@myoc/excalidraw 0.18.4 → 0.18.6
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-RE5EMAXD.js → chunk-4OALG4EH.js} +2 -2
- package/dist/dev/{chunk-RAK2YFHC.js → chunk-LRA2BMXO.js} +110 -195
- package/dist/dev/chunk-LRA2BMXO.js.map +7 -0
- package/dist/dev/{chunk-6MXLCRC3.js → chunk-YSK5QYKJ.js} +2 -1
- package/dist/dev/chunk-YSK5QYKJ.js.map +7 -0
- package/dist/dev/data/{image-KBZ4SRRJ.js → image-OTIQTZCO.js} +3 -3
- package/dist/dev/index.css +1 -0
- package/dist/dev/index.css.map +2 -2
- package/dist/dev/index.js +1251 -939
- package/dist/dev/index.js.map +4 -4
- package/dist/dev/locales/{en-FBYNI7ML.js → en-IPMKTZRA.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-6NO4X5TH.js → chunk-HYYBIWRU.js} +2 -2
- package/dist/prod/chunk-S7PD52DD.js +33 -0
- package/dist/prod/{chunk-4WWMDLFD.js → chunk-SNPKQ4QJ.js} +1 -1
- package/dist/prod/data/image-TF47GACX.js +1 -0
- package/dist/prod/index.css +1 -1
- package/dist/prod/index.js +16 -16
- package/dist/prod/locales/{en-RF5UZHGV.js → en-3XEBA2ZW.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/utils.d.ts +3 -0
- package/dist/types/element/src/arrange-algorithms/packer.d.ts +30 -0
- package/dist/types/element/src/arrange.d.ts +3 -0
- package/dist/types/element/src/binding.d.ts +1 -2
- package/dist/types/element/src/bounds.d.ts +2 -2
- package/dist/types/element/src/duplicate.d.ts +10 -13
- package/dist/types/element/src/frame.d.ts +1 -1
- package/dist/types/element/src/selection.d.ts +11 -0
- package/dist/types/element/src/types.d.ts +1 -0
- package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +12 -0
- package/dist/types/excalidraw/actions/actionArrange.d.ts +30 -0
- package/dist/types/excalidraw/actions/actionBoundText.d.ts +8 -0
- package/dist/types/excalidraw/actions/actionCanvas.d.ts +48 -0
- package/dist/types/excalidraw/actions/actionClipboard.d.ts +24 -0
- package/dist/types/excalidraw/actions/actionCropEditor.d.ts +4 -0
- package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +12 -0
- package/dist/types/excalidraw/actions/actionElementLink.d.ts +4 -0
- package/dist/types/excalidraw/actions/actionElementLock.d.ts +8 -0
- package/dist/types/excalidraw/actions/actionEmbeddable.d.ts +4 -0
- package/dist/types/excalidraw/actions/actionExport.d.ts +36 -0
- package/dist/types/excalidraw/actions/actionFinalize.d.ts +8 -0
- package/dist/types/excalidraw/actions/actionFrame.d.ts +16 -0
- package/dist/types/excalidraw/actions/actionGroup.d.ts +8 -0
- package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +4 -0
- package/dist/types/excalidraw/actions/actionLink.d.ts +4 -0
- package/dist/types/excalidraw/actions/actionMenu.d.ts +12 -0
- package/dist/types/excalidraw/actions/actionNavigate.d.ts +8 -0
- package/dist/types/excalidraw/actions/actionProperties.d.ts +60 -0
- package/dist/types/excalidraw/actions/actionSelectAll.d.ts +4 -0
- package/dist/types/excalidraw/actions/actionStyles.d.ts +4 -0
- package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +4 -0
- package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +4 -0
- package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +8 -0
- package/dist/types/excalidraw/actions/actionToggleStats.d.ts +4 -0
- package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +4 -0
- package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +4 -0
- package/dist/types/excalidraw/actions/index.d.ts +1 -0
- package/dist/types/excalidraw/actions/shortcuts.d.ts +1 -1
- package/dist/types/excalidraw/actions/types.d.ts +1 -1
- package/dist/types/excalidraw/appState.d.ts +4 -0
- package/dist/types/excalidraw/components/App.d.ts +8 -0
- package/dist/types/excalidraw/components/canvases/InteractiveCanvas.d.ts +1 -0
- package/dist/types/excalidraw/components/icons.d.ts +1 -0
- package/dist/types/excalidraw/data/blob.d.ts +1 -1
- package/dist/types/excalidraw/scene/scrollbars.d.ts +2 -3
- package/dist/types/excalidraw/scene/types.d.ts +2 -0
- package/dist/types/excalidraw/types.d.ts +10 -1
- package/package.json +1 -1
- package/dist/dev/chunk-6MXLCRC3.js.map +0 -7
- package/dist/dev/chunk-RAK2YFHC.js.map +0 -7
- package/dist/prod/chunk-RUGBXGWF.js +0 -33
- package/dist/prod/data/image-X6CIZAGC.js +0 -1
- /package/dist/dev/{chunk-RE5EMAXD.js.map → chunk-4OALG4EH.js.map} +0 -0
- /package/dist/dev/data/{image-KBZ4SRRJ.js.map → image-OTIQTZCO.js.map} +0 -0
- /package/dist/dev/locales/{en-FBYNI7ML.js.map → en-IPMKTZRA.js.map} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// <define:import.meta.env>
|
|
2
|
-
var define_import_meta_env_default = { VITE_APP_BACKEND_V2_GET_URL: "https://json-dev.excalidraw.com/api/v2/", VITE_APP_BACKEND_V2_POST_URL: "https://json-dev.excalidraw.com/api/v2/post/", VITE_APP_LIBRARY_URL: "https://libraries.excalidraw.com", VITE_APP_LIBRARY_BACKEND: "https://us-central1-excalidraw-room-persistence.cloudfunctions.net/libraries", VITE_APP_WS_SERVER_URL: "http://localhost:3002", VITE_APP_PLUS_LP: "https://plus.excalidraw.com", VITE_APP_PLUS_APP: "http://localhost:3000", VITE_APP_AI_BACKEND: "http://localhost:3015", VITE_APP_FIREBASE_CONFIG: '{"apiKey":"AIzaSyCMkxA60XIW8KbqMYL7edC4qT5l4qHX2h8","authDomain":"excalidraw-oss-dev.firebaseapp.com","projectId":"excalidraw-oss-dev","storageBucket":"excalidraw-oss-dev.appspot.com","messagingSenderId":"664559512677","appId":"1:664559512677:web:a385181f2928d328a7aa8c"}', VITE_APP_DEV_DISABLE_LIVE_RELOAD: "", VITE_APP_ENABLE_TRACKING: "true", FAST_REFRESH: "false", VITE_APP_PORT: "3000", VITE_APP_DEBUG_ENABLE_TEXT_CONTAINER_BOUNDING_BOX: "", VITE_APP_COLLAPSE_OVERLAY: "true", VITE_APP_ENABLE_ESLINT: "true", VITE_APP_ENABLE_PWA: "false", VITE_APP_PLUS_EXPORT_PUBLIC_KEY: "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAm2g5T+Rub6Kbf1Mf57t0\n7r2zeHuVg4dla3r5ryXMswtzz6x767octl6oLThn33mQsPSy3GKglFZoCTXJR4ij\nba8SxB04sL/N8eRrKja7TFWjCVtRwTTfyy771NYYNFVJclkxHyE5qw4m27crHF1y\nUNWEjuqNMi/lwAErS9fFa2oJlWyT8U7zzv/5kQREkxZI6y9v0AF3qcbsy2731FnD\ns9ChJvOUW9toIab2gsIdrKW8ZNpu084ZFVKb6LNjvIXI1Se4oMTHeszXzNptzlot\nkdxxjOoaQMAyfljFSot1F1FlU6MQlag7UnFGvFjRHN1JI5q4K+n3a67DX+TMyRqS\nHQIDAQAB", VITE_APP_DISABLE_PREVENT_UNLOAD: "", PKG_NAME: "@myoc/excalidraw", PKG_VERSION: "0.18.
|
|
2
|
+
var define_import_meta_env_default = { VITE_APP_BACKEND_V2_GET_URL: "https://json-dev.excalidraw.com/api/v2/", VITE_APP_BACKEND_V2_POST_URL: "https://json-dev.excalidraw.com/api/v2/post/", VITE_APP_LIBRARY_URL: "https://libraries.excalidraw.com", VITE_APP_LIBRARY_BACKEND: "https://us-central1-excalidraw-room-persistence.cloudfunctions.net/libraries", VITE_APP_WS_SERVER_URL: "http://localhost:3002", VITE_APP_PLUS_LP: "https://plus.excalidraw.com", VITE_APP_PLUS_APP: "http://localhost:3000", VITE_APP_AI_BACKEND: "http://localhost:3015", VITE_APP_FIREBASE_CONFIG: '{"apiKey":"AIzaSyCMkxA60XIW8KbqMYL7edC4qT5l4qHX2h8","authDomain":"excalidraw-oss-dev.firebaseapp.com","projectId":"excalidraw-oss-dev","storageBucket":"excalidraw-oss-dev.appspot.com","messagingSenderId":"664559512677","appId":"1:664559512677:web:a385181f2928d328a7aa8c"}', VITE_APP_DEV_DISABLE_LIVE_RELOAD: "", VITE_APP_ENABLE_TRACKING: "true", FAST_REFRESH: "false", VITE_APP_PORT: "3000", VITE_APP_DEBUG_ENABLE_TEXT_CONTAINER_BOUNDING_BOX: "", VITE_APP_COLLAPSE_OVERLAY: "true", VITE_APP_ENABLE_ESLINT: "true", VITE_APP_ENABLE_PWA: "false", VITE_APP_PLUS_EXPORT_PUBLIC_KEY: "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAm2g5T+Rub6Kbf1Mf57t0\n7r2zeHuVg4dla3r5ryXMswtzz6x767octl6oLThn33mQsPSy3GKglFZoCTXJR4ij\nba8SxB04sL/N8eRrKja7TFWjCVtRwTTfyy771NYYNFVJclkxHyE5qw4m27crHF1y\nUNWEjuqNMi/lwAErS9fFa2oJlWyT8U7zzv/5kQREkxZI6y9v0AF3qcbsy2731FnD\ns9ChJvOUW9toIab2gsIdrKW8ZNpu084ZFVKb6LNjvIXI1Se4oMTHeszXzNptzlot\nkdxxjOoaQMAyfljFSot1F1FlU6MQlag7UnFGvFjRHN1JI5q4K+n3a67DX+TMyRqS\nHQIDAQAB", VITE_APP_DISABLE_PREVENT_UNLOAD: "", PKG_NAME: "@myoc/excalidraw", PKG_VERSION: "0.18.5", DEV: true };
|
|
3
3
|
|
|
4
4
|
export {
|
|
5
5
|
define_import_meta_env_default
|
|
6
6
|
};
|
|
7
|
-
//# sourceMappingURL=chunk-
|
|
7
|
+
//# sourceMappingURL=chunk-4OALG4EH.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
define_import_meta_env_default
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-4OALG4EH.js";
|
|
4
4
|
import {
|
|
5
5
|
__publicField
|
|
6
6
|
} from "./chunk-XDFCUUT6.js";
|
|
@@ -1872,6 +1872,12 @@ var elementCenterPoint = (element, xOffset = 0, yOffset = 0) => {
|
|
|
1872
1872
|
const centerYPoint = y + height / 2 + yOffset;
|
|
1873
1873
|
return pointFrom(centerXPoint, centerYPoint);
|
|
1874
1874
|
};
|
|
1875
|
+
var isReadonlyArray = (value) => {
|
|
1876
|
+
return Array.isArray(value);
|
|
1877
|
+
};
|
|
1878
|
+
var sizeOf = (value) => {
|
|
1879
|
+
return isReadonlyArray(value) ? value.length : value instanceof Map ? value.size : Object.keys(value).length;
|
|
1880
|
+
};
|
|
1875
1881
|
|
|
1876
1882
|
// ../common/src/random.ts
|
|
1877
1883
|
var random = new Random(Date.now());
|
|
@@ -4440,6 +4446,20 @@ var elementLinkIcon = createIcon(
|
|
|
4440
4446
|
] }),
|
|
4441
4447
|
tablerIconProps
|
|
4442
4448
|
);
|
|
4449
|
+
var TableCellsIcon = createIcon(
|
|
4450
|
+
/* @__PURE__ */ jsxs("g", { strokeWidth: "1.25", children: [
|
|
4451
|
+
/* @__PURE__ */ jsx("rect", { x: "4", y: "4", width: "4", height: "4", rx: "1" }),
|
|
4452
|
+
/* @__PURE__ */ jsx("rect", { x: "10", y: "4", width: "4", height: "4", rx: "1" }),
|
|
4453
|
+
/* @__PURE__ */ jsx("rect", { x: "16", y: "4", width: "4", height: "4", rx: "1" }),
|
|
4454
|
+
/* @__PURE__ */ jsx("rect", { x: "4", y: "10", width: "4", height: "4", rx: "1" }),
|
|
4455
|
+
/* @__PURE__ */ jsx("rect", { x: "10", y: "10", width: "4", height: "4", rx: "1" }),
|
|
4456
|
+
/* @__PURE__ */ jsx("rect", { x: "16", y: "10", width: "4", height: "4", rx: "1" }),
|
|
4457
|
+
/* @__PURE__ */ jsx("rect", { x: "4", y: "16", width: "4", height: "4", rx: "1" }),
|
|
4458
|
+
/* @__PURE__ */ jsx("rect", { x: "10", y: "16", width: "4", height: "4", rx: "1" }),
|
|
4459
|
+
/* @__PURE__ */ jsx("rect", { x: "16", y: "16", width: "4", height: "4", rx: "1" })
|
|
4460
|
+
] }),
|
|
4461
|
+
tablerIconProps
|
|
4462
|
+
);
|
|
4443
4463
|
|
|
4444
4464
|
// ../math/src/ellipse.ts
|
|
4445
4465
|
function ellipse(center, halfWidth, halfHeight) {
|
|
@@ -6122,13 +6142,13 @@ var getLinearElementEdgeCoors = (linearElement, startOrEnd, elementsMap) => {
|
|
|
6122
6142
|
)
|
|
6123
6143
|
);
|
|
6124
6144
|
};
|
|
6125
|
-
var fixDuplicatedBindingsAfterDuplication = (
|
|
6126
|
-
for (const
|
|
6127
|
-
if ("boundElements" in
|
|
6128
|
-
Object.assign(
|
|
6129
|
-
boundElements:
|
|
6145
|
+
var fixDuplicatedBindingsAfterDuplication = (duplicatedElements, origIdToDuplicateId, duplicateElementsMap) => {
|
|
6146
|
+
for (const duplicateElement of duplicatedElements) {
|
|
6147
|
+
if ("boundElements" in duplicateElement && duplicateElement.boundElements) {
|
|
6148
|
+
Object.assign(duplicateElement, {
|
|
6149
|
+
boundElements: duplicateElement.boundElements.reduce(
|
|
6130
6150
|
(acc, binding) => {
|
|
6131
|
-
const newBindingId =
|
|
6151
|
+
const newBindingId = origIdToDuplicateId.get(binding.id);
|
|
6132
6152
|
if (newBindingId) {
|
|
6133
6153
|
acc.push({ ...binding, id: newBindingId });
|
|
6134
6154
|
}
|
|
@@ -6138,191 +6158,46 @@ var fixDuplicatedBindingsAfterDuplication = (newElements, oldIdToDuplicatedId, d
|
|
|
6138
6158
|
)
|
|
6139
6159
|
});
|
|
6140
6160
|
}
|
|
6141
|
-
if ("containerId" in
|
|
6142
|
-
Object.assign(
|
|
6143
|
-
containerId:
|
|
6161
|
+
if ("containerId" in duplicateElement && duplicateElement.containerId) {
|
|
6162
|
+
Object.assign(duplicateElement, {
|
|
6163
|
+
containerId: origIdToDuplicateId.get(duplicateElement.containerId) ?? null
|
|
6144
6164
|
});
|
|
6145
6165
|
}
|
|
6146
|
-
if ("endBinding" in
|
|
6147
|
-
const newEndBindingId =
|
|
6148
|
-
|
|
6166
|
+
if ("endBinding" in duplicateElement && duplicateElement.endBinding) {
|
|
6167
|
+
const newEndBindingId = origIdToDuplicateId.get(
|
|
6168
|
+
duplicateElement.endBinding.elementId
|
|
6149
6169
|
);
|
|
6150
|
-
Object.assign(
|
|
6170
|
+
Object.assign(duplicateElement, {
|
|
6151
6171
|
endBinding: newEndBindingId ? {
|
|
6152
|
-
...
|
|
6172
|
+
...duplicateElement.endBinding,
|
|
6153
6173
|
elementId: newEndBindingId
|
|
6154
6174
|
} : null
|
|
6155
6175
|
});
|
|
6156
6176
|
}
|
|
6157
|
-
if ("startBinding" in
|
|
6158
|
-
const newEndBindingId =
|
|
6159
|
-
|
|
6177
|
+
if ("startBinding" in duplicateElement && duplicateElement.startBinding) {
|
|
6178
|
+
const newEndBindingId = origIdToDuplicateId.get(
|
|
6179
|
+
duplicateElement.startBinding.elementId
|
|
6160
6180
|
);
|
|
6161
|
-
Object.assign(
|
|
6181
|
+
Object.assign(duplicateElement, {
|
|
6162
6182
|
startBinding: newEndBindingId ? {
|
|
6163
|
-
...
|
|
6183
|
+
...duplicateElement.startBinding,
|
|
6164
6184
|
elementId: newEndBindingId
|
|
6165
6185
|
} : null
|
|
6166
6186
|
});
|
|
6167
6187
|
}
|
|
6168
|
-
if (isElbowArrow(
|
|
6188
|
+
if (isElbowArrow(duplicateElement)) {
|
|
6169
6189
|
Object.assign(
|
|
6170
|
-
|
|
6171
|
-
updateElbowArrowPoints(
|
|
6190
|
+
duplicateElement,
|
|
6191
|
+
updateElbowArrowPoints(duplicateElement, duplicateElementsMap, {
|
|
6172
6192
|
points: [
|
|
6173
|
-
|
|
6174
|
-
|
|
6193
|
+
duplicateElement.points[0],
|
|
6194
|
+
duplicateElement.points[duplicateElement.points.length - 1]
|
|
6175
6195
|
]
|
|
6176
6196
|
})
|
|
6177
6197
|
);
|
|
6178
6198
|
}
|
|
6179
6199
|
}
|
|
6180
6200
|
};
|
|
6181
|
-
var fixReversedBindingsForBindables = (original, duplicate, originalElements, elementsWithClones, oldIdToDuplicatedId) => {
|
|
6182
|
-
original.boundElements?.forEach((binding, idx) => {
|
|
6183
|
-
if (binding.type !== "arrow") {
|
|
6184
|
-
return;
|
|
6185
|
-
}
|
|
6186
|
-
const oldArrow = elementsWithClones.find((el) => el.id === binding.id);
|
|
6187
|
-
if (!isBindingElement(oldArrow)) {
|
|
6188
|
-
return;
|
|
6189
|
-
}
|
|
6190
|
-
if (originalElements.has(binding.id)) {
|
|
6191
|
-
const newArrowId = oldIdToDuplicatedId.get(binding.id) ?? binding.id;
|
|
6192
|
-
const newArrow = elementsWithClones.find(
|
|
6193
|
-
(el) => el.id === newArrowId
|
|
6194
|
-
);
|
|
6195
|
-
mutateElement(newArrow, {
|
|
6196
|
-
startBinding: oldArrow.startBinding?.elementId === binding.id ? {
|
|
6197
|
-
...oldArrow.startBinding,
|
|
6198
|
-
elementId: duplicate.id
|
|
6199
|
-
} : newArrow.startBinding,
|
|
6200
|
-
endBinding: oldArrow.endBinding?.elementId === binding.id ? {
|
|
6201
|
-
...oldArrow.endBinding,
|
|
6202
|
-
elementId: duplicate.id
|
|
6203
|
-
} : newArrow.endBinding
|
|
6204
|
-
});
|
|
6205
|
-
mutateElement(duplicate, {
|
|
6206
|
-
boundElements: [
|
|
6207
|
-
...(duplicate.boundElements ?? []).filter(
|
|
6208
|
-
(el) => el.id !== binding.id && el.id !== newArrowId
|
|
6209
|
-
),
|
|
6210
|
-
{
|
|
6211
|
-
type: "arrow",
|
|
6212
|
-
id: newArrowId
|
|
6213
|
-
}
|
|
6214
|
-
]
|
|
6215
|
-
});
|
|
6216
|
-
} else {
|
|
6217
|
-
mutateElement(oldArrow, {
|
|
6218
|
-
startBinding: oldArrow.startBinding?.elementId === original.id ? {
|
|
6219
|
-
...oldArrow.startBinding,
|
|
6220
|
-
elementId: duplicate.id
|
|
6221
|
-
} : oldArrow.startBinding,
|
|
6222
|
-
endBinding: oldArrow.endBinding?.elementId === original.id ? {
|
|
6223
|
-
...oldArrow.endBinding,
|
|
6224
|
-
elementId: duplicate.id
|
|
6225
|
-
} : oldArrow.endBinding
|
|
6226
|
-
});
|
|
6227
|
-
mutateElement(duplicate, {
|
|
6228
|
-
boundElements: [
|
|
6229
|
-
...duplicate.boundElements ?? [],
|
|
6230
|
-
{
|
|
6231
|
-
type: "arrow",
|
|
6232
|
-
id: oldArrow.id
|
|
6233
|
-
}
|
|
6234
|
-
]
|
|
6235
|
-
});
|
|
6236
|
-
mutateElement(original, {
|
|
6237
|
-
boundElements: original.boundElements?.filter((_, i) => i !== idx) ?? null
|
|
6238
|
-
});
|
|
6239
|
-
}
|
|
6240
|
-
});
|
|
6241
|
-
};
|
|
6242
|
-
var fixReversedBindingsForArrows = (original, duplicate, originalElements, bindingProp, oldIdToDuplicatedId, elementsWithClones) => {
|
|
6243
|
-
const oldBindableId = original[bindingProp]?.elementId;
|
|
6244
|
-
if (oldBindableId) {
|
|
6245
|
-
if (originalElements.has(oldBindableId)) {
|
|
6246
|
-
const newBindableId = oldIdToDuplicatedId.get(oldBindableId) ?? oldBindableId;
|
|
6247
|
-
const newBindable = elementsWithClones.find(
|
|
6248
|
-
(el) => el.id === newBindableId
|
|
6249
|
-
);
|
|
6250
|
-
mutateElement(duplicate, {
|
|
6251
|
-
[bindingProp]: {
|
|
6252
|
-
...original[bindingProp],
|
|
6253
|
-
elementId: newBindableId
|
|
6254
|
-
}
|
|
6255
|
-
});
|
|
6256
|
-
mutateElement(newBindable, {
|
|
6257
|
-
boundElements: [
|
|
6258
|
-
...(newBindable.boundElements ?? []).filter(
|
|
6259
|
-
(el) => el.id !== original.id && el.id !== duplicate.id
|
|
6260
|
-
),
|
|
6261
|
-
{
|
|
6262
|
-
id: duplicate.id,
|
|
6263
|
-
type: "arrow"
|
|
6264
|
-
}
|
|
6265
|
-
]
|
|
6266
|
-
});
|
|
6267
|
-
} else {
|
|
6268
|
-
const originalBindable = elementsWithClones.find(
|
|
6269
|
-
(el) => el.id === oldBindableId
|
|
6270
|
-
);
|
|
6271
|
-
if (originalBindable) {
|
|
6272
|
-
mutateElement(duplicate, {
|
|
6273
|
-
[bindingProp]: original[bindingProp]
|
|
6274
|
-
});
|
|
6275
|
-
mutateElement(original, {
|
|
6276
|
-
[bindingProp]: null
|
|
6277
|
-
});
|
|
6278
|
-
mutateElement(originalBindable, {
|
|
6279
|
-
boundElements: [
|
|
6280
|
-
...originalBindable.boundElements?.filter(
|
|
6281
|
-
(el) => el.id !== original.id
|
|
6282
|
-
) ?? [],
|
|
6283
|
-
{
|
|
6284
|
-
id: duplicate.id,
|
|
6285
|
-
type: "arrow"
|
|
6286
|
-
}
|
|
6287
|
-
]
|
|
6288
|
-
});
|
|
6289
|
-
}
|
|
6290
|
-
}
|
|
6291
|
-
}
|
|
6292
|
-
};
|
|
6293
|
-
var fixReversedBindings = (originalElements, elementsWithClones, oldIdToDuplicatedId) => {
|
|
6294
|
-
for (const original of originalElements.values()) {
|
|
6295
|
-
const duplicate = elementsWithClones.find(
|
|
6296
|
-
(el) => el.id === oldIdToDuplicatedId.get(original.id)
|
|
6297
|
-
);
|
|
6298
|
-
if (isBindableElement(original) && isBindableElement(duplicate)) {
|
|
6299
|
-
fixReversedBindingsForBindables(
|
|
6300
|
-
original,
|
|
6301
|
-
duplicate,
|
|
6302
|
-
originalElements,
|
|
6303
|
-
elementsWithClones,
|
|
6304
|
-
oldIdToDuplicatedId
|
|
6305
|
-
);
|
|
6306
|
-
} else if (isArrowElement(original) && isArrowElement(duplicate)) {
|
|
6307
|
-
fixReversedBindingsForArrows(
|
|
6308
|
-
original,
|
|
6309
|
-
duplicate,
|
|
6310
|
-
originalElements,
|
|
6311
|
-
"startBinding",
|
|
6312
|
-
oldIdToDuplicatedId,
|
|
6313
|
-
elementsWithClones
|
|
6314
|
-
);
|
|
6315
|
-
fixReversedBindingsForArrows(
|
|
6316
|
-
original,
|
|
6317
|
-
duplicate,
|
|
6318
|
-
originalElements,
|
|
6319
|
-
"endBinding",
|
|
6320
|
-
oldIdToDuplicatedId,
|
|
6321
|
-
elementsWithClones
|
|
6322
|
-
);
|
|
6323
|
-
}
|
|
6324
|
-
}
|
|
6325
|
-
};
|
|
6326
6201
|
var fixBindingsAfterDeletion = (sceneElements, deletedElements) => {
|
|
6327
6202
|
const elements = arrayToMap(sceneElements);
|
|
6328
6203
|
for (const element of deletedElements) {
|
|
@@ -9272,23 +9147,21 @@ var elementsOverlappingBBox = ({
|
|
|
9272
9147
|
};
|
|
9273
9148
|
|
|
9274
9149
|
// ../element/src/frame.ts
|
|
9275
|
-
var bindElementsToFramesAfterDuplication = (nextElements,
|
|
9150
|
+
var bindElementsToFramesAfterDuplication = (nextElements, origElements, origIdToDuplicateId) => {
|
|
9276
9151
|
const nextElementMap = arrayToMap(nextElements);
|
|
9277
|
-
for (const element of
|
|
9152
|
+
for (const element of origElements) {
|
|
9278
9153
|
if (element.frameId) {
|
|
9279
|
-
const nextElementId =
|
|
9280
|
-
const nextFrameId =
|
|
9281
|
-
|
|
9282
|
-
|
|
9283
|
-
|
|
9284
|
-
|
|
9285
|
-
|
|
9286
|
-
|
|
9287
|
-
|
|
9288
|
-
|
|
9289
|
-
|
|
9290
|
-
);
|
|
9291
|
-
}
|
|
9154
|
+
const nextElementId = origIdToDuplicateId.get(element.id);
|
|
9155
|
+
const nextFrameId = origIdToDuplicateId.get(element.frameId);
|
|
9156
|
+
const nextElement = nextElementId && nextElementMap.get(nextElementId);
|
|
9157
|
+
if (nextElement) {
|
|
9158
|
+
mutateElement(
|
|
9159
|
+
nextElement,
|
|
9160
|
+
{
|
|
9161
|
+
frameId: nextFrameId ?? null
|
|
9162
|
+
},
|
|
9163
|
+
false
|
|
9164
|
+
);
|
|
9292
9165
|
}
|
|
9293
9166
|
}
|
|
9294
9167
|
}
|
|
@@ -9898,6 +9771,41 @@ var makeNextSelectedElementIds = (nextSelectedElementIds, prevState) => {
|
|
|
9898
9771
|
}
|
|
9899
9772
|
return nextSelectedElementIds;
|
|
9900
9773
|
};
|
|
9774
|
+
var _getLinearElementEditor = (targetElements) => {
|
|
9775
|
+
const linears = targetElements.filter(isLinearElement);
|
|
9776
|
+
if (linears.length === 1) {
|
|
9777
|
+
const linear = linears[0];
|
|
9778
|
+
const boundElements = linear.boundElements?.map((def) => def.id) ?? [];
|
|
9779
|
+
const onlySingleLinearSelected = targetElements.every(
|
|
9780
|
+
(el) => el.id === linear.id || boundElements.includes(el.id)
|
|
9781
|
+
);
|
|
9782
|
+
if (onlySingleLinearSelected) {
|
|
9783
|
+
return new LinearElementEditor(linear);
|
|
9784
|
+
}
|
|
9785
|
+
}
|
|
9786
|
+
return null;
|
|
9787
|
+
};
|
|
9788
|
+
var getSelectionStateForElements = (targetElements, allElements, appState) => {
|
|
9789
|
+
return {
|
|
9790
|
+
selectedLinearElement: _getLinearElementEditor(targetElements),
|
|
9791
|
+
...selectGroupsForSelectedElements(
|
|
9792
|
+
{
|
|
9793
|
+
editingGroupId: appState.editingGroupId,
|
|
9794
|
+
selectedElementIds: excludeElementsInFramesFromSelection(
|
|
9795
|
+
targetElements
|
|
9796
|
+
).reduce((acc, element) => {
|
|
9797
|
+
if (!isBoundToContainer(element)) {
|
|
9798
|
+
acc[element.id] = true;
|
|
9799
|
+
}
|
|
9800
|
+
return acc;
|
|
9801
|
+
}, {})
|
|
9802
|
+
},
|
|
9803
|
+
allElements,
|
|
9804
|
+
appState,
|
|
9805
|
+
null
|
|
9806
|
+
)
|
|
9807
|
+
};
|
|
9808
|
+
};
|
|
9901
9809
|
|
|
9902
9810
|
// ../element/src/groups.ts
|
|
9903
9811
|
var selectGroup = (groupId, appState, elements) => {
|
|
@@ -10546,10 +10454,7 @@ var _Scene = class _Scene {
|
|
|
10546
10454
|
return didChange;
|
|
10547
10455
|
}
|
|
10548
10456
|
replaceAllElements(nextElements) {
|
|
10549
|
-
const _nextElements = (
|
|
10550
|
-
// ts doesn't like `Array.isArray` of `instanceof Map`
|
|
10551
|
-
nextElements instanceof Array ? nextElements : Array.from(nextElements.values())
|
|
10552
|
-
);
|
|
10457
|
+
const _nextElements = isReadonlyArray(nextElements) ? nextElements : Array.from(nextElements.values());
|
|
10553
10458
|
const nextFrameLikes = [];
|
|
10554
10459
|
validateIndicesThrottled(_nextElements);
|
|
10555
10460
|
this.elements = syncInvalidIndices(_nextElements);
|
|
@@ -14345,7 +14250,7 @@ var getElementBounds = (element, elementsMap) => {
|
|
|
14345
14250
|
return ElementBounds.getBounds(element, elementsMap);
|
|
14346
14251
|
};
|
|
14347
14252
|
var getCommonBounds = (elements, elementsMap) => {
|
|
14348
|
-
if (!elements
|
|
14253
|
+
if (!sizeOf(elements)) {
|
|
14349
14254
|
return [0, 0, 0, 0];
|
|
14350
14255
|
}
|
|
14351
14256
|
let minX = Infinity;
|
|
@@ -14618,6 +14523,10 @@ var getDefaultAppState = () => {
|
|
|
14618
14523
|
showWelcomeScreen: false,
|
|
14619
14524
|
myocSimplifiedMode: true,
|
|
14620
14525
|
hideMainMenus: false,
|
|
14526
|
+
arrangeConfiguration: {
|
|
14527
|
+
gap: 10,
|
|
14528
|
+
algorithm: "bin-packing"
|
|
14529
|
+
},
|
|
14621
14530
|
theme: THEME.LIGHT,
|
|
14622
14531
|
collaborators: /* @__PURE__ */ new Map(),
|
|
14623
14532
|
currentChartType: "bar",
|
|
@@ -14723,6 +14632,7 @@ var APP_STATE_STORAGE_CONF = /* @__PURE__ */ ((config) => config)({
|
|
|
14723
14632
|
myocSimplifiedMode: { browser: true, export: false, server: false },
|
|
14724
14633
|
hideMainMenus: { browser: true, export: false, server: false },
|
|
14725
14634
|
wheelZoomsOnDefault: { browser: true, export: false, server: false },
|
|
14635
|
+
arrangeConfiguration: { browser: true, export: false, server: false },
|
|
14726
14636
|
theme: { browser: true, export: false, server: false },
|
|
14727
14637
|
collaborators: { browser: false, export: false, server: false },
|
|
14728
14638
|
currentChartType: { browser: true, export: false, server: false },
|
|
@@ -20103,7 +20013,7 @@ var parseFileContents = async (blob) => {
|
|
|
20103
20013
|
let contents;
|
|
20104
20014
|
if (blob.type === MIME_TYPES.png) {
|
|
20105
20015
|
try {
|
|
20106
|
-
return await (await import("./data/image-
|
|
20016
|
+
return await (await import("./data/image-OTIQTZCO.js")).decodePngMetadata(blob);
|
|
20107
20017
|
} catch (error) {
|
|
20108
20018
|
if (error.message === "INVALID") {
|
|
20109
20019
|
throw new ImageSceneDataError(
|
|
@@ -20355,9 +20265,13 @@ var ImageURLToFile = async (imageUrl, filename = "") => {
|
|
|
20355
20265
|
throw new Error("Error: unsupported file type", { cause: "UNSUPPORTED" });
|
|
20356
20266
|
};
|
|
20357
20267
|
var getFileFromEvent = async (event) => {
|
|
20358
|
-
const
|
|
20268
|
+
const dataTransferFiles = Array.from(event.dataTransfer.files);
|
|
20359
20269
|
const fileHandle = await getFileHandle(event);
|
|
20360
|
-
|
|
20270
|
+
const files = dataTransferFiles ? await Promise.all(dataTransferFiles.map((file2) => normalizeFile(file2))) : null;
|
|
20271
|
+
return {
|
|
20272
|
+
files,
|
|
20273
|
+
fileHandle
|
|
20274
|
+
};
|
|
20361
20275
|
};
|
|
20362
20276
|
var getFileHandle = async (event) => {
|
|
20363
20277
|
if (nativeFileSystemSupported) {
|
|
@@ -20865,6 +20779,7 @@ export {
|
|
|
20865
20779
|
upIcon,
|
|
20866
20780
|
cropIcon,
|
|
20867
20781
|
elementLinkIcon,
|
|
20782
|
+
TableCellsIcon,
|
|
20868
20783
|
shouldTestInside,
|
|
20869
20784
|
hitElementItself,
|
|
20870
20785
|
hitElementBoundingBox,
|
|
@@ -20920,7 +20835,6 @@ export {
|
|
|
20920
20835
|
bindPointToSnapToElementOutline,
|
|
20921
20836
|
calculateFixedPointForElbowArrowBinding,
|
|
20922
20837
|
fixDuplicatedBindingsAfterDuplication,
|
|
20923
|
-
fixReversedBindings,
|
|
20924
20838
|
fixBindingsAfterDeletion,
|
|
20925
20839
|
maxBindingGap,
|
|
20926
20840
|
bindingProperties,
|
|
@@ -20974,6 +20888,7 @@ export {
|
|
|
20974
20888
|
getSelectedElements,
|
|
20975
20889
|
getTargetElements,
|
|
20976
20890
|
makeNextSelectedElementIds,
|
|
20891
|
+
getSelectionStateForElements,
|
|
20977
20892
|
selectGroup,
|
|
20978
20893
|
selectGroupsForSelectedElements,
|
|
20979
20894
|
isSelectedViaGroup,
|
|
@@ -21112,4 +21027,4 @@ export {
|
|
|
21112
21027
|
createFile,
|
|
21113
21028
|
normalizeFile
|
|
21114
21029
|
};
|
|
21115
|
-
//# sourceMappingURL=chunk-
|
|
21030
|
+
//# sourceMappingURL=chunk-LRA2BMXO.js.map
|