@dwelle/excalidraw 0.6.0-rc.2 → 0.6.0-rc.3

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.
Files changed (56) hide show
  1. package/README.md +1 -3
  2. package/dist/dev/{chunk-LCPOPWNR.js → chunk-FCTATTEX.js} +2 -2
  3. package/dist/dev/{chunk-NGUTX5QY.js → chunk-GPAPUEH7.js} +14 -14
  4. package/dist/dev/{chunk-NGUTX5QY.js.map → chunk-GPAPUEH7.js.map} +2 -2
  5. package/dist/dev/data/{image-2IPPJHZ4.js → image-KIZE4OBD.js} +3 -3
  6. package/dist/dev/index.js +170 -145
  7. package/dist/dev/index.js.map +2 -2
  8. package/dist/dev/subset-shared.chunk.js +1 -1
  9. package/dist/dev/subset-worker.chunk.js +1 -1
  10. package/dist/prod/{chunk-BE2LY6VO.js → chunk-DZ7HA6XS.js} +1 -1
  11. package/dist/prod/{chunk-R7OERAXD.js → chunk-TQDSDB2B.js} +4 -4
  12. package/dist/prod/data/image-SCXWNX5A.js +1 -0
  13. package/dist/prod/index.js +11 -11
  14. package/dist/prod/subset-shared.chunk.js +1 -1
  15. package/dist/prod/subset-worker.chunk.js +1 -1
  16. package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +3 -3
  17. package/dist/types/excalidraw/actions/actionAlign.d.ts +6 -6
  18. package/dist/types/excalidraw/actions/actionBoundText.d.ts +3 -3
  19. package/dist/types/excalidraw/actions/actionCanvas.d.ts +13 -13
  20. package/dist/types/excalidraw/actions/actionClipboard.d.ts +13 -13
  21. package/dist/types/excalidraw/actions/actionCropEditor.d.ts +1 -1
  22. package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +3 -3
  23. package/dist/types/excalidraw/actions/actionDistribute.d.ts +2 -2
  24. package/dist/types/excalidraw/actions/actionDuplicateSelection.d.ts +1 -1
  25. package/dist/types/excalidraw/actions/actionElementLink.d.ts +4 -4
  26. package/dist/types/excalidraw/actions/actionElementLock.d.ts +2 -2
  27. package/dist/types/excalidraw/actions/actionExport.d.ts +11 -11
  28. package/dist/types/excalidraw/actions/actionFinalize.d.ts +2 -2
  29. package/dist/types/excalidraw/actions/actionFlip.d.ts +2 -2
  30. package/dist/types/excalidraw/actions/actionFrame.d.ts +7 -7
  31. package/dist/types/excalidraw/actions/actionGroup.d.ts +4 -4
  32. package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +1 -1
  33. package/dist/types/excalidraw/actions/actionLink.d.ts +1 -1
  34. package/dist/types/excalidraw/actions/actionMenu.d.ts +3 -3
  35. package/dist/types/excalidraw/actions/actionNavigate.d.ts +2 -2
  36. package/dist/types/excalidraw/actions/actionProperties.d.ts +15 -15
  37. package/dist/types/excalidraw/actions/actionSelectAll.d.ts +1 -1
  38. package/dist/types/excalidraw/actions/actionStyles.d.ts +3 -3
  39. package/dist/types/excalidraw/actions/actionTextAutoResize.d.ts +1 -1
  40. package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +1 -1
  41. package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +1 -1
  42. package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +2 -2
  43. package/dist/types/excalidraw/actions/actionToggleStats.d.ts +1 -1
  44. package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +1 -1
  45. package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +1 -1
  46. package/dist/types/excalidraw/actions/actionZindex.d.ts +4 -4
  47. package/dist/types/excalidraw/actions/types.d.ts +2 -2
  48. package/dist/types/excalidraw/components/App.d.ts +12 -2
  49. package/dist/types/excalidraw/element/embeddable.d.ts +1 -1
  50. package/dist/types/excalidraw/index.d.ts +1 -1
  51. package/dist/types/excalidraw/store.d.ts +6 -6
  52. package/dist/types/excalidraw/types.d.ts +2 -2
  53. package/package.json +2 -10
  54. package/dist/prod/data/image-DXJVNPGL.js +0 -1
  55. /package/dist/dev/{chunk-LCPOPWNR.js.map → chunk-FCTATTEX.js.map} +0 -0
  56. /package/dist/dev/data/{image-2IPPJHZ4.js.map → image-KIZE4OBD.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,
@@ -152,7 +153,6 @@ import {
152
153
  SloppinessCartoonistIcon,
153
154
  SnapCache,
154
155
  Store,
155
- StoreAction,
156
156
  StrokeStyleDashedIcon,
157
157
  StrokeStyleDottedIcon,
158
158
  StrokeWidthBaseIcon,
@@ -623,10 +623,10 @@ import {
623
623
  wrapText,
624
624
  youtubeIcon,
625
625
  zoomAreaIcon
626
- } from "./chunk-NGUTX5QY.js";
626
+ } from "./chunk-GPAPUEH7.js";
627
627
  import {
628
628
  define_import_meta_env_default
629
- } from "./chunk-LCPOPWNR.js";
629
+ } from "./chunk-FCTATTEX.js";
630
630
  import {
631
631
  en_default
632
632
  } from "./chunk-DGCWVQGA.js";
@@ -1308,7 +1308,7 @@ var actionDeleteSelected = register({
1308
1308
  ...nextAppState2,
1309
1309
  editingLinearElement: null
1310
1310
  },
1311
- storeAction: StoreAction.CAPTURE
1311
+ captureUpdate: CaptureUpdateAction.IMMEDIATELY
1312
1312
  };
1313
1313
  }
1314
1314
  const binding = {
@@ -1328,7 +1328,7 @@ var actionDeleteSelected = register({
1328
1328
  selectedPointsIndices: selectedPointsIndices?.[0] > 0 ? [selectedPointsIndices[0] - 1] : [0]
1329
1329
  }
1330
1330
  },
1331
- storeAction: StoreAction.CAPTURE
1331
+ captureUpdate: CaptureUpdateAction.IMMEDIATELY
1332
1332
  };
1333
1333
  }
1334
1334
  let { elements: nextElements, appState: nextAppState } = deleteSelectedElements(elements, appState, app);
@@ -1345,10 +1345,10 @@ var actionDeleteSelected = register({
1345
1345
  multiElement: null,
1346
1346
  activeEmbeddable: null
1347
1347
  },
1348
- storeAction: isSomeElementSelected(
1348
+ captureUpdate: isSomeElementSelected(
1349
1349
  getNonDeletedElements(elements),
1350
1350
  appState
1351
- ) ? StoreAction.CAPTURE : StoreAction.NONE
1351
+ ) ? CaptureUpdateAction.IMMEDIATELY : CaptureUpdateAction.EVENTUALLY
1352
1352
  };
1353
1353
  },
1354
1354
  keyTest: (event, appState, elements) => (event.key === KEYS.BACKSPACE || event.key === KEYS.DELETE) && !event[KEYS.CTRL_OR_CMD],
@@ -1720,7 +1720,7 @@ var actionSendBackward = register({
1720
1720
  return {
1721
1721
  elements: moveOneLeft(elements, appState),
1722
1722
  appState,
1723
- storeAction: StoreAction.CAPTURE
1723
+ captureUpdate: CaptureUpdateAction.IMMEDIATELY
1724
1724
  };
1725
1725
  },
1726
1726
  keyPriority: 40,
@@ -1746,7 +1746,7 @@ var actionBringForward = register({
1746
1746
  return {
1747
1747
  elements: moveOneRight(elements, appState),
1748
1748
  appState,
1749
- storeAction: StoreAction.CAPTURE
1749
+ captureUpdate: CaptureUpdateAction.IMMEDIATELY
1750
1750
  };
1751
1751
  },
1752
1752
  keyPriority: 40,
@@ -1772,7 +1772,7 @@ var actionSendToBack = register({
1772
1772
  return {
1773
1773
  elements: moveAllLeft(elements, appState),
1774
1774
  appState,
1775
- storeAction: StoreAction.CAPTURE
1775
+ captureUpdate: CaptureUpdateAction.IMMEDIATELY
1776
1776
  };
1777
1777
  },
1778
1778
  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,
@@ -1797,7 +1797,7 @@ var actionBringToFront = register({
1797
1797
  return {
1798
1798
  elements: moveAllRight(elements, appState),
1799
1799
  appState,
1800
- storeAction: StoreAction.CAPTURE
1800
+ captureUpdate: CaptureUpdateAction.IMMEDIATELY
1801
1801
  };
1802
1802
  },
1803
1803
  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,
@@ -1847,7 +1847,7 @@ var actionSelectAll = register({
1847
1847
  Object.keys(selectedElementIds).length === 1 && isLinearElement(elements[0]) ? new LinearElementEditor(elements[0]) : null
1848
1848
  )
1849
1849
  },
1850
- storeAction: StoreAction.CAPTURE
1850
+ captureUpdate: CaptureUpdateAction.IMMEDIATELY
1851
1851
  };
1852
1852
  },
1853
1853
  keyTest: (event) => event[KEYS.CTRL_OR_CMD] && event.key === KEYS.A
@@ -1955,7 +1955,7 @@ var actionDuplicateSelection = register({
1955
1955
  return {
1956
1956
  elements,
1957
1957
  appState: newAppState,
1958
- storeAction: StoreAction.CAPTURE
1958
+ captureUpdate: CaptureUpdateAction.IMMEDIATELY
1959
1959
  };
1960
1960
  } catch {
1961
1961
  return false;
@@ -1973,7 +1973,7 @@ var actionDuplicateSelection = register({
1973
1973
  }
1974
1974
  return {
1975
1975
  ...nextState,
1976
- storeAction: StoreAction.CAPTURE
1976
+ captureUpdate: CaptureUpdateAction.IMMEDIATELY
1977
1977
  };
1978
1978
  },
1979
1979
  keyTest: (event) => event[KEYS.CTRL_OR_CMD] && event.key === KEYS.D,
@@ -4436,7 +4436,7 @@ var changeFontSize = (elements, appState, app, getNewFontSize, fallbackValue) =>
4436
4436
  // the same font size
4437
4437
  currentItemFontSize: newFontSizes.size === 1 ? [...newFontSizes][0] : fallbackValue ?? appState.currentItemFontSize
4438
4438
  },
4439
- storeAction: StoreAction.CAPTURE
4439
+ captureUpdate: CaptureUpdateAction.IMMEDIATELY
4440
4440
  };
4441
4441
  };
4442
4442
  var actionChangeStrokeColor = register({
@@ -4461,7 +4461,7 @@ var actionChangeStrokeColor = register({
4461
4461
  ...appState,
4462
4462
  ...value
4463
4463
  },
4464
- storeAction: !!value.currentItemStrokeColor ? StoreAction.CAPTURE : StoreAction.NONE
4464
+ captureUpdate: !!value.currentItemStrokeColor ? CaptureUpdateAction.IMMEDIATELY : CaptureUpdateAction.EVENTUALLY
4465
4465
  };
4466
4466
  },
4467
4467
  PanelComponent: ({ elements, appState, updateData, appProps }) => /* @__PURE__ */ jsxs20(Fragment4, { children: [
@@ -4507,7 +4507,7 @@ var actionChangeBackgroundColor = register({
4507
4507
  ...appState,
4508
4508
  ...value
4509
4509
  },
4510
- storeAction: !!value.currentItemBackgroundColor ? StoreAction.CAPTURE : StoreAction.NONE
4510
+ captureUpdate: !!value.currentItemBackgroundColor ? CaptureUpdateAction.IMMEDIATELY : CaptureUpdateAction.EVENTUALLY
4511
4511
  };
4512
4512
  },
4513
4513
  PanelComponent: ({ elements, appState, updateData, appProps }) => /* @__PURE__ */ jsxs20(Fragment4, { children: [
@@ -4553,7 +4553,7 @@ var actionChangeFillStyle = register({
4553
4553
  })
4554
4554
  ),
4555
4555
  appState: { ...appState, currentItemFillStyle: value },
4556
- storeAction: StoreAction.CAPTURE
4556
+ captureUpdate: CaptureUpdateAction.IMMEDIATELY
4557
4557
  };
4558
4558
  },
4559
4559
  PanelComponent: ({ elements, appState, updateData }) => {
@@ -4616,7 +4616,7 @@ var actionChangeStrokeWidth = register({
4616
4616
  })
4617
4617
  ),
4618
4618
  appState: { ...appState, currentItemStrokeWidth: value },
4619
- storeAction: StoreAction.CAPTURE
4619
+ captureUpdate: CaptureUpdateAction.IMMEDIATELY
4620
4620
  };
4621
4621
  },
4622
4622
  PanelComponent: ({ elements, appState, updateData }) => /* @__PURE__ */ jsxs20("fieldset", { children: [
@@ -4672,7 +4672,7 @@ var actionChangeSloppiness = register({
4672
4672
  })
4673
4673
  ),
4674
4674
  appState: { ...appState, currentItemRoughness: value },
4675
- storeAction: StoreAction.CAPTURE
4675
+ captureUpdate: CaptureUpdateAction.IMMEDIATELY
4676
4676
  };
4677
4677
  },
4678
4678
  PanelComponent: ({ elements, appState, updateData }) => /* @__PURE__ */ jsxs20("fieldset", { children: [
@@ -4724,7 +4724,7 @@ var actionChangeStrokeStyle = register({
4724
4724
  })
4725
4725
  ),
4726
4726
  appState: { ...appState, currentItemStrokeStyle: value },
4727
- storeAction: StoreAction.CAPTURE
4727
+ captureUpdate: CaptureUpdateAction.IMMEDIATELY
4728
4728
  };
4729
4729
  },
4730
4730
  PanelComponent: ({ elements, appState, updateData }) => /* @__PURE__ */ jsxs20("fieldset", { children: [
@@ -4777,7 +4777,7 @@ var actionChangeOpacity = register({
4777
4777
  true
4778
4778
  ),
4779
4779
  appState: { ...appState, currentItemOpacity: value },
4780
- storeAction: StoreAction.CAPTURE
4780
+ captureUpdate: CaptureUpdateAction.IMMEDIATELY
4781
4781
  };
4782
4782
  },
4783
4783
  PanelComponent: ({ elements, appState, updateData }) => /* @__PURE__ */ jsx34(
@@ -4924,19 +4924,19 @@ var actionChangeFontFamily = register({
4924
4924
  ...appState,
4925
4925
  ...nextAppState
4926
4926
  },
4927
- storeAction: StoreAction.UPDATE
4927
+ captureUpdate: CaptureUpdateAction.NEVER
4928
4928
  };
4929
4929
  }
4930
4930
  const { currentItemFontFamily, currentHoveredFontFamily } = value;
4931
- let nexStoreAction = StoreAction.NONE;
4931
+ let nextCaptureUpdateAction = CaptureUpdateAction.EVENTUALLY;
4932
4932
  let nextFontFamily;
4933
4933
  let skipOnHoverRender = false;
4934
4934
  if (currentItemFontFamily) {
4935
4935
  nextFontFamily = currentItemFontFamily;
4936
- nexStoreAction = StoreAction.CAPTURE;
4936
+ nextCaptureUpdateAction = CaptureUpdateAction.IMMEDIATELY;
4937
4937
  } else if (currentHoveredFontFamily) {
4938
4938
  nextFontFamily = currentHoveredFontFamily;
4939
- nexStoreAction = StoreAction.NONE;
4939
+ nextCaptureUpdateAction = CaptureUpdateAction.EVENTUALLY;
4940
4940
  const selectedTextElements = getSelectedElements(elements, appState, {
4941
4941
  includeBoundTextElement: true
4942
4942
  }).filter((element) => isTextElement(element));
@@ -4960,7 +4960,7 @@ var actionChangeFontFamily = register({
4960
4960
  ...appState,
4961
4961
  ...nextAppState
4962
4962
  },
4963
- storeAction: nexStoreAction
4963
+ captureUpdate: nextCaptureUpdateAction
4964
4964
  };
4965
4965
  if (nextFontFamily && !skipOnHoverRender) {
4966
4966
  const elementContainerMapping = /* @__PURE__ */ new Map();
@@ -5200,7 +5200,7 @@ var actionChangeTextAlign = register({
5200
5200
  ...appState,
5201
5201
  currentItemTextAlign: value
5202
5202
  },
5203
- storeAction: StoreAction.CAPTURE
5203
+ captureUpdate: CaptureUpdateAction.IMMEDIATELY
5204
5204
  };
5205
5205
  },
5206
5206
  PanelComponent: ({ elements, appState, updateData, app }) => {
@@ -5285,7 +5285,7 @@ var actionChangeVerticalAlign = register({
5285
5285
  appState: {
5286
5286
  ...appState
5287
5287
  },
5288
- storeAction: StoreAction.CAPTURE
5288
+ captureUpdate: CaptureUpdateAction.IMMEDIATELY
5289
5289
  };
5290
5290
  },
5291
5291
  PanelComponent: ({ elements, appState, updateData, app }) => {
@@ -5360,7 +5360,7 @@ var actionChangeRoundness = register({
5360
5360
  ...appState,
5361
5361
  currentItemRoundness: value
5362
5362
  },
5363
- storeAction: StoreAction.CAPTURE
5363
+ captureUpdate: CaptureUpdateAction.IMMEDIATELY
5364
5364
  };
5365
5365
  },
5366
5366
  PanelComponent: ({ elements, appState, updateData }) => {
@@ -5505,7 +5505,7 @@ var actionChangeArrowhead = register({
5505
5505
  ...appState,
5506
5506
  [value.position === "start" ? "currentItemStartArrowhead" : "currentItemEndArrowhead"]: value.type
5507
5507
  },
5508
- storeAction: StoreAction.CAPTURE
5508
+ captureUpdate: CaptureUpdateAction.IMMEDIATELY
5509
5509
  };
5510
5510
  },
5511
5511
  PanelComponent: ({ elements, appState, updateData }) => {
@@ -5671,7 +5671,7 @@ var actionChangeArrowType = register({
5671
5671
  return {
5672
5672
  elements: newElements,
5673
5673
  appState: newState,
5674
- storeAction: StoreAction.CAPTURE
5674
+ captureUpdate: CaptureUpdateAction.IMMEDIATELY
5675
5675
  };
5676
5676
  },
5677
5677
  PanelComponent: ({ elements, appState, updateData }) => {
@@ -5836,7 +5836,7 @@ var actionChangeViewBackgroundColor = register({
5836
5836
  perform: (_, appState, value) => {
5837
5837
  return {
5838
5838
  appState: { ...appState, ...value },
5839
- storeAction: !!value.viewBackgroundColor ? StoreAction.CAPTURE : StoreAction.NONE
5839
+ captureUpdate: !!value.viewBackgroundColor ? CaptureUpdateAction.IMMEDIATELY : CaptureUpdateAction.EVENTUALLY
5840
5840
  };
5841
5841
  },
5842
5842
  PanelComponent: ({ elements, appState, updateData, appProps }) => {
@@ -5887,7 +5887,7 @@ var actionClearCanvas = register({
5887
5887
  pasteDialog: appState.pasteDialog,
5888
5888
  activeTool: appState.activeTool.type === "image" ? { ...appState.activeTool, type: "selection" } : appState.activeTool
5889
5889
  },
5890
- storeAction: StoreAction.CAPTURE
5890
+ captureUpdate: CaptureUpdateAction.IMMEDIATELY
5891
5891
  };
5892
5892
  }
5893
5893
  });
@@ -5911,7 +5911,7 @@ var actionZoomIn = register({
5911
5911
  ),
5912
5912
  userToFollow: null
5913
5913
  },
5914
- storeAction: StoreAction.NONE
5914
+ captureUpdate: CaptureUpdateAction.EVENTUALLY
5915
5915
  };
5916
5916
  },
5917
5917
  PanelComponent: ({ updateData, appState }) => /* @__PURE__ */ jsx36(
@@ -5950,7 +5950,7 @@ var actionZoomOut = register({
5950
5950
  ),
5951
5951
  userToFollow: null
5952
5952
  },
5953
- storeAction: StoreAction.NONE
5953
+ captureUpdate: CaptureUpdateAction.EVENTUALLY
5954
5954
  };
5955
5955
  },
5956
5956
  PanelComponent: ({ updateData, appState }) => /* @__PURE__ */ jsx36(
@@ -5989,7 +5989,7 @@ var actionResetZoom = register({
5989
5989
  ),
5990
5990
  userToFollow: null
5991
5991
  },
5992
- storeAction: StoreAction.NONE
5992
+ captureUpdate: CaptureUpdateAction.EVENTUALLY
5993
5993
  };
5994
5994
  },
5995
5995
  PanelComponent: ({ updateData, appState }) => /* @__PURE__ */ jsx36(Tooltip, { label: t("buttons.resetZoom"), style: { height: "100%" }, children: /* @__PURE__ */ jsxs21(
@@ -6076,7 +6076,7 @@ var zoomToFitBounds = ({
6076
6076
  scrollY: centerScroll.scrollY,
6077
6077
  zoom: { value: newZoomValue }
6078
6078
  },
6079
- storeAction: StoreAction.NONE
6079
+ captureUpdate: CaptureUpdateAction.EVENTUALLY
6080
6080
  };
6081
6081
  };
6082
6082
  var zoomToFit = ({
@@ -6172,7 +6172,7 @@ var actionToggleTheme = register({
6172
6172
  ...appState,
6173
6173
  theme: value || (appState.theme === THEME.LIGHT ? THEME.DARK : THEME.LIGHT)
6174
6174
  },
6175
- storeAction: StoreAction.NONE
6175
+ captureUpdate: CaptureUpdateAction.EVENTUALLY
6176
6176
  };
6177
6177
  },
6178
6178
  keyTest: (event) => event.altKey && event.shiftKey && event.code === CODES.D,
@@ -6207,7 +6207,7 @@ var actionToggleEraserTool = register({
6207
6207
  activeEmbeddable: null,
6208
6208
  activeTool
6209
6209
  },
6210
- storeAction: StoreAction.CAPTURE
6210
+ captureUpdate: CaptureUpdateAction.IMMEDIATELY
6211
6211
  };
6212
6212
  },
6213
6213
  keyTest: (event) => event.key === KEYS.E
@@ -6243,7 +6243,7 @@ var actionToggleHandTool = register({
6243
6243
  activeEmbeddable: null,
6244
6244
  activeTool
6245
6245
  },
6246
- storeAction: StoreAction.CAPTURE
6246
+ captureUpdate: CaptureUpdateAction.IMMEDIATELY
6247
6247
  };
6248
6248
  },
6249
6249
  keyTest: (event) => !event.altKey && !event[KEYS.CTRL_OR_CMD] && event.key === KEYS.H
@@ -6278,7 +6278,7 @@ var actionFinalize = register({
6278
6278
  cursorButton: "up",
6279
6279
  editingLinearElement: null
6280
6280
  },
6281
- storeAction: StoreAction.CAPTURE
6281
+ captureUpdate: CaptureUpdateAction.IMMEDIATELY
6282
6282
  };
6283
6283
  }
6284
6284
  }
@@ -6370,7 +6370,7 @@ var actionFinalize = register({
6370
6370
  pendingImageElementId: null
6371
6371
  },
6372
6372
  // TODO: #7348 we should not capture everything, but if we don't, it leads to incosistencies -> revisit
6373
- storeAction: StoreAction.CAPTURE
6373
+ captureUpdate: CaptureUpdateAction.IMMEDIATELY
6374
6374
  };
6375
6375
  },
6376
6376
  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,
@@ -6562,7 +6562,7 @@ var exportAsImage = async ({
6562
6562
  let blob = canvasToBlob(tempCanvas);
6563
6563
  if (data.appState.exportEmbedScene) {
6564
6564
  blob = blob.then(
6565
- (blob2) => import("./data/image-2IPPJHZ4.js").then(
6565
+ (blob2) => import("./data/image-KIZE4OBD.js").then(
6566
6566
  ({ encodePngMetadata }) => encodePngMetadata({
6567
6567
  blob: blob2,
6568
6568
  metadata: serializeAsJSON(
@@ -6680,7 +6680,7 @@ var actionChangeProjectName = register({
6680
6680
  perform: (_elements, appState, value) => {
6681
6681
  return {
6682
6682
  appState: { ...appState, name: value },
6683
- storeAction: StoreAction.NONE
6683
+ captureUpdate: CaptureUpdateAction.EVENTUALLY
6684
6684
  };
6685
6685
  },
6686
6686
  PanelComponent: ({ appState, updateData, appProps, data, app }) => /* @__PURE__ */ jsx41(
@@ -6700,7 +6700,7 @@ var actionChangeExportScale = register({
6700
6700
  perform: (_elements, appState, value) => {
6701
6701
  return {
6702
6702
  appState: { ...appState, exportScale: value },
6703
- storeAction: StoreAction.NONE
6703
+ captureUpdate: CaptureUpdateAction.EVENTUALLY
6704
6704
  };
6705
6705
  },
6706
6706
  PanelComponent: ({ elements: allElements, appState, updateData }) => {
@@ -6747,7 +6747,7 @@ var actionChangeExportBackground = register({
6747
6747
  perform: (_elements, appState, value) => {
6748
6748
  return {
6749
6749
  appState: { ...appState, exportBackground: value },
6750
- storeAction: StoreAction.NONE
6750
+ captureUpdate: CaptureUpdateAction.EVENTUALLY
6751
6751
  };
6752
6752
  },
6753
6753
  PanelComponent: ({ appState, updateData }) => /* @__PURE__ */ jsx41(
@@ -6766,7 +6766,7 @@ var actionChangeExportEmbedScene = register({
6766
6766
  perform: (_elements, appState, value) => {
6767
6767
  return {
6768
6768
  appState: { ...appState, exportEmbedScene: value },
6769
- storeAction: StoreAction.NONE
6769
+ captureUpdate: CaptureUpdateAction.EVENTUALLY
6770
6770
  };
6771
6771
  },
6772
6772
  PanelComponent: ({ appState, updateData }) => /* @__PURE__ */ jsxs24(
@@ -6799,7 +6799,7 @@ var actionSaveToActiveFile = register({
6799
6799
  app.getName()
6800
6800
  ) : await saveAsJSON(elements, appState, app.files, app.getName());
6801
6801
  return {
6802
- storeAction: StoreAction.NONE,
6802
+ captureUpdate: CaptureUpdateAction.EVENTUALLY,
6803
6803
  appState: {
6804
6804
  ...appState,
6805
6805
  fileHandle,
@@ -6817,7 +6817,7 @@ var actionSaveToActiveFile = register({
6817
6817
  } else {
6818
6818
  console.warn(error);
6819
6819
  }
6820
- return { storeAction: StoreAction.NONE };
6820
+ return { captureUpdate: CaptureUpdateAction.EVENTUALLY };
6821
6821
  }
6822
6822
  },
6823
6823
  keyTest: (event) => event.key === KEYS.S && event[KEYS.CTRL_OR_CMD] && !event.shiftKey
@@ -6840,7 +6840,7 @@ var actionSaveFileToDisk = register({
6840
6840
  app.getName()
6841
6841
  );
6842
6842
  return {
6843
- storeAction: StoreAction.NONE,
6843
+ captureUpdate: CaptureUpdateAction.EVENTUALLY,
6844
6844
  appState: {
6845
6845
  ...appState,
6846
6846
  openDialog: null,
@@ -6854,7 +6854,7 @@ var actionSaveFileToDisk = register({
6854
6854
  } else {
6855
6855
  console.warn(error);
6856
6856
  }
6857
- return { storeAction: StoreAction.NONE };
6857
+ return { captureUpdate: CaptureUpdateAction.EVENTUALLY };
6858
6858
  }
6859
6859
  },
6860
6860
  keyTest: (event) => event.key === KEYS.S && event.shiftKey && event[KEYS.CTRL_OR_CMD],
@@ -6890,7 +6890,7 @@ var actionLoadScene = register({
6890
6890
  elements: loadedElements,
6891
6891
  appState: loadedAppState,
6892
6892
  files,
6893
- storeAction: StoreAction.CAPTURE
6893
+ captureUpdate: CaptureUpdateAction.IMMEDIATELY
6894
6894
  };
6895
6895
  } catch (error) {
6896
6896
  if (error?.name === "AbortError") {
@@ -6901,7 +6901,7 @@ var actionLoadScene = register({
6901
6901
  elements,
6902
6902
  appState: { ...appState, errorMessage: error.message },
6903
6903
  files: app.files,
6904
- storeAction: StoreAction.NONE
6904
+ captureUpdate: CaptureUpdateAction.EVENTUALLY
6905
6905
  };
6906
6906
  }
6907
6907
  },
@@ -6914,7 +6914,7 @@ var actionExportWithDarkMode = register({
6914
6914
  perform: (_elements, appState, value) => {
6915
6915
  return {
6916
6916
  appState: { ...appState, exportWithDarkMode: value },
6917
- storeAction: StoreAction.NONE
6917
+ captureUpdate: CaptureUpdateAction.EVENTUALLY
6918
6918
  };
6919
6919
  },
6920
6920
  PanelComponent: ({ appState, updateData }) => /* @__PURE__ */ jsx41(
@@ -6966,7 +6966,7 @@ var actionCopyStyles = register({
6966
6966
  ...appState,
6967
6967
  toast: { message: t("toast.copyStyles") }
6968
6968
  },
6969
- storeAction: StoreAction.NONE
6969
+ captureUpdate: CaptureUpdateAction.EVENTUALLY
6970
6970
  };
6971
6971
  },
6972
6972
  keyTest: (event) => event[KEYS.CTRL_OR_CMD] && event.altKey && event.code === CODES.C
@@ -6981,7 +6981,7 @@ var actionPasteStyles = register({
6981
6981
  const pastedElement = elementsCopied[0];
6982
6982
  const boundTextElement = elementsCopied[1];
6983
6983
  if (!isExcalidrawElement(pastedElement)) {
6984
- return { elements, storeAction: StoreAction.NONE };
6984
+ return { elements, captureUpdate: CaptureUpdateAction.EVENTUALLY };
6985
6985
  }
6986
6986
  const selectedElements = getSelectedElements(elements, appState, {
6987
6987
  includeBoundTextElement: true
@@ -7047,7 +7047,7 @@ var actionPasteStyles = register({
7047
7047
  }
7048
7048
  return element;
7049
7049
  }),
7050
- storeAction: StoreAction.CAPTURE
7050
+ captureUpdate: CaptureUpdateAction.IMMEDIATELY
7051
7051
  };
7052
7052
  },
7053
7053
  keyTest: (event) => event[KEYS.CTRL_OR_CMD] && event.altKey && event.code === CODES.V
@@ -7064,7 +7064,7 @@ var actionToggleCanvasMenu = register({
7064
7064
  ...appState,
7065
7065
  openMenu: appState.openMenu === "canvas" ? null : "canvas"
7066
7066
  },
7067
- storeAction: StoreAction.NONE
7067
+ captureUpdate: CaptureUpdateAction.EVENTUALLY
7068
7068
  }),
7069
7069
  PanelComponent: ({ appState, updateData }) => /* @__PURE__ */ jsx42(
7070
7070
  ToolButton,
@@ -7086,7 +7086,7 @@ var actionToggleEditMenu = register({
7086
7086
  ...appState,
7087
7087
  openMenu: appState.openMenu === "shape" ? null : "shape"
7088
7088
  },
7089
- storeAction: StoreAction.NONE
7089
+ captureUpdate: CaptureUpdateAction.EVENTUALLY
7090
7090
  }),
7091
7091
  PanelComponent: ({ elements, appState, updateData }) => /* @__PURE__ */ jsx42(
7092
7092
  ToolButton,
@@ -7120,7 +7120,7 @@ var actionShortcuts = register({
7120
7120
  name: "help"
7121
7121
  }
7122
7122
  },
7123
- storeAction: StoreAction.NONE
7123
+ captureUpdate: CaptureUpdateAction.EVENTUALLY
7124
7124
  };
7125
7125
  },
7126
7126
  keyTest: (event) => event.key === KEYS.QUESTION_MARK
@@ -7162,7 +7162,11 @@ var actionGroup = register({
7162
7162
  })
7163
7163
  );
7164
7164
  if (selectedElements.length < 2) {
7165
- return { appState, elements, storeAction: StoreAction.NONE };
7165
+ return {
7166
+ appState,
7167
+ elements,
7168
+ captureUpdate: CaptureUpdateAction.EVENTUALLY
7169
+ };
7166
7170
  }
7167
7171
  const selectedGroupIds = getSelectedGroupIds(appState);
7168
7172
  if (selectedGroupIds.length === 1) {
@@ -7180,7 +7184,11 @@ var actionGroup = register({
7180
7184
  ...Array.from(selectedElementIds)
7181
7185
  ]);
7182
7186
  if (combinedSet.size === elementIdsInGroup.size) {
7183
- return { appState, elements, storeAction: StoreAction.NONE };
7187
+ return {
7188
+ appState,
7189
+ elements,
7190
+ captureUpdate: CaptureUpdateAction.EVENTUALLY
7191
+ };
7184
7192
  }
7185
7193
  }
7186
7194
  let nextElements = [...elements];
@@ -7231,7 +7239,7 @@ var actionGroup = register({
7231
7239
  )
7232
7240
  },
7233
7241
  elements: reorderedElements,
7234
- storeAction: StoreAction.CAPTURE
7242
+ captureUpdate: CaptureUpdateAction.IMMEDIATELY
7235
7243
  };
7236
7244
  },
7237
7245
  predicate: (elements, appState, _, app) => enableActionGroup(elements, appState, app),
@@ -7258,7 +7266,11 @@ var actionUngroup = register({
7258
7266
  const groupIds = getSelectedGroupIds(appState);
7259
7267
  const elementsMap = arrayToMap(elements);
7260
7268
  if (groupIds.length === 0) {
7261
- return { appState, elements, storeAction: StoreAction.NONE };
7269
+ return {
7270
+ appState,
7271
+ elements,
7272
+ captureUpdate: CaptureUpdateAction.EVENTUALLY
7273
+ };
7262
7274
  }
7263
7275
  let nextElements = [...elements];
7264
7276
  const boundTextElementIds = [];
@@ -7319,7 +7331,7 @@ var actionUngroup = register({
7319
7331
  return {
7320
7332
  appState: { ...appState, ...updateAppState },
7321
7333
  elements: nextElements,
7322
- storeAction: StoreAction.CAPTURE
7334
+ captureUpdate: CaptureUpdateAction.IMMEDIATELY
7323
7335
  };
7324
7336
  },
7325
7337
  keyTest: (event) => event.shiftKey && event[KEYS.CTRL_OR_CMD] && event.key === KEYS.G.toUpperCase(),
@@ -7585,7 +7597,7 @@ var actionGoToCollaborator = register({
7585
7597
  ...appState,
7586
7598
  userToFollow: null
7587
7599
  },
7588
- storeAction: StoreAction.NONE
7600
+ captureUpdate: CaptureUpdateAction.EVENTUALLY
7589
7601
  };
7590
7602
  }
7591
7603
  return {
@@ -7598,7 +7610,7 @@ var actionGoToCollaborator = register({
7598
7610
  // Close mobile menu
7599
7611
  openMenu: appState.openMenu === "canvas" ? null : appState.openMenu
7600
7612
  },
7601
- storeAction: StoreAction.NONE
7613
+ captureUpdate: CaptureUpdateAction.EVENTUALLY
7602
7614
  };
7603
7615
  },
7604
7616
  PanelComponent: ({ updateData, data, appState }) => {
@@ -7699,7 +7711,7 @@ var actionAddToLibrary = register({
7699
7711
  for (const type of LIBRARY_DISABLED_TYPES) {
7700
7712
  if (selectedElements.some((element) => element.type === type)) {
7701
7713
  return {
7702
- storeAction: StoreAction.NONE,
7714
+ captureUpdate: CaptureUpdateAction.EVENTUALLY,
7703
7715
  appState: {
7704
7716
  ...appState,
7705
7717
  errorMessage: t(`errors.libraryElementTypeError.${type}`)
@@ -7719,7 +7731,7 @@ var actionAddToLibrary = register({
7719
7731
  ]);
7720
7732
  }).then(() => {
7721
7733
  return {
7722
- storeAction: StoreAction.NONE,
7734
+ captureUpdate: CaptureUpdateAction.EVENTUALLY,
7723
7735
  appState: {
7724
7736
  ...appState,
7725
7737
  toast: { message: t("toast.addedToLibrary") }
@@ -7727,7 +7739,7 @@ var actionAddToLibrary = register({
7727
7739
  };
7728
7740
  }).catch((error) => {
7729
7741
  return {
7730
- storeAction: StoreAction.NONE,
7742
+ captureUpdate: CaptureUpdateAction.EVENTUALLY,
7731
7743
  appState: {
7732
7744
  ...appState,
7733
7745
  errorMessage: error.message
@@ -7820,7 +7832,7 @@ var actionAlignTop = register({
7820
7832
  position: "start",
7821
7833
  axis: "y"
7822
7834
  }),
7823
- storeAction: StoreAction.CAPTURE
7835
+ captureUpdate: CaptureUpdateAction.IMMEDIATELY
7824
7836
  };
7825
7837
  },
7826
7838
  keyTest: (event) => event[KEYS.CTRL_OR_CMD] && event.shiftKey && event.key === KEYS.ARROW_UP,
@@ -7852,7 +7864,7 @@ var actionAlignBottom = register({
7852
7864
  position: "end",
7853
7865
  axis: "y"
7854
7866
  }),
7855
- storeAction: StoreAction.CAPTURE
7867
+ captureUpdate: CaptureUpdateAction.IMMEDIATELY
7856
7868
  };
7857
7869
  },
7858
7870
  keyTest: (event) => event[KEYS.CTRL_OR_CMD] && event.shiftKey && event.key === KEYS.ARROW_DOWN,
@@ -7884,7 +7896,7 @@ var actionAlignLeft = register({
7884
7896
  position: "start",
7885
7897
  axis: "x"
7886
7898
  }),
7887
- storeAction: StoreAction.CAPTURE
7899
+ captureUpdate: CaptureUpdateAction.IMMEDIATELY
7888
7900
  };
7889
7901
  },
7890
7902
  keyTest: (event) => event[KEYS.CTRL_OR_CMD] && event.shiftKey && event.key === KEYS.ARROW_LEFT,
@@ -7916,7 +7928,7 @@ var actionAlignRight = register({
7916
7928
  position: "end",
7917
7929
  axis: "x"
7918
7930
  }),
7919
- storeAction: StoreAction.CAPTURE
7931
+ captureUpdate: CaptureUpdateAction.IMMEDIATELY
7920
7932
  };
7921
7933
  },
7922
7934
  keyTest: (event) => event[KEYS.CTRL_OR_CMD] && event.shiftKey && event.key === KEYS.ARROW_RIGHT,
@@ -7948,7 +7960,7 @@ var actionAlignVerticallyCentered = register({
7948
7960
  position: "center",
7949
7961
  axis: "y"
7950
7962
  }),
7951
- storeAction: StoreAction.CAPTURE
7963
+ captureUpdate: CaptureUpdateAction.IMMEDIATELY
7952
7964
  };
7953
7965
  },
7954
7966
  PanelComponent: ({ elements, appState, updateData, app }) => /* @__PURE__ */ jsx46(
@@ -7977,7 +7989,7 @@ var actionAlignHorizontallyCentered = register({
7977
7989
  position: "center",
7978
7990
  axis: "x"
7979
7991
  }),
7980
- storeAction: StoreAction.CAPTURE
7992
+ captureUpdate: CaptureUpdateAction.IMMEDIATELY
7981
7993
  };
7982
7994
  },
7983
7995
  PanelComponent: ({ elements, appState, updateData, app }) => /* @__PURE__ */ jsx46(
@@ -8076,7 +8088,7 @@ var distributeHorizontally = register({
8076
8088
  space: "between",
8077
8089
  axis: "x"
8078
8090
  }),
8079
- storeAction: StoreAction.CAPTURE
8091
+ captureUpdate: CaptureUpdateAction.IMMEDIATELY
8080
8092
  };
8081
8093
  },
8082
8094
  keyTest: (event) => !event[KEYS.CTRL_OR_CMD] && event.altKey && event.code === CODES.H,
@@ -8106,7 +8118,7 @@ var distributeVertically = register({
8106
8118
  space: "between",
8107
8119
  axis: "y"
8108
8120
  }),
8109
- storeAction: StoreAction.CAPTURE
8121
+ captureUpdate: CaptureUpdateAction.IMMEDIATELY
8110
8122
  };
8111
8123
  },
8112
8124
  keyTest: (event) => !event[KEYS.CTRL_OR_CMD] && event.altKey && event.code === CODES.V,
@@ -8144,7 +8156,7 @@ var actionFlipHorizontal = register({
8144
8156
  app
8145
8157
  ),
8146
8158
  appState,
8147
- storeAction: StoreAction.CAPTURE
8159
+ captureUpdate: CaptureUpdateAction.IMMEDIATELY
8148
8160
  };
8149
8161
  },
8150
8162
  keyTest: (event) => event.shiftKey && event.code === CODES.H
@@ -8168,7 +8180,7 @@ var actionFlipVertical = register({
8168
8180
  app
8169
8181
  ),
8170
8182
  appState,
8171
- storeAction: StoreAction.CAPTURE
8183
+ captureUpdate: CaptureUpdateAction.IMMEDIATELY
8172
8184
  };
8173
8185
  },
8174
8186
  keyTest: (event) => event.shiftKey && event.code === CODES.V && !event[KEYS.CTRL_OR_CMD]
@@ -8271,7 +8283,7 @@ var actionCopy = register({
8271
8283
  await copyToClipboard(elementsToCopy, app.files, event);
8272
8284
  } catch (error) {
8273
8285
  return {
8274
- storeAction: StoreAction.NONE,
8286
+ captureUpdate: CaptureUpdateAction.EVENTUALLY,
8275
8287
  appState: {
8276
8288
  ...appState,
8277
8289
  errorMessage: error.message
@@ -8279,7 +8291,7 @@ var actionCopy = register({
8279
8291
  };
8280
8292
  }
8281
8293
  return {
8282
- storeAction: StoreAction.NONE
8294
+ captureUpdate: CaptureUpdateAction.EVENTUALLY
8283
8295
  };
8284
8296
  },
8285
8297
  // don't supply a shortcut since we handle this conditionally via onCopy event
@@ -8300,7 +8312,7 @@ var actionPaste = register({
8300
8312
  console.error(`actionPaste ${error.name}: ${error.message}`);
8301
8313
  if (isFirefox) {
8302
8314
  return {
8303
- storeAction: StoreAction.NONE,
8315
+ captureUpdate: CaptureUpdateAction.EVENTUALLY,
8304
8316
  appState: {
8305
8317
  ...appState,
8306
8318
  errorMessage: t("hints.firefox_clipboard_write")
@@ -8308,7 +8320,7 @@ var actionPaste = register({
8308
8320
  };
8309
8321
  }
8310
8322
  return {
8311
- storeAction: StoreAction.NONE,
8323
+ captureUpdate: CaptureUpdateAction.EVENTUALLY,
8312
8324
  appState: {
8313
8325
  ...appState,
8314
8326
  errorMessage: t("errors.asyncPasteFailedOnRead")
@@ -8320,7 +8332,7 @@ var actionPaste = register({
8320
8332
  } catch (error) {
8321
8333
  console.error(error);
8322
8334
  return {
8323
- storeAction: StoreAction.NONE,
8335
+ captureUpdate: CaptureUpdateAction.EVENTUALLY,
8324
8336
  appState: {
8325
8337
  ...appState,
8326
8338
  errorMessage: t("errors.asyncPasteFailedOnParse")
@@ -8328,7 +8340,7 @@ var actionPaste = register({
8328
8340
  };
8329
8341
  }
8330
8342
  return {
8331
- storeAction: StoreAction.NONE
8343
+ captureUpdate: CaptureUpdateAction.EVENTUALLY
8332
8344
  };
8333
8345
  },
8334
8346
  // don't supply a shortcut since we handle this conditionally via onCopy event
@@ -8353,7 +8365,7 @@ var actionCopyAsSvg = register({
8353
8365
  perform: async (elements, appState, _data, app) => {
8354
8366
  if (!app.canvas) {
8355
8367
  return {
8356
- storeAction: StoreAction.NONE
8368
+ captureUpdate: CaptureUpdateAction.EVENTUALLY
8357
8369
  };
8358
8370
  }
8359
8371
  const { exportedElements, exportingFrame } = prepareElementsForExport(
@@ -8385,7 +8397,7 @@ var actionCopyAsSvg = register({
8385
8397
  })
8386
8398
  }
8387
8399
  },
8388
- storeAction: StoreAction.NONE
8400
+ captureUpdate: CaptureUpdateAction.EVENTUALLY
8389
8401
  };
8390
8402
  } catch (error) {
8391
8403
  console.error(error);
@@ -8393,7 +8405,7 @@ var actionCopyAsSvg = register({
8393
8405
  appState: {
8394
8406
  errorMessage: error.message
8395
8407
  },
8396
- storeAction: StoreAction.NONE
8408
+ captureUpdate: CaptureUpdateAction.EVENTUALLY
8397
8409
  };
8398
8410
  }
8399
8411
  },
@@ -8410,7 +8422,7 @@ var actionCopyAsPng = register({
8410
8422
  perform: async (elements, appState, _data, app) => {
8411
8423
  if (!app.canvas) {
8412
8424
  return {
8413
- storeAction: StoreAction.NONE
8425
+ captureUpdate: CaptureUpdateAction.EVENTUALLY
8414
8426
  };
8415
8427
  }
8416
8428
  const selectedElements = app.scene.getSelectedElements({
@@ -8443,7 +8455,7 @@ var actionCopyAsPng = register({
8443
8455
  })
8444
8456
  }
8445
8457
  },
8446
- storeAction: StoreAction.NONE
8458
+ captureUpdate: CaptureUpdateAction.EVENTUALLY
8447
8459
  };
8448
8460
  } catch (error) {
8449
8461
  console.error(error);
@@ -8452,7 +8464,7 @@ var actionCopyAsPng = register({
8452
8464
  ...appState,
8453
8465
  errorMessage: error.message
8454
8466
  },
8455
- storeAction: StoreAction.NONE
8467
+ captureUpdate: CaptureUpdateAction.EVENTUALLY
8456
8468
  };
8457
8469
  }
8458
8470
  },
@@ -8477,7 +8489,7 @@ var copyText = register({
8477
8489
  throw new Error(t("errors.copyToSystemClipboardFailed"));
8478
8490
  }
8479
8491
  return {
8480
- storeAction: StoreAction.NONE
8492
+ captureUpdate: CaptureUpdateAction.EVENTUALLY
8481
8493
  };
8482
8494
  },
8483
8495
  predicate: (elements, appState, _, app) => {
@@ -8507,7 +8519,7 @@ var actionToggleGridMode = register({
8507
8519
  gridModeEnabled: !this.checked(appState),
8508
8520
  objectsSnapModeEnabled: false
8509
8521
  },
8510
- storeAction: StoreAction.NONE
8522
+ captureUpdate: CaptureUpdateAction.EVENTUALLY
8511
8523
  };
8512
8524
  },
8513
8525
  checked: (appState) => appState.gridModeEnabled,
@@ -8534,7 +8546,7 @@ var actionToggleZenMode = register({
8534
8546
  ...appState,
8535
8547
  zenModeEnabled: !this.checked(appState)
8536
8548
  },
8537
- storeAction: StoreAction.NONE
8549
+ captureUpdate: CaptureUpdateAction.EVENTUALLY
8538
8550
  };
8539
8551
  },
8540
8552
  checked: (appState) => appState.zenModeEnabled,
@@ -8561,7 +8573,7 @@ var actionToggleObjectsSnapMode = register({
8561
8573
  objectsSnapModeEnabled: !this.checked(appState),
8562
8574
  gridModeEnabled: false
8563
8575
  },
8564
- storeAction: StoreAction.NONE
8576
+ captureUpdate: CaptureUpdateAction.EVENTUALLY
8565
8577
  };
8566
8578
  },
8567
8579
  checked: (appState) => appState.objectsSnapModeEnabled,
@@ -8586,7 +8598,7 @@ var actionToggleStats = register({
8586
8598
  ...appState,
8587
8599
  stats: { ...appState.stats, open: !this.checked(appState) }
8588
8600
  },
8589
- storeAction: StoreAction.NONE
8601
+ captureUpdate: CaptureUpdateAction.EVENTUALLY
8590
8602
  };
8591
8603
  },
8592
8604
  checked: (appState) => appState.stats.open,
@@ -8641,7 +8653,7 @@ var actionUnbindText = register({
8641
8653
  return {
8642
8654
  elements,
8643
8655
  appState,
8644
- storeAction: StoreAction.CAPTURE
8656
+ captureUpdate: CaptureUpdateAction.IMMEDIATELY
8645
8657
  };
8646
8658
  }
8647
8659
  });
@@ -8701,7 +8713,7 @@ var actionBindText = register({
8701
8713
  return {
8702
8714
  elements: pushTextAboveContainer(elements, container, textElement),
8703
8715
  appState: { ...appState, selectedElementIds: { [container.id]: true } },
8704
- storeAction: StoreAction.CAPTURE
8716
+ captureUpdate: CaptureUpdateAction.IMMEDIATELY
8705
8717
  };
8706
8718
  }
8707
8719
  });
@@ -8829,7 +8841,7 @@ var actionWrapTextInContainer = register({
8829
8841
  ...appState,
8830
8842
  selectedElementIds: containerIds
8831
8843
  },
8832
- storeAction: StoreAction.CAPTURE
8844
+ captureUpdate: CaptureUpdateAction.IMMEDIATELY
8833
8845
  };
8834
8846
  }
8835
8847
  });
@@ -9193,7 +9205,7 @@ var actionLink = register({
9193
9205
  showHyperlinkPopup: "editor",
9194
9206
  openMenu: null
9195
9207
  },
9196
- storeAction: StoreAction.CAPTURE
9208
+ captureUpdate: CaptureUpdateAction.IMMEDIATELY
9197
9209
  };
9198
9210
  },
9199
9211
  trackEvent: { category: "hyperlink", action: "click" },
@@ -9263,7 +9275,7 @@ var actionToggleElementLock = register({
9263
9275
  ...appState,
9264
9276
  selectedLinearElement: nextLockState ? null : appState.selectedLinearElement
9265
9277
  },
9266
- storeAction: StoreAction.CAPTURE
9278
+ captureUpdate: CaptureUpdateAction.IMMEDIATELY
9267
9279
  };
9268
9280
  },
9269
9281
  keyTest: (event, appState, elements, app) => {
@@ -9298,7 +9310,7 @@ var actionUnlockAllElements = register({
9298
9310
  lockedElements.map((el) => [el.id, true])
9299
9311
  )
9300
9312
  },
9301
- storeAction: StoreAction.CAPTURE
9313
+ captureUpdate: CaptureUpdateAction.IMMEDIATELY
9302
9314
  };
9303
9315
  },
9304
9316
  label: "labels.elementLock.unlockAll"
@@ -12782,14 +12794,14 @@ var actionCopyElementLink = register({
12782
12794
  closable: true
12783
12795
  }
12784
12796
  },
12785
- storeAction: StoreAction.NONE
12797
+ captureUpdate: CaptureUpdateAction.EVENTUALLY
12786
12798
  };
12787
12799
  }
12788
12800
  return {
12789
12801
  appState,
12790
12802
  elements,
12791
12803
  app,
12792
- storeAction: StoreAction.NONE
12804
+ captureUpdate: CaptureUpdateAction.EVENTUALLY
12793
12805
  };
12794
12806
  }
12795
12807
  } catch (error) {
@@ -12799,7 +12811,7 @@ var actionCopyElementLink = register({
12799
12811
  appState,
12800
12812
  elements,
12801
12813
  app,
12802
- storeAction: StoreAction.NONE
12814
+ captureUpdate: CaptureUpdateAction.EVENTUALLY
12803
12815
  };
12804
12816
  },
12805
12817
  predicate: (elements, appState) => canCreateLinkFromElements(getSelectedElements(elements, appState))
@@ -12811,7 +12823,12 @@ var actionLinkToElement = register({
12811
12823
  perform: (elements, appState, _, app) => {
12812
12824
  const selectedElements = getSelectedElements(elements, appState);
12813
12825
  if (selectedElements.length !== 1 || !canCreateLinkFromElements(selectedElements)) {
12814
- return { elements, appState, app, storeAction: StoreAction.NONE };
12826
+ return {
12827
+ elements,
12828
+ appState,
12829
+ app,
12830
+ captureUpdate: CaptureUpdateAction.EVENTUALLY
12831
+ };
12815
12832
  }
12816
12833
  return {
12817
12834
  appState: {
@@ -12821,7 +12838,7 @@ var actionLinkToElement = register({
12821
12838
  sourceElementId: getSelectedElements(elements, appState)[0].id
12822
12839
  }
12823
12840
  },
12824
- storeAction: StoreAction.CAPTURE
12841
+ captureUpdate: CaptureUpdateAction.IMMEDIATELY
12825
12842
  };
12826
12843
  },
12827
12844
  predicate: (elements, appState, appProps, app) => {
@@ -13586,7 +13603,7 @@ var actionToggleLinearEditor = register({
13586
13603
  ...appState,
13587
13604
  editingLinearElement
13588
13605
  },
13589
- storeAction: StoreAction.CAPTURE
13606
+ captureUpdate: CaptureUpdateAction.IMMEDIATELY
13590
13607
  };
13591
13608
  },
13592
13609
  PanelComponent: ({ appState, updateData, app }) => {
@@ -13629,7 +13646,7 @@ var actionToggleSearchMenu = register({
13629
13646
  if (searchInput?.matches(":focus")) {
13630
13647
  return {
13631
13648
  appState: { ...appState, openSidebar: null },
13632
- storeAction: StoreAction.NONE
13649
+ captureUpdate: CaptureUpdateAction.EVENTUALLY
13633
13650
  };
13634
13651
  }
13635
13652
  searchInput?.focus();
@@ -13642,7 +13659,7 @@ var actionToggleSearchMenu = register({
13642
13659
  openSidebar: { name: DEFAULT_SIDEBAR.name, tab: CANVAS_SEARCH_TAB },
13643
13660
  openDialog: null
13644
13661
  },
13645
- storeAction: StoreAction.NONE
13662
+ captureUpdate: CaptureUpdateAction.EVENTUALLY
13646
13663
  };
13647
13664
  },
13648
13665
  checked: (appState) => appState.gridModeEnabled,
@@ -13672,7 +13689,7 @@ var actionToggleCropEditor = register({
13672
13689
  isCropping: false,
13673
13690
  croppingElementId: selectedElement.id
13674
13691
  },
13675
- storeAction: StoreAction.CAPTURE
13692
+ captureUpdate: CaptureUpdateAction.IMMEDIATELY
13676
13693
  };
13677
13694
  },
13678
13695
  predicate: (elements, appState, _, app) => {
@@ -13848,17 +13865,17 @@ var executeHistoryAction = (app, appState, updater) => {
13848
13865
  if (!appState.multiElement && !appState.resizingElement && !appState.editingTextElement && !appState.newElement && !appState.selectedElementsAreBeingDragged && !appState.selectionElement && !app.flowChartCreator.isCreatingChart) {
13849
13866
  const result = updater();
13850
13867
  if (!result) {
13851
- return { storeAction: StoreAction.NONE };
13868
+ return { captureUpdate: CaptureUpdateAction.EVENTUALLY };
13852
13869
  }
13853
13870
  const [nextElementsMap, nextAppState] = result;
13854
13871
  const nextElements = Array.from(nextElementsMap.values());
13855
13872
  return {
13856
13873
  appState: nextAppState,
13857
13874
  elements: nextElements,
13858
- storeAction: StoreAction.UPDATE
13875
+ captureUpdate: CaptureUpdateAction.NEVER
13859
13876
  };
13860
13877
  }
13861
- return { storeAction: StoreAction.NONE };
13878
+ return { captureUpdate: CaptureUpdateAction.EVENTUALLY };
13862
13879
  };
13863
13880
  var createUndoAction = (history, store) => ({
13864
13881
  name: "undo",
@@ -19340,7 +19357,9 @@ var StatsDragInput = ({
19340
19357
  originalAppState: appState2,
19341
19358
  setInputValue: (value2) => setInputValue(String(value2))
19342
19359
  });
19343
- app.syncActionResult({ storeAction: StoreAction.CAPTURE });
19360
+ app.syncActionResult({
19361
+ captureUpdate: CaptureUpdateAction.IMMEDIATELY
19362
+ });
19344
19363
  }
19345
19364
  };
19346
19365
  const callbacksRef = useRef34({});
@@ -19444,7 +19463,9 @@ var StatsDragInput = ({
19444
19463
  onPointerMove,
19445
19464
  false
19446
19465
  );
19447
- app.syncActionResult({ storeAction: StoreAction.CAPTURE });
19466
+ app.syncActionResult({
19467
+ captureUpdate: CaptureUpdateAction.IMMEDIATELY
19468
+ });
19448
19469
  lastPointer = null;
19449
19470
  accumulatedChange = 0;
19450
19471
  stepChange = 0;
@@ -21724,7 +21745,7 @@ var actionToggleViewMode = register({
21724
21745
  ...appState,
21725
21746
  viewModeEnabled: !this.checked(appState)
21726
21747
  },
21727
- storeAction: StoreAction.NONE
21748
+ captureUpdate: CaptureUpdateAction.EVENTUALLY
21728
21749
  };
21729
21750
  },
21730
21751
  checked: (appState) => appState.viewModeEnabled,
@@ -21762,13 +21783,13 @@ var actionSelectAllElementsInFrame = register({
21762
21783
  return acc;
21763
21784
  }, {})
21764
21785
  },
21765
- storeAction: StoreAction.CAPTURE
21786
+ captureUpdate: CaptureUpdateAction.IMMEDIATELY
21766
21787
  };
21767
21788
  }
21768
21789
  return {
21769
21790
  elements,
21770
21791
  appState,
21771
- storeAction: StoreAction.NONE
21792
+ captureUpdate: CaptureUpdateAction.EVENTUALLY
21772
21793
  };
21773
21794
  },
21774
21795
  predicate: (elements, appState, _, app) => isSingleFrameSelected(appState, app)
@@ -21788,13 +21809,13 @@ var actionRemoveAllElementsFromFrame = register({
21788
21809
  [selectedElement.id]: true
21789
21810
  }
21790
21811
  },
21791
- storeAction: StoreAction.CAPTURE
21812
+ captureUpdate: CaptureUpdateAction.IMMEDIATELY
21792
21813
  };
21793
21814
  }
21794
21815
  return {
21795
21816
  elements,
21796
21817
  appState,
21797
- storeAction: StoreAction.NONE
21818
+ captureUpdate: CaptureUpdateAction.EVENTUALLY
21798
21819
  };
21799
21820
  },
21800
21821
  predicate: (elements, appState, _, app) => isSingleFrameSelected(appState, app)
@@ -21814,7 +21835,7 @@ var actionupdateFrameRendering = register({
21814
21835
  enabled: !appState.frameRendering.enabled
21815
21836
  }
21816
21837
  },
21817
- storeAction: StoreAction.NONE
21838
+ captureUpdate: CaptureUpdateAction.EVENTUALLY
21818
21839
  };
21819
21840
  },
21820
21841
  checked: (appState) => appState.frameRendering.enabled
@@ -21841,7 +21862,7 @@ var actionSetFrameAsActiveTool = register({
21841
21862
  type: "frame"
21842
21863
  })
21843
21864
  },
21844
- storeAction: StoreAction.NONE
21865
+ captureUpdate: CaptureUpdateAction.EVENTUALLY
21845
21866
  };
21846
21867
  },
21847
21868
  keyTest: (event) => !event[KEYS.CTRL_OR_CMD] && !event.shiftKey && !event.altKey && event.key.toLocaleLowerCase() === KEYS.F
@@ -21894,7 +21915,7 @@ var actionWrapSelectionInFrame = register({
21894
21915
  appState: {
21895
21916
  selectedElementIds: { [frame.id]: true }
21896
21917
  },
21897
- storeAction: StoreAction.CAPTURE
21918
+ captureUpdate: CaptureUpdateAction.IMMEDIATELY
21898
21919
  };
21899
21920
  }
21900
21921
  });
@@ -24650,7 +24671,7 @@ var actionTextAutoResize = register({
24650
24671
  }
24651
24672
  return element;
24652
24673
  }),
24653
- storeAction: StoreAction.CAPTURE
24674
+ captureUpdate: CaptureUpdateAction.IMMEDIATELY
24654
24675
  };
24655
24676
  }
24656
24677
  });
@@ -25225,12 +25246,12 @@ var App = class _App extends React43.Component {
25225
25246
  if (shouldUpdateStrokeColor) {
25226
25247
  this.syncActionResult({
25227
25248
  appState: { ...this.state, currentItemStrokeColor: color },
25228
- storeAction: StoreAction.CAPTURE
25249
+ captureUpdate: CaptureUpdateAction.IMMEDIATELY
25229
25250
  });
25230
25251
  } else {
25231
25252
  this.syncActionResult({
25232
25253
  appState: { ...this.state, currentItemBackgroundColor: color },
25233
- storeAction: StoreAction.CAPTURE
25254
+ captureUpdate: CaptureUpdateAction.IMMEDIATELY
25234
25255
  });
25235
25256
  }
25236
25257
  } else {
@@ -25243,7 +25264,7 @@ var App = class _App extends React43.Component {
25243
25264
  }
25244
25265
  return el;
25245
25266
  }),
25246
- storeAction: StoreAction.CAPTURE
25267
+ captureUpdate: CaptureUpdateAction.IMMEDIATELY
25247
25268
  });
25248
25269
  }
25249
25270
  },
@@ -25261,9 +25282,9 @@ var App = class _App extends React43.Component {
25261
25282
  if (this.unmounted || actionResult === false) {
25262
25283
  return;
25263
25284
  }
25264
- if (actionResult.storeAction === StoreAction.UPDATE) {
25285
+ if (actionResult.captureUpdate === CaptureUpdateAction.NEVER) {
25265
25286
  this.store.shouldUpdateSnapshot();
25266
- } else if (actionResult.storeAction === StoreAction.CAPTURE) {
25287
+ } else if (actionResult.captureUpdate === CaptureUpdateAction.IMMEDIATELY) {
25267
25288
  this.store.shouldCaptureIncrement();
25268
25289
  }
25269
25290
  let didUpdate = false;
@@ -25318,7 +25339,7 @@ var App = class _App extends React43.Component {
25318
25339
  });
25319
25340
  didUpdate = true;
25320
25341
  }
25321
- if (!didUpdate && actionResult.storeAction !== StoreAction.NONE) {
25342
+ if (!didUpdate && actionResult.captureUpdate !== CaptureUpdateAction.EVENTUALLY) {
25322
25343
  this.scene.triggerUpdate();
25323
25344
  }
25324
25345
  }));
@@ -25435,7 +25456,7 @@ var App = class _App extends React43.Component {
25435
25456
  this.resetHistory();
25436
25457
  this.syncActionResult({
25437
25458
  ...scene,
25438
- storeAction: StoreAction.UPDATE
25459
+ captureUpdate: CaptureUpdateAction.NEVER
25439
25460
  });
25440
25461
  this.clearImageShapeCache();
25441
25462
  this.fonts.loadSceneFonts().then((fontFaces) => {
@@ -26088,7 +26109,7 @@ var App = class _App extends React43.Component {
26088
26109
  __publicField(this, "updateScene", withBatchedUpdates(
26089
26110
  (sceneData) => {
26090
26111
  const nextElements = syncInvalidIndices(sceneData.elements ?? []);
26091
- if (sceneData.storeAction && sceneData.storeAction !== StoreAction.NONE) {
26112
+ if (sceneData.captureUpdate && sceneData.captureUpdate !== CaptureUpdateAction.EVENTUALLY) {
26092
26113
  const prevCommittedAppState = this.store.snapshot.appState;
26093
26114
  const prevCommittedElements = this.store.snapshot.elements;
26094
26115
  const nextCommittedAppState = sceneData.appState ? Object.assign({}, prevCommittedAppState, sceneData.appState) : prevCommittedAppState;
@@ -26098,12 +26119,12 @@ var App = class _App extends React43.Component {
26098
26119
  arrayToMap(nextElements)
26099
26120
  // We expect all (already reconciled) elements
26100
26121
  ) : prevCommittedElements;
26101
- if (sceneData.storeAction === StoreAction.CAPTURE) {
26122
+ if (sceneData.captureUpdate === CaptureUpdateAction.IMMEDIATELY) {
26102
26123
  this.store.captureIncrement(
26103
26124
  nextCommittedElements,
26104
26125
  nextCommittedAppState
26105
26126
  );
26106
- } else if (sceneData.storeAction === StoreAction.UPDATE) {
26127
+ } else if (sceneData.captureUpdate === CaptureUpdateAction.NEVER) {
26107
26128
  this.store.updateSnapshot(
26108
26129
  nextCommittedElements,
26109
26130
  nextCommittedAppState
@@ -26576,7 +26597,9 @@ var App = class _App extends React43.Component {
26576
26597
  if (!event.altKey) {
26577
26598
  if (this.flowChartNavigator.isExploring) {
26578
26599
  this.flowChartNavigator.clear();
26579
- this.syncActionResult({ storeAction: StoreAction.CAPTURE });
26600
+ this.syncActionResult({
26601
+ captureUpdate: CaptureUpdateAction.IMMEDIATELY
26602
+ });
26580
26603
  }
26581
26604
  }
26582
26605
  if (!event[KEYS.CTRL_OR_CMD]) {
@@ -26616,7 +26639,9 @@ var App = class _App extends React43.Component {
26616
26639
  }
26617
26640
  }
26618
26641
  this.flowChartCreator.clear();
26619
- this.syncActionResult({ storeAction: StoreAction.CAPTURE });
26642
+ this.syncActionResult({
26643
+ captureUpdate: CaptureUpdateAction.IMMEDIATELY
26644
+ });
26620
26645
  }
26621
26646
  }
26622
26647
  }));
@@ -27586,7 +27611,7 @@ var App = class _App extends React43.Component {
27586
27611
  this.state
27587
27612
  )
27588
27613
  },
27589
- storeAction: this.state.openDialog?.name === "elementLinkSelector" ? StoreAction.NONE : StoreAction.UPDATE
27614
+ captureUpdate: this.state.openDialog?.name === "elementLinkSelector" ? CaptureUpdateAction.EVENTUALLY : CaptureUpdateAction.NEVER
27590
27615
  });
27591
27616
  return;
27592
27617
  }
@@ -28943,7 +28968,7 @@ var App = class _App extends React43.Component {
28943
28968
  isLoading: false
28944
28969
  },
28945
28970
  replaceFiles: true,
28946
- storeAction: StoreAction.CAPTURE
28971
+ captureUpdate: CaptureUpdateAction.IMMEDIATELY
28947
28972
  });
28948
28973
  return;
28949
28974
  } catch (error) {
@@ -29041,7 +29066,7 @@ var App = class _App extends React43.Component {
29041
29066
  isLoading: false
29042
29067
  },
29043
29068
  replaceFiles: true,
29044
- storeAction: StoreAction.CAPTURE
29069
+ captureUpdate: CaptureUpdateAction.IMMEDIATELY
29045
29070
  });
29046
29071
  } else if (ret.type === MIME_TYPES.excalidrawlib) {
29047
29072
  await this.library.updateLibrary({
@@ -32207,7 +32232,7 @@ var App = class _App extends React43.Component {
32207
32232
  appState: {
32208
32233
  newElement: null
32209
32234
  },
32210
- storeAction: StoreAction.UPDATE
32235
+ captureUpdate: CaptureUpdateAction.NEVER
32211
32236
  });
32212
32237
  return;
32213
32238
  }
@@ -32327,7 +32352,7 @@ var App = class _App extends React43.Component {
32327
32352
  if (resizingElement && isInvisiblySmallElement(resizingElement)) {
32328
32353
  this.updateScene({
32329
32354
  elements: this.scene.getElementsIncludingDeleted().filter((el) => el.id !== resizingElement.id),
32330
- storeAction: StoreAction.UPDATE
32355
+ captureUpdate: CaptureUpdateAction.NEVER
32331
32356
  });
32332
32357
  }
32333
32358
  if (pointerDownState.resize.isResizing) {
@@ -33264,6 +33289,7 @@ var Excalidraw = React44.memo(ExcalidrawBase, areEqual5);
33264
33289
  Excalidraw.displayName = "Excalidraw";
33265
33290
  export {
33266
33291
  Button,
33292
+ CaptureUpdateAction,
33267
33293
  CommandPalette,
33268
33294
  DEFAULT_LASER_COLOR,
33269
33295
  DefaultSidebar,
@@ -33277,7 +33303,6 @@ export {
33277
33303
  ROUNDNESS,
33278
33304
  Sidebar,
33279
33305
  Stats,
33280
- StoreAction,
33281
33306
  THEME,
33282
33307
  TTDDialog,
33283
33308
  TTDDialogTrigger,