@vincentt-xr/sdk 2.0.0-alpha.11 → 2.0.0-alpha.12
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/GROUNDING.md +12 -7
- package/dist/{TextLabel-Dgt-uNN9.js → TextLabel-C6F5xoaz.js} +243 -264
- package/dist/TextLabel-ChZCoB3P.cjs +2 -0
- package/dist/components/ScreenImage/ScreenImage.d.ts +1 -1
- package/dist/components/ScreenShape/index.d.ts +1 -1
- package/dist/debug-ui.cjs +1 -1
- package/dist/debug-ui.js +2 -2
- package/dist/{index-WkEZBuB4.js → index-BaNlidsb.js} +276 -270
- package/dist/index-BzGLgXJm.cjs +46 -0
- package/dist/index-Cm3v6Dlg.cjs +21 -0
- package/dist/{index-CXaj3tOT.js → index-bL819L-K.js} +345 -338
- package/dist/instructions.cjs +1 -1
- package/dist/instructions.js +1 -1
- package/dist/main.cjs +1 -1
- package/dist/main.js +4 -4
- package/dist/scene-object.cjs +1 -1
- package/dist/scene-object.js +1 -1
- package/dist/useEditOverrides-BTkPGVjN.js +38 -0
- package/dist/useEditOverrides-C3ZVXuIH.cjs +1 -0
- package/dist/utils/useEditOverrides.d.ts +9 -2
- package/package.json +1 -1
- package/settings.json +1 -1
- package/dist/TextLabel-Ctp-a7g9.cjs +0 -2
- package/dist/index-Bxb_UcfF.cjs +0 -46
- package/dist/index-CYwAL_d7.cjs +0 -21
|
@@ -1,39 +1,19 @@
|
|
|
1
|
-
import { jsx as z, jsxs as
|
|
2
|
-
import { useMemo as B,
|
|
3
|
-
import { useThree as
|
|
1
|
+
import { jsx as z, jsxs as Te } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as B, forwardRef as xe, useEffect as be, useState as he, useRef as J } from "react";
|
|
3
|
+
import { useThree as Ce } from "@react-three/fiber";
|
|
4
4
|
import { b as Fe } from "./context-DTxSQvp4.js";
|
|
5
|
+
import { u as Le } from "./useEditOverrides-BTkPGVjN.js";
|
|
5
6
|
import * as We from "three";
|
|
6
|
-
const
|
|
7
|
-
const { camera: n, size: i } =
|
|
7
|
+
const et = ({ children: t, depth: e = 0 }) => {
|
|
8
|
+
const { camera: n, size: i } = Ce(), a = B(() => {
|
|
8
9
|
if (!n.isPerspectiveCamera)
|
|
9
10
|
return { width: 10, height: 10 };
|
|
10
11
|
const r = n, l = Math.abs(r.position.z - e), f = r.fov * Math.PI / 180, s = 2 * Math.tan(f / 2) * l;
|
|
11
12
|
return { width: s * (i.width / i.height), height: s };
|
|
12
13
|
}, [n, i, e]);
|
|
13
14
|
return /* @__PURE__ */ z(Fe.Provider, { value: a, children: /* @__PURE__ */ z("group", { position: [0, 0, e], children: t }) });
|
|
14
|
-
},
|
|
15
|
-
|
|
16
|
-
const t = globalThis[Ye];
|
|
17
|
-
return t && typeof t.subscribe == "function" && typeof t.version == "function" && typeof t.get == "function" ? t : void 0;
|
|
18
|
-
}
|
|
19
|
-
const Pe = () => () => {
|
|
20
|
-
}, ce = () => 0;
|
|
21
|
-
function He(t, e) {
|
|
22
|
-
const n = ke();
|
|
23
|
-
if (Ce(
|
|
24
|
-
n ? n.subscribe : Pe,
|
|
25
|
-
n ? n.version : ce,
|
|
26
|
-
ce
|
|
27
|
-
), !n) return t;
|
|
28
|
-
const i = n.get(t);
|
|
29
|
-
if (!i) return t;
|
|
30
|
-
let a = null;
|
|
31
|
-
for (const r of e)
|
|
32
|
-
Object.prototype.hasOwnProperty.call(i, r) && (a ?? (a = { ...t }), a[r] = i[r]);
|
|
33
|
-
return a ?? t;
|
|
34
|
-
}
|
|
35
|
-
const Se = Le(
|
|
36
|
-
({ texture: t, name: e, overlay: n, opacity: i, position: a, rotation: r, scale: l, visible: f, renderOrder: s }, h) => /* @__PURE__ */ xe(
|
|
15
|
+
}, me = xe(
|
|
16
|
+
({ texture: t, name: e, overlay: n, opacity: i, position: a, rotation: r, scale: l, visible: f, renderOrder: s }, h) => /* @__PURE__ */ Te(
|
|
37
17
|
"mesh",
|
|
38
18
|
{
|
|
39
19
|
ref: h,
|
|
@@ -59,8 +39,8 @@ const Se = Le(
|
|
|
59
39
|
}
|
|
60
40
|
)
|
|
61
41
|
);
|
|
62
|
-
|
|
63
|
-
const
|
|
42
|
+
me.displayName = "TextLabelMesh";
|
|
43
|
+
const Oe = {
|
|
64
44
|
color: "#ffffff",
|
|
65
45
|
strokeWidth: 0,
|
|
66
46
|
strokeOpacity: 1,
|
|
@@ -94,24 +74,24 @@ const Xe = {
|
|
|
94
74
|
strikethrough: !1,
|
|
95
75
|
bendPreset: "arc",
|
|
96
76
|
bendStrength: 0
|
|
97
|
-
},
|
|
98
|
-
|
|
77
|
+
}, Ye = (t) => {
|
|
78
|
+
be(
|
|
99
79
|
() => () => {
|
|
100
80
|
t == null || t.dispose();
|
|
101
81
|
},
|
|
102
82
|
[t]
|
|
103
83
|
);
|
|
104
84
|
};
|
|
105
|
-
function
|
|
85
|
+
function ke(t, e, n) {
|
|
106
86
|
return n === "left" ? e : n === "right" ? t - e : t / 2;
|
|
107
87
|
}
|
|
108
|
-
function
|
|
88
|
+
function Pe(t, e, n, i, a) {
|
|
109
89
|
return a === "top" ? e + n / 2 : a === "bottom" ? t - e - i + n / 2 : t / 2 - (i - n) / 2;
|
|
110
90
|
}
|
|
111
|
-
function
|
|
91
|
+
function He(t, e, n, i) {
|
|
112
92
|
return i === "full" || n === "left" ? 0 : n === "right" ? t - e : (t - e) / 2;
|
|
113
93
|
}
|
|
114
|
-
function
|
|
94
|
+
function Se(t, e, n, i) {
|
|
115
95
|
return `${t} ${e} ${n}px ${i}`;
|
|
116
96
|
}
|
|
117
97
|
function I(t, e) {
|
|
@@ -122,30 +102,30 @@ function we(t, e) {
|
|
|
122
102
|
const n = Math.max(0, Math.min(e, 1));
|
|
123
103
|
return t * (1.2 + n * 0.6);
|
|
124
104
|
}
|
|
125
|
-
function
|
|
105
|
+
function ye(t, e) {
|
|
126
106
|
"letterSpacing" in t && (t.letterSpacing = `${e}px`);
|
|
127
107
|
}
|
|
128
|
-
function
|
|
108
|
+
function ve(t) {
|
|
129
109
|
"letterSpacing" in t && (t.letterSpacing = "0px");
|
|
130
110
|
}
|
|
131
111
|
function H(t, e, n) {
|
|
132
|
-
|
|
112
|
+
ye(t, n);
|
|
133
113
|
const i = t.measureText(e).width;
|
|
134
|
-
return
|
|
114
|
+
return ve(t), i;
|
|
135
115
|
}
|
|
136
|
-
function
|
|
116
|
+
function V(t, e, n, i) {
|
|
137
117
|
return Math.max(1, Math.floor((t - e * 2) / we(n, i)));
|
|
138
118
|
}
|
|
139
|
-
function
|
|
119
|
+
function Xe(t, e, n, i, a) {
|
|
140
120
|
return e.length <= i && e.every((r) => H(t, r, a) <= n);
|
|
141
121
|
}
|
|
142
122
|
function K(t, e, n, i, a, r, l, f) {
|
|
143
|
-
t.font =
|
|
123
|
+
t.font = Se(i, a, r, l);
|
|
144
124
|
const s = e.split(" "), h = [];
|
|
145
125
|
let o = "";
|
|
146
126
|
for (const d of s) {
|
|
147
|
-
const
|
|
148
|
-
H(t,
|
|
127
|
+
const g = o ? `${o} ${d}` : d;
|
|
128
|
+
H(t, g, f) > n && o ? (h.push(o), o = d) : o = g;
|
|
149
129
|
}
|
|
150
130
|
return o && h.push(o), h;
|
|
151
131
|
}
|
|
@@ -182,7 +162,7 @@ function Q(t, e, n, i, a) {
|
|
|
182
162
|
);
|
|
183
163
|
});
|
|
184
164
|
}
|
|
185
|
-
function
|
|
165
|
+
function ce(t, e, n, i, a, r) {
|
|
186
166
|
if (e.length <= n)
|
|
187
167
|
return Q(
|
|
188
168
|
t,
|
|
@@ -206,7 +186,7 @@ function de(t, e, n, i, a, r) {
|
|
|
206
186
|
r
|
|
207
187
|
);
|
|
208
188
|
}
|
|
209
|
-
function
|
|
189
|
+
function pe(t) {
|
|
210
190
|
const {
|
|
211
191
|
ctx: e,
|
|
212
192
|
text: n,
|
|
@@ -219,12 +199,12 @@ function Ee(t) {
|
|
|
219
199
|
fontSize: h,
|
|
220
200
|
fontFamily: o,
|
|
221
201
|
letterSpacing: d,
|
|
222
|
-
lineSpacing:
|
|
202
|
+
lineSpacing: g,
|
|
223
203
|
overflow: u,
|
|
224
204
|
resizeToFit: S,
|
|
225
|
-
minFontSize:
|
|
205
|
+
minFontSize: c
|
|
226
206
|
} = t;
|
|
227
|
-
let b = h, m = I(b, d),
|
|
207
|
+
let b = h, m = I(b, d), w = i ?? ge(
|
|
228
208
|
e,
|
|
229
209
|
n,
|
|
230
210
|
a,
|
|
@@ -233,9 +213,9 @@ function Ee(t) {
|
|
|
233
213
|
b,
|
|
234
214
|
o,
|
|
235
215
|
m
|
|
236
|
-
), v =
|
|
216
|
+
), v = V(r, l, b, g);
|
|
237
217
|
const C = S === !0 || u === "shrink";
|
|
238
|
-
for (; C && !
|
|
218
|
+
for (; C && !Xe(e, w, a, v, m) && b > c && (b = Math.max(c, b - 4), m = I(b, d), w = i ?? ge(
|
|
239
219
|
e,
|
|
240
220
|
n,
|
|
241
221
|
a,
|
|
@@ -244,25 +224,25 @@ function Ee(t) {
|
|
|
244
224
|
b,
|
|
245
225
|
o,
|
|
246
226
|
m
|
|
247
|
-
), v =
|
|
227
|
+
), v = V(r, l, b, g), b !== c); )
|
|
248
228
|
;
|
|
249
|
-
return u === "ellipsis" ?
|
|
229
|
+
return u === "ellipsis" ? w = ce(
|
|
250
230
|
e,
|
|
251
|
-
|
|
231
|
+
w,
|
|
252
232
|
v,
|
|
253
233
|
a,
|
|
254
234
|
!0,
|
|
255
235
|
m
|
|
256
|
-
) : u === "clamp" || u === "shrink" ?
|
|
236
|
+
) : u === "clamp" || u === "shrink" ? w = ce(
|
|
257
237
|
e,
|
|
258
|
-
|
|
238
|
+
w,
|
|
259
239
|
v,
|
|
260
240
|
a,
|
|
261
241
|
!1,
|
|
262
242
|
m
|
|
263
|
-
) : u !== "clip" && (
|
|
243
|
+
) : u !== "clip" && (w = Q(e, w, a, void 0, m)), { fontSize: b, lines: w };
|
|
264
244
|
}
|
|
265
|
-
function
|
|
245
|
+
function Ae(t) {
|
|
266
246
|
const {
|
|
267
247
|
ctx: e,
|
|
268
248
|
text: n,
|
|
@@ -276,27 +256,27 @@ function Re(t) {
|
|
|
276
256
|
letterSpacing: o,
|
|
277
257
|
lineSpacing: d
|
|
278
258
|
} = t;
|
|
279
|
-
let
|
|
259
|
+
let g = s, u = K(
|
|
280
260
|
e,
|
|
281
261
|
n,
|
|
282
262
|
i,
|
|
283
263
|
l,
|
|
284
264
|
f,
|
|
285
|
-
|
|
265
|
+
g,
|
|
286
266
|
h,
|
|
287
|
-
I(
|
|
267
|
+
I(g, o)
|
|
288
268
|
);
|
|
289
|
-
const S =
|
|
290
|
-
return u.length > S && (
|
|
269
|
+
const S = V(a, r, g, d);
|
|
270
|
+
return u.length > S && (g = Math.max(12, Math.round(g * 0.75)), u = K(
|
|
291
271
|
e,
|
|
292
272
|
n,
|
|
293
273
|
i,
|
|
294
274
|
l,
|
|
295
275
|
f,
|
|
296
|
-
|
|
276
|
+
g,
|
|
297
277
|
h,
|
|
298
|
-
I(
|
|
299
|
-
)), { fontSize:
|
|
278
|
+
I(g, o)
|
|
279
|
+
)), { fontSize: g, lines: u };
|
|
300
280
|
}
|
|
301
281
|
function Z(t, e) {
|
|
302
282
|
return typeof OffscreenCanvas < "u" ? new OffscreenCanvas(t, e) : (() => {
|
|
@@ -304,9 +284,9 @@ function Z(t, e) {
|
|
|
304
284
|
return n.width = t, n.height = e, n;
|
|
305
285
|
})();
|
|
306
286
|
}
|
|
307
|
-
function
|
|
287
|
+
function Be(t, e) {
|
|
308
288
|
const n = e.width - e.padding * 2, a = Array.isArray(e.lines) || e.text.includes(`
|
|
309
|
-
`) || e.overflow !== void 0 || e.resizeToFit !== void 0 ?
|
|
289
|
+
`) || e.overflow !== void 0 || e.resizeToFit !== void 0 ? pe({
|
|
310
290
|
ctx: t,
|
|
311
291
|
text: e.text,
|
|
312
292
|
explicitLines: e.lines,
|
|
@@ -322,7 +302,7 @@ function De(t, e) {
|
|
|
322
302
|
minFontSize: e.minFontSize,
|
|
323
303
|
letterSpacing: e.letterSpacing,
|
|
324
304
|
lineSpacing: e.lineSpacing
|
|
325
|
-
}) :
|
|
305
|
+
}) : Ae({
|
|
326
306
|
ctx: t,
|
|
327
307
|
text: e.text,
|
|
328
308
|
maxWidth: n,
|
|
@@ -335,18 +315,18 @@ function De(t, e) {
|
|
|
335
315
|
letterSpacing: e.letterSpacing,
|
|
336
316
|
lineSpacing: e.lineSpacing
|
|
337
317
|
}), r = a.fontSize, l = a.lines;
|
|
338
|
-
t.font =
|
|
318
|
+
t.font = Se(e.fontStyle, e.fontWeight, r, e.fontFamily);
|
|
339
319
|
const f = I(r, e.letterSpacing), s = we(r, e.lineSpacing), h = Math.max(
|
|
340
320
|
r,
|
|
341
321
|
r + (l.length - 1) * s
|
|
342
|
-
), o =
|
|
322
|
+
), o = Pe(
|
|
343
323
|
e.height,
|
|
344
324
|
e.padding,
|
|
345
325
|
r,
|
|
346
326
|
h,
|
|
347
327
|
e.verticalAlign
|
|
348
328
|
), d = l.map(
|
|
349
|
-
(
|
|
329
|
+
(g) => H(t, g, f)
|
|
350
330
|
);
|
|
351
331
|
return {
|
|
352
332
|
fontSize: r,
|
|
@@ -359,23 +339,23 @@ function De(t, e) {
|
|
|
359
339
|
Math.max(0, Math.max(...d, 0)) + e.padding * 2
|
|
360
340
|
),
|
|
361
341
|
textBlockHeight: Math.min(e.height, h + e.padding * 2),
|
|
362
|
-
textX:
|
|
342
|
+
textX: ke(e.width, e.padding, e.textAlign)
|
|
363
343
|
};
|
|
364
344
|
}
|
|
365
|
-
function
|
|
345
|
+
function ze(t, e, n, i, a, r) {
|
|
366
346
|
t.beginPath(), t.moveTo(e + r, n), t.lineTo(e + i - r, n), t.quadraticCurveTo(e + i, n, e + i, n + r), t.lineTo(e + i, n + a - r), t.quadraticCurveTo(e + i, n + a, e + i - r, n + a), t.lineTo(e + r, n + a), t.quadraticCurveTo(e, n + a, e, n + a - r), t.lineTo(e, n + r), t.quadraticCurveTo(e, n, e + r, n), t.closePath();
|
|
367
347
|
}
|
|
368
|
-
function
|
|
348
|
+
function de(t, e, n) {
|
|
369
349
|
return typeof t != "number" || Number.isNaN(t) || t <= 0 ? e : Math.min(t, n);
|
|
370
350
|
}
|
|
371
|
-
function
|
|
372
|
-
const n =
|
|
351
|
+
function Ie(t, e) {
|
|
352
|
+
const n = He(
|
|
373
353
|
e.canvasWidth,
|
|
374
354
|
e.panelWidth,
|
|
375
355
|
e.textAlign,
|
|
376
356
|
e.bgFit
|
|
377
357
|
), i = (e.canvasHeight - e.panelHeight) / 2, a = Math.min(e.borderRadius, Math.min(e.panelWidth, e.panelHeight) / 2);
|
|
378
|
-
|
|
358
|
+
ze(t, n, i, e.panelWidth, e.panelHeight, a), Re(t, {
|
|
379
359
|
panelX: n,
|
|
380
360
|
panelY: i,
|
|
381
361
|
panelWidth: e.panelWidth,
|
|
@@ -390,7 +370,7 @@ function $e(t, e) {
|
|
|
390
370
|
bgTextureFlipY: e.bgTextureFlipY
|
|
391
371
|
}), e.borderColor && e.borderWidth > 0 && (t.lineWidth = e.borderWidth, t.strokeStyle = e.borderColor, t.stroke());
|
|
392
372
|
}
|
|
393
|
-
function
|
|
373
|
+
function Re(t, e) {
|
|
394
374
|
if (t.save(), t.globalAlpha = Math.max(0, Math.min(e.bgOpacity, 1)), e.bgFillMode === "gradient" && e.bgGradientStops && e.bgGradientStops.length > 1) {
|
|
395
375
|
const n = t.createLinearGradient(
|
|
396
376
|
e.panelX,
|
|
@@ -404,7 +384,7 @@ function _e(t, e) {
|
|
|
404
384
|
return;
|
|
405
385
|
}
|
|
406
386
|
if (e.bgTextureImage) {
|
|
407
|
-
t.clip(),
|
|
387
|
+
t.clip(), Ee(t, {
|
|
408
388
|
image: e.bgTextureImage,
|
|
409
389
|
x: e.panelX,
|
|
410
390
|
y: e.panelY,
|
|
@@ -418,17 +398,17 @@ function _e(t, e) {
|
|
|
418
398
|
}
|
|
419
399
|
t.fillStyle = e.bgColor, t.fill(), t.restore();
|
|
420
400
|
}
|
|
421
|
-
function
|
|
401
|
+
function Ee(t, e) {
|
|
422
402
|
const { image: n, x: i, y: a, width: r, height: l, fit: f, flipX: s, flipY: h } = e, o = "naturalWidth" in n ? n.naturalWidth : "videoWidth" in n ? n.videoWidth : n.width, d = "naturalHeight" in n ? n.naturalHeight : "videoHeight" in n ? n.videoHeight : n.height;
|
|
423
|
-
let
|
|
403
|
+
let g = r, u = l, S = i, c = a;
|
|
424
404
|
if (f !== "stretch" && o > 0 && d > 0) {
|
|
425
405
|
const b = f === "cover" ? Math.max(r / o, l / d) : Math.min(r / o, l / d);
|
|
426
|
-
|
|
406
|
+
g = o * b, u = d * b, S = i + (r - g) / 2, c = a + (l - u) / 2;
|
|
427
407
|
}
|
|
428
|
-
t.save(), (s || h) && (t.translate(s ? i + r : 0, h ? a + l : 0), t.scale(s ? -1 : 1, h ? -1 : 1), S = s ? -(S - i) -
|
|
408
|
+
t.save(), (s || h) && (t.translate(s ? i + r : 0, h ? a + l : 0), t.scale(s ? -1 : 1, h ? -1 : 1), S = s ? -(S - i) - g + i : S, c = h ? -(c - a) - u + a : c), t.drawImage(n, S, c, g, u), t.restore();
|
|
429
409
|
}
|
|
430
|
-
function
|
|
431
|
-
const l = a / 72, f = Math.abs(l), s = 1 - Math.min(1, Math.abs(e)), h = Math.min(1, Math.abs(e)), o = i <= 1 ? 0.5 : n / (i - 1), d = Math.sin(o * Math.PI * 2 - Math.PI / 2),
|
|
410
|
+
function $e(t, e, n, i, a, r) {
|
|
411
|
+
const l = a / 72, f = Math.abs(l), s = 1 - Math.min(1, Math.abs(e)), h = Math.min(1, Math.abs(e)), o = i <= 1 ? 0.5 : n / (i - 1), d = Math.sin(o * Math.PI * 2 - Math.PI / 2), g = Math.sin(o * Math.PI * 2.7 - Math.PI / 2) * (0.65 + o * 0.35), u = a * e * e, S = 2 * a * e / r, c = {
|
|
432
412
|
xOffset: 0,
|
|
433
413
|
yOffset: 0,
|
|
434
414
|
rotation: 0,
|
|
@@ -437,112 +417,112 @@ function Ve(t, e, n, i, a, r) {
|
|
|
437
417
|
};
|
|
438
418
|
switch (t) {
|
|
439
419
|
case "arc":
|
|
440
|
-
return { ...
|
|
420
|
+
return { ...c, yOffset: u, rotation: Math.atan(S) };
|
|
441
421
|
case "arc-lower":
|
|
442
422
|
return {
|
|
443
|
-
...
|
|
423
|
+
...c,
|
|
444
424
|
yOffset: u * 0.55,
|
|
445
425
|
scaleY: Math.max(0.2, 1 + l * e * e * 0.45)
|
|
446
426
|
};
|
|
447
427
|
case "arc-upper":
|
|
448
428
|
return {
|
|
449
|
-
...
|
|
429
|
+
...c,
|
|
450
430
|
yOffset: -u * 0.55,
|
|
451
431
|
scaleY: Math.max(0.2, 1 - l * e * e * 0.45)
|
|
452
432
|
};
|
|
453
433
|
case "arch":
|
|
454
|
-
return { ...
|
|
434
|
+
return { ...c, yOffset: u };
|
|
455
435
|
case "bulge":
|
|
456
|
-
return { ...
|
|
436
|
+
return { ...c, scaleY: Math.max(0.2, 1 + l * s * 0.75) };
|
|
457
437
|
case "shell-lower":
|
|
458
438
|
return {
|
|
459
|
-
...
|
|
439
|
+
...c,
|
|
460
440
|
yOffset: a * 0.45 * o * s,
|
|
461
441
|
scaleY: Math.max(0.2, 1 + l * o * s)
|
|
462
442
|
};
|
|
463
443
|
case "shell-upper":
|
|
464
444
|
return {
|
|
465
|
-
...
|
|
445
|
+
...c,
|
|
466
446
|
yOffset: -a * 0.45 * (1 - o) * s,
|
|
467
447
|
scaleY: Math.max(0.2, 1 + l * (1 - o) * s)
|
|
468
448
|
};
|
|
469
449
|
case "flag":
|
|
470
450
|
return {
|
|
471
|
-
...
|
|
472
|
-
yOffset: a * 0.65 *
|
|
451
|
+
...c,
|
|
452
|
+
yOffset: a * 0.65 * g,
|
|
473
453
|
rotation: Math.atan(
|
|
474
454
|
a / Math.max(r, 1) * Math.cos(o * Math.PI * 2.7) * 1.6
|
|
475
455
|
)
|
|
476
456
|
};
|
|
477
457
|
case "wave":
|
|
478
458
|
return {
|
|
479
|
-
...
|
|
459
|
+
...c,
|
|
480
460
|
yOffset: a * 0.6 * d,
|
|
481
461
|
rotation: Math.atan(a / Math.max(r, 1) * Math.cos(o * Math.PI * 2) * 1.4)
|
|
482
462
|
};
|
|
483
463
|
case "fish":
|
|
484
464
|
return {
|
|
485
|
-
...
|
|
465
|
+
...c,
|
|
486
466
|
scaleX: Math.max(0.25, 1 - f * h * 0.55),
|
|
487
467
|
scaleY: Math.max(0.2, 1 + l * s)
|
|
488
468
|
};
|
|
489
469
|
case "rise":
|
|
490
|
-
return { ...
|
|
470
|
+
return { ...c, yOffset: a * e };
|
|
491
471
|
case "fisheye":
|
|
492
472
|
return {
|
|
493
|
-
...
|
|
473
|
+
...c,
|
|
494
474
|
yOffset: a * 0.18 * e * s,
|
|
495
475
|
scaleX: Math.max(0.25, 1 + l * s * 0.7),
|
|
496
476
|
scaleY: Math.max(0.2, 1 + l * s * 0.7)
|
|
497
477
|
};
|
|
498
478
|
case "inflate":
|
|
499
479
|
return {
|
|
500
|
-
...
|
|
480
|
+
...c,
|
|
501
481
|
scaleX: Math.max(0.25, 1 + l * s * 0.6),
|
|
502
482
|
scaleY: Math.max(0.2, 1 + l * s * 0.6)
|
|
503
483
|
};
|
|
504
484
|
case "squeeze":
|
|
505
|
-
return { ...
|
|
485
|
+
return { ...c, scaleY: Math.max(0.2, 1 - l * s * 0.8) };
|
|
506
486
|
case "twist":
|
|
507
487
|
return {
|
|
508
|
-
...
|
|
488
|
+
...c,
|
|
509
489
|
yOffset: a * e,
|
|
510
490
|
rotation: l * e * 0.45,
|
|
511
491
|
scaleY: Math.max(0.2, 1 + l * e * 0.25)
|
|
512
492
|
};
|
|
513
493
|
default:
|
|
514
|
-
return
|
|
494
|
+
return c;
|
|
515
495
|
}
|
|
516
496
|
}
|
|
517
497
|
function P(t, e, n, i, a, r, l = "arc", f = 0) {
|
|
518
498
|
if (f !== 0) {
|
|
519
|
-
|
|
499
|
+
Ge(t, e, n, i, a, r, l, f);
|
|
520
500
|
return;
|
|
521
501
|
}
|
|
522
|
-
|
|
502
|
+
ye(t, a), r === "fill" ? t.fillText(e, n, i) : t.strokeText(e, n, i), ve(t);
|
|
523
503
|
}
|
|
524
|
-
function
|
|
504
|
+
function Ge(t, e, n, i, a, r, l, f) {
|
|
525
505
|
const s = Array.from(e);
|
|
526
506
|
if (s.length === 0) return;
|
|
527
|
-
const h = s.map((m) => t.measureText(m).width), o = h.reduce((m,
|
|
528
|
-
let b =
|
|
507
|
+
const h = s.map((m) => t.measureText(m).width), o = h.reduce((m, w) => m + w, 0) + a * Math.max(0, s.length - 1), d = t.textAlign, g = d === "right" ? n - o : d === "center" ? n - o / 2 : n, S = Math.max(-100, Math.min(f, 100)) / 100 * 72, c = Math.max(o / 2, 1);
|
|
508
|
+
let b = g;
|
|
529
509
|
for (let m = 0; m < s.length; m++) {
|
|
530
|
-
const
|
|
510
|
+
const w = s[m], v = h[m], C = b + v / 2, W = (C - g - o / 2) / c, x = $e(
|
|
531
511
|
l,
|
|
532
|
-
|
|
512
|
+
W,
|
|
533
513
|
m,
|
|
534
514
|
s.length,
|
|
535
515
|
S,
|
|
536
|
-
|
|
516
|
+
c
|
|
537
517
|
);
|
|
538
|
-
t.save(), t.translate(C + x.xOffset, i + x.yOffset), t.rotate(x.rotation), t.scale(x.scaleX, x.scaleY), t.textAlign = "center", r === "fill" ? t.fillText(
|
|
518
|
+
t.save(), t.translate(C + x.xOffset, i + x.yOffset), t.rotate(x.rotation), t.scale(x.scaleX, x.scaleY), t.textAlign = "center", r === "fill" ? t.fillText(w, 0, 0) : t.strokeText(w, 0, 0), t.restore(), b += v + a;
|
|
539
519
|
}
|
|
540
520
|
}
|
|
541
|
-
function
|
|
542
|
-
const h = H(t, e, f), o = a === "center" ? n - h / 2 : a === "right" ? n - h : n, d = s === "underline" ? l * 0.42 : -l * 0.08,
|
|
543
|
-
t.save(), t.strokeStyle = r, t.lineWidth = Math.max(2, l * 0.06), t.lineCap = "round", t.beginPath(), t.moveTo(o,
|
|
521
|
+
function ue(t, e, n, i, a, r, l, f, s) {
|
|
522
|
+
const h = H(t, e, f), o = a === "center" ? n - h / 2 : a === "right" ? n - h : n, d = s === "underline" ? l * 0.42 : -l * 0.08, g = i + d;
|
|
523
|
+
t.save(), t.strokeStyle = r, t.lineWidth = Math.max(2, l * 0.06), t.lineCap = "round", t.beginPath(), t.moveTo(o, g), t.lineTo(o + h, g), t.stroke(), t.restore();
|
|
544
524
|
}
|
|
545
|
-
function
|
|
525
|
+
function De(t, e) {
|
|
546
526
|
for (let n = 0; n < e.lines.length; n++) {
|
|
547
527
|
const i = e.lines[n], a = e.startY + n * e.lineHeight;
|
|
548
528
|
for (const r of e.shadowLayers)
|
|
@@ -576,7 +556,7 @@ function je(t, e) {
|
|
|
576
556
|
"fill",
|
|
577
557
|
e.bendPreset,
|
|
578
558
|
e.bendStrength
|
|
579
|
-
), t.restore(), e.underline &&
|
|
559
|
+
), t.restore(), e.underline && ue(
|
|
580
560
|
t,
|
|
581
561
|
i,
|
|
582
562
|
e.textX,
|
|
@@ -586,7 +566,7 @@ function je(t, e) {
|
|
|
586
566
|
e.fontSize,
|
|
587
567
|
e.letterSpacingPx,
|
|
588
568
|
"underline"
|
|
589
|
-
), e.strikethrough &&
|
|
569
|
+
), e.strikethrough && ue(
|
|
590
570
|
t,
|
|
591
571
|
i,
|
|
592
572
|
e.textX,
|
|
@@ -599,7 +579,7 @@ function je(t, e) {
|
|
|
599
579
|
);
|
|
600
580
|
}
|
|
601
581
|
}
|
|
602
|
-
function
|
|
582
|
+
function qe(t, e) {
|
|
603
583
|
const n = Math.max(0, Math.min(e.intensity, 1));
|
|
604
584
|
if (n <= 0) return;
|
|
605
585
|
const i = Math.max(0, Math.min(e.range, 1)), a = i * 72, r = Math.max(-0.5, Math.min(e.horizontalAngle, 0.5)) * 80, l = Math.max(-0.5, Math.min(e.verticalAngle, 0.5)) * 80;
|
|
@@ -626,7 +606,7 @@ function Ue(t, e) {
|
|
|
626
606
|
)), t.restore();
|
|
627
607
|
}
|
|
628
608
|
}
|
|
629
|
-
function
|
|
609
|
+
function Ne(t, e) {
|
|
630
610
|
const n = Z(e.width, e.height), i = n.getContext("2d");
|
|
631
611
|
i.clearRect(0, 0, e.width, e.height), i.font = e.font, i.fillStyle = "#ffffff", i.textAlign = e.textAlign, i.textBaseline = "middle";
|
|
632
612
|
for (let l = 0; l < e.lines.length; l++)
|
|
@@ -643,7 +623,7 @@ function Je(t, e) {
|
|
|
643
623
|
const a = Z(e.width, e.height), r = a.getContext("2d");
|
|
644
624
|
r.clearRect(0, 0, e.width, e.height), r.save(), r.globalAlpha = e.opacity, r.filter = e.blur > 0 ? `blur(${e.blur}px)` : "none", r.drawImage(n, e.offsetX, e.offsetY), r.restore(), r.globalCompositeOperation = "destination-in", r.drawImage(n, 0, 0), r.globalCompositeOperation = "source-in", r.globalAlpha = e.opacity, r.fillStyle = e.color, r.fillRect(0, 0, e.width, e.height), t.drawImage(a, 0, 0);
|
|
645
625
|
}
|
|
646
|
-
function
|
|
626
|
+
function Ue(t) {
|
|
647
627
|
const {
|
|
648
628
|
width: e,
|
|
649
629
|
height: n,
|
|
@@ -656,84 +636,84 @@ function Ke(t) {
|
|
|
656
636
|
innerShadow: h,
|
|
657
637
|
glow: o,
|
|
658
638
|
shadowColor: d,
|
|
659
|
-
shadowBlur:
|
|
639
|
+
shadowBlur: g,
|
|
660
640
|
shadowOffsetX: u,
|
|
661
641
|
shadowOffsetY: S,
|
|
662
|
-
shadowOpacity:
|
|
642
|
+
shadowOpacity: c,
|
|
663
643
|
textAlign: b,
|
|
664
644
|
bgFillMode: m,
|
|
665
|
-
bgOpacity:
|
|
645
|
+
bgOpacity: w,
|
|
666
646
|
bgFit: v,
|
|
667
647
|
bgAutoSize: C,
|
|
668
|
-
bgWidth:
|
|
648
|
+
bgWidth: W,
|
|
669
649
|
bgHeight: x,
|
|
670
|
-
bgGradientStops:
|
|
671
|
-
bgTextureImage:
|
|
672
|
-
bgTextureFit:
|
|
673
|
-
bgTextureFlipX:
|
|
674
|
-
bgTextureFlipY:
|
|
650
|
+
bgGradientStops: F,
|
|
651
|
+
bgTextureImage: L,
|
|
652
|
+
bgTextureFit: R,
|
|
653
|
+
bgTextureFlipX: E,
|
|
654
|
+
bgTextureFlipY: $,
|
|
675
655
|
underline: G,
|
|
676
|
-
strikethrough:
|
|
677
|
-
bendPreset:
|
|
656
|
+
strikethrough: D,
|
|
657
|
+
bendPreset: O,
|
|
678
658
|
bendStrength: Y
|
|
679
659
|
} = t;
|
|
680
|
-
let { fontSize: X, bgColor:
|
|
681
|
-
const
|
|
660
|
+
let { fontSize: X, bgColor: p } = t;
|
|
661
|
+
const q = [
|
|
682
662
|
...a ?? [],
|
|
683
663
|
...r && l > 0 ? [{ color: r, width: l, opacity: f }] : []
|
|
684
|
-
].filter((
|
|
664
|
+
].filter((T) => T.width > 0), N = [
|
|
685
665
|
...s ?? [],
|
|
686
|
-
...d && (
|
|
666
|
+
...d && (g > 0 || u !== 0 || S !== 0) ? [
|
|
687
667
|
{
|
|
688
668
|
color: d,
|
|
689
|
-
blur:
|
|
669
|
+
blur: g,
|
|
690
670
|
offsetX: u,
|
|
691
671
|
offsetY: S,
|
|
692
|
-
opacity:
|
|
672
|
+
opacity: c
|
|
693
673
|
}
|
|
694
674
|
] : []
|
|
695
|
-
].filter((
|
|
675
|
+
].filter((T) => T.blur > 0 || (T.offsetX ?? 0) !== 0 || (T.offsetY ?? 0) !== 0);
|
|
696
676
|
let k;
|
|
697
|
-
const
|
|
698
|
-
|
|
699
|
-
const
|
|
700
|
-
if (X =
|
|
701
|
-
const
|
|
702
|
-
|
|
703
|
-
v === "text" ||
|
|
677
|
+
const A = Z(e, n), M = A.getContext("2d");
|
|
678
|
+
M.clearRect(0, 0, e, n), M.fillStyle = i, M.textAlign = b, M.textBaseline = "middle";
|
|
679
|
+
const y = Be(M, t);
|
|
680
|
+
if (X = y.fontSize, p !== "transparent") {
|
|
681
|
+
const T = C === !0, U = de(
|
|
682
|
+
T ? void 0 : W,
|
|
683
|
+
v === "text" || T ? y.textBlockWidth : e,
|
|
704
684
|
e
|
|
705
|
-
),
|
|
706
|
-
|
|
707
|
-
v === "text" ||
|
|
685
|
+
), _ = de(
|
|
686
|
+
T ? void 0 : x,
|
|
687
|
+
v === "text" || T ? y.textBlockHeight : n,
|
|
708
688
|
n
|
|
709
689
|
);
|
|
710
|
-
|
|
690
|
+
Ie(M, {
|
|
711
691
|
canvasWidth: e,
|
|
712
692
|
canvasHeight: n,
|
|
713
693
|
textAlign: b,
|
|
714
694
|
bgFit: v,
|
|
715
|
-
panelWidth:
|
|
716
|
-
panelHeight:
|
|
717
|
-
bgColor:
|
|
695
|
+
panelWidth: U,
|
|
696
|
+
panelHeight: _,
|
|
697
|
+
bgColor: p,
|
|
718
698
|
bgFillMode: m,
|
|
719
|
-
bgOpacity:
|
|
720
|
-
bgGradientStops:
|
|
721
|
-
bgTextureImage:
|
|
722
|
-
bgTextureFit:
|
|
723
|
-
bgTextureFlipX:
|
|
724
|
-
bgTextureFlipY:
|
|
699
|
+
bgOpacity: w,
|
|
700
|
+
bgGradientStops: F,
|
|
701
|
+
bgTextureImage: L,
|
|
702
|
+
bgTextureFit: R,
|
|
703
|
+
bgTextureFlipX: E,
|
|
704
|
+
bgTextureFlipY: $,
|
|
725
705
|
borderColor: t.borderColor,
|
|
726
706
|
borderWidth: t.borderWidth,
|
|
727
707
|
borderRadius: t.borderRadius
|
|
728
708
|
});
|
|
729
709
|
}
|
|
730
|
-
return o &&
|
|
731
|
-
lines:
|
|
732
|
-
textX:
|
|
733
|
-
startY:
|
|
734
|
-
lineHeight:
|
|
735
|
-
letterSpacingPx:
|
|
736
|
-
bendPreset:
|
|
710
|
+
return o && qe(M, {
|
|
711
|
+
lines: y.resolvedLines,
|
|
712
|
+
textX: y.textX,
|
|
713
|
+
startY: y.startY,
|
|
714
|
+
lineHeight: y.lineHeight,
|
|
715
|
+
letterSpacingPx: y.letterSpacingPx,
|
|
716
|
+
bendPreset: O,
|
|
737
717
|
bendStrength: Y,
|
|
738
718
|
color: o.color,
|
|
739
719
|
style: o.style,
|
|
@@ -741,31 +721,31 @@ function Ke(t) {
|
|
|
741
721
|
range: o.range ?? 0.5,
|
|
742
722
|
horizontalAngle: o.horizontalAngle ?? 0,
|
|
743
723
|
verticalAngle: o.verticalAngle ?? 0
|
|
744
|
-
}),
|
|
745
|
-
lines:
|
|
746
|
-
textX:
|
|
747
|
-
startY:
|
|
748
|
-
lineHeight:
|
|
724
|
+
}), De(M, {
|
|
725
|
+
lines: y.resolvedLines,
|
|
726
|
+
textX: y.textX,
|
|
727
|
+
startY: y.startY,
|
|
728
|
+
lineHeight: y.lineHeight,
|
|
749
729
|
textAlign: b,
|
|
750
730
|
color: i,
|
|
751
731
|
fontSize: X,
|
|
752
|
-
letterSpacingPx:
|
|
753
|
-
bendPreset:
|
|
732
|
+
letterSpacingPx: y.letterSpacingPx,
|
|
733
|
+
bendPreset: O,
|
|
754
734
|
bendStrength: Y,
|
|
755
|
-
shadowLayers:
|
|
756
|
-
strokeLayers:
|
|
735
|
+
shadowLayers: N,
|
|
736
|
+
strokeLayers: q,
|
|
757
737
|
underline: G,
|
|
758
|
-
strikethrough:
|
|
759
|
-
}), h &&
|
|
738
|
+
strikethrough: D
|
|
739
|
+
}), h && Ne(M, {
|
|
760
740
|
width: e,
|
|
761
741
|
height: n,
|
|
762
|
-
font:
|
|
763
|
-
lines:
|
|
764
|
-
textX:
|
|
765
|
-
startY:
|
|
766
|
-
lineHeight:
|
|
767
|
-
letterSpacingPx:
|
|
768
|
-
bendPreset:
|
|
742
|
+
font: M.font,
|
|
743
|
+
lines: y.resolvedLines,
|
|
744
|
+
textX: y.textX,
|
|
745
|
+
startY: y.startY,
|
|
746
|
+
lineHeight: y.lineHeight,
|
|
747
|
+
letterSpacingPx: y.letterSpacingPx,
|
|
748
|
+
bendPreset: O,
|
|
769
749
|
bendStrength: Y,
|
|
770
750
|
textAlign: b,
|
|
771
751
|
color: h.color,
|
|
@@ -773,9 +753,9 @@ function Ke(t) {
|
|
|
773
753
|
blur: h.blur,
|
|
774
754
|
offsetX: h.offsetX ?? 0,
|
|
775
755
|
offsetY: h.offsetY ?? 0
|
|
776
|
-
}), k = new We.CanvasTexture(
|
|
756
|
+
}), k = new We.CanvasTexture(A), k.needsUpdate = !0, k;
|
|
777
757
|
}
|
|
778
|
-
function
|
|
758
|
+
function _e(t, e) {
|
|
779
759
|
const {
|
|
780
760
|
lines: n,
|
|
781
761
|
color: i,
|
|
@@ -787,37 +767,37 @@ function Qe(t, e) {
|
|
|
787
767
|
shadowLayers: h,
|
|
788
768
|
shadowEnabled: o,
|
|
789
769
|
innerShadow: d,
|
|
790
|
-
glow:
|
|
770
|
+
glow: g,
|
|
791
771
|
shadowColor: u,
|
|
792
772
|
shadowBlur: S,
|
|
793
|
-
shadowOffsetX:
|
|
773
|
+
shadowOffsetX: c,
|
|
794
774
|
shadowOffsetY: b,
|
|
795
775
|
shadowOpacity: m,
|
|
796
|
-
fontWeight:
|
|
776
|
+
fontWeight: w,
|
|
797
777
|
fontStyle: v,
|
|
798
778
|
fontFamily: C,
|
|
799
|
-
fontSize:
|
|
779
|
+
fontSize: W,
|
|
800
780
|
textAlign: x,
|
|
801
|
-
verticalAlign:
|
|
802
|
-
overflow:
|
|
803
|
-
resizeToFit:
|
|
804
|
-
minFontSize:
|
|
805
|
-
letterSpacing:
|
|
781
|
+
verticalAlign: F,
|
|
782
|
+
overflow: L,
|
|
783
|
+
resizeToFit: R,
|
|
784
|
+
minFontSize: E,
|
|
785
|
+
letterSpacing: $,
|
|
806
786
|
lineSpacing: G,
|
|
807
|
-
bgFillMode:
|
|
808
|
-
bgOpacity:
|
|
787
|
+
bgFillMode: D,
|
|
788
|
+
bgOpacity: O,
|
|
809
789
|
bgFit: Y,
|
|
810
790
|
bgAutoSize: X,
|
|
811
|
-
bgWidth:
|
|
812
|
-
bgHeight:
|
|
813
|
-
bgGradientStops:
|
|
791
|
+
bgWidth: p,
|
|
792
|
+
bgHeight: q,
|
|
793
|
+
bgGradientStops: N,
|
|
814
794
|
bgTextureFit: k,
|
|
815
|
-
bgTextureFlipX:
|
|
816
|
-
bgTextureFlipY:
|
|
817
|
-
borderColor:
|
|
818
|
-
borderWidth:
|
|
819
|
-
borderRadius:
|
|
820
|
-
padding:
|
|
795
|
+
bgTextureFlipX: A,
|
|
796
|
+
bgTextureFlipY: M,
|
|
797
|
+
borderColor: y,
|
|
798
|
+
borderWidth: T,
|
|
799
|
+
borderRadius: U,
|
|
800
|
+
padding: _,
|
|
821
801
|
aspect: ee,
|
|
822
802
|
resolution: j,
|
|
823
803
|
underline: te,
|
|
@@ -841,39 +821,39 @@ function Qe(t, e) {
|
|
|
841
821
|
strokeOpacity: s,
|
|
842
822
|
shadowLayers: le,
|
|
843
823
|
innerShadow: d,
|
|
844
|
-
glow:
|
|
824
|
+
glow: g,
|
|
845
825
|
shadowColor: o === !1 ? void 0 : u,
|
|
846
826
|
shadowBlur: o === !1 ? 0 : S,
|
|
847
|
-
shadowOffsetX: o === !1 ? 0 :
|
|
827
|
+
shadowOffsetX: o === !1 ? 0 : c,
|
|
848
828
|
shadowOffsetY: o === !1 ? 0 : b,
|
|
849
829
|
shadowOpacity: m,
|
|
850
|
-
fontWeight:
|
|
830
|
+
fontWeight: w,
|
|
851
831
|
fontStyle: v,
|
|
852
832
|
fontFamily: C,
|
|
853
|
-
fontSize:
|
|
833
|
+
fontSize: W,
|
|
854
834
|
textAlign: x,
|
|
855
|
-
verticalAlign:
|
|
856
|
-
overflow:
|
|
857
|
-
resizeToFit:
|
|
858
|
-
minFontSize:
|
|
859
|
-
letterSpacing:
|
|
835
|
+
verticalAlign: F,
|
|
836
|
+
overflow: L,
|
|
837
|
+
resizeToFit: R,
|
|
838
|
+
minFontSize: E,
|
|
839
|
+
letterSpacing: $,
|
|
860
840
|
lineSpacing: G,
|
|
861
841
|
bgColor: e.bgColor,
|
|
862
|
-
bgFillMode:
|
|
863
|
-
bgOpacity:
|
|
842
|
+
bgFillMode: D,
|
|
843
|
+
bgOpacity: O,
|
|
864
844
|
bgFit: Y,
|
|
865
845
|
bgAutoSize: X,
|
|
866
|
-
bgWidth:
|
|
867
|
-
bgHeight:
|
|
868
|
-
bgGradientStops:
|
|
846
|
+
bgWidth: p,
|
|
847
|
+
bgHeight: q,
|
|
848
|
+
bgGradientStops: N,
|
|
869
849
|
bgTextureImage: oe,
|
|
870
850
|
bgTextureFit: k,
|
|
871
|
-
bgTextureFlipX:
|
|
872
|
-
bgTextureFlipY:
|
|
873
|
-
borderColor:
|
|
874
|
-
borderWidth:
|
|
875
|
-
borderRadius:
|
|
876
|
-
padding:
|
|
851
|
+
bgTextureFlipX: A,
|
|
852
|
+
bgTextureFlipY: M,
|
|
853
|
+
borderColor: y,
|
|
854
|
+
borderWidth: T,
|
|
855
|
+
borderRadius: U,
|
|
856
|
+
padding: _,
|
|
877
857
|
height: j,
|
|
878
858
|
width: Math.round(j * Math.max(ee, 0.1)),
|
|
879
859
|
underline: te,
|
|
@@ -893,39 +873,39 @@ function Qe(t, e) {
|
|
|
893
873
|
s,
|
|
894
874
|
le,
|
|
895
875
|
d,
|
|
896
|
-
|
|
876
|
+
g,
|
|
897
877
|
o,
|
|
898
878
|
u,
|
|
899
879
|
S,
|
|
900
|
-
|
|
880
|
+
c,
|
|
901
881
|
b,
|
|
902
882
|
m,
|
|
903
|
-
|
|
883
|
+
w,
|
|
904
884
|
v,
|
|
905
885
|
C,
|
|
906
|
-
|
|
886
|
+
W,
|
|
907
887
|
x,
|
|
888
|
+
F,
|
|
908
889
|
L,
|
|
909
|
-
O,
|
|
910
|
-
E,
|
|
911
890
|
R,
|
|
912
|
-
|
|
913
|
-
G,
|
|
891
|
+
E,
|
|
914
892
|
$,
|
|
915
|
-
|
|
893
|
+
G,
|
|
894
|
+
D,
|
|
895
|
+
O,
|
|
916
896
|
Y,
|
|
917
897
|
X,
|
|
918
|
-
|
|
919
|
-
_,
|
|
898
|
+
p,
|
|
920
899
|
q,
|
|
900
|
+
N,
|
|
921
901
|
oe,
|
|
922
902
|
k,
|
|
923
|
-
|
|
924
|
-
T,
|
|
925
|
-
w,
|
|
903
|
+
A,
|
|
926
904
|
M,
|
|
927
|
-
|
|
928
|
-
|
|
905
|
+
y,
|
|
906
|
+
T,
|
|
907
|
+
U,
|
|
908
|
+
_,
|
|
929
909
|
ee,
|
|
930
910
|
j,
|
|
931
911
|
te,
|
|
@@ -933,12 +913,12 @@ function Qe(t, e) {
|
|
|
933
913
|
re,
|
|
934
914
|
ie
|
|
935
915
|
]
|
|
936
|
-
), fe = B(() =>
|
|
937
|
-
return
|
|
916
|
+
), fe = B(() => Ue(se), [se]);
|
|
917
|
+
return Ye(fe), fe;
|
|
938
918
|
}
|
|
939
|
-
const
|
|
940
|
-
function
|
|
941
|
-
const e =
|
|
919
|
+
const je = ["color"];
|
|
920
|
+
function tt(t) {
|
|
921
|
+
const e = Le(t, je), n = { ...Oe, ...e }, {
|
|
942
922
|
text: i,
|
|
943
923
|
bgColor: a,
|
|
944
924
|
opacity: r,
|
|
@@ -948,20 +928,20 @@ function at(t) {
|
|
|
948
928
|
rotation: h,
|
|
949
929
|
scale: o,
|
|
950
930
|
visible: d,
|
|
951
|
-
renderOrder:
|
|
952
|
-
} = n, [u, S] = he(null), [
|
|
931
|
+
renderOrder: g
|
|
932
|
+
} = n, [u, S] = he(null), [c, b] = he(null), m = J(i);
|
|
953
933
|
m.current !== i && (m.current = i, u !== null && S(null));
|
|
954
|
-
const
|
|
955
|
-
|
|
956
|
-
const v =
|
|
957
|
-
return
|
|
958
|
-
const
|
|
959
|
-
if (
|
|
960
|
-
return
|
|
961
|
-
delete
|
|
934
|
+
const w = J(a);
|
|
935
|
+
w.current !== a && (w.current = a, c !== null && b(null));
|
|
936
|
+
const v = J(null), x = _e(n, { text: u ?? i, bgColor: c ?? a });
|
|
937
|
+
return be(() => {
|
|
938
|
+
const F = v.current;
|
|
939
|
+
if (F)
|
|
940
|
+
return F.userData.setText = (L) => S(L), F.userData.setBgColor = (L) => b(L), () => {
|
|
941
|
+
delete F.userData.setText, delete F.userData.setBgColor;
|
|
962
942
|
};
|
|
963
943
|
}, []), /* @__PURE__ */ z(
|
|
964
|
-
|
|
944
|
+
me,
|
|
965
945
|
{
|
|
966
946
|
ref: v,
|
|
967
947
|
name: l,
|
|
@@ -972,13 +952,12 @@ function at(t) {
|
|
|
972
952
|
rotation: h,
|
|
973
953
|
scale: o,
|
|
974
954
|
visible: d,
|
|
975
|
-
renderOrder:
|
|
955
|
+
renderOrder: g
|
|
976
956
|
}
|
|
977
957
|
);
|
|
978
958
|
}
|
|
979
959
|
export {
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
Ae as u
|
|
960
|
+
et as S,
|
|
961
|
+
tt as T,
|
|
962
|
+
Ye as u
|
|
984
963
|
};
|