uxml-preview 0.4.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 +171 -0
- package/README.md +104 -6
- package/THIRD-PARTY-NOTICES.md +7 -0
- package/dist/index.d.ts +5 -10
- package/dist/index.js +1877 -1073
- package/dist/layout/yoga.d.ts +3 -1
- package/dist/model/types.d.ts +113 -1
- 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 +36 -0
- package/package.json +5 -3
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { loadYoga as
|
|
2
|
-
const
|
|
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
3
|
// VisualElement is the base class and carries no class of its own.
|
|
4
4
|
VisualElement: { hasText: !1, classes: [], parts: [] },
|
|
5
5
|
Label: { hasText: !0, classes: ["unity-label"], parts: [] },
|
|
@@ -37,24 +37,623 @@ const ve = {
|
|
|
37
37
|
{ name: "unity-content-container", style: { "flex-shrink": "0" } }
|
|
38
38
|
]
|
|
39
39
|
}
|
|
40
|
-
},
|
|
41
|
-
function
|
|
42
|
-
return
|
|
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;
|
|
43
55
|
}
|
|
44
|
-
function
|
|
45
|
-
|
|
46
|
-
return n !== void 0 ? { spec: n, fallback: !1 } : je(e) ? { spec: ue, fallback: !1 } : { spec: ue, fallback: !0 };
|
|
56
|
+
function ht() {
|
|
57
|
+
return Object.keys(je);
|
|
47
58
|
}
|
|
48
|
-
function
|
|
49
|
-
|
|
59
|
+
function X(e) {
|
|
60
|
+
const n = (t, s) => !Number.isInteger(t) || t < 0 || t > 1114111 || t >= 55296 && t <= 57343 ? s : String.fromCodePoint(t);
|
|
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, "&");
|
|
50
62
|
}
|
|
51
|
-
function
|
|
52
|
-
return
|
|
63
|
+
function $e(e) {
|
|
64
|
+
return e !== void 0 && /[A-Za-z0-9_.:-]/.test(e);
|
|
53
65
|
}
|
|
54
|
-
function
|
|
55
|
-
return
|
|
66
|
+
function Te(e) {
|
|
67
|
+
return e !== void 0 && /[A-Za-z_]/.test(e);
|
|
56
68
|
}
|
|
57
|
-
|
|
69
|
+
function mt(e) {
|
|
70
|
+
return e === " " || e === " " || e === `
|
|
71
|
+
` || e === "\r";
|
|
72
|
+
}
|
|
73
|
+
function ze(e) {
|
|
74
|
+
const n = [];
|
|
75
|
+
let t = 0, s = 0;
|
|
76
|
+
const r = () => s++;
|
|
77
|
+
function o(c, u, p) {
|
|
78
|
+
n.push({
|
|
79
|
+
kind: "malformed",
|
|
80
|
+
message: c,
|
|
81
|
+
at: { in: "uxml", span: { start: u, end: p } }
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
function d() {
|
|
85
|
+
for (; mt(e[t]); ) t++;
|
|
86
|
+
}
|
|
87
|
+
function a() {
|
|
88
|
+
for (; ; ) {
|
|
89
|
+
const c = e.indexOf("<", t);
|
|
90
|
+
if (c < 0) {
|
|
91
|
+
t = e.length;
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
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;
|
|
102
|
+
} else {
|
|
103
|
+
const p = e.indexOf(">", c);
|
|
104
|
+
t = p < 0 ? e.length : p + 1;
|
|
105
|
+
}
|
|
106
|
+
continue;
|
|
107
|
+
}
|
|
108
|
+
if (u === "?") {
|
|
109
|
+
const p = e.indexOf("?>", c + 2);
|
|
110
|
+
t = p < 0 ? e.length : p + 2;
|
|
111
|
+
continue;
|
|
112
|
+
}
|
|
113
|
+
t = c;
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
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 } };
|
|
134
|
+
t++;
|
|
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 } });
|
|
137
|
+
}
|
|
138
|
+
function l() {
|
|
139
|
+
const c = t;
|
|
140
|
+
t++;
|
|
141
|
+
const u = x(), p = [];
|
|
142
|
+
let i = !1;
|
|
143
|
+
for (; ; ) {
|
|
144
|
+
d();
|
|
145
|
+
const w = e[t];
|
|
146
|
+
if (w === void 0) {
|
|
147
|
+
o("unterminated open tag", c, e.length);
|
|
148
|
+
break;
|
|
149
|
+
}
|
|
150
|
+
if (w === ">") {
|
|
151
|
+
t++;
|
|
152
|
+
break;
|
|
153
|
+
}
|
|
154
|
+
if (w === "/" && e[t + 1] === ">") {
|
|
155
|
+
t += 2, i = !0;
|
|
156
|
+
break;
|
|
157
|
+
}
|
|
158
|
+
const g = h();
|
|
159
|
+
if (g === null) {
|
|
160
|
+
t++;
|
|
161
|
+
continue;
|
|
162
|
+
}
|
|
163
|
+
p.push(g);
|
|
164
|
+
}
|
|
165
|
+
const y = { start: c, end: t };
|
|
166
|
+
if (i)
|
|
167
|
+
return {
|
|
168
|
+
id: r(),
|
|
169
|
+
name: u,
|
|
170
|
+
attributes: p,
|
|
171
|
+
children: [],
|
|
172
|
+
spans: { openTag: y, inner: { start: t, end: t }, closeTag: null },
|
|
173
|
+
tagDirty: !1,
|
|
174
|
+
childrenDirty: !1
|
|
175
|
+
};
|
|
176
|
+
const k = t, f = [];
|
|
177
|
+
for (; ; ) {
|
|
178
|
+
if (a(), t >= e.length) {
|
|
179
|
+
o(`unterminated element <${Le(u)}>`, c, e.length);
|
|
180
|
+
break;
|
|
181
|
+
}
|
|
182
|
+
const w = e[t + 1];
|
|
183
|
+
if (w === "/") break;
|
|
184
|
+
if (!Te(w)) {
|
|
185
|
+
t++;
|
|
186
|
+
continue;
|
|
187
|
+
}
|
|
188
|
+
f.push(l());
|
|
189
|
+
}
|
|
190
|
+
const m = t;
|
|
191
|
+
let v = null;
|
|
192
|
+
if (e.startsWith("</", t)) {
|
|
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;
|
|
195
|
+
}
|
|
196
|
+
return {
|
|
197
|
+
id: r(),
|
|
198
|
+
name: u,
|
|
199
|
+
attributes: p,
|
|
200
|
+
children: f,
|
|
201
|
+
spans: { openTag: y, inner: { start: k, end: m }, closeTag: v },
|
|
202
|
+
tagDirty: !1,
|
|
203
|
+
childrenDirty: !1
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
return a(), t < e.length && Te(e[t + 1]) ? { root: l(), warnings: n } : (o("no root element", 0, 0), {
|
|
207
|
+
root: {
|
|
208
|
+
id: r(),
|
|
209
|
+
name: { prefix: null, local: "" },
|
|
210
|
+
attributes: [],
|
|
211
|
+
children: [],
|
|
212
|
+
spans: { openTag: { start: 0, end: 0 }, inner: { start: 0, end: 0 }, closeTag: null },
|
|
213
|
+
tagDirty: !1,
|
|
214
|
+
childrenDirty: !1
|
|
215
|
+
},
|
|
216
|
+
warnings: n
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
function Le(e) {
|
|
220
|
+
return e.prefix === null ? e.local : `${e.prefix}:${e.local}`;
|
|
221
|
+
}
|
|
222
|
+
let Ue;
|
|
223
|
+
function gt(e) {
|
|
224
|
+
Ue = e;
|
|
225
|
+
}
|
|
226
|
+
const _e = /* @__PURE__ */ new WeakMap();
|
|
227
|
+
function yt(e, n) {
|
|
228
|
+
_e.set(e, n);
|
|
229
|
+
}
|
|
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)];
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
const Ie = 32;
|
|
237
|
+
function We(e, n) {
|
|
238
|
+
var t;
|
|
239
|
+
return (t = e.attributes.find((s) => s.name === n)) == null ? void 0 : t.value;
|
|
240
|
+
}
|
|
241
|
+
function j(e, n) {
|
|
242
|
+
const t = We(e, n);
|
|
243
|
+
return t === void 0 ? void 0 : X(t);
|
|
244
|
+
}
|
|
245
|
+
function Pe(e) {
|
|
246
|
+
const n = /* @__PURE__ */ new Map();
|
|
247
|
+
for (const t of e.root.children) {
|
|
248
|
+
if (t.name.local !== "Template") continue;
|
|
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 });
|
|
251
|
+
}
|
|
252
|
+
return n;
|
|
253
|
+
}
|
|
254
|
+
function Fe(e, n) {
|
|
255
|
+
return JSON.stringify([e, n]);
|
|
256
|
+
}
|
|
257
|
+
function bt(e) {
|
|
258
|
+
return /(?:^|\/)Packages\//i.test(e) || /PackageCache/i.test(e);
|
|
259
|
+
}
|
|
260
|
+
function F(e, n, t, s, r, o = {}) {
|
|
261
|
+
e.push({
|
|
262
|
+
kind: n,
|
|
263
|
+
message: t,
|
|
264
|
+
...s === void 0 ? {} : { node: s.id },
|
|
265
|
+
...r === void 0 ? {} : { sourceDocument: r },
|
|
266
|
+
...o
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
function se(e, n = 0, t = void 0) {
|
|
270
|
+
return {
|
|
271
|
+
...e,
|
|
272
|
+
span: {
|
|
273
|
+
start: e.span.start + n,
|
|
274
|
+
end: e.span.end + n
|
|
275
|
+
},
|
|
276
|
+
...t === void 0 ? {} : { sourceDocument: t }
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
function Be(e) {
|
|
280
|
+
return { prefix: e.prefix, local: e.local };
|
|
281
|
+
}
|
|
282
|
+
function Ee() {
|
|
283
|
+
return { start: 0, end: 0 };
|
|
284
|
+
}
|
|
285
|
+
function ae(e, n) {
|
|
286
|
+
return { start: e.start + n, end: e.end + n };
|
|
287
|
+
}
|
|
288
|
+
function vt(e, n, t, s, r) {
|
|
289
|
+
return {
|
|
290
|
+
id: e,
|
|
291
|
+
name: n,
|
|
292
|
+
attributes: t,
|
|
293
|
+
children: s,
|
|
294
|
+
spans: { openTag: Ee(), inner: Ee(), closeTag: null },
|
|
295
|
+
tagDirty: !1,
|
|
296
|
+
childrenDirty: !1,
|
|
297
|
+
...r === void 0 ? {} : { derived: { kind: "template-container", instance: r } }
|
|
298
|
+
};
|
|
299
|
+
}
|
|
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,
|
|
303
|
+
rule: {
|
|
304
|
+
...r.rule,
|
|
305
|
+
selectors: r.rule.selectors.map((o) => ({
|
|
306
|
+
...o,
|
|
307
|
+
parts: o.parts.map((d) => ({ ...d, simple: [...d.simple] }))
|
|
308
|
+
})),
|
|
309
|
+
declarations: r.rule.declarations.map((o) => ({ ...o }))
|
|
310
|
+
}
|
|
311
|
+
} : { ...r } : { ...r, resolvedSheet: r.resolvedSheet + n });
|
|
312
|
+
return { ...e, items: s, sourceDocumentFrom: t };
|
|
313
|
+
}
|
|
314
|
+
function xt(e, n) {
|
|
315
|
+
const t = n.sheetOffsets.get(e.document);
|
|
316
|
+
if (t !== void 0) return t;
|
|
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) {
|
|
326
|
+
const t = n.sourceOffsets.get(e);
|
|
327
|
+
if (t !== void 0) return t;
|
|
328
|
+
const s = n.sourceLength + 1;
|
|
329
|
+
return n.sourceOffsets.set(e, s), n.sources.push(`
|
|
330
|
+
${e.source}`), n.sourceLength += e.source.length + 1, s;
|
|
331
|
+
}
|
|
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 });
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
function St(e) {
|
|
341
|
+
return e.map((n) => {
|
|
342
|
+
const t = j(n, "name"), s = j(n, "slot");
|
|
343
|
+
return `<${n.name.local}${t === void 0 ? "" : ` name="${t}"`}${s === void 0 ? "" : ` slot="${s}"`}>`;
|
|
344
|
+
});
|
|
345
|
+
}
|
|
346
|
+
function Ve(e, n) {
|
|
347
|
+
const t = j(e, "slot-name");
|
|
348
|
+
t !== void 0 && t.length > 0 && n.add(t);
|
|
349
|
+
for (const s of e.children) Ve(s, n);
|
|
350
|
+
}
|
|
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,
|
|
355
|
+
"template-slot-unsupported",
|
|
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(", ")}`,
|
|
357
|
+
e,
|
|
358
|
+
s,
|
|
359
|
+
{ reason: "not-rendered" }
|
|
360
|
+
);
|
|
361
|
+
}
|
|
362
|
+
function ge(e, n) {
|
|
363
|
+
if (!de(e)) {
|
|
364
|
+
const t = j(e, "name");
|
|
365
|
+
t !== void 0 && t.length > 0 && n.set(t, (n.get(t) ?? 0) + 1);
|
|
366
|
+
}
|
|
367
|
+
for (const t of e.children) ge(t, n);
|
|
368
|
+
}
|
|
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);
|
|
372
|
+
}
|
|
373
|
+
function $t(e, n, t, s, r) {
|
|
374
|
+
if (n.length === 0) return;
|
|
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,
|
|
381
|
+
"override-style-ignored",
|
|
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,
|
|
395
|
+
"override-target-missing",
|
|
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 } }
|
|
400
|
+
);
|
|
401
|
+
continue;
|
|
402
|
+
}
|
|
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);
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
function qe(e) {
|
|
412
|
+
return e.name.local === "Template" || e.name.local === "Instance" ? !0 : e.children.some(qe);
|
|
413
|
+
}
|
|
414
|
+
function Tt(e, n) {
|
|
415
|
+
let t = 0;
|
|
416
|
+
const s = (r) => {
|
|
417
|
+
t = Math.max(t, Number(r.id) + 1);
|
|
418
|
+
for (const o of r.children) s(o);
|
|
419
|
+
};
|
|
420
|
+
return s(e.root), {
|
|
421
|
+
resolver: n,
|
|
422
|
+
warnings: [],
|
|
423
|
+
cache: /* @__PURE__ */ new Map(),
|
|
424
|
+
sheetOffsets: /* @__PURE__ */ new WeakMap(),
|
|
425
|
+
reportedWarnings: /* @__PURE__ */ new WeakSet(),
|
|
426
|
+
sourceOffsets: new WeakMap([[e, 0]]),
|
|
427
|
+
sources: [e.source],
|
|
428
|
+
sourceLength: e.source.length,
|
|
429
|
+
sheets: [...e.sheets],
|
|
430
|
+
styleRoots: [...e.styleRoots ?? []],
|
|
431
|
+
nextId: () => t++,
|
|
432
|
+
stack: []
|
|
433
|
+
};
|
|
434
|
+
}
|
|
435
|
+
function It(e, n, t) {
|
|
436
|
+
var x;
|
|
437
|
+
const s = Fe(e.src, n);
|
|
438
|
+
if (t.cache.has(s)) return t.cache.get(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(
|
|
442
|
+
t.warnings,
|
|
443
|
+
"template-src-unresolved",
|
|
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`,
|
|
445
|
+
e.node,
|
|
446
|
+
n ?? void 0,
|
|
447
|
+
{ subject: { kind: "import", url: e.src, from: n } }
|
|
448
|
+
), bt(e.src) && F(
|
|
449
|
+
t.warnings,
|
|
450
|
+
"package-path-not-searched",
|
|
451
|
+
`Template src "${e.src}" was unresolved; the resolver returned no source and the core does not independently search Unity Packages/Library/PackageCache paths`,
|
|
452
|
+
e.node,
|
|
453
|
+
n ?? void 0,
|
|
454
|
+
{ reason: "not-rendered", subject: { kind: "import", url: e.src, from: n } }
|
|
455
|
+
), null;
|
|
456
|
+
const o = Ue;
|
|
457
|
+
if (o === void 0)
|
|
458
|
+
throw new Error("template parser is not registered; import parse from src/index before expansion");
|
|
459
|
+
const d = o(
|
|
460
|
+
r,
|
|
461
|
+
t.resolver === void 0 ? void 0 : (h, l) => t.resolver(h, l ?? e.src)
|
|
462
|
+
), a = {
|
|
463
|
+
url: e.src,
|
|
464
|
+
from: n,
|
|
465
|
+
document: d,
|
|
466
|
+
declarations: Pe(d)
|
|
467
|
+
};
|
|
468
|
+
return t.cache.set(s, a), a;
|
|
469
|
+
}
|
|
470
|
+
function Et(e, n, t) {
|
|
471
|
+
var s, r;
|
|
472
|
+
if (!t.reportedWarnings.has(e.document)) {
|
|
473
|
+
t.reportedWarnings.add(e.document);
|
|
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)),
|
|
487
|
+
children: [],
|
|
488
|
+
spans: {
|
|
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)
|
|
492
|
+
},
|
|
493
|
+
tagDirty: e.tagDirty,
|
|
494
|
+
childrenDirty: e.childrenDirty,
|
|
495
|
+
...a === 0 || s === null ? {} : {
|
|
496
|
+
sourceDocument: s.url,
|
|
497
|
+
sourceDocumentFrom: s.from,
|
|
498
|
+
sourceNode: e.id
|
|
499
|
+
}
|
|
500
|
+
};
|
|
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));
|
|
506
|
+
continue;
|
|
507
|
+
}
|
|
508
|
+
l.name.local !== "AttributeOverrides" && j(l, "slot") === void 0 && h.children.push(oe(l, n, t, s, r, o));
|
|
509
|
+
}
|
|
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));
|
|
519
|
+
continue;
|
|
520
|
+
}
|
|
521
|
+
o.name.local !== "AttributeOverrides" && j(o, "slot") === void 0 && n.children.push(oe(o, t, r, e, !1, s));
|
|
522
|
+
}
|
|
523
|
+
return r;
|
|
524
|
+
}
|
|
525
|
+
function ye(e, n, t, s, r) {
|
|
526
|
+
const o = vt(
|
|
527
|
+
n.nextId(),
|
|
528
|
+
{ prefix: e.name.prefix, local: "TemplateContainer" },
|
|
529
|
+
e.attributes.filter((f) => f.name !== "template").map(
|
|
530
|
+
(f) => se(
|
|
531
|
+
f,
|
|
532
|
+
t === null ? 0 : n.sourceOffsets.get(t.document) ?? 0,
|
|
533
|
+
t === null || t.url.length === 0 ? null : t.url
|
|
534
|
+
)
|
|
535
|
+
),
|
|
536
|
+
[],
|
|
537
|
+
e.id
|
|
538
|
+
);
|
|
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(
|
|
543
|
+
n.warnings,
|
|
544
|
+
"template-not-declared",
|
|
545
|
+
`Instance${d === void 0 ? "" : ` template "${d}"`} has no matching Template declaration`,
|
|
546
|
+
e,
|
|
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(
|
|
562
|
+
n.warnings,
|
|
563
|
+
"template-cycle",
|
|
564
|
+
`Template cycle detected: ${m}`,
|
|
565
|
+
e,
|
|
566
|
+
x,
|
|
567
|
+
{ reason: "invalid-value" }
|
|
568
|
+
), o;
|
|
569
|
+
}
|
|
570
|
+
if (r >= Ie)
|
|
571
|
+
return q(e, a, null, x, n), F(
|
|
572
|
+
n.warnings,
|
|
573
|
+
"template-depth-exceeded",
|
|
574
|
+
`Template expansion exceeded the depth limit ${Ie}: ${[
|
|
575
|
+
...n.stack,
|
|
576
|
+
c
|
|
577
|
+
].map((f) => f.label).join(" -> ")}`,
|
|
578
|
+
e,
|
|
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);
|
|
587
|
+
n.stack.pop();
|
|
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,
|
|
594
|
+
t === null ? 0 : n.sourceOffsets.get(t.document) ?? 0,
|
|
595
|
+
t === null || t.url.length === 0 ? null : t.url,
|
|
596
|
+
n
|
|
597
|
+
);
|
|
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;
|
|
601
|
+
}
|
|
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 = {
|
|
605
|
+
url: "",
|
|
606
|
+
from: null,
|
|
607
|
+
document: e,
|
|
608
|
+
declarations: Pe(e)
|
|
609
|
+
}, r = { nodes: /* @__PURE__ */ new Map([[e.root.id, e.root.id]]) }, o = {
|
|
610
|
+
id: e.root.id,
|
|
611
|
+
name: Be(e.root.name),
|
|
612
|
+
attributes: e.root.attributes.map((a) => se(a)),
|
|
613
|
+
children: [],
|
|
614
|
+
spans: {
|
|
615
|
+
openTag: { ...e.root.spans.openTag },
|
|
616
|
+
inner: { ...e.root.spans.inner },
|
|
617
|
+
closeTag: e.root.spans.closeTag === null ? null : { ...e.root.spans.closeTag }
|
|
618
|
+
},
|
|
619
|
+
tagDirty: e.root.tagDirty,
|
|
620
|
+
childrenDirty: e.root.childrenDirty
|
|
621
|
+
};
|
|
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));
|
|
626
|
+
continue;
|
|
627
|
+
}
|
|
628
|
+
a.name.local !== "AttributeOverrides" && j(a, "slot") === void 0 && o.children.push(oe(a, n, r, s, !0, 0));
|
|
629
|
+
}
|
|
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(
|
|
638
|
+
n.warnings,
|
|
639
|
+
"duplicate-name-in-tree",
|
|
640
|
+
`name "${a}" occurs ${x} times after template expansion`,
|
|
641
|
+
void 0,
|
|
642
|
+
void 0,
|
|
643
|
+
{ reason: "matches-unity", subject: { kind: "name", name: a } }
|
|
644
|
+
);
|
|
645
|
+
return {
|
|
646
|
+
document: {
|
|
647
|
+
...e,
|
|
648
|
+
root: o,
|
|
649
|
+
source: n.sources.join(""),
|
|
650
|
+
sheets: n.sheets,
|
|
651
|
+
styleRoots: n.styleRoots
|
|
652
|
+
},
|
|
653
|
+
warnings: n.warnings
|
|
654
|
+
};
|
|
655
|
+
}
|
|
656
|
+
const te = "6000.0.40f1", Je = `:disabled {
|
|
58
657
|
opacity: 0.5;
|
|
59
658
|
}
|
|
60
659
|
|
|
@@ -62,42 +661,220 @@ const Y = "6000.0.40f1", ye = `:disabled {
|
|
|
62
661
|
margin: 1px 3px;
|
|
63
662
|
-unity-text-align: middle-center;
|
|
64
663
|
}
|
|
65
|
-
`,
|
|
66
|
-
function
|
|
67
|
-
return e ?
|
|
68
|
-
}
|
|
69
|
-
const
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
"
|
|
77
|
-
"
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
"
|
|
82
|
-
"
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
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
|
+
};
|
|
86
859
|
}
|
|
87
|
-
|
|
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) {
|
|
88
865
|
const n = [];
|
|
89
|
-
let t = 0,
|
|
90
|
-
for (let
|
|
91
|
-
const o = e[
|
|
92
|
-
o === "(" ? t++ : o === ")" && (t = Math.max(0, t - 1)), t === 0 && /\s/.test(o) ?
|
|
866
|
+
let t = 0, s = -1;
|
|
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);
|
|
93
870
|
}
|
|
94
|
-
return
|
|
871
|
+
return s >= 0 && n.push(e.slice(s)), n;
|
|
95
872
|
}
|
|
96
|
-
function
|
|
97
|
-
const [n, t,
|
|
98
|
-
return n === void 0 ? null : t === void 0 ? [n, n, n, n] :
|
|
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];
|
|
99
876
|
}
|
|
100
|
-
const
|
|
877
|
+
const Vt = {
|
|
101
878
|
margin: ["margin-top", "margin-right", "margin-bottom", "margin-left"],
|
|
102
879
|
padding: ["padding-top", "padding-right", "padding-bottom", "padding-left"],
|
|
103
880
|
"border-width": [
|
|
@@ -120,21 +897,21 @@ const Ge = {
|
|
|
120
897
|
"border-bottom-left-radius"
|
|
121
898
|
]
|
|
122
899
|
};
|
|
123
|
-
function
|
|
900
|
+
function De(e) {
|
|
124
901
|
return /^-?(\d+\.?\d*|\.\d+)$/.test(e);
|
|
125
902
|
}
|
|
126
|
-
function
|
|
127
|
-
const [n, t,
|
|
128
|
-
return n === void 0 ? [] : n === "none" ? [["flex-grow", "0"], ["flex-shrink", "0"], ["flex-basis", "auto"]] : n === "auto" ? [["flex-grow", "1"], ["flex-shrink", "1"], ["flex-basis", "auto"]] : t === void 0 ?
|
|
903
|
+
function Yt(e) {
|
|
904
|
+
const [n, t, s] = e;
|
|
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]];
|
|
129
906
|
}
|
|
130
|
-
function
|
|
131
|
-
if (e === "flex") return
|
|
132
|
-
const t =
|
|
907
|
+
function le(e, n) {
|
|
908
|
+
if (e === "flex") return Yt(Oe(n));
|
|
909
|
+
const t = Vt[e];
|
|
133
910
|
if (t === void 0) return [[e, n]];
|
|
134
|
-
const
|
|
135
|
-
return
|
|
911
|
+
const s = Ht(Oe(n));
|
|
912
|
+
return s === null ? [[e, n]] : t.map((r, o) => [r, s[o]]);
|
|
136
913
|
}
|
|
137
|
-
const
|
|
914
|
+
const fe = {
|
|
138
915
|
"align-content": "flex-start",
|
|
139
916
|
"align-items": "stretch",
|
|
140
917
|
"align-self": "auto",
|
|
@@ -170,36 +947,37 @@ const ee = {
|
|
|
170
947
|
"padding-right": "0",
|
|
171
948
|
"padding-top": "0",
|
|
172
949
|
"font-size": "12px"
|
|
173
|
-
},
|
|
174
|
-
function
|
|
950
|
+
}, qt = ["em", "rem", "vh", "vw", "vmin", "vmax", "pt", "cm", "in"];
|
|
951
|
+
function ne(e) {
|
|
175
952
|
const n = e.trim();
|
|
176
|
-
if (n === "") return { length: null, problem: "empty value" };
|
|
953
|
+
if (n === "") return { length: null, problem: "empty value", reason: "invalid-value" };
|
|
177
954
|
if (n === "auto") return { length: { kind: "auto" } };
|
|
178
955
|
if (n === "none") return { length: { kind: "none" } };
|
|
179
956
|
if (n === "initial") return { length: { kind: "auto" } };
|
|
180
957
|
if (n.startsWith("calc("))
|
|
181
|
-
return { length: null, problem: "calc() is not
|
|
958
|
+
return { length: null, problem: "calc() is not evaluated", reason: "not-uss" };
|
|
182
959
|
const t = /^(-?(?:\d+\.?\d*|\.\d+))([a-z%]*)$/i.exec(n);
|
|
183
|
-
if (t === null)
|
|
184
|
-
|
|
185
|
-
|
|
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" };
|
|
186
964
|
}
|
|
187
|
-
function
|
|
965
|
+
function Me(e) {
|
|
188
966
|
const n = e.trim();
|
|
189
967
|
return /^-?(\d+\.?\d*|\.\d+)$/.test(n) ? Number(n) : null;
|
|
190
968
|
}
|
|
191
|
-
let
|
|
192
|
-
async function
|
|
193
|
-
|
|
969
|
+
let be = null;
|
|
970
|
+
async function Nn() {
|
|
971
|
+
be ?? (be = await it());
|
|
194
972
|
}
|
|
195
|
-
function
|
|
196
|
-
return
|
|
973
|
+
function jn() {
|
|
974
|
+
return be !== null;
|
|
197
975
|
}
|
|
198
|
-
let
|
|
199
|
-
function
|
|
200
|
-
return
|
|
976
|
+
let Q = 0;
|
|
977
|
+
function zn() {
|
|
978
|
+
return Q;
|
|
201
979
|
}
|
|
202
|
-
const
|
|
980
|
+
const ce = {
|
|
203
981
|
auto: L.Auto,
|
|
204
982
|
"flex-start": L.FlexStart,
|
|
205
983
|
center: L.Center,
|
|
@@ -209,279 +987,295 @@ const K = {
|
|
|
209
987
|
"space-between": L.SpaceBetween,
|
|
210
988
|
"space-around": L.SpaceAround,
|
|
211
989
|
"space-evenly": L.SpaceEvenly
|
|
212
|
-
},
|
|
213
|
-
"flex-start":
|
|
214
|
-
center:
|
|
215
|
-
"flex-end":
|
|
216
|
-
"space-between":
|
|
217
|
-
"space-around":
|
|
218
|
-
"space-evenly":
|
|
219
|
-
},
|
|
220
|
-
column:
|
|
221
|
-
"column-reverse":
|
|
222
|
-
row:
|
|
223
|
-
"row-reverse":
|
|
224
|
-
},
|
|
225
|
-
nowrap:
|
|
226
|
-
wrap:
|
|
227
|
-
"wrap-reverse":
|
|
228
|
-
},
|
|
229
|
-
["left",
|
|
230
|
-
["top",
|
|
231
|
-
["right",
|
|
232
|
-
["bottom",
|
|
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 = {
|
|
998
|
+
column: G.Column,
|
|
999
|
+
"column-reverse": G.ColumnReverse,
|
|
1000
|
+
row: G.Row,
|
|
1001
|
+
"row-reverse": G.RowReverse
|
|
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]
|
|
233
1011
|
];
|
|
234
|
-
function
|
|
235
|
-
const
|
|
236
|
-
if (
|
|
1012
|
+
function Kt(e, n, t, s) {
|
|
1013
|
+
const r = be;
|
|
1014
|
+
if (r === null)
|
|
237
1015
|
throw new Error("loadLayoutEngine() must be awaited before rendering");
|
|
238
|
-
const o = [],
|
|
239
|
-
let
|
|
240
|
-
const
|
|
241
|
-
var
|
|
242
|
-
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] ?? "";
|
|
243
1021
|
};
|
|
244
|
-
function b
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
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) {
|
|
256
1049
|
case "px":
|
|
257
|
-
return
|
|
1050
|
+
return b.value;
|
|
258
1051
|
case "percent":
|
|
259
|
-
return `${
|
|
1052
|
+
return `${b.value}%`;
|
|
260
1053
|
case "auto":
|
|
261
1054
|
return "auto";
|
|
262
1055
|
case "none":
|
|
263
1056
|
return;
|
|
264
1057
|
}
|
|
265
1058
|
}
|
|
266
|
-
function
|
|
267
|
-
if (
|
|
268
|
-
if (
|
|
269
|
-
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}%`;
|
|
270
1063
|
}
|
|
271
1064
|
}
|
|
272
|
-
function
|
|
273
|
-
|
|
274
|
-
const
|
|
275
|
-
(
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
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)));
|
|
284
1088
|
}
|
|
285
1089
|
}
|
|
286
|
-
function
|
|
287
|
-
var
|
|
288
|
-
return (
|
|
1090
|
+
function w(b) {
|
|
1091
|
+
var S;
|
|
1092
|
+
return (S = b.attributes.find((I) => I.name === "text")) == null ? void 0 : S.value;
|
|
289
1093
|
}
|
|
290
|
-
const
|
|
291
|
-
function $(
|
|
292
|
-
return
|
|
293
|
-
(
|
|
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)
|
|
294
1098
|
);
|
|
295
1099
|
}
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
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);
|
|
303
1117
|
o.push({
|
|
304
1118
|
kind: "unsupported-control",
|
|
305
|
-
message: `<${
|
|
306
|
-
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 }
|
|
307
1123
|
});
|
|
308
1124
|
}
|
|
309
|
-
if (
|
|
310
|
-
|
|
311
|
-
`<${
|
|
312
|
-
|
|
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 } }
|
|
313
1130
|
);
|
|
314
|
-
const
|
|
315
|
-
fontSize:
|
|
316
|
-
fontStyle:
|
|
317
|
-
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"
|
|
318
1135
|
};
|
|
319
|
-
|
|
320
|
-
(
|
|
1136
|
+
E.setMeasureFunc(
|
|
1137
|
+
(N) => s.measureText(
|
|
321
1138
|
A,
|
|
322
|
-
|
|
323
|
-
Number.isFinite(
|
|
1139
|
+
P,
|
|
1140
|
+
Number.isFinite(N) ? N : 0
|
|
324
1141
|
)
|
|
325
1142
|
);
|
|
326
1143
|
return;
|
|
327
1144
|
}
|
|
328
|
-
let
|
|
329
|
-
if (
|
|
330
|
-
|
|
1145
|
+
let _ = E;
|
|
1146
|
+
if (D.parts.length > 0) {
|
|
1147
|
+
p || (p = !0, o.push({
|
|
331
1148
|
kind: "version-dependent",
|
|
332
|
-
message: `<${
|
|
333
|
-
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 }
|
|
334
1153
|
}));
|
|
335
|
-
const
|
|
336
|
-
for (const
|
|
337
|
-
const
|
|
338
|
-
|
|
339
|
-
name:
|
|
340
|
-
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,
|
|
341
1160
|
box: { left: 0, top: 0, width: 0, height: 0 },
|
|
342
|
-
style:
|
|
1161
|
+
style: ke
|
|
343
1162
|
});
|
|
344
1163
|
}
|
|
345
|
-
|
|
1164
|
+
a.set(b.id, C), l.set(b.id, P);
|
|
346
1165
|
}
|
|
347
|
-
for (const
|
|
1166
|
+
for (const C of b.children) O(C, _);
|
|
348
1167
|
}
|
|
349
1168
|
O(e, null);
|
|
350
|
-
const
|
|
351
|
-
|
|
352
|
-
const
|
|
353
|
-
for (let
|
|
354
|
-
let
|
|
355
|
-
for (const [
|
|
356
|
-
const
|
|
357
|
-
if (
|
|
358
|
-
const
|
|
359
|
-
if (
|
|
360
|
-
const
|
|
361
|
-
(
|
|
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++) {
|
|
1173
|
+
let S = !1;
|
|
1174
|
+
for (const [I, E] of a) {
|
|
1175
|
+
const D = l.get(I);
|
|
1176
|
+
if (D === void 0) continue;
|
|
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);
|
|
362
1181
|
}
|
|
363
|
-
if (!
|
|
364
|
-
|
|
365
|
-
}
|
|
366
|
-
function
|
|
367
|
-
const
|
|
368
|
-
if (
|
|
369
|
-
const
|
|
370
|
-
let
|
|
371
|
-
|
|
372
|
-
const
|
|
373
|
-
|
|
374
|
-
const
|
|
375
|
-
|
|
1182
|
+
if (!S) break;
|
|
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 };
|
|
376
1195
|
});
|
|
377
|
-
for (const
|
|
1196
|
+
for (const C of b.children) W(C, M, A);
|
|
378
1197
|
}
|
|
379
|
-
return
|
|
380
|
-
boxes:
|
|
381
|
-
parts:
|
|
382
|
-
painted:
|
|
1198
|
+
return W(e, 0, 0), {
|
|
1199
|
+
boxes: d,
|
|
1200
|
+
parts: a,
|
|
1201
|
+
painted: x,
|
|
383
1202
|
warnings: o,
|
|
384
1203
|
dispose() {
|
|
385
|
-
u || (u = !0,
|
|
1204
|
+
u || (u = !0, R.freeRecursive(), Q -= c, h.clear(), l.clear());
|
|
386
1205
|
}
|
|
387
1206
|
};
|
|
388
1207
|
}
|
|
389
|
-
const
|
|
390
|
-
function
|
|
1208
|
+
const Qt = 1.2;
|
|
1209
|
+
function en(e) {
|
|
391
1210
|
var t;
|
|
392
1211
|
let n = null;
|
|
393
1212
|
if (e !== void 0) {
|
|
394
|
-
const
|
|
395
|
-
n = ((t =
|
|
1213
|
+
const s = e.createElement("canvas");
|
|
1214
|
+
n = ((t = s.getContext) == null ? void 0 : t.call(s, "2d")) ?? null;
|
|
396
1215
|
}
|
|
397
|
-
return (
|
|
398
|
-
const
|
|
1216
|
+
return (s, r, o) => {
|
|
1217
|
+
const d = r.fontSize * Qt, a = (p) => {
|
|
399
1218
|
if (n === null)
|
|
400
|
-
return
|
|
401
|
-
const
|
|
402
|
-
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;
|
|
403
1222
|
};
|
|
404
|
-
if (!(
|
|
405
|
-
const
|
|
1223
|
+
if (!(r.whiteSpace !== "nowrap" && r.whiteSpace !== "pre") || o <= 0) {
|
|
1224
|
+
const p = s.split(`
|
|
406
1225
|
`);
|
|
407
|
-
return { width:
|
|
1226
|
+
return { width: p.reduce((y, k) => Math.max(y, a(k)), 0), height: p.length * d };
|
|
408
1227
|
}
|
|
409
|
-
const
|
|
410
|
-
let
|
|
411
|
-
for (const
|
|
412
|
-
const
|
|
413
|
-
|
|
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;
|
|
414
1233
|
}
|
|
415
|
-
return u = Math.max(u,
|
|
1234
|
+
return u = Math.max(u, c), { width: u, height: l * d };
|
|
416
1235
|
};
|
|
417
1236
|
}
|
|
418
|
-
|
|
419
|
-
const n = (t, i) => !Number.isInteger(t) || t < 0 || t > 1114111 || t >= 55296 && t <= 57343 ? i : String.fromCodePoint(t);
|
|
420
|
-
return e.replace(/&#x([0-9a-f]+);/gi, (t, i) => n(parseInt(i, 16), t)).replace(/&#(\d+);/g, (t, i) => n(Number(i), t)).replace(/</g, "<").replace(/>/g, ">").replace(/"/g, '"').replace(/'/g, "'").replace(/&/g, "&");
|
|
421
|
-
}
|
|
422
|
-
const it = /* @__PURE__ */ new Set([
|
|
423
|
-
"box-shadow",
|
|
424
|
-
"filter",
|
|
425
|
-
"backdrop-filter",
|
|
426
|
-
"mix-blend-mode",
|
|
427
|
-
"background-blend-mode",
|
|
428
|
-
"clip-path",
|
|
429
|
-
"mask",
|
|
430
|
-
"outline",
|
|
431
|
-
"line-height",
|
|
432
|
-
"text-transform",
|
|
433
|
-
"text-decoration",
|
|
434
|
-
"z-index",
|
|
435
|
-
"float",
|
|
436
|
-
"clear",
|
|
437
|
-
"border-style"
|
|
438
|
-
]), st = /* @__PURE__ */ new Set([
|
|
439
|
-
"gap",
|
|
440
|
-
"row-gap",
|
|
441
|
-
"column-gap",
|
|
442
|
-
"aspect-ratio",
|
|
443
|
-
"background-size",
|
|
444
|
-
"background-position",
|
|
445
|
-
"background-repeat",
|
|
446
|
-
"overflow-wrap",
|
|
447
|
-
"word-break"
|
|
448
|
-
]), he = ["top", "right", "bottom", "left"], rt = {
|
|
1237
|
+
const tn = ["top", "right", "bottom", "left"], nn = {
|
|
449
1238
|
normal: { weight: "normal", style: "normal" },
|
|
450
1239
|
bold: { weight: "bold", style: "normal" },
|
|
451
1240
|
italic: { weight: "normal", style: "italic" },
|
|
452
1241
|
"bold-and-italic": { weight: "bold", style: "italic" }
|
|
453
|
-
},
|
|
1242
|
+
}, sn = {
|
|
454
1243
|
upper: "flex-start",
|
|
455
1244
|
middle: "center",
|
|
456
1245
|
lower: "flex-end"
|
|
457
|
-
},
|
|
1246
|
+
}, on = {
|
|
458
1247
|
left: "flex-start",
|
|
459
1248
|
center: "center",
|
|
460
1249
|
right: "flex-end"
|
|
461
|
-
},
|
|
1250
|
+
}, ue = {
|
|
462
1251
|
"stretch-to-fill": "100% 100%",
|
|
463
1252
|
"scale-and-crop": "cover",
|
|
464
1253
|
"scale-to-fit": "contain"
|
|
465
|
-
},
|
|
466
|
-
function
|
|
467
|
-
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());
|
|
468
1257
|
return n === null ? null : { form: n[1], path: n[3] };
|
|
469
1258
|
}
|
|
470
|
-
function
|
|
471
|
-
var
|
|
472
|
-
const
|
|
473
|
-
var
|
|
474
|
-
return (
|
|
475
|
-
},
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
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
|
+
});
|
|
1277
|
+
s["box-sizing"] = "border-box";
|
|
1278
|
+
const x = [
|
|
485
1279
|
"background-color",
|
|
486
1280
|
"color",
|
|
487
1281
|
"opacity",
|
|
@@ -494,192 +1288,199 @@ function ge(e, n, t = {}) {
|
|
|
494
1288
|
"font-size",
|
|
495
1289
|
"transform-origin"
|
|
496
1290
|
];
|
|
497
|
-
for (const
|
|
498
|
-
const
|
|
499
|
-
|
|
500
|
-
}
|
|
501
|
-
o("display") === "none" && (
|
|
502
|
-
for (const
|
|
503
|
-
const
|
|
504
|
-
if (
|
|
505
|
-
const { length:
|
|
506
|
-
|
|
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(
|
|
507
1301
|
"unsupported-property",
|
|
508
|
-
`border-${
|
|
509
|
-
|
|
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");
|
|
510
1305
|
}
|
|
511
|
-
const
|
|
512
|
-
|
|
513
|
-
const w = o(`padding-${
|
|
514
|
-
w !== void 0 && w !== "0" && (
|
|
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);
|
|
515
1310
|
}
|
|
516
|
-
for (const
|
|
1311
|
+
for (const f of [
|
|
517
1312
|
"top-left",
|
|
518
1313
|
"top-right",
|
|
519
1314
|
"bottom-right",
|
|
520
1315
|
"bottom-left"
|
|
521
1316
|
]) {
|
|
522
|
-
const
|
|
523
|
-
|
|
524
|
-
}
|
|
525
|
-
const
|
|
526
|
-
if (
|
|
527
|
-
const
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
const
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
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
|
+
});
|
|
546
1350
|
else {
|
|
547
|
-
const { form:
|
|
1351
|
+
const { form: m, path: v } = f, w = ((k = t.resolveAsset) == null ? void 0 : k.call(t, v, m)) ?? null;
|
|
548
1352
|
if (w === null)
|
|
549
|
-
|
|
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
|
+
});
|
|
550
1356
|
else {
|
|
551
|
-
|
|
552
|
-
const
|
|
553
|
-
|
|
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(
|
|
554
1360
|
"unsupported-property",
|
|
555
|
-
`-unity-background-scale-mode: ${
|
|
556
|
-
|
|
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];
|
|
557
1364
|
}
|
|
558
1365
|
}
|
|
559
1366
|
}
|
|
560
|
-
return
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
const
|
|
569
|
-
|
|
570
|
-
const p = [], g = /* @__PURE__ */ new Map();
|
|
571
|
-
function v(u) {
|
|
572
|
-
const r = i.get(u.id), f = (b) => {
|
|
573
|
-
var h;
|
|
574
|
-
const c = ((h = r == null ? void 0 : r.get(b)) == null ? void 0 : h.value) ?? ee[b] ?? "0", { length: S } = X(c);
|
|
575
|
-
return S !== null && S.kind === "px" ? S.value : 0;
|
|
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) => {
|
|
1374
|
+
var m;
|
|
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;
|
|
576
1377
|
};
|
|
577
|
-
return { left:
|
|
1378
|
+
return { left: i("border-left-width"), top: i("border-top-width") };
|
|
578
1379
|
}
|
|
579
|
-
function
|
|
580
|
-
const
|
|
581
|
-
var
|
|
582
|
-
const
|
|
583
|
-
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;
|
|
584
1385
|
};
|
|
585
|
-
return { left:
|
|
586
|
-
}
|
|
587
|
-
function
|
|
588
|
-
var
|
|
589
|
-
const
|
|
590
|
-
if (
|
|
591
|
-
const
|
|
592
|
-
|
|
593
|
-
const
|
|
594
|
-
|
|
595
|
-
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 = {
|
|
596
1397
|
position: "absolute",
|
|
597
|
-
left: `${
|
|
598
|
-
top: `${
|
|
599
|
-
width: `${
|
|
600
|
-
height: `${
|
|
1398
|
+
left: `${v}px`,
|
|
1399
|
+
top: `${w}px`,
|
|
1400
|
+
width: `${y.width}px`,
|
|
1401
|
+
height: `${y.height}px`,
|
|
601
1402
|
margin: "0",
|
|
602
|
-
...
|
|
1403
|
+
...m.declarations
|
|
603
1404
|
};
|
|
604
|
-
for (const [
|
|
605
|
-
|
|
606
|
-
const { spec: $ } =
|
|
607
|
-
if ($.hasText &&
|
|
608
|
-
|
|
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);
|
|
609
1410
|
else {
|
|
610
|
-
let
|
|
611
|
-
for (const
|
|
612
|
-
const
|
|
613
|
-
|
|
614
|
-
const
|
|
615
|
-
|
|
616
|
-
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 = {
|
|
617
1418
|
position: "absolute",
|
|
618
|
-
left: `${
|
|
619
|
-
top: `${
|
|
620
|
-
width: `${
|
|
621
|
-
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`,
|
|
622
1423
|
margin: "0",
|
|
623
|
-
...
|
|
1424
|
+
...I.declarations
|
|
624
1425
|
};
|
|
625
|
-
for (const [
|
|
626
|
-
|
|
627
|
-
|
|
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);
|
|
628
1429
|
}
|
|
629
|
-
for (const
|
|
630
|
-
const
|
|
631
|
-
|
|
1430
|
+
for (const b of u.children) {
|
|
1431
|
+
const S = l(b, z, W);
|
|
1432
|
+
S !== null && R.appendChild(S);
|
|
632
1433
|
}
|
|
633
1434
|
}
|
|
634
|
-
return
|
|
1435
|
+
return a.set(u.id, k), k;
|
|
635
1436
|
}
|
|
636
|
-
|
|
637
|
-
const
|
|
638
|
-
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 };
|
|
639
1440
|
}
|
|
640
|
-
const
|
|
641
|
-
function
|
|
1441
|
+
const Ce = /[A-Za-z0-9_-]/;
|
|
1442
|
+
function V(e) {
|
|
642
1443
|
return e === " " || e === " " || e === `
|
|
643
1444
|
` || e === "\r" || e === "\f";
|
|
644
1445
|
}
|
|
645
|
-
function
|
|
646
|
-
let
|
|
647
|
-
for (;
|
|
648
|
-
const o = e[
|
|
1446
|
+
function pe(e, n, t) {
|
|
1447
|
+
let s = n, r = 0;
|
|
1448
|
+
for (; s < e.length; ) {
|
|
1449
|
+
const o = e[s];
|
|
649
1450
|
if (o === '"' || o === "'") {
|
|
650
|
-
const
|
|
651
|
-
|
|
1451
|
+
const d = e.indexOf(o, s + 1);
|
|
1452
|
+
s = d < 0 ? e.length : d + 1;
|
|
652
1453
|
continue;
|
|
653
1454
|
}
|
|
654
|
-
if (o === "/" && e[
|
|
655
|
-
const
|
|
656
|
-
|
|
1455
|
+
if (o === "/" && e[s + 1] === "*") {
|
|
1456
|
+
const d = e.indexOf("*/", s + 2);
|
|
1457
|
+
s = d < 0 ? e.length : d + 2;
|
|
657
1458
|
continue;
|
|
658
1459
|
}
|
|
659
1460
|
if (o === "(" || o === "[")
|
|
660
|
-
|
|
1461
|
+
r++;
|
|
661
1462
|
else if (o === ")" || o === "]")
|
|
662
|
-
|
|
663
|
-
else if (
|
|
664
|
-
return
|
|
665
|
-
|
|
1463
|
+
r > 0 && r--;
|
|
1464
|
+
else if (r === 0 && t.includes(o))
|
|
1465
|
+
return s;
|
|
1466
|
+
s++;
|
|
666
1467
|
}
|
|
667
1468
|
return e.length;
|
|
668
1469
|
}
|
|
669
|
-
function
|
|
670
|
-
let
|
|
671
|
-
for (;
|
|
672
|
-
for (;
|
|
673
|
-
return { start:
|
|
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 };
|
|
674
1475
|
}
|
|
675
|
-
function
|
|
676
|
-
const
|
|
1476
|
+
function Ke(e, n, t, s) {
|
|
1477
|
+
const r = [];
|
|
677
1478
|
let o = n;
|
|
678
1479
|
for (; o < t; ) {
|
|
679
|
-
for (; o < t && (
|
|
1480
|
+
for (; o < t && (V(e[o]) || e.startsWith("/*", o)); )
|
|
680
1481
|
if (e.startsWith("/*", o)) {
|
|
681
|
-
const
|
|
682
|
-
o =
|
|
1482
|
+
const l = e.indexOf("*/", o + 2);
|
|
1483
|
+
o = l < 0 ? t : l + 2;
|
|
683
1484
|
} else
|
|
684
1485
|
o++;
|
|
685
1486
|
if (o >= t) break;
|
|
@@ -687,195 +1488,195 @@ function Se(e, n, t, i) {
|
|
|
687
1488
|
o++;
|
|
688
1489
|
continue;
|
|
689
1490
|
}
|
|
690
|
-
const
|
|
691
|
-
if (
|
|
692
|
-
const
|
|
693
|
-
|
|
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;
|
|
694
1495
|
continue;
|
|
695
1496
|
}
|
|
696
|
-
const
|
|
697
|
-
|
|
698
|
-
property: e.slice(
|
|
699
|
-
value: e.slice(
|
|
700
|
-
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 },
|
|
701
1502
|
dirty: !1
|
|
702
|
-
}), o =
|
|
1503
|
+
}), o = x + 1;
|
|
703
1504
|
}
|
|
704
|
-
return
|
|
1505
|
+
return r;
|
|
705
1506
|
}
|
|
706
|
-
function
|
|
1507
|
+
function dn(e) {
|
|
707
1508
|
const n = e.span.end - 1 - e.value.length;
|
|
708
1509
|
return n < e.span.start ? null : n;
|
|
709
1510
|
}
|
|
710
|
-
function
|
|
711
|
-
const
|
|
1511
|
+
function ve(e, n = null, t = 0) {
|
|
1512
|
+
const s = [], r = [];
|
|
712
1513
|
let o = 0;
|
|
713
|
-
function
|
|
714
|
-
|
|
1514
|
+
function d(m, v, w) {
|
|
1515
|
+
s.push({
|
|
715
1516
|
kind: "malformed",
|
|
716
|
-
message:
|
|
717
|
-
at: { in: "uss", sheet: t, span: { start:
|
|
1517
|
+
message: m,
|
|
1518
|
+
at: { in: "uss", sheet: t, span: { start: v, end: w } }
|
|
718
1519
|
});
|
|
719
1520
|
}
|
|
720
|
-
function
|
|
1521
|
+
function a() {
|
|
721
1522
|
for (; ; ) {
|
|
722
|
-
for (;
|
|
1523
|
+
for (; V(e[o]); ) o++;
|
|
723
1524
|
if (e.startsWith("/*", o)) {
|
|
724
|
-
const
|
|
725
|
-
o =
|
|
1525
|
+
const m = e.indexOf("*/", o + 2);
|
|
1526
|
+
o = m < 0 ? e.length : m + 2;
|
|
726
1527
|
continue;
|
|
727
1528
|
}
|
|
728
1529
|
return;
|
|
729
1530
|
}
|
|
730
1531
|
}
|
|
731
|
-
const
|
|
732
|
-
function
|
|
733
|
-
let
|
|
734
|
-
for (;
|
|
735
|
-
const
|
|
736
|
-
if (
|
|
737
|
-
const $ = e.indexOf(
|
|
738
|
-
|
|
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;
|
|
739
1540
|
continue;
|
|
740
1541
|
}
|
|
741
|
-
if (
|
|
742
|
-
const $ = e.indexOf("*/",
|
|
743
|
-
|
|
1542
|
+
if (g === "/" && e[v + 1] === "*") {
|
|
1543
|
+
const $ = e.indexOf("*/", v + 2);
|
|
1544
|
+
v = $ < 0 ? e.length : $ + 2;
|
|
744
1545
|
continue;
|
|
745
1546
|
}
|
|
746
|
-
if (
|
|
747
|
-
else if (
|
|
748
|
-
|
|
1547
|
+
if (g === "{") w++;
|
|
1548
|
+
else if (g === "}" && --w === 0) return v + 1;
|
|
1549
|
+
v++;
|
|
749
1550
|
}
|
|
750
1551
|
return e.length;
|
|
751
1552
|
}
|
|
752
|
-
function
|
|
753
|
-
let
|
|
754
|
-
for (;
|
|
755
|
-
return
|
|
756
|
-
}
|
|
757
|
-
function u(
|
|
758
|
-
const
|
|
759
|
-
let
|
|
760
|
-
for (;
|
|
761
|
-
const
|
|
762
|
-
if (
|
|
763
|
-
const
|
|
764
|
-
|
|
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;
|
|
765
1566
|
continue;
|
|
766
1567
|
}
|
|
767
|
-
if (
|
|
768
|
-
else if (
|
|
769
|
-
|
|
1568
|
+
if (T === v) $++;
|
|
1569
|
+
else if (T === w && --$ === 0) return g + 1;
|
|
1570
|
+
g++;
|
|
770
1571
|
}
|
|
771
1572
|
return e.length;
|
|
772
1573
|
}
|
|
773
|
-
function
|
|
774
|
-
const
|
|
775
|
-
let
|
|
776
|
-
for (;
|
|
777
|
-
const $ = e[
|
|
778
|
-
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;
|
|
779
1580
|
if ($ === "*")
|
|
780
|
-
|
|
1581
|
+
w.push({ kind: "universal" }), g++;
|
|
781
1582
|
else if ($ === "." || $ === "#") {
|
|
782
|
-
const
|
|
783
|
-
|
|
784
|
-
$ === "." ? { kind: "class", name: e.slice(
|
|
785
|
-
),
|
|
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;
|
|
786
1587
|
} else if ($ === "[") {
|
|
787
|
-
const
|
|
788
|
-
|
|
1588
|
+
const T = Math.min(u(g), v);
|
|
1589
|
+
w.push({ kind: "unknown", text: e.slice(g, T) }), g = T;
|
|
789
1590
|
} else if ($ === ":")
|
|
790
|
-
if (e[
|
|
791
|
-
const
|
|
792
|
-
|
|
1591
|
+
if (e[g + 1] === ":") {
|
|
1592
|
+
const T = c(g + 2);
|
|
1593
|
+
w.push({ kind: "unknown", text: e.slice(g, T) }), g = T;
|
|
793
1594
|
} else {
|
|
794
|
-
const
|
|
795
|
-
if (e[
|
|
796
|
-
const
|
|
797
|
-
|
|
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;
|
|
798
1599
|
} else
|
|
799
|
-
|
|
1600
|
+
w.push({ kind: "pseudo", name: e.slice(g + 1, T) }), g = T;
|
|
800
1601
|
}
|
|
801
|
-
else if (
|
|
802
|
-
const
|
|
803
|
-
|
|
1602
|
+
else if (Ce.test($)) {
|
|
1603
|
+
const T = c(g);
|
|
1604
|
+
w.push({ kind: "type", name: e.slice(g, T) }), g = T;
|
|
804
1605
|
} else
|
|
805
|
-
|
|
1606
|
+
w.push({ kind: "unknown", text: $ }), g++;
|
|
806
1607
|
}
|
|
807
|
-
return { simple:
|
|
808
|
-
}
|
|
809
|
-
function
|
|
810
|
-
const
|
|
811
|
-
let $ = "descendant",
|
|
812
|
-
for (;
|
|
813
|
-
const
|
|
814
|
-
if (
|
|
815
|
-
|
|
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++;
|
|
816
1617
|
continue;
|
|
817
1618
|
}
|
|
818
|
-
if (
|
|
819
|
-
$ = "child",
|
|
1619
|
+
if (R === ">") {
|
|
1620
|
+
$ = "child", O++;
|
|
820
1621
|
continue;
|
|
821
1622
|
}
|
|
822
|
-
if (
|
|
823
|
-
|
|
1623
|
+
if (R === "+" || R === "~") {
|
|
1624
|
+
T = R, O++;
|
|
824
1625
|
continue;
|
|
825
1626
|
}
|
|
826
|
-
const { simple:
|
|
827
|
-
if (
|
|
828
|
-
|
|
1627
|
+
const { simple: z, next: W } = p(O, w.end);
|
|
1628
|
+
if (W === O) {
|
|
1629
|
+
O++;
|
|
829
1630
|
continue;
|
|
830
1631
|
}
|
|
831
|
-
|
|
1632
|
+
T !== null && (z.unshift({ kind: "unknown", text: T }), T = null), g.push({ combinator: $, simple: z }), $ = "descendant", O = W;
|
|
832
1633
|
}
|
|
833
|
-
return { parts:
|
|
1634
|
+
return { parts: g, span: w };
|
|
834
1635
|
}
|
|
835
|
-
function
|
|
836
|
-
const
|
|
837
|
-
let
|
|
1636
|
+
function y(m, v) {
|
|
1637
|
+
const w = [];
|
|
1638
|
+
let g = m;
|
|
838
1639
|
for (; ; ) {
|
|
839
|
-
const $ = Math.min(
|
|
840
|
-
if (
|
|
841
|
-
|
|
1640
|
+
const $ = Math.min(x(g, ","), v);
|
|
1641
|
+
if (w.push(i(g, $)), $ >= v) break;
|
|
1642
|
+
g = $ + 1;
|
|
842
1643
|
}
|
|
843
|
-
return
|
|
1644
|
+
return w;
|
|
844
1645
|
}
|
|
845
|
-
function
|
|
846
|
-
const
|
|
847
|
-
if (
|
|
848
|
-
const
|
|
849
|
-
return o =
|
|
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 } };
|
|
850
1651
|
}
|
|
851
|
-
const $ =
|
|
852
|
-
if (o = $,
|
|
853
|
-
const
|
|
854
|
-
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: $ } };
|
|
855
1656
|
}
|
|
856
|
-
return { kind: "unknown", span: { start:
|
|
857
|
-
}
|
|
858
|
-
function
|
|
859
|
-
const
|
|
860
|
-
if (
|
|
861
|
-
return
|
|
862
|
-
const
|
|
863
|
-
(
|
|
1657
|
+
return { kind: "unknown", span: { start: m, end: $ } };
|
|
1658
|
+
}
|
|
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);
|
|
864
1665
|
const $ = {
|
|
865
|
-
selectors:
|
|
866
|
-
declarations:
|
|
867
|
-
span: { start:
|
|
868
|
-
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,
|
|
869
1670
|
selectorDirty: !1,
|
|
870
1671
|
declarationsDirty: !1
|
|
871
1672
|
};
|
|
872
|
-
return o =
|
|
1673
|
+
return o = g, { kind: "rule", rule: $ };
|
|
873
1674
|
}
|
|
874
|
-
for (;
|
|
875
|
-
|
|
876
|
-
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 };
|
|
877
1678
|
}
|
|
878
|
-
function
|
|
1679
|
+
function fn(e, n, t) {
|
|
879
1680
|
switch (e.kind) {
|
|
880
1681
|
case "universal":
|
|
881
1682
|
return !0;
|
|
@@ -891,60 +1692,60 @@ function ht(e, n, t) {
|
|
|
891
1692
|
return !1;
|
|
892
1693
|
}
|
|
893
1694
|
}
|
|
894
|
-
function
|
|
895
|
-
return e.simple.every((
|
|
1695
|
+
function pn(e, n, t) {
|
|
1696
|
+
return e.simple.every((s) => fn(s, n, t));
|
|
896
1697
|
}
|
|
897
|
-
function
|
|
898
|
-
if (!
|
|
1698
|
+
function he(e, n, t, s) {
|
|
1699
|
+
if (!pn(e[n], t, s)) return !1;
|
|
899
1700
|
if (n === 0) return !0;
|
|
900
|
-
const
|
|
1701
|
+
const r = s.parentOf(t);
|
|
901
1702
|
if (e[n].combinator === "child")
|
|
902
|
-
return
|
|
903
|
-
for (let o =
|
|
904
|
-
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;
|
|
905
1706
|
return !1;
|
|
906
1707
|
}
|
|
907
|
-
function
|
|
908
|
-
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);
|
|
909
1710
|
}
|
|
910
|
-
function
|
|
1711
|
+
function hn(e) {
|
|
911
1712
|
const n = [];
|
|
912
1713
|
for (const t of e.parts)
|
|
913
|
-
for (const
|
|
914
|
-
|
|
1714
|
+
for (const s of t.simple)
|
|
1715
|
+
s.kind === "pseudo" && s.name !== "root" && !n.includes(s.name) && n.push(s.name);
|
|
915
1716
|
return n;
|
|
916
1717
|
}
|
|
917
|
-
function
|
|
1718
|
+
function mn(e) {
|
|
918
1719
|
const n = [];
|
|
919
1720
|
for (const t of e)
|
|
920
|
-
for (const
|
|
921
|
-
for (const
|
|
922
|
-
if (
|
|
923
|
-
const o =
|
|
1721
|
+
for (const s of t.parts)
|
|
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}`;
|
|
924
1725
|
n.includes(o) || n.push(o);
|
|
925
1726
|
}
|
|
926
1727
|
return n;
|
|
927
1728
|
}
|
|
928
|
-
function
|
|
1729
|
+
function et(e) {
|
|
929
1730
|
for (const n of e)
|
|
930
1731
|
for (const t of n.parts)
|
|
931
|
-
for (const
|
|
932
|
-
if (
|
|
1732
|
+
for (const s of t.simple)
|
|
1733
|
+
if (s.kind === "unknown") return s.text;
|
|
933
1734
|
return null;
|
|
934
1735
|
}
|
|
935
|
-
function
|
|
1736
|
+
function gn(e) {
|
|
936
1737
|
const n = /* @__PURE__ */ new Map([[e, null]]), t = [e];
|
|
937
1738
|
for (; t.length > 0; ) {
|
|
938
|
-
const
|
|
939
|
-
for (const
|
|
940
|
-
n.set(
|
|
1739
|
+
const s = t.pop();
|
|
1740
|
+
for (const r of s.children)
|
|
1741
|
+
n.set(r, s), t.push(r);
|
|
941
1742
|
}
|
|
942
1743
|
return n;
|
|
943
1744
|
}
|
|
944
|
-
function
|
|
945
|
-
let n = 0, t = 0,
|
|
946
|
-
for (const
|
|
947
|
-
for (const o of
|
|
1745
|
+
function yn(e) {
|
|
1746
|
+
let n = 0, t = 0, s = 0;
|
|
1747
|
+
for (const r of e.parts)
|
|
1748
|
+
for (const o of r.simple)
|
|
948
1749
|
switch (o.kind) {
|
|
949
1750
|
case "name":
|
|
950
1751
|
n++;
|
|
@@ -954,88 +1755,100 @@ function xt(e) {
|
|
|
954
1755
|
t++;
|
|
955
1756
|
break;
|
|
956
1757
|
case "type":
|
|
957
|
-
|
|
1758
|
+
s++;
|
|
958
1759
|
break;
|
|
959
1760
|
}
|
|
960
|
-
return [n, t,
|
|
1761
|
+
return [n, t, s];
|
|
961
1762
|
}
|
|
962
|
-
function
|
|
1763
|
+
function tt(e, n) {
|
|
963
1764
|
return e[0] - n[0] || e[1] - n[1] || e[2] - n[2];
|
|
964
1765
|
}
|
|
965
|
-
const
|
|
1766
|
+
const bn = [Number.MAX_SAFE_INTEGER, 0, 0], vn = ve(Je, null, -1).sheet.items.flatMap(
|
|
966
1767
|
(e, n) => e.kind === "rule" ? [{ rule: e.rule, sheet: -1, item: n, builtin: !0 }] : []
|
|
967
1768
|
);
|
|
968
|
-
function
|
|
969
|
-
return
|
|
970
|
-
}
|
|
971
|
-
function
|
|
972
|
-
const
|
|
973
|
-
for (const [
|
|
974
|
-
const u =
|
|
975
|
-
if (u === void 0 ||
|
|
976
|
-
|
|
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) {
|
|
1777
|
+
s.push({
|
|
977
1778
|
kind: "unsupported-selector",
|
|
978
|
-
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 }
|
|
979
1782
|
});
|
|
980
1783
|
continue;
|
|
981
1784
|
}
|
|
982
|
-
|
|
983
|
-
}
|
|
984
|
-
const
|
|
985
|
-
const u =
|
|
986
|
-
u &&
|
|
987
|
-
for (const
|
|
988
|
-
if (
|
|
989
|
-
for (const
|
|
990
|
-
|
|
991
|
-
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);
|
|
992
1795
|
};
|
|
993
|
-
return
|
|
1796
|
+
return h(e.root, !1), a;
|
|
994
1797
|
}
|
|
995
|
-
function
|
|
1798
|
+
function kn(e) {
|
|
996
1799
|
const n = [], t = /* @__PURE__ */ new Map();
|
|
997
|
-
e.sheets.forEach((
|
|
998
|
-
|
|
999
|
-
}), n.push(...
|
|
1000
|
-
const
|
|
1001
|
-
const
|
|
1002
|
-
if (
|
|
1003
|
-
|
|
1004
|
-
const
|
|
1005
|
-
|
|
1006
|
-
if (
|
|
1007
|
-
n.push({ rule:
|
|
1008
|
-
else if (
|
|
1009
|
-
const u =
|
|
1010
|
-
u !== void 0 &&
|
|
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);
|
|
1011
1814
|
}
|
|
1012
1815
|
});
|
|
1013
1816
|
}, o = e.styleRoots ?? (e.sheets.length === 0 ? [] : [{ sheet: 0, scope: e.root.id }]);
|
|
1014
|
-
for (const
|
|
1817
|
+
for (const d of o) r(d.sheet, d.scope);
|
|
1015
1818
|
return n;
|
|
1016
1819
|
}
|
|
1017
|
-
function
|
|
1018
|
-
let
|
|
1019
|
-
for (;
|
|
1020
|
-
if (
|
|
1021
|
-
|
|
1820
|
+
function Sn(e, n, t) {
|
|
1821
|
+
let s = e;
|
|
1822
|
+
for (; s !== null; ) {
|
|
1823
|
+
if (s.kind === "element" && s.node.id === n) return !0;
|
|
1824
|
+
s = t.parentOf(s);
|
|
1022
1825
|
}
|
|
1023
1826
|
return !1;
|
|
1024
1827
|
}
|
|
1025
|
-
function
|
|
1828
|
+
function $n(e) {
|
|
1026
1829
|
return e.selectors.some(
|
|
1027
|
-
(n) => n.parts.some((t) => t.simple.some((
|
|
1830
|
+
(n) => n.parts.some((t) => t.simple.some((s) => s.kind === "pseudo" && s.name === "root"))
|
|
1028
1831
|
);
|
|
1029
1832
|
}
|
|
1030
|
-
function
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
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) {
|
|
1839
|
+
var s;
|
|
1840
|
+
const t = (s = e.sheets[n]) == null ? void 0 : s.origin;
|
|
1841
|
+
return typeof t == "string" ? { sourceDocument: t } : {};
|
|
1842
|
+
}
|
|
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 = {
|
|
1039
1852
|
/**
|
|
1040
1853
|
* The rule the measurement forced.
|
|
1041
1854
|
*
|
|
@@ -1046,225 +1859,347 @@ function Ee(e, n) {
|
|
|
1046
1859
|
* owner. That is the hierarchy the dumps show, so descendant selectors like
|
|
1047
1860
|
* `.panel #unity-content-viewport` behave as they do in Unity.
|
|
1048
1861
|
*/
|
|
1049
|
-
parentOf: (
|
|
1050
|
-
if (
|
|
1051
|
-
const
|
|
1052
|
-
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 };
|
|
1053
1866
|
}
|
|
1054
|
-
if (
|
|
1055
|
-
const
|
|
1056
|
-
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 };
|
|
1057
1870
|
},
|
|
1058
|
-
isRoot: (
|
|
1871
|
+
isRoot: (i) => i.kind === "element" && i.node === e.root,
|
|
1059
1872
|
// Unity's parts are VisualElements, so a `VisualElement` rule reaches them.
|
|
1060
1873
|
// Not measured — `part-type-selector` is the case that will settle it.
|
|
1061
|
-
typeNameOf: (
|
|
1062
|
-
idOf: (
|
|
1874
|
+
typeNameOf: (i) => i.kind === "element" ? i.node.name.local : "VisualElement",
|
|
1875
|
+
idOf: (i) => i.kind === "element" ? d(i.node, "name") : i.name,
|
|
1063
1876
|
// Implicit classes are as real as written ones for matching: in Unity the
|
|
1064
1877
|
// element genuinely carries them, which is why `.unity-button` in author USS
|
|
1065
1878
|
// hits a plain `<ui:Button />`. Parts carry classes too in Unity, but which
|
|
1066
1879
|
// ones is unmeasured, so none are claimed here.
|
|
1067
|
-
classesOf: (
|
|
1068
|
-
},
|
|
1069
|
-
...
|
|
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,
|
|
1070
1883
|
// A part inherits its owner's states: `SetEnabled(false)` disables the whole
|
|
1071
1884
|
// subtree, and a part is inside it.
|
|
1072
|
-
statesOf: (
|
|
1073
|
-
},
|
|
1885
|
+
statesOf: (i) => h.get(i.kind === "element" ? i.node : i.owner) ?? r
|
|
1886
|
+
}, c = [];
|
|
1074
1887
|
let u = !1;
|
|
1075
|
-
for (const
|
|
1076
|
-
if (
|
|
1077
|
-
|
|
1888
|
+
for (const i of kn(e)) {
|
|
1889
|
+
if (i.builtin === !0) {
|
|
1890
|
+
c.push(i);
|
|
1078
1891
|
continue;
|
|
1079
1892
|
}
|
|
1080
|
-
const
|
|
1081
|
-
if (
|
|
1082
|
-
|
|
1893
|
+
const y = et(i.rule.selectors);
|
|
1894
|
+
if (y !== null) {
|
|
1895
|
+
s.push({
|
|
1083
1896
|
kind: "unsupported-selector",
|
|
1084
|
-
message: `"${
|
|
1085
|
-
at: { in: "uss", sheet:
|
|
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)
|
|
1086
1902
|
});
|
|
1087
1903
|
continue;
|
|
1088
1904
|
}
|
|
1089
|
-
!u &&
|
|
1905
|
+
!u && $n(i.rule) && (u = !0, s.push({
|
|
1090
1906
|
kind: "version-dependent",
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
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
|
+
}
|
|
1094
1946
|
}
|
|
1095
|
-
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 };
|
|
1096
1962
|
}
|
|
1097
|
-
function
|
|
1098
|
-
const t = n.attributes.find((
|
|
1963
|
+
function we(e, n) {
|
|
1964
|
+
const t = n.attributes.find((r) => r.name === "style");
|
|
1099
1965
|
if (t === void 0) return [];
|
|
1100
|
-
const
|
|
1101
|
-
return
|
|
1966
|
+
const s = dn(t);
|
|
1967
|
+
return s === null ? [] : Ke(e.source, s, s + t.value.length);
|
|
1102
1968
|
}
|
|
1103
|
-
function
|
|
1104
|
-
|
|
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 = [];
|
|
1105
1994
|
let o = 0;
|
|
1106
|
-
const
|
|
1107
|
-
|
|
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 });
|
|
1108
1997
|
};
|
|
1109
1998
|
if (n.kind === "part") {
|
|
1110
|
-
const
|
|
1111
|
-
for (const [
|
|
1112
|
-
for (const [
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
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,
|
|
1116
2005
|
{
|
|
1117
2006
|
kind: "builtin-theme",
|
|
1118
2007
|
selector: `#${n.name}`,
|
|
1119
|
-
property:
|
|
1120
|
-
unityVersion:
|
|
2008
|
+
property: l,
|
|
2009
|
+
unityVersion: te
|
|
1121
2010
|
},
|
|
1122
2011
|
0,
|
|
1123
2012
|
[0, 0, 0]
|
|
1124
2013
|
);
|
|
1125
2014
|
}
|
|
1126
|
-
for (const
|
|
1127
|
-
if (
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
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 : {
|
|
2018
|
+
...t.ctx,
|
|
2019
|
+
// Unity USS :root names the element this particular stylesheet is
|
|
2020
|
+
// attached to. Template sheets are attached to each generated
|
|
2021
|
+
// TemplateContainer, not to the entry document root.
|
|
2022
|
+
isRoot: (c) => c.kind === "element" && c.node.id === a.scope
|
|
2023
|
+
};
|
|
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));
|
|
1133
2029
|
}
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
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 ? {
|
|
1137
2034
|
kind: "builtin-theme",
|
|
1138
|
-
selector:
|
|
1139
|
-
property:
|
|
1140
|
-
unityVersion:
|
|
2035
|
+
selector: wn(a.rule),
|
|
2036
|
+
property: k,
|
|
2037
|
+
unityVersion: te
|
|
1141
2038
|
} : {
|
|
1142
2039
|
kind: "rule",
|
|
1143
|
-
sheet:
|
|
1144
|
-
item:
|
|
1145
|
-
declIndex:
|
|
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 },
|
|
1146
2045
|
// Omitted rather than set to [] when unconditional, so the
|
|
1147
2046
|
// common case stays the shape it has always been.
|
|
1148
|
-
...
|
|
2047
|
+
...l.length > 0 ? { states: l } : {}
|
|
1149
2048
|
};
|
|
1150
|
-
|
|
2049
|
+
d(k, f, m, a.builtin === !0 ? 0 : 1, h);
|
|
1151
2050
|
}
|
|
1152
2051
|
}));
|
|
1153
2052
|
}
|
|
1154
2053
|
if (n.kind === "element") {
|
|
1155
|
-
const
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
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,
|
|
2061
|
+
{
|
|
2062
|
+
kind: "inline",
|
|
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 }
|
|
2067
|
+
},
|
|
2068
|
+
1,
|
|
2069
|
+
bn
|
|
2070
|
+
);
|
|
1159
2071
|
});
|
|
1160
2072
|
}
|
|
1161
|
-
return
|
|
2073
|
+
return r;
|
|
1162
2074
|
}
|
|
1163
|
-
function
|
|
2075
|
+
function ot(e) {
|
|
1164
2076
|
const n = /* @__PURE__ */ new Map();
|
|
1165
2077
|
for (const t of e) {
|
|
1166
|
-
const
|
|
1167
|
-
if (
|
|
2078
|
+
const s = n.get(t.property);
|
|
2079
|
+
if (s === void 0) {
|
|
1168
2080
|
n.set(t.property, t);
|
|
1169
2081
|
continue;
|
|
1170
2082
|
}
|
|
1171
|
-
if (t.rank !==
|
|
1172
|
-
t.rank >
|
|
2083
|
+
if (t.rank !== s.rank) {
|
|
2084
|
+
t.rank > s.rank && n.set(t.property, t);
|
|
1173
2085
|
continue;
|
|
1174
2086
|
}
|
|
1175
|
-
const
|
|
1176
|
-
(
|
|
2087
|
+
const r = tt(t.specificity, s.specificity);
|
|
2088
|
+
(r > 0 || r === 0 && t.order > s.order) && n.set(t.property, t);
|
|
1177
2089
|
}
|
|
1178
2090
|
for (const t of n.values()) t.winner = !0;
|
|
1179
2091
|
return n;
|
|
1180
2092
|
}
|
|
1181
|
-
const
|
|
1182
|
-
function
|
|
1183
|
-
var
|
|
1184
|
-
let
|
|
2093
|
+
const In = /var\(\s*(--[^,)\s]+)\s*(?:,([^)]*))?\)/;
|
|
2094
|
+
function me(e, n, t = /* @__PURE__ */ new Set()) {
|
|
2095
|
+
var r;
|
|
2096
|
+
let s = e;
|
|
1185
2097
|
for (let o = 0; o < 32; o++) {
|
|
1186
|
-
const
|
|
1187
|
-
if (
|
|
1188
|
-
const
|
|
1189
|
-
if (t.has(
|
|
1190
|
-
const
|
|
1191
|
-
if (
|
|
1192
|
-
|
|
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);
|
|
1193
2105
|
}
|
|
1194
2106
|
return null;
|
|
1195
2107
|
}
|
|
1196
|
-
function
|
|
1197
|
-
const t =
|
|
2108
|
+
function En(e, n) {
|
|
2109
|
+
const t = nt(e, n), s = [...t.warnings], r = /* @__PURE__ */ new Map();
|
|
1198
2110
|
let o = !1;
|
|
1199
|
-
const
|
|
1200
|
-
const
|
|
1201
|
-
!o &&
|
|
1202
|
-
const
|
|
1203
|
-
for (const [
|
|
1204
|
-
|
|
1205
|
-
for (const [
|
|
1206
|
-
|
|
1207
|
-
const
|
|
1208
|
-
for (const [
|
|
1209
|
-
for (const [
|
|
1210
|
-
const
|
|
1211
|
-
if (
|
|
1212
|
-
|
|
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) {
|
|
2124
|
+
s.push({
|
|
1213
2125
|
kind: "unsupported-property",
|
|
1214
|
-
message: `${
|
|
1215
|
-
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 }
|
|
1216
2130
|
});
|
|
1217
2131
|
continue;
|
|
1218
2132
|
}
|
|
1219
|
-
|
|
2133
|
+
m.set(w, { value: $, origin: g.origin });
|
|
1220
2134
|
}
|
|
1221
|
-
const
|
|
1222
|
-
for (const [
|
|
1223
|
-
|
|
1224
|
-
value:
|
|
1225
|
-
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 }
|
|
1226
2140
|
});
|
|
1227
|
-
return { computed:
|
|
1228
|
-
},
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
const
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
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
|
|
1240
2171
|
);
|
|
1241
|
-
|
|
1242
|
-
}),
|
|
2172
|
+
f.set(m.name, w.computed), y = w.forChildren;
|
|
2173
|
+
}), d.set(u.id, f);
|
|
1243
2174
|
}
|
|
1244
|
-
for (const
|
|
2175
|
+
for (const f of u.children) c(f, y);
|
|
1245
2176
|
};
|
|
1246
|
-
|
|
2177
|
+
c(e.root, /* @__PURE__ */ new Map()), o && s.push({
|
|
1247
2178
|
kind: "version-dependent",
|
|
1248
|
-
message: `
|
|
2179
|
+
message: `Built-in control defaults applied, as measured on Unity ${te}`,
|
|
2180
|
+
reason: "version-dependent"
|
|
1249
2181
|
});
|
|
1250
|
-
for (const
|
|
1251
|
-
if (
|
|
1252
|
-
const
|
|
1253
|
-
|
|
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({
|
|
1254
2186
|
kind: "unsupported-selector",
|
|
1255
|
-
message: `${
|
|
1256
|
-
at: { in: "uss", sheet:
|
|
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)
|
|
1257
2192
|
});
|
|
1258
2193
|
}
|
|
1259
|
-
return { styles:
|
|
2194
|
+
return { styles: r, partStyles: d, warnings: s };
|
|
1260
2195
|
}
|
|
1261
|
-
function
|
|
1262
|
-
const
|
|
1263
|
-
(
|
|
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
|
|
1264
2199
|
);
|
|
1265
|
-
return
|
|
2200
|
+
return ot(o), o;
|
|
1266
2201
|
}
|
|
1267
|
-
const
|
|
2202
|
+
const Un = [
|
|
1268
2203
|
{
|
|
1269
2204
|
id: "text-metrics",
|
|
1270
2205
|
kind: "unreproducible",
|
|
@@ -1284,376 +2219,245 @@ const Wt = [
|
|
|
1284
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."
|
|
1285
2220
|
}
|
|
1286
2221
|
];
|
|
1287
|
-
function
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
return e !== void 0 && /[A-Za-z_]/.test(e);
|
|
1292
|
-
}
|
|
1293
|
-
function Ct(e) {
|
|
1294
|
-
return e === " " || e === " " || e === `
|
|
1295
|
-
` || e === "\r";
|
|
1296
|
-
}
|
|
1297
|
-
function At(e) {
|
|
1298
|
-
const n = [];
|
|
1299
|
-
let t = 0, i = 0;
|
|
1300
|
-
const l = () => i++;
|
|
1301
|
-
function o(a, u, r) {
|
|
1302
|
-
n.push({
|
|
1303
|
-
kind: "malformed",
|
|
1304
|
-
message: a,
|
|
1305
|
-
at: { in: "uxml", span: { start: u, end: r } }
|
|
1306
|
-
});
|
|
1307
|
-
}
|
|
1308
|
-
function p() {
|
|
1309
|
-
for (; Ct(e[t]); ) t++;
|
|
1310
|
-
}
|
|
1311
|
-
function g() {
|
|
1312
|
-
for (; ; ) {
|
|
1313
|
-
const a = e.indexOf("<", t);
|
|
1314
|
-
if (a < 0) {
|
|
1315
|
-
t = e.length;
|
|
1316
|
-
return;
|
|
1317
|
-
}
|
|
1318
|
-
const u = e[a + 1];
|
|
1319
|
-
if (u === "!") {
|
|
1320
|
-
if (e.startsWith("<!--", a)) {
|
|
1321
|
-
const r = e.indexOf("-->", a + 4);
|
|
1322
|
-
t = r < 0 ? e.length : r + 3;
|
|
1323
|
-
} else if (e.startsWith("<![CDATA[", a)) {
|
|
1324
|
-
const r = e.indexOf("]]>", a + 9);
|
|
1325
|
-
t = r < 0 ? e.length : r + 3;
|
|
1326
|
-
} else {
|
|
1327
|
-
const r = e.indexOf(">", a);
|
|
1328
|
-
t = r < 0 ? e.length : r + 1;
|
|
1329
|
-
}
|
|
1330
|
-
continue;
|
|
1331
|
-
}
|
|
1332
|
-
if (u === "?") {
|
|
1333
|
-
const r = e.indexOf("?>", a + 2);
|
|
1334
|
-
t = r < 0 ? e.length : r + 2;
|
|
1335
|
-
continue;
|
|
1336
|
-
}
|
|
1337
|
-
t = a;
|
|
1338
|
-
return;
|
|
1339
|
-
}
|
|
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);
|
|
1340
2226
|
}
|
|
1341
|
-
function
|
|
1342
|
-
|
|
1343
|
-
for (; be(e[t]); ) t++;
|
|
1344
|
-
const u = e.slice(a, t), r = u.indexOf(":");
|
|
1345
|
-
return r < 0 ? { prefix: null, local: u } : { prefix: u.slice(0, r), local: u.slice(r + 1) };
|
|
2227
|
+
function r(h) {
|
|
2228
|
+
return h.includes('"') ? h.includes("'") ? `"${h.replace(/"/g, """)}"` : `'${h}'` : `"${h}"`;
|
|
1346
2229
|
}
|
|
1347
|
-
function
|
|
1348
|
-
const
|
|
1349
|
-
|
|
1350
|
-
if (t === a) return null;
|
|
1351
|
-
const u = e.slice(a, t), r = t;
|
|
1352
|
-
if (p(), e[t] !== "=")
|
|
1353
|
-
return t = r, o(`attribute "${u}" has no value`, a, r), { name: u, value: "", span: { start: a, end: r } };
|
|
1354
|
-
t++, p();
|
|
1355
|
-
const f = e[t];
|
|
1356
|
-
if (f !== '"' && f !== "'")
|
|
1357
|
-
return o(`attribute "${u}" has an unquoted value`, a, t), { name: u, value: "", span: { start: a, end: t } };
|
|
1358
|
-
t++;
|
|
1359
|
-
const b = t, c = e.indexOf(f, t);
|
|
1360
|
-
return c < 0 ? (o(`attribute "${u}" has an unterminated value`, a, e.length), t = e.length, { name: u, value: e.slice(b), span: { start: a, end: t } }) : (t = c + 1, { name: u, value: e.slice(b, c), span: { start: a, end: t } });
|
|
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}>`;
|
|
1361
2233
|
}
|
|
1362
|
-
function
|
|
1363
|
-
|
|
1364
|
-
t
|
|
1365
|
-
|
|
1366
|
-
let f = !1;
|
|
1367
|
-
for (; ; ) {
|
|
1368
|
-
p();
|
|
1369
|
-
const y = e[t];
|
|
1370
|
-
if (y === void 0) {
|
|
1371
|
-
o("unterminated open tag", a, e.length);
|
|
1372
|
-
break;
|
|
1373
|
-
}
|
|
1374
|
-
if (y === ">") {
|
|
1375
|
-
t++;
|
|
1376
|
-
break;
|
|
1377
|
-
}
|
|
1378
|
-
if (y === "/" && e[t + 1] === ">") {
|
|
1379
|
-
t += 2, f = !0;
|
|
1380
|
-
break;
|
|
1381
|
-
}
|
|
1382
|
-
const x = d();
|
|
1383
|
-
if (x === null) {
|
|
1384
|
-
t++;
|
|
1385
|
-
continue;
|
|
1386
|
-
}
|
|
1387
|
-
r.push(x);
|
|
1388
|
-
}
|
|
1389
|
-
const b = { start: a, end: t };
|
|
1390
|
-
if (f)
|
|
1391
|
-
return {
|
|
1392
|
-
id: l(),
|
|
1393
|
-
name: u,
|
|
1394
|
-
attributes: r,
|
|
1395
|
-
children: [],
|
|
1396
|
-
spans: { openTag: b, inner: { start: t, end: t }, closeTag: null },
|
|
1397
|
-
tagDirty: !1,
|
|
1398
|
-
childrenDirty: !1
|
|
1399
|
-
};
|
|
1400
|
-
const c = t, S = [];
|
|
1401
|
-
for (; ; ) {
|
|
1402
|
-
if (g(), t >= e.length) {
|
|
1403
|
-
o(`unterminated element <${Ce(u)}>`, a, e.length);
|
|
1404
|
-
break;
|
|
1405
|
-
}
|
|
1406
|
-
const y = e[t + 1];
|
|
1407
|
-
if (y === "/") break;
|
|
1408
|
-
if (!xe(y)) {
|
|
1409
|
-
t++;
|
|
1410
|
-
continue;
|
|
1411
|
-
}
|
|
1412
|
-
S.push(s());
|
|
1413
|
-
}
|
|
1414
|
-
const h = t;
|
|
1415
|
-
let w = null;
|
|
1416
|
-
if (e.startsWith("</", t)) {
|
|
1417
|
-
const y = e.indexOf(">", t), x = y < 0 ? e.length : y + 1;
|
|
1418
|
-
y < 0 && o("unterminated end tag", t, x), w = { start: t, end: x }, t = x;
|
|
1419
|
-
}
|
|
1420
|
-
return {
|
|
1421
|
-
id: l(),
|
|
1422
|
-
name: u,
|
|
1423
|
-
attributes: r,
|
|
1424
|
-
children: S,
|
|
1425
|
-
spans: { openTag: b, inner: { start: c, end: h }, closeTag: w },
|
|
1426
|
-
tagDirty: !1,
|
|
1427
|
-
childrenDirty: !1
|
|
1428
|
-
};
|
|
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 };
|
|
1429
2238
|
}
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
children
|
|
1436
|
-
spans: { openTag: { start: 0, end: 0 }, inner: { start: 0, end: 0 }, closeTag: null },
|
|
1437
|
-
tagDirty: !1,
|
|
1438
|
-
childrenDirty: !1
|
|
1439
|
-
},
|
|
1440
|
-
warnings: n
|
|
1441
|
-
});
|
|
1442
|
-
}
|
|
1443
|
-
function Ce(e) {
|
|
1444
|
-
return e.prefix === null ? e.local : `${e.prefix}:${e.local}`;
|
|
1445
|
-
}
|
|
1446
|
-
function Rt(e, n) {
|
|
1447
|
-
const t = (d) => e.slice(d.start, d.end);
|
|
1448
|
-
function i(d) {
|
|
1449
|
-
return d.spans.closeTag !== null ? d.spans.closeTag.end : Math.max(d.spans.openTag.end, d.spans.inner.end);
|
|
1450
|
-
}
|
|
1451
|
-
function l(d) {
|
|
1452
|
-
return d.includes('"') ? d.includes("'") ? `"${d.replace(/"/g, """)}"` : `'${d}'` : `"${d}"`;
|
|
1453
|
-
}
|
|
1454
|
-
function o(d) {
|
|
1455
|
-
const s = d.attributes.map((u) => ` ${u.name}=${l(u.value)}`).join(""), a = Ce(d.name);
|
|
1456
|
-
return d.spans.closeTag === null ? `<${a}${s} />` : `<${a}${s}>`;
|
|
1457
|
-
}
|
|
1458
|
-
function p(d) {
|
|
1459
|
-
var r, f;
|
|
1460
|
-
const s = t(d.spans.inner), a = ((r = /^[ \t]*\r?\n[ \t]*/.exec(s)) == null ? void 0 : r[0]) ?? "", u = ((f = /\r?\n[ \t]*$/.exec(s)) == null ? void 0 : f[0]) ?? "";
|
|
1461
|
-
return { between: a, before: a, after: u };
|
|
1462
|
-
}
|
|
1463
|
-
function g(d) {
|
|
1464
|
-
const { inner: s } = d.spans;
|
|
1465
|
-
if (d.children.length === 0) return t(s);
|
|
1466
|
-
if (d.childrenDirty) {
|
|
1467
|
-
const { between: r, before: f, after: b } = p(d);
|
|
1468
|
-
return f + d.children.map(v).join(r) + b;
|
|
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;
|
|
1469
2245
|
}
|
|
1470
|
-
let
|
|
1471
|
-
for (const
|
|
1472
|
-
|
|
1473
|
-
return
|
|
1474
|
-
}
|
|
1475
|
-
function
|
|
1476
|
-
const
|
|
1477
|
-
return
|
|
1478
|
-
}
|
|
1479
|
-
return e.slice(0, n.spans.openTag.start) +
|
|
1480
|
-
}
|
|
1481
|
-
function
|
|
1482
|
-
const n = e.source, t = (
|
|
1483
|
-
function
|
|
1484
|
-
return
|
|
1485
|
-
const
|
|
1486
|
-
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) {
|
|
1487
2263
|
case "universal":
|
|
1488
2264
|
return "*";
|
|
1489
2265
|
case "type":
|
|
1490
|
-
return
|
|
2266
|
+
return y.name;
|
|
1491
2267
|
case "class":
|
|
1492
|
-
return `.${
|
|
2268
|
+
return `.${y.name}`;
|
|
1493
2269
|
case "name":
|
|
1494
|
-
return `#${
|
|
2270
|
+
return `#${y.name}`;
|
|
1495
2271
|
case "pseudo":
|
|
1496
|
-
return `:${
|
|
2272
|
+
return `:${y.name}`;
|
|
1497
2273
|
case "unknown":
|
|
1498
|
-
return
|
|
2274
|
+
return y.text;
|
|
1499
2275
|
}
|
|
1500
2276
|
}).join("");
|
|
1501
|
-
return
|
|
2277
|
+
return p + i;
|
|
1502
2278
|
}).join("");
|
|
1503
2279
|
}
|
|
1504
|
-
function l
|
|
1505
|
-
var
|
|
1506
|
-
const
|
|
1507
|
-
if (
|
|
2280
|
+
function r(l) {
|
|
2281
|
+
var k, f;
|
|
2282
|
+
const c = l.declarations[0];
|
|
2283
|
+
if (c === void 0) return { between: "", before: "", after: "" };
|
|
1508
2284
|
const u = n.lastIndexOf(`
|
|
1509
|
-
`,
|
|
1510
|
-
return { between: `;${
|
|
1511
|
-
}
|
|
1512
|
-
function o(
|
|
1513
|
-
const
|
|
1514
|
-
if (
|
|
1515
|
-
return
|
|
1516
|
-
const u = n.slice(
|
|
1517
|
-
if (
|
|
1518
|
-
const { between:
|
|
1519
|
-
return `${
|
|
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}}`;
|
|
1520
2296
|
}
|
|
1521
|
-
let
|
|
1522
|
-
for (const
|
|
1523
|
-
|
|
1524
|
-
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);
|
|
1525
2301
|
}
|
|
1526
|
-
function
|
|
1527
|
-
return
|
|
2302
|
+
function d(l) {
|
|
2303
|
+
return l.dirty ? `${l.property}: ${l.value}` : t(l.span);
|
|
1528
2304
|
}
|
|
1529
|
-
function
|
|
1530
|
-
return
|
|
2305
|
+
function a(l) {
|
|
2306
|
+
return l.kind === "rule" ? o(l.rule) : t(l.span);
|
|
1531
2307
|
}
|
|
1532
|
-
let
|
|
1533
|
-
for (const
|
|
1534
|
-
const
|
|
1535
|
-
|
|
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;
|
|
1536
2312
|
}
|
|
1537
|
-
return
|
|
2313
|
+
return x + n.slice(h);
|
|
1538
2314
|
}
|
|
1539
|
-
|
|
2315
|
+
gt(
|
|
2316
|
+
(e, n) => n === void 0 ? Ne(e) : Ne(e, void 0, { resolveImport: n })
|
|
2317
|
+
);
|
|
2318
|
+
function rt(e, n = []) {
|
|
1540
2319
|
var t;
|
|
1541
|
-
for (const
|
|
1542
|
-
if (
|
|
1543
|
-
const
|
|
1544
|
-
|
|
2320
|
+
for (const s of e.children) {
|
|
2321
|
+
if (s.name.local === "Style") {
|
|
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 });
|
|
1545
2324
|
}
|
|
1546
|
-
|
|
2325
|
+
rt(s, n);
|
|
1547
2326
|
}
|
|
1548
2327
|
return n;
|
|
1549
2328
|
}
|
|
1550
|
-
function
|
|
2329
|
+
function Mn(e) {
|
|
1551
2330
|
return e.startsWith("project://") || e.startsWith("/");
|
|
1552
2331
|
}
|
|
1553
|
-
function
|
|
1554
|
-
var
|
|
1555
|
-
const
|
|
1556
|
-
for (const { url:
|
|
1557
|
-
const
|
|
1558
|
-
if (
|
|
1559
|
-
|
|
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({
|
|
1560
2339
|
kind: "import-unresolved",
|
|
1561
|
-
message: (t == null ? void 0 : t.resolveImport) === void 0 ? `<Style src="${
|
|
1562
|
-
node:
|
|
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 }
|
|
1563
2343
|
});
|
|
1564
2344
|
continue;
|
|
1565
2345
|
}
|
|
1566
|
-
|
|
1567
|
-
}
|
|
1568
|
-
if (n !== void 0 ||
|
|
1569
|
-
const
|
|
1570
|
-
let
|
|
1571
|
-
for (const
|
|
1572
|
-
const
|
|
1573
|
-
|
|
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 });
|
|
1574
2354
|
}
|
|
1575
2355
|
if (n !== void 0) {
|
|
1576
|
-
const
|
|
1577
|
-
|
|
2356
|
+
const i = p++;
|
|
2357
|
+
u.push({ text: n, origin: null, sheet: i }), d.push({ sheet: i, scope: s.root.id });
|
|
1578
2358
|
}
|
|
1579
|
-
for (;
|
|
1580
|
-
const
|
|
1581
|
-
o.push(
|
|
1582
|
-
for (const
|
|
1583
|
-
if (
|
|
1584
|
-
const
|
|
1585
|
-
if (
|
|
1586
|
-
const
|
|
1587
|
-
|
|
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);
|
|
1588
2368
|
continue;
|
|
1589
2369
|
}
|
|
1590
|
-
|
|
1591
|
-
const
|
|
1592
|
-
if (
|
|
1593
|
-
|
|
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({
|
|
1594
2374
|
kind: "import-unresolved",
|
|
1595
|
-
message: (t == null ? void 0 : t.resolveImport) === void 0 ? `@import "${
|
|
1596
|
-
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 }
|
|
1597
2378
|
});
|
|
1598
2379
|
continue;
|
|
1599
2380
|
}
|
|
1600
|
-
const w =
|
|
1601
|
-
|
|
2381
|
+
const w = p++;
|
|
2382
|
+
c.set(m, w), f.resolvedSheet = w, u.push({ text: v, origin: f.url, sheet: w });
|
|
1602
2383
|
}
|
|
1603
2384
|
}
|
|
1604
2385
|
}
|
|
1605
|
-
|
|
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;
|
|
1606
2388
|
}
|
|
1607
|
-
function
|
|
2389
|
+
function _n(e) {
|
|
1608
2390
|
const n = e.sheets[0];
|
|
1609
2391
|
return {
|
|
1610
|
-
uxml:
|
|
2392
|
+
uxml: On(e.source, e.root),
|
|
1611
2393
|
// Only the sheet passed to `parse` round-trips. `@import`ed sheets (Phase 3)
|
|
1612
2394
|
// are separate files and are not this function's to write.
|
|
1613
|
-
uss: n === void 0 ? "" :
|
|
2395
|
+
uss: n === void 0 ? "" : Dn(n)
|
|
1614
2396
|
};
|
|
1615
2397
|
}
|
|
1616
|
-
function
|
|
1617
|
-
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) ?? {
|
|
1618
2408
|
width: n.clientWidth,
|
|
1619
2409
|
height: n.clientHeight
|
|
1620
|
-
}, o =
|
|
2410
|
+
}, o = Dt(e), d = o.document, a = En(d, {
|
|
1621
2411
|
...(t == null ? void 0 : t.activeStates) === void 0 ? {} : { activeStates: t.activeStates },
|
|
1622
2412
|
...(t == null ? void 0 : t.states) === void 0 ? {} : { states: t.states }
|
|
1623
|
-
}),
|
|
1624
|
-
|
|
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
|
|
2417
|
+
});
|
|
2418
|
+
let c;
|
|
1625
2419
|
try {
|
|
1626
|
-
|
|
1627
|
-
document:
|
|
1628
|
-
resolveAsset: t == null ? void 0 : t.resolveAsset
|
|
2420
|
+
c = un(d.root, l.boxes, l.parts, a.styles, n, {
|
|
2421
|
+
document: s,
|
|
2422
|
+
resolveAsset: t == null ? void 0 : t.resolveAsset,
|
|
2423
|
+
locate: h
|
|
1629
2424
|
});
|
|
1630
|
-
} catch (
|
|
1631
|
-
throw
|
|
2425
|
+
} catch (p) {
|
|
2426
|
+
throw l.dispose(), p;
|
|
1632
2427
|
}
|
|
1633
|
-
let
|
|
2428
|
+
let u = !1;
|
|
1634
2429
|
return {
|
|
1635
|
-
warnings: [
|
|
1636
|
-
|
|
1637
|
-
|
|
2430
|
+
warnings: Rn([
|
|
2431
|
+
...o.warnings,
|
|
2432
|
+
...a.warnings,
|
|
2433
|
+
...l.warnings,
|
|
2434
|
+
...c.warnings
|
|
2435
|
+
]),
|
|
2436
|
+
elements: c.elements,
|
|
2437
|
+
boxes: l.boxes,
|
|
1638
2438
|
dispose() {
|
|
1639
|
-
|
|
2439
|
+
u || (u = !0, l.dispose(), n.replaceChildren());
|
|
1640
2440
|
}
|
|
1641
2441
|
};
|
|
1642
2442
|
}
|
|
1643
2443
|
export {
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
Bt as
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
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
|
|
1659
2463
|
};
|