uxml-preview 0.4.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,176 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.5.1 — 2026-10-13
4
+
5
+ A cleanup release: nothing drawn changes except where a Unity dump said it was
6
+ wrong, and things that used to be dropped without a word are now said.
7
+
8
+ ### Behavior changes
9
+
10
+ - **More warnings.** Raised where there used to be silence: undocumented property
11
+ names, documented properties this preview does not draw, state pseudo-classes
12
+ Unity's pseudo-class page does not list (`:selected`, `:first-child`, made-up names), `@media` and
13
+ `@keyframes` blocks, and `display` values other than `flex`/`none`. A screen
14
+ that passed silently in 0.5.0 may now list warnings; it is drawn the same.
15
+ - **`reason` and `subject` on `Warning`.** Both optional, both **open sets** —
16
+ give unknown values a `default` branch. `WarningKind` does not grow and no
17
+ field was removed. See "For consumers" below.
18
+ - **`engines.node` is `>=22`** (was `>=18`). CI and Pages already ran on 22.
19
+ - A `background-image` that is not an asset reference (`linear-gradient()`)
20
+ is `unsupported-property` with `reason: 'not-uss'`, no longer
21
+ `asset-unresolved`, so a host stops looking for a file that cannot exist.
22
+ - Warning text says what the renderer did; facts about Unity moved to
23
+ `reason`/`subject`. No message points at a source file any more.
24
+ `:root` keeps `kind: 'version-dependent'` but has `reason: 'matches-unity'`.
25
+
26
+ - **Every USS property now has one handling path.** Whether a property exists,
27
+ inherits and is drawn is read from a registry transcribed from Unity's USS
28
+ property reference (95/99/102 rows for 6000.0/6.3/6.6, checked 2026-10-13).
29
+ New `unsupported-property` warnings where there used to be silence:
30
+ - 24 documented properties this preview does not draw (`text-shadow`,
31
+ `transition*`, `-unity-text-outline*`, `-unity-font`, `all`, ...) —
32
+ `reason: 'not-rendered'`; properties newer than 6000.0 say so
33
+ (`filter (Unity 6.3+)`).
34
+ - any name Unity does not document (`font-family`, `colour`, `transform`,
35
+ `-unity-foo`, ...) — `reason: 'not-uss'`, with the USS properties to
36
+ write instead in `subject.replacements` for eleven common CSS names.
37
+ - **Corrected warnings.** `filter`/`backdrop-filter` are USS since 6.3/6.6
38
+ and are reported as not drawn rather than as non-USS. `gap`, `row-gap`,
39
+ `column-gap`, `overflow-wrap` and `word-break` are in no Unity USS reference
40
+ table up to 6.6 and are reported as not USS rather than version-dependent.
41
+ The reference version is Unity 6.3 LTS; Unity 6.7 (beta) adds some of these
42
+ and is not supported in this release.
43
+ `background-size`/`-position`/`-repeat` are in 6000.0 and no longer warn.
44
+ `aspect-ratio` is reported as a 6.3+ property this preview does not lay out.
45
+ - **`<Bindings>` and `<ui:Columns>` are no longer laid out.** The only
46
+ change in this release that moves anything drawn, and it moves it to where
47
+ Unity puts it: dumps on 6000.0.40f1 and 6000.3.25f1 show neither element in
48
+ the visual hierarchy, while the preview drew each as a zero-height box that
49
+ shifted `space-between`/`space-around` siblings. Their two
50
+ `unsupported-control` warnings are replaced by one notice per document
51
+ that data bindings are not evaluated (`reason: 'not-rendered'`). A
52
+ `<ui:Column>`'s name still counts toward `duplicate-name-in-tree`, because
53
+ Unity gives it to the header column it builds.
54
+ - **One warning per declaration.** Property warnings are raised once where
55
+ the declaration is written, with `at` — including in rules that match
56
+ nothing — instead of once per element the value reached. An inherited
57
+ value is never reported again on descendants. Value-level warnings
58
+ (`width: 2em`, an unresolved image) also collapse to one per declaration.
59
+ A consumer counting occurrences will count fewer.
60
+ - Inheritance now follows Unity's USS reference table. Five properties that
61
+ Unity marks inherited and this package did not now inherit:
62
+ `text-shadow`, `-unity-editor-text-rendering-mode`, `-unity-text-generator`,
63
+ `-unity-material` (6.3+) and `-unity-text-auto-size` (6.3+).
64
+ `isInherited()` returns `true` for them, and `resolveStyles()` hands them to
65
+ descendants with an `inherited` origin. Nothing drawn changes: none of the
66
+ five is drawn by this preview.
67
+
68
+ ### Added
69
+
70
+ - `WarningReason`, `WarningSubject` types.
71
+ - `USS_STATES` (and `UssState`): the seven states Unity sets, from Unity's
72
+ pseudo-class page — without `:root` and `:selected`.
73
+ - `TEMPLATE_DEPTH_LIMIT` (32): how deep template expansion goes, for hosts
74
+ that prefetch template files.
75
+
76
+ ### For consumers
77
+
78
+ - **Read `subject`, not the message.** The failed URL is `subject.url`, the
79
+ asset path `subject.path` (with `form`), a refused states key `subject.key`,
80
+ a property `subject.property`/`value`. Seven message texts consumers match
81
+ on today are kept byte for byte in this release, but are not an API.
82
+ - **Use `reason` to separate the author's mistakes from the tool's limits.**
83
+ `not-uss` and `invalid-value` are the author's; `not-rendered` is this
84
+ preview's; `version-dependent` needs checking; `matches-unity` is not a
85
+ defect. Failing a screen on every `unsupported-property` would now fail
86
+ valid USS this preview merely does not draw.
87
+ - **A `not-rendered` warning with `subject.affectsLayout: true` means this
88
+ preview's coordinates may differ from Unity's.** In that case, do not treat
89
+ a coordinate-based finding (zero size, overflow) as settled. `affectsLayout`
90
+ comes from a new registry column judging what each property can do in Unity
91
+ (box or pixels), kept apart from what this preview does with it.
92
+ `subject.applied: 'paint'` marks a property drawn here but not laid out as
93
+ Unity would (`letter-spacing`, `word-spacing`: drawn, left out of text
94
+ measurement), which now raises a `not-rendered` warning of its own.
95
+ - Replace copied constants with `USS_STATES` and `TEMPLATE_DEPTH_LIMIT`.
96
+
97
+ ### Deferred to 0.6.0
98
+
99
+ `:enabled` applied automatically, `states` key warnings, the unused
100
+ `unsupported-unit` kind, and value-level checks (`hsl()`, `cubic-bezier()`,
101
+ `space-evenly`, `linear-gradient()` per Unity version, USS-only `cursor`
102
+ values). Listed in `docs/backlog.md`.
103
+
104
+ ## 0.5.0 — 2026-08-26
105
+
106
+ ### Known limitations
107
+
108
+ - Slots are deliberately unsupported this release. **Slots — measured alive in
109
+ 6000.0.40f1. Out of this release scope and reported with
110
+ `template-slot-unsupported`.** Slot children are not placed in an arbitrary
111
+ location.
112
+ - A `style` AttributeOverride is reported as `override-style-ignored` and is not
113
+ applied, matching Unity's import behavior.
114
+ - Runtime `binding-path`, C# `makeItem`-selected `ListView`/`TreeView` item
115
+ templates, per-instance pseudo-state control, cyclic-graph truncation,
116
+ template editing, automatic extraction, and UI Builder reproduction remain
117
+ outside the viewer-core scope.
118
+ - The external 14-document sample is not broad template validation: only **1
119
+ document uses `<ui:Template>`**. Its former **31 → 0** figure counted
120
+ diagnostic lines — 1 Template declaration + 15 Instances + 15
121
+ AttributeOverrides — not 31 opened subtrees.
122
+ - An embedded package UXML physically present at
123
+ `<projectRoot>/Packages/<name>/` resolves through
124
+ `project://database/Packages/...`, as measured in Unity 6000.0.40f1. The core
125
+ and host still do not search `Library/PackageCache`; a registry-package
126
+ template available only there reports `package-path-not-searched`.
127
+
128
+ ### Added
129
+
130
+ - **Template / Instance expansion.** `<ui:Template>` declarations are resolved
131
+ through the existing `resolveImport(url, from)` host hook, and
132
+ `<ui:Instance>` expands to an opaque `TemplateContainer`. Instance `name`,
133
+ `class`, and inline `style` attach to that container; nested expansion is
134
+ capped at 32 levels.
135
+ - `collectDependencies(source)` returns template `src` URLs in source order so a
136
+ synchronous host can prefetch the transitive input before rendering.
137
+ - `WarningKindMap<T>` is exported so consumers can make their diagnostic
138
+ classifier exhaustive.
139
+ - `AttributeOverrides` reaches every duplicate `element-name` target and reports
140
+ `override-target-missing` with the requested and available names when it finds
141
+ none. A `style` override reports `override-style-ignored` with the target name
142
+ and value; Unity ignores it during import, so it is not applied. Template source
143
+ provenance is kept separate from the derived render tree.
144
+ - The public `WarningKind` union grows from **8 to 17**. Consumers must update
145
+ their warning classifiers. The nine new template diagnostics are:
146
+ `template-src-unresolved`, `template-not-declared`, `template-cycle`,
147
+ `template-depth-exceeded`, `override-target-missing`,
148
+ `duplicate-name-in-tree`, `package-path-not-searched`,
149
+ `template-slot-unsupported`, and `override-style-ignored`.
150
+
151
+ ### Changed
152
+
153
+ - Template stylesheet attachments remain scoped to the generated
154
+ `TemplateContainer` subtree. `Packages/...` is declaring-document-relative;
155
+ an embedded package UXML physically present at
156
+ `<projectRoot>/Packages/<name>/` resolves through the project-root-fixed
157
+ `project://database/Packages/...` form, as measured in Unity 6000.0.40f1.
158
+ `Library/PackageCache` is not searched, so a registry-package template
159
+ available only there reports `package-path-not-searched`.
160
+ - Cyclic templates fail closed with the complete cycle path. The source AST is
161
+ still round-tripped unchanged; expansion exists only in the render tree.
162
+
163
+ ### Verified
164
+
165
+ - Unity 6000.0.40f1 template cohort: **200 / 220 coordinate values**, 55
166
+ elements, and 11 rendered cases with 11/11 rendered baselines. The 20
167
+ mismatches classify as (a) known font/text metrics 20, (b) 1px 0, and (c) new
168
+ cause 0; axes are height 14, width 4, x 1, y 1.
169
+ - G3-11 has no layout baseline because Unity `CloneTree` overflows the stack on
170
+ the cyclic input; the preview reports `template-cycle` and fails closed.
171
+ - This cohort is separate from the v0.4.0 base-control figure of **660 / 676**
172
+ for 169 elements. The figures are not combined.
173
+
3
174
  ## 0.4.0 — 2026-08-12
4
175
 
5
176
  ### Added
package/README.md CHANGED
@@ -25,12 +25,12 @@ stylesheet comes out wrong.</sub>
25
25
  npm install uxml-preview
26
26
  ```
27
27
 
28
- > **v0.2.0 — early release.** Five controls (`VisualElement`, `Label`, `Button`,
28
+ > **v0.5.1.** Five controls (`VisualElement`, `Label`, `Button`,
29
29
  > `Image`, `ScrollView`), everything else drawn as a plain box with a warning,
30
30
  > and a support matrix that says plainly what has not been measured.
31
31
  > Read [what is not verified yet](#what-is-not-verified-yet) before relying on it.
32
32
  >
33
- > **v0.2.0 — 초기 릴리스입니다.** 컨트롤 5종(`VisualElement`, `Label`, `Button`,
33
+ > **v0.5.1.** 컨트롤 5종(`VisualElement`, `Label`, `Button`,
34
34
  > `Image`, `ScrollView`)이고, 나머지는 경고와 함께 일반 박스로 그립니다.
35
35
  > 검증되지 않은 부분은 지원 범위표에 그대로 적어뒀습니다. 쓰시기 전에
36
36
  > [아직 검증되지 않은 것](#아직-검증되지-않은-것)을 먼저 봐주세요.
@@ -53,6 +53,20 @@ differences are font metrics rather than layout — a browser cannot measure
53
53
  Unity's font asset. All sixteen are named in
54
54
  [`docs/accuracy.en.md`](docs/accuracy.en.md).
55
55
 
56
+ This changes what you can open: **you can now open real screens made by someone
57
+ else**, including screens assembled from reusable UXML parts rather than one
58
+ self-contained file. `<ui:Template>` declarations and `<ui:Instance>` elements
59
+ are expanded for rendering. The template cohort is measured separately:
60
+ **200 / 220 coordinate values across 55 elements and 11 rendered cases**; it is
61
+ not added to the base 660/676 figure. Cycles fail closed with a diagnostic, and
62
+ slots are measured as alive in Unity 6000.0.40f1 but remain out of scope and
63
+ report `template-slot-unsupported`.
64
+
65
+ This is not a claim that every external sample exercises templates: only **1 of
66
+ 14** external documents uses `<ui:Template>`. The reported 31 → 0 improvement
67
+ there counts diagnostic lines (1 declaration + 15 instances + 15 overrides),
68
+ not 31 opened subtrees.
69
+
56
70
  ```
57
71
  .uxml + .uss → parse → style resolve → Yoga layout → DOM paint
58
72
  ↓
@@ -99,7 +113,9 @@ That broken feedback loop is what this library fixes.
99
113
  | 5 | Golden tests against Unity | ✅ |
100
114
  | 6 | **v0.1 release** | ✅ |
101
115
  | 7 | **v0.2 — ScrollView, Image, states, a measured screen** | ✅ |
102
- | 8+ | Editing layer, tool integration | ⬜ |
116
+ | 8 | **v0.3–0.4 — asset/import resolution semantics, Unity CLI measurement** | ✅ |
117
+ | 9 | **v0.5 — Template / Instance expansion and diagnostics** | ✅ |
118
+ | 10+ | Editing layer, tool integration | ⬜ |
103
119
 
104
120
  Full plan: [`docs/ROADMAP.md`](docs/ROADMAP.md)
105
121
 
@@ -108,6 +124,18 @@ Full plan: [`docs/ROADMAP.md`](docs/ROADMAP.md)
108
124
  The support matrix is deliberately conservative — see
109
125
  [`docs/supported.en.md`](docs/supported.en.md) for the full table.
110
126
 
127
+ - **Slots are not supported in v0.5.1.** They were measured alive in Unity
128
+ 6000.0.40f1; slot children are not placed and `template-slot-unsupported` is
129
+ reported.
130
+ - **A `style` AttributeOverride is not applied.** Unity ignores it during import,
131
+ and the preview reports `override-style-ignored` instead of drawing a plausible
132
+ but wrong result.
133
+ - **`Library/PackageCache` is not searched.** Embedded package UXML physically
134
+ present under `<projectRoot>/Packages/<name>/` resolves through
135
+ `project://database/Packages/...`; a registry-package template available only
136
+ in the cache reports `package-path-not-searched`.
137
+ - **The external 14-document sample contains only 1 template document.** Its
138
+ 31 → 0 result counts diagnostic lines, not rendered template subtrees.
111
139
  - **Only geometry is compared automatically, and only as far as Yoga.** The
112
140
  figure above is measured at the coordinates the layout engine produces.
113
141
  Whether the painted DOM reproduces them is checked by an invariant of our own
@@ -143,7 +171,8 @@ const doc = parse(uxmlText, ussText);
143
171
 
144
172
  // model → screen
145
173
  const view = render(doc, document.getElementById('preview'), {
146
- resolveAsset: (path) => myAssetUrlFor(path),
174
+ resolveAsset: (path, form) =>
175
+ form === 'url' ? myAssetUrlFor(path) : myResourcesAssetUrlFor(path),
147
176
 
148
177
  // Pseudo-class states are explicit input, keyed by USS selector, so the same
149
178
  // call always draws the same picture. Per element, because real screens mix.
@@ -158,6 +187,20 @@ view.dispose();
158
187
  const { uxml, uss } = serialize(doc);
159
188
  ```
160
189
 
190
+ `form` keeps `url()` and `resource()` distinct. `url()` is a host-defined asset
191
+ path; `resource()` is Unity's Resources lookup, where the extension is optional
192
+ and the folder may occur anywhere under `Assets`. Unity can also resolve editor
193
+ built-ins that a disk-only host cannot, so return `null` rather than treating a
194
+ resource name as an ordinary project path.
195
+
196
+ For external stylesheets and template `src` files,
197
+ `parse(uxml, uss, { resolveImport: (url, from) => ... })` passes the immediate
198
+ containing URL as `from`. Entry-UXML references receive `null`; nested stylesheet
199
+ imports receive the containing stylesheet URL, and nested template dependencies
200
+ receive the containing UXML URL. Existing one-argument callbacks remain valid; a future third hook
201
+ argument will use an options object instead. `collectDependencies(source)` lists
202
+ template dependency URLs in source order for host prefetching.
203
+
161
204
  ### Playground
162
205
 
163
206
  **[reuhomi.github.io/uxml-preview](https://reuhomi.github.io/uxml-preview/)** —
@@ -210,12 +253,14 @@ Checked by comparing element geometry against the Unity Editor, case by case.
210
253
  Geometry rather than pixels: Unity draws text with its own font asset and a
211
254
  browser does not, so a pixel diff would measure the font more than the layout.
212
255
 
213
- Measured against Unity on 2026-08-12, over 40 cases and 169 elements:
256
+ Coordinates measured against Unity on 2026-08-12, over 40 layout cases and 169
257
+ elements:
214
258
 
215
259
  | | |
216
260
  |---|---|
217
261
  | Cases matching exactly | **38 / 40** |
218
262
  | Values within 0.5px | **660 / 676 (97.6%)** |
263
+ | Unity baselines recorded | **41 / 41** (40 coordinate cases + 1 resource observation) |
219
264
 
220
265
  The sixteen divergences are four different things, and the distinction matters
221
266
  more than the ratio: **ten are text metrics**, three are 1px, two are a
@@ -264,6 +309,14 @@ back out unchanged. Their own styles and their children come out normally; only
264
309
  what makes that control look like itself is missing. One unfamiliar tag never
265
310
  takes down the rest of the screen, and nothing is silently dropped.
266
311
 
312
+ **Are templates and instances rendered?**
313
+ Yes. Template declarations resolve through the host import hook, instances become
314
+ opaque `TemplateContainer` elements, and `AttributeOverrides` reach every
315
+ duplicate target for ordinary attributes. A `style` AttributeOverride is reported
316
+ as `override-style-ignored` because Unity ignores it during import. Slot children
317
+ are intentionally not placed; the measured Unity slot behavior is reported as
318
+ `template-slot-unsupported` in this release.
319
+
267
320
  ### License
268
321
 
269
322
  Apache-2.0
@@ -285,6 +338,18 @@ Unity 6000.0.40f1과 대조한 결과, 실무형 화면을 포함한 레이아
285
338
  폰트 메트릭** 차이입니다 — 브라우저는 유니티 폰트 에셋을 잴 수 없습니다.
286
339
  16개 전부 [`docs/accuracy.md`](docs/accuracy.md)에 이름과 사유를 적어뒀습니다.
287
340
 
341
+ 이제 **남이 만든 실제 화면을 열 수 있게 됩니다.** 한 파일에 모든 내용을 넣은
342
+ 화면뿐 아니라 재사용 가능한 UXML 조각을 조립한 화면도 `<ui:Template>`과
343
+ `<ui:Instance>`를 전개해 렌더링합니다. 템플릿 코호트는 기본 수치와 분리해
344
+ **55 elements, 11개 렌더 케이스의 좌표 220개 중 200개**로 측정했으며
345
+ 660/676에 합산하지 않습니다. 순환은 진단과 함께 fail-closed로 막고, 슬롯은
346
+ Unity 6000.0.40f1에서 살아 있음을 실측했지만 이번 범위 밖이라
347
+ `template-slot-unsupported`로 보고합니다.
348
+
349
+ 외부 14개 표본 전체가 템플릿을 검증한 것은 아닙니다. 그중 `<ui:Template>`을
350
+ 쓰는 문서는 **1개**뿐이고, 보고된 31 → 0은 열린 서브트리 수가 아니라 진단
351
+ 줄 수(선언 1 + Instance 15 + override 15)입니다.
352
+
288
353
  ```
289
354
  .uxml + .uss → 파싱 → 스타일 계산 → Yoga 레이아웃 → DOM 페인팅
290
355
  ↓
@@ -330,7 +395,9 @@ Unity 6000.0.40f1과 대조한 결과, 실무형 화면을 포함한 레이아
330
395
  | 5 | 유니티 대조 골든 테스트 | ✅ |
331
396
  | 6 | **v0.1 공개** | ✅ |
332
397
  | 7 | **v0.2 — ScrollView·Image·상태, 대표 화면 대조** | ✅ |
333
- | 8+ | 편집 레이어, 도구 통합 | ⬜ |
398
+ | 8 | **v0.3–0.4 — 에셋·import 해석 의미론, Unity CLI 계측** | ✅ |
399
+ | 9 | **v0.5 — Template / Instance 전개와 진단** | ✅ |
400
+ | 10+ | 편집 레이어, 도구 통합 | ⬜ |
334
401
 
335
402
  전체 계획: [`docs/ROADMAP.md`](docs/ROADMAP.md)
336
403
 
@@ -339,6 +406,17 @@ Unity 6000.0.40f1과 대조한 결과, 실무형 화면을 포함한 레이아
339
406
  지원 범위는 일부러 보수적으로 적었습니다. 전체 표는
340
407
  [`docs/supported.md`](docs/supported.md)에 있습니다.
341
408
 
409
+ - **v0.5.1은 슬롯을 지원하지 않습니다.** Unity 6000.0.40f1에서 살아 있음을
410
+ 실측했지만 슬롯 자식은 배치하지 않고 `template-slot-unsupported`로 보고합니다
411
+ - **`style` AttributeOverride는 적용하지 않습니다.** Unity가 import 과정에서
412
+ 무시하는 동작을 따르며, 그럴듯하지만 틀린 결과 대신
413
+ `override-style-ignored`를 보고합니다
414
+ - **`Library/PackageCache`는 탐색하지 않습니다.**
415
+ `<projectRoot>/Packages/<name>/`에 실물이 있는 embedded package UXML은
416
+ `project://database/Packages/...`로 해석하지만, 캐시에만 있는 레지스트리 패키지
417
+ 템플릿은 `package-path-not-searched`로 보고합니다
418
+ - **외부 14개 표본 중 템플릿 문서는 1개뿐입니다.** 31 → 0은 렌더된 템플릿
419
+ 서브트리가 아니라 진단 줄 수입니다
342
420
  - **자동 대조는 좌표만, 그것도 Yoga 층까지입니다.** 위 수치는 레이아웃 엔진이 낸
343
421
  좌표를 잰 것입니다. 그려진 DOM이 그 좌표를 재현하는지는 유니티가 아니라 자체
344
422
  불변식 검사로 봅니다
@@ -396,6 +474,19 @@ pnpm build
396
474
  정확도 수치를 재현하려면 유니티가 필요합니다. 절차는
397
475
  [`docs/accuracy.md`](docs/accuracy.md)에 있습니다.
398
476
 
477
+ ### API
478
+
479
+ `render` 옵션의 `resolveAsset(path, form)`에서 `form`은 `'url' | 'resource'`입니다.
480
+ `url()`은 호스트의 에셋 경로이고 `resource()`는 Unity Resources 검색입니다. 후자는
481
+ 확장자 없이 쓸 수 있고 Resources 폴더가 `Assets` 아래 어디에나 있을 수 있으며, 에디터
482
+ 내장 리소스처럼 프로젝트 디스크만 보는 호스트가 풀 수 없는 값도 있으므로 그때는 `null`을
483
+ 반환해야 합니다. 외부 스타일시트와 템플릿 `src`는
484
+ `parse(uxml, uss, { resolveImport: (url, from) => ... })`로 읽습니다. 엔트리 UXML의
485
+ 참조는 `from: null`, 중첩 stylesheet import는 부모 stylesheet URL, 중첩 템플릿
486
+ 의존성은 부모 UXML URL을 받습니다. 기존 한 인자 콜백은 계속 동작합니다.
487
+ `collectDependencies(source)`는 호스트가
488
+ 미리 가져올 템플릿 의존 URL을 소스 순서대로 돌려줍니다.
489
+
399
490
  ### 이런 질문에 답합니다
400
491
 
401
492
  **유니티를 켜지 않고 UXML을 미리 볼 수 있나요?**
@@ -430,6 +521,13 @@ Unity 6000.0.40f1 기준, 인벤토리 화면 전체를 포함한 레이아웃
430
521
  자기 스타일과 자식은 정상적으로 나오며 그 컨트롤 고유의 모양만 빠집니다. 모르는 태그
431
522
  하나 때문에 화면 전체가 죽지 않고, 조용히 사라지는 것도 없습니다.
432
523
 
524
+ **템플릿과 인스턴스도 렌더링하나요?**
525
+ 네. 템플릿 선언은 호스트 import 훅으로 해석하고, 인스턴스는 불투명한
526
+ `TemplateContainer`로 전개하며, `AttributeOverrides`는 같은 이름의 모든 대상에
527
+ 일반 속성을 적용합니다. `style` AttributeOverride는 Unity가 import에서 무시하므로
528
+ `override-style-ignored`로 보고하고 적용하지 않습니다. 슬롯 자식은 이번 릴리스에서
529
+ 배치하지 않고 `template-slot-unsupported` 진단으로 보고합니다.
530
+
433
531
  ### 라이선스
434
532
 
435
533
  Apache-2.0
@@ -53,3 +53,10 @@ SOFTWARE.
53
53
  Vite, Vitest, TypeScript, jsdom, pixelmatch and pngjs are development
54
54
  dependencies. They are not redistributed in either artifact above, so they carry
55
55
  no notice obligation here.
56
+
57
+ ## Test fixtures in the source repository
58
+
59
+ `tests/fixtures/external/` holds UXML and USS files from six open-source Unity
60
+ projects (MIT, and one Unlicense), used only as test input. They are not in the
61
+ npm package or the site. Each source's licence file sits in its folder, and
62
+ `tests/fixtures/external/README.md` lists the origins.
package/dist/index.d.ts CHANGED
@@ -7,7 +7,9 @@ import { LayoutBox, MeasureText } from './layout/yoga';
7
7
  * below are still signatures only; implementations land in Phases 2–4.
8
8
  * See docs/ROADMAP.md.
9
9
  */
10
- export type { Span, SourceRef, NodeId, ElementName, Attribute, ElementSpans, ElementNode, Combinator, SimpleSelector, SelectorPart, Selector, Declaration, Rule, SheetItem, StyleSheet, WarningKind, Warning, UxmlDocument, StyleOrigin, } from './model/types';
10
+ export type { Span, SourceRef, NodeId, ElementName, Attribute, ElementSpans, ElementNode, Combinator, SimpleSelector, SelectorPart, Selector, Declaration, Rule, SheetItem, StyleSheet, WarningKind, WarningKindMap, WarningReason, WarningSubject, Warning, UxmlDocument, StyleOrigin, } from './model/types';
11
+ export { collectDependencies, expandTemplates, TEMPLATE_DEPTH_LIMIT } from './template/expand';
12
+ export type { TemplateExpansion, TemplateResolver } from './template/expand';
11
13
  export { loadLayoutEngine, isLayoutEngineReady, liveNodeCount } from './layout/yoga';
12
14
  export type { LayoutBox, MeasureText, TextContext, TextMetrics } from './layout/yoga';
13
15
  export { createDefaultMeasureText } from './render/measure';
@@ -17,6 +19,8 @@ export { resolveStyles, explainProperty } from './style/resolve';
17
19
  export type { Candidate, ComputedStyle, ComputedValue, ResolveOptions, ResolveResult, } from './style/resolve';
18
20
  export type { Specificity } from './style/specificity';
19
21
  export { isInherited } from './style/properties';
22
+ export { USS_STATES } from './style/registry';
23
+ export type { UssState } from './style/registry';
20
24
  export { KNOWN_DIVERGENCES } from './known-divergences';
21
25
  export type { KnownDivergence } from './known-divergences';
22
26
  /**
@@ -141,13 +145,4 @@ export interface RenderResult {
141
145
  */
142
146
  dispose(): void;
143
147
  }
144
- /**
145
- * Purpose: draw a document into a container element.
146
- * Deps/Effects: replaces the container's children and allocates Yoga nodes.
147
- * Call `dispose()` on the result before rendering again.
148
- * Requires: `await loadLayoutEngine()` once, first. Yoga is WebAssembly and
149
- * cannot be loaded synchronously; keeping that await out here is
150
- * what lets this function stay synchronous, which the playground
151
- * and the golden tests both want.
152
- */
153
148
  export declare function render(doc: UxmlDocument, container: HTMLElement, options?: RenderOptions): RenderResult;