@myoc/excalidraw 0.18.5 → 0.18.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.
Files changed (77) hide show
  1. package/dist/dev/{chunk-XKDJIA35.js → chunk-3PM7AKUW.js} +124 -195
  2. package/dist/dev/chunk-3PM7AKUW.js.map +7 -0
  3. package/dist/dev/{chunk-626MKRIR.js → chunk-FAI3BF6J.js} +2 -2
  4. package/dist/dev/{chunk-6MXLCRC3.js → chunk-PEI7EPYO.js} +3 -1
  5. package/dist/dev/chunk-PEI7EPYO.js.map +7 -0
  6. package/dist/dev/data/{image-M4KEBNT4.js → image-PLZ7Q7VH.js} +3 -3
  7. package/dist/dev/index.css +29 -7
  8. package/dist/dev/index.css.map +2 -2
  9. package/dist/dev/index.js +1425 -1024
  10. package/dist/dev/index.js.map +4 -4
  11. package/dist/dev/locales/{en-FBYNI7ML.js → en-R455UJTM.js} +2 -2
  12. package/dist/dev/subset-shared.chunk.js +1 -1
  13. package/dist/dev/subset-worker.chunk.js +1 -1
  14. package/dist/prod/{chunk-44FCZ7FO.js → chunk-BBP5YSOX.js} +1 -1
  15. package/dist/prod/chunk-FOAZJPGC.js +33 -0
  16. package/dist/prod/{chunk-6NO4X5TH.js → chunk-KZWZ7WHC.js} +3 -3
  17. package/dist/prod/data/image-4IHLZPM6.js +1 -0
  18. package/dist/prod/index.css +1 -1
  19. package/dist/prod/index.js +16 -16
  20. package/dist/prod/locales/{en-RF5UZHGV.js → en-YWERZJD6.js} +1 -1
  21. package/dist/prod/subset-shared.chunk.js +1 -1
  22. package/dist/prod/subset-worker.chunk.js +1 -1
  23. package/dist/types/common/src/utils.d.ts +3 -0
  24. package/dist/types/element/src/arrange-algorithms/packer.d.ts +30 -0
  25. package/dist/types/element/src/arrange.d.ts +3 -0
  26. package/dist/types/element/src/binding.d.ts +1 -2
  27. package/dist/types/element/src/bounds.d.ts +2 -2
  28. package/dist/types/element/src/duplicate.d.ts +10 -13
  29. package/dist/types/element/src/frame.d.ts +1 -1
  30. package/dist/types/element/src/selection.d.ts +11 -0
  31. package/dist/types/element/src/types.d.ts +1 -0
  32. package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +12 -0
  33. package/dist/types/excalidraw/actions/actionArrange.d.ts +30 -0
  34. package/dist/types/excalidraw/actions/actionBoundText.d.ts +8 -0
  35. package/dist/types/excalidraw/actions/actionCanvas.d.ts +48 -0
  36. package/dist/types/excalidraw/actions/actionClipboard.d.ts +24 -0
  37. package/dist/types/excalidraw/actions/actionCropEditor.d.ts +4 -0
  38. package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +12 -0
  39. package/dist/types/excalidraw/actions/actionElementLink.d.ts +4 -0
  40. package/dist/types/excalidraw/actions/actionElementLock.d.ts +8 -0
  41. package/dist/types/excalidraw/actions/actionEmbeddable.d.ts +4 -0
  42. package/dist/types/excalidraw/actions/actionExport.d.ts +36 -0
  43. package/dist/types/excalidraw/actions/actionFinalize.d.ts +8 -0
  44. package/dist/types/excalidraw/actions/actionFrame.d.ts +16 -0
  45. package/dist/types/excalidraw/actions/actionGroup.d.ts +8 -0
  46. package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +4 -0
  47. package/dist/types/excalidraw/actions/actionLink.d.ts +4 -0
  48. package/dist/types/excalidraw/actions/actionMenu.d.ts +12 -0
  49. package/dist/types/excalidraw/actions/actionNavigate.d.ts +8 -0
  50. package/dist/types/excalidraw/actions/actionProperties.d.ts +60 -0
  51. package/dist/types/excalidraw/actions/actionSelectAll.d.ts +4 -0
  52. package/dist/types/excalidraw/actions/actionStyles.d.ts +4 -0
  53. package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +4 -0
  54. package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +4 -0
  55. package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +8 -0
  56. package/dist/types/excalidraw/actions/actionToggleStats.d.ts +4 -0
  57. package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +5 -0
  58. package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +4 -0
  59. package/dist/types/excalidraw/actions/index.d.ts +1 -0
  60. package/dist/types/excalidraw/actions/shortcuts.d.ts +1 -1
  61. package/dist/types/excalidraw/actions/types.d.ts +1 -1
  62. package/dist/types/excalidraw/appState.d.ts +4 -0
  63. package/dist/types/excalidraw/components/App.d.ts +8 -0
  64. package/dist/types/excalidraw/components/canvases/InteractiveCanvas.d.ts +1 -0
  65. package/dist/types/excalidraw/components/icons.d.ts +2 -0
  66. package/dist/types/excalidraw/data/blob.d.ts +1 -1
  67. package/dist/types/excalidraw/scene/scrollbars.d.ts +2 -3
  68. package/dist/types/excalidraw/scene/types.d.ts +2 -0
  69. package/dist/types/excalidraw/types.d.ts +10 -1
  70. package/package.json +1 -1
  71. package/dist/dev/chunk-6MXLCRC3.js.map +0 -7
  72. package/dist/dev/chunk-XKDJIA35.js.map +0 -7
  73. package/dist/prod/chunk-RT42IMT3.js +0 -33
  74. package/dist/prod/data/image-NV63W4US.js +0 -1
  75. /package/dist/dev/{chunk-626MKRIR.js.map → chunk-FAI3BF6J.js.map} +0 -0
  76. /package/dist/dev/data/{image-M4KEBNT4.js.map → image-PLZ7Q7VH.js.map} +0 -0
  77. /package/dist/dev/locales/{en-FBYNI7ML.js.map → en-R455UJTM.js.map} +0 -0
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  define_import_meta_env_default
3
- } from "./chunk-626MKRIR.js";
3
+ } from "./chunk-FAI3BF6J.js";
4
4
  import {
5
5
  __publicField
6
6
  } from "./chunk-XDFCUUT6.js";
@@ -1872,6 +1872,12 @@ var elementCenterPoint = (element, xOffset = 0, yOffset = 0) => {
1872
1872
  const centerYPoint = y + height / 2 + yOffset;
1873
1873
  return pointFrom(centerXPoint, centerYPoint);
1874
1874
  };
1875
+ var isReadonlyArray = (value) => {
1876
+ return Array.isArray(value);
1877
+ };
1878
+ var sizeOf = (value) => {
1879
+ return isReadonlyArray(value) ? value.length : value instanceof Map ? value.size : Object.keys(value).length;
1880
+ };
1875
1881
 
1876
1882
  // ../common/src/random.ts
1877
1883
  var random = new Random(Date.now());
@@ -4440,6 +4446,33 @@ var elementLinkIcon = createIcon(
4440
4446
  ] }),
4441
4447
  tablerIconProps
4442
4448
  );
4449
+ var TableCellsIcon = createIcon(
4450
+ /* @__PURE__ */ jsxs("g", { strokeWidth: "1.25", children: [
4451
+ /* @__PURE__ */ jsx("rect", { x: "4", y: "4", width: "4", height: "4", rx: "1" }),
4452
+ /* @__PURE__ */ jsx("rect", { x: "10", y: "4", width: "4", height: "4", rx: "1" }),
4453
+ /* @__PURE__ */ jsx("rect", { x: "16", y: "4", width: "4", height: "4", rx: "1" }),
4454
+ /* @__PURE__ */ jsx("rect", { x: "4", y: "10", width: "4", height: "4", rx: "1" }),
4455
+ /* @__PURE__ */ jsx("rect", { x: "10", y: "10", width: "4", height: "4", rx: "1" }),
4456
+ /* @__PURE__ */ jsx("rect", { x: "16", y: "10", width: "4", height: "4", rx: "1" }),
4457
+ /* @__PURE__ */ jsx("rect", { x: "4", y: "16", width: "4", height: "4", rx: "1" }),
4458
+ /* @__PURE__ */ jsx("rect", { x: "10", y: "16", width: "4", height: "4", rx: "1" }),
4459
+ /* @__PURE__ */ jsx("rect", { x: "16", y: "16", width: "4", height: "4", rx: "1" })
4460
+ ] }),
4461
+ tablerIconProps
4462
+ );
4463
+ var arrowsToEyeIcon = createIcon(
4464
+ /* @__PURE__ */ jsx(
4465
+ "svg",
4466
+ {
4467
+ stroke: "currentColor",
4468
+ fill: "currentColor",
4469
+ strokeWidth: 0.5,
4470
+ viewBox: "0 0 640 512",
4471
+ children: /* @__PURE__ */ jsx("path", { d: "M15 15C24.4 5.7 39.6 5.7 49 15l63 63L112 40c0-13.3 10.7-24 24-24s24 10.7 24 24l0 96c0 13.3-10.7 24-24 24l-96 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l38.1 0L15 49C5.7 39.6 5.7 24.4 15 15zM133.5 243.9C158.6 193.6 222.7 112 320 112s161.4 81.6 186.5 131.9c3.8 7.6 3.8 16.5 0 24.2C481.4 318.4 417.3 400 320 400s-161.4-81.6-186.5-131.9c-3.8-7.6-3.8-16.5 0-24.2zM320 320a64 64 0 1 0 0-128 64 64 0 1 0 0 128zM591 15c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-63 63 38.1 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-96 0c-13.3 0-24-10.7-24-24l0-96c0-13.3 10.7-24 24-24s24 10.7 24 24l0 38.1 63-63zM15 497c-9.4-9.4-9.4-24.6 0-33.9l63-63L40 400c-13.3 0-24-10.7-24-24s10.7-24 24-24l96 0c13.3 0 24 10.7 24 24l0 96c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-38.1L49 497c-9.4 9.4-24.6 9.4-33.9 0zm576 0l-63-63 0 38.1c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-96c0-13.3 10.7-24 24-24l96 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-38.1 0 63 63c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0z" })
4472
+ }
4473
+ ),
4474
+ tablerIconProps
4475
+ );
4443
4476
 
4444
4477
  // ../math/src/ellipse.ts
4445
4478
  function ellipse(center, halfWidth, halfHeight) {
@@ -6122,13 +6155,13 @@ var getLinearElementEdgeCoors = (linearElement, startOrEnd, elementsMap) => {
6122
6155
  )
6123
6156
  );
6124
6157
  };
6125
- var fixDuplicatedBindingsAfterDuplication = (newElements, oldIdToDuplicatedId, duplicatedElementsMap) => {
6126
- for (const element of newElements) {
6127
- if ("boundElements" in element && element.boundElements) {
6128
- Object.assign(element, {
6129
- boundElements: element.boundElements.reduce(
6158
+ var fixDuplicatedBindingsAfterDuplication = (duplicatedElements, origIdToDuplicateId, duplicateElementsMap) => {
6159
+ for (const duplicateElement of duplicatedElements) {
6160
+ if ("boundElements" in duplicateElement && duplicateElement.boundElements) {
6161
+ Object.assign(duplicateElement, {
6162
+ boundElements: duplicateElement.boundElements.reduce(
6130
6163
  (acc, binding) => {
6131
- const newBindingId = oldIdToDuplicatedId.get(binding.id);
6164
+ const newBindingId = origIdToDuplicateId.get(binding.id);
6132
6165
  if (newBindingId) {
6133
6166
  acc.push({ ...binding, id: newBindingId });
6134
6167
  }
@@ -6138,191 +6171,46 @@ var fixDuplicatedBindingsAfterDuplication = (newElements, oldIdToDuplicatedId, d
6138
6171
  )
6139
6172
  });
6140
6173
  }
6141
- if ("containerId" in element && element.containerId) {
6142
- Object.assign(element, {
6143
- containerId: oldIdToDuplicatedId.get(element.containerId) ?? null
6174
+ if ("containerId" in duplicateElement && duplicateElement.containerId) {
6175
+ Object.assign(duplicateElement, {
6176
+ containerId: origIdToDuplicateId.get(duplicateElement.containerId) ?? null
6144
6177
  });
6145
6178
  }
6146
- if ("endBinding" in element && element.endBinding) {
6147
- const newEndBindingId = oldIdToDuplicatedId.get(
6148
- element.endBinding.elementId
6179
+ if ("endBinding" in duplicateElement && duplicateElement.endBinding) {
6180
+ const newEndBindingId = origIdToDuplicateId.get(
6181
+ duplicateElement.endBinding.elementId
6149
6182
  );
6150
- Object.assign(element, {
6183
+ Object.assign(duplicateElement, {
6151
6184
  endBinding: newEndBindingId ? {
6152
- ...element.endBinding,
6185
+ ...duplicateElement.endBinding,
6153
6186
  elementId: newEndBindingId
6154
6187
  } : null
6155
6188
  });
6156
6189
  }
6157
- if ("startBinding" in element && element.startBinding) {
6158
- const newEndBindingId = oldIdToDuplicatedId.get(
6159
- element.startBinding.elementId
6190
+ if ("startBinding" in duplicateElement && duplicateElement.startBinding) {
6191
+ const newEndBindingId = origIdToDuplicateId.get(
6192
+ duplicateElement.startBinding.elementId
6160
6193
  );
6161
- Object.assign(element, {
6194
+ Object.assign(duplicateElement, {
6162
6195
  startBinding: newEndBindingId ? {
6163
- ...element.startBinding,
6196
+ ...duplicateElement.startBinding,
6164
6197
  elementId: newEndBindingId
6165
6198
  } : null
6166
6199
  });
6167
6200
  }
6168
- if (isElbowArrow(element)) {
6201
+ if (isElbowArrow(duplicateElement)) {
6169
6202
  Object.assign(
6170
- element,
6171
- updateElbowArrowPoints(element, duplicatedElementsMap, {
6203
+ duplicateElement,
6204
+ updateElbowArrowPoints(duplicateElement, duplicateElementsMap, {
6172
6205
  points: [
6173
- element.points[0],
6174
- element.points[element.points.length - 1]
6206
+ duplicateElement.points[0],
6207
+ duplicateElement.points[duplicateElement.points.length - 1]
6175
6208
  ]
6176
6209
  })
6177
6210
  );
6178
6211
  }
6179
6212
  }
6180
6213
  };
6181
- var fixReversedBindingsForBindables = (original, duplicate, originalElements, elementsWithClones, oldIdToDuplicatedId) => {
6182
- original.boundElements?.forEach((binding, idx) => {
6183
- if (binding.type !== "arrow") {
6184
- return;
6185
- }
6186
- const oldArrow = elementsWithClones.find((el) => el.id === binding.id);
6187
- if (!isBindingElement(oldArrow)) {
6188
- return;
6189
- }
6190
- if (originalElements.has(binding.id)) {
6191
- const newArrowId = oldIdToDuplicatedId.get(binding.id) ?? binding.id;
6192
- const newArrow = elementsWithClones.find(
6193
- (el) => el.id === newArrowId
6194
- );
6195
- mutateElement(newArrow, {
6196
- startBinding: oldArrow.startBinding?.elementId === binding.id ? {
6197
- ...oldArrow.startBinding,
6198
- elementId: duplicate.id
6199
- } : newArrow.startBinding,
6200
- endBinding: oldArrow.endBinding?.elementId === binding.id ? {
6201
- ...oldArrow.endBinding,
6202
- elementId: duplicate.id
6203
- } : newArrow.endBinding
6204
- });
6205
- mutateElement(duplicate, {
6206
- boundElements: [
6207
- ...(duplicate.boundElements ?? []).filter(
6208
- (el) => el.id !== binding.id && el.id !== newArrowId
6209
- ),
6210
- {
6211
- type: "arrow",
6212
- id: newArrowId
6213
- }
6214
- ]
6215
- });
6216
- } else {
6217
- mutateElement(oldArrow, {
6218
- startBinding: oldArrow.startBinding?.elementId === original.id ? {
6219
- ...oldArrow.startBinding,
6220
- elementId: duplicate.id
6221
- } : oldArrow.startBinding,
6222
- endBinding: oldArrow.endBinding?.elementId === original.id ? {
6223
- ...oldArrow.endBinding,
6224
- elementId: duplicate.id
6225
- } : oldArrow.endBinding
6226
- });
6227
- mutateElement(duplicate, {
6228
- boundElements: [
6229
- ...duplicate.boundElements ?? [],
6230
- {
6231
- type: "arrow",
6232
- id: oldArrow.id
6233
- }
6234
- ]
6235
- });
6236
- mutateElement(original, {
6237
- boundElements: original.boundElements?.filter((_, i) => i !== idx) ?? null
6238
- });
6239
- }
6240
- });
6241
- };
6242
- var fixReversedBindingsForArrows = (original, duplicate, originalElements, bindingProp, oldIdToDuplicatedId, elementsWithClones) => {
6243
- const oldBindableId = original[bindingProp]?.elementId;
6244
- if (oldBindableId) {
6245
- if (originalElements.has(oldBindableId)) {
6246
- const newBindableId = oldIdToDuplicatedId.get(oldBindableId) ?? oldBindableId;
6247
- const newBindable = elementsWithClones.find(
6248
- (el) => el.id === newBindableId
6249
- );
6250
- mutateElement(duplicate, {
6251
- [bindingProp]: {
6252
- ...original[bindingProp],
6253
- elementId: newBindableId
6254
- }
6255
- });
6256
- mutateElement(newBindable, {
6257
- boundElements: [
6258
- ...(newBindable.boundElements ?? []).filter(
6259
- (el) => el.id !== original.id && el.id !== duplicate.id
6260
- ),
6261
- {
6262
- id: duplicate.id,
6263
- type: "arrow"
6264
- }
6265
- ]
6266
- });
6267
- } else {
6268
- const originalBindable = elementsWithClones.find(
6269
- (el) => el.id === oldBindableId
6270
- );
6271
- if (originalBindable) {
6272
- mutateElement(duplicate, {
6273
- [bindingProp]: original[bindingProp]
6274
- });
6275
- mutateElement(original, {
6276
- [bindingProp]: null
6277
- });
6278
- mutateElement(originalBindable, {
6279
- boundElements: [
6280
- ...originalBindable.boundElements?.filter(
6281
- (el) => el.id !== original.id
6282
- ) ?? [],
6283
- {
6284
- id: duplicate.id,
6285
- type: "arrow"
6286
- }
6287
- ]
6288
- });
6289
- }
6290
- }
6291
- }
6292
- };
6293
- var fixReversedBindings = (originalElements, elementsWithClones, oldIdToDuplicatedId) => {
6294
- for (const original of originalElements.values()) {
6295
- const duplicate = elementsWithClones.find(
6296
- (el) => el.id === oldIdToDuplicatedId.get(original.id)
6297
- );
6298
- if (isBindableElement(original) && isBindableElement(duplicate)) {
6299
- fixReversedBindingsForBindables(
6300
- original,
6301
- duplicate,
6302
- originalElements,
6303
- elementsWithClones,
6304
- oldIdToDuplicatedId
6305
- );
6306
- } else if (isArrowElement(original) && isArrowElement(duplicate)) {
6307
- fixReversedBindingsForArrows(
6308
- original,
6309
- duplicate,
6310
- originalElements,
6311
- "startBinding",
6312
- oldIdToDuplicatedId,
6313
- elementsWithClones
6314
- );
6315
- fixReversedBindingsForArrows(
6316
- original,
6317
- duplicate,
6318
- originalElements,
6319
- "endBinding",
6320
- oldIdToDuplicatedId,
6321
- elementsWithClones
6322
- );
6323
- }
6324
- }
6325
- };
6326
6214
  var fixBindingsAfterDeletion = (sceneElements, deletedElements) => {
6327
6215
  const elements = arrayToMap(sceneElements);
6328
6216
  for (const element of deletedElements) {
@@ -9272,23 +9160,21 @@ var elementsOverlappingBBox = ({
9272
9160
  };
9273
9161
 
9274
9162
  // ../element/src/frame.ts
9275
- var bindElementsToFramesAfterDuplication = (nextElements, oldElements, oldIdToDuplicatedId) => {
9163
+ var bindElementsToFramesAfterDuplication = (nextElements, origElements, origIdToDuplicateId) => {
9276
9164
  const nextElementMap = arrayToMap(nextElements);
9277
- for (const element of oldElements) {
9165
+ for (const element of origElements) {
9278
9166
  if (element.frameId) {
9279
- const nextElementId = oldIdToDuplicatedId.get(element.id);
9280
- const nextFrameId = oldIdToDuplicatedId.get(element.frameId);
9281
- if (nextElementId) {
9282
- const nextElement = nextElementMap.get(nextElementId);
9283
- if (nextElement) {
9284
- mutateElement(
9285
- nextElement,
9286
- {
9287
- frameId: nextFrameId ?? element.frameId
9288
- },
9289
- false
9290
- );
9291
- }
9167
+ const nextElementId = origIdToDuplicateId.get(element.id);
9168
+ const nextFrameId = origIdToDuplicateId.get(element.frameId);
9169
+ const nextElement = nextElementId && nextElementMap.get(nextElementId);
9170
+ if (nextElement) {
9171
+ mutateElement(
9172
+ nextElement,
9173
+ {
9174
+ frameId: nextFrameId ?? null
9175
+ },
9176
+ false
9177
+ );
9292
9178
  }
9293
9179
  }
9294
9180
  }
@@ -9898,6 +9784,41 @@ var makeNextSelectedElementIds = (nextSelectedElementIds, prevState) => {
9898
9784
  }
9899
9785
  return nextSelectedElementIds;
9900
9786
  };
9787
+ var _getLinearElementEditor = (targetElements) => {
9788
+ const linears = targetElements.filter(isLinearElement);
9789
+ if (linears.length === 1) {
9790
+ const linear = linears[0];
9791
+ const boundElements = linear.boundElements?.map((def) => def.id) ?? [];
9792
+ const onlySingleLinearSelected = targetElements.every(
9793
+ (el) => el.id === linear.id || boundElements.includes(el.id)
9794
+ );
9795
+ if (onlySingleLinearSelected) {
9796
+ return new LinearElementEditor(linear);
9797
+ }
9798
+ }
9799
+ return null;
9800
+ };
9801
+ var getSelectionStateForElements = (targetElements, allElements, appState) => {
9802
+ return {
9803
+ selectedLinearElement: _getLinearElementEditor(targetElements),
9804
+ ...selectGroupsForSelectedElements(
9805
+ {
9806
+ editingGroupId: appState.editingGroupId,
9807
+ selectedElementIds: excludeElementsInFramesFromSelection(
9808
+ targetElements
9809
+ ).reduce((acc, element) => {
9810
+ if (!isBoundToContainer(element)) {
9811
+ acc[element.id] = true;
9812
+ }
9813
+ return acc;
9814
+ }, {})
9815
+ },
9816
+ allElements,
9817
+ appState,
9818
+ null
9819
+ )
9820
+ };
9821
+ };
9901
9822
 
9902
9823
  // ../element/src/groups.ts
9903
9824
  var selectGroup = (groupId, appState, elements) => {
@@ -10546,10 +10467,7 @@ var _Scene = class _Scene {
10546
10467
  return didChange;
10547
10468
  }
10548
10469
  replaceAllElements(nextElements) {
10549
- const _nextElements = (
10550
- // ts doesn't like `Array.isArray` of `instanceof Map`
10551
- nextElements instanceof Array ? nextElements : Array.from(nextElements.values())
10552
- );
10470
+ const _nextElements = isReadonlyArray(nextElements) ? nextElements : Array.from(nextElements.values());
10553
10471
  const nextFrameLikes = [];
10554
10472
  validateIndicesThrottled(_nextElements);
10555
10473
  this.elements = syncInvalidIndices(_nextElements);
@@ -14345,7 +14263,7 @@ var getElementBounds = (element, elementsMap) => {
14345
14263
  return ElementBounds.getBounds(element, elementsMap);
14346
14264
  };
14347
14265
  var getCommonBounds = (elements, elementsMap) => {
14348
- if (!elements.length) {
14266
+ if (!sizeOf(elements)) {
14349
14267
  return [0, 0, 0, 0];
14350
14268
  }
14351
14269
  let minX = Infinity;
@@ -14618,6 +14536,10 @@ var getDefaultAppState = () => {
14618
14536
  showWelcomeScreen: false,
14619
14537
  myocSimplifiedMode: true,
14620
14538
  hideMainMenus: false,
14539
+ arrangeConfiguration: {
14540
+ gap: 10,
14541
+ algorithm: "bin-packing"
14542
+ },
14621
14543
  theme: THEME.LIGHT,
14622
14544
  collaborators: /* @__PURE__ */ new Map(),
14623
14545
  currentChartType: "bar",
@@ -14723,6 +14645,7 @@ var APP_STATE_STORAGE_CONF = /* @__PURE__ */ ((config) => config)({
14723
14645
  myocSimplifiedMode: { browser: true, export: false, server: false },
14724
14646
  hideMainMenus: { browser: true, export: false, server: false },
14725
14647
  wheelZoomsOnDefault: { browser: true, export: false, server: false },
14648
+ arrangeConfiguration: { browser: true, export: false, server: false },
14726
14649
  theme: { browser: true, export: false, server: false },
14727
14650
  collaborators: { browser: false, export: false, server: false },
14728
14651
  currentChartType: { browser: true, export: false, server: false },
@@ -20103,7 +20026,7 @@ var parseFileContents = async (blob) => {
20103
20026
  let contents;
20104
20027
  if (blob.type === MIME_TYPES.png) {
20105
20028
  try {
20106
- return await (await import("./data/image-M4KEBNT4.js")).decodePngMetadata(blob);
20029
+ return await (await import("./data/image-PLZ7Q7VH.js")).decodePngMetadata(blob);
20107
20030
  } catch (error) {
20108
20031
  if (error.message === "INVALID") {
20109
20032
  throw new ImageSceneDataError(
@@ -20355,9 +20278,13 @@ var ImageURLToFile = async (imageUrl, filename = "") => {
20355
20278
  throw new Error("Error: unsupported file type", { cause: "UNSUPPORTED" });
20356
20279
  };
20357
20280
  var getFileFromEvent = async (event) => {
20358
- const file2 = event.dataTransfer.files.item(0);
20281
+ const dataTransferFiles = Array.from(event.dataTransfer.files);
20359
20282
  const fileHandle = await getFileHandle(event);
20360
- return { file: file2 ? await normalizeFile(file2) : null, fileHandle };
20283
+ const files = dataTransferFiles ? await Promise.all(dataTransferFiles.map((file2) => normalizeFile(file2))) : null;
20284
+ return {
20285
+ files,
20286
+ fileHandle
20287
+ };
20361
20288
  };
20362
20289
  var getFileHandle = async (event) => {
20363
20290
  if (nativeFileSystemSupported) {
@@ -20865,6 +20792,8 @@ export {
20865
20792
  upIcon,
20866
20793
  cropIcon,
20867
20794
  elementLinkIcon,
20795
+ TableCellsIcon,
20796
+ arrowsToEyeIcon,
20868
20797
  shouldTestInside,
20869
20798
  hitElementItself,
20870
20799
  hitElementBoundingBox,
@@ -20920,7 +20849,6 @@ export {
20920
20849
  bindPointToSnapToElementOutline,
20921
20850
  calculateFixedPointForElbowArrowBinding,
20922
20851
  fixDuplicatedBindingsAfterDuplication,
20923
- fixReversedBindings,
20924
20852
  fixBindingsAfterDeletion,
20925
20853
  maxBindingGap,
20926
20854
  bindingProperties,
@@ -20974,6 +20902,7 @@ export {
20974
20902
  getSelectedElements,
20975
20903
  getTargetElements,
20976
20904
  makeNextSelectedElementIds,
20905
+ getSelectionStateForElements,
20977
20906
  selectGroup,
20978
20907
  selectGroupsForSelectedElements,
20979
20908
  isSelectedViaGroup,
@@ -21112,4 +21041,4 @@ export {
21112
21041
  createFile,
21113
21042
  normalizeFile
21114
21043
  };
21115
- //# sourceMappingURL=chunk-XKDJIA35.js.map
21044
+ //# sourceMappingURL=chunk-3PM7AKUW.js.map