@plitzi/sdk-authoring 0.38.13 → 0.38.14
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 +145 -0
- package/dist/index-src.js +205 -148
- package/dist/index.d.ts +151 -1
- package/dist/index.js +2 -2
- package/dist/node.d.ts +18 -0
- package/dist/plugin.d.ts +6 -0
- package/package.json +6 -6
- package/skills/plitzi-authoring/reference/layouts.md +10 -0
- package/skills/plitzi-authoring/reference/plugins.md +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -561,6 +561,25 @@ export declare const assertSnippetValid: (snippet: Snippet, context: string, opt
|
|
|
561
561
|
*/
|
|
562
562
|
export declare const assertSpaceValid: (space: SpaceDocuments, context: string, options?: SpaceValidationOptions, allow?: readonly AllowedBreak[]) => SchemaValidationError[];
|
|
563
563
|
|
|
564
|
+
declare type Asset = {
|
|
565
|
+
id: string;
|
|
566
|
+
type: 'link';
|
|
567
|
+
params: {
|
|
568
|
+
href: string;
|
|
569
|
+
type: 'text/css';
|
|
570
|
+
rel: 'stylesheet';
|
|
571
|
+
} & Record<string, string>;
|
|
572
|
+
isMain?: boolean;
|
|
573
|
+
} | {
|
|
574
|
+
id: string;
|
|
575
|
+
type: 'script';
|
|
576
|
+
params: {
|
|
577
|
+
src: string;
|
|
578
|
+
type: 'text/javascript';
|
|
579
|
+
} & Record<string, string>;
|
|
580
|
+
isMain?: boolean;
|
|
581
|
+
};
|
|
582
|
+
|
|
564
583
|
/**
|
|
565
584
|
* The attributes of one built-in element, by type name — `Attributes<'heading'>['subType']`.
|
|
566
585
|
*
|
|
@@ -1885,6 +1904,11 @@ export declare interface AuthorSpaceOptions {
|
|
|
1885
1904
|
* type or `custom:<renderType>`. Their handles are `boxless`, so a page check does not wait for them on screen.
|
|
1886
1905
|
*/
|
|
1887
1906
|
drawsNothingTypes?: readonly string[];
|
|
1907
|
+
/**
|
|
1908
|
+
* The types that show only some of their children, chosen as they run (a plugin's `choosesChildren`), under the name
|
|
1909
|
+
* a space uses them by. Everything inside them is `conditional`, so a page check owes none of it on screen.
|
|
1910
|
+
*/
|
|
1911
|
+
choosesChildrenTypes?: readonly string[];
|
|
1888
1912
|
/**
|
|
1889
1913
|
* Plugin type → the attributes it declares under a name authoring keeps for the element itself (`variant`, `class`,
|
|
1890
1914
|
* `id`…): a factory reads those as the element's, so the plugin is never handed them. Derived from `plugins`.
|
|
@@ -2070,6 +2094,12 @@ declare type BlockJsxProps = {
|
|
|
2070
2094
|
contentCache?: string;
|
|
2071
2095
|
};
|
|
2072
2096
|
|
|
2097
|
+
/**
|
|
2098
|
+
* The attribute a binding writes, from where it lands: `offlineData.schema` writes part of `offlineData` — the runtime
|
|
2099
|
+
* sets the path — so it is `offlineData` an element has to read.
|
|
2100
|
+
*/
|
|
2101
|
+
export declare const boundAttribute: (to: string) => string;
|
|
2102
|
+
|
|
2073
2103
|
/** The breakpoints a rule set can be written for, widest first — the order they cascade in. */
|
|
2074
2104
|
export declare const BREAKPOINTS: DisplayMode[];
|
|
2075
2105
|
|
|
@@ -2439,6 +2469,22 @@ export declare const component: (componentId: string, instance?: ComponentInstan
|
|
|
2439
2469
|
/** What an element inside a component can read besides its own tree: the globals, and what its instance hands in. */
|
|
2440
2470
|
export declare const COMPONENT_SOURCES: string[];
|
|
2441
2471
|
|
|
2472
|
+
declare type ComponentDefinition = Pick<PluginSchema, 'attributes' | 'builder' | 'definition' | 'defaultStyle' | 'initialItems'> & {
|
|
2473
|
+
assets: Asset[];
|
|
2474
|
+
assetsSettings: Omit<Asset, 'isMain'>[];
|
|
2475
|
+
manifest: PluginManifest;
|
|
2476
|
+
market: Omit<PluginManifest, 'name'> & {
|
|
2477
|
+
category: string;
|
|
2478
|
+
};
|
|
2479
|
+
settings: {
|
|
2480
|
+
[key: string]: string | number | boolean;
|
|
2481
|
+
};
|
|
2482
|
+
type: string;
|
|
2483
|
+
subPlugins: string[];
|
|
2484
|
+
resource: string;
|
|
2485
|
+
isMain?: boolean;
|
|
2486
|
+
} & PluginManifest['runtime'];
|
|
2487
|
+
|
|
2442
2488
|
/** How an instance is authored: what it hands in, what fills its slots, and the authoring fields any element takes. */
|
|
2443
2489
|
export declare type ComponentInstanceProps = Pick<AuthoringProps, 'id' | 'class' | 'css' | 'states' | 'selector' | 'bind' | 'visible' | 'flows' | 'meta' | 'quiet'> & {
|
|
2444
2490
|
/** The props the component declares, by name. A prop is an attribute of the instance: `bind` can land on one too. */
|
|
@@ -2859,9 +2905,17 @@ export declare const digest: (value: string, length: number) => string;
|
|
|
2859
2905
|
|
|
2860
2906
|
export declare type DisplayMode = 'desktop' | 'tablet' | 'mobile';
|
|
2861
2907
|
|
|
2908
|
+
/**
|
|
2909
|
+
* How the document holding a page moves under a finger or a wheel, when the page says so — see
|
|
2910
|
+
* `PageProps.documentScroll`. Read by the authoring surface to refuse anything else.
|
|
2911
|
+
*/
|
|
2912
|
+
export declare const DOCUMENT_SCROLLS: readonly ["locked", "noBounce"];
|
|
2913
|
+
|
|
2862
2914
|
/** Checks that need no space: what any rendered page owes, whoever wrote it. */
|
|
2863
2915
|
export declare type DocumentChecks = Pick<InspectOptions, 'skip' | 'timeout'>;
|
|
2864
2916
|
|
|
2917
|
+
export declare type DocumentScroll = (typeof DOCUMENT_SCROLLS)[number];
|
|
2918
|
+
|
|
2865
2919
|
export declare const dropdown: {
|
|
2866
2920
|
(children: ElementSpec[], props?: ElementProps<Partial<{
|
|
2867
2921
|
disabled?: boolean | undefined;
|
|
@@ -2962,9 +3016,10 @@ export declare const elementAttributeNames: {
|
|
|
2962
3016
|
readonly modalContainer: readonly ["autoHideAfterClick", "title"];
|
|
2963
3017
|
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"];
|
|
2964
3018
|
readonly notFound: readonly [];
|
|
2965
|
-
readonly page: readonly ["layout", "layoutContainer", "notFound", "seoEnabled", "seoPageDescription", "seoPageTitle"];
|
|
3019
|
+
readonly page: readonly ["documentScroll", "layout", "layoutContainer", "notFound", "seoEnabled", "seoPageDescription", "seoPageTitle"];
|
|
2966
3020
|
readonly pagination: readonly ["label", "loadMoreLabel", "mode", "nextLabel", "pageInfo", "pageParam", "previousLabel", "target", "windowSize"];
|
|
2967
3021
|
readonly paragraph: readonly ["content"];
|
|
3022
|
+
readonly plitziSdk: readonly ["environment", "offlineData", "spaceKey"];
|
|
2968
3023
|
readonly reference: readonly ["referenceId", "referenceType"];
|
|
2969
3024
|
readonly richText: readonly ["content", "format", "mediaBaseUrl"];
|
|
2970
3025
|
readonly svg: readonly ["content", "label"];
|
|
@@ -3144,6 +3199,12 @@ export declare interface ElementDeclarationData {
|
|
|
3144
3199
|
* `plitzi page check`), which would otherwise wait for it to be on screen and report it hidden.
|
|
3145
3200
|
*/
|
|
3146
3201
|
drawsNothing?: boolean;
|
|
3202
|
+
/**
|
|
3203
|
+
* Whether the element shows only some of the children put inside it, chosen as it runs — a dashboard showing the
|
|
3204
|
+
* panels of the layout saved for this device, a wizard its current step. Read by the page checks, which then owe none
|
|
3205
|
+
* of them on screen; what it draws is still read by the checks of the whole page — images, overflow, legibility.
|
|
3206
|
+
*/
|
|
3207
|
+
choosesChildren?: boolean;
|
|
3147
3208
|
/**
|
|
3148
3209
|
* The attributes the page server evaluates against a context of its own, never where the element renders: a
|
|
3149
3210
|
* provider's `notFound`, read against its answer; a page's title and description, read against its server providers.
|
|
@@ -6079,6 +6140,9 @@ declare const elementDeclarations: {
|
|
|
6079
6140
|
readonly Page: DeclaredElement< {
|
|
6080
6141
|
readonly type: "page";
|
|
6081
6142
|
readonly serverTemplates: readonly ["seoPageTitle", "seoPageDescription", "notFound"];
|
|
6143
|
+
readonly attributeValues: {
|
|
6144
|
+
readonly documentScroll: readonly ["locked", "noBounce"];
|
|
6145
|
+
};
|
|
6082
6146
|
readonly triggers: {
|
|
6083
6147
|
readonly onPageLoad: {
|
|
6084
6148
|
readonly action: "onPageLoad";
|
|
@@ -6144,6 +6208,7 @@ declare const elementDeclarations: {
|
|
|
6144
6208
|
seoEnabled?: boolean | undefined;
|
|
6145
6209
|
seoPageTitle?: string | undefined;
|
|
6146
6210
|
seoPageDescription?: string | undefined;
|
|
6211
|
+
documentScroll?: (DocumentScroll | "") | undefined;
|
|
6147
6212
|
}>>;
|
|
6148
6213
|
readonly Pagination: DeclaredElement< {
|
|
6149
6214
|
readonly type: "pagination";
|
|
@@ -6241,6 +6306,30 @@ declare const elementDeclarations: {
|
|
|
6241
6306
|
}, Partial<{
|
|
6242
6307
|
content?: string | number | undefined;
|
|
6243
6308
|
}>>;
|
|
6309
|
+
readonly PlitziSdk: DeclaredElement< {
|
|
6310
|
+
readonly type: "plitziSdk";
|
|
6311
|
+
readonly content: {
|
|
6312
|
+
readonly attributes: {
|
|
6313
|
+
readonly spaceKey: "";
|
|
6314
|
+
readonly environment: "main";
|
|
6315
|
+
};
|
|
6316
|
+
readonly definition: {
|
|
6317
|
+
readonly label: "Plitzi Sdk";
|
|
6318
|
+
readonly description: "Another space drawn inside this one, as a widget — its home page, no router of its own: by its key, or from its documents (`offlineData`), bound to UI generated on the fly.";
|
|
6319
|
+
};
|
|
6320
|
+
readonly market: {
|
|
6321
|
+
readonly category: "advanced";
|
|
6322
|
+
readonly icon: "https://cdn.plitzi.com/resources/img/favicon.svg";
|
|
6323
|
+
};
|
|
6324
|
+
readonly defaultStyle: {
|
|
6325
|
+
readonly style: {
|
|
6326
|
+
readonly base: {
|
|
6327
|
+
readonly default: {};
|
|
6328
|
+
};
|
|
6329
|
+
};
|
|
6330
|
+
};
|
|
6331
|
+
};
|
|
6332
|
+
}, PlitziSdkAttributes>;
|
|
6244
6333
|
readonly Reference: DeclaredElement< {
|
|
6245
6334
|
readonly type: "reference";
|
|
6246
6335
|
readonly content: {
|
|
@@ -7134,6 +7223,8 @@ export declare const emptyTemplateFiles: ({ name, dir }?: {
|
|
|
7134
7223
|
dir?: string;
|
|
7135
7224
|
}) => Record<string, string>;
|
|
7136
7225
|
|
|
7226
|
+
declare type Environment = 'production' | 'staging' | 'development' | 'main';
|
|
7227
|
+
|
|
7137
7228
|
/**
|
|
7138
7229
|
* Expand supported CSS shorthands to their longhand keys, in declaration order: the later declaration wins, as it
|
|
7139
7230
|
* does in a stylesheet. `{ padding: 8, 'padding-left': 0 }` keeps `padding-left: 0`, and
|
|
@@ -7939,6 +8030,8 @@ export declare const isCssProperty: (key: string) => boolean;
|
|
|
7939
8030
|
*/
|
|
7940
8031
|
export declare const isCustomProperty: (key: string) => boolean;
|
|
7941
8032
|
|
|
8033
|
+
export declare const isDocumentScroll: (value: unknown) => value is DocumentScroll;
|
|
8034
|
+
|
|
7942
8035
|
/**
|
|
7943
8036
|
* Whether a style is the object form rather than plain CSS.
|
|
7944
8037
|
*
|
|
@@ -8575,6 +8668,12 @@ export declare interface NotificationsSpec {
|
|
|
8575
8668
|
progressHeight?: string;
|
|
8576
8669
|
}
|
|
8577
8670
|
|
|
8671
|
+
declare type OfflineDataRaw = {
|
|
8672
|
+
schema: Schema;
|
|
8673
|
+
style: Style;
|
|
8674
|
+
plugins?: PluginRaw[];
|
|
8675
|
+
};
|
|
8676
|
+
|
|
8578
8677
|
export declare const on: (trigger: ElementTriggerName | (string & {}), params?: Record<string, unknown>) => StepSpec;
|
|
8579
8678
|
|
|
8580
8679
|
export declare const onClick: (params?: {
|
|
@@ -8849,6 +8948,14 @@ export declare interface PageSpec {
|
|
|
8849
8948
|
* navigation.routeParams.slug)) }}'`.
|
|
8850
8949
|
*/
|
|
8851
8950
|
notFound?: string;
|
|
8951
|
+
/**
|
|
8952
|
+
* How the document moves while this page is on it. Left out, it scrolls as any page does. `'noBounce'` keeps the
|
|
8953
|
+
* scroll and takes away what a finger pulls past either end — iOS's rubber band, pull-to-refresh. `'locked'` holds it
|
|
8954
|
+
* still: a screen that fills the window — a dashboard, a board — where only the panels that scroll on their own
|
|
8955
|
+
* (`overflow: 'auto'`) move, and a finger dragged anywhere else no longer pulls the whole page. Never written onto a
|
|
8956
|
+
* document the space is embedded in.
|
|
8957
|
+
*/
|
|
8958
|
+
documentScroll?: DocumentScroll;
|
|
8852
8959
|
/**
|
|
8853
8960
|
* Who this page is FOR, and the trap is that omitting it is not the same as `public`.
|
|
8854
8961
|
*
|
|
@@ -9084,6 +9191,41 @@ export declare interface PlanProblem {
|
|
|
9084
9191
|
message: string;
|
|
9085
9192
|
}
|
|
9086
9193
|
|
|
9194
|
+
/** Another space drawn inside this one, as a widget: `plitziSdk({ id: 'card', bind: { offlineData: 'view.data' } })`. */
|
|
9195
|
+
export declare const plitziSdk: {
|
|
9196
|
+
(children: ElementSpec[], props?: ElementProps< PlitziSdkAttributes> | undefined): ElementSpec;
|
|
9197
|
+
(props?: ElementProps< PlitziSdkAttributes> | undefined): ElementSpec;
|
|
9198
|
+
};
|
|
9199
|
+
|
|
9200
|
+
/** What this element can be authored with. */
|
|
9201
|
+
declare type PlitziSdkAttributes = {
|
|
9202
|
+
/** The space drawn, fetched by its key. */
|
|
9203
|
+
spaceKey?: string;
|
|
9204
|
+
environment?: Environment;
|
|
9205
|
+
/**
|
|
9206
|
+
* The space drawn from its documents instead — `schema` and `style` with its compiled `cache`, what `plitzi_render`
|
|
9207
|
+
* answers — with no backend behind it: UI generated on the fly, a preview. Usually bound: whole, to an
|
|
9208
|
+
* `apiContainer`'s answer or a runtime's route, or `offlineData.schema` and `offlineData.style` from two elements.
|
|
9209
|
+
* With it, `spaceKey` is not read.
|
|
9210
|
+
*/
|
|
9211
|
+
offlineData?: OfflineDataRaw;
|
|
9212
|
+
};
|
|
9213
|
+
|
|
9214
|
+
declare type Plugin_2 = {
|
|
9215
|
+
assets: Asset[];
|
|
9216
|
+
assetsSettings: Omit<Asset, 'isMain'>[];
|
|
9217
|
+
attributes: ComponentDefinition['attributes'];
|
|
9218
|
+
builder: PluginBuilder;
|
|
9219
|
+
defaultStyle: ComponentDefinition['defaultStyle'];
|
|
9220
|
+
isMain?: boolean;
|
|
9221
|
+
manifest: PluginManifest;
|
|
9222
|
+
market: ComponentDefinition['market'];
|
|
9223
|
+
resource: string;
|
|
9224
|
+
settings: Record<string, unknown>;
|
|
9225
|
+
subPlugins?: string[];
|
|
9226
|
+
type: string;
|
|
9227
|
+
};
|
|
9228
|
+
|
|
9087
9229
|
export declare type PluginBuilder = {
|
|
9088
9230
|
canDelete?: boolean;
|
|
9089
9231
|
canDragDrop?: boolean;
|
|
@@ -9146,6 +9288,8 @@ export declare interface PluginDeclarationData {
|
|
|
9146
9288
|
sourceType?: string;
|
|
9147
9289
|
/** Behaviour rather than content: it draws nothing on a page, so no check waits for it on screen. */
|
|
9148
9290
|
drawsNothing?: boolean;
|
|
9291
|
+
/** It shows only some of its children, chosen as it runs: no check waits for any of them on screen. */
|
|
9292
|
+
choosesChildren?: boolean;
|
|
9149
9293
|
/** The events it fires beyond the ones every element does, by action. */
|
|
9150
9294
|
triggers?: Readonly<Record<string, {
|
|
9151
9295
|
action: string;
|
|
@@ -9229,6 +9373,12 @@ export declare type PluginManifest = {
|
|
|
9229
9373
|
version: string;
|
|
9230
9374
|
};
|
|
9231
9375
|
|
|
9376
|
+
declare type PluginRaw = {
|
|
9377
|
+
resource: string;
|
|
9378
|
+
settings: Plugin_2['settings'];
|
|
9379
|
+
type: string;
|
|
9380
|
+
};
|
|
9381
|
+
|
|
9232
9382
|
export declare type PluginSchema = {
|
|
9233
9383
|
attributes: Element_2['attributes'];
|
|
9234
9384
|
builder: PluginBuilder;
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { $ as GLOBAL_CALLBACK_BUILDERS, $i as
|
|
1
|
+
import { $ as GLOBAL_CALLBACK_BUILDERS, $i as withVisibility, $n as twigTemplate, $r as button, $t as css, A as unrollPage, Aa as n$1, Ai as text, An as getUtility, Ar as onKey, At as d, B as blankSpace, Bi as GLOBAL_SOURCES, Bn as cycleState, Br as resetForm, Bt as grid, C as pageTexts, Ca as t$1, Ci as reference, Cn as flagGateOf, Cr as declaredTrigger, Ct as unusedDeclarations, D as pageRegions, Da as o, Di as tabContainerBody, Dn as taskAction, Dr as onFlowError, Dt as pageFamily, E as diffPictures, Ea as i$1, Ei as tabContainer, En as defineAction, Er as onFlowEnd, Et as familyOf, F as readDevTools, Fi as defaultLabel, Fn as authLogout, Fr as onSubmit, Ft as t$2, G as space$1, Gi as boundAttribute, Gn as navigate, Gr as toggleElement, Gt as isClassModifier, H as catalogTemplateFiles, Hi as activeWhen, Hn as hostAction, Hr as scrollIntoView, Ht as className, I as readDevToolsInPage, Ii as defineElement, In as authRefreshDetails, Ir as openDialog, It as tokens, J as importSlug, Ji as hiddenWhen, Jn as runServerActionOrNotify, Jr as withPluginCatalogs, Jt as modifierClassName, K as space, Ki as groupBindings, Kn as removeState, Kr as updateElement, Kt as isClassRef, L as dataIssues, Li as element, Ln as cancelServerAction, Lr as openModal, Lt as createTw, M as inspectPage, Ma as s$1, Mi as video, Mn as addNotification, Mr as onPageLoad, Mt as FIXABLE_CODES, N as onScreen, Na as t, Ni as component, Nn as appendState, Nr as onPointerDown, Nt as n, O as profilePictures, Oa as s, Oi as tabContainerHeader, On as BUILTIN_UTILITIES, Or as onFlowProgress, Ot as notificationsCss, P as failedFlowText, Pi as defaultAttributes, Pn as authLogin, Pr as onScroll, Pt as r, Q as EXPLAIN_KINDS, Qi as visibleWhen, Qn as toggleState, Qr as blockJsx, Qt as STYLE_STATES, R as answerAction, Ri as inferredLinkMode, Rn as clearState, Rr as publishOn, Rt as tw, S as compareTexts, Sa as n$2, Si as plitziSdk, Sn as selectorFor, Sr as declaredCallback, St as suggestClassOverrides, T as comparePictures, Ta as a, Ti as svg, Tn as authoringCodesTable, Tr as onClick, Tt as refusalOf, U as emptyTemplateFiles, Ui as authorBinding, Un as invalidateQueries, Ur as scrollTo, Ut as classNames, V as blankTemplateFiles, Vi as activeOn, Vn as delay, Vr as scrollBy, Vt as row, W as toPortableSource, Wi as bindTemplate, Wn as moveState, Wr as setFieldValue, Wt as classRefs, X as importProbe, Xi as toBindingSpecs, Xn as stepState, Xr as apiContainer, Xt as styles, Y as importedFiles, Yi as resolveSource, Yn as setState, Yt as splitClassList, Z as BUILDER_NAMES, Zi as variantFrom, Zn as toggleInState, Zr as blockHtml, Zt as BREAKPOINTS, _ as shortcutKey, _a as elementSourceTypes, _i as markdown, _n as slugify, _r as carouselPause, _t as assertSnippetValid, a as locateClasses, aa as AUTHORING_CODES, ai as dialogContainer, an as expandShorthand, ar as when, at as SPACE_FIELDS, b as summariseRenders, ba as typeCallbackDefinitions, bi as pagination, bn as locate, br as closeDialog, bt as suggestSpace, c as validateSnippet, ca as isSuggestionCode, ci as embed, cn as shorthandLonghands, cr as whileRunning, ct as specFromSpace, d as i$2, da as elementCallbacks, di as formControl, dn as cssPropertyName, dr as getGlobalCallback, dt as actionToSource, ea as actionSource, ei as carousel, en as isRuleSetSpec, er as webHook, et as explain, f as o$1, fa as elementCatalog, fi as heading, fn as isCssProperty, fr as e, ft as withNamedIds, g as pressShortcut, ga as elementSlots, gi as listItem, gn as digest, gr as carouselNext, gt as transformerCatalog, h as withElement, ha as elementPartTypes, hi as list, hr as carouselGoTo, ht as suggestTransformer, i as lintSpace, ia as scope, ii as custom, in as cssShorthands, ir as named, it as ELEMENT_FIELDS, j as inspectDocument, ja as r$2, ji as themeToggle, jn as SET_STATE_TYPES, jr as onLoad, jt as i, k as loadImages, ka as c, ki as tabContainerItem, kn as applyUtility, kr as onInterval, kt as withNotificationsCss, l as validateSpace, la as elementAncestorTypes, li as fontAwesome, ln as cssNumberValue, lr as BUILTIN_GLOBAL_CALLBACKS, lt as compareSpaces, m as singlePageSpace, ma as elementLeafTypes, mi as link, mn as suggestCssProperty, mr as cancelApi, mt as getTransformer, n as authorSpace, na as twig, ni as channel, nn as toBlocks, nr as authorFlows, nt as explainList, o as locateElements, oa as AuthoringError, oi as dropdown, on as expandShorthandPatch, or as whenFailed, ot as specToSource, p as compactSvg, pa as elementDefaultAttributes, pi as image, pn as isCustomProperty, pr as announceOn, pt as BUILTIN_TRANSFORMERS, q as darkScheme, qi as hasVisibilityBinding, qn as runServerAction, qr as elementsFromManifest, qt as isStyleDeclaration, r as fixSpace, ra as closest, ri as container, rn as toResponsive, rr as flowStepIds, rt as explanationText, s as planFixes, sa as authoringCodeEntry, si as dropdownPopup, sn as expandShorthandTraced, sr as whenSucceeded, st as SCHEMA_SETTINGS, t as authorSnippet, ta as source, ti as carouselTrack, tn as sameBlocks, tr as authorFlow, tt as explainKindOf, u as a$2, ua as elementAttributeValues, ui as form, un as cssProperties, ur as applyBuiltinCallback, ut as actionSpecFromEntry, v as openPage, va as elementTriggers, vi as modalContainer, vn as buildHandles, vr as carouselPlay, vt as PAGE_SPEC_FIELDS, w as alignPictures, wa as elementAttributeNames, wi as richText, wn as flagSpecOf, wr as on, wt as SpaceRefusedError, x as PAGE_TEXT_LIMIT, xa as typeTriggerDefinitions, xi as paragraph, xn as pathForSlug, xr as closeModal, xt as withoutQuieted, y as inspectRenders, ya as elementTypeNames, yi as nodeHtml, yn as instanceSelectorFor, yr as carouselPrevious, yt as assertSpaceValid, z as CATALOG_TEMPLATE_IDENTITY, zi as COMPONENT_SOURCES, zn as copyToClipboard, zr as reloadApi, zt as column } from "./index-src.js";
|
|
2
2
|
import { n as e$1, r as r$1, t as a$1 } from "./index-declare.js";
|
|
3
|
-
export { AUTHORING_CODES, AuthoringError, BREAKPOINTS, BUILDER_NAMES, a as BUILTIN_ELEMENT_CALLBACKS, BUILTIN_GLOBAL_CALLBACKS, t as BUILTIN_PARAM_TYPES, BUILTIN_TRANSFORMERS, BUILTIN_UTILITIES, CATALOG_TEMPLATE_IDENTITY, COMPONENT_SOURCES, ELEMENT_FIELDS, EXPLAIN_KINDS, FIXABLE_CODES, GLOBAL_CALLBACK_BUILDERS, GLOBAL_SOURCES, t$
|
|
3
|
+
export { AUTHORING_CODES, AuthoringError, BREAKPOINTS, BUILDER_NAMES, a as BUILTIN_ELEMENT_CALLBACKS, BUILTIN_GLOBAL_CALLBACKS, t as BUILTIN_PARAM_TYPES, BUILTIN_TRANSFORMERS, BUILTIN_UTILITIES, CATALOG_TEMPLATE_IDENTITY, COMPONENT_SOURCES, t$1 as DOCUMENT_SCROLLS, ELEMENT_FIELDS, EXPLAIN_KINDS, FIXABLE_CODES, GLOBAL_CALLBACK_BUILDERS, GLOBAL_SOURCES, t$2 as MOTION_ENTERS, r as MOTION_LOOPS, n as MOTION_TRIGGERS, i as NOTIFICATIONS_FIELDS, PAGE_SPEC_FIELDS, PAGE_TEXT_LIMIT, SCHEMA_SETTINGS, i$1 as SCROLL_CALLBACKS, SET_STATE_TYPES, SPACE_FIELDS, STYLE_STATES, SpaceRefusedError, actionSource, actionSpecFromEntry, actionToSource, activeOn, activeWhen, addNotification, alignPictures, announceOn, answerAction, apiContainer, appendState, applyBuiltinCallback, s as applyElementCallback, applyUtility, assertSnippetValid, assertSpaceValid, authLogin, authLogout, authRefreshDetails, authorBinding, authorFlow, authorFlows, authorSnippet, authorSpace, authoringCodeEntry, authoringCodesTable, bindTemplate, blankSpace, space as blankSpaceSpec, blankTemplateFiles, blockHtml, blockJsx, boundAttribute, buildHandles, button, cancelApi, cancelServerAction, carousel, carouselGoTo, carouselNext, carouselPause, carouselPlay, carouselPrevious, carouselTrack, catalogTemplateFiles, channel, className, classNames, classRefs, clearState, closeDialog, closeModal, closest, column, compactSvg, comparePictures, compareSpaces, compareTexts, component, container, copyToClipboard, createTw, css, cssNumberValue, cssProperties, cssPropertyName, cssShorthands, custom, cycleState, darkScheme, dataIssues, declaredCallback, declaredTrigger, defaultAttributes, defaultLabel, defineAction, defineElement, a$1 as definePlugin, delay, dialogContainer, diffPictures, digest, dropdown, dropdownPopup, element, elementAncestorTypes, elementAttributeNames, elementAttributeValues, elementCallbacks, elementCatalog, r$1 as elementDeclaration, elementDefaultAttributes, elementLeafTypes, elementPartTypes, elementSlots, elementSourceTypes, elementTriggers, elementTypeNames, elementsFromManifest, embed, space$1 as emptySpaceSpec, emptyTemplateFiles, expandShorthand, expandShorthandPatch, expandShorthandTraced, explain, explainKindOf, explainList, explanationText, failedFlowText, familyOf, fixSpace, flagGateOf, flagSpecOf, flowStepIds, fontAwesome, form, formControl, o as getElementCallback, getGlobalCallback, getTransformer, getUtility, grid, groupBindings, hasVisibilityBinding, heading, n$1 as hiddenParams, hiddenWhen, hostAction, image, importProbe, importSlug, importedFiles, inferredLinkMode, inspectDocument, inspectPage, inspectRenders, instanceSelectorFor, s$1 as invalidParams, invalidateQueries, isClassModifier, isClassRef, isCssProperty, isCustomProperty, n$2 as isDocumentScroll, isRuleSetSpec, isStyleDeclaration, isSuggestionCode, link, lintSpace, list, listItem, loadImages, locate, locateClasses, locateElements, markdown, r$2 as missingRequiredParams, modalContainer, modifierClassName, moveState, named, navigate, nodeHtml, notificationsCss, on, onClick, onFlowEnd, onFlowError, onFlowProgress, onInterval, onKey, onLoad, onPageLoad, onPointerDown, onScreen, onScroll, onSubmit, openDialog, openModal, openPage, pageFamily, pageRegions, pageTexts, pagination, paragraph, pathForSlug, planFixes, plitziSdk, pressShortcut, profilePictures, publishOn, readDevTools, readDevToolsInPage, c as reconcileParams, reference, refusalOf, reloadApi, removeState, resetForm, resolveSource, richText, row, runServerAction, runServerActionOrNotify, sameBlocks, scope, scrollBy, scrollIntoView, scrollTo, selectorFor, setFieldValue, setState, shortcutKey, shorthandLonghands, singlePageSpace, slugify, source, e as spaceCallbacks, specFromSpace, specToSource, splitClassList, d as splitNotificationsCss, stepState, styles, suggestClassOverrides, suggestCssProperty, suggestSpace, suggestTransformer, summariseRenders, svg, tabContainer, tabContainerBody, tabContainerHeader, tabContainerItem, taskAction, text, themeToggle, toBindingSpecs, toBlocks, i$2 as toBuilderParams, a$2 as toInteractionCallback, o$1 as toInteractionCallbacks, toPortableSource, toResponsive, toggleElement, toggleInState, toggleState, tokens, transformerCatalog, tw, twig, twigTemplate, typeCallbackDefinitions, typeTriggerDefinitions, unrollPage, unusedDeclarations, updateElement, validateSnippet, validateSpace, e$1 as valuesOf, variantFrom, video, visibleWhen, webHook, when, whenFailed, whenSucceeded, whileRunning, withElement, withNamedIds, withNotificationsCss, withPluginCatalogs, withVisibility, withoutQuieted };
|
package/dist/node.d.ts
CHANGED
|
@@ -1314,6 +1314,14 @@ declare type CssSpec = CssInput | ResponsiveCss;
|
|
|
1314
1314
|
|
|
1315
1315
|
declare type DisplayMode = 'desktop' | 'tablet' | 'mobile';
|
|
1316
1316
|
|
|
1317
|
+
/**
|
|
1318
|
+
* How the document holding a page moves under a finger or a wheel, when the page says so — see
|
|
1319
|
+
* `PageProps.documentScroll`. Read by the authoring surface to refuse anything else.
|
|
1320
|
+
*/
|
|
1321
|
+
declare const DOCUMENT_SCROLLS: readonly ["locked", "noBounce"];
|
|
1322
|
+
|
|
1323
|
+
declare type DocumentScroll = (typeof DOCUMENT_SCROLLS)[number];
|
|
1324
|
+
|
|
1317
1325
|
/**
|
|
1318
1326
|
* An element, keyed by the one name it answers to.
|
|
1319
1327
|
*
|
|
@@ -1912,6 +1920,14 @@ declare interface PageSpec {
|
|
|
1912
1920
|
* navigation.routeParams.slug)) }}'`.
|
|
1913
1921
|
*/
|
|
1914
1922
|
notFound?: string;
|
|
1923
|
+
/**
|
|
1924
|
+
* How the document moves while this page is on it. Left out, it scrolls as any page does. `'noBounce'` keeps the
|
|
1925
|
+
* scroll and takes away what a finger pulls past either end — iOS's rubber band, pull-to-refresh. `'locked'` holds it
|
|
1926
|
+
* still: a screen that fills the window — a dashboard, a board — where only the panels that scroll on their own
|
|
1927
|
+
* (`overflow: 'auto'`) move, and a finger dragged anywhere else no longer pulls the whole page. Never written onto a
|
|
1928
|
+
* document the space is embedded in.
|
|
1929
|
+
*/
|
|
1930
|
+
documentScroll?: DocumentScroll;
|
|
1915
1931
|
/**
|
|
1916
1932
|
* Who this page is FOR, and the trap is that omitting it is not the same as `public`.
|
|
1917
1933
|
*
|
|
@@ -1960,6 +1976,8 @@ declare interface PluginDeclarationData {
|
|
|
1960
1976
|
sourceType?: string;
|
|
1961
1977
|
/** Behaviour rather than content: it draws nothing on a page, so no check waits for it on screen. */
|
|
1962
1978
|
drawsNothing?: boolean;
|
|
1979
|
+
/** It shows only some of its children, chosen as it runs: no check waits for any of them on screen. */
|
|
1980
|
+
choosesChildren?: boolean;
|
|
1963
1981
|
/** The events it fires beyond the ones every element does, by action. */
|
|
1964
1982
|
triggers?: Readonly<Record<string, {
|
|
1965
1983
|
action: string;
|
package/dist/plugin.d.ts
CHANGED
|
@@ -150,6 +150,12 @@ export declare interface ElementDeclarationData {
|
|
|
150
150
|
* `plitzi page check`), which would otherwise wait for it to be on screen and report it hidden.
|
|
151
151
|
*/
|
|
152
152
|
drawsNothing?: boolean;
|
|
153
|
+
/**
|
|
154
|
+
* Whether the element shows only some of the children put inside it, chosen as it runs — a dashboard showing the
|
|
155
|
+
* panels of the layout saved for this device, a wizard its current step. Read by the page checks, which then owe none
|
|
156
|
+
* of them on screen; what it draws is still read by the checks of the whole page — images, overflow, legibility.
|
|
157
|
+
*/
|
|
158
|
+
choosesChildren?: boolean;
|
|
153
159
|
/**
|
|
154
160
|
* The attributes the page server evaluates against a context of its own, never where the element renders: a
|
|
155
161
|
* provider's `notFound`, read against its answer; a page's title and description, read against its server providers.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plitzi/sdk-authoring",
|
|
3
|
-
"version": "0.38.
|
|
3
|
+
"version": "0.38.14",
|
|
4
4
|
"license": "AGPL-3.0",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist/index.js",
|
|
@@ -61,11 +61,11 @@
|
|
|
61
61
|
"devDependencies": {
|
|
62
62
|
"@microsoft/api-extractor": "^7.59.3",
|
|
63
63
|
"@plitzi/plitzi-ui": "^1.6.33",
|
|
64
|
-
"@plitzi/sdk-elements": "0.38.
|
|
65
|
-
"@plitzi/sdk-interactions": "0.38.
|
|
66
|
-
"@plitzi/sdk-schema": "0.38.
|
|
67
|
-
"@plitzi/sdk-shared": "0.38.
|
|
68
|
-
"@plitzi/sdk-style": "0.38.
|
|
64
|
+
"@plitzi/sdk-elements": "0.38.14",
|
|
65
|
+
"@plitzi/sdk-interactions": "0.38.14",
|
|
66
|
+
"@plitzi/sdk-schema": "0.38.14",
|
|
67
|
+
"@plitzi/sdk-shared": "0.38.14",
|
|
68
|
+
"@plitzi/sdk-style": "0.38.14",
|
|
69
69
|
"@types/react": "^19.3.0",
|
|
70
70
|
"eslint": "^9.39.5",
|
|
71
71
|
"prettier": "^3.9.9",
|
|
@@ -145,6 +145,16 @@ Every page is now its content and nothing else, and every page is guaranteed the
|
|
|
145
145
|
by name — `"{{ not (apiContainer_feed.products|find('slug', navigation.routeParams.slug)) }}"`. The page renders as
|
|
146
146
|
written: show its "not found" part with `visible`.
|
|
147
147
|
|
|
148
|
+
## A screen that fills the window
|
|
149
|
+
|
|
150
|
+
A dashboard or a board — one screen whose panels scroll on their own — says so on its page: `documentScroll:
|
|
151
|
+
'locked'` holds the document still, so a finger dragged on a tablet no longer pulls the whole page and bounces it
|
|
152
|
+
back. Give the shell the window's height (`height: '100dvh'`) and `overflow: 'auto'` to each part that scrolls; what
|
|
153
|
+
does not fit is cut off, with nothing a visitor can scroll to reach it. `'noBounce'` keeps a page scrolling without
|
|
154
|
+
the rubber band or pull-to-refresh. Either is written onto the document only while that page is on it, and only when
|
|
155
|
+
the document is the space's own — never the site a widget sits on, nor a space drawn inside another. Not an
|
|
156
|
+
`html, body` rule in `customCss`, which holds every page and the site the space is a widget on.
|
|
157
|
+
|
|
148
158
|
## Styles follow the same rule
|
|
149
159
|
|
|
150
160
|
- A role used on several pages is ONE class (`panelCard`, `pageTitle`), declared in the module that owns the area and
|
|
@@ -64,19 +64,19 @@ const NebulaRun = ({ shipColor = 'amber', best = 0, className }: NebulaRunProps)
|
|
|
64
64
|
## Writing to the space
|
|
65
65
|
|
|
66
66
|
A plugin that produces something the page shows — a score, a selection — writes it to `runtime.state`, where every
|
|
67
|
-
binding reads it:
|
|
67
|
+
binding reads it — and where two plugins share it, each being a bundle of its own (a module both import is two):
|
|
68
68
|
|
|
69
69
|
```ts
|
|
70
70
|
import { getStateManager } from '@plitzi/plitzi-sdk';
|
|
71
71
|
|
|
72
72
|
const state = getStateManager();
|
|
73
73
|
state.setStateByKey('arcadeBest', Math.max(score, Number(state.state.arcadeBest ?? 0)));
|
|
74
|
-
const stop = state.subscribe(next => save(next)); //
|
|
74
|
+
const stop = state.subscribe(next => save(next)); // after every change; `stop()` to leave
|
|
75
75
|
```
|
|
76
76
|
|
|
77
77
|
`state` is the current value, `setState` replaces it (or takes an updater), `setStateByKey` writes one key,
|
|
78
|
-
`clearState` empties it, `subscribe` listens. Bindings on `state.*` re-render at once. With
|
|
79
|
-
|
|
78
|
+
`clearState` empties it, `subscribe` listens. Bindings on `state.*` re-render at once. With `keepState` on
|
|
79
|
+
([kept state](kept-state.md)), what a plugin writes there is back after a reload.
|
|
80
80
|
|
|
81
81
|
## Laying out the space's elements
|
|
82
82
|
|