@myoc/excalidraw 0.19.506 → 0.19.508

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 (86) hide show
  1. package/CHANGELOG.md +106 -0
  2. package/dist/dev/{chunk-CUCA2WKB.js → chunk-4FUVQKPQ.js} +37 -43
  3. package/dist/dev/chunk-4FUVQKPQ.js.map +7 -0
  4. package/dist/dev/{chunk-KLM3KPI7.js → chunk-55P7U5EB.js} +4 -1
  5. package/dist/dev/chunk-55P7U5EB.js.map +7 -0
  6. package/dist/dev/{chunk-KCN2IL3S.js → chunk-TW3GG6X2.js} +2 -2
  7. package/dist/dev/data/{image-KG7C5ZXU.js → image-BLMJ34ZZ.js} +3 -3
  8. package/dist/dev/index.css +11 -3
  9. package/dist/dev/index.css.map +2 -2
  10. package/dist/dev/index.js +1391 -972
  11. package/dist/dev/index.js.map +4 -4
  12. package/dist/dev/locales/{en-I7VEBYIX.js → en-MHJYLCUG.js} +2 -2
  13. package/dist/dev/subset-shared.chunk.js +1 -1
  14. package/dist/dev/subset-worker.chunk.js +1 -1
  15. package/dist/prod/chunk-5HKPV526.js +4 -0
  16. package/dist/prod/{chunk-74H5OWWZ.js → chunk-GYDQTBSQ.js} +1 -1
  17. package/dist/prod/{chunk-3FGJVPJS.js → chunk-QIZKYIJ7.js} +3 -3
  18. package/dist/prod/data/image-S4O4TFPQ.js +1 -0
  19. package/dist/prod/index.css +1 -1
  20. package/dist/prod/index.js +19 -19
  21. package/dist/prod/locales/{en-Y2V7YPBM.js → en-YKHOUQAO.js} +1 -1
  22. package/dist/prod/subset-shared.chunk.js +1 -1
  23. package/dist/prod/subset-worker.chunk.js +1 -1
  24. package/dist/types/element/src/Scene.d.ts +5 -3
  25. package/dist/types/element/src/bounds.d.ts +4 -2
  26. package/dist/types/element/src/duplicate.d.ts +1 -0
  27. package/dist/types/element/src/frame.d.ts +7 -6
  28. package/dist/types/element/src/linearElementEditor.d.ts +2 -2
  29. package/dist/types/element/src/selection.d.ts +2 -2
  30. package/dist/types/element/src/shape.d.ts +1 -1
  31. package/dist/types/element/src/typeChecks.d.ts +1 -0
  32. package/dist/types/element/src/utils.d.ts +1 -1
  33. package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +3 -3
  34. package/dist/types/excalidraw/actions/actionBoundText.d.ts +2 -2
  35. package/dist/types/excalidraw/actions/actionCanvas.d.ts +11 -11
  36. package/dist/types/excalidraw/actions/actionClipboard.d.ts +2 -2
  37. package/dist/types/excalidraw/actions/actionCropEditor.d.ts +1 -1
  38. package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +3 -3
  39. package/dist/types/excalidraw/actions/actionDeselect.d.ts +168 -0
  40. package/dist/types/excalidraw/actions/actionElementLink.d.ts +1 -1
  41. package/dist/types/excalidraw/actions/actionElementLock.d.ts +2 -2
  42. package/dist/types/excalidraw/actions/actionEmbeddable.d.ts +1 -1
  43. package/dist/types/excalidraw/actions/actionExport.d.ts +2 -2
  44. package/dist/types/excalidraw/actions/actionFrame.d.ts +4 -4
  45. package/dist/types/excalidraw/actions/actionGroup.d.ts +2 -2
  46. package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +1 -1
  47. package/dist/types/excalidraw/actions/actionLink.d.ts +1 -1
  48. package/dist/types/excalidraw/actions/actionMenu.d.ts +1 -1
  49. package/dist/types/excalidraw/actions/actionProperties.d.ts +2 -2
  50. package/dist/types/excalidraw/actions/actionSelectAll.d.ts +1 -1
  51. package/dist/types/excalidraw/actions/actionStyles.d.ts +1 -1
  52. package/dist/types/excalidraw/actions/actionToggleArrowBinding.d.ts +1 -1
  53. package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +1 -1
  54. package/dist/types/excalidraw/actions/actionToggleMidpointSnapping.d.ts +1 -1
  55. package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +1 -1
  56. package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +1 -1
  57. package/dist/types/excalidraw/actions/actionToggleStats.d.ts +1 -1
  58. package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +1 -1
  59. package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +1 -1
  60. package/dist/types/excalidraw/actions/index.d.ts +1 -0
  61. package/dist/types/excalidraw/actions/types.d.ts +1 -1
  62. package/dist/types/excalidraw/appState.d.ts +1 -0
  63. package/dist/types/excalidraw/components/App.d.ts +9 -0
  64. package/dist/types/excalidraw/components/PublishLibrary.d.ts +3 -2
  65. package/dist/types/excalidraw/components/canvases/InteractiveCanvas.d.ts +1 -1
  66. package/dist/types/excalidraw/components/canvases/NewElementCanvas.d.ts +1 -0
  67. package/dist/types/excalidraw/components/canvases/StaticCanvas.d.ts +1 -1
  68. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemContentRadio.d.ts +2 -1
  69. package/dist/types/excalidraw/components/main-menu/DefaultItems.d.ts +1 -0
  70. package/dist/types/excalidraw/components/shapes.d.ts +7 -0
  71. package/dist/types/excalidraw/data/blob.d.ts +4 -8
  72. package/dist/types/excalidraw/data/json.d.ts +1 -1
  73. package/dist/types/excalidraw/index.d.ts +1 -1
  74. package/dist/types/excalidraw/scene/Renderer.d.ts +425 -19
  75. package/dist/types/excalidraw/types.d.ts +15 -2
  76. package/dist/types/fractional-indexing/src/index.d.ts +29 -0
  77. package/dist/types/math/src/constants.d.ts +0 -1
  78. package/dist/types/math/src/curve.d.ts +4 -1
  79. package/package.json +4 -5
  80. package/dist/dev/chunk-CUCA2WKB.js.map +0 -7
  81. package/dist/dev/chunk-KLM3KPI7.js.map +0 -7
  82. package/dist/prod/chunk-DAHBMDEO.js +0 -4
  83. package/dist/prod/data/image-OZR7E4WV.js +0 -1
  84. /package/dist/dev/{chunk-KCN2IL3S.js.map → chunk-TW3GG6X2.js.map} +0 -0
  85. /package/dist/dev/data/{image-KG7C5ZXU.js.map → image-BLMJ34ZZ.js.map} +0 -0
  86. /package/dist/dev/locales/{en-I7VEBYIX.js.map → en-MHJYLCUG.js.map} +0 -0
package/CHANGELOG.md CHANGED
@@ -65,6 +65,7 @@ Please add the latest change on the top under the correct section.
65
65
 
66
66
  ---
67
67
 
68
+
68
69
  ## 0.19.503 (2026-03-22)
69
70
 
70
71
  ## Excalidraw API
@@ -4123,5 +4124,110 @@ First release of `@excalidraw/excalidraw`## Excalidraw Library
4123
4124
 
4124
4125
  - Incorrect import for color (was moved to common)
4125
4126
 
4127
+ ---## Excalidraw Library
4128
+
4129
+ **_This section lists the updates made to the excalidraw library and will not affect the integration._**
4130
+
4131
+ ### Features
4132
+
4133
+ - Add ability to turn off compression for files that are smaller than a given size
4134
+
4135
+ - Add lock tool to the dropdown and also add the status of the extra tools to be the same icon as the selected tool
4136
+
4137
+ - Add view mode button
4138
+
4139
+ - Add multiple image copy paste or drag and drop
4140
+
4141
+ - Multiple image additions from clipboard
4142
+
4143
+ - Add arrange elements action
4144
+
4145
+ - Add top picks to appProps for both stoke color and background color
4146
+
4147
+ ### Fixes
4148
+
4149
+ - Issues
4150
+
4151
+ - Make mobile mode more myoc looking
4152
+
4153
+ - Add normalise functionality
4154
+
4155
+ - Update with excalidraw
4156
+
4157
+ - Fix imports
4158
+
4159
+ - Fix mutateGroup to use scene.mutateGroup
4160
+
4161
+ - Imports
4162
+
4163
+ - Ensure that fileId is different for compressed vs uncompressed file
4164
+
4165
+ - Remove not working prop for dontResizeLimitMBs
4166
+
4167
+ - Add smartview for mobile
4168
+
4169
+ - Hide the alignment buttons if there is only one group selected (they do nothing if only one group is selected)
4170
+
4171
+ - Use css vars already provided instead of hard coding directly from oc-gray
4172
+
4173
+ - Remove unused variables
4174
+
4175
+ - Pass the new top pick color props properly
4176
+
4177
+ - Incorrect import for color (was moved to common)
4178
+
4179
+ ---
4180
+ ## Excalidraw Library
4181
+
4182
+ **_This section lists the updates made to the excalidraw library and will not affect the integration._**
4183
+
4184
+ ### Features
4185
+
4186
+ - Add ability to turn off compression for files that are smaller than a given size
4187
+
4188
+ - Add lock tool to the dropdown and also add the status of the extra tools to be the same icon as the selected tool
4189
+
4190
+ - Add view mode button
4191
+
4192
+ - Add multiple image copy paste or drag and drop
4193
+
4194
+ - Multiple image additions from clipboard
4195
+
4196
+ - Add arrange elements action
4197
+
4198
+ - Add top picks to appProps for both stoke color and background color
4199
+
4200
+ ### Fixes
4201
+
4202
+ - Issues
4203
+
4204
+ - Make mobile mode more myoc looking
4205
+
4206
+ - Add normalise functionality
4207
+
4208
+ - Update with excalidraw
4209
+
4210
+ - Fix imports
4211
+
4212
+ - Fix mutateGroup to use scene.mutateGroup
4213
+
4214
+ - Imports
4215
+
4216
+ - Ensure that fileId is different for compressed vs uncompressed file
4217
+
4218
+ - Remove not working prop for dontResizeLimitMBs
4219
+
4220
+ - Add smartview for mobile
4221
+
4222
+ - Hide the alignment buttons if there is only one group selected (they do nothing if only one group is selected)
4223
+
4224
+ - Use css vars already provided instead of hard coding directly from oc-gray
4225
+
4226
+ - Remove unused variables
4227
+
4228
+ - Pass the new top pick color props properly
4229
+
4230
+ - Incorrect import for color (was moved to common)
4231
+
4126
4232
  ---
4127
4233
 
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  define_import_meta_env_default
3
- } from "./chunk-KCN2IL3S.js";
3
+ } from "./chunk-TW3GG6X2.js";
4
4
  import {
5
5
  __publicField
6
6
  } from "./chunk-XDFCUUT6.js";
@@ -124,7 +124,6 @@ var getDefaultAppState = () => {
124
124
  open: false,
125
125
  panels: STATS_PANELS.generalStats | STATS_PANELS.elementProperties
126
126
  },
127
- startBoundElement: null,
128
127
  suggestedBinding: null,
129
128
  frameRendering: { enabled: true, clip: true, name: true, outline: true },
130
129
  frameToHighlight: null,
@@ -152,7 +151,8 @@ var getDefaultAppState = () => {
152
151
  searchMatches: null,
153
152
  lockedMultiSelections: {},
154
153
  activeLockedId: null,
155
- bindMode: "orbit"
154
+ bindMode: "orbit",
155
+ boxSelectionMode: "contain"
156
156
  };
157
157
  };
158
158
  var APP_STATE_STORAGE_CONF = /* @__PURE__ */ ((config) => config)({
@@ -208,6 +208,7 @@ var APP_STATE_STORAGE_CONF = /* @__PURE__ */ ((config) => config)({
208
208
  gridModeEnabled: { browser: true, export: true, server: true },
209
209
  height: { browser: false, export: false, server: false },
210
210
  isBindingEnabled: { browser: true, export: false, server: false },
211
+ boxSelectionMode: { browser: true, export: false, server: false },
211
212
  bindingPreference: { browser: true, export: false, server: false },
212
213
  isMidpointSnappingEnabled: { browser: true, export: false, server: false },
213
214
  defaultSidebarDockedPreference: {
@@ -244,7 +245,6 @@ var APP_STATE_STORAGE_CONF = /* @__PURE__ */ ((config) => config)({
244
245
  selectionElement: { browser: false, export: false, server: false },
245
246
  shouldCacheIgnoreZoom: { browser: true, export: false, server: false },
246
247
  stats: { browser: true, export: false, server: false },
247
- startBoundElement: { browser: false, export: false, server: false },
248
248
  suggestedBinding: { browser: false, export: false, server: false },
249
249
  frameRendering: { browser: false, export: false, server: false },
250
250
  frameToHighlight: { browser: false, export: false, server: false },
@@ -4181,7 +4181,11 @@ var prepareElementsForRender = ({
4181
4181
  }) => {
4182
4182
  let nextElements;
4183
4183
  if (exportingFrame) {
4184
- nextElements = getElementsOverlappingFrame(elements, exportingFrame);
4184
+ nextElements = getElementsOverlappingFrame(
4185
+ elements,
4186
+ exportingFrame,
4187
+ arrayToMap(elements)
4188
+ );
4185
4189
  } else if (frameRendering.enabled && frameRendering.name) {
4186
4190
  nextElements = addFrameLabelsAsTextElements(elements, {
4187
4191
  exportWithDarkMode
@@ -4507,6 +4511,7 @@ import { syncInvalidIndices as syncInvalidIndices2 } from "@excalidraw/element";
4507
4511
  import { refreshTextDimensions } from "@excalidraw/element";
4508
4512
  import { getNormalizedDimensions } from "@excalidraw/element";
4509
4513
  import { isInvisiblySmallElement } from "@excalidraw/element";
4514
+ var MAX_ARROW_PX = 75e3;
4510
4515
  var AllowedExcalidrawActiveTools = {
4511
4516
  selection: true,
4512
4517
  lasso: true,
@@ -4764,8 +4769,8 @@ var restoreElement = (element, targetElementsMap, existingElementsMap, opts) =>
4764
4769
  startArrowhead: startArrowhead2,
4765
4770
  endArrowhead: endArrowhead2,
4766
4771
  points: points2,
4767
- x: x2,
4768
- y: y2,
4772
+ x: x2 ?? 0,
4773
+ y: y2 ?? 0,
4769
4774
  elbowed: element.elbowed,
4770
4775
  ...getSizeFromPoints(points2)
4771
4776
  };
@@ -4776,12 +4781,30 @@ var restoreElement = (element, targetElementsMap, existingElementsMap, opts) =>
4776
4781
  startIsSpecial: element.startIsSpecial,
4777
4782
  endIsSpecial: element.endIsSpecial
4778
4783
  }) : restoreElementWithProperties(element, base);
4779
- return {
4784
+ const normalizedRestoredElement = {
4780
4785
  ...restoredElement,
4781
4786
  ...LinearElementEditor2.getNormalizeElementPointsAndCoords(
4782
4787
  restoredElement
4783
4788
  )
4784
4789
  };
4790
+ if (normalizedRestoredElement.width > MAX_ARROW_PX || normalizedRestoredElement.height > MAX_ARROW_PX) {
4791
+ console.error(
4792
+ `Removing extremely large arrow ${normalizedRestoredElement.id} (type: ${isElbowArrow(normalizedRestoredElement) ? "elbow" : "simple"}, width: ${normalizedRestoredElement.width}, height: ${normalizedRestoredElement.height}, x: ${normalizedRestoredElement.x}, y: ${normalizedRestoredElement.y})`
4793
+ );
4794
+ return {
4795
+ ...normalizedRestoredElement,
4796
+ x: 0,
4797
+ y: 0,
4798
+ width: 100,
4799
+ height: 100,
4800
+ points: [
4801
+ pointFrom2(0, 0),
4802
+ pointFrom2(100, 100)
4803
+ ],
4804
+ isDeleted: true
4805
+ };
4806
+ }
4807
+ return normalizedRestoredElement;
4785
4808
  }
4786
4809
  case "ellipse":
4787
4810
  case "rectangle":
@@ -5006,6 +5029,10 @@ var restoreAppState = (appState, localAppState) => {
5006
5029
  const localValue = localAppState ? localAppState[key] : void 0;
5007
5030
  nextAppState[key] = suppliedValue !== void 0 ? suppliedValue : localValue !== void 0 ? localValue : defaultValue;
5008
5031
  }
5032
+ const boxSelectionMode = appState.boxSelectionMode ?? localAppState?.boxSelectionMode;
5033
+ if (boxSelectionMode !== void 0) {
5034
+ nextAppState.boxSelectionMode = boxSelectionMode;
5035
+ }
5009
5036
  return {
5010
5037
  ...nextAppState,
5011
5038
  cursorButton: localAppState?.cursorButton || "up",
@@ -5079,7 +5106,7 @@ var parseFileContents = async (blob) => {
5079
5106
  let contents;
5080
5107
  if (blob.type === MIME_TYPES6.png) {
5081
5108
  try {
5082
- return await (await import("./data/image-KG7C5ZXU.js")).decodePngMetadata(blob);
5109
+ return await (await import("./data/image-BLMJ34ZZ.js")).decodePngMetadata(blob);
5083
5110
  } catch (error) {
5084
5111
  if (error.message === "INVALID") {
5085
5112
  throw new ImageSceneDataError(
@@ -5266,38 +5293,6 @@ var getDataURL_sync = (data, mimeType) => {
5266
5293
  var dataURLToString = (dataURL) => {
5267
5294
  return base64ToString(dataURL.slice(dataURL.indexOf(",") + 1));
5268
5295
  };
5269
- var resizeImageFile = async (file, opts) => {
5270
- if (file.type === MIME_TYPES6.svg) {
5271
- return file;
5272
- }
5273
- const [pica, imageBlobReduce] = await Promise.all([
5274
- import("pica").then((res) => res.default),
5275
- // a wrapper for pica for better API
5276
- import("image-blob-reduce").then((res) => res.default)
5277
- ]);
5278
- const reduce = imageBlobReduce({
5279
- pica: pica({ features: ["js", "wasm"] })
5280
- });
5281
- if (opts.outputType) {
5282
- const { outputType } = opts;
5283
- reduce._create_blob = function(env) {
5284
- return this.pica.toBlob(env.out_canvas, outputType, 0.8).then((blob) => {
5285
- env.out_blob = blob;
5286
- return env;
5287
- });
5288
- };
5289
- }
5290
- if (!isSupportedImageFile(file)) {
5291
- throw new Error("Error: unsupported file type", { cause: "UNSUPPORTED" });
5292
- }
5293
- return new File(
5294
- [await reduce.toBlob(file, { max: opts.maxWidthOrHeight, alpha: true })],
5295
- file.name,
5296
- {
5297
- type: opts.outputType || file.type
5298
- }
5299
- );
5300
- };
5301
5296
  var SVGStringToFile = (SVGString, filename = "") => {
5302
5297
  return new File([new TextEncoder().encode(SVGString)], filename, {
5303
5298
  type: MIME_TYPES6.svg
@@ -5505,11 +5500,10 @@ export {
5505
5500
  getDataURL,
5506
5501
  getDataURL_sync,
5507
5502
  dataURLToString,
5508
- resizeImageFile,
5509
5503
  SVGStringToFile,
5510
5504
  ImageURLToFile,
5511
5505
  getFileHandle,
5512
5506
  createFile,
5513
5507
  normalizeFile
5514
5508
  };
5515
- //# sourceMappingURL=chunk-CUCA2WKB.js.map
5509
+ //# sourceMappingURL=chunk-4FUVQKPQ.js.map