@notis_ai/cli 0.2.27 → 0.2.28
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/README.md +2 -2
- package/config/notis_app_design_rules.json +5 -123
- package/dist/agent-hooks/notis-agent-hook.mjs +2 -2
- package/dist/base-skills/notis-spaces/.notis-base-skill.json +1 -1
- package/dist/base-skills/notis-spaces/SKILL.md +13 -19
- package/dist/base-skills/notis-spaces/references/design.md +11 -45
- package/dist/base-skills/notis-spaces/references/sdk.md +86 -67
- package/dist/base-skills/notis-spaces/references/views.md +12 -1
- package/dist/sdk/src/components/NotisCommentBoundary.tsx +43 -16
- package/dist/sdk/src/components/NotisSelectionBoundary.tsx +26 -1
- package/dist/sdk/src/components/SelectionActionBar.tsx +262 -0
- package/dist/sdk/src/hooks/useCollectionInteractions.ts +5 -2
- package/dist/sdk/src/space.ts +4 -0
- package/dist/sdk/src/ui/icons.tsx +11 -2
- package/dist/sdk/src/words/actions.ts +9 -1
- package/dist/sdk/src/words/keymap.ts +3 -0
- package/dist/space-harness/host.js +172 -134
- package/dist/space-sdk/dist/{chunk-BWHAORT4.js → chunk-BFGB6XXC.js} +2 -2
- package/dist/space-sdk/dist/index.js +2 -2
- package/dist/space-sdk/dist/ui.js +14 -11
- package/dist/space-sdk/src/components/NotisSelectionBoundary.d.ts +7 -0
- package/dist/space-sdk/src/space.ts +4 -0
- package/dist/space-sdk/src/tailwind-candidates.d.ts +117 -13
- package/dist/space-sdk/src/ui/blocks/DataTable.d.ts +86 -0
- package/dist/space-sdk/src/ui/blocks/InfoTip.d.ts +25 -0
- package/dist/space-sdk/src/ui/blocks/Meter.d.ts +39 -0
- package/dist/space-sdk/src/ui/blocks/blocks.d.ts +1 -1
- package/dist/space-sdk/src/ui/blocks/index.d.ts +6 -0
- package/dist/space-sdk/src/ui/charts/Chart.d.ts +15 -2
- package/dist/space-sdk/src/ui/charts/StatRow.d.ts +4 -3
- package/dist/space-sdk/src/ui/charts/chartData.d.ts +6 -0
- package/dist/space-sdk/src/ui/icons.d.ts +1 -1
- package/dist/space-sdk/src/ui/index.d.ts +2 -2
- package/dist/space-sdk/src/ui/list/Row.d.ts +10 -3
- package/dist/space-sdk/src/ui/period/dateFormat.d.ts +14 -0
- package/dist/space-sdk/src/words/actions.ts +9 -1
- package/dist/space-sdk/src/words/keymap.ts +3 -0
- package/dist/view-renderer/dist/host.js +243 -205
- package/package.json +3 -3
- package/src/command-specs/computer.js +3 -3
- package/template/components/ui/button.tsx +1 -1
- package/template/components/ui/native-select.tsx +1 -1
package/README.md
CHANGED
|
@@ -931,9 +931,9 @@ Examples:
|
|
|
931
931
|
|
|
932
932
|
### `npx --package @notis_ai/cli@latest -- notis computer restart`
|
|
933
933
|
|
|
934
|
-
Restart
|
|
934
|
+
Restart your Cloud Computer, awake or not responding. Its files are kept.
|
|
935
935
|
|
|
936
|
-
When to use:
|
|
936
|
+
When to use: When it is stuck, slow or not responding. Whatever was running on it stops; it answers again in 1 to 2 minutes. An asleep one has nothing to restart.
|
|
937
937
|
|
|
938
938
|
Options:
|
|
939
939
|
- `--yes` — Apply without the Continue? [y/N] question.
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"allow_reason_min_length": 12,
|
|
14
14
|
"profiles": {
|
|
15
15
|
"space": {
|
|
16
|
-
"description": "Every file a Space view can draw from. Used by notis spaces build/verify/preview/deploy and by the server on source-verify, source-stage and source-publish. Rules without a profiles field run in every profile; rules with profiles run only in the listed ones. A rule's profile_messages.<profile> replaces its message and its profile_severity.<profile> its severity in that profile
|
|
16
|
+
"description": "Every file a Space view can draw from. Used by notis spaces build/verify/preview/deploy and by the server on source-verify, source-stage and source-publish. Rules without a profiles field run in every profile; rules with profiles run only in the listed ones. A rule's profile_messages.<profile> replaces its message and its profile_severity.<profile> its severity in that profile. In a Space the rules protect the host frame, theme, keys and words; the look is the Space's own. Comments are blanked before matching.",
|
|
17
17
|
"include": ["app/**", "components/**", "hooks/**", "lib/**", "spaces/**", "src/**", "views/**"],
|
|
18
18
|
"exclude": ["**/*.test.*", "**/*.spec.*", "**/__tests__/**", "**/fixtures/**"]
|
|
19
19
|
}
|
|
@@ -21,70 +21,17 @@
|
|
|
21
21
|
"toolkit_live_pieces": [],
|
|
22
22
|
"toolkit_note": "Rules with a toolkit_piece point at a hand-rolled pattern the live Notis toolkit replaces. They stay warnings until that piece name is added to toolkit_live_pieces, then they refuse like any error.",
|
|
23
23
|
"rules": [
|
|
24
|
-
{
|
|
25
|
-
"id": "no-border-box",
|
|
26
|
-
"severity": "error",
|
|
27
|
-
"profile_severity": { "space": "warn" },
|
|
28
|
-
"pattern": "(?<![\\w-])border(?![\\w-])(?!\\s*:\\s*(?:0(?:px)?|none)\\s*(?:!important\\s*)?(?:[;}]))|(?<![\\w-])border-(?:[xy]|\\d+)(?![\\w-])",
|
|
29
|
-
"message": "Four-side borders are banned. Use a flat tint (bg-muted / bg-background) or a single border-t / border-b hairline between sections.",
|
|
30
|
-
"exclude": ["components/ui/badge.tsx", "components/ui/native-select.tsx"],
|
|
31
|
-
"profile_messages": { "space": "Default look: no four-side borders; a flat tint (bg-muted / bg-background) or one border-t / border-b hairline separates sections. It warns and never blocks: depart from it when the view's own design calls for it." }
|
|
32
|
-
},
|
|
33
24
|
{
|
|
34
25
|
"id": "no-side-bar",
|
|
35
26
|
"severity": "error",
|
|
36
27
|
"pattern": "(?<![\\w-])border-[lrtbse]-(?:[2-8](?![\\w.-])|\\[|(?:primary|destructive|foreground|muted-foreground|ring|accent|current)(?![\\w-]))|\\bshadow-\\[[^\\]\\s]*inset_(?:-?(?:[1-9]|0?\\.\\d*[1-9])|0(?:px)?_-?(?:[2-9]|[1-9]\\d))|(?:box-shadow|boxShadow)\\s*:[^;{}]*\\binset\\s+(?:-?(?:[1-9]|0?\\.\\d*[1-9])|0(?:px)?\\s+-?(?:[2-9]|[1-9]\\d))|(?<![\\w-])border-(?:left|right|top|bottom|inline-start|inline-end|block-start|block-end)(?:\\s*:(?!\\s*(?:(?:0(?:px)?|none)\\b|1px\\s+solid\\s+(?:transparent\\b|(?:hsl\\()?var\\(--[\\w-]*border)))|-width\\s*:(?!\\s*(?:0(?:px)?|1px)\\b)|-color\\s*:(?!\\s*(?:transparent\\b|(?:hsl\\()?var\\(--[\\w-]*border)))|\\bborder(?:Left|Right|Top|Bottom|InlineStart|InlineEnd|BlockStart|BlockEnd)\\s*:\\s*['\\\"`](?!(?:(?:0(?:px)?|none)\\b|1px\\s+solid\\s+(?:transparent\\b|(?:hsl\\()?var\\(--[\\w-]*border)))",
|
|
37
28
|
"message": "One-side edges are banned: no thicker or coloured border and no inset shadow on a single side. Mark a selection or highlight with a background tint (bg-muted) or a 1px ring on all four sides."
|
|
38
29
|
},
|
|
39
|
-
{
|
|
40
|
-
"id": "no-dashed-box",
|
|
41
|
-
"severity": "error",
|
|
42
|
-
"profile_severity": { "space": "warn" },
|
|
43
|
-
"pattern": "\\bborder-dashed\\b",
|
|
44
|
-
"message": "Dashed boxes are banned. Empty states are centered muted text with an optional primary button.",
|
|
45
|
-
"profile_messages": { "space": "Default look: no dashed boxes; an empty state is centred muted text with an optional primary button. It warns and never blocks: depart from it when the view's own design calls for it." }
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
"id": "no-divide",
|
|
49
|
-
"severity": "error",
|
|
50
|
-
"profile_severity": { "space": "warn" },
|
|
51
|
-
"pattern": "\\bdivide-[xy]\\b|<hr\\b",
|
|
52
|
-
"message": "Row dividers are banned. Use spacing, the Row hover from @notis/sdk/ui, or one hairline between sections.",
|
|
53
|
-
"profile_messages": {
|
|
54
|
-
"space": "Default look: no row dividers; Row from @notis/sdk/ui (its spacing and hover tint separate items) or one hairline between sections. It warns and never blocks: depart from it when the view's own design calls for it."
|
|
55
|
-
}
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
"id": "no-ring-box",
|
|
59
|
-
"severity": "error",
|
|
60
|
-
"profile_severity": { "space": "warn" },
|
|
61
|
-
"pattern": "(?<![\\w:-])ring-(?:1|2|4|inset)\\b",
|
|
62
|
-
"message": "Rings as a box or selection indicator are banned. Keep focus-visible:ring-2 on controls; use bg-muted for selection.",
|
|
63
|
-
"profile_messages": { "space": "Default look: no ring as a box; selection is a bg-muted tint and focus-visible:ring-2 stays on controls. It warns and never blocks: depart from it when the view's own design calls for it." }
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
"id": "no-shadow",
|
|
67
|
-
"severity": "error",
|
|
68
|
-
"profile_severity": { "space": "warn" },
|
|
69
|
-
"pattern": "\\bshadow-(?:sm|md|xl|2xl)\\b",
|
|
70
|
-
"message": "Shadows are banned on panels, cards, tiles, and bubbles. Only a floating popover or menu may use shadow-lg with bg-popover.",
|
|
71
|
-
"exclude": ["components/ui/popover.tsx", "components/ui/dropdown-menu.tsx", "components/ui/tooltip.tsx", "components/ui/select.tsx", "components/ui/dialog.tsx", "components/ui/sheet.tsx"],
|
|
72
|
-
"profile_messages": { "space": "Default look: flat panels, cards, tiles and bubbles; only a floating popover or menu takes shadow-lg with bg-popover. It warns and never blocks: depart from it when the view's own design calls for it." }
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
"id": "no-floating-shadow-without-popover",
|
|
76
|
-
"severity": "error",
|
|
77
|
-
"profile_severity": { "space": "warn" },
|
|
78
|
-
"pattern": "^(?!.*bg-popover).*\\bshadow-lg\\b",
|
|
79
|
-
"message": "shadow-lg is only allowed on a floating layer that also uses bg-popover.",
|
|
80
|
-
"exclude": ["components/ui/popover.tsx", "components/ui/dropdown-menu.tsx", "components/ui/tooltip.tsx", "components/ui/select.tsx", "components/ui/dialog.tsx", "components/ui/sheet.tsx"],
|
|
81
|
-
"profile_messages": { "space": "Default look: shadow-lg belongs on a floating layer that also uses bg-popover. It warns and never blocks: depart from it when the view's own design calls for it." }
|
|
82
|
-
},
|
|
83
30
|
{
|
|
84
31
|
"id": "no-palette-hue",
|
|
85
32
|
"severity": "error",
|
|
86
33
|
"pattern": "\\b(?:bg|text|border|ring|from|via|to|fill|stroke|outline|decoration|accent|caret|divide|shadow|placeholder)-(?:red|orange|amber|yellow|lime|green|emerald|teal|cyan|sky|blue|indigo|violet|purple|fuchsia|pink|rose|slate|gray|zinc|neutral|stone)-\\d{2,3}\\b",
|
|
87
|
-
"message": "Hardcoded Tailwind palette colors
|
|
34
|
+
"message": "Hardcoded Tailwind palette colors do not follow the light and dark themes. Use the theme tokens of the host and @notis/sdk/ui (toolkit.css)."
|
|
88
35
|
},
|
|
89
36
|
{
|
|
90
37
|
"id": "no-hex-color",
|
|
@@ -92,46 +39,12 @@
|
|
|
92
39
|
"pattern": "#[0-9a-fA-F]{3}(?:[0-9a-fA-F]{3}(?:[0-9a-fA-F]{2})?)?(?![\\w-])",
|
|
93
40
|
"message": "Hex colors are banned. Use theme tokens (hsl(var(--primary)) with opacity steps for charts)."
|
|
94
41
|
},
|
|
95
|
-
{
|
|
96
|
-
"id": "no-gradient",
|
|
97
|
-
"severity": "error",
|
|
98
|
-
"profile_severity": { "space": "warn" },
|
|
99
|
-
"pattern": "\\bbg-gradient-|linear-gradient\\(|radial-gradient\\(|conic-gradient\\(",
|
|
100
|
-
"message": "Gradients are banned.",
|
|
101
|
-
"profile_messages": { "space": "Default look: no gradients. It warns and never blocks: depart from it when the view's own design calls for it." }
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
"id": "no-backdrop-blur",
|
|
105
|
-
"severity": "error",
|
|
106
|
-
"profile_severity": { "space": "warn" },
|
|
107
|
-
"pattern": "\\bbackdrop-blur",
|
|
108
|
-
"message": "Glassmorphism is banned.",
|
|
109
|
-
"profile_messages": { "space": "Default look: no glassmorphism. It warns and never blocks: depart from it when the view's own design calls for it." }
|
|
110
|
-
},
|
|
111
|
-
{
|
|
112
|
-
"id": "no-eyebrow",
|
|
113
|
-
"severity": "error",
|
|
114
|
-
"profile_severity": { "space": "warn" },
|
|
115
|
-
"pattern": "\\buppercase\\b[^\\n]{0,80}\\btracking-(?:wide|wider|widest|\\[)|\\btracking-(?:wide|wider|widest|\\[)[^\\n]{0,80}\\buppercase\\b",
|
|
116
|
-
"message": "Uppercase tracking eyebrows are banned. Use a plain noun page title and text-xs text-muted-foreground labels.",
|
|
117
|
-
"profile_messages": {
|
|
118
|
-
"space": "Default look: no uppercase tracking eyebrows; labels are text-xs text-muted-foreground and the top bar crumb names the page. It warns and never blocks: depart from it when the view's own design calls for it."
|
|
119
|
-
}
|
|
120
|
-
},
|
|
121
42
|
{
|
|
122
43
|
"id": "no-tiny-text",
|
|
123
44
|
"severity": "error",
|
|
124
45
|
"pattern": "\\btext-\\[(?:[0-9]|1[01])(?:\\.\\d+)?px\\]",
|
|
125
46
|
"message": "Text below 12px is banned. Use text-xs (12px) at minimum."
|
|
126
47
|
},
|
|
127
|
-
{
|
|
128
|
-
"id": "no-badge-outline",
|
|
129
|
-
"severity": "error",
|
|
130
|
-
"profile_severity": { "space": "warn" },
|
|
131
|
-
"pattern": "<Badge\\b[^>]*variant=[\"']outline[\"']",
|
|
132
|
-
"message": "Badge variant=\"outline\" is banned. Use default, secondary, or destructive.",
|
|
133
|
-
"profile_messages": { "space": "Default look: Badge variants default, secondary or destructive. It warns and never blocks: depart from it when the view's own design calls for it." }
|
|
134
|
-
},
|
|
135
48
|
{
|
|
136
49
|
"id": "no-raw-select",
|
|
137
50
|
"severity": "error",
|
|
@@ -148,14 +61,6 @@
|
|
|
148
61
|
"space": "In-page search inputs are banned. Give ListReader a search prop from @notis/sdk/ui: the top bar owns the search field."
|
|
149
62
|
}
|
|
150
63
|
},
|
|
151
|
-
{
|
|
152
|
-
"id": "no-font-serif",
|
|
153
|
-
"severity": "error",
|
|
154
|
-
"profile_severity": { "space": "warn" },
|
|
155
|
-
"pattern": "\\bfont-serif\\b",
|
|
156
|
-
"message": "font-serif is banned. Apps use the portal font.",
|
|
157
|
-
"profile_messages": { "space": "Default look: the portal font. It warns and never blocks: depart from it when the view's own design calls for it." }
|
|
158
|
-
},
|
|
159
64
|
{
|
|
160
65
|
"id": "no-loading-placeholder",
|
|
161
66
|
"severity": "error",
|
|
@@ -177,24 +82,8 @@
|
|
|
177
82
|
"id": "no-page-heading",
|
|
178
83
|
"severity": "error",
|
|
179
84
|
"profiles": ["space"],
|
|
180
|
-
"pattern": "\\bPageHeading\\b|(?<![\\w-])nui-heading(?:-[\\w-]+)?(?![\\w-])
|
|
181
|
-
"message": "Spaces have no in-page title
|
|
182
|
-
},
|
|
183
|
-
{
|
|
184
|
-
"id": "no-space-h1",
|
|
185
|
-
"severity": "error",
|
|
186
|
-
"profiles": ["space"],
|
|
187
|
-
"pattern": "<h1(?![\\w-])|\\bcreateElement\\(\\s*['\\\"`]h1['\\\"`]",
|
|
188
|
-
"message": "A Space never draws an h1: the top bar holds the title. Blocks inside the page take a Section title (an h2) from @notis/sdk/ui."
|
|
189
|
-
},
|
|
190
|
-
{
|
|
191
|
-
"id": "no-centered-column",
|
|
192
|
-
"severity": "error",
|
|
193
|
-
"profile_severity": { "space": "warn" },
|
|
194
|
-
"profiles": ["space"],
|
|
195
|
-
"pattern": "(?<![\\w-])mx-auto(?![\\w-])[^\\n\\\"'`]*(?<![\\w-])(?:max-w-|container(?![\\w-]))|(?<![\\w-])(?:max-w-[\\w\\[\\]./-]+|container)(?![\\w-])[^\\n\\\"'`]*(?<![\\w-])mx-auto(?![\\w-])|(?:max-width|maxWidth)\\s*:[^{}]*\\bmargin(?:-inline|Inline)?\\s*:\\s*['\\\"`]?(?:0(?:px)?\\s+)?auto\\b|\\bmargin(?:-inline|Inline)?\\s*:\\s*['\\\"`]?(?:0(?:px)?\\s+)?auto\\b[^{}]*(?:max-width|maxWidth)\\s*:",
|
|
196
|
-
"message": "Spaces fill their pane edge to edge. Drop the centred column (mx-auto with max-w or container, or max-width with margin auto): Section from @notis/sdk/ui keeps the 24px inset and form fields cap their own width.",
|
|
197
|
-
"profile_messages": { "space": "Default look: a Space fills its pane edge to edge and Section keeps the 24px inset. A centred column is right for a reading, writing or focus layout; elsewhere drop it." }
|
|
85
|
+
"pattern": "\\bPageHeading\\b|(?<![\\w-])nui-heading(?:-[\\w-]+)?(?![\\w-])",
|
|
86
|
+
"message": "Spaces have no in-page page title: the top bar shows the Space and the open record. Remove PageHeading."
|
|
198
87
|
},
|
|
199
88
|
{
|
|
200
89
|
"id": "no-app-shell",
|
|
@@ -225,13 +114,6 @@
|
|
|
225
114
|
"pattern": "<ListReader(?![\\w.])(?:<[^<>]*>)?(?:[^{}>]|\\{(?:[^{}]|\\{(?:[^{}]|\\{[^{}]*\\})*\\})*\\})*?\\s(?:(?:toolbar|header|fill)\\s*=|divided(?![\\w-])|fill(?=[\\s/>]))",
|
|
226
115
|
"message": "ListReader no longer takes toolbar, header, divided or fill. Put the bar in title, tabs, create, viewMenu, infoLine and search; the reader always fills its pane and Row owns the spacing."
|
|
227
116
|
},
|
|
228
|
-
{
|
|
229
|
-
"id": "tiles-galleries-only",
|
|
230
|
-
"severity": "warn",
|
|
231
|
-
"profiles": ["space"],
|
|
232
|
-
"pattern": "\\blayout\\s*=\\s*\\{?\\s*['\\\"`]tiles['\\\"`]|\\brenderTile\\b",
|
|
233
|
-
"message": "Tiles suit a gallery, where each item has a picture or a mark (competitors, integrations, skills to discover). For a working list, rows usually read better; keep tiles when the view's design calls for them."
|
|
234
|
-
},
|
|
235
117
|
{
|
|
236
118
|
"id": "space-no-global-key-listener",
|
|
237
119
|
"severity": "error",
|
|
@@ -265,7 +147,7 @@
|
|
|
265
147
|
"severity": "error",
|
|
266
148
|
"profiles": ["space"],
|
|
267
149
|
"include": ["**/*.tsx", "**/*.jsx"],
|
|
268
|
-
"pattern": "(?:^[ \\t]*|(?<![\\s=]))>[ \\t]*(?=[^<>{}\\n]*[A-Za-z]{2})[A-Za-z][^<>{}\\n=;()&|]*(?:</|\\{)|\\b(?:placeholder|title|aria-label|alt|label)=[\"'](?=[^\"'{}\\n]*[A-Za-z]{2})[^\"'{}\\n]*[\"']",
|
|
150
|
+
"pattern": "(?:^[ \\t]*|(?<![\\s=]))>[ \\t]*(?=[^<>{}\\n]*[A-Za-z]{2})[A-Za-z][^<>{}\\n=;()&|]*(?:</|\\{)|\\b(?:placeholder|title|aria-label|alt|label)=[\"'](?![a-z]+[A-Z_][A-Za-z0-9_]*[\"'])(?=[^\"'{}\\n]*[A-Za-z]{2})[^\"'{}\\n]*[\"']",
|
|
269
151
|
"message": "A Space keeps its visible words in its words table (or uses a toolkit piece that owns its words) and renders them from there, never as a literal in JSX."
|
|
270
152
|
},
|
|
271
153
|
{
|
|
@@ -46136,8 +46136,8 @@ var computerCommandSpecs = [{
|
|
|
46136
46136
|
}
|
|
46137
46137
|
}, {
|
|
46138
46138
|
command_path: ["computer", "restart"],
|
|
46139
|
-
summary: "Restart
|
|
46140
|
-
when_to_use: "
|
|
46139
|
+
summary: "Restart your Cloud Computer, awake or not responding. Its files are kept.",
|
|
46140
|
+
when_to_use: "When it is stuck, slow or not responding. Whatever was running on it stops; it answers again in 1 to 2 minutes. An asleep one has nothing to restart.",
|
|
46141
46141
|
args_schema: { arguments: [], options: [YES_OPTION] },
|
|
46142
46142
|
examples: ["notis computer restart", "notis computer restart --yes"],
|
|
46143
46143
|
mutates: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"schema":1,"stamp":
|
|
1
|
+
{"schema":1,"stamp":1794414114,"commit":"b30c41a5c3e0b065aaf9a0be08c918eea77be86d"}
|
|
@@ -128,39 +128,33 @@ with them. When it is not, write your own layout on the hooks and blocks
|
|
|
128
128
|
`EmptyState`, `Notice`): your markup, the host's keys and words
|
|
129
129
|
([the sample](references/views.md#a-view-of-your-own)). Both are normal
|
|
130
130
|
choices; do not bend a request into `ListReader` because it is the closest
|
|
131
|
-
piece, and do not hand-roll what a piece already does well.
|
|
132
|
-
|
|
133
|
-
When you start from a piece, change it as shallowly as the design allows:
|
|
134
|
-
options (`density`, `openAs`, `layout`, `look`, `autoOpen`, `search`,
|
|
135
|
-
`actions`, an action's `key`), then slots (`row`, `reader`, `tabs`, `create`,
|
|
136
|
-
`viewMenu`, `infoLine`, `readerLabel`, `readerActions`, `crumbLabel`,
|
|
137
|
-
`renderTile`, `empty`), then your own layout on the hooks. A rewrite of a piece
|
|
138
|
-
stops receiving that piece's fixes, so do it when the design needs it, not by
|
|
139
|
-
default.
|
|
131
|
+
piece, and do not hand-roll what a piece already does well. A piece you rewrite
|
|
132
|
+
stops receiving that piece's fixes.
|
|
140
133
|
|
|
141
134
|
## Rules the pieces cannot hold for you
|
|
142
135
|
|
|
136
|
+
- Sidebar children are for short lists people navigate: a few sub-Spaces, or a
|
|
137
|
+
`collection` whose records stay few (folders of notes). A database that grows
|
|
138
|
+
every week is listed in the view, never as sidebar rows
|
|
139
|
+
([Records in the sidebar](references/views.md#records-in-the-sidebar)).
|
|
143
140
|
- Standard actions (`archive`, `complete`, `star`, `delete`...) take Notis's
|
|
144
141
|
words, key and toast: give only `id` and `run`. A Space's own action, label or
|
|
145
142
|
text brings an `{ en, fr }` pair; no English literal in JSX.
|
|
146
143
|
- Never add `keydown` listeners on `window` or `document`; use `useShortcut` or
|
|
147
144
|
the hooks above. Never portal to `document.body`; use `Menu`, `Popover`,
|
|
148
145
|
`Tooltip`, or `useLayerRoot()` as the container.
|
|
149
|
-
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
`bg-muted`), never hex, palette hues or raw rgb. A highlight is a ring on all
|
|
146
|
+
- The host top bar shows Space / view and the open item, and `ListReader`
|
|
147
|
+
`search` uses it, so a Space draws no second search field. The Space fills
|
|
148
|
+
the frame.
|
|
149
|
+
- Colours from the theme tokens of the host and `toolkit.css`, never hex,
|
|
150
|
+
palette hues or raw rgb. A highlight is a ring on all
|
|
155
151
|
four sides, never a coloured or thicker edge on one side. No fixed viewport
|
|
156
152
|
heights (`h-screen`, `vh`): use `h-full`, `flex-1`, `min-h-0`.
|
|
157
153
|
- The design check (run by every `notis spaces build`, and by the server on
|
|
158
154
|
publish) and `notis spaces verify` (390 and 1440 px, EN and FR) must pass
|
|
159
155
|
before any deploy. Its errors protect the host: frame, theme, keys, layers and
|
|
160
|
-
words. Its warnings
|
|
161
|
-
|
|
162
|
-
pieces a hand-made pattern could use; they never block. Keep a warning when
|
|
163
|
-
the view's design calls for it, and fix it when it was an accident.
|
|
156
|
+
words. Its warnings name the toolkit pieces a hand-made pattern could
|
|
157
|
+
use; they never block.
|
|
164
158
|
- A Space updates in place: pull it, change it, deploy it to the same Space ID.
|
|
165
159
|
Never ship a change as a new Space or a Store copy.
|
|
166
160
|
|
|
@@ -2,47 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
Decide what the view is for before choosing how to build it: what the person
|
|
4
4
|
does there, what they look at first, how dense or calm it should be. Then take
|
|
5
|
-
what fits from `@notis/sdk/ui
|
|
6
|
-
|
|
7
|
-
[SKILL.md](../SKILL.md#three-layers)). Either way the host frame, theme tokens,
|
|
8
|
-
keyboard engine and EN/FR words stay Notis's.
|
|
9
|
-
|
|
10
|
-
## Pick the piece
|
|
11
|
-
|
|
12
|
-
| The view shows | Start from |
|
|
13
|
-
| --- | --- |
|
|
14
|
-
| A list beside an open item (tickets, notes, inbox) | `ListReader` ([sample](views.md#write-the-view)) |
|
|
15
|
-
| The same records as a table | `ListReader` with `layout: 'table'` |
|
|
16
|
-
| A gallery where each item has a picture or a mark (competitors, integrations, skills to discover) | `ListReader` with `layout: 'tiles'` and `renderTile` |
|
|
17
|
-
| Items on dates | `CalendarView` (month, week, agenda) |
|
|
18
|
-
| Items over time, by lane | `TimelineView` |
|
|
19
|
-
| Items by stage, moved from one stage to the next (a sales funnel, a production pipeline) | `BoardView`: one column per stage, `onMove` to move tiles |
|
|
20
|
-
| Numbers over a period | `Section kind="bar"` with `PeriodPicker`, `StatRow`, `Section kind="chart"` with `Chart`, `Section kind="data"` with `ChartTable`, top to bottom, full width |
|
|
21
|
-
| One record as the page | `DocumentPage` (see [SDK](sdk.md#first-party-record-components)). Pick its `width` for the page: `standard` (the default) is a centred 900 px reading column for a page read as text, `wide` (1200 px) or `full` for a record that is a working surface such as a wide table or board |
|
|
22
|
-
| A form or settings page | `Section kind="form"`, `Button`, `NativeSelect`, `SegmentedControl`, `Notice`, `EmptyState` |
|
|
23
|
-
| A list on your own layout | `useListKeys`, `useSelection`, `Row`, `SelectionBar`, `Panels` |
|
|
24
|
-
| Files or pictures attached to an item, or a picture to open full screen | `AttachmentGallery` (opens `ImageViewer` on its images); `ImageViewer` alone for one picture ([SDK](sdk.md#toolkit-pieces)) |
|
|
25
|
-
| Anything none of these fit: one record at a time, a focus or practice screen, a canvas, a planner, a page laid out like a magazine, a mix of blocks | Your own layout on `useShortcut`, `Section`, `Button`, `EmptyState`, `Notice` and the hooks above ([sample](views.md#a-view-of-your-own)) |
|
|
26
|
-
|
|
27
|
-
The table is a starting point, not a menu to fit the request into. If a stock
|
|
28
|
-
piece would make the view worse for what the person does there, write your own.
|
|
5
|
+
what fits from `@notis/sdk/ui` ([SDK](sdk.md#toolkit-pieces)). The host frame,
|
|
6
|
+
theme tokens, keyboard engine and EN/FR words stay Notis's.
|
|
29
7
|
|
|
30
8
|
Floating UI comes from `Menu`, `Popover` and `Tooltip`; they open inside the
|
|
31
9
|
Space and pick up its theme. Open as Side, Center or Full belongs to the list
|
|
32
|
-
(`openAs`, `OpenAsMenu`)
|
|
10
|
+
(`openAs`, `OpenAsMenu`).
|
|
33
11
|
|
|
34
12
|
## Layout
|
|
35
13
|
|
|
36
14
|
The host top bar shows the title: Space / view with the view icon, and the
|
|
37
|
-
description as a tooltip. A Space
|
|
38
|
-
|
|
39
|
-
frame with no outer padding wrapper; a centred column (`mx-auto` with `max-w-*`)
|
|
40
|
-
is for a reading, writing or focus layout, and the reader article gets its
|
|
41
|
-
measure from the toolkit. The default look is flat: list toolbars are one 44px
|
|
42
|
-
tab row with a "+" at the right end, sections have no boxes. A view of your own
|
|
43
|
-
may depart from that look (cards, a border, a shadow, a different type scale)
|
|
44
|
-
when its design calls for it; the design check warns so you decide, and never
|
|
45
|
-
blocks it.
|
|
15
|
+
description as a tooltip. A Space does not draw its own search field; set
|
|
16
|
+
`search` on `ListReader`. The Space fills the frame.
|
|
46
17
|
|
|
47
18
|
- **Crumb.** An open item adds its name to the top bar crumb ("Product /
|
|
48
19
|
Tickets / PRO-002") in every open mode; `crumbLabel` on `ListReader` names it,
|
|
@@ -66,12 +37,6 @@ blocks it.
|
|
|
66
37
|
- **Drag to select.** A list that selects several gets the Manager's marquee
|
|
67
38
|
for free: a drag from empty space selects the rows under it. Do not build
|
|
68
39
|
your own.
|
|
69
|
-
- **Sections.** A dashboard, form or settings page is a stack of `Section`
|
|
70
|
-
kinds, full width: `bar` for the period and filters, `stats`, `chart`, `data`
|
|
71
|
-
for a table and `form`. A section title and count sit in its head; the page
|
|
72
|
-
itself has no title. Put the bar's pills and picker in its `tabs` slot as
|
|
73
|
-
they are: a `TabRow` folds what does not fit into More and other controls
|
|
74
|
-
scroll in the one row, so add no wrapper or overflow CSS of your own.
|
|
75
40
|
|
|
76
41
|
Do not rebuild what the host already shows: the sidebar, top bar, title, search
|
|
77
42
|
field, folder tree, chat, help sheet or selection bar. Let the phone layout come from
|
|
@@ -127,14 +92,15 @@ multi-field edit or a destructive confirmation.
|
|
|
127
92
|
## Look at the result
|
|
128
93
|
|
|
129
94
|
`notis spaces build` runs the design check and reports each rule broken by file
|
|
130
|
-
and line; the server runs it again on publish. Errors block; warnings
|
|
131
|
-
|
|
132
|
-
|
|
95
|
+
and line; the server runs it again on publish. Errors block; warnings name toolkit
|
|
96
|
+
pieces you could use, and they never block. Passing it does not prove the design
|
|
97
|
+
is good. Then run `notis spaces verify`, which draws every view at 390
|
|
133
98
|
and 1440 px in EN and FR, once with data and once while the reads are still
|
|
134
99
|
pending, and actually look at both images:
|
|
135
100
|
|
|
136
|
-
- Does the
|
|
137
|
-
|
|
101
|
+
- Does the first screen answer the one question the person opens the page for,
|
|
102
|
+
and does what needs action stand out?
|
|
103
|
+
- Do counts agree across sections?
|
|
138
104
|
- Does the view fill the host frame, also while loading?
|
|
139
105
|
- Does the pending image keep the final layout: same tab row and panes, a
|
|
140
106
|
skeleton where content will be, no Loading text and no empty state? Fix every
|
|
@@ -37,60 +37,6 @@ Text a person writes and reviews:
|
|
|
37
37
|
are gone reads Text changed. Do not build your own highlights. Pins on a page
|
|
38
38
|
use `useComments` with `CommentPane` (see Comments under Toolkit pieces).
|
|
39
39
|
|
|
40
|
-
## Records and declared reads
|
|
41
|
-
|
|
42
|
-
| API | Use |
|
|
43
|
-
| --- | --- |
|
|
44
|
-
| `useViewParams<typeof definition>()` | `{params, invalid, missing, declared, ready, setParams}` for declared typed URL params. Unknown names are dropped; invalid values use their declared default. `setParams(changes, {replace?})` changes this view's own params (`null` removes one) and keeps the same Space and record open. |
|
|
45
|
-
| `useShown<Row>(name, options?)` | Execute the native list in `shows[name]` with current params. Options: `sorts`, `pageSize`, `offset`, `includeContent`, `allPages` (every page, for a whole count or a local search); rows are in `data?.rows` and the schema revision a write needs in `data?.schema_revision`, with `loading`, `hasData`, `isFetching`, `error`, `refetch` (resolves to the read's error, or null when it succeeded; it never rejects). |
|
|
46
|
-
| `useShownAvailable(name)` | Check whether this host exposes the declared native list. A record Site can expose only its exact server-pinned row scope. |
|
|
47
|
-
| `useAction<Inputs, Result>(name)` / `useActionQuery<Result>(name, inputs, options?)` | Call a declared action (`call(inputs, options)`); read the result of a declared read action. Never call account-wide tools from a Space. When a read action answers with native rows, pass `rows: { binding, at, query? }` (`at`: the answer field holding them, `''` for a bare list; `query`: the native query it runs) so native writes to that database show in it at once too; without it the read only refreshes after the write. A failed call throws a `SpaceActionError`; its `code` is `rate_limited` when the provider refused it for sending too fast (it did not run, and Notis already waited and retried safe calls), so offer a retry after a few seconds instead of adding your own limiter, and `read_timeout` when a read took too long. |
|
|
48
|
-
| `useNativeMutation(binding, operation)` | Insert, update or delete one row of a linked database through the action that declares `LOCAL_NOTIS_DATABASE_INSERT`, `_UPDATE` or `_DELETE` on that binding with `request: { $input: 'request' }`. `mutate(input, {schemaRevision, requestId, showIn?})` returns the receipt (`record_key`, `revision`). The write shows in every list of that database at once, before the server answers: an edited row changes where it is (and moves to its sorted place, or leaves a `useNativeDocuments` read whose filter no longer keeps it), a new row joins the reads whose filter it passes and the `shows` lists named by `showIn` (by default the view's only list over that database), and a delete moves the record to the bin and leaves every list. A failed write puts the server's rows back. Do not keep your own copy of the change on top. One new request ID per effect. An insert action takes no `content_markdown`: insert, then save the body with `useNativeDocumentBody` and the record's revision. |
|
|
49
|
-
| `useNativeDelete(binding)` | Trash many rows of one linked database (a deck and its slides, a multi-select). `deleteMany(inputs, {schemaRevision, requestId})` hides every row from the lists at once, runs the writes a few at a time, each with the request ID `${requestId}:${record_key}` (a retry with the same `requestId` replays instead of trashing twice), refreshes the lists once at the end and brings back the rows whose write failed. It never throws for a failed row: it resolves to `{done, failed}`; say how many failed. Use it rather than a loop of `mutate`. |
|
|
50
|
-
| `useNativeDocumentBody(binding, recordKey, {readAction, writeAction?, enabled?})` | Markdown body adapter. Keep drafts in the view; save with the original content, record/schema revisions and stable request ID. Rich editing normally uses `DocumentEditor`. |
|
|
51
|
-
| `useNotis()` | Host resource, Space labels, route and ready state. Use `resource.id` for the current Space identity. |
|
|
52
|
-
|
|
53
|
-
Keep hooks unconditional. `loading` means no first successful read;
|
|
54
|
-
`isFetching` includes a silent refresh. Do not copy rows into mount-only state
|
|
55
|
-
or clear them on error ([loading rules](design.md#loading-empty-and-error)).
|
|
56
|
-
`Skeleton` and `ViewSkeleton` come from `@notis/sdk`; `ViewSkeleton`'s `label`
|
|
57
|
-
names what loads (`{ en: 'Loading meetings', fr: 'Chargement des réunions' }`),
|
|
58
|
-
said in the Space's language, default Loading content. Its shapes are
|
|
59
|
-
measured from the view at verify time and drawn from the release; `skeletonKey`
|
|
60
|
-
(default `main`) names the region when a view has several separately loading
|
|
61
|
-
parts, and `variant` only draws the fallback before the first measured release.
|
|
62
|
-
|
|
63
|
-
For another explicitly idempotent read use `useActionQuery`, or
|
|
64
|
-
`useQuery(keyArray, readCallback, { readOnly: true })` with every input in the
|
|
65
|
-
key. Call declared read actions inside a custom read with
|
|
66
|
-
`{ readOnly: true, dedupe: true }`; never mark a whole tool family read-only.
|
|
67
|
-
`useQueryClient().prefetch(...)` with the exact foreground key prepares a small
|
|
68
|
-
known read after render or on hover; never prefetch a write, a polling action or
|
|
69
|
-
a fan-out aggregate. The host keeps one in-memory cache per account, Space,
|
|
70
|
-
version and permission; do not add module-global or `localStorage` caches of
|
|
71
|
-
user data.
|
|
72
|
-
|
|
73
|
-
## First-party record components
|
|
74
|
-
|
|
75
|
-
| Component | Contract |
|
|
76
|
-
| --- | --- |
|
|
77
|
-
| `<DocumentPage recordKey>` | A record as the view's main content: save state, menu, cover, icon, title, meta, properties that save automatically, collaborative body. Slots `breadcrumb`, `actions`, `menuItems`, `aboveBody`, `belowBody`; toggles `share` (off by default, never for a report record), `header`, `meta`, `properties`, `width` (`standard` 900 px centred column by default, `wide` 1200 px, `full`); `viewer: 'html'` shows a record whose one stored `.html` file is the page; `onSaved`; `layout`. Pair with `DocumentPageSkeleton` and `usePrefetchRecord()`. It is the usual `reader` slot of `ListReader`; there it takes no `breadcrumb`, because the top bar crumb already names the open record. A page with a `breadcrumb` (a record opened from the view) names the top bar crumb leaf with its title itself; `topBarTitle` overrides that, and `onTitle` hears the title. |
|
|
78
|
-
| `<DocumentEditor recordKey>` | Native collaborative body, properties, images and attachments. With separate properties use `showProperties={false}`. |
|
|
79
|
-
| `<RecordProperties recordKey>` | Native revision-checked property editing. |
|
|
80
|
-
| `<HtmlFrame recordKey>` | Attached HTML under viewer CSP and an opaque-origin sandbox. Source cannot relax that boundary. `onReady` is called once per page after it has loaded and painted, or when the record cannot load: keep a slide hidden until then instead of showing a half-drawn page. `presentation={{ onAction }}` turns the pointer into a laser dot inside the page, keeps its buttons and links clickable, and hands the presenter's keys and plain clicks back as `next`, `previous`, `first`, `last` or `stop`; the page can send the same actions, so treat them as navigation only. |
|
|
81
|
-
| `<ReportFrame recordKey>` | A report row's saved independent implementation in its database's current view. |
|
|
82
|
-
| `<ShareControl recordKey>` | Private/shared record Site, copy link and revoke. |
|
|
83
|
-
| `<SpacePageFrame href>` | Another Notis Space page, live in this view: `href` is a Notis link (a path or a full link of this origin, such as a Page property). The Portal shows only that page's view (no sidebar, top bar or chat) with the viewer's own session and permissions. `interactive` (default `false`) lets it take clicks and keys; off, the view around it (a deck's arrows and swipes) keeps them. `title`, `className` (sizes the box it fills). Any other link, and every verify or build preview, shows a card with the title, the path and Open page. |
|
|
84
|
-
|
|
85
|
-
In its own Space's view, a record's Site is a row of the top bar Share panel, not
|
|
86
|
-
a toolbar button. The published Space declares the database binding; the server
|
|
87
|
-
rechecks record scope and binding revision. A Site exposes read-only body and
|
|
88
|
-
property snapshots and HTML for its pinned record, including a declared
|
|
89
|
-
non-collection record param. A report row cannot be shared as a Site; a report
|
|
90
|
-
saved as an HTML file can. A Site has no upload, collaboration credential,
|
|
91
|
-
authoring controls or sharing mutation. No credentials or filesystem URLs belong
|
|
92
|
-
in component props.
|
|
93
|
-
|
|
94
40
|
## Toolkit pieces
|
|
95
41
|
|
|
96
42
|
From `@notis/sdk/ui`. Their props live in the piece types; read them there
|
|
@@ -109,7 +55,10 @@ rather than from a copy.
|
|
|
109
55
|
`auto` for a move the list makes itself, or `url`), `renderTile` (tiles), `look` (`two-tone` keeps
|
|
110
56
|
the list tinted) and `autoOpen` (opens the first item). It has no toolbar or
|
|
111
57
|
header slot. `Row` takes `wrap` (title lines) and `now` (a fixed clock for
|
|
112
|
-
relative times)
|
|
58
|
+
relative times); a `Row` drawn on its own (a short "Needs action" list)
|
|
59
|
+
takes `onPress` and `pressLabel` and opens something on press, so never wrap
|
|
60
|
+
a row in a button of your own. A `labels` entry with a tone draws as a small
|
|
61
|
+
tinted pill. Drag to select is automatic on a list that selects several
|
|
113
62
|
(`selectable` or a bulk action): a drag from empty space selects the rows
|
|
114
63
|
under it, as in the Manager; `dragSelect={false}` turns it off. Reorder is
|
|
115
64
|
off until the view passes `reorder={{ onReorder, canReorder }}`: a row then
|
|
@@ -136,17 +85,34 @@ rather than from a copy.
|
|
|
136
85
|
only reads. Use it rather than columns of your own.
|
|
137
86
|
- **Time and numbers**: `PeriodPicker` with `usePeriod`, `DayPicker`,
|
|
138
87
|
`CalendarView`, `TimelineView`, `Chart`, `StatRow`, `ChartTable`,
|
|
139
|
-
`RenderChartData
|
|
140
|
-
|
|
141
|
-
in a measured axis, and its value after it; `labelFormat` gives that short
|
|
88
|
+
`RenderChartData`, `Meter`, `DataTable`, `formatDuration`. `Chart` stacks
|
|
89
|
+
bars or areas (`stacked`) and runs bars left to right (`horizontal`): each
|
|
90
|
+
label on up to two lines before its bar in a measured axis, and its value after it; `labelFormat` gives that short
|
|
142
91
|
value ("1.2k") while `format` stays the exact tooltip and table text. Draw
|
|
143
92
|
category bars this way rather than with your own recharts. For a chart of
|
|
144
93
|
your own, `ChartContainer` takes `aspect` or `height`; `ChartTooltipContent`
|
|
145
94
|
and `ChartLegend` also work outside it; `<Bar shape={barShape}
|
|
146
95
|
label={{ content: barLabel }} />` keeps zero bars and their value labels. A
|
|
147
|
-
sparkline `null` is a gap. `
|
|
148
|
-
|
|
149
|
-
|
|
96
|
+
sparkline `null` is a gap. `domain={[min, max]}` fixes the value scale (a
|
|
97
|
+
percentage on 0 to 100) and `valueAxis` draws it on the left through
|
|
98
|
+
`labelFormat` (without a `domain` its top rises to a round quarter); x labels thin out with the room and never run off the edge. `PeriodPicker` without the `custom` preset offers
|
|
99
|
+
presets only. `Meter` is a labelled capacity bar (`label`, `value`, `max`,
|
|
100
|
+
`valueText`, `hint`); at or past `limit` (a tick named by `limitLabel`) it
|
|
101
|
+
turns destructive. Set `limit` only to a threshold the data has (a memory
|
|
102
|
+
reserve, a quota), never to `max`: a full meter is not red by itself. `DataTable` is a read-only table with the `ChartTable`
|
|
103
|
+
look for rows that are not figures: `columns` (`id`, `label`, `cell`, `align`, `width`,
|
|
104
|
+
`mono`, `primary`, `hideBelow`), `rows` or `groups` (`key`, `label`, `rows`),
|
|
105
|
+
`rowKey`, and `onRowPress` with `rowLabel` to open a row (the primary cell
|
|
106
|
+
then sits inside the row's button: text and icons only, no link). The primary
|
|
107
|
+
column never gets under its `minWidth` (120 px by default): the last
|
|
108
|
+
columns that do not fit hide on their own.
|
|
109
|
+
`formatDuration(ms, locale, { units, smallest })` writes "1 h 31 min" (FR
|
|
110
|
+
"4 j 6 h").
|
|
111
|
+
- **Floating**: `Menu`, `Popover`, `Tooltip`, `InfoTip`. `InfoTip` is the
|
|
112
|
+
info button beside a label (a figure's `about`, a section heading, a meter):
|
|
113
|
+
`label` names what it explains and the children are one or two sentences
|
|
114
|
+
that open on press or tap. A `Tooltip` never shows on touch, so explanations
|
|
115
|
+
go in an `InfoTip`.
|
|
150
116
|
- **Files and pictures**: `AttachmentGallery` and `ImageViewer`, the ones
|
|
151
117
|
Notis conversations use. `AttachmentGallery` draws a row of file cards
|
|
152
118
|
(`items`: `url`, `name`, `type` or `kind`, `size`, `thumbnailUrl`); an
|
|
@@ -181,11 +147,10 @@ rather than from a copy.
|
|
|
181
147
|
previews, a timer). The browser asks once to place windows on screens; the
|
|
182
148
|
desktop app never asks. Leaving the view closes the audience window.
|
|
183
149
|
- **Blocks**: `Section`, `Badge`, `Button`, `ToggleGroup`, `SegmentedControl`,
|
|
184
|
-
`NativeSelect`, `EmptyState`, `Notice`, `Metric`. A
|
|
185
|
-
`
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
no card: the host top bar shows the title. One toggle is a `Button` with
|
|
150
|
+
`NativeSelect`, `EmptyState`, `Notice`, `Metric`. A `Section`'s `kind`
|
|
151
|
+
is `bar` (period and filters), `stats`, `chart`, `data` (a table) or `form`,
|
|
152
|
+
and its head takes `title`, `count`, `meta`, `tabs` and `actions`. There is no
|
|
153
|
+
page heading: the host top bar shows the title. One toggle is a `Button` with
|
|
189
154
|
`pressed`; several with any number on (filters, chart series) are a
|
|
190
155
|
`ToggleGroup`; tabs and filters over a whole list or section are pills
|
|
191
156
|
(`TabRow`); a `SegmentedControl` is only a mode switch inside a section.
|
|
@@ -216,7 +181,61 @@ Move to triage, and a Space whose first stop has a name passes
|
|
|
216
181
|
A status maps to one of ten groups (`backlog`, `todo`, `active`, `review`,
|
|
217
182
|
`waiting`, `done`, `cancelled`, `failed`, and `up`/`down` for a service), each
|
|
218
183
|
with its icon, words and the one status palette: pass the Space's own status to
|
|
219
|
-
`Row` or `StatusIcon` (with `label` for its own name)
|
|
184
|
+
`Row` or `StatusIcon` (with `label` for its own name).
|
|
185
|
+
|
|
186
|
+
## Records and declared reads
|
|
187
|
+
|
|
188
|
+
| API | Use |
|
|
189
|
+
| --- | --- |
|
|
190
|
+
| `useViewParams<typeof definition>()` | `{params, invalid, missing, declared, ready, setParams}` for declared typed URL params. Unknown names are dropped; invalid values use their declared default. `setParams(changes, {replace?})` changes this view's own params (`null` removes one) and keeps the same Space and record open. |
|
|
191
|
+
| `useShown<Row>(name, options?)` | Execute the native list in `shows[name]` with current params. Options: `sorts`, `pageSize`, `offset`, `includeContent`, `allPages` (every page, for a whole count or a local search); rows are in `data?.rows` and the schema revision a write needs in `data?.schema_revision`, with `loading`, `hasData`, `isFetching`, `error`, `refetch` (resolves to the read's error, or null when it succeeded; it never rejects). |
|
|
192
|
+
| `useShownAvailable(name)` | Check whether this host exposes the declared native list. A record Site can expose only its exact server-pinned row scope. |
|
|
193
|
+
| `useAction<Inputs, Result>(name)` / `useActionQuery<Result>(name, inputs, options?)` | Call a declared action (`call(inputs, options)`); read the result of a declared read action. Never call account-wide tools from a Space. When a read action answers with native rows, pass `rows: { binding, at, query? }` (`at`: the answer field holding them, `''` for a bare list; `query`: the native query it runs) so native writes to that database show in it at once too; without it the read only refreshes after the write. A failed call throws a `SpaceActionError`; its `code` is `rate_limited` when the provider refused it for sending too fast (it did not run, and Notis already waited and retried safe calls), so offer a retry after a few seconds instead of adding your own limiter, and `read_timeout` when a read took too long. |
|
|
194
|
+
| `useNativeMutation(binding, operation)` | Insert, update or delete one row of a linked database through the action that declares `LOCAL_NOTIS_DATABASE_INSERT`, `_UPDATE` or `_DELETE` on that binding with `request: { $input: 'request' }`. `mutate(input, {schemaRevision, requestId, showIn?})` returns the receipt (`record_key`, `revision`). The write shows in every list of that database at once, before the server answers: an edited row changes where it is (and moves to its sorted place, or leaves a `useNativeDocuments` read whose filter no longer keeps it), a new row joins the reads whose filter it passes and the `shows` lists named by `showIn` (by default the view's only list over that database), and a delete moves the record to the bin and leaves every list. A failed write puts the server's rows back. Do not keep your own copy of the change on top. One new request ID per effect. An insert action takes no `content_markdown`: insert, then save the body with `useNativeDocumentBody` and the record's revision. |
|
|
195
|
+
| `useNativeDelete(binding)` | Trash many rows of one linked database (a deck and its slides, a multi-select). `deleteMany(inputs, {schemaRevision, requestId})` hides every row from the lists at once, runs the writes a few at a time, each with the request ID `${requestId}:${record_key}` (a retry with the same `requestId` replays instead of trashing twice), refreshes the lists once at the end and brings back the rows whose write failed. It never throws for a failed row: it resolves to `{done, failed}`; say how many failed. Use it rather than a loop of `mutate`. |
|
|
196
|
+
| `useNativeDocumentBody(binding, recordKey, {readAction, writeAction?, enabled?})` | Markdown body adapter. Keep drafts in the view; save with the original content, record/schema revisions and stable request ID. Rich editing normally uses `DocumentEditor`. |
|
|
197
|
+
| `useNotis()` | Host resource, Space labels, route and ready state. Use `resource.id` for the current Space identity. |
|
|
198
|
+
|
|
199
|
+
Keep hooks unconditional. `loading` means no first successful read;
|
|
200
|
+
`isFetching` includes a silent refresh. Do not copy rows into mount-only state
|
|
201
|
+
or clear them on error ([loading rules](design.md#loading-empty-and-error)).
|
|
202
|
+
`Skeleton` and `ViewSkeleton` come from `@notis/sdk`; `ViewSkeleton`'s `label`
|
|
203
|
+
names what loads (`{ en: 'Loading meetings', fr: 'Chargement des réunions' }`),
|
|
204
|
+
said in the Space's language, default Loading content. Its shapes are
|
|
205
|
+
measured from the view at verify time and drawn from the release; `skeletonKey`
|
|
206
|
+
(default `main`) names the region when a view has several separately loading
|
|
207
|
+
parts, and `variant` only draws the fallback before the first measured release.
|
|
208
|
+
|
|
209
|
+
For another explicitly idempotent read use `useActionQuery`, or
|
|
210
|
+
`useQuery(keyArray, readCallback, { readOnly: true })` with every input in the
|
|
211
|
+
key. Call declared read actions inside a custom read with
|
|
212
|
+
`{ readOnly: true, dedupe: true }`; never mark a whole tool family read-only.
|
|
213
|
+
`useQueryClient().prefetch(...)` with the exact foreground key prepares a small
|
|
214
|
+
known read after render or on hover; never prefetch a write, a polling action or
|
|
215
|
+
a fan-out aggregate. The host keeps one in-memory cache per account, Space,
|
|
216
|
+
version and permission; do not add module-global or `localStorage` caches of
|
|
217
|
+
user data.
|
|
218
|
+
|
|
219
|
+
## First-party record components
|
|
220
|
+
|
|
221
|
+
| Component | Contract |
|
|
222
|
+
| --- | --- |
|
|
223
|
+
| `<DocumentPage recordKey>` | A record as the view's main content: save state, menu, cover, icon, title, meta, properties that save automatically, collaborative body. Slots `breadcrumb`, `actions`, `menuItems`, `aboveBody`, `belowBody`; toggles `share` (off by default, never for a report record), `header`, `meta`, `properties`, `width` (`standard` 900 px centred column by default, `wide` 1200 px, `full`); `viewer: 'html'` shows a record whose one stored `.html` file is the page; `onSaved`; `layout`. Pair with `DocumentPageSkeleton` and `usePrefetchRecord()`. It is the usual `reader` slot of `ListReader`; there it takes no `breadcrumb`, because the top bar crumb already names the open record. A page with a `breadcrumb` (a record opened from the view) names the top bar crumb leaf with its title itself; `topBarTitle` overrides that, and `onTitle` hears the title. |
|
|
224
|
+
| `<DocumentEditor recordKey>` | Native collaborative body, properties, images and attachments. With separate properties use `showProperties={false}`. |
|
|
225
|
+
| `<RecordProperties recordKey>` | Native revision-checked property editing. |
|
|
226
|
+
| `<HtmlFrame recordKey>` | Attached HTML under viewer CSP and an opaque-origin sandbox. Source cannot relax that boundary. `onReady` is called once per page after it has loaded and painted, or when the record cannot load: keep a slide hidden until then instead of showing a half-drawn page. `presentation={{ onAction }}` turns the pointer into a laser dot inside the page, keeps its buttons and links clickable, and hands the presenter's keys and plain clicks back as `next`, `previous`, `first`, `last` or `stop`; the page can send the same actions, so treat them as navigation only. |
|
|
227
|
+
| `<ReportFrame recordKey>` | A report row's saved independent implementation in its database's current view. |
|
|
228
|
+
| `<ShareControl recordKey>` | Private/shared record Site, copy link and revoke. |
|
|
229
|
+
| `<SpacePageFrame href>` | Another Notis Space page, live in this view: `href` is a Notis link (a path or a full link of this origin, such as a Page property). The Portal shows only that page's view (no sidebar, top bar or chat) with the viewer's own session and permissions. `interactive` (default `false`) lets it take clicks and keys; off, the view around it (a deck's arrows and swipes) keeps them. `title`, `className` (sizes the box it fills). Any other link, and every verify or build preview, shows a card with the title, the path and Open page. |
|
|
230
|
+
|
|
231
|
+
In its own Space's view, a record's Site is a row of the top bar Share panel, not
|
|
232
|
+
a toolbar button. The published Space declares the database binding; the server
|
|
233
|
+
rechecks record scope and binding revision. A Site exposes read-only body and
|
|
234
|
+
property snapshots and HTML for its pinned record, including a declared
|
|
235
|
+
non-collection record param. A report row cannot be shared as a Site; a report
|
|
236
|
+
saved as an HTML file can. A Site has no upload, collaboration credential,
|
|
237
|
+
authoring controls or sharing mutation. No credentials or filesystem URLs belong
|
|
238
|
+
in component props.
|
|
220
239
|
|
|
221
240
|
## Navigation
|
|
222
241
|
|
|
@@ -84,6 +84,17 @@ The saved `read` action is deliberately constrained to one native record for
|
|
|
84
84
|
body and record-Site reads; `shows.notes` owns the Editor's collection list. Keep
|
|
85
85
|
both tied to the same declared resource.
|
|
86
86
|
|
|
87
|
+
## Records in the sidebar
|
|
88
|
+
|
|
89
|
+
`collection` lists the database's records as rows under the Space in the
|
|
90
|
+
sidebar. Declare it only when the list stays short and people navigate it like
|
|
91
|
+
pages: folders of a notes Space, the chapters of a guide, a handful of decks.
|
|
92
|
+
Leave it out when records keep coming (candidates, leads, tickets, meetings,
|
|
93
|
+
logs, anything a skill or automation adds every week): show them in the view
|
|
94
|
+
with `shows` and a `ListReader` or table, which has search, filters and tabs.
|
|
95
|
+
The sidebar lists a row's first 10 records and a Show more row adds 10 at a
|
|
96
|
+
time, so a long collection still works, but it buries every Space below it.
|
|
97
|
+
|
|
87
98
|
A Site of the whole Space (or of one of its pages) runs each `shows` list
|
|
88
99
|
through such an action too, and that one-record action refuses the list's
|
|
89
100
|
request. Publishing is then refused with `site_list_action_required`. For a
|
|
@@ -166,7 +177,7 @@ no title, heading or search field of its own. `archive` is a standard action: it
|
|
|
166
177
|
brings its own words and key. `pin` is the Space's own: it brings its EN and FR
|
|
167
178
|
words and a key the clash check accepts. Add `tabs` for real saved filters and
|
|
168
179
|
`create` for a "+" that makes a record. Other kinds of view start from their own
|
|
169
|
-
piece; see [
|
|
180
|
+
piece; see [the toolkit pieces](sdk.md#toolkit-pieces).
|
|
170
181
|
|
|
171
182
|
## A view of your own
|
|
172
183
|
|