@rightkit/document-workspace 0.0.0-stage → 0.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 (262) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/LICENSE-APACHE +201 -0
  3. package/LICENSE-MIT +21 -0
  4. package/README.md +51 -2
  5. package/dist/app/App.d.ts +1 -0
  6. package/dist/app/App.js +6 -0
  7. package/dist/app/AppDialogs.d.ts +52 -0
  8. package/dist/app/AppDialogs.js +23 -0
  9. package/dist/app/AppDialogsHost.d.ts +31 -0
  10. package/dist/app/AppDialogsHost.js +30 -0
  11. package/dist/app/AppLifecycle.d.ts +19 -0
  12. package/dist/app/AppLifecycle.js +87 -0
  13. package/dist/app/AppProvider.d.ts +317 -0
  14. package/dist/app/AppProvider.js +217 -0
  15. package/dist/app/AppRoot.d.ts +8 -0
  16. package/dist/app/AppRoot.js +159 -0
  17. package/dist/app/AppShell.d.ts +2 -0
  18. package/dist/app/AppShell.js +81 -0
  19. package/dist/app/CommandPalette.d.ts +13 -0
  20. package/dist/app/CommandPalette.js +47 -0
  21. package/dist/app/DocActionBar.d.ts +36 -0
  22. package/dist/app/DocActionBar.js +300 -0
  23. package/dist/app/DocumentContextMenu.d.ts +29 -0
  24. package/dist/app/DocumentContextMenu.js +122 -0
  25. package/dist/app/DocumentPane.d.ts +52 -0
  26. package/dist/app/DocumentPane.js +30 -0
  27. package/dist/app/DocumentRouterTable.d.ts +58 -0
  28. package/dist/app/DocumentRouterTable.js +143 -0
  29. package/dist/app/ErrorBoundary.d.ts +12 -0
  30. package/dist/app/ErrorBoundary.js +16 -0
  31. package/dist/app/FindBar.d.ts +12 -0
  32. package/dist/app/FindBar.js +199 -0
  33. package/dist/app/LiveTitle.d.ts +14 -0
  34. package/dist/app/LiveTitle.js +14 -0
  35. package/dist/app/OpeningProgress.d.ts +13 -0
  36. package/dist/app/OpeningProgress.js +21 -0
  37. package/dist/app/PrintPreviewWindow.d.ts +2 -0
  38. package/dist/app/PrintPreviewWindow.js +57 -0
  39. package/dist/app/ShortcutHelp.d.ts +3 -0
  40. package/dist/app/ShortcutHelp.js +99 -0
  41. package/dist/app/Sidebar.d.ts +36 -0
  42. package/dist/app/Sidebar.js +121 -0
  43. package/dist/app/ToastViewport.d.ts +1 -0
  44. package/dist/app/ToastViewport.js +31 -0
  45. package/dist/app/Toolbar.d.ts +26 -0
  46. package/dist/app/Toolbar.js +63 -0
  47. package/dist/app/activeFormatSavers.d.ts +7 -0
  48. package/dist/app/activeFormatSavers.js +4 -0
  49. package/dist/app/clipboardPaths.d.ts +1 -0
  50. package/dist/app/clipboardPaths.js +31 -0
  51. package/dist/app/documentDrafts.d.ts +17 -0
  52. package/dist/app/documentDrafts.js +104 -0
  53. package/dist/app/draftResolution.d.ts +5 -0
  54. package/dist/app/draftResolution.js +25 -0
  55. package/dist/app/markdownPaletteActions.d.ts +8 -0
  56. package/dist/app/markdownPaletteActions.js +107 -0
  57. package/dist/app/resourceCensusDev.d.ts +41 -0
  58. package/dist/app/resourceCensusDev.js +518 -0
  59. package/dist/app/setupRecovery.d.ts +34 -0
  60. package/dist/app/setupRecovery.js +70 -0
  61. package/dist/app/shell/DocStatsPill.d.ts +18 -0
  62. package/dist/app/shell/DocStatsPill.js +32 -0
  63. package/dist/app/shell/DocumentTools.d.ts +9 -0
  64. package/dist/app/shell/DocumentTools.js +73 -0
  65. package/dist/app/shell/InfoInspector.d.ts +9 -0
  66. package/dist/app/shell/InfoInspector.js +67 -0
  67. package/dist/app/shell/StartPage.d.ts +9 -0
  68. package/dist/app/shell/StartPage.js +49 -0
  69. package/dist/app/shell/readEdit.d.ts +6 -0
  70. package/dist/app/shell/readEdit.js +6 -0
  71. package/dist/app/sidebar/SidebarDocumentMenu.d.ts +20 -0
  72. package/dist/app/sidebar/SidebarDocumentMenu.js +56 -0
  73. package/dist/app/sidebar/SidebarExpandedPanel.d.ts +9 -0
  74. package/dist/app/sidebar/SidebarExpandedPanel.js +78 -0
  75. package/dist/app/sidebar/SidebarIcons.d.ts +3 -0
  76. package/dist/app/sidebar/SidebarIcons.js +18 -0
  77. package/dist/app/sidebar/SidebarMenus.d.ts +19 -0
  78. package/dist/app/sidebar/SidebarMenus.js +64 -0
  79. package/dist/app/sidebar/SidebarPathUtils.d.ts +10 -0
  80. package/dist/app/sidebar/SidebarPathUtils.js +55 -0
  81. package/dist/app/sidebar/SidebarPrimitives.d.ts +12 -0
  82. package/dist/app/sidebar/SidebarPrimitives.js +45 -0
  83. package/dist/app/sidebar/SidebarRail.d.ts +5 -0
  84. package/dist/app/sidebar/SidebarRail.js +37 -0
  85. package/dist/app/sidebar/explorer/ExplorerRowMenu.d.ts +21 -0
  86. package/dist/app/sidebar/explorer/ExplorerRowMenu.js +37 -0
  87. package/dist/app/sidebar/explorer/ExplorerSections.d.ts +16 -0
  88. package/dist/app/sidebar/explorer/ExplorerSections.js +259 -0
  89. package/dist/app/sidebar/explorer/ExplorerTree.d.ts +46 -0
  90. package/dist/app/sidebar/explorer/ExplorerTree.js +387 -0
  91. package/dist/app/sidebar/explorer/explorerState.d.ts +37 -0
  92. package/dist/app/sidebar/explorer/explorerState.js +135 -0
  93. package/dist/app/tabMountPolicy.d.ts +45 -0
  94. package/dist/app/tabMountPolicy.js +104 -0
  95. package/dist/app/tabWarmOrder.d.ts +7 -0
  96. package/dist/app/tabWarmOrder.js +48 -0
  97. package/dist/app/tabs/TabFuseCurves.d.ts +3 -0
  98. package/dist/app/tabs/TabFuseCurves.js +15 -0
  99. package/dist/app/tabs/TabOverview.d.ts +24 -0
  100. package/dist/app/tabs/TabOverview.js +121 -0
  101. package/dist/app/tabs/TabStrip.d.ts +42 -0
  102. package/dist/app/tabs/TabStrip.js +380 -0
  103. package/dist/app/tabs/tabIds.d.ts +5 -0
  104. package/dist/app/tabs/tabIds.js +7 -0
  105. package/dist/app/tabs/useTabDirty.d.ts +3 -0
  106. package/dist/app/tabs/useTabDirty.js +11 -0
  107. package/dist/app/useAppChromeState.d.ts +21 -0
  108. package/dist/app/useAppChromeState.js +48 -0
  109. package/dist/app/useAppCommands.d.ts +66 -0
  110. package/dist/app/useAppCommands.js +71 -0
  111. package/dist/app/useAppDocumentCore.d.ts +210 -0
  112. package/dist/app/useAppDocumentCore.js +40 -0
  113. package/dist/app/useAppEffects.d.ts +18 -0
  114. package/dist/app/useAppEffects.js +52 -0
  115. package/dist/app/useAppPaneSearch.d.ts +37 -0
  116. package/dist/app/useAppPaneSearch.js +74 -0
  117. package/dist/app/useAppShellSetup.d.ts +40 -0
  118. package/dist/app/useAppShellSetup.js +52 -0
  119. package/dist/app/useAppSlots.d.ts +28 -0
  120. package/dist/app/useAppSlots.js +40 -0
  121. package/dist/app/useAppTabChrome.d.ts +51 -0
  122. package/dist/app/useAppTabChrome.js +66 -0
  123. package/dist/app/useAutoSave.d.ts +34 -0
  124. package/dist/app/useAutoSave.js +116 -0
  125. package/dist/app/useCloseAll.d.ts +52 -0
  126. package/dist/app/useCloseAll.js +295 -0
  127. package/dist/app/useClosedTabEviction.d.ts +10 -0
  128. package/dist/app/useClosedTabEviction.js +38 -0
  129. package/dist/app/useCommandPalette.d.ts +44 -0
  130. package/dist/app/useCommandPalette.js +254 -0
  131. package/dist/app/useCrossDocSearch.d.ts +7 -0
  132. package/dist/app/useCrossDocSearch.js +94 -0
  133. package/dist/app/useDistractionFree.d.ts +21 -0
  134. package/dist/app/useDistractionFree.js +73 -0
  135. package/dist/app/useDocumentCreation.d.ts +18 -0
  136. package/dist/app/useDocumentCreation.js +63 -0
  137. package/dist/app/useDocumentDirty.d.ts +31 -0
  138. package/dist/app/useDocumentDirty.js +46 -0
  139. package/dist/app/useDocumentLoader.d.ts +55 -0
  140. package/dist/app/useDocumentLoader.js +267 -0
  141. package/dist/app/useDocumentOutputActions.d.ts +6 -0
  142. package/dist/app/useDocumentOutputActions.js +45 -0
  143. package/dist/app/useDocumentRuntimeEffects.d.ts +36 -0
  144. package/dist/app/useDocumentRuntimeEffects.js +458 -0
  145. package/dist/app/useDocumentSaver.d.ts +58 -0
  146. package/dist/app/useDocumentSaver.js +511 -0
  147. package/dist/app/useDocumentTabs.d.ts +41 -0
  148. package/dist/app/useDocumentTabs.js +207 -0
  149. package/dist/app/useDocumentWatcher.d.ts +83 -0
  150. package/dist/app/useDocumentWatcher.js +393 -0
  151. package/dist/app/useDocumentZoom.d.ts +24 -0
  152. package/dist/app/useDocumentZoom.js +104 -0
  153. package/dist/app/useDocuments.d.ts +169 -0
  154. package/dist/app/useDocuments.js +455 -0
  155. package/dist/app/useDraftConfirmGate.d.ts +27 -0
  156. package/dist/app/useDraftConfirmGate.js +47 -0
  157. package/dist/app/useFileDragOverlay.d.ts +12 -0
  158. package/dist/app/useFileDragOverlay.js +49 -0
  159. package/dist/app/useFormatApis.d.ts +13 -0
  160. package/dist/app/useFormatApis.js +62 -0
  161. package/dist/app/useFormatDirtyState.d.ts +29 -0
  162. package/dist/app/useFormatDirtyState.js +81 -0
  163. package/dist/app/useGlobalShortcuts.d.ts +47 -0
  164. package/dist/app/useGlobalShortcuts.js +359 -0
  165. package/dist/app/useHtmlSession.d.ts +68 -0
  166. package/dist/app/useHtmlSession.js +463 -0
  167. package/dist/app/useHtmlSessionProps.d.ts +33 -0
  168. package/dist/app/useHtmlSessionProps.js +57 -0
  169. package/dist/app/useLibrary.d.ts +21 -0
  170. package/dist/app/useLibrary.js +81 -0
  171. package/dist/app/useOpenFromClipboard.d.ts +7 -0
  172. package/dist/app/useOpenFromClipboard.js +44 -0
  173. package/dist/app/usePaneLiveness.d.ts +29 -0
  174. package/dist/app/usePaneLiveness.js +199 -0
  175. package/dist/app/usePendingSavePaths.d.ts +19 -0
  176. package/dist/app/usePendingSavePaths.js +67 -0
  177. package/dist/app/useReadyShow.d.ts +12 -0
  178. package/dist/app/useReadyShow.js +142 -0
  179. package/dist/app/useSearchController.d.ts +22 -0
  180. package/dist/app/useSearchController.js +114 -0
  181. package/dist/app/useSetupRecovery.d.ts +41 -0
  182. package/dist/app/useSetupRecovery.js +153 -0
  183. package/dist/app/useTabChrome.d.ts +40 -0
  184. package/dist/app/useTabChrome.js +115 -0
  185. package/dist/app/useViewState.d.ts +27 -0
  186. package/dist/app/useViewState.js +160 -0
  187. package/dist/appName.d.ts +2 -0
  188. package/dist/appName.js +8 -0
  189. package/dist/documents/DocumentRouter.d.ts +102 -0
  190. package/dist/documents/DocumentRouter.js +153 -0
  191. package/dist/documents/FileTypeIcon.d.ts +6 -0
  192. package/dist/documents/FileTypeIcon.js +93 -0
  193. package/dist/documents/ImageDocument.d.ts +14 -0
  194. package/dist/documents/ImageDocument.js +61 -0
  195. package/dist/documents/capabilities.d.ts +17 -0
  196. package/dist/documents/capabilities.js +18 -0
  197. package/dist/documents/html/HtmlDocument.d.ts +15 -0
  198. package/dist/documents/html/HtmlDocument.js +584 -0
  199. package/dist/documents/html/HtmlDocumentLayout.d.ts +87 -0
  200. package/dist/documents/html/HtmlDocumentLayout.js +25 -0
  201. package/dist/documents/html/HtmlDocumentProps.d.ts +60 -0
  202. package/dist/documents/html/HtmlDocumentProps.js +1 -0
  203. package/dist/documents/html/HtmlDocumentSource.d.ts +34 -0
  204. package/dist/documents/html/HtmlDocumentSource.js +28 -0
  205. package/dist/documents/markdown/MarkdownSplitPane.d.ts +115 -0
  206. package/dist/documents/markdown/MarkdownSplitPane.js +352 -0
  207. package/dist/documents/mdx/MdxSplitPane.d.ts +32 -0
  208. package/dist/documents/mdx/MdxSplitPane.js +60 -0
  209. package/dist/documents/txt/LinkDialog.d.ts +8 -0
  210. package/dist/documents/txt/LinkDialog.js +34 -0
  211. package/dist/documents/txt/MarkdownSourceToolbar.d.ts +8 -0
  212. package/dist/documents/txt/MarkdownSourceToolbar.js +25 -0
  213. package/dist/documents/txt/SourceEditorToolbar.d.ts +12 -0
  214. package/dist/documents/txt/SourceEditorToolbar.js +4 -0
  215. package/dist/documents/txt/TxtEditor.d.ts +39 -0
  216. package/dist/documents/txt/TxtEditor.js +186 -0
  217. package/dist/documents/txt/sourceEditorTypes.d.ts +49 -0
  218. package/dist/documents/txt/sourceEditorTypes.js +1 -0
  219. package/dist/documents/txt/sourceExtensions.d.ts +38 -0
  220. package/dist/documents/txt/sourceExtensions.js +444 -0
  221. package/dist/documents/txt/sourceFormatting.d.ts +18 -0
  222. package/dist/documents/txt/sourceFormatting.js +183 -0
  223. package/dist/documents/txt/sourceTheme.d.ts +5 -0
  224. package/dist/documents/txt/sourceTheme.js +220 -0
  225. package/dist/documents/txt/useCodeMirrorSourceEditor.d.ts +69 -0
  226. package/dist/documents/txt/useCodeMirrorSourceEditor.js +546 -0
  227. package/dist/documents/txt/useSourceSearch.d.ts +39 -0
  228. package/dist/documents/txt/useSourceSearch.js +122 -0
  229. package/dist/documents/txt/useTextEditorCommands.d.ts +26 -0
  230. package/dist/documents/txt/useTextEditorCommands.js +151 -0
  231. package/dist/documents/web/LivePreviewPane.d.ts +11 -0
  232. package/dist/documents/web/LivePreviewPane.js +58 -0
  233. package/dist/env.d.ts +66 -0
  234. package/dist/index.d.ts +121 -0
  235. package/dist/index.js +123 -0
  236. package/dist/settings/AppearanceMenu.d.ts +9 -0
  237. package/dist/settings/AppearanceMenu.js +54 -0
  238. package/dist/settings/SettingsPanel.d.ts +7 -0
  239. package/dist/settings/SettingsPanel.js +104 -0
  240. package/dist/settings/publishedSections.d.ts +22 -0
  241. package/dist/settings/publishedSections.js +79 -0
  242. package/dist/settings/sections/AboutSection.d.ts +1 -0
  243. package/dist/settings/sections/AboutSection.js +13 -0
  244. package/dist/settings/sections/DiagnosticsSection.d.ts +1 -0
  245. package/dist/settings/sections/DiagnosticsSection.js +42 -0
  246. package/dist/settings/sections/PrivacySection.d.ts +3 -0
  247. package/dist/settings/sections/PrivacySection.js +51 -0
  248. package/dist/settings/sections/UpdateLicenseBlock.d.ts +10 -0
  249. package/dist/settings/sections/UpdateLicenseBlock.js +158 -0
  250. package/dist/state/explorer.d.ts +32 -0
  251. package/dist/state/explorer.js +111 -0
  252. package/dist/state/legal.d.ts +51 -0
  253. package/dist/state/legal.js +130 -0
  254. package/dist/state/library.d.ts +33 -0
  255. package/dist/state/library.js +110 -0
  256. package/dist/state/updateLicense.d.ts +31 -0
  257. package/dist/state/updateLicense.js +340 -0
  258. package/dist/styles/explorer.css +219 -0
  259. package/dist/styles/index.css +1477 -0
  260. package/dist/styles/tabs.css +467 -0
  261. package/dist/styles.css +6 -0
  262. package/package.json +88 -3
package/dist/index.js ADDED
@@ -0,0 +1,123 @@
1
+ // Generated entry: every module whose exports do not collide with an earlier one.
2
+ // Every module is also importable directly by subpath, e.g. `<package>/lib/foo`.
3
+ export * from "./app/App.js";
4
+ export * from "./app/AppDialogs.js";
5
+ export * from "./app/AppDialogsHost.js";
6
+ export * from "./app/AppLifecycle.js";
7
+ export * from "./app/AppProvider.js";
8
+ export * from "./app/AppRoot.js";
9
+ export * from "./app/AppShell.js";
10
+ export * from "./app/CommandPalette.js";
11
+ export * from "./app/DocActionBar.js";
12
+ export * from "./app/DocumentContextMenu.js";
13
+ export * from "./app/DocumentPane.js";
14
+ export * from "./app/DocumentRouterTable.js";
15
+ export * from "./app/ErrorBoundary.js";
16
+ export * from "./app/FindBar.js";
17
+ export * from "./app/LiveTitle.js";
18
+ export * from "./app/OpeningProgress.js";
19
+ export * from "./app/PrintPreviewWindow.js";
20
+ export * from "./app/ShortcutHelp.js";
21
+ export * from "./app/Sidebar.js";
22
+ export * from "./app/ToastViewport.js";
23
+ export * from "./app/Toolbar.js";
24
+ export * from "./app/activeFormatSavers.js";
25
+ export * from "./app/clipboardPaths.js";
26
+ export * from "./app/documentDrafts.js";
27
+ export * from "./app/draftResolution.js";
28
+ export * from "./app/markdownPaletteActions.js";
29
+ export * from "./app/resourceCensusDev.js";
30
+ export * from "./app/setupRecovery.js";
31
+ export * from "./app/shell/DocStatsPill.js";
32
+ export * from "./app/shell/DocumentTools.js";
33
+ export * from "./app/shell/InfoInspector.js";
34
+ export * from "./app/shell/StartPage.js";
35
+ export * from "./app/shell/readEdit.js";
36
+ export * from "./app/sidebar/SidebarDocumentMenu.js";
37
+ export * from "./app/sidebar/SidebarExpandedPanel.js";
38
+ export * from "./app/sidebar/SidebarIcons.js";
39
+ export * from "./app/sidebar/SidebarMenus.js";
40
+ export * from "./app/sidebar/SidebarPathUtils.js";
41
+ export * from "./app/sidebar/SidebarPrimitives.js";
42
+ export * from "./app/sidebar/SidebarRail.js";
43
+ export * from "./app/sidebar/explorer/ExplorerRowMenu.js";
44
+ export * from "./app/sidebar/explorer/ExplorerSections.js";
45
+ export * from "./app/sidebar/explorer/ExplorerTree.js";
46
+ export * from "./app/sidebar/explorer/explorerState.js";
47
+ export * from "./app/tabMountPolicy.js";
48
+ export * from "./app/tabWarmOrder.js";
49
+ export * from "./app/tabs/TabFuseCurves.js";
50
+ export * from "./app/tabs/TabOverview.js";
51
+ export * from "./app/tabs/TabStrip.js";
52
+ export * from "./app/tabs/tabIds.js";
53
+ export * from "./app/tabs/useTabDirty.js";
54
+ export * from "./app/useAppChromeState.js";
55
+ export * from "./app/useAppCommands.js";
56
+ export * from "./app/useAppDocumentCore.js";
57
+ export * from "./app/useAppEffects.js";
58
+ export * from "./app/useAppPaneSearch.js";
59
+ export * from "./app/useAppShellSetup.js";
60
+ export * from "./app/useAppSlots.js";
61
+ export * from "./app/useAppTabChrome.js";
62
+ export * from "./app/useAutoSave.js";
63
+ export * from "./app/useCloseAll.js";
64
+ export * from "./app/useClosedTabEviction.js";
65
+ export * from "./app/useCommandPalette.js";
66
+ export * from "./app/useCrossDocSearch.js";
67
+ export * from "./app/useDistractionFree.js";
68
+ export * from "./app/useDocumentCreation.js";
69
+ export * from "./app/useDocumentDirty.js";
70
+ export * from "./app/useDocumentLoader.js";
71
+ export * from "./app/useDocumentOutputActions.js";
72
+ export * from "./app/useDocumentRuntimeEffects.js";
73
+ export * from "./app/useDocumentSaver.js";
74
+ export * from "./app/useDocumentTabs.js";
75
+ export * from "./app/useDocumentWatcher.js";
76
+ export * from "./app/useDocumentZoom.js";
77
+ export * from "./app/useDraftConfirmGate.js";
78
+ export * from "./app/useFileDragOverlay.js";
79
+ export * from "./app/useFormatApis.js";
80
+ export * from "./app/useFormatDirtyState.js";
81
+ export * from "./app/useGlobalShortcuts.js";
82
+ export * from "./app/useHtmlSession.js";
83
+ export * from "./app/useHtmlSessionProps.js";
84
+ export * from "./app/useLibrary.js";
85
+ export * from "./app/useOpenFromClipboard.js";
86
+ export * from "./app/usePaneLiveness.js";
87
+ export * from "./app/usePendingSavePaths.js";
88
+ export * from "./app/useReadyShow.js";
89
+ export * from "./app/useSearchController.js";
90
+ export * from "./app/useSetupRecovery.js";
91
+ export * from "./app/useTabChrome.js";
92
+ export * from "./app/useViewState.js";
93
+ export * from "./appName.js";
94
+ export * from "./documents/DocumentRouter.js";
95
+ export * from "./documents/FileTypeIcon.js";
96
+ export * from "./documents/ImageDocument.js";
97
+ export * from "./documents/capabilities.js";
98
+ export * from "./documents/html/HtmlDocument.js";
99
+ export * from "./documents/html/HtmlDocumentLayout.js";
100
+ export * from "./documents/html/HtmlDocumentSource.js";
101
+ export * from "./documents/markdown/MarkdownSplitPane.js";
102
+ export * from "./documents/mdx/MdxSplitPane.js";
103
+ export * from "./documents/txt/LinkDialog.js";
104
+ export * from "./documents/txt/MarkdownSourceToolbar.js";
105
+ export * from "./documents/txt/SourceEditorToolbar.js";
106
+ export * from "./documents/txt/TxtEditor.js";
107
+ export * from "./documents/txt/sourceExtensions.js";
108
+ export * from "./documents/txt/sourceTheme.js";
109
+ export * from "./documents/txt/useCodeMirrorSourceEditor.js";
110
+ export * from "./documents/txt/useSourceSearch.js";
111
+ export * from "./documents/txt/useTextEditorCommands.js";
112
+ export * from "./documents/web/LivePreviewPane.js";
113
+ export * from "./settings/AppearanceMenu.js";
114
+ export * from "./settings/SettingsPanel.js";
115
+ export * from "./settings/publishedSections.js";
116
+ export * from "./settings/sections/AboutSection.js";
117
+ export * from "./settings/sections/DiagnosticsSection.js";
118
+ export * from "./settings/sections/PrivacySection.js";
119
+ export * from "./settings/sections/UpdateLicenseBlock.js";
120
+ export * from "./state/explorer.js";
121
+ export * from "./state/legal.js";
122
+ export * from "./state/library.js";
123
+ export * from "./state/updateLicense.js";
@@ -0,0 +1,9 @@
1
+ import { type AnchorRect } from "@rightkit/react-shell/react";
2
+ /** Compact theme menu from the sidebar footer. The interface font lives in Settings → Typography
3
+ * (a quick menu shouldn't restyle every control); "More settings…" opens the full panel.
4
+ * Call sites may pass `anchor` (the Theme button); otherwise the menu finds that button. */
5
+ export declare function AppearanceMenu({ onClose, onMore, anchor, }: {
6
+ onClose: () => void;
7
+ onMore: () => void;
8
+ anchor?: Element | AnchorRect;
9
+ }): import("react").JSX.Element;
@@ -0,0 +1,54 @@
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useMemo, useRef } from "react";
3
+ import { ContextMenu } from "@rightkit/react-shell/react";
4
+ import { useSettings } from "@rightkit/document-core/settings/settings";
5
+ import { BASE_THEME_IDS, themeById } from "@rightkit/document-core/settings/themes";
6
+ import { menuPanelClass, menuItemClass } from "../app/sidebar/SidebarPrimitives.js";
7
+ // Auto is a two-tone light/dark pie; every theme is a pie of its ink / primary / paper.
8
+ const AUTO_SWATCH = ["#F7F4EE", "#121417"];
9
+ const TRIGGER = '[data-vr-sidebar="expanded"] button[aria-label="Theme"]';
10
+ /** Compact theme menu from the sidebar footer. The interface font lives in Settings → Typography
11
+ * (a quick menu shouldn't restyle every control); "More settings…" opens the full panel.
12
+ * Call sites may pass `anchor` (the Theme button); otherwise the menu finds that button. */
13
+ export function AppearanceMenu({ onClose, onMore, anchor, }) {
14
+ const { settings, update } = useSettings();
15
+ // `update` / `onMore` may change identity per render; items must not (exitMs treats a new items
16
+ // identity as a re-open), so run() reads the latest through a ref.
17
+ const latest = useRef({ update, onMore });
18
+ latest.current = { update, onMore };
19
+ const themeId = settings.themeId;
20
+ const presets = useMemo(() => [
21
+ { id: "auto", name: "Auto", note: "Follows system", swatch: AUTO_SWATCH },
22
+ ...BASE_THEME_IDS.map((id) => {
23
+ const t = themeById(id);
24
+ return { id: t.id, name: t.name, note: "", swatch: [t.tokens.ink, t.tokens.primary, t.tokens.paper] };
25
+ }),
26
+ ], []);
27
+ const byId = useMemo(() => new Map(presets.map((p) => [`preset:${p.id}`, p])), [presets]);
28
+ const items = useMemo(() => [
29
+ ...presets.map((p) => ({
30
+ id: `preset:${p.id}`,
31
+ label: p.name,
32
+ checked: themeId === p.id,
33
+ run: () => latest.current.update({ themeId: p.id }),
34
+ })),
35
+ { id: "more", label: "More settings…", separatorBefore: true, run: () => latest.current.onMore() },
36
+ ], [presets, themeId]);
37
+ return (_jsx(ContextMenu, { anchor: anchor ?? document.querySelector(TRIGGER) ?? { left: 8, top: window.innerHeight - 48, right: 248, bottom: window.innerHeight - 48 }, placement: "top-end", label: "Theme", width: 240, items: items, onClose: onClose, itemAs: "button", showLead: false, renderItem: (item) => {
38
+ const preset = byId.get(item.id);
39
+ if (!preset)
40
+ return _jsx("span", { className: "flex-1 text-center text-xs text-muted", children: item.label });
41
+ const active = item.checked;
42
+ return (_jsxs(_Fragment, { children: [_jsx(Swatch, { colors: preset.swatch }), _jsx("span", { className: "flex-1", children: preset.name }), preset.note && _jsx("span", { className: "text-chrome-xs text-muted", children: preset.note }), active && (_jsx("span", { "aria-hidden": "true", className: "text-copper-hi", children: "\u2713" }))] }));
43
+ }, className: `${menuPanelClass} p-2`, scrimClassName: "no-print", exitMs: 80, exitClassName: "vr-pop-exit", slots: {
44
+ item: `${menuItemClass} vr-focus h-9 gap-2.5 rounded-md px-2 text-chrome-md [&.is-active]:bg-ink/30 [&[aria-checked=true]]:bg-copper/15 [&[aria-checked=true]]:text-paper`,
45
+ separator: "my-2 h-px",
46
+ } }));
47
+ }
48
+ /** Decorative pie of a theme's ink / primary / paper (Auto is a two-tone light/dark pie). RightKit
49
+ * has no swatch component; the menu row text carries the theme name. */
50
+ function Swatch({ colors }) {
51
+ const step = 100 / colors.length;
52
+ const stops = colors.map((color, i) => `${color} ${i * step}% ${(i + 1) * step}%`).join(", ");
53
+ return (_jsx("span", { "aria-hidden": "true", className: "h-5 w-5 shrink-0 rounded-full border border-line", style: { background: `conic-gradient(from 135deg, ${stops})` } }));
54
+ }
@@ -0,0 +1,7 @@
1
+ /** Settings dialog: the published `SettingsPanel` (nav, headings, `aria-current`) inside the shell
2
+ * `ModalShell` (backdrop, Escape, focus trap and restore). Section bodies read and write through
3
+ * `useSettings()` (the native-document backend in `settings.tsx`), so the panel keeps no store. */
4
+ export declare function SettingsPanel({ onClose, onHistoryPurged, }: {
5
+ onClose: () => void;
6
+ onHistoryPurged?: () => void;
7
+ }): import("react").JSX.Element;
@@ -0,0 +1,104 @@
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useMemo } from "react";
3
+ import { ModalShell } from "@rightkit/react-shell/react";
4
+ import { SettingsPanel as PublishedSettingsPanel, mergeSections, } from "@rightkit/settings-ui";
5
+ import { AboutSection } from "./sections/AboutSection.js";
6
+ import { DiagnosticsSection } from "./sections/DiagnosticsSection.js";
7
+ import { EditorSection } from "@rightkit/document-core/settings/sections/EditorSection";
8
+ import { FileAssociationsSection } from "@rightkit/document-core/settings/sections/FileAssociationsSection";
9
+ import { PrivacySection } from "./sections/PrivacySection.js";
10
+ import { ThemeSection } from "@rightkit/document-core/settings/sections/ThemeSection";
11
+ import { TypographySection } from "@rightkit/document-core/settings/sections/TypographySection";
12
+ import { isMac, isWindows } from "@rightkit/document-core/platform";
13
+ import { inTauri, isBrowserQaMode } from "@rightkit/document-core/state/tauriBridge";
14
+ import { hostAppName } from "../appName.js";
15
+ const SETTINGS_MODAL_SLOTS = {
16
+ overlay: "z-[60] bg-black/50 p-4 transition-opacity duration-[80ms] ease-out",
17
+ root: "vr-pop vr-pop-modal flex h-[76vh] max-h-[620px] max-w-[calc(100vw-2rem)] overflow-hidden rounded-xl border border-line bg-panel-2 shadow-2xl",
18
+ };
19
+ function Icon({ children }) {
20
+ return (_jsx("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", width: "14", height: "14", fill: "none", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round", children: children }));
21
+ }
22
+ const ICONS = {
23
+ about: (_jsxs(Icon, { children: [_jsx("circle", { cx: "12", cy: "12", r: "9" }), _jsx("path", { d: "M12 11v5M12 8h.01" })] })),
24
+ diagnostics: (_jsx(Icon, { children: _jsx("path", { d: "M4 18V6M8 18v-5M12 18V9M16 18v-8M20 18V4" }) })),
25
+ files: (_jsxs(Icon, { children: [_jsx("path", { d: "M5 4h10l4 4v12H5z" }), _jsx("path", { d: "M15 4v4h4M8 13h8M8 16h6" })] })),
26
+ theme: (_jsxs(Icon, { children: [_jsx("circle", { cx: "12", cy: "12", r: "9" }), _jsx("path", { d: "M12 3a9 9 0 0 1 0 18" })] })),
27
+ typography: (_jsx(Icon, { children: _jsx("path", { d: "M5 5h14M12 5v14M8 19h8" }) })),
28
+ editor: (_jsxs(Icon, { children: [_jsx("path", { d: "M4 20h4l11-11-4-4L4 16v4Z" }), _jsx("path", { d: "m13.5 6.5 4 4" })] })),
29
+ privacy: (_jsxs(Icon, { children: [_jsx("rect", { x: "5", y: "10", width: "14", height: "10", rx: "2" }), _jsx("path", { d: "M8 10V7a4 4 0 0 1 8 0v3" })] })),
30
+ };
31
+ /** A section body with the one-line description the old panel showed under the heading. */
32
+ function Body({ subtitle, children }) {
33
+ return (_jsxs(_Fragment, { children: [subtitle && _jsx("p", { className: "mb-5 text-xs text-muted-2", children: subtitle }), children] }));
34
+ }
35
+ function viewRightSections(onHistoryPurged) {
36
+ const showFileAssociations = (isMac() || isWindows()) && (inTauri() || isBrowserQaMode());
37
+ return [
38
+ {
39
+ id: "about",
40
+ label: "About",
41
+ group: "App",
42
+ order: 100,
43
+ icon: ICONS.about,
44
+ hideSectionHeading: true,
45
+ render: () => _jsx(AboutSection, {}),
46
+ },
47
+ {
48
+ id: "files",
49
+ label: "File associations",
50
+ group: "App",
51
+ order: 200,
52
+ icon: ICONS.files,
53
+ visible: () => showFileAssociations,
54
+ render: () => (_jsx(Body, { subtitle: `Choose which document formats open in ${hostAppName()} by default.`, children: _jsx(FileAssociationsSection, {}) })),
55
+ },
56
+ {
57
+ id: "diagnostics",
58
+ label: "Diagnostics",
59
+ group: "App",
60
+ order: 300,
61
+ icon: ICONS.diagnostics,
62
+ render: () => (_jsx(Body, { subtitle: "Local troubleshooting information and support tools.", children: _jsx(DiagnosticsSection, {}) })),
63
+ },
64
+ {
65
+ id: "theme",
66
+ label: "Theme",
67
+ group: "Preferences",
68
+ order: 400,
69
+ icon: ICONS.theme,
70
+ render: () => (_jsx(Body, { subtitle: `Choose the surfaces and accents used across ${hostAppName()}.`, children: _jsx(ThemeSection, {}) })),
71
+ },
72
+ {
73
+ id: "typography",
74
+ label: "Typography",
75
+ group: "Preferences",
76
+ order: 500,
77
+ icon: ICONS.typography,
78
+ render: () => (_jsx(Body, { subtitle: "Set interface and document reading type.", children: _jsx(TypographySection, {}) })),
79
+ },
80
+ {
81
+ id: "editor",
82
+ label: "Editor",
83
+ group: "Preferences",
84
+ order: 600,
85
+ icon: ICONS.editor,
86
+ render: () => (_jsx(Body, { subtitle: "Control writing and source-editing behavior.", children: _jsx(EditorSection, {}) })),
87
+ },
88
+ {
89
+ id: "privacy",
90
+ label: "Privacy",
91
+ group: "Preferences",
92
+ order: 700,
93
+ icon: ICONS.privacy,
94
+ render: () => (_jsx(Body, { subtitle: `Choose what ${hostAppName()} remembers on this device.`, children: _jsx(PrivacySection, { onHistoryPurged: onHistoryPurged }) })),
95
+ },
96
+ ];
97
+ }
98
+ /** Settings dialog: the published `SettingsPanel` (nav, headings, `aria-current`) inside the shell
99
+ * `ModalShell` (backdrop, Escape, focus trap and restore). Section bodies read and write through
100
+ * `useSettings()` (the native-document backend in `settings.tsx`), so the panel keeps no store. */
101
+ export function SettingsPanel({ onClose, onHistoryPurged, }) {
102
+ const sections = useMemo(() => mergeSections([], viewRightSections(onHistoryPurged)), [onHistoryPurged]);
103
+ return (_jsx(ModalShell, { label: "Settings", onClose: onClose, width: 800, dismissOn: "click", slots: SETTINGS_MODAL_SLOTS, children: _jsx("div", { "data-settings-shell": true, className: "vr-rk h-full min-w-0 flex-1", children: _jsx(PublishedSettingsPanel, { className: "h-full", sections: sections, title: "Settings", defaultActiveId: "about", hideSearch: true, navFooter: _jsx("button", { type: "button", onClick: onClose, "aria-label": "Close settings", title: "Close settings", className: "vr-press vr-focus mt-2 w-full rounded-md border border-line px-2 py-1.5 font-sans text-xs text-muted hover:bg-panel-2 hover:text-paper", children: "Close" }) }) }) }));
104
+ }
@@ -0,0 +1,22 @@
1
+ import { type SettingsSection } from "@rightkit/settings-ui";
2
+ /** Published UpdatesControls over the host app update client: status sentence, no badge (rightkit item 10a). */
3
+ export declare function UpdatesPanel(): import("react").JSX.Element;
4
+ /** Published aboutSection: the host app brand card replaces the default card; panels hold the rest. */
5
+ export declare function AboutFrame({ card, panels }: {
6
+ card: React.ReactNode;
7
+ panels: React.ReactNode;
8
+ }): import("react").JSX.Element;
9
+ /** Renders the published licenseSection body (status, verify, deactivate, activate, purchase rows) under the the host app token map. */
10
+ export declare function PublishedLicense({ section }: {
11
+ section: SettingsSection;
12
+ }): import("react").JSX.Element;
13
+ /** Published legalSection: one row per legal document with the acceptance receipt as its description. */
14
+ export declare function LegalPanel({ documents, acceptedAt, acceptedVersion, openExternal, }: {
15
+ documents: ReadonlyArray<{
16
+ title: string;
17
+ url: string;
18
+ }>;
19
+ acceptedAt: string | null;
20
+ acceptedVersion: string | null;
21
+ openExternal: (url: string) => void | Promise<void>;
22
+ }): import("react").JSX.Element;
@@ -0,0 +1,79 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useMemo, useReducer } from "react";
3
+ import { Button, Toggle } from "@rightkit/react-shell/react";
4
+ import { SettingRow, SettingsGroup, UpdatesControls, aboutSection, legalSection, } from "@rightkit/settings-ui";
5
+ import { APP_VERSION, createHostUpdatesAdapter, hasPendingExternalUpdate, openPendingExternalUpdate, } from "../state/updateLicense.js";
6
+ import { useSettings } from "@rightkit/document-core/settings/settings";
7
+ import { hostAppName } from "../appName.js";
8
+ /** the host app keeps its own settings store; this exposes the one key the published sections read. */
9
+ function useRkContext() {
10
+ const { settings, update } = useSettings();
11
+ return useMemo(() => {
12
+ const apply = (patch) => {
13
+ if ("updates.autoInstall" in patch) {
14
+ update({ autoCheckUpdates: patch["updates.autoInstall"] === true });
15
+ }
16
+ };
17
+ return {
18
+ values: { "updates.autoInstall": settings.autoCheckUpdates },
19
+ set: async (key, value) => apply({ [key]: value }),
20
+ patch: async (patch) => apply(patch),
21
+ saving: false,
22
+ error: null,
23
+ clearError: () => { },
24
+ };
25
+ }, [settings.autoCheckUpdates, update]);
26
+ }
27
+ /** Renders a published section body under the the host app token map. */
28
+ function RkSection({ section, ctx, children }) {
29
+ return (_jsxs("div", { className: "vr-rk", children: [section.render(ctx), children] }));
30
+ }
31
+ const UPDATE_LABELS = {
32
+ version: (v) => `${hostAppName()} ${v}`,
33
+ checkNow: "Check for updates",
34
+ checking: "Checking...",
35
+ installUpdate: "Install & relaunch",
36
+ installing: "Installing...",
37
+ status: (s, fallback) => {
38
+ switch (s.kind) {
39
+ case "idle":
40
+ return "Look for a newer release.";
41
+ case "up_to_date":
42
+ return "You’re up to date.";
43
+ case "available":
44
+ return s.eligible
45
+ ? `${hostAppName()} ${s.tier === "patch" ? "patch" : "update"} ${s.version} is ready.`
46
+ : "An update license is required for this channel.";
47
+ case "deferred":
48
+ return `${hostAppName()} ${s.version} is available as a manual download.`;
49
+ case "ready":
50
+ return `Restarting ${hostAppName()}...`;
51
+ default:
52
+ return fallback;
53
+ }
54
+ },
55
+ };
56
+ /** Published UpdatesControls over the host app update client: status sentence, no badge (rightkit item 10a). */
57
+ export function UpdatesPanel() {
58
+ const { settings, update } = useSettings();
59
+ const [, refresh] = useReducer((n) => n + 1, 0);
60
+ const client = useMemo(() => createHostUpdatesAdapter(refresh), []);
61
+ return (_jsx("div", { className: "vr-rk", children: _jsxs(SettingsGroup, { children: [_jsx(SettingRow, { id: "updates.status", label: `${hostAppName()} ${APP_VERSION}`, children: _jsx(UpdatesControls, { client: client, labels: UPDATE_LABELS, upgradeHint: "Activate an update license below.", showStatus: true, showBadge: false }) }), _jsx(SettingRow, { id: "updates.auto", label: "Automatic update checks", description: `Look for new releases while ${hostAppName()} is running. Installs always wait for you.`, children: _jsx(Toggle, { label: "Automatic update checks", checked: settings.autoCheckUpdates, onChange: (v) => update({ autoCheckUpdates: v }) }) }), hasPendingExternalUpdate() && (_jsx(SettingRow, { label: "Manual download", description: "Install the signed public build yourself.", children: _jsx(Button, { size: "sm", variant: "secondary", onClick: () => void openPendingExternalUpdate(), children: "Download installer" }) }))] }) }));
62
+ }
63
+ /** Published aboutSection: the host app brand card replaces the default card; panels hold the rest. */
64
+ export function AboutFrame({ card, panels }) {
65
+ const ctx = useRkContext();
66
+ const section = useMemo(() => aboutSection({ appName: hostAppName(), version: APP_VERSION, card, panels }), [card, panels]);
67
+ return _jsx(RkSection, { section: section, ctx: ctx });
68
+ }
69
+ /** Renders the published licenseSection body (status, verify, deactivate, activate, purchase rows) under the the host app token map. */
70
+ export function PublishedLicense({ section }) {
71
+ const ctx = useRkContext();
72
+ return _jsx(RkSection, { section: section, ctx: ctx });
73
+ }
74
+ /** Published legalSection: one row per legal document with the acceptance receipt as its description. */
75
+ export function LegalPanel({ documents, acceptedAt, acceptedVersion, openExternal, }) {
76
+ const ctx = useRkContext();
77
+ const section = useMemo(() => legalSection({ documents, acceptedAt, acceptedVersion, openExternal }), [documents, acceptedAt, acceptedVersion, openExternal]);
78
+ return _jsx(RkSection, { section: section, ctx: ctx });
79
+ }
@@ -0,0 +1 @@
1
+ export declare function AboutSection(): import("react").JSX.Element;
@@ -0,0 +1,13 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { LEGAL_ABOUT_LINKS } from "../../state/legal.js";
3
+ import { AboutFrame, LegalPanel, UpdatesPanel } from "../publishedSections.js";
4
+ import { useSettings } from "@rightkit/document-core/settings/settings";
5
+ import { openExternal } from "@rightkit/document-core/state/tauriBridge";
6
+ import { UpdateLicenseBlock } from "./UpdateLicenseBlock.js";
7
+ const footerLink = "text-copper-hi underline-offset-4 hover:underline";
8
+ const brandCard = (_jsxs("div", { className: "rounded-lg border border-line bg-panel/55 px-4 py-3 text-sm text-muted", children: [_jsxs("div", { className: "flex min-w-0 items-center justify-between gap-3", children: [_jsxs("div", { className: "[font-family:var(--font-wordmark)] text-3xl leading-none tracking-[0.01em] text-paper", children: ["View", _jsx("span", { className: "text-copper", children: "Right" })] }), _jsx("div", { className: "flex items-center gap-1.5 font-sans text-chrome-xs text-muted-2", children: _jsx("span", { className: "rounded-full border border-line bg-ink/25 px-2 py-1", children: "Local-first" }) })] }), _jsx("p", { className: "mt-1 text-xs text-paper/75", children: "Your documents, opened locally and kept on your device." }), _jsxs("div", { "data-about-contact": true, className: "mt-2 flex flex-wrap items-center gap-x-4 gap-y-1 border-t border-line/70 pt-2 font-sans text-chrome-xs", children: [_jsx("a", { className: footerLink, href: "https://viewright.cc", children: "viewright.cc" }), _jsx("a", { className: footerLink, href: "mailto:hello@viewright.cc", children: "hello@viewright.cc" })] })] }));
9
+ const panels = (_jsxs("div", { className: "mt-3 flex flex-col gap-3", children: [_jsx(UpdatesPanel, {}), _jsx(UpdateLicenseBlock, {})] }));
10
+ export function AboutSection() {
11
+ const { settings } = useSettings();
12
+ return (_jsxs("div", { "data-about-section": true, className: "flex h-full min-h-0 flex-col pr-9 text-sm text-muted", children: [_jsx(AboutFrame, { card: brandCard, panels: panels }), _jsx("p", { className: "mt-3 font-sans text-chrome-xs text-muted-2", children: "Right Suite Desktop License v1.0" }), _jsx(LegalPanel, { documents: LEGAL_ABOUT_LINKS, acceptedAt: settings.legalAcceptedAt || null, acceptedVersion: settings.legalAcceptanceVersion || null, openExternal: openExternal })] }));
13
+ }
@@ -0,0 +1 @@
1
+ export declare function DiagnosticsSection(): import("react").JSX.Element;
@@ -0,0 +1,42 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useState } from "react";
3
+ import { clearAllDiagnostics, collectDiagnosticsText, getDiagnostics, } from "@rightkit/document-core/state/diagnostics";
4
+ import { APP_VERSION } from "../../state/updateLicense.js";
5
+ import { useSettings } from "@rightkit/document-core/settings/settings";
6
+ import { writeClipboardText } from "@rightkit/document-core/state/tauriBridge";
7
+ import { hostAppName } from "../../appName.js";
8
+ export function DiagnosticsSection() {
9
+ const { settings } = useSettings();
10
+ const [log, setLog] = useState(() => getDiagnostics());
11
+ const [copied, setCopied] = useState("");
12
+ const refresh = () => setLog(getDiagnostics());
13
+ const copyLog = async () => {
14
+ try {
15
+ await writeClipboardText(await collectDiagnosticsText());
16
+ setCopied("copied");
17
+ }
18
+ catch {
19
+ setCopied("failed");
20
+ }
21
+ setTimeout(() => setCopied(""), 1800);
22
+ };
23
+ const emailLog = async () => {
24
+ await copyLog();
25
+ const subject = encodeURIComponent(`${hostAppName()} ${APP_VERSION} diagnostics`);
26
+ const body = encodeURIComponent("The diagnostics log has been copied to your clipboard — please paste it below this line, then send.\n\n----\n");
27
+ window.location.href = `mailto:hello@viewright.cc?subject=${subject}&body=${body}`;
28
+ };
29
+ const clear = async () => {
30
+ try {
31
+ await clearAllDiagnostics();
32
+ }
33
+ catch {
34
+ // The log stays on screen when erasure failed, so the failure is visible to the user.
35
+ }
36
+ refresh();
37
+ };
38
+ if (settings.diagnostics === false) {
39
+ return (_jsx("div", { className: "space-y-4", children: _jsx("div", { className: "space-y-3 text-sm text-muted", children: _jsx("p", { children: "Diagnostics logging is currently off (Privacy \u2192 diagnostics). Turn it on to capture loads, document timings, and errors here." }) }) }));
40
+ }
41
+ return (_jsxs("div", { className: "space-y-4 text-sm text-muted", children: [_jsx("p", { children: "A local log of loads, document timings, and errors \u2014 stays on your machine. Use it to report a problem: it never sends on its own; \u201CEmail to support\u201D copies the log and opens a prefilled message you send yourself." }), _jsxs("div", { className: "flex flex-wrap gap-2 font-mono text-xs", children: [_jsx("button", { type: "button", onClick: emailLog, className: "vr-press vr-focus rounded bg-copper/20 px-3 py-1.5 text-copper-hi hover:bg-copper/30", children: "Email to support" }), _jsx("button", { type: "button", onClick: copyLog, className: "vr-press vr-focus rounded border border-line px-3 py-1.5 text-muted hover:border-copper hover:text-copper-hi", children: copied === "copied" ? "Copied ✓" : copied === "failed" ? "Copy failed" : "Copy log" }), _jsx("button", { type: "button", onClick: refresh, className: "vr-press vr-focus rounded border border-line px-3 py-1.5 text-muted hover:border-copper hover:text-copper-hi", children: "Refresh" }), _jsx("button", { type: "button", onClick: clear, className: "vr-press vr-focus rounded border border-line px-3 py-1.5 text-muted hover:border-red-500/60 hover:text-paper", children: "Clear log" })] }), _jsx("div", { className: "max-h-72 overflow-auto rounded border border-line bg-ink/40 p-2 font-mono text-chrome-xs leading-relaxed text-muted-2 select-text", children: log.length === 0 ? (_jsx("p", { className: "text-muted-2", children: "No diagnostics recorded yet." })) : ([...log].reverse().map((e, i) => (_jsxs("p", { className: "whitespace-pre-wrap break-words", children: [_jsx("span", { className: "text-muted", children: new Date(e.ts_ms).toISOString().slice(11, 19) }), " ", _jsx("span", { className: "text-copper-hi", children: e.kind }), " ", e.event, e.duration_ms === undefined ? "" : ` — ${e.duration_ms}ms`] }, `${e.ts_ms}-${i}`)))) })] }));
42
+ }
@@ -0,0 +1,3 @@
1
+ export declare function PrivacySection({ onHistoryPurged }?: {
2
+ onHistoryPurged?: () => void;
3
+ }): import("react").JSX.Element;
@@ -0,0 +1,51 @@
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useState } from "react";
3
+ import { toast } from "@rightkit/platform-ui/headless";
4
+ import { drainSessionSaves } from "../../app/useDocumentRuntimeEffects.js";
5
+ import { ActionDialog, SegmentedControl } from "@rightkit/react-shell/react";
6
+ import { SettingsGroup } from "@rightkit/settings-ui";
7
+ import { DIALOG_SLOTS, cancelAction, dangerAction } from "@rightkit/document-core/app/chrome";
8
+ import { purgeUserPaths } from "@rightkit/document-core/state/tauriBridge";
9
+ import { clearAllDiagnostics, collectDiagnosticsText } from "@rightkit/document-core/state/diagnostics";
10
+ import { useSettings } from "@rightkit/document-core/settings/settings";
11
+ import { onOff } from "@rightkit/document-core/settings/sections/onOff";
12
+ import { writeClipboardText } from "@rightkit/document-core/state/tauriBridge";
13
+ import { hostAppName } from "../../appName.js";
14
+ export function PrivacySection({ onHistoryPurged } = {}) {
15
+ const { settings, update } = useSettings();
16
+ const [cleared, setCleared] = useState(false);
17
+ const [copied, setCopied] = useState(false);
18
+ const [confirmPurge, setConfirmPurge] = useState(false);
19
+ const [purging, setPurging] = useState(false);
20
+ const runPurge = async () => {
21
+ setPurging(true);
22
+ try {
23
+ await drainSessionSaves();
24
+ await purgeUserPaths();
25
+ onHistoryPurged?.();
26
+ toast("History cleared", "success");
27
+ }
28
+ catch {
29
+ toast("Couldn't clear history", "error");
30
+ }
31
+ finally {
32
+ setPurging(false);
33
+ setConfirmPurge(false);
34
+ }
35
+ };
36
+ return (_jsxs(_Fragment, { children: [_jsxs(SettingsGroup, { title: "Session restore", children: [_jsx("p", { className: "mb-3 max-w-prose text-sm text-muted", children: "Reopen file-backed tabs from the previous desktop session. Untitled scratch notes are still saved locally as drafts." }), _jsx(SegmentedControl, { label: "Session restore", options: onOff("Session restore"), value: settings.restoreSession ? "on" : "off", onChange: (v) => update({ restoreSession: v === "on" }) })] }), _jsxs(SettingsGroup, { title: "Diagnostic log", children: [_jsxs("p", { className: "mb-3 max-w-prose text-sm text-muted", children: [hostAppName(), " keeps a small local log of loads, document timings, and errors to help diagnose a crash or stuck launch. It is stored only on this device and is never sent anywhere. You can turn it off, copy it, or clear what\u2019s stored now."] }), _jsx(SegmentedControl, { label: "Diagnostic log", options: onOff("Diagnostics"), value: settings.diagnostics ? "on" : "off", onChange: (v) => update({ diagnostics: v === "on" }) })] }), _jsxs(SettingsGroup, { title: "Stored data", children: [_jsx("button", { type: "button", onClick: () => {
37
+ void collectDiagnosticsText()
38
+ .then((text) => writeClipboardText(text))
39
+ .then(() => setCopied(true))
40
+ .catch(() => {
41
+ // Clipboard access is permission-gated; leaving the log on screen is sufficient.
42
+ });
43
+ }, className: "vr-press vr-focus mr-2 rounded border border-line px-3 py-1.5 font-sans text-xs text-muted hover:border-copper hover:text-copper-hi", children: "Copy diagnostic log" }), _jsx("button", { type: "button", onClick: () => {
44
+ void clearAllDiagnostics()
45
+ .then(() => setCleared(true))
46
+ .catch(() => setCleared(false));
47
+ }, className: "vr-press vr-focus rounded border border-line px-3 py-1.5 font-sans text-xs text-muted hover:border-copper hover:text-copper-hi", children: "Clear diagnostic log" }), _jsx("button", { type: "button", onClick: () => setConfirmPurge(true), className: "vr-press vr-focus ml-2 rounded border border-line px-3 py-1.5 font-sans text-xs text-muted hover:border-danger/60 hover:text-paper", children: "Clear all history" }), copied && _jsx("span", { className: "ml-3 font-mono text-xs text-copper-hi", children: "copied" }), cleared && _jsx("span", { className: "ml-3 font-mono text-xs text-copper-hi", children: "cleared" })] }), confirmPurge && (_jsx(ActionDialog, { title: "Clear all history?", ariaLabel: "Clear all history?", description: "This removes recent files, the saved open-tab session and pinned files. Your settings are not changed.", onClose: () => setConfirmPurge(false), width: 440, role: "alertdialog", slots: DIALOG_SLOTS, actions: [
48
+ cancelAction(() => setConfirmPurge(false)),
49
+ { ...dangerAction("Clear history", () => void runPurge()), disabled: purging },
50
+ ] }))] }));
51
+ }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * the host app update-license block: the published `licenseSection()` (`@rightkit/settings-ui` 0.7.0)
3
+ * over the native licence client. App-owned remainder, each piece with its reason:
4
+ * the lazy client above, the Disabled-build notice, the loading gate (the package shows "Free"
5
+ * until its first read settles), the non-Pro notice (the package marks any active licence as
6
+ * licensed), the cross-window re-read on native change events (the package only reads on mount),
7
+ * and the label map. The webview holds no key or token: the key is a transient command input and
8
+ * the view is the only state. Record: docs/rightkit-exceptions/M12.md#m12-update-license-block.
9
+ */
10
+ export declare function UpdateLicenseBlock(): import("react").JSX.Element;