@bendyline/docblocks-react 2.0.0 → 2.1.1

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 (310) hide show
  1. package/README.md +18 -3
  2. package/dist/ExportDialog-VYATD5UC.js +9 -0
  3. package/dist/{ExportToolbarControls-D2YDWOXW.js → ExportToolbarControls-5HUE3LSX.js} +206 -42
  4. package/dist/{GitToolbarControl-LMIR4R7I.js → GitToolbarControl-FW3BZFXV.js} +62 -44
  5. package/dist/{GitUI-KGF5MSNV.js → GitUI-GMH3PAYL.js} +225 -141
  6. package/dist/{LazyEditorShell-EF2BWRXU.js → LazyEditorShell-RF54B5UD.js} +0 -1
  7. package/dist/ShareDialog-PAMOQQFB.js +212 -0
  8. package/dist/chunk-3CZ27FOA.js +359 -0
  9. package/dist/chunk-3QSZY74C.js +255 -0
  10. package/{src/Export/export-destination.ts → dist/chunk-BI7NVU6T.js} +16 -15
  11. package/dist/{chunk-VHDP4IPL.js → chunk-BPGEBGAN.js} +0 -1
  12. package/dist/{chunk-DD4VFJQI.js → chunk-EBWYGTN7.js} +2 -1
  13. package/dist/{chunk-ZI56BNB7.js → chunk-GHQ4X7KM.js} +27 -7
  14. package/dist/{chunk-5A4KEWKT.js → chunk-HFYPTTCH.js} +0 -1
  15. package/dist/chunk-LG6HAWCK.js +109 -0
  16. package/dist/chunk-TFMO7EVO.js +88 -0
  17. package/dist/{chunk-4XXSWN3T.js → chunk-YBEYTVU2.js} +0 -1
  18. package/dist/editor.d.ts +5 -4
  19. package/dist/editor.js +8 -70
  20. package/dist/export/index.d.ts +24 -8
  21. package/dist/export/index.js +10 -6
  22. package/dist/index.d.ts +355 -21
  23. package/dist/index.js +6419 -21
  24. package/dist/run-export-Z5BVFLIR.js +9 -0
  25. package/dist/settings/index.d.ts +9 -1
  26. package/dist/settings/index.js +6 -5
  27. package/package.json +18 -13
  28. package/src/styles/docblocks.css +985 -35
  29. package/dist/AppMenu/AppMenu.d.ts +0 -53
  30. package/dist/AppMenu/AppMenu.d.ts.map +0 -1
  31. package/dist/AppMenu/AppMenu.js +0 -67
  32. package/dist/AppMenu/AppMenu.js.map +0 -1
  33. package/dist/AppMenu/index.d.ts +0 -3
  34. package/dist/AppMenu/index.d.ts.map +0 -1
  35. package/dist/AppMenu/index.js +0 -2
  36. package/dist/AppMenu/index.js.map +0 -1
  37. package/dist/DocBlocksShell/DocBlocksShell.d.ts +0 -49
  38. package/dist/DocBlocksShell/DocBlocksShell.d.ts.map +0 -1
  39. package/dist/DocBlocksShell/DocBlocksShell.js +0 -2730
  40. package/dist/DocBlocksShell/DocBlocksShell.js.map +0 -1
  41. package/dist/DocBlocksShell/LazyEditorShell.d.ts +0 -3
  42. package/dist/DocBlocksShell/LazyEditorShell.d.ts.map +0 -1
  43. package/dist/DocBlocksShell/LazyEditorShell.js +0 -3
  44. package/dist/DocBlocksShell/LazyEditorShell.js.map +0 -1
  45. package/dist/DocBlocksShell/UpdateAvailableNotice.d.ts +0 -13
  46. package/dist/DocBlocksShell/UpdateAvailableNotice.d.ts.map +0 -1
  47. package/dist/DocBlocksShell/UpdateAvailableNotice.js +0 -16
  48. package/dist/DocBlocksShell/UpdateAvailableNotice.js.map +0 -1
  49. package/dist/DocBlocksShell/document-title.d.ts +0 -3
  50. package/dist/DocBlocksShell/document-title.d.ts.map +0 -1
  51. package/dist/DocBlocksShell/document-title.js +0 -17
  52. package/dist/DocBlocksShell/document-title.js.map +0 -1
  53. package/dist/DocBlocksShell/index.d.ts +0 -3
  54. package/dist/DocBlocksShell/index.d.ts.map +0 -1
  55. package/dist/DocBlocksShell/index.js +0 -2
  56. package/dist/DocBlocksShell/index.js.map +0 -1
  57. package/dist/DocBlocksShell/workspace-authority-barrier.d.ts +0 -14
  58. package/dist/DocBlocksShell/workspace-authority-barrier.d.ts.map +0 -1
  59. package/dist/DocBlocksShell/workspace-authority-barrier.js +0 -23
  60. package/dist/DocBlocksShell/workspace-authority-barrier.js.map +0 -1
  61. package/dist/Export/DeferredExportToolbarControls.d.ts +0 -5
  62. package/dist/Export/DeferredExportToolbarControls.d.ts.map +0 -1
  63. package/dist/Export/DeferredExportToolbarControls.js +0 -10
  64. package/dist/Export/DeferredExportToolbarControls.js.map +0 -1
  65. package/dist/Export/ExportDialog.d.ts +0 -25
  66. package/dist/Export/ExportDialog.d.ts.map +0 -1
  67. package/dist/Export/ExportDialog.js +0 -160
  68. package/dist/Export/ExportDialog.js.map +0 -1
  69. package/dist/Export/ExportToolbarControls.d.ts +0 -37
  70. package/dist/Export/ExportToolbarControls.d.ts.map +0 -1
  71. package/dist/Export/ExportToolbarControls.js +0 -285
  72. package/dist/Export/ExportToolbarControls.js.map +0 -1
  73. package/dist/Export/export-destination.d.ts +0 -3
  74. package/dist/Export/export-destination.d.ts.map +0 -1
  75. package/dist/Export/export-destination.js +0 -32
  76. package/dist/Export/export-destination.js.map +0 -1
  77. package/dist/Export/export-options.d.ts +0 -53
  78. package/dist/Export/export-options.d.ts.map +0 -1
  79. package/dist/Export/export-options.js +0 -49
  80. package/dist/Export/export-options.js.map +0 -1
  81. package/dist/Export/index.d.ts +0 -10
  82. package/dist/Export/index.d.ts.map +0 -1
  83. package/dist/Export/index.js +0 -6
  84. package/dist/Export/index.js.map +0 -1
  85. package/dist/Export/public-api.d.ts +0 -12
  86. package/dist/Export/public-api.d.ts.map +0 -1
  87. package/dist/Export/public-api.js +0 -9
  88. package/dist/Export/public-api.js.map +0 -1
  89. package/dist/Export/run-export.d.ts +0 -10
  90. package/dist/Export/run-export.d.ts.map +0 -1
  91. package/dist/Export/run-export.js +0 -313
  92. package/dist/Export/run-export.js.map +0 -1
  93. package/dist/Export/transform-summaries.d.ts +0 -7
  94. package/dist/Export/transform-summaries.d.ts.map +0 -1
  95. package/dist/Export/transform-summaries.js +0 -6
  96. package/dist/Export/transform-summaries.js.map +0 -1
  97. package/dist/ExportDialog-MEUISWZX.js +0 -9
  98. package/dist/ExportDialog-MEUISWZX.js.map +0 -1
  99. package/dist/ExportToolbarControls-D2YDWOXW.js.map +0 -1
  100. package/dist/FileExplorer/FileExplorer.d.ts +0 -43
  101. package/dist/FileExplorer/FileExplorer.d.ts.map +0 -1
  102. package/dist/FileExplorer/FileExplorer.js +0 -315
  103. package/dist/FileExplorer/FileExplorer.js.map +0 -1
  104. package/dist/FileExplorer/FileTreeNode.d.ts +0 -39
  105. package/dist/FileExplorer/FileTreeNode.d.ts.map +0 -1
  106. package/dist/FileExplorer/FileTreeNode.js +0 -131
  107. package/dist/FileExplorer/FileTreeNode.js.map +0 -1
  108. package/dist/FileExplorer/index.d.ts +0 -6
  109. package/dist/FileExplorer/index.d.ts.map +0 -1
  110. package/dist/FileExplorer/index.js +0 -4
  111. package/dist/FileExplorer/index.js.map +0 -1
  112. package/dist/FileExplorer/useFileTree.d.ts +0 -37
  113. package/dist/FileExplorer/useFileTree.d.ts.map +0 -1
  114. package/dist/FileExplorer/useFileTree.js +0 -284
  115. package/dist/FileExplorer/useFileTree.js.map +0 -1
  116. package/dist/Git/GitAuthGuidanceDialog.d.ts +0 -18
  117. package/dist/Git/GitAuthGuidanceDialog.d.ts.map +0 -1
  118. package/dist/Git/GitAuthGuidanceDialog.js +0 -27
  119. package/dist/Git/GitAuthGuidanceDialog.js.map +0 -1
  120. package/dist/Git/GitBranchesDialog.d.ts +0 -13
  121. package/dist/Git/GitBranchesDialog.d.ts.map +0 -1
  122. package/dist/Git/GitBranchesDialog.js +0 -59
  123. package/dist/Git/GitBranchesDialog.js.map +0 -1
  124. package/dist/Git/GitCloneDialog.d.ts +0 -14
  125. package/dist/Git/GitCloneDialog.d.ts.map +0 -1
  126. package/dist/Git/GitCloneDialog.js +0 -79
  127. package/dist/Git/GitCloneDialog.js.map +0 -1
  128. package/dist/Git/GitCommitDialog.d.ts +0 -12
  129. package/dist/Git/GitCommitDialog.d.ts.map +0 -1
  130. package/dist/Git/GitCommitDialog.js +0 -38
  131. package/dist/Git/GitCommitDialog.js.map +0 -1
  132. package/dist/Git/GitConflictsDialog.d.ts +0 -12
  133. package/dist/Git/GitConflictsDialog.d.ts.map +0 -1
  134. package/dist/Git/GitConflictsDialog.js +0 -17
  135. package/dist/Git/GitConflictsDialog.js.map +0 -1
  136. package/dist/Git/GitContext.d.ts +0 -89
  137. package/dist/Git/GitContext.d.ts.map +0 -1
  138. package/dist/Git/GitContext.js +0 -15
  139. package/dist/Git/GitContext.js.map +0 -1
  140. package/dist/Git/GitDiffDialog.d.ts +0 -20
  141. package/dist/Git/GitDiffDialog.d.ts.map +0 -1
  142. package/dist/Git/GitDiffDialog.js +0 -100
  143. package/dist/Git/GitDiffDialog.js.map +0 -1
  144. package/dist/Git/GitDiffView.d.ts +0 -23
  145. package/dist/Git/GitDiffView.d.ts.map +0 -1
  146. package/dist/Git/GitDiffView.js +0 -77
  147. package/dist/Git/GitDiffView.js.map +0 -1
  148. package/dist/Git/GitHistoryDialog.d.ts +0 -15
  149. package/dist/Git/GitHistoryDialog.d.ts.map +0 -1
  150. package/dist/Git/GitHistoryDialog.js +0 -107
  151. package/dist/Git/GitHistoryDialog.js.map +0 -1
  152. package/dist/Git/GitStatusBar.d.ts +0 -8
  153. package/dist/Git/GitStatusBar.d.ts.map +0 -1
  154. package/dist/Git/GitStatusBar.js +0 -49
  155. package/dist/Git/GitStatusBar.js.map +0 -1
  156. package/dist/Git/GitToolbarControl.d.ts +0 -15
  157. package/dist/Git/GitToolbarControl.d.ts.map +0 -1
  158. package/dist/Git/GitToolbarControl.js +0 -51
  159. package/dist/Git/GitToolbarControl.js.map +0 -1
  160. package/dist/Git/GitUI.d.ts +0 -14
  161. package/dist/Git/GitUI.d.ts.map +0 -1
  162. package/dist/Git/GitUI.js +0 -21
  163. package/dist/Git/GitUI.js.map +0 -1
  164. package/dist/Git/commit-selection.d.ts +0 -22
  165. package/dist/Git/commit-selection.d.ts.map +0 -1
  166. package/dist/Git/commit-selection.js +0 -47
  167. package/dist/Git/commit-selection.js.map +0 -1
  168. package/dist/Git/git-clone-utils.d.ts +0 -8
  169. package/dist/Git/git-clone-utils.d.ts.map +0 -1
  170. package/dist/Git/git-clone-utils.js +0 -26
  171. package/dist/Git/git-clone-utils.js.map +0 -1
  172. package/dist/Git/git-status.d.ts +0 -24
  173. package/dist/Git/git-status.d.ts.map +0 -1
  174. package/dist/Git/git-status.js +0 -105
  175. package/dist/Git/git-status.js.map +0 -1
  176. package/dist/Git/useGit.d.ts +0 -15
  177. package/dist/Git/useGit.d.ts.map +0 -1
  178. package/dist/Git/useGit.js +0 -206
  179. package/dist/Git/useGit.js.map +0 -1
  180. package/dist/Git/useGitStatus.d.ts +0 -17
  181. package/dist/Git/useGitStatus.d.ts.map +0 -1
  182. package/dist/Git/useGitStatus.js +0 -63
  183. package/dist/Git/useGitStatus.js.map +0 -1
  184. package/dist/GitToolbarControl-LMIR4R7I.js.map +0 -1
  185. package/dist/GitUI-KGF5MSNV.js.map +0 -1
  186. package/dist/LazyEditorShell-EF2BWRXU.js.map +0 -1
  187. package/dist/Settings/Settings.d.ts +0 -23
  188. package/dist/Settings/Settings.d.ts.map +0 -1
  189. package/dist/Settings/Settings.js +0 -22
  190. package/dist/Settings/Settings.js.map +0 -1
  191. package/dist/Settings/public-api.d.ts +0 -3
  192. package/dist/Settings/public-api.d.ts.map +0 -1
  193. package/dist/Settings/public-api.js +0 -2
  194. package/dist/Settings/public-api.js.map +0 -1
  195. package/dist/WorkspacePicker/WorkspacePicker.d.ts +0 -22
  196. package/dist/WorkspacePicker/WorkspacePicker.d.ts.map +0 -1
  197. package/dist/WorkspacePicker/WorkspacePicker.js +0 -74
  198. package/dist/WorkspacePicker/WorkspacePicker.js.map +0 -1
  199. package/dist/WorkspacePicker/WorkspaceSettingsButton.d.ts +0 -11
  200. package/dist/WorkspacePicker/WorkspaceSettingsButton.d.ts.map +0 -1
  201. package/dist/WorkspacePicker/WorkspaceSettingsButton.js +0 -27
  202. package/dist/WorkspacePicker/WorkspaceSettingsButton.js.map +0 -1
  203. package/dist/WorkspacePicker/WorkspaceSettingsDialog.d.ts +0 -20
  204. package/dist/WorkspacePicker/WorkspaceSettingsDialog.d.ts.map +0 -1
  205. package/dist/WorkspacePicker/WorkspaceSettingsDialog.js +0 -36
  206. package/dist/WorkspacePicker/WorkspaceSettingsDialog.js.map +0 -1
  207. package/dist/WorkspacePicker/index.d.ts +0 -3
  208. package/dist/WorkspacePicker/index.d.ts.map +0 -1
  209. package/dist/WorkspacePicker/index.js +0 -2
  210. package/dist/WorkspacePicker/index.js.map +0 -1
  211. package/dist/chunk-3SAXDU2U.js +0 -157
  212. package/dist/chunk-3SAXDU2U.js.map +0 -1
  213. package/dist/chunk-4XXSWN3T.js.map +0 -1
  214. package/dist/chunk-5A4KEWKT.js.map +0 -1
  215. package/dist/chunk-AOVTHZU7.js +0 -321
  216. package/dist/chunk-AOVTHZU7.js.map +0 -1
  217. package/dist/chunk-DD4VFJQI.js.map +0 -1
  218. package/dist/chunk-GSNZSCIK.js +0 -55
  219. package/dist/chunk-GSNZSCIK.js.map +0 -1
  220. package/dist/chunk-VHDP4IPL.js.map +0 -1
  221. package/dist/chunk-ZI56BNB7.js.map +0 -1
  222. package/dist/components/Dialog.d.ts +0 -22
  223. package/dist/components/Dialog.d.ts.map +0 -1
  224. package/dist/components/Dialog.js +0 -33
  225. package/dist/components/Dialog.js.map +0 -1
  226. package/dist/editor.d.ts.map +0 -1
  227. package/dist/editor.js.map +0 -1
  228. package/dist/export/index.js.map +0 -1
  229. package/dist/hooks/index.d.ts +0 -3
  230. package/dist/hooks/index.d.ts.map +0 -1
  231. package/dist/hooks/index.js +0 -2
  232. package/dist/hooks/index.js.map +0 -1
  233. package/dist/hooks/useDocumentSession.d.ts +0 -16
  234. package/dist/hooks/useDocumentSession.d.ts.map +0 -1
  235. package/dist/hooks/useDocumentSession.js +0 -18
  236. package/dist/hooks/useDocumentSession.js.map +0 -1
  237. package/dist/icons.d.ts +0 -12
  238. package/dist/icons.d.ts.map +0 -1
  239. package/dist/icons.js +0 -28
  240. package/dist/icons.js.map +0 -1
  241. package/dist/index.d.ts.map +0 -1
  242. package/dist/index.js.map +0 -1
  243. package/dist/preferences/theme.d.ts +0 -18
  244. package/dist/preferences/theme.d.ts.map +0 -1
  245. package/dist/preferences/theme.js +0 -63
  246. package/dist/preferences/theme.js.map +0 -1
  247. package/dist/preferences/versioning.d.ts +0 -27
  248. package/dist/preferences/versioning.d.ts.map +0 -1
  249. package/dist/preferences/versioning.js +0 -62
  250. package/dist/preferences/versioning.js.map +0 -1
  251. package/dist/provider-lease.d.ts +0 -10
  252. package/dist/provider-lease.d.ts.map +0 -1
  253. package/dist/provider-lease.js +0 -42
  254. package/dist/provider-lease.js.map +0 -1
  255. package/dist/run-export-ICTZITXC.js +0 -10
  256. package/dist/run-export-ICTZITXC.js.map +0 -1
  257. package/dist/settings/index.js.map +0 -1
  258. package/src/AppMenu/AppMenu.tsx +0 -334
  259. package/src/AppMenu/index.ts +0 -2
  260. package/src/DocBlocksShell/DocBlocksShell.tsx +0 -3398
  261. package/src/DocBlocksShell/LazyEditorShell.ts +0 -2
  262. package/src/DocBlocksShell/UpdateAvailableNotice.tsx +0 -60
  263. package/src/DocBlocksShell/document-title.ts +0 -19
  264. package/src/DocBlocksShell/index.ts +0 -2
  265. package/src/DocBlocksShell/workspace-authority-barrier.ts +0 -26
  266. package/src/Export/DeferredExportToolbarControls.tsx +0 -23
  267. package/src/Export/ExportDialog.tsx +0 -437
  268. package/src/Export/ExportToolbarControls.tsx +0 -511
  269. package/src/Export/export-options.ts +0 -99
  270. package/src/Export/index.ts +0 -19
  271. package/src/Export/public-api.ts +0 -17
  272. package/src/Export/run-export.ts +0 -374
  273. package/src/Export/transform-summaries.ts +0 -14
  274. package/src/FileExplorer/FileExplorer.tsx +0 -528
  275. package/src/FileExplorer/FileTreeNode.tsx +0 -306
  276. package/src/FileExplorer/index.ts +0 -5
  277. package/src/FileExplorer/useFileTree.ts +0 -352
  278. package/src/Git/GitAuthGuidanceDialog.tsx +0 -84
  279. package/src/Git/GitBranchesDialog.tsx +0 -144
  280. package/src/Git/GitCloneDialog.tsx +0 -200
  281. package/src/Git/GitCommitDialog.tsx +0 -119
  282. package/src/Git/GitConflictsDialog.tsx +0 -62
  283. package/src/Git/GitContext.tsx +0 -88
  284. package/src/Git/GitDiffDialog.tsx +0 -147
  285. package/src/Git/GitDiffView.tsx +0 -105
  286. package/src/Git/GitHistoryDialog.tsx +0 -195
  287. package/src/Git/GitStatusBar.tsx +0 -157
  288. package/src/Git/GitToolbarControl.tsx +0 -123
  289. package/src/Git/GitUI.tsx +0 -68
  290. package/src/Git/commit-selection.ts +0 -63
  291. package/src/Git/git-clone-utils.ts +0 -23
  292. package/src/Git/git-status.ts +0 -113
  293. package/src/Git/useGit.ts +0 -279
  294. package/src/Git/useGitStatus.ts +0 -78
  295. package/src/Settings/Settings.tsx +0 -118
  296. package/src/Settings/public-api.ts +0 -8
  297. package/src/WorkspacePicker/WorkspacePicker.tsx +0 -191
  298. package/src/WorkspacePicker/WorkspaceSettingsButton.tsx +0 -88
  299. package/src/WorkspacePicker/WorkspaceSettingsDialog.tsx +0 -121
  300. package/src/WorkspacePicker/index.ts +0 -2
  301. package/src/components/Dialog.tsx +0 -81
  302. package/src/editor.ts +0 -72
  303. package/src/hooks/index.ts +0 -2
  304. package/src/hooks/useDocumentSession.ts +0 -37
  305. package/src/icons.tsx +0 -48
  306. package/src/index.ts +0 -61
  307. package/src/preferences/theme.ts +0 -67
  308. package/src/preferences/versioning.ts +0 -69
  309. package/src/provider-lease.ts +0 -52
  310. package/src/types/pwa-dom.d.ts +0 -31
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/Export/export-options.ts"],"sourcesContent":["/**\n * Export option types and localStorage persistence for quick-export.\n */\n\nexport type ExportFormat = 'docx' | 'pdf' | 'pptx' | 'md' | 'html';\n\n/** Visual style for HTML export. */\nexport type HtmlStyle =\n /** Render via SquisqPlayer (themed, embeds player bundle). */\n | 'rendered'\n /** Plain semantic HTML — small, no JS, no playback. */\n | 'plain';\n\n/** Packaging for HTML export. */\nexport type HtmlBundle =\n /** Single self-contained .html file (images base64-embedded). */\n | 'single'\n /** ZIP containing index.html + asset files. */\n | 'zip';\n\nexport interface ExportOptions {\n format: ExportFormat;\n themeId: string;\n /** Transform style for PPTX — controls how content is segmented and styled. */\n transformStyle: string;\n /** Only applies to PDF */\n pageSize: 'letter' | 'a4';\n /** HTML rendering style. Only applies to format=html. */\n htmlStyle: HtmlStyle;\n /** HTML bundle layout. Only applies to format=html. */\n htmlBundle: HtmlBundle;\n /**\n * Recursive HTML bundle: walk relative `.md` links from the entry\n * document, render every reachable sibling/child page, and rewrite\n * cross-doc links from `.md` → `.html`. The output is a ZIP\n * regardless of `htmlBundle` because multi-doc output needs a\n * directory tree. Supported for both plain (`markdownDocsToPlainHtmlBundle`)\n * and rendered (`markdownDocsToHtmlBundle`) HTML styles. Only\n * meaningful when `format === 'html'`.\n */\n includeLinkedDocs: boolean;\n /**\n * Rename the entry page from `<basename>.html` to `index.html` so the\n * export drops straight into a static-site host that expects an\n * `index.html` landing page. For recursive bundles, cross-doc links\n * targeting the entry also rewrite to `index.html` so siblings don't\n * 404. For a single-doc HTML download, this just renames the file.\n * Only meaningful when `format === 'html'`.\n */\n entryAsIndex: boolean;\n}\n\nexport const FORMAT_LABELS: Record<ExportFormat, string> = {\n docx: 'Word Document (.docx)',\n pdf: 'PDF (.pdf)',\n pptx: 'PowerPoint (.pptx)',\n md: 'Markdown (.md)',\n html: 'HTML (.html)',\n};\n\nexport const FORMAT_EXTENSIONS: Record<ExportFormat, string> = {\n docx: '.docx',\n pdf: '.pdf',\n pptx: '.pptx',\n md: '.md',\n html: '.html',\n};\n\nconst STORAGE_KEY = 'docblocks-export-options';\n\nexport const DEFAULT_OPTIONS: ExportOptions = {\n format: 'pdf',\n themeId: 'standard',\n transformStyle: 'documentary',\n pageSize: 'letter',\n htmlStyle: 'plain',\n htmlBundle: 'single',\n includeLinkedDocs: false,\n entryAsIndex: false,\n};\n\nexport function loadLastExportOptions(): ExportOptions | null {\n try {\n const raw = localStorage.getItem(STORAGE_KEY);\n if (!raw) return null;\n const parsed = JSON.parse(raw) as Partial<ExportOptions>;\n return { ...DEFAULT_OPTIONS, ...parsed };\n } catch {\n return null;\n }\n}\n\nexport function saveExportOptions(options: ExportOptions): void {\n try {\n localStorage.setItem(STORAGE_KEY, JSON.stringify(options));\n } catch {\n // Ignore storage errors\n }\n}\n"],"mappings":";AAoDO,IAAM,gBAA8C;AAAA,EACzD,MAAM;AAAA,EACN,KAAK;AAAA,EACL,MAAM;AAAA,EACN,IAAI;AAAA,EACJ,MAAM;AACR;AAEO,IAAM,oBAAkD;AAAA,EAC7D,MAAM;AAAA,EACN,KAAK;AAAA,EACL,MAAM;AAAA,EACN,IAAI;AAAA,EACJ,MAAM;AACR;AAEA,IAAM,cAAc;AAEb,IAAM,kBAAiC;AAAA,EAC5C,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,gBAAgB;AAAA,EAChB,UAAU;AAAA,EACV,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,mBAAmB;AAAA,EACnB,cAAc;AAChB;AAEO,SAAS,wBAA8C;AAC5D,MAAI;AACF,UAAM,MAAM,aAAa,QAAQ,WAAW;AAC5C,QAAI,CAAC,IAAK,QAAO;AACjB,UAAM,SAAS,KAAK,MAAM,GAAG;AAC7B,WAAO,EAAE,GAAG,iBAAiB,GAAG,OAAO;AAAA,EACzC,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAEO,SAAS,kBAAkB,SAA8B;AAC9D,MAAI;AACF,iBAAa,QAAQ,aAAa,KAAK,UAAU,OAAO,CAAC;AAAA,EAC3D,QAAQ;AAAA,EAER;AACF;","names":[]}
@@ -1,55 +0,0 @@
1
- // src/components/Dialog.tsx
2
- import { useCallback, useEffect, useRef } from "react";
3
- import { jsx, jsxs } from "react/jsx-runtime";
4
- function Dialog({
5
- title,
6
- onClose,
7
- size = "default",
8
- children,
9
- footer,
10
- initialFocusRef,
11
- closeOnBackdrop = true
12
- }) {
13
- const closeButtonRef = useRef(null);
14
- useEffect(() => {
15
- const onKey = (e) => {
16
- if (e.key === "Escape") onClose();
17
- };
18
- window.addEventListener("keydown", onKey);
19
- return () => window.removeEventListener("keydown", onKey);
20
- }, [onClose]);
21
- useEffect(() => {
22
- const target = initialFocusRef?.current ?? closeButtonRef.current;
23
- target?.focus();
24
- }, []);
25
- const handleBackdropClick = useCallback(
26
- (e) => {
27
- if (closeOnBackdrop && e.target === e.currentTarget) onClose();
28
- },
29
- [closeOnBackdrop, onClose]
30
- );
31
- const sizeClass = size === "wide" ? " db-dialog--wide" : size === "full" ? " db-dialog--full" : "";
32
- return /* @__PURE__ */ jsx("div", { className: "db-dialog-overlay", onClick: handleBackdropClick, children: /* @__PURE__ */ jsxs("div", { className: `db-dialog${sizeClass}`, role: "dialog", "aria-modal": "true", "aria-label": title, children: [
33
- /* @__PURE__ */ jsxs("div", { className: "db-dialog-header", children: [
34
- /* @__PURE__ */ jsx("h2", { className: "db-dialog-title", children: title }),
35
- /* @__PURE__ */ jsx(
36
- "button",
37
- {
38
- ref: closeButtonRef,
39
- type: "button",
40
- className: "db-dialog-close",
41
- onClick: onClose,
42
- "aria-label": "Close",
43
- children: "\xD7"
44
- }
45
- )
46
- ] }),
47
- /* @__PURE__ */ jsx("div", { className: "db-dialog-body", children }),
48
- footer && /* @__PURE__ */ jsx("div", { className: "db-dialog-footer", children: footer })
49
- ] }) });
50
- }
51
-
52
- export {
53
- Dialog
54
- };
55
- //# sourceMappingURL=chunk-GSNZSCIK.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/Dialog.tsx"],"sourcesContent":["/**\n * Dialog — shared modal primitive.\n *\n * Promotes the `db-dialog-overlay` / `db-dialog` pattern used by the\n * settings dialogs into a reusable component, adding aria-modal and\n * initial focus. Escape and (by default) backdrop clicks close it.\n */\n\nimport { useCallback, useEffect, useRef } from 'react';\n\nexport interface DialogProps {\n title: string;\n onClose: () => void;\n /** default 380px / wide 560px / full min(1100px, 94vw) column. */\n size?: 'default' | 'wide' | 'full';\n children: React.ReactNode;\n /** Right-aligned action row below the body. */\n footer?: React.ReactNode;\n /** Element to focus on open; defaults to the close button. */\n initialFocusRef?: React.RefObject<HTMLElement | null>;\n /** Set false when a stray backdrop click would lose user input. */\n closeOnBackdrop?: boolean;\n}\n\nexport function Dialog({\n title,\n onClose,\n size = 'default',\n children,\n footer,\n initialFocusRef,\n closeOnBackdrop = true,\n}: DialogProps) {\n const closeButtonRef = useRef<HTMLButtonElement>(null);\n\n useEffect(() => {\n const onKey = (e: KeyboardEvent) => {\n if (e.key === 'Escape') onClose();\n };\n window.addEventListener('keydown', onKey);\n return () => window.removeEventListener('keydown', onKey);\n }, [onClose]);\n\n useEffect(() => {\n const target = initialFocusRef?.current ?? closeButtonRef.current;\n target?.focus();\n // Focus only on mount — refocusing on every re-render would fight the user.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const handleBackdropClick = useCallback(\n (e: React.MouseEvent) => {\n if (closeOnBackdrop && e.target === e.currentTarget) onClose();\n },\n [closeOnBackdrop, onClose],\n );\n\n const sizeClass =\n size === 'wide' ? ' db-dialog--wide' : size === 'full' ? ' db-dialog--full' : '';\n\n return (\n <div className=\"db-dialog-overlay\" onClick={handleBackdropClick}>\n <div className={`db-dialog${sizeClass}`} role=\"dialog\" aria-modal=\"true\" aria-label={title}>\n <div className=\"db-dialog-header\">\n <h2 className=\"db-dialog-title\">{title}</h2>\n <button\n ref={closeButtonRef}\n type=\"button\"\n className=\"db-dialog-close\"\n onClick={onClose}\n aria-label=\"Close\"\n >\n &times;\n </button>\n </div>\n <div className=\"db-dialog-body\">{children}</div>\n {footer && <div className=\"db-dialog-footer\">{footer}</div>}\n </div>\n </div>\n );\n}\n"],"mappings":";AAQA,SAAS,aAAa,WAAW,cAAc;AAuDvC,SACE,KADF;AAvCD,SAAS,OAAO;AAAA,EACrB;AAAA,EACA;AAAA,EACA,OAAO;AAAA,EACP;AAAA,EACA;AAAA,EACA;AAAA,EACA,kBAAkB;AACpB,GAAgB;AACd,QAAM,iBAAiB,OAA0B,IAAI;AAErD,YAAU,MAAM;AACd,UAAM,QAAQ,CAAC,MAAqB;AAClC,UAAI,EAAE,QAAQ,SAAU,SAAQ;AAAA,IAClC;AACA,WAAO,iBAAiB,WAAW,KAAK;AACxC,WAAO,MAAM,OAAO,oBAAoB,WAAW,KAAK;AAAA,EAC1D,GAAG,CAAC,OAAO,CAAC;AAEZ,YAAU,MAAM;AACd,UAAM,SAAS,iBAAiB,WAAW,eAAe;AAC1D,YAAQ,MAAM;AAAA,EAGhB,GAAG,CAAC,CAAC;AAEL,QAAM,sBAAsB;AAAA,IAC1B,CAAC,MAAwB;AACvB,UAAI,mBAAmB,EAAE,WAAW,EAAE,cAAe,SAAQ;AAAA,IAC/D;AAAA,IACA,CAAC,iBAAiB,OAAO;AAAA,EAC3B;AAEA,QAAM,YACJ,SAAS,SAAS,qBAAqB,SAAS,SAAS,qBAAqB;AAEhF,SACE,oBAAC,SAAI,WAAU,qBAAoB,SAAS,qBAC1C,+BAAC,SAAI,WAAW,YAAY,SAAS,IAAI,MAAK,UAAS,cAAW,QAAO,cAAY,OACnF;AAAA,yBAAC,SAAI,WAAU,oBACb;AAAA,0BAAC,QAAG,WAAU,mBAAmB,iBAAM;AAAA,MACvC;AAAA,QAAC;AAAA;AAAA,UACC,KAAK;AAAA,UACL,MAAK;AAAA,UACL,WAAU;AAAA,UACV,SAAS;AAAA,UACT,cAAW;AAAA,UACZ;AAAA;AAAA,MAED;AAAA,OACF;AAAA,IACA,oBAAC,SAAI,WAAU,kBAAkB,UAAS;AAAA,IACzC,UAAU,oBAAC,SAAI,WAAU,oBAAoB,kBAAO;AAAA,KACvD,GACF;AAEJ;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/editor.ts"],"sourcesContent":["/**\n * Placeholder prompts shown by DocBlocks when a Markdown document is empty.\n * Hosts pick one prompt for each mounted document generation and pass it to\n * Squisq, so the copy remains stable while that document is open.\n */\nexport const EMPTY_DOCUMENT_PROMPTS = [\n 'Start typing your content, or drop images on top of me...',\n 'Write anything -- paste markdown, drag in images, or just start typing...',\n 'Type away. Markdown syntax works too...',\n 'Chapter 1 begins here...',\n 'Once upon a time...',\n \"A blank page. Exciting, isn't it?\",\n 'The first word is always the hardest...',\n 'Plot twist: this is where it all starts...',\n 'Write something the future you will thank you for...',\n 'Begin at the beginning...',\n \"Let's begin.\",\n 'We can be heroes...',\n 'Here comes the sun...',\n 'And so it begins...',\n 'Let it be, let it be...',\n \"Don't stop believing...\",\n 'Started from the bottom...',\n 'This is the start of something new...',\n 'Ground control to Major Tom...',\n 'Come as you are...',\n 'Every new beginning...',\n \"Hello, is it me you're looking for?\",\n 'Imagine all the people...',\n 'Anything you want, you got it...',\n 'Rise above...',\n 'Do you have the time...',\n 'Here we are now, entertain us...',\n 'All the small things...',\n 'Should I stay or should I go?',\n 'I am a patient boy -- I wait, I wait, I wait...',\n 'Destination unknown...',\n 'Easy like Sunday morning...',\n 'Dance, dance, dance to the radio...',\n 'New day rising...',\n 'Visit the world...',\n 'Positive mental attitude...',\n 'Better I sing than I cry...',\n 'Disconnect for a minute...',\n 'We need new noise...',\n 'Shoot the moon...',\n \"I'll surprise you sometime -- I'll come around...\",\n 'Coming out of my cage, and doing just fine...',\n \"Throw me to the wolves -- I'll come back, leading the pack...\",\n 'There comes a time -- no excuses...',\n \"It's up to me now, turn on the bright lights...\",\n 'Do what you want...',\n 'Fingers crossed...',\n 'This is the start of how it all ends...',\n 'It has to start somewhere, it has to start sometime -- what better place than here? what better time than now?',\n \"I know myself, and I'll begin again...\",\n 'Dig me out, dig me in...',\n \"Everybody's full of sugar, honey, ice and tea...\",\n \"Take time with a wounded hand, 'cause it likes to heal...\",\n 'Grab a brush and put on a little makeup...',\n 'Amber is the color of your energy...',\n \"Wait -- they don't love it like I love it...\",\n \"A world's been buried, where love is the law; a you-topia...\",\n] as const;\n\nexport type EmptyDocumentPrompt = (typeof EMPTY_DOCUMENT_PROMPTS)[number];\n\n/** Pick a prompt using the supplied random source, or `Math.random`. */\nexport function pickEmptyDocumentPrompt(random: () => number = Math.random): EmptyDocumentPrompt {\n const index = Math.floor(random() * EMPTY_DOCUMENT_PROMPTS.length);\n return EMPTY_DOCUMENT_PROMPTS[index] ?? EMPTY_DOCUMENT_PROMPTS[0];\n}\n"],"mappings":";AAKO,IAAM,yBAAyB;AAAA,EACpC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAKO,SAAS,wBAAwB,SAAuB,KAAK,QAA6B;AAC/F,QAAM,QAAQ,KAAK,MAAM,OAAO,IAAI,uBAAuB,MAAM;AACjE,SAAO,uBAAuB,KAAK,KAAK,uBAAuB,CAAC;AAClE;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/Export/run-export.ts"],"sourcesContent":["/**\n * Execute an export using @bendyline/squisq-formats.\n */\n\nimport type {\n MarkdownDocument,\n MarkdownBlockNode,\n MarkdownInlineNode,\n} from '@bendyline/squisq/markdown';\nimport { parseMarkdown } from '@bendyline/squisq/markdown';\nimport type { Doc } from '@bendyline/squisq/schemas';\nimport type { ContentContainer } from '@bendyline/squisq/storage';\nimport type { ExportOptions, ExportFormat } from './export-options.js';\nimport { FORMAT_EXTENSIONS } from './export-options.js';\n\nexport type ExportBlobSaver = (blob: Blob, filename: string) => Promise<void> | void;\n\nconst MIME_TYPES: Record<ExportFormat, string> = {\n docx: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',\n pdf: 'application/pdf',\n pptx: 'application/vnd.openxmlformats-officedocument.presentationml.presentation',\n md: 'text/markdown',\n html: 'text/html',\n};\n\n/** Trigger a browser download for a Blob. */\nfunction downloadBlob(blob: Blob, filename: string): void {\n const url = URL.createObjectURL(blob);\n const a = document.createElement('a');\n a.href = url;\n a.download = filename;\n a.click();\n URL.revokeObjectURL(url);\n}\n\nasync function saveExportBlob(\n blob: Blob,\n filename: string,\n saveBlob?: ExportBlobSaver,\n): Promise<void> {\n if (saveBlob) {\n await saveBlob(blob, filename);\n return;\n }\n downloadBlob(blob, filename);\n}\n\n/** Derive a filename from the selected file path and export format. */\nfunction buildFilename(selectedFile: string | null, format: ExportFormat): string {\n const base = selectedFile ? selectedFile.replace(/^\\//, '').replace(/\\.[^.]+$/, '') : 'document';\n return base + FORMAT_EXTENSIONS[format];\n}\n\nexport function buildExportFilename(selectedFile: string | null, options: ExportOptions): string {\n const base = selectedFile ? selectedFile.replace(/^\\//, '').replace(/\\.[^.]+$/, '') : 'document';\n if (options.format === 'html') {\n if (options.includeLinkedDocs || options.htmlBundle === 'zip') return `${base}.zip`;\n if (options.entryAsIndex) return 'index.html';\n }\n return base + FORMAT_EXTENSIONS[options.format];\n}\n\n/** Run the export and trigger a download. */\nexport async function runExport(\n markdown: string,\n selectedFile: string | null,\n options: ExportOptions,\n mediaContainer?: ContentContainer | null,\n saveBlob?: ExportBlobSaver,\n): Promise<void> {\n const filename = buildFilename(selectedFile, options.format);\n const themeId = options.themeId !== 'standard' ? options.themeId : undefined;\n\n if (options.format === 'md') {\n await saveExportBlob(new Blob([markdown], { type: MIME_TYPES.md }), filename, saveBlob);\n return;\n }\n\n if (options.format === 'html') {\n await runHtmlExport(markdown, filename, options, mediaContainer, selectedFile, saveBlob);\n return;\n }\n\n const doc = parseMarkdown(markdown);\n\n if (options.format === 'docx') {\n const { markdownDocToDocx } = await import('@bendyline/squisq-formats/docx');\n const images = mediaContainer ? await resolveImages(doc, mediaContainer) : undefined;\n const buf = await markdownDocToDocx(doc, { themeId, images });\n await saveExportBlob(new Blob([buf], { type: MIME_TYPES.docx }), filename, saveBlob);\n return;\n }\n\n if (options.format === 'pdf') {\n const { markdownDocToPdf } = await import('@bendyline/squisq-formats/pdf');\n const buf = await markdownDocToPdf(doc, {\n themeId,\n pageSize: options.pageSize,\n });\n await saveExportBlob(new Blob([buf], { type: MIME_TYPES.pdf }), filename, saveBlob);\n return;\n }\n\n if (options.format === 'pptx') {\n const [{ markdownToDoc }, { applyTransform }, { docToPptx }] = await Promise.all([\n import('@bendyline/squisq/doc'),\n import('@bendyline/squisq/transform'),\n import('@bendyline/squisq-formats/pptx'),\n ]);\n // Use the full transform pipeline: markdown -> Doc -> transform -> PPTX\n const baseDoc = markdownToDoc(doc);\n const transformed = applyTransform(baseDoc, options.transformStyle);\n const enrichedDoc = transformed.doc;\n if (themeId) {\n enrichedDoc.themeId = themeId;\n }\n const buf = await docToPptx(enrichedDoc, { themeId });\n await saveExportBlob(new Blob([buf], { type: MIME_TYPES.pptx }), filename, saveBlob);\n return;\n }\n}\n\n/** Run the HTML export branch — handles all four htmlStyle × htmlBundle combinations. */\nasync function runHtmlExport(\n markdown: string,\n htmlFilename: string,\n options: ExportOptions,\n mediaContainer?: ContentContainer | null,\n selectedFile?: string | null,\n saveBlob?: ExportBlobSaver,\n): Promise<void> {\n const baseName = htmlFilename.replace(/\\.html$/, '');\n const zipName = `${baseName}.zip`;\n // When `entryAsIndex` is on, a single-doc HTML download lands on\n // disk as `index.html` so it drops straight into a static host. The\n // recursive ZIP path doesn't care — squisq's bundle helpers handle\n // the inside-zip rename and the cross-doc link rewrite themselves.\n const singleHtmlFilename = options.entryAsIndex ? 'index.html' : htmlFilename;\n const themeId = options.themeId !== 'standard' ? options.themeId : undefined;\n\n // Recursive HTML bundle: when the user opted in, ask squisq to walk\n // this doc's relative .md links and emit a ZIP with every reachable\n // page rendered + cross-doc hrefs rewritten. Two pipelines:\n // • Plain → `markdownDocsToPlainHtmlBundle` (semantic HTML)\n // • Rendered → `markdownDocsToHtmlBundle` (SquisqPlayer-rendered,\n // shared `squisq-player.js`, Doc-tree link rewrites)\n // Both consume the workspace container to resolve sibling files —\n // `mediaContainer` is already scoped to the selected file's parent\n // dir, which is exactly the bundle's scope root. Falls back to the\n // single-doc path if either prerequisite is missing rather than\n // silently skipping the recursion.\n if (options.includeLinkedDocs && mediaContainer && selectedFile) {\n const entryPath = basenameForBundle(selectedFile);\n if (options.htmlStyle === 'rendered') {\n const [{ markdownDocsToHtmlBundle }, { PLAYER_BUNDLE }] = await Promise.all([\n import('@bendyline/squisq-formats/html'),\n import('@bendyline/squisq-react/standalone-source'),\n ]);\n const blob = await markdownDocsToHtmlBundle({\n entryPath,\n readDocument: (path) => readDocumentFromContainer(mediaContainer, path),\n readBinary: (path) => mediaContainer.readFile(path),\n playerScript: PLAYER_BUNDLE,\n title: baseName,\n themeId,\n mode: 'static',\n entryAsIndex: options.entryAsIndex,\n });\n await saveExportBlob(blob, zipName, saveBlob);\n return;\n }\n const { markdownDocsToPlainHtmlBundle } = await import('@bendyline/squisq-formats/html');\n const blob = await markdownDocsToPlainHtmlBundle({\n entryPath,\n readDocument: (path) => readDocumentFromContainer(mediaContainer, path),\n readBinary: (path) => mediaContainer.readFile(path),\n title: baseName,\n themeId,\n entryAsIndex: options.entryAsIndex,\n });\n await saveExportBlob(blob, zipName, saveBlob);\n return;\n }\n\n if (options.htmlStyle === 'rendered') {\n const [{ markdownToDoc }, { docToHtml, docToHtmlZip, collectImagePaths }, { PLAYER_BUNDLE }] =\n await Promise.all([\n import('@bendyline/squisq/doc'),\n import('@bendyline/squisq-formats/html'),\n import('@bendyline/squisq-react/standalone-source'),\n ]);\n const mdDoc = parseMarkdown(markdown);\n const baseDoc = markdownToDoc(mdDoc);\n if (themeId) baseDoc.themeId = themeId;\n\n const images = mediaContainer\n ? await resolveDocImages(baseDoc, mediaContainer, collectImagePaths)\n : undefined;\n\n if (options.htmlBundle === 'zip') {\n const blob = await docToHtmlZip(baseDoc, {\n playerScript: PLAYER_BUNDLE,\n images,\n mode: 'static',\n title: baseName,\n });\n await saveExportBlob(blob, zipName, saveBlob);\n return;\n }\n\n const html = docToHtml(baseDoc, {\n playerScript: PLAYER_BUNDLE,\n images,\n mode: 'static',\n title: baseName,\n });\n await saveExportBlob(new Blob([html], { type: MIME_TYPES.html }), singleHtmlFilename, saveBlob);\n return;\n }\n\n // Plain semantic HTML\n const mdDoc = parseMarkdown(markdown);\n const referencedImages = collectMarkdownImageUrls(mdDoc);\n const localImages = referencedImages.filter((u) => !isExternalUrl(u));\n\n if (options.htmlBundle === 'zip' && mediaContainer && localImages.length > 0) {\n const [{ markdownDocToPlainHtml }, { MemoryContentContainer }, { containerToZip }] =\n await Promise.all([\n import('@bendyline/squisq-formats/html'),\n import('@bendyline/squisq/storage'),\n import('@bendyline/squisq-formats/container'),\n ]);\n // Mirror the markdown's relative paths inside the zip so <img src=\"...\"> still resolves.\n const html = markdownDocToPlainHtml(mdDoc, { title: baseName, themeId });\n const container = new MemoryContentContainer();\n await container.writeFile('index.html', new TextEncoder().encode(html));\n for (const url of localImages) {\n const data = await mediaContainer.readFile(url);\n if (!data) continue;\n const cleanPath = url.replace(/^\\/+/, '');\n await container.writeFile(cleanPath, new Uint8Array(data));\n }\n const blob = await containerToZip(container);\n await saveExportBlob(blob, zipName, saveBlob);\n return;\n }\n\n const { markdownDocToPlainHtml } = await import('@bendyline/squisq-formats/html');\n // Single-file plain HTML — embed local images as base64 data URIs.\n const inlineMap = new Map<string, string>();\n if (mediaContainer) {\n for (const url of localImages) {\n const data = await mediaContainer.readFile(url);\n if (!data) continue;\n inlineMap.set(url, arrayBufferToDataUrl(data, url));\n }\n }\n const html = markdownDocToPlainHtml(mdDoc, {\n title: baseName,\n images: inlineMap.size > 0 ? inlineMap : undefined,\n themeId,\n });\n await saveExportBlob(new Blob([html], { type: MIME_TYPES.html }), singleHtmlFilename, saveBlob);\n}\n\nconst IMAGE_MIME: Record<string, string> = {\n png: 'image/png',\n jpg: 'image/jpeg',\n jpeg: 'image/jpeg',\n gif: 'image/gif',\n webp: 'image/webp',\n bmp: 'image/bmp',\n svg: 'image/svg+xml',\n};\n\nfunction isExternalUrl(url: string): boolean {\n return (\n url.startsWith('http://') ||\n url.startsWith('https://') ||\n url.startsWith('data:') ||\n url.startsWith('blob:')\n );\n}\n\nfunction arrayBufferToDataUrl(data: ArrayBuffer, url: string): string {\n const ext = url.slice(url.lastIndexOf('.') + 1).toLowerCase();\n const mime = IMAGE_MIME[ext] ?? 'application/octet-stream';\n // btoa requires a binary string; chunk to avoid call-stack issues on large files.\n const bytes = new Uint8Array(data);\n let binary = '';\n const CHUNK = 0x8000;\n for (let i = 0; i < bytes.length; i += CHUNK) {\n binary += String.fromCharCode(...bytes.subarray(i, i + CHUNK));\n }\n return `data:${mime};base64,${btoa(binary)}`;\n}\n\n/** Walk the markdown AST and collect all image URLs. */\nfunction collectMarkdownImageUrls(doc: MarkdownDocument): string[] {\n const urls: string[] = [];\n function walkBlocks(nodes: MarkdownBlockNode[]): void {\n for (const node of nodes) {\n if ('children' in node && Array.isArray(node.children)) {\n for (const child of node.children as (MarkdownBlockNode | MarkdownInlineNode)[]) {\n if (child.type === 'image') {\n urls.push((child as { url: string }).url);\n } else if ('children' in child && Array.isArray(child.children)) {\n walkBlocks(child.children as MarkdownBlockNode[]);\n }\n }\n }\n }\n }\n walkBlocks(doc.children);\n return Array.from(new Set(urls));\n}\n\n/** Resolve image URLs (markdown → docx) to binary data from a ContentContainer. */\nasync function resolveImages(\n doc: MarkdownDocument,\n container: ContentContainer,\n): Promise<Map<string, { data: ArrayBuffer | Uint8Array; contentType: string }>> {\n const urls = collectMarkdownImageUrls(doc);\n const map = new Map<string, { data: ArrayBuffer | Uint8Array; contentType: string }>();\n\n for (const url of urls) {\n if (map.has(url)) continue;\n if (isExternalUrl(url)) continue;\n const data = await container.readFile(url);\n if (!data) continue;\n const ext = url.slice(url.lastIndexOf('.') + 1).toLowerCase();\n const contentType = IMAGE_MIME[ext] || 'image/png';\n map.set(url, { data, contentType });\n }\n\n return map;\n}\n\n/** Container-relative path for the bundle's entry document. `mediaContainer`\n * is already scoped to the selected file's parent directory, so the bundle\n * needs the basename (\"docs/home.md\" → \"home.md\"). */\nfunction basenameForBundle(selectedFile: string): string {\n const clean = selectedFile.replace(/^\\/+/, '');\n const idx = clean.lastIndexOf('/');\n return idx === -1 ? clean : clean.slice(idx + 1);\n}\n\n/** Read a UTF-8 text document from a ContentContainer. Returns null when\n * the file is missing — preserves the bundle's \"abort with error\" contract\n * for unreachable .md links. */\nasync function readDocumentFromContainer(\n container: ContentContainer,\n path: string,\n): Promise<string | null> {\n const data = await container.readFile(path);\n if (!data) return null;\n return new TextDecoder('utf-8').decode(data);\n}\n\n/** Resolve image paths referenced by a squisq Doc to ArrayBuffers for HTML export. */\nasync function resolveDocImages(\n doc: Doc,\n container: ContentContainer,\n collectImagePaths: (doc: Doc) => Iterable<string>,\n): Promise<Map<string, ArrayBuffer>> {\n const paths = collectImagePaths(doc);\n const map = new Map<string, ArrayBuffer>();\n for (const path of paths) {\n const data = await container.readFile(path);\n if (!data) continue;\n map.set(path, data);\n }\n return map;\n}\n"],"mappings":";;;;;AASA,SAAS,qBAAqB;AAQ9B,IAAM,aAA2C;AAAA,EAC/C,MAAM;AAAA,EACN,KAAK;AAAA,EACL,MAAM;AAAA,EACN,IAAI;AAAA,EACJ,MAAM;AACR;AAGA,SAAS,aAAa,MAAY,UAAwB;AACxD,QAAM,MAAM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AC;AACjD;AAKA,eAAe,0BACb,WACA,MACwB;AACxB,QAAM,OAAO,MAAM,UAAU,SAAS,IAAI;AAC1C,MAAI,CAAC,KAAM,QAAO;AAClB,SAAO,IAAI,YAAY,OAAO,EAAE,OAAO,IAAI;AAC7C;AAGA,eAAe,iBACb,KACA,WACA,mBACmC;AACnC,QAAM,QAAQ,kBAAkB,GAAG;AACnC,QAAM,MAAM,oBAAI,IAAyB;AACzC,aAAW,QAAQ,OAAO;AACxB,UAAM,OAAO,MAAM,UAAU,SAAS,IAAI;AAC1C,QAAI,CAAC,KAAM;AACX,QAAI,IAAI,MAAM,IAAI;AAAA,EACpB;AACA,SAAO;AACT;","names":["blob","mdDoc","html","markdownDocToPlainHtml"]}
@@ -1,22 +0,0 @@
1
- /**
2
- * Dialog — shared modal primitive.
3
- *
4
- * Promotes the `db-dialog-overlay` / `db-dialog` pattern used by the
5
- * settings dialogs into a reusable component, adding aria-modal and
6
- * initial focus. Escape and (by default) backdrop clicks close it.
7
- */
8
- export interface DialogProps {
9
- title: string;
10
- onClose: () => void;
11
- /** default 380px / wide 560px / full min(1100px, 94vw) column. */
12
- size?: 'default' | 'wide' | 'full';
13
- children: React.ReactNode;
14
- /** Right-aligned action row below the body. */
15
- footer?: React.ReactNode;
16
- /** Element to focus on open; defaults to the close button. */
17
- initialFocusRef?: React.RefObject<HTMLElement | null>;
18
- /** Set false when a stray backdrop click would lose user input. */
19
- closeOnBackdrop?: boolean;
20
- }
21
- export declare function Dialog({ title, onClose, size, children, footer, initialFocusRef, closeOnBackdrop, }: DialogProps): import("react/jsx-runtime").JSX.Element;
22
- //# sourceMappingURL=Dialog.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../../src/components/Dialog.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,kEAAkE;IAClE,IAAI,CAAC,EAAE,SAAS,GAAG,MAAM,GAAG,MAAM,CAAC;IACnC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,+CAA+C;IAC/C,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,8DAA8D;IAC9D,eAAe,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IACtD,mEAAmE;IACnE,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,wBAAgB,MAAM,CAAC,EACrB,KAAK,EACL,OAAO,EACP,IAAgB,EAChB,QAAQ,EACR,MAAM,EACN,eAAe,EACf,eAAsB,GACvB,EAAE,WAAW,2CAgDb"}
@@ -1,33 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- /**
3
- * Dialog — shared modal primitive.
4
- *
5
- * Promotes the `db-dialog-overlay` / `db-dialog` pattern used by the
6
- * settings dialogs into a reusable component, adding aria-modal and
7
- * initial focus. Escape and (by default) backdrop clicks close it.
8
- */
9
- import { useCallback, useEffect, useRef } from 'react';
10
- export function Dialog({ title, onClose, size = 'default', children, footer, initialFocusRef, closeOnBackdrop = true, }) {
11
- const closeButtonRef = useRef(null);
12
- useEffect(() => {
13
- const onKey = (e) => {
14
- if (e.key === 'Escape')
15
- onClose();
16
- };
17
- window.addEventListener('keydown', onKey);
18
- return () => window.removeEventListener('keydown', onKey);
19
- }, [onClose]);
20
- useEffect(() => {
21
- const target = initialFocusRef?.current ?? closeButtonRef.current;
22
- target?.focus();
23
- // Focus only on mount — refocusing on every re-render would fight the user.
24
- // eslint-disable-next-line react-hooks/exhaustive-deps
25
- }, []);
26
- const handleBackdropClick = useCallback((e) => {
27
- if (closeOnBackdrop && e.target === e.currentTarget)
28
- onClose();
29
- }, [closeOnBackdrop, onClose]);
30
- const sizeClass = size === 'wide' ? ' db-dialog--wide' : size === 'full' ? ' db-dialog--full' : '';
31
- return (_jsx("div", { className: "db-dialog-overlay", onClick: handleBackdropClick, children: _jsxs("div", { className: `db-dialog${sizeClass}`, role: "dialog", "aria-modal": "true", "aria-label": title, children: [_jsxs("div", { className: "db-dialog-header", children: [_jsx("h2", { className: "db-dialog-title", children: title }), _jsx("button", { ref: closeButtonRef, type: "button", className: "db-dialog-close", onClick: onClose, "aria-label": "Close", children: "\u00D7" })] }), _jsx("div", { className: "db-dialog-body", children: children }), footer && _jsx("div", { className: "db-dialog-footer", children: footer })] }) }));
32
- }
33
- //# sourceMappingURL=Dialog.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Dialog.js","sourceRoot":"","sources":["../../src/components/Dialog.tsx"],"names":[],"mappings":";AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAgBvD,MAAM,UAAU,MAAM,CAAC,EACrB,KAAK,EACL,OAAO,EACP,IAAI,GAAG,SAAS,EAChB,QAAQ,EACR,MAAM,EACN,eAAe,EACf,eAAe,GAAG,IAAI,GACV;IACZ,MAAM,cAAc,GAAG,MAAM,CAAoB,IAAI,CAAC,CAAC;IAEvD,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,KAAK,GAAG,CAAC,CAAgB,EAAE,EAAE;YACjC,IAAI,CAAC,CAAC,GAAG,KAAK,QAAQ;gBAAE,OAAO,EAAE,CAAC;QACpC,CAAC,CAAC;QACF,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;QAC1C,OAAO,GAAG,EAAE,CAAC,MAAM,CAAC,mBAAmB,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;IAC5D,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IAEd,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,MAAM,GAAG,eAAe,EAAE,OAAO,IAAI,cAAc,CAAC,OAAO,CAAC;QAClE,MAAM,EAAE,KAAK,EAAE,CAAC;QA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C,KAAK,CAAC,IAAI,sBAAsB,CAAC,CAAC,CAAC,CAAC;AACpE,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,3 +0,0 @@
1
- export { useDocumentSession } from './useDocumentSession.js';
2
- export type { UseDocumentSessionResult } from './useDocumentSession.js';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,YAAY,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC"}
@@ -1,2 +0,0 @@
1
- export { useDocumentSession } from './useDocumentSession.js';
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC"}
@@ -1,16 +0,0 @@
1
- import { DocumentSession, type DocumentSessionSnapshot } from '@bendyline/docblocks/document';
2
- export interface UseDocumentSessionResult {
3
- /** Stable controller for the lifetime of the mounted shell/panel. */
4
- session: DocumentSession;
5
- /** React snapshot of dirty/saving/saved/error/conflict state. */
6
- snapshot: DocumentSessionSnapshot;
7
- }
8
- /**
9
- * React binding for the framework-neutral DocumentSession engine.
10
- *
11
- * The hook deliberately does not infer target transitions from props.
12
- * Callers must use transitionTo(), retarget(), or delete() before changing
13
- * their view state so persistence ordering remains explicit.
14
- */
15
- export declare function useDocumentSession(autoSaveDelayMs?: number): UseDocumentSessionResult;
16
- //# sourceMappingURL=useDocumentSession.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useDocumentSession.d.ts","sourceRoot":"","sources":["../../src/hooks/useDocumentSession.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,eAAe,EAEf,KAAK,uBAAuB,EAC7B,MAAM,+BAA+B,CAAC;AAEvC,MAAM,WAAW,wBAAwB;IACvC,qEAAqE;IACrE,OAAO,EAAE,eAAe,CAAC;IACzB,iEAAiE;IACjE,QAAQ,EAAE,uBAAuB,CAAC;CACnC;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,eAAe,SAAM,GAAG,wBAAwB,CAclF"}
@@ -1,18 +0,0 @@
1
- import { useState, useSyncExternalStore } from 'react';
2
- import { DocumentRecoveryJournal, DocumentSession, getDefaultDocumentRecoveryStorage, } from '@bendyline/docblocks/document';
3
- /**
4
- * React binding for the framework-neutral DocumentSession engine.
5
- *
6
- * The hook deliberately does not infer target transitions from props.
7
- * Callers must use transitionTo(), retarget(), or delete() before changing
8
- * their view state so persistence ordering remains explicit.
9
- */
10
- export function useDocumentSession(autoSaveDelayMs = 500) {
11
- const [session] = useState(() => new DocumentSession({
12
- autoSaveDelayMs,
13
- recoveryJournal: new DocumentRecoveryJournal(getDefaultDocumentRecoveryStorage()),
14
- }));
15
- const snapshot = useSyncExternalStore(session.subscribe, session.getSnapshot, session.getSnapshot);
16
- return { session, snapshot };
17
- }
18
- //# sourceMappingURL=useDocumentSession.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useDocumentSession.js","sourceRoot":"","sources":["../../src/hooks/useDocumentSession.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAC;AACvD,OAAO,EACL,uBAAuB,EACvB,eAAe,EACf,iCAAiC,GAElC,MAAM,+BAA+B,CAAC;AASvC;;;;;;GAMG;AACH,MAAM,UAAU,kBAAkB,CAAC,eAAe,GAAG,GAAG;IACtD,MAAM,CAAC,OAAO,CAAC,GAAG,QAAQ,CACxB,GAAG,EAAE,CACH,IAAI,eAAe,CAAC;QAClB,eAAe;QACf,eAAe,EAAE,IAAI,uBAAuB,CAAC,iCAAiC,EAAE,CAAC;KAClF,CAAC,CACL,CAAC;IACF,MAAM,QAAQ,GAAG,oBAAoB,CACnC,OAAO,CAAC,SAAS,EACjB,OAAO,CAAC,WAAW,EACnB,OAAO,CAAC,WAAW,CACpB,CAAC;IACF,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC;AAC/B,CAAC"}
package/dist/icons.d.ts DELETED
@@ -1,12 +0,0 @@
1
- /**
2
- * DocBlocks shell icons use the Font Awesome Free webfont bundled by
3
- * `@bendyline/squisq-editor-react/styles`. Controls provide the accessible
4
- * name, so the glyphs themselves stay decorative.
5
- */
6
- export declare function NewFileIcon(): import("react/jsx-runtime").JSX.Element;
7
- export declare function NewFolderIcon(): import("react/jsx-runtime").JSX.Element;
8
- export declare function FolderIcon(): import("react/jsx-runtime").JSX.Element;
9
- export declare function MoreIcon(): import("react/jsx-runtime").JSX.Element;
10
- export declare function WorkspaceIcon(): import("react/jsx-runtime").JSX.Element;
11
- export declare function SplitViewIcon(): import("react/jsx-runtime").JSX.Element;
12
- //# sourceMappingURL=icons.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../src/icons.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,wBAAgB,WAAW,4CAE1B;AAED,wBAAgB,aAAa,4CAE5B;AAED,wBAAgB,UAAU,4CAEzB;AAED,wBAAgB,QAAQ,4CAEvB;AAED,wBAAgB,aAAa,4CAE5B;AAED,wBAAgB,aAAa,4CAiB5B"}
package/dist/icons.js DELETED
@@ -1,28 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- /**
3
- * DocBlocks shell icons use the Font Awesome Free webfont bundled by
4
- * `@bendyline/squisq-editor-react/styles`. Controls provide the accessible
5
- * name, so the glyphs themselves stay decorative.
6
- */
7
- function FontAwesomeIcon({ icon }) {
8
- return _jsx("i", { className: icon, "aria-hidden": "true" });
9
- }
10
- export function NewFileIcon() {
11
- return _jsx(FontAwesomeIcon, { icon: "fa-solid fa-file-circle-plus" });
12
- }
13
- export function NewFolderIcon() {
14
- return _jsx(FontAwesomeIcon, { icon: "fa-solid fa-folder-plus" });
15
- }
16
- export function FolderIcon() {
17
- return _jsx(FontAwesomeIcon, { icon: "fa-solid fa-folder" });
18
- }
19
- export function MoreIcon() {
20
- return _jsx(FontAwesomeIcon, { icon: "fa-solid fa-ellipsis" });
21
- }
22
- export function WorkspaceIcon() {
23
- return _jsx(FontAwesomeIcon, { icon: "fa-solid fa-gear" });
24
- }
25
- export function SplitViewIcon() {
26
- return (_jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [_jsx("rect", { x: "1.5", y: "2.5", width: "13", height: "11", rx: "1" }), _jsx("line", { x1: "6", y1: "2.5", x2: "6", y2: "13.5" })] }));
27
- }
28
- //# sourceMappingURL=icons.js.map
package/dist/icons.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"icons.js","sourceRoot":"","sources":["../src/icons.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,SAAS,eAAe,CAAC,EAAE,IAAI,EAAoB;IACjD,OAAO,YAAG,SAAS,EAAE,IAAI,iBAAc,MAAM,GAAG,CAAC;AACnD,CAAC;AAED,MAAM,UAAU,WAAW;IACzB,OAAO,KAAC,eAAe,IAAC,IAAI,EAAC,8BAA8B,GAAG,CAAC;AACjE,CAAC;AAED,MAAM,UAAU,aAAa;IAC3B,OAAO,KAAC,eAAe,IAAC,IAAI,EAAC,yBAAyB,GAAG,CAAC;AAC5D,CAAC;AAED,MAAM,UAAU,UAAU;IACxB,OAAO,KAAC,eAAe,IAAC,IAAI,EAAC,oBAAoB,GAAG,CAAC;AACvD,CAAC;AAED,MAAM,UAAU,QAAQ;IACtB,OAAO,KAAC,eAAe,IAAC,IAAI,EAAC,sBAAsB,GAAG,CAAC;AACzD,CAAC;AAED,MAAM,UAAU,aAAa;IAC3B,OAAO,KA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,EAAE,MAAM,0BAA0B,CAAC;AAO9F,SAAS;AACT,OAAO,EACL,mBAAmB,EACnB,eAAe,EACf,qBAAqB,EACrB,SAAS,EACT,2BAA2B,EAC3B,qBAAqB,GACtB,MAAM,mBAAmB,CAAC;AAY3B,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAGjD,QAAQ;AACR,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC"}
@@ -1,18 +0,0 @@
1
- /** Appearance preferences shared by the shell and settings UI. */
2
- export type ThemePreference = 'auto' | 'light' | 'dark';
3
- export declare const ACCENT_COLORS: readonly ["brown", "green", "blue", "purple", "maroon", "orange", "gray"];
4
- export type AccentColor = (typeof ACCENT_COLORS)[number];
5
- /**
6
- * Chrome (titlebar) background per resolved theme. Keep in sync with
7
- * `--db-bg-subtle` for the default accent in styles/docblocks.css and with
8
- * the static `<meta name="theme-color">` values in the site's index.html.
9
- * The shell writes these into the theme-color metas so the installed web
10
- * app's titlebar (Window Controls Overlay caption area, Android status bar)
11
- * follows the resolved theme.
12
- */
13
- export declare const DB_CHROME_COLORS: Record<'light' | 'dark', string>;
14
- export declare function loadThemePreference(): ThemePreference;
15
- export declare function saveThemePreference(value: ThemePreference): void;
16
- export declare function loadAccentColor(): AccentColor;
17
- export declare function saveAccentColor(value: AccentColor): void;
18
- //# sourceMappingURL=theme.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/preferences/theme.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAElE,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;AAExD,eAAO,MAAM,aAAa,2EAQhB,CAAC;AAEX,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;AAEzD;;;;;;;GAOG;AACH,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,OAAO,GAAG,MAAM,EAAE,MAAM,CAG7D,CAAC;AAKF,wBAAgB,mBAAmB,IAAI,eAAe,CAQrD;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,eAAe,GAAG,IAAI,CAMhE;AAED,wBAAgB,eAAe,IAAI,WAAW,CAQ7C;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI,CAMxD"}
@@ -1,63 +0,0 @@
1
- /** Appearance preferences shared by the shell and settings UI. */
2
- export const ACCENT_COLORS = [
3
- 'brown',
4
- 'green',
5
- 'blue',
6
- 'purple',
7
- 'maroon',
8
- 'orange',
9
- 'gray',
10
- ];
11
- /**
12
- * Chrome (titlebar) background per resolved theme. Keep in sync with
13
- * `--db-bg-subtle` for the default accent in styles/docblocks.css and with
14
- * the static `<meta name="theme-color">` values in the site's index.html.
15
- * The shell writes these into the theme-color metas so the installed web
16
- * app's titlebar (Window Controls Overlay caption area, Android status bar)
17
- * follows the resolved theme.
18
- */
19
- export const DB_CHROME_COLORS = {
20
- light: '#f3eede',
21
- dark: '#262219',
22
- };
23
- const THEME_STORAGE_KEY = 'docblocks:themePreference';
24
- const ACCENT_STORAGE_KEY = 'docblocks:accentColor';
25
- export function loadThemePreference() {
26
- try {
27
- const raw = localStorage.getItem(THEME_STORAGE_KEY);
28
- if (raw === 'light' || raw === 'dark' || raw === 'auto')
29
- return raw;
30
- }
31
- catch {
32
- // ignore unavailable storage
33
- }
34
- return 'auto';
35
- }
36
- export function saveThemePreference(value) {
37
- try {
38
- localStorage.setItem(THEME_STORAGE_KEY, value);
39
- }
40
- catch {
41
- // ignore quota errors
42
- }
43
- }
44
- export function loadAccentColor() {
45
- try {
46
- const raw = localStorage.getItem(ACCENT_STORAGE_KEY);
47
- if (ACCENT_COLORS.some((color) => color === raw))
48
- return raw;
49
- }
50
- catch {
51
- // ignore unavailable storage
52
- }
53
- return 'brown';
54
- }
55
- export function saveAccentColor(value) {
56
- try {
57
- localStorage.setItem(ACCENT_STORAGE_KEY, value);
58
- }
59
- catch {
60
- // ignore quota errors
61
- }
62
- }
63
- //# sourceMappingURL=theme.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"theme.js","sourceRoot":"","sources":["../../src/preferences/theme.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAIlE,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,OAAO;IACP,OAAO;IACP,MAAM;IACN,QAAQ;IACR,QAAQ;IACR,QAAQ;IACR,MAAM;CACE,CAAC;AAIX;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAqC;IAChE,KAAK,EAAE,SAAS;IAChB,IAAI,EAAE,SAAS;CAChB,CAAC;AAEF,MAAM,iBAAiB,GAAG,2BAA2B,CAAC;AACtD,MAAM,kBAAkB,GAAG,uBAAuB,CAAC;AAEnD,MAAM,UAAU,mBAAmB;IACjC,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,YAAY,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC;QACpD,IAAI,GAAG,KAAK,OAAO,IAAI,GAAG,KAAK,MAAM,IAAI,GAAG,KAAK,MAAM;YAAE,OAAO,GAAG,CAAC;IACtE,CAAC;IAAC,MAAM,CAAC;QACP,6BAA6B;IAC/B,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,KAAsB;IACxD,IAAI,CAAC;QACH,YAAY,CAAC,OAAO,CAAC,iBAAiB,EAAE,KAAK,CAAC,CAAC;IACjD,CAAC;IAAC,MAAM,CAAC;QACP,sBAAsB;IACxB,CAAC;AACH,CAAC;AAED,MAAM,UAAU,eAAe;IAC7B,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,YAAY,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC;QACrD,IAAI,aAAa,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,GAAG,CAAC;YAAE,OAAO,GAAkB,CAAC;IAC9E,CAAC;IAAC,MAAM,CAAC;QACP,6BAA6B;IAC/B,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,KAAkB;IAChD,IAAI,CAAC;QACH,YAAY,CAAC,OAAO,CAAC,kBAAkB,EAAE,KAAK,CAAC,CAAC;IAClD,CAAC;IAAC,MAAM,CAAC;QACP,sBAAsB;IACxB,CAAC;AACH,CAAC"}
@@ -1,27 +0,0 @@
1
- /**
2
- * Versioning preferences — global default + per-workspace resolution.
3
- *
4
- * The global preference controls whether DocBlocks writes version
5
- * snapshots (under `<basename>_files/.versions/`) when editing. The
6
- * default is `'browser-only'` so local-folder workspaces stay clean by
7
- * default and only IndexedDB workspaces accumulate version history.
8
- *
9
- * Each workspace can override the global default with its own setting
10
- * stored on the WorkspaceDescriptor. `'inherit'` (or absent) defers to
11
- * the global preference; `'on'` / `'off'` force the behavior regardless.
12
- */
13
- import type { WorkspaceDescriptor } from '@bendyline/docblocks/workspace';
14
- export type VersioningPreference = 'on' | 'browser-only' | 'off';
15
- export declare function loadVersioningPreference(): VersioningPreference;
16
- export declare function saveVersioningPreference(value: VersioningPreference): void;
17
- /** Whether a workspace type is "local" (writes to a real folder on disk). */
18
- export declare function isLocalWorkspaceType(type: WorkspaceDescriptor['type']): boolean;
19
- /**
20
- * Compute the effective versioning state for a workspace, honoring the
21
- * per-workspace override first and falling back to the global preference.
22
- *
23
- * Returns `false` whenever no workspace is provided so callers can use
24
- * this directly during initial render before a workspace loads.
25
- */
26
- export declare function resolveVersioningEnabled(workspace: WorkspaceDescriptor | null, globalPref: VersioningPreference): boolean;
27
- //# sourceMappingURL=versioning.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"versioning.d.ts","sourceRoot":"","sources":["../../src/preferences/versioning.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAE1E,MAAM,MAAM,oBAAoB,GAAG,IAAI,GAAG,cAAc,GAAG,KAAK,CAAC;AAKjE,wBAAgB,wBAAwB,IAAI,oBAAoB,CAQ/D;AAED,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,oBAAoB,GAAG,IAAI,CAM1E;AAED,6EAA6E;AAC7E,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,mBAAmB,CAAC,MAAM,CAAC,GAAG,OAAO,CAE/E;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CACtC,SAAS,EAAE,mBAAmB,GAAG,IAAI,EACrC,UAAU,EAAE,oBAAoB,GAC/B,OAAO,CAeT"}
@@ -1,62 +0,0 @@
1
- /**
2
- * Versioning preferences — global default + per-workspace resolution.
3
- *
4
- * The global preference controls whether DocBlocks writes version
5
- * snapshots (under `<basename>_files/.versions/`) when editing. The
6
- * default is `'browser-only'` so local-folder workspaces stay clean by
7
- * default and only IndexedDB workspaces accumulate version history.
8
- *
9
- * Each workspace can override the global default with its own setting
10
- * stored on the WorkspaceDescriptor. `'inherit'` (or absent) defers to
11
- * the global preference; `'on'` / `'off'` force the behavior regardless.
12
- */
13
- const STORAGE_KEY = 'docblocks:versioningPreference';
14
- const DEFAULT_PREFERENCE = 'browser-only';
15
- export function loadVersioningPreference() {
16
- try {
17
- const raw = localStorage.getItem(STORAGE_KEY);
18
- if (raw === 'on' || raw === 'browser-only' || raw === 'off')
19
- return raw;
20
- }
21
- catch {
22
- // ignore
23
- }
24
- return DEFAULT_PREFERENCE;
25
- }
26
- export function saveVersioningPreference(value) {
27
- try {
28
- localStorage.setItem(STORAGE_KEY, value);
29
- }
30
- catch {
31
- // ignore quota errors
32
- }
33
- }
34
- /** Whether a workspace type is "local" (writes to a real folder on disk). */
35
- export function isLocalWorkspaceType(type) {
36
- return type === 'native' || type === 'electron-native';
37
- }
38
- /**
39
- * Compute the effective versioning state for a workspace, honoring the
40
- * per-workspace override first and falling back to the global preference.
41
- *
42
- * Returns `false` whenever no workspace is provided so callers can use
43
- * this directly during initial render before a workspace loads.
44
- */
45
- export function resolveVersioningEnabled(workspace, globalPref) {
46
- if (!workspace)
47
- return false;
48
- const override = workspace.versioningOverride;
49
- if (override === 'on')
50
- return true;
51
- if (override === 'off')
52
- return false;
53
- switch (globalPref) {
54
- case 'on':
55
- return true;
56
- case 'off':
57
- return false;
58
- case 'browser-only':
59
- return !isLocalWorkspaceType(workspace.type);
60
- }
61
- }
62
- //# sourceMappingURL=versioning.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"versioning.js","sourceRoot":"","sources":["../../src/preferences/versioning.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAMH,MAAM,WAAW,GAAG,gCAAgC,CAAC;AACrD,MAAM,kBAAkB,GAAyB,cAAc,CAAC;AAEhE,MAAM,UAAU,wBAAwB;IACtC,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,YAAY,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;QAC9C,IAAI,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,cAAc,IAAI,GAAG,KAAK,KAAK;YAAE,OAAO,GAAG,CAAC;IAC1E,CAAC;IAAC,MAAM,CAAC;QACP,SAAS;IACX,CAAC;IACD,OAAO,kBAAkB,CAAC;AAC5B,CAAC;AAED,MAAM,UAAU,wBAAwB,CAAC,KAA2B;IAClE,IAAI,CAAC;QACH,YAAY,CAAC,OAAO,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;IAC3C,CAAC;IAAC,MAAM,CAAC;QACP,sBAAsB;IACxB,CAAC;AACH,CAAC;AAED,6EAA6E;AAC7E,MAAM,UAAU,oBAAoB,CAAC,IAAiC;IACpE,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,iBAAiB,CAAC;AACzD,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,wBAAwB,CACtC,SAAqC,EACrC,UAAgC;IAEhC,IAAI,CAAC,SAAS;QAAE,OAAO,KAAK,CAAC;IAE7B,MAAM,QAAQ,GAAG,SAAS,CAAC,kBAAkB,CAAC;IAC9C,IAAI,QAAQ,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IACnC,IAAI,QAAQ,KAAK,KAAK;QAAE,OAAO,KAAK,CAAC;IAErC,QAAQ,UAAU,EAAE,CAAC;QACnB,KAAK,IAAI;YACP,OAAO,IAAI,CAAC;QACd,KAAK,KAAK;YACR,OAAO,KAAK,CAAC;QACf,KAAK,cAAc;YACjB,OAAO,CAAC,oBAAoB,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IACjD,CAAC;AACH,CAAC"}
@@ -1,10 +0,0 @@
1
- import type { FileSystemProviderV2 } from '@bendyline/docblocks/filesystem';
2
- /**
3
- * Retain one UI ownership lease for a provider.
4
- *
5
- * Final release is deferred by one microtask. React Strict Mode intentionally
6
- * performs setup → cleanup → setup, so an immediate cleanup disposer would
7
- * permanently close the provider that the second setup still owns.
8
- */
9
- export declare function retainFileSystemProvider(provider: FileSystemProviderV2): () => void;
10
- //# sourceMappingURL=provider-lease.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"provider-lease.d.ts","sourceRoot":"","sources":["../src/provider-lease.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAU5E;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,oBAAoB,GAAG,MAAM,IAAI,CAkCnF"}
@@ -1,42 +0,0 @@
1
- const leases = new WeakMap();
2
- /**
3
- * Retain one UI ownership lease for a provider.
4
- *
5
- * Final release is deferred by one microtask. React Strict Mode intentionally
6
- * performs setup → cleanup → setup, so an immediate cleanup disposer would
7
- * permanently close the provider that the second setup still owns.
8
- */
9
- export function retainFileSystemProvider(provider) {
10
- let record = leases.get(provider);
11
- if (!record) {
12
- record = { holders: 0, generation: 0, disposePromise: null };
13
- leases.set(provider, record);
14
- }
15
- if (record.disposePromise) {
16
- throw new Error('Cannot retain a filesystem provider after disposal has started.');
17
- }
18
- record.holders += 1;
19
- record.generation += 1;
20
- let released = false;
21
- return () => {
22
- if (released)
23
- return;
24
- released = true;
25
- record.holders -= 1;
26
- record.generation += 1;
27
- const releaseGeneration = record.generation;
28
- queueMicrotask(() => {
29
- if (record.holders !== 0 ||
30
- record.generation !== releaseGeneration ||
31
- record.disposePromise) {
32
- return;
33
- }
34
- record.disposePromise = provider.dispose();
35
- // React cleanup cannot await or render a disposal failure. Joiners still
36
- // receive the original promise from the provider; this observer prevents
37
- // an unhandled rejection during unmount.
38
- void record.disposePromise.catch(() => undefined);
39
- });
40
- };
41
- }
42
- //# sourceMappingURL=provider-lease.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"provider-lease.js","sourceRoot":"","sources":["../src/provider-lease.ts"],"names":[],"mappings":"AAQA,MAAM,MAAM,GAAG,IAAI,OAAO,EAA6C,CAAC;AAExE;;;;;;GAMG;AACH,MAAM,UAAU,wBAAwB,CAAC,QAA8B;IACrE,IAAI,MAAM,GAAG,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAClC,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,GAAG,EAAE,OAAO,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,cAAc,EAAE,IAAI,EAAE,CAAC;QAC7D,MAAM,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IAC/B,CAAC;IACD,IAAI,MAAM,CAAC,cAAc,EAAE,CAAC;QAC1B,MAAM,IAAI,KAAK,CAAC,iEAAiE,CAAC,CAAC;IACrF,CAAC;IAED,MAAM,CAAC,OAAO,IAAI,CAAC,CAAC;IACpB,MAAM,CAAC,UAAU,IAAI,CAAC,CAAC;IACvB,IAAI,QAAQ,GAAG,KAAK,CAAC;IACrB,OAAO,GAAG,EAAE;QACV,IAAI,QAAQ;YAAE,OAAO;QACrB,QAAQ,GAAG,IAAI,CAAC;QAChB,MAAO,CAAC,OAAO,IAAI,CAAC,CAAC;QACrB,MAAO,CAAC,UAAU,IAAI,CAAC,CAAC;QACxB,MAAM,iBAAiB,GAAG,MAAO,CAAC,UAAU,CAAC;QAC7C,cAAc,CAAC,GAAG,EAAE;YAClB,IACE,MAAO,CAAC,OAAO,KAAK,CAAC;gBACrB,MAAO,CAAC,UAAU,KAAK,iBAAiB;gBACxC,MAAO,CAAC,cAAc,EACtB,CAAC;gBACD,OAAO;YACT,CAAC;YACD,MAAO,CAAC,cAAc,GAAG,QAAQ,CAAC,OAAO,EAAE,CAAC;YAC5C,yEAAyE;YACzE,yEAAyE;YACzE,yCAAyC;YACzC,KAAK,MAAO,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;QACrD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC"}
@@ -1,10 +0,0 @@
1
- import {
2
- buildExportFilename,
3
- runExport
4
- } from "./chunk-ZI56BNB7.js";
5
- import "./chunk-DD4VFJQI.js";
6
- export {
7
- buildExportFilename,
8
- runExport
9
- };
10
- //# sourceMappingURL=run-export-ICTZITXC.js.map