@hankchen/canvas-editor-vue 2.0.0 → 2.2.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.
@@ -0,0 +1,98 @@
1
+ import { createBlock as e, defineComponent as t, mergeProps as n, openBlock as r, resolveDynamicComponent as i } from "vue";
2
+ //#region ../canvas-editor/src/shared/layerPath.ts
3
+ function a(e) {
4
+ return typeof e == "number" && Number.isSafeInteger(e) && e >= 0;
5
+ }
6
+ function o(e) {
7
+ if (!Array.isArray(e) || e.length < 2 || e[0] !== "layers" || !a(e[1])) return !1;
8
+ let t = [
9
+ "rows",
10
+ "cells",
11
+ "content"
12
+ ], n = 0, r = 2;
13
+ for (; r < e.length;) {
14
+ let i = e[r];
15
+ if (n === 0 && i === "template") {
16
+ if (r === e.length - 1) return !0;
17
+ if (e[r + 1] !== "cells") return !1;
18
+ n = 1, r += 1;
19
+ continue;
20
+ }
21
+ let o = t[n];
22
+ if (i !== o) return !1;
23
+ if (o === "content") return r === e.length - 1;
24
+ if (!a(e[r + 1])) return !1;
25
+ n += 1, r += 2;
26
+ }
27
+ return !0;
28
+ }
29
+ function s(e) {
30
+ return e.includes("template");
31
+ }
32
+ function c(e) {
33
+ return o(e) && e.length === 2;
34
+ }
35
+ function l(e, t) {
36
+ if (e === t) return !0;
37
+ if (!e || !t || e.length !== t.length) return !1;
38
+ for (let n = 0; n < e.length; n += 1) if (e[n] !== t[n]) return !1;
39
+ return !0;
40
+ }
41
+ function u(e, t) {
42
+ if (e.length < t.length) return !1;
43
+ for (let n = 0; n < t.length; n += 1) if (e[n] !== t[n]) return !1;
44
+ return !0;
45
+ }
46
+ function d(e, t) {
47
+ return t.some((t) => u(e, t));
48
+ }
49
+ function f(e, t) {
50
+ let n = e, r = 0;
51
+ for (; r < t.length;) {
52
+ let e = n;
53
+ if (typeof e != "object" || !e) return null;
54
+ let i = t[r];
55
+ if (typeof i != "string" || (n = e[i], n == null)) return null;
56
+ if (i === "template") {
57
+ r += 1;
58
+ continue;
59
+ }
60
+ if (r + 1 >= t.length) break;
61
+ let a = n, o = t[r + 1];
62
+ if (!Array.isArray(a) || typeof o != "number" || (n = a[o], n == null)) return null;
63
+ r += 2;
64
+ }
65
+ return n;
66
+ }
67
+ function p(e, t) {
68
+ if (!o(t)) return null;
69
+ let n = f(e, t);
70
+ return typeof n != "object" || !n || !("type" in n) ? null : n;
71
+ }
72
+ function m(e, t) {
73
+ let n = t[1];
74
+ return typeof n != "number" || !Number.isSafeInteger(n) || n < 0 ? null : e.layers[n] ?? null;
75
+ }
76
+ //#endregion
77
+ //#region src/shared/PanelIcon.vue
78
+ var h = /* @__PURE__ */ t({
79
+ inheritAttrs: !1,
80
+ __name: "PanelIcon",
81
+ props: {
82
+ icon: {},
83
+ size: { default: 14 },
84
+ strokeWidth: { default: 2 }
85
+ },
86
+ setup(t) {
87
+ return (a, o) => (r(), e(i(t.icon), n({
88
+ size: t.size,
89
+ "stroke-width": t.strokeWidth
90
+ }, a.$attrs), null, 16, ["size", "stroke-width"]));
91
+ }
92
+ }), g = (e, t) => {
93
+ let n = e.__vccOpts || e;
94
+ for (let [e, r] of t) n[e] = r;
95
+ return n;
96
+ };
97
+ //#endregion
98
+ export { s as a, m as c, c as i, h as n, l as o, d as r, p as s, g as t };
@@ -1,6 +1,6 @@
1
1
  import { HorizontalAlign, VerticalAlign } from '@hankchen/canvas-editor';
2
2
  type __VLS_Props = {
3
- /** 当前会话模式(ui.editing.expression 投影):激活项高亮随之 */
3
+ /** 当前会话模式(ui.editing.expression 投影):触发钮文字与菜单勾选随之 */
4
4
  mode: 'static' | 'expression';
5
5
  /** 字体引用(textEditLayout.font 原串;空串 = 内置默认字体) */
6
6
  font: string;