@vincentt-xr/sdk 2.0.0-alpha.10 → 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 +95 -8
- package/dist/{CanonicalHeadFrame-D_0OzdB9.cjs → CanonicalHeadFrame-CZFvPzN_.cjs} +1 -1
- package/dist/{CanonicalHeadFrame-DdUqF6Fv.js → CanonicalHeadFrame-vn-jM9fG.js} +3 -3
- package/dist/{DebuggerUI-D-rcPa54.js → DebuggerUI-DDpU-nBF.js} +1 -1
- package/dist/{DebuggerUI-CVuV-VJ5.cjs → DebuggerUI-Db-1VtQJ.cjs} +1 -1
- package/dist/{FaceRetouch-C1AxBNex.js → FaceRetouch-D2xH5OpW.js} +4 -4
- package/dist/{FaceRetouch-D7kryDE6.cjs → FaceRetouch-DHhn1nSV.cjs} +1 -1
- package/dist/{TextLabel-c9BCucOI.js → TextLabel-C6F5xoaz.js} +182 -180
- package/dist/TextLabel-ChZCoB3P.cjs +2 -0
- package/dist/{bodyMaskMaterial-Cs2awskk.js → bodyMaskMaterial-C3aXItLo.js} +1 -1
- package/dist/{bodyMaskMaterial-CBWub5t_.cjs → bodyMaskMaterial-Q6rYywwW.cjs} +1 -1
- package/dist/{cache-2x3CUJuY.js → cache-C85JjyZA.js} +2 -2
- package/dist/{cache-DL1Dbz6k.cjs → cache-DFqZYsHC.cjs} +1 -1
- package/dist/components/ScreenImage/ScreenImage.d.ts +4 -1
- package/dist/components/ScreenShape/index.d.ts +4 -1
- package/dist/components/ScreenText/index.d.ts +4 -1
- package/dist/components/SegmentationOverlay/settings.d.ts +2 -2
- package/dist/components/TextLabel/TextLabel.d.ts +1 -1
- package/dist/{contexts-Y_FhdnIv.js → contexts-B5GODwuV.js} +2 -2
- package/dist/{contexts-DQc7zyqT.cjs → contexts-CSz9stBV.cjs} +1 -1
- package/dist/coordinates/index.d.ts +1 -1
- package/dist/coordinates/viewport.d.ts +10 -0
- package/dist/debug-ui/media-source.cjs +1 -1
- package/dist/debug-ui/media-source.js +1 -1
- package/dist/debug-ui.cjs +1 -1
- package/dist/debug-ui.js +11 -11
- package/dist/{drawNormalizedCrop-DG3gtJxf.js → drawNormalizedCrop-BLfB484W.js} +5 -5
- package/dist/{drawNormalizedCrop-C4KFaRne.cjs → drawNormalizedCrop-DaGT5mZ5.cjs} +1 -1
- package/dist/entries/core.d.ts +1 -1
- package/dist/face-effects.cjs +1 -1
- package/dist/face-effects.js +17 -17
- package/dist/footage-input/index.d.ts +46 -0
- package/dist/{getFaceInfo-BzlwHMjX.cjs → getFaceInfo-BbcKq8PJ.cjs} +1 -1
- package/dist/{getFaceInfo-BafgGT27.js → getFaceInfo-D_tCSQC7.js} +1 -1
- package/dist/{index-DiIoHK_4.js → index-B9DdHE4u.js} +1 -1
- package/dist/{index-Cyk_VIZE.js → index-BaNlidsb.js} +279 -273
- package/dist/index-BzGLgXJm.cjs +46 -0
- package/dist/{index-iIQ9jBDb.js → index-CNt8esFO.js} +1 -1
- package/dist/{index-CKRN-xJp.js → index-CTqQJj5p.js} +1249 -1175
- package/dist/{index-ItufYyHH.cjs → index-CelqbDSR.cjs} +1 -1
- package/dist/index-Cm3v6Dlg.cjs +21 -0
- package/dist/{index-vr2ichWQ.js → index-D10O6vqR.js} +2 -2
- package/dist/{index-S3gqudT6.cjs → index-DIYaENN3.cjs} +1 -1
- package/dist/{index-CUldCMRl.js → index-DlP4xxaT.js} +1 -1
- package/dist/{index-D-4w34GO.cjs → index-DzdKBXGE.cjs} +1 -1
- package/dist/index-J3Qy6hi3.cjs +1 -0
- package/dist/{index-By_LCo2V.cjs → index-LC2Xs08E.cjs} +1 -1
- package/dist/{index-BZoBxyLn.js → index-bL819L-K.js} +387 -375
- package/dist/instructions.cjs +1 -1
- package/dist/instructions.js +8 -8
- package/dist/{internal-Bb9ZXbpr.cjs → internal-DS8Pdlsm.cjs} +1 -1
- package/dist/{internal-Gt1wn6Z3.js → internal-TD4QhIry.js} +3 -3
- package/dist/internal.cjs +1 -1
- package/dist/internal.js +2 -2
- package/dist/{landmarks-BEjJXcnE.cjs → landmarks-BP6RbRHN.cjs} +1 -1
- package/dist/{landmarks-DtCAFV_m.js → landmarks-vLy5QKt6.js} +1 -1
- package/dist/low-level.cjs +1 -1
- package/dist/low-level.js +40 -40
- package/dist/main.cjs +1 -1
- package/dist/main.js +234 -230
- package/dist/particles.cjs +1 -1
- package/dist/particles.js +5 -5
- package/dist/product.cjs +1 -1
- package/dist/product.js +2 -2
- package/dist/{providers-CEZQgz2s.cjs → providers-BRSbw214.cjs} +1 -1
- package/dist/{providers-CRuaD8bi.js → providers-DmJlgrDD.js} +3 -3
- package/dist/{renderGroups-BADrepA1.cjs → renderGroups-B0N58SIA.cjs} +1 -1
- package/dist/{renderGroups-CNB99dZ2.js → renderGroups-BcQYy_J2.js} +1 -1
- package/dist/{renderPasses-DgxUKn9b.cjs → renderPasses-Bt8k0dkm.cjs} +1 -1
- package/dist/{renderPasses-DuapJA6V.js → renderPasses-DIPTIU_x.js} +4 -4
- package/dist/scene-object.cjs +1 -1
- package/dist/scene-object.js +2 -2
- package/dist/screen2d/coordinates.d.ts +37 -0
- package/dist/{segmentation-BOZJdWFC.js → segmentation-CZs5aVvY.js} +1 -1
- package/dist/{segmentation-J8GoNBvP.cjs → segmentation-Cz7oeNcS.cjs} +1 -1
- package/dist/{selectors-QB2qsaxy.cjs → selectors-Bq6tSgOY.cjs} +1 -1
- package/dist/{selectors-BvJepq6H.js → selectors-K5JKCWxw.js} +1 -1
- package/dist/{session-BVX859as.cjs → session-3aCMNb8W.cjs} +1 -1
- package/dist/{session-Cz8aie4K.js → session-DHBNTyJJ.js} +1 -1
- package/dist/tracking.cjs +1 -1
- package/dist/tracking.js +75 -75
- package/dist/{trigger-D9L4GPmQ.js → trigger-BwZ81ENx.js} +7 -7
- package/dist/{trigger-DZ9vU7jo.cjs → trigger-UjeJY5uh.cjs} +1 -1
- package/dist/{useBodies-BYzJpQ4L.js → useBodies-BMKHXAOL.js} +2 -2
- package/dist/{useBodies-Cxpmx6Bb.cjs → useBodies-CXomEo0i.cjs} +1 -1
- package/dist/useEditOverrides-BTkPGVjN.js +38 -0
- package/dist/useEditOverrides-C3ZVXuIH.cjs +1 -0
- package/dist/{useFaceInfo-DlLRAVNw.cjs → useFaceInfo-BEMMiZxw.cjs} +1 -1
- package/dist/{useFaceInfo-BzEUj2OI.js → useFaceInfo-BNVdnprN.js} +4 -4
- package/dist/{useFaceResultReader-Cc4Qrutf.js → useFaceResultReader-B15wn6RB.js} +1 -1
- package/dist/{useFaceResultReader-D3jOQNKz.cjs → useFaceResultReader-D9qibKmm.cjs} +1 -1
- package/dist/{useIrisTracking-Bz4uLDa7.js → useIrisTracking-CYm-KDIZ.js} +10 -10
- package/dist/{useIrisTracking-DRGWgoNy.cjs → useIrisTracking-DExhnhlt.cjs} +1 -1
- package/dist/{useXRCapabilities-B1KLckqw.js → useXRCapabilities-ClWlG5_Y.js} +1 -1
- package/dist/{useXRCapabilities-CZlPUBjF.cjs → useXRCapabilities-D-EhcDzM.cjs} +1 -1
- package/dist/utils/useEditOverrides.d.ts +33 -0
- package/docs/api/face-info.mdx +1 -1
- package/docs/api/screen-space-coordinates.mdx +17 -9
- package/docs/api/session-lifecycle.mdx +29 -0
- package/package.json +1 -1
- package/settings.json +64 -13
- package/dist/TextLabel-XE0rQSDn.cjs +0 -2
- package/dist/index-C-Mryx_u.cjs +0 -21
- package/dist/index-Dv3WnY9n.cjs +0 -46
- package/dist/index-Sho4F4it.cjs +0 -1
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useMemo 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
3
|
import { useThree as Ce } from "@react-three/fiber";
|
|
4
4
|
import { b as Fe } from "./context-DTxSQvp4.js";
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
import { u as Le } from "./useEditOverrides-BTkPGVjN.js";
|
|
6
|
+
import * as We from "three";
|
|
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
|
-
return /* @__PURE__ */
|
|
14
|
+
return /* @__PURE__ */ z(Fe.Provider, { value: a, children: /* @__PURE__ */ z("group", { position: [0, 0, e], children: t }) });
|
|
14
15
|
}, me = xe(
|
|
15
16
|
({ texture: t, name: e, overlay: n, opacity: i, position: a, rotation: r, scale: l, visible: f, renderOrder: s }, h) => /* @__PURE__ */ Te(
|
|
16
17
|
"mesh",
|
|
@@ -23,8 +24,8 @@ const Qe = ({ children: t, depth: e = 0 }) => {
|
|
|
23
24
|
visible: f,
|
|
24
25
|
renderOrder: s,
|
|
25
26
|
children: [
|
|
26
|
-
/* @__PURE__ */
|
|
27
|
-
/* @__PURE__ */
|
|
27
|
+
/* @__PURE__ */ z("planeGeometry", { args: [1, 1] }),
|
|
28
|
+
/* @__PURE__ */ z(
|
|
28
29
|
"meshBasicMaterial",
|
|
29
30
|
{
|
|
30
31
|
map: t,
|
|
@@ -39,7 +40,7 @@ const Qe = ({ children: t, depth: e = 0 }) => {
|
|
|
39
40
|
)
|
|
40
41
|
);
|
|
41
42
|
me.displayName = "TextLabelMesh";
|
|
42
|
-
const
|
|
43
|
+
const Oe = {
|
|
43
44
|
color: "#ffffff",
|
|
44
45
|
strokeWidth: 0,
|
|
45
46
|
strokeOpacity: 1,
|
|
@@ -81,19 +82,19 @@ const We = {
|
|
|
81
82
|
[t]
|
|
82
83
|
);
|
|
83
84
|
};
|
|
84
|
-
function
|
|
85
|
+
function ke(t, e, n) {
|
|
85
86
|
return n === "left" ? e : n === "right" ? t - e : t / 2;
|
|
86
87
|
}
|
|
87
|
-
function
|
|
88
|
+
function Pe(t, e, n, i, a) {
|
|
88
89
|
return a === "top" ? e + n / 2 : a === "bottom" ? t - e - i + n / 2 : t / 2 - (i - n) / 2;
|
|
89
90
|
}
|
|
90
|
-
function
|
|
91
|
+
function He(t, e, n, i) {
|
|
91
92
|
return i === "full" || n === "left" ? 0 : n === "right" ? t - e : (t - e) / 2;
|
|
92
93
|
}
|
|
93
94
|
function Se(t, e, n, i) {
|
|
94
95
|
return `${t} ${e} ${n}px ${i}`;
|
|
95
96
|
}
|
|
96
|
-
function
|
|
97
|
+
function I(t, e) {
|
|
97
98
|
const n = Math.max(0, Math.min(e, 1));
|
|
98
99
|
return t * n * 0.08;
|
|
99
100
|
}
|
|
@@ -107,29 +108,29 @@ function ye(t, e) {
|
|
|
107
108
|
function ve(t) {
|
|
108
109
|
"letterSpacing" in t && (t.letterSpacing = "0px");
|
|
109
110
|
}
|
|
110
|
-
function
|
|
111
|
+
function H(t, e, n) {
|
|
111
112
|
ye(t, n);
|
|
112
113
|
const i = t.measureText(e).width;
|
|
113
114
|
return ve(t), i;
|
|
114
115
|
}
|
|
115
|
-
function
|
|
116
|
+
function V(t, e, n, i) {
|
|
116
117
|
return Math.max(1, Math.floor((t - e * 2) / we(n, i)));
|
|
117
118
|
}
|
|
118
|
-
function
|
|
119
|
-
return e.length <= i && e.every((r) =>
|
|
119
|
+
function Xe(t, e, n, i, a) {
|
|
120
|
+
return e.length <= i && e.every((r) => H(t, r, a) <= n);
|
|
120
121
|
}
|
|
121
|
-
function
|
|
122
|
+
function K(t, e, n, i, a, r, l, f) {
|
|
122
123
|
t.font = Se(i, a, r, l);
|
|
123
124
|
const s = e.split(" "), h = [];
|
|
124
125
|
let o = "";
|
|
125
126
|
for (const d of s) {
|
|
126
127
|
const g = o ? `${o} ${d}` : d;
|
|
127
|
-
|
|
128
|
+
H(t, g, f) > n && o ? (h.push(o), o = d) : o = g;
|
|
128
129
|
}
|
|
129
130
|
return o && h.push(o), h;
|
|
130
131
|
}
|
|
131
132
|
function ge(t, e, n, i, a, r, l, f) {
|
|
132
|
-
const h = e.split(/\r?\n/).flatMap((o) => o.trim().length === 0 ? [""] :
|
|
133
|
+
const h = e.split(/\r?\n/).flatMap((o) => o.trim().length === 0 ? [""] : K(
|
|
133
134
|
t,
|
|
134
135
|
o,
|
|
135
136
|
n,
|
|
@@ -144,13 +145,13 @@ function ge(t, e, n, i, a, r, l, f) {
|
|
|
144
145
|
function Me(t, e, n, i, a) {
|
|
145
146
|
const r = i ? "..." : "";
|
|
146
147
|
let l = e.trimEnd();
|
|
147
|
-
for (; l.length > 0 &&
|
|
148
|
+
for (; l.length > 0 && H(t, `${l}${r}`, a) > n; )
|
|
148
149
|
l = l.slice(0, -1).trimEnd();
|
|
149
150
|
return `${l}${r}`;
|
|
150
151
|
}
|
|
151
|
-
function
|
|
152
|
+
function Q(t, e, n, i, a) {
|
|
152
153
|
return e.map((r, l) => {
|
|
153
|
-
if (
|
|
154
|
+
if (H(t, r, a) <= n) return r;
|
|
154
155
|
const f = l === e.length - 1;
|
|
155
156
|
return Me(
|
|
156
157
|
t,
|
|
@@ -163,7 +164,7 @@ function V(t, e, n, i, a) {
|
|
|
163
164
|
}
|
|
164
165
|
function ce(t, e, n, i, a, r) {
|
|
165
166
|
if (e.length <= n)
|
|
166
|
-
return
|
|
167
|
+
return Q(
|
|
167
168
|
t,
|
|
168
169
|
e,
|
|
169
170
|
i,
|
|
@@ -177,7 +178,7 @@ function ce(t, e, n, i, a, r) {
|
|
|
177
178
|
i,
|
|
178
179
|
a,
|
|
179
180
|
r
|
|
180
|
-
),
|
|
181
|
+
), Q(
|
|
181
182
|
t,
|
|
182
183
|
l,
|
|
183
184
|
i,
|
|
@@ -185,7 +186,7 @@ function ce(t, e, n, i, a, r) {
|
|
|
185
186
|
r
|
|
186
187
|
);
|
|
187
188
|
}
|
|
188
|
-
function
|
|
189
|
+
function pe(t) {
|
|
189
190
|
const {
|
|
190
191
|
ctx: e,
|
|
191
192
|
text: n,
|
|
@@ -203,7 +204,7 @@ function Xe(t) {
|
|
|
203
204
|
resizeToFit: S,
|
|
204
205
|
minFontSize: c
|
|
205
206
|
} = t;
|
|
206
|
-
let b = h, m =
|
|
207
|
+
let b = h, m = I(b, d), w = i ?? ge(
|
|
207
208
|
e,
|
|
208
209
|
n,
|
|
209
210
|
a,
|
|
@@ -212,9 +213,9 @@ function Xe(t) {
|
|
|
212
213
|
b,
|
|
213
214
|
o,
|
|
214
215
|
m
|
|
215
|
-
),
|
|
216
|
+
), v = V(r, l, b, g);
|
|
216
217
|
const C = S === !0 || u === "shrink";
|
|
217
|
-
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(
|
|
218
219
|
e,
|
|
219
220
|
n,
|
|
220
221
|
a,
|
|
@@ -223,23 +224,23 @@ function Xe(t) {
|
|
|
223
224
|
b,
|
|
224
225
|
o,
|
|
225
226
|
m
|
|
226
|
-
),
|
|
227
|
+
), v = V(r, l, b, g), b !== c); )
|
|
227
228
|
;
|
|
228
229
|
return u === "ellipsis" ? w = ce(
|
|
229
230
|
e,
|
|
230
231
|
w,
|
|
231
|
-
|
|
232
|
+
v,
|
|
232
233
|
a,
|
|
233
234
|
!0,
|
|
234
235
|
m
|
|
235
236
|
) : u === "clamp" || u === "shrink" ? w = ce(
|
|
236
237
|
e,
|
|
237
238
|
w,
|
|
238
|
-
|
|
239
|
+
v,
|
|
239
240
|
a,
|
|
240
241
|
!1,
|
|
241
242
|
m
|
|
242
|
-
) : u !== "clip" && (w =
|
|
243
|
+
) : u !== "clip" && (w = Q(e, w, a, void 0, m)), { fontSize: b, lines: w };
|
|
243
244
|
}
|
|
244
245
|
function Ae(t) {
|
|
245
246
|
const {
|
|
@@ -255,7 +256,7 @@ function Ae(t) {
|
|
|
255
256
|
letterSpacing: o,
|
|
256
257
|
lineSpacing: d
|
|
257
258
|
} = t;
|
|
258
|
-
let g = s, u =
|
|
259
|
+
let g = s, u = K(
|
|
259
260
|
e,
|
|
260
261
|
n,
|
|
261
262
|
i,
|
|
@@ -263,10 +264,10 @@ function Ae(t) {
|
|
|
263
264
|
f,
|
|
264
265
|
g,
|
|
265
266
|
h,
|
|
266
|
-
|
|
267
|
+
I(g, o)
|
|
267
268
|
);
|
|
268
|
-
const S =
|
|
269
|
-
return u.length > S && (g = Math.max(12, Math.round(g * 0.75)), u =
|
|
269
|
+
const S = V(a, r, g, d);
|
|
270
|
+
return u.length > S && (g = Math.max(12, Math.round(g * 0.75)), u = K(
|
|
270
271
|
e,
|
|
271
272
|
n,
|
|
272
273
|
i,
|
|
@@ -274,7 +275,7 @@ function Ae(t) {
|
|
|
274
275
|
f,
|
|
275
276
|
g,
|
|
276
277
|
h,
|
|
277
|
-
|
|
278
|
+
I(g, o)
|
|
278
279
|
)), { fontSize: g, lines: u };
|
|
279
280
|
}
|
|
280
281
|
function Z(t, e) {
|
|
@@ -283,9 +284,9 @@ function Z(t, e) {
|
|
|
283
284
|
return n.width = t, n.height = e, n;
|
|
284
285
|
})();
|
|
285
286
|
}
|
|
286
|
-
function
|
|
287
|
+
function Be(t, e) {
|
|
287
288
|
const n = e.width - e.padding * 2, a = Array.isArray(e.lines) || e.text.includes(`
|
|
288
|
-
`) || e.overflow !== void 0 || e.resizeToFit !== void 0 ?
|
|
289
|
+
`) || e.overflow !== void 0 || e.resizeToFit !== void 0 ? pe({
|
|
289
290
|
ctx: t,
|
|
290
291
|
text: e.text,
|
|
291
292
|
explicitLines: e.lines,
|
|
@@ -315,17 +316,17 @@ function pe(t, e) {
|
|
|
315
316
|
lineSpacing: e.lineSpacing
|
|
316
317
|
}), r = a.fontSize, l = a.lines;
|
|
317
318
|
t.font = Se(e.fontStyle, e.fontWeight, r, e.fontFamily);
|
|
318
|
-
const f =
|
|
319
|
+
const f = I(r, e.letterSpacing), s = we(r, e.lineSpacing), h = Math.max(
|
|
319
320
|
r,
|
|
320
321
|
r + (l.length - 1) * s
|
|
321
|
-
), o =
|
|
322
|
+
), o = Pe(
|
|
322
323
|
e.height,
|
|
323
324
|
e.padding,
|
|
324
325
|
r,
|
|
325
326
|
h,
|
|
326
327
|
e.verticalAlign
|
|
327
328
|
), d = l.map(
|
|
328
|
-
(g) =>
|
|
329
|
+
(g) => H(t, g, f)
|
|
329
330
|
);
|
|
330
331
|
return {
|
|
331
332
|
fontSize: r,
|
|
@@ -338,23 +339,23 @@ function pe(t, e) {
|
|
|
338
339
|
Math.max(0, Math.max(...d, 0)) + e.padding * 2
|
|
339
340
|
),
|
|
340
341
|
textBlockHeight: Math.min(e.height, h + e.padding * 2),
|
|
341
|
-
textX:
|
|
342
|
+
textX: ke(e.width, e.padding, e.textAlign)
|
|
342
343
|
};
|
|
343
344
|
}
|
|
344
|
-
function
|
|
345
|
+
function ze(t, e, n, i, a, r) {
|
|
345
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();
|
|
346
347
|
}
|
|
347
348
|
function de(t, e, n) {
|
|
348
349
|
return typeof t != "number" || Number.isNaN(t) || t <= 0 ? e : Math.min(t, n);
|
|
349
350
|
}
|
|
350
|
-
function
|
|
351
|
-
const n =
|
|
351
|
+
function Ie(t, e) {
|
|
352
|
+
const n = He(
|
|
352
353
|
e.canvasWidth,
|
|
353
354
|
e.panelWidth,
|
|
354
355
|
e.textAlign,
|
|
355
356
|
e.bgFit
|
|
356
357
|
), i = (e.canvasHeight - e.panelHeight) / 2, a = Math.min(e.borderRadius, Math.min(e.panelWidth, e.panelHeight) / 2);
|
|
357
|
-
|
|
358
|
+
ze(t, n, i, e.panelWidth, e.panelHeight, a), Re(t, {
|
|
358
359
|
panelX: n,
|
|
359
360
|
panelY: i,
|
|
360
361
|
panelWidth: e.panelWidth,
|
|
@@ -369,7 +370,7 @@ function ze(t, e) {
|
|
|
369
370
|
bgTextureFlipY: e.bgTextureFlipY
|
|
370
371
|
}), e.borderColor && e.borderWidth > 0 && (t.lineWidth = e.borderWidth, t.strokeStyle = e.borderColor, t.stroke());
|
|
371
372
|
}
|
|
372
|
-
function
|
|
373
|
+
function Re(t, e) {
|
|
373
374
|
if (t.save(), t.globalAlpha = Math.max(0, Math.min(e.bgOpacity, 1)), e.bgFillMode === "gradient" && e.bgGradientStops && e.bgGradientStops.length > 1) {
|
|
374
375
|
const n = t.createLinearGradient(
|
|
375
376
|
e.panelX,
|
|
@@ -383,7 +384,7 @@ function Ie(t, e) {
|
|
|
383
384
|
return;
|
|
384
385
|
}
|
|
385
386
|
if (e.bgTextureImage) {
|
|
386
|
-
t.clip(),
|
|
387
|
+
t.clip(), Ee(t, {
|
|
387
388
|
image: e.bgTextureImage,
|
|
388
389
|
x: e.panelX,
|
|
389
390
|
y: e.panelY,
|
|
@@ -397,7 +398,7 @@ function Ie(t, e) {
|
|
|
397
398
|
}
|
|
398
399
|
t.fillStyle = e.bgColor, t.fill(), t.restore();
|
|
399
400
|
}
|
|
400
|
-
function
|
|
401
|
+
function Ee(t, e) {
|
|
401
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;
|
|
402
403
|
let g = r, u = l, S = i, c = a;
|
|
403
404
|
if (f !== "stretch" && o > 0 && d > 0) {
|
|
@@ -406,7 +407,7 @@ function Re(t, e) {
|
|
|
406
407
|
}
|
|
407
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();
|
|
408
409
|
}
|
|
409
|
-
function
|
|
410
|
+
function $e(t, e, n, i, a, r) {
|
|
410
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 = {
|
|
411
412
|
xOffset: 0,
|
|
412
413
|
yOffset: 0,
|
|
@@ -493,39 +494,39 @@ function Ee(t, e, n, i, a, r) {
|
|
|
493
494
|
return c;
|
|
494
495
|
}
|
|
495
496
|
}
|
|
496
|
-
function
|
|
497
|
+
function P(t, e, n, i, a, r, l = "arc", f = 0) {
|
|
497
498
|
if (f !== 0) {
|
|
498
|
-
|
|
499
|
+
Ge(t, e, n, i, a, r, l, f);
|
|
499
500
|
return;
|
|
500
501
|
}
|
|
501
502
|
ye(t, a), r === "fill" ? t.fillText(e, n, i) : t.strokeText(e, n, i), ve(t);
|
|
502
503
|
}
|
|
503
|
-
function
|
|
504
|
+
function Ge(t, e, n, i, a, r, l, f) {
|
|
504
505
|
const s = Array.from(e);
|
|
505
506
|
if (s.length === 0) return;
|
|
506
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);
|
|
507
508
|
let b = g;
|
|
508
509
|
for (let m = 0; m < s.length; m++) {
|
|
509
|
-
const w = s[m],
|
|
510
|
+
const w = s[m], v = h[m], C = b + v / 2, W = (C - g - o / 2) / c, x = $e(
|
|
510
511
|
l,
|
|
511
|
-
|
|
512
|
+
W,
|
|
512
513
|
m,
|
|
513
514
|
s.length,
|
|
514
515
|
S,
|
|
515
516
|
c
|
|
516
517
|
);
|
|
517
|
-
t.save(), t.translate(C +
|
|
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;
|
|
518
519
|
}
|
|
519
520
|
}
|
|
520
521
|
function ue(t, e, n, i, a, r, l, f, s) {
|
|
521
|
-
const h =
|
|
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;
|
|
522
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();
|
|
523
524
|
}
|
|
524
|
-
function
|
|
525
|
+
function De(t, e) {
|
|
525
526
|
for (let n = 0; n < e.lines.length; n++) {
|
|
526
527
|
const i = e.lines[n], a = e.startY + n * e.lineHeight;
|
|
527
528
|
for (const r of e.shadowLayers)
|
|
528
|
-
t.save(), t.shadowColor = r.color, t.shadowBlur = r.blur, t.shadowOffsetX = r.offsetX ?? 0, t.shadowOffsetY = r.offsetY ?? 0, t.globalAlpha = r.opacity ?? 1, t.fillStyle = e.color,
|
|
529
|
+
t.save(), t.shadowColor = r.color, t.shadowBlur = r.blur, t.shadowOffsetX = r.offsetX ?? 0, t.shadowOffsetY = r.offsetY ?? 0, t.globalAlpha = r.opacity ?? 1, t.fillStyle = e.color, P(
|
|
529
530
|
t,
|
|
530
531
|
i,
|
|
531
532
|
e.textX,
|
|
@@ -536,7 +537,7 @@ function Ge(t, e) {
|
|
|
536
537
|
e.bendStrength
|
|
537
538
|
), t.restore();
|
|
538
539
|
for (const r of e.strokeLayers)
|
|
539
|
-
t.save(), t.lineJoin = "round", t.miterLimit = 2, t.lineWidth = r.width, t.strokeStyle = r.color, t.globalAlpha = r.opacity ?? 1,
|
|
540
|
+
t.save(), t.lineJoin = "round", t.miterLimit = 2, t.lineWidth = r.width, t.strokeStyle = r.color, t.globalAlpha = r.opacity ?? 1, P(
|
|
540
541
|
t,
|
|
541
542
|
i,
|
|
542
543
|
e.textX,
|
|
@@ -546,7 +547,7 @@ function Ge(t, e) {
|
|
|
546
547
|
e.bendPreset,
|
|
547
548
|
e.bendStrength
|
|
548
549
|
), t.restore();
|
|
549
|
-
t.save(), t.fillStyle = e.color, t.globalAlpha = 1,
|
|
550
|
+
t.save(), t.fillStyle = e.color, t.globalAlpha = 1, P(
|
|
550
551
|
t,
|
|
551
552
|
i,
|
|
552
553
|
e.textX,
|
|
@@ -578,13 +579,13 @@ function Ge(t, e) {
|
|
|
578
579
|
);
|
|
579
580
|
}
|
|
580
581
|
}
|
|
581
|
-
function
|
|
582
|
+
function qe(t, e) {
|
|
582
583
|
const n = Math.max(0, Math.min(e.intensity, 1));
|
|
583
584
|
if (n <= 0) return;
|
|
584
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;
|
|
585
586
|
for (let f = 0; f < e.lines.length; f++) {
|
|
586
587
|
const s = e.startY + f * e.lineHeight;
|
|
587
|
-
t.save(), t.globalAlpha = n, t.shadowColor = e.color, t.shadowBlur = a, t.shadowOffsetX = r, t.shadowOffsetY = l, e.style === "contoured" ? (t.lineJoin = "round", t.miterLimit = 2, t.lineWidth = Math.max(2, i * 42), t.strokeStyle = e.color,
|
|
588
|
+
t.save(), t.globalAlpha = n, t.shadowColor = e.color, t.shadowBlur = a, t.shadowOffsetX = r, t.shadowOffsetY = l, e.style === "contoured" ? (t.lineJoin = "round", t.miterLimit = 2, t.lineWidth = Math.max(2, i * 42), t.strokeStyle = e.color, P(
|
|
588
589
|
t,
|
|
589
590
|
e.lines[f],
|
|
590
591
|
e.textX,
|
|
@@ -593,7 +594,7 @@ function De(t, e) {
|
|
|
593
594
|
"stroke",
|
|
594
595
|
e.bendPreset,
|
|
595
596
|
e.bendStrength
|
|
596
|
-
)) : (t.fillStyle = e.color,
|
|
597
|
+
)) : (t.fillStyle = e.color, P(
|
|
597
598
|
t,
|
|
598
599
|
e.lines[f],
|
|
599
600
|
e.textX,
|
|
@@ -605,11 +606,11 @@ function De(t, e) {
|
|
|
605
606
|
)), t.restore();
|
|
606
607
|
}
|
|
607
608
|
}
|
|
608
|
-
function
|
|
609
|
+
function Ne(t, e) {
|
|
609
610
|
const n = Z(e.width, e.height), i = n.getContext("2d");
|
|
610
611
|
i.clearRect(0, 0, e.width, e.height), i.font = e.font, i.fillStyle = "#ffffff", i.textAlign = e.textAlign, i.textBaseline = "middle";
|
|
611
612
|
for (let l = 0; l < e.lines.length; l++)
|
|
612
|
-
|
|
613
|
+
P(
|
|
613
614
|
i,
|
|
614
615
|
e.lines[l],
|
|
615
616
|
e.textX,
|
|
@@ -622,7 +623,7 @@ function qe(t, e) {
|
|
|
622
623
|
const a = Z(e.width, e.height), r = a.getContext("2d");
|
|
623
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);
|
|
624
625
|
}
|
|
625
|
-
function
|
|
626
|
+
function Ue(t) {
|
|
626
627
|
const {
|
|
627
628
|
width: e,
|
|
628
629
|
height: n,
|
|
@@ -642,25 +643,25 @@ function Ne(t) {
|
|
|
642
643
|
textAlign: b,
|
|
643
644
|
bgFillMode: m,
|
|
644
645
|
bgOpacity: w,
|
|
645
|
-
bgFit:
|
|
646
|
+
bgFit: v,
|
|
646
647
|
bgAutoSize: C,
|
|
647
|
-
bgWidth:
|
|
648
|
-
bgHeight:
|
|
649
|
-
bgGradientStops:
|
|
650
|
-
bgTextureImage:
|
|
648
|
+
bgWidth: W,
|
|
649
|
+
bgHeight: x,
|
|
650
|
+
bgGradientStops: F,
|
|
651
|
+
bgTextureImage: L,
|
|
651
652
|
bgTextureFit: R,
|
|
652
653
|
bgTextureFlipX: E,
|
|
653
654
|
bgTextureFlipY: $,
|
|
654
655
|
underline: G,
|
|
655
656
|
strikethrough: D,
|
|
656
|
-
bendPreset:
|
|
657
|
+
bendPreset: O,
|
|
657
658
|
bendStrength: Y
|
|
658
659
|
} = t;
|
|
659
|
-
let { fontSize:
|
|
660
|
+
let { fontSize: X, bgColor: p } = t;
|
|
660
661
|
const q = [
|
|
661
662
|
...a ?? [],
|
|
662
663
|
...r && l > 0 ? [{ color: r, width: l, opacity: f }] : []
|
|
663
|
-
].filter((
|
|
664
|
+
].filter((T) => T.width > 0), N = [
|
|
664
665
|
...s ?? [],
|
|
665
666
|
...d && (g > 0 || u !== 0 || S !== 0) ? [
|
|
666
667
|
{
|
|
@@ -671,33 +672,33 @@ function Ne(t) {
|
|
|
671
672
|
opacity: c
|
|
672
673
|
}
|
|
673
674
|
] : []
|
|
674
|
-
].filter((
|
|
675
|
-
let
|
|
676
|
-
const A = Z(e, n),
|
|
677
|
-
|
|
678
|
-
const y =
|
|
679
|
-
if (
|
|
680
|
-
const
|
|
681
|
-
|
|
682
|
-
|
|
675
|
+
].filter((T) => T.blur > 0 || (T.offsetX ?? 0) !== 0 || (T.offsetY ?? 0) !== 0);
|
|
676
|
+
let k;
|
|
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,
|
|
683
684
|
e
|
|
684
|
-
),
|
|
685
|
-
|
|
686
|
-
|
|
685
|
+
), _ = de(
|
|
686
|
+
T ? void 0 : x,
|
|
687
|
+
v === "text" || T ? y.textBlockHeight : n,
|
|
687
688
|
n
|
|
688
689
|
);
|
|
689
|
-
|
|
690
|
+
Ie(M, {
|
|
690
691
|
canvasWidth: e,
|
|
691
692
|
canvasHeight: n,
|
|
692
693
|
textAlign: b,
|
|
693
|
-
bgFit:
|
|
694
|
+
bgFit: v,
|
|
694
695
|
panelWidth: U,
|
|
695
|
-
panelHeight:
|
|
696
|
-
bgColor:
|
|
696
|
+
panelHeight: _,
|
|
697
|
+
bgColor: p,
|
|
697
698
|
bgFillMode: m,
|
|
698
699
|
bgOpacity: w,
|
|
699
|
-
bgGradientStops:
|
|
700
|
-
bgTextureImage:
|
|
700
|
+
bgGradientStops: F,
|
|
701
|
+
bgTextureImage: L,
|
|
701
702
|
bgTextureFit: R,
|
|
702
703
|
bgTextureFlipX: E,
|
|
703
704
|
bgTextureFlipY: $,
|
|
@@ -706,13 +707,13 @@ function Ne(t) {
|
|
|
706
707
|
borderRadius: t.borderRadius
|
|
707
708
|
});
|
|
708
709
|
}
|
|
709
|
-
return o &&
|
|
710
|
+
return o && qe(M, {
|
|
710
711
|
lines: y.resolvedLines,
|
|
711
712
|
textX: y.textX,
|
|
712
713
|
startY: y.startY,
|
|
713
714
|
lineHeight: y.lineHeight,
|
|
714
715
|
letterSpacingPx: y.letterSpacingPx,
|
|
715
|
-
bendPreset:
|
|
716
|
+
bendPreset: O,
|
|
716
717
|
bendStrength: Y,
|
|
717
718
|
color: o.color,
|
|
718
719
|
style: o.style,
|
|
@@ -720,31 +721,31 @@ function Ne(t) {
|
|
|
720
721
|
range: o.range ?? 0.5,
|
|
721
722
|
horizontalAngle: o.horizontalAngle ?? 0,
|
|
722
723
|
verticalAngle: o.verticalAngle ?? 0
|
|
723
|
-
}),
|
|
724
|
+
}), De(M, {
|
|
724
725
|
lines: y.resolvedLines,
|
|
725
726
|
textX: y.textX,
|
|
726
727
|
startY: y.startY,
|
|
727
728
|
lineHeight: y.lineHeight,
|
|
728
729
|
textAlign: b,
|
|
729
730
|
color: i,
|
|
730
|
-
fontSize:
|
|
731
|
+
fontSize: X,
|
|
731
732
|
letterSpacingPx: y.letterSpacingPx,
|
|
732
|
-
bendPreset:
|
|
733
|
+
bendPreset: O,
|
|
733
734
|
bendStrength: Y,
|
|
734
735
|
shadowLayers: N,
|
|
735
736
|
strokeLayers: q,
|
|
736
737
|
underline: G,
|
|
737
738
|
strikethrough: D
|
|
738
|
-
}), h &&
|
|
739
|
+
}), h && Ne(M, {
|
|
739
740
|
width: e,
|
|
740
741
|
height: n,
|
|
741
|
-
font:
|
|
742
|
+
font: M.font,
|
|
742
743
|
lines: y.resolvedLines,
|
|
743
744
|
textX: y.textX,
|
|
744
745
|
startY: y.startY,
|
|
745
746
|
lineHeight: y.lineHeight,
|
|
746
747
|
letterSpacingPx: y.letterSpacingPx,
|
|
747
|
-
bendPreset:
|
|
748
|
+
bendPreset: O,
|
|
748
749
|
bendStrength: Y,
|
|
749
750
|
textAlign: b,
|
|
750
751
|
color: h.color,
|
|
@@ -752,9 +753,9 @@ function Ne(t) {
|
|
|
752
753
|
blur: h.blur,
|
|
753
754
|
offsetX: h.offsetX ?? 0,
|
|
754
755
|
offsetY: h.offsetY ?? 0
|
|
755
|
-
}),
|
|
756
|
+
}), k = new We.CanvasTexture(A), k.needsUpdate = !0, k;
|
|
756
757
|
}
|
|
757
|
-
function
|
|
758
|
+
function _e(t, e) {
|
|
758
759
|
const {
|
|
759
760
|
lines: n,
|
|
760
761
|
color: i,
|
|
@@ -773,43 +774,43 @@ function Ue(t, e) {
|
|
|
773
774
|
shadowOffsetY: b,
|
|
774
775
|
shadowOpacity: m,
|
|
775
776
|
fontWeight: w,
|
|
776
|
-
fontStyle:
|
|
777
|
+
fontStyle: v,
|
|
777
778
|
fontFamily: C,
|
|
778
|
-
fontSize:
|
|
779
|
-
textAlign:
|
|
780
|
-
verticalAlign:
|
|
781
|
-
overflow:
|
|
779
|
+
fontSize: W,
|
|
780
|
+
textAlign: x,
|
|
781
|
+
verticalAlign: F,
|
|
782
|
+
overflow: L,
|
|
782
783
|
resizeToFit: R,
|
|
783
784
|
minFontSize: E,
|
|
784
785
|
letterSpacing: $,
|
|
785
786
|
lineSpacing: G,
|
|
786
787
|
bgFillMode: D,
|
|
787
|
-
bgOpacity:
|
|
788
|
+
bgOpacity: O,
|
|
788
789
|
bgFit: Y,
|
|
789
|
-
bgAutoSize:
|
|
790
|
-
bgWidth:
|
|
790
|
+
bgAutoSize: X,
|
|
791
|
+
bgWidth: p,
|
|
791
792
|
bgHeight: q,
|
|
792
793
|
bgGradientStops: N,
|
|
793
|
-
bgTextureFit:
|
|
794
|
+
bgTextureFit: k,
|
|
794
795
|
bgTextureFlipX: A,
|
|
795
|
-
bgTextureFlipY:
|
|
796
|
+
bgTextureFlipY: M,
|
|
796
797
|
borderColor: y,
|
|
797
|
-
borderWidth:
|
|
798
|
+
borderWidth: T,
|
|
798
799
|
borderRadius: U,
|
|
799
|
-
padding:
|
|
800
|
+
padding: _,
|
|
800
801
|
aspect: ee,
|
|
801
|
-
resolution:
|
|
802
|
+
resolution: j,
|
|
802
803
|
underline: te,
|
|
803
804
|
strikethrough: ne,
|
|
804
805
|
bendPreset: re,
|
|
805
806
|
bendStrength: ie
|
|
806
|
-
} = t, ae =
|
|
807
|
+
} = t, ae = B(
|
|
807
808
|
() => r === !1 ? [] : a,
|
|
808
809
|
[r, a]
|
|
809
|
-
), le =
|
|
810
|
+
), le = B(
|
|
810
811
|
() => o === !1 ? [] : h,
|
|
811
812
|
[o, h]
|
|
812
|
-
), oe = void 0, se =
|
|
813
|
+
), oe = void 0, se = B(
|
|
813
814
|
() => ({
|
|
814
815
|
text: e.text,
|
|
815
816
|
lines: n,
|
|
@@ -827,34 +828,34 @@ function Ue(t, e) {
|
|
|
827
828
|
shadowOffsetY: o === !1 ? 0 : b,
|
|
828
829
|
shadowOpacity: m,
|
|
829
830
|
fontWeight: w,
|
|
830
|
-
fontStyle:
|
|
831
|
+
fontStyle: v,
|
|
831
832
|
fontFamily: C,
|
|
832
|
-
fontSize:
|
|
833
|
-
textAlign:
|
|
834
|
-
verticalAlign:
|
|
835
|
-
overflow:
|
|
833
|
+
fontSize: W,
|
|
834
|
+
textAlign: x,
|
|
835
|
+
verticalAlign: F,
|
|
836
|
+
overflow: L,
|
|
836
837
|
resizeToFit: R,
|
|
837
838
|
minFontSize: E,
|
|
838
839
|
letterSpacing: $,
|
|
839
840
|
lineSpacing: G,
|
|
840
841
|
bgColor: e.bgColor,
|
|
841
842
|
bgFillMode: D,
|
|
842
|
-
bgOpacity:
|
|
843
|
+
bgOpacity: O,
|
|
843
844
|
bgFit: Y,
|
|
844
|
-
bgAutoSize:
|
|
845
|
-
bgWidth:
|
|
845
|
+
bgAutoSize: X,
|
|
846
|
+
bgWidth: p,
|
|
846
847
|
bgHeight: q,
|
|
847
848
|
bgGradientStops: N,
|
|
848
849
|
bgTextureImage: oe,
|
|
849
|
-
bgTextureFit:
|
|
850
|
+
bgTextureFit: k,
|
|
850
851
|
bgTextureFlipX: A,
|
|
851
|
-
bgTextureFlipY:
|
|
852
|
+
bgTextureFlipY: M,
|
|
852
853
|
borderColor: y,
|
|
853
|
-
borderWidth:
|
|
854
|
+
borderWidth: T,
|
|
854
855
|
borderRadius: U,
|
|
855
|
-
padding:
|
|
856
|
-
height:
|
|
857
|
-
width: Math.round(
|
|
856
|
+
padding: _,
|
|
857
|
+
height: j,
|
|
858
|
+
width: Math.round(j * Math.max(ee, 0.1)),
|
|
858
859
|
underline: te,
|
|
859
860
|
strikethrough: ne,
|
|
860
861
|
bendPreset: re,
|
|
@@ -880,82 +881,83 @@ function Ue(t, e) {
|
|
|
880
881
|
b,
|
|
881
882
|
m,
|
|
882
883
|
w,
|
|
883
|
-
|
|
884
|
+
v,
|
|
884
885
|
C,
|
|
886
|
+
W,
|
|
887
|
+
x,
|
|
885
888
|
F,
|
|
886
|
-
v,
|
|
887
889
|
L,
|
|
888
|
-
I,
|
|
889
890
|
R,
|
|
890
891
|
E,
|
|
891
892
|
$,
|
|
892
893
|
G,
|
|
893
894
|
D,
|
|
894
|
-
|
|
895
|
+
O,
|
|
895
896
|
Y,
|
|
896
|
-
H,
|
|
897
897
|
X,
|
|
898
|
+
p,
|
|
898
899
|
q,
|
|
899
900
|
N,
|
|
900
901
|
oe,
|
|
901
|
-
|
|
902
|
+
k,
|
|
902
903
|
A,
|
|
903
|
-
|
|
904
|
+
M,
|
|
904
905
|
y,
|
|
905
|
-
|
|
906
|
+
T,
|
|
906
907
|
U,
|
|
907
|
-
|
|
908
|
+
_,
|
|
908
909
|
ee,
|
|
909
|
-
|
|
910
|
+
j,
|
|
910
911
|
te,
|
|
911
912
|
ne,
|
|
912
913
|
re,
|
|
913
914
|
ie
|
|
914
915
|
]
|
|
915
|
-
), fe =
|
|
916
|
+
), fe = B(() => Ue(se), [se]);
|
|
916
917
|
return Ye(fe), fe;
|
|
917
918
|
}
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
919
|
+
const je = ["color"];
|
|
920
|
+
function tt(t) {
|
|
921
|
+
const e = Le(t, je), n = { ...Oe, ...e }, {
|
|
922
|
+
text: i,
|
|
923
|
+
bgColor: a,
|
|
924
|
+
opacity: r,
|
|
925
|
+
name: l,
|
|
926
|
+
overlay: f = !0,
|
|
927
|
+
position: s,
|
|
928
|
+
rotation: h,
|
|
929
|
+
scale: o,
|
|
930
|
+
visible: d,
|
|
931
|
+
renderOrder: g
|
|
932
|
+
} = n, [u, S] = he(null), [c, b] = he(null), m = J(i);
|
|
933
|
+
m.current !== i && (m.current = i, u !== null && S(null));
|
|
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 });
|
|
935
937
|
return be(() => {
|
|
936
|
-
const
|
|
937
|
-
if (
|
|
938
|
-
return
|
|
939
|
-
delete
|
|
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;
|
|
940
942
|
};
|
|
941
|
-
}, []), /* @__PURE__ */
|
|
943
|
+
}, []), /* @__PURE__ */ z(
|
|
942
944
|
me,
|
|
943
945
|
{
|
|
944
|
-
ref:
|
|
945
|
-
name:
|
|
946
|
-
texture:
|
|
947
|
-
overlay:
|
|
948
|
-
opacity:
|
|
949
|
-
position:
|
|
950
|
-
rotation:
|
|
951
|
-
scale:
|
|
952
|
-
visible:
|
|
953
|
-
renderOrder:
|
|
946
|
+
ref: v,
|
|
947
|
+
name: l,
|
|
948
|
+
texture: x,
|
|
949
|
+
overlay: f,
|
|
950
|
+
opacity: r,
|
|
951
|
+
position: s,
|
|
952
|
+
rotation: h,
|
|
953
|
+
scale: o,
|
|
954
|
+
visible: d,
|
|
955
|
+
renderOrder: g
|
|
954
956
|
}
|
|
955
957
|
);
|
|
956
958
|
}
|
|
957
959
|
export {
|
|
958
|
-
|
|
959
|
-
|
|
960
|
+
et as S,
|
|
961
|
+
tt as T,
|
|
960
962
|
Ye as u
|
|
961
963
|
};
|