uxml-preview 0.5.0 → 0.5.1
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 +101 -0
- package/README.md +4 -4
- package/THIRD-PARTY-NOTICES.md +7 -0
- package/dist/index.d.ts +4 -11
- package/dist/index.js +1624 -1278
- package/dist/layout/yoga.d.ts +3 -1
- package/dist/model/types.d.ts +81 -0
- package/dist/render/css-map.d.ts +3 -1
- package/dist/render/values.d.ts +2 -0
- package/dist/style/registry.d.ts +110 -0
- package/dist/style/resolve.d.ts +10 -0
- package/dist/template/expand.d.ts +10 -0
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,154 +1,211 @@
|
|
|
1
|
-
import { loadYoga as
|
|
2
|
-
|
|
1
|
+
import { loadYoga as it, PositionType as re, Direction as Se, Edge as J, BoxSizing as at, FlexDirection as G, Wrap as K, Justify as B, Align as L, Display as lt, Overflow as ct } from "yoga-layout/load";
|
|
2
|
+
const je = {
|
|
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
|
+
}, ie = { hasText: !1, classes: [], parts: [] }, ut = "UXML", dt = /* @__PURE__ */ new Set(["Style", "Template", "AttributeOverrides", "Bindings", "Columns"]);
|
|
41
|
+
function de(e) {
|
|
42
|
+
return dt.has(e.name.local);
|
|
43
|
+
}
|
|
44
|
+
function Y(e) {
|
|
45
|
+
var t;
|
|
46
|
+
if (((t = e.derived) == null ? void 0 : t.kind) === "template-container") return { spec: ie, fallback: !1 };
|
|
47
|
+
const n = je[e.name.local];
|
|
48
|
+
return n !== void 0 ? { spec: n, fallback: !1 } : ft(e) ? { spec: ie, fallback: !1 } : { spec: ie, fallback: !0 };
|
|
49
|
+
}
|
|
50
|
+
function ft(e) {
|
|
51
|
+
return e.name.local === ut;
|
|
52
|
+
}
|
|
53
|
+
function pt(e) {
|
|
54
|
+
return Y(e).spec.classes;
|
|
55
|
+
}
|
|
56
|
+
function ht() {
|
|
57
|
+
return Object.keys(je);
|
|
58
|
+
}
|
|
59
|
+
function X(e) {
|
|
3
60
|
const n = (t, s) => !Number.isInteger(t) || t < 0 || t > 1114111 || t >= 55296 && t <= 57343 ? s : String.fromCodePoint(t);
|
|
4
61
|
return e.replace(/&#x([0-9a-f]+);/gi, (t, s) => n(parseInt(s, 16), t)).replace(/&#(\d+);/g, (t, s) => n(Number(s), t)).replace(/</g, "<").replace(/>/g, ">").replace(/"/g, '"').replace(/'/g, "'").replace(/&/g, "&");
|
|
5
62
|
}
|
|
6
|
-
function
|
|
63
|
+
function $e(e) {
|
|
7
64
|
return e !== void 0 && /[A-Za-z0-9_.:-]/.test(e);
|
|
8
65
|
}
|
|
9
|
-
function
|
|
66
|
+
function Te(e) {
|
|
10
67
|
return e !== void 0 && /[A-Za-z_]/.test(e);
|
|
11
68
|
}
|
|
12
|
-
function
|
|
69
|
+
function mt(e) {
|
|
13
70
|
return e === " " || e === " " || e === `
|
|
14
71
|
` || e === "\r";
|
|
15
72
|
}
|
|
16
|
-
function
|
|
73
|
+
function ze(e) {
|
|
17
74
|
const n = [];
|
|
18
75
|
let t = 0, s = 0;
|
|
19
|
-
const
|
|
20
|
-
function
|
|
76
|
+
const r = () => s++;
|
|
77
|
+
function o(c, u, p) {
|
|
21
78
|
n.push({
|
|
22
79
|
kind: "malformed",
|
|
23
|
-
message:
|
|
24
|
-
at: { in: "uxml", span: { start:
|
|
80
|
+
message: c,
|
|
81
|
+
at: { in: "uxml", span: { start: u, end: p } }
|
|
25
82
|
});
|
|
26
83
|
}
|
|
27
|
-
function
|
|
28
|
-
for (;
|
|
84
|
+
function d() {
|
|
85
|
+
for (; mt(e[t]); ) t++;
|
|
29
86
|
}
|
|
30
|
-
function
|
|
87
|
+
function a() {
|
|
31
88
|
for (; ; ) {
|
|
32
|
-
const
|
|
33
|
-
if (
|
|
89
|
+
const c = e.indexOf("<", t);
|
|
90
|
+
if (c < 0) {
|
|
34
91
|
t = e.length;
|
|
35
92
|
return;
|
|
36
93
|
}
|
|
37
|
-
const
|
|
38
|
-
if (
|
|
39
|
-
if (e.startsWith("<!--",
|
|
40
|
-
const
|
|
41
|
-
t =
|
|
42
|
-
} else if (e.startsWith("<![CDATA[",
|
|
43
|
-
const
|
|
44
|
-
t =
|
|
94
|
+
const u = e[c + 1];
|
|
95
|
+
if (u === "!") {
|
|
96
|
+
if (e.startsWith("<!--", c)) {
|
|
97
|
+
const p = e.indexOf("-->", c + 4);
|
|
98
|
+
t = p < 0 ? e.length : p + 3;
|
|
99
|
+
} else if (e.startsWith("<![CDATA[", c)) {
|
|
100
|
+
const p = e.indexOf("]]>", c + 9);
|
|
101
|
+
t = p < 0 ? e.length : p + 3;
|
|
45
102
|
} else {
|
|
46
|
-
const
|
|
47
|
-
t =
|
|
103
|
+
const p = e.indexOf(">", c);
|
|
104
|
+
t = p < 0 ? e.length : p + 1;
|
|
48
105
|
}
|
|
49
106
|
continue;
|
|
50
107
|
}
|
|
51
|
-
if (
|
|
52
|
-
const
|
|
53
|
-
t =
|
|
108
|
+
if (u === "?") {
|
|
109
|
+
const p = e.indexOf("?>", c + 2);
|
|
110
|
+
t = p < 0 ? e.length : p + 2;
|
|
54
111
|
continue;
|
|
55
112
|
}
|
|
56
|
-
t =
|
|
113
|
+
t = c;
|
|
57
114
|
return;
|
|
58
115
|
}
|
|
59
116
|
}
|
|
60
|
-
function
|
|
61
|
-
const
|
|
62
|
-
for (;
|
|
63
|
-
const
|
|
64
|
-
return
|
|
65
|
-
}
|
|
66
|
-
function
|
|
67
|
-
const
|
|
68
|
-
for (;
|
|
69
|
-
if (t ===
|
|
70
|
-
const
|
|
71
|
-
if (
|
|
72
|
-
return t =
|
|
73
|
-
t++,
|
|
74
|
-
const
|
|
75
|
-
if (
|
|
76
|
-
return
|
|
117
|
+
function x() {
|
|
118
|
+
const c = t;
|
|
119
|
+
for (; $e(e[t]); ) t++;
|
|
120
|
+
const u = e.slice(c, t), p = u.indexOf(":");
|
|
121
|
+
return p < 0 ? { prefix: null, local: u } : { prefix: u.slice(0, p), local: u.slice(p + 1) };
|
|
122
|
+
}
|
|
123
|
+
function h() {
|
|
124
|
+
const c = t;
|
|
125
|
+
for (; $e(e[t]); ) t++;
|
|
126
|
+
if (t === c) return null;
|
|
127
|
+
const u = e.slice(c, t), p = t;
|
|
128
|
+
if (d(), e[t] !== "=")
|
|
129
|
+
return t = p, o(`attribute "${u}" has no value`, c, p), { name: u, value: "", span: { start: c, end: p } };
|
|
130
|
+
t++, d();
|
|
131
|
+
const i = e[t];
|
|
132
|
+
if (i !== '"' && i !== "'")
|
|
133
|
+
return o(`attribute "${u}" has an unquoted value`, c, t), { name: u, value: "", span: { start: c, end: t } };
|
|
77
134
|
t++;
|
|
78
|
-
const
|
|
79
|
-
return
|
|
135
|
+
const y = t, k = e.indexOf(i, t);
|
|
136
|
+
return k < 0 ? (o(`attribute "${u}" has an unterminated value`, c, e.length), t = e.length, { name: u, value: e.slice(y), span: { start: c, end: t } }) : (t = k + 1, { name: u, value: e.slice(y, k), span: { start: c, end: t } });
|
|
80
137
|
}
|
|
81
|
-
function
|
|
82
|
-
const
|
|
138
|
+
function l() {
|
|
139
|
+
const c = t;
|
|
83
140
|
t++;
|
|
84
|
-
const
|
|
85
|
-
let
|
|
141
|
+
const u = x(), p = [];
|
|
142
|
+
let i = !1;
|
|
86
143
|
for (; ; ) {
|
|
87
|
-
|
|
88
|
-
const
|
|
89
|
-
if (
|
|
90
|
-
|
|
144
|
+
d();
|
|
145
|
+
const w = e[t];
|
|
146
|
+
if (w === void 0) {
|
|
147
|
+
o("unterminated open tag", c, e.length);
|
|
91
148
|
break;
|
|
92
149
|
}
|
|
93
|
-
if (
|
|
150
|
+
if (w === ">") {
|
|
94
151
|
t++;
|
|
95
152
|
break;
|
|
96
153
|
}
|
|
97
|
-
if (
|
|
98
|
-
t += 2,
|
|
154
|
+
if (w === "/" && e[t + 1] === ">") {
|
|
155
|
+
t += 2, i = !0;
|
|
99
156
|
break;
|
|
100
157
|
}
|
|
101
|
-
const
|
|
102
|
-
if (
|
|
158
|
+
const g = h();
|
|
159
|
+
if (g === null) {
|
|
103
160
|
t++;
|
|
104
161
|
continue;
|
|
105
162
|
}
|
|
106
|
-
|
|
163
|
+
p.push(g);
|
|
107
164
|
}
|
|
108
|
-
const
|
|
109
|
-
if (
|
|
165
|
+
const y = { start: c, end: t };
|
|
166
|
+
if (i)
|
|
110
167
|
return {
|
|
111
|
-
id:
|
|
112
|
-
name:
|
|
113
|
-
attributes:
|
|
168
|
+
id: r(),
|
|
169
|
+
name: u,
|
|
170
|
+
attributes: p,
|
|
114
171
|
children: [],
|
|
115
|
-
spans: { openTag:
|
|
172
|
+
spans: { openTag: y, inner: { start: t, end: t }, closeTag: null },
|
|
116
173
|
tagDirty: !1,
|
|
117
174
|
childrenDirty: !1
|
|
118
175
|
};
|
|
119
|
-
const
|
|
176
|
+
const k = t, f = [];
|
|
120
177
|
for (; ; ) {
|
|
121
|
-
if (
|
|
122
|
-
|
|
178
|
+
if (a(), t >= e.length) {
|
|
179
|
+
o(`unterminated element <${Le(u)}>`, c, e.length);
|
|
123
180
|
break;
|
|
124
181
|
}
|
|
125
|
-
const
|
|
126
|
-
if (
|
|
127
|
-
if (!
|
|
182
|
+
const w = e[t + 1];
|
|
183
|
+
if (w === "/") break;
|
|
184
|
+
if (!Te(w)) {
|
|
128
185
|
t++;
|
|
129
186
|
continue;
|
|
130
187
|
}
|
|
131
|
-
|
|
188
|
+
f.push(l());
|
|
132
189
|
}
|
|
133
190
|
const m = t;
|
|
134
|
-
let
|
|
191
|
+
let v = null;
|
|
135
192
|
if (e.startsWith("</", t)) {
|
|
136
|
-
const
|
|
137
|
-
|
|
193
|
+
const w = e.indexOf(">", t), g = w < 0 ? e.length : w + 1;
|
|
194
|
+
w < 0 && o("unterminated end tag", t, g), v = { start: t, end: g }, t = g;
|
|
138
195
|
}
|
|
139
196
|
return {
|
|
140
|
-
id:
|
|
141
|
-
name:
|
|
142
|
-
attributes:
|
|
143
|
-
children:
|
|
144
|
-
spans: { openTag:
|
|
197
|
+
id: r(),
|
|
198
|
+
name: u,
|
|
199
|
+
attributes: p,
|
|
200
|
+
children: f,
|
|
201
|
+
spans: { openTag: y, inner: { start: k, end: m }, closeTag: v },
|
|
145
202
|
tagDirty: !1,
|
|
146
203
|
childrenDirty: !1
|
|
147
204
|
};
|
|
148
205
|
}
|
|
149
|
-
return
|
|
206
|
+
return a(), t < e.length && Te(e[t + 1]) ? { root: l(), warnings: n } : (o("no root element", 0, 0), {
|
|
150
207
|
root: {
|
|
151
|
-
id:
|
|
208
|
+
id: r(),
|
|
152
209
|
name: { prefix: null, local: "" },
|
|
153
210
|
attributes: [],
|
|
154
211
|
children: [],
|
|
@@ -159,56 +216,57 @@ function Re(e) {
|
|
|
159
216
|
warnings: n
|
|
160
217
|
});
|
|
161
218
|
}
|
|
162
|
-
function
|
|
219
|
+
function Le(e) {
|
|
163
220
|
return e.prefix === null ? e.local : `${e.prefix}:${e.local}`;
|
|
164
221
|
}
|
|
165
|
-
let
|
|
166
|
-
function
|
|
167
|
-
|
|
222
|
+
let Ue;
|
|
223
|
+
function gt(e) {
|
|
224
|
+
Ue = e;
|
|
168
225
|
}
|
|
169
|
-
const
|
|
170
|
-
function
|
|
171
|
-
|
|
226
|
+
const _e = /* @__PURE__ */ new WeakMap();
|
|
227
|
+
function yt(e, n) {
|
|
228
|
+
_e.set(e, n);
|
|
172
229
|
}
|
|
173
|
-
function
|
|
174
|
-
return
|
|
175
|
-
const s =
|
|
176
|
-
return s === void 0 || s.length === 0 ? [] : [
|
|
230
|
+
function Cn(e) {
|
|
231
|
+
return ze(e).root.children.filter((t) => t.name.local === "Template").flatMap((t) => {
|
|
232
|
+
const s = We(t, "src");
|
|
233
|
+
return s === void 0 || s.length === 0 ? [] : [X(s)];
|
|
177
234
|
});
|
|
178
235
|
}
|
|
179
|
-
const
|
|
180
|
-
function
|
|
236
|
+
const Ie = 32;
|
|
237
|
+
function We(e, n) {
|
|
181
238
|
var t;
|
|
182
239
|
return (t = e.attributes.find((s) => s.name === n)) == null ? void 0 : t.value;
|
|
183
240
|
}
|
|
184
|
-
function
|
|
185
|
-
const t =
|
|
186
|
-
return t === void 0 ? void 0 :
|
|
241
|
+
function j(e, n) {
|
|
242
|
+
const t = We(e, n);
|
|
243
|
+
return t === void 0 ? void 0 : X(t);
|
|
187
244
|
}
|
|
188
|
-
function
|
|
245
|
+
function Pe(e) {
|
|
189
246
|
const n = /* @__PURE__ */ new Map();
|
|
190
247
|
for (const t of e.root.children) {
|
|
191
248
|
if (t.name.local !== "Template") continue;
|
|
192
|
-
const s =
|
|
193
|
-
s === void 0 || s.length === 0 ||
|
|
249
|
+
const s = j(t, "name"), r = j(t, "src");
|
|
250
|
+
s === void 0 || s.length === 0 || r === void 0 || r.length === 0 || n.set(s, { name: s, src: r, node: t });
|
|
194
251
|
}
|
|
195
252
|
return n;
|
|
196
253
|
}
|
|
197
|
-
function
|
|
254
|
+
function Fe(e, n) {
|
|
198
255
|
return JSON.stringify([e, n]);
|
|
199
256
|
}
|
|
200
|
-
function
|
|
257
|
+
function bt(e) {
|
|
201
258
|
return /(?:^|\/)Packages\//i.test(e) || /PackageCache/i.test(e);
|
|
202
259
|
}
|
|
203
|
-
function
|
|
260
|
+
function F(e, n, t, s, r, o = {}) {
|
|
204
261
|
e.push({
|
|
205
262
|
kind: n,
|
|
206
263
|
message: t,
|
|
207
264
|
...s === void 0 ? {} : { node: s.id },
|
|
208
|
-
...
|
|
265
|
+
...r === void 0 ? {} : { sourceDocument: r },
|
|
266
|
+
...o
|
|
209
267
|
});
|
|
210
268
|
}
|
|
211
|
-
function
|
|
269
|
+
function se(e, n = 0, t = void 0) {
|
|
212
270
|
return {
|
|
213
271
|
...e,
|
|
214
272
|
span: {
|
|
@@ -218,140 +276,146 @@ function ee(e, n = 0, t = void 0) {
|
|
|
218
276
|
...t === void 0 ? {} : { sourceDocument: t }
|
|
219
277
|
};
|
|
220
278
|
}
|
|
221
|
-
function
|
|
279
|
+
function Be(e) {
|
|
222
280
|
return { prefix: e.prefix, local: e.local };
|
|
223
281
|
}
|
|
224
|
-
function
|
|
282
|
+
function Ee() {
|
|
225
283
|
return { start: 0, end: 0 };
|
|
226
284
|
}
|
|
227
|
-
function
|
|
285
|
+
function ae(e, n) {
|
|
228
286
|
return { start: e.start + n, end: e.end + n };
|
|
229
287
|
}
|
|
230
|
-
function
|
|
288
|
+
function vt(e, n, t, s, r) {
|
|
231
289
|
return {
|
|
232
290
|
id: e,
|
|
233
291
|
name: n,
|
|
234
292
|
attributes: t,
|
|
235
293
|
children: s,
|
|
236
|
-
spans: { openTag:
|
|
294
|
+
spans: { openTag: Ee(), inner: Ee(), closeTag: null },
|
|
237
295
|
tagDirty: !1,
|
|
238
296
|
childrenDirty: !1,
|
|
239
|
-
...
|
|
297
|
+
...r === void 0 ? {} : { derived: { kind: "template-container", instance: r } }
|
|
240
298
|
};
|
|
241
299
|
}
|
|
242
|
-
function
|
|
243
|
-
const s = e.items.map((
|
|
244
|
-
...
|
|
300
|
+
function wt(e, n, t) {
|
|
301
|
+
const s = e.items.map((r) => r.kind !== "import" || r.resolvedSheet === void 0 ? r.kind === "rule" ? {
|
|
302
|
+
...r,
|
|
245
303
|
rule: {
|
|
246
|
-
...
|
|
247
|
-
selectors:
|
|
248
|
-
...
|
|
249
|
-
parts:
|
|
304
|
+
...r.rule,
|
|
305
|
+
selectors: r.rule.selectors.map((o) => ({
|
|
306
|
+
...o,
|
|
307
|
+
parts: o.parts.map((d) => ({ ...d, simple: [...d.simple] }))
|
|
250
308
|
})),
|
|
251
|
-
declarations:
|
|
309
|
+
declarations: r.rule.declarations.map((o) => ({ ...o }))
|
|
252
310
|
}
|
|
253
|
-
} : { ...
|
|
311
|
+
} : { ...r } : { ...r, resolvedSheet: r.resolvedSheet + n });
|
|
254
312
|
return { ...e, items: s, sourceDocumentFrom: t };
|
|
255
313
|
}
|
|
256
|
-
function
|
|
314
|
+
function xt(e, n) {
|
|
257
315
|
const t = n.sheetOffsets.get(e.document);
|
|
258
316
|
if (t !== void 0) return t;
|
|
259
|
-
const s = n.sheets.length,
|
|
260
|
-
return e.document.sheets.forEach((
|
|
261
|
-
for (const
|
|
262
|
-
|
|
263
|
-
}), n.sheetOffsets.set(e.document,
|
|
264
|
-
(
|
|
265
|
-
),
|
|
266
|
-
}
|
|
267
|
-
function
|
|
317
|
+
const s = n.sheets.length, r = e.document.sheets.map((d, a) => s + a), o = e.document.sheets.map(() => e.url);
|
|
318
|
+
return e.document.sheets.forEach((d, a) => {
|
|
319
|
+
for (const x of d.items)
|
|
320
|
+
x.kind === "import" && x.resolvedSheet !== void 0 && (o[x.resolvedSheet] = d.origin ?? e.url);
|
|
321
|
+
}), n.sheetOffsets.set(e.document, r), e.document.sheets.forEach(
|
|
322
|
+
(d, a) => n.sheets.push(wt(d, s, o[a]))
|
|
323
|
+
), r;
|
|
324
|
+
}
|
|
325
|
+
function He(e, n) {
|
|
268
326
|
const t = n.sourceOffsets.get(e);
|
|
269
327
|
if (t !== void 0) return t;
|
|
270
328
|
const s = n.sourceLength + 1;
|
|
271
329
|
return n.sourceOffsets.set(e, s), n.sources.push(`
|
|
272
330
|
${e.source}`), n.sourceLength += e.source.length + 1, s;
|
|
273
331
|
}
|
|
274
|
-
function
|
|
275
|
-
for (const
|
|
276
|
-
const
|
|
277
|
-
if (
|
|
278
|
-
const
|
|
279
|
-
|
|
332
|
+
function kt(e, n, t, s, r) {
|
|
333
|
+
for (const o of e.document.styleRoots ?? []) {
|
|
334
|
+
const d = n[o.sheet];
|
|
335
|
+
if (d === void 0) continue;
|
|
336
|
+
const a = t.nodes.get(o.scope) ?? s.id;
|
|
337
|
+
r.styleRoots.push({ sheet: d, scope: a });
|
|
280
338
|
}
|
|
281
339
|
}
|
|
282
|
-
function
|
|
340
|
+
function St(e) {
|
|
283
341
|
return e.map((n) => {
|
|
284
|
-
const t =
|
|
342
|
+
const t = j(n, "name"), s = j(n, "slot");
|
|
285
343
|
return `<${n.name.local}${t === void 0 ? "" : ` name="${t}"`}${s === void 0 ? "" : ` slot="${s}"`}>`;
|
|
286
344
|
});
|
|
287
345
|
}
|
|
288
|
-
function
|
|
289
|
-
const t =
|
|
346
|
+
function Ve(e, n) {
|
|
347
|
+
const t = j(e, "slot-name");
|
|
290
348
|
t !== void 0 && t.length > 0 && n.add(t);
|
|
291
|
-
for (const s of e.children)
|
|
349
|
+
for (const s of e.children) Ve(s, n);
|
|
292
350
|
}
|
|
293
|
-
function
|
|
294
|
-
const
|
|
295
|
-
t !== null &&
|
|
296
|
-
|
|
351
|
+
function q(e, n, t, s, r) {
|
|
352
|
+
const o = /* @__PURE__ */ new Set();
|
|
353
|
+
t !== null && Ve(t.document.root, o), !(o.size === 0 && n.length === 0) && F(
|
|
354
|
+
r.warnings,
|
|
297
355
|
"template-slot-unsupported",
|
|
298
|
-
`Template slots are unsupported; defined slot names: ${t === null ? "(unavailable)" :
|
|
356
|
+
`Template slots are unsupported; defined slot names: ${t === null ? "(unavailable)" : o.size === 0 ? "(none)" : [...o].join(", ")}; children not placed: ${n.length === 0 ? "(none)" : St(n).join(", ")}`,
|
|
299
357
|
e,
|
|
300
|
-
s
|
|
358
|
+
s,
|
|
359
|
+
{ reason: "not-rendered" }
|
|
301
360
|
);
|
|
302
361
|
}
|
|
303
|
-
function
|
|
304
|
-
if (e
|
|
305
|
-
const t =
|
|
362
|
+
function ge(e, n) {
|
|
363
|
+
if (!de(e)) {
|
|
364
|
+
const t = j(e, "name");
|
|
306
365
|
t !== void 0 && t.length > 0 && n.set(t, (n.get(t) ?? 0) + 1);
|
|
307
366
|
}
|
|
308
|
-
for (const t of e.children)
|
|
367
|
+
for (const t of e.children) ge(t, n);
|
|
309
368
|
}
|
|
310
|
-
function
|
|
311
|
-
|
|
312
|
-
for (const s of e.children)
|
|
369
|
+
function Ye(e, n, t) {
|
|
370
|
+
j(e, "name") === n && t.push(e);
|
|
371
|
+
for (const s of e.children) Ye(s, n, t);
|
|
313
372
|
}
|
|
314
|
-
function
|
|
373
|
+
function $t(e, n, t, s, r) {
|
|
315
374
|
if (n.length === 0) return;
|
|
316
|
-
const
|
|
317
|
-
|
|
318
|
-
for (const
|
|
319
|
-
const
|
|
320
|
-
if (
|
|
321
|
-
|
|
375
|
+
const o = /* @__PURE__ */ new Map();
|
|
376
|
+
ge(e, o);
|
|
377
|
+
for (const d of n) {
|
|
378
|
+
const a = j(d, "element-name"), x = j(d, "style");
|
|
379
|
+
if (x !== void 0 && F(
|
|
380
|
+
r.warnings,
|
|
322
381
|
"override-style-ignored",
|
|
323
|
-
`AttributeOverrides style for element-name "${
|
|
324
|
-
|
|
325
|
-
s ?? void 0
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
382
|
+
`AttributeOverrides style for element-name "${a ?? "(missing)"}" was ignored with value "${x}"`,
|
|
383
|
+
d,
|
|
384
|
+
s ?? void 0,
|
|
385
|
+
{
|
|
386
|
+
reason: "matches-unity",
|
|
387
|
+
...a === void 0 ? {} : { subject: { kind: "name", name: a } }
|
|
388
|
+
}
|
|
389
|
+
), a === void 0 || a.length === 0) continue;
|
|
390
|
+
const h = [];
|
|
391
|
+
if (Ye(e, a, h), h.length === 0) {
|
|
392
|
+
const l = [...o.keys()];
|
|
393
|
+
F(
|
|
394
|
+
r.warnings,
|
|
332
395
|
"override-target-missing",
|
|
333
|
-
`AttributeOverrides target "${
|
|
334
|
-
|
|
335
|
-
s ?? void 0
|
|
396
|
+
`AttributeOverrides target "${a}" matched no element; available names: ${l.length === 0 ? "(none)" : l.join(", ")}`,
|
|
397
|
+
d,
|
|
398
|
+
s ?? void 0,
|
|
399
|
+
{ reason: "invalid-value", subject: { kind: "name", name: a } }
|
|
336
400
|
);
|
|
337
401
|
continue;
|
|
338
402
|
}
|
|
339
|
-
for (const
|
|
340
|
-
for (const
|
|
341
|
-
if (
|
|
342
|
-
const
|
|
343
|
-
|
|
403
|
+
for (const l of h)
|
|
404
|
+
for (const c of d.attributes) {
|
|
405
|
+
if (c.name === "element-name" || c.name === "style") continue;
|
|
406
|
+
const u = l.attributes.find((p) => p.name === c.name);
|
|
407
|
+
u === void 0 ? l.attributes.push(se(c, t, s)) : (u.value = c.value, u.sourceDocument = s);
|
|
344
408
|
}
|
|
345
409
|
}
|
|
346
410
|
}
|
|
347
|
-
function
|
|
348
|
-
return e.name.local === "Template" || e.name.local === "Instance" ? !0 : e.children.some(
|
|
411
|
+
function qe(e) {
|
|
412
|
+
return e.name.local === "Template" || e.name.local === "Instance" ? !0 : e.children.some(qe);
|
|
349
413
|
}
|
|
350
|
-
function
|
|
414
|
+
function Tt(e, n) {
|
|
351
415
|
let t = 0;
|
|
352
|
-
const s = (
|
|
353
|
-
t = Math.max(t, Number(
|
|
354
|
-
for (const
|
|
416
|
+
const s = (r) => {
|
|
417
|
+
t = Math.max(t, Number(r.id) + 1);
|
|
418
|
+
for (const o of r.children) s(o);
|
|
355
419
|
};
|
|
356
420
|
return s(e.root), {
|
|
357
421
|
resolver: n,
|
|
@@ -368,101 +432,103 @@ function mt(e, n) {
|
|
|
368
432
|
stack: []
|
|
369
433
|
};
|
|
370
434
|
}
|
|
371
|
-
function
|
|
372
|
-
var
|
|
373
|
-
const s =
|
|
435
|
+
function It(e, n, t) {
|
|
436
|
+
var x;
|
|
437
|
+
const s = Fe(e.src, n);
|
|
374
438
|
if (t.cache.has(s)) return t.cache.get(s) ?? null;
|
|
375
|
-
const
|
|
376
|
-
if (
|
|
377
|
-
return t.cache.set(s, null),
|
|
439
|
+
const r = ((x = t.resolver) == null ? void 0 : x.call(t, e.src, n)) ?? null;
|
|
440
|
+
if (r === null)
|
|
441
|
+
return t.cache.set(s, null), F(
|
|
378
442
|
t.warnings,
|
|
379
443
|
"template-src-unresolved",
|
|
380
444
|
`Template "${e.name}" src "${e.src}" could not be resolved from ${n === null ? "the entry UXML" : `"${n}"`}; attempted resolveImport("${e.src}", ${n === null ? "null" : `"${n}"`}); internal filesystem search paths: none`,
|
|
381
445
|
e.node,
|
|
382
|
-
n ?? void 0
|
|
383
|
-
|
|
446
|
+
n ?? void 0,
|
|
447
|
+
{ subject: { kind: "import", url: e.src, from: n } }
|
|
448
|
+
), bt(e.src) && F(
|
|
384
449
|
t.warnings,
|
|
385
450
|
"package-path-not-searched",
|
|
386
451
|
`Template src "${e.src}" was unresolved; the resolver returned no source and the core does not independently search Unity Packages/Library/PackageCache paths`,
|
|
387
452
|
e.node,
|
|
388
|
-
n ?? void 0
|
|
453
|
+
n ?? void 0,
|
|
454
|
+
{ reason: "not-rendered", subject: { kind: "import", url: e.src, from: n } }
|
|
389
455
|
), null;
|
|
390
|
-
const
|
|
391
|
-
if (
|
|
456
|
+
const o = Ue;
|
|
457
|
+
if (o === void 0)
|
|
392
458
|
throw new Error("template parser is not registered; import parse from src/index before expansion");
|
|
393
|
-
const
|
|
394
|
-
|
|
395
|
-
t.resolver === void 0 ? void 0 : (
|
|
396
|
-
),
|
|
459
|
+
const d = o(
|
|
460
|
+
r,
|
|
461
|
+
t.resolver === void 0 ? void 0 : (h, l) => t.resolver(h, l ?? e.src)
|
|
462
|
+
), a = {
|
|
397
463
|
url: e.src,
|
|
398
464
|
from: n,
|
|
399
|
-
document:
|
|
400
|
-
declarations:
|
|
465
|
+
document: d,
|
|
466
|
+
declarations: Pe(d)
|
|
401
467
|
};
|
|
402
|
-
return t.cache.set(s,
|
|
468
|
+
return t.cache.set(s, a), a;
|
|
403
469
|
}
|
|
404
|
-
function
|
|
405
|
-
var s,
|
|
470
|
+
function Et(e, n, t) {
|
|
471
|
+
var s, r;
|
|
406
472
|
if (!t.reportedWarnings.has(e.document)) {
|
|
407
473
|
t.reportedWarnings.add(e.document);
|
|
408
|
-
for (const
|
|
409
|
-
((s =
|
|
410
|
-
...
|
|
411
|
-
at: { ...
|
|
412
|
-
sourceDocument: ((
|
|
413
|
-
}) : t.warnings.push({ ...
|
|
414
|
-
}
|
|
415
|
-
}
|
|
416
|
-
function
|
|
417
|
-
const
|
|
418
|
-
id:
|
|
419
|
-
name:
|
|
420
|
-
attributes: e.attributes.map((
|
|
474
|
+
for (const o of e.document.warnings)
|
|
475
|
+
((s = o.at) == null ? void 0 : s.in) === "uss" ? t.warnings.push({
|
|
476
|
+
...o,
|
|
477
|
+
at: { ...o.at, sheet: n[o.at.sheet] ?? o.at.sheet },
|
|
478
|
+
sourceDocument: ((r = e.document.sheets[o.at.sheet]) == null ? void 0 : r.origin) ?? e.url
|
|
479
|
+
}) : t.warnings.push({ ...o, sourceDocument: e.url });
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
function oe(e, n, t, s, r, o) {
|
|
483
|
+
const d = r ? e.id : n.nextId(), a = s === null ? 0 : n.sourceOffsets.get(s.document) ?? 0, x = a === 0 || s === null ? void 0 : s.url, h = {
|
|
484
|
+
id: d,
|
|
485
|
+
name: Be(e.name),
|
|
486
|
+
attributes: e.attributes.map((l) => se(l, a, x)),
|
|
421
487
|
children: [],
|
|
422
488
|
spans: {
|
|
423
|
-
openTag:
|
|
424
|
-
inner:
|
|
425
|
-
closeTag: e.spans.closeTag === null ? null :
|
|
489
|
+
openTag: ae(e.spans.openTag, a),
|
|
490
|
+
inner: ae(e.spans.inner, a),
|
|
491
|
+
closeTag: e.spans.closeTag === null ? null : ae(e.spans.closeTag, a)
|
|
426
492
|
},
|
|
427
493
|
tagDirty: e.tagDirty,
|
|
428
494
|
childrenDirty: e.childrenDirty,
|
|
429
|
-
...
|
|
495
|
+
...a === 0 || s === null ? {} : {
|
|
430
496
|
sourceDocument: s.url,
|
|
431
497
|
sourceDocumentFrom: s.from,
|
|
432
498
|
sourceNode: e.id
|
|
433
499
|
}
|
|
434
500
|
};
|
|
435
|
-
t.nodes.set(e.id,
|
|
436
|
-
for (const
|
|
437
|
-
if (!(
|
|
438
|
-
if (
|
|
439
|
-
|
|
501
|
+
t.nodes.set(e.id, h.id);
|
|
502
|
+
for (const l of e.children)
|
|
503
|
+
if (!(l.name.local === "Template" || l.name.local === "Style")) {
|
|
504
|
+
if (l.name.local === "Instance") {
|
|
505
|
+
h.children.push(ye(l, n, s, t, o + 1));
|
|
440
506
|
continue;
|
|
441
507
|
}
|
|
442
|
-
|
|
508
|
+
l.name.local !== "AttributeOverrides" && j(l, "slot") === void 0 && h.children.push(oe(l, n, t, s, r, o));
|
|
443
509
|
}
|
|
444
|
-
return
|
|
445
|
-
}
|
|
446
|
-
function
|
|
447
|
-
|
|
448
|
-
const
|
|
449
|
-
for (const
|
|
450
|
-
if (!(
|
|
451
|
-
if (
|
|
452
|
-
n.children.push(
|
|
510
|
+
return h;
|
|
511
|
+
}
|
|
512
|
+
function Ot(e, n, t, s) {
|
|
513
|
+
He(e.document, t);
|
|
514
|
+
const r = { nodes: /* @__PURE__ */ new Map([[e.document.root.id, n.id]]) };
|
|
515
|
+
for (const o of e.document.root.children)
|
|
516
|
+
if (!(o.name.local === "Template" || o.name.local === "Style")) {
|
|
517
|
+
if (o.name.local === "Instance") {
|
|
518
|
+
n.children.push(ye(o, t, e, r, s + 1));
|
|
453
519
|
continue;
|
|
454
520
|
}
|
|
455
|
-
|
|
521
|
+
o.name.local !== "AttributeOverrides" && j(o, "slot") === void 0 && n.children.push(oe(o, t, r, e, !1, s));
|
|
456
522
|
}
|
|
457
|
-
return
|
|
523
|
+
return r;
|
|
458
524
|
}
|
|
459
|
-
function
|
|
460
|
-
const
|
|
525
|
+
function ye(e, n, t, s, r) {
|
|
526
|
+
const o = vt(
|
|
461
527
|
n.nextId(),
|
|
462
528
|
{ prefix: e.name.prefix, local: "TemplateContainer" },
|
|
463
|
-
e.attributes.filter((
|
|
464
|
-
(
|
|
465
|
-
|
|
529
|
+
e.attributes.filter((f) => f.name !== "template").map(
|
|
530
|
+
(f) => se(
|
|
531
|
+
f,
|
|
466
532
|
t === null ? 0 : n.sourceOffsets.get(t.document) ?? 0,
|
|
467
533
|
t === null || t.url.length === 0 ? null : t.url
|
|
468
534
|
)
|
|
@@ -470,74 +536,80 @@ function he(e, n, t, s, i) {
|
|
|
470
536
|
[],
|
|
471
537
|
e.id
|
|
472
538
|
);
|
|
473
|
-
t !== null && (
|
|
474
|
-
const
|
|
475
|
-
if (
|
|
476
|
-
return
|
|
539
|
+
t !== null && (o.sourceDocument = t.url.length > 0 ? t.url : null, o.sourceDocumentFrom = t.from), s.nodes.set(e.id, o.id);
|
|
540
|
+
const d = j(e, "template"), a = e.children.filter((f) => j(f, "slot") !== void 0), x = t === null || t.url.length === 0 ? void 0 : t.url, h = t == null ? void 0 : t.declarations.get(d ?? "");
|
|
541
|
+
if (h === void 0)
|
|
542
|
+
return q(e, a, null, x, n), F(
|
|
477
543
|
n.warnings,
|
|
478
544
|
"template-not-declared",
|
|
479
|
-
`Instance${
|
|
545
|
+
`Instance${d === void 0 ? "" : ` template "${d}"`} has no matching Template declaration`,
|
|
480
546
|
e,
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
547
|
+
x,
|
|
548
|
+
{
|
|
549
|
+
reason: "invalid-value",
|
|
550
|
+
...d === void 0 ? {} : { subject: { kind: "name", name: d } }
|
|
551
|
+
}
|
|
552
|
+
), o;
|
|
553
|
+
const l = t === null || t.url.length === 0 ? null : t.url, c = {
|
|
554
|
+
key: JSON.stringify([h.name, h.src, l]),
|
|
555
|
+
label: `${h.name}@${h.src}`
|
|
556
|
+
}, u = n.stack.findIndex((f) => f.key === c.key);
|
|
557
|
+
if (u >= 0) {
|
|
558
|
+
const f = n.cache.get(Fe(h.src, l)) ?? null;
|
|
559
|
+
q(e, a, f, x, n);
|
|
560
|
+
const m = [...n.stack.slice(u), c].map((v) => v.label).join(" -> ");
|
|
561
|
+
return F(
|
|
492
562
|
n.warnings,
|
|
493
563
|
"template-cycle",
|
|
494
564
|
`Template cycle detected: ${m}`,
|
|
495
565
|
e,
|
|
496
|
-
|
|
497
|
-
|
|
566
|
+
x,
|
|
567
|
+
{ reason: "invalid-value" }
|
|
568
|
+
), o;
|
|
498
569
|
}
|
|
499
|
-
if (
|
|
500
|
-
return
|
|
570
|
+
if (r >= Ie)
|
|
571
|
+
return q(e, a, null, x, n), F(
|
|
501
572
|
n.warnings,
|
|
502
573
|
"template-depth-exceeded",
|
|
503
|
-
`Template expansion exceeded the depth limit ${
|
|
574
|
+
`Template expansion exceeded the depth limit ${Ie}: ${[
|
|
504
575
|
...n.stack,
|
|
505
|
-
|
|
506
|
-
].map((
|
|
576
|
+
c
|
|
577
|
+
].map((f) => f.label).join(" -> ")}`,
|
|
507
578
|
e,
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
579
|
+
x,
|
|
580
|
+
{ reason: "not-rendered" }
|
|
581
|
+
), o;
|
|
582
|
+
const p = It(h, l, n);
|
|
583
|
+
if (p === null)
|
|
584
|
+
return q(e, a, null, x, n), o;
|
|
585
|
+
He(p.document, n), n.stack.push(c);
|
|
586
|
+
const i = Ot(p, o, n, r);
|
|
515
587
|
n.stack.pop();
|
|
516
|
-
const
|
|
517
|
-
|
|
518
|
-
const
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
588
|
+
const y = xt(p, n);
|
|
589
|
+
Et(p, y, n), kt(p, y, i, o, n);
|
|
590
|
+
const k = e.children.filter((f) => f.name.local === "AttributeOverrides");
|
|
591
|
+
q(e, a, p, x, n), $t(
|
|
592
|
+
o,
|
|
593
|
+
k,
|
|
522
594
|
t === null ? 0 : n.sourceOffsets.get(t.document) ?? 0,
|
|
523
595
|
t === null || t.url.length === 0 ? null : t.url,
|
|
524
596
|
n
|
|
525
597
|
);
|
|
526
|
-
for (const
|
|
527
|
-
|
|
528
|
-
return
|
|
598
|
+
for (const f of e.children)
|
|
599
|
+
f.name.local === "AttributeOverrides" || f.name.local === "Style" || j(f, "slot") !== void 0 || o.children.push(oe(f, n, s, t, !1, r));
|
|
600
|
+
return o;
|
|
529
601
|
}
|
|
530
|
-
function
|
|
531
|
-
if (!
|
|
532
|
-
const n =
|
|
602
|
+
function Dt(e) {
|
|
603
|
+
if (!qe(e.root)) return { document: e, warnings: [] };
|
|
604
|
+
const n = Tt(e, _e.get(e)), t = n.styleRoots.length, s = {
|
|
533
605
|
url: "",
|
|
534
606
|
from: null,
|
|
535
607
|
document: e,
|
|
536
|
-
declarations:
|
|
537
|
-
},
|
|
608
|
+
declarations: Pe(e)
|
|
609
|
+
}, r = { nodes: /* @__PURE__ */ new Map([[e.root.id, e.root.id]]) }, o = {
|
|
538
610
|
id: e.root.id,
|
|
539
|
-
name:
|
|
540
|
-
attributes: e.root.attributes.map((
|
|
611
|
+
name: Be(e.root.name),
|
|
612
|
+
attributes: e.root.attributes.map((a) => se(a)),
|
|
541
613
|
children: [],
|
|
542
614
|
spans: {
|
|
543
615
|
openTag: { ...e.root.spans.openTag },
|
|
@@ -547,30 +619,33 @@ function bt(e) {
|
|
|
547
619
|
tagDirty: e.root.tagDirty,
|
|
548
620
|
childrenDirty: e.root.childrenDirty
|
|
549
621
|
};
|
|
550
|
-
for (const
|
|
551
|
-
if (!(
|
|
552
|
-
if (
|
|
553
|
-
|
|
622
|
+
for (const a of e.root.children)
|
|
623
|
+
if (!(a.name.local === "Template" || a.name.local === "Style")) {
|
|
624
|
+
if (a.name.local === "Instance") {
|
|
625
|
+
o.children.push(ye(a, n, s, r, 0));
|
|
554
626
|
continue;
|
|
555
627
|
}
|
|
556
|
-
|
|
628
|
+
a.name.local !== "AttributeOverrides" && j(a, "slot") === void 0 && o.children.push(oe(a, n, r, s, !0, 0));
|
|
557
629
|
}
|
|
558
|
-
for (let
|
|
559
|
-
const
|
|
560
|
-
|
|
561
|
-
}
|
|
562
|
-
const
|
|
563
|
-
|
|
564
|
-
for (const [
|
|
565
|
-
|
|
630
|
+
for (let a = 0; a < t; a++) {
|
|
631
|
+
const x = n.styleRoots[a], h = r.nodes.get(x.scope);
|
|
632
|
+
h !== void 0 && (n.styleRoots[a] = { ...x, scope: h });
|
|
633
|
+
}
|
|
634
|
+
const d = /* @__PURE__ */ new Map();
|
|
635
|
+
ge(o, d);
|
|
636
|
+
for (const [a, x] of d)
|
|
637
|
+
x > 1 && F(
|
|
566
638
|
n.warnings,
|
|
567
639
|
"duplicate-name-in-tree",
|
|
568
|
-
`name "${
|
|
640
|
+
`name "${a}" occurs ${x} times after template expansion`,
|
|
641
|
+
void 0,
|
|
642
|
+
void 0,
|
|
643
|
+
{ reason: "matches-unity", subject: { kind: "name", name: a } }
|
|
569
644
|
);
|
|
570
645
|
return {
|
|
571
646
|
document: {
|
|
572
647
|
...e,
|
|
573
|
-
root:
|
|
648
|
+
root: o,
|
|
574
649
|
source: n.sources.join(""),
|
|
575
650
|
sheets: n.sheets,
|
|
576
651
|
styleRoots: n.styleRoots
|
|
@@ -578,64 +653,7 @@ function bt(e) {
|
|
|
578
653
|
warnings: n.warnings
|
|
579
654
|
};
|
|
580
655
|
}
|
|
581
|
-
const
|
|
582
|
-
// VisualElement is the base class and carries no class of its own.
|
|
583
|
-
VisualElement: { hasText: !1, classes: [], parts: [] },
|
|
584
|
-
Label: { hasText: !0, classes: ["unity-label"], parts: [] },
|
|
585
|
-
Button: { hasText: !0, classes: ["unity-button"], parts: [] },
|
|
586
|
-
// Image draws a texture, not text. Its picture reaches this renderer through
|
|
587
|
-
// `background-image` in USS, which `resolveAsset` can turn into something a
|
|
588
|
-
// browser will load; a texture assigned from C# has no path to follow here.
|
|
589
|
-
Image: { hasText: !1, classes: ["unity-image"], parts: [] },
|
|
590
|
-
/**
|
|
591
|
-
* Four elements from one tag. The names below are observed in
|
|
592
|
-
* `tests/golden/unity/scrollview-*.json`, not taken from documentation — the
|
|
593
|
-
* middle one, `unity-content-and-vertical-scroll-container`, is not in
|
|
594
|
-
* Unity's manual diagram at all and was found by dumping.
|
|
595
|
-
*
|
|
596
|
-
* The styles are inference, unlike the names: they are how this renderer
|
|
597
|
-
* reproduces the measured geometry, and the three `scrollview-*` golden cases
|
|
598
|
-
* are what decides whether the inference is right.
|
|
599
|
-
*/
|
|
600
|
-
ScrollView: {
|
|
601
|
-
hasText: !1,
|
|
602
|
-
classes: ["unity-scroll-view"],
|
|
603
|
-
parts: [
|
|
604
|
-
// Fills the ScrollView's content box, and lays the viewport out beside
|
|
605
|
-
// the vertical scrollbar — hence row.
|
|
606
|
-
{
|
|
607
|
-
name: "unity-content-and-vertical-scroll-container",
|
|
608
|
-
style: { "flex-grow": "1", "flex-direction": "row" }
|
|
609
|
-
},
|
|
610
|
-
// What actually clips. Takes whatever width the scrollbar leaves.
|
|
611
|
-
{ name: "unity-content-viewport", style: { "flex-grow": "1", overflow: "hidden" } },
|
|
612
|
-
// `flex-shrink: 0` is the whole reason a ScrollView is not one box:
|
|
613
|
-
// this grows to the content's height instead of being squeezed into the
|
|
614
|
-
// viewport's, so children keep their sizes and the viewport crops them.
|
|
615
|
-
// Without it three 60px children in a 100px view come out 33/34/33.
|
|
616
|
-
{ name: "unity-content-container", style: { "flex-shrink": "0" } }
|
|
617
|
-
]
|
|
618
|
-
}
|
|
619
|
-
}, re = { hasText: !1, classes: [], parts: [] }, yt = "UXML", xt = /* @__PURE__ */ new Set(["Style"]);
|
|
620
|
-
function kt(e) {
|
|
621
|
-
return xt.has(e.name.local);
|
|
622
|
-
}
|
|
623
|
-
function H(e) {
|
|
624
|
-
var t;
|
|
625
|
-
if (((t = e.derived) == null ? void 0 : t.kind) === "template-container") return { spec: re, fallback: !1 };
|
|
626
|
-
const n = He[e.name.local];
|
|
627
|
-
return n !== void 0 ? { spec: n, fallback: !1 } : St(e) ? { spec: re, fallback: !1 } : { spec: re, fallback: !0 };
|
|
628
|
-
}
|
|
629
|
-
function St(e) {
|
|
630
|
-
return e.name.local === yt;
|
|
631
|
-
}
|
|
632
|
-
function $t(e) {
|
|
633
|
-
return H(e).spec.classes;
|
|
634
|
-
}
|
|
635
|
-
function Tt() {
|
|
636
|
-
return Object.keys(He);
|
|
637
|
-
}
|
|
638
|
-
const Z = "6000.0.40f1", Ve = `:disabled {
|
|
656
|
+
const te = "6000.0.40f1", Je = `:disabled {
|
|
639
657
|
opacity: 0.5;
|
|
640
658
|
}
|
|
641
659
|
|
|
@@ -643,42 +661,220 @@ const Z = "6000.0.40f1", Ve = `:disabled {
|
|
|
643
661
|
margin: 1px 3px;
|
|
644
662
|
-unity-text-align: middle-center;
|
|
645
663
|
}
|
|
646
|
-
`,
|
|
647
|
-
function
|
|
648
|
-
return e ?
|
|
649
|
-
}
|
|
650
|
-
const
|
|
651
|
-
"
|
|
652
|
-
"
|
|
653
|
-
"
|
|
654
|
-
"
|
|
655
|
-
"
|
|
656
|
-
"
|
|
657
|
-
"
|
|
658
|
-
"
|
|
659
|
-
"
|
|
660
|
-
"
|
|
661
|
-
"
|
|
662
|
-
"
|
|
663
|
-
"
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
664
|
+
`, Mt = 13;
|
|
665
|
+
function Rt(e) {
|
|
666
|
+
return e ? Mt : 0;
|
|
667
|
+
}
|
|
668
|
+
const At = {
|
|
669
|
+
yoga: "A flexbox style input of Yoga, which UI Toolkit lays out with (CLAUDE.md rule 1); many are compared in the golden set",
|
|
670
|
+
box: "Margin, padding and border widths are part of the box Yoga sizes and places",
|
|
671
|
+
aspectRatio: "Yoga sizes a box from aspect-ratio, which Unity passes through from 6.3",
|
|
672
|
+
all: "Resets every property at once, layout properties included",
|
|
673
|
+
textSize: "Font size sets the measured size of an auto-sized text element",
|
|
674
|
+
textMeasureInferred: "Changes glyph metrics or spacing, which feed the text measurement that sizes an auto-sized text element",
|
|
675
|
+
autoSizeInferred: "Fits the text to the element box rather than the box to the text",
|
|
676
|
+
renderingModeInferred: "Chooses how glyphs are rasterised in the Editor, not how they are measured",
|
|
677
|
+
ellipsisInferred: "Truncates text inside a box that is already sized",
|
|
678
|
+
textAlign: "Places text inside its box; the box does not move (the Step 6 eye check saw it only by looking)",
|
|
679
|
+
textEffectInferred: "Draws around glyphs that are already placed",
|
|
680
|
+
colour: "Colour and corner rounding of a box that is already placed",
|
|
681
|
+
visibility: "Hidden elements keep their space; only display: none removes it",
|
|
682
|
+
transform: "Transforms apply after layout and do not move siblings (Unity Manual, USS transform)",
|
|
683
|
+
background: "Draws inside the box; a VisualElement is not sized by its background",
|
|
684
|
+
overflowInferred: "Clips descendants; with this Yoga version hidden never moved a box (property sheet), and Unity runs Yoga too",
|
|
685
|
+
clipBoxInferred: "Chooses the clipping rectangle, not any box",
|
|
686
|
+
effectInferred: "Post-processes pixels that are already drawn",
|
|
687
|
+
cursor: "Pointer appearance only; nothing is drawn or laid out",
|
|
688
|
+
timeInferred: "Changes values over time; a settled frame, which is what this preview draws, is unaffected"
|
|
689
|
+
}, Ct = {
|
|
690
|
+
/** Row count of each table on the date above. A test holds the data to these. */
|
|
691
|
+
counts: { "6000.0": 95, "6000.3": 99, "6000.6": 102 }
|
|
692
|
+
}, Nt = [
|
|
693
|
+
["align-content", "6000.0", !1, "layout", "layout", "yoga"],
|
|
694
|
+
["align-items", "6000.0", !1, "layout", "layout", "yoga"],
|
|
695
|
+
["align-self", "6000.0", !1, "layout", "layout", "yoga"],
|
|
696
|
+
["all", "6000.0", !1, "none", "layout", "all"],
|
|
697
|
+
["animation-play-state", "6000.6", !1, "none", "none", "timeInferred"],
|
|
698
|
+
["aspect-ratio", "6000.3", !1, "none", "layout", "aspectRatio"],
|
|
699
|
+
["backdrop-filter", "6000.6", !1, "none", "paint", "effectInferred"],
|
|
700
|
+
["background-color", "6000.0", !1, "paint", "paint", "colour"],
|
|
701
|
+
["background-image", "6000.0", !1, "paint", "paint", "background"],
|
|
702
|
+
["background-position", "6000.0", !1, "paint", "paint", "background"],
|
|
703
|
+
["background-position-x", "6000.0", !1, "none", "paint", "background"],
|
|
704
|
+
["background-position-y", "6000.0", !1, "none", "paint", "background"],
|
|
705
|
+
["background-repeat", "6000.0", !1, "paint", "paint", "background"],
|
|
706
|
+
["background-size", "6000.0", !1, "paint", "paint", "background"],
|
|
707
|
+
["border-bottom-color", "6000.0", !1, "paint", "paint", "colour"],
|
|
708
|
+
["border-bottom-left-radius", "6000.0", !1, "paint", "paint", "colour"],
|
|
709
|
+
["border-bottom-right-radius", "6000.0", !1, "paint", "paint", "colour"],
|
|
710
|
+
["border-bottom-width", "6000.0", !1, "layout", "layout", "box"],
|
|
711
|
+
["border-color", "6000.0", !1, "paint", "paint", "colour"],
|
|
712
|
+
["border-left-color", "6000.0", !1, "paint", "paint", "colour"],
|
|
713
|
+
["border-left-width", "6000.0", !1, "layout", "layout", "box"],
|
|
714
|
+
["border-radius", "6000.0", !1, "paint", "paint", "colour"],
|
|
715
|
+
["border-right-color", "6000.0", !1, "paint", "paint", "colour"],
|
|
716
|
+
["border-right-width", "6000.0", !1, "layout", "layout", "box"],
|
|
717
|
+
["border-top-color", "6000.0", !1, "paint", "paint", "colour"],
|
|
718
|
+
["border-top-left-radius", "6000.0", !1, "paint", "paint", "colour"],
|
|
719
|
+
["border-top-right-radius", "6000.0", !1, "paint", "paint", "colour"],
|
|
720
|
+
["border-top-width", "6000.0", !1, "layout", "layout", "box"],
|
|
721
|
+
["border-width", "6000.0", !1, "layout", "layout", "box"],
|
|
722
|
+
["bottom", "6000.0", !1, "layout", "layout", "yoga"],
|
|
723
|
+
["color", "6000.0", !0, "paint", "paint", "colour"],
|
|
724
|
+
["cursor", "6000.0", !1, "paint", "none", "cursor"],
|
|
725
|
+
["display", "6000.0", !1, "layout", "layout", "yoga"],
|
|
726
|
+
["filter", "6000.3", !1, "none", "paint", "effectInferred"],
|
|
727
|
+
["flex", "6000.0", !1, "layout", "layout", "yoga"],
|
|
728
|
+
["flex-basis", "6000.0", !1, "layout", "layout", "yoga"],
|
|
729
|
+
["flex-direction", "6000.0", !1, "layout", "layout", "yoga"],
|
|
730
|
+
["flex-grow", "6000.0", !1, "layout", "layout", "yoga"],
|
|
731
|
+
["flex-shrink", "6000.0", !1, "layout", "layout", "yoga"],
|
|
732
|
+
["flex-wrap", "6000.0", !1, "layout", "layout", "yoga"],
|
|
733
|
+
["font-size", "6000.0", !0, "layout", "layout", "textSize"],
|
|
734
|
+
["height", "6000.0", !1, "layout", "layout", "yoga"],
|
|
735
|
+
["justify-content", "6000.0", !1, "layout", "layout", "yoga"],
|
|
736
|
+
["left", "6000.0", !1, "layout", "layout", "yoga"],
|
|
737
|
+
["letter-spacing", "6000.0", !0, "paint", "layout", "textMeasureInferred"],
|
|
738
|
+
["margin", "6000.0", !1, "layout", "layout", "box"],
|
|
739
|
+
["margin-bottom", "6000.0", !1, "layout", "layout", "box"],
|
|
740
|
+
["margin-left", "6000.0", !1, "layout", "layout", "box"],
|
|
741
|
+
["margin-right", "6000.0", !1, "layout", "layout", "box"],
|
|
742
|
+
["margin-top", "6000.0", !1, "layout", "layout", "box"],
|
|
743
|
+
["max-height", "6000.0", !1, "layout", "layout", "yoga"],
|
|
744
|
+
["max-width", "6000.0", !1, "layout", "layout", "yoga"],
|
|
745
|
+
["min-height", "6000.0", !1, "layout", "layout", "yoga"],
|
|
746
|
+
["min-width", "6000.0", !1, "layout", "layout", "yoga"],
|
|
747
|
+
["opacity", "6000.0", !1, "paint", "paint", "colour"],
|
|
748
|
+
// Yoga is told about `hidden`, but at this Yoga version it never moves a box;
|
|
749
|
+
// what shows is the clipping, which is the CSS mapping's.
|
|
750
|
+
["overflow", "6000.0", !1, "paint", "paint", "overflowInferred"],
|
|
751
|
+
["padding", "6000.0", !1, "layout", "layout", "box"],
|
|
752
|
+
["padding-bottom", "6000.0", !1, "layout", "layout", "box"],
|
|
753
|
+
["padding-left", "6000.0", !1, "layout", "layout", "box"],
|
|
754
|
+
["padding-right", "6000.0", !1, "layout", "layout", "box"],
|
|
755
|
+
["padding-top", "6000.0", !1, "layout", "layout", "box"],
|
|
756
|
+
["position", "6000.0", !1, "layout", "layout", "yoga"],
|
|
757
|
+
["right", "6000.0", !1, "layout", "layout", "yoga"],
|
|
758
|
+
["rotate", "6000.0", !1, "paint", "paint", "transform"],
|
|
759
|
+
["scale", "6000.0", !1, "paint", "paint", "transform"],
|
|
760
|
+
["text-overflow", "6000.0", !1, "paint", "paint", "ellipsisInferred"],
|
|
761
|
+
["text-shadow", "6000.0", !0, "none", "paint", "textEffectInferred"],
|
|
762
|
+
["top", "6000.0", !1, "layout", "layout", "yoga"],
|
|
763
|
+
["transform-origin", "6000.0", !1, "paint", "paint", "transform"],
|
|
764
|
+
["transition", "6000.0", !1, "none", "none", "timeInferred"],
|
|
765
|
+
["transition-delay", "6000.0", !1, "none", "none", "timeInferred"],
|
|
766
|
+
["transition-duration", "6000.0", !1, "none", "none", "timeInferred"],
|
|
767
|
+
["transition-property", "6000.0", !1, "none", "none", "timeInferred"],
|
|
768
|
+
["transition-timing-function", "6000.0", !1, "none", "none", "timeInferred"],
|
|
769
|
+
["translate", "6000.0", !1, "paint", "paint", "transform"],
|
|
770
|
+
["-unity-animation-clip", "6000.6", !1, "none", "none", "timeInferred"],
|
|
771
|
+
["-unity-background-image-tint-color", "6000.0", !1, "none", "paint", "background"],
|
|
772
|
+
["-unity-background-scale-mode", "6000.0", !1, "paint", "paint", "background"],
|
|
773
|
+
["-unity-editor-text-rendering-mode", "6000.0", !0, "none", "paint", "renderingModeInferred"],
|
|
774
|
+
["-unity-font", "6000.0", !0, "none", "layout", "textMeasureInferred"],
|
|
775
|
+
["-unity-font-definition", "6000.0", !0, "none", "layout", "textMeasureInferred"],
|
|
776
|
+
["-unity-font-style", "6000.0", !0, "layout", "layout", "textMeasureInferred"],
|
|
777
|
+
["-unity-material", "6000.3", !0, "none", "paint", "effectInferred"],
|
|
778
|
+
["-unity-overflow-clip-box", "6000.0", !1, "none", "paint", "clipBoxInferred"],
|
|
779
|
+
["-unity-paragraph-spacing", "6000.0", !0, "none", "layout", "textMeasureInferred"],
|
|
780
|
+
["-unity-slice-bottom", "6000.0", !1, "none", "paint", "background"],
|
|
781
|
+
["-unity-slice-left", "6000.0", !1, "none", "paint", "background"],
|
|
782
|
+
["-unity-slice-right", "6000.0", !1, "none", "paint", "background"],
|
|
783
|
+
["-unity-slice-scale", "6000.0", !1, "none", "paint", "background"],
|
|
784
|
+
["-unity-slice-top", "6000.0", !1, "none", "paint", "background"],
|
|
785
|
+
["-unity-slice-type", "6000.0", !1, "none", "paint", "background"],
|
|
786
|
+
["-unity-text-align", "6000.0", !0, "paint", "paint", "textAlign"],
|
|
787
|
+
["-unity-text-auto-size", "6000.3", !0, "none", "paint", "autoSizeInferred"],
|
|
788
|
+
["-unity-text-generator", "6000.0", !0, "none", "layout", "textMeasureInferred"],
|
|
789
|
+
["-unity-text-outline", "6000.0", !1, "none", "paint", "textEffectInferred"],
|
|
790
|
+
["-unity-text-outline-color", "6000.0", !0, "none", "paint", "textEffectInferred"],
|
|
791
|
+
["-unity-text-outline-width", "6000.0", !0, "none", "paint", "textEffectInferred"],
|
|
792
|
+
["-unity-text-overflow-position", "6000.0", !1, "none", "paint", "ellipsisInferred"],
|
|
793
|
+
["visibility", "6000.0", !0, "paint", "paint", "visibility"],
|
|
794
|
+
["white-space", "6000.0", !0, "layout", "layout", "textMeasureInferred"],
|
|
795
|
+
["width", "6000.0", !1, "layout", "layout", "yoga"],
|
|
796
|
+
["word-spacing", "6000.0", !0, "paint", "layout", "textMeasureInferred"]
|
|
797
|
+
], Ge = Nt.map(
|
|
798
|
+
([e, n, t, s, r, o]) => ({
|
|
799
|
+
name: e,
|
|
800
|
+
since: n,
|
|
801
|
+
inherited: t,
|
|
802
|
+
handling: s,
|
|
803
|
+
unity: r,
|
|
804
|
+
basis: At[o],
|
|
805
|
+
inferred: o.endsWith("Inferred")
|
|
806
|
+
})
|
|
807
|
+
), jt = new Map(Ge.map((e) => [e.name, e]));
|
|
808
|
+
function zt(e) {
|
|
809
|
+
return jt.get(e);
|
|
810
|
+
}
|
|
811
|
+
const Lt = {
|
|
812
|
+
"font-family": ["-unity-font-definition"],
|
|
813
|
+
"font-weight": ["-unity-font-style"],
|
|
814
|
+
"font-style": ["-unity-font-style"],
|
|
815
|
+
"text-align": ["-unity-text-align"],
|
|
816
|
+
transform: ["translate", "rotate", "scale"],
|
|
817
|
+
"border-image": ["-unity-slice-left", "-unity-slice-top", "-unity-slice-right", "-unity-slice-bottom"],
|
|
818
|
+
"vertical-align": ["-unity-text-align"],
|
|
819
|
+
font: ["font-size", "-unity-font-definition", "-unity-font-style"],
|
|
820
|
+
inset: ["top", "right", "bottom", "left"],
|
|
821
|
+
"overflow-x": ["overflow"],
|
|
822
|
+
"overflow-y": ["overflow"]
|
|
823
|
+
}, Ut = {
|
|
824
|
+
"aspect-ratio": "not applied to layout by this preview",
|
|
825
|
+
"-unity-font": "font not loaded by this preview; the browser default is used",
|
|
826
|
+
"-unity-font-definition": "font not loaded by this preview; the browser default is used",
|
|
827
|
+
transition: "not animated by this preview",
|
|
828
|
+
"transition-delay": "not animated by this preview",
|
|
829
|
+
"transition-duration": "not animated by this preview",
|
|
830
|
+
"transition-property": "not animated by this preview",
|
|
831
|
+
"transition-timing-function": "not animated by this preview",
|
|
832
|
+
"animation-play-state": "not animated by this preview",
|
|
833
|
+
"-unity-animation-clip": "not animated by this preview"
|
|
834
|
+
}, _t = `6.${Object.keys(Ct.counts).sort().at(-1).slice(5)}`;
|
|
835
|
+
function Wt(e) {
|
|
836
|
+
return `Unity 6.${e.slice(5)}+`;
|
|
837
|
+
}
|
|
838
|
+
function Xe(e, n) {
|
|
839
|
+
if (e.startsWith("--")) return null;
|
|
840
|
+
const t = zt(e);
|
|
841
|
+
if (t === void 0) {
|
|
842
|
+
const o = Lt[e];
|
|
843
|
+
return {
|
|
844
|
+
message: `${e}: not in the USS property reference up to Unity ${_t}; ignored` + (o === void 0 ? "" : `; USS uses ${o.join(", ")}`),
|
|
845
|
+
reason: "not-uss",
|
|
846
|
+
subject: { kind: "property", property: e, value: n, ...o === void 0 ? {} : { replacements: o } }
|
|
847
|
+
};
|
|
848
|
+
}
|
|
849
|
+
const s = t.unity === "layout", r = t.since === "6000.0" ? "" : ` (${Wt(t.since)})`;
|
|
850
|
+
return t.handling === "paint" && s ? {
|
|
851
|
+
message: `${e}${r}: drawn, but left out of text measurement by this preview`,
|
|
852
|
+
reason: "not-rendered",
|
|
853
|
+
subject: { kind: "property", property: e, value: n, since: t.since, affectsLayout: s, applied: "paint" }
|
|
854
|
+
} : t.handling !== "none" ? null : {
|
|
855
|
+
message: `${e}${r}: ${Ut[e] ?? "not drawn by this preview"}`,
|
|
856
|
+
reason: "not-rendered",
|
|
857
|
+
subject: { kind: "property", property: e, value: n, since: t.since, affectsLayout: s }
|
|
858
|
+
};
|
|
667
859
|
}
|
|
668
|
-
|
|
860
|
+
const Pt = ["hover", "active", "inactive", "focus", "disabled", "enabled", "checked"], Ft = new Set(Ge.filter((e) => e.inherited).map((e) => e.name));
|
|
861
|
+
function Bt(e) {
|
|
862
|
+
return e.startsWith("--") || Ft.has(e);
|
|
863
|
+
}
|
|
864
|
+
function Oe(e) {
|
|
669
865
|
const n = [];
|
|
670
866
|
let t = 0, s = -1;
|
|
671
|
-
for (let
|
|
672
|
-
const
|
|
673
|
-
|
|
867
|
+
for (let r = 0; r < e.length; r++) {
|
|
868
|
+
const o = e[r];
|
|
869
|
+
o === "(" ? t++ : o === ")" && (t = Math.max(0, t - 1)), t === 0 && /\s/.test(o) ? s >= 0 && (n.push(e.slice(s, r)), s = -1) : s < 0 && (s = r);
|
|
674
870
|
}
|
|
675
871
|
return s >= 0 && n.push(e.slice(s)), n;
|
|
676
872
|
}
|
|
677
|
-
function
|
|
678
|
-
const [n, t, s,
|
|
679
|
-
return n === void 0 ? null : t === void 0 ? [n, n, n, n] : s === void 0 ? [n, t, n, t] :
|
|
873
|
+
function Ht(e) {
|
|
874
|
+
const [n, t, s, r] = e;
|
|
875
|
+
return n === void 0 ? null : t === void 0 ? [n, n, n, n] : s === void 0 ? [n, t, n, t] : r === void 0 ? [n, t, s, t] : [n, t, s, r];
|
|
680
876
|
}
|
|
681
|
-
const
|
|
877
|
+
const Vt = {
|
|
682
878
|
margin: ["margin-top", "margin-right", "margin-bottom", "margin-left"],
|
|
683
879
|
padding: ["padding-top", "padding-right", "padding-bottom", "padding-left"],
|
|
684
880
|
"border-width": [
|
|
@@ -701,21 +897,21 @@ const It = {
|
|
|
701
897
|
"border-bottom-left-radius"
|
|
702
898
|
]
|
|
703
899
|
};
|
|
704
|
-
function
|
|
900
|
+
function De(e) {
|
|
705
901
|
return /^-?(\d+\.?\d*|\.\d+)$/.test(e);
|
|
706
902
|
}
|
|
707
|
-
function
|
|
903
|
+
function Yt(e) {
|
|
708
904
|
const [n, t, s] = e;
|
|
709
|
-
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"]] : t === void 0 ?
|
|
905
|
+
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"]] : t === void 0 ? De(n) ? [["flex-grow", n], ["flex-shrink", "1"], ["flex-basis", "0"]] : [["flex-grow", "1"], ["flex-shrink", "1"], ["flex-basis", n]] : s === void 0 ? De(t) ? [["flex-grow", n], ["flex-shrink", t], ["flex-basis", "0"]] : [["flex-grow", n], ["flex-shrink", "1"], ["flex-basis", t]] : [["flex-grow", n], ["flex-shrink", t], ["flex-basis", s]];
|
|
710
906
|
}
|
|
711
|
-
function
|
|
712
|
-
if (e === "flex") return
|
|
713
|
-
const t =
|
|
907
|
+
function le(e, n) {
|
|
908
|
+
if (e === "flex") return Yt(Oe(n));
|
|
909
|
+
const t = Vt[e];
|
|
714
910
|
if (t === void 0) return [[e, n]];
|
|
715
|
-
const s =
|
|
716
|
-
return s === null ? [[e, n]] : t.map((
|
|
911
|
+
const s = Ht(Oe(n));
|
|
912
|
+
return s === null ? [[e, n]] : t.map((r, o) => [r, s[o]]);
|
|
717
913
|
}
|
|
718
|
-
const
|
|
914
|
+
const fe = {
|
|
719
915
|
"align-content": "flex-start",
|
|
720
916
|
"align-items": "stretch",
|
|
721
917
|
"align-self": "auto",
|
|
@@ -751,314 +947,335 @@ const ae = {
|
|
|
751
947
|
"padding-right": "0",
|
|
752
948
|
"padding-top": "0",
|
|
753
949
|
"font-size": "12px"
|
|
754
|
-
},
|
|
755
|
-
function
|
|
950
|
+
}, qt = ["em", "rem", "vh", "vw", "vmin", "vmax", "pt", "cm", "in"];
|
|
951
|
+
function ne(e) {
|
|
756
952
|
const n = e.trim();
|
|
757
|
-
if (n === "") return { length: null, problem: "empty value" };
|
|
953
|
+
if (n === "") return { length: null, problem: "empty value", reason: "invalid-value" };
|
|
758
954
|
if (n === "auto") return { length: { kind: "auto" } };
|
|
759
955
|
if (n === "none") return { length: { kind: "none" } };
|
|
760
956
|
if (n === "initial") return { length: { kind: "auto" } };
|
|
761
957
|
if (n.startsWith("calc("))
|
|
762
|
-
return { length: null, problem: "calc() is not
|
|
958
|
+
return { length: null, problem: "calc() is not evaluated", reason: "not-uss" };
|
|
763
959
|
const t = /^(-?(?:\d+\.?\d*|\.\d+))([a-z%]*)$/i.exec(n);
|
|
764
|
-
if (t === null)
|
|
765
|
-
|
|
766
|
-
|
|
960
|
+
if (t === null)
|
|
961
|
+
return { length: null, problem: `cannot read "${n}" as a length`, reason: "invalid-value" };
|
|
962
|
+
const s = Number(t[1]), r = t[2].toLowerCase();
|
|
963
|
+
return r === "" || r === "px" ? { length: { kind: "px", value: s } } : r === "%" ? { length: { kind: "percent", value: s } } : qt.includes(r) ? { length: null, problem: `unit "${r}" not recognised`, reason: "not-uss" } : { length: null, problem: `unknown unit "${r}"`, reason: "invalid-value" };
|
|
767
964
|
}
|
|
768
|
-
function
|
|
965
|
+
function Me(e) {
|
|
769
966
|
const n = e.trim();
|
|
770
967
|
return /^-?(\d+\.?\d*|\.\d+)$/.test(n) ? Number(n) : null;
|
|
771
968
|
}
|
|
772
|
-
let
|
|
773
|
-
async function
|
|
774
|
-
|
|
775
|
-
}
|
|
776
|
-
function
|
|
777
|
-
return
|
|
778
|
-
}
|
|
779
|
-
let
|
|
780
|
-
function
|
|
781
|
-
return
|
|
782
|
-
}
|
|
783
|
-
const
|
|
784
|
-
auto:
|
|
785
|
-
"flex-start":
|
|
786
|
-
center:
|
|
787
|
-
"flex-end":
|
|
788
|
-
stretch:
|
|
789
|
-
baseline:
|
|
790
|
-
"space-between":
|
|
791
|
-
"space-around":
|
|
792
|
-
"space-evenly":
|
|
793
|
-
},
|
|
794
|
-
"flex-start":
|
|
795
|
-
center:
|
|
796
|
-
"flex-end":
|
|
797
|
-
"space-between":
|
|
798
|
-
"space-around":
|
|
799
|
-
"space-evenly":
|
|
800
|
-
},
|
|
969
|
+
let be = null;
|
|
970
|
+
async function Nn() {
|
|
971
|
+
be ?? (be = await it());
|
|
972
|
+
}
|
|
973
|
+
function jn() {
|
|
974
|
+
return be !== null;
|
|
975
|
+
}
|
|
976
|
+
let Q = 0;
|
|
977
|
+
function zn() {
|
|
978
|
+
return Q;
|
|
979
|
+
}
|
|
980
|
+
const ce = {
|
|
981
|
+
auto: L.Auto,
|
|
982
|
+
"flex-start": L.FlexStart,
|
|
983
|
+
center: L.Center,
|
|
984
|
+
"flex-end": L.FlexEnd,
|
|
985
|
+
stretch: L.Stretch,
|
|
986
|
+
baseline: L.Baseline,
|
|
987
|
+
"space-between": L.SpaceBetween,
|
|
988
|
+
"space-around": L.SpaceAround,
|
|
989
|
+
"space-evenly": L.SpaceEvenly
|
|
990
|
+
}, Jt = {
|
|
991
|
+
"flex-start": B.FlexStart,
|
|
992
|
+
center: B.Center,
|
|
993
|
+
"flex-end": B.FlexEnd,
|
|
994
|
+
"space-between": B.SpaceBetween,
|
|
995
|
+
"space-around": B.SpaceAround,
|
|
996
|
+
"space-evenly": B.SpaceEvenly
|
|
997
|
+
}, Gt = {
|
|
801
998
|
column: G.Column,
|
|
802
999
|
"column-reverse": G.ColumnReverse,
|
|
803
1000
|
row: G.Row,
|
|
804
1001
|
"row-reverse": G.RowReverse
|
|
805
|
-
},
|
|
806
|
-
nowrap:
|
|
807
|
-
wrap:
|
|
808
|
-
"wrap-reverse":
|
|
809
|
-
},
|
|
810
|
-
["left",
|
|
811
|
-
["top",
|
|
812
|
-
["right",
|
|
813
|
-
["bottom",
|
|
1002
|
+
}, Xt = {
|
|
1003
|
+
nowrap: K.NoWrap,
|
|
1004
|
+
wrap: K.Wrap,
|
|
1005
|
+
"wrap-reverse": K.WrapReverse
|
|
1006
|
+
}, Zt = [
|
|
1007
|
+
["left", J.Left],
|
|
1008
|
+
["top", J.Top],
|
|
1009
|
+
["right", J.Right],
|
|
1010
|
+
["bottom", J.Bottom]
|
|
814
1011
|
];
|
|
815
|
-
function
|
|
816
|
-
const
|
|
817
|
-
if (
|
|
1012
|
+
function Kt(e, n, t, s) {
|
|
1013
|
+
const r = be;
|
|
1014
|
+
if (r === null)
|
|
818
1015
|
throw new Error("loadLayoutEngine() must be awaited before rendering");
|
|
819
|
-
const
|
|
820
|
-
let
|
|
821
|
-
const
|
|
822
|
-
var
|
|
823
|
-
return ((
|
|
1016
|
+
const o = [], d = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), x = [], h = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map();
|
|
1017
|
+
let c = 0, u = !1, p = !1;
|
|
1018
|
+
const i = (b, S) => {
|
|
1019
|
+
var I;
|
|
1020
|
+
return ((I = b.get(S)) == null ? void 0 : I.value) ?? fe[S] ?? "";
|
|
824
1021
|
};
|
|
825
|
-
function
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
1022
|
+
function y(b, S, I, E) {
|
|
1023
|
+
var D;
|
|
1024
|
+
(E == null ? void 0 : E.origin.kind) !== "inherited" && o.push({
|
|
1025
|
+
kind: "unsupported-property",
|
|
1026
|
+
message: b,
|
|
1027
|
+
node: S.id,
|
|
1028
|
+
...I,
|
|
1029
|
+
...E === void 0 ? {} : ((D = s.locate) == null ? void 0 : D.call(s, E.origin)) ?? {}
|
|
1030
|
+
});
|
|
1031
|
+
}
|
|
1032
|
+
function k(b, S, I) {
|
|
1033
|
+
const E = i(b, S);
|
|
1034
|
+
if (E === "") return null;
|
|
1035
|
+
const { length: D, problem: M, reason: A } = ne(E);
|
|
1036
|
+
return M !== void 0 && y(
|
|
1037
|
+
`${S}: ${M}`,
|
|
1038
|
+
I,
|
|
1039
|
+
{
|
|
1040
|
+
...A === void 0 ? {} : { reason: A },
|
|
1041
|
+
subject: { kind: "property", property: S, value: E }
|
|
1042
|
+
},
|
|
1043
|
+
b.get(S)
|
|
1044
|
+
), D;
|
|
1045
|
+
}
|
|
1046
|
+
function f(b) {
|
|
1047
|
+
if (b !== null)
|
|
1048
|
+
switch (b.kind) {
|
|
837
1049
|
case "px":
|
|
838
|
-
return
|
|
1050
|
+
return b.value;
|
|
839
1051
|
case "percent":
|
|
840
|
-
return `${
|
|
1052
|
+
return `${b.value}%`;
|
|
841
1053
|
case "auto":
|
|
842
1054
|
return "auto";
|
|
843
1055
|
case "none":
|
|
844
1056
|
return;
|
|
845
1057
|
}
|
|
846
1058
|
}
|
|
847
|
-
function m(
|
|
848
|
-
if (
|
|
849
|
-
if (
|
|
850
|
-
if (
|
|
1059
|
+
function m(b) {
|
|
1060
|
+
if (b !== null) {
|
|
1061
|
+
if (b.kind === "px") return b.value;
|
|
1062
|
+
if (b.kind === "percent") return `${b.value}%`;
|
|
851
1063
|
}
|
|
852
1064
|
}
|
|
853
|
-
function
|
|
854
|
-
|
|
855
|
-
const
|
|
856
|
-
(
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
1065
|
+
function v(b, S, I) {
|
|
1066
|
+
b.setBoxSizing(at.BorderBox), b.setFlexDirection(Gt[i(S, "flex-direction")] ?? G.Column), b.setFlexWrap(Xt[i(S, "flex-wrap")] ?? K.NoWrap), b.setJustifyContent(Jt[i(S, "justify-content")] ?? B.FlexStart), b.setAlignItems(ce[i(S, "align-items")] ?? L.Stretch), b.setAlignSelf(ce[i(S, "align-self")] ?? L.Auto), b.setAlignContent(ce[i(S, "align-content")] ?? L.FlexStart), b.setFlexGrow(Me(i(S, "flex-grow")) ?? 0), b.setFlexShrink(Me(i(S, "flex-shrink")) ?? 1), b.setFlexBasis(f(k(S, "flex-basis", I)));
|
|
1067
|
+
const E = i(S, "position");
|
|
1068
|
+
(E === "fixed" || E === "sticky") && y(`position: ${E} treated as relative`, I, {
|
|
1069
|
+
reason: "not-uss",
|
|
1070
|
+
subject: { kind: "property", property: "position", value: E }
|
|
1071
|
+
}, S.get("position")), b.setPositionType(
|
|
1072
|
+
E === "absolute" ? re.Absolute : re.Relative
|
|
1073
|
+
);
|
|
1074
|
+
const D = i(S, "display");
|
|
1075
|
+
D === "none" ? b.setDisplay(lt.None) : D !== "flex" && D !== "initial" && y(`display: ${D} laid out as flex`, I, {
|
|
1076
|
+
reason: "invalid-value",
|
|
1077
|
+
subject: { kind: "property", property: "display", value: D }
|
|
1078
|
+
}, S.get("display"));
|
|
1079
|
+
const M = i(S, "overflow");
|
|
1080
|
+
M === "hidden" ? b.setOverflow(ct.Hidden) : (M === "auto" || M === "scroll") && y(`overflow: ${M} ignored; nothing scrolls`, I, {
|
|
1081
|
+
reason: "not-uss",
|
|
1082
|
+
subject: { kind: "property", property: "overflow", value: M }
|
|
1083
|
+
}, S.get("overflow")), b.setWidth(f(k(S, "width", I))), b.setHeight(f(k(S, "height", I))), b.setMinWidth(m(k(S, "min-width", I))), b.setMinHeight(m(k(S, "min-height", I))), b.setMaxWidth(m(k(S, "max-width", I))), b.setMaxHeight(m(k(S, "max-height", I)));
|
|
1084
|
+
for (const [A, U] of Zt) {
|
|
1085
|
+
b.setMargin(U, m(k(S, `margin-${A}`, I))), b.setPadding(U, m(k(S, `padding-${A}`, I)));
|
|
1086
|
+
const _ = m(k(S, `border-${A}-width`, I));
|
|
1087
|
+
b.setBorder(U, typeof _ == "number" ? _ : void 0), b.setPosition(U, m(k(S, A, I)));
|
|
865
1088
|
}
|
|
866
1089
|
}
|
|
867
|
-
function
|
|
1090
|
+
function w(b) {
|
|
868
1091
|
var S;
|
|
869
|
-
return (S =
|
|
1092
|
+
return (S = b.attributes.find((I) => I.name === "text")) == null ? void 0 : S.value;
|
|
870
1093
|
}
|
|
871
|
-
const
|
|
872
|
-
function $(
|
|
873
|
-
return
|
|
874
|
-
(S) =>
|
|
1094
|
+
const g = ["text", "label"];
|
|
1095
|
+
function $(b) {
|
|
1096
|
+
return g.filter(
|
|
1097
|
+
(S) => b.attributes.some((I) => I.name === S && I.value.length > 0)
|
|
875
1098
|
);
|
|
876
1099
|
}
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
1100
|
+
let T = !1;
|
|
1101
|
+
function O(b, S) {
|
|
1102
|
+
if (de(b)) {
|
|
1103
|
+
b.name.local === "Bindings" && !T && (T = !0, o.push({
|
|
1104
|
+
kind: "unsupported-control",
|
|
1105
|
+
message: "Data bindings are not evaluated in this preview; bound values show as written",
|
|
1106
|
+
node: b.id,
|
|
1107
|
+
reason: "not-rendered",
|
|
1108
|
+
subject: { kind: "control", type: "Bindings" }
|
|
1109
|
+
}));
|
|
1110
|
+
return;
|
|
1111
|
+
}
|
|
1112
|
+
const I = n.get(b.id) ?? /* @__PURE__ */ new Map(), E = r.Node.create();
|
|
1113
|
+
c++, Q++, h.set(b, E), x.push(b), v(E, I, b), S !== null && S.insertChild(E, S.getChildCount());
|
|
1114
|
+
const { spec: D, fallback: M } = Y(b), A = w(b), U = D.hasText && A !== void 0 && A.length > 0;
|
|
1115
|
+
if (M) {
|
|
1116
|
+
const C = $(b);
|
|
1117
|
+
o.push({
|
|
885
1118
|
kind: "unsupported-control",
|
|
886
|
-
message: `<${
|
|
887
|
-
node:
|
|
1119
|
+
message: `<${b.name.local}> has no renderer in this version and is drawn as a plain VisualElement` + (C.length === 0 ? "" : `; its ${C.join(" and ")} attribute${C.length > 1 ? "s are" : " is"} not drawn`),
|
|
1120
|
+
node: b.id,
|
|
1121
|
+
reason: "not-rendered",
|
|
1122
|
+
subject: { kind: "control", type: b.name.local }
|
|
888
1123
|
});
|
|
889
1124
|
}
|
|
890
|
-
if (
|
|
891
|
-
|
|
892
|
-
`<${
|
|
893
|
-
|
|
1125
|
+
if (U) {
|
|
1126
|
+
b.children.some((N) => !de(N)) && y(
|
|
1127
|
+
`<${b.name.local}> has both a text attribute and children; children are not drawn`,
|
|
1128
|
+
b,
|
|
1129
|
+
{ reason: "not-rendered", subject: { kind: "control", type: b.name.local } }
|
|
894
1130
|
);
|
|
895
|
-
const
|
|
896
|
-
fontSize:
|
|
897
|
-
fontStyle:
|
|
898
|
-
whiteSpace:
|
|
1131
|
+
const C = k(I, "font-size", b), P = {
|
|
1132
|
+
fontSize: C !== null && C.kind === "px" ? C.value : 12,
|
|
1133
|
+
fontStyle: i(I, "-unity-font-style") || "normal",
|
|
1134
|
+
whiteSpace: i(I, "white-space") || "normal"
|
|
899
1135
|
};
|
|
900
|
-
|
|
901
|
-
(
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
Number.isFinite(
|
|
1136
|
+
E.setMeasureFunc(
|
|
1137
|
+
(N) => s.measureText(
|
|
1138
|
+
A,
|
|
1139
|
+
P,
|
|
1140
|
+
Number.isFinite(N) ? N : 0
|
|
905
1141
|
)
|
|
906
1142
|
);
|
|
907
1143
|
return;
|
|
908
1144
|
}
|
|
909
|
-
let
|
|
1145
|
+
let _ = E;
|
|
910
1146
|
if (D.parts.length > 0) {
|
|
911
|
-
|
|
1147
|
+
p || (p = !0, o.push({
|
|
912
1148
|
kind: "version-dependent",
|
|
913
|
-
message: `<${
|
|
914
|
-
node:
|
|
1149
|
+
message: `<${b.name.local}> drawn with built-in child elements measured on Unity ${te}`,
|
|
1150
|
+
node: b.id,
|
|
1151
|
+
reason: "version-dependent",
|
|
1152
|
+
subject: { kind: "control", type: b.name.local }
|
|
915
1153
|
}));
|
|
916
|
-
const
|
|
917
|
-
for (const
|
|
918
|
-
const
|
|
919
|
-
|
|
920
|
-
name:
|
|
921
|
-
owner:
|
|
1154
|
+
const C = [], P = [], N = t.get(b.id);
|
|
1155
|
+
for (const xe of D.parts) {
|
|
1156
|
+
const ke = (N == null ? void 0 : N.get(xe.name)) ?? /* @__PURE__ */ new Map(), Z = r.Node.create();
|
|
1157
|
+
c++, Q++, v(Z, ke, b), _.insertChild(Z, _.getChildCount()), _ = Z, P.push(Z), C.push({
|
|
1158
|
+
name: xe.name,
|
|
1159
|
+
owner: b.id,
|
|
922
1160
|
box: { left: 0, top: 0, width: 0, height: 0 },
|
|
923
|
-
style:
|
|
1161
|
+
style: ke
|
|
924
1162
|
});
|
|
925
1163
|
}
|
|
926
|
-
|
|
1164
|
+
a.set(b.id, C), l.set(b.id, P);
|
|
927
1165
|
}
|
|
928
|
-
for (const
|
|
1166
|
+
for (const C of b.children) O(C, _);
|
|
929
1167
|
}
|
|
930
1168
|
O(e, null);
|
|
931
|
-
const
|
|
932
|
-
|
|
933
|
-
const
|
|
934
|
-
for (let
|
|
1169
|
+
const R = h.get(e);
|
|
1170
|
+
R.setWidth(s.size.width), R.setHeight(s.size.height), R.setPositionType(re.Relative), R.calculateLayout(s.size.width, s.size.height, Se.LTR);
|
|
1171
|
+
const z = /* @__PURE__ */ new Map();
|
|
1172
|
+
for (let b = 0; b < 3; b++) {
|
|
935
1173
|
let S = !1;
|
|
936
|
-
for (const [
|
|
937
|
-
const D =
|
|
1174
|
+
for (const [I, E] of a) {
|
|
1175
|
+
const D = l.get(I);
|
|
938
1176
|
if (D === void 0) continue;
|
|
939
|
-
const
|
|
940
|
-
if (
|
|
941
|
-
const
|
|
942
|
-
(
|
|
1177
|
+
const M = E.findIndex((N) => N.name === "unity-content-viewport"), A = E.findIndex((N) => N.name === "unity-content-container");
|
|
1178
|
+
if (M === -1 || A === -1) continue;
|
|
1179
|
+
const U = D[M].getComputedLayout(), C = D[A].getComputedLayout().height > U.height + 0.01, P = Rt(C);
|
|
1180
|
+
(z.get(I) ?? 0) !== P && (z.set(I, P), D[M].setMargin(J.Right, P), S = !0);
|
|
943
1181
|
}
|
|
944
1182
|
if (!S) break;
|
|
945
|
-
|
|
946
|
-
}
|
|
947
|
-
function
|
|
948
|
-
const
|
|
949
|
-
if (
|
|
950
|
-
const D =
|
|
951
|
-
let
|
|
952
|
-
|
|
953
|
-
const
|
|
954
|
-
|
|
955
|
-
const
|
|
956
|
-
|
|
1183
|
+
R.calculateLayout(s.size.width, s.size.height, Se.LTR);
|
|
1184
|
+
}
|
|
1185
|
+
function W(b, S, I) {
|
|
1186
|
+
const E = h.get(b);
|
|
1187
|
+
if (E === void 0) return;
|
|
1188
|
+
const D = E.getComputedLayout();
|
|
1189
|
+
let M = S + D.left, A = I + D.top;
|
|
1190
|
+
d.set(b.id, { left: M, top: A, width: D.width, height: D.height });
|
|
1191
|
+
const U = a.get(b.id), _ = l.get(b.id);
|
|
1192
|
+
U !== void 0 && _ !== void 0 && U.forEach((C, P) => {
|
|
1193
|
+
const N = _[P].getComputedLayout();
|
|
1194
|
+
M += N.left, A += N.top, C.box = { left: M, top: A, width: N.width, height: N.height };
|
|
957
1195
|
});
|
|
958
|
-
for (const
|
|
1196
|
+
for (const C of b.children) W(C, M, A);
|
|
959
1197
|
}
|
|
960
|
-
return
|
|
961
|
-
boxes:
|
|
962
|
-
parts:
|
|
963
|
-
painted:
|
|
964
|
-
warnings:
|
|
1198
|
+
return W(e, 0, 0), {
|
|
1199
|
+
boxes: d,
|
|
1200
|
+
parts: a,
|
|
1201
|
+
painted: x,
|
|
1202
|
+
warnings: o,
|
|
965
1203
|
dispose() {
|
|
966
|
-
|
|
1204
|
+
u || (u = !0, R.freeRecursive(), Q -= c, h.clear(), l.clear());
|
|
967
1205
|
}
|
|
968
1206
|
};
|
|
969
1207
|
}
|
|
970
|
-
const
|
|
971
|
-
function
|
|
1208
|
+
const Qt = 1.2;
|
|
1209
|
+
function en(e) {
|
|
972
1210
|
var t;
|
|
973
1211
|
let n = null;
|
|
974
1212
|
if (e !== void 0) {
|
|
975
1213
|
const s = e.createElement("canvas");
|
|
976
1214
|
n = ((t = s.getContext) == null ? void 0 : t.call(s, "2d")) ?? null;
|
|
977
1215
|
}
|
|
978
|
-
return (s,
|
|
979
|
-
const
|
|
1216
|
+
return (s, r, o) => {
|
|
1217
|
+
const d = r.fontSize * Qt, a = (p) => {
|
|
980
1218
|
if (n === null)
|
|
981
|
-
return
|
|
982
|
-
const
|
|
983
|
-
return n.font = `${
|
|
1219
|
+
return p.length * r.fontSize * 0.5;
|
|
1220
|
+
const i = r.fontStyle.includes("bold") ? "bold" : "normal", y = r.fontStyle.includes("italic") ? "italic" : "normal";
|
|
1221
|
+
return n.font = `${y} ${i} ${r.fontSize}px sans-serif`, n.measureText(p).width;
|
|
984
1222
|
};
|
|
985
|
-
if (!(
|
|
986
|
-
const
|
|
1223
|
+
if (!(r.whiteSpace !== "nowrap" && r.whiteSpace !== "pre") || o <= 0) {
|
|
1224
|
+
const p = s.split(`
|
|
987
1225
|
`);
|
|
988
|
-
return { width:
|
|
1226
|
+
return { width: p.reduce((y, k) => Math.max(y, a(k)), 0), height: p.length * d };
|
|
989
1227
|
}
|
|
990
|
-
const
|
|
991
|
-
let
|
|
992
|
-
for (const
|
|
993
|
-
const
|
|
994
|
-
|
|
1228
|
+
const h = s.split(/\s+/).filter((p) => p.length > 0);
|
|
1229
|
+
let l = 1, c = 0, u = 0;
|
|
1230
|
+
for (const p of h) {
|
|
1231
|
+
const i = a(p), y = c === 0 ? 0 : a(" ");
|
|
1232
|
+
c > 0 && c + y + i > o ? (u = Math.max(u, c), l++, c = i) : c += y + i;
|
|
995
1233
|
}
|
|
996
|
-
return
|
|
1234
|
+
return u = Math.max(u, c), { width: u, height: l * d };
|
|
997
1235
|
};
|
|
998
1236
|
}
|
|
999
|
-
const
|
|
1000
|
-
"box-shadow",
|
|
1001
|
-
"filter",
|
|
1002
|
-
"backdrop-filter",
|
|
1003
|
-
"mix-blend-mode",
|
|
1004
|
-
"background-blend-mode",
|
|
1005
|
-
"clip-path",
|
|
1006
|
-
"mask",
|
|
1007
|
-
"outline",
|
|
1008
|
-
"line-height",
|
|
1009
|
-
"text-transform",
|
|
1010
|
-
"text-decoration",
|
|
1011
|
-
"z-index",
|
|
1012
|
-
"float",
|
|
1013
|
-
"clear",
|
|
1014
|
-
"border-style"
|
|
1015
|
-
]), Pt = /* @__PURE__ */ new Set([
|
|
1016
|
-
"gap",
|
|
1017
|
-
"row-gap",
|
|
1018
|
-
"column-gap",
|
|
1019
|
-
"aspect-ratio",
|
|
1020
|
-
"background-size",
|
|
1021
|
-
"background-position",
|
|
1022
|
-
"background-repeat",
|
|
1023
|
-
"overflow-wrap",
|
|
1024
|
-
"word-break"
|
|
1025
|
-
]), Ee = ["top", "right", "bottom", "left"], Bt = {
|
|
1237
|
+
const tn = ["top", "right", "bottom", "left"], nn = {
|
|
1026
1238
|
normal: { weight: "normal", style: "normal" },
|
|
1027
1239
|
bold: { weight: "bold", style: "normal" },
|
|
1028
1240
|
italic: { weight: "normal", style: "italic" },
|
|
1029
1241
|
"bold-and-italic": { weight: "bold", style: "italic" }
|
|
1030
|
-
},
|
|
1242
|
+
}, sn = {
|
|
1031
1243
|
upper: "flex-start",
|
|
1032
1244
|
middle: "center",
|
|
1033
1245
|
lower: "flex-end"
|
|
1034
|
-
},
|
|
1246
|
+
}, on = {
|
|
1035
1247
|
left: "flex-start",
|
|
1036
1248
|
center: "center",
|
|
1037
1249
|
right: "flex-end"
|
|
1038
|
-
},
|
|
1250
|
+
}, ue = {
|
|
1039
1251
|
"stretch-to-fill": "100% 100%",
|
|
1040
1252
|
"scale-and-crop": "cover",
|
|
1041
1253
|
"scale-to-fit": "contain"
|
|
1042
|
-
},
|
|
1043
|
-
function
|
|
1044
|
-
const n = /^(url|resource)\(\s*(["']?)(.*?)\2\s*\)$/.exec(
|
|
1254
|
+
}, Re = "stretch-to-fill";
|
|
1255
|
+
function rn(e) {
|
|
1256
|
+
const n = /^(url|resource)\(\s*(["']?)(.*?)\2\s*\)$/.exec(X(e).trim());
|
|
1045
1257
|
return n === null ? null : { form: n[1], path: n[3] };
|
|
1046
1258
|
}
|
|
1047
|
-
function
|
|
1048
|
-
var
|
|
1049
|
-
const s = {},
|
|
1050
|
-
var
|
|
1051
|
-
return (
|
|
1052
|
-
},
|
|
1053
|
-
|
|
1054
|
-
|
|
1259
|
+
function Ae(e, n, t = {}) {
|
|
1260
|
+
var k;
|
|
1261
|
+
const s = {}, r = [], o = (f) => {
|
|
1262
|
+
var m;
|
|
1263
|
+
return (m = e.get(f)) == null ? void 0 : m.value;
|
|
1264
|
+
}, d = (f, m, v = {}) => {
|
|
1265
|
+
var $, T, O;
|
|
1266
|
+
const w = (($ = v.subject) == null ? void 0 : $.kind) === "property" ? v.subject.property : ((T = v.subject) == null ? void 0 : T.kind) === "asset" ? "background-image" : void 0, g = w === void 0 ? void 0 : e.get(w);
|
|
1267
|
+
(g == null ? void 0 : g.origin.kind) !== "inherited" && r.push({
|
|
1268
|
+
kind: f,
|
|
1269
|
+
message: m,
|
|
1270
|
+
node: n,
|
|
1271
|
+
...v,
|
|
1272
|
+
...g === void 0 ? {} : ((O = t.locate) == null ? void 0 : O.call(t, g.origin)) ?? {}
|
|
1273
|
+
});
|
|
1274
|
+
}, a = (f, m = o(f)) => ({
|
|
1275
|
+
subject: { kind: "property", property: f, ...m === void 0 ? {} : { value: m } }
|
|
1276
|
+
});
|
|
1055
1277
|
s["box-sizing"] = "border-box";
|
|
1056
|
-
|
|
1057
|
-
Ft.has(p) ? u("unsupported-property", `${p} does not exist in USS and is ignored`) : Pt.has(p) && u(
|
|
1058
|
-
"version-dependent",
|
|
1059
|
-
`${p} depends on the Unity version; verify it in your project`
|
|
1060
|
-
);
|
|
1061
|
-
const c = [
|
|
1278
|
+
const x = [
|
|
1062
1279
|
"background-color",
|
|
1063
1280
|
"color",
|
|
1064
1281
|
"opacity",
|
|
@@ -1071,388 +1288,395 @@ function De(e, n, t = {}) {
|
|
|
1071
1288
|
"font-size",
|
|
1072
1289
|
"transform-origin"
|
|
1073
1290
|
];
|
|
1074
|
-
for (const
|
|
1075
|
-
const
|
|
1076
|
-
|
|
1077
|
-
}
|
|
1078
|
-
|
|
1079
|
-
for (const
|
|
1080
|
-
const
|
|
1081
|
-
if (
|
|
1082
|
-
const { length:
|
|
1083
|
-
|
|
1291
|
+
for (const f of x) {
|
|
1292
|
+
const m = o(f);
|
|
1293
|
+
m !== void 0 && (s[f] = m);
|
|
1294
|
+
}
|
|
1295
|
+
o("display") === "none" && (s.display = "none"), o("overflow") === "hidden" && (s.overflow = "hidden");
|
|
1296
|
+
for (const f of tn) {
|
|
1297
|
+
const m = o(`border-${f}-width`);
|
|
1298
|
+
if (m !== void 0 && m !== "0") {
|
|
1299
|
+
const { length: g, problem: $ } = ne(m);
|
|
1300
|
+
g === null || g.kind !== "px" ? d(
|
|
1084
1301
|
"unsupported-property",
|
|
1085
|
-
`border-${
|
|
1086
|
-
|
|
1302
|
+
`border-${f}-width: ${$ ?? `"${m}" is not a pixel length`}; ignored`,
|
|
1303
|
+
{ reason: "invalid-value", ...a(`border-${f}-width`) }
|
|
1304
|
+
) : (s[`border-${f}-width`] = `${g.value}px`, s[`border-${f}-style`] = "solid");
|
|
1087
1305
|
}
|
|
1088
|
-
const
|
|
1089
|
-
|
|
1090
|
-
const
|
|
1091
|
-
|
|
1306
|
+
const v = o(`border-${f}-color`);
|
|
1307
|
+
v !== void 0 && (s[`border-${f}-color`] = v);
|
|
1308
|
+
const w = o(`padding-${f}`);
|
|
1309
|
+
w !== void 0 && w !== "0" && (s[`padding-${f}`] = w);
|
|
1092
1310
|
}
|
|
1093
|
-
for (const
|
|
1311
|
+
for (const f of [
|
|
1094
1312
|
"top-left",
|
|
1095
1313
|
"top-right",
|
|
1096
1314
|
"bottom-right",
|
|
1097
1315
|
"bottom-left"
|
|
1098
1316
|
]) {
|
|
1099
|
-
const
|
|
1100
|
-
|
|
1101
|
-
}
|
|
1102
|
-
const
|
|
1103
|
-
if (
|
|
1104
|
-
const
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
const
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1317
|
+
const m = o(`border-${f}-radius`);
|
|
1318
|
+
m !== void 0 && (s[`border-${f}-radius`] = m);
|
|
1319
|
+
}
|
|
1320
|
+
const h = o("-unity-font-style");
|
|
1321
|
+
if (h !== void 0) {
|
|
1322
|
+
const f = nn[h];
|
|
1323
|
+
f === void 0 ? d("unsupported-property", `-unity-font-style: "${h}" ignored`, {
|
|
1324
|
+
reason: "invalid-value",
|
|
1325
|
+
...a("-unity-font-style")
|
|
1326
|
+
}) : (s["font-weight"] = f.weight, s["font-style"] = f.style);
|
|
1327
|
+
}
|
|
1328
|
+
const l = o("-unity-text-align");
|
|
1329
|
+
if (l !== void 0) {
|
|
1330
|
+
const [f, m] = l.split("-"), v = sn[f ?? ""], w = on[m ?? ""];
|
|
1331
|
+
v === void 0 || w === void 0 ? d("unsupported-property", `-unity-text-align: "${l}" ignored`, {
|
|
1332
|
+
reason: "invalid-value",
|
|
1333
|
+
...a("-unity-text-align")
|
|
1334
|
+
}) : (s["align-items"] = v, s["justify-content"] = w);
|
|
1335
|
+
}
|
|
1336
|
+
const c = [], u = o("translate");
|
|
1337
|
+
u !== void 0 && c.push(`translate(${u.replace(/\s+/, ", ")})`);
|
|
1338
|
+
const p = o("rotate");
|
|
1339
|
+
p !== void 0 && c.push(`rotate(${p})`);
|
|
1340
|
+
const i = o("scale");
|
|
1341
|
+
i !== void 0 && c.push(`scale(${i.replace(/\s+/, ", ")})`), c.length > 0 && (s.transform = c.join(" "));
|
|
1342
|
+
const y = o("background-image");
|
|
1343
|
+
if (y !== void 0 && y !== "none") {
|
|
1344
|
+
const f = rn(y);
|
|
1345
|
+
if (f === null)
|
|
1346
|
+
d("unsupported-property", `background-image: "${y}" is not an asset reference; ignored`, {
|
|
1347
|
+
reason: "not-uss",
|
|
1348
|
+
...a("background-image")
|
|
1349
|
+
});
|
|
1123
1350
|
else {
|
|
1124
|
-
const { form:
|
|
1125
|
-
if (
|
|
1126
|
-
s["background-image"] = "repeating-linear-gradient(45deg, rgba(255,0,255,0.35) 0 6px, rgba(0,0,0,0) 6px 12px)",
|
|
1351
|
+
const { form: m, path: v } = f, w = ((k = t.resolveAsset) == null ? void 0 : k.call(t, v, m)) ?? null;
|
|
1352
|
+
if (w === null)
|
|
1353
|
+
s["background-image"] = "repeating-linear-gradient(45deg, rgba(255,0,255,0.35) 0 6px, rgba(0,0,0,0) 6px 12px)", d("asset-unresolved", `background-image: "${v}" was not resolved`, {
|
|
1354
|
+
subject: { kind: "asset", path: v, form: m }
|
|
1355
|
+
});
|
|
1127
1356
|
else {
|
|
1128
|
-
s["background-image"] = `url("${
|
|
1129
|
-
const
|
|
1130
|
-
|
|
1357
|
+
s["background-image"] = `url("${w}")`, s["background-repeat"] = o("background-repeat") ?? "no-repeat", s["background-position"] = o("background-position") ?? "center";
|
|
1358
|
+
const g = o("background-size"), $ = o("-unity-background-scale-mode") ?? Re, T = ue[$];
|
|
1359
|
+
T === void 0 && d(
|
|
1131
1360
|
"unsupported-property",
|
|
1132
|
-
`-unity-background-scale-mode: ${
|
|
1133
|
-
|
|
1361
|
+
`-unity-background-scale-mode: "${$}" ignored; expected one of ${Object.keys(ue).join(", ")}`,
|
|
1362
|
+
{ reason: "invalid-value", ...a("-unity-background-scale-mode", $) }
|
|
1363
|
+
), s["background-size"] = g ?? T ?? ue[Re];
|
|
1134
1364
|
}
|
|
1135
1365
|
}
|
|
1136
1366
|
}
|
|
1137
|
-
return
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
}
|
|
1145
|
-
const Gt = "data-uxml-node", Jt = "data-uxml-part", Xt = "data-uxml-part-owner";
|
|
1146
|
-
function Yt(e, n, t, s, i, r) {
|
|
1147
|
-
const u = [], c = /* @__PURE__ */ new Map();
|
|
1148
|
-
function v(f) {
|
|
1149
|
-
const l = s.get(f.id), h = (g) => {
|
|
1367
|
+
return { declarations: s, warnings: r };
|
|
1368
|
+
}
|
|
1369
|
+
const an = "data-uxml-node", ln = "data-uxml-part", cn = "data-uxml-part-owner";
|
|
1370
|
+
function un(e, n, t, s, r, o) {
|
|
1371
|
+
const d = [], a = /* @__PURE__ */ new Map();
|
|
1372
|
+
function x(u) {
|
|
1373
|
+
const p = s.get(u.id), i = (y) => {
|
|
1150
1374
|
var m;
|
|
1151
|
-
const
|
|
1152
|
-
return
|
|
1375
|
+
const k = ((m = p == null ? void 0 : p.get(y)) == null ? void 0 : m.value) ?? fe[y] ?? "0", { length: f } = ne(k);
|
|
1376
|
+
return f !== null && f.kind === "px" ? f.value : 0;
|
|
1153
1377
|
};
|
|
1154
|
-
return { left:
|
|
1378
|
+
return { left: i("border-left-width"), top: i("border-top-width") };
|
|
1155
1379
|
}
|
|
1156
|
-
function
|
|
1157
|
-
const
|
|
1158
|
-
var
|
|
1159
|
-
const
|
|
1160
|
-
return
|
|
1380
|
+
function h(u) {
|
|
1381
|
+
const p = (i) => {
|
|
1382
|
+
var f;
|
|
1383
|
+
const y = ((f = u.style.get(i)) == null ? void 0 : f.value) ?? fe[i] ?? "0", { length: k } = ne(y);
|
|
1384
|
+
return k !== null && k.kind === "px" ? k.value : 0;
|
|
1161
1385
|
};
|
|
1162
|
-
return { left:
|
|
1163
|
-
}
|
|
1164
|
-
function
|
|
1165
|
-
var
|
|
1166
|
-
const
|
|
1167
|
-
if (
|
|
1168
|
-
const
|
|
1169
|
-
|
|
1170
|
-
const
|
|
1171
|
-
|
|
1172
|
-
const
|
|
1386
|
+
return { left: p("border-left-width"), top: p("border-top-width") };
|
|
1387
|
+
}
|
|
1388
|
+
function l(u, p, i) {
|
|
1389
|
+
var O;
|
|
1390
|
+
const y = n.get(u.id);
|
|
1391
|
+
if (y === void 0) return null;
|
|
1392
|
+
const k = o.document.createElement("div");
|
|
1393
|
+
k.setAttribute(an, String(u.id));
|
|
1394
|
+
const f = s.get(u.id) ?? /* @__PURE__ */ new Map(), m = Ae(f, u.id, o);
|
|
1395
|
+
d.push(...m.warnings);
|
|
1396
|
+
const v = p === null ? 0 : y.left - p.left - i.left, w = p === null ? 0 : y.top - p.top - i.top, g = {
|
|
1173
1397
|
position: "absolute",
|
|
1174
|
-
left: `${
|
|
1175
|
-
top: `${
|
|
1176
|
-
width: `${
|
|
1177
|
-
height: `${
|
|
1398
|
+
left: `${v}px`,
|
|
1399
|
+
top: `${w}px`,
|
|
1400
|
+
width: `${y.width}px`,
|
|
1401
|
+
height: `${y.height}px`,
|
|
1178
1402
|
margin: "0",
|
|
1179
1403
|
...m.declarations
|
|
1180
1404
|
};
|
|
1181
|
-
for (const [
|
|
1182
|
-
|
|
1183
|
-
const { spec: $ } =
|
|
1184
|
-
if ($.hasText &&
|
|
1185
|
-
|
|
1405
|
+
for (const [R, z] of Object.entries(g))
|
|
1406
|
+
k.style.setProperty(R, z);
|
|
1407
|
+
const { spec: $ } = Y(u), T = (O = u.attributes.find((R) => R.name === "text")) == null ? void 0 : O.value;
|
|
1408
|
+
if ($.hasText && T !== void 0 && T.length > 0)
|
|
1409
|
+
k.style.setProperty("display", m.declarations.display ?? "flex"), m.declarations["align-items"] === void 0 && k.style.setProperty("align-items", "flex-start"), m.declarations["justify-content"] === void 0 && k.style.setProperty("justify-content", "flex-start"), k.textContent = X(T);
|
|
1186
1410
|
else {
|
|
1187
|
-
let
|
|
1188
|
-
for (const
|
|
1189
|
-
const
|
|
1190
|
-
|
|
1191
|
-
const
|
|
1192
|
-
|
|
1193
|
-
const
|
|
1411
|
+
let R = k, z = y, W = x(u);
|
|
1412
|
+
for (const b of t.get(u.id) ?? []) {
|
|
1413
|
+
const S = o.document.createElement("div");
|
|
1414
|
+
S.setAttribute(ln, b.name), S.setAttribute(cn, String(u.id));
|
|
1415
|
+
const I = Ae(b.style, u.id, o);
|
|
1416
|
+
d.push(...I.warnings);
|
|
1417
|
+
const E = {
|
|
1194
1418
|
position: "absolute",
|
|
1195
|
-
left: `${
|
|
1196
|
-
top: `${
|
|
1197
|
-
width: `${
|
|
1198
|
-
height: `${
|
|
1419
|
+
left: `${b.box.left - z.left - W.left}px`,
|
|
1420
|
+
top: `${b.box.top - z.top - W.top}px`,
|
|
1421
|
+
width: `${b.box.width}px`,
|
|
1422
|
+
height: `${b.box.height}px`,
|
|
1199
1423
|
margin: "0",
|
|
1200
|
-
...
|
|
1424
|
+
...I.declarations
|
|
1201
1425
|
};
|
|
1202
|
-
for (const [
|
|
1203
|
-
|
|
1204
|
-
|
|
1426
|
+
for (const [D, M] of Object.entries(E))
|
|
1427
|
+
S.style.setProperty(D, M);
|
|
1428
|
+
R.appendChild(S), R = S, z = b.box, W = h(b);
|
|
1205
1429
|
}
|
|
1206
|
-
for (const
|
|
1207
|
-
const
|
|
1208
|
-
|
|
1430
|
+
for (const b of u.children) {
|
|
1431
|
+
const S = l(b, z, W);
|
|
1432
|
+
S !== null && R.appendChild(S);
|
|
1209
1433
|
}
|
|
1210
1434
|
}
|
|
1211
|
-
return
|
|
1435
|
+
return a.set(u.id, k), k;
|
|
1212
1436
|
}
|
|
1213
|
-
|
|
1214
|
-
const
|
|
1215
|
-
return
|
|
1437
|
+
r.replaceChildren();
|
|
1438
|
+
const c = l(e, null, { left: 0, top: 0 });
|
|
1439
|
+
return c !== null && (c.style.setProperty("position", "relative"), r.appendChild(c)), { warnings: d, elements: a };
|
|
1216
1440
|
}
|
|
1217
|
-
const
|
|
1218
|
-
function
|
|
1441
|
+
const Ce = /[A-Za-z0-9_-]/;
|
|
1442
|
+
function V(e) {
|
|
1219
1443
|
return e === " " || e === " " || e === `
|
|
1220
1444
|
` || e === "\r" || e === "\f";
|
|
1221
1445
|
}
|
|
1222
|
-
function
|
|
1223
|
-
let s = n,
|
|
1446
|
+
function pe(e, n, t) {
|
|
1447
|
+
let s = n, r = 0;
|
|
1224
1448
|
for (; s < e.length; ) {
|
|
1225
|
-
const
|
|
1226
|
-
if (
|
|
1227
|
-
const
|
|
1228
|
-
s =
|
|
1449
|
+
const o = e[s];
|
|
1450
|
+
if (o === '"' || o === "'") {
|
|
1451
|
+
const d = e.indexOf(o, s + 1);
|
|
1452
|
+
s = d < 0 ? e.length : d + 1;
|
|
1229
1453
|
continue;
|
|
1230
1454
|
}
|
|
1231
|
-
if (
|
|
1232
|
-
const
|
|
1233
|
-
s =
|
|
1455
|
+
if (o === "/" && e[s + 1] === "*") {
|
|
1456
|
+
const d = e.indexOf("*/", s + 2);
|
|
1457
|
+
s = d < 0 ? e.length : d + 2;
|
|
1234
1458
|
continue;
|
|
1235
1459
|
}
|
|
1236
|
-
if (
|
|
1237
|
-
|
|
1238
|
-
else if (
|
|
1239
|
-
|
|
1240
|
-
else if (
|
|
1460
|
+
if (o === "(" || o === "[")
|
|
1461
|
+
r++;
|
|
1462
|
+
else if (o === ")" || o === "]")
|
|
1463
|
+
r > 0 && r--;
|
|
1464
|
+
else if (r === 0 && t.includes(o))
|
|
1241
1465
|
return s;
|
|
1242
1466
|
s++;
|
|
1243
1467
|
}
|
|
1244
1468
|
return e.length;
|
|
1245
1469
|
}
|
|
1246
|
-
function
|
|
1247
|
-
let s = n,
|
|
1248
|
-
for (; s <
|
|
1249
|
-
for (;
|
|
1250
|
-
return { start: s, end:
|
|
1251
|
-
}
|
|
1252
|
-
function
|
|
1253
|
-
const
|
|
1254
|
-
let
|
|
1255
|
-
for (;
|
|
1256
|
-
for (;
|
|
1257
|
-
if (e.startsWith("/*",
|
|
1258
|
-
const
|
|
1259
|
-
|
|
1470
|
+
function Ze(e, n, t) {
|
|
1471
|
+
let s = n, r = t;
|
|
1472
|
+
for (; s < r && V(e[s]); ) s++;
|
|
1473
|
+
for (; r > s && V(e[r - 1]); ) r--;
|
|
1474
|
+
return { start: s, end: r };
|
|
1475
|
+
}
|
|
1476
|
+
function Ke(e, n, t, s) {
|
|
1477
|
+
const r = [];
|
|
1478
|
+
let o = n;
|
|
1479
|
+
for (; o < t; ) {
|
|
1480
|
+
for (; o < t && (V(e[o]) || e.startsWith("/*", o)); )
|
|
1481
|
+
if (e.startsWith("/*", o)) {
|
|
1482
|
+
const l = e.indexOf("*/", o + 2);
|
|
1483
|
+
o = l < 0 ? t : l + 2;
|
|
1260
1484
|
} else
|
|
1261
|
-
|
|
1262
|
-
if (
|
|
1263
|
-
if (e[
|
|
1264
|
-
|
|
1485
|
+
o++;
|
|
1486
|
+
if (o >= t) break;
|
|
1487
|
+
if (e[o] === ";") {
|
|
1488
|
+
o++;
|
|
1265
1489
|
continue;
|
|
1266
1490
|
}
|
|
1267
|
-
const
|
|
1268
|
-
if (
|
|
1269
|
-
const
|
|
1270
|
-
s == null || s("declaration without a value",
|
|
1491
|
+
const d = o, a = pe(e, d, ":;}");
|
|
1492
|
+
if (a >= t || e[a] !== ":") {
|
|
1493
|
+
const l = Math.min(a, t);
|
|
1494
|
+
s == null || s("declaration without a value", d, l), o = l + 1;
|
|
1271
1495
|
continue;
|
|
1272
1496
|
}
|
|
1273
|
-
const
|
|
1274
|
-
|
|
1275
|
-
property: e.slice(
|
|
1276
|
-
value: e.slice(
|
|
1277
|
-
span: { start:
|
|
1497
|
+
const x = Math.min(pe(e, a + 1, ";}"), t), h = Ze(e, a + 1, x);
|
|
1498
|
+
r.push({
|
|
1499
|
+
property: e.slice(d, a).trim(),
|
|
1500
|
+
value: e.slice(h.start, h.end),
|
|
1501
|
+
span: { start: d, end: h.end },
|
|
1278
1502
|
dirty: !1
|
|
1279
|
-
}),
|
|
1503
|
+
}), o = x + 1;
|
|
1280
1504
|
}
|
|
1281
|
-
return
|
|
1505
|
+
return r;
|
|
1282
1506
|
}
|
|
1283
|
-
function
|
|
1507
|
+
function dn(e) {
|
|
1284
1508
|
const n = e.span.end - 1 - e.value.length;
|
|
1285
1509
|
return n < e.span.start ? null : n;
|
|
1286
1510
|
}
|
|
1287
|
-
function
|
|
1288
|
-
const s = [],
|
|
1289
|
-
let
|
|
1290
|
-
function
|
|
1511
|
+
function ve(e, n = null, t = 0) {
|
|
1512
|
+
const s = [], r = [];
|
|
1513
|
+
let o = 0;
|
|
1514
|
+
function d(m, v, w) {
|
|
1291
1515
|
s.push({
|
|
1292
1516
|
kind: "malformed",
|
|
1293
1517
|
message: m,
|
|
1294
|
-
at: { in: "uss", sheet: t, span: { start:
|
|
1518
|
+
at: { in: "uss", sheet: t, span: { start: v, end: w } }
|
|
1295
1519
|
});
|
|
1296
1520
|
}
|
|
1297
|
-
function
|
|
1521
|
+
function a() {
|
|
1298
1522
|
for (; ; ) {
|
|
1299
|
-
for (;
|
|
1300
|
-
if (e.startsWith("/*",
|
|
1301
|
-
const m = e.indexOf("*/",
|
|
1302
|
-
|
|
1523
|
+
for (; V(e[o]); ) o++;
|
|
1524
|
+
if (e.startsWith("/*", o)) {
|
|
1525
|
+
const m = e.indexOf("*/", o + 2);
|
|
1526
|
+
o = m < 0 ? e.length : m + 2;
|
|
1303
1527
|
continue;
|
|
1304
1528
|
}
|
|
1305
1529
|
return;
|
|
1306
1530
|
}
|
|
1307
1531
|
}
|
|
1308
|
-
const
|
|
1309
|
-
function
|
|
1310
|
-
let
|
|
1311
|
-
for (;
|
|
1312
|
-
const
|
|
1313
|
-
if (
|
|
1314
|
-
const $ = e.indexOf(
|
|
1315
|
-
|
|
1532
|
+
const x = (m, v) => pe(e, m, v), h = (m, v) => Ze(e, m, v);
|
|
1533
|
+
function l(m) {
|
|
1534
|
+
let v = m + 1, w = 1;
|
|
1535
|
+
for (; v < e.length; ) {
|
|
1536
|
+
const g = e[v];
|
|
1537
|
+
if (g === '"' || g === "'") {
|
|
1538
|
+
const $ = e.indexOf(g, v + 1);
|
|
1539
|
+
v = $ < 0 ? e.length : $ + 1;
|
|
1316
1540
|
continue;
|
|
1317
1541
|
}
|
|
1318
|
-
if (
|
|
1319
|
-
const $ = e.indexOf("*/",
|
|
1320
|
-
|
|
1542
|
+
if (g === "/" && e[v + 1] === "*") {
|
|
1543
|
+
const $ = e.indexOf("*/", v + 2);
|
|
1544
|
+
v = $ < 0 ? e.length : $ + 2;
|
|
1321
1545
|
continue;
|
|
1322
1546
|
}
|
|
1323
|
-
if (
|
|
1324
|
-
else if (
|
|
1325
|
-
|
|
1547
|
+
if (g === "{") w++;
|
|
1548
|
+
else if (g === "}" && --w === 0) return v + 1;
|
|
1549
|
+
v++;
|
|
1326
1550
|
}
|
|
1327
1551
|
return e.length;
|
|
1328
1552
|
}
|
|
1329
|
-
function
|
|
1330
|
-
let
|
|
1331
|
-
for (;
|
|
1332
|
-
return
|
|
1333
|
-
}
|
|
1334
|
-
function
|
|
1335
|
-
const
|
|
1336
|
-
let
|
|
1337
|
-
for (;
|
|
1338
|
-
const
|
|
1339
|
-
if (
|
|
1340
|
-
const
|
|
1341
|
-
|
|
1553
|
+
function c(m) {
|
|
1554
|
+
let v = m;
|
|
1555
|
+
for (; v < e.length && Ce.test(e[v]); ) v++;
|
|
1556
|
+
return v;
|
|
1557
|
+
}
|
|
1558
|
+
function u(m) {
|
|
1559
|
+
const v = e[m], w = v === "(" ? ")" : "]";
|
|
1560
|
+
let g = m + 1, $ = 1;
|
|
1561
|
+
for (; g < e.length; ) {
|
|
1562
|
+
const T = e[g];
|
|
1563
|
+
if (T === '"' || T === "'") {
|
|
1564
|
+
const O = e.indexOf(T, g + 1);
|
|
1565
|
+
g = O < 0 ? e.length : O + 1;
|
|
1342
1566
|
continue;
|
|
1343
1567
|
}
|
|
1344
|
-
if (
|
|
1345
|
-
else if (
|
|
1346
|
-
|
|
1568
|
+
if (T === v) $++;
|
|
1569
|
+
else if (T === w && --$ === 0) return g + 1;
|
|
1570
|
+
g++;
|
|
1347
1571
|
}
|
|
1348
1572
|
return e.length;
|
|
1349
1573
|
}
|
|
1350
|
-
function
|
|
1351
|
-
const
|
|
1352
|
-
let
|
|
1353
|
-
for (;
|
|
1354
|
-
const $ = e[
|
|
1355
|
-
if (
|
|
1574
|
+
function p(m, v) {
|
|
1575
|
+
const w = [];
|
|
1576
|
+
let g = m;
|
|
1577
|
+
for (; g < v; ) {
|
|
1578
|
+
const $ = e[g];
|
|
1579
|
+
if (V($) || $ === ">" || $ === "+" || $ === "~" || $ === ",") break;
|
|
1356
1580
|
if ($ === "*")
|
|
1357
|
-
|
|
1581
|
+
w.push({ kind: "universal" }), g++;
|
|
1358
1582
|
else if ($ === "." || $ === "#") {
|
|
1359
|
-
const
|
|
1360
|
-
|
|
1361
|
-
$ === "." ? { kind: "class", name: e.slice(
|
|
1362
|
-
),
|
|
1583
|
+
const T = c(g + 1);
|
|
1584
|
+
w.push(
|
|
1585
|
+
$ === "." ? { kind: "class", name: e.slice(g + 1, T) } : { kind: "name", name: e.slice(g + 1, T) }
|
|
1586
|
+
), g = T;
|
|
1363
1587
|
} else if ($ === "[") {
|
|
1364
|
-
const
|
|
1365
|
-
|
|
1588
|
+
const T = Math.min(u(g), v);
|
|
1589
|
+
w.push({ kind: "unknown", text: e.slice(g, T) }), g = T;
|
|
1366
1590
|
} else if ($ === ":")
|
|
1367
|
-
if (e[
|
|
1368
|
-
const
|
|
1369
|
-
|
|
1591
|
+
if (e[g + 1] === ":") {
|
|
1592
|
+
const T = c(g + 2);
|
|
1593
|
+
w.push({ kind: "unknown", text: e.slice(g, T) }), g = T;
|
|
1370
1594
|
} else {
|
|
1371
|
-
const
|
|
1372
|
-
if (e[
|
|
1373
|
-
const
|
|
1374
|
-
|
|
1595
|
+
const T = c(g + 1);
|
|
1596
|
+
if (e[T] === "(") {
|
|
1597
|
+
const O = Math.min(u(T), v);
|
|
1598
|
+
w.push({ kind: "unknown", text: e.slice(g, O) }), g = O;
|
|
1375
1599
|
} else
|
|
1376
|
-
|
|
1600
|
+
w.push({ kind: "pseudo", name: e.slice(g + 1, T) }), g = T;
|
|
1377
1601
|
}
|
|
1378
|
-
else if (
|
|
1379
|
-
const
|
|
1380
|
-
|
|
1602
|
+
else if (Ce.test($)) {
|
|
1603
|
+
const T = c(g);
|
|
1604
|
+
w.push({ kind: "type", name: e.slice(g, T) }), g = T;
|
|
1381
1605
|
} else
|
|
1382
|
-
|
|
1606
|
+
w.push({ kind: "unknown", text: $ }), g++;
|
|
1383
1607
|
}
|
|
1384
|
-
return { simple:
|
|
1385
|
-
}
|
|
1386
|
-
function
|
|
1387
|
-
const
|
|
1388
|
-
let $ = "descendant",
|
|
1389
|
-
for (;
|
|
1390
|
-
const
|
|
1391
|
-
if (
|
|
1392
|
-
|
|
1608
|
+
return { simple: w, next: g };
|
|
1609
|
+
}
|
|
1610
|
+
function i(m, v) {
|
|
1611
|
+
const w = h(m, v), g = [];
|
|
1612
|
+
let $ = "descendant", T = null, O = w.start;
|
|
1613
|
+
for (; O < w.end; ) {
|
|
1614
|
+
const R = e[O];
|
|
1615
|
+
if (V(R)) {
|
|
1616
|
+
O++;
|
|
1393
1617
|
continue;
|
|
1394
1618
|
}
|
|
1395
|
-
if (
|
|
1396
|
-
$ = "child",
|
|
1619
|
+
if (R === ">") {
|
|
1620
|
+
$ = "child", O++;
|
|
1397
1621
|
continue;
|
|
1398
1622
|
}
|
|
1399
|
-
if (
|
|
1400
|
-
|
|
1623
|
+
if (R === "+" || R === "~") {
|
|
1624
|
+
T = R, O++;
|
|
1401
1625
|
continue;
|
|
1402
1626
|
}
|
|
1403
|
-
const { simple:
|
|
1404
|
-
if (
|
|
1405
|
-
|
|
1627
|
+
const { simple: z, next: W } = p(O, w.end);
|
|
1628
|
+
if (W === O) {
|
|
1629
|
+
O++;
|
|
1406
1630
|
continue;
|
|
1407
1631
|
}
|
|
1408
|
-
|
|
1632
|
+
T !== null && (z.unshift({ kind: "unknown", text: T }), T = null), g.push({ combinator: $, simple: z }), $ = "descendant", O = W;
|
|
1409
1633
|
}
|
|
1410
|
-
return { parts:
|
|
1634
|
+
return { parts: g, span: w };
|
|
1411
1635
|
}
|
|
1412
|
-
function
|
|
1413
|
-
const
|
|
1414
|
-
let
|
|
1636
|
+
function y(m, v) {
|
|
1637
|
+
const w = [];
|
|
1638
|
+
let g = m;
|
|
1415
1639
|
for (; ; ) {
|
|
1416
|
-
const $ = Math.min(
|
|
1417
|
-
if (
|
|
1418
|
-
|
|
1640
|
+
const $ = Math.min(x(g, ","), v);
|
|
1641
|
+
if (w.push(i(g, $)), $ >= v) break;
|
|
1642
|
+
g = $ + 1;
|
|
1419
1643
|
}
|
|
1420
|
-
return
|
|
1644
|
+
return w;
|
|
1421
1645
|
}
|
|
1422
|
-
function
|
|
1423
|
-
const m =
|
|
1424
|
-
if (
|
|
1425
|
-
const
|
|
1426
|
-
return
|
|
1646
|
+
function k() {
|
|
1647
|
+
const m = o, v = c(o + 1), w = e.slice(o + 1, v), g = x(v, "{;");
|
|
1648
|
+
if (g < e.length && e[g] === "{") {
|
|
1649
|
+
const T = l(g);
|
|
1650
|
+
return o = T, { kind: "unknown", span: { start: m, end: T } };
|
|
1427
1651
|
}
|
|
1428
|
-
const $ =
|
|
1429
|
-
if (
|
|
1430
|
-
const
|
|
1431
|
-
return
|
|
1652
|
+
const $ = g < e.length ? g + 1 : e.length;
|
|
1653
|
+
if (o = $, w === "import") {
|
|
1654
|
+
const T = e.slice(v, $), O = /["']([^"']*)["']/.exec(T);
|
|
1655
|
+
return O === null ? (d("@import without a quoted path", m, $), { kind: "unknown", span: { start: m, end: $ } }) : { kind: "import", url: O[1], span: { start: m, end: $ } };
|
|
1432
1656
|
}
|
|
1433
1657
|
return { kind: "unknown", span: { start: m, end: $ } };
|
|
1434
1658
|
}
|
|
1435
|
-
function
|
|
1436
|
-
const m =
|
|
1437
|
-
if (
|
|
1438
|
-
return
|
|
1439
|
-
const
|
|
1440
|
-
(
|
|
1659
|
+
function f() {
|
|
1660
|
+
const m = o, v = x(m, "{");
|
|
1661
|
+
if (v >= e.length)
|
|
1662
|
+
return d("rule without a block", m, e.length), o = e.length, { kind: "unknown", span: { start: m, end: e.length } };
|
|
1663
|
+
const w = h(m, v), g = l(v);
|
|
1664
|
+
(g > e.length || e[g - 1] !== "}") && d("unterminated rule block", m, g);
|
|
1441
1665
|
const $ = {
|
|
1442
|
-
selectors:
|
|
1443
|
-
declarations:
|
|
1444
|
-
span: { start:
|
|
1445
|
-
selectorSpan:
|
|
1666
|
+
selectors: y(w.start, w.end),
|
|
1667
|
+
declarations: Ke(e, v + 1, g - 1, d),
|
|
1668
|
+
span: { start: w.start, end: g },
|
|
1669
|
+
selectorSpan: w,
|
|
1446
1670
|
selectorDirty: !1,
|
|
1447
1671
|
declarationsDirty: !1
|
|
1448
1672
|
};
|
|
1449
|
-
return
|
|
1673
|
+
return o = g, { kind: "rule", rule: $ };
|
|
1450
1674
|
}
|
|
1451
|
-
for (;
|
|
1452
|
-
|
|
1453
|
-
return { sheet: { source: e, origin: n, items:
|
|
1675
|
+
for (; a(), !(o >= e.length); )
|
|
1676
|
+
r.push(e[o] === "@" ? k() : f());
|
|
1677
|
+
return { sheet: { source: e, origin: n, items: r }, warnings: s };
|
|
1454
1678
|
}
|
|
1455
|
-
function
|
|
1679
|
+
function fn(e, n, t) {
|
|
1456
1680
|
switch (e.kind) {
|
|
1457
1681
|
case "universal":
|
|
1458
1682
|
return !0;
|
|
@@ -1468,61 +1692,61 @@ function Zt(e, n, t) {
|
|
|
1468
1692
|
return !1;
|
|
1469
1693
|
}
|
|
1470
1694
|
}
|
|
1471
|
-
function
|
|
1472
|
-
return e.simple.every((s) =>
|
|
1695
|
+
function pn(e, n, t) {
|
|
1696
|
+
return e.simple.every((s) => fn(s, n, t));
|
|
1473
1697
|
}
|
|
1474
|
-
function
|
|
1475
|
-
if (!
|
|
1698
|
+
function he(e, n, t, s) {
|
|
1699
|
+
if (!pn(e[n], t, s)) return !1;
|
|
1476
1700
|
if (n === 0) return !0;
|
|
1477
|
-
const
|
|
1701
|
+
const r = s.parentOf(t);
|
|
1478
1702
|
if (e[n].combinator === "child")
|
|
1479
|
-
return
|
|
1480
|
-
for (let
|
|
1481
|
-
if (
|
|
1703
|
+
return r !== null && he(e, n - 1, r, s);
|
|
1704
|
+
for (let o = r; o !== null; o = s.parentOf(o))
|
|
1705
|
+
if (he(e, n - 1, o, s)) return !0;
|
|
1482
1706
|
return !1;
|
|
1483
1707
|
}
|
|
1484
|
-
function
|
|
1485
|
-
return e.parts.length === 0 ? !1 :
|
|
1708
|
+
function Qe(e, n, t) {
|
|
1709
|
+
return e.parts.length === 0 ? !1 : he(e.parts, e.parts.length - 1, n, t);
|
|
1486
1710
|
}
|
|
1487
|
-
function
|
|
1711
|
+
function hn(e) {
|
|
1488
1712
|
const n = [];
|
|
1489
1713
|
for (const t of e.parts)
|
|
1490
1714
|
for (const s of t.simple)
|
|
1491
1715
|
s.kind === "pseudo" && s.name !== "root" && !n.includes(s.name) && n.push(s.name);
|
|
1492
1716
|
return n;
|
|
1493
1717
|
}
|
|
1494
|
-
function
|
|
1718
|
+
function mn(e) {
|
|
1495
1719
|
const n = [];
|
|
1496
1720
|
for (const t of e)
|
|
1497
1721
|
for (const s of t.parts)
|
|
1498
|
-
for (const
|
|
1499
|
-
if (
|
|
1500
|
-
const
|
|
1501
|
-
n.includes(
|
|
1722
|
+
for (const r of s.simple) {
|
|
1723
|
+
if (r.kind !== "name" && r.kind !== "class" || !r.name.startsWith("unity-")) continue;
|
|
1724
|
+
const o = r.kind === "name" ? `#${r.name}` : `.${r.name}`;
|
|
1725
|
+
n.includes(o) || n.push(o);
|
|
1502
1726
|
}
|
|
1503
1727
|
return n;
|
|
1504
1728
|
}
|
|
1505
|
-
function
|
|
1729
|
+
function et(e) {
|
|
1506
1730
|
for (const n of e)
|
|
1507
1731
|
for (const t of n.parts)
|
|
1508
1732
|
for (const s of t.simple)
|
|
1509
1733
|
if (s.kind === "unknown") return s.text;
|
|
1510
1734
|
return null;
|
|
1511
1735
|
}
|
|
1512
|
-
function
|
|
1736
|
+
function gn(e) {
|
|
1513
1737
|
const n = /* @__PURE__ */ new Map([[e, null]]), t = [e];
|
|
1514
1738
|
for (; t.length > 0; ) {
|
|
1515
1739
|
const s = t.pop();
|
|
1516
|
-
for (const
|
|
1517
|
-
n.set(
|
|
1740
|
+
for (const r of s.children)
|
|
1741
|
+
n.set(r, s), t.push(r);
|
|
1518
1742
|
}
|
|
1519
1743
|
return n;
|
|
1520
1744
|
}
|
|
1521
|
-
function
|
|
1745
|
+
function yn(e) {
|
|
1522
1746
|
let n = 0, t = 0, s = 0;
|
|
1523
|
-
for (const
|
|
1524
|
-
for (const
|
|
1525
|
-
switch (
|
|
1747
|
+
for (const r of e.parts)
|
|
1748
|
+
for (const o of r.simple)
|
|
1749
|
+
switch (o.kind) {
|
|
1526
1750
|
case "name":
|
|
1527
1751
|
n++;
|
|
1528
1752
|
break;
|
|
@@ -1536,62 +1760,64 @@ function sn(e) {
|
|
|
1536
1760
|
}
|
|
1537
1761
|
return [n, t, s];
|
|
1538
1762
|
}
|
|
1539
|
-
function
|
|
1763
|
+
function tt(e, n) {
|
|
1540
1764
|
return e[0] - n[0] || e[1] - n[1] || e[2] - n[2];
|
|
1541
1765
|
}
|
|
1542
|
-
const
|
|
1766
|
+
const bn = [Number.MAX_SAFE_INTEGER, 0, 0], vn = ve(Je, null, -1).sheet.items.flatMap(
|
|
1543
1767
|
(e, n) => e.kind === "rule" ? [{ rule: e.rule, sheet: -1, item: n, builtin: !0 }] : []
|
|
1544
1768
|
);
|
|
1545
|
-
function
|
|
1546
|
-
return
|
|
1547
|
-
}
|
|
1548
|
-
function
|
|
1549
|
-
const
|
|
1550
|
-
for (const [
|
|
1551
|
-
const
|
|
1552
|
-
if (
|
|
1769
|
+
function wn(e) {
|
|
1770
|
+
return Je.slice(e.selectorSpan.start, e.selectorSpan.end).trim();
|
|
1771
|
+
}
|
|
1772
|
+
function xn(e, n, t, s) {
|
|
1773
|
+
const r = (t == null ? void 0 : t.activeStates) ?? /* @__PURE__ */ new Set(), o = Object.entries((t == null ? void 0 : t.states) ?? {}), d = [];
|
|
1774
|
+
for (const [l, c] of o) {
|
|
1775
|
+
const u = ve(`${l} {}`, null, -1).sheet.items.find((i) => i.kind === "rule"), p = u === void 0 ? l : et(u.rule.selectors);
|
|
1776
|
+
if (u === void 0 || p !== null) {
|
|
1553
1777
|
s.push({
|
|
1554
1778
|
kind: "unsupported-selector",
|
|
1555
|
-
message: `states key "${
|
|
1779
|
+
message: `states key "${l}" is not a usable USS selector; it is ignored`,
|
|
1780
|
+
reason: "not-uss",
|
|
1781
|
+
subject: { kind: "states-key", key: l }
|
|
1556
1782
|
});
|
|
1557
1783
|
continue;
|
|
1558
1784
|
}
|
|
1559
|
-
|
|
1560
|
-
}
|
|
1561
|
-
const
|
|
1562
|
-
const
|
|
1563
|
-
|
|
1564
|
-
for (const
|
|
1565
|
-
if (
|
|
1566
|
-
for (const
|
|
1567
|
-
|
|
1568
|
-
for (const
|
|
1785
|
+
d.push({ selectors: u.rule.selectors, states: c });
|
|
1786
|
+
}
|
|
1787
|
+
const a = /* @__PURE__ */ new Map(), x = (l) => l.attributes.some((c) => c.name === "enabled" && c.value === "false"), h = (l, c) => {
|
|
1788
|
+
const u = c || x(l), p = new Set(r);
|
|
1789
|
+
u && p.add("disabled");
|
|
1790
|
+
for (const i of d)
|
|
1791
|
+
if (i.selectors.some((y) => Qe(y, { kind: "element", node: l }, n)))
|
|
1792
|
+
for (const y of i.states) p.add(y);
|
|
1793
|
+
a.set(l, p);
|
|
1794
|
+
for (const i of l.children) h(i, u);
|
|
1569
1795
|
};
|
|
1570
|
-
return
|
|
1796
|
+
return h(e.root, !1), a;
|
|
1571
1797
|
}
|
|
1572
|
-
function
|
|
1798
|
+
function kn(e) {
|
|
1573
1799
|
const n = [], t = /* @__PURE__ */ new Map();
|
|
1574
|
-
e.sheets.forEach((
|
|
1575
|
-
|
|
1576
|
-
}), n.push(...
|
|
1577
|
-
const s = /* @__PURE__ */ new Map(),
|
|
1578
|
-
const
|
|
1579
|
-
if (
|
|
1580
|
-
|
|
1581
|
-
const
|
|
1582
|
-
|
|
1583
|
-
if (
|
|
1584
|
-
n.push({ rule:
|
|
1585
|
-
else if (
|
|
1586
|
-
const
|
|
1587
|
-
|
|
1800
|
+
e.sheets.forEach((d, a) => {
|
|
1801
|
+
d.origin !== null && !t.has(d.origin) && t.set(d.origin, a);
|
|
1802
|
+
}), n.push(...vn);
|
|
1803
|
+
const s = /* @__PURE__ */ new Map(), r = (d, a) => {
|
|
1804
|
+
const x = s.get(a) ?? /* @__PURE__ */ new Set();
|
|
1805
|
+
if (x.has(d)) return;
|
|
1806
|
+
x.add(d), s.set(a, x);
|
|
1807
|
+
const h = e.sheets[d];
|
|
1808
|
+
h !== void 0 && h.items.forEach((l, c) => {
|
|
1809
|
+
if (l.kind === "rule")
|
|
1810
|
+
n.push({ rule: l.rule, sheet: d, item: c, scope: a });
|
|
1811
|
+
else if (l.kind === "import") {
|
|
1812
|
+
const u = l.resolvedSheet ?? t.get(l.url);
|
|
1813
|
+
u !== void 0 && r(u, a);
|
|
1588
1814
|
}
|
|
1589
1815
|
});
|
|
1590
|
-
},
|
|
1591
|
-
for (const
|
|
1816
|
+
}, o = e.styleRoots ?? (e.sheets.length === 0 ? [] : [{ sheet: 0, scope: e.root.id }]);
|
|
1817
|
+
for (const d of o) r(d.sheet, d.scope);
|
|
1592
1818
|
return n;
|
|
1593
1819
|
}
|
|
1594
|
-
function
|
|
1820
|
+
function Sn(e, n, t) {
|
|
1595
1821
|
let s = e;
|
|
1596
1822
|
for (; s !== null; ) {
|
|
1597
1823
|
if (s.kind === "element" && s.node.id === n) return !0;
|
|
@@ -1599,25 +1825,30 @@ function un(e, n, t) {
|
|
|
1599
1825
|
}
|
|
1600
1826
|
return !1;
|
|
1601
1827
|
}
|
|
1602
|
-
function
|
|
1828
|
+
function $n(e) {
|
|
1603
1829
|
return e.selectors.some(
|
|
1604
1830
|
(n) => n.parts.some((t) => t.simple.some((s) => s.kind === "pseudo" && s.name === "root"))
|
|
1605
1831
|
);
|
|
1606
1832
|
}
|
|
1607
|
-
function
|
|
1833
|
+
function ee(e, n) {
|
|
1834
|
+
var s;
|
|
1835
|
+
const t = n.rule.selectorSpan;
|
|
1836
|
+
return ((s = e.sheets[n.sheet]) == null ? void 0 : s.source.slice(t.start, t.end)) ?? "";
|
|
1837
|
+
}
|
|
1838
|
+
function H(e, n) {
|
|
1608
1839
|
var s;
|
|
1609
1840
|
const t = (s = e.sheets[n]) == null ? void 0 : s.origin;
|
|
1610
1841
|
return typeof t == "string" ? { sourceDocument: t } : {};
|
|
1611
1842
|
}
|
|
1612
|
-
function
|
|
1613
|
-
const t =
|
|
1614
|
-
var
|
|
1615
|
-
const
|
|
1616
|
-
return
|
|
1617
|
-
},
|
|
1618
|
-
var
|
|
1619
|
-
return (
|
|
1620
|
-
},
|
|
1843
|
+
function nt(e, n) {
|
|
1844
|
+
const t = gn(e.root), s = [], r = /* @__PURE__ */ new Set(), o = (i) => {
|
|
1845
|
+
var k;
|
|
1846
|
+
const y = (k = i.attributes.find((f) => f.name === "class")) == null ? void 0 : k.value;
|
|
1847
|
+
return y === void 0 ? [] : y.split(/\s+/).filter((f) => f.length > 0);
|
|
1848
|
+
}, d = (i, y) => {
|
|
1849
|
+
var k;
|
|
1850
|
+
return (k = i.attributes.find((f) => f.name === y)) == null ? void 0 : k.value;
|
|
1851
|
+
}, a = {
|
|
1621
1852
|
/**
|
|
1622
1853
|
* The rule the measurement forced.
|
|
1623
1854
|
*
|
|
@@ -1628,146 +1859,220 @@ function Ke(e, n) {
|
|
|
1628
1859
|
* owner. That is the hierarchy the dumps show, so descendant selectors like
|
|
1629
1860
|
* `.panel #unity-content-viewport` behave as they do in Unity.
|
|
1630
1861
|
*/
|
|
1631
|
-
parentOf: (
|
|
1632
|
-
if (
|
|
1633
|
-
const
|
|
1634
|
-
return
|
|
1862
|
+
parentOf: (i) => {
|
|
1863
|
+
if (i.kind === "element") {
|
|
1864
|
+
const f = t.get(i.node) ?? null;
|
|
1865
|
+
return f === null ? null : { kind: "element", node: f };
|
|
1635
1866
|
}
|
|
1636
|
-
if (
|
|
1637
|
-
const
|
|
1638
|
-
return { kind: "part", owner:
|
|
1867
|
+
if (i.depth === 0) return { kind: "element", node: i.owner };
|
|
1868
|
+
const k = Y(i.owner).spec.parts[i.depth - 1];
|
|
1869
|
+
return { kind: "part", owner: i.owner, name: k.name, depth: i.depth - 1 };
|
|
1639
1870
|
},
|
|
1640
|
-
isRoot: (
|
|
1871
|
+
isRoot: (i) => i.kind === "element" && i.node === e.root,
|
|
1641
1872
|
// Unity's parts are VisualElements, so a `VisualElement` rule reaches them.
|
|
1642
1873
|
// Not measured — `part-type-selector` is the case that will settle it.
|
|
1643
|
-
typeNameOf: (
|
|
1644
|
-
idOf: (
|
|
1874
|
+
typeNameOf: (i) => i.kind === "element" ? i.node.name.local : "VisualElement",
|
|
1875
|
+
idOf: (i) => i.kind === "element" ? d(i.node, "name") : i.name,
|
|
1645
1876
|
// Implicit classes are as real as written ones for matching: in Unity the
|
|
1646
1877
|
// element genuinely carries them, which is why `.unity-button` in author USS
|
|
1647
1878
|
// hits a plain `<ui:Button />`. Parts carry classes too in Unity, but which
|
|
1648
1879
|
// ones is unmeasured, so none are claimed here.
|
|
1649
|
-
classesOf: (
|
|
1650
|
-
},
|
|
1651
|
-
...
|
|
1880
|
+
classesOf: (i) => i.kind === "element" ? [...o(i.node), ...pt(i.node)] : []
|
|
1881
|
+
}, x = { ...a, statesOf: () => r }, h = xn(e, x, n, s), l = {
|
|
1882
|
+
...a,
|
|
1652
1883
|
// A part inherits its owner's states: `SetEnabled(false)` disables the whole
|
|
1653
1884
|
// subtree, and a part is inside it.
|
|
1654
|
-
statesOf: (
|
|
1655
|
-
},
|
|
1656
|
-
let
|
|
1657
|
-
for (const
|
|
1658
|
-
if (
|
|
1659
|
-
|
|
1885
|
+
statesOf: (i) => h.get(i.kind === "element" ? i.node : i.owner) ?? r
|
|
1886
|
+
}, c = [];
|
|
1887
|
+
let u = !1;
|
|
1888
|
+
for (const i of kn(e)) {
|
|
1889
|
+
if (i.builtin === !0) {
|
|
1890
|
+
c.push(i);
|
|
1660
1891
|
continue;
|
|
1661
1892
|
}
|
|
1662
|
-
const
|
|
1663
|
-
if (
|
|
1893
|
+
const y = et(i.rule.selectors);
|
|
1894
|
+
if (y !== null) {
|
|
1664
1895
|
s.push({
|
|
1665
1896
|
kind: "unsupported-selector",
|
|
1666
|
-
message: `"${
|
|
1667
|
-
at: { in: "uss", sheet:
|
|
1668
|
-
|
|
1897
|
+
message: `"${y}": the whole rule is ignored`,
|
|
1898
|
+
at: { in: "uss", sheet: i.sheet, span: i.rule.selectorSpan },
|
|
1899
|
+
reason: "not-uss",
|
|
1900
|
+
subject: { kind: "selector", selector: ee(e, i), fragment: y },
|
|
1901
|
+
...H(e, i.sheet)
|
|
1669
1902
|
});
|
|
1670
1903
|
continue;
|
|
1671
1904
|
}
|
|
1672
|
-
!
|
|
1905
|
+
!u && $n(i.rule) && (u = !0, s.push({
|
|
1673
1906
|
kind: "version-dependent",
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1907
|
+
// Not a version difference: USS :root means something else than CSS
|
|
1908
|
+
// :root, and this preview does what Unity does. Kept as a warning so
|
|
1909
|
+
// an author porting CSS is told; the kind stays for compatibility.
|
|
1910
|
+
message: ":root matched the element this stylesheet is attached to — the document root, or the TemplateContainer of a template",
|
|
1911
|
+
at: { in: "uss", sheet: i.sheet, span: i.rule.selectorSpan },
|
|
1912
|
+
reason: "matches-unity",
|
|
1913
|
+
subject: { kind: "selector", selector: ee(e, i), fragment: ":root" },
|
|
1914
|
+
...H(e, i.sheet)
|
|
1915
|
+
})), c.push(i);
|
|
1916
|
+
}
|
|
1917
|
+
const p = /* @__PURE__ */ new Set();
|
|
1918
|
+
for (const i of c) {
|
|
1919
|
+
if (i.builtin === !0) continue;
|
|
1920
|
+
const y = `${i.sheet}:${i.item}`;
|
|
1921
|
+
if (p.has(y)) continue;
|
|
1922
|
+
p.add(y);
|
|
1923
|
+
const k = /* @__PURE__ */ new Set();
|
|
1924
|
+
for (const f of i.rule.selectors)
|
|
1925
|
+
for (const m of f.parts)
|
|
1926
|
+
for (const v of m.simple)
|
|
1927
|
+
v.kind !== "pseudo" || v.name === "root" || Pt.includes(v.name) || k.add(v.name);
|
|
1928
|
+
for (const f of k)
|
|
1929
|
+
s.push({
|
|
1930
|
+
kind: "unsupported-selector",
|
|
1931
|
+
message: `":${f}": never matches; Unity sets no such state`,
|
|
1932
|
+
at: { in: "uss", sheet: i.sheet, span: i.rule.selectorSpan },
|
|
1933
|
+
...H(e, i.sheet),
|
|
1934
|
+
reason: "not-uss",
|
|
1935
|
+
subject: { kind: "selector", selector: ee(e, i), fragment: `:${f}` }
|
|
1936
|
+
});
|
|
1937
|
+
for (const f of i.rule.declarations) {
|
|
1938
|
+
const m = Xe(f.property, f.value);
|
|
1939
|
+
m !== null && s.push({
|
|
1940
|
+
kind: "unsupported-property",
|
|
1941
|
+
...m,
|
|
1942
|
+
at: { in: "uss", sheet: i.sheet, span: f.span },
|
|
1943
|
+
...H(e, i.sheet)
|
|
1944
|
+
});
|
|
1945
|
+
}
|
|
1678
1946
|
}
|
|
1679
|
-
return
|
|
1947
|
+
return e.sheets.forEach((i, y) => {
|
|
1948
|
+
var k;
|
|
1949
|
+
for (const f of i.items) {
|
|
1950
|
+
if (f.kind !== "unknown") continue;
|
|
1951
|
+
const m = (k = /^@([A-Za-z][\w-]*)/.exec(i.source.slice(f.span.start, f.span.end))) == null ? void 0 : k[1];
|
|
1952
|
+
m === void 0 || m === "import" || s.push({
|
|
1953
|
+
kind: "unsupported-selector",
|
|
1954
|
+
message: `@${m}: block ignored`,
|
|
1955
|
+
at: { in: "uss", sheet: y, span: f.span },
|
|
1956
|
+
...H(e, y),
|
|
1957
|
+
reason: "not-uss",
|
|
1958
|
+
subject: { kind: "at-rule", name: m }
|
|
1959
|
+
});
|
|
1960
|
+
}
|
|
1961
|
+
}), { ctx: l, usable: c, warnings: s };
|
|
1680
1962
|
}
|
|
1681
|
-
function
|
|
1682
|
-
const t = n.attributes.find((
|
|
1963
|
+
function we(e, n) {
|
|
1964
|
+
const t = n.attributes.find((r) => r.name === "style");
|
|
1683
1965
|
if (t === void 0) return [];
|
|
1684
|
-
const s =
|
|
1685
|
-
return s === null ? [] :
|
|
1686
|
-
}
|
|
1687
|
-
function
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1966
|
+
const s = dn(t);
|
|
1967
|
+
return s === null ? [] : Ke(e.source, s, s + t.value.length);
|
|
1968
|
+
}
|
|
1969
|
+
function Tn(e) {
|
|
1970
|
+
let n = null;
|
|
1971
|
+
const t = (s, r) => {
|
|
1972
|
+
var o;
|
|
1973
|
+
typeof s.sourceDocument != "string" && r.set(((o = s.derived) == null ? void 0 : o.instance) ?? s.id, s);
|
|
1974
|
+
for (const d of s.children) t(d, r);
|
|
1975
|
+
return r;
|
|
1976
|
+
};
|
|
1977
|
+
return (s) => {
|
|
1978
|
+
var r;
|
|
1979
|
+
if (s.kind === "rule") {
|
|
1980
|
+
const o = (r = e.sheets[s.sheet]) == null ? void 0 : r.items[s.item], d = (o == null ? void 0 : o.kind) === "rule" ? o.rule.declarations[s.declIndex] : void 0;
|
|
1981
|
+
return d === void 0 ? {} : { at: { in: "uss", sheet: s.sheet, span: d.span }, ...H(e, s.sheet) };
|
|
1982
|
+
}
|
|
1983
|
+
if (s.kind === "inline") {
|
|
1984
|
+
if (typeof s.sourceDocument == "string") return { sourceDocument: s.sourceDocument };
|
|
1985
|
+
n ?? (n = t(e.root, /* @__PURE__ */ new Map()));
|
|
1986
|
+
const o = n.get(s.node), d = o === void 0 ? void 0 : we(e, o)[s.declIndex];
|
|
1987
|
+
return d === void 0 ? {} : { at: { in: "uxml", span: d.span } };
|
|
1988
|
+
}
|
|
1989
|
+
return {};
|
|
1990
|
+
};
|
|
1991
|
+
}
|
|
1992
|
+
function st(e, n, t, s) {
|
|
1993
|
+
const r = [];
|
|
1994
|
+
let o = 0;
|
|
1995
|
+
const d = (a, x, h, l, c) => {
|
|
1996
|
+
r.push({ property: a, value: x, origin: h, rank: l, specificity: c, order: o++, winner: !1 });
|
|
1692
1997
|
};
|
|
1693
1998
|
if (n.kind === "part") {
|
|
1694
|
-
const
|
|
1695
|
-
for (const [
|
|
1696
|
-
for (const [
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1999
|
+
const a = Y(n.owner).spec.parts[n.depth];
|
|
2000
|
+
for (const [x, h] of Object.entries((a == null ? void 0 : a.style) ?? {}))
|
|
2001
|
+
for (const [l, c] of le(x, h))
|
|
2002
|
+
d(
|
|
2003
|
+
l,
|
|
2004
|
+
c,
|
|
1700
2005
|
{
|
|
1701
2006
|
kind: "builtin-theme",
|
|
1702
2007
|
selector: `#${n.name}`,
|
|
1703
|
-
property:
|
|
1704
|
-
unityVersion:
|
|
2008
|
+
property: l,
|
|
2009
|
+
unityVersion: te
|
|
1705
2010
|
},
|
|
1706
2011
|
0,
|
|
1707
2012
|
[0, 0, 0]
|
|
1708
2013
|
);
|
|
1709
2014
|
}
|
|
1710
|
-
for (const
|
|
1711
|
-
if (
|
|
1712
|
-
const
|
|
2015
|
+
for (const a of t.usable) {
|
|
2016
|
+
if (a.scope !== void 0 && !Sn(n, a.scope, t.ctx)) continue;
|
|
2017
|
+
const x = a.scope === void 0 ? t.ctx : {
|
|
1713
2018
|
...t.ctx,
|
|
1714
2019
|
// Unity USS :root names the element this particular stylesheet is
|
|
1715
2020
|
// attached to. Template sheets are attached to each generated
|
|
1716
2021
|
// TemplateContainer, not to the entry document root.
|
|
1717
|
-
isRoot: (
|
|
2022
|
+
isRoot: (c) => c.kind === "element" && c.node.id === a.scope
|
|
1718
2023
|
};
|
|
1719
|
-
let
|
|
1720
|
-
for (const
|
|
1721
|
-
if (!
|
|
1722
|
-
const
|
|
1723
|
-
(
|
|
2024
|
+
let h = null, l = [];
|
|
2025
|
+
for (const c of a.rule.selectors) {
|
|
2026
|
+
if (!Qe(c, n, x)) continue;
|
|
2027
|
+
const u = yn(c);
|
|
2028
|
+
(h === null || tt(u, h) > 0) && (h = u, l = hn(c));
|
|
1724
2029
|
}
|
|
1725
|
-
|
|
1726
|
-
var
|
|
1727
|
-
for (const [
|
|
1728
|
-
const m =
|
|
2030
|
+
h !== null && (s == null || s.add(a), a.rule.declarations.forEach((c, u) => {
|
|
2031
|
+
var p, i, y;
|
|
2032
|
+
for (const [k, f] of le(c.property, c.value)) {
|
|
2033
|
+
const m = a.builtin === !0 ? {
|
|
1729
2034
|
kind: "builtin-theme",
|
|
1730
|
-
selector:
|
|
1731
|
-
property:
|
|
1732
|
-
unityVersion:
|
|
2035
|
+
selector: wn(a.rule),
|
|
2036
|
+
property: k,
|
|
2037
|
+
unityVersion: te
|
|
1733
2038
|
} : {
|
|
1734
2039
|
kind: "rule",
|
|
1735
|
-
sheet:
|
|
1736
|
-
item:
|
|
1737
|
-
declIndex:
|
|
1738
|
-
...((
|
|
1739
|
-
...((
|
|
2040
|
+
sheet: a.sheet,
|
|
2041
|
+
item: a.item,
|
|
2042
|
+
declIndex: u,
|
|
2043
|
+
...((p = e.sheets[a.sheet]) == null ? void 0 : p.origin) === null || ((i = e.sheets[a.sheet]) == null ? void 0 : i.origin) === void 0 ? {} : { sourceDocument: e.sheets[a.sheet].origin },
|
|
2044
|
+
...((y = e.sheets[a.sheet]) == null ? void 0 : y.sourceDocumentFrom) === void 0 ? {} : { sourceDocumentFrom: e.sheets[a.sheet].sourceDocumentFrom },
|
|
1740
2045
|
// Omitted rather than set to [] when unconditional, so the
|
|
1741
2046
|
// common case stays the shape it has always been.
|
|
1742
|
-
...
|
|
2047
|
+
...l.length > 0 ? { states: l } : {}
|
|
1743
2048
|
};
|
|
1744
|
-
|
|
2049
|
+
d(k, f, m, a.builtin === !0 ? 0 : 1, h);
|
|
1745
2050
|
}
|
|
1746
2051
|
}));
|
|
1747
2052
|
}
|
|
1748
2053
|
if (n.kind === "element") {
|
|
1749
|
-
const
|
|
1750
|
-
|
|
1751
|
-
var
|
|
1752
|
-
for (const [
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
2054
|
+
const a = n.node;
|
|
2055
|
+
we(e, a).forEach((x, h) => {
|
|
2056
|
+
var l;
|
|
2057
|
+
for (const [c, u] of le(x.property, x.value))
|
|
2058
|
+
d(
|
|
2059
|
+
c,
|
|
2060
|
+
u,
|
|
1756
2061
|
{
|
|
1757
2062
|
kind: "inline",
|
|
1758
|
-
node: ((
|
|
1759
|
-
declIndex:
|
|
1760
|
-
...typeof
|
|
1761
|
-
...
|
|
2063
|
+
node: ((l = a.derived) == null ? void 0 : l.instance) ?? a.sourceNode ?? a.id,
|
|
2064
|
+
declIndex: h,
|
|
2065
|
+
...typeof a.sourceDocument == "string" ? { sourceDocument: a.sourceDocument } : {},
|
|
2066
|
+
...a.sourceDocumentFrom === void 0 ? {} : { sourceDocumentFrom: a.sourceDocumentFrom }
|
|
1762
2067
|
},
|
|
1763
2068
|
1,
|
|
1764
|
-
|
|
2069
|
+
bn
|
|
1765
2070
|
);
|
|
1766
2071
|
});
|
|
1767
2072
|
}
|
|
1768
|
-
return
|
|
2073
|
+
return r;
|
|
1769
2074
|
}
|
|
1770
|
-
function
|
|
2075
|
+
function ot(e) {
|
|
1771
2076
|
const n = /* @__PURE__ */ new Map();
|
|
1772
2077
|
for (const t of e) {
|
|
1773
2078
|
const s = n.get(t.property);
|
|
@@ -1779,100 +2084,122 @@ function Qe(e) {
|
|
|
1779
2084
|
t.rank > s.rank && n.set(t.property, t);
|
|
1780
2085
|
continue;
|
|
1781
2086
|
}
|
|
1782
|
-
const
|
|
1783
|
-
(
|
|
2087
|
+
const r = tt(t.specificity, s.specificity);
|
|
2088
|
+
(r > 0 || r === 0 && t.order > s.order) && n.set(t.property, t);
|
|
1784
2089
|
}
|
|
1785
2090
|
for (const t of n.values()) t.winner = !0;
|
|
1786
2091
|
return n;
|
|
1787
2092
|
}
|
|
1788
|
-
const
|
|
1789
|
-
function
|
|
1790
|
-
var
|
|
2093
|
+
const In = /var\(\s*(--[^,)\s]+)\s*(?:,([^)]*))?\)/;
|
|
2094
|
+
function me(e, n, t = /* @__PURE__ */ new Set()) {
|
|
2095
|
+
var r;
|
|
1791
2096
|
let s = e;
|
|
1792
|
-
for (let
|
|
1793
|
-
const
|
|
1794
|
-
if (
|
|
1795
|
-
const
|
|
1796
|
-
if (t.has(
|
|
1797
|
-
const
|
|
1798
|
-
if (
|
|
1799
|
-
s = s.slice(0,
|
|
2097
|
+
for (let o = 0; o < 32; o++) {
|
|
2098
|
+
const d = In.exec(s);
|
|
2099
|
+
if (d === null) return s;
|
|
2100
|
+
const a = d[1], x = (r = d[2]) == null ? void 0 : r.trim();
|
|
2101
|
+
if (t.has(a)) return null;
|
|
2102
|
+
const h = /* @__PURE__ */ new Set([...t, a]), l = n.get(a), c = l !== void 0 ? me(l, n, h) : x !== void 0 && x.length > 0 ? me(x, n, h) : null;
|
|
2103
|
+
if (c === null) return null;
|
|
2104
|
+
s = s.slice(0, d.index) + c + s.slice(d.index + d[0].length);
|
|
1800
2105
|
}
|
|
1801
2106
|
return null;
|
|
1802
2107
|
}
|
|
1803
|
-
function
|
|
1804
|
-
const t =
|
|
1805
|
-
let
|
|
1806
|
-
const
|
|
1807
|
-
const
|
|
1808
|
-
!
|
|
1809
|
-
const
|
|
1810
|
-
for (const [
|
|
1811
|
-
|
|
1812
|
-
for (const [
|
|
1813
|
-
|
|
1814
|
-
const
|
|
1815
|
-
for (const [
|
|
1816
|
-
for (const [
|
|
1817
|
-
const
|
|
1818
|
-
if (
|
|
2108
|
+
function En(e, n) {
|
|
2109
|
+
const t = nt(e, n), s = [...t.warnings], r = /* @__PURE__ */ new Map();
|
|
2110
|
+
let o = !1;
|
|
2111
|
+
const d = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Set(), x = (u, p, i) => {
|
|
2112
|
+
const y = st(e, u, t, a);
|
|
2113
|
+
!o && y.some((w) => w.origin.kind === "builtin-theme") && (o = !0);
|
|
2114
|
+
const k = ot(y), f = /* @__PURE__ */ new Map();
|
|
2115
|
+
for (const [w, g] of p)
|
|
2116
|
+
w.startsWith("--") && f.set(w, g.value);
|
|
2117
|
+
for (const [w, g] of k)
|
|
2118
|
+
w.startsWith("--") && f.set(w, g.value);
|
|
2119
|
+
const m = /* @__PURE__ */ new Map();
|
|
2120
|
+
for (const [w, g] of p) m.set(w, g);
|
|
2121
|
+
for (const [w, g] of k) {
|
|
2122
|
+
const $ = me(g.value, f);
|
|
2123
|
+
if ($ === null) {
|
|
1819
2124
|
s.push({
|
|
1820
2125
|
kind: "unsupported-property",
|
|
1821
|
-
message: `${
|
|
1822
|
-
node:
|
|
2126
|
+
message: `${w}: var() reference could not be resolved; declaration dropped`,
|
|
2127
|
+
node: i,
|
|
2128
|
+
reason: "invalid-value",
|
|
2129
|
+
subject: { kind: "property", property: w, value: g.value }
|
|
1823
2130
|
});
|
|
1824
2131
|
continue;
|
|
1825
2132
|
}
|
|
1826
|
-
|
|
2133
|
+
m.set(w, { value: $, origin: g.origin });
|
|
1827
2134
|
}
|
|
1828
|
-
const
|
|
1829
|
-
for (const [
|
|
1830
|
-
|
|
1831
|
-
value:
|
|
1832
|
-
origin: { kind: "inherited", from:
|
|
2135
|
+
const v = /* @__PURE__ */ new Map();
|
|
2136
|
+
for (const [w, g] of m)
|
|
2137
|
+
Bt(w) && v.set(w, {
|
|
2138
|
+
value: g.value,
|
|
2139
|
+
origin: { kind: "inherited", from: i, origin: g.origin }
|
|
1833
2140
|
});
|
|
1834
|
-
return { computed:
|
|
1835
|
-
},
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
const
|
|
1842
|
-
h.
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
2141
|
+
return { computed: m, forChildren: v };
|
|
2142
|
+
}, h = /* @__PURE__ */ new Set(), l = (u) => {
|
|
2143
|
+
var y;
|
|
2144
|
+
const p = ((y = u.derived) == null ? void 0 : y.instance) ?? u.sourceNode ?? u.id, i = typeof u.sourceDocument == "string" ? u.sourceDocument : null;
|
|
2145
|
+
we(e, u).forEach((k, f) => {
|
|
2146
|
+
const m = Xe(k.property, k.value);
|
|
2147
|
+
if (m === null) return;
|
|
2148
|
+
const v = `${u.sourceDocument ?? ""}#${p}#${f}`;
|
|
2149
|
+
h.has(v) || (h.add(v), s.push({
|
|
2150
|
+
kind: "unsupported-property",
|
|
2151
|
+
...m,
|
|
2152
|
+
node: u.id,
|
|
2153
|
+
// A span is only meaningful in the entry document's own text; a
|
|
2154
|
+
// template's declaration names its file instead.
|
|
2155
|
+
...i !== null ? { sourceDocument: i } : { at: { in: "uxml", span: k.span } }
|
|
2156
|
+
}));
|
|
2157
|
+
});
|
|
2158
|
+
}, c = (u, p) => {
|
|
2159
|
+
l(u);
|
|
2160
|
+
const i = x({ kind: "element", node: u }, p, u.id);
|
|
2161
|
+
r.set(u.id, i.computed);
|
|
2162
|
+
let y = i.forChildren;
|
|
2163
|
+
const k = Y(u).spec.parts;
|
|
2164
|
+
if (k.length > 0) {
|
|
2165
|
+
const f = /* @__PURE__ */ new Map();
|
|
2166
|
+
k.forEach((m, v) => {
|
|
2167
|
+
const w = x(
|
|
2168
|
+
{ kind: "part", owner: u, name: m.name, depth: v },
|
|
2169
|
+
y,
|
|
2170
|
+
u.id
|
|
1847
2171
|
);
|
|
1848
|
-
|
|
1849
|
-
}),
|
|
2172
|
+
f.set(m.name, w.computed), y = w.forChildren;
|
|
2173
|
+
}), d.set(u.id, f);
|
|
1850
2174
|
}
|
|
1851
|
-
for (const
|
|
2175
|
+
for (const f of u.children) c(f, y);
|
|
1852
2176
|
};
|
|
1853
|
-
|
|
2177
|
+
c(e.root, /* @__PURE__ */ new Map()), o && s.push({
|
|
1854
2178
|
kind: "version-dependent",
|
|
1855
|
-
message: `
|
|
2179
|
+
message: `Built-in control defaults applied, as measured on Unity ${te}`,
|
|
2180
|
+
reason: "version-dependent"
|
|
1856
2181
|
});
|
|
1857
|
-
for (const
|
|
1858
|
-
if (
|
|
1859
|
-
const
|
|
1860
|
-
|
|
2182
|
+
for (const u of t.usable) {
|
|
2183
|
+
if (u.builtin === !0 || a.has(u)) continue;
|
|
2184
|
+
const p = mn(u.rule.selectors);
|
|
2185
|
+
p.length !== 0 && s.push({
|
|
1861
2186
|
kind: "unsupported-selector",
|
|
1862
|
-
message: `${
|
|
1863
|
-
at: { in: "uss", sheet:
|
|
1864
|
-
|
|
2187
|
+
message: `${p.join(", ")} matched nothing; only ${ht().join(", ")} are drawn with the parts these names refer to`,
|
|
2188
|
+
at: { in: "uss", sheet: u.sheet, span: u.rule.selectorSpan },
|
|
2189
|
+
reason: "not-rendered",
|
|
2190
|
+
subject: { kind: "selector", selector: ee(e, u), fragment: p.join(", ") },
|
|
2191
|
+
...H(e, u.sheet)
|
|
1865
2192
|
});
|
|
1866
2193
|
}
|
|
1867
|
-
return { styles:
|
|
2194
|
+
return { styles: r, partStyles: d, warnings: s };
|
|
1868
2195
|
}
|
|
1869
|
-
function
|
|
1870
|
-
const
|
|
1871
|
-
(
|
|
2196
|
+
function Ln(e, n, t, s) {
|
|
2197
|
+
const r = nt(e, s), o = st(e, { kind: "element", node: n }, r).filter(
|
|
2198
|
+
(d) => d.property === t
|
|
1872
2199
|
);
|
|
1873
|
-
return
|
|
2200
|
+
return ot(o), o;
|
|
1874
2201
|
}
|
|
1875
|
-
const
|
|
2202
|
+
const Un = [
|
|
1876
2203
|
{
|
|
1877
2204
|
id: "text-metrics",
|
|
1878
2205
|
kind: "unreproducible",
|
|
@@ -1892,226 +2219,245 @@ const $n = [
|
|
|
1892
2219
|
detail: "The yoga-layout version this package depends on resolves a main-axis percentage against an indefinite parent differently from the Yoga vendored inside Unity 6000.0.40f1. Not configurable: no available setting reproduces Unity's answer without breaking cases that currently match. Fully deterministic and pinned to a case in docs/accuracy.md — this always reproduces the same way, it just cannot be fixed from inside this repository."
|
|
1893
2220
|
}
|
|
1894
2221
|
];
|
|
1895
|
-
function
|
|
1896
|
-
const t = (
|
|
1897
|
-
function s(
|
|
1898
|
-
return
|
|
1899
|
-
}
|
|
1900
|
-
function
|
|
1901
|
-
return
|
|
1902
|
-
}
|
|
1903
|
-
function
|
|
1904
|
-
const
|
|
1905
|
-
return
|
|
1906
|
-
}
|
|
1907
|
-
function
|
|
1908
|
-
var
|
|
1909
|
-
const
|
|
1910
|
-
return { between:
|
|
1911
|
-
}
|
|
1912
|
-
function
|
|
1913
|
-
const { inner:
|
|
1914
|
-
if (
|
|
1915
|
-
if (
|
|
1916
|
-
const { between:
|
|
1917
|
-
return
|
|
2222
|
+
function On(e, n) {
|
|
2223
|
+
const t = (h) => e.slice(h.start, h.end);
|
|
2224
|
+
function s(h) {
|
|
2225
|
+
return h.spans.closeTag !== null ? h.spans.closeTag.end : Math.max(h.spans.openTag.end, h.spans.inner.end);
|
|
2226
|
+
}
|
|
2227
|
+
function r(h) {
|
|
2228
|
+
return h.includes('"') ? h.includes("'") ? `"${h.replace(/"/g, """)}"` : `'${h}'` : `"${h}"`;
|
|
2229
|
+
}
|
|
2230
|
+
function o(h) {
|
|
2231
|
+
const l = h.attributes.map((u) => ` ${u.name}=${r(u.value)}`).join(""), c = Le(h.name);
|
|
2232
|
+
return h.spans.closeTag === null ? `<${c}${l} />` : `<${c}${l}>`;
|
|
2233
|
+
}
|
|
2234
|
+
function d(h) {
|
|
2235
|
+
var p, i;
|
|
2236
|
+
const l = t(h.spans.inner), c = ((p = /^[ \t]*\r?\n[ \t]*/.exec(l)) == null ? void 0 : p[0]) ?? "", u = ((i = /\r?\n[ \t]*$/.exec(l)) == null ? void 0 : i[0]) ?? "";
|
|
2237
|
+
return { between: c, before: c, after: u };
|
|
2238
|
+
}
|
|
2239
|
+
function a(h) {
|
|
2240
|
+
const { inner: l } = h.spans;
|
|
2241
|
+
if (h.children.length === 0) return t(l);
|
|
2242
|
+
if (h.childrenDirty) {
|
|
2243
|
+
const { between: p, before: i, after: y } = d(h);
|
|
2244
|
+
return i + h.children.map(x).join(p) + y;
|
|
1918
2245
|
}
|
|
1919
|
-
let
|
|
1920
|
-
for (const
|
|
1921
|
-
|
|
1922
|
-
return
|
|
1923
|
-
}
|
|
1924
|
-
function
|
|
1925
|
-
const
|
|
1926
|
-
return
|
|
1927
|
-
}
|
|
1928
|
-
return e.slice(0, n.spans.openTag.start) +
|
|
1929
|
-
}
|
|
1930
|
-
function
|
|
1931
|
-
const n = e.source, t = (
|
|
1932
|
-
function s(
|
|
1933
|
-
return
|
|
1934
|
-
const
|
|
1935
|
-
switch (
|
|
2246
|
+
let c = "", u = l.start;
|
|
2247
|
+
for (const p of h.children)
|
|
2248
|
+
c += e.slice(u, p.spans.openTag.start), c += x(p), u = s(p);
|
|
2249
|
+
return c + e.slice(u, l.end);
|
|
2250
|
+
}
|
|
2251
|
+
function x(h) {
|
|
2252
|
+
const l = h.tagDirty ? o(h) : t(h.spans.openTag), c = h.spans.closeTag === null ? "" : t(h.spans.closeTag);
|
|
2253
|
+
return l + a(h) + c;
|
|
2254
|
+
}
|
|
2255
|
+
return e.slice(0, n.spans.openTag.start) + x(n) + e.slice(s(n));
|
|
2256
|
+
}
|
|
2257
|
+
function Dn(e) {
|
|
2258
|
+
const n = e.source, t = (l) => n.slice(l.start, l.end);
|
|
2259
|
+
function s(l) {
|
|
2260
|
+
return l.parts.map((c, u) => {
|
|
2261
|
+
const p = u === 0 ? "" : c.combinator === "child" ? " > " : " ", i = c.simple.map((y) => {
|
|
2262
|
+
switch (y.kind) {
|
|
1936
2263
|
case "universal":
|
|
1937
2264
|
return "*";
|
|
1938
2265
|
case "type":
|
|
1939
|
-
return
|
|
2266
|
+
return y.name;
|
|
1940
2267
|
case "class":
|
|
1941
|
-
return `.${
|
|
2268
|
+
return `.${y.name}`;
|
|
1942
2269
|
case "name":
|
|
1943
|
-
return `#${
|
|
2270
|
+
return `#${y.name}`;
|
|
1944
2271
|
case "pseudo":
|
|
1945
|
-
return `:${
|
|
2272
|
+
return `:${y.name}`;
|
|
1946
2273
|
case "unknown":
|
|
1947
|
-
return
|
|
2274
|
+
return y.text;
|
|
1948
2275
|
}
|
|
1949
2276
|
}).join("");
|
|
1950
|
-
return
|
|
2277
|
+
return p + i;
|
|
1951
2278
|
}).join("");
|
|
1952
2279
|
}
|
|
1953
|
-
function
|
|
1954
|
-
var
|
|
1955
|
-
const
|
|
1956
|
-
if (
|
|
1957
|
-
const
|
|
1958
|
-
`,
|
|
1959
|
-
return { between: `;${
|
|
1960
|
-
}
|
|
1961
|
-
function
|
|
1962
|
-
const
|
|
1963
|
-
if (
|
|
1964
|
-
return
|
|
1965
|
-
const
|
|
1966
|
-
if (
|
|
1967
|
-
const { between:
|
|
1968
|
-
return `${
|
|
2280
|
+
function r(l) {
|
|
2281
|
+
var k, f;
|
|
2282
|
+
const c = l.declarations[0];
|
|
2283
|
+
if (c === void 0) return { between: "", before: "", after: "" };
|
|
2284
|
+
const u = n.lastIndexOf(`
|
|
2285
|
+
`, c.span.start), p = u < 0 ? "" : n.slice(u, c.span.start), i = n.slice(l.selectorSpan.end, l.span.end), y = ((f = (k = /\r?\n[ \t]*\}$/.exec(i)) == null ? void 0 : k[0]) == null ? void 0 : f.replace(/\}$/, "")) ?? "";
|
|
2286
|
+
return { between: `;${p}`, before: p, after: `;${y}` };
|
|
2287
|
+
}
|
|
2288
|
+
function o(l) {
|
|
2289
|
+
const c = l.selectorDirty ? l.selectors.map(s).join(", ") : t(l.selectorSpan);
|
|
2290
|
+
if (l.declarations.length === 0)
|
|
2291
|
+
return c + n.slice(l.selectorSpan.end, l.span.end);
|
|
2292
|
+
const u = n.slice(l.selectorSpan.end, l.declarations[0].span.start);
|
|
2293
|
+
if (l.declarationsDirty) {
|
|
2294
|
+
const { between: y, before: k, after: f } = r(l), m = u.slice(0, u.indexOf("{") + 1), v = l.declarations.map(d).join(y);
|
|
2295
|
+
return `${c}${m}${k}${v}${f}}`;
|
|
1969
2296
|
}
|
|
1970
|
-
let
|
|
1971
|
-
for (const
|
|
1972
|
-
|
|
1973
|
-
return
|
|
2297
|
+
let p = c, i = l.selectorSpan.end;
|
|
2298
|
+
for (const y of l.declarations)
|
|
2299
|
+
p += n.slice(i, y.span.start), p += d(y), i = y.span.end;
|
|
2300
|
+
return p + n.slice(i, l.span.end);
|
|
1974
2301
|
}
|
|
1975
|
-
function
|
|
1976
|
-
return
|
|
2302
|
+
function d(l) {
|
|
2303
|
+
return l.dirty ? `${l.property}: ${l.value}` : t(l.span);
|
|
1977
2304
|
}
|
|
1978
|
-
function
|
|
1979
|
-
return
|
|
2305
|
+
function a(l) {
|
|
2306
|
+
return l.kind === "rule" ? o(l.rule) : t(l.span);
|
|
1980
2307
|
}
|
|
1981
|
-
let
|
|
1982
|
-
for (const
|
|
1983
|
-
const
|
|
1984
|
-
|
|
2308
|
+
let x = "", h = 0;
|
|
2309
|
+
for (const l of e.items) {
|
|
2310
|
+
const c = l.kind === "rule" ? l.rule.span : l.span;
|
|
2311
|
+
x += n.slice(h, c.start), x += a(l), h = c.end;
|
|
1985
2312
|
}
|
|
1986
|
-
return
|
|
2313
|
+
return x + n.slice(h);
|
|
1987
2314
|
}
|
|
1988
|
-
|
|
1989
|
-
(e, n) => n === void 0 ?
|
|
2315
|
+
gt(
|
|
2316
|
+
(e, n) => n === void 0 ? Ne(e) : Ne(e, void 0, { resolveImport: n })
|
|
1990
2317
|
);
|
|
1991
|
-
function
|
|
2318
|
+
function rt(e, n = []) {
|
|
1992
2319
|
var t;
|
|
1993
2320
|
for (const s of e.children) {
|
|
1994
2321
|
if (s.name.local === "Style") {
|
|
1995
|
-
const
|
|
1996
|
-
|
|
2322
|
+
const r = (t = s.attributes.find((o) => o.name === "src")) == null ? void 0 : t.value;
|
|
2323
|
+
r !== void 0 && r.length > 0 && n.push({ url: X(r), scope: e.id });
|
|
1997
2324
|
}
|
|
1998
|
-
|
|
2325
|
+
rt(s, n);
|
|
1999
2326
|
}
|
|
2000
2327
|
return n;
|
|
2001
2328
|
}
|
|
2002
|
-
function
|
|
2329
|
+
function Mn(e) {
|
|
2003
2330
|
return e.startsWith("project://") || e.startsWith("/");
|
|
2004
2331
|
}
|
|
2005
|
-
function
|
|
2006
|
-
var
|
|
2007
|
-
const s =
|
|
2008
|
-
for (const { url:
|
|
2009
|
-
const
|
|
2010
|
-
if (
|
|
2011
|
-
|
|
2332
|
+
function Ne(e, n, t) {
|
|
2333
|
+
var h, l;
|
|
2334
|
+
const s = ze(e), r = [...s.warnings], o = [], d = [], a = [];
|
|
2335
|
+
for (const { url: c, scope: u } of rt(s.root)) {
|
|
2336
|
+
const p = ((h = t == null ? void 0 : t.resolveImport) == null ? void 0 : h.call(t, c, null)) ?? null;
|
|
2337
|
+
if (p === null) {
|
|
2338
|
+
r.push({
|
|
2012
2339
|
kind: "import-unresolved",
|
|
2013
|
-
message: (t == null ? void 0 : t.resolveImport) === void 0 ? `<Style src="${
|
|
2014
|
-
node: s.root.id
|
|
2340
|
+
message: (t == null ? void 0 : t.resolveImport) === void 0 ? `<Style src="${c}"> was not loaded: pass resolveImport to read it, or pass the stylesheet text directly. Until then this document renders unstyled.` : `<Style src="${c}"> could not be resolved`,
|
|
2341
|
+
node: s.root.id,
|
|
2342
|
+
subject: { kind: "import", url: c, from: null }
|
|
2015
2343
|
});
|
|
2016
2344
|
continue;
|
|
2017
2345
|
}
|
|
2018
|
-
|
|
2019
|
-
}
|
|
2020
|
-
if (n !== void 0 ||
|
|
2021
|
-
const
|
|
2022
|
-
let
|
|
2023
|
-
for (const
|
|
2024
|
-
const
|
|
2025
|
-
|
|
2346
|
+
a.push({ text: p, origin: c, scope: u });
|
|
2347
|
+
}
|
|
2348
|
+
if (n !== void 0 || a.length > 0) {
|
|
2349
|
+
const c = /* @__PURE__ */ new Map(), u = [];
|
|
2350
|
+
let p = 0;
|
|
2351
|
+
for (const i of a) {
|
|
2352
|
+
const y = p++;
|
|
2353
|
+
u.push({ text: i.text, origin: i.origin, sheet: y }), d.push({ sheet: y, scope: i.scope });
|
|
2026
2354
|
}
|
|
2027
2355
|
if (n !== void 0) {
|
|
2028
|
-
const
|
|
2029
|
-
|
|
2356
|
+
const i = p++;
|
|
2357
|
+
u.push({ text: n, origin: null, sheet: i }), d.push({ sheet: i, scope: s.root.id });
|
|
2030
2358
|
}
|
|
2031
|
-
for (;
|
|
2032
|
-
const
|
|
2033
|
-
|
|
2034
|
-
for (const
|
|
2035
|
-
if (
|
|
2036
|
-
const m =
|
|
2037
|
-
if (
|
|
2038
|
-
const
|
|
2039
|
-
|
|
2359
|
+
for (; u.length > 0; ) {
|
|
2360
|
+
const i = u.shift(), y = i.sheet, k = ve(i.text, i.origin, y);
|
|
2361
|
+
o.push(k.sheet), r.push(...k.warnings);
|
|
2362
|
+
for (const f of k.sheet.items) {
|
|
2363
|
+
if (f.kind !== "import") continue;
|
|
2364
|
+
const m = Mn(f.url) ? f.url : JSON.stringify([f.url, i.origin]);
|
|
2365
|
+
if (c.has(m)) {
|
|
2366
|
+
const g = c.get(m);
|
|
2367
|
+
g != null && (f.resolvedSheet = g);
|
|
2040
2368
|
continue;
|
|
2041
2369
|
}
|
|
2042
|
-
|
|
2043
|
-
const
|
|
2044
|
-
if (
|
|
2045
|
-
|
|
2370
|
+
c.set(m, null);
|
|
2371
|
+
const v = ((l = t == null ? void 0 : t.resolveImport) == null ? void 0 : l.call(t, f.url, i.origin)) ?? null;
|
|
2372
|
+
if (v === null) {
|
|
2373
|
+
r.push({
|
|
2046
2374
|
kind: "import-unresolved",
|
|
2047
|
-
message: (t == null ? void 0 : t.resolveImport) === void 0 ? `@import "${
|
|
2048
|
-
at: { in: "uss", sheet:
|
|
2375
|
+
message: (t == null ? void 0 : t.resolveImport) === void 0 ? `@import "${f.url}" was not loaded: pass resolveImport to read it` : `@import "${f.url}" could not be resolved`,
|
|
2376
|
+
at: { in: "uss", sheet: y, span: f.span },
|
|
2377
|
+
subject: { kind: "import", url: f.url, from: i.origin }
|
|
2049
2378
|
});
|
|
2050
2379
|
continue;
|
|
2051
2380
|
}
|
|
2052
|
-
const
|
|
2053
|
-
|
|
2381
|
+
const w = p++;
|
|
2382
|
+
c.set(m, w), f.resolvedSheet = w, u.push({ text: v, origin: f.url, sheet: w });
|
|
2054
2383
|
}
|
|
2055
2384
|
}
|
|
2056
2385
|
}
|
|
2057
|
-
const
|
|
2058
|
-
return
|
|
2386
|
+
const x = { source: e, root: s.root, sheets: o, styleRoots: d, warnings: r };
|
|
2387
|
+
return yt(x, t == null ? void 0 : t.resolveImport), x;
|
|
2059
2388
|
}
|
|
2060
|
-
function
|
|
2389
|
+
function _n(e) {
|
|
2061
2390
|
const n = e.sheets[0];
|
|
2062
2391
|
return {
|
|
2063
|
-
uxml:
|
|
2392
|
+
uxml: On(e.source, e.root),
|
|
2064
2393
|
// Only the sheet passed to `parse` round-trips. `@import`ed sheets (Phase 3)
|
|
2065
2394
|
// are separate files and are not this function's to write.
|
|
2066
|
-
uss: n === void 0 ? "" :
|
|
2395
|
+
uss: n === void 0 ? "" : Dn(n)
|
|
2067
2396
|
};
|
|
2068
2397
|
}
|
|
2069
|
-
function
|
|
2070
|
-
const
|
|
2398
|
+
function Rn(e) {
|
|
2399
|
+
const n = /* @__PURE__ */ new Set();
|
|
2400
|
+
return e.filter((t) => {
|
|
2401
|
+
if (t.at === void 0) return !0;
|
|
2402
|
+
const s = JSON.stringify([t.kind, t.message, t.sourceDocument ?? null, t.at]);
|
|
2403
|
+
return n.has(s) ? !1 : (n.add(s), !0);
|
|
2404
|
+
});
|
|
2405
|
+
}
|
|
2406
|
+
function Wn(e, n, t) {
|
|
2407
|
+
const s = n.ownerDocument, r = (t == null ? void 0 : t.size) ?? {
|
|
2071
2408
|
width: n.clientWidth,
|
|
2072
2409
|
height: n.clientHeight
|
|
2073
|
-
},
|
|
2410
|
+
}, o = Dt(e), d = o.document, a = En(d, {
|
|
2074
2411
|
...(t == null ? void 0 : t.activeStates) === void 0 ? {} : { activeStates: t.activeStates },
|
|
2075
2412
|
...(t == null ? void 0 : t.states) === void 0 ? {} : { states: t.states }
|
|
2076
|
-
}),
|
|
2077
|
-
size:
|
|
2078
|
-
measureText:
|
|
2413
|
+
}), x = (t == null ? void 0 : t.measureText) ?? en(s), h = Tn(d), l = Kt(d.root, a.styles, a.partStyles, {
|
|
2414
|
+
size: r,
|
|
2415
|
+
measureText: x,
|
|
2416
|
+
locate: h
|
|
2079
2417
|
});
|
|
2080
|
-
let
|
|
2418
|
+
let c;
|
|
2081
2419
|
try {
|
|
2082
|
-
|
|
2420
|
+
c = un(d.root, l.boxes, l.parts, a.styles, n, {
|
|
2083
2421
|
document: s,
|
|
2084
|
-
resolveAsset: t == null ? void 0 : t.resolveAsset
|
|
2422
|
+
resolveAsset: t == null ? void 0 : t.resolveAsset,
|
|
2423
|
+
locate: h
|
|
2085
2424
|
});
|
|
2086
|
-
} catch (
|
|
2087
|
-
throw
|
|
2425
|
+
} catch (p) {
|
|
2426
|
+
throw l.dispose(), p;
|
|
2088
2427
|
}
|
|
2089
|
-
let
|
|
2428
|
+
let u = !1;
|
|
2090
2429
|
return {
|
|
2091
|
-
warnings: [
|
|
2092
|
-
|
|
2093
|
-
|
|
2430
|
+
warnings: Rn([
|
|
2431
|
+
...o.warnings,
|
|
2432
|
+
...a.warnings,
|
|
2433
|
+
...l.warnings,
|
|
2434
|
+
...c.warnings
|
|
2435
|
+
]),
|
|
2436
|
+
elements: c.elements,
|
|
2437
|
+
boxes: l.boxes,
|
|
2094
2438
|
dispose() {
|
|
2095
|
-
|
|
2439
|
+
u || (u = !0, l.dispose(), n.replaceChildren());
|
|
2096
2440
|
}
|
|
2097
2441
|
};
|
|
2098
2442
|
}
|
|
2099
2443
|
export {
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
Dt as
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2444
|
+
Un as KNOWN_DIVERGENCES,
|
|
2445
|
+
an as NODE_ATTRIBUTE,
|
|
2446
|
+
ln as PART_ATTRIBUTE,
|
|
2447
|
+
cn as PART_OWNER_ATTRIBUTE,
|
|
2448
|
+
Ie as TEMPLATE_DEPTH_LIMIT,
|
|
2449
|
+
Pt as USS_STATES,
|
|
2450
|
+
Cn as collectDependencies,
|
|
2451
|
+
en as createDefaultMeasureText,
|
|
2452
|
+
Dt as expandTemplates,
|
|
2453
|
+
Ln as explainProperty,
|
|
2454
|
+
Bt as isInherited,
|
|
2455
|
+
jn as isLayoutEngineReady,
|
|
2456
|
+
zn as liveNodeCount,
|
|
2457
|
+
Nn as loadLayoutEngine,
|
|
2458
|
+
Ne as parse,
|
|
2459
|
+
Wn as render,
|
|
2460
|
+
En as resolveStyles,
|
|
2461
|
+
_n as serialize,
|
|
2462
|
+
ht as supportedControlNames
|
|
2117
2463
|
};
|