@plitzi/sdk-server 0.38.24 → 0.39.1
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 +162 -1
- package/README.md +55 -9
- package/dist/actions.d.ts +4 -1
- package/dist/actions.js +3 -2
- package/dist/auth.d.ts +2 -2
- package/dist/auth.js +5 -4
- package/dist/core/auth/api/accounts.d.ts +11 -0
- package/dist/core/auth/api/accounts.js +175 -0
- package/dist/core/auth/api/admin.d.ts +41 -0
- package/dist/core/auth/api/admin.js +146 -0
- package/dist/core/auth/api/context.d.ts +119 -0
- package/dist/core/auth/api/context.js +262 -0
- package/dist/core/auth/api/factors.d.ts +31 -0
- package/dist/core/auth/api/factors.js +209 -0
- package/dist/core/auth/api/index.d.ts +94 -0
- package/dist/core/auth/api/index.js +43 -0
- package/dist/core/auth/api/profile.d.ts +43 -0
- package/dist/core/auth/api/profile.js +243 -0
- package/dist/core/auth/api/session.d.ts +62 -0
- package/dist/core/auth/api/session.js +312 -0
- package/dist/core/auth/{api.d.ts → api/types.d.ts} +41 -195
- package/dist/core/auth/api/values.d.ts +67 -0
- package/dist/core/auth/api/values.js +90 -0
- package/dist/core/auth/createAuth.d.ts +49 -39
- package/dist/core/auth/createAuth.js +21 -1
- package/dist/core/auth/oauth/client.d.ts +2 -2
- package/dist/core/auth/oauth/client.js +6 -1
- package/dist/core/auth/oauth/index.d.ts +30 -7
- package/dist/core/auth/oauth/index.js +33 -14
- package/dist/core/auth/oauth/providers/github.js +1 -1
- package/dist/core/auth/oauth/providers/google.js +1 -1
- package/dist/core/auth/oauth/providers/oidc.d.ts +40 -0
- package/dist/core/auth/oauth/providers/oidc.js +197 -0
- package/dist/core/auth/oauth/state.d.ts +2 -0
- package/dist/core/auth/oauth/state.js +2 -0
- package/dist/core/auth/oauth/types.d.ts +21 -3
- package/dist/core/auth/oauth/types.js +4 -1
- package/dist/core/auth/routes.js +1 -1
- package/dist/core/auth/tokens.d.ts +3 -1
- package/dist/core/auth/tokens.js +2 -1
- package/dist/core/configSeam.d.ts +0 -4
- package/dist/core/configSeam.js +12 -1
- package/dist/core/createServer.js +16 -4
- package/dist/core/freePort.d.ts +10 -0
- package/dist/core/freePort.js +39 -1
- package/dist/core/handlers/socialRouteHandlers.d.ts +9 -1
- package/dist/core/handlers/socialRouteHandlers.js +46 -12
- package/dist/core/health.d.ts +1 -0
- package/dist/core/health.js +2 -1
- package/dist/core/http/stages/authRoutes.d.ts +6 -0
- package/dist/core/http/stages/authRoutes.js +42 -1
- package/dist/core/http/stages/images.js +5 -3
- package/dist/core/http/stages/livePages.js +1 -1
- package/dist/core/server/fleet/relay.js +9 -1
- package/dist/core/server/fleet/stores.d.ts +7 -0
- package/dist/core/server/fleet/stores.js +15 -2
- package/dist/core/server/pageServer.js +5 -1
- package/dist/core/services/realtime.js +4 -2
- package/dist/core/services/registry.js +7 -1
- package/dist/core/services/robotsTxt.d.ts +16 -0
- package/dist/core/services/robotsTxt.js +50 -0
- package/dist/core/services/servedSpace.d.ts +8 -0
- package/dist/core/services/servedSpace.js +16 -0
- package/dist/core/services/sitemapXml.d.ts +7 -0
- package/dist/core/services/sitemapXml.js +37 -0
- package/dist/functions-api.d.ts +69 -2
- package/dist/helpers/fileStore.d.ts +60 -0
- package/dist/helpers/fileStore.js +127 -0
- package/dist/helpers/outboundGuard.d.ts +32 -3
- package/dist/helpers/outboundGuard.js +50 -5
- package/dist/hosts/project/agentRuns.d.ts +24 -0
- package/dist/hosts/project/agentRuns.js +107 -0
- package/dist/hosts/project/laterAsks.d.ts +41 -0
- package/dist/hosts/project/laterAsks.js +117 -0
- package/dist/hosts/project/plugins.js +11 -4
- package/dist/hosts/project/serveProject.d.ts +18 -1
- package/dist/hosts/project/serveProject.js +89 -25
- package/dist/hosts/project/spaceFailure.d.ts +4 -0
- package/dist/hosts/project/spaceFailure.js +10 -0
- package/dist/hosts/project/watchSpace.d.ts +5 -5
- package/dist/hosts/project/watchSpace.js +15 -6
- package/dist/index.js +2 -2
- package/dist/kernel.js +1 -1
- package/dist/modules/actions/connectorWrite.js +3 -1
- package/dist/modules/actions/index.js +1 -1
- package/dist/modules/actions/jobs/fileQueue.d.ts +34 -0
- package/dist/modules/actions/jobs/fileQueue.js +72 -0
- package/dist/modules/actions/jobs/index.js +3 -3
- package/dist/modules/actions/jobs/memoryQueue.js +6 -215
- package/dist/modules/actions/jobs/queueDocument.d.ts +14 -0
- package/dist/modules/actions/jobs/queueDocument.js +22 -0
- package/dist/modules/actions/jobs/queueRules.d.ts +39 -0
- package/dist/modules/actions/jobs/queueRules.js +270 -0
- package/dist/modules/actions/moduleFor.js +2 -0
- package/dist/modules/actions/runtime/fileKv.d.ts +3 -1
- package/dist/modules/actions/runtime/fileKv.js +12 -98
- package/dist/modules/actions/runtime/guards.d.ts +19 -1
- package/dist/modules/actions/runtime/guards.js +10 -1
- package/dist/modules/actions/runtime/kvChange.d.ts +40 -0
- package/dist/modules/actions/runtime/kvChange.js +23 -1
- package/dist/modules/actions/runtime/kvList.d.ts +4 -0
- package/dist/modules/actions/runtime/kvList.js +5 -1
- package/dist/modules/actions/runtime/kvStore.js +15 -1
- package/dist/modules/actions/runtime/namespaceKv.js +2 -0
- package/dist/modules/actions/runtime/renderResolver.js +31 -5
- package/dist/modules/actions/runtime/runAction.js +16 -6
- package/dist/modules/actions/runtime/scope.js +11 -0
- package/dist/modules/actions/runtime/taskContext.js +11 -32
- package/dist/modules/actions/tasks/auth.js +2 -0
- package/dist/modules/actions/tasks/connector.js +6 -2
- package/dist/modules/actions/tasks/flow.js +5 -0
- package/dist/modules/actions/tasks/http.js +2 -1
- package/dist/modules/actions/tasks/kv.js +5 -0
- package/dist/modules/actions/tasks/list.js +11 -2
- package/dist/modules/actions/tasks/transform.js +2 -0
- package/dist/modules/actions/transport/callHandler.js +25 -4
- package/dist/modules/actions/types.d.ts +46 -1
- package/dist/modules/connectors/engine.d.ts +7 -2
- package/dist/modules/connectors/engine.js +4 -4
- package/dist/modules/connectors/resolver.d.ts +2 -1
- package/dist/modules/connectors/resolver.js +3 -2
- package/dist/modules/functions/build.d.ts +7 -2
- package/dist/modules/functions/build.js +90 -6
- package/dist/modules/functions/capabilities.js +16 -0
- package/dist/modules/functions/context.js +6 -2
- package/dist/modules/functions/contract.d.ts +39 -1
- package/dist/modules/functions/driver.d.ts +2 -1
- package/dist/modules/functions/driver.js +35 -0
- package/dist/modules/functions/load.d.ts +1 -1
- package/dist/modules/functions/load.js +2 -2
- package/dist/modules/functions/manifest.js +7 -1
- package/dist/modules/functions/oauth.d.ts +1 -1
- package/dist/modules/functions/oauth.js +4 -4
- package/dist/modules/functions/protocol.d.ts +6 -0
- package/dist/modules/functions/sandbox/guest/bytes.d.ts +27 -0
- package/dist/modules/functions/sandbox/guest/bytes.js +108 -0
- package/dist/modules/functions/sandbox/guest/crypto.d.ts +47 -0
- package/dist/modules/functions/sandbox/guest/crypto.js +144 -0
- package/dist/modules/functions/sandbox/guest/events.d.ts +152 -0
- package/dist/modules/functions/sandbox/guest/events.js +143 -0
- package/dist/modules/functions/sandbox/guest/fetch.d.ts +305 -0
- package/dist/modules/functions/sandbox/guest/fetch.js +237 -0
- package/dist/modules/functions/sandbox/guest/index.d.ts +28 -0
- package/dist/modules/functions/sandbox/guest/index.js +130 -0
- package/dist/modules/functions/sandbox/{guest.d.ts → guest/types.d.ts} +5 -12
- package/dist/modules/functions/sandbox/isolate.js +20 -6
- package/dist/modules/functions/space.js +2 -8
- package/dist/modules/images/imageProxy.d.ts +3 -2
- package/dist/modules/images/imageProxy.js +2 -2
- package/dist/modules/mongo/jobQueue.js +0 -19
- package/dist/modules/mysql/accounts.js +12 -5
- package/dist/modules/mysql/jobs/index.d.ts +1 -1
- package/dist/modules/mysql/jobs/schema.d.ts +0 -6
- package/dist/modules/mysql/jobs/schema.js +2 -46
- package/dist/modules/mysql/schema.js +26 -1
- package/dist/modules/mysql/sessions.js +2 -1
- package/dist/modules/realtime/handlers.d.ts +9 -4
- package/dist/modules/realtime/handlers.js +20 -3
- package/dist/modules/realtime/hub.d.ts +4 -2
- package/dist/modules/realtime/hub.js +36 -4
- package/dist/modules/realtime/index.d.ts +14 -0
- package/dist/modules/realtime/index.js +14 -1
- package/dist/modules/realtime/presence.d.ts +33 -0
- package/dist/modules/realtime/presence.js +56 -0
- package/dist/modules/realtime/socket.d.ts +3 -1
- package/dist/modules/realtime/socket.js +2 -2
- package/dist/modules/rsc/connectorRscData.d.ts +6 -1
- package/dist/modules/rsc/connectorRscData.js +27 -6
- package/dist/modules/rsc/externalQueryReader.d.ts +28 -0
- package/dist/modules/rsc/externalQueryReader.js +43 -0
- package/dist/modules/rsc/handler.js +1 -1
- package/dist/modules/rsc/resolveRscData.d.ts +11 -1
- package/dist/modules/rsc/resolveRscData.js +86 -16
- package/dist/modules/runtime/inside.js +1 -1
- package/dist/modules/runtime/runner.js +2 -1
- package/dist/modules/sqlite/jobQueue.d.ts +35 -0
- package/dist/modules/sqlite/jobQueue.js +56 -0
- package/dist/modules/sqlite/kv.d.ts +1 -1
- package/dist/modules/sqlite/kv.js +2 -10
- package/dist/modules/sqlite/open.d.ts +3 -0
- package/dist/modules/sqlite/open.js +13 -0
- package/dist/modules/ssr/Component.d.ts +5 -1
- package/dist/modules/ssr/Component.js +3 -1
- package/dist/modules/ssr/applySSRResult.d.ts +8 -1
- package/dist/modules/ssr/applySSRResult.js +23 -3
- package/dist/modules/ssr/handler.js +30 -5
- package/dist/modules/ssr/prepareRender.js +31 -8
- package/dist/modules/ssr/preview.d.ts +2 -0
- package/dist/modules/ssr/preview.js +6 -3
- package/dist/modules/ssr/registerExternalPlugins.d.ts +2 -6
- package/dist/modules/ssr/registerExternalPlugins.js +2 -2
- package/dist/modules/ssr/resolvePageSeo.d.ts +11 -0
- package/dist/modules/ssr/resolvePageSeo.js +13 -2
- package/dist/modules/ssr/streamBody.js +2 -2
- package/dist/modules/ssr/views/template.ejs +21 -17
- package/dist/mysql.d.ts +1 -1
- package/dist/mysql.js +2 -2
- package/dist/plugins/manager.d.ts +5 -0
- package/dist/plugins/manager.js +9 -0
- package/dist/sqlite.d.ts +8 -1
- package/dist/sqlite.js +3 -1
- package/package.json +5 -5
- package/skills/plitzi-authoring/CHEATSHEET.md +6 -6
- package/skills/plitzi-authoring/SKILL.md +4 -2
- package/skills/plitzi-authoring/recipes/accordion.ts +2 -1
- package/skills/plitzi-authoring/recipes/carousel.ts +24 -3
- package/skills/plitzi-authoring/recipes/detail-page.ts +0 -1
- package/skills/plitzi-authoring/recipes/embed-and-svg.ts +3 -1
- package/skills/plitzi-authoring/recipes/filter-a-list.ts +0 -1
- package/skills/plitzi-authoring/recipes/show-data.ts +0 -1
- package/skills/plitzi-authoring/recipes/typed-data.ts +0 -1
- package/skills/plitzi-authoring/reference/accessibility.md +10 -2
- package/skills/plitzi-authoring/reference/auth.md +15 -4
- package/skills/plitzi-authoring/reference/authoring-errors.md +55 -12
- package/skills/plitzi-authoring/reference/colours-and-motion.md +7 -1
- package/skills/plitzi-authoring/reference/components.md +4 -1
- package/skills/plitzi-authoring/reference/data-and-visibility.md +31 -22
- package/skills/plitzi-authoring/reference/efficiency.md +2 -1
- package/skills/plitzi-authoring/reference/elements-and-styles.md +16 -15
- package/skills/plitzi-authoring/reference/flows.md +29 -17
- package/skills/plitzi-authoring/reference/kept-state.md +20 -0
- package/skills/plitzi-authoring/reference/layouts.md +18 -2
- package/skills/plitzi-authoring/reference/lists.md +20 -4
- package/skills/plitzi-authoring/reference/plugin-reach.md +12 -0
- package/skills/plitzi-authoring/reference/plugins.md +17 -3
- package/skills/plitzi-authoring/reference/realtime.md +8 -5
- package/skills/plitzi-authoring/reference/structure.md +17 -1
- package/skills/plitzi-authoring/reference/templates.md +11 -3
- package/skills/plitzi-authoring/reference/testing.md +82 -5
- package/skills/plitzi-authoring/reference/typed-sources.md +6 -0
- package/skills/plitzi-authoring/reference/validation.md +1 -1
- package/dist/core/auth/api.js +0 -1323
- package/dist/modules/functions/sandbox/guest.js +0 -662
|
@@ -19,7 +19,8 @@ button({ content: '', title: 'Close', icon: 'fa-solid fa-xmark' })
|
|
|
19
19
|
// Words that do not say what it does — a key hint, a count: `label` is read in their place.
|
|
20
20
|
button({ content: 'V', label: 'Select (V)', title: 'Select — V', icon: 'fa-solid fa-arrow-pointer' })
|
|
21
21
|
|
|
22
|
-
// A link around a whole card: without `label` it is announced as every word inside the card
|
|
22
|
+
// A link around a whole card: without `label` it is announced as every word inside the card — and around an
|
|
23
|
+
// `article`, Playwright reads no name at all (accname takes none from an article): name it, and a test finds it.
|
|
23
24
|
link({ href: '/posts/field-notes', label: 'Read “Field notes”', children: [ /* cover, topic, title, byline */ ] })
|
|
24
25
|
|
|
25
26
|
// A field whose design says what it is: the label stays, out of sight.
|
|
@@ -81,8 +82,15 @@ button({ content: 'Menu', bind: { ariaExpanded: 'state.menuOpen' }, flows: [[onC
|
|
|
81
82
|
|
|
82
83
|
An "active" variant is for the eyes. `ariaPressed` and `ariaExpanded` are for everyone else. Use both. A button that
|
|
83
84
|
opens a panel also names it — `controls: 'menu-panel'`, the panel's id (authoring gives the panel the anchor
|
|
84
|
-
`aria-controls` needs; [recipes/accordion.ts](../recipes/accordion.ts)).
|
|
85
|
+
`aria-controls` needs; [recipes/accordion.ts](../recipes/accordion.ts)). In a list's row, both are the row's own: each
|
|
86
|
+
row's panel is drawn as `<id>-<row>`, and the row's button points at its own. Words that change while somebody is on the page
|
|
85
87
|
— a count, a total, a status — sit in `container({ live: 'polite', … })`, so a screen reader says them when they change.
|
|
88
|
+
A part that opens and closes on its own — a question and its answer, many open at once — needs no state at all:
|
|
89
|
+
`container({ subType: 'details', children: [container({ subType: 'summary', children: [text('Question')] }), …] })`
|
|
90
|
+
(`open: true` to start open), the browser's own disclosure, announced as one. The accordion recipe is for one-at-a-time.
|
|
91
|
+
Results, a menu or a set of options someone goes through with the keyboard sit in `focusGroup({ label, children })`:
|
|
92
|
+
↑/↓ move between the controls inside, ←/→ to the first of the next or previous list, and ↓ from a search field inside
|
|
93
|
+
goes down into them — Tab alone took a stop per result.
|
|
86
94
|
|
|
87
95
|
## The page has an outline
|
|
88
96
|
|
|
@@ -48,7 +48,8 @@ form({
|
|
|
48
48
|
- What it answers: `ok`; when not, `reason` (`unverified`, `inactive`, `network`, `missing`…) and, for `reason: 'mfa'`,
|
|
49
49
|
`mfaToken` — the challenge `mode: 'mfa'` completes. Test it on `<step>.ok` with `when`, never `whenSucceeded` /
|
|
50
50
|
`whenFailed`, which are a server action's ([flows](flows.md)).
|
|
51
|
-
- `authLogout()` ends the session; `
|
|
51
|
+
- `authLogout()` ends the session; `authLogoutEverywhere('site' | 'all')` ends it on every device too — this space's
|
|
52
|
+
sessions, or every one of the account; `authRefreshDetails()` reloads who is signed in.
|
|
52
53
|
|
|
53
54
|
## Who is signed in
|
|
54
55
|
|
|
@@ -61,13 +62,23 @@ being found out), `{{ auth.details.username }}` — `details` carries `id`, `use
|
|
|
61
62
|
A page's `accessLevel`: `'authenticated'` (signed in), `'public'` (signed OUT only — the sign-in page), or nothing
|
|
62
63
|
(everybody). A lone `public` page vanishes the moment anyone signs in, so leave it out unless the page has a signed-in
|
|
63
64
|
twin on the same slug. `unauthorizedRedirect` names where a visitor the page is not for goes — a page's id or slug
|
|
64
|
-
(`''` is the home page), or a URL; without it they are answered 403.
|
|
65
|
+
(`''` is the home page), or a URL; without it they are answered 403. A visitor not signed in is sent with the address
|
|
66
|
+
they asked for as `?redirect=`. A `public` sign-in with `unauthorizedRedirect` sends whoever signs in on it there
|
|
67
|
+
itself — back to `?redirect=` when it is on this site, else to its `unauthorizedRedirect` — the moment `authLogin`
|
|
68
|
+
succeeds, so steps after the login race the page leaving: end the flow at the login (`login-then-leaves` says so). A
|
|
69
|
+
sign-in for everybody sends them back itself: `navigate({ urlType: 'external', url: "{{ navigation.queryParams.redirect | default('/') }}" })`.
|
|
70
|
+
|
|
71
|
+
Which page an address draws, and for whom, is the router's decision — a tool or a test asks it, never the pages' paths:
|
|
72
|
+
`pageAt(schema, '/sign-in', { signedIn: true })` (the page, or where it sends them), `audienceAt(schema, '/sign-in')`
|
|
73
|
+
(`everyone`, `gated` — one page drawn apart by sign-in —, `guests`, `members`, `both-apart`, `nobody`).
|
|
65
74
|
|
|
66
75
|
A page for some permissions says so: `access: { permissions: ['postPublish'] }` — every one held, by a signed-in visitor
|
|
67
76
|
(the permissions of their visitor roles; on Plitzi's own spaces, their account's). The server keeps it: anybody else is
|
|
68
77
|
answered 401 or 403 and the page's refusal, and its content is never sent to them — not in the page, not in the space
|
|
69
|
-
the browser fetches. Signed out, they go to `unauthorizedRedirect` when the page names one.
|
|
70
|
-
`
|
|
78
|
+
the browser fetches. Signed out, they go to `unauthorizedRedirect` when the page names one. The refusal is a few words
|
|
79
|
+
of Plitzi's unless `settings.withheldPage` names a page of the space (id or slug, with no `access`): it is drawn
|
|
80
|
+
instead, in the same layout, with the same status — `auth.isAuthenticated` tells "sign in" from "not yours". Hiding a
|
|
81
|
+
part of a page on `auth.details.permissions` is not this: the part was still sent.
|
|
71
82
|
|
|
72
83
|
## What a visitor may do
|
|
73
84
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# When `authorSpace` refuses, warns or suggests
|
|
2
2
|
|
|
3
|
-
<!-- Generated from AUTHORING_CODES (src/schema/codes
|
|
3
|
+
<!-- Generated from AUTHORING_CODES (src/schema/codes/) by `yarn generate:authoring-errors`. Do not edit. -->
|
|
4
4
|
|
|
5
5
|
Search this page for the code in brackets — `[class-and-css]` — rather than reading it whole, or ask for one:
|
|
6
6
|
`npx @plitzi/cli explain class-and-css`.
|
|
@@ -28,11 +28,13 @@ The space is not written until these are fixed.
|
|
|
28
28
|
| `action-without-steps` | an action with no steps | the steps it runs |
|
|
29
29
|
| `active-when-constant` | an `activeWhen` condition that reads nothing — always or never true | name what it depends on: `'{{ list_dots.index == state.slide }}'` |
|
|
30
30
|
| `ancestor-not-class` | an ancestor condition keyed by something that is neither a class name nor `'>'` (the parent) | `[card.name]` for a `styles()` declaration, or `'>'` for the parent whatever it wears |
|
|
31
|
+
| `ancestor-shape` | an ancestor condition given keys other than `css`, `states` and `variants` — `pseudos` (an ancestor's rules reach the element, never its `::before`/`::after`) or `conditions` — which were dropped without a word | for `pseudos`, a custom property the ancestor's state sets — `ancestors: { [card.name]: { states: { hover: { '--fill-opacity': '1' } } } }` — read by the class's own pseudo-element: `pseudos: { before: { css: { opacity: 'var(--fill-opacity, 0.6)' } } }`; for `conditions`, the condition on the class's own `css` — `conditions: { 'motion-reduce': { css: { transition: 'none' } } }` |
|
|
31
32
|
| `anchor-duplicate` | one anchor on two elements of the same page (layouts included) | rename all but one |
|
|
33
|
+
| `anchor-in-row` | a link to an anchor drawn in a list’s rows — each row’s is named after its row, so the link lands at the top | link to one row’s (`hash: 'answer-<row key>'`), the list’s own anchor, or one outside it |
|
|
32
34
|
| `anchor-invalid` | an `anchor` or a link's `hash` that is not lowercase letters, digits and `-` | `anchor: 'plans'`, `hash: 'plans'` — no `#` |
|
|
33
35
|
| `anchor-missing` | a link whose `hash` no element on the page it goes to carries — it would land at the top | the anchor the message lists, or give the section that `anchor` |
|
|
34
36
|
| `anchor-no-tag` | an anchor on an element that renders no element of its own | the anchor on the element around it, or `subType: 'div'` on the provider |
|
|
35
|
-
| `anchor-repeated` | an anchor inside a
|
|
37
|
+
| `anchor-repeated` | an anchor inside a component — it would be in the page once per instance | the anchor on the element around the instance (in a list row, an anchor is the row’s own: that one is fine) |
|
|
36
38
|
| `as-without-from` | `as` with no `from` — `as` is how the source `from` names is shown | `from: 'products.item.price', as: 'price'` |
|
|
37
39
|
| `attribute-kind` | text where a flag or a list is read | `disabled: true`, not `'true'`; `items: [ … ]` |
|
|
38
40
|
| `attribute-value` | a value outside the attribute's list (`subType: 'h7'`) | one of the listed values |
|
|
@@ -60,6 +62,9 @@ The space is not written until these are fixed.
|
|
|
60
62
|
| `computed-reads-element` | a computed value reading an element's source — no element is around the whole space | compute it from the globals and the variables, or bind it on the element |
|
|
61
63
|
| `computed-unknown` | a computed value read before it is declared, or never declared | declare it in `computed`, above the one that reads it |
|
|
62
64
|
| `condition-field-unpublished` | a `when` asking a step of its flow for a key it never publishes — `whenSucceeded` / `whenFailed` on anything but `runServerAction` | a key the step publishes (`explain <step>`): after `authLogin`, `when({ field: 'signedIn.ok', operator: '=', value: true }, …)` |
|
|
65
|
+
| `condition-short-source` | a step's condition reading an element's source by the element's id alone — `roomStats.locked` — which reads nothing | the source named in full, as a template names it: `apiContainer_roomStats.locked` |
|
|
66
|
+
| `condition-template` | a `when` rule with a template in its field or value — `value: '{{ list_genres.item.id }}'` — compared as that text, so it never holds | a path: `field: 'state.picks'`; another path as the value, `value: 'list_genres.item.id', isBinding: true`; an expression, a computed value |
|
|
67
|
+
| `controls-other-row` | a button's `controls` naming an element a list draws in its rows, from outside that row | the button in the same row as what it shows and hides, or `controls` naming an element outside the list |
|
|
63
68
|
| `controls-unknown` | a button's `controls` naming no element of the space | the id of the element it shows and hides: `controls: 'faq-answer'` |
|
|
64
69
|
| `css-property-twice` | one property written twice in a rule set — `paddingTop` beside `'padding-top'` — so one would silently win | keep one |
|
|
65
70
|
| `css-property-unknown` | a CSS property that does not exist | the property it suggests; a custom property starts with `--` |
|
|
@@ -82,7 +87,7 @@ The space is not written until these are fixed.
|
|
|
82
87
|
| `folder-cycle` | a page folder inside itself | a `parent` that leads to the top |
|
|
83
88
|
| `folder-undeclared` | a page, a layout or a folder filed in a folder the space does not declare | declare it on the space — `pageFolders: [{ id: 'docs', name: 'Docs' }]`, its slug starting its pages' addresses — or use the name it suggests |
|
|
84
89
|
| `font-invalid` | a font the space cannot load as declared | the field the message names |
|
|
85
|
-
| `format-unknown` | an `as` that names no format of the space's `formats` | declare it once — `formats: { price: "{{ source\|currency('USD') }}" }` — or write the template in its place |
|
|
90
|
+
| `format-unknown` | an `as` that names no format of the space's `formats` | declare it once — `formats: { price: "{{ source\|currency('USD') }}" }` — or write the template in its place; words the element always shows are its `content`, with no `from` |
|
|
86
91
|
| `from-and-bind` | the main attribute bound twice, with `from` and in `bind` | keep `from`, and give `bind` the other attributes |
|
|
87
92
|
| `from-without-attribute` | `from` on a type with no one attribute that shows its data (a container, a form) | bind the attribute you mean: `bind: { attribute: 'source' }` |
|
|
88
93
|
| `global-callback-module` | a global callback sent to a module other than the one that registers it | the step builder, which knows the module |
|
|
@@ -104,14 +109,17 @@ The space is not written until these are fixed.
|
|
|
104
109
|
| `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
110
|
| `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
111
|
| `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' |
|
|
112
|
+
| `og-type-unknown` | a page's `seoType` that Open Graph does not name | `seoType: 'article'`, `'profile'`, `'music.playlist'` — or leave it out, and the page is a `website` |
|
|
107
113
|
| `outside-ancestor` | an element that reads the state of an element it is not inside | nest it in the element the message names |
|
|
108
114
|
| `page-access` | a page `access` the server cannot keep: no permissions, or one that is not a name | `access: { permissions: ['…'] }` with at least one permission name, or no `access` for a page anybody may see |
|
|
109
115
|
| `page-access-level` | an `accessLevel` that is not one the router reads | one of the values the message lists |
|
|
116
|
+
| `page-catch-all-default` | the page of every address no other answers (`slug: '*'`) marked the home | `isDefault` on the page at `''`, or left out: the page at `''` is the home |
|
|
117
|
+
| `page-nav-invalid` | a page's `nav` without a label, with an order that is no number, or on a page with no one address to list | `nav: { label: 'Pets', order: 3 }` on a page whose path takes no param — a page per record is reached from its list |
|
|
110
118
|
| `page-route-reserved` | a page under `/fn`, where the space's functions answer | another slug |
|
|
111
119
|
| `page-route-taken` | two pages at one address for the same visitors | another slug — or `accessLevel` `'public'` on one and `'authenticated'` on the other |
|
|
112
120
|
| `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'`) |
|
|
113
121
|
| `page-target-url` | a URL, `mailto:` or `tel:` in a link left in page mode | `mode: 'external'` |
|
|
114
|
-
| `page-template` | a template in a page's `seoTitle`, `seoDescription` or `
|
|
122
|
+
| `page-template` | a template in a page's `seoTitle`, `seoDescription`, `notFound` or a text of its `structuredData` 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 |
|
|
115
123
|
| `page-without-slug` | a page with no `slug` | `slug: ''` for the home page, its path for any other: `'about'`, `'blog/:slug'` |
|
|
116
124
|
| `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) |
|
|
117
125
|
| `prop-missing` | an instance without a prop its component requires | `component('card', { props: { name: … } })`, or bind it |
|
|
@@ -120,8 +128,11 @@ The space is not written until these are fixed.
|
|
|
120
128
|
| `prop-unknown` | a prop the component does not declare, handed in or read | the prop it suggests, or declare it: `props: { name: { type: 'text' } }` |
|
|
121
129
|
| `prop-value` | a prop handed in with a value its declaration does not take | a value of the declared type, or one of its options |
|
|
122
130
|
| `props-outside-component` | `props.x` read outside a component | read the source it would have come from |
|
|
131
|
+
| `provider-when-not-rules` | a provider's `when` that is no rule group — a string, a single rule — never read, so it never waits | `when: { combinator: 'and', rules: [{ field, operator, value }] }`, each field a source by its name |
|
|
123
132
|
| `quiet-unknown` | an element's `quiet` naming something that is not a suggestion's code — a problem is never quieted | the code of the suggestion it was offered: `quiet: ['repeated-shape']` |
|
|
124
133
|
| `redirect-target-unknown` | a page that sends visitors it is not for to a page the space does not have | a page's id or slug (`''` is the home page), or a full URL |
|
|
134
|
+
| `robots-txt-line` | a line of the space's `settings.robotsTxt` that no crawler reads, or one with no `User-agent` | `User-agent: *` then `Allow: /`, `Disallow: /overlay` — each line `Field: value`, or a comment |
|
|
135
|
+
| `robots-unknown` | a page's `robots` with a directive no search engine reads, or none | `robots: 'noindex'`, `'noindex, nofollow'` — or leave it out, and the page is indexed |
|
|
125
136
|
| `row-and-children` | a list with a `row` and `children` — the row is what it renders | one of the two |
|
|
126
137
|
| `row-component` | a list's `row` naming a component the space does not declare, or one with no prop to take the row | a declared component with an `item` prop — or a single prop — for the row |
|
|
127
138
|
| `row-outside-list` | `row` on an element that is not a list | a `list` around it |
|
|
@@ -131,25 +142,39 @@ The space is not written until these are fixed.
|
|
|
131
142
|
| `selector-taken` | a `selector` that is a declared class, or another element's | `class` to share rules; a selector of an element's own is its alone |
|
|
132
143
|
| `server-data-in-browser` | a provider asking for the project's own data (`/data/…`, read by its server from `src/data/` and never served) from the browser | `runtime: 'server'` on the provider: the page arrives with the data in it |
|
|
133
144
|
| `server-provider-in-component` | a `runtime: 'server'` element inside a component: the page server resolves a page's and its layouts', never a component's | put the provider on the page, around the instance, and hand the component its rows as a prop |
|
|
145
|
+
| `server-query-unresolved` | a `runtime: 'server'` provider whose `query` the page server cannot read — bound, a template reading what the browser alone holds (anything but the space's variables and `navigation`), the visitor's cookies (`credentials: 'include'`), another method than GET, or neither an address (`https://…`) nor a path (`/…`) — so it draws empty | write it over the space's variables and `navigation` (`'{{ apiUrl }}/posts/{{ navigation.routeParams.id }}'`); an `action` for what the browser holds; or no `runtime: 'server'`, and the browser asks it |
|
|
146
|
+
| `server-source-in-browser` | a provider with an `action` or a `connector` asked from the browser — only the page server resolves those, so it never asks | `runtime: 'server'` on the provider |
|
|
134
147
|
| `setting-misplaced` | `settings.computed` or `settings.channels` written inside `settings` | `computed` and `channels` at the top of the space |
|
|
148
|
+
| `share-image-invalid` | a page's `seoImage` that is neither a file of the site, an address nor a template — or a `seoImageAlt` with no picture | `seoImage: '/og/home.png'` (in public/), `'https://…'` or `'{{ apiContainer_room.cover }}'`, with `seoImageAlt` saying what it shows |
|
|
149
|
+
| `shorthand-ambiguous` | a shorthand one of whose parts is a bare `var(--x)` — `background: var(--surface)` — which longhand it is depends on what the variable holds | the longhand it is: `'background-color': 'var(--x)'` for a colour, `'background-image'` for a gradient or a picture |
|
|
150
|
+
| `shorthand-unread` | a `font` shorthand with a part the expansion reads as none of its longhands — a `var()` size, a system font — or without the size and family CSS requires | the longhands it means: `'font-size': 'var(--size)'`, `'font-family': …`; a CSS-wide keyword (`font: inherit`) is read whole |
|
|
135
151
|
| `slot-children` | children handed to an instance outside its slots | `children: { slotName: [ … ] }`; a component with no slots takes no children |
|
|
136
152
|
| `slot-not-class` | a `slots` entry that is not a class — rules written in place, or nothing — which a slot cannot wear | the rules as a `styles()` declaration, handed to the slot beside its other classes |
|
|
137
153
|
| `slot-unknown` | a component slot that is not an element of its tree | the id of an element inside the component — usually an empty container |
|
|
138
154
|
| `source-field-unknown` | a path into a typed source that its sample does not have | read a field the sample has, or add the field to the sample |
|
|
139
|
-
| `
|
|
155
|
+
| `source-name-missing` | a source named by nothing — most often a field read off a list row that has no types | write the row's field as text (`${r.item}.field`), or give the list `items` a typed source's path |
|
|
156
|
+
| `space-identity-invalid` | the space's `siteName`, `language`, `favicon`, `shareImage` or `themeColor` written as nothing a head reads | `siteName: 'My site'`, `language: 'en'`, `favicon: '/favicon.svg'`, `shareImage: '/og.png'`, `themeColor: { light: '#fbf7f0', dark: '#0b0a10' }` |
|
|
157
|
+
| `state-browser-not-kept` | a `browserState` key the space does not keep — transient, or not in `keptState` | keep it, or leave it out of `browserState` |
|
|
158
|
+
| `state-kept-and-transient` | `keptState` (the only keys kept) and `transientState` (the keys left out) both said | one of the two: `keptState` when few keys are kept, `transientState` when few are not |
|
|
159
|
+
| `state-key-list` | `settings.transientState` / `paintedState` / `browserState` that is not a list of top-level state keys | `transientState: ['demoStep']` — a dotted path names its top key |
|
|
140
160
|
| `state-painted-and-transient` | a state key both painted (kept for the server) and transient (never kept) | remove it from one of the two |
|
|
141
|
-
| `
|
|
161
|
+
| `state-painted-not-kept` | a `paintedState` key that `keptState` does not keep — the server draws with what is kept | add it to `keptState`, or leave it out of `paintedState` |
|
|
162
|
+
| `state-shape` | a state given a rule set's keys (`pseudos`, `variants`, `ancestors`…): a state holds plain CSS | a pseudo-element's state goes under the pseudo-element — `pseudos: { before: { states: { hover: { opacity: '1' } } } }`; an ancestor's, under `ancestors` |
|
|
163
|
+
| `step-duplicate` | two steps with one name in a flow, in two flows of one element, or in an action | a name each |
|
|
142
164
|
| `step-name` | a step name a later step cannot read as `{{ name.field }}` | a letter first, then letters, digits, `-` and `_` |
|
|
143
165
|
| `step-params` | a step param that does not exist, or a value outside its options | the params and values it lists |
|
|
144
166
|
| `step-type` | a step `type` that does not exist | the step builders — `setState(…)`, `navigate(…)` — write it |
|
|
167
|
+
| `structured-data-shape` | a page's `structuredData` item with no `@context` or `@type`, or a value JSON cannot carry | `structuredData: { '@context': 'https://schema.org', '@type': 'SportsEvent', name: '…' }` |
|
|
145
168
|
| `style-condition-unknown` | a condition a class's rules cannot hold under | `motion-reduce`, `motion-safe`, or a container width — `container (max-width: 30rem)`, `container card (min-width: 480px)` |
|
|
169
|
+
| `style-key-unknown` | a style holding a key that is no part of one — `slots` written inside `styles()` — beside its `css` or states | the element's `slots` beside its `class`, each a `styles()` of its own; a style takes `css`, `states`, `variants`, `ancestors`, `pseudos`, `conditions` |
|
|
170
|
+
| `style-part-shape` | a condition or a pseudo-element given `variants`, `ancestors` or `conditions` — it holds its selector's own `css`, its `states` and (a condition) its `pseudos` | the class's own `css` under the condition — `{ 'motion-reduce': { css: { transition: 'none' } } }` drops what an ancestor's or a variant's rule would animate — or the rule under `ancestors`/`variants` at the top of the class |
|
|
146
171
|
| `style-pseudo-content` | a `content` CSS cannot read — text without its quotes draws nothing — or a `before`/`after` with no `content`, which is not there at all | the text in quotes inside the string — `content: '"→"'`, `'""'` for an empty box — or a function such as `counter(step)` |
|
|
147
172
|
| `style-pseudo-property` | a property the pseudo-element ignores — the browser drops it without a word | one it honours (`::selection` paints, `::marker` and `::placeholder` take text and font), or style the element |
|
|
148
173
|
| `style-pseudo-unknown` | a pseudo-element a class cannot dress | one of `before`, `after`, `marker`, `placeholder`, `first-letter`, `first-line`, `selection` — without the `::` |
|
|
149
174
|
| `style-state-unknown` | a state a selector does not react to | one of the states it lists (`hover`, `focus`, `active`…) |
|
|
150
175
|
| `svg-not-svg` | an `svg` whose `content` is not one `<svg>…</svg>` — it draws nothing | the SVG markup alone; HTML around it goes in a `blockHtml` |
|
|
151
176
|
| `template-in-value` | a `{{ }}` inside an attribute that is an object or a list — a provider's `input`, a list's `items`, a plugin's settings: only an attribute that is text is evaluated | a binding on the attribute (`bindTemplate(name, source, template, { returns: 'value' })`); for a provider's `input`, nothing for a route or query param — the action is already handed them as `input.<name>` |
|
|
152
|
-
| `template-short-source` | a source named without its prefix inside a template or a step | the full name: `apiContainer_stats`, `list_rows` |
|
|
177
|
+
| `template-short-source` | a source named without its prefix inside a template or a step | the full name: `apiContainer_stats`, `list_rows` — a list's row, `r.inTemplate.item` |
|
|
153
178
|
| `template-source-out-of-scope` | a template reading the source of an element it is not inside | move the element inside it, or share the value through `state` |
|
|
154
179
|
| `template-text-into-value` | a template, which renders text, feeding an attribute that holds a list or an object | `bindTemplate('items', source, '{{ … }}', { returns: 'value' })` |
|
|
155
180
|
| `template-unknown-name` | a name in a template that is not a source, a variable or a route param | the full source name (`list_rows.item`), `navigation.queryParams.x`, or `source` for the bound value |
|
|
@@ -166,9 +191,12 @@ The space is not written until these are fixed.
|
|
|
166
191
|
| `unknown-field` | a field the space, a page, an element, a binding or a step does not have | the field it suggests; an element's attribute goes inside the factory's props (`button({ content })`) |
|
|
167
192
|
| `unknown-transformer` | a transformer that does not exist | one of the transformers it lists |
|
|
168
193
|
| `utility-module` | a utility sent to a module — a utility takes none | drop the `on` |
|
|
194
|
+
| `variant-bound-twice` | two bindings (`variantFrom`, `activeOn`, `activeWhen`) setting the variant of one class on one element — the second always wins | one `variantFrom` whose template answers every case: `{{ wide ? 'roomy' : current ? 'active' : 'idle' }}`; two things that change apart (a size, a lit state) are two classes, each with its own `variantFrom` |
|
|
169
195
|
| `visibility-as-attribute` | `visibility` bound as an attribute, which no element reads | `visible: { source, template }` |
|
|
196
|
+
| `visible-expression` | `visible` written as an expression (`"state.plan == 'pro'"`, `"a && !b"`) — it takes a source, read as one, which resolves to nothing | `visible: { source: 'state.plan', template: "{{ state.plan == 'pro' }}" }` — or a source alone, `'state.open'`, `'!state.open'` |
|
|
170
197
|
| `visitor-roles` | `settings.visitorRoles` written in a shape the runtime does not read | the shape the message gives |
|
|
171
198
|
| `while-running` | `whileRunning` on a step that is not the trigger, or a mode other than `skip`, `parallel`, `queue`, `latest` | `[whileRunning('queue', onClick()), …]` |
|
|
199
|
+
| `withheld-page-invalid` | `settings.withheldPage` naming no page of the space, or one with an `access` of its own | the id or slug of a page every visitor may see: `withheldPage: 'no-access'` |
|
|
172
200
|
|
|
173
201
|
## Warned
|
|
174
202
|
|
|
@@ -178,6 +206,7 @@ The space renders, and renders something you probably did not mean. Fix every on
|
|
|
178
206
|
| --- | --- | --- |
|
|
179
207
|
| `action-output-path` | a read of `.data` on a provider fed by a server action — it publishes the action’s output at its root, and `.data` is a `query` provider’s answer | the output’s own field — `apiContainer_feed.stories`, not `apiContainer_feed.data.stories` |
|
|
180
208
|
| `animation-name-unknown` | `animation-name` naming keyframes the space does not declare — nothing plays | declare them in the space's `keyframes`, or name one it has |
|
|
209
|
+
| `browser-state-without-keep-state` | `browserState` without `keepState` — nothing is kept in the first place | `settings.keepState: true`, or remove `browserState` |
|
|
181
210
|
| `click-on-static-element` | a click flow on a container, text, heading, image or list item — no keyboard reaches it | the flow on a `button` (it holds children) or a `link` |
|
|
182
211
|
| `colour-without-dark` | a colour token with no dark value | `{ light, dark, default }` |
|
|
183
212
|
| `condition-starts-visible` | a computed visibility that shows until its data answers | `visible: { source, template }` |
|
|
@@ -190,32 +219,45 @@ The space renders, and renders something you probably did not mean. Fix every on
|
|
|
190
219
|
| `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 |
|
|
191
220
|
| `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 |
|
|
192
221
|
| `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 |
|
|
222
|
+
| `font-weight-not-loaded` | a `font-weight` no face the space loads has — the browser draws the nearest one, or fakes a bolder one | the weight in the font’s `weights`, or a weight it loads |
|
|
193
223
|
| `FORM_SUBMIT_UNMANAGED` | a form the browser would submit itself, reloading the page | `managedByInteractions: true` |
|
|
194
224
|
| `form-control-name-taken` | two controls in one form with one name — one overwrites the other | a name each |
|
|
195
225
|
| `form-control-unnamed` | a control in a form with no `name` — its value never reaches `values` | `formControl({ name: 'email', … })` |
|
|
196
226
|
| `form-value-compared-to-blank` | a `when` comparing a submitted field to `""` — a field nobody typed in is not sent | `operator: 'empty'` / `'notEmpty'` |
|
|
197
227
|
| `heading-level-overridden` | 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 | set the property on one of the two: the level slot for that level alone, `heading` for every heading |
|
|
198
228
|
| `heading-level-skipped` | an `h4` right after an `h2` — the outline misses a level | the next level down; size it with its class |
|
|
229
|
+
| `icon-font-replaced` | a class on a `fontAwesome` icon setting `font-family` — the icon's glyphs are Font Awesome's font, and another draws a fallback character in their place | the class's `font-family` on the text around the icon, never on the icon; its size and colour on the icon are fine |
|
|
199
230
|
| `image-without-alt` | an image that is not `decorative` and has no `alt` | say what it shows, or `decorative: true` |
|
|
231
|
+
| `journey-start-access` | a journey starts on a page its visitor may not be on: one for signed-in visitors played as a guest (sent to sign in there), or one asking permissions its test account’s roles do not give (withheld from it) | the journey played as an account that may open the page — or started on a page its visitor opens; kept as it is when the door is what it checks |
|
|
232
|
+
| `kept-state-without-keep-state` | `keptState` without `keepState` — nothing is kept in the first place | `settings.keepState: true`, or remove `keptState` |
|
|
200
233
|
| `label-ignored` | a `label` on a container whose tag is named by what it holds (`li`, a heading) | the words inside, or a landmark tag (`nav`, `section`…) |
|
|
201
234
|
| `link-current-section` | `current: 'section'` on a link that is never current (an external one) or current everywhere (to `/`) | leave `current` out — `'section'` is for a link to a section's own page, `/automations/runs` |
|
|
202
235
|
| `list-item-key-missing` | a list's `itemKey` that some of its items lack, or two of them share — the rows fall back to `id`, then position | a field every item has, once each |
|
|
236
|
+
| `list-items-outside-answer` | a list's `items` bound to a query provider outside its answer — the provider itself, or a field read at its root, where its state is: no list, so the rows render NaN or a placeholder | the list inside the answer: `catalog.data.games`, or `catalog.records` (paginated) |
|
|
203
237
|
| `list-row-not-li` | a row of a list with `items` that is not an `<li>` — that list is a `<ul>` (or `<ol>`), so the row is a box inside a list, no item to a screen reader | `container({ subType: 'li' })` — or the component's root one, or a wrapper for a link or a button |
|
|
238
|
+
| `login-then-leaves` | steps after `auth.login` on a page for signed-out visitors: the page sends whoever signs in on, to `?redirect=` or its `unauthorizedRedirect`, as the login succeeds — the steps race it | end the flow at the login: the page sends the visitor where `?redirect=` says; a page for everybody (no `accessLevel`) navigates itself |
|
|
239
|
+
| `message-while-running` | a channel's `onMessage` flow with no `whileRunning`: a message that arrives while it runs is dropped (`skip`, the default) | `[whileRunning('queue', onMessage()), …]` to hear each one, `'latest'` for the last; `whileRunning('skip', …)` when dropping is meant |
|
|
204
240
|
| `overlay-never-opened` | a modal or a dialog that starts hidden and that no step opens | a flow with `openModal('id')` / `openDialog('id')` |
|
|
205
241
|
| `overlay-starts-open` | a modal or a dialog open when the page loads | `visible: false`, opened by `openModal` |
|
|
242
|
+
| `page-path-unknown` | a link or `navigate` to a path no page of the space answers — a page not made yet, or a typo | a path a page answers (its folder and slug), the page's id, or `mode: 'external'` for one the server answers itself |
|
|
206
243
|
| `painted-state-without-keep-state` | `paintedState` without `keepState` — nothing is kept for the server to draw with | `settings.keepState: true`, or remove `paintedState` |
|
|
207
244
|
| `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` |
|
|
208
|
-
| `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`) |
|
|
245
|
+
| `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, as the warning names it (`variant` → `kind`, `from` → `start`) |
|
|
246
|
+
| `popup-position-set` | a class on a `dropdownPopup` setting where it is drawn — `position`, `top`, `left`, `right`, `bottom`, `inset` or `transform` — over the place its dropdown puts it at, at the space's root | its look on the class, its place on the dropdown: `popupPlacement`, `containerTopOffset`, `containerLeftOffset`, and `popupWidth: "trigger"` for its width |
|
|
209
247
|
| `provider-without-source` | an `apiContainer` that asks nothing | a `query` (or `action`, `connector`, `resource`) |
|
|
210
248
|
| `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 |
|
|
211
249
|
| `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` |
|
|
212
250
|
| `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 |
|
|
213
|
-
| `
|
|
251
|
+
| `server-when-unknown` | a server provider's `when` that reads what the browser alone holds — a `state`, a variable, a browser provider — so the page server resolves it whatever it says | wait on what the server knows (`navigation`, `auth`, a server provider’s answer), or ask it from the browser with a `query` |
|
|
252
|
+
| `span-holds-block` | a `container` with `subType: 'span'` holding a block, or with `'p'` holding anything that renders a `<div>` (a `text`, a plain `container`) — which the browser closes the paragraph before | a `div` (leave `subType` out), or words and inline elements: `paragraph(…)`, a `span` container, a `link` |
|
|
214
253
|
| `state-key-has-runtime-prefix` | a state key written with `runtime.state.` in front — the state callbacks already write below it | `key: 'cart'`, not `'runtime.state.cart'` |
|
|
215
254
|
| `state-toggled-in-branches` | two `setState` of one key, each under a `when` on that key — the second flips back what the first wrote | `toggleState({ key })`; for something shown by default, a key named for hiding it |
|
|
216
255
|
| `STYLE_WITHOUT_TAG` | style on a provider that renders no element of its own | `subType: 'div'` on the provider, or style its parent |
|
|
217
256
|
| `tablet-rule-skips-mobile` | a tablet rule phones never get — mobile inherits desktop, not tablet | write it under `compact` (tablet and mobile together) |
|
|
218
257
|
| `template-never-resolved` | a condition in an attribute, which only resolves `{{ name\|filter }}` — used as written | move it into `bindTemplate` |
|
|
258
|
+
| `template-or-value` | a template's `or` (or `and`) beside a text or a number — `sort or 'listeners'` — which answers true or false, never the value | a fallback value with `??`: `sort ?? 'listeners'`; a test with `or` between two conditions |
|
|
259
|
+
| `test-account-role-gone` | a test account holds a visitor role the space does not declare in `settings.visitorRoles` — removed since, or never there: a journey plays it without that role, and one that needed what it gave fails | one of the space’s roles for the account — or the role declared again |
|
|
260
|
+
| `test-unreadable` | a test of the space — an element check or a flow — that cannot be read as it is written: a page no page of the space answers, an element it no longer has, a relation that is none. A snapshot and a publish wait for it | the test as the message says — or the space back to what the test expects |
|
|
219
261
|
| `transient-state-without-keep-state` | `transientState` without `keepState` — nothing is kept in the first place | `settings.keepState: true`, or remove `transientState` |
|
|
220
262
|
| `unknown-element-type` | a type no built-in element has | the built-in it suggests; a plugin's declaration goes in `authorSpace(space, { plugins: [declaration] })` |
|
|
221
263
|
| `unknown-global-callback` | a global callback no built-in source declares — it runs only if something registers it | the built-in it suggests, or make sure a plugin or module of the space registers it |
|
|
@@ -229,7 +271,7 @@ Nothing is wrong: the page renders as written. Each is a shorter way to the same
|
|
|
229
271
|
|
|
230
272
|
| Code | Written the long way | The short way |
|
|
231
273
|
| --- | --- | --- |
|
|
232
|
-
| `class-overrides-class` | one class's shorthand erasing the longhand another class on the same element writes out — `padding` over `padding-top` — because the stylesheet writes it later: classes in the order they are first met, a breakpoint's rules after the base, never the order of a class list | the longhands the shorthand means instead of it (`padding-left`, `padding-right`), so it leaves the other class's alone — or `quiet: ['class-overrides-class']` when the
|
|
274
|
+
| `class-overrides-class` | one class's shorthand erasing the longhand another class on the same element writes out — `padding` over `padding-top` — or the same property set over the class listed after it — `gap` over `gap` — because the stylesheet writes it later: classes in the order they are first met, a breakpoint's rules after the base, never the order of a class list | the longhands the shorthand means instead of it (`padding-left`, `padding-right`), so it leaves the other class's alone; the same property, left to one of the two or written on the element itself — or `quiet: ['class-overrides-class']` when the winner is meant to win |
|
|
233
275
|
| `content-attribute` | a button or a link whose children are only its words and an icon — a `text`, a `fontAwesome` — elements more than it needs | its own `content` and `icon` (`link({ href, content: 'Docs', icon: 'fa-solid fa-arrow-right', iconPlacement: 'after' })`); the icon's class goes on the `icon` slot, and what the text's class adds on the box's class, never the class itself |
|
|
234
276
|
| `custom-css-class` | a `customCss` rule a class can hold — `.card:hover`, `.panel .icon` | the class's own `states` or `ancestors`, where the style editor reads it back and a breakpoint can change it |
|
|
235
277
|
| `custom-css-notifications` | the toasts or their icon, close button or progress bar dressed with `.Toastify__*` rules in `customCss` | `notifications: { font, fontSize, fontWeight, minHeight, iconSize, closeColor, progressHeight, … }` |
|
|
@@ -240,10 +282,11 @@ Nothing is wrong: the page renders as written. Each is a shorter way to the same
|
|
|
240
282
|
| `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 |
|
|
241
283
|
| `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: [...] }` |
|
|
242
284
|
| `plugin-custom-host` | a `custom` element naming, by `renderType`, a plugin whose declaration the space was handed | place it from its declaration — `const seatPicker = defineElement(declaration)`, then `seatPicker({ id, … })`: typed by what it declares (a `definePlugin` declaration carries its attributes), the element the builder adds too |
|
|
243
|
-
| `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
|
|
244
|
-
| `repeated-shape` | the same structure written again and again with different words — cards, rows, tiles
|
|
285
|
+
| `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, written in its area’s folder and listed in the space’s `components`; a link marks its own page with the `current` state |
|
|
286
|
+
| `repeated-shape` | the same structure written again and again with different words — cards, rows, tiles. Copies that read their data in a form of their own (their template) or render on the server are no repeats, and neither are copies side by side wired to different sources or state keys — controls written alike; copies apart that read different sources are one component, each instance handed its own | a component with props (`components`, `component(id, { props })`) — a source a copy reads handed in as a bound `json` prop (`component(id, { bind: [{ to: 'items', source }] })`, read inside as `props.items`) — or one `list` when they are rows of data side by side; a few cards a person rewords on the canvas can stay cards |
|
|
245
287
|
| `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 |
|
|
246
288
|
| `unused-component` | a component no page, layout or other component places | remove it from `components`, or place it where it was meant to go |
|
|
289
|
+
| `unused-plugin` | a plugin the project declares that no page, layout or component places — built and shipped, drawn nowhere | place it where it was meant to go, or remove its folder from `src/plugins/` |
|
|
247
290
|
| `unused-token` | a token of `variables` no `var(--…)` reads — not a class, an element, `customCss` nor another token | remove it, or write it where its colour is written out |
|
|
248
291
|
|
|
249
292
|
## UPPER_CASE codes
|
|
@@ -21,6 +21,7 @@ Only `opacity` and `transform` (`translate`, `scale`, `rotate`) animate off the
|
|
|
21
21
|
the page hydrates and on a slow phone. Everything else repaints, or lays the page out again, on every frame.
|
|
22
22
|
|
|
23
23
|
- **A preset first:** `motion: { enter: 'fade-up', on: 'view' }` on any element, `stagger: 60` for children one by one,
|
|
24
|
+
`easing: 'ease-in-out'` and `distance: 20` (px) for a reference's own curve and travel — not keyframes of your own —,
|
|
24
25
|
`loop: 'float'` — played by the SDK, cheap and stilled for reduced motion by construction (`npx plitzi explain motion` lists them; `MOTION_ENTERS` and `MOTION_LOOPS` in code).
|
|
25
26
|
`on: 'view'` plays once, the first time the element comes into view, and it stays; `on: 'scroll'` follows the scroll
|
|
26
27
|
both ways — it goes back out as the reader scrolls up past it — so keep it for an effect that is about the scroll.
|
|
@@ -43,8 +44,13 @@ the page hydrates and on a slow phone. Everything else repaints, or lays the pag
|
|
|
43
44
|
`padding` becomes a layout animation).
|
|
44
45
|
- **`will-change`** only on the few elements about to move, never on every item of a list.
|
|
45
46
|
|
|
47
|
+
**Between pages:** `settings.viewTransitions: true` draws each move as one view becoming the next — the pages cross-fade,
|
|
48
|
+
and an element named the same on both (`viewTransitionName: 'product-photo'` in its class) moves from where it was to
|
|
49
|
+
where it lands; give that name to one element per page. None where the browser has none or motion is reduced.
|
|
50
|
+
|
|
46
51
|
`authorSpace` suggests `heavy-animation` for keyframes a class or `customCss` runs off the compositor, naming each
|
|
47
|
-
property and the way out.
|
|
52
|
+
property and the way out. Run on purpose (an original's one entrance), it is quieted on each element wearing the class
|
|
53
|
+
(`quiet: ['heavy-animation']`); one `customCss` runs names no element.
|
|
48
54
|
|
|
49
55
|
## Colours and themes
|
|
50
56
|
|
|
@@ -39,7 +39,8 @@ export const productCard: ComponentSpec = {
|
|
|
39
39
|
})
|
|
40
40
|
};
|
|
41
41
|
|
|
42
|
-
// in the space
|
|
42
|
+
// in the space — the one list every component of it is in, whichever area it serves (a project keeps it beside
|
|
43
|
+
// `components.ts`, in `src/space/components/index.ts`); one area's own is written in its folder and listed there
|
|
43
44
|
components: [productCard],
|
|
44
45
|
pages: [{ name: 'Shop', slug: 'shop', body: [
|
|
45
46
|
component('product-card', { props: { title: 'Lamp', price: 40 }, children: { 'product-card-actions': [button('Buy')] } })
|
|
@@ -58,6 +59,8 @@ pages: [{ name: 'Shop', slug: 'shop', body: [
|
|
|
58
59
|
slot; `children: { '<slot>': [ … ] }` names the slot for each. What fills a slot is the instance's, not the
|
|
59
60
|
component's: it is authored on the page and sees the page's sources. A prop's value is read as a template on the
|
|
60
61
|
instance, so words that show `{{ … }}` as text (docs, a tutorial) go in a slot — a `markdown` child — not in a prop.
|
|
62
|
+
**A slot left empty** — the instance puts nothing in it, and it holds nothing of its own — draws nothing on the
|
|
63
|
+
page, nor its parent's gap; the builder keeps it, the place an author drops into.
|
|
61
64
|
- **Closed.** Inside, nothing but `props` and the globals (`state`, `auth`, `navigation`, `theme`, `variables`,
|
|
62
65
|
`computed`). A binding inside a component onto a provider of the page is refused — "nothing in this component answers
|
|
63
66
|
to …" — because the component would render differently wherever it was placed. Put the provider inside the component,
|
|
@@ -25,11 +25,10 @@ A colour from data binds a custom property — `[{ to: '--who', source, category
|
|
|
25
25
|
completed from what the element publishes (`apiContainer_posts`, `list_postList`; a `form` publishes under
|
|
26
26
|
`apiContainer`). A name nothing answers to, or a prefix that does not match, is refused.
|
|
27
27
|
|
|
28
|
-
**Inside a template the name is spelled in full
|
|
29
|
-
|
|
28
|
+
**Inside a template the name is spelled in full** (`{{ apiContainer_stats.data.total }}`): only a `source` is
|
|
29
|
+
completed, so the short name in a template is refused.
|
|
30
30
|
|
|
31
|
-
An element re-renders when anything it reads changes
|
|
32
|
-
templates name. The globals are `variables`, `navigation` (`routeParams`, `queryParams`, `origin`, `currentPageId`,
|
|
31
|
+
An element re-renders when anything it reads changes. The globals are `variables`, `navigation` (`routeParams`, `queryParams`, `origin`, `currentPageId`,
|
|
33
32
|
`pending` / `pendingLocation` while a link waits for its page's server data),
|
|
34
33
|
`auth` (who is signed in, `status` while that is being found out), `state` (what flows wrote), `theme`
|
|
35
34
|
(`mode`, `resolved`), `host` (the `hostData` an application embedding the space hands the SDK) and `computed` (below).
|
|
@@ -64,9 +63,8 @@ apiContainer({ id: 'board', runtime: 'server', action: 'queue-board' })
|
|
|
64
63
|
|
|
65
64
|
- A provider's source is readable by its **descendants** only. Wrap what reads it; a sibling cannot see it.
|
|
66
65
|
- It publishes its answer plus `isLoading`, `isEmpty`, `hasError`, `errorMessage` — bind a state to those, not to
|
|
67
|
-
guesses. A `query`'s body is `data` in **either runtime
|
|
68
|
-
|
|
69
|
-
`apiContainer_board.columns`, never `.data.columns` (warned `action-output-path`).
|
|
66
|
+
guesses. A `query`'s body is `data` in **either runtime**: moving a provider to the server changes no binding. A connector publishes `records` (or `record`). **An action publishes its output (its last step's return)
|
|
67
|
+
at the root**: `apiContainer_board.columns`, never `.data.columns` (warned `action-output-path`).
|
|
70
68
|
`isEmpty` reads what arrived: a `query`'s body when it is missing, `null`, `''`, `[]` or `{}`; a connector list by
|
|
71
69
|
its `records`; a `singleRecord` provider by its `record`. It is also true before the first answer, so pair it with
|
|
72
70
|
`not isLoading` for an empty state.
|
|
@@ -74,13 +72,25 @@ apiContainer({ id: 'board', runtime: 'server', action: 'queue-board' })
|
|
|
74
72
|
`"{{ source ? apiUrl ~ '/workspaces/' ~ source ~ '/stats' : '' }}"` with `source: 'state.workspace.id'`. A server
|
|
75
73
|
provider's bound `input` (`bindTemplate('input', 'state.c', '{{ { country: source } }}', { returns: 'value' })`)
|
|
76
74
|
asks again on every change; `reloadApi('p', { … })` asks once.
|
|
77
|
-
- An action is handed the page's route and query params as input (`r/:room` → `input.room`)
|
|
78
|
-
|
|
75
|
+
- An action is handed the page's route and query params as input (`r/:room` → `input.room`), with the element's
|
|
76
|
+
`input` laid over them: a key the `input` leaves out still comes from the address — on `/orders?status=open`, an
|
|
77
|
+
`input` of `{{ { } }}` still sends `status: 'open'`, and a test that empties the `input` proves nothing of it. A
|
|
78
|
+
written `input` is sent as is: a `{{ }}` in it is refused (`template-in-value`) — bind it.
|
|
79
79
|
- `isLoading` is true while it is asked again, in either runtime. A newer ask drops the older one; `cancelApi('p')` is a
|
|
80
80
|
STOP: what is shown stays.
|
|
81
|
+
- **`when` makes it wait** (a rule group over sources: `auth.isAuthenticated`, `roomData.found`): it asks nothing
|
|
82
|
+
until it holds. The page server holds a server one's too — reading `navigation`, `auth` and the server providers it
|
|
83
|
+
names — and the browser asks it once it holds there; one on `state` is resolved regardless (`server-when-unknown`).
|
|
81
84
|
- `runtime: 'server'` is resolved by the page server — server data is on unless a space says `rsc: { enabled: false }`.
|
|
82
85
|
Only a page and its layouts are resolved — never inside a component: keep the provider on the page and hand the
|
|
83
86
|
component its rows as a prop ([recipes/server-data.ts](../recipes/server-data.ts)).
|
|
87
|
+
- A server provider's `query` is read by the page server too, so the page arrives with it instead of filling in after
|
|
88
|
+
load: a path of the space (`/data/…`) or another site's address (`https://…`, asked with GET and the headers it
|
|
89
|
+
declares — never the visitor's cookies, never a private address the deployment does not name as its own). Its
|
|
90
|
+
template may read the space's variables and `navigation` (`'{{ apiUrl }}/posts/{{ navigation.routeParams.id }}'`);
|
|
91
|
+
bound, over a `state` or `auth`, with the visitor's cookies or another method it is the browser's alone
|
|
92
|
+
(`server-query-unresolved`): an `action` takes that as its input. What the server reads rides in the page's HTML: a
|
|
93
|
+
file of megabytes the page draws (a map's geometry) stays a browser `query` with `cache: true`.
|
|
84
94
|
|
|
85
95
|
### Typed by a sample
|
|
86
96
|
|
|
@@ -91,6 +101,7 @@ see [typed-sources.md](typed-sources.md).
|
|
|
91
101
|
|
|
92
102
|
Content lives in JSON files read like any API — `apiContainer({ id: 'catalog', query: '/data/games.json', children:
|
|
93
103
|
[ … ] })` — so a real endpoint later changes one `query`. `mockData` is only what the BUILDER shows. Say demo is demo.
|
|
104
|
+
Records written inline (`inline-records`) move to such a file, drawn by one `list`.
|
|
94
105
|
|
|
95
106
|
- **Server project:** `src/data/games.json` answers `/data/games.json`, read by the server, never served. The provider
|
|
96
107
|
is `runtime: 'server'` (the page arrives with it); a browser one is refused (`server-data-in-browser`).
|
|
@@ -98,25 +109,23 @@ Content lives in JSON files read like any API — `apiContainer({ id: 'catalog',
|
|
|
98
109
|
|
|
99
110
|
**`public/` is on the internet**, and so is everything the space's documents hold (pages, variables, attributes,
|
|
100
111
|
`mockData`) and what a provider reads into a page: never a secret, a key or data only some visitors may read. A secret
|
|
101
|
-
is a credential an action or
|
|
102
|
-
|
|
112
|
+
is a credential an action or connector names; data for some visitors comes from a server action answering only what
|
|
113
|
+
is shown, its `access` checking who asks.
|
|
103
114
|
|
|
104
115
|
### Live, cached, refreshed
|
|
105
116
|
|
|
106
|
-
- **Live:** `refreshSeconds: 15` asks again on its own (either runtime)
|
|
107
|
-
|
|
108
|
-
- **Cached:** `cache: true` (
|
|
109
|
-
same thing and across page changes.
|
|
117
|
+
- **Live:** `refreshSeconds: 15` asks again on its own (either runtime), paused in a hidden tab, never overlapping:
|
|
118
|
+
queues, feeds, status boards.
|
|
119
|
+
- **Cached:** `cache: true` (`staleTime`, 30 s) shares an answer between providers asking the same.
|
|
110
120
|
- **Refreshed by writes:** a `webHook` that is not a GET refreshes every request to its own site by default
|
|
111
121
|
(`invalidateQueries: 'origin'`); a `runServerAction` refreshes everything (`'all'`). Narrow it with
|
|
112
122
|
`'elements'` + `invalidateElements: ['orders']`, or stop it with `'none'`.
|
|
113
|
-
- **Say `'none'` when a refresh would move the page on
|
|
114
|
-
→ leave") would leave in the middle of a multi-step form that saves as it goes.
|
|
123
|
+
- **Say `'none'` when a refresh would move the page on** — one that leaves on an answer, mid-form.
|
|
115
124
|
|
|
116
125
|
## Visibility
|
|
117
126
|
|
|
118
|
-
What the page's own data or state shows and hides. What a person switches on
|
|
119
|
-
|
|
127
|
+
What the page's own data or state shows and hides. What a person switches on (a beta, a rollout) is a
|
|
128
|
+
[feature flag](feature-flags.md): gated off, an element is not rendered at all.
|
|
120
129
|
|
|
121
130
|
```ts
|
|
122
131
|
container({ visible: 'posts.hasPosts', … }) // shown while true
|
|
@@ -150,9 +159,9 @@ Rules for a condition's template:
|
|
|
150
159
|
|
|
151
160
|
- **A visibility binding written by hand in `bind` keeps the element on screen until it answers** — a flash for a
|
|
152
161
|
condition on data (`condition-starts-visible` warns); `visible` starts it hidden.
|
|
153
|
-
- **A hidden element stays in the DOM** (`plitzi-component--hidden`), its subtree mounted
|
|
154
|
-
|
|
155
|
-
|
|
162
|
+
- **A hidden element stays in the DOM** (`plitzi-component--hidden`), its subtree mounted — a hidden channel stays
|
|
163
|
+
joined, a hidden provider still asks. `loadStrategy: 'visible'` mounts what it holds only while shown (`'lazy'`: from
|
|
164
|
+
the first time; modals do): for a heavy panel usually hidden, or a container wrapping a channel or provider to stop it.
|
|
156
165
|
- **Once its source has a value, the answer is a yes or a no**: `false`, `0`, `''` and an empty list hide it,
|
|
157
166
|
anything else shows it.
|
|
158
167
|
- **While its source has no value, only a definite answer is written.** `!source` is `true` — shown; a template's
|
|
@@ -65,7 +65,8 @@ And a few the suggestions do not count, because they cost styles rather than ele
|
|
|
65
65
|
space's `elements` defaults (`elements: { heading: { color: 'var(--fg)' } }`), not a class on each.
|
|
66
66
|
- **A shorthand in a class says every side.** On an element wearing two classes, one's `padding` erases the
|
|
67
67
|
`padding-top` the other writes out wherever the stylesheet writes it later; write the longhands it means
|
|
68
|
-
(`class-overrides-class` — a suggestion, quieted like the rest).
|
|
68
|
+
(`class-overrides-class` — a suggestion, quieted like the rest). A shared class made of repeated CSS meets the same:
|
|
69
|
+
its `gap` loses to `btn`'s when `btn` is written later.
|
|
69
70
|
- **Inner parts are slots.** A form control's input, a modal's backdrop, a theme toggle's icons: style them with
|
|
70
71
|
`slots: { input: inputClass }` on the element, or the type's `slots` in `elements` — never a `customCss` rule reaching
|
|
71
72
|
into the element.
|
|
@@ -15,17 +15,17 @@ container([hero, grid]) // an array is the children
|
|
|
15
15
|
|
|
16
16
|
| Authoring field | What it does |
|
|
17
17
|
| --- | --- |
|
|
18
|
-
| `id` | the ONE name
|
|
18
|
+
| `id` | the ONE name it answers to — its key, a binding's source, a step's target. Unique across the WHOLE space |
|
|
19
19
|
| `class` | a shared class: a `styles()` declaration or a name from the space's `classes`; a list for several. Exclusive with `css` |
|
|
20
20
|
| `css` | rules of this element's own: one set, or one per breakpoint (`{ desktop, tablet, mobile }`) |
|
|
21
|
-
| `states` | `hover`, `focus-visible`, `current` (the chosen link,
|
|
21
|
+
| `states` | all there are: `hover`, `focus`, `focus-visible`, `focus-within`, `active` (the press), `disabled`, `checked`, `visited`, `current` (the chosen link, the open tab), `expanded`, `hidden`, `first`/`last`/`odd`/`even` |
|
|
22
22
|
| `variant` | a variant of the class it wears (when the class declares it) or of its type |
|
|
23
|
-
| `slots` | a class for one of
|
|
23
|
+
| `slots` | a class for one of its OTHER selectors — a form control's `input` |
|
|
24
24
|
| `bind` | where a value comes from |
|
|
25
25
|
| `visible` | a condition (`'src'`, `'!src'`, `{ source, template }`), or `false` to start hidden |
|
|
26
26
|
| `flows` | what happens on click, on submit, on load |
|
|
27
27
|
| `runtime` | `'server'` resolves this provider's data on the server |
|
|
28
|
-
| `loadStrategy` | when the contents mount
|
|
28
|
+
| `loadStrategy` | when the contents mount: `eager`, `lazy`, `visible`; left out, `eager` (`lazy` for a modal or a dialog) |
|
|
29
29
|
| `children` | the tree |
|
|
30
30
|
| `meta` | `meta.label` is the element's name in the builder's tree |
|
|
31
31
|
|
|
@@ -34,8 +34,7 @@ reads).
|
|
|
34
34
|
|
|
35
35
|
**A link says where by its `href`:** a page id (`link({ href: 'reports' })`, folder included), a path within the space
|
|
36
36
|
— with `{{tokens}}` if it needs them, a row's own slug (`'/games/{{ list_games.item.slug }}'`) — or a full URL
|
|
37
|
-
(`https:`, `mailto:`, `tel:`), passed through untouched. `mode` follows from it; write it only to say otherwise. A link
|
|
38
|
-
that opens another tab (`target: 'blank'`) gets `rel="noopener noreferrer"`. A link is an `<a>`: never put a link inside
|
|
37
|
+
(`https:`, `mailto:`, `tel:`), passed through untouched. `mode` follows from it; write it only to say otherwise. A link is an `<a>`: never put a link inside
|
|
39
38
|
another link — make the card the link, or the button, not both.
|
|
40
39
|
|
|
41
40
|
**A link's words are its `content`** and an icon its `icon`, as a button's (`link({ href: 'pricing', content:
|
|
@@ -47,8 +46,8 @@ layout lights the right item everywhere.
|
|
|
47
46
|
**An element's `id` is not its HTML id.** It reaches the DOM as `data-plitzi-el`. For a section a URL can land on, give it
|
|
48
47
|
an `anchor` (`anchor: 'plans'` → `id="plans"`: lowercase, digits, `-`) and link to it with `hash`:
|
|
49
48
|
`link({ href: 'home', hash: 'plans' })` goes to `/#plans` and scrolls there, waiting for a section that renders once
|
|
50
|
-
its data arrives. One
|
|
51
|
-
|
|
49
|
+
its data arrives. One per page, layouts included; none in a component. In a list's row it is `<anchor>-<row key>`
|
|
50
|
+
(`hash: 'pick-luna'`). Under a fixed
|
|
52
51
|
header, give the section `scroll-margin-top` (the header's height) so it does not land beneath it.
|
|
53
52
|
|
|
54
53
|
**Some types hold no children.** A `heading`, `text`, `paragraph`, `image`, `formControl`… renders its own attributes
|
|
@@ -79,9 +78,10 @@ A plugin's type is authored the same way: `defineElement(declaration)` — see [
|
|
|
79
78
|
|
|
80
79
|
## CSS
|
|
81
80
|
|
|
82
|
-
Write CSS as you write CSS, shorthands included —
|
|
83
|
-
kebab-case or camelCase (`paddingTop
|
|
84
|
-
`
|
|
81
|
+
Write CSS as you write CSS, shorthands included — expanded to the longhands Plitzi's editor reads. Keys in
|
|
82
|
+
kebab-case or camelCase (`paddingTop`), and a bare number on a length is pixels (`gap: 16`;
|
|
83
|
+
`opacity: 0.5` stays a number). A property outside the vocabulary is refused, as is
|
|
84
|
+
`background: 'var(--x)'`: write `background-color` or `background-image`.
|
|
85
85
|
|
|
86
86
|
- `column(gap, extra?)`, `row(gap, extra?)`, `grid(columns, gap, extra?)` for the three layouts every space repeats.
|
|
87
87
|
- **Breakpoints are ranges, not a cascade.** `tablet` is 48–64rem, `mobile` up to 48rem, and each inherits only from
|
|
@@ -117,10 +117,11 @@ container({ class: card, children: [ … ] });
|
|
|
117
117
|
- One name declared twice with rules that disagree is refused. Declare a class once, in the module that owns it, and
|
|
118
118
|
import it.
|
|
119
119
|
- `ancestors: { [sidebar.name]: { variants: { collapsed: { display: 'none' } } } }` styles an element by the state or
|
|
120
|
-
variant of an ancestor class
|
|
120
|
+
variant of an ancestor class (a descendant selector): a parent's hover or collapse, with no flow; `'>'` is the parent,
|
|
121
121
|
whatever it wears (a component's part: `{ '>': { states: { expanded: … } } }`).
|
|
122
122
|
- `pseudos: { after: { content: '"→"' } }` (`before`/`after` need a quoted `content`; also `selection`, `marker`,
|
|
123
|
-
`placeholder`, `first-letter`, `first-line`)
|
|
123
|
+
`placeholder`, `first-letter`, `first-line`); its element's state goes inside it:
|
|
124
|
+
`pseudos: { before: { states: { hover: … } } }`. `conditions: { 'motion-reduce': …, 'container (max-width: 30rem)': … }`.
|
|
124
125
|
- **`hidden` is how an element looks while its `visible` says no** — where it goes as it hides, and where it comes
|
|
125
126
|
from as it shows. Give the class a transition that includes `display` with `allow-discrete`, and a panel fades or
|
|
126
127
|
slides instead of blinking; the transition on the base is the way in, the one in `hidden` the way out:
|
|
@@ -150,8 +151,8 @@ container({ class: card, children: [ … ] });
|
|
|
150
151
|
- Per element TYPE defaults go in `elements: { heading: { base, states, variants, pseudos, slots } }` — a whole type.
|
|
151
152
|
- **Slots** are an element's parts (not `customCss`): a `formControl`'s `input` (the box), `field` (its `<input>`),
|
|
152
153
|
`label`, `requiredMark`, `error`; a `markdown`'s or `richText`'s `heading`, `heading2`, `link`, `codeBlockFrame`…;
|
|
153
|
-
a `pagination`'s `page` (the one shown: its `current` state). `plitzi explain <type>` lists them
|
|
154
|
-
element's with `slots`, a type's with `elements.<type>.slots`.
|
|
154
|
+
a `pagination`'s `page` (the one shown: its `current` state). `plitzi explain <type>` lists them, and what the element
|
|
155
|
+
writes on its node (`aria-selected`). Style one element's with `slots`, a type's with `elements.<type>.slots`.
|
|
155
156
|
- A `modalContainer` / `dialogContainer` is fixed to the viewport, as tall as its content up to the screen, and 500px
|
|
156
157
|
wide up to the screen; theme its look through its slots.
|
|
157
158
|
|