@nysds/playground 0.1.0
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/LICENSE +25 -0
- package/README.md +364 -0
- package/bin/cli.mjs +223 -0
- package/bin/cli.test.mjs +36 -0
- package/decks/customizing-components.json +97 -0
- package/dist/assets/index-LO1tomgR.css +6 -0
- package/dist/assets/index-bBtGCGL_.js +5190 -0
- package/dist/assets/internal/typescript.js +193739 -0
- package/dist/assets/nys-icon.library-Bi_7DKlD-YSs5zqZy-DXISxj9N.js +609 -0
- package/dist/assets/nys-icon.library-CwuPZJAc-TryaOS7Z.js +600 -0
- package/dist/assets/playground-typescript-worker-BcTrPYfY.js +87 -0
- package/dist/assets/playground-typescript-worker.js +87 -0
- package/dist/favicon.svg +10 -0
- package/dist/index.html +769 -0
- package/dist/nysds-logo.svg +21 -0
- package/dist/nysds-symbol.svg +7 -0
- package/index.html +768 -0
- package/package.json +59 -0
- package/presets/00-welcome.json +8 -0
- package/presets/01-button.json +7 -0
- package/presets/02-alert.json +7 -0
- package/presets/03-badge-and-avatar.json +7 -0
- package/presets/04-text-input.json +7 -0
- package/presets/05-select-radio-checkbox.json +7 -0
- package/presets/06-form-validation.json +7 -0
- package/presets/07-card.json +7 -0
- package/presets/08-accordion.json +7 -0
- package/presets/09-tabs.json +7 -0
- package/presets/10-modal.json +7 -0
- package/presets/11-stepper.json +7 -0
- package/presets/12-table-and-pagination.json +7 -0
- package/presets/13-tooltip-and-dropdown.json +7 -0
- package/presets/14-navigation.json +7 -0
- package/presets/15-page-structure.json +7 -0
- package/presets/16-themes.json +7 -0
- package/presets/17-utility-classes.json +7 -0
- package/presets/README.md +118 -0
- package/public/favicon.svg +10 -0
- package/public/nysds-logo.svg +21 -0
- package/public/nysds-symbol.svg +7 -0
- package/src/app.css +1087 -0
- package/src/debounce.ts +86 -0
- package/src/deck-model.ts +299 -0
- package/src/deck-store.ts +144 -0
- package/src/decks.test.ts +288 -0
- package/src/editor-panes.ts +190 -0
- package/src/editors.ts +92 -0
- package/src/home.ts +225 -0
- package/src/icon-names.ts +117 -0
- package/src/icons.test.ts +58 -0
- package/src/keys.ts +162 -0
- package/src/main.ts +1456 -0
- package/src/playground.config.ts +74 -0
- package/src/playground.ts +261 -0
- package/src/present.ts +398 -0
- package/src/preset-schema.ts +228 -0
- package/src/route.test.ts +56 -0
- package/src/routing.ts +60 -0
- package/src/settings.ts +211 -0
- package/src/starters.ts +86 -0
- package/src/state.test.ts +544 -0
- package/src/state.ts +237 -0
- package/src/theme.ts +82 -0
- package/src/version-catalog.ts +42 -0
- package/src/versions.ts +88 -0
- package/src/wrapper.ts +84 -0
- package/tsconfig.json +25 -0
- package/vite.config.ts +62 -0
package/index.html
ADDED
|
@@ -0,0 +1,768 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
|
+
<link rel="icon" href="./favicon.svg" type="image/svg+xml" />
|
|
7
|
+
<meta
|
|
8
|
+
name="description"
|
|
9
|
+
content="Edit HTML, CSS, and JavaScript against the New York State Design System and share the result with a link."
|
|
10
|
+
/>
|
|
11
|
+
<title>NYSDS Playground</title>
|
|
12
|
+
<link
|
|
13
|
+
rel="preload"
|
|
14
|
+
href="/fonts/proximanova-regular.woff2"
|
|
15
|
+
as="font"
|
|
16
|
+
type="font/woff2"
|
|
17
|
+
crossorigin
|
|
18
|
+
/>
|
|
19
|
+
<link rel="stylesheet" href="/fonts/nysds-fonts.css" />
|
|
20
|
+
<style>
|
|
21
|
+
/* Keep the shell out of sight until the components are defined, so
|
|
22
|
+
the page never shows unstyled text before the design system loads.
|
|
23
|
+
A splash with the logo covers the wait. The app removes both. */
|
|
24
|
+
#app:not(.app--ready) {
|
|
25
|
+
visibility: hidden;
|
|
26
|
+
}
|
|
27
|
+
#splash {
|
|
28
|
+
position: fixed;
|
|
29
|
+
inset: 0;
|
|
30
|
+
z-index: 1000;
|
|
31
|
+
display: grid;
|
|
32
|
+
place-items: center;
|
|
33
|
+
background: #f6f6f6;
|
|
34
|
+
}
|
|
35
|
+
#splash[hidden] {
|
|
36
|
+
display: none;
|
|
37
|
+
}
|
|
38
|
+
#splash img {
|
|
39
|
+
width: min(80vw, 400px);
|
|
40
|
+
height: auto;
|
|
41
|
+
animation: splash-pulse 1.4s ease-in-out infinite;
|
|
42
|
+
}
|
|
43
|
+
@keyframes splash-pulse {
|
|
44
|
+
50% {
|
|
45
|
+
opacity: 0.5;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
@media (prefers-reduced-motion: reduce) {
|
|
49
|
+
#splash img {
|
|
50
|
+
animation: none;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
</style>
|
|
54
|
+
</head>
|
|
55
|
+
<body>
|
|
56
|
+
<div id="splash" aria-hidden="true">
|
|
57
|
+
<img src="./nysds-logo.svg" alt="" width="1037" height="114" />
|
|
58
|
+
</div>
|
|
59
|
+
<noscript>
|
|
60
|
+
<p style="padding: 16px; font-family: sans-serif">
|
|
61
|
+
NYSDS Playground needs JavaScript to run.
|
|
62
|
+
</p>
|
|
63
|
+
</noscript>
|
|
64
|
+
<div id="app" class="app">
|
|
65
|
+
<main class="home" id="home" hidden>
|
|
66
|
+
<header class="home__header">
|
|
67
|
+
<h1 class="home__title">
|
|
68
|
+
<img class="home__logo" src="./nysds-logo.svg" alt="NYS Design System" width="1037" height="114" />
|
|
69
|
+
<span class="home__title-text">Playground</span>
|
|
70
|
+
</h1>
|
|
71
|
+
<nys-tooltip for="home-settings-button" text="Settings"></nys-tooltip>
|
|
72
|
+
<nys-button id="home-settings-button" size="sm" variant="ghost" circle label="Settings">
|
|
73
|
+
<svg
|
|
74
|
+
slot="circle-icon"
|
|
75
|
+
class="glyph"
|
|
76
|
+
viewBox="0 -960 960 960"
|
|
77
|
+
fill="currentColor"
|
|
78
|
+
aria-hidden="true"
|
|
79
|
+
>
|
|
80
|
+
<path
|
|
81
|
+
d="M370-80l-16-128q-13-5-24.5-12T307-235l-119 50L78-375l103-78q-1-7-1-13.5v-27q0-6.5 1-13.5L78-585l110-190 119 50q11-8 23-15t24-12l16-128h220l16 128q13 5 24.5 12t22.5 15l119-50 110 190-103 78q1 7 1 13.5v27q0 6.5-2 13.5l103 78-110 190-118-50q-11 8-23 15t-24 12L590-80H370Zm112-260q58 0 99-41t41-99q0-58-41-99t-99-41q-59 0-99.5 41T342-480q0 58 40.5 99t99.5 41Z"
|
|
82
|
+
/>
|
|
83
|
+
</svg>
|
|
84
|
+
</nys-button>
|
|
85
|
+
</header>
|
|
86
|
+
|
|
87
|
+
<p class="home__lede">
|
|
88
|
+
Decks are saved in this browser only, not on a server. Edit one, present it, share a slide as a link, or export a deck as JSON to back it up or move it to another browser.
|
|
89
|
+
</p>
|
|
90
|
+
|
|
91
|
+
<div class="home__actions nys-display-flex nys-flex-wrap nys-flex-gap-200">
|
|
92
|
+
<nys-button id="new-deck-button" label="New deck" prefixIcon="add"></nys-button>
|
|
93
|
+
<nys-button
|
|
94
|
+
id="import-deck-button"
|
|
95
|
+
variant="outline"
|
|
96
|
+
label="Import deck"
|
|
97
|
+
prefixIcon="upload_file"
|
|
98
|
+
></nys-button>
|
|
99
|
+
<nys-button
|
|
100
|
+
id="scratch-button"
|
|
101
|
+
variant="ghost"
|
|
102
|
+
label="Scratch pad"
|
|
103
|
+
prefixIcon="code"
|
|
104
|
+
></nys-button>
|
|
105
|
+
</div>
|
|
106
|
+
|
|
107
|
+
<div class="home__decks nys-grid-row nys-grid-gap" id="deck-list"></div>
|
|
108
|
+
|
|
109
|
+
<div class="home__footer">
|
|
110
|
+
<nys-button
|
|
111
|
+
id="restore-starters-button"
|
|
112
|
+
size="sm"
|
|
113
|
+
variant="ghost"
|
|
114
|
+
label="Restore starter decks"
|
|
115
|
+
prefixIcon="refresh"
|
|
116
|
+
></nys-button>
|
|
117
|
+
</div>
|
|
118
|
+
|
|
119
|
+
<input
|
|
120
|
+
class="home__file"
|
|
121
|
+
id="import-file"
|
|
122
|
+
type="file"
|
|
123
|
+
accept=".json,application/json"
|
|
124
|
+
hidden
|
|
125
|
+
/>
|
|
126
|
+
</main>
|
|
127
|
+
|
|
128
|
+
<header class="toolbar" id="toolbar">
|
|
129
|
+
<a class="toolbar__home" id="toolbar-home" href="./" aria-label="NYSDS Playground home">
|
|
130
|
+
<svg
|
|
131
|
+
class="toolbar__mark"
|
|
132
|
+
viewBox="13 3 205 205"
|
|
133
|
+
fill="currentColor"
|
|
134
|
+
aria-hidden="true"
|
|
135
|
+
focusable="false"
|
|
136
|
+
>
|
|
137
|
+
<path
|
|
138
|
+
d="M89.6599 110.894L56.3349 77.5558V48.4713H172.629L217.285 93.4372C211.299 42.5111 168.016 3 115.5 3C58.8907 3 13 48.908 13 105.538C13 128.627 20.6323 149.93 33.5051 167.07"
|
|
139
|
+
/>
|
|
140
|
+
<path
|
|
141
|
+
d="M172.629 48.3945V164.733H143.556V98.0323L54.072 187.55C71.191 200.39 92.4567 208 115.5 208C172.109 208 218 162.092 218 105.462C218 101.356 217.731 97.3158 217.262 93.3366L172.629 48.3945Z"
|
|
142
|
+
/>
|
|
143
|
+
<path d="M56.3291 77.5552H122.979L89.6541 110.893L56.3291 77.5552Z" />
|
|
144
|
+
</svg>
|
|
145
|
+
</a>
|
|
146
|
+
|
|
147
|
+
<h1 class="toolbar__title scratch-only" id="deck-title-static">Scratch pad</h1>
|
|
148
|
+
|
|
149
|
+
<button
|
|
150
|
+
class="toolbar__title toolbar__rename deck-only edit-only"
|
|
151
|
+
id="deck-title"
|
|
152
|
+
type="button"
|
|
153
|
+
>
|
|
154
|
+
<span id="deck-title-text"></span>
|
|
155
|
+
<nys-icon class="toolbar__rename-icon" name="edit_square" size="sm"></nys-icon>
|
|
156
|
+
</button>
|
|
157
|
+
|
|
158
|
+
<input
|
|
159
|
+
class="toolbar__rename-input deck-only"
|
|
160
|
+
id="deck-title-field"
|
|
161
|
+
type="text"
|
|
162
|
+
aria-label="Deck title"
|
|
163
|
+
hidden
|
|
164
|
+
/>
|
|
165
|
+
|
|
166
|
+
<nys-tooltip class="deck-only" for="deck-settings-button" text="Deck settings"></nys-tooltip>
|
|
167
|
+
<nys-button
|
|
168
|
+
class="deck-only"
|
|
169
|
+
id="deck-settings-button"
|
|
170
|
+
size="sm"
|
|
171
|
+
variant="ghost"
|
|
172
|
+
circle
|
|
173
|
+
icon="more_vert"
|
|
174
|
+
label="Deck settings"
|
|
175
|
+
></nys-button>
|
|
176
|
+
|
|
177
|
+
<nys-button
|
|
178
|
+
class="scratch-only"
|
|
179
|
+
id="save-as-deck-button"
|
|
180
|
+
size="sm"
|
|
181
|
+
variant="outline"
|
|
182
|
+
label="Save as deck"
|
|
183
|
+
prefixIcon="add"
|
|
184
|
+
></nys-button>
|
|
185
|
+
|
|
186
|
+
<p class="toolbar__saved" id="saved-indicator" role="status" aria-live="polite"></p>
|
|
187
|
+
|
|
188
|
+
<div class="toolbar__spacer"></div>
|
|
189
|
+
|
|
190
|
+
<nys-select
|
|
191
|
+
id="version-select"
|
|
192
|
+
class="toolbar__select"
|
|
193
|
+
ariaLabel="Design system version"
|
|
194
|
+
width="md"
|
|
195
|
+
></nys-select>
|
|
196
|
+
|
|
197
|
+
<nys-tooltip for="share-button" text="Share"></nys-tooltip>
|
|
198
|
+
<nys-button
|
|
199
|
+
id="share-button"
|
|
200
|
+
size="sm"
|
|
201
|
+
variant="ghost"
|
|
202
|
+
circle
|
|
203
|
+
icon="link"
|
|
204
|
+
label="Share"
|
|
205
|
+
></nys-button>
|
|
206
|
+
|
|
207
|
+
<nys-tooltip class="deck-only" for="export-button" text="Export deck"></nys-tooltip>
|
|
208
|
+
<nys-button
|
|
209
|
+
class="deck-only"
|
|
210
|
+
id="export-button"
|
|
211
|
+
size="sm"
|
|
212
|
+
variant="ghost"
|
|
213
|
+
circle
|
|
214
|
+
icon="download"
|
|
215
|
+
label="Export deck"
|
|
216
|
+
></nys-button>
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
<nys-tooltip for="settings-button" text="Settings"></nys-tooltip>
|
|
221
|
+
<nys-button
|
|
222
|
+
id="settings-button"
|
|
223
|
+
size="sm"
|
|
224
|
+
variant="ghost"
|
|
225
|
+
circle
|
|
226
|
+
label="Settings"
|
|
227
|
+
>
|
|
228
|
+
<svg
|
|
229
|
+
slot="circle-icon"
|
|
230
|
+
class="glyph"
|
|
231
|
+
viewBox="0 -960 960 960"
|
|
232
|
+
fill="currentColor"
|
|
233
|
+
aria-hidden="true"
|
|
234
|
+
>
|
|
235
|
+
<path
|
|
236
|
+
d="M370-80l-16-128q-13-5-24.5-12T307-235l-119 50L78-375l103-78q-1-7-1-13.5v-27q0-6.5 1-13.5L78-585l110-190 119 50q11-8 23-15t24-12l16-128h220l16 128q13 5 24.5 12t22.5 15l119-50 110 190-103 78q1 7 1 13.5v27q0 6.5-2 13.5l103 78-110 190-118-50q-11 8-23 15t-24 12L590-80H370Zm112-260q58 0 99-41t41-99q0-58-41-99t-99-41q-59 0-99.5 41T342-480q0 58 40.5 99t99.5 41Z"
|
|
237
|
+
/>
|
|
238
|
+
</svg>
|
|
239
|
+
</nys-button>
|
|
240
|
+
|
|
241
|
+
<nys-button id="present-button" size="sm" label="Present">
|
|
242
|
+
<svg
|
|
243
|
+
slot="prefix-icon"
|
|
244
|
+
class="glyph"
|
|
245
|
+
viewBox="0 -960 960 960"
|
|
246
|
+
fill="currentColor"
|
|
247
|
+
aria-hidden="true"
|
|
248
|
+
>
|
|
249
|
+
<path d="M320-200v-560l440 280-440 280Z" />
|
|
250
|
+
</svg>
|
|
251
|
+
</nys-button>
|
|
252
|
+
</header>
|
|
253
|
+
|
|
254
|
+
<main class="split" id="split">
|
|
255
|
+
<section class="split__pane split__pane--editors" id="editors" aria-label="Code editors">
|
|
256
|
+
<div class="editors__layout editors__layout--tabs" id="tabs-layout">
|
|
257
|
+
<playground-tab-bar
|
|
258
|
+
project="project"
|
|
259
|
+
editor="file-editor"
|
|
260
|
+
class="editors__tabs"
|
|
261
|
+
></playground-tab-bar>
|
|
262
|
+
<playground-file-editor
|
|
263
|
+
id="file-editor"
|
|
264
|
+
project="project"
|
|
265
|
+
line-numbers
|
|
266
|
+
line-wrapping
|
|
267
|
+
class="editors__editor"
|
|
268
|
+
></playground-file-editor>
|
|
269
|
+
</div>
|
|
270
|
+
|
|
271
|
+
<div class="editors__layout editors__layout--columns" id="columns-layout" hidden>
|
|
272
|
+
<section class="column" id="column-html" data-pane="html">
|
|
273
|
+
<header class="column__header">
|
|
274
|
+
<button
|
|
275
|
+
type="button"
|
|
276
|
+
class="column__label"
|
|
277
|
+
id="column-html-label"
|
|
278
|
+
aria-expanded="true"
|
|
279
|
+
aria-controls="column-html-editor"
|
|
280
|
+
>
|
|
281
|
+
HTML
|
|
282
|
+
</button>
|
|
283
|
+
<nys-button
|
|
284
|
+
class="column__collapse"
|
|
285
|
+
id="column-html-collapse"
|
|
286
|
+
circle
|
|
287
|
+
size="sm"
|
|
288
|
+
variant="ghost"
|
|
289
|
+
icon="chevron_left"
|
|
290
|
+
label="Collapse HTML"
|
|
291
|
+
></nys-button>
|
|
292
|
+
</header>
|
|
293
|
+
<playground-file-editor
|
|
294
|
+
id="column-html-editor"
|
|
295
|
+
class="column__editor"
|
|
296
|
+
project="project"
|
|
297
|
+
filename="snippet.html"
|
|
298
|
+
line-numbers
|
|
299
|
+
line-wrapping
|
|
300
|
+
></playground-file-editor>
|
|
301
|
+
</section>
|
|
302
|
+
<section class="column" id="column-css" data-pane="css">
|
|
303
|
+
<header class="column__header">
|
|
304
|
+
<button
|
|
305
|
+
type="button"
|
|
306
|
+
class="column__label"
|
|
307
|
+
id="column-css-label"
|
|
308
|
+
aria-expanded="true"
|
|
309
|
+
aria-controls="column-css-editor"
|
|
310
|
+
>
|
|
311
|
+
CSS
|
|
312
|
+
</button>
|
|
313
|
+
<nys-button
|
|
314
|
+
class="column__collapse"
|
|
315
|
+
id="column-css-collapse"
|
|
316
|
+
circle
|
|
317
|
+
size="sm"
|
|
318
|
+
variant="ghost"
|
|
319
|
+
icon="chevron_left"
|
|
320
|
+
label="Collapse CSS"
|
|
321
|
+
></nys-button>
|
|
322
|
+
</header>
|
|
323
|
+
<playground-file-editor
|
|
324
|
+
id="column-css-editor"
|
|
325
|
+
class="column__editor"
|
|
326
|
+
project="project"
|
|
327
|
+
filename="styles.css"
|
|
328
|
+
line-numbers
|
|
329
|
+
line-wrapping
|
|
330
|
+
></playground-file-editor>
|
|
331
|
+
</section>
|
|
332
|
+
<section class="column" id="column-js" data-pane="js">
|
|
333
|
+
<header class="column__header">
|
|
334
|
+
<button
|
|
335
|
+
type="button"
|
|
336
|
+
class="column__label"
|
|
337
|
+
id="column-js-label"
|
|
338
|
+
aria-expanded="true"
|
|
339
|
+
aria-controls="column-js-editor"
|
|
340
|
+
>
|
|
341
|
+
JS
|
|
342
|
+
</button>
|
|
343
|
+
<nys-button
|
|
344
|
+
class="column__collapse"
|
|
345
|
+
id="column-js-collapse"
|
|
346
|
+
circle
|
|
347
|
+
size="sm"
|
|
348
|
+
variant="ghost"
|
|
349
|
+
icon="chevron_left"
|
|
350
|
+
label="Collapse JS"
|
|
351
|
+
></nys-button>
|
|
352
|
+
</header>
|
|
353
|
+
<playground-file-editor
|
|
354
|
+
id="column-js-editor"
|
|
355
|
+
class="column__editor"
|
|
356
|
+
project="project"
|
|
357
|
+
filename="script.js"
|
|
358
|
+
line-numbers
|
|
359
|
+
line-wrapping
|
|
360
|
+
></playground-file-editor>
|
|
361
|
+
</section>
|
|
362
|
+
</div>
|
|
363
|
+
</section>
|
|
364
|
+
|
|
365
|
+
<div
|
|
366
|
+
class="split__divider"
|
|
367
|
+
id="divider"
|
|
368
|
+
role="separator"
|
|
369
|
+
aria-orientation="horizontal"
|
|
370
|
+
aria-label="Resize the code drawer"
|
|
371
|
+
tabindex="0"
|
|
372
|
+
></div>
|
|
373
|
+
|
|
374
|
+
<section class="split__pane split__pane--preview" aria-label="Live preview">
|
|
375
|
+
<playground-preview
|
|
376
|
+
id="preview"
|
|
377
|
+
project="project"
|
|
378
|
+
html-file="index.html"
|
|
379
|
+
class="preview"
|
|
380
|
+
></playground-preview>
|
|
381
|
+
<nys-button
|
|
382
|
+
class="preview__build"
|
|
383
|
+
id="build-button"
|
|
384
|
+
size="sm"
|
|
385
|
+
variant="outline"
|
|
386
|
+
label="Update preview"
|
|
387
|
+
prefixIcon="refresh"
|
|
388
|
+
hidden
|
|
389
|
+
></nys-button>
|
|
390
|
+
</section>
|
|
391
|
+
</main>
|
|
392
|
+
|
|
393
|
+
<div class="notes" id="notes" role="dialog" aria-labelledby="notes-heading" hidden>
|
|
394
|
+
<h2 class="notes__heading" id="notes-heading">Presenter notes</h2>
|
|
395
|
+
<div class="notes__body" id="notes-body"></div>
|
|
396
|
+
<nys-button
|
|
397
|
+
id="notes-close"
|
|
398
|
+
size="sm"
|
|
399
|
+
variant="ghost"
|
|
400
|
+
label="Close notes"
|
|
401
|
+
prefixIcon="close"
|
|
402
|
+
></nys-button>
|
|
403
|
+
</div>
|
|
404
|
+
|
|
405
|
+
<footer class="caption" id="caption" tabindex="-1">
|
|
406
|
+
<div class="caption__left">
|
|
407
|
+
<nys-button
|
|
408
|
+
inverted
|
|
409
|
+
id="prev-button"
|
|
410
|
+
size="sm"
|
|
411
|
+
variant="outline"
|
|
412
|
+
circle
|
|
413
|
+
icon="chevron_left"
|
|
414
|
+
label="Previous slide"
|
|
415
|
+
></nys-button>
|
|
416
|
+
<div class="caption__headline">
|
|
417
|
+
<p class="caption__title">
|
|
418
|
+
<span class="present-only">
|
|
419
|
+
<span class="caption__group" id="caption-group"></span>
|
|
420
|
+
<span id="caption-title"></span>
|
|
421
|
+
</span>
|
|
422
|
+
<span class="caption__picker edit-only">
|
|
423
|
+
<select class="caption__select" id="slide-picker" aria-label="Go to slide"></select>
|
|
424
|
+
<nys-icon class="caption__picker-icon" name="chevron_down" size="sm"></nys-icon>
|
|
425
|
+
</span>
|
|
426
|
+
<span class="caption__count caption__count--inline" data-count></span>
|
|
427
|
+
</p>
|
|
428
|
+
<p class="caption__description" id="caption-description"></p>
|
|
429
|
+
</div>
|
|
430
|
+
</div>
|
|
431
|
+
|
|
432
|
+
<div class="caption__center">
|
|
433
|
+
<span class="caption__home" aria-hidden="true">
|
|
434
|
+
<svg
|
|
435
|
+
class="caption__mark"
|
|
436
|
+
viewBox="13 3 205 205"
|
|
437
|
+
fill="currentColor"
|
|
438
|
+
aria-hidden="true"
|
|
439
|
+
focusable="false"
|
|
440
|
+
>
|
|
441
|
+
<path
|
|
442
|
+
d="M89.6599 110.894L56.3349 77.5558V48.4713H172.629L217.285 93.4372C211.299 42.5111 168.016 3 115.5 3C58.8907 3 13 48.908 13 105.538C13 128.627 20.6323 149.93 33.5051 167.07"
|
|
443
|
+
/>
|
|
444
|
+
<path
|
|
445
|
+
d="M172.629 48.3945V164.733H143.556V98.0323L54.072 187.55C71.191 200.39 92.4567 208 115.5 208C172.109 208 218 162.092 218 105.462C218 101.356 217.731 97.3158 217.262 93.3366L172.629 48.3945Z"
|
|
446
|
+
/>
|
|
447
|
+
<path d="M56.3291 77.5552H122.979L89.6541 110.893L56.3291 77.5552Z" />
|
|
448
|
+
</svg>
|
|
449
|
+
</span>
|
|
450
|
+
</div>
|
|
451
|
+
|
|
452
|
+
<div class="caption__right">
|
|
453
|
+
<p class="caption__count" id="caption-count" data-count></p>
|
|
454
|
+
<div class="caption__actions">
|
|
455
|
+
<nys-button
|
|
456
|
+
class="edit-only deck-only"
|
|
457
|
+
inverted
|
|
458
|
+
id="add-slide-button"
|
|
459
|
+
size="sm"
|
|
460
|
+
variant="outline"
|
|
461
|
+
label="Add slide"
|
|
462
|
+
prefixIcon="add"
|
|
463
|
+
></nys-button>
|
|
464
|
+
<nys-button
|
|
465
|
+
class="edit-only deck-only"
|
|
466
|
+
inverted
|
|
467
|
+
id="slide-settings-button"
|
|
468
|
+
size="sm"
|
|
469
|
+
variant="ghost"
|
|
470
|
+
label="Slide settings"
|
|
471
|
+
prefixIcon="edit_square"
|
|
472
|
+
></nys-button>
|
|
473
|
+
<nys-button
|
|
474
|
+
class="edit-only deck-only"
|
|
475
|
+
inverted
|
|
476
|
+
id="move-slide-back-button"
|
|
477
|
+
size="sm"
|
|
478
|
+
variant="ghost"
|
|
479
|
+
circle
|
|
480
|
+
icon="arrow_back"
|
|
481
|
+
label="Move slide earlier"
|
|
482
|
+
></nys-button>
|
|
483
|
+
<nys-button
|
|
484
|
+
class="edit-only deck-only"
|
|
485
|
+
inverted
|
|
486
|
+
id="move-slide-forward-button"
|
|
487
|
+
size="sm"
|
|
488
|
+
variant="ghost"
|
|
489
|
+
circle
|
|
490
|
+
icon="arrow_forward"
|
|
491
|
+
label="Move slide later"
|
|
492
|
+
></nys-button>
|
|
493
|
+
<nys-button
|
|
494
|
+
class="edit-only deck-only"
|
|
495
|
+
inverted
|
|
496
|
+
id="duplicate-slide-button"
|
|
497
|
+
size="sm"
|
|
498
|
+
variant="ghost"
|
|
499
|
+
circle
|
|
500
|
+
icon="content_copy"
|
|
501
|
+
label="Duplicate slide"
|
|
502
|
+
></nys-button>
|
|
503
|
+
<nys-button
|
|
504
|
+
class="edit-only deck-only"
|
|
505
|
+
inverted
|
|
506
|
+
id="delete-slide-button"
|
|
507
|
+
size="sm"
|
|
508
|
+
variant="ghost"
|
|
509
|
+
circle
|
|
510
|
+
icon="delete"
|
|
511
|
+
label="Delete slide"
|
|
512
|
+
></nys-button>
|
|
513
|
+
<nys-tooltip class="present-only" for="exit-present-button" text="Edit slides" inverted></nys-tooltip>
|
|
514
|
+
<nys-button
|
|
515
|
+
class="present-only"
|
|
516
|
+
inverted
|
|
517
|
+
id="exit-present-button"
|
|
518
|
+
size="sm"
|
|
519
|
+
variant="ghost"
|
|
520
|
+
circle
|
|
521
|
+
icon="edit_square"
|
|
522
|
+
label="Edit slides"
|
|
523
|
+
></nys-button>
|
|
524
|
+
<nys-tooltip class="caption__notes" for="notes-button" text="Presenter notes" inverted></nys-tooltip>
|
|
525
|
+
<nys-button
|
|
526
|
+
class="caption__notes"
|
|
527
|
+
inverted
|
|
528
|
+
id="notes-button"
|
|
529
|
+
size="sm"
|
|
530
|
+
variant="ghost"
|
|
531
|
+
circle
|
|
532
|
+
icon="info"
|
|
533
|
+
label="Presenter notes"
|
|
534
|
+
></nys-button>
|
|
535
|
+
<nys-tooltip class="present-only" for="reset-slide-button" text="Reset slide" inverted></nys-tooltip>
|
|
536
|
+
<nys-button
|
|
537
|
+
class="present-only"
|
|
538
|
+
inverted
|
|
539
|
+
id="reset-slide-button"
|
|
540
|
+
size="sm"
|
|
541
|
+
variant="ghost"
|
|
542
|
+
circle
|
|
543
|
+
icon="refresh"
|
|
544
|
+
label="Reset slide"
|
|
545
|
+
></nys-button>
|
|
546
|
+
<nys-tooltip class="present-only" for="present-settings-button" text="Settings" inverted></nys-tooltip>
|
|
547
|
+
<nys-button
|
|
548
|
+
class="present-only"
|
|
549
|
+
inverted
|
|
550
|
+
id="present-settings-button"
|
|
551
|
+
size="sm"
|
|
552
|
+
variant="ghost"
|
|
553
|
+
circle
|
|
554
|
+
icon="more_vert"
|
|
555
|
+
label="Settings"
|
|
556
|
+
></nys-button>
|
|
557
|
+
</div>
|
|
558
|
+
<nys-button
|
|
559
|
+
inverted
|
|
560
|
+
id="next-button"
|
|
561
|
+
size="sm"
|
|
562
|
+
variant="outline"
|
|
563
|
+
circle
|
|
564
|
+
icon="chevron_right"
|
|
565
|
+
label="Next slide"
|
|
566
|
+
></nys-button>
|
|
567
|
+
</div>
|
|
568
|
+
</footer>
|
|
569
|
+
|
|
570
|
+
<p class="present-hint" id="present-hint" hidden></p>
|
|
571
|
+
|
|
572
|
+
<nys-modal id="deck-modal" heading="Deck settings" width="md">
|
|
573
|
+
<div class="settings">
|
|
574
|
+
<nys-textinput
|
|
575
|
+
id="deck-title-input"
|
|
576
|
+
label="Deck title"
|
|
577
|
+
placeholder="A name for this deck"
|
|
578
|
+
></nys-textinput>
|
|
579
|
+
<nys-textarea
|
|
580
|
+
id="deck-description-input"
|
|
581
|
+
label="Description"
|
|
582
|
+
rows="2"
|
|
583
|
+
description="One sentence. It shows on the home page and in the slide bar."
|
|
584
|
+
></nys-textarea>
|
|
585
|
+
<div class="settings__code">
|
|
586
|
+
<div class="settings__legend" id="deck-base-css-label">Base CSS</div>
|
|
587
|
+
<p class="settings__hint" id="deck-base-css-hint">
|
|
588
|
+
CSS applied to every slide in this deck, without taking up room in the CSS tab.
|
|
589
|
+
</p>
|
|
590
|
+
<playground-code-editor
|
|
591
|
+
id="deck-base-css-input"
|
|
592
|
+
class="settings__editor"
|
|
593
|
+
type="css"
|
|
594
|
+
line-numbers
|
|
595
|
+
line-wrapping
|
|
596
|
+
aria-labelledby="deck-base-css-label"
|
|
597
|
+
aria-describedby="deck-base-css-hint"
|
|
598
|
+
></playground-code-editor>
|
|
599
|
+
</div>
|
|
600
|
+
</div>
|
|
601
|
+
<div slot="actions">
|
|
602
|
+
<nys-button id="deck-modal-done" label="Done"></nys-button>
|
|
603
|
+
</div>
|
|
604
|
+
</nys-modal>
|
|
605
|
+
|
|
606
|
+
<nys-modal id="slide-modal" heading="Slide settings" width="md">
|
|
607
|
+
<div class="settings">
|
|
608
|
+
<nys-textinput id="slide-title-input" label="Title"></nys-textinput>
|
|
609
|
+
<nys-textinput
|
|
610
|
+
id="slide-group-input"
|
|
611
|
+
label="Group"
|
|
612
|
+
description="A section label, such as 1. Lock it down. Slides that share one are grouped."
|
|
613
|
+
></nys-textinput>
|
|
614
|
+
<nys-textarea id="slide-description-input" label="Description" rows="2"></nys-textarea>
|
|
615
|
+
<nys-textarea
|
|
616
|
+
id="slide-notes-input"
|
|
617
|
+
label="Presenter notes"
|
|
618
|
+
rows="4"
|
|
619
|
+
description="Shown only to you, with the n key while presenting."
|
|
620
|
+
></nys-textarea>
|
|
621
|
+
<fieldset class="settings__fieldset">
|
|
622
|
+
<legend class="settings__legend">Editors to open</legend>
|
|
623
|
+
<p class="settings__hint">
|
|
624
|
+
Applies to the side-by-side layout. Leave all three off to keep whatever is open.
|
|
625
|
+
</p>
|
|
626
|
+
<div class="nys-display-flex nys-flex-gap-300">
|
|
627
|
+
<nys-checkbox id="slide-editor-html" label="HTML" size="sm"></nys-checkbox>
|
|
628
|
+
<nys-checkbox id="slide-editor-css" label="CSS" size="sm"></nys-checkbox>
|
|
629
|
+
<nys-checkbox id="slide-editor-js" label="JS" size="sm"></nys-checkbox>
|
|
630
|
+
</div>
|
|
631
|
+
</fieldset>
|
|
632
|
+
<nys-select
|
|
633
|
+
id="slide-version-select"
|
|
634
|
+
label="Design system version"
|
|
635
|
+
width="md"
|
|
636
|
+
description="Pick latest to follow the newest release."
|
|
637
|
+
></nys-select>
|
|
638
|
+
</div>
|
|
639
|
+
<div slot="actions">
|
|
640
|
+
<nys-button id="slide-modal-done" label="Done"></nys-button>
|
|
641
|
+
</div>
|
|
642
|
+
</nys-modal>
|
|
643
|
+
|
|
644
|
+
<nys-modal id="confirm-modal" heading="Are you sure?" width="sm">
|
|
645
|
+
<p id="confirm-message"></p>
|
|
646
|
+
<div slot="actions">
|
|
647
|
+
<nys-button id="confirm-cancel" variant="outline" label="Cancel"></nys-button>
|
|
648
|
+
<nys-button id="confirm-ok" label="Delete"></nys-button>
|
|
649
|
+
</div>
|
|
650
|
+
</nys-modal>
|
|
651
|
+
|
|
652
|
+
<nys-modal id="leave-modal" heading="Leave the scratch pad?" width="sm">
|
|
653
|
+
<p>Your edits aren't saved anywhere yet.</p>
|
|
654
|
+
<div slot="actions">
|
|
655
|
+
<nys-button id="leave-stay" variant="outline" label="Stay"></nys-button>
|
|
656
|
+
<nys-button id="leave-discard" variant="outline" label="Leave"></nys-button>
|
|
657
|
+
<nys-button id="leave-save" label="Save as deck"></nys-button>
|
|
658
|
+
</div>
|
|
659
|
+
</nys-modal>
|
|
660
|
+
|
|
661
|
+
<nys-modal id="share-modal" heading="Share" width="md">
|
|
662
|
+
<p class="share__lede">
|
|
663
|
+
A deck link points at a deck in this browser. A standalone link carries the code
|
|
664
|
+
itself, so it opens anywhere.
|
|
665
|
+
</p>
|
|
666
|
+
<div class="nys-display-flex nys-flex-column nys-flex-gap-200">
|
|
667
|
+
<nys-button
|
|
668
|
+
id="share-deck-link"
|
|
669
|
+
variant="outline"
|
|
670
|
+
label="Copy link to this slide (works in this browser)"
|
|
671
|
+
prefixIcon="link"
|
|
672
|
+
></nys-button>
|
|
673
|
+
<nys-button
|
|
674
|
+
id="share-code-link"
|
|
675
|
+
label="Copy standalone link"
|
|
676
|
+
prefixIcon="link"
|
|
677
|
+
></nys-button>
|
|
678
|
+
</div>
|
|
679
|
+
<div slot="actions">
|
|
680
|
+
<nys-button id="share-modal-done" label="Done"></nys-button>
|
|
681
|
+
</div>
|
|
682
|
+
</nys-modal>
|
|
683
|
+
|
|
684
|
+
<nys-modal id="settings-modal" heading="Settings" width="md">
|
|
685
|
+
<div class="settings">
|
|
686
|
+
<nys-toggle
|
|
687
|
+
id="theme-toggle"
|
|
688
|
+
class="settings__field"
|
|
689
|
+
size="sm"
|
|
690
|
+
label="Dark editor"
|
|
691
|
+
description="Changes the code editors only. The preview always shows the design system as it is."
|
|
692
|
+
name="editor-theme"
|
|
693
|
+
value="dark"
|
|
694
|
+
></nys-toggle>
|
|
695
|
+
|
|
696
|
+
<nys-toggle
|
|
697
|
+
id="columns-toggle"
|
|
698
|
+
class="settings__field"
|
|
699
|
+
size="sm"
|
|
700
|
+
label="Side by side editors"
|
|
701
|
+
description="Shows HTML, CSS, and JavaScript in three columns. Turn it off for one tabbed editor."
|
|
702
|
+
name="editor-layout"
|
|
703
|
+
value="columns"
|
|
704
|
+
></nys-toggle>
|
|
705
|
+
|
|
706
|
+
<nys-select
|
|
707
|
+
id="font-size-select"
|
|
708
|
+
class="settings__field"
|
|
709
|
+
width="md"
|
|
710
|
+
label="Editor font size"
|
|
711
|
+
>
|
|
712
|
+
<option value="small" label="Small (13px)"></option>
|
|
713
|
+
<option value="medium" label="Medium (15px)"></option>
|
|
714
|
+
<option value="large" label="Large (18px)"></option>
|
|
715
|
+
</nys-select>
|
|
716
|
+
|
|
717
|
+
<nys-select
|
|
718
|
+
id="update-mode-select"
|
|
719
|
+
class="settings__field"
|
|
720
|
+
width="lg"
|
|
721
|
+
label="Update preview"
|
|
722
|
+
description="How soon an edit reaches the preview. Cmd or Ctrl plus Enter updates it at once."
|
|
723
|
+
>
|
|
724
|
+
<option value="typing" label="While typing"></option>
|
|
725
|
+
<option value="pause" label="After a longer pause"></option>
|
|
726
|
+
<option value="manual" label="Manually"></option>
|
|
727
|
+
</nys-select>
|
|
728
|
+
|
|
729
|
+
<nys-toggle
|
|
730
|
+
id="prerelease-toggle"
|
|
731
|
+
class="settings__field"
|
|
732
|
+
size="sm"
|
|
733
|
+
label="Show prerelease versions"
|
|
734
|
+
name="prereleases"
|
|
735
|
+
value="on"
|
|
736
|
+
></nys-toggle>
|
|
737
|
+
|
|
738
|
+
<nys-button
|
|
739
|
+
id="reset-settings-button"
|
|
740
|
+
class="settings__reset"
|
|
741
|
+
size="sm"
|
|
742
|
+
variant="outline"
|
|
743
|
+
label="Reset settings"
|
|
744
|
+
prefixIcon="refresh"
|
|
745
|
+
></nys-button>
|
|
746
|
+
</div>
|
|
747
|
+
<div slot="actions">
|
|
748
|
+
<nys-button id="settings-done-button" label="Done"></nys-button>
|
|
749
|
+
</div>
|
|
750
|
+
</nys-modal>
|
|
751
|
+
|
|
752
|
+
<div class="deck-missing" id="deck-missing" hidden>
|
|
753
|
+
<nys-alert
|
|
754
|
+
type="warning"
|
|
755
|
+
heading="Deck not found"
|
|
756
|
+
text="That deck is not in this browser. Decks are stored per browser, so a deck link only opens where it was made."
|
|
757
|
+
></nys-alert>
|
|
758
|
+
<nys-button id="deck-missing-home" label="Go home" prefixIcon="arrow_back"></nys-button>
|
|
759
|
+
</div>
|
|
760
|
+
|
|
761
|
+
<div class="toast" id="toast" role="status" aria-live="polite" hidden></div>
|
|
762
|
+
</div>
|
|
763
|
+
|
|
764
|
+
<playground-project id="project"></playground-project>
|
|
765
|
+
|
|
766
|
+
<script type="module" src="./src/main.ts"></script>
|
|
767
|
+
</body>
|
|
768
|
+
</html>
|