@plitzi/sdk-authoring 0.37.8 → 0.37.10

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 (45) hide show
  1. package/CHANGELOG.md +817 -0
  2. package/dist/index.d.ts +2769 -266
  3. package/dist/index.js +14203 -7441
  4. package/package.json +9 -8
  5. package/skills/plitzi-authoring/CHEATSHEET.md +135 -0
  6. package/skills/plitzi-authoring/SKILL.md +77 -74
  7. package/skills/plitzi-authoring/recipes/carousel.ts +114 -0
  8. package/skills/plitzi-authoring/recipes/detail-page.ts +70 -0
  9. package/skills/plitzi-authoring/recipes/embed-and-svg.ts +48 -0
  10. package/skills/plitzi-authoring/recipes/every-few-seconds.ts +119 -0
  11. package/skills/plitzi-authoring/recipes/feature-flag.ts +24 -0
  12. package/skills/plitzi-authoring/recipes/filter-a-list.ts +63 -0
  13. package/skills/plitzi-authoring/recipes/forms-and-modals.ts +64 -0
  14. package/skills/plitzi-authoring/recipes/from-tailwind.ts +52 -0
  15. package/skills/plitzi-authoring/recipes/link-to-a-section.ts +35 -0
  16. package/skills/plitzi-authoring/recipes/link-with-data.ts +40 -0
  17. package/skills/plitzi-authoring/recipes/marquee.ts +57 -0
  18. package/skills/plitzi-authoring/recipes/plugin.ts +53 -0
  19. package/skills/plitzi-authoring/recipes/scroll-a-row.ts +79 -0
  20. package/skills/plitzi-authoring/recipes/show-data.ts +73 -0
  21. package/skills/plitzi-authoring/recipes/style-a-page.ts +45 -0
  22. package/skills/plitzi-authoring/recipes/typed-data.ts +64 -0
  23. package/skills/plitzi-authoring/recipes/usable-without-sight.ts +39 -0
  24. package/skills/plitzi-authoring/reference/accessibility.md +2 -2
  25. package/skills/plitzi-authoring/reference/authoring-errors.md +195 -53
  26. package/skills/plitzi-authoring/reference/colours-and-motion.md +63 -0
  27. package/skills/plitzi-authoring/reference/components.md +83 -0
  28. package/skills/plitzi-authoring/reference/data-and-visibility.md +29 -29
  29. package/skills/plitzi-authoring/reference/efficiency.md +53 -0
  30. package/skills/plitzi-authoring/reference/elements-and-styles.md +39 -24
  31. package/skills/plitzi-authoring/reference/feature-flags.md +78 -0
  32. package/skills/plitzi-authoring/reference/flows.md +26 -37
  33. package/skills/plitzi-authoring/reference/kept-state.md +28 -0
  34. package/skills/plitzi-authoring/reference/layouts.md +20 -3
  35. package/skills/plitzi-authoring/reference/lists.md +45 -16
  36. package/skills/plitzi-authoring/reference/plugins.md +27 -0
  37. package/skills/plitzi-authoring/reference/realtime.md +35 -0
  38. package/skills/plitzi-authoring/reference/review-checklist.md +8 -3
  39. package/skills/plitzi-authoring/reference/{templates-and-export.md → snippets-and-export.md} +15 -8
  40. package/skills/plitzi-authoring/reference/structure.md +29 -20
  41. package/skills/plitzi-authoring/reference/tailwind.md +19 -0
  42. package/skills/plitzi-authoring/reference/templates.md +6 -5
  43. package/skills/plitzi-authoring/reference/testing.md +11 -0
  44. package/skills/plitzi-authoring/reference/typed-sources.md +20 -0
  45. package/skills/plitzi-authoring/reference/validation.md +6 -2
package/dist/index.d.ts CHANGED
@@ -40,7 +40,7 @@ export declare type AccessSpec = ActionAccess | 'public' | 'session';
40
40
  * There is no implicit default: a trigger that declares no access is refused at save time rather than falling back
41
41
  * to something a reader has to guess at.
42
42
  */
43
- declare type ActionAccess =
43
+ export declare type ActionAccess =
44
44
  /** Anyone, including an anonymous visitor. Implicit for a webhook; anywhere else it is a deliberate choice. */
45
45
  {
46
46
  mode: 'public';
@@ -73,7 +73,7 @@ declare type ActionAccess =
73
73
  * actually reaches for. A field beside the flow was the same fact written twice, with no rule for which won.
74
74
  * Read it with `isActionEnabled` from `@plitzi/sdk-shared/actions`.
75
75
  */
76
- declare type ActionDocument = {
76
+ export declare type ActionDocument = {
77
77
  name: string;
78
78
  description?: string;
79
79
  /**
@@ -99,12 +99,12 @@ declare type ActionDocument = {
99
99
  * `id` is stamped by the store rather than carried by the document, for the same reason `ConnectorManifestDraft`
100
100
  * drops it: a document holding its own id can disagree with the one it was fetched by.
101
101
  */
102
- declare type ActionEntry = {
102
+ export declare type ActionEntry = {
103
103
  id: string;
104
104
  document: ActionDocument;
105
105
  };
106
106
 
107
- declare type ActionField = {
107
+ export declare type ActionField = {
108
108
  type: ActionFieldType;
109
109
  required?: boolean;
110
110
  defaultValue?: string | number | boolean;
@@ -119,10 +119,10 @@ declare type ActionField = {
119
119
  * `video`) and an action takes arguments, not entries. `json` is the escape hatch for a nested payload, and it is
120
120
  * the only one whose contents are not validated beyond being parseable.
121
121
  */
122
- declare type ActionFieldType = 'text' | 'number' | 'boolean' | 'date' | 'json' | 'file';
122
+ export declare type ActionFieldType = 'text' | 'number' | 'boolean' | 'date' | 'json' | 'file';
123
123
 
124
124
  /** Ceilings for one run. A per-action value may only tighten the deployment's own. */
125
- declare type ActionLimits = {
125
+ export declare type ActionLimits = {
126
126
  timeoutMs?: number;
127
127
  /** Ceiling for a streaming run, which is allowed to be longer-lived than a request/response one. */
128
128
  streamTimeoutMs?: number;
@@ -138,6 +138,34 @@ declare type ActionLimits = {
138
138
  maxResponseBytes?: number;
139
139
  };
140
140
 
141
+ /**
142
+ * A server action read back into the `defineAction` call that writes it: the other direction from {@link defineAction},
143
+ * as `specFromSpace` is for a space.
144
+ *
145
+ * Only when the round trip is exact. The spec read is authored again and compared with the document it came from —
146
+ * every step, every chain link, every param — and a document that would come back any different is not read at all:
147
+ * the reason is given instead, and the document stays the JSON it is. A builder can write flows code has no words for
148
+ * (a branch, a step titled by hand), and a decompiler that approximated them would hand back a different action.
149
+ */
150
+ export declare type ActionReading = {
151
+ ok: true;
152
+ spec: ActionSpec;
153
+ } | {
154
+ ok: false;
155
+ reason: string;
156
+ };
157
+
158
+ export declare type ActionSource = {
159
+ /** What the file exports the action as: its id in camelCase, `boardCreateAction`. */
160
+ exportName: string;
161
+ source: string;
162
+ };
163
+
164
+ export declare interface ActionSourceOptions {
165
+ /** Where `defineAction` is imported from. */
166
+ packageName?: string;
167
+ }
168
+
141
169
  export declare interface ActionSpec {
142
170
  id: string;
143
171
  name: string;
@@ -160,8 +188,19 @@ export declare interface ActionSpec {
160
188
  * names. An unquoted token keeps its type (`{{ rate.total }}` is a number), a quoted one is text.
161
189
  */
162
190
  output?: string;
191
+ /** Ceilings for one run, tighter than the deployment's own: a per-action value can only lower them. */
192
+ limits?: ActionLimits;
163
193
  }
164
194
 
195
+ /**
196
+ * The declaration that writes this action, or why there is none. See the module's comment. The document is whatever
197
+ * JSON arrived — a platform's export, a file — and one without an action's shape is answered, never thrown on.
198
+ */
199
+ export declare const actionSpecFromEntry: ({ id, document }: {
200
+ id: string;
201
+ document: unknown;
202
+ }) => ActionReading;
203
+
165
204
  export declare interface ActionStepSpec {
166
205
  /**
167
206
  * What later steps and the output call this one by — `{{ rate.total }}` resolves only when the step that
@@ -183,6 +222,12 @@ export declare interface ActionStepSpec {
183
222
  enabled?: boolean;
184
223
  }
185
224
 
225
+ /**
226
+ * A declaration written out as the module that holds it. Valid but unformatted, as `specToSource`'s is: run it through
227
+ * the project's formatter.
228
+ */
229
+ export declare const actionToSource: (spec: ActionSpec, { packageName }?: ActionSourceOptions) => ActionSource;
230
+
186
231
  export declare type ActionTriggerSpec = (TriggerCommon & {
187
232
  type: 'call';
188
233
  access: AccessSpec;
@@ -229,6 +274,13 @@ export declare interface ActiveOnOptions {
229
274
  slot?: string;
230
275
  }
231
276
 
277
+ /**
278
+ * Wears a class's variant while a condition holds — the dot of the slide on screen, the tab whose panel is open:
279
+ * `activeWhen(dot, '{{ list_dots.index == state.slide }}')`. The general form of {@link activeOn}, which is this for
280
+ * "the current page"; the condition is written as an attribute's token is, names in full, braces optional.
281
+ */
282
+ export declare const activeWhen: (cls: ClassRef, condition: string, options?: ActiveOnOptions) => BindingSpec;
283
+
232
284
  export declare const addNotification: (params: {
233
285
  content: string;
234
286
  placement?: "top-right" | "top-center" | "top-left" | "bottom-right" | "bottom-center" | "bottom-left";
@@ -278,8 +330,8 @@ export declare const announceOn: (target: string, state: unknown) => StepSpec;
278
330
  * which is why their declarations had to be written before they could be authored at all.
279
331
  */
280
332
  export declare const apiContainer: {
281
- (props?: ElementProps<ApiContainerAttributes> | undefined): ElementSpec;
282
- (children: ElementSpec[], props?: ElementProps<ApiContainerAttributes> | undefined): ElementSpec;
333
+ (props?: ElementProps< ApiContainerAttributes> | undefined): ElementSpec;
334
+ (children: ElementSpec[], props?: ElementProps< ApiContainerAttributes> | undefined): ElementSpec;
283
335
  };
284
336
 
285
337
  /** What this element can be authored with — its component's own props, minus what the runtime supplies. */
@@ -340,6 +392,11 @@ declare type ApiContainerProps = {
340
392
  pageParam?: string;
341
393
  /** Renders children while the first client-side request is still in flight, so a loading state can be bound. */
342
394
  renderWhileLoading?: boolean;
395
+ /**
396
+ * The id of a child shown in place of the others until the first answer arrives — a skeleton of what is coming — and
397
+ * gone after it. In the builder every child shows, so the slot can be edited beside what it stands for.
398
+ */
399
+ loadingSlot?: string;
343
400
  /**
344
401
  * Keep a browser request's answer in the page's query cache, shared with every provider asking the same thing.
345
402
  * Off by default: an author opts in knowing the page may show an answer up to `staleTime` old.
@@ -363,6 +420,16 @@ declare type ApiContainerProps = {
363
420
  refreshSeconds?: number | string;
364
421
  };
365
422
 
423
+ /** What an `apiContainer` publishes: the answer under `data`, and how the asking went. */
424
+ export declare interface ApiContainerSource<Data> {
425
+ data: Data;
426
+ isLoading: boolean;
427
+ isEmpty: boolean;
428
+ hasError: boolean;
429
+ errorMessage: string;
430
+ isStale: boolean;
431
+ }
432
+
366
433
  /**
367
434
  * Adds to the list at `runtime.state.<key>`, creating it if it is not there.
368
435
  *
@@ -389,6 +456,8 @@ export declare interface AppliedFix {
389
456
  code: string;
390
457
  elementId: string | null;
391
458
  message: string;
459
+ /** The change itself, when there is one way to write it in the source; a message alone otherwise. */
460
+ change?: FixChange;
392
461
  }
393
462
 
394
463
  /** Resolve a `globalCallback` action against the built-in catalog: returns the module id it is registered under
@@ -415,6 +484,9 @@ export declare const applyUtility: (action: string, params: Record<string, unkno
415
484
  params: Record<string, unknown>;
416
485
  };
417
486
 
487
+ /** The throwing flavour. Returns what was survivable so a caller can decide what to do about it. */
488
+ export declare const assertSnippetValid: (snippet: Snippet, context: string, options?: SpaceValidationOptions) => SchemaValidationError[];
489
+
418
490
  /**
419
491
  * The throwing flavour. Returns what was survivable so a caller can decide what to do about it.
420
492
  *
@@ -422,9 +494,6 @@ export declare const applyUtility: (action: string, params: Record<string, unkno
422
494
  */
423
495
  export declare const assertSpaceValid: (space: SpaceDocuments, context: string, options?: SpaceValidationOptions, allow?: readonly AllowedBreak[]) => SchemaValidationError[];
424
496
 
425
- /** The throwing flavour. Returns what was survivable so a caller can decide what to do about it. */
426
- export declare const assertTemplateValid: (template: Template, context: string, options?: SpaceValidationOptions) => SchemaValidationError[];
427
-
428
497
  /**
429
498
  * The attributes of one built-in element, by type name — `Attributes<'heading'>['subType']`.
430
499
  *
@@ -488,6 +557,17 @@ declare type AuthorableProps<Props, Injected extends keyof Props> = Omit<Props,
488
557
  * nothing outside the element ever names one — so it says what it targets and where in the list it sits. */
489
558
  export declare const authorBinding: (index: number, spec: BindingSpec) => ElementBinding;
490
559
 
560
+ export declare interface AuthoredSnippet {
561
+ /** The manifest as it is published: `JSON.stringify` it and host it. */
562
+ snippet: Snippet;
563
+ /**
564
+ * What the validators had to say that was not fatal — a class the snippet names but does not carry, a step
565
+ * naming an action no built-in source declares. Beside the manifest rather than inside it: what ships is a
566
+ * document a builder fetches, and it carries nothing that is not part of the snippet.
567
+ */
568
+ warnings: SchemaValidationError[];
569
+ }
570
+
491
571
  export declare interface AuthoredSpace {
492
572
  schema: Schema;
493
573
  style: Style;
@@ -504,17 +584,12 @@ export declare interface AuthoredSpace {
504
584
  * errors of its own.
505
585
  */
506
586
  warnings: SchemaValidationError[];
507
- }
508
-
509
- export declare interface AuthoredTemplate {
510
- /** The manifest as it is published: `JSON.stringify` it and host it. */
511
- template: Template;
512
587
  /**
513
- * What the validators had to say that was not fatal — a class the template names but does not carry, a step
514
- * naming an action no built-in source declares. Beside the manifest rather than inside it: what ships is a
515
- * document a builder fetches, and it carries nothing that is not part of the template.
588
+ * A shorter way to the same page — a layout for a header on every page, a component for cards written ten times, an
589
+ * element's own `content` — ranked by the elements each would save. Not a problem: nothing here is wrong. See
590
+ * `suggestSpace`.
516
591
  */
517
- warnings: SchemaValidationError[];
592
+ suggestions: Suggestion[];
518
593
  }
519
594
 
520
595
  /**
@@ -528,6 +603,887 @@ export declare const authorFlow: (steps: StepSpec[], host?: string, counters?: M
528
603
 
529
604
  export declare const authorFlows: (flows: StepSpec[][], host?: string) => Record<string, ElementInteraction>;
530
605
 
606
+ export declare const AUTHORING_CODES: {
607
+ readonly 'no-pages': {
608
+ readonly kind: "refused";
609
+ readonly means: "a space with no pages";
610
+ readonly fix: "`pages: [{ id: 'home', name: 'Home', slug: '', body: [] }]`";
611
+ };
612
+ readonly 'setting-misplaced': {
613
+ readonly kind: "refused";
614
+ readonly means: "`settings.computed` or `settings.channels` written inside `settings`";
615
+ readonly fix: "`computed` and `channels` at the top of the space";
616
+ };
617
+ readonly 'state-key-list': {
618
+ readonly kind: "refused";
619
+ readonly means: "`settings.transientState` / `paintedState` that is not a list of top-level state keys";
620
+ readonly fix: "`transientState: ['demoStep']` — a dotted path names its top key";
621
+ };
622
+ readonly 'state-painted-and-transient': {
623
+ readonly kind: "refused";
624
+ readonly means: "a state key both painted (kept for the server) and transient (never kept)";
625
+ readonly fix: "remove it from one of the two";
626
+ };
627
+ readonly 'transient-state-without-keep-state': {
628
+ readonly kind: "warned";
629
+ readonly means: "`transientState` without `keepState` — nothing is kept in the first place";
630
+ readonly fix: "`settings.keepState: true`, or remove `transientState`";
631
+ };
632
+ readonly 'painted-state-without-keep-state': {
633
+ readonly kind: "warned";
634
+ readonly means: "`paintedState` without `keepState` — nothing is kept for the server to draw with";
635
+ readonly fix: "`settings.keepState: true`, or remove `paintedState`";
636
+ };
637
+ readonly 'visitor-roles': {
638
+ readonly kind: "refused";
639
+ readonly means: "`settings.visitorRoles` written in a shape the runtime does not read";
640
+ readonly fix: "the shape the message gives";
641
+ };
642
+ readonly 'font-invalid': {
643
+ readonly kind: "refused";
644
+ readonly means: "a font the space cannot load as declared";
645
+ readonly fix: "the field the message names";
646
+ };
647
+ readonly 'notifications-shape': {
648
+ readonly kind: "refused";
649
+ readonly means: "`notifications` with a field it does not have, or a value that is not one CSS value";
650
+ readonly fix: "the fields it lists; a colour or a length, like 'var(--card)' or '12px'";
651
+ };
652
+ readonly 'unknown-field': {
653
+ readonly kind: "refused";
654
+ readonly means: "a field the space, a page, an element, a binding or a step does not have";
655
+ readonly fix: "the field it suggests; an element's attribute goes inside the factory's props (`button({ content })`)";
656
+ };
657
+ readonly 'page-without-slug': {
658
+ readonly kind: "refused";
659
+ readonly means: "a page with no `slug`";
660
+ readonly fix: "`slug: ''` for the home page, its path for any other: `'about'`, `'blog/:slug'`";
661
+ };
662
+ readonly 'page-route-taken': {
663
+ readonly kind: "refused";
664
+ readonly means: "two pages at one address for the same visitors";
665
+ readonly fix: "another slug — or `accessLevel` `'public'` on one and `'authenticated'` on the other";
666
+ };
667
+ readonly 'page-route-reserved': {
668
+ readonly kind: "refused";
669
+ readonly means: "a page under `/fn`, where the space's functions answer";
670
+ readonly fix: "another slug";
671
+ };
672
+ readonly 'page-access-level': {
673
+ readonly kind: "refused";
674
+ readonly means: "an `accessLevel` that is not one the router reads";
675
+ readonly fix: "one of the values the message lists";
676
+ };
677
+ readonly 'page-target-unknown': {
678
+ readonly kind: "refused";
679
+ readonly means: "a link or `navigate` to a page id that does not exist";
680
+ readonly fix: "an existing page id, or a path with its slash (`'/about'`)";
681
+ };
682
+ readonly 'page-target-url': {
683
+ readonly kind: "refused";
684
+ readonly means: "a URL, `mailto:` or `tel:` in a link left in page mode";
685
+ readonly fix: "`mode: 'external'`";
686
+ };
687
+ readonly 'redirect-target-unknown': {
688
+ readonly kind: "refused";
689
+ readonly means: "a page that sends visitors it is not for to a page the space does not have";
690
+ readonly fix: "a page's id or slug (`''` is the home page), or a full URL";
691
+ };
692
+ readonly 'folder-undeclared': {
693
+ readonly kind: "refused";
694
+ readonly means: "a page, a layout or a folder filed in a folder the space does not declare";
695
+ readonly fix: "declare the folder, or the name it suggests";
696
+ };
697
+ readonly 'folder-cycle': {
698
+ readonly kind: "refused";
699
+ readonly means: "a page folder inside itself";
700
+ readonly fix: "a `parent` that leads to the top";
701
+ };
702
+ readonly 'layout-undeclared': {
703
+ readonly kind: "refused";
704
+ readonly means: "a page or a layout inside a layout the space does not declare";
705
+ readonly fix: "the layout's id, or declare it in `layouts`";
706
+ };
707
+ readonly 'layout-slot-unknown': {
708
+ readonly kind: "refused";
709
+ readonly means: "a layout `slot` that is not an element inside that layout";
710
+ readonly fix: "the id of the element in the shell where the body goes";
711
+ };
712
+ readonly 'anchor-invalid': {
713
+ readonly kind: "refused";
714
+ readonly means: "an `anchor` or a link's `hash` that is not lowercase letters, digits and `-`";
715
+ readonly fix: "`anchor: 'plans'`, `hash: 'plans'` — no `#`";
716
+ };
717
+ readonly 'anchor-no-tag': {
718
+ readonly kind: "refused";
719
+ readonly means: "an anchor on an element that renders no element of its own";
720
+ readonly fix: "the anchor on the element around it, or `subType: 'div'` on the provider";
721
+ };
722
+ readonly 'anchor-repeated': {
723
+ readonly kind: "refused";
724
+ readonly means: "an anchor inside a list row or a component — it would be in the page once per row or instance";
725
+ readonly fix: "the anchor on the list, or on the element around the instance";
726
+ };
727
+ readonly 'anchor-duplicate': {
728
+ readonly kind: "refused";
729
+ readonly means: "one anchor on two elements of the same page (layouts included)";
730
+ readonly fix: "rename all but one";
731
+ };
732
+ readonly 'anchor-missing': {
733
+ readonly kind: "refused";
734
+ readonly means: "a link whose `hash` no element on the page it goes to carries — it would land at the top";
735
+ readonly fix: "the anchor the message lists, or give the section that `anchor`";
736
+ };
737
+ readonly 'id-invalid': {
738
+ readonly kind: "refused";
739
+ readonly means: "an id a binding, a template or a test cannot name";
740
+ readonly fix: "a letter first, then letters, digits, `-` and `_`: `'hero-title'`";
741
+ };
742
+ readonly 'id-taken': {
743
+ readonly kind: "refused";
744
+ readonly means: "two elements with one id — ids are one namespace for the whole space";
745
+ readonly fix: "wrap what a helper builds in `scope('promos', ref => …)`: every id inside is prefixed, `ref('slides')` names one";
746
+ };
747
+ readonly 'id-shadows-global': {
748
+ readonly kind: "refused";
749
+ readonly means: "an element named like a global data source (`state`, `navigation`, `auth`…)";
750
+ readonly fix: "another id";
751
+ };
752
+ readonly 'class-undeclared': {
753
+ readonly kind: "refused";
754
+ readonly means: "a class name the space does not declare";
755
+ readonly fix: "declare it in `classes`, hand the `styles()` declaration itself, or write the rules with `css`";
756
+ };
757
+ readonly 'class-conflict': {
758
+ readonly kind: "refused";
759
+ readonly means: "two different declarations for one class name";
760
+ readonly fix: "rename one, or make them agree";
761
+ };
762
+ readonly 'class-listed-under-other-name': {
763
+ readonly kind: "refused";
764
+ readonly means: "a `styles()` declaration listed in `classes` under another name";
765
+ readonly fix: "list it under its own name";
766
+ };
767
+ readonly 'class-and-css': {
768
+ readonly kind: "refused";
769
+ readonly means: "an element wearing a shared class AND `css` or `states` of its own — it has one base selector";
770
+ readonly fix: "the rules on top of the class: `class: [card, { opacity: '0.5' }]` (needs an `id`) — or into the class";
771
+ };
772
+ readonly 'class-and-selector': {
773
+ readonly kind: "refused";
774
+ readonly means: "an element with a shared class and a `selector` of its own";
775
+ readonly fix: "drop one: a shared class IS its selector";
776
+ };
777
+ readonly 'modifier-count': {
778
+ readonly kind: "refused";
779
+ readonly means: "more than one set of rules in a class list";
780
+ readonly fix: "one set, after the classes: `class: [card, { opacity: '0.5', 'margin-top': '8px' }]`";
781
+ };
782
+ readonly 'modifier-without-id': {
783
+ readonly kind: "refused";
784
+ readonly means: "rules on top of a class on an element with no `id` — the id names the class they become";
785
+ readonly fix: "`id: 'hero-bg'`";
786
+ };
787
+ readonly 'selector-invalid': {
788
+ readonly kind: "refused";
789
+ readonly means: "a `selector` that is not a CSS class name";
790
+ readonly fix: "letters, digits, `-` and `_`";
791
+ };
792
+ readonly 'selector-taken': {
793
+ readonly kind: "refused";
794
+ readonly means: "a `selector` that is a declared class, or another element's";
795
+ readonly fix: "`class` to share rules; a selector of an element's own is its alone";
796
+ };
797
+ readonly 'css-value': {
798
+ readonly kind: "refused";
799
+ readonly means: "an empty CSS value, or one with `;` or `{}`";
800
+ readonly fix: "one value per property; leave a property out instead of writing it empty";
801
+ };
802
+ readonly 'css-property-twice': {
803
+ readonly kind: "refused";
804
+ readonly means: "one property written twice in a rule set — `paddingTop` beside `'padding-top'` — so one would silently win";
805
+ readonly fix: "keep one";
806
+ };
807
+ readonly 'css-property-unknown': {
808
+ readonly kind: "refused";
809
+ readonly means: "a CSS property that does not exist";
810
+ readonly fix: "the property it suggests; a custom property starts with `--`";
811
+ };
812
+ readonly UNKNOWN_CSS_PROPERTY: {
813
+ readonly kind: "refused";
814
+ readonly means: "a property in the style document the style editor cannot read back";
815
+ readonly fix: "the property it suggests";
816
+ };
817
+ readonly 'rule-set-mixed': {
818
+ readonly kind: "refused";
819
+ readonly means: "a style that writes its rules beside `states`, `variants` or `ancestors` instead of under `css`";
820
+ readonly fix: "`{ css: { desktop: { … } }, states: { hover: { … } } }` — the rules under `css`, each of the others beside it";
821
+ };
822
+ readonly 'style-state-unknown': {
823
+ readonly kind: "refused";
824
+ readonly means: "a state a selector does not react to";
825
+ readonly fix: "one of the states it lists (`hover`, `focus`, `active`…)";
826
+ };
827
+ readonly 'ancestor-not-class': {
828
+ readonly kind: "refused";
829
+ readonly means: "an ancestor condition keyed by something that is not a class name";
830
+ readonly fix: "`[card.name]` for a `styles()` declaration";
831
+ };
832
+ readonly 'tablet-rule-skips-mobile': {
833
+ readonly kind: "warned";
834
+ readonly means: "a tablet rule phones never get — mobile inherits desktop, not tablet";
835
+ readonly fix: "write it under `compact` (tablet and mobile together)";
836
+ };
837
+ readonly 'tw-unknown-class': {
838
+ readonly kind: "refused";
839
+ readonly means: "a class `tw()` does not know as Tailwind";
840
+ readonly fix: "the class it suggests; a colour of the space through `createTw({ colors })`; any CSS as `[property:value]`";
841
+ };
842
+ readonly 'tw-no-equivalent': {
843
+ readonly kind: "refused";
844
+ readonly means: "a Tailwind class or variant with no exact equivalent in a Plitzi style (`sm:`, `dark:`, `space-x-4`)";
845
+ readonly fix: "what the message names: `md:`/`lg:`/`max-md:`/`max-lg:`, a token with both themes, `gap`";
846
+ };
847
+ readonly 'tw-class-conflict': {
848
+ readonly kind: "refused";
849
+ readonly means: "two classes set the same property and neither is the narrower one (`p-2 p-4`)";
850
+ readonly fix: "keep one";
851
+ };
852
+ readonly 'unknown-variable': {
853
+ readonly kind: "warned";
854
+ readonly means: "a `var(--x)` nothing in the space declares — the property it is in is dropped";
855
+ readonly fix: "declare it under `variables`, fix the name, or give it a fallback: `var(--x, …)`";
856
+ };
857
+ readonly 'colour-without-dark': {
858
+ readonly kind: "warned";
859
+ readonly means: "a colour token with no dark value";
860
+ readonly fix: "`{ light, dark, default }`";
861
+ };
862
+ readonly STYLE_WITHOUT_TAG: {
863
+ readonly kind: "warned";
864
+ readonly means: "style on a provider that renders no element of its own";
865
+ readonly fix: "`subType: 'div'` on the provider, or style its parent";
866
+ };
867
+ readonly 'element-shape': {
868
+ readonly kind: "refused";
869
+ readonly means: "an element that is not an object with a `type`, `attributes` and a list of `children`";
870
+ readonly fix: "build elements with their factories — `text(…)`, `container(…)`";
871
+ };
872
+ readonly 'element-rejected': {
873
+ readonly kind: "refused";
874
+ readonly means: "an element the schema refused to hold";
875
+ readonly fix: "the problem listed with it";
876
+ };
877
+ readonly 'unknown-element-type': {
878
+ readonly kind: "warned";
879
+ readonly means: "a type no built-in element has";
880
+ readonly fix: "the built-in it suggests; a plugin's declaration goes in `authorSpace(space, { plugins: [declaration] })`";
881
+ };
882
+ readonly 'unknown-attribute': {
883
+ readonly kind: "refused";
884
+ readonly means: "an attribute the element does not have";
885
+ readonly fix: "one it lists; an event (`onClick`) is a flow: `flows: [[onClick(), …]]`";
886
+ };
887
+ readonly 'attribute-value': {
888
+ readonly kind: "refused";
889
+ readonly means: "a value outside the attribute's list (`subType: 'h7'`)";
890
+ readonly fix: "one of the listed values";
891
+ };
892
+ readonly 'attribute-kind': {
893
+ readonly kind: "refused";
894
+ readonly means: "text where a flag or a list is read";
895
+ readonly fix: "`disabled: true`, not `'true'`; `items: [ … ]`";
896
+ };
897
+ readonly 'element-runtime': {
898
+ readonly kind: "refused";
899
+ readonly means: "a `runtime` the element does not run in";
900
+ readonly fix: "one of the values the message lists";
901
+ };
902
+ readonly 'element-load-strategy': {
903
+ readonly kind: "refused";
904
+ readonly means: "a `loadStrategy` the element does not take";
905
+ readonly fix: "one of the values the message lists";
906
+ };
907
+ readonly 'children-in-leaf': {
908
+ readonly kind: "refused";
909
+ readonly means: "children on a type that renders only its own attributes (`heading`, `text`, `image`…)";
910
+ readonly fix: "a `container` — for a heading made of parts, `container({ subType: 'h1', children })`";
911
+ };
912
+ readonly 'span-holds-block': {
913
+ readonly kind: "warned";
914
+ readonly means: "a `container({ subType: 'span' })` holding a heading, a paragraph, a list, a form or prose";
915
+ readonly fix: "a `div` (leave `subType` out), or words: a `text` with `display: inline` in its class";
916
+ };
917
+ readonly 'part-missing': {
918
+ readonly kind: "refused";
919
+ readonly means: "a compound element — a carousel, a tab container, a dropdown — without a part it renders through";
920
+ readonly fix: "the part the message names, inside it (`carousel()` writes its own track)";
921
+ };
922
+ readonly 'outside-ancestor': {
923
+ readonly kind: "refused";
924
+ readonly means: "an element that reads the state of an element it is not inside";
925
+ readonly fix: "nest it in the element the message names";
926
+ };
927
+ readonly 'default-content-beside-children': {
928
+ readonly kind: "warned";
929
+ readonly means: "a button printing its default \"Button\" beside its children";
930
+ readonly fix: "`content: ''`";
931
+ };
932
+ readonly 'loading-slot-unknown': {
933
+ readonly kind: "refused";
934
+ readonly means: "an `apiContainer`'s `loadingSlot` that is not the id of one of its children";
935
+ readonly fix: "the id of the child to show until the first answer — `loadingSlot: 'catalog-skeleton'` beside that child";
936
+ };
937
+ readonly 'row-and-children': {
938
+ readonly kind: "refused";
939
+ readonly means: "a list with a `row` and `children` — the row is what it renders";
940
+ readonly fix: "one of the two";
941
+ };
942
+ readonly 'row-without-id': {
943
+ readonly kind: "refused";
944
+ readonly means: "a list whose `row` is a function, with no `id` — the row's sources are named after it";
945
+ readonly fix: "`list({ id: 'products', items, row: r => … })`";
946
+ };
947
+ readonly 'row-outside-list': {
948
+ readonly kind: "refused";
949
+ readonly means: "`row` on an element that is not a list";
950
+ readonly fix: "a `list` around it";
951
+ };
952
+ readonly 'source-field-unknown': {
953
+ readonly kind: "refused";
954
+ readonly means: "a path into a typed source that its sample does not have";
955
+ readonly fix: "read a field the sample has, or add the field to the sample";
956
+ };
957
+ readonly 'svg-not-svg': {
958
+ readonly kind: "refused";
959
+ readonly means: "an `svg` whose `content` is not one `<svg>…</svg>` — it draws nothing";
960
+ readonly fix: "the SVG markup alone; HTML around it goes in a `blockHtml`";
961
+ };
962
+ readonly 'row-component': {
963
+ readonly kind: "refused";
964
+ readonly means: "a list's `row` naming a component the space does not declare, or one with no prop to take the row";
965
+ readonly fix: "a declared component with an `item` prop — or a single prop — for the row";
966
+ };
967
+ readonly 'list-without-items': {
968
+ readonly kind: "refused";
969
+ readonly means: "a controlled list with nothing to render";
970
+ readonly fix: "`items: [ … ]` or `bind: { items: 'provider.data.rows' }`";
971
+ };
972
+ readonly 'list-item-key-missing': {
973
+ readonly kind: "warned";
974
+ 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";
975
+ readonly fix: "a field every item has, once each";
976
+ };
977
+ readonly 'list-items-ignored': {
978
+ readonly kind: "refused";
979
+ readonly means: "a list whose items nothing reads — `source: 'none'` renders its children once";
980
+ readonly fix: "`source: 'controlled'`";
981
+ };
982
+ readonly 'overlay-starts-open': {
983
+ readonly kind: "warned";
984
+ readonly means: "a modal or a dialog open when the page loads";
985
+ readonly fix: "`visible: false`, opened by `openModal`";
986
+ };
987
+ readonly 'overlay-never-opened': {
988
+ readonly kind: "warned";
989
+ readonly means: "a modal or a dialog that starts hidden and that no step opens";
990
+ readonly fix: "a flow with `openModal('id')` / `openDialog('id')`";
991
+ };
992
+ readonly 'provider-without-source': {
993
+ readonly kind: "warned";
994
+ readonly means: "an `apiContainer` that asks nothing";
995
+ readonly fix: "a `query` (or `action`, `connector`, `resource`)";
996
+ };
997
+ readonly 'server-data-without-rsc': {
998
+ readonly kind: "warned";
999
+ readonly means: "a `runtime: 'server'` provider with a `connector` or `action` in a space that does not turn server data on";
1000
+ readonly fix: "`rsc: { enabled: true }` on the space";
1001
+ };
1002
+ readonly 'route-param-undeclared': {
1003
+ readonly kind: "warned";
1004
+ readonly means: "`navigation.routeParams.x` read on a page whose slug has no `:x` — always empty";
1005
+ readonly fix: "add `:x` to the slug, or read `navigation.queryParams.x`";
1006
+ };
1007
+ readonly 'form-control-unnamed': {
1008
+ readonly kind: "warned";
1009
+ readonly means: "a control in a form with no `name` — its value never reaches `values`";
1010
+ readonly fix: "`formControl({ name: 'email', … })`";
1011
+ };
1012
+ readonly 'form-control-name-taken': {
1013
+ readonly kind: "warned";
1014
+ readonly means: "two controls in one form with one name — one overwrites the other";
1015
+ readonly fix: "a name each";
1016
+ };
1017
+ readonly FORM_SUBMIT_UNMANAGED: {
1018
+ readonly kind: "warned";
1019
+ readonly means: "a form the browser would submit itself, reloading the page";
1020
+ readonly fix: "`managedByInteractions: true`";
1021
+ };
1022
+ readonly 'from-without-attribute': {
1023
+ readonly kind: "refused";
1024
+ readonly means: "`from` on a type with no one attribute that shows its data (a container, a form)";
1025
+ readonly fix: "bind the attribute you mean: `bind: { attribute: 'source' }`";
1026
+ };
1027
+ readonly 'from-and-bind': {
1028
+ readonly kind: "refused";
1029
+ readonly means: "the main attribute bound twice, with `from` and in `bind`";
1030
+ readonly fix: "keep `from`, and give `bind` the other attributes";
1031
+ };
1032
+ readonly 'as-without-from': {
1033
+ readonly kind: "refused";
1034
+ readonly means: "`as` with no `from` — `as` is how the source `from` names is shown";
1035
+ readonly fix: "`from: 'products.item.price', as: 'price'`";
1036
+ };
1037
+ readonly 'format-unknown': {
1038
+ readonly kind: "refused";
1039
+ readonly means: "an `as` that names no format of the space's `formats`";
1040
+ readonly fix: "declare it once — `formats: { price: \"{{ source|currency('USD') }}\" }` — or write the template in its place";
1041
+ };
1042
+ readonly 'binding-shape': {
1043
+ readonly kind: "refused";
1044
+ readonly means: "a binding with no `to` or no `source`";
1045
+ readonly fix: "`bind: { content: 'posts.item.title' }`, or `bindTemplate(to, source, template)`";
1046
+ };
1047
+ readonly 'binding-category': {
1048
+ readonly kind: "refused";
1049
+ readonly means: "a binding `category` that does not exist";
1050
+ readonly fix: "one of the categories it lists";
1051
+ };
1052
+ readonly 'binding-source-unknown': {
1053
+ readonly kind: "refused";
1054
+ readonly means: "a binding whose source names an element that does not exist, or with its prefix written wrong";
1055
+ readonly fix: "the id of the element that publishes it, written alone — the prefix is filled in";
1056
+ };
1057
+ readonly 'binding-source-out-of-scope': {
1058
+ readonly kind: "refused";
1059
+ readonly means: "a source read by an element that is not inside the element publishing it";
1060
+ readonly fix: "move the element inside it, or share the value through `state`";
1061
+ };
1062
+ readonly 'binding-target-unknown': {
1063
+ readonly kind: "refused";
1064
+ readonly means: "a binding onto an attribute the element does not have — the value arrives and nothing shows it";
1065
+ readonly fix: "one it lists (`content`); to follow data with a class, `variantFrom`";
1066
+ };
1067
+ readonly 'active-when-constant': {
1068
+ readonly kind: "refused";
1069
+ readonly means: "an `activeWhen` condition that reads nothing — always or never true";
1070
+ readonly fix: "name what it depends on: `'{{ list_dots.index == state.slide }}'`";
1071
+ };
1072
+ readonly 'visibility-as-attribute': {
1073
+ readonly kind: "refused";
1074
+ readonly means: "`visibility` bound as an attribute, which no element reads";
1075
+ readonly fix: "`visible: { source, template }`";
1076
+ };
1077
+ readonly 'unknown-transformer': {
1078
+ readonly kind: "refused";
1079
+ readonly means: "a transformer that does not exist";
1080
+ readonly fix: "one of the transformers it lists";
1081
+ };
1082
+ readonly 'transformer-params': {
1083
+ readonly kind: "refused";
1084
+ readonly means: "a transformer param that does not exist, or a value outside its options";
1085
+ readonly fix: "the params and values it lists";
1086
+ };
1087
+ readonly 'template-text-into-value': {
1088
+ readonly kind: "refused";
1089
+ readonly means: "a template, which renders text, feeding an attribute that holds a list or an object";
1090
+ readonly fix: "`bindTemplate('items', source, '{{ … }}', { returns: 'value' })`";
1091
+ };
1092
+ readonly 'template-unreadable': {
1093
+ readonly kind: "refused";
1094
+ readonly means: "a template with an operator, a filter or a function that does not exist, or broken syntax";
1095
+ readonly fix: "an operator, a filter or a function the interpreter has — the message names the one it could not read; `matches` never exists";
1096
+ };
1097
+ readonly 'template-unknown-name': {
1098
+ readonly kind: "refused";
1099
+ readonly means: "a name in a template that is not a source, a variable or a route param";
1100
+ readonly fix: "the full source name (`list_rows.item`), `navigation.queryParams.x`, or `source` for the bound value";
1101
+ };
1102
+ readonly 'template-short-source': {
1103
+ readonly kind: "refused";
1104
+ readonly means: "a source named without its prefix inside a template or a step";
1105
+ readonly fix: "the full name: `apiContainer_stats`, `list_rows`";
1106
+ };
1107
+ readonly 'template-source-out-of-scope': {
1108
+ readonly kind: "refused";
1109
+ readonly means: "a template reading the source of an element it is not inside";
1110
+ readonly fix: "move the element inside it, or share the value through `state`";
1111
+ };
1112
+ readonly 'template-never-resolved': {
1113
+ readonly kind: "warned";
1114
+ readonly means: "a condition in an attribute, which only resolves `{{ name|filter }}` — used as written";
1115
+ readonly fix: "move it into `bindTemplate`";
1116
+ };
1117
+ readonly 'condition-starts-visible': {
1118
+ readonly kind: "warned";
1119
+ readonly means: "a computed visibility that shows until its data answers";
1120
+ readonly fix: "`visible: { source, template }`";
1121
+ };
1122
+ readonly 'computed-name': {
1123
+ readonly kind: "refused";
1124
+ readonly means: "a computed value whose name a template cannot read as `computed.x`";
1125
+ readonly fix: "letters, digits and `_`";
1126
+ };
1127
+ readonly 'computed-not-template': {
1128
+ readonly kind: "refused";
1129
+ readonly means: "a computed value that is not a template";
1130
+ readonly fix: "`'{{ state.x * 2 }}'`";
1131
+ };
1132
+ readonly 'computed-reads-element': {
1133
+ readonly kind: "refused";
1134
+ readonly means: "a computed value reading an element's source — no element is around the whole space";
1135
+ readonly fix: "compute it from the globals and the variables, or bind it on the element";
1136
+ };
1137
+ readonly 'computed-unknown': {
1138
+ readonly kind: "refused";
1139
+ readonly means: "a computed value read before it is declared, or never declared";
1140
+ readonly fix: "declare it in `computed`, above the one that reads it";
1141
+ };
1142
+ readonly 'component-id': {
1143
+ readonly kind: "refused";
1144
+ readonly means: "a component whose `id` is not a name it can be placed by";
1145
+ readonly fix: "a letter first, then letters, digits, `-` and `_`";
1146
+ };
1147
+ readonly 'component-duplicate': {
1148
+ readonly kind: "refused";
1149
+ readonly means: "two components with one id";
1150
+ readonly fix: "a name each";
1151
+ };
1152
+ readonly 'component-undeclared': {
1153
+ readonly kind: "refused";
1154
+ readonly means: "an instance of a component the space does not declare";
1155
+ readonly fix: "the id it suggests, or declare it in `components`";
1156
+ };
1157
+ readonly 'prop-name': {
1158
+ readonly kind: "refused";
1159
+ readonly means: "a prop whose name a template cannot read as `props.x`";
1160
+ readonly fix: "letters, digits and `_`";
1161
+ };
1162
+ readonly 'prop-unknown': {
1163
+ readonly kind: "refused";
1164
+ readonly means: "a prop the component does not declare, handed in or read";
1165
+ readonly fix: "the prop it suggests, or declare it: `props: { name: { type: 'text' } }`";
1166
+ };
1167
+ readonly 'prop-missing': {
1168
+ readonly kind: "refused";
1169
+ readonly means: "an instance without a prop its component requires";
1170
+ readonly fix: "`component('card', { props: { name: … } })`, or bind it";
1171
+ };
1172
+ readonly 'prop-value': {
1173
+ readonly kind: "refused";
1174
+ readonly means: "a prop handed in with a value its declaration does not take";
1175
+ readonly fix: "a value of the declared type, or one of its options";
1176
+ };
1177
+ readonly 'props-outside-component': {
1178
+ readonly kind: "refused";
1179
+ readonly means: "`props.x` read outside a component";
1180
+ readonly fix: "read the source it would have come from";
1181
+ };
1182
+ readonly 'slot-unknown': {
1183
+ readonly kind: "refused";
1184
+ readonly means: "a component slot that is not an element of its tree";
1185
+ readonly fix: "the id of an element inside the component — usually an empty container";
1186
+ };
1187
+ readonly 'slot-children': {
1188
+ readonly kind: "refused";
1189
+ readonly means: "children handed to an instance outside its slots";
1190
+ readonly fix: "`children: { slotName: [ … ] }`; a component with no slots takes no children";
1191
+ };
1192
+ readonly 'flag-gate': {
1193
+ readonly kind: "refused";
1194
+ readonly means: "an element's or a page's `flag` that is not a flag name";
1195
+ readonly fix: "`flag: 'newCheckout'`, or `flag: '!newCheckout'` for \"only while off\"";
1196
+ };
1197
+ readonly 'flag-undeclared': {
1198
+ readonly kind: "refused";
1199
+ readonly means: "a gate on a flag the space does not declare — it reads as off, so the element never (or always) renders";
1200
+ readonly fix: "declare it in `flags`, or remove the gate";
1201
+ };
1202
+ readonly 'flag-unknown': {
1203
+ readonly kind: "refused";
1204
+ readonly means: "a template reading a flag the space does not declare";
1205
+ readonly fix: "the declared name it suggests, or declare it";
1206
+ };
1207
+ readonly 'flag-name': {
1208
+ readonly kind: "refused";
1209
+ readonly means: "a flag whose name a template cannot read as `flags.x`";
1210
+ readonly fix: "letters, digits and `_`";
1211
+ };
1212
+ readonly 'flag-shape': {
1213
+ readonly kind: "refused";
1214
+ readonly means: "a flag whose `value` is not `true` or `false`";
1215
+ readonly fix: "`{ value: false, rules: [] }`";
1216
+ };
1217
+ readonly 'flag-rule-shape': {
1218
+ readonly kind: "refused";
1219
+ readonly means: "a flag rule that is not `{ when, value }`, or whose `value` is not `true` or `false`";
1220
+ readonly fix: "`{ when: { … }, value: true }`";
1221
+ };
1222
+ readonly 'flag-rule-empty': {
1223
+ readonly kind: "warned";
1224
+ readonly means: "a flag rule with no conditions — skipped, never read as \"always\"";
1225
+ readonly fix: "give it a condition, or set the flag's `value` instead";
1226
+ };
1227
+ readonly 'flag-unused': {
1228
+ readonly kind: "warned";
1229
+ readonly means: "a declared flag nothing gates on and no template reads";
1230
+ readonly fix: "gate what it switches (`flag: 'x'`), or remove it once the feature has shipped";
1231
+ };
1232
+ readonly 'flow-empty': {
1233
+ readonly kind: "refused";
1234
+ readonly means: "a flow with no steps";
1235
+ readonly fix: "`[onClick(), setState({ … })]`";
1236
+ };
1237
+ readonly 'flow-without-trigger': {
1238
+ readonly kind: "refused";
1239
+ readonly means: "a flow whose first step is not the event that runs it";
1240
+ readonly fix: "`[onClick(), setState(…)]`";
1241
+ };
1242
+ readonly 'step-name': {
1243
+ readonly kind: "refused";
1244
+ readonly means: "a step name a later step cannot read as `{{ name.field }}`";
1245
+ readonly fix: "a letter first, then letters, digits, `-` and `_`";
1246
+ };
1247
+ readonly 'step-duplicate': {
1248
+ readonly kind: "refused";
1249
+ readonly means: "two steps with one name in a flow or an action";
1250
+ readonly fix: "a name each";
1251
+ };
1252
+ readonly 'step-type': {
1253
+ readonly kind: "refused";
1254
+ readonly means: "a step `type` that does not exist";
1255
+ readonly fix: "the step builders — `setState(…)`, `navigate(…)` — write it";
1256
+ };
1257
+ readonly 'step-params': {
1258
+ readonly kind: "refused";
1259
+ readonly means: "a step param that does not exist, or a value outside its options";
1260
+ readonly fix: "the params and values it lists";
1261
+ };
1262
+ readonly 'trigger-never-fired': {
1263
+ readonly kind: "refused";
1264
+ readonly means: "a flow on an event the element never fires";
1265
+ readonly fix: "the element that fires it; for a plugin, `declaredTrigger(declaration, 'onPick')`";
1266
+ };
1267
+ readonly 'trigger-keys': {
1268
+ readonly kind: "refused";
1269
+ readonly means: "an `onKey` shortcut that cannot fire: two keys at once, only modifiers, or a name that is not a key";
1270
+ readonly fix: "`onKey('f')`, `onKey('shift+f')`, `onKey('mod+k, escape')`";
1271
+ };
1272
+ readonly 'trigger-interval': {
1273
+ readonly kind: "refused";
1274
+ readonly means: "an `onInterval` that never ticks: not a whole number of milliseconds, or below 250";
1275
+ readonly fix: "`onInterval(5000)`";
1276
+ };
1277
+ readonly 'while-running': {
1278
+ readonly kind: "refused";
1279
+ readonly means: "`whileRunning` on a step that is not the trigger, or a mode other than `skip`, `parallel`, `queue`";
1280
+ readonly fix: "`[whileRunning('queue', onClick()), …]`";
1281
+ };
1282
+ readonly 'callback-not-answered': {
1283
+ readonly kind: "refused";
1284
+ readonly means: "a step sending an action the target element never answers to";
1285
+ readonly fix: "the element that answers it; for a plugin, `declaredCallback(declaration, 'reset', { on })`";
1286
+ };
1287
+ readonly 'callback-key-unknown': {
1288
+ readonly kind: "refused";
1289
+ readonly means: "a `setState` / `toggleState` on an element writing a field it does not have";
1290
+ readonly fix: "an attribute it lists, or for `category: 'state'` `visibility` / `styleSelectors.<selector>`";
1291
+ };
1292
+ readonly 'global-callback-undeclared': {
1293
+ readonly kind: "refused";
1294
+ readonly means: "a global-callback step builder naming an action no source declares";
1295
+ readonly fix: "one of the actions it lists";
1296
+ };
1297
+ readonly 'global-callback-module': {
1298
+ readonly kind: "refused";
1299
+ readonly means: "a global callback sent to a module other than the one that registers it";
1300
+ readonly fix: "the step builder, which knows the module";
1301
+ };
1302
+ readonly 'unknown-global-callback': {
1303
+ readonly kind: "warned";
1304
+ readonly means: "a global callback no built-in source declares — it runs only if something registers it";
1305
+ readonly fix: "the built-in it suggests, or make sure a plugin or module of the space registers it";
1306
+ };
1307
+ readonly 'utility-module': {
1308
+ readonly kind: "refused";
1309
+ readonly means: "a utility sent to a module — a utility takes none";
1310
+ readonly fix: "drop the `on`";
1311
+ };
1312
+ readonly 'unknown-utility': {
1313
+ readonly kind: "warned";
1314
+ readonly means: "a utility that is not one of the built-in ones";
1315
+ readonly fix: "one of the built-in utilities";
1316
+ };
1317
+ readonly 'state-key-has-runtime-prefix': {
1318
+ readonly kind: "warned";
1319
+ readonly means: "a state key written with `runtime.state.` in front — the state callbacks already write below it";
1320
+ readonly fix: "`key: 'cart'`, not `'runtime.state.cart'`";
1321
+ };
1322
+ readonly 'state-toggled-in-branches': {
1323
+ readonly kind: "warned";
1324
+ readonly means: "two `setState` of one key, each under a `when` on that key — the second flips back what the first wrote";
1325
+ readonly fix: "`toggleState({ key })`; for something shown by default, a key named for hiding it";
1326
+ };
1327
+ readonly 'form-value-compared-to-blank': {
1328
+ readonly kind: "warned";
1329
+ readonly means: "a `when` comparing a submitted field to `\"\"` — a field nobody typed in is not sent";
1330
+ readonly fix: "`operator: 'empty'` / `'notEmpty'`";
1331
+ };
1332
+ readonly 'action-without-entry': {
1333
+ readonly kind: "refused";
1334
+ readonly means: "an action with no way in, so nothing can start it";
1335
+ readonly fix: "a `trigger` — `{ type: 'call', access }`, or `render`, `webhook`, `custom`, `schedule`";
1336
+ };
1337
+ readonly 'action-without-steps': {
1338
+ readonly kind: "refused";
1339
+ readonly means: "an action with no steps";
1340
+ readonly fix: "the steps it runs";
1341
+ };
1342
+ readonly 'action-step-params': {
1343
+ readonly kind: "refused";
1344
+ readonly means: "a step with no params in an action whose ways in declare different inputs";
1345
+ readonly fix: "the step's params";
1346
+ };
1347
+ readonly 'channel-declaration': {
1348
+ readonly kind: "refused";
1349
+ readonly means: "a channel whose pattern or access the server cannot read";
1350
+ readonly fix: "what the message says: `{ access: { mode: 'public' } }`, a pattern like `room:{id}`";
1351
+ };
1352
+ readonly 'channel-topic': {
1353
+ readonly kind: "refused";
1354
+ readonly means: "a `channel` element with no topic";
1355
+ readonly fix: "a topic a channel of the space covers";
1356
+ };
1357
+ readonly 'channel-grant': {
1358
+ readonly kind: "refused";
1359
+ readonly means: "a topic of a private channel opened with no grant to it";
1360
+ readonly fix: "the grant the message names, or a public channel";
1361
+ };
1362
+ readonly 'control-without-name': {
1363
+ readonly kind: "warned";
1364
+ readonly means: "a button or a link with no words, or a field nothing names";
1365
+ readonly fix: "`title` on the button, `label` on the link, `label` (with `hideLabel: true`) on the field";
1366
+ };
1367
+ readonly 'embed-without-title': {
1368
+ readonly kind: "warned";
1369
+ readonly means: "an `embed` with no `title` — a frame a screen reader cannot describe";
1370
+ readonly fix: "say what it shows in `title`";
1371
+ };
1372
+ readonly 'image-without-alt': {
1373
+ readonly kind: "warned";
1374
+ readonly means: "an image that is not `decorative` and has no `alt`";
1375
+ readonly fix: "say what it shows, or `decorative: true`";
1376
+ };
1377
+ readonly 'click-on-static-element': {
1378
+ readonly kind: "warned";
1379
+ readonly means: "a click flow on a container, text, heading, image or list item — no keyboard reaches it";
1380
+ readonly fix: "the flow on a `button` (it holds children) or a `link`";
1381
+ };
1382
+ readonly 'heading-level-skipped': {
1383
+ readonly kind: "warned";
1384
+ readonly means: "an `h4` right after an `h2` — the outline misses a level";
1385
+ readonly fix: "the next level down; size it with its class";
1386
+ };
1387
+ readonly 'label-ignored': {
1388
+ readonly kind: "warned";
1389
+ readonly means: "a `label` on a container whose tag is named by what it holds (`li`, a heading)";
1390
+ readonly fix: "the words inside, or a landmark tag (`nav`, `section`…)";
1391
+ };
1392
+ readonly 'dropdown-without-control': {
1393
+ readonly kind: "warned";
1394
+ readonly means: "a dropdown opened from a box or an icon — no keyboard opens it";
1395
+ readonly fix: "a `button` as what opens it (`title` if it is only an icon)";
1396
+ };
1397
+ readonly 'control-in-decorative': {
1398
+ readonly kind: "warned";
1399
+ readonly means: "a control inside a `decorative` container — Tab lands on something nothing announces";
1400
+ readonly fix: "move it out of the illustration";
1401
+ };
1402
+ readonly 'repeated-on-pages': {
1403
+ readonly kind: "suggested";
1404
+ readonly means: "the same block — a header, a footer, a side panel — written into several pages";
1405
+ 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";
1406
+ };
1407
+ readonly 'repeated-shape': {
1408
+ readonly kind: "suggested";
1409
+ readonly means: "the same structure written again and again with different words — cards, rows, tiles";
1410
+ 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";
1411
+ };
1412
+ readonly 'content-attribute': {
1413
+ readonly kind: "suggested";
1414
+ 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";
1415
+ 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";
1416
+ };
1417
+ readonly 'custom-css-class': {
1418
+ readonly kind: "suggested";
1419
+ readonly means: "a `customCss` rule a class can hold — `.card:hover`, `.panel .icon`";
1420
+ readonly fix: "the class's own `states` or `ancestors`, where the style editor reads it back and a breakpoint can change it";
1421
+ };
1422
+ readonly 'custom-css-sdk-default': {
1423
+ readonly kind: "suggested";
1424
+ readonly means: "`customCss` repeating what the SDK already does for every space — less motion when asked, the theme toggle showing one icon";
1425
+ readonly fix: "nothing: remove it";
1426
+ };
1427
+ readonly 'custom-css-notifications': {
1428
+ readonly kind: "suggested";
1429
+ readonly means: "the toasts dressed with `.Toastify__toast` rules in `customCss`";
1430
+ readonly fix: "`notifications: { font, fontSize, border, shadow, padding, background, text, radius }`";
1431
+ };
1432
+ readonly 'heavy-animation': {
1433
+ readonly kind: "suggested";
1434
+ 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";
1435
+ 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]`";
1436
+ };
1437
+ };
1438
+
1439
+ export declare type AuthoringCode = keyof Codes;
1440
+
1441
+ /**
1442
+ * Every problem `authorSpace` and `lintSpace` report, by its code: whether it is refused or warned, what was wrong, and
1443
+ * what to write instead — and every suggestion `suggestSpace` makes, a shorter way to the same page.
1444
+ *
1445
+ * The one table: a refusal or a warning raised with a code that is not here is a compile error, and the skill's
1446
+ * `authoring-errors.md` is generated from it (`yarn generate:authoring-errors`), so the page cannot miss one. The
1447
+ * UPPER_CASE codes beside these come from the documents' own structure (`validateSchema`) and only a hand-written or
1448
+ * hand-edited JSON has them — the three an authored space can meet are listed here too.
1449
+ */
1450
+ export declare type AuthoringCodeEntry = {
1451
+ /**
1452
+ * Refused stops the space from being written; warned writes it, and says it will not do what it says; suggested is
1453
+ * not a problem at all — the page renders as written, and a shorter way to the same page exists.
1454
+ */
1455
+ kind: 'refused' | 'warned' | 'suggested';
1456
+ /** What was wrong, in a line. */
1457
+ means: string;
1458
+ /** What to write instead. */
1459
+ fix: string;
1460
+ };
1461
+
1462
+ /**
1463
+ * The row of a code a problem was reported with — what any tool that relays a problem adds to it (the MCP, the CLI),
1464
+ * so the fix travels with the code and nobody needs the skill's page to read it. `undefined` for a structural
1465
+ * UPPER_CASE code of `validateSchema` the table does not hold.
1466
+ */
1467
+ export declare const authoringCodeEntry: (code: string) => AuthoringCodeEntry | undefined;
1468
+
1469
+ /**
1470
+ * Every code of one kind as a Markdown table — code, what was wrong, what to write instead — for any page that explains
1471
+ * them: the skill's `authoring-errors.md` and the website's both render it, so neither can miss a code.
1472
+ */
1473
+ export declare const authoringCodesTable: (kind: AuthoringCodeEntry["kind"]) => string;
1474
+
1475
+ /**
1476
+ * A declaration `authorSpace` will not write, with the code its row in `authoring-errors.md` is filed under.
1477
+ *
1478
+ * `reason` is the sentence alone; `message` leads with the code, so an error that escapes on its own still says where
1479
+ * to look it up.
1480
+ */
1481
+ export declare class AuthoringError extends Error {
1482
+ readonly code: RefusalCode;
1483
+ readonly reason: string;
1484
+ constructor(code: RefusalCode, reason: string, options?: ErrorOptions);
1485
+ }
1486
+
531
1487
  /**
532
1488
  * Authoring an element.
533
1489
  *
@@ -548,10 +1504,10 @@ export declare interface AuthoringProps {
548
1504
  */
549
1505
  id?: string;
550
1506
  /**
551
- * A shared class — a name from the space's `classes`, or a `styles()` declaration — or a list of them. Exclusive
552
- * with {@link AuthoringProps.css}.
1507
+ * A shared class — a name from the space's `classes`, or a `styles()` declaration — or a list of them, which may end
1508
+ * with rules of this element's own on top: `[cover, { opacity: '0.25' }]`. Exclusive with {@link AuthoringProps.css}.
553
1509
  */
554
- class?: ClassList;
1510
+ class?: ElementClassList;
555
1511
  /** Rules of this element's own: one set, or one per breakpoint. Shorthands are expanded when the space is written. */
556
1512
  css?: CssSpec;
557
1513
  /** How the element's own rules react — `hover`, `focus` — beside {@link AuthoringProps.css}. */
@@ -563,23 +1519,45 @@ export declare interface AuthoringProps {
563
1519
  /** A class for one of the element's other selectors — a form control's `input`, `label`, `error`. */
564
1520
  slots?: Record<string, ClassList>;
565
1521
  /** `{ content: 'posts.title' }`, or the full form for state, transformers and conditions. */
566
- bind?: BindingsSpec;
1522
+ bind?: BindingsInput;
1523
+ /** The source the element's main attribute shows — see {@link ElementSpec.from}. */
1524
+ from?: SourceName;
1525
+ /** How `from` is shown: a name of the space's `formats`, or a template of its own. */
1526
+ as?: string;
1527
+ /**
1528
+ * A list's row — what it renders once per item: a component's id, placed with the row bound to its `item` prop, or
1529
+ * a function handed the row's names (`r.item`, `r.index`, and `r.inTemplate` for a template) returning the elements.
1530
+ */
1531
+ row?: string | RowWriter<ListRow>;
567
1532
  /**
568
1533
  * Show this element only while the value at this source is true. `!source` shows it while the value is false,
569
1534
  * `{ source, template }` while a template over it says `true`, and `false` starts it hidden for a flow to reveal.
570
1535
  */
571
- visible?: string | false | VisibleCondition;
1536
+ visible?: SourceName | false | VisibleInput;
572
1537
  /** One flow per entry; steps are chained in the order written. */
573
1538
  flows?: StepSpec[][];
574
1539
  /** `server` resolves this element's data on the server rather than in the browser. */
575
1540
  runtime?: ElementRuntime;
576
1541
  /** When the element's contents mount relative to its visibility. Left out, the element type decides. */
577
1542
  loadStrategy?: ElementLoadStrategy;
1543
+ /** Its `id` in the DOM, so `/page#anchor` lands on it. One per page; not inside a list row or a component. */
1544
+ anchor?: string;
1545
+ /** The feature flag it exists under: `'newCheckout'` while on, `'!newCheckout'` while off. Not a visibility. */
1546
+ flag?: string;
578
1547
  children?: ElementSpec[];
579
1548
  /** What the builder shows, not what the runtime reads. */
580
1549
  meta?: SpecMeta;
581
1550
  }
582
1551
 
1552
+ /**
1553
+ * `authorSnippet`, holding the same vocabularies — the artefact you publish when you are not building a space.
1554
+ *
1555
+ * A snippet is a subtree hosted as a JSON and dragged onto someone else's canvas, so the checks that matter are
1556
+ * the ones about what does NOT travel with it: a class it names but does not carry, a binding onto a provider that
1557
+ * stayed behind. Those are the assembly half's; what this adds is the catalog that tells a real source from a typo.
1558
+ */
1559
+ export declare const authorSnippet: (spec: SnippetSpec, options?: AuthorSpaceOptions) => AuthoredSnippet;
1560
+
583
1561
  /**
584
1562
  * `authorSpace`, holding this SDK's own vocabularies — and each plugin handed in as `plugins`, held to its declaration.
585
1563
  *
@@ -614,6 +1592,8 @@ export declare interface AuthorSpaceOptions {
614
1592
  slotNames?: Record<string, readonly string[]>;
615
1593
  /** Element type → the type it only works inside. Left out, a sub-element is placed wherever it is written. */
616
1594
  ancestorTypes?: Record<string, string>;
1595
+ /** Element type → the parts it renders through, each a child it needs. Left out, a compound type is never checked. */
1596
+ partTypes?: Record<string, readonly string[]>;
617
1597
  /**
618
1598
  * Element type → the attributes its component reads, `null` for one that reads any. Left out, an attribute
619
1599
  * nothing reads is written without a word.
@@ -656,18 +1636,14 @@ export declare interface AuthorSpaceOptions {
656
1636
  }>>;
657
1637
  }
658
1638
 
659
- /**
660
- * `authorTemplate`, holding the same vocabularies — the artefact you publish when you are not building a space.
661
- *
662
- * A template is a subtree hosted as a JSON and dragged onto someone else's canvas, so the checks that matter are
663
- * the ones about what does NOT travel with it: a class it names but does not carry, a binding onto a provider that
664
- * stayed behind. Those are the assembly half's; what this adds is the catalog that tells a real source from a typo.
665
- */
666
- export declare const authorTemplate: (spec: TemplateSpec, options?: AuthorSpaceOptions) => AuthoredTemplate;
667
-
668
1639
  export declare const authRefreshDetails: () => StepSpec;
669
1640
 
670
- declare type BindingCategory = 'attributes' | 'style' | 'initialState';
1641
+ export declare type BindingCategory = 'attributes' | 'style' | 'initialState';
1642
+
1643
+ /** A binding whose source may be a typed source's path as well as a name. */
1644
+ export declare type BindingsInput = Record<string, SourceName> | (Omit<BindingSpec, 'source'> & {
1645
+ source: SourceName;
1646
+ })[];
671
1647
 
672
1648
  export declare interface BindingSpec {
673
1649
  /** Attribute, style property or state key that receives the value. */
@@ -695,7 +1671,7 @@ export declare interface BindingSpec {
695
1671
  */
696
1672
  export declare type BindingsSpec = Record<string, string> | BindingSpec[];
697
1673
 
698
- declare type BindingTransformer = {
1674
+ export declare type BindingTransformer = {
699
1675
  action: string;
700
1676
  /**
701
1677
  * Mostly text, and not only: a param the builder draws as a checkbox (`styleVariant`'s `append`) is stored as the
@@ -781,6 +1757,12 @@ declare type BlockJsxProps = {
781
1757
  /** The breakpoints a rule set can be written for, widest first — the order they cascade in. */
782
1758
  export declare const BREAKPOINTS: DisplayMode[];
783
1759
 
1760
+ /**
1761
+ * The builder of an action whose builder is not named after it. Checked by a test against the exports, so a renamed
1762
+ * builder breaks the build rather than this answer.
1763
+ */
1764
+ export declare const BUILDER_NAMES: Record<string, string>;
1765
+
784
1766
  export declare const buildHandles: (pages: Record<string, PageHandle>, layouts?: Record<string, LayoutHandle>) => SpaceHandles;
785
1767
 
786
1768
  export declare const BUILTIN_ELEMENT_CALLBACKS: Record<string, BuiltinElementCallback>;
@@ -878,17 +1860,96 @@ export declare const button: ElementFactory<Partial<{
878
1860
  title?: string | undefined;
879
1861
  content?: string | undefined;
880
1862
  disabled?: boolean | undefined;
1863
+ icon?: string | undefined;
881
1864
  subType?: "button" | "submit" | "reset" | undefined;
1865
+ iconPlacement?: IconPlacement | undefined;
882
1866
  contentPlacement?: "before" | "after" | undefined;
883
1867
  ariaExpanded?: boolean | undefined;
884
1868
  ariaPressed?: boolean | undefined;
885
1869
  }>>;
886
1870
 
887
- declare type CallbackName<D extends DeclaresInteractions> = keyof NonNullable<D['callbacks']> & string;
1871
+ declare type CallbackName<D extends DeclaresInteractions> = keyof NonNullable<D['callbacks']> & string;
1872
+
1873
+ export declare const cancelServerAction: (params: {
1874
+ runId: string;
1875
+ }) => StepSpec;
1876
+
1877
+ /**
1878
+ * A carousel's `items` may name the source its slides come from, as a list's may: `carousel({ id: 'hero', items:
1879
+ * 'site.data.slides', row: r => … })` writes the slide into a `carouselTrack`, and its `children` are the controls.
1880
+ */
1881
+ export declare const carousel: {
1882
+ (props?: ElementProps<Omit<Partial<{
1883
+ mode?: CarouselMode | undefined;
1884
+ label?: string | undefined;
1885
+ items?: unknown[] | undefined;
1886
+ speed?: number | undefined;
1887
+ loop?: boolean | undefined;
1888
+ autoplay?: number | undefined;
1889
+ pauseOnHover?: boolean | undefined;
1890
+ transition?: CarouselTransition | undefined;
1891
+ itemKey?: string | undefined;
1892
+ }>, "items"> & {
1893
+ items?: CarouselAttributes["items"] | SourceName;
1894
+ }> | undefined): ElementSpec;
1895
+ (children: ElementSpec[], props?: ElementProps<Omit<Partial<{
1896
+ mode?: CarouselMode | undefined;
1897
+ label?: string | undefined;
1898
+ items?: unknown[] | undefined;
1899
+ speed?: number | undefined;
1900
+ loop?: boolean | undefined;
1901
+ autoplay?: number | undefined;
1902
+ pauseOnHover?: boolean | undefined;
1903
+ transition?: CarouselTransition | undefined;
1904
+ itemKey?: string | undefined;
1905
+ }>, "items"> & {
1906
+ items?: CarouselAttributes["items"] | SourceName;
1907
+ }> | undefined): ElementSpec;
1908
+ };
1909
+
1910
+ declare type CarouselAttributes = AttributesOf<typeof elementDeclarations.Carousel>;
1911
+
1912
+ /**
1913
+ * The carousel `target` shows the slide at `index`, from 0 — a dot's own row: `carouselGoTo('hero', '{{ list_dots.index }}')`.
1914
+ */
1915
+ export declare const carouselGoTo: (target: string, index: number | string) => StepSpec;
1916
+
1917
+ declare type CarouselMode = 'slide' | 'marquee' | 'scroll';
1918
+
1919
+ /** The carousel `target` shows its next slide — round to the first after the last when it loops. */
1920
+ export declare const carouselNext: (target: string) => StepSpec;
1921
+
1922
+ /** The carousel `target` stops moving by itself until it is told to play. */
1923
+ export declare const carouselPause: (target: string) => StepSpec;
1924
+
1925
+ /** The carousel `target` moves on by itself again, every `autoplay` milliseconds. */
1926
+ export declare const carouselPlay: (target: string) => StepSpec;
1927
+
1928
+ /** The carousel `target` shows its previous slide; the slide enters from the left. */
1929
+ export declare const carouselPrevious: (target: string) => StepSpec;
1930
+
1931
+ export declare const carouselTrack: {
1932
+ (props?: AuthoringProps | undefined): ElementSpec;
1933
+ (children: ElementSpec[], props?: AuthoringProps | undefined): ElementSpec;
1934
+ };
1935
+
1936
+ declare type CarouselTransition = 'slide' | 'fade' | 'none';
1937
+
1938
+ /** The name and address the catalog template is written under — what a copy under another name replaces. */
1939
+ export declare const CATALOG_TEMPLATE_IDENTITY: {
1940
+ readonly name: "Catalog";
1941
+ readonly permanentUrl: "catalog";
1942
+ };
888
1943
 
889
- export declare const cancelServerAction: (params: {
890
- runId: string;
891
- }) => StepSpec;
1944
+ /**
1945
+ * The catalog template as a project's files, by path: a shop with a layout, a product card, a home, a filtered
1946
+ * catalog and a page per product, its data in `public/data/products.json` — a file per part, as a space bigger than
1947
+ * one screen is written. The files are the template's own (`templates/catalog`), the ones its test authors; they
1948
+ * import `@plitzi/sdk-authoring` by name already, so the copy is the file.
1949
+ */
1950
+ export declare const catalogTemplateFiles: ({ name }?: {
1951
+ name?: string;
1952
+ }) => Record<string, string>;
892
1953
 
893
1954
  export declare const channel: {
894
1955
  (props?: ElementProps<Partial<{
@@ -913,7 +1974,7 @@ export declare const channel: {
913
1974
  * A topic no pattern of the space matches is refused, by the server and at authoring: a page cannot open a channel
914
1975
  * nobody decided should exist.
915
1976
  */
916
- declare type ChannelDeclaration = {
1977
+ export declare type ChannelDeclaration = {
917
1978
  /** Who may subscribe and publish — the access vocabulary actions use. */
918
1979
  access: ActionAccess;
919
1980
  /**
@@ -936,7 +1997,7 @@ declare type ChannelDeclaration = {
936
1997
  messagesPerSecond?: number;
937
1998
  };
938
1999
 
939
- declare type ChannelDeclarations = Record<string, ChannelDeclaration>;
2000
+ export declare type ChannelDeclarations = Record<string, ChannelDeclaration>;
940
2001
 
941
2002
  /**
942
2003
  * The classes a selector wears: one, or several.
@@ -974,13 +2035,15 @@ export declare const closeDialog: (target: string) => StepSpec;
974
2035
  /** Closes a `modalContainer`, by id — from a button inside it or anywhere else. */
975
2036
  export declare const closeModal: (target: string) => StepSpec;
976
2037
 
2038
+ declare type Codes = typeof AUTHORING_CODES;
2039
+
977
2040
  /**
978
2041
  * The answer, once `system` has been put to the machine: what is actually on screen.
979
2042
  *
980
2043
  * Every consumer that paints something wants this one — a code editor, a chart, the dev-tools panel. `theme` is
981
2044
  * the CHOICE and can be `system`, which is not a colour and cannot be compared against one.
982
2045
  */
983
- declare type ColorScheme = Exclude<Theme, 'system'>;
2046
+ export declare type ColorScheme = Exclude<Theme, 'system'>;
984
2047
 
985
2048
  /**
986
2049
  * The three layouts every space writes over and over.
@@ -992,18 +2055,89 @@ export declare const column: (gap: string, extra?: CssProps) => StyleRules;
992
2055
 
993
2056
  declare type Combinator = 'and' | 'or';
994
2057
 
2058
+ /** Two pictures compared in a page the driver holds — any page will do, nothing of it is read. */
2059
+ export declare const comparePictures: (driver: PictureDriver, a: string, b: string, regions?: PictureRegion[], tolerance?: number) => Promise<PictureDiff>;
2060
+
995
2061
  /** Every observable way `actual` differs from `expected`. Empty means they render the same space. */
996
2062
  export declare const compareSpaces: (expected: SpaceDocuments, actual: SpaceDocuments) => SpaceDifference[];
997
2063
 
2064
+ /**
2065
+ * An instance of one of the space's components (`SpaceSpec.components`): the component's tree, rendered here with
2066
+ * these props.
2067
+ *
2068
+ * ```ts
2069
+ * component('product-card', { props: { title: 'Lamp' }, children: { 'product-card-actions': [button('Buy')] } })
2070
+ * ```
2071
+ *
2072
+ * Checked when the space is written: a component the space does not declare, a prop it does not declare, a required
2073
+ * one left out, a value of the wrong kind and a slot it does not have are each refused, by name.
2074
+ */
2075
+ export declare const component: (componentId: string, instance?: ComponentInstanceProps) => ElementSpec;
2076
+
2077
+ /** What an element inside a component can read besides its own tree: the globals, and what its instance hands in. */
2078
+ export declare const COMPONENT_SOURCES: string[];
2079
+
2080
+ /** How an instance is authored: what it hands in, what fills its slots, and the authoring fields any element takes. */
2081
+ export declare type ComponentInstanceProps = Pick<AuthoringProps, 'id' | 'class' | 'css' | 'states' | 'selector' | 'bind' | 'visible' | 'flows' | 'meta'> & {
2082
+ /** The props the component declares, by name. A prop is an attribute of the instance: `bind` can land on one too. */
2083
+ props?: Record<string, unknown>;
2084
+ /** What fills the slots: a list, for a component with one slot, or one list per slot it declares. */
2085
+ children?: ElementSpec[] | Record<string, ElementSpec[]>;
2086
+ };
2087
+
2088
+ /**
2089
+ * A prop a component declares, as the document stores it: the part of a `BuiltinParam` that survives JSON — no `when`
2090
+ * guard and no `builderType` worked out from other params, which are functions and only ever live in code.
2091
+ */
2092
+ export declare type ComponentProp = Pick<BuiltinParam, 'type' | 'description' | 'default' | 'options' | 'required' | 'label' | 'optionLabels' | 'elementType'>;
2093
+
2094
+ /**
2095
+ * A reusable subtree of the space: written once, placed anywhere with {@link component}, and published, versioned and
2096
+ * copied with the space because it is part of it.
2097
+ *
2098
+ * It is CLOSED. Inside, a binding or a template reads `props` — what each instance hands in, declared here — and the
2099
+ * globals, never the page an instance sits on: a component that read its surroundings would render differently
2100
+ * wherever it was placed, and could not be checked until it was. What it needs from there comes in as a prop.
2101
+ *
2102
+ * ```ts
2103
+ * components: [{
2104
+ * id: 'product-card',
2105
+ * props: { title: { type: 'text', description: 'The heading', required: true } },
2106
+ * slots: ['product-card-actions'],
2107
+ * root: container({ id: 'product-card-root', children: [
2108
+ * heading({ id: 'product-card-title', bind: { content: 'props.title' } }),
2109
+ * container({ id: 'product-card-actions' })
2110
+ * ] })
2111
+ * }]
2112
+ * ```
2113
+ */
2114
+ export declare interface ComponentSpec {
2115
+ /** The name an instance places it by. */
2116
+ id: string;
2117
+ /** What the builder shows. Defaults to the id. */
2118
+ label?: string;
2119
+ /** The page folder the builder files it under. It routes nothing: a component has no URL of its own. */
2120
+ folder?: string;
2121
+ /**
2122
+ * What an instance hands in, each as an attribute of the instance and read inside as `{{ props.<name> }}`. Declared
2123
+ * as a step's params are — a type, what it is for, a default, whether it is required — and checked the same way.
2124
+ */
2125
+ props?: Record<string, ComponentProp>;
2126
+ /** Elements of the tree an instance fills with its children, each child naming the one it goes in. */
2127
+ slots?: string[];
2128
+ /** The tree. Its root is what an instance renders, and ids inside it are names the whole space shares. */
2129
+ root: ElementSpec;
2130
+ }
2131
+
998
2132
  export declare const container: {
999
2133
  (props?: ElementProps<Partial<{
1000
2134
  label?: string | undefined;
1001
- subType?: "div" | "header" | "footer" | "nav" | "main" | "section" | "article" | "aside" | "address" | "figure" | "dl" | "dt" | "dd" | "li" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | undefined;
2135
+ subType?: "div" | "header" | "footer" | "nav" | "main" | "section" | "article" | "aside" | "address" | "figure" | "dl" | "dt" | "dd" | "li" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "span" | undefined;
1002
2136
  decorative?: boolean | undefined;
1003
2137
  }>> | undefined): ElementSpec;
1004
2138
  (children: ElementSpec[], props?: ElementProps<Partial<{
1005
2139
  label?: string | undefined;
1006
- subType?: "div" | "header" | "footer" | "nav" | "main" | "section" | "article" | "aside" | "address" | "figure" | "dl" | "dt" | "dd" | "li" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | undefined;
2140
+ subType?: "div" | "header" | "footer" | "nav" | "main" | "section" | "article" | "aside" | "address" | "figure" | "dl" | "dt" | "dd" | "li" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "span" | undefined;
1007
2141
  decorative?: boolean | undefined;
1008
2142
  }>> | undefined): ElementSpec;
1009
2143
  };
@@ -1012,7 +2146,27 @@ declare type ContentShorthand<A> = 'content' extends keyof A ? {
1012
2146
  (content: string, props?: ElementProps<A>): ElementSpec;
1013
2147
  } : unknown;
1014
2148
 
1015
- export declare const css: (rules: CssProps) => StyleRules;
2149
+ /**
2150
+ * A `tw()` with colours of its own: `createTw({ colors: tokens(variables) })` makes `bg-surface` the space's token.
2151
+ *
2152
+ * `tw('flex items-center gap-2 px-5 py-2 rounded-full bg-slate-950/90 hover:scale-105 md:text-sm')` is the rules those
2153
+ * classes mean, written out when the space is — nothing of Tailwind runs in the page. Tailwind's breakpoints become
2154
+ * Plitzi's (`md:` tablet and desktop, `lg:` desktop, `max-md:` mobile, `max-lg:` tablet and mobile), its states the
2155
+ * class's states, `group-hover/<class>:` how it looks inside an ancestor wearing that class. A class Tailwind does not
2156
+ * have, or one with no exact equivalent here (`sm:`, `dark:`, `space-x-4`), is refused with what to write instead.
2157
+ */
2158
+ export declare const createTw: ({ colors }?: TwOptions) => Tw;
2159
+
2160
+ export declare const css: (input: CssProps) => StyleRules;
2161
+
2162
+ /**
2163
+ * Plain rules as an author writes them: kebab-case or camelCase keys (`paddingTop`), a bare number for a length in
2164
+ * pixels (`gap: 16`), and a property that changes on another breakpoint given a value per breakpoint in place.
2165
+ */
2166
+ export declare type CssInput = Record<string, StyleValue | ResponsiveValue>;
2167
+
2168
+ /** A number written as a value, as CSS reads it: itself where a bare number is a whole value, pixels otherwise. */
2169
+ export declare const cssNumberValue: (property: string, value: number) => string | number;
1016
2170
 
1017
2171
  /** The patch flavour of {@link CssProps}: `null` clears every longhand the key controls. */
1018
2172
  export declare type CssPatch = Record<string, StyleValue | null>;
@@ -1021,6 +2175,13 @@ export declare type CssPatch = Record<string, StyleValue | null>;
1021
2175
  * exact keys — camelCase or unknown keys are rejected. */
1022
2176
  export declare const cssProperties: string[];
1023
2177
 
2178
+ /**
2179
+ * A property as an author may write it, in the spelling the document keeps: kebab-case already, or camelCase the way a
2180
+ * React style object writes it — `paddingTop` is `padding-top`, `WebkitLineClamp` is `-webkit-line-clamp`. A custom
2181
+ * property (`--brand`) is the author's own spelling and is kept.
2182
+ */
2183
+ export declare const cssPropertyName: (key: string) => string;
2184
+
1024
2185
  /**
1025
2186
  * The two shapes CSS has while a space is being authored.
1026
2187
  *
@@ -1043,7 +2204,7 @@ export declare const cssShorthands: string[];
1043
2204
  * properties and never will be, so a rule set that mentions one is per-breakpoint and one that does not is the
1044
2205
  * desktop rules.
1045
2206
  */
1046
- export declare type CssSpec = CssProps | ResponsiveCss;
2207
+ export declare type CssSpec = CssInput | ResponsiveCss;
1047
2208
 
1048
2209
  export declare const custom: ElementFactory<CustomAttributes>;
1049
2210
 
@@ -1064,6 +2225,24 @@ declare type CustomProps = {
1064
2225
  scriptUrl?: string;
1065
2226
  };
1066
2227
 
2228
+ /**
2229
+ * Moves a number in state round a cycle of `length` — the slide after the last is the first, the one before the first
2230
+ * the last: `cycleState({ key: 'slide', length: 3 })` is "next", `by: -1` "previous". `length` is a number, or an
2231
+ * expression for one (`'apiContainer_site.data.slides|length'`). The same `setState` written out, without the
2232
+ * arithmetic in a template.
2233
+ */
2234
+ export declare const cycleState: (params: {
2235
+ key: string;
2236
+ length: StepNumber;
2237
+ by?: StepNumber;
2238
+ }) => StepSpec;
2239
+
2240
+ /**
2241
+ * What the dark scheme changes, from a probe of it that read the light probe's colour samples again — or nothing,
2242
+ * when the page looks the same in both and has no dark scheme of its own.
2243
+ */
2244
+ export declare const darkScheme: (light: ImportProbe, dark: ImportProbe) => ImportedDark | undefined;
2245
+
1067
2246
  declare type DeclarationByType = {
1068
2247
  [Name in keyof typeof elementDeclarations as (typeof elementDeclarations)[Name]['type']]: (typeof elementDeclarations)[Name];
1069
2248
  };
@@ -1120,6 +2299,50 @@ export declare const defineElement: <A = Record<string, unknown>>(declaration: E
1120
2299
  /** Milliseconds. The param is `time` — not `delay`, `duration` or `ms`, any of which waits zero. */
1121
2300
  export declare const delay: (time: number) => StepSpec;
1122
2301
 
2302
+ /** Anything that can run a function in a browser page — Playwright's `Page`, Puppeteer's. */
2303
+ export declare interface DevToolsDriver {
2304
+ evaluate<R, A>(fn: (input: A) => R | Promise<R>, input: A): Promise<R>;
2305
+ }
2306
+
2307
+ /** A flow that ran: what fired it, on what, how it ended, and its steps. */
2308
+ export declare interface DevToolsFlow {
2309
+ at: string;
2310
+ trigger: string;
2311
+ on?: string;
2312
+ status: string;
2313
+ ms: number;
2314
+ steps: DevToolsFlowStep[];
2315
+ }
2316
+
2317
+ /**
2318
+ * What the page's dev tools know, read from the page in text: the flows that ran — the failed ones above all — the
2319
+ * state, the sources and one element. The dev tools publish it on `window.__plitzi` while they are on (debug mode,
2320
+ * any development server); a page without them answers nothing, and says so.
2321
+ */
2322
+ /** One step of a flow that ran, as the dev tools tell it. */
2323
+ export declare interface DevToolsFlowStep {
2324
+ title: string;
2325
+ action: string;
2326
+ status: string;
2327
+ ms: number;
2328
+ error?: string;
2329
+ }
2330
+
2331
+ export declare interface DevToolsInput {
2332
+ state: boolean;
2333
+ element?: string;
2334
+ }
2335
+
2336
+ export declare interface DevToolsReport {
2337
+ /** Whether the page had its dev tools on — without them there is nothing to read. */
2338
+ available: boolean;
2339
+ flows: DevToolsFlow[];
2340
+ state?: unknown;
2341
+ /** Every source by its full name, with the shape of what it holds now. */
2342
+ sources?: Record<string, unknown>;
2343
+ element?: unknown;
2344
+ }
2345
+
1123
2346
  export declare const dialogContainer: {
1124
2347
  (props?: ElementProps<Partial<{
1125
2348
  headerLabel: string;
@@ -1137,6 +2360,9 @@ export declare const dialogContainer: {
1137
2360
  }>> | undefined): ElementSpec;
1138
2361
  };
1139
2362
 
2363
+ /** Runs in the page: both pictures decoded on canvases, compared pixel by pixel. Self-contained — it is serialised. */
2364
+ export declare const diffPictures: ({ a, b, regions, tolerance }: PictureDiffInput) => Promise<PictureDiff>;
2365
+
1140
2366
  /**
1141
2367
  * Deterministic hex digest, in plain TypeScript. What names a style selector — never an element, a page or a step:
1142
2368
  * those answer to names a person reads.
@@ -1148,7 +2374,7 @@ export declare const dialogContainer: {
1148
2374
  */
1149
2375
  export declare const digest: (value: string, length: number) => string;
1150
2376
 
1151
- declare type DisplayMode = 'desktop' | 'tablet' | 'mobile';
2377
+ export declare type DisplayMode = 'desktop' | 'tablet' | 'mobile';
1152
2378
 
1153
2379
  /** Checks that need no space: what any rendered page owes, whoever wrote it. */
1154
2380
  export declare type DocumentChecks = Pick<InspectOptions, 'skip' | 'timeout'>;
@@ -1205,6 +2431,7 @@ declare type Element_2<TAttributes extends Record<string, unknown> = Record<stri
1205
2431
  };
1206
2432
  definition: ElementDefinition;
1207
2433
  };
2434
+ export { Element_2 as Element }
1208
2435
 
1209
2436
  /**
1210
2437
  * Every field of an element spec, in the order the emitter writes them.
@@ -1213,7 +2440,7 @@ declare type Element_2<TAttributes extends Record<string, unknown> = Record<stri
1213
2440
  * export drops without a word. `specFields.test.ts` refuses to compile until it is listed here — and once it is, it is
1214
2441
  * written like any other, so growing the authoring surface needs nothing more from the emitter than this line.
1215
2442
  */
1216
- export declare const ELEMENT_FIELDS: readonly ["type", "id", "attributes", "class", "css", "states", "selector", "variant", "slots", "bind", "visible", "flows", "runtime", "loadStrategy", "meta", "children"];
2443
+ export declare const ELEMENT_FIELDS: readonly ["type", "id", "attributes", "class", "css", "states", "selector", "variant", "slots", "bind", "from", "as", "row", "visible", "flows", "runtime", "loadStrategy", "anchor", "flag", "meta", "children"];
1217
2444
 
1218
2445
  /** The sub-elements that only work inside another type, and that type — see `ElementDeclarationData.ancestorType`. */
1219
2446
  export declare const elementAncestorTypes: Record<string, string>;
@@ -1225,24 +2452,27 @@ export declare const elementAncestorTypes: Record<string, string>;
1225
2452
  * a builder that has since moved on, and nothing renders it.
1226
2453
  */
1227
2454
  export declare const elementAttributeNames: {
1228
- readonly apiContainer: readonly ["accessToken", "action", "cache", "connector", "credentials", "endpoint", "filters", "gcTime", "headers", "input", "limit", "method", "mockData", "pageParam", "pagination", "query", "refreshSeconds", "renderWhileLoading", "resource", "singleRecord", "staleTime", "subType", "when"];
2455
+ readonly apiContainer: readonly ["accessToken", "action", "cache", "connector", "credentials", "endpoint", "filters", "gcTime", "headers", "input", "limit", "loadingSlot", "method", "mockData", "pageParam", "pagination", "query", "refreshSeconds", "renderWhileLoading", "resource", "singleRecord", "staleTime", "subType", "when"];
1229
2456
  readonly blockHtml: readonly ["content"];
1230
2457
  readonly blockJsx: readonly ["allowEmptyRender", "content", "contentCache", "props"];
1231
- readonly button: readonly ["ariaExpanded", "ariaPressed", "content", "contentPlacement", "disabled", "label", "subType", "title"];
2458
+ readonly button: readonly ["ariaExpanded", "ariaPressed", "content", "contentPlacement", "disabled", "icon", "iconPlacement", "label", "subType", "title"];
2459
+ readonly carousel: readonly ["autoplay", "itemKey", "items", "label", "loop", "mode", "pauseOnHover", "speed", "transition"];
2460
+ readonly carouselTrack: readonly [];
1232
2461
  readonly channel: readonly ["grant", "keep", "presence", "subType", "topic"];
1233
2462
  readonly container: readonly ["decorative", "label", "subType"];
1234
2463
  readonly custom: null;
1235
2464
  readonly dialogContainer: readonly ["acceptButtonLabel", "acceptButtonLabelLoading", "autoHideAfterClick", "headerLabel", "rejectButtonLabel"];
1236
2465
  readonly dropdown: readonly ["backgroundDisabled", "closeOnClickBackground", "closeOnClickPopup", "containerLeftOffset", "containerTopOffset", "disabled", "openPopup", "popupPlacement"];
1237
2466
  readonly dropdownPopup: readonly [];
2467
+ readonly embed: readonly ["allow", "loading", "referrerPolicy", "sandbox", "src", "title"];
1238
2468
  readonly fontAwesome: readonly ["icon", "iconAnimation", "label", "size"];
1239
2469
  readonly form: readonly ["actionUrl", "errors", "managedByInteractions", "method", "noValidate", "values"];
1240
2470
  readonly formControl: readonly ["autoComplete", "autoFocus", "defaultValue", "disabled", "formatMessage", "hideLabel", "label", "matches", "matchesMessage", "maxLength", "maxLengthMessage", "minLength", "minLengthMessage", "name", "options", "pattern", "patternMessage", "placeholder", "previewError", "readOnly", "required", "requiredMessage", "subType"];
1241
2471
  readonly heading: readonly ["content", "subType"];
1242
- readonly image: readonly ["alt", "decorative", "fetchPriority", "loadMode", "src"];
2472
+ readonly image: readonly ["alt", "decorative", "fetchPriority", "height", "loadMode", "sizes", "src", "width"];
1243
2473
  readonly layoutContainer: readonly ["layout", "layoutContainer", "subType"];
1244
- readonly link: readonly ["href", "label", "mode", "target"];
1245
- readonly list: readonly ["items", "source", "subType"];
2474
+ readonly link: readonly ["content", "contentPlacement", "hash", "href", "icon", "iconPlacement", "label", "mode", "target"];
2475
+ readonly list: readonly ["itemKey", "items", "source", "subType"];
1246
2476
  readonly listItem: readonly [];
1247
2477
  readonly loading: readonly [];
1248
2478
  readonly markdown: readonly ["content"];
@@ -1252,8 +2482,9 @@ export declare const elementAttributeNames: {
1252
2482
  readonly page: readonly ["layout", "layoutContainer", "seoEnabled", "seoPageDescription", "seoPageTitle"];
1253
2483
  readonly pagination: readonly ["label", "loadMoreLabel", "mode", "nextLabel", "pageInfo", "pageParam", "previousLabel", "target", "windowSize"];
1254
2484
  readonly paragraph: readonly ["content"];
1255
- readonly reference: readonly ["referenceContainer", "referenceId", "referenceType"];
2485
+ readonly reference: readonly ["referenceId", "referenceType"];
1256
2486
  readonly richText: readonly ["content", "format", "mediaBaseUrl"];
2487
+ readonly svg: readonly ["content", "label"];
1257
2488
  readonly tabContainer: readonly [];
1258
2489
  readonly tabContainerBody: readonly [];
1259
2490
  readonly tabContainerHeader: readonly [];
@@ -1283,7 +2514,7 @@ export declare interface ElementAttributesBrand<A> {
1283
2514
  /** The values each built-in type's enumerated attributes take — a heading's `subType`, a link's `mode`. */
1284
2515
  export declare const elementAttributeValues: Record<string, Record<string, readonly string[]>>;
1285
2516
 
1286
- declare type ElementBinding = {
2517
+ export declare type ElementBinding = {
1287
2518
  id: string;
1288
2519
  source: string;
1289
2520
  transformers?: BindingTransformer[];
@@ -1304,6 +2535,15 @@ export declare const elementCallbacks: Record<string, string[]>;
1304
2535
  /** Keyed by the schema `type`, which is what a document and every catalog address a type by. */
1305
2536
  export declare const elementCatalog: Record<string, ElementSemantics>;
1306
2537
 
2538
+ /**
2539
+ * An element's classes, and at most one set of rules of its own on top of them — `class: [cover, { opacity: '0.25' }]`.
2540
+ *
2541
+ * "This class, plus one thing" is the commonest shape there is. The rules become a class named after the element,
2542
+ * `<id>--own`, declared after every shared one so it wins over them; it is still one class, visible and editable in the
2543
+ * builder, and the element still has one base selector. Needs the element's `id`, which names it.
2544
+ */
2545
+ export declare type ElementClassList = ClassList | readonly (ClassRef | StyleSpec)[];
2546
+
1307
2547
  export declare const elementDeclaration: <A>() => <const D extends ElementDeclarationData>(declaration: D) => D & ElementAttributesBrand<A>;
1308
2548
 
1309
2549
  /** What every declaration is, whatever else it carries. */
@@ -1490,7 +2730,7 @@ declare const elementDeclarations: {
1490
2730
  readonly canSelect: true;
1491
2731
  readonly canDragDrop: true;
1492
2732
  readonly canMove: true;
1493
- readonly canTemplate: true;
2733
+ readonly canSnippet: true;
1494
2734
  readonly itemsAllowed: readonly [];
1495
2735
  readonly itemsNotAllowed: readonly [];
1496
2736
  };
@@ -1539,7 +2779,7 @@ declare const elementDeclarations: {
1539
2779
  readonly canSelect: true;
1540
2780
  readonly canDragDrop: true;
1541
2781
  readonly canMove: true;
1542
- readonly canTemplate: true;
2782
+ readonly canSnippet: true;
1543
2783
  readonly itemsAllowed: readonly [];
1544
2784
  readonly itemsNotAllowed: readonly [];
1545
2785
  };
@@ -1592,7 +2832,7 @@ declare const elementDeclarations: {
1592
2832
  readonly canSelect: true;
1593
2833
  readonly canDragDrop: true;
1594
2834
  readonly canMove: true;
1595
- readonly canTemplate: true;
2835
+ readonly canSnippet: true;
1596
2836
  readonly itemsAllowed: readonly [];
1597
2837
  readonly itemsNotAllowed: readonly [];
1598
2838
  };
@@ -1622,11 +2862,14 @@ declare const elementDeclarations: {
1622
2862
  readonly attributeValues: {
1623
2863
  readonly subType: readonly string[];
1624
2864
  readonly contentPlacement: readonly string[];
2865
+ readonly iconPlacement: readonly string[];
1625
2866
  };
1626
2867
  readonly content: {
1627
2868
  readonly attributes: {
1628
2869
  readonly contentPlacement: "after";
1629
2870
  readonly content: "Button";
2871
+ readonly icon: "";
2872
+ readonly iconPlacement: "before";
1630
2873
  readonly subType: "button";
1631
2874
  readonly disabled: false;
1632
2875
  };
@@ -1638,6 +2881,7 @@ declare const elementDeclarations: {
1638
2881
  readonly bindings: {};
1639
2882
  readonly styleSelectors: {
1640
2883
  readonly base: "";
2884
+ readonly icon: "";
1641
2885
  };
1642
2886
  readonly initialState: {
1643
2887
  readonly visibility: true;
@@ -1648,7 +2892,7 @@ declare const elementDeclarations: {
1648
2892
  readonly canSelect: true;
1649
2893
  readonly canDragDrop: true;
1650
2894
  readonly canMove: true;
1651
- readonly canTemplate: true;
2895
+ readonly canSnippet: true;
1652
2896
  readonly itemsAllowed: readonly [];
1653
2897
  readonly itemsNotAllowed: readonly [];
1654
2898
  };
@@ -1742,11 +2986,187 @@ declare const elementDeclarations: {
1742
2986
  title?: string | undefined;
1743
2987
  content?: string | undefined;
1744
2988
  disabled?: boolean | undefined;
2989
+ icon?: string | undefined;
1745
2990
  subType?: "button" | "submit" | "reset" | undefined;
2991
+ iconPlacement?: IconPlacement | undefined;
1746
2992
  contentPlacement?: "before" | "after" | undefined;
1747
2993
  ariaExpanded?: boolean | undefined;
1748
2994
  ariaPressed?: boolean | undefined;
1749
2995
  }>>;
2996
+ readonly Carousel: {
2997
+ readonly type: "carousel";
2998
+ readonly sourceType: "carousel";
2999
+ readonly triggers: {
3000
+ readonly onChange: {
3001
+ readonly action: "onChange";
3002
+ readonly title: "On Slide Change";
3003
+ readonly type: "trigger";
3004
+ readonly params: {};
3005
+ readonly preview: {
3006
+ readonly index: "0";
3007
+ readonly item: {};
3008
+ };
3009
+ };
3010
+ };
3011
+ readonly callbacks: {
3012
+ readonly next: {
3013
+ readonly action: "next";
3014
+ readonly title: "Next Slide";
3015
+ readonly type: "callback";
3016
+ readonly params: {};
3017
+ readonly preview: {};
3018
+ };
3019
+ readonly previous: {
3020
+ readonly action: "previous";
3021
+ readonly title: "Previous Slide";
3022
+ readonly type: "callback";
3023
+ readonly params: {};
3024
+ readonly preview: {};
3025
+ };
3026
+ readonly goTo: {
3027
+ readonly action: "goTo";
3028
+ readonly title: "Go To Slide";
3029
+ readonly type: "callback";
3030
+ readonly params: {
3031
+ readonly index: {
3032
+ readonly type: "text";
3033
+ readonly label: "Index (from 0)";
3034
+ readonly defaultValue: "0";
3035
+ readonly canBind: true;
3036
+ };
3037
+ };
3038
+ readonly preview: {};
3039
+ };
3040
+ readonly play: {
3041
+ readonly action: "play";
3042
+ readonly title: "Play";
3043
+ readonly type: "callback";
3044
+ readonly params: {};
3045
+ readonly preview: {};
3046
+ };
3047
+ readonly pause: {
3048
+ readonly action: "pause";
3049
+ readonly title: "Pause";
3050
+ readonly type: "callback";
3051
+ readonly params: {};
3052
+ readonly preview: {};
3053
+ };
3054
+ };
3055
+ readonly content: {
3056
+ readonly attributes: {
3057
+ readonly items: readonly [];
3058
+ readonly mode: "slide";
3059
+ readonly autoplay: 0;
3060
+ readonly pauseOnHover: true;
3061
+ readonly loop: true;
3062
+ readonly transition: "slide";
3063
+ readonly speed: 30;
3064
+ readonly label: "";
3065
+ };
3066
+ readonly definition: {
3067
+ readonly label: "Carousel";
3068
+ readonly type: "carousel";
3069
+ readonly description: "Items shown one at a time, scrolled past as a marquee, or swiped as a row — with controls of its own inside.";
3070
+ readonly items: readonly [];
3071
+ readonly bindings: {};
3072
+ readonly styleSelectors: {
3073
+ readonly base: "";
3074
+ };
3075
+ readonly initialState: {
3076
+ readonly visibility: true;
3077
+ };
3078
+ };
3079
+ readonly builder: {
3080
+ readonly canDelete: true;
3081
+ readonly canSelect: true;
3082
+ readonly canDragDrop: true;
3083
+ readonly canMove: true;
3084
+ readonly canSnippet: true;
3085
+ readonly itemsAllowed: readonly [];
3086
+ readonly itemsNotAllowed: readonly [];
3087
+ };
3088
+ readonly market: {
3089
+ readonly category: "structure";
3090
+ readonly owner: "Plitzi";
3091
+ readonly verified: true;
3092
+ readonly license: "MIT";
3093
+ readonly website: "https://plitzi.com";
3094
+ readonly backgroundColor: "#4422ee";
3095
+ readonly icon: "fa-solid fa-images";
3096
+ };
3097
+ readonly defaultStyle: {
3098
+ readonly name: "Carousel";
3099
+ readonly displayMode: "desktop";
3100
+ readonly style: {
3101
+ readonly base: {
3102
+ readonly default: {
3103
+ readonly position: "relative";
3104
+ };
3105
+ };
3106
+ };
3107
+ };
3108
+ readonly settings: {};
3109
+ };
3110
+ readonly initialItems: readonly ["carouselTrack"];
3111
+ } & ElementAttributesBrand<Partial<{
3112
+ mode?: CarouselMode | undefined;
3113
+ label?: string | undefined;
3114
+ items?: unknown[] | undefined;
3115
+ speed?: number | undefined;
3116
+ loop?: boolean | undefined;
3117
+ autoplay?: number | undefined;
3118
+ pauseOnHover?: boolean | undefined;
3119
+ transition?: CarouselTransition | undefined;
3120
+ itemKey?: string | undefined;
3121
+ }>>;
3122
+ readonly CarouselTrack: {
3123
+ readonly type: "carouselTrack";
3124
+ readonly ancestorType: "carousel";
3125
+ readonly content: {
3126
+ readonly attributes: {};
3127
+ readonly definition: {
3128
+ readonly label: "Carousel Track";
3129
+ readonly type: "carouselTrack";
3130
+ readonly description: "Where a carousel shows its slides: what is inside is one slide, rendered once per item.";
3131
+ readonly items: readonly [];
3132
+ readonly bindings: {};
3133
+ readonly styleSelectors: {
3134
+ readonly base: "";
3135
+ };
3136
+ readonly initialState: {
3137
+ readonly visibility: true;
3138
+ };
3139
+ };
3140
+ readonly builder: {
3141
+ readonly canDelete: true;
3142
+ readonly canSelect: true;
3143
+ readonly canDragDrop: true;
3144
+ readonly canMove: true;
3145
+ readonly canSnippet: false;
3146
+ readonly itemsAllowed: readonly [];
3147
+ readonly itemsNotAllowed: readonly [];
3148
+ };
3149
+ readonly market: {
3150
+ readonly category: "structure";
3151
+ readonly owner: "Plitzi";
3152
+ readonly verified: true;
3153
+ readonly license: "MIT";
3154
+ readonly website: "https://plitzi.com";
3155
+ readonly backgroundColor: "#4422ee";
3156
+ readonly icon: "fa-solid fa-film";
3157
+ };
3158
+ readonly defaultStyle: {
3159
+ readonly name: "Carousel Track";
3160
+ readonly displayMode: "desktop";
3161
+ readonly style: {
3162
+ readonly base: {
3163
+ readonly default: {};
3164
+ };
3165
+ };
3166
+ };
3167
+ readonly settings: {};
3168
+ };
3169
+ } & ElementAttributesBrand<unknown>;
1750
3170
  readonly Channel: {
1751
3171
  readonly type: "channel";
1752
3172
  readonly attributeValues: {
@@ -1848,7 +3268,7 @@ declare const elementDeclarations: {
1848
3268
  readonly canSelect: true;
1849
3269
  readonly canDragDrop: true;
1850
3270
  readonly canMove: true;
1851
- readonly canTemplate: true;
3271
+ readonly canSnippet: true;
1852
3272
  readonly itemsAllowed: readonly [];
1853
3273
  readonly itemsNotAllowed: readonly [];
1854
3274
  };
@@ -1907,7 +3327,7 @@ declare const elementDeclarations: {
1907
3327
  readonly canSelect: true;
1908
3328
  readonly canDragDrop: true;
1909
3329
  readonly canMove: true;
1910
- readonly canTemplate: true;
3330
+ readonly canSnippet: true;
1911
3331
  readonly itemsAllowed: readonly [];
1912
3332
  readonly itemsNotAllowed: readonly [];
1913
3333
  };
@@ -1934,7 +3354,7 @@ declare const elementDeclarations: {
1934
3354
  };
1935
3355
  } & ElementAttributesBrand<Partial<{
1936
3356
  label?: string | undefined;
1937
- subType?: "div" | "header" | "footer" | "nav" | "main" | "section" | "article" | "aside" | "address" | "figure" | "dl" | "dt" | "dd" | "li" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | undefined;
3357
+ subType?: "div" | "header" | "footer" | "nav" | "main" | "section" | "article" | "aside" | "address" | "figure" | "dl" | "dt" | "dd" | "li" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "span" | undefined;
1938
3358
  decorative?: boolean | undefined;
1939
3359
  }>>;
1940
3360
  readonly Custom: {
@@ -1964,7 +3384,7 @@ declare const elementDeclarations: {
1964
3384
  readonly canSelect: true;
1965
3385
  readonly canDragDrop: true;
1966
3386
  readonly canMove: true;
1967
- readonly canTemplate: true;
3387
+ readonly canSnippet: true;
1968
3388
  readonly itemsAllowed: readonly [];
1969
3389
  readonly itemsNotAllowed: readonly [];
1970
3390
  };
@@ -2108,7 +3528,7 @@ declare const elementDeclarations: {
2108
3528
  readonly canSelect: true;
2109
3529
  readonly canDragDrop: true;
2110
3530
  readonly canMove: true;
2111
- readonly canTemplate: true;
3531
+ readonly canSnippet: true;
2112
3532
  readonly itemsAllowed: readonly [];
2113
3533
  readonly itemsNotAllowed: readonly [];
2114
3534
  };
@@ -2255,7 +3675,7 @@ declare const elementDeclarations: {
2255
3675
  readonly canSelect: true;
2256
3676
  readonly canDragDrop: true;
2257
3677
  readonly canMove: true;
2258
- readonly canTemplate: true;
3678
+ readonly canSnippet: true;
2259
3679
  readonly itemsAllowed: readonly [];
2260
3680
  readonly itemsNotAllowed: readonly [];
2261
3681
  };
@@ -2325,7 +3745,7 @@ declare const elementDeclarations: {
2325
3745
  readonly canSelect: true;
2326
3746
  readonly canDragDrop: false;
2327
3747
  readonly canMove: false;
2328
- readonly canTemplate: false;
3748
+ readonly canSnippet: false;
2329
3749
  readonly itemsAllowed: readonly [];
2330
3750
  readonly itemsNotAllowed: readonly [];
2331
3751
  };
@@ -2367,6 +3787,71 @@ declare const elementDeclarations: {
2367
3787
  };
2368
3788
  readonly initialItems: readonly [];
2369
3789
  } & ElementAttributesBrand<unknown>;
3790
+ readonly Embed: {
3791
+ readonly type: "embed";
3792
+ readonly content: {
3793
+ readonly attributes: {
3794
+ readonly src: "";
3795
+ readonly title: "";
3796
+ readonly loading: "lazy";
3797
+ };
3798
+ readonly definition: {
3799
+ readonly label: "Embed";
3800
+ readonly type: "embed";
3801
+ readonly description: "Another page inside this one — a map, a video player, a form — in a frame.";
3802
+ readonly bindings: {};
3803
+ readonly styleSelectors: {
3804
+ readonly base: "";
3805
+ };
3806
+ readonly initialState: {
3807
+ readonly visibility: true;
3808
+ };
3809
+ };
3810
+ readonly builder: {
3811
+ readonly canDelete: true;
3812
+ readonly canSelect: true;
3813
+ readonly canDragDrop: true;
3814
+ readonly canMove: true;
3815
+ readonly canSnippet: true;
3816
+ readonly itemsAllowed: readonly [];
3817
+ readonly itemsNotAllowed: readonly [];
3818
+ };
3819
+ readonly market: {
3820
+ readonly category: "media";
3821
+ readonly owner: "Plitzi";
3822
+ readonly verified: true;
3823
+ readonly license: "MIT";
3824
+ readonly website: "https://plitzi.com";
3825
+ readonly backgroundColor: "#4422ee";
3826
+ readonly icon: "fa-solid fa-window-maximize";
3827
+ };
3828
+ readonly defaultStyle: {
3829
+ readonly name: "Embed";
3830
+ readonly displayMode: "desktop";
3831
+ readonly style: {
3832
+ readonly base: {
3833
+ readonly default: {
3834
+ readonly display: "block";
3835
+ readonly width: "100%";
3836
+ readonly 'aspect-ratio': "16 / 9";
3837
+ readonly 'border-top-width': "0px";
3838
+ readonly 'border-right-width': "0px";
3839
+ readonly 'border-bottom-width': "0px";
3840
+ readonly 'border-left-width': "0px";
3841
+ };
3842
+ };
3843
+ };
3844
+ };
3845
+ readonly settings: {};
3846
+ };
3847
+ } & ElementAttributesBrand<Partial<{
3848
+ title?: string | undefined;
3849
+ referrerPolicy?: "no-referrer" | "origin" | "strict-origin-when-cross-origin" | "no-referrer-when-downgrade" | undefined;
3850
+ src?: string | undefined;
3851
+ allow?: string | undefined;
3852
+ loading?: "lazy" | "eager" | undefined;
3853
+ sandbox?: string | undefined;
3854
+ }>>;
2370
3855
  readonly FontAwesome: {
2371
3856
  readonly type: "fontAwesome";
2372
3857
  readonly content: {
@@ -2392,7 +3877,7 @@ declare const elementDeclarations: {
2392
3877
  readonly canSelect: true;
2393
3878
  readonly canDragDrop: true;
2394
3879
  readonly canMove: true;
2395
- readonly canTemplate: true;
3880
+ readonly canSnippet: true;
2396
3881
  readonly itemsAllowed: readonly [];
2397
3882
  readonly itemsNotAllowed: readonly [];
2398
3883
  };
@@ -2515,7 +4000,7 @@ declare const elementDeclarations: {
2515
4000
  readonly canSelect: true;
2516
4001
  readonly canDragDrop: true;
2517
4002
  readonly canMove: true;
2518
- readonly canTemplate: true;
4003
+ readonly canSnippet: true;
2519
4004
  readonly itemsAllowed: readonly [];
2520
4005
  readonly itemsNotAllowed: readonly [];
2521
4006
  };
@@ -2608,7 +4093,7 @@ declare const elementDeclarations: {
2608
4093
  readonly canSelect: true;
2609
4094
  readonly canDragDrop: true;
2610
4095
  readonly canMove: true;
2611
- readonly canTemplate: false;
4096
+ readonly canSnippet: false;
2612
4097
  readonly itemsAllowed: readonly [];
2613
4098
  readonly itemsNotAllowed: readonly [];
2614
4099
  };
@@ -3084,7 +4569,7 @@ declare const elementDeclarations: {
3084
4569
  readonly canSelect: true;
3085
4570
  readonly canDragDrop: true;
3086
4571
  readonly canMove: true;
3087
- readonly canTemplate: true;
4572
+ readonly canSnippet: true;
3088
4573
  readonly itemsAllowed: readonly [];
3089
4574
  readonly itemsNotAllowed: readonly [];
3090
4575
  };
@@ -3235,7 +4720,7 @@ declare const elementDeclarations: {
3235
4720
  readonly canSelect: true;
3236
4721
  readonly canDragDrop: true;
3237
4722
  readonly canMove: true;
3238
- readonly canTemplate: true;
4723
+ readonly canSnippet: true;
3239
4724
  readonly itemsAllowed: readonly [];
3240
4725
  readonly itemsNotAllowed: readonly [];
3241
4726
  };
@@ -3264,7 +4749,10 @@ declare const elementDeclarations: {
3264
4749
  readonly settings: {};
3265
4750
  };
3266
4751
  } & ElementAttributesBrand<Partial<{
4752
+ height?: number | undefined;
4753
+ width?: number | undefined;
3267
4754
  fetchPriority?: "high" | "low" | "auto" | undefined;
4755
+ sizes?: string | undefined;
3268
4756
  src?: string | undefined;
3269
4757
  alt?: string | undefined;
3270
4758
  decorative?: boolean | undefined;
@@ -3297,7 +4785,7 @@ declare const elementDeclarations: {
3297
4785
  readonly canSelect: true;
3298
4786
  readonly canDragDrop: false;
3299
4787
  readonly canMove: true;
3300
- readonly canTemplate: true;
4788
+ readonly canSnippet: true;
3301
4789
  readonly itemsAllowed: readonly [];
3302
4790
  readonly itemsNotAllowed: readonly [];
3303
4791
  };
@@ -3332,13 +4820,20 @@ declare const elementDeclarations: {
3332
4820
  readonly attributeValues: {
3333
4821
  readonly mode: readonly string[];
3334
4822
  readonly target: readonly string[];
4823
+ readonly contentPlacement: readonly string[];
4824
+ readonly iconPlacement: readonly string[];
3335
4825
  };
3336
4826
  readonly content: {
3337
4827
  readonly attributes: {
3338
4828
  readonly href: "#";
3339
4829
  readonly target: "self";
3340
4830
  readonly mode: "page";
4831
+ readonly hash: "";
3341
4832
  readonly label: "";
4833
+ readonly content: "";
4834
+ readonly contentPlacement: "after";
4835
+ readonly icon: "";
4836
+ readonly iconPlacement: "before";
3342
4837
  };
3343
4838
  readonly definition: {
3344
4839
  readonly label: "Link";
@@ -3348,6 +4843,7 @@ declare const elementDeclarations: {
3348
4843
  readonly bindings: {};
3349
4844
  readonly styleSelectors: {
3350
4845
  readonly base: "";
4846
+ readonly icon: "";
3351
4847
  };
3352
4848
  readonly initialState: {
3353
4849
  readonly visibility: true;
@@ -3358,7 +4854,7 @@ declare const elementDeclarations: {
3358
4854
  readonly canSelect: true;
3359
4855
  readonly canDragDrop: true;
3360
4856
  readonly canMove: true;
3361
- readonly canTemplate: true;
4857
+ readonly canSnippet: true;
3362
4858
  readonly itemsAllowed: readonly [];
3363
4859
  readonly itemsNotAllowed: readonly ["link"];
3364
4860
  };
@@ -3391,6 +4887,11 @@ declare const elementDeclarations: {
3391
4887
  href?: string | undefined;
3392
4888
  label?: string | undefined;
3393
4889
  target?: "self" | "blank" | "parent" | "top" | undefined;
4890
+ content?: string | undefined;
4891
+ icon?: string | undefined;
4892
+ iconPlacement?: IconPlacement | undefined;
4893
+ contentPlacement?: "before" | "after" | undefined;
4894
+ hash?: string | undefined;
3394
4895
  }>>;
3395
4896
  readonly List: {
3396
4897
  readonly type: "list";
@@ -3423,7 +4924,7 @@ declare const elementDeclarations: {
3423
4924
  readonly canSelect: true;
3424
4925
  readonly canDragDrop: true;
3425
4926
  readonly canMove: true;
3426
- readonly canTemplate: true;
4927
+ readonly canSnippet: true;
3427
4928
  readonly itemsAllowed: readonly [];
3428
4929
  readonly itemsNotAllowed: readonly [];
3429
4930
  };
@@ -3480,6 +4981,7 @@ declare const elementDeclarations: {
3480
4981
  source?: "none" | "controlled" | undefined;
3481
4982
  items?: unknown[] | undefined;
3482
4983
  subType?: "ul" | "ol" | undefined;
4984
+ itemKey?: string | undefined;
3483
4985
  }>>;
3484
4986
  readonly ListItem: {
3485
4987
  readonly type: "listItem";
@@ -3503,7 +5005,7 @@ declare const elementDeclarations: {
3503
5005
  readonly canSelect: true;
3504
5006
  readonly canDragDrop: true;
3505
5007
  readonly canMove: true;
3506
- readonly canTemplate: true;
5008
+ readonly canSnippet: true;
3507
5009
  readonly itemsAllowed: readonly [];
3508
5010
  readonly itemsNotAllowed: readonly ["listItem"];
3509
5011
  };
@@ -3549,7 +5051,7 @@ declare const elementDeclarations: {
3549
5051
  readonly canSelect: true;
3550
5052
  readonly canDragDrop: false;
3551
5053
  readonly canMove: true;
3552
- readonly canTemplate: true;
5054
+ readonly canSnippet: true;
3553
5055
  readonly itemsAllowed: readonly [];
3554
5056
  readonly itemsNotAllowed: readonly [];
3555
5057
  };
@@ -3597,7 +5099,7 @@ declare const elementDeclarations: {
3597
5099
  readonly canSelect: true;
3598
5100
  readonly canDragDrop: true;
3599
5101
  readonly canMove: true;
3600
- readonly canTemplate: true;
5102
+ readonly canSnippet: true;
3601
5103
  readonly itemsAllowed: readonly [];
3602
5104
  readonly itemsNotAllowed: readonly [];
3603
5105
  };
@@ -3706,7 +5208,7 @@ declare const elementDeclarations: {
3706
5208
  readonly canSelect: true;
3707
5209
  readonly canDragDrop: true;
3708
5210
  readonly canMove: true;
3709
- readonly canTemplate: true;
5211
+ readonly canSnippet: true;
3710
5212
  readonly itemsAllowed: readonly [];
3711
5213
  readonly itemsNotAllowed: readonly [];
3712
5214
  };
@@ -3838,7 +5340,7 @@ declare const elementDeclarations: {
3838
5340
  readonly canSelect: true;
3839
5341
  readonly canDragDrop: true;
3840
5342
  readonly canMove: true;
3841
- readonly canTemplate: true;
5343
+ readonly canSnippet: true;
3842
5344
  readonly itemsAllowed: readonly [];
3843
5345
  readonly itemsNotAllowed: readonly [];
3844
5346
  };
@@ -3881,6 +5383,8 @@ declare const elementDeclarations: {
3881
5383
  slot?: string | undefined | undefined;
3882
5384
  title?: string | undefined | undefined;
3883
5385
  defaultValue?: string | number | readonly string[] | undefined;
5386
+ hidden?: boolean | undefined | undefined;
5387
+ onScroll?: UIEventHandler<"span"> | undefined;
3884
5388
  onLoad?: ReactEventHandler<"span"> | undefined;
3885
5389
  onClick?: MouseEventHandler<"span"> | undefined;
3886
5390
  onPointerDown?: PointerEventHandler<"span"> | undefined;
@@ -4089,7 +5593,6 @@ declare const elementDeclarations: {
4089
5593
  onGotPointerCaptureCapture?: PointerEventHandler<"span"> | undefined;
4090
5594
  onLostPointerCapture?: PointerEventHandler<"span"> | undefined;
4091
5595
  onLostPointerCaptureCapture?: PointerEventHandler<"span"> | undefined;
4092
- onScroll?: UIEventHandler<"span"> | undefined;
4093
5596
  onScrollCapture?: UIEventHandler<"span"> | undefined;
4094
5597
  onScrollEnd?: UIEventHandler<"span"> | undefined;
4095
5598
  onScrollEndCapture?: UIEventHandler<"span"> | undefined;
@@ -4121,7 +5624,6 @@ declare const elementDeclarations: {
4121
5624
  dir?: string | undefined | undefined;
4122
5625
  draggable?: (boolean | "false" | "true") | undefined;
4123
5626
  enterKeyHint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined | undefined;
4124
- hidden?: boolean | undefined | undefined;
4125
5627
  spellCheck?: (boolean | "false" | "true") | undefined;
4126
5628
  translate?: "yes" | "no" | undefined | undefined;
4127
5629
  radioGroup?: string | undefined | undefined;
@@ -4176,7 +5678,7 @@ declare const elementDeclarations: {
4176
5678
  readonly canSelect: true;
4177
5679
  readonly canDragDrop: false;
4178
5680
  readonly canMove: true;
4179
- readonly canTemplate: true;
5681
+ readonly canSnippet: true;
4180
5682
  readonly itemsAllowed: readonly [];
4181
5683
  readonly itemsNotAllowed: readonly [];
4182
5684
  };
@@ -4246,7 +5748,7 @@ declare const elementDeclarations: {
4246
5748
  readonly canSelect: true;
4247
5749
  readonly canDragDrop: false;
4248
5750
  readonly canMove: false;
4249
- readonly canTemplate: true;
5751
+ readonly canSnippet: true;
4250
5752
  readonly itemsAllowed: readonly [];
4251
5753
  readonly itemsNotAllowed: readonly [];
4252
5754
  };
@@ -4335,7 +5837,7 @@ declare const elementDeclarations: {
4335
5837
  readonly canSelect: true;
4336
5838
  readonly canDragDrop: true;
4337
5839
  readonly canMove: true;
4338
- readonly canTemplate: true;
5840
+ readonly canSnippet: true;
4339
5841
  readonly itemsAllowed: readonly [];
4340
5842
  readonly itemsNotAllowed: readonly [];
4341
5843
  };
@@ -4399,7 +5901,7 @@ declare const elementDeclarations: {
4399
5901
  readonly canSelect: true;
4400
5902
  readonly canDragDrop: true;
4401
5903
  readonly canMove: true;
4402
- readonly canTemplate: true;
5904
+ readonly canSnippet: true;
4403
5905
  readonly itemsAllowed: readonly [];
4404
5906
  readonly itemsNotAllowed: readonly [];
4405
5907
  };
@@ -4435,12 +5937,11 @@ declare const elementDeclarations: {
4435
5937
  readonly attributes: {
4436
5938
  readonly referenceType: "element";
4437
5939
  readonly referenceId: "";
4438
- readonly referenceContainer: "";
4439
5940
  };
4440
5941
  readonly definition: {
4441
5942
  readonly label: "Reference";
4442
5943
  readonly type: "reference";
4443
- readonly description: "Reuses another element or template by id, rendering it in place.";
5944
+ readonly description: "Places one of the components of the space, or renders another of its elements by id, in place.";
4444
5945
  readonly items: readonly [];
4445
5946
  readonly bindings: {};
4446
5947
  readonly styleSelectors: {
@@ -4455,7 +5956,7 @@ declare const elementDeclarations: {
4455
5956
  readonly canSelect: true;
4456
5957
  readonly canDragDrop: true;
4457
5958
  readonly canMove: true;
4458
- readonly canTemplate: true;
5959
+ readonly canSnippet: true;
4459
5960
  readonly itemsAllowed: readonly [];
4460
5961
  readonly itemsNotAllowed: readonly [];
4461
5962
  };
@@ -4480,9 +5981,8 @@ declare const elementDeclarations: {
4480
5981
  readonly settings: {};
4481
5982
  };
4482
5983
  } & ElementAttributesBrand<Partial<{
4483
- referenceType: ElementLayoutType;
4484
5984
  referenceId: string;
4485
- referenceContainer: string;
5985
+ referenceType: "element" | "component";
4486
5986
  }>>;
4487
5987
  readonly RichText: {
4488
5988
  readonly type: "richText";
@@ -4513,7 +6013,7 @@ declare const elementDeclarations: {
4513
6013
  readonly canSelect: true;
4514
6014
  readonly canDragDrop: true;
4515
6015
  readonly canMove: true;
4516
- readonly canTemplate: true;
6016
+ readonly canSnippet: true;
4517
6017
  readonly itemsAllowed: readonly [];
4518
6018
  readonly itemsNotAllowed: readonly [];
4519
6019
  };
@@ -4543,6 +6043,62 @@ declare const elementDeclarations: {
4543
6043
  content?: string | undefined;
4544
6044
  mediaBaseUrl?: string | undefined;
4545
6045
  }>>;
6046
+ readonly Svg: {
6047
+ readonly type: "svg";
6048
+ readonly content: {
6049
+ readonly attributes: {
6050
+ readonly content: "";
6051
+ readonly label: "";
6052
+ };
6053
+ readonly definition: {
6054
+ readonly label: "SVG";
6055
+ readonly type: "svg";
6056
+ readonly description: "A drawing written as SVG markup, coloured by its class.";
6057
+ readonly bindings: {};
6058
+ readonly styleSelectors: {
6059
+ readonly base: "";
6060
+ };
6061
+ readonly initialState: {
6062
+ readonly visibility: true;
6063
+ };
6064
+ };
6065
+ readonly builder: {
6066
+ readonly canDelete: true;
6067
+ readonly canSelect: true;
6068
+ readonly canDragDrop: true;
6069
+ readonly canMove: true;
6070
+ readonly canSnippet: true;
6071
+ readonly itemsAllowed: readonly [];
6072
+ readonly itemsNotAllowed: readonly [];
6073
+ };
6074
+ readonly market: {
6075
+ readonly category: "media";
6076
+ readonly owner: "Plitzi";
6077
+ readonly verified: true;
6078
+ readonly license: "MIT";
6079
+ readonly website: "https://plitzi.com";
6080
+ readonly backgroundColor: "#4422ee";
6081
+ readonly icon: "fa-solid fa-bezier-curve";
6082
+ };
6083
+ readonly defaultStyle: {
6084
+ readonly name: "Svg";
6085
+ readonly displayMode: "desktop";
6086
+ readonly style: {
6087
+ readonly base: {
6088
+ readonly default: {
6089
+ readonly display: "inline-flex";
6090
+ readonly width: "24px";
6091
+ readonly height: "24px";
6092
+ };
6093
+ };
6094
+ };
6095
+ };
6096
+ readonly settings: {};
6097
+ };
6098
+ } & ElementAttributesBrand<Partial<{
6099
+ label?: string | undefined;
6100
+ content?: string | undefined;
6101
+ }>>;
4546
6102
  readonly TabContainer: {
4547
6103
  readonly type: "tabContainer";
4548
6104
  readonly content: {
@@ -4565,7 +6121,7 @@ declare const elementDeclarations: {
4565
6121
  readonly canSelect: true;
4566
6122
  readonly canDragDrop: true;
4567
6123
  readonly canMove: true;
4568
- readonly canTemplate: true;
6124
+ readonly canSnippet: true;
4569
6125
  readonly itemsAllowed: readonly ["tabContainerHeader", "tabContainerBody"];
4570
6126
  readonly itemsNotAllowed: readonly [];
4571
6127
  };
@@ -4615,7 +6171,7 @@ declare const elementDeclarations: {
4615
6171
  readonly canSelect: true;
4616
6172
  readonly canDragDrop: false;
4617
6173
  readonly canMove: false;
4618
- readonly canTemplate: false;
6174
+ readonly canSnippet: false;
4619
6175
  readonly itemsAllowed: readonly ["tabContainerItem"];
4620
6176
  readonly itemsNotAllowed: readonly [];
4621
6177
  };
@@ -4665,7 +6221,7 @@ declare const elementDeclarations: {
4665
6221
  readonly canSelect: true;
4666
6222
  readonly canDragDrop: false;
4667
6223
  readonly canMove: false;
4668
- readonly canTemplate: false;
6224
+ readonly canSnippet: false;
4669
6225
  readonly itemsAllowed: readonly ["tabContainerItem"];
4670
6226
  readonly itemsNotAllowed: readonly [];
4671
6227
  };
@@ -4714,7 +6270,7 @@ declare const elementDeclarations: {
4714
6270
  readonly canSelect: true;
4715
6271
  readonly canDragDrop: true;
4716
6272
  readonly canMove: true;
4717
- readonly canTemplate: true;
6273
+ readonly canSnippet: true;
4718
6274
  readonly itemsAllowed: readonly [];
4719
6275
  readonly itemsNotAllowed: readonly ["tabContainerItem", "tabContainerHeader", "tabContainerBody"];
4720
6276
  };
@@ -4763,7 +6319,7 @@ declare const elementDeclarations: {
4763
6319
  readonly canSelect: true;
4764
6320
  readonly canDragDrop: true;
4765
6321
  readonly canMove: true;
4766
- readonly canTemplate: true;
6322
+ readonly canSnippet: true;
4767
6323
  readonly itemsAllowed: readonly [];
4768
6324
  readonly itemsNotAllowed: readonly [];
4769
6325
  };
@@ -4838,7 +6394,7 @@ declare const elementDeclarations: {
4838
6394
  readonly canSelect: true;
4839
6395
  readonly canDragDrop: true;
4840
6396
  readonly canMove: true;
4841
- readonly canTemplate: true;
6397
+ readonly canSnippet: true;
4842
6398
  readonly itemsAllowed: readonly [];
4843
6399
  readonly itemsNotAllowed: readonly [];
4844
6400
  };
@@ -4901,7 +6457,7 @@ declare const elementDeclarations: {
4901
6457
  readonly canSelect: true;
4902
6458
  readonly canDragDrop: true;
4903
6459
  readonly canMove: true;
4904
- readonly canTemplate: true;
6460
+ readonly canSnippet: true;
4905
6461
  readonly itemsAllowed: readonly [];
4906
6462
  readonly itemsNotAllowed: readonly [];
4907
6463
  };
@@ -4941,7 +6497,7 @@ declare const elementDeclarations: {
4941
6497
  /** The attributes each built-in type starts with — what a factory merges under the author's own. */
4942
6498
  export declare const elementDefaultAttributes: Record<string, Record<string, unknown>>;
4943
6499
 
4944
- declare type ElementDefinition = {
6500
+ export declare type ElementDefinition = {
4945
6501
  rootId: Element_2['id'];
4946
6502
  label: string;
4947
6503
  type: string;
@@ -4963,6 +6519,13 @@ declare type ElementDefinition = {
4963
6519
  runtime?: ElementRuntime;
4964
6520
  /** When this element's items are mounted, relative to its `visibility`. See {@link ElementLoadStrategy}. */
4965
6521
  loadStrategy?: ElementLoadStrategy;
6522
+ /** The feature flag this element exists under. See {@link ElementFlagGate}. */
6523
+ flag?: ElementFlagGate;
6524
+ /**
6525
+ * The `id` this element carries in the DOM, so a link to `/page#anchor` lands on it — `data-id` names the element
6526
+ * for the platform, this names it for the URL. One per rendered page, layouts included (`isAnchor`).
6527
+ */
6528
+ anchor?: string;
4966
6529
  };
4967
6530
 
4968
6531
  /**
@@ -4974,6 +6537,21 @@ export declare type ElementFactory<A> = ContentShorthand<A> & {
4974
6537
  (children: ElementSpec[], props?: ElementProps<A>): ElementSpec;
4975
6538
  };
4976
6539
 
6540
+ /**
6541
+ * What a feature flag gates an element on: it exists only while the flag `name` resolves to `is`.
6542
+ *
6543
+ * Not a visibility. A hidden element is still rendered, its markup still in the page; a gated one whose flag says no
6544
+ * is not rendered at all — not on the server, not in the browser, not its subtree — and the data of its server
6545
+ * elements is not resolved. Its declaration still travels with the space's document, as every element's does, so a
6546
+ * flag switches a feature off; it does not keep it secret. `is: false` is the other half of a rollout: the old
6547
+ * version, shown until the flag turns on.
6548
+ * On a page, a flag that says no makes the page not found.
6549
+ */
6550
+ export declare type ElementFlagGate = {
6551
+ name: string;
6552
+ is: boolean;
6553
+ };
6554
+
4977
6555
  /**
4978
6556
  * How a test names what an author wrote.
4979
6557
  *
@@ -5031,7 +6609,7 @@ export declare interface ElementHandle {
5031
6609
  boxless?: true;
5032
6610
  }
5033
6611
 
5034
- declare type ElementInteraction<T extends Record<string, unknown> = Record<string, unknown>> = {
6612
+ export declare type ElementInteraction<T extends Record<string, unknown> = Record<string, unknown>> = {
5035
6613
  id: string;
5036
6614
  title: string;
5037
6615
  type: InteractionCallbackType;
@@ -5048,8 +6626,6 @@ declare type ElementInteraction<T extends Record<string, unknown> = Record<strin
5048
6626
  whileRunning?: WhileRunning;
5049
6627
  };
5050
6628
 
5051
- declare type ElementLayoutType = 'layout' | 'segment' | 'element' | 'reference';
5052
-
5053
6629
  /**
5054
6630
  * The types that hold no children — a heading, a text, an image, a form control.
5055
6631
  *
@@ -5076,7 +6652,13 @@ export declare const elementLeafTypes: string[];
5076
6652
  * - `visible`: mounted only while shown. Pays the build cost on every reveal and drops the subtree's state on
5077
6653
  * every hide — worth it for contents that are expensive to KEEP (a live map, a video, a polling source).
5078
6654
  */
5079
- declare type ElementLoadStrategy = 'eager' | 'lazy' | 'visible';
6655
+ export declare type ElementLoadStrategy = 'eager' | 'lazy' | 'visible';
6656
+
6657
+ /**
6658
+ * The parts each compound type renders through — a carousel's `carouselTrack`, a tab container's header and body: the
6659
+ * types it starts with (`initialItems`) that work only inside it. Without one it renders nothing of what it holds.
6660
+ */
6661
+ export declare const elementPartTypes: Record<string, string[]>;
5080
6662
 
5081
6663
  /** What a variant may change on one element: anything but what makes it that element. */
5082
6664
  export declare type ElementPatch = Partial<Omit<ElementSpec, 'type' | 'id' | 'children'>>;
@@ -5102,7 +6684,7 @@ export declare interface ElementRenders {
5102
6684
  changed: string[];
5103
6685
  }
5104
6686
 
5105
- declare type ElementRuntime = 'server' | 'client' | 'shared';
6687
+ export declare type ElementRuntime = 'server' | 'client' | 'shared';
5106
6688
 
5107
6689
  /**
5108
6690
  * What each built-in element IS, read off the declarations rather than listed somewhere.
@@ -5172,6 +6754,16 @@ export declare interface ElementSpec {
5172
6754
  */
5173
6755
  id?: string;
5174
6756
  attributes?: Record<string, unknown>;
6757
+ /**
6758
+ * The source the element's main attribute shows — `content` of a text, a heading, a paragraph or a button; `src`
6759
+ * of an image; `href` of a link; `items` of a list: `heading({ from: 'site.data.hero.title' })`. `bind` is for
6760
+ * the other attributes.
6761
+ */
6762
+ from?: string;
6763
+ /** How `from` is shown: a name of the space's `formats`, or a template of its own (`'{{ source }} items'`). */
6764
+ as?: string;
6765
+ /** A list's row, by the component placed once per item with the row bound to its `item` prop. */
6766
+ row?: string;
5175
6767
  /**
5176
6768
  * A style variant the element starts in, e.g. a heading's `title`.
5177
6769
  *
@@ -5206,9 +6798,10 @@ export declare interface ElementSpec {
5206
6798
  * so declaring both is a question with no answer and is refused rather than silently resolved.
5207
6799
  *
5208
6800
  * Either a name from {@link SpaceSpec.classes}, or a `styles()` declaration that brings its own rules along — or a
5209
- * list of them, for an element that wears a shared base and a modifier (`[panelCard, quotaPanel]`).
6801
+ * list of them, for an element that wears a shared base and a modifier (`[panelCard, quotaPanel]`). A list may end
6802
+ * with rules of the element's own on top of its classes, `[cover, { opacity: '0.25' }]` ({@link ElementClassList}).
5210
6803
  */
5211
- class?: ClassList;
6804
+ class?: ElementClassList;
5212
6805
  /**
5213
6806
  * A class for one of the element's OTHER style selectors, by selector name — a form control's `input`, `label`
5214
6807
  * and `error`.
@@ -5245,6 +6838,18 @@ export declare interface ElementSpec {
5245
6838
  runtime?: ElementRuntime;
5246
6839
  /** When this element's contents mount relative to its visibility. Left out, the element type decides. */
5247
6840
  loadStrategy?: ElementLoadStrategy;
6841
+ /**
6842
+ * The `id` this element carries in the DOM, so `/page#anchor` lands on it — `link({ href: 'home', hash: 'plans' })`.
6843
+ * Lowercase letters, digits and `-`; one per page, layouts included; not inside a list row or a component, which
6844
+ * would repeat it.
6845
+ */
6846
+ anchor?: string;
6847
+ /**
6848
+ * The feature flag this exists under: `'newCheckout'` exists only while the flag is on, `'!newCheckout'` only while
6849
+ * it is off — the old version, kept until the new one ships. Not a visibility: gated off, it is not rendered at all,
6850
+ * on the server or in the browser. The flag is one {@link SpaceSpec.flags} declares.
6851
+ */
6852
+ flag?: string;
5248
6853
  children?: ElementSpec[];
5249
6854
  meta?: SpecMeta;
5250
6855
  }
@@ -5290,6 +6895,35 @@ export declare type ElementTypeName = keyof DeclarationByType;
5290
6895
  /** Every built-in type name, for anything that has to tell a known type from one a plugin has to provide. */
5291
6896
  export declare const elementTypeNames: string[];
5292
6897
 
6898
+ export declare const embed: {
6899
+ (props?: ElementProps<Partial<{
6900
+ title?: string | undefined;
6901
+ referrerPolicy?: "no-referrer" | "origin" | "strict-origin-when-cross-origin" | "no-referrer-when-downgrade" | undefined;
6902
+ src?: string | undefined;
6903
+ allow?: string | undefined;
6904
+ loading?: "lazy" | "eager" | undefined;
6905
+ sandbox?: string | undefined;
6906
+ }>> | undefined): ElementSpec;
6907
+ (children: ElementSpec[], props?: ElementProps<Partial<{
6908
+ title?: string | undefined;
6909
+ referrerPolicy?: "no-referrer" | "origin" | "strict-origin-when-cross-origin" | "no-referrer-when-downgrade" | undefined;
6910
+ src?: string | undefined;
6911
+ allow?: string | undefined;
6912
+ loading?: "lazy" | "eager" | undefined;
6913
+ sandbox?: string | undefined;
6914
+ }>> | undefined): ElementSpec;
6915
+ };
6916
+
6917
+ /**
6918
+ * The space `plitzi create --template blank` starts from, as a file: tokens, a layout and one empty page — for a
6919
+ * project about to be something specific, where the welcome tour is the first thing that would be deleted.
6920
+ */
6921
+ export declare const emptySpaceSource: ({ name }?: {
6922
+ name?: string;
6923
+ }) => string;
6924
+
6925
+ export declare const emptySpaceSpec: SpaceSpec;
6926
+
5293
6927
  /**
5294
6928
  * Expand supported CSS shorthands to their longhand keys, in declaration order: the later declaration wins, as it
5295
6929
  * does in a stylesheet. `{ padding: 8, 'padding-left': 0 }` keeps `padding-left: 0`, and
@@ -5303,9 +6937,112 @@ export declare const expandShorthand: (css: CssProps) => CssProps;
5303
6937
  * `{ padding: null }` clears all four sides rather than a `padding` key that was never stored. */
5304
6938
  export declare const expandShorthandPatch: (css: CssPatch) => CssPatch;
5305
6939
 
6940
+ /** Everything a name is — an action can be both a global and an element callback (`setState`), and is said as both. */
6941
+ export declare const explain: (name: string) => Explanation[];
6942
+
6943
+ /** What each kind is called when listed. */
6944
+ export declare const EXPLAIN_KINDS: Record<ExplainKind, string>;
6945
+
6946
+ export declare type ExplainKind = Explanation['kind'];
6947
+
6948
+ /** A kind by what it is called when listed (`steps`) or by itself (`step`). */
6949
+ export declare const explainKindOf: (name: string) => ExplainKind | undefined;
6950
+
6951
+ /** Every name of one kind, with a line about each — what to ask `explain` about next. */
6952
+ export declare const explainList: (kind: ExplainKind) => {
6953
+ name: string;
6954
+ summary: string;
6955
+ }[];
6956
+
6957
+ export declare type Explanation = {
6958
+ kind: 'element';
6959
+ name: string;
6960
+ label: string;
6961
+ description: string;
6962
+ factory: string;
6963
+ attributes: {
6964
+ name: string;
6965
+ default?: unknown;
6966
+ values?: readonly string[];
6967
+ }[];
6968
+ triggers: string[];
6969
+ callbacks: string[];
6970
+ slots: string[];
6971
+ /** The type it has to be inside, for one that only works in another. */
6972
+ inside?: string;
6973
+ /** The name its data source is published under: `<source>_<id>`. */
6974
+ source?: string;
6975
+ holdsChildren: boolean;
6976
+ } | {
6977
+ kind: 'step';
6978
+ name: string;
6979
+ title: string;
6980
+ /** How the runtime finds it: a global callback by its module, an element callback on an element, a utility alone. */
6981
+ type: 'globalCallback' | 'callback' | 'utility';
6982
+ /** The authoring function that writes it, when there is one. */
6983
+ builder?: string;
6984
+ /** The element types that answer to it, for an element callback. */
6985
+ answeredBy?: string[];
6986
+ params: ParamInfo[];
6987
+ } | {
6988
+ kind: 'trigger';
6989
+ name: string;
6990
+ title: string;
6991
+ builder?: string;
6992
+ /** What a flow it starts reads: `{{ <step>.field }}`. */
6993
+ reads: string[];
6994
+ /** The types that fire it — every element, or the ones named. */
6995
+ firedBy: string[] | 'every element';
6996
+ params: ParamInfo[];
6997
+ } | {
6998
+ kind: 'code';
6999
+ name: string;
7000
+ codeKind: AuthoringCodeEntry['kind'];
7001
+ means: string;
7002
+ fix: string;
7003
+ } | {
7004
+ kind: 'transformer';
7005
+ name: string;
7006
+ title: string;
7007
+ description: string;
7008
+ params: ParamInfo[];
7009
+ };
7010
+
7011
+ /** One explanation as text, for a person or an agent reading a terminal. */
7012
+ export declare const explanationText: (explanation: Explanation) => string;
7013
+
7014
+ /** A failed flow in one line, with the steps that failed under it. */
7015
+ export declare const failedFlowText: (flow: DevToolsFlow) => string;
7016
+
5306
7017
  /** The lint codes `fixSpace` knows how to settle: what the builder offers to fix, and what the server will fix. */
5307
7018
  export declare const FIXABLE_CODES: ReadonlySet<string>;
5308
7019
 
7020
+ /**
7021
+ * A change a fix made, in the words the author wrote it with: an attribute, one of the element's own fields
7022
+ * (`visible`), a binding by its target, or a field of one of its steps (`on`, a param). What lets the same fix be
7023
+ * offered as an edit to the source that wrote the element, as well as made to its document.
7024
+ */
7025
+ export declare interface FixChange {
7026
+ on: 'attribute' | 'field' | 'binding' | {
7027
+ step: string;
7028
+ };
7029
+ /** `replace` swaps one literal text for another anywhere under the key — a transformer's action in a binding. */
7030
+ op: 'remove' | 'rename' | 'set' | 'replace';
7031
+ /** The attribute, field or param; a binding's target; the text `replace` looks for. */
7032
+ key: string;
7033
+ /** What `rename` renames to, and what `replace` writes. */
7034
+ to?: string;
7035
+ /** What `set` writes. */
7036
+ value?: string | boolean;
7037
+ }
7038
+
7039
+ /** What is wrong with a declaration, and what of it has one fix. */
7040
+ export declare interface FixPlan {
7041
+ /** Every problem the linter reports — errors and warnings alike, whether or not the space would be refused. */
7042
+ problems: PlanProblem[];
7043
+ fixes: PlannedFix[];
7044
+ }
7045
+
5309
7046
  export declare interface FixResult {
5310
7047
  schema: Schema;
5311
7048
  style: Style;
@@ -5318,6 +7055,19 @@ export declare interface FixResult {
5318
7055
  */
5319
7056
  export declare const fixSpace: (space: SpaceDocuments, options?: LintCatalogs, codes?: Iterable<string>, elements?: Iterable<string>) => FixResult;
5320
7057
 
7058
+ /**
7059
+ * The gate an element's or a page's `flag` writes: `'newCheckout'` while the flag is on, `'!newCheckout'` while it is
7060
+ * off. Whether the flag is DECLARED is `lintSpace`'s to say, with the declared ones to choose from; a value that names
7061
+ * no flag at all is refused here, where it was written.
7062
+ */
7063
+ export declare const flagGateOf: (flag: unknown, where: string) => ElementFlagGate | undefined;
7064
+
7065
+ /** The other way round, for a document read back into a spec. */
7066
+ export declare const flagSpecOf: (gate: ElementFlagGate) => string;
7067
+
7068
+ /** Every step's id, flow by flow, as `authorFlows` writes them — where a step of the document was in the source. */
7069
+ export declare const flowStepIds: (flows: StepSpec[][]) => string[][];
7070
+
5321
7071
  export declare const fontAwesome: {
5322
7072
  (props?: ElementProps<Partial<{
5323
7073
  size?: string | undefined;
@@ -5333,7 +7083,7 @@ export declare const fontAwesome: {
5333
7083
  }>> | undefined): ElementSpec;
5334
7084
  };
5335
7085
 
5336
- declare type FontBase = {
7086
+ export declare type FontBase = {
5337
7087
  /** What `font-family` names. Unique within a space. */
5338
7088
  family: string;
5339
7089
  /** Appended to the stack — `'Lato', sans-serif` — and what renders while the face loads. */
@@ -5348,6 +7098,7 @@ declare type FontBase = {
5348
7098
  };
5349
7099
 
5350
7100
  declare type FontDisplay_2 = 'auto' | 'block' | 'swap' | 'fallback' | 'optional';
7101
+ export { FontDisplay_2 as FontDisplay }
5351
7102
 
5352
7103
  /** One face of a family: the file carrying a given weight and slant. */
5353
7104
  declare type FontFace_2 = {
@@ -5357,8 +7108,9 @@ declare type FontFace_2 = {
5357
7108
  /** Limits the face to the code points it covers, so the browser fetches it only when needed. */
5358
7109
  unicodeRange?: string;
5359
7110
  };
7111
+ export { FontFace_2 as FontFace }
5360
7112
 
5361
- declare type FontStyle = 'normal' | 'italic';
7113
+ export declare type FontStyle = 'normal' | 'italic';
5362
7114
 
5363
7115
  export declare const form: {
5364
7116
  (props?: ElementProps<Partial<{
@@ -5380,8 +7132,8 @@ export declare const form: {
5380
7132
  };
5381
7133
 
5382
7134
  export declare const formControl: {
5383
- (props?: ElementProps<FormControlAttributes> | undefined): ElementSpec;
5384
- (children: ElementSpec[], props?: ElementProps<FormControlAttributes> | undefined): ElementSpec;
7135
+ (props?: ElementProps< FormControlAttributes> | undefined): ElementSpec;
7136
+ (children: ElementSpec[], props?: ElementProps< FormControlAttributes> | undefined): ElementSpec;
5385
7137
  };
5386
7138
 
5387
7139
  /** What this element can be authored with — its component's own props, minus what the runtime supplies. */
@@ -5465,7 +7217,7 @@ export declare const getTransformer: (action: string) => BuiltinTransformer | un
5465
7217
  export declare const getUtility: (action: string) => BuiltinUtility | undefined;
5466
7218
 
5467
7219
  /**
5468
- * The sources that belong to nobody, registered once for the whole space.
7220
+ * The sources that belong to nobody, registered once for the whole space — the runtime's own list.
5469
7221
  *
5470
7222
  * They are named as themselves rather than as `<type>_<id>`, which is what tells them apart from a source an
5471
7223
  * element publishes — and is why an element may not answer to one of these names.
@@ -5476,19 +7228,21 @@ export declare const getUtility: (action: string) => BuiltinUtility | undefined;
5476
7228
  *
5477
7229
  * `theme` is `{ mode, resolved }` — `resolved` is always `light` or `dark`, which is what a URL or a rule wants.
5478
7230
  *
7231
+ * `flags` holds the space's feature flags (`SpaceSpec.flags`) as they resolved, by name: `true` or `false`.
7232
+ *
5479
7233
  * `computed` holds the space's own computed values (`SpaceSpec.computed`), by name.
5480
7234
  */
5481
- export declare const GLOBAL_SOURCES: string[];
7235
+ export declare const GLOBAL_SOURCES: readonly string[];
5482
7236
 
5483
7237
  /** Google Fonts, reached through the single aggregated `css2` request the resolver builds. */
5484
- declare type GoogleFont = FontBase & {
7238
+ export declare type GoogleFont = FontBase & {
5485
7239
  source: 'google';
5486
7240
  subsets?: string[];
5487
7241
  };
5488
7242
 
5489
7243
  export declare const grid: (columns: string, gap: string, extra?: CssProps) => StyleRules;
5490
7244
 
5491
- export declare const groupBindings: (path: string, bind: BindingsSpec, sources?: SourceIndex, where?: string) => Partial<Record<BindingCategory, ElementBinding[]>>;
7245
+ export declare const groupBindings: (path: string, bind: BindingsSpec, sources?: SourceIndex, where?: string, globals?: readonly string[]) => Partial<Record<BindingCategory, ElementBinding[]>>;
5492
7246
 
5493
7247
  /** Whether any of these bindings decides the element's visibility — which makes it a condition, authored hidden. */
5494
7248
  export declare const hasVisibilityBinding: (bindings: BindingSpec[] | undefined) => boolean;
@@ -5529,23 +7283,31 @@ export declare const hostAction: (params: {
5529
7283
  /** Uploaded to this deployment's font store. `path` is store-relative and never absolute: a
5530
7284
  * manifest that carried `https://cdn.plitzi.com/...` would follow a space onto a server that is
5531
7285
  * not ours and keep asking Plitzi for its fonts. The URL is made at render time. */
5532
- declare type HostedFont = FontBase & {
7286
+ export declare type HostedFont = FontBase & {
5533
7287
  source: 'hosted';
5534
7288
  files: (FontFace_2 & {
5535
7289
  path: string;
5536
7290
  })[];
5537
7291
  };
5538
7292
 
7293
+ declare type IconPlacement = 'before' | 'after';
7294
+
5539
7295
  export declare const image: {
5540
7296
  (props?: ElementProps<Partial<{
7297
+ height?: number | undefined;
7298
+ width?: number | undefined;
5541
7299
  fetchPriority?: "high" | "low" | "auto" | undefined;
7300
+ sizes?: string | undefined;
5542
7301
  src?: string | undefined;
5543
7302
  alt?: string | undefined;
5544
7303
  decorative?: boolean | undefined;
5545
7304
  loadMode?: "auto" | "eager" | "lazy" | undefined;
5546
7305
  }>> | undefined): ElementSpec;
5547
7306
  (children: ElementSpec[], props?: ElementProps<Partial<{
7307
+ height?: number | undefined;
7308
+ width?: number | undefined;
5548
7309
  fetchPriority?: "high" | "low" | "auto" | undefined;
7310
+ sizes?: string | undefined;
5549
7311
  src?: string | undefined;
5550
7312
  alt?: string | undefined;
5551
7313
  decorative?: boolean | undefined;
@@ -5553,6 +7315,151 @@ export declare const image: {
5553
7315
  }>> | undefined): ElementSpec;
5554
7316
  };
5555
7317
 
7318
+ export declare interface ImportAsset {
7319
+ src: string;
7320
+ alt: string;
7321
+ width: number;
7322
+ height: number;
7323
+ }
7324
+
7325
+ /** Where a colour was seen: an element by its path, and which of its colours. */
7326
+ export declare interface ImportColourSample {
7327
+ path: string;
7328
+ property: 'color' | 'background-color';
7329
+ }
7330
+
7331
+ export declare interface Imported {
7332
+ files: ImportedFile[];
7333
+ summary: ImportSummary;
7334
+ }
7335
+
7336
+ /** The colours the page shows in the dark scheme, by the light colour each one replaces. */
7337
+ export declare interface ImportedDark {
7338
+ colours: Record<string, string>;
7339
+ customProperties: Record<string, string>;
7340
+ }
7341
+
7342
+ export declare interface ImportedFile {
7343
+ /** Relative to the folder the import is written in. */
7344
+ path: string;
7345
+ content: string;
7346
+ }
7347
+
7348
+ /**
7349
+ * The files an import is written as: tokens, the outline, one JSON per repeated list, the pictures it found and a
7350
+ * page saying what was not carried over. Pure — the CLI measures, takes the screenshots and writes them to disk.
7351
+ */
7352
+ export declare const importedFiles: ({ probes, dark }: ImportedPage) => Imported;
7353
+
7354
+ /** The page as it was measured: once per width, and what changes in the dark scheme when it has one. */
7355
+ export declare interface ImportedPage {
7356
+ probes: ImportProbe[];
7357
+ dark?: ImportedDark;
7358
+ }
7359
+
7360
+ /** A run of siblings with the same shape — cards, rows, links — and the fields each one shows. */
7361
+ export declare interface ImportList {
7362
+ /** The heading of the block it is in, as written — the file it is saved as is named after it — or `''` with none. */
7363
+ name: string;
7364
+ path: string;
7365
+ items: Record<string, string>[];
7366
+ }
7367
+
7368
+ /**
7369
+ * A page measured for import: what it is built from — its tokens, the outline of its landmarks with their real
7370
+ * measures, the lists it repeats, its pictures — read in the browser that rendered it. Not its words: an import is a
7371
+ * place to start writing from, and the structure is what takes longest to work out by hand.
7372
+ */
7373
+ /** One block of the page's outline, by where it is in the document. */
7374
+ export declare interface ImportNode {
7375
+ /** Its place among its parent's elements, from the body down: `0/2/1`. The same element at another width. */
7376
+ path: string;
7377
+ tag: string;
7378
+ /** The text of its first heading, which names it. */
7379
+ heading?: string;
7380
+ /** The `id` the page gave it. */
7381
+ id?: string;
7382
+ width: number;
7383
+ height: number;
7384
+ /** Its layout, as the page computes it: only what differs from a plain block. */
7385
+ style: Record<string, string>;
7386
+ /** How many siblings like it there are, when it stands for a repeated item. */
7387
+ repeats?: number;
7388
+ children: ImportNode[];
7389
+ }
7390
+
7391
+ export declare interface ImportProbe {
7392
+ url: string;
7393
+ title: string;
7394
+ /** The viewport width it was measured at. */
7395
+ width: number;
7396
+ /** The custom properties `:root` (or `html`) declares, resolved. */
7397
+ customProperties: Record<string, string>;
7398
+ /**
7399
+ * The colours that cover most of the page: its background, its text, and the next few — each with where it was seen,
7400
+ * so the same place can be read again in the dark scheme.
7401
+ */
7402
+ colors: {
7403
+ background?: string;
7404
+ foreground?: string;
7405
+ accents: string[];
7406
+ samples: Record<string, ImportColourSample>;
7407
+ };
7408
+ fonts: {
7409
+ body?: string;
7410
+ heading?: string;
7411
+ google: {
7412
+ family: string;
7413
+ weights: number[];
7414
+ }[];
7415
+ loaded: string[];
7416
+ };
7417
+ /** Corner radii and shadows used three times or more, most used first. */
7418
+ radii: string[];
7419
+ shadows: string[];
7420
+ outline: ImportNode[];
7421
+ lists: ImportList[];
7422
+ assets: ImportAsset[];
7423
+ /** The colours at {@link ImportProbeInput.read}, in its order: `''` where nothing is there any more. */
7424
+ read: string[];
7425
+ }
7426
+
7427
+ /** Runs in the page. Self-contained — it is serialised. */
7428
+ export declare const importProbe: ({ depth, read }: ImportProbeInput) => ImportProbe;
7429
+
7430
+ export declare interface ImportProbeInput {
7431
+ /** At most this many blocks deep below the body. */
7432
+ depth: number;
7433
+ /** Places to read a colour at — another probe's samples, read again in another scheme. */
7434
+ read?: ImportColourSample[];
7435
+ }
7436
+
7437
+ export declare const importSlug: (text: string) => string;
7438
+
7439
+ /** What an import found, counted — the few lines `plitzi import` answers with. */
7440
+ export declare interface ImportSummary {
7441
+ url: string;
7442
+ widths: number[];
7443
+ colours: number;
7444
+ /** Whether the page had a scheme of its own in the dark, rather than the light one again. */
7445
+ dark: boolean;
7446
+ shadows: number;
7447
+ radii: number;
7448
+ fonts: string[];
7449
+ blocks: number;
7450
+ lists: {
7451
+ file: string;
7452
+ rows: number;
7453
+ }[];
7454
+ pictures: number;
7455
+ }
7456
+
7457
+ /**
7458
+ * What a link's `href` says it is when the author did not say: a path is a route of this space, a URL is somewhere
7459
+ * else, anything else is a page's id. `mode` stays for the rare link that means otherwise.
7460
+ */
7461
+ export declare const inferredLinkMode: (href: unknown) => "page" | "internal" | "external";
7462
+
5556
7463
  /**
5557
7464
  * The half of `inspectPage` that needs no space: images, sideways scroll, legibility — for a page whose documents are
5558
7465
  * not in hand, like an example served by somebody else's server. `page` in the report is `document`.
@@ -5603,11 +7510,16 @@ export declare const inspectRenders: (page: RenderEvaluator, act: () => Promise<
5603
7510
 
5604
7511
  declare const interactionBasicTriggers: Record<string, InteractionCallback>;
5605
7512
 
5606
- declare type InteractionCallback<T extends Record<string, unknown> = Record<string, unknown>> = {
7513
+ export declare type InteractionCallback<T extends Record<string, unknown> = Record<string, unknown>> = {
5607
7514
  elementId?: string;
5608
7515
  action: string;
5609
7516
  title: string;
5610
7517
  type: InteractionCallbackType;
7518
+ /**
7519
+ * The heading the editor's picker lists it under, when that is not its type's: a space's own functions are tasks to
7520
+ * the run, and a category of their own to whoever picks a step.
7521
+ */
7522
+ group?: string;
5611
7523
  enabled?: boolean;
5612
7524
  params: Record<keyof T, InteractionCallbackParam<T>> | ((params: InteractionCallbackParamValues<T>) => Record<keyof T, InteractionCallbackParam<T>>);
5613
7525
  callback?: (params: InteractionCallbackParamValues<T>, context?: InteractionCallbackContext) => unknown;
@@ -5622,12 +7534,12 @@ declare type InteractionCallback<T extends Record<string, unknown> = Record<stri
5622
7534
  * report back TO that element — a server action running detached finishes long after the flow that launched it
5623
7535
  * returned, and `onFlowEnd` has to fire somewhere specific.
5624
7536
  */
5625
- declare type InteractionCallbackContext = {
7537
+ export declare type InteractionCallbackContext = {
5626
7538
  /** Id of the element this flow fired on. Absent for a flow with no host element. */
5627
7539
  hostElementId?: string;
5628
7540
  };
5629
7541
 
5630
- declare type InteractionCallbackParam<T extends Record<string, unknown> = Record<string, unknown>> = {
7542
+ export declare type InteractionCallbackParam<T extends Record<string, unknown> = Record<string, unknown>> = {
5631
7543
  canBind?: boolean;
5632
7544
  label?: string;
5633
7545
  when?: boolean | ((params: InteractionCallbackParamValues<T>) => boolean);
@@ -5681,17 +7593,17 @@ declare type InteractionCallbackParam<T extends Record<string, unknown> = Record
5681
7593
  }[]);
5682
7594
  });
5683
7595
 
5684
- declare type InteractionCallbackParamValues<T extends Record<string, unknown> = Record<string, unknown>> = T;
7596
+ export declare type InteractionCallbackParamValues<T extends Record<string, unknown> = Record<string, unknown>> = T;
5685
7597
 
5686
- declare type InteractionCallbackPreview = string | Record<string, unknown>;
7598
+ export declare type InteractionCallbackPreview = string | Record<string, unknown>;
5687
7599
 
5688
- declare type InteractionCallbackPreviews = Record<string, InteractionCallbackPreview>;
7600
+ export declare type InteractionCallbackPreviews = Record<string, InteractionCallbackPreview>;
5689
7601
 
5690
- declare type InteractionCallbackType = 'trigger' | 'globalCallback' | 'callback' | 'utility' | 'task';
7602
+ export declare type InteractionCallbackType = 'trigger' | 'globalCallback' | 'callback' | 'utility' | 'task';
5691
7603
 
5692
- declare type InteractionParamType = 'boolean' | 'select' | 'text' | 'textarea' | 'codemirror-text' | 'codemirror-json' | 'elements';
7604
+ export declare type InteractionParamType = 'boolean' | 'select' | 'text' | 'textarea' | 'codemirror-text' | 'codemirror-json' | 'elements';
5693
7605
 
5694
- declare type InteractionPostCallback<T extends Record<string, unknown> = Record<string, unknown>> = (params: InteractionCallbackParamValues<T>, callbackResult?: unknown) => unknown;
7606
+ export declare type InteractionPostCallback<T extends Record<string, unknown> = Record<string, unknown>> = (params: InteractionCallbackParamValues<T>, callbackResult?: unknown) => unknown;
5695
7607
 
5696
7608
  /**
5697
7609
  * Tells the page's browser requests the data behind them changed, so the api containers showing them ask again.
@@ -5721,6 +7633,9 @@ export declare interface InvalidParam {
5721
7633
  * that is not really used. Callers gate this to CLOSED (strict) catalogs, whose types we own authoritatively. */
5722
7634
  export declare const invalidParams: (provided: Record<string, unknown>, effective: Record<string, unknown>, spec: ParamSpec) => InvalidParam[];
5723
7635
 
7636
+ /** An entry of an element's class list that is rules of its own rather than a class. */
7637
+ export declare const isClassModifier: (entry: ClassRef | StyleSpec) => entry is StyleSpec;
7638
+
5724
7639
  export declare const isCssProperty: (key: string) => boolean;
5725
7640
 
5726
7641
  /**
@@ -5811,20 +7726,17 @@ export declare interface LayoutSpec {
5811
7726
  body: ElementSpec[];
5812
7727
  }
5813
7728
 
5814
- export declare const link: {
5815
- (props?: ElementProps<Partial<{
5816
- mode?: "page" | "internal" | "external" | undefined;
5817
- href?: string | undefined;
5818
- label?: string | undefined;
5819
- target?: "self" | "blank" | "parent" | "top" | undefined;
5820
- }>> | undefined): ElementSpec;
5821
- (children: ElementSpec[], props?: ElementProps<Partial<{
5822
- mode?: "page" | "internal" | "external" | undefined;
5823
- href?: string | undefined;
5824
- label?: string | undefined;
5825
- target?: "self" | "blank" | "parent" | "top" | undefined;
5826
- }>> | undefined): ElementSpec;
5827
- };
7729
+ export declare const link: ElementFactory<Partial<{
7730
+ mode?: "page" | "internal" | "external" | undefined;
7731
+ href?: string | undefined;
7732
+ label?: string | undefined;
7733
+ target?: "self" | "blank" | "parent" | "top" | undefined;
7734
+ content?: string | undefined;
7735
+ icon?: string | undefined;
7736
+ iconPlacement?: IconPlacement | undefined;
7737
+ contentPlacement?: "before" | "after" | undefined;
7738
+ hash?: string | undefined;
7739
+ }>>;
5828
7740
 
5829
7741
  export declare type LintCatalogs = AuthorSpaceOptions;
5830
7742
 
@@ -5844,24 +7756,44 @@ export declare interface LintResult {
5844
7756
  */
5845
7757
  export declare const lintSpace: (space: SpaceDocuments, options?: LintCatalogs) => LintResult;
5846
7758
 
5847
- export declare const list: {
5848
- (props?: ElementProps<Partial<{
5849
- source?: "none" | "controlled" | undefined;
5850
- items?: unknown[] | undefined;
5851
- subType?: "ul" | "ol" | undefined;
5852
- }>> | undefined): ElementSpec;
5853
- (children: ElementSpec[], props?: ElementProps<Partial<{
5854
- source?: "none" | "controlled" | undefined;
5855
- items?: unknown[] | undefined;
5856
- subType?: "ul" | "ol" | undefined;
5857
- }>> | undefined): ElementSpec;
5858
- };
7759
+ /**
7760
+ * A list's `items` may name the source its rows come from, in their place: `list({ items: 'catalog.data.products' })`
7761
+ * — or be a typed source's path (`items: site.data.grid`), whose `row` is then handed its item typed.
7762
+ */
7763
+ export declare function list<Item>(props: TypedListProps<Item>): ElementSpec;
7764
+
7765
+ export declare function list(props?: ListProps): ElementSpec;
7766
+
7767
+ export declare function list(children: ElementSpec[], props?: ListProps): ElementSpec;
7768
+
7769
+ declare type ListAttributes = AttributesOf<typeof elementDeclarations.List>;
5859
7770
 
5860
7771
  export declare const listItem: {
5861
7772
  (props?: AuthoringProps | undefined): ElementSpec;
5862
7773
  (children: ElementSpec[], props?: AuthoringProps | undefined): ElementSpec;
5863
7774
  };
5864
7775
 
7776
+ declare type ListProps = ElementProps<Omit<ListAttributes, 'items'> & {
7777
+ items?: ListAttributes['items'] | string;
7778
+ }>;
7779
+
7780
+ /** A list's row by its names: short in a binding or `from`, spelled in full in a template or an attribute's token. */
7781
+ export declare interface ListRow {
7782
+ /** The list's own name, as the space knows it. */
7783
+ list: string;
7784
+ /** The source its rows publish, in full: `list_rows`, `carousel_hero`. */
7785
+ source: string;
7786
+ /** The row's item: `rows.item`, and a field of it `` `${r.item}.title` ``. */
7787
+ item: string;
7788
+ /** Its position: `rows.index`. */
7789
+ index: string;
7790
+ /** The same names in full, for a template or an attribute token: `{{ list_rows.item.slug }}`. */
7791
+ inTemplate: {
7792
+ item: string;
7793
+ index: string;
7794
+ };
7795
+ }
7796
+
5865
7797
  /**
5866
7798
  * A driver's locator for an authored element, by name.
5867
7799
  *
@@ -5882,7 +7814,7 @@ export declare interface LocatorSource<L> {
5882
7814
  locator(selector: string): L;
5883
7815
  }
5884
7816
 
5885
- declare type ManifestAsset = {
7817
+ export declare type ManifestAsset = {
5886
7818
  integrity?: string;
5887
7819
  src?: string;
5888
7820
  srcPath?: string;
@@ -5912,6 +7844,9 @@ export declare const modalContainer: {
5912
7844
  }>> | undefined): ElementSpec;
5913
7845
  };
5914
7846
 
7847
+ /** The name of the class an element's own rules on top of its classes become. */
7848
+ export declare const modifierClassName: (elementId: string) => string;
7849
+
5915
7850
  /**
5916
7851
  * Moves one entry between two lists, and does nothing if it is not in the first.
5917
7852
  *
@@ -5944,6 +7879,8 @@ export declare const nodeHtml: ElementFactory<Partial<{
5944
7879
  slot?: string | undefined | undefined;
5945
7880
  title?: string | undefined | undefined;
5946
7881
  defaultValue?: string | number | readonly string[] | undefined;
7882
+ hidden?: boolean | undefined | undefined;
7883
+ onScroll?: UIEventHandler<"span"> | undefined;
5947
7884
  onLoad?: ReactEventHandler<"span"> | undefined;
5948
7885
  onClick?: MouseEventHandler<"span"> | undefined;
5949
7886
  onPointerDown?: PointerEventHandler<"span"> | undefined;
@@ -6152,7 +8089,6 @@ export declare const nodeHtml: ElementFactory<Partial<{
6152
8089
  onGotPointerCaptureCapture?: PointerEventHandler<"span"> | undefined;
6153
8090
  onLostPointerCapture?: PointerEventHandler<"span"> | undefined;
6154
8091
  onLostPointerCaptureCapture?: PointerEventHandler<"span"> | undefined;
6155
- onScroll?: UIEventHandler<"span"> | undefined;
6156
8092
  onScrollCapture?: UIEventHandler<"span"> | undefined;
6157
8093
  onScrollEnd?: UIEventHandler<"span"> | undefined;
6158
8094
  onScrollEndCapture?: UIEventHandler<"span"> | undefined;
@@ -6184,7 +8120,6 @@ export declare const nodeHtml: ElementFactory<Partial<{
6184
8120
  dir?: string | undefined | undefined;
6185
8121
  draggable?: (boolean | "false" | "true") | undefined;
6186
8122
  enterKeyHint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined | undefined;
6187
- hidden?: boolean | undefined | undefined;
6188
8123
  spellCheck?: (boolean | "false" | "true") | undefined;
6189
8124
  translate?: "yes" | "no" | undefined | undefined;
6190
8125
  radioGroup?: string | undefined | undefined;
@@ -6219,12 +8154,10 @@ export declare const nodeHtml: ElementFactory<Partial<{
6219
8154
  subType?: "span" | undefined;
6220
8155
  }>>;
6221
8156
 
6222
- /**
6223
- * The rule that styles the toast container, or `''` when there is nothing to say.
6224
- *
6225
- * Refuses what would not style anything: an unknown field, and a value that is not one CSS value — a `;` or a brace
6226
- * would end the declaration early and let the rest of the text become rules of its own.
6227
- */
8157
+ /** Every field `notifications` takes — what an editor of the setting (the MCP server's `patchSettings`) offers. */
8158
+ export declare const NOTIFICATIONS_FIELDS: readonly (keyof NotificationsSpec)[];
8159
+
8160
+ /** The rule that styles the toast container, or `''` when there is nothing to say; refuses a spec that is not sound. */
6228
8161
  export declare const notificationsCss: (spec: NotificationsSpec | undefined) => string;
6229
8162
 
6230
8163
  /**
@@ -6245,6 +8178,16 @@ export declare interface NotificationsSpec {
6245
8178
  info?: string;
6246
8179
  /** Corner radius, e.g. `'12px'`. */
6247
8180
  radius?: string;
8181
+ /** Its typeface — the space's own, as a token: `'var(--font-sans)'`. */
8182
+ font?: string;
8183
+ /** Its text size, e.g. `'13px'`. */
8184
+ fontSize?: string;
8185
+ /** Its edge, as `border` writes it: `'1px solid var(--border)'`. */
8186
+ border?: string;
8187
+ /** Its depth, as `box-shadow` writes it: `'var(--shadow-lg)'`. */
8188
+ shadow?: string;
8189
+ /** The room inside it, e.g. `'12px 14px'`. */
8190
+ padding?: string;
6248
8191
  }
6249
8192
 
6250
8193
  export declare const on: (trigger: ElementTriggerName | (string & {}), params?: Record<string, unknown>) => StepSpec;
@@ -6263,6 +8206,15 @@ export declare const onFlowError: () => StepSpec;
6263
8206
 
6264
8207
  export declare const onFlowProgress: () => StepSpec;
6265
8208
 
8209
+ /**
8210
+ * Every `ms` milliseconds while the element is on the page and the tab is in view — an autoplay, a clock, a refresh:
8211
+ * `[[onInterval(5000), setState({ key: 'slide', type: 'number', value: '{{ ((state.slide ?? 0) + 1) % 4 }}' })]]`.
8212
+ *
8213
+ * At least 250 ms. It does not tick in the builder outside preview. To pause it, put a condition on its steps
8214
+ * (`when(...)`) — a state an `onMouseEnter` sets, say. `{{ <this step's id>.count }}` is how many times it has ticked.
8215
+ */
8216
+ export declare const onInterval: (ms: number) => StepSpec;
8217
+
6266
8218
  /**
6267
8219
  * A keyboard shortcut, heard on the whole page for as long as the element is mounted: `onKey('f')`,
6268
8220
  * `onKey('shift+f')`, `onKey('mod+k')` (⌘ on a Mac, Ctrl elsewhere), several at once with commas (`onKey('plus, =')`).
@@ -6275,13 +8227,6 @@ export declare const onKey: (keys: string) => StepSpec;
6275
8227
 
6276
8228
  export declare const onLoad: () => StepSpec;
6277
8229
 
6278
- /**
6279
- * A page has this second load event in addition to {@link onLoad}.
6280
- *
6281
- * `onLoad` runs for every mounted element, including a page. `onPageLoad` belongs only to the page and carries its
6282
- * id plus the current route and query params, so it is the one to use when a flow needs to make a decision from the
6283
- * address that brought the visitor here.
6284
- */
6285
8230
  export declare const onPageLoad: () => StepSpec;
6286
8231
 
6287
8232
  /** The press, before it is a click — where a drag away from the element starts. A click still follows it. */
@@ -6313,6 +8258,13 @@ export declare interface OnScreenOptions {
6313
8258
  ignore?: string[];
6314
8259
  }
6315
8260
 
8261
+ /**
8262
+ * The element's own box scrolled; once on mount too. Its flow reads `{ x, y, atStart, atEnd }` — name the trigger
8263
+ * and hide the arrow at the end already reached: `[named('row', onScroll()), setState({ key: 'atEnd', type:
8264
+ * 'boolean', value: '{{ row.atEnd }}' })]`.
8265
+ */
8266
+ export declare const onScroll: () => StepSpec;
8267
+
6316
8268
  /**
6317
8269
  * A form submitting itself, with the values keyed by each control's `name`.
6318
8270
  *
@@ -6345,7 +8297,7 @@ export declare interface PageEvaluator {
6345
8297
  evaluate<R>(fn: (input: ProbeInput) => R, input: ProbeInput): Promise<R>;
6346
8298
  }
6347
8299
 
6348
- declare type PageFolder = {
8300
+ export declare type PageFolder = {
6349
8301
  id: string;
6350
8302
  name: string;
6351
8303
  slug: string;
@@ -6385,6 +8337,13 @@ export declare interface PageHandle extends ElementHandle {
6385
8337
  elements: Record<string, ElementHandle>;
6386
8338
  }
6387
8339
 
8340
+ /**
8341
+ * Runs in the page that was pictured: its parts, where they are on the full page — its landmarks (header, nav, main,
8342
+ * footer, each section and aside), or, on a page that has none, the named blocks right inside the page. Each named by
8343
+ * its tag and its id or element name (`section#plans`, `div#hero`). Self-contained — it is serialised.
8344
+ */
8345
+ export declare const pageRegions: () => PictureRegion[];
8346
+
6388
8347
  export declare interface PageReport {
6389
8348
  /** The page that was inspected, by id. */
6390
8349
  page: string;
@@ -6441,6 +8400,8 @@ export declare interface PageSpec {
6441
8400
  /** As {@link ElementSpec.class} — a shared class instead of a selector of this page's own. */
6442
8401
  class?: ClassList;
6443
8402
  flows?: StepSpec[][];
8403
+ /** As {@link ElementSpec.flag}: a page whose flag says no is not found. */
8404
+ flag?: string;
6444
8405
  body: ElementSpec[];
6445
8406
  }
6446
8407
 
@@ -6477,21 +8438,111 @@ declare type PaginationPageInfo = {
6477
8438
  total?: number;
6478
8439
  };
6479
8440
 
6480
- export declare const paragraph: ElementFactory<Partial<{
6481
- content?: string | number | undefined;
6482
- }>>;
8441
+ export declare const paragraph: ElementFactory<Partial<{
8442
+ content?: string | number | undefined;
8443
+ }>>;
8444
+
8445
+ /**
8446
+ * What a name means in the authoring surface — an element type, a step, a trigger, a problem's code, a transformer —
8447
+ * answered from the catalogues the checks themselves read, so it cannot say anything they do not.
8448
+ *
8449
+ * The question an agent otherwise answers by searching eight thousand lines of `.d.ts`: what does `navigate` take,
8450
+ * what does `onPageLoad` hand its flow, what attributes has a `container`. `plitzi explain` prints it, and the MCP
8451
+ * serves it, from here.
8452
+ */
8453
+ export declare interface ParamInfo {
8454
+ name: string;
8455
+ type: string;
8456
+ description?: string;
8457
+ default?: unknown;
8458
+ options?: readonly string[];
8459
+ required?: boolean;
8460
+ }
8461
+
8462
+ export declare type ParamSpec = Record<string, BuiltinParam>;
8463
+
8464
+ declare const PATH: unique symbol;
8465
+
8466
+ /** The route for a slug: authoring stores it bare, and everything that navigates wants it absolute. */
8467
+ export declare const pathForSlug: (slug: string) => string;
8468
+
8469
+ export declare interface PictureDiff {
8470
+ width: number;
8471
+ height: number;
8472
+ /** The share of pixels that differ, in percent, to one decimal. */
8473
+ changed: number;
8474
+ regions: {
8475
+ name: string;
8476
+ changed: number;
8477
+ }[];
8478
+ /** Both pictures beside each other, and the differences in red over a faded copy of the first — PNG data URLs. */
8479
+ sideBySide: string;
8480
+ diff: string;
8481
+ }
8482
+
8483
+ export declare interface PictureDiffInput {
8484
+ /** The two pictures, as `data:image/png;base64,…` URLs. */
8485
+ a: string;
8486
+ b: string;
8487
+ regions: PictureRegion[];
8488
+ /** How far apart two channels may be and still count as the same pixel (0–255) — anti-aliasing is not a change. */
8489
+ tolerance: number;
8490
+ }
8491
+
8492
+ /** Anything that can run a function in a browser page — Playwright's `Page`, Puppeteer's. */
8493
+ export declare interface PictureDriver {
8494
+ evaluate<R, A>(fn: (input: A) => R | Promise<R>, input: A): Promise<R>;
8495
+ }
8496
+
8497
+ /**
8498
+ * Two pictures of a page compared in numbers — how much differs, overall and in each part of the page — so an agent
8499
+ * reads "footer 2 %, spotlight 14 %" instead of looking at two full screenshots, and opens a picture only where the
8500
+ * numbers say something moved.
8501
+ *
8502
+ * The comparison runs in a browser page (any driver's `evaluate`): a canvas is the one image decoder every driver
8503
+ * already has, so this package stays one that installs nothing.
8504
+ */
8505
+ /** A part of the page, by where it is in the picture: the landmarks a page is read by. */
8506
+ export declare interface PictureRegion {
8507
+ name: string;
8508
+ x: number;
8509
+ y: number;
8510
+ width: number;
8511
+ height: number;
8512
+ }
6483
8513
 
6484
- export declare type ParamSpec = Record<string, BuiltinParam>;
8514
+ /**
8515
+ * `planFixes`, holding the same catalogs: every fix `fixSpace` would make in this declaration, each with the place in
8516
+ * the author's code that wrote the element and the edit that makes the fix there — what `plitzi fix` shows and writes.
8517
+ */
8518
+ export declare const planFixes: (spec: SpaceSpec, options?: AuthorSpaceOptions) => FixPlan;
6485
8519
 
6486
- /** The route for a slug: authoring stores it bare, and everything that navigates wants it absolute. */
6487
- export declare const pathForSlug: (slug: string) => string;
8520
+ /** One fix `fixSpace` would make, with where it was written and the edit that makes it there. */
8521
+ export declare interface PlannedFix {
8522
+ code: string;
8523
+ message: string;
8524
+ elementId: string | null;
8525
+ /** Where the element was written: `src/site/home.ts:42`. Absent for an element no factory wrote. */
8526
+ at?: string;
8527
+ /** The same place exactly — the factory's name, at its line and column — which is what the edit is made at. */
8528
+ position?: WrittenPosition;
8529
+ /** Absent when the fix has no one way to be written in the source — it is said, and left to the author. */
8530
+ edit?: SpecEdit;
8531
+ }
8532
+
8533
+ /** A problem the linter reports, by its code and the element it is on. */
8534
+ export declare interface PlanProblem {
8535
+ code: string;
8536
+ elementId: string | null;
8537
+ message: string;
8538
+ }
6488
8539
 
6489
- declare type PluginBuilder = {
8540
+ export declare type PluginBuilder = {
6490
8541
  canDelete?: boolean;
6491
8542
  canDragDrop?: boolean;
6492
8543
  canSelect?: boolean;
6493
8544
  canMove?: boolean;
6494
- canTemplate?: boolean;
8545
+ canSnippet?: boolean;
6495
8546
  itemsAllowed?: string[];
6496
8547
  itemsNotAllowed?: string[];
6497
8548
  };
@@ -6589,7 +8640,7 @@ export declare interface PluginHostOptions {
6589
8640
  };
6590
8641
  }
6591
8642
 
6592
- declare type PluginManifest = {
8643
+ export declare type PluginManifest = {
6593
8644
  assets: Record<string, ManifestAsset>;
6594
8645
  assetsSettings: Record<string, ManifestAsset>;
6595
8646
  author: string;
@@ -6615,7 +8666,7 @@ declare type PluginManifest = {
6615
8666
  version: string;
6616
8667
  };
6617
8668
 
6618
- declare type PluginSchema = {
8669
+ export declare type PluginSchema = {
6619
8670
  attributes: Element_2['attributes'];
6620
8671
  builder: PluginBuilder;
6621
8672
  initialItems?: string[];
@@ -6689,6 +8740,12 @@ declare type ProviderPagination = 'none' | 'url' | 'append';
6689
8740
  */
6690
8741
  export declare const publishOn: (target: string, type: string, data?: unknown) => StepSpec;
6691
8742
 
8743
+ /** The page's dev tools, read: the flows that ran and, when asked, the state, the sources and one element. */
8744
+ export declare const readDevTools: (driver: DevToolsDriver, input: DevToolsInput) => Promise<DevToolsReport>;
8745
+
8746
+ /** Runs in the page. Self-contained — it is serialised — and it trusts nothing it reads off `window`. */
8747
+ export declare const readDevToolsInPage: ({ state, element }: DevToolsInput) => DevToolsReport;
8748
+
6692
8749
  /** Reconcile supplied params to a catalog schema: drop unknown keys when the set is CLOSED (strict), then fill the
6693
8750
  * builder's defaults for any declared param the agent omitted whose `when` guard holds. Mirrors what the builder
6694
8751
  * stores, so the persisted node round-trips cleanly. */
@@ -6696,17 +8753,22 @@ export declare const reconcileParams: (params: Record<string, unknown>, spec: Pa
6696
8753
 
6697
8754
  export declare const reference: {
6698
8755
  (props?: ElementProps<Partial<{
6699
- referenceType: ElementLayoutType;
6700
8756
  referenceId: string;
6701
- referenceContainer: string;
8757
+ referenceType: "element" | "component";
6702
8758
  }>> | undefined): ElementSpec;
6703
8759
  (children: ElementSpec[], props?: ElementProps<Partial<{
6704
- referenceType: ElementLayoutType;
6705
8760
  referenceId: string;
6706
- referenceContainer: string;
8761
+ referenceType: "element" | "component";
6707
8762
  }>> | undefined): ElementSpec;
6708
8763
  };
6709
8764
 
8765
+ export declare type RefusalCode = {
8766
+ [Code in AuthoringCode]: Codes[Code]['kind'] extends 'refused' ? Code : never;
8767
+ }[AuthoringCode];
8768
+
8769
+ /** What a thrown problem says as a refusal: its code and sentence when it is an `AuthoringError`, its message otherwise. */
8770
+ export declare const refusalOf: (error: unknown) => Pick<SpaceRefusal, "code" | "message">;
8771
+
6710
8772
  /**
6711
8773
  * Asks an `apiContainer` to fetch again, by id.
6712
8774
  *
@@ -6723,7 +8785,7 @@ export declare const reloadApi: (target: string, input?: Record<string, string>)
6723
8785
 
6724
8786
  /** Someone else's origin — Adobe Fonts, Bunny, Fontshare, the customer's own CDN. Either a
6725
8787
  * stylesheet that declares the faces, or the files themselves. */
6726
- declare type RemoteFont = FontBase & {
8788
+ export declare type RemoteFont = FontBase & {
6727
8789
  source: 'remote';
6728
8790
  stylesheet?: string;
6729
8791
  files?: (FontFace_2 & {
@@ -6794,7 +8856,7 @@ export declare const resetForm: (target: string) => StepSpec;
6794
8856
  * Both halves being wrong is the same failure and it is the quietest one this surface has: the binding resolves
6795
8857
  * to nothing, the element renders its placeholder, and every layer below considers the document perfectly valid.
6796
8858
  */
6797
- export declare const resolveSource: (source: string, index: SourceIndex, where: string) => string;
8859
+ export declare const resolveSource: (source: string, index: SourceIndex, where: string, globals?: readonly string[]) => string;
6798
8860
 
6799
8861
  /** A selector's whole block per breakpoint, as it reaches the document. */
6800
8862
  export declare type ResponsiveBlock = Partial<Record<DisplayMode, StyleBlock>>;
@@ -6813,6 +8875,9 @@ export declare type ResponsiveCss = Partial<Record<DisplayMode | 'compact', CssP
6813
8875
  /** Per-breakpoint CSS as it reaches the document. */
6814
8876
  export declare type ResponsiveStyle = Partial<Record<DisplayMode, StyleRules>>;
6815
8877
 
8878
+ /** One property's value per breakpoint — `{ desktop: '24px', mobile: '18px' }` — inside a plain rule set. */
8879
+ export declare type ResponsiveValue = Partial<Record<DisplayMode | 'compact', StyleValue>>;
8880
+
6816
8881
  export declare const richText: ElementFactory<Partial<{
6817
8882
  format?: "html" | "markdown" | "text" | undefined;
6818
8883
  content?: string | undefined;
@@ -6821,6 +8886,9 @@ export declare const richText: ElementFactory<Partial<{
6821
8886
 
6822
8887
  export declare const row: (gap: string, extra?: CssProps) => StyleRules;
6823
8888
 
8889
+ /** What a list's `row` function is: handed the row's names, it writes what the row renders. */
8890
+ export declare type RowWriter<Row> = (row: Row) => ElementSpec | ElementSpec[];
8891
+
6824
8892
  export declare type Rule = {
6825
8893
  id?: string;
6826
8894
  field: string;
@@ -6896,13 +8964,15 @@ export declare const runServerAction: (params: {
6896
8964
  /** Whether two normalised selectors say the same thing, whatever order they were written in. */
6897
8965
  export declare const sameBlocks: (a: ResponsiveBlock, b: ResponsiveBlock) => boolean;
6898
8966
 
6899
- declare type Schema = {
8967
+ export declare type Schema = {
6900
8968
  flat: Record<string, Element_2>;
6901
8969
  definition: {
6902
8970
  name: string;
6903
8971
  permanentUrl: string;
6904
8972
  };
6905
8973
  variables: SchemaVariable[];
8974
+ /** Keyed by the name each is read by. A space that declares none has none — documents written before flags too. */
8975
+ flags?: Record<string, SchemaFlag>;
6906
8976
  settings: {
6907
8977
  keepState?: boolean;
6908
8978
  stateStorage?: 'localStorage' | 'sessionStorage';
@@ -6996,6 +9066,7 @@ declare type Schema = {
6996
9066
  rsc?: SchemaRsc;
6997
9067
  pages: Element_2['id'][];
6998
9068
  pageFolders: PageFolder[];
9069
+ components: Record<SpaceComponent['id'], SpaceComponent>;
6999
9070
  };
7000
9071
 
7001
9072
  /**
@@ -7005,20 +9076,47 @@ declare type Schema = {
7005
9076
  */
7006
9077
  export declare const SCHEMA_SETTINGS: readonly ["keepState", "stateStorage", "transientState", "paintedState", "customCss", "visitorRoles", "userProvider", "tokenStorage", "loginUrl", "userUrl", "refreshUrl", "logoutUrl", "detailsPath", "tokenPath", "refreshTokenPath", "expirationTimePath", "refreshExpirationTimePath", "sessionHintCookie", "sessionExchangeUrl", "mfaUrl", "sessionGate", "sessionRevalidateSeconds", "debugMode", "computed", "channels"];
7007
9078
 
7008
- declare type SchemaRsc = {
9079
+ /**
9080
+ * A feature flag the space declares, under the name it is read by: `{{ flags.newCheckout }}`.
9081
+ *
9082
+ * Read with the document, stored apart from it: each environment has one set, shared by every revision it serves, so a
9083
+ * flag is turned without a new revision and a rollback keeps the flags as they are. A revision keeps a copy of the flags
9084
+ * it was published with, read only when the environment's own cannot be. The draft (`main`) applies whatever it says
9085
+ * now; a published environment, what was last published to it. Its rules see the environment, the host, the URL and
9086
+ * who is visiting (`user.authenticated`, `user.email`, `user.username`, `user.roles`). Whoever runs the space may
9087
+ * override the answer — the server it is rendered by, then the SDK embedding it, then a tester with the dev tools —
9088
+ * but only for flags declared here.
9089
+ */
9090
+ export declare type SchemaFlag = {
9091
+ description?: string;
9092
+ /** The answer when no rule matches. */
9093
+ value: boolean;
9094
+ rules: SchemaFlagRule[];
9095
+ };
9096
+
9097
+ /** A value a flag takes where its `when` matches. The first rule that matches decides. */
9098
+ export declare type SchemaFlagRule = {
9099
+ when: RuleGroup;
9100
+ value: boolean;
9101
+ };
9102
+
9103
+ export declare type SchemaRsc = {
7009
9104
  enabled?: boolean;
7010
9105
  /** Wire protocol for RSC updates. 'json' is the default (data-only). 'stream' uses the RSC wire format (requires react-server condition). */
7011
9106
  transport?: 'json' | 'stream';
7012
9107
  };
7013
9108
 
7014
- declare type SchemaValidationError = {
9109
+ export declare type SchemaValidationError = {
7015
9110
  code: string;
7016
9111
  message: string;
7017
9112
  elementId?: string;
9113
+ /** The component whose tree the error is in; absent for the pages' tree. */
9114
+ componentId?: string;
7018
9115
  details?: unknown;
7019
9116
  };
7020
9117
 
7021
- declare type SchemaValidationOptions = {
9118
+ export declare type SchemaValidationOptions = {
9119
+ /** Validates `flat` as a fragment hung off this element — a component's tree — instead of as the pages' tree. */
7022
9120
  baseElementId?: string;
7023
9121
  /**
7024
9122
  * Element type → the source name it publishes under.
@@ -7030,13 +9128,13 @@ declare type SchemaValidationOptions = {
7030
9128
  sourceTypes?: Record<string, string>;
7031
9129
  };
7032
9130
 
7033
- declare type SchemaValidationResult = {
9131
+ export declare type SchemaValidationResult = {
7034
9132
  valid: boolean;
7035
9133
  errors: SchemaValidationError[];
7036
9134
  warnings: SchemaValidationError[];
7037
9135
  };
7038
9136
 
7039
- declare type SchemaVariable = SchemaVariableBase<'number', number> | SchemaVariableBase<'checkbox' | 'switch', boolean> | SchemaVariableBase<'text' | 'email' | 'password' | 'select' | 'select2' | 'textarea' | 'color', string>;
9137
+ export declare type SchemaVariable = SchemaVariableBase<'number', number> | SchemaVariableBase<'checkbox' | 'switch', boolean> | SchemaVariableBase<'text' | 'email' | 'password' | 'select' | 'select2' | 'textarea' | 'color', string>;
7040
9138
 
7041
9139
  declare type SchemaVariableBase<TType extends string, TValue> = {
7042
9140
  name: string;
@@ -7049,6 +9147,117 @@ declare type SchemaVariableBase<TType extends string, TValue> = {
7049
9147
  }[];
7050
9148
  };
7051
9149
 
9150
+ /**
9151
+ * Builds a part of the space whose ids are its own: every `id` given inside is prefixed — `scope('promos', ref => …)`
9152
+ * makes `id: 'panel'` the element `promos-panel` — so a helper that writes the same block twice writes two sets of ids,
9153
+ * not one id twice. `ref('slides')` is the full name, for whatever names a scoped element: a binding, a step's target,
9154
+ * a template (`` `{{ list_${ref('slides')}.index }}` ``). Scopes nest; a list's `row` already reads its list's full name.
9155
+ */
9156
+ export declare const scope: <T>(prefix: string, build: (ref: (id: string) => string) => T) => T;
9157
+
9158
+ declare const SCROLL_BEHAVIORS: readonly ["smooth", "auto"];
9159
+
9160
+ /**
9161
+ * Moving what an element shows, on the element whose box scrolls (`overflow: auto` on a row of cards, a panel) — or,
9162
+ * with `scrollIntoView`, the page to an element. Arrows over a carousel that still swipes on a phone, a "back to the
9163
+ * top", a jump to the answer a form just showed. Its node names the element that moves; nothing happens where there is
9164
+ * no page to move (a server render).
9165
+ */
9166
+ export declare const SCROLL_CALLBACKS: {
9167
+ scrollBy: {
9168
+ title: string;
9169
+ type: "callback";
9170
+ strictParams: true;
9171
+ params: {
9172
+ x: {
9173
+ type: "text";
9174
+ description: string;
9175
+ default: string;
9176
+ };
9177
+ y: {
9178
+ type: "text";
9179
+ description: string;
9180
+ default: string;
9181
+ };
9182
+ behavior: BuiltinParam;
9183
+ };
9184
+ };
9185
+ scrollTo: {
9186
+ title: string;
9187
+ type: "callback";
9188
+ strictParams: true;
9189
+ params: {
9190
+ x: {
9191
+ type: "text";
9192
+ description: string;
9193
+ default: string;
9194
+ };
9195
+ y: {
9196
+ type: "text";
9197
+ description: string;
9198
+ default: string;
9199
+ };
9200
+ behavior: BuiltinParam;
9201
+ };
9202
+ };
9203
+ scrollIntoView: {
9204
+ title: string;
9205
+ type: "callback";
9206
+ strictParams: true;
9207
+ params: {
9208
+ block: {
9209
+ type: "select";
9210
+ description: string;
9211
+ default: string;
9212
+ options: ("start" | "center" | "end" | "nearest")[];
9213
+ };
9214
+ inline: {
9215
+ type: "select";
9216
+ description: string;
9217
+ default: string;
9218
+ options: ("start" | "center" | "end" | "nearest")[];
9219
+ };
9220
+ behavior: BuiltinParam;
9221
+ };
9222
+ };
9223
+ };
9224
+
9225
+ /** Where `scrollIntoView` lands an element, on each axis. */
9226
+ declare const SCROLL_POSITIONS: readonly ["start", "center", "end", "nearest"];
9227
+
9228
+ /**
9229
+ * Moves what an element's box shows — a row of cards with `overflow: auto`, a panel — by an amount: pixels (`'240'`) or
9230
+ * a share of what the box shows (`'80%'`); negative goes back. `target` is the element whose box scrolls.
9231
+ *
9232
+ * `[onClick(), scrollBy('cards', { x: '80%' })]` is the "next" arrow over a row that still swipes on a phone.
9233
+ */
9234
+ declare const scrollBy_2: (target: string, move: ScrollMove) => StepSpec;
9235
+ export { scrollBy_2 as scrollBy }
9236
+
9237
+ /**
9238
+ * Brings an element into view — the page, and every box around it that scrolls. For a link to a part of the page,
9239
+ * an `anchor` and a link's `hash` say it without a flow; this is for a flow that has more to do.
9240
+ */
9241
+ export declare const scrollIntoView: (target: string, where?: {
9242
+ block?: ScrollStepPosition;
9243
+ inline?: ScrollStepPosition;
9244
+ behavior?: ScrollStepBehavior;
9245
+ }) => StepSpec;
9246
+
9247
+ declare type ScrollMove = {
9248
+ x?: string;
9249
+ y?: string;
9250
+ behavior?: ScrollStepBehavior;
9251
+ };
9252
+
9253
+ declare type ScrollStepBehavior = (typeof SCROLL_BEHAVIORS)[number];
9254
+
9255
+ declare type ScrollStepPosition = (typeof SCROLL_POSITIONS)[number];
9256
+
9257
+ /** Moves an element's box to a place: `'start'`, `'end'`, pixels from the start, or a share of the way (`'50%'`). */
9258
+ declare const scrollTo_2: (target: string, place: ScrollMove) => StepSpec;
9259
+ export { scrollTo_2 as scrollTo }
9260
+
7052
9261
  export declare const selectorFor: (id: string) => string;
7053
9262
 
7054
9263
  /**
@@ -7108,9 +9317,106 @@ export declare const singlePageSpace: (body: ElementSpec[], space?: Partial<Omit
7108
9317
  */
7109
9318
  export declare const slugify: (value: string, fallback: string) => string;
7110
9319
 
9320
+ /**
9321
+ * A published snippet: a subtree, the style that dresses it, and the element a builder instantiates.
9322
+ *
9323
+ * The artefact someone hosts when they are not building a space — fetched by URL, shown in the Resources panel,
9324
+ * dragged onto a canvas — which is why it lives beside the schema and the style rather than with the builder's own
9325
+ * types: it is a document, produced and consumed by processes that never open a builder.
9326
+ */
9327
+ export declare type Snippet = {
9328
+ id?: string;
9329
+ definition: {
9330
+ name: string;
9331
+ description: string;
9332
+ /** Root of what travels. Its subtree is the whole of `schema.flat`, and it answers to no parent. */
9333
+ baseElementId: Element_2['id'];
9334
+ };
9335
+ /**
9336
+ * Only what travels: the subtree and the variables its rules read. Nothing else of the space it was cut from — its
9337
+ * pages, settings or components — comes along, and a builder showing or dropping it reads nothing else.
9338
+ */
9339
+ schema: Pick<Schema, 'flat' | 'variables'>;
9340
+ style: Style;
9341
+ };
9342
+
9343
+ /**
9344
+ * What a snippet author declares: a name, a description and a subtree.
9345
+ *
9346
+ * The style half is declared exactly as a space declares it — the classes the subtree names, the element defaults
9347
+ * it relies on, the variables its rules read — because that is precisely what has to TRAVEL with it. A snippet
9348
+ * that names a class the space it lands in happens not to declare renders unstyled, so anything the subtree reads
9349
+ * is carried in the manifest rather than assumed.
9350
+ */
9351
+ export declare interface SnippetSpec {
9352
+ name: string;
9353
+ description: string;
9354
+ /**
9355
+ * What this snippet's ids are derived from, as `permanentUrl` is for a space. Defaults to a slug of the name.
9356
+ *
9357
+ * Ids are re-generated when the snippet is dropped into a space, so this decides nothing at run time — it
9358
+ * decides only that authoring the same snippet twice writes the same file.
9359
+ */
9360
+ key?: string;
9361
+ variables?: Partial<StyleVariables>;
9362
+ /** As {@link SpaceSpec.classes}. Every class the subtree names has to be declared here, or it does not travel. */
9363
+ classes?: Record<string, StyleSpec | StyleDeclaration>;
9364
+ elements?: Record<string, ElementStyleSpec>;
9365
+ schemaVariables?: SchemaVariable[];
9366
+ mode?: Style['mode'];
9367
+ theme?: Style['theme'];
9368
+ /** The subtree, and its root is the element a builder instantiates. */
9369
+ root: ElementSpec;
9370
+ }
9371
+
9372
+ /**
9373
+ * The `apiContainer` with this id as a typed source, its `data` typed — and checked — by a sample of the answer: the
9374
+ * JSON file the query reads, imported (`import home from './home.json' with { type: 'json' }`):
9375
+ *
9376
+ * ```ts
9377
+ * const site = source('site', home);
9378
+ * apiContainer({ id: site.id, query: '/data/home.json', children: [heading({ from: site.data.hero.title })] });
9379
+ * ```
9380
+ *
9381
+ * A path the sample does not have is a type error, and refused (`source-field-unknown`) where the types were not
9382
+ * looking. Nothing of the sample is written into the space. Inside a `scope()`, the id is the scoped one, as the
9383
+ * element's is.
9384
+ */
9385
+ export declare const source: <Data>(id: string, sample: Data) => SourcePath<ApiContainerSource<Data>> & {
9386
+ readonly id: string;
9387
+ };
9388
+
9389
+ /** What every path to a source's value is, whatever it leads to. */
9390
+ declare interface SourceBrand {
9391
+ readonly [PATH]: string;
9392
+ /** The full name: `String(site.data.total)`. */
9393
+ toString(): string;
9394
+ }
9395
+
7111
9396
  /** What an element publishes: the source prefix its type registers under, by the id it was given. */
7112
9397
  export declare type SourceIndex = Map<string, string>;
7113
9398
 
9399
+ /** A source's name: written by hand (`'catalog.data.products'`), or reached through {@link source}. */
9400
+ export declare type SourceName = string | SourceBrand;
9401
+
9402
+ /**
9403
+ * A path into a source, typed by a sample of what it holds: `site.data.hero.title` is the name
9404
+ * `apiContainer_site.data.hero.title`. A field the sample does not have is a type error where it is written. It is
9405
+ * the full name, so it reads the same in `from`, `items`, `bind` and a template (`` `{{ ${site.data.total} }}` ``); an
9406
+ * item of a list is `.0`, `.1` — `site.data.sections[1]`.
9407
+ */
9408
+ export declare type SourcePath<T> = SourceBrand & (T extends readonly (infer Item)[] ? {
9409
+ readonly [index: number]: SourcePath<Item>;
9410
+ } : T extends object ? {
9411
+ readonly [Key in keyof T]-?: SourcePath<T[Key]>;
9412
+ } : unknown);
9413
+
9414
+ /** The row of a list fed by a typed source: its item as the sample's item, its position as a number. */
9415
+ export declare interface SourceRow<Item> {
9416
+ item: SourcePath<Item>;
9417
+ index: SourcePath<number>;
9418
+ }
9419
+
7114
9420
  /**
7115
9421
  * Which element types publish a data source, and under what name.
7116
9422
  *
@@ -7120,7 +9426,7 @@ export declare type SourceIndex = Map<string, string>;
7120
9426
  export declare type SourceTypes = Record<string, string>;
7121
9427
 
7122
9428
  /** The same guarantee for the space itself, in the order its fields are written. */
7123
- export declare const SPACE_FIELDS: readonly ["name", "permanentUrl", "mode", "theme", "variables", "fonts", "elements", "classes", "schemaVariables", "settings", "computed", "channels", "customCss", "notifications", "rsc", "pageFolders", "layouts", "pages"];
9429
+ export declare const SPACE_FIELDS: readonly ["name", "permanentUrl", "mode", "theme", "variables", "fonts", "elements", "classes", "schemaVariables", "settings", "computed", "formats", "flags", "channels", "customCss", "notifications", "rsc", "pageFolders", "layouts", "components", "pages"];
7124
9430
 
7125
9431
  /**
7126
9432
  * The `space` source, which the SDK application registers rather than this package.
@@ -7132,7 +9438,29 @@ export declare const SPACE_FIELDS: readonly ["name", "permanentUrl", "mode", "th
7132
9438
  */
7133
9439
  export declare const spaceCallbacks: Record<string, BuiltinGlobalCallback>;
7134
9440
 
7135
- declare type SpaceCredentialProvider = 's3' | 'r2' | 'ssr' | 'custom' | 'smtp';
9441
+ /**
9442
+ * A reusable subtree of the space: declared once, placed on any page as an instance (a `reference` element with
9443
+ * `referenceType: 'component'`), and versioned, published and copied with the space because it is part of it.
9444
+ *
9445
+ * Its tree is a `flat` of its own rather than roots inside `schema.flat`: that one is the tree of the pages, and a
9446
+ * component belongs to none. Ids are still one namespace across every tree, so an id alone says which tree it is in.
9447
+ */
9448
+ export declare type SpaceComponent = {
9449
+ /** The key it is stored under, and what an instance names in `referenceId`. */
9450
+ id: string;
9451
+ label?: string;
9452
+ /** The page folder the builder files it under. It routes nothing: a component has no URL of its own. */
9453
+ folder?: string;
9454
+ /** What an instance hands in, each as an attribute of the instance; read inside as `{{ props.<name> }}`. */
9455
+ props?: Record<string, ComponentProp>;
9456
+ /** Elements of `flat` an instance fills with its children, each child naming the one it goes in (`slot`). */
9457
+ slots?: Element_2['id'][];
9458
+ rootId: Element_2['id'];
9459
+ /** `rootId` with no parent, and everything under it. */
9460
+ flat: Record<Element_2['id'], Element_2>;
9461
+ };
9462
+
9463
+ export declare type SpaceCredentialProvider = 's3' | 'r2' | 'ssr' | 'custom' | 'smtp';
7136
9464
 
7137
9465
  /**
7138
9466
  * Whether two pairs of space documents render the same space.
@@ -7165,7 +9493,7 @@ export declare interface SpaceDocuments {
7165
9493
  style: Style;
7166
9494
  }
7167
9495
 
7168
- declare type SpaceFont = SystemFont | GoogleFont | RemoteFont | HostedFont;
9496
+ export declare type SpaceFont = SystemFont | GoogleFont | RemoteFont | HostedFont;
7169
9497
 
7170
9498
  export declare interface SpaceHandles {
7171
9499
  /** The pages, by id. */
@@ -7185,6 +9513,32 @@ export declare interface SpaceHandles {
7185
9513
  page(idOrSlug: string): PageHandle;
7186
9514
  }
7187
9515
 
9516
+ /** One element `authorSpace` could not write: where to find it, and why. */
9517
+ export declare type SpaceRefusal = {
9518
+ /** The nearest named element and the steps from it — `"store-footer" › container[1]`. Empty for the space itself. */
9519
+ place: string;
9520
+ /** The line of the author's own code that wrote it — `src/site/layout.ts:417` — when a factory recorded one. */
9521
+ at?: string;
9522
+ /** What `authoring-errors.md` files it under — a code of `AUTHORING_CODES`, or a structural one of `validateSchema`. */
9523
+ code?: string;
9524
+ message: string;
9525
+ };
9526
+
9527
+ /**
9528
+ * Everything `authorSpace` refused in one run, rather than the first thing: an author fixes the lot in one pass instead
9529
+ * of discovering them one corrected run at a time. `refusals` holds them as data, for a tool that prints its own.
9530
+ */
9531
+ export declare class SpaceRefusedError extends Error {
9532
+ readonly refusals: readonly SpaceRefusal[];
9533
+ /**
9534
+ * `linted: false` when elements had to be left out: the documents are not whole, so the space's other checks — the
9535
+ * ones that read what the elements mean — wait for these to be fixed rather than report what is merely missing.
9536
+ */
9537
+ constructor(space: string, refusals: readonly SpaceRefusal[], { linted }?: {
9538
+ linted?: boolean;
9539
+ });
9540
+ }
9541
+
7188
9542
  export declare interface SpaceSpec {
7189
9543
  name: string;
7190
9544
  permanentUrl: string;
@@ -7226,6 +9580,35 @@ export declare interface SpaceSpec {
7226
9580
  * element's source (a list row, a provider) is not readable here: bind that on the element.
7227
9581
  */
7228
9582
  computed?: Record<string, string>;
9583
+ /**
9584
+ * Templates by name, for what an element shows of its data: `formats: { price: "{{ source|currency('USD') }}" }`
9585
+ * once, then `text({ from: 'products.item.price', as: 'price' })` anywhere. `source` is the value `from` reads.
9586
+ */
9587
+ formats?: Record<string, string>;
9588
+ /**
9589
+ * The space's feature flags, by the name each is read by — `{{ flags.newCheckout }}` in a binding or a `when`, and
9590
+ * what an element's or a page's `flag` names:
9591
+ *
9592
+ * ```ts
9593
+ * flags: {
9594
+ * newCheckout: {
9595
+ * description: 'The one-step checkout',
9596
+ * value: false,
9597
+ * rules: [
9598
+ * { when: { combinator: 'and', rules: [{ field: 'environment', operator: '=', value: 'staging' }] }, value: true },
9599
+ * { when: { combinator: 'and', rules: [{ field: 'user.roles', operator: 'contains', value: 'beta' }] }, value: true }
9600
+ * ]
9601
+ * }
9602
+ * }
9603
+ * ```
9604
+ *
9605
+ * `value` is the answer when no rule matches; the first rule that matches decides otherwise. A rule sees
9606
+ * `environment`, `hostname`, `routeParams.*`, `queryParams.*` and the visitor (`user.authenticated`, `user.email`,
9607
+ * `user.username`, `user.roles`). Kept apart from the space's snapshots — one set per environment, turned without a
9608
+ * new snapshot — and served with Plitzi down from a self-hosted server's cache. The server rendering it, the SDK
9609
+ * 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`.
9610
+ */
9611
+ flags?: Schema['flags'];
7229
9612
  /**
7230
9613
  * The realtime channels the space offers, by topic pattern — what a `channel` element's `topic` must match:
7231
9614
  *
@@ -7266,6 +9649,8 @@ export declare interface SpaceSpec {
7266
9649
  pageFolders?: PageFolderSpec[];
7267
9650
  /** Shells pages render inside. See {@link LayoutSpec}. */
7268
9651
  layouts?: LayoutSpec[];
9652
+ /** Reusable subtrees, placed with {@link component}. See {@link ComponentSpec}. */
9653
+ components?: ComponentSpec[];
7269
9654
  pages: PageSpec[];
7270
9655
  }
7271
9656
 
@@ -7294,6 +9679,19 @@ export declare interface SpecCorrection {
7294
9679
  */
7295
9680
  export declare type SpecCorrectionCode = 'legacy-element-id' | 'legacy-element-type' | 'unknown-element-type' | 'dropped-field' | 'dropped-attribute' | 'fixed-attribute' | 'dropped-setting' | 'missing-element' | 'unreachable-element' | 'folded-state-selector' | 'dropped-selector' | 'unwritable-css' | 'folded-custom-css' | 'unknown-style-state' | 'broken-binding' | 'fixed-binding-source' | 'broken-flow' | 'dead-flow' | 'dead-step' | 'fixed-global-callback' | 'dropped-initial-state' | 'dropped-param' | 'missing-folder' | 'broken-layout';
7296
9681
 
9682
+ /**
9683
+ * A fix's change as an edit of the source that wrote the element: the same change, on the props of the call that wrote
9684
+ * it — or on one of its steps, by the flow it is in and its place there.
9685
+ */
9686
+ export declare interface SpecEdit extends Omit<FixChange, 'on'> {
9687
+ on: 'attribute' | 'field' | 'binding' | 'step';
9688
+ /** For a step: which of the element's `flows`, and which step in it. */
9689
+ step?: {
9690
+ flow: number;
9691
+ index: number;
9692
+ };
9693
+ }
9694
+
7297
9695
  export declare interface SpecFromSpace {
7298
9696
  spec: SpaceSpec;
7299
9697
  corrections: SpecCorrection[];
@@ -7358,14 +9756,39 @@ export declare interface SpecSourceOptions {
7358
9756
  * thousands of elements wants: a page is then something one can open.
7359
9757
  */
7360
9758
  split?: boolean;
9759
+ /**
9760
+ * What a split file's import of another one ends in: nothing for a bundler, which resolves `./styles` itself; `.ts`
9761
+ * for a project Node runs by stripping the types, which imports a file by its name (`plitzi create --from`).
9762
+ */
9763
+ importExtension?: '' | '.ts';
7361
9764
  }
7362
9765
 
7363
9766
  /** Writes a spec out as source files. See {@link SpecSourceOptions}. */
7364
9767
  export declare const specToSource: (spec: SpaceSpec, options: SpecSourceOptions) => SpecSourceFiles;
7365
9768
 
9769
+ /** An element's class list taken apart: the classes it wears, and the rules of its own written on top of them. */
9770
+ export declare const splitClassList: (value: ElementClassList) => {
9771
+ refs: ClassRef[];
9772
+ modifiers: StyleSpec[];
9773
+ };
9774
+
9775
+ /**
9776
+ * A space's custom CSS read apart: the notifications' rule {@link notificationsCss} wrote, back as the spec, and the
9777
+ * space's own CSS without it — so an editor shows and changes each on its own, and writes them together again with
9778
+ * {@link withNotificationsCss}. A rule someone edited into something else (a declaration that is no field's) is left
9779
+ * where it is, as the space's own CSS: read back, it would lose what was added to it.
9780
+ */
9781
+ export declare const splitNotificationsCss: (customCss: string) => {
9782
+ notifications: NotificationsSpec;
9783
+ customCss: string;
9784
+ };
9785
+
7366
9786
  /** Rules for the states a selector reacts to — `hover`, `focus`, `active` — each one plain or per breakpoint. */
7367
9787
  export declare type StatesSpec = Partial<Record<StyleState, CssSpec>>;
7368
9788
 
9789
+ /** A number a step adds or ends at: written as is, or a template expression (`'apiContainer_site.data.products|length'`). */
9790
+ declare type StepNumber = number | string;
9791
+
7369
9792
  /**
7370
9793
  * What an author declares, as opposed to what a document stores.
7371
9794
  *
@@ -7397,6 +9820,17 @@ export declare interface StepSpec {
7397
9820
  whileRunning?: ElementInteraction['whileRunning'];
7398
9821
  }
7399
9822
 
9823
+ /**
9824
+ * Moves a number in state by `by`, stopping at `min` and `max` rather than going round — "show 40 more" up to the
9825
+ * total. Each bound a number or an expression for one, as in {@link cycleState}.
9826
+ */
9827
+ export declare const stepState: (params: {
9828
+ key: string;
9829
+ by: StepNumber;
9830
+ min?: StepNumber;
9831
+ max?: StepNumber;
9832
+ }) => StepSpec;
9833
+
7400
9834
  /**
7401
9835
  * What a step is allowed to name, supplied by whoever owns the vocabulary.
7402
9836
  *
@@ -7439,7 +9873,7 @@ export declare interface StepVocabulary {
7439
9873
  }>;
7440
9874
  }
7441
9875
 
7442
- declare type Style = {
9876
+ export declare type Style = {
7443
9877
  platform: Record<DisplayMode, Record<string, StyleItem>>;
7444
9878
  mode?: StyleMode;
7445
9879
  theme: {
@@ -7466,30 +9900,34 @@ export declare const STYLE_STATES: readonly StyleState[];
7466
9900
  * `focus-visible` is the focus ring a keyboard user needs and a mouse user does not; `focus-within` dresses a
7467
9901
  * container while anything inside it has focus — a field wrapper around its input.
7468
9902
  *
9903
+ * `current` is the link to the page being shown — the navigation item of where the visitor is. The link says so itself
9904
+ * (`aria-current="page"`, what a screen reader announces too), so a header written once in a layout marks the right item
9905
+ * on every page, which a class chosen per page could not.
9906
+ *
7469
9907
  * `hidden` is not a pseudo-class: it is how an element looks while its `visible` says no — where it goes as it hides,
7470
9908
  * and where it comes from as it shows. With a transition on the class (`display` among what it transitions, and
7471
9909
  * `transition-behavior: allow-discrete`), a panel fades or slides in and out instead of blinking.
7472
9910
  */
7473
- declare const STYLE_STATES_2: readonly ["hover", "focus", "focus-visible", "focus-within", "active", "disabled", "checked", "visited", "hidden"];
9911
+ declare const STYLE_STATES_2: readonly ["hover", "focus", "focus-visible", "focus-within", "active", "disabled", "checked", "visited", "current", "hidden"];
7474
9912
 
7475
- declare type StyleAncestor = {
9913
+ export declare type StyleAncestor = {
7476
9914
  default?: StyleObject;
7477
9915
  states?: StyleStates;
7478
9916
  variants?: StyleVariants;
7479
9917
  };
7480
9918
 
7481
- declare type StyleAncestors = Record<string, StyleAncestor>;
9919
+ export declare type StyleAncestors = Record<string, StyleAncestor>;
7482
9920
 
7483
- declare type StyleAttributes = Record<string, StyleBlock>;
9921
+ export declare type StyleAttributes = Record<string, StyleBlock>;
7484
9922
 
7485
- declare type StyleBlock = {
9923
+ export declare type StyleBlock = {
7486
9924
  default?: StyleObject;
7487
9925
  states?: StyleStates;
7488
9926
  variants?: StyleVariants;
7489
9927
  ancestors?: StyleAncestors;
7490
9928
  };
7491
9929
 
7492
- declare type StyleCategory = (typeof styleConstants)[keyof typeof styleConstants];
9930
+ export declare type StyleCategory = (typeof styleConstants)[keyof typeof styleConstants];
7493
9931
 
7494
9932
  declare const styleConstants: {
7495
9933
  readonly DISPLAY: "display";
@@ -7593,6 +10031,11 @@ declare const styleConstants: {
7593
10031
  readonly APPEARANCE: "appearance";
7594
10032
  readonly SCROLL_BEHAVIOR: "scroll-behavior";
7595
10033
  readonly OVERSCROLL_BEHAVIOR: "overscroll-behavior";
10034
+ readonly SCROLL_SNAP_TYPE: "scroll-snap-type";
10035
+ readonly SCROLL_SNAP_ALIGN: "scroll-snap-align";
10036
+ readonly SCROLL_SNAP_STOP: "scroll-snap-stop";
10037
+ readonly SCROLL_PADDING_TOP: "scroll-padding-top";
10038
+ readonly SCROLL_MARGIN_TOP: "scroll-margin-top";
7596
10039
  readonly ACCENT_COLOR: "accent-color";
7597
10040
  readonly CARET_COLOR: "caret-color";
7598
10041
  readonly COLOR_SCHEME: "color-scheme";
@@ -7681,7 +10124,7 @@ export declare interface StyleDeclaration {
7681
10124
  toString(): string;
7682
10125
  }
7683
10126
 
7684
- declare type StyleItem = {
10127
+ export declare type StyleItem = {
7685
10128
  name: string;
7686
10129
  type: TagType;
7687
10130
  variables?: Partial<StyleVariables>;
@@ -7690,9 +10133,9 @@ declare type StyleItem = {
7690
10133
  componentType?: string;
7691
10134
  };
7692
10135
 
7693
- declare type StyleMode = 'mobile-first' | 'desktop-first';
10136
+ export declare type StyleMode = 'mobile-first' | 'desktop-first';
7694
10137
 
7695
- declare type StyleObject = Partial<Record<StyleCategory, StyleValue>>;
10138
+ export declare type StyleObject = Partial<Record<StyleCategory, StyleValue>>;
7696
10139
 
7697
10140
  /** What reaches the document: expanded longhands, in the vocabulary the style editor understands. */
7698
10141
  export declare type StyleRules = StyleObject;
@@ -7721,32 +10164,68 @@ export declare const styles: (name: string, rules: StyleSpec) => StyleDeclaratio
7721
10164
  /** A selector's rules in either shape: plain CSS, or CSS with its states and variants beside it. */
7722
10165
  export declare type StyleSpec = CssSpec | RuleSetSpec;
7723
10166
 
7724
- declare type StyleState = (typeof STYLE_STATES_2)[number];
10167
+ export declare type StyleState = (typeof STYLE_STATES_2)[number];
7725
10168
 
7726
- declare type StyleStates = Partial<Record<StyleState, StyleObject>>;
10169
+ export declare type StyleStates = Partial<Record<StyleState, StyleObject>>;
7727
10170
 
7728
- declare type StyleThemeValue = Partial<Record<ColorScheme | 'default', string>>;
10171
+ export declare type StyleThemeValue = Partial<Record<ColorScheme | 'default', string>>;
7729
10172
 
7730
- declare type StyleValue = number | string;
10173
+ export declare type StyleValue = number | string;
7731
10174
 
7732
- declare enum StyleVariableCategory {
10175
+ export declare enum StyleVariableCategory {
7733
10176
  COLOR = "color",
7734
10177
  SPACING = "spacing",
7735
10178
  SHADOW = "shadow",
7736
10179
  CUSTOM = "custom"
7737
10180
  }
7738
10181
 
7739
- declare type StyleVariableGroup = Record<string, StyleVariableValue>;
10182
+ export declare type StyleVariableGroup = Record<string, StyleVariableValue>;
7740
10183
 
7741
- declare type StyleVariables = Record<StyleVariableCategory, StyleVariableGroup>;
10184
+ export declare type StyleVariables = Record<StyleVariableCategory, StyleVariableGroup>;
7742
10185
 
7743
- declare type StyleVariableValue = string | number | StyleThemeValue;
10186
+ export declare type StyleVariableValue = string | number | StyleThemeValue;
7744
10187
 
7745
- declare type StyleVariants = Record<string, Omit<StyleBlock, 'variants' | 'ancestors'>>;
10188
+ export declare type StyleVariants = Record<string, Omit<StyleBlock, 'variants' | 'ancestors'>>;
7746
10189
 
7747
10190
  /** If a camelCase key maps to a known kebab-case property, return it — used to name the correct key in an error. */
7748
10191
  export declare const suggestCssProperty: (key: string) => string | undefined;
7749
10192
 
10193
+ /**
10194
+ * A shorter or lighter way to the same page — not a problem: what is written renders as written.
10195
+ *
10196
+ * `saves` is how many elements the space would no longer carry, the measure suggestions are ranked by; a suggestion
10197
+ * about the stylesheet saves none and is listed after those that do.
10198
+ */
10199
+ export declare interface Suggestion {
10200
+ code: SuggestionCode;
10201
+ message: string;
10202
+ /** The elements it is about, the first being the one to look at. Empty for one about the stylesheet. */
10203
+ elementIds: string[];
10204
+ saves: number;
10205
+ /** Where the first of them was written: `src/site/home.ts:42`. Absent when no factory wrote it. */
10206
+ at?: string;
10207
+ }
10208
+
10209
+ export declare type SuggestionCode = {
10210
+ [Code in AuthoringCode]: Codes[Code]['kind'] extends 'suggested' ? Code : never;
10211
+ }[AuthoringCode];
10212
+
10213
+ /**
10214
+ * A shorter way to the same page: what a space's documents could say with fewer elements or less CSS — or, for its
10215
+ * animations, a lighter one.
10216
+ *
10217
+ * Not the linter. `lintSpace` reports what renders something other than what was written, and a space is refused or
10218
+ * warned for it; nothing here is wrong — the page renders exactly as written. These are the platform's own ways to say
10219
+ * it once instead of many times (layouts, components, lists, an element's own `content`, a class's states, the SDK's
10220
+ * defaults) or to move it cheaply (the compositor's properties), offered to whoever wrote it the long way: an agent
10221
+ * that did not know them, or a person who has not met them yet. Each names what to write instead, and the ones about
10222
+ * elements say how many it saves, which is what they are ranked by.
10223
+ */
10224
+ export declare const suggestSpace: ({ schema, style }: {
10225
+ schema: Schema;
10226
+ style: Style;
10227
+ }) => Suggestion[];
10228
+
7750
10229
  /** The closest known transformer action to a mistyped one (substring match either way), so a wrong action like
7751
10230
  * "template" teaches "twigTemplate". Undefined when nothing is close. */
7752
10231
  export declare const suggestTransformer: (action: string) => string | undefined;
@@ -7754,8 +10233,13 @@ export declare const suggestTransformer: (action: string) => string | undefined;
7754
10233
  /** The commits as a report. Separate from the page so what a report SAYS is tested without a browser. */
7755
10234
  export declare const summariseRenders: (commits: readonly TracedCommit[], max?: number) => RenderReport;
7756
10235
 
10236
+ export declare const svg: ElementFactory<Partial<{
10237
+ label?: string | undefined;
10238
+ content?: string | undefined;
10239
+ }>>;
10240
+
7757
10241
  /** Installed nowhere: a stack the visitor's system already has. Costs no bytes. */
7758
- declare type SystemFont = FontBase & {
10242
+ export declare type SystemFont = FontBase & {
7759
10243
  source: 'system';
7760
10244
  };
7761
10245
 
@@ -7779,64 +10263,19 @@ export declare const tabContainerItem: {
7779
10263
  (children: ElementSpec[], props?: AuthoringProps | undefined): ElementSpec;
7780
10264
  };
7781
10265
 
7782
- declare type TagType = 'class' | 'element' | 'id';
10266
+ export declare type TagType = 'class' | 'element' | 'id';
7783
10267
 
7784
- /**
7785
- * A published template: a subtree, the style that dresses it, and the element a builder instantiates.
7786
- *
7787
- * The artefact someone hosts when they are not building a space — fetched by URL, shown in the Resources panel,
7788
- * dragged onto a canvas — which is why it lives beside the schema and the style rather than with the builder's own
7789
- * types: it is a document, produced and consumed by processes that never open a builder.
7790
- */
7791
- export declare type Template = {
7792
- id?: string;
7793
- definition: {
7794
- name: string;
7795
- description: string;
7796
- /** Root of what travels. Its subtree is the whole of `schema.flat`, and it answers to no parent. */
7797
- baseElementId: Element_2['id'];
7798
- };
7799
- schema: Schema;
7800
- style: Style;
7801
- };
10268
+ /** Colour names beside the palette: a space's tokens (`surface: 'var(--surface)'`), or a palette name redefined. */
10269
+ export declare type TailwindColors = Readonly<Record<string, string>>;
7802
10270
 
7803
10271
  /** What a binding's template hands its attribute: its rendered text, or the value of its one `{{ expression }}`. */
7804
10272
  export declare type TemplateReturns = 'text' | 'value';
7805
10273
 
7806
- /**
7807
- * What a template author declares: a name, a description and a subtree.
7808
- *
7809
- * The style half is declared exactly as a space declares it — the classes the subtree names, the element defaults
7810
- * it relies on, the variables its rules read — because that is precisely what has to TRAVEL with it. A template
7811
- * that names a class the space it lands in happens not to declare renders unstyled, so anything the subtree reads
7812
- * is carried in the manifest rather than assumed.
7813
- */
7814
- export declare interface TemplateSpec {
7815
- name: string;
7816
- description: string;
7817
- /**
7818
- * What this template's ids are derived from, as `permanentUrl` is for a space. Defaults to a slug of the name.
7819
- *
7820
- * Ids are re-generated when the template is dropped into a space, so this decides nothing at run time — it
7821
- * decides only that authoring the same template twice writes the same file.
7822
- */
7823
- key?: string;
7824
- variables?: Partial<StyleVariables>;
7825
- /** As {@link SpaceSpec.classes}. Every class the subtree names has to be declared here, or it does not travel. */
7826
- classes?: Record<string, StyleSpec | StyleDeclaration>;
7827
- elements?: Record<string, ElementStyleSpec>;
7828
- schemaVariables?: SchemaVariable[];
7829
- mode?: Style['mode'];
7830
- theme?: Style['theme'];
7831
- /** The subtree, and its root is the element a builder instantiates. */
7832
- root: ElementSpec;
7833
- }
7834
-
7835
10274
  export declare const text: ElementFactory<Partial<{
7836
10275
  content?: string | number | undefined;
7837
10276
  }>>;
7838
10277
 
7839
- declare type Theme = 'dark' | 'light' | 'system';
10278
+ export declare type Theme = 'dark' | 'light' | 'system';
7840
10279
 
7841
10280
  export declare const themeToggle: {
7842
10281
  (props?: ElementProps<Partial<{
@@ -7931,6 +10370,17 @@ export declare const toInteractionCallback: <T extends Record<string, unknown> =
7931
10370
  */
7932
10371
  export declare const toInteractionCallbacks: <C extends Record<string, BuiltinActionSpec>>(catalog: C, handlers: { [K in keyof C]: (params: never, context?: InteractionCallbackContext) => unknown; }, overrides?: { [K in keyof C]?: Partial<InteractionCallback>; }) => Record<string, InteractionCallback>;
7933
10372
 
10373
+ export declare type Tokens<Variables> = {
10374
+ readonly [Name in VariableName<Variables>]: `var(--${Name})`;
10375
+ };
10376
+
10377
+ /**
10378
+ * The space's variables as the values a rule writes: `tokens(variables).surface` is `'var(--surface)'`. A name the
10379
+ * space does not declare is a type error where it is written, not a property the browser drops — so declare the
10380
+ * variables `as const` or `satisfies SpaceSpec['variables']`, and hand the same object to the space.
10381
+ */
10382
+ export declare const tokens: <const Variables extends Partial<StyleVariables>>(variables: Variables) => Tokens<Variables>;
10383
+
7934
10384
  export declare const toPortableSource: (source: string) => string;
7935
10385
 
7936
10386
  /**
@@ -7998,10 +10448,39 @@ declare interface TriggerCommon {
7998
10448
 
7999
10449
  declare type TriggerName<D extends DeclaresInteractions> = keyof NonNullable<D['triggers']> & string;
8000
10450
 
10451
+ /** Turns Tailwind classes into the rules `styles()` takes. See {@link createTw}. */
10452
+ export declare type Tw = (classes: string) => RuleSetSpec;
10453
+
10454
+ /** {@link createTw} with Tailwind's palette and nothing else. */
10455
+ export declare const tw: Tw;
10456
+
10457
+ /**
10458
+ * A template with paths in it, each written as its full name: `` twig`{{ ${site.data.total} + 1 }}` ``. A plain
10459
+ * template literal writes the same text, but a type-checked lint refuses an object inside one.
10460
+ */
10461
+ export declare const twig: (parts: TemplateStringsArray, ...values: (SourceName | number)[]) => string;
10462
+
8001
10463
  export declare const twigTemplate: (params: {
8002
10464
  template: string;
8003
10465
  }) => StepSpec;
8004
10466
 
10467
+ export declare interface TwOptions {
10468
+ /**
10469
+ * Colour names beside Tailwind's palette, or in place of one of its names: the space's tokens, so `bg-surface` is
10470
+ * `var(--surface)` — `createTw({ colors: tokens(variables) })`.
10471
+ */
10472
+ colors?: TailwindColors;
10473
+ }
10474
+
10475
+ /** The callbacks only some types answer to, by action name — with their params, for whatever explains or checks one. */
10476
+ export declare const typeCallbackDefinitions: Record<string, InteractionCallback>;
10477
+
10478
+ /** A list fed by a typed source: its `row` is handed the item typed as the sample's (`g => text({ from: g.item.title })`). */
10479
+ declare type TypedListProps<Item> = Omit<ListProps, 'items' | 'row'> & {
10480
+ items: SourcePath<readonly Item[]>;
10481
+ row?: string | RowWriter<SourceRow<Item>>;
10482
+ };
10483
+
8005
10484
  /** The triggers only some types fire, by action name — for a step builder that wants the title the builder shows. */
8006
10485
  export declare const typeTriggerDefinitions: Record<string, InteractionCallback>;
8007
10486
 
@@ -8024,15 +10503,15 @@ export declare const updateElement: (params: {
8024
10503
  revertOnFinish?: boolean;
8025
10504
  }, target?: string) => StepSpec;
8026
10505
 
10506
+ /** `validateSnippet`, holding this SDK's own catalogs — for a manifest authored elsewhere. */
10507
+ export declare const validateSnippet: (snippet: Snippet, options?: SpaceValidationOptions) => SchemaValidationResult;
10508
+
8027
10509
  /**
8028
10510
  * `validateSpace`, holding this SDK's own catalogs — the same gate `authorSpace` puts its output through, for documents
8029
10511
  * written anywhere else: the builder saving through the API, an import, an agent's edit, a JSON edited by hand.
8030
10512
  */
8031
10513
  export declare const validateSpace: (space: SpaceDocuments, options?: SpaceValidationOptions) => SchemaValidationResult;
8032
10514
 
8033
- /** `validateTemplate`, holding this SDK's own catalogs — for a manifest authored elsewhere. */
8034
- export declare const validateTemplate: (template: Template, options?: SpaceValidationOptions) => SchemaValidationResult;
8035
-
8036
10515
  /**
8037
10516
  * Every value of a string-literal union, as a list — and a compile error when the list leaves one out.
8038
10517
  *
@@ -8043,6 +10522,10 @@ export declare const valuesOf: <T extends string>() => <const V extends readonly
8043
10522
  readonly missing: Exclude<T, V[number]>;
8044
10523
  })) => readonly string[];
8045
10524
 
10525
+ declare type VariableName<Variables> = {
10526
+ [Category in keyof Variables]: keyof Variables[Category] & string;
10527
+ }[keyof Variables];
10528
+
8046
10529
  /**
8047
10530
  * Switches one of a CLASS's variants from a value the data answered — a status pill that turns amber, green or red
8048
10531
  * as the job it describes moves.
@@ -8104,6 +10587,11 @@ export declare interface VisibleCondition {
8104
10587
  template: string;
8105
10588
  }
8106
10589
 
10590
+ /** A visibility condition whose source may be a typed source's path as well as a name. */
10591
+ export declare type VisibleInput = Omit<VisibleCondition, 'source'> & {
10592
+ source: SourceName;
10593
+ };
10594
+
8107
10595
  /**
8108
10596
  * Shows or hides an element from a value the data answered.
8109
10597
  *
@@ -8113,6 +10601,10 @@ export declare interface VisibleCondition {
8113
10601
  */
8114
10602
  export declare const visibleWhen: (source: string, template?: string) => BindingSpec;
8115
10603
 
10604
+ export declare type WarningCode = {
10605
+ [Code in AuthoringCode]: Codes[Code]['kind'] extends 'warned' ? Code : never;
10606
+ }[AuthoringCode];
10607
+
8116
10608
  /**
8117
10609
  * Calls a URL and puts the answer in the flow scope as `{{ <id>.response.status }}` and `{{ <id>.response.data }}`.
8118
10610
  *
@@ -8214,7 +10706,7 @@ export declare const whenSucceeded: (stepId: string, step: StepSpec) => StepSpec
8214
10706
  * - `parallel`: every firing runs its own flow, at the same time.
8215
10707
  * - `queue`: every firing runs, one after another, in the order they came — none lost, none overlapping.
8216
10708
  */
8217
- declare type WhileRunning = 'skip' | 'parallel' | 'queue';
10709
+ export declare type WhileRunning = 'skip' | 'parallel' | 'queue';
8218
10710
 
8219
10711
  /**
8220
10712
  * What a trigger does when it fires again while the flow it started still runs.
@@ -8258,6 +10750,9 @@ export declare const withNamedIds: (schema: Schema) => {
8258
10750
  renames: ElementRename[];
8259
10751
  };
8260
10752
 
10753
+ /** The space's custom CSS with its notifications' rule after it; refuses a spec that is not sound. */
10754
+ export declare const withNotificationsCss: (customCss: string, spec: NotificationsSpec | undefined) => string;
10755
+
8261
10756
  /**
8262
10757
  * The catalogs `authorSpace` holds a space to, with each declared plugin in them as if it were built in.
8263
10758
  *
@@ -8273,4 +10768,12 @@ export declare const withVisibility: (spec: {
8273
10768
  visible?: string | false | VisibleCondition;
8274
10769
  }) => BindingSpec[] | undefined;
8275
10770
 
10771
+ /** Where a call is, exactly: the file, its line and the column its function's name starts at, from 1. */
10772
+ export declare interface WrittenPosition {
10773
+ /** Relative to the working directory when it is under it. */
10774
+ file: string;
10775
+ line: number;
10776
+ column: number;
10777
+ }
10778
+
8276
10779
  export { }