@myoc/excalidraw 0.19.519 → 0.19.520
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-RIK6B6HD.js → chunk-FQHULQ5P.js} +62 -26
- package/dist/dev/chunk-FQHULQ5P.js.map +7 -0
- package/dist/dev/{chunk-ZGRXNVW4.js → chunk-IU2VFRFU.js} +4 -1
- package/dist/dev/chunk-IU2VFRFU.js.map +7 -0
- package/dist/dev/{chunk-MCPNWEHU.js → chunk-SJJUXTTF.js} +2 -2
- package/dist/dev/data/{image-IRC25PM5.js → image-X3JCQEUX.js} +3 -3
- package/dist/dev/index.css +12 -0
- package/dist/dev/index.css.map +2 -2
- package/dist/dev/index.js +1315 -395
- package/dist/dev/index.js.map +4 -4
- package/dist/dev/locales/{en-RQFAMS2U.js → en-25BPHB4T.js} +2 -2
- package/dist/dev/subset-shared.chunk.js +1 -1
- package/dist/dev/subset-worker.chunk.js +1 -1
- package/dist/prod/{chunk-QW7MIEK6.js → chunk-3QXZ5NQO.js} +1 -1
- package/dist/prod/{chunk-VHQT4IVX.js → chunk-3UXKIWVY.js} +2 -2
- package/dist/prod/chunk-YJSNILE6.js +4 -0
- package/dist/prod/data/image-OBEPGJLJ.js +1 -0
- package/dist/prod/index.css +1 -1
- package/dist/prod/index.js +20 -20
- package/dist/prod/locales/{en-6UCVDQQ7.js → en-AH5BYWXT.js} +1 -1
- 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 +8 -5
- package/dist/types/common/src/utils.d.ts +0 -42
- package/dist/types/element/src/comparisons.d.ts +1 -0
- package/dist/types/element/src/image.d.ts +5 -0
- package/dist/types/element/src/newElement.d.ts +2 -0
- package/dist/types/element/src/types.d.ts +8 -0
- package/dist/types/excalidraw/actions/actionBoundText.d.ts +4 -2
- package/dist/types/excalidraw/actions/actionCanvas.d.ts +22 -11
- package/dist/types/excalidraw/actions/actionClipboard.d.ts +4 -2
- package/dist/types/excalidraw/actions/actionCropEditor.d.ts +2 -1
- package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +6 -3
- package/dist/types/excalidraw/actions/actionDeselect.d.ts +2 -1
- package/dist/types/excalidraw/actions/actionElementLink.d.ts +2 -1
- package/dist/types/excalidraw/actions/actionElementLock.d.ts +4 -2
- package/dist/types/excalidraw/actions/actionEmbeddable.d.ts +2 -1
- package/dist/types/excalidraw/actions/actionExport.d.ts +4 -2
- package/dist/types/excalidraw/actions/actionFrame.d.ts +10 -4
- package/dist/types/excalidraw/actions/actionGroup.d.ts +4 -2
- package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +4 -1
- package/dist/types/excalidraw/actions/actionLink.d.ts +2 -1
- package/dist/types/excalidraw/actions/actionMenu.d.ts +2 -1
- package/dist/types/excalidraw/actions/actionProperties.d.ts +16 -5
- package/dist/types/excalidraw/actions/actionSelectAll.d.ts +2 -1
- package/dist/types/excalidraw/actions/actionStyles.d.ts +2 -1
- package/dist/types/excalidraw/actions/actionToggleArrowBinding.d.ts +2 -1
- package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +2 -1
- package/dist/types/excalidraw/actions/actionToggleMidpointSnapping.d.ts +2 -1
- package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +2 -1
- package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +2 -1
- package/dist/types/excalidraw/actions/actionToggleStats.d.ts +2 -1
- package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +2 -1
- package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +2 -1
- package/dist/types/excalidraw/actions/index.d.ts +1 -1
- package/dist/types/excalidraw/actions/types.d.ts +1 -1
- package/dist/types/excalidraw/appState.d.ts +2 -1
- package/dist/types/excalidraw/components/App.d.ts +12 -28
- package/dist/types/excalidraw/components/ColorPicker/colorPickerUtils.d.ts +1 -1
- package/dist/types/excalidraw/components/ConvertElementTypePopup.d.ts +1 -1
- package/dist/types/excalidraw/components/EyeDropper.d.ts +1 -1
- package/dist/types/excalidraw/components/OverwriteConfirm/OverwriteConfirmState.d.ts +1 -1
- package/dist/types/excalidraw/components/SearchMenu.d.ts +1 -1
- package/dist/types/excalidraw/components/Sidebar/Sidebar.d.ts +1 -1
- package/dist/types/excalidraw/components/canvases/StaticCanvas.d.ts +2 -1
- package/dist/types/excalidraw/components/icons.d.ts +2 -0
- package/dist/types/excalidraw/data/blob.d.ts +2 -1
- package/dist/types/excalidraw/data/json.d.ts +2 -1
- package/dist/types/excalidraw/index.d.ts +2 -2
- package/dist/types/excalidraw/renderer/animation.d.ts +1 -0
- package/dist/types/excalidraw/scene/Renderer.d.ts +2 -0
- package/dist/types/excalidraw/scene/index.d.ts +1 -1
- package/dist/types/excalidraw/scene/types.d.ts +1 -0
- package/dist/types/excalidraw/scroll.d.ts +46 -0
- package/dist/types/excalidraw/types.d.ts +16 -3
- package/dist/types/laser-pointer/src/index.d.ts +2 -0
- package/dist/types/laser-pointer/src/math.d.ts +16 -0
- package/dist/types/laser-pointer/src/simplify.d.ts +2 -0
- package/dist/types/laser-pointer/src/state.d.ts +35 -0
- package/package.json +4 -4
- package/dist/dev/chunk-RIK6B6HD.js.map +0 -7
- package/dist/dev/chunk-ZGRXNVW4.js.map +0 -7
- package/dist/prod/chunk-FL5QOM6C.js +0 -4
- package/dist/prod/data/image-7LG744DI.js +0 -1
- /package/dist/dev/{chunk-MCPNWEHU.js.map → chunk-SJJUXTTF.js.map} +0 -0
- /package/dist/dev/data/{image-IRC25PM5.js.map → image-X3JCQEUX.js.map} +0 -0
- /package/dist/dev/locales/{en-RQFAMS2U.js.map → en-25BPHB4T.js.map} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -4873,4 +4873,57 @@ First release of `@excalidraw/excalidraw`## Excalidraw Library
|
|
|
4873
4873
|
- Incorrect import for color (was moved to common)
|
|
4874
4874
|
|
|
4875
4875
|
---
|
|
4876
|
+
## Excalidraw Library
|
|
4877
|
+
|
|
4878
|
+
**_This section lists the updates made to the excalidraw library and will not affect the integration._**
|
|
4879
|
+
|
|
4880
|
+
### Features
|
|
4881
|
+
|
|
4882
|
+
- Add ability to turn off compression for files that are smaller than a given size
|
|
4883
|
+
|
|
4884
|
+
- Add lock tool to the dropdown and also add the status of the extra tools to be the same icon as the selected tool
|
|
4885
|
+
|
|
4886
|
+
- Add view mode button
|
|
4887
|
+
|
|
4888
|
+
- Add multiple image copy paste or drag and drop
|
|
4889
|
+
|
|
4890
|
+
- Multiple image additions from clipboard
|
|
4891
|
+
|
|
4892
|
+
- Add arrange elements action
|
|
4893
|
+
|
|
4894
|
+
- Add top picks to appProps for both stoke color and background color
|
|
4895
|
+
|
|
4896
|
+
### Fixes
|
|
4897
|
+
|
|
4898
|
+
- Issues
|
|
4899
|
+
|
|
4900
|
+
- Make mobile mode more myoc looking
|
|
4901
|
+
|
|
4902
|
+
- Add normalise functionality
|
|
4903
|
+
|
|
4904
|
+
- Update with excalidraw
|
|
4905
|
+
|
|
4906
|
+
- Fix imports
|
|
4907
|
+
|
|
4908
|
+
- Fix mutateGroup to use scene.mutateGroup
|
|
4909
|
+
|
|
4910
|
+
- Imports
|
|
4911
|
+
|
|
4912
|
+
- Ensure that fileId is different for compressed vs uncompressed file
|
|
4913
|
+
|
|
4914
|
+
- Remove not working prop for dontResizeLimitMBs
|
|
4915
|
+
|
|
4916
|
+
- Add smartview for mobile
|
|
4917
|
+
|
|
4918
|
+
- Hide the alignment buttons if there is only one group selected (they do nothing if only one group is selected)
|
|
4919
|
+
|
|
4920
|
+
- Use css vars already provided instead of hard coding directly from oc-gray
|
|
4921
|
+
|
|
4922
|
+
- Remove unused variables
|
|
4923
|
+
|
|
4924
|
+
- Pass the new top pick color props properly
|
|
4925
|
+
|
|
4926
|
+
- Incorrect import for color (was moved to common)
|
|
4927
|
+
|
|
4928
|
+
---
|
|
4876
4929
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
define_import_meta_env_default
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-SJJUXTTF.js";
|
|
4
4
|
import {
|
|
5
5
|
__publicField
|
|
6
6
|
} from "./chunk-XDFCUUT6.js";
|
|
@@ -27,6 +27,7 @@ import {
|
|
|
27
27
|
DEFAULT_ELEMENT_PROPS,
|
|
28
28
|
DEFAULT_FONT_FAMILY,
|
|
29
29
|
DEFAULT_FONT_SIZE,
|
|
30
|
+
DEFAULT_ELEMENT_STROKE_WIDTH_KEY,
|
|
30
31
|
DEFAULT_TEXT_ALIGN,
|
|
31
32
|
DEFAULT_GRID_SIZE,
|
|
32
33
|
EXPORT_SCALES,
|
|
@@ -59,12 +60,13 @@ var getDefaultAppState = () => {
|
|
|
59
60
|
currentItemFontSize: DEFAULT_FONT_SIZE,
|
|
60
61
|
currentItemOpacity: DEFAULT_ELEMENT_PROPS.opacity,
|
|
61
62
|
currentItemRoughness: DEFAULT_ELEMENT_PROPS.roughness,
|
|
63
|
+
currentItemStrokeVariability: "constant",
|
|
62
64
|
currentItemStartArrowhead: null,
|
|
63
65
|
currentItemStrokeColor: DEFAULT_ELEMENT_PROPS.strokeColor,
|
|
64
66
|
currentItemRoundness: isTestEnv() ? "sharp" : "round",
|
|
65
67
|
currentItemArrowType: ARROW_TYPE.round,
|
|
66
68
|
currentItemStrokeStyle: DEFAULT_ELEMENT_PROPS.strokeStyle,
|
|
67
|
-
|
|
69
|
+
currentItemStrokeWidthKey: DEFAULT_ELEMENT_STROKE_WIDTH_KEY,
|
|
68
70
|
currentItemTextAlign: DEFAULT_TEXT_ALIGN,
|
|
69
71
|
currentHoveredFontFamily: null,
|
|
70
72
|
cursorButton: "up",
|
|
@@ -183,10 +185,15 @@ var APP_STATE_STORAGE_CONF = /* @__PURE__ */ ((config) => config)({
|
|
|
183
185
|
},
|
|
184
186
|
currentItemOpacity: { browser: true, export: false, server: false },
|
|
185
187
|
currentItemRoughness: { browser: true, export: false, server: false },
|
|
188
|
+
currentItemStrokeVariability: {
|
|
189
|
+
browser: true,
|
|
190
|
+
export: false,
|
|
191
|
+
server: false
|
|
192
|
+
},
|
|
186
193
|
currentItemStartArrowhead: { browser: true, export: false, server: false },
|
|
187
194
|
currentItemStrokeColor: { browser: true, export: false, server: false },
|
|
188
195
|
currentItemStrokeStyle: { browser: true, export: false, server: false },
|
|
189
|
-
|
|
196
|
+
currentItemStrokeWidthKey: { browser: true, export: false, server: false },
|
|
190
197
|
currentItemTextAlign: { browser: true, export: false, server: false },
|
|
191
198
|
currentHoveredFontFamily: { browser: false, export: false, server: false },
|
|
192
199
|
cursorButton: { browser: true, export: false, server: false },
|
|
@@ -417,6 +424,7 @@ import {
|
|
|
417
424
|
hasBackground,
|
|
418
425
|
hasStrokeWidth,
|
|
419
426
|
hasStrokeStyle,
|
|
427
|
+
hasFreedrawMode,
|
|
420
428
|
canHaveArrowheads,
|
|
421
429
|
canChangeRoundness
|
|
422
430
|
} from "@excalidraw/element";
|
|
@@ -4459,6 +4467,7 @@ var getExportSize = (elements, exportPadding, scale) => {
|
|
|
4459
4467
|
import { isFiniteNumber, isValidPoint, pointFrom as pointFrom2 } from "@excalidraw/math";
|
|
4460
4468
|
import {
|
|
4461
4469
|
DEFAULT_FONT_FAMILY as DEFAULT_FONT_FAMILY2,
|
|
4470
|
+
DEFAULT_STROKE_STREAMLINE,
|
|
4462
4471
|
DEFAULT_TEXT_ALIGN as DEFAULT_TEXT_ALIGN2,
|
|
4463
4472
|
DEFAULT_VERTICAL_ALIGN,
|
|
4464
4473
|
FONT_FAMILY as FONT_FAMILY3,
|
|
@@ -4473,7 +4482,9 @@ import {
|
|
|
4473
4482
|
arrayToMap as arrayToMap2,
|
|
4474
4483
|
getSizeFromPoints,
|
|
4475
4484
|
normalizeLink as normalizeLink2,
|
|
4476
|
-
getLineHeight
|
|
4485
|
+
getLineHeight,
|
|
4486
|
+
STROKE_WIDTH,
|
|
4487
|
+
STROKE_WIDTH_KEYS
|
|
4477
4488
|
} from "@excalidraw/common";
|
|
4478
4489
|
import {
|
|
4479
4490
|
calculateFixedPointForNonElbowArrowBinding,
|
|
@@ -4504,7 +4515,25 @@ import { syncInvalidIndices as syncInvalidIndices2 } from "@excalidraw/element";
|
|
|
4504
4515
|
import { refreshTextDimensions } from "@excalidraw/element";
|
|
4505
4516
|
import { getNormalizedDimensions } from "@excalidraw/element";
|
|
4506
4517
|
import { isInvisiblySmallElement } from "@excalidraw/element";
|
|
4507
|
-
var
|
|
4518
|
+
var MAX_LINEAR_PX = 75e3;
|
|
4519
|
+
var handleOversizedLinearElements = (element) => {
|
|
4520
|
+
if (element.width <= MAX_LINEAR_PX && element.height <= MAX_LINEAR_PX) {
|
|
4521
|
+
return element;
|
|
4522
|
+
}
|
|
4523
|
+
const label = element.type === "arrow" ? `${isElbowArrow(element) ? "elbow" : "simple"} arrow` : element.type;
|
|
4524
|
+
console.error(
|
|
4525
|
+
`Removing extremely large ${label} ${element.id} (width: ${element.width}, height: ${element.height}, x: ${element.x}, y: ${element.y})`
|
|
4526
|
+
);
|
|
4527
|
+
return {
|
|
4528
|
+
...element,
|
|
4529
|
+
x: 0,
|
|
4530
|
+
y: 0,
|
|
4531
|
+
width: 100,
|
|
4532
|
+
height: 100,
|
|
4533
|
+
points: [pointFrom2(0, 0), pointFrom2(100, 100)],
|
|
4534
|
+
isDeleted: true
|
|
4535
|
+
};
|
|
4536
|
+
};
|
|
4508
4537
|
var restoreLinearElementPoints = (points, width, height) => {
|
|
4509
4538
|
const restoredPoints = Array.isArray(points) ? points.reduce((acc, point) => {
|
|
4510
4539
|
if (isValidPoint(point)) {
|
|
@@ -4563,6 +4592,23 @@ var AllowedExcalidrawActiveTools = {
|
|
|
4563
4592
|
laser: false,
|
|
4564
4593
|
magicframe: false
|
|
4565
4594
|
};
|
|
4595
|
+
var ALLOWED_STROKE_VARIABILITIES = /* @__PURE__ */ new Set([
|
|
4596
|
+
"constant",
|
|
4597
|
+
"variable"
|
|
4598
|
+
]);
|
|
4599
|
+
var restoreStrokeVariability = (variability, defaultValue) => {
|
|
4600
|
+
return typeof variability === "string" && ALLOWED_STROKE_VARIABILITIES.has(variability) ? variability : defaultValue;
|
|
4601
|
+
};
|
|
4602
|
+
var getStrokeWidthKey = (strokeWidth) => {
|
|
4603
|
+
return isFiniteNumber(strokeWidth) ? STROKE_WIDTH_KEYS.find((key) => STROKE_WIDTH[key] === strokeWidth) ?? null : null;
|
|
4604
|
+
};
|
|
4605
|
+
var restoreFreedrawStrokeOptions = (strokeOptions) => {
|
|
4606
|
+
const options = strokeOptions && typeof strokeOptions === "object" ? strokeOptions : null;
|
|
4607
|
+
return {
|
|
4608
|
+
variability: restoreStrokeVariability(options?.variability, "variable"),
|
|
4609
|
+
streamline: isFiniteNumber(options?.streamline) ? options?.streamline : DEFAULT_STROKE_STREAMLINE
|
|
4610
|
+
};
|
|
4611
|
+
};
|
|
4566
4612
|
var getFontFamilyByName = (fontFamilyName) => {
|
|
4567
4613
|
if (Object.keys(FONT_FAMILY3).includes(fontFamilyName)) {
|
|
4568
4614
|
return FONT_FAMILY3[fontFamilyName];
|
|
@@ -4740,6 +4786,7 @@ var restoreElement = (element, targetElementsMap, existingElementsMap, opts) =>
|
|
|
4740
4786
|
return restoreElementWithProperties(element, {
|
|
4741
4787
|
points: points2,
|
|
4742
4788
|
simulatePressure: element.simulatePressure,
|
|
4789
|
+
strokeOptions: restoreFreedrawStrokeOptions(element.strokeOptions),
|
|
4743
4790
|
pressures
|
|
4744
4791
|
});
|
|
4745
4792
|
}
|
|
@@ -4748,6 +4795,7 @@ var restoreElement = (element, targetElementsMap, existingElementsMap, opts) =>
|
|
|
4748
4795
|
status: element.status || "pending",
|
|
4749
4796
|
fileId: element.fileId,
|
|
4750
4797
|
fileName: element.fileName ?? null,
|
|
4798
|
+
thumbHash: typeof element.thumbHash === "string" ? element.thumbHash : null,
|
|
4751
4799
|
scale: element.scale || [1, 1],
|
|
4752
4800
|
crop: element.crop ?? null
|
|
4753
4801
|
});
|
|
@@ -4770,7 +4818,7 @@ var restoreElement = (element, targetElementsMap, existingElementsMap, opts) =>
|
|
|
4770
4818
|
y: y ?? 0
|
|
4771
4819
|
}));
|
|
4772
4820
|
}
|
|
4773
|
-
|
|
4821
|
+
const restoredLine = restoreElementWithProperties(element, {
|
|
4774
4822
|
type: "line",
|
|
4775
4823
|
startBinding: null,
|
|
4776
4824
|
endBinding: null,
|
|
@@ -4784,6 +4832,7 @@ var restoreElement = (element, targetElementsMap, existingElementsMap, opts) =>
|
|
|
4784
4832
|
} : {},
|
|
4785
4833
|
...getSizeFromPoints(points)
|
|
4786
4834
|
});
|
|
4835
|
+
return handleOversizedLinearElements(restoredLine);
|
|
4787
4836
|
case "arrow": {
|
|
4788
4837
|
const startArrowhead2 = normalizeArrowhead(element.startArrowhead);
|
|
4789
4838
|
const endArrowhead2 = element.endArrowhead === void 0 ? "arrow" : normalizeArrowhead(element.endArrowhead);
|
|
@@ -4837,24 +4886,7 @@ var restoreElement = (element, targetElementsMap, existingElementsMap, opts) =>
|
|
|
4837
4886
|
restoredElement
|
|
4838
4887
|
)
|
|
4839
4888
|
};
|
|
4840
|
-
|
|
4841
|
-
console.error(
|
|
4842
|
-
`Removing extremely large arrow ${normalizedRestoredElement.id} (type: ${isElbowArrow(normalizedRestoredElement) ? "elbow" : "simple"}, width: ${normalizedRestoredElement.width}, height: ${normalizedRestoredElement.height}, x: ${normalizedRestoredElement.x}, y: ${normalizedRestoredElement.y})`
|
|
4843
|
-
);
|
|
4844
|
-
return {
|
|
4845
|
-
...normalizedRestoredElement,
|
|
4846
|
-
x: 0,
|
|
4847
|
-
y: 0,
|
|
4848
|
-
width: 100,
|
|
4849
|
-
height: 100,
|
|
4850
|
-
points: [
|
|
4851
|
-
pointFrom2(0, 0),
|
|
4852
|
-
pointFrom2(100, 100)
|
|
4853
|
-
],
|
|
4854
|
-
isDeleted: true
|
|
4855
|
-
};
|
|
4856
|
-
}
|
|
4857
|
-
return normalizedRestoredElement;
|
|
4889
|
+
return handleOversizedLinearElements(normalizedRestoredElement);
|
|
4858
4890
|
}
|
|
4859
4891
|
case "ellipse":
|
|
4860
4892
|
case "rectangle":
|
|
@@ -5083,6 +5115,9 @@ var restoreAppState = (appState, localAppState) => {
|
|
|
5083
5115
|
if (boxSelectionMode !== void 0) {
|
|
5084
5116
|
nextAppState.boxSelectionMode = boxSelectionMode;
|
|
5085
5117
|
}
|
|
5118
|
+
if (appState.currentItemStrokeWidth !== void 0) {
|
|
5119
|
+
nextAppState.currentItemStrokeWidthKey = getStrokeWidthKey(appState.currentItemStrokeWidth) ?? defaultAppState.currentItemStrokeWidthKey;
|
|
5120
|
+
}
|
|
5086
5121
|
return {
|
|
5087
5122
|
...nextAppState,
|
|
5088
5123
|
cursorButton: localAppState?.cursorButton || "up",
|
|
@@ -5121,7 +5156,7 @@ var parseFileContents = async (blob) => {
|
|
|
5121
5156
|
let contents;
|
|
5122
5157
|
if (blob.type === MIME_TYPES6.png) {
|
|
5123
5158
|
try {
|
|
5124
|
-
return await (await import("./data/image-
|
|
5159
|
+
return await (await import("./data/image-X3JCQEUX.js")).decodePngMetadata(blob);
|
|
5125
5160
|
} catch (error) {
|
|
5126
5161
|
if (error.message === "INVALID") {
|
|
5127
5162
|
throw new ImageSceneDataError(
|
|
@@ -5432,6 +5467,7 @@ export {
|
|
|
5432
5467
|
hasBackground,
|
|
5433
5468
|
hasStrokeWidth,
|
|
5434
5469
|
hasStrokeStyle,
|
|
5470
|
+
hasFreedrawMode,
|
|
5435
5471
|
canHaveArrowheads,
|
|
5436
5472
|
canChangeRoundness,
|
|
5437
5473
|
AbortError,
|
|
@@ -5482,4 +5518,4 @@ export {
|
|
|
5482
5518
|
createFile,
|
|
5483
5519
|
normalizeFile
|
|
5484
5520
|
};
|
|
5485
|
-
//# sourceMappingURL=chunk-
|
|
5521
|
+
//# sourceMappingURL=chunk-FQHULQ5P.js.map
|