@needle-tools/engine 4.8.0-next.9de3f45 → 4.8.0-next.c98d4ee
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/gltf-progressive--2HtE1d8.umd.cjs +8 -0
- package/dist/gltf-progressive-CeuEsYpY.min.js +8 -0
- package/dist/gltf-progressive-DY5t1MFv.js +1370 -0
- package/dist/loader.worker-8olmVOL4.js +1 -0
- package/dist/needle-engine.bundle-BGWBaskf.min.js +1607 -0
- package/dist/needle-engine.bundle-By9CcUKE.js +42600 -0
- package/dist/needle-engine.bundle-Dc3rwg_0.umd.cjs +1607 -0
- package/dist/needle-engine.d.ts +15 -15
- package/dist/needle-engine.js +591 -592
- package/dist/needle-engine.min.js +1 -1
- package/dist/needle-engine.umd.cjs +1 -1
- package/dist/{postprocessing-BzY0H7ry.min.js → postprocessing-ChsrvDkI.min.js} +54 -54
- package/dist/{postprocessing-vKBVFpSz.js → postprocessing-DElbMQgB.js} +479 -483
- package/dist/{postprocessing-Dw2OCMp4.umd.cjs → postprocessing-DtxaELce.umd.cjs} +66 -66
- package/dist/{three-examples-DUcCNw9s.umd.cjs → three-examples-BhQvv1B9.umd.cjs} +11 -11
- package/dist/{three-examples-tvuhV8Ne.js → three-examples-CM6Iip03.js} +23 -27
- package/dist/{three-examples-BMOhDaYR.min.js → three-examples-D2zemuAM.min.js} +12 -12
- package/dist/{three-mesh-ui-CxuWt7m-.js → three-mesh-ui-D6Mz5Yl7.js} +799 -810
- package/dist/three-mesh-ui-DWcMuyQ_.min.js +406 -0
- package/dist/three-mesh-ui-tt0buEDC.umd.cjs +406 -0
- package/dist/{vendor-BmYIgaS1.js → vendor-ClB-U1Hn.js} +10 -10
- package/dist/{vendor-Cavtu3CP.umd.cjs → vendor-bOWOWClg.umd.cjs} +1 -1
- package/package.json +3 -3
- package/plugins/vite/dependencies.js +28 -19
- package/dist/gltf-progressive-Bz6FXMZ1.min.js +0 -8
- package/dist/gltf-progressive-DAdiYt1v.js +0 -1392
- package/dist/gltf-progressive-D_S7mZaT.umd.cjs +0 -8
- package/dist/loader.worker-qHzhYKEC.js +0 -1
- package/dist/needle-engine.bundle-C5vAAuK3.js +0 -43849
- package/dist/needle-engine.bundle-fg0LG9Pa.umd.cjs +0 -1607
- package/dist/needle-engine.bundle-tepIih-J.min.js +0 -1607
- package/dist/three-mesh-ui-B3p3gyUz.min.js +0 -406
- package/dist/three-mesh-ui-CQiIQIlA.umd.cjs +0 -406
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
var Ct = (i, e, t) => e in i ? It(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
|
|
3
|
-
var I = (i, e, t) => Ct(i, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
-
import { Vector4 as Rt, Vector3 as Bt, Vector2 as Ut, TextureLoader as At, Texture as Tt, ShaderMaterial as Mt, PlaneGeometry as Ft, Plane as Ot, Object3D as Lt, MeshBasicMaterial as zt, Mesh as Wt, LinearFilter as Et, FrontSide as Dt, FileLoader as Ht, EventDispatcher as Gt, DoubleSide as $t, Color as Nt, BufferGeometry as Xt, BufferAttribute as jt, BackSide as Yt } from "./three-DrqIzZTH.js";
|
|
1
|
+
import { Vector4 as Pt, Vector3 as It, Vector2 as Ct, TextureLoader as Rt, Texture as Bt, ShaderMaterial as Ut, PlaneGeometry as At, Plane as Tt, Object3D as Mt, MeshBasicMaterial as Ft, Mesh as Ot, LinearFilter as Lt, FrontSide as zt, FileLoader as Wt, EventDispatcher as Et, DoubleSide as Dt, Color as Ht, BufferGeometry as Gt, BufferAttribute as $t, BackSide as Nt } from "./three-DrqIzZTH.js";
|
|
5
2
|
var V = {};
|
|
6
3
|
V.d = (i, e) => {
|
|
7
4
|
for (var t in e)
|
|
@@ -19,39 +16,39 @@ V.d(m, {
|
|
|
19
16
|
),
|
|
20
17
|
nS: () => (
|
|
21
18
|
/* reexport */
|
|
22
|
-
|
|
19
|
+
yt
|
|
23
20
|
),
|
|
24
21
|
eB: () => (
|
|
25
22
|
/* reexport */
|
|
26
|
-
|
|
23
|
+
T
|
|
27
24
|
),
|
|
28
25
|
Yp: () => (
|
|
29
26
|
/* reexport */
|
|
30
|
-
|
|
27
|
+
ne
|
|
31
28
|
),
|
|
32
29
|
VB: () => (
|
|
33
30
|
/* reexport */
|
|
34
|
-
|
|
31
|
+
I
|
|
35
32
|
),
|
|
36
33
|
BC: () => (
|
|
37
34
|
/* reexport */
|
|
38
|
-
|
|
35
|
+
O
|
|
39
36
|
),
|
|
40
37
|
zN: () => (
|
|
41
38
|
/* reexport */
|
|
42
|
-
|
|
39
|
+
C
|
|
43
40
|
),
|
|
44
41
|
cV: () => (
|
|
45
42
|
/* reexport */
|
|
46
|
-
|
|
43
|
+
B
|
|
47
44
|
),
|
|
48
45
|
hW: () => (
|
|
49
46
|
/* reexport */
|
|
50
|
-
|
|
47
|
+
F
|
|
51
48
|
),
|
|
52
49
|
k2: () => (
|
|
53
50
|
/* reexport */
|
|
54
|
-
|
|
51
|
+
ze
|
|
55
52
|
),
|
|
56
53
|
K6: () => (
|
|
57
54
|
/* reexport */
|
|
@@ -59,53 +56,53 @@ V.d(m, {
|
|
|
59
56
|
),
|
|
60
57
|
M7: () => (
|
|
61
58
|
/* reexport */
|
|
62
|
-
|
|
59
|
+
oe
|
|
63
60
|
),
|
|
64
61
|
ls: () => (
|
|
65
62
|
/* reexport */
|
|
66
|
-
|
|
63
|
+
L
|
|
67
64
|
),
|
|
68
65
|
Hi: () => (
|
|
69
66
|
/* reexport */
|
|
70
|
-
|
|
67
|
+
tt
|
|
71
68
|
),
|
|
72
69
|
EY: () => (
|
|
73
70
|
/* reexport */
|
|
74
|
-
|
|
71
|
+
M
|
|
75
72
|
),
|
|
76
73
|
MR: () => (
|
|
77
74
|
/* reexport */
|
|
78
|
-
|
|
75
|
+
je
|
|
79
76
|
),
|
|
80
77
|
zf: () => (
|
|
81
78
|
/* reexport */
|
|
82
|
-
|
|
79
|
+
Le
|
|
83
80
|
),
|
|
84
81
|
Ay: () => (
|
|
85
82
|
/* binding */
|
|
86
|
-
|
|
83
|
+
an
|
|
87
84
|
),
|
|
88
85
|
yo: () => (
|
|
89
86
|
/* binding */
|
|
90
|
-
|
|
87
|
+
bt
|
|
91
88
|
)
|
|
92
89
|
});
|
|
90
|
+
var ne = {};
|
|
91
|
+
V.r(ne);
|
|
92
|
+
V.d(ne, {
|
|
93
|
+
get: () => Fe,
|
|
94
|
+
set: () => Xt
|
|
95
|
+
});
|
|
93
96
|
var oe = {};
|
|
94
97
|
V.r(oe);
|
|
95
98
|
V.d(oe, {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
V.r(ae);
|
|
101
|
-
V.d(ae, {
|
|
102
|
-
alphaTestTransformer: () => K,
|
|
103
|
-
asPreprocessorValueTransformer: () => Ke,
|
|
104
|
-
toPreprocessorTriggerTransformer: () => ve,
|
|
105
|
-
toUserDataTransformer: () => os,
|
|
99
|
+
alphaTestTransformer: () => Y,
|
|
100
|
+
asPreprocessorValueTransformer: () => Ye,
|
|
101
|
+
toPreprocessorTriggerTransformer: () => me,
|
|
102
|
+
toUserDataTransformer: () => ss,
|
|
106
103
|
uniformOrUserDataTransformer: () => x
|
|
107
104
|
});
|
|
108
|
-
const
|
|
105
|
+
const se = {
|
|
109
106
|
fontFamily: null,
|
|
110
107
|
fontSize: 0.05,
|
|
111
108
|
fontKerning: "auto",
|
|
@@ -142,11 +139,11 @@ const re = {
|
|
|
142
139
|
letterSpacing: 0,
|
|
143
140
|
invertAlpha: !1,
|
|
144
141
|
segments: 1
|
|
145
|
-
},
|
|
142
|
+
}, Xt = function(i) {
|
|
146
143
|
for (const e in i)
|
|
147
|
-
|
|
148
|
-
},
|
|
149
|
-
return Object.prototype.hasOwnProperty.call(
|
|
144
|
+
se[e] = i[e];
|
|
145
|
+
}, Fe = function(i) {
|
|
146
|
+
return Object.prototype.hasOwnProperty.call(se, i) || console.warn(`ThreeMeshUI::DefaultValues is trying to retrieve non-existing property '${i}'`), se[i];
|
|
150
147
|
};
|
|
151
148
|
class p {
|
|
152
149
|
/**
|
|
@@ -230,7 +227,7 @@ class p {
|
|
|
230
227
|
* @return {any}
|
|
231
228
|
*/
|
|
232
229
|
getDefaultValue() {
|
|
233
|
-
return
|
|
230
|
+
return Fe(this._id);
|
|
234
231
|
}
|
|
235
232
|
/* eslint-disable no-unused-vars */
|
|
236
233
|
/**
|
|
@@ -257,7 +254,7 @@ class p {
|
|
|
257
254
|
this._needsRender = !1;
|
|
258
255
|
}
|
|
259
256
|
}
|
|
260
|
-
class
|
|
257
|
+
class jt extends p {
|
|
261
258
|
constructor() {
|
|
262
259
|
super("renderOrder", "auto", !0), this.output = this._outputValue, this._actualValue = 0;
|
|
263
260
|
}
|
|
@@ -293,7 +290,7 @@ class qt extends p {
|
|
|
293
290
|
return this._value;
|
|
294
291
|
}
|
|
295
292
|
}
|
|
296
|
-
class
|
|
293
|
+
class C extends p {
|
|
297
294
|
/**
|
|
298
295
|
*
|
|
299
296
|
* @param {string} propertyId
|
|
@@ -331,7 +328,7 @@ class R extends p {
|
|
|
331
328
|
return this._value === "inherit" ? this._notInheritedValue : this._value;
|
|
332
329
|
}
|
|
333
330
|
}
|
|
334
|
-
class
|
|
331
|
+
class Yt extends C {
|
|
335
332
|
constructor() {
|
|
336
333
|
super("offset", "inherit", !1);
|
|
337
334
|
}
|
|
@@ -340,20 +337,20 @@ class Jt extends R {
|
|
|
340
337
|
super.update(e, t), e._parent._value !== null && (e.position.z = this._notInheritedValue);
|
|
341
338
|
}
|
|
342
339
|
}
|
|
343
|
-
class
|
|
340
|
+
class Kt extends C {
|
|
344
341
|
constructor() {
|
|
345
|
-
super("fontSmooth", "inherit", !0), this._needsUpdate = !1, this.isValid =
|
|
342
|
+
super("fontSmooth", "inherit", !0), this._needsUpdate = !1, this.isValid = Jt, this.output = this._outputValue;
|
|
346
343
|
}
|
|
347
344
|
}
|
|
348
|
-
const
|
|
349
|
-
function
|
|
350
|
-
return
|
|
345
|
+
const qt = ["inherit", "none", "antialiased"];
|
|
346
|
+
function Jt(i) {
|
|
347
|
+
return qt.indexOf(i) === -1 ? (console.warn(`.fontSmoothing value '${i}' is not valid. Aborted`), !1) : !0;
|
|
351
348
|
}
|
|
352
|
-
var
|
|
349
|
+
var Zt = (i) => {
|
|
353
350
|
var e = {};
|
|
354
351
|
return V.d(e, i), e;
|
|
355
352
|
};
|
|
356
|
-
const u =
|
|
353
|
+
const u = Zt({ BackSide: () => Nt, BufferAttribute: () => $t, BufferGeometry: () => Gt, Color: () => Ht, DoubleSide: () => Dt, EventDispatcher: () => Et, FileLoader: () => Wt, FrontSide: () => zt, LinearFilter: () => Lt, Mesh: () => Ot, MeshBasicMaterial: () => Ft, Object3D: () => Mt, Plane: () => Tt, PlaneGeometry: () => At, ShaderMaterial: () => Ut, Texture: () => Bt, TextureLoader: () => Rt, Vector2: () => Ct, Vector3: () => It, Vector4: () => Pt });
|
|
357
354
|
class g extends p {
|
|
358
355
|
/**
|
|
359
356
|
*
|
|
@@ -430,7 +427,7 @@ class g extends p {
|
|
|
430
427
|
return t ? t[`_${this._id}`].getInheritedInput(t) : this.getDefaultValue();
|
|
431
428
|
}
|
|
432
429
|
}
|
|
433
|
-
class
|
|
430
|
+
class j extends g {
|
|
434
431
|
constructor(e, t) {
|
|
435
432
|
super(e, t, !1), this._input = new u.Vector4(0, 0, 0, 0), this._inline = null, this._value = new u.Vector4(0, 0, 0, 0);
|
|
436
433
|
}
|
|
@@ -542,7 +539,7 @@ class Y extends g {
|
|
|
542
539
|
isNaN(t) || e.setScalar(t);
|
|
543
540
|
}
|
|
544
541
|
}
|
|
545
|
-
class
|
|
542
|
+
class Qt extends j {
|
|
546
543
|
constructor() {
|
|
547
544
|
super("padding", new u.Vector4(0, 0, 0, 0));
|
|
548
545
|
}
|
|
@@ -550,7 +547,7 @@ class ii extends Y {
|
|
|
550
547
|
super.computeOutputValue(e), e._bounds._needsUpdate = !0, e._bounds._needsRender = !0, e._layouter._needsProcess = !0, e._renderer._needsRender = !0, e._parent._value && (e._parent._value._layouter._needsProcess = !0);
|
|
551
548
|
}
|
|
552
549
|
}
|
|
553
|
-
class
|
|
550
|
+
class ei extends j {
|
|
554
551
|
constructor() {
|
|
555
552
|
super("margin", new u.Vector4(0, 0, 0, 0));
|
|
556
553
|
}
|
|
@@ -558,12 +555,12 @@ class si extends Y {
|
|
|
558
555
|
super.computeOutputValue(e), e._renderer._needsRender = !0, e._parent._value && (e._parent._value._flexDirection._needsProcess = !0);
|
|
559
556
|
}
|
|
560
557
|
}
|
|
561
|
-
const
|
|
558
|
+
const Ie = function(i, e, t) {
|
|
562
559
|
i[e] = t;
|
|
563
|
-
},
|
|
560
|
+
}, ti = function(i, e, t) {
|
|
564
561
|
t !== null && (i[e] = t);
|
|
565
562
|
};
|
|
566
|
-
class
|
|
563
|
+
class z {
|
|
567
564
|
/**
|
|
568
565
|
* @constructor
|
|
569
566
|
* @param {MediationDefinition} definition
|
|
@@ -589,7 +586,7 @@ class W {
|
|
|
589
586
|
for (const n in this._definition) {
|
|
590
587
|
const o = this._definition[n];
|
|
591
588
|
if (s[n] !== void 0) {
|
|
592
|
-
const a = o.t ? o.t :
|
|
589
|
+
const a = o.t ? o.t : Ie;
|
|
593
590
|
a(t, o.m, s[n]), r && a(r, o.m, s[n]);
|
|
594
591
|
}
|
|
595
592
|
}
|
|
@@ -610,13 +607,13 @@ class W {
|
|
|
610
607
|
for (const o in r) {
|
|
611
608
|
const a = r[o];
|
|
612
609
|
if (s[o] !== void 0) {
|
|
613
|
-
const l = a.t ? a.t :
|
|
610
|
+
const l = a.t ? a.t : Ie;
|
|
614
611
|
l(t, a.m, s[o]), n && l(n, a.m, s[o]);
|
|
615
612
|
}
|
|
616
613
|
}
|
|
617
614
|
}
|
|
618
615
|
}
|
|
619
|
-
class
|
|
616
|
+
class ii extends p {
|
|
620
617
|
constructor() {
|
|
621
618
|
super("parent", null, !1);
|
|
622
619
|
}
|
|
@@ -656,10 +653,10 @@ class ni extends p {
|
|
|
656
653
|
this._value = null;
|
|
657
654
|
}
|
|
658
655
|
}
|
|
659
|
-
const
|
|
656
|
+
const re = function(i, e, t = 6) {
|
|
660
657
|
return i.toFixed(t) === e.toFixed(t);
|
|
661
658
|
};
|
|
662
|
-
class
|
|
659
|
+
class Ce extends p {
|
|
663
660
|
/**
|
|
664
661
|
*
|
|
665
662
|
* @param {string} propertyId
|
|
@@ -673,7 +670,7 @@ class Re extends p {
|
|
|
673
670
|
* @param {number} value
|
|
674
671
|
*/
|
|
675
672
|
set value(e) {
|
|
676
|
-
this.isValid(e) && (
|
|
673
|
+
this.isValid(e) && (re(this._value, e) || (this._value = e, this._needsUpdate = !0));
|
|
677
674
|
}
|
|
678
675
|
/**
|
|
679
676
|
*
|
|
@@ -683,20 +680,20 @@ class Re extends p {
|
|
|
683
680
|
return this._value;
|
|
684
681
|
}
|
|
685
682
|
}
|
|
686
|
-
class
|
|
683
|
+
class Re extends C {
|
|
687
684
|
/**
|
|
688
685
|
*
|
|
689
686
|
* @param {string} propertyId
|
|
690
687
|
*/
|
|
691
688
|
constructor(e) {
|
|
692
|
-
super(e, "inherit", !0), this.isValid =
|
|
689
|
+
super(e, "inherit", !0), this.isValid = ri;
|
|
693
690
|
}
|
|
694
691
|
}
|
|
695
|
-
const
|
|
696
|
-
function
|
|
697
|
-
return
|
|
692
|
+
const si = [u.FrontSide, u.BackSide, u.DoubleSide];
|
|
693
|
+
function ri(i) {
|
|
694
|
+
return si.indexOf(i) === -1 ? (console.warn(`SideProperty value '${i}' is not valid. Abort`), !1) : !0;
|
|
698
695
|
}
|
|
699
|
-
class
|
|
696
|
+
class Oe {
|
|
700
697
|
constructor() {
|
|
701
698
|
this._offsetX = 0, this._offsetY = 0, this._lineBreak = null, this._kerning = 0, this._fontFactor = 1, this._fontSize = 0, this._cumulativeWidth = 0, this._paddingLeft = 0, this._paddingRight = 0, this._marginLeft = 0, this._marginRight = 0;
|
|
702
699
|
}
|
|
@@ -917,7 +914,7 @@ class Le {
|
|
|
917
914
|
return this._fontFactor;
|
|
918
915
|
}
|
|
919
916
|
}
|
|
920
|
-
class
|
|
917
|
+
class Le {
|
|
921
918
|
/**
|
|
922
919
|
*
|
|
923
920
|
* @param {TypographicFont} typographicFont
|
|
@@ -1000,7 +997,7 @@ class ze {
|
|
|
1000
997
|
throw new Error("Abstract... Need to be implemented");
|
|
1001
998
|
}
|
|
1002
999
|
}
|
|
1003
|
-
class
|
|
1000
|
+
class ze extends Oe {
|
|
1004
1001
|
/**
|
|
1005
1002
|
*
|
|
1006
1003
|
* @param {TypographicGlyph} characterDesc
|
|
@@ -1082,25 +1079,25 @@ class We extends Le {
|
|
|
1082
1079
|
return this._typographic.font.lineBase * this._fontFactor;
|
|
1083
1080
|
}
|
|
1084
1081
|
}
|
|
1085
|
-
const
|
|
1082
|
+
const ni = {
|
|
1086
1083
|
light: "100",
|
|
1087
1084
|
normal: "400",
|
|
1088
1085
|
bold: "700",
|
|
1089
1086
|
bolder: "900"
|
|
1090
1087
|
};
|
|
1091
|
-
function
|
|
1088
|
+
function ae(i) {
|
|
1092
1089
|
if (!isNaN(i)) return i.toString();
|
|
1093
|
-
const e =
|
|
1090
|
+
const e = ni[i];
|
|
1094
1091
|
return e || i;
|
|
1095
1092
|
}
|
|
1096
|
-
class
|
|
1093
|
+
class oi extends u.EventDispatcher {
|
|
1097
1094
|
/**
|
|
1098
1095
|
*
|
|
1099
1096
|
* @param {import('./../core/elements/MeshUIBaseElement').FontWeightFormat} weight
|
|
1100
1097
|
* @param {"normal"|"italic"} style
|
|
1101
1098
|
*/
|
|
1102
1099
|
constructor(e, t) {
|
|
1103
|
-
super(), this._isReady = !1, this._weight =
|
|
1100
|
+
super(), this._isReady = !1, this._weight = ae(e), this._style = t, this._size = 42, this._lineHeight = 42, this._lineBase = 42, this._font = null;
|
|
1104
1101
|
}
|
|
1105
1102
|
/**
|
|
1106
1103
|
*
|
|
@@ -1219,7 +1216,7 @@ class hi extends u.EventDispatcher {
|
|
|
1219
1216
|
* @private
|
|
1220
1217
|
*/
|
|
1221
1218
|
_checkReadiness() {
|
|
1222
|
-
this._readyCondition() &&
|
|
1219
|
+
this._readyCondition() && ui(this);
|
|
1223
1220
|
}
|
|
1224
1221
|
/* eslint-disable no-unused-vars */
|
|
1225
1222
|
/**
|
|
@@ -1240,18 +1237,18 @@ class hi extends u.EventDispatcher {
|
|
|
1240
1237
|
throw new Error(`FontVariant(${typeof this})::_readyCondition() is abstract and should therefore be overridden.`);
|
|
1241
1238
|
}
|
|
1242
1239
|
}
|
|
1243
|
-
const
|
|
1244
|
-
function
|
|
1245
|
-
i._isReady = !0, i.dispatchEvent(
|
|
1240
|
+
const ai = { type: "ready" };
|
|
1241
|
+
function ui(i) {
|
|
1242
|
+
i._isReady = !0, i.dispatchEvent(ai);
|
|
1246
1243
|
}
|
|
1247
|
-
const
|
|
1248
|
-
class
|
|
1244
|
+
const O = oi;
|
|
1245
|
+
class hi extends p {
|
|
1249
1246
|
/**
|
|
1250
1247
|
*
|
|
1251
1248
|
* @param {FontVariant} [value=null]
|
|
1252
1249
|
*/
|
|
1253
1250
|
constructor(e = null) {
|
|
1254
|
-
super("font", e, !1), this._needsUpdate = !1, this._fontVariant = null, this._handleFontReadyClosure = null, this.isValid =
|
|
1251
|
+
super("font", e, !1), this._needsUpdate = !1, this._fontVariant = null, this._handleFontReadyClosure = null, this.isValid = li;
|
|
1255
1252
|
}
|
|
1256
1253
|
output(e) {
|
|
1257
1254
|
e[this._id] = this._fontVariant;
|
|
@@ -1262,7 +1259,7 @@ class di extends p {
|
|
|
1262
1259
|
* @override
|
|
1263
1260
|
*/
|
|
1264
1261
|
update(e, t) {
|
|
1265
|
-
if (this._fontVariant && !this._fontVariant.isReady && this._fontVariant.removeEventListener("ready", this._handleFontReadyClosure), this._value && this._value instanceof
|
|
1262
|
+
if (this._fontVariant && !this._fontVariant.isReady && this._fontVariant.removeEventListener("ready", this._handleFontReadyClosure), this._value && this._value instanceof O)
|
|
1266
1263
|
this._fontVariant = this._value;
|
|
1267
1264
|
else {
|
|
1268
1265
|
const s = e._fontFamily._value;
|
|
@@ -1271,7 +1268,7 @@ class di extends p {
|
|
|
1271
1268
|
e._fontStyle._value
|
|
1272
1269
|
));
|
|
1273
1270
|
}
|
|
1274
|
-
this._fontVariant && (this._fontVariant._alterElementProperties(e), this._handleFontReadyClosure =
|
|
1271
|
+
this._fontVariant && (this._fontVariant._alterElementProperties(e), this._handleFontReadyClosure = ci(e, this), this._fontVariant.isReady ? this._handleFontReadyClosure() : this._fontVariant.addEventListener("ready", this._handleFontReadyClosure), (!e._fontMaterial._defaultMaterial || !(e._fontMaterial._defaultMaterial instanceof this._fontVariant.fontMaterial)) && (e._fontMaterial._defaultMaterial = new this._fontVariant.fontMaterial(), e._fontMaterial._needsUpdate = !0));
|
|
1275
1272
|
}
|
|
1276
1273
|
/**
|
|
1277
1274
|
* @override
|
|
@@ -1301,39 +1298,39 @@ class di extends p {
|
|
|
1301
1298
|
this._handleFontReadyClosure && (this._fontVariant.removeEventListener("ready", this._handleFontReadyClosure), this._handleFontReadyClosure = null), this._value = null, this._fontVariant = null;
|
|
1302
1299
|
}
|
|
1303
1300
|
}
|
|
1304
|
-
function
|
|
1305
|
-
return i instanceof
|
|
1301
|
+
function li(i) {
|
|
1302
|
+
return i instanceof O ? !0 : (console.warn(`.font value '${i}' is not valid. It requires a FontVariant instance. Aborted`), !1);
|
|
1306
1303
|
}
|
|
1307
|
-
function
|
|
1304
|
+
function ci(i, e) {
|
|
1308
1305
|
return function() {
|
|
1309
1306
|
e._needsUpdate = !0, i._glyphs._needsProcess = !0, e._fontVariant.removeEventListener("ready", e._handleFontReadyClosure), e._handleFontReadyClosure = null;
|
|
1310
1307
|
};
|
|
1311
1308
|
}
|
|
1312
|
-
class
|
|
1309
|
+
class di extends g {
|
|
1313
1310
|
constructor(e) {
|
|
1314
|
-
super("display", e), this._value = "flex", this._allowsInherit = !1, this._needsUpdate = !1, this.isValidValue =
|
|
1311
|
+
super("display", e), this._value = "flex", this._allowsInherit = !1, this._needsUpdate = !1, this.isValidValue = fi;
|
|
1315
1312
|
}
|
|
1316
1313
|
computeOutputValue(e) {
|
|
1317
1314
|
e._visible._value = this._output !== "none";
|
|
1318
1315
|
}
|
|
1319
1316
|
}
|
|
1320
|
-
const
|
|
1321
|
-
function
|
|
1322
|
-
return
|
|
1317
|
+
const _i = ["none", "flex"];
|
|
1318
|
+
function fi(i) {
|
|
1319
|
+
return _i.indexOf(i) === -1 ? (console.warn(`(.style) display value '${i}' is not valid. Aborted`), !1) : !0;
|
|
1323
1320
|
}
|
|
1324
|
-
class
|
|
1321
|
+
class pi extends g {
|
|
1325
1322
|
constructor(e) {
|
|
1326
|
-
super("boxSizing", e), this._allowsInherit = !1, this.isValidValue =
|
|
1323
|
+
super("boxSizing", e), this._allowsInherit = !1, this.isValidValue = mi;
|
|
1327
1324
|
}
|
|
1328
1325
|
computeOutputValue(e) {
|
|
1329
1326
|
this._value = this._inheritedInput, e._bounds._needsUpdate = !0;
|
|
1330
1327
|
}
|
|
1331
1328
|
}
|
|
1332
|
-
const
|
|
1333
|
-
function
|
|
1334
|
-
return
|
|
1329
|
+
const gi = ["border-box", "content-box"];
|
|
1330
|
+
function mi(i) {
|
|
1331
|
+
return gi.indexOf(i) === -1 ? (console.warn(`(.style) boxSizing value '${i}' is not valid. Aborted`), !1) : !0;
|
|
1335
1332
|
}
|
|
1336
|
-
class
|
|
1333
|
+
class U extends g {
|
|
1337
1334
|
constructor(e, t) {
|
|
1338
1335
|
super(e, t, !1), this._value = new u.Color(), this.output = this._outputValue;
|
|
1339
1336
|
}
|
|
@@ -1348,25 +1345,25 @@ class A extends g {
|
|
|
1348
1345
|
this._input = this._inline = e, this._needsUpdate = !0;
|
|
1349
1346
|
}
|
|
1350
1347
|
}
|
|
1351
|
-
class
|
|
1348
|
+
class Z extends g {
|
|
1352
1349
|
/**
|
|
1353
1350
|
*
|
|
1354
1351
|
* @param {string} propertyId
|
|
1355
1352
|
* @param {any} defaultValue
|
|
1356
1353
|
*/
|
|
1357
1354
|
constructor(e, t) {
|
|
1358
|
-
super(e, t, !0), this.isValidValue =
|
|
1355
|
+
super(e, t, !0), this.isValidValue = vi, this._allowsInherit = !1, this._input = t, this._value = t, this.output = this._outputValue, this.computeOutputValue = this._computeFromInherited;
|
|
1359
1356
|
}
|
|
1360
1357
|
_outputValue(e) {
|
|
1361
1358
|
e[this._id] = this._inheritedInput;
|
|
1362
1359
|
}
|
|
1363
1360
|
}
|
|
1364
|
-
function
|
|
1361
|
+
function vi(i) {
|
|
1365
1362
|
return i < 0 && i > 1 ? (console.warn(`(.style) styleFactorProperty('${this.id}') value '${i}' is not valid)`), !1) : !0;
|
|
1366
1363
|
}
|
|
1367
|
-
class
|
|
1364
|
+
class yi extends g {
|
|
1368
1365
|
constructor(e) {
|
|
1369
|
-
super("backgroundImage", e, !0), this._input = null, this._allowsInherit = !1, this._textureSize = new u.Vector2(1, 1), this.isValidValue =
|
|
1366
|
+
super("backgroundImage", e, !0), this._input = null, this._allowsInherit = !1, this._textureSize = new u.Vector2(1, 1), this.isValidValue = bi;
|
|
1370
1367
|
}
|
|
1371
1368
|
/**
|
|
1372
1369
|
* @override
|
|
@@ -1395,21 +1392,21 @@ class wi extends g {
|
|
|
1395
1392
|
this._value ? this._textureSize.set(this._value.image.width, this._value.image.height) : this._textureSize.set(1, 1);
|
|
1396
1393
|
}
|
|
1397
1394
|
}
|
|
1398
|
-
function
|
|
1395
|
+
function bi(i) {
|
|
1399
1396
|
return !0;
|
|
1400
1397
|
}
|
|
1401
|
-
class
|
|
1398
|
+
class xi extends g {
|
|
1402
1399
|
constructor(e) {
|
|
1403
|
-
super("backgroundSize", e, !0), this.isValidValue =
|
|
1400
|
+
super("backgroundSize", e, !0), this.isValidValue = Si, this.output = this._outputValue;
|
|
1404
1401
|
}
|
|
1405
1402
|
}
|
|
1406
|
-
const
|
|
1407
|
-
function
|
|
1408
|
-
return
|
|
1403
|
+
const wi = ["cover", "contain", "stretch"];
|
|
1404
|
+
function Si(i) {
|
|
1405
|
+
return wi.indexOf(i) === -1 ? (console.warn(`(.style) backgroundSize value '${i}' is not valid. Aborted`), !1) : !0;
|
|
1409
1406
|
}
|
|
1410
|
-
class
|
|
1407
|
+
class Vi extends g {
|
|
1411
1408
|
constructor(e) {
|
|
1412
|
-
super("overflow", e, !0), this.isValidValue =
|
|
1409
|
+
super("overflow", e, !0), this.isValidValue = Pi, this._clippingPlanes = null, this._renderStrategy = this._emptyRender;
|
|
1413
1410
|
}
|
|
1414
1411
|
/**
|
|
1415
1412
|
* Update of overflow is a bit different, as parent may trigger changes on it
|
|
@@ -1488,29 +1485,29 @@ class Ii extends g {
|
|
|
1488
1485
|
}
|
|
1489
1486
|
}
|
|
1490
1487
|
}
|
|
1491
|
-
const
|
|
1492
|
-
function
|
|
1493
|
-
return
|
|
1488
|
+
const ki = ["visible", "hidden"];
|
|
1489
|
+
function Pi(i) {
|
|
1490
|
+
return ki.indexOf(i) === -1 ? (console.warn(`(.style) overflow value '${i}' is not valid. Aborted`), !1) : !0;
|
|
1494
1491
|
}
|
|
1495
|
-
const
|
|
1496
|
-
return
|
|
1492
|
+
const R = "rem", We = "em", G = "%", Ii = [R, We, G], Ee = function(i) {
|
|
1493
|
+
return Ii.indexOf(i) === -1 ? R : i;
|
|
1497
1494
|
};
|
|
1498
|
-
class
|
|
1495
|
+
class Ci extends j {
|
|
1499
1496
|
/**
|
|
1500
1497
|
*
|
|
1501
1498
|
* @param {Vector4} defaultValue
|
|
1502
1499
|
*/
|
|
1503
1500
|
constructor(e) {
|
|
1504
1501
|
super("borderRadius", e), this._valueUV = this._value.clone(), this._input = new u.Vector4(0, 0, 0, 0), this._mediation = !0, this._cornerTL = new u.Vector2(0, 1), this._cornerTR = new u.Vector2(1, 1), this._cornerBR = new u.Vector2(1, 0), this._cornerBL = new u.Vector2(0, 0);
|
|
1505
|
-
const t = new
|
|
1506
|
-
t.complementaryMediation = s, s.complementaryMediation = t, r.complementaryMediation = n, n.complementaryMediation = r, this._sideMediators = [t, s, r, n], this._units =
|
|
1502
|
+
const t = new W(this._valueUV, ["x", "y"]), s = new W(this._valueUV, ["z", "w"]), r = new W(this._valueUV, ["x", "w"]), n = new W(this._valueUV, ["y", "z"]);
|
|
1503
|
+
t.complementaryMediation = s, s.complementaryMediation = t, r.complementaryMediation = n, n.complementaryMediation = r, this._sideMediators = [t, s, r, n], this._units = R;
|
|
1507
1504
|
}
|
|
1508
1505
|
/**
|
|
1509
1506
|
*
|
|
1510
1507
|
* @param {string} units
|
|
1511
1508
|
*/
|
|
1512
1509
|
set units(e) {
|
|
1513
|
-
this._units =
|
|
1510
|
+
this._units = Ee(e), this._needsProcess = !0;
|
|
1514
1511
|
}
|
|
1515
1512
|
/**
|
|
1516
1513
|
*
|
|
@@ -1563,12 +1560,12 @@ class Ui extends Y {
|
|
|
1563
1560
|
render(e) {
|
|
1564
1561
|
this._valueUV.copy(this._value);
|
|
1565
1562
|
const t = e._bounds._offsetWidth, s = e._bounds._offsetHeight;
|
|
1566
|
-
if (this._units ===
|
|
1563
|
+
if (this._units === G && this._valueUV.divideScalar(100), this._units === R && this._valueUV.divideScalar(Math.min(t, s)), this._mediation)
|
|
1567
1564
|
do
|
|
1568
1565
|
this._sideMediators.forEach((o) => o.computeValue()), this._sideMediators.sort((o, a) => o.value < a.value ? 1 : -1), this._sideMediators[0].value > 1 && this._sideMediators[0].mediate();
|
|
1569
1566
|
while (this._sideMediators[0].value > 1);
|
|
1570
1567
|
let r = t > s ? s / t : 1, n = t < s ? t / s : 1;
|
|
1571
|
-
this._units ===
|
|
1568
|
+
this._units === G && (r = n = 1), this._cornerTL.x = this._valueUV.x * r, this._cornerTL.y = 1 - this._valueUV.x * n, this._cornerTR.x = 1 - this._valueUV.y * r, this._cornerTR.y = 1 - this._valueUV.y * n, this._cornerBR.x = 1 - this._valueUV.z * r, this._cornerBR.y = this._valueUV.z * n, this._cornerBL.x = this._valueUV.w * r, this._cornerBL.y = this._valueUV.w * n;
|
|
1572
1569
|
}
|
|
1573
1570
|
/**
|
|
1574
1571
|
*
|
|
@@ -1691,7 +1688,7 @@ class Ui extends Y {
|
|
|
1691
1688
|
return (this._input.w + this._input.x) / 2;
|
|
1692
1689
|
}
|
|
1693
1690
|
}
|
|
1694
|
-
class
|
|
1691
|
+
class W {
|
|
1695
1692
|
/**
|
|
1696
1693
|
*
|
|
1697
1694
|
* @param {Vector4} borderRadiuses
|
|
@@ -1741,20 +1738,20 @@ class E {
|
|
|
1741
1738
|
this._complementaryMediation = null, this._borderRadiuses = null;
|
|
1742
1739
|
}
|
|
1743
1740
|
}
|
|
1744
|
-
class
|
|
1741
|
+
class Ri extends j {
|
|
1745
1742
|
/**
|
|
1746
1743
|
*
|
|
1747
1744
|
* @param defaultValue
|
|
1748
1745
|
*/
|
|
1749
1746
|
constructor(e) {
|
|
1750
|
-
super("borderWidth", e, !1), this._valueUV = this._value.clone(), this.output = this._outputValue, this._units =
|
|
1747
|
+
super("borderWidth", e, !1), this._valueUV = this._value.clone(), this.output = this._outputValue, this._units = R;
|
|
1751
1748
|
}
|
|
1752
1749
|
/**
|
|
1753
1750
|
*
|
|
1754
1751
|
* @param {string} units
|
|
1755
1752
|
*/
|
|
1756
1753
|
set units(e) {
|
|
1757
|
-
this._units =
|
|
1754
|
+
this._units = Ee(e), this._needsUpdate = !0;
|
|
1758
1755
|
}
|
|
1759
1756
|
/**
|
|
1760
1757
|
*
|
|
@@ -1787,9 +1784,9 @@ class Ai extends Y {
|
|
|
1787
1784
|
render(e) {
|
|
1788
1785
|
this._valueUV.copy(this._value);
|
|
1789
1786
|
const t = e._bounds._offsetWidth, s = e._bounds._offsetHeight;
|
|
1790
|
-
if (this._units ===
|
|
1787
|
+
if (this._units === G && (console.log("Percent"), console.log(this._valueUV)), this._units === R)
|
|
1791
1788
|
t !== 0 && (this._valueUV.w /= t, this._valueUV.y /= t), s !== 0 && (this._valueUV.x /= s, this._valueUV.z /= s);
|
|
1792
|
-
else if (this._units ===
|
|
1789
|
+
else if (this._units === We) {
|
|
1793
1790
|
if (t !== 0) {
|
|
1794
1791
|
const r = t > s ? s / t : 1;
|
|
1795
1792
|
this._valueUV.y *= r, this._valueUV.w *= r;
|
|
@@ -1801,7 +1798,7 @@ class Ai extends Y {
|
|
|
1801
1798
|
}
|
|
1802
1799
|
}
|
|
1803
1800
|
}
|
|
1804
|
-
class
|
|
1801
|
+
class Bi extends p {
|
|
1805
1802
|
/**
|
|
1806
1803
|
*
|
|
1807
1804
|
* @param {string} propertyId
|
|
@@ -1825,7 +1822,7 @@ class Ti extends p {
|
|
|
1825
1822
|
return this._value;
|
|
1826
1823
|
}
|
|
1827
1824
|
}
|
|
1828
|
-
class
|
|
1825
|
+
class De extends U {
|
|
1829
1826
|
constructor(e) {
|
|
1830
1827
|
super("backgroundColor", e, !1), this._input = "transparent", this._allowsInherit = !1;
|
|
1831
1828
|
}
|
|
@@ -1862,7 +1859,7 @@ class P extends p {
|
|
|
1862
1859
|
output(e) {
|
|
1863
1860
|
}
|
|
1864
1861
|
}
|
|
1865
|
-
class
|
|
1862
|
+
class Ui extends p {
|
|
1866
1863
|
constructor() {
|
|
1867
1864
|
super("inlineJustificator", null, !1), this._value = null;
|
|
1868
1865
|
}
|
|
@@ -1896,41 +1893,41 @@ class Mi extends p {
|
|
|
1896
1893
|
});
|
|
1897
1894
|
}
|
|
1898
1895
|
}
|
|
1899
|
-
const
|
|
1900
|
-
return
|
|
1896
|
+
const Ai = ["start", "center", "end", "stretch"], Ti = function(i) {
|
|
1897
|
+
return Ai.indexOf(i) === -1 ? (console.warn(`(.style) alignItems value '${i}' is not valid. Aborted`), !1) : !0;
|
|
1901
1898
|
};
|
|
1902
|
-
class
|
|
1899
|
+
class ue extends g {
|
|
1903
1900
|
constructor() {
|
|
1904
|
-
super("alignItems", "inherit", !0), this.isValidValue =
|
|
1901
|
+
super("alignItems", "inherit", !0), this.isValidValue = Ti;
|
|
1905
1902
|
}
|
|
1906
1903
|
}
|
|
1907
|
-
class
|
|
1904
|
+
class he extends g {
|
|
1908
1905
|
constructor() {
|
|
1909
|
-
super("textAlign", "inherit", !0), this.isValidValue =
|
|
1906
|
+
super("textAlign", "inherit", !0), this.isValidValue = Fi;
|
|
1910
1907
|
}
|
|
1911
1908
|
}
|
|
1912
|
-
const
|
|
1913
|
-
return
|
|
1909
|
+
const Mi = ["left", "right", "center", "justify", "justify-left", "justify-right", "justify-center"], Fi = function(i) {
|
|
1910
|
+
return Mi.indexOf(i) === -1 ? (console.warn(`(.style) textAlign value '${i}' is not valid. Aborted`), !1) : !0;
|
|
1914
1911
|
};
|
|
1915
|
-
class
|
|
1912
|
+
class le extends g {
|
|
1916
1913
|
constructor() {
|
|
1917
|
-
super("flexDirection", "inherit", !0), this.isValid =
|
|
1914
|
+
super("flexDirection", "inherit", !0), this.isValid = Li;
|
|
1918
1915
|
}
|
|
1919
1916
|
}
|
|
1920
|
-
const
|
|
1921
|
-
function
|
|
1922
|
-
return
|
|
1917
|
+
const Oi = ["row", "row-reverse", "column", "column-reverse"];
|
|
1918
|
+
function Li(i) {
|
|
1919
|
+
return Oi.indexOf(i) === -1 ? (console.warn(`(.style) flexDirection value '${i}' is not valid. Aborted`), !1) : !0;
|
|
1923
1920
|
}
|
|
1924
|
-
class
|
|
1921
|
+
class ce extends g {
|
|
1925
1922
|
constructor() {
|
|
1926
|
-
super("justifyContent", "inherit", !0), this.isValidValue =
|
|
1923
|
+
super("justifyContent", "inherit", !0), this.isValidValue = Wi;
|
|
1927
1924
|
}
|
|
1928
1925
|
}
|
|
1929
|
-
const
|
|
1930
|
-
function
|
|
1931
|
-
return
|
|
1926
|
+
const zi = ["start", "center", "end", "space-between", "space-around", "space-evenly"];
|
|
1927
|
+
function Wi(i) {
|
|
1928
|
+
return zi.indexOf(i) === -1 ? (console.warn(`(.style) justifyContent value '${i}' is not valid. Aborted`), !1) : !0;
|
|
1932
1929
|
}
|
|
1933
|
-
class
|
|
1930
|
+
class Ei extends g {
|
|
1934
1931
|
constructor() {
|
|
1935
1932
|
super("order", 0, !0), this._value = 0, this._input = 0, this._allowsInherit = !1;
|
|
1936
1933
|
}
|
|
@@ -1939,19 +1936,19 @@ class Gi extends g {
|
|
|
1939
1936
|
this._value = this._inheritedInput, e._parent._value && (e._parent._value._children._needsProcess = !0);
|
|
1940
1937
|
}
|
|
1941
1938
|
}
|
|
1942
|
-
class
|
|
1939
|
+
class He extends g {
|
|
1943
1940
|
constructor() {
|
|
1944
|
-
super("position", "static", !0), this._allowsInherit = !1, this._value = "static", this._needsUpdate = !1, this.computeOutputValue = this._computeFromInherited, this.isValidValue =
|
|
1941
|
+
super("position", "static", !0), this._allowsInherit = !1, this._value = "static", this._needsUpdate = !1, this.computeOutputValue = this._computeFromInherited, this.isValidValue = Hi;
|
|
1945
1942
|
}
|
|
1946
1943
|
_computeFromInherited(e) {
|
|
1947
1944
|
super._computeFromInherited(e), e._parent._value && (e._parent._value._children._needsProcess = !0);
|
|
1948
1945
|
}
|
|
1949
1946
|
}
|
|
1950
|
-
const
|
|
1951
|
-
function
|
|
1952
|
-
return
|
|
1947
|
+
const Di = ["static", "absolute"];
|
|
1948
|
+
function Hi(i) {
|
|
1949
|
+
return Di.indexOf(i) === -1 ? (console.warn(`(.style) position value '${i}' is not valid. Aborted`), !1) : !0;
|
|
1953
1950
|
}
|
|
1954
|
-
class
|
|
1951
|
+
class Ge extends g {
|
|
1955
1952
|
/**
|
|
1956
1953
|
*
|
|
1957
1954
|
* @param {string} propertyId
|
|
@@ -2012,12 +2009,12 @@ class $e extends g {
|
|
|
2012
2009
|
return this._value;
|
|
2013
2010
|
}
|
|
2014
2011
|
}
|
|
2015
|
-
class
|
|
2012
|
+
class Gi extends Ge {
|
|
2016
2013
|
constructor() {
|
|
2017
2014
|
super("width");
|
|
2018
2015
|
}
|
|
2019
2016
|
}
|
|
2020
|
-
class
|
|
2017
|
+
class $i extends Ge {
|
|
2021
2018
|
constructor() {
|
|
2022
2019
|
super("height");
|
|
2023
2020
|
}
|
|
@@ -2025,7 +2022,7 @@ class ji extends $e {
|
|
|
2025
2022
|
super.computeOutputValue(e);
|
|
2026
2023
|
}
|
|
2027
2024
|
}
|
|
2028
|
-
class
|
|
2025
|
+
class $e extends P {
|
|
2029
2026
|
constructor() {
|
|
2030
2027
|
super("textContent"), this._needsUpdate = !1;
|
|
2031
2028
|
}
|
|
@@ -2042,25 +2039,25 @@ class Ne extends P {
|
|
|
2042
2039
|
this._value = t;
|
|
2043
2040
|
}
|
|
2044
2041
|
}
|
|
2045
|
-
class
|
|
2042
|
+
class Ne extends g {
|
|
2046
2043
|
constructor(e) {
|
|
2047
|
-
super("fontStyle", e, !0), this.isValidValue =
|
|
2044
|
+
super("fontStyle", e, !0), this.isValidValue = Xi;
|
|
2048
2045
|
}
|
|
2049
2046
|
}
|
|
2050
|
-
const
|
|
2051
|
-
function
|
|
2052
|
-
return
|
|
2047
|
+
const Ni = ["normal", "italic"];
|
|
2048
|
+
function Xi(i) {
|
|
2049
|
+
return Ni.indexOf(i) === -1 ? (console.warn(`(.style) fontStyle value '${i}' is not valid. Aborted`), !1) : !0;
|
|
2053
2050
|
}
|
|
2054
|
-
class
|
|
2051
|
+
class Xe extends g {
|
|
2055
2052
|
constructor() {
|
|
2056
|
-
super("fontWeight", "inherit", !0), this.isValid =
|
|
2053
|
+
super("fontWeight", "inherit", !0), this.isValid = Yi;
|
|
2057
2054
|
}
|
|
2058
2055
|
}
|
|
2059
|
-
const
|
|
2060
|
-
function
|
|
2061
|
-
return
|
|
2056
|
+
const ji = ["100", "200", "300", "400", "500", "600", "700", "800", "900", "light", "normal", "bold", "bolder"];
|
|
2057
|
+
function Yi(i) {
|
|
2058
|
+
return ji.indexOf(i.toString()) === -1 ? (console.warn(`(.style) fontWeight value '${i}' is not valid. Aborted`), !1) : !0;
|
|
2062
2059
|
}
|
|
2063
|
-
class
|
|
2060
|
+
class je {
|
|
2064
2061
|
constructor() {
|
|
2065
2062
|
this._size = 42, this._lineHeight = 42, this._lineBase = 38, this._name = "-", this._charset = "";
|
|
2066
2063
|
}
|
|
@@ -2100,7 +2097,7 @@ class Ye {
|
|
|
2100
2097
|
return this._charset;
|
|
2101
2098
|
}
|
|
2102
2099
|
}
|
|
2103
|
-
class
|
|
2100
|
+
class Ki extends je {
|
|
2104
2101
|
/**
|
|
2105
2102
|
*
|
|
2106
2103
|
* @param {import('./MSDFFontVariant').MSDFJson} json
|
|
@@ -2123,7 +2120,7 @@ class Zi extends Ye {
|
|
|
2123
2120
|
return this._textureHeight;
|
|
2124
2121
|
}
|
|
2125
2122
|
}
|
|
2126
|
-
class
|
|
2123
|
+
class qi extends ze {
|
|
2127
2124
|
/**
|
|
2128
2125
|
*
|
|
2129
2126
|
* @param {MSDFTypographicGlyph} characterDesc
|
|
@@ -2139,7 +2136,7 @@ class Qi extends We {
|
|
|
2139
2136
|
return this.typographic.uv;
|
|
2140
2137
|
}
|
|
2141
2138
|
}
|
|
2142
|
-
class
|
|
2139
|
+
class $ extends Le {
|
|
2143
2140
|
/**
|
|
2144
2141
|
* @param {MSDFTypographicFont} fontDescription
|
|
2145
2142
|
* @param {import('./MSDFFontVariant').MSDFJsonChar} characterData
|
|
@@ -2165,7 +2162,7 @@ class N extends ze {
|
|
|
2165
2162
|
* @returns {MSDFTypographicGlyph}
|
|
2166
2163
|
*/
|
|
2167
2164
|
clone(e) {
|
|
2168
|
-
return new
|
|
2165
|
+
return new $(this._font, {
|
|
2169
2166
|
char: e,
|
|
2170
2167
|
width: this._width,
|
|
2171
2168
|
height: this._heigth,
|
|
@@ -2181,10 +2178,10 @@ class N extends ze {
|
|
|
2181
2178
|
* @returns {MSDFInlineGlyph}
|
|
2182
2179
|
*/
|
|
2183
2180
|
asInlineGlyph() {
|
|
2184
|
-
return new
|
|
2181
|
+
return new qi(this);
|
|
2185
2182
|
}
|
|
2186
2183
|
}
|
|
2187
|
-
class
|
|
2184
|
+
class Ji extends u.PlaneGeometry {
|
|
2188
2185
|
/**
|
|
2189
2186
|
*
|
|
2190
2187
|
* @param {MSDFInlineGlyph} inline
|
|
@@ -2234,23 +2231,23 @@ class es extends u.PlaneGeometry {
|
|
|
2234
2231
|
);
|
|
2235
2232
|
}
|
|
2236
2233
|
}
|
|
2237
|
-
const
|
|
2234
|
+
const Zi = (
|
|
2238
2235
|
/* glsl */
|
|
2239
2236
|
`
|
|
2240
2237
|
attribute vec2 uvG;
|
|
2241
2238
|
varying vec2 vUvG;
|
|
2242
2239
|
`
|
|
2243
|
-
),
|
|
2240
|
+
), de = Zi, Qi = (
|
|
2244
2241
|
/* glsl */
|
|
2245
2242
|
`
|
|
2246
2243
|
vUvG = uvG;
|
|
2247
2244
|
`
|
|
2248
|
-
),
|
|
2245
|
+
), _e = Qi, es = (
|
|
2249
2246
|
/* glsl */
|
|
2250
2247
|
`
|
|
2251
2248
|
gl_Position.z -= 0.00001;
|
|
2252
2249
|
`
|
|
2253
|
-
),
|
|
2250
|
+
), fe = es, ts = (
|
|
2254
2251
|
/* glsl */
|
|
2255
2252
|
`
|
|
2256
2253
|
varying vec2 vUvG;
|
|
@@ -2276,7 +2273,7 @@ float tap(vec2 offsetUV) {
|
|
|
2276
2273
|
return alpha;
|
|
2277
2274
|
}
|
|
2278
2275
|
`
|
|
2279
|
-
),
|
|
2276
|
+
), pe = ts, is = (
|
|
2280
2277
|
/* glsl */
|
|
2281
2278
|
`
|
|
2282
2279
|
float alpha;
|
|
@@ -2317,15 +2314,15 @@ float tap(vec2 offsetUV) {
|
|
|
2317
2314
|
|
|
2318
2315
|
diffuseColor.a *= alpha;
|
|
2319
2316
|
`
|
|
2320
|
-
),
|
|
2321
|
-
i.alphaTest = t,
|
|
2322
|
-
},
|
|
2317
|
+
), ge = is, Y = function(i, e, t) {
|
|
2318
|
+
i.alphaTest = t, me(i, "USE_ALPHATEST", t > 0);
|
|
2319
|
+
}, me = function(i, e, t) {
|
|
2323
2320
|
i.defines && (t ? i.defines[e] === void 0 && (i.defines[e] = "", i.needsUpdate = !0) : i.defines[e] !== void 0 && (delete i.defines[e], i.needsUpdate = !0));
|
|
2324
|
-
},
|
|
2321
|
+
}, Ye = function(i, e, t) {
|
|
2325
2322
|
i.defines[e] && i.defines[e] === t || (i.defines[e] = t, i.needsUpdate = !0);
|
|
2326
2323
|
}, x = function(i, e, t) {
|
|
2327
2324
|
i.userData[e] ? i.userData[e].value = t : i.uniforms[e].value = t;
|
|
2328
|
-
},
|
|
2325
|
+
}, ss = function(i, e, t) {
|
|
2329
2326
|
i.userData[e].value = t;
|
|
2330
2327
|
};
|
|
2331
2328
|
class w {
|
|
@@ -2375,15 +2372,15 @@ class w {
|
|
|
2375
2372
|
e.vertexShader = e.vertexShader.replace(
|
|
2376
2373
|
"#include <uv_pars_vertex>",
|
|
2377
2374
|
`#include <uv_pars_vertex>
|
|
2378
|
-
` +
|
|
2375
|
+
` + de
|
|
2379
2376
|
), e.vertexShader = e.vertexShader.replace(
|
|
2380
2377
|
"#include <uv_vertex>",
|
|
2381
2378
|
`#include <uv_vertex>
|
|
2382
|
-
` +
|
|
2379
|
+
` + _e
|
|
2383
2380
|
), e.vertexShader = e.vertexShader.replace(
|
|
2384
2381
|
"#include <project_vertex>",
|
|
2385
2382
|
`#include <project_vertex>
|
|
2386
|
-
` +
|
|
2383
|
+
` + fe
|
|
2387
2384
|
);
|
|
2388
2385
|
}
|
|
2389
2386
|
/**
|
|
@@ -2394,11 +2391,11 @@ class w {
|
|
|
2394
2391
|
e.fragmentShader = e.fragmentShader.replace(
|
|
2395
2392
|
"#include <uv_pars_fragment>",
|
|
2396
2393
|
`#include <uv_pars_fragment>
|
|
2397
|
-
` +
|
|
2394
|
+
` + pe
|
|
2398
2395
|
), e.fragmentShader = e.fragmentShader.replace(
|
|
2399
2396
|
"#include <alphamap_fragment>",
|
|
2400
2397
|
`#include <alphamap_fragment>
|
|
2401
|
-
` +
|
|
2398
|
+
` + ge
|
|
2402
2399
|
);
|
|
2403
2400
|
}
|
|
2404
2401
|
/**
|
|
@@ -2408,22 +2405,6 @@ class w {
|
|
|
2408
2405
|
*/
|
|
2409
2406
|
static from(e) {
|
|
2410
2407
|
return class extends e {
|
|
2411
|
-
constructor(s = {}) {
|
|
2412
|
-
w.ensureMaterialOptions(s);
|
|
2413
|
-
super(s);
|
|
2414
|
-
/**
|
|
2415
|
-
*
|
|
2416
|
-
* On before compile that first run three-mesh-ui fontMaterial
|
|
2417
|
-
* then user defined onBeforeCompile
|
|
2418
|
-
* @param shader
|
|
2419
|
-
* @private
|
|
2420
|
-
*/
|
|
2421
|
-
I(this, "_cumulativeOnBeforeCompile", (s) => {
|
|
2422
|
-
w.bindUniformsWithUserData(s, this), w.injectShaderChunks(s), this._userDefinedOnBeforeCompile(s);
|
|
2423
|
-
});
|
|
2424
|
-
w.ensureDefines(this), w.ensureUserData(this, s), this._userDefinedOnBeforeCompile = (r) => {
|
|
2425
|
-
}, this._onBeforeCompile = this._cumulativeOnBeforeCompile;
|
|
2426
|
-
}
|
|
2427
2408
|
/**
|
|
2428
2409
|
*
|
|
2429
2410
|
* @abstract
|
|
@@ -2432,6 +2413,10 @@ class w {
|
|
|
2432
2413
|
static get fontMaterialProperties() {
|
|
2433
2414
|
return w.mediation;
|
|
2434
2415
|
}
|
|
2416
|
+
constructor(t = {}) {
|
|
2417
|
+
w.ensureMaterialOptions(t), super(t), w.ensureDefines(this), w.ensureUserData(this, t), this._userDefinedOnBeforeCompile = (s) => {
|
|
2418
|
+
}, this._onBeforeCompile = this._cumulativeOnBeforeCompile;
|
|
2419
|
+
}
|
|
2435
2420
|
////////////////////////////
|
|
2436
2421
|
// OnBeforeCompile Override
|
|
2437
2422
|
///////////////////////////
|
|
@@ -2440,8 +2425,8 @@ class w {
|
|
|
2440
2425
|
* the three-mesh-ui fontMaterial onBeforeCompile
|
|
2441
2426
|
* @param { (shader:any) => void }fct
|
|
2442
2427
|
*/
|
|
2443
|
-
set onBeforeCompile(
|
|
2444
|
-
this._userDefinedOnBeforeCompile =
|
|
2428
|
+
set onBeforeCompile(t) {
|
|
2429
|
+
this._userDefinedOnBeforeCompile = t;
|
|
2445
2430
|
}
|
|
2446
2431
|
/**
|
|
2447
2432
|
* Override the getter of onBeforeCompile in order to
|
|
@@ -2451,6 +2436,16 @@ class w {
|
|
|
2451
2436
|
get onBeforeCompile() {
|
|
2452
2437
|
return this._onBeforeCompile;
|
|
2453
2438
|
}
|
|
2439
|
+
/**
|
|
2440
|
+
*
|
|
2441
|
+
* On before compile that first run three-mesh-ui fontMaterial
|
|
2442
|
+
* then user defined onBeforeCompile
|
|
2443
|
+
* @param shader
|
|
2444
|
+
* @private
|
|
2445
|
+
*/
|
|
2446
|
+
_cumulativeOnBeforeCompile = (t) => {
|
|
2447
|
+
w.bindUniformsWithUserData(t, this), w.injectShaderChunks(t), this._userDefinedOnBeforeCompile(t);
|
|
2448
|
+
};
|
|
2454
2449
|
};
|
|
2455
2450
|
}
|
|
2456
2451
|
/**
|
|
@@ -2458,60 +2453,60 @@ class w {
|
|
|
2458
2453
|
* @returns {Object<{m: string, t?: (function((Material|ShaderMaterial), string, *): void)}>}
|
|
2459
2454
|
*/
|
|
2460
2455
|
static get mediation() {
|
|
2461
|
-
return
|
|
2456
|
+
return os;
|
|
2462
2457
|
}
|
|
2463
2458
|
}
|
|
2464
|
-
const
|
|
2459
|
+
const rs = function(i, e, t) {
|
|
2465
2460
|
const s = t ? t.texture : null, r = t ? t.unitRange : new u.Vector2();
|
|
2466
2461
|
if (i[e] !== void 0) {
|
|
2467
2462
|
i.glyphMap = s, i.unitRange = r;
|
|
2468
2463
|
return;
|
|
2469
2464
|
}
|
|
2470
2465
|
i.userData && i.userData.glyphMap && (i.userData.glyphMap.value = s, i.userData.unitRange.value = r);
|
|
2471
|
-
},
|
|
2466
|
+
}, ns = function(i, e, t) {
|
|
2472
2467
|
t && t !== "antialiased" ? i.defines.NO_RGSS = "" : delete i.defines.NO_RGSS, i.needsUpdate = !0;
|
|
2473
|
-
},
|
|
2468
|
+
}, os = {
|
|
2474
2469
|
clippingPlanes: { m: "clippingPlanes" },
|
|
2475
|
-
fontAlphaTest: { m: "alphaTest", t:
|
|
2470
|
+
fontAlphaTest: { m: "alphaTest", t: Y },
|
|
2476
2471
|
fontSide: { m: "side" },
|
|
2477
|
-
font: { m: "glyphMap", t:
|
|
2472
|
+
font: { m: "glyphMap", t: rs },
|
|
2478
2473
|
color: { m: "color" },
|
|
2479
2474
|
fontOpacity: { m: "opacity" },
|
|
2480
|
-
fontSmooth: { m: "NO_RGSS", t:
|
|
2481
|
-
invertAlpha: { m: "INVERT_ALPHA", t:
|
|
2482
|
-
},
|
|
2475
|
+
fontSmooth: { m: "NO_RGSS", t: ns },
|
|
2476
|
+
invertAlpha: { m: "INVERT_ALPHA", t: me }
|
|
2477
|
+
}, as = (
|
|
2483
2478
|
/* glsl */
|
|
2484
2479
|
`
|
|
2485
|
-
${
|
|
2480
|
+
${de}
|
|
2486
2481
|
#include <clipping_planes_pars_vertex>
|
|
2487
2482
|
void main() {
|
|
2488
|
-
${
|
|
2483
|
+
${_e}
|
|
2489
2484
|
#include <begin_vertex>
|
|
2490
2485
|
#include <project_vertex>
|
|
2491
|
-
${
|
|
2486
|
+
${fe}
|
|
2492
2487
|
#include <clipping_planes_vertex>
|
|
2493
2488
|
}
|
|
2494
2489
|
`
|
|
2495
|
-
),
|
|
2490
|
+
), us = (
|
|
2496
2491
|
/* glsl */
|
|
2497
2492
|
`
|
|
2498
2493
|
uniform vec3 diffuse;
|
|
2499
2494
|
uniform float opacity;
|
|
2500
|
-
${
|
|
2495
|
+
${pe}
|
|
2501
2496
|
#include <alphatest_pars_fragment>
|
|
2502
2497
|
#include <clipping_planes_pars_fragment>
|
|
2503
2498
|
void main() {
|
|
2504
2499
|
// instead of <color_fragment> : vec4 diffuseColor
|
|
2505
2500
|
vec4 diffuseColor = vec4( diffuse, opacity );
|
|
2506
|
-
${
|
|
2501
|
+
${ge}
|
|
2507
2502
|
#include <alphatest_fragment>
|
|
2508
2503
|
// instead of <output_fragment>
|
|
2509
2504
|
gl_FragColor = diffuseColor;
|
|
2510
2505
|
#include <clipping_planes_fragment>
|
|
2511
2506
|
}
|
|
2512
2507
|
`
|
|
2513
|
-
),
|
|
2514
|
-
class
|
|
2508
|
+
), hs = 0.02;
|
|
2509
|
+
class ve extends u.ShaderMaterial {
|
|
2515
2510
|
/**
|
|
2516
2511
|
* This static method is mandatory for extending ThreeMeshUI.MSDFFontMaterial
|
|
2517
2512
|
* It will provide a transfer description for properties from ThreeMeshUI.Text to THREE.Material
|
|
@@ -2531,12 +2526,12 @@ class ye extends u.ShaderMaterial {
|
|
|
2531
2526
|
opacity: { value: 1 },
|
|
2532
2527
|
unitRange: { value: new u.Vector2(0, 0) },
|
|
2533
2528
|
// vec2
|
|
2534
|
-
alphaTest: { value:
|
|
2529
|
+
alphaTest: { value: hs }
|
|
2535
2530
|
},
|
|
2536
2531
|
transparent: !0,
|
|
2537
2532
|
clipping: !0,
|
|
2538
|
-
vertexShader:
|
|
2539
|
-
fragmentShader:
|
|
2533
|
+
vertexShader: as,
|
|
2534
|
+
fragmentShader: us,
|
|
2540
2535
|
extensions: {
|
|
2541
2536
|
derivatives: !0
|
|
2542
2537
|
}
|
|
@@ -2603,7 +2598,7 @@ class ye extends u.ShaderMaterial {
|
|
|
2603
2598
|
* @returns {boolean}
|
|
2604
2599
|
*/
|
|
2605
2600
|
get isDefault() {
|
|
2606
|
-
return this.constructor ===
|
|
2601
|
+
return this.constructor === ve;
|
|
2607
2602
|
}
|
|
2608
2603
|
/**
|
|
2609
2604
|
*
|
|
@@ -2620,15 +2615,15 @@ class ye extends u.ShaderMaterial {
|
|
|
2620
2615
|
this.uniforms.alphaTest.value = e;
|
|
2621
2616
|
}
|
|
2622
2617
|
}
|
|
2623
|
-
class
|
|
2618
|
+
class ls extends O {
|
|
2624
2619
|
constructor(e, t, s, r) {
|
|
2625
|
-
if (super(e, t), this._unitRange = new u.Vector2(1, 1), s.pages ? this._buildData(s) :
|
|
2620
|
+
if (super(e, t), this._unitRange = new u.Vector2(1, 1), s.pages ? this._buildData(s) : cs(this, s), r instanceof u.Texture)
|
|
2626
2621
|
this._texture = r, this._buildTexture(r);
|
|
2627
2622
|
else if (typeof r == "string" || r instanceof String)
|
|
2628
|
-
|
|
2623
|
+
ds(this, r);
|
|
2629
2624
|
else
|
|
2630
2625
|
throw new Error(`ThreeMeshUI::MSDFVariant provided 'texture' parameter is '${typeof r}'. Only Texture and String allowed.`);
|
|
2631
|
-
this._defaultMaterialClass =
|
|
2626
|
+
this._defaultMaterialClass = ve, this._checkReadiness();
|
|
2632
2627
|
}
|
|
2633
2628
|
get texture() {
|
|
2634
2629
|
return this._texture;
|
|
@@ -2657,7 +2652,7 @@ class _s extends L {
|
|
|
2657
2652
|
* @private
|
|
2658
2653
|
*/
|
|
2659
2654
|
_buildData(e) {
|
|
2660
|
-
this._font = new
|
|
2655
|
+
this._font = new Ki(e), this._kernings = this._buildKerningPairs(e), this._chars = this._buildCharacters(e), this._chars[" "] = this._buildCharacterWhite(e), this._chars[`
|
|
2661
2656
|
`] = this._buildCharacterWhite(e, `
|
|
2662
2657
|
`, 1e-3, 1), this._chars[" "] = this._buildCharacterWhite(e, " ", 4, 1), this._size = e.info.size, this._lineHeight = e.common.lineHeight, this._lineBase = e.common.base, this._distanceRange = e.distanceField.distanceRange, this._unitRange = new u.Vector2(this._distanceRange, this._distanceRange).divide(new u.Vector2(e.common.scaleW, e.common.scaleH));
|
|
2663
2658
|
}
|
|
@@ -2676,7 +2671,7 @@ class _s extends L {
|
|
|
2676
2671
|
* @returns {string|null}
|
|
2677
2672
|
*/
|
|
2678
2673
|
_getFallbackCharacter(e) {
|
|
2679
|
-
return
|
|
2674
|
+
return I.missingCharacter(this, e);
|
|
2680
2675
|
}
|
|
2681
2676
|
/**
|
|
2682
2677
|
*
|
|
@@ -2686,7 +2681,7 @@ class _s extends L {
|
|
|
2686
2681
|
* @returns {MSDFGeometricGlyph}
|
|
2687
2682
|
*/
|
|
2688
2683
|
getGeometricGlyph(e, t) {
|
|
2689
|
-
return new
|
|
2684
|
+
return new Ji(e, t);
|
|
2690
2685
|
}
|
|
2691
2686
|
/**
|
|
2692
2687
|
* Abstraction implementation
|
|
@@ -2724,7 +2719,7 @@ class _s extends L {
|
|
|
2724
2719
|
const t = {};
|
|
2725
2720
|
for (let s = 0; s < e.chars.length; s++) {
|
|
2726
2721
|
const r = e.chars[s];
|
|
2727
|
-
t[r.char] = new
|
|
2722
|
+
t[r.char] = new $(this._font, r);
|
|
2728
2723
|
}
|
|
2729
2724
|
return t;
|
|
2730
2725
|
}
|
|
@@ -2737,7 +2732,7 @@ class _s extends L {
|
|
|
2737
2732
|
* @private
|
|
2738
2733
|
*/
|
|
2739
2734
|
_buildCharacterWhite(e, t = " ", s = 1, r = 1) {
|
|
2740
|
-
return new
|
|
2735
|
+
return new $(
|
|
2741
2736
|
this._font,
|
|
2742
2737
|
{
|
|
2743
2738
|
char: t,
|
|
@@ -2755,27 +2750,23 @@ class _s extends L {
|
|
|
2755
2750
|
_alterElementProperties(e) {
|
|
2756
2751
|
}
|
|
2757
2752
|
}
|
|
2758
|
-
function
|
|
2753
|
+
function cs(i, e) {
|
|
2759
2754
|
new u.FileLoader().setResponseType("json").load(e, (t) => {
|
|
2760
2755
|
i._buildData(t), i._checkReadiness();
|
|
2761
2756
|
});
|
|
2762
2757
|
}
|
|
2763
|
-
function
|
|
2758
|
+
function ds(i, e) {
|
|
2764
2759
|
i._texture = new u.TextureLoader().load(e, (t) => {
|
|
2765
2760
|
i._buildTexture(t), i._checkReadiness();
|
|
2766
2761
|
});
|
|
2767
2762
|
}
|
|
2768
|
-
class
|
|
2763
|
+
class K extends u.EventDispatcher {
|
|
2769
2764
|
/**
|
|
2770
2765
|
*
|
|
2771
2766
|
* @param {string} name
|
|
2772
2767
|
*/
|
|
2773
|
-
constructor(
|
|
2774
|
-
super();
|
|
2775
|
-
I(this, "_checkReadiness", () => {
|
|
2776
|
-
this._variants.every((t) => t.isReady) && ms(this);
|
|
2777
|
-
});
|
|
2778
|
-
this._name = t, this._variants = [], this._isReady = !1;
|
|
2768
|
+
constructor(e) {
|
|
2769
|
+
super(), this._name = e, this._variants = [], this._isReady = !1;
|
|
2779
2770
|
}
|
|
2780
2771
|
get isReady() {
|
|
2781
2772
|
return this._isReady;
|
|
@@ -2788,13 +2779,13 @@ class q extends u.EventDispatcher {
|
|
|
2788
2779
|
* @param {string|Texture} texture
|
|
2789
2780
|
* @param {boolean} [override=false]
|
|
2790
2781
|
*/
|
|
2791
|
-
addVariant(t, s, r, n
|
|
2792
|
-
if (
|
|
2782
|
+
addVariant(e, t, s, r, n = !1) {
|
|
2783
|
+
if (n || !this.getVariant(e, t)) {
|
|
2793
2784
|
this._isReady = !1;
|
|
2794
|
-
const
|
|
2795
|
-
this._variants.push(
|
|
2785
|
+
const o = new ls(e, t, s, r);
|
|
2786
|
+
this._variants.push(o), o.isReady ? this._checkReadiness() : o.addEventListener("ready", this._checkReadiness);
|
|
2796
2787
|
} else
|
|
2797
|
-
console.warn(`FontFamily('${this._name}')::addVariant() - Variant(${
|
|
2788
|
+
console.warn(`FontFamily('${this._name}')::addVariant() - Variant(${e}, ${t}) already exists.`);
|
|
2798
2789
|
return this;
|
|
2799
2790
|
}
|
|
2800
2791
|
/**
|
|
@@ -2802,8 +2793,8 @@ class q extends u.EventDispatcher {
|
|
|
2802
2793
|
* @param {FontVariant} variantImplementation
|
|
2803
2794
|
* @param {boolean} [override=false]
|
|
2804
2795
|
*/
|
|
2805
|
-
addCustomImplementationVariant(
|
|
2806
|
-
return
|
|
2796
|
+
addCustomImplementationVariant(e, t = !1) {
|
|
2797
|
+
return t || !this.getVariant(e.weight, e.style) ? (this._isReady = !1, this._variants.push(e), e.isReady ? this._checkReadiness() : e.addEventListener("ready", this._checkReadiness)) : console.warn(`FontFamily('${this._name}')::addCustomImplementationVariant() - Variant(${e.weight}, ${e.style}) already exists.`), this;
|
|
2807
2798
|
}
|
|
2808
2799
|
/**
|
|
2809
2800
|
*
|
|
@@ -2811,8 +2802,8 @@ class q extends u.EventDispatcher {
|
|
|
2811
2802
|
* @param {string} style
|
|
2812
2803
|
* @returns {FontVariant|null}
|
|
2813
2804
|
*/
|
|
2814
|
-
getVariant(
|
|
2815
|
-
return
|
|
2805
|
+
getVariant(e, t) {
|
|
2806
|
+
return e = ae(e), this._variants.find((s) => s.weight === e && s.style === t);
|
|
2816
2807
|
}
|
|
2817
2808
|
/**
|
|
2818
2809
|
*
|
|
@@ -2821,15 +2812,18 @@ class q extends u.EventDispatcher {
|
|
|
2821
2812
|
get name() {
|
|
2822
2813
|
return this._name;
|
|
2823
2814
|
}
|
|
2815
|
+
_checkReadiness = () => {
|
|
2816
|
+
this._variants.every((e) => e.isReady) && fs(this);
|
|
2817
|
+
};
|
|
2824
2818
|
}
|
|
2825
|
-
const
|
|
2826
|
-
function
|
|
2827
|
-
i._isReady = !0, i.dispatchEvent(
|
|
2819
|
+
const _s = { type: "ready" };
|
|
2820
|
+
function fs(i) {
|
|
2821
|
+
i._isReady = !0, i.dispatchEvent(_s);
|
|
2828
2822
|
}
|
|
2829
|
-
const
|
|
2823
|
+
const H = {}, ps = function(i) {
|
|
2830
2824
|
const e = [...arguments];
|
|
2831
2825
|
e.forEach((s) => {
|
|
2832
|
-
if (!(s instanceof
|
|
2826
|
+
if (!(s instanceof K))
|
|
2833
2827
|
throw new Error(`FontLibrary::prepare() - One of the provided parameter is not a FontFamily. Instead ${typeof s} given.`);
|
|
2834
2828
|
});
|
|
2835
2829
|
const t = function() {
|
|
@@ -2846,27 +2840,27 @@ const G = {}, vs = function(i) {
|
|
|
2846
2840
|
});
|
|
2847
2841
|
}
|
|
2848
2842
|
});
|
|
2849
|
-
},
|
|
2850
|
-
return
|
|
2851
|
-
},
|
|
2852
|
-
return
|
|
2853
|
-
},
|
|
2854
|
-
|
|
2843
|
+
}, gs = function(i) {
|
|
2844
|
+
return H[i] && console.error(`FontLibrary::addFontFamily - Font('${i}') is already registered`), H[i] = new K(i), H[i];
|
|
2845
|
+
}, ms = function(i) {
|
|
2846
|
+
return H[i];
|
|
2847
|
+
}, vs = function(i) {
|
|
2848
|
+
Ke = i;
|
|
2855
2849
|
};
|
|
2856
|
-
let
|
|
2850
|
+
let Ke = function(i, e) {
|
|
2857
2851
|
return console.error(`The character '${e}' is not included in the font characters set.`), " ";
|
|
2858
2852
|
};
|
|
2859
|
-
function
|
|
2860
|
-
return
|
|
2861
|
-
}
|
|
2862
|
-
const
|
|
2863
|
-
addFontFamily:
|
|
2864
|
-
getFontFamily:
|
|
2865
|
-
prepare:
|
|
2866
|
-
setMissingCharacterHandler:
|
|
2867
|
-
missingCharacter:
|
|
2868
|
-
},
|
|
2869
|
-
class
|
|
2853
|
+
function ys(i, e) {
|
|
2854
|
+
return Ke(i, e);
|
|
2855
|
+
}
|
|
2856
|
+
const bs = {
|
|
2857
|
+
addFontFamily: gs,
|
|
2858
|
+
getFontFamily: ms,
|
|
2859
|
+
prepare: ps,
|
|
2860
|
+
setMissingCharacterHandler: vs,
|
|
2861
|
+
missingCharacter: ys
|
|
2862
|
+
}, I = bs;
|
|
2863
|
+
class qe extends g {
|
|
2870
2864
|
constructor() {
|
|
2871
2865
|
super("fontFamily", "inherit", !0);
|
|
2872
2866
|
}
|
|
@@ -2876,10 +2870,10 @@ class Je extends g {
|
|
|
2876
2870
|
* @param element
|
|
2877
2871
|
*/
|
|
2878
2872
|
computeOutputValue(e) {
|
|
2879
|
-
if (this._input instanceof
|
|
2873
|
+
if (this._input instanceof K)
|
|
2880
2874
|
this._value = this._input;
|
|
2881
2875
|
else if (this._input !== "inherit") if (typeof this._input == "string") {
|
|
2882
|
-
const t =
|
|
2876
|
+
const t = I.getFontFamily(this._input);
|
|
2883
2877
|
t ? this._value = t : console.warn(`(.style) fontFamily, the font '${this._input}' is not registered. Aborted.`);
|
|
2884
2878
|
} else
|
|
2885
2879
|
console.warn("(.style) fontFamily requires a registered fontFamily instance, or the id of a registered fontFamily."), console.warn("If you want to set a specific font, please use .font property instead.");
|
|
@@ -2897,7 +2891,7 @@ class Je extends g {
|
|
|
2897
2891
|
return t ? t[`_${this._id}`].getInheritedInput(t) : this.getDefaultValue();
|
|
2898
2892
|
}
|
|
2899
2893
|
}
|
|
2900
|
-
class
|
|
2894
|
+
class Je extends g {
|
|
2901
2895
|
/**
|
|
2902
2896
|
*
|
|
2903
2897
|
*/
|
|
@@ -2908,45 +2902,45 @@ class Ze extends g {
|
|
|
2908
2902
|
super.update(e, t), e._layouter._needsProcess = !0;
|
|
2909
2903
|
}
|
|
2910
2904
|
}
|
|
2911
|
-
class
|
|
2905
|
+
class Ze extends g {
|
|
2912
2906
|
constructor() {
|
|
2913
|
-
super("whiteSpace", "inherit"), this.isValidValue =
|
|
2907
|
+
super("whiteSpace", "inherit"), this.isValidValue = ws;
|
|
2914
2908
|
}
|
|
2915
2909
|
}
|
|
2916
|
-
const
|
|
2917
|
-
function
|
|
2918
|
-
return
|
|
2910
|
+
const xs = ["normal", "nowrap", "pre", "pre-line", "pre-wrap"];
|
|
2911
|
+
function ws(i) {
|
|
2912
|
+
return xs.indexOf(i) === -1 ? (console.warn(`(.style) whiteSpace value '${i}' is not valid. Aborted`), !1) : !0;
|
|
2919
2913
|
}
|
|
2920
|
-
class
|
|
2914
|
+
class Qe extends g {
|
|
2921
2915
|
constructor() {
|
|
2922
2916
|
super("letterSpacing", "inherit", !0);
|
|
2923
2917
|
}
|
|
2924
2918
|
}
|
|
2925
|
-
class
|
|
2919
|
+
class Ss extends g {
|
|
2926
2920
|
constructor() {
|
|
2927
2921
|
super("fontSize", "inherit", !0);
|
|
2928
2922
|
}
|
|
2929
2923
|
}
|
|
2930
|
-
class
|
|
2924
|
+
class et extends p {
|
|
2931
2925
|
constructor() {
|
|
2932
2926
|
super("segments", 1, !1);
|
|
2933
2927
|
}
|
|
2934
2928
|
}
|
|
2935
|
-
class
|
|
2929
|
+
class Vs extends C {
|
|
2936
2930
|
constructor() {
|
|
2937
2931
|
super("invertAlpha", "inherit");
|
|
2938
2932
|
}
|
|
2939
2933
|
}
|
|
2940
|
-
class
|
|
2934
|
+
class q extends g {
|
|
2941
2935
|
constructor() {
|
|
2942
|
-
super("fontKerning", "inherit"), this.isValidValue =
|
|
2936
|
+
super("fontKerning", "inherit"), this.isValidValue = Ps;
|
|
2943
2937
|
}
|
|
2944
2938
|
}
|
|
2945
|
-
const
|
|
2946
|
-
function
|
|
2947
|
-
return
|
|
2939
|
+
const ks = ["normal", "none", "inherit"];
|
|
2940
|
+
function Ps(i) {
|
|
2941
|
+
return ks.indexOf(i) === -1 ? (console.warn(`(.style) fontKerning value '${i}' is not valid. Aborted`), !1) : !0;
|
|
2948
2942
|
}
|
|
2949
|
-
class
|
|
2943
|
+
class E extends C {
|
|
2950
2944
|
/**
|
|
2951
2945
|
*
|
|
2952
2946
|
* @param {string} propertyId
|
|
@@ -2955,7 +2949,7 @@ class D extends R {
|
|
|
2955
2949
|
super(e, "inherit", !0);
|
|
2956
2950
|
}
|
|
2957
2951
|
}
|
|
2958
|
-
class
|
|
2952
|
+
class Be extends C {
|
|
2959
2953
|
/**
|
|
2960
2954
|
*
|
|
2961
2955
|
* @param {string} propertyId
|
|
@@ -2966,7 +2960,7 @@ class Ue extends R {
|
|
|
2966
2960
|
update(e, t) {
|
|
2967
2961
|
this._notInheritedValue = this._value, this._notInheritedValue === "inherit" ? this._notInheritedValue = this.getInheritedInput(e) : this.propagate(e), this._notInheritedValue ? this._notInheritedValue.constructor.mediation ? this._mediation = { ...this._notInheritedValue.constructor.mediation } : this._mediation = {
|
|
2968
2962
|
clippingPlanes: { m: "clippingPlanes" },
|
|
2969
|
-
fontAlphaTest: { m: "alphaTest", t:
|
|
2963
|
+
fontAlphaTest: { m: "alphaTest", t: Y },
|
|
2970
2964
|
fontSide: { m: "side" },
|
|
2971
2965
|
color: { m: "color" },
|
|
2972
2966
|
fontOpacity: { m: "opacity" }
|
|
@@ -2989,27 +2983,19 @@ class Ue extends R {
|
|
|
2989
2983
|
return this._defaultMaterial;
|
|
2990
2984
|
}
|
|
2991
2985
|
}
|
|
2992
|
-
const
|
|
2986
|
+
const Is = function(i, e, t) {
|
|
2993
2987
|
i.traverse((s) => {
|
|
2994
2988
|
s.renderOrder = t;
|
|
2995
2989
|
});
|
|
2996
2990
|
};
|
|
2997
|
-
class
|
|
2991
|
+
class L extends u.Object3D {
|
|
2998
2992
|
/**
|
|
2999
2993
|
*
|
|
3000
2994
|
* @param {Properties} properties
|
|
3001
2995
|
* @param {Options} values
|
|
3002
2996
|
*/
|
|
3003
|
-
constructor(
|
|
3004
|
-
super()
|
|
3005
|
-
/**
|
|
3006
|
-
* Try to retrieve parentUI after each structural change
|
|
3007
|
-
* @protected
|
|
3008
|
-
*/
|
|
3009
|
-
I(this, "_rebuildParentUI", () => {
|
|
3010
|
-
this._parent._needsUpdate = !0, this.parent && !this.parent.isUI ? (X.register(this), this.activatePseudoState("root")) : (X.remove(this), this.deactivatePseudoState("root"));
|
|
3011
|
-
});
|
|
3012
|
-
Object.defineProperties(
|
|
2997
|
+
constructor(e, t) {
|
|
2998
|
+
super(), Object.defineProperties(
|
|
3013
2999
|
this,
|
|
3014
3000
|
{
|
|
3015
3001
|
isUI: {
|
|
@@ -3021,14 +3007,14 @@ class z extends u.Object3D {
|
|
|
3021
3007
|
), this._backgroundMesh = null, this._backgroundMaterial = null, this._backgroundCustomDepthMaterial = null, this._backgroundMaterialMediation = {}, this._backgroundMeshMediation = {
|
|
3022
3008
|
backgroundCastShadow: { m: "castShadow" },
|
|
3023
3009
|
backgroundReceiveShadow: { m: "receiveShadow" },
|
|
3024
|
-
renderOrder: { m: "renderOrder", t:
|
|
3025
|
-
}, this._fontMesh = null, this._fontMaterial = new
|
|
3010
|
+
renderOrder: { m: "renderOrder", t: Is }
|
|
3011
|
+
}, this._fontMesh = null, this._fontMaterial = new Be("fontMaterial"), this._fontCustomDepthMaterial = new Be("fontCustomDepthMaterial"), this._fontMeshMediation = {
|
|
3026
3012
|
fontMaterial: { m: "material" },
|
|
3027
|
-
fontCustomDepthMaterial: { m: "customDepthMaterial", t:
|
|
3013
|
+
fontCustomDepthMaterial: { m: "customDepthMaterial", t: ti },
|
|
3028
3014
|
fontCastShadow: { m: "castShadow" },
|
|
3029
3015
|
fontReceiveShadow: { m: "receiveShadow" },
|
|
3030
3016
|
renderOrder: { m: "renderOrder" }
|
|
3031
|
-
}, this._children =
|
|
3017
|
+
}, this._children = e.children ? new e.children() : new P("children"), this._parent = new ii(), this.addEventListener("added", this._rebuildParentUI), this.addEventListener("removed", this._rebuildParentUI), this._backgroundSide = new Re("backgroundSide"), this._fontSide = new Re("fontSide"), this._backgroundAlphaTest = new Ce("backgroundAlphaTest", 0.02), this._fontAlphaTest = new Ce("fontAlphaTest", 0.02), this._visible = new Bi("visible", !0), this._backgroundCastShadow = new E("backgroundCastShadow"), this._fontCastShadow = new E("fontCastShadow"), this._backgroundReceiveShadow = new E("backgroundReceiveShadow"), this._fontReceiveShadow = new E("fontReceiveShadow"), this._renderOrder = new jt(), this._segments = e.segments ? new e.segments() : new et(), this._bounds = e.bounds ? new e.bounds() : new P("bounds"), this._order = new Ei(), this._padding = new Qt(), this._margin = new ei(), this._position = new He(), this._flexDirection = e.flexDirection ? new e.flexDirection() : new le(), this._justifyContent = e.justifyContent ? new e.justifyContent() : new ce(), this._alignItems = e.alignItems ? new e.alignItems() : new ue(), this._display = new di("flex"), this._boxSizing = new pi("border-box"), this._width = new Gi(), this._height = new $i(), this._backgroundColor = e.backgroundColor ? new e.backgroundColor() : new De(), this._backgroundOpacity = new Z("backgroundOpacity", 0.5), this._backgroundImage = new yi(), this._backgroundSize = new xi("cover"), this._color = e.color ? new e.color() : new U("color", "inherit"), this._fontOpacity = new Z("fontOpacity", "inherit"), this._whiteSpace = e.whiteSpace ? new e.whiteSpace() : new Ze(), this._fontFamily = e.fontFamily ? new e.fontFamily() : new qe(), this._fontStyle = e.fontStyle ? new e.fontStyle() : new Ne("normal"), this._fontWeight = e.fontWeight ? new e.fontWeight() : new Xe(), this._fontSize = e.fontSize ? new e.fontSize() : new Ss(), this._lineHeight = e.lineHeight ? new e.lineHeight() : new Je(), this._fontKerning = e.fontKerning ? new e.fontKerning() : new q(), this._letterSpacing = e.letterSpacing ? new e.letterSpacing() : new Qe(), this._overflow = new Vi("visible"), this._borderRadius = new Ci(0), this._borderWidth = new Ri(0), this._borderColor = new U("borderColor", 16711935), this._borderOpacity = new Z("borderOpacity", 1), this._font = new hi(), this._lineBreak = e.lineBreak ? new e.lineBreak() : new P("lineBreak"), this._textContent = e.textContent ? new e.textContent() : new $e(), this._glyphs = e.glyphs ? new e.glyphs() : new P("glyphs"), this._inlines = e.inlines ? new e.inlines() : new P("inlines"), this._layouter = e.layouter ? new e.layouter() : new P("layouter"), this._inlineJustificator = new Ui(), this._textAlign = e.textAlign ? new e.textAlign() : new he(), this._autoSize = e.autoSize ? new e.autoSize() : new P("autoSize"), this._renderer = e.renderer ? new e.renderer() : new P("renderer"), this._offset = new Yt(), this._invertAlpha = new Vs(), this._fontSmooth = e.fontSmooth ? new e.fontSmooth() : new Kt(), this._components = [
|
|
3032
3018
|
this._textContent,
|
|
3033
3019
|
this._children,
|
|
3034
3020
|
this._parent,
|
|
@@ -3096,79 +3082,79 @@ class z extends u.Object3D {
|
|
|
3096
3082
|
this._fontCustomDepthMaterial,
|
|
3097
3083
|
this._overflow,
|
|
3098
3084
|
this._renderer
|
|
3099
|
-
], this._onAfterUpdates = [],
|
|
3085
|
+
], this._onAfterUpdates = [], t.backgroundSide || (t.backgroundSide = 0), t && this.set(t);
|
|
3100
3086
|
}
|
|
3101
3087
|
///////////////
|
|
3102
3088
|
/// UPDATE
|
|
3103
3089
|
///////////////
|
|
3104
3090
|
update() {
|
|
3105
|
-
const
|
|
3106
|
-
for (const
|
|
3107
|
-
|
|
3108
|
-
this._transferToBackgroundMesh(
|
|
3109
|
-
for (const
|
|
3110
|
-
|
|
3091
|
+
const e = {};
|
|
3092
|
+
for (const t of this._components)
|
|
3093
|
+
t._needsUpdate && (t.update(this, e), t._needsUpdate = !1);
|
|
3094
|
+
this._transferToBackgroundMesh(e), this._transferToFontMesh(e), this._transferToBackgroundMaterial(e), this._transferToFontMaterial(e);
|
|
3095
|
+
for (const t of this._children._uis)
|
|
3096
|
+
t.update();
|
|
3111
3097
|
}
|
|
3112
3098
|
process() {
|
|
3113
|
-
for (const
|
|
3114
|
-
|
|
3115
|
-
for (const
|
|
3116
|
-
|
|
3099
|
+
for (const e of this._children._uis)
|
|
3100
|
+
e.process();
|
|
3101
|
+
for (const e of this._components)
|
|
3102
|
+
e._needsProcess && (e.process(this), e._needsProcess = !1);
|
|
3117
3103
|
}
|
|
3118
3104
|
render() {
|
|
3119
|
-
for (let
|
|
3120
|
-
const
|
|
3121
|
-
|
|
3105
|
+
for (let e = 0; e < this._components.length; e++) {
|
|
3106
|
+
const t = this._components[e];
|
|
3107
|
+
t._needsRender && (t.render(this), t._needsRender = !1);
|
|
3122
3108
|
}
|
|
3123
|
-
for (const
|
|
3124
|
-
|
|
3109
|
+
for (const e of this._children._uis)
|
|
3110
|
+
e.render();
|
|
3125
3111
|
}
|
|
3126
3112
|
/**
|
|
3127
3113
|
*
|
|
3128
3114
|
* @param {Options} options
|
|
3129
3115
|
*/
|
|
3130
|
-
set(
|
|
3131
|
-
if (
|
|
3132
|
-
const
|
|
3133
|
-
let
|
|
3134
|
-
if (!
|
|
3135
|
-
const
|
|
3136
|
-
|
|
3116
|
+
set(e) {
|
|
3117
|
+
if (e.fontTexture && (console.warn("ThreeMeshUI::set( {fontTexture} ) is deprecated. Please use fontLibrary to register font families and variants."), e.fontFamily)) {
|
|
3118
|
+
const t = e.fontFamily.pages ? e.fontFamily.info.face : e.fontFamily;
|
|
3119
|
+
let s = I.getFontFamily(t);
|
|
3120
|
+
if (!s) {
|
|
3121
|
+
const r = e.fontStyle ? e.fontStyle : "normal", n = e.fontWeight ? e.fontWeight : "400";
|
|
3122
|
+
s = I.addFontFamily(t).addVariant(n, r, e.fontFamily, e.fontTexture);
|
|
3137
3123
|
}
|
|
3138
|
-
|
|
3124
|
+
e.fontFamily = s, delete e.fontTexture;
|
|
3139
3125
|
}
|
|
3140
|
-
for (let
|
|
3141
|
-
const
|
|
3142
|
-
switch (
|
|
3126
|
+
for (let t of Object.keys(e)) {
|
|
3127
|
+
const s = e[t];
|
|
3128
|
+
switch (t) {
|
|
3143
3129
|
case "contentDirection":
|
|
3144
|
-
console.warn("ThreeMeshUI v7xx: property `contentDirection` is deprecated and has been renamed as `flexDirection`"),
|
|
3130
|
+
console.warn("ThreeMeshUI v7xx: property `contentDirection` is deprecated and has been renamed as `flexDirection`"), t = "flexDirection";
|
|
3145
3131
|
break;
|
|
3146
3132
|
case "interLine":
|
|
3147
|
-
console.warn("ThreeMeshUI v7xx: property `interLine` is deprecated and has been renamed as `lineHeight`"),
|
|
3133
|
+
console.warn("ThreeMeshUI v7xx: property `interLine` is deprecated and has been renamed as `lineHeight`"), t = "lineHeight";
|
|
3148
3134
|
break;
|
|
3149
3135
|
case "content":
|
|
3150
|
-
console.warn("ThreeMeshUI v7xx: property `content` is deprecated and has been renamed as `textContent`"),
|
|
3136
|
+
console.warn("ThreeMeshUI v7xx: property `content` is deprecated and has been renamed as `textContent`"), t = "textContent";
|
|
3151
3137
|
break;
|
|
3152
3138
|
case "fontColor":
|
|
3153
|
-
console.warn("ThreeMeshUI v7xx: property `fontColor` is deprecated and has been renamed as `color`"),
|
|
3139
|
+
console.warn("ThreeMeshUI v7xx: property `fontColor` is deprecated and has been renamed as `color`"), t = "color";
|
|
3154
3140
|
break;
|
|
3155
3141
|
case "hiddenOverflow":
|
|
3156
|
-
console.warn("ThreeMeshUI v7xx: property `hiddenOverflow` is deprecated and has been renamed as `overflow`"),
|
|
3142
|
+
console.warn("ThreeMeshUI v7xx: property `hiddenOverflow` is deprecated and has been renamed as `overflow`"), t = "overflow";
|
|
3157
3143
|
break;
|
|
3158
3144
|
case "backgroundTexture":
|
|
3159
|
-
console.warn("ThreeMeshUI v7xx: property `backgroundTexture` is deprecated and has been renamed as `backgroundImage`"),
|
|
3145
|
+
console.warn("ThreeMeshUI v7xx: property `backgroundTexture` is deprecated and has been renamed as `backgroundImage`"), t = "backgroundImage";
|
|
3160
3146
|
break;
|
|
3161
3147
|
case "alignContent":
|
|
3162
|
-
console.warn("ThreeMeshUI v7xx: property `alignContent` is deprecated and has been renamed as `alignItems`"),
|
|
3148
|
+
console.warn("ThreeMeshUI v7xx: property `alignContent` is deprecated and has been renamed as `alignItems`"), t = "alignItems";
|
|
3163
3149
|
break;
|
|
3164
3150
|
case "borderTopColor":
|
|
3165
3151
|
case "borderBottomColor":
|
|
3166
3152
|
case "borderLeftColor":
|
|
3167
3153
|
case "borderRightColor":
|
|
3168
|
-
|
|
3154
|
+
t = "borderColor";
|
|
3169
3155
|
break;
|
|
3170
3156
|
}
|
|
3171
|
-
switch (
|
|
3157
|
+
switch (t) {
|
|
3172
3158
|
// properties
|
|
3173
3159
|
// As textContent property might alter the hierarchy, do not wait until update
|
|
3174
3160
|
// case 'textContent' :
|
|
@@ -3177,7 +3163,7 @@ class z extends u.Object3D {
|
|
|
3177
3163
|
case "segments":
|
|
3178
3164
|
case "visible":
|
|
3179
3165
|
case "offset":
|
|
3180
|
-
this[`_${
|
|
3166
|
+
this[`_${t}`].value = s;
|
|
3181
3167
|
break;
|
|
3182
3168
|
// styles properties
|
|
3183
3169
|
case "flexDirection":
|
|
@@ -3211,62 +3197,62 @@ class z extends u.Object3D {
|
|
|
3211
3197
|
case "overflow":
|
|
3212
3198
|
case "order":
|
|
3213
3199
|
case "boxSizing":
|
|
3214
|
-
this[`_${
|
|
3200
|
+
this[`_${t}`] && (this[`_${t}`].inline = s);
|
|
3215
3201
|
break;
|
|
3216
3202
|
case "paddingTop":
|
|
3217
|
-
this._padding.top =
|
|
3203
|
+
this._padding.top = s;
|
|
3218
3204
|
break;
|
|
3219
3205
|
case "paddingRight":
|
|
3220
|
-
this._padding.right =
|
|
3206
|
+
this._padding.right = s;
|
|
3221
3207
|
break;
|
|
3222
3208
|
case "paddingBottom":
|
|
3223
|
-
this._padding.bottom =
|
|
3209
|
+
this._padding.bottom = s;
|
|
3224
3210
|
break;
|
|
3225
3211
|
case "paddingLeft":
|
|
3226
|
-
this._padding.left =
|
|
3212
|
+
this._padding.left = s;
|
|
3227
3213
|
break;
|
|
3228
3214
|
case "marginTop":
|
|
3229
|
-
this._margin.top =
|
|
3215
|
+
this._margin.top = s;
|
|
3230
3216
|
break;
|
|
3231
3217
|
case "marginRight":
|
|
3232
|
-
this._margin.right =
|
|
3218
|
+
this._margin.right = s;
|
|
3233
3219
|
break;
|
|
3234
3220
|
case "marginBottom":
|
|
3235
|
-
this._margin.bottom =
|
|
3221
|
+
this._margin.bottom = s;
|
|
3236
3222
|
break;
|
|
3237
3223
|
case "marginLeft":
|
|
3238
|
-
this._margin.left =
|
|
3224
|
+
this._margin.left = s;
|
|
3239
3225
|
break;
|
|
3240
3226
|
case "borderTopWidth":
|
|
3241
|
-
this._borderWidth.top =
|
|
3227
|
+
this._borderWidth.top = s;
|
|
3242
3228
|
break;
|
|
3243
3229
|
case "borderRightWidth":
|
|
3244
|
-
this._borderWidth.right =
|
|
3230
|
+
this._borderWidth.right = s;
|
|
3245
3231
|
break;
|
|
3246
3232
|
case "borderBottomWidth":
|
|
3247
|
-
this._borderWidth.bottom =
|
|
3233
|
+
this._borderWidth.bottom = s;
|
|
3248
3234
|
break;
|
|
3249
3235
|
case "borderLeftWidth":
|
|
3250
|
-
this._borderWidth.left =
|
|
3236
|
+
this._borderWidth.left = s;
|
|
3251
3237
|
break;
|
|
3252
3238
|
case "borderTopLeftRadius":
|
|
3253
|
-
this._borderRadius.topLeft =
|
|
3239
|
+
this._borderRadius.topLeft = s;
|
|
3254
3240
|
break;
|
|
3255
3241
|
case "borderTopRightRadius":
|
|
3256
|
-
this._borderRadius.topRight =
|
|
3242
|
+
this._borderRadius.topRight = s;
|
|
3257
3243
|
break;
|
|
3258
3244
|
case "borderBottomRightRadius":
|
|
3259
|
-
this._borderRadius.bottomRight =
|
|
3245
|
+
this._borderRadius.bottomRight = s;
|
|
3260
3246
|
break;
|
|
3261
3247
|
case "borderBottomLeftRadius":
|
|
3262
|
-
this._borderRadius.bottomLeft =
|
|
3248
|
+
this._borderRadius.bottomLeft = s;
|
|
3263
3249
|
break;
|
|
3264
3250
|
// Back & Front linked properties
|
|
3265
3251
|
case "side":
|
|
3266
3252
|
case "castShadow":
|
|
3267
3253
|
case "receiveShadow":
|
|
3268
|
-
const
|
|
3269
|
-
this[`_background${
|
|
3254
|
+
const r = t.charAt(0).toUpperCase() + t.substr(1);
|
|
3255
|
+
this[`_background${r}`].value = s, this[`_font${r}`].value = s;
|
|
3270
3256
|
break;
|
|
3271
3257
|
// Meshes & material properties
|
|
3272
3258
|
case "fontSide":
|
|
@@ -3277,19 +3263,19 @@ class z extends u.Object3D {
|
|
|
3277
3263
|
case "backgroundReceiveShadow":
|
|
3278
3264
|
case "fontMaterial":
|
|
3279
3265
|
case "fontCustomDepthMaterial":
|
|
3280
|
-
this[`_${
|
|
3266
|
+
this[`_${t}`].value = s;
|
|
3281
3267
|
break;
|
|
3282
3268
|
default:
|
|
3283
|
-
this[`_${
|
|
3269
|
+
this[`_${t}`] !== void 0 ? this[`_${t}`].value = s : this[t] = s;
|
|
3284
3270
|
}
|
|
3285
3271
|
}
|
|
3286
3272
|
}
|
|
3287
|
-
get(
|
|
3288
|
-
switch (
|
|
3273
|
+
get(e) {
|
|
3274
|
+
switch (e) {
|
|
3289
3275
|
case "overflow":
|
|
3290
3276
|
case "width":
|
|
3291
3277
|
case "height":
|
|
3292
|
-
return this[`_${
|
|
3278
|
+
return this[`_${e}`].inline;
|
|
3293
3279
|
}
|
|
3294
3280
|
}
|
|
3295
3281
|
/**
|
|
@@ -3299,6 +3285,13 @@ class z extends u.Object3D {
|
|
|
3299
3285
|
_rebuildChildrenLists() {
|
|
3300
3286
|
this._children._needsUpdate = !0;
|
|
3301
3287
|
}
|
|
3288
|
+
/**
|
|
3289
|
+
* Try to retrieve parentUI after each structural change
|
|
3290
|
+
* @protected
|
|
3291
|
+
*/
|
|
3292
|
+
_rebuildParentUI = () => {
|
|
3293
|
+
this._parent._needsUpdate = !0, this.parent && !this.parent.isUI ? (N.register(this), this.activatePseudoState("root")) : (N.remove(this), this.deactivatePseudoState("root"));
|
|
3294
|
+
};
|
|
3302
3295
|
/**
|
|
3303
3296
|
* When the user calls component.add, it registers for updates,
|
|
3304
3297
|
* then call THREE.Object3D.add.
|
|
@@ -3310,11 +3303,11 @@ class z extends u.Object3D {
|
|
|
3310
3303
|
* @param {...Object3D} object
|
|
3311
3304
|
* @return {this}
|
|
3312
3305
|
*/
|
|
3313
|
-
add(
|
|
3314
|
-
let
|
|
3315
|
-
for (let
|
|
3316
|
-
super.add(arguments[
|
|
3317
|
-
return
|
|
3306
|
+
add(e) {
|
|
3307
|
+
let t = !1;
|
|
3308
|
+
for (let s = 0; s < arguments.length; s++)
|
|
3309
|
+
super.add(arguments[s]), arguments[s].isUI && (t = !0);
|
|
3310
|
+
return t && this._rebuildChildrenLists(), this;
|
|
3318
3311
|
}
|
|
3319
3312
|
/**
|
|
3320
3313
|
* When the user calls component.remove, it registers for updates,
|
|
@@ -3323,9 +3316,9 @@ class z extends u.Object3D {
|
|
|
3323
3316
|
* @param {...Object3D} object
|
|
3324
3317
|
* @return {this}
|
|
3325
3318
|
*/
|
|
3326
|
-
remove(
|
|
3327
|
-
for (const
|
|
3328
|
-
arguments[
|
|
3319
|
+
remove(e) {
|
|
3320
|
+
for (const t of Object.keys(arguments))
|
|
3321
|
+
arguments[t].isInline && this.update(null, !0);
|
|
3329
3322
|
return super.remove(...arguments), this._rebuildChildrenLists(), this;
|
|
3330
3323
|
}
|
|
3331
3324
|
/**
|
|
@@ -3333,8 +3326,8 @@ class z extends u.Object3D {
|
|
|
3333
3326
|
* @return {Object3D}
|
|
3334
3327
|
*/
|
|
3335
3328
|
clear() {
|
|
3336
|
-
return this.removeFromParent(), this.traverse((
|
|
3337
|
-
|
|
3329
|
+
return this.removeFromParent(), this.traverse((e) => {
|
|
3330
|
+
e.material && e.material.dispose(), e.geometry && e.geometry.dispose();
|
|
3338
3331
|
}), super.clear(), this._backgroundMesh = null, this._backgroundMaterial = null, this._backgroundMaterialMediation = null, this._backgroundMeshMediation = null, this._children.dispose(), this._children = null, this._parent.dispose(), this._parent = null, this._backgroundSide = null, this._backgroundAlphaTest = null, this._visible = null, this._backgroundCastShadow = null, this._backgroundReceiveShadow = null, this._renderOrder = null, this._segments = null, this._bounds = null, this._boxSizing = null, this._padding = null, this._margin = null, this._position = null, this._flexDirection = null, this._justifyContent = null, this._alignItems = null, this._display = null, this._backgroundColor = null, this._backgroundOpacity = null, this._backgroundSize = null, this._fontOpacity = null, this._color = null, this._whiteSpace = null, this._fontFamily = null, this._fontStyle = null, this._fontWeight = null, this._lineHeight = null, this._fontKerning = null, this._letterSpacing = null, this._overflow = null, this._textAlign = null, this._font = null, this._lineBreak = null, this._layouter = null, this;
|
|
3339
3332
|
}
|
|
3340
3333
|
/**
|
|
@@ -3358,15 +3351,15 @@ class z extends u.Object3D {
|
|
|
3358
3351
|
*
|
|
3359
3352
|
* @param {Material|ShaderMaterial} material
|
|
3360
3353
|
*/
|
|
3361
|
-
set backgroundMaterial(
|
|
3362
|
-
this._backgroundMaterial =
|
|
3354
|
+
set backgroundMaterial(e) {
|
|
3355
|
+
this._backgroundMaterial = e, this._backgroundMaterialMediation = { ...e.constructor.mediation }, this._transferToBackgroundMaterial(), this._backgroundMesh && (this._backgroundMesh.material = this._backgroundMaterial, x(e, "frameSize", this._backgroundMesh.scale));
|
|
3363
3356
|
}
|
|
3364
3357
|
/**
|
|
3365
3358
|
*
|
|
3366
3359
|
* @param {Material|null} material
|
|
3367
3360
|
*/
|
|
3368
|
-
set backgroundCustomDepthMaterial(
|
|
3369
|
-
this._backgroundCustomDepthMaterial =
|
|
3361
|
+
set backgroundCustomDepthMaterial(e) {
|
|
3362
|
+
this._backgroundCustomDepthMaterial = e, this._transferToBackgroundMaterial(), this._backgroundMesh && (this._backgroundMesh.customDepthMaterial = this._backgroundCustomDepthMaterial);
|
|
3370
3363
|
}
|
|
3371
3364
|
/**
|
|
3372
3365
|
*
|
|
@@ -3381,20 +3374,20 @@ class z extends u.Object3D {
|
|
|
3381
3374
|
* @param {Object} [options=null]
|
|
3382
3375
|
* @private
|
|
3383
3376
|
*/
|
|
3384
|
-
_transferToBackgroundMaterial(
|
|
3385
|
-
if (!
|
|
3386
|
-
|
|
3387
|
-
for (const
|
|
3388
|
-
|
|
3377
|
+
_transferToBackgroundMaterial(e = null) {
|
|
3378
|
+
if (!e) {
|
|
3379
|
+
e = {};
|
|
3380
|
+
for (const t of this._components)
|
|
3381
|
+
t.output(e);
|
|
3389
3382
|
}
|
|
3390
|
-
|
|
3383
|
+
z.mediate(this, this._backgroundMaterial, e, this._backgroundMaterialMediation, this._backgroundCustomDepthMaterial);
|
|
3391
3384
|
}
|
|
3392
3385
|
/**
|
|
3393
3386
|
*
|
|
3394
3387
|
* @param {number} value
|
|
3395
3388
|
*/
|
|
3396
|
-
set backgroundSide(
|
|
3397
|
-
this._backgroundSide.value =
|
|
3389
|
+
set backgroundSide(e) {
|
|
3390
|
+
this._backgroundSide.value = e, this._backgroundMaterial && (this._backgroundMaterial.side = e);
|
|
3398
3391
|
}
|
|
3399
3392
|
/**
|
|
3400
3393
|
*
|
|
@@ -3407,8 +3400,8 @@ class z extends u.Object3D {
|
|
|
3407
3400
|
*
|
|
3408
3401
|
* @param {number} value
|
|
3409
3402
|
*/
|
|
3410
|
-
set backgroundAlphaTest(
|
|
3411
|
-
this._backgroundAlphaTest.value =
|
|
3403
|
+
set backgroundAlphaTest(e) {
|
|
3404
|
+
this._backgroundAlphaTest.value = e, this._backgroundMaterial && (this._backgroundMaterial.alphaTest = e);
|
|
3412
3405
|
}
|
|
3413
3406
|
/**
|
|
3414
3407
|
*
|
|
@@ -3430,15 +3423,15 @@ class z extends u.Object3D {
|
|
|
3430
3423
|
*
|
|
3431
3424
|
* @param {Material|ShaderMaterial} material
|
|
3432
3425
|
*/
|
|
3433
|
-
set fontMaterial(
|
|
3434
|
-
this._fontMaterial.value =
|
|
3426
|
+
set fontMaterial(e) {
|
|
3427
|
+
this._fontMaterial.value = e;
|
|
3435
3428
|
}
|
|
3436
3429
|
/**
|
|
3437
3430
|
*
|
|
3438
3431
|
* @param {Material|null} material
|
|
3439
3432
|
*/
|
|
3440
|
-
set fontCustomDepthMaterial(
|
|
3441
|
-
this._fontCustomDepthMaterial.value =
|
|
3433
|
+
set fontCustomDepthMaterial(e) {
|
|
3434
|
+
this._fontCustomDepthMaterial.value = e;
|
|
3442
3435
|
}
|
|
3443
3436
|
/**
|
|
3444
3437
|
*
|
|
@@ -3453,23 +3446,23 @@ class z extends u.Object3D {
|
|
|
3453
3446
|
* @param {Object} [options=null]
|
|
3454
3447
|
* @private
|
|
3455
3448
|
*/
|
|
3456
|
-
_transferToFontMaterial(
|
|
3457
|
-
const
|
|
3458
|
-
if (
|
|
3459
|
-
if (!
|
|
3460
|
-
|
|
3461
|
-
for (const
|
|
3462
|
-
|
|
3449
|
+
_transferToFontMaterial(e = null) {
|
|
3450
|
+
const t = this._fontMaterial.value;
|
|
3451
|
+
if (t) {
|
|
3452
|
+
if (!e) {
|
|
3453
|
+
e = {};
|
|
3454
|
+
for (const s of this._components)
|
|
3455
|
+
s.output(e);
|
|
3463
3456
|
}
|
|
3464
|
-
|
|
3457
|
+
z.mediate(this, t, e, this._fontMaterial._mediation, this._fontCustomDepthMaterial.value);
|
|
3465
3458
|
}
|
|
3466
3459
|
}
|
|
3467
3460
|
/**
|
|
3468
3461
|
*
|
|
3469
3462
|
* @param {number} value
|
|
3470
3463
|
*/
|
|
3471
|
-
set fontSide(
|
|
3472
|
-
this._fontSide.value =
|
|
3464
|
+
set fontSide(e) {
|
|
3465
|
+
this._fontSide.value = e;
|
|
3473
3466
|
}
|
|
3474
3467
|
/**
|
|
3475
3468
|
*
|
|
@@ -3482,8 +3475,8 @@ class z extends u.Object3D {
|
|
|
3482
3475
|
*
|
|
3483
3476
|
* @param {number} value
|
|
3484
3477
|
*/
|
|
3485
|
-
set fontAlphaTest(
|
|
3486
|
-
this._fontAlphaTest.value =
|
|
3478
|
+
set fontAlphaTest(e) {
|
|
3479
|
+
this._fontAlphaTest.value = e;
|
|
3487
3480
|
}
|
|
3488
3481
|
/**
|
|
3489
3482
|
*
|
|
@@ -3501,20 +3494,20 @@ class z extends u.Object3D {
|
|
|
3501
3494
|
* @param {Object} [options=null]
|
|
3502
3495
|
* @private
|
|
3503
3496
|
*/
|
|
3504
|
-
_transferToBackgroundMesh(
|
|
3505
|
-
if (!
|
|
3506
|
-
|
|
3507
|
-
for (const
|
|
3508
|
-
|
|
3497
|
+
_transferToBackgroundMesh(e = null) {
|
|
3498
|
+
if (!e) {
|
|
3499
|
+
e = {};
|
|
3500
|
+
for (const t of this._components)
|
|
3501
|
+
t.output(e);
|
|
3509
3502
|
}
|
|
3510
|
-
|
|
3503
|
+
z.mediate(this, this._backgroundMesh, e, this._backgroundMeshMediation);
|
|
3511
3504
|
}
|
|
3512
3505
|
/**
|
|
3513
3506
|
* @internal
|
|
3514
3507
|
* @param {Mesh|Array.<Mesh>|null} mesh
|
|
3515
3508
|
*/
|
|
3516
|
-
setBackgroundMesh(
|
|
3517
|
-
this._backgroundMesh && (this.remove(this._backgroundMesh), this.unbindBackgroundMeshProperties()), this._backgroundMesh =
|
|
3509
|
+
setBackgroundMesh(e) {
|
|
3510
|
+
this._backgroundMesh && (this.remove(this._backgroundMesh), this.unbindBackgroundMeshProperties()), this._backgroundMesh = e, this._backgroundMesh && (this.bindBackgroundMeshProperties(), this._backgroundCustomDepthMaterial && (this._backgroundMesh.customDepthMaterial = this._backgroundCustomDepthMaterial), this._backgroundMaterial && x(this._backgroundMaterial, "frameSize", this._backgroundMesh.scale), this._transferToBackgroundMesh(), this.add(this._backgroundMesh));
|
|
3518
3511
|
}
|
|
3519
3512
|
/**
|
|
3520
3513
|
*
|
|
@@ -3526,24 +3519,24 @@ class z extends u.Object3D {
|
|
|
3526
3519
|
*/
|
|
3527
3520
|
unbindBackgroundMeshProperties() {
|
|
3528
3521
|
}
|
|
3529
|
-
activatePseudoState(
|
|
3522
|
+
activatePseudoState(e) {
|
|
3530
3523
|
}
|
|
3531
|
-
deactivatePseudoState(
|
|
3524
|
+
deactivatePseudoState(e) {
|
|
3532
3525
|
}
|
|
3533
|
-
togglePseudoState(
|
|
3526
|
+
togglePseudoState(e) {
|
|
3534
3527
|
}
|
|
3535
|
-
hasPseudoState(
|
|
3528
|
+
hasPseudoState(e) {
|
|
3536
3529
|
return !1;
|
|
3537
3530
|
}
|
|
3538
|
-
set borderRadiusMediation(
|
|
3539
|
-
this._borderRadius.mediation =
|
|
3531
|
+
set borderRadiusMediation(e) {
|
|
3532
|
+
this._borderRadius.mediation = e;
|
|
3540
3533
|
}
|
|
3541
3534
|
/**
|
|
3542
3535
|
*
|
|
3543
3536
|
* @param {boolean} value
|
|
3544
3537
|
*/
|
|
3545
|
-
set backgroundCastShadow(
|
|
3546
|
-
this._backgroundCastShadow && (this._backgroundCastShadow.value =
|
|
3538
|
+
set backgroundCastShadow(e) {
|
|
3539
|
+
this._backgroundCastShadow && (this._backgroundCastShadow.value = e);
|
|
3547
3540
|
}
|
|
3548
3541
|
/**
|
|
3549
3542
|
*
|
|
@@ -3556,8 +3549,8 @@ class z extends u.Object3D {
|
|
|
3556
3549
|
*
|
|
3557
3550
|
* @param {boolean} value
|
|
3558
3551
|
*/
|
|
3559
|
-
set backgroundReceiveShadow(
|
|
3560
|
-
this._backgroundReceiveShadow && (this._backgroundReceiveShadow.value =
|
|
3552
|
+
set backgroundReceiveShadow(e) {
|
|
3553
|
+
this._backgroundReceiveShadow && (this._backgroundReceiveShadow.value = e);
|
|
3561
3554
|
}
|
|
3562
3555
|
/**
|
|
3563
3556
|
*
|
|
@@ -3570,8 +3563,8 @@ class z extends u.Object3D {
|
|
|
3570
3563
|
*
|
|
3571
3564
|
* @param {number} value
|
|
3572
3565
|
*/
|
|
3573
|
-
set renderOrder(
|
|
3574
|
-
this._renderOrder && (this._renderOrder.value =
|
|
3566
|
+
set renderOrder(e) {
|
|
3567
|
+
this._renderOrder && (this._renderOrder.value = e);
|
|
3575
3568
|
}
|
|
3576
3569
|
/**
|
|
3577
3570
|
*
|
|
@@ -3587,22 +3580,22 @@ class z extends u.Object3D {
|
|
|
3587
3580
|
* @param {Object} [options=null]
|
|
3588
3581
|
* @private
|
|
3589
3582
|
*/
|
|
3590
|
-
_transferToFontMesh(
|
|
3583
|
+
_transferToFontMesh(e = null) {
|
|
3591
3584
|
if (this._fontMesh) {
|
|
3592
|
-
if (!
|
|
3593
|
-
|
|
3594
|
-
for (const
|
|
3595
|
-
|
|
3585
|
+
if (!e) {
|
|
3586
|
+
e = {};
|
|
3587
|
+
for (const t of this._components)
|
|
3588
|
+
t.output(e);
|
|
3596
3589
|
}
|
|
3597
|
-
|
|
3590
|
+
z.mediate(this, this._fontMesh, e, this._fontMeshMediation);
|
|
3598
3591
|
}
|
|
3599
3592
|
}
|
|
3600
3593
|
/**
|
|
3601
3594
|
* @internal
|
|
3602
3595
|
* @param {Mesh|Array.<Mesh>|null} mesh
|
|
3603
3596
|
*/
|
|
3604
|
-
setFontMesh(
|
|
3605
|
-
this._fontMesh && (this.remove(this._fontMesh), this._fontMesh.material && this._fontMesh.material.dispose(), this._fontMesh.geometry && this._fontMesh.geometry.dispose(), this._fontMesh = null, this.unbindFontMeshProperties()), this._fontMesh =
|
|
3597
|
+
setFontMesh(e) {
|
|
3598
|
+
this._fontMesh && (this.remove(this._fontMesh), this._fontMesh.material && this._fontMesh.material.dispose(), this._fontMesh.geometry && this._fontMesh.geometry.dispose(), this._fontMesh = null, this.unbindFontMeshProperties()), this._fontMesh = e, this._fontMesh && (this._fontMesh.raycast = () => {
|
|
3606
3599
|
}, this.bindFontMeshProperties(), this._transferToFontMaterial(), this._transferToFontMesh(), this.add(this._fontMesh));
|
|
3607
3600
|
}
|
|
3608
3601
|
/**
|
|
@@ -3619,8 +3612,8 @@ class z extends u.Object3D {
|
|
|
3619
3612
|
*
|
|
3620
3613
|
* @param {boolean} value
|
|
3621
3614
|
*/
|
|
3622
|
-
set fontCastShadow(
|
|
3623
|
-
this._fontCastShadow && (this._fontCastShadow.value =
|
|
3615
|
+
set fontCastShadow(e) {
|
|
3616
|
+
this._fontCastShadow && (this._fontCastShadow.value = e);
|
|
3624
3617
|
}
|
|
3625
3618
|
/**
|
|
3626
3619
|
*
|
|
@@ -3633,8 +3626,8 @@ class z extends u.Object3D {
|
|
|
3633
3626
|
*
|
|
3634
3627
|
* @param {boolean} value
|
|
3635
3628
|
*/
|
|
3636
|
-
set fontReceiveShadow(
|
|
3637
|
-
this._fontReceiveShadow && (this._fontReceiveShadow.value =
|
|
3629
|
+
set fontReceiveShadow(e) {
|
|
3630
|
+
this._fontReceiveShadow && (this._fontReceiveShadow.value = e);
|
|
3638
3631
|
}
|
|
3639
3632
|
/**
|
|
3640
3633
|
*
|
|
@@ -3650,8 +3643,8 @@ class z extends u.Object3D {
|
|
|
3650
3643
|
*
|
|
3651
3644
|
* @param {Number} v
|
|
3652
3645
|
*/
|
|
3653
|
-
set segments(
|
|
3654
|
-
this._segments.value =
|
|
3646
|
+
set segments(e) {
|
|
3647
|
+
this._segments.value = e;
|
|
3655
3648
|
}
|
|
3656
3649
|
/**
|
|
3657
3650
|
*
|
|
@@ -3667,38 +3660,38 @@ class z extends u.Object3D {
|
|
|
3667
3660
|
*
|
|
3668
3661
|
* @param {Function} func
|
|
3669
3662
|
*/
|
|
3670
|
-
set onAfterUpdate(
|
|
3671
|
-
console.warn("ThreeMeshUI v7xx : `onAfterUpdate()` property has been deprecated, please rely on `addAfterUpdate` instead."), this.addAfterUpdate(
|
|
3663
|
+
set onAfterUpdate(e) {
|
|
3664
|
+
console.warn("ThreeMeshUI v7xx : `onAfterUpdate()` property has been deprecated, please rely on `addAfterUpdate` instead."), this.addAfterUpdate(e);
|
|
3672
3665
|
}
|
|
3673
3666
|
/**
|
|
3674
3667
|
*
|
|
3675
3668
|
* @param {Function} func
|
|
3676
3669
|
*/
|
|
3677
|
-
addAfterUpdate(
|
|
3678
|
-
this._onAfterUpdates.push(
|
|
3670
|
+
addAfterUpdate(e) {
|
|
3671
|
+
this._onAfterUpdates.push(e);
|
|
3679
3672
|
}
|
|
3680
3673
|
/**
|
|
3681
3674
|
*
|
|
3682
3675
|
* @param {Function} func
|
|
3683
3676
|
*/
|
|
3684
|
-
removeAfterUpdate(
|
|
3685
|
-
const
|
|
3686
|
-
|
|
3677
|
+
removeAfterUpdate(e) {
|
|
3678
|
+
const t = this._onAfterUpdates.indexOf(e);
|
|
3679
|
+
t !== -1 && this._onAfterUpdates.splice(t, 1);
|
|
3687
3680
|
}
|
|
3688
3681
|
/**
|
|
3689
3682
|
* @todo: afterUpdate not called anymore
|
|
3690
3683
|
*/
|
|
3691
3684
|
performAfterUpdate() {
|
|
3692
|
-
for (let
|
|
3693
|
-
this._onAfterUpdates[
|
|
3685
|
+
for (let e = 0; e < this._onAfterUpdates.length; e++)
|
|
3686
|
+
this._onAfterUpdates[e]();
|
|
3694
3687
|
}
|
|
3695
3688
|
/**
|
|
3696
3689
|
* Retrieve a property
|
|
3697
3690
|
* @param propertyName
|
|
3698
3691
|
* @return {BaseProperty|null}
|
|
3699
3692
|
*/
|
|
3700
|
-
getProperty(
|
|
3701
|
-
return this[`_${
|
|
3693
|
+
getProperty(e) {
|
|
3694
|
+
return this[`_${e}`] ? this[`_${e}`] : null;
|
|
3702
3695
|
}
|
|
3703
3696
|
/**
|
|
3704
3697
|
*
|
|
@@ -3706,8 +3699,8 @@ class z extends u.Object3D {
|
|
|
3706
3699
|
* @param {BaseProperty} instance
|
|
3707
3700
|
* @returns {void}
|
|
3708
3701
|
*/
|
|
3709
|
-
appendProperty(
|
|
3710
|
-
this[`_${
|
|
3702
|
+
appendProperty(e, t) {
|
|
3703
|
+
this[`_${e}`] = t, this._components.push(t);
|
|
3711
3704
|
}
|
|
3712
3705
|
/**
|
|
3713
3706
|
*
|
|
@@ -3715,12 +3708,12 @@ class z extends u.Object3D {
|
|
|
3715
3708
|
* @param {BaseProperty} instance
|
|
3716
3709
|
* @returns {BaseProperty}
|
|
3717
3710
|
*/
|
|
3718
|
-
replaceProperty(
|
|
3719
|
-
const
|
|
3720
|
-
return this._components[
|
|
3711
|
+
replaceProperty(e, t) {
|
|
3712
|
+
const s = this[`_${e}`], r = this._components.indexOf(s);
|
|
3713
|
+
return this._components[r] = this[`_${e}`] = t, t.needsUpdate = !0, s;
|
|
3721
3714
|
}
|
|
3722
3715
|
}
|
|
3723
|
-
class
|
|
3716
|
+
class N {
|
|
3724
3717
|
static register(e) {
|
|
3725
3718
|
this.elements.includes(e) || this.elements.push(e);
|
|
3726
3719
|
}
|
|
@@ -3733,8 +3726,8 @@ class X {
|
|
|
3733
3726
|
e.update(), e.process(), e.process(), e.render();
|
|
3734
3727
|
}
|
|
3735
3728
|
}
|
|
3736
|
-
|
|
3737
|
-
const
|
|
3729
|
+
N.elements = [];
|
|
3730
|
+
const Cs = (
|
|
3738
3731
|
/* glsl */
|
|
3739
3732
|
`
|
|
3740
3733
|
|
|
@@ -3743,7 +3736,7 @@ attribute vec2 uvB;
|
|
|
3743
3736
|
varying vec2 vUvB;
|
|
3744
3737
|
|
|
3745
3738
|
`
|
|
3746
|
-
),
|
|
3739
|
+
), ye = Cs, Rs = (
|
|
3747
3740
|
/* glsl */
|
|
3748
3741
|
`
|
|
3749
3742
|
|
|
@@ -3751,7 +3744,7 @@ varying vec2 vUvB;
|
|
|
3751
3744
|
vUvB = uvB;
|
|
3752
3745
|
|
|
3753
3746
|
`
|
|
3754
|
-
),
|
|
3747
|
+
), be = Rs, Bs = (
|
|
3755
3748
|
/* glsl */
|
|
3756
3749
|
`
|
|
3757
3750
|
|
|
@@ -3782,7 +3775,7 @@ float getEllipticFactor( vec2 uv, vec2 center, float radiusX, float radiusY )
|
|
|
3782
3775
|
}
|
|
3783
3776
|
|
|
3784
3777
|
`
|
|
3785
|
-
),
|
|
3778
|
+
), xe = Bs, Us = (
|
|
3786
3779
|
/* glsl */
|
|
3787
3780
|
`
|
|
3788
3781
|
|
|
@@ -3911,7 +3904,7 @@ if( vUvB.x > cornerBR.x && vUvB.y < cornerBR.y ) {
|
|
|
3911
3904
|
}
|
|
3912
3905
|
|
|
3913
3906
|
`
|
|
3914
|
-
),
|
|
3907
|
+
), we = Us, As = (
|
|
3915
3908
|
/* glsl */
|
|
3916
3909
|
`
|
|
3917
3910
|
|
|
@@ -3920,7 +3913,7 @@ uniform vec3 frameSize;
|
|
|
3920
3913
|
uniform vec2 textureSize;
|
|
3921
3914
|
|
|
3922
3915
|
`
|
|
3923
|
-
),
|
|
3916
|
+
), Se = As, Ts = (
|
|
3924
3917
|
/* glsl */
|
|
3925
3918
|
`
|
|
3926
3919
|
|
|
@@ -3970,7 +3963,7 @@ vec4 sampleTexture() {
|
|
|
3970
3963
|
}
|
|
3971
3964
|
#endif
|
|
3972
3965
|
`
|
|
3973
|
-
),
|
|
3966
|
+
), Ve = Ts, Ms = (
|
|
3974
3967
|
/* glsl */
|
|
3975
3968
|
`
|
|
3976
3969
|
#ifdef USE_MAP
|
|
@@ -3980,20 +3973,20 @@ vec4 sampleTexture() {
|
|
|
3980
3973
|
|
|
3981
3974
|
#endif
|
|
3982
3975
|
`
|
|
3983
|
-
),
|
|
3984
|
-
msdfAlphaglyphParsVertexGlsl:
|
|
3985
|
-
msdfAlphaglyphVertexGlsl:
|
|
3986
|
-
msdfOffsetglyphVertexGlsl:
|
|
3987
|
-
msdfAlphaglyphParsFragmentGlsl:
|
|
3988
|
-
msdfAlphaglyphFragmentGlsl:
|
|
3989
|
-
frameBorderParsVertexGlsl:
|
|
3990
|
-
frameBorderVertexGlsl:
|
|
3991
|
-
frameCommonParsFragmentGlsl:
|
|
3992
|
-
frameBorderParsFragmentGlsl:
|
|
3993
|
-
frameBorderFragmentGlsl:
|
|
3994
|
-
frameBackgroundParsFragmentGlsl:
|
|
3995
|
-
frameBackgroundFragmentGlsl:
|
|
3996
|
-
},
|
|
3976
|
+
), ke = Ms, tt = {
|
|
3977
|
+
msdfAlphaglyphParsVertexGlsl: de,
|
|
3978
|
+
msdfAlphaglyphVertexGlsl: _e,
|
|
3979
|
+
msdfOffsetglyphVertexGlsl: fe,
|
|
3980
|
+
msdfAlphaglyphParsFragmentGlsl: pe,
|
|
3981
|
+
msdfAlphaglyphFragmentGlsl: ge,
|
|
3982
|
+
frameBorderParsVertexGlsl: ye,
|
|
3983
|
+
frameBorderVertexGlsl: be,
|
|
3984
|
+
frameCommonParsFragmentGlsl: Se,
|
|
3985
|
+
frameBorderParsFragmentGlsl: xe,
|
|
3986
|
+
frameBorderFragmentGlsl: we,
|
|
3987
|
+
frameBackgroundParsFragmentGlsl: Ve,
|
|
3988
|
+
frameBackgroundFragmentGlsl: ke
|
|
3989
|
+
}, Fs = (
|
|
3997
3990
|
/* glsl */
|
|
3998
3991
|
`
|
|
3999
3992
|
// Would be automatic on three materials and from USE_UV
|
|
@@ -4001,7 +3994,7 @@ vec4 sampleTexture() {
|
|
|
4001
3994
|
varying vec2 vUv;
|
|
4002
3995
|
#endif
|
|
4003
3996
|
|
|
4004
|
-
${
|
|
3997
|
+
${ye}
|
|
4005
3998
|
|
|
4006
3999
|
#include <clipping_planes_pars_vertex>
|
|
4007
4000
|
|
|
@@ -4011,7 +4004,7 @@ void main() {
|
|
|
4011
4004
|
vUv = uv;
|
|
4012
4005
|
#endif
|
|
4013
4006
|
|
|
4014
|
-
${
|
|
4007
|
+
${be}
|
|
4015
4008
|
|
|
4016
4009
|
vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );
|
|
4017
4010
|
gl_Position = projectionMatrix * mvPosition;
|
|
@@ -4020,7 +4013,7 @@ void main() {
|
|
|
4020
4013
|
|
|
4021
4014
|
}
|
|
4022
4015
|
`
|
|
4023
|
-
),
|
|
4016
|
+
), Os = (
|
|
4024
4017
|
/* glsl */
|
|
4025
4018
|
`
|
|
4026
4019
|
|
|
@@ -4032,9 +4025,9 @@ uniform float opacity;
|
|
|
4032
4025
|
uniform float alphaTest;
|
|
4033
4026
|
#endif
|
|
4034
4027
|
|
|
4035
|
-
${
|
|
4028
|
+
${Se}
|
|
4036
4029
|
|
|
4037
|
-
${
|
|
4030
|
+
${xe}
|
|
4038
4031
|
|
|
4039
4032
|
|
|
4040
4033
|
#ifdef USE_MAP
|
|
@@ -4042,7 +4035,7 @@ varying vec2 vUv;
|
|
|
4042
4035
|
uniform sampler2D map;
|
|
4043
4036
|
#endif
|
|
4044
4037
|
|
|
4045
|
-
${
|
|
4038
|
+
${Ve}
|
|
4046
4039
|
|
|
4047
4040
|
#include <clipping_planes_pars_fragment>
|
|
4048
4041
|
|
|
@@ -4051,9 +4044,9 @@ void main() {
|
|
|
4051
4044
|
vec4 diffuseColor = vec4( diffuse, opacity );
|
|
4052
4045
|
|
|
4053
4046
|
// map
|
|
4054
|
-
${
|
|
4047
|
+
${ke}
|
|
4055
4048
|
|
|
4056
|
-
${
|
|
4049
|
+
${we}
|
|
4057
4050
|
|
|
4058
4051
|
#ifdef USE_ALPHATEST
|
|
4059
4052
|
|
|
@@ -4069,13 +4062,13 @@ void main() {
|
|
|
4069
4062
|
}
|
|
4070
4063
|
`
|
|
4071
4064
|
);
|
|
4072
|
-
class
|
|
4065
|
+
class X {
|
|
4073
4066
|
/**
|
|
4074
4067
|
*
|
|
4075
4068
|
* @returns {Object<{m: string, t?: (function((Material|ShaderMaterial), string, *): void)}>}
|
|
4076
4069
|
*/
|
|
4077
4070
|
static get mediation() {
|
|
4078
|
-
return
|
|
4071
|
+
return zs;
|
|
4079
4072
|
}
|
|
4080
4073
|
/**
|
|
4081
4074
|
* Alter a material options with required fontMaterial options and or default values
|
|
@@ -4115,7 +4108,7 @@ class j {
|
|
|
4115
4108
|
* @param shader
|
|
4116
4109
|
*/
|
|
4117
4110
|
static injectShaderChunks(e) {
|
|
4118
|
-
|
|
4111
|
+
X.injectVertexShaderChunks(e), X.injectFragmentShaderChunks(e);
|
|
4119
4112
|
}
|
|
4120
4113
|
/**
|
|
4121
4114
|
*
|
|
@@ -4125,11 +4118,11 @@ class j {
|
|
|
4125
4118
|
e.vertexShader = e.vertexShader.replace(
|
|
4126
4119
|
"#include <uv_pars_vertex>",
|
|
4127
4120
|
`#include <uv_pars_vertex>
|
|
4128
|
-
` +
|
|
4121
|
+
` + ye
|
|
4129
4122
|
), e.vertexShader = e.vertexShader.replace(
|
|
4130
4123
|
"#include <uv_vertex>",
|
|
4131
4124
|
`#include <uv_vertex>
|
|
4132
|
-
` +
|
|
4125
|
+
` + be
|
|
4133
4126
|
);
|
|
4134
4127
|
}
|
|
4135
4128
|
/**
|
|
@@ -4140,36 +4133,36 @@ class j {
|
|
|
4140
4133
|
e.fragmentShader = e.fragmentShader.replace(
|
|
4141
4134
|
"#include <map_pars_fragment>",
|
|
4142
4135
|
`#include <map_pars_fragment>
|
|
4143
|
-
` +
|
|
4136
|
+
` + Ve
|
|
4144
4137
|
), e.fragmentShader = e.fragmentShader.replace(
|
|
4145
4138
|
"#include <map_pars_fragment>",
|
|
4146
4139
|
`#include <map_pars_fragment>
|
|
4147
|
-
` +
|
|
4140
|
+
` + xe
|
|
4148
4141
|
), e.fragmentShader = e.fragmentShader.replace(
|
|
4149
4142
|
"#include <map_pars_fragment>",
|
|
4150
4143
|
`#include <map_pars_fragment>
|
|
4151
|
-
` +
|
|
4144
|
+
` + Se
|
|
4152
4145
|
), e.fragmentShader = e.fragmentShader.replace(
|
|
4153
4146
|
"#include <map_fragment>",
|
|
4154
|
-
|
|
4147
|
+
ke
|
|
4155
4148
|
), e.fragmentShader = e.fragmentShader.replace(
|
|
4156
4149
|
"#include <alphamap_fragment>",
|
|
4157
|
-
|
|
4150
|
+
we + `
|
|
4158
4151
|
#include <alphamap_fragment>`
|
|
4159
4152
|
);
|
|
4160
4153
|
}
|
|
4161
4154
|
}
|
|
4162
|
-
const
|
|
4163
|
-
t = ["stretch", "contain", "cover"].indexOf(t),
|
|
4164
|
-
},
|
|
4155
|
+
const Ls = function(i, e, t) {
|
|
4156
|
+
t = ["stretch", "contain", "cover"].indexOf(t), Ye(i, "BACKGROUND_MAPPING", t);
|
|
4157
|
+
}, zs = {
|
|
4165
4158
|
clippingPlanes: { m: "clippingPlanes" },
|
|
4166
|
-
backgroundAlphaTest: { m: "alphaTest", t:
|
|
4159
|
+
backgroundAlphaTest: { m: "alphaTest", t: Y },
|
|
4167
4160
|
backgroundSide: { m: "side" },
|
|
4168
4161
|
// backgroundTexture: { m: 'map' },
|
|
4169
4162
|
backgroundImage: { m: "map" },
|
|
4170
4163
|
backgroundColor: { m: "color" },
|
|
4171
4164
|
backgroundOpacity: { m: "opacity" },
|
|
4172
|
-
backgroundSize: { m: "computedBackgroundSize", t:
|
|
4165
|
+
backgroundSize: { m: "computedBackgroundSize", t: Ls },
|
|
4173
4166
|
borderWidth: { m: "borderWidth", t: x },
|
|
4174
4167
|
borderColor: { m: "borderColor", t: x },
|
|
4175
4168
|
cornerTL: { m: "cornerTL", t: x },
|
|
@@ -4180,7 +4173,7 @@ const Es = function(i, e, t) {
|
|
|
4180
4173
|
size: { m: "frameSize", t: x },
|
|
4181
4174
|
tSize: { m: "textureSize", t: x }
|
|
4182
4175
|
};
|
|
4183
|
-
class
|
|
4176
|
+
class it extends u.ShaderMaterial {
|
|
4184
4177
|
/**
|
|
4185
4178
|
* This static method is mandatory for extending ThreeMeshUI.FrameMaterial
|
|
4186
4179
|
* It will provide a transfer description for properties from ThreeMeshUI.Text to THREE.Material
|
|
@@ -4188,7 +4181,7 @@ class st extends u.ShaderMaterial {
|
|
|
4188
4181
|
* @returns {Object.<{m:string, t?:(frameMaterial:Material|ShaderMaterial, materialProperty:string, value:any) => void}>}
|
|
4189
4182
|
*/
|
|
4190
4183
|
static get mediation() {
|
|
4191
|
-
return
|
|
4184
|
+
return X.mediation;
|
|
4192
4185
|
}
|
|
4193
4186
|
constructor() {
|
|
4194
4187
|
super({
|
|
@@ -4213,8 +4206,8 @@ class st extends u.ShaderMaterial {
|
|
|
4213
4206
|
side: u.FrontSide,
|
|
4214
4207
|
transparent: !0,
|
|
4215
4208
|
clipping: !0,
|
|
4216
|
-
vertexShader:
|
|
4217
|
-
fragmentShader:
|
|
4209
|
+
vertexShader: Fs,
|
|
4210
|
+
fragmentShader: Os,
|
|
4218
4211
|
extensions: {
|
|
4219
4212
|
derivatives: !0
|
|
4220
4213
|
}
|
|
@@ -4269,20 +4262,9 @@ class st extends u.ShaderMaterial {
|
|
|
4269
4262
|
this.uniforms.diffuse.value = e;
|
|
4270
4263
|
}
|
|
4271
4264
|
}
|
|
4272
|
-
class
|
|
4265
|
+
class Ws extends p {
|
|
4273
4266
|
constructor() {
|
|
4274
|
-
super("children", null, !1);
|
|
4275
|
-
/**
|
|
4276
|
-
*
|
|
4277
|
-
* Sort children according to their .style.order property or fallback on children index
|
|
4278
|
-
*
|
|
4279
|
-
* @param {HTMLElementVR} a
|
|
4280
|
-
* @param {HTMLElementVR} b
|
|
4281
|
-
* @return {number}
|
|
4282
|
-
* @private
|
|
4283
|
-
*/
|
|
4284
|
-
I(this, "_sortOrder", (t, s) => t._order._value < s._order._value ? -1 : t._order._value > s._order._value ? 1 : this._uis.indexOf(t) < this._uis.indexOf(s) ? -1 : 1);
|
|
4285
|
-
this._uis = [], this._boxes = [];
|
|
4267
|
+
super("children", null, !1), this._uis = [], this._boxes = [];
|
|
4286
4268
|
}
|
|
4287
4269
|
/* eslint-disable no-unused-vars */
|
|
4288
4270
|
/**
|
|
@@ -4293,8 +4275,8 @@ class Hs extends p {
|
|
|
4293
4275
|
* @param element
|
|
4294
4276
|
* @param out
|
|
4295
4277
|
*/
|
|
4296
|
-
update(
|
|
4297
|
-
this._compute(
|
|
4278
|
+
update(e, t) {
|
|
4279
|
+
this._compute(e), e._layouter._needsUpdate = !0, e._renderOrder._needsUpdate = !0;
|
|
4298
4280
|
}
|
|
4299
4281
|
/**
|
|
4300
4282
|
* Process when :
|
|
@@ -4302,11 +4284,11 @@ class Hs extends p {
|
|
|
4302
4284
|
*
|
|
4303
4285
|
* @param element
|
|
4304
4286
|
*/
|
|
4305
|
-
process(
|
|
4306
|
-
this._compute(
|
|
4287
|
+
process(e) {
|
|
4288
|
+
this._compute(e), e._flexDirection._needsProcess = !0, e._layouter._needsProcess = !0, e._overflow._needsRender = !0;
|
|
4307
4289
|
}
|
|
4308
|
-
_compute(
|
|
4309
|
-
this._uis =
|
|
4290
|
+
_compute(e) {
|
|
4291
|
+
this._uis = e.children.filter((t) => t.visible && t.isUI), this._boxes = this._uis.filter((t) => t.isBox).sort(this._sortOrder);
|
|
4310
4292
|
}
|
|
4311
4293
|
/**
|
|
4312
4294
|
*
|
|
@@ -4314,8 +4296,18 @@ class Hs extends p {
|
|
|
4314
4296
|
dispose() {
|
|
4315
4297
|
this._uis = null, this._boxes = null;
|
|
4316
4298
|
}
|
|
4299
|
+
/**
|
|
4300
|
+
*
|
|
4301
|
+
* Sort children according to their .style.order property or fallback on children index
|
|
4302
|
+
*
|
|
4303
|
+
* @param {HTMLElementVR} a
|
|
4304
|
+
* @param {HTMLElementVR} b
|
|
4305
|
+
* @return {number}
|
|
4306
|
+
* @private
|
|
4307
|
+
*/
|
|
4308
|
+
_sortOrder = (e, t) => e._order._value < t._order._value ? -1 : e._order._value > t._order._value ? 1 : this._uis.indexOf(e) < this._uis.indexOf(t) ? -1 : 1;
|
|
4317
4309
|
}
|
|
4318
|
-
class
|
|
4310
|
+
class st extends p {
|
|
4319
4311
|
constructor() {
|
|
4320
4312
|
super("bounds", null, !1), this._size = new u.Vector3(1, 1, 1), this._offsetWidth = 0, this._offsetHeight = 0, this._innerWidth = 0, this._innerHeight = 0, this._centerX = 0.5, this._centerY = 0.5, this._needsProcess = !0;
|
|
4321
4313
|
}
|
|
@@ -4326,7 +4318,7 @@ class rt extends p {
|
|
|
4326
4318
|
*/
|
|
4327
4319
|
setReferenceWidth(e, t) {
|
|
4328
4320
|
const s = e._width, r = e._padding._value, n = e._borderWidth._value, o = e._margin._value, a = s._auto ? 1 : s._value, l = t * a - (o.y + o.w);
|
|
4329
|
-
|
|
4321
|
+
re(l, this._offsetWidth) || (this._offsetWidth = l, this._innerWidth = this._offsetWidth - (r.y + r.w + n.y + n.w), this._centerX = Q(e), this._propagateWidth(e), this._triggerCascadingDependencies(e));
|
|
4330
4322
|
}
|
|
4331
4323
|
/**
|
|
4332
4324
|
* Set the value of the height 100%
|
|
@@ -4335,22 +4327,22 @@ class rt extends p {
|
|
|
4335
4327
|
*/
|
|
4336
4328
|
setReferenceHeight(e, t) {
|
|
4337
4329
|
const s = e._height, r = e._padding._value, n = e._borderWidth._value, o = e._margin._value, a = s._auto ? 1 : s._value, l = t * a - (o.x + o.z);
|
|
4338
|
-
|
|
4330
|
+
re(l, this._offsetHeight) || (this._offsetHeight = l, this._innerHeight = this._offsetHeight - (r.x + r.z + n.x + n.z), this._centerY = ee(e), this._propagateHeight(e), this._triggerCascadingDependencies(e));
|
|
4339
4331
|
}
|
|
4340
4332
|
setChildrenWidth(e, t) {
|
|
4341
4333
|
const s = e._padding._value, r = e._borderWidth._value;
|
|
4342
|
-
this._innerWidth = t, this._offsetWidth = this._innerWidth + (s.y + s.w + r.y + r.w), this._centerX =
|
|
4334
|
+
this._innerWidth = t, this._offsetWidth = this._innerWidth + (s.y + s.w + r.y + r.w), this._centerX = Q(e), this._propagateWidth(e), this._triggerCascadingDependencies(e);
|
|
4343
4335
|
}
|
|
4344
4336
|
setChildrenHeight(e, t) {
|
|
4345
4337
|
const s = e._padding._value, r = e._borderWidth._value;
|
|
4346
|
-
this._innerHeight = t, this._offsetHeight = this._innerHeight + (s.x + s.z + r.x + r.z), this._centerY =
|
|
4338
|
+
this._innerHeight = t, this._offsetHeight = this._innerHeight + (s.x + s.z + r.x + r.z), this._centerY = ee(e), this._propagateHeight(e), this._triggerCascadingDependencies(e);
|
|
4347
4339
|
}
|
|
4348
4340
|
/* eslint-disable no-unused-vars */
|
|
4349
4341
|
update(e, t) {
|
|
4350
4342
|
const s = e._padding._value, r = e._borderWidth._value, n = e._width;
|
|
4351
|
-
!n._auto && !n._relative && (e._boxSizing._value === "content-box" ? (this._innerWidth = n._value, this._offsetWidth = this._innerWidth + s.y + s.w + r.y + r.w) : (this._offsetWidth = n._value, this._innerWidth = this._offsetWidth - (s.y + s.w + r.y + r.w)), this._centerX =
|
|
4343
|
+
!n._auto && !n._relative && (e._boxSizing._value === "content-box" ? (this._innerWidth = n._value, this._offsetWidth = this._innerWidth + s.y + s.w + r.y + r.w) : (this._offsetWidth = n._value, this._innerWidth = this._offsetWidth - (s.y + s.w + r.y + r.w)), this._centerX = Q(e), this._needsProcess = !0, this._propagateWidth(e), this._triggerCascadingDependencies(e));
|
|
4352
4344
|
const o = e._height;
|
|
4353
|
-
!o._auto && !o._relative && (e._boxSizing._value === "content-box" ? (this._innerHeight = o._value, this._offsetHeight = this._innerHeight + s.x + s.z + r.x + r.z) : (this._offsetHeight = o._value, this._innerHeight = this._offsetHeight - (s.x + s.z + r.x + r.z)), this._centerY =
|
|
4345
|
+
!o._auto && !o._relative && (e._boxSizing._value === "content-box" ? (this._innerHeight = o._value, this._offsetHeight = this._innerHeight + s.x + s.z + r.x + r.z) : (this._offsetHeight = o._value, this._innerHeight = this._offsetHeight - (s.x + s.z + r.x + r.z)), this._centerY = ee(e), this._needsProcess = !0, this._propagateHeight(e), this._triggerCascadingDependencies(e));
|
|
4354
4346
|
}
|
|
4355
4347
|
/* eslint-disable no-unused-vars */
|
|
4356
4348
|
render(e) {
|
|
@@ -4376,7 +4368,7 @@ class rt extends p {
|
|
|
4376
4368
|
* @internal
|
|
4377
4369
|
*/
|
|
4378
4370
|
_computeChildrenSideWidth(e) {
|
|
4379
|
-
return
|
|
4371
|
+
return Es(e);
|
|
4380
4372
|
}
|
|
4381
4373
|
/**
|
|
4382
4374
|
*
|
|
@@ -4384,7 +4376,7 @@ class rt extends p {
|
|
|
4384
4376
|
* @internal
|
|
4385
4377
|
*/
|
|
4386
4378
|
_computeChildrenSideHeight(e) {
|
|
4387
|
-
return
|
|
4379
|
+
return Ds(e);
|
|
4388
4380
|
}
|
|
4389
4381
|
_propagateWidth(e) {
|
|
4390
4382
|
for (let t = 0; t < e._children._boxes.length; t++) {
|
|
@@ -4402,27 +4394,27 @@ class rt extends p {
|
|
|
4402
4394
|
e._parent._value && (e._parent._value._autoSize._needsProcess = !0), e._flexDirection._needsProcess = !0, e._fontSize._needsProcess = !0, e._layouter._needsProcess = !0, this._needsRender = !0, e._borderWidth._needsRender = !0, e._borderRadius._needsRender = !0, e._overflow._needsRender = !0;
|
|
4403
4395
|
}
|
|
4404
4396
|
}
|
|
4405
|
-
function
|
|
4397
|
+
function Q(i) {
|
|
4406
4398
|
const e = i._padding._value, t = i._borderWidth._value, s = e.w + t.w, r = e.y + t.y;
|
|
4407
4399
|
return (s - r) / 2;
|
|
4408
4400
|
}
|
|
4409
|
-
function
|
|
4401
|
+
function ee(i) {
|
|
4410
4402
|
const e = i._padding._value, t = i._borderWidth._value, s = e.x + t.x;
|
|
4411
4403
|
return (e.z + t.z - s) / 2;
|
|
4412
4404
|
}
|
|
4413
|
-
function
|
|
4405
|
+
function Es(i) {
|
|
4414
4406
|
return i._children._boxes.reduce((e, t) => {
|
|
4415
4407
|
const s = t._margin._value, r = t._bounds._offsetWidth + s.y + s.w;
|
|
4416
4408
|
return e + r;
|
|
4417
4409
|
}, 0);
|
|
4418
4410
|
}
|
|
4419
|
-
function
|
|
4411
|
+
function Ds(i) {
|
|
4420
4412
|
return i._children._boxes.reduce((e, t) => {
|
|
4421
4413
|
const s = t._margin._value, r = t._bounds._offsetHeight + s.x + s.z;
|
|
4422
4414
|
return e + r;
|
|
4423
4415
|
}, 0);
|
|
4424
4416
|
}
|
|
4425
|
-
class
|
|
4417
|
+
class Hs extends ue {
|
|
4426
4418
|
constructor() {
|
|
4427
4419
|
super(), this._allowsInherit = !1, this._needsUpdate = !0, this._process = this.emptyStrategyLogic, this._childAlign = this.emptyStrategyLogic;
|
|
4428
4420
|
}
|
|
@@ -4434,28 +4426,28 @@ class Ns extends he {
|
|
|
4434
4426
|
switch (this._value = this._inheritedInput, e._flexDirection._value) {
|
|
4435
4427
|
case "row":
|
|
4436
4428
|
case "row-reverse":
|
|
4437
|
-
switch (this._process =
|
|
4429
|
+
switch (this._process = Ys, this._value) {
|
|
4438
4430
|
case "start":
|
|
4439
|
-
this._childAlign =
|
|
4431
|
+
this._childAlign = $s;
|
|
4440
4432
|
break;
|
|
4441
4433
|
case "end":
|
|
4442
|
-
this._childAlign =
|
|
4434
|
+
this._childAlign = Gs;
|
|
4443
4435
|
break;
|
|
4444
4436
|
default:
|
|
4445
|
-
this._childAlign =
|
|
4437
|
+
this._childAlign = Ue;
|
|
4446
4438
|
}
|
|
4447
4439
|
break;
|
|
4448
4440
|
case "column":
|
|
4449
4441
|
case "column-reverse":
|
|
4450
|
-
switch (this._process =
|
|
4442
|
+
switch (this._process = js, this._value) {
|
|
4451
4443
|
case "start":
|
|
4452
|
-
this._childAlign =
|
|
4444
|
+
this._childAlign = Xs;
|
|
4453
4445
|
break;
|
|
4454
4446
|
case "end":
|
|
4455
|
-
this._childAlign =
|
|
4447
|
+
this._childAlign = Ns;
|
|
4456
4448
|
break;
|
|
4457
4449
|
default:
|
|
4458
|
-
this._childAlign =
|
|
4450
|
+
this._childAlign = Ue;
|
|
4459
4451
|
}
|
|
4460
4452
|
break;
|
|
4461
4453
|
}
|
|
@@ -4477,50 +4469,50 @@ class Ns extends he {
|
|
|
4477
4469
|
});
|
|
4478
4470
|
}
|
|
4479
4471
|
}
|
|
4480
|
-
function
|
|
4472
|
+
function Ue() {
|
|
4481
4473
|
return 0;
|
|
4482
4474
|
}
|
|
4483
|
-
function
|
|
4475
|
+
function Gs(i, e) {
|
|
4484
4476
|
return -e + i._bounds._offsetHeight / 2;
|
|
4485
4477
|
}
|
|
4486
|
-
function
|
|
4478
|
+
function $s(i, e) {
|
|
4487
4479
|
return e - i._bounds._offsetHeight / 2;
|
|
4488
4480
|
}
|
|
4489
|
-
function
|
|
4481
|
+
function Ns(i, e) {
|
|
4490
4482
|
return e - i._bounds._offsetWidth / 2;
|
|
4491
4483
|
}
|
|
4492
|
-
function
|
|
4484
|
+
function Xs(i, e) {
|
|
4493
4485
|
return -e + i._bounds._offsetWidth / 2;
|
|
4494
4486
|
}
|
|
4495
|
-
function
|
|
4487
|
+
function js(i, e) {
|
|
4496
4488
|
const t = i._bounds._innerWidth / 2;
|
|
4497
4489
|
i._children._boxes.forEach((s) => {
|
|
4498
4490
|
i._layouter._childrenPos[s.id].x = e(s, t);
|
|
4499
4491
|
});
|
|
4500
4492
|
}
|
|
4501
|
-
function
|
|
4493
|
+
function Ys(i, e) {
|
|
4502
4494
|
const t = i._bounds._innerHeight / 2;
|
|
4503
4495
|
i._children._boxes.forEach((s) => {
|
|
4504
4496
|
i._layouter._childrenPos[s.id].y = e(s, t);
|
|
4505
4497
|
});
|
|
4506
4498
|
}
|
|
4507
|
-
class
|
|
4499
|
+
class Ks extends le {
|
|
4508
4500
|
constructor() {
|
|
4509
4501
|
super(), this._allowsInherit = !1, this._needsUpdate = !0, this._offset = 0, this._reverse = 1, this._process = this.emptyStrategyLogic;
|
|
4510
4502
|
}
|
|
4511
4503
|
computeOutputValue(e) {
|
|
4512
4504
|
switch (this._value = this._inheritedInput, this._value) {
|
|
4513
4505
|
case "row":
|
|
4514
|
-
this._process =
|
|
4506
|
+
this._process = qs;
|
|
4515
4507
|
break;
|
|
4516
4508
|
case "row-reverse":
|
|
4517
|
-
this._process =
|
|
4509
|
+
this._process = Js;
|
|
4518
4510
|
break;
|
|
4519
4511
|
case "column":
|
|
4520
|
-
this._process =
|
|
4512
|
+
this._process = Zs;
|
|
4521
4513
|
break;
|
|
4522
4514
|
case "column-reverse":
|
|
4523
|
-
this._process =
|
|
4515
|
+
this._process = Qs;
|
|
4524
4516
|
break;
|
|
4525
4517
|
}
|
|
4526
4518
|
e._justifyContent._needsUpdate || e._justifyContent.computeOutputValue(e), e._alignItems._needsUpdate || e._alignItems.computeOutputValue(e), this._needsProcess = !0;
|
|
@@ -4543,7 +4535,7 @@ class Zs extends ce {
|
|
|
4543
4535
|
this._reverse = -Math.sign(this._offset), this._reverse === 0 && (this._reverse = 1), this._process(e), e._justifyContent._needsProcess = !0, e._layouter._needsProcess = !0;
|
|
4544
4536
|
}
|
|
4545
4537
|
}
|
|
4546
|
-
function
|
|
4538
|
+
function qs(i) {
|
|
4547
4539
|
let e = i._flexDirection._offset;
|
|
4548
4540
|
const t = i._flexDirection._reverse, s = i._children._boxes;
|
|
4549
4541
|
for (let r = 0; r < s.length; r++) {
|
|
@@ -4553,7 +4545,7 @@ function Qs(i) {
|
|
|
4553
4545
|
l.x = e + a / 2 * t, l.y = 0, e += t * (a + n._margin._value.y);
|
|
4554
4546
|
}
|
|
4555
4547
|
}
|
|
4556
|
-
function
|
|
4548
|
+
function Js(i) {
|
|
4557
4549
|
let e = i._flexDirection._offset;
|
|
4558
4550
|
const t = i._flexDirection._reverse, s = i._children._boxes;
|
|
4559
4551
|
for (let r = 0; r < s.length; r++) {
|
|
@@ -4563,7 +4555,7 @@ function er(i) {
|
|
|
4563
4555
|
l.x = e + a / 2 * t, l.y = 0, e += (a + n._margin._value.w) * t;
|
|
4564
4556
|
}
|
|
4565
4557
|
}
|
|
4566
|
-
function
|
|
4558
|
+
function Zs(i) {
|
|
4567
4559
|
let e = i._flexDirection._offset;
|
|
4568
4560
|
const t = i._flexDirection._reverse, s = i._children._boxes;
|
|
4569
4561
|
for (let r = 0; r < s.length; r++) {
|
|
@@ -4573,7 +4565,7 @@ function tr(i) {
|
|
|
4573
4565
|
l.x = 0, l.y = e + a / 2 * t, e += (a + n._margin._value.z) * t;
|
|
4574
4566
|
}
|
|
4575
4567
|
}
|
|
4576
|
-
function
|
|
4568
|
+
function Qs(i) {
|
|
4577
4569
|
let e = i._flexDirection._offset;
|
|
4578
4570
|
const t = i._flexDirection._reverse, s = i._children._boxes;
|
|
4579
4571
|
for (let r = 0; r < s.length; r++) {
|
|
@@ -4583,7 +4575,7 @@ function ir(i) {
|
|
|
4583
4575
|
l.x = 0, l.y = e + a / 2 * t, e += (a + n._margin._value.x) * t;
|
|
4584
4576
|
}
|
|
4585
4577
|
}
|
|
4586
|
-
class
|
|
4578
|
+
class er extends ce {
|
|
4587
4579
|
constructor(e) {
|
|
4588
4580
|
super("justifyContent", e, !0), this._allowsInherit = !1, this._needsUpdate = !0, this._computeOffset = this.emptyStrategyLogic, this._computeMargin = this.emptyStrategyLogic, this._process = this.emptyStrategyLogic;
|
|
4589
4581
|
}
|
|
@@ -4591,31 +4583,31 @@ class sr extends de {
|
|
|
4591
4583
|
switch (this._value = this._inheritedInput, e._flexDirection._value) {
|
|
4592
4584
|
case "column-reverse":
|
|
4593
4585
|
case "column":
|
|
4594
|
-
this._process =
|
|
4586
|
+
this._process = ir.bind(this);
|
|
4595
4587
|
break;
|
|
4596
4588
|
case "row-reverse":
|
|
4597
4589
|
case "row":
|
|
4598
|
-
this._process =
|
|
4590
|
+
this._process = tr.bind(this);
|
|
4599
4591
|
break;
|
|
4600
4592
|
}
|
|
4601
4593
|
switch (this._value) {
|
|
4602
4594
|
case "end":
|
|
4603
|
-
this._computeOffset =
|
|
4595
|
+
this._computeOffset = nr, this._computeMargin = te;
|
|
4604
4596
|
break;
|
|
4605
4597
|
case "center":
|
|
4606
|
-
this._computeOffset =
|
|
4598
|
+
this._computeOffset = or, this._computeMargin = te;
|
|
4607
4599
|
break;
|
|
4608
4600
|
case "start":
|
|
4609
|
-
this._computeOffset =
|
|
4601
|
+
this._computeOffset = D, this._computeMargin = te;
|
|
4610
4602
|
break;
|
|
4611
4603
|
case "space-between":
|
|
4612
|
-
this._computeOffset =
|
|
4604
|
+
this._computeOffset = D, this._computeMargin = ar;
|
|
4613
4605
|
break;
|
|
4614
4606
|
case "space-around":
|
|
4615
|
-
this._computeOffset =
|
|
4607
|
+
this._computeOffset = D, this._computeMargin = hr;
|
|
4616
4608
|
break;
|
|
4617
4609
|
case "space-evenly":
|
|
4618
|
-
this._computeOffset =
|
|
4610
|
+
this._computeOffset = D, this._computeMargin = ur;
|
|
4619
4611
|
break;
|
|
4620
4612
|
}
|
|
4621
4613
|
e._flexDirection._needsProcess = !0;
|
|
@@ -4624,39 +4616,39 @@ class sr extends de {
|
|
|
4624
4616
|
this._process(e), e._alignItems._needsProcess = !0;
|
|
4625
4617
|
}
|
|
4626
4618
|
}
|
|
4627
|
-
function
|
|
4628
|
-
const e = i._flexDirection._offset, { usedDirectionSpace: t, remainingSpace: s } =
|
|
4619
|
+
function tr(i) {
|
|
4620
|
+
const e = i._flexDirection._offset, { usedDirectionSpace: t, remainingSpace: s } = sr(i), r = e * 2 - t * Math.sign(e), n = this._computeOffset(r), o = this._computeMargin(i, s, i._flexDirection._reverse);
|
|
4629
4621
|
i._children._boxes.forEach((a, l) => {
|
|
4630
4622
|
i._layouter._childrenPos[a.id].x -= n - o[l];
|
|
4631
4623
|
});
|
|
4632
4624
|
}
|
|
4633
|
-
function
|
|
4634
|
-
const e = i._flexDirection._offset, { usedDirectionSpace: t, remainingSpace: s } =
|
|
4625
|
+
function ir(i) {
|
|
4626
|
+
const e = i._flexDirection._offset, { usedDirectionSpace: t, remainingSpace: s } = rr(i), r = e * 2 - t * Math.sign(e), n = this._computeOffset(r), o = this._computeMargin(i, s, i._flexDirection._reverse);
|
|
4635
4627
|
i._children._boxes.forEach((a, l) => {
|
|
4636
4628
|
i._layouter._childrenPos[a.id].y -= n - o[l];
|
|
4637
4629
|
});
|
|
4638
4630
|
}
|
|
4639
|
-
function
|
|
4631
|
+
function sr(i) {
|
|
4640
4632
|
const e = i._bounds._computeChildrenSideWidth(i);
|
|
4641
4633
|
return { usedDirectionSpace: e, remainingSpace: i._bounds._innerWidth - e };
|
|
4642
4634
|
}
|
|
4643
|
-
function
|
|
4635
|
+
function rr(i) {
|
|
4644
4636
|
const e = i._bounds._computeChildrenSideHeight(i);
|
|
4645
4637
|
return { usedDirectionSpace: e, remainingSpace: i._bounds._innerHeight - e };
|
|
4646
4638
|
}
|
|
4647
|
-
function
|
|
4639
|
+
function D(i) {
|
|
4648
4640
|
return 0;
|
|
4649
4641
|
}
|
|
4650
|
-
function
|
|
4642
|
+
function nr(i) {
|
|
4651
4643
|
return i;
|
|
4652
4644
|
}
|
|
4653
|
-
function
|
|
4645
|
+
function or(i) {
|
|
4654
4646
|
return i / 2;
|
|
4655
4647
|
}
|
|
4656
|
-
function
|
|
4648
|
+
function te(i, e = 0, t = 1) {
|
|
4657
4649
|
return Array(i._children._boxes.length).fill(0);
|
|
4658
4650
|
}
|
|
4659
|
-
function
|
|
4651
|
+
function ar(i, e = 0, t = 1) {
|
|
4660
4652
|
const r = i._children._boxes.length, n = Array(r).fill(0);
|
|
4661
4653
|
if (e > 0 && r > 1) {
|
|
4662
4654
|
const o = e / (r - 1) * t;
|
|
@@ -4666,7 +4658,7 @@ function lr(i, e = 0, t = 1) {
|
|
|
4666
4658
|
}
|
|
4667
4659
|
return n;
|
|
4668
4660
|
}
|
|
4669
|
-
function
|
|
4661
|
+
function ur(i, e = 0, t = 1) {
|
|
4670
4662
|
const r = i._children._boxes.length, n = Array(r).fill(0);
|
|
4671
4663
|
if (e > 0) {
|
|
4672
4664
|
const o = e / (r + 1) * t;
|
|
@@ -4675,7 +4667,7 @@ function cr(i, e = 0, t = 1) {
|
|
|
4675
4667
|
}
|
|
4676
4668
|
return n;
|
|
4677
4669
|
}
|
|
4678
|
-
function
|
|
4670
|
+
function hr(i, e = 0, t = 1) {
|
|
4679
4671
|
const r = i._children._boxes.length, n = Array(r).fill(0);
|
|
4680
4672
|
if (e > 0) {
|
|
4681
4673
|
const o = e / r * t, a = o / 2;
|
|
@@ -4685,8 +4677,8 @@ function dr(i, e = 0, t = 1) {
|
|
|
4685
4677
|
}
|
|
4686
4678
|
return n;
|
|
4687
4679
|
}
|
|
4688
|
-
let
|
|
4689
|
-
class
|
|
4680
|
+
let ie;
|
|
4681
|
+
class rt extends u.Mesh {
|
|
4690
4682
|
/**
|
|
4691
4683
|
*
|
|
4692
4684
|
* @param {MeshUIBaseElement} element
|
|
@@ -4728,7 +4720,7 @@ class nt extends u.Mesh {
|
|
|
4728
4720
|
}
|
|
4729
4721
|
}
|
|
4730
4722
|
let o = e.backgroundMaterial;
|
|
4731
|
-
t && (
|
|
4723
|
+
t && (ie || (ie = new u.MeshBasicMaterial({ alphaTest: 1.1 })), o = ie);
|
|
4732
4724
|
const a = new u.PlaneGeometry(1, 1, e._segments.value, e._segments.value), l = new u.BufferAttribute(new Float32Array(a.getAttribute("uv").array), 2);
|
|
4733
4725
|
if (a.setAttribute("uvB", l).name = "uvB", super(a, o), this.name = "UIBackgroundBox", t) {
|
|
4734
4726
|
this.slice = t, this.sliceSize = new u.Vector3(1 - (t.left + t.right), 1 - (t.bottom + t.top), 1), this.sliceScale = new u.Vector3(r, n, 1);
|
|
@@ -4747,10 +4739,10 @@ class nt extends u.Mesh {
|
|
|
4747
4739
|
for (const t in this.slices) {
|
|
4748
4740
|
const s = this.slices[t];
|
|
4749
4741
|
s.scale.set(1 / this.scale.x, 1 / this.scale.y, this.scale.y);
|
|
4750
|
-
const r =
|
|
4742
|
+
const r = lr[t];
|
|
4751
4743
|
for (const o in r)
|
|
4752
4744
|
s.position[o] = this.scale[o] * r[o] * s.scale[o];
|
|
4753
|
-
const n =
|
|
4745
|
+
const n = cr[t];
|
|
4754
4746
|
if (n) {
|
|
4755
4747
|
n.x && (s.position.x = this.sliceScale.x * 0.5 * (this.slice.left - this.slice.right) * (1 / this.scale.x)), n.y && (s.position.y = this.sliceScale.y * 0.5 * (this.slice.bottom - this.slice.top) * (1 / this.scale.y));
|
|
4756
4748
|
for (const o in n) {
|
|
@@ -4762,7 +4754,7 @@ class nt extends u.Mesh {
|
|
|
4762
4754
|
e.x !== 1 && (this.slices.left.scale.x *= e.x, this.slices.topLeft.scale.x *= e.x, this.slices.bottomLeft.scale.x *= e.x, this.slices.right.scale.x *= e.x, this.slices.topRight.scale.x *= e.x, this.slices.bottomRight.scale.x *= e.x), e.y !== 1 && (this.slices.top.scale.y *= e.y, this.slices.topLeft.scale.y *= e.y, this.slices.topRight.scale.y *= e.y, this.slices.bottom.scale.y *= e.y, this.slices.bottomLeft.scale.y *= e.y, this.slices.bottomRight.scale.y *= e.y);
|
|
4763
4755
|
}
|
|
4764
4756
|
}
|
|
4765
|
-
const
|
|
4757
|
+
const lr = {
|
|
4766
4758
|
topLeft: { x: -0.5, y: 0.5 },
|
|
4767
4759
|
top: { y: 0.5 },
|
|
4768
4760
|
topRight: { x: 0.5, y: 0.5 },
|
|
@@ -4771,7 +4763,7 @@ const _r = {
|
|
|
4771
4763
|
bottomLeft: { x: -0.5, y: -0.5 },
|
|
4772
4764
|
bottom: { y: -0.5 },
|
|
4773
4765
|
bottomRight: { x: 0.5, y: -0.5 }
|
|
4774
|
-
},
|
|
4766
|
+
}, cr = {
|
|
4775
4767
|
top: { x: 1 },
|
|
4776
4768
|
left: { y: 1 },
|
|
4777
4769
|
right: { y: 1 },
|
|
@@ -4787,15 +4779,15 @@ function k(i, e, t, s, r) {
|
|
|
4787
4779
|
const l = new u.BufferAttribute(new Float32Array(i.getAttribute("uv").array), 2);
|
|
4788
4780
|
i.setAttribute("uvB", l).name = "uvB";
|
|
4789
4781
|
}
|
|
4790
|
-
class
|
|
4782
|
+
class nt extends p {
|
|
4791
4783
|
constructor() {
|
|
4792
4784
|
super("renderer");
|
|
4793
4785
|
}
|
|
4794
4786
|
render(e) {
|
|
4795
|
-
e._backgroundMesh || e.setBackgroundMesh(new
|
|
4787
|
+
e._backgroundMesh || e.setBackgroundMesh(new rt(e)), e.performAfterUpdate();
|
|
4796
4788
|
}
|
|
4797
4789
|
}
|
|
4798
|
-
class
|
|
4790
|
+
class dr extends He {
|
|
4799
4791
|
constructor() {
|
|
4800
4792
|
super("position");
|
|
4801
4793
|
}
|
|
@@ -4803,44 +4795,44 @@ class pr extends Ge {
|
|
|
4803
4795
|
super.update(e, t), this._needsProcess = !0;
|
|
4804
4796
|
}
|
|
4805
4797
|
}
|
|
4806
|
-
class
|
|
4798
|
+
class _r extends p {
|
|
4807
4799
|
constructor() {
|
|
4808
4800
|
super("autosize"), this._needsProcess = !0;
|
|
4809
4801
|
}
|
|
4810
4802
|
process(e) {
|
|
4811
|
-
e._width._auto &&
|
|
4803
|
+
e._width._auto && fr(e), e._height._auto && pr(e);
|
|
4812
4804
|
const t = e._alignItems._value === "stretch", s = t && e._flexDirection._value.indexOf("column") !== -1, r = t && !s;
|
|
4813
4805
|
for (const n of e._children._boxes)
|
|
4814
4806
|
(n._width._auto && s || n._width._relative) && n._bounds.setReferenceWidth(n, e._bounds._innerWidth), (n._height._auto && r || n._height._relative) && n._bounds.setReferenceHeight(n, e._bounds._innerHeight);
|
|
4815
4807
|
}
|
|
4816
4808
|
}
|
|
4817
|
-
function
|
|
4818
|
-
i._bounds.setChildrenWidth(i,
|
|
4809
|
+
function fr(i) {
|
|
4810
|
+
i._bounds.setChildrenWidth(i, mr(i));
|
|
4819
4811
|
}
|
|
4820
|
-
function
|
|
4821
|
-
i._bounds.setChildrenHeight(i,
|
|
4812
|
+
function pr(i) {
|
|
4813
|
+
i._bounds.setChildrenHeight(i, gr(i));
|
|
4822
4814
|
}
|
|
4823
|
-
function
|
|
4815
|
+
function gr(i) {
|
|
4824
4816
|
switch (i._flexDirection._value) {
|
|
4825
4817
|
case "row":
|
|
4826
4818
|
case "row-reverse":
|
|
4827
|
-
return
|
|
4819
|
+
return xr(i);
|
|
4828
4820
|
case "column":
|
|
4829
4821
|
case "column-reverse":
|
|
4830
|
-
return
|
|
4822
|
+
return yr(i);
|
|
4831
4823
|
}
|
|
4832
4824
|
}
|
|
4833
|
-
function
|
|
4825
|
+
function mr(i) {
|
|
4834
4826
|
switch (i._flexDirection._value) {
|
|
4835
4827
|
case "row":
|
|
4836
4828
|
case "row-reverse":
|
|
4837
|
-
return
|
|
4829
|
+
return vr(i);
|
|
4838
4830
|
case "column":
|
|
4839
4831
|
case "column-reverse":
|
|
4840
|
-
return
|
|
4832
|
+
return br(i);
|
|
4841
4833
|
}
|
|
4842
4834
|
}
|
|
4843
|
-
function
|
|
4835
|
+
function vr(i) {
|
|
4844
4836
|
let e = 0;
|
|
4845
4837
|
for (const t of i._children._boxes) {
|
|
4846
4838
|
if (t._position._value !== "static") continue;
|
|
@@ -4849,7 +4841,7 @@ function xr(i) {
|
|
|
4849
4841
|
}
|
|
4850
4842
|
return e;
|
|
4851
4843
|
}
|
|
4852
|
-
function
|
|
4844
|
+
function yr(i) {
|
|
4853
4845
|
let e = 0;
|
|
4854
4846
|
for (const t of i._children._boxes) {
|
|
4855
4847
|
if (t._position._value !== "static") continue;
|
|
@@ -4858,7 +4850,7 @@ function wr(i) {
|
|
|
4858
4850
|
}
|
|
4859
4851
|
return e;
|
|
4860
4852
|
}
|
|
4861
|
-
function
|
|
4853
|
+
function br(i) {
|
|
4862
4854
|
let e = 0;
|
|
4863
4855
|
for (const t of i._children._boxes) {
|
|
4864
4856
|
if (t._position._value !== "static") continue;
|
|
@@ -4867,7 +4859,7 @@ function Sr(i) {
|
|
|
4867
4859
|
}
|
|
4868
4860
|
return e;
|
|
4869
4861
|
}
|
|
4870
|
-
function
|
|
4862
|
+
function xr(i) {
|
|
4871
4863
|
let e = 0;
|
|
4872
4864
|
for (const t of i._children._boxes) {
|
|
4873
4865
|
if (t._position._value !== "static") continue;
|
|
@@ -4876,14 +4868,14 @@ function Vr(i) {
|
|
|
4876
4868
|
}
|
|
4877
4869
|
return e;
|
|
4878
4870
|
}
|
|
4879
|
-
class
|
|
4871
|
+
class A extends L {
|
|
4880
4872
|
/**
|
|
4881
4873
|
*
|
|
4882
4874
|
* @param {import('./../../core/elements/MeshUIBaseElement').Properties} properties
|
|
4883
4875
|
* @param {import('./../../core/elements/MeshUIBaseElement').Options} values
|
|
4884
4876
|
*/
|
|
4885
4877
|
constructor(e, t) {
|
|
4886
|
-
|
|
4878
|
+
A.definePropertiesValues(e, t), super(e, t), A.init(this);
|
|
4887
4879
|
}
|
|
4888
4880
|
/**
|
|
4889
4881
|
* When the backgroundMesh has been set, bind properties
|
|
@@ -4905,7 +4897,7 @@ class T extends z {
|
|
|
4905
4897
|
* @param {import('./../../core/elements/MeshUIBaseElement').Options} values
|
|
4906
4898
|
*/
|
|
4907
4899
|
static definePropertiesValues(e, t) {
|
|
4908
|
-
e.children || (e.children =
|
|
4900
|
+
e.children || (e.children = Ws), e.bounds || (e.bounds = st), e.flexDirection || (e.flexDirection = Ks), e.justifyContent || (e.justifyContent = er), e.alignItems || (e.alignItems = Hs), e.position || (e.position = dr), e.autoSize || (e.autoSize = _r), e.renderer || (e.renderer = nt), t.fontSide || (t.fontSide = 0), t.invertAlpha || (t.invertAlpha = !1), t.fontCastShadow || (t.fontCastShadow = !1), t.fontReceiveShadow || (t.fontReceiveShadow = !1), t.backgroundCastShadow || (t.backgroundCastShadow = !1), t.backgroundReceiveShadow || (t.backgroundReceiveShadow = !1);
|
|
4909
4901
|
}
|
|
4910
4902
|
/**
|
|
4911
4903
|
*
|
|
@@ -4921,10 +4913,10 @@ class T extends z {
|
|
|
4921
4913
|
value: !0
|
|
4922
4914
|
}
|
|
4923
4915
|
}
|
|
4924
|
-
), e.backgroundMaterial = new
|
|
4916
|
+
), e.backgroundMaterial = new it(), e._renderer.render(e), e._backgroundMesh.visible = !1;
|
|
4925
4917
|
}
|
|
4926
4918
|
}
|
|
4927
|
-
class
|
|
4919
|
+
class Ae extends Array {
|
|
4928
4920
|
/**
|
|
4929
4921
|
*
|
|
4930
4922
|
* @param {Inline[]} items
|
|
@@ -4933,7 +4925,7 @@ class Te extends Array {
|
|
|
4933
4925
|
super(...e), this.width = 0, this.lineBase = 0, this.lineHeight = 0, this.y = 0;
|
|
4934
4926
|
}
|
|
4935
4927
|
}
|
|
4936
|
-
class
|
|
4928
|
+
class wr extends p {
|
|
4937
4929
|
constructor() {
|
|
4938
4930
|
super("layouter", null, !1), this._needsUpdate = !0, this._childrenPos = {};
|
|
4939
4931
|
}
|
|
@@ -4960,14 +4952,14 @@ class kr extends p {
|
|
|
4960
4952
|
process(e) {
|
|
4961
4953
|
}
|
|
4962
4954
|
}
|
|
4963
|
-
class
|
|
4955
|
+
class T extends A {
|
|
4964
4956
|
/**
|
|
4965
4957
|
*
|
|
4966
4958
|
* @param {import('./../../core/elements/MeshUIBaseElement').Options} [values={}]
|
|
4967
4959
|
*/
|
|
4968
4960
|
constructor(e = {}) {
|
|
4969
4961
|
const t = {};
|
|
4970
|
-
|
|
4962
|
+
T.definePropertiesValues(t, e), super(t, e), T.init(this);
|
|
4971
4963
|
}
|
|
4972
4964
|
/* eslint-disable no-unused-vars */
|
|
4973
4965
|
/**
|
|
@@ -4991,7 +4983,7 @@ class M extends T {
|
|
|
4991
4983
|
* @param {import('./../../core/elements/MeshUIBaseElement').Options} values
|
|
4992
4984
|
*/
|
|
4993
4985
|
static definePropertiesValues(e, t) {
|
|
4994
|
-
e.layouter =
|
|
4986
|
+
e.layouter = wr;
|
|
4995
4987
|
}
|
|
4996
4988
|
/**
|
|
4997
4989
|
*
|
|
@@ -5010,7 +5002,7 @@ class M extends T {
|
|
|
5010
5002
|
);
|
|
5011
5003
|
}
|
|
5012
5004
|
}
|
|
5013
|
-
class
|
|
5005
|
+
class Sr extends p {
|
|
5014
5006
|
constructor() {
|
|
5015
5007
|
super("textContent", null, !1);
|
|
5016
5008
|
}
|
|
@@ -5019,7 +5011,7 @@ class Pr extends p {
|
|
|
5019
5011
|
e._glyphs._needsUpdate = !0, e._whiteSpace._needsProcess = !0;
|
|
5020
5012
|
}
|
|
5021
5013
|
}
|
|
5022
|
-
class
|
|
5014
|
+
class Vr extends p {
|
|
5023
5015
|
constructor() {
|
|
5024
5016
|
super("inlines", null, !1), this._value = null;
|
|
5025
5017
|
}
|
|
@@ -5039,7 +5031,7 @@ class Ir extends p {
|
|
|
5039
5031
|
return this._value;
|
|
5040
5032
|
}
|
|
5041
5033
|
}
|
|
5042
|
-
class
|
|
5034
|
+
class kr extends p {
|
|
5043
5035
|
constructor() {
|
|
5044
5036
|
super("glyphs", null, !1), this._needsUpdate = !1, this._value = null;
|
|
5045
5037
|
}
|
|
@@ -5054,7 +5046,7 @@ class Cr extends p {
|
|
|
5054
5046
|
return this._value;
|
|
5055
5047
|
}
|
|
5056
5048
|
}
|
|
5057
|
-
class
|
|
5049
|
+
class Pr extends U {
|
|
5058
5050
|
constructor() {
|
|
5059
5051
|
super("color", "inherit", !1), this.output = this._outputValue;
|
|
5060
5052
|
}
|
|
@@ -5067,7 +5059,7 @@ class Rr extends A {
|
|
|
5067
5059
|
this._input === "inherit" ? this._value.set(this.getInheritedInput(e)) : this._value.set(this._input);
|
|
5068
5060
|
}
|
|
5069
5061
|
}
|
|
5070
|
-
class
|
|
5062
|
+
class ot extends p {
|
|
5071
5063
|
constructor(e = `- ,.:?!
|
|
5072
5064
|
`) {
|
|
5073
5065
|
super("lineBreak", e, !0), this._newLineBreakability = null;
|
|
@@ -5093,7 +5085,7 @@ class at extends p {
|
|
|
5093
5085
|
return this._value;
|
|
5094
5086
|
}
|
|
5095
5087
|
}
|
|
5096
|
-
class
|
|
5088
|
+
class at extends p {
|
|
5097
5089
|
constructor() {
|
|
5098
5090
|
super("layouter", null, !1), this._value = null;
|
|
5099
5091
|
}
|
|
@@ -5110,7 +5102,7 @@ class ut extends p {
|
|
|
5110
5102
|
this._value && (this._value._layouter._needsProcess = !0);
|
|
5111
5103
|
}
|
|
5112
5104
|
}
|
|
5113
|
-
class
|
|
5105
|
+
class Ir extends U {
|
|
5114
5106
|
constructor(e) {
|
|
5115
5107
|
super("backgroundColor", e, !1), this._allowsInherit = !1, this._input = 0;
|
|
5116
5108
|
}
|
|
@@ -5123,20 +5115,20 @@ class Br extends A {
|
|
|
5123
5115
|
this._input === "inherit" ? this._value.set(this.getInheritedInput(e)) : this._value.set(this._input);
|
|
5124
5116
|
}
|
|
5125
5117
|
}
|
|
5126
|
-
class
|
|
5118
|
+
class ut extends Ne {
|
|
5127
5119
|
constructor() {
|
|
5128
5120
|
super(), this._allowsInherit = !1, this.computeOutputValue = this._computeFromInherited;
|
|
5129
5121
|
}
|
|
5130
5122
|
}
|
|
5131
|
-
class
|
|
5123
|
+
class ht extends Xe {
|
|
5132
5124
|
constructor() {
|
|
5133
5125
|
super();
|
|
5134
5126
|
}
|
|
5135
5127
|
computeOutputValue(e) {
|
|
5136
|
-
this._value =
|
|
5128
|
+
this._value = ae(this.getInheritedInput(e));
|
|
5137
5129
|
}
|
|
5138
5130
|
}
|
|
5139
|
-
class
|
|
5131
|
+
class lt extends qe {
|
|
5140
5132
|
constructor() {
|
|
5141
5133
|
super("fontFamily", "inherit", !0), this._input = "inherit", this._needsUpdate = !0, this._allowsInherit = !1;
|
|
5142
5134
|
}
|
|
@@ -5147,10 +5139,10 @@ class ct extends Je {
|
|
|
5147
5139
|
*/
|
|
5148
5140
|
computeOutputValue(e) {
|
|
5149
5141
|
let t = this._inheritedInput;
|
|
5150
|
-
if (t === "inherit" && (t = this.getInheritedInput(e)), t instanceof
|
|
5142
|
+
if (t === "inherit" && (t = this.getInheritedInput(e)), t instanceof K)
|
|
5151
5143
|
this._value = t, e._font._needsUpdate = !0;
|
|
5152
5144
|
else if (typeof t == "string") {
|
|
5153
|
-
const s =
|
|
5145
|
+
const s = I.getFontFamily(t);
|
|
5154
5146
|
s ? (this._value = s, e._font._needsUpdate = !0) : console.warn(`(.style) fontFamily, the font '${t}' is not registered. Aborted.`);
|
|
5155
5147
|
} else
|
|
5156
5148
|
console.warn("(.style) fontFamily requires a registered fontFamily instance, or the id of a registered fontFamily."), console.warn("If you want to set a specific font, please use .font property instead.");
|
|
@@ -5163,7 +5155,7 @@ class ct extends Je {
|
|
|
5163
5155
|
return this._value;
|
|
5164
5156
|
}
|
|
5165
5157
|
}
|
|
5166
|
-
class
|
|
5158
|
+
class Pe extends Ze {
|
|
5167
5159
|
constructor() {
|
|
5168
5160
|
super(), this._allowsInherit = !1, this.computeOutputValue = this._computeFromInherited, this._whiteSpacedContent = "", this._stringCollapser = this.emptyStrategyLogic, this._inlineCollapser = this.emptyStrategyLogic, this._inlineWrapper = this.emptyStrategyLogic;
|
|
5169
5161
|
}
|
|
@@ -5174,40 +5166,40 @@ class Ie extends Qe {
|
|
|
5174
5166
|
* @private
|
|
5175
5167
|
*/
|
|
5176
5168
|
_computeFromInherited(e) {
|
|
5177
|
-
switch (super._computeFromInherited(e), this._newLineBreakability =
|
|
5169
|
+
switch (super._computeFromInherited(e), this._newLineBreakability = Cr(this._value), this._value) {
|
|
5178
5170
|
case "nowrap":
|
|
5179
5171
|
case "normal":
|
|
5180
|
-
this._stringCollapser =
|
|
5172
|
+
this._stringCollapser = Rr;
|
|
5181
5173
|
break;
|
|
5182
5174
|
case "pre-line":
|
|
5183
|
-
this._stringCollapser =
|
|
5175
|
+
this._stringCollapser = ct;
|
|
5184
5176
|
break;
|
|
5185
5177
|
default:
|
|
5186
|
-
this._stringCollapser =
|
|
5178
|
+
this._stringCollapser = Br;
|
|
5187
5179
|
}
|
|
5188
5180
|
switch (this._value) {
|
|
5189
5181
|
case "pre-line":
|
|
5190
5182
|
case "nowrap":
|
|
5191
5183
|
case "normal":
|
|
5192
|
-
this._inlineCollapser =
|
|
5184
|
+
this._inlineCollapser = Fr;
|
|
5193
5185
|
break;
|
|
5194
5186
|
case "pre-wrap":
|
|
5195
|
-
this._inlineCollapser =
|
|
5187
|
+
this._inlineCollapser = Mr;
|
|
5196
5188
|
break;
|
|
5197
5189
|
default:
|
|
5198
|
-
this._inlineCollapser =
|
|
5190
|
+
this._inlineCollapser = Or;
|
|
5199
5191
|
}
|
|
5200
5192
|
switch (this._value) {
|
|
5201
5193
|
case "pre-line":
|
|
5202
5194
|
case "pre-wrap":
|
|
5203
5195
|
case "normal":
|
|
5204
|
-
this._inlineWrapper =
|
|
5196
|
+
this._inlineWrapper = Ur;
|
|
5205
5197
|
break;
|
|
5206
5198
|
case "pre":
|
|
5207
|
-
this._inlineWrapper =
|
|
5199
|
+
this._inlineWrapper = Ar;
|
|
5208
5200
|
break;
|
|
5209
5201
|
default:
|
|
5210
|
-
this._inlineWrapper =
|
|
5202
|
+
this._inlineWrapper = Tr;
|
|
5211
5203
|
}
|
|
5212
5204
|
this._needsProcess = !0;
|
|
5213
5205
|
}
|
|
@@ -5215,8 +5207,8 @@ class Ie extends Qe {
|
|
|
5215
5207
|
e.isInline && !e.isInlineBlock && (this._whiteSpacedContent = this._stringCollapser(e._textContent._value), e._glyphs._needsProcess = !0);
|
|
5216
5208
|
}
|
|
5217
5209
|
}
|
|
5218
|
-
const
|
|
5219
|
-
`, "\r": "\r", " ": " " },
|
|
5210
|
+
const Te = { " ": " ", "\n": `
|
|
5211
|
+
`, "\r": "\r", " ": " " }, Cr = function(i) {
|
|
5220
5212
|
switch (i) {
|
|
5221
5213
|
case "pre":
|
|
5222
5214
|
case "pre-wrap":
|
|
@@ -5225,87 +5217,87 @@ const Me = { " ": " ", "\n": `
|
|
|
5225
5217
|
}
|
|
5226
5218
|
return null;
|
|
5227
5219
|
};
|
|
5228
|
-
function
|
|
5229
|
-
return
|
|
5220
|
+
function Rr(i) {
|
|
5221
|
+
return ct(i.replace(/\n/g, " "));
|
|
5230
5222
|
}
|
|
5231
|
-
function
|
|
5223
|
+
function ct(i) {
|
|
5232
5224
|
return i.replace(/[ ]{2,}/g, " ");
|
|
5233
5225
|
}
|
|
5234
|
-
function
|
|
5226
|
+
function Br(i) {
|
|
5235
5227
|
return i;
|
|
5236
5228
|
}
|
|
5237
|
-
function
|
|
5229
|
+
function Ur(i, e, t, s) {
|
|
5238
5230
|
const r = i[e];
|
|
5239
5231
|
if (r.lineBreak === "mandatory" || t + r.xadvance + r.xoffset + r.kerning > s.INNER_WIDTH) return !0;
|
|
5240
|
-
const n =
|
|
5241
|
-
return
|
|
5232
|
+
const n = ft(i, e, s);
|
|
5233
|
+
return Lr(i[e - 1], t, n, s);
|
|
5242
5234
|
}
|
|
5243
|
-
function
|
|
5235
|
+
function Ar(i, e, t, s) {
|
|
5244
5236
|
return i[e].lineBreak === "mandatory";
|
|
5245
5237
|
}
|
|
5246
|
-
function
|
|
5238
|
+
function Tr() {
|
|
5247
5239
|
return !1;
|
|
5248
5240
|
}
|
|
5249
|
-
function
|
|
5241
|
+
function Mr(i) {
|
|
5250
5242
|
if (!i[0]) return 0;
|
|
5251
5243
|
const e = i[0], t = i[i.length - 1];
|
|
5252
5244
|
return e.char && e.char === `
|
|
5253
|
-
` && i.length > 1 &&
|
|
5254
|
-
` && i.length > 1 &&
|
|
5245
|
+
` && i.length > 1 && _t([e], i[1]), t.char && t.char === `
|
|
5246
|
+
` && i.length > 1 && dt([t], i[i.length - 2]), e.offsetX;
|
|
5255
5247
|
}
|
|
5256
|
-
function
|
|
5248
|
+
function Fr(i) {
|
|
5257
5249
|
if (!i[0]) return 0;
|
|
5258
5250
|
let e = [], t;
|
|
5259
5251
|
for (let s = 0; s < i.length; s++) {
|
|
5260
5252
|
const r = i[s];
|
|
5261
|
-
if (r.char &&
|
|
5253
|
+
if (r.char && Te[r.char] && i.length > s) {
|
|
5262
5254
|
e.push(r), t = i[s + 1];
|
|
5263
5255
|
continue;
|
|
5264
5256
|
}
|
|
5265
5257
|
break;
|
|
5266
5258
|
}
|
|
5267
|
-
|
|
5259
|
+
_t(e, t), e = [], t = null;
|
|
5268
5260
|
for (let s = i.length - 1; s > 0; s--) {
|
|
5269
5261
|
const r = i[s];
|
|
5270
|
-
if (r.char &&
|
|
5262
|
+
if (r.char && Te[r.char] && s > 0) {
|
|
5271
5263
|
e.push(r), t = i[s - 1];
|
|
5272
5264
|
continue;
|
|
5273
5265
|
}
|
|
5274
5266
|
break;
|
|
5275
5267
|
}
|
|
5276
|
-
return
|
|
5268
|
+
return dt(e, t), i[0].offsetX;
|
|
5277
5269
|
}
|
|
5278
|
-
function
|
|
5270
|
+
function Or(i) {
|
|
5279
5271
|
return i[0] ? i[0].offsetX : 0;
|
|
5280
5272
|
}
|
|
5281
|
-
function
|
|
5273
|
+
function dt(i, e) {
|
|
5282
5274
|
if (e)
|
|
5283
5275
|
for (let t = 0; t < i.length; t++) {
|
|
5284
5276
|
const s = i[t];
|
|
5285
5277
|
s.fontFactor = 0, s.offsetX = e.offsetX + e.cumulativeWidth, s.cumulativeWidth = 0;
|
|
5286
5278
|
}
|
|
5287
5279
|
}
|
|
5288
|
-
function
|
|
5280
|
+
function _t(i, e) {
|
|
5289
5281
|
if (e)
|
|
5290
5282
|
for (let t = 0; t < i.length; t++) {
|
|
5291
5283
|
const s = i[t];
|
|
5292
5284
|
s.fontFactor = 0, s.offsetX = e.offsetX, s.cumulativeWidth = 0;
|
|
5293
5285
|
}
|
|
5294
5286
|
}
|
|
5295
|
-
function
|
|
5287
|
+
function ft(i, e, t, s) {
|
|
5296
5288
|
if (s = s || 0, !i[e]) return s;
|
|
5297
5289
|
const r = i[e];
|
|
5298
|
-
return r.lineBreak ? s + r.xadvance :
|
|
5290
|
+
return r.lineBreak ? s + r.xadvance : ft(
|
|
5299
5291
|
i,
|
|
5300
5292
|
e + 1,
|
|
5301
5293
|
t,
|
|
5302
5294
|
s + r.xadvance + r.xoffset + r.kerning + t.LETTERSPACING
|
|
5303
5295
|
);
|
|
5304
5296
|
}
|
|
5305
|
-
function
|
|
5297
|
+
function Lr(i, e, t, s) {
|
|
5306
5298
|
return !i || !i.char || e + t < s.INNER_WIDTH ? !1 : s.BREAKON.indexOf(i.char) > -1;
|
|
5307
5299
|
}
|
|
5308
|
-
class
|
|
5300
|
+
class pt extends Qe {
|
|
5309
5301
|
constructor() {
|
|
5310
5302
|
super(), this._input = "inherit", this._allowsInherit = !1, this.computeOutputValue = this._computeFromInherited;
|
|
5311
5303
|
}
|
|
@@ -5313,7 +5305,7 @@ class gt extends et {
|
|
|
5313
5305
|
super._computeFromInherited(e), e._fontSize._needsProcess = !0, e._layouter._needsProcess = !0;
|
|
5314
5306
|
}
|
|
5315
5307
|
}
|
|
5316
|
-
class
|
|
5308
|
+
class gt extends g {
|
|
5317
5309
|
constructor() {
|
|
5318
5310
|
super("fontSize", "inherit", !0), this._allowsInherit = !1;
|
|
5319
5311
|
}
|
|
@@ -5336,7 +5328,7 @@ class mt extends g {
|
|
|
5336
5328
|
return this._value;
|
|
5337
5329
|
}
|
|
5338
5330
|
}
|
|
5339
|
-
class
|
|
5331
|
+
class mt extends et {
|
|
5340
5332
|
constructor() {
|
|
5341
5333
|
super("segments", 1, !1), this._notInheritedValue = void 0;
|
|
5342
5334
|
}
|
|
@@ -5360,12 +5352,12 @@ class vt extends tt {
|
|
|
5360
5352
|
return this._value === "inherit" ? this._notInheritedValue : this._value;
|
|
5361
5353
|
}
|
|
5362
5354
|
}
|
|
5363
|
-
class
|
|
5355
|
+
class zr extends mt {
|
|
5364
5356
|
constructor() {
|
|
5365
5357
|
super(), this._value = "inherit";
|
|
5366
5358
|
}
|
|
5367
5359
|
}
|
|
5368
|
-
class
|
|
5360
|
+
class Wr extends q {
|
|
5369
5361
|
constructor() {
|
|
5370
5362
|
super(), this._allowsInherit = !1, this.computeOutputValue = this._computeFromInherited;
|
|
5371
5363
|
}
|
|
@@ -5382,7 +5374,7 @@ class Hr extends J {
|
|
|
5382
5374
|
}
|
|
5383
5375
|
}
|
|
5384
5376
|
}
|
|
5385
|
-
class
|
|
5377
|
+
class vt extends p {
|
|
5386
5378
|
constructor() {
|
|
5387
5379
|
super("children", null, !1), this._uis = [];
|
|
5388
5380
|
}
|
|
@@ -5415,7 +5407,7 @@ class yt extends p {
|
|
|
5415
5407
|
dispose() {
|
|
5416
5408
|
}
|
|
5417
5409
|
}
|
|
5418
|
-
function
|
|
5410
|
+
function Er(i, e = !1) {
|
|
5419
5411
|
const t = i[0].index !== null, s = new Set(Object.keys(i[0].attributes)), r = new Set(Object.keys(i[0].morphAttributes)), n = {}, o = {}, a = i[0].morphTargetsRelative, l = new u.BufferGeometry();
|
|
5420
5412
|
let d = 0;
|
|
5421
5413
|
for (let c = 0; c < i.length; ++c) {
|
|
@@ -5460,7 +5452,7 @@ function Gr(i, e = !1) {
|
|
|
5460
5452
|
l.setIndex(h);
|
|
5461
5453
|
}
|
|
5462
5454
|
for (const c in n) {
|
|
5463
|
-
const h =
|
|
5455
|
+
const h = Me(n[c]);
|
|
5464
5456
|
if (!h)
|
|
5465
5457
|
return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the " + c + " attribute."), null;
|
|
5466
5458
|
l.setAttribute(c, h);
|
|
@@ -5473,7 +5465,7 @@ function Gr(i, e = !1) {
|
|
|
5473
5465
|
const f = [];
|
|
5474
5466
|
for (let S = 0; S < o[c].length; ++S)
|
|
5475
5467
|
f.push(o[c][S][_]);
|
|
5476
|
-
const v =
|
|
5468
|
+
const v = Me(f);
|
|
5477
5469
|
if (!v)
|
|
5478
5470
|
return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the " + c + " morphAttribute."), null;
|
|
5479
5471
|
l.morphAttributes[c].push(v);
|
|
@@ -5481,7 +5473,7 @@ function Gr(i, e = !1) {
|
|
|
5481
5473
|
}
|
|
5482
5474
|
return l;
|
|
5483
5475
|
}
|
|
5484
|
-
function
|
|
5476
|
+
function Me(i) {
|
|
5485
5477
|
let e, t, s, r = -1, n = 0;
|
|
5486
5478
|
for (let d = 0; d < i.length; ++d) {
|
|
5487
5479
|
const c = i[d];
|
|
@@ -5512,7 +5504,7 @@ function Fe(i) {
|
|
|
5512
5504
|
}
|
|
5513
5505
|
return r !== void 0 && (a.gpuType = r), a;
|
|
5514
5506
|
}
|
|
5515
|
-
class
|
|
5507
|
+
class Dr extends p {
|
|
5516
5508
|
constructor() {
|
|
5517
5509
|
super("renderer");
|
|
5518
5510
|
}
|
|
@@ -5520,11 +5512,11 @@ class $r extends p {
|
|
|
5520
5512
|
if (!e._inlines._value || !e._inlines._value.length) return;
|
|
5521
5513
|
const t = e._inlines._value.map(
|
|
5522
5514
|
(r) => e._font._fontVariant.getGeometricGlyph(r, e).translate(r.offsetX, r.offsetY, 0)
|
|
5523
|
-
), s =
|
|
5515
|
+
), s = Er(t);
|
|
5524
5516
|
e.setFontMesh(new u.Mesh(s, e.fontMaterial)), e._fontMesh.renderOrder = 1 / 0;
|
|
5525
5517
|
}
|
|
5526
5518
|
}
|
|
5527
|
-
class
|
|
5519
|
+
class Hr extends he {
|
|
5528
5520
|
constructor() {
|
|
5529
5521
|
super(), this._allowsInherit = !1, this._needsUpdate = !1;
|
|
5530
5522
|
}
|
|
@@ -5533,19 +5525,14 @@ class Nr extends le {
|
|
|
5533
5525
|
this._value = this._inheritedInput, e._layouter._needsProcess = !0;
|
|
5534
5526
|
}
|
|
5535
5527
|
}
|
|
5536
|
-
class
|
|
5528
|
+
class B extends L {
|
|
5537
5529
|
/**
|
|
5538
5530
|
*
|
|
5539
5531
|
* @param {import('./../../core/elements/MeshUIBaseElement').Options} [values={}]
|
|
5540
5532
|
*/
|
|
5541
|
-
constructor(
|
|
5542
|
-
const
|
|
5543
|
-
|
|
5544
|
-
super(s, t);
|
|
5545
|
-
I(this, "_rebuildParentUI", () => {
|
|
5546
|
-
super._rebuildParentUI(), this._layouter._needsUpdate = !0;
|
|
5547
|
-
});
|
|
5548
|
-
U.init(this);
|
|
5533
|
+
constructor(e = {}) {
|
|
5534
|
+
const t = {};
|
|
5535
|
+
B.definePropertiesValues(t, e), super(t, e), B.init(this);
|
|
5549
5536
|
}
|
|
5550
5537
|
/* eslint-disable no-unused-vars */
|
|
5551
5538
|
/**
|
|
@@ -5554,22 +5541,25 @@ class U extends z {
|
|
|
5554
5541
|
* @param {...Object3D} object
|
|
5555
5542
|
* @return {this}
|
|
5556
5543
|
*/
|
|
5557
|
-
add(
|
|
5558
|
-
const
|
|
5559
|
-
for (let
|
|
5560
|
-
const
|
|
5561
|
-
!
|
|
5544
|
+
add(e) {
|
|
5545
|
+
const t = [];
|
|
5546
|
+
for (let s = 0; s < arguments.length; s++) {
|
|
5547
|
+
const r = arguments[s];
|
|
5548
|
+
!r.isUI || r.isInline ? (t.push(r), r.position.z = 5e-3) : console.warn("Block element can only contain Box elements.", r);
|
|
5562
5549
|
}
|
|
5563
|
-
return super.add(...
|
|
5550
|
+
return super.add(...t);
|
|
5564
5551
|
}
|
|
5565
|
-
|
|
5566
|
-
this.
|
|
5552
|
+
_rebuildParentUI = () => {
|
|
5553
|
+
super._rebuildParentUI(), this._layouter._needsUpdate = !0;
|
|
5554
|
+
};
|
|
5555
|
+
set textContent(e) {
|
|
5556
|
+
this._textContent.value = e;
|
|
5567
5557
|
}
|
|
5568
5558
|
get textContent() {
|
|
5569
5559
|
return this._textContent._value;
|
|
5570
5560
|
}
|
|
5571
|
-
set invertAlpha(
|
|
5572
|
-
this._invertAlpha.value =
|
|
5561
|
+
set invertAlpha(e) {
|
|
5562
|
+
this._invertAlpha.value = e;
|
|
5573
5563
|
}
|
|
5574
5564
|
get invertAlpha() {
|
|
5575
5565
|
return this._invertAlpha._value;
|
|
@@ -5580,16 +5570,16 @@ class U extends z {
|
|
|
5580
5570
|
* @param {import('./../../core/elements/MeshUIBaseElement').Properties} properties
|
|
5581
5571
|
* @param {import('./../../core/elements/MeshUIBaseElement').Options} values
|
|
5582
5572
|
*/
|
|
5583
|
-
static definePropertiesValues(
|
|
5584
|
-
|
|
5573
|
+
static definePropertiesValues(e, t) {
|
|
5574
|
+
e.children || (e.children = vt), e.textContent || (e.textContent = Sr), e.glyphs || (e.glyphs = kr), e.inlines || (e.inlines = Vr), e.layouter || (e.layouter = at), e.renderer || (e.renderer = Dr), e.fontFamily || (e.fontFamily = lt), e.fontWeight || (e.fontWeight = ht), e.fontStyle || (e.fontStyle = ut), e.fontSize || (e.fontSize = gt), e.color || (e.color = Pr), e.backgroundColor || (e.backgroundColor = Ir), e.lineBreak || (e.lineBreak = ot), e.letterSpacing || (e.letterSpacing = pt), e.whiteSpace || (e.whiteSpace = Pe), e.segments || (e.segments = zr), e.textAlign || (e.textAlign = Hr), e.fontKerning || (e.fontKerning = Wr);
|
|
5585
5575
|
}
|
|
5586
5576
|
/**
|
|
5587
5577
|
*
|
|
5588
5578
|
* @param {MeshUIBaseElement} element
|
|
5589
5579
|
*/
|
|
5590
|
-
static init(
|
|
5580
|
+
static init(e) {
|
|
5591
5581
|
Object.defineProperties(
|
|
5592
|
-
|
|
5582
|
+
e,
|
|
5593
5583
|
{
|
|
5594
5584
|
isInline: {
|
|
5595
5585
|
configurable: !1,
|
|
@@ -5600,7 +5590,7 @@ class U extends z {
|
|
|
5600
5590
|
);
|
|
5601
5591
|
}
|
|
5602
5592
|
}
|
|
5603
|
-
class
|
|
5593
|
+
class Gr extends $e {
|
|
5604
5594
|
constructor() {
|
|
5605
5595
|
super("textContent", null, !1), this._needsUpdate = !1;
|
|
5606
5596
|
}
|
|
@@ -5614,10 +5604,10 @@ class Xr extends Ne {
|
|
|
5614
5604
|
const r = e.children[s];
|
|
5615
5605
|
r.isUI && (e.remove(r), r.clear());
|
|
5616
5606
|
}
|
|
5617
|
-
e._children._uis = [], this._value && e.add(new
|
|
5607
|
+
e._children._uis = [], this._value && e.add(new B({ name: "anonymousInline", textContent: this._value }));
|
|
5618
5608
|
}
|
|
5619
5609
|
}
|
|
5620
|
-
class
|
|
5610
|
+
class $r extends Array {
|
|
5621
5611
|
/**
|
|
5622
5612
|
*
|
|
5623
5613
|
* @param {Line} items
|
|
@@ -5626,7 +5616,7 @@ class jr extends Array {
|
|
|
5626
5616
|
super(...e), this.width = 0, this.height = 0;
|
|
5627
5617
|
}
|
|
5628
5618
|
}
|
|
5629
|
-
class
|
|
5619
|
+
class Nr extends p {
|
|
5630
5620
|
constructor() {
|
|
5631
5621
|
super("layouter", null, !1), this._value = null;
|
|
5632
5622
|
}
|
|
@@ -5640,7 +5630,7 @@ class Yr extends p {
|
|
|
5640
5630
|
process(e) {
|
|
5641
5631
|
let t = e._width._value;
|
|
5642
5632
|
e._width._auto ? t = 1 / 0 : t = e._bounds._innerWidth;
|
|
5643
|
-
const s = e._lineHeight._value, r = new
|
|
5633
|
+
const s = e._lineHeight._value, r = new $r(new Ae());
|
|
5644
5634
|
let n = 0;
|
|
5645
5635
|
e._children._inlines.forEach((h) => {
|
|
5646
5636
|
if (!h._inlines.value) return;
|
|
@@ -5650,18 +5640,18 @@ class Yr extends p {
|
|
|
5650
5640
|
LETTERSPACING: f,
|
|
5651
5641
|
BREAKON: S,
|
|
5652
5642
|
INNER_WIDTH: t
|
|
5653
|
-
},
|
|
5654
|
-
n += h._margin._value.w + h._padding._value.w, h._inlines.value.forEach((y,
|
|
5655
|
-
const
|
|
5656
|
-
if (
|
|
5657
|
-
if (r.push(new
|
|
5643
|
+
}, St = h._whiteSpace._inlineWrapper;
|
|
5644
|
+
n += h._margin._value.w + h._padding._value.w, h._inlines.value.forEach((y, Vt, kt) => {
|
|
5645
|
+
const J = r[r.length - 1];
|
|
5646
|
+
if (St(kt, Vt, n, b)) {
|
|
5647
|
+
if (r.push(new Ae(y)), y.offsetX = y.xoffset, y.width === 0) {
|
|
5658
5648
|
n = 0;
|
|
5659
5649
|
return;
|
|
5660
5650
|
}
|
|
5661
5651
|
y.cumulativeWidth = y.xadvance + f, n = y.cumulativeWidth;
|
|
5662
5652
|
return;
|
|
5663
5653
|
}
|
|
5664
|
-
r[r.length - 1].push(y), y.offsetX = n + y.xoffset + y.kerning, y.cumulativeWidth = y.xadvance + y.kerning + f, n += y.cumulativeWidth,
|
|
5654
|
+
r[r.length - 1].push(y), y.offsetX = n + y.xoffset + y.kerning, y.cumulativeWidth = y.xadvance + y.kerning + f, n += y.cumulativeWidth, J.length - 1 === 1 && J[J.length - 2].width === 0 && (y.offsetX -= y.xoffset, n -= y.xoffset);
|
|
5665
5655
|
}), n += h._margin._value.y + h._padding._value.y;
|
|
5666
5656
|
});
|
|
5667
5657
|
const o = e._whiteSpace._inlineCollapser;
|
|
@@ -5690,7 +5680,7 @@ class Yr extends p {
|
|
|
5690
5680
|
e._fontSize.process(e);
|
|
5691
5681
|
}
|
|
5692
5682
|
}
|
|
5693
|
-
class
|
|
5683
|
+
class Xr extends he {
|
|
5694
5684
|
constructor() {
|
|
5695
5685
|
super(), this._allowsInherit = !1, this._needsUpdate = !0;
|
|
5696
5686
|
}
|
|
@@ -5699,13 +5689,13 @@ class Kr extends le {
|
|
|
5699
5689
|
this._value = this._inheritedInput, this._needsProcess = !0;
|
|
5700
5690
|
}
|
|
5701
5691
|
process(e) {
|
|
5702
|
-
|
|
5692
|
+
jr(e), e._renderer._needsRender = !0;
|
|
5703
5693
|
}
|
|
5704
5694
|
}
|
|
5705
|
-
function
|
|
5695
|
+
function jr(i) {
|
|
5706
5696
|
const e = i._layouter._value, t = i._textAlign._value, s = i._bounds._innerWidth;
|
|
5707
5697
|
for (let r = 0; r < e.length; r++) {
|
|
5708
|
-
const n = e[r], o =
|
|
5698
|
+
const n = e[r], o = Yr(i, n, r === e.length - 1), a = i._padding._value, l = i._borderWidth._value, d = (-a.w + a.y) / 2 + (-l.w + l.y) / 2;
|
|
5709
5699
|
n.x += o;
|
|
5710
5700
|
for (let c = 0; c < n.length; c++)
|
|
5711
5701
|
n[c].offsetX += o - d;
|
|
@@ -5730,7 +5720,7 @@ function qr(i) {
|
|
|
5730
5720
|
t === "justify-right" && n.reverse();
|
|
5731
5721
|
}
|
|
5732
5722
|
}
|
|
5733
|
-
function
|
|
5723
|
+
function Yr(i, e, t) {
|
|
5734
5724
|
switch (i._textAlign._value) {
|
|
5735
5725
|
case "justify-left":
|
|
5736
5726
|
case "justify":
|
|
@@ -5747,7 +5737,7 @@ function Jr(i, e, t) {
|
|
|
5747
5737
|
console.warn(`textAlign: '${i._textAlign._value}' is not valid`);
|
|
5748
5738
|
}
|
|
5749
5739
|
}
|
|
5750
|
-
class
|
|
5740
|
+
class Kr extends le {
|
|
5751
5741
|
constructor() {
|
|
5752
5742
|
super(), this._value = this._input = "column", this._allowsInherit = !1, this._needsUpdate = !0;
|
|
5753
5743
|
}
|
|
@@ -5756,7 +5746,7 @@ class Zr extends ce {
|
|
|
5756
5746
|
this._value = this._inheritedInput;
|
|
5757
5747
|
}
|
|
5758
5748
|
}
|
|
5759
|
-
class
|
|
5749
|
+
class qr extends Je {
|
|
5760
5750
|
/**
|
|
5761
5751
|
*
|
|
5762
5752
|
*/
|
|
@@ -5764,7 +5754,7 @@ class Qr extends Ze {
|
|
|
5764
5754
|
super(), this._allowsInherit = !1, this.computeOutputValue = this._computeFromInherited;
|
|
5765
5755
|
}
|
|
5766
5756
|
}
|
|
5767
|
-
class
|
|
5757
|
+
class Jr extends q {
|
|
5768
5758
|
constructor() {
|
|
5769
5759
|
super(), this._value = this._input = this.getDefaultValue(), this._allowsInherit = !1, this.computeOutputValue = this._computeFromInherited;
|
|
5770
5760
|
}
|
|
@@ -5772,25 +5762,14 @@ class en extends J {
|
|
|
5772
5762
|
super._computeFromInherited(e);
|
|
5773
5763
|
}
|
|
5774
5764
|
}
|
|
5775
|
-
class
|
|
5765
|
+
class Zr extends st {
|
|
5776
5766
|
constructor() {
|
|
5777
5767
|
super(), this._innerWidth = 1 / 0, this._innerHeight = 0;
|
|
5778
5768
|
}
|
|
5779
5769
|
}
|
|
5780
|
-
class
|
|
5770
|
+
class Qr extends p {
|
|
5781
5771
|
constructor() {
|
|
5782
|
-
super("children", null, !1);
|
|
5783
|
-
/**
|
|
5784
|
-
*
|
|
5785
|
-
* Sort children according to their .style.order property or fallback on children index
|
|
5786
|
-
*
|
|
5787
|
-
* @param {HTMLElementVR} a
|
|
5788
|
-
* @param {HTMLElementVR} b
|
|
5789
|
-
* @return {number}
|
|
5790
|
-
* @private
|
|
5791
|
-
*/
|
|
5792
|
-
I(this, "_sortOrder", (t, s) => t._order._value < s._order._value ? -1 : t._order._value > s._order._value ? 1 : this._uis.indexOf(t) < this._uis.indexOf(s) ? -1 : 1);
|
|
5793
|
-
this._uis = [], this._inlines = [], this._boxes = [];
|
|
5772
|
+
super("children", null, !1), this._uis = [], this._inlines = [], this._boxes = [];
|
|
5794
5773
|
}
|
|
5795
5774
|
/* eslint-disable no-unused-vars */
|
|
5796
5775
|
/**
|
|
@@ -5801,8 +5780,8 @@ class sn extends p {
|
|
|
5801
5780
|
* @param element
|
|
5802
5781
|
* @param out
|
|
5803
5782
|
*/
|
|
5804
|
-
update(
|
|
5805
|
-
this._compute(
|
|
5783
|
+
update(e, t) {
|
|
5784
|
+
this._compute(e), this._needsProcess = !0;
|
|
5806
5785
|
}
|
|
5807
5786
|
/**
|
|
5808
5787
|
* Process when :
|
|
@@ -5810,11 +5789,11 @@ class sn extends p {
|
|
|
5810
5789
|
*
|
|
5811
5790
|
* @param element
|
|
5812
5791
|
*/
|
|
5813
|
-
process(
|
|
5814
|
-
this._compute(
|
|
5792
|
+
process(e) {
|
|
5793
|
+
this._compute(e), e._overflow._needsRender = !0;
|
|
5815
5794
|
}
|
|
5816
|
-
_compute(
|
|
5817
|
-
this._uis =
|
|
5795
|
+
_compute(e) {
|
|
5796
|
+
this._uis = e.children.filter((t) => t.visible && t.isUI), this._inlines = this._uis.filter((t) => t.isInline).sort(this._sortOrder);
|
|
5818
5797
|
}
|
|
5819
5798
|
/**
|
|
5820
5799
|
*
|
|
@@ -5822,8 +5801,18 @@ class sn extends p {
|
|
|
5822
5801
|
dispose() {
|
|
5823
5802
|
this._inlines = null;
|
|
5824
5803
|
}
|
|
5804
|
+
/**
|
|
5805
|
+
*
|
|
5806
|
+
* Sort children according to their .style.order property or fallback on children index
|
|
5807
|
+
*
|
|
5808
|
+
* @param {HTMLElementVR} a
|
|
5809
|
+
* @param {HTMLElementVR} b
|
|
5810
|
+
* @return {number}
|
|
5811
|
+
* @private
|
|
5812
|
+
*/
|
|
5813
|
+
_sortOrder = (e, t) => e._order._value < t._order._value ? -1 : e._order._value > t._order._value ? 1 : this._uis.indexOf(e) < this._uis.indexOf(t) ? -1 : 1;
|
|
5825
5814
|
}
|
|
5826
|
-
class
|
|
5815
|
+
class en extends p {
|
|
5827
5816
|
constructor() {
|
|
5828
5817
|
super("autosize");
|
|
5829
5818
|
}
|
|
@@ -5834,7 +5823,7 @@ class rn extends p {
|
|
|
5834
5823
|
}
|
|
5835
5824
|
}
|
|
5836
5825
|
}
|
|
5837
|
-
class
|
|
5826
|
+
class tn extends nt {
|
|
5838
5827
|
constructor() {
|
|
5839
5828
|
super("renderer"), this._needsUpdate = !1;
|
|
5840
5829
|
}
|
|
@@ -5845,14 +5834,14 @@ class nn extends ot {
|
|
|
5845
5834
|
e.performAfterUpdate();
|
|
5846
5835
|
}
|
|
5847
5836
|
}
|
|
5848
|
-
class
|
|
5837
|
+
class M extends A {
|
|
5849
5838
|
/**
|
|
5850
5839
|
*
|
|
5851
5840
|
* @param {import('./../../core/elements/MeshUIBaseElement').Options} [values={}]
|
|
5852
5841
|
* @param [properties={}]
|
|
5853
5842
|
*/
|
|
5854
5843
|
constructor(e = {}, t = {}) {
|
|
5855
|
-
|
|
5844
|
+
M.definePropertiesValues(t, e), super(t, e), M.init(this);
|
|
5856
5845
|
}
|
|
5857
5846
|
/* eslint-disable no-unused-vars */
|
|
5858
5847
|
/**
|
|
@@ -5892,7 +5881,7 @@ class F extends T {
|
|
|
5892
5881
|
* @param {import('./../../core/elements/MeshUIBaseElement').Options} values
|
|
5893
5882
|
*/
|
|
5894
5883
|
static definePropertiesValues(e, t) {
|
|
5895
|
-
e.flexDirection =
|
|
5884
|
+
e.flexDirection = Kr, e.justifyContent = ce, e.alignItems = ue, e.bounds = Zr, e.autoSize = en, e.renderer = tn, e.children || (e.children = Qr), e.textContent || (e.textContent = Gr), e.layouter || (e.layouter = Nr), e.lineHeight || (e.lineHeight = qr), e.textAlign || (e.textAlign = Xr), e.whiteSpace || (e.whiteSpace = Pe), e.fontKerning || (e.fontKerning = Jr), e.segments || (e.segments = mt), t.width || (t.width = "100%"), t.fontSide || (t.fontSide = 0);
|
|
5896
5885
|
}
|
|
5897
5886
|
/**
|
|
5898
5887
|
*
|
|
@@ -5911,7 +5900,7 @@ class F extends T {
|
|
|
5911
5900
|
);
|
|
5912
5901
|
}
|
|
5913
5902
|
}
|
|
5914
|
-
class
|
|
5903
|
+
class sn extends p {
|
|
5915
5904
|
constructor() {
|
|
5916
5905
|
super("inlines", null, !1), this._value = [];
|
|
5917
5906
|
}
|
|
@@ -5921,15 +5910,15 @@ class on extends p {
|
|
|
5921
5910
|
this._value[t].paddingRight = e._padding._value.y, this._value[t].marginRight = e._margin._value.y;
|
|
5922
5911
|
}
|
|
5923
5912
|
}
|
|
5924
|
-
class
|
|
5913
|
+
class rn extends p {
|
|
5925
5914
|
constructor() {
|
|
5926
5915
|
super("renderer");
|
|
5927
5916
|
}
|
|
5928
5917
|
render(e) {
|
|
5929
|
-
e._backgroundMesh || e.setBackgroundMesh(new
|
|
5918
|
+
e._backgroundMesh || e.setBackgroundMesh(new rt(e)), e._backgroundMesh.position.x = e._inlines._value[0].offsetX + e._inlines._value[0].width / 2, e._backgroundMesh.position.y = e._inlines._value[0].offsetY + e._inlines._value[0].lineBase / 2, e._bounds.render(e);
|
|
5930
5919
|
}
|
|
5931
5920
|
}
|
|
5932
|
-
class
|
|
5921
|
+
class nn extends p {
|
|
5933
5922
|
constructor() {
|
|
5934
5923
|
super("bounds", null, !1), this._size = new u.Vector3(1, 1, 1), this._offsetWidth = 0, this._offsetHeight = 0, this._innerWidth = 0, this._innerHeight = 0;
|
|
5935
5924
|
}
|
|
@@ -5952,14 +5941,14 @@ class un extends p {
|
|
|
5952
5941
|
e.size = this._size;
|
|
5953
5942
|
}
|
|
5954
5943
|
}
|
|
5955
|
-
class
|
|
5944
|
+
class F extends L {
|
|
5956
5945
|
/**
|
|
5957
5946
|
*
|
|
5958
5947
|
* @param {import('./../../core/elements/MeshUIBaseElement').Options} [values={}]
|
|
5959
5948
|
*/
|
|
5960
5949
|
constructor(e = {}) {
|
|
5961
5950
|
const t = {};
|
|
5962
|
-
|
|
5951
|
+
F.definePropertiesValues(t, e), super(t, e), F.init(this);
|
|
5963
5952
|
}
|
|
5964
5953
|
clear() {
|
|
5965
5954
|
for (const e of this._inlines._value)
|
|
@@ -6002,7 +5991,7 @@ class O extends z {
|
|
|
6002
5991
|
* @param {import('./../../core/elements/MeshUIBaseElement').Options} values
|
|
6003
5992
|
*/
|
|
6004
5993
|
static definePropertiesValues(e, t) {
|
|
6005
|
-
e.children || (e.children =
|
|
5994
|
+
e.children || (e.children = vt), e.bounds || (e.bounds = nn), e.inlines || (e.inlines = sn), e.layouter || (e.layouter = at), e.renderer || (e.renderer = rn), e.fontFamily || (e.fontFamily = lt), e.fontWeight || (e.fontWeight = ht), e.fontStyle || (e.fontStyle = ut), e.fontSize || (e.fontSize = gt), e.backgroundColor || (e.backgroundColor = De), e.lineBreak || (e.lineBreak = ot), e.letterSpacing || (e.letterSpacing = pt), e.whiteSpace || (e.whiteSpace = Pe), e.fontKerning || (e.fontKerning = q), t.backgroundSize || (t.backgroundSize = "cover"), t.width || (t.width = "100%"), t.height || (t.height = "100%"), t.boxSizing || (t.boxSizing = "border-box");
|
|
6006
5995
|
}
|
|
6007
5996
|
/**
|
|
6008
5997
|
*
|
|
@@ -6023,10 +6012,10 @@ class O extends z {
|
|
|
6023
6012
|
value: !0
|
|
6024
6013
|
}
|
|
6025
6014
|
}
|
|
6026
|
-
), e._inlines._value = [new
|
|
6015
|
+
), e._inlines._value = [new on(e)], e.backgroundMaterial = new it(), e._renderer.render(e);
|
|
6027
6016
|
}
|
|
6028
6017
|
}
|
|
6029
|
-
class
|
|
6018
|
+
class on extends Oe {
|
|
6030
6019
|
/**
|
|
6031
6020
|
*
|
|
6032
6021
|
* @param {InlineBlockElement} parent
|
|
@@ -6089,7 +6078,7 @@ class hn extends Le {
|
|
|
6089
6078
|
this._uiElement = null;
|
|
6090
6079
|
}
|
|
6091
6080
|
}
|
|
6092
|
-
class
|
|
6081
|
+
class yt {
|
|
6093
6082
|
/**
|
|
6094
6083
|
*
|
|
6095
6084
|
* @param {MeshUIBaseElement} subject
|
|
@@ -6122,47 +6111,47 @@ class bt {
|
|
|
6122
6111
|
clear() {
|
|
6123
6112
|
}
|
|
6124
6113
|
}
|
|
6125
|
-
const
|
|
6114
|
+
const bt = () => N.update(), xt = {
|
|
6126
6115
|
BaseProperty: p,
|
|
6127
|
-
Block:
|
|
6128
|
-
Text:
|
|
6129
|
-
Inline:
|
|
6130
|
-
InlineBlock:
|
|
6116
|
+
Block: T,
|
|
6117
|
+
Text: M,
|
|
6118
|
+
Inline: B,
|
|
6119
|
+
InlineBlock: F,
|
|
6131
6120
|
// Keyboard : KeyboardElement,
|
|
6132
|
-
MeshUIBaseElement:
|
|
6133
|
-
FontLibrary:
|
|
6134
|
-
update:
|
|
6121
|
+
MeshUIBaseElement: L,
|
|
6122
|
+
FontLibrary: I,
|
|
6123
|
+
update: bt,
|
|
6135
6124
|
MSDFFontMaterialUtils: w,
|
|
6136
|
-
ShaderChunkUI:
|
|
6137
|
-
Behavior:
|
|
6138
|
-
FontVariant:
|
|
6125
|
+
ShaderChunkUI: tt,
|
|
6126
|
+
Behavior: yt,
|
|
6127
|
+
FontVariant: O
|
|
6139
6128
|
};
|
|
6140
|
-
typeof global < "u" && (global.ThreeMeshUI =
|
|
6141
|
-
const
|
|
6142
|
-
var
|
|
6143
|
-
const
|
|
6129
|
+
typeof global < "u" && (global.ThreeMeshUI = xt);
|
|
6130
|
+
const an = xt;
|
|
6131
|
+
var un = m.ti, wt = m.nS, hn = m.eB, ln = m.Yp, cn = m.VB, dn = m.BC, _n = m.zN, fn = m.cV, pn = m.hW, gn = m.k2, mn = m.K6, vn = m.M7, yn = m.ls, bn = m.Hi, xn = m.EY, wn = m.MR, Sn = m.zf, Vn = m.Ay, kn = m.yo;
|
|
6132
|
+
const Cn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
6144
6133
|
__proto__: null,
|
|
6145
|
-
BaseProperty:
|
|
6146
|
-
Behavior:
|
|
6147
|
-
Block:
|
|
6148
|
-
DefaultValues:
|
|
6149
|
-
FontLibrary:
|
|
6150
|
-
FontVariant:
|
|
6151
|
-
InheritableProperty:
|
|
6152
|
-
Inline:
|
|
6153
|
-
InlineBlock:
|
|
6154
|
-
InlineGlyph:
|
|
6155
|
-
MSDFFontMaterialUtils:
|
|
6156
|
-
MaterialTransformers:
|
|
6157
|
-
MeshUIBaseElement:
|
|
6158
|
-
ShaderChunkUI:
|
|
6159
|
-
Text:
|
|
6160
|
-
TypographicFont:
|
|
6161
|
-
TypographicGlyph:
|
|
6162
|
-
default:
|
|
6163
|
-
update:
|
|
6134
|
+
BaseProperty: un,
|
|
6135
|
+
Behavior: wt,
|
|
6136
|
+
Block: hn,
|
|
6137
|
+
DefaultValues: ln,
|
|
6138
|
+
FontLibrary: cn,
|
|
6139
|
+
FontVariant: dn,
|
|
6140
|
+
InheritableProperty: _n,
|
|
6141
|
+
Inline: fn,
|
|
6142
|
+
InlineBlock: pn,
|
|
6143
|
+
InlineGlyph: gn,
|
|
6144
|
+
MSDFFontMaterialUtils: mn,
|
|
6145
|
+
MaterialTransformers: vn,
|
|
6146
|
+
MeshUIBaseElement: yn,
|
|
6147
|
+
ShaderChunkUI: bn,
|
|
6148
|
+
Text: xn,
|
|
6149
|
+
TypographicFont: wn,
|
|
6150
|
+
TypographicGlyph: Sn,
|
|
6151
|
+
default: Vn,
|
|
6152
|
+
update: kn
|
|
6164
6153
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
6165
|
-
class
|
|
6154
|
+
class Rn extends wt {
|
|
6166
6155
|
constructor(e, t = {}) {
|
|
6167
6156
|
super(e), e._simpleState__activeStates = [], e._simpleState__normalStyles = {}, e._simpleState__states = t, e._simpleState__statesProperties = {};
|
|
6168
6157
|
for (const s in t)
|
|
@@ -6219,12 +6208,12 @@ class Tn extends St {
|
|
|
6219
6208
|
}
|
|
6220
6209
|
}
|
|
6221
6210
|
export {
|
|
6222
|
-
|
|
6223
|
-
|
|
6224
|
-
|
|
6225
|
-
|
|
6226
|
-
|
|
6227
|
-
|
|
6228
|
-
|
|
6229
|
-
|
|
6211
|
+
Rn as SimpleStateBehavior,
|
|
6212
|
+
Cn as ThreeMeshUI,
|
|
6213
|
+
hn as __webpack_exports__Block,
|
|
6214
|
+
cn as __webpack_exports__FontLibrary,
|
|
6215
|
+
fn as __webpack_exports__Inline,
|
|
6216
|
+
xn as __webpack_exports__Text,
|
|
6217
|
+
Vn as __webpack_exports__default,
|
|
6218
|
+
kn as __webpack_exports__update
|
|
6230
6219
|
};
|