@myoc/excalidraw 0.19.522 → 0.19.524

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 (37) hide show
  1. package/CHANGELOG.md +123 -1
  2. package/dist/dev/{chunk-BCNQXIBK.js → chunk-3SND5YQP.js} +50 -6
  3. package/dist/dev/chunk-3SND5YQP.js.map +7 -0
  4. package/dist/dev/{chunk-6T5HZJCI.js → chunk-W3K3P2GO.js} +2 -2
  5. package/dist/dev/data/{image-NFLICJEW.js → image-F4TDOTKO.js} +3 -3
  6. package/dist/dev/index.css +774 -622
  7. package/dist/dev/index.css.map +3 -3
  8. package/dist/dev/index.js +11072 -10660
  9. package/dist/dev/index.js.map +4 -4
  10. package/dist/dev/subset-shared.chunk.js +1 -1
  11. package/dist/dev/subset-worker.chunk.js +1 -1
  12. package/dist/prod/{chunk-SZWH77NQ.js → chunk-GPFWSM2Y.js} +1 -1
  13. package/dist/prod/chunk-H5UC5NY3.js +4 -0
  14. package/dist/prod/data/image-FQV7KQIF.js +1 -0
  15. package/dist/prod/index.css +1 -1
  16. package/dist/prod/index.js +16 -16
  17. package/dist/prod/subset-shared.chunk.js +1 -1
  18. package/dist/prod/subset-worker.chunk.js +1 -1
  19. package/dist/types/excalidraw/actions/actionCanvas.d.ts +6 -6
  20. package/dist/types/excalidraw/actions/index.d.ts +1 -1
  21. package/dist/types/excalidraw/actions/shortcuts.d.ts +1 -1
  22. package/dist/types/excalidraw/actions/types.d.ts +1 -1
  23. package/dist/types/excalidraw/components/Actions.d.ts +1 -2
  24. package/dist/types/excalidraw/components/App.d.ts +9 -3
  25. package/dist/types/excalidraw/components/MobileToolbar.d.ts +3 -1
  26. package/dist/types/excalidraw/components/Toolbar.d.ts +3 -1
  27. package/dist/types/excalidraw/components/Tools.d.ts +9 -4
  28. package/dist/types/excalidraw/components/main-menu/DefaultItems.d.ts +0 -2
  29. package/dist/types/excalidraw/types.d.ts +9 -1
  30. package/dist/types/excalidraw/viewport.d.ts +7 -1
  31. package/package.json +4 -4
  32. package/dist/dev/chunk-BCNQXIBK.js.map +0 -7
  33. package/dist/prod/chunk-66O5T5YX.js +0 -4
  34. package/dist/prod/data/image-AAJBLI3M.js +0 -1
  35. package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +0 -191
  36. /package/dist/dev/{chunk-6T5HZJCI.js.map → chunk-W3K3P2GO.js.map} +0 -0
  37. /package/dist/dev/data/{image-NFLICJEW.js.map → image-F4TDOTKO.js.map} +0 -0
package/CHANGELOG.md CHANGED
@@ -65,7 +65,6 @@ Please add the latest change on the top under the correct section.
65
65
 
66
66
  ---
67
67
 
68
-
69
68
  ## 0.19.503 (2026-03-22)
70
69
 
71
70
  ## Excalidraw API
@@ -4297,6 +4296,61 @@ First release of `@excalidraw/excalidraw`## Excalidraw Library
4297
4296
  - Incorrect import for color (was moved to common)
4298
4297
 
4299
4298
  ---
4299
+
4300
+ ## Excalidraw Library
4301
+
4302
+ **_This section lists the updates made to the excalidraw library and will not affect the integration._**
4303
+
4304
+ ### Features
4305
+
4306
+ - Add ability to turn off compression for files that are smaller than a given size
4307
+
4308
+ - Add lock tool to the dropdown and also add the status of the extra tools to be the same icon as the selected tool
4309
+
4310
+ - Add view mode button
4311
+
4312
+ - Add multiple image copy paste or drag and drop
4313
+
4314
+ - Multiple image additions from clipboard
4315
+
4316
+ - Add arrange elements action
4317
+
4318
+ - Add top picks to appProps for both stoke color and background color
4319
+
4320
+ ### Fixes
4321
+
4322
+ - Issues
4323
+
4324
+ - Make mobile mode more myoc looking
4325
+
4326
+ - Add normalise functionality
4327
+
4328
+ - Update with excalidraw
4329
+
4330
+ - Fix imports
4331
+
4332
+ - Fix mutateGroup to use scene.mutateGroup
4333
+
4334
+ - Imports
4335
+
4336
+ - Ensure that fileId is different for compressed vs uncompressed file
4337
+
4338
+ - Remove not working prop for dontResizeLimitMBs
4339
+
4340
+ - Add smartview for mobile
4341
+
4342
+ - Hide the alignment buttons if there is only one group selected (they do nothing if only one group is selected)
4343
+
4344
+ - Use css vars already provided instead of hard coding directly from oc-gray
4345
+
4346
+ - Remove unused variables
4347
+
4348
+ - Pass the new top pick color props properly
4349
+
4350
+ - Incorrect import for color (was moved to common)
4351
+
4352
+ ---
4353
+
4300
4354
  ## Excalidraw Library
4301
4355
 
4302
4356
  **_This section lists the updates made to the excalidraw library and will not affect the integration._**
@@ -4350,6 +4404,7 @@ First release of `@excalidraw/excalidraw`## Excalidraw Library
4350
4404
  - Incorrect import for color (was moved to common)
4351
4405
 
4352
4406
  ---
4407
+
4353
4408
  ## Excalidraw Library
4354
4409
 
4355
4410
  **_This section lists the updates made to the excalidraw library and will not affect the integration._**
@@ -4403,6 +4458,7 @@ First release of `@excalidraw/excalidraw`## Excalidraw Library
4403
4458
  - Incorrect import for color (was moved to common)
4404
4459
 
4405
4460
  ---
4461
+
4406
4462
  ## Excalidraw Library
4407
4463
 
4408
4464
  **_This section lists the updates made to the excalidraw library and will not affect the integration._**
@@ -4456,6 +4512,7 @@ First release of `@excalidraw/excalidraw`## Excalidraw Library
4456
4512
  - Incorrect import for color (was moved to common)
4457
4513
 
4458
4514
  ---
4515
+
4459
4516
  ## Excalidraw Library
4460
4517
 
4461
4518
  **_This section lists the updates made to the excalidraw library and will not affect the integration._**
@@ -4509,6 +4566,7 @@ First release of `@excalidraw/excalidraw`## Excalidraw Library
4509
4566
  - Incorrect import for color (was moved to common)
4510
4567
 
4511
4568
  ---
4569
+
4512
4570
  ## Excalidraw Library
4513
4571
 
4514
4572
  **_This section lists the updates made to the excalidraw library and will not affect the integration._**
@@ -4562,6 +4620,7 @@ First release of `@excalidraw/excalidraw`## Excalidraw Library
4562
4620
  - Incorrect import for color (was moved to common)
4563
4621
 
4564
4622
  ---
4623
+
4565
4624
  ## Excalidraw Library
4566
4625
 
4567
4626
  **_This section lists the updates made to the excalidraw library and will not affect the integration._**
@@ -4615,6 +4674,7 @@ First release of `@excalidraw/excalidraw`## Excalidraw Library
4615
4674
  - Incorrect import for color (was moved to common)
4616
4675
 
4617
4676
  ---
4677
+
4618
4678
  ## Excalidraw Library
4619
4679
 
4620
4680
  **_This section lists the updates made to the excalidraw library and will not affect the integration._**
@@ -4668,6 +4728,7 @@ First release of `@excalidraw/excalidraw`## Excalidraw Library
4668
4728
  - Incorrect import for color (was moved to common)
4669
4729
 
4670
4730
  ---
4731
+
4671
4732
  ## Excalidraw Library
4672
4733
 
4673
4734
  **_This section lists the updates made to the excalidraw library and will not affect the integration._**
@@ -4721,6 +4782,7 @@ First release of `@excalidraw/excalidraw`## Excalidraw Library
4721
4782
  - Incorrect import for color (was moved to common)
4722
4783
 
4723
4784
  ---
4785
+
4724
4786
  ## Excalidraw Library
4725
4787
 
4726
4788
  **_This section lists the updates made to the excalidraw library and will not affect the integration._**
@@ -4774,6 +4836,7 @@ First release of `@excalidraw/excalidraw`## Excalidraw Library
4774
4836
  - Incorrect import for color (was moved to common)
4775
4837
 
4776
4838
  ---
4839
+
4777
4840
  ## Excalidraw Library
4778
4841
 
4779
4842
  **_This section lists the updates made to the excalidraw library and will not affect the integration._**
@@ -4827,6 +4890,7 @@ First release of `@excalidraw/excalidraw`## Excalidraw Library
4827
4890
  - Incorrect import for color (was moved to common)
4828
4891
 
4829
4892
  ---
4893
+
4830
4894
  ## Excalidraw Library
4831
4895
 
4832
4896
  **_This section lists the updates made to the excalidraw library and will not affect the integration._**
@@ -4880,6 +4944,7 @@ First release of `@excalidraw/excalidraw`## Excalidraw Library
4880
4944
  - Incorrect import for color (was moved to common)
4881
4945
 
4882
4946
  ---
4947
+
4883
4948
  ## Excalidraw Library
4884
4949
 
4885
4950
  **_This section lists the updates made to the excalidraw library and will not affect the integration._**
@@ -4933,6 +4998,7 @@ First release of `@excalidraw/excalidraw`## Excalidraw Library
4933
4998
  - Incorrect import for color (was moved to common)
4934
4999
 
4935
5000
  ---
5001
+
4936
5002
  ## Excalidraw Library
4937
5003
 
4938
5004
  **_This section lists the updates made to the excalidraw library and will not affect the integration._**
@@ -4986,6 +5052,7 @@ First release of `@excalidraw/excalidraw`## Excalidraw Library
4986
5052
  - Incorrect import for color (was moved to common)
4987
5053
 
4988
5054
  ---
5055
+
4989
5056
  ## Excalidraw Library
4990
5057
 
4991
5058
  **_This section lists the updates made to the excalidraw library and will not affect the integration._**
@@ -5039,6 +5106,7 @@ First release of `@excalidraw/excalidraw`## Excalidraw Library
5039
5106
  - Incorrect import for color (was moved to common)
5040
5107
 
5041
5108
  ---
5109
+
5042
5110
  ## Excalidraw Library
5043
5111
 
5044
5112
  **_This section lists the updates made to the excalidraw library and will not affect the integration._**
@@ -5092,6 +5160,7 @@ First release of `@excalidraw/excalidraw`## Excalidraw Library
5092
5160
  - Incorrect import for color (was moved to common)
5093
5161
 
5094
5162
  ---
5163
+
5095
5164
  ## Excalidraw Library
5096
5165
 
5097
5166
  **_This section lists the updates made to the excalidraw library and will not affect the integration._**
@@ -5145,6 +5214,7 @@ First release of `@excalidraw/excalidraw`## Excalidraw Library
5145
5214
  - Incorrect import for color (was moved to common)
5146
5215
 
5147
5216
  ---
5217
+
5148
5218
  ## Excalidraw Library
5149
5219
 
5150
5220
  **_This section lists the updates made to the excalidraw library and will not affect the integration._**
@@ -5197,5 +5267,57 @@ First release of `@excalidraw/excalidraw`## Excalidraw Library
5197
5267
 
5198
5268
  - Incorrect import for color (was moved to common)
5199
5269
 
5270
+ ---## Excalidraw Library
5271
+
5272
+ **_This section lists the updates made to the excalidraw library and will not affect the integration._**
5273
+
5274
+ ### Features
5275
+
5276
+ - Add ability to turn off compression for files that are smaller than a given size
5277
+
5278
+ - Add lock tool to the dropdown and also add the status of the extra tools to be the same icon as the selected tool
5279
+
5280
+ - Add view mode button
5281
+
5282
+ - Add multiple image copy paste or drag and drop
5283
+
5284
+ - Multiple image additions from clipboard
5285
+
5286
+ - Add arrange elements action
5287
+
5288
+ - Add top picks to appProps for both stoke color and background color
5289
+
5290
+ ### Fixes
5291
+
5292
+ - Issues
5293
+
5294
+ - Make mobile mode more myoc looking
5295
+
5296
+ - Add normalise functionality
5297
+
5298
+ - Update with excalidraw
5299
+
5300
+ - Fix imports
5301
+
5302
+ - Fix mutateGroup to use scene.mutateGroup
5303
+
5304
+ - Imports
5305
+
5306
+ - Ensure that fileId is different for compressed vs uncompressed file
5307
+
5308
+ - Remove not working prop for dontResizeLimitMBs
5309
+
5310
+ - Add smartview for mobile
5311
+
5312
+ - Hide the alignment buttons if there is only one group selected (they do nothing if only one group is selected)
5313
+
5314
+ - Use css vars already provided instead of hard coding directly from oc-gray
5315
+
5316
+ - Remove unused variables
5317
+
5318
+ - Pass the new top pick color props properly
5319
+
5320
+ - Incorrect import for color (was moved to common)
5321
+
5200
5322
  ---
5201
5323
 
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  define_import_meta_env_default
3
- } from "./chunk-6T5HZJCI.js";
3
+ } from "./chunk-W3K3P2GO.js";
4
4
  import {
5
5
  __publicField
6
6
  } from "./chunk-XDFCUUT6.js";
@@ -486,7 +486,8 @@ var zoomToFitBounds = ({
486
486
  fit = "scale-down",
487
487
  minZoom = -Infinity,
488
488
  maxZoom = Infinity,
489
- steppedZoom = false
489
+ steppedZoom = false,
490
+ viewportZoomFactor = 1
490
491
  }) => {
491
492
  const [x1, y1, x2, y2] = bounds;
492
493
  const centerX = (x1 + x2) / 2;
@@ -513,7 +514,8 @@ var zoomToFitBounds = ({
513
514
  height: effectiveCanvasHeight
514
515
  });
515
516
  }
516
- const targetZoomValue = steppedZoom && fit !== "none" ? roundToStep(adjustedZoomValue, ZOOM_STEP, "floor") : adjustedZoomValue;
517
+ const scaledZoomValue = fit === "none" ? adjustedZoomValue : adjustedZoomValue * viewportZoomFactor;
518
+ const targetZoomValue = steppedZoom && fit !== "none" ? roundToStep(scaledZoomValue, ZOOM_STEP, "floor") : scaledZoomValue;
517
519
  const newZoomValue = getNormalizedZoom(
518
520
  clamp(targetZoomValue, minZoom, maxZoom)
519
521
  );
@@ -4663,6 +4665,8 @@ import {
4663
4665
  DEFAULT_ELEMENT_PROPS as DEFAULT_ELEMENT_PROPS2,
4664
4666
  DEFAULT_GRID_SIZE as DEFAULT_GRID_SIZE2,
4665
4667
  DEFAULT_GRID_STEP as DEFAULT_GRID_STEP2,
4668
+ COLOR_TOP_PICKS_SLOTS,
4669
+ colorToHex,
4666
4670
  randomId,
4667
4671
  getUpdatedTimestamp,
4668
4672
  updateActiveTool,
@@ -5280,6 +5284,41 @@ var LegacyAppStateMigrations = {
5280
5284
  ];
5281
5285
  }
5282
5286
  };
5287
+ var restoreColorTopPicks = (colorTopPicks, defaultColorTopPicks) => {
5288
+ if (!colorTopPicks) {
5289
+ return defaultColorTopPicks;
5290
+ }
5291
+ const restorePicks = (picks) => {
5292
+ if (!Array.isArray(picks)) {
5293
+ return null;
5294
+ }
5295
+ const seen = /* @__PURE__ */ new Set();
5296
+ const restored = [];
5297
+ for (const pick of picks) {
5298
+ if (typeof pick !== "string") {
5299
+ continue;
5300
+ }
5301
+ const normalized = colorToHex(pick);
5302
+ if (!normalized) {
5303
+ continue;
5304
+ }
5305
+ if (seen.has(normalized)) {
5306
+ continue;
5307
+ }
5308
+ seen.add(normalized);
5309
+ restored.push(pick);
5310
+ if (restored.length === COLOR_TOP_PICKS_SLOTS) {
5311
+ break;
5312
+ }
5313
+ }
5314
+ return restored;
5315
+ };
5316
+ return {
5317
+ elementStroke: restorePicks(colorTopPicks?.elementStroke),
5318
+ elementBackground: restorePicks(colorTopPicks?.elementBackground),
5319
+ bucketFill: restorePicks(colorTopPicks?.bucketFill)
5320
+ };
5321
+ };
5283
5322
  var restoreAppState = (appState, localAppState) => {
5284
5323
  appState = appState || {};
5285
5324
  const defaultAppState = getDefaultAppState();
@@ -5330,13 +5369,18 @@ var restoreAppState = (appState, localAppState) => {
5330
5369
  // string (legacy)
5331
5370
  typeof appState.openSidebar === "string" ? { name: DEFAULT_SIDEBAR.name } : nextAppState.openSidebar
5332
5371
  ),
5372
+ colorTopPicks: restoreColorTopPicks(
5373
+ appState.colorTopPicks,
5374
+ defaultAppState.colorTopPicks
5375
+ ),
5333
5376
  gridSize: getNormalizedGridSize(
5334
5377
  isFiniteNumber(appState.gridSize) ? appState.gridSize : DEFAULT_GRID_SIZE2
5335
5378
  ),
5336
5379
  gridStep: getNormalizedGridStep(
5337
5380
  isFiniteNumber(appState.gridStep) ? appState.gridStep : DEFAULT_GRID_STEP2
5338
5381
  ),
5339
- editingFrame: null
5382
+ editingFrame: null,
5383
+ zenModeEnabled: false
5340
5384
  };
5341
5385
  };
5342
5386
 
@@ -5345,7 +5389,7 @@ var parseFileContents = async (blob) => {
5345
5389
  let contents;
5346
5390
  if (blob.type === MIME_TYPES6.png) {
5347
5391
  try {
5348
- return await (await import("./data/image-NFLICJEW.js")).decodePngMetadata(blob);
5392
+ return await (await import("./data/image-F4TDOTKO.js")).decodePngMetadata(blob);
5349
5393
  } catch (error) {
5350
5394
  if (error.message === "INVALID") {
5351
5395
  throw new ImageSceneDataError(
@@ -5781,4 +5825,4 @@ export {
5781
5825
  createFile,
5782
5826
  normalizeFile
5783
5827
  };
5784
- //# sourceMappingURL=chunk-BCNQXIBK.js.map
5828
+ //# sourceMappingURL=chunk-3SND5YQP.js.map