@nous-excalidraw/excalidraw 0.18.9-beta.7 → 0.18.9-beta.9
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/dist/dev/{chunk-VZ7WZUQN.js → chunk-C6RN7XA7.js} +30 -19
- package/dist/dev/chunk-C6RN7XA7.js.map +7 -0
- package/dist/dev/{chunk-HID6G2T4.js → chunk-EULCBTW3.js} +2 -2
- package/dist/dev/components/TTDDialog/{CodeMirrorEditor-VZQFI7IY.js → CodeMirrorEditor-JR7WFBKX.js} +2 -2
- package/dist/dev/data/{image-T6BNHCNE.js → image-OLKHXB2P.js} +3 -3
- package/dist/dev/index.js +968 -760
- 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-FRB6K5PH.js → chunk-AAMRX7L3.js} +1 -1
- package/dist/prod/chunk-T62DQDOJ.js +4 -0
- package/dist/prod/components/TTDDialog/{CodeMirrorEditor-RMVTPIYH.js → CodeMirrorEditor-G2V2GRCQ.js} +1 -1
- package/dist/prod/data/image-L6HZNRVO.js +1 -0
- package/dist/prod/index.js +41 -41
- 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 -7
- package/dist/types/common/src/fontSize.d.ts +9 -4
- package/dist/types/common/src/strokeWidth.d.ts +67 -13
- package/dist/types/common/src/zoomDisplay.d.ts +3 -0
- package/dist/types/element/src/bounds.d.ts +2 -2
- package/dist/types/element/src/index.d.ts +1 -0
- package/dist/types/element/src/renderElement.d.ts +1 -0
- package/dist/types/element/src/selection.d.ts +2 -2
- package/dist/types/element/src/shape.d.ts +5 -3
- package/dist/types/element/src/strokeWidth.d.ts +11 -0
- package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +3 -0
- package/dist/types/excalidraw/actions/actionBoundText.d.ts +2 -0
- package/dist/types/excalidraw/actions/actionCanvas.d.ts +47 -25
- package/dist/types/excalidraw/actions/actionClipboard.d.ts +2 -0
- package/dist/types/excalidraw/actions/actionCropEditor.d.ts +1 -0
- package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +4 -1
- package/dist/types/excalidraw/actions/actionDeselect.d.ts +2 -1
- package/dist/types/excalidraw/actions/actionElementLink.d.ts +1 -0
- package/dist/types/excalidraw/actions/actionElementLock.d.ts +2 -0
- package/dist/types/excalidraw/actions/actionEmbeddable.d.ts +1 -0
- package/dist/types/excalidraw/actions/actionExport.d.ts +8 -6
- package/dist/types/excalidraw/actions/actionFrame.d.ts +4 -0
- package/dist/types/excalidraw/actions/actionGroup.d.ts +4 -2
- package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +1 -0
- package/dist/types/excalidraw/actions/actionLink.d.ts +1 -0
- package/dist/types/excalidraw/actions/actionMenu.d.ts +1 -0
- package/dist/types/excalidraw/actions/actionProperties.d.ts +2 -0
- package/dist/types/excalidraw/actions/actionSelectAll.d.ts +2 -1
- package/dist/types/excalidraw/actions/actionStyles.d.ts +1 -0
- package/dist/types/excalidraw/actions/actionToggleArrowBinding.d.ts +1 -0
- package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +1 -0
- package/dist/types/excalidraw/actions/actionToggleMidpointSnapping.d.ts +1 -0
- package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +1 -0
- package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +1 -0
- package/dist/types/excalidraw/actions/actionToggleStats.d.ts +1 -0
- package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +1 -0
- package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +1 -0
- package/dist/types/excalidraw/appState.d.ts +6 -6
- package/dist/types/excalidraw/components/App.d.ts +2 -0
- package/dist/types/excalidraw/data/blob.d.ts +14 -12
- package/dist/types/excalidraw/data/json.d.ts +7 -6
- package/dist/types/excalidraw/scene/types.d.ts +3 -0
- package/dist/types/excalidraw/types.d.ts +2 -0
- package/package.json +4 -4
- package/dist/dev/chunk-VZ7WZUQN.js.map +0 -7
- package/dist/prod/chunk-MGSRJZ2V.js +0 -4
- package/dist/prod/data/image-V7SMJ67N.js +0 -1
- /package/dist/dev/{chunk-HID6G2T4.js.map → chunk-EULCBTW3.js.map} +0 -0
- /package/dist/dev/components/TTDDialog/{CodeMirrorEditor-VZQFI7IY.js.map → CodeMirrorEditor-JR7WFBKX.js.map} +0 -0
- /package/dist/dev/data/{image-T6BNHCNE.js.map → image-OLKHXB2P.js.map} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
define_import_meta_env_default
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-EULCBTW3.js";
|
|
4
4
|
import {
|
|
5
5
|
__publicField
|
|
6
6
|
} from "./chunk-XDFCUUT6.js";
|
|
@@ -33,10 +33,9 @@ import {
|
|
|
33
33
|
THEME,
|
|
34
34
|
DEFAULT_GRID_STEP,
|
|
35
35
|
isTestEnv,
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
getSceneStrokeWidthForZoom
|
|
36
|
+
getDefaultSceneFontSizeForZoom,
|
|
37
|
+
getDefaultSceneStrokeWidth,
|
|
38
|
+
INITIAL_CANVAS_ZOOM
|
|
40
39
|
} from "@nous-excalidraw/common";
|
|
41
40
|
var defaultExportScale = EXPORT_SCALES.includes(devicePixelRatio) ? devicePixelRatio : 1;
|
|
42
41
|
var getDefaultAppState = () => {
|
|
@@ -48,7 +47,7 @@ var getDefaultAppState = () => {
|
|
|
48
47
|
currentItemEndArrowhead: "arrow",
|
|
49
48
|
currentItemFillStyle: DEFAULT_ELEMENT_PROPS.fillStyle,
|
|
50
49
|
currentItemFontFamily: DEFAULT_FONT_FAMILY,
|
|
51
|
-
currentItemFontSize:
|
|
50
|
+
currentItemFontSize: getDefaultSceneFontSizeForZoom(INITIAL_CANVAS_ZOOM),
|
|
52
51
|
currentItemOpacity: DEFAULT_ELEMENT_PROPS.opacity,
|
|
53
52
|
currentItemRoughness: DEFAULT_ELEMENT_PROPS.roughness,
|
|
54
53
|
currentItemStartArrowhead: null,
|
|
@@ -56,10 +55,8 @@ var getDefaultAppState = () => {
|
|
|
56
55
|
currentItemRoundness: isTestEnv() ? "sharp" : "round",
|
|
57
56
|
currentItemArrowType: ARROW_TYPE.round,
|
|
58
57
|
currentItemStrokeStyle: DEFAULT_ELEMENT_PROPS.strokeStyle,
|
|
59
|
-
currentItemStrokeWidth:
|
|
60
|
-
|
|
61
|
-
1
|
|
62
|
-
),
|
|
58
|
+
currentItemStrokeWidth: getDefaultSceneStrokeWidth(INITIAL_CANVAS_ZOOM),
|
|
59
|
+
currentItemStrokeWidthCustom: false,
|
|
63
60
|
currentItemTextAlign: DEFAULT_TEXT_ALIGN,
|
|
64
61
|
currentHoveredFontFamily: null,
|
|
65
62
|
cursorButton: "up",
|
|
@@ -131,7 +128,7 @@ var getDefaultAppState = () => {
|
|
|
131
128
|
viewBackgroundColor: COLOR_PALETTE.white,
|
|
132
129
|
zenModeEnabled: false,
|
|
133
130
|
zoom: {
|
|
134
|
-
value:
|
|
131
|
+
value: INITIAL_CANVAS_ZOOM
|
|
135
132
|
},
|
|
136
133
|
viewModeEnabled: false,
|
|
137
134
|
showHyperlinkPopup: false,
|
|
@@ -178,6 +175,7 @@ var APP_STATE_STORAGE_CONF = /* @__PURE__ */ ((config) => config)({
|
|
|
178
175
|
currentItemStrokeColor: { browser: true, export: false, server: false },
|
|
179
176
|
currentItemStrokeStyle: { browser: true, export: false, server: false },
|
|
180
177
|
currentItemStrokeWidth: { browser: true, export: false, server: false },
|
|
178
|
+
currentItemStrokeWidthCustom: { browser: false, export: false, server: false },
|
|
181
179
|
currentItemTextAlign: { browser: true, export: false, server: false },
|
|
182
180
|
currentHoveredFontFamily: { browser: false, export: false, server: false },
|
|
183
181
|
cursorButton: { browser: true, export: false, server: false },
|
|
@@ -4280,7 +4278,8 @@ var exportToCanvas = async (elements, appState, files, {
|
|
|
4280
4278
|
embedsValidationStatus: /* @__PURE__ */ new Map(),
|
|
4281
4279
|
elementsPendingErasure: /* @__PURE__ */ new Set(),
|
|
4282
4280
|
pendingFlowchartNodes: null,
|
|
4283
|
-
theme: appState.exportWithDarkMode ? THEME5.DARK : THEME5.LIGHT
|
|
4281
|
+
theme: appState.exportWithDarkMode ? THEME5.DARK : THEME5.LIGHT,
|
|
4282
|
+
zoom: defaultAppState.zoom.value
|
|
4284
4283
|
}
|
|
4285
4284
|
});
|
|
4286
4285
|
return canvas;
|
|
@@ -4491,7 +4490,9 @@ import {
|
|
|
4491
4490
|
arrayToMap as arrayToMap2,
|
|
4492
4491
|
getSizeFromPoints,
|
|
4493
4492
|
normalizeLink as normalizeLink2,
|
|
4494
|
-
getLineHeight
|
|
4493
|
+
getLineHeight,
|
|
4494
|
+
getDisplaySceneStrokeWidth,
|
|
4495
|
+
isCustomStrokeWidthOverride
|
|
4495
4496
|
} from "@nous-excalidraw/common";
|
|
4496
4497
|
import {
|
|
4497
4498
|
calculateFixedPointForNonElbowArrowBinding,
|
|
@@ -4499,7 +4500,8 @@ import {
|
|
|
4499
4500
|
normalizeArrowhead,
|
|
4500
4501
|
isPointInElement,
|
|
4501
4502
|
isValidPolygon,
|
|
4502
|
-
projectFixedPointOntoDiagonal
|
|
4503
|
+
projectFixedPointOntoDiagonal,
|
|
4504
|
+
migrateElementStrokeWidthCustom
|
|
4503
4505
|
} from "@nous-excalidraw/element";
|
|
4504
4506
|
import { normalizeFixedPoint } from "@nous-excalidraw/element";
|
|
4505
4507
|
import {
|
|
@@ -4888,6 +4890,7 @@ var restoreElements = (targetElements, existingElements, opts) => {
|
|
|
4888
4890
|
migratedElement = null;
|
|
4889
4891
|
}
|
|
4890
4892
|
if (migratedElement) {
|
|
4893
|
+
migratedElement = migrateElementStrokeWidthCustom(migratedElement);
|
|
4891
4894
|
const localElement = existingElementsMap?.get(element.id);
|
|
4892
4895
|
const shouldMarkAsDeleted = opts?.deleteInvisibleElements && isInvisiblySmallElement(element);
|
|
4893
4896
|
if (shouldMarkAsDeleted) {
|
|
@@ -5028,6 +5031,16 @@ var restoreAppState = (appState, localAppState) => {
|
|
|
5028
5031
|
if (boxSelectionMode !== void 0) {
|
|
5029
5032
|
nextAppState.boxSelectionMode = boxSelectionMode;
|
|
5030
5033
|
}
|
|
5034
|
+
const zoomValue = getNormalizedZoom(
|
|
5035
|
+
isFiniteNumber(appState.zoom) ? appState.zoom : appState.zoom?.value ?? defaultAppState.zoom.value
|
|
5036
|
+
);
|
|
5037
|
+
if (!nextAppState.currentItemStrokeWidthCustom || !isCustomStrokeWidthOverride(
|
|
5038
|
+
true,
|
|
5039
|
+
nextAppState.currentItemStrokeWidth
|
|
5040
|
+
)) {
|
|
5041
|
+
nextAppState.currentItemStrokeWidthCustom = false;
|
|
5042
|
+
nextAppState.currentItemStrokeWidth = getDisplaySceneStrokeWidth(zoomValue);
|
|
5043
|
+
}
|
|
5031
5044
|
return {
|
|
5032
5045
|
...nextAppState,
|
|
5033
5046
|
cursorButton: localAppState?.cursorButton || "up",
|
|
@@ -5043,9 +5056,7 @@ var restoreAppState = (appState, localAppState) => {
|
|
|
5043
5056
|
},
|
|
5044
5057
|
// Migrates from previous version where appState.zoom was a number
|
|
5045
5058
|
zoom: {
|
|
5046
|
-
value:
|
|
5047
|
-
isFiniteNumber(appState.zoom) ? appState.zoom : appState.zoom?.value ?? defaultAppState.zoom.value
|
|
5048
|
-
)
|
|
5059
|
+
value: zoomValue
|
|
5049
5060
|
},
|
|
5050
5061
|
openSidebar: (
|
|
5051
5062
|
// string (legacy)
|
|
@@ -5101,7 +5112,7 @@ var parseFileContents = async (blob) => {
|
|
|
5101
5112
|
let contents;
|
|
5102
5113
|
if (blob.type === MIME_TYPES6.png) {
|
|
5103
5114
|
try {
|
|
5104
|
-
return await (await import("./data/image-
|
|
5115
|
+
return await (await import("./data/image-OLKHXB2P.js")).decodePngMetadata(blob);
|
|
5105
5116
|
} catch (error) {
|
|
5106
5117
|
if (error.message === "INVALID") {
|
|
5107
5118
|
throw new ImageSceneDataError(
|
|
@@ -5535,4 +5546,4 @@ export {
|
|
|
5535
5546
|
createFile,
|
|
5536
5547
|
normalizeFile
|
|
5537
5548
|
};
|
|
5538
|
-
//# sourceMappingURL=chunk-
|
|
5549
|
+
//# sourceMappingURL=chunk-C6RN7XA7.js.map
|