@notis_ai/cli 0.2.18 → 0.2.19
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 +542 -146
- package/bin/check-runtime.js +15 -0
- package/bin/notis.js +2 -0
- package/config/notis_app_design_rules.json +320 -0
- package/config/portal-route-roots.json +45 -0
- package/dist/agent-hooks/notis-agent-hook.mjs +42325 -18273
- package/dist/base-skills/notis-cli/.notis-base-skill.json +1 -0
- package/dist/base-skills/notis-cli/SKILL.md +51 -280
- package/dist/base-skills/notis-cli/references/app-delivery.md +17 -0
- package/dist/base-skills/notis-cli/references/intelligence.md +94 -0
- package/dist/base-skills/notis-cli/references/native-databases.md +21 -0
- package/dist/base-skills/notis-cli/references/tool-examples.md +56 -0
- package/dist/base-skills/notis-cli/references/troubleshooting.md +67 -0
- package/dist/base-skills/notis-query/.notis-base-skill.json +1 -0
- package/dist/base-skills/notis-query/SKILL.md +35 -699
- package/dist/base-skills/notis-query/references/database-discovery.md +59 -0
- package/dist/base-skills/notis-query/references/documents.md +74 -0
- package/dist/base-skills/notis-query/references/query.md +76 -0
- package/dist/base-skills/notis-spaces/.notis-base-skill.json +1 -0
- package/dist/base-skills/notis-spaces/SKILL.md +218 -0
- package/dist/base-skills/notis-spaces/references/architecture.md +116 -0
- package/dist/base-skills/notis-spaces/references/context.md +81 -0
- package/dist/base-skills/notis-spaces/references/design.md +141 -0
- package/dist/base-skills/notis-spaces/references/fixtures.md +29 -0
- package/dist/base-skills/notis-spaces/references/memory.md +58 -0
- package/dist/base-skills/notis-spaces/references/reading.md +73 -0
- package/dist/base-skills/notis-spaces/references/release.md +120 -0
- package/dist/base-skills/notis-spaces/references/reports.md +77 -0
- package/dist/base-skills/notis-spaces/references/sdk.md +273 -0
- package/dist/base-skills/notis-spaces/references/store.md +118 -0
- package/dist/base-skills/notis-spaces/references/troubleshooting.md +28 -0
- package/dist/base-skills/notis-spaces/references/views.md +229 -0
- package/{template/packages → dist}/sdk/package.json +9 -10
- package/dist/sdk/src/agentContext.ts +36 -0
- package/dist/sdk/src/bundleModule.ts +175 -0
- package/dist/sdk/src/components/Dialog.tsx +103 -0
- package/dist/sdk/src/components/DocumentEditor.tsx +113 -0
- package/dist/sdk/src/components/DocumentPage.tsx +184 -0
- package/{template/packages → dist}/sdk/src/components/Markdown.tsx +9 -3
- package/{template/packages → dist}/sdk/src/components/MarkdownEditor.tsx +26 -5
- package/{template/packages → dist}/sdk/src/components/MultiSelectActionBar.tsx +95 -12
- package/{template/packages → dist}/sdk/src/components/MultiSelectCheckbox.tsx +4 -2
- package/dist/sdk/src/components/NotisCommentBoundary.tsx +172 -0
- package/{template/packages → dist}/sdk/src/components/NotisSelectionBoundary.tsx +9 -5
- package/dist/sdk/src/components/RecordComponents.tsx +111 -0
- package/dist/sdk/src/components/Skeleton.tsx +38 -0
- package/dist/sdk/src/config.ts +31 -0
- package/{template/packages → dist}/sdk/src/documents.ts +21 -6
- package/dist/sdk/src/hooks/useAction.ts +28 -0
- package/dist/sdk/src/hooks/useAgentContext.ts +23 -0
- package/{template/packages → dist}/sdk/src/hooks/useBackend.ts +3 -2
- package/dist/sdk/src/hooks/useCloudComputer.ts +94 -0
- package/dist/sdk/src/hooks/useCloudComputerShell.ts +114 -0
- package/{template/packages → dist}/sdk/src/hooks/useCollectionInteractions.ts +157 -147
- package/dist/sdk/src/hooks/useDatabaseSchema.ts +50 -0
- package/{template/packages → dist}/sdk/src/hooks/useDatabaseSubscription.ts +2 -2
- package/dist/sdk/src/hooks/useDocument.ts +51 -0
- package/{template/packages → dist}/sdk/src/hooks/useDocuments.ts +25 -59
- package/{template/packages → dist}/sdk/src/hooks/useHandover.ts +7 -7
- package/dist/sdk/src/hooks/useLongPressSelection.ts +79 -0
- package/dist/sdk/src/hooks/useMarqueeSelection.ts +194 -0
- package/{template/packages → dist}/sdk/src/hooks/useMultiSelect.ts +2 -8
- package/dist/sdk/src/hooks/useNativeDocumentBody.ts +50 -0
- package/dist/sdk/src/hooks/useNativeDocuments.ts +143 -0
- package/{template/packages → dist}/sdk/src/hooks/useNotis.ts +6 -1
- package/dist/sdk/src/hooks/useNotisNavigation.ts +70 -0
- package/dist/sdk/src/hooks/useQuery.ts +81 -0
- package/dist/sdk/src/hooks/useToolQuery.ts +12 -0
- package/dist/sdk/src/hooks/useTopBarSearch.ts +102 -0
- package/dist/sdk/src/hooks/useTopBarTitleLeaf.ts +75 -0
- package/{template/packages → dist}/sdk/src/hooks/useUpsertDocument.ts +1 -1
- package/dist/sdk/src/hooks/useViewParams.ts +195 -0
- package/dist/sdk/src/hooks/useViewerReads.ts +129 -0
- package/{template/packages → dist}/sdk/src/index.ts +64 -1
- package/{template/packages → dist}/sdk/src/interactions/actions.ts +14 -1
- package/{template/packages → dist}/sdk/src/interactions/shortcuts.tsx +129 -23
- package/dist/sdk/src/interactions/visibility.ts +13 -0
- package/{template/packages → dist}/sdk/src/interactions.ts +5 -1
- package/dist/sdk/src/nativeData.ts +39 -0
- package/{template/packages → dist}/sdk/src/provider.tsx +9 -4
- package/dist/sdk/src/queryCache.ts +292 -0
- package/dist/sdk/src/queryErrors.ts +51 -0
- package/dist/sdk/src/runtime.ts +675 -0
- package/dist/sdk/src/runtimeModules.ts +33 -0
- package/dist/sdk/src/space.ts +442 -0
- package/dist/sdk/src/standardViewParams.ts +36 -0
- package/{template/packages → dist}/sdk/src/styles.css +81 -16
- package/dist/sdk/src/tailwind.ts +66 -0
- package/dist/sdk/src/ui/charts/RenderChartData.tsx +25 -0
- package/dist/sdk/src/ui/engine/core.ts +392 -0
- package/dist/sdk/src/ui/engine/dom.ts +183 -0
- package/dist/sdk/src/ui/engine/hooks.ts +195 -0
- package/dist/sdk/src/ui/engine/instance.ts +63 -0
- package/dist/sdk/src/ui/engine/keycapContext.ts +2 -0
- package/dist/sdk/src/ui/engine/registry.ts +262 -0
- package/dist/sdk/src/ui/engine/types.ts +62 -0
- package/dist/sdk/src/ui/icons.tsx +91 -0
- package/dist/sdk/src/ui/util.ts +83 -0
- package/dist/sdk/src/viewPeriod.ts +26 -0
- package/dist/sdk/src/vite.ts +92 -0
- package/dist/sdk/src/words/actions.ts +295 -0
- package/dist/sdk/src/words/clashes.ts +158 -0
- package/dist/sdk/src/words/format.ts +136 -0
- package/dist/sdk/src/words/index.ts +13 -0
- package/dist/sdk/src/words/keymap.ts +72 -0
- package/dist/sdk/src/words/keys.ts +297 -0
- package/dist/sdk/src/words/shell.ts +46 -0
- package/dist/sdk/src/words/types.ts +65 -0
- package/dist/skill-sync/index.js +832 -151
- package/dist/skill-sync/index.js.map +4 -4
- package/dist/skill-sync-worker.mjs +3941 -0
- package/dist/space-harness/host.js +1460 -0
- package/dist/space-sdk/dist/chunk-ZSN57ATH.js +5 -0
- package/dist/space-sdk/dist/index.js +15 -0
- package/dist/space-sdk/dist/ui.js +18 -0
- package/dist/space-sdk/package.json +33 -0
- package/dist/space-sdk/src/agentContext.d.ts +36 -0
- package/dist/space-sdk/src/components/Dialog.d.ts +20 -0
- package/dist/space-sdk/src/components/DocumentEditor.d.ts +46 -0
- package/dist/space-sdk/src/components/DocumentPage.d.ts +53 -0
- package/dist/space-sdk/src/components/Markdown.d.ts +18 -0
- package/dist/space-sdk/src/components/MarkdownEditor.d.ts +11 -0
- package/dist/space-sdk/src/components/MultiSelectActionBar.d.ts +31 -0
- package/dist/space-sdk/src/components/MultiSelectCheckbox.d.ts +14 -0
- package/dist/space-sdk/src/components/MultiSelectDragOverlay.d.ts +8 -0
- package/dist/space-sdk/src/components/NotisCommentBoundary.d.ts +36 -0
- package/dist/space-sdk/src/components/NotisSelectionBoundary.d.ts +16 -0
- package/dist/space-sdk/src/components/RecordComponents.d.ts +64 -0
- package/dist/space-sdk/src/components/ShortcutHints.d.ts +12 -0
- package/dist/space-sdk/src/components/Skeleton.d.ts +23 -0
- package/dist/space-sdk/src/config.ts +31 -0
- package/dist/space-sdk/src/documents.d.ts +59 -0
- package/dist/space-sdk/src/hooks/useAction.d.ts +8 -0
- package/dist/space-sdk/src/hooks/useActiveResource.d.ts +3 -0
- package/dist/space-sdk/src/hooks/useAgentContext.d.ts +7 -0
- package/dist/space-sdk/src/hooks/useBackend.d.ts +23 -0
- package/dist/space-sdk/src/hooks/useCloudComputer.d.ts +45 -0
- package/dist/space-sdk/src/hooks/useCloudComputerShell.d.ts +49 -0
- package/dist/space-sdk/src/hooks/useCollectionInteractions.d.ts +118 -0
- package/dist/space-sdk/src/hooks/useDatabaseSchema.d.ts +14 -0
- package/dist/space-sdk/src/hooks/useDatabaseSubscription.d.ts +26 -0
- package/dist/space-sdk/src/hooks/useDocument.d.ts +22 -0
- package/dist/space-sdk/src/hooks/useDocuments.d.ts +31 -0
- package/dist/space-sdk/src/hooks/useHandover.d.ts +43 -0
- package/dist/space-sdk/src/hooks/useLongPressSelection.d.ts +9 -0
- package/dist/space-sdk/src/hooks/useMarqueeSelection.d.ts +57 -0
- package/dist/space-sdk/src/hooks/useMultiSelect.d.ts +51 -0
- package/dist/space-sdk/src/hooks/useNativeDocumentBody.d.ts +24 -0
- package/dist/space-sdk/src/hooks/useNativeDocuments.d.ts +55 -0
- package/dist/space-sdk/src/hooks/useNotis.d.ts +25 -0
- package/dist/space-sdk/src/hooks/useNotisNavigation.d.ts +33 -0
- package/dist/space-sdk/src/hooks/useQuery.d.ts +22 -0
- package/dist/space-sdk/src/hooks/useTool.d.ts +20 -0
- package/dist/space-sdk/src/hooks/useToolQuery.d.ts +3 -0
- package/dist/space-sdk/src/hooks/useTools.d.ts +15 -0
- package/dist/space-sdk/src/hooks/useTopBarSearch.d.ts +48 -0
- package/dist/space-sdk/src/hooks/useTopBarTitleLeaf.d.ts +24 -0
- package/dist/space-sdk/src/hooks/useUpsertDocument.d.ts +27 -0
- package/dist/space-sdk/src/hooks/useViewParams.d.ts +76 -0
- package/dist/space-sdk/src/hooks/useViewerReads.d.ts +38 -0
- package/dist/space-sdk/src/index.d.ts +98 -0
- package/dist/space-sdk/src/interactions/actions.d.ts +33 -0
- package/dist/space-sdk/src/interactions/shortcuts.d.ts +42 -0
- package/dist/space-sdk/src/interactions/visibility.d.ts +2 -0
- package/dist/space-sdk/src/nativeData.d.ts +66 -0
- package/dist/space-sdk/src/provider.d.ts +17 -0
- package/dist/space-sdk/src/queryCache.d.ts +45 -0
- package/dist/space-sdk/src/queryErrors.ts +51 -0
- package/dist/space-sdk/src/runtime.d.ts +615 -0
- package/dist/space-sdk/src/runtimeModules.ts +33 -0
- package/dist/space-sdk/src/space.ts +442 -0
- package/dist/space-sdk/src/standardViewParams.d.ts +15 -0
- package/dist/space-sdk/src/tailwind-candidates.d.ts +3418 -0
- package/dist/space-sdk/src/tailwind.ts +66 -0
- package/dist/space-sdk/src/ui/actions/ActionToast.d.ts +15 -0
- package/dist/space-sdk/src/ui/actions/actionWords.d.ts +16 -0
- package/dist/space-sdk/src/ui/actions/index.d.ts +7 -0
- package/dist/space-sdk/src/ui/actions/useActions.d.ts +69 -0
- package/dist/space-sdk/src/ui/actions/useToast.d.ts +41 -0
- package/dist/space-sdk/src/ui/blocks/Tabs.d.ts +139 -0
- package/dist/space-sdk/src/ui/blocks/blocks.d.ts +217 -0
- package/dist/space-sdk/src/ui/blocks/index.d.ts +4 -0
- package/dist/space-sdk/src/ui/board/BoardView.d.ts +36 -0
- package/dist/space-sdk/src/ui/board/boardModel.d.ts +46 -0
- package/dist/space-sdk/src/ui/board/boardWords.d.ts +9 -0
- package/dist/space-sdk/src/ui/board/index.d.ts +5 -0
- package/dist/space-sdk/src/ui/calendar/CalendarView.d.ts +49 -0
- package/dist/space-sdk/src/ui/calendar/DayPicker.d.ts +23 -0
- package/dist/space-sdk/src/ui/calendar/calendarMath.d.ts +81 -0
- package/dist/space-sdk/src/ui/charts/Chart.d.ts +203 -0
- package/dist/space-sdk/src/ui/charts/ChartTable.d.ts +37 -0
- package/dist/space-sdk/src/ui/charts/RenderChartData.d.ts +16 -0
- package/dist/space-sdk/src/ui/charts/StatRow.d.ts +59 -0
- package/dist/space-sdk/src/ui/charts/chartData.d.ts +84 -0
- package/dist/space-sdk/src/ui/comments/CommentPane.d.ts +58 -0
- package/dist/space-sdk/src/ui/comments/commentModel.d.ts +157 -0
- package/dist/space-sdk/src/ui/comments/commentWords.d.ts +60 -0
- package/dist/space-sdk/src/ui/comments/index.d.ts +4 -0
- package/dist/space-sdk/src/ui/comments/useComments.d.ts +146 -0
- package/dist/space-sdk/src/ui/engine/HelpSheet.d.ts +12 -0
- package/dist/space-sdk/src/ui/engine/KeyboardEngine.d.ts +27 -0
- package/dist/space-sdk/src/ui/engine/core.d.ts +73 -0
- package/dist/space-sdk/src/ui/engine/hooks.d.ts +64 -0
- package/dist/space-sdk/src/ui/engine/index.d.ts +14 -0
- package/dist/space-sdk/src/ui/engine/instance.d.ts +21 -0
- package/dist/space-sdk/src/ui/engine/keycapContext.d.ts +2 -0
- package/dist/space-sdk/src/ui/engine/registry.d.ts +77 -0
- package/dist/space-sdk/src/ui/engine/step.d.ts +11 -0
- package/dist/space-sdk/src/ui/engine/types.d.ts +54 -0
- package/dist/space-sdk/src/ui/fields/fieldWords.d.ts +56 -0
- package/dist/space-sdk/src/ui/fields/fields.d.ts +162 -0
- package/dist/space-sdk/src/ui/fields/index.d.ts +5 -0
- package/dist/space-sdk/src/ui/fields/useFieldDraft.d.ts +22 -0
- package/dist/space-sdk/src/ui/gallery/AttachmentGallery.d.ts +53 -0
- package/dist/space-sdk/src/ui/gallery/ImageViewer.d.ts +27 -0
- package/dist/space-sdk/src/ui/gallery/galleryWords.d.ts +95 -0
- package/dist/space-sdk/src/ui/gallery/index.d.ts +5 -0
- package/dist/space-sdk/src/ui/icons.d.ts +13 -0
- package/dist/space-sdk/src/ui/index.d.ts +54 -0
- package/dist/space-sdk/src/ui/keycap/Keycap.d.ts +22 -0
- package/dist/space-sdk/src/ui/keycap/index.d.ts +2 -0
- package/dist/space-sdk/src/ui/layout/Panels.d.ts +50 -0
- package/dist/space-sdk/src/ui/layout/chatPanelEdge.d.ts +77 -0
- package/dist/space-sdk/src/ui/layout/index.d.ts +5 -0
- package/dist/space-sdk/src/ui/layout/panelMath.d.ts +91 -0
- package/dist/space-sdk/src/ui/list/ListReader.d.ts +380 -0
- package/dist/space-sdk/src/ui/list/Row.d.ts +145 -0
- package/dist/space-sdk/src/ui/list/SelectionBar.d.ts +65 -0
- package/dist/space-sdk/src/ui/list/index.d.ts +14 -0
- package/dist/space-sdk/src/ui/list/rowState.d.ts +22 -0
- package/dist/space-sdk/src/ui/list/useListKeys.d.ts +89 -0
- package/dist/space-sdk/src/ui/list/useReorder.d.ts +86 -0
- package/dist/space-sdk/src/ui/list/useSelection.d.ts +90 -0
- package/dist/space-sdk/src/ui/open/OpenAsMenu.d.ts +15 -0
- package/dist/space-sdk/src/ui/open/index.d.ts +6 -0
- package/dist/space-sdk/src/ui/open/openModeStore.d.ts +39 -0
- package/dist/space-sdk/src/ui/open/useOpenMode.d.ts +17 -0
- package/dist/space-sdk/src/ui/overlay/Menu.d.ts +88 -0
- package/dist/space-sdk/src/ui/overlay/Popover.d.ts +28 -0
- package/dist/space-sdk/src/ui/overlay/Tooltip.d.ts +19 -0
- package/dist/space-sdk/src/ui/overlay/index.d.ts +9 -0
- package/dist/space-sdk/src/ui/overlay/layerRoot.d.ts +24 -0
- package/dist/space-sdk/src/ui/overlay/position.d.ts +31 -0
- package/dist/space-sdk/src/ui/period/PeriodPicker.d.ts +30 -0
- package/dist/space-sdk/src/ui/period/dateFormat.d.ts +50 -0
- package/dist/space-sdk/src/ui/period/dateWords.d.ts +88 -0
- package/dist/space-sdk/src/ui/period/periods.d.ts +70 -0
- package/dist/space-sdk/src/ui/period/usePeriod.d.ts +23 -0
- package/dist/space-sdk/src/ui/present/index.d.ts +3 -0
- package/dist/space-sdk/src/ui/present/presentWords.d.ts +27 -0
- package/dist/space-sdk/src/ui/present/screens.d.ts +36 -0
- package/dist/space-sdk/src/ui/present/useAudienceScreen.d.ts +38 -0
- package/dist/space-sdk/src/ui/styles.d.ts +21 -0
- package/dist/space-sdk/src/ui/timeline/TimelineView.d.ts +44 -0
- package/dist/space-sdk/src/ui/timeline/timelineMath.d.ts +123 -0
- package/dist/space-sdk/src/viewPeriod.d.ts +8 -0
- package/dist/space-sdk/src/vite.ts +92 -0
- package/dist/space-sdk/src/words/actions.ts +295 -0
- package/dist/space-sdk/src/words/clashes.ts +158 -0
- package/dist/space-sdk/src/words/format.ts +136 -0
- package/dist/space-sdk/src/words/index.ts +13 -0
- package/dist/space-sdk/src/words/keymap.ts +72 -0
- package/dist/space-sdk/src/words/keys.ts +297 -0
- package/dist/space-sdk/src/words/shell.ts +46 -0
- package/dist/space-sdk/src/words/types.ts +65 -0
- package/dist/view-renderer/dist/host.css +1 -0
- package/dist/view-renderer/dist/host.js +2374 -0
- package/dist/view-renderer/dist/theme.css +73 -0
- package/dist/view-renderer/src/dom.js +212 -0
- package/dist/view-renderer/src/errors.js +8 -0
- package/dist/view-renderer/src/host.tsx +250 -0
- package/dist/view-renderer/src/index.js +4 -0
- package/dist/view-renderer/src/png.js +213 -0
- package/dist/view-renderer/src/pool.js +110 -0
- package/dist/view-renderer/src/remote-broker.js +59 -0
- package/dist/view-renderer/src/renderer.js +271 -0
- package/package.json +21 -11
- package/skills/notis-cli/AGENT_INSTRUCTIONS.md +63 -12
- package/skills/notis-onboarding/BRIEF.md +14 -9
- package/skills/notis-query/cli.md +1 -1
- package/skills/notis-spaces/cli.md +540 -0
- package/src/cli.js +8 -8
- package/src/command-specs/agents.js +121 -8
- package/src/command-specs/auth.js +3 -3
- package/src/command-specs/diagnostics.js +97 -20
- package/src/command-specs/documents.js +158 -0
- package/src/command-specs/files.js +29 -0
- package/src/command-specs/handover.js +331 -79
- package/src/command-specs/helpers.js +50 -40
- package/src/command-specs/index.js +14 -5
- package/src/command-specs/meta.js +38 -9
- package/src/command-specs/onboarding.js +1 -1
- package/src/command-specs/profile.js +42 -1
- package/src/command-specs/skills.js +314 -9
- package/src/command-specs/smoke.js +16 -4
- package/src/command-specs/spaces.js +783 -0
- package/src/command-specs/tools.js +118 -21
- package/src/command-specs/version-history.js +20 -0
- package/src/command-specs/views.js +69 -0
- package/src/runtime/agent-browser.js +178 -267
- package/src/runtime/agent-setup.js +172 -13
- package/src/runtime/app-boundary-validator.js +338 -2
- package/src/runtime/app-data-literals.js +82 -0
- package/src/runtime/app-platform.js +750 -1570
- package/src/runtime/auth-recovery.js +17 -0
- package/src/runtime/base-skills.d.ts +11 -0
- package/src/runtime/base-skills.js +100 -3
- package/src/runtime/computer-identity.d.ts +30 -0
- package/src/runtime/computer-identity.js +151 -0
- package/src/runtime/config-lock.js +135 -0
- package/src/runtime/confined-space-build.js +74 -0
- package/src/runtime/confined-space-verify.js +49 -0
- package/src/runtime/delegated-context.js +5 -21
- package/src/runtime/native-record-files.js +47 -0
- package/src/runtime/oauth.js +342 -31
- package/src/runtime/profiles.js +19 -112
- package/src/runtime/retired-sdk-files.js +24 -0
- package/src/runtime/retry.js +150 -0
- package/src/runtime/skill-sync/cloud-client.ts +33 -8
- package/src/runtime/skill-sync/index.ts +443 -106
- package/src/runtime/skill-sync/local-scanner.ts +248 -32
- package/src/runtime/skill-sync/native-identity.ts +102 -0
- package/src/runtime/skill-sync/native-plan.ts +70 -0
- package/src/runtime/skill-sync/symlink-manager.ts +66 -16
- package/src/runtime/skill-sync/sync-plan.ts +34 -2
- package/src/runtime/skill-sync/types.ts +54 -0
- package/src/runtime/skill-sync/write-cloud-skill.ts +4 -4
- package/src/runtime/skill-sync-service.js +109 -0
- package/src/runtime/source-root.js +32 -0
- package/src/runtime/space-collection-scaffold.js +107 -0
- package/src/runtime/space-database-structures.js +229 -0
- package/src/runtime/space-fixture-broker.js +68 -0
- package/src/runtime/space-lock.js +337 -0
- package/src/runtime/space-platform.js +133 -0
- package/src/runtime/space-source.js +290 -0
- package/src/runtime/space-test-server.js +354 -0
- package/src/runtime/space-verification.js +94 -0
- package/src/runtime/space-verify-browser-worker.js +51 -0
- package/src/runtime/space-view-manifest.js +368 -0
- package/src/runtime/sync-skills.d.ts +5 -1
- package/src/runtime/sync-skills.js +11 -2
- package/src/runtime/tool-confirmation.js +138 -0
- package/src/runtime/transport.js +118 -24
- package/src/runtime/upsell.js +219 -0
- package/src/runtime/view-render.js +49 -0
- package/src/skill-sync-worker-entry.js +2 -0
- package/src/skill-sync-worker.js +114 -0
- package/src/space-harness-host.ts +122 -0
- package/template/.harness/index.html.tmpl +9 -352
- package/template/app/globals.css +29 -3
- package/template/app/layout.tsx +2 -6
- package/template/components/ui/badge.tsx +7 -4
- package/template/components/ui/button.tsx +1 -1
- package/template/components/ui/native-select.tsx +24 -0
- package/template/notis.config.ts +4 -36
- package/template/package-lock.json +1800 -1867
- package/template/package.json +16 -14
- package/template/postcss.config.mjs +1 -1
- package/template/tailwind.config.ts +1 -6
- package/template/tsconfig.json +1 -0
- package/template/vite.config.ts +2 -2
- package/dist/base-skills/notis-apps/SKILL.md +0 -613
- package/skills/notis-apps/cli.md +0 -285
- package/src/command-specs/apps.js +0 -3011
- package/src/runtime/app-changelog.js +0 -79
- package/src/runtime/app-dev-consumers.js +0 -154
- package/src/runtime/app-dev-host-lock.js +0 -80
- package/src/runtime/app-dev-process-identity.js +0 -111
- package/src/runtime/app-dev-roots.js +0 -284
- package/src/runtime/app-dev-server.js +0 -1140
- package/src/runtime/app-dev-sessions.js +0 -185
- package/src/runtime/app-registry-scaffolds.js +0 -367
- package/src/runtime/assets/store-screenshot-dark.png +0 -0
- package/src/runtime/cli-mode.generated.js +0 -5
- package/src/runtime/cli-mode.js +0 -34
- package/src/runtime/store-screenshot.js +0 -143
- package/template/CHANGELOG.md +0 -5
- package/template/app/page.tsx +0 -60
- package/template/components/ui/card.tsx +0 -56
- package/template/packages/sdk/src/components/DocumentEditor.tsx +0 -103
- package/template/packages/sdk/src/config.ts +0 -259
- package/template/packages/sdk/src/hooks/useCloudComputer.ts +0 -97
- package/template/packages/sdk/src/hooks/useDatabaseSchema.ts +0 -85
- package/template/packages/sdk/src/hooks/useDocument.ts +0 -78
- package/template/packages/sdk/src/hooks/useNotisNavigation.ts +0 -52
- package/template/packages/sdk/src/hooks/useTopBarSearch.ts +0 -73
- package/template/packages/sdk/src/runtime.ts +0 -439
- package/template/packages/sdk/src/vite.ts +0 -56
- package/template/packages/sdk/tsconfig.json +0 -15
- /package/{template/packages → dist}/sdk/src/components/MultiSelectDragOverlay.tsx +0 -0
- /package/{template/packages → dist}/sdk/src/components/ShortcutHints.tsx +0 -0
- /package/{template/packages → dist}/sdk/src/hooks/useActiveResource.ts +0 -0
- /package/{template/packages → dist}/sdk/src/hooks/useTool.ts +0 -0
- /package/{template/packages → dist}/sdk/src/hooks/useTools.ts +0 -0
- /package/{template/packages → dist}/sdk/src/ui.ts +0 -0
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/** Build-only SDK content discovery. Author configuration and PostCSS plugins stay intact. */
|
|
2
|
+
import { existsSync, mkdtempSync, rmSync, writeFileSync } from 'node:fs';
|
|
3
|
+
import { tmpdir } from 'node:os';
|
|
4
|
+
import { dirname, join, relative, resolve } from 'node:path';
|
|
5
|
+
import { fileURLToPath } from 'node:url';
|
|
6
|
+
|
|
7
|
+
export function notisTailwindContent() {
|
|
8
|
+
let root = process.cwd();
|
|
9
|
+
let temporary: string | undefined;
|
|
10
|
+
const wrappers = new Map<string, string>();
|
|
11
|
+
const cleanup = () => {
|
|
12
|
+
if (temporary) rmSync(temporary, { recursive: true, force: true });
|
|
13
|
+
temporary = undefined;
|
|
14
|
+
wrappers.clear();
|
|
15
|
+
};
|
|
16
|
+
return {
|
|
17
|
+
name: 'notis-sdk-tailwind-content',
|
|
18
|
+
enforce: 'pre' as const,
|
|
19
|
+
configResolved(config: { root: string }) { root = config.root; },
|
|
20
|
+
transform(source: string, id: string) {
|
|
21
|
+
const stylesheet = id.split('?')[0];
|
|
22
|
+
if (!stylesheet.endsWith('.css')) return null;
|
|
23
|
+
// Tailwind 4 discovers dependency sources through CSS, not config.content.
|
|
24
|
+
// Keep the author's imports, configuration and PostCSS pipeline untouched.
|
|
25
|
+
if (/@import\s+(?:url\(\s*)?(['"])tailwindcss(?:\/[^'"]*)?\1/.test(source)) {
|
|
26
|
+
const sdkSource = dirname(fileURLToPath(import.meta.url));
|
|
27
|
+
const relativeSource = './' + relative(dirname(stylesheet), sdkSource).replaceAll('\\', '/');
|
|
28
|
+
const directive = `@source ${JSON.stringify(relativeSource)};`;
|
|
29
|
+
return source.includes(directive) ? null : { code: `${source}\n${directive}\n`, map: null };
|
|
30
|
+
}
|
|
31
|
+
if (!/@tailwind\s/.test(source)) return null;
|
|
32
|
+
const explicit = source.match(/@config\s+(['"])(.*?)\1\s*;/);
|
|
33
|
+
const config = explicit
|
|
34
|
+
? resolve(dirname(id.split('?')[0]), explicit[2])
|
|
35
|
+
: ['ts', 'js', 'cjs', 'mjs'].map(ext => join(root, `tailwind.config.${ext}`)).find(existsSync);
|
|
36
|
+
if (!config) return null;
|
|
37
|
+
let wrapper = wrappers.get(config);
|
|
38
|
+
if (!wrapper) {
|
|
39
|
+
temporary ||= mkdtempSync(join(tmpdir(), 'notis-tailwind-'));
|
|
40
|
+
wrapper = join(temporary, `config-${wrappers.size}.ts`);
|
|
41
|
+
const sdkGlob = join(dirname(fileURLToPath(import.meta.url)), '**/*.{ts,tsx}').replaceAll('\\', '/');
|
|
42
|
+
writeFileSync(wrapper, `import config from ${JSON.stringify(config)};
|
|
43
|
+
import { resolve } from 'node:path';
|
|
44
|
+
const content = config.content || [];
|
|
45
|
+
const files = Array.isArray(content) ? content : (content.files || []);
|
|
46
|
+
const base = ${JSON.stringify(root)};
|
|
47
|
+
const relativeBase = ${JSON.stringify(dirname(config))};
|
|
48
|
+
export default { ...config, content: {
|
|
49
|
+
...(Array.isArray(content) ? {} : content),
|
|
50
|
+
relative: false,
|
|
51
|
+
files: [...files.map(file => typeof file !== 'string' ? file :
|
|
52
|
+
(file.startsWith('!') ? '!' : '') + resolve(content.relative ? relativeBase : base, file.replace(/^!/, ''))),
|
|
53
|
+
${JSON.stringify(sdkGlob)}],
|
|
54
|
+
} };
|
|
55
|
+
`);
|
|
56
|
+
wrappers.set(config, wrapper);
|
|
57
|
+
}
|
|
58
|
+
const directive = `@config ${JSON.stringify('./' + relative(dirname(id.split('?')[0]), wrapper).replaceAll('\\', '/'))};`;
|
|
59
|
+
// Imports must remain before @config. Vite resolves them before PostCSS.
|
|
60
|
+
const code = explicit ? source.replace(explicit[0], directive) : `${source}\n${directive}\n`;
|
|
61
|
+
return { code, map: null };
|
|
62
|
+
},
|
|
63
|
+
closeBundle: cleanup,
|
|
64
|
+
closeWatcher: cleanup,
|
|
65
|
+
};
|
|
66
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ActionToast (toolkit spec 2.7): the words after an action, a muted reason line when there is one, Undo when the
|
|
3
|
+
* action returned an UndoFn, and a Dismiss button when `onDismiss` is given. While Undo is offered, Z (and Mod+Z)
|
|
4
|
+
* undo at route scope; while the Undo runs its button says so and Z does nothing.
|
|
5
|
+
*/
|
|
6
|
+
import type { ActionToastState } from './useToast';
|
|
7
|
+
export interface ActionToastProps {
|
|
8
|
+
toast: ActionToastState | null;
|
|
9
|
+
onUndo(): void;
|
|
10
|
+
/** Draws a Dismiss button that hides the toast (hidden while an Undo runs). */
|
|
11
|
+
onDismiss?(): void;
|
|
12
|
+
/** Owner override for the Z key (default the nearest ShortcutScope). */
|
|
13
|
+
owner?: string;
|
|
14
|
+
}
|
|
15
|
+
export declare function ActionToast({ toast, onUndo, onDismiss, owner }: ActionToastProps): import("react").JSX.Element | null;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** The words and timing of the toast after an action (toolkit spec 2.7). */
|
|
2
|
+
import { type Words } from '../../words';
|
|
3
|
+
/** How long a toast stays (the Manager's undo toast). An Undo that is running keeps it until it ends. */
|
|
4
|
+
export declare const ACTION_TOAST_MS = 6000;
|
|
5
|
+
export declare const ACTION_WORDS: Readonly<{
|
|
6
|
+
failed: Words;
|
|
7
|
+
resultUnknown: Words;
|
|
8
|
+
undone: Words;
|
|
9
|
+
undoing: Words;
|
|
10
|
+
undoFailed: Words;
|
|
11
|
+
dismiss: Words;
|
|
12
|
+
failedOne: Words;
|
|
13
|
+
failedMany: Words;
|
|
14
|
+
}>;
|
|
15
|
+
/** The toast words after `n` items failed in a run that changed others. */
|
|
16
|
+
export declare function failedItemsWords(n: number): Words;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { ACTION_TOAST_MS, ACTION_WORDS, failedItemsWords } from './actionWords';
|
|
2
|
+
export { availableActions, resolveActions, useActions } from './useActions';
|
|
3
|
+
export type { ActionHandlers, ActionOutcome, ActionsController, ResolvedAction, UseActionsOptions, } from './useActions';
|
|
4
|
+
export { useToast } from './useToast';
|
|
5
|
+
export type { ActionToastState, ToastController, ToastOptions, UseToastOptions } from './useToast';
|
|
6
|
+
export { ActionToast } from './ActionToast';
|
|
7
|
+
export type { ActionToastProps } from './ActionToast';
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `useActions` (toolkit spec 2.7): binds the standard action catalogue to a Space's handlers. Notis owns the words,
|
|
3
|
+
* icons, keys and toasts; the Space supplies only `run`. A standard id without a `run` is hidden.
|
|
4
|
+
*
|
|
5
|
+
* Actions resolve live: labels, tones, icons and toggles follow the refs on every render (a locale change or a new
|
|
6
|
+
* label shows at once), and `run`, `appliesTo`, `toast`, `options` and `value` are read when used.
|
|
7
|
+
*/
|
|
8
|
+
import { type ActionDef, type ActionIcon, type ActionOption, type ActionRef, type ActionTone, type KeySpec, type StandardActionId, type Words } from '../../words';
|
|
9
|
+
import { type ActionToastState, type ToastOptions } from './useToast';
|
|
10
|
+
export interface ResolvedAction<T> {
|
|
11
|
+
id: string;
|
|
12
|
+
label: Words;
|
|
13
|
+
icon?: ActionIcon;
|
|
14
|
+
key?: KeySpec;
|
|
15
|
+
tone: ActionTone;
|
|
16
|
+
bulk: boolean;
|
|
17
|
+
appliesTo?: (item: T) => boolean;
|
|
18
|
+
run: ActionDef<T>['run'];
|
|
19
|
+
/** Null when the toast is turned off. */
|
|
20
|
+
toast?: ((n: number) => Words | string | null) | null;
|
|
21
|
+
/** The other half of a toggle (star/unstar, read/unread, pause/resume, enable/disable). */
|
|
22
|
+
toggle?: string;
|
|
23
|
+
/** Opens a picker instead of acting at once (move, assign, or any action with `options`). */
|
|
24
|
+
picker: boolean;
|
|
25
|
+
/** The picker choices for `items` (empty when the action has none). */
|
|
26
|
+
options?: (items: T[]) => readonly ActionOption[];
|
|
27
|
+
/** The value the items share (checked in the picker). */
|
|
28
|
+
value?: (items: T[]) => string | null | undefined;
|
|
29
|
+
}
|
|
30
|
+
export type ActionHandlers<T> = Partial<Record<StandardActionId, ActionDef<T>['run']>>;
|
|
31
|
+
export interface UseActionsOptions {
|
|
32
|
+
/** A run or its Undo threw or rejected (the toast already says so); an Undo reports `{ id: 'undo' }`. */
|
|
33
|
+
onError?: (error: unknown, action: {
|
|
34
|
+
id: string;
|
|
35
|
+
}) => void;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* What a run did. `done`: it ran (`failed` lists the items that did not change). `cancelled`: the run said so, or
|
|
39
|
+
* nothing applied. `failed`: it threw. `busy`: the same action was still running, so this call was ignored.
|
|
40
|
+
*/
|
|
41
|
+
export interface ActionOutcome<T> {
|
|
42
|
+
status: 'done' | 'cancelled' | 'failed' | 'busy';
|
|
43
|
+
done: T[];
|
|
44
|
+
failed: T[];
|
|
45
|
+
}
|
|
46
|
+
export interface ActionsController<T> {
|
|
47
|
+
/** Every action that has a run, in the given order. */
|
|
48
|
+
actions: ResolvedAction<T>[];
|
|
49
|
+
/**
|
|
50
|
+
* The actions that apply to `items`. Toggle pairs show one half: the first listed half that fits every item,
|
|
51
|
+
* else (a mixed selection) the first listed half that fits some, which then runs on those only. Any other
|
|
52
|
+
* action needs at least one item it applies to.
|
|
53
|
+
*/
|
|
54
|
+
available(items: readonly T[]): ResolvedAction<T>[];
|
|
55
|
+
/** Runs `action` on the items it applies to, then shows its toast (with Undo when it returned one). */
|
|
56
|
+
run(action: ResolvedAction<T> | string, items: readonly T[], choice?: ActionOption): Promise<ActionOutcome<T>>;
|
|
57
|
+
/** Ids of the actions running now (the selection bar shows them busy and ignores a second press). */
|
|
58
|
+
busy: ReadonlySet<string>;
|
|
59
|
+
isBusy(id: string): boolean;
|
|
60
|
+
toast: ActionToastState | null;
|
|
61
|
+
/** Shows other words in the same toast (a note, a refusal), replacing the one on screen. */
|
|
62
|
+
notify(words: Words | string, options?: ToastOptions): void;
|
|
63
|
+
undo(): Promise<void>;
|
|
64
|
+
dismiss(): void;
|
|
65
|
+
}
|
|
66
|
+
export declare function resolveActions<T>(refs: readonly ActionRef<T>[], handlers?: ActionHandlers<T>): ResolvedAction<T>[];
|
|
67
|
+
/** The actions of `actions` that apply to `items` (see `ActionsController.available`). */
|
|
68
|
+
export declare function availableActions<T>(actions: readonly ResolvedAction<T>[], items: readonly T[]): ResolvedAction<T>[];
|
|
69
|
+
export declare function useActions<T>(refs: readonly ActionRef<T>[], handlers?: ActionHandlers<T>, options?: UseActionsOptions): ActionsController<T>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `useToast` (toolkit spec 2.7): the toast a page shows after something it did, the same toast the actions show.
|
|
3
|
+
* One at a time: a new one replaces the one on screen. It stays ACTION_TOAST_MS; an Undo that is running keeps it,
|
|
4
|
+
* busy, until the Undo ends. Draw it with `<ActionToast toast={toaster.toast} onUndo={toaster.undo}
|
|
5
|
+
* onDismiss={toaster.dismiss} />`. `useActions` and ListReader use it, so a ListReader page reaches it through its
|
|
6
|
+
* controller or ReaderCtx.notify.
|
|
7
|
+
*/
|
|
8
|
+
import { type UndoFn, type Words } from '../../words';
|
|
9
|
+
export interface ActionToastState {
|
|
10
|
+
id: number;
|
|
11
|
+
words: Words;
|
|
12
|
+
/** A muted second line: why it failed, or a note on what happened. */
|
|
13
|
+
reason: Words | null;
|
|
14
|
+
tone: 'default' | 'danger';
|
|
15
|
+
/** Present when the toast offers Undo: the button shows and Z undoes. */
|
|
16
|
+
undo: UndoFn | null;
|
|
17
|
+
/** The Undo is running: its button says so, and a second press does nothing. */
|
|
18
|
+
undoing: boolean;
|
|
19
|
+
}
|
|
20
|
+
export interface ToastOptions {
|
|
21
|
+
/** `danger` for a failure. */
|
|
22
|
+
tone?: 'default' | 'danger';
|
|
23
|
+
/** Offers Undo (the button, and Z). An UndoFn that throws shows "Could not undo that." with an ActionError's reason. */
|
|
24
|
+
undo?: UndoFn | null;
|
|
25
|
+
/** A muted second line under the words. */
|
|
26
|
+
reason?: Words | string | null;
|
|
27
|
+
}
|
|
28
|
+
export interface UseToastOptions {
|
|
29
|
+
/** An Undo threw or rejected (the toast already says so). */
|
|
30
|
+
onError?: (error: unknown) => void;
|
|
31
|
+
}
|
|
32
|
+
export interface ToastController {
|
|
33
|
+
toast: ActionToastState | null;
|
|
34
|
+
/** Shows `words`, replacing the toast on screen. */
|
|
35
|
+
notify(words: Words | string, options?: ToastOptions): void;
|
|
36
|
+
/** Runs the toast's Undo. The toast stays, busy, until it ends, then says whether it worked. */
|
|
37
|
+
undo(): Promise<void>;
|
|
38
|
+
/** Hides the toast (not while its Undo runs: the outcome still shows). */
|
|
39
|
+
dismiss(): void;
|
|
40
|
+
}
|
|
41
|
+
export declare function useToast(options?: UseToastOptions): ToastController;
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tabs and TabRow: strips of pills (one look for both, Flo 5b). SegmentedControl stays for mode switches inside a
|
|
3
|
+
* section (a chart's Bars, Line, Area).
|
|
4
|
+
*
|
|
5
|
+
* Tabs: a strip of views where the choice switches the whole content below it (a page's sections, a record's panes),
|
|
6
|
+
* with its panel. TabRow: the 44px row over a list or a page (TLB1, TLB2). Role 'tabs' when the choice switches the
|
|
7
|
+
* content (tablist), role 'filter' when it narrows one list (radiogroup). It never wraps: `lead` sits before the
|
|
8
|
+
* pills, `end` is pinned at the row's end and `maxVisible` moves the rest of the pills into a More menu.
|
|
9
|
+
*
|
|
10
|
+
* The active pill is tinted (never a line or an edge on one side). Each pill can show a count. [ and ] switch to the
|
|
11
|
+
* previous or next view from anywhere on the page (route scope, listed in the ? sheet), the arrow keys move between
|
|
12
|
+
* pills while one has focus, Home and End jump to the ends. A calendar or timeline in the content takes [ and ] only
|
|
13
|
+
* while focus is inside it. On narrow widths the Tabs strip scrolls sideways; a TabRow folds the pills its row has no
|
|
14
|
+
* room for into the More menu.
|
|
15
|
+
*/
|
|
16
|
+
import { type ReactNode } from 'react';
|
|
17
|
+
import { type Words } from '../../words';
|
|
18
|
+
type Text = Words | string;
|
|
19
|
+
/** The words of Tabs and TabRow: a strip's default name and its [ and ] shortcuts. */
|
|
20
|
+
export declare const TABS_WORDS: Readonly<{
|
|
21
|
+
views: {
|
|
22
|
+
en: string;
|
|
23
|
+
fr: string;
|
|
24
|
+
};
|
|
25
|
+
previousView: {
|
|
26
|
+
en: string;
|
|
27
|
+
fr: string;
|
|
28
|
+
};
|
|
29
|
+
nextView: {
|
|
30
|
+
en: string;
|
|
31
|
+
fr: string;
|
|
32
|
+
};
|
|
33
|
+
}>;
|
|
34
|
+
/** The words of a TabRow: its default name as a filter and its More menu. */
|
|
35
|
+
export declare const TABROW_WORDS: Readonly<{
|
|
36
|
+
filters: {
|
|
37
|
+
en: string;
|
|
38
|
+
fr: string;
|
|
39
|
+
};
|
|
40
|
+
more: {
|
|
41
|
+
en: string;
|
|
42
|
+
fr: string;
|
|
43
|
+
};
|
|
44
|
+
showMore: {
|
|
45
|
+
en: string;
|
|
46
|
+
fr: string;
|
|
47
|
+
};
|
|
48
|
+
}>;
|
|
49
|
+
/** One tab of `Tabs`. */
|
|
50
|
+
export interface TabItem<V extends string> {
|
|
51
|
+
value: V;
|
|
52
|
+
label: Text;
|
|
53
|
+
icon?: ReactNode | string;
|
|
54
|
+
/** Shown after the label in a muted tone (0 included). */
|
|
55
|
+
count?: number;
|
|
56
|
+
disabled?: boolean;
|
|
57
|
+
}
|
|
58
|
+
/** The props of `Tabs`. */
|
|
59
|
+
export interface TabsProps<V extends string> {
|
|
60
|
+
tabs: readonly TabItem<V>[];
|
|
61
|
+
value: NoInfer<V>;
|
|
62
|
+
onChange(value: NoInfer<V>): void;
|
|
63
|
+
/** The strip's accessible name. Default "Views". */
|
|
64
|
+
label?: Text;
|
|
65
|
+
/**
|
|
66
|
+
* [ and ] switch views (default true). One strip per page carries them: set false on a second or nested strip.
|
|
67
|
+
* The strip owns them: a calendar or timeline inside the content steps its period with [ and ] only while focus is
|
|
68
|
+
* inside it (after a click on it, or once a key moved focus into it).
|
|
69
|
+
*/
|
|
70
|
+
keys?: boolean;
|
|
71
|
+
/**
|
|
72
|
+
* 'auto' (default): an arrow key moves to the tab and shows it. 'manual': arrows move focus only, Enter or Space
|
|
73
|
+
* shows the focused tab (for views that are slow to show).
|
|
74
|
+
*/
|
|
75
|
+
activation?: 'auto' | 'manual';
|
|
76
|
+
/** When given, rendered as the tab panel of the active tab (labelled by it). Omit to render the panel yourself
|
|
77
|
+
* with `tabPanelProps`. */
|
|
78
|
+
children?: ReactNode;
|
|
79
|
+
/** Stable prefix for tab and panel ids. Default a generated one. */
|
|
80
|
+
id?: string;
|
|
81
|
+
className?: string;
|
|
82
|
+
panelClassName?: string;
|
|
83
|
+
}
|
|
84
|
+
/** One pill of a TabRow. */
|
|
85
|
+
export interface TabRowItem<V extends string = string> {
|
|
86
|
+
id: V;
|
|
87
|
+
label: Text;
|
|
88
|
+
/** Shown after the label in a muted tone (0 included). */
|
|
89
|
+
count?: number;
|
|
90
|
+
icon?: ReactNode | string;
|
|
91
|
+
disabled?: boolean;
|
|
92
|
+
}
|
|
93
|
+
/** The props of `TabRow`. */
|
|
94
|
+
export interface TabRowProps<V extends string = string> {
|
|
95
|
+
/** 'tabs': the choice switches the content below (tablist). 'filter': it narrows one list (radiogroup). */
|
|
96
|
+
role: 'tabs' | 'filter';
|
|
97
|
+
items: readonly TabRowItem<V>[];
|
|
98
|
+
value: NoInfer<V>;
|
|
99
|
+
onChange(id: NoInfer<V>): void;
|
|
100
|
+
/** The strip's accessible name. Default "Views" for tabs, "Filters" for a filter. */
|
|
101
|
+
label?: Text;
|
|
102
|
+
/** The most pills the strip shows; the rest go into a More menu. The active pill always shows. Default all that fit. */
|
|
103
|
+
maxVisible?: number;
|
|
104
|
+
/** Before the pills, in the same line: a section title, a back button. */
|
|
105
|
+
lead?: ReactNode;
|
|
106
|
+
/** Pinned at the row's end: the "+" create button and the view menu. */
|
|
107
|
+
end?: ReactNode;
|
|
108
|
+
/** 'list' (default): 6px before, 8px after (8 each on a phone). 'page': 20px each side (12 on a phone). */
|
|
109
|
+
inset?: 'list' | 'page';
|
|
110
|
+
/** [ and ] step through every item from anywhere on the page (default false). One row per page carries them. */
|
|
111
|
+
keys?: boolean;
|
|
112
|
+
/** Role 'tabs': a stable prefix for tab and panel ids; the pills then control `tabPanelProps(id, value)`. */
|
|
113
|
+
id?: string;
|
|
114
|
+
className?: string;
|
|
115
|
+
}
|
|
116
|
+
/** Ids shared by a tab and its panel, for a panel rendered outside `<Tabs>`. */
|
|
117
|
+
export declare function tabIds(prefix: string, value: string): {
|
|
118
|
+
tab: string;
|
|
119
|
+
panel: string;
|
|
120
|
+
};
|
|
121
|
+
/** Props for a panel rendered outside `<Tabs>`: `<div {...tabPanelProps(prefix, value)}>`. */
|
|
122
|
+
export declare function tabPanelProps(prefix: string, value: string): {
|
|
123
|
+
id: string;
|
|
124
|
+
role: 'tabpanel';
|
|
125
|
+
'aria-labelledby': string;
|
|
126
|
+
tabIndex: number;
|
|
127
|
+
};
|
|
128
|
+
/** The next enabled tab from `from` in `direction`, wrapping round. Null when no other tab is enabled. */
|
|
129
|
+
export declare function stepTab<V extends string>(tabs: readonly TabItem<V>[], from: V, direction: 1 | -1): V | null;
|
|
130
|
+
/** A strip of view pills whose choice switches the content below it, with its panel when `children` is given. */
|
|
131
|
+
export declare function Tabs<V extends string>({ tabs, value, onChange, label, keys, activation, children, id, className, panelClassName, }: TabsProps<V>): import("react").JSX.Element;
|
|
132
|
+
/**
|
|
133
|
+
* The 44px row of pills over a list or a page (TLB1, TLB2). Role 'tabs' switches the content below (tablist), role
|
|
134
|
+
* 'filter' narrows one list (radiogroup); one look for both. It never wraps or scrolls: the pills its row has no room
|
|
135
|
+
* for, and those past `maxVisible`, go into a More menu, the active pill kept in the last place. When even the active
|
|
136
|
+
* pill alone has no room beside More and the end content, its label shortens with an ellipsis (its count stays).
|
|
137
|
+
*/
|
|
138
|
+
export declare function TabRow<V extends string>({ role, items, value, onChange, label, maxVisible, lead, end, inset, keys, id, className, }: TabRowProps<V>): import("react").JSX.Element;
|
|
139
|
+
export {};
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Building blocks promoted from Spaces (toolkit spec 2.12): Section, Badge, Button, SegmentedControl, NativeSelect,
|
|
3
|
+
* EmptyState, Notice and Metric. Flat look (no boxes, borders or eyebrows; the page title lives in the top bar), styled
|
|
4
|
+
* by `toolkit.css`. Every text prop takes EN/FR words or a plain string.
|
|
5
|
+
*/
|
|
6
|
+
import { type ButtonHTMLAttributes, type ReactNode, type SelectHTMLAttributes } from 'react';
|
|
7
|
+
import { type Words } from '../../words';
|
|
8
|
+
import type { Tone } from '../list/Row';
|
|
9
|
+
type Text = Words | string;
|
|
10
|
+
export declare const BLOCK_WORDS: Readonly<{
|
|
11
|
+
previousPage: {
|
|
12
|
+
en: string;
|
|
13
|
+
fr: string;
|
|
14
|
+
};
|
|
15
|
+
nextPage: {
|
|
16
|
+
en: string;
|
|
17
|
+
fr: string;
|
|
18
|
+
};
|
|
19
|
+
pageOf: {
|
|
20
|
+
en: string;
|
|
21
|
+
fr: string;
|
|
22
|
+
};
|
|
23
|
+
rangeOf: {
|
|
24
|
+
en: string;
|
|
25
|
+
fr: string;
|
|
26
|
+
};
|
|
27
|
+
pagination: {
|
|
28
|
+
en: string;
|
|
29
|
+
fr: string;
|
|
30
|
+
};
|
|
31
|
+
emptyTitle: {
|
|
32
|
+
en: string;
|
|
33
|
+
fr: string;
|
|
34
|
+
};
|
|
35
|
+
emptyBody: {
|
|
36
|
+
en: string;
|
|
37
|
+
fr: string;
|
|
38
|
+
};
|
|
39
|
+
}>;
|
|
40
|
+
/**
|
|
41
|
+
* What a Section holds, which sets its spacing. bar: a period or filter bar (px 24, pt 12). stats: a full-width
|
|
42
|
+
* StatRow strip. chart: a chart under its head (px 24, pt 32). data: a table or list under its head (pt 40; the head
|
|
43
|
+
* px 24, pb 12; the edge cells 24 in). form: fields across the full width (px 24, pt 24); each field caps its own width.
|
|
44
|
+
*/
|
|
45
|
+
export type SectionKind = 'bar' | 'stats' | 'chart' | 'data' | 'form';
|
|
46
|
+
/** The props of `Section`. */
|
|
47
|
+
export interface SectionProps {
|
|
48
|
+
/** What the section holds, which sets its spacing. Default 'data'. */
|
|
49
|
+
kind?: SectionKind;
|
|
50
|
+
/** A data label in the head row (h2, 14px medium); never a page title, which lives in the top bar. */
|
|
51
|
+
title?: Text;
|
|
52
|
+
/** A muted count after the title (12px, tabular). */
|
|
53
|
+
count?: number;
|
|
54
|
+
/** Muted text after the title (a date range, a source): words, or any content. */
|
|
55
|
+
meta?: ReactNode | Words;
|
|
56
|
+
/** A TabRow or SegmentedControl in the head row. A TabRow folds what does not fit into More; in a bar, other controls scroll sideways in the one row; a chart head 560px or narrower puts them on their own line. */
|
|
57
|
+
tabs?: ReactNode;
|
|
58
|
+
/** Ghost icon buttons at the end of the head row (a 32px "+", a view menu). */
|
|
59
|
+
actions?: ReactNode;
|
|
60
|
+
children?: ReactNode;
|
|
61
|
+
className?: string;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* A full-width page section with no border, ring, background or radius on any kind. The head row (title, count, meta,
|
|
65
|
+
* tabs, actions) shows only when one of them is given.
|
|
66
|
+
*/
|
|
67
|
+
export declare function Section({ kind, title, count, meta, tabs, actions, children, className }: SectionProps): import("react").JSX.Element;
|
|
68
|
+
export interface BadgeProps {
|
|
69
|
+
tone?: Tone;
|
|
70
|
+
icon?: ReactNode | string;
|
|
71
|
+
/** Words or a plain string are shown in the toolkit locale; any other content as it is. */
|
|
72
|
+
children?: ReactNode | Words;
|
|
73
|
+
className?: string;
|
|
74
|
+
}
|
|
75
|
+
export declare function Badge({ tone, icon, children, className }: BadgeProps): import("react").JSX.Element;
|
|
76
|
+
/**
|
|
77
|
+
* default: a soft neutral fill. primary: the page's main action. secondary: the Portal's secondary fill. ghost: no
|
|
78
|
+
* fill until hover. link: text in the primary colour, underlined on hover. danger: a destructive action.
|
|
79
|
+
*/
|
|
80
|
+
export type ButtonVariant = 'default' | 'primary' | 'secondary' | 'ghost' | 'link' | 'danger';
|
|
81
|
+
export type ButtonSize = 'sm' | 'md' | 'lg';
|
|
82
|
+
export interface ButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children'> {
|
|
83
|
+
variant?: ButtonVariant;
|
|
84
|
+
size?: ButtonSize;
|
|
85
|
+
icon?: ReactNode | string;
|
|
86
|
+
/**
|
|
87
|
+
* Makes the button a toggle (aria-pressed): quiet while off, filled while on, whatever the variant. Its hover is
|
|
88
|
+
* lighter than the on fill, so an off toggle under the pointer never reads as on. For several, see ToggleGroup.
|
|
89
|
+
*/
|
|
90
|
+
pressed?: boolean;
|
|
91
|
+
children?: ReactNode | Words;
|
|
92
|
+
}
|
|
93
|
+
export declare const Button: import("react").ForwardRefExoticComponent<ButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
94
|
+
export interface ToggleGroupProps<V extends string> {
|
|
95
|
+
options: readonly SegmentedOption<V>[];
|
|
96
|
+
/** The options that are on. */
|
|
97
|
+
value: readonly V[];
|
|
98
|
+
/** The options on after a press, in option order. */
|
|
99
|
+
onChange(value: V[]): void;
|
|
100
|
+
/** The group's accessible name. */
|
|
101
|
+
label?: Text;
|
|
102
|
+
/** Default 'sm'. */
|
|
103
|
+
size?: ButtonSize;
|
|
104
|
+
className?: string;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Several toggles, any number on (filters, chart series): a role="group" of aria-pressed buttons. Each press turns
|
|
108
|
+
* one option on or off; the caller decides what an empty set means (keep the last one on, or turn them all on).
|
|
109
|
+
* For one choice out of several use SegmentedControl.
|
|
110
|
+
*/
|
|
111
|
+
export declare function ToggleGroup<V extends string>({ options, value, onChange, label, size, className }: ToggleGroupProps<V>): import("react").JSX.Element;
|
|
112
|
+
export interface SegmentedOption<V extends string> {
|
|
113
|
+
value: V;
|
|
114
|
+
label: Text;
|
|
115
|
+
icon?: ReactNode | string;
|
|
116
|
+
count?: number;
|
|
117
|
+
disabled?: boolean;
|
|
118
|
+
}
|
|
119
|
+
export interface SegmentedControlProps<V extends string> {
|
|
120
|
+
options: readonly SegmentedOption<V>[];
|
|
121
|
+
value: V;
|
|
122
|
+
onChange(value: V): void;
|
|
123
|
+
/** The group's accessible name. */
|
|
124
|
+
label?: Text;
|
|
125
|
+
className?: string;
|
|
126
|
+
}
|
|
127
|
+
/** Pills for a mode switch inside a section (a chart's Bars, Line, Area; the period bar's presets); never a TabRow. */
|
|
128
|
+
export declare function SegmentedControl<V extends string>({ options, value, onChange, label, className }: SegmentedControlProps<V>): import("react").JSX.Element;
|
|
129
|
+
export interface SwitchProps {
|
|
130
|
+
checked: boolean;
|
|
131
|
+
onChange(checked: boolean): void;
|
|
132
|
+
/** Accessible name; shown beside the switch unless `hideLabel`. */
|
|
133
|
+
label: Text;
|
|
134
|
+
/** Keep the label for screen readers only (a row already says what the switch does). */
|
|
135
|
+
hideLabel?: boolean;
|
|
136
|
+
disabled?: boolean;
|
|
137
|
+
/** A change is being saved: the switch shows busy and ignores presses. */
|
|
138
|
+
busy?: boolean;
|
|
139
|
+
/** 'sm' (default, 16px tall, rows and menus) or 'md' (20px, settings). */
|
|
140
|
+
size?: 'sm' | 'md';
|
|
141
|
+
className?: string;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* An on/off switch (role switch). Clicks on it never reach the row under it, so it sits inside a list row without
|
|
145
|
+
* opening the row.
|
|
146
|
+
*/
|
|
147
|
+
export declare function Switch({ checked, onChange, label, hideLabel, disabled, busy, size, className }: SwitchProps): import("react").JSX.Element;
|
|
148
|
+
export interface PaginationProps {
|
|
149
|
+
/** The current page, from 1. */
|
|
150
|
+
page: number;
|
|
151
|
+
/** How many pages; with `total` and `pageSize` it is worked out. */
|
|
152
|
+
pageCount?: number;
|
|
153
|
+
/** Item count: the label then reads "21 to 40 of 134". */
|
|
154
|
+
total?: number;
|
|
155
|
+
pageSize?: number;
|
|
156
|
+
onChange(page: number): void;
|
|
157
|
+
/** A page is loading: the buttons wait. */
|
|
158
|
+
busy?: boolean;
|
|
159
|
+
className?: string;
|
|
160
|
+
}
|
|
161
|
+
/** Previous and next page buttons with "Page 2 of 5" (or "21 to 40 of 134" when the total is known). */
|
|
162
|
+
export declare function Pagination({ page, pageCount, total, pageSize, onChange, busy, className }: PaginationProps): import("react").JSX.Element;
|
|
163
|
+
export interface NativeSelectOption<V extends string> {
|
|
164
|
+
value: V;
|
|
165
|
+
label: Text;
|
|
166
|
+
disabled?: boolean;
|
|
167
|
+
}
|
|
168
|
+
export interface NativeSelectProps<V extends string> extends Omit<SelectHTMLAttributes<HTMLSelectElement>, 'value' | 'onChange' | 'children'> {
|
|
169
|
+
options: readonly NativeSelectOption<V>[];
|
|
170
|
+
value: V;
|
|
171
|
+
onChange(value: V): void;
|
|
172
|
+
/** Accessible name (no visible label). */
|
|
173
|
+
label?: Text;
|
|
174
|
+
}
|
|
175
|
+
/** The platform select, styled flat: the right control on phones and in narrow toolbars. */
|
|
176
|
+
export declare function NativeSelect<V extends string>({ options, value, onChange, label, className, ...rest }: NativeSelectProps<V>): import("react").JSX.Element;
|
|
177
|
+
export interface EmptyStateProps {
|
|
178
|
+
/** Default "Nothing here yet". */
|
|
179
|
+
title?: Text;
|
|
180
|
+
body?: Text;
|
|
181
|
+
/** A button under the text. */
|
|
182
|
+
action?: ReactNode;
|
|
183
|
+
icon?: ReactNode | string;
|
|
184
|
+
className?: string;
|
|
185
|
+
}
|
|
186
|
+
export declare function EmptyState({ title, body, action, icon, className }: EmptyStateProps): import("react").JSX.Element;
|
|
187
|
+
export interface NoticeProps {
|
|
188
|
+
tone?: Tone;
|
|
189
|
+
children?: ReactNode | Words;
|
|
190
|
+
/** Shows a Try again button. */
|
|
191
|
+
onRetry?: () => void;
|
|
192
|
+
/** Other buttons on the right. */
|
|
193
|
+
action?: ReactNode;
|
|
194
|
+
/**
|
|
195
|
+
* The message cannot wait: a screen reader breaks off what it is saying to read it (role="alert"). Keep it for a
|
|
196
|
+
* problem the person must act on now; any tone may be urgent. Default false: role="status", read once the reader is
|
|
197
|
+
* idle, also for danger.
|
|
198
|
+
*/
|
|
199
|
+
urgent?: boolean;
|
|
200
|
+
className?: string;
|
|
201
|
+
}
|
|
202
|
+
/** A one-line message in the page (an error with Try again, a warning, a tip). Only an urgent notice is an alert. */
|
|
203
|
+
export declare function Notice({ tone, children, onRetry, action, urgent, className }: NoticeProps): import("react").JSX.Element;
|
|
204
|
+
export interface MetricProps {
|
|
205
|
+
label: Text;
|
|
206
|
+
value: ReactNode;
|
|
207
|
+
/** A change against the comparison period, already formatted ("+12%"). */
|
|
208
|
+
delta?: ReactNode;
|
|
209
|
+
/** Colours the delta: up is good unless `invert`. */
|
|
210
|
+
trend?: 'up' | 'down' | 'flat';
|
|
211
|
+
/** A rising value is bad (costs, errors). */
|
|
212
|
+
invert?: boolean;
|
|
213
|
+
hint?: Text;
|
|
214
|
+
className?: string;
|
|
215
|
+
}
|
|
216
|
+
export declare function Metric({ label, value, delta, trend, invert, hint, className }: MetricProps): import("react").JSX.Element;
|
|
217
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { BLOCK_WORDS, Badge, Button, EmptyState, Metric, NativeSelect, Notice, Pagination, Section, SegmentedControl, Switch, ToggleGroup, } from './blocks';
|
|
2
|
+
export type { BadgeProps, ButtonProps, ButtonSize, ButtonVariant, EmptyStateProps, MetricProps, NativeSelectOption, NativeSelectProps, NoticeProps, PaginationProps, SectionKind, SectionProps, SegmentedControlProps, SegmentedOption, SwitchProps, ToggleGroupProps, } from './blocks';
|
|
3
|
+
export { TABROW_WORDS, TABS_WORDS, TabRow, Tabs, stepTab, tabIds, tabPanelProps } from './Tabs';
|
|
4
|
+
export type { TabItem, TabRowItem, TabRowProps, TabsProps } from './Tabs';
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* BoardView (toolkit spec 2.3, board layout): a Kanban board, one column per stage, built on ListReader so the reader,
|
|
3
|
+
* open modes, `openParam`, selection, the selection bar and actions behave exactly as in a list.
|
|
4
|
+
*
|
|
5
|
+
* - Columns sit side by side (gap 12, padding 12) and each scrolls on its own; the board scrolls sideways. On a phone
|
|
6
|
+
* each column takes about 85% of the width and snaps into place.
|
|
7
|
+
* - Tiles are ListReader tiles (`renderTile`): a ring on all four sides, never a coloured edge or a shadow.
|
|
8
|
+
* - Arrows move the cursor: Up/Down (and J/K) within a column, Left/Right to the nearest column with tiles. Enter or
|
|
9
|
+
* a click opens the tile in the reader beside the board, or as a slide when there is no room. Esc closes it. With
|
|
10
|
+
* nothing open the board runs full width, and nothing opens or closes on its own when the width changes.
|
|
11
|
+
* - Selection: X, Shift+Up/Down, Mod+A, Mod-click and Shift-click; the selection bar floats as a pill.
|
|
12
|
+
* - Moving (with `onMove`): drag a tile or the selection to a column (a line shows where it lands), Shift+Left/Right
|
|
13
|
+
* to the next column, or M (Move to) and pick a column. The page moves the items (optimistically, if it likes); the
|
|
14
|
+
* cursor stays on the moved tile.
|
|
15
|
+
*/
|
|
16
|
+
import type { Words } from '../../words';
|
|
17
|
+
import { type ListReaderProps, type TileParts } from '../list/ListReader';
|
|
18
|
+
import type { BoardColumn, BoardMoveHandler } from './boardModel';
|
|
19
|
+
/** The props of `BoardView`: ListReader's, with the board's columns instead of rows and groups. */
|
|
20
|
+
export interface BoardViewProps<T> extends Omit<ListReaderProps<T>, 'row' | 'layout' | 'renderTile' | 'columns' | 'groupBy' | 'collapsible' | 'collapsed' | 'onCollapsedChange' | 'tileVariant' | 'autoOpen' | 'hasMore' | 'onLoadMore' | 'loadingMore' | 'empty' | 'density' | 'board'> {
|
|
21
|
+
/** The stages, left to right. A `tone` adds a small dot before the label. */
|
|
22
|
+
columns: readonly BoardColumn[];
|
|
23
|
+
/** The id of the column an item sits in. An item whose column is not listed is not shown. */
|
|
24
|
+
getColumn(item: T): string;
|
|
25
|
+
/** One tile: title, subtitle, body, figure, trailing (and a mark). */
|
|
26
|
+
renderTile(item: T): TileParts;
|
|
27
|
+
/**
|
|
28
|
+
* Moves tiles to `toColumnId`: drag and drop (with `index`, the place among the tiles that stay in that column),
|
|
29
|
+
* Shift+Left/Right and the M (Move to) menu (without). Return an UndoFn for Undo in the toast. Leave out for a board
|
|
30
|
+
* that only reads.
|
|
31
|
+
*/
|
|
32
|
+
onMove?: BoardMoveHandler;
|
|
33
|
+
/** Shown in a column with no tiles. Default "No items" / "Aucun élément". */
|
|
34
|
+
emptyColumn?: Words | string;
|
|
35
|
+
}
|
|
36
|
+
export declare function BoardView<T>({ columns, getColumn, renderTile, onMove, emptyColumn, ...rest }: BoardViewProps<T>): import("react").JSX.Element;
|