@bendyline/docblocks-react 2.0.0 → 2.1.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 (300) hide show
  1. package/README.md +6 -0
  2. package/dist/{ExportDialog-MEUISWZX.js → ExportDialog-7LDIXJZ3.js} +3 -2
  3. package/dist/{ExportToolbarControls-D2YDWOXW.js → ExportToolbarControls-GHAOJMH6.js} +147 -12
  4. package/dist/ExportToolbarControls-GHAOJMH6.js.map +1 -0
  5. package/dist/{GitToolbarControl-LMIR4R7I.js → GitToolbarControl-GNMRVKWQ.js} +62 -43
  6. package/dist/GitToolbarControl-GNMRVKWQ.js.map +1 -0
  7. package/dist/{GitUI-KGF5MSNV.js → GitUI-VHOBQY43.js} +225 -140
  8. package/dist/GitUI-VHOBQY43.js.map +1 -0
  9. package/dist/ShareDialog-63ENBEDZ.js +213 -0
  10. package/dist/ShareDialog-63ENBEDZ.js.map +1 -0
  11. package/dist/chunk-57ZJJOC5.js +89 -0
  12. package/dist/chunk-57ZJJOC5.js.map +1 -0
  13. package/dist/chunk-FEWQUQML.js +256 -0
  14. package/dist/chunk-FEWQUQML.js.map +1 -0
  15. package/dist/chunk-FMGTHSTX.js +110 -0
  16. package/dist/chunk-FMGTHSTX.js.map +1 -0
  17. package/dist/chunk-UNYZQXWR.js +324 -0
  18. package/dist/chunk-UNYZQXWR.js.map +1 -0
  19. package/dist/editor.d.ts +5 -4
  20. package/dist/editor.js +8 -69
  21. package/dist/editor.js.map +1 -1
  22. package/dist/export/index.d.ts +7 -1
  23. package/dist/export/index.js +2 -1
  24. package/dist/index.d.ts +346 -21
  25. package/dist/index.js +6169 -20
  26. package/dist/index.js.map +1 -1
  27. package/dist/settings/index.d.ts +9 -1
  28. package/dist/settings/index.js +6 -4
  29. package/package.json +18 -13
  30. package/src/styles/docblocks.css +537 -26
  31. package/dist/AppMenu/AppMenu.d.ts +0 -53
  32. package/dist/AppMenu/AppMenu.d.ts.map +0 -1
  33. package/dist/AppMenu/AppMenu.js +0 -67
  34. package/dist/AppMenu/AppMenu.js.map +0 -1
  35. package/dist/AppMenu/index.d.ts +0 -3
  36. package/dist/AppMenu/index.d.ts.map +0 -1
  37. package/dist/AppMenu/index.js +0 -2
  38. package/dist/AppMenu/index.js.map +0 -1
  39. package/dist/DocBlocksShell/DocBlocksShell.d.ts +0 -49
  40. package/dist/DocBlocksShell/DocBlocksShell.d.ts.map +0 -1
  41. package/dist/DocBlocksShell/DocBlocksShell.js +0 -2730
  42. package/dist/DocBlocksShell/DocBlocksShell.js.map +0 -1
  43. package/dist/DocBlocksShell/LazyEditorShell.d.ts +0 -3
  44. package/dist/DocBlocksShell/LazyEditorShell.d.ts.map +0 -1
  45. package/dist/DocBlocksShell/LazyEditorShell.js +0 -3
  46. package/dist/DocBlocksShell/LazyEditorShell.js.map +0 -1
  47. package/dist/DocBlocksShell/UpdateAvailableNotice.d.ts +0 -13
  48. package/dist/DocBlocksShell/UpdateAvailableNotice.d.ts.map +0 -1
  49. package/dist/DocBlocksShell/UpdateAvailableNotice.js +0 -16
  50. package/dist/DocBlocksShell/UpdateAvailableNotice.js.map +0 -1
  51. package/dist/DocBlocksShell/document-title.d.ts +0 -3
  52. package/dist/DocBlocksShell/document-title.d.ts.map +0 -1
  53. package/dist/DocBlocksShell/document-title.js +0 -17
  54. package/dist/DocBlocksShell/document-title.js.map +0 -1
  55. package/dist/DocBlocksShell/index.d.ts +0 -3
  56. package/dist/DocBlocksShell/index.d.ts.map +0 -1
  57. package/dist/DocBlocksShell/index.js +0 -2
  58. package/dist/DocBlocksShell/index.js.map +0 -1
  59. package/dist/DocBlocksShell/workspace-authority-barrier.d.ts +0 -14
  60. package/dist/DocBlocksShell/workspace-authority-barrier.d.ts.map +0 -1
  61. package/dist/DocBlocksShell/workspace-authority-barrier.js +0 -23
  62. package/dist/DocBlocksShell/workspace-authority-barrier.js.map +0 -1
  63. package/dist/Export/DeferredExportToolbarControls.d.ts +0 -5
  64. package/dist/Export/DeferredExportToolbarControls.d.ts.map +0 -1
  65. package/dist/Export/DeferredExportToolbarControls.js +0 -10
  66. package/dist/Export/DeferredExportToolbarControls.js.map +0 -1
  67. package/dist/Export/ExportDialog.d.ts +0 -25
  68. package/dist/Export/ExportDialog.d.ts.map +0 -1
  69. package/dist/Export/ExportDialog.js +0 -160
  70. package/dist/Export/ExportDialog.js.map +0 -1
  71. package/dist/Export/ExportToolbarControls.d.ts +0 -37
  72. package/dist/Export/ExportToolbarControls.d.ts.map +0 -1
  73. package/dist/Export/ExportToolbarControls.js +0 -285
  74. package/dist/Export/ExportToolbarControls.js.map +0 -1
  75. package/dist/Export/export-destination.d.ts +0 -3
  76. package/dist/Export/export-destination.d.ts.map +0 -1
  77. package/dist/Export/export-destination.js +0 -32
  78. package/dist/Export/export-destination.js.map +0 -1
  79. package/dist/Export/export-options.d.ts +0 -53
  80. package/dist/Export/export-options.d.ts.map +0 -1
  81. package/dist/Export/export-options.js +0 -49
  82. package/dist/Export/export-options.js.map +0 -1
  83. package/dist/Export/index.d.ts +0 -10
  84. package/dist/Export/index.d.ts.map +0 -1
  85. package/dist/Export/index.js +0 -6
  86. package/dist/Export/index.js.map +0 -1
  87. package/dist/Export/public-api.d.ts +0 -12
  88. package/dist/Export/public-api.d.ts.map +0 -1
  89. package/dist/Export/public-api.js +0 -9
  90. package/dist/Export/public-api.js.map +0 -1
  91. package/dist/Export/run-export.d.ts +0 -10
  92. package/dist/Export/run-export.d.ts.map +0 -1
  93. package/dist/Export/run-export.js +0 -313
  94. package/dist/Export/run-export.js.map +0 -1
  95. package/dist/Export/transform-summaries.d.ts +0 -7
  96. package/dist/Export/transform-summaries.d.ts.map +0 -1
  97. package/dist/Export/transform-summaries.js +0 -6
  98. package/dist/Export/transform-summaries.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/Settings/Settings.d.ts +0 -23
  187. package/dist/Settings/Settings.d.ts.map +0 -1
  188. package/dist/Settings/Settings.js +0 -22
  189. package/dist/Settings/Settings.js.map +0 -1
  190. package/dist/Settings/public-api.d.ts +0 -3
  191. package/dist/Settings/public-api.d.ts.map +0 -1
  192. package/dist/Settings/public-api.js +0 -2
  193. package/dist/Settings/public-api.js.map +0 -1
  194. package/dist/WorkspacePicker/WorkspacePicker.d.ts +0 -22
  195. package/dist/WorkspacePicker/WorkspacePicker.d.ts.map +0 -1
  196. package/dist/WorkspacePicker/WorkspacePicker.js +0 -74
  197. package/dist/WorkspacePicker/WorkspacePicker.js.map +0 -1
  198. package/dist/WorkspacePicker/WorkspaceSettingsButton.d.ts +0 -11
  199. package/dist/WorkspacePicker/WorkspaceSettingsButton.d.ts.map +0 -1
  200. package/dist/WorkspacePicker/WorkspaceSettingsButton.js +0 -27
  201. package/dist/WorkspacePicker/WorkspaceSettingsButton.js.map +0 -1
  202. package/dist/WorkspacePicker/WorkspaceSettingsDialog.d.ts +0 -20
  203. package/dist/WorkspacePicker/WorkspaceSettingsDialog.d.ts.map +0 -1
  204. package/dist/WorkspacePicker/WorkspaceSettingsDialog.js +0 -36
  205. package/dist/WorkspacePicker/WorkspaceSettingsDialog.js.map +0 -1
  206. package/dist/WorkspacePicker/index.d.ts +0 -3
  207. package/dist/WorkspacePicker/index.d.ts.map +0 -1
  208. package/dist/WorkspacePicker/index.js +0 -2
  209. package/dist/WorkspacePicker/index.js.map +0 -1
  210. package/dist/chunk-3SAXDU2U.js +0 -157
  211. package/dist/chunk-3SAXDU2U.js.map +0 -1
  212. package/dist/chunk-AOVTHZU7.js +0 -321
  213. package/dist/chunk-AOVTHZU7.js.map +0 -1
  214. package/dist/chunk-GSNZSCIK.js +0 -55
  215. package/dist/chunk-GSNZSCIK.js.map +0 -1
  216. package/dist/components/Dialog.d.ts +0 -22
  217. package/dist/components/Dialog.d.ts.map +0 -1
  218. package/dist/components/Dialog.js +0 -33
  219. package/dist/components/Dialog.js.map +0 -1
  220. package/dist/editor.d.ts.map +0 -1
  221. package/dist/hooks/index.d.ts +0 -3
  222. package/dist/hooks/index.d.ts.map +0 -1
  223. package/dist/hooks/index.js +0 -2
  224. package/dist/hooks/index.js.map +0 -1
  225. package/dist/hooks/useDocumentSession.d.ts +0 -16
  226. package/dist/hooks/useDocumentSession.d.ts.map +0 -1
  227. package/dist/hooks/useDocumentSession.js +0 -18
  228. package/dist/hooks/useDocumentSession.js.map +0 -1
  229. package/dist/icons.d.ts +0 -12
  230. package/dist/icons.d.ts.map +0 -1
  231. package/dist/icons.js +0 -28
  232. package/dist/icons.js.map +0 -1
  233. package/dist/index.d.ts.map +0 -1
  234. package/dist/preferences/theme.d.ts +0 -18
  235. package/dist/preferences/theme.d.ts.map +0 -1
  236. package/dist/preferences/theme.js +0 -63
  237. package/dist/preferences/theme.js.map +0 -1
  238. package/dist/preferences/versioning.d.ts +0 -27
  239. package/dist/preferences/versioning.d.ts.map +0 -1
  240. package/dist/preferences/versioning.js +0 -62
  241. package/dist/preferences/versioning.js.map +0 -1
  242. package/dist/provider-lease.d.ts +0 -10
  243. package/dist/provider-lease.d.ts.map +0 -1
  244. package/dist/provider-lease.js +0 -42
  245. package/dist/provider-lease.js.map +0 -1
  246. package/src/AppMenu/AppMenu.tsx +0 -334
  247. package/src/AppMenu/index.ts +0 -2
  248. package/src/DocBlocksShell/DocBlocksShell.tsx +0 -3398
  249. package/src/DocBlocksShell/LazyEditorShell.ts +0 -2
  250. package/src/DocBlocksShell/UpdateAvailableNotice.tsx +0 -60
  251. package/src/DocBlocksShell/document-title.ts +0 -19
  252. package/src/DocBlocksShell/index.ts +0 -2
  253. package/src/DocBlocksShell/workspace-authority-barrier.ts +0 -26
  254. package/src/Export/DeferredExportToolbarControls.tsx +0 -23
  255. package/src/Export/ExportDialog.tsx +0 -437
  256. package/src/Export/ExportToolbarControls.tsx +0 -511
  257. package/src/Export/export-destination.ts +0 -30
  258. package/src/Export/export-options.ts +0 -99
  259. package/src/Export/index.ts +0 -19
  260. package/src/Export/public-api.ts +0 -17
  261. package/src/Export/run-export.ts +0 -374
  262. package/src/Export/transform-summaries.ts +0 -14
  263. package/src/FileExplorer/FileExplorer.tsx +0 -528
  264. package/src/FileExplorer/FileTreeNode.tsx +0 -306
  265. package/src/FileExplorer/index.ts +0 -5
  266. package/src/FileExplorer/useFileTree.ts +0 -352
  267. package/src/Git/GitAuthGuidanceDialog.tsx +0 -84
  268. package/src/Git/GitBranchesDialog.tsx +0 -144
  269. package/src/Git/GitCloneDialog.tsx +0 -200
  270. package/src/Git/GitCommitDialog.tsx +0 -119
  271. package/src/Git/GitConflictsDialog.tsx +0 -62
  272. package/src/Git/GitContext.tsx +0 -88
  273. package/src/Git/GitDiffDialog.tsx +0 -147
  274. package/src/Git/GitDiffView.tsx +0 -105
  275. package/src/Git/GitHistoryDialog.tsx +0 -195
  276. package/src/Git/GitStatusBar.tsx +0 -157
  277. package/src/Git/GitToolbarControl.tsx +0 -123
  278. package/src/Git/GitUI.tsx +0 -68
  279. package/src/Git/commit-selection.ts +0 -63
  280. package/src/Git/git-clone-utils.ts +0 -23
  281. package/src/Git/git-status.ts +0 -113
  282. package/src/Git/useGit.ts +0 -279
  283. package/src/Git/useGitStatus.ts +0 -78
  284. package/src/Settings/Settings.tsx +0 -118
  285. package/src/Settings/public-api.ts +0 -8
  286. package/src/WorkspacePicker/WorkspacePicker.tsx +0 -191
  287. package/src/WorkspacePicker/WorkspaceSettingsButton.tsx +0 -88
  288. package/src/WorkspacePicker/WorkspaceSettingsDialog.tsx +0 -121
  289. package/src/WorkspacePicker/index.ts +0 -2
  290. package/src/components/Dialog.tsx +0 -81
  291. package/src/editor.ts +0 -72
  292. package/src/hooks/index.ts +0 -2
  293. package/src/hooks/useDocumentSession.ts +0 -37
  294. package/src/icons.tsx +0 -48
  295. package/src/index.ts +0 -61
  296. package/src/preferences/theme.ts +0 -67
  297. package/src/preferences/versioning.ts +0 -69
  298. package/src/provider-lease.ts +0 -52
  299. package/src/types/pwa-dom.d.ts +0 -31
  300. /package/dist/{ExportDialog-MEUISWZX.js.map → ExportDialog-7LDIXJZ3.js.map} +0 -0
@@ -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,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;QAChB,4EAA4E;QAC5E,uDAAuD;IACzD,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,MAAM,mBAAmB,GAAG,WAAW,CACrC,CAAC,CAAmB,EAAE,EAAE;QACtB,IAAI,eAAe,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,aAAa;YAAE,OAAO,EAAE,CAAC;IACjE,CAAC,EACD,CAAC,eAAe,EAAE,OAAO,CAAC,CAC3B,CAAC;IAEF,MAAM,SAAS,GACb,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,EAAE,CAAC;IAEnF,OAAO,CACL,cAAK,SAAS,EAAC,mBAAmB,EAAC,OAAO,EAAE,mBAAmB,YAC7D,eAAK,SAAS,EAAE,YAAY,SAAS,EAAE,EAAE,IAAI,EAAC,QAAQ,gBAAY,MAAM,gBAAa,KAAK,aACxF,eAAK,SAAS,EAAC,kBAAkB,aAC/B,aAAI,SAAS,EAAC,iBAAiB,YAAE,KAAK,GAAM,EAC5C,iBACE,GAAG,EAAE,cAAc,EACnB,IAAI,EAAC,QAAQ,EACb,SAAS,EAAC,iBAAiB,EAC3B,OAAO,EAAE,OAAO,gBACL,OAAO,uBAGX,IACL,EACN,cAAK,SAAS,EAAC,gBAAgB,YAAE,QAAQ,GAAO,EAC/C,MAAM,IAAI,cAAK,SAAS,EAAC,kBAAkB,YAAE,MAAM,GAAO,IACvD,GACF,CACP,CAAC;AACJ,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../src/editor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,+mEA0DzB,CAAC;AAEX,MAAM,MAAM,mBAAmB,GAAG,CAAC,OAAO,sBAAsB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE1E,wEAAwE;AACxE,wBAAgB,uBAAuB,CAAC,MAAM,GAAE,MAAM,MAAoB,GAAG,mBAAmB,CAG/F"}
@@ -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,KAAC,eAAe,IAAC,IAAI,EAAC,kBAAkB,GAAG,CAAC;AACrD,CAAC;AAED,MAAM,UAAU,aAAa;IAC3B,OAAO,CACL,eACE,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,MAAM,EAAC,cAAc,EACrB,WAAW,EAAC,KAAK,EACjB,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,iBACV,MAAM,aAElB,eAAM,CAAC,EAAC,KAAK,EAAC,CAAC,EAAC,KAAK,EAAC,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,EAAE,EAAC,GAAG,GAAG,EACtD,eAAM,EAAE,EAAC,GAAG,EAAC,EAAE,EAAC,KAAK,EAAC,EAAE,EAAC,GAAG,EAAC,EAAE,EAAC,MAAM,GAAG,IACrC,CACP,CAAC;AACJ,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,YAAY,EACV,iBAAiB,EACjB,cAAc,EACd,uBAAuB,GACxB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,YAAY,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAGtD,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,YAAY,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAGvE,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,YAAY,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAGrE,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAGrF,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAC9F,YAAY,EACV,wBAAwB,EACxB,mBAAmB,EACnB,kBAAkB,GACnB,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EACL,mBAAmB,EACnB,eAAe,EACf,qBAAqB,EACrB,SAAS,EACT,2BAA2B,EAC3B,qBAAqB,GACtB,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EACV,wBAAwB,EACxB,wBAAwB,EACxB,uBAAuB,EACvB,0BAA0B,EAC1B,YAAY,EACZ,UAAU,EACV,SAAS,EACT,aAAa,EACb,eAAe,GAChB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,YAAY,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAG3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,YAAY,EAAE,wBAAwB,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"}