@myoc/excalidraw 0.19.528 → 0.19.529

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -5320,6 +5320,7 @@ First release of `@excalidraw/excalidraw`## Excalidraw Library
5320
5320
  - Incorrect import for color (was moved to common)
5321
5321
 
5322
5322
  ---
5323
+
5323
5324
  ## Excalidraw Library
5324
5325
 
5325
5326
  **_This section lists the updates made to the excalidraw library and will not affect the integration._**
@@ -5373,6 +5374,7 @@ First release of `@excalidraw/excalidraw`## Excalidraw Library
5373
5374
  - Incorrect import for color (was moved to common)
5374
5375
 
5375
5376
  ---
5377
+
5376
5378
  ## Excalidraw Library
5377
5379
 
5378
5380
  **_This section lists the updates made to the excalidraw library and will not affect the integration._**
@@ -5426,6 +5428,7 @@ First release of `@excalidraw/excalidraw`## Excalidraw Library
5426
5428
  - Incorrect import for color (was moved to common)
5427
5429
 
5428
5430
  ---
5431
+
5429
5432
  ## Excalidraw Library
5430
5433
 
5431
5434
  **_This section lists the updates made to the excalidraw library and will not affect the integration._**
@@ -5479,6 +5482,7 @@ First release of `@excalidraw/excalidraw`## Excalidraw Library
5479
5482
  - Incorrect import for color (was moved to common)
5480
5483
 
5481
5484
  ---
5485
+
5482
5486
  ## Excalidraw Library
5483
5487
 
5484
5488
  **_This section lists the updates made to the excalidraw library and will not affect the integration._**
@@ -5531,5 +5535,57 @@ First release of `@excalidraw/excalidraw`## Excalidraw Library
5531
5535
 
5532
5536
  - Incorrect import for color (was moved to common)
5533
5537
 
5538
+ ---## Excalidraw Library
5539
+
5540
+ **_This section lists the updates made to the excalidraw library and will not affect the integration._**
5541
+
5542
+ ### Features
5543
+
5544
+ - Add ability to turn off compression for files that are smaller than a given size
5545
+
5546
+ - Add lock tool to the dropdown and also add the status of the extra tools to be the same icon as the selected tool
5547
+
5548
+ - Add view mode button
5549
+
5550
+ - Add multiple image copy paste or drag and drop
5551
+
5552
+ - Multiple image additions from clipboard
5553
+
5554
+ - Add arrange elements action
5555
+
5556
+ - Add top picks to appProps for both stoke color and background color
5557
+
5558
+ ### Fixes
5559
+
5560
+ - Issues
5561
+
5562
+ - Make mobile mode more myoc looking
5563
+
5564
+ - Add normalise functionality
5565
+
5566
+ - Update with excalidraw
5567
+
5568
+ - Fix imports
5569
+
5570
+ - Fix mutateGroup to use scene.mutateGroup
5571
+
5572
+ - Imports
5573
+
5574
+ - Ensure that fileId is different for compressed vs uncompressed file
5575
+
5576
+ - Remove not working prop for dontResizeLimitMBs
5577
+
5578
+ - Add smartview for mobile
5579
+
5580
+ - Hide the alignment buttons if there is only one group selected (they do nothing if only one group is selected)
5581
+
5582
+ - Use css vars already provided instead of hard coding directly from oc-gray
5583
+
5584
+ - Remove unused variables
5585
+
5586
+ - Pass the new top pick color props properly
5587
+
5588
+ - Incorrect import for color (was moved to common)
5589
+
5534
5590
  ---
5535
5591
 
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  define_import_meta_env_default
3
- } from "./chunk-6FFT5HLH.js";
3
+ } from "./chunk-H5L4PT3U.js";
4
4
  import {
5
5
  __publicField
6
6
  } from "./chunk-XDFCUUT6.js";
@@ -4654,6 +4654,7 @@ var getCanvasSize = (elements, exportPadding) => {
4654
4654
 
4655
4655
  // data/restore.ts
4656
4656
  import { isFiniteNumber, isValidPoint, pointFrom as pointFrom3 } from "@excalidraw/math";
4657
+ import { generateKeyBetween } from "@excalidraw/fractional-indexing";
4657
4658
  import {
4658
4659
  DEFAULT_FONT_FAMILY as DEFAULT_FONT_FAMILY2,
4659
4660
  DEFAULT_STROKE_STREAMLINE,
@@ -4702,7 +4703,10 @@ import {
4702
4703
  isTextElement as isTextElement4,
4703
4704
  isUsingAdaptiveRadius
4704
4705
  } from "@excalidraw/element";
4705
- import { syncInvalidIndices as syncInvalidIndices2 } from "@excalidraw/element";
4706
+ import {
4707
+ orderByFractionalIndex,
4708
+ syncInvalidIndices as syncInvalidIndices2
4709
+ } from "@excalidraw/element";
4706
4710
  import { refreshTextDimensions } from "@excalidraw/element";
4707
4711
  import { getNormalizedDimensions } from "@excalidraw/element";
4708
4712
  import { isInvisiblySmallElement } from "@excalidraw/element";
@@ -5130,6 +5134,12 @@ var repairBoundElement = (boundElement, elementsMap) => {
5130
5134
  if (boundElement.isDeleted) {
5131
5135
  return;
5132
5136
  }
5137
+ if (boundElement.index != null && container.index != null && boundElement.index <= container.index) {
5138
+ boundElement.index = generateKeyBetween(
5139
+ container.index,
5140
+ null
5141
+ );
5142
+ }
5133
5143
  if (container.boundElements && !container.boundElements.find((binding) => binding.id === boundElement.id)) {
5134
5144
  const boundElements = (container.boundElements || (container.boundElements = [])).slice();
5135
5145
  boundElements.push({ type: "text", id: boundElement.id });
@@ -5217,56 +5227,58 @@ var restoreElements = (targetElements, existingElements, opts) => {
5217
5227
  }
5218
5228
  }
5219
5229
  }
5220
- return restoredElements.map((element) => {
5221
- if (isElbowArrow(element) && !isArrowBoundToElement(element) && !validateElbowPoints(element.points)) {
5222
- return {
5223
- ...element,
5224
- ...updateElbowArrowPoints(
5225
- element,
5226
- restoredElementsMap,
5227
- {
5228
- points: [
5229
- pointFrom3(0, 0),
5230
- element.points[element.points.length - 1]
5231
- ]
5232
- }
5233
- ),
5234
- index: element.index
5235
- };
5236
- }
5237
- if (isElbowArrow(element) && element.startBinding && element.endBinding && element.startBinding.elementId === element.endBinding.elementId && element.points.length > 1 && element.points.some(
5238
- ([rx, ry]) => Math.abs(rx) > 1e6 || Math.abs(ry) > 1e6
5239
- )) {
5240
- console.error("Fixing self-bound elbow arrow", element.id);
5241
- const boundElement = restoredElementsMap.get(
5242
- element.startBinding.elementId
5243
- );
5244
- if (!boundElement) {
5245
- console.error(
5246
- "Bound element not found",
5230
+ return orderByFractionalIndex(
5231
+ restoredElements.map((element) => {
5232
+ if (isElbowArrow(element) && !isArrowBoundToElement(element) && !validateElbowPoints(element.points)) {
5233
+ return {
5234
+ ...element,
5235
+ ...updateElbowArrowPoints(
5236
+ element,
5237
+ restoredElementsMap,
5238
+ {
5239
+ points: [
5240
+ pointFrom3(0, 0),
5241
+ element.points[element.points.length - 1]
5242
+ ]
5243
+ }
5244
+ ),
5245
+ index: element.index
5246
+ };
5247
+ }
5248
+ if (isElbowArrow(element) && element.startBinding && element.endBinding && element.startBinding.elementId === element.endBinding.elementId && element.points.length > 1 && element.points.some(
5249
+ ([rx, ry]) => Math.abs(rx) > 1e6 || Math.abs(ry) > 1e6
5250
+ )) {
5251
+ console.error("Fixing self-bound elbow arrow", element.id);
5252
+ const boundElement = restoredElementsMap.get(
5247
5253
  element.startBinding.elementId
5248
5254
  );
5249
- return element;
5255
+ if (!boundElement) {
5256
+ console.error(
5257
+ "Bound element not found",
5258
+ element.startBinding.elementId
5259
+ );
5260
+ return element;
5261
+ }
5262
+ return {
5263
+ ...element,
5264
+ x: boundElement.x + boundElement.width / 2,
5265
+ y: boundElement.y - 5,
5266
+ width: boundElement.width,
5267
+ height: boundElement.height,
5268
+ points: [
5269
+ pointFrom3(0, 0),
5270
+ pointFrom3(0, -10),
5271
+ pointFrom3(boundElement.width / 2 + 5, -10),
5272
+ pointFrom3(
5273
+ boundElement.width / 2 + 5,
5274
+ boundElement.height / 2 + 5
5275
+ )
5276
+ ]
5277
+ };
5250
5278
  }
5251
- return {
5252
- ...element,
5253
- x: boundElement.x + boundElement.width / 2,
5254
- y: boundElement.y - 5,
5255
- width: boundElement.width,
5256
- height: boundElement.height,
5257
- points: [
5258
- pointFrom3(0, 0),
5259
- pointFrom3(0, -10),
5260
- pointFrom3(boundElement.width / 2 + 5, -10),
5261
- pointFrom3(
5262
- boundElement.width / 2 + 5,
5263
- boundElement.height / 2 + 5
5264
- )
5265
- ]
5266
- };
5267
- }
5268
- return element;
5269
- });
5279
+ return element;
5280
+ })
5281
+ );
5270
5282
  };
5271
5283
  var coalesceAppStateValue = (key, appState, defaultAppState) => {
5272
5284
  const value = appState[key];
@@ -5389,7 +5401,7 @@ var parseFileContents = async (blob) => {
5389
5401
  let contents;
5390
5402
  if (blob.type === MIME_TYPES6.png) {
5391
5403
  try {
5392
- return await (await import("./data/image-V7WKCORB.js")).decodePngMetadata(blob);
5404
+ return await (await import("./data/image-GYAOLTNI.js")).decodePngMetadata(blob);
5393
5405
  } catch (error) {
5394
5406
  if (error.message === "INVALID") {
5395
5407
  throw new ImageSceneDataError(
@@ -5826,4 +5838,4 @@ export {
5826
5838
  createFile,
5827
5839
  normalizeFile
5828
5840
  };
5829
- //# sourceMappingURL=chunk-NY5S5VQK.js.map
5841
+ //# sourceMappingURL=chunk-7GX2B2N5.js.map