@plitzi/sdk-authoring 0.38.6 → 0.38.8

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.
Files changed (29) hide show
  1. package/CHANGELOG.md +381 -0
  2. package/dist/index-src.js +26687 -0
  3. package/dist/index.d.ts +1174 -367
  4. package/dist/index.js +2 -24803
  5. package/dist/node.d.ts +2820 -0
  6. package/dist/node.js +610 -13
  7. package/package.json +7 -7
  8. package/skills/plitzi-authoring/CHEATSHEET.md +2 -2
  9. package/skills/plitzi-authoring/SKILL.md +34 -148
  10. package/skills/plitzi-authoring/recipes/plugin.ts +1 -1
  11. package/skills/plitzi-authoring/reference/accessibility.md +3 -4
  12. package/skills/plitzi-authoring/reference/auth.md +75 -0
  13. package/skills/plitzi-authoring/reference/authoring-errors.md +19 -4
  14. package/skills/plitzi-authoring/reference/colours-and-motion.md +3 -2
  15. package/skills/plitzi-authoring/reference/drawing.md +1 -1
  16. package/skills/plitzi-authoring/reference/efficiency.md +5 -2
  17. package/skills/plitzi-authoring/reference/elements-and-styles.md +23 -23
  18. package/skills/plitzi-authoring/reference/flows.md +15 -8
  19. package/skills/plitzi-authoring/reference/index.md +33 -0
  20. package/skills/plitzi-authoring/reference/layouts.md +15 -18
  21. package/skills/plitzi-authoring/reference/plugins.md +3 -3
  22. package/skills/plitzi-authoring/reference/recipes.md +25 -0
  23. package/skills/plitzi-authoring/reference/review-checklist.md +2 -1
  24. package/skills/plitzi-authoring/reference/rules.md +61 -0
  25. package/skills/plitzi-authoring/reference/snippets-and-export.md +2 -2
  26. package/skills/plitzi-authoring/reference/structure.md +4 -3
  27. package/skills/plitzi-authoring/reference/testing.md +1 -1
  28. package/skills/plitzi-authoring/reference/validation.md +1 -1
  29. package/dist/index-compactSvg.js +0 -16
package/dist/node.d.ts CHANGED
@@ -1,3 +1,1173 @@
1
+ /**
2
+ * Who may start a run through ONE way in. Resolved against the auth kernel — never re-implemented here.
3
+ *
4
+ * It belongs to the trigger and not to the action, because the two are different questions: a webhook is reachable
5
+ * by anyone who learns its URL and is gated on its signature, while the same flow called from a page may well
6
+ * require a session. Stating it once for the action forced the loosest of its ways in onto all of them.
7
+ *
8
+ * There is no implicit default: a trigger that declares no access is refused at save time rather than falling back
9
+ * to something a reader has to guess at.
10
+ */
11
+ declare type ActionAccess =
12
+ /** Anyone, including an anonymous visitor. Implicit for a webhook; anywhere else it is a deliberate choice. */
13
+ {
14
+ mode: 'public';
15
+ }
16
+ /** Any request carrying a valid session for this space. */
17
+ | {
18
+ mode: 'session';
19
+ }
20
+ /** A session holding every one of these space permissions. */
21
+ | {
22
+ mode: 'role';
23
+ permissions: string[];
24
+ };
25
+
26
+ /** What one ancestor condition changes: inside it always, in its states, or in its variants (and their states). */
27
+ declare interface AncestorSpec {
28
+ css?: CssSpec;
29
+ states?: StatesSpec;
30
+ variants?: Record<string, CssSpec | VariantSpec>;
31
+ }
32
+
33
+ declare interface AuthoredSpace {
34
+ schema: Schema;
35
+ style: Style;
36
+ /**
37
+ * What an end-to-end suite addresses this space by — every page and element, under the id it was actually given.
38
+ *
39
+ * Returned rather than looked up from the document afterwards, because a spec that leaves an id out is given a
40
+ * derived one, and only the author knows what it minted. See `./handles`.
41
+ */
42
+ handles: SpaceHandles;
43
+ /**
44
+ * What the document validator had to say that was not fatal — a page with no default, a variable nothing reads.
45
+ * Returned rather than printed: a seed may log them, a test may assert on them, and a build may treat them as
46
+ * errors of its own.
47
+ */
48
+ warnings: SchemaValidationError[];
49
+ /**
50
+ * A shorter way to the same page — a layout for a header on every page, a component for cards written ten times, an
51
+ * element's own `content` — ranked by the elements each would save. Not a problem: nothing here is wrong. See
52
+ * `suggestSpace`.
53
+ */
54
+ suggestions: Suggestion[];
55
+ }
56
+
57
+ declare const AUTHORING_CODES: {
58
+ readonly 'no-pages': {
59
+ readonly kind: "refused";
60
+ readonly means: "a space with no pages";
61
+ readonly fix: "`pages: [{ id: 'home', name: 'Home', slug: '', body: [] }]`";
62
+ };
63
+ readonly 'setting-misplaced': {
64
+ readonly kind: "refused";
65
+ readonly means: "`settings.computed` or `settings.channels` written inside `settings`";
66
+ readonly fix: "`computed` and `channels` at the top of the space";
67
+ };
68
+ readonly 'state-key-list': {
69
+ readonly kind: "refused";
70
+ readonly means: "`settings.transientState` / `paintedState` that is not a list of top-level state keys";
71
+ readonly fix: "`transientState: ['demoStep']` — a dotted path names its top key";
72
+ };
73
+ readonly 'state-painted-and-transient': {
74
+ readonly kind: "refused";
75
+ readonly means: "a state key both painted (kept for the server) and transient (never kept)";
76
+ readonly fix: "remove it from one of the two";
77
+ };
78
+ readonly 'transient-state-without-keep-state': {
79
+ readonly kind: "warned";
80
+ readonly means: "`transientState` without `keepState` — nothing is kept in the first place";
81
+ readonly fix: "`settings.keepState: true`, or remove `transientState`";
82
+ };
83
+ readonly 'painted-state-without-keep-state': {
84
+ readonly kind: "warned";
85
+ readonly means: "`paintedState` without `keepState` — nothing is kept for the server to draw with";
86
+ readonly fix: "`settings.keepState: true`, or remove `paintedState`";
87
+ };
88
+ readonly 'visitor-roles': {
89
+ readonly kind: "refused";
90
+ readonly means: "`settings.visitorRoles` written in a shape the runtime does not read";
91
+ readonly fix: "the shape the message gives";
92
+ };
93
+ readonly 'font-invalid': {
94
+ readonly kind: "refused";
95
+ readonly means: "a font the space cannot load as declared";
96
+ readonly fix: "the field the message names";
97
+ };
98
+ readonly 'notifications-shape': {
99
+ readonly kind: "refused";
100
+ readonly means: "`notifications` with a field it does not have, or a value that is not one CSS value";
101
+ readonly fix: "the field it suggests, or one it lists; one CSS value, like 'var(--card)', '12px' or '500'";
102
+ };
103
+ readonly 'unknown-field': {
104
+ readonly kind: "refused";
105
+ readonly means: "a field the space, a page, an element, a binding or a step does not have";
106
+ readonly fix: "the field it suggests; an element's attribute goes inside the factory's props (`button({ content })`)";
107
+ };
108
+ readonly 'page-without-slug': {
109
+ readonly kind: "refused";
110
+ readonly means: "a page with no `slug`";
111
+ readonly fix: "`slug: ''` for the home page, its path for any other: `'about'`, `'blog/:slug'`";
112
+ };
113
+ readonly 'page-route-taken': {
114
+ readonly kind: "refused";
115
+ readonly means: "two pages at one address for the same visitors";
116
+ readonly fix: "another slug — or `accessLevel` `'public'` on one and `'authenticated'` on the other";
117
+ };
118
+ readonly 'page-route-reserved': {
119
+ readonly kind: "refused";
120
+ readonly means: "a page under `/fn`, where the space's functions answer";
121
+ readonly fix: "another slug";
122
+ };
123
+ readonly 'page-access-level': {
124
+ readonly kind: "refused";
125
+ readonly means: "an `accessLevel` that is not one the router reads";
126
+ readonly fix: "one of the values the message lists";
127
+ };
128
+ readonly 'page-target-unknown': {
129
+ readonly kind: "refused";
130
+ readonly means: "a link or `navigate` to a page id that does not exist";
131
+ readonly fix: "an existing page id, or a path with its slash (`'/about'`)";
132
+ };
133
+ readonly 'page-target-url': {
134
+ readonly kind: "refused";
135
+ readonly means: "a URL, `mailto:` or `tel:` in a link left in page mode";
136
+ readonly fix: "`mode: 'external'`";
137
+ };
138
+ readonly 'redirect-target-unknown': {
139
+ readonly kind: "refused";
140
+ readonly means: "a page that sends visitors it is not for to a page the space does not have";
141
+ readonly fix: "a page's id or slug (`''` is the home page), or a full URL";
142
+ };
143
+ readonly 'folder-undeclared': {
144
+ readonly kind: "refused";
145
+ readonly means: "a page, a layout or a folder filed in a folder the space does not declare";
146
+ readonly fix: "declare the folder, or the name it suggests";
147
+ };
148
+ readonly 'folder-cycle': {
149
+ readonly kind: "refused";
150
+ readonly means: "a page folder inside itself";
151
+ readonly fix: "a `parent` that leads to the top";
152
+ };
153
+ readonly 'layout-undeclared': {
154
+ readonly kind: "refused";
155
+ readonly means: "a page or a layout inside a layout the space does not declare";
156
+ readonly fix: "the layout's id, or declare it in `layouts`";
157
+ };
158
+ readonly 'layout-slot-unknown': {
159
+ readonly kind: "refused";
160
+ readonly means: "a layout `slot` that is not an element inside that layout";
161
+ readonly fix: "the id of the element in the shell where the body goes";
162
+ };
163
+ readonly 'motion-invalid': {
164
+ readonly kind: "refused";
165
+ readonly means: "a `motion` with a preset, a trigger or a timing the page cannot play";
166
+ readonly fix: "`motion: { enter: 'fade-up', on: 'view' }` — the message lists the presets";
167
+ };
168
+ readonly 'motion-no-tag': {
169
+ readonly kind: "refused";
170
+ readonly means: "a `motion` on an element with no tag of its own — nothing to move";
171
+ readonly fix: "the motion on what it wraps, or a `subType` on it";
172
+ };
173
+ readonly 'anchor-invalid': {
174
+ readonly kind: "refused";
175
+ readonly means: "an `anchor` or a link's `hash` that is not lowercase letters, digits and `-`";
176
+ readonly fix: "`anchor: 'plans'`, `hash: 'plans'` — no `#`";
177
+ };
178
+ readonly 'anchor-no-tag': {
179
+ readonly kind: "refused";
180
+ readonly means: "an anchor on an element that renders no element of its own";
181
+ readonly fix: "the anchor on the element around it, or `subType: 'div'` on the provider";
182
+ };
183
+ readonly 'anchor-repeated': {
184
+ readonly kind: "refused";
185
+ readonly means: "an anchor inside a list row or a component — it would be in the page once per row or instance";
186
+ readonly fix: "the anchor on the list, or on the element around the instance";
187
+ };
188
+ readonly 'anchor-duplicate': {
189
+ readonly kind: "refused";
190
+ readonly means: "one anchor on two elements of the same page (layouts included)";
191
+ readonly fix: "rename all but one";
192
+ };
193
+ readonly 'anchor-missing': {
194
+ readonly kind: "refused";
195
+ readonly means: "a link whose `hash` no element on the page it goes to carries — it would land at the top";
196
+ readonly fix: "the anchor the message lists, or give the section that `anchor`";
197
+ };
198
+ readonly 'link-current-section': {
199
+ readonly kind: "warned";
200
+ readonly means: "`current: 'section'` on a link that is never current (an external one) or current everywhere (to `/`)";
201
+ readonly fix: "leave `current` out — `'section'` is for a link to a section's own page, `/automations/runs`";
202
+ };
203
+ readonly 'id-invalid': {
204
+ readonly kind: "refused";
205
+ readonly means: "an id a binding, a template or a test cannot name";
206
+ readonly fix: "a letter first, then letters, digits, `-` and `_`: `'hero-title'`";
207
+ };
208
+ readonly 'controls-no-anchor': {
209
+ readonly kind: "warned";
210
+ readonly means: "a button's `controls` naming no anchor — `aria-controls` points at nothing";
211
+ readonly fix: "an `anchor` on the element it shows and hides, and `controls` naming it";
212
+ };
213
+ readonly 'quiet-unknown': {
214
+ readonly kind: "refused";
215
+ readonly means: "an element's `quiet` naming something that is not a suggestion's code — a problem is never quieted";
216
+ readonly fix: "the code of the suggestion it was offered: `quiet: ['repeated-shape']`";
217
+ };
218
+ readonly 'controls-unknown': {
219
+ readonly kind: "refused";
220
+ readonly means: "a button's `controls` naming no element of the space";
221
+ readonly fix: "the id of the element it shows and hides: `controls: 'faq-answer'`";
222
+ };
223
+ readonly 'id-taken': {
224
+ readonly kind: "refused";
225
+ readonly means: "two elements with one id — ids are one namespace for the whole space";
226
+ readonly fix: "a name taken by a page or a layout: a name of its own; a helper called twice: `scope('promos', ref => …)`, every id inside prefixed";
227
+ };
228
+ readonly 'id-shadows-global': {
229
+ readonly kind: "refused";
230
+ readonly means: "an element named like a global data source (`state`, `navigation`, `auth`…)";
231
+ readonly fix: "another id";
232
+ };
233
+ readonly 'class-undeclared': {
234
+ readonly kind: "refused";
235
+ readonly means: "a class name the space does not declare";
236
+ readonly fix: "declare it in `classes`, hand the `styles()` declaration itself, or write the rules with `css`";
237
+ };
238
+ readonly 'element-slot-unknown': {
239
+ readonly kind: "refused";
240
+ readonly means: "a `slots` key the element type does not have — its class would dress nothing";
241
+ readonly fix: "one of the slots `plitzi explain <type>` lists; the element itself takes `class`";
242
+ };
243
+ readonly 'class-conflict': {
244
+ readonly kind: "refused";
245
+ readonly means: "two different declarations for one class name";
246
+ readonly fix: "rename one, or make them agree";
247
+ };
248
+ readonly 'class-listed-under-other-name': {
249
+ readonly kind: "refused";
250
+ readonly means: "a `styles()` declaration listed in `classes` under another name";
251
+ readonly fix: "list it under its own name";
252
+ };
253
+ readonly 'class-and-css': {
254
+ readonly kind: "refused";
255
+ readonly means: "an element wearing a shared class AND `css` or `states` of its own — it has one base selector";
256
+ readonly fix: "the rules on top of the class: `class: [card, { opacity: '0.5' }]` (needs an `id`) — or into the class";
257
+ };
258
+ readonly 'class-and-selector': {
259
+ readonly kind: "refused";
260
+ readonly means: "an element with a shared class and a `selector` of its own";
261
+ readonly fix: "drop one: a shared class IS its selector";
262
+ };
263
+ readonly 'modifier-count': {
264
+ readonly kind: "refused";
265
+ readonly means: "more than one set of rules in a class list";
266
+ readonly fix: "one set, after the classes: `class: [card, { opacity: '0.5', 'margin-top': '8px' }]`";
267
+ };
268
+ readonly 'modifier-without-id': {
269
+ readonly kind: "refused";
270
+ readonly means: "rules on top of a class on an element with no `id` — the id names the class they become";
271
+ readonly fix: "`id: 'hero-bg'`";
272
+ };
273
+ readonly 'selector-invalid': {
274
+ readonly kind: "refused";
275
+ readonly means: "a `selector` that is not a CSS class name";
276
+ readonly fix: "letters, digits, `-` and `_`";
277
+ };
278
+ readonly 'selector-taken': {
279
+ readonly kind: "refused";
280
+ readonly means: "a `selector` that is a declared class, or another element's";
281
+ readonly fix: "`class` to share rules; a selector of an element's own is its alone";
282
+ };
283
+ readonly 'css-value': {
284
+ readonly kind: "refused";
285
+ readonly means: "an empty CSS value, or one with `;` or `{}`";
286
+ readonly fix: "one value per property; leave a property out instead of writing it empty";
287
+ };
288
+ readonly 'css-property-twice': {
289
+ readonly kind: "refused";
290
+ readonly means: "one property written twice in a rule set — `paddingTop` beside `'padding-top'` — so one would silently win";
291
+ readonly fix: "keep one";
292
+ };
293
+ readonly 'css-property-unknown': {
294
+ readonly kind: "refused";
295
+ readonly means: "a CSS property that does not exist";
296
+ readonly fix: "the property it suggests; a custom property starts with `--`";
297
+ };
298
+ readonly UNKNOWN_CSS_PROPERTY: {
299
+ readonly kind: "refused";
300
+ readonly means: "a property in the style document the style editor cannot read back";
301
+ readonly fix: "the property it suggests";
302
+ };
303
+ readonly 'rule-set-mixed': {
304
+ readonly kind: "refused";
305
+ readonly means: "a style that writes its rules beside `states`, `variants` or `ancestors` instead of under `css`";
306
+ readonly fix: "`{ css: { desktop: { … } }, states: { hover: { … } } }` — the rules under `css`, each of the others beside it";
307
+ };
308
+ readonly 'style-state-unknown': {
309
+ readonly kind: "refused";
310
+ readonly means: "a state a selector does not react to";
311
+ readonly fix: "one of the states it lists (`hover`, `focus`, `active`…)";
312
+ };
313
+ readonly 'ancestor-not-class': {
314
+ readonly kind: "refused";
315
+ readonly means: "an ancestor condition keyed by something that is neither a class name nor `'>'` (the parent)";
316
+ readonly fix: "`[card.name]` for a `styles()` declaration, or `'>'` for the parent whatever it wears";
317
+ };
318
+ readonly 'heading-level-overridden': {
319
+ readonly kind: "warned";
320
+ readonly means: "a markdown's or richText's `heading` slot and a level's (`heading3`) both setting one property, the general class written later in the stylesheet — the level's value is lost";
321
+ readonly fix: "set the property on one of the two: the level slot for that level alone, `heading` for every heading";
322
+ };
323
+ readonly 'style-pseudo-unknown': {
324
+ readonly kind: "refused";
325
+ readonly means: "a pseudo-element a class cannot dress";
326
+ readonly fix: "one of `before`, `after`, `marker`, `placeholder`, `first-letter`, `first-line`, `selection` — without the `::`";
327
+ };
328
+ readonly 'style-pseudo-property': {
329
+ readonly kind: "refused";
330
+ readonly means: "a property the pseudo-element ignores — the browser drops it without a word";
331
+ readonly fix: "one it honours (`::selection` paints, `::marker` and `::placeholder` take text and font), or style the element";
332
+ };
333
+ readonly 'style-pseudo-content': {
334
+ readonly kind: "refused";
335
+ readonly means: "a `content` CSS cannot read — text without its quotes draws nothing — or a `before`/`after` with no `content`, which is not there at all";
336
+ readonly fix: "the text in quotes inside the string — `content: '\"→\"'`, `'\"\"'` for an empty box — or a function such as `counter(step)`";
337
+ };
338
+ readonly 'style-condition-unknown': {
339
+ readonly kind: "refused";
340
+ readonly means: "a condition a class's rules cannot hold under";
341
+ readonly fix: "`motion-reduce`, `motion-safe`, or a container width — `container (max-width: 30rem)`, `container card (min-width: 480px)`";
342
+ };
343
+ readonly 'keyframes-shape': {
344
+ readonly kind: "refused";
345
+ readonly means: "keyframes with a name CSS does not accept or the SDK keeps for itself, or a frame that is not an offset";
346
+ readonly fix: "a plain name (`slide-in`), frames keyed `from`, `to` or a percentage (`'50%'`, `'0%, 100%'`)";
347
+ };
348
+ readonly 'animation-name-unknown': {
349
+ readonly kind: "warned";
350
+ readonly means: "`animation-name` naming keyframes the space does not declare — nothing plays";
351
+ readonly fix: "declare them in the space's `keyframes`, or name one it has";
352
+ };
353
+ readonly 'tablet-rule-skips-mobile': {
354
+ readonly kind: "warned";
355
+ readonly means: "a tablet rule phones never get — mobile inherits desktop, not tablet";
356
+ readonly fix: "write it under `compact` (tablet and mobile together)";
357
+ };
358
+ readonly 'tw-unknown-class': {
359
+ readonly kind: "refused";
360
+ readonly means: "a class `tw()` does not know as Tailwind";
361
+ readonly fix: "the class it suggests; a colour of the space through `createTw({ colors })`; any CSS as `[property:value]`";
362
+ };
363
+ readonly 'tw-no-equivalent': {
364
+ readonly kind: "refused";
365
+ readonly means: "a Tailwind class or variant with no exact equivalent in a Plitzi style (`sm:`, `dark:`, `space-x-4`)";
366
+ readonly fix: "what the message names: `md:`/`lg:`/`max-md:`/`max-lg:`, a token with both themes, `gap`";
367
+ };
368
+ readonly 'tw-class-conflict': {
369
+ readonly kind: "refused";
370
+ readonly means: "two classes set the same property and neither is the narrower one (`p-2 p-4`)";
371
+ readonly fix: "keep one";
372
+ };
373
+ readonly 'unknown-variable': {
374
+ readonly kind: "warned";
375
+ readonly means: "a `var(--x)` nothing in the space declares — the property it is in is dropped";
376
+ readonly fix: "declare it under `variables`, fix the name, or give it a fallback: `var(--x, …)`";
377
+ };
378
+ readonly 'colour-without-dark': {
379
+ readonly kind: "warned";
380
+ readonly means: "a colour token with no dark value";
381
+ readonly fix: "`{ light, dark, default }`";
382
+ };
383
+ readonly STYLE_WITHOUT_TAG: {
384
+ readonly kind: "warned";
385
+ readonly means: "style on a provider that renders no element of its own";
386
+ readonly fix: "`subType: 'div'` on the provider, or style its parent";
387
+ };
388
+ readonly 'element-shape': {
389
+ readonly kind: "refused";
390
+ readonly means: "an element that is not an object with a `type`, `attributes` and a list of `children`";
391
+ readonly fix: "build elements with their factories — `text(…)`, `container(…)`";
392
+ };
393
+ readonly 'element-rejected': {
394
+ readonly kind: "refused";
395
+ readonly means: "an element the schema refused to hold";
396
+ readonly fix: "the problem listed with it";
397
+ };
398
+ readonly 'unknown-element-type': {
399
+ readonly kind: "warned";
400
+ readonly means: "a type no built-in element has";
401
+ readonly fix: "the built-in it suggests; a plugin's declaration goes in `authorSpace(space, { plugins: [declaration] })`";
402
+ };
403
+ readonly 'plugin-attribute-reserved': {
404
+ readonly kind: "warned";
405
+ readonly means: "a plugin attribute named as one of the element’s own fields — a factory never hands it to the plugin";
406
+ readonly fix: "rename it in the plugin (`variant` → `kind`)";
407
+ };
408
+ readonly 'unknown-variant': {
409
+ readonly kind: "warned";
410
+ readonly means: "a variant no class of the element and no style of its type declares — nothing applies";
411
+ readonly fix: "declare it (`styles(name, { variants: { … } })`), or name one that is";
412
+ };
413
+ readonly 'unknown-attribute': {
414
+ readonly kind: "refused";
415
+ readonly means: "an attribute the element does not have";
416
+ readonly fix: "one it lists; an event (`onClick`) is a flow: `flows: [[onClick(), …]]`";
417
+ };
418
+ readonly 'attribute-value': {
419
+ readonly kind: "refused";
420
+ readonly means: "a value outside the attribute's list (`subType: 'h7'`)";
421
+ readonly fix: "one of the listed values";
422
+ };
423
+ readonly 'attribute-kind': {
424
+ readonly kind: "refused";
425
+ readonly means: "text where a flag or a list is read";
426
+ readonly fix: "`disabled: true`, not `'true'`; `items: [ … ]`";
427
+ };
428
+ readonly 'element-runtime': {
429
+ readonly kind: "refused";
430
+ readonly means: "a `runtime` the element does not run in";
431
+ readonly fix: "one of the values the message lists";
432
+ };
433
+ readonly 'element-load-strategy': {
434
+ readonly kind: "refused";
435
+ readonly means: "a `loadStrategy` the element does not take";
436
+ readonly fix: "one of the values the message lists";
437
+ };
438
+ readonly 'children-in-leaf': {
439
+ readonly kind: "refused";
440
+ readonly means: "children on a type that renders only its own attributes (`heading`, `text`, `image`…)";
441
+ readonly fix: "a `container` — for a heading made of parts, `container({ subType: 'h1', children })`";
442
+ };
443
+ readonly 'span-holds-block': {
444
+ readonly kind: "warned";
445
+ readonly means: "a `container` with `subType: 'span'` or `'p'` holding a heading, a paragraph, a list, a form or prose";
446
+ readonly fix: "a `div` (leave `subType` out), or words and inline elements: a `text`, a `link`";
447
+ };
448
+ readonly 'part-missing': {
449
+ readonly kind: "refused";
450
+ readonly means: "a compound element — a carousel, a tab container, a dropdown — without a part it renders through";
451
+ readonly fix: "the part the message names, inside it (`carousel()` writes its own track)";
452
+ };
453
+ readonly 'outside-ancestor': {
454
+ readonly kind: "refused";
455
+ readonly means: "an element that reads the state of an element it is not inside";
456
+ readonly fix: "nest it in the element the message names";
457
+ };
458
+ readonly 'default-content-beside-children': {
459
+ readonly kind: "warned";
460
+ readonly means: "a button printing its default \"Button\" beside its children";
461
+ readonly fix: "`content: ''`";
462
+ };
463
+ readonly 'loading-slot-unknown': {
464
+ readonly kind: "refused";
465
+ readonly means: "an `apiContainer`'s `loadingSlot` that is not the id of one of its children";
466
+ readonly fix: "the id of the child to show until the first answer — `loadingSlot: 'catalog-skeleton'` beside that child";
467
+ };
468
+ readonly 'row-and-children': {
469
+ readonly kind: "refused";
470
+ readonly means: "a list with a `row` and `children` — the row is what it renders";
471
+ readonly fix: "one of the two";
472
+ };
473
+ readonly 'row-without-id': {
474
+ readonly kind: "refused";
475
+ readonly means: "a list whose `row` is a function, with no `id` — the row's sources are named after it";
476
+ readonly fix: "`list({ id: 'products', items, row: r => … })`";
477
+ };
478
+ readonly 'row-outside-list': {
479
+ readonly kind: "refused";
480
+ readonly means: "`row` on an element that is not a list";
481
+ readonly fix: "a `list` around it";
482
+ };
483
+ readonly 'source-field-unknown': {
484
+ readonly kind: "refused";
485
+ readonly means: "a path into a typed source that its sample does not have";
486
+ readonly fix: "read a field the sample has, or add the field to the sample";
487
+ };
488
+ readonly 'svg-not-svg': {
489
+ readonly kind: "refused";
490
+ readonly means: "an `svg` whose `content` is not one `<svg>…</svg>` — it draws nothing";
491
+ readonly fix: "the SVG markup alone; HTML around it goes in a `blockHtml`";
492
+ };
493
+ readonly 'row-component': {
494
+ readonly kind: "refused";
495
+ readonly means: "a list's `row` naming a component the space does not declare, or one with no prop to take the row";
496
+ readonly fix: "a declared component with an `item` prop — or a single prop — for the row";
497
+ };
498
+ readonly 'list-without-items': {
499
+ readonly kind: "refused";
500
+ readonly means: "a controlled list with nothing to render";
501
+ readonly fix: "`items: [ … ]` or `bind: { items: 'provider.data.rows' }`";
502
+ };
503
+ readonly 'list-row-not-li': {
504
+ readonly kind: "warned";
505
+ readonly means: "a row of a list with `items` that is not an `<li>` — that list is a `<ul>` (or `<ol>`), so the row is a box inside a list, no item to a screen reader";
506
+ readonly fix: "`container({ subType: 'li' })` — or the component's root one, or a wrapper for a link or a button";
507
+ };
508
+ readonly 'list-item-key-missing': {
509
+ readonly kind: "warned";
510
+ readonly means: "a list's `itemKey` that some of its items lack, or two of them share — the rows fall back to `id`, then position";
511
+ readonly fix: "a field every item has, once each";
512
+ };
513
+ readonly 'list-items-ignored': {
514
+ readonly kind: "refused";
515
+ readonly means: "a list whose items nothing reads — `source: 'none'` renders its children once";
516
+ readonly fix: "`source: 'controlled'`";
517
+ };
518
+ readonly 'overlay-starts-open': {
519
+ readonly kind: "warned";
520
+ readonly means: "a modal or a dialog open when the page loads";
521
+ readonly fix: "`visible: false`, opened by `openModal`";
522
+ };
523
+ readonly 'overlay-never-opened': {
524
+ readonly kind: "warned";
525
+ readonly means: "a modal or a dialog that starts hidden and that no step opens";
526
+ readonly fix: "a flow with `openModal('id')` / `openDialog('id')`";
527
+ };
528
+ readonly 'provider-without-source': {
529
+ readonly kind: "warned";
530
+ readonly means: "an `apiContainer` that asks nothing";
531
+ readonly fix: "a `query` (or `action`, `connector`, `resource`)";
532
+ };
533
+ readonly 'action-output-path': {
534
+ readonly kind: "warned";
535
+ readonly means: "a read of `.data` on a provider fed by a server action — it publishes the action’s output at its root, and `.data` is a `query` provider’s answer";
536
+ readonly fix: "the output’s own field — `apiContainer_feed.stories`, not `apiContainer_feed.data.stories`";
537
+ };
538
+ readonly 'path-not-in-data': {
539
+ readonly kind: "warned";
540
+ readonly means: "a binding onto a provider whose answer the author could read (`data`), through a path that answer does not have";
541
+ readonly fix: "the path the message lists the keys for — `p.data.plans`, not `p.data.landing.plans`";
542
+ };
543
+ readonly 'server-provider-in-component': {
544
+ readonly kind: "refused";
545
+ readonly means: "a `runtime: 'server'` element inside a component: the page server resolves a page's and its layouts', never a component's";
546
+ readonly fix: "put the provider on the page, around the instance, and hand the component its rows as a prop";
547
+ };
548
+ readonly 'server-data-in-browser': {
549
+ readonly kind: "refused";
550
+ readonly means: "a provider asking for the project's own data (`/data/…`, read by its server from `src/data/` and never served) from the browser";
551
+ readonly fix: "`runtime: 'server'` on the provider: the page arrives with the data in it";
552
+ };
553
+ readonly 'server-data-without-rsc': {
554
+ readonly kind: "warned";
555
+ readonly means: "a `runtime: 'server'` provider — `connector`, `action` or `query` — in a space that turns server data off (`rsc: { enabled: false }`)";
556
+ readonly fix: "drop `rsc: { enabled: false }`: server data is on unless a space turns it off";
557
+ };
558
+ readonly 'route-param-undeclared': {
559
+ readonly kind: "warned";
560
+ readonly means: "`navigation.routeParams.x` read on a page whose slug has no `:x` — always empty";
561
+ readonly fix: "add `:x` to the slug, or read `navigation.queryParams.x`";
562
+ };
563
+ readonly 'form-control-unnamed': {
564
+ readonly kind: "warned";
565
+ readonly means: "a control in a form with no `name` — its value never reaches `values`";
566
+ readonly fix: "`formControl({ name: 'email', … })`";
567
+ };
568
+ readonly 'form-control-name-taken': {
569
+ readonly kind: "warned";
570
+ readonly means: "two controls in one form with one name — one overwrites the other";
571
+ readonly fix: "a name each";
572
+ };
573
+ readonly FORM_SUBMIT_UNMANAGED: {
574
+ readonly kind: "warned";
575
+ readonly means: "a form the browser would submit itself, reloading the page";
576
+ readonly fix: "`managedByInteractions: true`";
577
+ };
578
+ readonly 'from-without-attribute': {
579
+ readonly kind: "refused";
580
+ readonly means: "`from` on a type with no one attribute that shows its data (a container, a form)";
581
+ readonly fix: "bind the attribute you mean: `bind: { attribute: 'source' }`";
582
+ };
583
+ readonly 'from-and-bind': {
584
+ readonly kind: "refused";
585
+ readonly means: "the main attribute bound twice, with `from` and in `bind`";
586
+ readonly fix: "keep `from`, and give `bind` the other attributes";
587
+ };
588
+ readonly 'as-without-from': {
589
+ readonly kind: "refused";
590
+ readonly means: "`as` with no `from` — `as` is how the source `from` names is shown";
591
+ readonly fix: "`from: 'products.item.price', as: 'price'`";
592
+ };
593
+ readonly 'format-unknown': {
594
+ readonly kind: "refused";
595
+ readonly means: "an `as` that names no format of the space's `formats`";
596
+ readonly fix: "declare it once — `formats: { price: \"{{ source|currency('USD') }}\" }` — or write the template in its place";
597
+ };
598
+ readonly 'binding-shape': {
599
+ readonly kind: "refused";
600
+ readonly means: "a binding with no `to` or no `source`";
601
+ readonly fix: "`bind: { content: 'posts.item.title' }`, or `bindTemplate(to, source, template)`";
602
+ };
603
+ readonly 'binding-category': {
604
+ readonly kind: "refused";
605
+ readonly means: "a binding `category` that does not exist";
606
+ readonly fix: "one of the categories it lists";
607
+ };
608
+ readonly 'binding-source-unknown': {
609
+ readonly kind: "refused";
610
+ readonly means: "a binding whose source names an element that does not exist, or with its prefix written wrong";
611
+ readonly fix: "the id of the element that publishes it, written alone — the prefix is filled in";
612
+ };
613
+ readonly 'binding-source-out-of-scope': {
614
+ readonly kind: "refused";
615
+ readonly means: "a source read by an element that is not inside the element publishing it";
616
+ readonly fix: "move the element inside it, or share the value through `state`";
617
+ };
618
+ readonly 'binding-target-unknown': {
619
+ readonly kind: "refused";
620
+ readonly means: "a binding onto an attribute the element does not have — the value arrives and nothing shows it";
621
+ readonly fix: "one it lists (`content`); to follow data with a class, `variantFrom`";
622
+ };
623
+ readonly 'active-when-constant': {
624
+ readonly kind: "refused";
625
+ readonly means: "an `activeWhen` condition that reads nothing — always or never true";
626
+ readonly fix: "name what it depends on: `'{{ list_dots.index == state.slide }}'`";
627
+ };
628
+ readonly 'visibility-as-attribute': {
629
+ readonly kind: "refused";
630
+ readonly means: "`visibility` bound as an attribute, which no element reads";
631
+ readonly fix: "`visible: { source, template }`";
632
+ };
633
+ readonly 'unknown-transformer': {
634
+ readonly kind: "refused";
635
+ readonly means: "a transformer that does not exist";
636
+ readonly fix: "one of the transformers it lists";
637
+ };
638
+ readonly 'transformer-params': {
639
+ readonly kind: "refused";
640
+ readonly means: "a transformer param that does not exist, or a value outside its options";
641
+ readonly fix: "the params and values it lists";
642
+ };
643
+ readonly 'template-text-into-value': {
644
+ readonly kind: "refused";
645
+ readonly means: "a template, which renders text, feeding an attribute that holds a list or an object";
646
+ readonly fix: "`bindTemplate('items', source, '{{ … }}', { returns: 'value' })`";
647
+ };
648
+ readonly 'template-unreadable': {
649
+ readonly kind: "refused";
650
+ readonly means: "a template with an operator, a filter or a function that does not exist, or broken syntax";
651
+ readonly fix: "an operator, a filter or a function the interpreter has — the message names the one it could not read; `matches` never exists";
652
+ };
653
+ readonly 'template-unknown-name': {
654
+ readonly kind: "refused";
655
+ readonly means: "a name in a template that is not a source, a variable or a route param";
656
+ readonly fix: "the full source name (`list_rows.item`), `navigation.queryParams.x`, or `source` for the bound value";
657
+ };
658
+ readonly 'template-short-source': {
659
+ readonly kind: "refused";
660
+ readonly means: "a source named without its prefix inside a template or a step";
661
+ readonly fix: "the full name: `apiContainer_stats`, `list_rows`";
662
+ };
663
+ readonly 'template-source-out-of-scope': {
664
+ readonly kind: "refused";
665
+ readonly means: "a template reading the source of an element it is not inside";
666
+ readonly fix: "move the element inside it, or share the value through `state`";
667
+ };
668
+ readonly 'template-never-resolved': {
669
+ readonly kind: "warned";
670
+ readonly means: "a condition in an attribute, which only resolves `{{ name|filter }}` — used as written";
671
+ readonly fix: "move it into `bindTemplate`";
672
+ };
673
+ readonly 'condition-starts-visible': {
674
+ readonly kind: "warned";
675
+ readonly means: "a computed visibility that shows until its data answers";
676
+ readonly fix: "`visible: { source, template }`";
677
+ };
678
+ readonly 'computed-name': {
679
+ readonly kind: "refused";
680
+ readonly means: "a computed value whose name a template cannot read as `computed.x`";
681
+ readonly fix: "letters, digits and `_`";
682
+ };
683
+ readonly 'computed-not-template': {
684
+ readonly kind: "refused";
685
+ readonly means: "a computed value that is not a template";
686
+ readonly fix: "`'{{ state.x * 2 }}'`";
687
+ };
688
+ readonly 'computed-reads-element': {
689
+ readonly kind: "refused";
690
+ readonly means: "a computed value reading an element's source — no element is around the whole space";
691
+ readonly fix: "compute it from the globals and the variables, or bind it on the element";
692
+ };
693
+ readonly 'computed-unknown': {
694
+ readonly kind: "refused";
695
+ readonly means: "a computed value read before it is declared, or never declared";
696
+ readonly fix: "declare it in `computed`, above the one that reads it";
697
+ };
698
+ readonly 'global-field-unknown': {
699
+ readonly kind: "refused";
700
+ readonly means: "a binding, a template or a `when` reading a field `navigation`, `auth` or `theme` never has — `auth.authenticated`";
701
+ readonly fix: "the field it suggests: `auth.isAuthenticated`, `auth.details.username`, `navigation.queryParams.next`, `theme.resolved`";
702
+ };
703
+ readonly 'component-id': {
704
+ readonly kind: "refused";
705
+ readonly means: "a component whose `id` is not a name it can be placed by";
706
+ readonly fix: "a letter first, then letters, digits, `-` and `_`";
707
+ };
708
+ readonly 'component-duplicate': {
709
+ readonly kind: "refused";
710
+ readonly means: "two components with one id";
711
+ readonly fix: "a name each";
712
+ };
713
+ readonly 'component-undeclared': {
714
+ readonly kind: "refused";
715
+ readonly means: "an instance of a component the space does not declare";
716
+ readonly fix: "the id it suggests, or declare it in `components`";
717
+ };
718
+ readonly 'prop-name': {
719
+ readonly kind: "refused";
720
+ readonly means: "a prop whose name a template cannot read as `props.x`";
721
+ readonly fix: "letters, digits and `_`";
722
+ };
723
+ readonly 'prop-type-unknown': {
724
+ readonly kind: "refused";
725
+ readonly means: "a prop declared with a type no editor offers and nothing checks a value against";
726
+ readonly fix: "one of text, textarea, select, boolean, number, scalar, json, elementIds — words are `text`";
727
+ };
728
+ readonly 'prop-unknown': {
729
+ readonly kind: "refused";
730
+ readonly means: "a prop the component does not declare, handed in or read";
731
+ readonly fix: "the prop it suggests, or declare it: `props: { name: { type: 'text' } }`";
732
+ };
733
+ readonly 'prop-missing': {
734
+ readonly kind: "refused";
735
+ readonly means: "an instance without a prop its component requires";
736
+ readonly fix: "`component('card', { props: { name: … } })`, or bind it";
737
+ };
738
+ readonly 'prop-value': {
739
+ readonly kind: "refused";
740
+ readonly means: "a prop handed in with a value its declaration does not take";
741
+ readonly fix: "a value of the declared type, or one of its options";
742
+ };
743
+ readonly 'props-outside-component': {
744
+ readonly kind: "refused";
745
+ readonly means: "`props.x` read outside a component";
746
+ readonly fix: "read the source it would have come from";
747
+ };
748
+ readonly 'slot-unknown': {
749
+ readonly kind: "refused";
750
+ readonly means: "a component slot that is not an element of its tree";
751
+ readonly fix: "the id of an element inside the component — usually an empty container";
752
+ };
753
+ readonly 'slot-children': {
754
+ readonly kind: "refused";
755
+ readonly means: "children handed to an instance outside its slots";
756
+ readonly fix: "`children: { slotName: [ … ] }`; a component with no slots takes no children";
757
+ };
758
+ readonly 'flag-gate': {
759
+ readonly kind: "refused";
760
+ readonly means: "an element's or a page's `flag` that is not a flag name";
761
+ readonly fix: "`flag: 'newCheckout'`, or `flag: '!newCheckout'` for \"only while off\"";
762
+ };
763
+ readonly 'flag-undeclared': {
764
+ readonly kind: "refused";
765
+ readonly means: "a gate on a flag the space does not declare — it reads as off, so the element never (or always) renders";
766
+ readonly fix: "declare it in `flags`, or remove the gate";
767
+ };
768
+ readonly 'flag-unknown': {
769
+ readonly kind: "refused";
770
+ readonly means: "a template, a binding or a `when` reading a flag the space does not declare";
771
+ readonly fix: "the declared name it suggests, or declare it";
772
+ };
773
+ readonly 'flag-name': {
774
+ readonly kind: "refused";
775
+ readonly means: "a flag whose name a template cannot read as `flags.x`";
776
+ readonly fix: "letters, digits and `_`";
777
+ };
778
+ readonly 'flag-shape': {
779
+ readonly kind: "refused";
780
+ readonly means: "a flag whose `value` is not `true` or `false`";
781
+ readonly fix: "`{ value: false, rules: [] }`";
782
+ };
783
+ readonly 'flag-rule-shape': {
784
+ readonly kind: "refused";
785
+ readonly means: "a flag rule that is not `{ when, value }`, or whose `value` is not `true` or `false`";
786
+ readonly fix: "`{ when: { … }, value: true }`";
787
+ };
788
+ readonly 'flag-rule-empty': {
789
+ readonly kind: "warned";
790
+ readonly means: "a flag rule with no conditions — skipped, never read as \"always\"";
791
+ readonly fix: "give it a condition, or set the flag's `value` instead";
792
+ };
793
+ readonly 'flag-unused': {
794
+ readonly kind: "warned";
795
+ readonly means: "a declared flag nothing gates on and no template reads";
796
+ readonly fix: "gate what it switches (`flag: 'x'`), or remove it once the feature has shipped";
797
+ };
798
+ readonly 'flow-empty': {
799
+ readonly kind: "refused";
800
+ readonly means: "a flow with no steps";
801
+ readonly fix: "`[onClick(), setState({ … })]`";
802
+ };
803
+ readonly 'flow-without-trigger': {
804
+ readonly kind: "refused";
805
+ readonly means: "a flow whose first step is not the event that runs it";
806
+ readonly fix: "`[onClick(), setState(…)]`";
807
+ };
808
+ readonly 'step-name': {
809
+ readonly kind: "refused";
810
+ readonly means: "a step name a later step cannot read as `{{ name.field }}`";
811
+ readonly fix: "a letter first, then letters, digits, `-` and `_`";
812
+ };
813
+ readonly 'step-duplicate': {
814
+ readonly kind: "refused";
815
+ readonly means: "two steps with one name in a flow or an action";
816
+ readonly fix: "a name each";
817
+ };
818
+ readonly 'step-type': {
819
+ readonly kind: "refused";
820
+ readonly means: "a step `type` that does not exist";
821
+ readonly fix: "the step builders — `setState(…)`, `navigate(…)` — write it";
822
+ };
823
+ readonly 'step-params': {
824
+ readonly kind: "refused";
825
+ readonly means: "a step param that does not exist, or a value outside its options";
826
+ readonly fix: "the params and values it lists";
827
+ };
828
+ readonly 'element-ids-target': {
829
+ readonly kind: "refused";
830
+ readonly means: "a step refreshing containers by id (`invalidateElements`, `invalidateQueries({ elements })`) naming one the space does not have, or one that is not an `apiContainer`";
831
+ readonly fix: "the id of the `apiContainer` whose data the step changes: `invalidateElements: ['posts']`";
832
+ };
833
+ readonly 'trigger-never-fired': {
834
+ readonly kind: "refused";
835
+ readonly means: "a flow on an event the element never fires";
836
+ readonly fix: "the element that fires it; for a plugin, `declaredTrigger(declaration, 'onPick')`";
837
+ };
838
+ readonly 'trigger-keys': {
839
+ readonly kind: "refused";
840
+ readonly means: "an `onKey` shortcut that cannot fire: two keys at once, only modifiers, or a name that is not a key";
841
+ readonly fix: "`onKey('f')`, `onKey('shift+f')`, `onKey('mod+k, escape')`";
842
+ };
843
+ readonly 'trigger-interval': {
844
+ readonly kind: "refused";
845
+ readonly means: "an `onInterval` that never ticks: not a whole number of milliseconds, or below 250";
846
+ readonly fix: "`onInterval(5000)`";
847
+ };
848
+ readonly 'while-running': {
849
+ readonly kind: "refused";
850
+ readonly means: "`whileRunning` on a step that is not the trigger, or a mode other than `skip`, `parallel`, `queue`, `latest`";
851
+ readonly fix: "`[whileRunning('queue', onClick()), …]`";
852
+ };
853
+ readonly 'callback-not-answered': {
854
+ readonly kind: "refused";
855
+ readonly means: "a step sending an action the target element never answers to";
856
+ readonly fix: "the element that answers it; for a plugin, `declaredCallback(declaration, 'reset', { on })`";
857
+ };
858
+ readonly 'callback-key-unknown': {
859
+ readonly kind: "refused";
860
+ readonly means: "a `setState` / `toggleState` on an element writing a field it does not have";
861
+ readonly fix: "an attribute it lists, or for `category: 'state'` `visibility` / `styleSelectors.<selector>`";
862
+ };
863
+ readonly 'global-callback-undeclared': {
864
+ readonly kind: "refused";
865
+ readonly means: "a global-callback step builder naming an action no source declares";
866
+ readonly fix: "one of the actions it lists";
867
+ };
868
+ readonly 'global-callback-module': {
869
+ readonly kind: "refused";
870
+ readonly means: "a global callback sent to a module other than the one that registers it";
871
+ readonly fix: "the step builder, which knows the module";
872
+ };
873
+ readonly 'unknown-global-callback': {
874
+ readonly kind: "warned";
875
+ readonly means: "a global callback no built-in source declares — it runs only if something registers it";
876
+ readonly fix: "the built-in it suggests, or make sure a plugin or module of the space registers it";
877
+ };
878
+ readonly 'utility-module': {
879
+ readonly kind: "refused";
880
+ readonly means: "a utility sent to a module — a utility takes none";
881
+ readonly fix: "drop the `on`";
882
+ };
883
+ readonly 'unknown-utility': {
884
+ readonly kind: "warned";
885
+ readonly means: "a utility that is not one of the built-in ones";
886
+ readonly fix: "one of the built-in utilities";
887
+ };
888
+ readonly 'state-key-has-runtime-prefix': {
889
+ readonly kind: "warned";
890
+ readonly means: "a state key written with `runtime.state.` in front — the state callbacks already write below it";
891
+ readonly fix: "`key: 'cart'`, not `'runtime.state.cart'`";
892
+ };
893
+ readonly 'state-toggled-in-branches': {
894
+ readonly kind: "warned";
895
+ readonly means: "two `setState` of one key, each under a `when` on that key — the second flips back what the first wrote";
896
+ readonly fix: "`toggleState({ key })`; for something shown by default, a key named for hiding it";
897
+ };
898
+ readonly 'form-value-compared-to-blank': {
899
+ readonly kind: "warned";
900
+ readonly means: "a `when` comparing a submitted field to `\"\"` — a field nobody typed in is not sent";
901
+ readonly fix: "`operator: 'empty'` / `'notEmpty'`";
902
+ };
903
+ readonly 'condition-field-unpublished': {
904
+ readonly kind: "refused";
905
+ readonly means: "a `when` asking a step of its flow for a key it never publishes — `whenSucceeded` / `whenFailed` on anything but `runServerAction`";
906
+ readonly fix: "a key the step publishes (`explain <step>`): after `authLogin`, `when({ field: 'signedIn.ok', operator: '=', value: true }, …)`";
907
+ };
908
+ readonly 'action-without-entry': {
909
+ readonly kind: "refused";
910
+ readonly means: "an action with no way in, so nothing can start it";
911
+ readonly fix: "a `trigger` — `{ type: 'call', access }`, or `render`, `webhook`, `custom`, `schedule`";
912
+ };
913
+ readonly 'action-without-steps': {
914
+ readonly kind: "refused";
915
+ readonly means: "an action with no steps";
916
+ readonly fix: "the steps it runs";
917
+ };
918
+ readonly 'action-step-params': {
919
+ readonly kind: "refused";
920
+ readonly means: "a step with no params in an action whose ways in declare different inputs";
921
+ readonly fix: "the step's params";
922
+ };
923
+ readonly 'channel-declaration': {
924
+ readonly kind: "refused";
925
+ readonly means: "a channel whose pattern or access the server cannot read";
926
+ readonly fix: "what the message says: `{ access: { mode: 'public' } }`, a pattern like `room:{id}`";
927
+ };
928
+ readonly 'channel-topic': {
929
+ readonly kind: "refused";
930
+ readonly means: "a `channel` element with no topic";
931
+ readonly fix: "a topic a channel of the space covers";
932
+ };
933
+ readonly 'channel-grant': {
934
+ readonly kind: "refused";
935
+ readonly means: "a topic of a private channel opened with no grant to it";
936
+ readonly fix: "the grant the message names, or a public channel";
937
+ };
938
+ readonly 'control-without-name': {
939
+ readonly kind: "warned";
940
+ readonly means: "a button or a link with no words, or a field nothing names";
941
+ readonly fix: "`title` on the button, `label` on the link, `label` (with `hideLabel: true`) on the field";
942
+ };
943
+ readonly 'embed-without-title': {
944
+ readonly kind: "warned";
945
+ readonly means: "an `embed` with no `title` — a frame a screen reader cannot describe";
946
+ readonly fix: "say what it shows in `title`";
947
+ };
948
+ readonly 'image-without-alt': {
949
+ readonly kind: "warned";
950
+ readonly means: "an image that is not `decorative` and has no `alt`";
951
+ readonly fix: "say what it shows, or `decorative: true`";
952
+ };
953
+ readonly 'click-on-static-element': {
954
+ readonly kind: "warned";
955
+ readonly means: "a click flow on a container, text, heading, image or list item — no keyboard reaches it";
956
+ readonly fix: "the flow on a `button` (it holds children) or a `link`";
957
+ };
958
+ readonly 'heading-level-skipped': {
959
+ readonly kind: "warned";
960
+ readonly means: "an `h4` right after an `h2` — the outline misses a level";
961
+ readonly fix: "the next level down; size it with its class";
962
+ };
963
+ readonly 'label-ignored': {
964
+ readonly kind: "warned";
965
+ readonly means: "a `label` on a container whose tag is named by what it holds (`li`, a heading)";
966
+ readonly fix: "the words inside, or a landmark tag (`nav`, `section`…)";
967
+ };
968
+ readonly 'dropdown-without-control': {
969
+ readonly kind: "warned";
970
+ readonly means: "a dropdown opened from a box or an icon — no keyboard opens it";
971
+ readonly fix: "a `button` as what opens it (`title` if it is only an icon)";
972
+ };
973
+ readonly 'control-in-decorative': {
974
+ readonly kind: "warned";
975
+ readonly means: "a control inside a `decorative` container — Tab lands on something nothing announces";
976
+ readonly fix: "move it out of the illustration";
977
+ };
978
+ readonly 'repeated-on-pages': {
979
+ readonly kind: "suggested";
980
+ readonly means: "the same block — a header, a footer, a side panel — written into several pages";
981
+ readonly fix: "a layout holding it once (`layouts`, and `layout: { id, slot }` on each page) — a component when only some pages of a layout carry it; a link marks its own page with the `current` state";
982
+ };
983
+ readonly 'repeated-shape': {
984
+ readonly kind: "suggested";
985
+ readonly means: "the same structure written again and again with different words — cards, rows, tiles";
986
+ readonly fix: "a component with props (`components`, `component(id, { props })`), or one `list` when they are rows of data side by side — a few cards a person rewords on the canvas can stay cards";
987
+ };
988
+ readonly 'content-attribute': {
989
+ readonly kind: "suggested";
990
+ readonly means: "a button or a link whose children are only its words and an icon — a `text`, a `fontAwesome` — elements more than it needs";
991
+ readonly fix: "its own `content` and `icon` (`link({ href, content: 'Docs', icon: 'fa-solid fa-arrow-right', iconPlacement: 'after' })`); the icon's class goes on the `icon` slot, and what the text's class adds on the box's class, never the class itself";
992
+ };
993
+ readonly 'custom-css-class': {
994
+ readonly kind: "suggested";
995
+ readonly means: "a `customCss` rule a class can hold — `.card:hover`, `.panel .icon`";
996
+ readonly fix: "the class's own `states` or `ancestors`, where the style editor reads it back and a breakpoint can change it";
997
+ };
998
+ readonly 'custom-css-sdk-default': {
999
+ readonly kind: "suggested";
1000
+ readonly means: "`customCss` repeating what the SDK already does for every space — less motion when asked, the theme toggle showing one icon";
1001
+ readonly fix: "nothing: remove it";
1002
+ };
1003
+ readonly 'custom-css-slot': {
1004
+ readonly kind: "suggested";
1005
+ readonly means: "a part of a built-in element dressed in `customCss` by the SDK's markup — a form control's `<input>`, a pager's buttons, a heading inside a markdown";
1006
+ readonly fix: "a class on the slot of that part — `slots: { field: input }`, `elements.<type>.slots` — with its states";
1007
+ };
1008
+ readonly 'custom-css-notifications': {
1009
+ readonly kind: "suggested";
1010
+ readonly means: "the toasts or their icon, close button or progress bar dressed with `.Toastify__*` rules in `customCss`";
1011
+ readonly fix: "`notifications: { font, fontSize, fontWeight, minHeight, iconSize, closeColor, progressHeight, … }`";
1012
+ };
1013
+ readonly 'heavy-animation': {
1014
+ readonly kind: "suggested";
1015
+ readonly means: "keyframes animating what the browser repaints or lays out again on every frame — a size, a position, a blur, a shadow, or a colour in a loop — which stutters whenever the page is busy, most of all while it loads";
1016
+ readonly fix: "`opacity` and `transform`: a size or a position is `translate`/`scale`, a blur or a shadow is the `opacity` of a layer carrying it; a loop that must animate anything else starts `paused` and runs under `[data-hydrated]`";
1017
+ };
1018
+ readonly 'unused-class': {
1019
+ readonly kind: "suggested";
1020
+ readonly means: "a class declared in `classes` that no element, binding, flow or other class names";
1021
+ readonly fix: "remove it from `classes` — or wear it where it was meant to go";
1022
+ };
1023
+ readonly 'unused-token': {
1024
+ readonly kind: "suggested";
1025
+ readonly means: "a token of `variables` no `var(--…)` reads — not a class, an element, `customCss` nor another token";
1026
+ readonly fix: "remove it, or write it where its colour is written out";
1027
+ };
1028
+ readonly 'literal-colour': {
1029
+ readonly kind: "suggested";
1030
+ readonly means: "a colour written out in a class where the space has a token of that value — it stays put in the dark scheme";
1031
+ readonly fix: "`var(--token)` when it should follow the scheme; a token of one value of its own when it must stay the same in both";
1032
+ };
1033
+ readonly 'unused-component': {
1034
+ readonly kind: "suggested";
1035
+ readonly means: "a component no page, layout or other component places";
1036
+ readonly fix: "remove it from `components`, or place it where it was meant to go";
1037
+ };
1038
+ readonly 'class-overrides-class': {
1039
+ readonly kind: "suggested";
1040
+ readonly means: "one class's shorthand erasing the longhand another class on the same element writes out — `padding` over `padding-top` — because the stylesheet writes it later: classes in the order they are first met, a breakpoint's rules after the base, never the order of a class list";
1041
+ readonly fix: "the longhands the shorthand means instead of it (`padding-left`, `padding-right`), so it leaves the other class's alone — or `quiet: ['class-overrides-class']` when the shorthand is meant to win";
1042
+ };
1043
+ };
1044
+
1045
+ declare type AuthoringCode = keyof Codes;
1046
+
1047
+ /**
1048
+ * The project's space, authored: what a project's server serves — `serveProject({ space: authorProjectSpace })` — and
1049
+ * its visual tests read. `projectSpace`, then `authorSpace` with what it is checked against.
1050
+ */
1051
+ export declare const authorProjectSpace: () => Promise<AuthoredSpace>;
1052
+
1053
+ declare type BindingCategory = 'attributes' | 'style' | 'initialState';
1054
+
1055
+ declare interface BindingSpec {
1056
+ /** Attribute, style property or state key that receives the value. */
1057
+ to: string;
1058
+ /**
1059
+ * Where the value comes from.
1060
+ *
1061
+ * Normally `<id>.<field>` — the name YOU gave the element, and the source prefix is looked up from what that
1062
+ * element publishes. The four globals (`variables`, `navigation`, `auth`, `state`) are named as themselves, and
1063
+ * a source written in full (`apiContainer_posts.data`) is left alone but checked.
1064
+ */
1065
+ source: string;
1066
+ category?: BindingCategory;
1067
+ transformers?: ElementBinding['transformers'];
1068
+ when?: ElementBinding['when'];
1069
+ enabled?: boolean;
1070
+ }
1071
+
1072
+ /**
1073
+ * Bindings, in either of the two forms.
1074
+ *
1075
+ * The map is the common case and the short one — `{ content: 'apiContainer_posts.title' }` — and it targets
1076
+ * attributes, which is what nearly every binding does. The array is for everything else: a binding onto element
1077
+ * state, one with a transformer, one that only applies under a condition.
1078
+ */
1079
+ declare type BindingsSpec = Record<string, string> | BindingSpec[];
1080
+
1081
+ declare type BindingTransformer = {
1082
+ action: string;
1083
+ /**
1084
+ * Mostly text, and not only: a param the builder draws as a checkbox (`styleVariant`'s `append`) is stored as the
1085
+ * boolean it is, and the transformer reads it as one — `if (!append)`. Writing `"false"` there would read as true.
1086
+ */
1087
+ params: Record<string, string | number | boolean>;
1088
+ enabled?: boolean;
1089
+ };
1090
+
1091
+ declare const BUILTIN_PARAM_TYPES: readonly ["text", "textarea", "select", "boolean", "number", "scalar", "json", "elementIds"];
1092
+
1093
+ declare interface BuiltinParam {
1094
+ type: BuiltinParamType;
1095
+ description: string;
1096
+ default?: string | number | boolean | string[];
1097
+ options?: string[];
1098
+ when?: (params: Record<string, unknown>) => boolean;
1099
+ required?: boolean;
1100
+ /** Overrides the label derived from the param name (`autoDismiss` → "Auto Dismiss"). */
1101
+ label?: string;
1102
+ /** Overrides the label derived from an option value (`top-right` → "Top Right"). */
1103
+ optionLabels?: Record<string, string>;
1104
+ /**
1105
+ * The control the editor shows, when it is not the obvious one for `type` — including the case where it depends
1106
+ * on what the author has already filled in (a value whose control follows the type they picked above it).
1107
+ */
1108
+ builderType?: InteractionParamType | ((params: Record<string, unknown>) => InteractionParamType);
1109
+ /** Whether the editor offers to bind this param to a data source. Bindable unless a param says otherwise. */
1110
+ canBind?: boolean;
1111
+ /** For `elementIds`: the element type the editor offers (e.g. `apiContainer`); every element without one. */
1112
+ elementType?: string;
1113
+ }
1114
+
1115
+ declare type BuiltinParamType = (typeof BUILTIN_PARAM_TYPES)[number];
1116
+
1117
+ /**
1118
+ * One kind of channel a space offers, declared under a topic PATTERN — `board:{id}` is every board, each its own topic.
1119
+ *
1120
+ * A topic no pattern of the space matches is refused, by the server and at authoring: a page cannot open a channel
1121
+ * nobody decided should exist.
1122
+ */
1123
+ declare type ChannelDeclaration = {
1124
+ /** Who may subscribe and publish — the access vocabulary actions use. */
1125
+ access: ActionAccess;
1126
+ /**
1127
+ * Who may send: `clients` (pages publish directly — cursors, reactions, what is cheap and ephemeral) or `server`
1128
+ * (only a flow's `realtime.publish` — what was validated and saved first). `clients` when absent.
1129
+ */
1130
+ publish?: 'clients' | 'server';
1131
+ /** Whether members announce themselves — who is here, and what they are pointing at. */
1132
+ presence?: boolean;
1133
+ /**
1134
+ * Whether a page needs a GRANT to open a topic of it: a token a flow's `realtime.grant` issued for that exact topic —
1135
+ * after checking a password, an invitation, an order's owner, whatever decides who is in. Without one the topic is
1136
+ * refused, however well its name is known; `access` still applies on top. For a private room, a customer's order,
1137
+ * a locked board.
1138
+ */
1139
+ grant?: boolean;
1140
+ /** The largest `data` a page may send, as JSON bytes. 4 KB when absent. */
1141
+ maxMessageBytes?: number;
1142
+ /** How many messages one connection may send a second. 30 when absent. */
1143
+ messagesPerSecond?: number;
1144
+ };
1145
+
1146
+ declare type ChannelDeclarations = Record<string, ChannelDeclaration>;
1147
+
1148
+ /**
1149
+ * The classes a selector wears: one, or several.
1150
+ *
1151
+ * Several is what the builder writes when an element carries a shared base and a modifier — `panel-card quota-panel`
1152
+ * — and the SDK applies all of them, in the order the stylesheet declares them rather than the order listed here.
1153
+ */
1154
+ declare type ClassList = ClassRef | readonly ClassRef[];
1155
+
1156
+ /** A class by name, or a `styles()` declaration that brings its rules along. */
1157
+ declare type ClassRef = string | StyleDeclaration;
1158
+
1159
+ declare type Codes = typeof AUTHORING_CODES;
1160
+
1161
+ /**
1162
+ * The answer, once `system` has been put to the machine: what is actually on screen.
1163
+ *
1164
+ * Every consumer that paints something wants this one — a code editor, a chart, the dev-tools panel. `theme` is
1165
+ * the CHOICE and can be `system`, which is not a colour and cannot be compared against one.
1166
+ */
1167
+ declare type ColorScheme = Exclude<Theme, 'system'>;
1168
+
1169
+ declare type Combinator = 'and' | 'or';
1170
+
1
1171
  /**
2
1172
  * An SVG as it is worth carrying in a space: what a design tool wrote for itself taken out — the XML prolog and doctype,
3
1173
  * comments, `<metadata>`, an editor's own elements and attributes (Inkscape, Sodipodi, Sketch, Figma's `data-name`) —
@@ -9,6 +1179,715 @@
9
1179
  */
10
1180
  export declare const compactSvg: (markup: string) => string;
11
1181
 
1182
+ /**
1183
+ * A prop a component declares, as the document stores it: the part of a `BuiltinParam` that survives JSON — no `when`
1184
+ * guard and no `builderType` worked out from other params, which are functions and only ever live in code.
1185
+ */
1186
+ declare type ComponentProp = Pick<BuiltinParam, 'type' | 'description' | 'default' | 'options' | 'required' | 'label' | 'optionLabels' | 'elementType'>;
1187
+
1188
+ /**
1189
+ * A reusable subtree of the space: written once, placed anywhere with {@link component}, and published, versioned and
1190
+ * copied with the space because it is part of it.
1191
+ *
1192
+ * It is CLOSED. Inside, a binding or a template reads `props` — what each instance hands in, declared here — and the
1193
+ * globals, never the page an instance sits on: a component that read its surroundings would render differently
1194
+ * wherever it was placed, and could not be checked until it was. What it needs from there comes in as a prop.
1195
+ *
1196
+ * ```ts
1197
+ * components: [{
1198
+ * id: 'product-card',
1199
+ * props: { title: { type: 'text', description: 'The heading', required: true } },
1200
+ * slots: ['product-card-actions'],
1201
+ * root: container({ id: 'product-card-root', children: [
1202
+ * heading({ id: 'product-card-title', bind: { content: 'props.title' } }),
1203
+ * container({ id: 'product-card-actions' })
1204
+ * ] })
1205
+ * }]
1206
+ * ```
1207
+ */
1208
+ declare interface ComponentSpec {
1209
+ /** The name an instance places it by. */
1210
+ id: string;
1211
+ /** What the builder shows. Defaults to the id. */
1212
+ label?: string;
1213
+ /** The page folder the builder files it under. It routes nothing: a component has no URL of its own. */
1214
+ folder?: string;
1215
+ /**
1216
+ * What an instance hands in, each as an attribute of the instance and read inside as `{{ props.<name> }}`. Declared
1217
+ * as a step's params are — a type, what it is for, a default, whether it is required — and checked the same way.
1218
+ */
1219
+ props?: Record<string, ComponentProp>;
1220
+ /** Elements of the tree an instance fills with its children, each child naming the one it goes in. */
1221
+ slots?: string[];
1222
+ /** The tree. Its root is what an instance renders, and ids inside it are names the whole space shares. */
1223
+ root: ElementSpec;
1224
+ }
1225
+
1226
+ /** A condition's rules in the object form: the selector's own under it, its states' and its pseudo-elements'. */
1227
+ declare interface ConditionRulesSpec extends PseudoRulesSpec {
1228
+ pseudos?: PseudosSpec;
1229
+ }
1230
+
1231
+ /**
1232
+ * A selector's rules under a condition of the page rather than of the element: `motion-reduce` (the visitor asked for
1233
+ * less motion), `motion-safe`, or a container's width — `container (max-width: 30rem)`, `container card (min-width:
1234
+ * 480px)` — asked of the nearest ancestor whose class sets `container-type` (and `container-name` to name it).
1235
+ */
1236
+ declare type ConditionSpec = CssSpec | ConditionRulesSpec;
1237
+
1238
+ /**
1239
+ * Plain rules as an author writes them: kebab-case or camelCase keys (`paddingTop`), a bare number for a length in
1240
+ * pixels (`gap: 16`), and a property that changes on another breakpoint given a value per breakpoint in place.
1241
+ */
1242
+ declare type CssInput = Record<string, StyleValue | ResponsiveValue>;
1243
+
1244
+ /**
1245
+ * The two shapes CSS has while a space is being authored.
1246
+ *
1247
+ * `CssProps` is what a person or an agent writes: kebab-case CSS with shorthands allowed. `StyleRules` is what
1248
+ * reaches the document, and the difference is not cosmetic — Plitzi's style editor reads a closed list of ~196
1249
+ * longhand properties, so a `padding` or a `gap` that survives to persistence renders correctly and then cannot be
1250
+ * read back, edited or overridden per breakpoint. Everything the authoring surface accepts is expanded and checked
1251
+ * against that list before it is written.
1252
+ */
1253
+ /** What an author writes: kebab-case CSS, shorthands allowed, one value per key. */
1254
+ declare type CssProps = Record<string, StyleValue>;
1255
+
1256
+ /**
1257
+ * CSS for one element or class, in either of the two shapes an author writes it in.
1258
+ *
1259
+ * Told apart by the keys, which is unambiguous rather than clever: `desktop`, `tablet` and `mobile` are not CSS
1260
+ * properties and never will be, so a rule set that mentions one is per-breakpoint and one that does not is the
1261
+ * desktop rules.
1262
+ */
1263
+ declare type CssSpec = CssInput | ResponsiveCss;
1264
+
1265
+ declare type DisplayMode = 'desktop' | 'tablet' | 'mobile';
1266
+
1267
+ /**
1268
+ * An element, keyed by the one name it answers to.
1269
+ *
1270
+ * `id` is that name: the `flat` key, what `parentId`/`items`/`rootId` point at, the `<type>_<id>` a binding's source
1271
+ * is built from, and the target an interaction wires to. It is chosen — typed by a person in the builder's tree,
1272
+ * written by an agent, or minted as `<type>-<n>` — never an opaque generated handle, so the key an author writes
1273
+ * down is the key the runtime resolves. `definition.label` stays free display text and wires nothing.
1274
+ */
1275
+ declare type Element_2<TAttributes extends Record<string, unknown> = Record<string, unknown>> = {
1276
+ id: string;
1277
+ attributes: TAttributes & {
1278
+ subType?: string;
1279
+ };
1280
+ definition: ElementDefinition;
1281
+ };
1282
+
1283
+ declare type ElementBinding = {
1284
+ id: string;
1285
+ source: string;
1286
+ transformers?: BindingTransformer[];
1287
+ when?: RuleGroup;
1288
+ enabled?: boolean;
1289
+ to: string;
1290
+ };
1291
+
1292
+ /**
1293
+ * An element's classes, and at most one set of rules of its own on top of them — `class: [cover, { opacity: '0.25' }]`.
1294
+ *
1295
+ * "This class, plus one thing" is the commonest shape there is. The rules become a class named after the element,
1296
+ * `<id>--own`, declared after every shared one so it wins over them; it is still one class, visible and editable in the
1297
+ * builder, and the element still has one base selector. Needs the element's `id`, which names it.
1298
+ */
1299
+ declare type ElementClassList = ClassList | readonly (ClassRef | StyleSpec)[];
1300
+
1301
+ declare type ElementDefinition = {
1302
+ rootId: Element_2['id'];
1303
+ label: string;
1304
+ type: string;
1305
+ parentId?: Element_2['id'];
1306
+ items?: Element_2['id'][];
1307
+ styleSelectors: {
1308
+ base: string;
1309
+ [selector: string]: string;
1310
+ };
1311
+ bindings?: Partial<Record<BindingCategory, ElementBinding[]>>;
1312
+ interactions?: Record<string, ElementInteraction>;
1313
+ initialState?: {
1314
+ styleVariant?: Partial<Record<string, Partial<Record<string, string | string[]>>>>;
1315
+ styleSelectors?: ElementDefinition['styleSelectors'];
1316
+ visibility?: boolean;
1317
+ [key: string]: unknown;
1318
+ };
1319
+ /** Where this element is rendered. 'server' = SSR only, 'client' = browser only, 'shared' = both (default). */
1320
+ runtime?: ElementRuntime;
1321
+ /** When this element's items are mounted, relative to its `visibility`. See {@link ElementLoadStrategy}. */
1322
+ loadStrategy?: ElementLoadStrategy;
1323
+ /** The feature flag this element exists under. See {@link ElementFlagGate}. */
1324
+ flag?: ElementFlagGate;
1325
+ /**
1326
+ * The `id` this element carries in the DOM, so a link to `/page#anchor` lands on it — `data-id` names the element
1327
+ * for the platform, this names it for the URL. One per rendered page, layouts included (`isAnchor`).
1328
+ */
1329
+ anchor?: string;
1330
+ /** How it arrives and whether it keeps moving, played by the SDK's stylesheet. See {@link ElementMotion}. */
1331
+ motion?: ElementMotion;
1332
+ /**
1333
+ * The codes of the suggestions this element is not offered, because it is written this way on purpose —
1334
+ * `['repeated-shape']`. Read by the one place suggestions are made (`suggestSpace`), so authoring, the builder and
1335
+ * the MCP leave out the same ones. Never a problem's code.
1336
+ */
1337
+ quiet?: string[];
1338
+ };
1339
+
1340
+ /**
1341
+ * What a feature flag gates an element on: it exists only while the flag `name` resolves to `is`.
1342
+ *
1343
+ * Not a visibility. A hidden element is still rendered, its markup still in the page; a gated one whose flag says no
1344
+ * is not rendered at all — not on the server, not in the browser, not its subtree — and the data of its server
1345
+ * elements is not resolved. Its declaration still travels with the space's document, as every element's does, so a
1346
+ * flag switches a feature off; it does not keep it secret. `is: false` is the other half of a rollout: the old
1347
+ * version, shown until the flag turns on.
1348
+ * On a page, a flag that says no makes the page not found.
1349
+ */
1350
+ declare type ElementFlagGate = {
1351
+ name: string;
1352
+ is: boolean;
1353
+ };
1354
+
1355
+ /**
1356
+ * How a test names what an author wrote.
1357
+ *
1358
+ * An end-to-end suite has to address a rendered element, and everything it could address one by used to be wrong in
1359
+ * the same way: a CSS class is a styling decision that changes when the design does, a text match breaks when the copy
1360
+ * is edited, and the `nth-child` chain a recorder produces is invalidated by inserting a section above. What does not
1361
+ * move is the element's id — since it is also its NAME, chosen by whoever authored it, and unique across the document.
1362
+ *
1363
+ * So authoring returns the ids it assigned, and the renderer publishes them as `data-plitzi-el`. A spec written
1364
+ * against `handles.element('hero-cta')` cannot drift from the space: the id it names either exists at author time or
1365
+ * the build fails, which is exactly one build earlier than the suite would have failed silently.
1366
+ */
1367
+ declare interface ElementHandle {
1368
+ /** The one name this element answers to: its key in the document, and what `data-plitzi-el` carries. */
1369
+ id: string;
1370
+ type: string;
1371
+ /**
1372
+ * The root it lives on, by id: its page — or, for an element of a layout shell, that layout, since it renders on
1373
+ * every page that names the layout rather than on one of them.
1374
+ */
1375
+ pageId: string;
1376
+ /** A CSS selector matching exactly this element in a rendered page. */
1377
+ selector: string;
1378
+ /**
1379
+ * Whether the AUTHOR wrote this id, as opposed to authoring deriving `<type>-<n>` for it.
1380
+ *
1381
+ * The distinction is what makes a generic assertion possible: a named element is one somebody decided mattered
1382
+ * enough to point at, so "everything this space names is on screen" is a contract worth holding it to, while the
1383
+ * derived ones are positional and change the moment a section is inserted above them.
1384
+ */
1385
+ named: boolean;
1386
+ /**
1387
+ * Whether this element is on screen only under a condition — a `visible` of its own or on anything above it.
1388
+ *
1389
+ * A menu that opens on a tap and a confirmation that appears after a submit are named so a flow can reach them,
1390
+ * and they are correctly NOT on a page somebody has only just opened. A suite asserting "everything named is
1391
+ * visible" skips these, or it forces the author to leave unnamed exactly what a flow needs to point at.
1392
+ *
1393
+ * Also an element whose every child is conditional: with none of them shown it shows nothing either — a list of
1394
+ * flyouts at rest, a `display: contents` wrapper of panels.
1395
+ *
1396
+ * Present only when true: almost nothing on a page is conditional, and the handles are serialized.
1397
+ */
1398
+ conditional?: true;
1399
+ /**
1400
+ * Whether this element sits inside a list's row, so it renders once per row — several times, or not at all while the
1401
+ * list is empty. Its selector matches every copy: address one with the driver's `.first()` / `.nth()`.
1402
+ *
1403
+ * Present only when true, like `conditional`.
1404
+ */
1405
+ repeated?: true;
1406
+ /**
1407
+ * Whether this element renders no element of its own — a provider with no tag (`apiContainer` with no `subType`).
1408
+ * Its children render; it has no box to be visible, so an assertion that it is on screen can only fail.
1409
+ *
1410
+ * Present only when true.
1411
+ */
1412
+ boxless?: true;
1413
+ }
1414
+
1415
+ declare type ElementInteraction<T extends Record<string, unknown> = Record<string, unknown>> = {
1416
+ id: string;
1417
+ title: string;
1418
+ type: InteractionCallbackType;
1419
+ action: string;
1420
+ params: InteractionCallbackParamValues<T>;
1421
+ preview: Record<string, unknown>;
1422
+ elementId: Element_2['id'] | null;
1423
+ beforeNode: string;
1424
+ afterNode: string;
1425
+ flowId: string;
1426
+ enabled: boolean;
1427
+ when?: RuleGroup;
1428
+ /** On a trigger only: what a firing does while this flow is still running. `skip` when absent. */
1429
+ whileRunning?: WhileRunning;
1430
+ };
1431
+
1432
+ /**
1433
+ * When an element's CONTENTS are mounted, relative to its own `visibility`.
1434
+ *
1435
+ * About the subtree, never about the element itself: whatever a hidden element registers — a modal's `openModal`
1436
+ * callback, a form's source, an interaction trigger — is registered by the element, so an element that stops
1437
+ * rendering is an element nothing can ever show again. The shell always renders; what these decide is its items.
1438
+ *
1439
+ * - `eager` (default): always mounted. Right for an element that is on screen almost always — deferring it would only
1440
+ * add a render cycle between the page loading and the page appearing — and for a hidden element whose contents
1441
+ * have to be in the server's HTML: a section a search engine should read, a panel a CSS-only accordion opens
1442
+ * without the SDK's help.
1443
+ * - `lazy`: mounted the first time it is shown, and kept from then on. The one for elements that start hidden by
1444
+ * nature, and those declare it themselves — a modal or a dialog nobody opens costs nothing, and one that has been
1445
+ * opened keeps what the visitor typed into it.
1446
+ * - `visible`: mounted only while shown. Pays the build cost on every reveal and drops the subtree's state on
1447
+ * every hide — worth it for contents that are expensive to KEEP (a live map, a video, a polling source).
1448
+ */
1449
+ declare type ElementLoadStrategy = 'eager' | 'lazy' | 'visible';
1450
+
1451
+ declare interface ElementMotion {
1452
+ /** How it arrives. */
1453
+ enter?: MotionEnter;
1454
+ /** When it arrives: `load` (the default), `view` (once, as it comes into view) or `scroll` (with the scroll). */
1455
+ on?: MotionTrigger;
1456
+ /** How long it takes to arrive, in ms (600 by default). Ignored under `scroll`, which follows the scroll. */
1457
+ duration?: number;
1458
+ /** How long it waits before it does, in ms. */
1459
+ delay?: number;
1460
+ /**
1461
+ * Its CHILDREN arrive one after another, this many ms apart — a grid of cards, a list's rows — rather than the
1462
+ * element itself. Up to the first 24; the rest arrive with the 24th.
1463
+ */
1464
+ stagger?: number;
1465
+ /** Keeps moving after it arrived. */
1466
+ loop?: MotionLoop;
1467
+ }
1468
+
1469
+ declare type ElementRuntime = 'server' | 'client' | 'shared';
1470
+
1471
+ declare interface ElementSpec {
1472
+ type: string;
1473
+ /**
1474
+ * The one name this element answers to, everywhere: its key in the document, a binding's source
1475
+ * (`apiContainer_posts.records`), a step's `on`, an interaction target.
1476
+ *
1477
+ * Derived as `<type>-<n>` when left out, which is unique but POSITIONAL — adding an element above renumbers
1478
+ * every one below it, and each binding that named one then points at a different element without changing.
1479
+ * Name the ones something else refers to; a derived name is deliberately not accepted as a binding source.
1480
+ */
1481
+ id?: string;
1482
+ attributes?: Record<string, unknown>;
1483
+ /**
1484
+ * The source the element's main attribute shows — `content` of a text, a heading, a paragraph or a button; `src`
1485
+ * of an image; `href` of a link; `items` of a list: `heading({ from: 'site.data.hero.title' })`. `bind` is for
1486
+ * the other attributes.
1487
+ */
1488
+ from?: string;
1489
+ /** How `from` is shown: a name of the space's `formats`, or a template of its own (`'{{ source }} items'`). */
1490
+ as?: string;
1491
+ /** A list's row, by the component placed once per item with the row bound to its `item` prop. */
1492
+ row?: string;
1493
+ /**
1494
+ * A style variant the element starts in, e.g. a heading's `title`.
1495
+ *
1496
+ * The element TYPE's vocabulary by default. When the element wears a class that declares a variant of this name and
1497
+ * the type declares none, it is that CLASS's variant — `text({ class: avatar, variant: 'violet' })` wears
1498
+ * `avatar--violet`. Keyed by the type instead, it named a selector the element does not wear and rendered plain.
1499
+ * For a variant that follows the data, bind it with `variantFrom`.
1500
+ */
1501
+ variant?: string;
1502
+ /**
1503
+ * A rule set of this element's own. Shorthands are expanded and every property is checked before it is written,
1504
+ * so what reaches the document is what the style editor can read back.
1505
+ */
1506
+ css?: CssSpec;
1507
+ /**
1508
+ * The name of this element's own selector — the one {@link ElementSpec.css} writes to. Left out, it is derived from
1509
+ * where the element sits; given, it is kept exactly, which is how a space read back from the builder keeps the
1510
+ * names its style editor, its `customCss` and anything outside the document already know it by.
1511
+ */
1512
+ selector?: string;
1513
+ /**
1514
+ * How this element's own selector reacts — `hover`, `focus`, `active` — beside {@link ElementSpec.css}. A state
1515
+ * is part of the element's selector, not a second one, so it is refused alongside a shared `class` for the same
1516
+ * reason `css` is: the rules belong in the class.
1517
+ */
1518
+ states?: StatesSpec;
1519
+ /**
1520
+ * Reuse a selector authored elsewhere in the space instead of minting one. Two elements naming the same class
1521
+ * share one rule, which is the difference between a stylesheet and a pile of one-off declarations.
1522
+ *
1523
+ * Exclusive with {@link ElementSpec.css} and {@link ElementSpec.states}: an element has exactly one base selector,
1524
+ * so declaring both is a question with no answer and is refused rather than silently resolved.
1525
+ *
1526
+ * Either a name from {@link SpaceSpec.classes}, or a `styles()` declaration that brings its own rules along — or a
1527
+ * list of them, for an element that wears a shared base and a modifier (`[panelCard, quotaPanel]`). A list may end
1528
+ * with rules of the element's own on top of its classes, `[cover, { opacity: '0.25' }]` ({@link ElementClassList}).
1529
+ */
1530
+ class?: ElementClassList;
1531
+ /**
1532
+ * A class for one of the element's OTHER style selectors, by selector name — a form control's `input`, `label`
1533
+ * and `error`.
1534
+ *
1535
+ * `css` and `class` above are its `base`, and an element made of parts cannot be dressed through that one alone:
1536
+ * a rule meant for the input lands on the wrapper instead, and the input keeps the browser's own look. The value
1537
+ * names a class from {@link SpaceSpec.classes} — or carries one, as a `styles()` declaration — or lists several, so
1538
+ * one rule serves every control that wants it.
1539
+ */
1540
+ slots?: Record<string, ClassList>;
1541
+ bind?: BindingsSpec;
1542
+ /**
1543
+ * Show this element only while the value at this source is true. `!source` shows it while the value is false.
1544
+ *
1545
+ * Visibility is element STATE rather than an attribute, which is the one binding nobody guesses the category of
1546
+ * — and getting it wrong writes a `visibility` attribute no element reads, so the element stays visible and
1547
+ * nothing reports anything. As a field it cannot be got wrong, and it leaves {@link ElementSpec.bind} free to
1548
+ * stay in its short form: a condition is not an attribute, and pushing one into the list turned every binding
1549
+ * beside it into the long one.
1550
+ *
1551
+ * One field with a `!` rather than a `visible`/`hidden` pair, because `hidden` is a real HTML attribute — and in
1552
+ * this surface the attribute keeps a name it shares with anything else.
1553
+ *
1554
+ * `false` starts it hidden with no condition at all: a panel that a flow reveals (`toggleState`, `setState`)
1555
+ * rather than one the data does.
1556
+ *
1557
+ * `{ source, template }` is a condition the value does not answer on its own — the template's value is read as a yes
1558
+ * or a no (`false`, `0`, empty, an empty list or nothing is a no)
1559
+ * (`"{{ source == '' or source == list_games.item.genre }}"`). Like every condition, it starts hidden.
1560
+ */
1561
+ visible?: string | false | VisibleCondition;
1562
+ /** One flow per entry. Steps are chained in order. */
1563
+ flows?: StepSpec[][];
1564
+ runtime?: ElementRuntime;
1565
+ /** When this element's contents mount relative to its visibility. Left out, the element type decides. */
1566
+ loadStrategy?: ElementLoadStrategy;
1567
+ /**
1568
+ * The `id` this element carries in the DOM, so `/page#anchor` lands on it — `link({ href: 'home', hash: 'plans' })`.
1569
+ * Lowercase letters, digits and `-`; one per page, layouts included; not inside a list row or a component, which
1570
+ * would repeat it.
1571
+ */
1572
+ anchor?: string;
1573
+ /**
1574
+ * How it arrives and whether it keeps moving — `{ enter: 'fade-up', on: 'view' }`, `{ loop: 'float' }`,
1575
+ * `{ enter: 'scale', stagger: 60 }` for children that arrive one after another. Played by the SDK's stylesheet,
1576
+ * opacity and transforms only, and stilled for a visitor who asked for less motion. See motion.md.
1577
+ */
1578
+ motion?: ElementMotion;
1579
+ /**
1580
+ * The feature flag this exists under: `'newCheckout'` exists only while the flag is on, `'!newCheckout'` only while
1581
+ * it is off — the old version, kept until the new one ships. Not a visibility: gated off, it is not rendered at all,
1582
+ * on the server or in the browser. The flag is one {@link SpaceSpec.flags} declares.
1583
+ */
1584
+ flag?: string;
1585
+ /**
1586
+ * Suggestions this element is not offered, because it is written this way on purpose — `quiet: ['repeated-shape']`
1587
+ * on the root a helper writes three menus from, each reading its own data. A suggestion about several elements is
1588
+ * quiet when any of them says so. Only suggestions: a problem is never quieted.
1589
+ */
1590
+ quiet?: SuggestionCode[];
1591
+ children?: ElementSpec[];
1592
+ meta?: SpecMeta;
1593
+ }
1594
+
1595
+ /**
1596
+ * Per element *type* defaults — what `.plitzi__heading` resolves to before any class applies.
1597
+ *
1598
+ * `slots` dresses the type's OTHER selectors — a modal's `rootContainer`, a form control's `input` — for every
1599
+ * element of the type at once.
1600
+ */
1601
+ declare interface ElementStyleSpec {
1602
+ base?: CssSpec;
1603
+ states?: StatesSpec;
1604
+ variants?: Record<string, CssSpec | VariantSpec>;
1605
+ ancestors?: Record<string, AncestorSpec>;
1606
+ pseudos?: PseudosSpec;
1607
+ conditions?: Record<string, ConditionSpec>;
1608
+ slots?: Record<string, StyleSpec>;
1609
+ }
1610
+
1611
+ declare type FontBase = {
1612
+ /** What `font-family` names. Unique within a space. */
1613
+ family: string;
1614
+ /** Appended to the stack — `'Lato', sans-serif` — and what renders while the face loads. */
1615
+ fallback: string;
1616
+ /** The weights the family really provides: what the picker offers, and what it disables against. */
1617
+ weights: number[];
1618
+ styles: FontStyle[];
1619
+ display?: FontDisplay_2;
1620
+ /** Worth a `<link rel="preload">`. The body family, and at most one more: preloading everything
1621
+ * is the same as preloading nothing. */
1622
+ preload?: boolean;
1623
+ };
1624
+
1625
+ declare type FontDisplay_2 = 'auto' | 'block' | 'swap' | 'fallback' | 'optional';
1626
+
1627
+ /** One face of a family: the file carrying a given weight and slant. */
1628
+ declare type FontFace_2 = {
1629
+ weight: number;
1630
+ style: FontStyle;
1631
+ format: 'woff2' | 'woff';
1632
+ /** Limits the face to the code points it covers, so the browser fetches it only when needed. */
1633
+ unicodeRange?: string;
1634
+ };
1635
+
1636
+ declare type FontStyle = 'normal' | 'italic';
1637
+
1638
+ /** Google Fonts, reached through the single aggregated `css2` request the resolver builds. */
1639
+ declare type GoogleFont = FontBase & {
1640
+ source: 'google';
1641
+ subsets?: string[];
1642
+ };
1643
+
1644
+ /** Uploaded to this deployment's font store. `path` is store-relative and never absolute: a
1645
+ * manifest that carried `https://cdn.plitzi.com/...` would follow a space onto a server that is
1646
+ * not ours and keep asking Plitzi for its fonts. The URL is made at render time. */
1647
+ declare type HostedFont = FontBase & {
1648
+ source: 'hosted';
1649
+ files: (FontFace_2 & {
1650
+ path: string;
1651
+ })[];
1652
+ };
1653
+
1654
+ declare type InteractionCallbackParamValues<T extends Record<string, unknown> = Record<string, unknown>> = T;
1655
+
1656
+ declare type InteractionCallbackType = 'trigger' | 'globalCallback' | 'callback' | 'utility' | 'task';
1657
+
1658
+ declare type InteractionParamType = 'boolean' | 'select' | 'text' | 'number' | 'textarea' | 'codemirror-text' | 'codemirror-json' | 'elements';
1659
+
1660
+ /**
1661
+ * A space's keyframes as an author writes them: by name, each frame keyed by its offset — `from`, `to`, `'50%'`,
1662
+ * `'0%, 100%'` — and its rules as any other CSS is written, shorthands allowed:
1663
+ *
1664
+ * ```ts
1665
+ * keyframes: { 'caret-blink': { '0%, 100%': { opacity: 1 }, '50%': { opacity: 0 } } }
1666
+ * ```
1667
+ *
1668
+ * A class plays them with `animation-name` (`animation: 'caret-blink 1s steps(1) infinite'`).
1669
+ */
1670
+ declare type KeyframesSpec = Record<string, Record<string, CssProps>>;
1671
+
1672
+ /** A layout shell: what pages render inside, so its elements are on screen wherever a page names it. */
1673
+ declare interface LayoutHandle extends ElementHandle {
1674
+ /** Everything in the shell, by id — the header and the navigation a test reaches for on any page. */
1675
+ elements: Record<string, ElementHandle>;
1676
+ /** The layout this shell itself renders inside, for a shell within a shell. */
1677
+ layout?: string;
1678
+ }
1679
+
1680
+ /**
1681
+ * Which layout a page — or another layout — renders inside, and where in it.
1682
+ *
1683
+ * Both halves, always: the layout is the shell (the header, the sidebar), and `slot` is the element inside that
1684
+ * shell the page's body is rendered into. A layout named without a slot has nowhere to put the page, which is why
1685
+ * they are one field rather than two.
1686
+ */
1687
+ declare interface LayoutRef {
1688
+ /** The id of a layout declared in {@link SpaceSpec.layouts}. */
1689
+ id: string;
1690
+ /** The id of an element inside that layout, where the body goes. */
1691
+ slot: string;
1692
+ }
1693
+
1694
+ /**
1695
+ * A shell several pages share — a root of its own, never inside a page and never one of them.
1696
+ *
1697
+ * It is written once and every page that names it renders inside it, so the header and the sidebar are the same
1698
+ * nodes on every page rather than a copy per page that drifts. A layout may itself sit inside another one, and the
1699
+ * page resolves the chain from the outside in.
1700
+ */
1701
+ declare interface LayoutSpec {
1702
+ /** The name a page's {@link LayoutRef} uses. */
1703
+ id: string;
1704
+ /** What the builder's tree shows. */
1705
+ label?: string;
1706
+ /** The page folder the builder files it under. It does not route anything: a layout has no URL of its own. */
1707
+ folder?: string;
1708
+ /** The layout this one renders inside, for a shell within a shell. */
1709
+ layout?: LayoutRef;
1710
+ attributes?: Record<string, unknown>;
1711
+ css?: CssSpec;
1712
+ states?: StatesSpec;
1713
+ /** As {@link ElementSpec.selector}. */
1714
+ selector?: string;
1715
+ class?: ClassList;
1716
+ bind?: BindingsSpec;
1717
+ flows?: StepSpec[][];
1718
+ body: ElementSpec[];
1719
+ }
1720
+
1721
+ /** Where in the project's own files an error points first, and what it says: a module that did not load, located. */
1722
+ export declare const moduleProblem: (error: unknown, root: string) => string;
1723
+
1724
+ /**
1725
+ * An element's declared motion — how it arrives, when, and whether it keeps moving — which the SDK's own stylesheet
1726
+ * plays (`_motion.scss`). Every preset moves only `opacity` and `transform`, which the compositor animates without
1727
+ * laying the page out again, and every one is stilled for a visitor who asked for less motion: the motion good
1728
+ * practices, kept by construction rather than by the author.
1729
+ *
1730
+ * The one description the authoring package, the builder's Motion tab, the MCP and the validator all read; the
1731
+ * stylesheet mirrors its presets and frames, and a test in `apps/sdk` holds the two together.
1732
+ */
1733
+ declare const MOTION_ENTERS: readonly ["fade", "fade-up", "fade-down", "slide-left", "slide-right", "slide-up", "scale", "zoom-in", "zoom-out", "pop", "bounce-in", "tilt", "spin-in"];
1734
+
1735
+ /**
1736
+ * A motion that repeats: a gentle rise and fall, a breath, a turn, a sway — a bounce, a wobble, a small orbit, a
1737
+ * heartbeat, a drift. Held until the page is live.
1738
+ */
1739
+ declare const MOTION_LOOPS: readonly ["float", "pulse", "spin", "sway", "bounce", "wobble", "orbit", "heartbeat", "drift"];
1740
+
1741
+ /**
1742
+ * When an arrival plays: as the page loads (`load`); once, as the element first comes into view, and then it stays
1743
+ * (`view`); or with the scroll itself, at the reader's pace — played backwards when the reader scrolls back up past it
1744
+ * (`scroll`).
1745
+ */
1746
+ declare const MOTION_TRIGGERS: readonly ["load", "view", "scroll"];
1747
+
1748
+ declare type MotionEnter = (typeof MOTION_ENTERS)[number];
1749
+
1750
+ declare type MotionLoop = (typeof MOTION_LOOPS)[number];
1751
+
1752
+ declare type MotionTrigger = (typeof MOTION_TRIGGERS)[number];
1753
+
1754
+ /**
1755
+ * How a space's notifications look — the toasts an `addNotification` step shows: the toast, and the parts inside it
1756
+ * (its icon, its close button, its progress bar).
1757
+ *
1758
+ * Every value is one CSS value — a colour, a length, a weight — and a token is the right answer wherever there is one
1759
+ * (`'var(--card)'`): a token follows the light/dark toggle, which the notifications already do. Left out, a value keeps
1760
+ * the library's own.
1761
+ */
1762
+ declare interface NotificationsSpec {
1763
+ /** The toast's surface. */
1764
+ background?: string;
1765
+ /** Its text. */
1766
+ text?: string;
1767
+ /** The accent of each `appearance`: its icon and its progress bar. */
1768
+ success?: string;
1769
+ danger?: string;
1770
+ warning?: string;
1771
+ info?: string;
1772
+ /** Corner radius, e.g. `'12px'`. */
1773
+ radius?: string;
1774
+ /** Its typeface — the space's own, as a token: `'var(--font-sans)'`. */
1775
+ font?: string;
1776
+ /** Its text size, e.g. `'13px'`. */
1777
+ fontSize?: string;
1778
+ /** Its edge, as `border` writes it: `'1px solid var(--border)'`. */
1779
+ border?: string;
1780
+ /** Its depth, as `box-shadow` writes it: `'var(--shadow-lg)'`. */
1781
+ shadow?: string;
1782
+ /** The room inside it, e.g. `'12px 14px'`. */
1783
+ padding?: string;
1784
+ /** The least it is tall — `'0px'` lets a one-line message be one line high. */
1785
+ minHeight?: string;
1786
+ /** Its text's weight, e.g. `'500'`. */
1787
+ fontWeight?: string;
1788
+ /** Its text's leading, e.g. `'1.45'`. */
1789
+ lineHeight?: string;
1790
+ /** The icon's width, e.g. `'18px'`. */
1791
+ iconSize?: string;
1792
+ /** The room between the icon and the message, e.g. `'10px'`. */
1793
+ iconGap?: string;
1794
+ /** The close button's colour, e.g. `'var(--muted)'`. */
1795
+ closeColor?: string;
1796
+ /** How opaque the close button is at rest, e.g. `'0.8'`; hovered or focused it is opaque. */
1797
+ closeOpacity?: string;
1798
+ /** How tall the progress bar is, e.g. `'2px'`. */
1799
+ progressHeight?: string;
1800
+ }
1801
+
1802
+ declare type Operator = '' | '=' | '!=' | '<' | '>' | '<=' | '>=' | 'contains' | 'doesNotContain' | 'beginsWith' | 'doesNotBeginWith' | 'endsWith' | 'doesNotEndWith' | 'empty' | 'notEmpty' | 'in' | 'notIn' | 'between' | 'notBetween';
1803
+
1804
+ declare type PageFolder = {
1805
+ id: string;
1806
+ name: string;
1807
+ slug: string;
1808
+ parentId?: PageFolder['id'];
1809
+ };
1810
+
1811
+ /**
1812
+ * A folder of pages, which is a ROUTING decision and not a filing one.
1813
+ *
1814
+ * A folder's slug prefixes the path of every page in it — a page called `getting-started` inside a folder called
1815
+ * `docs` answers at `/docs/getting-started` — and folders nest, so the prefix is the chain of slugs from the root.
1816
+ * The builder also draws them as the tree in its page list, but that is the smaller half: without folders a space
1817
+ * authored in code cannot produce a nested URL at all.
1818
+ */
1819
+ declare interface PageFolderSpec {
1820
+ /** The name a page refers to it by, and its id in the document. */
1821
+ id: string;
1822
+ /** What the builder's page tree shows. Defaults to the id. */
1823
+ name?: string;
1824
+ /** The path segment this folder contributes. Defaults to the id. */
1825
+ slug?: string;
1826
+ /** The folder this one sits inside, by id. */
1827
+ parent?: string;
1828
+ }
1829
+
1830
+ declare interface PageHandle extends ElementHandle {
1831
+ slug: string;
1832
+ /** The route a test navigates to, leading slash included — `/` for the home page. */
1833
+ path: string;
1834
+ /** Who the page is for, as declared. An `authenticated` page answers a visitor with no session with a 403 or a redirect. */
1835
+ accessLevel?: 'public' | 'authenticated';
1836
+ /** The route params its slug declares (`post/{{slug}}` → `['slug']`). A path with any is not a URL until they are filled. */
1837
+ params: string[];
1838
+ /** The layout this page renders inside, by id — whose elements are on screen here too. */
1839
+ layout?: string;
1840
+ /** Everything on this page, by id. */
1841
+ elements: Record<string, ElementHandle>;
1842
+ }
1843
+
1844
+ declare interface PageSpec {
1845
+ name: string;
1846
+ /** As {@link ElementSpec.id} — a page is an element, and its flows are targeted the same way. */
1847
+ id?: string;
1848
+ /** Route, without a leading slash. Empty is the home page. */
1849
+ slug: string;
1850
+ isDefault?: boolean;
1851
+ seoTitle?: string;
1852
+ seoDescription?: string;
1853
+ /**
1854
+ * Who this page is FOR, and the trap is that omitting it is not the same as `public`.
1855
+ *
1856
+ * A page with no `accessLevel` is authored for everybody and matches in both states. `public` means *signed-out
1857
+ * visitors only* — it is one half of the pair that lets a space put a sign-in page and the page behind it on the
1858
+ * same path — so a lone `public` page vanishes from the route table the moment anyone has a session, and the
1859
+ * space answers 403 to its own owner. Left undefined unless the author means it.
1860
+ */
1861
+ accessLevel?: 'public' | 'authenticated';
1862
+ /**
1863
+ * Where a visitor this page is not for is sent — a page's id or slug (`login`; `''` is the home page), its path, or a
1864
+ * full URL for somewhere off this space. Resolved to the page's id, and refused when it names no page.
1865
+ *
1866
+ * Without it they are answered 403, which is correct and rarely what a site wants: somebody who followed a link
1867
+ * to a members page should land on the sign-in, not on a refusal. One field rather than the router's two,
1868
+ * because naming the destination and asking to be redirected are one decision.
1869
+ */
1870
+ unauthorizedRedirect?: string;
1871
+ /**
1872
+ * The folder this page sits in, by the id declared in {@link SpaceSpec.pageFolders}.
1873
+ *
1874
+ * It changes where the page ANSWERS, not just where it is filed: the folder's slug (and its parents') prefixes
1875
+ * the route. A page naming a folder the space does not declare is refused.
1876
+ */
1877
+ folder?: string;
1878
+ /** The shared layout this page renders inside. See {@link LayoutRef}. */
1879
+ layout?: LayoutRef;
1880
+ css?: CssSpec;
1881
+ /** As {@link ElementSpec.selector}. */
1882
+ selector?: string;
1883
+ /** As {@link ElementSpec.class} — a shared class instead of a selector of this page's own. */
1884
+ class?: ClassList;
1885
+ flows?: StepSpec[][];
1886
+ /** As {@link ElementSpec.flag}: a page whose flag says no is not found. */
1887
+ flag?: string;
1888
+ body: ElementSpec[];
1889
+ }
1890
+
12
1891
  /**
13
1892
  * What `authorSpace` reads from a plugin's declaration. Structural, so a `PluginDeclaration`, an element's own
14
1893
  * declaration and a manifest's `pluginSchema` entry (with its `type`) all fit.
@@ -57,6 +1936,42 @@ declare interface PluginDeclarationData {
57
1936
  */
58
1937
  export declare const pluginDeclarations: (folder: string | URL) => Promise<PluginDeclarationData[]>;
59
1938
 
1939
+ /** What a project `@plitzi/cli` writes checks its space against: the part of `authorSpace`'s options its files say. */
1940
+ export declare type ProjectAuthoring = {
1941
+ plugins: PluginDeclarationData[];
1942
+ pluginTypes: string[];
1943
+ serverData?: (query: string) => unknown;
1944
+ data: (query: string) => unknown;
1945
+ };
1946
+
1947
+ /**
1948
+ * What `authorSpace` checks the space of a project `@plitzi/cli` writes against, read from the project the process runs
1949
+ * — so its server, `npm run author` and the CLI's checks hold the space to the same thing:
1950
+ *
1951
+ * - `plugins`: every plugin folder's declaration (`src/plugins/<Name>/declaration.ts`, `pluginDeclarations`);
1952
+ * - `pluginTypes`: the element types of the plugins it runs as they were built (`vendor/plugins/`);
1953
+ * - `serverData`: the project's own data, which only its server reads (`src/data/`, `projectData`) — a server-mode
1954
+ * project's; one with no server has no such folder, and its providers read `public/data/` from the browser;
1955
+ * - `data`: the JSON files it serves (`public/`, `publicData`).
1956
+ *
1957
+ * A folder the project does not have is nothing to check against. The project is the working directory — its scripts
1958
+ * run there, `npm start` and `npm run author` alike — and a process started anywhere else is refused, saying what is
1959
+ * missing (`projectRoot` of `@plitzi/sdk-shared/project/root`, the check its server makes too). So is a project laid out
1960
+ * where nothing reads it — a plugin folder with no `index.ts`, code in `src/plugin/`, `.env` in `src/` — every error at
1961
+ * once (`assertProjectLayout` of `@plitzi/sdk-shared/project/layout`, what its server and `plitzi doctor` say too).
1962
+ *
1963
+ * ```ts
1964
+ * authorSpace(space, await projectAuthoring());
1965
+ * ```
1966
+ */
1967
+ export declare const projectAuthoring: () => Promise<ProjectAuthoring>;
1968
+
1969
+ /**
1970
+ * `projectAuthoring` of the project at `root`, held to the same check: for a tool that works on a project from another
1971
+ * folder — the CLI, run anywhere inside one. A project's own code calls `projectAuthoring()`.
1972
+ */
1973
+ export declare const projectAuthoringAt: (root: string) => Promise<ProjectAuthoring>;
1974
+
60
1975
  /**
61
1976
  * What a provider's `/data/<file>` query answers from the project's own data — `src/data/`, which its server reads and
62
1977
  * never serves (`dataDir`) — for `authorSpace`'s `serverData`: bindings are held to the file, and a provider reading
@@ -64,6 +1979,58 @@ export declare const pluginDeclarations: (folder: string | URL) => Promise<Plugi
64
1979
  */
65
1980
  export declare const projectData: (folder: string | URL) => ((query: string) => unknown);
66
1981
 
1982
+ /**
1983
+ * A module of the project that did not load — a file that does not parse, an import of nothing, a module that throws
1984
+ * as it runs — said at the first of the project's own files it points at: `src/space/hero.ts:139: Expected ','…`. The
1985
+ * server, `npm run author` and the CLI each say it in those words, never as a stack.
1986
+ */
1987
+ export declare class ProjectModuleError extends Error {
1988
+ constructor(message: string);
1989
+ }
1990
+
1991
+ /**
1992
+ * The space of the project this process runs — `src/space/index.ts`'s `space` — with what it is checked against, once
1993
+ * the project's root and layout are (`projectAuthoring`). Imported only then, so a factory that refuses what it is
1994
+ * given as the space's files load is said like the rest — the message, not a stack. A module that exports no space is
1995
+ * refused, saying what to export (`ProjectSpaceError`).
1996
+ */
1997
+ export declare const projectSpace: () => Promise<ProjectSpaceSource>;
1998
+
1999
+ /**
2000
+ * `projectSpace` of the project at `root`, held to the same checks: for a tool that works on a project from another
2001
+ * folder — the CLI, run anywhere inside one. A project's own code calls `projectSpace()` or `authorProjectSpace()`.
2002
+ */
2003
+ export declare const projectSpaceAt: (root: string) => Promise<ProjectSpaceSource>;
2004
+
2005
+ /** A project whose space module (`src/space/index.ts`) exports no space: its message says what to export. */
2006
+ export declare class ProjectSpaceError extends Error {
2007
+ constructor(module: string);
2008
+ }
2009
+
2010
+ /** The space a project declares in `src/space/`, with what it is checked against (`projectAuthoring`). */
2011
+ export declare type ProjectSpaceSource = {
2012
+ space: SpaceSpec;
2013
+ authoring: ProjectAuthoring;
2014
+ };
2015
+
2016
+ /** A pseudo-element's rules in the object form: its own, and the selector's states that change them. */
2017
+ declare interface PseudoRulesSpec {
2018
+ css?: CssSpec;
2019
+ states?: StatesSpec;
2020
+ }
2021
+
2022
+ /**
2023
+ * A pseudo-element's rules: plain CSS, or CSS with the states of the selector that show it —
2024
+ * `after: { css: { content: '"→"' }, states: { hover: { 'margin-left': '4px' } } }` is `.x::after` and `.x:hover::after`.
2025
+ */
2026
+ declare type PseudoSpec = CssSpec | PseudoRulesSpec;
2027
+
2028
+ /**
2029
+ * What a selector draws or dresses besides the element — `before`, `after`, `marker`, `placeholder`, `first-letter`,
2030
+ * `first-line`, `selection` (`STYLE_PSEUDOS`). `content` is written as CSS reads it, quotes included: `'"→"'`.
2031
+ */
2032
+ declare type PseudosSpec = Partial<Record<StylePseudo, PseudoSpec>>;
2033
+
67
2034
  /**
68
2035
  * What a provider's `query` answers when it is a JSON file the project serves — `/data/plans.json` read from `public/` —
69
2036
  * for `authorSpace`'s `data`: every binding onto that provider is then held to the file. Anything else — another site,
@@ -72,6 +2039,819 @@ export declare const projectData: (folder: string | URL) => ((query: string) =>
72
2039
  */
73
2040
  export declare const publicData: (folder: string | URL) => ((query: string) => unknown);
74
2041
 
2042
+ /** Someone else's origin — Adobe Fonts, Bunny, Fontshare, the customer's own CDN. Either a
2043
+ * stylesheet that declares the faces, or the files themselves. */
2044
+ declare type RemoteFont = FontBase & {
2045
+ source: 'remote';
2046
+ stylesheet?: string;
2047
+ files?: (FontFace_2 & {
2048
+ url: string;
2049
+ })[];
2050
+ };
2051
+
2052
+ /** A selector's whole block per breakpoint, as it reaches the document. */
2053
+ declare type ResponsiveBlock = Partial<Record<DisplayMode, StyleBlock>>;
2054
+
2055
+ /**
2056
+ * Per-breakpoint CSS as an author writes it. Omitted breakpoints inherit `desktop`, as they do in the builder — and
2057
+ * only `desktop`: `tablet` (48–64rem) and `mobile` (up to 48rem) are disjoint ranges, so a `tablet` rule never
2058
+ * reaches a phone unless `mobile` repeats it.
2059
+ *
2060
+ * `compact` is both of them at once — everything narrower than a desktop: the dock that replaces a sidebar, the grid
2061
+ * that drops to one column. Written out to `tablet` and `mobile` alike, under whatever either says for itself, so
2062
+ * the document still holds the three breakpoints the builder edits.
2063
+ */
2064
+ declare type ResponsiveCss = Partial<Record<DisplayMode | 'compact', CssProps>>;
2065
+
2066
+ /** One property's value per breakpoint — `{ desktop: '24px', mobile: '18px' }` — inside a plain rule set. */
2067
+ declare type ResponsiveValue = Partial<Record<DisplayMode | 'compact', StyleValue>>;
2068
+
2069
+ declare type Rule = {
2070
+ id?: string;
2071
+ field: string;
2072
+ operator: Operator;
2073
+ enabled?: boolean;
2074
+ } & ({
2075
+ isBinding: true;
2076
+ value: string;
2077
+ } | {
2078
+ isBinding?: false;
2079
+ value: RuleValue;
2080
+ });
2081
+
2082
+ declare type RuleGroup = {
2083
+ id?: string;
2084
+ combinator: Combinator;
2085
+ rules: (Rule | RuleGroup)[];
2086
+ enabled?: boolean;
2087
+ };
2088
+
2089
+ /**
2090
+ * Everything one selector can say, where plain CSS is not enough.
2091
+ *
2092
+ * `:hover` and the variants are not separate classes in Plitzi — they are parts of the SAME selector, which is what
2093
+ * the style editor shows as tabs of one class. Writing them as a second class (`.card:hover` in `customCss`) renders,
2094
+ * and then cannot be read back or overridden per breakpoint, so they are declared beside the rules they modify.
2095
+ */
2096
+ declare interface RuleSetSpec extends VariantSpec {
2097
+ /** By name — what `data-variant` and an element's `variant` select. Plain CSS, or CSS with states of its own. */
2098
+ variants?: Record<string, CssSpec | VariantSpec>;
2099
+ /**
2100
+ * How this selector looks inside an ANCESTOR, keyed by a class that ancestor wears: always (`css` — the shared icon
2101
+ * that is smaller inside a toolbar), or while the ancestor is in a state or variant (a card's hover moving its
2102
+ * icon, a collapsed sidebar hiding its labels). Any ancestor counts, not only the parent. Name the
2103
+ * class by its declaration — `[card.name]: { states: { hover: … } }` — so a rename reaches it.
2104
+ *
2105
+ * The selector's own states and variants win over these where both set a property.
2106
+ *
2107
+ * `'>'` is the element's parent, whatever class it wears — what a closed component's part reacts to without naming
2108
+ * the class of the element around it: `ancestors: { '>': { states: { expanded: { transform: 'rotate(180deg)' } } } }`.
2109
+ */
2110
+ ancestors?: Record<string, AncestorSpec>;
2111
+ /** Rules under a condition of the page — reduced motion, a container's width — by condition. */
2112
+ conditions?: Record<string, ConditionSpec>;
2113
+ }
2114
+
2115
+ declare type RuleValue = Date | string | number | boolean | undefined | null | object;
2116
+
2117
+ declare type Schema = {
2118
+ flat: Record<string, Element_2>;
2119
+ definition: {
2120
+ name: string;
2121
+ permanentUrl: string;
2122
+ };
2123
+ variables: SchemaVariable[];
2124
+ /** Keyed by the name each is read by. A space that declares none has none — documents written before flags too. */
2125
+ flags?: Record<string, SchemaFlag>;
2126
+ settings: {
2127
+ keepState?: boolean;
2128
+ stateStorage?: 'localStorage' | 'sessionStorage';
2129
+ /**
2130
+ * Keys of `runtime.state` that are never kept, even with `keepState` on: they are not written, not brought back,
2131
+ * and a value one of them already holds survives the moment the rest is restored. For state that must start fresh
2132
+ * on every visit — a demo, a panel somebody left open, a step of a walkthrough. Top-level keys, as `setState`
2133
+ * writes them.
2134
+ */
2135
+ transientState?: string[];
2136
+ /**
2137
+ * Keys of `runtime.state` the first paint depends on — the tool a toolbar shows, a name in an avatar — kept in a
2138
+ * cookie as well as in `stateStorage`, so the server renders with them and the page does not swap them in after
2139
+ * hydration. Small values only: the cookie travels with every request and holds at most a few kilobytes. Needs
2140
+ * `keepState`; a key cannot be both painted and transient. Top-level keys, as `setState` writes them.
2141
+ */
2142
+ paintedState?: string[];
2143
+ customCss: string;
2144
+ /**
2145
+ * The roles a signed-in visitor may hold in this space, each with the permissions it gives:
2146
+ * `{ author: ['postPublish'] }`. They are what an action's `access: 'role'` and a page's `can()` are answered from
2147
+ * — a visitor holds exactly the permissions of their roles here, never those of their account anywhere else.
2148
+ *
2149
+ * Declared by the space, so they are published, versioned and exported with it. WHO holds which is not: that is a
2150
+ * list of people, kept by the platform the space runs on, and never part of a document anybody can read.
2151
+ */
2152
+ visitorRoles?: Record<string, string[]>;
2153
+ /** `basic` covers any HTTP+JSON backend by configuration; anything else is a name someone registered. */
2154
+ userProvider?: 'basic' | 'custom' | '' | (string & {});
2155
+ tokenStorage?: 'localStorage' | 'sessionStorage' | '';
2156
+ loginUrl?: string;
2157
+ userUrl?: string;
2158
+ refreshUrl?: string;
2159
+ logoutUrl?: string;
2160
+ detailsPath?: string;
2161
+ tokenPath?: string;
2162
+ refreshTokenPath?: string;
2163
+ expirationTimePath?: string;
2164
+ refreshExpirationTimePath?: string;
2165
+ /**
2166
+ * Name of a readable (non-httpOnly) cookie your backend sets alongside its session cookie, whose value is
2167
+ * `<access expiry>.<refresh expiry>` in unix seconds. It carries no credential — only when the session dies —
2168
+ * and it is what lets a page answer "is anyone signed in here?" with no request at all, including the answer
2169
+ * "no". Without it, a first load with empty storage has to ask the backend to find out.
2170
+ */
2171
+ sessionHintCookie?: string;
2172
+ /**
2173
+ * Where to hand a credential this browser obtained on its own, so the rendering server can establish a session
2174
+ * of its own for it. Declaring it is how a space says "my sign-in happens in the browser" — a client-side
2175
+ * identity provider (Auth0 and the like) leaves the server rendering pages as a guest while the browser knows
2176
+ * who this is, and the page changes under the visitor as it hydrates. Leave empty when your backend issues the
2177
+ * session itself, which is the case whenever `loginUrl` is your own API.
2178
+ */
2179
+ sessionExchangeUrl?: string;
2180
+ /**
2181
+ * Where a sign-in that owed a second factor is completed: a password the backend answered with `mfaRequired` and
2182
+ * an `mfaToken` resolves `auth.login` to `{ ok: false, reason: 'mfa', mfaToken }`, and `auth.login` with `mode:
2183
+ * 'mfa'` posts `{ mfaToken, code }` here and adopts the session it answers with. Leave empty when the backend has
2184
+ * no second factor.
2185
+ */
2186
+ mfaUrl?: string;
2187
+ /**
2188
+ * What to do on a page that requires a session while the stored one is being re-checked. `optimistic` (the
2189
+ * default) renders from the stored session and signs out if the check disagrees; `strict` waits for the answer,
2190
+ * trading a round trip for never showing a signed-in page to someone whose session has just ended.
2191
+ */
2192
+ sessionGate?: 'optimistic' | 'strict';
2193
+ /** How old a confirmation may get before the SDK re-checks on the next focus. Defaults to 300. */
2194
+ sessionRevalidateSeconds?: number;
2195
+ /**
2196
+ * Lets the published site open the dev tools — elements, state, interactions — for anybody who visits it.
2197
+ *
2198
+ * The same `debugMode` the SDK and the page server take, answered by the space: read by a page server that left the
2199
+ * decision open. A server that sets its own `debugMode` decides for every space it renders, and an explicit
2200
+ * `false` there cannot be turned around from here. Never `devMode`, which makes a deployment a development server.
2201
+ */
2202
+ debugMode?: boolean;
2203
+ /**
2204
+ * Values the space computes once and reads everywhere, by name: `{ xp: '{{ state.favourites|length * 10 }}' }` is
2205
+ * read as `{{ computed.xp }}` in any binding, attribute or step. Each is a template over the global sources and the
2206
+ * values declared before it (`computed.<earlier>`), re-evaluated when any of them changes. A template that is one
2207
+ * `{{ expression }}` gives its value (a number, a list); anything else gives text.
2208
+ */
2209
+ computed?: Record<string, string>;
2210
+ /**
2211
+ * The realtime channels the space offers, by topic pattern: `{ 'board:{id}': { access: { mode: 'public' } } }`.
2212
+ * A page subscribes to and publishes on a topic one of them matches, and on nothing else.
2213
+ */
2214
+ channels?: ChannelDeclarations;
2215
+ };
2216
+ rsc?: SchemaRsc;
2217
+ pages: Element_2['id'][];
2218
+ pageFolders: PageFolder[];
2219
+ components: Record<SpaceComponent['id'], SpaceComponent>;
2220
+ };
2221
+
2222
+ /**
2223
+ * A feature flag the space declares, under the name it is read by: `{{ flags.newCheckout }}`.
2224
+ *
2225
+ * Read with the document, stored apart from it: each environment has one set, shared by every revision it serves, so a
2226
+ * flag is turned without a new revision and a rollback keeps the flags as they are. A revision keeps a copy of the flags
2227
+ * it was published with, read only when the environment's own cannot be. The draft (`main`) applies whatever it says
2228
+ * now; a published environment, what was last published to it. Its rules see the environment, the host, the URL and
2229
+ * who is visiting (`user.authenticated`, `user.email`, `user.username`, `user.roles`). Whoever runs the space may
2230
+ * override the answer — the server it is rendered by, then the SDK embedding it, then a tester with the dev tools —
2231
+ * but only for flags declared here.
2232
+ */
2233
+ declare type SchemaFlag = {
2234
+ description?: string;
2235
+ /** The answer when no rule matches. */
2236
+ value: boolean;
2237
+ rules: SchemaFlagRule[];
2238
+ };
2239
+
2240
+ /** A value a flag takes where its `when` matches. The first rule that matches decides. */
2241
+ declare type SchemaFlagRule = {
2242
+ when: RuleGroup;
2243
+ value: boolean;
2244
+ };
2245
+
2246
+ declare type SchemaRsc = {
2247
+ enabled?: boolean;
2248
+ /** Wire protocol for RSC updates. 'json' is the default (data-only). 'stream' uses the RSC wire format (requires react-server condition). */
2249
+ transport?: 'json' | 'stream';
2250
+ };
2251
+
2252
+ declare type SchemaValidationError = {
2253
+ code: string;
2254
+ message: string;
2255
+ elementId?: string;
2256
+ /** The component whose tree the error is in; absent for the pages' tree. */
2257
+ componentId?: string;
2258
+ /** The name an element points at that no element answers to — what a suggestion of the nearest one is made from. */
2259
+ missing?: string;
2260
+ /** The step the missing element was to answer (`openModal`): a suggestion is drawn from the elements that do. */
2261
+ wantedBy?: string;
2262
+ details?: unknown;
2263
+ };
2264
+
2265
+ declare type SchemaVariable = SchemaVariableBase<'number', number> | SchemaVariableBase<'checkbox' | 'switch', boolean> | SchemaVariableBase<'text' | 'email' | 'password' | 'select' | 'select2' | 'textarea' | 'color', string>;
2266
+
2267
+ declare type SchemaVariableBase<TType extends string, TValue> = {
2268
+ name: string;
2269
+ category: string;
2270
+ type: TType;
2271
+ value: TValue;
2272
+ subValues: {
2273
+ when: RuleGroup;
2274
+ value: TValue;
2275
+ }[];
2276
+ };
2277
+
2278
+ /**
2279
+ * A reusable subtree of the space: declared once, placed on any page as an instance (a `reference` element with
2280
+ * `referenceType: 'component'`), and versioned, published and copied with the space because it is part of it.
2281
+ *
2282
+ * Its tree is a `flat` of its own rather than roots inside `schema.flat`: that one is the tree of the pages, and a
2283
+ * component belongs to none. Ids are still one namespace across every tree, so an id alone says which tree it is in.
2284
+ */
2285
+ declare type SpaceComponent = {
2286
+ /** The key it is stored under, and what an instance names in `referenceId`. */
2287
+ id: string;
2288
+ label?: string;
2289
+ /** The page folder the builder files it under. It routes nothing: a component has no URL of its own. */
2290
+ folder?: string;
2291
+ /** What an instance hands in, each as an attribute of the instance; read inside as `{{ props.<name> }}`. */
2292
+ props?: Record<string, ComponentProp>;
2293
+ /** Elements of `flat` an instance fills with its children, each child naming the one it goes in (`slot`). */
2294
+ slots?: Element_2['id'][];
2295
+ rootId: Element_2['id'];
2296
+ /** `rootId` with no parent, and everything under it. */
2297
+ flat: Record<Element_2['id'], Element_2>;
2298
+ };
2299
+
2300
+ declare type SpaceFont = SystemFont | GoogleFont | RemoteFont | HostedFont;
2301
+
2302
+ declare interface SpaceHandles {
2303
+ /** The pages, by id. */
2304
+ pages: Record<string, PageHandle>;
2305
+ /** The layout shells, by id. */
2306
+ layouts: Record<string, LayoutHandle>;
2307
+ /** Every element of every page and every layout, by id — ids are unique across the whole document. */
2308
+ elements: Record<string, ElementHandle>;
2309
+ /**
2310
+ * One element, by id, or a throw naming what does exist.
2311
+ *
2312
+ * A throw rather than `undefined`, because the caller is a test: handed nothing, it would build a selector matching
2313
+ * nothing and report a missing element on screen, which is a true statement about the wrong thing.
2314
+ */
2315
+ element(id: string): ElementHandle;
2316
+ /** One page, by id or by slug. Throws the same way, for the same reason. */
2317
+ page(idOrSlug: string): PageHandle;
2318
+ }
2319
+
2320
+ declare interface SpaceSpec {
2321
+ name: string;
2322
+ permanentUrl: string;
2323
+ /** CSS custom properties, by category. `color` is the usual one. */
2324
+ variables?: Partial<StyleVariables>;
2325
+ /**
2326
+ * Named classes an element can reach with `class`, so a rule is written once.
2327
+ *
2328
+ * A space-wide stylesheet, and the right place for the rules that describe the space rather than one section of
2329
+ * it. `styles()` is the same thing declared next to what it dresses; both end up here.
2330
+ *
2331
+ * In ORDER: the stylesheet lists these first, in the order written, and then the `styles()` declarations the tree
2332
+ * names that are not here. Order decides which of two classes wins where one element wears both and they set the
2333
+ * same property — `class: [shareFill, fillDanger]` — so a declaration can be named here too, by its variable, to
2334
+ * put it in its place: `{ 'an-share-fill': shareFill, 'an-fill-danger': fillDanger }`.
2335
+ */
2336
+ classes?: Record<string, StyleSpec | StyleDeclaration>;
2337
+ elements?: Record<string, ElementStyleSpec>;
2338
+ schemaVariables?: SchemaVariable[];
2339
+ customCss?: string;
2340
+ /**
2341
+ * The space's own `@keyframes`, by name — what a class plays with `animation-name`:
2342
+ * `{ 'caret-blink': { '0%, 100%': { opacity: 1 }, '50%': { opacity: 0 } } }`. For how an element arrives or the loop it
2343
+ * keeps, declared `motion` says it better; these are for the rest (a caret, a drifting gradient, a panel sliding in).
2344
+ * Written at the top of `customCss`, where the style editor reads them back.
2345
+ */
2346
+ keyframes?: KeyframesSpec;
2347
+ /**
2348
+ * How the notifications an `addNotification` step shows look: `{ background: 'var(--card)', text: 'var(--foreground)',
2349
+ * success: 'var(--accent)', radius: '12px' }`. They follow the light/dark theme and the page's font already.
2350
+ */
2351
+ notifications?: NotificationsSpec;
2352
+ /**
2353
+ * Values computed once and read everywhere as `{{ computed.<name> }}` — an expression a dozen bindings would
2354
+ * otherwise each repeat:
2355
+ *
2356
+ * ```ts
2357
+ * computed: {
2358
+ * xp: '{{ (state.favourites|length) * 10 + (state.runs ?? 0) * 5 }}',
2359
+ * level: '{{ computed.xp // 100 + 1 }}'
2360
+ * }
2361
+ * ```
2362
+ *
2363
+ * Each is a template over the globals (`state`, `auth`, `navigation`, `variables`, `theme`, `host`) and the values
2364
+ * declared ABOVE it. One `{{ expression }}` gives its value (a number, a list, a flag); anything else gives text. An
2365
+ * element's source (a list row, a provider) is not readable here: bind that on the element.
2366
+ */
2367
+ computed?: Record<string, string>;
2368
+ /**
2369
+ * Templates by name, for what an element shows of its data: `formats: { price: "{{ source|currency('USD') }}" }`
2370
+ * once, then `text({ from: 'products.item.price', as: 'price' })` anywhere. `source` is the value `from` reads.
2371
+ */
2372
+ formats?: Record<string, string>;
2373
+ /**
2374
+ * The space's feature flags, by the name each is read by — `{{ flags.newCheckout }}` in a binding or a `when`, and
2375
+ * what an element's or a page's `flag` names:
2376
+ *
2377
+ * ```ts
2378
+ * flags: {
2379
+ * newCheckout: {
2380
+ * description: 'The one-step checkout',
2381
+ * value: false,
2382
+ * rules: [
2383
+ * { when: { combinator: 'and', rules: [{ field: 'environment', operator: '=', value: 'staging' }] }, value: true },
2384
+ * { when: { combinator: 'and', rules: [{ field: 'user.roles', operator: 'contains', value: 'beta' }] }, value: true }
2385
+ * ]
2386
+ * }
2387
+ * }
2388
+ * ```
2389
+ *
2390
+ * `value` is the answer when no rule matches; the first rule that matches decides otherwise. A rule sees
2391
+ * `environment`, `hostname`, `routeParams.*`, `queryParams.*` and the visitor (`user.authenticated`, `user.email`,
2392
+ * `user.username`, `user.roles`). Kept apart from the space's snapshots — one set per environment, turned without a
2393
+ * new snapshot — and served with Plitzi down from a self-hosted server's cache. The server rendering it, the SDK
2394
+ * embedding it and a tester with the dev tools may each override the answer — only for flags declared here. See `docs/en/feature-flags.md`.
2395
+ */
2396
+ flags?: Schema['flags'];
2397
+ /**
2398
+ * The realtime channels the space offers, by topic pattern — what a `channel` element's `topic` must match:
2399
+ *
2400
+ * ```ts
2401
+ * channels: {
2402
+ * 'board:{id}': { access: { mode: 'public' }, presence: true },
2403
+ * 'scores:{id}': { access: { mode: 'session' }, publish: 'server' }
2404
+ * }
2405
+ * ```
2406
+ *
2407
+ * `{id}` is the part a page fills in (`board:{{ id }}`); each board is its own topic. `publish: 'server'` is a
2408
+ * channel only a flow's `realtime.publish` sends on. See `docs/en/realtime.md`.
2409
+ */
2410
+ channels?: ChannelDeclarations;
2411
+ /**
2412
+ * Everything else the schema's settings carry — where sign-in posts to, which cookie hints at a session, how
2413
+ * state is kept. `customCss` above is the one field of that same object every space sets, and it stays named on
2414
+ * its own for that reason; these are the rest, spread over it.
2415
+ */
2416
+ settings?: Partial<Omit<Schema['settings'], 'customCss'>>;
2417
+ /**
2418
+ * Server-resolved data for this space's `runtime: 'server'` elements: on unless a space turns it off. Left out,
2419
+ * authoring writes `{ enabled: true }` for a space that has a server element; `{ enabled: false }` with one is warned
2420
+ * (`server-data-without-rsc`).
2421
+ */
2422
+ rsc?: Schema['rsc'];
2423
+ mode?: Style['mode'];
2424
+ theme?: Style['theme'];
2425
+ /**
2426
+ * The web fonts this space loads — Google, hosted or remote faces, or a system stack.
2427
+ *
2428
+ * A `font-family` naming a face nobody declares here renders in the fallback, and silently: the renderer loads
2429
+ * exactly this list (the page server writes its `<link>`s and `@font-face` rules into the document) and nothing
2430
+ * else ever fetches a face.
2431
+ */
2432
+ fonts?: SpaceFont[];
2433
+ /** Route prefixes a page can sit under. See {@link PageFolderSpec}. */
2434
+ pageFolders?: PageFolderSpec[];
2435
+ /** Shells pages render inside. See {@link LayoutSpec}. */
2436
+ layouts?: LayoutSpec[];
2437
+ /** Reusable subtrees, placed with {@link component}. See {@link ComponentSpec}. */
2438
+ components?: ComponentSpec[];
2439
+ pages: PageSpec[];
2440
+ }
2441
+
2442
+ /** Fields the builder shows but the runtime does not read. */
2443
+ declare interface SpecMeta {
2444
+ /**
2445
+ * The name this element answers to in the builder's tree.
2446
+ *
2447
+ * Not `label` at the top level, and not by accident: `label` is a real attribute of a link and of a form control,
2448
+ * and an authoring field of the same name would quietly shadow it — the field an author obviously means when
2449
+ * they write `label` on a form control is the one the user reads.
2450
+ */
2451
+ label?: string;
2452
+ }
2453
+
2454
+ /** Rules for the states a selector reacts to — `hover`, `focus`, `active` — each one plain or per breakpoint. */
2455
+ declare type StatesSpec = Partial<Record<StyleState, CssSpec>>;
2456
+
2457
+ /**
2458
+ * What an author declares, as opposed to what a document stores.
2459
+ *
2460
+ * A space is two documents of deeply cross-referenced ids: every element carries its own id, its parent's, its
2461
+ * root's and the name of a style selector that has to exist in three breakpoint maps, and an interaction is a
2462
+ * linked list threaded through `beforeNode`/`afterNode`. None of that is a decision — it is bookkeeping, and it is
2463
+ * derived. What is left here is what a person actually chooses: a tree, some CSS, what happens on click.
2464
+ */
2465
+ /** A step in an interaction flow. The chaining, ids and flow id are derived; this is what the author decides. */
2466
+ declare interface StepSpec {
2467
+ /**
2468
+ * What later steps call this one by.
2469
+ *
2470
+ * A flow's scope is keyed by node id, so `{{ publish.output.url }}` resolves only when the step that produced it
2471
+ * is named `publish`. Left out, the id is derived from the step's position — unique, and nothing an author can
2472
+ * write down, which is the same as saying a step's result is unreachable.
2473
+ */
2474
+ id?: string;
2475
+ type: ElementInteraction['type'];
2476
+ action: string;
2477
+ title?: string;
2478
+ params?: Record<string, unknown>;
2479
+ preview?: Record<string, unknown>;
2480
+ /** The id of the element the step is registered on. Utilities are resolved by action alone and take none. */
2481
+ on?: string;
2482
+ when?: ElementInteraction['when'];
2483
+ enabled?: boolean;
2484
+ /** On a trigger: what firing it again does while its flow still runs. See {@link whileRunning}. */
2485
+ whileRunning?: ElementInteraction['whileRunning'];
2486
+ }
2487
+
2488
+ declare type Style = {
2489
+ platform: Record<DisplayMode, Record<string, StyleItem>>;
2490
+ mode?: StyleMode;
2491
+ theme: {
2492
+ default: Theme;
2493
+ schemes: Theme[];
2494
+ };
2495
+ variables: Partial<StyleVariables>;
2496
+ /** The families this space declares. A `font-family` naming anything absent from here renders in a fallback,
2497
+ * because nothing else in the system loads a face. Optional because a document written before the manifest
2498
+ * existed has none, and that is a real state every reader has to survive rather than a bug. */
2499
+ fonts?: SpaceFont[];
2500
+ cache: string;
2501
+ };
2502
+
2503
+ /**
2504
+ * The pseudo-elements a class can dress — parts of an element the page has no node for: the box drawn before or after
2505
+ * its content, a list item's bullet, an empty field's hint, the first letter or line of a paragraph, the text a visitor
2506
+ * selects. One list, read by the type, the compiler, the style editor and authoring.
2507
+ *
2508
+ * Each is written last in its selector (`.card:hover::after`), which is the only place CSS allows it: a state, a
2509
+ * variant or a condition of the class chooses WHEN, the pseudo-element WHAT.
2510
+ */
2511
+ declare const STYLE_PSEUDOS: readonly ["before", "after", "marker", "placeholder", "first-letter", "first-line", "selection"];
2512
+
2513
+ /**
2514
+ * The states a selector can react to — one list, read by the type, the style editor, the event schema and authoring.
2515
+ *
2516
+ * It used to be written out in each of those, and the copies drifted: the editor's `checked` and `visited` options had
2517
+ * their label and value swapped, so choosing one stored a state nothing else recognised.
2518
+ *
2519
+ * `focus-visible` is the focus ring a keyboard user needs and a mouse user does not; `focus-within` dresses a
2520
+ * container while anything inside it has focus — a field wrapper around its input.
2521
+ *
2522
+ * `current` is the chosen one of a set: the link to the page being shown (`aria-current`), the option pressed in a group
2523
+ * of toggles (`aria-pressed`), the selected tab (`aria-selected`). The element says so itself — what a screen reader
2524
+ * announces too — so a header written once in a layout marks the right item on every page, and a theme switch its
2525
+ * chosen scheme, which a class chosen per page could not.
2526
+ *
2527
+ * `expanded` is the control that opens a panel while the panel is open — a dropdown's trigger, an accordion's header, a
2528
+ * menu button (`aria-expanded`). The control says so itself, as the chosen one of a set does.
2529
+ *
2530
+ * `hidden` is not a pseudo-class: it is how an element looks while its `visible` says no — where it goes as it hides,
2531
+ * and where it comes from as it shows. With a transition on the class (`display` among what it transitions, and
2532
+ * `transition-behavior: allow-discrete`), a panel fades or slides in and out instead of blinking.
2533
+ *
2534
+ * `first`, `last`, `odd` and `even` are where the element sits among its siblings — the row of a list that has no
2535
+ * divider above it, the alternate rows of a table. They count every sibling, as `:nth-child` does.
2536
+ */
2537
+ declare const STYLE_STATES: readonly ["hover", "focus", "focus-visible", "focus-within", "active", "disabled", "checked", "visited", "current", "expanded", "hidden", "first", "last", "odd", "even"];
2538
+
2539
+ declare type StyleAncestor = {
2540
+ default?: StyleObject;
2541
+ states?: StyleStates;
2542
+ variants?: Record<string, StyleStateBlock>;
2543
+ };
2544
+
2545
+ declare type StyleAncestors = Record<string, StyleAncestor>;
2546
+
2547
+ declare type StyleAttributes = Record<string, StyleBlock>;
2548
+
2549
+ declare type StyleBlock = {
2550
+ default?: StyleObject;
2551
+ states?: StyleStates;
2552
+ variants?: StyleVariants;
2553
+ ancestors?: StyleAncestors;
2554
+ pseudos?: StylePseudos;
2555
+ conditions?: StyleConditions;
2556
+ };
2557
+
2558
+ declare type StyleCategory = (typeof styleConstants)[keyof typeof styleConstants];
2559
+
2560
+ declare type StyleCondition = StyleStateBlock & {
2561
+ pseudos?: StylePseudos;
2562
+ };
2563
+
2564
+ declare type StyleConditions = Record<string, StyleCondition>;
2565
+
2566
+ declare const styleConstants: {
2567
+ readonly DISPLAY: "display";
2568
+ readonly FLEX_WRAP: "flex-wrap";
2569
+ readonly FLEX_DIRECTION: "flex-direction";
2570
+ readonly ALIGN_ITEMS: "align-items";
2571
+ readonly JUSTIFY_ITEMS: "justify-items";
2572
+ readonly JUSTIFY_CONTENT: "justify-content";
2573
+ readonly ALIGN_CONTENT: "align-content";
2574
+ readonly ROW_GAP: "row-gap";
2575
+ readonly COLUMN_GAP: "column-gap";
2576
+ readonly GRID_ROW_GAP: "grid-row-gap";
2577
+ readonly GRID_COLUMN_GAP: "grid-column-gap";
2578
+ readonly GRID_TEMPLATE_AREAS: "grid-template-areas";
2579
+ readonly GRID_TEMPLATE_COLUMNS: "grid-template-columns";
2580
+ readonly GRID_TEMPLATE_ROWS: "grid-template-rows";
2581
+ readonly GRID_AUTO_FLOW: "grid-auto-flow";
2582
+ readonly GRID_AUTO_ROWS: "grid-auto-rows";
2583
+ readonly GRID_AUTO_COLUMNS: "grid-auto-columns";
2584
+ readonly GRID_ROW_START: "grid-row-start";
2585
+ readonly GRID_COLUMN_START: "grid-column-start";
2586
+ readonly GRID_ROW_END: "grid-row-end";
2587
+ readonly GRID_COLUMN_END: "grid-column-end";
2588
+ readonly ALIGN_SELF: "align-self";
2589
+ readonly JUSTIFY_SELF: "justify-self";
2590
+ readonly ORDER: "order";
2591
+ readonly FLEX_GROW: "flex-grow";
2592
+ readonly FLEX_SHRINK: "flex-shrink";
2593
+ readonly FLEX_BASIS: "flex-basis";
2594
+ readonly LIST_STYLE: "list-style";
2595
+ readonly LIST_STYLE_TYPE: "list-style-type";
2596
+ readonly LIST_STYLE_POSITION: "list-style-position";
2597
+ readonly LIST_STYLE_IMAGE: "list-style-image";
2598
+ readonly BACKGROUND_COLOR: "background-color";
2599
+ readonly BACKGROUND_IMAGE: "background-image";
2600
+ readonly BACKGROUND_POSITION: "background-position";
2601
+ readonly BACKGROUND_SIZE: "background-size";
2602
+ readonly BACKGROUND_REPEAT: "background-repeat";
2603
+ readonly BACKGROUND_ORIGIN: "background-origin";
2604
+ readonly BACKGROUND_CLIP: "background-clip";
2605
+ readonly BACKGROUND_ATTACHMENT: "background-attachment";
2606
+ readonly BACKGROUND_BLEND_MODE: "background-blend-mode";
2607
+ readonly MASK_IMAGE: "mask-image";
2608
+ readonly MASK_SIZE: "mask-size";
2609
+ readonly MASK_POSITION: "mask-position";
2610
+ readonly MASK_REPEAT: "mask-repeat";
2611
+ readonly MASK_COMPOSITE: "mask-composite";
2612
+ readonly WEBKIT_MASK_IMAGE: "-webkit-mask-image";
2613
+ readonly BORDER_TOP_STYLE: "border-top-style";
2614
+ readonly BORDER_TOP_WIDTH: "border-top-width";
2615
+ readonly BORDER_TOP_COLOR: "border-top-color";
2616
+ readonly BORDER_BOTTOM_STYLE: "border-bottom-style";
2617
+ readonly BORDER_BOTTOM_WIDTH: "border-bottom-width";
2618
+ readonly BORDER_BOTTOM_COLOR: "border-bottom-color";
2619
+ readonly BORDER_LEFT_STYLE: "border-left-style";
2620
+ readonly BORDER_LEFT_WIDTH: "border-left-width";
2621
+ readonly BORDER_LEFT_COLOR: "border-left-color";
2622
+ readonly BORDER_RIGHT_STYLE: "border-right-style";
2623
+ readonly BORDER_RIGHT_WIDTH: "border-right-width";
2624
+ readonly BORDER_RIGHT_COLOR: "border-right-color";
2625
+ readonly BORDER_TOP_LEFT_RADIUS: "border-top-left-radius";
2626
+ readonly BORDER_TOP_RIGHT_RADIUS: "border-top-right-radius";
2627
+ readonly BORDER_BOTTOM_LEFT_RADIUS: "border-bottom-left-radius";
2628
+ readonly BORDER_BOTTOM_RIGHT_RADIUS: "border-bottom-right-radius";
2629
+ readonly BORDER_COLLAPSE: "border-collapse";
2630
+ readonly BORDER_SPACING: "border-spacing";
2631
+ readonly TABLE_LAYOUT: "table-layout";
2632
+ readonly OPACITY: "opacity";
2633
+ readonly VISIBILITY: "visibility";
2634
+ readonly CURSOR: "cursor";
2635
+ readonly TRANSITION: "transition";
2636
+ readonly TRANSITION_PROPERTY: "transition-property";
2637
+ readonly TRANSITION_DURATION: "transition-duration";
2638
+ readonly TRANSITION_TIMING_FUNCTION: "transition-timing-function";
2639
+ readonly TRANSITION_DELAY: "transition-delay";
2640
+ readonly TRANSITION_BEHAVIOR: "transition-behavior";
2641
+ readonly ANIMATION: "animation";
2642
+ readonly ANIMATION_NAME: "animation-name";
2643
+ readonly ANIMATION_DURATION: "animation-duration";
2644
+ readonly ANIMATION_TIMING_FUNCTION: "animation-timing-function";
2645
+ readonly ANIMATION_DELAY: "animation-delay";
2646
+ readonly ANIMATION_ITERATION_COUNT: "animation-iteration-count";
2647
+ readonly ANIMATION_DIRECTION: "animation-direction";
2648
+ readonly ANIMATION_FILL_MODE: "animation-fill-mode";
2649
+ readonly ANIMATION_PLAY_STATE: "animation-play-state";
2650
+ readonly ANIMATION_TIMELINE: "animation-timeline";
2651
+ readonly ANIMATION_RANGE: "animation-range";
2652
+ readonly BOX_SHADOW: "box-shadow";
2653
+ readonly FILTER: "filter";
2654
+ readonly BACKDROP_FILTER: "backdrop-filter";
2655
+ readonly MIX_BLEND_MODE: "mix-blend-mode";
2656
+ readonly ISOLATION: "isolation";
2657
+ readonly CLIP_PATH: "clip-path";
2658
+ readonly TRANSFORM: "transform";
2659
+ readonly TRANSFORM_ORIGIN: "transform-origin";
2660
+ readonly TRANSLATE: "translate";
2661
+ readonly ROTATE: "rotate";
2662
+ readonly SCALE: "scale";
2663
+ readonly TRANSFORM_STYLE: "transform-style";
2664
+ readonly PERSPECTIVE: "perspective";
2665
+ readonly PERSPECTIVE_ORIGIN: "perspective-origin";
2666
+ readonly BACKFACE_VISIBILITY: "backface-visibility";
2667
+ readonly WILL_CHANGE: "will-change";
2668
+ readonly OUTLINE_WIDTH: "outline-width";
2669
+ readonly OUTLINE_STYLE: "outline-style";
2670
+ readonly OUTLINE_COLOR: "outline-color";
2671
+ readonly OUTLINE_OFFSET: "outline-offset";
2672
+ readonly POINTER_EVENTS: "pointer-events";
2673
+ readonly USER_SELECT: "user-select";
2674
+ readonly TOUCH_ACTION: "touch-action";
2675
+ readonly RESIZE: "resize";
2676
+ readonly APPEARANCE: "appearance";
2677
+ readonly SCROLL_BEHAVIOR: "scroll-behavior";
2678
+ readonly OVERSCROLL_BEHAVIOR: "overscroll-behavior";
2679
+ readonly SCROLL_SNAP_TYPE: "scroll-snap-type";
2680
+ readonly SCROLL_SNAP_ALIGN: "scroll-snap-align";
2681
+ readonly SCROLL_SNAP_STOP: "scroll-snap-stop";
2682
+ readonly SCROLL_PADDING_TOP: "scroll-padding-top";
2683
+ readonly SCROLL_MARGIN_TOP: "scroll-margin-top";
2684
+ readonly ACCENT_COLOR: "accent-color";
2685
+ readonly CARET_COLOR: "caret-color";
2686
+ readonly COLOR_SCHEME: "color-scheme";
2687
+ readonly CONTENT: "content";
2688
+ readonly POSITION: "position";
2689
+ readonly FLOAT: "float";
2690
+ readonly CLEAR: "clear";
2691
+ readonly Z_INDEX: "z-index";
2692
+ readonly TOP: "top";
2693
+ readonly BOTTOM: "bottom";
2694
+ readonly LEFT: "left";
2695
+ readonly RIGHT: "right";
2696
+ readonly BOX_SIZING: "box-sizing";
2697
+ readonly ASPECT_RATIO: "aspect-ratio";
2698
+ readonly WIDTH: "width";
2699
+ readonly HEIGHT: "height";
2700
+ readonly MIN_WIDTH: "min-width";
2701
+ readonly MIN_HEIGHT: "min-height";
2702
+ readonly MAX_WIDTH: "max-width";
2703
+ readonly MAX_HEIGHT: "max-height";
2704
+ readonly OVERFLOW: "overflow";
2705
+ readonly OVERFLOW_X: "overflow-x";
2706
+ readonly OVERFLOW_Y: "overflow-y";
2707
+ readonly SCROLLBAR_WIDTH: "scrollbar-width";
2708
+ readonly SCROLLBAR_COLOR: "scrollbar-color";
2709
+ readonly CONTAINER_TYPE: "container-type";
2710
+ readonly CONTAINER_NAME: "container-name";
2711
+ readonly OBJECT_FIT: "object-fit";
2712
+ readonly OBJECT_POSITION: "object-position";
2713
+ readonly COLUMN_WIDTH: "column-width";
2714
+ readonly COLUMN_COUNT: "column-count";
2715
+ readonly MARGIN_TOP: "margin-top";
2716
+ readonly MARGIN_BOTTOM: "margin-bottom";
2717
+ readonly MARGIN_LEFT: "margin-left";
2718
+ readonly MARGIN_RIGHT: "margin-right";
2719
+ readonly PADDING_TOP: "padding-top";
2720
+ readonly PADDING_BOTTOM: "padding-bottom";
2721
+ readonly PADDING_LEFT: "padding-left";
2722
+ readonly PADDING_RIGHT: "padding-right";
2723
+ readonly FONT_FAMILY: "font-family";
2724
+ readonly FONT_WEIGHT: "font-weight";
2725
+ readonly FONT_SIZE: "font-size";
2726
+ readonly LINE_HEIGHT: "line-height";
2727
+ readonly COLOR: "color";
2728
+ readonly TEXT_ALIGN: "text-align";
2729
+ readonly FONT_STYLE: "font-style";
2730
+ readonly FONT_VARIANT: "font-variant";
2731
+ readonly FONT_VARIANT_NUMERIC: "font-variant-numeric";
2732
+ readonly FONT_FEATURE_SETTINGS: "font-feature-settings";
2733
+ readonly TEXT_DECORATION: "text-decoration";
2734
+ readonly TEXT_DECORATION_LINE: "text-decoration-line";
2735
+ readonly TEXT_DECORATION_COLOR: "text-decoration-color";
2736
+ readonly TEXT_DECORATION_STYLE: "text-decoration-style";
2737
+ readonly TEXT_DECORATION_THICKNESS: "text-decoration-thickness";
2738
+ readonly TEXT_UNDERLINE_OFFSET: "text-underline-offset";
2739
+ readonly LETTER_SPACING: "letter-spacing";
2740
+ readonly WORD_SPACING: "word-spacing";
2741
+ readonly TEXT_INDENT: "text-indent";
2742
+ readonly TEXT_TRANSFORM: "text-transform";
2743
+ readonly DIRECTION: "direction";
2744
+ readonly WHITE_SPACE: "white-space";
2745
+ readonly TEXT_WRAP: "text-wrap";
2746
+ readonly WORD_BREAK: "word-break";
2747
+ readonly OVERFLOW_WRAP: "overflow-wrap";
2748
+ readonly HYPHENS: "hyphens";
2749
+ readonly VERTICAL_ALIGN: "vertical-align";
2750
+ readonly TEXT_OVERFLOW: "text-overflow";
2751
+ readonly TEXT_SHADOW: "text-shadow";
2752
+ readonly LINE_CLAMP: "line-clamp";
2753
+ readonly WEBKIT_LINE_CLAMP: "-webkit-line-clamp";
2754
+ readonly WEBKIT_BOX_ORIENT: "-webkit-box-orient";
2755
+ readonly WEBKIT_TEXT_FILL_COLOR: "-webkit-text-fill-color";
2756
+ readonly WEBKIT_BACKGROUND_CLIP: "-webkit-background-clip";
2757
+ readonly BOX_DECORATION_BREAK: "box-decoration-break";
2758
+ readonly WEBKIT_BOX_DECORATION_BREAK: "-webkit-box-decoration-break";
2759
+ readonly FILL: "fill";
2760
+ readonly STROKE: "stroke";
2761
+ readonly STROKE_WIDTH: "stroke-width";
2762
+ };
2763
+
2764
+ /**
2765
+ * A named rule set — a class — as opposed to an anonymous one.
2766
+ *
2767
+ * `css` and the layout helpers produce rules that belong to whoever asked for them. This is the other kind: rules
2768
+ * with a name, so more than one element can point at the same ones and a change to them is a change to all. The
2769
+ * rules are normalised when the declaration is made, so an unwritable property is an error on the line that wrote
2770
+ * it rather than wherever the class is later used.
2771
+ */
2772
+ declare interface StyleDeclaration {
2773
+ readonly name: string;
2774
+ readonly rules: ResponsiveBlock;
2775
+ toString(): string;
2776
+ }
2777
+
2778
+ declare type StyleItem = {
2779
+ name: string;
2780
+ type: TagType;
2781
+ variables?: Partial<StyleVariables>;
2782
+ attributes: StyleAttributes;
2783
+ cache: string;
2784
+ componentType?: string;
2785
+ };
2786
+
2787
+ declare type StyleMode = 'mobile-first' | 'desktop-first';
2788
+
2789
+ declare type StyleObject = Partial<Record<StyleCategory, StyleValue>>;
2790
+
2791
+ declare type StylePseudo = (typeof STYLE_PSEUDOS)[number];
2792
+
2793
+ declare type StylePseudos = Partial<Record<StylePseudo, StyleStateBlock>>;
2794
+
2795
+ /** A selector's rules in either shape: plain CSS, or CSS with its states and variants beside it. */
2796
+ declare type StyleSpec = CssSpec | RuleSetSpec;
2797
+
2798
+ declare type StyleState = (typeof STYLE_STATES)[number];
2799
+
2800
+ declare type StyleStateBlock = {
2801
+ default?: StyleObject;
2802
+ states?: StyleStates;
2803
+ };
2804
+
2805
+ declare type StyleStates = Partial<Record<StyleState, StyleObject>>;
2806
+
2807
+ declare type StyleThemeValue = Partial<Record<ColorScheme | 'default', string>>;
2808
+
2809
+ declare type StyleValue = number | string;
2810
+
2811
+ declare enum StyleVariableCategory {
2812
+ COLOR = "color",
2813
+ SPACING = "spacing",
2814
+ SHADOW = "shadow",
2815
+ CUSTOM = "custom"
2816
+ }
2817
+
2818
+ declare type StyleVariableGroup = Record<string, StyleVariableValue>;
2819
+
2820
+ declare type StyleVariables = Record<StyleVariableCategory, StyleVariableGroup>;
2821
+
2822
+ declare type StyleVariableValue = string | number | StyleThemeValue;
2823
+
2824
+ declare type StyleVariant = StyleStateBlock & {
2825
+ pseudos?: StylePseudos;
2826
+ };
2827
+
2828
+ declare type StyleVariants = Record<string, StyleVariant>;
2829
+
2830
+ /**
2831
+ * A shorter or lighter way to the same page — not a problem: what is written renders as written.
2832
+ *
2833
+ * `saves` is how many elements the space would no longer carry, the measure suggestions are ranked by; a suggestion
2834
+ * about the stylesheet saves none and is listed after those that do.
2835
+ */
2836
+ declare interface Suggestion {
2837
+ code: SuggestionCode;
2838
+ message: string;
2839
+ /** The elements it is about, the first being the one to look at. Empty for one about the stylesheet. */
2840
+ elementIds: string[];
2841
+ saves: number;
2842
+ /** Where the first of them was written: `src/space/pages/home.ts:42`. Absent when no factory wrote it. */
2843
+ at?: string;
2844
+ /**
2845
+ * The declarations a suggestion about the stylesheet or the components is about — the classes, tokens or components
2846
+ * it names — so whoever reports only what is new (the MCP, after a batch) can tell a new one from those said before.
2847
+ */
2848
+ subjects?: string[];
2849
+ }
2850
+
2851
+ declare type SuggestionCode = {
2852
+ [Code in AuthoringCode]: Codes[Code]['kind'] extends 'suggested' ? Code : never;
2853
+ }[AuthoringCode];
2854
+
75
2855
  /** One SVG file, compacted (`compactSvg`) — what `svg()` takes. Refused, with its path, when it is not an SVG. */
76
2856
  export declare const svgFile: (file: string | URL) => string;
77
2857
 
@@ -81,4 +2861,44 @@ export declare const svgFile: (file: string | URL) => string;
81
2861
  */
82
2862
  export declare const svgFiles: (folder: string | URL) => Record<string, string>;
83
2863
 
2864
+ /** Installed nowhere: a stack the visitor's system already has. Costs no bytes. */
2865
+ declare type SystemFont = FontBase & {
2866
+ source: 'system';
2867
+ };
2868
+
2869
+ declare type TagType = 'class' | 'element' | 'id';
2870
+
2871
+ declare type Theme = 'dark' | 'light' | 'system';
2872
+
2873
+ /** One variant of a selector: what it changes, and how it reacts on its own. A variant cannot carry variants. */
2874
+ declare interface VariantSpec {
2875
+ css?: CssSpec;
2876
+ states?: StatesSpec;
2877
+ pseudos?: PseudosSpec;
2878
+ }
2879
+
2880
+ /**
2881
+ * A visibility the data does not answer on its own: a template over the value, read as a yes or a no —
2882
+ * `{ source: 'state.genre', template: "{{ source == '' or source == list_games.item.genre }}" }`. `false`, `0`, an
2883
+ * empty text, an empty list and nothing at all are a no; anything else is a yes. No `? 'true' : 'false'` needed.
2884
+ *
2885
+ * As an element's `visible` it also starts the element hidden, which is what a condition computed from data wants:
2886
+ * shown only once the template has said so, rather than drawn and then taken away.
2887
+ */
2888
+ declare interface VisibleCondition {
2889
+ source: string;
2890
+ template: string;
2891
+ }
2892
+
2893
+ /**
2894
+ * What a trigger does when it fires again while the flow it started is still running.
2895
+ *
2896
+ * - `skip` (the default): the new firing is ignored — what keeps a double click from submitting twice.
2897
+ * - `parallel`: every firing runs its own flow, at the same time.
2898
+ * - `queue`: every firing runs, one after another, in the order they came — none lost, none overlapping.
2899
+ * - `latest`: every firing runs, and the run before it stops — it starts no further step, and the step it is waiting
2900
+ * on stops if it can (a server action, a request). A search as you type: only the last question is answered.
2901
+ */
2902
+ declare type WhileRunning = 'skip' | 'parallel' | 'queue' | 'latest';
2903
+
84
2904
  export { }