@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,86 @@
1
+ import React from 'react';
2
+ import type { CustomBlockProps } from '../registry';
3
+ /** Definitions consumed by kit/index.ts (type + renderer + slash entry). */
4
+ export declare const INPUT2_BLOCKS: readonly [{
5
+ readonly type: "choicecards";
6
+ readonly render: React.FC<CustomBlockProps>;
7
+ readonly slash: {
8
+ readonly label: "Choice cards";
9
+ readonly hint: "Pick from image cards — single or multi";
10
+ readonly keywords: "choice cards image radio multi select picture option visual gallery pick";
11
+ readonly make: () => {
12
+ type: string;
13
+ props: {
14
+ name: string;
15
+ opts: {
16
+ label: string;
17
+ }[];
18
+ value: null;
19
+ };
20
+ };
21
+ };
22
+ }, {
23
+ readonly type: "longtext";
24
+ readonly render: React.FC<CustomBlockProps>;
25
+ readonly slash: {
26
+ readonly label: "Long text";
27
+ readonly hint: "A named multi-line text area";
28
+ readonly keywords: "long text textarea multiline paragraph notes comment input";
29
+ readonly make: () => {
30
+ type: string;
31
+ props: {
32
+ name: string;
33
+ value: string;
34
+ };
35
+ };
36
+ };
37
+ }, {
38
+ readonly type: "richtext";
39
+ readonly render: React.FC<CustomBlockProps>;
40
+ readonly slash: {
41
+ readonly label: "Rich text";
42
+ readonly hint: "Formatted text — bold, italic, links";
43
+ readonly keywords: "rich text formatted markup bold italic underline link wysiwyg input";
44
+ readonly make: () => {
45
+ type: string;
46
+ props: {
47
+ name: string;
48
+ runs: never[];
49
+ };
50
+ };
51
+ };
52
+ }, {
53
+ readonly type: "searchselect";
54
+ readonly render: React.FC<CustomBlockProps>;
55
+ readonly slash: {
56
+ readonly label: "Searchable select";
57
+ readonly hint: "Search a list — single or multi";
58
+ readonly keywords: "search select multiselect dropdown combobox autocomplete filter pick option";
59
+ readonly make: () => {
60
+ type: string;
61
+ props: {
62
+ name: string;
63
+ opts: {
64
+ label: string;
65
+ }[];
66
+ value: null;
67
+ };
68
+ };
69
+ };
70
+ }, {
71
+ readonly type: "tagfield";
72
+ readonly render: React.FC<CustomBlockProps>;
73
+ readonly slash: {
74
+ readonly label: "Tag field";
75
+ readonly hint: "Free-entry tags with suggestions";
76
+ readonly keywords: "tag tags chips labels keywords free entry suggestions multi input";
77
+ readonly make: () => {
78
+ type: string;
79
+ props: {
80
+ name: string;
81
+ selected: never[];
82
+ freeEntry: boolean;
83
+ };
84
+ };
85
+ };
86
+ }];
@@ -0,0 +1,5 @@
1
+ export declare function registerKitConfig(blockId: string, open: () => void): () => void;
2
+ /** Whether a block has a registered config affordance (i.e. is configurable). */
3
+ export declare const hasKitConfig: (blockId: string) => boolean;
4
+ /** Open a block's config popover. Returns false if the block has none. */
5
+ export declare function openKitConfig(blockId: string): boolean;
@@ -0,0 +1,31 @@
1
+ /**
2
+ * The bridge for the "Expand" view of an interactive block's settings. Rather
3
+ * than a bespoke drawer, the config reuses the app's existing **side pane**:
4
+ * KitConfig portals its live fields into a host element the {@link SplitPane}
5
+ * mounts when it shows the `CONFIG_PANE_ID` pseudo-page.
6
+ *
7
+ * Three module singletons, the same pattern as `kitConfig`/`openDocs`:
8
+ * - `panel` — which block is being configured (id + title), or null.
9
+ * - `host` — the DOM node inside the side pane to portal the fields into.
10
+ * - `nav` — how to open/close that side pane, wired by NavigationProvider
11
+ * (the bridge stays free of React/navigation imports).
12
+ */
13
+ export interface KitPanelState {
14
+ blockId: string;
15
+ title: string;
16
+ }
17
+ /** Open (or switch) the expanded config to a block, and reveal the side pane. */
18
+ export declare function openKitPanel(blockId: string, title: string): void;
19
+ /** Clear the expanded config. By default also hides the side pane; pass
20
+ * `keepPane` when the pane is already going away (its own unmount calls this). */
21
+ export declare function closeKitPanel(opts?: {
22
+ keepPane?: boolean;
23
+ }): void;
24
+ export declare const getKitPanel: () => KitPanelState | null;
25
+ export declare function subscribeKitPanel(cb: () => void): () => void;
26
+ /** The side pane publishes its portal host (null on unmount). */
27
+ export declare function setKitPanelHost(el: HTMLElement | null): void;
28
+ export declare const getKitPanelHost: () => HTMLElement | null;
29
+ export declare function subscribeKitPanelHost(cb: () => void): () => void;
30
+ /** NavigationProvider wires opening/closing the CONFIG side pane. */
31
+ export declare function registerKitPanelNav(open: (blockId: string) => void, close: () => void): () => void;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Group lock state, provided by a `group` block to everything rendered inside
3
+ * it. A locked group makes its contents read-only — `BlockEditor` swaps in a
4
+ * read-only editor for descendant blocks — except interactive widgets a reader
5
+ * is meant to keep operating (those carry `props.interactive`).
6
+ */
7
+ export interface KitLockState {
8
+ locked: boolean;
9
+ }
10
+ export declare const KitLockContext: import("react").Context<KitLockState>;
11
+ /** Whether the nearest enclosing group is locked. */
12
+ export declare const useKitLock: () => boolean;
@@ -0,0 +1,60 @@
1
+ import { type BlockMap } from '../model';
2
+ /**
3
+ * Choice options for the radio / checklist / dropdown inputs.
4
+ *
5
+ * An option has a **display label** (what the reader sees) and a **value** (what
6
+ * the reactive scope and exports serialise). They're decoupled so a friendly
7
+ * "Option 1" can publish a clean `option-1`. The value defaults to a slug of
8
+ * the label, so the simple case (label only) still works and old documents —
9
+ * which stored a plain comma-separated `options` string where value == label —
10
+ * keep resolving unchanged.
11
+ */
12
+ export interface KitOption {
13
+ label: string;
14
+ value: string;
15
+ /** Choice-card media (optional): a cover image (URL or data URL), an
16
+ * icon/emoji, or a palette colour token shown when no image is set. */
17
+ image?: string;
18
+ icon?: string;
19
+ color?: string;
20
+ }
21
+ /** Stored option (value may be blank → falls back to a slug of the label). */
22
+ interface RawOption {
23
+ label: string;
24
+ value?: string;
25
+ image?: string;
26
+ icon?: string;
27
+ color?: string;
28
+ }
29
+ /** A URL/identifier-friendly slug of a label ("Option 1" → "option-1"). */
30
+ export declare const slugify: (s: string) => string;
31
+ /**
32
+ * Turn ANY free-text display label into a valid TypeScript identifier, so a
33
+ * reader-facing name like "Tax rate (2024) 💰" still publishes a usable symbol
34
+ * (`taxRate2024`) with the author never touching the config. The rules, in
35
+ * order: fold accents to ASCII ("Café" → "Cafe"); split on every run of
36
+ * non-identifier characters and camelCase the words; prefix a leading digit
37
+ * with `_`; suffix a reserved word with `_`. Returns '' only when nothing
38
+ * usable remains (the caller falls back to the block's default symbol). The
39
+ * reactive engine references these via `new Function(name, …)`, so the result
40
+ * is always legal.
41
+ */
42
+ export declare const varNameFromLabel: (label: string) => string;
43
+ /** The value an option actually publishes (explicit value, else slug of label). */
44
+ export declare const optionValue: (opt: RawOption) => string;
45
+ /** Parse the legacy comma-separated string. `Label = value` sets an explicit
46
+ * value; a bare `Label` keeps value == label (the historical behaviour). */
47
+ export declare function parseOptionsString(raw: string): RawOption[];
48
+ /** The stored raw options for a block: the structured `opts` array if present,
49
+ * else the parsed legacy `options` string. */
50
+ export declare function rawOptions(props: {
51
+ opts?: unknown;
52
+ options?: unknown;
53
+ }): RawOption[];
54
+ /** Fully-resolved options (every value non-empty) for rendering + publishing. */
55
+ export declare function resolveOptions(block: BlockMap): KitOption[];
56
+ /** Same resolution from a plain props bag (export path). */
57
+ export declare function resolveOptionsFromProps(props: Record<string, unknown>): KitOption[];
58
+ /** Map a stored value back to its display label (falls back to the value). */
59
+ export declare const labelOf: (options: KitOption[], value: string) => string;
60
+ export {};
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+ import type { CustomBlockProps } from '../registry';
3
+ export declare const PROGRESS_BLOCKS: readonly [{
4
+ readonly type: "progressbar";
5
+ readonly render: React.FC<CustomBlockProps>;
6
+ readonly slash: {
7
+ readonly label: "Progress bar";
8
+ readonly hint: "A bar computed from an expression over inputs";
9
+ readonly keywords: "progress bar meter completion percent gauge status indicator";
10
+ readonly make: () => {
11
+ type: string;
12
+ props: {
13
+ label: string;
14
+ source: string;
15
+ max: number;
16
+ format: string;
17
+ };
18
+ };
19
+ };
20
+ }];
@@ -0,0 +1,100 @@
1
+ import type * as Y from 'yjs';
2
+ import { type BlockMap } from '../model';
3
+ /**
4
+ * The name a block publishes under: its explicit variable `name` when set,
5
+ * otherwise one derived from the human display `label` ("Dark mode" → darkMode).
6
+ * So an author who only fills in a display name still gets a working reactive
7
+ * symbol — without it, display-name-only inputs published nothing and the whole
8
+ * dataflow looked empty. Returns '' when neither yields a legal identifier.
9
+ */
10
+ export declare function publishedName(block: BlockMap): string;
11
+ /** Block types that publish a named value into the scope. */
12
+ export declare const INPUT_TYPES: Set<string>;
13
+ /**
14
+ * The reactive namespace a group publishes under — a legal identifier derived
15
+ * from the group's display name. Inputs inside a named group are exported as
16
+ * `group.field.value`; an unnamed group adds no namespace.
17
+ */
18
+ export declare function groupKey(block: BlockMap): string;
19
+ /** The plain-text projection of a rich-text input's stored runs. Used as the
20
+ * block's published value (so evalExpr/export read a string) and by the export
21
+ * tokenizer. Defined here so scope, the renderer, and exports agree. */
22
+ export declare function richTextPlain(block: BlockMap): string;
23
+ /** The published value of one input block (shape depends on the type). */
24
+ export declare function inputValue(block: BlockMap): unknown;
25
+ /** Every named input's current value, by name. */
26
+ export declare function inputScope(doc: Y.Doc): Record<string, unknown>;
27
+ /** Find the first input block published under `name`, or null. */
28
+ export declare function findInput(doc: Y.Doc, name: string): BlockMap | null;
29
+ /** Write an input's value back from a synced/plain value (inverse of inputValue). */
30
+ export declare function setInputValue(block: BlockMap, value: unknown): void;
31
+ /** A group's own inputs, keyed by published field name (not crossing into any
32
+ * nested group, which keeps its own namespace). Drives cross-page sync. */
33
+ export declare function groupInputs(group: BlockMap): Map<string, BlockMap>;
34
+ /**
35
+ * Write a numeric input's value (button actions: set / increment). Clamps to
36
+ * the input's own min/max when it declares them. No-op when the name doesn't
37
+ * resolve or the target isn't numeric.
38
+ */
39
+ export declare function setNamedNumber(doc: Y.Doc, name: string, next: (current: number) => number): void;
40
+ /**
41
+ * Evaluate an expression over the input scope. Same trust model as the app's
42
+ * expr blocks: the document's own code runs client-side with the inputs in
43
+ * scope. Returns `{value}` or `{error}` — callers render, never throw.
44
+ */
45
+ export declare function evalExpr(source: string, scope: Record<string, unknown>): {
46
+ value?: unknown;
47
+ error?: string;
48
+ };
49
+ /**
50
+ * Evaluate live-code: a single expression, or — when that doesn't parse — a
51
+ * function body (multi-line code with its own `return`). Lets a live code
52
+ * block hold real programs, not just one-liners.
53
+ */
54
+ export declare function evalCode(source: string, scope: Record<string, unknown>): {
55
+ value?: unknown;
56
+ error?: string;
57
+ };
58
+ export interface ComputedScope {
59
+ /** Every name a consumer can reference: inputs + named live-code outputs. */
60
+ scope: Record<string, unknown>;
61
+ /** Per-block evaluation results (live code + legacy formulas), by block id. */
62
+ results: Map<string, {
63
+ value?: unknown;
64
+ error?: string;
65
+ }>;
66
+ }
67
+ /**
68
+ * The document's full reactive scope: input values first, then every LIVE
69
+ * code block (and legacy formula block) evaluated **in document order**, each
70
+ * seeing the inputs plus all named outputs above it — so computations chain.
71
+ * A single ordered pass: forward references read `undefined`, cycles can't
72
+ * happen.
73
+ */
74
+ export declare function computeScope(doc: Y.Doc): ComputedScope;
75
+ /** Render an evaluated value the way the formula block does (compact numbers). */
76
+ export declare function formatValue(value: unknown): string;
77
+ /** The status-light state. `off` = neutral (no/unevaluable value). */
78
+ export type Status = 'ok' | 'warn' | 'bad' | 'off';
79
+ /**
80
+ * Map a status-light expression result to a state. Booleans → ok/bad; numbers
81
+ * → ok at/above `okAt`, warn at/above `warnAt`, else bad; the strings
82
+ * ok/warn/bad pass through; anything else is neutral. Shared by the live block
83
+ * and the exporters so a light's colour is identical in the window and a PDF.
84
+ */
85
+ export declare function statusOf(value: unknown, error: string | undefined, okAt: number, warnAt: number): Status;
86
+ /** One reactive block's resolved value for export (and a status light's state). */
87
+ export interface ExportCell {
88
+ value: unknown;
89
+ /** Status lights only: the resolved ok/warn/bad/off state. */
90
+ status?: Status;
91
+ }
92
+ /**
93
+ * Resolve every reactive block's CURRENT value the way the editor does, keyed by
94
+ * block id — so static exports (PDF / Markdown) and the pre-hydration HTML show
95
+ * the same numbers, charts, lights and bars as the live window. Inputs publish
96
+ * their value; live code / formulas come from {@link computeScope}; charts,
97
+ * status lights, and progress bars evaluate their expression over the same
98
+ * scope (mirroring their block components).
99
+ */
100
+ export declare function computeExportCells(doc: Y.Doc): Map<string, ExportCell>;
@@ -0,0 +1,236 @@
1
+ import * as Y from 'yjs';
2
+ /**
3
+ * The block editor's document model: a CRDT block tree in a Y.Doc.
4
+ *
5
+ * Shape — one uniform recursive structure for everything:
6
+ *
7
+ * doc.getArray('blocks') Y.Array<Y.Map> top-level blocks
8
+ * block (Y.Map):
9
+ * id string stable id (drag/drop, React keys, anchors)
10
+ * type BlockType
11
+ * text Y.Text rich text (attribute runs), text blocks only
12
+ * props Y.Map type-specific config (heading level, spans…)
13
+ * children Y.Array<Y.Map> container blocks (columns → column → blocks,
14
+ * table → row → cell)
15
+ *
16
+ * Uniformity is the point: a table cell and a layout column hold ordinary
17
+ * blocks, so editing, drag-and-drop, selection, and serialization recurse
18
+ * with no special cases. Inline formatting lives in Y.Text attribute runs
19
+ * ({b,i,u,s,c,a,m} — bold, italic, underline, strike, code, anchor href,
20
+ * mention page id) so concurrent edits merge at the character level.
21
+ *
22
+ * Two serializations:
23
+ * - the Y update (base64) — the CRDT history, what collaboration merges;
24
+ * - a plain JSON projection — what the server, exports, and tests read.
25
+ * Both are stored in the page snapshot (see `encodeSnapshot`).
26
+ */
27
+ export type BlockType = 'paragraph' | 'heading' | 'list' | 'todo' | 'quote' | 'callout' | 'code' | 'notes' | 'divider' | 'columns' | 'column' | 'table' | 'row' | 'cell' | 'group' | 'tabs' | 'tab' | 'accordion' | 'accordionsection';
28
+ /** Inline formatting attributes carried by Y.Text runs. */
29
+ export interface InlineAttrs {
30
+ b?: boolean;
31
+ i?: boolean;
32
+ u?: boolean;
33
+ s?: boolean;
34
+ c?: boolean;
35
+ /** Link href. */
36
+ a?: string;
37
+ /** Mention: a page id (rendered as a live page chip). */
38
+ m?: string;
39
+ /** Text colour — a palette token (see `colors.ts`). */
40
+ tc?: string;
41
+ /** Highlight colour — a palette token. */
42
+ hl?: string;
43
+ }
44
+ /** One run of a block's rich text in the JSON projection. */
45
+ export interface TextRun {
46
+ t: string;
47
+ a?: InlineAttrs;
48
+ }
49
+ /** The JSON projection of a block (exports, server, tests). */
50
+ export interface BlockJSON {
51
+ id: string;
52
+ type: AnyBlockType;
53
+ text?: TextRun[];
54
+ props?: Record<string, unknown>;
55
+ children?: BlockJSON[];
56
+ }
57
+ /** Block types that carry editable rich text. */
58
+ export declare const TEXT_BLOCKS: ReadonlySet<BlockType>;
59
+ /** Block types whose `children` hold ordinary blocks. */
60
+ export declare const CONTAINER_BLOCKS: ReadonlySet<BlockType>;
61
+ export type BlockMap = Y.Map<unknown>;
62
+ /** Core types plus registered custom types (registry.tsx). */
63
+ export type AnyBlockType = BlockType | (string & {});
64
+ export interface NewBlock {
65
+ type: AnyBlockType;
66
+ text?: string | TextRun[];
67
+ props?: Record<string, unknown>;
68
+ children?: NewBlock[];
69
+ id?: string;
70
+ }
71
+ /** Build a detached block Y.Map (insert it into an array before editing). */
72
+ export declare function makeBlock(input: NewBlock): BlockMap;
73
+ /**
74
+ * Coerce an untrusted plain object (e.g. from an AI `append_blocks` proposal)
75
+ * into a {@link NewBlock}, recursing into `children`. Returns null for anything
76
+ * that isn't a usable block. Keeps {@link makeBlock} fed only well-formed input
77
+ * so a malformed model response can't corrupt the document — and unlike the old
78
+ * flat `{type, text}` handling, it preserves rich-text runs, props, and nested
79
+ * children, so the agent can build interactive kit inputs and layouts.
80
+ */
81
+ export declare function coerceNewBlock(value: unknown): NewBlock | null;
82
+ /** A fresh empty document (one empty paragraph, like a new page). */
83
+ export declare function createDoc(blocks?: NewBlock[]): Y.Doc;
84
+ export declare function rootBlocks(doc: Y.Doc): Y.Array<BlockMap>;
85
+ /**
86
+ * A doc seeded *deterministically*: the seed content is written by a fixed
87
+ * replica (clientID 1) with caller-supplied block ids, so every client that
88
+ * seeds the same template produces byte-identical CRDT state. Two tabs that
89
+ * race to initialize then merge into ONE copy of the content instead of two.
90
+ * Blocks without explicit ids would defeat the purpose — they get stable ids
91
+ * derived from their position instead of random ones.
92
+ */
93
+ export declare function createSeededDoc(blocks: NewBlock[], seedTag?: string): Y.Doc;
94
+ export declare const blockId: (b: BlockMap) => string;
95
+ export declare const blockType: (b: BlockMap) => BlockType;
96
+ export declare const blockText: (b: BlockMap) => Y.Text | undefined;
97
+ export declare const blockChildren: (b: BlockMap) => Y.Array<BlockMap> | undefined;
98
+ /**
99
+ * Rewrite a Y.Text to `next` with a MINIMAL splice: the shared leading prefix
100
+ * and trailing suffix are left untouched, so only the changed middle is deleted
101
+ * and reinserted. Better for cursors, collaboration, and inline formatting on
102
+ * the unchanged ends than a full delete-all + reinsert.
103
+ */
104
+ export declare function replaceText(text: Y.Text, next: string): void;
105
+ export declare function blockProp<T>(b: BlockMap, key: string): T | undefined;
106
+ export declare function setBlockProp(b: BlockMap, key: string, value: unknown): void;
107
+ /** Depth-first walk over every block in the tree. */
108
+ export declare function walkBlocks(list: Y.Array<BlockMap>): Generator<{
109
+ block: BlockMap;
110
+ parent: Y.Array<BlockMap>;
111
+ index: number;
112
+ }>;
113
+ /** Locate a block (and its parent array + index) by id anywhere in the doc. */
114
+ export declare function findBlock(doc: Y.Doc, id: string): {
115
+ block: BlockMap;
116
+ parent: Y.Array<BlockMap>;
117
+ index: number;
118
+ } | null;
119
+ /** Deep-clone a block into a fresh detached Y.Map (same ids). */
120
+ export declare function cloneBlock(b: BlockMap, freshIds?: boolean): BlockMap;
121
+ export declare function insertBlock(doc: Y.Doc, parent: Y.Array<BlockMap>, index: number, input: NewBlock): string;
122
+ export declare function removeBlock(doc: Y.Doc, id: string): void;
123
+ /**
124
+ * Move a block to `toIndex` of the array identified by `targetParentId`
125
+ * (`null` = the root list). Clones under the hood (Yjs re-parent rule);
126
+ * `toIndex` is interpreted against the array *without* the moved block.
127
+ */
128
+ export declare function moveBlock(doc: Y.Doc, id: string, targetParentId: string | null, toIndex: number): void;
129
+ /** Split a text block at `offset`: the tail (text + attrs) becomes a new block below. */
130
+ export declare function splitBlock(doc: Y.Doc, id: string, offset: number, newType?: BlockType): string | null;
131
+ /**
132
+ * Merge a text block into the previous text block (Backspace at offset 0).
133
+ * Returns the previous block's id and its pre-merge length (caret target).
134
+ */
135
+ export declare function mergeWithPrevious(doc: Y.Doc, id: string): {
136
+ id: string;
137
+ offset: number;
138
+ } | null;
139
+ /** Change a block's type in place (keeps text); optional props patch. */
140
+ export declare function turnInto(doc: Y.Doc, id: string, type: BlockType, props?: Record<string, unknown>): void;
141
+ /**
142
+ * Apply an optional `{type, props}` patch to a block IN PLACE — call from inside
143
+ * a transaction. Like {@link turnInto} but the type is optional (props-only
144
+ * updates keep the type) and there's no own transaction, so the agent bridge can
145
+ * fold it into its single 'local' transaction. Turning into a text block adds an
146
+ * empty Y.Text when missing.
147
+ */
148
+ export declare function patchBlock(block: BlockMap, patch: {
149
+ type?: string;
150
+ props?: Record<string, unknown>;
151
+ }): void;
152
+ /** Most columns a layout can hold (a 12-unit grid stays legible up to six). */
153
+ export declare const MAX_COLUMNS = 6;
154
+ /**
155
+ * Make a columns layout: wraps `targetId` and the moved block `movedId`
156
+ * side-by-side (moved goes left when `side === 'left'`). If `targetId` is
157
+ * already a column's child, the moved block becomes a new adjacent column
158
+ * instead (2 → 3 → … columns by dropping beside, up to {@link MAX_COLUMNS}).
159
+ */
160
+ export declare function dropBeside(doc: Y.Doc, movedId: string, targetId: string, side: 'left' | 'right'): void;
161
+ /** The block whose `children` array is `arr`, or null for the root list. */
162
+ export declare function parentBlockOf(doc: Y.Doc, arr: Y.Array<BlockMap>): BlockMap | null;
163
+ /** Drop empty columns; unwrap single-column layouts; drop empty layouts. */
164
+ export declare function pruneEmptyContainers(doc: Y.Doc): void;
165
+ /** A document never renders empty — keep one paragraph to type into. */
166
+ export declare function ensureNotEmpty(doc: Y.Doc): void;
167
+ export declare function makeTable(rows: number, cols: number): NewBlock;
168
+ /** Insert a row at `rowIndex` (clamped); matches the table's column count. */
169
+ export declare function tableInsertRow(doc: Y.Doc, tableId: string, rowIndex: number): void;
170
+ export declare function tableInsertColumn(doc: Y.Doc, tableId: string, colIndex: number): void;
171
+ export declare function tableDeleteRow(doc: Y.Doc, tableId: string, rowIndex: number): void;
172
+ export declare function tableDeleteColumn(doc: Y.Doc, tableId: string, colIndex: number): void;
173
+ /**
174
+ * Locate a cell within its table: row/column indices plus the table block.
175
+ * Powers cell navigation (Tab/Enter) — cells are blocks, but movement inside
176
+ * a table is grid-shaped, not list-shaped.
177
+ */
178
+ export declare function cellPosition(doc: Y.Doc, cellId: string): {
179
+ table: BlockMap;
180
+ row: number;
181
+ col: number;
182
+ rows: number;
183
+ cols: number;
184
+ } | null;
185
+ /**
186
+ * The neighbouring cell id for grid navigation. `next`/`prev` move within
187
+ * the row and wrap across rows; `down`/`up` move within the column. Returns
188
+ * null at the table's edge (callers may grow the table and retry).
189
+ */
190
+ export declare function cellNeighbor(doc: Y.Doc, cellId: string, dir: 'next' | 'prev' | 'down' | 'up'): string | null;
191
+ export declare function blockToJSON(b: BlockMap): BlockJSON;
192
+ export declare function docToJSON(doc: Y.Doc): BlockJSON[];
193
+ /** The plain concatenated text of a block (search, summaries). */
194
+ export declare function blockPlainText(b: BlockMap): string;
195
+ /** Persisted form inside a page snapshot. */
196
+ export interface BlockDocSnapshot {
197
+ v: 1;
198
+ /** Base64 Y update — the CRDT state vector clients merge from. */
199
+ update: string;
200
+ /** Plain JSON projection — exports / server / non-CRDT readers. */
201
+ blocks: BlockJSON[];
202
+ }
203
+ export declare function encodeSnapshot(doc: Y.Doc): BlockDocSnapshot;
204
+ /** Rebuild a Y.Doc from a snapshot (falls back to the JSON projection). */
205
+ export declare function decodeSnapshot(snapshot: BlockDocSnapshot | undefined | null): Y.Doc;
206
+ interface EditorJsBlock {
207
+ id?: string;
208
+ type: string;
209
+ data: Record<string, unknown>;
210
+ }
211
+ /** Strip an EditorJS HTML string into rich runs (b/i/code/links survive). */
212
+ export declare function htmlToRuns(html: string): TextRun[];
213
+ /**
214
+ * Parse clipboard/external HTML into blocks: top-level block elements map to
215
+ * block types, inline markup folds into rich runs (via {@link htmlToRuns}),
216
+ * lists flatten to one block per item, tables come across whole. Anything
217
+ * unrecognized degrades to a paragraph with its text — never dropped.
218
+ */
219
+ export declare function htmlToBlocks(html: string): NewBlock[];
220
+ /** Reactive context for migration: cell values + the name index, straight
221
+ * from the page snapshot (`values` / `names`). */
222
+ export interface MigrationContext {
223
+ values?: Array<[string, unknown]>;
224
+ names?: Array<[string, string]>;
225
+ /** Page titles by id — gives subpage/database mentions their real names. */
226
+ pageLabels?: Map<string, string>;
227
+ }
228
+ /**
229
+ * One-way migration of an EditorJS document into the block model. Every block
230
+ * type the app ships maps to something — reactive blocks (slider/expr) become
231
+ * the editor's reactive plugins, links to nested pages survive as mention
232
+ * runs, derived blocks (toc) are skipped, and the rest degrade to readable
233
+ * text. Nothing is lost silently — the original snapshot stays on the page.
234
+ */
235
+ export declare function migrateEditorJs(blocks: EditorJsBlock[], ctx?: MigrationContext): NewBlock[];
236
+ export {};
@@ -0,0 +1,18 @@
1
+ import * as Y from 'yjs';
2
+ import { type BlockMap } from './model';
3
+ /**
4
+ * Present mode splits a page into slides at every top-level `divider` block.
5
+ * Within a slide, `notes` blocks are speaker-only (shown in the presenter view,
6
+ * never to the audience); everything else is audience `content`.
7
+ */
8
+ export interface Slide {
9
+ content: BlockMap[];
10
+ notes: BlockMap[];
11
+ }
12
+ /**
13
+ * Group a document's top-level blocks into slides at each `divider`. A
14
+ * divider-less doc is a single slide; leading/trailing/doubled dividers never
15
+ * yield an empty slide; an empty doc yields one empty slide so the deck always
16
+ * has something to show.
17
+ */
18
+ export declare function splitSlides(doc: Y.Doc): Slide[];
@@ -0,0 +1,16 @@
1
+ import * as Y from 'yjs';
2
+ export interface PresencePeer {
3
+ clientId: number;
4
+ name: string;
5
+ color: string;
6
+ blockId: string | null;
7
+ at: number;
8
+ }
9
+ export interface BroadcastConnection {
10
+ disconnect(): void;
11
+ /** Update this client's presence (focused block). */
12
+ setPresence(blockId: string | null): void;
13
+ /** Subscribe to the live peer list (excluding self). */
14
+ onPeers(cb: (peers: PresencePeer[]) => void): () => void;
15
+ }
16
+ export declare function connectBroadcast(doc: Y.Doc, channelName: string, userName?: string): BroadcastConnection;
@@ -0,0 +1,2 @@
1
+ /** Register the built-in reactive blocks (idempotent enough for app startup). */
2
+ export declare function registerReactiveBlocks(): void;
@@ -0,0 +1,38 @@
1
+ import type React from 'react';
2
+ import type { BlockMap, NewBlock } from './model';
3
+ import type { BlockEditorController } from './useBlockEditor';
4
+ /**
5
+ * The custom-block extension point. Anything the core editor doesn't know
6
+ * (reactive widgets, embeds, app-specific views) registers here: a renderer
7
+ * keyed by block `type`, optionally with a slash-menu entry. The registry is
8
+ * a module-level singleton — same pattern as the app's pageLinks bridge — so
9
+ * registration works from any layer without threading React context.
10
+ *
11
+ * Custom blocks receive the raw block Y.Map and the editor controller; they
12
+ * own their props via `blockProp`/`setBlockProp` (CRDT-synced like
13
+ * everything else) and are rendered inside the standard row (gutter, drag,
14
+ * selection all behave normally).
15
+ */
16
+ export interface CustomBlockProps {
17
+ block: BlockMap;
18
+ editor: BlockEditorController;
19
+ }
20
+ export interface CustomBlockDef {
21
+ /** The block `type` this renders (must not collide with core types). */
22
+ type: string;
23
+ render: React.FC<CustomBlockProps>;
24
+ /** Optional slash-menu entry that inserts this block. */
25
+ slash?: {
26
+ label: string;
27
+ hint: string;
28
+ keywords: string;
29
+ make: () => NewBlock;
30
+ /** Slash-menu category. Built-ins set `interactive`; third-party blocks
31
+ * default to `extensions`. */
32
+ group?: 'interactive' | 'extensions';
33
+ };
34
+ }
35
+ export declare function registerCustomBlock(def: CustomBlockDef): () => void;
36
+ export declare const getCustomBlock: (type: string) => CustomBlockDef | undefined;
37
+ export declare const customSlashItems: () => CustomBlockDef[];
38
+ export declare const subscribeRegistry: (cb: () => void) => (() => void);