@book.dev/ui 1.60.0
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/LICENSE +21 -0
- package/dist/EmojiGrid-xK5mPJPo.js +205 -0
- package/dist/blockeditor/BlockEditor.d.ts +68 -0
- package/dist/blockeditor/CodeBlockView.d.ts +19 -0
- package/dist/blockeditor/InlineToolbar.d.ts +18 -0
- package/dist/blockeditor/LinkPicker.d.ts +16 -0
- package/dist/blockeditor/MentionMenu.d.ts +14 -0
- package/dist/blockeditor/PresentBlocks.d.ts +21 -0
- package/dist/blockeditor/RichTextEditor.d.ts +29 -0
- package/dist/blockeditor/SlashMenu.d.ts +49 -0
- package/dist/blockeditor/TextBlockView.d.ts +9 -0
- package/dist/blockeditor/__tests__/LinkPicker.test.d.ts +1 -0
- package/dist/blockeditor/__tests__/SlashMenu.test.d.ts +1 -0
- package/dist/blockeditor/__tests__/aiApply.test.d.ts +1 -0
- package/dist/blockeditor/__tests__/groupLock.test.d.ts +1 -0
- package/dist/blockeditor/__tests__/highlight.test.d.ts +1 -0
- package/dist/blockeditor/__tests__/mergeUp.test.d.ts +1 -0
- package/dist/blockeditor/__tests__/present.test.d.ts +1 -0
- package/dist/blockeditor/aiBlocks.d.ts +9 -0
- package/dist/blockeditor/colors.d.ts +23 -0
- package/dist/blockeditor/exportBlocks.d.ts +25 -0
- package/dist/blockeditor/highlight.d.ts +25 -0
- package/dist/blockeditor/index.d.ts +8 -0
- package/dist/blockeditor/kit/KitFrame.d.ts +95 -0
- package/dist/blockeditor/kit/KitSettings.d.ts +18 -0
- package/dist/blockeditor/kit/OptionsEditor.d.ts +8 -0
- package/dist/blockeditor/kit/__tests__/chartMath.test.d.ts +1 -0
- package/dist/blockeditor/kit/__tests__/dataflow.test.d.ts +1 -0
- package/dist/blockeditor/kit/__tests__/exportKit.test.d.ts +1 -0
- package/dist/blockeditor/kit/__tests__/exportKit2.test.d.ts +1 -0
- package/dist/blockeditor/kit/__tests__/groupSync.test.d.ts +1 -0
- package/dist/blockeditor/kit/__tests__/inputs2Render.test.d.ts +1 -0
- package/dist/blockeditor/kit/__tests__/inputs2Scope.test.d.ts +1 -0
- package/dist/blockeditor/kit/__tests__/inputsRender.test.d.ts +1 -0
- package/dist/blockeditor/kit/__tests__/kitConfig.test.d.ts +1 -0
- package/dist/blockeditor/kit/__tests__/kitPanel.test.d.ts +1 -0
- package/dist/blockeditor/kit/__tests__/options.test.d.ts +1 -0
- package/dist/blockeditor/kit/__tests__/scope.test.d.ts +1 -0
- package/dist/blockeditor/kit/cards.d.ts +51 -0
- package/dist/blockeditor/kit/chartMath.d.ts +62 -0
- package/dist/blockeditor/kit/charts.d.ts +27 -0
- package/dist/blockeditor/kit/completion.d.ts +45 -0
- package/dist/blockeditor/kit/dataflow.d.ts +68 -0
- package/dist/blockeditor/kit/groupSync.d.ts +23 -0
- package/dist/blockeditor/kit/index.d.ts +11 -0
- package/dist/blockeditor/kit/inputs.d.ts +135 -0
- package/dist/blockeditor/kit/inputs2.d.ts +86 -0
- package/dist/blockeditor/kit/kitConfig.d.ts +5 -0
- package/dist/blockeditor/kit/kitPanel.d.ts +31 -0
- package/dist/blockeditor/kit/lock.d.ts +12 -0
- package/dist/blockeditor/kit/options.d.ts +60 -0
- package/dist/blockeditor/kit/progress.d.ts +20 -0
- package/dist/blockeditor/kit/scope.d.ts +100 -0
- package/dist/blockeditor/model.d.ts +236 -0
- package/dist/blockeditor/present.d.ts +18 -0
- package/dist/blockeditor/provider.d.ts +16 -0
- package/dist/blockeditor/reactiveBlocks.d.ts +2 -0
- package/dist/blockeditor/registry.d.ts +38 -0
- package/dist/blockeditor/richtext.d.ts +48 -0
- package/dist/blockeditor/useBlockEditor.d.ts +45 -0
- package/dist/components/AboutDialog.d.ts +9 -0
- package/dist/components/AgentPanel.d.ts +2 -0
- package/dist/components/AiBridgeHost.d.ts +14 -0
- package/dist/components/AiSearchDialog.d.ts +8 -0
- package/dist/components/AiSettings.d.ts +7 -0
- package/dist/components/AppearanceSettings.d.ts +3 -0
- package/dist/components/BackForwardCluster.d.ts +1 -0
- package/dist/components/BackupSettings.d.ts +2 -0
- package/dist/components/BreadcrumbCluster.d.ts +1 -0
- package/dist/components/ColorSchemeMenu.d.ts +1 -0
- package/dist/components/CommandMenu.d.ts +1 -0
- package/dist/components/CommandToggle.d.ts +3 -0
- package/dist/components/DocumentArea.d.ts +8 -0
- package/dist/components/Drawer.d.ts +7 -0
- package/dist/components/EmojiGrid.d.ts +16 -0
- package/dist/components/EmojiPickerHost.d.ts +8 -0
- package/dist/components/ExtensionsSettings.d.ts +7 -0
- package/dist/components/FavoritesNav.d.ts +8 -0
- package/dist/components/GeneralSettings.d.ts +2 -0
- package/dist/components/GlobalShortcuts.d.ts +9 -0
- package/dist/components/HomeButton.d.ts +2 -0
- package/dist/components/IconPicker.d.ts +17 -0
- package/dist/components/NavBar.d.ts +1 -0
- package/dist/components/NavContextMenu.d.ts +7 -0
- package/dist/components/PageActionsCluster.d.ts +9 -0
- package/dist/components/PageAppearanceHost.d.ts +9 -0
- package/dist/components/PageContextMenu.d.ts +17 -0
- package/dist/components/PageCover.d.ts +18 -0
- package/dist/components/PageHeaderControls.d.ts +13 -0
- package/dist/components/PageIcon.d.ts +16 -0
- package/dist/components/PageProperties.d.ts +53 -0
- package/dist/components/PluginBoot.d.ts +2 -0
- package/dist/components/PresentMode.d.ts +7 -0
- package/dist/components/ProfileAvatar.d.ts +17 -0
- package/dist/components/ProfileMenu.d.ts +6 -0
- package/dist/components/Settings.d.ts +7 -0
- package/dist/components/SettingsButton.d.ts +2 -0
- package/dist/components/SettingsPanel.d.ts +14 -0
- package/dist/components/SideNav.d.ts +1 -0
- package/dist/components/SideNavToggle.d.ts +3 -0
- package/dist/components/SidebarSections.d.ts +17 -0
- package/dist/components/SplitPane.d.ts +9 -0
- package/dist/components/TemplateGallery.d.ts +8 -0
- package/dist/components/TitlebarTabs.d.ts +10 -0
- package/dist/components/TrashDialog.d.ts +7 -0
- package/dist/components/WindowActionsCluster.d.ts +6 -0
- package/dist/components/WindowControls.d.ts +6 -0
- package/dist/components/WindowTitle.d.ts +7 -0
- package/dist/components/WorkspaceInfo.d.ts +6 -0
- package/dist/components/WorkspaceNavigationTree.d.ts +14 -0
- package/dist/components/WorkspaceSelectMenu.d.ts +10 -0
- package/dist/components/__tests__/AppearanceSettings.test.d.ts +1 -0
- package/dist/components/__tests__/PageIcon.test.d.ts +1 -0
- package/dist/components/__tests__/SettingsPanel.test.d.ts +1 -0
- package/dist/components/__tests__/buildTree.test.d.ts +1 -0
- package/dist/components/__tests__/profileAvatar.test.d.ts +1 -0
- package/dist/components/appearance/AppearanceControls.d.ts +33 -0
- package/dist/components/appearance/PageCustomiseBody.d.ts +29 -0
- package/dist/components/brand/OpenBookLogo.d.ts +11 -0
- package/dist/components/brand/index.d.ts +1 -0
- package/dist/components/database/DatabaseCard.d.ts +36 -0
- package/dist/components/database/DatabasePicker.d.ts +12 -0
- package/dist/components/database/DatabaseRowProperties.d.ts +13 -0
- package/dist/components/database/DatabaseView.d.ts +9 -0
- package/dist/components/database/InlineDatabaseBlock.d.ts +3 -0
- package/dist/components/database/__tests__/InlineDatabaseBlock.test.d.ts +1 -0
- package/dist/components/database/databaseCells.d.ts +57 -0
- package/dist/components/database/databaseCharts.d.ts +28 -0
- package/dist/components/database/databaseColors.d.ts +12 -0
- package/dist/components/database/databaseGraph.d.ts +16 -0
- package/dist/components/database/databaseLayouts.d.ts +84 -0
- package/dist/components/database/databaseMap.d.ts +21 -0
- package/dist/components/database/databaseMapLeaflet.d.ts +26 -0
- package/dist/components/database/databaseMenus.d.ts +97 -0
- package/dist/components/database/databaseTimeline.d.ts +27 -0
- package/dist/components/database/geocode.d.ts +24 -0
- package/dist/components/database/useDatabase.d.ts +129 -0
- package/dist/components/index.d.ts +12 -0
- package/dist/components/review/BlockReviewMarkers.d.ts +19 -0
- package/dist/components/review/CommentThread.d.ts +20 -0
- package/dist/components/review/ReviewPaneBody.d.ts +12 -0
- package/dist/components/review/SuggestHost.d.ts +13 -0
- package/dist/components/review/SuggestionCard.d.ts +21 -0
- package/dist/components/review/__tests__/review.test.d.ts +1 -0
- package/dist/components/review/useReview.d.ts +27 -0
- package/dist/components/settings/AccountSettings.d.ts +6 -0
- package/dist/components/settings/AdminSettings.d.ts +2 -0
- package/dist/components/settings/ConnectionSettings.d.ts +7 -0
- package/dist/components/settings/CustomisationSettings.d.ts +2 -0
- package/dist/components/settings/ProfileSettings.d.ts +2 -0
- package/dist/components/settings/primitives.d.ts +47 -0
- package/dist/components/settings/stubs.d.ts +8 -0
- package/dist/components/ui/__tests__/kbd.test.d.ts +1 -0
- package/dist/components/ui/__tests__/markdown.test.d.ts +1 -0
- package/dist/components/ui/__tests__/select.test.d.ts +1 -0
- package/dist/components/ui/badge.d.ts +9 -0
- package/dist/components/ui/button.d.ts +11 -0
- package/dist/components/ui/command.d.ts +86 -0
- package/dist/components/ui/context-menu.d.ts +24 -0
- package/dist/components/ui/dialog.d.ts +18 -0
- package/dist/components/ui/dropdown-menu.d.ts +27 -0
- package/dist/components/ui/icon-button.d.ts +16 -0
- package/dist/components/ui/input.d.ts +9 -0
- package/dist/components/ui/kbd.d.ts +31 -0
- package/dist/components/ui/label.d.ts +5 -0
- package/dist/components/ui/markdown.d.ts +19 -0
- package/dist/components/ui/navigation-menu.d.ts +12 -0
- package/dist/components/ui/popover.d.ts +6 -0
- package/dist/components/ui/scroll-area.d.ts +5 -0
- package/dist/components/ui/select.d.ts +42 -0
- package/dist/components/ui/skeleton.d.ts +6 -0
- package/dist/components/ui/switch.d.ts +4 -0
- package/dist/components/ui/tooltip.d.ts +7 -0
- package/dist/components/ui/tree.d.ts +37 -0
- package/dist/components/useAppCommands.d.ts +25 -0
- package/dist/data/DataProvider.d.ts +30 -0
- package/dist/data/index.d.ts +1 -0
- package/dist/databaseMapLeaflet-8LYcHcR6.js +87 -0
- package/dist/export/__tests__/chartNormalize.test.d.ts +1 -0
- package/dist/export/__tests__/export.test.d.ts +1 -0
- package/dist/export/__tests__/exportReactive.test.d.ts +1 -0
- package/dist/export/chartNormalize.d.ts +22 -0
- package/dist/export/chartSvg.d.ts +2 -0
- package/dist/export/documentModel.d.ts +136 -0
- package/dist/export/exportSite.d.ts +40 -0
- package/dist/export/format.d.ts +2 -0
- package/dist/export/kitChart.d.ts +21 -0
- package/dist/export/toHtml.d.ts +25 -0
- package/dist/export/toMarkdown.d.ts +7 -0
- package/dist/export/toPdf.d.ts +14 -0
- package/dist/exportBlocks-33D7P_8Q.js +987 -0
- package/dist/exportSite-DlRm4u7W.js +50 -0
- package/dist/format-CLQoRoYP.js +1646 -0
- package/dist/i18n/__tests__/i18n.test.d.ts +1 -0
- package/dist/i18n/index.d.ts +24 -0
- package/dist/i18n/messages/de.d.ts +2 -0
- package/dist/i18n/messages/en.d.ts +977 -0
- package/dist/i18n/messages/ja.d.ts +2 -0
- package/dist/i18n/messages/zh.d.ts +2 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +20915 -0
- package/dist/layouts/DefaultLayout.d.ts +4 -0
- package/dist/layouts/index.d.ts +1 -0
- package/dist/lib/__tests__/accountClient.test.d.ts +1 -0
- package/dist/lib/__tests__/backlinks.test.d.ts +1 -0
- package/dist/lib/__tests__/backupBundle.test.d.ts +1 -0
- package/dist/lib/__tests__/blockExport.test.d.ts +1 -0
- package/dist/lib/__tests__/blockModel.test.d.ts +1 -0
- package/dist/lib/__tests__/databaseFormula.test.d.ts +1 -0
- package/dist/lib/__tests__/databaseTypes.test.d.ts +1 -0
- package/dist/lib/__tests__/favorites.test.d.ts +1 -0
- package/dist/lib/__tests__/homePage.test.d.ts +1 -0
- package/dist/lib/__tests__/hud.test.d.ts +1 -0
- package/dist/lib/__tests__/icons.test.d.ts +1 -0
- package/dist/lib/__tests__/mixedContent.test.d.ts +1 -0
- package/dist/lib/__tests__/pageAppearance.test.d.ts +1 -0
- package/dist/lib/__tests__/pageIcon.test.d.ts +1 -0
- package/dist/lib/__tests__/pageLayout.test.d.ts +1 -0
- package/dist/lib/__tests__/pageSaveStatus.test.d.ts +1 -0
- package/dist/lib/__tests__/pageTheme.test.d.ts +1 -0
- package/dist/lib/__tests__/parentGrouping.test.d.ts +1 -0
- package/dist/lib/__tests__/pluginSdk.test.d.ts +1 -0
- package/dist/lib/__tests__/recents.test.d.ts +1 -0
- package/dist/lib/__tests__/relations.test.d.ts +1 -0
- package/dist/lib/__tests__/templates.test.d.ts +1 -0
- package/dist/lib/__tests__/textMerge.test.d.ts +1 -0
- package/dist/lib/__tests__/themes.test.d.ts +1 -0
- package/dist/lib/__tests__/treeMove.test.d.ts +1 -0
- package/dist/lib/aiBridge.d.ts +67 -0
- package/dist/lib/aiFeatures.d.ts +31 -0
- package/dist/lib/aiSettingsNav.d.ts +14 -0
- package/dist/lib/backupBundle.d.ts +23 -0
- package/dist/lib/bookFolderTransfer.d.ts +15 -0
- package/dist/lib/download.d.ts +10 -0
- package/dist/lib/editorChrome.d.ts +14 -0
- package/dist/lib/emoji.d.ts +10 -0
- package/dist/lib/emojiData.d.ts +21 -0
- package/dist/lib/emojiPicker.d.ts +31 -0
- package/dist/lib/favorites.d.ts +11 -0
- package/dist/lib/homePage.d.ts +53 -0
- package/dist/lib/hud.d.ts +70 -0
- package/dist/lib/iconRecents.d.ts +3 -0
- package/dist/lib/iconValue.d.ts +19 -0
- package/dist/lib/lucideIcons.d.ts +21 -0
- package/dist/lib/openDocs.d.ts +5 -0
- package/dist/lib/pageActions.d.ts +17 -0
- package/dist/lib/pageAppearance.d.ts +20 -0
- package/dist/lib/pageCover.d.ts +21 -0
- package/dist/lib/pageCustomise.d.ts +6 -0
- package/dist/lib/pageDocActions.d.ts +20 -0
- package/dist/lib/pageFont.d.ts +25 -0
- package/dist/lib/pageFullWidth.d.ts +10 -0
- package/dist/lib/pageIcon.d.ts +25 -0
- package/dist/lib/pageLinks.d.ts +41 -0
- package/dist/lib/pageSaveStatus.d.ts +14 -0
- package/dist/lib/pageTheme.d.ts +15 -0
- package/dist/lib/pageThemePresets.d.ts +23 -0
- package/dist/lib/recents.d.ts +9 -0
- package/dist/lib/reviewPane.d.ts +23 -0
- package/dist/lib/selection.d.ts +2 -0
- package/dist/lib/shortcuts.d.ts +79 -0
- package/dist/lib/sidebarStyles.d.ts +10 -0
- package/dist/lib/suggestBridge.d.ts +33 -0
- package/dist/lib/textMerge.d.ts +19 -0
- package/dist/lib/themes.d.ts +137 -0
- package/dist/lib/treeMove.d.ts +24 -0
- package/dist/lib/useModifierHeld.d.ts +1 -0
- package/dist/lib/utils.d.ts +2 -0
- package/dist/lucideIcons-B6pmC-WQ.js +5003 -0
- package/dist/model-CBxw8JNb.js +734 -0
- package/dist/pageIcon-BWTy7hAh.js +32 -0
- package/dist/plugins/__tests__/host.test.d.ts +1 -0
- package/dist/plugins/__tests__/loader.test.d.ts +1 -0
- package/dist/plugins/__tests__/pagePlugin.test.d.ts +1 -0
- package/dist/plugins/api.d.ts +67 -0
- package/dist/plugins/commandRegistry.d.ts +15 -0
- package/dist/plugins/host.d.ts +32 -0
- package/dist/plugins/index.d.ts +5 -0
- package/dist/plugins/loader.d.ts +19 -0
- package/dist/plugins/pagePlugin.d.ts +21 -0
- package/dist/providers/AccountProvider.d.ts +67 -0
- package/dist/providers/ConfirmProvider.d.ts +30 -0
- package/dist/providers/ForwardingProvider.d.ts +23 -0
- package/dist/providers/HudProvider.d.ts +9 -0
- package/dist/providers/I18nProvider.d.ts +23 -0
- package/dist/providers/NavigationProvider.d.ts +89 -0
- package/dist/providers/PlatformLibraryProvider.d.ts +107 -0
- package/dist/providers/PreferencesProvider.d.ts +47 -0
- package/dist/providers/ThemeProvider.d.ts +26 -0
- package/dist/providers/WorkspaceProvider.d.ts +40 -0
- package/dist/providers/__tests__/PreferencesProvider.test.d.ts +1 -0
- package/dist/providers/__tests__/extractToken.test.d.ts +1 -0
- package/dist/providers/__tests__/windowModel.test.d.ts +1 -0
- package/dist/providers/index.d.ts +10 -0
- package/dist/providers/windowModel.d.ts +69 -0
- package/dist/screens/BlockPageDocument.d.ts +4 -0
- package/dist/screens/ConnectedPageDocument.d.ts +14 -0
- package/dist/screens/DataflowView.d.ts +2 -0
- package/dist/screens/HomeScreen.d.ts +7 -0
- package/dist/screens/index.d.ts +3 -0
- package/dist/screens/pageChrome.d.ts +46 -0
- package/dist/style.css +3 -0
- package/dist/toHtml-BoPr8Ce4.js +394 -0
- package/dist/toPdf-DGtKQSRA.js +133 -0
- package/package.json +94 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as DefaultLayout } from './DefaultLayout';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import type * as Y from 'yjs';
|
|
2
|
+
import type { AgentProposal, StoredSuggestion } from '@book.dev/sdk';
|
|
3
|
+
/**
|
|
4
|
+
* Bridge between the (provider-less) block editor and the app's AI client —
|
|
5
|
+
* the same singleton pattern as `pageLinks`. The app installs it once
|
|
6
|
+
* (DefaultLayout); editor slash items consult `ready` to decide whether to
|
|
7
|
+
* appear and call through for completions / task breakdowns.
|
|
8
|
+
*
|
|
9
|
+
* The bridge also owns the agent's WRITE path. Write tools never mutate; the
|
|
10
|
+
* agent returns a PROPOSED change set, the AgentPanel shows it for approval,
|
|
11
|
+
* and on approve the bridge applies it. Two application paths:
|
|
12
|
+
*
|
|
13
|
+
* 1. CRDT path — when a live block editor for the target page has registered
|
|
14
|
+
* its Y.Doc (via {@link registerBlockEditorDoc}), the change is applied in
|
|
15
|
+
* ONE Y transaction (origin 'local') so it's undoable and broadcasts live,
|
|
16
|
+
* exactly like a kit click or a streamed token.
|
|
17
|
+
* 2. Server fallback — otherwise the change is applied through the data client
|
|
18
|
+
* (savePage / updateRow). A live editor on that page merges it (CRDT union)
|
|
19
|
+
* on its next server push.
|
|
20
|
+
*
|
|
21
|
+
* Keeping the editor-doc handle in a singleton (rather than coupling the agent
|
|
22
|
+
* to React) mirrors how `aiBridge.complete` already streams tokens into the
|
|
23
|
+
* editor's CRDT without the agent knowing about React at all.
|
|
24
|
+
*/
|
|
25
|
+
export interface ProposalApplyResult {
|
|
26
|
+
applied: number;
|
|
27
|
+
failed: Array<{
|
|
28
|
+
id: string;
|
|
29
|
+
error: string;
|
|
30
|
+
}>;
|
|
31
|
+
}
|
|
32
|
+
export interface AiBridgeImpl {
|
|
33
|
+
/** Engine is configured and was ready at the last status poll. */
|
|
34
|
+
ready: () => boolean;
|
|
35
|
+
complete: (text: string, onToken: (token: string) => void) => Promise<string>;
|
|
36
|
+
tasks: (goal: string, context?: string) => Promise<string[]>;
|
|
37
|
+
/** Apply an approved set of agent proposals. */
|
|
38
|
+
applyProposals: (proposals: AgentProposal[]) => Promise<ProposalApplyResult>;
|
|
39
|
+
/**
|
|
40
|
+
* Apply one accepted suggestion to the document — the same CRDT-first /
|
|
41
|
+
* savePage-fallback path as {@link applyProposals}, keyed off the suggestion's
|
|
42
|
+
* `payload.applyKind`. Throws on failure (the caller keeps the suggestion open).
|
|
43
|
+
*/
|
|
44
|
+
applySuggestion: (suggestion: StoredSuggestion) => Promise<void>;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Convert a persisted suggestion back into the {@link AgentProposal} shape the
|
|
48
|
+
* editor-bridge apply path understands. The suggestion's `payload` carries the
|
|
49
|
+
* original write-tool kind as `applyKind`, so applying an AI suggestion and a
|
|
50
|
+
* human suggestion go through identical code.
|
|
51
|
+
*/
|
|
52
|
+
export declare const suggestionToProposal: (s: StoredSuggestion) => AgentProposal;
|
|
53
|
+
/** A mounted block editor registers its live doc. Returns an unregister fn. */
|
|
54
|
+
export declare const registerBlockEditorDoc: (pageId: string, doc: Y.Doc) => (() => void);
|
|
55
|
+
/** The live editor doc for a page, when one is currently mounted. */
|
|
56
|
+
export declare const getBlockEditorDoc: (pageId: string | undefined) => Y.Doc | null;
|
|
57
|
+
/** Reverse lookup: the page id a live editor doc is registered under, if any. */
|
|
58
|
+
export declare const getPageIdForDoc: (doc: Y.Doc) => string | null;
|
|
59
|
+
export declare const setAiBridge: (next: AiBridgeImpl | null) => void;
|
|
60
|
+
export declare const subscribeAiBridge: (cb: () => void) => (() => void);
|
|
61
|
+
export declare const aiBridge: {
|
|
62
|
+
ready: () => boolean;
|
|
63
|
+
complete: (text: string, onToken: (token: string) => void) => Promise<string>;
|
|
64
|
+
tasks: (goal: string, context?: string) => Promise<string[]>;
|
|
65
|
+
applyProposals: (proposals: AgentProposal[]) => Promise<ProposalApplyResult>;
|
|
66
|
+
applySuggestion: (suggestion: StoredSuggestion) => Promise<void>;
|
|
67
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Per-feature surfacing for AI entry points. Not everyone wants AI front and
|
|
3
|
+
* centre, so each AI feature can be set to:
|
|
4
|
+
* - `recommended` — shown up front in menus (the default),
|
|
5
|
+
* - `enabled` — present but only surfaced once the user searches for it,
|
|
6
|
+
* - `disabled` — removed from menus entirely.
|
|
7
|
+
*
|
|
8
|
+
* The setting lives in the user preferences blob (see {@link
|
|
9
|
+
* providers/PreferencesProvider}); menus read it through {@link
|
|
10
|
+
* readFeatureVisibility}, which works outside React too (the block editor mounts
|
|
11
|
+
* its own root), mirroring how favourites/recents read localStorage directly.
|
|
12
|
+
*/
|
|
13
|
+
import type { TKey } from '@/i18n';
|
|
14
|
+
export type FeatureVisibility = 'recommended' | 'enabled' | 'disabled';
|
|
15
|
+
/** An AI entry point the user can dial up or down. `id` matches the command /
|
|
16
|
+
* slash-item id so each surface gates the right item. */
|
|
17
|
+
export interface AiFeatureDef {
|
|
18
|
+
id: string;
|
|
19
|
+
/** i18n key for the label shown in Settings → AI → Features. */
|
|
20
|
+
labelKey: TKey;
|
|
21
|
+
}
|
|
22
|
+
export declare const AI_FEATURES: AiFeatureDef[];
|
|
23
|
+
export declare const isAiFeature: (id: string) => boolean;
|
|
24
|
+
export declare const DEFAULT_FEATURE_VISIBILITY: FeatureVisibility;
|
|
25
|
+
/** A feature's visibility, read straight from persisted preferences (defaults
|
|
26
|
+
* to `recommended`). Safe to call outside React and during SSR. */
|
|
27
|
+
export declare function readFeatureVisibility(id: string): FeatureVisibility;
|
|
28
|
+
/** Whether an item with this visibility shows, given whether the user is
|
|
29
|
+
* searching: recommended → always; enabled → only while searching; disabled →
|
|
30
|
+
* never. */
|
|
31
|
+
export declare function featureShown(vis: FeatureVisibility, searching: boolean): boolean;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A tiny bridge between the Settings nav rail and the AI settings panel. The
|
|
3
|
+
* nav's per-provider sub-items call {@link focusAiProvider}; the AI panel (which
|
|
4
|
+
* owns the provider accordions) registers a handler that expands the matching
|
|
5
|
+
* accordion and scrolls it into view. Mirrors the kitPanel / reviewPane bridges
|
|
6
|
+
* — it lets two sibling components coordinate without threading state through the
|
|
7
|
+
* settings shell.
|
|
8
|
+
*
|
|
9
|
+
* If the AI panel isn't mounted yet (the sub-item was clicked from another tab),
|
|
10
|
+
* the request is held and replayed when the panel registers.
|
|
11
|
+
*/
|
|
12
|
+
export type AiProviderFocus = (provider: string) => void;
|
|
13
|
+
export declare function focusAiProvider(provider: string): void;
|
|
14
|
+
export declare function registerAiProviderFocus(fn: AiProviderFocus | null): void;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure helpers for the restore flow: validate a backup file, list the top-level
|
|
3
|
+
* pages to offer as restore targets, and expand a selection of those into the
|
|
4
|
+
* full set of pages + databases to send to the server (so a selected page always
|
|
5
|
+
* brings its subtree, its hosted database, and that database's rows).
|
|
6
|
+
*/
|
|
7
|
+
import { type SpaceBackup, type StoredDatabase, type StoredPage } from '@book.dev/sdk';
|
|
8
|
+
export declare function parseBackup(text: string): SpaceBackup;
|
|
9
|
+
/**
|
|
10
|
+
* The pages to show in the restore checklist: top-level documents — not database
|
|
11
|
+
* rows, and not nested under another page that's also in the bundle.
|
|
12
|
+
*/
|
|
13
|
+
export declare function bundleRoots(bundle: SpaceBackup): StoredPage[];
|
|
14
|
+
/**
|
|
15
|
+
* Expand selected root ids into the closure to import: each selected page plus
|
|
16
|
+
* its descendants, the databases those pages host, and those databases' rows.
|
|
17
|
+
*/
|
|
18
|
+
export declare function closure(bundle: SpaceBackup, rootIds: Iterable<string>): {
|
|
19
|
+
pages: StoredPage[];
|
|
20
|
+
databases: StoredDatabase[];
|
|
21
|
+
};
|
|
22
|
+
/** How many of the closure's pages already exist in the current space (by id). */
|
|
23
|
+
export declare function overwriteCount(pages: StoredPage[], existingIds: Set<string>): number;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { BookFolderFile } from '@book.dev/sdk';
|
|
2
|
+
/**
|
|
3
|
+
* Export `files` to a folder the user picks (Chromium) or, failing that, a
|
|
4
|
+
* downloaded `.zip` named from `suggestedName`. Resolves a summary, or `null` if
|
|
5
|
+
* the user cancelled the directory picker.
|
|
6
|
+
*/
|
|
7
|
+
export declare function exportBookFolderInBrowser(files: BookFolderFile[], suggestedName: string): Promise<{
|
|
8
|
+
location: string;
|
|
9
|
+
count: number;
|
|
10
|
+
} | null>;
|
|
11
|
+
/**
|
|
12
|
+
* Import a book folder: read a user-picked directory (Chromium) or unzip a
|
|
13
|
+
* user-picked `.zip` (fallback). Resolves the files, or `null` if cancelled.
|
|
14
|
+
*/
|
|
15
|
+
export declare function importBookFolderInBrowser(): Promise<BookFolderFile[] | null>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Trigger a client-side file download for a Blob via a temporary `<a download>`.
|
|
3
|
+
* Works in the browser; on the desktop (WKWebView/Tauri) a programmatic download
|
|
4
|
+
* may need the Tauri fs/dialog plugin — verify on the real app.
|
|
5
|
+
*/
|
|
6
|
+
export declare function downloadBlob(filename: string, blob: Blob): void;
|
|
7
|
+
/** Download a UTF-8 text file (markdown, html, json) with the given MIME type. */
|
|
8
|
+
export declare function downloadText(filename: string, text: string, mime?: string): void;
|
|
9
|
+
/** A filesystem-safe slug for a page title, for export filenames. */
|
|
10
|
+
export declare function safeFilename(name: string | null | undefined, fallback?: string): string;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** Turn off autocorrect/autocapitalize/spellcheck on a verbatim field. */
|
|
2
|
+
export declare function disableAutocorrect(el: Element): void;
|
|
3
|
+
/**
|
|
4
|
+
* If the block/slash popover is open with nothing focused, nudge EditorJS's
|
|
5
|
+
* Flipper (which listens for ArrowDown on `document`) to focus the first
|
|
6
|
+
* selectable item, so the user can press Enter to insert it. No-op otherwise.
|
|
7
|
+
*/
|
|
8
|
+
export declare function preselectFirstPopoverItem(holder: HTMLElement): void;
|
|
9
|
+
/**
|
|
10
|
+
* Install the enhancements on a holder. Runs once, then on every relevant DOM
|
|
11
|
+
* mutation (new blocks, popover open/filter) and whenever the page list changes
|
|
12
|
+
* (mention titles). Returns a disposer.
|
|
13
|
+
*/
|
|
14
|
+
export declare function installEditorChrome(holder: HTMLElement): () => void;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface EmojiMatch {
|
|
2
|
+
emoji: string;
|
|
3
|
+
name: string;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Search emoji by shortcode/name for the inline `:` picker (offline — node-emoji
|
|
7
|
+
* bundles its dataset). Results are ranked so a name that *starts with* the query
|
|
8
|
+
* comes before a mere substring match, then trimmed to `limit`.
|
|
9
|
+
*/
|
|
10
|
+
export declare function searchEmojis(query: string, limit?: number): EmojiMatch[];
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Curated emoji set for the in-house icon picker's *browse* view, grouped into
|
|
3
|
+
* the familiar categories. This is intentionally a sensible subset (the common
|
|
4
|
+
* page-icon emoji), not the full Unicode set — it keeps the picker fast, calm,
|
|
5
|
+
* and zero-dependency. The long tail is reachable through the search box, which
|
|
6
|
+
* queries the full `node-emoji` dataset (see {@link components/EmojiGrid}).
|
|
7
|
+
*
|
|
8
|
+
* All glyphs are native Unicode (no sprites / network), so they render with the
|
|
9
|
+
* platform font in both web and the desktop WKWebView.
|
|
10
|
+
*/
|
|
11
|
+
export interface EmojiCategory {
|
|
12
|
+
/** Stable id (also the i18n key suffix `emoji.cat.<id>`). */
|
|
13
|
+
id: string;
|
|
14
|
+
/** A representative glyph for the category-nav button. */
|
|
15
|
+
icon: string;
|
|
16
|
+
emojis: string[];
|
|
17
|
+
}
|
|
18
|
+
export declare const EMOJI_CATEGORIES: EmojiCategory[];
|
|
19
|
+
/** A flat, de-duplicated list of every curated glyph (used for "recents" seeding
|
|
20
|
+
* and as a fallback browse list). */
|
|
21
|
+
export declare const ALL_CURATED_EMOJIS: string[];
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A tiny singleton bridge to the one app-wide emoji grid picker. Any call site —
|
|
3
|
+
* React component or **vanilla** EditorJS block tool (which has no provider tree,
|
|
4
|
+
* cf. `lib/pageLinks.ts`) — opens the picker anchored at a screen rect and gets a
|
|
5
|
+
* callback when an emoji is chosen. The `<EmojiPickerHost>` mounted at the app
|
|
6
|
+
* shell renders the actual picker over this state.
|
|
7
|
+
*/
|
|
8
|
+
export interface EmojiPickerAnchor {
|
|
9
|
+
left: number;
|
|
10
|
+
top: number;
|
|
11
|
+
width: number;
|
|
12
|
+
height: number;
|
|
13
|
+
}
|
|
14
|
+
interface EmojiPickerState {
|
|
15
|
+
open: boolean;
|
|
16
|
+
anchor: EmojiPickerAnchor | null;
|
|
17
|
+
value: string;
|
|
18
|
+
onPick: ((emoji: string) => void) | null;
|
|
19
|
+
}
|
|
20
|
+
declare class EmojiPickerBridge {
|
|
21
|
+
private state;
|
|
22
|
+
private readonly listeners;
|
|
23
|
+
subscribe: (cb: () => void) => (() => void);
|
|
24
|
+
getState: () => EmojiPickerState;
|
|
25
|
+
private set;
|
|
26
|
+
/** Open the picker anchored at `anchor` (a DOMRect-like), reporting picks to `onPick`. */
|
|
27
|
+
open: (anchor: EmojiPickerAnchor, value: string, onPick: (emoji: string) => void) => void;
|
|
28
|
+
close: () => void;
|
|
29
|
+
}
|
|
30
|
+
export declare const emojiPicker: EmojiPickerBridge;
|
|
31
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** Pure: toggle `id`'s membership, newest pinned first. */
|
|
2
|
+
export declare function toggleFavoriteId(list: string[], id: string): string[];
|
|
3
|
+
/** The current favourites, in pinned order. */
|
|
4
|
+
export declare const readFavorites: () => string[];
|
|
5
|
+
export declare const isFavorite: (id: string) => boolean;
|
|
6
|
+
/** Pin/unpin a page. */
|
|
7
|
+
export declare const toggleFavorite: (id: string) => void;
|
|
8
|
+
/** Drop a page from favourites (e.g. when it's deleted). No-op if absent. */
|
|
9
|
+
export declare const removeFavorite: (id: string) => void;
|
|
10
|
+
/** Subscribe to favourite changes. Returns an unsubscribe fn. */
|
|
11
|
+
export declare const subscribeFavorites: (cb: () => void) => (() => void);
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Home view — a pseudo-page. It lives in the window model, the URL
|
|
3
|
+
* (`?page=home`) and history like any page id, so back/forward, tabs and
|
|
4
|
+
* deep links all work; the document area just renders the Home screen for
|
|
5
|
+
* it instead of fetching a document.
|
|
6
|
+
*/
|
|
7
|
+
export declare const HOME_PAGE_ID = "home";
|
|
8
|
+
/**
|
|
9
|
+
* The dataflow split-pane mode — another pseudo-page: `?split=flow` shows
|
|
10
|
+
* the PRIMARY page's reactive graph instead of a second document.
|
|
11
|
+
*/
|
|
12
|
+
export declare const FLOW_PANE_ID = "flow";
|
|
13
|
+
/**
|
|
14
|
+
* The block-settings split-pane mode — a pseudo-page that hosts the "Expand"
|
|
15
|
+
* view of an interactive block's configuration. Reuses the side pane rather
|
|
16
|
+
* than a separate drawer; the live config fields portal into it (see
|
|
17
|
+
* `blockeditor/kit/kitPanel.ts`). Ephemeral — never persisted to the URL.
|
|
18
|
+
*/
|
|
19
|
+
export declare const CONFIG_PANE_ID = "config";
|
|
20
|
+
/**
|
|
21
|
+
* The page-customisation split-pane mode — a pseudo-page hosting a page's
|
|
22
|
+
* appearance + typeface controls (accent, neutrals, intensities, primary /
|
|
23
|
+
* secondary fonts). Like {@link CONFIG_PANE_ID} it reuses the side pane rather
|
|
24
|
+
* than a popover, and is ephemeral — never persisted to the URL. The page it
|
|
25
|
+
* targets is tracked in `lib/pageCustomise.ts`.
|
|
26
|
+
*/
|
|
27
|
+
export declare const CUSTOMISE_PANE_ID = "customise";
|
|
28
|
+
/**
|
|
29
|
+
* The Review split-pane mode — a pseudo-page hosting the suggestions + comments
|
|
30
|
+
* review surface for a page (open suggestions with before→after diffs, accept /
|
|
31
|
+
* reject, and threaded rich-text comments). Like {@link CONFIG_PANE_ID} it
|
|
32
|
+
* reuses the side pane and is ephemeral — never persisted to the URL. The page
|
|
33
|
+
* it targets is tracked in `lib/reviewPane.ts`.
|
|
34
|
+
*/
|
|
35
|
+
export declare const REVIEW_PANE_ID = "review";
|
|
36
|
+
/**
|
|
37
|
+
* The Assistant split-pane mode — a pseudo-page hosting the workspace agent chat.
|
|
38
|
+
* Like {@link REVIEW_PANE_ID} it reuses the side pane (rather than a separate
|
|
39
|
+
* docked panel) and is ephemeral — never persisted to the URL.
|
|
40
|
+
*/
|
|
41
|
+
export declare const AGENT_PANE_ID = "agent";
|
|
42
|
+
/** Which Home widgets are shown. All on by default; configurable per device. */
|
|
43
|
+
export interface HomeWidgets {
|
|
44
|
+
actions: boolean;
|
|
45
|
+
recents: boolean;
|
|
46
|
+
favorites: boolean;
|
|
47
|
+
edited: boolean;
|
|
48
|
+
}
|
|
49
|
+
export declare const DEFAULT_HOME_WIDGETS: HomeWidgets;
|
|
50
|
+
export declare function readHomeWidgets(): HomeWidgets;
|
|
51
|
+
export declare function writeHomeWidgets(widgets: HomeWidgets): void;
|
|
52
|
+
/** The greeting key for an hour of the day (5–12 morning, 12–18 afternoon). */
|
|
53
|
+
export declare function greetingKey(hour: number): 'morning' | 'afternoon' | 'evening';
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/** The settings sidebar: three sections, each with its sub-screens, in order.
|
|
2
|
+
* Preferences = how the app behaves and looks; Account = who you are
|
|
3
|
+
* (identity first); Workspace = this workspace's server and capabilities. */
|
|
4
|
+
export declare const SETTINGS_SECTIONS: readonly [{
|
|
5
|
+
readonly id: "preferences";
|
|
6
|
+
readonly tabs: readonly ["general", "appearance", "customisation"];
|
|
7
|
+
}, {
|
|
8
|
+
readonly id: "account";
|
|
9
|
+
readonly tabs: readonly ["profile", "signup", "signin", "support"];
|
|
10
|
+
}, {
|
|
11
|
+
readonly id: "workspace";
|
|
12
|
+
readonly tabs: readonly ["connection", "integrations", "extensions", "ai", "admin"];
|
|
13
|
+
}];
|
|
14
|
+
export type SettingsSectionId = (typeof SETTINGS_SECTIONS)[number]['id'];
|
|
15
|
+
/** Settings panels, flattened in display order (derived from the sections). */
|
|
16
|
+
export declare const SETTINGS_TABS: ("appearance" | "ai" | "extensions" | "general" | "profile" | "customisation" | "connection" | "integrations" | "admin" | "signup" | "signin" | "support")[];
|
|
17
|
+
export type SettingsTab = (typeof SETTINGS_SECTIONS)[number]['tabs'][number];
|
|
18
|
+
/** The first sub-screen — the default when nothing (valid) is persisted. */
|
|
19
|
+
export declare const DEFAULT_SETTINGS_TAB: SettingsTab;
|
|
20
|
+
/** How the settings screen is presented. */
|
|
21
|
+
export type SettingsMode = 'modal' | 'fullscreen';
|
|
22
|
+
/** How a page is presented: an immersive full-screen deck, or the presenter
|
|
23
|
+
* console (current + next slide, speaker notes, timer). */
|
|
24
|
+
export type PresentMode = 'fullscreen' | 'presenter';
|
|
25
|
+
export declare const isSettingsTab: (value: unknown) => value is SettingsTab;
|
|
26
|
+
/**
|
|
27
|
+
* Resolve a persisted tab id to a current one: map renamed legacy ids
|
|
28
|
+
* (`server`→`connection`, `backup`→`admin`) and fall back to the default for
|
|
29
|
+
* anything no longer a valid tab, so an old `settings.tab` never dead-ends.
|
|
30
|
+
*/
|
|
31
|
+
export declare const normalizeTab: (value: unknown) => SettingsTab;
|
|
32
|
+
export interface HudProps {
|
|
33
|
+
commandPalette: {
|
|
34
|
+
open: boolean;
|
|
35
|
+
};
|
|
36
|
+
settings: {
|
|
37
|
+
open: boolean;
|
|
38
|
+
/** Whether settings show as a centered modal or fill the viewport. */
|
|
39
|
+
mode: SettingsMode;
|
|
40
|
+
/** The currently selected settings panel. */
|
|
41
|
+
tab: SettingsTab;
|
|
42
|
+
};
|
|
43
|
+
present: {
|
|
44
|
+
open: boolean;
|
|
45
|
+
/** Immersive full-screen deck, or the presenter console. */
|
|
46
|
+
mode: PresentMode;
|
|
47
|
+
/** The page being presented. */
|
|
48
|
+
pageId: string | null;
|
|
49
|
+
};
|
|
50
|
+
sideNav: {
|
|
51
|
+
open: boolean;
|
|
52
|
+
docked: boolean;
|
|
53
|
+
};
|
|
54
|
+
trash: {
|
|
55
|
+
open: boolean;
|
|
56
|
+
};
|
|
57
|
+
templates: {
|
|
58
|
+
open: boolean;
|
|
59
|
+
};
|
|
60
|
+
ai: {
|
|
61
|
+
open: boolean;
|
|
62
|
+
};
|
|
63
|
+
agent: {
|
|
64
|
+
open: boolean;
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
export declare const HudDefault: HudProps;
|
|
68
|
+
export declare const HUD_STORAGE_KEY = "hud";
|
|
69
|
+
export declare const loadHudStorage: () => HudProps;
|
|
70
|
+
export declare const saveHudStorage: (hud: HudProps) => void;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure helpers for page-icon *values* — no React, no `lucide-react` import — so
|
|
3
|
+
* text-only consumers (HTML/Markdown export, mention labels) can reason about an
|
|
4
|
+
* icon string without pulling the icon component registry into their bundle.
|
|
5
|
+
*
|
|
6
|
+
* A page icon is either a native emoji glyph (e.g. `"📄"`) or a curated Lucide
|
|
7
|
+
* icon serialized as `"lucide:<Name>"`. Rendering to pixels lives in
|
|
8
|
+
* {@link components/PageIcon}; resolving to a component lives in
|
|
9
|
+
* {@link lib/lucideIcons}.
|
|
10
|
+
*/
|
|
11
|
+
export declare const LUCIDE_PREFIX = "lucide:";
|
|
12
|
+
/** Whether an icon value refers to a Lucide icon (vs. an emoji glyph). */
|
|
13
|
+
export declare const isLucideIcon: (value: string | null | undefined) => boolean;
|
|
14
|
+
/**
|
|
15
|
+
* A plain-text rendering of an icon value. Emoji glyphs pass through; Lucide
|
|
16
|
+
* icons have no text form, so they collapse to an empty string (callers should
|
|
17
|
+
* treat that as "no icon" rather than printing the `lucide:` ref literally).
|
|
18
|
+
*/
|
|
19
|
+
export declare const pageIconToText: (value: string | null | undefined) => string;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The curated set of Lucide icons offered by the icon picker and rendered for
|
|
3
|
+
* `lucide:<Name>` page icons (see {@link components/PageIcon}).
|
|
4
|
+
*
|
|
5
|
+
* We import a hand-picked subset explicitly rather than the whole `lucide-react`
|
|
6
|
+
* package (~1,500 icons) so the always-loaded bundle stays small and the picker
|
|
7
|
+
* shows a tidy, useful gallery instead of an overwhelming wall. The registry is
|
|
8
|
+
* the single extension point: add names here to grow the set, and later icon
|
|
9
|
+
* *sources* (custom uploads, other libraries) can sit beside it behind the same
|
|
10
|
+
* `lucide:`-style prefix scheme (#5).
|
|
11
|
+
*/
|
|
12
|
+
import { type LucideIcon } from 'lucide-react';
|
|
13
|
+
import { LUCIDE_PREFIX, isLucideIcon } from '@/lib/iconValue';
|
|
14
|
+
export { LUCIDE_PREFIX, isLucideIcon };
|
|
15
|
+
/** Name → component, in a deliberate, roughly-themed display order. Each icon
|
|
16
|
+
* appears exactly once; the key is the value persisted as `lucide:<key>`. */
|
|
17
|
+
export declare const LUCIDE_ICONS: Record<string, LucideIcon>;
|
|
18
|
+
/** The picker's display order. */
|
|
19
|
+
export declare const LUCIDE_ICON_NAMES: string[];
|
|
20
|
+
/** Resolve a `lucide:Name` value (or a bare `Name`) to its component, or null. */
|
|
21
|
+
export declare function lucideIconFor(value: string): LucideIcon | null;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type * as Y from 'yjs';
|
|
2
|
+
export declare function registerOpenDoc(pageId: string, doc: Y.Doc): () => void;
|
|
3
|
+
export declare const openDoc: (pageId: string | null | undefined) => Y.Doc | undefined;
|
|
4
|
+
/** Fires when a doc is registered/removed (not on edits — subscribe to the doc). */
|
|
5
|
+
export declare const subscribeOpenDocs: (cb: () => void) => (() => void);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cross-cutting page actions that several surfaces (context menus, the command
|
|
3
|
+
* palette, the sidebar) trigger, but which act on UI that lives elsewhere in the
|
|
4
|
+
* tree — so they go through the window/clipboard rather than React props.
|
|
5
|
+
*/
|
|
6
|
+
/** Build a shareable deep link to a page (`?page=<id>`), no split. */
|
|
7
|
+
export declare function pageLinkUrl(pageId: string): string;
|
|
8
|
+
/** Copy arbitrary text to the clipboard. Resolves to whether it worked. */
|
|
9
|
+
export declare function copyText(text: string): Promise<boolean>;
|
|
10
|
+
/** Copy a page's deep link to the clipboard. Resolves to whether it worked. */
|
|
11
|
+
export declare function copyPageLink(pageId: string): Promise<boolean>;
|
|
12
|
+
/** Ask the editor showing `pageId` to focus its title field for renaming. */
|
|
13
|
+
export declare function requestRenamePage(pageId: string): void;
|
|
14
|
+
/** If a rename is pending for `pageId`, claim it (clears the flag). */
|
|
15
|
+
export declare function consumePendingRename(pageId: string): boolean;
|
|
16
|
+
/** Subscribe to rename requests. Returns an unsubscribe fn. */
|
|
17
|
+
export declare function onRenamePageRequest(cb: (pageId: string) => void): () => void;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export type AppearanceFacet = 'theme' | 'cover' | 'fonts' | 'fullWidth';
|
|
2
|
+
export declare const subscribePageAppearance: (cb: () => void) => (() => void);
|
|
3
|
+
export interface AppearanceBackend {
|
|
4
|
+
/** Persist one facet to the page document (`null` clears it). */
|
|
5
|
+
persist: (pageId: string, propertyKey: string, value: unknown) => void;
|
|
6
|
+
/** Fetch a page's stored properties and hydrate the cache. */
|
|
7
|
+
load: (pageId: string) => void;
|
|
8
|
+
}
|
|
9
|
+
export declare function setAppearanceBackend(b: AppearanceBackend | null): void;
|
|
10
|
+
/**
|
|
11
|
+
* Replace a page's cached appearance from its stored `properties`. Idempotent
|
|
12
|
+
* and reference-stable: a facet whose JSON is unchanged keeps its old object so
|
|
13
|
+
* `useSyncExternalStore` doesn't loop. Lifts any legacy localStorage value into
|
|
14
|
+
* the document the first time a page is seen without stored appearance.
|
|
15
|
+
*/
|
|
16
|
+
export declare function hydratePageAppearance(pageId: string, properties: Record<string, unknown> | null | undefined): void;
|
|
17
|
+
export declare function readAppearanceFacet<T>(pageId: string, facet: AppearanceFacet): T | null;
|
|
18
|
+
export declare function writeAppearanceFacet(pageId: string, facet: AppearanceFacet, value: unknown): void;
|
|
19
|
+
/** React-subscribe to one page's facet; re-renders when it changes. */
|
|
20
|
+
export declare function useAppearanceFacet<T>(pageId: string, facet: AppearanceFacet): T | null;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export type PageCover = {
|
|
2
|
+
kind: 'gradient';
|
|
3
|
+
css: string;
|
|
4
|
+
} | {
|
|
5
|
+
kind: 'image';
|
|
6
|
+
url: string;
|
|
7
|
+
position?: number;
|
|
8
|
+
};
|
|
9
|
+
/** Curated gradient covers — tasteful in both light and dark, no image needed. */
|
|
10
|
+
export declare const COVER_GRADIENTS: ReadonlyArray<{
|
|
11
|
+
id: string;
|
|
12
|
+
css: string;
|
|
13
|
+
}>;
|
|
14
|
+
/** Subscribe to cover changes (any page). Returns an unsubscribe fn. */
|
|
15
|
+
export declare const subscribePageCover: (cb: () => void) => (() => void);
|
|
16
|
+
/** The cover stored for a page, or `null` when none is set. */
|
|
17
|
+
export declare function readPageCover(pageId: string): PageCover | null;
|
|
18
|
+
/** Persist (or, with `null`, clear) a page's cover. */
|
|
19
|
+
export declare function writePageCover(pageId: string, cover: PageCover | null): void;
|
|
20
|
+
/** React-subscribe to one page's cover; re-renders when it changes. */
|
|
21
|
+
export declare function usePageCover(pageId: string): PageCover | null;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** Subscribe to target changes. Returns an unsubscribe fn. */
|
|
2
|
+
export declare const subscribePageCustomise: (cb: () => void) => (() => void);
|
|
3
|
+
/** The page currently being customised in the side pane, or `null`. */
|
|
4
|
+
export declare const getPageCustomiseTarget: () => string | null;
|
|
5
|
+
/** Point the customisation side pane at a page (does not open the pane itself). */
|
|
6
|
+
export declare function setPageCustomiseTarget(pageId: string | null): void;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bridge between the open page documents and the shell: a document registers
|
|
3
|
+
* its export/delete capabilities here (keyed by page id), and the nav-bar
|
|
4
|
+
* page menu renders whatever the *current* page can do. A module singleton,
|
|
5
|
+
* like the plugin command registry — the shell and the documents never hold
|
|
6
|
+
* references to each other.
|
|
7
|
+
*/
|
|
8
|
+
export type ExportKind = 'md' | 'pdf-paged' | 'pdf-continuous' | 'pdf-slides' | 'html' | 'html-slides' | 'plugin';
|
|
9
|
+
export interface PageDocActions {
|
|
10
|
+
/** Which export formats this document offers (order = menu order). */
|
|
11
|
+
exportKinds: ExportKind[];
|
|
12
|
+
runExport: (kind: ExportKind) => void | Promise<void>;
|
|
13
|
+
/** Move the page to the trash (confirms per user preference). */
|
|
14
|
+
deletePage?: () => void | Promise<void>;
|
|
15
|
+
}
|
|
16
|
+
export declare function registerPageDocActions(pageId: string, actions: PageDocActions): () => void;
|
|
17
|
+
export declare const pageDocActions: (pageId: string | null | undefined) => PageDocActions | undefined;
|
|
18
|
+
export declare const subscribePageDocActions: (cb: () => void) => (() => void);
|
|
19
|
+
/** Monotonic change counter — pair with useSyncExternalStore. */
|
|
20
|
+
export declare const pageDocActionsVersion: () => number;
|