@plitzi/sdk-authoring 0.36.1 → 0.37.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +61 -0
- package/dist/index.d.ts +444 -60
- package/dist/index.js +3553 -610
- package/package.json +8 -7
- package/skills/plitzi-authoring/SKILL.md +27 -3
package/dist/index.d.ts
CHANGED
|
@@ -214,6 +214,13 @@ export declare const addNotification: (params: {
|
|
|
214
214
|
autoDismissTimeout?: number;
|
|
215
215
|
}) => StepSpec;
|
|
216
216
|
|
|
217
|
+
/** What one ancestor condition changes: inside it always, in its states, or in its variants (and their states). */
|
|
218
|
+
export declare interface AncestorSpec {
|
|
219
|
+
css?: CssSpec;
|
|
220
|
+
states?: StatesSpec;
|
|
221
|
+
variants?: Record<string, CssSpec | VariantSpec>;
|
|
222
|
+
}
|
|
223
|
+
|
|
217
224
|
/**
|
|
218
225
|
* A factory per element, named after it.
|
|
219
226
|
*
|
|
@@ -474,22 +481,32 @@ export declare interface AuthoringProps {
|
|
|
474
481
|
* when left out, positionally, so name the ones something else refers to.
|
|
475
482
|
*/
|
|
476
483
|
id?: string;
|
|
477
|
-
/**
|
|
478
|
-
|
|
484
|
+
/**
|
|
485
|
+
* A shared class — a name from the space's `classes`, or a `styles()` declaration — or a list of them. Exclusive
|
|
486
|
+
* with {@link AuthoringProps.css}.
|
|
487
|
+
*/
|
|
488
|
+
class?: ClassList;
|
|
479
489
|
/** Rules of this element's own: one set, or one per breakpoint. Shorthands are expanded when the space is written. */
|
|
480
490
|
css?: CssSpec;
|
|
491
|
+
/** How the element's own rules react — `hover`, `focus` — beside {@link AuthoringProps.css}. */
|
|
492
|
+
states?: StatesSpec;
|
|
481
493
|
/** Style variant of the element's own vocabulary, e.g. a heading's `title`. */
|
|
482
494
|
variant?: string;
|
|
483
495
|
/** A class for one of the element's other selectors — a form control's `input`, `label`, `error`. */
|
|
484
|
-
slots?: Record<string,
|
|
496
|
+
slots?: Record<string, ClassList>;
|
|
485
497
|
/** `{ content: 'posts.title' }`, or the full form for state, transformers and conditions. */
|
|
486
498
|
bind?: BindingsSpec;
|
|
487
|
-
/**
|
|
488
|
-
|
|
499
|
+
/**
|
|
500
|
+
* Show this element only while the value at this source is true. `!source` shows it while the value is false, and
|
|
501
|
+
* `false` starts it hidden for a flow to reveal.
|
|
502
|
+
*/
|
|
503
|
+
visible?: string | false;
|
|
489
504
|
/** One flow per entry; steps are chained in the order written. */
|
|
490
505
|
flows?: StepSpec[][];
|
|
491
506
|
/** `server` resolves this element's data on the server rather than in the browser. */
|
|
492
507
|
runtime?: ElementRuntime;
|
|
508
|
+
/** When the element's contents mount relative to its visibility. Left out, the element type decides. */
|
|
509
|
+
loadStrategy?: ElementLoadStrategy;
|
|
493
510
|
children?: ElementSpec[];
|
|
494
511
|
/** What the builder shows, not what the runtime reads. */
|
|
495
512
|
meta?: SpecMeta;
|
|
@@ -563,7 +580,11 @@ export declare type BindingsSpec = Record<string, string> | BindingSpec[];
|
|
|
563
580
|
|
|
564
581
|
declare type BindingTransformer = {
|
|
565
582
|
action: string;
|
|
566
|
-
|
|
583
|
+
/**
|
|
584
|
+
* Mostly text, and not only: a param the builder draws as a checkbox (`styleVariant`'s `append`) is stored as the
|
|
585
|
+
* boolean it is, and the transformer reads it as one — `if (!append)`. Writing `"false"` there would read as true.
|
|
586
|
+
*/
|
|
587
|
+
params: Record<string, string | number | boolean>;
|
|
567
588
|
enabled?: boolean;
|
|
568
589
|
};
|
|
569
590
|
|
|
@@ -719,6 +740,7 @@ export declare interface BuiltinTransformer {
|
|
|
719
740
|
export declare type BuiltinUtility = BuiltinActionSpec;
|
|
720
741
|
|
|
721
742
|
export declare const button: ElementFactory<Partial<{
|
|
743
|
+
title?: string | undefined;
|
|
722
744
|
content?: string | undefined;
|
|
723
745
|
disabled?: boolean | undefined;
|
|
724
746
|
subType?: "button" | "submit" | "reset" | undefined;
|
|
@@ -731,8 +753,25 @@ export declare const cancelServerAction: (params: {
|
|
|
731
753
|
runId: string;
|
|
732
754
|
}) => StepSpec;
|
|
733
755
|
|
|
756
|
+
/**
|
|
757
|
+
* The classes a selector wears: one, or several.
|
|
758
|
+
*
|
|
759
|
+
* Several is what the builder writes when an element carries a shared base and a modifier — `panel-card quota-panel`
|
|
760
|
+
* — and the SDK applies all of them, in the order the stylesheet declares them rather than the order listed here.
|
|
761
|
+
*/
|
|
762
|
+
export declare type ClassList = ClassRef | readonly ClassRef[];
|
|
763
|
+
|
|
734
764
|
/** The class name a value names, however it was written. */
|
|
735
|
-
export declare const className: (value:
|
|
765
|
+
export declare const className: (value: ClassRef) => string;
|
|
766
|
+
|
|
767
|
+
/** Every class a list names, as the names a selector joins with a space. */
|
|
768
|
+
export declare const classNames: (value: ClassList) => string[];
|
|
769
|
+
|
|
770
|
+
/** A class by name, or a `styles()` declaration that brings its rules along. */
|
|
771
|
+
export declare type ClassRef = string | StyleDeclaration;
|
|
772
|
+
|
|
773
|
+
/** The classes a list holds, one or several, as they were written. */
|
|
774
|
+
export declare const classRefs: (value: ClassList) => readonly ClassRef[];
|
|
736
775
|
|
|
737
776
|
/**
|
|
738
777
|
* Empties the list at `runtime.state.<key>`, or the whole of `runtime.state` when no key is named.
|
|
@@ -762,12 +801,15 @@ export declare const column: (gap: string, extra?: CssProps) => StyleRules;
|
|
|
762
801
|
|
|
763
802
|
declare type Combinator = 'and' | 'or';
|
|
764
803
|
|
|
804
|
+
/** Every observable way `actual` differs from `expected`. Empty means they render the same space. */
|
|
805
|
+
export declare const compareSpaces: (expected: SpaceDocuments, actual: SpaceDocuments) => SpaceDifference[];
|
|
806
|
+
|
|
765
807
|
export declare const container: {
|
|
766
808
|
(props?: ElementProps<Partial<{
|
|
767
|
-
subType?: "div" | "header" | "footer" | "nav" | "main" | "section" | "article" | "aside" | "address" | "figure" | "dl" | "dt" | "dd" | undefined;
|
|
809
|
+
subType?: "div" | "header" | "footer" | "nav" | "main" | "section" | "article" | "aside" | "address" | "figure" | "dl" | "dt" | "dd" | "li" | undefined;
|
|
768
810
|
}>> | undefined): ElementSpec;
|
|
769
811
|
(children: ElementSpec[], props?: ElementProps<Partial<{
|
|
770
|
-
subType?: "div" | "header" | "footer" | "nav" | "main" | "section" | "article" | "aside" | "address" | "figure" | "dl" | "dt" | "dd" | undefined;
|
|
812
|
+
subType?: "div" | "header" | "footer" | "nav" | "main" | "section" | "article" | "aside" | "address" | "figure" | "dl" | "dt" | "dd" | "li" | undefined;
|
|
771
813
|
}>> | undefined): ElementSpec;
|
|
772
814
|
};
|
|
773
815
|
|
|
@@ -818,27 +860,40 @@ export declare const cssShorthands: string[];
|
|
|
818
860
|
*/
|
|
819
861
|
export declare type CssSpec = CssProps | ResponsiveCss;
|
|
820
862
|
|
|
821
|
-
export declare const custom:
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
863
|
+
export declare const custom: ElementFactory<CustomAttributes>;
|
|
864
|
+
|
|
865
|
+
/**
|
|
866
|
+
* What this element can be authored with — its component's own props, minus what the runtime supplies — and
|
|
867
|
+
* anything else: the component its `renderType` names reads its own attributes off this element (a chart's
|
|
868
|
+
* `series`, a map's `height`), so the element carries whatever that component declares.
|
|
869
|
+
*/
|
|
870
|
+
declare type CustomAttributes = AuthorableAttributes<CustomProps> & Record<string, unknown>;
|
|
871
|
+
|
|
872
|
+
declare type CustomProps = {
|
|
873
|
+
ref?: RefObject<HTMLElement>;
|
|
874
|
+
className?: string;
|
|
875
|
+
renderType?: string;
|
|
876
|
+
settings?: string;
|
|
877
|
+
isPlugin?: boolean;
|
|
878
|
+
assets?: string;
|
|
879
|
+
scriptUrl?: string;
|
|
836
880
|
};
|
|
837
881
|
|
|
838
882
|
declare type DeclarationByType = {
|
|
839
883
|
[Name in keyof typeof elementDeclarations as (typeof elementDeclarations)[Name]['type']]: (typeof elementDeclarations)[Name];
|
|
840
884
|
};
|
|
841
885
|
|
|
886
|
+
/**
|
|
887
|
+
* The attributes an element of this type starts with — what a factory merges under the author's own.
|
|
888
|
+
*
|
|
889
|
+
* An attribute equal to one of these says nothing a factory would not say for it, which is what lets a reader of a
|
|
890
|
+
* document leave it out, and what makes "absent" and "the default" the same answer when two documents are compared.
|
|
891
|
+
*/
|
|
892
|
+
export declare const defaultAttributes: (type: string) => Record<string, unknown>;
|
|
893
|
+
|
|
894
|
+
/** The name a factory gives an element of this type in the builder's tree, unless the author gave it another. */
|
|
895
|
+
export declare const defaultLabel: (type: string) => string;
|
|
896
|
+
|
|
842
897
|
/**
|
|
843
898
|
* Build an action document from a declaration.
|
|
844
899
|
*
|
|
@@ -951,6 +1006,59 @@ declare type Element_2<TAttributes extends Record<string, unknown> = Record<stri
|
|
|
951
1006
|
definition: ElementDefinition;
|
|
952
1007
|
};
|
|
953
1008
|
|
|
1009
|
+
/**
|
|
1010
|
+
* Every field of an element spec, in the order the emitter writes them.
|
|
1011
|
+
*
|
|
1012
|
+
* The emitter is only as current as this list: a field `ElementSpec` gains and this does not name is a field every
|
|
1013
|
+
* export drops without a word. `specFields.test.ts` refuses to compile until it is listed here — and once it is, it is
|
|
1014
|
+
* written like any other, so growing the authoring surface needs nothing more from the emitter than this line.
|
|
1015
|
+
*/
|
|
1016
|
+
export declare const ELEMENT_FIELDS: readonly ["type", "id", "attributes", "class", "css", "states", "variant", "slots", "bind", "visible", "flows", "runtime", "loadStrategy", "meta", "children"];
|
|
1017
|
+
|
|
1018
|
+
/**
|
|
1019
|
+
* The attributes each built-in element can be authored with, by type — `null` for an element that takes any.
|
|
1020
|
+
*
|
|
1021
|
+
* What a component reads, and so what a document's attributes are allowed to say: anything else is left over from
|
|
1022
|
+
* a builder that has since moved on, and nothing renders it.
|
|
1023
|
+
*/
|
|
1024
|
+
export declare const elementAttributeNames: {
|
|
1025
|
+
readonly apiContainer: readonly ["accessToken", "action", "cache", "connector", "credentials", "endpoint", "filters", "gcTime", "headers", "input", "limit", "method", "mockData", "pageParam", "pagination", "query", "renderWhileLoading", "resource", "singleRecord", "staleTime", "subType", "when"];
|
|
1026
|
+
readonly blockHtml: readonly ["content"];
|
|
1027
|
+
readonly blockJsx: readonly ["allowEmptyRender", "content", "contentCache", "props"];
|
|
1028
|
+
readonly button: readonly ["ariaExpanded", "ariaPressed", "content", "contentPlacement", "disabled", "subType", "title"];
|
|
1029
|
+
readonly container: readonly ["subType"];
|
|
1030
|
+
readonly custom: null;
|
|
1031
|
+
readonly dialogContainer: readonly ["acceptButtonLabel", "acceptButtonLabelLoading", "autoHideAfterClick", "headerLabel", "rejectButtonLabel"];
|
|
1032
|
+
readonly dropdown: readonly ["backgroundDisabled", "closeOnClickBackground", "closeOnClickPopup", "containerLeftOffset", "containerTopOffset", "disabled", "openPopup", "popupPlacement"];
|
|
1033
|
+
readonly dropdownPopup: readonly [];
|
|
1034
|
+
readonly fontAwesome: readonly ["icon", "iconAnimation", "size"];
|
|
1035
|
+
readonly form: readonly ["actionUrl", "errors", "managedByInteractions", "method", "noValidate", "values"];
|
|
1036
|
+
readonly formControl: readonly ["autoComplete", "defaultValue", "disabled", "formatMessage", "label", "matches", "matchesMessage", "maxLength", "maxLengthMessage", "minLength", "minLengthMessage", "name", "options", "pattern", "patternMessage", "placeholder", "previewError", "readOnly", "required", "requiredMessage", "subType"];
|
|
1037
|
+
readonly heading: readonly ["content", "subType"];
|
|
1038
|
+
readonly image: readonly ["alt", "fetchPriority", "loadMode", "src"];
|
|
1039
|
+
readonly layoutContainer: readonly ["layout", "layoutContainer", "subType"];
|
|
1040
|
+
readonly link: readonly ["href", "label", "mode", "target"];
|
|
1041
|
+
readonly list: readonly ["items", "source", "subType"];
|
|
1042
|
+
readonly listItem: readonly [];
|
|
1043
|
+
readonly loading: readonly [];
|
|
1044
|
+
readonly markdown: readonly ["content"];
|
|
1045
|
+
readonly modalContainer: readonly ["autoHideAfterClick", "title"];
|
|
1046
|
+
readonly nodeHtml: readonly ["about", "accessKey", "aria-activedescendant", "aria-atomic", "aria-autocomplete", "aria-braillelabel", "aria-brailleroledescription", "aria-busy", "aria-checked", "aria-colcount", "aria-colindex", "aria-colindextext", "aria-colspan", "aria-controls", "aria-current", "aria-describedby", "aria-description", "aria-details", "aria-disabled", "aria-dropeffect", "aria-errormessage", "aria-expanded", "aria-flowto", "aria-grabbed", "aria-haspopup", "aria-hidden", "aria-invalid", "aria-keyshortcuts", "aria-label", "aria-labelledby", "aria-level", "aria-live", "aria-modal", "aria-multiline", "aria-multiselectable", "aria-orientation", "aria-owns", "aria-placeholder", "aria-posinset", "aria-pressed", "aria-readonly", "aria-relevant", "aria-required", "aria-roledescription", "aria-rowcount", "aria-rowindex", "aria-rowindextext", "aria-rowspan", "aria-selected", "aria-setsize", "aria-sort", "aria-valuemax", "aria-valuemin", "aria-valuenow", "aria-valuetext", "autoCapitalize", "autoCorrect", "autoFocus", "autoSave", "color", "content", "contentEditable", "contextMenu", "dangerouslySetInnerHTML", "datatype", "defaultChecked", "defaultValue", "dir", "draggable", "enterKeyHint", "exportparts", "hidden", "inert", "inlist", "inputMode", "is", "itemID", "itemProp", "itemRef", "itemScope", "itemType", "lang", "nonce", "onAbort", "onAbortCapture", "onAnimationEnd", "onAnimationEndCapture", "onAnimationIteration", "onAnimationIterationCapture", "onAnimationStart", "onAnimationStartCapture", "onAuxClick", "onAuxClickCapture", "onBeforeInput", "onBeforeInputCapture", "onBeforeToggle", "onBlur", "onBlurCapture", "onCanPlay", "onCanPlayCapture", "onCanPlayThrough", "onCanPlayThroughCapture", "onChange", "onChangeCapture", "onClick", "onClickCapture", "onCompositionEnd", "onCompositionEndCapture", "onCompositionStart", "onCompositionStartCapture", "onCompositionUpdate", "onCompositionUpdateCapture", "onContextMenu", "onContextMenuCapture", "onCopy", "onCopyCapture", "onCut", "onCutCapture", "onDoubleClick", "onDoubleClickCapture", "onDrag", "onDragCapture", "onDragEnd", "onDragEndCapture", "onDragEnter", "onDragEnterCapture", "onDragExit", "onDragExitCapture", "onDragLeave", "onDragLeaveCapture", "onDragOver", "onDragOverCapture", "onDragStart", "onDragStartCapture", "onDrop", "onDropCapture", "onDurationChange", "onDurationChangeCapture", "onEmptied", "onEmptiedCapture", "onEncrypted", "onEncryptedCapture", "onEnded", "onEndedCapture", "onError", "onErrorCapture", "onFocus", "onFocusCapture", "onGotPointerCapture", "onGotPointerCaptureCapture", "onInput", "onInputCapture", "onInvalid", "onInvalidCapture", "onKeyDown", "onKeyDownCapture", "onKeyPress", "onKeyPressCapture", "onKeyUp", "onKeyUpCapture", "onLoad", "onLoadCapture", "onLoadedData", "onLoadedDataCapture", "onLoadedMetadata", "onLoadedMetadataCapture", "onLoadStart", "onLoadStartCapture", "onLostPointerCapture", "onLostPointerCaptureCapture", "onMouseDown", "onMouseDownCapture", "onMouseEnter", "onMouseLeave", "onMouseMove", "onMouseMoveCapture", "onMouseOut", "onMouseOutCapture", "onMouseOver", "onMouseOverCapture", "onMouseUp", "onMouseUpCapture", "onPaste", "onPasteCapture", "onPause", "onPauseCapture", "onPlay", "onPlayCapture", "onPlaying", "onPlayingCapture", "onPointerCancel", "onPointerCancelCapture", "onPointerDown", "onPointerDownCapture", "onPointerEnter", "onPointerLeave", "onPointerMove", "onPointerMoveCapture", "onPointerOut", "onPointerOutCapture", "onPointerOver", "onPointerOverCapture", "onPointerUp", "onPointerUpCapture", "onProgress", "onProgressCapture", "onRateChange", "onRateChangeCapture", "onReset", "onResetCapture", "onScroll", "onScrollCapture", "onScrollEnd", "onScrollEndCapture", "onSeeked", "onSeekedCapture", "onSeeking", "onSeekingCapture", "onSelect", "onSelectCapture", "onStalled", "onStalledCapture", "onSubmit", "onSubmitCapture", "onSuspend", "onSuspendCapture", "onTimeUpdate", "onTimeUpdateCapture", "onToggle", "onTouchCancel", "onTouchCancelCapture", "onTouchEnd", "onTouchEndCapture", "onTouchMove", "onTouchMoveCapture", "onTouchStart", "onTouchStartCapture", "onTransitionCancel", "onTransitionCancelCapture", "onTransitionEnd", "onTransitionEndCapture", "onTransitionRun", "onTransitionRunCapture", "onTransitionStart", "onTransitionStartCapture", "onVolumeChange", "onVolumeChangeCapture", "onWaiting", "onWaitingCapture", "onWheel", "onWheelCapture", "part", "popover", "popoverTarget", "popoverTargetAction", "prefix", "property", "radioGroup", "rel", "resource", "results", "rev", "role", "security", "slot", "spellCheck", "style", "subType", "suppressContentEditableWarning", "suppressHydrationWarning", "tabIndex", "title", "translate", "typeof", "unselectable", "vocab"];
|
|
1047
|
+
readonly notFound: readonly [];
|
|
1048
|
+
readonly page: readonly ["layout", "layoutContainer", "seoEnabled", "seoPageDescription", "seoPageTitle"];
|
|
1049
|
+
readonly pagination: readonly ["loadMoreLabel", "mode", "nextLabel", "pageInfo", "pageParam", "previousLabel", "target", "windowSize"];
|
|
1050
|
+
readonly paragraph: readonly ["content"];
|
|
1051
|
+
readonly reference: readonly ["referenceContainer", "referenceId", "referenceType"];
|
|
1052
|
+
readonly richText: readonly ["content", "format", "mediaBaseUrl"];
|
|
1053
|
+
readonly tabContainer: readonly [];
|
|
1054
|
+
readonly tabContainerBody: readonly [];
|
|
1055
|
+
readonly tabContainerHeader: readonly [];
|
|
1056
|
+
readonly tabContainerItem: readonly [];
|
|
1057
|
+
readonly text: readonly ["content"];
|
|
1058
|
+
readonly themeToggle: readonly ["darkLabel", "lightLabel", "showSystem", "subType", "systemLabel"];
|
|
1059
|
+
readonly video: readonly ["autoPlay", "loop", "muted", "playsInline", "src"];
|
|
1060
|
+
};
|
|
1061
|
+
|
|
954
1062
|
/**
|
|
955
1063
|
* How an element says what it can be authored with.
|
|
956
1064
|
*
|
|
@@ -1293,6 +1401,7 @@ declare const elementDeclarations: {
|
|
|
1293
1401
|
readonly settings: {};
|
|
1294
1402
|
};
|
|
1295
1403
|
} & ElementAttributesBrand<Partial<{
|
|
1404
|
+
title?: string | undefined;
|
|
1296
1405
|
content?: string | undefined;
|
|
1297
1406
|
disabled?: boolean | undefined;
|
|
1298
1407
|
subType?: "button" | "submit" | "reset" | undefined;
|
|
@@ -1350,7 +1459,7 @@ declare const elementDeclarations: {
|
|
|
1350
1459
|
readonly settings: {};
|
|
1351
1460
|
};
|
|
1352
1461
|
} & ElementAttributesBrand<Partial<{
|
|
1353
|
-
subType?: "div" | "header" | "footer" | "nav" | "main" | "section" | "article" | "aside" | "address" | "figure" | "dl" | "dt" | "dd" | undefined;
|
|
1462
|
+
subType?: "div" | "header" | "footer" | "nav" | "main" | "section" | "article" | "aside" | "address" | "figure" | "dl" | "dt" | "dd" | "li" | undefined;
|
|
1354
1463
|
}>>;
|
|
1355
1464
|
readonly Custom: {
|
|
1356
1465
|
readonly type: "custom";
|
|
@@ -1403,13 +1512,7 @@ declare const elementDeclarations: {
|
|
|
1403
1512
|
};
|
|
1404
1513
|
readonly settings: {};
|
|
1405
1514
|
};
|
|
1406
|
-
} & ElementAttributesBrand<
|
|
1407
|
-
settings?: string | undefined;
|
|
1408
|
-
assets?: string | undefined;
|
|
1409
|
-
renderType?: string | undefined;
|
|
1410
|
-
isPlugin?: boolean | undefined;
|
|
1411
|
-
scriptUrl?: string | undefined;
|
|
1412
|
-
}>>;
|
|
1515
|
+
} & ElementAttributesBrand<CustomAttributes>;
|
|
1413
1516
|
readonly DialogContainer: {
|
|
1414
1517
|
readonly type: "dialogContainer";
|
|
1415
1518
|
readonly sourceType: "dialogContainer";
|
|
@@ -2569,7 +2672,9 @@ declare const elementDeclarations: {
|
|
|
2569
2672
|
readonly settings: {};
|
|
2570
2673
|
};
|
|
2571
2674
|
} & ElementAttributesBrand<Partial<{
|
|
2675
|
+
layout?: string | undefined;
|
|
2572
2676
|
subType?: "div" | "header" | "footer" | "nav" | "main" | "section" | "article" | "aside" | "address" | "figure" | undefined;
|
|
2677
|
+
layoutContainer?: string | undefined;
|
|
2573
2678
|
}>>;
|
|
2574
2679
|
readonly Link: {
|
|
2575
2680
|
readonly type: "link";
|
|
@@ -3641,8 +3746,8 @@ declare const elementDeclarations: {
|
|
|
3641
3746
|
readonly settings: {};
|
|
3642
3747
|
};
|
|
3643
3748
|
} & ElementAttributesBrand<Partial<{
|
|
3644
|
-
referenceId: string;
|
|
3645
3749
|
referenceType: ElementLayoutType;
|
|
3750
|
+
referenceId: string;
|
|
3646
3751
|
referenceContainer: string;
|
|
3647
3752
|
}>>;
|
|
3648
3753
|
readonly RichText: {
|
|
@@ -4260,27 +4365,33 @@ export declare interface ElementSpec {
|
|
|
4260
4365
|
* so what reaches the document is what the style editor can read back.
|
|
4261
4366
|
*/
|
|
4262
4367
|
css?: CssSpec;
|
|
4368
|
+
/**
|
|
4369
|
+
* How this element's own selector reacts — `hover`, `focus`, `active` — beside {@link ElementSpec.css}. A state
|
|
4370
|
+
* is part of the element's selector, not a second one, so it is refused alongside a shared `class` for the same
|
|
4371
|
+
* reason `css` is: the rules belong in the class.
|
|
4372
|
+
*/
|
|
4373
|
+
states?: StatesSpec;
|
|
4263
4374
|
/**
|
|
4264
4375
|
* Reuse a selector authored elsewhere in the space instead of minting one. Two elements naming the same class
|
|
4265
4376
|
* share one rule, which is the difference between a stylesheet and a pile of one-off declarations.
|
|
4266
4377
|
*
|
|
4267
|
-
* Exclusive with {@link ElementSpec.css}: an element has exactly one base selector,
|
|
4268
|
-
* question with no answer and is refused rather than silently resolved.
|
|
4378
|
+
* Exclusive with {@link ElementSpec.css} and {@link ElementSpec.states}: an element has exactly one base selector,
|
|
4379
|
+
* so declaring both is a question with no answer and is refused rather than silently resolved.
|
|
4269
4380
|
*
|
|
4270
|
-
* Either a name from {@link SpaceSpec.classes}, or a
|
|
4271
|
-
*
|
|
4381
|
+
* Either a name from {@link SpaceSpec.classes}, or a `styles()` declaration that brings its own rules along — or a
|
|
4382
|
+
* list of them, for an element that wears a shared base and a modifier (`[panelCard, quotaPanel]`).
|
|
4272
4383
|
*/
|
|
4273
|
-
class?:
|
|
4384
|
+
class?: ClassList;
|
|
4274
4385
|
/**
|
|
4275
4386
|
* A class for one of the element's OTHER style selectors, by selector name — a form control's `input`, `label`
|
|
4276
4387
|
* and `error`.
|
|
4277
4388
|
*
|
|
4278
4389
|
* `css` and `class` above are its `base`, and an element made of parts cannot be dressed through that one alone:
|
|
4279
4390
|
* a rule meant for the input lands on the wrapper instead, and the input keeps the browser's own look. The value
|
|
4280
|
-
* names a class from {@link SpaceSpec.classes} — or carries one, as a
|
|
4281
|
-
* serves every control that wants it.
|
|
4391
|
+
* names a class from {@link SpaceSpec.classes} — or carries one, as a `styles()` declaration — or lists several, so
|
|
4392
|
+
* one rule serves every control that wants it.
|
|
4282
4393
|
*/
|
|
4283
|
-
slots?: Record<string,
|
|
4394
|
+
slots?: Record<string, ClassList>;
|
|
4284
4395
|
bind?: BindingsSpec;
|
|
4285
4396
|
/**
|
|
4286
4397
|
* Show this element only while the value at this source is true. `!source` shows it while the value is false.
|
|
@@ -4293,19 +4404,32 @@ export declare interface ElementSpec {
|
|
|
4293
4404
|
*
|
|
4294
4405
|
* One field with a `!` rather than a `visible`/`hidden` pair, because `hidden` is a real HTML attribute — and in
|
|
4295
4406
|
* this surface the attribute keeps a name it shares with anything else.
|
|
4407
|
+
*
|
|
4408
|
+
* `false` starts it hidden with no condition at all: a panel that a flow reveals (`toggleState`, `setState`)
|
|
4409
|
+
* rather than one the data does.
|
|
4296
4410
|
*/
|
|
4297
|
-
visible?: string;
|
|
4411
|
+
visible?: string | false;
|
|
4298
4412
|
/** One flow per entry. Steps are chained in order. */
|
|
4299
4413
|
flows?: StepSpec[][];
|
|
4300
4414
|
runtime?: ElementRuntime;
|
|
4415
|
+
/** When this element's contents mount relative to its visibility. Left out, the element type decides. */
|
|
4416
|
+
loadStrategy?: ElementLoadStrategy;
|
|
4301
4417
|
children?: ElementSpec[];
|
|
4302
4418
|
meta?: SpecMeta;
|
|
4303
4419
|
}
|
|
4304
4420
|
|
|
4305
|
-
/**
|
|
4421
|
+
/**
|
|
4422
|
+
* Per element *type* defaults — what `.plitzi__heading` resolves to before any class applies.
|
|
4423
|
+
*
|
|
4424
|
+
* `slots` dresses the type's OTHER selectors — a modal's `rootContainer`, a form control's `input` — for every
|
|
4425
|
+
* element of the type at once.
|
|
4426
|
+
*/
|
|
4306
4427
|
export declare interface ElementStyleSpec {
|
|
4307
|
-
base?:
|
|
4308
|
-
|
|
4428
|
+
base?: CssSpec;
|
|
4429
|
+
states?: StatesSpec;
|
|
4430
|
+
variants?: Record<string, CssSpec | VariantSpec>;
|
|
4431
|
+
ancestors?: Record<string, AncestorSpec>;
|
|
4432
|
+
slots?: Record<string, StyleSpec>;
|
|
4309
4433
|
}
|
|
4310
4434
|
|
|
4311
4435
|
/**
|
|
@@ -4326,8 +4450,13 @@ export declare type ElementTypeName = keyof DeclarationByType;
|
|
|
4326
4450
|
/** Every built-in type name, for anything that has to tell a known type from one a plugin has to provide. */
|
|
4327
4451
|
export declare const elementTypeNames: string[];
|
|
4328
4452
|
|
|
4329
|
-
/**
|
|
4330
|
-
*
|
|
4453
|
+
/**
|
|
4454
|
+
* Expand supported CSS shorthands to their longhand keys, in declaration order: the later declaration wins, as it
|
|
4455
|
+
* does in a stylesheet. `{ padding: 8, 'padding-left': 0 }` keeps `padding-left: 0`, and
|
|
4456
|
+
* `{ 'overflow-x': 'hidden', overflow: 'scroll' }` scrolls both ways — a document the builder saved with a shorthand
|
|
4457
|
+
* written after its longhands rendered the shorthand, and reading it back any other way changes the page.
|
|
4458
|
+
* Unrecognized keys pass through.
|
|
4459
|
+
*/
|
|
4331
4460
|
export declare const expandShorthand: (css: CssProps) => CssProps;
|
|
4332
4461
|
|
|
4333
4462
|
/** Patch flavour of {@link expandShorthand}: a `null` value removes every longhand the key controls, so
|
|
@@ -4401,6 +4530,8 @@ export declare const formControl: {
|
|
|
4401
4530
|
/** What this element can be authored with — its component's own props, minus what the runtime supplies. */
|
|
4402
4531
|
declare type FormControlAttributes = AuthorableAttributes<FormControlProps, 'value' | 'error' | 'handleChange' | 'handleValidate'> & {
|
|
4403
4532
|
defaultValue?: string;
|
|
4533
|
+
/** Read by `withFieldValue`, not by the component: shows the control in its error state while editing. */
|
|
4534
|
+
previewError?: boolean;
|
|
4404
4535
|
};
|
|
4405
4536
|
|
|
4406
4537
|
declare type FormControlProps = {
|
|
@@ -4677,6 +4808,60 @@ export declare const isCssProperty: (key: string) => boolean;
|
|
|
4677
4808
|
*/
|
|
4678
4809
|
export declare const isCustomProperty: (key: string) => boolean;
|
|
4679
4810
|
|
|
4811
|
+
/**
|
|
4812
|
+
* Whether a style is the object form rather than plain CSS.
|
|
4813
|
+
*
|
|
4814
|
+
* Told apart by the keys, like the per-breakpoint shape: `css`, `states`, `variants` and `ancestors` are not CSS properties, so
|
|
4815
|
+
* an object naming only those is a rule set and anything else is CSS.
|
|
4816
|
+
*/
|
|
4817
|
+
export declare const isRuleSetSpec: (spec: StyleSpec) => spec is RuleSetSpec;
|
|
4818
|
+
|
|
4819
|
+
/**
|
|
4820
|
+
* A `styles()` declaration, told apart from a plain rule set by what only a declaration carries.
|
|
4821
|
+
*
|
|
4822
|
+
* No CSS property is called `rules`, so a rule set can never be mistaken for one.
|
|
4823
|
+
*/
|
|
4824
|
+
export declare const isStyleDeclaration: (value: StyleSpec | StyleDeclaration) => value is StyleDeclaration;
|
|
4825
|
+
|
|
4826
|
+
/**
|
|
4827
|
+
* Which layout a page — or another layout — renders inside, and where in it.
|
|
4828
|
+
*
|
|
4829
|
+
* Both halves, always: the layout is the shell (the header, the sidebar), and `slot` is the element inside that
|
|
4830
|
+
* shell the page's body is rendered into. A layout named without a slot has nowhere to put the page, which is why
|
|
4831
|
+
* they are one field rather than two.
|
|
4832
|
+
*/
|
|
4833
|
+
export declare interface LayoutRef {
|
|
4834
|
+
/** The id of a layout declared in {@link SpaceSpec.layouts}. */
|
|
4835
|
+
id: string;
|
|
4836
|
+
/** The id of an element inside that layout, where the body goes. */
|
|
4837
|
+
slot: string;
|
|
4838
|
+
}
|
|
4839
|
+
|
|
4840
|
+
/**
|
|
4841
|
+
* A shell several pages share — a root of its own, never inside a page and never one of them.
|
|
4842
|
+
*
|
|
4843
|
+
* It is written once and every page that names it renders inside it, so the header and the sidebar are the same
|
|
4844
|
+
* nodes on every page rather than a copy per page that drifts. A layout may itself sit inside another one, and the
|
|
4845
|
+
* page resolves the chain from the outside in.
|
|
4846
|
+
*/
|
|
4847
|
+
export declare interface LayoutSpec {
|
|
4848
|
+
/** The name a page's {@link LayoutRef} uses. */
|
|
4849
|
+
id: string;
|
|
4850
|
+
/** What the builder's tree shows. */
|
|
4851
|
+
label?: string;
|
|
4852
|
+
/** The page folder the builder files it under. It does not route anything: a layout has no URL of its own. */
|
|
4853
|
+
folder?: string;
|
|
4854
|
+
/** The layout this one renders inside, for a shell within a shell. */
|
|
4855
|
+
layout?: LayoutRef;
|
|
4856
|
+
attributes?: Record<string, unknown>;
|
|
4857
|
+
css?: CssSpec;
|
|
4858
|
+
states?: StatesSpec;
|
|
4859
|
+
class?: ClassList;
|
|
4860
|
+
bind?: BindingsSpec;
|
|
4861
|
+
flows?: StepSpec[][];
|
|
4862
|
+
body: ElementSpec[];
|
|
4863
|
+
}
|
|
4864
|
+
|
|
4680
4865
|
export declare const link: {
|
|
4681
4866
|
(props?: ElementProps<Partial<{
|
|
4682
4867
|
mode?: "page" | "internal" | "external" | undefined;
|
|
@@ -5174,9 +5359,14 @@ export declare interface PageSpec {
|
|
|
5174
5359
|
* the route. A page naming a folder the space does not declare is refused.
|
|
5175
5360
|
*/
|
|
5176
5361
|
folder?: string;
|
|
5362
|
+
/** The shared layout this page renders inside. See {@link LayoutRef}. */
|
|
5363
|
+
layout?: LayoutRef;
|
|
5364
|
+
/** Keep the page's element state across visits, in the storage named by {@link PageSpec.stateStorage}. */
|
|
5365
|
+
keepState?: boolean;
|
|
5366
|
+
stateStorage?: Schema['settings']['stateStorage'];
|
|
5177
5367
|
css?: CssSpec;
|
|
5178
5368
|
/** As {@link ElementSpec.class} — a shared class instead of a selector of this page's own. */
|
|
5179
|
-
class?:
|
|
5369
|
+
class?: ClassList;
|
|
5180
5370
|
flows?: StepSpec[][];
|
|
5181
5371
|
body: ElementSpec[];
|
|
5182
5372
|
}
|
|
@@ -5289,13 +5479,13 @@ export declare const reconcileParams: (params: Record<string, unknown>, spec: Pa
|
|
|
5289
5479
|
|
|
5290
5480
|
export declare const reference: {
|
|
5291
5481
|
(props?: ElementProps<Partial<{
|
|
5292
|
-
referenceId: string;
|
|
5293
5482
|
referenceType: ElementLayoutType;
|
|
5483
|
+
referenceId: string;
|
|
5294
5484
|
referenceContainer: string;
|
|
5295
5485
|
}>> | undefined): ElementSpec;
|
|
5296
5486
|
(children: ElementSpec[], props?: ElementProps<Partial<{
|
|
5297
|
-
referenceId: string;
|
|
5298
5487
|
referenceType: ElementLayoutType;
|
|
5488
|
+
referenceId: string;
|
|
5299
5489
|
referenceContainer: string;
|
|
5300
5490
|
}>> | undefined): ElementSpec;
|
|
5301
5491
|
};
|
|
@@ -5362,6 +5552,9 @@ export declare const resetForm: (target: string) => StepSpec;
|
|
|
5362
5552
|
*/
|
|
5363
5553
|
export declare const resolveSource: (source: string, index: SourceIndex, where: string) => string;
|
|
5364
5554
|
|
|
5555
|
+
/** A selector's whole block per breakpoint, as it reaches the document. */
|
|
5556
|
+
export declare type ResponsiveBlock = Partial<Record<DisplayMode, StyleBlock>>;
|
|
5557
|
+
|
|
5365
5558
|
/**
|
|
5366
5559
|
* Per-breakpoint CSS as an author writes it. Omitted breakpoints inherit `desktop`, as they do in the builder — and
|
|
5367
5560
|
* only `desktop`: `tablet` (48–64rem) and `mobile` (below 48rem) are disjoint ranges, so a `tablet` rule never
|
|
@@ -5400,6 +5593,27 @@ export declare type RuleGroup = {
|
|
|
5400
5593
|
enabled?: boolean;
|
|
5401
5594
|
};
|
|
5402
5595
|
|
|
5596
|
+
/**
|
|
5597
|
+
* Everything one selector can say, where plain CSS is not enough.
|
|
5598
|
+
*
|
|
5599
|
+
* `:hover` and the variants are not separate classes in Plitzi — they are parts of the SAME selector, which is what
|
|
5600
|
+
* the style editor shows as tabs of one class. Writing them as a second class (`.card:hover` in `customCss`) renders,
|
|
5601
|
+
* and then cannot be read back or overridden per breakpoint, so they are declared beside the rules they modify.
|
|
5602
|
+
*/
|
|
5603
|
+
export declare interface RuleSetSpec extends VariantSpec {
|
|
5604
|
+
/** By name — what `data-variant` and an element's `variant` select. Plain CSS, or CSS with states of its own. */
|
|
5605
|
+
variants?: Record<string, CssSpec | VariantSpec>;
|
|
5606
|
+
/**
|
|
5607
|
+
* How this selector looks inside an ANCESTOR, keyed by a class that ancestor wears: always (`css` — the shared icon
|
|
5608
|
+
* that is smaller inside a toolbar), or while the ancestor is in a state or variant (a card's hover moving its
|
|
5609
|
+
* icon, a collapsed sidebar hiding its labels). Any ancestor counts, not only the parent. Name the
|
|
5610
|
+
* class by its declaration — `[card.name]: { states: { hover: … } }` — so a rename reaches it.
|
|
5611
|
+
*
|
|
5612
|
+
* The selector's own states and variants win over these where both set a property.
|
|
5613
|
+
*/
|
|
5614
|
+
ancestors?: Record<string, AncestorSpec>;
|
|
5615
|
+
}
|
|
5616
|
+
|
|
5403
5617
|
declare type RuleValue = Date | string | number | boolean | undefined | null | object;
|
|
5404
5618
|
|
|
5405
5619
|
/**
|
|
@@ -5431,8 +5645,8 @@ export declare const runServerAction: (params: {
|
|
|
5431
5645
|
invalidateElements?: string[];
|
|
5432
5646
|
}) => StepSpec;
|
|
5433
5647
|
|
|
5434
|
-
/** Whether two normalised
|
|
5435
|
-
export declare const
|
|
5648
|
+
/** Whether two normalised selectors say the same thing, whatever order they were written in. */
|
|
5649
|
+
export declare const sameBlocks: (a: ResponsiveBlock, b: ResponsiveBlock) => boolean;
|
|
5436
5650
|
|
|
5437
5651
|
declare type Schema = {
|
|
5438
5652
|
flat: Record<string, Element_2>;
|
|
@@ -5494,6 +5708,13 @@ declare type Schema = {
|
|
|
5494
5708
|
pageFolders: PageFolder[];
|
|
5495
5709
|
};
|
|
5496
5710
|
|
|
5711
|
+
/**
|
|
5712
|
+
* Every setting a space can carry, which `schemaSettings.test.ts` holds to the `Schema['settings']` type.
|
|
5713
|
+
*
|
|
5714
|
+
* A key outside it is one nothing reads any more — `head`, from before a space declared its fonts.
|
|
5715
|
+
*/
|
|
5716
|
+
export declare const SCHEMA_SETTINGS: readonly ["keepState", "stateStorage", "customCss", "userProvider", "tokenStorage", "loginUrl", "userUrl", "refreshUrl", "logoutUrl", "detailsPath", "tokenPath", "refreshTokenPath", "expirationTimePath", "refreshExpirationTimePath", "sessionHintCookie", "sessionExchangeUrl", "sessionGate", "sessionRevalidateSeconds", "debugMode"];
|
|
5717
|
+
|
|
5497
5718
|
declare type SchemaRsc = {
|
|
5498
5719
|
enabled?: boolean;
|
|
5499
5720
|
/** Wire protocol for RSC updates. 'json' is the default (data-only). 'stream' uses the RSC wire format (requires react-server condition). */
|
|
@@ -5571,6 +5792,9 @@ export declare type SourceIndex = Map<string, string>;
|
|
|
5571
5792
|
*/
|
|
5572
5793
|
export declare type SourceTypes = Record<string, string>;
|
|
5573
5794
|
|
|
5795
|
+
/** The same guarantee for the space itself, in the order its fields are written. */
|
|
5796
|
+
export declare const SPACE_FIELDS: readonly ["name", "permanentUrl", "mode", "theme", "variables", "fonts", "elements", "classes", "schemaVariables", "settings", "customCss", "rsc", "pageFolders", "layouts", "pages"];
|
|
5797
|
+
|
|
5574
5798
|
/**
|
|
5575
5799
|
* The `space` source, which the SDK application registers rather than this package.
|
|
5576
5800
|
*
|
|
@@ -5583,6 +5807,23 @@ export declare const spaceCallbacks: Record<string, BuiltinGlobalCallback>;
|
|
|
5583
5807
|
|
|
5584
5808
|
declare type SpaceCredentialProvider = 's3' | 'r2' | 'ssr' | 'custom' | 'smtp';
|
|
5585
5809
|
|
|
5810
|
+
/**
|
|
5811
|
+
* Whether two pairs of space documents render the same space.
|
|
5812
|
+
*
|
|
5813
|
+
* Not whether they are the same bytes: a selector used by one element is free to be renamed, a binding's id is
|
|
5814
|
+
* derived from its position, an attribute left out means its default, and an element nothing refers to may be
|
|
5815
|
+
* called anything. What has to agree is everything a visitor or another part of the document can observe — the
|
|
5816
|
+
* tree, every attribute, the rules that apply to each element (whatever the selector holding them is called), the
|
|
5817
|
+
* bindings, the flows, the pages, the layouts and the settings.
|
|
5818
|
+
*
|
|
5819
|
+
* Elements are paired by position, so an element renamed on the way through is still compared with itself.
|
|
5820
|
+
*/
|
|
5821
|
+
export declare interface SpaceDifference {
|
|
5822
|
+
/** Where, by the ids of the FIRST pair: `home > hero > title`, `style: card`, `settings.customCss`. */
|
|
5823
|
+
at: string;
|
|
5824
|
+
message: string;
|
|
5825
|
+
}
|
|
5826
|
+
|
|
5586
5827
|
/**
|
|
5587
5828
|
* Whether a pair of documents is a space that can be served.
|
|
5588
5829
|
*
|
|
@@ -5625,8 +5866,13 @@ export declare interface SpaceSpec {
|
|
|
5625
5866
|
*
|
|
5626
5867
|
* A space-wide stylesheet, and the right place for the rules that describe the space rather than one section of
|
|
5627
5868
|
* it. `styles()` is the same thing declared next to what it dresses; both end up here.
|
|
5869
|
+
*
|
|
5870
|
+
* In ORDER: the stylesheet lists these first, in the order written, and then the `styles()` declarations the tree
|
|
5871
|
+
* names that are not here. Order decides which of two classes wins where one element wears both and they set the
|
|
5872
|
+
* same property — `class: [shareFill, fillDanger]` — so a declaration can be named here too, by its variable, to
|
|
5873
|
+
* put it in its place: `{ 'an-share-fill': shareFill, 'an-fill-danger': fillDanger }`.
|
|
5628
5874
|
*/
|
|
5629
|
-
classes?: Record<string,
|
|
5875
|
+
classes?: Record<string, StyleSpec | StyleDeclaration>;
|
|
5630
5876
|
elements?: Record<string, ElementStyleSpec>;
|
|
5631
5877
|
schemaVariables?: SchemaVariable[];
|
|
5632
5878
|
customCss?: string;
|
|
@@ -5654,9 +5900,64 @@ export declare interface SpaceSpec {
|
|
|
5654
5900
|
fonts?: SpaceFont[];
|
|
5655
5901
|
/** Route prefixes a page can sit under. See {@link PageFolderSpec}. */
|
|
5656
5902
|
pageFolders?: PageFolderSpec[];
|
|
5903
|
+
/** Shells pages render inside. See {@link LayoutSpec}. */
|
|
5904
|
+
layouts?: LayoutSpec[];
|
|
5657
5905
|
pages: PageSpec[];
|
|
5658
5906
|
}
|
|
5659
5907
|
|
|
5908
|
+
export declare interface SpecCorrection {
|
|
5909
|
+
code: SpecCorrectionCode;
|
|
5910
|
+
message: string;
|
|
5911
|
+
/** The element, page or selector it concerns. */
|
|
5912
|
+
at?: string;
|
|
5913
|
+
}
|
|
5914
|
+
|
|
5915
|
+
/**
|
|
5916
|
+
* A space document, read back into the declaration that would author it.
|
|
5917
|
+
*
|
|
5918
|
+
* `authorSpace` turns a spec into documents and derives every id, selector name and back-reference on the way. This
|
|
5919
|
+
* is the other direction: it reads the documents and keeps only what a person decided, so the result can be written
|
|
5920
|
+
* out as code and authored again. What comes back is EQUIVALENT rather than identical — a selector used by one
|
|
5921
|
+
* element becomes that element's own `css` and is renamed on the way back in, a binding's id is re-derived — and
|
|
5922
|
+
* every difference of that kind is one nothing else in the document can observe.
|
|
5923
|
+
*
|
|
5924
|
+
* Documents found in the wild are not all well formed, and some were written by a builder that has since moved on.
|
|
5925
|
+
* Rather than refusing them, what can be repaired is repaired and every repair is reported in `corrections`, so a
|
|
5926
|
+
* person can read what changed. Nothing is changed silently, and nothing that renders is dropped.
|
|
5927
|
+
*/
|
|
5928
|
+
export declare type SpecCorrectionCode = 'legacy-element-type' | 'unknown-element-type' | 'dropped-field' | 'dropped-attribute' | 'fixed-attribute' | 'dropped-setting' | 'missing-element' | 'unreachable-element' | 'folded-state-selector' | 'dropped-selector' | 'unwritable-css' | 'folded-custom-css' | 'unknown-style-state' | 'broken-binding' | 'fixed-binding-source' | 'broken-flow' | 'fixed-global-callback' | 'dropped-initial-state' | 'missing-folder' | 'broken-layout';
|
|
5929
|
+
|
|
5930
|
+
export declare interface SpecFromSpace {
|
|
5931
|
+
spec: SpaceSpec;
|
|
5932
|
+
corrections: SpecCorrection[];
|
|
5933
|
+
}
|
|
5934
|
+
|
|
5935
|
+
/**
|
|
5936
|
+
* Reads a space's documents back into a {@link SpaceSpec}, repairing what can be repaired and reporting each repair.
|
|
5937
|
+
*
|
|
5938
|
+
* Pass the result to `authorSpace` and the documents that come back are equivalent to the ones read — the same
|
|
5939
|
+
* tree, the same rules under the same selectors wherever anything names them, the same bindings and flows — which
|
|
5940
|
+
* `compareSpaces` can prove for any particular pair.
|
|
5941
|
+
*/
|
|
5942
|
+
export declare const specFromSpace: (documents: SpaceDocuments, options?: SpecFromSpaceOptions) => SpecFromSpace;
|
|
5943
|
+
|
|
5944
|
+
export declare interface SpecFromSpaceOptions {
|
|
5945
|
+
/** The space's name, when the document does not carry one. */
|
|
5946
|
+
name?: string;
|
|
5947
|
+
/** The space's permanent URL, when the document does not carry one. Ids and selector names derive from it. */
|
|
5948
|
+
permanentUrl?: string;
|
|
5949
|
+
/** Element types a plugin provides. Kept as they are, where any other type the SDK does not ship is reported. */
|
|
5950
|
+
pluginTypes?: readonly string[];
|
|
5951
|
+
/**
|
|
5952
|
+
* Keep every element's id, the positional ones nothing refers to included.
|
|
5953
|
+
*
|
|
5954
|
+
* Left out, an id like `container-19` that nothing names is dropped and derived again, which is right for a copy.
|
|
5955
|
+
* For a space people keep working in it is not: the builder's tree shows the id as the element's name, and a test
|
|
5956
|
+
* or a person may know an element by it.
|
|
5957
|
+
*/
|
|
5958
|
+
keepIds?: boolean;
|
|
5959
|
+
}
|
|
5960
|
+
|
|
5660
5961
|
/** Fields the builder shows but the runtime does not read. */
|
|
5661
5962
|
export declare interface SpecMeta {
|
|
5662
5963
|
/**
|
|
@@ -5669,6 +5970,35 @@ export declare interface SpecMeta {
|
|
|
5669
5970
|
label?: string;
|
|
5670
5971
|
}
|
|
5671
5972
|
|
|
5973
|
+
/** Source files by path, relative to wherever they are written. The space itself is `index.ts`. */
|
|
5974
|
+
export declare type SpecSourceFiles = Record<string, string>;
|
|
5975
|
+
|
|
5976
|
+
/**
|
|
5977
|
+
* A {@link SpaceSpec}, written out as the TypeScript a person would have written.
|
|
5978
|
+
*
|
|
5979
|
+
* Every element is a call to its factory — `heading('Hi', { subType: 'h2' })` — with the attributes its type
|
|
5980
|
+
* already defaults to left out, because the factory puts them back. A class something names becomes a `styles()`
|
|
5981
|
+
* declaration next to the space and is named by variable, so a typo is a compile error rather than an unstyled
|
|
5982
|
+
* element. The output is valid but unformatted: run it through the project's formatter.
|
|
5983
|
+
*/
|
|
5984
|
+
export declare interface SpecSourceOptions {
|
|
5985
|
+
/** What the space is exported as: `export const <exportName>: SpaceSpec`. */
|
|
5986
|
+
exportName: string;
|
|
5987
|
+
/** Where the authoring surface is imported from. */
|
|
5988
|
+
packageName?: string;
|
|
5989
|
+
/**
|
|
5990
|
+
* One file per page and per layout, beside one for the shared classes, instead of a single file. What a space of
|
|
5991
|
+
* thousands of elements wants: a page is then something one can open.
|
|
5992
|
+
*/
|
|
5993
|
+
split?: boolean;
|
|
5994
|
+
}
|
|
5995
|
+
|
|
5996
|
+
/** Writes a spec out as source files. See {@link SpecSourceOptions}. */
|
|
5997
|
+
export declare const specToSource: (spec: SpaceSpec, options: SpecSourceOptions) => SpecSourceFiles;
|
|
5998
|
+
|
|
5999
|
+
/** Rules for the states a selector reacts to — `hover`, `focus`, `active` — each one plain or per breakpoint. */
|
|
6000
|
+
export declare type StatesSpec = Partial<Record<StyleState, CssSpec>>;
|
|
6001
|
+
|
|
5672
6002
|
/**
|
|
5673
6003
|
* What an author declares, as opposed to what a document stores.
|
|
5674
6004
|
*
|
|
@@ -5734,12 +6064,35 @@ declare type Style = {
|
|
|
5734
6064
|
cache: string;
|
|
5735
6065
|
};
|
|
5736
6066
|
|
|
6067
|
+
/** The states a selector can react to — the closed list the style editor offers, read from where it is declared. */
|
|
6068
|
+
export declare const STYLE_STATES: readonly StyleState[];
|
|
6069
|
+
|
|
6070
|
+
/**
|
|
6071
|
+
* The states a selector can react to — one list, read by the type, the style editor, the event schema and authoring.
|
|
6072
|
+
*
|
|
6073
|
+
* It used to be written out in each of those, and the copies drifted: the editor's `checked` and `visited` options had
|
|
6074
|
+
* their label and value swapped, so choosing one stored a state nothing else recognised.
|
|
6075
|
+
*
|
|
6076
|
+
* `focus-visible` is the focus ring a keyboard user needs and a mouse user does not; `focus-within` dresses a
|
|
6077
|
+
* container while anything inside it has focus — a field wrapper around its input.
|
|
6078
|
+
*/
|
|
6079
|
+
declare const STYLE_STATES_2: readonly ["hover", "focus", "focus-visible", "focus-within", "active", "disabled", "checked", "visited"];
|
|
6080
|
+
|
|
6081
|
+
declare type StyleAncestor = {
|
|
6082
|
+
default?: StyleObject;
|
|
6083
|
+
states?: StyleStates;
|
|
6084
|
+
variants?: StyleVariants;
|
|
6085
|
+
};
|
|
6086
|
+
|
|
6087
|
+
declare type StyleAncestors = Record<string, StyleAncestor>;
|
|
6088
|
+
|
|
5737
6089
|
declare type StyleAttributes = Record<string, StyleBlock>;
|
|
5738
6090
|
|
|
5739
6091
|
declare type StyleBlock = {
|
|
5740
6092
|
default?: StyleObject;
|
|
5741
6093
|
states?: StyleStates;
|
|
5742
6094
|
variants?: StyleVariants;
|
|
6095
|
+
ancestors?: StyleAncestors;
|
|
5743
6096
|
};
|
|
5744
6097
|
|
|
5745
6098
|
declare type StyleCategory = (typeof styleConstants)[keyof typeof styleConstants];
|
|
@@ -5822,6 +6175,8 @@ declare const styleConstants: {
|
|
|
5822
6175
|
readonly ANIMATION_DIRECTION: "animation-direction";
|
|
5823
6176
|
readonly ANIMATION_FILL_MODE: "animation-fill-mode";
|
|
5824
6177
|
readonly ANIMATION_PLAY_STATE: "animation-play-state";
|
|
6178
|
+
readonly ANIMATION_TIMELINE: "animation-timeline";
|
|
6179
|
+
readonly ANIMATION_RANGE: "animation-range";
|
|
5825
6180
|
readonly BOX_SHADOW: "box-shadow";
|
|
5826
6181
|
readonly FILTER: "filter";
|
|
5827
6182
|
readonly BACKDROP_FILTER: "backdrop-filter";
|
|
@@ -5865,6 +6220,8 @@ declare const styleConstants: {
|
|
|
5865
6220
|
readonly OVERFLOW: "overflow";
|
|
5866
6221
|
readonly OVERFLOW_X: "overflow-x";
|
|
5867
6222
|
readonly OVERFLOW_Y: "overflow-y";
|
|
6223
|
+
readonly SCROLLBAR_WIDTH: "scrollbar-width";
|
|
6224
|
+
readonly SCROLLBAR_COLOR: "scrollbar-color";
|
|
5868
6225
|
readonly OBJECT_FIT: "object-fit";
|
|
5869
6226
|
readonly OBJECT_POSITION: "object-position";
|
|
5870
6227
|
readonly COLUMN_WIDTH: "column-width";
|
|
@@ -5885,6 +6242,8 @@ declare const styleConstants: {
|
|
|
5885
6242
|
readonly TEXT_ALIGN: "text-align";
|
|
5886
6243
|
readonly FONT_STYLE: "font-style";
|
|
5887
6244
|
readonly FONT_VARIANT: "font-variant";
|
|
6245
|
+
readonly FONT_VARIANT_NUMERIC: "font-variant-numeric";
|
|
6246
|
+
readonly FONT_FEATURE_SETTINGS: "font-feature-settings";
|
|
5888
6247
|
readonly TEXT_DECORATION: "text-decoration";
|
|
5889
6248
|
readonly TEXT_DECORATION_LINE: "text-decoration-line";
|
|
5890
6249
|
readonly TEXT_DECORATION_COLOR: "text-decoration-color";
|
|
@@ -5907,6 +6266,7 @@ declare const styleConstants: {
|
|
|
5907
6266
|
readonly LINE_CLAMP: "line-clamp";
|
|
5908
6267
|
readonly WEBKIT_LINE_CLAMP: "-webkit-line-clamp";
|
|
5909
6268
|
readonly WEBKIT_BOX_ORIENT: "-webkit-box-orient";
|
|
6269
|
+
readonly WEBKIT_TEXT_FILL_COLOR: "-webkit-text-fill-color";
|
|
5910
6270
|
readonly FILL: "fill";
|
|
5911
6271
|
readonly STROKE: "stroke";
|
|
5912
6272
|
readonly STROKE_WIDTH: "stroke-width";
|
|
@@ -5922,7 +6282,7 @@ declare const styleConstants: {
|
|
|
5922
6282
|
*/
|
|
5923
6283
|
export declare interface StyleDeclaration {
|
|
5924
6284
|
readonly name: string;
|
|
5925
|
-
readonly rules:
|
|
6285
|
+
readonly rules: ResponsiveBlock;
|
|
5926
6286
|
toString(): string;
|
|
5927
6287
|
}
|
|
5928
6288
|
|
|
@@ -5961,9 +6321,12 @@ export declare type StyleRules = StyleObject;
|
|
|
5961
6321
|
* property is refused on this line. What a declaration MEANS — where it is collected from, what happens when one
|
|
5962
6322
|
* name is declared twice — belongs to whoever assembles the document; this fragment only names rules.
|
|
5963
6323
|
*/
|
|
5964
|
-
export declare const styles: (name: string, rules:
|
|
6324
|
+
export declare const styles: (name: string, rules: StyleSpec) => StyleDeclaration;
|
|
6325
|
+
|
|
6326
|
+
/** A selector's rules in either shape: plain CSS, or CSS with its states and variants beside it. */
|
|
6327
|
+
export declare type StyleSpec = CssSpec | RuleSetSpec;
|
|
5965
6328
|
|
|
5966
|
-
declare type StyleState =
|
|
6329
|
+
declare type StyleState = (typeof STYLE_STATES_2)[number];
|
|
5967
6330
|
|
|
5968
6331
|
declare type StyleStates = Partial<Record<StyleState, StyleObject>>;
|
|
5969
6332
|
|
|
@@ -5984,7 +6347,7 @@ declare type StyleVariables = Record<StyleVariableCategory, StyleVariableGroup>;
|
|
|
5984
6347
|
|
|
5985
6348
|
declare type StyleVariableValue = string | number | StyleThemeValue;
|
|
5986
6349
|
|
|
5987
|
-
declare type StyleVariants = Record<string, Omit<StyleBlock, 'variants'>>;
|
|
6350
|
+
declare type StyleVariants = Record<string, Omit<StyleBlock, 'variants' | 'ancestors'>>;
|
|
5988
6351
|
|
|
5989
6352
|
/** If a camelCase key maps to a known kebab-case property, return it — used to name the correct key in an error. */
|
|
5990
6353
|
export declare const suggestCssProperty: (key: string) => string | undefined;
|
|
@@ -6059,7 +6422,7 @@ export declare interface TemplateSpec {
|
|
|
6059
6422
|
key?: string;
|
|
6060
6423
|
variables?: Partial<StyleVariables>;
|
|
6061
6424
|
/** As {@link SpaceSpec.classes}. Every class the subtree names has to be declared here, or it does not travel. */
|
|
6062
|
-
classes?: Record<string,
|
|
6425
|
+
classes?: Record<string, StyleSpec | StyleDeclaration>;
|
|
6063
6426
|
elements?: Record<string, ElementStyleSpec>;
|
|
6064
6427
|
schemaVariables?: SchemaVariable[];
|
|
6065
6428
|
mode?: Style['mode'];
|
|
@@ -6094,7 +6457,22 @@ export declare const themeToggle: {
|
|
|
6094
6457
|
/** Both binding forms as one list. The map form targets attributes, which is what nearly every binding does. */
|
|
6095
6458
|
export declare const toBindingSpecs: (bind: BindingsSpec) => BindingSpec[];
|
|
6096
6459
|
|
|
6097
|
-
|
|
6460
|
+
/**
|
|
6461
|
+
* The same door as {@link css}, for everything one selector carries: its rules, its states and its variants.
|
|
6462
|
+
*
|
|
6463
|
+
* Every rule set in it goes through {@link css}, so a shorthand in a `hover` expands and a typo in a variant is
|
|
6464
|
+
* refused on the line that wrote it. A breakpoint nothing speaks for is left out, which is what the builder writes.
|
|
6465
|
+
*/
|
|
6466
|
+
export declare const toBlocks: (spec: StyleSpec | undefined) => ResponsiveBlock;
|
|
6467
|
+
|
|
6468
|
+
/**
|
|
6469
|
+
* Converted once per declaration and shared.
|
|
6470
|
+
*
|
|
6471
|
+
* Declarations are module constants, and every element builds its own `setState` / `toggleState` from the same two
|
|
6472
|
+
* on every mount — so converting here each time, a regex per param, was a measurable share of mounting a page.
|
|
6473
|
+
* Callers spread what they change, which is why the shared object is read-only.
|
|
6474
|
+
*/
|
|
6475
|
+
export declare const toBuilderParams: (spec: ParamSpec) => Readonly<Record<string, InteractionCallbackParam>>;
|
|
6098
6476
|
|
|
6099
6477
|
/**
|
|
6100
6478
|
* The same write as {@link updateElement}, storing the opposite of what is there — a panel that expands on one click
|
|
@@ -6221,6 +6599,12 @@ export declare const validateSpace: (space: SpaceDocuments, options?: SchemaVali
|
|
|
6221
6599
|
/** `validateTemplate`, holding this SDK's own source catalog — for a manifest authored elsewhere. */
|
|
6222
6600
|
export declare const validateTemplate: (template: Template, options?: SchemaValidationOptions) => SchemaValidationResult;
|
|
6223
6601
|
|
|
6602
|
+
/** One variant of a selector: what it changes, and how it reacts on its own. A variant cannot carry variants. */
|
|
6603
|
+
export declare interface VariantSpec {
|
|
6604
|
+
css?: CssSpec;
|
|
6605
|
+
states?: StatesSpec;
|
|
6606
|
+
}
|
|
6607
|
+
|
|
6224
6608
|
export declare const video: {
|
|
6225
6609
|
(props?: ElementProps<Partial<{
|
|
6226
6610
|
src?: string | undefined;
|
|
@@ -6343,7 +6727,7 @@ export declare const whenSucceeded: (stepId: string, step: StepSpec) => StepSpec
|
|
|
6343
6727
|
*/
|
|
6344
6728
|
export declare const withVisibility: (spec: {
|
|
6345
6729
|
bind?: BindingsSpec;
|
|
6346
|
-
visible?: string;
|
|
6730
|
+
visible?: string | false;
|
|
6347
6731
|
}) => BindingSpec[] | undefined;
|
|
6348
6732
|
|
|
6349
6733
|
export { }
|