@hankchen/canvas-editor-vue 0.1.0 → 0.1.2

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.
@@ -1,96 +0,0 @@
1
- import { S as e, x as t } from "./layerPath-BRZK9ka1.js";
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 e(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: e, iconNode: n, "icon-node": r, icon: i = {
63
- name: e && c(e),
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 t("svg", j, [...M.map(([e, n]) => t(e, 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(e, n = []) {
86
- let r = typeof e == "string" ? {
87
- name: e,
88
- node: n
89
- } : e;
90
- return (e, { slots: n }) => t(d, {
91
- ...e,
92
- icon: r
93
- }, n.default ? { default: n.default } : void 0);
94
- }
95
- //#endregion
96
- export { f as t };
@@ -1,341 +0,0 @@
1
- import { t as e } from "./createLucideIcon-CMq8ZKo2.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 };