uxml-preview 0.1.0 → 0.2.0
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/CHANGELOG.md +97 -1
- package/README.md +84 -46
- package/dist/controls/registry.d.ts +59 -2
- package/dist/controls/theme.d.ts +87 -0
- package/dist/index.d.ts +24 -6
- package/dist/index.js +1108 -791
- package/dist/layout/yoga.d.ts +34 -1
- package/dist/model/types.d.ts +33 -2
- package/dist/parser/entities.d.ts +19 -0
- package/dist/render/paint.d.ts +14 -2
- package/dist/style/resolve.d.ts +50 -2
- package/dist/style/selector.d.ts +50 -9
- package/package.json +86 -59
package/dist/index.js
CHANGED
|
@@ -1,16 +1,140 @@
|
|
|
1
|
-
import { loadYoga as
|
|
2
|
-
const
|
|
3
|
-
VisualElement
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { loadYoga as Mt, PositionType as Z, Direction as lt, Edge as P, BoxSizing as Rt, FlexDirection as H, Wrap as q, Justify as W, Align as L, Display as Ut, Overflow as Dt } from "yoga-layout/load";
|
|
2
|
+
const xt = {
|
|
3
|
+
// VisualElement is the base class and carries no class of its own.
|
|
4
|
+
VisualElement: { hasText: !1, classes: [], parts: [] },
|
|
5
|
+
Label: { hasText: !0, classes: ["unity-label"], parts: [] },
|
|
6
|
+
Button: { hasText: !0, classes: ["unity-button"], parts: [] },
|
|
7
|
+
// Image draws a texture, not text. Its picture reaches this renderer through
|
|
8
|
+
// `background-image` in USS, which `resolveAsset` can turn into something a
|
|
9
|
+
// browser will load; a texture assigned from C# has no path to follow here.
|
|
10
|
+
Image: { hasText: !1, classes: ["unity-image"], parts: [] },
|
|
11
|
+
/**
|
|
12
|
+
* Four elements from one tag. The names below are observed in
|
|
13
|
+
* `tests/golden/unity/scrollview-*.json`, not taken from documentation — the
|
|
14
|
+
* middle one, `unity-content-and-vertical-scroll-container`, is not in
|
|
15
|
+
* Unity's manual diagram at all and was found by dumping.
|
|
16
|
+
*
|
|
17
|
+
* The styles are inference, unlike the names: they are how this renderer
|
|
18
|
+
* reproduces the measured geometry, and the three `scrollview-*` golden cases
|
|
19
|
+
* are what decides whether the inference is right.
|
|
20
|
+
*/
|
|
21
|
+
ScrollView: {
|
|
22
|
+
hasText: !1,
|
|
23
|
+
classes: ["unity-scroll-view"],
|
|
24
|
+
parts: [
|
|
25
|
+
// Fills the ScrollView's content box, and lays the viewport out beside
|
|
26
|
+
// the vertical scrollbar — hence row.
|
|
27
|
+
{
|
|
28
|
+
name: "unity-content-and-vertical-scroll-container",
|
|
29
|
+
style: { "flex-grow": "1", "flex-direction": "row" }
|
|
30
|
+
},
|
|
31
|
+
// What actually clips. Takes whatever width the scrollbar leaves.
|
|
32
|
+
{ name: "unity-content-viewport", style: { "flex-grow": "1", overflow: "hidden" } },
|
|
33
|
+
// `flex-shrink: 0` is the whole reason a ScrollView is not one box:
|
|
34
|
+
// this grows to the content's height instead of being squeezed into the
|
|
35
|
+
// viewport's, so children keep their sizes and the viewport crops them.
|
|
36
|
+
// Without it three 60px children in a 100px view come out 33/34/33.
|
|
37
|
+
{ name: "unity-content-container", style: { "flex-shrink": "0" } }
|
|
38
|
+
]
|
|
39
|
+
}
|
|
40
|
+
}, ct = { hasText: !1, classes: [], parts: [] }, Lt = "UXML", _t = /* @__PURE__ */ new Set(["Style"]);
|
|
41
|
+
function zt(t) {
|
|
42
|
+
return _t.has(t.name.local);
|
|
43
|
+
}
|
|
44
|
+
function F(t) {
|
|
45
|
+
const n = xt[t.name.local];
|
|
46
|
+
return n !== void 0 ? { spec: n, fallback: !1 } : jt(t) ? { spec: ct, fallback: !1 } : { spec: ct, fallback: !0 };
|
|
47
|
+
}
|
|
48
|
+
function jt(t) {
|
|
49
|
+
return t.name.local === Lt;
|
|
50
|
+
}
|
|
51
|
+
function Wt(t) {
|
|
52
|
+
return F(t).spec.classes;
|
|
53
|
+
}
|
|
54
|
+
function Bt() {
|
|
55
|
+
return Object.keys(xt);
|
|
56
|
+
}
|
|
57
|
+
const X = "6000.0.40f1", vt = `:disabled {
|
|
58
|
+
opacity: 0.5;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.unity-button {
|
|
62
|
+
margin: 1px 3px;
|
|
63
|
+
-unity-text-align: middle-center;
|
|
64
|
+
}
|
|
65
|
+
`, Ft = 13;
|
|
66
|
+
function Pt(t) {
|
|
67
|
+
return t ? Ft : 0;
|
|
68
|
+
}
|
|
69
|
+
const Ht = /* @__PURE__ */ new Set([
|
|
70
|
+
"color",
|
|
71
|
+
"font-size",
|
|
72
|
+
"letter-spacing",
|
|
73
|
+
"word-spacing",
|
|
74
|
+
"visibility",
|
|
75
|
+
"white-space",
|
|
76
|
+
"-unity-font",
|
|
77
|
+
"-unity-font-definition",
|
|
78
|
+
"-unity-font-style",
|
|
79
|
+
"-unity-paragraph-spacing",
|
|
80
|
+
"-unity-text-align",
|
|
81
|
+
"-unity-text-outline-color",
|
|
82
|
+
"-unity-text-outline-width"
|
|
83
|
+
]);
|
|
84
|
+
function Vt(t) {
|
|
85
|
+
return t.startsWith("--") || Ht.has(t);
|
|
86
|
+
}
|
|
87
|
+
function ut(t) {
|
|
88
|
+
const n = [];
|
|
89
|
+
let e = 0, i = -1;
|
|
90
|
+
for (let l = 0; l < t.length; l++) {
|
|
91
|
+
const s = t[l];
|
|
92
|
+
s === "(" ? e++ : s === ")" && (e = Math.max(0, e - 1)), e === 0 && /\s/.test(s) ? i >= 0 && (n.push(t.slice(i, l)), i = -1) : i < 0 && (i = l);
|
|
93
|
+
}
|
|
94
|
+
return i >= 0 && n.push(t.slice(i)), n;
|
|
95
|
+
}
|
|
96
|
+
function qt(t) {
|
|
97
|
+
const [n, e, i, l] = t;
|
|
98
|
+
return n === void 0 ? null : e === void 0 ? [n, n, n, n] : i === void 0 ? [n, e, n, e] : l === void 0 ? [n, e, i, e] : [n, e, i, l];
|
|
99
|
+
}
|
|
100
|
+
const Gt = {
|
|
101
|
+
margin: ["margin-top", "margin-right", "margin-bottom", "margin-left"],
|
|
102
|
+
padding: ["padding-top", "padding-right", "padding-bottom", "padding-left"],
|
|
103
|
+
"border-width": [
|
|
104
|
+
"border-top-width",
|
|
105
|
+
"border-right-width",
|
|
106
|
+
"border-bottom-width",
|
|
107
|
+
"border-left-width"
|
|
108
|
+
],
|
|
109
|
+
"border-color": [
|
|
110
|
+
"border-top-color",
|
|
111
|
+
"border-right-color",
|
|
112
|
+
"border-bottom-color",
|
|
113
|
+
"border-left-color"
|
|
114
|
+
],
|
|
115
|
+
// Radii run clockwise from the top-left corner, not top/right/bottom/left.
|
|
116
|
+
"border-radius": [
|
|
117
|
+
"border-top-left-radius",
|
|
118
|
+
"border-top-right-radius",
|
|
119
|
+
"border-bottom-right-radius",
|
|
120
|
+
"border-bottom-left-radius"
|
|
121
|
+
]
|
|
6
122
|
};
|
|
7
|
-
function
|
|
8
|
-
return
|
|
123
|
+
function dt(t) {
|
|
124
|
+
return /^-?(\d+\.?\d*|\.\d+)$/.test(t);
|
|
125
|
+
}
|
|
126
|
+
function Xt(t) {
|
|
127
|
+
const [n, e, i] = t;
|
|
128
|
+
return n === void 0 ? [] : n === "none" ? [["flex-grow", "0"], ["flex-shrink", "0"], ["flex-basis", "auto"]] : n === "auto" ? [["flex-grow", "1"], ["flex-shrink", "1"], ["flex-basis", "auto"]] : e === void 0 ? dt(n) ? [["flex-grow", n], ["flex-shrink", "1"], ["flex-basis", "0"]] : [["flex-grow", "1"], ["flex-shrink", "1"], ["flex-basis", n]] : i === void 0 ? dt(e) ? [["flex-grow", n], ["flex-shrink", e], ["flex-basis", "0"]] : [["flex-grow", n], ["flex-shrink", "1"], ["flex-basis", e]] : [["flex-grow", n], ["flex-shrink", e], ["flex-basis", i]];
|
|
9
129
|
}
|
|
10
|
-
function
|
|
11
|
-
return
|
|
130
|
+
function J(t, n) {
|
|
131
|
+
if (t === "flex") return Xt(ut(n));
|
|
132
|
+
const e = Gt[t];
|
|
133
|
+
if (e === void 0) return [[t, n]];
|
|
134
|
+
const i = qt(ut(n));
|
|
135
|
+
return i === null ? [[t, n]] : e.map((l, s) => [l, i[s]]);
|
|
12
136
|
}
|
|
13
|
-
const
|
|
137
|
+
const tt = {
|
|
14
138
|
"align-content": "flex-start",
|
|
15
139
|
"align-items": "stretch",
|
|
16
140
|
"align-self": "auto",
|
|
@@ -46,8 +170,8 @@ const Q = {
|
|
|
46
170
|
"padding-right": "0",
|
|
47
171
|
"padding-top": "0",
|
|
48
172
|
"font-size": "12px"
|
|
49
|
-
},
|
|
50
|
-
function
|
|
173
|
+
}, Yt = ["em", "rem", "vh", "vw", "vmin", "vmax", "pt", "cm", "in"];
|
|
174
|
+
function Y(t) {
|
|
51
175
|
const n = t.trim();
|
|
52
176
|
if (n === "") return { length: null, problem: "empty value" };
|
|
53
177
|
if (n === "auto") return { length: { kind: "auto" } };
|
|
@@ -58,195 +182,244 @@ function P(t) {
|
|
|
58
182
|
const e = /^(-?(?:\d+\.?\d*|\.\d+))([a-z%]*)$/i.exec(n);
|
|
59
183
|
if (e === null) return { length: null, problem: `cannot read "${n}" as a length` };
|
|
60
184
|
const i = Number(e[1]), l = e[2].toLowerCase();
|
|
61
|
-
return l === "" || l === "px" ? { length: { kind: "px", value: i } } : l === "%" ? { length: { kind: "percent", value: i } } :
|
|
185
|
+
return l === "" || l === "px" ? { length: { kind: "px", value: i } } : l === "%" ? { length: { kind: "percent", value: i } } : Yt.includes(l) ? { length: null, problem: `"${l}" is not a USS unit` } : { length: null, problem: `unknown unit "${l}"` };
|
|
62
186
|
}
|
|
63
|
-
function
|
|
187
|
+
function ft(t) {
|
|
64
188
|
const n = t.trim();
|
|
65
189
|
return /^-?(\d+\.?\d*|\.\d+)$/.test(n) ? Number(n) : null;
|
|
66
190
|
}
|
|
67
|
-
let
|
|
68
|
-
async function
|
|
69
|
-
|
|
191
|
+
let st = null;
|
|
192
|
+
async function Ue() {
|
|
193
|
+
st ?? (st = await Mt());
|
|
70
194
|
}
|
|
71
|
-
function
|
|
72
|
-
return
|
|
195
|
+
function De() {
|
|
196
|
+
return st !== null;
|
|
73
197
|
}
|
|
74
|
-
let
|
|
75
|
-
function
|
|
76
|
-
return
|
|
198
|
+
let G = 0;
|
|
199
|
+
function Le() {
|
|
200
|
+
return G;
|
|
77
201
|
}
|
|
78
|
-
const
|
|
79
|
-
auto:
|
|
80
|
-
"flex-start":
|
|
81
|
-
center:
|
|
82
|
-
"flex-end":
|
|
83
|
-
stretch:
|
|
84
|
-
baseline:
|
|
85
|
-
"space-between":
|
|
86
|
-
"space-around":
|
|
87
|
-
"space-evenly":
|
|
88
|
-
},
|
|
89
|
-
"flex-start":
|
|
90
|
-
center:
|
|
91
|
-
"flex-end":
|
|
92
|
-
"space-between":
|
|
93
|
-
"space-around":
|
|
94
|
-
"space-evenly":
|
|
95
|
-
},
|
|
96
|
-
column:
|
|
97
|
-
"column-reverse":
|
|
98
|
-
row:
|
|
99
|
-
"row-reverse":
|
|
100
|
-
},
|
|
101
|
-
nowrap:
|
|
102
|
-
wrap:
|
|
103
|
-
"wrap-reverse":
|
|
104
|
-
},
|
|
105
|
-
["left",
|
|
106
|
-
["top",
|
|
107
|
-
["right",
|
|
108
|
-
["bottom",
|
|
202
|
+
const K = {
|
|
203
|
+
auto: L.Auto,
|
|
204
|
+
"flex-start": L.FlexStart,
|
|
205
|
+
center: L.Center,
|
|
206
|
+
"flex-end": L.FlexEnd,
|
|
207
|
+
stretch: L.Stretch,
|
|
208
|
+
baseline: L.Baseline,
|
|
209
|
+
"space-between": L.SpaceBetween,
|
|
210
|
+
"space-around": L.SpaceAround,
|
|
211
|
+
"space-evenly": L.SpaceEvenly
|
|
212
|
+
}, Zt = {
|
|
213
|
+
"flex-start": W.FlexStart,
|
|
214
|
+
center: W.Center,
|
|
215
|
+
"flex-end": W.FlexEnd,
|
|
216
|
+
"space-between": W.SpaceBetween,
|
|
217
|
+
"space-around": W.SpaceAround,
|
|
218
|
+
"space-evenly": W.SpaceEvenly
|
|
219
|
+
}, Jt = {
|
|
220
|
+
column: H.Column,
|
|
221
|
+
"column-reverse": H.ColumnReverse,
|
|
222
|
+
row: H.Row,
|
|
223
|
+
"row-reverse": H.RowReverse
|
|
224
|
+
}, Kt = {
|
|
225
|
+
nowrap: q.NoWrap,
|
|
226
|
+
wrap: q.Wrap,
|
|
227
|
+
"wrap-reverse": q.WrapReverse
|
|
228
|
+
}, Qt = [
|
|
229
|
+
["left", P.Left],
|
|
230
|
+
["top", P.Top],
|
|
231
|
+
["right", P.Right],
|
|
232
|
+
["bottom", P.Bottom]
|
|
109
233
|
];
|
|
110
|
-
function
|
|
111
|
-
const
|
|
112
|
-
if (
|
|
234
|
+
function te(t, n, e, i) {
|
|
235
|
+
const l = st;
|
|
236
|
+
if (l === null)
|
|
113
237
|
throw new Error("loadLayoutEngine() must be awaited before rendering");
|
|
114
|
-
const
|
|
115
|
-
let
|
|
116
|
-
const
|
|
117
|
-
var
|
|
118
|
-
return ((
|
|
238
|
+
const s = [], m = /* @__PURE__ */ new Map(), g = /* @__PURE__ */ new Map(), v = [], u = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
|
|
239
|
+
let a = 0, d = !1, o = !1;
|
|
240
|
+
const f = (p, k) => {
|
|
241
|
+
var T;
|
|
242
|
+
return ((T = p.get(k)) == null ? void 0 : T.value) ?? tt[k] ?? "";
|
|
119
243
|
};
|
|
120
|
-
function
|
|
121
|
-
|
|
122
|
-
}
|
|
123
|
-
function
|
|
124
|
-
const
|
|
125
|
-
if (
|
|
126
|
-
const { length:
|
|
127
|
-
return
|
|
128
|
-
}
|
|
129
|
-
function
|
|
130
|
-
if (
|
|
131
|
-
switch (
|
|
244
|
+
function w(p, k) {
|
|
245
|
+
s.push({ kind: "unsupported-property", message: p, node: k.id });
|
|
246
|
+
}
|
|
247
|
+
function c(p, k, T) {
|
|
248
|
+
const N = f(p, k);
|
|
249
|
+
if (N === "") return null;
|
|
250
|
+
const { length: C, problem: I } = Y(N);
|
|
251
|
+
return I !== void 0 && w(`${k}: ${I}`, T), C;
|
|
252
|
+
}
|
|
253
|
+
function S(p) {
|
|
254
|
+
if (p !== null)
|
|
255
|
+
switch (p.kind) {
|
|
132
256
|
case "px":
|
|
133
|
-
return
|
|
257
|
+
return p.value;
|
|
134
258
|
case "percent":
|
|
135
|
-
return `${
|
|
259
|
+
return `${p.value}%`;
|
|
136
260
|
case "auto":
|
|
137
261
|
return "auto";
|
|
138
262
|
case "none":
|
|
139
263
|
return;
|
|
140
264
|
}
|
|
141
265
|
}
|
|
142
|
-
function
|
|
143
|
-
if (
|
|
144
|
-
if (
|
|
145
|
-
if (
|
|
266
|
+
function h(p) {
|
|
267
|
+
if (p !== null) {
|
|
268
|
+
if (p.kind === "px") return p.value;
|
|
269
|
+
if (p.kind === "percent") return `${p.value}%`;
|
|
146
270
|
}
|
|
147
271
|
}
|
|
148
|
-
function
|
|
149
|
-
|
|
150
|
-
const
|
|
151
|
-
(
|
|
152
|
-
|
|
153
|
-
),
|
|
154
|
-
const
|
|
155
|
-
|
|
156
|
-
for (const [
|
|
157
|
-
|
|
158
|
-
const
|
|
159
|
-
|
|
272
|
+
function b(p, k, T) {
|
|
273
|
+
p.setBoxSizing(Rt.BorderBox), p.setFlexDirection(Jt[f(k, "flex-direction")] ?? H.Column), p.setFlexWrap(Kt[f(k, "flex-wrap")] ?? q.NoWrap), p.setJustifyContent(Zt[f(k, "justify-content")] ?? W.FlexStart), p.setAlignItems(K[f(k, "align-items")] ?? L.Stretch), p.setAlignSelf(K[f(k, "align-self")] ?? L.Auto), p.setAlignContent(K[f(k, "align-content")] ?? L.FlexStart), p.setFlexGrow(ft(f(k, "flex-grow")) ?? 0), p.setFlexShrink(ft(f(k, "flex-shrink")) ?? 1), p.setFlexBasis(S(c(k, "flex-basis", T)));
|
|
274
|
+
const N = f(k, "position");
|
|
275
|
+
(N === "fixed" || N === "sticky") && w(`position: ${N} is not supported in USS; treated as relative`, T), p.setPositionType(
|
|
276
|
+
N === "absolute" ? Z.Absolute : Z.Relative
|
|
277
|
+
), f(k, "display") === "none" && p.setDisplay(Ut.None);
|
|
278
|
+
const C = f(k, "overflow");
|
|
279
|
+
C === "hidden" ? p.setOverflow(Dt.Hidden) : (C === "auto" || C === "scroll") && w(`overflow: ${C} needs a ScrollView element in USS`, T), p.setWidth(S(c(k, "width", T))), p.setHeight(S(c(k, "height", T))), p.setMinWidth(h(c(k, "min-width", T))), p.setMinHeight(h(c(k, "min-height", T))), p.setMaxWidth(h(c(k, "max-width", T))), p.setMaxHeight(h(c(k, "max-height", T)));
|
|
280
|
+
for (const [I, A] of Qt) {
|
|
281
|
+
p.setMargin(A, h(c(k, `margin-${I}`, T))), p.setPadding(A, h(c(k, `padding-${I}`, T)));
|
|
282
|
+
const z = h(c(k, `border-${I}-width`, T));
|
|
283
|
+
p.setBorder(A, typeof z == "number" ? z : void 0), p.setPosition(A, h(c(k, I, T)));
|
|
160
284
|
}
|
|
161
285
|
}
|
|
162
|
-
function
|
|
163
|
-
var
|
|
164
|
-
return (
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
286
|
+
function y(p) {
|
|
287
|
+
var k;
|
|
288
|
+
return (k = p.attributes.find((T) => T.name === "text")) == null ? void 0 : k.value;
|
|
289
|
+
}
|
|
290
|
+
const x = ["text", "label"];
|
|
291
|
+
function $(p) {
|
|
292
|
+
return x.filter(
|
|
293
|
+
(k) => p.attributes.some((T) => T.name === k && T.value.length > 0)
|
|
294
|
+
);
|
|
295
|
+
}
|
|
296
|
+
function O(p, k) {
|
|
297
|
+
if (zt(p)) return;
|
|
298
|
+
const T = n.get(p.id) ?? /* @__PURE__ */ new Map(), N = l.Node.create();
|
|
299
|
+
a++, G++, u.set(p, N), v.push(p), b(N, T, p), k !== null && k.insertChild(N, k.getChildCount());
|
|
300
|
+
const { spec: C, fallback: I } = F(p), A = y(p), z = C.hasText && A !== void 0 && A.length > 0;
|
|
301
|
+
if (I) {
|
|
302
|
+
const M = $(p);
|
|
303
|
+
s.push({
|
|
304
|
+
kind: "unsupported-control",
|
|
305
|
+
message: `<${p.name.local}> has no renderer in this version and is drawn as a plain VisualElement` + (M.length === 0 ? "" : `; its ${M.join(" and ")} attribute${M.length > 1 ? "s are" : " is"} not drawn, because Unity draws that through a child element`),
|
|
306
|
+
node: p.id
|
|
307
|
+
});
|
|
308
|
+
}
|
|
309
|
+
if (z) {
|
|
310
|
+
p.children.length > 0 && w(
|
|
311
|
+
`<${p.name.local}> has both a text attribute and children; children are not drawn`,
|
|
312
|
+
p
|
|
174
313
|
);
|
|
175
|
-
const
|
|
176
|
-
fontSize:
|
|
177
|
-
fontStyle:
|
|
178
|
-
whiteSpace:
|
|
314
|
+
const M = c(T, "font-size", p), _ = {
|
|
315
|
+
fontSize: M !== null && M.kind === "px" ? M.value : 12,
|
|
316
|
+
fontStyle: f(T, "-unity-font-style") || "normal",
|
|
317
|
+
whiteSpace: f(T, "white-space") || "normal"
|
|
179
318
|
};
|
|
180
|
-
|
|
181
|
-
(
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
Number.isFinite(
|
|
319
|
+
N.setMeasureFunc(
|
|
320
|
+
(U) => i.measureText(
|
|
321
|
+
A,
|
|
322
|
+
_,
|
|
323
|
+
Number.isFinite(U) ? U : 0
|
|
185
324
|
)
|
|
186
325
|
);
|
|
187
326
|
return;
|
|
188
327
|
}
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
328
|
+
let j = N;
|
|
329
|
+
if (C.parts.length > 0) {
|
|
330
|
+
o || (o = !0, s.push({
|
|
331
|
+
kind: "version-dependent",
|
|
332
|
+
message: `<${p.name.local}> is drawn with the implicit child elements Unity builds for it, and their geometry was measured on Unity ${X}. Other versions may differ; see src/controls/theme.ts.`,
|
|
333
|
+
node: p.id
|
|
334
|
+
}));
|
|
335
|
+
const M = [], _ = [], U = e.get(p.id);
|
|
336
|
+
for (const ot of C.parts) {
|
|
337
|
+
const at = (U == null ? void 0 : U.get(ot.name)) ?? /* @__PURE__ */ new Map(), V = l.Node.create();
|
|
338
|
+
a++, G++, b(V, at, p), j.insertChild(V, j.getChildCount()), j = V, _.push(V), M.push({
|
|
339
|
+
name: ot.name,
|
|
340
|
+
owner: p.id,
|
|
341
|
+
box: { left: 0, top: 0, width: 0, height: 0 },
|
|
342
|
+
style: at
|
|
195
343
|
});
|
|
196
|
-
continue;
|
|
197
344
|
}
|
|
198
|
-
|
|
345
|
+
g.set(p.id, M), r.set(p.id, _);
|
|
346
|
+
}
|
|
347
|
+
for (const M of p.children) O(M, j);
|
|
348
|
+
}
|
|
349
|
+
O(t, null);
|
|
350
|
+
const E = u.get(t);
|
|
351
|
+
E.setWidth(i.size.width), E.setHeight(i.size.height), E.setPositionType(Z.Relative), E.calculateLayout(i.size.width, i.size.height, lt.LTR);
|
|
352
|
+
const R = /* @__PURE__ */ new Map();
|
|
353
|
+
for (let p = 0; p < 3; p++) {
|
|
354
|
+
let k = !1;
|
|
355
|
+
for (const [T, N] of g) {
|
|
356
|
+
const C = r.get(T);
|
|
357
|
+
if (C === void 0) continue;
|
|
358
|
+
const I = N.findIndex((U) => U.name === "unity-content-viewport"), A = N.findIndex((U) => U.name === "unity-content-container");
|
|
359
|
+
if (I === -1 || A === -1) continue;
|
|
360
|
+
const z = C[I].getComputedLayout(), M = C[A].getComputedLayout().height > z.height + 0.01, _ = Pt(M);
|
|
361
|
+
(R.get(T) ?? 0) !== _ && (R.set(T, _), C[I].setMargin(P.Right, _), k = !0);
|
|
199
362
|
}
|
|
363
|
+
if (!k) break;
|
|
364
|
+
E.calculateLayout(i.size.width, i.size.height, lt.LTR);
|
|
200
365
|
}
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
const
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
366
|
+
function D(p, k, T) {
|
|
367
|
+
const N = u.get(p);
|
|
368
|
+
if (N === void 0) return;
|
|
369
|
+
const C = N.getComputedLayout();
|
|
370
|
+
let I = k + C.left, A = T + C.top;
|
|
371
|
+
m.set(p.id, { left: I, top: A, width: C.width, height: C.height });
|
|
372
|
+
const z = g.get(p.id), j = r.get(p.id);
|
|
373
|
+
z !== void 0 && j !== void 0 && z.forEach((M, _) => {
|
|
374
|
+
const U = j[_].getComputedLayout();
|
|
375
|
+
I += U.left, A += U.top, M.box = { left: I, top: A, width: U.width, height: U.height };
|
|
376
|
+
});
|
|
377
|
+
for (const M of p.children) D(M, I, A);
|
|
378
|
+
}
|
|
379
|
+
return D(t, 0, 0), {
|
|
380
|
+
boxes: m,
|
|
381
|
+
parts: g,
|
|
382
|
+
painted: v,
|
|
383
|
+
warnings: s,
|
|
215
384
|
dispose() {
|
|
216
|
-
d || (d = !0,
|
|
385
|
+
d || (d = !0, E.freeRecursive(), G -= a, u.clear(), r.clear());
|
|
217
386
|
}
|
|
218
387
|
};
|
|
219
388
|
}
|
|
220
|
-
const
|
|
221
|
-
function
|
|
389
|
+
const ee = 1.2;
|
|
390
|
+
function ne(t) {
|
|
222
391
|
var e;
|
|
223
392
|
let n = null;
|
|
224
393
|
if (t !== void 0) {
|
|
225
394
|
const i = t.createElement("canvas");
|
|
226
395
|
n = ((e = i.getContext) == null ? void 0 : e.call(i, "2d")) ?? null;
|
|
227
396
|
}
|
|
228
|
-
return (i, l,
|
|
229
|
-
const
|
|
397
|
+
return (i, l, s) => {
|
|
398
|
+
const m = l.fontSize * ee, g = (o) => {
|
|
230
399
|
if (n === null)
|
|
231
|
-
return
|
|
232
|
-
const
|
|
233
|
-
return n.font = `${
|
|
400
|
+
return o.length * l.fontSize * 0.5;
|
|
401
|
+
const f = l.fontStyle.includes("bold") ? "bold" : "normal", w = l.fontStyle.includes("italic") ? "italic" : "normal";
|
|
402
|
+
return n.font = `${w} ${f} ${l.fontSize}px sans-serif`, n.measureText(o).width;
|
|
234
403
|
};
|
|
235
|
-
if (!(l.whiteSpace !== "nowrap" && l.whiteSpace !== "pre") ||
|
|
236
|
-
const
|
|
404
|
+
if (!(l.whiteSpace !== "nowrap" && l.whiteSpace !== "pre") || s <= 0) {
|
|
405
|
+
const o = i.split(`
|
|
237
406
|
`);
|
|
238
|
-
return { width:
|
|
407
|
+
return { width: o.reduce((w, c) => Math.max(w, g(c)), 0), height: o.length * m };
|
|
239
408
|
}
|
|
240
|
-
const
|
|
241
|
-
let
|
|
242
|
-
for (const
|
|
243
|
-
const
|
|
244
|
-
|
|
409
|
+
const u = i.split(/\s+/).filter((o) => o.length > 0);
|
|
410
|
+
let r = 1, a = 0, d = 0;
|
|
411
|
+
for (const o of u) {
|
|
412
|
+
const f = g(o), w = a === 0 ? 0 : g(" ");
|
|
413
|
+
a > 0 && a + w + f > s ? (d = Math.max(d, a), r++, a = f) : a += w + f;
|
|
245
414
|
}
|
|
246
|
-
return
|
|
415
|
+
return d = Math.max(d, a), { width: d, height: r * m };
|
|
247
416
|
};
|
|
248
417
|
}
|
|
249
|
-
|
|
418
|
+
function yt(t) {
|
|
419
|
+
const n = (e, i) => !Number.isInteger(e) || e < 0 || e > 1114111 || e >= 55296 && e <= 57343 ? i : String.fromCodePoint(e);
|
|
420
|
+
return t.replace(/&#x([0-9a-f]+);/gi, (e, i) => n(parseInt(i, 16), e)).replace(/&#(\d+);/g, (e, i) => n(Number(i), e)).replace(/</g, "<").replace(/>/g, ">").replace(/"/g, '"').replace(/'/g, "'").replace(/&/g, "&");
|
|
421
|
+
}
|
|
422
|
+
const ie = /* @__PURE__ */ new Set([
|
|
250
423
|
"box-shadow",
|
|
251
424
|
"filter",
|
|
252
425
|
"backdrop-filter",
|
|
@@ -262,7 +435,7 @@ const kt = /* @__PURE__ */ new Set([
|
|
|
262
435
|
"float",
|
|
263
436
|
"clear",
|
|
264
437
|
"border-style"
|
|
265
|
-
]),
|
|
438
|
+
]), se = /* @__PURE__ */ new Set([
|
|
266
439
|
"gap",
|
|
267
440
|
"row-gap",
|
|
268
441
|
"column-gap",
|
|
@@ -272,37 +445,41 @@ const kt = /* @__PURE__ */ new Set([
|
|
|
272
445
|
"background-repeat",
|
|
273
446
|
"overflow-wrap",
|
|
274
447
|
"word-break"
|
|
275
|
-
]),
|
|
448
|
+
]), pt = ["top", "right", "bottom", "left"], re = {
|
|
276
449
|
normal: { weight: "normal", style: "normal" },
|
|
277
450
|
bold: { weight: "bold", style: "normal" },
|
|
278
451
|
italic: { weight: "normal", style: "italic" },
|
|
279
452
|
"bold-and-italic": { weight: "bold", style: "italic" }
|
|
280
|
-
},
|
|
453
|
+
}, oe = {
|
|
281
454
|
upper: "flex-start",
|
|
282
455
|
middle: "center",
|
|
283
456
|
lower: "flex-end"
|
|
284
|
-
},
|
|
457
|
+
}, ae = {
|
|
285
458
|
left: "flex-start",
|
|
286
459
|
center: "center",
|
|
287
460
|
right: "flex-end"
|
|
288
|
-
}
|
|
289
|
-
|
|
461
|
+
}, Q = {
|
|
462
|
+
"stretch-to-fill": "100% 100%",
|
|
463
|
+
"scale-and-crop": "cover",
|
|
464
|
+
"scale-to-fit": "contain"
|
|
465
|
+
}, ht = "stretch-to-fill";
|
|
466
|
+
function le(t) {
|
|
290
467
|
const n = /^(?:url|resource)\(\s*(["']?)(.*?)\1\s*\)$/.exec(t.trim());
|
|
291
468
|
return n === null ? null : n[2];
|
|
292
469
|
}
|
|
293
|
-
function
|
|
294
|
-
var
|
|
295
|
-
const i = {}, l = [],
|
|
296
|
-
var
|
|
297
|
-
return (
|
|
298
|
-
},
|
|
299
|
-
l.push({ kind:
|
|
470
|
+
function mt(t, n, e = {}) {
|
|
471
|
+
var w;
|
|
472
|
+
const i = {}, l = [], s = (c) => {
|
|
473
|
+
var S;
|
|
474
|
+
return (S = t.get(c)) == null ? void 0 : S.value;
|
|
475
|
+
}, m = (c, S) => {
|
|
476
|
+
l.push({ kind: c, message: S, node: n });
|
|
300
477
|
};
|
|
301
478
|
i["box-sizing"] = "border-box";
|
|
302
|
-
for (const [
|
|
303
|
-
|
|
479
|
+
for (const [c] of t)
|
|
480
|
+
ie.has(c) ? m("unsupported-property", `${c} does not exist in USS and is ignored`) : se.has(c) && m(
|
|
304
481
|
"version-dependent",
|
|
305
|
-
`${
|
|
482
|
+
`${c} depends on the Unity version; verify it in your project`
|
|
306
483
|
);
|
|
307
484
|
const g = [
|
|
308
485
|
"background-color",
|
|
@@ -317,473 +494,445 @@ function Et(t, n, e = {}) {
|
|
|
317
494
|
"font-size",
|
|
318
495
|
"transform-origin"
|
|
319
496
|
];
|
|
320
|
-
for (const
|
|
321
|
-
const
|
|
322
|
-
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
for (const
|
|
326
|
-
const
|
|
327
|
-
if (
|
|
328
|
-
const { length:
|
|
329
|
-
|
|
497
|
+
for (const c of g) {
|
|
498
|
+
const S = s(c);
|
|
499
|
+
S !== void 0 && (i[c] = S);
|
|
500
|
+
}
|
|
501
|
+
s("display") === "none" && (i.display = "none"), s("overflow") === "hidden" && (i.overflow = "hidden");
|
|
502
|
+
for (const c of pt) {
|
|
503
|
+
const S = s(`border-${c}-width`);
|
|
504
|
+
if (S !== void 0 && S !== "0") {
|
|
505
|
+
const { length: y, problem: x } = Y(S);
|
|
506
|
+
y === null || y.kind !== "px" ? m(
|
|
330
507
|
"unsupported-property",
|
|
331
|
-
`border-${
|
|
332
|
-
) : (i[`border-${
|
|
508
|
+
`border-${c}-width: ${x ?? `"${S}" is not a pixel length`}; ignored`
|
|
509
|
+
) : (i[`border-${c}-width`] = `${y.value}px`, i[`border-${c}-style`] = "solid");
|
|
333
510
|
}
|
|
334
|
-
const
|
|
335
|
-
|
|
336
|
-
const
|
|
337
|
-
|
|
511
|
+
const h = s(`border-${c}-color`);
|
|
512
|
+
h !== void 0 && (i[`border-${c}-color`] = h);
|
|
513
|
+
const b = s(`padding-${c}`);
|
|
514
|
+
b !== void 0 && b !== "0" && (i[`padding-${c}`] = b);
|
|
338
515
|
}
|
|
339
|
-
for (const
|
|
516
|
+
for (const c of [
|
|
340
517
|
"top-left",
|
|
341
518
|
"top-right",
|
|
342
519
|
"bottom-right",
|
|
343
520
|
"bottom-left"
|
|
344
521
|
]) {
|
|
345
|
-
const
|
|
346
|
-
|
|
347
|
-
}
|
|
348
|
-
const
|
|
349
|
-
if (
|
|
350
|
-
const
|
|
351
|
-
|
|
352
|
-
}
|
|
353
|
-
const
|
|
354
|
-
if (
|
|
355
|
-
const [
|
|
356
|
-
|
|
357
|
-
}
|
|
358
|
-
const
|
|
359
|
-
|
|
360
|
-
const
|
|
361
|
-
|
|
362
|
-
const
|
|
363
|
-
|
|
364
|
-
const
|
|
365
|
-
if (
|
|
366
|
-
const
|
|
367
|
-
if (
|
|
368
|
-
|
|
522
|
+
const S = s(`border-${c}-radius`);
|
|
523
|
+
S !== void 0 && (i[`border-${c}-radius`] = S);
|
|
524
|
+
}
|
|
525
|
+
const v = s("-unity-font-style");
|
|
526
|
+
if (v !== void 0) {
|
|
527
|
+
const c = re[v];
|
|
528
|
+
c === void 0 ? m("unsupported-property", `-unity-font-style: ${v} is not a USS value`) : (i["font-weight"] = c.weight, i["font-style"] = c.style);
|
|
529
|
+
}
|
|
530
|
+
const u = s("-unity-text-align");
|
|
531
|
+
if (u !== void 0) {
|
|
532
|
+
const [c, S] = u.split("-"), h = oe[c ?? ""], b = ae[S ?? ""];
|
|
533
|
+
h === void 0 || b === void 0 ? m("unsupported-property", `-unity-text-align: ${u} is not a USS value`) : (i["align-items"] = h, i["justify-content"] = b);
|
|
534
|
+
}
|
|
535
|
+
const r = [], a = s("translate");
|
|
536
|
+
a !== void 0 && r.push(`translate(${a.replace(/\s+/, ", ")})`);
|
|
537
|
+
const d = s("rotate");
|
|
538
|
+
d !== void 0 && r.push(`rotate(${d})`);
|
|
539
|
+
const o = s("scale");
|
|
540
|
+
o !== void 0 && r.push(`scale(${o.replace(/\s+/, ", ")})`), r.length > 0 && (i.transform = r.join(" "));
|
|
541
|
+
const f = s("background-image");
|
|
542
|
+
if (f !== void 0 && f !== "none") {
|
|
543
|
+
const c = le(f);
|
|
544
|
+
if (c === null)
|
|
545
|
+
m("asset-unresolved", `background-image: cannot read "${f}" as an asset path`);
|
|
369
546
|
else {
|
|
370
|
-
const
|
|
371
|
-
|
|
547
|
+
const S = ((w = e.resolveAsset) == null ? void 0 : w.call(e, c)) ?? null;
|
|
548
|
+
if (S === null)
|
|
549
|
+
i["background-image"] = "repeating-linear-gradient(45deg, rgba(255,0,255,0.35) 0 6px, rgba(0,0,0,0) 6px 12px)", m("asset-unresolved", `background-image: "${c}" was not resolved`);
|
|
550
|
+
else {
|
|
551
|
+
i["background-image"] = `url("${S}")`, i["background-repeat"] = s("background-repeat") ?? "no-repeat", i["background-position"] = s("background-position") ?? "center";
|
|
552
|
+
const h = s("background-size"), b = s("-unity-background-scale-mode") ?? ht, y = Q[b];
|
|
553
|
+
y === void 0 && m(
|
|
554
|
+
"unsupported-property",
|
|
555
|
+
`-unity-background-scale-mode: ${b} is not a USS value; expected one of ${Object.keys(Q).join(", ")}`
|
|
556
|
+
), i["background-size"] = h ?? y ?? Q[ht];
|
|
557
|
+
}
|
|
372
558
|
}
|
|
373
559
|
}
|
|
374
|
-
return
|
|
560
|
+
return s("-unity-background-image-tint-color") !== void 0 && m(
|
|
375
561
|
"unsupported-property",
|
|
376
562
|
"-unity-background-image-tint-color has no CSS equivalent and is not drawn"
|
|
377
|
-
),
|
|
563
|
+
), pt.some((c) => s(`-unity-slice-${c}`) !== void 0) && m("unsupported-property", "-unity-slice-* (9-slice) is not drawn in this preview"), s("-unity-font-definition") !== void 0 && m(
|
|
378
564
|
"unsupported-property",
|
|
379
565
|
"-unity-font-definition names a Unity font asset; the browser default is used"
|
|
380
566
|
), { declarations: i, warnings: l };
|
|
381
567
|
}
|
|
382
|
-
const
|
|
383
|
-
function
|
|
384
|
-
const
|
|
385
|
-
function
|
|
386
|
-
const
|
|
387
|
-
var
|
|
388
|
-
const
|
|
568
|
+
const ce = "data-uxml-node", ue = "data-uxml-part", de = "data-uxml-part-owner";
|
|
569
|
+
function fe(t, n, e, i, l, s) {
|
|
570
|
+
const m = [], g = /* @__PURE__ */ new Map();
|
|
571
|
+
function v(d) {
|
|
572
|
+
const o = i.get(d.id), f = (w) => {
|
|
573
|
+
var h;
|
|
574
|
+
const c = ((h = o == null ? void 0 : o.get(w)) == null ? void 0 : h.value) ?? tt[w] ?? "0", { length: S } = Y(c);
|
|
389
575
|
return S !== null && S.kind === "px" ? S.value : 0;
|
|
390
576
|
};
|
|
391
|
-
return { left:
|
|
392
|
-
}
|
|
393
|
-
function
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
577
|
+
return { left: f("border-left-width"), top: f("border-top-width") };
|
|
578
|
+
}
|
|
579
|
+
function u(d) {
|
|
580
|
+
const o = (f) => {
|
|
581
|
+
var S;
|
|
582
|
+
const w = ((S = d.style.get(f)) == null ? void 0 : S.value) ?? tt[f] ?? "0", { length: c } = Y(w);
|
|
583
|
+
return c !== null && c.kind === "px" ? c.value : 0;
|
|
584
|
+
};
|
|
585
|
+
return { left: o("border-left-width"), top: o("border-top-width") };
|
|
586
|
+
}
|
|
587
|
+
function r(d, o, f) {
|
|
588
|
+
var E;
|
|
589
|
+
const w = n.get(d.id);
|
|
590
|
+
if (w === void 0) return null;
|
|
591
|
+
const c = s.document.createElement("div");
|
|
592
|
+
c.setAttribute(ce, String(d.id));
|
|
593
|
+
const S = i.get(d.id) ?? /* @__PURE__ */ new Map(), h = mt(S, d.id, s);
|
|
594
|
+
m.push(...h.warnings);
|
|
595
|
+
const b = o === null ? 0 : w.left - o.left - f.left, y = o === null ? 0 : w.top - o.top - f.top, x = {
|
|
402
596
|
position: "absolute",
|
|
403
|
-
left: `${
|
|
404
|
-
top: `${
|
|
405
|
-
width: `${
|
|
406
|
-
height: `${
|
|
597
|
+
left: `${b}px`,
|
|
598
|
+
top: `${y}px`,
|
|
599
|
+
width: `${w.width}px`,
|
|
600
|
+
height: `${w.height}px`,
|
|
407
601
|
margin: "0",
|
|
408
|
-
...
|
|
602
|
+
...h.declarations
|
|
409
603
|
};
|
|
410
|
-
for (const [
|
|
411
|
-
|
|
412
|
-
const
|
|
413
|
-
if (
|
|
414
|
-
|
|
604
|
+
for (const [R, D] of Object.entries(x))
|
|
605
|
+
c.style.setProperty(R, D);
|
|
606
|
+
const { spec: $ } = F(d), O = (E = d.attributes.find((R) => R.name === "text")) == null ? void 0 : E.value;
|
|
607
|
+
if ($.hasText && O !== void 0 && O.length > 0)
|
|
608
|
+
c.style.setProperty("display", h.declarations.display ?? "flex"), h.declarations["align-items"] === void 0 && c.style.setProperty("align-items", "flex-start"), h.declarations["justify-content"] === void 0 && c.style.setProperty("justify-content", "flex-start"), c.textContent = yt(O);
|
|
415
609
|
else {
|
|
416
|
-
|
|
417
|
-
for (const
|
|
418
|
-
const T =
|
|
419
|
-
T
|
|
610
|
+
let R = c, D = w, p = v(d);
|
|
611
|
+
for (const k of e.get(d.id) ?? []) {
|
|
612
|
+
const T = s.document.createElement("div");
|
|
613
|
+
T.setAttribute(ue, k.name), T.setAttribute(de, String(d.id));
|
|
614
|
+
const N = mt(k.style, d.id, s);
|
|
615
|
+
m.push(...N.warnings);
|
|
616
|
+
const C = {
|
|
617
|
+
position: "absolute",
|
|
618
|
+
left: `${k.box.left - D.left - p.left}px`,
|
|
619
|
+
top: `${k.box.top - D.top - p.top}px`,
|
|
620
|
+
width: `${k.box.width}px`,
|
|
621
|
+
height: `${k.box.height}px`,
|
|
622
|
+
margin: "0",
|
|
623
|
+
...N.declarations
|
|
624
|
+
};
|
|
625
|
+
for (const [I, A] of Object.entries(C))
|
|
626
|
+
T.style.setProperty(I, A);
|
|
627
|
+
R.appendChild(T), R = T, D = k.box, p = u(k);
|
|
628
|
+
}
|
|
629
|
+
for (const k of d.children) {
|
|
630
|
+
const T = r(k, D, p);
|
|
631
|
+
T !== null && R.appendChild(T);
|
|
420
632
|
}
|
|
421
633
|
}
|
|
422
|
-
return
|
|
634
|
+
return g.set(d.id, c), c;
|
|
423
635
|
}
|
|
424
|
-
|
|
425
|
-
const
|
|
426
|
-
return
|
|
427
|
-
}
|
|
428
|
-
function Ct(t) {
|
|
429
|
-
const n = (e, i) => !Number.isInteger(e) || e < 0 || e > 1114111 || e >= 55296 && e <= 57343 ? i : String.fromCodePoint(e);
|
|
430
|
-
return t.replace(/&#x([0-9a-f]+);/gi, (e, i) => n(parseInt(i, 16), e)).replace(/&#(\d+);/g, (e, i) => n(Number(i), e)).replace(/</g, "<").replace(/>/g, ">").replace(/"/g, '"').replace(/'/g, "'").replace(/&/g, "&");
|
|
636
|
+
l.replaceChildren();
|
|
637
|
+
const a = r(t, null, { left: 0, top: 0 });
|
|
638
|
+
return a !== null && (a.style.setProperty("position", "relative"), l.appendChild(a)), { warnings: m, elements: g };
|
|
431
639
|
}
|
|
432
|
-
const
|
|
433
|
-
function
|
|
640
|
+
const gt = /[A-Za-z0-9_-]/;
|
|
641
|
+
function B(t) {
|
|
434
642
|
return t === " " || t === " " || t === `
|
|
435
643
|
` || t === "\r" || t === "\f";
|
|
436
644
|
}
|
|
437
|
-
function
|
|
645
|
+
function et(t, n, e) {
|
|
438
646
|
let i = n, l = 0;
|
|
439
647
|
for (; i < t.length; ) {
|
|
440
|
-
const
|
|
441
|
-
if (
|
|
442
|
-
const
|
|
443
|
-
i =
|
|
648
|
+
const s = t[i];
|
|
649
|
+
if (s === '"' || s === "'") {
|
|
650
|
+
const m = t.indexOf(s, i + 1);
|
|
651
|
+
i = m < 0 ? t.length : m + 1;
|
|
444
652
|
continue;
|
|
445
653
|
}
|
|
446
|
-
if (
|
|
447
|
-
const
|
|
448
|
-
i =
|
|
654
|
+
if (s === "/" && t[i + 1] === "*") {
|
|
655
|
+
const m = t.indexOf("*/", i + 2);
|
|
656
|
+
i = m < 0 ? t.length : m + 2;
|
|
449
657
|
continue;
|
|
450
658
|
}
|
|
451
|
-
if (
|
|
659
|
+
if (s === "(" || s === "[")
|
|
452
660
|
l++;
|
|
453
|
-
else if (
|
|
661
|
+
else if (s === ")" || s === "]")
|
|
454
662
|
l > 0 && l--;
|
|
455
|
-
else if (l === 0 && e.includes(
|
|
663
|
+
else if (l === 0 && e.includes(s))
|
|
456
664
|
return i;
|
|
457
665
|
i++;
|
|
458
666
|
}
|
|
459
667
|
return t.length;
|
|
460
668
|
}
|
|
461
|
-
function
|
|
669
|
+
function kt(t, n, e) {
|
|
462
670
|
let i = n, l = e;
|
|
463
|
-
for (; i < l &&
|
|
464
|
-
for (; l > i &&
|
|
671
|
+
for (; i < l && B(t[i]); ) i++;
|
|
672
|
+
for (; l > i && B(t[l - 1]); ) l--;
|
|
465
673
|
return { start: i, end: l };
|
|
466
674
|
}
|
|
467
|
-
function
|
|
675
|
+
function St(t, n, e, i) {
|
|
468
676
|
const l = [];
|
|
469
|
-
let
|
|
470
|
-
for (;
|
|
471
|
-
for (;
|
|
472
|
-
if (t.startsWith("/*",
|
|
473
|
-
const
|
|
474
|
-
|
|
677
|
+
let s = n;
|
|
678
|
+
for (; s < e; ) {
|
|
679
|
+
for (; s < e && (B(t[s]) || t.startsWith("/*", s)); )
|
|
680
|
+
if (t.startsWith("/*", s)) {
|
|
681
|
+
const r = t.indexOf("*/", s + 2);
|
|
682
|
+
s = r < 0 ? e : r + 2;
|
|
475
683
|
} else
|
|
476
|
-
|
|
477
|
-
if (
|
|
478
|
-
if (t[
|
|
479
|
-
|
|
684
|
+
s++;
|
|
685
|
+
if (s >= e) break;
|
|
686
|
+
if (t[s] === ";") {
|
|
687
|
+
s++;
|
|
480
688
|
continue;
|
|
481
689
|
}
|
|
482
|
-
const
|
|
690
|
+
const m = s, g = et(t, m, ":;}");
|
|
483
691
|
if (g >= e || t[g] !== ":") {
|
|
484
|
-
const
|
|
485
|
-
i == null || i("declaration without a value",
|
|
692
|
+
const r = Math.min(g, e);
|
|
693
|
+
i == null || i("declaration without a value", m, r), s = r + 1;
|
|
486
694
|
continue;
|
|
487
695
|
}
|
|
488
|
-
const
|
|
696
|
+
const v = Math.min(et(t, g + 1, ";}"), e), u = kt(t, g + 1, v);
|
|
489
697
|
l.push({
|
|
490
|
-
property: t.slice(
|
|
491
|
-
value: t.slice(
|
|
492
|
-
span: { start:
|
|
698
|
+
property: t.slice(m, g).trim(),
|
|
699
|
+
value: t.slice(u.start, u.end),
|
|
700
|
+
span: { start: m, end: u.end },
|
|
493
701
|
dirty: !1
|
|
494
|
-
}),
|
|
702
|
+
}), s = v + 1;
|
|
495
703
|
}
|
|
496
704
|
return l;
|
|
497
705
|
}
|
|
498
|
-
function
|
|
706
|
+
function pe(t) {
|
|
499
707
|
const n = t.span.end - 1 - t.value.length;
|
|
500
708
|
return n < t.span.start ? null : n;
|
|
501
709
|
}
|
|
502
|
-
function
|
|
710
|
+
function rt(t, n = null, e = 0) {
|
|
503
711
|
const i = [], l = [];
|
|
504
|
-
let
|
|
505
|
-
function
|
|
712
|
+
let s = 0;
|
|
713
|
+
function m(h, b, y) {
|
|
506
714
|
i.push({
|
|
507
715
|
kind: "malformed",
|
|
508
|
-
message:
|
|
509
|
-
at: { in: "uss", sheet: e, span: { start:
|
|
716
|
+
message: h,
|
|
717
|
+
at: { in: "uss", sheet: e, span: { start: b, end: y } }
|
|
510
718
|
});
|
|
511
719
|
}
|
|
512
720
|
function g() {
|
|
513
721
|
for (; ; ) {
|
|
514
|
-
for (;
|
|
515
|
-
if (t.startsWith("/*",
|
|
516
|
-
const
|
|
517
|
-
|
|
722
|
+
for (; B(t[s]); ) s++;
|
|
723
|
+
if (t.startsWith("/*", s)) {
|
|
724
|
+
const h = t.indexOf("*/", s + 2);
|
|
725
|
+
s = h < 0 ? t.length : h + 2;
|
|
518
726
|
continue;
|
|
519
727
|
}
|
|
520
728
|
return;
|
|
521
729
|
}
|
|
522
730
|
}
|
|
523
|
-
const
|
|
524
|
-
function
|
|
525
|
-
let
|
|
526
|
-
for (;
|
|
527
|
-
const
|
|
528
|
-
if (
|
|
529
|
-
const
|
|
530
|
-
|
|
731
|
+
const v = (h, b) => et(t, h, b), u = (h, b) => kt(t, h, b);
|
|
732
|
+
function r(h) {
|
|
733
|
+
let b = h + 1, y = 1;
|
|
734
|
+
for (; b < t.length; ) {
|
|
735
|
+
const x = t[b];
|
|
736
|
+
if (x === '"' || x === "'") {
|
|
737
|
+
const $ = t.indexOf(x, b + 1);
|
|
738
|
+
b = $ < 0 ? t.length : $ + 1;
|
|
531
739
|
continue;
|
|
532
740
|
}
|
|
533
|
-
if (
|
|
534
|
-
const
|
|
535
|
-
|
|
741
|
+
if (x === "/" && t[b + 1] === "*") {
|
|
742
|
+
const $ = t.indexOf("*/", b + 2);
|
|
743
|
+
b = $ < 0 ? t.length : $ + 2;
|
|
536
744
|
continue;
|
|
537
745
|
}
|
|
538
|
-
if (
|
|
539
|
-
else if (
|
|
540
|
-
|
|
746
|
+
if (x === "{") y++;
|
|
747
|
+
else if (x === "}" && --y === 0) return b + 1;
|
|
748
|
+
b++;
|
|
541
749
|
}
|
|
542
750
|
return t.length;
|
|
543
751
|
}
|
|
544
|
-
function
|
|
545
|
-
let
|
|
546
|
-
for (;
|
|
547
|
-
return
|
|
548
|
-
}
|
|
549
|
-
function
|
|
550
|
-
const
|
|
551
|
-
let
|
|
552
|
-
for (;
|
|
553
|
-
const
|
|
554
|
-
if (
|
|
555
|
-
const
|
|
556
|
-
|
|
752
|
+
function a(h) {
|
|
753
|
+
let b = h;
|
|
754
|
+
for (; b < t.length && gt.test(t[b]); ) b++;
|
|
755
|
+
return b;
|
|
756
|
+
}
|
|
757
|
+
function d(h) {
|
|
758
|
+
const b = t[h], y = b === "(" ? ")" : "]";
|
|
759
|
+
let x = h + 1, $ = 1;
|
|
760
|
+
for (; x < t.length; ) {
|
|
761
|
+
const O = t[x];
|
|
762
|
+
if (O === '"' || O === "'") {
|
|
763
|
+
const E = t.indexOf(O, x + 1);
|
|
764
|
+
x = E < 0 ? t.length : E + 1;
|
|
557
765
|
continue;
|
|
558
766
|
}
|
|
559
|
-
if (
|
|
560
|
-
else if (
|
|
561
|
-
|
|
767
|
+
if (O === b) $++;
|
|
768
|
+
else if (O === y && --$ === 0) return x + 1;
|
|
769
|
+
x++;
|
|
562
770
|
}
|
|
563
771
|
return t.length;
|
|
564
772
|
}
|
|
565
|
-
function
|
|
566
|
-
const
|
|
567
|
-
let
|
|
568
|
-
for (;
|
|
569
|
-
const
|
|
570
|
-
if (
|
|
571
|
-
if (
|
|
572
|
-
|
|
573
|
-
else if (
|
|
574
|
-
const
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
),
|
|
578
|
-
} else if (
|
|
579
|
-
const
|
|
580
|
-
|
|
581
|
-
} else if (
|
|
582
|
-
if (t[
|
|
583
|
-
const
|
|
584
|
-
|
|
773
|
+
function o(h, b) {
|
|
774
|
+
const y = [];
|
|
775
|
+
let x = h;
|
|
776
|
+
for (; x < b; ) {
|
|
777
|
+
const $ = t[x];
|
|
778
|
+
if (B($) || $ === ">" || $ === "+" || $ === "~" || $ === ",") break;
|
|
779
|
+
if ($ === "*")
|
|
780
|
+
y.push({ kind: "universal" }), x++;
|
|
781
|
+
else if ($ === "." || $ === "#") {
|
|
782
|
+
const O = a(x + 1);
|
|
783
|
+
y.push(
|
|
784
|
+
$ === "." ? { kind: "class", name: t.slice(x + 1, O) } : { kind: "name", name: t.slice(x + 1, O) }
|
|
785
|
+
), x = O;
|
|
786
|
+
} else if ($ === "[") {
|
|
787
|
+
const O = Math.min(d(x), b);
|
|
788
|
+
y.push({ kind: "unknown", text: t.slice(x, O) }), x = O;
|
|
789
|
+
} else if ($ === ":")
|
|
790
|
+
if (t[x + 1] === ":") {
|
|
791
|
+
const O = a(x + 2);
|
|
792
|
+
y.push({ kind: "unknown", text: t.slice(x, O) }), x = O;
|
|
585
793
|
} else {
|
|
586
|
-
const
|
|
587
|
-
if (t[
|
|
588
|
-
const
|
|
589
|
-
|
|
794
|
+
const O = a(x + 1);
|
|
795
|
+
if (t[O] === "(") {
|
|
796
|
+
const E = Math.min(d(O), b);
|
|
797
|
+
y.push({ kind: "unknown", text: t.slice(x, E) }), x = E;
|
|
590
798
|
} else
|
|
591
|
-
|
|
799
|
+
y.push({ kind: "pseudo", name: t.slice(x + 1, O) }), x = O;
|
|
592
800
|
}
|
|
593
|
-
else if (
|
|
594
|
-
const
|
|
595
|
-
|
|
801
|
+
else if (gt.test($)) {
|
|
802
|
+
const O = a(x);
|
|
803
|
+
y.push({ kind: "type", name: t.slice(x, O) }), x = O;
|
|
596
804
|
} else
|
|
597
|
-
|
|
805
|
+
y.push({ kind: "unknown", text: $ }), x++;
|
|
598
806
|
}
|
|
599
|
-
return { simple:
|
|
600
|
-
}
|
|
601
|
-
function
|
|
602
|
-
const
|
|
603
|
-
let
|
|
604
|
-
for (;
|
|
605
|
-
const
|
|
606
|
-
if (
|
|
607
|
-
|
|
807
|
+
return { simple: y, next: x };
|
|
808
|
+
}
|
|
809
|
+
function f(h, b) {
|
|
810
|
+
const y = u(h, b), x = [];
|
|
811
|
+
let $ = "descendant", O = null, E = y.start;
|
|
812
|
+
for (; E < y.end; ) {
|
|
813
|
+
const R = t[E];
|
|
814
|
+
if (B(R)) {
|
|
815
|
+
E++;
|
|
608
816
|
continue;
|
|
609
817
|
}
|
|
610
|
-
if (
|
|
611
|
-
|
|
818
|
+
if (R === ">") {
|
|
819
|
+
$ = "child", E++;
|
|
612
820
|
continue;
|
|
613
821
|
}
|
|
614
|
-
if (
|
|
615
|
-
|
|
822
|
+
if (R === "+" || R === "~") {
|
|
823
|
+
O = R, E++;
|
|
616
824
|
continue;
|
|
617
825
|
}
|
|
618
|
-
const { simple:
|
|
619
|
-
if (
|
|
620
|
-
|
|
826
|
+
const { simple: D, next: p } = o(E, y.end);
|
|
827
|
+
if (p === E) {
|
|
828
|
+
E++;
|
|
621
829
|
continue;
|
|
622
830
|
}
|
|
623
|
-
|
|
831
|
+
O !== null && (D.unshift({ kind: "unknown", text: O }), O = null), x.push({ combinator: $, simple: D }), $ = "descendant", E = p;
|
|
624
832
|
}
|
|
625
|
-
return { parts:
|
|
833
|
+
return { parts: x, span: y };
|
|
626
834
|
}
|
|
627
|
-
function
|
|
628
|
-
const
|
|
629
|
-
let
|
|
835
|
+
function w(h, b) {
|
|
836
|
+
const y = [];
|
|
837
|
+
let x = h;
|
|
630
838
|
for (; ; ) {
|
|
631
|
-
const
|
|
632
|
-
if (
|
|
633
|
-
|
|
839
|
+
const $ = Math.min(v(x, ","), b);
|
|
840
|
+
if (y.push(f(x, $)), $ >= b) break;
|
|
841
|
+
x = $ + 1;
|
|
634
842
|
}
|
|
635
|
-
return
|
|
843
|
+
return y;
|
|
636
844
|
}
|
|
637
|
-
function
|
|
638
|
-
const
|
|
639
|
-
if (
|
|
640
|
-
const
|
|
641
|
-
return
|
|
845
|
+
function c() {
|
|
846
|
+
const h = s, b = a(s + 1), y = t.slice(s + 1, b), x = v(b, "{;");
|
|
847
|
+
if (x < t.length && t[x] === "{") {
|
|
848
|
+
const O = r(x);
|
|
849
|
+
return s = O, { kind: "unknown", span: { start: h, end: O } };
|
|
642
850
|
}
|
|
643
|
-
const
|
|
644
|
-
if (
|
|
645
|
-
const
|
|
646
|
-
return
|
|
851
|
+
const $ = x < t.length ? x + 1 : t.length;
|
|
852
|
+
if (s = $, y === "import") {
|
|
853
|
+
const O = t.slice(b, $), E = /["']([^"']*)["']/.exec(O);
|
|
854
|
+
return E === null ? (m("@import without a quoted path", h, $), { kind: "unknown", span: { start: h, end: $ } }) : { kind: "import", url: E[1], span: { start: h, end: $ } };
|
|
647
855
|
}
|
|
648
|
-
return { kind: "unknown", span: { start:
|
|
649
|
-
}
|
|
650
|
-
function
|
|
651
|
-
const
|
|
652
|
-
if (
|
|
653
|
-
return
|
|
654
|
-
const
|
|
655
|
-
(
|
|
656
|
-
const
|
|
657
|
-
selectors:
|
|
658
|
-
declarations:
|
|
659
|
-
span: { start:
|
|
660
|
-
selectorSpan:
|
|
856
|
+
return { kind: "unknown", span: { start: h, end: $ } };
|
|
857
|
+
}
|
|
858
|
+
function S() {
|
|
859
|
+
const h = s, b = v(h, "{");
|
|
860
|
+
if (b >= t.length)
|
|
861
|
+
return m("rule without a block", h, t.length), s = t.length, { kind: "unknown", span: { start: h, end: t.length } };
|
|
862
|
+
const y = u(h, b), x = r(b);
|
|
863
|
+
(x > t.length || t[x - 1] !== "}") && m("unterminated rule block", h, x);
|
|
864
|
+
const $ = {
|
|
865
|
+
selectors: w(y.start, y.end),
|
|
866
|
+
declarations: St(t, b + 1, x - 1, m),
|
|
867
|
+
span: { start: y.start, end: x },
|
|
868
|
+
selectorSpan: y,
|
|
661
869
|
selectorDirty: !1,
|
|
662
870
|
declarationsDirty: !1
|
|
663
871
|
};
|
|
664
|
-
return
|
|
872
|
+
return s = x, { kind: "rule", rule: $ };
|
|
665
873
|
}
|
|
666
|
-
for (; g(), !(
|
|
667
|
-
l.push(t[
|
|
874
|
+
for (; g(), !(s >= t.length); )
|
|
875
|
+
l.push(t[s] === "@" ? c() : S());
|
|
668
876
|
return { sheet: { source: t, origin: n, items: l }, warnings: i };
|
|
669
877
|
}
|
|
670
|
-
|
|
671
|
-
"color",
|
|
672
|
-
"font-size",
|
|
673
|
-
"letter-spacing",
|
|
674
|
-
"word-spacing",
|
|
675
|
-
"visibility",
|
|
676
|
-
"white-space",
|
|
677
|
-
"-unity-font",
|
|
678
|
-
"-unity-font-definition",
|
|
679
|
-
"-unity-font-style",
|
|
680
|
-
"-unity-paragraph-spacing",
|
|
681
|
-
"-unity-text-align",
|
|
682
|
-
"-unity-text-outline-color",
|
|
683
|
-
"-unity-text-outline-width"
|
|
684
|
-
]);
|
|
685
|
-
function zt(t) {
|
|
686
|
-
return t.startsWith("--") || At.has(t);
|
|
687
|
-
}
|
|
688
|
-
function G(t) {
|
|
689
|
-
const n = [];
|
|
690
|
-
let e = 0, i = -1;
|
|
691
|
-
for (let l = 0; l < t.length; l++) {
|
|
692
|
-
const r = t[l];
|
|
693
|
-
r === "(" ? e++ : r === ")" && (e = Math.max(0, e - 1)), e === 0 && /\s/.test(r) ? i >= 0 && (n.push(t.slice(i, l)), i = -1) : i < 0 && (i = l);
|
|
694
|
-
}
|
|
695
|
-
return i >= 0 && n.push(t.slice(i)), n;
|
|
696
|
-
}
|
|
697
|
-
function Rt(t) {
|
|
698
|
-
const [n, e, i, l] = t;
|
|
699
|
-
return n === void 0 ? null : e === void 0 ? [n, n, n, n] : i === void 0 ? [n, e, n, e] : l === void 0 ? [n, e, i, e] : [n, e, i, l];
|
|
700
|
-
}
|
|
701
|
-
const Ut = {
|
|
702
|
-
margin: ["margin-top", "margin-right", "margin-bottom", "margin-left"],
|
|
703
|
-
padding: ["padding-top", "padding-right", "padding-bottom", "padding-left"],
|
|
704
|
-
"border-width": [
|
|
705
|
-
"border-top-width",
|
|
706
|
-
"border-right-width",
|
|
707
|
-
"border-bottom-width",
|
|
708
|
-
"border-left-width"
|
|
709
|
-
],
|
|
710
|
-
"border-color": [
|
|
711
|
-
"border-top-color",
|
|
712
|
-
"border-right-color",
|
|
713
|
-
"border-bottom-color",
|
|
714
|
-
"border-left-color"
|
|
715
|
-
],
|
|
716
|
-
// Radii run clockwise from the top-left corner, not top/right/bottom/left.
|
|
717
|
-
"border-radius": [
|
|
718
|
-
"border-top-left-radius",
|
|
719
|
-
"border-top-right-radius",
|
|
720
|
-
"border-bottom-right-radius",
|
|
721
|
-
"border-bottom-left-radius"
|
|
722
|
-
]
|
|
723
|
-
};
|
|
724
|
-
function Y(t) {
|
|
725
|
-
return /^-?(\d+\.?\d*|\.\d+)$/.test(t);
|
|
726
|
-
}
|
|
727
|
-
function Wt(t) {
|
|
728
|
-
const [n, e, i] = t;
|
|
729
|
-
return n === void 0 ? [] : n === "none" ? [["flex-grow", "0"], ["flex-shrink", "0"], ["flex-basis", "auto"]] : n === "auto" ? [["flex-grow", "1"], ["flex-shrink", "1"], ["flex-basis", "auto"]] : e === void 0 ? Y(n) ? [["flex-grow", n], ["flex-shrink", "1"], ["flex-basis", "0"]] : [["flex-grow", "1"], ["flex-shrink", "1"], ["flex-basis", n]] : i === void 0 ? Y(e) ? [["flex-grow", n], ["flex-shrink", e], ["flex-basis", "0"]] : [["flex-grow", n], ["flex-shrink", "1"], ["flex-basis", e]] : [["flex-grow", n], ["flex-shrink", e], ["flex-basis", i]];
|
|
730
|
-
}
|
|
731
|
-
function Z(t, n) {
|
|
732
|
-
if (t === "flex") return Wt(G(n));
|
|
733
|
-
const e = Ut[t];
|
|
734
|
-
if (e === void 0) return [[t, n]];
|
|
735
|
-
const i = Rt(G(n));
|
|
736
|
-
return i === null ? [[t, n]] : e.map((l, r) => [l, i[r]]);
|
|
737
|
-
}
|
|
738
|
-
function Ft(t) {
|
|
739
|
-
var e;
|
|
740
|
-
const n = (e = t.attributes.find((i) => i.name === "class")) == null ? void 0 : e.value;
|
|
741
|
-
return n === void 0 ? [] : n.split(/\s+/).filter((i) => i.length > 0);
|
|
742
|
-
}
|
|
743
|
-
function Lt(t) {
|
|
744
|
-
var n;
|
|
745
|
-
return (n = t.attributes.find((e) => e.name === "name")) == null ? void 0 : n.value;
|
|
746
|
-
}
|
|
747
|
-
function jt(t, n, e) {
|
|
878
|
+
function he(t, n, e) {
|
|
748
879
|
switch (t.kind) {
|
|
749
880
|
case "universal":
|
|
750
881
|
return !0;
|
|
751
882
|
case "type":
|
|
752
|
-
return n
|
|
883
|
+
return e.typeNameOf(n) === t.name;
|
|
753
884
|
case "class":
|
|
754
|
-
return
|
|
885
|
+
return e.classesOf(n).includes(t.name);
|
|
755
886
|
case "name":
|
|
756
|
-
return
|
|
887
|
+
return e.idOf(n) === t.name;
|
|
757
888
|
case "pseudo":
|
|
758
|
-
return t.name === "root" ?
|
|
889
|
+
return t.name === "root" ? e.isRoot(n) : e.statesOf(n).has(t.name);
|
|
759
890
|
case "unknown":
|
|
760
891
|
return !1;
|
|
761
892
|
}
|
|
762
893
|
}
|
|
763
|
-
function
|
|
764
|
-
return t.simple.every((i) =>
|
|
894
|
+
function me(t, n, e) {
|
|
895
|
+
return t.simple.every((i) => he(i, n, e));
|
|
765
896
|
}
|
|
766
|
-
function
|
|
767
|
-
if (!
|
|
897
|
+
function nt(t, n, e, i) {
|
|
898
|
+
if (!me(t[n], e, i)) return !1;
|
|
768
899
|
if (n === 0) return !0;
|
|
769
900
|
const l = i.parentOf(e);
|
|
770
901
|
if (t[n].combinator === "child")
|
|
771
|
-
return l !== null &&
|
|
772
|
-
for (let
|
|
773
|
-
if (
|
|
902
|
+
return l !== null && nt(t, n - 1, l, i);
|
|
903
|
+
for (let s = l; s !== null; s = i.parentOf(s))
|
|
904
|
+
if (nt(t, n - 1, s, i)) return !0;
|
|
774
905
|
return !1;
|
|
775
906
|
}
|
|
776
|
-
function
|
|
777
|
-
return t.parts.length === 0 ? !1 :
|
|
907
|
+
function $t(t, n, e) {
|
|
908
|
+
return t.parts.length === 0 ? !1 : nt(t.parts, t.parts.length - 1, n, e);
|
|
909
|
+
}
|
|
910
|
+
function ge(t) {
|
|
911
|
+
const n = [];
|
|
912
|
+
for (const e of t.parts)
|
|
913
|
+
for (const i of e.simple)
|
|
914
|
+
i.kind === "pseudo" && i.name !== "root" && !n.includes(i.name) && n.push(i.name);
|
|
915
|
+
return n;
|
|
916
|
+
}
|
|
917
|
+
function we(t) {
|
|
918
|
+
const n = [];
|
|
919
|
+
for (const e of t)
|
|
920
|
+
for (const i of e.parts)
|
|
921
|
+
for (const l of i.simple) {
|
|
922
|
+
if (l.kind !== "name" && l.kind !== "class" || !l.name.startsWith("unity-")) continue;
|
|
923
|
+
const s = l.kind === "name" ? `#${l.name}` : `.${l.name}`;
|
|
924
|
+
n.includes(s) || n.push(s);
|
|
925
|
+
}
|
|
926
|
+
return n;
|
|
778
927
|
}
|
|
779
|
-
function
|
|
928
|
+
function Tt(t) {
|
|
780
929
|
for (const n of t)
|
|
781
930
|
for (const e of n.parts)
|
|
782
931
|
for (const i of e.simple)
|
|
783
932
|
if (i.kind === "unknown") return i.text;
|
|
784
933
|
return null;
|
|
785
934
|
}
|
|
786
|
-
function
|
|
935
|
+
function be(t) {
|
|
787
936
|
const n = /* @__PURE__ */ new Map([[t, null]]), e = [t];
|
|
788
937
|
for (; e.length > 0; ) {
|
|
789
938
|
const i = e.pop();
|
|
@@ -792,11 +941,11 @@ function Bt(t) {
|
|
|
792
941
|
}
|
|
793
942
|
return n;
|
|
794
943
|
}
|
|
795
|
-
function
|
|
944
|
+
function xe(t) {
|
|
796
945
|
let n = 0, e = 0, i = 0;
|
|
797
946
|
for (const l of t.parts)
|
|
798
|
-
for (const
|
|
799
|
-
switch (
|
|
947
|
+
for (const s of l.simple)
|
|
948
|
+
switch (s.kind) {
|
|
800
949
|
case "name":
|
|
801
950
|
n++;
|
|
802
951
|
break;
|
|
@@ -810,90 +959,197 @@ function qt(t) {
|
|
|
810
959
|
}
|
|
811
960
|
return [n, e, i];
|
|
812
961
|
}
|
|
813
|
-
function
|
|
962
|
+
function Ot(t, n) {
|
|
814
963
|
return t[0] - n[0] || t[1] - n[1] || t[2] - n[2];
|
|
815
964
|
}
|
|
816
|
-
const
|
|
817
|
-
|
|
965
|
+
const ve = [Number.MAX_SAFE_INTEGER, 0, 0], ye = rt(vt, null, -1).sheet.items.flatMap(
|
|
966
|
+
(t, n) => t.kind === "rule" ? [{ rule: t.rule, sheet: -1, item: n, builtin: !0 }] : []
|
|
967
|
+
);
|
|
968
|
+
function ke(t) {
|
|
969
|
+
return vt.slice(t.selectorSpan.start, t.selectorSpan.end).trim();
|
|
970
|
+
}
|
|
971
|
+
function Se(t, n, e, i) {
|
|
972
|
+
const l = (e == null ? void 0 : e.activeStates) ?? /* @__PURE__ */ new Set(), s = Object.entries((e == null ? void 0 : e.states) ?? {}), m = [];
|
|
973
|
+
for (const [r, a] of s) {
|
|
974
|
+
const d = rt(`${r} {}`, null, -1).sheet.items.find((f) => f.kind === "rule"), o = d === void 0 ? r : Tt(d.rule.selectors);
|
|
975
|
+
if (d === void 0 || o !== null) {
|
|
976
|
+
i.push({
|
|
977
|
+
kind: "unsupported-selector",
|
|
978
|
+
message: `states key "${r}" is not a usable USS selector; it is ignored`
|
|
979
|
+
});
|
|
980
|
+
continue;
|
|
981
|
+
}
|
|
982
|
+
m.push({ selectors: d.rule.selectors, states: a });
|
|
983
|
+
}
|
|
984
|
+
const g = /* @__PURE__ */ new Map(), v = (r) => r.attributes.some((a) => a.name === "enabled" && a.value === "false"), u = (r, a) => {
|
|
985
|
+
const d = a || v(r), o = new Set(l);
|
|
986
|
+
d && o.add("disabled");
|
|
987
|
+
for (const f of m)
|
|
988
|
+
if (f.selectors.some((w) => $t(w, { kind: "element", node: r }, n)))
|
|
989
|
+
for (const w of f.states) o.add(w);
|
|
990
|
+
g.set(r, o);
|
|
991
|
+
for (const f of r.children) u(f, d);
|
|
992
|
+
};
|
|
993
|
+
return u(t.root, !1), g;
|
|
994
|
+
}
|
|
995
|
+
function $e(t) {
|
|
818
996
|
const n = [], e = /* @__PURE__ */ new Map();
|
|
819
|
-
t.sheets.forEach((
|
|
820
|
-
|
|
821
|
-
});
|
|
822
|
-
const i = /* @__PURE__ */ new Set(), l = (
|
|
823
|
-
if (i.has(
|
|
824
|
-
i.add(
|
|
825
|
-
const
|
|
826
|
-
|
|
997
|
+
t.sheets.forEach((s, m) => {
|
|
998
|
+
s.origin !== null && !e.has(s.origin) && e.set(s.origin, m);
|
|
999
|
+
}), n.push(...ye);
|
|
1000
|
+
const i = /* @__PURE__ */ new Set(), l = (s) => {
|
|
1001
|
+
if (i.has(s)) return;
|
|
1002
|
+
i.add(s);
|
|
1003
|
+
const m = t.sheets[s];
|
|
1004
|
+
m !== void 0 && m.items.forEach((g, v) => {
|
|
827
1005
|
if (g.kind === "rule")
|
|
828
|
-
n.push({ rule: g.rule, sheet:
|
|
1006
|
+
n.push({ rule: g.rule, sheet: s, item: v });
|
|
829
1007
|
else if (g.kind === "import") {
|
|
830
|
-
const
|
|
831
|
-
|
|
1008
|
+
const u = e.get(g.url);
|
|
1009
|
+
u !== void 0 && l(u);
|
|
832
1010
|
}
|
|
833
1011
|
});
|
|
834
1012
|
};
|
|
835
1013
|
return l(0), n;
|
|
836
1014
|
}
|
|
837
|
-
function
|
|
1015
|
+
function Te(t) {
|
|
838
1016
|
return t.selectors.some(
|
|
839
1017
|
(n) => n.parts.some((e) => e.simple.some((i) => i.kind === "pseudo" && i.name === "root"))
|
|
840
1018
|
);
|
|
841
1019
|
}
|
|
842
|
-
function
|
|
843
|
-
const e =
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
},
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
1020
|
+
function Et(t, n) {
|
|
1021
|
+
const e = be(t.root), i = [], l = /* @__PURE__ */ new Set(), s = (o) => {
|
|
1022
|
+
var w;
|
|
1023
|
+
const f = (w = o.attributes.find((c) => c.name === "class")) == null ? void 0 : w.value;
|
|
1024
|
+
return f === void 0 ? [] : f.split(/\s+/).filter((c) => c.length > 0);
|
|
1025
|
+
}, m = (o, f) => {
|
|
1026
|
+
var w;
|
|
1027
|
+
return (w = o.attributes.find((c) => c.name === f)) == null ? void 0 : w.value;
|
|
1028
|
+
}, g = {
|
|
1029
|
+
/**
|
|
1030
|
+
* The rule the measurement forced.
|
|
1031
|
+
*
|
|
1032
|
+
* An element from the file gets its *file* parent, even when its layout
|
|
1033
|
+
* parent is a part — `#Grid > .slot` reaches a slot inside a ScrollView in
|
|
1034
|
+
* Unity, so parts are transparent here. Parts themselves follow the real
|
|
1035
|
+
* chain: each sits inside the one before it, and the outermost inside its
|
|
1036
|
+
* owner. That is the hierarchy the dumps show, so descendant selectors like
|
|
1037
|
+
* `.panel #unity-content-viewport` behave as they do in Unity.
|
|
1038
|
+
*/
|
|
1039
|
+
parentOf: (o) => {
|
|
1040
|
+
if (o.kind === "element") {
|
|
1041
|
+
const c = e.get(o.node) ?? null;
|
|
1042
|
+
return c === null ? null : { kind: "element", node: c };
|
|
1043
|
+
}
|
|
1044
|
+
if (o.depth === 0) return { kind: "element", node: o.owner };
|
|
1045
|
+
const w = F(o.owner).spec.parts[o.depth - 1];
|
|
1046
|
+
return { kind: "part", owner: o.owner, name: w.name, depth: o.depth - 1 };
|
|
1047
|
+
},
|
|
1048
|
+
isRoot: (o) => o.kind === "element" && o.node === t.root,
|
|
1049
|
+
// Unity's parts are VisualElements, so a `VisualElement` rule reaches them.
|
|
1050
|
+
// Not measured — `part-type-selector` is the case that will settle it.
|
|
1051
|
+
typeNameOf: (o) => o.kind === "element" ? o.node.name.local : "VisualElement",
|
|
1052
|
+
idOf: (o) => o.kind === "element" ? m(o.node, "name") : o.name,
|
|
1053
|
+
// Implicit classes are as real as written ones for matching: in Unity the
|
|
1054
|
+
// element genuinely carries them, which is why `.unity-button` in author USS
|
|
1055
|
+
// hits a plain `<ui:Button />`. Parts carry classes too in Unity, but which
|
|
1056
|
+
// ones is unmeasured, so none are claimed here.
|
|
1057
|
+
classesOf: (o) => o.kind === "element" ? [...s(o.node), ...Wt(o.node)] : []
|
|
1058
|
+
}, v = { ...g, statesOf: () => l }, u = Se(t, v, n, i), r = {
|
|
1059
|
+
...g,
|
|
1060
|
+
// A part inherits its owner's states: `SetEnabled(false)` disables the whole
|
|
1061
|
+
// subtree, and a part is inside it.
|
|
1062
|
+
statesOf: (o) => u.get(o.kind === "element" ? o.node : o.owner) ?? l
|
|
1063
|
+
}, a = [];
|
|
1064
|
+
let d = !1;
|
|
1065
|
+
for (const o of $e(t)) {
|
|
1066
|
+
if (o.builtin === !0) {
|
|
1067
|
+
a.push(o);
|
|
1068
|
+
continue;
|
|
1069
|
+
}
|
|
1070
|
+
const f = Tt(o.rule.selectors);
|
|
1071
|
+
if (f !== null) {
|
|
1072
|
+
i.push({
|
|
853
1073
|
kind: "unsupported-selector",
|
|
854
|
-
message: `"${
|
|
855
|
-
at: { in: "uss", sheet:
|
|
1074
|
+
message: `"${f}" is not supported in USS; the whole rule is ignored`,
|
|
1075
|
+
at: { in: "uss", sheet: o.sheet, span: o.rule.selectorSpan }
|
|
856
1076
|
});
|
|
857
1077
|
continue;
|
|
858
1078
|
}
|
|
859
|
-
!
|
|
1079
|
+
!d && Te(o.rule) && (d = !0, i.push({
|
|
860
1080
|
kind: "version-dependent",
|
|
861
1081
|
message: ":root in USS names the element the stylesheet was applied to, not the document root as in CSS. This preview matches it against the <ui:UXML> element; verify against your Unity version.",
|
|
862
|
-
at: { in: "uss", sheet:
|
|
863
|
-
})),
|
|
1082
|
+
at: { in: "uss", sheet: o.sheet, span: o.rule.selectorSpan }
|
|
1083
|
+
})), a.push(o);
|
|
864
1084
|
}
|
|
865
|
-
return { ctx:
|
|
1085
|
+
return { ctx: r, usable: a, warnings: i };
|
|
866
1086
|
}
|
|
867
|
-
function
|
|
1087
|
+
function Oe(t, n) {
|
|
868
1088
|
const e = n.attributes.find((l) => l.name === "style");
|
|
869
1089
|
if (e === void 0) return [];
|
|
870
|
-
const i =
|
|
871
|
-
return i === null ? [] :
|
|
1090
|
+
const i = pe(e);
|
|
1091
|
+
return i === null ? [] : St(t.source, i, i + e.value.length);
|
|
872
1092
|
}
|
|
873
|
-
function
|
|
874
|
-
const
|
|
875
|
-
let
|
|
876
|
-
const
|
|
877
|
-
|
|
1093
|
+
function Nt(t, n, e, i) {
|
|
1094
|
+
const l = [];
|
|
1095
|
+
let s = 0;
|
|
1096
|
+
const m = (g, v, u, r, a) => {
|
|
1097
|
+
l.push({ property: g, value: v, origin: u, rank: r, specificity: a, order: s++, winner: !1 });
|
|
878
1098
|
};
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
for (const
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
1099
|
+
if (n.kind === "part") {
|
|
1100
|
+
const g = F(n.owner).spec.parts[n.depth];
|
|
1101
|
+
for (const [v, u] of Object.entries((g == null ? void 0 : g.style) ?? {}))
|
|
1102
|
+
for (const [r, a] of J(v, u))
|
|
1103
|
+
m(
|
|
1104
|
+
r,
|
|
1105
|
+
a,
|
|
1106
|
+
{
|
|
1107
|
+
kind: "builtin-theme",
|
|
1108
|
+
selector: `#${n.name}`,
|
|
1109
|
+
property: r,
|
|
1110
|
+
unityVersion: X
|
|
1111
|
+
},
|
|
1112
|
+
0,
|
|
1113
|
+
[0, 0, 0]
|
|
1114
|
+
);
|
|
1115
|
+
}
|
|
1116
|
+
for (const g of e.usable) {
|
|
1117
|
+
let v = null, u = [];
|
|
1118
|
+
for (const r of g.rule.selectors) {
|
|
1119
|
+
if (!$t(r, n, e.ctx)) continue;
|
|
1120
|
+
const a = xe(r);
|
|
1121
|
+
(v === null || Ot(a, v) > 0) && (v = a, u = ge(r));
|
|
885
1122
|
}
|
|
886
|
-
|
|
887
|
-
for (const [
|
|
888
|
-
|
|
1123
|
+
v !== null && (i == null || i.add(g), g.rule.declarations.forEach((r, a) => {
|
|
1124
|
+
for (const [d, o] of J(r.property, r.value)) {
|
|
1125
|
+
const f = g.builtin === !0 ? {
|
|
1126
|
+
kind: "builtin-theme",
|
|
1127
|
+
selector: ke(g.rule),
|
|
1128
|
+
property: d,
|
|
1129
|
+
unityVersion: X
|
|
1130
|
+
} : {
|
|
1131
|
+
kind: "rule",
|
|
1132
|
+
sheet: g.sheet,
|
|
1133
|
+
item: g.item,
|
|
1134
|
+
declIndex: a,
|
|
1135
|
+
// Omitted rather than set to [] when unconditional, so the
|
|
1136
|
+
// common case stays the shape it has always been.
|
|
1137
|
+
...u.length > 0 ? { states: u } : {}
|
|
1138
|
+
};
|
|
1139
|
+
m(d, o, f, g.builtin === !0 ? 0 : 1, v);
|
|
1140
|
+
}
|
|
1141
|
+
}));
|
|
1142
|
+
}
|
|
1143
|
+
if (n.kind === "element") {
|
|
1144
|
+
const g = n.node;
|
|
1145
|
+
Oe(t, g).forEach((v, u) => {
|
|
1146
|
+
for (const [r, a] of J(v.property, v.value))
|
|
1147
|
+
m(r, a, { kind: "inline", node: g.id, declIndex: u }, 1, ve);
|
|
889
1148
|
});
|
|
890
1149
|
}
|
|
891
|
-
return
|
|
892
|
-
for (const [b, d] of Z(p.property, p.value))
|
|
893
|
-
r(b, d, { kind: "inline", node: n.id, declIndex: g }, Vt);
|
|
894
|
-
}), i;
|
|
1150
|
+
return l;
|
|
895
1151
|
}
|
|
896
|
-
function
|
|
1152
|
+
function Ct(t) {
|
|
897
1153
|
const n = /* @__PURE__ */ new Map();
|
|
898
1154
|
for (const e of t) {
|
|
899
1155
|
const i = n.get(e.property);
|
|
@@ -901,209 +1157,246 @@ function st(t) {
|
|
|
901
1157
|
n.set(e.property, e);
|
|
902
1158
|
continue;
|
|
903
1159
|
}
|
|
904
|
-
|
|
1160
|
+
if (e.rank !== i.rank) {
|
|
1161
|
+
e.rank > i.rank && n.set(e.property, e);
|
|
1162
|
+
continue;
|
|
1163
|
+
}
|
|
1164
|
+
const l = Ot(e.specificity, i.specificity);
|
|
905
1165
|
(l > 0 || l === 0 && e.order > i.order) && n.set(e.property, e);
|
|
906
1166
|
}
|
|
907
1167
|
for (const e of n.values()) e.winner = !0;
|
|
908
1168
|
return n;
|
|
909
1169
|
}
|
|
910
|
-
const
|
|
911
|
-
function
|
|
1170
|
+
const Ee = /var\(\s*(--[^,)\s]+)\s*(?:,([^)]*))?\)/;
|
|
1171
|
+
function it(t, n, e = /* @__PURE__ */ new Set()) {
|
|
912
1172
|
var l;
|
|
913
1173
|
let i = t;
|
|
914
|
-
for (let
|
|
915
|
-
const
|
|
916
|
-
if (
|
|
917
|
-
const g =
|
|
1174
|
+
for (let s = 0; s < 32; s++) {
|
|
1175
|
+
const m = Ee.exec(i);
|
|
1176
|
+
if (m === null) return i;
|
|
1177
|
+
const g = m[1], v = (l = m[2]) == null ? void 0 : l.trim();
|
|
918
1178
|
if (e.has(g)) return null;
|
|
919
|
-
const
|
|
920
|
-
if (
|
|
921
|
-
i = i.slice(0,
|
|
1179
|
+
const u = /* @__PURE__ */ new Set([...e, g]), r = n.get(g), a = r !== void 0 ? it(r, n, u) : v !== void 0 && v.length > 0 ? it(v, n, u) : null;
|
|
1180
|
+
if (a === null) return null;
|
|
1181
|
+
i = i.slice(0, m.index) + a + i.slice(m.index + m[0].length);
|
|
922
1182
|
}
|
|
923
1183
|
return null;
|
|
924
1184
|
}
|
|
925
|
-
function
|
|
926
|
-
const e =
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
const
|
|
933
|
-
|
|
934
|
-
for (const [
|
|
935
|
-
|
|
936
|
-
|
|
1185
|
+
function Ne(t, n) {
|
|
1186
|
+
const e = Et(t, n), i = [...e.warnings], l = /* @__PURE__ */ new Map();
|
|
1187
|
+
let s = !1;
|
|
1188
|
+
const m = /* @__PURE__ */ new Map(), g = /* @__PURE__ */ new Set(), v = (r, a, d) => {
|
|
1189
|
+
const o = Nt(t, r, e, g);
|
|
1190
|
+
!s && o.some((h) => h.origin.kind === "builtin-theme") && (s = !0);
|
|
1191
|
+
const f = Ct(o), w = /* @__PURE__ */ new Map();
|
|
1192
|
+
for (const [h, b] of a)
|
|
1193
|
+
h.startsWith("--") && w.set(h, b.value);
|
|
1194
|
+
for (const [h, b] of f)
|
|
1195
|
+
h.startsWith("--") && w.set(h, b.value);
|
|
1196
|
+
const c = /* @__PURE__ */ new Map();
|
|
1197
|
+
for (const [h, b] of a) c.set(h, b);
|
|
1198
|
+
for (const [h, b] of f) {
|
|
1199
|
+
const y = it(b.value, w);
|
|
1200
|
+
if (y === null) {
|
|
937
1201
|
i.push({
|
|
938
1202
|
kind: "unsupported-property",
|
|
939
|
-
message: `${
|
|
940
|
-
node:
|
|
1203
|
+
message: `${h}: var() reference could not be resolved; declaration dropped`,
|
|
1204
|
+
node: d
|
|
941
1205
|
});
|
|
942
1206
|
continue;
|
|
943
1207
|
}
|
|
944
|
-
|
|
1208
|
+
c.set(h, { value: y, origin: b.origin });
|
|
945
1209
|
}
|
|
946
|
-
|
|
947
|
-
const
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
origin: { kind: "inherited", from: p.id, origin: f.origin }
|
|
1210
|
+
const S = /* @__PURE__ */ new Map();
|
|
1211
|
+
for (const [h, b] of c)
|
|
1212
|
+
Vt(h) && S.set(h, {
|
|
1213
|
+
value: b.value,
|
|
1214
|
+
origin: { kind: "inherited", from: d, origin: b.origin }
|
|
952
1215
|
});
|
|
953
|
-
|
|
1216
|
+
return { computed: c, forChildren: S };
|
|
1217
|
+
}, u = (r, a) => {
|
|
1218
|
+
const d = v({ kind: "element", node: r }, a, r.id);
|
|
1219
|
+
l.set(r.id, d.computed);
|
|
1220
|
+
let o = d.forChildren;
|
|
1221
|
+
const f = F(r).spec.parts;
|
|
1222
|
+
if (f.length > 0) {
|
|
1223
|
+
const w = /* @__PURE__ */ new Map();
|
|
1224
|
+
f.forEach((c, S) => {
|
|
1225
|
+
const h = v(
|
|
1226
|
+
{ kind: "part", owner: r, name: c.name, depth: S },
|
|
1227
|
+
o,
|
|
1228
|
+
r.id
|
|
1229
|
+
);
|
|
1230
|
+
w.set(c.name, h.computed), o = h.forChildren;
|
|
1231
|
+
}), m.set(r.id, w);
|
|
1232
|
+
}
|
|
1233
|
+
for (const w of r.children) u(w, o);
|
|
954
1234
|
};
|
|
955
|
-
|
|
1235
|
+
u(t.root, /* @__PURE__ */ new Map()), s && i.push({
|
|
1236
|
+
kind: "version-dependent",
|
|
1237
|
+
message: `Unity's control defaults were applied, as measured on ${X} (Unity ships these as a theme stylesheet). Other versions may use different values; see src/controls/theme.ts.`
|
|
1238
|
+
});
|
|
1239
|
+
for (const r of e.usable) {
|
|
1240
|
+
if (r.builtin === !0 || g.has(r)) continue;
|
|
1241
|
+
const a = we(r.rule.selectors);
|
|
1242
|
+
a.length !== 0 && i.push({
|
|
1243
|
+
kind: "unsupported-selector",
|
|
1244
|
+
message: `${a.join(", ")} matched nothing. Those names belong to the elements a control builds for itself, and only controls with a renderer of their own have them — ${Bt().join(", ")}. Anything else is drawn as a plain box and has no parts to style.`,
|
|
1245
|
+
at: { in: "uss", sheet: r.sheet, span: r.rule.selectorSpan }
|
|
1246
|
+
});
|
|
1247
|
+
}
|
|
1248
|
+
return { styles: l, partStyles: m, warnings: i };
|
|
956
1249
|
}
|
|
957
|
-
function
|
|
958
|
-
const l =
|
|
959
|
-
(
|
|
1250
|
+
function _e(t, n, e, i) {
|
|
1251
|
+
const l = Et(t, i), s = Nt(t, { kind: "element", node: n }, l).filter(
|
|
1252
|
+
(m) => m.property === e
|
|
960
1253
|
);
|
|
961
|
-
return
|
|
1254
|
+
return Ct(s), s;
|
|
962
1255
|
}
|
|
963
|
-
function
|
|
1256
|
+
function wt(t) {
|
|
964
1257
|
return t !== void 0 && /[A-Za-z0-9_.:-]/.test(t);
|
|
965
1258
|
}
|
|
966
|
-
function
|
|
1259
|
+
function bt(t) {
|
|
967
1260
|
return t !== void 0 && /[A-Za-z_]/.test(t);
|
|
968
1261
|
}
|
|
969
|
-
function
|
|
1262
|
+
function Ce(t) {
|
|
970
1263
|
return t === " " || t === " " || t === `
|
|
971
1264
|
` || t === "\r";
|
|
972
1265
|
}
|
|
973
|
-
function
|
|
1266
|
+
function Ie(t) {
|
|
974
1267
|
const n = [];
|
|
975
1268
|
let e = 0, i = 0;
|
|
976
1269
|
const l = () => i++;
|
|
977
|
-
function
|
|
1270
|
+
function s(a, d, o) {
|
|
978
1271
|
n.push({
|
|
979
1272
|
kind: "malformed",
|
|
980
|
-
message:
|
|
981
|
-
at: { in: "uxml", span: { start:
|
|
1273
|
+
message: a,
|
|
1274
|
+
at: { in: "uxml", span: { start: d, end: o } }
|
|
982
1275
|
});
|
|
983
1276
|
}
|
|
984
|
-
function
|
|
985
|
-
for (;
|
|
1277
|
+
function m() {
|
|
1278
|
+
for (; Ce(t[e]); ) e++;
|
|
986
1279
|
}
|
|
987
1280
|
function g() {
|
|
988
1281
|
for (; ; ) {
|
|
989
|
-
const
|
|
990
|
-
if (
|
|
1282
|
+
const a = t.indexOf("<", e);
|
|
1283
|
+
if (a < 0) {
|
|
991
1284
|
e = t.length;
|
|
992
1285
|
return;
|
|
993
1286
|
}
|
|
994
|
-
const
|
|
995
|
-
if (
|
|
996
|
-
if (t.startsWith("<!--",
|
|
997
|
-
const
|
|
998
|
-
e =
|
|
999
|
-
} else if (t.startsWith("<![CDATA[",
|
|
1000
|
-
const
|
|
1001
|
-
e =
|
|
1287
|
+
const d = t[a + 1];
|
|
1288
|
+
if (d === "!") {
|
|
1289
|
+
if (t.startsWith("<!--", a)) {
|
|
1290
|
+
const o = t.indexOf("-->", a + 4);
|
|
1291
|
+
e = o < 0 ? t.length : o + 3;
|
|
1292
|
+
} else if (t.startsWith("<![CDATA[", a)) {
|
|
1293
|
+
const o = t.indexOf("]]>", a + 9);
|
|
1294
|
+
e = o < 0 ? t.length : o + 3;
|
|
1002
1295
|
} else {
|
|
1003
|
-
const
|
|
1004
|
-
e =
|
|
1296
|
+
const o = t.indexOf(">", a);
|
|
1297
|
+
e = o < 0 ? t.length : o + 1;
|
|
1005
1298
|
}
|
|
1006
1299
|
continue;
|
|
1007
1300
|
}
|
|
1008
|
-
if (
|
|
1009
|
-
const
|
|
1010
|
-
e =
|
|
1301
|
+
if (d === "?") {
|
|
1302
|
+
const o = t.indexOf("?>", a + 2);
|
|
1303
|
+
e = o < 0 ? t.length : o + 2;
|
|
1011
1304
|
continue;
|
|
1012
1305
|
}
|
|
1013
|
-
e =
|
|
1306
|
+
e = a;
|
|
1014
1307
|
return;
|
|
1015
1308
|
}
|
|
1016
1309
|
}
|
|
1017
|
-
function
|
|
1018
|
-
const
|
|
1019
|
-
for (;
|
|
1020
|
-
const
|
|
1021
|
-
return
|
|
1022
|
-
}
|
|
1023
|
-
function
|
|
1024
|
-
const
|
|
1025
|
-
for (;
|
|
1026
|
-
if (e ===
|
|
1027
|
-
const
|
|
1028
|
-
if (
|
|
1029
|
-
return e =
|
|
1030
|
-
e++,
|
|
1031
|
-
const
|
|
1032
|
-
if (
|
|
1033
|
-
return
|
|
1310
|
+
function v() {
|
|
1311
|
+
const a = e;
|
|
1312
|
+
for (; wt(t[e]); ) e++;
|
|
1313
|
+
const d = t.slice(a, e), o = d.indexOf(":");
|
|
1314
|
+
return o < 0 ? { prefix: null, local: d } : { prefix: d.slice(0, o), local: d.slice(o + 1) };
|
|
1315
|
+
}
|
|
1316
|
+
function u() {
|
|
1317
|
+
const a = e;
|
|
1318
|
+
for (; wt(t[e]); ) e++;
|
|
1319
|
+
if (e === a) return null;
|
|
1320
|
+
const d = t.slice(a, e), o = e;
|
|
1321
|
+
if (m(), t[e] !== "=")
|
|
1322
|
+
return e = o, s(`attribute "${d}" has no value`, a, o), { name: d, value: "", span: { start: a, end: o } };
|
|
1323
|
+
e++, m();
|
|
1324
|
+
const f = t[e];
|
|
1325
|
+
if (f !== '"' && f !== "'")
|
|
1326
|
+
return s(`attribute "${d}" has an unquoted value`, a, e), { name: d, value: "", span: { start: a, end: e } };
|
|
1034
1327
|
e++;
|
|
1035
|
-
const
|
|
1036
|
-
return
|
|
1328
|
+
const w = e, c = t.indexOf(f, e);
|
|
1329
|
+
return c < 0 ? (s(`attribute "${d}" has an unterminated value`, a, t.length), e = t.length, { name: d, value: t.slice(w), span: { start: a, end: e } }) : (e = c + 1, { name: d, value: t.slice(w, c), span: { start: a, end: e } });
|
|
1037
1330
|
}
|
|
1038
|
-
function
|
|
1039
|
-
const
|
|
1331
|
+
function r() {
|
|
1332
|
+
const a = e;
|
|
1040
1333
|
e++;
|
|
1041
|
-
const
|
|
1042
|
-
let
|
|
1334
|
+
const d = v(), o = [];
|
|
1335
|
+
let f = !1;
|
|
1043
1336
|
for (; ; ) {
|
|
1044
|
-
|
|
1045
|
-
const
|
|
1046
|
-
if (
|
|
1047
|
-
|
|
1337
|
+
m();
|
|
1338
|
+
const y = t[e];
|
|
1339
|
+
if (y === void 0) {
|
|
1340
|
+
s("unterminated open tag", a, t.length);
|
|
1048
1341
|
break;
|
|
1049
1342
|
}
|
|
1050
|
-
if (
|
|
1343
|
+
if (y === ">") {
|
|
1051
1344
|
e++;
|
|
1052
1345
|
break;
|
|
1053
1346
|
}
|
|
1054
|
-
if (
|
|
1055
|
-
e += 2,
|
|
1347
|
+
if (y === "/" && t[e + 1] === ">") {
|
|
1348
|
+
e += 2, f = !0;
|
|
1056
1349
|
break;
|
|
1057
1350
|
}
|
|
1058
|
-
const
|
|
1059
|
-
if (
|
|
1351
|
+
const x = u();
|
|
1352
|
+
if (x === null) {
|
|
1060
1353
|
e++;
|
|
1061
1354
|
continue;
|
|
1062
1355
|
}
|
|
1063
|
-
|
|
1356
|
+
o.push(x);
|
|
1064
1357
|
}
|
|
1065
|
-
const
|
|
1066
|
-
if (
|
|
1358
|
+
const w = { start: a, end: e };
|
|
1359
|
+
if (f)
|
|
1067
1360
|
return {
|
|
1068
1361
|
id: l(),
|
|
1069
|
-
name:
|
|
1070
|
-
attributes:
|
|
1362
|
+
name: d,
|
|
1363
|
+
attributes: o,
|
|
1071
1364
|
children: [],
|
|
1072
|
-
spans: { openTag:
|
|
1365
|
+
spans: { openTag: w, inner: { start: e, end: e }, closeTag: null },
|
|
1073
1366
|
tagDirty: !1,
|
|
1074
1367
|
childrenDirty: !1
|
|
1075
1368
|
};
|
|
1076
|
-
const
|
|
1369
|
+
const c = e, S = [];
|
|
1077
1370
|
for (; ; ) {
|
|
1078
1371
|
if (g(), e >= t.length) {
|
|
1079
|
-
|
|
1372
|
+
s(`unterminated element <${It(d)}>`, a, t.length);
|
|
1080
1373
|
break;
|
|
1081
1374
|
}
|
|
1082
|
-
const
|
|
1083
|
-
if (
|
|
1084
|
-
if (!
|
|
1375
|
+
const y = t[e + 1];
|
|
1376
|
+
if (y === "/") break;
|
|
1377
|
+
if (!bt(y)) {
|
|
1085
1378
|
e++;
|
|
1086
1379
|
continue;
|
|
1087
1380
|
}
|
|
1088
|
-
|
|
1381
|
+
S.push(r());
|
|
1089
1382
|
}
|
|
1090
|
-
const
|
|
1091
|
-
let
|
|
1383
|
+
const h = e;
|
|
1384
|
+
let b = null;
|
|
1092
1385
|
if (t.startsWith("</", e)) {
|
|
1093
|
-
const
|
|
1094
|
-
|
|
1386
|
+
const y = t.indexOf(">", e), x = y < 0 ? t.length : y + 1;
|
|
1387
|
+
y < 0 && s("unterminated end tag", e, x), b = { start: e, end: x }, e = x;
|
|
1095
1388
|
}
|
|
1096
1389
|
return {
|
|
1097
1390
|
id: l(),
|
|
1098
|
-
name:
|
|
1099
|
-
attributes:
|
|
1100
|
-
children:
|
|
1101
|
-
spans: { openTag:
|
|
1391
|
+
name: d,
|
|
1392
|
+
attributes: o,
|
|
1393
|
+
children: S,
|
|
1394
|
+
spans: { openTag: w, inner: { start: c, end: h }, closeTag: b },
|
|
1102
1395
|
tagDirty: !1,
|
|
1103
1396
|
childrenDirty: !1
|
|
1104
1397
|
};
|
|
1105
1398
|
}
|
|
1106
|
-
return g(), e < t.length &&
|
|
1399
|
+
return g(), e < t.length && bt(t[e + 1]) ? { root: r(), warnings: n } : (s("no root element", 0, 0), {
|
|
1107
1400
|
root: {
|
|
1108
1401
|
id: l(),
|
|
1109
1402
|
name: { prefix: null, local: "" },
|
|
@@ -1116,177 +1409,201 @@ function Qt(t) {
|
|
|
1116
1409
|
warnings: n
|
|
1117
1410
|
});
|
|
1118
1411
|
}
|
|
1119
|
-
function
|
|
1412
|
+
function It(t) {
|
|
1120
1413
|
return t.prefix === null ? t.local : `${t.prefix}:${t.local}`;
|
|
1121
1414
|
}
|
|
1122
|
-
function
|
|
1123
|
-
const e = (
|
|
1124
|
-
function i(
|
|
1125
|
-
return
|
|
1126
|
-
}
|
|
1127
|
-
function l(
|
|
1128
|
-
return
|
|
1129
|
-
}
|
|
1130
|
-
function
|
|
1131
|
-
const
|
|
1132
|
-
return
|
|
1133
|
-
}
|
|
1134
|
-
function
|
|
1135
|
-
var
|
|
1136
|
-
const
|
|
1137
|
-
return { between:
|
|
1138
|
-
}
|
|
1139
|
-
function g(
|
|
1140
|
-
const { inner:
|
|
1141
|
-
if (
|
|
1142
|
-
if (
|
|
1143
|
-
const { between:
|
|
1144
|
-
return
|
|
1415
|
+
function Ae(t, n) {
|
|
1416
|
+
const e = (u) => t.slice(u.start, u.end);
|
|
1417
|
+
function i(u) {
|
|
1418
|
+
return u.spans.closeTag !== null ? u.spans.closeTag.end : Math.max(u.spans.openTag.end, u.spans.inner.end);
|
|
1419
|
+
}
|
|
1420
|
+
function l(u) {
|
|
1421
|
+
return u.includes('"') ? u.includes("'") ? `"${u.replace(/"/g, """)}"` : `'${u}'` : `"${u}"`;
|
|
1422
|
+
}
|
|
1423
|
+
function s(u) {
|
|
1424
|
+
const r = u.attributes.map((d) => ` ${d.name}=${l(d.value)}`).join(""), a = It(u.name);
|
|
1425
|
+
return u.spans.closeTag === null ? `<${a}${r} />` : `<${a}${r}>`;
|
|
1426
|
+
}
|
|
1427
|
+
function m(u) {
|
|
1428
|
+
var o, f;
|
|
1429
|
+
const r = e(u.spans.inner), a = ((o = /^[ \t]*\r?\n[ \t]*/.exec(r)) == null ? void 0 : o[0]) ?? "", d = ((f = /\r?\n[ \t]*$/.exec(r)) == null ? void 0 : f[0]) ?? "";
|
|
1430
|
+
return { between: a, before: a, after: d };
|
|
1431
|
+
}
|
|
1432
|
+
function g(u) {
|
|
1433
|
+
const { inner: r } = u.spans;
|
|
1434
|
+
if (u.children.length === 0) return e(r);
|
|
1435
|
+
if (u.childrenDirty) {
|
|
1436
|
+
const { between: o, before: f, after: w } = m(u);
|
|
1437
|
+
return f + u.children.map(v).join(o) + w;
|
|
1145
1438
|
}
|
|
1146
|
-
let
|
|
1147
|
-
for (const
|
|
1148
|
-
|
|
1149
|
-
return
|
|
1439
|
+
let a = "", d = r.start;
|
|
1440
|
+
for (const o of u.children)
|
|
1441
|
+
a += t.slice(d, o.spans.openTag.start), a += v(o), d = i(o);
|
|
1442
|
+
return a + t.slice(d, r.end);
|
|
1150
1443
|
}
|
|
1151
|
-
function
|
|
1152
|
-
const
|
|
1153
|
-
return
|
|
1444
|
+
function v(u) {
|
|
1445
|
+
const r = u.tagDirty ? s(u) : e(u.spans.openTag), a = u.spans.closeTag === null ? "" : e(u.spans.closeTag);
|
|
1446
|
+
return r + g(u) + a;
|
|
1154
1447
|
}
|
|
1155
|
-
return t.slice(0, n.spans.openTag.start) +
|
|
1448
|
+
return t.slice(0, n.spans.openTag.start) + v(n) + t.slice(i(n));
|
|
1156
1449
|
}
|
|
1157
|
-
function
|
|
1158
|
-
const n = t.source, e = (
|
|
1159
|
-
function i(
|
|
1160
|
-
return
|
|
1161
|
-
const
|
|
1162
|
-
switch (
|
|
1450
|
+
function Me(t) {
|
|
1451
|
+
const n = t.source, e = (r) => n.slice(r.start, r.end);
|
|
1452
|
+
function i(r) {
|
|
1453
|
+
return r.parts.map((a, d) => {
|
|
1454
|
+
const o = d === 0 ? "" : a.combinator === "child" ? " > " : " ", f = a.simple.map((w) => {
|
|
1455
|
+
switch (w.kind) {
|
|
1163
1456
|
case "universal":
|
|
1164
1457
|
return "*";
|
|
1165
1458
|
case "type":
|
|
1166
|
-
return
|
|
1459
|
+
return w.name;
|
|
1167
1460
|
case "class":
|
|
1168
|
-
return `.${
|
|
1461
|
+
return `.${w.name}`;
|
|
1169
1462
|
case "name":
|
|
1170
|
-
return `#${
|
|
1463
|
+
return `#${w.name}`;
|
|
1171
1464
|
case "pseudo":
|
|
1172
|
-
return `:${
|
|
1465
|
+
return `:${w.name}`;
|
|
1173
1466
|
case "unknown":
|
|
1174
|
-
return
|
|
1467
|
+
return w.text;
|
|
1175
1468
|
}
|
|
1176
1469
|
}).join("");
|
|
1177
|
-
return
|
|
1470
|
+
return o + f;
|
|
1178
1471
|
}).join("");
|
|
1179
1472
|
}
|
|
1180
|
-
function l(
|
|
1181
|
-
var
|
|
1182
|
-
const
|
|
1183
|
-
if (
|
|
1184
|
-
const
|
|
1185
|
-
`,
|
|
1186
|
-
return { between: `;${
|
|
1187
|
-
}
|
|
1188
|
-
function r
|
|
1189
|
-
const
|
|
1190
|
-
if (
|
|
1191
|
-
return
|
|
1192
|
-
const
|
|
1193
|
-
if (
|
|
1194
|
-
const { between:
|
|
1195
|
-
return `${
|
|
1473
|
+
function l(r) {
|
|
1474
|
+
var c, S;
|
|
1475
|
+
const a = r.declarations[0];
|
|
1476
|
+
if (a === void 0) return { between: "", before: "", after: "" };
|
|
1477
|
+
const d = n.lastIndexOf(`
|
|
1478
|
+
`, a.span.start), o = d < 0 ? "" : n.slice(d, a.span.start), f = n.slice(r.selectorSpan.end, r.span.end), w = ((S = (c = /\r?\n[ \t]*\}$/.exec(f)) == null ? void 0 : c[0]) == null ? void 0 : S.replace(/\}$/, "")) ?? "";
|
|
1479
|
+
return { between: `;${o}`, before: o, after: `;${w}` };
|
|
1480
|
+
}
|
|
1481
|
+
function s(r) {
|
|
1482
|
+
const a = r.selectorDirty ? r.selectors.map(i).join(", ") : e(r.selectorSpan);
|
|
1483
|
+
if (r.declarations.length === 0)
|
|
1484
|
+
return a + n.slice(r.selectorSpan.end, r.span.end);
|
|
1485
|
+
const d = n.slice(r.selectorSpan.end, r.declarations[0].span.start);
|
|
1486
|
+
if (r.declarationsDirty) {
|
|
1487
|
+
const { between: w, before: c, after: S } = l(r), h = d.slice(0, d.indexOf("{") + 1), b = r.declarations.map(m).join(w);
|
|
1488
|
+
return `${a}${h}${c}${b}${S}}`;
|
|
1196
1489
|
}
|
|
1197
|
-
let
|
|
1198
|
-
for (const
|
|
1199
|
-
|
|
1200
|
-
return
|
|
1490
|
+
let o = a, f = r.selectorSpan.end;
|
|
1491
|
+
for (const w of r.declarations)
|
|
1492
|
+
o += n.slice(f, w.span.start), o += m(w), f = w.span.end;
|
|
1493
|
+
return o + n.slice(f, r.span.end);
|
|
1201
1494
|
}
|
|
1202
|
-
function
|
|
1203
|
-
return
|
|
1495
|
+
function m(r) {
|
|
1496
|
+
return r.dirty ? `${r.property}: ${r.value}` : e(r.span);
|
|
1204
1497
|
}
|
|
1205
|
-
function g(
|
|
1206
|
-
return
|
|
1498
|
+
function g(r) {
|
|
1499
|
+
return r.kind === "rule" ? s(r.rule) : e(r.span);
|
|
1207
1500
|
}
|
|
1208
|
-
let
|
|
1209
|
-
for (const
|
|
1210
|
-
const
|
|
1211
|
-
|
|
1501
|
+
let v = "", u = 0;
|
|
1502
|
+
for (const r of t.items) {
|
|
1503
|
+
const a = r.kind === "rule" ? r.rule.span : r.span;
|
|
1504
|
+
v += n.slice(u, a.start), v += g(r), u = a.end;
|
|
1212
1505
|
}
|
|
1213
|
-
return
|
|
1506
|
+
return v + n.slice(u);
|
|
1507
|
+
}
|
|
1508
|
+
function At(t, n = []) {
|
|
1509
|
+
var e;
|
|
1510
|
+
if (t.name.local === "Style") {
|
|
1511
|
+
const i = (e = t.attributes.find((l) => l.name === "src")) == null ? void 0 : e.value;
|
|
1512
|
+
i !== void 0 && i.length > 0 && n.push(yt(i));
|
|
1513
|
+
}
|
|
1514
|
+
for (const i of t.children) At(i, n);
|
|
1515
|
+
return n;
|
|
1214
1516
|
}
|
|
1215
|
-
function
|
|
1216
|
-
var
|
|
1217
|
-
const i =
|
|
1218
|
-
|
|
1219
|
-
const g =
|
|
1220
|
-
|
|
1517
|
+
function ze(t, n, e) {
|
|
1518
|
+
var g, v;
|
|
1519
|
+
const i = Ie(t), l = [...i.warnings], s = [], m = [];
|
|
1520
|
+
for (const u of At(i.root)) {
|
|
1521
|
+
const r = ((g = e == null ? void 0 : e.resolveImport) == null ? void 0 : g.call(e, u)) ?? null;
|
|
1522
|
+
if (r === null) {
|
|
1523
|
+
l.push({
|
|
1524
|
+
kind: "import-unresolved",
|
|
1525
|
+
message: (e == null ? void 0 : e.resolveImport) === void 0 ? `<Style src="${u}"> was not loaded: pass resolveImport to read it, or pass the stylesheet text directly. Until then this document renders unstyled.` : `<Style src="${u}"> could not be resolved`,
|
|
1526
|
+
node: i.root.id
|
|
1527
|
+
});
|
|
1528
|
+
continue;
|
|
1529
|
+
}
|
|
1530
|
+
m.push({ text: r, origin: u });
|
|
1531
|
+
}
|
|
1532
|
+
if (n !== void 0 || m.length > 0) {
|
|
1533
|
+
const u = /* @__PURE__ */ new Set(), r = [
|
|
1534
|
+
...m,
|
|
1535
|
+
...n === void 0 ? [] : [{ text: n, origin: null }]
|
|
1221
1536
|
];
|
|
1222
|
-
for (;
|
|
1223
|
-
const
|
|
1224
|
-
|
|
1225
|
-
for (const
|
|
1226
|
-
if (
|
|
1227
|
-
|
|
1228
|
-
const
|
|
1229
|
-
if (
|
|
1537
|
+
for (; r.length > 0; ) {
|
|
1538
|
+
const a = r.shift(), d = s.length, o = rt(a.text, a.origin, d);
|
|
1539
|
+
s.push(o.sheet), l.push(...o.warnings);
|
|
1540
|
+
for (const f of o.sheet.items) {
|
|
1541
|
+
if (f.kind !== "import" || u.has(f.url)) continue;
|
|
1542
|
+
u.add(f.url);
|
|
1543
|
+
const w = ((v = e == null ? void 0 : e.resolveImport) == null ? void 0 : v.call(e, f.url)) ?? null;
|
|
1544
|
+
if (w === null) {
|
|
1230
1545
|
l.push({
|
|
1231
1546
|
kind: "import-unresolved",
|
|
1232
|
-
message: (e == null ? void 0 : e.resolveImport) === void 0 ? `@import "${
|
|
1233
|
-
at: { in: "uss", sheet:
|
|
1547
|
+
message: (e == null ? void 0 : e.resolveImport) === void 0 ? `@import "${f.url}" was not loaded: pass resolveImport to read it` : `@import "${f.url}" could not be resolved`,
|
|
1548
|
+
at: { in: "uss", sheet: d, span: f.span }
|
|
1234
1549
|
});
|
|
1235
1550
|
continue;
|
|
1236
1551
|
}
|
|
1237
|
-
|
|
1552
|
+
r.push({ text: w, origin: f.url });
|
|
1238
1553
|
}
|
|
1239
1554
|
}
|
|
1240
1555
|
}
|
|
1241
|
-
return { source: t, root: i.root, sheets:
|
|
1556
|
+
return { source: t, root: i.root, sheets: s, warnings: l };
|
|
1242
1557
|
}
|
|
1243
|
-
function
|
|
1558
|
+
function je(t) {
|
|
1244
1559
|
const n = t.sheets[0];
|
|
1245
1560
|
return {
|
|
1246
|
-
uxml:
|
|
1561
|
+
uxml: Ae(t.source, t.root),
|
|
1247
1562
|
// Only the sheet passed to `parse` round-trips. `@import`ed sheets (Phase 3)
|
|
1248
1563
|
// are separate files and are not this function's to write.
|
|
1249
|
-
uss: n === void 0 ? "" :
|
|
1564
|
+
uss: n === void 0 ? "" : Me(n)
|
|
1250
1565
|
};
|
|
1251
1566
|
}
|
|
1252
|
-
function
|
|
1567
|
+
function We(t, n, e) {
|
|
1253
1568
|
const i = n.ownerDocument, l = (e == null ? void 0 : e.size) ?? {
|
|
1254
1569
|
width: n.clientWidth,
|
|
1255
1570
|
height: n.clientHeight
|
|
1256
|
-
},
|
|
1257
|
-
|
|
1258
|
-
(e == null ? void 0 : e.
|
|
1259
|
-
),
|
|
1260
|
-
let
|
|
1571
|
+
}, s = Ne(t, {
|
|
1572
|
+
...(e == null ? void 0 : e.activeStates) === void 0 ? {} : { activeStates: e.activeStates },
|
|
1573
|
+
...(e == null ? void 0 : e.states) === void 0 ? {} : { states: e.states }
|
|
1574
|
+
}), m = (e == null ? void 0 : e.measureText) ?? ne(i), g = te(t.root, s.styles, s.partStyles, { size: l, measureText: m });
|
|
1575
|
+
let v;
|
|
1261
1576
|
try {
|
|
1262
|
-
|
|
1577
|
+
v = fe(t.root, g.boxes, g.parts, s.styles, n, {
|
|
1263
1578
|
document: i,
|
|
1264
1579
|
resolveAsset: e == null ? void 0 : e.resolveAsset
|
|
1265
1580
|
});
|
|
1266
|
-
} catch (
|
|
1267
|
-
throw g.dispose(),
|
|
1581
|
+
} catch (r) {
|
|
1582
|
+
throw g.dispose(), r;
|
|
1268
1583
|
}
|
|
1269
|
-
let
|
|
1584
|
+
let u = !1;
|
|
1270
1585
|
return {
|
|
1271
|
-
warnings: [...
|
|
1272
|
-
elements:
|
|
1586
|
+
warnings: [...s.warnings, ...g.warnings, ...v.warnings],
|
|
1587
|
+
elements: v.elements,
|
|
1273
1588
|
boxes: g.boxes,
|
|
1274
1589
|
dispose() {
|
|
1275
|
-
|
|
1590
|
+
u || (u = !0, g.dispose(), n.replaceChildren());
|
|
1276
1591
|
}
|
|
1277
1592
|
};
|
|
1278
1593
|
}
|
|
1279
1594
|
export {
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1595
|
+
ce as NODE_ATTRIBUTE,
|
|
1596
|
+
ue as PART_ATTRIBUTE,
|
|
1597
|
+
de as PART_OWNER_ATTRIBUTE,
|
|
1598
|
+
ne as createDefaultMeasureText,
|
|
1599
|
+
_e as explainProperty,
|
|
1600
|
+
Vt as isInherited,
|
|
1601
|
+
De as isLayoutEngineReady,
|
|
1602
|
+
Le as liveNodeCount,
|
|
1603
|
+
Ue as loadLayoutEngine,
|
|
1604
|
+
ze as parse,
|
|
1605
|
+
We as render,
|
|
1606
|
+
Ne as resolveStyles,
|
|
1607
|
+
je as serialize,
|
|
1608
|
+
Bt as supportedControlNames
|
|
1292
1609
|
};
|