@notis_ai/cli 0.2.18 → 0.2.20
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 +279 -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,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The board model (toolkit spec 2.3, board layout): its columns, how a ListReader in `layout="board"` is told about
|
|
3
|
+
* them, and the pure helpers the board uses (column order, the neighbour column, the drop index).
|
|
4
|
+
*/
|
|
5
|
+
import type { ActionRunResult, Words } from '../../words';
|
|
6
|
+
import type { Tone } from '../list/Row';
|
|
7
|
+
/** One column of a board: a stage. `tone` adds a small dot before its label (never a coloured edge). */
|
|
8
|
+
export interface BoardColumn {
|
|
9
|
+
id: string;
|
|
10
|
+
label: Words | string;
|
|
11
|
+
tone?: Tone;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Where tiles go. `toColumnId` is the column; `index` is the place in that column among the tiles that stay there
|
|
15
|
+
* (0 = first), given by a drop. A keyboard or menu move leaves it out: the tiles join the column wherever the page puts
|
|
16
|
+
* them. The page moves the items (optimistically, if it likes); the board keeps the cursor on the moved tile. Return
|
|
17
|
+
* an UndoFn for Undo in the toast, or `{ failed }` / throw to say it did not work.
|
|
18
|
+
*/
|
|
19
|
+
export type BoardMoveHandler = (ids: string[], toColumnId: string, index?: number) => ActionRunResult | Promise<ActionRunResult>;
|
|
20
|
+
/** The board of a ListReader in `layout="board"` (BoardView builds it). */
|
|
21
|
+
export interface ListBoard<T> {
|
|
22
|
+
columns: readonly BoardColumn[];
|
|
23
|
+
/** The id of the column an item sits in. An item whose column is not in `columns` is not shown. */
|
|
24
|
+
getColumn(item: T): string;
|
|
25
|
+
/** Moves tiles: drag and drop, Shift+Left/Right and the M (Move to) menu. Leave out for a board that only reads. */
|
|
26
|
+
onMove?: BoardMoveHandler;
|
|
27
|
+
/** Shown in a column with no tiles. Default "No items" / "Aucun élément". */
|
|
28
|
+
emptyColumn?: Words | string;
|
|
29
|
+
}
|
|
30
|
+
/** Items in board order: column by column (as `columns` lists them), each keeping the order `items` gave. */
|
|
31
|
+
export declare function boardOrder<T>(items: readonly T[], columns: readonly BoardColumn[], getColumn: (item: T) => string): T[];
|
|
32
|
+
/** The column next to `columnId` (`-1` left, `1` right), empty or not; null at the edge or for an unknown column. */
|
|
33
|
+
export declare function neighbourColumn(columns: readonly BoardColumn[], columnId: string, delta: -1 | 1): string | null;
|
|
34
|
+
/**
|
|
35
|
+
* Where a drop at `pointerY` lands in a column: the index among `tiles` (the column's tiles in order, the dragged ones
|
|
36
|
+
* left out) of the first tile whose middle is below the pointer, else the end. `before` is that tile's id (null at the
|
|
37
|
+
* end), where the drop line shows.
|
|
38
|
+
*/
|
|
39
|
+
export declare function dropIndex(tiles: ReadonlyArray<{
|
|
40
|
+
id: string;
|
|
41
|
+
top: number;
|
|
42
|
+
height: number;
|
|
43
|
+
}>, pointerY: number): {
|
|
44
|
+
index: number;
|
|
45
|
+
before: string | null;
|
|
46
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** The board's own words (EN and FR). Move to, Open and the rest come from the action catalogue and the list. */
|
|
2
|
+
import { type Words } from '../../words';
|
|
3
|
+
export declare const BOARD_WORDS: Readonly<{
|
|
4
|
+
board: Words;
|
|
5
|
+
moveLeft: Words;
|
|
6
|
+
moveRight: Words;
|
|
7
|
+
emptyColumn: Words;
|
|
8
|
+
moved: Words;
|
|
9
|
+
}>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { BoardView } from './BoardView';
|
|
2
|
+
export type { BoardViewProps } from './BoardView';
|
|
3
|
+
export { boardOrder, dropIndex as boardDropIndex, neighbourColumn } from './boardModel';
|
|
4
|
+
export type { BoardColumn, BoardMoveHandler, ListBoard } from './boardModel';
|
|
5
|
+
export { BOARD_WORDS } from './boardWords';
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CalendarView (toolkit spec 2.11, deck "calendar": month, week and agenda over the same items, plus a tray of items
|
|
3
|
+
* with no date). Keys (spec 3, settled in 6): `[` and `]` step a month (a week, three weeks in the agenda), T comes
|
|
4
|
+
* back to today and puts the cursor on today's first item, J/K and the up and down arrows walk the items in reading
|
|
5
|
+
* order, the left and right arrows jump to the next or previous day with items, Enter opens.
|
|
6
|
+
*
|
|
7
|
+
* Generic over the item: give `getDate` (and `getEnd` for multi-day items); `row` draws an item, else its title.
|
|
8
|
+
*/
|
|
9
|
+
import * as React from 'react';
|
|
10
|
+
import { type Locale, type Words } from '../../words/types';
|
|
11
|
+
import { type CalendarViewKind, type DateInput } from './calendarMath';
|
|
12
|
+
/** How an item is drawn: a month chip, a dot (narrow month), a week or tray card, an agenda row. */
|
|
13
|
+
export type CalendarItemVariant = 'chip' | 'dot' | 'card' | 'row';
|
|
14
|
+
export interface CalendarViewProps<T> {
|
|
15
|
+
items: readonly T[];
|
|
16
|
+
getDate: (item: T) => DateInput;
|
|
17
|
+
/** Last day of a multi-day item (drawn on every day, counted once by the keys). */
|
|
18
|
+
getEnd?: (item: T) => DateInput;
|
|
19
|
+
/** Default `item.id`. */
|
|
20
|
+
getId?: (item: T) => string;
|
|
21
|
+
/** Default `item.title` (or `item.name`). */
|
|
22
|
+
getTitle?: (item: T) => string;
|
|
23
|
+
/** Draws an item; the toolkit gives the chip, focus and keys around it. */
|
|
24
|
+
row?: (item: T, variant: CalendarItemVariant) => React.ReactNode;
|
|
25
|
+
view?: CalendarViewKind;
|
|
26
|
+
defaultView?: CalendarViewKind;
|
|
27
|
+
onViewChange?: (view: CalendarViewKind) => void;
|
|
28
|
+
/** Views offered by the switch, in order. Default month, week, agenda. */
|
|
29
|
+
views?: readonly CalendarViewKind[];
|
|
30
|
+
onOpen?: (item: T) => void;
|
|
31
|
+
/** The open item (drawn as open). */
|
|
32
|
+
openId?: string | null;
|
|
33
|
+
/** Shows the tray of items with no date. Default true. */
|
|
34
|
+
tray?: boolean;
|
|
35
|
+
/** Accessible name of the item list. Default "Items by date". */
|
|
36
|
+
label?: Words | string;
|
|
37
|
+
locale?: Locale;
|
|
38
|
+
className?: string;
|
|
39
|
+
/** Today, for tests and previews. */
|
|
40
|
+
today?: Date;
|
|
41
|
+
}
|
|
42
|
+
/** Below this width the month view draws dots and narrow weekday names, and the week stacks. */
|
|
43
|
+
export declare const CALENDAR_NARROW_MAX = 640;
|
|
44
|
+
/** Below this width the tray goes under the grid. */
|
|
45
|
+
export declare const CALENDAR_TRAY_SIDE_MIN = 900;
|
|
46
|
+
export declare function CalendarView<T>(props: CalendarViewProps<T>): React.JSX.Element;
|
|
47
|
+
export declare namespace CalendarView {
|
|
48
|
+
var displayName: string;
|
|
49
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DayPicker: the react-day-picker calendar the Portal used (`portal/src/components/ui/calendar.tsx`), moved into the
|
|
3
|
+
* toolkit (spec 2.11) and re-skinned with `nui-dp-*` classes in toolkit.css instead of Tailwind and the library sheet.
|
|
4
|
+
*
|
|
5
|
+
* Weeks start on Monday, as in the deck. Month and day names follow the toolkit locale (EN or FR) unless a
|
|
6
|
+
* react-day-picker `locale` is passed. Weekday heads use the narrow names ("M T W" / "L M M", B7) so the grid fits.
|
|
7
|
+
*/
|
|
8
|
+
import * as React from 'react';
|
|
9
|
+
import { DayPicker as ReactDayPicker } from 'react-day-picker';
|
|
10
|
+
import type { Locale } from '../../words/types';
|
|
11
|
+
export type { DateRange, Matcher } from 'react-day-picker';
|
|
12
|
+
type ReactDayPickerProps = React.ComponentProps<typeof ReactDayPicker>;
|
|
13
|
+
/** Omit that keeps the single, multiple and range modes apart. */
|
|
14
|
+
type DistributiveOmit<T, K extends PropertyKey> = T extends unknown ? Omit<T, K> : never;
|
|
15
|
+
export type DayPickerProps = DistributiveOmit<ReactDayPickerProps, 'locale'> & {
|
|
16
|
+
/** `en` or `fr`; defaults to the toolkit locale. A react-day-picker locale object is accepted too. */
|
|
17
|
+
locale?: Locale | ReactDayPickerProps['locale'];
|
|
18
|
+
};
|
|
19
|
+
/** A calendar of days in the toolkit look: Monday first, narrow weekday heads, EN or FR names. */
|
|
20
|
+
export declare function DayPicker({ className, classNames, components, formatters, showOutsideDays, locale, ...props }: DayPickerProps): React.JSX.Element;
|
|
21
|
+
export declare namespace DayPicker {
|
|
22
|
+
var displayName: string;
|
|
23
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CalendarView math (toolkit spec 2.11, deck layouts-new.js calendar). Pure: date-fns only, no React.
|
|
3
|
+
*
|
|
4
|
+
* Weeks start on Monday. Month view shows whole weeks around the month; week view one week; agenda three weeks
|
|
5
|
+
* from the start of the shown week, skipping empty days except today. Navigation order is the order the chips
|
|
6
|
+
* appear: day by day, then the tray of items with no date.
|
|
7
|
+
*/
|
|
8
|
+
import { toIsoDay } from '../period/periods';
|
|
9
|
+
export type CalendarViewKind = 'month' | 'week' | 'agenda';
|
|
10
|
+
export declare const CALENDAR_VIEWS: readonly CalendarViewKind[];
|
|
11
|
+
/** Days an agenda shows. */
|
|
12
|
+
export declare const AGENDA_DAYS = 21;
|
|
13
|
+
/** A month cell shows this many chips; with more, one fewer plus "+N more". */
|
|
14
|
+
export declare const MONTH_CHIPS = 3;
|
|
15
|
+
/** A multi-day item is drawn on at most this many days. */
|
|
16
|
+
export declare const MAX_SPAN_DAYS = 62;
|
|
17
|
+
export type DateInput = Date | string | number | null | undefined;
|
|
18
|
+
/** A local day from a Date, an ISO day ("2026-10-15", local), an ISO time or a timestamp. Invalid gives null. */
|
|
19
|
+
export declare function toDay(value: DateInput): Date | null;
|
|
20
|
+
export declare const dayKey: typeof toIsoDay;
|
|
21
|
+
/** Monday of the week holding `date`. */
|
|
22
|
+
export declare function weekStart(date: Date): Date;
|
|
23
|
+
export declare function isWeekend(date: Date): boolean;
|
|
24
|
+
/** The first day each view starts on for an offset (months for month, weeks for week and agenda) from today. */
|
|
25
|
+
export declare function viewStart(view: CalendarViewKind, offset: number, today: Date): Date;
|
|
26
|
+
/** How far `[` and `]` move the offset: one month, one week, or three weeks for the agenda. */
|
|
27
|
+
export declare function offsetStep(view: CalendarViewKind): number;
|
|
28
|
+
export interface MonthGrid {
|
|
29
|
+
/** First of the month. */
|
|
30
|
+
month: Date;
|
|
31
|
+
/** Whole weeks, Monday first: `rows * 7` days. */
|
|
32
|
+
days: Date[];
|
|
33
|
+
rows: number;
|
|
34
|
+
}
|
|
35
|
+
export declare function monthGrid(monthDate: Date): MonthGrid;
|
|
36
|
+
export declare function weekDays(start: Date): Date[];
|
|
37
|
+
/** The days a view shows (the month view's whole weeks, the week, or the agenda's 21 days). */
|
|
38
|
+
export declare function visibleDays(view: CalendarViewKind, offset: number, today: Date): Date[];
|
|
39
|
+
export interface DayBuckets<T> {
|
|
40
|
+
byDay: Map<string, T[]>;
|
|
41
|
+
none: T[];
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Items by day key. With `getEnd`, an item is drawn on each day from its date to its end (at most MAX_SPAN_DAYS);
|
|
45
|
+
* an end before the start counts as one day. Order inside a day keeps the input order.
|
|
46
|
+
*/
|
|
47
|
+
export declare function bucketByDay<T>(items: readonly T[], getDate: (item: T) => DateInput, getEnd?: (item: T) => DateInput): DayBuckets<T>;
|
|
48
|
+
/** The chips a month cell shows: all up to three; with more, two (unless expanded). */
|
|
49
|
+
export declare function shownChips<T>(items: readonly T[], expanded: boolean, limit?: number): {
|
|
50
|
+
shown: T[];
|
|
51
|
+
more: number;
|
|
52
|
+
};
|
|
53
|
+
/** Days of the agenda that print: those with items, and today always. */
|
|
54
|
+
export declare function agendaDays<T>(days: readonly Date[], byDay: Map<string, T[]>, today: Date): Date[];
|
|
55
|
+
export interface NavEntry {
|
|
56
|
+
id: string;
|
|
57
|
+
/** Day key, or null for the tray. */
|
|
58
|
+
day: string | null;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Chips in the order they appear (what J and K walk): day by day over the shown days, then the tray. An item
|
|
62
|
+
* drawn on several days counts once, at its first day. Month cells hide what sits behind "+N more".
|
|
63
|
+
*/
|
|
64
|
+
export declare function navOrder<T>(options: {
|
|
65
|
+
view: CalendarViewKind;
|
|
66
|
+
days: readonly Date[];
|
|
67
|
+
byDay: Map<string, T[]>;
|
|
68
|
+
none?: readonly T[];
|
|
69
|
+
getId: (item: T) => string;
|
|
70
|
+
expandedDay?: string | null;
|
|
71
|
+
today: Date;
|
|
72
|
+
}): NavEntry[];
|
|
73
|
+
/** ArrowRight and ArrowLeft: the first chip of the next (or previous) day that has chips. No cursor starts at the ends. */
|
|
74
|
+
export declare function stepDay(order: readonly NavEntry[], cursor: string | null | undefined, delta: 1 | -1): string | null;
|
|
75
|
+
/**
|
|
76
|
+
* Where T puts the cursor once the view is back on today: the first chip of today, else the first chip after today,
|
|
77
|
+
* else the last chip before it, else nothing.
|
|
78
|
+
*/
|
|
79
|
+
export declare function todayCursor(order: readonly NavEntry[], today: Date): string | null;
|
|
80
|
+
/** Keeps the cursor when it is still shown; else the first chip (or nothing). */
|
|
81
|
+
export declare function settleCursor(order: readonly NavEntry[], cursor: string | null | undefined): string | null;
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Charts (toolkit spec 2.11).
|
|
3
|
+
*
|
|
4
|
+
* The recharts wrapper the Portal used (`portal/src/components/ui/chart.tsx`: ChartContainer, ChartTooltip,
|
|
5
|
+
* ChartTooltipContent, ChartLegend, ChartStyle), moved here and styled by `nui-chart-*` rules in toolkit.css instead
|
|
6
|
+
* of Tailwind. The recharts primitives are re-exported so a host and a Space draw with the toolkit's one recharts
|
|
7
|
+
* instance (two copies do not share their chart context).
|
|
8
|
+
*
|
|
9
|
+
* `Chart` is the ready piece: one period series as a line, bars or an area, the comparison as a dashed line, a
|
|
10
|
+
* legend, tooltips in the toolkit locale, and its numbers in a hidden table for Markdown (RenderChartData). Bars and
|
|
11
|
+
* areas can stack, and bars can run horizontally with their value after each bar.
|
|
12
|
+
*/
|
|
13
|
+
import * as React from 'react';
|
|
14
|
+
import { ResponsiveContainer, Tooltip, type BarShapeProps, type LabelProps, type TooltipContentProps } from 'recharts';
|
|
15
|
+
import { type Locale, type Words } from '../../words/types';
|
|
16
|
+
import type { CompareId } from '../period/periods';
|
|
17
|
+
export { Area, AreaChart, Bar, BarChart, CartesianGrid, Cell, ComposedChart, LabelList, Legend, Line, LineChart, Pie, PieChart, ReferenceDot, ReferenceLine, ResponsiveContainer, Scatter, Tooltip, XAxis, YAxis, } from 'recharts';
|
|
18
|
+
declare const THEMES: {
|
|
19
|
+
readonly light: '';
|
|
20
|
+
readonly dark: '.dark';
|
|
21
|
+
};
|
|
22
|
+
export type ChartConfig = {
|
|
23
|
+
[k in string]: {
|
|
24
|
+
label?: React.ReactNode;
|
|
25
|
+
icon?: React.ComponentType;
|
|
26
|
+
} & ({
|
|
27
|
+
color?: string;
|
|
28
|
+
theme?: never;
|
|
29
|
+
} | {
|
|
30
|
+
color?: never;
|
|
31
|
+
theme: Record<keyof typeof THEMES, string>;
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
interface ChartContextValue {
|
|
35
|
+
config: ChartConfig;
|
|
36
|
+
}
|
|
37
|
+
export declare function useChart(): ChartContextValue;
|
|
38
|
+
export type ChartContainerProps = React.ComponentProps<'div'> & {
|
|
39
|
+
config: ChartConfig;
|
|
40
|
+
children: React.ComponentProps<typeof ResponsiveContainer>['children'];
|
|
41
|
+
/**
|
|
42
|
+
* Width over height of the box. Default 16 / 9; `'auto'` drops the ratio, so the box takes the height its parent,
|
|
43
|
+
* `height` or `style` gives it.
|
|
44
|
+
*/
|
|
45
|
+
aspect?: number | 'auto';
|
|
46
|
+
/** A fixed height (px, or any CSS length). It drops the default ratio unless `aspect` is also given. */
|
|
47
|
+
height?: number | string;
|
|
48
|
+
};
|
|
49
|
+
/** Sizes a recharts chart to its box and defines `--color-<key>` for each configured series. */
|
|
50
|
+
export declare const ChartContainer: React.ForwardRefExoticComponent<Omit<ChartContainerProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
51
|
+
export declare function ChartStyle({ id, config }: {
|
|
52
|
+
id: string;
|
|
53
|
+
config: ChartConfig;
|
|
54
|
+
}): React.JSX.Element | null;
|
|
55
|
+
/**
|
|
56
|
+
* recharts' own Tooltip (the same component, not a wrapper): pass `content`, such as a ChartTooltipContent or your
|
|
57
|
+
* own box. recharts drops series without a value at the point; `filterNull={false}` keeps them, and
|
|
58
|
+
* ChartTooltipContent shows them as "No data".
|
|
59
|
+
*/
|
|
60
|
+
export declare const ChartTooltip: typeof Tooltip;
|
|
61
|
+
type TooltipItem = NonNullable<TooltipContentProps['payload']>[number];
|
|
62
|
+
export type ChartTooltipContentProps = Partial<TooltipContentProps> & {
|
|
63
|
+
className?: string;
|
|
64
|
+
hideLabel?: boolean;
|
|
65
|
+
hideIndicator?: boolean;
|
|
66
|
+
indicator?: 'line' | 'dot' | 'dashed';
|
|
67
|
+
nameKey?: string;
|
|
68
|
+
labelKey?: string;
|
|
69
|
+
labelClassName?: string;
|
|
70
|
+
color?: string;
|
|
71
|
+
/** Formats each value. Default: a number in the locale ("1,240" / "1 240"), a string as written. */
|
|
72
|
+
valueFormatter?: (value: number | string, item: TooltipItem) => React.ReactNode;
|
|
73
|
+
/** Language of the default number format and of "No data". Default the toolkit locale. */
|
|
74
|
+
locale?: Locale;
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* The tooltip box: a label line, then one row per series with its indicator, name and value. A series without a
|
|
78
|
+
* value at the point shows "No data" (it reaches the box when the Tooltip has `filterNull={false}`). Works inside a
|
|
79
|
+
* ChartContainer (names and colours from its config) or alone.
|
|
80
|
+
*/
|
|
81
|
+
export declare const ChartTooltipContent: React.ForwardRefExoticComponent<Partial<TooltipContentProps> & {
|
|
82
|
+
className?: string;
|
|
83
|
+
hideLabel?: boolean;
|
|
84
|
+
hideIndicator?: boolean;
|
|
85
|
+
indicator?: 'line' | 'dot' | 'dashed';
|
|
86
|
+
nameKey?: string;
|
|
87
|
+
labelKey?: string;
|
|
88
|
+
labelClassName?: string;
|
|
89
|
+
color?: string;
|
|
90
|
+
/** Formats each value. Default: a number in the locale ("1,240" / "1 240"), a string as written. */
|
|
91
|
+
valueFormatter?: (value: number | string, item: TooltipItem) => React.ReactNode;
|
|
92
|
+
/** Language of the default number format and of "No data". Default the toolkit locale. */
|
|
93
|
+
locale?: Locale;
|
|
94
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
95
|
+
/**
|
|
96
|
+
* One legend entry: an item of recharts' legend payload, or your own for a legend drawn outside a chart (a hand-made
|
|
97
|
+
* chart, a Scatter, a key shared by several charts).
|
|
98
|
+
*/
|
|
99
|
+
export interface ChartLegendItem {
|
|
100
|
+
/** The series key: its label and colour come from the config. */
|
|
101
|
+
dataKey?: unknown;
|
|
102
|
+
/** The label when the config has none for the key (recharts puts the series name here). */
|
|
103
|
+
value?: React.ReactNode;
|
|
104
|
+
/** Any CSS colour. Default the config colour, else `var(--color-<key>)` (defined inside a ChartContainer only). */
|
|
105
|
+
color?: string;
|
|
106
|
+
/** How the key is drawn. Default a square, or a dashed line for a dashed series. */
|
|
107
|
+
shape?: 'square' | 'circle' | 'line' | 'dashed';
|
|
108
|
+
/** A dashed series, such as a comparison: drawn as a dashed line. */
|
|
109
|
+
dashed?: boolean;
|
|
110
|
+
/** recharts' legend type: `none` (a series with `legendType="none"`) leaves the entry out. */
|
|
111
|
+
type?: string;
|
|
112
|
+
/** recharts' series props: a `strokeDasharray` draws the key dashed. */
|
|
113
|
+
payload?: unknown;
|
|
114
|
+
}
|
|
115
|
+
export type ChartLegendProps = React.ComponentProps<'div'> & {
|
|
116
|
+
hideIcon?: boolean;
|
|
117
|
+
/** The entries: recharts' Legend `payload`, or ChartLegendItem objects of your own. */
|
|
118
|
+
payload?: readonly unknown[];
|
|
119
|
+
verticalAlign?: 'top' | 'bottom';
|
|
120
|
+
nameKey?: string;
|
|
121
|
+
/** Labels, colours and icons by key. Default the ChartContainer's config; give it for a legend outside one. */
|
|
122
|
+
config?: ChartConfig;
|
|
123
|
+
};
|
|
124
|
+
/**
|
|
125
|
+
* The legend: a key (square, circle, line or dashed line) and a label per series. Inside a ChartContainer, as a
|
|
126
|
+
* recharts `<Legend content>`, or alone with `config` and ChartLegendItem entries.
|
|
127
|
+
*/
|
|
128
|
+
export declare const ChartLegend: React.ForwardRefExoticComponent<Omit<ChartLegendProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
129
|
+
/**
|
|
130
|
+
* A bar shape that keeps zero-size bars, so their labels still draw (recharts drops a zero bar, and its label, unless
|
|
131
|
+
* the Bar has a shape of its own). Draws the bar as recharts does. `<Bar shape={barShape} label={...} />`.
|
|
132
|
+
*/
|
|
133
|
+
export declare function barShape(props: BarShapeProps): React.ReactElement;
|
|
134
|
+
/**
|
|
135
|
+
* A bar's value label, zero bars included: after the end of a horizontal bar, or above a vertical one with
|
|
136
|
+
* `position: 'top'`. Pair it with `shape={barShape}` (zero bars keep their place) and give `formatter` for the
|
|
137
|
+
* number text. Made for values of 0 and up.
|
|
138
|
+
* `<Bar shape={barShape} label={{ content: barLabel, position: 'right', formatter: (v) => format(v) }} />`
|
|
139
|
+
*/
|
|
140
|
+
export declare function barLabel(props: LabelProps): React.ReactElement | null;
|
|
141
|
+
export type ChartKind = 'line' | 'bar' | 'area';
|
|
142
|
+
export interface ChartSeries {
|
|
143
|
+
/** Field of each row holding the value. */
|
|
144
|
+
key: string;
|
|
145
|
+
label: Words | string;
|
|
146
|
+
/** Any CSS colour. Default the chart tokens in order (`--chart-1`, `--chart-2`...). */
|
|
147
|
+
color?: string;
|
|
148
|
+
}
|
|
149
|
+
export interface ChartProps {
|
|
150
|
+
kind: ChartKind;
|
|
151
|
+
/** One row per point, such as `periodSeries()` rows. */
|
|
152
|
+
data: readonly object[];
|
|
153
|
+
/** The series drawn. Default `{ key: 'value', label: 'This period' }`. */
|
|
154
|
+
series?: ChartSeries | readonly ChartSeries[];
|
|
155
|
+
/**
|
|
156
|
+
* The comparison, drawn as a dashed line. A CompareId reads the `compare` field and names it ("Previous period");
|
|
157
|
+
* a series names its own field. Omitted or `none`: no comparison.
|
|
158
|
+
*/
|
|
159
|
+
compare?: CompareId | ChartSeries | false | null;
|
|
160
|
+
/** Unique field per row for the x axis. Default `key` when rows have it, else `label`. */
|
|
161
|
+
xKey?: string;
|
|
162
|
+
/** Field with the short axis label. Default `label`. */
|
|
163
|
+
labelKey?: string;
|
|
164
|
+
/** Field with the full point name in tooltips and the data table. Default `range`, else the axis label. */
|
|
165
|
+
nameKey?: string;
|
|
166
|
+
/** Accessible name of the chart and title of its data table. */
|
|
167
|
+
title?: Words | string;
|
|
168
|
+
/**
|
|
169
|
+
* Height in px. Default 140 for bars and 200 for a line or an area (deck PG3), or one row per point for horizontal
|
|
170
|
+
* bars (32px, or 14px a series plus 12 when several series sit side by side). A chart that switches kind passes one
|
|
171
|
+
* height, so the switch never moves the page.
|
|
172
|
+
*/
|
|
173
|
+
height?: number;
|
|
174
|
+
/** Bars or areas stack, and the value axis fits each point's total. Lines ignore it. */
|
|
175
|
+
stacked?: boolean;
|
|
176
|
+
/**
|
|
177
|
+
* Bars run left to right, one row per point: its label before the bar on at most two lines, its value after (the
|
|
178
|
+
* total when stacked). Only for `kind="bar"`; draws no comparison.
|
|
179
|
+
*/
|
|
180
|
+
horizontal?: boolean;
|
|
181
|
+
/** Value text in tooltips and the data table. Default whole numbers (one decimal under 10). */
|
|
182
|
+
format?: (value: number, locale: Locale) => string;
|
|
183
|
+
/** The short value after each horizontal bar (or stack), such as "1.2k" beside an exact tooltip. Default `format`. */
|
|
184
|
+
labelFormat?: (value: number, locale: Locale) => string;
|
|
185
|
+
/**
|
|
186
|
+
* The last point is still filling (the range ends today): its bar is drawn full colour, the others lighter until
|
|
187
|
+
* hovered (deck period-r6). Default: true when the last row's `to` is today.
|
|
188
|
+
*/
|
|
189
|
+
live?: boolean;
|
|
190
|
+
locale?: Locale;
|
|
191
|
+
className?: string;
|
|
192
|
+
}
|
|
193
|
+
/** The colour series `i` is drawn with. */
|
|
194
|
+
export declare function seriesColor(series: ChartSeries, index: number): string;
|
|
195
|
+
/** The hidden table of a chart: one row per point, the point name then each series value. */
|
|
196
|
+
export declare function chartTableRows(data: readonly object[], series: readonly ChartSeries[], compare: ChartSeries | null, nameOf: (row: object) => string, format: (value: number) => string): Array<Array<string | null>>;
|
|
197
|
+
/** A period chart (bars, a line or an area) with an optional dashed comparison; 140px bars or a 200px plot by default. */
|
|
198
|
+
export declare function Chart({ kind, data, series: seriesProp, compare: compareProp, xKey: xKeyProp, labelKey, nameKey: nameKeyProp, title, height: heightProp, stacked, horizontal: horizontalProp, format: formatProp, labelFormat: labelFormatProp, live: liveProp, locale: localeProp, className, }: ChartProps): React.JSX.Element;
|
|
199
|
+
export declare namespace Chart {
|
|
200
|
+
var displayName: string;
|
|
201
|
+
}
|
|
202
|
+
/** "1,240 on Jan 5" / "1 240 le 5 janv.", for a Space's own tooltips and summaries. */
|
|
203
|
+
export declare function chartPointText(value: string, name: string, locale: Locale, previous?: string | null): string;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ChartTable (toolkit spec 2.11, deck chart page alt b): the metrics of a chart page as a table under the chart.
|
|
3
|
+
* Columns: Metric, Trend (a sparkline, 140), Value (112), then Previous (112) and Change (96) with a comparison. Trend
|
|
4
|
+
* and Previous hide when the table is 760px or narrower. The deck table rules: 40px rows, a sticky 36px header, the
|
|
5
|
+
* Metric cell 24px in and the last cell 24px from the right edge. A real table, so view Markdown reads it as one.
|
|
6
|
+
*/
|
|
7
|
+
import * as React from 'react';
|
|
8
|
+
import { type Locale, type Words } from '../../words/types';
|
|
9
|
+
import type { CompareId } from '../period/periods';
|
|
10
|
+
import { type StatMetric } from './StatRow';
|
|
11
|
+
export interface SparklineProps {
|
|
12
|
+
/** One value per point. A null (or NaN) is a gap: the line breaks there instead of dropping to zero. */
|
|
13
|
+
values: readonly (number | null)[];
|
|
14
|
+
width?: number;
|
|
15
|
+
height?: number;
|
|
16
|
+
className?: string;
|
|
17
|
+
}
|
|
18
|
+
/** A small area plus line (72 by 24 by default), drawn in `--chart-1`. Decorative: hidden from assistive tech. */
|
|
19
|
+
export declare function Sparkline({ values, width, height, className }: SparklineProps): React.JSX.Element;
|
|
20
|
+
export interface ChartTableProps {
|
|
21
|
+
metrics: readonly StatMetric[];
|
|
22
|
+
/** Default `prev`; `none` drops the Previous and Change columns. */
|
|
23
|
+
compare?: CompareId;
|
|
24
|
+
/** Accessible name. Default "Key figures". */
|
|
25
|
+
title?: Words | string;
|
|
26
|
+
/** The highlighted metric (the one the chart above draws). */
|
|
27
|
+
activeId?: string;
|
|
28
|
+
/** Makes rows pressable: picks the metric the chart draws. */
|
|
29
|
+
onSelect?: (metric: StatMetric) => void;
|
|
30
|
+
locale?: Locale;
|
|
31
|
+
className?: string;
|
|
32
|
+
}
|
|
33
|
+
/** The metrics of a chart page as a table: 40px rows, a sticky header, Trend and Previous hidden at 760px or less. */
|
|
34
|
+
export declare function ChartTable({ metrics, compare, title, activeId, onSelect, locale: localeProp, className }: ChartTableProps): React.JSX.Element;
|
|
35
|
+
export declare namespace ChartTable {
|
|
36
|
+
var displayName: string;
|
|
37
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
export interface RenderChartDataProps {
|
|
4
|
+
title: string;
|
|
5
|
+
columns: readonly string[];
|
|
6
|
+
rows: readonly (readonly (string | number | boolean | null)[])[];
|
|
7
|
+
/** The visible chart. `Chart` and `ChartTable` already render their own data table. */
|
|
8
|
+
children?: ReactNode;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* A chart's data, available to view Markdown without adding a second visible table (toolkit spec 2.11; moved from
|
|
12
|
+
* `src/components/RenderChartData.tsx`). Keep labels and values identical to the chart. The renderer recognizes this
|
|
13
|
+
* semantic table inside Shadow DOM; snapshots never infer numbers from SVG geometry. `Chart` renders its numbers
|
|
14
|
+
* through it.
|
|
15
|
+
*/
|
|
16
|
+
export declare function RenderChartData({ title, columns, rows, children }: RenderChartDataProps): React.JSX.Element;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* StatRow (toolkit spec 2.11, deck chart page alt b, PG2): the key figures above a chart, as a full-width strip of
|
|
3
|
+
* four equal cells (two when the strip is 640px or narrower). Each cell, 24px in and 16px tall padding, shows its
|
|
4
|
+
* label, the value with its change, and the previous value with what it is compared to. No card, gap or rule between
|
|
5
|
+
* cells; a strip right after a bar Section takes a hairline above and below (the toolkit's blocks rules).
|
|
6
|
+
*/
|
|
7
|
+
import * as React from 'react';
|
|
8
|
+
import { type Locale, type Words } from '../../words/types';
|
|
9
|
+
import { type Delta } from '../period/dateFormat';
|
|
10
|
+
import type { CompareId } from '../period/periods';
|
|
11
|
+
/** One figure of a StatRow or a ChartTable row. */
|
|
12
|
+
export interface StatMetric {
|
|
13
|
+
/** Stable key. Default the label. */
|
|
14
|
+
id?: string;
|
|
15
|
+
label: Words | string;
|
|
16
|
+
/** This period. A string is shown as written (no change computed). */
|
|
17
|
+
value: number | string;
|
|
18
|
+
/** The comparison period's value. */
|
|
19
|
+
previous?: number | null;
|
|
20
|
+
/** Default whole numbers (one decimal under 10) in the locale. */
|
|
21
|
+
format?: (value: number, locale: Locale) => string;
|
|
22
|
+
/** False when a rise is bad (costs, errors): the change turns red. Default true. */
|
|
23
|
+
higherIsBetter?: boolean;
|
|
24
|
+
/** Replaces the second line ("1,020 previous period"). */
|
|
25
|
+
hint?: Words | string;
|
|
26
|
+
/** Values over the period, for the ChartTable trend column. A null is a gap in the sparkline. */
|
|
27
|
+
spark?: readonly (number | null)[];
|
|
28
|
+
/**
|
|
29
|
+
* Beside the label, in StatRow and ChartTable: what the figure means, usually an info button that opens a popover
|
|
30
|
+
* or a tooltip (the Space's own). In a pressable ChartTable row a press on it does not pick the row.
|
|
31
|
+
*/
|
|
32
|
+
about?: React.ReactNode;
|
|
33
|
+
}
|
|
34
|
+
export interface StatRowProps {
|
|
35
|
+
metrics: readonly StatMetric[];
|
|
36
|
+
/** What `previous` is: names it on the second line. Default `prev`; `none` hides previous values and changes. */
|
|
37
|
+
compare?: CompareId;
|
|
38
|
+
locale?: Locale;
|
|
39
|
+
className?: string;
|
|
40
|
+
}
|
|
41
|
+
export interface MetricView {
|
|
42
|
+
key: string;
|
|
43
|
+
label: string;
|
|
44
|
+
value: string;
|
|
45
|
+
previous: string | null;
|
|
46
|
+
delta: Delta | null;
|
|
47
|
+
sub: string | null;
|
|
48
|
+
}
|
|
49
|
+
/** "vs previous period" without its "vs ": "previous period" / "période précédente". */
|
|
50
|
+
export declare function vsTail(compare: CompareId, locale: Locale): string;
|
|
51
|
+
/** The texts of one metric cell, computed once for StatRow and ChartTable. Pure. */
|
|
52
|
+
export declare function metricView(metric: StatMetric, compare: CompareId, locale: Locale): MetricView;
|
|
53
|
+
/** True when a slot holds something to draw. */
|
|
54
|
+
export declare function hasSlot(node: React.ReactNode): boolean;
|
|
55
|
+
/** The key figures strip: four equal cells per line (two at 640px or narrower), full width, no frame. */
|
|
56
|
+
export declare function StatRow({ metrics, compare, locale: localeProp, className }: StatRowProps): React.JSX.Element;
|
|
57
|
+
export declare namespace StatRow {
|
|
58
|
+
var displayName: string;
|
|
59
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Chart data mapping (toolkit spec 2.11). Pure: date-fns only.
|
|
3
|
+
*
|
|
4
|
+
* Dated points go into bins sized for the period, the way the deck draws it: hours for one day, days up to a month,
|
|
5
|
+
* weeks up to six months, then months. The comparison period is binned the same way and lined up bin by bin.
|
|
6
|
+
*/
|
|
7
|
+
import type { Locale } from '../../words/types';
|
|
8
|
+
import { type DateRange } from '../period/periods';
|
|
9
|
+
export type BinUnit = 'hour' | 'day' | 'week' | 'month';
|
|
10
|
+
export interface Bin {
|
|
11
|
+
from: Date;
|
|
12
|
+
to: Date;
|
|
13
|
+
}
|
|
14
|
+
export interface DatedPoint {
|
|
15
|
+
date: Date | string | number;
|
|
16
|
+
value: number;
|
|
17
|
+
}
|
|
18
|
+
/** One row of a period chart: the bin, its value and, with a comparison, the value of the same bin before. */
|
|
19
|
+
export interface PeriodChartRow {
|
|
20
|
+
/** ISO start of the bin, a stable key. */
|
|
21
|
+
key: string;
|
|
22
|
+
/** Short axis label ("Jan 5", "14", "Mar"). */
|
|
23
|
+
label: string;
|
|
24
|
+
/** Full bin name for tooltips ("Jan 5 to 11, 2026"). */
|
|
25
|
+
range: string;
|
|
26
|
+
from: Date;
|
|
27
|
+
to: Date;
|
|
28
|
+
value: number;
|
|
29
|
+
compare: number | null;
|
|
30
|
+
}
|
|
31
|
+
export declare function binUnit(range: DateRange): BinUnit;
|
|
32
|
+
/** The bins of a range. Weeks step seven days from the first day; the last week and month stop at the range end. */
|
|
33
|
+
export declare function buildBins(range: DateRange, unit?: BinUnit): Bin[];
|
|
34
|
+
/** Adds up (or averages, for levels such as active users) the points that fall in each bin. Empty bins are 0. */
|
|
35
|
+
export declare function aggregate(points: readonly DatedPoint[], bins: readonly Bin[], mode?: 'sum' | 'avg'): number[];
|
|
36
|
+
export declare function binLabel(bin: Bin, unit: BinUnit, locale: Locale): string;
|
|
37
|
+
export declare function binRangeLabel(bin: Bin, unit: BinUnit, locale: Locale): string;
|
|
38
|
+
export interface PeriodSeriesInput {
|
|
39
|
+
points: readonly DatedPoint[];
|
|
40
|
+
range: DateRange;
|
|
41
|
+
/** The comparison range; its points come from `comparePoints`, or from `points` when they cover it. */
|
|
42
|
+
compareRange?: DateRange | null;
|
|
43
|
+
comparePoints?: readonly DatedPoint[];
|
|
44
|
+
mode?: 'sum' | 'avg';
|
|
45
|
+
unit?: BinUnit;
|
|
46
|
+
locale: Locale;
|
|
47
|
+
}
|
|
48
|
+
/** Rows for `<Chart>`: one per bin of the period, with the comparison lined up bin by bin (cut to the same count). */
|
|
49
|
+
export declare function periodSeries(input: PeriodSeriesInput): PeriodChartRow[];
|
|
50
|
+
/** Sum or average of a period, for a stat next to the chart. */
|
|
51
|
+
export declare function total(points: readonly DatedPoint[], range: DateRange, mode?: 'sum' | 'avg'): number;
|
|
52
|
+
/** Half the widest short axis label ("15 sept.", "12 PM"), in px. */
|
|
53
|
+
export declare const AXIS_LABEL_HALF = 24;
|
|
54
|
+
/**
|
|
55
|
+
* Room between two labelled points of a line or area chart, in px (80): an edge label anchored inward (see
|
|
56
|
+
* `edgeAnchor`), a whole label wide, and the centred label next to it, half a label, keep 8px apart.
|
|
57
|
+
*/
|
|
58
|
+
export declare const AXIS_LABEL_ROOM: number;
|
|
59
|
+
/**
|
|
60
|
+
* Axis labels: about seven, counted back from the last bin so the newest one always shows. With `spacing`, the px
|
|
61
|
+
* between neighbouring points, a narrow chart labels fewer points so no two labels meet.
|
|
62
|
+
*/
|
|
63
|
+
export declare function axisLabelStep(count: number, spacing?: number): number;
|
|
64
|
+
export declare function showAxisLabel(index: number, count: number, spacing?: number): boolean;
|
|
65
|
+
/**
|
|
66
|
+
* How an axis label sits on its point `x` in a line or area chart, whose first and last points lie on the plot edges
|
|
67
|
+
* (`left`, `right`): a label closer to an edge than half a label starts (left) or ends (right) at its point, so it
|
|
68
|
+
* never runs out of the chart. Every other label is centred.
|
|
69
|
+
*/
|
|
70
|
+
export declare function edgeAnchor(x: number, left: number, right: number): 'start' | 'middle' | 'end';
|
|
71
|
+
/** Top of the value axis: 10% above the highest value (this period or the comparison), never below 1. */
|
|
72
|
+
export declare function chartMax(values: ReadonlyArray<number | null | undefined>): number;
|
|
73
|
+
/** True when the period ends today, so its last bin is still filling (drawn full colour). */
|
|
74
|
+
export declare function endsToday(range: DateRange, now?: Date): boolean;
|
|
75
|
+
/**
|
|
76
|
+
* Paths of a sparkline (deck: an area plus a line, 72 by 24): `line` strokes the values left to right, `area` closes
|
|
77
|
+
* it down to the baseline. Values scale to the highest one (×1.1, like the chart); one value draws a flat line.
|
|
78
|
+
* A missing value (null, undefined, NaN) is a gap: each point keeps its place, the line and the area break at the
|
|
79
|
+
* gap, and a point alone between gaps is a dot (a zero-length segment the round line cap draws).
|
|
80
|
+
*/
|
|
81
|
+
export declare function sparkPaths(values: readonly (number | null | undefined)[], width?: number, height?: number): {
|
|
82
|
+
line: string;
|
|
83
|
+
area: string;
|
|
84
|
+
};
|