@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,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The workspace switcher. `variant` controls the trigger only:
|
|
3
|
+
* - `sidebar` (default) — the full-width, two-line button at the top of the
|
|
4
|
+
* sidebar (web);
|
|
5
|
+
* - `titlebar` — a compact icon + name button for the desktop titlebar.
|
|
6
|
+
* The dropdown contents (workspace list + "add a workspace") are identical.
|
|
7
|
+
*/
|
|
8
|
+
export default function WorkspaceSelectMenu({ variant }: {
|
|
9
|
+
variant?: 'sidebar' | 'titlebar';
|
|
10
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -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,33 @@
|
|
|
1
|
+
import { type ComponentType, type ReactNode } from 'react';
|
|
2
|
+
import { type Level } from '@/lib/themes';
|
|
3
|
+
/** A compact segmented button row — the shared shape for every appearance knob. */
|
|
4
|
+
export declare function Segmented<T extends string | number>({ options, value, onChange, className, }: {
|
|
5
|
+
options: Array<{
|
|
6
|
+
value: T;
|
|
7
|
+
label: string;
|
|
8
|
+
icon?: ComponentType<{
|
|
9
|
+
className?: string;
|
|
10
|
+
}>;
|
|
11
|
+
}>;
|
|
12
|
+
value: T;
|
|
13
|
+
onChange: (value: T) => void;
|
|
14
|
+
className?: string;
|
|
15
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
/** A labelled section wrapper used throughout the appearance UI. */
|
|
17
|
+
export declare function Field({ label, hint, children }: {
|
|
18
|
+
label: string;
|
|
19
|
+
hint?: string;
|
|
20
|
+
children: ReactNode;
|
|
21
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
/** The accent-palette picker: swatches grouped by bold / pastel / neutral. */
|
|
23
|
+
export declare function AccentPicker({ value, onChange, scheme, }: {
|
|
24
|
+
value: string;
|
|
25
|
+
onChange: (id: string) => void;
|
|
26
|
+
scheme: 'light' | 'dark';
|
|
27
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
/** A 0–3 level picker (interface intensity / control intensity). */
|
|
29
|
+
export declare function LevelPicker({ value, onChange, labels, }: {
|
|
30
|
+
value: Level;
|
|
31
|
+
onChange: (v: Level) => void;
|
|
32
|
+
labels: [string, string, string, string];
|
|
33
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type CSSProperties } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Compose this page's effective appearance (the app's appearance with the
|
|
4
|
+
* page's override merged on top) into a scoped CSS-variable `style`, or
|
|
5
|
+
* `undefined` when the page just follows the app. Spread onto the page wrapper
|
|
6
|
+
* so the override recolors the page content while the app chrome stays global.
|
|
7
|
+
*/
|
|
8
|
+
export declare function usePageThemeStyle(pageId: string): CSSProperties | undefined;
|
|
9
|
+
/** Whether a page sets its own canvas background tint (drives `.ob-page-bg`). */
|
|
10
|
+
export declare function usePageHasBackground(pageId: string): boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Per-page customisation. A whole-page theme preset (#4) sets control colour,
|
|
13
|
+
* font, background, and cover at once; the individual pickers (#5) then tweak
|
|
14
|
+
* each aspect. Writes page-scoped overrides (theme via {@link writePageTheme},
|
|
15
|
+
* fonts via {@link writePageFonts}, cover via {@link writePageCover}); the app
|
|
16
|
+
* chrome is out of scope — a page override only restyles that page.
|
|
17
|
+
*/
|
|
18
|
+
export declare function PageAppearanceControls({ pageId }: {
|
|
19
|
+
pageId: string;
|
|
20
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
/**
|
|
22
|
+
* The page-customisation side pane body (the {@link CUSTOMISE_PANE_ID} pane).
|
|
23
|
+
* Reads the page being customised from the `pageCustomise` bridge and renders
|
|
24
|
+
* its appearance + typeface controls — the same side-pane mechanism the block
|
|
25
|
+
* settings use, rather than a cramped popover.
|
|
26
|
+
*/
|
|
27
|
+
export declare function PageCustomiseBody(): import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
/** Whether a page carries any per-page customisation (theme knob or font). */
|
|
29
|
+
export declare const hasPageCustomisation: (pageId: string) => boolean;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type CSSProperties } from 'react';
|
|
2
|
+
export interface OpenBookLogoProps {
|
|
3
|
+
/** Rendered width & height (the mark is square-ish, 220×214 viewBox). */
|
|
4
|
+
size?: number | string;
|
|
5
|
+
className?: string;
|
|
6
|
+
style?: CSSProperties;
|
|
7
|
+
/** Accessible label; pass `null`/'' to mark decorative. */
|
|
8
|
+
title?: string | null;
|
|
9
|
+
}
|
|
10
|
+
export declare function OpenBookLogo({ size, className, style, title }: OpenBookLogoProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export default OpenBookLogo;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { OpenBookLogo, type OpenBookLogoProps } from './OpenBookLogo';
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* The extensible **database card** — a compact preview of an entity used for
|
|
4
|
+
* hover and popovers. It's deliberately generic: an optional cover, an icon +
|
|
5
|
+
* title, and a list of `fields` (label + node). {@link useRowCard} builds one
|
|
6
|
+
* from a database row, but any caller can assemble its own `fields` to reuse the
|
|
7
|
+
* card for mentions, search results, or other entities.
|
|
8
|
+
*/
|
|
9
|
+
export interface CardField {
|
|
10
|
+
id: string;
|
|
11
|
+
label: string;
|
|
12
|
+
node: React.ReactNode;
|
|
13
|
+
}
|
|
14
|
+
export interface DatabaseCardData {
|
|
15
|
+
title: string;
|
|
16
|
+
icon?: string;
|
|
17
|
+
/** A CSS background for the cover band (gradient or image), or none. */
|
|
18
|
+
cover?: React.CSSProperties;
|
|
19
|
+
fields: CardField[];
|
|
20
|
+
}
|
|
21
|
+
export declare const DatabaseCard: React.FC<{
|
|
22
|
+
data: DatabaseCardData;
|
|
23
|
+
onOpen?: () => void;
|
|
24
|
+
}>;
|
|
25
|
+
/** Build (and cache) a {@link DatabaseCardData} for a database row, fetched on demand. */
|
|
26
|
+
export declare function useRowCard(rowId: string, active: boolean): DatabaseCardData | null;
|
|
27
|
+
/**
|
|
28
|
+
* Wrap a trigger so hovering it (after a short delay) reveals the row's
|
|
29
|
+
* {@link DatabaseCard} in a popover. Built on {@link Popover} with hover
|
|
30
|
+
* handlers (no focus stealing); clicking the card title opens the row.
|
|
31
|
+
*/
|
|
32
|
+
export declare const RowHoverCard: React.FC<{
|
|
33
|
+
rowId: string;
|
|
34
|
+
children: React.ReactNode;
|
|
35
|
+
openDelay?: number;
|
|
36
|
+
}>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* The inline prompt a fresh database block shows until it has a database: create
|
|
4
|
+
* a new one, or link an existing database (chosen via {@link DatabasePicker}).
|
|
5
|
+
* Rendered via a portal inside the document providers, so it reads the live page
|
|
6
|
+
* list and triggers the block's create/link actions.
|
|
7
|
+
*/
|
|
8
|
+
export declare const InlineDatabaseChooser: React.FC<{
|
|
9
|
+
onCreate: () => void;
|
|
10
|
+
onPick: (pageId: string) => void;
|
|
11
|
+
}>;
|
|
12
|
+
export default InlineDatabaseChooser;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* The database-row half of the page-view properties panel. When a page is a
|
|
4
|
+
* database row, its columns appear here as editable fields — organised into
|
|
5
|
+
* collapsible **property groups**, with per-property and per-group show/hide.
|
|
6
|
+
* Reuses {@link useDatabase} (keyed on the row's database) so edits round-trip
|
|
7
|
+
* through the same path as the table and stay live with it.
|
|
8
|
+
*/
|
|
9
|
+
export declare const DatabaseRowProperties: React.FC<{
|
|
10
|
+
pageId: string;
|
|
11
|
+
databaseId: string;
|
|
12
|
+
}>;
|
|
13
|
+
export default DatabaseRowProperties;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/** Focus a (possibly not-yet-rendered) row's title input, retrying briefly. */
|
|
3
|
+
export declare function focusRowTitle(rowId: string, attempt?: number): void;
|
|
4
|
+
export declare const DatabaseView: React.FC<{
|
|
5
|
+
pageId: string;
|
|
6
|
+
databaseIdHint?: string | null;
|
|
7
|
+
inline?: boolean;
|
|
8
|
+
}>;
|
|
9
|
+
export default DatabaseView;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type DatabaseProperty, type DatabaseRow, type DatabaseSelectOption } from '@book.dev/sdk';
|
|
3
|
+
/**
|
|
4
|
+
* The raw value to feed a property cell: the stored value for editable types,
|
|
5
|
+
* and the *derived* value for the read-only ones — `expr` (a reactive export),
|
|
6
|
+
* `formula` (computed from sibling properties; needs the full property list),
|
|
7
|
+
* and the `created_time`/`last_edited_time` timestamps (from the row page).
|
|
8
|
+
*/
|
|
9
|
+
export declare function cellValue(row: DatabaseRow, property: DatabaseProperty, properties?: DatabaseProperty[], rows?: DatabaseRow[]): unknown;
|
|
10
|
+
/** The current user's display name, used to stamp owner/verification. */
|
|
11
|
+
export declare function useIdentity(): string;
|
|
12
|
+
/** A person value rendered as an avatar chip. */
|
|
13
|
+
export declare const PersonChip: React.FC<{
|
|
14
|
+
name: string;
|
|
15
|
+
}>;
|
|
16
|
+
/** A verification badge (verified / not). */
|
|
17
|
+
export declare const VerificationBadge: React.FC<{
|
|
18
|
+
value: unknown;
|
|
19
|
+
}>;
|
|
20
|
+
/** A colored select-option chip. */
|
|
21
|
+
export declare const SelectChip: React.FC<{
|
|
22
|
+
option: DatabaseSelectOption;
|
|
23
|
+
}>;
|
|
24
|
+
export declare function formatCellValue(property: DatabaseProperty, value: unknown): string;
|
|
25
|
+
/** Render a computed rollup value (a list for "show original", else a number). */
|
|
26
|
+
export declare function formatRollupValue(property: DatabaseProperty, value: unknown): string;
|
|
27
|
+
/** Render a computed formula value, surfacing errors and honouring number format. */
|
|
28
|
+
export declare function formatFormulaValue(value: unknown, format?: DatabaseProperty['numberFormat']): string;
|
|
29
|
+
/** Compact, human-readable rendering of an arbitrary exported expression value. */
|
|
30
|
+
export declare function formatExprValue(value: unknown, format?: DatabaseProperty['numberFormat']): string;
|
|
31
|
+
/** Serialise rows to CSV — a header of "Name" + column names, then a row each.
|
|
32
|
+
* Values are flattened and RFC-4180-escaped. Pure (shared by the export action). */
|
|
33
|
+
export declare function rowsToCsv(rows: DatabaseRow[], columns: DatabaseProperty[], properties: DatabaseProperty[]): string;
|
|
34
|
+
/** Parse CSV text into a grid of cells (RFC-4180: quotes, escaped quotes,
|
|
35
|
+
* embedded commas/newlines). Pure — shared by the import action and tests. */
|
|
36
|
+
export declare function parseCsv(text: string): string[][];
|
|
37
|
+
export interface PropertyValueCellProps {
|
|
38
|
+
property: DatabaseProperty;
|
|
39
|
+
value: unknown;
|
|
40
|
+
/** Live exported value (expr columns are read-only and use this). */
|
|
41
|
+
exprValue?: unknown;
|
|
42
|
+
onChange: (value: unknown) => void;
|
|
43
|
+
/** Create a new select option (returns it), used by the select editor. */
|
|
44
|
+
onAddOption?: (label: string) => Promise<DatabaseSelectOption | null>;
|
|
45
|
+
/** Candidate rows for a `dependency` cell (the database's own rows, sans self). */
|
|
46
|
+
rowOptions?: {
|
|
47
|
+
id: string;
|
|
48
|
+
label: string;
|
|
49
|
+
icon?: string;
|
|
50
|
+
}[];
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* An inline, type-aware editor for one row's value of one property. Manual
|
|
54
|
+
* types edit in place; `expr` columns are read-only and show the live exported
|
|
55
|
+
* value projected from the row page's reactive store.
|
|
56
|
+
*/
|
|
57
|
+
export declare const PropertyValueCell: React.FC<PropertyValueCellProps>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type DatabaseProperty, type DatabaseView as DbView } from '@book.dev/sdk';
|
|
3
|
+
import type { UseDatabase } from './useDatabase';
|
|
4
|
+
/**
|
|
5
|
+
* A horizontal bar chart: one bar per group of the view's `groupByPropertyId`,
|
|
6
|
+
* sized by its aggregate (count by default, else sum/avg/min/max of a numeric
|
|
7
|
+
* property). A `breakdownPropertyId` splits each bar into stacked segments. Bars
|
|
8
|
+
* are interactive — hover for a readout, click to drill into the underlying rows.
|
|
9
|
+
* Dependency-free — just flexbox bars — so it renders identically in the web app
|
|
10
|
+
* and the desktop WKWebView.
|
|
11
|
+
*/
|
|
12
|
+
export declare const BarChartView: React.FC<{
|
|
13
|
+
db: UseDatabase;
|
|
14
|
+
view: DbView;
|
|
15
|
+
properties: DatabaseProperty[];
|
|
16
|
+
}>;
|
|
17
|
+
/**
|
|
18
|
+
* A pie chart drawn with a CSS `conic-gradient` plus an interactive legend. Each
|
|
19
|
+
* slice is a group of the view's `groupByPropertyId`. With a `breakdownPropertyId`
|
|
20
|
+
* it becomes a two-ring sunburst: the inner disc is the primary groups, the outer
|
|
21
|
+
* ring their breakdown segments, and the legend nests each group's segments. Every
|
|
22
|
+
* legend row hovers for a readout and clicks to drill into its rows.
|
|
23
|
+
*/
|
|
24
|
+
export declare const PieChartView: React.FC<{
|
|
25
|
+
db: UseDatabase;
|
|
26
|
+
view: DbView;
|
|
27
|
+
properties: DatabaseProperty[];
|
|
28
|
+
}>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ChartDatum } from '@book.dev/sdk';
|
|
2
|
+
/**
|
|
3
|
+
* Concrete colors for charts/boards. The `select` swatch tokens
|
|
4
|
+
* ({@link SELECT_COLORS}) render as Tailwind classes elsewhere (see
|
|
5
|
+
* `COLOR_CLASSES` in `databaseCells`), but charts need raw color values for
|
|
6
|
+
* inline `conic-gradient` / SVG fills, so this maps each token to a hex color.
|
|
7
|
+
*/
|
|
8
|
+
export declare const SWATCH_HEX: Record<string, string>;
|
|
9
|
+
/** Fallback palette for groups that carry no swatch token (cycled by index). */
|
|
10
|
+
export declare const CHART_PALETTE: string[];
|
|
11
|
+
/** Resolve a chart slice/bar color: the group's swatch if any, else the palette. */
|
|
12
|
+
export declare const chartColor: (datum: Pick<ChartDatum, "color">, index: number) => string;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type DatabaseProperty, type DatabaseView as DbView } from '@book.dev/sdk';
|
|
3
|
+
import type { UseDatabase } from './useDatabase';
|
|
4
|
+
/**
|
|
5
|
+
* Dependency graph view: rows as nodes in a left-to-right DAG, laid out by the
|
|
6
|
+
* pure {@link dependencyGraph} layering (every node sits to the right of all its
|
|
7
|
+
* predecessors). Edges are arrows predecessor → dependent; clicking a node opens
|
|
8
|
+
* the row. Best paired with a `dependency` property (the view's
|
|
9
|
+
* `dependencyPropertyId`).
|
|
10
|
+
*/
|
|
11
|
+
export declare const GraphView: React.FC<{
|
|
12
|
+
db: UseDatabase;
|
|
13
|
+
view: DbView;
|
|
14
|
+
properties: DatabaseProperty[];
|
|
15
|
+
}>;
|
|
16
|
+
export default GraphView;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type DatabaseProperty, type DatabaseRow, type DatabaseView as DbView, type RowGroup } from '@book.dev/sdk';
|
|
3
|
+
import type { UseDatabase } from './useDatabase';
|
|
4
|
+
/** The emoji to render beside a group's label, or `null` (non-page groups). */
|
|
5
|
+
export declare const groupGlyph: (group: RowGroup, prop: DatabaseProperty | undefined, groupByParent: boolean) => string | null;
|
|
6
|
+
/** A group's display label — the linked page's title for relation groups (whose
|
|
7
|
+
* SDK label is the raw page id), otherwise the group's own label (parent-item
|
|
8
|
+
* groups already carry the row name). */
|
|
9
|
+
export declare const groupHeading: (group: RowGroup, prop: DatabaseProperty | undefined) => string;
|
|
10
|
+
/**
|
|
11
|
+
* Whether a group reads as collapsed. Empty groups fold by default (the view's
|
|
12
|
+
* `collapseEmptyGroups`, on unless set false); the `collapsed` Set stores
|
|
13
|
+
* *deviations* from that default, so a user can still fold a populated group or
|
|
14
|
+
* unfold an empty one with the same toggle.
|
|
15
|
+
*/
|
|
16
|
+
export declare const groupCollapsed: (group: RowGroup, collapsed: Set<string>, collapseEmpty: boolean) => boolean;
|
|
17
|
+
/** The collapsed-Set membership that makes every group display as `collapse`
|
|
18
|
+
* (used by the board/table "Collapse all" / "Expand all" toggles). */
|
|
19
|
+
export declare const setAllGroupsCollapsed: (groups: RowGroup[], collapse: boolean, collapseEmpty: boolean) => Set<string>;
|
|
20
|
+
/**
|
|
21
|
+
* Register the titles + icons of relation group properties' target rows so the
|
|
22
|
+
* group headers resolve to page titles/icons (mirrors the relation cell). A no-op
|
|
23
|
+
* unless a passed property is a relation with a target database; safe to pass the
|
|
24
|
+
* primary and sub-group properties together.
|
|
25
|
+
*/
|
|
26
|
+
export declare function useRelationGroupTitles(...props: Array<DatabaseProperty | undefined>): void;
|
|
27
|
+
/**
|
|
28
|
+
* Compact, read-only chips summarising a row's property values. Shared by the
|
|
29
|
+
* list, gallery, and board layouts so a row reads the same wherever it appears.
|
|
30
|
+
*/
|
|
31
|
+
export declare const RowChips: React.FC<{
|
|
32
|
+
row: DatabaseRow;
|
|
33
|
+
properties: DatabaseProperty[];
|
|
34
|
+
rows?: DatabaseRow[];
|
|
35
|
+
labelled?: boolean;
|
|
36
|
+
}>;
|
|
37
|
+
/** The card-edge tint for a row from a `select`/`status` colour property, or undefined. */
|
|
38
|
+
export declare function cardAccent(row: DatabaseRow, colorProperty: DatabaseProperty | undefined): string | undefined;
|
|
39
|
+
/**
|
|
40
|
+
* The row/card edge tint for a row under a view's conditional formatting: the
|
|
41
|
+
* first matching {@link ColorRule}'s colour, else the `cardColorPropertyId`
|
|
42
|
+
* select-option colour. The single source of row colouring across every layout.
|
|
43
|
+
*/
|
|
44
|
+
export declare function rowColor(row: DatabaseRow, view: DbView, properties: DatabaseProperty[], rows?: DatabaseRow[]): string | undefined;
|
|
45
|
+
/**
|
|
46
|
+
* Right-click any card (board / gallery) for the same quick row actions as the
|
|
47
|
+
* table — open, insert below, duplicate, delete — without opening the row first.
|
|
48
|
+
*/
|
|
49
|
+
export declare const RowContextMenu: React.FC<{
|
|
50
|
+
db: UseDatabase;
|
|
51
|
+
rowId: string;
|
|
52
|
+
children: React.ReactNode;
|
|
53
|
+
}>;
|
|
54
|
+
/** Gallery: a responsive grid of cards, one per row, with optional cover images.
|
|
55
|
+
* When the view names a `groupByPropertyId`, cards split into titled sections. */
|
|
56
|
+
export declare const GalleryView: React.FC<{
|
|
57
|
+
db: UseDatabase;
|
|
58
|
+
view: DbView;
|
|
59
|
+
properties: DatabaseProperty[];
|
|
60
|
+
}>;
|
|
61
|
+
/**
|
|
62
|
+
* Board (kanban): columns from the view's group-by property. Cards drag between
|
|
63
|
+
* columns to change their group value (when grouping on a `select`). A per-column
|
|
64
|
+
* "+ New" creates a row already set to that column. When the view also names a
|
|
65
|
+
* `subGroupByPropertyId`, the board splits into horizontal **swimlanes** (one per
|
|
66
|
+
* sub-group value, spanning all columns — the Notion model); dropping a card into
|
|
67
|
+
* a (column, lane) cell sets both the column and the lane property in one
|
|
68
|
+
* transaction. Lanes are collapsible and their collapsed state persists.
|
|
69
|
+
*/
|
|
70
|
+
export declare const BoardView: React.FC<{
|
|
71
|
+
db: UseDatabase;
|
|
72
|
+
view: DbView;
|
|
73
|
+
properties: DatabaseProperty[];
|
|
74
|
+
/** The view's visible property set, shown as card chips (defaults to all). */
|
|
75
|
+
cardProperties?: DatabaseProperty[];
|
|
76
|
+
}>;
|
|
77
|
+
/** Calendar: rows laid out on a month grid by a date property. */
|
|
78
|
+
export declare const CalendarView: React.FC<{
|
|
79
|
+
db: UseDatabase;
|
|
80
|
+
view: DbView;
|
|
81
|
+
properties: DatabaseProperty[];
|
|
82
|
+
/** Properties to show as chips under each tile's title (the date drives placement). */
|
|
83
|
+
cardProperties?: DatabaseProperty[];
|
|
84
|
+
}>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type DatabaseProperty, type DatabaseView as DbView } from '@book.dev/sdk';
|
|
3
|
+
import type { UseDatabase } from './useDatabase';
|
|
4
|
+
/**
|
|
5
|
+
* Map view: rows with resolvable coordinates rendered as markers on Leaflet +
|
|
6
|
+
* OpenStreetMap raster tiles. Markers are coloured by the view's
|
|
7
|
+
* `groupByPropertyId` (shared with every other layout via {@link groupRowsBy} +
|
|
8
|
+
* {@link SWATCH_HEX}), with a legend below the map and clustering at low zoom for
|
|
9
|
+
* dense data. Clicking a marker opens the row (the same affordance other views
|
|
10
|
+
* use). Rows without coordinates collect into an "unplaced" affordance — which,
|
|
11
|
+
* when an address property is configured, can geocode them on demand (opt-in,
|
|
12
|
+
* cached — see `geocode.ts`) rather than silently dropping them.
|
|
13
|
+
*/
|
|
14
|
+
export declare const MapView: React.FC<{
|
|
15
|
+
db: UseDatabase;
|
|
16
|
+
view: DbView;
|
|
17
|
+
properties: DatabaseProperty[];
|
|
18
|
+
/** The view's visible property set, shown as chips in the unplaced list. */
|
|
19
|
+
cardProperties?: DatabaseProperty[];
|
|
20
|
+
}>;
|
|
21
|
+
export default MapView;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import 'leaflet.markercluster';
|
|
3
|
+
import 'leaflet/dist/leaflet.css';
|
|
4
|
+
import 'leaflet.markercluster/dist/MarkerCluster.css';
|
|
5
|
+
import type { DatabaseRow } from '@book.dev/sdk';
|
|
6
|
+
/** A row resolved to a placed marker, pre-coloured by its group. */
|
|
7
|
+
export interface PlacedMarker {
|
|
8
|
+
row: DatabaseRow;
|
|
9
|
+
lat: number;
|
|
10
|
+
lng: number;
|
|
11
|
+
/** The hex colour from the group-by swatch (or a neutral default). */
|
|
12
|
+
color: string;
|
|
13
|
+
/** Marker tooltip / aria label. */
|
|
14
|
+
label: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* The Leaflet map itself: OpenStreetMap raster tiles + the marker layer. Lazily
|
|
18
|
+
* loaded by {@link MapView} so Leaflet's bundle + CSS only arrive with a real map
|
|
19
|
+
* view and never during SSR.
|
|
20
|
+
*/
|
|
21
|
+
declare const LeafletMap: React.FC<{
|
|
22
|
+
markers: PlacedMarker[];
|
|
23
|
+
clustered: boolean;
|
|
24
|
+
onOpen: (rowId: string) => void;
|
|
25
|
+
}>;
|
|
26
|
+
export default LeafletMap;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type DatabaseProperty, type DatabaseView, type DatabaseViewType, type StoredDatabase, type SummaryType } from '@book.dev/sdk';
|
|
3
|
+
import type { NewPropertyInput, UseDatabase } from './useDatabase';
|
|
4
|
+
/** Per-view-type display metadata (icon + label), shared by the toolbar + menus. */
|
|
5
|
+
export declare const VIEW_TYPES: {
|
|
6
|
+
value: DatabaseViewType;
|
|
7
|
+
label: string;
|
|
8
|
+
Icon: React.ComponentType<{
|
|
9
|
+
className?: string;
|
|
10
|
+
}>;
|
|
11
|
+
}[];
|
|
12
|
+
export declare const viewIcon: (type: DatabaseViewType) => React.ComponentType<{
|
|
13
|
+
className?: string;
|
|
14
|
+
}>;
|
|
15
|
+
export declare const AddPropertyMenu: React.FC<{
|
|
16
|
+
onAdd: (input: NewPropertyInput) => void;
|
|
17
|
+
}>;
|
|
18
|
+
/**
|
|
19
|
+
* Per-column header editor: rename, change type, edit select options / formula /
|
|
20
|
+
* number format, reorder, and delete the property. Opens from the `⋯` in a
|
|
21
|
+
* column header.
|
|
22
|
+
*/
|
|
23
|
+
export declare const PropertyMenu: React.FC<{
|
|
24
|
+
property: DatabaseProperty;
|
|
25
|
+
db: UseDatabase;
|
|
26
|
+
index: number;
|
|
27
|
+
count: number;
|
|
28
|
+
}>;
|
|
29
|
+
interface MenuProps {
|
|
30
|
+
database: StoredDatabase;
|
|
31
|
+
view: DatabaseView;
|
|
32
|
+
onChange: (patch: Partial<DatabaseView>) => void;
|
|
33
|
+
}
|
|
34
|
+
/** Filter editor: a nested and/or tree of conditions applied to the current view. */
|
|
35
|
+
export declare const FilterMenu: React.FC<MenuProps>;
|
|
36
|
+
/** Sort editor: ordered sort keys applied to the current view. */
|
|
37
|
+
export declare const SortMenu: React.FC<MenuProps>;
|
|
38
|
+
/**
|
|
39
|
+
* A table column-footer summary control: shows the computed value (`display`)
|
|
40
|
+
* and, on click, a menu to choose the calculation (count/sum/avg/…). Shows a
|
|
41
|
+
* subtle "Calculate" affordance on hover when no summary is set.
|
|
42
|
+
*/
|
|
43
|
+
export declare const SummaryPicker: React.FC<{
|
|
44
|
+
current: SummaryType;
|
|
45
|
+
display: string;
|
|
46
|
+
onChange: (t: SummaryType) => void;
|
|
47
|
+
}>;
|
|
48
|
+
/** Conditional-formatting editor: rules that tint each row/card edge. */
|
|
49
|
+
export declare const ColorRulesEditor: React.FC<{
|
|
50
|
+
db: UseDatabase;
|
|
51
|
+
view: DatabaseView;
|
|
52
|
+
}>;
|
|
53
|
+
/**
|
|
54
|
+
* Dashboard metric cards above a database view: each is an aggregate (count, sum,
|
|
55
|
+
* average, …) over the view's *filtered* rows, so they update live as filters and
|
|
56
|
+
* data change. Rendered only when the view defines metrics; a trailing "+" adds
|
|
57
|
+
* another (defaulting to a row count — a sensible first metric).
|
|
58
|
+
*/
|
|
59
|
+
export declare const MetricsBar: React.FC<{
|
|
60
|
+
db: UseDatabase;
|
|
61
|
+
view: DatabaseView;
|
|
62
|
+
}>;
|
|
63
|
+
/** Add the first metric card to a view (a row count) — the dashboard entry point. */
|
|
64
|
+
export declare function addFirstMetric(db: UseDatabase, view: DatabaseView): void;
|
|
65
|
+
/**
|
|
66
|
+
* Active-filter chips: each top-level condition of the view's filter as a small
|
|
67
|
+
* removable pill, so the filters added from the toolbar or a cell's right-click
|
|
68
|
+
* menu are visible at a glance and one click to drop. Nested filter groups stay
|
|
69
|
+
* managed in the Filter menu (a single "advanced" pill stands in for them).
|
|
70
|
+
*/
|
|
71
|
+
export declare const FilterChips: React.FC<{
|
|
72
|
+
db: UseDatabase;
|
|
73
|
+
view: DatabaseView;
|
|
74
|
+
}>;
|
|
75
|
+
/**
|
|
76
|
+
* Active-sort chips: each sort key as a removable pill — click the label to flip
|
|
77
|
+
* its direction, the × to drop it. Mirrors {@link FilterChips} so the otherwise
|
|
78
|
+
* hidden sort state is visible and editable at a glance.
|
|
79
|
+
*/
|
|
80
|
+
export declare const SortChips: React.FC<{
|
|
81
|
+
db: UseDatabase;
|
|
82
|
+
view: DatabaseView;
|
|
83
|
+
}>;
|
|
84
|
+
/** The `+` next to the view tabs: add a new view of a chosen layout. */
|
|
85
|
+
export declare const AddViewMenu: React.FC<{
|
|
86
|
+
onAdd: (type: DatabaseViewType) => void;
|
|
87
|
+
}>;
|
|
88
|
+
/**
|
|
89
|
+
* The active view's settings: rename, switch layout, configure layout-specific
|
|
90
|
+
* options (board/chart grouping, chart aggregation, calendar date, visible
|
|
91
|
+
* columns), duplicate, and delete.
|
|
92
|
+
*/
|
|
93
|
+
export declare const ViewOptionsMenu: React.FC<{
|
|
94
|
+
db: UseDatabase;
|
|
95
|
+
view: DatabaseView;
|
|
96
|
+
}>;
|
|
97
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type DatabaseProperty, type DatabaseView as DbView } from '@book.dev/sdk';
|
|
3
|
+
import type { UseDatabase } from './useDatabase';
|
|
4
|
+
/** The timeline's zoom level. Drives the day width and the header granularity. */
|
|
5
|
+
export type TimelineScale = 'day' | 'week' | 'month' | 'quarter' | 'year';
|
|
6
|
+
/**
|
|
7
|
+
* Timeline (Gantt) view: each dated row is a bar on a horizontal day axis, sized
|
|
8
|
+
* by its date span (a `dateRange` property, or a start + end property). Bars are
|
|
9
|
+
* drag-to-reschedule (drag the body to move, an edge to resize) and drag-to-link
|
|
10
|
+
* (the finish-edge handle onto another bar adds a dependency). The axis is
|
|
11
|
+
* zoomable (daily…yearly), today is marked and centred, and the canvas scrolls
|
|
12
|
+
* indefinitely either way. Clicking empty canvas places an item — a new row at
|
|
13
|
+
* that date, or the row armed from the "Unscheduled" tray.
|
|
14
|
+
*
|
|
15
|
+
* `TimelineView` resolves the date configuration and early-returns a hint when it
|
|
16
|
+
* can't lay anything out; the hook-bearing work lives in `TimelineCanvas`, which
|
|
17
|
+
* is only mounted once a start-date property exists (so its hooks run
|
|
18
|
+
* unconditionally).
|
|
19
|
+
*/
|
|
20
|
+
export declare const TimelineView: React.FC<{
|
|
21
|
+
db: UseDatabase;
|
|
22
|
+
view: DbView;
|
|
23
|
+
properties: DatabaseProperty[];
|
|
24
|
+
/** Properties to show as chips under each rail label (the dates drive placement). */
|
|
25
|
+
cardProperties?: DatabaseProperty[];
|
|
26
|
+
}>;
|
|
27
|
+
export default TimelineView;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { LocationValue } from '@book.dev/sdk';
|
|
2
|
+
/** A cached miss is recorded as `null` so we don't retry hopeless addresses. */
|
|
3
|
+
type CacheEntry = {
|
|
4
|
+
lat: number;
|
|
5
|
+
lng: number;
|
|
6
|
+
} | null;
|
|
7
|
+
/** A cached coordinate for an address without touching the network, or `undefined`
|
|
8
|
+
* when the address has never been looked up. A cached miss reads as `null`. */
|
|
9
|
+
export declare function cachedGeocode(address: string): CacheEntry | undefined;
|
|
10
|
+
/**
|
|
11
|
+
* Geocode one address to coordinates, consulting the cache first. Returns null
|
|
12
|
+
* for an unresolvable address (also cached, to avoid retry storms). Only called
|
|
13
|
+
* behind an explicit user action — never during a passive render.
|
|
14
|
+
*/
|
|
15
|
+
export declare function geocodeAddress(address: string): Promise<{
|
|
16
|
+
lat: number;
|
|
17
|
+
lng: number;
|
|
18
|
+
} | null>;
|
|
19
|
+
/** Build the {@link LocationValue} for a geocoded address (keeps the source string). */
|
|
20
|
+
export declare function locationFromGeocode(address: string, coords: {
|
|
21
|
+
lat: number;
|
|
22
|
+
lng: number;
|
|
23
|
+
}): LocationValue;
|
|
24
|
+
export {};
|