@myoc/excalidraw 0.19.511 → 0.19.512
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 +53 -0
- package/dist/dev/{chunk-WGF6T3RR.js → chunk-OBLRXIUK.js} +72 -16
- package/dist/dev/chunk-OBLRXIUK.js.map +7 -0
- package/dist/dev/{chunk-G3MPOS33.js → chunk-QHLG4OQL.js} +2 -2
- package/dist/dev/data/{image-UBAFGYUH.js → image-R7FQP7SA.js} +3 -3
- package/dist/dev/index.js +230 -224
- package/dist/dev/index.js.map +4 -4
- package/dist/dev/subset-shared.chunk.js +1 -1
- package/dist/dev/subset-worker.chunk.js +1 -1
- package/dist/prod/chunk-5JM5RIGS.js +4 -0
- package/dist/prod/{chunk-L47KOK35.js → chunk-KVNPEVSY.js} +1 -1
- package/dist/prod/data/image-HP6HSTQ2.js +1 -0
- package/dist/prod/index.js +14 -14
- package/dist/prod/subset-shared.chunk.js +1 -1
- package/dist/prod/subset-worker.chunk.js +1 -1
- package/dist/types/common/src/constants.d.ts +1 -0
- package/dist/types/excalidraw/{animated-trail.d.ts → animatedTrail.d.ts} +4 -3
- package/dist/types/excalidraw/components/App.d.ts +1 -3
- package/dist/types/excalidraw/components/SVGLayer.d.ts +1 -1
- package/dist/types/excalidraw/eraser/index.d.ts +2 -3
- package/dist/types/excalidraw/{laser-trails.d.ts → laserTrails.d.ts} +5 -7
- package/dist/types/excalidraw/lasso/index.d.ts +2 -3
- package/dist/types/excalidraw/renderer/animation.d.ts +4 -1
- package/dist/types/excalidraw/types.d.ts +9 -0
- package/dist/types/math/src/point.d.ts +1 -0
- package/package.json +4 -4
- package/dist/dev/chunk-WGF6T3RR.js.map +0 -7
- package/dist/prod/chunk-FDFMDTNR.js +0 -4
- package/dist/prod/data/image-TSPDSW4O.js +0 -1
- package/dist/types/excalidraw/animation-frame-handler.d.ts +0 -16
- /package/dist/dev/{chunk-G3MPOS33.js.map → chunk-QHLG4OQL.js.map} +0 -0
- /package/dist/dev/data/{image-UBAFGYUH.js.map → image-R7FQP7SA.js.map} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -4389,4 +4389,57 @@ First release of `@excalidraw/excalidraw`## Excalidraw Library
|
|
|
4389
4389
|
- Incorrect import for color (was moved to common)
|
|
4390
4390
|
|
|
4391
4391
|
---
|
|
4392
|
+
## Excalidraw Library
|
|
4393
|
+
|
|
4394
|
+
**_This section lists the updates made to the excalidraw library and will not affect the integration._**
|
|
4395
|
+
|
|
4396
|
+
### Features
|
|
4397
|
+
|
|
4398
|
+
- Add ability to turn off compression for files that are smaller than a given size
|
|
4399
|
+
|
|
4400
|
+
- Add lock tool to the dropdown and also add the status of the extra tools to be the same icon as the selected tool
|
|
4401
|
+
|
|
4402
|
+
- Add view mode button
|
|
4403
|
+
|
|
4404
|
+
- Add multiple image copy paste or drag and drop
|
|
4405
|
+
|
|
4406
|
+
- Multiple image additions from clipboard
|
|
4407
|
+
|
|
4408
|
+
- Add arrange elements action
|
|
4409
|
+
|
|
4410
|
+
- Add top picks to appProps for both stoke color and background color
|
|
4411
|
+
|
|
4412
|
+
### Fixes
|
|
4413
|
+
|
|
4414
|
+
- Issues
|
|
4415
|
+
|
|
4416
|
+
- Make mobile mode more myoc looking
|
|
4417
|
+
|
|
4418
|
+
- Add normalise functionality
|
|
4419
|
+
|
|
4420
|
+
- Update with excalidraw
|
|
4421
|
+
|
|
4422
|
+
- Fix imports
|
|
4423
|
+
|
|
4424
|
+
- Fix mutateGroup to use scene.mutateGroup
|
|
4425
|
+
|
|
4426
|
+
- Imports
|
|
4427
|
+
|
|
4428
|
+
- Ensure that fileId is different for compressed vs uncompressed file
|
|
4429
|
+
|
|
4430
|
+
- Remove not working prop for dontResizeLimitMBs
|
|
4431
|
+
|
|
4432
|
+
- Add smartview for mobile
|
|
4433
|
+
|
|
4434
|
+
- Hide the alignment buttons if there is only one group selected (they do nothing if only one group is selected)
|
|
4435
|
+
|
|
4436
|
+
- Use css vars already provided instead of hard coding directly from oc-gray
|
|
4437
|
+
|
|
4438
|
+
- Remove unused variables
|
|
4439
|
+
|
|
4440
|
+
- Pass the new top pick color props properly
|
|
4441
|
+
|
|
4442
|
+
- Incorrect import for color (was moved to common)
|
|
4443
|
+
|
|
4444
|
+
---
|
|
4392
4445
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
define_import_meta_env_default
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-QHLG4OQL.js";
|
|
4
4
|
import {
|
|
5
5
|
__publicField
|
|
6
6
|
} from "./chunk-XDFCUUT6.js";
|
|
@@ -4437,7 +4437,7 @@ var getExportSize = (elements, exportPadding, scale) => {
|
|
|
4437
4437
|
};
|
|
4438
4438
|
|
|
4439
4439
|
// data/restore.ts
|
|
4440
|
-
import { isFiniteNumber, pointFrom as pointFrom2 } from "@excalidraw/math";
|
|
4440
|
+
import { isFiniteNumber, isValidPoint, pointFrom as pointFrom2 } from "@excalidraw/math";
|
|
4441
4441
|
import {
|
|
4442
4442
|
DEFAULT_FONT_FAMILY as DEFAULT_FONT_FAMILY2,
|
|
4443
4443
|
DEFAULT_TEXT_ALIGN as DEFAULT_TEXT_ALIGN2,
|
|
@@ -4486,6 +4486,45 @@ import { refreshTextDimensions } from "@excalidraw/element";
|
|
|
4486
4486
|
import { getNormalizedDimensions } from "@excalidraw/element";
|
|
4487
4487
|
import { isInvisiblySmallElement } from "@excalidraw/element";
|
|
4488
4488
|
var MAX_ARROW_PX = 75e3;
|
|
4489
|
+
var restoreLinearElementPoints = (points, width, height) => {
|
|
4490
|
+
const restoredPoints = Array.isArray(points) ? points.reduce((acc, point) => {
|
|
4491
|
+
if (isValidPoint(point)) {
|
|
4492
|
+
acc.push(pointFrom2(point[0], point[1]));
|
|
4493
|
+
}
|
|
4494
|
+
return acc;
|
|
4495
|
+
}, []) : [];
|
|
4496
|
+
return restoredPoints.length < 2 ? [
|
|
4497
|
+
pointFrom2(0, 0),
|
|
4498
|
+
pointFrom2(
|
|
4499
|
+
isFiniteNumber(width) ? width : 0,
|
|
4500
|
+
isFiniteNumber(height) ? height : 0
|
|
4501
|
+
)
|
|
4502
|
+
] : restoredPoints;
|
|
4503
|
+
};
|
|
4504
|
+
var restoreFreedrawPoints = (points, pressures) => {
|
|
4505
|
+
if (!Array.isArray(points)) {
|
|
4506
|
+
return {
|
|
4507
|
+
points: [],
|
|
4508
|
+
pressures: []
|
|
4509
|
+
};
|
|
4510
|
+
}
|
|
4511
|
+
const pressureValues = Array.isArray(pressures) ? pressures : [];
|
|
4512
|
+
const restoredPoints = [];
|
|
4513
|
+
const restoredPressures = [];
|
|
4514
|
+
points.forEach((point, index) => {
|
|
4515
|
+
if (isValidPoint(point)) {
|
|
4516
|
+
restoredPoints.push(pointFrom2(point[0], point[1]));
|
|
4517
|
+
if (index in pressureValues) {
|
|
4518
|
+
const pressure = pressureValues[index];
|
|
4519
|
+
restoredPressures.push(isFiniteNumber(pressure) ? pressure : 0.5);
|
|
4520
|
+
}
|
|
4521
|
+
}
|
|
4522
|
+
});
|
|
4523
|
+
return {
|
|
4524
|
+
points: restoredPoints,
|
|
4525
|
+
pressures: restoredPressures
|
|
4526
|
+
};
|
|
4527
|
+
};
|
|
4489
4528
|
var AllowedExcalidrawActiveTools = {
|
|
4490
4529
|
selection: true,
|
|
4491
4530
|
lasso: true,
|
|
@@ -4675,10 +4714,14 @@ var restoreElement = (element, targetElementsMap, existingElementsMap, opts) =>
|
|
|
4675
4714
|
}
|
|
4676
4715
|
return element;
|
|
4677
4716
|
case "freedraw": {
|
|
4717
|
+
const { points: points2, pressures } = restoreFreedrawPoints(
|
|
4718
|
+
element.points,
|
|
4719
|
+
element.pressures
|
|
4720
|
+
);
|
|
4678
4721
|
return restoreElementWithProperties(element, {
|
|
4679
|
-
points:
|
|
4722
|
+
points: points2,
|
|
4680
4723
|
simulatePressure: element.simulatePressure,
|
|
4681
|
-
pressures
|
|
4724
|
+
pressures
|
|
4682
4725
|
});
|
|
4683
4726
|
}
|
|
4684
4727
|
case "image":
|
|
@@ -4694,12 +4737,18 @@ var restoreElement = (element, targetElementsMap, existingElementsMap, opts) =>
|
|
|
4694
4737
|
const endArrowhead = normalizeArrowhead(element.endArrowhead);
|
|
4695
4738
|
let x = element.x;
|
|
4696
4739
|
let y = element.y;
|
|
4697
|
-
let points = (
|
|
4698
|
-
|
|
4699
|
-
|
|
4740
|
+
let points = restoreLinearElementPoints(
|
|
4741
|
+
element.points,
|
|
4742
|
+
element.width,
|
|
4743
|
+
element.height
|
|
4700
4744
|
);
|
|
4701
4745
|
if (points[0][0] !== 0 || points[0][1] !== 0) {
|
|
4702
|
-
({ points, x, y } = LinearElementEditor2.getNormalizeElementPointsAndCoords(
|
|
4746
|
+
({ points, x, y } = LinearElementEditor2.getNormalizeElementPointsAndCoords({
|
|
4747
|
+
...element,
|
|
4748
|
+
points,
|
|
4749
|
+
x: x ?? 0,
|
|
4750
|
+
y: y ?? 0
|
|
4751
|
+
}));
|
|
4703
4752
|
}
|
|
4704
4753
|
return restoreElementWithProperties(element, {
|
|
4705
4754
|
type: "line",
|
|
@@ -4711,7 +4760,7 @@ var restoreElement = (element, targetElementsMap, existingElementsMap, opts) =>
|
|
|
4711
4760
|
x,
|
|
4712
4761
|
y,
|
|
4713
4762
|
...isLineElement(element) ? {
|
|
4714
|
-
polygon: isValidPolygon(
|
|
4763
|
+
polygon: isValidPolygon(points) ? element.polygon ?? false : false
|
|
4715
4764
|
} : {},
|
|
4716
4765
|
...getSizeFromPoints(points)
|
|
4717
4766
|
});
|
|
@@ -4720,21 +4769,28 @@ var restoreElement = (element, targetElementsMap, existingElementsMap, opts) =>
|
|
|
4720
4769
|
const endArrowhead2 = element.endArrowhead === void 0 ? "arrow" : normalizeArrowhead(element.endArrowhead);
|
|
4721
4770
|
const x2 = element.x;
|
|
4722
4771
|
const y2 = element.y;
|
|
4723
|
-
const points2 = (
|
|
4724
|
-
|
|
4725
|
-
|
|
4772
|
+
const points2 = restoreLinearElementPoints(
|
|
4773
|
+
element.points,
|
|
4774
|
+
element.width,
|
|
4775
|
+
element.height
|
|
4726
4776
|
);
|
|
4777
|
+
const elementWithRestoredPoints = {
|
|
4778
|
+
...element,
|
|
4779
|
+
points: points2,
|
|
4780
|
+
x: x2 ?? 0,
|
|
4781
|
+
y: y2 ?? 0
|
|
4782
|
+
};
|
|
4727
4783
|
const base = {
|
|
4728
4784
|
type: element.type,
|
|
4729
4785
|
startBinding: repairBinding(
|
|
4730
|
-
|
|
4786
|
+
elementWithRestoredPoints,
|
|
4731
4787
|
element.startBinding,
|
|
4732
4788
|
targetElementsMap,
|
|
4733
4789
|
existingElementsMap,
|
|
4734
4790
|
"start"
|
|
4735
4791
|
),
|
|
4736
4792
|
endBinding: repairBinding(
|
|
4737
|
-
|
|
4793
|
+
elementWithRestoredPoints,
|
|
4738
4794
|
element.endBinding,
|
|
4739
4795
|
targetElementsMap,
|
|
4740
4796
|
existingElementsMap,
|
|
@@ -5045,7 +5101,7 @@ var parseFileContents = async (blob) => {
|
|
|
5045
5101
|
let contents;
|
|
5046
5102
|
if (blob.type === MIME_TYPES6.png) {
|
|
5047
5103
|
try {
|
|
5048
|
-
return await (await import("./data/image-
|
|
5104
|
+
return await (await import("./data/image-R7FQP7SA.js")).decodePngMetadata(blob);
|
|
5049
5105
|
} catch (error) {
|
|
5050
5106
|
if (error.message === "INVALID") {
|
|
5051
5107
|
throw new ImageSceneDataError(
|
|
@@ -5406,4 +5462,4 @@ export {
|
|
|
5406
5462
|
createFile,
|
|
5407
5463
|
normalizeFile
|
|
5408
5464
|
};
|
|
5409
|
-
//# sourceMappingURL=chunk-
|
|
5465
|
+
//# sourceMappingURL=chunk-OBLRXIUK.js.map
|