mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
refactor: rename elementType to activeTool and make it an object (#4968)
* refactor: rename elementType to activeTool * update docs * fix snap * update activeToll to be an object and review fixes * fix tests * fix
This commit is contained in:
parent
2209e2c1e8
commit
127af9db23
25 changed files with 364 additions and 207 deletions
|
@ -2,6 +2,9 @@
|
|||
|
||||
exports[`contextMenu element selecting 'Add to library' in context menu adds element to library: [end of test] appState 1`] = `
|
||||
Object {
|
||||
"activeTool": Object {
|
||||
"type": "selection",
|
||||
},
|
||||
"collaborators": Map {},
|
||||
"currentChartType": "bar",
|
||||
"currentItemBackgroundColor": "transparent",
|
||||
|
@ -24,7 +27,6 @@ Object {
|
|||
"editingGroupId": null,
|
||||
"editingLinearElement": null,
|
||||
"elementLocked": false,
|
||||
"elementType": "selection",
|
||||
"errorMessage": null,
|
||||
"exportBackground": true,
|
||||
"exportEmbedScene": false,
|
||||
|
@ -173,6 +175,9 @@ exports[`contextMenu element selecting 'Add to library' in context menu adds ele
|
|||
|
||||
exports[`contextMenu element selecting 'Bring forward' in context menu brings element forward: [end of test] appState 1`] = `
|
||||
Object {
|
||||
"activeTool": Object {
|
||||
"type": "selection",
|
||||
},
|
||||
"collaborators": Map {},
|
||||
"currentChartType": "bar",
|
||||
"currentItemBackgroundColor": "transparent",
|
||||
|
@ -195,7 +200,6 @@ Object {
|
|||
"editingGroupId": null,
|
||||
"editingLinearElement": null,
|
||||
"elementLocked": false,
|
||||
"elementType": "selection",
|
||||
"errorMessage": null,
|
||||
"exportBackground": true,
|
||||
"exportEmbedScene": false,
|
||||
|
@ -500,6 +504,9 @@ exports[`contextMenu element selecting 'Bring forward' in context menu brings el
|
|||
|
||||
exports[`contextMenu element selecting 'Bring to front' in context menu brings element to front: [end of test] appState 1`] = `
|
||||
Object {
|
||||
"activeTool": Object {
|
||||
"type": "selection",
|
||||
},
|
||||
"collaborators": Map {},
|
||||
"currentChartType": "bar",
|
||||
"currentItemBackgroundColor": "transparent",
|
||||
|
@ -522,7 +529,6 @@ Object {
|
|||
"editingGroupId": null,
|
||||
"editingLinearElement": null,
|
||||
"elementLocked": false,
|
||||
"elementType": "selection",
|
||||
"errorMessage": null,
|
||||
"exportBackground": true,
|
||||
"exportEmbedScene": false,
|
||||
|
@ -827,6 +833,9 @@ exports[`contextMenu element selecting 'Bring to front' in context menu brings e
|
|||
|
||||
exports[`contextMenu element selecting 'Copy styles' in context menu copies styles: [end of test] appState 1`] = `
|
||||
Object {
|
||||
"activeTool": Object {
|
||||
"type": "selection",
|
||||
},
|
||||
"collaborators": Map {},
|
||||
"currentChartType": "bar",
|
||||
"currentItemBackgroundColor": "transparent",
|
||||
|
@ -849,7 +858,6 @@ Object {
|
|||
"editingGroupId": null,
|
||||
"editingLinearElement": null,
|
||||
"elementLocked": false,
|
||||
"elementType": "selection",
|
||||
"errorMessage": null,
|
||||
"exportBackground": true,
|
||||
"exportEmbedScene": false,
|
||||
|
@ -998,6 +1006,9 @@ exports[`contextMenu element selecting 'Copy styles' in context menu copies styl
|
|||
|
||||
exports[`contextMenu element selecting 'Delete' in context menu deletes element: [end of test] appState 1`] = `
|
||||
Object {
|
||||
"activeTool": Object {
|
||||
"type": "selection",
|
||||
},
|
||||
"collaborators": Map {},
|
||||
"currentChartType": "bar",
|
||||
"currentItemBackgroundColor": "transparent",
|
||||
|
@ -1020,7 +1031,6 @@ Object {
|
|||
"editingGroupId": null,
|
||||
"editingLinearElement": null,
|
||||
"elementLocked": false,
|
||||
"elementType": "selection",
|
||||
"errorMessage": null,
|
||||
"exportBackground": true,
|
||||
"exportEmbedScene": false,
|
||||
|
@ -1204,6 +1214,9 @@ exports[`contextMenu element selecting 'Delete' in context menu deletes element:
|
|||
|
||||
exports[`contextMenu element selecting 'Duplicate' in context menu duplicates element: [end of test] appState 1`] = `
|
||||
Object {
|
||||
"activeTool": Object {
|
||||
"type": "selection",
|
||||
},
|
||||
"collaborators": Map {},
|
||||
"currentChartType": "bar",
|
||||
"currentItemBackgroundColor": "transparent",
|
||||
|
@ -1226,7 +1239,6 @@ Object {
|
|||
"editingGroupId": null,
|
||||
"editingLinearElement": null,
|
||||
"elementLocked": false,
|
||||
"elementType": "selection",
|
||||
"errorMessage": null,
|
||||
"exportBackground": true,
|
||||
"exportEmbedScene": false,
|
||||
|
@ -1467,6 +1479,9 @@ exports[`contextMenu element selecting 'Duplicate' in context menu duplicates el
|
|||
|
||||
exports[`contextMenu element selecting 'Group selection' in context menu groups selected elements: [end of test] appState 1`] = `
|
||||
Object {
|
||||
"activeTool": Object {
|
||||
"type": "selection",
|
||||
},
|
||||
"collaborators": Map {},
|
||||
"currentChartType": "bar",
|
||||
"currentItemBackgroundColor": "transparent",
|
||||
|
@ -1489,7 +1504,6 @@ Object {
|
|||
"editingGroupId": null,
|
||||
"editingLinearElement": null,
|
||||
"elementLocked": false,
|
||||
"elementType": "selection",
|
||||
"errorMessage": null,
|
||||
"exportBackground": true,
|
||||
"exportEmbedScene": false,
|
||||
|
@ -1812,6 +1826,9 @@ exports[`contextMenu element selecting 'Group selection' in context menu groups
|
|||
|
||||
exports[`contextMenu element selecting 'Paste styles' in context menu pastes styles: [end of test] appState 1`] = `
|
||||
Object {
|
||||
"activeTool": Object {
|
||||
"type": "selection",
|
||||
},
|
||||
"collaborators": Map {},
|
||||
"currentChartType": "bar",
|
||||
"currentItemBackgroundColor": "#e64980",
|
||||
|
@ -1834,7 +1851,6 @@ Object {
|
|||
"editingGroupId": null,
|
||||
"editingLinearElement": null,
|
||||
"elementLocked": false,
|
||||
"elementType": "selection",
|
||||
"errorMessage": null,
|
||||
"exportBackground": true,
|
||||
"exportEmbedScene": false,
|
||||
|
@ -2587,6 +2603,9 @@ exports[`contextMenu element selecting 'Paste styles' in context menu pastes sty
|
|||
|
||||
exports[`contextMenu element selecting 'Send backward' in context menu sends element backward: [end of test] appState 1`] = `
|
||||
Object {
|
||||
"activeTool": Object {
|
||||
"type": "selection",
|
||||
},
|
||||
"collaborators": Map {},
|
||||
"currentChartType": "bar",
|
||||
"currentItemBackgroundColor": "transparent",
|
||||
|
@ -2609,7 +2628,6 @@ Object {
|
|||
"editingGroupId": null,
|
||||
"editingLinearElement": null,
|
||||
"elementLocked": false,
|
||||
"elementType": "selection",
|
||||
"errorMessage": null,
|
||||
"exportBackground": true,
|
||||
"exportEmbedScene": false,
|
||||
|
@ -2914,6 +2932,9 @@ exports[`contextMenu element selecting 'Send backward' in context menu sends ele
|
|||
|
||||
exports[`contextMenu element selecting 'Send to back' in context menu sends element to back: [end of test] appState 1`] = `
|
||||
Object {
|
||||
"activeTool": Object {
|
||||
"type": "selection",
|
||||
},
|
||||
"collaborators": Map {},
|
||||
"currentChartType": "bar",
|
||||
"currentItemBackgroundColor": "transparent",
|
||||
|
@ -2936,7 +2957,6 @@ Object {
|
|||
"editingGroupId": null,
|
||||
"editingLinearElement": null,
|
||||
"elementLocked": false,
|
||||
"elementType": "selection",
|
||||
"errorMessage": null,
|
||||
"exportBackground": true,
|
||||
"exportEmbedScene": false,
|
||||
|
@ -3241,6 +3261,9 @@ exports[`contextMenu element selecting 'Send to back' in context menu sends elem
|
|||
|
||||
exports[`contextMenu element selecting 'Ungroup selection' in context menu ungroups selected group: [end of test] appState 1`] = `
|
||||
Object {
|
||||
"activeTool": Object {
|
||||
"type": "selection",
|
||||
},
|
||||
"collaborators": Map {},
|
||||
"currentChartType": "bar",
|
||||
"currentItemBackgroundColor": "transparent",
|
||||
|
@ -3263,7 +3286,6 @@ Object {
|
|||
"editingGroupId": null,
|
||||
"editingLinearElement": null,
|
||||
"elementLocked": false,
|
||||
"elementType": "selection",
|
||||
"errorMessage": null,
|
||||
"exportBackground": true,
|
||||
"exportEmbedScene": false,
|
||||
|
@ -3646,6 +3668,9 @@ exports[`contextMenu element selecting 'Ungroup selection' in context menu ungro
|
|||
|
||||
exports[`contextMenu element shows 'Group selection' in context menu for multiple selected elements: [end of test] appState 1`] = `
|
||||
Object {
|
||||
"activeTool": Object {
|
||||
"type": "selection",
|
||||
},
|
||||
"collaborators": Map {},
|
||||
"currentChartType": "bar",
|
||||
"currentItemBackgroundColor": "transparent",
|
||||
|
@ -3668,7 +3693,6 @@ Object {
|
|||
"editingGroupId": null,
|
||||
"editingLinearElement": null,
|
||||
"elementLocked": false,
|
||||
"elementType": "selection",
|
||||
"errorMessage": null,
|
||||
"exportBackground": true,
|
||||
"exportEmbedScene": false,
|
||||
|
@ -3915,6 +3939,9 @@ exports[`contextMenu element shows 'Group selection' in context menu for multipl
|
|||
|
||||
exports[`contextMenu element shows 'Ungroup selection' in context menu for group inside selected elements: [end of test] appState 1`] = `
|
||||
Object {
|
||||
"activeTool": Object {
|
||||
"type": "selection",
|
||||
},
|
||||
"collaborators": Map {},
|
||||
"currentChartType": "bar",
|
||||
"currentItemBackgroundColor": "transparent",
|
||||
|
@ -3937,7 +3964,6 @@ Object {
|
|||
"editingGroupId": null,
|
||||
"editingLinearElement": null,
|
||||
"elementLocked": false,
|
||||
"elementType": "selection",
|
||||
"errorMessage": null,
|
||||
"exportBackground": true,
|
||||
"exportEmbedScene": false,
|
||||
|
@ -4263,6 +4289,9 @@ exports[`contextMenu element shows 'Ungroup selection' in context menu for group
|
|||
|
||||
exports[`contextMenu element shows context menu for canvas: [end of test] appState 1`] = `
|
||||
Object {
|
||||
"activeTool": Object {
|
||||
"type": "selection",
|
||||
},
|
||||
"collaborators": Map {},
|
||||
"currentChartType": "bar",
|
||||
"currentItemBackgroundColor": "transparent",
|
||||
|
@ -4285,7 +4314,6 @@ Object {
|
|||
"editingGroupId": null,
|
||||
"editingLinearElement": null,
|
||||
"elementLocked": false,
|
||||
"elementType": "selection",
|
||||
"errorMessage": null,
|
||||
"exportBackground": true,
|
||||
"exportEmbedScene": false,
|
||||
|
@ -4365,6 +4393,9 @@ exports[`contextMenu element shows context menu for canvas: [end of test] number
|
|||
|
||||
exports[`contextMenu element shows context menu for element: [end of test] appState 1`] = `
|
||||
Object {
|
||||
"activeTool": Object {
|
||||
"type": "selection",
|
||||
},
|
||||
"collaborators": Map {},
|
||||
"currentChartType": "bar",
|
||||
"currentItemBackgroundColor": "transparent",
|
||||
|
@ -4387,7 +4418,6 @@ Object {
|
|||
"editingGroupId": null,
|
||||
"editingLinearElement": null,
|
||||
"elementLocked": false,
|
||||
"elementType": "selection",
|
||||
"errorMessage": null,
|
||||
"exportBackground": true,
|
||||
"exportEmbedScene": false,
|
||||
|
@ -4445,6 +4475,9 @@ Object {
|
|||
|
||||
exports[`contextMenu element shows context menu for element: [end of test] appState 2`] = `
|
||||
Object {
|
||||
"activeTool": Object {
|
||||
"type": "selection",
|
||||
},
|
||||
"collaborators": Map {},
|
||||
"currentChartType": "bar",
|
||||
"currentItemBackgroundColor": "transparent",
|
||||
|
@ -4467,7 +4500,6 @@ Object {
|
|||
"editingGroupId": null,
|
||||
"editingLinearElement": null,
|
||||
"elementLocked": false,
|
||||
"elementType": "selection",
|
||||
"errorMessage": null,
|
||||
"exportBackground": true,
|
||||
"exportEmbedScene": false,
|
||||
|
@ -4692,4 +4724,4 @@ exports[`contextMenu element shows context menu for element: [end of test] numbe
|
|||
|
||||
exports[`contextMenu element shows context menu for element: [end of test] number of renders 1`] = `9`;
|
||||
|
||||
exports[`contextMenu element shows context menu for element: [end of test] number of renders 2`] = `6`;
|
||||
exports[`contextMenu element shows context menu for element: [end of test] number of renders 2`] = `6`;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue