mce 0.11.3 → 0.12.0
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/README.md +1 -1
- package/dist/components/Layers.vue.d.ts +3 -0
- package/dist/components/Toolbelt.vue.d.ts +3 -0
- package/dist/components/shared/LayoutItem.vue.d.ts +8 -2
- package/dist/composables/icons.d.ts +5 -1
- package/dist/index.css +107 -6
- package/dist/index.d.ts +2 -0
- package/dist/index.js +714 -321
- package/dist/locale/en.d.ts +0 -1
- package/dist/mixins/0.config/base.d.ts +10 -0
- package/dist/mixins/2.box.d.ts +1 -1
- package/dist/mixins/scroll.d.ts +18 -0
- package/dist/mixins/zoom.d.ts +16 -0
- package/dist/{mixins/2.export → plugins}/json.d.ts +1 -1
- package/dist/plugins/scroll.d.ts +11 -0
- package/dist/plugins/ui.d.ts +1 -0
- package/dist/plugins/zoom.d.ts +1 -9
- package/dist/typed-plugins.d.ts +4 -2
- package/dist/utils/image.d.ts +0 -1
- package/package.json +2 -2
- package/dist/mixins/2.loader/json.d.ts +0 -2
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ref, computed, watch, markRaw, reactive, warn, shallowRef, onBeforeUnmount, onMounted, inject, provide, defineComponent, createVNode, mergeProps, createElementVNode, toValue, getCurrentInstance, onScopeDispose, createElementBlock, openBlock, Fragment, renderList, unref, normalizeStyle, normalizeClass, readonly, toRef, useId, onDeactivated, onActivated, useAttrs, createBlock, resolveDynamicComponent, useTemplateRef, renderSlot, Teleport, createCommentVNode, mergeModels, useModel, resolveComponent, withCtx, createTextVNode, toDisplayString, createSlots, normalizeProps, guardReactiveProps, withDirectives, vShow, vModelText, nextTick, withModifiers,
|
|
1
|
+
import { ref, computed, watch, markRaw, reactive, warn, shallowRef, onBeforeUnmount, onMounted, inject, provide, defineComponent, createVNode, mergeProps, createElementVNode, toValue, getCurrentInstance, onScopeDispose, createElementBlock, openBlock, Fragment, renderList, unref, normalizeStyle, normalizeClass, readonly, toRef, useId, onDeactivated, onActivated, useAttrs, createBlock, resolveDynamicComponent, useTemplateRef, renderSlot, Teleport, createCommentVNode, mergeModels, useModel, resolveComponent, withCtx, createTextVNode, toDisplayString, createSlots, normalizeProps, guardReactiveProps, onBeforeMount, withDirectives, vShow, vModelText, nextTick, withModifiers, isRef } from "vue";
|
|
2
2
|
import { useFileDialog, useEventListener, isClient, useResizeObserver as useResizeObserver$1, useLocalStorage, onClickOutside, useMouse, useDebounceFn } from "@vueuse/core";
|
|
3
3
|
import { Node as Node$1, Element2D, Timeline, Engine, Camera2D, DrawboardEffect, IN_BROWSER, clamp, assets, TimelineNode, Transform2D, DEG_TO_RAD, render, Animation } from "modern-canvas";
|
|
4
4
|
import { getObjectValueByPath, setObjectValueByPath, Observable, Reactivable, idGenerator, property, normalizeElement, normalizeTextContent } from "modern-idoc";
|
|
@@ -124,6 +124,26 @@ const _0_config_base = defineMixin((editor, options) => {
|
|
|
124
124
|
registerConfig("typographyStrategy", "autoHeight");
|
|
125
125
|
registerConfig("handleShape", "rect");
|
|
126
126
|
registerConfig("localDb", false);
|
|
127
|
+
const screenCenterOffset = { left: 0, top: 0, bottom: 0, right: 0 };
|
|
128
|
+
registerConfig("screenCenterOffset", { ...screenCenterOffset });
|
|
129
|
+
const getScreenCenterOffset = () => {
|
|
130
|
+
const offset2 = {
|
|
131
|
+
...screenCenterOffset,
|
|
132
|
+
...config.value.screenCenterOffset
|
|
133
|
+
};
|
|
134
|
+
if (config.value.scrollbar) {
|
|
135
|
+
offset2.right += 8;
|
|
136
|
+
offset2.bottom += 8;
|
|
137
|
+
}
|
|
138
|
+
if (config.value.ruler) {
|
|
139
|
+
offset2.left += 16;
|
|
140
|
+
offset2.top += 16;
|
|
141
|
+
}
|
|
142
|
+
return offset2;
|
|
143
|
+
};
|
|
144
|
+
Object.assign(editor, {
|
|
145
|
+
getScreenCenterOffset
|
|
146
|
+
});
|
|
127
147
|
return () => {
|
|
128
148
|
const {
|
|
129
149
|
camera,
|
|
@@ -490,7 +510,8 @@ function initYElement(yMap, element = {}, parentId, regenId = false) {
|
|
|
490
510
|
yMap.set("name", normalized.name ?? id);
|
|
491
511
|
yMap.set("childrenIds", yChildrenIds);
|
|
492
512
|
yMap.set("meta", new Y.Map(Object.entries(normalized.meta ?? {})));
|
|
493
|
-
|
|
513
|
+
const inCanvasIs = normalized?.meta?.inCanvasIs;
|
|
514
|
+
if (inCanvasIs === "Element2D" || inCanvasIs === "Lottie2D") {
|
|
494
515
|
yMap.set("style", new Y.Map(Object.entries(normalized.style ?? {})));
|
|
495
516
|
yMap.set("background", new Y.Map(Object.entries(normalized.background ?? {})));
|
|
496
517
|
yMap.set("shape", new Y.Map(Object.entries(normalized.shape ?? {})));
|
|
@@ -1026,7 +1047,6 @@ const en = {
|
|
|
1026
1047
|
"view:timeline": "Timeline",
|
|
1027
1048
|
"view:statusbar": "Statusbar",
|
|
1028
1049
|
"view:frameOutline": "Frame outlines",
|
|
1029
|
-
"zoom": "Zoom",
|
|
1030
1050
|
"zoomIn": "Zoom in",
|
|
1031
1051
|
"zoomOut": "Zoom out",
|
|
1032
1052
|
"zoomTo100": "Zoom to 100%",
|
|
@@ -1256,10 +1276,10 @@ function getImageSizeFromUrl(url, opts = {}) {
|
|
|
1256
1276
|
});
|
|
1257
1277
|
}
|
|
1258
1278
|
const imageMimeTypeExtMap = {
|
|
1279
|
+
// 'image/svg+xml': ['.svg'],
|
|
1259
1280
|
"image/jpeg": [".jpg", ".jpeg"],
|
|
1260
1281
|
"image/png": [".png"],
|
|
1261
1282
|
"image/gif": [".gif"],
|
|
1262
|
-
"image/svg+xml": [".svg"],
|
|
1263
1283
|
"image/tiff": [".tif", ".tiff"],
|
|
1264
1284
|
"image/bmp": [".bmp"],
|
|
1265
1285
|
"image/x-ms-bmp": [".bmp"],
|
|
@@ -1711,8 +1731,8 @@ const _2_box = defineMixin((editor) => {
|
|
|
1711
1731
|
obb.top *= zoom.y;
|
|
1712
1732
|
obb.width *= zoom.x;
|
|
1713
1733
|
obb.height *= zoom.y;
|
|
1714
|
-
obb.left
|
|
1715
|
-
obb.top
|
|
1734
|
+
obb.left -= position.x;
|
|
1735
|
+
obb.top -= position.y;
|
|
1716
1736
|
} else if (inTarget === "frame") {
|
|
1717
1737
|
const first = Array.isArray(node) ? node[0] : node;
|
|
1718
1738
|
if (first instanceof Element2D) {
|
|
@@ -1814,12 +1834,12 @@ const _2_box = defineMixin((editor) => {
|
|
|
1814
1834
|
_aabb.top *= zoom.y;
|
|
1815
1835
|
_aabb.width *= zoom.x;
|
|
1816
1836
|
_aabb.height *= zoom.y;
|
|
1817
|
-
_aabb.left
|
|
1818
|
-
_aabb.top
|
|
1837
|
+
_aabb.left -= position.x;
|
|
1838
|
+
_aabb.top -= position.y;
|
|
1819
1839
|
return _aabb;
|
|
1820
1840
|
}
|
|
1821
1841
|
const rootAabb = computed(() => getAabb(root.value.children));
|
|
1822
|
-
const
|
|
1842
|
+
const selectionAabb = computed(() => getAabb(selection.value));
|
|
1823
1843
|
Object.assign(editor, {
|
|
1824
1844
|
obbToFit,
|
|
1825
1845
|
getObb,
|
|
@@ -1828,7 +1848,7 @@ const _2_box = defineMixin((editor) => {
|
|
|
1828
1848
|
getAabbInDrawboard,
|
|
1829
1849
|
aabbToDrawboardAabb,
|
|
1830
1850
|
rootAabb,
|
|
1831
|
-
|
|
1851
|
+
selectionAabb
|
|
1832
1852
|
});
|
|
1833
1853
|
});
|
|
1834
1854
|
const _2_export = defineMixin((editor) => {
|
|
@@ -1873,69 +1893,6 @@ const _2_export = defineMixin((editor) => {
|
|
|
1873
1893
|
to
|
|
1874
1894
|
});
|
|
1875
1895
|
});
|
|
1876
|
-
const _2_export_json = defineMixin((editor) => {
|
|
1877
|
-
const {
|
|
1878
|
-
registerExporter,
|
|
1879
|
-
getAabb,
|
|
1880
|
-
selection,
|
|
1881
|
-
root,
|
|
1882
|
-
getTimeRange
|
|
1883
|
-
} = editor;
|
|
1884
|
-
registerExporter({
|
|
1885
|
-
name: "json",
|
|
1886
|
-
copyAs: (exported) => JSON.stringify(exported),
|
|
1887
|
-
saveAs: (exported) => new Blob([JSON.stringify(exported)], { type: "application/json" }),
|
|
1888
|
-
handle: (options) => {
|
|
1889
|
-
const {
|
|
1890
|
-
selected = false,
|
|
1891
|
-
scale = 1
|
|
1892
|
-
} = options;
|
|
1893
|
-
let id = idGenerator();
|
|
1894
|
-
let elements = [];
|
|
1895
|
-
if (Array.isArray(selected)) {
|
|
1896
|
-
elements = selected;
|
|
1897
|
-
} else {
|
|
1898
|
-
if (selected === true) {
|
|
1899
|
-
elements = selection.value;
|
|
1900
|
-
}
|
|
1901
|
-
if (elements.length === 0 && root.value) {
|
|
1902
|
-
if (root.value.meta.id) {
|
|
1903
|
-
id = root.value.meta.id;
|
|
1904
|
-
}
|
|
1905
|
-
elements = root.value.children;
|
|
1906
|
-
}
|
|
1907
|
-
}
|
|
1908
|
-
const box = getAabb(elements, "parent");
|
|
1909
|
-
console.log(box);
|
|
1910
|
-
return {
|
|
1911
|
-
id,
|
|
1912
|
-
style: {
|
|
1913
|
-
width: box.width * scale,
|
|
1914
|
-
height: box.height * scale,
|
|
1915
|
-
transformOrigin: "left top",
|
|
1916
|
-
transform: `scale(${scale})`
|
|
1917
|
-
},
|
|
1918
|
-
children: elements.map((el) => {
|
|
1919
|
-
const json = el.toJSON();
|
|
1920
|
-
if (box.left) {
|
|
1921
|
-
json.style.left = (json.style.left ?? 0) - box.left;
|
|
1922
|
-
}
|
|
1923
|
-
if (box.top) {
|
|
1924
|
-
json.style.top = (json.style.top ?? 0) - box.top;
|
|
1925
|
-
}
|
|
1926
|
-
json.meta ??= {};
|
|
1927
|
-
json.meta.inPptIs = "Slide";
|
|
1928
|
-
return json;
|
|
1929
|
-
}),
|
|
1930
|
-
meta: {
|
|
1931
|
-
inPptIs: "Pptx",
|
|
1932
|
-
inCanvasIs: "Element2D",
|
|
1933
|
-
...getTimeRange(elements)
|
|
1934
|
-
}
|
|
1935
|
-
};
|
|
1936
|
-
}
|
|
1937
|
-
});
|
|
1938
|
-
});
|
|
1939
1896
|
const _2_load = defineMixin((editor) => {
|
|
1940
1897
|
const {
|
|
1941
1898
|
state
|
|
@@ -2012,36 +1969,6 @@ const _2_load = defineMixin((editor) => {
|
|
|
2012
1969
|
openFileDialog
|
|
2013
1970
|
});
|
|
2014
1971
|
});
|
|
2015
|
-
const _2_loader_json = defineMixin((editor) => {
|
|
2016
|
-
const {
|
|
2017
|
-
registerLoader
|
|
2018
|
-
} = editor;
|
|
2019
|
-
const RE = /\.json$/i;
|
|
2020
|
-
registerLoader({
|
|
2021
|
-
name: "json",
|
|
2022
|
-
accept: ".json",
|
|
2023
|
-
test: (source) => {
|
|
2024
|
-
if (source instanceof Blob) {
|
|
2025
|
-
if (source.type.startsWith("application/json")) {
|
|
2026
|
-
return true;
|
|
2027
|
-
}
|
|
2028
|
-
}
|
|
2029
|
-
if (source instanceof File) {
|
|
2030
|
-
if (RE.test(source.name)) {
|
|
2031
|
-
return true;
|
|
2032
|
-
}
|
|
2033
|
-
}
|
|
2034
|
-
return false;
|
|
2035
|
-
},
|
|
2036
|
-
load: async (source) => {
|
|
2037
|
-
const json = JSON.parse(await source.text());
|
|
2038
|
-
if ("version" in json && "elements" in json) {
|
|
2039
|
-
console.log(json);
|
|
2040
|
-
}
|
|
2041
|
-
return json;
|
|
2042
|
-
}
|
|
2043
|
-
});
|
|
2044
|
-
});
|
|
2045
1972
|
const _3_view = defineMixin((editor) => {
|
|
2046
1973
|
const {
|
|
2047
1974
|
renderEngine,
|
|
@@ -2609,6 +2536,88 @@ const _4_4_doc = defineMixin((editor, options) => {
|
|
|
2609
2536
|
}
|
|
2610
2537
|
};
|
|
2611
2538
|
});
|
|
2539
|
+
const _scroll$1 = defineMixin((editor) => {
|
|
2540
|
+
const {
|
|
2541
|
+
camera,
|
|
2542
|
+
getAabb,
|
|
2543
|
+
selectionAabb,
|
|
2544
|
+
viewAabb,
|
|
2545
|
+
drawboardAabb,
|
|
2546
|
+
getScreenCenterOffset
|
|
2547
|
+
} = editor;
|
|
2548
|
+
const scrollTo = async (target, options = {}) => {
|
|
2549
|
+
const {
|
|
2550
|
+
behavior,
|
|
2551
|
+
duration = 500
|
|
2552
|
+
} = options;
|
|
2553
|
+
const _camera = camera.value;
|
|
2554
|
+
const screenCenterOffset = getScreenCenterOffset();
|
|
2555
|
+
const offset2 = { x: 0, y: 0 };
|
|
2556
|
+
let position = { x: 0, y: 0 };
|
|
2557
|
+
if (typeof target === "object" && "x" in target && "y" in target) {
|
|
2558
|
+
position.x = target.x;
|
|
2559
|
+
position.y = target.y;
|
|
2560
|
+
} else {
|
|
2561
|
+
let aabb;
|
|
2562
|
+
if (Array.isArray(target)) {
|
|
2563
|
+
aabb = getAabb(target);
|
|
2564
|
+
} else {
|
|
2565
|
+
switch (target) {
|
|
2566
|
+
case "selection":
|
|
2567
|
+
aabb = selectionAabb.value;
|
|
2568
|
+
break;
|
|
2569
|
+
case "root":
|
|
2570
|
+
default:
|
|
2571
|
+
aabb = viewAabb.value;
|
|
2572
|
+
break;
|
|
2573
|
+
}
|
|
2574
|
+
}
|
|
2575
|
+
position = { x: aabb.left + aabb.width / 2, y: aabb.top + aabb.height / 2 };
|
|
2576
|
+
offset2.x -= screenCenterOffset.left;
|
|
2577
|
+
offset2.y -= screenCenterOffset.top;
|
|
2578
|
+
offset2.x -= (drawboardAabb.value.width - screenCenterOffset.left - screenCenterOffset.right) / 2;
|
|
2579
|
+
offset2.y -= (drawboardAabb.value.height - screenCenterOffset.top - screenCenterOffset.bottom) / 2;
|
|
2580
|
+
}
|
|
2581
|
+
position.x *= _camera.zoom.x;
|
|
2582
|
+
position.x += offset2.x;
|
|
2583
|
+
position.y *= _camera.zoom.y;
|
|
2584
|
+
position.y += offset2.y;
|
|
2585
|
+
const oldPosition = { x: _camera.position.x, y: _camera.position.y };
|
|
2586
|
+
switch (behavior) {
|
|
2587
|
+
case "smooth":
|
|
2588
|
+
await new Promise((resolve) => {
|
|
2589
|
+
const positionDistance = {
|
|
2590
|
+
x: position.x - oldPosition.x,
|
|
2591
|
+
y: position.y - oldPosition.y
|
|
2592
|
+
};
|
|
2593
|
+
const startTime = performance.now();
|
|
2594
|
+
function step(now) {
|
|
2595
|
+
const elapsed = now - startTime;
|
|
2596
|
+
const progress = Math.min(elapsed / duration, 1);
|
|
2597
|
+
const ease = progress < 0.5 ? 2 * progress * progress : -1 + (4 - 2 * progress) * progress;
|
|
2598
|
+
_camera.position.set(
|
|
2599
|
+
oldPosition.x + positionDistance.x * ease,
|
|
2600
|
+
oldPosition.y + positionDistance.y * ease
|
|
2601
|
+
);
|
|
2602
|
+
if (elapsed < duration) {
|
|
2603
|
+
requestAnimationFrame(step);
|
|
2604
|
+
} else {
|
|
2605
|
+
resolve();
|
|
2606
|
+
}
|
|
2607
|
+
}
|
|
2608
|
+
requestAnimationFrame(step);
|
|
2609
|
+
});
|
|
2610
|
+
break;
|
|
2611
|
+
case "instant":
|
|
2612
|
+
default:
|
|
2613
|
+
_camera.position.set(position.x, position.y);
|
|
2614
|
+
break;
|
|
2615
|
+
}
|
|
2616
|
+
};
|
|
2617
|
+
Object.assign(editor, {
|
|
2618
|
+
scrollTo
|
|
2619
|
+
});
|
|
2620
|
+
});
|
|
2612
2621
|
const _snapshot = defineMixin((editor) => {
|
|
2613
2622
|
const {
|
|
2614
2623
|
renderEngine,
|
|
@@ -2720,6 +2729,114 @@ const _snapshot = defineMixin((editor) => {
|
|
|
2720
2729
|
});
|
|
2721
2730
|
};
|
|
2722
2731
|
});
|
|
2732
|
+
const _zoom$1 = defineMixin((editor) => {
|
|
2733
|
+
const {
|
|
2734
|
+
camera,
|
|
2735
|
+
drawboardAabb,
|
|
2736
|
+
selectionAabb,
|
|
2737
|
+
viewAabb,
|
|
2738
|
+
getAabb,
|
|
2739
|
+
getScreenCenterOffset
|
|
2740
|
+
} = editor;
|
|
2741
|
+
const zoomTo = async (target, options = {}) => {
|
|
2742
|
+
const {
|
|
2743
|
+
mode = "contain",
|
|
2744
|
+
duration = 500,
|
|
2745
|
+
behavior
|
|
2746
|
+
} = options;
|
|
2747
|
+
let aabb;
|
|
2748
|
+
if (Array.isArray(target)) {
|
|
2749
|
+
aabb = getAabb(target);
|
|
2750
|
+
} else {
|
|
2751
|
+
switch (target) {
|
|
2752
|
+
case "selection":
|
|
2753
|
+
aabb = selectionAabb.value;
|
|
2754
|
+
break;
|
|
2755
|
+
case "root":
|
|
2756
|
+
default:
|
|
2757
|
+
aabb = viewAabb.value;
|
|
2758
|
+
break;
|
|
2759
|
+
}
|
|
2760
|
+
}
|
|
2761
|
+
const offset2 = getScreenCenterOffset();
|
|
2762
|
+
const { width, height } = drawboardAabb.value;
|
|
2763
|
+
const tw = width - (offset2.left + offset2.right);
|
|
2764
|
+
const th = height - (offset2.top + offset2.bottom);
|
|
2765
|
+
const sx = aabb.left;
|
|
2766
|
+
const sy = aabb.top;
|
|
2767
|
+
const sw = aabb.width;
|
|
2768
|
+
const sh = aabb.height;
|
|
2769
|
+
if (!sw || !sh)
|
|
2770
|
+
return;
|
|
2771
|
+
const zw = tw / sw;
|
|
2772
|
+
const zh = th / sh;
|
|
2773
|
+
const _camera = camera.value;
|
|
2774
|
+
let targetZoom;
|
|
2775
|
+
if (typeof target === "number") {
|
|
2776
|
+
targetZoom = target;
|
|
2777
|
+
} else if (mode === "cover") {
|
|
2778
|
+
targetZoom = Math.max(zw, zh);
|
|
2779
|
+
} else {
|
|
2780
|
+
targetZoom = Math.min(zw, zh);
|
|
2781
|
+
}
|
|
2782
|
+
const oldZoom = Math.min(_camera.zoom.x, _camera.zoom.y);
|
|
2783
|
+
const newZoom = Math.min(
|
|
2784
|
+
clamp(targetZoom, _camera.minZoom.x, _camera.maxZoom.x),
|
|
2785
|
+
clamp(targetZoom, _camera.minZoom.y, _camera.maxZoom.y)
|
|
2786
|
+
);
|
|
2787
|
+
let x = offset2.left;
|
|
2788
|
+
let y = offset2.top;
|
|
2789
|
+
if (zw < zh) {
|
|
2790
|
+
y += (th - sh * newZoom) / 2;
|
|
2791
|
+
} else {
|
|
2792
|
+
x += (tw - sw * newZoom) / 2;
|
|
2793
|
+
}
|
|
2794
|
+
const oldPosition = {
|
|
2795
|
+
x: _camera.position.x,
|
|
2796
|
+
y: _camera.position.y
|
|
2797
|
+
};
|
|
2798
|
+
const newPosition = {
|
|
2799
|
+
x: sx * newZoom - x,
|
|
2800
|
+
y: sy * newZoom - y
|
|
2801
|
+
};
|
|
2802
|
+
switch (behavior) {
|
|
2803
|
+
case "smooth":
|
|
2804
|
+
await new Promise((resolve) => {
|
|
2805
|
+
const zoomDistance = newZoom - oldZoom;
|
|
2806
|
+
const positionDistance = {
|
|
2807
|
+
x: newPosition.x - oldPosition.x,
|
|
2808
|
+
y: newPosition.y - oldPosition.y
|
|
2809
|
+
};
|
|
2810
|
+
const startTime = performance.now();
|
|
2811
|
+
function step(now) {
|
|
2812
|
+
const elapsed = now - startTime;
|
|
2813
|
+
const progress = Math.min(elapsed / duration, 1);
|
|
2814
|
+
const ease = progress < 0.5 ? 2 * progress * progress : -1 + (4 - 2 * progress) * progress;
|
|
2815
|
+
_camera.zoom.set(oldZoom + zoomDistance * ease);
|
|
2816
|
+
_camera.position.set(
|
|
2817
|
+
oldPosition.x + positionDistance.x * ease,
|
|
2818
|
+
oldPosition.y + positionDistance.y * ease
|
|
2819
|
+
);
|
|
2820
|
+
if (elapsed < duration) {
|
|
2821
|
+
requestAnimationFrame(step);
|
|
2822
|
+
} else {
|
|
2823
|
+
resolve();
|
|
2824
|
+
}
|
|
2825
|
+
}
|
|
2826
|
+
requestAnimationFrame(step);
|
|
2827
|
+
});
|
|
2828
|
+
break;
|
|
2829
|
+
case "instant":
|
|
2830
|
+
default:
|
|
2831
|
+
_camera.zoom.set(newZoom);
|
|
2832
|
+
_camera.position.set(newPosition.x, newPosition.y);
|
|
2833
|
+
break;
|
|
2834
|
+
}
|
|
2835
|
+
};
|
|
2836
|
+
Object.assign(editor, {
|
|
2837
|
+
zoomTo
|
|
2838
|
+
});
|
|
2839
|
+
});
|
|
2723
2840
|
const mixins = [
|
|
2724
2841
|
_0_command,
|
|
2725
2842
|
_0_config,
|
|
@@ -2734,16 +2851,16 @@ const mixins = [
|
|
|
2734
2851
|
_1_upload,
|
|
2735
2852
|
_2_box,
|
|
2736
2853
|
_2_export,
|
|
2737
|
-
_2_export_json,
|
|
2738
2854
|
_2_load,
|
|
2739
|
-
_2_loader_json,
|
|
2740
2855
|
_3_view,
|
|
2741
2856
|
_4_0_text,
|
|
2742
2857
|
_4_1_lock,
|
|
2743
2858
|
_4_2_element,
|
|
2744
2859
|
_4_3_frame,
|
|
2745
2860
|
_4_4_doc,
|
|
2746
|
-
|
|
2861
|
+
_scroll$1,
|
|
2862
|
+
_snapshot,
|
|
2863
|
+
_zoom$1
|
|
2747
2864
|
];
|
|
2748
2865
|
function defaultCompare(a, b) {
|
|
2749
2866
|
if (a < b) {
|
|
@@ -4386,7 +4503,7 @@ const _gif = definePlugin((editor, options) => {
|
|
|
4386
4503
|
height,
|
|
4387
4504
|
fonts,
|
|
4388
4505
|
keyframes: Array.from({ length: ~~((endTime - startTime) / 100) }, (_, i) => startTime + i * 100),
|
|
4389
|
-
|
|
4506
|
+
onKeyframe: async (data2, { duration, progress }) => {
|
|
4390
4507
|
await encoder.encode({ data: data2, delay: duration });
|
|
4391
4508
|
onProgress?.(progress);
|
|
4392
4509
|
}
|
|
@@ -4602,7 +4719,7 @@ const _image = definePlugin((editor) => {
|
|
|
4602
4719
|
accept: imageExts.join(","),
|
|
4603
4720
|
test: (source) => {
|
|
4604
4721
|
if (source instanceof Blob) {
|
|
4605
|
-
if (source.type.startsWith("image/")) {
|
|
4722
|
+
if (!source.type.startsWith("image/svg+xml") && source.type.startsWith("image/")) {
|
|
4606
4723
|
return true;
|
|
4607
4724
|
}
|
|
4608
4725
|
}
|
|
@@ -4672,6 +4789,97 @@ const _import = definePlugin((editor) => {
|
|
|
4672
4789
|
}
|
|
4673
4790
|
};
|
|
4674
4791
|
});
|
|
4792
|
+
const _json = definePlugin((editor) => {
|
|
4793
|
+
const {
|
|
4794
|
+
getAabb,
|
|
4795
|
+
selection,
|
|
4796
|
+
root,
|
|
4797
|
+
getTimeRange
|
|
4798
|
+
} = editor;
|
|
4799
|
+
const RE = /\.json$/i;
|
|
4800
|
+
return {
|
|
4801
|
+
name: "mce:json",
|
|
4802
|
+
loaders: [
|
|
4803
|
+
{
|
|
4804
|
+
name: "json",
|
|
4805
|
+
accept: ".json",
|
|
4806
|
+
test: (source) => {
|
|
4807
|
+
if (source instanceof Blob) {
|
|
4808
|
+
if (source.type.startsWith("application/json")) {
|
|
4809
|
+
return true;
|
|
4810
|
+
}
|
|
4811
|
+
}
|
|
4812
|
+
if (source instanceof File) {
|
|
4813
|
+
if (RE.test(source.name)) {
|
|
4814
|
+
return true;
|
|
4815
|
+
}
|
|
4816
|
+
}
|
|
4817
|
+
return false;
|
|
4818
|
+
},
|
|
4819
|
+
load: async (source) => {
|
|
4820
|
+
const json = JSON.parse(await source.text());
|
|
4821
|
+
if ("version" in json && "elements" in json) {
|
|
4822
|
+
console.log(json);
|
|
4823
|
+
}
|
|
4824
|
+
return json;
|
|
4825
|
+
}
|
|
4826
|
+
}
|
|
4827
|
+
],
|
|
4828
|
+
exporters: [
|
|
4829
|
+
{
|
|
4830
|
+
name: "json",
|
|
4831
|
+
handle: (options) => {
|
|
4832
|
+
const {
|
|
4833
|
+
selected = false,
|
|
4834
|
+
scale = 1
|
|
4835
|
+
} = options;
|
|
4836
|
+
let id = idGenerator();
|
|
4837
|
+
let elements = [];
|
|
4838
|
+
if (Array.isArray(selected)) {
|
|
4839
|
+
elements = selected;
|
|
4840
|
+
} else {
|
|
4841
|
+
if (selected === true) {
|
|
4842
|
+
elements = selection.value;
|
|
4843
|
+
}
|
|
4844
|
+
if (elements.length === 0 && root.value) {
|
|
4845
|
+
if (root.value.meta.id) {
|
|
4846
|
+
id = root.value.meta.id;
|
|
4847
|
+
}
|
|
4848
|
+
elements = root.value.children;
|
|
4849
|
+
}
|
|
4850
|
+
}
|
|
4851
|
+
const box = getAabb(elements, "parent");
|
|
4852
|
+
return {
|
|
4853
|
+
id,
|
|
4854
|
+
style: {
|
|
4855
|
+
width: box.width * scale,
|
|
4856
|
+
height: box.height * scale,
|
|
4857
|
+
transformOrigin: "left top",
|
|
4858
|
+
transform: `scale(${scale})`
|
|
4859
|
+
},
|
|
4860
|
+
children: elements.map((el) => {
|
|
4861
|
+
const json = el.toJSON();
|
|
4862
|
+
if (box.left) {
|
|
4863
|
+
json.style.left = (json.style.left ?? 0) - box.left;
|
|
4864
|
+
}
|
|
4865
|
+
if (box.top) {
|
|
4866
|
+
json.style.top = (json.style.top ?? 0) - box.top;
|
|
4867
|
+
}
|
|
4868
|
+
json.meta ??= {};
|
|
4869
|
+
json.meta.inPptIs = "Slide";
|
|
4870
|
+
return json;
|
|
4871
|
+
}),
|
|
4872
|
+
meta: {
|
|
4873
|
+
inPptIs: "Pptx",
|
|
4874
|
+
inCanvasIs: "Element2D",
|
|
4875
|
+
...getTimeRange(elements)
|
|
4876
|
+
}
|
|
4877
|
+
};
|
|
4878
|
+
}
|
|
4879
|
+
}
|
|
4880
|
+
]
|
|
4881
|
+
};
|
|
4882
|
+
});
|
|
4675
4883
|
const _layerOrder = definePlugin((editor) => {
|
|
4676
4884
|
const {
|
|
4677
4885
|
selection
|
|
@@ -4825,25 +5033,26 @@ const _menu = definePlugin((editor, options) => {
|
|
|
4825
5033
|
{ key: "open" },
|
|
4826
5034
|
{ type: "divider" },
|
|
4827
5035
|
{ key: "import" },
|
|
4828
|
-
exportMenu.value
|
|
4829
|
-
]
|
|
5036
|
+
exportMenu.value.children.length && exportMenu.value
|
|
5037
|
+
].filter(Boolean)
|
|
4830
5038
|
}));
|
|
4831
5039
|
const historyMenus = computed(() => [
|
|
4832
5040
|
{ key: "undo", disabled: !canUndo.value },
|
|
4833
5041
|
{ key: "redo", disabled: !canRedo.value }
|
|
4834
5042
|
]);
|
|
5043
|
+
const copyAsMenu = computed(() => ({
|
|
5044
|
+
key: "copyAs",
|
|
5045
|
+
disabled: !hasSelected.value,
|
|
5046
|
+
children: [...exporters.value.values()].filter((v) => Boolean(v.copyAs)).map((v) => ({ key: `copyAs:${v.name}` }))
|
|
5047
|
+
}));
|
|
4835
5048
|
const editMenus1 = computed(() => [
|
|
4836
5049
|
{ key: "copy", disabled: !hasSelected.value },
|
|
4837
|
-
|
|
4838
|
-
key: "copyAs",
|
|
4839
|
-
disabled: !hasSelected.value,
|
|
4840
|
-
children: [...exporters.value.values()].filter((v) => Boolean(v.copyAs)).map((v) => ({ key: `copyAs:${v.name}` }))
|
|
4841
|
-
},
|
|
5050
|
+
copyAsMenu.value.children.length && copyAsMenu.value,
|
|
4842
5051
|
{ key: "cut", disabled: !hasSelected.value },
|
|
4843
5052
|
{ key: "paste" },
|
|
4844
5053
|
{ key: "duplicate", disabled: !hasSelected.value },
|
|
4845
5054
|
{ key: "delete", disabled: !hasSelected.value }
|
|
4846
|
-
]);
|
|
5055
|
+
].filter(Boolean));
|
|
4847
5056
|
const selectMenu = computed(() => ({
|
|
4848
5057
|
key: "select",
|
|
4849
5058
|
children: [
|
|
@@ -4864,8 +5073,8 @@ const _menu = definePlugin((editor, options) => {
|
|
|
4864
5073
|
...selectMenu.value.children
|
|
4865
5074
|
]
|
|
4866
5075
|
}));
|
|
4867
|
-
const
|
|
4868
|
-
key: "
|
|
5076
|
+
const zoomViewMenu = computed(() => ({
|
|
5077
|
+
key: "view",
|
|
4869
5078
|
children: [
|
|
4870
5079
|
{ key: "zoomIn" },
|
|
4871
5080
|
{ key: "zoomOut" },
|
|
@@ -4885,7 +5094,7 @@ const _menu = definePlugin((editor, options) => {
|
|
|
4885
5094
|
{ key: "view:statusbar", checked: config.value.statusbar },
|
|
4886
5095
|
{ key: "view:frameOutline", checked: config.value.frameOutline },
|
|
4887
5096
|
{ type: "divider" },
|
|
4888
|
-
...
|
|
5097
|
+
...zoomViewMenu.value.children
|
|
4889
5098
|
]
|
|
4890
5099
|
}));
|
|
4891
5100
|
const objectMenu1 = computed(() => [
|
|
@@ -4961,6 +5170,7 @@ const _menu = definePlugin((editor, options) => {
|
|
|
4961
5170
|
layerOrderMenu.value,
|
|
4962
5171
|
layerPositionMenu.value,
|
|
4963
5172
|
flipMenu.value,
|
|
5173
|
+
zoomViewMenu.value,
|
|
4964
5174
|
{ type: "divider" },
|
|
4965
5175
|
exportMenu.value
|
|
4966
5176
|
];
|
|
@@ -5099,6 +5309,17 @@ const _saveAs = definePlugin((editor) => {
|
|
|
5099
5309
|
]
|
|
5100
5310
|
};
|
|
5101
5311
|
});
|
|
5312
|
+
const _scroll = definePlugin((editor) => {
|
|
5313
|
+
const {
|
|
5314
|
+
scrollTo
|
|
5315
|
+
} = editor;
|
|
5316
|
+
return {
|
|
5317
|
+
name: "mce:scroll",
|
|
5318
|
+
commands: [
|
|
5319
|
+
{ command: "scrollToSelection", handle: (options) => scrollTo("selection", options) }
|
|
5320
|
+
]
|
|
5321
|
+
};
|
|
5322
|
+
});
|
|
5102
5323
|
const _select = definePlugin((editor) => {
|
|
5103
5324
|
const {
|
|
5104
5325
|
selection,
|
|
@@ -5298,85 +5519,23 @@ const _visibility = definePlugin((editor) => {
|
|
|
5298
5519
|
]
|
|
5299
5520
|
};
|
|
5300
5521
|
});
|
|
5301
|
-
const defaultZoomToFitOffset = { left: 0, top: 0, bottom: 0, right: 0 };
|
|
5302
5522
|
const _zoom = definePlugin((editor) => {
|
|
5303
5523
|
const {
|
|
5304
5524
|
camera,
|
|
5305
5525
|
drawboardAabb,
|
|
5306
|
-
|
|
5307
|
-
|
|
5308
|
-
|
|
5309
|
-
registerConfig,
|
|
5310
|
-
selection
|
|
5526
|
+
zoomTo,
|
|
5527
|
+
selection,
|
|
5528
|
+
exec
|
|
5311
5529
|
} = editor;
|
|
5312
|
-
registerConfig("zoomToFitOffset", { ...defaultZoomToFitOffset });
|
|
5313
|
-
function zoomIn() {
|
|
5314
|
-
camera.value.addZoom(0.25);
|
|
5315
|
-
}
|
|
5316
|
-
function zoomOut() {
|
|
5317
|
-
camera.value.addZoom(-0.25);
|
|
5318
|
-
}
|
|
5319
|
-
function zoomTo100() {
|
|
5320
|
-
camera.value.setZoom(1);
|
|
5321
|
-
}
|
|
5322
|
-
function _zoomToFit(mode, selection2 = false) {
|
|
5323
|
-
const targetAabb = selection2 ? currentAabb.value : viewAabb.value;
|
|
5324
|
-
const offset2 = {
|
|
5325
|
-
...defaultZoomToFitOffset,
|
|
5326
|
-
...config.value.zoomToFitOffset
|
|
5327
|
-
};
|
|
5328
|
-
if (config.value.scrollbar) {
|
|
5329
|
-
offset2.right += 8;
|
|
5330
|
-
offset2.bottom += 8;
|
|
5331
|
-
}
|
|
5332
|
-
if (config.value.ruler) {
|
|
5333
|
-
offset2.left += 16;
|
|
5334
|
-
offset2.top += 16;
|
|
5335
|
-
}
|
|
5336
|
-
const tw = drawboardAabb.value.width - (offset2.left + offset2.right);
|
|
5337
|
-
const th = drawboardAabb.value.height - (offset2.top + offset2.bottom);
|
|
5338
|
-
const sx = targetAabb.left;
|
|
5339
|
-
const sy = targetAabb.top;
|
|
5340
|
-
const sw = targetAabb.width;
|
|
5341
|
-
const sh = targetAabb.height;
|
|
5342
|
-
if (sw && sh) {
|
|
5343
|
-
const zw = tw / sw;
|
|
5344
|
-
const zh = th / sh;
|
|
5345
|
-
camera.value.setZoom(
|
|
5346
|
-
mode === "contain" ? Math.min(zw, zh) : Math.max(zw, zh)
|
|
5347
|
-
);
|
|
5348
|
-
const zoom = camera.value.zoom.x;
|
|
5349
|
-
let x = offset2.left;
|
|
5350
|
-
let y = offset2.top;
|
|
5351
|
-
if (zw < zh) {
|
|
5352
|
-
y += (th - sh * zoom) / 2;
|
|
5353
|
-
} else {
|
|
5354
|
-
x += (tw - sw * zoom) / 2;
|
|
5355
|
-
}
|
|
5356
|
-
camera.value.position.set(
|
|
5357
|
-
-sx * zoom + x,
|
|
5358
|
-
-sy * zoom + y
|
|
5359
|
-
);
|
|
5360
|
-
}
|
|
5361
|
-
}
|
|
5362
|
-
function zoomToFit() {
|
|
5363
|
-
_zoomToFit("contain");
|
|
5364
|
-
}
|
|
5365
|
-
function zoomToCover() {
|
|
5366
|
-
_zoomToFit("cover");
|
|
5367
|
-
}
|
|
5368
|
-
function zoomToSelection() {
|
|
5369
|
-
_zoomToFit("contain", true);
|
|
5370
|
-
}
|
|
5371
5530
|
return {
|
|
5372
5531
|
name: "mce:zoom",
|
|
5373
5532
|
commands: [
|
|
5374
|
-
{ command: "zoomIn", handle:
|
|
5375
|
-
{ command: "zoomOut", handle:
|
|
5376
|
-
{ command: "zoomTo100", handle:
|
|
5377
|
-
{ command: "
|
|
5378
|
-
{ command: "
|
|
5379
|
-
{ command: "zoomToSelection", handle:
|
|
5533
|
+
{ command: "zoomIn", handle: () => camera.value.addZoom(0.25) },
|
|
5534
|
+
{ command: "zoomOut", handle: () => camera.value.addZoom(-0.25) },
|
|
5535
|
+
{ command: "zoomTo100", handle: () => camera.value.setZoom(1) },
|
|
5536
|
+
{ command: "zoomToCover", handle: () => zoomTo("root", { mode: "cover" }) },
|
|
5537
|
+
{ command: "zoomToFit", handle: () => zoomTo("root", { mode: "contain" }) },
|
|
5538
|
+
{ command: "zoomToSelection", handle: (options) => zoomTo("selection", options) }
|
|
5380
5539
|
],
|
|
5381
5540
|
hotkeys: [
|
|
5382
5541
|
{ command: "zoomIn", key: "CmdOrCtrl+=" },
|
|
@@ -5386,26 +5545,26 @@ const _zoom = definePlugin((editor) => {
|
|
|
5386
5545
|
{ command: "zoomToSelection", key: "Shift+™" }
|
|
5387
5546
|
],
|
|
5388
5547
|
events: {
|
|
5389
|
-
setDoc: zoomToFit,
|
|
5548
|
+
setDoc: () => exec("zoomToFit"),
|
|
5390
5549
|
setCurrentFrame: () => {
|
|
5391
5550
|
if (selection.value.length) {
|
|
5392
|
-
zoomToSelection
|
|
5551
|
+
exec("zoomToSelection");
|
|
5393
5552
|
} else {
|
|
5394
|
-
zoomToFit
|
|
5553
|
+
exec("zoomToFit");
|
|
5395
5554
|
}
|
|
5396
5555
|
}
|
|
5397
5556
|
},
|
|
5398
5557
|
setup: () => {
|
|
5399
5558
|
const {
|
|
5400
5559
|
drawboardDom,
|
|
5401
|
-
config
|
|
5560
|
+
config
|
|
5402
5561
|
} = editor;
|
|
5403
|
-
watch(() =>
|
|
5562
|
+
watch(() => config.value.viewMode, () => exec("zoomToFit"));
|
|
5404
5563
|
useResizeObserver$1(drawboardDom, (entries) => {
|
|
5405
5564
|
const { left: _left, top: _top, width, height } = entries[0].contentRect;
|
|
5406
5565
|
const { left = _left, top = _top } = drawboardDom.value?.getBoundingClientRect() ?? {};
|
|
5407
5566
|
drawboardAabb.value = { left, top, width, height };
|
|
5408
|
-
zoomToFit
|
|
5567
|
+
exec("zoomToFit");
|
|
5409
5568
|
});
|
|
5410
5569
|
}
|
|
5411
5570
|
};
|
|
@@ -5423,6 +5582,7 @@ const plugins = [
|
|
|
5423
5582
|
_html,
|
|
5424
5583
|
_image,
|
|
5425
5584
|
_import,
|
|
5585
|
+
_json,
|
|
5426
5586
|
_layerOrder,
|
|
5427
5587
|
_layerPosition,
|
|
5428
5588
|
_lock,
|
|
@@ -5431,6 +5591,7 @@ const plugins = [
|
|
|
5431
5591
|
_new,
|
|
5432
5592
|
_open,
|
|
5433
5593
|
_saveAs,
|
|
5594
|
+
_scroll,
|
|
5434
5595
|
_select,
|
|
5435
5596
|
_text,
|
|
5436
5597
|
_ui,
|
|
@@ -5678,10 +5839,19 @@ const aliases = {
|
|
|
5678
5839
|
play: "M8 5.14v14l11-7z",
|
|
5679
5840
|
pause: "M14 19h4V5h-4M6 19h4V5H6z",
|
|
5680
5841
|
gps: "M12 8a4 4 0 0 1 4 4a4 4 0 0 1-4 4a4 4 0 0 1-4-4a4 4 0 0 1 4-4m-8.95 5H1v-2h2.05C3.5 6.83 6.83 3.5 11 3.05V1h2v2.05c4.17.45 7.5 3.78 7.95 7.95H23v2h-2.05c-.45 4.17-3.78 7.5-7.95 7.95V23h-2v-2.05C6.83 20.5 3.5 17.17 3.05 13M12 5a7 7 0 0 0-7 7a7 7 0 0 0 7 7a7 7 0 0 0 7-7a7 7 0 0 0-7-7",
|
|
5681
|
-
|
|
5842
|
+
arrowRight: "M12.6 12L8 7.4L9.4 6l6 6l-6 6L8 16.6z",
|
|
5682
5843
|
mouseLeftClick: "M13 9V1.07A8.01 8.01 0 0 1 19.75 7c.16.64.25 1.31.25 2zm4.66-2c-.48-1.35-1.43-2.5-2.66-3.19V7zM6 15v-2h12v2c0 1.59-.63 3.12-1.76 4.24A5.97 5.97 0 0 1 12 21a5.97 5.97 0 0 1-4.24-1.76A5.97 5.97 0 0 1 6 15m-2 0c0 2.12.84 4.16 2.34 5.66S9.88 23 12 23s4.16-.84 5.66-2.34S20 17.12 20 15v-4H4zm7-6V1.07C7.06 1.56 4 4.92 4 9z",
|
|
5683
5844
|
mouseRightClick: "M13 9V1.07c3.94.49 7 3.85 7 7.93zm-2 0V1.07A8.01 8.01 0 0 0 4.25 7C4.09 7.64 4 8.31 4 9zM6.34 7C6.82 5.65 7.78 4.5 9 3.81V7zM6 15v-2h12v2c0 1.59-.63 3.12-1.76 4.24A5.97 5.97 0 0 1 12 21a5.97 5.97 0 0 1-4.24-1.76A5.97 5.97 0 0 1 6 15m-2 0c0 2.12.84 4.16 2.34 5.66S9.88 23 12 23s4.16-.84 5.66-2.34S20 17.12 20 15v-4H4z",
|
|
5684
|
-
check: "M21 7L9 19l-5.5-5.5l1.41-1.41L9 16.17L19.59 5.59z"
|
|
5845
|
+
check: "M21 7L9 19l-5.5-5.5l1.41-1.41L9 16.17L19.59 5.59z",
|
|
5846
|
+
frame: "M17 9v6H7V9zm2-6h-2v3h2zM7 3H5v3h2zm16 4h-3v2h3zm-4 0H5v10h14zM4 7H1v2h3zm19 8h-3v2h3zM4 15H1v2h3zm15 3h-2v3h2zM7 18H5v3h2z",
|
|
5847
|
+
group: "M10 22q-.825 0-1.412-.587T8 20v-4H4q-.825 0-1.412-.587T2 14V4q0-.825.588-1.412T4 2h10q.825 0 1.413.588T16 4v4h4q.825 0 1.413.588T22 10v10q0 .825-.587 1.413T20 22zm0-2h10V10h-6V4H4v10h6zm2-8",
|
|
5848
|
+
shape: "M8 17.95q.25.025.488.038T9 18t.513-.012t.487-.038V20h10V10h-2.05q.025-.25.038-.488T18 9t-.012-.513T17.95 8H20q.825 0 1.413.588T22 10v10q0 .825-.587 1.413T20 22H10q-.825 0-1.412-.587T8 20zM9 16q-2.925 0-4.962-2.037T2 9t2.038-4.962T9 2t4.963 2.038T16 9t-2.037 4.963T9 16m0-2q2.075 0 3.538-1.463T14 9t-1.463-3.537T9 4T5.463 5.463T4 9t1.463 3.538T9 14m0-5",
|
|
5849
|
+
text: "m18.5 4l1.16 4.35l-.96.26c-.45-.87-.91-1.74-1.44-2.18C16.73 6 16.11 6 15.5 6H13v10.5c0 .5 0 1 .33 1.25c.34.25 1 .25 1.67.25v1H9v-1c.67 0 1.33 0 1.67-.25c.33-.25.33-.75.33-1.25V6H8.5c-.61 0-1.23 0-1.76.43c-.53.44-.99 1.31-1.44 2.18l-.96-.26L5.5 4z",
|
|
5850
|
+
image: "M5 21q-.825 0-1.412-.587T3 19V5q0-.825.588-1.412T5 3h14q.825 0 1.413.588T21 5v14q0 .825-.587 1.413T19 21zm0-2h14V5H5zm1-2h12l-3.75-5l-3 4L9 13zm-1 2V5zm3.5-9q.625 0 1.063-.437T10 8.5t-.437-1.062T8.5 7t-1.062.438T7 8.5t.438 1.063T8.5 10",
|
|
5851
|
+
lock: "M6 22q-.825 0-1.412-.587T4 20V10q0-.825.588-1.412T6 8h1V6q0-2.075 1.463-3.537T12 1t3.538 1.463T17 6v2h1q.825 0 1.413.588T20 10v10q0 .825-.587 1.413T18 22zm0-2h12V10H6zm6-3q.825 0 1.413-.587T14 15t-.587-1.412T12 13t-1.412.588T10 15t.588 1.413T12 17M9 8h6V6q0-1.25-.875-2.125T12 3t-2.125.875T9 6zM6 20V10z",
|
|
5852
|
+
unlock: "M6 8h9V6q0-1.25-.875-2.125T12 3t-2.125.875T9 6H7q0-2.075 1.463-3.537T12 1t3.538 1.463T17 6v2h1q.825 0 1.413.588T20 10v10q0 .825-.587 1.413T18 22H6q-.825 0-1.412-.587T4 20V10q0-.825.588-1.412T6 8m0 12h12V10H6zm6-3q.825 0 1.413-.587T14 15t-.587-1.412T12 13t-1.412.588T10 15t.588 1.413T12 17m-6 3V10z",
|
|
5853
|
+
visible: "M12 16q1.875 0 3.188-1.312T16.5 11.5t-1.312-3.187T12 7T8.813 8.313T7.5 11.5t1.313 3.188T12 16m0-1.8q-1.125 0-1.912-.788T9.3 11.5t.788-1.912T12 8.8t1.913.788t.787 1.912t-.787 1.913T12 14.2m0 4.8q-3.65 0-6.65-2.037T1 11.5q1.35-3.425 4.35-5.462T12 4t6.65 2.038T23 11.5q-1.35 3.425-4.35 5.463T12 19m0-2q2.825 0 5.188-1.487T20.8 11.5q-1.25-2.525-3.613-4.012T12 6T6.813 7.488T3.2 11.5q1.25 2.525 3.613 4.013T12 17",
|
|
5854
|
+
unvisible: "m16.1 13.3l-1.45-1.45q.225-1.175-.675-2.2t-2.325-.8L10.2 7.4q.425-.2.863-.3T12 7q1.875 0 3.188 1.313T16.5 11.5q0 .5-.1.938t-.3.862m3.2 3.15l-1.45-1.4q.95-.725 1.688-1.587T20.8 11.5q-1.25-2.525-3.588-4.012T12 6q-.725 0-1.425.1T9.2 6.4L7.65 4.85q1.025-.425 2.1-.638T12 4q3.775 0 6.725 2.087T23 11.5q-.575 1.475-1.513 2.738T19.3 16.45m.5 6.15l-4.2-4.15q-.875.275-1.762.413T12 19q-3.775 0-6.725-2.087T1 11.5q.525-1.325 1.325-2.463T4.15 7L1.4 4.2l1.4-1.4l18.4 18.4zM5.55 8.4q-.725.65-1.325 1.425T3.2 11.5q1.25 2.525 3.588 4.013T12 17q.5 0 .975-.062t.975-.138l-.9-.95q-.275.075-.525.113T12 16q-1.875 0-3.188-1.312T7.5 11.5q0-.275.038-.525t.112-.525zm4.2 4.2"
|
|
5685
5855
|
};
|
|
5686
5856
|
const svg = {
|
|
5687
5857
|
component: MceSvgIcon
|
|
@@ -5786,13 +5956,13 @@ const defaultHoverStrategy = (context) => {
|
|
|
5786
5956
|
}
|
|
5787
5957
|
return void 0;
|
|
5788
5958
|
};
|
|
5789
|
-
const _hoisted_1$
|
|
5790
|
-
const _sfc_main$
|
|
5959
|
+
const _hoisted_1$h = { class: "mce-auxiliary" };
|
|
5960
|
+
const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
5791
5961
|
__name: "Auxiliary",
|
|
5792
5962
|
setup(__props) {
|
|
5793
5963
|
const { auxiliaryLines } = useEditor();
|
|
5794
5964
|
return (_ctx, _cache) => {
|
|
5795
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
5965
|
+
return openBlock(), createElementBlock("div", _hoisted_1$h, [
|
|
5796
5966
|
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(auxiliaryLines), (item, key) => {
|
|
5797
5967
|
return openBlock(), createElementBlock("div", {
|
|
5798
5968
|
key,
|
|
@@ -6085,7 +6255,7 @@ function createLayout(props) {
|
|
|
6085
6255
|
};
|
|
6086
6256
|
}
|
|
6087
6257
|
const MceMenuSymbol = Symbol.for("MceMenuSymbol");
|
|
6088
|
-
const _sfc_main$
|
|
6258
|
+
const _sfc_main$w = /* @__PURE__ */ defineComponent({
|
|
6089
6259
|
__name: "Icon",
|
|
6090
6260
|
props: {
|
|
6091
6261
|
disabled: Boolean,
|
|
@@ -6110,7 +6280,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
6110
6280
|
};
|
|
6111
6281
|
}
|
|
6112
6282
|
});
|
|
6113
|
-
const _sfc_main$
|
|
6283
|
+
const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
6114
6284
|
...{
|
|
6115
6285
|
inheritAttrs: false
|
|
6116
6286
|
},
|
|
@@ -6222,7 +6392,7 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
|
6222
6392
|
};
|
|
6223
6393
|
}
|
|
6224
6394
|
});
|
|
6225
|
-
const _hoisted_1$
|
|
6395
|
+
const _hoisted_1$g = ["onMouseenter"];
|
|
6226
6396
|
const _hoisted_2$8 = ["onClick"];
|
|
6227
6397
|
const _hoisted_3$7 = {
|
|
6228
6398
|
key: 0,
|
|
@@ -6233,7 +6403,7 @@ const _hoisted_5$3 = {
|
|
|
6233
6403
|
key: 1,
|
|
6234
6404
|
class: "mce-list-item__append"
|
|
6235
6405
|
};
|
|
6236
|
-
const _sfc_main$
|
|
6406
|
+
const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
6237
6407
|
...{
|
|
6238
6408
|
name: "MceMenu"
|
|
6239
6409
|
},
|
|
@@ -6306,7 +6476,7 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
|
6306
6476
|
});
|
|
6307
6477
|
return (_ctx, _cache) => {
|
|
6308
6478
|
const _component_MceMenu = resolveComponent("MceMenu");
|
|
6309
|
-
return openBlock(), createBlock(_sfc_main$
|
|
6479
|
+
return openBlock(), createBlock(_sfc_main$v, {
|
|
6310
6480
|
ref: "overlayTpl",
|
|
6311
6481
|
modelValue: isActive.value,
|
|
6312
6482
|
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => isActive.value = $event),
|
|
@@ -6350,7 +6520,7 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
|
6350
6520
|
onClick: (e) => onClickItem(item, index, e)
|
|
6351
6521
|
}, [
|
|
6352
6522
|
hasPrepend.value ? (openBlock(), createElementBlock("div", _hoisted_3$7, [
|
|
6353
|
-
item.checked ? (openBlock(), createBlock(_sfc_main$
|
|
6523
|
+
item.checked ? (openBlock(), createBlock(_sfc_main$w, {
|
|
6354
6524
|
key: 0,
|
|
6355
6525
|
icon: "$check"
|
|
6356
6526
|
})) : createCommentVNode("", true)
|
|
@@ -6361,10 +6531,10 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
|
6361
6531
|
])
|
|
6362
6532
|
]),
|
|
6363
6533
|
item.children?.length ? (openBlock(), createElementBlock("div", _hoisted_5$3, [
|
|
6364
|
-
createVNode(_sfc_main$
|
|
6534
|
+
createVNode(_sfc_main$w, { icon: "$arrowRight" })
|
|
6365
6535
|
])) : createCommentVNode("", true)
|
|
6366
6536
|
], 10, _hoisted_2$8)
|
|
6367
|
-
], 40, _hoisted_1$
|
|
6537
|
+
], 40, _hoisted_1$g))
|
|
6368
6538
|
], 64);
|
|
6369
6539
|
}), 128)),
|
|
6370
6540
|
opened.value > -1 && __props.items?.[opened.value]?.children?.length ? (openBlock(), createBlock(_component_MceMenu, {
|
|
@@ -6394,12 +6564,12 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
|
6394
6564
|
};
|
|
6395
6565
|
}
|
|
6396
6566
|
});
|
|
6397
|
-
const _hoisted_1$
|
|
6567
|
+
const _hoisted_1$f = { class: "mce-context-menu__title" };
|
|
6398
6568
|
const _hoisted_2$7 = {
|
|
6399
6569
|
key: 0,
|
|
6400
6570
|
class: "mce-context-menu__kbd"
|
|
6401
6571
|
};
|
|
6402
|
-
const _sfc_main$
|
|
6572
|
+
const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
6403
6573
|
__name: "ContextMenu",
|
|
6404
6574
|
props: {
|
|
6405
6575
|
"modelValue": { type: Boolean },
|
|
@@ -6418,11 +6588,19 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
|
6418
6588
|
exec,
|
|
6419
6589
|
getKbd,
|
|
6420
6590
|
t,
|
|
6421
|
-
hotkeys
|
|
6591
|
+
hotkeys,
|
|
6592
|
+
registerCommand,
|
|
6593
|
+
unregisterCommand
|
|
6422
6594
|
} = useEditor();
|
|
6423
6595
|
const model = useModel(__props, "modelValue");
|
|
6424
6596
|
const position = useModel(__props, "position");
|
|
6425
6597
|
const menuRef = useTemplateRef("menuTplRef");
|
|
6598
|
+
onBeforeMount(() => {
|
|
6599
|
+
registerCommand({ command: "openContextMenu", handle: onContextmenu });
|
|
6600
|
+
});
|
|
6601
|
+
onBeforeUnmount(() => {
|
|
6602
|
+
unregisterCommand("openContextMenu");
|
|
6603
|
+
});
|
|
6426
6604
|
function updateLocation() {
|
|
6427
6605
|
menuRef.value?.updateLocation();
|
|
6428
6606
|
}
|
|
@@ -6449,7 +6627,7 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
|
6449
6627
|
updateLocation
|
|
6450
6628
|
});
|
|
6451
6629
|
return (_ctx, _cache) => {
|
|
6452
|
-
return openBlock(), createBlock(_sfc_main$
|
|
6630
|
+
return openBlock(), createBlock(_sfc_main$u, {
|
|
6453
6631
|
ref: "menuTplRef",
|
|
6454
6632
|
modelValue: model.value,
|
|
6455
6633
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => model.value = $event),
|
|
@@ -6464,7 +6642,7 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
|
6464
6642
|
"onClick:item": onClickItem
|
|
6465
6643
|
}, {
|
|
6466
6644
|
title: withCtx(({ item }) => [
|
|
6467
|
-
createElementVNode("span", _hoisted_1$
|
|
6645
|
+
createElementVNode("span", _hoisted_1$f, toDisplayString(unref(t)(item.key)), 1),
|
|
6468
6646
|
unref(hotkeys).has(item.key) ? (openBlock(), createElementBlock("span", _hoisted_2$7, toDisplayString(unref(getKbd)(item.key)), 1)) : createCommentVNode("", true)
|
|
6469
6647
|
]),
|
|
6470
6648
|
_: 1
|
|
@@ -6472,11 +6650,11 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
|
6472
6650
|
};
|
|
6473
6651
|
}
|
|
6474
6652
|
});
|
|
6475
|
-
const _hoisted_1$
|
|
6653
|
+
const _hoisted_1$e = {
|
|
6476
6654
|
key: 0,
|
|
6477
6655
|
class: "mce-drawing__content"
|
|
6478
6656
|
};
|
|
6479
|
-
const _sfc_main$
|
|
6657
|
+
const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
6480
6658
|
__name: "Drawing",
|
|
6481
6659
|
setup(__props) {
|
|
6482
6660
|
const {
|
|
@@ -6506,12 +6684,12 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
|
|
|
6506
6684
|
}),
|
|
6507
6685
|
onMousedown
|
|
6508
6686
|
}, [
|
|
6509
|
-
unref(stateContext)?.content ? (openBlock(), createElementBlock("div", _hoisted_1$
|
|
6687
|
+
unref(stateContext)?.content ? (openBlock(), createElementBlock("div", _hoisted_1$e, toDisplayString(unref(t)(unref(stateContext).content)), 1)) : createCommentVNode("", true)
|
|
6510
6688
|
], 36)) : createCommentVNode("", true);
|
|
6511
6689
|
};
|
|
6512
6690
|
}
|
|
6513
6691
|
});
|
|
6514
|
-
const _sfc_main$
|
|
6692
|
+
const _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
6515
6693
|
__name: "Floatbar",
|
|
6516
6694
|
props: {
|
|
6517
6695
|
...makeMceOverlayProps({
|
|
@@ -6537,7 +6715,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
6537
6715
|
updateLocation
|
|
6538
6716
|
});
|
|
6539
6717
|
return (_ctx, _cache) => {
|
|
6540
|
-
return openBlock(), createBlock(_sfc_main$
|
|
6718
|
+
return openBlock(), createBlock(_sfc_main$v, {
|
|
6541
6719
|
ref: "overlayTpl",
|
|
6542
6720
|
class: "mce-floatbar",
|
|
6543
6721
|
location: props.location,
|
|
@@ -6554,7 +6732,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
6554
6732
|
};
|
|
6555
6733
|
}
|
|
6556
6734
|
});
|
|
6557
|
-
const _sfc_main$
|
|
6735
|
+
const _sfc_main$q = /* @__PURE__ */ defineComponent({
|
|
6558
6736
|
__name: "Frame",
|
|
6559
6737
|
props: {
|
|
6560
6738
|
"modelValue": { required: true },
|
|
@@ -6620,7 +6798,7 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
|
6620
6798
|
};
|
|
6621
6799
|
}
|
|
6622
6800
|
});
|
|
6623
|
-
const _sfc_main$
|
|
6801
|
+
const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
6624
6802
|
__name: "Frames",
|
|
6625
6803
|
setup(__props) {
|
|
6626
6804
|
const {
|
|
@@ -6628,7 +6806,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
6628
6806
|
} = useEditor();
|
|
6629
6807
|
return (_ctx, _cache) => {
|
|
6630
6808
|
return openBlock(true), createElementBlock(Fragment, null, renderList(unref(frames), (frame, key) => {
|
|
6631
|
-
return openBlock(), createBlock(_sfc_main$
|
|
6809
|
+
return openBlock(), createBlock(_sfc_main$q, {
|
|
6632
6810
|
key,
|
|
6633
6811
|
"model-value": frame
|
|
6634
6812
|
}, null, 8, ["model-value"]);
|
|
@@ -6636,36 +6814,36 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
6636
6814
|
};
|
|
6637
6815
|
}
|
|
6638
6816
|
});
|
|
6639
|
-
const _sfc_main$
|
|
6817
|
+
const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
6640
6818
|
__name: "GoBackSelectedArea",
|
|
6641
6819
|
setup(__props) {
|
|
6642
6820
|
const {
|
|
6643
|
-
|
|
6821
|
+
selectionAabb,
|
|
6644
6822
|
drawboardAabb,
|
|
6645
6823
|
aabbToDrawboardAabb,
|
|
6646
|
-
|
|
6647
|
-
|
|
6824
|
+
t,
|
|
6825
|
+
exec
|
|
6648
6826
|
} = useEditor();
|
|
6649
6827
|
const isActive = computed(() => {
|
|
6650
|
-
return
|
|
6828
|
+
return selectionAabb.value.width && selectionAabb.value.height && !isOverlappingAabb(
|
|
6651
6829
|
drawboardAabb.value,
|
|
6652
|
-
aabbToDrawboardAabb(
|
|
6830
|
+
aabbToDrawboardAabb(selectionAabb.value)
|
|
6653
6831
|
);
|
|
6654
6832
|
});
|
|
6655
6833
|
return (_ctx, _cache) => {
|
|
6656
6834
|
return isActive.value ? (openBlock(), createElementBlock("div", {
|
|
6657
6835
|
key: 0,
|
|
6658
6836
|
class: "mce-back-selected-aera",
|
|
6659
|
-
onClick: _cache[0] || (_cache[0] = withModifiers(($event) => unref(exec)("
|
|
6837
|
+
onClick: _cache[0] || (_cache[0] = withModifiers(($event) => unref(exec)("scrollToSelection", { behavior: "smooth" }), ["prevent"]))
|
|
6660
6838
|
}, [
|
|
6661
|
-
createVNode(_sfc_main$
|
|
6839
|
+
createVNode(_sfc_main$w, { icon: "$gps" }),
|
|
6662
6840
|
createElementVNode("span", null, toDisplayString(unref(t)("goBackSelectedArea")), 1)
|
|
6663
6841
|
])) : createCommentVNode("", true);
|
|
6664
6842
|
};
|
|
6665
6843
|
}
|
|
6666
6844
|
});
|
|
6667
|
-
const _hoisted_1$
|
|
6668
|
-
const _sfc_main$
|
|
6845
|
+
const _hoisted_1$d = ["data-name"];
|
|
6846
|
+
const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
6669
6847
|
__name: "Hover",
|
|
6670
6848
|
setup(__props) {
|
|
6671
6849
|
const {
|
|
@@ -6683,11 +6861,11 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
|
6683
6861
|
borderColor: "currentcolor",
|
|
6684
6862
|
...unref(boundingBoxToStyle)(hoverElementObb.value)
|
|
6685
6863
|
})
|
|
6686
|
-
}, null, 12, _hoisted_1$
|
|
6864
|
+
}, null, 12, _hoisted_1$d)) : createCommentVNode("", true);
|
|
6687
6865
|
};
|
|
6688
6866
|
}
|
|
6689
6867
|
});
|
|
6690
|
-
const _sfc_main$
|
|
6868
|
+
const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
6691
6869
|
__name: "Tooltip",
|
|
6692
6870
|
props: /* @__PURE__ */ mergeModels({
|
|
6693
6871
|
...makeMceOverlayProps({
|
|
@@ -6710,7 +6888,7 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
|
6710
6888
|
updateLocation
|
|
6711
6889
|
});
|
|
6712
6890
|
return (_ctx, _cache) => {
|
|
6713
|
-
return openBlock(), createBlock(_sfc_main$
|
|
6891
|
+
return openBlock(), createBlock(_sfc_main$v, {
|
|
6714
6892
|
ref: "overlayTpl",
|
|
6715
6893
|
modelValue: isActive.value,
|
|
6716
6894
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isActive.value = $event),
|
|
@@ -6736,10 +6914,10 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
|
6736
6914
|
};
|
|
6737
6915
|
}
|
|
6738
6916
|
});
|
|
6739
|
-
const _hoisted_1$
|
|
6917
|
+
const _hoisted_1$c = ["width", "height"];
|
|
6740
6918
|
const _hoisted_2$6 = ["onDblclick", "onMousedown", "onMousemove"];
|
|
6741
6919
|
const _hoisted_3$6 = { style: { "font-size": "12px", "text-wrap": "nowrap" } };
|
|
6742
|
-
const _sfc_main$
|
|
6920
|
+
const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
6743
6921
|
...{
|
|
6744
6922
|
inheritAttrs: false
|
|
6745
6923
|
},
|
|
@@ -6824,7 +7002,7 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
6824
7002
|
return niceFraction * 10 ** exponent;
|
|
6825
7003
|
});
|
|
6826
7004
|
const start = computed(() => {
|
|
6827
|
-
const value =
|
|
7005
|
+
const value = props.position / props.zoom;
|
|
6828
7006
|
return Math.floor(value / unit.value) * unit.value;
|
|
6829
7007
|
});
|
|
6830
7008
|
const end = computed(() => {
|
|
@@ -6833,10 +7011,10 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
6833
7011
|
return start.value + Math.ceil(value / unit.value) * unit.value;
|
|
6834
7012
|
});
|
|
6835
7013
|
function numToPx(num) {
|
|
6836
|
-
return Math.round(num * props.zoom
|
|
7014
|
+
return Math.round(num * props.zoom - props.position);
|
|
6837
7015
|
}
|
|
6838
7016
|
function pxToNum(px) {
|
|
6839
|
-
return Math.round((px
|
|
7017
|
+
return Math.round((px + props.position) / props.zoom);
|
|
6840
7018
|
}
|
|
6841
7019
|
function render2() {
|
|
6842
7020
|
const cvs = canvas.value;
|
|
@@ -6995,7 +7173,7 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
6995
7173
|
class: "mce-ruler__canvas",
|
|
6996
7174
|
width: props.size,
|
|
6997
7175
|
height: props.size
|
|
6998
|
-
}, null, 8, _hoisted_1$
|
|
7176
|
+
}, null, 8, _hoisted_1$c)
|
|
6999
7177
|
], 16)), [
|
|
7000
7178
|
[unref(vResizeObserver), unref(resize)]
|
|
7001
7179
|
]),
|
|
@@ -7019,7 +7197,7 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
7019
7197
|
onMouseleave: onLeave
|
|
7020
7198
|
}, null, 46, _hoisted_2$6);
|
|
7021
7199
|
}), 128)),
|
|
7022
|
-
createVNode(_sfc_main$
|
|
7200
|
+
createVNode(_sfc_main$m, {
|
|
7023
7201
|
"model-value": !!tipText.value,
|
|
7024
7202
|
target: tipPos.value,
|
|
7025
7203
|
offset: 24
|
|
@@ -7033,8 +7211,8 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
7033
7211
|
};
|
|
7034
7212
|
}
|
|
7035
7213
|
});
|
|
7036
|
-
const _hoisted_1$
|
|
7037
|
-
const _sfc_main$
|
|
7214
|
+
const _hoisted_1$b = { class: "mce-rulers" };
|
|
7215
|
+
const _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
7038
7216
|
...{
|
|
7039
7217
|
inheritAttrs: false
|
|
7040
7218
|
},
|
|
@@ -7047,8 +7225,8 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
7047
7225
|
} = useEditor();
|
|
7048
7226
|
const activeAabb = computed(() => getAabbInDrawboard(selection.value));
|
|
7049
7227
|
return (_ctx, _cache) => {
|
|
7050
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
7051
|
-
createVNode(_sfc_main$
|
|
7228
|
+
return openBlock(), createElementBlock("div", _hoisted_1$b, [
|
|
7229
|
+
createVNode(_sfc_main$l, {
|
|
7052
7230
|
refline: "",
|
|
7053
7231
|
zoom: unref(camera).zoom.x,
|
|
7054
7232
|
position: unref(camera).position.x,
|
|
@@ -7056,7 +7234,7 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
7056
7234
|
axis: "",
|
|
7057
7235
|
size: 16
|
|
7058
7236
|
}, null, 8, ["zoom", "position", "selected"]),
|
|
7059
|
-
createVNode(_sfc_main$
|
|
7237
|
+
createVNode(_sfc_main$l, {
|
|
7060
7238
|
refline: "",
|
|
7061
7239
|
zoom: unref(camera).zoom.y,
|
|
7062
7240
|
position: unref(camera).position.y,
|
|
@@ -7070,13 +7248,13 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
7070
7248
|
};
|
|
7071
7249
|
}
|
|
7072
7250
|
});
|
|
7073
|
-
const _hoisted_1$
|
|
7251
|
+
const _hoisted_1$a = {
|
|
7074
7252
|
ref: "trackTplRef",
|
|
7075
7253
|
class: "mce-scrollbar__track"
|
|
7076
7254
|
};
|
|
7077
7255
|
const AMOUNT_STEP = 50;
|
|
7078
7256
|
const AMOUNT_REPEAR_DELAY = 50;
|
|
7079
|
-
const _sfc_main$
|
|
7257
|
+
const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
7080
7258
|
__name: "Scrollbar",
|
|
7081
7259
|
props: /* @__PURE__ */ mergeModels({
|
|
7082
7260
|
zoom: {},
|
|
@@ -7166,7 +7344,7 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
7166
7344
|
[props.vertical ? "top" : "left"]: `${props.offset}px`
|
|
7167
7345
|
})
|
|
7168
7346
|
}, [
|
|
7169
|
-
createElementVNode("div", _hoisted_1$
|
|
7347
|
+
createElementVNode("div", _hoisted_1$a, [
|
|
7170
7348
|
withDirectives(createElementVNode("div", {
|
|
7171
7349
|
ref: "thumbTplRef",
|
|
7172
7350
|
class: normalizeClass(["mce-scrollbar__thumb", {
|
|
@@ -7189,7 +7367,7 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
7189
7367
|
};
|
|
7190
7368
|
}
|
|
7191
7369
|
});
|
|
7192
|
-
const _sfc_main$
|
|
7370
|
+
const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
7193
7371
|
...{
|
|
7194
7372
|
inheritAttrs: false
|
|
7195
7373
|
},
|
|
@@ -7207,14 +7385,14 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
7207
7385
|
} = useEditor();
|
|
7208
7386
|
return (_ctx, _cache) => {
|
|
7209
7387
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
7210
|
-
createVNode(_sfc_main$
|
|
7388
|
+
createVNode(_sfc_main$j, mergeProps(props, {
|
|
7211
7389
|
modelValue: unref(camera).position.y,
|
|
7212
7390
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => unref(camera).position.y = $event),
|
|
7213
7391
|
zoom: unref(camera).zoom.y,
|
|
7214
7392
|
vertical: "",
|
|
7215
7393
|
length: unref(viewAabb).height
|
|
7216
7394
|
}), null, 16, ["modelValue", "zoom", "length"]),
|
|
7217
|
-
createVNode(_sfc_main$
|
|
7395
|
+
createVNode(_sfc_main$j, mergeProps(props, {
|
|
7218
7396
|
modelValue: unref(camera).position.x,
|
|
7219
7397
|
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => unref(camera).position.x = $event),
|
|
7220
7398
|
zoom: unref(camera).zoom.x,
|
|
@@ -7224,7 +7402,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
7224
7402
|
};
|
|
7225
7403
|
}
|
|
7226
7404
|
});
|
|
7227
|
-
const _hoisted_1$
|
|
7405
|
+
const _hoisted_1$9 = { class: "mce-transformable__svg" };
|
|
7228
7406
|
const _hoisted_2$5 = { "pointer-events": "all" };
|
|
7229
7407
|
const _hoisted_3$5 = ["x", "y", "width", "height", "aria-label", "fill"];
|
|
7230
7408
|
const _hoisted_4$3 = ["cx", "cy", "r", "aria-label", "fill"];
|
|
@@ -7233,7 +7411,7 @@ const _hoisted_6$2 = {
|
|
|
7233
7411
|
key: 0,
|
|
7234
7412
|
class: "mce-transformable__tip"
|
|
7235
7413
|
};
|
|
7236
|
-
const _sfc_main$
|
|
7414
|
+
const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
7237
7415
|
__name: "Transformable",
|
|
7238
7416
|
props: {
|
|
7239
7417
|
tag: { default: "div" },
|
|
@@ -7606,7 +7784,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
7606
7784
|
},
|
|
7607
7785
|
start
|
|
7608
7786
|
}),
|
|
7609
|
-
(openBlock(), createElementBlock("svg", _hoisted_1$
|
|
7787
|
+
(openBlock(), createElementBlock("svg", _hoisted_1$9, [
|
|
7610
7788
|
createElementVNode("rect", {
|
|
7611
7789
|
width: "100%",
|
|
7612
7790
|
height: "100%",
|
|
@@ -7682,7 +7860,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
7682
7860
|
};
|
|
7683
7861
|
}
|
|
7684
7862
|
});
|
|
7685
|
-
const _sfc_main$
|
|
7863
|
+
const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
7686
7864
|
...{
|
|
7687
7865
|
inheritAttrs: false
|
|
7688
7866
|
},
|
|
@@ -7821,7 +7999,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
7821
7999
|
})
|
|
7822
8000
|
}, null, 4);
|
|
7823
8001
|
}), 128)),
|
|
7824
|
-
selectionObb.value.width && selectionObb.value.height ? (openBlock(), createBlock(_sfc_main$
|
|
8002
|
+
selectionObb.value.width && selectionObb.value.height ? (openBlock(), createBlock(_sfc_main$h, {
|
|
7825
8003
|
key: 1,
|
|
7826
8004
|
ref: "transformableRef",
|
|
7827
8005
|
modelValue: selectionObb.value,
|
|
@@ -7854,7 +8032,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
7854
8032
|
};
|
|
7855
8033
|
}
|
|
7856
8034
|
});
|
|
7857
|
-
const _sfc_main$
|
|
8035
|
+
const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
7858
8036
|
__name: "Setup",
|
|
7859
8037
|
setup(__props) {
|
|
7860
8038
|
useEditor().setup();
|
|
@@ -7863,7 +8041,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
7863
8041
|
};
|
|
7864
8042
|
}
|
|
7865
8043
|
});
|
|
7866
|
-
const _sfc_main$
|
|
8044
|
+
const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
7867
8045
|
__name: "Layout",
|
|
7868
8046
|
props: {
|
|
7869
8047
|
...makeLayoutProps()
|
|
@@ -7892,7 +8070,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
7892
8070
|
};
|
|
7893
8071
|
}
|
|
7894
8072
|
});
|
|
7895
|
-
const _sfc_main$
|
|
8073
|
+
const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
7896
8074
|
__name: "LayoutItem",
|
|
7897
8075
|
props: {
|
|
7898
8076
|
position: {
|
|
@@ -7903,7 +8081,10 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
7903
8081
|
type: [Number, String],
|
|
7904
8082
|
default: 300
|
|
7905
8083
|
},
|
|
7906
|
-
modelValue:
|
|
8084
|
+
modelValue: {
|
|
8085
|
+
type: Boolean,
|
|
8086
|
+
default: true
|
|
8087
|
+
},
|
|
7907
8088
|
...makeLayoutItemProps()
|
|
7908
8089
|
},
|
|
7909
8090
|
setup(__props) {
|
|
@@ -7929,11 +8110,11 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
7929
8110
|
};
|
|
7930
8111
|
}
|
|
7931
8112
|
});
|
|
7932
|
-
const _hoisted_1$
|
|
8113
|
+
const _hoisted_1$8 = {
|
|
7933
8114
|
key: 0,
|
|
7934
8115
|
class: "mce-main__scroller"
|
|
7935
8116
|
};
|
|
7936
|
-
const _sfc_main$
|
|
8117
|
+
const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
7937
8118
|
__name: "Main",
|
|
7938
8119
|
props: {
|
|
7939
8120
|
scrollable: Boolean
|
|
@@ -7948,14 +8129,14 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
7948
8129
|
]]),
|
|
7949
8130
|
style: normalizeStyle([unref(mainStyles)])
|
|
7950
8131
|
}, [
|
|
7951
|
-
props.scrollable ? (openBlock(), createElementBlock("div", _hoisted_1$
|
|
8132
|
+
props.scrollable ? (openBlock(), createElementBlock("div", _hoisted_1$8, [
|
|
7952
8133
|
renderSlot(_ctx.$slots, "default")
|
|
7953
8134
|
])) : renderSlot(_ctx.$slots, "default", { key: 1 })
|
|
7954
8135
|
], 6);
|
|
7955
8136
|
};
|
|
7956
8137
|
}
|
|
7957
8138
|
});
|
|
7958
|
-
const _hoisted_1$
|
|
8139
|
+
const _hoisted_1$7 = { class: "progress-indicator" };
|
|
7959
8140
|
const _hoisted_2$4 = {
|
|
7960
8141
|
key: 0,
|
|
7961
8142
|
class: "progress-indicator__status"
|
|
@@ -7965,7 +8146,7 @@ const _hoisted_4$2 = {
|
|
|
7965
8146
|
key: 1,
|
|
7966
8147
|
class: "progress-indicator__bar-indeterminate"
|
|
7967
8148
|
};
|
|
7968
|
-
const _sfc_main$
|
|
8149
|
+
const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
7969
8150
|
__name: "ProgressIndicator",
|
|
7970
8151
|
props: /* @__PURE__ */ mergeModels({
|
|
7971
8152
|
label: {},
|
|
@@ -7978,7 +8159,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
7978
8159
|
setup(__props) {
|
|
7979
8160
|
const progress = useModel(__props, "modelValue");
|
|
7980
8161
|
return (_ctx, _cache) => {
|
|
7981
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
8162
|
+
return openBlock(), createElementBlock("div", _hoisted_1$7, [
|
|
7982
8163
|
__props.label ? (openBlock(), createElementBlock("span", _hoisted_2$4, toDisplayString(__props.label), 1)) : createCommentVNode("", true),
|
|
7983
8164
|
createElementVNode("div", _hoisted_3$4, [
|
|
7984
8165
|
!__props.indeterminate ? (openBlock(), createElementBlock("div", {
|
|
@@ -7998,8 +8179,8 @@ const _export_sfc = (sfc, props) => {
|
|
|
7998
8179
|
}
|
|
7999
8180
|
return target;
|
|
8000
8181
|
};
|
|
8001
|
-
const ProgressIndicator = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
8002
|
-
const _hoisted_1$
|
|
8182
|
+
const ProgressIndicator = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__scopeId", "data-v-c4234331"]]);
|
|
8183
|
+
const _hoisted_1$6 = { class: "mce-statusbar" };
|
|
8003
8184
|
const _hoisted_2$3 = { class: "mce-statusbar__main" };
|
|
8004
8185
|
const _hoisted_3$3 = { class: "mce-statusbar__item" };
|
|
8005
8186
|
const _hoisted_4$1 = { class: "mce-statusbar__kbd" };
|
|
@@ -8020,7 +8201,7 @@ const _hoisted_18 = { class: "mce-statusbar__item" };
|
|
|
8020
8201
|
const _hoisted_19 = { class: "mce-statusbar__kbd" };
|
|
8021
8202
|
const _hoisted_20 = { class: "mce-statusbar__item" };
|
|
8022
8203
|
const _hoisted_21 = { class: "mce-statusbar__progress" };
|
|
8023
|
-
const _sfc_main$
|
|
8204
|
+
const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
8024
8205
|
__name: "Statusbar",
|
|
8025
8206
|
setup(__props) {
|
|
8026
8207
|
const {
|
|
@@ -8031,7 +8212,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
8031
8212
|
exportProgress
|
|
8032
8213
|
} = useEditor();
|
|
8033
8214
|
return (_ctx, _cache) => {
|
|
8034
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
8215
|
+
return openBlock(), createElementBlock("div", _hoisted_1$6, [
|
|
8035
8216
|
createElementVNode("div", _hoisted_2$3, [
|
|
8036
8217
|
unref(state) === "typing" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
8037
8218
|
createElementVNode("div", _hoisted_3$3, [
|
|
@@ -8045,7 +8226,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
8045
8226
|
])
|
|
8046
8227
|
], 64)) : unref(state) === "transforming" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
8047
8228
|
createElementVNode("div", _hoisted_8, [
|
|
8048
|
-
createVNode(_sfc_main$
|
|
8229
|
+
createVNode(_sfc_main$w, { icon: "$mouseRightClick" })
|
|
8049
8230
|
]),
|
|
8050
8231
|
_cache[2] || (_cache[2] = createElementVNode("span", null, " / ", -1)),
|
|
8051
8232
|
createElementVNode("div", _hoisted_9, [
|
|
@@ -8059,7 +8240,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
8059
8240
|
])
|
|
8060
8241
|
], 64)) : unref(state) ? (openBlock(), createElementBlock("span", _hoisted_13, toDisplayString(unref(t)(unref(state))), 1)) : (openBlock(), createElementBlock(Fragment, { key: 3 }, [
|
|
8061
8242
|
createElementVNode("div", _hoisted_14, [
|
|
8062
|
-
createVNode(_sfc_main$
|
|
8243
|
+
createVNode(_sfc_main$w, { icon: "$mouseLeftClick" }),
|
|
8063
8244
|
createElementVNode("span", null, toDisplayString(unref(t)("selectObject")), 1)
|
|
8064
8245
|
]),
|
|
8065
8246
|
_cache[4] || (_cache[4] = createElementVNode("span", null, " + ", -1)),
|
|
@@ -8069,7 +8250,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
8069
8250
|
]),
|
|
8070
8251
|
_cache[5] || (_cache[5] = createElementVNode("div", { class: "mce-statusbar__divider" }, null, -1)),
|
|
8071
8252
|
createElementVNode("div", _hoisted_17, [
|
|
8072
|
-
createVNode(_sfc_main$
|
|
8253
|
+
createVNode(_sfc_main$w, { icon: "$mouseLeftClick" }),
|
|
8073
8254
|
createElementVNode("span", null, toDisplayString(unref(t)("selectArea")), 1)
|
|
8074
8255
|
]),
|
|
8075
8256
|
_cache[6] || (_cache[6] = createElementVNode("span", null, " + ", -1)),
|
|
@@ -8079,7 +8260,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
8079
8260
|
]),
|
|
8080
8261
|
_cache[7] || (_cache[7] = createElementVNode("div", { class: "mce-statusbar__divider" }, null, -1)),
|
|
8081
8262
|
createElementVNode("div", _hoisted_20, [
|
|
8082
|
-
createVNode(_sfc_main$
|
|
8263
|
+
createVNode(_sfc_main$w, { icon: "$mouseLeftClick" }),
|
|
8083
8264
|
createElementVNode("span", null, toDisplayString(unref(t)("dragSelected")), 1)
|
|
8084
8265
|
])
|
|
8085
8266
|
], 64))
|
|
@@ -8096,8 +8277,8 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
8096
8277
|
};
|
|
8097
8278
|
}
|
|
8098
8279
|
});
|
|
8099
|
-
const Statusbar = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
8100
|
-
const _sfc_main$
|
|
8280
|
+
const Statusbar = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__scopeId", "data-v-36c89bd7"]]);
|
|
8281
|
+
const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
8101
8282
|
__name: "TextEditor",
|
|
8102
8283
|
setup(__props, { expose: __expose }) {
|
|
8103
8284
|
const {
|
|
@@ -8192,19 +8373,19 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
8192
8373
|
};
|
|
8193
8374
|
}
|
|
8194
8375
|
});
|
|
8195
|
-
const _hoisted_1$
|
|
8196
|
-
const _sfc_main$
|
|
8376
|
+
const _hoisted_1$5 = { class: "mce-payhead" };
|
|
8377
|
+
const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
8197
8378
|
__name: "Playhead",
|
|
8198
8379
|
setup(__props) {
|
|
8199
8380
|
return (_ctx, _cache) => {
|
|
8200
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
8381
|
+
return openBlock(), createElementBlock("div", _hoisted_1$5, [..._cache[0] || (_cache[0] = [
|
|
8201
8382
|
createElementVNode("header", { class: "mce-payhead__header" }, null, -1),
|
|
8202
8383
|
createElementVNode("main", { class: "mce-payhead__main" }, null, -1)
|
|
8203
8384
|
])]);
|
|
8204
8385
|
};
|
|
8205
8386
|
}
|
|
8206
8387
|
});
|
|
8207
|
-
const _hoisted_1$
|
|
8388
|
+
const _hoisted_1$4 = {
|
|
8208
8389
|
key: 0,
|
|
8209
8390
|
class: "mce-segment__edge mce-segment__edge--front"
|
|
8210
8391
|
};
|
|
@@ -8216,7 +8397,7 @@ const _hoisted_3$2 = {
|
|
|
8216
8397
|
key: 1,
|
|
8217
8398
|
class: "mce-segment__edge mce-segment__edge--end"
|
|
8218
8399
|
};
|
|
8219
|
-
const _sfc_main$
|
|
8400
|
+
const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
8220
8401
|
__name: "Segment",
|
|
8221
8402
|
props: {
|
|
8222
8403
|
node: {},
|
|
@@ -8247,25 +8428,25 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
8247
8428
|
]]),
|
|
8248
8429
|
style: normalizeStyle(style.value)
|
|
8249
8430
|
}, [
|
|
8250
|
-
__props.active ? (openBlock(), createElementBlock("div", _hoisted_1$
|
|
8431
|
+
__props.active ? (openBlock(), createElementBlock("div", _hoisted_1$4)) : createCommentVNode("", true),
|
|
8251
8432
|
createElementVNode("span", _hoisted_2$2, toDisplayString(props.node.name), 1),
|
|
8252
8433
|
__props.active ? (openBlock(), createElementBlock("div", _hoisted_3$2)) : createCommentVNode("", true)
|
|
8253
8434
|
], 6);
|
|
8254
8435
|
};
|
|
8255
8436
|
}
|
|
8256
8437
|
});
|
|
8257
|
-
const _hoisted_1$
|
|
8258
|
-
const _sfc_main$
|
|
8438
|
+
const _hoisted_1$3 = { class: "mce-track" };
|
|
8439
|
+
const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
8259
8440
|
__name: "Track",
|
|
8260
8441
|
setup(__props) {
|
|
8261
8442
|
return (_ctx, _cache) => {
|
|
8262
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
8443
|
+
return openBlock(), createElementBlock("div", _hoisted_1$3, [
|
|
8263
8444
|
renderSlot(_ctx.$slots, "default")
|
|
8264
8445
|
]);
|
|
8265
8446
|
};
|
|
8266
8447
|
}
|
|
8267
8448
|
});
|
|
8268
|
-
const _sfc_main$
|
|
8449
|
+
const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
8269
8450
|
__name: "Trackhead",
|
|
8270
8451
|
props: {
|
|
8271
8452
|
node: {}
|
|
@@ -8281,7 +8462,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
8281
8462
|
};
|
|
8282
8463
|
}
|
|
8283
8464
|
});
|
|
8284
|
-
const _hoisted_1$
|
|
8465
|
+
const _hoisted_1$2 = { class: "mce-timeline__toolbar" };
|
|
8285
8466
|
const _hoisted_2$1 = { class: "mce-timeline__main" };
|
|
8286
8467
|
const _hoisted_3$1 = { class: "mce-timeline__left" };
|
|
8287
8468
|
const _hoisted_4 = { class: "mce-timeline__left-wrapper" };
|
|
@@ -8289,7 +8470,7 @@ const _hoisted_5 = { class: "mce-timeline__right-wrapper" };
|
|
|
8289
8470
|
const _hoisted_6 = { class: "mce-timeline__ruler" };
|
|
8290
8471
|
const _hoisted_7 = { class: "mce-timeline__track" };
|
|
8291
8472
|
const wheelSensitivity = 0.02;
|
|
8292
|
-
const _sfc_main$
|
|
8473
|
+
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
8293
8474
|
__name: "Timeline",
|
|
8294
8475
|
setup(__props) {
|
|
8295
8476
|
const {
|
|
@@ -8392,12 +8573,12 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
8392
8573
|
onWheel: _cache[0] || (_cache[0] = withModifiers(() => {
|
|
8393
8574
|
}, ["prevent"]))
|
|
8394
8575
|
}, [
|
|
8395
|
-
createElementVNode("div", _hoisted_1$
|
|
8576
|
+
createElementVNode("div", _hoisted_1$2, [
|
|
8396
8577
|
createElementVNode("div", {
|
|
8397
8578
|
class: "mce-timeline__play",
|
|
8398
8579
|
onClick: toggle
|
|
8399
8580
|
}, [
|
|
8400
|
-
createVNode(_sfc_main$
|
|
8581
|
+
createVNode(_sfc_main$w, {
|
|
8401
8582
|
icon: paused.value ? "$play" : "$pause"
|
|
8402
8583
|
}, null, 8, ["icon"])
|
|
8403
8584
|
])
|
|
@@ -8411,7 +8592,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
8411
8592
|
})
|
|
8412
8593
|
}, [
|
|
8413
8594
|
(openBlock(true), createElementBlock(Fragment, null, renderList(elements.value, (node, index) => {
|
|
8414
|
-
return openBlock(), createBlock(_sfc_main$
|
|
8595
|
+
return openBlock(), createBlock(_sfc_main$5, {
|
|
8415
8596
|
key: index,
|
|
8416
8597
|
node
|
|
8417
8598
|
}, null, 8, ["node"]);
|
|
@@ -8426,7 +8607,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
8426
8607
|
}, [
|
|
8427
8608
|
createElementVNode("div", _hoisted_5, [
|
|
8428
8609
|
createElementVNode("div", _hoisted_6, [
|
|
8429
|
-
createVNode(_sfc_main$
|
|
8610
|
+
createVNode(_sfc_main$l, {
|
|
8430
8611
|
ref: "rulerTpl",
|
|
8431
8612
|
zoom: 1 / unref(msPerPx) * fps.value,
|
|
8432
8613
|
unit: 100,
|
|
@@ -8444,9 +8625,9 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
8444
8625
|
})
|
|
8445
8626
|
}, [
|
|
8446
8627
|
(openBlock(true), createElementBlock(Fragment, null, renderList(elements.value, (node, index) => {
|
|
8447
|
-
return openBlock(), createBlock(_sfc_main$
|
|
8628
|
+
return openBlock(), createBlock(_sfc_main$6, { key: index }, {
|
|
8448
8629
|
default: withCtx(() => [
|
|
8449
|
-
createVNode(_sfc_main$
|
|
8630
|
+
createVNode(_sfc_main$7, {
|
|
8450
8631
|
node,
|
|
8451
8632
|
"ms-per-px": unref(msPerPx),
|
|
8452
8633
|
active: unref(selection).some((v) => v.equal(node)),
|
|
@@ -8458,7 +8639,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
8458
8639
|
}), 128))
|
|
8459
8640
|
], 4)
|
|
8460
8641
|
]),
|
|
8461
|
-
createVNode(_sfc_main$
|
|
8642
|
+
createVNode(_sfc_main$8, {
|
|
8462
8643
|
style: normalizeStyle({
|
|
8463
8644
|
transform: `translate(${position.value[0] + Math.ceil(unref(currentTime) / unref(msPerPx))}px, 0px)`
|
|
8464
8645
|
})
|
|
@@ -8470,6 +8651,12 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
8470
8651
|
};
|
|
8471
8652
|
}
|
|
8472
8653
|
});
|
|
8654
|
+
const _sfc_main$3 = {};
|
|
8655
|
+
const _hoisted_1$1 = { class: "mce-toolbelt" };
|
|
8656
|
+
function _sfc_render(_ctx, _cache) {
|
|
8657
|
+
return openBlock(), createElementBlock("div", _hoisted_1$1);
|
|
8658
|
+
}
|
|
8659
|
+
const Toolbelt = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render]]);
|
|
8473
8660
|
const _hoisted_1 = ["data-pixel-ratio"];
|
|
8474
8661
|
const _hoisted_2 = {
|
|
8475
8662
|
ref: "canvasTpl",
|
|
@@ -8479,7 +8666,7 @@ const _hoisted_3 = {
|
|
|
8479
8666
|
ref: "overlayContainerTpl",
|
|
8480
8667
|
class: "mce-editor__overlay-container"
|
|
8481
8668
|
};
|
|
8482
|
-
const _sfc_main$
|
|
8669
|
+
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
8483
8670
|
__name: "EditorLayout",
|
|
8484
8671
|
props: {
|
|
8485
8672
|
...makeMceStrategyProps({
|
|
@@ -8743,10 +8930,10 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
8743
8930
|
}
|
|
8744
8931
|
}
|
|
8745
8932
|
return (_ctx, _cache) => {
|
|
8746
|
-
return openBlock(), createBlock(_sfc_main$
|
|
8933
|
+
return openBlock(), createBlock(_sfc_main$e, { class: "mce-editor" }, {
|
|
8747
8934
|
default: withCtx(() => [
|
|
8748
|
-
createVNode(_sfc_main$
|
|
8749
|
-
createVNode(_sfc_main$
|
|
8935
|
+
createVNode(_sfc_main$f),
|
|
8936
|
+
createVNode(_sfc_main$c, null, {
|
|
8750
8937
|
default: withCtx(() => [
|
|
8751
8938
|
createElementVNode("div", {
|
|
8752
8939
|
ref_key: "drawboardDom",
|
|
@@ -8759,12 +8946,12 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
8759
8946
|
}, ["prevent"]))
|
|
8760
8947
|
}, [
|
|
8761
8948
|
createElementVNode("canvas", _hoisted_2, null, 512),
|
|
8762
|
-
createVNode(_sfc_main$
|
|
8763
|
-
createVNode(_sfc_main$
|
|
8764
|
-
createVNode(_sfc_main$l),
|
|
8949
|
+
createVNode(_sfc_main$9, { ref: "textEditorTpl" }, null, 512),
|
|
8950
|
+
createVNode(_sfc_main$x),
|
|
8765
8951
|
createVNode(_sfc_main$n),
|
|
8766
|
-
createVNode(_sfc_main$
|
|
8767
|
-
createVNode(_sfc_main$
|
|
8952
|
+
createVNode(_sfc_main$p),
|
|
8953
|
+
createVNode(_sfc_main$s),
|
|
8954
|
+
createVNode(_sfc_main$g, {
|
|
8768
8955
|
ref: "selectorTpl",
|
|
8769
8956
|
"selected-area": selectedArea.value,
|
|
8770
8957
|
"resize-strategy": unref(selection)[0] ? props.resizeStrategy(unref(selection)[0]) : void 0
|
|
@@ -8777,8 +8964,8 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
8777
8964
|
]),
|
|
8778
8965
|
_: 3
|
|
8779
8966
|
}, 8, ["selected-area", "resize-strategy"]),
|
|
8780
|
-
unref(config).scrollbar ? (openBlock(), createBlock(_sfc_main$
|
|
8781
|
-
_ctx.$slots.floatbar ? (openBlock(), createBlock(_sfc_main$
|
|
8967
|
+
unref(config).scrollbar ? (openBlock(), createBlock(_sfc_main$i, { key: 0 })) : createCommentVNode("", true),
|
|
8968
|
+
_ctx.$slots.floatbar ? (openBlock(), createBlock(_sfc_main$r, {
|
|
8782
8969
|
key: 1,
|
|
8783
8970
|
target: unref(state) === "typing" ? textEditor.value?.textEditor : selector.value?.transformable?.$el
|
|
8784
8971
|
}, {
|
|
@@ -8787,16 +8974,17 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
8787
8974
|
]),
|
|
8788
8975
|
_: 3
|
|
8789
8976
|
}, 8, ["target"])) : createCommentVNode("", true),
|
|
8790
|
-
createVNode(_sfc_main$
|
|
8791
|
-
createVNode(_sfc_main$
|
|
8792
|
-
unref(config).ruler ? (openBlock(), createBlock(_sfc_main$
|
|
8977
|
+
createVNode(_sfc_main$t),
|
|
8978
|
+
createVNode(_sfc_main$o),
|
|
8979
|
+
unref(config).ruler ? (openBlock(), createBlock(_sfc_main$k, { key: 2 })) : createCommentVNode("", true),
|
|
8980
|
+
createVNode(Toolbelt),
|
|
8793
8981
|
renderSlot(_ctx.$slots, "drawboard")
|
|
8794
8982
|
], 40, _hoisted_1)
|
|
8795
8983
|
]),
|
|
8796
8984
|
_: 3
|
|
8797
8985
|
}),
|
|
8798
8986
|
renderSlot(_ctx.$slots, "default"),
|
|
8799
|
-
createVNode(_sfc_main$
|
|
8987
|
+
createVNode(_sfc_main$d, {
|
|
8800
8988
|
modelValue: unref(config).statusbar,
|
|
8801
8989
|
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => unref(config).statusbar = $event),
|
|
8802
8990
|
position: "bottom",
|
|
@@ -8807,14 +8995,14 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
8807
8995
|
]),
|
|
8808
8996
|
_: 1
|
|
8809
8997
|
}, 8, ["modelValue"]),
|
|
8810
|
-
createVNode(_sfc_main$
|
|
8998
|
+
createVNode(_sfc_main$d, {
|
|
8811
8999
|
modelValue: unref(config).timeline,
|
|
8812
9000
|
"onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => unref(config).timeline = $event),
|
|
8813
9001
|
position: "bottom",
|
|
8814
9002
|
size: 160
|
|
8815
9003
|
}, {
|
|
8816
9004
|
default: withCtx(() => [
|
|
8817
|
-
createVNode(_sfc_main$
|
|
9005
|
+
createVNode(_sfc_main$4)
|
|
8818
9006
|
]),
|
|
8819
9007
|
_: 1
|
|
8820
9008
|
}, 8, ["modelValue"]),
|
|
@@ -8825,6 +9013,209 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
8825
9013
|
};
|
|
8826
9014
|
}
|
|
8827
9015
|
});
|
|
9016
|
+
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
9017
|
+
__name: "Layers",
|
|
9018
|
+
setup(__props) {
|
|
9019
|
+
const {
|
|
9020
|
+
root,
|
|
9021
|
+
selection,
|
|
9022
|
+
exec,
|
|
9023
|
+
zoomTo
|
|
9024
|
+
} = useEditor();
|
|
9025
|
+
const rootRef = ref();
|
|
9026
|
+
const hover = ref();
|
|
9027
|
+
const current = ref();
|
|
9028
|
+
watch(hover, (hover2) => {
|
|
9029
|
+
const rootBox = rootRef.value?.getBoundingClientRect();
|
|
9030
|
+
const hoverBox = hover2?.dom.getBoundingClientRect();
|
|
9031
|
+
if (rootBox && hoverBox && hover2.node instanceof Element2D) {
|
|
9032
|
+
current.value = {
|
|
9033
|
+
x: -rootRef.value.scrollLeft,
|
|
9034
|
+
y: rootRef.value.scrollTop + hoverBox.y - rootBox.y,
|
|
9035
|
+
node: hover2.node
|
|
9036
|
+
};
|
|
9037
|
+
} else {
|
|
9038
|
+
current.value = void 0;
|
|
9039
|
+
}
|
|
9040
|
+
});
|
|
9041
|
+
function onMouseleave() {
|
|
9042
|
+
hover.value = void 0;
|
|
9043
|
+
}
|
|
9044
|
+
const Layer = defineComponent({
|
|
9045
|
+
name: "MceLayer",
|
|
9046
|
+
inheritAttrs: false,
|
|
9047
|
+
props: {
|
|
9048
|
+
node: {
|
|
9049
|
+
type: Object,
|
|
9050
|
+
required: true
|
|
9051
|
+
},
|
|
9052
|
+
indent: {
|
|
9053
|
+
type: Number,
|
|
9054
|
+
default: 0
|
|
9055
|
+
}
|
|
9056
|
+
},
|
|
9057
|
+
setup(props, { attrs }) {
|
|
9058
|
+
const opened = ref(false);
|
|
9059
|
+
const isActive = computed(() => selection.value.some((v) => v.equal(props.node)));
|
|
9060
|
+
const children = computed(() => props.node?.children ?? []);
|
|
9061
|
+
const itemRef = ref();
|
|
9062
|
+
const editing = ref(false);
|
|
9063
|
+
const editValue = ref();
|
|
9064
|
+
function onClickExpand() {
|
|
9065
|
+
opened.value = !opened.value;
|
|
9066
|
+
}
|
|
9067
|
+
function onClickContent() {
|
|
9068
|
+
if (props.node instanceof Element2D) {
|
|
9069
|
+
selection.value = [props.node];
|
|
9070
|
+
}
|
|
9071
|
+
}
|
|
9072
|
+
function onDblclickThumbnail(e) {
|
|
9073
|
+
e.stopPropagation();
|
|
9074
|
+
if (props.node instanceof Element2D) {
|
|
9075
|
+
zoomTo("selection", {
|
|
9076
|
+
behavior: "smooth"
|
|
9077
|
+
});
|
|
9078
|
+
}
|
|
9079
|
+
}
|
|
9080
|
+
function onDblclickContent() {
|
|
9081
|
+
editing.value = true;
|
|
9082
|
+
}
|
|
9083
|
+
function onMouseenter() {
|
|
9084
|
+
hover.value = {
|
|
9085
|
+
node: props.node,
|
|
9086
|
+
dom: itemRef.value
|
|
9087
|
+
};
|
|
9088
|
+
}
|
|
9089
|
+
return () => {
|
|
9090
|
+
function thumbnail() {
|
|
9091
|
+
const node = props.node;
|
|
9092
|
+
if (node.meta.inEditorIs === "Frame") {
|
|
9093
|
+
return createVNode(_sfc_main$w, { icon: "$frame" });
|
|
9094
|
+
}
|
|
9095
|
+
if (node.children.length > 0) {
|
|
9096
|
+
return createVNode(_sfc_main$w, { icon: "$group" });
|
|
9097
|
+
}
|
|
9098
|
+
if (node instanceof Element2D) {
|
|
9099
|
+
if (node.foreground.isValid() && node.foreground.image) {
|
|
9100
|
+
return createVNode(_sfc_main$w, { icon: "$image" });
|
|
9101
|
+
}
|
|
9102
|
+
if (node.text.isValid()) {
|
|
9103
|
+
return createVNode(_sfc_main$w, { icon: "$text" });
|
|
9104
|
+
}
|
|
9105
|
+
}
|
|
9106
|
+
return createVNode(_sfc_main$w, { icon: "$shape" });
|
|
9107
|
+
}
|
|
9108
|
+
return createElementVNode(
|
|
9109
|
+
"div",
|
|
9110
|
+
mergeProps(attrs, {
|
|
9111
|
+
class: [
|
|
9112
|
+
"mce-layer",
|
|
9113
|
+
isActive.value && "mce-layer--active",
|
|
9114
|
+
opened.value && "mce-layer--opened"
|
|
9115
|
+
]
|
|
9116
|
+
}),
|
|
9117
|
+
[
|
|
9118
|
+
createElementVNode("div", {
|
|
9119
|
+
class: "mce-layer-item",
|
|
9120
|
+
style: {
|
|
9121
|
+
"--indent-padding": `${props.indent * 16}px`
|
|
9122
|
+
},
|
|
9123
|
+
ref: itemRef,
|
|
9124
|
+
onMouseenter,
|
|
9125
|
+
onContextmenu: (e) => {
|
|
9126
|
+
if (props.node instanceof Element2D) {
|
|
9127
|
+
selection.value = [props.node];
|
|
9128
|
+
exec("openContextMenu", e);
|
|
9129
|
+
}
|
|
9130
|
+
}
|
|
9131
|
+
}, [
|
|
9132
|
+
createElementVNode("div", {
|
|
9133
|
+
class: "mce-layer-item__expand",
|
|
9134
|
+
onClick: onClickExpand
|
|
9135
|
+
}, [
|
|
9136
|
+
children.value.length ? createVNode(_sfc_main$w, { icon: "$arrowRight" }) : void 0
|
|
9137
|
+
]),
|
|
9138
|
+
createElementVNode("div", {
|
|
9139
|
+
class: "mce-layer-item__content",
|
|
9140
|
+
onClick: onClickContent,
|
|
9141
|
+
onDblclick: onDblclickContent
|
|
9142
|
+
}, [
|
|
9143
|
+
createElementVNode("div", {
|
|
9144
|
+
class: "mce-layer-item__thumbnail",
|
|
9145
|
+
onDblclick: onDblclickThumbnail
|
|
9146
|
+
}, [
|
|
9147
|
+
thumbnail()
|
|
9148
|
+
]),
|
|
9149
|
+
createElementVNode("div", {
|
|
9150
|
+
class: "mce-layer-item__name"
|
|
9151
|
+
}, [
|
|
9152
|
+
editing.value ? createElementVNode("input", {
|
|
9153
|
+
class: "mce-layer-item__name-input",
|
|
9154
|
+
autofocus: true,
|
|
9155
|
+
value: props.node.name,
|
|
9156
|
+
onBlur: () => {
|
|
9157
|
+
editing.value = false;
|
|
9158
|
+
if (editValue.value) {
|
|
9159
|
+
props.node.name = editValue.value;
|
|
9160
|
+
editValue.value = void 0;
|
|
9161
|
+
}
|
|
9162
|
+
},
|
|
9163
|
+
onInput: (e) => editValue.value = e.target.value
|
|
9164
|
+
}) : props.node.name || props.node.id
|
|
9165
|
+
])
|
|
9166
|
+
])
|
|
9167
|
+
]),
|
|
9168
|
+
...opened.value ? children.value.map((child) => createVNode(Layer, {
|
|
9169
|
+
node: child,
|
|
9170
|
+
indent: props.indent + 1
|
|
9171
|
+
})) : []
|
|
9172
|
+
]
|
|
9173
|
+
);
|
|
9174
|
+
};
|
|
9175
|
+
}
|
|
9176
|
+
});
|
|
9177
|
+
return (_ctx, _cache) => {
|
|
9178
|
+
return openBlock(), createElementBlock("div", {
|
|
9179
|
+
ref_key: "rootRef",
|
|
9180
|
+
ref: rootRef,
|
|
9181
|
+
class: "mce-layers",
|
|
9182
|
+
onMouseleave
|
|
9183
|
+
}, [
|
|
9184
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(root).children, (child, index) => {
|
|
9185
|
+
return openBlock(), createBlock(unref(Layer), {
|
|
9186
|
+
key: index,
|
|
9187
|
+
node: child
|
|
9188
|
+
}, null, 8, ["node"]);
|
|
9189
|
+
}), 128)),
|
|
9190
|
+
current.value !== void 0 ? (openBlock(), createElementBlock("div", {
|
|
9191
|
+
key: 0,
|
|
9192
|
+
class: "mce-layers__action",
|
|
9193
|
+
style: normalizeStyle({
|
|
9194
|
+
right: `${current.value.x}px`,
|
|
9195
|
+
top: `${current.value.y}px`
|
|
9196
|
+
})
|
|
9197
|
+
}, [
|
|
9198
|
+
createElementVNode("div", {
|
|
9199
|
+
class: "mce-btn",
|
|
9200
|
+
onClick: _cache[0] || (_cache[0] = ($event) => current.value.node.meta.lock = !current.value.node.meta.lock)
|
|
9201
|
+
}, [
|
|
9202
|
+
createVNode(_sfc_main$w, {
|
|
9203
|
+
icon: current.value.node.meta.lock ? "$lock" : "$unlock"
|
|
9204
|
+
}, null, 8, ["icon"])
|
|
9205
|
+
]),
|
|
9206
|
+
createElementVNode("div", {
|
|
9207
|
+
class: "mce-btn",
|
|
9208
|
+
onClick: _cache[1] || (_cache[1] = ($event) => current.value.node.style.visibility = current.value.node.style.visibility === "visible" ? "hidden" : "visible")
|
|
9209
|
+
}, [
|
|
9210
|
+
createVNode(_sfc_main$w, {
|
|
9211
|
+
icon: current.value.node.style.visibility === "visible" ? "$visible" : "$unvisible"
|
|
9212
|
+
}, null, 8, ["icon"])
|
|
9213
|
+
])
|
|
9214
|
+
], 4)) : createCommentVNode("", true)
|
|
9215
|
+
], 544);
|
|
9216
|
+
};
|
|
9217
|
+
}
|
|
9218
|
+
});
|
|
8828
9219
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
8829
9220
|
__name: "Dialog",
|
|
8830
9221
|
props: /* @__PURE__ */ mergeModels({
|
|
@@ -8852,7 +9243,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
8852
9243
|
updateLocation
|
|
8853
9244
|
});
|
|
8854
9245
|
return (_ctx, _cache) => {
|
|
8855
|
-
return openBlock(), createBlock(_sfc_main$
|
|
9246
|
+
return openBlock(), createBlock(_sfc_main$v, {
|
|
8856
9247
|
ref: "overlayTpl",
|
|
8857
9248
|
modelValue: isActive.value,
|
|
8858
9249
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isActive.value = $event),
|
|
@@ -8879,8 +9270,10 @@ export {
|
|
|
8879
9270
|
_sfc_main as Dialog,
|
|
8880
9271
|
Doc,
|
|
8881
9272
|
Editor,
|
|
8882
|
-
_sfc_main$1 as
|
|
8883
|
-
_sfc_main$
|
|
9273
|
+
_sfc_main$1 as EditorLayers,
|
|
9274
|
+
_sfc_main$2 as EditorLayout,
|
|
9275
|
+
_sfc_main$d as EditorLayoutItem,
|
|
9276
|
+
Toolbelt as EditorToolbelt,
|
|
8884
9277
|
IconsSymbol,
|
|
8885
9278
|
MceComponentIcon,
|
|
8886
9279
|
MceLayoutItemKey,
|
|
@@ -8888,12 +9281,12 @@ export {
|
|
|
8888
9281
|
MceMenuSymbol,
|
|
8889
9282
|
MceOverlaySymbol,
|
|
8890
9283
|
MceSvgIcon,
|
|
8891
|
-
_sfc_main$
|
|
9284
|
+
_sfc_main$u as Menu,
|
|
8892
9285
|
Model,
|
|
8893
|
-
_sfc_main$
|
|
9286
|
+
_sfc_main$l as Ruler,
|
|
8894
9287
|
SUPPORTS_CLIPBOARD,
|
|
8895
|
-
_sfc_main$
|
|
8896
|
-
_sfc_main$
|
|
9288
|
+
_sfc_main$j as Scrollbar,
|
|
9289
|
+
_sfc_main$h as Transformable,
|
|
8897
9290
|
USER_AGENT,
|
|
8898
9291
|
boundingBoxToStyle,
|
|
8899
9292
|
consoleError,
|