@plitzi/sdk-authoring 0.37.1 → 0.37.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1288 -0
- package/dist/index.d.ts +1673 -130
- package/dist/index.js +8979 -3334
- package/package.json +10 -10
- package/skills/plitzi-authoring/SKILL.md +153 -263
- package/skills/plitzi-authoring/reference/accessibility.md +111 -0
- package/skills/plitzi-authoring/reference/authoring-errors.md +70 -0
- package/skills/plitzi-authoring/reference/data-and-visibility.md +180 -0
- package/skills/plitzi-authoring/reference/elements-and-styles.md +161 -0
- package/skills/plitzi-authoring/reference/flows.md +171 -0
- package/skills/plitzi-authoring/reference/layouts.md +140 -0
- package/skills/plitzi-authoring/reference/lists.md +74 -0
- package/skills/plitzi-authoring/reference/performance.md +67 -0
- package/skills/plitzi-authoring/reference/plugins.md +167 -0
- package/skills/plitzi-authoring/reference/review-checklist.md +67 -0
- package/skills/plitzi-authoring/reference/structure.md +83 -0
- package/skills/plitzi-authoring/reference/templates-and-export.md +54 -0
- package/skills/plitzi-authoring/reference/templates.md +109 -0
- package/skills/plitzi-authoring/reference/testing.md +119 -0
- package/skills/plitzi-authoring/reference/validation.md +73 -0
package/dist/index.d.ts
CHANGED
|
@@ -206,14 +206,53 @@ export declare type ActionTriggerSpec = (TriggerCommon & {
|
|
|
206
206
|
timezone?: string;
|
|
207
207
|
});
|
|
208
208
|
|
|
209
|
+
/**
|
|
210
|
+
* Marks a navigation entry as the current one on the pages it stands for.
|
|
211
|
+
*
|
|
212
|
+
* The page being shown is \`navigation.currentPageId\`, so an entry lights up when that is one of its pages — one
|
|
213
|
+
* binding, the same on every entry of a menu that lives in a layout, instead of a copy of the menu per page with the
|
|
214
|
+
* right entry styled by hand. Several ids for one entry: a section and the pages beneath it (\`['spaces',
|
|
215
|
+
* 'space-record']\`). Every other page wears \`idle\`, a name the class need not declare.
|
|
216
|
+
*
|
|
217
|
+
* \`\`\`ts
|
|
218
|
+
* const navLink = styles('nav-link', { css: { … }, variants: { active: { color: 'var(--accent)' } } });
|
|
219
|
+
* link({ href: 'docs-data', class: navLink, bind: [activeOn(navLink, 'docs-data')] });
|
|
220
|
+
* \`\`\`
|
|
221
|
+
*/
|
|
222
|
+
export declare const activeOn: (cls: ClassRef, pages: string | readonly string[], options?: ActiveOnOptions) => BindingSpec;
|
|
223
|
+
|
|
224
|
+
/** What {@link activeOn} takes beyond the class and the pages. */
|
|
225
|
+
export declare interface ActiveOnOptions {
|
|
226
|
+
/** The variant worn on those pages. `active` unless the class calls it something else. */
|
|
227
|
+
variant?: string;
|
|
228
|
+
/** Which of the element's selectors wears the class, as in {@link variantFrom}. */
|
|
229
|
+
slot?: string;
|
|
230
|
+
}
|
|
231
|
+
|
|
209
232
|
export declare const addNotification: (params: {
|
|
210
233
|
content: string;
|
|
211
234
|
placement?: "top-right" | "top-center" | "top-left" | "bottom-right" | "bottom-center" | "bottom-left";
|
|
212
|
-
|
|
235
|
+
appearance?: "success" | "danger" | "warning" | "info";
|
|
213
236
|
autoDismiss?: boolean;
|
|
214
237
|
autoDismissTimeout?: number;
|
|
215
238
|
}) => StepSpec;
|
|
216
239
|
|
|
240
|
+
/**
|
|
241
|
+
* One refusal a document is allowed to carry, named exactly: which check, on which element, and why.
|
|
242
|
+
*
|
|
243
|
+
* Narrow on purpose — a code alone would let a second, accidental instance through beside the intended one. It is
|
|
244
|
+
* never silent either: the refusal comes back in `warnings` with the reason in front, and an entry that matches nothing
|
|
245
|
+
* is itself refused, so it cannot outlive the break it was written for.
|
|
246
|
+
*/
|
|
247
|
+
export declare interface AllowedBreak {
|
|
248
|
+
/** The validator code, as a refusal prints it in brackets — `template-unknown-name`. */
|
|
249
|
+
code: string;
|
|
250
|
+
/** The id of the element that breaks it. */
|
|
251
|
+
element: string;
|
|
252
|
+
/** Why this is on purpose. Printed with the warning, for whoever reads it next. */
|
|
253
|
+
why: string;
|
|
254
|
+
}
|
|
255
|
+
|
|
217
256
|
/** What one ancestor condition changes: inside it always, in its states, or in its variants (and their states). */
|
|
218
257
|
export declare interface AncestorSpec {
|
|
219
258
|
css?: CssSpec;
|
|
@@ -221,6 +260,9 @@ export declare interface AncestorSpec {
|
|
|
221
260
|
variants?: Record<string, CssSpec | VariantSpec>;
|
|
222
261
|
}
|
|
223
262
|
|
|
263
|
+
/** Announces this page on a `channel` with presence — a name, a colour: what the other members see of it. */
|
|
264
|
+
export declare const announceOn: (target: string, state: unknown) => StepSpec;
|
|
265
|
+
|
|
224
266
|
/**
|
|
225
267
|
* A factory per element, named after it.
|
|
226
268
|
*
|
|
@@ -310,6 +352,15 @@ declare type ApiContainerProps = {
|
|
|
310
352
|
staleTime?: number | string;
|
|
311
353
|
/** With `cache`: seconds an answer nobody renders is kept, so coming back within it paints at once. */
|
|
312
354
|
gcTime?: number | string;
|
|
355
|
+
/**
|
|
356
|
+
* Asks again on its own every this many seconds — for a page showing something that keeps moving: a queue, a
|
|
357
|
+
* feed, a status board. Off (`0`) by default.
|
|
358
|
+
*
|
|
359
|
+
* The same refresh `performQuery` runs, for either runtime: a browser request is re-sent, a server provider
|
|
360
|
+
* asks the server for its own slice again. Skipped while the tab is hidden and never stacked on one still in
|
|
361
|
+
* flight. A text field in the builder, hence the string.
|
|
362
|
+
*/
|
|
363
|
+
refreshSeconds?: number | string;
|
|
313
364
|
};
|
|
314
365
|
|
|
315
366
|
/**
|
|
@@ -333,6 +384,13 @@ export declare const appendState: (params: {
|
|
|
333
384
|
withId?: boolean;
|
|
334
385
|
}) => StepSpec;
|
|
335
386
|
|
|
387
|
+
/** One change a fix made, said the way the problems list says the issue it settles. */
|
|
388
|
+
export declare interface AppliedFix {
|
|
389
|
+
code: string;
|
|
390
|
+
elementId: string | null;
|
|
391
|
+
message: string;
|
|
392
|
+
}
|
|
393
|
+
|
|
336
394
|
/** Resolve a `globalCallback` action against the built-in catalog: returns the module id it is registered under
|
|
337
395
|
* (`source`) and the params reconciled to the callback's schema — unknown keys dropped for a closed callback, then
|
|
338
396
|
* missing defaults filled. An action the catalog does not know (e.g. a plugin callback) yields no source and
|
|
@@ -357,11 +415,15 @@ export declare const applyUtility: (action: string, params: Record<string, unkno
|
|
|
357
415
|
params: Record<string, unknown>;
|
|
358
416
|
};
|
|
359
417
|
|
|
360
|
-
/**
|
|
361
|
-
|
|
418
|
+
/**
|
|
419
|
+
* The throwing flavour. Returns what was survivable so a caller can decide what to do about it.
|
|
420
|
+
*
|
|
421
|
+
* `allow` turns the refusals it names into warnings (see `AllowedBreak`), and refuses an entry that names nothing.
|
|
422
|
+
*/
|
|
423
|
+
export declare const assertSpaceValid: (space: SpaceDocuments, context: string, options?: SpaceValidationOptions, allow?: readonly AllowedBreak[]) => SchemaValidationError[];
|
|
362
424
|
|
|
363
425
|
/** The throwing flavour. Returns what was survivable so a caller can decide what to do about it. */
|
|
364
|
-
export declare const assertTemplateValid: (template: Template, context: string, options?:
|
|
426
|
+
export declare const assertTemplateValid: (template: Template, context: string, options?: SpaceValidationOptions) => SchemaValidationError[];
|
|
365
427
|
|
|
366
428
|
/**
|
|
367
429
|
* The attributes of one built-in element, by type name — `Attributes<'heading'>['subType']`.
|
|
@@ -395,6 +457,10 @@ export declare const authLogin: (params: {
|
|
|
395
457
|
} | {
|
|
396
458
|
mode: "token";
|
|
397
459
|
token: string;
|
|
460
|
+
} | {
|
|
461
|
+
mode: "mfa";
|
|
462
|
+
mfaToken: string;
|
|
463
|
+
code: string;
|
|
398
464
|
}) => StepSpec;
|
|
399
465
|
|
|
400
466
|
export declare const authLogout: () => StepSpec;
|
|
@@ -490,6 +556,8 @@ export declare interface AuthoringProps {
|
|
|
490
556
|
css?: CssSpec;
|
|
491
557
|
/** How the element's own rules react — `hover`, `focus` — beside {@link AuthoringProps.css}. */
|
|
492
558
|
states?: StatesSpec;
|
|
559
|
+
/** The name of the element's own selector; derived from where it sits when left out. */
|
|
560
|
+
selector?: string;
|
|
493
561
|
/** Style variant of the element's own vocabulary, e.g. a heading's `title`. */
|
|
494
562
|
variant?: string;
|
|
495
563
|
/** A class for one of the element's other selectors — a form control's `input`, `label`, `error`. */
|
|
@@ -497,10 +565,10 @@ export declare interface AuthoringProps {
|
|
|
497
565
|
/** `{ content: 'posts.title' }`, or the full form for state, transformers and conditions. */
|
|
498
566
|
bind?: BindingsSpec;
|
|
499
567
|
/**
|
|
500
|
-
* Show this element only while the value at this source is true. `!source` shows it while the value is false,
|
|
501
|
-
* `false` starts it hidden for a flow to reveal.
|
|
568
|
+
* Show this element only while the value at this source is true. `!source` shows it while the value is false,
|
|
569
|
+
* `{ source, template }` while a template over it says `true`, and `false` starts it hidden for a flow to reveal.
|
|
502
570
|
*/
|
|
503
|
-
visible?: string | false;
|
|
571
|
+
visible?: string | false | VisibleCondition;
|
|
504
572
|
/** One flow per entry; steps are chained in the order written. */
|
|
505
573
|
flows?: StepSpec[][];
|
|
506
574
|
/** `server` resolves this element's data on the server rather than in the browser. */
|
|
@@ -513,13 +581,15 @@ export declare interface AuthoringProps {
|
|
|
513
581
|
}
|
|
514
582
|
|
|
515
583
|
/**
|
|
516
|
-
* `authorSpace`, holding this SDK's own vocabularies.
|
|
584
|
+
* `authorSpace`, holding this SDK's own vocabularies — and each plugin handed in as `plugins`, held to its declaration.
|
|
517
585
|
*
|
|
518
586
|
* Deliberately shadows the one re-exported above — an explicit export wins over a star — so that everybody who
|
|
519
587
|
* imports from this package gets both checks that need to know what this SDK ships.
|
|
520
588
|
*
|
|
521
|
-
* **Flows.** A step naming a callback on the wrong module is refused
|
|
522
|
-
*
|
|
589
|
+
* **Flows.** A step naming a callback on the wrong module is refused, and so is a flow starting on a trigger its
|
|
590
|
+
* built-in element never fires, or an element callback aimed at a built-in element that does not answer to it; one
|
|
591
|
+
* naming an action no built-in source declares comes back in `warnings`, since a plugin is free to register a
|
|
592
|
+
* module this process cannot see.
|
|
523
593
|
*
|
|
524
594
|
* **Bindings.** A source may name the element alone and the prefix it publishes under is filled in — which
|
|
525
595
|
* is the half an author cannot see, and is not always the element's own type.
|
|
@@ -537,6 +607,53 @@ export declare interface AuthorSpaceOptions {
|
|
|
537
607
|
* prefix that does not match the element it names goes unnoticed.
|
|
538
608
|
*/
|
|
539
609
|
sourceTypes?: SourceTypes;
|
|
610
|
+
/**
|
|
611
|
+
* Element type → its other style selectors (a modal's `rootContainer`). Every element carries a class for each, so a
|
|
612
|
+
* per-type `slots` style reaches all of them; left out, only the slots an element styles itself are addressable.
|
|
613
|
+
*/
|
|
614
|
+
slotNames?: Record<string, readonly string[]>;
|
|
615
|
+
/** Element type → the type it only works inside. Left out, a sub-element is placed wherever it is written. */
|
|
616
|
+
ancestorTypes?: Record<string, string>;
|
|
617
|
+
/**
|
|
618
|
+
* Element type → the attributes its component reads, `null` for one that reads any. Left out, an attribute
|
|
619
|
+
* nothing reads is written without a word.
|
|
620
|
+
*/
|
|
621
|
+
attributeNames?: Readonly<Record<string, readonly string[] | null>>;
|
|
622
|
+
/** The types that hold no children. Left out, children written into one are dropped at render time unreported. */
|
|
623
|
+
leafTypes?: readonly string[];
|
|
624
|
+
/**
|
|
625
|
+
* Element type → the attributes it starts with. What tells a default `content` rendered beside children apart from
|
|
626
|
+
* one the author wrote, and an attribute that holds a list from one that holds text.
|
|
627
|
+
*/
|
|
628
|
+
defaultAttributes?: Readonly<Record<string, Readonly<Record<string, unknown>>>>;
|
|
629
|
+
/** Element type → attribute → the values it takes. Left out, `subType: 'h7'` is written as given. */
|
|
630
|
+
attributeValues?: Readonly<Record<string, Readonly<Record<string, readonly string[]>>>>;
|
|
631
|
+
/**
|
|
632
|
+
* Element types a plugin of this project registers — its own components, authored with `defineElement` or
|
|
633
|
+
* `elementsFromManifest`. Any other type that is not built in is reported as `unknown-element-type`, because a typo
|
|
634
|
+
* (`contaner`) and a plugin nobody registered render the same: nothing.
|
|
635
|
+
*/
|
|
636
|
+
pluginTypes?: readonly string[];
|
|
637
|
+
/**
|
|
638
|
+
* The plugins this project ships, as their declarations — the `declaration.ts` beside each component, or the
|
|
639
|
+
* `pluginSchema` of a published manifest.
|
|
640
|
+
*
|
|
641
|
+
* More than `pluginTypes`: a declared plugin is held to what it declares, like a built-in element. A flow that
|
|
642
|
+
* starts on a trigger it never fires, a step sent to a callback it does not answer, an attribute it does not read
|
|
643
|
+
* and a binding onto one are all reported — with only a type name, every one of them is written and silently does
|
|
644
|
+
* nothing.
|
|
645
|
+
*/
|
|
646
|
+
plugins?: readonly PluginDeclarationData[];
|
|
647
|
+
/**
|
|
648
|
+
* What this document breaks ON PURPOSE — a fixture for how the runtime copes with something no author would write,
|
|
649
|
+
* like a provider whose URL names a route param no page has. See {@link AllowedBreak}.
|
|
650
|
+
*/
|
|
651
|
+
allow?: readonly AllowedBreak[];
|
|
652
|
+
/** The binding transformers and their params. Left out, a transformer nothing implements is written as given. */
|
|
653
|
+
transformers?: Readonly<Record<string, {
|
|
654
|
+
strictParams?: boolean;
|
|
655
|
+
params?: ParamSpec;
|
|
656
|
+
}>>;
|
|
540
657
|
}
|
|
541
658
|
|
|
542
659
|
/**
|
|
@@ -588,6 +705,27 @@ declare type BindingTransformer = {
|
|
|
588
705
|
enabled?: boolean;
|
|
589
706
|
};
|
|
590
707
|
|
|
708
|
+
/**
|
|
709
|
+
* An attribute computed by a template over a source — a label with units, a URL with an id in it, a filtered list.
|
|
710
|
+
*
|
|
711
|
+
* The long form is a binding with one `twigTemplate` transformer, which every computed attribute needs and nobody
|
|
712
|
+
* wants to write out:
|
|
713
|
+
*
|
|
714
|
+
* ```ts
|
|
715
|
+
* text('', { bind: [bindTemplate('content', 'state.xp', '{{ source }} XP')] });
|
|
716
|
+
* list({ source: 'controlled', bind: [bindTemplate('items', 'games.data', '{{ source|filter(g => g.new) }}', { returns: 'value' })] });
|
|
717
|
+
* container({ bind: [bindTemplate('width', 'state.progress', '{{ source }}%', { category: 'style' })] });
|
|
718
|
+
* ```
|
|
719
|
+
*/
|
|
720
|
+
export declare const bindTemplate: (to: string, source: string, template: string, options?: BindTemplateOptions) => BindingSpec;
|
|
721
|
+
|
|
722
|
+
export declare interface BindTemplateOptions {
|
|
723
|
+
/** Where the value goes: an attribute (the default), a style property (`style`), or element state. */
|
|
724
|
+
category?: BindingCategory;
|
|
725
|
+
/** `value` for an attribute that holds a list, a number or a flag rather than words — a list's `items`. */
|
|
726
|
+
returns?: TemplateReturns;
|
|
727
|
+
}
|
|
728
|
+
|
|
591
729
|
/** The two documents, authored fresh — so one caller writing its own name in cannot mark the next one's copy. */
|
|
592
730
|
export declare const blankSpace: () => AuthoredSpace;
|
|
593
731
|
|
|
@@ -609,18 +747,14 @@ export declare interface BlankSpaceSourceOptions {
|
|
|
609
747
|
/** The name the copy carries. `permanentUrl` follows it, slugged. */
|
|
610
748
|
name?: string;
|
|
611
749
|
/**
|
|
612
|
-
* Add a `custom` element hosting a plugin the receiver supplies.
|
|
750
|
+
* Add a `custom` element hosting a plugin the receiver supplies — or several, one after another, given a list.
|
|
613
751
|
*
|
|
614
752
|
* Off by default, and it has to be: the platform authors a new space from this same declaration and hosts none
|
|
615
753
|
* of anybody's plugins, so a `custom` element in it would render "Custom Component … Not Found" on every space
|
|
616
754
|
* anyone ever signed up for. It is on for `plitzi create`, where the project being scaffolded carries the
|
|
617
755
|
* component and registers it — which is the one fact about Plitzi a page of built-in elements cannot show.
|
|
618
756
|
*/
|
|
619
|
-
plugin?:
|
|
620
|
-
renderType: string;
|
|
621
|
-
id: string;
|
|
622
|
-
settings: Record<string, unknown>;
|
|
623
|
-
};
|
|
757
|
+
plugin?: PluginHostOptions | readonly PluginHostOptions[];
|
|
624
758
|
}
|
|
625
759
|
|
|
626
760
|
export declare const blankSpaceSpec: SpaceSpec;
|
|
@@ -647,7 +781,7 @@ declare type BlockJsxProps = {
|
|
|
647
781
|
/** The breakpoints a rule set can be written for, widest first — the order they cascade in. */
|
|
648
782
|
export declare const BREAKPOINTS: DisplayMode[];
|
|
649
783
|
|
|
650
|
-
export declare const buildHandles: (pages: Record<string, PageHandle>) => SpaceHandles;
|
|
784
|
+
export declare const buildHandles: (pages: Record<string, PageHandle>, layouts?: Record<string, LayoutHandle>) => SpaceHandles;
|
|
651
785
|
|
|
652
786
|
export declare const BUILTIN_ELEMENT_CALLBACKS: Record<string, BuiltinElementCallback>;
|
|
653
787
|
|
|
@@ -728,7 +862,7 @@ export declare interface BuiltinParam {
|
|
|
728
862
|
elementType?: string;
|
|
729
863
|
}
|
|
730
864
|
|
|
731
|
-
export declare type BuiltinParamType = 'text' | 'textarea' | 'select' | 'boolean' | 'number' | 'scalar' | 'elementIds';
|
|
865
|
+
export declare type BuiltinParamType = 'text' | 'textarea' | 'select' | 'boolean' | 'number' | 'scalar' | 'json' | 'elementIds';
|
|
732
866
|
|
|
733
867
|
export declare interface BuiltinTransformer {
|
|
734
868
|
title: string;
|
|
@@ -740,6 +874,7 @@ export declare interface BuiltinTransformer {
|
|
|
740
874
|
export declare type BuiltinUtility = BuiltinActionSpec;
|
|
741
875
|
|
|
742
876
|
export declare const button: ElementFactory<Partial<{
|
|
877
|
+
label?: string | undefined;
|
|
743
878
|
title?: string | undefined;
|
|
744
879
|
content?: string | undefined;
|
|
745
880
|
disabled?: boolean | undefined;
|
|
@@ -749,10 +884,60 @@ export declare const button: ElementFactory<Partial<{
|
|
|
749
884
|
ariaPressed?: boolean | undefined;
|
|
750
885
|
}>>;
|
|
751
886
|
|
|
887
|
+
declare type CallbackName<D extends DeclaresInteractions> = keyof NonNullable<D['callbacks']> & string;
|
|
888
|
+
|
|
752
889
|
export declare const cancelServerAction: (params: {
|
|
753
890
|
runId: string;
|
|
754
891
|
}) => StepSpec;
|
|
755
892
|
|
|
893
|
+
export declare const channel: {
|
|
894
|
+
(props?: ElementProps<Partial<{
|
|
895
|
+
subType?: "" | "div" | "section" | "aside" | "main" | undefined;
|
|
896
|
+
topic?: string | undefined;
|
|
897
|
+
grant?: string | undefined;
|
|
898
|
+
presence?: unknown;
|
|
899
|
+
keep?: number | string | undefined;
|
|
900
|
+
}>> | undefined): ElementSpec;
|
|
901
|
+
(children: ElementSpec[], props?: ElementProps<Partial<{
|
|
902
|
+
subType?: "" | "div" | "section" | "aside" | "main" | undefined;
|
|
903
|
+
topic?: string | undefined;
|
|
904
|
+
grant?: string | undefined;
|
|
905
|
+
presence?: unknown;
|
|
906
|
+
keep?: number | string | undefined;
|
|
907
|
+
}>> | undefined): ElementSpec;
|
|
908
|
+
};
|
|
909
|
+
|
|
910
|
+
/**
|
|
911
|
+
* One kind of channel a space offers, declared under a topic PATTERN — `board:{id}` is every board, each its own topic.
|
|
912
|
+
*
|
|
913
|
+
* A topic no pattern of the space matches is refused, by the server and at authoring: a page cannot open a channel
|
|
914
|
+
* nobody decided should exist.
|
|
915
|
+
*/
|
|
916
|
+
declare type ChannelDeclaration = {
|
|
917
|
+
/** Who may subscribe and publish — the access vocabulary actions use. */
|
|
918
|
+
access: ActionAccess;
|
|
919
|
+
/**
|
|
920
|
+
* Who may send: `clients` (pages publish directly — cursors, reactions, what is cheap and ephemeral) or `server`
|
|
921
|
+
* (only a flow's `realtime.publish` — what was validated and saved first). `clients` when absent.
|
|
922
|
+
*/
|
|
923
|
+
publish?: 'clients' | 'server';
|
|
924
|
+
/** Whether members announce themselves — who is here, and what they are pointing at. */
|
|
925
|
+
presence?: boolean;
|
|
926
|
+
/**
|
|
927
|
+
* Whether a page needs a GRANT to open a topic of it: a token a flow's `realtime.grant` issued for that exact topic —
|
|
928
|
+
* after checking a password, an invitation, an order's owner, whatever decides who is in. Without one the topic is
|
|
929
|
+
* refused, however well its name is known; `access` still applies on top. For a private room, a customer's order,
|
|
930
|
+
* a locked board.
|
|
931
|
+
*/
|
|
932
|
+
grant?: boolean;
|
|
933
|
+
/** The largest `data` a page may send, as JSON bytes. 4 KB when absent. */
|
|
934
|
+
maxMessageBytes?: number;
|
|
935
|
+
/** How many messages one connection may send a second. 30 when absent. */
|
|
936
|
+
messagesPerSecond?: number;
|
|
937
|
+
};
|
|
938
|
+
|
|
939
|
+
declare type ChannelDeclarations = Record<string, ChannelDeclaration>;
|
|
940
|
+
|
|
756
941
|
/**
|
|
757
942
|
* The classes a selector wears: one, or several.
|
|
758
943
|
*
|
|
@@ -783,6 +968,12 @@ export declare const clearState: (params?: {
|
|
|
783
968
|
key?: string;
|
|
784
969
|
}) => StepSpec;
|
|
785
970
|
|
|
971
|
+
/** Closes a `dialogContainer`, by id. */
|
|
972
|
+
export declare const closeDialog: (target: string) => StepSpec;
|
|
973
|
+
|
|
974
|
+
/** Closes a `modalContainer`, by id — from a button inside it or anywhere else. */
|
|
975
|
+
export declare const closeModal: (target: string) => StepSpec;
|
|
976
|
+
|
|
786
977
|
/**
|
|
787
978
|
* The answer, once `system` has been put to the machine: what is actually on screen.
|
|
788
979
|
*
|
|
@@ -806,10 +997,14 @@ export declare const compareSpaces: (expected: SpaceDocuments, actual: SpaceDocu
|
|
|
806
997
|
|
|
807
998
|
export declare const container: {
|
|
808
999
|
(props?: ElementProps<Partial<{
|
|
809
|
-
|
|
1000
|
+
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;
|
|
1002
|
+
decorative?: boolean | undefined;
|
|
810
1003
|
}>> | undefined): ElementSpec;
|
|
811
1004
|
(children: ElementSpec[], props?: ElementProps<Partial<{
|
|
812
|
-
|
|
1005
|
+
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;
|
|
1007
|
+
decorative?: boolean | undefined;
|
|
813
1008
|
}>> | undefined): ElementSpec;
|
|
814
1009
|
};
|
|
815
1010
|
|
|
@@ -817,16 +1012,6 @@ declare type ContentShorthand<A> = 'content' extends keyof A ? {
|
|
|
817
1012
|
(content: string, props?: ElementProps<A>): ElementSpec;
|
|
818
1013
|
} : unknown;
|
|
819
1014
|
|
|
820
|
-
/**
|
|
821
|
-
* The one door CSS goes through while authoring.
|
|
822
|
-
*
|
|
823
|
-
* It does two things a hand-written object cannot: it expands the shorthands the style editor has no controls for,
|
|
824
|
-
* and it refuses a property that is not in the vocabulary. Both failures are silent otherwise — a shorthand renders
|
|
825
|
-
* and then cannot be edited, a typo renders as nothing at all — and both are cheapest to hear about on the line
|
|
826
|
-
* that wrote them.
|
|
827
|
-
*
|
|
828
|
-
* Idempotent: rules that are already longhand pass through unchanged, so a fragment may be run through it twice.
|
|
829
|
-
*/
|
|
830
1015
|
export declare const css: (rules: CssProps) => StyleRules;
|
|
831
1016
|
|
|
832
1017
|
/** The patch flavour of {@link CssProps}: `null` clears every longhand the key controls. */
|
|
@@ -883,6 +1068,33 @@ declare type DeclarationByType = {
|
|
|
883
1068
|
[Name in keyof typeof elementDeclarations as (typeof elementDeclarations)[Name]['type']]: (typeof elementDeclarations)[Name];
|
|
884
1069
|
};
|
|
885
1070
|
|
|
1071
|
+
/**
|
|
1072
|
+
* A step that runs one of the actions a declaration says its element answers to — on the element named by `on`.
|
|
1073
|
+
*
|
|
1074
|
+
* The built-in elements have a builder per action (`openModal`, `reloadApi`); a plugin's actions are its own, and
|
|
1075
|
+
* without this they were written as a literal step, where naming the wrong action, or forgetting `on`, is a button
|
|
1076
|
+
* that does nothing. Typed from the declaration, so only an action it declares can be named.
|
|
1077
|
+
*/
|
|
1078
|
+
export declare const declaredCallback: <D extends DeclaresInteractions>(declaration: D, callback: CallbackName<D>, target: {
|
|
1079
|
+
on: string;
|
|
1080
|
+
params?: Record<string, unknown>;
|
|
1081
|
+
}) => StepSpec;
|
|
1082
|
+
|
|
1083
|
+
/**
|
|
1084
|
+
* A flow's first step, on one of the triggers a declaration says its element fires — typed from the declaration.
|
|
1085
|
+
*
|
|
1086
|
+
* For an element this SDK does not ship: a plugin fires its own events, and `on('onQuakeSelect')` accepts any string
|
|
1087
|
+
* because it cannot know them. Handed the plugin's `declaration.ts`, a trigger it does not declare is a compile error,
|
|
1088
|
+
* and the step carries the declared title and `preview` — what the builder shows a reader of the flow.
|
|
1089
|
+
*/
|
|
1090
|
+
export declare const declaredTrigger: <D extends DeclaresInteractions>(declaration: D, trigger: TriggerName<D>) => StepSpec;
|
|
1091
|
+
|
|
1092
|
+
/** What a declaration offers the two builders below: its events and its actions, keyed by name. */
|
|
1093
|
+
declare interface DeclaresInteractions {
|
|
1094
|
+
triggers?: Readonly<Record<string, InteractionCallback>>;
|
|
1095
|
+
callbacks?: Readonly<Record<string, InteractionCallback>>;
|
|
1096
|
+
}
|
|
1097
|
+
|
|
886
1098
|
/**
|
|
887
1099
|
* The attributes an element of this type starts with — what a factory merges under the author's own.
|
|
888
1100
|
*
|
|
@@ -894,21 +1106,6 @@ export declare const defaultAttributes: (type: string) => Record<string, unknown
|
|
|
894
1106
|
/** The name a factory gives an element of this type in the builder's tree, unless the author gave it another. */
|
|
895
1107
|
export declare const defaultLabel: (type: string) => string;
|
|
896
1108
|
|
|
897
|
-
/**
|
|
898
|
-
* Build an action document from a declaration.
|
|
899
|
-
*
|
|
900
|
-
* ```ts
|
|
901
|
-
* defineAction({
|
|
902
|
-
* id: 'update-post',
|
|
903
|
-
* name: 'Update a post',
|
|
904
|
-
* trigger: { type: 'call', access: { mode: 'role', permissions: ['postPublish'] }, input: {
|
|
905
|
-
* slug: { type: 'text', required: true, label: 'Slug' },
|
|
906
|
-
* title: { type: 'text', label: 'Title' }
|
|
907
|
-
* } },
|
|
908
|
-
* steps: [{ id: 'updated', task: 'blog.updatePost' }]
|
|
909
|
-
* });
|
|
910
|
-
* ```
|
|
911
|
-
*/
|
|
912
1109
|
export declare const defineAction: (spec: ActionSpec) => ActionEntry;
|
|
913
1110
|
|
|
914
1111
|
/**
|
|
@@ -953,6 +1150,9 @@ export declare const digest: (value: string, length: number) => string;
|
|
|
953
1150
|
|
|
954
1151
|
declare type DisplayMode = 'desktop' | 'tablet' | 'mobile';
|
|
955
1152
|
|
|
1153
|
+
/** Checks that need no space: what any rendered page owes, whoever wrote it. */
|
|
1154
|
+
export declare type DocumentChecks = Pick<InspectOptions, 'skip' | 'timeout'>;
|
|
1155
|
+
|
|
956
1156
|
export declare const dropdown: {
|
|
957
1157
|
(props?: ElementProps<Partial<{
|
|
958
1158
|
disabled?: boolean | undefined;
|
|
@@ -1013,7 +1213,10 @@ declare type Element_2<TAttributes extends Record<string, unknown> = Record<stri
|
|
|
1013
1213
|
* export drops without a word. `specFields.test.ts` refuses to compile until it is listed here — and once it is, it is
|
|
1014
1214
|
* written like any other, so growing the authoring surface needs nothing more from the emitter than this line.
|
|
1015
1215
|
*/
|
|
1016
|
-
export declare const ELEMENT_FIELDS: readonly ["type", "id", "attributes", "class", "css", "states", "variant", "slots", "bind", "visible", "flows", "runtime", "loadStrategy", "meta", "children"];
|
|
1216
|
+
export declare const ELEMENT_FIELDS: readonly ["type", "id", "attributes", "class", "css", "states", "selector", "variant", "slots", "bind", "visible", "flows", "runtime", "loadStrategy", "meta", "children"];
|
|
1217
|
+
|
|
1218
|
+
/** The sub-elements that only work inside another type, and that type — see `ElementDeclarationData.ancestorType`. */
|
|
1219
|
+
export declare const elementAncestorTypes: Record<string, string>;
|
|
1017
1220
|
|
|
1018
1221
|
/**
|
|
1019
1222
|
* The attributes each built-in element can be authored with, by type — `null` for an element that takes any.
|
|
@@ -1022,20 +1225,21 @@ export declare const ELEMENT_FIELDS: readonly ["type", "id", "attributes", "clas
|
|
|
1022
1225
|
* a builder that has since moved on, and nothing renders it.
|
|
1023
1226
|
*/
|
|
1024
1227
|
export declare const elementAttributeNames: {
|
|
1025
|
-
readonly apiContainer: readonly ["accessToken", "action", "cache", "connector", "credentials", "endpoint", "filters", "gcTime", "headers", "input", "limit", "method", "mockData", "pageParam", "pagination", "query", "renderWhileLoading", "resource", "singleRecord", "staleTime", "subType", "when"];
|
|
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"];
|
|
1026
1229
|
readonly blockHtml: readonly ["content"];
|
|
1027
1230
|
readonly blockJsx: readonly ["allowEmptyRender", "content", "contentCache", "props"];
|
|
1028
|
-
readonly button: readonly ["ariaExpanded", "ariaPressed", "content", "contentPlacement", "disabled", "subType", "title"];
|
|
1029
|
-
readonly
|
|
1231
|
+
readonly button: readonly ["ariaExpanded", "ariaPressed", "content", "contentPlacement", "disabled", "label", "subType", "title"];
|
|
1232
|
+
readonly channel: readonly ["grant", "keep", "presence", "subType", "topic"];
|
|
1233
|
+
readonly container: readonly ["decorative", "label", "subType"];
|
|
1030
1234
|
readonly custom: null;
|
|
1031
1235
|
readonly dialogContainer: readonly ["acceptButtonLabel", "acceptButtonLabelLoading", "autoHideAfterClick", "headerLabel", "rejectButtonLabel"];
|
|
1032
1236
|
readonly dropdown: readonly ["backgroundDisabled", "closeOnClickBackground", "closeOnClickPopup", "containerLeftOffset", "containerTopOffset", "disabled", "openPopup", "popupPlacement"];
|
|
1033
1237
|
readonly dropdownPopup: readonly [];
|
|
1034
|
-
readonly fontAwesome: readonly ["icon", "iconAnimation", "size"];
|
|
1238
|
+
readonly fontAwesome: readonly ["icon", "iconAnimation", "label", "size"];
|
|
1035
1239
|
readonly form: readonly ["actionUrl", "errors", "managedByInteractions", "method", "noValidate", "values"];
|
|
1036
|
-
readonly formControl: readonly ["autoComplete", "defaultValue", "disabled", "formatMessage", "label", "matches", "matchesMessage", "maxLength", "maxLengthMessage", "minLength", "minLengthMessage", "name", "options", "pattern", "patternMessage", "placeholder", "previewError", "readOnly", "required", "requiredMessage", "subType"];
|
|
1240
|
+
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"];
|
|
1037
1241
|
readonly heading: readonly ["content", "subType"];
|
|
1038
|
-
readonly image: readonly ["alt", "fetchPriority", "loadMode", "src"];
|
|
1242
|
+
readonly image: readonly ["alt", "decorative", "fetchPriority", "loadMode", "src"];
|
|
1039
1243
|
readonly layoutContainer: readonly ["layout", "layoutContainer", "subType"];
|
|
1040
1244
|
readonly link: readonly ["href", "label", "mode", "target"];
|
|
1041
1245
|
readonly list: readonly ["items", "source", "subType"];
|
|
@@ -1046,7 +1250,7 @@ export declare const elementAttributeNames: {
|
|
|
1046
1250
|
readonly nodeHtml: readonly ["about", "accessKey", "aria-activedescendant", "aria-atomic", "aria-autocomplete", "aria-braillelabel", "aria-brailleroledescription", "aria-busy", "aria-checked", "aria-colcount", "aria-colindex", "aria-colindextext", "aria-colspan", "aria-controls", "aria-current", "aria-describedby", "aria-description", "aria-details", "aria-disabled", "aria-dropeffect", "aria-errormessage", "aria-expanded", "aria-flowto", "aria-grabbed", "aria-haspopup", "aria-hidden", "aria-invalid", "aria-keyshortcuts", "aria-label", "aria-labelledby", "aria-level", "aria-live", "aria-modal", "aria-multiline", "aria-multiselectable", "aria-orientation", "aria-owns", "aria-placeholder", "aria-posinset", "aria-pressed", "aria-readonly", "aria-relevant", "aria-required", "aria-roledescription", "aria-rowcount", "aria-rowindex", "aria-rowindextext", "aria-rowspan", "aria-selected", "aria-setsize", "aria-sort", "aria-valuemax", "aria-valuemin", "aria-valuenow", "aria-valuetext", "autoCapitalize", "autoCorrect", "autoFocus", "autoSave", "color", "content", "contentEditable", "contextMenu", "dangerouslySetInnerHTML", "datatype", "defaultChecked", "defaultValue", "dir", "draggable", "enterKeyHint", "exportparts", "hidden", "inert", "inlist", "inputMode", "is", "itemID", "itemProp", "itemRef", "itemScope", "itemType", "lang", "nonce", "onAbort", "onAbortCapture", "onAnimationEnd", "onAnimationEndCapture", "onAnimationIteration", "onAnimationIterationCapture", "onAnimationStart", "onAnimationStartCapture", "onAuxClick", "onAuxClickCapture", "onBeforeInput", "onBeforeInputCapture", "onBeforeToggle", "onBlur", "onBlurCapture", "onCanPlay", "onCanPlayCapture", "onCanPlayThrough", "onCanPlayThroughCapture", "onChange", "onChangeCapture", "onClick", "onClickCapture", "onCompositionEnd", "onCompositionEndCapture", "onCompositionStart", "onCompositionStartCapture", "onCompositionUpdate", "onCompositionUpdateCapture", "onContextMenu", "onContextMenuCapture", "onCopy", "onCopyCapture", "onCut", "onCutCapture", "onDoubleClick", "onDoubleClickCapture", "onDrag", "onDragCapture", "onDragEnd", "onDragEndCapture", "onDragEnter", "onDragEnterCapture", "onDragExit", "onDragExitCapture", "onDragLeave", "onDragLeaveCapture", "onDragOver", "onDragOverCapture", "onDragStart", "onDragStartCapture", "onDrop", "onDropCapture", "onDurationChange", "onDurationChangeCapture", "onEmptied", "onEmptiedCapture", "onEncrypted", "onEncryptedCapture", "onEnded", "onEndedCapture", "onError", "onErrorCapture", "onFocus", "onFocusCapture", "onGotPointerCapture", "onGotPointerCaptureCapture", "onInput", "onInputCapture", "onInvalid", "onInvalidCapture", "onKeyDown", "onKeyDownCapture", "onKeyPress", "onKeyPressCapture", "onKeyUp", "onKeyUpCapture", "onLoad", "onLoadCapture", "onLoadedData", "onLoadedDataCapture", "onLoadedMetadata", "onLoadedMetadataCapture", "onLoadStart", "onLoadStartCapture", "onLostPointerCapture", "onLostPointerCaptureCapture", "onMouseDown", "onMouseDownCapture", "onMouseEnter", "onMouseLeave", "onMouseMove", "onMouseMoveCapture", "onMouseOut", "onMouseOutCapture", "onMouseOver", "onMouseOverCapture", "onMouseUp", "onMouseUpCapture", "onPaste", "onPasteCapture", "onPause", "onPauseCapture", "onPlay", "onPlayCapture", "onPlaying", "onPlayingCapture", "onPointerCancel", "onPointerCancelCapture", "onPointerDown", "onPointerDownCapture", "onPointerEnter", "onPointerLeave", "onPointerMove", "onPointerMoveCapture", "onPointerOut", "onPointerOutCapture", "onPointerOver", "onPointerOverCapture", "onPointerUp", "onPointerUpCapture", "onProgress", "onProgressCapture", "onRateChange", "onRateChangeCapture", "onReset", "onResetCapture", "onScroll", "onScrollCapture", "onScrollEnd", "onScrollEndCapture", "onSeeked", "onSeekedCapture", "onSeeking", "onSeekingCapture", "onSelect", "onSelectCapture", "onStalled", "onStalledCapture", "onSubmit", "onSubmitCapture", "onSuspend", "onSuspendCapture", "onTimeUpdate", "onTimeUpdateCapture", "onToggle", "onTouchCancel", "onTouchCancelCapture", "onTouchEnd", "onTouchEndCapture", "onTouchMove", "onTouchMoveCapture", "onTouchStart", "onTouchStartCapture", "onTransitionCancel", "onTransitionCancelCapture", "onTransitionEnd", "onTransitionEndCapture", "onTransitionRun", "onTransitionRunCapture", "onTransitionStart", "onTransitionStartCapture", "onVolumeChange", "onVolumeChangeCapture", "onWaiting", "onWaitingCapture", "onWheel", "onWheelCapture", "part", "popover", "popoverTarget", "popoverTargetAction", "prefix", "property", "radioGroup", "rel", "resource", "results", "rev", "role", "security", "slot", "spellCheck", "style", "subType", "suppressContentEditableWarning", "suppressHydrationWarning", "tabIndex", "title", "translate", "typeof", "unselectable", "vocab"];
|
|
1047
1251
|
readonly notFound: readonly [];
|
|
1048
1252
|
readonly page: readonly ["layout", "layoutContainer", "seoEnabled", "seoPageDescription", "seoPageTitle"];
|
|
1049
|
-
readonly pagination: readonly ["loadMoreLabel", "mode", "nextLabel", "pageInfo", "pageParam", "previousLabel", "target", "windowSize"];
|
|
1253
|
+
readonly pagination: readonly ["label", "loadMoreLabel", "mode", "nextLabel", "pageInfo", "pageParam", "previousLabel", "target", "windowSize"];
|
|
1050
1254
|
readonly paragraph: readonly ["content"];
|
|
1051
1255
|
readonly reference: readonly ["referenceContainer", "referenceId", "referenceType"];
|
|
1052
1256
|
readonly richText: readonly ["content", "format", "mediaBaseUrl"];
|
|
@@ -1076,6 +1280,9 @@ export declare interface ElementAttributesBrand<A> {
|
|
|
1076
1280
|
readonly __attributes: A;
|
|
1077
1281
|
}
|
|
1078
1282
|
|
|
1283
|
+
/** The values each built-in type's enumerated attributes take — a heading's `subType`, a link's `mode`. */
|
|
1284
|
+
export declare const elementAttributeValues: Record<string, Record<string, readonly string[]>>;
|
|
1285
|
+
|
|
1079
1286
|
declare type ElementBinding = {
|
|
1080
1287
|
id: string;
|
|
1081
1288
|
source: string;
|
|
@@ -1085,6 +1292,15 @@ declare type ElementBinding = {
|
|
|
1085
1292
|
to: string;
|
|
1086
1293
|
};
|
|
1087
1294
|
|
|
1295
|
+
/**
|
|
1296
|
+
* Every element callback each built-in type answers to: `setState` and `toggleState`, which every element registers,
|
|
1297
|
+
* and the ones its declaration adds.
|
|
1298
|
+
*
|
|
1299
|
+
* A callback runs on the element it names, so aiming it at one of the wrong type is the same silent dead end as a
|
|
1300
|
+
* trigger on the wrong element — the builder offers `openModal` only on a modal, and a hand-written step does not.
|
|
1301
|
+
*/
|
|
1302
|
+
export declare const elementCallbacks: Record<string, string[]>;
|
|
1303
|
+
|
|
1088
1304
|
/** Keyed by the schema `type`, which is what a document and every catalog address a type by. */
|
|
1089
1305
|
export declare const elementCatalog: Record<string, ElementSemantics>;
|
|
1090
1306
|
|
|
@@ -1105,6 +1321,35 @@ export declare interface ElementDeclarationData {
|
|
|
1105
1321
|
* reads it to resolve a binding that named the element alone.
|
|
1106
1322
|
*/
|
|
1107
1323
|
sourceType?: string;
|
|
1324
|
+
/**
|
|
1325
|
+
* The triggers this type fires on top of the ones every element does (`onClick`, `onLoad`…), by action name.
|
|
1326
|
+
*
|
|
1327
|
+
* Declared here for the reason `sourceType` is: the component registers exactly these, and the authoring surface
|
|
1328
|
+
* reads them to refuse a flow that starts on a trigger its element never fires — an `onSubmit` on the submit
|
|
1329
|
+
* button rather than on the form is a flow that is written, saved and silently never runs.
|
|
1330
|
+
*/
|
|
1331
|
+
triggers?: Record<string, InteractionCallback>;
|
|
1332
|
+
/**
|
|
1333
|
+
* The callbacks this type runs on itself on top of the ones every element does (`setState`, `toggleState`) —
|
|
1334
|
+
* their static half. The component adds what only a mounted element has: the function, a title naming its label,
|
|
1335
|
+
* options drawn from its children. Read by the authoring surface to refuse a step aimed at an element that does not
|
|
1336
|
+
* answer to it — an `openModal` sent to a plain container is a button that does nothing.
|
|
1337
|
+
*/
|
|
1338
|
+
callbacks?: Record<string, InteractionCallback>;
|
|
1339
|
+
/**
|
|
1340
|
+
* The type this one only works somewhere inside: it reads its state from that element's context, and anywhere
|
|
1341
|
+
* else it throws on its first render. A dropdown's panel, a tab container's header and body.
|
|
1342
|
+
*/
|
|
1343
|
+
ancestorType?: string;
|
|
1344
|
+
/**
|
|
1345
|
+
* The values an enumerated attribute takes — a heading's `subType`, a link's `mode` — by attribute name.
|
|
1346
|
+
*
|
|
1347
|
+
* A component's props say this in TypeScript, which is gone at run time; an author writing JavaScript, a document
|
|
1348
|
+
* that arrived as JSON or a value that went through a cast reaches the element anyway, and `subType: 'h7'` renders an
|
|
1349
|
+
* `<h7>`. Written with {@link valuesOf}, so the list cannot drift from the props it mirrors; read by the authoring
|
|
1350
|
+
* surface to refuse a value outside it.
|
|
1351
|
+
*/
|
|
1352
|
+
attributeValues?: Record<string, readonly string[]>;
|
|
1108
1353
|
content?: {
|
|
1109
1354
|
attributes?: Record<string, unknown>;
|
|
1110
1355
|
definition?: {
|
|
@@ -1118,7 +1363,95 @@ export declare type ElementDeclarationName = keyof typeof elementDeclarations;
|
|
|
1118
1363
|
declare const elementDeclarations: {
|
|
1119
1364
|
readonly ApiContainer: {
|
|
1120
1365
|
readonly type: "apiContainer";
|
|
1366
|
+
readonly attributeValues: {
|
|
1367
|
+
readonly subType: readonly string[];
|
|
1368
|
+
readonly method: readonly string[];
|
|
1369
|
+
readonly credentials: readonly string[];
|
|
1370
|
+
readonly pagination: readonly string[];
|
|
1371
|
+
};
|
|
1121
1372
|
readonly sourceType: "apiContainer";
|
|
1373
|
+
readonly triggers: {
|
|
1374
|
+
readonly onApiError: {
|
|
1375
|
+
readonly action: "onApiError";
|
|
1376
|
+
readonly title: "On Api Error";
|
|
1377
|
+
readonly type: "trigger";
|
|
1378
|
+
readonly params: {};
|
|
1379
|
+
readonly preview: {
|
|
1380
|
+
readonly url: "";
|
|
1381
|
+
readonly method: "";
|
|
1382
|
+
readonly status: "";
|
|
1383
|
+
readonly data: "";
|
|
1384
|
+
};
|
|
1385
|
+
};
|
|
1386
|
+
readonly onApiSuccess: {
|
|
1387
|
+
readonly action: "onApiSuccess";
|
|
1388
|
+
readonly title: "On Api Success";
|
|
1389
|
+
readonly type: "trigger";
|
|
1390
|
+
readonly params: {};
|
|
1391
|
+
readonly preview: {
|
|
1392
|
+
readonly url: "";
|
|
1393
|
+
readonly method: "";
|
|
1394
|
+
readonly status: "";
|
|
1395
|
+
readonly data: "";
|
|
1396
|
+
};
|
|
1397
|
+
};
|
|
1398
|
+
};
|
|
1399
|
+
readonly callbacks: {
|
|
1400
|
+
readonly performQuery: {
|
|
1401
|
+
readonly action: "performQuery";
|
|
1402
|
+
readonly title: "Perform Query";
|
|
1403
|
+
readonly type: "callback";
|
|
1404
|
+
readonly preview: {};
|
|
1405
|
+
readonly params: {
|
|
1406
|
+
readonly input: {
|
|
1407
|
+
readonly label: "Input (server providers)";
|
|
1408
|
+
readonly type: "codemirror-json";
|
|
1409
|
+
readonly defaultValue: "{}";
|
|
1410
|
+
readonly description: string;
|
|
1411
|
+
};
|
|
1412
|
+
};
|
|
1413
|
+
};
|
|
1414
|
+
readonly loadMore: {
|
|
1415
|
+
readonly action: "loadMore";
|
|
1416
|
+
readonly title: "Load More";
|
|
1417
|
+
readonly type: "callback";
|
|
1418
|
+
readonly preview: {};
|
|
1419
|
+
readonly params: {};
|
|
1420
|
+
};
|
|
1421
|
+
readonly goToPage: {
|
|
1422
|
+
readonly action: "goToPage";
|
|
1423
|
+
readonly title: "Go To Page";
|
|
1424
|
+
readonly type: "callback";
|
|
1425
|
+
readonly preview: {};
|
|
1426
|
+
readonly params: {
|
|
1427
|
+
readonly page: {
|
|
1428
|
+
readonly label: "Page";
|
|
1429
|
+
readonly defaultValue: "1";
|
|
1430
|
+
readonly type: "text";
|
|
1431
|
+
};
|
|
1432
|
+
};
|
|
1433
|
+
};
|
|
1434
|
+
readonly writeRecord: {
|
|
1435
|
+
readonly action: "writeRecord";
|
|
1436
|
+
readonly title: "Write Record";
|
|
1437
|
+
readonly type: "callback";
|
|
1438
|
+
readonly preview: {
|
|
1439
|
+
readonly action: "create";
|
|
1440
|
+
};
|
|
1441
|
+
readonly params: {
|
|
1442
|
+
readonly action: {
|
|
1443
|
+
readonly label: "Endpoint";
|
|
1444
|
+
readonly defaultValue: "create";
|
|
1445
|
+
readonly type: "text";
|
|
1446
|
+
};
|
|
1447
|
+
readonly recordId: {
|
|
1448
|
+
readonly label: "Record Id";
|
|
1449
|
+
readonly defaultValue: "";
|
|
1450
|
+
readonly type: "text";
|
|
1451
|
+
};
|
|
1452
|
+
};
|
|
1453
|
+
};
|
|
1454
|
+
};
|
|
1122
1455
|
readonly content: {
|
|
1123
1456
|
readonly attributes: {
|
|
1124
1457
|
readonly query: "";
|
|
@@ -1286,6 +1619,10 @@ declare const elementDeclarations: {
|
|
|
1286
1619
|
} & ElementAttributesBrand<BlockJsxAttributes>;
|
|
1287
1620
|
readonly Button: {
|
|
1288
1621
|
readonly type: "button";
|
|
1622
|
+
readonly attributeValues: {
|
|
1623
|
+
readonly subType: readonly string[];
|
|
1624
|
+
readonly contentPlacement: readonly string[];
|
|
1625
|
+
};
|
|
1289
1626
|
readonly content: {
|
|
1290
1627
|
readonly attributes: {
|
|
1291
1628
|
readonly contentPlacement: "after";
|
|
@@ -1345,7 +1682,7 @@ declare const elementDeclarations: {
|
|
|
1345
1682
|
readonly 'padding-bottom': "6px";
|
|
1346
1683
|
readonly cursor: "pointer";
|
|
1347
1684
|
readonly 'font-size': "16px";
|
|
1348
|
-
readonly 'line-height': "
|
|
1685
|
+
readonly 'line-height': "1.5";
|
|
1349
1686
|
readonly 'border-top-left-radius': "4px";
|
|
1350
1687
|
readonly 'border-top-right-radius': "4px";
|
|
1351
1688
|
readonly 'border-bottom-left-radius': "4px";
|
|
@@ -1366,7 +1703,7 @@ declare const elementDeclarations: {
|
|
|
1366
1703
|
readonly 'padding-bottom': "6px";
|
|
1367
1704
|
readonly cursor: "pointer";
|
|
1368
1705
|
readonly 'font-size': "16px";
|
|
1369
|
-
readonly 'line-height': "
|
|
1706
|
+
readonly 'line-height': "1.5";
|
|
1370
1707
|
readonly 'border-top-left-radius': "4px";
|
|
1371
1708
|
readonly 'border-top-right-radius': "4px";
|
|
1372
1709
|
readonly 'border-bottom-left-radius': "4px";
|
|
@@ -1387,7 +1724,7 @@ declare const elementDeclarations: {
|
|
|
1387
1724
|
readonly 'padding-bottom': "6px";
|
|
1388
1725
|
readonly cursor: "pointer";
|
|
1389
1726
|
readonly 'font-size': "16px";
|
|
1390
|
-
readonly 'line-height': "
|
|
1727
|
+
readonly 'line-height': "1.5";
|
|
1391
1728
|
readonly 'border-top-left-radius': "4px";
|
|
1392
1729
|
readonly 'border-top-right-radius': "4px";
|
|
1393
1730
|
readonly 'border-bottom-left-radius': "4px";
|
|
@@ -1401,6 +1738,7 @@ declare const elementDeclarations: {
|
|
|
1401
1738
|
readonly settings: {};
|
|
1402
1739
|
};
|
|
1403
1740
|
} & ElementAttributesBrand<Partial<{
|
|
1741
|
+
label?: string | undefined;
|
|
1404
1742
|
title?: string | undefined;
|
|
1405
1743
|
content?: string | undefined;
|
|
1406
1744
|
disabled?: boolean | undefined;
|
|
@@ -1409,8 +1747,144 @@ declare const elementDeclarations: {
|
|
|
1409
1747
|
ariaExpanded?: boolean | undefined;
|
|
1410
1748
|
ariaPressed?: boolean | undefined;
|
|
1411
1749
|
}>>;
|
|
1750
|
+
readonly Channel: {
|
|
1751
|
+
readonly type: "channel";
|
|
1752
|
+
readonly attributeValues: {
|
|
1753
|
+
readonly subType: readonly string[];
|
|
1754
|
+
};
|
|
1755
|
+
readonly sourceType: "channel";
|
|
1756
|
+
readonly triggers: {
|
|
1757
|
+
readonly onMessage: {
|
|
1758
|
+
readonly action: "onMessage";
|
|
1759
|
+
readonly title: "On Message";
|
|
1760
|
+
readonly type: "trigger";
|
|
1761
|
+
readonly params: {};
|
|
1762
|
+
readonly preview: {
|
|
1763
|
+
readonly type: "";
|
|
1764
|
+
readonly data: "";
|
|
1765
|
+
readonly from: "";
|
|
1766
|
+
readonly user: "";
|
|
1767
|
+
readonly at: "";
|
|
1768
|
+
};
|
|
1769
|
+
};
|
|
1770
|
+
readonly onJoin: {
|
|
1771
|
+
readonly action: "onJoin";
|
|
1772
|
+
readonly title: "On Join";
|
|
1773
|
+
readonly type: "trigger";
|
|
1774
|
+
readonly params: {};
|
|
1775
|
+
readonly preview: {
|
|
1776
|
+
readonly from: "";
|
|
1777
|
+
readonly user: "";
|
|
1778
|
+
readonly state: {};
|
|
1779
|
+
};
|
|
1780
|
+
};
|
|
1781
|
+
readonly onLeave: {
|
|
1782
|
+
readonly action: "onLeave";
|
|
1783
|
+
readonly title: "On Leave";
|
|
1784
|
+
readonly type: "trigger";
|
|
1785
|
+
readonly params: {};
|
|
1786
|
+
readonly preview: {
|
|
1787
|
+
readonly from: "";
|
|
1788
|
+
readonly user: "";
|
|
1789
|
+
readonly state: {};
|
|
1790
|
+
};
|
|
1791
|
+
};
|
|
1792
|
+
};
|
|
1793
|
+
readonly callbacks: {
|
|
1794
|
+
readonly publish: {
|
|
1795
|
+
readonly action: "publish";
|
|
1796
|
+
readonly title: "Publish";
|
|
1797
|
+
readonly type: "callback";
|
|
1798
|
+
readonly preview: {};
|
|
1799
|
+
readonly params: {
|
|
1800
|
+
readonly type: {
|
|
1801
|
+
readonly label: "Type";
|
|
1802
|
+
readonly defaultValue: "";
|
|
1803
|
+
readonly type: "text";
|
|
1804
|
+
};
|
|
1805
|
+
readonly data: {
|
|
1806
|
+
readonly label: "Data (JSON or a template)";
|
|
1807
|
+
readonly defaultValue: "";
|
|
1808
|
+
readonly type: "text";
|
|
1809
|
+
};
|
|
1810
|
+
};
|
|
1811
|
+
};
|
|
1812
|
+
readonly setPresence: {
|
|
1813
|
+
readonly action: "setPresence";
|
|
1814
|
+
readonly title: "Set Presence";
|
|
1815
|
+
readonly type: "callback";
|
|
1816
|
+
readonly preview: {};
|
|
1817
|
+
readonly params: {
|
|
1818
|
+
readonly data: {
|
|
1819
|
+
readonly label: "State (JSON or a template)";
|
|
1820
|
+
readonly defaultValue: "";
|
|
1821
|
+
readonly type: "text";
|
|
1822
|
+
};
|
|
1823
|
+
};
|
|
1824
|
+
};
|
|
1825
|
+
};
|
|
1826
|
+
readonly content: {
|
|
1827
|
+
readonly attributes: {
|
|
1828
|
+
readonly topic: "";
|
|
1829
|
+
readonly grant: "";
|
|
1830
|
+
readonly keep: 20;
|
|
1831
|
+
readonly subType: "";
|
|
1832
|
+
};
|
|
1833
|
+
readonly definition: {
|
|
1834
|
+
readonly label: "Channel";
|
|
1835
|
+
readonly type: "channel";
|
|
1836
|
+
readonly description: string;
|
|
1837
|
+
readonly items: readonly [];
|
|
1838
|
+
readonly bindings: {};
|
|
1839
|
+
readonly styleSelectors: {
|
|
1840
|
+
readonly base: "";
|
|
1841
|
+
};
|
|
1842
|
+
readonly initialState: {
|
|
1843
|
+
readonly visibility: true;
|
|
1844
|
+
};
|
|
1845
|
+
};
|
|
1846
|
+
readonly builder: {
|
|
1847
|
+
readonly canDelete: true;
|
|
1848
|
+
readonly canSelect: true;
|
|
1849
|
+
readonly canDragDrop: true;
|
|
1850
|
+
readonly canMove: true;
|
|
1851
|
+
readonly canTemplate: true;
|
|
1852
|
+
readonly itemsAllowed: readonly [];
|
|
1853
|
+
readonly itemsNotAllowed: readonly [];
|
|
1854
|
+
};
|
|
1855
|
+
readonly market: {
|
|
1856
|
+
readonly category: "provider";
|
|
1857
|
+
readonly owner: "Plitzi";
|
|
1858
|
+
readonly verified: true;
|
|
1859
|
+
readonly license: "MIT";
|
|
1860
|
+
readonly website: "https://plitzi.com";
|
|
1861
|
+
readonly backgroundColor: "#4422ee";
|
|
1862
|
+
readonly icon: "fa-solid fa-tower-broadcast";
|
|
1863
|
+
};
|
|
1864
|
+
readonly defaultStyle: {
|
|
1865
|
+
readonly name: "Channel";
|
|
1866
|
+
readonly displayMode: "desktop";
|
|
1867
|
+
readonly style: {
|
|
1868
|
+
readonly base: {
|
|
1869
|
+
readonly default: {};
|
|
1870
|
+
};
|
|
1871
|
+
};
|
|
1872
|
+
readonly subTypes: {};
|
|
1873
|
+
};
|
|
1874
|
+
readonly settings: {};
|
|
1875
|
+
};
|
|
1876
|
+
} & ElementAttributesBrand<Partial<{
|
|
1877
|
+
subType?: "" | "div" | "section" | "aside" | "main" | undefined;
|
|
1878
|
+
topic?: string | undefined;
|
|
1879
|
+
grant?: string | undefined;
|
|
1880
|
+
presence?: unknown;
|
|
1881
|
+
keep?: number | string | undefined;
|
|
1882
|
+
}>>;
|
|
1412
1883
|
readonly Container: {
|
|
1413
1884
|
readonly type: "container";
|
|
1885
|
+
readonly attributeValues: {
|
|
1886
|
+
readonly subType: readonly string[];
|
|
1887
|
+
};
|
|
1414
1888
|
readonly content: {
|
|
1415
1889
|
readonly attributes: {
|
|
1416
1890
|
readonly subType: "div";
|
|
@@ -1459,7 +1933,9 @@ declare const elementDeclarations: {
|
|
|
1459
1933
|
readonly settings: {};
|
|
1460
1934
|
};
|
|
1461
1935
|
} & ElementAttributesBrand<Partial<{
|
|
1462
|
-
|
|
1936
|
+
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;
|
|
1938
|
+
decorative?: boolean | undefined;
|
|
1463
1939
|
}>>;
|
|
1464
1940
|
readonly Custom: {
|
|
1465
1941
|
readonly type: "custom";
|
|
@@ -1516,6 +1992,87 @@ declare const elementDeclarations: {
|
|
|
1516
1992
|
readonly DialogContainer: {
|
|
1517
1993
|
readonly type: "dialogContainer";
|
|
1518
1994
|
readonly sourceType: "dialogContainer";
|
|
1995
|
+
readonly triggers: {
|
|
1996
|
+
readonly onDialogAccept: {
|
|
1997
|
+
readonly action: "onDialogAccept";
|
|
1998
|
+
readonly title: "On Dialog Accept";
|
|
1999
|
+
readonly type: "trigger";
|
|
2000
|
+
readonly params: {
|
|
2001
|
+
readonly metadata: {
|
|
2002
|
+
readonly type: "text";
|
|
2003
|
+
readonly defaultValue: "";
|
|
2004
|
+
};
|
|
2005
|
+
};
|
|
2006
|
+
readonly preview: {
|
|
2007
|
+
readonly metadata: "";
|
|
2008
|
+
};
|
|
2009
|
+
};
|
|
2010
|
+
readonly onDialogReject: {
|
|
2011
|
+
readonly action: "onDialogReject";
|
|
2012
|
+
readonly title: "On Dialog Reject";
|
|
2013
|
+
readonly type: "trigger";
|
|
2014
|
+
readonly params: {
|
|
2015
|
+
readonly metadata: {
|
|
2016
|
+
readonly type: "text";
|
|
2017
|
+
readonly defaultValue: "";
|
|
2018
|
+
};
|
|
2019
|
+
};
|
|
2020
|
+
readonly preview: {
|
|
2021
|
+
readonly metadata: "";
|
|
2022
|
+
};
|
|
2023
|
+
};
|
|
2024
|
+
readonly onDialogOpen: {
|
|
2025
|
+
readonly action: "onDialogOpen";
|
|
2026
|
+
readonly title: "On Dialog Open";
|
|
2027
|
+
readonly type: "trigger";
|
|
2028
|
+
readonly params: {
|
|
2029
|
+
readonly metadata: {
|
|
2030
|
+
readonly type: "text";
|
|
2031
|
+
readonly defaultValue: "";
|
|
2032
|
+
};
|
|
2033
|
+
};
|
|
2034
|
+
readonly preview: {
|
|
2035
|
+
readonly metadata: "";
|
|
2036
|
+
};
|
|
2037
|
+
};
|
|
2038
|
+
readonly onDialogClose: {
|
|
2039
|
+
readonly action: "onDialogClose";
|
|
2040
|
+
readonly title: "On Dialog Close";
|
|
2041
|
+
readonly type: "trigger";
|
|
2042
|
+
readonly params: {
|
|
2043
|
+
readonly metadata: {
|
|
2044
|
+
readonly type: "text";
|
|
2045
|
+
readonly defaultValue: "";
|
|
2046
|
+
};
|
|
2047
|
+
};
|
|
2048
|
+
readonly preview: {
|
|
2049
|
+
readonly metadata: "";
|
|
2050
|
+
};
|
|
2051
|
+
};
|
|
2052
|
+
};
|
|
2053
|
+
readonly callbacks: {
|
|
2054
|
+
readonly openDialog: {
|
|
2055
|
+
readonly action: "openDialog";
|
|
2056
|
+
readonly title: "Open Dialog";
|
|
2057
|
+
readonly type: "callback";
|
|
2058
|
+
readonly params: {
|
|
2059
|
+
readonly metadata: {
|
|
2060
|
+
readonly type: "text";
|
|
2061
|
+
readonly defaultValue: "";
|
|
2062
|
+
};
|
|
2063
|
+
};
|
|
2064
|
+
readonly preview: {
|
|
2065
|
+
readonly metadata: "";
|
|
2066
|
+
};
|
|
2067
|
+
};
|
|
2068
|
+
readonly closeDialog: {
|
|
2069
|
+
readonly action: "closeDialog";
|
|
2070
|
+
readonly title: "Close Dialog";
|
|
2071
|
+
readonly type: "callback";
|
|
2072
|
+
readonly preview: {};
|
|
2073
|
+
readonly params: {};
|
|
2074
|
+
};
|
|
2075
|
+
};
|
|
1519
2076
|
readonly content: {
|
|
1520
2077
|
readonly attributes: {
|
|
1521
2078
|
readonly headerLabel: "Dialog Header";
|
|
@@ -1597,7 +2154,7 @@ declare const elementDeclarations: {
|
|
|
1597
2154
|
readonly left: "50%";
|
|
1598
2155
|
readonly width: "500px";
|
|
1599
2156
|
readonly height: "300px";
|
|
1600
|
-
readonly 'background-color': "white";
|
|
2157
|
+
readonly 'background-color': "light-dark(white, oklch(0.21 0.006 285.885))";
|
|
1601
2158
|
readonly transform: "translate3d(-50%, -50%, 0px)";
|
|
1602
2159
|
readonly 'padding-top': "20px";
|
|
1603
2160
|
readonly 'padding-bottom': "20px";
|
|
@@ -1665,6 +2222,9 @@ declare const elementDeclarations: {
|
|
|
1665
2222
|
}>>;
|
|
1666
2223
|
readonly Dropdown: {
|
|
1667
2224
|
readonly type: "dropdown";
|
|
2225
|
+
readonly attributeValues: {
|
|
2226
|
+
readonly popupPlacement: readonly string[];
|
|
2227
|
+
};
|
|
1668
2228
|
readonly content: {
|
|
1669
2229
|
readonly attributes: {
|
|
1670
2230
|
readonly popupPlacement: "bottom";
|
|
@@ -1746,6 +2306,7 @@ declare const elementDeclarations: {
|
|
|
1746
2306
|
}>>;
|
|
1747
2307
|
readonly DropdownPopup: {
|
|
1748
2308
|
readonly type: "dropdownPopup";
|
|
2309
|
+
readonly ancestorType: "dropdown";
|
|
1749
2310
|
readonly content: {
|
|
1750
2311
|
readonly attributes: {};
|
|
1751
2312
|
readonly definition: {
|
|
@@ -1783,7 +2344,7 @@ declare const elementDeclarations: {
|
|
|
1783
2344
|
readonly style: {
|
|
1784
2345
|
readonly base: {
|
|
1785
2346
|
readonly default: {
|
|
1786
|
-
readonly 'background-color': "white";
|
|
2347
|
+
readonly 'background-color': "light-dark(white, oklch(0.21 0.006 285.885))";
|
|
1787
2348
|
readonly 'padding-right': "4px";
|
|
1788
2349
|
readonly 'padding-bottom': "4px";
|
|
1789
2350
|
readonly 'padding-left': "4px";
|
|
@@ -1860,12 +2421,73 @@ declare const elementDeclarations: {
|
|
|
1860
2421
|
};
|
|
1861
2422
|
} & ElementAttributesBrand<Partial<{
|
|
1862
2423
|
size?: string | undefined;
|
|
2424
|
+
label?: string | undefined;
|
|
1863
2425
|
icon?: string | undefined;
|
|
1864
2426
|
iconAnimation?: string | undefined;
|
|
1865
2427
|
}>>;
|
|
1866
2428
|
readonly Form: {
|
|
1867
2429
|
readonly type: "form";
|
|
2430
|
+
readonly attributeValues: {
|
|
2431
|
+
readonly method: readonly string[];
|
|
2432
|
+
};
|
|
1868
2433
|
readonly sourceType: "apiContainer";
|
|
2434
|
+
readonly triggers: {
|
|
2435
|
+
readonly onSubmit: {
|
|
2436
|
+
readonly action: "onSubmit";
|
|
2437
|
+
readonly title: "On Form Submit";
|
|
2438
|
+
readonly type: "trigger";
|
|
2439
|
+
readonly params: {};
|
|
2440
|
+
readonly preview: {
|
|
2441
|
+
readonly values: {};
|
|
2442
|
+
readonly actionUrl: "";
|
|
2443
|
+
readonly method: "";
|
|
2444
|
+
};
|
|
2445
|
+
};
|
|
2446
|
+
};
|
|
2447
|
+
readonly callbacks: {
|
|
2448
|
+
readonly performReset: {
|
|
2449
|
+
readonly action: "performReset";
|
|
2450
|
+
readonly title: "Reset Form";
|
|
2451
|
+
readonly type: "callback";
|
|
2452
|
+
readonly params: {};
|
|
2453
|
+
};
|
|
2454
|
+
readonly setFieldValue: {
|
|
2455
|
+
readonly action: "setFieldValue";
|
|
2456
|
+
readonly title: "Set Field Value";
|
|
2457
|
+
readonly type: "callback";
|
|
2458
|
+
readonly preview: {};
|
|
2459
|
+
readonly params: {
|
|
2460
|
+
readonly name: {
|
|
2461
|
+
readonly label: "Field Name";
|
|
2462
|
+
readonly defaultValue: undefined;
|
|
2463
|
+
readonly type: "select";
|
|
2464
|
+
readonly options: [];
|
|
2465
|
+
};
|
|
2466
|
+
readonly value: {
|
|
2467
|
+
readonly type: "text";
|
|
2468
|
+
readonly defaultValue: "";
|
|
2469
|
+
};
|
|
2470
|
+
};
|
|
2471
|
+
};
|
|
2472
|
+
readonly setFieldError: {
|
|
2473
|
+
readonly action: "setFieldError";
|
|
2474
|
+
readonly title: "Set Field Error";
|
|
2475
|
+
readonly type: "callback";
|
|
2476
|
+
readonly preview: {};
|
|
2477
|
+
readonly params: {
|
|
2478
|
+
readonly name: {
|
|
2479
|
+
readonly label: "Field Name";
|
|
2480
|
+
readonly defaultValue: undefined;
|
|
2481
|
+
readonly type: "select";
|
|
2482
|
+
readonly options: [];
|
|
2483
|
+
};
|
|
2484
|
+
readonly error: {
|
|
2485
|
+
readonly type: "text";
|
|
2486
|
+
readonly defaultValue: "";
|
|
2487
|
+
};
|
|
2488
|
+
};
|
|
2489
|
+
};
|
|
2490
|
+
};
|
|
1869
2491
|
readonly content: {
|
|
1870
2492
|
readonly attributes: {
|
|
1871
2493
|
readonly method: "get";
|
|
@@ -1926,14 +2548,31 @@ declare const elementDeclarations: {
|
|
|
1926
2548
|
}>>;
|
|
1927
2549
|
readonly FormControl: {
|
|
1928
2550
|
readonly type: "formControl";
|
|
2551
|
+
readonly attributeValues: {
|
|
2552
|
+
readonly subType: readonly string[];
|
|
2553
|
+
};
|
|
2554
|
+
readonly triggers: {
|
|
2555
|
+
readonly onChange: {
|
|
2556
|
+
readonly action: "onChange";
|
|
2557
|
+
readonly title: "On Change";
|
|
2558
|
+
readonly type: "trigger";
|
|
2559
|
+
readonly params: {};
|
|
2560
|
+
readonly preview: {
|
|
2561
|
+
readonly value: "";
|
|
2562
|
+
readonly name: "";
|
|
2563
|
+
};
|
|
2564
|
+
};
|
|
2565
|
+
};
|
|
1929
2566
|
readonly content: {
|
|
1930
2567
|
readonly attributes: {
|
|
1931
2568
|
readonly subType: "text";
|
|
1932
2569
|
readonly name: "";
|
|
1933
2570
|
readonly label: "Label";
|
|
2571
|
+
readonly hideLabel: false;
|
|
1934
2572
|
readonly placeholder: "";
|
|
1935
2573
|
readonly defaultValue: "";
|
|
1936
2574
|
readonly autoComplete: true;
|
|
2575
|
+
readonly autoFocus: false;
|
|
1937
2576
|
readonly disabled: false;
|
|
1938
2577
|
readonly options: readonly [];
|
|
1939
2578
|
readonly required: true;
|
|
@@ -2420,6 +3059,9 @@ declare const elementDeclarations: {
|
|
|
2420
3059
|
} & ElementAttributesBrand<FormControlAttributes>;
|
|
2421
3060
|
readonly Heading: {
|
|
2422
3061
|
readonly type: "heading";
|
|
3062
|
+
readonly attributeValues: {
|
|
3063
|
+
readonly subType: readonly string[];
|
|
3064
|
+
};
|
|
2423
3065
|
readonly content: {
|
|
2424
3066
|
readonly attributes: {
|
|
2425
3067
|
readonly content: "Heading";
|
|
@@ -2474,7 +3116,7 @@ declare const elementDeclarations: {
|
|
|
2474
3116
|
readonly 'margin-bottom': "25px";
|
|
2475
3117
|
readonly 'font-size': "38px";
|
|
2476
3118
|
readonly 'font-weight': 700;
|
|
2477
|
-
readonly 'line-height': "
|
|
3119
|
+
readonly 'line-height': "1.158";
|
|
2478
3120
|
};
|
|
2479
3121
|
};
|
|
2480
3122
|
};
|
|
@@ -2489,7 +3131,7 @@ declare const elementDeclarations: {
|
|
|
2489
3131
|
readonly 'margin-bottom': "25px";
|
|
2490
3132
|
readonly 'font-size': "32px";
|
|
2491
3133
|
readonly 'font-weight': 700;
|
|
2492
|
-
readonly 'line-height': "
|
|
3134
|
+
readonly 'line-height': "1.125";
|
|
2493
3135
|
};
|
|
2494
3136
|
};
|
|
2495
3137
|
};
|
|
@@ -2504,7 +3146,7 @@ declare const elementDeclarations: {
|
|
|
2504
3146
|
readonly 'margin-bottom': "25px";
|
|
2505
3147
|
readonly 'font-size': "24px";
|
|
2506
3148
|
readonly 'font-weight': 700;
|
|
2507
|
-
readonly 'line-height': "
|
|
3149
|
+
readonly 'line-height': "1.25";
|
|
2508
3150
|
};
|
|
2509
3151
|
};
|
|
2510
3152
|
};
|
|
@@ -2519,7 +3161,7 @@ declare const elementDeclarations: {
|
|
|
2519
3161
|
readonly 'margin-bottom': "25px";
|
|
2520
3162
|
readonly 'font-size': "18px";
|
|
2521
3163
|
readonly 'font-weight': 700;
|
|
2522
|
-
readonly 'line-height': "
|
|
3164
|
+
readonly 'line-height': "1.333";
|
|
2523
3165
|
};
|
|
2524
3166
|
};
|
|
2525
3167
|
};
|
|
@@ -2534,7 +3176,7 @@ declare const elementDeclarations: {
|
|
|
2534
3176
|
readonly 'margin-bottom': "25px";
|
|
2535
3177
|
readonly 'font-size': "14px";
|
|
2536
3178
|
readonly 'font-weight': 700;
|
|
2537
|
-
readonly 'line-height': "
|
|
3179
|
+
readonly 'line-height': "1.429";
|
|
2538
3180
|
};
|
|
2539
3181
|
};
|
|
2540
3182
|
};
|
|
@@ -2549,7 +3191,7 @@ declare const elementDeclarations: {
|
|
|
2549
3191
|
readonly 'margin-bottom': "25px";
|
|
2550
3192
|
readonly 'font-size': "12px";
|
|
2551
3193
|
readonly 'font-weight': 700;
|
|
2552
|
-
readonly 'line-height': "
|
|
3194
|
+
readonly 'line-height': "1.5";
|
|
2553
3195
|
};
|
|
2554
3196
|
};
|
|
2555
3197
|
};
|
|
@@ -2564,10 +3206,15 @@ declare const elementDeclarations: {
|
|
|
2564
3206
|
}>>;
|
|
2565
3207
|
readonly Image: {
|
|
2566
3208
|
readonly type: "image";
|
|
3209
|
+
readonly attributeValues: {
|
|
3210
|
+
readonly fetchPriority: readonly string[];
|
|
3211
|
+
readonly loadMode: readonly string[];
|
|
3212
|
+
};
|
|
2567
3213
|
readonly content: {
|
|
2568
3214
|
readonly attributes: {
|
|
2569
3215
|
readonly src: "https://cdn.plitzi.com/resources/img/placeholder-img.svg";
|
|
2570
3216
|
readonly alt: "";
|
|
3217
|
+
readonly decorative: false;
|
|
2571
3218
|
readonly fetchPriority: "auto";
|
|
2572
3219
|
readonly loadMode: "auto";
|
|
2573
3220
|
};
|
|
@@ -2620,10 +3267,14 @@ declare const elementDeclarations: {
|
|
|
2620
3267
|
fetchPriority?: "high" | "low" | "auto" | undefined;
|
|
2621
3268
|
src?: string | undefined;
|
|
2622
3269
|
alt?: string | undefined;
|
|
2623
|
-
|
|
3270
|
+
decorative?: boolean | undefined;
|
|
3271
|
+
loadMode?: "auto" | "eager" | "lazy" | undefined;
|
|
2624
3272
|
}>>;
|
|
2625
3273
|
readonly LayoutContainer: {
|
|
2626
3274
|
readonly type: "layoutContainer";
|
|
3275
|
+
readonly attributeValues: {
|
|
3276
|
+
readonly subType: readonly string[];
|
|
3277
|
+
};
|
|
2627
3278
|
readonly content: {
|
|
2628
3279
|
readonly attributes: {
|
|
2629
3280
|
readonly subType: "div";
|
|
@@ -2678,6 +3329,10 @@ declare const elementDeclarations: {
|
|
|
2678
3329
|
}>>;
|
|
2679
3330
|
readonly Link: {
|
|
2680
3331
|
readonly type: "link";
|
|
3332
|
+
readonly attributeValues: {
|
|
3333
|
+
readonly mode: readonly string[];
|
|
3334
|
+
readonly target: readonly string[];
|
|
3335
|
+
};
|
|
2681
3336
|
readonly content: {
|
|
2682
3337
|
readonly attributes: {
|
|
2683
3338
|
readonly href: "#";
|
|
@@ -2733,12 +3388,16 @@ declare const elementDeclarations: {
|
|
|
2733
3388
|
};
|
|
2734
3389
|
} & ElementAttributesBrand<Partial<{
|
|
2735
3390
|
mode?: "page" | "internal" | "external" | undefined;
|
|
3391
|
+
href?: string | undefined;
|
|
2736
3392
|
label?: string | undefined;
|
|
2737
3393
|
target?: "self" | "blank" | "parent" | "top" | undefined;
|
|
2738
|
-
href?: string | undefined;
|
|
2739
3394
|
}>>;
|
|
2740
3395
|
readonly List: {
|
|
2741
3396
|
readonly type: "list";
|
|
3397
|
+
readonly attributeValues: {
|
|
3398
|
+
readonly subType: readonly string[];
|
|
3399
|
+
readonly source: readonly string[];
|
|
3400
|
+
};
|
|
2742
3401
|
readonly sourceType: "list";
|
|
2743
3402
|
readonly content: {
|
|
2744
3403
|
readonly attributes: {
|
|
@@ -2958,7 +3617,7 @@ declare const elementDeclarations: {
|
|
|
2958
3617
|
readonly base: {
|
|
2959
3618
|
readonly default: {
|
|
2960
3619
|
readonly 'font-size': "14px";
|
|
2961
|
-
readonly 'line-height': "
|
|
3620
|
+
readonly 'line-height': "1.714";
|
|
2962
3621
|
};
|
|
2963
3622
|
};
|
|
2964
3623
|
};
|
|
@@ -2971,13 +3630,59 @@ declare const elementDeclarations: {
|
|
|
2971
3630
|
readonly ModalContainer: {
|
|
2972
3631
|
readonly type: "modalContainer";
|
|
2973
3632
|
readonly sourceType: "modalContainer";
|
|
2974
|
-
readonly
|
|
2975
|
-
readonly
|
|
2976
|
-
readonly
|
|
2977
|
-
readonly
|
|
3633
|
+
readonly triggers: {
|
|
3634
|
+
readonly onModalOpen: {
|
|
3635
|
+
readonly action: "onModalOpen";
|
|
3636
|
+
readonly title: "On Modal Open";
|
|
3637
|
+
readonly type: "trigger";
|
|
3638
|
+
readonly params: {
|
|
3639
|
+
readonly metadata: {
|
|
3640
|
+
readonly type: "text";
|
|
3641
|
+
readonly defaultValue: "";
|
|
3642
|
+
};
|
|
3643
|
+
};
|
|
3644
|
+
readonly preview: {
|
|
3645
|
+
readonly metadata: "";
|
|
3646
|
+
};
|
|
2978
3647
|
};
|
|
2979
|
-
readonly
|
|
2980
|
-
readonly
|
|
3648
|
+
readonly onModalClose: {
|
|
3649
|
+
readonly action: "onModalClose";
|
|
3650
|
+
readonly title: "On Modal Close";
|
|
3651
|
+
readonly type: "trigger";
|
|
3652
|
+
readonly preview: {};
|
|
3653
|
+
readonly params: {};
|
|
3654
|
+
};
|
|
3655
|
+
};
|
|
3656
|
+
readonly callbacks: {
|
|
3657
|
+
readonly openModal: {
|
|
3658
|
+
readonly action: "openModal";
|
|
3659
|
+
readonly title: "Open Modal";
|
|
3660
|
+
readonly type: "callback";
|
|
3661
|
+
readonly params: {
|
|
3662
|
+
readonly metadata: {
|
|
3663
|
+
readonly type: "text";
|
|
3664
|
+
readonly defaultValue: "";
|
|
3665
|
+
};
|
|
3666
|
+
};
|
|
3667
|
+
readonly preview: {
|
|
3668
|
+
readonly metadata: "";
|
|
3669
|
+
};
|
|
3670
|
+
};
|
|
3671
|
+
readonly closeModal: {
|
|
3672
|
+
readonly action: "closeModal";
|
|
3673
|
+
readonly title: "Close Modal";
|
|
3674
|
+
readonly type: "callback";
|
|
3675
|
+
readonly params: {};
|
|
3676
|
+
readonly preview: {};
|
|
3677
|
+
};
|
|
3678
|
+
};
|
|
3679
|
+
readonly content: {
|
|
3680
|
+
readonly attributes: {
|
|
3681
|
+
readonly title: "Modal Header";
|
|
3682
|
+
readonly autoHideAfterClick: true;
|
|
3683
|
+
};
|
|
3684
|
+
readonly definition: {
|
|
3685
|
+
readonly label: "Modal Container";
|
|
2981
3686
|
readonly type: "modalContainer";
|
|
2982
3687
|
readonly description: "A modal overlay container opened and closed through interactions; use for dialogs over the page.";
|
|
2983
3688
|
readonly items: readonly [];
|
|
@@ -3047,7 +3752,7 @@ declare const elementDeclarations: {
|
|
|
3047
3752
|
readonly left: "50%";
|
|
3048
3753
|
readonly width: "500px";
|
|
3049
3754
|
readonly height: "300px";
|
|
3050
|
-
readonly 'background-color': "white";
|
|
3755
|
+
readonly 'background-color': "light-dark(white, oklch(0.21 0.006 285.885))";
|
|
3051
3756
|
readonly transform: "translate3d(-50%, -50%, 0px)";
|
|
3052
3757
|
readonly 'border-top-left-radius': "8px";
|
|
3053
3758
|
readonly 'border-top-right-radius': "8px";
|
|
@@ -3061,7 +3766,7 @@ declare const elementDeclarations: {
|
|
|
3061
3766
|
readonly 'align-items': "center";
|
|
3062
3767
|
readonly 'justify-content': "space-between";
|
|
3063
3768
|
readonly 'border-bottom-width': "1px";
|
|
3064
|
-
readonly 'border-bottom-color': "#d1d5db";
|
|
3769
|
+
readonly 'border-bottom-color': "light-dark(#d1d5db, oklch(0.37 0.013 285.805))";
|
|
3065
3770
|
readonly 'border-bottom-style': "solid";
|
|
3066
3771
|
readonly 'padding-left': "20px";
|
|
3067
3772
|
readonly 'padding-right': "20px";
|
|
@@ -3178,6 +3883,7 @@ declare const elementDeclarations: {
|
|
|
3178
3883
|
defaultValue?: string | number | readonly string[] | undefined;
|
|
3179
3884
|
onLoad?: ReactEventHandler<"span"> | undefined;
|
|
3180
3885
|
onClick?: MouseEventHandler<"span"> | undefined;
|
|
3886
|
+
onPointerDown?: PointerEventHandler<"span"> | undefined;
|
|
3181
3887
|
onMouseEnter?: MouseEventHandler<"span"> | undefined;
|
|
3182
3888
|
onMouseLeave?: MouseEventHandler<"span"> | undefined;
|
|
3183
3889
|
onFocus?: FocusEventHandler<"span"> | undefined;
|
|
@@ -3366,7 +4072,6 @@ declare const elementDeclarations: {
|
|
|
3366
4072
|
onTouchMoveCapture?: TouchEventHandler<"span"> | undefined;
|
|
3367
4073
|
onTouchStart?: TouchEventHandler<"span"> | undefined;
|
|
3368
4074
|
onTouchStartCapture?: TouchEventHandler<"span"> | undefined;
|
|
3369
|
-
onPointerDown?: PointerEventHandler<"span"> | undefined;
|
|
3370
4075
|
onPointerDownCapture?: PointerEventHandler<"span"> | undefined;
|
|
3371
4076
|
onPointerMove?: PointerEventHandler<"span"> | undefined;
|
|
3372
4077
|
onPointerMoveCapture?: PointerEventHandler<"span"> | undefined;
|
|
@@ -3498,6 +4203,19 @@ declare const elementDeclarations: {
|
|
|
3498
4203
|
} & ElementAttributesBrand<unknown>;
|
|
3499
4204
|
readonly Page: {
|
|
3500
4205
|
readonly type: "page";
|
|
4206
|
+
readonly triggers: {
|
|
4207
|
+
readonly onPageLoad: {
|
|
4208
|
+
readonly action: "onPageLoad";
|
|
4209
|
+
readonly title: "On Page Load";
|
|
4210
|
+
readonly type: "trigger";
|
|
4211
|
+
readonly params: {};
|
|
4212
|
+
readonly preview: {
|
|
4213
|
+
readonly pageId: "";
|
|
4214
|
+
readonly routeParams: "";
|
|
4215
|
+
readonly queryParams: "";
|
|
4216
|
+
};
|
|
4217
|
+
};
|
|
4218
|
+
};
|
|
3501
4219
|
readonly content: {
|
|
3502
4220
|
readonly attributes: {
|
|
3503
4221
|
readonly enabled: true;
|
|
@@ -3573,6 +4291,21 @@ declare const elementDeclarations: {
|
|
|
3573
4291
|
}>>;
|
|
3574
4292
|
readonly Pagination: {
|
|
3575
4293
|
readonly type: "pagination";
|
|
4294
|
+
readonly attributeValues: {
|
|
4295
|
+
readonly mode: readonly string[];
|
|
4296
|
+
readonly target: readonly string[];
|
|
4297
|
+
};
|
|
4298
|
+
readonly triggers: {
|
|
4299
|
+
readonly onPageChange: {
|
|
4300
|
+
readonly action: "onPageChange";
|
|
4301
|
+
readonly title: "On Page Change";
|
|
4302
|
+
readonly type: "trigger";
|
|
4303
|
+
readonly params: {};
|
|
4304
|
+
readonly preview: {
|
|
4305
|
+
readonly page: "1";
|
|
4306
|
+
};
|
|
4307
|
+
};
|
|
4308
|
+
};
|
|
3576
4309
|
readonly content: {
|
|
3577
4310
|
readonly attributes: {
|
|
3578
4311
|
readonly pageInfo: {};
|
|
@@ -3634,6 +4367,7 @@ declare const elementDeclarations: {
|
|
|
3634
4367
|
};
|
|
3635
4368
|
} & ElementAttributesBrand<Partial<{
|
|
3636
4369
|
mode?: "pages" | "loadMore" | undefined;
|
|
4370
|
+
label?: string | undefined;
|
|
3637
4371
|
target?: "url" | "interaction" | undefined;
|
|
3638
4372
|
pageParam?: string | undefined;
|
|
3639
4373
|
pageInfo?: PaginationPageInfo | undefined;
|
|
@@ -3752,6 +4486,9 @@ declare const elementDeclarations: {
|
|
|
3752
4486
|
}>>;
|
|
3753
4487
|
readonly RichText: {
|
|
3754
4488
|
readonly type: "richText";
|
|
4489
|
+
readonly attributeValues: {
|
|
4490
|
+
readonly format: readonly string[];
|
|
4491
|
+
};
|
|
3755
4492
|
readonly content: {
|
|
3756
4493
|
readonly attributes: {
|
|
3757
4494
|
readonly content: "";
|
|
@@ -3857,6 +4594,7 @@ declare const elementDeclarations: {
|
|
|
3857
4594
|
} & ElementAttributesBrand<unknown>;
|
|
3858
4595
|
readonly TabContainerBody: {
|
|
3859
4596
|
readonly type: "tabContainerBody";
|
|
4597
|
+
readonly ancestorType: "tabContainer";
|
|
3860
4598
|
readonly content: {
|
|
3861
4599
|
readonly attributes: {};
|
|
3862
4600
|
readonly definition: {
|
|
@@ -3906,6 +4644,7 @@ declare const elementDeclarations: {
|
|
|
3906
4644
|
} & ElementAttributesBrand<unknown>;
|
|
3907
4645
|
readonly TabContainerHeader: {
|
|
3908
4646
|
readonly type: "tabContainerHeader";
|
|
4647
|
+
readonly ancestorType: "tabContainer";
|
|
3909
4648
|
readonly content: {
|
|
3910
4649
|
readonly attributes: {};
|
|
3911
4650
|
readonly definition: {
|
|
@@ -4044,7 +4783,7 @@ declare const elementDeclarations: {
|
|
|
4044
4783
|
readonly base: {
|
|
4045
4784
|
readonly default: {
|
|
4046
4785
|
readonly 'font-size': "14px";
|
|
4047
|
-
readonly 'line-height': "
|
|
4786
|
+
readonly 'line-height': "1.714";
|
|
4048
4787
|
readonly display: "inline";
|
|
4049
4788
|
};
|
|
4050
4789
|
};
|
|
@@ -4057,6 +4796,20 @@ declare const elementDeclarations: {
|
|
|
4057
4796
|
}>>;
|
|
4058
4797
|
readonly ThemeToggle: {
|
|
4059
4798
|
readonly type: "themeToggle";
|
|
4799
|
+
readonly attributeValues: {
|
|
4800
|
+
readonly subType: readonly string[];
|
|
4801
|
+
};
|
|
4802
|
+
readonly triggers: {
|
|
4803
|
+
readonly onThemeChange: {
|
|
4804
|
+
readonly action: "onThemeChange";
|
|
4805
|
+
readonly title: "On Theme Change";
|
|
4806
|
+
readonly type: "trigger";
|
|
4807
|
+
readonly params: {};
|
|
4808
|
+
readonly preview: {
|
|
4809
|
+
readonly theme: "dark";
|
|
4810
|
+
};
|
|
4811
|
+
};
|
|
4812
|
+
};
|
|
4060
4813
|
readonly content: {
|
|
4061
4814
|
readonly attributes: {
|
|
4062
4815
|
readonly subType: "switch";
|
|
@@ -4068,7 +4821,7 @@ declare const elementDeclarations: {
|
|
|
4068
4821
|
readonly definition: {
|
|
4069
4822
|
readonly label: "Theme Toggle";
|
|
4070
4823
|
readonly type: "themeToggle";
|
|
4071
|
-
readonly description: "Lets a visitor choose light or dark. It writes the choice on the document root, where a space stylesheet is already looking for it, and remembers it — so the machine decides until somebody says otherwise. It ships no colours of its own: style it with the space own classes
|
|
4824
|
+
readonly description: "Lets a visitor choose light or dark. It writes the choice on the document root, where a space stylesheet is already looking for it, and remembers it — so the machine decides until somebody says otherwise. It ships no colours of its own: style it with the space own classes. It shows the icon of the scheme in use by default; key a rule off `data-theme-icon` to change that.";
|
|
4072
4825
|
readonly items: readonly [];
|
|
4073
4826
|
readonly bindings: {};
|
|
4074
4827
|
readonly styleSelectors: {
|
|
@@ -4185,6 +4938,9 @@ declare const elementDeclarations: {
|
|
|
4185
4938
|
}>>;
|
|
4186
4939
|
};
|
|
4187
4940
|
|
|
4941
|
+
/** The attributes each built-in type starts with — what a factory merges under the author's own. */
|
|
4942
|
+
export declare const elementDefaultAttributes: Record<string, Record<string, unknown>>;
|
|
4943
|
+
|
|
4188
4944
|
declare type ElementDefinition = {
|
|
4189
4945
|
rootId: Element_2['id'];
|
|
4190
4946
|
label: string;
|
|
@@ -4234,7 +4990,10 @@ export declare interface ElementHandle {
|
|
|
4234
4990
|
/** The one name this element answers to: its key in the document, and what `data-plitzi-el` carries. */
|
|
4235
4991
|
id: string;
|
|
4236
4992
|
type: string;
|
|
4237
|
-
/**
|
|
4993
|
+
/**
|
|
4994
|
+
* The root it lives on, by id: its page — or, for an element of a layout shell, that layout, since it renders on
|
|
4995
|
+
* every page that names the layout rather than on one of them.
|
|
4996
|
+
*/
|
|
4238
4997
|
pageId: string;
|
|
4239
4998
|
/** A CSS selector matching exactly this element in a rendered page. */
|
|
4240
4999
|
selector: string;
|
|
@@ -4256,6 +5015,20 @@ export declare interface ElementHandle {
|
|
|
4256
5015
|
* Present only when true: almost nothing on a page is conditional, and the handles are serialized.
|
|
4257
5016
|
*/
|
|
4258
5017
|
conditional?: true;
|
|
5018
|
+
/**
|
|
5019
|
+
* Whether this element sits inside a list's row, so it renders once per row — several times, or not at all while the
|
|
5020
|
+
* list is empty. Its selector matches every copy: address one with the driver's `.first()` / `.nth()`.
|
|
5021
|
+
*
|
|
5022
|
+
* Present only when true, like `conditional`.
|
|
5023
|
+
*/
|
|
5024
|
+
repeated?: true;
|
|
5025
|
+
/**
|
|
5026
|
+
* Whether this element renders no element of its own — a provider with no tag (`apiContainer` with no `subType`).
|
|
5027
|
+
* Its children render; it has no box to be visible, so an assertion that it is on screen can only fail.
|
|
5028
|
+
*
|
|
5029
|
+
* Present only when true.
|
|
5030
|
+
*/
|
|
5031
|
+
boxless?: true;
|
|
4259
5032
|
}
|
|
4260
5033
|
|
|
4261
5034
|
declare type ElementInteraction<T extends Record<string, unknown> = Record<string, unknown>> = {
|
|
@@ -4271,10 +5044,21 @@ declare type ElementInteraction<T extends Record<string, unknown> = Record<strin
|
|
|
4271
5044
|
flowId: string;
|
|
4272
5045
|
enabled: boolean;
|
|
4273
5046
|
when?: RuleGroup;
|
|
5047
|
+
/** On a trigger only: what a firing does while this flow is still running. `skip` when absent. */
|
|
5048
|
+
whileRunning?: WhileRunning;
|
|
4274
5049
|
};
|
|
4275
5050
|
|
|
4276
5051
|
declare type ElementLayoutType = 'layout' | 'segment' | 'element' | 'reference';
|
|
4277
5052
|
|
|
5053
|
+
/**
|
|
5054
|
+
* The types that hold no children — a heading, a text, an image, a form control.
|
|
5055
|
+
*
|
|
5056
|
+
* Their components render their own attributes and never read `children`, so anything nested in one is dropped
|
|
5057
|
+
* without a word: a two-tone heading authored as a heading with two texts in it renders the word "Heading". A type
|
|
5058
|
+
* that can hold children says so by declaring `items`, which is also what lets the builder drop into it.
|
|
5059
|
+
*/
|
|
5060
|
+
export declare const elementLeafTypes: string[];
|
|
5061
|
+
|
|
4278
5062
|
/**
|
|
4279
5063
|
* When an element's CONTENTS are mounted, relative to its own `visibility`.
|
|
4280
5064
|
*
|
|
@@ -4294,9 +5078,30 @@ declare type ElementLayoutType = 'layout' | 'segment' | 'element' | 'reference';
|
|
|
4294
5078
|
*/
|
|
4295
5079
|
declare type ElementLoadStrategy = 'eager' | 'lazy' | 'visible';
|
|
4296
5080
|
|
|
5081
|
+
/** What a variant may change on one element: anything but what makes it that element. */
|
|
5082
|
+
export declare type ElementPatch = Partial<Omit<ElementSpec, 'type' | 'id' | 'children'>>;
|
|
5083
|
+
|
|
4297
5084
|
/** Attributes and authoring fields, flat. Attributes win a name they share with anything here. */
|
|
4298
5085
|
export declare type ElementProps<A> = A & AuthoringProps;
|
|
4299
5086
|
|
|
5087
|
+
/** An element moved onto a name, and whether that name is the one its document already knew it by. */
|
|
5088
|
+
export declare interface ElementRename {
|
|
5089
|
+
from: string;
|
|
5090
|
+
to: string;
|
|
5091
|
+
fromIdRef: boolean;
|
|
5092
|
+
}
|
|
5093
|
+
|
|
5094
|
+
export declare interface ElementRenders {
|
|
5095
|
+
/** The element, by the id the space gave it. */
|
|
5096
|
+
id: string;
|
|
5097
|
+
renders: number;
|
|
5098
|
+
/**
|
|
5099
|
+
* What changed for it, over all its renders: `attributes`, `elementState`, a prop's name. Empty when it rendered
|
|
5100
|
+
* with nothing of its own changed — carried by its context or its parent, the render worth looking at first.
|
|
5101
|
+
*/
|
|
5102
|
+
changed: string[];
|
|
5103
|
+
}
|
|
5104
|
+
|
|
4300
5105
|
declare type ElementRuntime = 'server' | 'client' | 'shared';
|
|
4301
5106
|
|
|
4302
5107
|
/**
|
|
@@ -4333,6 +5138,15 @@ export declare interface ElementSemantics {
|
|
|
4333
5138
|
*/
|
|
4334
5139
|
export declare const elementsFromManifest: <A extends Record<string, object> = Record<string, Record<string, unknown>>>(manifest: PluginManifest) => { [Type in keyof A]: ElementFactory<A[Type]>; };
|
|
4335
5140
|
|
|
5141
|
+
/**
|
|
5142
|
+
* The OTHER selectors each type dresses — a modal's `rootContainer`, a form control's `input` — by type.
|
|
5143
|
+
*
|
|
5144
|
+
* Every element carries a class per slot (`plitzi__<type>-<slot>`), and that is what a space's per-type `slots` style
|
|
5145
|
+
* addresses. A document that names only the slots its author styled leaves the rest of them classless, so the style
|
|
5146
|
+
* the space wrote for the TYPE reaches some of its elements and not others — which is a themed modal beside a white one.
|
|
5147
|
+
*/
|
|
5148
|
+
export declare const elementSlots: Record<string, string[]>;
|
|
5149
|
+
|
|
4336
5150
|
/**
|
|
4337
5151
|
* Which types publish a data source, and under what name.
|
|
4338
5152
|
*
|
|
@@ -4358,13 +5172,26 @@ export declare interface ElementSpec {
|
|
|
4358
5172
|
*/
|
|
4359
5173
|
id?: string;
|
|
4360
5174
|
attributes?: Record<string, unknown>;
|
|
4361
|
-
/**
|
|
5175
|
+
/**
|
|
5176
|
+
* A style variant the element starts in, e.g. a heading's `title`.
|
|
5177
|
+
*
|
|
5178
|
+
* The element TYPE's vocabulary by default. When the element wears a class that declares a variant of this name and
|
|
5179
|
+
* the type declares none, it is that CLASS's variant — `text({ class: avatar, variant: 'violet' })` wears
|
|
5180
|
+
* `avatar--violet`. Keyed by the type instead, it named a selector the element does not wear and rendered plain.
|
|
5181
|
+
* For a variant that follows the data, bind it with `variantFrom`.
|
|
5182
|
+
*/
|
|
4362
5183
|
variant?: string;
|
|
4363
5184
|
/**
|
|
4364
5185
|
* A rule set of this element's own. Shorthands are expanded and every property is checked before it is written,
|
|
4365
5186
|
* so what reaches the document is what the style editor can read back.
|
|
4366
5187
|
*/
|
|
4367
5188
|
css?: CssSpec;
|
|
5189
|
+
/**
|
|
5190
|
+
* The name of this element's own selector — the one {@link ElementSpec.css} writes to. Left out, it is derived from
|
|
5191
|
+
* where the element sits; given, it is kept exactly, which is how a space read back from the builder keeps the
|
|
5192
|
+
* names its style editor, its `customCss` and anything outside the document already know it by.
|
|
5193
|
+
*/
|
|
5194
|
+
selector?: string;
|
|
4368
5195
|
/**
|
|
4369
5196
|
* How this element's own selector reacts — `hover`, `focus`, `active` — beside {@link ElementSpec.css}. A state
|
|
4370
5197
|
* is part of the element's selector, not a second one, so it is refused alongside a shared `class` for the same
|
|
@@ -4407,8 +5234,12 @@ export declare interface ElementSpec {
|
|
|
4407
5234
|
*
|
|
4408
5235
|
* `false` starts it hidden with no condition at all: a panel that a flow reveals (`toggleState`, `setState`)
|
|
4409
5236
|
* rather than one the data does.
|
|
5237
|
+
*
|
|
5238
|
+
* `{ source, template }` is a condition the value does not answer on its own — the template's value is read as a yes
|
|
5239
|
+
* or a no (`false`, `0`, empty, an empty list or nothing is a no)
|
|
5240
|
+
* (`"{{ source == '' or source == list_games.item.genre }}"`). Like every condition, it starts hidden.
|
|
4410
5241
|
*/
|
|
4411
|
-
visible?: string | false;
|
|
5242
|
+
visible?: string | false | VisibleCondition;
|
|
4412
5243
|
/** One flow per entry. Steps are chained in order. */
|
|
4413
5244
|
flows?: StepSpec[][];
|
|
4414
5245
|
runtime?: ElementRuntime;
|
|
@@ -4444,6 +5275,15 @@ export declare interface ElementStyleSpec {
|
|
|
4444
5275
|
*/
|
|
4445
5276
|
export declare type ElementTriggerName = keyof typeof interactionBasicTriggers;
|
|
4446
5277
|
|
|
5278
|
+
/**
|
|
5279
|
+
* Every trigger each built-in type fires: the ones all elements share, and the ones its declaration adds.
|
|
5280
|
+
*
|
|
5281
|
+
* What lets a flow on the wrong element be refused instead of written. The trigger names an event, and only the
|
|
5282
|
+
* element that fires it ever starts the flow — an `onSubmit` on a form's submit button is saved, looks right beside
|
|
5283
|
+
* the form, and never runs, which is how a working form reads as "forms do not work outside the builder".
|
|
5284
|
+
*/
|
|
5285
|
+
export declare const elementTriggers: Record<string, string[]>;
|
|
5286
|
+
|
|
4447
5287
|
/** Every built-in element type, by the name a document stores — `heading`, `apiContainer`, `formControl`. */
|
|
4448
5288
|
export declare type ElementTypeName = keyof DeclarationByType;
|
|
4449
5289
|
|
|
@@ -4463,14 +5303,31 @@ export declare const expandShorthand: (css: CssProps) => CssProps;
|
|
|
4463
5303
|
* `{ padding: null }` clears all four sides rather than a `padding` key that was never stored. */
|
|
4464
5304
|
export declare const expandShorthandPatch: (css: CssPatch) => CssPatch;
|
|
4465
5305
|
|
|
5306
|
+
/** The lint codes `fixSpace` knows how to settle: what the builder offers to fix, and what the server will fix. */
|
|
5307
|
+
export declare const FIXABLE_CODES: ReadonlySet<string>;
|
|
5308
|
+
|
|
5309
|
+
export declare interface FixResult {
|
|
5310
|
+
schema: Schema;
|
|
5311
|
+
style: Style;
|
|
5312
|
+
applied: AppliedFix[];
|
|
5313
|
+
}
|
|
5314
|
+
|
|
5315
|
+
/**
|
|
5316
|
+
* `fixSpace`, holding the same catalogs `lintSpace` reads with — so a fix settles exactly what the linter reports, on
|
|
5317
|
+
* a copy of the documents. `codes` narrows it to some of `FIXABLE_CODES`.
|
|
5318
|
+
*/
|
|
5319
|
+
export declare const fixSpace: (space: SpaceDocuments, options?: LintCatalogs, codes?: Iterable<string>, elements?: Iterable<string>) => FixResult;
|
|
5320
|
+
|
|
4466
5321
|
export declare const fontAwesome: {
|
|
4467
5322
|
(props?: ElementProps<Partial<{
|
|
4468
5323
|
size?: string | undefined;
|
|
5324
|
+
label?: string | undefined;
|
|
4469
5325
|
icon?: string | undefined;
|
|
4470
5326
|
iconAnimation?: string | undefined;
|
|
4471
5327
|
}>> | undefined): ElementSpec;
|
|
4472
5328
|
(children: ElementSpec[], props?: ElementProps<Partial<{
|
|
4473
5329
|
size?: string | undefined;
|
|
5330
|
+
label?: string | undefined;
|
|
4474
5331
|
icon?: string | undefined;
|
|
4475
5332
|
iconAnimation?: string | undefined;
|
|
4476
5333
|
}>> | undefined): ElementSpec;
|
|
@@ -4537,11 +5394,24 @@ declare type FormControlAttributes = AuthorableAttributes<FormControlProps, 'val
|
|
|
4537
5394
|
declare type FormControlProps = {
|
|
4538
5395
|
ref: RefObject<HTMLElement>;
|
|
4539
5396
|
className: string;
|
|
4540
|
-
subType: 'text' | 'number' | 'email' | 'password' | 'date' | 'time' | 'checkbox' | 'switch' | 'select' | 'textarea' | 'hidden'
|
|
5397
|
+
subType: 'text' | 'number' | 'email' | 'password' | 'date' | 'time' | 'checkbox' | 'switch' | 'select' | 'textarea' | 'hidden'
|
|
5398
|
+
/** The browser's own colour picker: its value is `#rrggbb`. */
|
|
5399
|
+
| 'color';
|
|
4541
5400
|
name: string;
|
|
4542
5401
|
label: string;
|
|
5402
|
+
/**
|
|
5403
|
+
* Keeps `label` out of sight while it still names the field — for a field whose design already says what it is for:
|
|
5404
|
+
* a search box with a magnifier, a colour swatch. Without a label a screen reader or a browser agent finds an unnamed
|
|
5405
|
+
* box; a placeholder names only a text field, and only until something is typed.
|
|
5406
|
+
*/
|
|
5407
|
+
hideLabel: boolean;
|
|
4543
5408
|
placeholder: string;
|
|
4544
5409
|
autoComplete: boolean;
|
|
5410
|
+
/**
|
|
5411
|
+
* Takes the focus as it appears — a search box opened by a shortcut is typed into at once. With the control's
|
|
5412
|
+
* container shown only while wanted (`loadStrategy: 'visible'`), it appears each time it is opened.
|
|
5413
|
+
*/
|
|
5414
|
+
autoFocus: boolean;
|
|
4545
5415
|
disabled: boolean;
|
|
4546
5416
|
options: {
|
|
4547
5417
|
label: string;
|
|
@@ -4571,11 +5441,10 @@ declare type FormControlProps = {
|
|
|
4571
5441
|
value: string;
|
|
4572
5442
|
error: string;
|
|
4573
5443
|
/**
|
|
4574
|
-
* Supplied by `withFieldValue
|
|
5444
|
+
* Supplied by `withFieldValue`, with or without a form around the control.
|
|
4575
5445
|
*
|
|
4576
|
-
*
|
|
4577
|
-
*
|
|
4578
|
-
* screen is exactly such a control: nothing to submit, and the change itself is the event.
|
|
5446
|
+
* Inside a form the value is the form's; outside one it is the control's own, so a select that filters a screen
|
|
5447
|
+
* works on its own — nothing to submit, and its `onChange` is the whole event. Validation only runs inside a form.
|
|
4579
5448
|
*/
|
|
4580
5449
|
handleChange?: (e: ChangeEvent<HTMLInputElement> | ChangeEvent<HTMLSelectElement> | ChangeEvent<HTMLTextAreaElement>) => void;
|
|
4581
5450
|
handleValidate?: () => void;
|
|
@@ -4606,6 +5475,8 @@ export declare const getUtility: (action: string) => BuiltinUtility | undefined;
|
|
|
4606
5475
|
* validator that refused the name would make that impossible to write.
|
|
4607
5476
|
*
|
|
4608
5477
|
* `theme` is `{ mode, resolved }` — `resolved` is always `light` or `dark`, which is what a URL or a rule wants.
|
|
5478
|
+
*
|
|
5479
|
+
* `computed` holds the space's own computed values (`SpaceSpec.computed`), by name.
|
|
4609
5480
|
*/
|
|
4610
5481
|
export declare const GLOBAL_SOURCES: string[];
|
|
4611
5482
|
|
|
@@ -4619,6 +5490,9 @@ export declare const grid: (columns: string, gap: string, extra?: CssProps) => S
|
|
|
4619
5490
|
|
|
4620
5491
|
export declare const groupBindings: (path: string, bind: BindingsSpec, sources?: SourceIndex, where?: string) => Partial<Record<BindingCategory, ElementBinding[]>>;
|
|
4621
5492
|
|
|
5493
|
+
/** Whether any of these bindings decides the element's visibility — which makes it a condition, authored hidden. */
|
|
5494
|
+
export declare const hasVisibilityBinding: (bindings: BindingSpec[] | undefined) => boolean;
|
|
5495
|
+
|
|
4622
5496
|
export declare const heading: ElementFactory<Partial<{
|
|
4623
5497
|
content?: string | undefined;
|
|
4624
5498
|
subType?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | undefined;
|
|
@@ -4667,16 +5541,66 @@ export declare const image: {
|
|
|
4667
5541
|
fetchPriority?: "high" | "low" | "auto" | undefined;
|
|
4668
5542
|
src?: string | undefined;
|
|
4669
5543
|
alt?: string | undefined;
|
|
4670
|
-
|
|
5544
|
+
decorative?: boolean | undefined;
|
|
5545
|
+
loadMode?: "auto" | "eager" | "lazy" | undefined;
|
|
4671
5546
|
}>> | undefined): ElementSpec;
|
|
4672
5547
|
(children: ElementSpec[], props?: ElementProps<Partial<{
|
|
4673
5548
|
fetchPriority?: "high" | "low" | "auto" | undefined;
|
|
4674
5549
|
src?: string | undefined;
|
|
4675
5550
|
alt?: string | undefined;
|
|
4676
|
-
|
|
5551
|
+
decorative?: boolean | undefined;
|
|
5552
|
+
loadMode?: "auto" | "eager" | "lazy" | undefined;
|
|
4677
5553
|
}>> | undefined): ElementSpec;
|
|
4678
5554
|
};
|
|
4679
5555
|
|
|
5556
|
+
/**
|
|
5557
|
+
* The half of `inspectPage` that needs no space: images, sideways scroll, legibility — for a page whose documents are
|
|
5558
|
+
* not in hand, like an example served by somebody else's server. `page` in the report is `document`.
|
|
5559
|
+
*/
|
|
5560
|
+
export declare const inspectDocument: (driver: PageEvaluator, options?: DocumentChecks) => Promise<PageReport>;
|
|
5561
|
+
|
|
5562
|
+
export declare interface InspectOptions extends OnScreenOptions {
|
|
5563
|
+
/** The page that is open, by id or slug. Defaults to the home page (`/`), or the first page there is. */
|
|
5564
|
+
page?: string;
|
|
5565
|
+
/** Checks to leave out, for a page that is known to break one of them on purpose. All are on by default. */
|
|
5566
|
+
skip?: ('images' | 'overflow' | 'legibility')[];
|
|
5567
|
+
/**
|
|
5568
|
+
* How long to keep looking before reporting, in milliseconds — 5000 by default, like an assertion's own retry.
|
|
5569
|
+
*
|
|
5570
|
+
* A page is inspected the moment it is asked, and a provider still answering is a missing element for a few frames,
|
|
5571
|
+
* so the probe runs again until it finds nothing or the time is up. `0` looks once.
|
|
5572
|
+
*/
|
|
5573
|
+
timeout?: number;
|
|
5574
|
+
}
|
|
5575
|
+
|
|
5576
|
+
/**
|
|
5577
|
+
* Everything wrong with an open page, as one list: every element it owes (see `onScreen`) present and visible, its
|
|
5578
|
+
* images loaded, nothing scrolling sideways, no text in the colour behind it.
|
|
5579
|
+
*
|
|
5580
|
+
* ```ts
|
|
5581
|
+
* const { handles, schema, style } = authorSpace(space);
|
|
5582
|
+
* await page.goto('/');
|
|
5583
|
+
* expect((await inspectPage(page, handles)).problems).toEqual([]);
|
|
5584
|
+
* ```
|
|
5585
|
+
*
|
|
5586
|
+
* The one call a suite needs for "this page rendered whole", in any space and with no upkeep — and the one that says
|
|
5587
|
+
* WHY when it did not: which ancestor hid an element, which one overflowed, which image failed.
|
|
5588
|
+
*/
|
|
5589
|
+
export declare const inspectPage: (driver: PageEvaluator, handles: SpaceHandles, options?: InspectOptions) => Promise<PageReport>;
|
|
5590
|
+
|
|
5591
|
+
/**
|
|
5592
|
+
* What `act` rendered: every element, how often, what changed for it, and what was written to set it off.
|
|
5593
|
+
*
|
|
5594
|
+
* ```ts
|
|
5595
|
+
* const report = await inspectRenders(page, () => page.click('[data-plitzi-el="save"]'), { max: 10 });
|
|
5596
|
+
* expect(report.problems).toEqual([]);
|
|
5597
|
+
* ```
|
|
5598
|
+
*
|
|
5599
|
+
* The page must be rendering under `debugMode`, where the SDK profiles every element; anywhere else this throws, with
|
|
5600
|
+
* how to turn it on.
|
|
5601
|
+
*/
|
|
5602
|
+
export declare const inspectRenders: (page: RenderEvaluator, act: () => Promise<unknown>, options?: RenderOptions) => Promise<RenderReport>;
|
|
5603
|
+
|
|
4680
5604
|
declare const interactionBasicTriggers: Record<string, InteractionCallback>;
|
|
4681
5605
|
|
|
4682
5606
|
declare type InteractionCallback<T extends Record<string, unknown> = Record<string, unknown>> = {
|
|
@@ -4823,6 +5747,29 @@ export declare const isRuleSetSpec: (spec: StyleSpec) => spec is RuleSetSpec;
|
|
|
4823
5747
|
*/
|
|
4824
5748
|
export declare const isStyleDeclaration: (value: StyleSpec | StyleDeclaration) => value is StyleDeclaration;
|
|
4825
5749
|
|
|
5750
|
+
/**
|
|
5751
|
+
* A shortcut pressed the way the page will read it.
|
|
5752
|
+
*
|
|
5753
|
+
* `mod` is ⌘ on a Mac and Ctrl anywhere else — decided by the PAGE, from its user agent, when it listens. A driver's
|
|
5754
|
+
* own "Control or Meta" asks the machine running the suite instead, and a suite on a Mac driving an emulated desktop
|
|
5755
|
+
* Chrome presses ⌘ at a page listening for Ctrl: the flow never runs, and nothing says why.
|
|
5756
|
+
*/
|
|
5757
|
+
/** A page that can be asked a question and typed at — Playwright's `Page`, Puppeteer's, or anything alike. */
|
|
5758
|
+
export declare interface KeyboardDriver {
|
|
5759
|
+
evaluate<R>(fn: () => R): Promise<R>;
|
|
5760
|
+
keyboard: {
|
|
5761
|
+
press(key: string): Promise<void>;
|
|
5762
|
+
};
|
|
5763
|
+
}
|
|
5764
|
+
|
|
5765
|
+
/** A layout shell: what pages render inside, so its elements are on screen wherever a page names it. */
|
|
5766
|
+
export declare interface LayoutHandle extends ElementHandle {
|
|
5767
|
+
/** Everything in the shell, by id — the header and the navigation a test reaches for on any page. */
|
|
5768
|
+
elements: Record<string, ElementHandle>;
|
|
5769
|
+
/** The layout this shell itself renders inside, for a shell within a shell. */
|
|
5770
|
+
layout?: string;
|
|
5771
|
+
}
|
|
5772
|
+
|
|
4826
5773
|
/**
|
|
4827
5774
|
* Which layout a page — or another layout — renders inside, and where in it.
|
|
4828
5775
|
*
|
|
@@ -4856,6 +5803,8 @@ export declare interface LayoutSpec {
|
|
|
4856
5803
|
attributes?: Record<string, unknown>;
|
|
4857
5804
|
css?: CssSpec;
|
|
4858
5805
|
states?: StatesSpec;
|
|
5806
|
+
/** As {@link ElementSpec.selector}. */
|
|
5807
|
+
selector?: string;
|
|
4859
5808
|
class?: ClassList;
|
|
4860
5809
|
bind?: BindingsSpec;
|
|
4861
5810
|
flows?: StepSpec[][];
|
|
@@ -4865,18 +5814,36 @@ export declare interface LayoutSpec {
|
|
|
4865
5814
|
export declare const link: {
|
|
4866
5815
|
(props?: ElementProps<Partial<{
|
|
4867
5816
|
mode?: "page" | "internal" | "external" | undefined;
|
|
5817
|
+
href?: string | undefined;
|
|
4868
5818
|
label?: string | undefined;
|
|
4869
5819
|
target?: "self" | "blank" | "parent" | "top" | undefined;
|
|
4870
|
-
href?: string | undefined;
|
|
4871
5820
|
}>> | undefined): ElementSpec;
|
|
4872
5821
|
(children: ElementSpec[], props?: ElementProps<Partial<{
|
|
4873
5822
|
mode?: "page" | "internal" | "external" | undefined;
|
|
5823
|
+
href?: string | undefined;
|
|
4874
5824
|
label?: string | undefined;
|
|
4875
5825
|
target?: "self" | "blank" | "parent" | "top" | undefined;
|
|
4876
|
-
href?: string | undefined;
|
|
4877
5826
|
}>> | undefined): ElementSpec;
|
|
4878
5827
|
};
|
|
4879
5828
|
|
|
5829
|
+
export declare type LintCatalogs = AuthorSpaceOptions;
|
|
5830
|
+
|
|
5831
|
+
export declare type LintIssue = SchemaValidationError;
|
|
5832
|
+
|
|
5833
|
+
export declare interface LintResult {
|
|
5834
|
+
/** What renders something other than what the document says — a template read past, a link to nowhere. */
|
|
5835
|
+
errors: LintIssue[];
|
|
5836
|
+
/** What renders, and probably not as meant — a modal open on arrival, a colour with no dark value. */
|
|
5837
|
+
warnings: LintIssue[];
|
|
5838
|
+
}
|
|
5839
|
+
|
|
5840
|
+
/**
|
|
5841
|
+
* `lintSpace`, holding this SDK's own catalogs: what a space's documents MEAN, read the way the runtime will read
|
|
5842
|
+
* them — every template, flow, binding, attribute and link. For a caller that already knows the structure holds and
|
|
5843
|
+
* wants the problems to show — a panel of them, beside the element each one names.
|
|
5844
|
+
*/
|
|
5845
|
+
export declare const lintSpace: (space: SpaceDocuments, options?: LintCatalogs) => LintResult;
|
|
5846
|
+
|
|
4880
5847
|
export declare const list: {
|
|
4881
5848
|
(props?: ElementProps<Partial<{
|
|
4882
5849
|
source?: "none" | "controlled" | undefined;
|
|
@@ -4979,6 +5946,7 @@ export declare const nodeHtml: ElementFactory<Partial<{
|
|
|
4979
5946
|
defaultValue?: string | number | readonly string[] | undefined;
|
|
4980
5947
|
onLoad?: ReactEventHandler<"span"> | undefined;
|
|
4981
5948
|
onClick?: MouseEventHandler<"span"> | undefined;
|
|
5949
|
+
onPointerDown?: PointerEventHandler<"span"> | undefined;
|
|
4982
5950
|
onMouseEnter?: MouseEventHandler<"span"> | undefined;
|
|
4983
5951
|
onMouseLeave?: MouseEventHandler<"span"> | undefined;
|
|
4984
5952
|
onFocus?: FocusEventHandler<"span"> | undefined;
|
|
@@ -5167,7 +6135,6 @@ export declare const nodeHtml: ElementFactory<Partial<{
|
|
|
5167
6135
|
onTouchMoveCapture?: TouchEventHandler<"span"> | undefined;
|
|
5168
6136
|
onTouchStart?: TouchEventHandler<"span"> | undefined;
|
|
5169
6137
|
onTouchStartCapture?: TouchEventHandler<"span"> | undefined;
|
|
5170
|
-
onPointerDown?: PointerEventHandler<"span"> | undefined;
|
|
5171
6138
|
onPointerDownCapture?: PointerEventHandler<"span"> | undefined;
|
|
5172
6139
|
onPointerMove?: PointerEventHandler<"span"> | undefined;
|
|
5173
6140
|
onPointerMoveCapture?: PointerEventHandler<"span"> | undefined;
|
|
@@ -5253,12 +6220,33 @@ export declare const nodeHtml: ElementFactory<Partial<{
|
|
|
5253
6220
|
}>>;
|
|
5254
6221
|
|
|
5255
6222
|
/**
|
|
5256
|
-
* `
|
|
6223
|
+
* The rule that styles the toast container, or `''` when there is nothing to say.
|
|
5257
6224
|
*
|
|
5258
|
-
*
|
|
5259
|
-
*
|
|
5260
|
-
* the builders useless for exactly the flows that matter most.
|
|
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.
|
|
5261
6227
|
*/
|
|
6228
|
+
export declare const notificationsCss: (spec: NotificationsSpec | undefined) => string;
|
|
6229
|
+
|
|
6230
|
+
/**
|
|
6231
|
+
* How a space's notifications look — the toasts an `addNotification` step shows.
|
|
6232
|
+
*
|
|
6233
|
+
* Every value is any CSS colour or length, and a token is the right answer for all of them (`'var(--card)'`): a token
|
|
6234
|
+
* follows the light/dark toggle, which the notifications already do. Left out, a value keeps the library's own.
|
|
6235
|
+
*/
|
|
6236
|
+
export declare interface NotificationsSpec {
|
|
6237
|
+
/** The toast's surface. */
|
|
6238
|
+
background?: string;
|
|
6239
|
+
/** Its text. */
|
|
6240
|
+
text?: string;
|
|
6241
|
+
/** The accent of each `appearance`: its icon and its progress bar. */
|
|
6242
|
+
success?: string;
|
|
6243
|
+
danger?: string;
|
|
6244
|
+
warning?: string;
|
|
6245
|
+
info?: string;
|
|
6246
|
+
/** Corner radius, e.g. `'12px'`. */
|
|
6247
|
+
radius?: string;
|
|
6248
|
+
}
|
|
6249
|
+
|
|
5262
6250
|
export declare const on: (trigger: ElementTriggerName | (string & {}), params?: Record<string, unknown>) => StepSpec;
|
|
5263
6251
|
|
|
5264
6252
|
export declare const onClick: (params?: {
|
|
@@ -5275,8 +6263,56 @@ export declare const onFlowError: () => StepSpec;
|
|
|
5275
6263
|
|
|
5276
6264
|
export declare const onFlowProgress: () => StepSpec;
|
|
5277
6265
|
|
|
6266
|
+
/**
|
|
6267
|
+
* A keyboard shortcut, heard on the whole page for as long as the element is mounted: `onKey('f')`,
|
|
6268
|
+
* `onKey('shift+f')`, `onKey('mod+k')` (⌘ on a Mac, Ctrl elsewhere), several at once with commas (`onKey('plus, =')`).
|
|
6269
|
+
*
|
|
6270
|
+
* Put it on the element whose flows it drives, or on the page for a shortcut of the page's. A press while somebody
|
|
6271
|
+
* types in a field is the field's, unless Ctrl, ⌘ or Alt is held or the key is Escape — and the field keeps its own
|
|
6272
|
+
* editing even then (⌘A, ⌘Z, ⌘C/⌘V, moving by word). `{{ <this step's id>.key }}` is the key pressed, canonical (`shift+f`) — for one flow answering several shortcuts.
|
|
6273
|
+
*/
|
|
6274
|
+
export declare const onKey: (keys: string) => StepSpec;
|
|
6275
|
+
|
|
5278
6276
|
export declare const onLoad: () => StepSpec;
|
|
5279
6277
|
|
|
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
|
+
export declare const onPageLoad: () => StepSpec;
|
|
6286
|
+
|
|
6287
|
+
/** The press, before it is a click — where a drag away from the element starts. A click still follows it. */
|
|
6288
|
+
export declare const onPointerDown: (params?: {
|
|
6289
|
+
propagateEvent?: boolean;
|
|
6290
|
+
}) => StepSpec;
|
|
6291
|
+
|
|
6292
|
+
/**
|
|
6293
|
+
* What a page shows the moment it is opened, by handle: its own elements and those of every layout it renders inside,
|
|
6294
|
+
* outermost shell first.
|
|
6295
|
+
*
|
|
6296
|
+
* Left out, because a bare visit cannot see them and asserting them would only fail: an element shown under a
|
|
6297
|
+
* condition (`conditional`), one rendered once per list row (`repeated` — several copies, or none while the list is
|
|
6298
|
+
* empty), and a provider with no tag (`boxless`), which has no box to be visible. The roots themselves are left out
|
|
6299
|
+
* too: a page and a layout are frames, and what a reader sees is what is in them.
|
|
6300
|
+
*/
|
|
6301
|
+
export declare const onScreen: (handles: SpaceHandles, page: string, options?: OnScreenOptions) => ElementHandle[];
|
|
6302
|
+
|
|
6303
|
+
export declare interface OnScreenOptions {
|
|
6304
|
+
/**
|
|
6305
|
+
* Which elements a freshly opened page owes: `named` (the default) is what an author bothered to name — the contract
|
|
6306
|
+
* a suite can hold ANY space to — and `all` adds the ones authoring numbered, for a space written for the test itself.
|
|
6307
|
+
*/
|
|
6308
|
+
elements?: 'named' | 'all';
|
|
6309
|
+
/**
|
|
6310
|
+
* Ids a test knows are not on screen yet although authoring cannot tell — an element whose data has not arrived.
|
|
6311
|
+
* Every one must exist: a typo here would silently widen what the check lets through.
|
|
6312
|
+
*/
|
|
6313
|
+
ignore?: string[];
|
|
6314
|
+
}
|
|
6315
|
+
|
|
5280
6316
|
/**
|
|
5281
6317
|
* A form submitting itself, with the values keyed by each control's `name`.
|
|
5282
6318
|
*
|
|
@@ -5286,8 +6322,29 @@ export declare const onLoad: () => StepSpec;
|
|
|
5286
6322
|
*/
|
|
5287
6323
|
export declare const onSubmit: () => StepSpec;
|
|
5288
6324
|
|
|
6325
|
+
/** Opens a `dialogContainer`, by id, the way {@link openModal} opens a modal — it starts open too. */
|
|
6326
|
+
export declare const openDialog: (target: string, metadata?: string) => StepSpec;
|
|
6327
|
+
|
|
6328
|
+
/**
|
|
6329
|
+
* Opens a `modalContainer`, by id.
|
|
6330
|
+
*
|
|
6331
|
+
* A modal starts OPEN: declare it `visible: false` — its starting state, not a condition — and open it with this.
|
|
6332
|
+
* `metadata` travels into the modal, which publishes it as its source, so the content can read what opened it
|
|
6333
|
+
* (`{{ modalContainer_<id>.content }}` for a plain value). An element callback, so `target` is the MODAL's id.
|
|
6334
|
+
*/
|
|
6335
|
+
export declare const openModal: (target: string, metadata?: string) => StepSpec;
|
|
6336
|
+
|
|
5289
6337
|
declare type Operator = '' | '=' | '!=' | '<' | '>' | '<=' | '>=' | 'contains' | 'doesNotContain' | 'beginsWith' | 'doesNotBeginWith' | 'endsWith' | 'doesNotEndWith' | 'empty' | 'notEmpty' | 'in' | 'notIn' | 'between' | 'notBetween';
|
|
5290
6338
|
|
|
6339
|
+
/**
|
|
6340
|
+
* A page a function can be evaluated in — Playwright's `Page`, Puppeteer's, or anything with the same method.
|
|
6341
|
+
*
|
|
6342
|
+
* Structural, like `LocatorSource`, so this package names no driver and installs none.
|
|
6343
|
+
*/
|
|
6344
|
+
export declare interface PageEvaluator {
|
|
6345
|
+
evaluate<R>(fn: (input: ProbeInput) => R, input: ProbeInput): Promise<R>;
|
|
6346
|
+
}
|
|
6347
|
+
|
|
5291
6348
|
declare type PageFolder = {
|
|
5292
6349
|
id: string;
|
|
5293
6350
|
name: string;
|
|
@@ -5322,10 +6379,26 @@ export declare interface PageHandle extends ElementHandle {
|
|
|
5322
6379
|
accessLevel?: 'public' | 'authenticated';
|
|
5323
6380
|
/** The route params its slug declares (`post/{{slug}}` → `['slug']`). A path with any is not a URL until they are filled. */
|
|
5324
6381
|
params: string[];
|
|
6382
|
+
/** The layout this page renders inside, by id — whose elements are on screen here too. */
|
|
6383
|
+
layout?: string;
|
|
5325
6384
|
/** Everything on this page, by id. */
|
|
5326
6385
|
elements: Record<string, ElementHandle>;
|
|
5327
6386
|
}
|
|
5328
6387
|
|
|
6388
|
+
export declare interface PageReport {
|
|
6389
|
+
/** The page that was inspected, by id. */
|
|
6390
|
+
page: string;
|
|
6391
|
+
/** How many elements were owed and checked. */
|
|
6392
|
+
checked: number;
|
|
6393
|
+
/**
|
|
6394
|
+
* Everything wrong, one sentence each, naming the element and the reason — empty when the page is whole.
|
|
6395
|
+
*
|
|
6396
|
+
* A list, so a suite asserts it once (`expect(report.problems).toEqual([])`) and a failure prints every problem
|
|
6397
|
+
* together, instead of stopping at the first locator that timed out and saying only that it did.
|
|
6398
|
+
*/
|
|
6399
|
+
problems: string[];
|
|
6400
|
+
}
|
|
6401
|
+
|
|
5329
6402
|
export declare interface PageSpec {
|
|
5330
6403
|
name: string;
|
|
5331
6404
|
/** As {@link ElementSpec.id} — a page is an element, and its flows are targeted the same way. */
|
|
@@ -5345,7 +6418,8 @@ export declare interface PageSpec {
|
|
|
5345
6418
|
*/
|
|
5346
6419
|
accessLevel?: 'public' | 'authenticated';
|
|
5347
6420
|
/**
|
|
5348
|
-
* Where a visitor this page is not for is sent — a slug,
|
|
6421
|
+
* Where a visitor this page is not for is sent — a page's id or slug (`login`; `''` is the home page), its path, or a
|
|
6422
|
+
* full URL for somewhere off this space. Resolved to the page's id, and refused when it names no page.
|
|
5349
6423
|
*
|
|
5350
6424
|
* Without it they are answered 403, which is correct and rarely what a site wants: somebody who followed a link
|
|
5351
6425
|
* to a members page should land on the sign-in, not on a refusal. One field rather than the router's two,
|
|
@@ -5361,10 +6435,9 @@ export declare interface PageSpec {
|
|
|
5361
6435
|
folder?: string;
|
|
5362
6436
|
/** The shared layout this page renders inside. See {@link LayoutRef}. */
|
|
5363
6437
|
layout?: LayoutRef;
|
|
5364
|
-
/** Keep the page's element state across visits, in the storage named by {@link PageSpec.stateStorage}. */
|
|
5365
|
-
keepState?: boolean;
|
|
5366
|
-
stateStorage?: Schema['settings']['stateStorage'];
|
|
5367
6438
|
css?: CssSpec;
|
|
6439
|
+
/** As {@link ElementSpec.selector}. */
|
|
6440
|
+
selector?: string;
|
|
5368
6441
|
/** As {@link ElementSpec.class} — a shared class instead of a selector of this page's own. */
|
|
5369
6442
|
class?: ClassList;
|
|
5370
6443
|
flows?: StepSpec[][];
|
|
@@ -5374,6 +6447,7 @@ export declare interface PageSpec {
|
|
|
5374
6447
|
export declare const pagination: {
|
|
5375
6448
|
(props?: ElementProps<Partial<{
|
|
5376
6449
|
mode?: "pages" | "loadMore" | undefined;
|
|
6450
|
+
label?: string | undefined;
|
|
5377
6451
|
target?: "url" | "interaction" | undefined;
|
|
5378
6452
|
pageParam?: string | undefined;
|
|
5379
6453
|
pageInfo?: PaginationPageInfo | undefined;
|
|
@@ -5384,6 +6458,7 @@ export declare const pagination: {
|
|
|
5384
6458
|
}>> | undefined): ElementSpec;
|
|
5385
6459
|
(children: ElementSpec[], props?: ElementProps<Partial<{
|
|
5386
6460
|
mode?: "pages" | "loadMore" | undefined;
|
|
6461
|
+
label?: string | undefined;
|
|
5387
6462
|
target?: "url" | "interaction" | undefined;
|
|
5388
6463
|
pageParam?: string | undefined;
|
|
5389
6464
|
pageInfo?: PaginationPageInfo | undefined;
|
|
@@ -5421,6 +6496,99 @@ declare type PluginBuilder = {
|
|
|
5421
6496
|
itemsNotAllowed?: string[];
|
|
5422
6497
|
};
|
|
5423
6498
|
|
|
6499
|
+
/**
|
|
6500
|
+
* A plugin's declaration: an element of somebody's own, declared the way the built-in ones declare themselves.
|
|
6501
|
+
*
|
|
6502
|
+
* On top of what {@link ElementDeclarationData} says of any element it carries the whole `content`, because for a
|
|
6503
|
+
* plugin that is also what gets PUBLISHED — its build writes it into `plugin-manifest.json`, which the builder, the page
|
|
6504
|
+
* server and the MCP server read before they load any code. Data only, so that build can read it without React.
|
|
6505
|
+
*
|
|
6506
|
+
* `A` is the attributes the element accepts: its component's props, minus what the runtime supplies.
|
|
6507
|
+
* `const declaration = { … } satisfies PluginDeclaration<SeatPickerAttributes>` then refuses a default the component
|
|
6508
|
+
* does not take.
|
|
6509
|
+
*/
|
|
6510
|
+
export declare interface PluginDeclaration<A extends object = Record<string, unknown>> extends Omit<ElementDeclarationData, 'content'> {
|
|
6511
|
+
content: {
|
|
6512
|
+
/** The element's starting attributes — its component's defaults, where the builder can show them. */
|
|
6513
|
+
attributes: A;
|
|
6514
|
+
definition: Omit<ElementDefinition, 'rootId' | 'parentId' | 'interactions' | 'runtime' | 'loadStrategy'> & {
|
|
6515
|
+
/** What the element is for, in a sentence: the builder shows it, and an agent reads it to choose the element. */
|
|
6516
|
+
description?: string;
|
|
6517
|
+
};
|
|
6518
|
+
builder: PluginBuilder;
|
|
6519
|
+
/** How the builder's catalogue shows the element. Whether it is verified is the platform's to say, never its own. */
|
|
6520
|
+
market: {
|
|
6521
|
+
category: string;
|
|
6522
|
+
owner: string;
|
|
6523
|
+
license: string;
|
|
6524
|
+
website: string;
|
|
6525
|
+
backgroundColor: string;
|
|
6526
|
+
icon: string;
|
|
6527
|
+
};
|
|
6528
|
+
defaultStyle: PluginSchema['defaultStyle'];
|
|
6529
|
+
settings?: Record<string, string | number | boolean>;
|
|
6530
|
+
};
|
|
6531
|
+
}
|
|
6532
|
+
|
|
6533
|
+
/**
|
|
6534
|
+
* What `authorSpace` reads from a plugin's declaration. Structural, so a `PluginDeclaration`, an element's own
|
|
6535
|
+
* declaration and a manifest's `pluginSchema` entry (with its `type`) all fit.
|
|
6536
|
+
*/
|
|
6537
|
+
export declare interface PluginDeclarationData {
|
|
6538
|
+
type: string;
|
|
6539
|
+
/** The source name it publishes under, when it publishes one. */
|
|
6540
|
+
sourceType?: string;
|
|
6541
|
+
/** The events it fires beyond the ones every element does, by action. */
|
|
6542
|
+
triggers?: Readonly<Record<string, {
|
|
6543
|
+
action: string;
|
|
6544
|
+
}>>;
|
|
6545
|
+
/** The actions it answers to beyond `setState` and `toggleState`, by action. */
|
|
6546
|
+
callbacks?: Readonly<Record<string, {
|
|
6547
|
+
action: string;
|
|
6548
|
+
}>>;
|
|
6549
|
+
content?: {
|
|
6550
|
+
/** Its starting attributes: what it reads, and what a factory merges under the author's own. */
|
|
6551
|
+
attributes?: Readonly<Record<string, unknown>>;
|
|
6552
|
+
definition?: {
|
|
6553
|
+
/** Its name in the builder. */
|
|
6554
|
+
label?: string;
|
|
6555
|
+
/** Present when it holds children. */
|
|
6556
|
+
items?: readonly unknown[];
|
|
6557
|
+
styleSelectors?: Readonly<Record<string, unknown>>;
|
|
6558
|
+
};
|
|
6559
|
+
/** The attributes a data source may be pointed at — read as attributes too, since a binding writes them. */
|
|
6560
|
+
defaultStyle?: {
|
|
6561
|
+
bindingsAllowed?: {
|
|
6562
|
+
attributes?: readonly {
|
|
6563
|
+
path: string;
|
|
6564
|
+
}[];
|
|
6565
|
+
};
|
|
6566
|
+
};
|
|
6567
|
+
};
|
|
6568
|
+
}
|
|
6569
|
+
|
|
6570
|
+
export declare interface PluginHostOptions {
|
|
6571
|
+
renderType: string;
|
|
6572
|
+
id: string;
|
|
6573
|
+
/**
|
|
6574
|
+
* How the space hosts it. `custom` (the default) is a `custom` element naming the component by `renderType` — a
|
|
6575
|
+
* component the page registers itself, as a project's own are. `element` is an element OF the plugin's type, the
|
|
6576
|
+
* way the builder adds a plugin somebody dropped: the one shape a plugin loaded from its manifest renders as.
|
|
6577
|
+
*/
|
|
6578
|
+
as?: 'custom' | 'element';
|
|
6579
|
+
/** Written on the `custom` element as attributes, which the component receives as props of the same names. */
|
|
6580
|
+
attributes: Record<string, unknown>;
|
|
6581
|
+
/**
|
|
6582
|
+
* A provider around the plugin, and the props it feeds: `{ id: 'stats', query: '/data/stats.json', bind: { value:
|
|
6583
|
+
* 'stats.data.value' } }`. What a project with no backend shows its data with — a JSON file it serves itself.
|
|
6584
|
+
*/
|
|
6585
|
+
data?: {
|
|
6586
|
+
id: string;
|
|
6587
|
+
query: string;
|
|
6588
|
+
bind: Record<string, string>;
|
|
6589
|
+
};
|
|
6590
|
+
}
|
|
6591
|
+
|
|
5424
6592
|
declare type PluginManifest = {
|
|
5425
6593
|
assets: Record<string, ManifestAsset>;
|
|
5426
6594
|
assetsSettings: Record<string, ManifestAsset>;
|
|
@@ -5470,8 +6638,57 @@ declare type PluginSchema = {
|
|
|
5470
6638
|
};
|
|
5471
6639
|
};
|
|
5472
6640
|
|
|
6641
|
+
/**
|
|
6642
|
+
* Presses `shortcut` — written as `onKey` writes it: `'mod+a'`, `'shift+f'`, `'escape'` — with the keys this page
|
|
6643
|
+
* listens for.
|
|
6644
|
+
*
|
|
6645
|
+
* ```ts
|
|
6646
|
+
* await pressShortcut(page, 'mod+z');
|
|
6647
|
+
* ```
|
|
6648
|
+
*/
|
|
6649
|
+
export declare const pressShortcut: (page: KeyboardDriver, shortcut: string) => Promise<void>;
|
|
6650
|
+
|
|
6651
|
+
export declare interface ProbeFindings {
|
|
6652
|
+
/** Whether anything on the page carries `data-plitzi-el` at all — no means nothing checked below can be found. */
|
|
6653
|
+
marked: boolean;
|
|
6654
|
+
missing: string[];
|
|
6655
|
+
hidden: {
|
|
6656
|
+
id: string;
|
|
6657
|
+
reason: string;
|
|
6658
|
+
}[];
|
|
6659
|
+
brokenImages: string[];
|
|
6660
|
+
overflow: {
|
|
6661
|
+
pixels: number;
|
|
6662
|
+
widest: string[];
|
|
6663
|
+
} | null;
|
|
6664
|
+
illegible: string[];
|
|
6665
|
+
}
|
|
6666
|
+
|
|
6667
|
+
/**
|
|
6668
|
+
* What the browser half of `inspectPage` is asked, and what it answers.
|
|
6669
|
+
*
|
|
6670
|
+
* Plain data both ways, because it crosses into the page as a serialized argument and comes back the same way.
|
|
6671
|
+
*/
|
|
6672
|
+
export declare interface ProbeInput {
|
|
6673
|
+
expected: {
|
|
6674
|
+
id: string;
|
|
6675
|
+
selector: string;
|
|
6676
|
+
}[];
|
|
6677
|
+
images: boolean;
|
|
6678
|
+
overflow: boolean;
|
|
6679
|
+
legibility: boolean;
|
|
6680
|
+
}
|
|
6681
|
+
|
|
5473
6682
|
declare type ProviderPagination = 'none' | 'url' | 'append';
|
|
5474
6683
|
|
|
6684
|
+
/**
|
|
6685
|
+
* Says something on a `channel`, by id: every page on its topic hears it — `onMessage`, and the channel's source.
|
|
6686
|
+
*
|
|
6687
|
+
* `data` is what they receive: a template (`'{{ state.draft }}'`) or JSON text. `type` is yours to name — `chat`,
|
|
6688
|
+
* `wave`, `move` — and a flow on `onMessage` tells them apart with `when({ field: '<step>.type', … })`.
|
|
6689
|
+
*/
|
|
6690
|
+
export declare const publishOn: (target: string, type: string, data?: unknown) => StepSpec;
|
|
6691
|
+
|
|
5475
6692
|
/** Reconcile supplied params to a catalog schema: drop unknown keys when the set is CLOSED (strict), then fill the
|
|
5476
6693
|
* builder's defaults for any declared param the agent omitted whose `when` guard holds. Mirrors what the builder
|
|
5477
6694
|
* stores, so the persisted node round-trips cleanly. */
|
|
@@ -5498,9 +6715,11 @@ export declare const reference: {
|
|
|
5498
6715
|
* somebody reloads it. Pair it with the call that did the writing rather than with a notification: what tells the
|
|
5499
6716
|
* person it worked is the row leaving.
|
|
5500
6717
|
*
|
|
5501
|
-
* An element callback, so `target` is the CONTAINER's id, not the button's.
|
|
6718
|
+
* An element callback, so `target` is the CONTAINER's id, not the button's. `input` is what a server-driven one is
|
|
6719
|
+
* asked with this time — `{ q: '{{ state.search }}' }` for a search — beside the page's route and query params, and
|
|
6720
|
+
* kept for every page it loads after, until the next reload.
|
|
5502
6721
|
*/
|
|
5503
|
-
export declare const reloadApi: (target: string) => StepSpec;
|
|
6722
|
+
export declare const reloadApi: (target: string, input?: Record<string, string>) => StepSpec;
|
|
5504
6723
|
|
|
5505
6724
|
/** Someone else's origin — Adobe Fonts, Bunny, Fontshare, the customer's own CDN. Either a
|
|
5506
6725
|
* stylesheet that declares the faces, or the files themselves. */
|
|
@@ -5529,6 +6748,31 @@ export declare const removeState: (params: {
|
|
|
5529
6748
|
index: string | number;
|
|
5530
6749
|
}) => StepSpec;
|
|
5531
6750
|
|
|
6751
|
+
/** A page a function can be evaluated in, with one argument — Playwright's `Page`, Puppeteer's, or anything alike. */
|
|
6752
|
+
export declare interface RenderEvaluator {
|
|
6753
|
+
evaluate<R>(fn: (since: number) => R, since: number): Promise<R>;
|
|
6754
|
+
}
|
|
6755
|
+
|
|
6756
|
+
export declare interface RenderOptions {
|
|
6757
|
+
/** The most element renders the interaction may cause. Over it, `problems` says so and names the elements. */
|
|
6758
|
+
max?: number;
|
|
6759
|
+
/** How long to wait after the interaction for what it set off to render, in milliseconds — 300 by default. */
|
|
6760
|
+
settle?: number;
|
|
6761
|
+
}
|
|
6762
|
+
|
|
6763
|
+
export declare interface RenderReport {
|
|
6764
|
+
/** React commits the interaction caused. */
|
|
6765
|
+
commits: number;
|
|
6766
|
+
/** Element renders in all of them. */
|
|
6767
|
+
total: number;
|
|
6768
|
+
/** Every element that rendered, most renders first. */
|
|
6769
|
+
elements: ElementRenders[];
|
|
6770
|
+
/** The store paths written meanwhile — what set the renders off. */
|
|
6771
|
+
causes: string[];
|
|
6772
|
+
/** Empty unless `max` was given and exceeded: one sentence with the count and the elements that rendered most. */
|
|
6773
|
+
problems: string[];
|
|
6774
|
+
}
|
|
6775
|
+
|
|
5532
6776
|
/**
|
|
5533
6777
|
* Empties a form — every value and every error — by id.
|
|
5534
6778
|
*
|
|
@@ -5559,8 +6803,12 @@ export declare type ResponsiveBlock = Partial<Record<DisplayMode, StyleBlock>>;
|
|
|
5559
6803
|
* Per-breakpoint CSS as an author writes it. Omitted breakpoints inherit `desktop`, as they do in the builder — and
|
|
5560
6804
|
* only `desktop`: `tablet` (48–64rem) and `mobile` (below 48rem) are disjoint ranges, so a `tablet` rule never
|
|
5561
6805
|
* reaches a phone unless `mobile` repeats it.
|
|
6806
|
+
*
|
|
6807
|
+
* `compact` is both of them at once — everything narrower than a desktop: the dock that replaces a sidebar, the grid
|
|
6808
|
+
* that drops to one column. Written out to `tablet` and `mobile` alike, under whatever either says for itself, so
|
|
6809
|
+
* the document still holds the three breakpoints the builder edits.
|
|
5562
6810
|
*/
|
|
5563
|
-
export declare type ResponsiveCss = Partial<Record<DisplayMode, CssProps>>;
|
|
6811
|
+
export declare type ResponsiveCss = Partial<Record<DisplayMode | 'compact', CssProps>>;
|
|
5564
6812
|
|
|
5565
6813
|
/** Per-breakpoint CSS as it reaches the document. */
|
|
5566
6814
|
export declare type ResponsiveStyle = Partial<Record<DisplayMode, StyleRules>>;
|
|
@@ -5658,7 +6906,30 @@ declare type Schema = {
|
|
|
5658
6906
|
settings: {
|
|
5659
6907
|
keepState?: boolean;
|
|
5660
6908
|
stateStorage?: 'localStorage' | 'sessionStorage';
|
|
6909
|
+
/**
|
|
6910
|
+
* Keys of `runtime.state` that are never kept, even with `keepState` on: they are not written, not brought back,
|
|
6911
|
+
* and a value one of them already holds survives the moment the rest is restored. For state that must start fresh
|
|
6912
|
+
* on every visit — a demo, a panel somebody left open, a step of a walkthrough. Top-level keys, as `setState`
|
|
6913
|
+
* writes them.
|
|
6914
|
+
*/
|
|
6915
|
+
transientState?: string[];
|
|
6916
|
+
/**
|
|
6917
|
+
* Keys of `runtime.state` the first paint depends on — the tool a toolbar shows, a name in an avatar — kept in a
|
|
6918
|
+
* cookie as well as in `stateStorage`, so the server renders with them and the page does not swap them in after
|
|
6919
|
+
* hydration. Small values only: the cookie travels with every request and holds at most a few kilobytes. Needs
|
|
6920
|
+
* `keepState`; a key cannot be both painted and transient. Top-level keys, as `setState` writes them.
|
|
6921
|
+
*/
|
|
6922
|
+
paintedState?: string[];
|
|
5661
6923
|
customCss: string;
|
|
6924
|
+
/**
|
|
6925
|
+
* The roles a signed-in visitor may hold in this space, each with the permissions it gives:
|
|
6926
|
+
* `{ author: ['postPublish'] }`. They are what an action's `access: 'role'` and a page's `can()` are answered from
|
|
6927
|
+
* — a visitor holds exactly the permissions of their roles here, never those of their account anywhere else.
|
|
6928
|
+
*
|
|
6929
|
+
* Declared by the space, so they are published, versioned and exported with it. WHO holds which is not: that is a
|
|
6930
|
+
* list of people, kept by the platform the space runs on, and never part of a document anybody can read.
|
|
6931
|
+
*/
|
|
6932
|
+
visitorRoles?: Record<string, string[]>;
|
|
5662
6933
|
/** `basic` covers any HTTP+JSON backend by configuration; anything else is a name someone registered. */
|
|
5663
6934
|
userProvider?: 'basic' | 'custom' | '' | (string & {});
|
|
5664
6935
|
tokenStorage?: 'localStorage' | 'sessionStorage' | '';
|
|
@@ -5686,6 +6957,13 @@ declare type Schema = {
|
|
|
5686
6957
|
* session itself, which is the case whenever `loginUrl` is your own API.
|
|
5687
6958
|
*/
|
|
5688
6959
|
sessionExchangeUrl?: string;
|
|
6960
|
+
/**
|
|
6961
|
+
* Where a sign-in that owed a second factor is completed: a password the backend answered with `mfaRequired` and
|
|
6962
|
+
* an `mfaToken` resolves `auth.login` to `{ ok: false, reason: 'mfa', mfaToken }`, and `auth.login` with `mode:
|
|
6963
|
+
* 'mfa'` posts `{ mfaToken, code }` here and adopts the session it answers with. Leave empty when the backend has
|
|
6964
|
+
* no second factor.
|
|
6965
|
+
*/
|
|
6966
|
+
mfaUrl?: string;
|
|
5689
6967
|
/**
|
|
5690
6968
|
* What to do on a page that requires a session while the stored one is being re-checked. `optimistic` (the
|
|
5691
6969
|
* default) renders from the stored session and signs out if the check disagrees; `strict` waits for the answer,
|
|
@@ -5702,6 +6980,18 @@ declare type Schema = {
|
|
|
5702
6980
|
* `false` there cannot be turned around from here. Never `devMode`, which makes a deployment a development server.
|
|
5703
6981
|
*/
|
|
5704
6982
|
debugMode?: boolean;
|
|
6983
|
+
/**
|
|
6984
|
+
* Values the space computes once and reads everywhere, by name: `{ xp: '{{ state.favourites|length * 10 }}' }` is
|
|
6985
|
+
* read as `{{ computed.xp }}` in any binding, attribute or step. Each is a template over the global sources and the
|
|
6986
|
+
* values declared before it (`computed.<earlier>`), re-evaluated when any of them changes. A template that is one
|
|
6987
|
+
* `{{ expression }}` gives its value (a number, a list); anything else gives text.
|
|
6988
|
+
*/
|
|
6989
|
+
computed?: Record<string, string>;
|
|
6990
|
+
/**
|
|
6991
|
+
* The realtime channels the space offers, by topic pattern: `{ 'board:{id}': { access: { mode: 'public' } } }`.
|
|
6992
|
+
* A page subscribes to and publishes on a topic one of them matches, and on nothing else.
|
|
6993
|
+
*/
|
|
6994
|
+
channels?: ChannelDeclarations;
|
|
5705
6995
|
};
|
|
5706
6996
|
rsc?: SchemaRsc;
|
|
5707
6997
|
pages: Element_2['id'][];
|
|
@@ -5713,7 +7003,7 @@ declare type Schema = {
|
|
|
5713
7003
|
*
|
|
5714
7004
|
* A key outside it is one nothing reads any more — `head`, from before a space declared its fonts.
|
|
5715
7005
|
*/
|
|
5716
|
-
export declare const SCHEMA_SETTINGS: readonly ["keepState", "stateStorage", "customCss", "userProvider", "tokenStorage", "loginUrl", "userUrl", "refreshUrl", "logoutUrl", "detailsPath", "tokenPath", "refreshTokenPath", "expirationTimePath", "refreshExpirationTimePath", "sessionHintCookie", "sessionExchangeUrl", "sessionGate", "sessionRevalidateSeconds", "debugMode"];
|
|
7006
|
+
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"];
|
|
5717
7007
|
|
|
5718
7008
|
declare type SchemaRsc = {
|
|
5719
7009
|
enabled?: boolean;
|
|
@@ -5761,16 +7051,53 @@ declare type SchemaVariableBase<TType extends string, TValue> = {
|
|
|
5761
7051
|
|
|
5762
7052
|
export declare const selectorFor: (id: string) => string;
|
|
5763
7053
|
|
|
5764
|
-
/**
|
|
7054
|
+
/**
|
|
7055
|
+
* What `setState` can store a value as — the state source's own `type` options, spelled once for the type system. A
|
|
7056
|
+
* test holds the two to the same list: this one had lost `json`, so storing a row or an object was a compile error in
|
|
7057
|
+
* exactly the place the runtime and the docs said to do it.
|
|
7058
|
+
*/
|
|
7059
|
+
export declare const SET_STATE_TYPES: readonly ["boolean", "number", "text", "json"];
|
|
7060
|
+
|
|
7061
|
+
/**
|
|
7062
|
+
* Writes one value into a form's control, by the control's `name` — what fills a form with what is already known
|
|
7063
|
+
* (the account's username on a profile page) without a binding on the control, which would be rewritten each time its
|
|
7064
|
+
* source changed, under the person typing.
|
|
7065
|
+
*
|
|
7066
|
+
* A form callback, so `target` is the FORM's id. `value` is a template: `'{{ auth.details.username }}'`.
|
|
7067
|
+
*/
|
|
7068
|
+
export declare const setFieldValue: (target: string, name: string, value: string) => StepSpec;
|
|
7069
|
+
|
|
7070
|
+
/**
|
|
7071
|
+
* Writes `runtime.state.<key>`. NOT the element `setState`, which changes one element's own attribute.
|
|
7072
|
+
*
|
|
7073
|
+
* `json` stores an object or a list: `value: '{{ list_rows.item }}'` keeps the row itself, not its text.
|
|
7074
|
+
*/
|
|
5765
7075
|
export declare const setState: (params: {
|
|
5766
7076
|
key: string;
|
|
5767
|
-
type:
|
|
7077
|
+
type: (typeof SET_STATE_TYPES)[number];
|
|
5768
7078
|
value: unknown;
|
|
5769
7079
|
}) => StepSpec;
|
|
5770
7080
|
|
|
7081
|
+
/** A shortcut as `onKey` writes it, as the key a driver presses. Refuses anything `onKey` would. */
|
|
7082
|
+
export declare const shortcutKey: (shortcut: string, isMac: boolean) => string;
|
|
7083
|
+
|
|
5771
7084
|
/** The longhand keys a shorthand controls — what a `null` patch value has to clear. */
|
|
5772
7085
|
export declare const shorthandLonghands: (key: string) => string[] | undefined;
|
|
5773
7086
|
|
|
7087
|
+
/**
|
|
7088
|
+
* A space with nothing but one page, for a test that is about what is ON it.
|
|
7089
|
+
*
|
|
7090
|
+
* ```ts
|
|
7091
|
+
* const { schema, style, handles } = authorSpace(singlePageSpace([heading('Hi', { id: 'title', subType: 'h1' })]));
|
|
7092
|
+
* ```
|
|
7093
|
+
*
|
|
7094
|
+
* Everything else — the variables, the classes, the page's own fields — goes in `space`, and `space.page` is merged
|
|
7095
|
+
* onto the page, so a test states only what it is about.
|
|
7096
|
+
*/
|
|
7097
|
+
export declare const singlePageSpace: (body: ElementSpec[], space?: Partial<Omit<SpaceSpec, "pages">> & {
|
|
7098
|
+
page?: Partial<Omit<PageSpec, "body">>;
|
|
7099
|
+
}) => SpaceSpec;
|
|
7100
|
+
|
|
5774
7101
|
/**
|
|
5775
7102
|
* A string as a slug: lowercase, `[a-z0-9-]`, no leading or trailing dash.
|
|
5776
7103
|
*
|
|
@@ -5793,7 +7120,7 @@ export declare type SourceIndex = Map<string, string>;
|
|
|
5793
7120
|
export declare type SourceTypes = Record<string, string>;
|
|
5794
7121
|
|
|
5795
7122
|
/** The same guarantee for the space itself, in the order its fields are written. */
|
|
5796
|
-
export declare const SPACE_FIELDS: readonly ["name", "permanentUrl", "mode", "theme", "variables", "fonts", "elements", "classes", "schemaVariables", "settings", "customCss", "rsc", "pageFolders", "layouts", "pages"];
|
|
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"];
|
|
5797
7124
|
|
|
5798
7125
|
/**
|
|
5799
7126
|
* The `space` source, which the SDK application registers rather than this package.
|
|
@@ -5843,7 +7170,9 @@ declare type SpaceFont = SystemFont | GoogleFont | RemoteFont | HostedFont;
|
|
|
5843
7170
|
export declare interface SpaceHandles {
|
|
5844
7171
|
/** The pages, by id. */
|
|
5845
7172
|
pages: Record<string, PageHandle>;
|
|
5846
|
-
/**
|
|
7173
|
+
/** The layout shells, by id. */
|
|
7174
|
+
layouts: Record<string, LayoutHandle>;
|
|
7175
|
+
/** Every element of every page and every layout, by id — ids are unique across the whole document. */
|
|
5847
7176
|
elements: Record<string, ElementHandle>;
|
|
5848
7177
|
/**
|
|
5849
7178
|
* One element, by id, or a throw naming what does exist.
|
|
@@ -5876,6 +7205,41 @@ export declare interface SpaceSpec {
|
|
|
5876
7205
|
elements?: Record<string, ElementStyleSpec>;
|
|
5877
7206
|
schemaVariables?: SchemaVariable[];
|
|
5878
7207
|
customCss?: string;
|
|
7208
|
+
/**
|
|
7209
|
+
* How the notifications an `addNotification` step shows look: `{ background: 'var(--card)', text: 'var(--foreground)',
|
|
7210
|
+
* success: 'var(--accent)', radius: '12px' }`. They follow the light/dark theme and the page's font already.
|
|
7211
|
+
*/
|
|
7212
|
+
notifications?: NotificationsSpec;
|
|
7213
|
+
/**
|
|
7214
|
+
* Values computed once and read everywhere as `{{ computed.<name> }}` — an expression a dozen bindings would
|
|
7215
|
+
* otherwise each repeat:
|
|
7216
|
+
*
|
|
7217
|
+
* ```ts
|
|
7218
|
+
* computed: {
|
|
7219
|
+
* xp: '{{ (state.favourites|length) * 10 + (state.runs ?? 0) * 5 }}',
|
|
7220
|
+
* level: '{{ computed.xp // 100 + 1 }}'
|
|
7221
|
+
* }
|
|
7222
|
+
* ```
|
|
7223
|
+
*
|
|
7224
|
+
* Each is a template over the globals (`state`, `auth`, `navigation`, `variables`, `theme`, `host`) and the values
|
|
7225
|
+
* declared ABOVE it. One `{{ expression }}` gives its value (a number, a list, a flag); anything else gives text. An
|
|
7226
|
+
* element's source (a list row, a provider) is not readable here: bind that on the element.
|
|
7227
|
+
*/
|
|
7228
|
+
computed?: Record<string, string>;
|
|
7229
|
+
/**
|
|
7230
|
+
* The realtime channels the space offers, by topic pattern — what a `channel` element's `topic` must match:
|
|
7231
|
+
*
|
|
7232
|
+
* ```ts
|
|
7233
|
+
* channels: {
|
|
7234
|
+
* 'board:{id}': { access: { mode: 'public' }, presence: true },
|
|
7235
|
+
* 'scores:{id}': { access: { mode: 'session' }, publish: 'server' }
|
|
7236
|
+
* }
|
|
7237
|
+
* ```
|
|
7238
|
+
*
|
|
7239
|
+
* `{id}` is the part a page fills in (`board:{{ id }}`); each board is its own topic. `publish: 'server'` is a
|
|
7240
|
+
* channel only a flow's `realtime.publish` sends on. See `docs/en/realtime.md`.
|
|
7241
|
+
*/
|
|
7242
|
+
channels?: ChannelDeclarations;
|
|
5879
7243
|
/**
|
|
5880
7244
|
* Everything else the schema's settings carry — where sign-in posts to, which cookie hints at a session, how
|
|
5881
7245
|
* state is kept. `customCss` above is the one field of that same object every space sets, and it stays named on
|
|
@@ -5905,6 +7269,9 @@ export declare interface SpaceSpec {
|
|
|
5905
7269
|
pages: PageSpec[];
|
|
5906
7270
|
}
|
|
5907
7271
|
|
|
7272
|
+
/** The structure's options, and the catalogues the linter reads what the documents mean against. */
|
|
7273
|
+
export declare type SpaceValidationOptions = SchemaValidationOptions & LintCatalogs;
|
|
7274
|
+
|
|
5908
7275
|
export declare interface SpecCorrection {
|
|
5909
7276
|
code: SpecCorrectionCode;
|
|
5910
7277
|
message: string;
|
|
@@ -5925,7 +7292,7 @@ export declare interface SpecCorrection {
|
|
|
5925
7292
|
* Rather than refusing them, what can be repaired is repaired and every repair is reported in `corrections`, so a
|
|
5926
7293
|
* person can read what changed. Nothing is changed silently, and nothing that renders is dropped.
|
|
5927
7294
|
*/
|
|
5928
|
-
export declare type SpecCorrectionCode = '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' | 'fixed-global-callback' | 'dropped-initial-state' | 'missing-folder' | 'broken-layout';
|
|
7295
|
+
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';
|
|
5929
7296
|
|
|
5930
7297
|
export declare interface SpecFromSpace {
|
|
5931
7298
|
spec: SpaceSpec;
|
|
@@ -6026,6 +7393,8 @@ export declare interface StepSpec {
|
|
|
6026
7393
|
on?: string;
|
|
6027
7394
|
when?: ElementInteraction['when'];
|
|
6028
7395
|
enabled?: boolean;
|
|
7396
|
+
/** On a trigger: what firing it again does while its flow still runs. See {@link whileRunning}. */
|
|
7397
|
+
whileRunning?: ElementInteraction['whileRunning'];
|
|
6029
7398
|
}
|
|
6030
7399
|
|
|
6031
7400
|
/**
|
|
@@ -6041,12 +7410,33 @@ export declare interface StepSpec {
|
|
|
6041
7410
|
* makes the fragment usable on documents whose vocabulary nobody here knows.
|
|
6042
7411
|
*/
|
|
6043
7412
|
export declare interface StepVocabulary {
|
|
6044
|
-
/** Global callbacks by action name, each naming the module id it is registered on. */
|
|
7413
|
+
/** Global callbacks by action name, each naming the module id it is registered on, and the params it takes. */
|
|
6045
7414
|
globalCallbacks: Record<string, {
|
|
6046
7415
|
source: string;
|
|
7416
|
+
strictParams?: boolean;
|
|
7417
|
+
params?: ParamSpec;
|
|
7418
|
+
}>;
|
|
7419
|
+
/** Utility actions and their params. A utility is resolved by action alone and runs on no module at all. */
|
|
7420
|
+
utilities: Record<string, {
|
|
7421
|
+
strictParams?: boolean;
|
|
7422
|
+
params?: ParamSpec;
|
|
7423
|
+
}>;
|
|
7424
|
+
/**
|
|
7425
|
+
* Element type → every trigger it fires, the ones all elements share included. A type that is not listed is a
|
|
7426
|
+
* plugin's, whose triggers nobody here can know, and its flows are left alone.
|
|
7427
|
+
*/
|
|
7428
|
+
triggers?: Record<string, readonly string[]>;
|
|
7429
|
+
/** Element type → every element callback it answers to, the shared `setState`/`toggleState` included. */
|
|
7430
|
+
callbacks?: Record<string, readonly string[]>;
|
|
7431
|
+
/**
|
|
7432
|
+
* The callbacks every element answers to, and the params each takes. A type's own callbacks (`openModal`) describe
|
|
7433
|
+
* their params for the builder's controls, whose options only a mounted element knows, so only these are held to
|
|
7434
|
+
* their params.
|
|
7435
|
+
*/
|
|
7436
|
+
sharedCallbacks?: Record<string, {
|
|
7437
|
+
strictParams?: boolean;
|
|
7438
|
+
params?: ParamSpec;
|
|
6047
7439
|
}>;
|
|
6048
|
-
/** Utility actions. A utility is resolved by action alone and runs on no module at all. */
|
|
6049
|
-
utilities: Record<string, unknown>;
|
|
6050
7440
|
}
|
|
6051
7441
|
|
|
6052
7442
|
declare type Style = {
|
|
@@ -6075,8 +7465,12 @@ export declare const STYLE_STATES: readonly StyleState[];
|
|
|
6075
7465
|
*
|
|
6076
7466
|
* `focus-visible` is the focus ring a keyboard user needs and a mouse user does not; `focus-within` dresses a
|
|
6077
7467
|
* container while anything inside it has focus — a field wrapper around its input.
|
|
7468
|
+
*
|
|
7469
|
+
* `hidden` is not a pseudo-class: it is how an element looks while its `visible` says no — where it goes as it hides,
|
|
7470
|
+
* and where it comes from as it shows. With a transition on the class (`display` among what it transitions, and
|
|
7471
|
+
* `transition-behavior: allow-discrete`), a panel fades or slides in and out instead of blinking.
|
|
6078
7472
|
*/
|
|
6079
|
-
declare const STYLE_STATES_2: readonly ["hover", "focus", "focus-visible", "focus-within", "active", "disabled", "checked", "visited"];
|
|
7473
|
+
declare const STYLE_STATES_2: readonly ["hover", "focus", "focus-visible", "focus-within", "active", "disabled", "checked", "visited", "hidden"];
|
|
6080
7474
|
|
|
6081
7475
|
declare type StyleAncestor = {
|
|
6082
7476
|
default?: StyleObject;
|
|
@@ -6166,6 +7560,7 @@ declare const styleConstants: {
|
|
|
6166
7560
|
readonly TRANSITION_DURATION: "transition-duration";
|
|
6167
7561
|
readonly TRANSITION_TIMING_FUNCTION: "transition-timing-function";
|
|
6168
7562
|
readonly TRANSITION_DELAY: "transition-delay";
|
|
7563
|
+
readonly TRANSITION_BEHAVIOR: "transition-behavior";
|
|
6169
7564
|
readonly ANIMATION: "animation";
|
|
6170
7565
|
readonly ANIMATION_NAME: "animation-name";
|
|
6171
7566
|
readonly ANIMATION_DURATION: "animation-duration";
|
|
@@ -6356,6 +7751,9 @@ export declare const suggestCssProperty: (key: string) => string | undefined;
|
|
|
6356
7751
|
* "template" teaches "twigTemplate". Undefined when nothing is close. */
|
|
6357
7752
|
export declare const suggestTransformer: (action: string) => string | undefined;
|
|
6358
7753
|
|
|
7754
|
+
/** The commits as a report. Separate from the page so what a report SAYS is tested without a browser. */
|
|
7755
|
+
export declare const summariseRenders: (commits: readonly TracedCommit[], max?: number) => RenderReport;
|
|
7756
|
+
|
|
6359
7757
|
/** Installed nowhere: a stack the visitor's system already has. Costs no bytes. */
|
|
6360
7758
|
declare type SystemFont = FontBase & {
|
|
6361
7759
|
source: 'system';
|
|
@@ -6402,6 +7800,9 @@ export declare type Template = {
|
|
|
6402
7800
|
style: Style;
|
|
6403
7801
|
};
|
|
6404
7802
|
|
|
7803
|
+
/** What a binding's template hands its attribute: its rendered text, or the value of its one `{{ expression }}`. */
|
|
7804
|
+
export declare type TemplateReturns = 'text' | 'value';
|
|
7805
|
+
|
|
6405
7806
|
/**
|
|
6406
7807
|
* What a template author declares: a name, a description and a subtree.
|
|
6407
7808
|
*
|
|
@@ -6491,7 +7892,7 @@ export declare const toggleElement: (params: {
|
|
|
6491
7892
|
* A checkbox, as one step: in the list at `runtime.state.<key>` if it was not, out of it if it was.
|
|
6492
7893
|
*
|
|
6493
7894
|
* The list is a SET, which is what makes pressing the box twice safe — an append guarded by a check reads the list
|
|
6494
|
-
*
|
|
7895
|
+
* before the other press's write lands, so two presses in the same tick both add.
|
|
6495
7896
|
*/
|
|
6496
7897
|
export declare const toggleInState: (params: {
|
|
6497
7898
|
key: string;
|
|
@@ -6501,9 +7902,10 @@ export declare const toggleInState: (params: {
|
|
|
6501
7902
|
/**
|
|
6502
7903
|
* Flips `runtime.state.<key>` — expand and collapse, open and close, from ONE step on ONE trigger.
|
|
6503
7904
|
*
|
|
6504
|
-
* The alternative
|
|
6505
|
-
*
|
|
6506
|
-
*
|
|
7905
|
+
* The alternative — two `setState` steps under `when` conditions that are complements of each other — undoes itself:
|
|
7906
|
+
* each step reads the state as it is when it runs, so the second sees what the first just wrote and writes it back.
|
|
7907
|
+
* Anything not already `true` counts as false, so a key nobody has set yet flips ON first: for something shown by
|
|
7908
|
+
* default, name the key for hiding it (`sidebarCollapsed`), so its absence means shown.
|
|
6507
7909
|
*/
|
|
6508
7910
|
export declare const toggleState: (params: {
|
|
6509
7911
|
key: string;
|
|
@@ -6539,6 +7941,35 @@ export declare const toPortableSource: (source: string) => string;
|
|
|
6539
7941
|
*/
|
|
6540
7942
|
export declare const toResponsive: (spec: CssSpec | undefined) => ResponsiveStyle;
|
|
6541
7943
|
|
|
7944
|
+
declare type TracedCommit = {
|
|
7945
|
+
commitId: number;
|
|
7946
|
+
elements: TracedRender[];
|
|
7947
|
+
causes: {
|
|
7948
|
+
path: string;
|
|
7949
|
+
}[];
|
|
7950
|
+
};
|
|
7951
|
+
|
|
7952
|
+
/**
|
|
7953
|
+
* Which elements an interaction rendered, and why — read off the SDK's own render tracing.
|
|
7954
|
+
*
|
|
7955
|
+
* A page that does the right thing can still do it by rendering everything: a binding subscribed to more than it
|
|
7956
|
+
* reads, a value that comes out a new object each time, a parent whose change carries every child with it. Nothing
|
|
7957
|
+
* shows it but the frame rate, on somebody else's slower machine. This names every element that rendered, how often,
|
|
7958
|
+
* and what changed for it — so a suite can hold an interaction to what it should cost, and a failure says where the
|
|
7959
|
+
* extra renders came from.
|
|
7960
|
+
*/
|
|
7961
|
+
/** What the tracing records of one render — the part read here. */
|
|
7962
|
+
declare type TracedRender = {
|
|
7963
|
+
elementId: string;
|
|
7964
|
+
/**
|
|
7965
|
+
* What changed for the element since its previous render, as its `withElement` saw it: set only when the element
|
|
7966
|
+
* itself rendered, and empty when it rendered with none of its inputs changed (its context, or its parent).
|
|
7967
|
+
*/
|
|
7968
|
+
changedProps?: {
|
|
7969
|
+
key: string;
|
|
7970
|
+
}[];
|
|
7971
|
+
};
|
|
7972
|
+
|
|
6542
7973
|
/** The transformer catalog projected for the data-sources resource / primer, so the agent knows the exact action
|
|
6543
7974
|
* names and params up front (the real fix for the "agent can't write transformers" problem). */
|
|
6544
7975
|
export declare const transformerCatalog: () => TransformerInfo[];
|
|
@@ -6565,10 +7996,15 @@ declare interface TriggerCommon {
|
|
|
6565
7996
|
enabled?: boolean;
|
|
6566
7997
|
}
|
|
6567
7998
|
|
|
7999
|
+
declare type TriggerName<D extends DeclaresInteractions> = keyof NonNullable<D['triggers']> & string;
|
|
8000
|
+
|
|
6568
8001
|
export declare const twigTemplate: (params: {
|
|
6569
8002
|
template: string;
|
|
6570
8003
|
}) => StepSpec;
|
|
6571
8004
|
|
|
8005
|
+
/** The triggers only some types fire, by action name — for a step builder that wants the title the builder shows. */
|
|
8006
|
+
export declare const typeTriggerDefinitions: Record<string, InteractionCallback>;
|
|
8007
|
+
|
|
6572
8008
|
/**
|
|
6573
8009
|
* Changes one element's own attribute or state — the element `setState`, which is NOT the global one that writes
|
|
6574
8010
|
* `runtime.state`. Left without a target it runs against the element the flow is declared on.
|
|
@@ -6589,15 +8025,48 @@ export declare const updateElement: (params: {
|
|
|
6589
8025
|
}, target?: string) => StepSpec;
|
|
6590
8026
|
|
|
6591
8027
|
/**
|
|
6592
|
-
* `validateSpace`, holding this SDK's own
|
|
8028
|
+
* `validateSpace`, holding this SDK's own catalogs — the same gate `authorSpace` puts its output through, for documents
|
|
8029
|
+
* written anywhere else: the builder saving through the API, an import, an agent's edit, a JSON edited by hand.
|
|
8030
|
+
*/
|
|
8031
|
+
export declare const validateSpace: (space: SpaceDocuments, options?: SpaceValidationOptions) => SchemaValidationResult;
|
|
8032
|
+
|
|
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
|
+
/**
|
|
8037
|
+
* Every value of a string-literal union, as a list — and a compile error when the list leaves one out.
|
|
6593
8038
|
*
|
|
6594
|
-
*
|
|
6595
|
-
*
|
|
8039
|
+
* `valuesOf<NonNullable<ButtonProps['subType']>>()(['button', 'submit', 'reset'])`. A value outside the union is
|
|
8040
|
+
* refused by the parameter type; one the union has and the list does not makes the argument ask for `missing`.
|
|
6596
8041
|
*/
|
|
6597
|
-
export declare const
|
|
8042
|
+
export declare const valuesOf: <T extends string>() => <const V extends readonly T[]>(values: V & ([Exclude<T, V[number]>] extends [never] ? unknown : {
|
|
8043
|
+
readonly missing: Exclude<T, V[number]>;
|
|
8044
|
+
})) => readonly string[];
|
|
6598
8045
|
|
|
6599
|
-
/**
|
|
6600
|
-
|
|
8046
|
+
/**
|
|
8047
|
+
* Switches one of a CLASS's variants from a value the data answered — a status pill that turns amber, green or red
|
|
8048
|
+
* as the job it describes moves.
|
|
8049
|
+
*
|
|
8050
|
+
* The variant map is keyed by the SELECTOR the variants belong to, and the obvious guess names a different one:
|
|
8051
|
+
* `text.base` selects the text TYPE's own variants (`text--done`), not the class the element wears
|
|
8052
|
+
* (`statusPill--done`), so the element renders with no variant at all and nothing reports it. Taken from the class
|
|
8053
|
+
* declaration, the key cannot drift from the class it means. The value at `source` names the variant, or `template`
|
|
8054
|
+
* turns it into one.
|
|
8055
|
+
*/
|
|
8056
|
+
export declare const variantFrom: (cls: ClassRef, source: string, options?: VariantFromOptions) => BindingSpec;
|
|
8057
|
+
|
|
8058
|
+
/** What {@link variantFrom} takes beyond the class and the source. */
|
|
8059
|
+
export declare interface VariantFromOptions {
|
|
8060
|
+
/** Which of the element's selectors wears the class — `base` for nearly everything, `input` for a form control. */
|
|
8061
|
+
slot?: string;
|
|
8062
|
+
/**
|
|
8063
|
+
* A twig expression turning the value into a variant name, with the value as `source` — for when the data does not
|
|
8064
|
+
* already speak in variant names: `"{{ source == 'completed' ? 'ok' : 'failed' }}"`, or `"{{ source == 'code' ?
|
|
8065
|
+
* 'on' : 'off' }}"` for a control that lights up when a state names it. A name the class does not declare wears no
|
|
8066
|
+
* variant, so the other branch can simply name one nothing styles.
|
|
8067
|
+
*/
|
|
8068
|
+
template?: string;
|
|
8069
|
+
}
|
|
6601
8070
|
|
|
6602
8071
|
/** One variant of a selector: what it changes, and how it reacts on its own. A variant cannot carry variants. */
|
|
6603
8072
|
export declare interface VariantSpec {
|
|
@@ -6622,6 +8091,19 @@ export declare const video: {
|
|
|
6622
8091
|
}>> | undefined): ElementSpec;
|
|
6623
8092
|
};
|
|
6624
8093
|
|
|
8094
|
+
/**
|
|
8095
|
+
* A visibility the data does not answer on its own: a template over the value, read as a yes or a no —
|
|
8096
|
+
* `{ source: 'state.genre', template: "{{ source == '' or source == list_games.item.genre }}" }`. `false`, `0`, an
|
|
8097
|
+
* empty text, an empty list and nothing at all are a no; anything else is a yes. No `? 'true' : 'false'` needed.
|
|
8098
|
+
*
|
|
8099
|
+
* As an element's `visible` it also starts the element hidden, which is what a condition computed from data wants:
|
|
8100
|
+
* shown only once the template has said so, rather than drawn and then taken away.
|
|
8101
|
+
*/
|
|
8102
|
+
export declare interface VisibleCondition {
|
|
8103
|
+
source: string;
|
|
8104
|
+
template: string;
|
|
8105
|
+
}
|
|
8106
|
+
|
|
6625
8107
|
/**
|
|
6626
8108
|
* Shows or hides an element from a value the data answered.
|
|
6627
8109
|
*
|
|
@@ -6629,7 +8111,7 @@ export declare const video: {
|
|
|
6629
8111
|
* and getting it wrong writes a `visibility` attribute no element reads, so the element stays visible and nothing
|
|
6630
8112
|
* reports anything.
|
|
6631
8113
|
*/
|
|
6632
|
-
export declare const visibleWhen: (source: string) => BindingSpec;
|
|
8114
|
+
export declare const visibleWhen: (source: string, template?: string) => BindingSpec;
|
|
6633
8115
|
|
|
6634
8116
|
/**
|
|
6635
8117
|
* Calls a URL and puts the answer in the flow scope as `{{ <id>.response.status }}` and `{{ <id>.response.data }}`.
|
|
@@ -6647,6 +8129,11 @@ export declare const webHook: (params: {
|
|
|
6647
8129
|
method?: "get" | "post" | "put" | "delete" | "patch" | "head";
|
|
6648
8130
|
body?: string | Record<string, unknown>;
|
|
6649
8131
|
authorizationToken?: string;
|
|
8132
|
+
/**
|
|
8133
|
+
* Headers of the request by name, templates for the values: `{ 'x-api-key': '{{ apiKey }}' }`. Not `Authorization`
|
|
8134
|
+
* (that is `authorizationToken`) nor the content type (the body's own), which the step sets itself.
|
|
8135
|
+
*/
|
|
8136
|
+
headers?: Record<string, string>;
|
|
6650
8137
|
credentials?: "include" | "omit" | "same-origin";
|
|
6651
8138
|
/** A read only: serve it from the page's query cache for `staleTime` seconds, shared with api containers. */
|
|
6652
8139
|
cache?: boolean;
|
|
@@ -6705,7 +8192,9 @@ export declare const when: (rules: Rule | Rule[], step: StepSpec, combinator?: "
|
|
|
6705
8192
|
* Runs a step only if the named server action did NOT complete.
|
|
6706
8193
|
*
|
|
6707
8194
|
* Every outcome that is not `completed`, which is deliberate: a run can come back `failed`, `skipped` or
|
|
6708
|
-
* `aborted`, and to the page they are one event — it did not work, and the reason is in `{{<id>.reason}}
|
|
8195
|
+
* `aborted`, and to the page they are one event — it did not work, and the reason is in `{{<id>.reason}}` — and, when
|
|
8196
|
+
* the server or a step wrote one for the caller (`ActionRefusal`, `flow.fail` telling the caller), in
|
|
8197
|
+
* `{{<id>.error}}`.
|
|
6709
8198
|
* Matching only `failed` is how the other two end up silently doing nothing.
|
|
6710
8199
|
*/
|
|
6711
8200
|
export declare const whenFailed: (stepId: string, step: StepSpec) => StepSpec;
|
|
@@ -6719,15 +8208,69 @@ export declare const whenFailed: (stepId: string, step: StepSpec) => StepSpec;
|
|
|
6719
8208
|
export declare const whenSucceeded: (stepId: string, step: StepSpec) => StepSpec;
|
|
6720
8209
|
|
|
6721
8210
|
/**
|
|
6722
|
-
*
|
|
8211
|
+
* What a trigger does when it fires again while the flow it started is still running.
|
|
8212
|
+
*
|
|
8213
|
+
* - `skip` (the default): the new firing is ignored — what keeps a double click from submitting twice.
|
|
8214
|
+
* - `parallel`: every firing runs its own flow, at the same time.
|
|
8215
|
+
* - `queue`: every firing runs, one after another, in the order they came — none lost, none overlapping.
|
|
8216
|
+
*/
|
|
8217
|
+
declare type WhileRunning = 'skip' | 'parallel' | 'queue';
|
|
8218
|
+
|
|
8219
|
+
/**
|
|
8220
|
+
* What a trigger does when it fires again while the flow it started still runs.
|
|
8221
|
+
*
|
|
8222
|
+
* `skip` is what happens without this: the new firing is ignored — which is what keeps a double click from submitting
|
|
8223
|
+
* twice, and exactly wrong for a stream of events a flow must answer every one of. `queue` runs each firing after the
|
|
8224
|
+
* last, in order; `parallel` runs them all at once.
|
|
8225
|
+
*
|
|
8226
|
+
* ```ts
|
|
8227
|
+
* [whileRunning('queue', named('arrived', on('onArrival'))), addNotification({ … }), delay(8000), …]
|
|
8228
|
+
* ```
|
|
8229
|
+
*/
|
|
8230
|
+
export declare const whileRunning: (mode: WhileRunning, trigger: StepSpec) => StepSpec;
|
|
8231
|
+
|
|
8232
|
+
/**
|
|
8233
|
+
* The same space with one element changed — "same page, one thing different", which is most of what a suite renders.
|
|
8234
|
+
*
|
|
8235
|
+
* ```ts
|
|
8236
|
+
* authorSpace(withElement(space, 'hero-title', { attributes: { content: 'Second render' } }))
|
|
8237
|
+
* ```
|
|
6723
8238
|
*
|
|
6724
|
-
*
|
|
6725
|
-
*
|
|
6726
|
-
*
|
|
8239
|
+
* On the SPEC, not on the authored documents, so the variant goes through `authorSpace` like anything else: a patch
|
|
8240
|
+
* that leaves the element invalid is refused with the same message a first draft would get, instead of rendering as
|
|
8241
|
+
* a document no author could have written. `attributes` merge onto the element's own; every other field replaces.
|
|
8242
|
+
* The spec passed in is not touched.
|
|
6727
8243
|
*/
|
|
8244
|
+
export declare const withElement: (spec: SpaceSpec, id: string, patch: ElementPatch) => SpaceSpec;
|
|
8245
|
+
|
|
8246
|
+
/**
|
|
8247
|
+
* The schema with every element under a name authoring accepts, and the renames that took.
|
|
8248
|
+
*
|
|
8249
|
+
* A builder from before an element's id was its name keyed `flat` by a Mongo ObjectId and kept the name apart, in
|
|
8250
|
+
* `idRef` — which is what the element's sources and the steps aimed at it were written against. The name is the id
|
|
8251
|
+
* now, so it is taken back: `idRef` where the element has one, a positional `<type>-<n>` where its id is not one
|
|
8252
|
+
* anything can name. An ObjectId that happens to start with a letter is a valid id and still not the name, which is
|
|
8253
|
+
* why carrying an `idRef` is enough on its own. `repointIds` carries every reference along — the same pass a rename in
|
|
8254
|
+
* the builder runs — on a copy, since the documents are the caller's.
|
|
8255
|
+
*/
|
|
8256
|
+
export declare const withNamedIds: (schema: Schema) => {
|
|
8257
|
+
schema: Schema;
|
|
8258
|
+
renames: ElementRename[];
|
|
8259
|
+
};
|
|
8260
|
+
|
|
8261
|
+
/**
|
|
8262
|
+
* The catalogs `authorSpace` holds a space to, with each declared plugin in them as if it were built in.
|
|
8263
|
+
*
|
|
8264
|
+
* Every catalog a built-in element is checked against is derived from its declaration; a plugin's declaration has
|
|
8265
|
+
* the same shape, so its type gets the same checks — its triggers and callbacks join the step vocabulary, its
|
|
8266
|
+
* attributes the attribute list, its source name the source table. Without this a plugin type was a name the linter
|
|
8267
|
+
* waved through, and a flow on an event it never fires was written, saved and never ran.
|
|
8268
|
+
*/
|
|
8269
|
+
export declare const withPluginCatalogs: (options: AuthorSpaceOptions) => AuthorSpaceOptions;
|
|
8270
|
+
|
|
6728
8271
|
export declare const withVisibility: (spec: {
|
|
6729
8272
|
bind?: BindingsSpec;
|
|
6730
|
-
visible?: string | false;
|
|
8273
|
+
visible?: string | false | VisibleCondition;
|
|
6731
8274
|
}) => BindingSpec[] | undefined;
|
|
6732
8275
|
|
|
6733
8276
|
export { }
|