@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.
Files changed (305) hide show
  1. package/LICENSE +21 -0
  2. package/dist/EmojiGrid-xK5mPJPo.js +205 -0
  3. package/dist/blockeditor/BlockEditor.d.ts +68 -0
  4. package/dist/blockeditor/CodeBlockView.d.ts +19 -0
  5. package/dist/blockeditor/InlineToolbar.d.ts +18 -0
  6. package/dist/blockeditor/LinkPicker.d.ts +16 -0
  7. package/dist/blockeditor/MentionMenu.d.ts +14 -0
  8. package/dist/blockeditor/PresentBlocks.d.ts +21 -0
  9. package/dist/blockeditor/RichTextEditor.d.ts +29 -0
  10. package/dist/blockeditor/SlashMenu.d.ts +49 -0
  11. package/dist/blockeditor/TextBlockView.d.ts +9 -0
  12. package/dist/blockeditor/__tests__/LinkPicker.test.d.ts +1 -0
  13. package/dist/blockeditor/__tests__/SlashMenu.test.d.ts +1 -0
  14. package/dist/blockeditor/__tests__/aiApply.test.d.ts +1 -0
  15. package/dist/blockeditor/__tests__/groupLock.test.d.ts +1 -0
  16. package/dist/blockeditor/__tests__/highlight.test.d.ts +1 -0
  17. package/dist/blockeditor/__tests__/mergeUp.test.d.ts +1 -0
  18. package/dist/blockeditor/__tests__/present.test.d.ts +1 -0
  19. package/dist/blockeditor/aiBlocks.d.ts +9 -0
  20. package/dist/blockeditor/colors.d.ts +23 -0
  21. package/dist/blockeditor/exportBlocks.d.ts +25 -0
  22. package/dist/blockeditor/highlight.d.ts +25 -0
  23. package/dist/blockeditor/index.d.ts +8 -0
  24. package/dist/blockeditor/kit/KitFrame.d.ts +95 -0
  25. package/dist/blockeditor/kit/KitSettings.d.ts +18 -0
  26. package/dist/blockeditor/kit/OptionsEditor.d.ts +8 -0
  27. package/dist/blockeditor/kit/__tests__/chartMath.test.d.ts +1 -0
  28. package/dist/blockeditor/kit/__tests__/dataflow.test.d.ts +1 -0
  29. package/dist/blockeditor/kit/__tests__/exportKit.test.d.ts +1 -0
  30. package/dist/blockeditor/kit/__tests__/exportKit2.test.d.ts +1 -0
  31. package/dist/blockeditor/kit/__tests__/groupSync.test.d.ts +1 -0
  32. package/dist/blockeditor/kit/__tests__/inputs2Render.test.d.ts +1 -0
  33. package/dist/blockeditor/kit/__tests__/inputs2Scope.test.d.ts +1 -0
  34. package/dist/blockeditor/kit/__tests__/inputsRender.test.d.ts +1 -0
  35. package/dist/blockeditor/kit/__tests__/kitConfig.test.d.ts +1 -0
  36. package/dist/blockeditor/kit/__tests__/kitPanel.test.d.ts +1 -0
  37. package/dist/blockeditor/kit/__tests__/options.test.d.ts +1 -0
  38. package/dist/blockeditor/kit/__tests__/scope.test.d.ts +1 -0
  39. package/dist/blockeditor/kit/cards.d.ts +51 -0
  40. package/dist/blockeditor/kit/chartMath.d.ts +62 -0
  41. package/dist/blockeditor/kit/charts.d.ts +27 -0
  42. package/dist/blockeditor/kit/completion.d.ts +45 -0
  43. package/dist/blockeditor/kit/dataflow.d.ts +68 -0
  44. package/dist/blockeditor/kit/groupSync.d.ts +23 -0
  45. package/dist/blockeditor/kit/index.d.ts +11 -0
  46. package/dist/blockeditor/kit/inputs.d.ts +135 -0
  47. package/dist/blockeditor/kit/inputs2.d.ts +86 -0
  48. package/dist/blockeditor/kit/kitConfig.d.ts +5 -0
  49. package/dist/blockeditor/kit/kitPanel.d.ts +31 -0
  50. package/dist/blockeditor/kit/lock.d.ts +12 -0
  51. package/dist/blockeditor/kit/options.d.ts +60 -0
  52. package/dist/blockeditor/kit/progress.d.ts +20 -0
  53. package/dist/blockeditor/kit/scope.d.ts +100 -0
  54. package/dist/blockeditor/model.d.ts +236 -0
  55. package/dist/blockeditor/present.d.ts +18 -0
  56. package/dist/blockeditor/provider.d.ts +16 -0
  57. package/dist/blockeditor/reactiveBlocks.d.ts +2 -0
  58. package/dist/blockeditor/registry.d.ts +38 -0
  59. package/dist/blockeditor/richtext.d.ts +48 -0
  60. package/dist/blockeditor/useBlockEditor.d.ts +45 -0
  61. package/dist/components/AboutDialog.d.ts +9 -0
  62. package/dist/components/AgentPanel.d.ts +2 -0
  63. package/dist/components/AiBridgeHost.d.ts +14 -0
  64. package/dist/components/AiSearchDialog.d.ts +8 -0
  65. package/dist/components/AiSettings.d.ts +7 -0
  66. package/dist/components/AppearanceSettings.d.ts +3 -0
  67. package/dist/components/BackForwardCluster.d.ts +1 -0
  68. package/dist/components/BackupSettings.d.ts +2 -0
  69. package/dist/components/BreadcrumbCluster.d.ts +1 -0
  70. package/dist/components/ColorSchemeMenu.d.ts +1 -0
  71. package/dist/components/CommandMenu.d.ts +1 -0
  72. package/dist/components/CommandToggle.d.ts +3 -0
  73. package/dist/components/DocumentArea.d.ts +8 -0
  74. package/dist/components/Drawer.d.ts +7 -0
  75. package/dist/components/EmojiGrid.d.ts +16 -0
  76. package/dist/components/EmojiPickerHost.d.ts +8 -0
  77. package/dist/components/ExtensionsSettings.d.ts +7 -0
  78. package/dist/components/FavoritesNav.d.ts +8 -0
  79. package/dist/components/GeneralSettings.d.ts +2 -0
  80. package/dist/components/GlobalShortcuts.d.ts +9 -0
  81. package/dist/components/HomeButton.d.ts +2 -0
  82. package/dist/components/IconPicker.d.ts +17 -0
  83. package/dist/components/NavBar.d.ts +1 -0
  84. package/dist/components/NavContextMenu.d.ts +7 -0
  85. package/dist/components/PageActionsCluster.d.ts +9 -0
  86. package/dist/components/PageAppearanceHost.d.ts +9 -0
  87. package/dist/components/PageContextMenu.d.ts +17 -0
  88. package/dist/components/PageCover.d.ts +18 -0
  89. package/dist/components/PageHeaderControls.d.ts +13 -0
  90. package/dist/components/PageIcon.d.ts +16 -0
  91. package/dist/components/PageProperties.d.ts +53 -0
  92. package/dist/components/PluginBoot.d.ts +2 -0
  93. package/dist/components/PresentMode.d.ts +7 -0
  94. package/dist/components/ProfileAvatar.d.ts +17 -0
  95. package/dist/components/ProfileMenu.d.ts +6 -0
  96. package/dist/components/Settings.d.ts +7 -0
  97. package/dist/components/SettingsButton.d.ts +2 -0
  98. package/dist/components/SettingsPanel.d.ts +14 -0
  99. package/dist/components/SideNav.d.ts +1 -0
  100. package/dist/components/SideNavToggle.d.ts +3 -0
  101. package/dist/components/SidebarSections.d.ts +17 -0
  102. package/dist/components/SplitPane.d.ts +9 -0
  103. package/dist/components/TemplateGallery.d.ts +8 -0
  104. package/dist/components/TitlebarTabs.d.ts +10 -0
  105. package/dist/components/TrashDialog.d.ts +7 -0
  106. package/dist/components/WindowActionsCluster.d.ts +6 -0
  107. package/dist/components/WindowControls.d.ts +6 -0
  108. package/dist/components/WindowTitle.d.ts +7 -0
  109. package/dist/components/WorkspaceInfo.d.ts +6 -0
  110. package/dist/components/WorkspaceNavigationTree.d.ts +14 -0
  111. package/dist/components/WorkspaceSelectMenu.d.ts +10 -0
  112. package/dist/components/__tests__/AppearanceSettings.test.d.ts +1 -0
  113. package/dist/components/__tests__/PageIcon.test.d.ts +1 -0
  114. package/dist/components/__tests__/SettingsPanel.test.d.ts +1 -0
  115. package/dist/components/__tests__/buildTree.test.d.ts +1 -0
  116. package/dist/components/__tests__/profileAvatar.test.d.ts +1 -0
  117. package/dist/components/appearance/AppearanceControls.d.ts +33 -0
  118. package/dist/components/appearance/PageCustomiseBody.d.ts +29 -0
  119. package/dist/components/brand/OpenBookLogo.d.ts +11 -0
  120. package/dist/components/brand/index.d.ts +1 -0
  121. package/dist/components/database/DatabaseCard.d.ts +36 -0
  122. package/dist/components/database/DatabasePicker.d.ts +12 -0
  123. package/dist/components/database/DatabaseRowProperties.d.ts +13 -0
  124. package/dist/components/database/DatabaseView.d.ts +9 -0
  125. package/dist/components/database/InlineDatabaseBlock.d.ts +3 -0
  126. package/dist/components/database/__tests__/InlineDatabaseBlock.test.d.ts +1 -0
  127. package/dist/components/database/databaseCells.d.ts +57 -0
  128. package/dist/components/database/databaseCharts.d.ts +28 -0
  129. package/dist/components/database/databaseColors.d.ts +12 -0
  130. package/dist/components/database/databaseGraph.d.ts +16 -0
  131. package/dist/components/database/databaseLayouts.d.ts +84 -0
  132. package/dist/components/database/databaseMap.d.ts +21 -0
  133. package/dist/components/database/databaseMapLeaflet.d.ts +26 -0
  134. package/dist/components/database/databaseMenus.d.ts +97 -0
  135. package/dist/components/database/databaseTimeline.d.ts +27 -0
  136. package/dist/components/database/geocode.d.ts +24 -0
  137. package/dist/components/database/useDatabase.d.ts +129 -0
  138. package/dist/components/index.d.ts +12 -0
  139. package/dist/components/review/BlockReviewMarkers.d.ts +19 -0
  140. package/dist/components/review/CommentThread.d.ts +20 -0
  141. package/dist/components/review/ReviewPaneBody.d.ts +12 -0
  142. package/dist/components/review/SuggestHost.d.ts +13 -0
  143. package/dist/components/review/SuggestionCard.d.ts +21 -0
  144. package/dist/components/review/__tests__/review.test.d.ts +1 -0
  145. package/dist/components/review/useReview.d.ts +27 -0
  146. package/dist/components/settings/AccountSettings.d.ts +6 -0
  147. package/dist/components/settings/AdminSettings.d.ts +2 -0
  148. package/dist/components/settings/ConnectionSettings.d.ts +7 -0
  149. package/dist/components/settings/CustomisationSettings.d.ts +2 -0
  150. package/dist/components/settings/ProfileSettings.d.ts +2 -0
  151. package/dist/components/settings/primitives.d.ts +47 -0
  152. package/dist/components/settings/stubs.d.ts +8 -0
  153. package/dist/components/ui/__tests__/kbd.test.d.ts +1 -0
  154. package/dist/components/ui/__tests__/markdown.test.d.ts +1 -0
  155. package/dist/components/ui/__tests__/select.test.d.ts +1 -0
  156. package/dist/components/ui/badge.d.ts +9 -0
  157. package/dist/components/ui/button.d.ts +11 -0
  158. package/dist/components/ui/command.d.ts +86 -0
  159. package/dist/components/ui/context-menu.d.ts +24 -0
  160. package/dist/components/ui/dialog.d.ts +18 -0
  161. package/dist/components/ui/dropdown-menu.d.ts +27 -0
  162. package/dist/components/ui/icon-button.d.ts +16 -0
  163. package/dist/components/ui/input.d.ts +9 -0
  164. package/dist/components/ui/kbd.d.ts +31 -0
  165. package/dist/components/ui/label.d.ts +5 -0
  166. package/dist/components/ui/markdown.d.ts +19 -0
  167. package/dist/components/ui/navigation-menu.d.ts +12 -0
  168. package/dist/components/ui/popover.d.ts +6 -0
  169. package/dist/components/ui/scroll-area.d.ts +5 -0
  170. package/dist/components/ui/select.d.ts +42 -0
  171. package/dist/components/ui/skeleton.d.ts +6 -0
  172. package/dist/components/ui/switch.d.ts +4 -0
  173. package/dist/components/ui/tooltip.d.ts +7 -0
  174. package/dist/components/ui/tree.d.ts +37 -0
  175. package/dist/components/useAppCommands.d.ts +25 -0
  176. package/dist/data/DataProvider.d.ts +30 -0
  177. package/dist/data/index.d.ts +1 -0
  178. package/dist/databaseMapLeaflet-8LYcHcR6.js +87 -0
  179. package/dist/export/__tests__/chartNormalize.test.d.ts +1 -0
  180. package/dist/export/__tests__/export.test.d.ts +1 -0
  181. package/dist/export/__tests__/exportReactive.test.d.ts +1 -0
  182. package/dist/export/chartNormalize.d.ts +22 -0
  183. package/dist/export/chartSvg.d.ts +2 -0
  184. package/dist/export/documentModel.d.ts +136 -0
  185. package/dist/export/exportSite.d.ts +40 -0
  186. package/dist/export/format.d.ts +2 -0
  187. package/dist/export/kitChart.d.ts +21 -0
  188. package/dist/export/toHtml.d.ts +25 -0
  189. package/dist/export/toMarkdown.d.ts +7 -0
  190. package/dist/export/toPdf.d.ts +14 -0
  191. package/dist/exportBlocks-33D7P_8Q.js +987 -0
  192. package/dist/exportSite-DlRm4u7W.js +50 -0
  193. package/dist/format-CLQoRoYP.js +1646 -0
  194. package/dist/i18n/__tests__/i18n.test.d.ts +1 -0
  195. package/dist/i18n/index.d.ts +24 -0
  196. package/dist/i18n/messages/de.d.ts +2 -0
  197. package/dist/i18n/messages/en.d.ts +977 -0
  198. package/dist/i18n/messages/ja.d.ts +2 -0
  199. package/dist/i18n/messages/zh.d.ts +2 -0
  200. package/dist/index.d.ts +11 -0
  201. package/dist/index.js +20915 -0
  202. package/dist/layouts/DefaultLayout.d.ts +4 -0
  203. package/dist/layouts/index.d.ts +1 -0
  204. package/dist/lib/__tests__/accountClient.test.d.ts +1 -0
  205. package/dist/lib/__tests__/backlinks.test.d.ts +1 -0
  206. package/dist/lib/__tests__/backupBundle.test.d.ts +1 -0
  207. package/dist/lib/__tests__/blockExport.test.d.ts +1 -0
  208. package/dist/lib/__tests__/blockModel.test.d.ts +1 -0
  209. package/dist/lib/__tests__/databaseFormula.test.d.ts +1 -0
  210. package/dist/lib/__tests__/databaseTypes.test.d.ts +1 -0
  211. package/dist/lib/__tests__/favorites.test.d.ts +1 -0
  212. package/dist/lib/__tests__/homePage.test.d.ts +1 -0
  213. package/dist/lib/__tests__/hud.test.d.ts +1 -0
  214. package/dist/lib/__tests__/icons.test.d.ts +1 -0
  215. package/dist/lib/__tests__/mixedContent.test.d.ts +1 -0
  216. package/dist/lib/__tests__/pageAppearance.test.d.ts +1 -0
  217. package/dist/lib/__tests__/pageIcon.test.d.ts +1 -0
  218. package/dist/lib/__tests__/pageLayout.test.d.ts +1 -0
  219. package/dist/lib/__tests__/pageSaveStatus.test.d.ts +1 -0
  220. package/dist/lib/__tests__/pageTheme.test.d.ts +1 -0
  221. package/dist/lib/__tests__/parentGrouping.test.d.ts +1 -0
  222. package/dist/lib/__tests__/pluginSdk.test.d.ts +1 -0
  223. package/dist/lib/__tests__/recents.test.d.ts +1 -0
  224. package/dist/lib/__tests__/relations.test.d.ts +1 -0
  225. package/dist/lib/__tests__/templates.test.d.ts +1 -0
  226. package/dist/lib/__tests__/textMerge.test.d.ts +1 -0
  227. package/dist/lib/__tests__/themes.test.d.ts +1 -0
  228. package/dist/lib/__tests__/treeMove.test.d.ts +1 -0
  229. package/dist/lib/aiBridge.d.ts +67 -0
  230. package/dist/lib/aiFeatures.d.ts +31 -0
  231. package/dist/lib/aiSettingsNav.d.ts +14 -0
  232. package/dist/lib/backupBundle.d.ts +23 -0
  233. package/dist/lib/bookFolderTransfer.d.ts +15 -0
  234. package/dist/lib/download.d.ts +10 -0
  235. package/dist/lib/editorChrome.d.ts +14 -0
  236. package/dist/lib/emoji.d.ts +10 -0
  237. package/dist/lib/emojiData.d.ts +21 -0
  238. package/dist/lib/emojiPicker.d.ts +31 -0
  239. package/dist/lib/favorites.d.ts +11 -0
  240. package/dist/lib/homePage.d.ts +53 -0
  241. package/dist/lib/hud.d.ts +70 -0
  242. package/dist/lib/iconRecents.d.ts +3 -0
  243. package/dist/lib/iconValue.d.ts +19 -0
  244. package/dist/lib/lucideIcons.d.ts +21 -0
  245. package/dist/lib/openDocs.d.ts +5 -0
  246. package/dist/lib/pageActions.d.ts +17 -0
  247. package/dist/lib/pageAppearance.d.ts +20 -0
  248. package/dist/lib/pageCover.d.ts +21 -0
  249. package/dist/lib/pageCustomise.d.ts +6 -0
  250. package/dist/lib/pageDocActions.d.ts +20 -0
  251. package/dist/lib/pageFont.d.ts +25 -0
  252. package/dist/lib/pageFullWidth.d.ts +10 -0
  253. package/dist/lib/pageIcon.d.ts +25 -0
  254. package/dist/lib/pageLinks.d.ts +41 -0
  255. package/dist/lib/pageSaveStatus.d.ts +14 -0
  256. package/dist/lib/pageTheme.d.ts +15 -0
  257. package/dist/lib/pageThemePresets.d.ts +23 -0
  258. package/dist/lib/recents.d.ts +9 -0
  259. package/dist/lib/reviewPane.d.ts +23 -0
  260. package/dist/lib/selection.d.ts +2 -0
  261. package/dist/lib/shortcuts.d.ts +79 -0
  262. package/dist/lib/sidebarStyles.d.ts +10 -0
  263. package/dist/lib/suggestBridge.d.ts +33 -0
  264. package/dist/lib/textMerge.d.ts +19 -0
  265. package/dist/lib/themes.d.ts +137 -0
  266. package/dist/lib/treeMove.d.ts +24 -0
  267. package/dist/lib/useModifierHeld.d.ts +1 -0
  268. package/dist/lib/utils.d.ts +2 -0
  269. package/dist/lucideIcons-B6pmC-WQ.js +5003 -0
  270. package/dist/model-CBxw8JNb.js +734 -0
  271. package/dist/pageIcon-BWTy7hAh.js +32 -0
  272. package/dist/plugins/__tests__/host.test.d.ts +1 -0
  273. package/dist/plugins/__tests__/loader.test.d.ts +1 -0
  274. package/dist/plugins/__tests__/pagePlugin.test.d.ts +1 -0
  275. package/dist/plugins/api.d.ts +67 -0
  276. package/dist/plugins/commandRegistry.d.ts +15 -0
  277. package/dist/plugins/host.d.ts +32 -0
  278. package/dist/plugins/index.d.ts +5 -0
  279. package/dist/plugins/loader.d.ts +19 -0
  280. package/dist/plugins/pagePlugin.d.ts +21 -0
  281. package/dist/providers/AccountProvider.d.ts +67 -0
  282. package/dist/providers/ConfirmProvider.d.ts +30 -0
  283. package/dist/providers/ForwardingProvider.d.ts +23 -0
  284. package/dist/providers/HudProvider.d.ts +9 -0
  285. package/dist/providers/I18nProvider.d.ts +23 -0
  286. package/dist/providers/NavigationProvider.d.ts +89 -0
  287. package/dist/providers/PlatformLibraryProvider.d.ts +107 -0
  288. package/dist/providers/PreferencesProvider.d.ts +47 -0
  289. package/dist/providers/ThemeProvider.d.ts +26 -0
  290. package/dist/providers/WorkspaceProvider.d.ts +40 -0
  291. package/dist/providers/__tests__/PreferencesProvider.test.d.ts +1 -0
  292. package/dist/providers/__tests__/extractToken.test.d.ts +1 -0
  293. package/dist/providers/__tests__/windowModel.test.d.ts +1 -0
  294. package/dist/providers/index.d.ts +10 -0
  295. package/dist/providers/windowModel.d.ts +69 -0
  296. package/dist/screens/BlockPageDocument.d.ts +4 -0
  297. package/dist/screens/ConnectedPageDocument.d.ts +14 -0
  298. package/dist/screens/DataflowView.d.ts +2 -0
  299. package/dist/screens/HomeScreen.d.ts +7 -0
  300. package/dist/screens/index.d.ts +3 -0
  301. package/dist/screens/pageChrome.d.ts +46 -0
  302. package/dist/style.css +3 -0
  303. package/dist/toHtml-BoPr8Ce4.js +394 -0
  304. package/dist/toPdf-DGtKQSRA.js +133 -0
  305. package/package.json +94 -0
@@ -0,0 +1,19 @@
1
+ import { type ReactNode } from 'react';
2
+ /**
3
+ * A small, dependency-free Markdown renderer for short assistant replies. It
4
+ * covers the constructs models actually emit in chat — headings, bullet/ordered
5
+ * lists, fenced + inline code, blockquotes, horizontal rules, links, and
6
+ * bold/italic/strikethrough — and renders to React elements (never
7
+ * `dangerouslySetInnerHTML`, so there is no HTML-injection surface). Partial
8
+ * Markdown renders gracefully, so it is safe to feed a streaming, half-written
9
+ * answer and re-render as more arrives.
10
+ *
11
+ * It is intentionally not a complete CommonMark implementation (no nested
12
+ * lists, tables, or reference links); those are rare in chat and not worth the
13
+ * weight. Unmatched syntax falls back to literal text.
14
+ */
15
+ export declare function Markdown({ content, className }: {
16
+ content: string;
17
+ className?: string;
18
+ }): ReactNode;
19
+ export default Markdown;
@@ -0,0 +1,12 @@
1
+ import * as React from "react";
2
+ import * as NavigationMenuPrimitive from "@radix-ui/react-navigation-menu";
3
+ declare const NavigationMenu: React.ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuProps & React.RefAttributes<HTMLElement>, "ref"> & React.RefAttributes<HTMLElement>>;
4
+ declare const NavigationMenuList: React.ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuListProps & React.RefAttributes<HTMLUListElement>, "ref"> & React.RefAttributes<HTMLUListElement>>;
5
+ declare const NavigationMenuItem: React.ForwardRefExoticComponent<NavigationMenuPrimitive.NavigationMenuItemProps & React.RefAttributes<HTMLLIElement>>;
6
+ declare const navigationMenuTriggerStyle: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
7
+ declare const NavigationMenuTrigger: React.ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
8
+ declare const NavigationMenuContent: React.ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
9
+ declare const NavigationMenuLink: React.ForwardRefExoticComponent<NavigationMenuPrimitive.NavigationMenuLinkProps & React.RefAttributes<HTMLAnchorElement>>;
10
+ declare const NavigationMenuViewport: React.ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuViewportProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
11
+ declare const NavigationMenuIndicator: React.ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuIndicatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
12
+ export { navigationMenuTriggerStyle, NavigationMenu, NavigationMenuList, NavigationMenuItem, NavigationMenuContent, NavigationMenuTrigger, NavigationMenuLink, NavigationMenuIndicator, NavigationMenuViewport, };
@@ -0,0 +1,6 @@
1
+ import * as React from "react";
2
+ import * as PopoverPrimitive from "@radix-ui/react-popover";
3
+ declare const Popover: React.FC<PopoverPrimitive.PopoverProps>;
4
+ declare const PopoverTrigger: React.ForwardRefExoticComponent<PopoverPrimitive.PopoverTriggerProps & React.RefAttributes<HTMLButtonElement>>;
5
+ declare const PopoverContent: React.ForwardRefExoticComponent<Omit<PopoverPrimitive.PopoverContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
6
+ export { Popover, PopoverTrigger, PopoverContent };
@@ -0,0 +1,5 @@
1
+ import * as React from "react";
2
+ import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
3
+ declare const ScrollArea: React.ForwardRefExoticComponent<Omit<ScrollAreaPrimitive.ScrollAreaProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
4
+ declare const ScrollBar: React.ForwardRefExoticComponent<Omit<ScrollAreaPrimitive.ScrollAreaScrollbarProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
5
+ export { ScrollArea, ScrollBar };
@@ -0,0 +1,42 @@
1
+ import * as React from "react";
2
+ /**
3
+ * A custom `Select` — a Radix-Popover listbox styled to match {@link Input},
4
+ * replacing the native `<select>` for a consistent, themed experience (the OS
5
+ * dropdown looked foreign and ignored our palette). It deliberately keeps the
6
+ * native API so call sites migrate by renaming the element only: it accepts
7
+ * `<option>` / `<optgroup>` children, a `value`, and an `onChange` that fires
8
+ * with a synthetic `{target: {value}}` event. Keyboard parity with the native
9
+ * control: arrows, Home/End, type-ahead, Enter/Space to pick, Esc to close.
10
+ *
11
+ * Pass `unstyled` when the caller's `className` fully styles the trigger (the
12
+ * dense database menus and the kit inputs do this); otherwise the trigger wears
13
+ * the shared input styling.
14
+ */
15
+ /** The native-compatible change event shape the control emits. */
16
+ export interface SelectChangeEvent {
17
+ target: {
18
+ value: string;
19
+ };
20
+ currentTarget: {
21
+ value: string;
22
+ };
23
+ }
24
+ export interface SelectProps {
25
+ value?: string | number;
26
+ onChange?: (event: SelectChangeEvent) => void;
27
+ children?: React.ReactNode;
28
+ placeholder?: string;
29
+ disabled?: boolean;
30
+ inputSize?: "default" | "sm";
31
+ /** Skip the default input styling — the caller's `className` styles the trigger. */
32
+ unstyled?: boolean;
33
+ className?: string;
34
+ /** Class for the trigger's wrapper (e.g. width); the popup matches its width. */
35
+ wrapperClassName?: string;
36
+ align?: "start" | "center" | "end";
37
+ "aria-label"?: string;
38
+ id?: string;
39
+ name?: string;
40
+ }
41
+ declare const Select: React.ForwardRefExoticComponent<SelectProps & React.RefAttributes<HTMLButtonElement>>;
42
+ export { Select };
@@ -0,0 +1,6 @@
1
+ /** A shimmering placeholder that reserves space while content is (re)computing,
2
+ * so a block can fill in without shifting the surrounding layout. The shimmer
3
+ * (a soft highlight sweep, see `.ob-skeleton` in index.css) reads calmer than
4
+ * an opacity pulse and freezes gracefully under reduced motion. */
5
+ declare function Skeleton({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
6
+ export { Skeleton };
@@ -0,0 +1,4 @@
1
+ import * as React from "react";
2
+ import * as SwitchPrimitives from "@radix-ui/react-switch";
3
+ declare const Switch: React.ForwardRefExoticComponent<Omit<SwitchPrimitives.SwitchProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
4
+ export { Switch };
@@ -0,0 +1,7 @@
1
+ import * as React from "react";
2
+ import * as TooltipPrimitive from "@radix-ui/react-tooltip";
3
+ declare const TooltipProvider: React.FC<TooltipPrimitive.TooltipProviderProps>;
4
+ declare const Tooltip: React.FC<TooltipPrimitive.TooltipProps>;
5
+ declare const TooltipTrigger: React.ForwardRefExoticComponent<TooltipPrimitive.TooltipTriggerProps & React.RefAttributes<HTMLButtonElement>>;
6
+ declare const TooltipContent: React.ForwardRefExoticComponent<Omit<TooltipPrimitive.TooltipContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
7
+ export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Tree component
3
+ * https://github.com/shadcn-ui/ui/issues/355
4
+ *
5
+ * Expansion and selection are fully controlled here (a lifted `expandedIds`
6
+ * set), so navigating to a page never collapses folders the user opened by hand
7
+ * — selecting a page only *adds* its ancestors to the open set. Rows support
8
+ * native HTML5 drag-and-drop (reorder among siblings + nest); the move maths
9
+ * live in `lib/treeMove.ts`.
10
+ */
11
+ import React from "react";
12
+ import { type LucideIcon } from "lucide-react";
13
+ import type { DropWhere } from "@/lib/treeMove";
14
+ interface TreeDataItem {
15
+ id: string;
16
+ name: string;
17
+ icon?: LucideIcon | string;
18
+ children?: TreeDataItem[];
19
+ }
20
+ declare const Tree: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
21
+ data: TreeDataItem[] | TreeDataItem;
22
+ selectedItemId?: string;
23
+ onSelectChange?: (item: TreeDataItem | undefined) => void;
24
+ expandAll?: boolean;
25
+ folderIcon?: LucideIcon;
26
+ itemIcon?: LucideIcon;
27
+ /** Right-click menu for a row (e.g. page actions). Rendered in a ContextMenuContent. */
28
+ renderItemContextMenu?: (item: TreeDataItem) => React.ReactNode;
29
+ /** Trailing controls revealed on row hover/focus (e.g. add / ⋯). `openMenu`
30
+ * opens the row's context menu at the row, so a button can mirror right-click. */
31
+ renderRowActions?: (item: TreeDataItem, helpers: {
32
+ openMenu: () => void;
33
+ }) => React.ReactNode;
34
+ /** Called when a row is dropped on another (drag-to-reorder / drag-to-nest). */
35
+ onMove?: (draggedId: string, targetId: string, where: DropWhere) => void;
36
+ } & React.RefAttributes<HTMLDivElement>>;
37
+ export { Tree, type TreeDataItem };
@@ -0,0 +1,25 @@
1
+ import type { LucideIcon } from 'lucide-react';
2
+ import { type ShortcutCombo } from '@/lib/shortcuts';
3
+ /** A command's bucket in the palette (each renders as a labelled group). */
4
+ export type CommandGroup = 'create' | 'view' | 'navigation' | 'app';
5
+ export interface AppCommand {
6
+ id: string;
7
+ group: CommandGroup;
8
+ /** Localised display label. */
9
+ title: string;
10
+ /** Extra search terms so the palette finds it under synonyms. */
11
+ keywords?: string;
12
+ icon: LucideIcon;
13
+ /** Shown as a hint and bound by the global key handler when present. */
14
+ shortcut?: ShortcutCombo;
15
+ /** Runs the command. Does *not* close the palette — the caller decides. */
16
+ run: () => void;
17
+ /** Greyed out and non-firing (e.g. Back with no history). */
18
+ disabled?: boolean;
19
+ }
20
+ /**
21
+ * The single source of truth for app-level commands. The command palette
22
+ * renders them, the global key handler ({@link useGlobalShortcuts}) fires the
23
+ * ones with a shortcut, and both stay in sync because they read this list.
24
+ */
25
+ export declare function useAppCommands(): AppCommand[];
@@ -0,0 +1,30 @@
1
+ import React, { PropsWithChildren } from 'react';
2
+ import type { DataClient, PageSnapshot } from '@book.dev/sdk';
3
+ /**
4
+ * Provides the active {@link DataClient} to the document UI. The host (desktop
5
+ * app or web shell) decides which client to inject — local Tauri store or a
6
+ * remote HTTP server.
7
+ */
8
+ export declare const DataProvider: React.FC<PropsWithChildren<{
9
+ client: DataClient;
10
+ }>>;
11
+ /** Access the active data client. Throws if used outside a {@link DataProvider}. */
12
+ export declare const useData: () => DataClient;
13
+ /**
14
+ * Wire a page's persistence to the active client, producing the `onLoad`/
15
+ * `onSave` callbacks the document editor expects. Saving stores the snapshot as
16
+ * the page's `data`; loading returns the stored snapshot (or `null`).
17
+ */
18
+ export declare const usePagePersistence: (pageId: string, name?: string | null) => {
19
+ onLoad: () => Promise<PageSnapshot | null>;
20
+ onSave: (snapshot: PageSnapshot) => Promise<void>;
21
+ };
22
+ /**
23
+ * Read (or lazily mint + persist) the id of the page this install is currently
24
+ * editing. Until multi-page navigation lands, this keeps a single document
25
+ * stable across restarts. Returns `null` during SSR / first paint, then the id
26
+ * after mount — render the document only once it is non-null.
27
+ */
28
+ export declare const useCurrentPageId: () => string | null;
29
+ /** Imperative variant of {@link useCurrentPageId}. Browser-only. */
30
+ export declare const getOrCreateCurrentPageId: () => string;
@@ -0,0 +1 @@
1
+ export { DataProvider, useData, usePagePersistence, useCurrentPageId, getOrCreateCurrentPageId, } from './DataProvider';
@@ -0,0 +1,87 @@
1
+ import { useEffect as e, useRef as t } from "react";
2
+ import { jsx as n, jsxs as r } from "react/jsx-runtime";
3
+ import i from "leaflet";
4
+ import { MapContainer as a, TileLayer as o, useMap as s } from "react-leaflet";
5
+ import "leaflet.markercluster";
6
+ import "leaflet/dist/leaflet.css";
7
+ import "leaflet.markercluster/dist/MarkerCluster.css";
8
+ //#region src/components/database/databaseMapLeaflet.tsx
9
+ var c = (e) => i.divIcon({
10
+ className: "ob-map-pin",
11
+ html: `<svg width="22" height="30" viewBox="0 0 22 30" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
12
+ <path d="M11 0C5 0 0 4.6 0 10.4 0 18 11 30 11 30s11-12 11-19.6C22 4.6 17 0 11 0z" fill="${e}" stroke="#ffffff" stroke-width="1.5"/>
13
+ <circle cx="11" cy="10.5" r="3.6" fill="#ffffff"/>
14
+ </svg>`,
15
+ iconSize: [22, 30],
16
+ iconAnchor: [11, 30],
17
+ tooltipAnchor: [0, -28]
18
+ }), l = (e) => {
19
+ let t = e.getChildCount(), n = t < 10 ? 32 : t < 100 ? 38 : 44;
20
+ return i.divIcon({
21
+ html: `<div class="ob-map-cluster" style="width:${n}px;height:${n}px">${t}</div>`,
22
+ className: "ob-map-cluster-wrap",
23
+ iconSize: [n, n]
24
+ });
25
+ }, u = (e) => e.map((e) => `${e.lat.toFixed(5)},${e.lng.toFixed(5)},${e.color}`).sort().join("|"), d = ({ markers: n }) => {
26
+ let r = s(), a = u(n), o = t("");
27
+ return e(() => {
28
+ if (a === o.current || n.length === 0) return;
29
+ if (o.current = a, n.length === 1) {
30
+ r.setView([n[0].lat, n[0].lng], 12);
31
+ return;
32
+ }
33
+ let e = i.latLngBounds(n.map((e) => [e.lat, e.lng]));
34
+ r.fitBounds(e, {
35
+ padding: [40, 40],
36
+ maxZoom: 14
37
+ });
38
+ }, [r, a]), null;
39
+ }, f = ({ markers: n, clustered: r, onOpen: a }) => {
40
+ let o = s(), d = t(a);
41
+ return d.current = a, e(() => {
42
+ let e = r ? i.markerClusterGroup({
43
+ chunkedLoading: !0,
44
+ showCoverageOnHover: !1,
45
+ maxClusterRadius: 56,
46
+ iconCreateFunction: l
47
+ }) : i.layerGroup();
48
+ for (let t of n) {
49
+ let n = i.marker([t.lat, t.lng], {
50
+ icon: c(t.color),
51
+ title: t.label,
52
+ keyboard: !0
53
+ });
54
+ n.bindTooltip(t.label, {
55
+ direction: "top",
56
+ offset: [0, -28]
57
+ }), n.on("click", () => d.current(t.row.id)), e.addLayer(n);
58
+ }
59
+ return o.addLayer(e), () => {
60
+ o.removeLayer(e);
61
+ };
62
+ }, [
63
+ o,
64
+ u(n),
65
+ r
66
+ ]), null;
67
+ }, p = ({ markers: e, clustered: t, onOpen: i }) => /* @__PURE__ */ r(a, {
68
+ center: [20, 0],
69
+ zoom: 2,
70
+ scrollWheelZoom: !0,
71
+ className: "h-full w-full",
72
+ children: [
73
+ /* @__PURE__ */ n(o, {
74
+ attribution: "© <a href=\"https://www.openstreetmap.org/copyright\">OpenStreetMap</a> contributors",
75
+ url: "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",
76
+ maxZoom: 19
77
+ }),
78
+ /* @__PURE__ */ n(f, {
79
+ markers: e,
80
+ clustered: t,
81
+ onOpen: i
82
+ }),
83
+ /* @__PURE__ */ n(d, { markers: e })
84
+ ]
85
+ });
86
+ //#endregion
87
+ export { p as default };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Normalizes a cell value into a list of named numeric series.
3
+ *
4
+ * Accepted shapes:
5
+ * - `number[]` → one series, named after the cell
6
+ * - `{ series: Array<{ name?, data: number[] }> }` → multiple named series from one cell
7
+ *
8
+ * Non-conforming inputs (string, null, malformed objects) return []. Within
9
+ * each series, non-numeric values are filtered out — the chart only plots
10
+ * what's actually plottable. Empty series (zero numeric values) are dropped.
11
+ *
12
+ * The shape is intentionally a union (not a Chart.js-style always-nested
13
+ * object) so the common "one cell, one curve" case is just `[1, 2, 3]`
14
+ * with the cell's display name as the series label, and richer
15
+ * compositions opt into the `{series}` form when they need multiple
16
+ * curves out of one expression.
17
+ */
18
+ export type NormalizedSeries = {
19
+ name: string;
20
+ data: number[];
21
+ };
22
+ export declare function normalizeChartInput(value: unknown, fallbackName: string): NormalizedSeries[];
@@ -0,0 +1,2 @@
1
+ import type { NormalizedSeries } from './chartNormalize';
2
+ export declare function buildChartSvg(series: NormalizedSeries[], width?: number, color?: string): SVGElement | null;
@@ -0,0 +1,136 @@
1
+ /**
2
+ * A normalized, presentation-agnostic model of a page document, built once from
3
+ * a {@link PageSnapshot} and consumed by every exporter (Markdown, PDF, HTML).
4
+ *
5
+ * It parses each EditorJS block into a typed shape: inline HTML → formatting
6
+ * runs (bold/italic/code/marker/link/`@`-mention), lists into nested items, and
7
+ * reactive blocks (slider/expr/chart) resolved against the snapshot's persisted
8
+ * `values`/`names`. Pure and DOM-light (uses `DOMParser`, available in the
9
+ * browser and happy-dom) so it is unit-tested directly.
10
+ */
11
+ import type { PageSnapshot } from '@book.dev/sdk';
12
+ import { type NormalizedSeries } from './chartNormalize';
13
+ export interface InlineRun {
14
+ text: string;
15
+ bold?: boolean;
16
+ italic?: boolean;
17
+ underline?: boolean;
18
+ strike?: boolean;
19
+ code?: boolean;
20
+ marker?: boolean;
21
+ /** Text colour (CSS hex) — from the editor's `tc` palette token. */
22
+ color?: string;
23
+ /** Highlight colour (CSS hex) when a `<mark>` carries one. */
24
+ markerColor?: string;
25
+ link?: string;
26
+ mention?: {
27
+ pageId: string;
28
+ label: string;
29
+ };
30
+ }
31
+ export interface ListItem {
32
+ runs: InlineRun[];
33
+ items: ListItem[];
34
+ }
35
+ export type DocBlock = {
36
+ type: 'paragraph';
37
+ runs: InlineRun[];
38
+ } | {
39
+ type: 'header';
40
+ level: number;
41
+ runs: InlineRun[];
42
+ } | {
43
+ type: 'list';
44
+ ordered: boolean;
45
+ items: ListItem[];
46
+ } | {
47
+ type: 'quote';
48
+ runs: InlineRun[];
49
+ caption: string;
50
+ } | {
51
+ type: 'code';
52
+ code: string;
53
+ } | {
54
+ type: 'delimiter';
55
+ } | {
56
+ type: 'table';
57
+ withHeadings: boolean;
58
+ rows: InlineRun[][][];
59
+ } | {
60
+ type: 'callout';
61
+ variant: string;
62
+ runs: InlineRun[];
63
+ } | {
64
+ type: 'accordion';
65
+ title: InlineRun[];
66
+ content: InlineRun[];
67
+ open: boolean;
68
+ } | {
69
+ type: 'checklist';
70
+ items: {
71
+ runs: InlineRun[];
72
+ checked: boolean;
73
+ }[];
74
+ } | {
75
+ type: 'toc';
76
+ entries: {
77
+ level: number;
78
+ text: string;
79
+ }[];
80
+ } | {
81
+ type: 'button';
82
+ label: string;
83
+ url: string;
84
+ } | {
85
+ type: 'divider';
86
+ style: string;
87
+ label: string;
88
+ } | {
89
+ type: 'slider';
90
+ name: string;
91
+ value: unknown;
92
+ } | {
93
+ type: 'expr';
94
+ name: string;
95
+ value: unknown;
96
+ source: string;
97
+ } | {
98
+ type: 'chart';
99
+ series: NormalizedSeries[];
100
+ kind: string;
101
+ labels: string[];
102
+ title: string;
103
+ value: unknown;
104
+ } | {
105
+ type: 'kvalue';
106
+ label: string;
107
+ value: unknown;
108
+ } | {
109
+ type: 'light';
110
+ label: string;
111
+ status: string;
112
+ value: unknown;
113
+ } | {
114
+ type: 'progress';
115
+ label: string;
116
+ pct: number;
117
+ readout: string;
118
+ } | {
119
+ type: 'unknown';
120
+ raw: string;
121
+ };
122
+ export interface DocModel {
123
+ title: string;
124
+ icon: string;
125
+ blocks: DocBlock[];
126
+ }
127
+ /** Parse a block's inline HTML into formatting runs. */
128
+ export declare function parseInline(html: string): InlineRun[];
129
+ /** Plain text of an inline run list (for titles, captions, etc.). */
130
+ export declare function runsToText(runs: InlineRun[]): string;
131
+ export interface BuildModelOptions {
132
+ title: string;
133
+ icon: string;
134
+ snapshot: PageSnapshot;
135
+ }
136
+ export declare function buildDocumentModel({ title, icon, snapshot: rawSnapshot }: BuildModelOptions): DocModel;
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Gather a page and everything reachable from it into a self-contained bundle for
3
+ * the interactive HTML export: the page, its nested subpages, the databases it
4
+ * hosts (with their rows — which are themselves pages), and every page those link
5
+ * to. A breadth-first crawl from the root, deduped by id and capped, so a single
6
+ * exported file carries a whole navigable mini-site.
7
+ */
8
+ import { type DataClient, type DatabaseRow, type DatabaseSchema, type PageSnapshot } from '@book.dev/sdk';
9
+ /** A database hosted by a page, projected for static rendering. */
10
+ export interface SiteDatabase {
11
+ schema: DatabaseSchema;
12
+ rows: DatabaseRow[];
13
+ }
14
+ /** One page in the exported bundle. */
15
+ export interface SitePage {
16
+ id: string;
17
+ title: string;
18
+ icon: string;
19
+ snapshot: PageSnapshot;
20
+ /** Present when this page hosts a database (its rows are also pages in the bundle). */
21
+ database?: SiteDatabase;
22
+ }
23
+ /** The exported mini-site: the root page plus every page reachable from it. */
24
+ export interface SiteBundle {
25
+ rootId: string;
26
+ pages: SitePage[];
27
+ }
28
+ /** Page ids a snapshot references: subpage/database blocks and inline `@`-mentions. */
29
+ export declare function referencedPageIds(rawSnapshot: PageSnapshot): string[];
30
+ /**
31
+ * Crawl from `rootId` and return every reachable page. The root's live content is
32
+ * supplied via `root` (so unsaved edits export faithfully); every other page is
33
+ * fetched from the store. Hosted databases contribute their schema, rows, and the
34
+ * row pages themselves.
35
+ */
36
+ export declare function gatherSite(client: DataClient, rootId: string, root: {
37
+ snapshot: PageSnapshot;
38
+ title: string;
39
+ icon: string;
40
+ }): Promise<SiteBundle>;
@@ -0,0 +1,2 @@
1
+ /** Shared value formatting for exports (mirrors the editor's result display). */
2
+ export declare function formatValue(v: unknown): string;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Kind-faithful kit-chart drawing (line, area, bar, pie, donut, scatter, funnel)
3
+ * as pure SVG — no charting library. The geometry mirrors the editor's
4
+ * `chartMath`, so an exported chart looks like the one in the window.
5
+ *
6
+ * The drawing lives as a JS **source string** ({@link KIT_CHART_JS}) so it has a
7
+ * single definition used two ways: inlined verbatim into the standalone HTML
8
+ * runtime (where it redraws live as sliders move), and executed here via
9
+ * `new Function` for the static PDF export ({@link kitChartSvg}). Keeping it as
10
+ * one string avoids the two copies drifting apart.
11
+ */
12
+ export declare const KIT_CHART_JS = "\nconst KIT_PALETTE=[\"#6366f1\",\"#f59e0b\",\"#10b981\",\"#ef4444\",\"#8b5cf6\",\"#06b6d4\",\"#f97316\",\"#14b8a6\"];\nfunction kitSeries(v){ if(v&&typeof v===\"object\"&&Array.isArray(v.series)) return v.series.filter(s=>Array.isArray(s.data)&&s.data.every(n=>typeof n===\"number\")&&s.data.length).map(s=>({name:String(s.name??\"\"),values:s.data})); if(Array.isArray(v)&&v.every(n=>typeof n===\"number\")) return v.length?[{name:\"\",values:v}]:[]; if(Array.isArray(v)&&v.length&&v.every(p=>p&&typeof p===\"object\"&&isFinite(p.x)&&isFinite(p.y))) return [{name:\"\",values:v.map(p=>p.y)}]; if(Array.isArray(v)&&v.every(a=>Array.isArray(a)&&a.every(n=>typeof n===\"number\"))) return v.filter(a=>a.length).map((a,i)=>({name:\"s\"+(i+1),values:a})); if(v&&typeof v===\"object\"&&!Array.isArray(v)) return Object.entries(v).filter(([,a])=>Array.isArray(a)&&a.every(n=>typeof n===\"number\")&&a.length).map(([n,a])=>({name:n,values:a})); if(typeof v===\"number\"&&isFinite(v)) return [{name:\"\",values:[v]}]; return []; }\nfunction kitLabelled(v,labels){ if(v&&typeof v===\"object\"&&!Array.isArray(v)){ const e=Object.entries(v).filter(([,n])=>typeof n===\"number\"&&isFinite(n)); if(e.length) return e.map(([label,value])=>({label,value})); } if(Array.isArray(v)&&v.every(n=>typeof n===\"number\")) return v.map((value,i)=>({label:labels[i]||(\"#\"+(i+1)),value})); return []; }\nfunction kitExtent(vals){ if(!vals.length) return {min:0,max:1}; let min=Math.min.apply(null,vals.concat([0])), max=Math.max.apply(null,vals); if(min===max){min-=1;max+=1;} return {min,max}; }\nfunction kitScale(v,d,r0,r1){ return r0+((v-d.min)/(d.max-d.min))*(r1-r0); }\nfunction kitTicks(d){ const span=d.max-d.min, step0=Math.pow(10,Math.floor(Math.log10(span/3))); const step=[step0,step0*2,step0*5,step0*10].find(s=>span/s<=4)||step0*10; const out=[]; for(let v=Math.ceil(d.min/step)*step; v<=d.max+1e-9; v+=step) out.push(Math.round(v*1e6)/1e6); return out; }\nfunction drawKit(v,kind,labels){\n labels = labels || [];\n const W=660,H=300,PAD=34,P=KIT_PALETTE;\n const grid=(d)=>kitTicks(d).map(t=>{const y=kitScale(t,d,H-PAD,PAD);return '<line x1=\"'+PAD+'\" x2=\"'+(W-PAD)+'\" y1=\"'+y+'\" y2=\"'+y+'\" stroke=\"currentColor\" opacity=\"0.15\" stroke-dasharray=\"2 4\"/><text x=\"'+(PAD-6)+'\" y=\"'+(y+3)+'\" font-size=\"10\" fill=\"currentColor\" opacity=\"0.55\" text-anchor=\"end\">'+t+'</text>';}).join('');\n let body='';\n if(kind==='pie'||kind==='donut'){\n const slices=kitLabelled(v,labels).filter(s=>s.value>0); if(!slices.length) return '';\n const total=slices.reduce((a,s)=>a+s.value,0), r=H/2-16, r0=kind==='donut'?r*0.55:0, cx=H/2, cy=H/2; let ang=-Math.PI/2;\n body=slices.map((s,i)=>{ const sweep=s.value/total*Math.PI*2, a0=ang, a1=ang+sweep; ang=a1; const end=sweep>=Math.PI*2-1e-6?a1-1e-4:a1, large=sweep>Math.PI?1:0; const pt=(a,rad)=>(cx+Math.cos(a)*rad)+','+(cy+Math.sin(a)*rad);\n const path=r0>0?'M '+pt(a0,r)+' A '+r+' '+r+' 0 '+large+' 1 '+pt(end,r)+' L '+pt(end,r0)+' A '+r0+' '+r0+' 0 '+large+' 0 '+pt(a0,r0)+' Z':'M '+cx+','+cy+' L '+pt(a0,r)+' A '+r+' '+r+' 0 '+large+' 1 '+pt(end,r)+' Z';\n return '<path d=\"'+path+'\" fill=\"'+P[i%P.length]+'\"/>';\n }).join('')+slices.map((s,i)=>'<g transform=\"translate('+(H+24)+','+(28+i*20)+')\"><rect width=\"10\" height=\"10\" rx=\"2\" fill=\"'+P[i%P.length]+'\"/><text x=\"16\" y=\"9\" font-size=\"11\" fill=\"currentColor\" opacity=\"0.7\">'+s.label+' \u00B7 '+Math.round(s.value/total*100)+'%</text></g>').join('');\n } else if(kind==='funnel'){\n const stages=kitLabelled(v,labels); const max=Math.max.apply(null,stages.map(s=>Math.max(0,s.value)).concat([0])); if(!stages.length||max<=0) return '';\n const gap=3, rowH=(H-PAD-gap*(stages.length-1))/stages.length;\n body=stages.map((s,i)=>{ const w=Math.max(Math.max(0,s.value)/max*(W-PAD*2),2), x=PAD+((W-PAD*2)-w)/2, y=12+i*(rowH+gap);\n return '<rect x=\"'+x+'\" y=\"'+y+'\" width=\"'+w+'\" height=\"'+rowH+'\" rx=\"4\" fill=\"'+P[i%P.length]+'\" opacity=\"0.85\"/><text x=\"'+(W/2)+'\" y=\"'+(y+rowH/2+4)+'\" font-size=\"11\" font-weight=\"600\" text-anchor=\"middle\" fill=\"#fff\">'+s.label+' \u00B7 '+s.value+'</text>';\n }).join('');\n } else if(kind==='scatter'){\n const pts=Array.isArray(v)&&v.length&&v.every(p=>p&&typeof p===\"object\"&&isFinite(p.x)&&isFinite(p.y))?v:(Array.isArray(v)&&v.every(n=>typeof n===\"number\")?v.map((y,x)=>({x,y})):[]); if(!pts.length) return '';\n const dx=kitExtent(pts.map(p=>p.x)), dy=kitExtent(pts.map(p=>p.y));\n body=grid(dy)+pts.map(p=>'<circle cx=\"'+kitScale(p.x,dx,PAD,W-PAD)+'\" cy=\"'+kitScale(p.y,dy,H-PAD,PAD)+'\" r=\"4\" fill=\"'+P[0]+'\" opacity=\"0.75\"/>').join('');\n } else if(kind==='bar'){\n const series=kitSeries(v); if(!series.length) return '';\n const d=kitExtent(series.flatMap(s=>s.values)), n=Math.max.apply(null,series.map(s=>s.values.length)), groupW=(W-PAD*2)/n, barW=Math.max(groupW*0.7/series.length,2), zero=kitScale(Math.max(d.min,0),d,H-PAD,PAD);\n body=grid(d)+series.map((s,si)=>s.values.map((val,i)=>{ const y=kitScale(val,d,H-PAD,PAD), x=PAD+i*groupW+groupW*0.15+si*barW; return '<rect x=\"'+x+'\" y=\"'+Math.min(y,zero)+'\" width=\"'+(barW-1)+'\" height=\"'+Math.max(Math.abs(zero-y),1)+'\" rx=\"2\" fill=\"'+P[si%P.length]+'\"/>'; }).join('')).join('')+labels.slice(0,n).map((l,i)=>'<text x=\"'+(PAD+i*groupW+groupW/2)+'\" y=\"'+(H-8)+'\" font-size=\"10\" text-anchor=\"middle\" fill=\"currentColor\" opacity=\"0.55\">'+l+'</text>').join('');\n } else { // line / area\n const series=kitSeries(v); if(!series.length) return '';\n const d=kitExtent(series.flatMap(s=>s.values)), base=kitScale(Math.max(d.min,0),d,H-PAD,PAD);\n const n=Math.max.apply(null,series.map(s=>s.values.length));\n body=grid(d)+series.map((s,i)=>{ const len=s.values.length; const pts=s.values.map((val,j)=>{ const x=len===1?W/2:PAD+(j/(len-1))*(W-PAD*2); return (Math.round(x*10)/10)+','+(Math.round(kitScale(val,d,H-PAD,PAD)*10)/10); }).join(' ');\n const first=pts.split(' ')[0].split(',')[0], parts=pts.split(' '), last=parts[parts.length-1].split(',')[0];\n return (kind==='area'?'<polygon points=\"'+first+','+base+' '+pts+' '+last+','+base+'\" fill=\"'+P[i%P.length]+'\" opacity=\"0.15\"/>':'')+'<polyline points=\"'+pts+'\" fill=\"none\" stroke=\"'+P[i%P.length]+'\" stroke-width=\"2\" stroke-linejoin=\"round\"/>';\n }).join('')+labels.slice(0,n).map((l,i)=>'<text x=\"'+(n===1?W/2:PAD+(i/(n-1))*(W-PAD*2))+'\" y=\"'+(H-8)+'\" font-size=\"10\" text-anchor=\"middle\" fill=\"currentColor\" opacity=\"0.55\">'+l+'</text>').join('');\n }\n if(kind!=='pie'&&kind!=='donut'&&kind!=='funnel'&&kind!=='scatter'){\n const named=kitSeries(v).filter(s=>s.name);\n if(named.length>1) body+=named.map((s,i)=>'<g transform=\"translate('+(W-PAD-90)+','+(16+i*18)+')\"><rect width=\"10\" height=\"10\" rx=\"2\" fill=\"'+P[i%P.length]+'\"/><text x=\"16\" y=\"9\" font-size=\"11\" fill=\"currentColor\" opacity=\"0.7\">'+s.name+'</text></g>').join('');\n }\n return '<svg viewBox=\"0 0 '+W+' '+H+'\" xmlns=\"http://www.w3.org/2000/svg\" style=\"width:100%;height:auto\">'+body+'</svg>';\n}\n";
13
+ /** The chart's fixed view-box dimensions (mirrors the source above). */
14
+ export declare const KIT_CHART_W = 660;
15
+ export declare const KIT_CHART_H = 300;
16
+ /**
17
+ * Draw a kit chart to an SVG string for a value/kind/labels — the static-export
18
+ * counterpart of the runtime's live redraw. Returns '' when there's nothing
19
+ * plottable.
20
+ */
21
+ export declare function kitChartSvg(value: unknown, kind: string, labels?: string[]): string;
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Render a page — or a whole reachable mini-site — to a **self-contained,
3
+ * interactive** HTML document. Prose, lists, code, mentions and links are styled
4
+ * static HTML; reactive blocks stay *live* (sliders recompute their dependent
5
+ * expressions and redraw charts) via a small inlined runtime; and nested pages,
6
+ * subpages and database rows are **navigable** — clicking one swaps the document
7
+ * to that page, all inside the single file.
8
+ *
9
+ * - {@link toHtml} renders one page snapshot (the Markdown/PDF-parity baseline).
10
+ * - {@link toHtmlSite} renders a {@link SiteBundle}: every page as a section, a
11
+ * client-side router, and databases drawn as tables of navigable rows.
12
+ */
13
+ import type { PageSnapshot } from '@book.dev/sdk';
14
+ import type { SiteBundle } from './exportSite';
15
+ /** Build the interactive HTML for a single page snapshot (Markdown/PDF parity). */
16
+ export declare function toHtml(rawSnapshot: PageSnapshot, title: string, icon: string): string;
17
+ /** Build a self-contained, interactive slide deck: blocks split into slides at
18
+ * every divider, widgets stay live offline, arrow-key navigation. */
19
+ export declare function toSlideDeck(rawSnapshot: PageSnapshot, title: string, icon: string): string;
20
+ /**
21
+ * Build one interactive HTML file for a whole {@link SiteBundle}: every page as a
22
+ * navigable section, databases as tables of navigable rows, and a client-side
23
+ * router that swaps the visible page on link clicks (with browser back/forward).
24
+ */
25
+ export declare function toHtmlSite(bundle: SiteBundle): string;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Render a {@link DocModel} to Markdown. Pure and unit-tested. Reactive blocks
3
+ * collapse to their current value (`**name** = value`); charts to a caption with
4
+ * series names; `@`-mentions to their label text (there is no portable URL).
5
+ */
6
+ import type { DocModel } from './documentModel';
7
+ export declare function toMarkdown(model: DocModel): string;
@@ -0,0 +1,14 @@
1
+ import 'svg2pdf.js';
2
+ export type PdfMode = 'paged' | 'continuous';
3
+ /**
4
+ * Render exported HTML to a vector PDF. `mode` controls pagination:
5
+ * - `continuous`: a single page sized to the full content height;
6
+ * - `paged`: US-Letter pages, the content sliced across them by viewBox.
7
+ */
8
+ export declare function toPdf(html: string, mode: PdfMode): Promise<Blob>;
9
+ /**
10
+ * Render a slide-deck HTML (from {@link toHtmlSlides}) to a PDF — one slide per
11
+ * page, each fit to a landscape page at the slide's own aspect. All slides are
12
+ * forced visible first (the deck hides all but the current one).
13
+ */
14
+ export declare function toPdfSlides(html: string): Promise<Blob>;