@hankchen/canvas-editor-vue 0.1.2 → 0.1.4
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/canvas/guideSnap.d.ts +4 -2
- package/dist/canvas-C70NSsoF.js +1674 -0
- package/dist/canvas.js +1 -1
- package/dist/createLucideIcon-SCvtEGVf.js +96 -0
- package/dist/dist-DGtNmLwo.js +341 -0
- package/dist/index.js +11 -11
- package/dist/{layer-panel-BM-nX_OX.js → layer-panel-GiVy_B4A.js} +229 -112
- package/dist/layer-panel.js +1 -1
- package/dist/property-panel/fields/BooleanField.d.ts +2 -0
- package/dist/{property-panel-Cw6T9dAQ.js → property-panel-C2etsIhF.js} +407 -354
- package/dist/property-panel.js +1 -1
- package/dist/shared/editableTarget.d.ts +8 -0
- package/dist/{shared-BTyB4vbT.js → shared-wuupBoZg.js} +20 -20
- package/dist/shared.js +4 -4
- package/dist/{status-bar-DO8akYAw.js → status-bar-_PvEXyq8.js} +6 -6
- package/dist/status-bar.js +1 -1
- package/dist/style.css +1 -1
- package/dist/{useDataSourceSchema-DStVoY8Z.js → useDataSourceSchema-CGbldbUj.js} +20 -20
- package/dist/{useTransientFeedback-Cnp6aNB7.js → useTransientFeedback-CTjmMmFF.js} +15 -9
- package/package.json +2 -2
- package/dist/canvas-CSdXMg6S.js +0 -1601
- package/dist/dist-B6-i-hhY.js +0 -184
package/dist/canvas.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as e, a as t, c as n, d as r, f as i, g as a, h as o, i as s, l as c, m as l, n as u, o as d, p as f, r as p, s as m, t as h, u as g } from "./canvas-
|
|
1
|
+
import { _ as e, a as t, c as n, d as r, f as i, g as a, h as o, i as s, l as c, m as l, n as u, o as d, p as f, r as p, s as m, t as h, u as g } from "./canvas-C70NSsoF.js";
|
|
2
2
|
export { e as AlignFloatBar, n as CanvasSurface, f as ContentTypePill, a as ContextMenu, l as FindBar, m as GuidesOverlay, d as Ruler, c as TextEditingOverlay, u as createGizmoOverlayPainter, h as createRafScheduler, t as drawCreateRubberBand, s as drawFindMatches, p as drawSelectionGizmo, r as useDpr, o as useFindSession, g as useTextEditing, i as watchDprChanges };
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { h as e, inject as t } from "vue";
|
|
2
|
+
//#region ../../node_modules/.pnpm/@lucide+vue@1.48.0_vue@3.5.43_typescript@5.9.3_/node_modules/@lucide/vue/dist/esm/shared/src/build/defaultAttributes.mjs
|
|
3
|
+
var n = {
|
|
4
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
5
|
+
width: 24,
|
|
6
|
+
height: 24,
|
|
7
|
+
viewBox: "0 0 24 24",
|
|
8
|
+
fill: "none",
|
|
9
|
+
stroke: "currentColor",
|
|
10
|
+
"stroke-width": 2,
|
|
11
|
+
"stroke-linecap": "round",
|
|
12
|
+
"stroke-linejoin": "round"
|
|
13
|
+
}, r = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) === t).join(" ").trim();
|
|
14
|
+
//#endregion
|
|
15
|
+
//#region ../../node_modules/.pnpm/@lucide+vue@1.48.0_vue@3.5.43_typescript@5.9.3_/node_modules/@lucide/vue/dist/esm/shared/src/build/buildLucideIconNode.mjs
|
|
16
|
+
function i(e) {
|
|
17
|
+
return e != null;
|
|
18
|
+
}
|
|
19
|
+
function a(e, t = {}) {
|
|
20
|
+
let a = t.attributeNames ?? {}, o = (e) => a[e] ?? e, s = e.size ?? e.width ?? n.width, c = e.size ?? e.height ?? n.height, l = e.aliases?.filter((e) => typeof e == "string" && e.trim() !== "").map((e) => `lucide-${e}`) ?? [], u = [...e.name ? [`lucide-${e.name}`] : [], ...l], d = t.className?.split(" ").filter(Boolean) ?? [], f = t.includeDefaultClasses === !1 ? r(...d) : r("lucide", ...u, ...d), p = t.absoluteStrokeWidth ? Number(t.strokeWidth ?? n["stroke-width"]) * Number(e.size ?? e.width ?? n.width) / Number(t.size ?? t.width ?? n.width) : t.strokeWidth ?? n["stroke-width"];
|
|
21
|
+
return [
|
|
22
|
+
"svg",
|
|
23
|
+
{
|
|
24
|
+
...Object.entries(n).reduce((e, [t, n]) => (e[o(t)] = n, e), {}),
|
|
25
|
+
..."color" in t && t.color && { [o("stroke")]: t.color },
|
|
26
|
+
..."size" in t && i(t.size) && {
|
|
27
|
+
[o("width")]: t.size,
|
|
28
|
+
[o("height")]: t.size
|
|
29
|
+
},
|
|
30
|
+
..."width" in t && i(t.width) && { [o("width")]: t.width },
|
|
31
|
+
..."height" in t && i(t.height) && { [o("height")]: t.height },
|
|
32
|
+
[o("stroke-width")]: p,
|
|
33
|
+
...f && { [o("class")]: f },
|
|
34
|
+
[o("viewBox")]: `0 0 ${s} ${c}`,
|
|
35
|
+
...t.hasA11yProp === !1 ? { [o("aria-hidden")]: "true" } : {},
|
|
36
|
+
..."attributes" in t && t.attributes
|
|
37
|
+
},
|
|
38
|
+
e.node.map((e) => {
|
|
39
|
+
let [n, r, i] = e, a = t.nonScalingStroke ? {
|
|
40
|
+
[o("vector-effect")]: "non-scaling-stroke",
|
|
41
|
+
...r
|
|
42
|
+
} : r;
|
|
43
|
+
return i ? [
|
|
44
|
+
n,
|
|
45
|
+
a,
|
|
46
|
+
i
|
|
47
|
+
] : [n, a];
|
|
48
|
+
})
|
|
49
|
+
];
|
|
50
|
+
}
|
|
51
|
+
//#endregion
|
|
52
|
+
//#region ../../node_modules/.pnpm/@lucide+vue@1.48.0_vue@3.5.43_typescript@5.9.3_/node_modules/@lucide/vue/dist/esm/shared/src/utils/hasA11yProp.mjs
|
|
53
|
+
var o = (e) => {
|
|
54
|
+
for (let t in e) if (t.startsWith("aria-") || t === "role" || t === "title") return !0;
|
|
55
|
+
return !1;
|
|
56
|
+
}, s = (e) => e === "", c = (e) => e?.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), l = /* @__PURE__ */ Symbol("lucide-icons");
|
|
57
|
+
function u() {
|
|
58
|
+
return t(l, {});
|
|
59
|
+
}
|
|
60
|
+
//#endregion
|
|
61
|
+
//#region ../../node_modules/.pnpm/@lucide+vue@1.48.0_vue@3.5.43_typescript@5.9.3_/node_modules/@lucide/vue/dist/esm/Icon.mjs
|
|
62
|
+
var d = ({ name: t, iconNode: n, "icon-node": r, icon: i = {
|
|
63
|
+
name: t && c(t),
|
|
64
|
+
node: n ?? r ?? [],
|
|
65
|
+
size: 24,
|
|
66
|
+
aliases: []
|
|
67
|
+
}, absoluteStrokeWidth: l, "absolute-stroke-width": d, nonScalingStroke: f, "non-scaling-stroke": p, strokeWidth: m, "stroke-width": h, size: g, width: _ = g, height: v = g, color: y, ...b }, { slots: x }) => {
|
|
68
|
+
let { size: S, color: C, strokeWidth: w = 2, absoluteStrokeWidth: T = !1, nonScalingStroke: E = !1, class: D = "" } = u(), O = s(l) || s(d) || l === !0 || d === !0 || T === !0, k = s(f) || s(p) || f === !0 || p === !0 || E === !0;
|
|
69
|
+
delete b.class;
|
|
70
|
+
let A = x.default?.(), [, j, M = []] = a(i, {
|
|
71
|
+
color: y ?? C,
|
|
72
|
+
width: _ ?? g ?? S,
|
|
73
|
+
height: v ?? g ?? S,
|
|
74
|
+
strokeWidth: m ?? h ?? w,
|
|
75
|
+
absoluteStrokeWidth: O,
|
|
76
|
+
nonScalingStroke: k,
|
|
77
|
+
className: D,
|
|
78
|
+
hasA11yProp: A != null && A.length > 0 || o(b),
|
|
79
|
+
attributes: b
|
|
80
|
+
});
|
|
81
|
+
return e("svg", j, [...M.map(([t, n]) => e(t, n)), ...A ?? []]);
|
|
82
|
+
};
|
|
83
|
+
//#endregion
|
|
84
|
+
//#region ../../node_modules/.pnpm/@lucide+vue@1.48.0_vue@3.5.43_typescript@5.9.3_/node_modules/@lucide/vue/dist/esm/createLucideIcon.mjs
|
|
85
|
+
function f(t, n = []) {
|
|
86
|
+
let r = typeof t == "string" ? {
|
|
87
|
+
name: t,
|
|
88
|
+
node: n
|
|
89
|
+
} : t;
|
|
90
|
+
return (t, { slots: n }) => e(d, {
|
|
91
|
+
...t,
|
|
92
|
+
icon: r
|
|
93
|
+
}, n.default ? { default: n.default } : void 0);
|
|
94
|
+
}
|
|
95
|
+
//#endregion
|
|
96
|
+
export { f as t };
|
|
@@ -0,0 +1,341 @@
|
|
|
1
|
+
import { t as e } from "./createLucideIcon-SCvtEGVf.js";
|
|
2
|
+
var t = e({
|
|
3
|
+
name: "align-center-horizontal",
|
|
4
|
+
size: 24,
|
|
5
|
+
node: [
|
|
6
|
+
["path", {
|
|
7
|
+
d: "M2 12h20",
|
|
8
|
+
key: "9i4pu4"
|
|
9
|
+
}],
|
|
10
|
+
["path", {
|
|
11
|
+
d: "M10 16v4a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-4",
|
|
12
|
+
key: "11f1s0"
|
|
13
|
+
}],
|
|
14
|
+
["path", {
|
|
15
|
+
d: "M10 8V4a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v4",
|
|
16
|
+
key: "t14dx9"
|
|
17
|
+
}],
|
|
18
|
+
["path", {
|
|
19
|
+
d: "M20 16v1a2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2v-1",
|
|
20
|
+
key: "1w07xs"
|
|
21
|
+
}],
|
|
22
|
+
["path", {
|
|
23
|
+
d: "M14 8V7c0-1.1.9-2 2-2h2a2 2 0 0 1 2 2v1",
|
|
24
|
+
key: "1apec2"
|
|
25
|
+
}]
|
|
26
|
+
]
|
|
27
|
+
}), n = e({
|
|
28
|
+
name: "align-center-vertical",
|
|
29
|
+
size: 24,
|
|
30
|
+
node: [
|
|
31
|
+
["path", {
|
|
32
|
+
d: "M12 2v20",
|
|
33
|
+
key: "t6zp3m"
|
|
34
|
+
}],
|
|
35
|
+
["path", {
|
|
36
|
+
d: "M8 10H4a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h4",
|
|
37
|
+
key: "14d6g8"
|
|
38
|
+
}],
|
|
39
|
+
["path", {
|
|
40
|
+
d: "M16 10h4a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2h-4",
|
|
41
|
+
key: "1e2lrw"
|
|
42
|
+
}],
|
|
43
|
+
["path", {
|
|
44
|
+
d: "M8 20H7a2 2 0 0 1-2-2v-2c0-1.1.9-2 2-2h1",
|
|
45
|
+
key: "1fkdwx"
|
|
46
|
+
}],
|
|
47
|
+
["path", {
|
|
48
|
+
d: "M16 14h1a2 2 0 0 1 2 2v2a2 2 0 0 1-2 2h-1",
|
|
49
|
+
key: "1euafb"
|
|
50
|
+
}]
|
|
51
|
+
]
|
|
52
|
+
}), r = e({
|
|
53
|
+
name: "align-end-horizontal",
|
|
54
|
+
size: 24,
|
|
55
|
+
node: [
|
|
56
|
+
["rect", {
|
|
57
|
+
width: "6",
|
|
58
|
+
height: "16",
|
|
59
|
+
x: "4",
|
|
60
|
+
y: "2",
|
|
61
|
+
rx: "2",
|
|
62
|
+
key: "z5wdxg"
|
|
63
|
+
}],
|
|
64
|
+
["rect", {
|
|
65
|
+
width: "6",
|
|
66
|
+
height: "9",
|
|
67
|
+
x: "14",
|
|
68
|
+
y: "9",
|
|
69
|
+
rx: "2",
|
|
70
|
+
key: "um7a8w"
|
|
71
|
+
}],
|
|
72
|
+
["path", {
|
|
73
|
+
d: "M22 22H2",
|
|
74
|
+
key: "19qnx5"
|
|
75
|
+
}]
|
|
76
|
+
]
|
|
77
|
+
}), i = e({
|
|
78
|
+
name: "align-end-vertical",
|
|
79
|
+
size: 24,
|
|
80
|
+
node: [
|
|
81
|
+
["rect", {
|
|
82
|
+
width: "16",
|
|
83
|
+
height: "6",
|
|
84
|
+
x: "2",
|
|
85
|
+
y: "4",
|
|
86
|
+
rx: "2",
|
|
87
|
+
key: "10wcwx"
|
|
88
|
+
}],
|
|
89
|
+
["rect", {
|
|
90
|
+
width: "9",
|
|
91
|
+
height: "6",
|
|
92
|
+
x: "9",
|
|
93
|
+
y: "14",
|
|
94
|
+
rx: "2",
|
|
95
|
+
key: "4p5bwg"
|
|
96
|
+
}],
|
|
97
|
+
["path", {
|
|
98
|
+
d: "M22 22V2",
|
|
99
|
+
key: "12ipfv"
|
|
100
|
+
}]
|
|
101
|
+
]
|
|
102
|
+
}), a = e({
|
|
103
|
+
name: "align-start-horizontal",
|
|
104
|
+
size: 24,
|
|
105
|
+
node: [
|
|
106
|
+
["rect", {
|
|
107
|
+
width: "6",
|
|
108
|
+
height: "16",
|
|
109
|
+
x: "4",
|
|
110
|
+
y: "6",
|
|
111
|
+
rx: "2",
|
|
112
|
+
key: "1n4dg1"
|
|
113
|
+
}],
|
|
114
|
+
["rect", {
|
|
115
|
+
width: "6",
|
|
116
|
+
height: "9",
|
|
117
|
+
x: "14",
|
|
118
|
+
y: "6",
|
|
119
|
+
rx: "2",
|
|
120
|
+
key: "17khns"
|
|
121
|
+
}],
|
|
122
|
+
["path", {
|
|
123
|
+
d: "M22 2H2",
|
|
124
|
+
key: "fhrpnj"
|
|
125
|
+
}]
|
|
126
|
+
]
|
|
127
|
+
}), o = e({
|
|
128
|
+
name: "align-start-vertical",
|
|
129
|
+
size: 24,
|
|
130
|
+
node: [
|
|
131
|
+
["rect", {
|
|
132
|
+
width: "9",
|
|
133
|
+
height: "6",
|
|
134
|
+
x: "6",
|
|
135
|
+
y: "14",
|
|
136
|
+
rx: "2",
|
|
137
|
+
key: "lpm2y7"
|
|
138
|
+
}],
|
|
139
|
+
["rect", {
|
|
140
|
+
width: "16",
|
|
141
|
+
height: "6",
|
|
142
|
+
x: "6",
|
|
143
|
+
y: "4",
|
|
144
|
+
rx: "2",
|
|
145
|
+
key: "rdj6ps"
|
|
146
|
+
}],
|
|
147
|
+
["path", {
|
|
148
|
+
d: "M2 2v20",
|
|
149
|
+
key: "1ivd8o"
|
|
150
|
+
}]
|
|
151
|
+
]
|
|
152
|
+
}), s = e({
|
|
153
|
+
name: "chevron-down",
|
|
154
|
+
size: 24,
|
|
155
|
+
node: [["path", {
|
|
156
|
+
d: "m6 9 6 6 6-6",
|
|
157
|
+
key: "qrunsl"
|
|
158
|
+
}]]
|
|
159
|
+
}), c = [
|
|
160
|
+
"top-left",
|
|
161
|
+
"top",
|
|
162
|
+
"top-right",
|
|
163
|
+
"left",
|
|
164
|
+
"center",
|
|
165
|
+
"right",
|
|
166
|
+
"bottom-left",
|
|
167
|
+
"bottom",
|
|
168
|
+
"bottom-right"
|
|
169
|
+
], l = [
|
|
170
|
+
"left",
|
|
171
|
+
"center",
|
|
172
|
+
"right"
|
|
173
|
+
], u = [
|
|
174
|
+
"top",
|
|
175
|
+
"center",
|
|
176
|
+
"bottom"
|
|
177
|
+
], d = /* @__PURE__ */ ",(。(、(;(:(!(?(」(』()(】(》(〉(…(—(~(·(!(?(%(,(.(;(:()(](}".split("("), f = [
|
|
178
|
+
"「",
|
|
179
|
+
"『",
|
|
180
|
+
"(",
|
|
181
|
+
"【",
|
|
182
|
+
"《",
|
|
183
|
+
"〈",
|
|
184
|
+
"“",
|
|
185
|
+
"‘",
|
|
186
|
+
"(",
|
|
187
|
+
"[",
|
|
188
|
+
"{"
|
|
189
|
+
], p = new Intl.Segmenter(void 0, { granularity: "grapheme" });
|
|
190
|
+
function m(e) {
|
|
191
|
+
return e === "" ? [] : Array.from(p.segment(e), (e) => e.segment);
|
|
192
|
+
}
|
|
193
|
+
var h = .55;
|
|
194
|
+
function g(e) {
|
|
195
|
+
return e.length === 1 && e >= " " && e <= "~";
|
|
196
|
+
}
|
|
197
|
+
function _(e) {
|
|
198
|
+
return { measure(t) {
|
|
199
|
+
let n = 0;
|
|
200
|
+
for (let e of t) n += g(e) ? h : 1;
|
|
201
|
+
return n * e;
|
|
202
|
+
} };
|
|
203
|
+
}
|
|
204
|
+
var v = (e, t) => _(t);
|
|
205
|
+
function y(e) {
|
|
206
|
+
return e.join("");
|
|
207
|
+
}
|
|
208
|
+
function b(e) {
|
|
209
|
+
return e === " " || e === " ";
|
|
210
|
+
}
|
|
211
|
+
function x(e) {
|
|
212
|
+
return d.includes(e);
|
|
213
|
+
}
|
|
214
|
+
function S(e) {
|
|
215
|
+
return f.includes(e);
|
|
216
|
+
}
|
|
217
|
+
function C() {
|
|
218
|
+
return (e, t, n) => {
|
|
219
|
+
if (e === "") return [];
|
|
220
|
+
let r = [];
|
|
221
|
+
for (let i of e.split("\n")) {
|
|
222
|
+
let e = m(i);
|
|
223
|
+
if (e.length === 0) {
|
|
224
|
+
r.push("");
|
|
225
|
+
continue;
|
|
226
|
+
}
|
|
227
|
+
let a = [];
|
|
228
|
+
for (let i of e) {
|
|
229
|
+
if (a.length === 0 || n.measure(y(a) + i) <= t) {
|
|
230
|
+
a.push(i);
|
|
231
|
+
continue;
|
|
232
|
+
}
|
|
233
|
+
let e = w(a, i);
|
|
234
|
+
e.line.length > 0 && r.push(y(e.line)), a = e.rest;
|
|
235
|
+
}
|
|
236
|
+
a.length > 0 && r.push(y(a));
|
|
237
|
+
}
|
|
238
|
+
return r;
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
function w(e, t) {
|
|
242
|
+
let n = e, r = [t], i = T(e);
|
|
243
|
+
if (i !== -1) {
|
|
244
|
+
let a = +(e[i] === "-"), o = e.slice(0, i + a), s = e.slice(i + 1);
|
|
245
|
+
o.length > 0 && (n = o, r = [...s, t]);
|
|
246
|
+
}
|
|
247
|
+
return n = D(n), r = O(r), E(n, r);
|
|
248
|
+
}
|
|
249
|
+
function T(e) {
|
|
250
|
+
for (let t = e.length - 1; t > 0; t--) {
|
|
251
|
+
let n = e[t];
|
|
252
|
+
if (n === " " || n === "-") return t;
|
|
253
|
+
}
|
|
254
|
+
return -1;
|
|
255
|
+
}
|
|
256
|
+
function E(e, t) {
|
|
257
|
+
for (; t.length > 0 && x(t[0]);) e = [...e, t[0]], t = t.slice(1);
|
|
258
|
+
for (; e.length > 0 && S(e[e.length - 1]);) t = [e[e.length - 1], ...t], e = e.slice(0, -1);
|
|
259
|
+
return {
|
|
260
|
+
line: e,
|
|
261
|
+
rest: t
|
|
262
|
+
};
|
|
263
|
+
}
|
|
264
|
+
function D(e) {
|
|
265
|
+
for (; e.length > 0 && b(e[e.length - 1]);) e = e.slice(0, -1);
|
|
266
|
+
return e;
|
|
267
|
+
}
|
|
268
|
+
function O(e) {
|
|
269
|
+
for (; e.length > 0 && b(e[0]);) e = e.slice(1);
|
|
270
|
+
return e;
|
|
271
|
+
}
|
|
272
|
+
var k = C();
|
|
273
|
+
function A(e) {
|
|
274
|
+
return {
|
|
275
|
+
lineBreaker: e?.lineBreaker ?? k,
|
|
276
|
+
measurerFactory: e?.measurerFactory ?? v
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
function j(e) {
|
|
280
|
+
return e === 0 ? 0 : e;
|
|
281
|
+
}
|
|
282
|
+
function M(e) {
|
|
283
|
+
return j(Math.trunc(e));
|
|
284
|
+
}
|
|
285
|
+
function N(e, t) {
|
|
286
|
+
switch (e.type) {
|
|
287
|
+
case "TextLayer": {
|
|
288
|
+
if (!e.shape.autoWidth) return e.shape.width;
|
|
289
|
+
let { measurerFactory: n } = A(t), r = n(e.font, e.fontSize), i = 0;
|
|
290
|
+
for (let t of e.text.split("\n")) i = Math.max(i, r.measure(t));
|
|
291
|
+
return M(Math.ceil(i)) + M(e.shape.padding.left + e.shape.padding.right);
|
|
292
|
+
}
|
|
293
|
+
default: return e.shape.width;
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
function P(e) {
|
|
297
|
+
return Math.ceil(e.fontSize * e.shape.lineHeight);
|
|
298
|
+
}
|
|
299
|
+
function F(e, t) {
|
|
300
|
+
if (!e.autowrap) return [e.text];
|
|
301
|
+
let { lineBreaker: n, measurerFactory: r } = A(t);
|
|
302
|
+
return n(e.text, L(e, t), r(e.font, e.fontSize));
|
|
303
|
+
}
|
|
304
|
+
function I(e, t) {
|
|
305
|
+
switch (e.type) {
|
|
306
|
+
case "TextLayer": {
|
|
307
|
+
if (!e.shape.autoHeight) return e.shape.height;
|
|
308
|
+
let n = M(e.shape.padding.top + e.shape.padding.bottom);
|
|
309
|
+
return e.autowrap ? P(e) * F(e, t).length + n : e.text === "" ? n : P(e) + n;
|
|
310
|
+
}
|
|
311
|
+
case "QrCodeLayer": return !e.shape.autoHeight && e.shape.height > 0 ? e.shape.height : N(e, t);
|
|
312
|
+
default: return e.shape.height;
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
function L(e, t) {
|
|
316
|
+
return M(N(e, t) - e.shape.padding.left - e.shape.padding.right);
|
|
317
|
+
}
|
|
318
|
+
function R(e, t) {
|
|
319
|
+
return M(I(e, t) - e.shape.padding.top - e.shape.padding.bottom);
|
|
320
|
+
}
|
|
321
|
+
function z(e, t, n, r, i) {
|
|
322
|
+
return {
|
|
323
|
+
x: e === "top-right" || e === "right" || e === "bottom-right" ? t - r : e === "top" || e === "center" || e === "bottom" ? M((t - r) / 2) : 0,
|
|
324
|
+
y: e === "bottom-left" || e === "bottom" || e === "bottom-right" ? n - i : e === "left" || e === "center" || e === "right" ? M((n - i) / 2) : 0
|
|
325
|
+
};
|
|
326
|
+
}
|
|
327
|
+
function B(e, t, n, r, i, a) {
|
|
328
|
+
let o = N(e, a), s = I(e, a), c = z(e.position.anchor, r, i, o, s), l = t + c.x + e.position.x, u = n + c.y + e.position.y;
|
|
329
|
+
return {
|
|
330
|
+
x: l,
|
|
331
|
+
y: u,
|
|
332
|
+
width: o,
|
|
333
|
+
height: s,
|
|
334
|
+
contentX: l + e.shape.padding.left,
|
|
335
|
+
contentY: u + e.shape.padding.top,
|
|
336
|
+
contentWidth: L(e, a),
|
|
337
|
+
contentHeight: R(e, a)
|
|
338
|
+
};
|
|
339
|
+
}
|
|
340
|
+
//#endregion
|
|
341
|
+
export { L as a, o as c, r as d, n as f, R as i, a as l, l as n, B as o, t as p, u as r, s, c as t, i as u };
|
package/dist/index.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { _ as e, a as t, c as n, d as r, f as i, g as a, h as o, i as s, l as c, m as l, n as u, o as d, p as f, r as p, s as m, t as h, u as g } from "./canvas-
|
|
2
|
-
import {
|
|
3
|
-
import { a as
|
|
4
|
-
import {
|
|
5
|
-
import { i as
|
|
6
|
-
import { n as
|
|
7
|
-
import {
|
|
1
|
+
import { _ as e, a as t, c as n, d as r, f as i, g as a, h as o, i as s, l as c, m as l, n as u, o as d, p as f, r as p, s as m, t as h, u as g } from "./canvas-C70NSsoF.js";
|
|
2
|
+
import { a as _, i as v, n as y, r as b, t as x } from "./layer-panel-GiVy_B4A.js";
|
|
3
|
+
import { a as S, c as C, d as w, f as T, i as E, l as D, m as O, n as k, o as A, p as j, r as M, s as N, t as P, u as F } from "./property-panel-C2etsIhF.js";
|
|
4
|
+
import { i as I, n as L, r as R, t as z } from "./completionAnchor-CDR5YZhu.js";
|
|
5
|
+
import { c as B, i as V, n as H, s as U, t as W } from "./useTransientFeedback-CTjmMmFF.js";
|
|
6
|
+
import { i as G, n as K, r as q, t as J } from "./uploadFile-BOfv8aLG.js";
|
|
7
|
+
import { n as Y, t as X } from "./usePathCompletion-uJ5c_gQ0.js";
|
|
8
8
|
import { n as Z, t as Q } from "./useViewport-D9Ipevzs.js";
|
|
9
|
-
import { n as $, r as ee, t as te } from "./useDataSourceSchema-
|
|
10
|
-
import { n as ne, r as re, t as ie } from "./status-bar-
|
|
9
|
+
import { n as $, r as ee, t as te } from "./useDataSourceSchema-CGbldbUj.js";
|
|
10
|
+
import { n as ne, r as re, t as ie } from "./status-bar-_PvEXyq8.js";
|
|
11
11
|
import { t as ae } from "./useShortcutsHelp-CsyarO2P.js";
|
|
12
|
-
import { n as oe, r as se, t as ce } from "./shared-
|
|
12
|
+
import { n as oe, r as se, t as ce } from "./shared-wuupBoZg.js";
|
|
13
13
|
//#region src/index.ts
|
|
14
14
|
var le = "@hankchen/canvas-editor-vue";
|
|
15
15
|
//#endregion
|
|
16
|
-
export {
|
|
16
|
+
export { v as ADD_LAYER_MENU, _ as ADD_MENU, V as ARM_LAYER_CREATE_HINT, e as AlignFloatBar, D as CANVAS_FIELD_SECTIONS, n as CanvasSurface, f as ContentTypePill, a as ContextMenu, $ as DropdownMenu, R as ExpressionCompletionPopup, F as FIELD_SECTIONS_BY_TYPE, N as FONT_PICKER_KEY, l as FindBar, m as GuidesOverlay, se as HelpDialog, S as IMAGE_UPLOAD_KEY, x as LayerPanel, le as PACKAGE_NAME, I as PanelIcon, k as PropertyField, P as PropertyPanel, d as Ruler, ie as StatusBar, c as TextEditingOverlay, L as applyCompletion, E as controlRegistry, u as createGizmoOverlayPainter, h as createRafScheduler, U as detectShortcutPlatform, t as drawCreateRubberBand, s as drawFindMatches, p as drawSelectionGizmo, q as expressionCompletionSource, G as expressionFieldContext, w as fieldSectionsForPath, T as fieldSectionsForType, ne as formatLayerGeometry, re as formatLayerPath, C as injectFontPicker, A as injectImageUpload, H as isEditableEventTarget, y as isUpperHalf, j as layerRoleAt, z as measureCursorAnchor, O as readField, Y as rowsPathCompletionSource, B as shortcutActionLabel, J as uploadFileFromDom, te as useDataSourceSchema, r as useDpr, ee as useDropdownMenu, K as useExpressionCompletion, o as useFindSession, oe as useHistory, b as useLayerPanel, X as usePathCompletion, M as usePropertyPanel, Z as useSelection, ce as useShortcuts, ae as useShortcutsHelp, g as useTextEditing, W as useTransientFeedback, Q as useViewport, i as watchDprChanges };
|