@plitzi/sdk-authoring 0.38.9 → 0.38.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +81 -0
- package/dist/index-src.js +636 -431
- package/dist/index.d.ts +78 -40
- package/dist/node.d.ts +28 -1
- package/package.json +6 -6
- package/skills/plitzi-authoring/CHEATSHEET.md +1 -1
- package/skills/plitzi-authoring/recipes/filter-a-list.ts +0 -2
- package/skills/plitzi-authoring/recipes/forms-and-modals.ts +2 -1
- package/skills/plitzi-authoring/reference/authoring-errors.md +4 -1
- package/skills/plitzi-authoring/reference/layouts.md +4 -2
- package/skills/plitzi-authoring/reference/structure.md +3 -1
package/dist/index.d.ts
CHANGED
|
@@ -413,25 +413,25 @@ export declare const apiContainer: {
|
|
|
413
413
|
headers?: Record<string, string> | undefined;
|
|
414
414
|
notFound?: string | undefined;
|
|
415
415
|
subType?: "div" | "header" | "footer" | "nav" | "main" | "section" | "article" | "aside" | "address" | "figure" | "" | undefined;
|
|
416
|
+
credentials?: RequestCredentials | undefined;
|
|
417
|
+
staleTime?: number | string | undefined;
|
|
418
|
+
gcTime?: number | string | undefined;
|
|
419
|
+
pageParam?: string | undefined;
|
|
416
420
|
query?: string | undefined;
|
|
417
421
|
accessToken?: string | undefined;
|
|
418
422
|
mockData?: (Record<string, unknown> | string) | undefined;
|
|
419
|
-
|
|
423
|
+
singleRecord?: boolean | undefined;
|
|
424
|
+
pagination?: ProviderPagination | undefined;
|
|
425
|
+
renderWhileLoading?: boolean | undefined;
|
|
426
|
+
loadingSlot?: string | undefined;
|
|
427
|
+
refreshSeconds?: number | string | undefined;
|
|
420
428
|
connector?: string | undefined;
|
|
421
429
|
limit?: string | undefined;
|
|
422
|
-
singleRecord?: boolean | undefined;
|
|
423
430
|
filters?: {
|
|
424
431
|
field: string;
|
|
425
432
|
operator: string;
|
|
426
433
|
value: string;
|
|
427
434
|
}[] | undefined;
|
|
428
|
-
pagination?: ProviderPagination | undefined;
|
|
429
|
-
pageParam?: string | undefined;
|
|
430
|
-
renderWhileLoading?: boolean | undefined;
|
|
431
|
-
loadingSlot?: string | undefined;
|
|
432
|
-
staleTime?: number | string | undefined;
|
|
433
|
-
gcTime?: number | string | undefined;
|
|
434
|
-
refreshSeconds?: number | string | undefined;
|
|
435
435
|
}>> | undefined): ElementSpec;
|
|
436
436
|
(props?: ElementProps<Partial<{
|
|
437
437
|
when?: RuleGroup | undefined;
|
|
@@ -444,25 +444,25 @@ export declare const apiContainer: {
|
|
|
444
444
|
headers?: Record<string, string> | undefined;
|
|
445
445
|
notFound?: string | undefined;
|
|
446
446
|
subType?: "div" | "header" | "footer" | "nav" | "main" | "section" | "article" | "aside" | "address" | "figure" | "" | undefined;
|
|
447
|
+
credentials?: RequestCredentials | undefined;
|
|
448
|
+
staleTime?: number | string | undefined;
|
|
449
|
+
gcTime?: number | string | undefined;
|
|
450
|
+
pageParam?: string | undefined;
|
|
447
451
|
query?: string | undefined;
|
|
448
452
|
accessToken?: string | undefined;
|
|
449
453
|
mockData?: (Record<string, unknown> | string) | undefined;
|
|
450
|
-
|
|
454
|
+
singleRecord?: boolean | undefined;
|
|
455
|
+
pagination?: ProviderPagination | undefined;
|
|
456
|
+
renderWhileLoading?: boolean | undefined;
|
|
457
|
+
loadingSlot?: string | undefined;
|
|
458
|
+
refreshSeconds?: number | string | undefined;
|
|
451
459
|
connector?: string | undefined;
|
|
452
460
|
limit?: string | undefined;
|
|
453
|
-
singleRecord?: boolean | undefined;
|
|
454
461
|
filters?: {
|
|
455
462
|
field: string;
|
|
456
463
|
operator: string;
|
|
457
464
|
value: string;
|
|
458
465
|
}[] | undefined;
|
|
459
|
-
pagination?: ProviderPagination | undefined;
|
|
460
|
-
pageParam?: string | undefined;
|
|
461
|
-
renderWhileLoading?: boolean | undefined;
|
|
462
|
-
loadingSlot?: string | undefined;
|
|
463
|
-
staleTime?: number | string | undefined;
|
|
464
|
-
gcTime?: number | string | undefined;
|
|
465
|
-
refreshSeconds?: number | string | undefined;
|
|
466
466
|
}>> | undefined): ElementSpec;
|
|
467
467
|
};
|
|
468
468
|
|
|
@@ -733,6 +733,11 @@ export declare const AUTHORING_CODES: {
|
|
|
733
733
|
readonly means: "a page that sends visitors it is not for to a page the space does not have";
|
|
734
734
|
readonly fix: "a page's id or slug (`''` is the home page), or a full URL";
|
|
735
735
|
};
|
|
736
|
+
readonly 'page-template': {
|
|
737
|
+
readonly kind: "refused";
|
|
738
|
+
readonly means: "a template in a page's `seoTitle`, `seoDescription` or `notFound` that reads what is not there when the server answers — anything but the page's `runtime: 'server'` providers and `navigation` — or cannot be read";
|
|
739
|
+
readonly fix: "read the record from a provider with `runtime: 'server'` on the page or its layout — `'{{ apiContainer_post.title }} — Blog'` — or words of its own";
|
|
740
|
+
};
|
|
736
741
|
readonly 'folder-undeclared': {
|
|
737
742
|
readonly kind: "refused";
|
|
738
743
|
readonly means: "a page, a layout or a folder filed in a folder the space does not declare";
|
|
@@ -908,6 +913,11 @@ export declare const AUTHORING_CODES: {
|
|
|
908
913
|
readonly means: "an ancestor condition keyed by something that is neither a class name nor `'>'` (the parent)";
|
|
909
914
|
readonly fix: "`[card.name]` for a `styles()` declaration, or `'>'` for the parent whatever it wears";
|
|
910
915
|
};
|
|
916
|
+
readonly 'focus-on-field-box': {
|
|
917
|
+
readonly kind: "warned";
|
|
918
|
+
readonly means: "a `focus` or `focus-visible` state on a text field's or a select's `input` slot — the box the field is drawn in, which never takes focus, so no ring is ever shown";
|
|
919
|
+
readonly fix: "`'focus-within'` on the same class, or the state on the `field` slot";
|
|
920
|
+
};
|
|
911
921
|
readonly 'heading-level-overridden': {
|
|
912
922
|
readonly kind: "warned";
|
|
913
923
|
readonly means: "a markdown's or richText's `heading` slot and a level's (`heading3`) both setting one property, the general class written later in the stylesheet — the level's value is lost";
|
|
@@ -1145,7 +1155,7 @@ export declare const AUTHORING_CODES: {
|
|
|
1145
1155
|
};
|
|
1146
1156
|
readonly 'not-found-not-a-template': {
|
|
1147
1157
|
readonly kind: "refused";
|
|
1148
|
-
readonly means: "`notFound
|
|
1158
|
+
readonly means: "`notFound`, a provider's or a page's, that is not one `{{ expression }}` — never `true`, so never a 404";
|
|
1149
1159
|
readonly fix: "`notFound: '{{ source.found == false }}'`";
|
|
1150
1160
|
};
|
|
1151
1161
|
readonly 'server-data-in-browser': {
|
|
@@ -1168,6 +1178,11 @@ export declare const AUTHORING_CODES: {
|
|
|
1168
1178
|
readonly means: "a control in a form with no `name` — its value never reaches `values`";
|
|
1169
1179
|
readonly fix: "`formControl({ name: 'email', … })`";
|
|
1170
1180
|
};
|
|
1181
|
+
readonly 'required-message-unused': {
|
|
1182
|
+
readonly kind: "warned";
|
|
1183
|
+
readonly means: "a `requiredMessage` on a field nothing requires — fields are optional unless `required: true`, so it is never shown and an empty answer is sent";
|
|
1184
|
+
readonly fix: "`required: true` on the field, or no message";
|
|
1185
|
+
};
|
|
1171
1186
|
readonly 'form-control-name-taken': {
|
|
1172
1187
|
readonly kind: "warned";
|
|
1173
1188
|
readonly means: "two controls in one form with one name — one overwrites the other";
|
|
@@ -2152,8 +2167,8 @@ export declare const carousel: {
|
|
|
2152
2167
|
items?: unknown[] | undefined;
|
|
2153
2168
|
speed?: number | undefined;
|
|
2154
2169
|
loop?: boolean | undefined;
|
|
2155
|
-
autoplay?: number | undefined;
|
|
2156
2170
|
pauseOnHover?: boolean | undefined;
|
|
2171
|
+
autoplay?: number | undefined;
|
|
2157
2172
|
transition?: CarouselTransition | undefined;
|
|
2158
2173
|
itemKey?: string | undefined;
|
|
2159
2174
|
}>, "items"> & {
|
|
@@ -2165,8 +2180,8 @@ export declare const carousel: {
|
|
|
2165
2180
|
items?: unknown[] | undefined;
|
|
2166
2181
|
speed?: number | undefined;
|
|
2167
2182
|
loop?: boolean | undefined;
|
|
2168
|
-
autoplay?: number | undefined;
|
|
2169
2183
|
pauseOnHover?: boolean | undefined;
|
|
2184
|
+
autoplay?: number | undefined;
|
|
2170
2185
|
transition?: CarouselTransition | undefined;
|
|
2171
2186
|
itemKey?: string | undefined;
|
|
2172
2187
|
}>, "items"> & {
|
|
@@ -2223,16 +2238,16 @@ export declare const catalogTemplateFiles: ({ name, mode }?: {
|
|
|
2223
2238
|
export declare const channel: {
|
|
2224
2239
|
(children: ElementSpec[], props?: ElementProps<Partial<{
|
|
2225
2240
|
subType?: "" | "div" | "section" | "aside" | "main" | undefined;
|
|
2226
|
-
topic?: string | undefined;
|
|
2227
2241
|
grant?: string | undefined;
|
|
2228
2242
|
presence?: unknown;
|
|
2243
|
+
topic?: string | undefined;
|
|
2229
2244
|
keep?: number | string | undefined;
|
|
2230
2245
|
}>> | undefined): ElementSpec;
|
|
2231
2246
|
(props?: ElementProps<Partial<{
|
|
2232
2247
|
subType?: "" | "div" | "section" | "aside" | "main" | undefined;
|
|
2233
|
-
topic?: string | undefined;
|
|
2234
2248
|
grant?: string | undefined;
|
|
2235
2249
|
presence?: unknown;
|
|
2250
|
+
topic?: string | undefined;
|
|
2236
2251
|
keep?: number | string | undefined;
|
|
2237
2252
|
}>> | undefined): ElementSpec;
|
|
2238
2253
|
};
|
|
@@ -2852,7 +2867,7 @@ export declare const elementAttributeNames: {
|
|
|
2852
2867
|
readonly modalContainer: readonly ["autoHideAfterClick", "title"];
|
|
2853
2868
|
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"];
|
|
2854
2869
|
readonly notFound: readonly [];
|
|
2855
|
-
readonly page: readonly ["layout", "layoutContainer", "seoEnabled", "seoPageDescription", "seoPageTitle"];
|
|
2870
|
+
readonly page: readonly ["layout", "layoutContainer", "notFound", "seoEnabled", "seoPageDescription", "seoPageTitle"];
|
|
2856
2871
|
readonly pagination: readonly ["label", "loadMoreLabel", "mode", "nextLabel", "pageInfo", "pageParam", "previousLabel", "target", "windowSize"];
|
|
2857
2872
|
readonly paragraph: readonly ["content"];
|
|
2858
2873
|
readonly reference: readonly ["referenceId", "referenceType"];
|
|
@@ -2969,6 +2984,14 @@ export declare interface ElementDeclarationData {
|
|
|
2969
2984
|
* `plitzi page check`), which would otherwise wait for it to be on screen and report it hidden.
|
|
2970
2985
|
*/
|
|
2971
2986
|
drawsNothing?: boolean;
|
|
2987
|
+
/**
|
|
2988
|
+
* The attributes the page server evaluates against a context of its own, never where the element renders: a
|
|
2989
|
+
* provider's `notFound`, read against its answer; a page's title and description, read against its server providers.
|
|
2990
|
+
* Interpolated in the element's own scope they resolved to nothing — a `|default(…)` to its fallback — before the
|
|
2991
|
+
* reader that has their names could see them. Read by the element runtime, which leaves them as written, and by the
|
|
2992
|
+
* authoring lint, which holds them to that context.
|
|
2993
|
+
*/
|
|
2994
|
+
serverTemplates?: readonly string[];
|
|
2972
2995
|
content?: {
|
|
2973
2996
|
attributes?: Record<string, unknown>;
|
|
2974
2997
|
definition?: {
|
|
@@ -2989,6 +3012,7 @@ declare const elementDeclarations: {
|
|
|
2989
3012
|
readonly pagination: readonly string[];
|
|
2990
3013
|
};
|
|
2991
3014
|
readonly sourceType: "apiContainer";
|
|
3015
|
+
readonly serverTemplates: readonly ["notFound"];
|
|
2992
3016
|
readonly triggers: {
|
|
2993
3017
|
readonly onApiError: {
|
|
2994
3018
|
readonly action: "onApiError";
|
|
@@ -3152,25 +3176,25 @@ declare const elementDeclarations: {
|
|
|
3152
3176
|
headers?: Record<string, string> | undefined;
|
|
3153
3177
|
notFound?: string | undefined;
|
|
3154
3178
|
subType?: "div" | "header" | "footer" | "nav" | "main" | "section" | "article" | "aside" | "address" | "figure" | "" | undefined;
|
|
3179
|
+
credentials?: RequestCredentials | undefined;
|
|
3180
|
+
staleTime?: number | string | undefined;
|
|
3181
|
+
gcTime?: number | string | undefined;
|
|
3182
|
+
pageParam?: string | undefined;
|
|
3155
3183
|
query?: string | undefined;
|
|
3156
3184
|
accessToken?: string | undefined;
|
|
3157
3185
|
mockData?: (Record<string, unknown> | string) | undefined;
|
|
3158
|
-
|
|
3186
|
+
singleRecord?: boolean | undefined;
|
|
3187
|
+
pagination?: ProviderPagination | undefined;
|
|
3188
|
+
renderWhileLoading?: boolean | undefined;
|
|
3189
|
+
loadingSlot?: string | undefined;
|
|
3190
|
+
refreshSeconds?: number | string | undefined;
|
|
3159
3191
|
connector?: string | undefined;
|
|
3160
3192
|
limit?: string | undefined;
|
|
3161
|
-
singleRecord?: boolean | undefined;
|
|
3162
3193
|
filters?: {
|
|
3163
3194
|
field: string;
|
|
3164
3195
|
operator: string;
|
|
3165
3196
|
value: string;
|
|
3166
3197
|
}[] | undefined;
|
|
3167
|
-
pagination?: ProviderPagination | undefined;
|
|
3168
|
-
pageParam?: string | undefined;
|
|
3169
|
-
renderWhileLoading?: boolean | undefined;
|
|
3170
|
-
loadingSlot?: string | undefined;
|
|
3171
|
-
staleTime?: number | string | undefined;
|
|
3172
|
-
gcTime?: number | string | undefined;
|
|
3173
|
-
refreshSeconds?: number | string | undefined;
|
|
3174
3198
|
}>>;
|
|
3175
3199
|
readonly BlockHtml: {
|
|
3176
3200
|
readonly type: "blockHtml";
|
|
@@ -3543,8 +3567,8 @@ declare const elementDeclarations: {
|
|
|
3543
3567
|
items?: unknown[] | undefined;
|
|
3544
3568
|
speed?: number | undefined;
|
|
3545
3569
|
loop?: boolean | undefined;
|
|
3546
|
-
autoplay?: number | undefined;
|
|
3547
3570
|
pauseOnHover?: boolean | undefined;
|
|
3571
|
+
autoplay?: number | undefined;
|
|
3548
3572
|
transition?: CarouselTransition | undefined;
|
|
3549
3573
|
itemKey?: string | undefined;
|
|
3550
3574
|
}>>;
|
|
@@ -3727,9 +3751,9 @@ declare const elementDeclarations: {
|
|
|
3727
3751
|
};
|
|
3728
3752
|
} & ElementAttributesBrand<Partial<{
|
|
3729
3753
|
subType?: "" | "div" | "section" | "aside" | "main" | undefined;
|
|
3730
|
-
topic?: string | undefined;
|
|
3731
3754
|
grant?: string | undefined;
|
|
3732
3755
|
presence?: unknown;
|
|
3756
|
+
topic?: string | undefined;
|
|
3733
3757
|
keep?: number | string | undefined;
|
|
3734
3758
|
}>>;
|
|
3735
3759
|
readonly Container: {
|
|
@@ -4002,8 +4026,7 @@ declare const elementDeclarations: {
|
|
|
4002
4026
|
readonly top: "0";
|
|
4003
4027
|
readonly position: "absolute";
|
|
4004
4028
|
readonly 'z-index': "210";
|
|
4005
|
-
readonly 'background-color': "
|
|
4006
|
-
readonly opacity: "0.5";
|
|
4029
|
+
readonly 'background-color': "rgb(0 0 0 / 50%)";
|
|
4007
4030
|
};
|
|
4008
4031
|
};
|
|
4009
4032
|
readonly rootContainer: {
|
|
@@ -5977,7 +6000,7 @@ declare const elementDeclarations: {
|
|
|
5977
6000
|
readonly definition: {
|
|
5978
6001
|
readonly label: "Modal Container";
|
|
5979
6002
|
readonly type: "modalContainer";
|
|
5980
|
-
readonly description:
|
|
6003
|
+
readonly description: string;
|
|
5981
6004
|
readonly items: readonly [];
|
|
5982
6005
|
readonly bindings: {};
|
|
5983
6006
|
readonly loadStrategy: "lazy";
|
|
@@ -6034,8 +6057,7 @@ declare const elementDeclarations: {
|
|
|
6034
6057
|
readonly top: "0";
|
|
6035
6058
|
readonly position: "absolute";
|
|
6036
6059
|
readonly 'z-index': "210";
|
|
6037
|
-
readonly 'background-color': "
|
|
6038
|
-
readonly opacity: "0.5";
|
|
6060
|
+
readonly 'background-color': "rgb(0 0 0 / 50%)";
|
|
6039
6061
|
};
|
|
6040
6062
|
};
|
|
6041
6063
|
readonly rootContainer: {
|
|
@@ -6520,6 +6542,7 @@ declare const elementDeclarations: {
|
|
|
6520
6542
|
} & ElementAttributesBrand<unknown>;
|
|
6521
6543
|
readonly Page: {
|
|
6522
6544
|
readonly type: "page";
|
|
6545
|
+
readonly serverTemplates: readonly ["seoPageTitle", "seoPageDescription", "notFound"];
|
|
6523
6546
|
readonly triggers: {
|
|
6524
6547
|
readonly onPageLoad: {
|
|
6525
6548
|
readonly action: "onPageLoad";
|
|
@@ -6600,6 +6623,7 @@ declare const elementDeclarations: {
|
|
|
6600
6623
|
};
|
|
6601
6624
|
} & ElementAttributesBrand<Partial<{
|
|
6602
6625
|
layout?: string | undefined;
|
|
6626
|
+
notFound?: string | undefined;
|
|
6603
6627
|
layoutContainer?: string | undefined;
|
|
6604
6628
|
seoEnabled?: boolean | undefined;
|
|
6605
6629
|
seoPageTitle?: string | undefined;
|
|
@@ -9536,8 +9560,20 @@ export declare interface PageSpec {
|
|
|
9536
9560
|
/** Route, without a leading slash. Empty is the home page. */
|
|
9537
9561
|
slug: string;
|
|
9538
9562
|
isDefault?: boolean;
|
|
9563
|
+
/**
|
|
9564
|
+
* The page's title and description in the head, for search engines and link previews. Either may be a template over
|
|
9565
|
+
* the page's server providers (`runtime: 'server'`, its layouts' too) and `navigation` — `'{{ apiContainer_post.title
|
|
9566
|
+
* }} — Blog'` — which the server evaluates as it writes the head.
|
|
9567
|
+
*/
|
|
9539
9568
|
seoTitle?: string;
|
|
9540
9569
|
seoDescription?: string;
|
|
9570
|
+
/**
|
|
9571
|
+
* One expression over the same answers that says this address shows nothing — a record that is not there: the page is
|
|
9572
|
+
* sent with status 404, rendered as written. For a record read by a provider the page shares with others, in its
|
|
9573
|
+
* layout, whose own `notFound` cannot say it for one page: `'{{ not (apiContainer_feed.topics|find('slug',
|
|
9574
|
+
* navigation.routeParams.slug)) }}'`.
|
|
9575
|
+
*/
|
|
9576
|
+
notFound?: string;
|
|
9541
9577
|
/**
|
|
9542
9578
|
* Who this page is FOR, and the trap is that omitting it is not the same as `public`.
|
|
9543
9579
|
*
|
|
@@ -9963,8 +9999,10 @@ export declare interface ProbeFindings {
|
|
|
9963
9999
|
id: string;
|
|
9964
10000
|
pixels: number;
|
|
9965
10001
|
}[];
|
|
10002
|
+
/** Words that cannot be told from what is behind them, with their contrast against it (WCAG's ratio, 1 to 21). */
|
|
9966
10003
|
illegible: {
|
|
9967
10004
|
text: string;
|
|
10005
|
+
contrast: number;
|
|
9968
10006
|
elementId?: string;
|
|
9969
10007
|
}[];
|
|
9970
10008
|
}
|
package/dist/node.d.ts
CHANGED
|
@@ -140,6 +140,11 @@ declare const AUTHORING_CODES: {
|
|
|
140
140
|
readonly means: "a page that sends visitors it is not for to a page the space does not have";
|
|
141
141
|
readonly fix: "a page's id or slug (`''` is the home page), or a full URL";
|
|
142
142
|
};
|
|
143
|
+
readonly 'page-template': {
|
|
144
|
+
readonly kind: "refused";
|
|
145
|
+
readonly means: "a template in a page's `seoTitle`, `seoDescription` or `notFound` that reads what is not there when the server answers — anything but the page's `runtime: 'server'` providers and `navigation` — or cannot be read";
|
|
146
|
+
readonly fix: "read the record from a provider with `runtime: 'server'` on the page or its layout — `'{{ apiContainer_post.title }} — Blog'` — or words of its own";
|
|
147
|
+
};
|
|
143
148
|
readonly 'folder-undeclared': {
|
|
144
149
|
readonly kind: "refused";
|
|
145
150
|
readonly means: "a page, a layout or a folder filed in a folder the space does not declare";
|
|
@@ -315,6 +320,11 @@ declare const AUTHORING_CODES: {
|
|
|
315
320
|
readonly means: "an ancestor condition keyed by something that is neither a class name nor `'>'` (the parent)";
|
|
316
321
|
readonly fix: "`[card.name]` for a `styles()` declaration, or `'>'` for the parent whatever it wears";
|
|
317
322
|
};
|
|
323
|
+
readonly 'focus-on-field-box': {
|
|
324
|
+
readonly kind: "warned";
|
|
325
|
+
readonly means: "a `focus` or `focus-visible` state on a text field's or a select's `input` slot — the box the field is drawn in, which never takes focus, so no ring is ever shown";
|
|
326
|
+
readonly fix: "`'focus-within'` on the same class, or the state on the `field` slot";
|
|
327
|
+
};
|
|
318
328
|
readonly 'heading-level-overridden': {
|
|
319
329
|
readonly kind: "warned";
|
|
320
330
|
readonly means: "a markdown's or richText's `heading` slot and a level's (`heading3`) both setting one property, the general class written later in the stylesheet — the level's value is lost";
|
|
@@ -552,7 +562,7 @@ declare const AUTHORING_CODES: {
|
|
|
552
562
|
};
|
|
553
563
|
readonly 'not-found-not-a-template': {
|
|
554
564
|
readonly kind: "refused";
|
|
555
|
-
readonly means: "`notFound
|
|
565
|
+
readonly means: "`notFound`, a provider's or a page's, that is not one `{{ expression }}` — never `true`, so never a 404";
|
|
556
566
|
readonly fix: "`notFound: '{{ source.found == false }}'`";
|
|
557
567
|
};
|
|
558
568
|
readonly 'server-data-in-browser': {
|
|
@@ -575,6 +585,11 @@ declare const AUTHORING_CODES: {
|
|
|
575
585
|
readonly means: "a control in a form with no `name` — its value never reaches `values`";
|
|
576
586
|
readonly fix: "`formControl({ name: 'email', … })`";
|
|
577
587
|
};
|
|
588
|
+
readonly 'required-message-unused': {
|
|
589
|
+
readonly kind: "warned";
|
|
590
|
+
readonly means: "a `requiredMessage` on a field nothing requires — fields are optional unless `required: true`, so it is never shown and an empty answer is sent";
|
|
591
|
+
readonly fix: "`required: true` on the field, or no message";
|
|
592
|
+
};
|
|
578
593
|
readonly 'form-control-name-taken': {
|
|
579
594
|
readonly kind: "warned";
|
|
580
595
|
readonly means: "two controls in one form with one name — one overwrites the other";
|
|
@@ -1863,8 +1878,20 @@ declare interface PageSpec {
|
|
|
1863
1878
|
/** Route, without a leading slash. Empty is the home page. */
|
|
1864
1879
|
slug: string;
|
|
1865
1880
|
isDefault?: boolean;
|
|
1881
|
+
/**
|
|
1882
|
+
* The page's title and description in the head, for search engines and link previews. Either may be a template over
|
|
1883
|
+
* the page's server providers (`runtime: 'server'`, its layouts' too) and `navigation` — `'{{ apiContainer_post.title
|
|
1884
|
+
* }} — Blog'` — which the server evaluates as it writes the head.
|
|
1885
|
+
*/
|
|
1866
1886
|
seoTitle?: string;
|
|
1867
1887
|
seoDescription?: string;
|
|
1888
|
+
/**
|
|
1889
|
+
* One expression over the same answers that says this address shows nothing — a record that is not there: the page is
|
|
1890
|
+
* sent with status 404, rendered as written. For a record read by a provider the page shares with others, in its
|
|
1891
|
+
* layout, whose own `notFound` cannot say it for one page: `'{{ not (apiContainer_feed.topics|find('slug',
|
|
1892
|
+
* navigation.routeParams.slug)) }}'`.
|
|
1893
|
+
*/
|
|
1894
|
+
notFound?: string;
|
|
1868
1895
|
/**
|
|
1869
1896
|
* Who this page is FOR, and the trap is that omitting it is not the same as `public`.
|
|
1870
1897
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plitzi/sdk-authoring",
|
|
3
|
-
"version": "0.38.
|
|
3
|
+
"version": "0.38.10",
|
|
4
4
|
"license": "AGPL-3.0",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist/index.js",
|
|
@@ -54,11 +54,11 @@
|
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"@microsoft/api-extractor": "^7.59.3",
|
|
56
56
|
"@plitzi/plitzi-ui": "^1.6.32",
|
|
57
|
-
"@plitzi/sdk-elements": "0.38.
|
|
58
|
-
"@plitzi/sdk-interactions": "0.38.
|
|
59
|
-
"@plitzi/sdk-schema": "0.38.
|
|
60
|
-
"@plitzi/sdk-shared": "0.38.
|
|
61
|
-
"@plitzi/sdk-style": "0.38.
|
|
57
|
+
"@plitzi/sdk-elements": "0.38.10",
|
|
58
|
+
"@plitzi/sdk-interactions": "0.38.10",
|
|
59
|
+
"@plitzi/sdk-schema": "0.38.10",
|
|
60
|
+
"@plitzi/sdk-shared": "0.38.10",
|
|
61
|
+
"@plitzi/sdk-style": "0.38.10",
|
|
62
62
|
"@types/react": "^19.3.0",
|
|
63
63
|
"eslint": "^9.39.5",
|
|
64
64
|
"prettier": "^3.9.9",
|
|
@@ -50,7 +50,7 @@ apiContainer({ id: 'p', query: '/data/x.json', runtime: 'server', children }) //
|
|
|
50
50
|
apiContainer({ id: 'p', action: 'report', runtime: 'server', children }) // the action's output at p's root: p.rows
|
|
51
51
|
// loadingSlot: 'p-skeleton' — a child shown until it answers
|
|
52
52
|
form({ id, managedByInteractions: true, flows, children })
|
|
53
|
-
formControl({ name: 'email', label: 'Email', subType: 'email' })
|
|
53
|
+
formControl({ name: 'email', label: 'Email', subType: 'email', required: true }) // optional without required; select: options: [{ label, value }]
|
|
54
54
|
modalContainer({ id, visible: false, title, children })
|
|
55
55
|
component('card', { props: { title }, children: { body: [ … ] } })
|
|
56
56
|
custom({ renderType: 'myPlugin' }); defineElement<Props>(declaration) // a plugin
|
|
@@ -31,8 +31,6 @@ export const recipe: SpaceSpec = {
|
|
|
31
31
|
{ label: 'Graphics cards', value: 'gpu' }
|
|
32
32
|
],
|
|
33
33
|
defaultValue: 'all',
|
|
34
|
-
// A filter always has an answer: the select is not a question that must be filled in.
|
|
35
|
-
required: false,
|
|
36
34
|
flows: [
|
|
37
35
|
[named('picked', on('onChange')), setState({ key: 'category', type: 'text', value: '{{ picked.value }}' })]
|
|
38
36
|
]
|
|
@@ -38,7 +38,8 @@ export const recipe: SpaceSpec = {
|
|
|
38
38
|
[named('sent', onSubmit()), setState({ key: 'email', type: 'text', value: '{{ sent.values.email }}' })]
|
|
39
39
|
],
|
|
40
40
|
children: [
|
|
41
|
-
|
|
41
|
+
// Optional unless it says so, as an HTML field is: a sign-up without an address is no sign-up.
|
|
42
|
+
formControl({ name: 'email', label: 'Email', subType: 'email', required: true }),
|
|
42
43
|
button({ content: 'Sign up', subType: 'submit' })
|
|
43
44
|
]
|
|
44
45
|
}),
|
|
@@ -102,7 +102,7 @@ The space is not written until these are fixed.
|
|
|
102
102
|
| `motion-no-tag` | a `motion` on an element with no tag of its own — nothing to move | the motion on what it wraps, or a `subType` on it |
|
|
103
103
|
| `no-pages` | a space with no pages | `pages: [{ id: 'home', name: 'Home', slug: '', body: [] }]` |
|
|
104
104
|
| `not-found-in-browser` | `notFound` on a provider asked from the browser — its answer arrives after the page was sent with its status | `runtime: 'server'` on the provider, or `visible` on the page's "not found" part instead |
|
|
105
|
-
| `not-found-not-a-template` | `notFound
|
|
105
|
+
| `not-found-not-a-template` | `notFound`, a provider's or a page's, that is not one `{{ expression }}` — never `true`, so never a 404 | `notFound: '{{ source.found == false }}'` |
|
|
106
106
|
| `notifications-shape` | `notifications` with a field it does not have, or a value that is not one CSS value | the field it suggests, or one it lists; one CSS value, like 'var(--card)', '12px' or '500' |
|
|
107
107
|
| `outside-ancestor` | an element that reads the state of an element it is not inside | nest it in the element the message names |
|
|
108
108
|
| `page-access-level` | an `accessLevel` that is not one the router reads | one of the values the message lists |
|
|
@@ -110,6 +110,7 @@ The space is not written until these are fixed.
|
|
|
110
110
|
| `page-route-taken` | two pages at one address for the same visitors | another slug — or `accessLevel` `'public'` on one and `'authenticated'` on the other |
|
|
111
111
|
| `page-target-unknown` | a link or `navigate` to a page id that does not exist | an existing page id, or a path with its slash (`'/about'`) |
|
|
112
112
|
| `page-target-url` | a URL, `mailto:` or `tel:` in a link left in page mode | `mode: 'external'` |
|
|
113
|
+
| `page-template` | a template in a page's `seoTitle`, `seoDescription` or `notFound` that reads what is not there when the server answers — anything but the page's `runtime: 'server'` providers and `navigation` — or cannot be read | read the record from a provider with `runtime: 'server'` on the page or its layout — `'{{ apiContainer_post.title }} — Blog'` — or words of its own |
|
|
113
114
|
| `page-without-slug` | a page with no `slug` | `slug: ''` for the home page, its path for any other: `'about'`, `'blog/:slug'` |
|
|
114
115
|
| `part-missing` | a compound element — a carousel, a tab container, a dropdown — without a part it renders through | the part the message names, inside it (`carousel()` writes its own track) |
|
|
115
116
|
| `prop-missing` | an instance without a prop its component requires | `component('card', { props: { name: … } })`, or bind it |
|
|
@@ -185,6 +186,7 @@ The space renders, and renders something you probably did not mean. Fix every on
|
|
|
185
186
|
| `embed-without-title` | an `embed` with no `title` — a frame a screen reader cannot describe | say what it shows in `title` |
|
|
186
187
|
| `flag-rule-empty` | a flag rule with no conditions — skipped, never read as "always" | give it a condition, or set the flag's `value` instead |
|
|
187
188
|
| `flag-unused` | a declared flag nothing gates on and no template reads | gate what it switches (`flag: 'x'`), or remove it once the feature has shipped |
|
|
189
|
+
| `focus-on-field-box` | a `focus` or `focus-visible` state on a text field's or a select's `input` slot — the box the field is drawn in, which never takes focus, so no ring is ever shown | `'focus-within'` on the same class, or the state on the `field` slot |
|
|
188
190
|
| `FORM_SUBMIT_UNMANAGED` | a form the browser would submit itself, reloading the page | `managedByInteractions: true` |
|
|
189
191
|
| `form-control-name-taken` | two controls in one form with one name — one overwrites the other | a name each |
|
|
190
192
|
| `form-control-unnamed` | a control in a form with no `name` — its value never reaches `values` | `formControl({ name: 'email', … })` |
|
|
@@ -202,6 +204,7 @@ The space renders, and renders something you probably did not mean. Fix every on
|
|
|
202
204
|
| `path-not-in-data` | a binding onto a provider whose answer the author could read (`data`), through a path that answer does not have | the path the message lists the keys for — `p.data.plans`, not `p.data.landing.plans` |
|
|
203
205
|
| `plugin-attribute-reserved` | a plugin attribute named as one of the element’s own fields — a factory never hands it to the plugin | rename it in the plugin (`variant` → `kind`) |
|
|
204
206
|
| `provider-without-source` | an `apiContainer` that asks nothing | a `query` (or `action`, `connector`, `resource`) |
|
|
207
|
+
| `required-message-unused` | a `requiredMessage` on a field nothing requires — fields are optional unless `required: true`, so it is never shown and an empty answer is sent | `required: true` on the field, or no message |
|
|
205
208
|
| `route-param-undeclared` | `navigation.routeParams.x` read on a page whose slug has no `:x` — always empty | add `:x` to the slug, or read `navigation.queryParams.x` |
|
|
206
209
|
| `server-data-without-rsc` | a `runtime: 'server'` provider — `connector`, `action` or `query` — in a space that turns server data off (`rsc: { enabled: false }`) | drop `rsc: { enabled: false }`: server data is on unless a space turns it off |
|
|
207
210
|
| `span-holds-block` | a `container` with `subType: 'span'` or `'p'` holding a heading, a paragraph, a list, a form or prose | a `div` (leave `subType` out), or words and inline elements: a `text`, a `link` |
|
|
@@ -139,8 +139,10 @@ Every page is now its content and nothing else, and every page is guaranteed the
|
|
|
139
139
|
suggests writing your own (`not-found-page`): say it in the space's words.
|
|
140
140
|
- **A page that exists but finds nothing** — `/products/:slug` for a slug no product has — is sent with 404 too when
|
|
141
141
|
its server provider says so: `notFound: "{{ not (source.data.products|find('slug', navigation.routeParams.slug)) }}"`,
|
|
142
|
-
one expression against its answer, on a `runtime: 'server'` provider of the page
|
|
143
|
-
page shares
|
|
142
|
+
one expression against its answer, on a `runtime: 'server'` provider of the page. When the record comes from a
|
|
143
|
+
provider of its layout, which every page shares, the page says it: `notFound` on the page reads its server providers
|
|
144
|
+
by name — `"{{ not (apiContainer_feed.products|find('slug', navigation.routeParams.slug)) }}"`. The page renders as
|
|
145
|
+
written: show its "not found" part with `visible`.
|
|
144
146
|
|
|
145
147
|
## Styles follow the same rule
|
|
146
148
|
|
|
@@ -93,7 +93,9 @@ pages: [
|
|
|
93
93
|
|
|
94
94
|
Adding a page is adding an entry; two entries of one id or slug are refused as any two pages are. For one shape over
|
|
95
95
|
records a visitor browses — a product, a post — a single page with a route param (`slug: 'posts/:postId'`) reading
|
|
96
|
-
the record is the answer instead: one page, as many addresses as records.
|
|
96
|
+
the record is the answer instead: one page, as many addresses as records. Its `seoTitle` can say the record —
|
|
97
|
+
`'{{ apiContainer_post.title }} — Blog'` — read from a provider on the page with `runtime: 'server'`, or from
|
|
98
|
+
`navigation`: the server writes the head with it, so a link preview shows it. Anything else is refused (`page-template`).
|
|
97
99
|
|
|
98
100
|
## Names
|
|
99
101
|
|