@bendyline/docblocks-react 1.1.2 → 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 (225) hide show
  1. package/README.md +37 -5
  2. package/dist/ExportDialog-7LDIXJZ3.js +10 -0
  3. package/dist/ExportDialog-7LDIXJZ3.js.map +1 -0
  4. package/dist/ExportToolbarControls-GHAOJMH6.js +508 -0
  5. package/dist/ExportToolbarControls-GHAOJMH6.js.map +1 -0
  6. package/dist/GitToolbarControl-GNMRVKWQ.js +136 -0
  7. package/dist/GitToolbarControl-GNMRVKWQ.js.map +1 -0
  8. package/dist/GitUI-VHOBQY43.js +1133 -0
  9. package/dist/GitUI-VHOBQY43.js.map +1 -0
  10. package/dist/LazyEditorShell-EF2BWRXU.js +6 -0
  11. package/dist/LazyEditorShell-EF2BWRXU.js.map +1 -0
  12. package/dist/ShareDialog-63ENBEDZ.js +213 -0
  13. package/dist/ShareDialog-63ENBEDZ.js.map +1 -0
  14. package/dist/chunk-4XXSWN3T.js +13 -0
  15. package/dist/chunk-4XXSWN3T.js.map +1 -0
  16. package/dist/chunk-57ZJJOC5.js +89 -0
  17. package/dist/chunk-57ZJJOC5.js.map +1 -0
  18. package/dist/chunk-5A4KEWKT.js +97 -0
  19. package/dist/chunk-5A4KEWKT.js.map +1 -0
  20. package/dist/chunk-DD4VFJQI.js +51 -0
  21. package/dist/chunk-DD4VFJQI.js.map +1 -0
  22. package/dist/chunk-FEWQUQML.js +256 -0
  23. package/dist/chunk-FEWQUQML.js.map +1 -0
  24. package/dist/chunk-FMGTHSTX.js +110 -0
  25. package/dist/chunk-FMGTHSTX.js.map +1 -0
  26. package/dist/chunk-UNYZQXWR.js +324 -0
  27. package/dist/chunk-UNYZQXWR.js.map +1 -0
  28. package/dist/chunk-VHDP4IPL.js +70 -0
  29. package/dist/chunk-VHDP4IPL.js.map +1 -0
  30. package/dist/chunk-ZI56BNB7.js +270 -0
  31. package/dist/chunk-ZI56BNB7.js.map +1 -0
  32. package/dist/editor.d.ts +11 -0
  33. package/dist/editor.js +9 -0
  34. package/dist/editor.js.map +1 -0
  35. package/dist/export/index.d.ts +93 -0
  36. package/dist/export/index.js +27 -0
  37. package/dist/export/index.js.map +1 -0
  38. package/dist/index.d.ts +346 -18
  39. package/dist/index.js +6169 -18
  40. package/dist/index.js.map +1 -1
  41. package/dist/run-export-ICTZITXC.js +10 -0
  42. package/dist/run-export-ICTZITXC.js.map +1 -0
  43. package/dist/settings/index.d.ts +36 -0
  44. package/dist/settings/index.js +14 -0
  45. package/dist/settings/index.js.map +1 -0
  46. package/package.json +33 -13
  47. package/src/styles/docblocks.css +2738 -132
  48. package/dist/AppMenu/AppMenu.d.ts +0 -26
  49. package/dist/AppMenu/AppMenu.d.ts.map +0 -1
  50. package/dist/AppMenu/AppMenu.js +0 -28
  51. package/dist/AppMenu/AppMenu.js.map +0 -1
  52. package/dist/AppMenu/index.d.ts +0 -3
  53. package/dist/AppMenu/index.d.ts.map +0 -1
  54. package/dist/AppMenu/index.js +0 -2
  55. package/dist/AppMenu/index.js.map +0 -1
  56. package/dist/DocBlocksShell/DocBlocksShell.d.ts +0 -36
  57. package/dist/DocBlocksShell/DocBlocksShell.d.ts.map +0 -1
  58. package/dist/DocBlocksShell/DocBlocksShell.js +0 -1351
  59. package/dist/DocBlocksShell/DocBlocksShell.js.map +0 -1
  60. package/dist/DocBlocksShell/index.d.ts +0 -3
  61. package/dist/DocBlocksShell/index.d.ts.map +0 -1
  62. package/dist/DocBlocksShell/index.js +0 -2
  63. package/dist/DocBlocksShell/index.js.map +0 -1
  64. package/dist/Export/ExportDialog.d.ts +0 -16
  65. package/dist/Export/ExportDialog.d.ts.map +0 -1
  66. package/dist/Export/ExportDialog.js +0 -158
  67. package/dist/Export/ExportDialog.js.map +0 -1
  68. package/dist/Export/ExportToolbarControls.d.ts +0 -17
  69. package/dist/Export/ExportToolbarControls.d.ts.map +0 -1
  70. package/dist/Export/ExportToolbarControls.js +0 -200
  71. package/dist/Export/ExportToolbarControls.js.map +0 -1
  72. package/dist/Export/export-options.d.ts +0 -53
  73. package/dist/Export/export-options.d.ts.map +0 -1
  74. package/dist/Export/export-options.js +0 -49
  75. package/dist/Export/export-options.js.map +0 -1
  76. package/dist/Export/index.d.ts +0 -6
  77. package/dist/Export/index.d.ts.map +0 -1
  78. package/dist/Export/index.js +0 -3
  79. package/dist/Export/index.js.map +0 -1
  80. package/dist/Export/run-export.d.ts +0 -8
  81. package/dist/Export/run-export.d.ts.map +0 -1
  82. package/dist/Export/run-export.js +0 -296
  83. package/dist/Export/run-export.js.map +0 -1
  84. package/dist/Export/transform-summaries.d.ts +0 -7
  85. package/dist/Export/transform-summaries.d.ts.map +0 -1
  86. package/dist/Export/transform-summaries.js +0 -6
  87. package/dist/Export/transform-summaries.js.map +0 -1
  88. package/dist/FileExplorer/FileExplorer.d.ts +0 -21
  89. package/dist/FileExplorer/FileExplorer.d.ts.map +0 -1
  90. package/dist/FileExplorer/FileExplorer.js +0 -140
  91. package/dist/FileExplorer/FileExplorer.js.map +0 -1
  92. package/dist/FileExplorer/FileTreeNode.d.ts +0 -18
  93. package/dist/FileExplorer/FileTreeNode.d.ts.map +0 -1
  94. package/dist/FileExplorer/FileTreeNode.js +0 -112
  95. package/dist/FileExplorer/FileTreeNode.js.map +0 -1
  96. package/dist/FileExplorer/index.d.ts +0 -6
  97. package/dist/FileExplorer/index.d.ts.map +0 -1
  98. package/dist/FileExplorer/index.js +0 -4
  99. package/dist/FileExplorer/index.js.map +0 -1
  100. package/dist/FileExplorer/useFileTree.d.ts +0 -35
  101. package/dist/FileExplorer/useFileTree.d.ts.map +0 -1
  102. package/dist/FileExplorer/useFileTree.js +0 -124
  103. package/dist/FileExplorer/useFileTree.js.map +0 -1
  104. package/dist/WorkspacePicker/WorkspacePicker.d.ts +0 -17
  105. package/dist/WorkspacePicker/WorkspacePicker.d.ts.map +0 -1
  106. package/dist/WorkspacePicker/WorkspacePicker.js +0 -63
  107. package/dist/WorkspacePicker/WorkspacePicker.js.map +0 -1
  108. package/dist/WorkspacePicker/WorkspaceSettingsButton.d.ts +0 -11
  109. package/dist/WorkspacePicker/WorkspaceSettingsButton.d.ts.map +0 -1
  110. package/dist/WorkspacePicker/WorkspaceSettingsButton.js +0 -27
  111. package/dist/WorkspacePicker/WorkspaceSettingsButton.js.map +0 -1
  112. package/dist/WorkspacePicker/WorkspaceSettingsDialog.d.ts +0 -20
  113. package/dist/WorkspacePicker/WorkspaceSettingsDialog.d.ts.map +0 -1
  114. package/dist/WorkspacePicker/WorkspaceSettingsDialog.js +0 -36
  115. package/dist/WorkspacePicker/WorkspaceSettingsDialog.js.map +0 -1
  116. package/dist/WorkspacePicker/index.d.ts +0 -3
  117. package/dist/WorkspacePicker/index.d.ts.map +0 -1
  118. package/dist/WorkspacePicker/index.js +0 -2
  119. package/dist/WorkspacePicker/index.js.map +0 -1
  120. package/dist/hooks/index.d.ts +0 -2
  121. package/dist/hooks/index.d.ts.map +0 -1
  122. package/dist/hooks/index.js +0 -2
  123. package/dist/hooks/index.js.map +0 -1
  124. package/dist/hooks/useAutoSave.d.ts +0 -15
  125. package/dist/hooks/useAutoSave.d.ts.map +0 -1
  126. package/dist/hooks/useAutoSave.js +0 -83
  127. package/dist/hooks/useAutoSave.js.map +0 -1
  128. package/dist/icons.d.ts +0 -7
  129. package/dist/icons.d.ts.map +0 -1
  130. package/dist/icons.js +0 -27
  131. package/dist/icons.js.map +0 -1
  132. package/dist/index.d.ts.map +0 -1
  133. package/dist/monaco-slim.d.ts +0 -19
  134. package/dist/monaco-slim.d.ts.map +0 -1
  135. package/dist/monaco-slim.js +0 -19
  136. package/dist/monaco-slim.js.map +0 -1
  137. package/dist/preferences/versioning.d.ts +0 -27
  138. package/dist/preferences/versioning.d.ts.map +0 -1
  139. package/dist/preferences/versioning.js +0 -62
  140. package/dist/preferences/versioning.js.map +0 -1
  141. package/src/AppMenu/AppMenu.tsx +0 -264
  142. package/src/AppMenu/index.ts +0 -2
  143. package/src/DocBlocksShell/DocBlocksShell.tsx +0 -1778
  144. package/src/DocBlocksShell/index.ts +0 -2
  145. package/src/Export/ExportDialog.tsx +0 -383
  146. package/src/Export/ExportToolbarControls.tsx +0 -313
  147. package/src/Export/export-options.ts +0 -99
  148. package/src/Export/index.ts +0 -5
  149. package/src/Export/run-export.ts +0 -349
  150. package/src/Export/transform-summaries.ts +0 -14
  151. package/src/FileExplorer/FileExplorer.tsx +0 -282
  152. package/src/FileExplorer/FileTreeNode.tsx +0 -214
  153. package/src/FileExplorer/index.ts +0 -5
  154. package/src/FileExplorer/useFileTree.ts +0 -178
  155. package/src/WorkspacePicker/WorkspacePicker.tsx +0 -137
  156. package/src/WorkspacePicker/WorkspaceSettingsButton.tsx +0 -88
  157. package/src/WorkspacePicker/WorkspaceSettingsDialog.tsx +0 -121
  158. package/src/WorkspacePicker/index.ts +0 -2
  159. package/src/fonts/fonts.css +0 -362
  160. package/src/fonts/licenses/LICENSE-cormorant-garamond.txt +0 -93
  161. package/src/fonts/licenses/LICENSE-crimson-text.txt +0 -93
  162. package/src/fonts/licenses/LICENSE-dm-sans.txt +0 -93
  163. package/src/fonts/licenses/LICENSE-dm-serif-display.txt +0 -93
  164. package/src/fonts/licenses/LICENSE-hanken-grotesk.txt +0 -94
  165. package/src/fonts/licenses/LICENSE-ibm-plex-sans.txt +0 -93
  166. package/src/fonts/licenses/LICENSE-inter.txt +0 -93
  167. package/src/fonts/licenses/LICENSE-jetbrains-mono.txt +0 -93
  168. package/src/fonts/licenses/LICENSE-lora.txt +0 -93
  169. package/src/fonts/licenses/LICENSE-merriweather.txt +0 -93
  170. package/src/fonts/licenses/LICENSE-oswald.txt +0 -93
  171. package/src/fonts/licenses/LICENSE-playfair-display.txt +0 -93
  172. package/src/fonts/licenses/LICENSE-pt-serif.txt +0 -93
  173. package/src/fonts/licenses/LICENSE-roboto.txt +0 -93
  174. package/src/fonts/licenses/LICENSE-source-serif-4.txt +0 -93
  175. package/src/fonts/woff2/cormorant-garamond-400.woff2 +0 -0
  176. package/src/fonts/woff2/cormorant-garamond-700.woff2 +0 -0
  177. package/src/fonts/woff2/crimson-text-400.woff2 +0 -0
  178. package/src/fonts/woff2/crimson-text-400i.woff2 +0 -0
  179. package/src/fonts/woff2/crimson-text-700.woff2 +0 -0
  180. package/src/fonts/woff2/dm-sans-400.woff2 +0 -0
  181. package/src/fonts/woff2/dm-sans-400i.woff2 +0 -0
  182. package/src/fonts/woff2/dm-sans-500.woff2 +0 -0
  183. package/src/fonts/woff2/dm-sans-700.woff2 +0 -0
  184. package/src/fonts/woff2/dm-serif-display-400.woff2 +0 -0
  185. package/src/fonts/woff2/hanken-grotesk-400.woff2 +0 -0
  186. package/src/fonts/woff2/hanken-grotesk-400i.woff2 +0 -0
  187. package/src/fonts/woff2/hanken-grotesk-500.woff2 +0 -0
  188. package/src/fonts/woff2/hanken-grotesk-600.woff2 +0 -0
  189. package/src/fonts/woff2/hanken-grotesk-700.woff2 +0 -0
  190. package/src/fonts/woff2/ibm-plex-sans-400.woff2 +0 -0
  191. package/src/fonts/woff2/ibm-plex-sans-400i.woff2 +0 -0
  192. package/src/fonts/woff2/ibm-plex-sans-500.woff2 +0 -0
  193. package/src/fonts/woff2/ibm-plex-sans-600.woff2 +0 -0
  194. package/src/fonts/woff2/ibm-plex-sans-700.woff2 +0 -0
  195. package/src/fonts/woff2/inter-400.woff2 +0 -0
  196. package/src/fonts/woff2/inter-400i.woff2 +0 -0
  197. package/src/fonts/woff2/inter-500.woff2 +0 -0
  198. package/src/fonts/woff2/inter-600.woff2 +0 -0
  199. package/src/fonts/woff2/inter-700.woff2 +0 -0
  200. package/src/fonts/woff2/jetbrains-mono-400.woff2 +0 -0
  201. package/src/fonts/woff2/jetbrains-mono-400i.woff2 +0 -0
  202. package/src/fonts/woff2/jetbrains-mono-700.woff2 +0 -0
  203. package/src/fonts/woff2/lora-400.woff2 +0 -0
  204. package/src/fonts/woff2/lora-400i.woff2 +0 -0
  205. package/src/fonts/woff2/lora-700.woff2 +0 -0
  206. package/src/fonts/woff2/merriweather-400.woff2 +0 -0
  207. package/src/fonts/woff2/merriweather-700.woff2 +0 -0
  208. package/src/fonts/woff2/oswald-400.woff2 +0 -0
  209. package/src/fonts/woff2/oswald-700.woff2 +0 -0
  210. package/src/fonts/woff2/playfair-display-400.woff2 +0 -0
  211. package/src/fonts/woff2/playfair-display-700.woff2 +0 -0
  212. package/src/fonts/woff2/pt-serif-400.woff2 +0 -0
  213. package/src/fonts/woff2/pt-serif-700.woff2 +0 -0
  214. package/src/fonts/woff2/roboto-400.woff2 +0 -0
  215. package/src/fonts/woff2/roboto-400i.woff2 +0 -0
  216. package/src/fonts/woff2/roboto-700.woff2 +0 -0
  217. package/src/fonts/woff2/source-serif-4-400.woff2 +0 -0
  218. package/src/fonts/woff2/source-serif-4-400i.woff2 +0 -0
  219. package/src/fonts/woff2/source-serif-4-700.woff2 +0 -0
  220. package/src/hooks/index.ts +0 -1
  221. package/src/hooks/useAutoSave.ts +0 -116
  222. package/src/icons.tsx +0 -70
  223. package/src/index.ts +0 -31
  224. package/src/monaco-slim.ts +0 -20
  225. package/src/preferences/versioning.ts +0 -69
@@ -1,137 +0,0 @@
1
- /**
2
- * WorkspacePicker — dropdown for switching between workspaces
3
- * (IndexedDB-based or native folder via File System Access API).
4
- */
5
-
6
- import { useState, useEffect, useCallback, useRef } from 'react';
7
- import type { WorkspaceDescriptor } from '@bendyline/docblocks/workspace';
8
- import { listWorkspaces, saveWorkspace, touchWorkspace } from '@bendyline/docblocks/workspace';
9
- import { isNativeFileSystemSupported } from '@bendyline/docblocks/filesystem';
10
- import { isElectronHost } from '@bendyline/docblocks/host';
11
-
12
- export interface WorkspacePickerProps {
13
- /** Currently active workspace id. */
14
- activeWorkspaceId: string | null;
15
- /** Called when the user picks a different workspace. */
16
- onSelect: (descriptor: WorkspaceDescriptor) => void;
17
- /** Called when the user chooses "Open Folder" (native FS). */
18
- onOpenFolder: () => void;
19
- /** Optional className. */
20
- className?: string;
21
- }
22
-
23
- export function WorkspacePicker({
24
- activeWorkspaceId,
25
- onSelect,
26
- onOpenFolder,
27
- className,
28
- }: WorkspacePickerProps) {
29
- const [workspaces, setWorkspaces] = useState<WorkspaceDescriptor[]>([]);
30
- const [isOpen, setIsOpen] = useState(false);
31
- const pickerRef = useRef<HTMLDivElement>(null);
32
-
33
- // Close dropdown on outside click
34
- useEffect(() => {
35
- if (!isOpen) return;
36
- function handleOutsideClick(e: MouseEvent) {
37
- if (pickerRef.current && !pickerRef.current.contains(e.target as Node)) {
38
- setIsOpen(false);
39
- }
40
- }
41
- document.addEventListener('mousedown', handleOutsideClick);
42
- return () => document.removeEventListener('mousedown', handleOutsideClick);
43
- }, [isOpen]);
44
-
45
- const electron = isElectronHost();
46
-
47
- const refresh = useCallback(async () => {
48
- const list = await listWorkspaces();
49
- // On desktop, hide web-only workspaces (indexeddb/native).
50
- const filtered = electron
51
- ? list.filter((w) => w.type === 'electron-native')
52
- : list.filter((w) => w.type !== 'electron-native');
53
- setWorkspaces(filtered);
54
- }, [electron]);
55
-
56
- useEffect(() => {
57
- refresh();
58
- }, [refresh, activeWorkspaceId]);
59
-
60
- const handleSelect = useCallback(
61
- async (ws: WorkspaceDescriptor) => {
62
- await touchWorkspace(ws.id);
63
- onSelect(ws);
64
- setIsOpen(false);
65
- },
66
- [onSelect],
67
- );
68
-
69
- const handleCreateNew = useCallback(async () => {
70
- const name = `Workspace ${workspaces.length + 1}`;
71
- const id = `ws-${Date.now()}`;
72
- const descriptor: WorkspaceDescriptor = {
73
- id,
74
- name,
75
- type: 'indexeddb',
76
- lastOpened: new Date().toISOString(),
77
- };
78
- await saveWorkspace(descriptor);
79
- await refresh();
80
- onSelect(descriptor);
81
- setIsOpen(false);
82
- }, [workspaces.length, onSelect, refresh]);
83
-
84
- const activeWs = workspaces.find((w) => w.id === activeWorkspaceId);
85
-
86
- return (
87
- <div ref={pickerRef} className={`db-workspace-picker ${className ?? ''}`}>
88
- <button
89
- className="db-workspace-picker-btn"
90
- onClick={() => setIsOpen(!isOpen)}
91
- title="Switch workspace"
92
- >
93
- {activeWs?.name ?? 'No workspace'}
94
- <span className="db-workspace-picker-caret">{isOpen ? '\u25B4' : '\u25BE'}</span>
95
- </button>
96
-
97
- {isOpen && (
98
- <div className="db-workspace-dropdown">
99
- {workspaces.map((ws) => (
100
- <button
101
- key={ws.id}
102
- className={`db-workspace-dropdown-item ${
103
- ws.id === activeWorkspaceId ? 'db-workspace-dropdown-item--active' : ''
104
- }`}
105
- onClick={() => handleSelect(ws)}
106
- >
107
- {ws.name}
108
- <span className="db-workspace-type">
109
- {ws.type === 'native' || ws.type === 'electron-native' ? '(folder)' : ''}
110
- </span>
111
- </button>
112
- ))}
113
-
114
- <div className="db-workspace-dropdown-divider" />
115
-
116
- {!electron && (
117
- <button className="db-workspace-dropdown-item" onClick={handleCreateNew}>
118
- + New Workspace
119
- </button>
120
- )}
121
-
122
- {(electron || isNativeFileSystemSupported()) && (
123
- <button
124
- className="db-workspace-dropdown-item"
125
- onClick={() => {
126
- setIsOpen(false);
127
- onOpenFolder();
128
- }}
129
- >
130
- Open Folder...
131
- </button>
132
- )}
133
- </div>
134
- )}
135
- </div>
136
- );
137
- }
@@ -1,88 +0,0 @@
1
- /**
2
- * WorkspaceSettingsButton — gear icon dropdown for workspace actions.
3
- */
4
-
5
- import { useState, useCallback, useRef, useEffect } from 'react';
6
- import { WorkspaceIcon } from '../icons.js';
7
-
8
- export interface WorkspaceSettingsButtonProps {
9
- onSettings: () => void;
10
- onRename: () => void;
11
- onDownload: () => void;
12
- onRemove: () => void;
13
- }
14
-
15
- export function WorkspaceSettingsButton({
16
- onSettings,
17
- onRename,
18
- onDownload,
19
- onRemove,
20
- }: WorkspaceSettingsButtonProps) {
21
- const [isOpen, setIsOpen] = useState(false);
22
- const ref = useRef<HTMLDivElement>(null);
23
-
24
- useEffect(() => {
25
- if (!isOpen) return;
26
- function handleOutsideClick(e: MouseEvent) {
27
- if (ref.current && !ref.current.contains(e.target as Node)) {
28
- setIsOpen(false);
29
- }
30
- }
31
- document.addEventListener('mousedown', handleOutsideClick);
32
- return () => document.removeEventListener('mousedown', handleOutsideClick);
33
- }, [isOpen]);
34
-
35
- const handleAction = useCallback((action: () => void) => {
36
- setIsOpen(false);
37
- action();
38
- }, []);
39
-
40
- return (
41
- <div ref={ref} className="db-ws-settings">
42
- <button
43
- className="db-ws-settings-btn"
44
- onClick={() => setIsOpen(!isOpen)}
45
- aria-expanded={isOpen}
46
- aria-haspopup="true"
47
- aria-label="Workspace settings"
48
- title="Workspace settings"
49
- >
50
- <WorkspaceIcon />
51
- </button>
52
-
53
- {isOpen && (
54
- <div className="db-ws-settings-dropdown" role="menu">
55
- <button
56
- className="db-ws-settings-item"
57
- role="menuitem"
58
- onClick={() => handleAction(onSettings)}
59
- >
60
- Workspace settings…
61
- </button>
62
- <button
63
- className="db-ws-settings-item"
64
- role="menuitem"
65
- onClick={() => handleAction(onRename)}
66
- >
67
- Rename workspace
68
- </button>
69
- <button
70
- className="db-ws-settings-item"
71
- role="menuitem"
72
- onClick={() => handleAction(onDownload)}
73
- >
74
- Download workspace
75
- </button>
76
- <div className="db-ws-settings-divider" />
77
- <button
78
- className="db-ws-settings-item db-ws-settings-item--danger"
79
- role="menuitem"
80
- onClick={() => handleAction(onRemove)}
81
- >
82
- Remove workspace
83
- </button>
84
- </div>
85
- )}
86
- </div>
87
- );
88
- }
@@ -1,121 +0,0 @@
1
- /**
2
- * WorkspaceSettingsDialog — per-workspace settings modal.
3
- *
4
- * Lets the user override the global versioning preference for a single
5
- * workspace (or fall back to inheriting it). The override is stored on
6
- * the WorkspaceDescriptor and persisted via `saveWorkspace`.
7
- */
8
-
9
- import { useCallback, useEffect } from 'react';
10
- import type { WorkspaceDescriptor } from '@bendyline/docblocks/workspace';
11
- import {
12
- isLocalWorkspaceType,
13
- resolveVersioningEnabled,
14
- type VersioningPreference,
15
- } from '../preferences/versioning.js';
16
-
17
- export type WorkspaceVersioningOverride = NonNullable<WorkspaceDescriptor['versioningOverride']>;
18
-
19
- export interface WorkspaceSettingsDialogProps {
20
- workspace: WorkspaceDescriptor;
21
- /** Current global versioning preference — used to label "Inherit". */
22
- globalVersioningPreference: VersioningPreference;
23
- /** Apply a new override and close the dialog. */
24
- onChange: (override: WorkspaceVersioningOverride) => void;
25
- onClose: () => void;
26
- }
27
-
28
- const VERSIONING_LABELS: Record<VersioningPreference, string> = {
29
- on: 'on',
30
- 'browser-only': 'on for browser workspaces, off for local folders',
31
- off: 'off',
32
- };
33
-
34
- export function WorkspaceSettingsDialog({
35
- workspace,
36
- globalVersioningPreference,
37
- onChange,
38
- onClose,
39
- }: WorkspaceSettingsDialogProps) {
40
- // Treat absent/undefined as 'inherit' for the radio state.
41
- const current: WorkspaceVersioningOverride = workspace.versioningOverride ?? 'inherit';
42
-
43
- useEffect(() => {
44
- const onKey = (e: KeyboardEvent) => {
45
- if (e.key === 'Escape') onClose();
46
- };
47
- window.addEventListener('keydown', onKey);
48
- return () => window.removeEventListener('keydown', onKey);
49
- }, [onClose]);
50
-
51
- const handleBackdropClick = useCallback(
52
- (e: React.MouseEvent) => {
53
- if (e.target === e.currentTarget) onClose();
54
- },
55
- [onClose],
56
- );
57
-
58
- const isLocal = isLocalWorkspaceType(workspace.type);
59
- const inheritedEnabled = resolveVersioningEnabled(
60
- { ...workspace, versioningOverride: 'inherit' },
61
- globalVersioningPreference,
62
- );
63
- const inheritLabel = `Inherit default — currently ${VERSIONING_LABELS[globalVersioningPreference]} (${inheritedEnabled ? 'on' : 'off'} for this workspace)`;
64
-
65
- return (
66
- <div className="db-dialog-overlay" onClick={handleBackdropClick}>
67
- <div className="db-dialog" role="dialog" aria-label="Workspace settings">
68
- <div className="db-dialog-header">
69
- <h2 className="db-dialog-title">Workspace settings</h2>
70
- <button type="button" className="db-dialog-close" onClick={onClose} aria-label="Close">
71
- &times;
72
- </button>
73
- </div>
74
- <div className="db-dialog-body">
75
- <p className="db-settings-hint">
76
- <strong>{workspace.name}</strong> &middot;{' '}
77
- {isLocal ? 'Local folder workspace' : 'Browser workspace'}
78
- </p>
79
-
80
- <fieldset className="db-settings-fieldset">
81
- <legend className="db-settings-legend">Version history</legend>
82
- <p className="db-settings-hint">
83
- Controls whether DocBlocks keeps prior revisions in{' '}
84
- <code>&lt;name&gt;_files/.versions/</code> for documents in this workspace.
85
- </p>
86
- <label className="db-settings-radio">
87
- <input
88
- type="radio"
89
- name="ws-versioning"
90
- value="inherit"
91
- checked={current === 'inherit'}
92
- onChange={() => onChange('inherit')}
93
- />
94
- {inheritLabel}
95
- </label>
96
- <label className="db-settings-radio">
97
- <input
98
- type="radio"
99
- name="ws-versioning"
100
- value="on"
101
- checked={current === 'on'}
102
- onChange={() => onChange('on')}
103
- />
104
- On for this workspace
105
- </label>
106
- <label className="db-settings-radio">
107
- <input
108
- type="radio"
109
- name="ws-versioning"
110
- value="off"
111
- checked={current === 'off'}
112
- onChange={() => onChange('off')}
113
- />
114
- Off for this workspace
115
- </label>
116
- </fieldset>
117
- </div>
118
- </div>
119
- </div>
120
- );
121
- }
@@ -1,2 +0,0 @@
1
- export { WorkspacePicker } from './WorkspacePicker.js';
2
- export type { WorkspacePickerProps } from './WorkspacePicker.js';
@@ -1,362 +0,0 @@
1
- /* Google Fonts - Latin subset, self-hosted WOFF2 */
2
- /* See licenses/ directory for individual font licenses */
3
-
4
- @font-face {
5
- font-family: 'Playfair Display';
6
- font-style: normal;
7
- font-weight: 400;
8
- font-display: swap;
9
- src: url('./woff2/playfair-display-400.woff2') format('woff2');
10
- }
11
-
12
- @font-face {
13
- font-family: 'Playfair Display';
14
- font-style: normal;
15
- font-weight: 700;
16
- font-display: swap;
17
- src: url('./woff2/playfair-display-700.woff2') format('woff2');
18
- }
19
-
20
- @font-face {
21
- font-family: 'Oswald';
22
- font-style: normal;
23
- font-weight: 400;
24
- font-display: swap;
25
- src: url('./woff2/oswald-400.woff2') format('woff2');
26
- }
27
-
28
- @font-face {
29
- font-family: 'Oswald';
30
- font-style: normal;
31
- font-weight: 700;
32
- font-display: swap;
33
- src: url('./woff2/oswald-700.woff2') format('woff2');
34
- }
35
-
36
- @font-face {
37
- font-family: 'Merriweather';
38
- font-style: normal;
39
- font-weight: 400;
40
- font-display: swap;
41
- src: url('./woff2/merriweather-400.woff2') format('woff2');
42
- }
43
-
44
- @font-face {
45
- font-family: 'Merriweather';
46
- font-style: normal;
47
- font-weight: 700;
48
- font-display: swap;
49
- src: url('./woff2/merriweather-700.woff2') format('woff2');
50
- }
51
-
52
- @font-face {
53
- font-family: 'DM Serif Display';
54
- font-style: normal;
55
- font-weight: 400;
56
- font-display: swap;
57
- src: url('./woff2/dm-serif-display-400.woff2') format('woff2');
58
- }
59
-
60
- @font-face {
61
- font-family: 'Cormorant Garamond';
62
- font-style: normal;
63
- font-weight: 400;
64
- font-display: swap;
65
- src: url('./woff2/cormorant-garamond-400.woff2') format('woff2');
66
- }
67
-
68
- @font-face {
69
- font-family: 'Cormorant Garamond';
70
- font-style: normal;
71
- font-weight: 700;
72
- font-display: swap;
73
- src: url('./woff2/cormorant-garamond-700.woff2') format('woff2');
74
- }
75
-
76
- @font-face {
77
- font-family: 'PT Serif';
78
- font-style: normal;
79
- font-weight: 400;
80
- font-display: swap;
81
- src: url('./woff2/pt-serif-400.woff2') format('woff2');
82
- }
83
-
84
- @font-face {
85
- font-family: 'PT Serif';
86
- font-style: normal;
87
- font-weight: 700;
88
- font-display: swap;
89
- src: url('./woff2/pt-serif-700.woff2') format('woff2');
90
- }
91
-
92
- @font-face {
93
- font-family: 'Source Serif 4';
94
- font-style: italic;
95
- font-weight: 400;
96
- font-display: swap;
97
- src: url('./woff2/source-serif-4-400i.woff2') format('woff2');
98
- }
99
-
100
- @font-face {
101
- font-family: 'Source Serif 4';
102
- font-style: normal;
103
- font-weight: 400;
104
- font-display: swap;
105
- src: url('./woff2/source-serif-4-400.woff2') format('woff2');
106
- }
107
-
108
- @font-face {
109
- font-family: 'Source Serif 4';
110
- font-style: normal;
111
- font-weight: 700;
112
- font-display: swap;
113
- src: url('./woff2/source-serif-4-700.woff2') format('woff2');
114
- }
115
-
116
- @font-face {
117
- font-family: 'Roboto';
118
- font-style: italic;
119
- font-weight: 400;
120
- font-display: swap;
121
- src: url('./woff2/roboto-400i.woff2') format('woff2');
122
- }
123
-
124
- @font-face {
125
- font-family: 'Roboto';
126
- font-style: normal;
127
- font-weight: 400;
128
- font-display: swap;
129
- src: url('./woff2/roboto-400.woff2') format('woff2');
130
- }
131
-
132
- @font-face {
133
- font-family: 'Roboto';
134
- font-style: normal;
135
- font-weight: 700;
136
- font-display: swap;
137
- src: url('./woff2/roboto-700.woff2') format('woff2');
138
- }
139
-
140
- @font-face {
141
- font-family: 'Lora';
142
- font-style: italic;
143
- font-weight: 400;
144
- font-display: swap;
145
- src: url('./woff2/lora-400i.woff2') format('woff2');
146
- }
147
-
148
- @font-face {
149
- font-family: 'Lora';
150
- font-style: normal;
151
- font-weight: 400;
152
- font-display: swap;
153
- src: url('./woff2/lora-400.woff2') format('woff2');
154
- }
155
-
156
- @font-face {
157
- font-family: 'Lora';
158
- font-style: normal;
159
- font-weight: 700;
160
- font-display: swap;
161
- src: url('./woff2/lora-700.woff2') format('woff2');
162
- }
163
-
164
- @font-face {
165
- font-family: 'IBM Plex Sans';
166
- font-style: italic;
167
- font-weight: 400;
168
- font-display: swap;
169
- src: url('./woff2/ibm-plex-sans-400i.woff2') format('woff2');
170
- }
171
-
172
- @font-face {
173
- font-family: 'IBM Plex Sans';
174
- font-style: normal;
175
- font-weight: 400;
176
- font-display: swap;
177
- src: url('./woff2/ibm-plex-sans-400.woff2') format('woff2');
178
- }
179
-
180
- @font-face {
181
- font-family: 'IBM Plex Sans';
182
- font-style: normal;
183
- font-weight: 500;
184
- font-display: swap;
185
- src: url('./woff2/ibm-plex-sans-500.woff2') format('woff2');
186
- }
187
-
188
- @font-face {
189
- font-family: 'IBM Plex Sans';
190
- font-style: normal;
191
- font-weight: 600;
192
- font-display: swap;
193
- src: url('./woff2/ibm-plex-sans-600.woff2') format('woff2');
194
- }
195
-
196
- @font-face {
197
- font-family: 'IBM Plex Sans';
198
- font-style: normal;
199
- font-weight: 700;
200
- font-display: swap;
201
- src: url('./woff2/ibm-plex-sans-700.woff2') format('woff2');
202
- }
203
-
204
- @font-face {
205
- font-family: 'DM Sans';
206
- font-style: italic;
207
- font-weight: 400;
208
- font-display: swap;
209
- src: url('./woff2/dm-sans-400i.woff2') format('woff2');
210
- }
211
-
212
- @font-face {
213
- font-family: 'DM Sans';
214
- font-style: normal;
215
- font-weight: 400;
216
- font-display: swap;
217
- src: url('./woff2/dm-sans-400.woff2') format('woff2');
218
- }
219
-
220
- @font-face {
221
- font-family: 'DM Sans';
222
- font-style: normal;
223
- font-weight: 500;
224
- font-display: swap;
225
- src: url('./woff2/dm-sans-500.woff2') format('woff2');
226
- }
227
-
228
- @font-face {
229
- font-family: 'DM Sans';
230
- font-style: normal;
231
- font-weight: 700;
232
- font-display: swap;
233
- src: url('./woff2/dm-sans-700.woff2') format('woff2');
234
- }
235
-
236
- @font-face {
237
- font-family: 'Crimson Text';
238
- font-style: italic;
239
- font-weight: 400;
240
- font-display: swap;
241
- src: url('./woff2/crimson-text-400i.woff2') format('woff2');
242
- }
243
-
244
- @font-face {
245
- font-family: 'Crimson Text';
246
- font-style: normal;
247
- font-weight: 400;
248
- font-display: swap;
249
- src: url('./woff2/crimson-text-400.woff2') format('woff2');
250
- }
251
-
252
- @font-face {
253
- font-family: 'Crimson Text';
254
- font-style: normal;
255
- font-weight: 700;
256
- font-display: swap;
257
- src: url('./woff2/crimson-text-700.woff2') format('woff2');
258
- }
259
-
260
- @font-face {
261
- font-family: 'Hanken Grotesk';
262
- font-style: italic;
263
- font-weight: 400;
264
- font-display: swap;
265
- src: url('./woff2/hanken-grotesk-400i.woff2') format('woff2');
266
- }
267
-
268
- @font-face {
269
- font-family: 'Hanken Grotesk';
270
- font-style: normal;
271
- font-weight: 400;
272
- font-display: swap;
273
- src: url('./woff2/hanken-grotesk-400.woff2') format('woff2');
274
- }
275
-
276
- @font-face {
277
- font-family: 'Hanken Grotesk';
278
- font-style: normal;
279
- font-weight: 500;
280
- font-display: swap;
281
- src: url('./woff2/hanken-grotesk-500.woff2') format('woff2');
282
- }
283
-
284
- @font-face {
285
- font-family: 'Hanken Grotesk';
286
- font-style: normal;
287
- font-weight: 600;
288
- font-display: swap;
289
- src: url('./woff2/hanken-grotesk-600.woff2') format('woff2');
290
- }
291
-
292
- @font-face {
293
- font-family: 'Hanken Grotesk';
294
- font-style: normal;
295
- font-weight: 700;
296
- font-display: swap;
297
- src: url('./woff2/hanken-grotesk-700.woff2') format('woff2');
298
- }
299
-
300
- @font-face {
301
- font-family: 'Inter';
302
- font-style: italic;
303
- font-weight: 400;
304
- font-display: swap;
305
- src: url('./woff2/inter-400i.woff2') format('woff2');
306
- }
307
-
308
- @font-face {
309
- font-family: 'Inter';
310
- font-style: normal;
311
- font-weight: 400;
312
- font-display: swap;
313
- src: url('./woff2/inter-400.woff2') format('woff2');
314
- }
315
-
316
- @font-face {
317
- font-family: 'Inter';
318
- font-style: normal;
319
- font-weight: 500;
320
- font-display: swap;
321
- src: url('./woff2/inter-500.woff2') format('woff2');
322
- }
323
-
324
- @font-face {
325
- font-family: 'Inter';
326
- font-style: normal;
327
- font-weight: 600;
328
- font-display: swap;
329
- src: url('./woff2/inter-600.woff2') format('woff2');
330
- }
331
-
332
- @font-face {
333
- font-family: 'Inter';
334
- font-style: normal;
335
- font-weight: 700;
336
- font-display: swap;
337
- src: url('./woff2/inter-700.woff2') format('woff2');
338
- }
339
-
340
- @font-face {
341
- font-family: 'JetBrains Mono';
342
- font-style: italic;
343
- font-weight: 400;
344
- font-display: swap;
345
- src: url('./woff2/jetbrains-mono-400i.woff2') format('woff2');
346
- }
347
-
348
- @font-face {
349
- font-family: 'JetBrains Mono';
350
- font-style: normal;
351
- font-weight: 400;
352
- font-display: swap;
353
- src: url('./woff2/jetbrains-mono-400.woff2') format('woff2');
354
- }
355
-
356
- @font-face {
357
- font-family: 'JetBrains Mono';
358
- font-style: normal;
359
- font-weight: 700;
360
- font-display: swap;
361
- src: url('./woff2/jetbrains-mono-700.woff2') format('woff2');
362
- }