@excalidraw/excalidraw 0.18.0-rc.5 → 0.18.0-rc.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -3
- package/dist/dev/{chunk-UGZAZPWM.js → chunk-GOAAUIXU.js} +13 -13
- package/dist/dev/{chunk-UGZAZPWM.js.map → chunk-GOAAUIXU.js.map} +2 -2
- package/dist/dev/data/{image-NQXTDRIN.js → image-HTHTIQHJ.js} +2 -2
- package/dist/dev/index.js +169 -144
- package/dist/dev/index.js.map +2 -2
- package/dist/prod/{chunk-44FFCT2W.js → chunk-J5HKV5GO.js} +14 -14
- package/dist/prod/data/{image-WYICPQ4X.js → image-FCYNPK35.js} +1 -1
- package/dist/prod/index.js +13 -13
- package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +3 -3
- package/dist/types/excalidraw/actions/actionAlign.d.ts +6 -6
- package/dist/types/excalidraw/actions/actionBoundText.d.ts +3 -3
- package/dist/types/excalidraw/actions/actionCanvas.d.ts +13 -13
- package/dist/types/excalidraw/actions/actionClipboard.d.ts +13 -13
- package/dist/types/excalidraw/actions/actionCropEditor.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +3 -3
- package/dist/types/excalidraw/actions/actionDistribute.d.ts +2 -2
- package/dist/types/excalidraw/actions/actionDuplicateSelection.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionElementLink.d.ts +4 -4
- package/dist/types/excalidraw/actions/actionElementLock.d.ts +2 -2
- package/dist/types/excalidraw/actions/actionExport.d.ts +11 -11
- package/dist/types/excalidraw/actions/actionFinalize.d.ts +2 -2
- package/dist/types/excalidraw/actions/actionFlip.d.ts +2 -2
- package/dist/types/excalidraw/actions/actionFrame.d.ts +7 -7
- package/dist/types/excalidraw/actions/actionGroup.d.ts +4 -4
- package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionLink.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionMenu.d.ts +3 -3
- package/dist/types/excalidraw/actions/actionNavigate.d.ts +2 -2
- package/dist/types/excalidraw/actions/actionProperties.d.ts +15 -15
- package/dist/types/excalidraw/actions/actionSelectAll.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionStyles.d.ts +3 -3
- package/dist/types/excalidraw/actions/actionTextAutoResize.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +2 -2
- package/dist/types/excalidraw/actions/actionToggleStats.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionZindex.d.ts +4 -4
- package/dist/types/excalidraw/actions/types.d.ts +2 -2
- package/dist/types/excalidraw/components/App.d.ts +12 -2
- package/dist/types/excalidraw/element/embeddable.d.ts +1 -1
- package/dist/types/excalidraw/index.d.ts +1 -1
- package/dist/types/excalidraw/store.d.ts +6 -6
- package/dist/types/excalidraw/types.d.ts +2 -2
- package/package.json +1 -10
- /package/dist/dev/data/{image-NQXTDRIN.js.map → image-HTHTIQHJ.js.map} +0 -0
package/dist/dev/index.js
CHANGED
|
@@ -33,6 +33,7 @@ import {
|
|
|
33
33
|
COLOR_VOICE_CALL,
|
|
34
34
|
COLOR_WHITE,
|
|
35
35
|
CURSOR_TYPE,
|
|
36
|
+
CaptureUpdateAction,
|
|
36
37
|
CenterHorizontallyIcon,
|
|
37
38
|
CenterVerticallyIcon,
|
|
38
39
|
CloseIcon,
|
|
@@ -151,7 +152,6 @@ import {
|
|
|
151
152
|
SloppinessCartoonistIcon,
|
|
152
153
|
SnapCache,
|
|
153
154
|
Store,
|
|
154
|
-
StoreAction,
|
|
155
155
|
StrokeStyleDashedIcon,
|
|
156
156
|
StrokeStyleDottedIcon,
|
|
157
157
|
StrokeWidthBaseIcon,
|
|
@@ -618,7 +618,7 @@ import {
|
|
|
618
618
|
wrapText,
|
|
619
619
|
youtubeIcon,
|
|
620
620
|
zoomAreaIcon
|
|
621
|
-
} from "./chunk-
|
|
621
|
+
} from "./chunk-GOAAUIXU.js";
|
|
622
622
|
import {
|
|
623
623
|
define_import_meta_env_default
|
|
624
624
|
} from "./chunk-TLD3FD3P.js";
|
|
@@ -1233,7 +1233,7 @@ var actionDeleteSelected = register({
|
|
|
1233
1233
|
...nextAppState2,
|
|
1234
1234
|
editingLinearElement: null
|
|
1235
1235
|
},
|
|
1236
|
-
|
|
1236
|
+
captureUpdate: CaptureUpdateAction.IMMEDIATELY
|
|
1237
1237
|
};
|
|
1238
1238
|
}
|
|
1239
1239
|
const binding = {
|
|
@@ -1253,7 +1253,7 @@ var actionDeleteSelected = register({
|
|
|
1253
1253
|
selectedPointsIndices: selectedPointsIndices?.[0] > 0 ? [selectedPointsIndices[0] - 1] : [0]
|
|
1254
1254
|
}
|
|
1255
1255
|
},
|
|
1256
|
-
|
|
1256
|
+
captureUpdate: CaptureUpdateAction.IMMEDIATELY
|
|
1257
1257
|
};
|
|
1258
1258
|
}
|
|
1259
1259
|
let { elements: nextElements, appState: nextAppState } = deleteSelectedElements(elements, appState, app);
|
|
@@ -1270,10 +1270,10 @@ var actionDeleteSelected = register({
|
|
|
1270
1270
|
multiElement: null,
|
|
1271
1271
|
activeEmbeddable: null
|
|
1272
1272
|
},
|
|
1273
|
-
|
|
1273
|
+
captureUpdate: isSomeElementSelected(
|
|
1274
1274
|
getNonDeletedElements(elements),
|
|
1275
1275
|
appState
|
|
1276
|
-
) ?
|
|
1276
|
+
) ? CaptureUpdateAction.IMMEDIATELY : CaptureUpdateAction.EVENTUALLY
|
|
1277
1277
|
};
|
|
1278
1278
|
},
|
|
1279
1279
|
keyTest: (event, appState, elements) => (event.key === KEYS.BACKSPACE || event.key === KEYS.DELETE) && !event[KEYS.CTRL_OR_CMD],
|
|
@@ -1645,7 +1645,7 @@ var actionSendBackward = register({
|
|
|
1645
1645
|
return {
|
|
1646
1646
|
elements: moveOneLeft(elements, appState),
|
|
1647
1647
|
appState,
|
|
1648
|
-
|
|
1648
|
+
captureUpdate: CaptureUpdateAction.IMMEDIATELY
|
|
1649
1649
|
};
|
|
1650
1650
|
},
|
|
1651
1651
|
keyPriority: 40,
|
|
@@ -1671,7 +1671,7 @@ var actionBringForward = register({
|
|
|
1671
1671
|
return {
|
|
1672
1672
|
elements: moveOneRight(elements, appState),
|
|
1673
1673
|
appState,
|
|
1674
|
-
|
|
1674
|
+
captureUpdate: CaptureUpdateAction.IMMEDIATELY
|
|
1675
1675
|
};
|
|
1676
1676
|
},
|
|
1677
1677
|
keyPriority: 40,
|
|
@@ -1697,7 +1697,7 @@ var actionSendToBack = register({
|
|
|
1697
1697
|
return {
|
|
1698
1698
|
elements: moveAllLeft(elements, appState),
|
|
1699
1699
|
appState,
|
|
1700
|
-
|
|
1700
|
+
captureUpdate: CaptureUpdateAction.IMMEDIATELY
|
|
1701
1701
|
};
|
|
1702
1702
|
},
|
|
1703
1703
|
keyTest: (event) => isDarwin ? event[KEYS.CTRL_OR_CMD] && event.altKey && event.code === CODES.BRACKET_LEFT : event[KEYS.CTRL_OR_CMD] && event.shiftKey && event.code === CODES.BRACKET_LEFT,
|
|
@@ -1722,7 +1722,7 @@ var actionBringToFront = register({
|
|
|
1722
1722
|
return {
|
|
1723
1723
|
elements: moveAllRight(elements, appState),
|
|
1724
1724
|
appState,
|
|
1725
|
-
|
|
1725
|
+
captureUpdate: CaptureUpdateAction.IMMEDIATELY
|
|
1726
1726
|
};
|
|
1727
1727
|
},
|
|
1728
1728
|
keyTest: (event) => isDarwin ? event[KEYS.CTRL_OR_CMD] && event.altKey && event.code === CODES.BRACKET_RIGHT : event[KEYS.CTRL_OR_CMD] && event.shiftKey && event.code === CODES.BRACKET_RIGHT,
|
|
@@ -1772,7 +1772,7 @@ var actionSelectAll = register({
|
|
|
1772
1772
|
Object.keys(selectedElementIds).length === 1 && isLinearElement(elements[0]) ? new LinearElementEditor(elements[0]) : null
|
|
1773
1773
|
)
|
|
1774
1774
|
},
|
|
1775
|
-
|
|
1775
|
+
captureUpdate: CaptureUpdateAction.IMMEDIATELY
|
|
1776
1776
|
};
|
|
1777
1777
|
},
|
|
1778
1778
|
keyTest: (event) => event[KEYS.CTRL_OR_CMD] && event.key === KEYS.A
|
|
@@ -1880,7 +1880,7 @@ var actionDuplicateSelection = register({
|
|
|
1880
1880
|
return {
|
|
1881
1881
|
elements,
|
|
1882
1882
|
appState: newAppState,
|
|
1883
|
-
|
|
1883
|
+
captureUpdate: CaptureUpdateAction.IMMEDIATELY
|
|
1884
1884
|
};
|
|
1885
1885
|
} catch {
|
|
1886
1886
|
return false;
|
|
@@ -1898,7 +1898,7 @@ var actionDuplicateSelection = register({
|
|
|
1898
1898
|
}
|
|
1899
1899
|
return {
|
|
1900
1900
|
...nextState,
|
|
1901
|
-
|
|
1901
|
+
captureUpdate: CaptureUpdateAction.IMMEDIATELY
|
|
1902
1902
|
};
|
|
1903
1903
|
},
|
|
1904
1904
|
keyTest: (event) => event[KEYS.CTRL_OR_CMD] && event.key === KEYS.D,
|
|
@@ -4361,7 +4361,7 @@ var changeFontSize = (elements, appState, app, getNewFontSize, fallbackValue) =>
|
|
|
4361
4361
|
// the same font size
|
|
4362
4362
|
currentItemFontSize: newFontSizes.size === 1 ? [...newFontSizes][0] : fallbackValue ?? appState.currentItemFontSize
|
|
4363
4363
|
},
|
|
4364
|
-
|
|
4364
|
+
captureUpdate: CaptureUpdateAction.IMMEDIATELY
|
|
4365
4365
|
};
|
|
4366
4366
|
};
|
|
4367
4367
|
var actionChangeStrokeColor = register({
|
|
@@ -4386,7 +4386,7 @@ var actionChangeStrokeColor = register({
|
|
|
4386
4386
|
...appState,
|
|
4387
4387
|
...value
|
|
4388
4388
|
},
|
|
4389
|
-
|
|
4389
|
+
captureUpdate: !!value.currentItemStrokeColor ? CaptureUpdateAction.IMMEDIATELY : CaptureUpdateAction.EVENTUALLY
|
|
4390
4390
|
};
|
|
4391
4391
|
},
|
|
4392
4392
|
PanelComponent: ({ elements, appState, updateData, appProps }) => /* @__PURE__ */ jsxs20(Fragment4, { children: [
|
|
@@ -4432,7 +4432,7 @@ var actionChangeBackgroundColor = register({
|
|
|
4432
4432
|
...appState,
|
|
4433
4433
|
...value
|
|
4434
4434
|
},
|
|
4435
|
-
|
|
4435
|
+
captureUpdate: !!value.currentItemBackgroundColor ? CaptureUpdateAction.IMMEDIATELY : CaptureUpdateAction.EVENTUALLY
|
|
4436
4436
|
};
|
|
4437
4437
|
},
|
|
4438
4438
|
PanelComponent: ({ elements, appState, updateData, appProps }) => /* @__PURE__ */ jsxs20(Fragment4, { children: [
|
|
@@ -4478,7 +4478,7 @@ var actionChangeFillStyle = register({
|
|
|
4478
4478
|
})
|
|
4479
4479
|
),
|
|
4480
4480
|
appState: { ...appState, currentItemFillStyle: value },
|
|
4481
|
-
|
|
4481
|
+
captureUpdate: CaptureUpdateAction.IMMEDIATELY
|
|
4482
4482
|
};
|
|
4483
4483
|
},
|
|
4484
4484
|
PanelComponent: ({ elements, appState, updateData }) => {
|
|
@@ -4541,7 +4541,7 @@ var actionChangeStrokeWidth = register({
|
|
|
4541
4541
|
})
|
|
4542
4542
|
),
|
|
4543
4543
|
appState: { ...appState, currentItemStrokeWidth: value },
|
|
4544
|
-
|
|
4544
|
+
captureUpdate: CaptureUpdateAction.IMMEDIATELY
|
|
4545
4545
|
};
|
|
4546
4546
|
},
|
|
4547
4547
|
PanelComponent: ({ elements, appState, updateData }) => /* @__PURE__ */ jsxs20("fieldset", { children: [
|
|
@@ -4597,7 +4597,7 @@ var actionChangeSloppiness = register({
|
|
|
4597
4597
|
})
|
|
4598
4598
|
),
|
|
4599
4599
|
appState: { ...appState, currentItemRoughness: value },
|
|
4600
|
-
|
|
4600
|
+
captureUpdate: CaptureUpdateAction.IMMEDIATELY
|
|
4601
4601
|
};
|
|
4602
4602
|
},
|
|
4603
4603
|
PanelComponent: ({ elements, appState, updateData }) => /* @__PURE__ */ jsxs20("fieldset", { children: [
|
|
@@ -4649,7 +4649,7 @@ var actionChangeStrokeStyle = register({
|
|
|
4649
4649
|
})
|
|
4650
4650
|
),
|
|
4651
4651
|
appState: { ...appState, currentItemStrokeStyle: value },
|
|
4652
|
-
|
|
4652
|
+
captureUpdate: CaptureUpdateAction.IMMEDIATELY
|
|
4653
4653
|
};
|
|
4654
4654
|
},
|
|
4655
4655
|
PanelComponent: ({ elements, appState, updateData }) => /* @__PURE__ */ jsxs20("fieldset", { children: [
|
|
@@ -4702,7 +4702,7 @@ var actionChangeOpacity = register({
|
|
|
4702
4702
|
true
|
|
4703
4703
|
),
|
|
4704
4704
|
appState: { ...appState, currentItemOpacity: value },
|
|
4705
|
-
|
|
4705
|
+
captureUpdate: CaptureUpdateAction.IMMEDIATELY
|
|
4706
4706
|
};
|
|
4707
4707
|
},
|
|
4708
4708
|
PanelComponent: ({ elements, appState, updateData }) => /* @__PURE__ */ jsx34(
|
|
@@ -4849,19 +4849,19 @@ var actionChangeFontFamily = register({
|
|
|
4849
4849
|
...appState,
|
|
4850
4850
|
...nextAppState
|
|
4851
4851
|
},
|
|
4852
|
-
|
|
4852
|
+
captureUpdate: CaptureUpdateAction.NEVER
|
|
4853
4853
|
};
|
|
4854
4854
|
}
|
|
4855
4855
|
const { currentItemFontFamily, currentHoveredFontFamily } = value;
|
|
4856
|
-
let
|
|
4856
|
+
let nextCaptureUpdateAction = CaptureUpdateAction.EVENTUALLY;
|
|
4857
4857
|
let nextFontFamily;
|
|
4858
4858
|
let skipOnHoverRender = false;
|
|
4859
4859
|
if (currentItemFontFamily) {
|
|
4860
4860
|
nextFontFamily = currentItemFontFamily;
|
|
4861
|
-
|
|
4861
|
+
nextCaptureUpdateAction = CaptureUpdateAction.IMMEDIATELY;
|
|
4862
4862
|
} else if (currentHoveredFontFamily) {
|
|
4863
4863
|
nextFontFamily = currentHoveredFontFamily;
|
|
4864
|
-
|
|
4864
|
+
nextCaptureUpdateAction = CaptureUpdateAction.EVENTUALLY;
|
|
4865
4865
|
const selectedTextElements = getSelectedElements(elements, appState, {
|
|
4866
4866
|
includeBoundTextElement: true
|
|
4867
4867
|
}).filter((element) => isTextElement(element));
|
|
@@ -4885,7 +4885,7 @@ var actionChangeFontFamily = register({
|
|
|
4885
4885
|
...appState,
|
|
4886
4886
|
...nextAppState
|
|
4887
4887
|
},
|
|
4888
|
-
|
|
4888
|
+
captureUpdate: nextCaptureUpdateAction
|
|
4889
4889
|
};
|
|
4890
4890
|
if (nextFontFamily && !skipOnHoverRender) {
|
|
4891
4891
|
const elementContainerMapping = /* @__PURE__ */ new Map();
|
|
@@ -5125,7 +5125,7 @@ var actionChangeTextAlign = register({
|
|
|
5125
5125
|
...appState,
|
|
5126
5126
|
currentItemTextAlign: value
|
|
5127
5127
|
},
|
|
5128
|
-
|
|
5128
|
+
captureUpdate: CaptureUpdateAction.IMMEDIATELY
|
|
5129
5129
|
};
|
|
5130
5130
|
},
|
|
5131
5131
|
PanelComponent: ({ elements, appState, updateData, app }) => {
|
|
@@ -5210,7 +5210,7 @@ var actionChangeVerticalAlign = register({
|
|
|
5210
5210
|
appState: {
|
|
5211
5211
|
...appState
|
|
5212
5212
|
},
|
|
5213
|
-
|
|
5213
|
+
captureUpdate: CaptureUpdateAction.IMMEDIATELY
|
|
5214
5214
|
};
|
|
5215
5215
|
},
|
|
5216
5216
|
PanelComponent: ({ elements, appState, updateData, app }) => {
|
|
@@ -5285,7 +5285,7 @@ var actionChangeRoundness = register({
|
|
|
5285
5285
|
...appState,
|
|
5286
5286
|
currentItemRoundness: value
|
|
5287
5287
|
},
|
|
5288
|
-
|
|
5288
|
+
captureUpdate: CaptureUpdateAction.IMMEDIATELY
|
|
5289
5289
|
};
|
|
5290
5290
|
},
|
|
5291
5291
|
PanelComponent: ({ elements, appState, updateData }) => {
|
|
@@ -5430,7 +5430,7 @@ var actionChangeArrowhead = register({
|
|
|
5430
5430
|
...appState,
|
|
5431
5431
|
[value.position === "start" ? "currentItemStartArrowhead" : "currentItemEndArrowhead"]: value.type
|
|
5432
5432
|
},
|
|
5433
|
-
|
|
5433
|
+
captureUpdate: CaptureUpdateAction.IMMEDIATELY
|
|
5434
5434
|
};
|
|
5435
5435
|
},
|
|
5436
5436
|
PanelComponent: ({ elements, appState, updateData }) => {
|
|
@@ -5596,7 +5596,7 @@ var actionChangeArrowType = register({
|
|
|
5596
5596
|
return {
|
|
5597
5597
|
elements: newElements,
|
|
5598
5598
|
appState: newState,
|
|
5599
|
-
|
|
5599
|
+
captureUpdate: CaptureUpdateAction.IMMEDIATELY
|
|
5600
5600
|
};
|
|
5601
5601
|
},
|
|
5602
5602
|
PanelComponent: ({ elements, appState, updateData }) => {
|
|
@@ -5761,7 +5761,7 @@ var actionChangeViewBackgroundColor = register({
|
|
|
5761
5761
|
perform: (_, appState, value) => {
|
|
5762
5762
|
return {
|
|
5763
5763
|
appState: { ...appState, ...value },
|
|
5764
|
-
|
|
5764
|
+
captureUpdate: !!value.viewBackgroundColor ? CaptureUpdateAction.IMMEDIATELY : CaptureUpdateAction.EVENTUALLY
|
|
5765
5765
|
};
|
|
5766
5766
|
},
|
|
5767
5767
|
PanelComponent: ({ elements, appState, updateData, appProps }) => {
|
|
@@ -5812,7 +5812,7 @@ var actionClearCanvas = register({
|
|
|
5812
5812
|
pasteDialog: appState.pasteDialog,
|
|
5813
5813
|
activeTool: appState.activeTool.type === "image" ? { ...appState.activeTool, type: "selection" } : appState.activeTool
|
|
5814
5814
|
},
|
|
5815
|
-
|
|
5815
|
+
captureUpdate: CaptureUpdateAction.IMMEDIATELY
|
|
5816
5816
|
};
|
|
5817
5817
|
}
|
|
5818
5818
|
});
|
|
@@ -5836,7 +5836,7 @@ var actionZoomIn = register({
|
|
|
5836
5836
|
),
|
|
5837
5837
|
userToFollow: null
|
|
5838
5838
|
},
|
|
5839
|
-
|
|
5839
|
+
captureUpdate: CaptureUpdateAction.EVENTUALLY
|
|
5840
5840
|
};
|
|
5841
5841
|
},
|
|
5842
5842
|
PanelComponent: ({ updateData, appState }) => /* @__PURE__ */ jsx36(
|
|
@@ -5875,7 +5875,7 @@ var actionZoomOut = register({
|
|
|
5875
5875
|
),
|
|
5876
5876
|
userToFollow: null
|
|
5877
5877
|
},
|
|
5878
|
-
|
|
5878
|
+
captureUpdate: CaptureUpdateAction.EVENTUALLY
|
|
5879
5879
|
};
|
|
5880
5880
|
},
|
|
5881
5881
|
PanelComponent: ({ updateData, appState }) => /* @__PURE__ */ jsx36(
|
|
@@ -5914,7 +5914,7 @@ var actionResetZoom = register({
|
|
|
5914
5914
|
),
|
|
5915
5915
|
userToFollow: null
|
|
5916
5916
|
},
|
|
5917
|
-
|
|
5917
|
+
captureUpdate: CaptureUpdateAction.EVENTUALLY
|
|
5918
5918
|
};
|
|
5919
5919
|
},
|
|
5920
5920
|
PanelComponent: ({ updateData, appState }) => /* @__PURE__ */ jsx36(Tooltip, { label: t("buttons.resetZoom"), style: { height: "100%" }, children: /* @__PURE__ */ jsxs21(
|
|
@@ -6001,7 +6001,7 @@ var zoomToFitBounds = ({
|
|
|
6001
6001
|
scrollY: centerScroll.scrollY,
|
|
6002
6002
|
zoom: { value: newZoomValue }
|
|
6003
6003
|
},
|
|
6004
|
-
|
|
6004
|
+
captureUpdate: CaptureUpdateAction.EVENTUALLY
|
|
6005
6005
|
};
|
|
6006
6006
|
};
|
|
6007
6007
|
var zoomToFit = ({
|
|
@@ -6097,7 +6097,7 @@ var actionToggleTheme = register({
|
|
|
6097
6097
|
...appState,
|
|
6098
6098
|
theme: value || (appState.theme === THEME.LIGHT ? THEME.DARK : THEME.LIGHT)
|
|
6099
6099
|
},
|
|
6100
|
-
|
|
6100
|
+
captureUpdate: CaptureUpdateAction.EVENTUALLY
|
|
6101
6101
|
};
|
|
6102
6102
|
},
|
|
6103
6103
|
keyTest: (event) => event.altKey && event.shiftKey && event.code === CODES.D,
|
|
@@ -6132,7 +6132,7 @@ var actionToggleEraserTool = register({
|
|
|
6132
6132
|
activeEmbeddable: null,
|
|
6133
6133
|
activeTool
|
|
6134
6134
|
},
|
|
6135
|
-
|
|
6135
|
+
captureUpdate: CaptureUpdateAction.IMMEDIATELY
|
|
6136
6136
|
};
|
|
6137
6137
|
},
|
|
6138
6138
|
keyTest: (event) => event.key === KEYS.E
|
|
@@ -6168,7 +6168,7 @@ var actionToggleHandTool = register({
|
|
|
6168
6168
|
activeEmbeddable: null,
|
|
6169
6169
|
activeTool
|
|
6170
6170
|
},
|
|
6171
|
-
|
|
6171
|
+
captureUpdate: CaptureUpdateAction.IMMEDIATELY
|
|
6172
6172
|
};
|
|
6173
6173
|
},
|
|
6174
6174
|
keyTest: (event) => !event.altKey && !event[KEYS.CTRL_OR_CMD] && event.key === KEYS.H
|
|
@@ -6203,7 +6203,7 @@ var actionFinalize = register({
|
|
|
6203
6203
|
cursorButton: "up",
|
|
6204
6204
|
editingLinearElement: null
|
|
6205
6205
|
},
|
|
6206
|
-
|
|
6206
|
+
captureUpdate: CaptureUpdateAction.IMMEDIATELY
|
|
6207
6207
|
};
|
|
6208
6208
|
}
|
|
6209
6209
|
}
|
|
@@ -6295,7 +6295,7 @@ var actionFinalize = register({
|
|
|
6295
6295
|
pendingImageElementId: null
|
|
6296
6296
|
},
|
|
6297
6297
|
// TODO: #7348 we should not capture everything, but if we don't, it leads to incosistencies -> revisit
|
|
6298
|
-
|
|
6298
|
+
captureUpdate: CaptureUpdateAction.IMMEDIATELY
|
|
6299
6299
|
};
|
|
6300
6300
|
},
|
|
6301
6301
|
keyTest: (event, appState) => event.key === KEYS.ESCAPE && (appState.editingLinearElement !== null || !appState.newElement && appState.multiElement === null) || (event.key === KEYS.ESCAPE || event.key === KEYS.ENTER) && appState.multiElement !== null,
|
|
@@ -6478,7 +6478,7 @@ var exportCanvas = async (type, elements, appState, files, {
|
|
|
6478
6478
|
let blob = canvasToBlob(tempCanvas);
|
|
6479
6479
|
if (appState.exportEmbedScene) {
|
|
6480
6480
|
blob = blob.then(
|
|
6481
|
-
(blob2) => import("./data/image-
|
|
6481
|
+
(blob2) => import("./data/image-HTHTIQHJ.js").then(
|
|
6482
6482
|
({ encodePngMetadata }) => encodePngMetadata({
|
|
6483
6483
|
blob: blob2,
|
|
6484
6484
|
metadata: serializeAsJSON(elements, appState, files, "local")
|
|
@@ -6587,7 +6587,7 @@ var actionChangeProjectName = register({
|
|
|
6587
6587
|
perform: (_elements, appState, value) => {
|
|
6588
6588
|
return {
|
|
6589
6589
|
appState: { ...appState, name: value },
|
|
6590
|
-
|
|
6590
|
+
captureUpdate: CaptureUpdateAction.EVENTUALLY
|
|
6591
6591
|
};
|
|
6592
6592
|
},
|
|
6593
6593
|
PanelComponent: ({ appState, updateData, appProps, data, app }) => /* @__PURE__ */ jsx41(
|
|
@@ -6607,7 +6607,7 @@ var actionChangeExportScale = register({
|
|
|
6607
6607
|
perform: (_elements, appState, value) => {
|
|
6608
6608
|
return {
|
|
6609
6609
|
appState: { ...appState, exportScale: value },
|
|
6610
|
-
|
|
6610
|
+
captureUpdate: CaptureUpdateAction.EVENTUALLY
|
|
6611
6611
|
};
|
|
6612
6612
|
},
|
|
6613
6613
|
PanelComponent: ({ elements: allElements, appState, updateData }) => {
|
|
@@ -6648,7 +6648,7 @@ var actionChangeExportBackground = register({
|
|
|
6648
6648
|
perform: (_elements, appState, value) => {
|
|
6649
6649
|
return {
|
|
6650
6650
|
appState: { ...appState, exportBackground: value },
|
|
6651
|
-
|
|
6651
|
+
captureUpdate: CaptureUpdateAction.EVENTUALLY
|
|
6652
6652
|
};
|
|
6653
6653
|
},
|
|
6654
6654
|
PanelComponent: ({ appState, updateData }) => /* @__PURE__ */ jsx41(
|
|
@@ -6667,7 +6667,7 @@ var actionChangeExportEmbedScene = register({
|
|
|
6667
6667
|
perform: (_elements, appState, value) => {
|
|
6668
6668
|
return {
|
|
6669
6669
|
appState: { ...appState, exportEmbedScene: value },
|
|
6670
|
-
|
|
6670
|
+
captureUpdate: CaptureUpdateAction.EVENTUALLY
|
|
6671
6671
|
};
|
|
6672
6672
|
},
|
|
6673
6673
|
PanelComponent: ({ appState, updateData }) => /* @__PURE__ */ jsxs24(
|
|
@@ -6700,7 +6700,7 @@ var actionSaveToActiveFile = register({
|
|
|
6700
6700
|
app.getName()
|
|
6701
6701
|
) : await saveAsJSON(elements, appState, app.files, app.getName());
|
|
6702
6702
|
return {
|
|
6703
|
-
|
|
6703
|
+
captureUpdate: CaptureUpdateAction.EVENTUALLY,
|
|
6704
6704
|
appState: {
|
|
6705
6705
|
...appState,
|
|
6706
6706
|
fileHandle,
|
|
@@ -6718,7 +6718,7 @@ var actionSaveToActiveFile = register({
|
|
|
6718
6718
|
} else {
|
|
6719
6719
|
console.warn(error);
|
|
6720
6720
|
}
|
|
6721
|
-
return {
|
|
6721
|
+
return { captureUpdate: CaptureUpdateAction.EVENTUALLY };
|
|
6722
6722
|
}
|
|
6723
6723
|
},
|
|
6724
6724
|
keyTest: (event) => event.key === KEYS.S && event[KEYS.CTRL_OR_CMD] && !event.shiftKey
|
|
@@ -6741,7 +6741,7 @@ var actionSaveFileToDisk = register({
|
|
|
6741
6741
|
app.getName()
|
|
6742
6742
|
);
|
|
6743
6743
|
return {
|
|
6744
|
-
|
|
6744
|
+
captureUpdate: CaptureUpdateAction.EVENTUALLY,
|
|
6745
6745
|
appState: {
|
|
6746
6746
|
...appState,
|
|
6747
6747
|
openDialog: null,
|
|
@@ -6755,7 +6755,7 @@ var actionSaveFileToDisk = register({
|
|
|
6755
6755
|
} else {
|
|
6756
6756
|
console.warn(error);
|
|
6757
6757
|
}
|
|
6758
|
-
return {
|
|
6758
|
+
return { captureUpdate: CaptureUpdateAction.EVENTUALLY };
|
|
6759
6759
|
}
|
|
6760
6760
|
},
|
|
6761
6761
|
keyTest: (event) => event.key === KEYS.S && event.shiftKey && event[KEYS.CTRL_OR_CMD],
|
|
@@ -6791,7 +6791,7 @@ var actionLoadScene = register({
|
|
|
6791
6791
|
elements: loadedElements,
|
|
6792
6792
|
appState: loadedAppState,
|
|
6793
6793
|
files,
|
|
6794
|
-
|
|
6794
|
+
captureUpdate: CaptureUpdateAction.IMMEDIATELY
|
|
6795
6795
|
};
|
|
6796
6796
|
} catch (error) {
|
|
6797
6797
|
if (error?.name === "AbortError") {
|
|
@@ -6802,7 +6802,7 @@ var actionLoadScene = register({
|
|
|
6802
6802
|
elements,
|
|
6803
6803
|
appState: { ...appState, errorMessage: error.message },
|
|
6804
6804
|
files: app.files,
|
|
6805
|
-
|
|
6805
|
+
captureUpdate: CaptureUpdateAction.EVENTUALLY
|
|
6806
6806
|
};
|
|
6807
6807
|
}
|
|
6808
6808
|
},
|
|
@@ -6815,7 +6815,7 @@ var actionExportWithDarkMode = register({
|
|
|
6815
6815
|
perform: (_elements, appState, value) => {
|
|
6816
6816
|
return {
|
|
6817
6817
|
appState: { ...appState, exportWithDarkMode: value },
|
|
6818
|
-
|
|
6818
|
+
captureUpdate: CaptureUpdateAction.EVENTUALLY
|
|
6819
6819
|
};
|
|
6820
6820
|
},
|
|
6821
6821
|
PanelComponent: ({ appState, updateData }) => /* @__PURE__ */ jsx41(
|
|
@@ -6867,7 +6867,7 @@ var actionCopyStyles = register({
|
|
|
6867
6867
|
...appState,
|
|
6868
6868
|
toast: { message: t("toast.copyStyles") }
|
|
6869
6869
|
},
|
|
6870
|
-
|
|
6870
|
+
captureUpdate: CaptureUpdateAction.EVENTUALLY
|
|
6871
6871
|
};
|
|
6872
6872
|
},
|
|
6873
6873
|
keyTest: (event) => event[KEYS.CTRL_OR_CMD] && event.altKey && event.code === CODES.C
|
|
@@ -6882,7 +6882,7 @@ var actionPasteStyles = register({
|
|
|
6882
6882
|
const pastedElement = elementsCopied[0];
|
|
6883
6883
|
const boundTextElement = elementsCopied[1];
|
|
6884
6884
|
if (!isExcalidrawElement(pastedElement)) {
|
|
6885
|
-
return { elements,
|
|
6885
|
+
return { elements, captureUpdate: CaptureUpdateAction.EVENTUALLY };
|
|
6886
6886
|
}
|
|
6887
6887
|
const selectedElements = getSelectedElements(elements, appState, {
|
|
6888
6888
|
includeBoundTextElement: true
|
|
@@ -6948,7 +6948,7 @@ var actionPasteStyles = register({
|
|
|
6948
6948
|
}
|
|
6949
6949
|
return element;
|
|
6950
6950
|
}),
|
|
6951
|
-
|
|
6951
|
+
captureUpdate: CaptureUpdateAction.IMMEDIATELY
|
|
6952
6952
|
};
|
|
6953
6953
|
},
|
|
6954
6954
|
keyTest: (event) => event[KEYS.CTRL_OR_CMD] && event.altKey && event.code === CODES.V
|
|
@@ -6965,7 +6965,7 @@ var actionToggleCanvasMenu = register({
|
|
|
6965
6965
|
...appState,
|
|
6966
6966
|
openMenu: appState.openMenu === "canvas" ? null : "canvas"
|
|
6967
6967
|
},
|
|
6968
|
-
|
|
6968
|
+
captureUpdate: CaptureUpdateAction.EVENTUALLY
|
|
6969
6969
|
}),
|
|
6970
6970
|
PanelComponent: ({ appState, updateData }) => /* @__PURE__ */ jsx42(
|
|
6971
6971
|
ToolButton,
|
|
@@ -6987,7 +6987,7 @@ var actionToggleEditMenu = register({
|
|
|
6987
6987
|
...appState,
|
|
6988
6988
|
openMenu: appState.openMenu === "shape" ? null : "shape"
|
|
6989
6989
|
},
|
|
6990
|
-
|
|
6990
|
+
captureUpdate: CaptureUpdateAction.EVENTUALLY
|
|
6991
6991
|
}),
|
|
6992
6992
|
PanelComponent: ({ elements, appState, updateData }) => /* @__PURE__ */ jsx42(
|
|
6993
6993
|
ToolButton,
|
|
@@ -7021,7 +7021,7 @@ var actionShortcuts = register({
|
|
|
7021
7021
|
name: "help"
|
|
7022
7022
|
}
|
|
7023
7023
|
},
|
|
7024
|
-
|
|
7024
|
+
captureUpdate: CaptureUpdateAction.EVENTUALLY
|
|
7025
7025
|
};
|
|
7026
7026
|
},
|
|
7027
7027
|
keyTest: (event) => event.key === KEYS.QUESTION_MARK
|
|
@@ -7063,7 +7063,11 @@ var actionGroup = register({
|
|
|
7063
7063
|
})
|
|
7064
7064
|
);
|
|
7065
7065
|
if (selectedElements.length < 2) {
|
|
7066
|
-
return {
|
|
7066
|
+
return {
|
|
7067
|
+
appState,
|
|
7068
|
+
elements,
|
|
7069
|
+
captureUpdate: CaptureUpdateAction.EVENTUALLY
|
|
7070
|
+
};
|
|
7067
7071
|
}
|
|
7068
7072
|
const selectedGroupIds = getSelectedGroupIds(appState);
|
|
7069
7073
|
if (selectedGroupIds.length === 1) {
|
|
@@ -7081,7 +7085,11 @@ var actionGroup = register({
|
|
|
7081
7085
|
...Array.from(selectedElementIds)
|
|
7082
7086
|
]);
|
|
7083
7087
|
if (combinedSet.size === elementIdsInGroup.size) {
|
|
7084
|
-
return {
|
|
7088
|
+
return {
|
|
7089
|
+
appState,
|
|
7090
|
+
elements,
|
|
7091
|
+
captureUpdate: CaptureUpdateAction.EVENTUALLY
|
|
7092
|
+
};
|
|
7085
7093
|
}
|
|
7086
7094
|
}
|
|
7087
7095
|
let nextElements = [...elements];
|
|
@@ -7132,7 +7140,7 @@ var actionGroup = register({
|
|
|
7132
7140
|
)
|
|
7133
7141
|
},
|
|
7134
7142
|
elements: reorderedElements,
|
|
7135
|
-
|
|
7143
|
+
captureUpdate: CaptureUpdateAction.IMMEDIATELY
|
|
7136
7144
|
};
|
|
7137
7145
|
},
|
|
7138
7146
|
predicate: (elements, appState, _, app) => enableActionGroup(elements, appState, app),
|
|
@@ -7159,7 +7167,11 @@ var actionUngroup = register({
|
|
|
7159
7167
|
const groupIds = getSelectedGroupIds(appState);
|
|
7160
7168
|
const elementsMap = arrayToMap(elements);
|
|
7161
7169
|
if (groupIds.length === 0) {
|
|
7162
|
-
return {
|
|
7170
|
+
return {
|
|
7171
|
+
appState,
|
|
7172
|
+
elements,
|
|
7173
|
+
captureUpdate: CaptureUpdateAction.EVENTUALLY
|
|
7174
|
+
};
|
|
7163
7175
|
}
|
|
7164
7176
|
let nextElements = [...elements];
|
|
7165
7177
|
const boundTextElementIds = [];
|
|
@@ -7220,7 +7232,7 @@ var actionUngroup = register({
|
|
|
7220
7232
|
return {
|
|
7221
7233
|
appState: { ...appState, ...updateAppState },
|
|
7222
7234
|
elements: nextElements,
|
|
7223
|
-
|
|
7235
|
+
captureUpdate: CaptureUpdateAction.IMMEDIATELY
|
|
7224
7236
|
};
|
|
7225
7237
|
},
|
|
7226
7238
|
keyTest: (event) => event.shiftKey && event[KEYS.CTRL_OR_CMD] && event.key === KEYS.G.toUpperCase(),
|
|
@@ -7486,7 +7498,7 @@ var actionGoToCollaborator = register({
|
|
|
7486
7498
|
...appState,
|
|
7487
7499
|
userToFollow: null
|
|
7488
7500
|
},
|
|
7489
|
-
|
|
7501
|
+
captureUpdate: CaptureUpdateAction.EVENTUALLY
|
|
7490
7502
|
};
|
|
7491
7503
|
}
|
|
7492
7504
|
return {
|
|
@@ -7499,7 +7511,7 @@ var actionGoToCollaborator = register({
|
|
|
7499
7511
|
// Close mobile menu
|
|
7500
7512
|
openMenu: appState.openMenu === "canvas" ? null : appState.openMenu
|
|
7501
7513
|
},
|
|
7502
|
-
|
|
7514
|
+
captureUpdate: CaptureUpdateAction.EVENTUALLY
|
|
7503
7515
|
};
|
|
7504
7516
|
},
|
|
7505
7517
|
PanelComponent: ({ updateData, data, appState }) => {
|
|
@@ -7600,7 +7612,7 @@ var actionAddToLibrary = register({
|
|
|
7600
7612
|
for (const type of LIBRARY_DISABLED_TYPES) {
|
|
7601
7613
|
if (selectedElements.some((element) => element.type === type)) {
|
|
7602
7614
|
return {
|
|
7603
|
-
|
|
7615
|
+
captureUpdate: CaptureUpdateAction.EVENTUALLY,
|
|
7604
7616
|
appState: {
|
|
7605
7617
|
...appState,
|
|
7606
7618
|
errorMessage: t(`errors.libraryElementTypeError.${type}`)
|
|
@@ -7620,7 +7632,7 @@ var actionAddToLibrary = register({
|
|
|
7620
7632
|
]);
|
|
7621
7633
|
}).then(() => {
|
|
7622
7634
|
return {
|
|
7623
|
-
|
|
7635
|
+
captureUpdate: CaptureUpdateAction.EVENTUALLY,
|
|
7624
7636
|
appState: {
|
|
7625
7637
|
...appState,
|
|
7626
7638
|
toast: { message: t("toast.addedToLibrary") }
|
|
@@ -7628,7 +7640,7 @@ var actionAddToLibrary = register({
|
|
|
7628
7640
|
};
|
|
7629
7641
|
}).catch((error) => {
|
|
7630
7642
|
return {
|
|
7631
|
-
|
|
7643
|
+
captureUpdate: CaptureUpdateAction.EVENTUALLY,
|
|
7632
7644
|
appState: {
|
|
7633
7645
|
...appState,
|
|
7634
7646
|
errorMessage: error.message
|
|
@@ -7721,7 +7733,7 @@ var actionAlignTop = register({
|
|
|
7721
7733
|
position: "start",
|
|
7722
7734
|
axis: "y"
|
|
7723
7735
|
}),
|
|
7724
|
-
|
|
7736
|
+
captureUpdate: CaptureUpdateAction.IMMEDIATELY
|
|
7725
7737
|
};
|
|
7726
7738
|
},
|
|
7727
7739
|
keyTest: (event) => event[KEYS.CTRL_OR_CMD] && event.shiftKey && event.key === KEYS.ARROW_UP,
|
|
@@ -7753,7 +7765,7 @@ var actionAlignBottom = register({
|
|
|
7753
7765
|
position: "end",
|
|
7754
7766
|
axis: "y"
|
|
7755
7767
|
}),
|
|
7756
|
-
|
|
7768
|
+
captureUpdate: CaptureUpdateAction.IMMEDIATELY
|
|
7757
7769
|
};
|
|
7758
7770
|
},
|
|
7759
7771
|
keyTest: (event) => event[KEYS.CTRL_OR_CMD] && event.shiftKey && event.key === KEYS.ARROW_DOWN,
|
|
@@ -7785,7 +7797,7 @@ var actionAlignLeft = register({
|
|
|
7785
7797
|
position: "start",
|
|
7786
7798
|
axis: "x"
|
|
7787
7799
|
}),
|
|
7788
|
-
|
|
7800
|
+
captureUpdate: CaptureUpdateAction.IMMEDIATELY
|
|
7789
7801
|
};
|
|
7790
7802
|
},
|
|
7791
7803
|
keyTest: (event) => event[KEYS.CTRL_OR_CMD] && event.shiftKey && event.key === KEYS.ARROW_LEFT,
|
|
@@ -7817,7 +7829,7 @@ var actionAlignRight = register({
|
|
|
7817
7829
|
position: "end",
|
|
7818
7830
|
axis: "x"
|
|
7819
7831
|
}),
|
|
7820
|
-
|
|
7832
|
+
captureUpdate: CaptureUpdateAction.IMMEDIATELY
|
|
7821
7833
|
};
|
|
7822
7834
|
},
|
|
7823
7835
|
keyTest: (event) => event[KEYS.CTRL_OR_CMD] && event.shiftKey && event.key === KEYS.ARROW_RIGHT,
|
|
@@ -7849,7 +7861,7 @@ var actionAlignVerticallyCentered = register({
|
|
|
7849
7861
|
position: "center",
|
|
7850
7862
|
axis: "y"
|
|
7851
7863
|
}),
|
|
7852
|
-
|
|
7864
|
+
captureUpdate: CaptureUpdateAction.IMMEDIATELY
|
|
7853
7865
|
};
|
|
7854
7866
|
},
|
|
7855
7867
|
PanelComponent: ({ elements, appState, updateData, app }) => /* @__PURE__ */ jsx46(
|
|
@@ -7878,7 +7890,7 @@ var actionAlignHorizontallyCentered = register({
|
|
|
7878
7890
|
position: "center",
|
|
7879
7891
|
axis: "x"
|
|
7880
7892
|
}),
|
|
7881
|
-
|
|
7893
|
+
captureUpdate: CaptureUpdateAction.IMMEDIATELY
|
|
7882
7894
|
};
|
|
7883
7895
|
},
|
|
7884
7896
|
PanelComponent: ({ elements, appState, updateData, app }) => /* @__PURE__ */ jsx46(
|
|
@@ -7977,7 +7989,7 @@ var distributeHorizontally = register({
|
|
|
7977
7989
|
space: "between",
|
|
7978
7990
|
axis: "x"
|
|
7979
7991
|
}),
|
|
7980
|
-
|
|
7992
|
+
captureUpdate: CaptureUpdateAction.IMMEDIATELY
|
|
7981
7993
|
};
|
|
7982
7994
|
},
|
|
7983
7995
|
keyTest: (event) => !event[KEYS.CTRL_OR_CMD] && event.altKey && event.code === CODES.H,
|
|
@@ -8007,7 +8019,7 @@ var distributeVertically = register({
|
|
|
8007
8019
|
space: "between",
|
|
8008
8020
|
axis: "y"
|
|
8009
8021
|
}),
|
|
8010
|
-
|
|
8022
|
+
captureUpdate: CaptureUpdateAction.IMMEDIATELY
|
|
8011
8023
|
};
|
|
8012
8024
|
},
|
|
8013
8025
|
keyTest: (event) => !event[KEYS.CTRL_OR_CMD] && event.altKey && event.code === CODES.V,
|
|
@@ -8045,7 +8057,7 @@ var actionFlipHorizontal = register({
|
|
|
8045
8057
|
app
|
|
8046
8058
|
),
|
|
8047
8059
|
appState,
|
|
8048
|
-
|
|
8060
|
+
captureUpdate: CaptureUpdateAction.IMMEDIATELY
|
|
8049
8061
|
};
|
|
8050
8062
|
},
|
|
8051
8063
|
keyTest: (event) => event.shiftKey && event.code === CODES.H
|
|
@@ -8069,7 +8081,7 @@ var actionFlipVertical = register({
|
|
|
8069
8081
|
app
|
|
8070
8082
|
),
|
|
8071
8083
|
appState,
|
|
8072
|
-
|
|
8084
|
+
captureUpdate: CaptureUpdateAction.IMMEDIATELY
|
|
8073
8085
|
};
|
|
8074
8086
|
},
|
|
8075
8087
|
keyTest: (event) => event.shiftKey && event.code === CODES.V && !event[KEYS.CTRL_OR_CMD]
|
|
@@ -8172,7 +8184,7 @@ var actionCopy = register({
|
|
|
8172
8184
|
await copyToClipboard(elementsToCopy, app.files, event);
|
|
8173
8185
|
} catch (error) {
|
|
8174
8186
|
return {
|
|
8175
|
-
|
|
8187
|
+
captureUpdate: CaptureUpdateAction.EVENTUALLY,
|
|
8176
8188
|
appState: {
|
|
8177
8189
|
...appState,
|
|
8178
8190
|
errorMessage: error.message
|
|
@@ -8180,7 +8192,7 @@ var actionCopy = register({
|
|
|
8180
8192
|
};
|
|
8181
8193
|
}
|
|
8182
8194
|
return {
|
|
8183
|
-
|
|
8195
|
+
captureUpdate: CaptureUpdateAction.EVENTUALLY
|
|
8184
8196
|
};
|
|
8185
8197
|
},
|
|
8186
8198
|
// don't supply a shortcut since we handle this conditionally via onCopy event
|
|
@@ -8201,7 +8213,7 @@ var actionPaste = register({
|
|
|
8201
8213
|
console.error(`actionPaste ${error.name}: ${error.message}`);
|
|
8202
8214
|
if (isFirefox) {
|
|
8203
8215
|
return {
|
|
8204
|
-
|
|
8216
|
+
captureUpdate: CaptureUpdateAction.EVENTUALLY,
|
|
8205
8217
|
appState: {
|
|
8206
8218
|
...appState,
|
|
8207
8219
|
errorMessage: t("hints.firefox_clipboard_write")
|
|
@@ -8209,7 +8221,7 @@ var actionPaste = register({
|
|
|
8209
8221
|
};
|
|
8210
8222
|
}
|
|
8211
8223
|
return {
|
|
8212
|
-
|
|
8224
|
+
captureUpdate: CaptureUpdateAction.EVENTUALLY,
|
|
8213
8225
|
appState: {
|
|
8214
8226
|
...appState,
|
|
8215
8227
|
errorMessage: t("errors.asyncPasteFailedOnRead")
|
|
@@ -8221,7 +8233,7 @@ var actionPaste = register({
|
|
|
8221
8233
|
} catch (error) {
|
|
8222
8234
|
console.error(error);
|
|
8223
8235
|
return {
|
|
8224
|
-
|
|
8236
|
+
captureUpdate: CaptureUpdateAction.EVENTUALLY,
|
|
8225
8237
|
appState: {
|
|
8226
8238
|
...appState,
|
|
8227
8239
|
errorMessage: t("errors.asyncPasteFailedOnParse")
|
|
@@ -8229,7 +8241,7 @@ var actionPaste = register({
|
|
|
8229
8241
|
};
|
|
8230
8242
|
}
|
|
8231
8243
|
return {
|
|
8232
|
-
|
|
8244
|
+
captureUpdate: CaptureUpdateAction.EVENTUALLY
|
|
8233
8245
|
};
|
|
8234
8246
|
},
|
|
8235
8247
|
// don't supply a shortcut since we handle this conditionally via onCopy event
|
|
@@ -8254,7 +8266,7 @@ var actionCopyAsSvg = register({
|
|
|
8254
8266
|
perform: async (elements, appState, _data, app) => {
|
|
8255
8267
|
if (!app.canvas) {
|
|
8256
8268
|
return {
|
|
8257
|
-
|
|
8269
|
+
captureUpdate: CaptureUpdateAction.EVENTUALLY
|
|
8258
8270
|
};
|
|
8259
8271
|
}
|
|
8260
8272
|
const { exportedElements, exportingFrame } = prepareElementsForExport(
|
|
@@ -8288,7 +8300,7 @@ var actionCopyAsSvg = register({
|
|
|
8288
8300
|
})
|
|
8289
8301
|
}
|
|
8290
8302
|
},
|
|
8291
|
-
|
|
8303
|
+
captureUpdate: CaptureUpdateAction.EVENTUALLY
|
|
8292
8304
|
};
|
|
8293
8305
|
} catch (error) {
|
|
8294
8306
|
console.error(error);
|
|
@@ -8296,7 +8308,7 @@ var actionCopyAsSvg = register({
|
|
|
8296
8308
|
appState: {
|
|
8297
8309
|
errorMessage: error.message
|
|
8298
8310
|
},
|
|
8299
|
-
|
|
8311
|
+
captureUpdate: CaptureUpdateAction.EVENTUALLY
|
|
8300
8312
|
};
|
|
8301
8313
|
}
|
|
8302
8314
|
},
|
|
@@ -8313,7 +8325,7 @@ var actionCopyAsPng = register({
|
|
|
8313
8325
|
perform: async (elements, appState, _data, app) => {
|
|
8314
8326
|
if (!app.canvas) {
|
|
8315
8327
|
return {
|
|
8316
|
-
|
|
8328
|
+
captureUpdate: CaptureUpdateAction.EVENTUALLY
|
|
8317
8329
|
};
|
|
8318
8330
|
}
|
|
8319
8331
|
const selectedElements = app.scene.getSelectedElements({
|
|
@@ -8342,7 +8354,7 @@ var actionCopyAsPng = register({
|
|
|
8342
8354
|
})
|
|
8343
8355
|
}
|
|
8344
8356
|
},
|
|
8345
|
-
|
|
8357
|
+
captureUpdate: CaptureUpdateAction.EVENTUALLY
|
|
8346
8358
|
};
|
|
8347
8359
|
} catch (error) {
|
|
8348
8360
|
console.error(error);
|
|
@@ -8351,7 +8363,7 @@ var actionCopyAsPng = register({
|
|
|
8351
8363
|
...appState,
|
|
8352
8364
|
errorMessage: error.message
|
|
8353
8365
|
},
|
|
8354
|
-
|
|
8366
|
+
captureUpdate: CaptureUpdateAction.EVENTUALLY
|
|
8355
8367
|
};
|
|
8356
8368
|
}
|
|
8357
8369
|
},
|
|
@@ -8376,7 +8388,7 @@ var copyText = register({
|
|
|
8376
8388
|
throw new Error(t("errors.copyToSystemClipboardFailed"));
|
|
8377
8389
|
}
|
|
8378
8390
|
return {
|
|
8379
|
-
|
|
8391
|
+
captureUpdate: CaptureUpdateAction.EVENTUALLY
|
|
8380
8392
|
};
|
|
8381
8393
|
},
|
|
8382
8394
|
predicate: (elements, appState, _, app) => {
|
|
@@ -8406,7 +8418,7 @@ var actionToggleGridMode = register({
|
|
|
8406
8418
|
gridModeEnabled: !this.checked(appState),
|
|
8407
8419
|
objectsSnapModeEnabled: false
|
|
8408
8420
|
},
|
|
8409
|
-
|
|
8421
|
+
captureUpdate: CaptureUpdateAction.EVENTUALLY
|
|
8410
8422
|
};
|
|
8411
8423
|
},
|
|
8412
8424
|
checked: (appState) => appState.gridModeEnabled,
|
|
@@ -8433,7 +8445,7 @@ var actionToggleZenMode = register({
|
|
|
8433
8445
|
...appState,
|
|
8434
8446
|
zenModeEnabled: !this.checked(appState)
|
|
8435
8447
|
},
|
|
8436
|
-
|
|
8448
|
+
captureUpdate: CaptureUpdateAction.EVENTUALLY
|
|
8437
8449
|
};
|
|
8438
8450
|
},
|
|
8439
8451
|
checked: (appState) => appState.zenModeEnabled,
|
|
@@ -8460,7 +8472,7 @@ var actionToggleObjectsSnapMode = register({
|
|
|
8460
8472
|
objectsSnapModeEnabled: !this.checked(appState),
|
|
8461
8473
|
gridModeEnabled: false
|
|
8462
8474
|
},
|
|
8463
|
-
|
|
8475
|
+
captureUpdate: CaptureUpdateAction.EVENTUALLY
|
|
8464
8476
|
};
|
|
8465
8477
|
},
|
|
8466
8478
|
checked: (appState) => appState.objectsSnapModeEnabled,
|
|
@@ -8485,7 +8497,7 @@ var actionToggleStats = register({
|
|
|
8485
8497
|
...appState,
|
|
8486
8498
|
stats: { ...appState.stats, open: !this.checked(appState) }
|
|
8487
8499
|
},
|
|
8488
|
-
|
|
8500
|
+
captureUpdate: CaptureUpdateAction.EVENTUALLY
|
|
8489
8501
|
};
|
|
8490
8502
|
},
|
|
8491
8503
|
checked: (appState) => appState.stats.open,
|
|
@@ -8540,7 +8552,7 @@ var actionUnbindText = register({
|
|
|
8540
8552
|
return {
|
|
8541
8553
|
elements,
|
|
8542
8554
|
appState,
|
|
8543
|
-
|
|
8555
|
+
captureUpdate: CaptureUpdateAction.IMMEDIATELY
|
|
8544
8556
|
};
|
|
8545
8557
|
}
|
|
8546
8558
|
});
|
|
@@ -8600,7 +8612,7 @@ var actionBindText = register({
|
|
|
8600
8612
|
return {
|
|
8601
8613
|
elements: pushTextAboveContainer(elements, container, textElement),
|
|
8602
8614
|
appState: { ...appState, selectedElementIds: { [container.id]: true } },
|
|
8603
|
-
|
|
8615
|
+
captureUpdate: CaptureUpdateAction.IMMEDIATELY
|
|
8604
8616
|
};
|
|
8605
8617
|
}
|
|
8606
8618
|
});
|
|
@@ -8728,7 +8740,7 @@ var actionWrapTextInContainer = register({
|
|
|
8728
8740
|
...appState,
|
|
8729
8741
|
selectedElementIds: containerIds
|
|
8730
8742
|
},
|
|
8731
|
-
|
|
8743
|
+
captureUpdate: CaptureUpdateAction.IMMEDIATELY
|
|
8732
8744
|
};
|
|
8733
8745
|
}
|
|
8734
8746
|
});
|
|
@@ -9092,7 +9104,7 @@ var actionLink = register({
|
|
|
9092
9104
|
showHyperlinkPopup: "editor",
|
|
9093
9105
|
openMenu: null
|
|
9094
9106
|
},
|
|
9095
|
-
|
|
9107
|
+
captureUpdate: CaptureUpdateAction.IMMEDIATELY
|
|
9096
9108
|
};
|
|
9097
9109
|
},
|
|
9098
9110
|
trackEvent: { category: "hyperlink", action: "click" },
|
|
@@ -9162,7 +9174,7 @@ var actionToggleElementLock = register({
|
|
|
9162
9174
|
...appState,
|
|
9163
9175
|
selectedLinearElement: nextLockState ? null : appState.selectedLinearElement
|
|
9164
9176
|
},
|
|
9165
|
-
|
|
9177
|
+
captureUpdate: CaptureUpdateAction.IMMEDIATELY
|
|
9166
9178
|
};
|
|
9167
9179
|
},
|
|
9168
9180
|
keyTest: (event, appState, elements, app) => {
|
|
@@ -9197,7 +9209,7 @@ var actionUnlockAllElements = register({
|
|
|
9197
9209
|
lockedElements.map((el) => [el.id, true])
|
|
9198
9210
|
)
|
|
9199
9211
|
},
|
|
9200
|
-
|
|
9212
|
+
captureUpdate: CaptureUpdateAction.IMMEDIATELY
|
|
9201
9213
|
};
|
|
9202
9214
|
},
|
|
9203
9215
|
label: "labels.elementLock.unlockAll"
|
|
@@ -12669,14 +12681,14 @@ var actionCopyElementLink = register({
|
|
|
12669
12681
|
closable: true
|
|
12670
12682
|
}
|
|
12671
12683
|
},
|
|
12672
|
-
|
|
12684
|
+
captureUpdate: CaptureUpdateAction.EVENTUALLY
|
|
12673
12685
|
};
|
|
12674
12686
|
}
|
|
12675
12687
|
return {
|
|
12676
12688
|
appState,
|
|
12677
12689
|
elements,
|
|
12678
12690
|
app,
|
|
12679
|
-
|
|
12691
|
+
captureUpdate: CaptureUpdateAction.EVENTUALLY
|
|
12680
12692
|
};
|
|
12681
12693
|
}
|
|
12682
12694
|
} catch (error) {
|
|
@@ -12686,7 +12698,7 @@ var actionCopyElementLink = register({
|
|
|
12686
12698
|
appState,
|
|
12687
12699
|
elements,
|
|
12688
12700
|
app,
|
|
12689
|
-
|
|
12701
|
+
captureUpdate: CaptureUpdateAction.EVENTUALLY
|
|
12690
12702
|
};
|
|
12691
12703
|
},
|
|
12692
12704
|
predicate: (elements, appState) => canCreateLinkFromElements(getSelectedElements(elements, appState))
|
|
@@ -12698,7 +12710,12 @@ var actionLinkToElement = register({
|
|
|
12698
12710
|
perform: (elements, appState, _, app) => {
|
|
12699
12711
|
const selectedElements = getSelectedElements(elements, appState);
|
|
12700
12712
|
if (selectedElements.length !== 1 || !canCreateLinkFromElements(selectedElements)) {
|
|
12701
|
-
return {
|
|
12713
|
+
return {
|
|
12714
|
+
elements,
|
|
12715
|
+
appState,
|
|
12716
|
+
app,
|
|
12717
|
+
captureUpdate: CaptureUpdateAction.EVENTUALLY
|
|
12718
|
+
};
|
|
12702
12719
|
}
|
|
12703
12720
|
return {
|
|
12704
12721
|
appState: {
|
|
@@ -12708,7 +12725,7 @@ var actionLinkToElement = register({
|
|
|
12708
12725
|
sourceElementId: getSelectedElements(elements, appState)[0].id
|
|
12709
12726
|
}
|
|
12710
12727
|
},
|
|
12711
|
-
|
|
12728
|
+
captureUpdate: CaptureUpdateAction.IMMEDIATELY
|
|
12712
12729
|
};
|
|
12713
12730
|
},
|
|
12714
12731
|
predicate: (elements, appState, appProps, app) => {
|
|
@@ -13473,7 +13490,7 @@ var actionToggleLinearEditor = register({
|
|
|
13473
13490
|
...appState,
|
|
13474
13491
|
editingLinearElement
|
|
13475
13492
|
},
|
|
13476
|
-
|
|
13493
|
+
captureUpdate: CaptureUpdateAction.IMMEDIATELY
|
|
13477
13494
|
};
|
|
13478
13495
|
},
|
|
13479
13496
|
PanelComponent: ({ appState, updateData, app }) => {
|
|
@@ -13516,7 +13533,7 @@ var actionToggleSearchMenu = register({
|
|
|
13516
13533
|
if (searchInput?.matches(":focus")) {
|
|
13517
13534
|
return {
|
|
13518
13535
|
appState: { ...appState, openSidebar: null },
|
|
13519
|
-
|
|
13536
|
+
captureUpdate: CaptureUpdateAction.EVENTUALLY
|
|
13520
13537
|
};
|
|
13521
13538
|
}
|
|
13522
13539
|
searchInput?.focus();
|
|
@@ -13529,7 +13546,7 @@ var actionToggleSearchMenu = register({
|
|
|
13529
13546
|
openSidebar: { name: DEFAULT_SIDEBAR.name, tab: CANVAS_SEARCH_TAB },
|
|
13530
13547
|
openDialog: null
|
|
13531
13548
|
},
|
|
13532
|
-
|
|
13549
|
+
captureUpdate: CaptureUpdateAction.EVENTUALLY
|
|
13533
13550
|
};
|
|
13534
13551
|
},
|
|
13535
13552
|
checked: (appState) => appState.gridModeEnabled,
|
|
@@ -13559,7 +13576,7 @@ var actionToggleCropEditor = register({
|
|
|
13559
13576
|
isCropping: false,
|
|
13560
13577
|
croppingElementId: selectedElement.id
|
|
13561
13578
|
},
|
|
13562
|
-
|
|
13579
|
+
captureUpdate: CaptureUpdateAction.IMMEDIATELY
|
|
13563
13580
|
};
|
|
13564
13581
|
},
|
|
13565
13582
|
predicate: (elements, appState, _, app) => {
|
|
@@ -13735,17 +13752,17 @@ var executeHistoryAction = (app, appState, updater) => {
|
|
|
13735
13752
|
if (!appState.multiElement && !appState.resizingElement && !appState.editingTextElement && !appState.newElement && !appState.selectedElementsAreBeingDragged && !appState.selectionElement && !app.flowChartCreator.isCreatingChart) {
|
|
13736
13753
|
const result = updater();
|
|
13737
13754
|
if (!result) {
|
|
13738
|
-
return {
|
|
13755
|
+
return { captureUpdate: CaptureUpdateAction.EVENTUALLY };
|
|
13739
13756
|
}
|
|
13740
13757
|
const [nextElementsMap, nextAppState] = result;
|
|
13741
13758
|
const nextElements = Array.from(nextElementsMap.values());
|
|
13742
13759
|
return {
|
|
13743
13760
|
appState: nextAppState,
|
|
13744
13761
|
elements: nextElements,
|
|
13745
|
-
|
|
13762
|
+
captureUpdate: CaptureUpdateAction.NEVER
|
|
13746
13763
|
};
|
|
13747
13764
|
}
|
|
13748
|
-
return {
|
|
13765
|
+
return { captureUpdate: CaptureUpdateAction.EVENTUALLY };
|
|
13749
13766
|
};
|
|
13750
13767
|
var createUndoAction = (history, store) => ({
|
|
13751
13768
|
name: "undo",
|
|
@@ -19209,7 +19226,9 @@ var StatsDragInput = ({
|
|
|
19209
19226
|
originalAppState: appState2,
|
|
19210
19227
|
setInputValue: (value2) => setInputValue(String(value2))
|
|
19211
19228
|
});
|
|
19212
|
-
app.syncActionResult({
|
|
19229
|
+
app.syncActionResult({
|
|
19230
|
+
captureUpdate: CaptureUpdateAction.IMMEDIATELY
|
|
19231
|
+
});
|
|
19213
19232
|
}
|
|
19214
19233
|
};
|
|
19215
19234
|
const callbacksRef = useRef34({});
|
|
@@ -19313,7 +19332,9 @@ var StatsDragInput = ({
|
|
|
19313
19332
|
onPointerMove,
|
|
19314
19333
|
false
|
|
19315
19334
|
);
|
|
19316
|
-
app.syncActionResult({
|
|
19335
|
+
app.syncActionResult({
|
|
19336
|
+
captureUpdate: CaptureUpdateAction.IMMEDIATELY
|
|
19337
|
+
});
|
|
19317
19338
|
lastPointer = null;
|
|
19318
19339
|
accumulatedChange = 0;
|
|
19319
19340
|
stepChange = 0;
|
|
@@ -21587,7 +21608,7 @@ var actionToggleViewMode = register({
|
|
|
21587
21608
|
...appState,
|
|
21588
21609
|
viewModeEnabled: !this.checked(appState)
|
|
21589
21610
|
},
|
|
21590
|
-
|
|
21611
|
+
captureUpdate: CaptureUpdateAction.EVENTUALLY
|
|
21591
21612
|
};
|
|
21592
21613
|
},
|
|
21593
21614
|
checked: (appState) => appState.viewModeEnabled,
|
|
@@ -21625,13 +21646,13 @@ var actionSelectAllElementsInFrame = register({
|
|
|
21625
21646
|
return acc;
|
|
21626
21647
|
}, {})
|
|
21627
21648
|
},
|
|
21628
|
-
|
|
21649
|
+
captureUpdate: CaptureUpdateAction.IMMEDIATELY
|
|
21629
21650
|
};
|
|
21630
21651
|
}
|
|
21631
21652
|
return {
|
|
21632
21653
|
elements,
|
|
21633
21654
|
appState,
|
|
21634
|
-
|
|
21655
|
+
captureUpdate: CaptureUpdateAction.EVENTUALLY
|
|
21635
21656
|
};
|
|
21636
21657
|
},
|
|
21637
21658
|
predicate: (elements, appState, _, app) => isSingleFrameSelected(appState, app)
|
|
@@ -21651,13 +21672,13 @@ var actionRemoveAllElementsFromFrame = register({
|
|
|
21651
21672
|
[selectedElement.id]: true
|
|
21652
21673
|
}
|
|
21653
21674
|
},
|
|
21654
|
-
|
|
21675
|
+
captureUpdate: CaptureUpdateAction.IMMEDIATELY
|
|
21655
21676
|
};
|
|
21656
21677
|
}
|
|
21657
21678
|
return {
|
|
21658
21679
|
elements,
|
|
21659
21680
|
appState,
|
|
21660
|
-
|
|
21681
|
+
captureUpdate: CaptureUpdateAction.EVENTUALLY
|
|
21661
21682
|
};
|
|
21662
21683
|
},
|
|
21663
21684
|
predicate: (elements, appState, _, app) => isSingleFrameSelected(appState, app)
|
|
@@ -21677,7 +21698,7 @@ var actionupdateFrameRendering = register({
|
|
|
21677
21698
|
enabled: !appState.frameRendering.enabled
|
|
21678
21699
|
}
|
|
21679
21700
|
},
|
|
21680
|
-
|
|
21701
|
+
captureUpdate: CaptureUpdateAction.EVENTUALLY
|
|
21681
21702
|
};
|
|
21682
21703
|
},
|
|
21683
21704
|
checked: (appState) => appState.frameRendering.enabled
|
|
@@ -21704,7 +21725,7 @@ var actionSetFrameAsActiveTool = register({
|
|
|
21704
21725
|
type: "frame"
|
|
21705
21726
|
})
|
|
21706
21727
|
},
|
|
21707
|
-
|
|
21728
|
+
captureUpdate: CaptureUpdateAction.EVENTUALLY
|
|
21708
21729
|
};
|
|
21709
21730
|
},
|
|
21710
21731
|
keyTest: (event) => !event[KEYS.CTRL_OR_CMD] && !event.shiftKey && !event.altKey && event.key.toLocaleLowerCase() === KEYS.F
|
|
@@ -21757,7 +21778,7 @@ var actionWrapSelectionInFrame = register({
|
|
|
21757
21778
|
appState: {
|
|
21758
21779
|
selectedElementIds: { [frame.id]: true }
|
|
21759
21780
|
},
|
|
21760
|
-
|
|
21781
|
+
captureUpdate: CaptureUpdateAction.IMMEDIATELY
|
|
21761
21782
|
};
|
|
21762
21783
|
}
|
|
21763
21784
|
});
|
|
@@ -24514,7 +24535,7 @@ var actionTextAutoResize = register({
|
|
|
24514
24535
|
}
|
|
24515
24536
|
return element;
|
|
24516
24537
|
}),
|
|
24517
|
-
|
|
24538
|
+
captureUpdate: CaptureUpdateAction.IMMEDIATELY
|
|
24518
24539
|
};
|
|
24519
24540
|
}
|
|
24520
24541
|
});
|
|
@@ -25087,12 +25108,12 @@ var App = class _App extends React43.Component {
|
|
|
25087
25108
|
if (shouldUpdateStrokeColor) {
|
|
25088
25109
|
this.syncActionResult({
|
|
25089
25110
|
appState: { ...this.state, currentItemStrokeColor: color },
|
|
25090
|
-
|
|
25111
|
+
captureUpdate: CaptureUpdateAction.IMMEDIATELY
|
|
25091
25112
|
});
|
|
25092
25113
|
} else {
|
|
25093
25114
|
this.syncActionResult({
|
|
25094
25115
|
appState: { ...this.state, currentItemBackgroundColor: color },
|
|
25095
|
-
|
|
25116
|
+
captureUpdate: CaptureUpdateAction.IMMEDIATELY
|
|
25096
25117
|
});
|
|
25097
25118
|
}
|
|
25098
25119
|
} else {
|
|
@@ -25105,7 +25126,7 @@ var App = class _App extends React43.Component {
|
|
|
25105
25126
|
}
|
|
25106
25127
|
return el;
|
|
25107
25128
|
}),
|
|
25108
|
-
|
|
25129
|
+
captureUpdate: CaptureUpdateAction.IMMEDIATELY
|
|
25109
25130
|
});
|
|
25110
25131
|
}
|
|
25111
25132
|
},
|
|
@@ -25123,9 +25144,9 @@ var App = class _App extends React43.Component {
|
|
|
25123
25144
|
if (this.unmounted || actionResult === false) {
|
|
25124
25145
|
return;
|
|
25125
25146
|
}
|
|
25126
|
-
if (actionResult.
|
|
25147
|
+
if (actionResult.captureUpdate === CaptureUpdateAction.NEVER) {
|
|
25127
25148
|
this.store.shouldUpdateSnapshot();
|
|
25128
|
-
} else if (actionResult.
|
|
25149
|
+
} else if (actionResult.captureUpdate === CaptureUpdateAction.IMMEDIATELY) {
|
|
25129
25150
|
this.store.shouldCaptureIncrement();
|
|
25130
25151
|
}
|
|
25131
25152
|
let didUpdate = false;
|
|
@@ -25180,7 +25201,7 @@ var App = class _App extends React43.Component {
|
|
|
25180
25201
|
});
|
|
25181
25202
|
didUpdate = true;
|
|
25182
25203
|
}
|
|
25183
|
-
if (!didUpdate && actionResult.
|
|
25204
|
+
if (!didUpdate && actionResult.captureUpdate !== CaptureUpdateAction.EVENTUALLY) {
|
|
25184
25205
|
this.scene.triggerUpdate();
|
|
25185
25206
|
}
|
|
25186
25207
|
}));
|
|
@@ -25291,7 +25312,7 @@ var App = class _App extends React43.Component {
|
|
|
25291
25312
|
this.resetHistory();
|
|
25292
25313
|
this.syncActionResult({
|
|
25293
25314
|
...scene,
|
|
25294
|
-
|
|
25315
|
+
captureUpdate: CaptureUpdateAction.NEVER
|
|
25295
25316
|
});
|
|
25296
25317
|
this.clearImageShapeCache();
|
|
25297
25318
|
this.fonts.loadSceneFonts().then((fontFaces) => {
|
|
@@ -25935,7 +25956,7 @@ var App = class _App extends React43.Component {
|
|
|
25935
25956
|
__publicField(this, "updateScene", withBatchedUpdates(
|
|
25936
25957
|
(sceneData) => {
|
|
25937
25958
|
const nextElements = syncInvalidIndices(sceneData.elements ?? []);
|
|
25938
|
-
if (sceneData.
|
|
25959
|
+
if (sceneData.captureUpdate && sceneData.captureUpdate !== CaptureUpdateAction.EVENTUALLY) {
|
|
25939
25960
|
const prevCommittedAppState = this.store.snapshot.appState;
|
|
25940
25961
|
const prevCommittedElements = this.store.snapshot.elements;
|
|
25941
25962
|
const nextCommittedAppState = sceneData.appState ? Object.assign({}, prevCommittedAppState, sceneData.appState) : prevCommittedAppState;
|
|
@@ -25945,12 +25966,12 @@ var App = class _App extends React43.Component {
|
|
|
25945
25966
|
arrayToMap(nextElements)
|
|
25946
25967
|
// We expect all (already reconciled) elements
|
|
25947
25968
|
) : prevCommittedElements;
|
|
25948
|
-
if (sceneData.
|
|
25969
|
+
if (sceneData.captureUpdate === CaptureUpdateAction.IMMEDIATELY) {
|
|
25949
25970
|
this.store.captureIncrement(
|
|
25950
25971
|
nextCommittedElements,
|
|
25951
25972
|
nextCommittedAppState
|
|
25952
25973
|
);
|
|
25953
|
-
} else if (sceneData.
|
|
25974
|
+
} else if (sceneData.captureUpdate === CaptureUpdateAction.NEVER) {
|
|
25954
25975
|
this.store.updateSnapshot(
|
|
25955
25976
|
nextCommittedElements,
|
|
25956
25977
|
nextCommittedAppState
|
|
@@ -26423,7 +26444,9 @@ var App = class _App extends React43.Component {
|
|
|
26423
26444
|
if (!event.altKey) {
|
|
26424
26445
|
if (this.flowChartNavigator.isExploring) {
|
|
26425
26446
|
this.flowChartNavigator.clear();
|
|
26426
|
-
this.syncActionResult({
|
|
26447
|
+
this.syncActionResult({
|
|
26448
|
+
captureUpdate: CaptureUpdateAction.IMMEDIATELY
|
|
26449
|
+
});
|
|
26427
26450
|
}
|
|
26428
26451
|
}
|
|
26429
26452
|
if (!event[KEYS.CTRL_OR_CMD]) {
|
|
@@ -26463,7 +26486,9 @@ var App = class _App extends React43.Component {
|
|
|
26463
26486
|
}
|
|
26464
26487
|
}
|
|
26465
26488
|
this.flowChartCreator.clear();
|
|
26466
|
-
this.syncActionResult({
|
|
26489
|
+
this.syncActionResult({
|
|
26490
|
+
captureUpdate: CaptureUpdateAction.IMMEDIATELY
|
|
26491
|
+
});
|
|
26467
26492
|
}
|
|
26468
26493
|
}
|
|
26469
26494
|
}));
|
|
@@ -27418,7 +27443,7 @@ var App = class _App extends React43.Component {
|
|
|
27418
27443
|
this.state
|
|
27419
27444
|
)
|
|
27420
27445
|
},
|
|
27421
|
-
|
|
27446
|
+
captureUpdate: this.state.openDialog?.name === "elementLinkSelector" ? CaptureUpdateAction.EVENTUALLY : CaptureUpdateAction.NEVER
|
|
27422
27447
|
});
|
|
27423
27448
|
return;
|
|
27424
27449
|
}
|
|
@@ -28775,7 +28800,7 @@ var App = class _App extends React43.Component {
|
|
|
28775
28800
|
isLoading: false
|
|
28776
28801
|
},
|
|
28777
28802
|
replaceFiles: true,
|
|
28778
|
-
|
|
28803
|
+
captureUpdate: CaptureUpdateAction.IMMEDIATELY
|
|
28779
28804
|
});
|
|
28780
28805
|
return;
|
|
28781
28806
|
} catch (error) {
|
|
@@ -28873,7 +28898,7 @@ var App = class _App extends React43.Component {
|
|
|
28873
28898
|
isLoading: false
|
|
28874
28899
|
},
|
|
28875
28900
|
replaceFiles: true,
|
|
28876
|
-
|
|
28901
|
+
captureUpdate: CaptureUpdateAction.IMMEDIATELY
|
|
28877
28902
|
});
|
|
28878
28903
|
} else if (ret.type === MIME_TYPES.excalidrawlib) {
|
|
28879
28904
|
await this.library.updateLibrary({
|
|
@@ -31996,7 +32021,7 @@ var App = class _App extends React43.Component {
|
|
|
31996
32021
|
appState: {
|
|
31997
32022
|
newElement: null
|
|
31998
32023
|
},
|
|
31999
|
-
|
|
32024
|
+
captureUpdate: CaptureUpdateAction.NEVER
|
|
32000
32025
|
});
|
|
32001
32026
|
return;
|
|
32002
32027
|
}
|
|
@@ -32116,7 +32141,7 @@ var App = class _App extends React43.Component {
|
|
|
32116
32141
|
if (resizingElement && isInvisiblySmallElement(resizingElement)) {
|
|
32117
32142
|
this.updateScene({
|
|
32118
32143
|
elements: this.scene.getElementsIncludingDeleted().filter((el) => el.id !== resizingElement.id),
|
|
32119
|
-
|
|
32144
|
+
captureUpdate: CaptureUpdateAction.NEVER
|
|
32120
32145
|
});
|
|
32121
32146
|
}
|
|
32122
32147
|
if (pointerDownState.resize.isResizing) {
|
|
@@ -33040,6 +33065,7 @@ var Excalidraw = React44.memo(ExcalidrawBase, areEqual5);
|
|
|
33040
33065
|
Excalidraw.displayName = "Excalidraw";
|
|
33041
33066
|
export {
|
|
33042
33067
|
Button,
|
|
33068
|
+
CaptureUpdateAction,
|
|
33043
33069
|
DEFAULT_LASER_COLOR,
|
|
33044
33070
|
DefaultSidebar,
|
|
33045
33071
|
DiagramToCodePlugin,
|
|
@@ -33052,7 +33078,6 @@ export {
|
|
|
33052
33078
|
ROUNDNESS,
|
|
33053
33079
|
Sidebar,
|
|
33054
33080
|
Stats,
|
|
33055
|
-
StoreAction,
|
|
33056
33081
|
THEME,
|
|
33057
33082
|
TTDDialog,
|
|
33058
33083
|
TTDDialogTrigger,
|