@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
package/src/editor.ts DELETED
@@ -1,72 +0,0 @@
1
- /**
2
- * Placeholder prompts shown by DocBlocks when a Markdown document is empty.
3
- * Hosts pick one prompt for each mounted document generation and pass it to
4
- * Squisq, so the copy remains stable while that document is open.
5
- */
6
- export const EMPTY_DOCUMENT_PROMPTS = [
7
- 'Start typing your content, or drop images on top of me...',
8
- 'Write anything -- paste markdown, drag in images, or just start typing...',
9
- 'Type away. Markdown syntax works too...',
10
- 'Chapter 1 begins here...',
11
- 'Once upon a time...',
12
- "A blank page. Exciting, isn't it?",
13
- 'The first word is always the hardest...',
14
- 'Plot twist: this is where it all starts...',
15
- 'Write something the future you will thank you for...',
16
- 'Begin at the beginning...',
17
- "Let's begin.",
18
- 'We can be heroes...',
19
- 'Here comes the sun...',
20
- 'And so it begins...',
21
- 'Let it be, let it be...',
22
- "Don't stop believing...",
23
- 'Started from the bottom...',
24
- 'This is the start of something new...',
25
- 'Ground control to Major Tom...',
26
- 'Come as you are...',
27
- 'Every new beginning...',
28
- "Hello, is it me you're looking for?",
29
- 'Imagine all the people...',
30
- 'Anything you want, you got it...',
31
- 'Rise above...',
32
- 'Do you have the time...',
33
- 'Here we are now, entertain us...',
34
- 'All the small things...',
35
- 'Should I stay or should I go?',
36
- 'I am a patient boy -- I wait, I wait, I wait...',
37
- 'Destination unknown...',
38
- 'Easy like Sunday morning...',
39
- 'Dance, dance, dance to the radio...',
40
- 'New day rising...',
41
- 'Visit the world...',
42
- 'Positive mental attitude...',
43
- 'Better I sing than I cry...',
44
- 'Disconnect for a minute...',
45
- 'We need new noise...',
46
- 'Shoot the moon...',
47
- "I'll surprise you sometime -- I'll come around...",
48
- 'Coming out of my cage, and doing just fine...',
49
- "Throw me to the wolves -- I'll come back, leading the pack...",
50
- 'There comes a time -- no excuses...',
51
- "It's up to me now, turn on the bright lights...",
52
- 'Do what you want...',
53
- 'Fingers crossed...',
54
- 'This is the start of how it all ends...',
55
- 'It has to start somewhere, it has to start sometime -- what better place than here? what better time than now?',
56
- "I know myself, and I'll begin again...",
57
- 'Dig me out, dig me in...',
58
- "Everybody's full of sugar, honey, ice and tea...",
59
- "Take time with a wounded hand, 'cause it likes to heal...",
60
- 'Grab a brush and put on a little makeup...',
61
- 'Amber is the color of your energy...',
62
- "Wait -- they don't love it like I love it...",
63
- "A world's been buried, where love is the law; a you-topia...",
64
- ] as const;
65
-
66
- export type EmptyDocumentPrompt = (typeof EMPTY_DOCUMENT_PROMPTS)[number];
67
-
68
- /** Pick a prompt using the supplied random source, or `Math.random`. */
69
- export function pickEmptyDocumentPrompt(random: () => number = Math.random): EmptyDocumentPrompt {
70
- const index = Math.floor(random() * EMPTY_DOCUMENT_PROMPTS.length);
71
- return EMPTY_DOCUMENT_PROMPTS[index] ?? EMPTY_DOCUMENT_PROMPTS[0];
72
- }
@@ -1,2 +0,0 @@
1
- export { useDocumentSession } from './useDocumentSession.js';
2
- export type { UseDocumentSessionResult } from './useDocumentSession.js';
@@ -1,37 +0,0 @@
1
- import { useState, useSyncExternalStore } from 'react';
2
- import {
3
- DocumentRecoveryJournal,
4
- DocumentSession,
5
- getDefaultDocumentRecoveryStorage,
6
- type DocumentSessionSnapshot,
7
- } from '@bendyline/docblocks/document';
8
-
9
- export interface UseDocumentSessionResult {
10
- /** Stable controller for the lifetime of the mounted shell/panel. */
11
- session: DocumentSession;
12
- /** React snapshot of dirty/saving/saved/error/conflict state. */
13
- snapshot: DocumentSessionSnapshot;
14
- }
15
-
16
- /**
17
- * React binding for the framework-neutral DocumentSession engine.
18
- *
19
- * The hook deliberately does not infer target transitions from props.
20
- * Callers must use transitionTo(), retarget(), or delete() before changing
21
- * their view state so persistence ordering remains explicit.
22
- */
23
- export function useDocumentSession(autoSaveDelayMs = 500): UseDocumentSessionResult {
24
- const [session] = useState(
25
- () =>
26
- new DocumentSession({
27
- autoSaveDelayMs,
28
- recoveryJournal: new DocumentRecoveryJournal(getDefaultDocumentRecoveryStorage()),
29
- }),
30
- );
31
- const snapshot = useSyncExternalStore(
32
- session.subscribe,
33
- session.getSnapshot,
34
- session.getSnapshot,
35
- );
36
- return { session, snapshot };
37
- }
package/src/icons.tsx DELETED
@@ -1,48 +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
-
7
- function FontAwesomeIcon({ icon }: { icon: string }) {
8
- return <i className={icon} aria-hidden="true" />;
9
- }
10
-
11
- export function NewFileIcon() {
12
- return <FontAwesomeIcon icon="fa-solid fa-file-circle-plus" />;
13
- }
14
-
15
- export function NewFolderIcon() {
16
- return <FontAwesomeIcon icon="fa-solid fa-folder-plus" />;
17
- }
18
-
19
- export function FolderIcon() {
20
- return <FontAwesomeIcon icon="fa-solid fa-folder" />;
21
- }
22
-
23
- export function MoreIcon() {
24
- return <FontAwesomeIcon icon="fa-solid fa-ellipsis" />;
25
- }
26
-
27
- export function WorkspaceIcon() {
28
- return <FontAwesomeIcon icon="fa-solid fa-gear" />;
29
- }
30
-
31
- export function SplitViewIcon() {
32
- return (
33
- <svg
34
- width="16"
35
- height="16"
36
- viewBox="0 0 16 16"
37
- fill="none"
38
- stroke="currentColor"
39
- strokeWidth="1.5"
40
- strokeLinecap="round"
41
- strokeLinejoin="round"
42
- aria-hidden="true"
43
- >
44
- <rect x="1.5" y="2.5" width="13" height="11" rx="1" />
45
- <line x1="6" y1="2.5" x2="6" y2="13.5" />
46
- </svg>
47
- );
48
- }
package/src/index.ts DELETED
@@ -1,61 +0,0 @@
1
- /**
2
- * @bendyline/docblocks-react — React components for DocBlocks
3
- */
4
-
5
- // FileExplorer
6
- export { FileExplorer } from './FileExplorer/index.js';
7
- export type {
8
- FileExplorerProps,
9
- FileTreeChange,
10
- FileTreeMutationHandler,
11
- } from './FileExplorer/index.js';
12
- export { FileTreeNode } from './FileExplorer/index.js';
13
- export type { FileTreeNodeProps } from './FileExplorer/index.js';
14
- export { useFileTree } from './FileExplorer/index.js';
15
-
16
- // WorkspacePicker
17
- export { WorkspacePicker } from './WorkspacePicker/index.js';
18
- export type { WorkspacePickerProps } from './WorkspacePicker/index.js';
19
-
20
- // DocBlocksShell
21
- export { DocBlocksShell } from './DocBlocksShell/index.js';
22
- export type { DocBlocksShellProps } from './DocBlocksShell/index.js';
23
-
24
- // AppMenu
25
- export { AppMenu } from './AppMenu/index.js';
26
- export type { AccentColor, AppMenuProps, ThemePreference } from './AppMenu/index.js';
27
-
28
- // Settings
29
- export { AccentColorSettings, SettingsDialog, ThemeSettings } from './Settings/public-api.js';
30
- export type {
31
- AccentColorSettingsProps,
32
- SettingsDialogProps,
33
- ThemeSettingsProps,
34
- } from './Settings/public-api.js';
35
-
36
- // Export
37
- export {
38
- buildExportFilename,
39
- DEFAULT_OPTIONS,
40
- loadLastExportOptions,
41
- runExport,
42
- updateExportTargetExtension,
43
- ExportToolbarControls,
44
- } from './Export/index.js';
45
- export type {
46
- ExportDestinationControl,
47
- ExportDestinationAdapter,
48
- ExportDestinationTarget,
49
- ExportToolbarControlsProps,
50
- ExportFormat,
51
- HtmlBundle,
52
- HtmlStyle,
53
- ExportOptions,
54
- ExportBlobSaver,
55
- } from './Export/index.js';
56
- export { ExportDialog } from './Export/index.js';
57
- export type { ExportDialogProps } from './Export/index.js';
58
-
59
- // Hooks
60
- export { useDocumentSession } from './hooks/index.js';
61
- export type { UseDocumentSessionResult } from './hooks/index.js';
@@ -1,67 +0,0 @@
1
- /** Appearance preferences shared by the shell and settings UI. */
2
-
3
- export type ThemePreference = 'auto' | 'light' | 'dark';
4
-
5
- export const ACCENT_COLORS = [
6
- 'brown',
7
- 'green',
8
- 'blue',
9
- 'purple',
10
- 'maroon',
11
- 'orange',
12
- 'gray',
13
- ] as const;
14
-
15
- export type AccentColor = (typeof ACCENT_COLORS)[number];
16
-
17
- /**
18
- * Chrome (titlebar) background per resolved theme. Keep in sync with
19
- * `--db-bg-subtle` for the default accent in styles/docblocks.css and with
20
- * the static `<meta name="theme-color">` values in the site's index.html.
21
- * The shell writes these into the theme-color metas so the installed web
22
- * app's titlebar (Window Controls Overlay caption area, Android status bar)
23
- * follows the resolved theme.
24
- */
25
- export const DB_CHROME_COLORS: Record<'light' | 'dark', string> = {
26
- light: '#f3eede',
27
- dark: '#262219',
28
- };
29
-
30
- const THEME_STORAGE_KEY = 'docblocks:themePreference';
31
- const ACCENT_STORAGE_KEY = 'docblocks:accentColor';
32
-
33
- export function loadThemePreference(): ThemePreference {
34
- try {
35
- const raw = localStorage.getItem(THEME_STORAGE_KEY);
36
- if (raw === 'light' || raw === 'dark' || raw === 'auto') return raw;
37
- } catch {
38
- // ignore unavailable storage
39
- }
40
- return 'auto';
41
- }
42
-
43
- export function saveThemePreference(value: ThemePreference): void {
44
- try {
45
- localStorage.setItem(THEME_STORAGE_KEY, value);
46
- } catch {
47
- // ignore quota errors
48
- }
49
- }
50
-
51
- export function loadAccentColor(): AccentColor {
52
- try {
53
- const raw = localStorage.getItem(ACCENT_STORAGE_KEY);
54
- if (ACCENT_COLORS.some((color) => color === raw)) return raw as AccentColor;
55
- } catch {
56
- // ignore unavailable storage
57
- }
58
- return 'brown';
59
- }
60
-
61
- export function saveAccentColor(value: AccentColor): void {
62
- try {
63
- localStorage.setItem(ACCENT_STORAGE_KEY, value);
64
- } catch {
65
- // ignore quota errors
66
- }
67
- }
@@ -1,69 +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
-
14
- import type { WorkspaceDescriptor } from '@bendyline/docblocks/workspace';
15
-
16
- export type VersioningPreference = 'on' | 'browser-only' | 'off';
17
-
18
- const STORAGE_KEY = 'docblocks:versioningPreference';
19
- const DEFAULT_PREFERENCE: VersioningPreference = 'browser-only';
20
-
21
- export function loadVersioningPreference(): VersioningPreference {
22
- try {
23
- const raw = localStorage.getItem(STORAGE_KEY);
24
- if (raw === 'on' || raw === 'browser-only' || raw === 'off') return raw;
25
- } catch {
26
- // ignore
27
- }
28
- return DEFAULT_PREFERENCE;
29
- }
30
-
31
- export function saveVersioningPreference(value: VersioningPreference): void {
32
- try {
33
- localStorage.setItem(STORAGE_KEY, value);
34
- } catch {
35
- // ignore quota errors
36
- }
37
- }
38
-
39
- /** Whether a workspace type is "local" (writes to a real folder on disk). */
40
- export function isLocalWorkspaceType(type: WorkspaceDescriptor['type']): boolean {
41
- return type === 'native' || type === 'electron-native';
42
- }
43
-
44
- /**
45
- * Compute the effective versioning state for a workspace, honoring the
46
- * per-workspace override first and falling back to the global preference.
47
- *
48
- * Returns `false` whenever no workspace is provided so callers can use
49
- * this directly during initial render before a workspace loads.
50
- */
51
- export function resolveVersioningEnabled(
52
- workspace: WorkspaceDescriptor | null,
53
- globalPref: VersioningPreference,
54
- ): boolean {
55
- if (!workspace) return false;
56
-
57
- const override = workspace.versioningOverride;
58
- if (override === 'on') return true;
59
- if (override === 'off') return false;
60
-
61
- switch (globalPref) {
62
- case 'on':
63
- return true;
64
- case 'off':
65
- return false;
66
- case 'browser-only':
67
- return !isLocalWorkspaceType(workspace.type);
68
- }
69
- }
@@ -1,52 +0,0 @@
1
- import type { FileSystemProviderV2 } from '@bendyline/docblocks/filesystem';
2
-
3
- interface ProviderLeaseRecord {
4
- holders: number;
5
- generation: number;
6
- disposePromise: Promise<void> | null;
7
- }
8
-
9
- const leases = new WeakMap<FileSystemProviderV2, ProviderLeaseRecord>();
10
-
11
- /**
12
- * Retain one UI ownership lease for a provider.
13
- *
14
- * Final release is deferred by one microtask. React Strict Mode intentionally
15
- * performs setup → cleanup → setup, so an immediate cleanup disposer would
16
- * permanently close the provider that the second setup still owns.
17
- */
18
- export function retainFileSystemProvider(provider: FileSystemProviderV2): () => void {
19
- let record = leases.get(provider);
20
- if (!record) {
21
- record = { holders: 0, generation: 0, disposePromise: null };
22
- leases.set(provider, record);
23
- }
24
- if (record.disposePromise) {
25
- throw new Error('Cannot retain a filesystem provider after disposal has started.');
26
- }
27
-
28
- record.holders += 1;
29
- record.generation += 1;
30
- let released = false;
31
- return () => {
32
- if (released) return;
33
- released = true;
34
- record!.holders -= 1;
35
- record!.generation += 1;
36
- const releaseGeneration = record!.generation;
37
- queueMicrotask(() => {
38
- if (
39
- record!.holders !== 0 ||
40
- record!.generation !== releaseGeneration ||
41
- record!.disposePromise
42
- ) {
43
- return;
44
- }
45
- record!.disposePromise = provider.dispose();
46
- // React cleanup cannot await or render a disposal failure. Joiners still
47
- // receive the original promise from the provider; this observer prevents
48
- // an unhandled rejection during unmount.
49
- void record!.disposePromise.catch(() => undefined);
50
- });
51
- };
52
- }
@@ -1,31 +0,0 @@
1
- /**
2
- * Ambient declarations for PWA browser APIs that TypeScript's lib.dom does
3
- * not ship yet: the Chromium install-prompt event and the launchQueue
4
- * file-handling API. Both are Chromium-only — always feature-detect before
5
- * use; on other engines the events simply never fire and `launchQueue` is
6
- * undefined.
7
- */
8
-
9
- interface BeforeInstallPromptEvent extends Event {
10
- /** Shows the browser install prompt. Callable at most once per event. */
11
- prompt(): Promise<void>;
12
- readonly userChoice: Promise<{ outcome: 'accepted' | 'dismissed'; platform: string }>;
13
- }
14
-
15
- interface LaunchParams {
16
- readonly files: ReadonlyArray<FileSystemFileHandle>;
17
- readonly targetURL?: string;
18
- }
19
-
20
- interface LaunchQueue {
21
- setConsumer(consumer: (params: LaunchParams) => void): void;
22
- }
23
-
24
- interface Window {
25
- launchQueue?: LaunchQueue;
26
- }
27
-
28
- interface WindowEventMap {
29
- beforeinstallprompt: BeforeInstallPromptEvent;
30
- appinstalled: Event;
31
- }