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