@plitzi/sdk-authoring 0.38.8 → 0.38.9
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 +62 -0
- package/dist/index-src.js +474 -238
- package/dist/index.d.ts +54 -12
- package/dist/index.js +2 -2
- package/dist/node.d.ts +19 -0
- package/dist/node.js +10 -0
- package/package.json +6 -6
- package/skills/plitzi-authoring/recipes/detail-page.ts +4 -2
- package/skills/plitzi-authoring/reference/accessibility.md +2 -0
- package/skills/plitzi-authoring/reference/authoring-errors.md +3 -0
- package/skills/plitzi-authoring/reference/flows.md +2 -2
- package/skills/plitzi-authoring/reference/layouts.md +18 -0
- package/skills/plitzi-authoring/reference/recipes.md +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -411,6 +411,7 @@ export declare const apiContainer: {
|
|
|
411
411
|
method?: "get" | "post" | "put" | "delete" | "patch" | undefined;
|
|
412
412
|
resource?: string | undefined;
|
|
413
413
|
headers?: Record<string, string> | undefined;
|
|
414
|
+
notFound?: string | undefined;
|
|
414
415
|
subType?: "div" | "header" | "footer" | "nav" | "main" | "section" | "article" | "aside" | "address" | "figure" | "" | undefined;
|
|
415
416
|
query?: string | undefined;
|
|
416
417
|
accessToken?: string | undefined;
|
|
@@ -441,6 +442,7 @@ export declare const apiContainer: {
|
|
|
441
442
|
method?: "get" | "post" | "put" | "delete" | "patch" | undefined;
|
|
442
443
|
resource?: string | undefined;
|
|
443
444
|
headers?: Record<string, string> | undefined;
|
|
445
|
+
notFound?: string | undefined;
|
|
444
446
|
subType?: "div" | "header" | "footer" | "nav" | "main" | "section" | "article" | "aside" | "address" | "figure" | "" | undefined;
|
|
445
447
|
query?: string | undefined;
|
|
446
448
|
accessToken?: string | undefined;
|
|
@@ -1136,6 +1138,16 @@ export declare const AUTHORING_CODES: {
|
|
|
1136
1138
|
readonly means: "a `runtime: 'server'` element inside a component: the page server resolves a page's and its layouts', never a component's";
|
|
1137
1139
|
readonly fix: "put the provider on the page, around the instance, and hand the component its rows as a prop";
|
|
1138
1140
|
};
|
|
1141
|
+
readonly 'not-found-in-browser': {
|
|
1142
|
+
readonly kind: "refused";
|
|
1143
|
+
readonly means: "`notFound` on a provider asked from the browser — its answer arrives after the page was sent with its status";
|
|
1144
|
+
readonly fix: "`runtime: 'server'` on the provider, or `visible` on the page's \"not found\" part instead";
|
|
1145
|
+
};
|
|
1146
|
+
readonly 'not-found-not-a-template': {
|
|
1147
|
+
readonly kind: "refused";
|
|
1148
|
+
readonly means: "`notFound` that is not one `{{ expression }}` against the answer — never `true`, so never a 404";
|
|
1149
|
+
readonly fix: "`notFound: '{{ source.found == false }}'`";
|
|
1150
|
+
};
|
|
1139
1151
|
readonly 'server-data-in-browser': {
|
|
1140
1152
|
readonly kind: "refused";
|
|
1141
1153
|
readonly means: "a provider asking for the project's own data (`/data/…`, read by its server from `src/data/` and never served) from the browser";
|
|
@@ -1621,6 +1633,11 @@ export declare const AUTHORING_CODES: {
|
|
|
1621
1633
|
readonly means: "a colour written out in a class where the space has a token of that value — it stays put in the dark scheme";
|
|
1622
1634
|
readonly fix: "`var(--token)` when it should follow the scheme; a token of one value of its own when it must stay the same in both";
|
|
1623
1635
|
};
|
|
1636
|
+
readonly 'not-found-page': {
|
|
1637
|
+
readonly kind: "suggested";
|
|
1638
|
+
readonly means: "a space with no page of its own for an address no other page answers — a plain one was added, in the home page’s layout, sent with status 404";
|
|
1639
|
+
readonly fix: "a page whose slug is `'*'`: `{ id: 'not-found', name: 'Not found', slug: '*', layout: …, body: [...] }`";
|
|
1640
|
+
};
|
|
1624
1641
|
readonly 'unused-component': {
|
|
1625
1642
|
readonly kind: "suggested";
|
|
1626
1643
|
readonly means: "a component no page, layout or other component places";
|
|
@@ -1835,6 +1852,11 @@ export declare interface AuthorSpaceOptions {
|
|
|
1835
1852
|
* nothing.
|
|
1836
1853
|
*/
|
|
1837
1854
|
plugins?: readonly PluginDeclarationData[];
|
|
1855
|
+
/**
|
|
1856
|
+
* The CSS the space's pages load besides its own — its plugins' stylesheets. Read for the tokens they use: one only a
|
|
1857
|
+
* plugin reads (`var(--glass)` in its `.css`) is not said to be unused, which would have its colour deleted.
|
|
1858
|
+
*/
|
|
1859
|
+
stylesheets?: readonly string[];
|
|
1838
1860
|
/**
|
|
1839
1861
|
* What this document breaks ON PURPOSE — a fixture for how the runtime copes with something no author would write,
|
|
1840
1862
|
* like a provider whose URL names a route param no page has. See {@link AllowedBreak}.
|
|
@@ -2803,7 +2825,7 @@ export declare const elementAncestorTypes: Record<string, string>;
|
|
|
2803
2825
|
* a builder that has since moved on, and nothing renders it.
|
|
2804
2826
|
*/
|
|
2805
2827
|
export declare const elementAttributeNames: {
|
|
2806
|
-
readonly apiContainer: readonly ["accessToken", "action", "cache", "connector", "credentials", "endpoint", "filters", "gcTime", "headers", "input", "limit", "loadingSlot", "method", "mockData", "pageParam", "pagination", "query", "refreshSeconds", "renderWhileLoading", "resource", "singleRecord", "staleTime", "subType", "when"];
|
|
2828
|
+
readonly apiContainer: readonly ["accessToken", "action", "cache", "connector", "credentials", "endpoint", "filters", "gcTime", "headers", "input", "limit", "loadingSlot", "method", "mockData", "notFound", "pageParam", "pagination", "query", "refreshSeconds", "renderWhileLoading", "resource", "singleRecord", "staleTime", "subType", "when"];
|
|
2807
2829
|
readonly blockHtml: readonly ["content"];
|
|
2808
2830
|
readonly blockJsx: readonly ["allowEmptyRender", "content", "contentCache", "props"];
|
|
2809
2831
|
readonly button: readonly ["ariaExpanded", "ariaPressed", "content", "contentPlacement", "controls", "disabled", "icon", "iconPlacement", "label", "subType", "title"];
|
|
@@ -2823,7 +2845,7 @@ export declare const elementAttributeNames: {
|
|
|
2823
2845
|
readonly image: readonly ["alt", "decorative", "fetchPriority", "height", "loadMode", "resize", "sizes", "src", "width"];
|
|
2824
2846
|
readonly layoutContainer: readonly ["layout", "layoutContainer", "subType"];
|
|
2825
2847
|
readonly link: readonly ["content", "contentPlacement", "current", "hash", "href", "icon", "iconPlacement", "label", "mode", "target"];
|
|
2826
|
-
readonly list: readonly ["itemKey", "items", "source", "subType"];
|
|
2848
|
+
readonly list: readonly ["itemKey", "items", "label", "source", "subType"];
|
|
2827
2849
|
readonly listItem: readonly [];
|
|
2828
2850
|
readonly loading: readonly [];
|
|
2829
2851
|
readonly markdown: readonly ["content", "headingLinks"];
|
|
@@ -2840,7 +2862,7 @@ export declare const elementAttributeNames: {
|
|
|
2840
2862
|
readonly tabContainerBody: readonly [];
|
|
2841
2863
|
readonly tabContainerHeader: readonly [];
|
|
2842
2864
|
readonly tabContainerItem: readonly [];
|
|
2843
|
-
readonly text: readonly ["content", "title"];
|
|
2865
|
+
readonly text: readonly ["content", "decorative", "title"];
|
|
2844
2866
|
readonly themeToggle: readonly ["darkLabel", "lightLabel", "showSystem", "subType", "systemLabel"];
|
|
2845
2867
|
readonly video: readonly ["autoPlay", "loop", "muted", "playsInline", "src"];
|
|
2846
2868
|
};
|
|
@@ -3128,6 +3150,7 @@ declare const elementDeclarations: {
|
|
|
3128
3150
|
method?: "get" | "post" | "put" | "delete" | "patch" | undefined;
|
|
3129
3151
|
resource?: string | undefined;
|
|
3130
3152
|
headers?: Record<string, string> | undefined;
|
|
3153
|
+
notFound?: string | undefined;
|
|
3131
3154
|
subType?: "div" | "header" | "footer" | "nav" | "main" | "section" | "article" | "aside" | "address" | "figure" | "" | undefined;
|
|
3132
3155
|
query?: string | undefined;
|
|
3133
3156
|
accessToken?: string | undefined;
|
|
@@ -4539,7 +4562,7 @@ declare const elementDeclarations: {
|
|
|
4539
4562
|
readonly autoFocus: false;
|
|
4540
4563
|
readonly disabled: false;
|
|
4541
4564
|
readonly options: readonly [];
|
|
4542
|
-
readonly required:
|
|
4565
|
+
readonly required: false;
|
|
4543
4566
|
readonly requiredMessage: "";
|
|
4544
4567
|
readonly minLength: 0;
|
|
4545
4568
|
readonly minLengthMessage: "";
|
|
@@ -5719,6 +5742,7 @@ declare const elementDeclarations: {
|
|
|
5719
5742
|
readonly initialItems: readonly ["listItem", "listItem", "listItem"];
|
|
5720
5743
|
} & ElementAttributesBrand<Partial<{
|
|
5721
5744
|
source?: "none" | "controlled" | undefined;
|
|
5745
|
+
label?: string | undefined;
|
|
5722
5746
|
items?: unknown[] | undefined;
|
|
5723
5747
|
subType?: "ul" | "ol" | undefined;
|
|
5724
5748
|
itemKey?: string | undefined;
|
|
@@ -7169,6 +7193,7 @@ declare const elementDeclarations: {
|
|
|
7169
7193
|
} & ElementAttributesBrand<Partial<{
|
|
7170
7194
|
title?: string | undefined;
|
|
7171
7195
|
content?: string | number | undefined;
|
|
7196
|
+
decorative?: boolean | undefined;
|
|
7172
7197
|
}>>;
|
|
7173
7198
|
readonly ThemeToggle: {
|
|
7174
7199
|
readonly type: "themeToggle";
|
|
@@ -7824,15 +7849,17 @@ export declare const embed: {
|
|
|
7824
7849
|
}>> | undefined): ElementSpec;
|
|
7825
7850
|
};
|
|
7826
7851
|
|
|
7852
|
+
export declare const emptySpaceSpec: SpaceSpec;
|
|
7853
|
+
|
|
7827
7854
|
/**
|
|
7828
|
-
* The space `plitzi create --template blank` starts from, as
|
|
7829
|
-
* project about to be something specific, where the welcome tour is the first thing that would be deleted
|
|
7855
|
+
* The space `plitzi create --template blank` starts from, as its files by path: tokens, a layout and one empty page —
|
|
7856
|
+
* for a project about to be something specific, where the welcome tour is the first thing that would be deleted —
|
|
7857
|
+
* and the page for an address nothing answers, beside it.
|
|
7830
7858
|
*/
|
|
7831
|
-
export declare const
|
|
7859
|
+
export declare const emptyTemplateFiles: ({ name, dir }?: {
|
|
7832
7860
|
name?: string;
|
|
7833
|
-
|
|
7834
|
-
|
|
7835
|
-
export declare const emptySpaceSpec: SpaceSpec;
|
|
7861
|
+
dir?: string;
|
|
7862
|
+
}) => Record<string, string>;
|
|
7836
7863
|
|
|
7837
7864
|
/**
|
|
7838
7865
|
* Expand supported CSS shorthands to their longhand keys, in declaration order: the later declaration wins, as it
|
|
@@ -8103,6 +8130,7 @@ declare type FormControlProps = {
|
|
|
8103
8130
|
label: string;
|
|
8104
8131
|
value: string;
|
|
8105
8132
|
}[];
|
|
8133
|
+
/** Optional unless it says so, as an HTML field is: a required field left empty stops the submit. */
|
|
8106
8134
|
required: boolean;
|
|
8107
8135
|
/**
|
|
8108
8136
|
* The rules a value has to meet before the form submits, checked by the form at submit time and by the control when
|
|
@@ -9471,7 +9499,7 @@ export declare interface PageIssue {
|
|
|
9471
9499
|
}
|
|
9472
9500
|
|
|
9473
9501
|
/** What kind of problem a page check found: what a tool branches on, where `message` is what a person reads. */
|
|
9474
|
-
export declare type PageIssueCode = 'not-rendered' | 'element-missing' | 'element-hidden' | 'image-not-loaded' | 'sideways-scroll' | 'illegible-text';
|
|
9502
|
+
export declare type PageIssueCode = 'not-rendered' | 'element-missing' | 'element-hidden' | 'image-not-loaded' | 'sideways-scroll' | 'cut-off' | 'illegible-text';
|
|
9475
9503
|
|
|
9476
9504
|
/**
|
|
9477
9505
|
* Runs in the page that was pictured: its parts, where they are on the full page — its landmarks (header, nav, main,
|
|
@@ -9930,6 +9958,11 @@ export declare interface ProbeFindings {
|
|
|
9930
9958
|
widest: string[];
|
|
9931
9959
|
elementIds: string[];
|
|
9932
9960
|
} | null;
|
|
9961
|
+
/** A link, a control or words of the space's cut at the screen's edge — by how many pixels fall outside it. */
|
|
9962
|
+
cutOff: {
|
|
9963
|
+
id: string;
|
|
9964
|
+
pixels: number;
|
|
9965
|
+
}[];
|
|
9933
9966
|
illegible: {
|
|
9934
9967
|
text: string;
|
|
9935
9968
|
elementId?: string;
|
|
@@ -11452,6 +11485,8 @@ declare const styleConstants: {
|
|
|
11452
11485
|
readonly TEXT_INDENT: "text-indent";
|
|
11453
11486
|
readonly TEXT_TRANSFORM: "text-transform";
|
|
11454
11487
|
readonly DIRECTION: "direction";
|
|
11488
|
+
readonly WRITING_MODE: "writing-mode";
|
|
11489
|
+
readonly TEXT_ORIENTATION: "text-orientation";
|
|
11455
11490
|
readonly WHITE_SPACE: "white-space";
|
|
11456
11491
|
readonly TEXT_WRAP: "text-wrap";
|
|
11457
11492
|
readonly WORD_BREAK: "word-break";
|
|
@@ -11613,6 +11648,10 @@ export declare type SuggestionCode = {
|
|
|
11613
11648
|
export declare const suggestSpace: ({ schema, style }: {
|
|
11614
11649
|
schema: Schema;
|
|
11615
11650
|
style: Style;
|
|
11651
|
+
},
|
|
11652
|
+
/** The CSS the pages load besides the space's own — its plugins' stylesheets: a token read there is read. */
|
|
11653
|
+
{ stylesheets }?: {
|
|
11654
|
+
stylesheets?: readonly string[];
|
|
11616
11655
|
}) => Suggestion[];
|
|
11617
11656
|
|
|
11618
11657
|
/** The closest known transformer action to a mistyped one (substring match either way), so a wrong action like
|
|
@@ -11663,6 +11702,7 @@ export declare type TemplateReturns = 'text' | 'value';
|
|
|
11663
11702
|
export declare const text: ElementFactory<Partial<{
|
|
11664
11703
|
title?: string | undefined;
|
|
11665
11704
|
content?: string | number | undefined;
|
|
11705
|
+
decorative?: boolean | undefined;
|
|
11666
11706
|
}>>;
|
|
11667
11707
|
|
|
11668
11708
|
export declare interface TextComparison {
|
|
@@ -11908,7 +11948,9 @@ export declare const unrollPage: () => number;
|
|
|
11908
11948
|
* What a space declares and nothing uses — its classes, tokens and components — by the one rule the suggestions, the
|
|
11909
11949
|
* builder's Usages panel and anything else that says "unused" read, so they never disagree.
|
|
11910
11950
|
*/
|
|
11911
|
-
export declare const unusedDeclarations: (schema: Schema, style: Declared
|
|
11951
|
+
export declare const unusedDeclarations: (schema: Schema, style: Declared,
|
|
11952
|
+
/** The CSS the pages load besides the space's own — its plugins' stylesheets — whose `var(--…)` read tokens too. */
|
|
11953
|
+
stylesheets?: readonly string[]) => {
|
|
11912
11954
|
classes: string[];
|
|
11913
11955
|
tokens: string[];
|
|
11914
11956
|
components: string[];
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as GLOBAL_CALLBACK_BUILDERS, $i as AUTHORING_CODES, $n as setState, $r as container, $t as isCssProperty, A as unrollPage, Ai as defaultLabel, An as whenFailed, Ar as onScroll, At as className, B as blankSpace, Bi as groupBindings, Bn as authLogout, Br as setFieldValue, Bt as css, C as pageTexts, Ca as c, Ci as tabContainerHeader, Cn as authoringCodesTable, Cr as onFlowError, Ct as unusedDeclarations, D as pageRegions, Da as t, Di as video, Dn as flowStepIds, Dr as onLoad, Dt as column, E as diffPictures, Ea as s$1, Ei as themeToggle, En as authorFlows, Er as onKey, Et as tw, F as readDevTools, Fi as GLOBAL_SOURCES, Fn as getUtility, Fr as reloadApi, Ft as modifierClassName, G as space$1, Gi as variantFrom, Gn as cycleState, Gt as cssShorthands, H as catalogTemplateFiles, Hi as hiddenWhen, Hn as cancelServerAction, Hr as updateElement, Ht as sameBlocks, I as readDevToolsInPage, Ii as activeOn, In as SET_STATE_TYPES, Ir as resetForm, It as splitClassList, J as importSlug, Ji as actionSource, Jn as invalidateQueries, Jr as blockJsx, Jt as expandShorthandTraced, K as space, Ki as visibleWhen, Kn as delay, Kr as apiContainer, Kt as expandShorthand, L as dataIssues, Li as activeWhen, Ln as addNotification, Lr as scrollBy, Lt as styles, M as inspectPage, Mi as element, Mn as whileRunning, Mr as openDialog, Mt as classRefs, N as onScreen, Ni as inferredLinkMode, Nn as BUILTIN_UTILITIES, Nr as openModal, Nt as isClassModifier, O as profilePictures, Oi as component, On as named, Or as onPageLoad, Ot as grid, P as failedFlowText, Pi as COMPONENT_SOURCES, Pn as applyUtility, Pr as publishOn, Pt as isStyleDeclaration, Q as EXPLAIN_KINDS, Qi as scope, Qn as runServerAction, Qr as channel, Qt as cssPropertyName, R as answerAction, Ri as authorBinding, Rn as appendState, Rr as scrollIntoView, Rt as BREAKPOINTS, S as compareTexts, Sa as s, Si as tabContainerBody, Sn as flagSpecOf, Sr as onFlowEnd, St as suggestClassOverrides, T as comparePictures, Ta as r$1, Ti as text, Tn as authorFlow, Tr as onInterval, Tt as createTw, U as
|
|
2
|
-
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$1 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, 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, delay, dialogContainer, diffPictures, digest, dropdown, dropdownPopup, element, elementAncestorTypes, elementAttributeNames, elementAttributeValues, elementCallbacks, elementCatalog, t$2 as elementDeclaration, elementDefaultAttributes, elementLeafTypes, elementPartTypes, elementSlots, elementSourceTypes, elementTriggers, elementTypeNames, elementsFromManifest, embed,
|
|
1
|
+
import { $ as GLOBAL_CALLBACK_BUILDERS, $i as AUTHORING_CODES, $n as setState, $r as container, $t as isCssProperty, A as unrollPage, Ai as defaultLabel, An as whenFailed, Ar as onScroll, At as className, B as blankSpace, Bi as groupBindings, Bn as authLogout, Br as setFieldValue, Bt as css, C as pageTexts, Ca as c, Ci as tabContainerHeader, Cn as authoringCodesTable, Cr as onFlowError, Ct as unusedDeclarations, D as pageRegions, Da as t, Di as video, Dn as flowStepIds, Dr as onLoad, Dt as column, E as diffPictures, Ea as s$1, Ei as themeToggle, En as authorFlows, Er as onKey, Et as tw, F as readDevTools, Fi as GLOBAL_SOURCES, Fn as getUtility, Fr as reloadApi, Ft as modifierClassName, G as space$1, Gi as variantFrom, Gn as cycleState, Gt as cssShorthands, H as catalogTemplateFiles, Hi as hiddenWhen, Hn as cancelServerAction, Hr as updateElement, Ht as sameBlocks, I as readDevToolsInPage, Ii as activeOn, In as SET_STATE_TYPES, Ir as resetForm, It as splitClassList, J as importSlug, Ji as actionSource, Jn as invalidateQueries, Jr as blockJsx, Jt as expandShorthandTraced, K as space, Ki as visibleWhen, Kn as delay, Kr as apiContainer, Kt as expandShorthand, L as dataIssues, Li as activeWhen, Ln as addNotification, Lr as scrollBy, Lt as styles, M as inspectPage, Mi as element, Mn as whileRunning, Mr as openDialog, Mt as classRefs, N as onScreen, Ni as inferredLinkMode, Nn as BUILTIN_UTILITIES, Nr as openModal, Nt as isClassModifier, O as profilePictures, Oi as component, On as named, Or as onPageLoad, Ot as grid, P as failedFlowText, Pi as COMPONENT_SOURCES, Pn as applyUtility, Pr as publishOn, Pt as isStyleDeclaration, Q as EXPLAIN_KINDS, Qi as scope, Qn as runServerAction, Qr as channel, Qt as cssPropertyName, R as answerAction, Ri as authorBinding, Rn as appendState, Rr as scrollIntoView, Rt as BREAKPOINTS, S as compareTexts, Sa as s, Si as tabContainerBody, Sn as flagSpecOf, Sr as onFlowEnd, St as suggestClassOverrides, T as comparePictures, Ta as r$1, Ti as text, Tn as authorFlow, Tr as onInterval, Tt as createTw, U as emptyTemplateFiles, Ui as resolveSource, Un as clearState, Ur as elementsFromManifest, Ut as toBlocks, V as blankTemplateFiles, Vi as hasVisibilityBinding, Vn as authRefreshDetails, Vr as toggleElement, Vt as isRuleSetSpec, W as toPortableSource, Wi as toBindingSpecs, Wn as copyToClipboard, Wr as withPluginCatalogs, Wt as toResponsive, X as importProbe, Xi as twig, Xn as navigate, Xr as carousel, Xt as cssNumberValue, Y as importedFiles, Yi as source, Yn as moveState, Yr as button, Yt as shorthandLonghands, Z as BUILDER_NAMES, Zi as closest, Zn as removeState, Zr as carouselTrack, Zt as cssProperties, _ as shortcutKey, _a as t$2, _i as paragraph, _n as instanceSelectorFor, _r as closeModal, _t as assertSnippetValid, a as locateClasses, aa as elementCallbacks, ai as fontAwesome, an as notificationsCss, ar as BUILTIN_GLOBAL_CALLBACKS, at as SPACE_FIELDS, b as summariseRenders, ba as i$1, bi as svg, bn as selectorFor, br as on, bt as suggestSpace, c as validateSnippet, ca as elementLeafTypes, ci as heading, cn as i, cr as e, ct as specFromSpace, d as i$2, da as elementSourceTypes, di as list, dn as r, dr as carouselGoTo, dt as actionToSource, ea as AuthoringError, ei as custom, en as isCustomProperty, er as stepState, et as explain, f as o$1, fa as elementTriggers, fi as listItem, fn as t$1, fr as carouselNext, ft as withNamedIds, g as pressShortcut, ga as e$1, gi as pagination, gn as buildHandles, gr as closeDialog, gt as transformerCatalog, h as withElement, ha as typeTriggerDefinitions, hi as nodeHtml, hn as slugify, hr as carouselPrevious, ht as suggestTransformer, i as lintSpace, ia as elementAttributeValues, ii as embed, in as pageFamily, ir as webHook, it as ELEMENT_FIELDS, j as inspectDocument, ji as defineElement, jn as whenSucceeded, jr as onSubmit, jt as classNames, k as loadImages, ki as defaultAttributes, kn as when, kr as onPointerDown, kt as row, l as validateSpace, la as elementPartTypes, li as image, ln as FIXABLE_CODES, lr as announceOn, lt as compareSpaces, m as singlePageSpace, ma as typeCallbackDefinitions, mi as modalContainer, mn as digest, mr as carouselPlay, mt as getTransformer, n as authorSpace, na as isSuggestionCode, ni as dropdown, nn as SpaceRefusedError, nr as toggleState, nt as explainList, o as locateElements, oa as elementCatalog, oi as form, on as withNotificationsCss, or as applyBuiltinCallback, ot as specToSource, p as compactSvg, pa as elementTypeNames, pi as markdown, pr as carouselPause, pt as BUILTIN_TRANSFORMERS, q as darkScheme, qi as withVisibility, qn as hostAction, qr as blockHtml, qt as expandShorthandPatch, r as fixSpace, ra as elementAncestorTypes, ri as dropdownPopup, rn as refusalOf, rr as twigTemplate, rt as explanationText, s as planFixes, sa as elementDefaultAttributes, si as formControl, sn as d, sr as getGlobalCallback, st as SCHEMA_SETTINGS, t as authorSnippet, ta as authoringCodeEntry, ti as dialogContainer, tn as suggestCssProperty, tr as toggleInState, tt as explainKindOf, u as a$1, ua as elementSlots, ui as link, un as n, ur as cancelApi, ut as actionSpecFromEntry, v as openPage, va as elementAttributeNames, vi as reference, vn as locate, vr as declaredCallback, vt as PAGE_SPEC_FIELDS, w as alignPictures, wa as n$1, wi as tabContainerItem, wn as defineAction, wr as onFlowProgress, wt as tokens, x as PAGE_TEXT_LIMIT, xa as o, xi as tabContainer, xn as flagGateOf, xr as onClick, xt as withoutQuieted, y as inspectRenders, ya as a, yi as richText, yn as pathForSlug, yr as declaredTrigger, yt as assertSpaceValid, z as CATALOG_TEMPLATE_IDENTITY, zi as bindTemplate, zn as authLogin, zr as scrollTo, zt as STYLE_STATES } from "./index-src.js";
|
|
2
|
+
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$1 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, 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, delay, dialogContainer, diffPictures, digest, dropdown, dropdownPopup, element, elementAncestorTypes, elementAttributeNames, elementAttributeValues, elementCallbacks, elementCatalog, t$2 as elementDeclaration, elementDefaultAttributes, elementLeafTypes, elementPartTypes, elementSlots, elementSourceTypes, elementTriggers, elementTypeNames, elementsFromManifest, embed, space$1 as emptySpaceSpec, emptyTemplateFiles, expandShorthand, expandShorthandPatch, expandShorthandTraced, explain, explainKindOf, explainList, explanationText, failedFlowText, 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, isCssProperty, isCustomProperty, isRuleSetSpec, isStyleDeclaration, isSuggestionCode, link, lintSpace, list, listItem, loadImages, locate, locateClasses, locateElements, markdown, r$1 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, pressShortcut, profilePictures, publishOn, readDevTools, readDevToolsInPage, c as reconcileParams, reference, refusalOf, reloadApi, removeState, resetForm, resolveSource, richText, row, runServerAction, 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, text, themeToggle, toBindingSpecs, toBlocks, i$2 as toBuilderParams, a$1 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
|
@@ -545,6 +545,16 @@ declare const AUTHORING_CODES: {
|
|
|
545
545
|
readonly means: "a `runtime: 'server'` element inside a component: the page server resolves a page's and its layouts', never a component's";
|
|
546
546
|
readonly fix: "put the provider on the page, around the instance, and hand the component its rows as a prop";
|
|
547
547
|
};
|
|
548
|
+
readonly 'not-found-in-browser': {
|
|
549
|
+
readonly kind: "refused";
|
|
550
|
+
readonly means: "`notFound` on a provider asked from the browser — its answer arrives after the page was sent with its status";
|
|
551
|
+
readonly fix: "`runtime: 'server'` on the provider, or `visible` on the page's \"not found\" part instead";
|
|
552
|
+
};
|
|
553
|
+
readonly 'not-found-not-a-template': {
|
|
554
|
+
readonly kind: "refused";
|
|
555
|
+
readonly means: "`notFound` that is not one `{{ expression }}` against the answer — never `true`, so never a 404";
|
|
556
|
+
readonly fix: "`notFound: '{{ source.found == false }}'`";
|
|
557
|
+
};
|
|
548
558
|
readonly 'server-data-in-browser': {
|
|
549
559
|
readonly kind: "refused";
|
|
550
560
|
readonly means: "a provider asking for the project's own data (`/data/…`, read by its server from `src/data/` and never served) from the browser";
|
|
@@ -1030,6 +1040,11 @@ declare const AUTHORING_CODES: {
|
|
|
1030
1040
|
readonly means: "a colour written out in a class where the space has a token of that value — it stays put in the dark scheme";
|
|
1031
1041
|
readonly fix: "`var(--token)` when it should follow the scheme; a token of one value of its own when it must stay the same in both";
|
|
1032
1042
|
};
|
|
1043
|
+
readonly 'not-found-page': {
|
|
1044
|
+
readonly kind: "suggested";
|
|
1045
|
+
readonly means: "a space with no page of its own for an address no other page answers — a plain one was added, in the home page’s layout, sent with status 404";
|
|
1046
|
+
readonly fix: "a page whose slug is `'*'`: `{ id: 'not-found', name: 'Not found', slug: '*', layout: …, body: [...] }`";
|
|
1047
|
+
};
|
|
1033
1048
|
readonly 'unused-component': {
|
|
1034
1049
|
readonly kind: "suggested";
|
|
1035
1050
|
readonly means: "a component no page, layout or other component places";
|
|
@@ -1940,6 +1955,7 @@ export declare const pluginDeclarations: (folder: string | URL) => Promise<Plugi
|
|
|
1940
1955
|
export declare type ProjectAuthoring = {
|
|
1941
1956
|
plugins: PluginDeclarationData[];
|
|
1942
1957
|
pluginTypes: string[];
|
|
1958
|
+
stylesheets: string[];
|
|
1943
1959
|
serverData?: (query: string) => unknown;
|
|
1944
1960
|
data: (query: string) => unknown;
|
|
1945
1961
|
};
|
|
@@ -1950,6 +1966,7 @@ export declare type ProjectAuthoring = {
|
|
|
1950
1966
|
*
|
|
1951
1967
|
* - `plugins`: every plugin folder's declaration (`src/plugins/<Name>/declaration.ts`, `pluginDeclarations`);
|
|
1952
1968
|
* - `pluginTypes`: the element types of the plugins it runs as they were built (`vendor/plugins/`);
|
|
1969
|
+
* - `stylesheets`: its plugins' own CSS, every `.css` under `src/plugins/`, for the tokens they read;
|
|
1953
1970
|
* - `serverData`: the project's own data, which only its server reads (`src/data/`, `projectData`) — a server-mode
|
|
1954
1971
|
* project's; one with no server has no such folder, and its providers read `public/data/` from the browser;
|
|
1955
1972
|
* - `data`: the JSON files it serves (`public/`, `publicData`).
|
|
@@ -2741,6 +2758,8 @@ declare const styleConstants: {
|
|
|
2741
2758
|
readonly TEXT_INDENT: "text-indent";
|
|
2742
2759
|
readonly TEXT_TRANSFORM: "text-transform";
|
|
2743
2760
|
readonly DIRECTION: "direction";
|
|
2761
|
+
readonly WRITING_MODE: "writing-mode";
|
|
2762
|
+
readonly TEXT_ORIENTATION: "text-orientation";
|
|
2744
2763
|
readonly WHITE_SPACE: "white-space";
|
|
2745
2764
|
readonly TEXT_WRAP: "text-wrap";
|
|
2746
2765
|
readonly WORD_BREAK: "word-break";
|
package/dist/node.js
CHANGED
|
@@ -575,11 +575,20 @@ var builtPluginTypes = (folder) => existsSync(folder) ? readdirSync(folder, { wi
|
|
|
575
575
|
return [entry.name, ...e(pluginSchema) ? Object.keys(pluginSchema) : []];
|
|
576
576
|
}) : [];
|
|
577
577
|
/**
|
|
578
|
+
* The stylesheets of the plugins under `folder` — every `.css` in a plugin's folder, at any depth — as their text, for
|
|
579
|
+
* `authorSpace`'s `stylesheets`: the tokens a plugin's own CSS reads are tokens the space uses.
|
|
580
|
+
*/
|
|
581
|
+
var pluginStylesheets = (folder) => existsSync(folder) ? readdirSync(folder, {
|
|
582
|
+
recursive: true,
|
|
583
|
+
withFileTypes: true
|
|
584
|
+
}).filter((entry) => entry.isFile() && entry.name.endsWith(".css")).map((entry) => m.join(entry.parentPath, entry.name)).sort().map((file) => readFileSync(file, "utf-8")) : [];
|
|
585
|
+
/**
|
|
578
586
|
* What `authorSpace` checks the space of a project `@plitzi/cli` writes against, read from the project the process runs
|
|
579
587
|
* — so its server, `npm run author` and the CLI's checks hold the space to the same thing:
|
|
580
588
|
*
|
|
581
589
|
* - `plugins`: every plugin folder's declaration (`src/plugins/<Name>/declaration.ts`, `pluginDeclarations`);
|
|
582
590
|
* - `pluginTypes`: the element types of the plugins it runs as they were built (`vendor/plugins/`);
|
|
591
|
+
* - `stylesheets`: its plugins' own CSS, every `.css` under `src/plugins/`, for the tokens they read;
|
|
583
592
|
* - `serverData`: the project's own data, which only its server reads (`src/data/`, `projectData`) — a server-mode
|
|
584
593
|
* project's; one with no server has no such folder, and its providers read `public/data/` from the browser;
|
|
585
594
|
* - `data`: the JSON files it serves (`public/`, `publicData`).
|
|
@@ -606,6 +615,7 @@ var projectAuthoringAt = async (root) => {
|
|
|
606
615
|
return {
|
|
607
616
|
plugins: await pluginDeclarations(m.join(at, o$1)),
|
|
608
617
|
pluginTypes: builtPluginTypes(m.join(at, u)),
|
|
618
|
+
stylesheets: pluginStylesheets(m.join(at, o$1)),
|
|
609
619
|
...existsSync(serverData) ? { serverData: projectData(serverData) } : {},
|
|
610
620
|
data: publicData(m.join(at, p))
|
|
611
621
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plitzi/sdk-authoring",
|
|
3
|
-
"version": "0.38.
|
|
3
|
+
"version": "0.38.9",
|
|
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.9",
|
|
58
|
+
"@plitzi/sdk-interactions": "0.38.9",
|
|
59
|
+
"@plitzi/sdk-schema": "0.38.9",
|
|
60
|
+
"@plitzi/sdk-shared": "0.38.9",
|
|
61
|
+
"@plitzi/sdk-style": "0.38.9",
|
|
62
62
|
"@types/react": "^19.3.0",
|
|
63
63
|
"eslint": "^9.39.5",
|
|
64
64
|
"prettier": "^3.9.9",
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/* eslint-disable quotes -- templates quote their own strings, and read best in the other quotes */
|
|
2
2
|
/**
|
|
3
3
|
* A page per record: a card links to `/products/<slug>`, and the detail page narrows the same file to the product its
|
|
4
|
-
* address names — with a message, not an empty page, when no product has that name
|
|
4
|
+
* address names — with a message, not an empty page, when no product has that name, and status 404: the provider is
|
|
5
|
+
* resolved on the server, and `notFound` says when its answer holds nothing for this address.
|
|
5
6
|
*/
|
|
6
7
|
import { apiContainer, heading, link, list, text, listItem } from '@plitzi/sdk-authoring';
|
|
7
8
|
|
|
@@ -48,7 +49,8 @@ export const recipe: SpaceSpec = {
|
|
|
48
49
|
apiContainer({
|
|
49
50
|
id: 'catalog-one',
|
|
50
51
|
query: '/data/products.json',
|
|
51
|
-
|
|
52
|
+
runtime: 'server',
|
|
53
|
+
notFound: "{{ not (source.data.products|find('slug', navigation.routeParams.slug)) }}",
|
|
52
54
|
children: [
|
|
53
55
|
list({
|
|
54
56
|
id: 'this-product',
|
|
@@ -38,6 +38,8 @@ image({ src: '/grain.png', decorative: true }) // an orname
|
|
|
38
38
|
image({ decorative: true, bind: { src: 'post.record.cover' } }) // a cover under its own headline adds nothing
|
|
39
39
|
image({ bind: { src: 'row.item.cover', alt: 'row.item.title' } }) // …unless it is alone in a link: then it names it
|
|
40
40
|
fontAwesome({ icon: 'fa-solid fa-triangle-exclamation', label: 'Overdue' }) // an icon that says something alone
|
|
41
|
+
text('福', { decorative: true }) // a seal or a mark drawn for the look alone
|
|
42
|
+
list({ label: 'Kinds of capsule', … }) // a group of options is named, as a group
|
|
41
43
|
```
|
|
42
44
|
|
|
43
45
|
## Clicks go on controls
|
|
@@ -101,6 +101,8 @@ The space is not written until these are fixed.
|
|
|
101
101
|
| `motion-invalid` | a `motion` with a preset, a trigger or a timing the page cannot play | `motion: { enter: 'fade-up', on: 'view' }` — the message lists the presets |
|
|
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
|
+
| `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` that is not one `{{ expression }}` against the answer — never `true`, so never a 404 | `notFound: '{{ source.found == false }}'` |
|
|
104
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' |
|
|
105
107
|
| `outside-ancestor` | an element that reads the state of an element it is not inside | nest it in the element the message names |
|
|
106
108
|
| `page-access-level` | an `accessLevel` that is not one the router reads | one of the values the message lists |
|
|
@@ -229,6 +231,7 @@ Nothing is wrong: the page renders as written. Each is a shorter way to the same
|
|
|
229
231
|
| `custom-css-slot` | a part of a built-in element dressed in `customCss` by the SDK's markup — a form control's `<input>`, a pager's buttons, a heading inside a markdown | a class on the slot of that part — `slots: { field: input }`, `elements.<type>.slots` — with its states |
|
|
230
232
|
| `heavy-animation` | keyframes animating what the browser repaints or lays out again on every frame — a size, a position, a blur, a shadow, or a colour in a loop — which stutters whenever the page is busy, most of all while it loads | `opacity` and `transform`: a size or a position is `translate`/`scale`, a blur or a shadow is the `opacity` of a layer carrying it; a loop that must animate anything else starts `paused` and runs under `[data-hydrated]` |
|
|
231
233
|
| `literal-colour` | a colour written out in a class where the space has a token of that value — it stays put in the dark scheme | `var(--token)` when it should follow the scheme; a token of one value of its own when it must stay the same in both |
|
|
234
|
+
| `not-found-page` | a space with no page of its own for an address no other page answers — a plain one was added, in the home page’s layout, sent with status 404 | a page whose slug is `'*'`: `{ id: 'not-found', name: 'Not found', slug: '*', layout: …, body: [...] }` |
|
|
232
235
|
| `repeated-on-pages` | the same block — a header, a footer, a side panel — written into several pages | a layout holding it once (`layouts`, and `layout: { id, slot }` on each page) — a component when only some pages of a layout carry it; a link marks its own page with the `current` state |
|
|
233
236
|
| `repeated-shape` | the same structure written again and again with different words — cards, rows, tiles | a component with props (`components`, `component(id, { props })`), or one `list` when they are rows of data side by side — a few cards a person rewords on the canvas can stay cards |
|
|
234
237
|
| `unused-class` | a class declared in `classes` that no element, binding, flow or other class names | remove it from `classes` — or wear it where it was meant to go |
|
|
@@ -131,8 +131,8 @@ form({
|
|
|
131
131
|
});
|
|
132
132
|
```
|
|
133
133
|
|
|
134
|
-
A `formControl` is `required
|
|
135
|
-
|
|
134
|
+
A `formControl` is optional unless it says `required: true`, as an HTML field is. A required field that is empty stops
|
|
135
|
+
the submit, and the browser says which.
|
|
136
136
|
|
|
137
137
|
## Notifications
|
|
138
138
|
|
|
@@ -124,6 +124,24 @@ pages: pageFamily(
|
|
|
124
124
|
|
|
125
125
|
Every page is now its content and nothing else, and every page is guaranteed the same structure.
|
|
126
126
|
|
|
127
|
+
## The page for an address nothing answers
|
|
128
|
+
|
|
129
|
+
```ts
|
|
130
|
+
{ id: 'not-found', name: 'Not found', slug: '*', layout: { id: 'site', slot: 'site-main' }, body: [ … ] }
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
- **`slug: '*'`** is the page of every address no other page answers — a mistyped link, a page taken down — sent with
|
|
134
|
+
status 404, in the layout you give it, so the visitor is still on the site with a way back. Its own address answers
|
|
135
|
+
404 too.
|
|
136
|
+
- **One per folder, if a section wants its own.** In a folder (`folder: 'docs'`) it answers that folder's unknown
|
|
137
|
+
addresses; the deepest folder's wins, the space's takes the rest. A page whose `flag` is off shows it too.
|
|
138
|
+
- **A space with none is given a plain one** — a title and a link home, in the home page's layout — and `author`
|
|
139
|
+
suggests writing your own (`not-found-page`): say it in the space's words.
|
|
140
|
+
- **A page that exists but finds nothing** — `/products/:slug` for a slug no product has — is sent with 404 too when
|
|
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 (not of its layout, which every
|
|
143
|
+
page shares). The page renders as written: show its "not found" part with `visible`.
|
|
144
|
+
|
|
127
145
|
## Styles follow the same rule
|
|
128
146
|
|
|
129
147
|
- A role used on several pages is ONE class (`panelCard`, `pageTitle`), declared in the module that owns the area and
|
|
@@ -9,7 +9,7 @@ Each is a whole file that authors with no warning — CI holds it to that. Copy
|
|
|
9
9
|
| Data read by the page server (`--mode server`) | [recipes/server-data.ts](../recipes/server-data.ts) |
|
|
10
10
|
| An accordion, one answer open at a time | [recipes/accordion.ts](../recipes/accordion.ts) |
|
|
11
11
|
| Filter and sort a list from a select | [recipes/filter-a-list.ts](../recipes/filter-a-list.ts) |
|
|
12
|
-
| A page per record (`/products/:slug`), and "not found" | [recipes/detail-page.ts](../recipes/detail-page.ts) |
|
|
12
|
+
| A page per record (`/products/:slug`), and "not found" sent with 404 | [recipes/detail-page.ts](../recipes/detail-page.ts) |
|
|
13
13
|
| Link to a section of a page (`/#plans`) | [recipes/link-to-a-section.ts](../recipes/link-to-a-section.ts) |
|
|
14
14
|
| A carousel: slides with arrows, dots and autoplay; a marquee; a row that swipes | [recipes/carousel.ts](../recipes/carousel.ts) |
|
|
15
15
|
| Do something every few seconds — a ticker, a poll, a slideshow by hand | [recipes/every-few-seconds.ts](../recipes/every-few-seconds.ts) |
|