-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
348 lines (337 loc) · 15.1 KB
/
Copy pathindex.html
File metadata and controls
348 lines (337 loc) · 15.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="theme-color" content="#f7f8fa" />
<meta
name="description"
content="Explore how SwiftUI DisplayList descriptions map to minimalDescription encodings."
/>
<meta property="og:title" content="DisplayList Explorer" />
<meta
property="og:description"
content="DisplayList description → minimalDescription, with linked ranges and encoding statistics."
/>
<meta property="og:type" content="website" />
<title>DisplayList Explorer</title>
<link rel="icon" href="data:," />
<link rel="stylesheet" href="./styles.css" />
</head>
<body>
<header class="site-header">
<a class="wordmark" href="./" aria-label="DisplayList Explorer home">
<span class="wordmark-mark">DL</span>
<span>DisplayList Explorer</span>
</a>
<div class="header-meta">
<div id="wasm-status" class="status" role="status">Loading SwiftWasm…</div>
<a class="github-link" href="https://github.com/OpenSwiftUIProject/DisplayListExplorer">
Source code ↗
</a>
</div>
</header>
<main id="top">
<section class="product-intro" aria-labelledby="page-title">
<div>
<h1 id="page-title">DisplayList Explorer</h1>
<div class="conversion-direction">
<p id="conversion-summary" class="conversion-summary">DisplayList.description → minimalDescription</p>
<button
id="direction-toggle"
class="direction-toggle"
type="button"
aria-label="Swap conversion direction"
title="Use the current output as the next input"
>
⇄ Swap
</button>
</div>
</div>
<p>
Paste either representation, swap direction when needed, then hover either side to follow
each <code>minimalDescription</code> encoding.
</p>
</section>
<section class="explorer" aria-label="DisplayList explorer">
<article class="pane source-pane">
<div class="pane-header">
<div>
<p class="pane-kicker">Source</p>
<h2 id="source-title">DisplayList Description</h2>
</div>
<div class="pane-actions">
<button id="sample-button" class="quiet-button" type="button">Load sample</button>
<button id="clear-button" class="quiet-button" type="button">Clear</button>
</div>
</div>
<div id="editor-container" class="editor-container">
<div class="editor-loading">Loading editor…</div>
</div>
</article>
<div
id="pane-splitter"
class="pane-splitter"
role="separator"
aria-label="Resize source and output panes"
aria-orientation="vertical"
aria-valuemin="20"
aria-valuemax="80"
aria-valuenow="50"
title="Drag to resize panes; double-click to reset"
tabindex="0"
></div>
<article class="pane detail-pane">
<div class="detail-toolbar">
<div class="tabs" role="tablist" aria-label="DisplayList details">
<button
id="minimal-tab"
class="tab is-active"
type="button"
role="tab"
aria-selected="true"
aria-controls="minimal-panel"
data-tab="minimal"
>
<svg class="tab-icon" viewBox="0 0 24 24" aria-hidden="true">
<path d="m18 16 4-4-4-4"></path>
<path d="m6 8-4 4 4 4"></path>
<path d="m14.5 4-5 16"></path>
</svg>
<span id="output-tab-label">minimalDesc</span>
</button>
<button
id="info-tab"
class="tab"
type="button"
role="tab"
aria-selected="false"
aria-controls="info-panel"
data-tab="info"
>
<svg class="tab-icon" viewBox="0 0 24 24" aria-hidden="true">
<path d="M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5Z"></path>
<polyline points="14 2 14 8 20 8"></polyline>
<line x1="8" x2="16" y1="13" y2="13"></line>
<line x1="8" x2="16" y1="17" y2="17"></line>
</svg>
<span>Info</span>
</button>
<button
id="preview-tab"
class="tab"
type="button"
role="tab"
aria-selected="false"
aria-controls="preview-panel"
data-tab="preview"
>
<svg class="tab-icon" viewBox="0 0 24 24" aria-hidden="true">
<rect width="20" height="14" x="2" y="3" rx="2"></rect>
<line x1="8" x2="16" y1="21" y2="21"></line>
<line x1="12" x2="12" y1="17" y2="21"></line>
</svg>
<span>Preview</span>
</button>
<button
id="statistics-tab"
class="tab"
type="button"
role="tab"
aria-selected="false"
aria-controls="statistics-panel"
data-tab="statistics"
>
<svg class="tab-icon" viewBox="0 0 24 24" aria-hidden="true">
<path d="M22 12h-4l-3 9L9 3l-3 9H2"></path>
</svg>
<span>Statistics</span>
</button>
</div>
<div class="output-actions">
<button id="share-button" class="share-button" type="button" disabled>Copy link</button>
<button id="copy-button" class="copy-button" type="button" disabled>Copy</button>
</div>
</div>
<section id="minimal-panel" class="tab-panel is-active" role="tabpanel" aria-labelledby="minimal-tab">
<div class="panel-heading">
<div>
<p class="pane-kicker">Output</p>
<h2 id="output-title">minimalDescription</h2>
</div>
<p id="mapping-summary" class="mapping-summary">Waiting for the converter…</p>
</div>
<pre id="minimal-output" class="minimal-output output-placeholder" aria-live="polite">Loading the Swift converter…</pre>
<p id="conversion-error" class="error-message" role="alert" hidden></p>
<div id="hover-inspector" class="hover-inspector" aria-live="polite">
Hover a mapped element on either side to inspect its encoding.
</div>
</section>
<section id="info-panel" class="tab-panel" role="tabpanel" aria-labelledby="info-tab" hidden>
<div class="panel-heading info-heading">
<div>
<p class="pane-kicker">Reference</p>
<h2>Encoding Info</h2>
</div>
<p>Tokens are context-dependent; this tab documents them without implying usage.</p>
</div>
<aside id="forward-limitation" class="limitation-note">
<strong>Conversion limitation</strong>
<span>
An empty <code>(effect)</code> in the pasted description has lost its original effect type.
When encountered, this tool uses the identity encoding <code>(E)</code> as a fallback.
</span>
</aside>
<aside id="reverse-limitation" class="limitation-note" hidden>
<strong>Lossy reconstruction</strong>
<span>
<code>?</code> marks an unknown value; <code>*</code> marks a payload or effect type
that cannot be recovered from <code>minimalDescription</code>.
</span>
</aside>
<div id="encoding-info" class="encoding-info">
<p class="empty-state">Loading encoding definitions…</p>
</div>
</section>
<section id="preview-panel" class="tab-panel" role="tabpanel" aria-labelledby="preview-tab" hidden>
<div class="panel-heading preview-heading">
<div>
<p class="pane-kicker">Canvas approximation</p>
<h2>DisplayList Preview</h2>
</div>
<div class="preview-heading-meta">
<p id="preview-summary">No preview</p>
<div class="preview-control-row">
<div class="preview-device-picker">
<button
id="preview-device-button"
class="preview-device-button"
type="button"
aria-label="Choose preview device"
aria-haspopup="listbox"
aria-expanded="false"
aria-controls="preview-device-menu"
>
<span class="preview-device-icon" aria-hidden="true">▣</span>
<span id="preview-device-label">iPhone 17 Pro</span>
<span id="preview-device-dimensions" class="preview-device-dimensions">402 × 874</span>
<span class="preview-device-chevron" aria-hidden="true">⌄</span>
</button>
<div id="preview-device-menu" class="preview-device-menu" role="listbox" aria-label="Preview device" hidden>
<button id="preview-device-iphone17pro" type="button" role="option" aria-selected="true">
<span>iPhone 17 Pro</span><span>402 × 874</span>
</button>
<button id="preview-device-iphone17promax" type="button" role="option" aria-selected="false">
<span>iPhone 17 Pro Max</span><span>440 × 956</span>
</button>
<button id="preview-device-iphoneair" type="button" role="option" aria-selected="false">
<span>iPhone Air</span><span>420 × 912</span>
</button>
<button id="preview-device-iphone16e" type="button" role="option" aria-selected="false">
<span>iPhone 16e</span><span>390 × 844</span>
</button>
<button id="preview-device-iphone15pro" type="button" role="option" aria-selected="false">
<span>iPhone 15 Pro</span><span>393 × 852</span>
</button>
<button id="preview-device-window" type="button" role="option" aria-selected="false">
<span>Window</span><span>Custom size</span>
</button>
</div>
</div>
<div id="preview-window-size" class="preview-window-size" role="group" aria-label="Window content size" hidden>
<input
id="preview-window-width"
type="number"
value="800"
min="100"
max="10000"
step="1"
inputmode="numeric"
aria-label="Window width in points"
/>
<span aria-hidden="true">×</span>
<input
id="preview-window-height"
type="number"
value="600"
min="100"
max="10000"
step="1"
inputmode="numeric"
aria-label="Window height in points"
/>
<span>pt</span>
</div>
<div class="preview-zoom-controls" role="group" aria-label="Preview zoom controls">
<button id="preview-zoom-out" type="button" aria-label="Zoom out" title="Zoom out">−</button>
<label class="preview-zoom-value" title="Enter a zoom percentage">
<input
id="preview-zoom-value"
type="number"
min="1"
max="1600"
step="1"
inputmode="decimal"
aria-label="Preview zoom percentage"
placeholder="—"
disabled
/>
<span aria-hidden="true">%</span>
</label>
<button id="preview-zoom-in" type="button" aria-label="Zoom in" title="Zoom in">+</button>
</div>
<button
id="preview-zoom-fit"
class="preview-zoom-fit is-active"
type="button"
aria-label="Fit preview to canvas"
aria-pressed="true"
>Fit</button>
</div>
</div>
</div>
<div id="preview-surface" class="preview-surface" aria-label="Draggable device preview">
<canvas id="preview-canvas" class="preview-canvas" aria-label="Rendered DisplayList preview"></canvas>
<p id="preview-empty" class="preview-empty">Paste a DisplayList description to preview it.</p>
<div id="preview-scale" class="preview-scale" hidden>
<span id="preview-scale-label" class="preview-scale-label">100 pt</span>
<span id="preview-scale-rule" class="preview-scale-rule" aria-hidden="true"></span>
</div>
</div>
<p class="preview-footnote">
Layout, resolved colors, opacity, transforms, clips, and path geometry are reproduced when present.
Drag to move the selected device. Missing image, font, paint, and platform payloads use approximations or placeholders.
</p>
</section>
<section
id="statistics-panel"
class="tab-panel"
role="tabpanel"
aria-labelledby="statistics-tab"
hidden
>
<div class="panel-heading statistics-heading">
<div>
<p class="pane-kicker">Current input</p>
<h2>Encoding Statistics</h2>
</div>
<p id="statistics-summary">No mapped encodings yet.</p>
</div>
<div id="encoding-statistics" class="statistics-content">
<p class="empty-state">Paste a DisplayList description to see occurrence counts.</p>
</div>
</section>
</article>
</section>
<section class="privacy-note" aria-label="About this tool">
<span>Runs locally</span>
<p>The parser is written in Swift and executes in your browser as WebAssembly. No DisplayList data leaves this page.</p>
</section>
</main>
<footer>
<span>DisplayList Explorer</span>
<span>SwiftWasm · OpenSwiftUIProject</span>
</footer>
<script type="module" src="./main.js"></script>
</body>
</html>