@plitzi/sdk-authoring 0.37.2 → 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 +1146 -0
- package/dist/index.d.ts +1162 -105
- package/dist/index.js +7570 -3309
- package/package.json +8 -8
- package/skills/plitzi-authoring/SKILL.md +98 -14
- 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 +84 -18
- package/skills/plitzi-authoring/reference/elements-and-styles.md +61 -7
- package/skills/plitzi-authoring/reference/flows.md +108 -17
- 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 +19 -2
- package/skills/plitzi-authoring/reference/templates.md +67 -27
- package/skills/plitzi-authoring/reference/testing.md +72 -5
- package/skills/plitzi-authoring/reference/validation.md +73 -0
package/dist/index.d.ts
CHANGED
|
@@ -232,11 +232,27 @@ export declare interface ActiveOnOptions {
|
|
|
232
232
|
export declare const addNotification: (params: {
|
|
233
233
|
content: string;
|
|
234
234
|
placement?: "top-right" | "top-center" | "top-left" | "bottom-right" | "bottom-center" | "bottom-left";
|
|
235
|
-
|
|
235
|
+
appearance?: "success" | "danger" | "warning" | "info";
|
|
236
236
|
autoDismiss?: boolean;
|
|
237
237
|
autoDismissTimeout?: number;
|
|
238
238
|
}) => StepSpec;
|
|
239
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
|
+
|
|
240
256
|
/** What one ancestor condition changes: inside it always, in its states, or in its variants (and their states). */
|
|
241
257
|
export declare interface AncestorSpec {
|
|
242
258
|
css?: CssSpec;
|
|
@@ -244,6 +260,9 @@ export declare interface AncestorSpec {
|
|
|
244
260
|
variants?: Record<string, CssSpec | VariantSpec>;
|
|
245
261
|
}
|
|
246
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
|
+
|
|
247
266
|
/**
|
|
248
267
|
* A factory per element, named after it.
|
|
249
268
|
*
|
|
@@ -365,6 +384,13 @@ export declare const appendState: (params: {
|
|
|
365
384
|
withId?: boolean;
|
|
366
385
|
}) => StepSpec;
|
|
367
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
|
+
|
|
368
394
|
/** Resolve a `globalCallback` action against the built-in catalog: returns the module id it is registered under
|
|
369
395
|
* (`source`) and the params reconciled to the callback's schema — unknown keys dropped for a closed callback, then
|
|
370
396
|
* missing defaults filled. An action the catalog does not know (e.g. a plugin callback) yields no source and
|
|
@@ -389,11 +415,15 @@ export declare const applyUtility: (action: string, params: Record<string, unkno
|
|
|
389
415
|
params: Record<string, unknown>;
|
|
390
416
|
};
|
|
391
417
|
|
|
392
|
-
/**
|
|
393
|
-
|
|
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[];
|
|
394
424
|
|
|
395
425
|
/** The throwing flavour. Returns what was survivable so a caller can decide what to do about it. */
|
|
396
|
-
export declare const assertTemplateValid: (template: Template, context: string, options?:
|
|
426
|
+
export declare const assertTemplateValid: (template: Template, context: string, options?: SpaceValidationOptions) => SchemaValidationError[];
|
|
397
427
|
|
|
398
428
|
/**
|
|
399
429
|
* The attributes of one built-in element, by type name — `Attributes<'heading'>['subType']`.
|
|
@@ -427,6 +457,10 @@ export declare const authLogin: (params: {
|
|
|
427
457
|
} | {
|
|
428
458
|
mode: "token";
|
|
429
459
|
token: string;
|
|
460
|
+
} | {
|
|
461
|
+
mode: "mfa";
|
|
462
|
+
mfaToken: string;
|
|
463
|
+
code: string;
|
|
430
464
|
}) => StepSpec;
|
|
431
465
|
|
|
432
466
|
export declare const authLogout: () => StepSpec;
|
|
@@ -531,10 +565,10 @@ export declare interface AuthoringProps {
|
|
|
531
565
|
/** `{ content: 'posts.title' }`, or the full form for state, transformers and conditions. */
|
|
532
566
|
bind?: BindingsSpec;
|
|
533
567
|
/**
|
|
534
|
-
* Show this element only while the value at this source is true. `!source` shows it while the value is false,
|
|
535
|
-
* `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.
|
|
536
570
|
*/
|
|
537
|
-
visible?: string | false;
|
|
571
|
+
visible?: string | false | VisibleCondition;
|
|
538
572
|
/** One flow per entry; steps are chained in the order written. */
|
|
539
573
|
flows?: StepSpec[][];
|
|
540
574
|
/** `server` resolves this element's data on the server rather than in the browser. */
|
|
@@ -547,7 +581,7 @@ export declare interface AuthoringProps {
|
|
|
547
581
|
}
|
|
548
582
|
|
|
549
583
|
/**
|
|
550
|
-
* `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.
|
|
551
585
|
*
|
|
552
586
|
* Deliberately shadows the one re-exported above — an explicit export wins over a star — so that everybody who
|
|
553
587
|
* imports from this package gets both checks that need to know what this SDK ships.
|
|
@@ -585,6 +619,41 @@ export declare interface AuthorSpaceOptions {
|
|
|
585
619
|
* nothing reads is written without a word.
|
|
586
620
|
*/
|
|
587
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
|
+
}>>;
|
|
588
657
|
}
|
|
589
658
|
|
|
590
659
|
/**
|
|
@@ -636,6 +705,27 @@ declare type BindingTransformer = {
|
|
|
636
705
|
enabled?: boolean;
|
|
637
706
|
};
|
|
638
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
|
+
|
|
639
729
|
/** The two documents, authored fresh — so one caller writing its own name in cannot mark the next one's copy. */
|
|
640
730
|
export declare const blankSpace: () => AuthoredSpace;
|
|
641
731
|
|
|
@@ -657,18 +747,14 @@ export declare interface BlankSpaceSourceOptions {
|
|
|
657
747
|
/** The name the copy carries. `permanentUrl` follows it, slugged. */
|
|
658
748
|
name?: string;
|
|
659
749
|
/**
|
|
660
|
-
* 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.
|
|
661
751
|
*
|
|
662
752
|
* Off by default, and it has to be: the platform authors a new space from this same declaration and hosts none
|
|
663
753
|
* of anybody's plugins, so a `custom` element in it would render "Custom Component … Not Found" on every space
|
|
664
754
|
* anyone ever signed up for. It is on for `plitzi create`, where the project being scaffolded carries the
|
|
665
755
|
* component and registers it — which is the one fact about Plitzi a page of built-in elements cannot show.
|
|
666
756
|
*/
|
|
667
|
-
plugin?:
|
|
668
|
-
renderType: string;
|
|
669
|
-
id: string;
|
|
670
|
-
settings: Record<string, unknown>;
|
|
671
|
-
};
|
|
757
|
+
plugin?: PluginHostOptions | readonly PluginHostOptions[];
|
|
672
758
|
}
|
|
673
759
|
|
|
674
760
|
export declare const blankSpaceSpec: SpaceSpec;
|
|
@@ -776,7 +862,7 @@ export declare interface BuiltinParam {
|
|
|
776
862
|
elementType?: string;
|
|
777
863
|
}
|
|
778
864
|
|
|
779
|
-
export declare type BuiltinParamType = 'text' | 'textarea' | 'select' | 'boolean' | 'number' | 'scalar' | 'elementIds';
|
|
865
|
+
export declare type BuiltinParamType = 'text' | 'textarea' | 'select' | 'boolean' | 'number' | 'scalar' | 'json' | 'elementIds';
|
|
780
866
|
|
|
781
867
|
export declare interface BuiltinTransformer {
|
|
782
868
|
title: string;
|
|
@@ -788,6 +874,7 @@ export declare interface BuiltinTransformer {
|
|
|
788
874
|
export declare type BuiltinUtility = BuiltinActionSpec;
|
|
789
875
|
|
|
790
876
|
export declare const button: ElementFactory<Partial<{
|
|
877
|
+
label?: string | undefined;
|
|
791
878
|
title?: string | undefined;
|
|
792
879
|
content?: string | undefined;
|
|
793
880
|
disabled?: boolean | undefined;
|
|
@@ -797,10 +884,60 @@ export declare const button: ElementFactory<Partial<{
|
|
|
797
884
|
ariaPressed?: boolean | undefined;
|
|
798
885
|
}>>;
|
|
799
886
|
|
|
887
|
+
declare type CallbackName<D extends DeclaresInteractions> = keyof NonNullable<D['callbacks']> & string;
|
|
888
|
+
|
|
800
889
|
export declare const cancelServerAction: (params: {
|
|
801
890
|
runId: string;
|
|
802
891
|
}) => StepSpec;
|
|
803
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
|
+
|
|
804
941
|
/**
|
|
805
942
|
* The classes a selector wears: one, or several.
|
|
806
943
|
*
|
|
@@ -860,10 +997,14 @@ export declare const compareSpaces: (expected: SpaceDocuments, actual: SpaceDocu
|
|
|
860
997
|
|
|
861
998
|
export declare const container: {
|
|
862
999
|
(props?: ElementProps<Partial<{
|
|
863
|
-
|
|
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;
|
|
864
1003
|
}>> | undefined): ElementSpec;
|
|
865
1004
|
(children: ElementSpec[], props?: ElementProps<Partial<{
|
|
866
|
-
|
|
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;
|
|
867
1008
|
}>> | undefined): ElementSpec;
|
|
868
1009
|
};
|
|
869
1010
|
|
|
@@ -871,16 +1012,6 @@ declare type ContentShorthand<A> = 'content' extends keyof A ? {
|
|
|
871
1012
|
(content: string, props?: ElementProps<A>): ElementSpec;
|
|
872
1013
|
} : unknown;
|
|
873
1014
|
|
|
874
|
-
/**
|
|
875
|
-
* The one door CSS goes through while authoring.
|
|
876
|
-
*
|
|
877
|
-
* It does two things a hand-written object cannot: it expands the shorthands the style editor has no controls for,
|
|
878
|
-
* and it refuses a property that is not in the vocabulary. Both failures are silent otherwise — a shorthand renders
|
|
879
|
-
* and then cannot be edited, a typo renders as nothing at all — and both are cheapest to hear about on the line
|
|
880
|
-
* that wrote them.
|
|
881
|
-
*
|
|
882
|
-
* Idempotent: rules that are already longhand pass through unchanged, so a fragment may be run through it twice.
|
|
883
|
-
*/
|
|
884
1015
|
export declare const css: (rules: CssProps) => StyleRules;
|
|
885
1016
|
|
|
886
1017
|
/** The patch flavour of {@link CssProps}: `null` clears every longhand the key controls. */
|
|
@@ -937,6 +1068,33 @@ declare type DeclarationByType = {
|
|
|
937
1068
|
[Name in keyof typeof elementDeclarations as (typeof elementDeclarations)[Name]['type']]: (typeof elementDeclarations)[Name];
|
|
938
1069
|
};
|
|
939
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
|
+
|
|
940
1098
|
/**
|
|
941
1099
|
* The attributes an element of this type starts with — what a factory merges under the author's own.
|
|
942
1100
|
*
|
|
@@ -948,21 +1106,6 @@ export declare const defaultAttributes: (type: string) => Record<string, unknown
|
|
|
948
1106
|
/** The name a factory gives an element of this type in the builder's tree, unless the author gave it another. */
|
|
949
1107
|
export declare const defaultLabel: (type: string) => string;
|
|
950
1108
|
|
|
951
|
-
/**
|
|
952
|
-
* Build an action document from a declaration.
|
|
953
|
-
*
|
|
954
|
-
* ```ts
|
|
955
|
-
* defineAction({
|
|
956
|
-
* id: 'update-post',
|
|
957
|
-
* name: 'Update a post',
|
|
958
|
-
* trigger: { type: 'call', access: { mode: 'role', permissions: ['postPublish'] }, input: {
|
|
959
|
-
* slug: { type: 'text', required: true, label: 'Slug' },
|
|
960
|
-
* title: { type: 'text', label: 'Title' }
|
|
961
|
-
* } },
|
|
962
|
-
* steps: [{ id: 'updated', task: 'blog.updatePost' }]
|
|
963
|
-
* });
|
|
964
|
-
* ```
|
|
965
|
-
*/
|
|
966
1109
|
export declare const defineAction: (spec: ActionSpec) => ActionEntry;
|
|
967
1110
|
|
|
968
1111
|
/**
|
|
@@ -1007,6 +1150,9 @@ export declare const digest: (value: string, length: number) => string;
|
|
|
1007
1150
|
|
|
1008
1151
|
declare type DisplayMode = 'desktop' | 'tablet' | 'mobile';
|
|
1009
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
|
+
|
|
1010
1156
|
export declare const dropdown: {
|
|
1011
1157
|
(props?: ElementProps<Partial<{
|
|
1012
1158
|
disabled?: boolean | undefined;
|
|
@@ -1082,17 +1228,18 @@ export declare const elementAttributeNames: {
|
|
|
1082
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"];
|
|
1083
1229
|
readonly blockHtml: readonly ["content"];
|
|
1084
1230
|
readonly blockJsx: readonly ["allowEmptyRender", "content", "contentCache", "props"];
|
|
1085
|
-
readonly button: readonly ["ariaExpanded", "ariaPressed", "content", "contentPlacement", "disabled", "subType", "title"];
|
|
1086
|
-
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"];
|
|
1087
1234
|
readonly custom: null;
|
|
1088
1235
|
readonly dialogContainer: readonly ["acceptButtonLabel", "acceptButtonLabelLoading", "autoHideAfterClick", "headerLabel", "rejectButtonLabel"];
|
|
1089
1236
|
readonly dropdown: readonly ["backgroundDisabled", "closeOnClickBackground", "closeOnClickPopup", "containerLeftOffset", "containerTopOffset", "disabled", "openPopup", "popupPlacement"];
|
|
1090
1237
|
readonly dropdownPopup: readonly [];
|
|
1091
|
-
readonly fontAwesome: readonly ["icon", "iconAnimation", "size"];
|
|
1238
|
+
readonly fontAwesome: readonly ["icon", "iconAnimation", "label", "size"];
|
|
1092
1239
|
readonly form: readonly ["actionUrl", "errors", "managedByInteractions", "method", "noValidate", "values"];
|
|
1093
|
-
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"];
|
|
1094
1241
|
readonly heading: readonly ["content", "subType"];
|
|
1095
|
-
readonly image: readonly ["alt", "fetchPriority", "loadMode", "src"];
|
|
1242
|
+
readonly image: readonly ["alt", "decorative", "fetchPriority", "loadMode", "src"];
|
|
1096
1243
|
readonly layoutContainer: readonly ["layout", "layoutContainer", "subType"];
|
|
1097
1244
|
readonly link: readonly ["href", "label", "mode", "target"];
|
|
1098
1245
|
readonly list: readonly ["items", "source", "subType"];
|
|
@@ -1103,7 +1250,7 @@ export declare const elementAttributeNames: {
|
|
|
1103
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"];
|
|
1104
1251
|
readonly notFound: readonly [];
|
|
1105
1252
|
readonly page: readonly ["layout", "layoutContainer", "seoEnabled", "seoPageDescription", "seoPageTitle"];
|
|
1106
|
-
readonly pagination: readonly ["loadMoreLabel", "mode", "nextLabel", "pageInfo", "pageParam", "previousLabel", "target", "windowSize"];
|
|
1253
|
+
readonly pagination: readonly ["label", "loadMoreLabel", "mode", "nextLabel", "pageInfo", "pageParam", "previousLabel", "target", "windowSize"];
|
|
1107
1254
|
readonly paragraph: readonly ["content"];
|
|
1108
1255
|
readonly reference: readonly ["referenceContainer", "referenceId", "referenceType"];
|
|
1109
1256
|
readonly richText: readonly ["content", "format", "mediaBaseUrl"];
|
|
@@ -1133,6 +1280,9 @@ export declare interface ElementAttributesBrand<A> {
|
|
|
1133
1280
|
readonly __attributes: A;
|
|
1134
1281
|
}
|
|
1135
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
|
+
|
|
1136
1286
|
declare type ElementBinding = {
|
|
1137
1287
|
id: string;
|
|
1138
1288
|
source: string;
|
|
@@ -1191,6 +1341,15 @@ export declare interface ElementDeclarationData {
|
|
|
1191
1341
|
* else it throws on its first render. A dropdown's panel, a tab container's header and body.
|
|
1192
1342
|
*/
|
|
1193
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[]>;
|
|
1194
1353
|
content?: {
|
|
1195
1354
|
attributes?: Record<string, unknown>;
|
|
1196
1355
|
definition?: {
|
|
@@ -1204,6 +1363,12 @@ export declare type ElementDeclarationName = keyof typeof elementDeclarations;
|
|
|
1204
1363
|
declare const elementDeclarations: {
|
|
1205
1364
|
readonly ApiContainer: {
|
|
1206
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
|
+
};
|
|
1207
1372
|
readonly sourceType: "apiContainer";
|
|
1208
1373
|
readonly triggers: {
|
|
1209
1374
|
readonly onApiError: {
|
|
@@ -1237,7 +1402,14 @@ declare const elementDeclarations: {
|
|
|
1237
1402
|
readonly title: "Perform Query";
|
|
1238
1403
|
readonly type: "callback";
|
|
1239
1404
|
readonly preview: {};
|
|
1240
|
-
readonly params: {
|
|
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
|
+
};
|
|
1241
1413
|
};
|
|
1242
1414
|
readonly loadMore: {
|
|
1243
1415
|
readonly action: "loadMore";
|
|
@@ -1447,6 +1619,10 @@ declare const elementDeclarations: {
|
|
|
1447
1619
|
} & ElementAttributesBrand<BlockJsxAttributes>;
|
|
1448
1620
|
readonly Button: {
|
|
1449
1621
|
readonly type: "button";
|
|
1622
|
+
readonly attributeValues: {
|
|
1623
|
+
readonly subType: readonly string[];
|
|
1624
|
+
readonly contentPlacement: readonly string[];
|
|
1625
|
+
};
|
|
1450
1626
|
readonly content: {
|
|
1451
1627
|
readonly attributes: {
|
|
1452
1628
|
readonly contentPlacement: "after";
|
|
@@ -1506,7 +1682,7 @@ declare const elementDeclarations: {
|
|
|
1506
1682
|
readonly 'padding-bottom': "6px";
|
|
1507
1683
|
readonly cursor: "pointer";
|
|
1508
1684
|
readonly 'font-size': "16px";
|
|
1509
|
-
readonly 'line-height': "
|
|
1685
|
+
readonly 'line-height': "1.5";
|
|
1510
1686
|
readonly 'border-top-left-radius': "4px";
|
|
1511
1687
|
readonly 'border-top-right-radius': "4px";
|
|
1512
1688
|
readonly 'border-bottom-left-radius': "4px";
|
|
@@ -1527,7 +1703,7 @@ declare const elementDeclarations: {
|
|
|
1527
1703
|
readonly 'padding-bottom': "6px";
|
|
1528
1704
|
readonly cursor: "pointer";
|
|
1529
1705
|
readonly 'font-size': "16px";
|
|
1530
|
-
readonly 'line-height': "
|
|
1706
|
+
readonly 'line-height': "1.5";
|
|
1531
1707
|
readonly 'border-top-left-radius': "4px";
|
|
1532
1708
|
readonly 'border-top-right-radius': "4px";
|
|
1533
1709
|
readonly 'border-bottom-left-radius': "4px";
|
|
@@ -1548,7 +1724,7 @@ declare const elementDeclarations: {
|
|
|
1548
1724
|
readonly 'padding-bottom': "6px";
|
|
1549
1725
|
readonly cursor: "pointer";
|
|
1550
1726
|
readonly 'font-size': "16px";
|
|
1551
|
-
readonly 'line-height': "
|
|
1727
|
+
readonly 'line-height': "1.5";
|
|
1552
1728
|
readonly 'border-top-left-radius': "4px";
|
|
1553
1729
|
readonly 'border-top-right-radius': "4px";
|
|
1554
1730
|
readonly 'border-bottom-left-radius': "4px";
|
|
@@ -1562,6 +1738,7 @@ declare const elementDeclarations: {
|
|
|
1562
1738
|
readonly settings: {};
|
|
1563
1739
|
};
|
|
1564
1740
|
} & ElementAttributesBrand<Partial<{
|
|
1741
|
+
label?: string | undefined;
|
|
1565
1742
|
title?: string | undefined;
|
|
1566
1743
|
content?: string | undefined;
|
|
1567
1744
|
disabled?: boolean | undefined;
|
|
@@ -1570,8 +1747,144 @@ declare const elementDeclarations: {
|
|
|
1570
1747
|
ariaExpanded?: boolean | undefined;
|
|
1571
1748
|
ariaPressed?: boolean | undefined;
|
|
1572
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
|
+
}>>;
|
|
1573
1883
|
readonly Container: {
|
|
1574
1884
|
readonly type: "container";
|
|
1885
|
+
readonly attributeValues: {
|
|
1886
|
+
readonly subType: readonly string[];
|
|
1887
|
+
};
|
|
1575
1888
|
readonly content: {
|
|
1576
1889
|
readonly attributes: {
|
|
1577
1890
|
readonly subType: "div";
|
|
@@ -1620,7 +1933,9 @@ declare const elementDeclarations: {
|
|
|
1620
1933
|
readonly settings: {};
|
|
1621
1934
|
};
|
|
1622
1935
|
} & ElementAttributesBrand<Partial<{
|
|
1623
|
-
|
|
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;
|
|
1624
1939
|
}>>;
|
|
1625
1940
|
readonly Custom: {
|
|
1626
1941
|
readonly type: "custom";
|
|
@@ -1907,6 +2222,9 @@ declare const elementDeclarations: {
|
|
|
1907
2222
|
}>>;
|
|
1908
2223
|
readonly Dropdown: {
|
|
1909
2224
|
readonly type: "dropdown";
|
|
2225
|
+
readonly attributeValues: {
|
|
2226
|
+
readonly popupPlacement: readonly string[];
|
|
2227
|
+
};
|
|
1910
2228
|
readonly content: {
|
|
1911
2229
|
readonly attributes: {
|
|
1912
2230
|
readonly popupPlacement: "bottom";
|
|
@@ -2103,11 +2421,15 @@ declare const elementDeclarations: {
|
|
|
2103
2421
|
};
|
|
2104
2422
|
} & ElementAttributesBrand<Partial<{
|
|
2105
2423
|
size?: string | undefined;
|
|
2424
|
+
label?: string | undefined;
|
|
2106
2425
|
icon?: string | undefined;
|
|
2107
2426
|
iconAnimation?: string | undefined;
|
|
2108
2427
|
}>>;
|
|
2109
2428
|
readonly Form: {
|
|
2110
2429
|
readonly type: "form";
|
|
2430
|
+
readonly attributeValues: {
|
|
2431
|
+
readonly method: readonly string[];
|
|
2432
|
+
};
|
|
2111
2433
|
readonly sourceType: "apiContainer";
|
|
2112
2434
|
readonly triggers: {
|
|
2113
2435
|
readonly onSubmit: {
|
|
@@ -2226,6 +2548,9 @@ declare const elementDeclarations: {
|
|
|
2226
2548
|
}>>;
|
|
2227
2549
|
readonly FormControl: {
|
|
2228
2550
|
readonly type: "formControl";
|
|
2551
|
+
readonly attributeValues: {
|
|
2552
|
+
readonly subType: readonly string[];
|
|
2553
|
+
};
|
|
2229
2554
|
readonly triggers: {
|
|
2230
2555
|
readonly onChange: {
|
|
2231
2556
|
readonly action: "onChange";
|
|
@@ -2243,9 +2568,11 @@ declare const elementDeclarations: {
|
|
|
2243
2568
|
readonly subType: "text";
|
|
2244
2569
|
readonly name: "";
|
|
2245
2570
|
readonly label: "Label";
|
|
2571
|
+
readonly hideLabel: false;
|
|
2246
2572
|
readonly placeholder: "";
|
|
2247
2573
|
readonly defaultValue: "";
|
|
2248
2574
|
readonly autoComplete: true;
|
|
2575
|
+
readonly autoFocus: false;
|
|
2249
2576
|
readonly disabled: false;
|
|
2250
2577
|
readonly options: readonly [];
|
|
2251
2578
|
readonly required: true;
|
|
@@ -2732,6 +3059,9 @@ declare const elementDeclarations: {
|
|
|
2732
3059
|
} & ElementAttributesBrand<FormControlAttributes>;
|
|
2733
3060
|
readonly Heading: {
|
|
2734
3061
|
readonly type: "heading";
|
|
3062
|
+
readonly attributeValues: {
|
|
3063
|
+
readonly subType: readonly string[];
|
|
3064
|
+
};
|
|
2735
3065
|
readonly content: {
|
|
2736
3066
|
readonly attributes: {
|
|
2737
3067
|
readonly content: "Heading";
|
|
@@ -2786,7 +3116,7 @@ declare const elementDeclarations: {
|
|
|
2786
3116
|
readonly 'margin-bottom': "25px";
|
|
2787
3117
|
readonly 'font-size': "38px";
|
|
2788
3118
|
readonly 'font-weight': 700;
|
|
2789
|
-
readonly 'line-height': "
|
|
3119
|
+
readonly 'line-height': "1.158";
|
|
2790
3120
|
};
|
|
2791
3121
|
};
|
|
2792
3122
|
};
|
|
@@ -2801,7 +3131,7 @@ declare const elementDeclarations: {
|
|
|
2801
3131
|
readonly 'margin-bottom': "25px";
|
|
2802
3132
|
readonly 'font-size': "32px";
|
|
2803
3133
|
readonly 'font-weight': 700;
|
|
2804
|
-
readonly 'line-height': "
|
|
3134
|
+
readonly 'line-height': "1.125";
|
|
2805
3135
|
};
|
|
2806
3136
|
};
|
|
2807
3137
|
};
|
|
@@ -2816,7 +3146,7 @@ declare const elementDeclarations: {
|
|
|
2816
3146
|
readonly 'margin-bottom': "25px";
|
|
2817
3147
|
readonly 'font-size': "24px";
|
|
2818
3148
|
readonly 'font-weight': 700;
|
|
2819
|
-
readonly 'line-height': "
|
|
3149
|
+
readonly 'line-height': "1.25";
|
|
2820
3150
|
};
|
|
2821
3151
|
};
|
|
2822
3152
|
};
|
|
@@ -2831,7 +3161,7 @@ declare const elementDeclarations: {
|
|
|
2831
3161
|
readonly 'margin-bottom': "25px";
|
|
2832
3162
|
readonly 'font-size': "18px";
|
|
2833
3163
|
readonly 'font-weight': 700;
|
|
2834
|
-
readonly 'line-height': "
|
|
3164
|
+
readonly 'line-height': "1.333";
|
|
2835
3165
|
};
|
|
2836
3166
|
};
|
|
2837
3167
|
};
|
|
@@ -2846,7 +3176,7 @@ declare const elementDeclarations: {
|
|
|
2846
3176
|
readonly 'margin-bottom': "25px";
|
|
2847
3177
|
readonly 'font-size': "14px";
|
|
2848
3178
|
readonly 'font-weight': 700;
|
|
2849
|
-
readonly 'line-height': "
|
|
3179
|
+
readonly 'line-height': "1.429";
|
|
2850
3180
|
};
|
|
2851
3181
|
};
|
|
2852
3182
|
};
|
|
@@ -2861,7 +3191,7 @@ declare const elementDeclarations: {
|
|
|
2861
3191
|
readonly 'margin-bottom': "25px";
|
|
2862
3192
|
readonly 'font-size': "12px";
|
|
2863
3193
|
readonly 'font-weight': 700;
|
|
2864
|
-
readonly 'line-height': "
|
|
3194
|
+
readonly 'line-height': "1.5";
|
|
2865
3195
|
};
|
|
2866
3196
|
};
|
|
2867
3197
|
};
|
|
@@ -2876,10 +3206,15 @@ declare const elementDeclarations: {
|
|
|
2876
3206
|
}>>;
|
|
2877
3207
|
readonly Image: {
|
|
2878
3208
|
readonly type: "image";
|
|
3209
|
+
readonly attributeValues: {
|
|
3210
|
+
readonly fetchPriority: readonly string[];
|
|
3211
|
+
readonly loadMode: readonly string[];
|
|
3212
|
+
};
|
|
2879
3213
|
readonly content: {
|
|
2880
3214
|
readonly attributes: {
|
|
2881
3215
|
readonly src: "https://cdn.plitzi.com/resources/img/placeholder-img.svg";
|
|
2882
3216
|
readonly alt: "";
|
|
3217
|
+
readonly decorative: false;
|
|
2883
3218
|
readonly fetchPriority: "auto";
|
|
2884
3219
|
readonly loadMode: "auto";
|
|
2885
3220
|
};
|
|
@@ -2932,10 +3267,14 @@ declare const elementDeclarations: {
|
|
|
2932
3267
|
fetchPriority?: "high" | "low" | "auto" | undefined;
|
|
2933
3268
|
src?: string | undefined;
|
|
2934
3269
|
alt?: string | undefined;
|
|
2935
|
-
|
|
3270
|
+
decorative?: boolean | undefined;
|
|
3271
|
+
loadMode?: "auto" | "eager" | "lazy" | undefined;
|
|
2936
3272
|
}>>;
|
|
2937
3273
|
readonly LayoutContainer: {
|
|
2938
3274
|
readonly type: "layoutContainer";
|
|
3275
|
+
readonly attributeValues: {
|
|
3276
|
+
readonly subType: readonly string[];
|
|
3277
|
+
};
|
|
2939
3278
|
readonly content: {
|
|
2940
3279
|
readonly attributes: {
|
|
2941
3280
|
readonly subType: "div";
|
|
@@ -2990,6 +3329,10 @@ declare const elementDeclarations: {
|
|
|
2990
3329
|
}>>;
|
|
2991
3330
|
readonly Link: {
|
|
2992
3331
|
readonly type: "link";
|
|
3332
|
+
readonly attributeValues: {
|
|
3333
|
+
readonly mode: readonly string[];
|
|
3334
|
+
readonly target: readonly string[];
|
|
3335
|
+
};
|
|
2993
3336
|
readonly content: {
|
|
2994
3337
|
readonly attributes: {
|
|
2995
3338
|
readonly href: "#";
|
|
@@ -3045,12 +3388,16 @@ declare const elementDeclarations: {
|
|
|
3045
3388
|
};
|
|
3046
3389
|
} & ElementAttributesBrand<Partial<{
|
|
3047
3390
|
mode?: "page" | "internal" | "external" | undefined;
|
|
3391
|
+
href?: string | undefined;
|
|
3048
3392
|
label?: string | undefined;
|
|
3049
3393
|
target?: "self" | "blank" | "parent" | "top" | undefined;
|
|
3050
|
-
href?: string | undefined;
|
|
3051
3394
|
}>>;
|
|
3052
3395
|
readonly List: {
|
|
3053
3396
|
readonly type: "list";
|
|
3397
|
+
readonly attributeValues: {
|
|
3398
|
+
readonly subType: readonly string[];
|
|
3399
|
+
readonly source: readonly string[];
|
|
3400
|
+
};
|
|
3054
3401
|
readonly sourceType: "list";
|
|
3055
3402
|
readonly content: {
|
|
3056
3403
|
readonly attributes: {
|
|
@@ -3270,7 +3617,7 @@ declare const elementDeclarations: {
|
|
|
3270
3617
|
readonly base: {
|
|
3271
3618
|
readonly default: {
|
|
3272
3619
|
readonly 'font-size': "14px";
|
|
3273
|
-
readonly 'line-height': "
|
|
3620
|
+
readonly 'line-height': "1.714";
|
|
3274
3621
|
};
|
|
3275
3622
|
};
|
|
3276
3623
|
};
|
|
@@ -3536,6 +3883,7 @@ declare const elementDeclarations: {
|
|
|
3536
3883
|
defaultValue?: string | number | readonly string[] | undefined;
|
|
3537
3884
|
onLoad?: ReactEventHandler<"span"> | undefined;
|
|
3538
3885
|
onClick?: MouseEventHandler<"span"> | undefined;
|
|
3886
|
+
onPointerDown?: PointerEventHandler<"span"> | undefined;
|
|
3539
3887
|
onMouseEnter?: MouseEventHandler<"span"> | undefined;
|
|
3540
3888
|
onMouseLeave?: MouseEventHandler<"span"> | undefined;
|
|
3541
3889
|
onFocus?: FocusEventHandler<"span"> | undefined;
|
|
@@ -3724,7 +4072,6 @@ declare const elementDeclarations: {
|
|
|
3724
4072
|
onTouchMoveCapture?: TouchEventHandler<"span"> | undefined;
|
|
3725
4073
|
onTouchStart?: TouchEventHandler<"span"> | undefined;
|
|
3726
4074
|
onTouchStartCapture?: TouchEventHandler<"span"> | undefined;
|
|
3727
|
-
onPointerDown?: PointerEventHandler<"span"> | undefined;
|
|
3728
4075
|
onPointerDownCapture?: PointerEventHandler<"span"> | undefined;
|
|
3729
4076
|
onPointerMove?: PointerEventHandler<"span"> | undefined;
|
|
3730
4077
|
onPointerMoveCapture?: PointerEventHandler<"span"> | undefined;
|
|
@@ -3944,6 +4291,10 @@ declare const elementDeclarations: {
|
|
|
3944
4291
|
}>>;
|
|
3945
4292
|
readonly Pagination: {
|
|
3946
4293
|
readonly type: "pagination";
|
|
4294
|
+
readonly attributeValues: {
|
|
4295
|
+
readonly mode: readonly string[];
|
|
4296
|
+
readonly target: readonly string[];
|
|
4297
|
+
};
|
|
3947
4298
|
readonly triggers: {
|
|
3948
4299
|
readonly onPageChange: {
|
|
3949
4300
|
readonly action: "onPageChange";
|
|
@@ -4016,6 +4367,7 @@ declare const elementDeclarations: {
|
|
|
4016
4367
|
};
|
|
4017
4368
|
} & ElementAttributesBrand<Partial<{
|
|
4018
4369
|
mode?: "pages" | "loadMore" | undefined;
|
|
4370
|
+
label?: string | undefined;
|
|
4019
4371
|
target?: "url" | "interaction" | undefined;
|
|
4020
4372
|
pageParam?: string | undefined;
|
|
4021
4373
|
pageInfo?: PaginationPageInfo | undefined;
|
|
@@ -4134,6 +4486,9 @@ declare const elementDeclarations: {
|
|
|
4134
4486
|
}>>;
|
|
4135
4487
|
readonly RichText: {
|
|
4136
4488
|
readonly type: "richText";
|
|
4489
|
+
readonly attributeValues: {
|
|
4490
|
+
readonly format: readonly string[];
|
|
4491
|
+
};
|
|
4137
4492
|
readonly content: {
|
|
4138
4493
|
readonly attributes: {
|
|
4139
4494
|
readonly content: "";
|
|
@@ -4428,7 +4783,7 @@ declare const elementDeclarations: {
|
|
|
4428
4783
|
readonly base: {
|
|
4429
4784
|
readonly default: {
|
|
4430
4785
|
readonly 'font-size': "14px";
|
|
4431
|
-
readonly 'line-height': "
|
|
4786
|
+
readonly 'line-height': "1.714";
|
|
4432
4787
|
readonly display: "inline";
|
|
4433
4788
|
};
|
|
4434
4789
|
};
|
|
@@ -4441,6 +4796,9 @@ declare const elementDeclarations: {
|
|
|
4441
4796
|
}>>;
|
|
4442
4797
|
readonly ThemeToggle: {
|
|
4443
4798
|
readonly type: "themeToggle";
|
|
4799
|
+
readonly attributeValues: {
|
|
4800
|
+
readonly subType: readonly string[];
|
|
4801
|
+
};
|
|
4444
4802
|
readonly triggers: {
|
|
4445
4803
|
readonly onThemeChange: {
|
|
4446
4804
|
readonly action: "onThemeChange";
|
|
@@ -4580,6 +4938,9 @@ declare const elementDeclarations: {
|
|
|
4580
4938
|
}>>;
|
|
4581
4939
|
};
|
|
4582
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
|
+
|
|
4583
4944
|
declare type ElementDefinition = {
|
|
4584
4945
|
rootId: Element_2['id'];
|
|
4585
4946
|
label: string;
|
|
@@ -4654,6 +5015,20 @@ export declare interface ElementHandle {
|
|
|
4654
5015
|
* Present only when true: almost nothing on a page is conditional, and the handles are serialized.
|
|
4655
5016
|
*/
|
|
4656
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;
|
|
4657
5032
|
}
|
|
4658
5033
|
|
|
4659
5034
|
declare type ElementInteraction<T extends Record<string, unknown> = Record<string, unknown>> = {
|
|
@@ -4669,10 +5044,21 @@ declare type ElementInteraction<T extends Record<string, unknown> = Record<strin
|
|
|
4669
5044
|
flowId: string;
|
|
4670
5045
|
enabled: boolean;
|
|
4671
5046
|
when?: RuleGroup;
|
|
5047
|
+
/** On a trigger only: what a firing does while this flow is still running. `skip` when absent. */
|
|
5048
|
+
whileRunning?: WhileRunning;
|
|
4672
5049
|
};
|
|
4673
5050
|
|
|
4674
5051
|
declare type ElementLayoutType = 'layout' | 'segment' | 'element' | 'reference';
|
|
4675
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
|
+
|
|
4676
5062
|
/**
|
|
4677
5063
|
* When an element's CONTENTS are mounted, relative to its own `visibility`.
|
|
4678
5064
|
*
|
|
@@ -4692,9 +5078,30 @@ declare type ElementLayoutType = 'layout' | 'segment' | 'element' | 'reference';
|
|
|
4692
5078
|
*/
|
|
4693
5079
|
declare type ElementLoadStrategy = 'eager' | 'lazy' | 'visible';
|
|
4694
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
|
+
|
|
4695
5084
|
/** Attributes and authoring fields, flat. Attributes win a name they share with anything here. */
|
|
4696
5085
|
export declare type ElementProps<A> = A & AuthoringProps;
|
|
4697
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
|
+
|
|
4698
5105
|
declare type ElementRuntime = 'server' | 'client' | 'shared';
|
|
4699
5106
|
|
|
4700
5107
|
/**
|
|
@@ -4827,8 +5234,12 @@ export declare interface ElementSpec {
|
|
|
4827
5234
|
*
|
|
4828
5235
|
* `false` starts it hidden with no condition at all: a panel that a flow reveals (`toggleState`, `setState`)
|
|
4829
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.
|
|
4830
5241
|
*/
|
|
4831
|
-
visible?: string | false;
|
|
5242
|
+
visible?: string | false | VisibleCondition;
|
|
4832
5243
|
/** One flow per entry. Steps are chained in order. */
|
|
4833
5244
|
flows?: StepSpec[][];
|
|
4834
5245
|
runtime?: ElementRuntime;
|
|
@@ -4892,14 +5303,31 @@ export declare const expandShorthand: (css: CssProps) => CssProps;
|
|
|
4892
5303
|
* `{ padding: null }` clears all four sides rather than a `padding` key that was never stored. */
|
|
4893
5304
|
export declare const expandShorthandPatch: (css: CssPatch) => CssPatch;
|
|
4894
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
|
+
|
|
4895
5321
|
export declare const fontAwesome: {
|
|
4896
5322
|
(props?: ElementProps<Partial<{
|
|
4897
5323
|
size?: string | undefined;
|
|
5324
|
+
label?: string | undefined;
|
|
4898
5325
|
icon?: string | undefined;
|
|
4899
5326
|
iconAnimation?: string | undefined;
|
|
4900
5327
|
}>> | undefined): ElementSpec;
|
|
4901
5328
|
(children: ElementSpec[], props?: ElementProps<Partial<{
|
|
4902
5329
|
size?: string | undefined;
|
|
5330
|
+
label?: string | undefined;
|
|
4903
5331
|
icon?: string | undefined;
|
|
4904
5332
|
iconAnimation?: string | undefined;
|
|
4905
5333
|
}>> | undefined): ElementSpec;
|
|
@@ -4966,11 +5394,24 @@ declare type FormControlAttributes = AuthorableAttributes<FormControlProps, 'val
|
|
|
4966
5394
|
declare type FormControlProps = {
|
|
4967
5395
|
ref: RefObject<HTMLElement>;
|
|
4968
5396
|
className: string;
|
|
4969
|
-
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';
|
|
4970
5400
|
name: string;
|
|
4971
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;
|
|
4972
5408
|
placeholder: string;
|
|
4973
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;
|
|
4974
5415
|
disabled: boolean;
|
|
4975
5416
|
options: {
|
|
4976
5417
|
label: string;
|
|
@@ -5000,11 +5441,10 @@ declare type FormControlProps = {
|
|
|
5000
5441
|
value: string;
|
|
5001
5442
|
error: string;
|
|
5002
5443
|
/**
|
|
5003
|
-
* Supplied by `withFieldValue
|
|
5444
|
+
* Supplied by `withFieldValue`, with or without a form around the control.
|
|
5004
5445
|
*
|
|
5005
|
-
*
|
|
5006
|
-
*
|
|
5007
|
-
* 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.
|
|
5008
5448
|
*/
|
|
5009
5449
|
handleChange?: (e: ChangeEvent<HTMLInputElement> | ChangeEvent<HTMLSelectElement> | ChangeEvent<HTMLTextAreaElement>) => void;
|
|
5010
5450
|
handleValidate?: () => void;
|
|
@@ -5035,6 +5475,8 @@ export declare const getUtility: (action: string) => BuiltinUtility | undefined;
|
|
|
5035
5475
|
* validator that refused the name would make that impossible to write.
|
|
5036
5476
|
*
|
|
5037
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.
|
|
5038
5480
|
*/
|
|
5039
5481
|
export declare const GLOBAL_SOURCES: string[];
|
|
5040
5482
|
|
|
@@ -5099,16 +5541,66 @@ export declare const image: {
|
|
|
5099
5541
|
fetchPriority?: "high" | "low" | "auto" | undefined;
|
|
5100
5542
|
src?: string | undefined;
|
|
5101
5543
|
alt?: string | undefined;
|
|
5102
|
-
|
|
5544
|
+
decorative?: boolean | undefined;
|
|
5545
|
+
loadMode?: "auto" | "eager" | "lazy" | undefined;
|
|
5103
5546
|
}>> | undefined): ElementSpec;
|
|
5104
5547
|
(children: ElementSpec[], props?: ElementProps<Partial<{
|
|
5105
5548
|
fetchPriority?: "high" | "low" | "auto" | undefined;
|
|
5106
5549
|
src?: string | undefined;
|
|
5107
5550
|
alt?: string | undefined;
|
|
5108
|
-
|
|
5551
|
+
decorative?: boolean | undefined;
|
|
5552
|
+
loadMode?: "auto" | "eager" | "lazy" | undefined;
|
|
5109
5553
|
}>> | undefined): ElementSpec;
|
|
5110
5554
|
};
|
|
5111
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
|
+
|
|
5112
5604
|
declare const interactionBasicTriggers: Record<string, InteractionCallback>;
|
|
5113
5605
|
|
|
5114
5606
|
declare type InteractionCallback<T extends Record<string, unknown> = Record<string, unknown>> = {
|
|
@@ -5255,10 +5747,27 @@ export declare const isRuleSetSpec: (spec: StyleSpec) => spec is RuleSetSpec;
|
|
|
5255
5747
|
*/
|
|
5256
5748
|
export declare const isStyleDeclaration: (value: StyleSpec | StyleDeclaration) => value is StyleDeclaration;
|
|
5257
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
|
+
|
|
5258
5765
|
/** A layout shell: what pages render inside, so its elements are on screen wherever a page names it. */
|
|
5259
5766
|
export declare interface LayoutHandle extends ElementHandle {
|
|
5260
5767
|
/** Everything in the shell, by id — the header and the navigation a test reaches for on any page. */
|
|
5261
5768
|
elements: Record<string, ElementHandle>;
|
|
5769
|
+
/** The layout this shell itself renders inside, for a shell within a shell. */
|
|
5770
|
+
layout?: string;
|
|
5262
5771
|
}
|
|
5263
5772
|
|
|
5264
5773
|
/**
|
|
@@ -5305,18 +5814,36 @@ export declare interface LayoutSpec {
|
|
|
5305
5814
|
export declare const link: {
|
|
5306
5815
|
(props?: ElementProps<Partial<{
|
|
5307
5816
|
mode?: "page" | "internal" | "external" | undefined;
|
|
5817
|
+
href?: string | undefined;
|
|
5308
5818
|
label?: string | undefined;
|
|
5309
5819
|
target?: "self" | "blank" | "parent" | "top" | undefined;
|
|
5310
|
-
href?: string | undefined;
|
|
5311
5820
|
}>> | undefined): ElementSpec;
|
|
5312
5821
|
(children: ElementSpec[], props?: ElementProps<Partial<{
|
|
5313
5822
|
mode?: "page" | "internal" | "external" | undefined;
|
|
5823
|
+
href?: string | undefined;
|
|
5314
5824
|
label?: string | undefined;
|
|
5315
5825
|
target?: "self" | "blank" | "parent" | "top" | undefined;
|
|
5316
|
-
href?: string | undefined;
|
|
5317
5826
|
}>> | undefined): ElementSpec;
|
|
5318
5827
|
};
|
|
5319
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
|
+
|
|
5320
5847
|
export declare const list: {
|
|
5321
5848
|
(props?: ElementProps<Partial<{
|
|
5322
5849
|
source?: "none" | "controlled" | undefined;
|
|
@@ -5419,6 +5946,7 @@ export declare const nodeHtml: ElementFactory<Partial<{
|
|
|
5419
5946
|
defaultValue?: string | number | readonly string[] | undefined;
|
|
5420
5947
|
onLoad?: ReactEventHandler<"span"> | undefined;
|
|
5421
5948
|
onClick?: MouseEventHandler<"span"> | undefined;
|
|
5949
|
+
onPointerDown?: PointerEventHandler<"span"> | undefined;
|
|
5422
5950
|
onMouseEnter?: MouseEventHandler<"span"> | undefined;
|
|
5423
5951
|
onMouseLeave?: MouseEventHandler<"span"> | undefined;
|
|
5424
5952
|
onFocus?: FocusEventHandler<"span"> | undefined;
|
|
@@ -5607,7 +6135,6 @@ export declare const nodeHtml: ElementFactory<Partial<{
|
|
|
5607
6135
|
onTouchMoveCapture?: TouchEventHandler<"span"> | undefined;
|
|
5608
6136
|
onTouchStart?: TouchEventHandler<"span"> | undefined;
|
|
5609
6137
|
onTouchStartCapture?: TouchEventHandler<"span"> | undefined;
|
|
5610
|
-
onPointerDown?: PointerEventHandler<"span"> | undefined;
|
|
5611
6138
|
onPointerDownCapture?: PointerEventHandler<"span"> | undefined;
|
|
5612
6139
|
onPointerMove?: PointerEventHandler<"span"> | undefined;
|
|
5613
6140
|
onPointerMoveCapture?: PointerEventHandler<"span"> | undefined;
|
|
@@ -5692,6 +6219,34 @@ export declare const nodeHtml: ElementFactory<Partial<{
|
|
|
5692
6219
|
subType?: "span" | undefined;
|
|
5693
6220
|
}>>;
|
|
5694
6221
|
|
|
6222
|
+
/**
|
|
6223
|
+
* The rule that styles the toast container, or `''` when there is nothing to say.
|
|
6224
|
+
*
|
|
6225
|
+
* Refuses what would not style anything: an unknown field, and a value that is not one CSS value — a `;` or a brace
|
|
6226
|
+
* would end the declaration early and let the rest of the text become rules of its own.
|
|
6227
|
+
*/
|
|
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
|
+
|
|
5695
6250
|
export declare const on: (trigger: ElementTriggerName | (string & {}), params?: Record<string, unknown>) => StepSpec;
|
|
5696
6251
|
|
|
5697
6252
|
export declare const onClick: (params?: {
|
|
@@ -5708,6 +6263,16 @@ export declare const onFlowError: () => StepSpec;
|
|
|
5708
6263
|
|
|
5709
6264
|
export declare const onFlowProgress: () => StepSpec;
|
|
5710
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
|
+
|
|
5711
6276
|
export declare const onLoad: () => StepSpec;
|
|
5712
6277
|
|
|
5713
6278
|
/**
|
|
@@ -5719,6 +6284,35 @@ export declare const onLoad: () => StepSpec;
|
|
|
5719
6284
|
*/
|
|
5720
6285
|
export declare const onPageLoad: () => StepSpec;
|
|
5721
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
|
+
|
|
5722
6316
|
/**
|
|
5723
6317
|
* A form submitting itself, with the values keyed by each control's `name`.
|
|
5724
6318
|
*
|
|
@@ -5742,6 +6336,15 @@ export declare const openModal: (target: string, metadata?: string) => StepSpec;
|
|
|
5742
6336
|
|
|
5743
6337
|
declare type Operator = '' | '=' | '!=' | '<' | '>' | '<=' | '>=' | 'contains' | 'doesNotContain' | 'beginsWith' | 'doesNotBeginWith' | 'endsWith' | 'doesNotEndWith' | 'empty' | 'notEmpty' | 'in' | 'notIn' | 'between' | 'notBetween';
|
|
5744
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
|
+
|
|
5745
6348
|
declare type PageFolder = {
|
|
5746
6349
|
id: string;
|
|
5747
6350
|
name: string;
|
|
@@ -5776,10 +6379,26 @@ export declare interface PageHandle extends ElementHandle {
|
|
|
5776
6379
|
accessLevel?: 'public' | 'authenticated';
|
|
5777
6380
|
/** The route params its slug declares (`post/{{slug}}` → `['slug']`). A path with any is not a URL until they are filled. */
|
|
5778
6381
|
params: string[];
|
|
6382
|
+
/** The layout this page renders inside, by id — whose elements are on screen here too. */
|
|
6383
|
+
layout?: string;
|
|
5779
6384
|
/** Everything on this page, by id. */
|
|
5780
6385
|
elements: Record<string, ElementHandle>;
|
|
5781
6386
|
}
|
|
5782
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
|
+
|
|
5783
6402
|
export declare interface PageSpec {
|
|
5784
6403
|
name: string;
|
|
5785
6404
|
/** As {@link ElementSpec.id} — a page is an element, and its flows are targeted the same way. */
|
|
@@ -5799,7 +6418,8 @@ export declare interface PageSpec {
|
|
|
5799
6418
|
*/
|
|
5800
6419
|
accessLevel?: 'public' | 'authenticated';
|
|
5801
6420
|
/**
|
|
5802
|
-
* 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.
|
|
5803
6423
|
*
|
|
5804
6424
|
* Without it they are answered 403, which is correct and rarely what a site wants: somebody who followed a link
|
|
5805
6425
|
* to a members page should land on the sign-in, not on a refusal. One field rather than the router's two,
|
|
@@ -5815,9 +6435,6 @@ export declare interface PageSpec {
|
|
|
5815
6435
|
folder?: string;
|
|
5816
6436
|
/** The shared layout this page renders inside. See {@link LayoutRef}. */
|
|
5817
6437
|
layout?: LayoutRef;
|
|
5818
|
-
/** Keep the page's element state across visits, in the storage named by {@link PageSpec.stateStorage}. */
|
|
5819
|
-
keepState?: boolean;
|
|
5820
|
-
stateStorage?: Schema['settings']['stateStorage'];
|
|
5821
6438
|
css?: CssSpec;
|
|
5822
6439
|
/** As {@link ElementSpec.selector}. */
|
|
5823
6440
|
selector?: string;
|
|
@@ -5830,6 +6447,7 @@ export declare interface PageSpec {
|
|
|
5830
6447
|
export declare const pagination: {
|
|
5831
6448
|
(props?: ElementProps<Partial<{
|
|
5832
6449
|
mode?: "pages" | "loadMore" | undefined;
|
|
6450
|
+
label?: string | undefined;
|
|
5833
6451
|
target?: "url" | "interaction" | undefined;
|
|
5834
6452
|
pageParam?: string | undefined;
|
|
5835
6453
|
pageInfo?: PaginationPageInfo | undefined;
|
|
@@ -5840,6 +6458,7 @@ export declare const pagination: {
|
|
|
5840
6458
|
}>> | undefined): ElementSpec;
|
|
5841
6459
|
(children: ElementSpec[], props?: ElementProps<Partial<{
|
|
5842
6460
|
mode?: "pages" | "loadMore" | undefined;
|
|
6461
|
+
label?: string | undefined;
|
|
5843
6462
|
target?: "url" | "interaction" | undefined;
|
|
5844
6463
|
pageParam?: string | undefined;
|
|
5845
6464
|
pageInfo?: PaginationPageInfo | undefined;
|
|
@@ -5877,6 +6496,99 @@ declare type PluginBuilder = {
|
|
|
5877
6496
|
itemsNotAllowed?: string[];
|
|
5878
6497
|
};
|
|
5879
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
|
+
|
|
5880
6592
|
declare type PluginManifest = {
|
|
5881
6593
|
assets: Record<string, ManifestAsset>;
|
|
5882
6594
|
assetsSettings: Record<string, ManifestAsset>;
|
|
@@ -5926,8 +6638,57 @@ declare type PluginSchema = {
|
|
|
5926
6638
|
};
|
|
5927
6639
|
};
|
|
5928
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
|
+
|
|
5929
6682
|
declare type ProviderPagination = 'none' | 'url' | 'append';
|
|
5930
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
|
+
|
|
5931
6692
|
/** Reconcile supplied params to a catalog schema: drop unknown keys when the set is CLOSED (strict), then fill the
|
|
5932
6693
|
* builder's defaults for any declared param the agent omitted whose `when` guard holds. Mirrors what the builder
|
|
5933
6694
|
* stores, so the persisted node round-trips cleanly. */
|
|
@@ -5954,9 +6715,11 @@ export declare const reference: {
|
|
|
5954
6715
|
* somebody reloads it. Pair it with the call that did the writing rather than with a notification: what tells the
|
|
5955
6716
|
* person it worked is the row leaving.
|
|
5956
6717
|
*
|
|
5957
|
-
* 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.
|
|
5958
6721
|
*/
|
|
5959
|
-
export declare const reloadApi: (target: string) => StepSpec;
|
|
6722
|
+
export declare const reloadApi: (target: string, input?: Record<string, string>) => StepSpec;
|
|
5960
6723
|
|
|
5961
6724
|
/** Someone else's origin — Adobe Fonts, Bunny, Fontshare, the customer's own CDN. Either a
|
|
5962
6725
|
* stylesheet that declares the faces, or the files themselves. */
|
|
@@ -5985,6 +6748,31 @@ export declare const removeState: (params: {
|
|
|
5985
6748
|
index: string | number;
|
|
5986
6749
|
}) => StepSpec;
|
|
5987
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
|
+
|
|
5988
6776
|
/**
|
|
5989
6777
|
* Empties a form — every value and every error — by id.
|
|
5990
6778
|
*
|
|
@@ -6015,8 +6803,12 @@ export declare type ResponsiveBlock = Partial<Record<DisplayMode, StyleBlock>>;
|
|
|
6015
6803
|
* Per-breakpoint CSS as an author writes it. Omitted breakpoints inherit `desktop`, as they do in the builder — and
|
|
6016
6804
|
* only `desktop`: `tablet` (48–64rem) and `mobile` (below 48rem) are disjoint ranges, so a `tablet` rule never
|
|
6017
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.
|
|
6018
6810
|
*/
|
|
6019
|
-
export declare type ResponsiveCss = Partial<Record<DisplayMode, CssProps>>;
|
|
6811
|
+
export declare type ResponsiveCss = Partial<Record<DisplayMode | 'compact', CssProps>>;
|
|
6020
6812
|
|
|
6021
6813
|
/** Per-breakpoint CSS as it reaches the document. */
|
|
6022
6814
|
export declare type ResponsiveStyle = Partial<Record<DisplayMode, StyleRules>>;
|
|
@@ -6114,7 +6906,30 @@ declare type Schema = {
|
|
|
6114
6906
|
settings: {
|
|
6115
6907
|
keepState?: boolean;
|
|
6116
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[];
|
|
6117
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[]>;
|
|
6118
6933
|
/** `basic` covers any HTTP+JSON backend by configuration; anything else is a name someone registered. */
|
|
6119
6934
|
userProvider?: 'basic' | 'custom' | '' | (string & {});
|
|
6120
6935
|
tokenStorage?: 'localStorage' | 'sessionStorage' | '';
|
|
@@ -6142,6 +6957,13 @@ declare type Schema = {
|
|
|
6142
6957
|
* session itself, which is the case whenever `loginUrl` is your own API.
|
|
6143
6958
|
*/
|
|
6144
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;
|
|
6145
6967
|
/**
|
|
6146
6968
|
* What to do on a page that requires a session while the stored one is being re-checked. `optimistic` (the
|
|
6147
6969
|
* default) renders from the stored session and signs out if the check disagrees; `strict` waits for the answer,
|
|
@@ -6158,6 +6980,18 @@ declare type Schema = {
|
|
|
6158
6980
|
* `false` there cannot be turned around from here. Never `devMode`, which makes a deployment a development server.
|
|
6159
6981
|
*/
|
|
6160
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;
|
|
6161
6995
|
};
|
|
6162
6996
|
rsc?: SchemaRsc;
|
|
6163
6997
|
pages: Element_2['id'][];
|
|
@@ -6169,7 +7003,7 @@ declare type Schema = {
|
|
|
6169
7003
|
*
|
|
6170
7004
|
* A key outside it is one nothing reads any more — `head`, from before a space declared its fonts.
|
|
6171
7005
|
*/
|
|
6172
|
-
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"];
|
|
6173
7007
|
|
|
6174
7008
|
declare type SchemaRsc = {
|
|
6175
7009
|
enabled?: boolean;
|
|
@@ -6217,16 +7051,53 @@ declare type SchemaVariableBase<TType extends string, TValue> = {
|
|
|
6217
7051
|
|
|
6218
7052
|
export declare const selectorFor: (id: string) => string;
|
|
6219
7053
|
|
|
6220
|
-
/**
|
|
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
|
+
*/
|
|
6221
7075
|
export declare const setState: (params: {
|
|
6222
7076
|
key: string;
|
|
6223
|
-
type:
|
|
7077
|
+
type: (typeof SET_STATE_TYPES)[number];
|
|
6224
7078
|
value: unknown;
|
|
6225
7079
|
}) => StepSpec;
|
|
6226
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
|
+
|
|
6227
7084
|
/** The longhand keys a shorthand controls — what a `null` patch value has to clear. */
|
|
6228
7085
|
export declare const shorthandLonghands: (key: string) => string[] | undefined;
|
|
6229
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
|
+
|
|
6230
7101
|
/**
|
|
6231
7102
|
* A string as a slug: lowercase, `[a-z0-9-]`, no leading or trailing dash.
|
|
6232
7103
|
*
|
|
@@ -6249,7 +7120,7 @@ export declare type SourceIndex = Map<string, string>;
|
|
|
6249
7120
|
export declare type SourceTypes = Record<string, string>;
|
|
6250
7121
|
|
|
6251
7122
|
/** The same guarantee for the space itself, in the order its fields are written. */
|
|
6252
|
-
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"];
|
|
6253
7124
|
|
|
6254
7125
|
/**
|
|
6255
7126
|
* The `space` source, which the SDK application registers rather than this package.
|
|
@@ -6334,6 +7205,41 @@ export declare interface SpaceSpec {
|
|
|
6334
7205
|
elements?: Record<string, ElementStyleSpec>;
|
|
6335
7206
|
schemaVariables?: SchemaVariable[];
|
|
6336
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;
|
|
6337
7243
|
/**
|
|
6338
7244
|
* Everything else the schema's settings carry — where sign-in posts to, which cookie hints at a session, how
|
|
6339
7245
|
* state is kept. `customCss` above is the one field of that same object every space sets, and it stays named on
|
|
@@ -6363,6 +7269,9 @@ export declare interface SpaceSpec {
|
|
|
6363
7269
|
pages: PageSpec[];
|
|
6364
7270
|
}
|
|
6365
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
|
+
|
|
6366
7275
|
export declare interface SpecCorrection {
|
|
6367
7276
|
code: SpecCorrectionCode;
|
|
6368
7277
|
message: string;
|
|
@@ -6383,7 +7292,7 @@ export declare interface SpecCorrection {
|
|
|
6383
7292
|
* Rather than refusing them, what can be repaired is repaired and every repair is reported in `corrections`, so a
|
|
6384
7293
|
* person can read what changed. Nothing is changed silently, and nothing that renders is dropped.
|
|
6385
7294
|
*/
|
|
6386
|
-
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' | 'dead-flow' | 'dead-step' | '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';
|
|
6387
7296
|
|
|
6388
7297
|
export declare interface SpecFromSpace {
|
|
6389
7298
|
spec: SpaceSpec;
|
|
@@ -6484,6 +7393,8 @@ export declare interface StepSpec {
|
|
|
6484
7393
|
on?: string;
|
|
6485
7394
|
when?: ElementInteraction['when'];
|
|
6486
7395
|
enabled?: boolean;
|
|
7396
|
+
/** On a trigger: what firing it again does while its flow still runs. See {@link whileRunning}. */
|
|
7397
|
+
whileRunning?: ElementInteraction['whileRunning'];
|
|
6487
7398
|
}
|
|
6488
7399
|
|
|
6489
7400
|
/**
|
|
@@ -6499,12 +7410,17 @@ export declare interface StepSpec {
|
|
|
6499
7410
|
* makes the fragment usable on documents whose vocabulary nobody here knows.
|
|
6500
7411
|
*/
|
|
6501
7412
|
export declare interface StepVocabulary {
|
|
6502
|
-
/** 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. */
|
|
6503
7414
|
globalCallbacks: Record<string, {
|
|
6504
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;
|
|
6505
7423
|
}>;
|
|
6506
|
-
/** Utility actions. A utility is resolved by action alone and runs on no module at all. */
|
|
6507
|
-
utilities: Record<string, unknown>;
|
|
6508
7424
|
/**
|
|
6509
7425
|
* Element type → every trigger it fires, the ones all elements share included. A type that is not listed is a
|
|
6510
7426
|
* plugin's, whose triggers nobody here can know, and its flows are left alone.
|
|
@@ -6512,6 +7428,15 @@ export declare interface StepVocabulary {
|
|
|
6512
7428
|
triggers?: Record<string, readonly string[]>;
|
|
6513
7429
|
/** Element type → every element callback it answers to, the shared `setState`/`toggleState` included. */
|
|
6514
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;
|
|
7439
|
+
}>;
|
|
6515
7440
|
}
|
|
6516
7441
|
|
|
6517
7442
|
declare type Style = {
|
|
@@ -6540,8 +7465,12 @@ export declare const STYLE_STATES: readonly StyleState[];
|
|
|
6540
7465
|
*
|
|
6541
7466
|
* `focus-visible` is the focus ring a keyboard user needs and a mouse user does not; `focus-within` dresses a
|
|
6542
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.
|
|
6543
7472
|
*/
|
|
6544
|
-
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"];
|
|
6545
7474
|
|
|
6546
7475
|
declare type StyleAncestor = {
|
|
6547
7476
|
default?: StyleObject;
|
|
@@ -6631,6 +7560,7 @@ declare const styleConstants: {
|
|
|
6631
7560
|
readonly TRANSITION_DURATION: "transition-duration";
|
|
6632
7561
|
readonly TRANSITION_TIMING_FUNCTION: "transition-timing-function";
|
|
6633
7562
|
readonly TRANSITION_DELAY: "transition-delay";
|
|
7563
|
+
readonly TRANSITION_BEHAVIOR: "transition-behavior";
|
|
6634
7564
|
readonly ANIMATION: "animation";
|
|
6635
7565
|
readonly ANIMATION_NAME: "animation-name";
|
|
6636
7566
|
readonly ANIMATION_DURATION: "animation-duration";
|
|
@@ -6821,6 +7751,9 @@ export declare const suggestCssProperty: (key: string) => string | undefined;
|
|
|
6821
7751
|
* "template" teaches "twigTemplate". Undefined when nothing is close. */
|
|
6822
7752
|
export declare const suggestTransformer: (action: string) => string | undefined;
|
|
6823
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
|
+
|
|
6824
7757
|
/** Installed nowhere: a stack the visitor's system already has. Costs no bytes. */
|
|
6825
7758
|
declare type SystemFont = FontBase & {
|
|
6826
7759
|
source: 'system';
|
|
@@ -6867,6 +7800,9 @@ export declare type Template = {
|
|
|
6867
7800
|
style: Style;
|
|
6868
7801
|
};
|
|
6869
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
|
+
|
|
6870
7806
|
/**
|
|
6871
7807
|
* What a template author declares: a name, a description and a subtree.
|
|
6872
7808
|
*
|
|
@@ -6956,7 +7892,7 @@ export declare const toggleElement: (params: {
|
|
|
6956
7892
|
* A checkbox, as one step: in the list at `runtime.state.<key>` if it was not, out of it if it was.
|
|
6957
7893
|
*
|
|
6958
7894
|
* The list is a SET, which is what makes pressing the box twice safe — an append guarded by a check reads the list
|
|
6959
|
-
*
|
|
7895
|
+
* before the other press's write lands, so two presses in the same tick both add.
|
|
6960
7896
|
*/
|
|
6961
7897
|
export declare const toggleInState: (params: {
|
|
6962
7898
|
key: string;
|
|
@@ -6966,9 +7902,10 @@ export declare const toggleInState: (params: {
|
|
|
6966
7902
|
/**
|
|
6967
7903
|
* Flips `runtime.state.<key>` — expand and collapse, open and close, from ONE step on ONE trigger.
|
|
6968
7904
|
*
|
|
6969
|
-
* The alternative
|
|
6970
|
-
*
|
|
6971
|
-
*
|
|
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.
|
|
6972
7909
|
*/
|
|
6973
7910
|
export declare const toggleState: (params: {
|
|
6974
7911
|
key: string;
|
|
@@ -7004,6 +7941,35 @@ export declare const toPortableSource: (source: string) => string;
|
|
|
7004
7941
|
*/
|
|
7005
7942
|
export declare const toResponsive: (spec: CssSpec | undefined) => ResponsiveStyle;
|
|
7006
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
|
+
|
|
7007
7973
|
/** The transformer catalog projected for the data-sources resource / primer, so the agent knows the exact action
|
|
7008
7974
|
* names and params up front (the real fix for the "agent can't write transformers" problem). */
|
|
7009
7975
|
export declare const transformerCatalog: () => TransformerInfo[];
|
|
@@ -7030,6 +7996,8 @@ declare interface TriggerCommon {
|
|
|
7030
7996
|
enabled?: boolean;
|
|
7031
7997
|
}
|
|
7032
7998
|
|
|
7999
|
+
declare type TriggerName<D extends DeclaresInteractions> = keyof NonNullable<D['triggers']> & string;
|
|
8000
|
+
|
|
7033
8001
|
export declare const twigTemplate: (params: {
|
|
7034
8002
|
template: string;
|
|
7035
8003
|
}) => StepSpec;
|
|
@@ -7057,15 +8025,23 @@ export declare const updateElement: (params: {
|
|
|
7057
8025
|
}, target?: string) => StepSpec;
|
|
7058
8026
|
|
|
7059
8027
|
/**
|
|
7060
|
-
* `validateSpace`, holding this SDK's own
|
|
7061
|
-
*
|
|
7062
|
-
* Which is where it matters most: a JSON edited by hand, or an export whose bindings were retyped. Without the
|
|
7063
|
-
* catalog a source can only be half-checked, and the half it cannot see is the one nobody gets right.
|
|
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.
|
|
7064
8030
|
*/
|
|
7065
|
-
export declare const validateSpace: (space: SpaceDocuments, options?:
|
|
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;
|
|
7066
8035
|
|
|
7067
|
-
/**
|
|
7068
|
-
|
|
8036
|
+
/**
|
|
8037
|
+
* Every value of a string-literal union, as a list — and a compile error when the list leaves one out.
|
|
8038
|
+
*
|
|
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`.
|
|
8041
|
+
*/
|
|
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[];
|
|
7069
8045
|
|
|
7070
8046
|
/**
|
|
7071
8047
|
* Switches one of a CLASS's variants from a value the data answered — a status pill that turns amber, green or red
|
|
@@ -7115,6 +8091,19 @@ export declare const video: {
|
|
|
7115
8091
|
}>> | undefined): ElementSpec;
|
|
7116
8092
|
};
|
|
7117
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
|
+
|
|
7118
8107
|
/**
|
|
7119
8108
|
* Shows or hides an element from a value the data answered.
|
|
7120
8109
|
*
|
|
@@ -7122,7 +8111,7 @@ export declare const video: {
|
|
|
7122
8111
|
* and getting it wrong writes a `visibility` attribute no element reads, so the element stays visible and nothing
|
|
7123
8112
|
* reports anything.
|
|
7124
8113
|
*/
|
|
7125
|
-
export declare const visibleWhen: (source: string) => BindingSpec;
|
|
8114
|
+
export declare const visibleWhen: (source: string, template?: string) => BindingSpec;
|
|
7126
8115
|
|
|
7127
8116
|
/**
|
|
7128
8117
|
* Calls a URL and puts the answer in the flow scope as `{{ <id>.response.status }}` and `{{ <id>.response.data }}`.
|
|
@@ -7140,6 +8129,11 @@ export declare const webHook: (params: {
|
|
|
7140
8129
|
method?: "get" | "post" | "put" | "delete" | "patch" | "head";
|
|
7141
8130
|
body?: string | Record<string, unknown>;
|
|
7142
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>;
|
|
7143
8137
|
credentials?: "include" | "omit" | "same-origin";
|
|
7144
8138
|
/** A read only: serve it from the page's query cache for `staleTime` seconds, shared with api containers. */
|
|
7145
8139
|
cache?: boolean;
|
|
@@ -7198,7 +8192,9 @@ export declare const when: (rules: Rule | Rule[], step: StepSpec, combinator?: "
|
|
|
7198
8192
|
* Runs a step only if the named server action did NOT complete.
|
|
7199
8193
|
*
|
|
7200
8194
|
* Every outcome that is not `completed`, which is deliberate: a run can come back `failed`, `skipped` or
|
|
7201
|
-
* `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}}`.
|
|
7202
8198
|
* Matching only `failed` is how the other two end up silently doing nothing.
|
|
7203
8199
|
*/
|
|
7204
8200
|
export declare const whenFailed: (stepId: string, step: StepSpec) => StepSpec;
|
|
@@ -7211,9 +8207,70 @@ export declare const whenFailed: (stepId: string, step: StepSpec) => StepSpec;
|
|
|
7211
8207
|
*/
|
|
7212
8208
|
export declare const whenSucceeded: (stepId: string, step: StepSpec) => StepSpec;
|
|
7213
8209
|
|
|
8210
|
+
/**
|
|
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
|
+
* ```
|
|
8238
|
+
*
|
|
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.
|
|
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
|
+
|
|
7214
8271
|
export declare const withVisibility: (spec: {
|
|
7215
8272
|
bind?: BindingsSpec;
|
|
7216
|
-
visible?: string | false;
|
|
8273
|
+
visible?: string | false | VisibleCondition;
|
|
7217
8274
|
}) => BindingSpec[] | undefined;
|
|
7218
8275
|
|
|
7219
8276
|
export { }
|