@mistriwork/kit 1.0.0-rc.10 → 1.0.0-rc.12

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 (970) hide show
  1. package/dist/client/actionGrants.d.ts +21 -0
  2. package/dist/client/actionGrants.js +24 -0
  3. package/dist/client/addressMount.d.ts +67 -0
  4. package/dist/client/addressMount.js +136 -0
  5. package/dist/client/app.d.ts +10 -0
  6. package/dist/client/app.js +976 -0
  7. package/dist/client/boot.d.ts +1 -0
  8. package/dist/client/boot.js +37 -0
  9. package/dist/client/brandLook.css +125 -0
  10. package/dist/client/breakdownBatch.d.ts +34 -0
  11. package/dist/client/breakdownBatch.js +115 -0
  12. package/dist/client/bulkActions.d.ts +66 -0
  13. package/dist/client/bulkActions.js +171 -0
  14. package/dist/client/chart.d.ts +20 -0
  15. package/dist/client/chart.js +80 -0
  16. package/dist/client/clauses.d.ts +121 -0
  17. package/dist/client/clauses.js +276 -0
  18. package/dist/client/columns.d.ts +77 -0
  19. package/dist/client/columns.js +102 -0
  20. package/dist/client/components/Accordion.d.ts +26 -0
  21. package/dist/client/components/Accordion.js +44 -0
  22. package/dist/client/components/ApiOperations.d.ts +3 -0
  23. package/dist/client/components/ApiOperations.js +162 -0
  24. package/dist/client/components/AppColumnMenu.d.ts +66 -0
  25. package/dist/client/components/AppColumnMenu.js +59 -0
  26. package/dist/client/components/AppColumnMenuPopups.d.ts +21 -0
  27. package/dist/client/components/AppColumnMenuPopups.js +92 -0
  28. package/dist/client/components/AppFooter.css +17 -0
  29. package/dist/client/components/AppFooter.d.ts +23 -0
  30. package/dist/client/components/AppFooter.js +12 -0
  31. package/dist/client/components/AppIssues.d.ts +4 -0
  32. package/dist/client/components/AppIssues.js +18 -0
  33. package/dist/client/components/AppList.d.ts +20 -0
  34. package/dist/client/components/AppList.js +696 -0
  35. package/dist/client/components/AttachmentList.d.ts +45 -0
  36. package/dist/client/components/AttachmentList.js +178 -0
  37. package/dist/client/components/BoardList.css +9 -0
  38. package/dist/client/components/Breakdown.d.ts +11 -0
  39. package/dist/client/components/Breakdown.js +157 -0
  40. package/dist/client/components/BreakdownRoom.d.ts +4 -0
  41. package/dist/client/components/BreakdownRoom.js +48 -0
  42. package/dist/client/components/CardsList.d.ts +23 -0
  43. package/dist/client/components/CardsList.js +209 -0
  44. package/dist/client/components/Chart.css +165 -0
  45. package/dist/client/components/Chart.d.ts +194 -0
  46. package/dist/client/components/Chart.js +801 -0
  47. package/dist/client/components/ChartFigure.d.ts +82 -0
  48. package/dist/client/components/ChartFigure.js +102 -0
  49. package/dist/client/components/ChartShapes.css +213 -0
  50. package/dist/client/components/ChartShapes.d.ts +63 -0
  51. package/dist/client/components/ChartShapes.js +393 -0
  52. package/dist/client/components/Checklist.css +16 -0
  53. package/dist/client/components/Composer.d.ts +1 -0
  54. package/dist/client/components/Composer.js +331 -0
  55. package/dist/client/components/Content.d.ts +8 -0
  56. package/dist/client/components/Content.js +170 -0
  57. package/dist/client/components/CountedLabel.d.ts +10 -0
  58. package/dist/client/components/CountedLabel.js +26 -0
  59. package/dist/client/components/Crumbs.d.ts +11 -0
  60. package/dist/client/components/Crumbs.js +142 -0
  61. package/dist/client/components/DashboardList.css +7 -0
  62. package/dist/client/components/DashboardList.d.ts +9 -0
  63. package/dist/client/components/DashboardList.js +46 -0
  64. package/dist/client/components/DashboardNote.d.ts +21 -0
  65. package/dist/client/components/DashboardNote.js +22 -0
  66. package/dist/client/components/DateField.css +6 -0
  67. package/dist/client/components/DateField.d.ts +7 -0
  68. package/dist/client/components/DateField.js +27 -0
  69. package/dist/client/components/DefinedFields.d.ts +50 -0
  70. package/dist/client/components/DefinedFields.js +186 -0
  71. package/dist/client/components/DeleteButton.d.ts +30 -0
  72. package/dist/client/components/DeleteButton.js +198 -0
  73. package/dist/client/components/Diagram.d.ts +7 -0
  74. package/dist/client/components/Diagram.js +320 -0
  75. package/dist/client/components/Dressed.d.ts +31 -0
  76. package/dist/client/components/Dressed.js +138 -0
  77. package/dist/client/components/Dropdown.d.ts +14 -0
  78. package/dist/client/components/Dropdown.js +20 -0
  79. package/dist/client/components/EditLayoutButton.d.ts +13 -0
  80. package/dist/client/components/EditLayoutButton.js +7 -0
  81. package/dist/client/components/Editable.d.ts +47 -0
  82. package/dist/client/components/Editable.js +422 -0
  83. package/dist/client/components/ErrorBoundary.d.ts +40 -0
  84. package/dist/client/components/ErrorBoundary.js +41 -0
  85. package/dist/client/components/Export.d.ts +15 -0
  86. package/dist/client/components/Export.js +151 -0
  87. package/dist/client/components/ExportHold.d.ts +18 -0
  88. package/dist/client/components/ExportHold.js +30 -0
  89. package/dist/client/components/FavoriteStar.d.ts +5 -0
  90. package/dist/client/components/FavoriteStar.js +14 -0
  91. package/dist/client/components/FieldArranger.d.ts +28 -0
  92. package/dist/client/components/FieldArranger.js +82 -0
  93. package/dist/client/components/FilePreview.css +20 -0
  94. package/dist/client/components/FilePreview.d.ts +26 -0
  95. package/dist/client/components/FilePreview.js +170 -0
  96. package/dist/client/components/FilterBoxes.d.ts +76 -0
  97. package/dist/client/components/FilterBoxes.js +294 -0
  98. package/dist/client/components/FilterRail.css +100 -0
  99. package/dist/client/components/FilterRail.d.ts +61 -0
  100. package/dist/client/components/FilterRail.js +559 -0
  101. package/dist/client/components/Gallery.d.ts +11 -0
  102. package/dist/client/components/Gallery.js +53 -0
  103. package/dist/client/components/Grid.d.ts +122 -0
  104. package/dist/client/components/Grid.js +1115 -0
  105. package/dist/client/components/GridCellEditor.d.ts +35 -0
  106. package/dist/client/components/GridCellEditor.js +291 -0
  107. package/dist/client/components/GridSelection.d.ts +16 -0
  108. package/dist/client/components/GridSelection.js +28 -0
  109. package/dist/client/components/HelpPanel.d.ts +5 -0
  110. package/dist/client/components/HelpPanel.js +92 -0
  111. package/dist/client/components/History.d.ts +10 -0
  112. package/dist/client/components/History.js +22 -0
  113. package/dist/client/components/Icon.d.ts +31 -0
  114. package/dist/client/components/Icon.js +20 -0
  115. package/dist/client/components/JsonPreview.d.ts +5 -0
  116. package/dist/client/components/JsonPreview.js +25 -0
  117. package/dist/client/components/JsonValue.d.ts +4 -0
  118. package/dist/client/components/JsonValue.js +3 -0
  119. package/dist/client/components/JsonView.css +109 -0
  120. package/dist/client/components/JsonView.d.ts +3 -0
  121. package/dist/client/components/JsonView.js +118 -0
  122. package/dist/client/components/Landing.d.ts +19 -0
  123. package/dist/client/components/Landing.js +55 -0
  124. package/dist/client/components/LandingSurface.css +177 -0
  125. package/dist/client/components/LandingSurface.d.ts +42 -0
  126. package/dist/client/components/LandingSurface.js +108 -0
  127. package/dist/client/components/LayoutBuilder.d.ts +36 -0
  128. package/dist/client/components/LayoutBuilder.js +104 -0
  129. package/dist/client/components/Lightbox.d.ts +29 -0
  130. package/dist/client/components/Lightbox.js +62 -0
  131. package/dist/client/components/ListEmpty.css +13 -0
  132. package/dist/client/components/ListEmpty.d.ts +10 -0
  133. package/dist/client/components/ListEmpty.js +8 -0
  134. package/dist/client/components/ListFilterBar.css +76 -0
  135. package/dist/client/components/ListFilterBar.d.ts +52 -0
  136. package/dist/client/components/ListFilterBar.js +304 -0
  137. package/dist/client/components/LiveNotices.css +105 -0
  138. package/dist/client/components/LiveNotices.d.ts +26 -0
  139. package/dist/client/components/LiveNotices.js +211 -0
  140. package/dist/client/components/MinorMoneyInput.d.ts +26 -0
  141. package/dist/client/components/MinorMoneyInput.js +50 -0
  142. package/dist/client/components/Modal.css +3 -0
  143. package/dist/client/components/MultiStepForm.css +122 -0
  144. package/dist/client/components/MultiStepForm.d.ts +59 -0
  145. package/dist/client/components/MultiStepForm.js +216 -0
  146. package/dist/client/components/NavGlyph.d.ts +14 -0
  147. package/dist/client/components/NavGlyph.js +27 -0
  148. package/dist/client/components/Nested.d.ts +21 -0
  149. package/dist/client/components/Nested.js +86 -0
  150. package/dist/client/components/NewRecord.d.ts +89 -0
  151. package/dist/client/components/NewRecord.js +897 -0
  152. package/dist/client/components/NewRecordButton.d.ts +13 -0
  153. package/dist/client/components/NewRecordButton.js +28 -0
  154. package/dist/client/components/Notes.css +39 -0
  155. package/dist/client/components/Notes.d.ts +59 -0
  156. package/dist/client/components/Notes.js +96 -0
  157. package/dist/client/components/OverflowMenu.d.ts +3 -0
  158. package/dist/client/components/OverflowMenu.js +60 -0
  159. package/dist/client/components/Page.d.ts +52 -0
  160. package/dist/client/components/Page.js +237 -0
  161. package/dist/client/components/PageCurrent.d.ts +38 -0
  162. package/dist/client/components/PageCurrent.js +27 -0
  163. package/dist/client/components/PageEmptyRun.d.ts +18 -0
  164. package/dist/client/components/PageEmptyRun.js +118 -0
  165. package/dist/client/components/PageFields.d.ts +3 -0
  166. package/dist/client/components/PageFields.js +294 -0
  167. package/dist/client/components/PageFlowDiagram.css +193 -0
  168. package/dist/client/components/PageFlowDiagram.d.ts +95 -0
  169. package/dist/client/components/PageFlowDiagram.js +276 -0
  170. package/dist/client/components/PageFlows.css +27 -0
  171. package/dist/client/components/PageFlows.d.ts +54 -0
  172. package/dist/client/components/PageFlows.js +92 -0
  173. package/dist/client/components/PageGroups.d.ts +43 -0
  174. package/dist/client/components/PageGroups.js +123 -0
  175. package/dist/client/components/PageHead.d.ts +28 -0
  176. package/dist/client/components/PageHead.js +279 -0
  177. package/dist/client/components/PageHeadline.d.ts +23 -0
  178. package/dist/client/components/PageHeadline.js +101 -0
  179. package/dist/client/components/PageHistory.d.ts +62 -0
  180. package/dist/client/components/PageHistory.js +160 -0
  181. package/dist/client/components/PageLayout.d.ts +22 -0
  182. package/dist/client/components/PageLayout.js +13 -0
  183. package/dist/client/components/PageMetrics.d.ts +11 -0
  184. package/dist/client/components/PageMetrics.js +252 -0
  185. package/dist/client/components/PageRelated.d.ts +70 -0
  186. package/dist/client/components/PageRelated.js +667 -0
  187. package/dist/client/components/PageRoom.d.ts +37 -0
  188. package/dist/client/components/PageRoom.js +277 -0
  189. package/dist/client/components/PageSectionBox.d.ts +28 -0
  190. package/dist/client/components/PageSectionBox.js +65 -0
  191. package/dist/client/components/PageSections.d.ts +38 -0
  192. package/dist/client/components/PageSections.js +352 -0
  193. package/dist/client/components/PageSkeleton.css +17 -0
  194. package/dist/client/components/PageSkeleton.d.ts +11 -0
  195. package/dist/client/components/PageSkeleton.js +25 -0
  196. package/dist/client/components/PageTimeline.d.ts +2 -0
  197. package/dist/client/components/PageTimeline.js +273 -0
  198. package/dist/client/components/Palette.d.ts +4 -0
  199. package/dist/client/components/Palette.js +176 -0
  200. package/dist/client/components/Peek.d.ts +1 -0
  201. package/dist/client/components/Peek.js +158 -0
  202. package/dist/client/components/PeekPanel.d.ts +16 -0
  203. package/dist/client/components/PeekPanel.js +120 -0
  204. package/dist/client/components/Picker.d.ts +13 -0
  205. package/dist/client/components/Picker.js +33 -0
  206. package/dist/client/components/Prefs.d.ts +3 -0
  207. package/dist/client/components/Prefs.js +121 -0
  208. package/dist/client/components/PresentationSwitch.d.ts +13 -0
  209. package/dist/client/components/PresentationSwitch.js +10 -0
  210. package/dist/client/components/Prompt.d.ts +35 -0
  211. package/dist/client/components/Prompt.js +114 -0
  212. package/dist/client/components/QrCode.css +11 -0
  213. package/dist/client/components/QrCode.d.ts +4 -0
  214. package/dist/client/components/QrCode.js +57 -0
  215. package/dist/client/components/QueueList.css +122 -0
  216. package/dist/client/components/QuickAdd.css +18 -0
  217. package/dist/client/components/QuickAdd.d.ts +11 -0
  218. package/dist/client/components/QuickAdd.js +53 -0
  219. package/dist/client/components/QuickAddOnDemand.d.ts +4 -0
  220. package/dist/client/components/QuickAddOnDemand.js +10 -0
  221. package/dist/client/components/Record.d.ts +36 -0
  222. package/dist/client/components/Record.js +385 -0
  223. package/dist/client/components/RecordGone.d.ts +7 -0
  224. package/dist/client/components/RecordGone.js +22 -0
  225. package/dist/client/components/RecordPicker.d.ts +59 -0
  226. package/dist/client/components/RecordPicker.js +299 -0
  227. package/dist/client/components/RecordSummaries.d.ts +55 -0
  228. package/dist/client/components/RecordSummaries.js +151 -0
  229. package/dist/client/components/RecordTags.d.ts +6 -0
  230. package/dist/client/components/RecordTags.js +119 -0
  231. package/dist/client/components/RecordTrailNav.d.ts +25 -0
  232. package/dist/client/components/RecordTrailNav.js +110 -0
  233. package/dist/client/components/RichText.d.ts +7 -0
  234. package/dist/client/components/RichText.js +82 -0
  235. package/dist/client/components/RichTextEditor.css +202 -0
  236. package/dist/client/components/RichTextEditor.d.ts +33 -0
  237. package/dist/client/components/RichTextEditor.js +348 -0
  238. package/dist/client/components/RichTextField.d.ts +26 -0
  239. package/dist/client/components/RichTextField.js +71 -0
  240. package/dist/client/components/Rooms.d.ts +35 -0
  241. package/dist/client/components/Rooms.js +276 -0
  242. package/dist/client/components/RowActions.d.ts +8 -0
  243. package/dist/client/components/RowActions.js +49 -0
  244. package/dist/client/components/RowHost.d.ts +110 -0
  245. package/dist/client/components/RowHost.js +212 -0
  246. package/dist/client/components/SavedViews.d.ts +25 -0
  247. package/dist/client/components/SavedViews.js +35 -0
  248. package/dist/client/components/SchemaExport.d.ts +15 -0
  249. package/dist/client/components/SchemaExport.js +42 -0
  250. package/dist/client/components/SectionPeriod.css +14 -0
  251. package/dist/client/components/SectionPeriod.d.ts +7 -0
  252. package/dist/client/components/SectionPeriod.js +14 -0
  253. package/dist/client/components/SetFieldDialog.d.ts +12 -0
  254. package/dist/client/components/SetFieldDialog.js +51 -0
  255. package/dist/client/components/Sidebar.d.ts +34 -0
  256. package/dist/client/components/Sidebar.js +398 -0
  257. package/dist/client/components/Skeleton.d.ts +35 -0
  258. package/dist/client/components/Skeleton.js +49 -0
  259. package/dist/client/components/SortMenu.d.ts +20 -0
  260. package/dist/client/components/SortMenu.js +45 -0
  261. package/dist/client/components/SplitListDetail.css +119 -0
  262. package/dist/client/components/SuggestBox.d.ts +29 -0
  263. package/dist/client/components/SuggestBox.js +60 -0
  264. package/dist/client/components/Summary.d.ts +14 -0
  265. package/dist/client/components/Summary.js +93 -0
  266. package/dist/client/components/TableRoom.d.ts +88 -0
  267. package/dist/client/components/TableRoom.js +246 -0
  268. package/dist/client/components/TableView.d.ts +111 -0
  269. package/dist/client/components/TableView.js +324 -0
  270. package/dist/client/components/ThMenu.d.ts +40 -0
  271. package/dist/client/components/ThMenu.js +163 -0
  272. package/dist/client/components/ThemeLab.d.ts +4 -0
  273. package/dist/client/components/ThemeLab.js +67 -0
  274. package/dist/client/components/TimelineSides.css +23 -0
  275. package/dist/client/components/TimelineSides.d.ts +7 -0
  276. package/dist/client/components/TimelineSides.js +9 -0
  277. package/dist/client/components/Tour.d.ts +12 -0
  278. package/dist/client/components/Tour.js +131 -0
  279. package/dist/client/components/Value.d.ts +38 -0
  280. package/dist/client/components/Value.js +172 -0
  281. package/dist/client/components/WorkPanel.d.ts +9 -0
  282. package/dist/client/components/WorkPanel.js +43 -0
  283. package/dist/client/components/WorkflowStatus.d.ts +6 -0
  284. package/dist/client/components/WorkflowStatus.js +44 -0
  285. package/dist/client/components/WriteConfirm.d.ts +4 -0
  286. package/dist/client/components/WriteConfirm.js +27 -0
  287. package/dist/client/components/appColumnMenuModel.d.ts +46 -0
  288. package/dist/client/components/appColumnMenuModel.js +51 -0
  289. package/dist/client/components/appListModel.d.ts +179 -0
  290. package/dist/client/components/appListModel.js +421 -0
  291. package/dist/client/components/appRooms.d.ts +106 -0
  292. package/dist/client/components/appRooms.js +133 -0
  293. package/dist/client/components/autoChart.d.ts +33 -0
  294. package/dist/client/components/autoChart.js +107 -0
  295. package/dist/client/components/avatarPhotos.d.ts +45 -0
  296. package/dist/client/components/avatarPhotos.js +93 -0
  297. package/dist/client/components/besideDetail.d.ts +1 -0
  298. package/dist/client/components/besideDetail.js +10 -0
  299. package/dist/client/components/boardNew.d.ts +2 -0
  300. package/dist/client/components/boardNew.js +8 -0
  301. package/dist/client/components/cardsModel.d.ts +11 -0
  302. package/dist/client/components/cardsModel.js +24 -0
  303. package/dist/client/components/chromeIcons.d.ts +16 -0
  304. package/dist/client/components/chromeIcons.js +16 -0
  305. package/dist/client/components/columnPresentation.d.ts +8 -0
  306. package/dist/client/components/columnPresentation.js +47 -0
  307. package/dist/client/components/componentSlot.d.ts +31 -0
  308. package/dist/client/components/componentSlot.js +76 -0
  309. package/dist/client/components/composerDraft.d.ts +16 -0
  310. package/dist/client/components/composerDraft.js +16 -0
  311. package/dist/client/components/conditionText.d.ts +14 -0
  312. package/dist/client/components/conditionText.js +45 -0
  313. package/dist/client/components/conditionWords.d.ts +37 -0
  314. package/dist/client/components/conditionWords.js +382 -0
  315. package/dist/client/components/crumbSlot.d.ts +14 -0
  316. package/dist/client/components/crumbSlot.js +49 -0
  317. package/dist/client/components/dashboardModel.d.ts +283 -0
  318. package/dist/client/components/dashboardModel.js +415 -0
  319. package/dist/client/components/dashboardParts.d.ts +9 -0
  320. package/dist/client/components/dashboardParts.js +18 -0
  321. package/dist/client/components/diagramModel.d.ts +83 -0
  322. package/dist/client/components/diagramModel.js +211 -0
  323. package/dist/client/components/dueOpen.d.ts +1 -0
  324. package/dist/client/components/dueOpen.js +23 -0
  325. package/dist/client/components/editInteraction.d.ts +20 -0
  326. package/dist/client/components/editInteraction.js +178 -0
  327. package/dist/client/components/favoriteNav.d.ts +6 -0
  328. package/dist/client/components/favoriteNav.js +31 -0
  329. package/dist/client/components/favorites.d.ts +23 -0
  330. package/dist/client/components/favorites.js +86 -0
  331. package/dist/client/components/filePreviewModel.d.ts +18 -0
  332. package/dist/client/components/filePreviewModel.js +21 -0
  333. package/dist/client/components/filterRailModel.d.ts +93 -0
  334. package/dist/client/components/filterRailModel.js +302 -0
  335. package/dist/client/components/formControlsStyle.d.ts +1 -0
  336. package/dist/client/components/formControlsStyle.js +3 -0
  337. package/dist/client/components/formDefaults.d.ts +17 -0
  338. package/dist/client/components/formDefaults.js +128 -0
  339. package/dist/client/components/gridArrange.d.ts +33 -0
  340. package/dist/client/components/gridArrange.js +62 -0
  341. package/dist/client/components/gridCellModel.d.ts +32 -0
  342. package/dist/client/components/gridCellModel.js +42 -0
  343. package/dist/client/components/gridSizing.d.ts +89 -0
  344. package/dist/client/components/gridSizing.js +295 -0
  345. package/dist/client/components/groupMoves.d.ts +44 -0
  346. package/dist/client/components/groupMoves.js +295 -0
  347. package/dist/client/components/groupOrder.d.ts +43 -0
  348. package/dist/client/components/groupOrder.js +63 -0
  349. package/dist/client/components/inputRenderers.d.ts +48 -0
  350. package/dist/client/components/inputRenderers.js +37 -0
  351. package/dist/client/components/intakeStyle.d.ts +2 -0
  352. package/dist/client/components/intakeStyle.js +6 -0
  353. package/dist/client/components/jsonModel.d.ts +98 -0
  354. package/dist/client/components/jsonModel.js +264 -0
  355. package/dist/client/components/listColumn.d.ts +20 -0
  356. package/dist/client/components/listColumn.js +31 -0
  357. package/dist/client/components/listNavigation.d.ts +16 -0
  358. package/dist/client/components/listNavigation.js +14 -0
  359. package/dist/client/components/mentionRows.d.ts +5 -0
  360. package/dist/client/components/mentionRows.js +62 -0
  361. package/dist/client/components/mount.d.ts +55 -0
  362. package/dist/client/components/mount.js +155 -0
  363. package/dist/client/components/myViews.d.ts +54 -0
  364. package/dist/client/components/myViews.js +82 -0
  365. package/dist/client/components/navCounts.d.ts +84 -0
  366. package/dist/client/components/navCounts.js +194 -0
  367. package/dist/client/components/navigationTree.d.ts +52 -0
  368. package/dist/client/components/navigationTree.js +49 -0
  369. package/dist/client/components/newMenuModel.d.ts +27 -0
  370. package/dist/client/components/newMenuModel.js +58 -0
  371. package/dist/client/components/newRecordModel.d.ts +58 -0
  372. package/dist/client/components/newRecordModel.js +232 -0
  373. package/dist/client/components/onDemand.d.ts +30 -0
  374. package/dist/client/components/onDemand.js +121 -0
  375. package/dist/client/components/optimisticMoves.d.ts +21 -0
  376. package/dist/client/components/optimisticMoves.js +145 -0
  377. package/dist/client/components/pageContext.d.ts +154 -0
  378. package/dist/client/components/pageContext.js +47 -0
  379. package/dist/client/components/pageFieldsRead.d.ts +67 -0
  380. package/dist/client/components/pageFieldsRead.js +55 -0
  381. package/dist/client/components/pageModel.d.ts +203 -0
  382. package/dist/client/components/pageModel.js +67 -0
  383. package/dist/client/components/pageStep.d.ts +31 -0
  384. package/dist/client/components/pageStep.js +15 -0
  385. package/dist/client/components/paletteModel.d.ts +9 -0
  386. package/dist/client/components/paletteModel.js +46 -0
  387. package/dist/client/components/pickerStaleness.d.ts +32 -0
  388. package/dist/client/components/pickerStaleness.js +27 -0
  389. package/dist/client/components/placeOrder.d.ts +47 -0
  390. package/dist/client/components/placeOrder.js +71 -0
  391. package/dist/client/components/pointerDrag.d.ts +54 -0
  392. package/dist/client/components/pointerDrag.js +95 -0
  393. package/dist/client/components/presentationFit.d.ts +19 -0
  394. package/dist/client/components/presentationFit.js +32 -0
  395. package/dist/client/components/recordKeys.d.ts +2 -0
  396. package/dist/client/components/recordKeys.js +8 -0
  397. package/dist/client/components/recordSearch.d.ts +31 -0
  398. package/dist/client/components/recordSearch.js +80 -0
  399. package/dist/client/components/recordSurface.d.ts +86 -0
  400. package/dist/client/components/recordSurface.js +267 -0
  401. package/dist/client/components/rowOpens.d.ts +19 -0
  402. package/dist/client/components/rowOpens.js +25 -0
  403. package/dist/client/components/sidebarModel.d.ts +152 -0
  404. package/dist/client/components/sidebarModel.js +372 -0
  405. package/dist/client/components/suggestModel.d.ts +22 -0
  406. package/dist/client/components/suggestModel.js +49 -0
  407. package/dist/client/components/suggestPart.d.ts +4 -0
  408. package/dist/client/components/suggestPart.js +4 -0
  409. package/dist/client/components/textMeasure.d.ts +2 -0
  410. package/dist/client/components/textMeasure.js +35 -0
  411. package/dist/client/components/unknownIcon.d.ts +8 -0
  412. package/dist/client/components/unknownIcon.js +32 -0
  413. package/dist/client/components/useBulkSelection.d.ts +30 -0
  414. package/dist/client/components/useBulkSelection.js +360 -0
  415. package/dist/client/components/useConditionWords.d.ts +17 -0
  416. package/dist/client/components/useConditionWords.js +104 -0
  417. package/dist/client/components/useGridKeyboard.d.ts +32 -0
  418. package/dist/client/components/useGridKeyboard.js +223 -0
  419. package/dist/client/components/useListOrder.d.ts +94 -0
  420. package/dist/client/components/useListOrder.js +294 -0
  421. package/dist/client/components/useMediaQuery.d.ts +10 -0
  422. package/dist/client/components/useMediaQuery.js +45 -0
  423. package/dist/client/components/useMessageLanguage.d.ts +1 -0
  424. package/dist/client/components/useMessageLanguage.js +6 -0
  425. package/dist/client/components/usePins.d.ts +20 -0
  426. package/dist/client/components/usePins.js +66 -0
  427. package/dist/client/components/usePointerDrag.d.ts +72 -0
  428. package/dist/client/components/usePointerDrag.js +553 -0
  429. package/dist/client/components/useRecordInsert.d.ts +42 -0
  430. package/dist/client/components/useRecordInsert.js +145 -0
  431. package/dist/client/components/useRowWindow.d.ts +35 -0
  432. package/dist/client/components/useRowWindow.js +149 -0
  433. package/dist/client/components/useStickyHead.d.ts +17 -0
  434. package/dist/client/components/useStickyHead.js +65 -0
  435. package/dist/client/components/useTabFold.d.ts +32 -0
  436. package/dist/client/components/useTabFold.js +145 -0
  437. package/dist/client/components/valueModel.d.ts +300 -0
  438. package/dist/client/components/valueModel.js +560 -0
  439. package/dist/client/components/valueRenderers.d.ts +36 -0
  440. package/dist/client/components/valueRenderers.js +13 -0
  441. package/dist/client/components/viewLink.d.ts +27 -0
  442. package/dist/client/components/viewLink.js +79 -0
  443. package/dist/client/components/walk.d.ts +14 -0
  444. package/dist/client/components/walk.js +16 -0
  445. package/dist/client/compose.d.ts +8 -0
  446. package/dist/client/compose.js +163 -0
  447. package/dist/client/composedHook.d.ts +20 -0
  448. package/dist/client/composedHook.js +12 -0
  449. package/dist/client/composedReads.d.ts +26 -0
  450. package/dist/client/composedReads.js +183 -0
  451. package/dist/client/composer.css +499 -0
  452. package/dist/client/composer.d.ts +121 -0
  453. package/dist/client/composer.js +1079 -0
  454. package/dist/client/composerEntry.d.ts +1 -0
  455. package/dist/client/composerEntry.js +58 -0
  456. package/dist/client/composerTab.d.ts +6 -0
  457. package/dist/client/composerTab.js +20 -0
  458. package/dist/client/conditions.d.ts +46 -0
  459. package/dist/client/conditions.js +150 -0
  460. package/dist/client/connectionList.d.ts +11 -0
  461. package/dist/client/connectionList.js +146 -0
  462. package/dist/client/connectionScope.d.ts +6 -0
  463. package/dist/client/connectionScope.js +14 -0
  464. package/dist/client/connectionTransition.d.ts +12 -0
  465. package/dist/client/connectionTransition.js +41 -0
  466. package/dist/client/copy/columnMenu/components/AppColumnMenu.d.ts +4 -0
  467. package/dist/client/copy/columnMenu/components/AppColumnMenu.js +6 -0
  468. package/dist/client/copy/columnMenu/components/AppColumnMenuPopups.d.ts +4 -0
  469. package/dist/client/copy/columnMenu/components/AppColumnMenuPopups.js +6 -0
  470. package/dist/client/copy/columnMenu/components/ThMenu.d.ts +35 -0
  471. package/dist/client/copy/columnMenu/components/ThMenu.js +37 -0
  472. package/dist/client/copy/columnMenu/components/appColumnMenuModel.d.ts +10 -0
  473. package/dist/client/copy/columnMenu/components/appColumnMenuModel.js +12 -0
  474. package/dist/client/copy/dashboards/breakdownBatch.d.ts +3 -0
  475. package/dist/client/copy/dashboards/breakdownBatch.js +5 -0
  476. package/dist/client/copy/dashboards/components/Breakdown.d.ts +32 -0
  477. package/dist/client/copy/dashboards/components/Breakdown.js +25 -0
  478. package/dist/client/copy/dashboards/components/BreakdownRoom.d.ts +3 -0
  479. package/dist/client/copy/dashboards/components/BreakdownRoom.js +5 -0
  480. package/dist/client/copy/dashboards/components/Chart.d.ts +26 -0
  481. package/dist/client/copy/dashboards/components/Chart.js +19 -0
  482. package/dist/client/copy/dashboards/components/ChartShapes.d.ts +16 -0
  483. package/dist/client/copy/dashboards/components/ChartShapes.js +12 -0
  484. package/dist/client/copy/dashboards/components/PageMetrics.d.ts +21 -0
  485. package/dist/client/copy/dashboards/components/PageMetrics.js +20 -0
  486. package/dist/client/copy/dashboards/components/SectionPeriod.d.ts +4 -0
  487. package/dist/client/copy/dashboards/components/SectionPeriod.js +6 -0
  488. package/dist/client/copy/dashboards/components/dashboardModel.d.ts +3 -0
  489. package/dist/client/copy/dashboards/components/dashboardModel.js +5 -0
  490. package/dist/client/copy/es.d.ts +11 -0
  491. package/dist/client/copy/es.js +60 -0
  492. package/dist/client/copy/filters/components/FilterBoxes.d.ts +10 -0
  493. package/dist/client/copy/filters/components/FilterBoxes.js +12 -0
  494. package/dist/client/copy/filters/components/FilterRail.d.ts +16 -0
  495. package/dist/client/copy/filters/components/FilterRail.js +18 -0
  496. package/dist/client/copy/filters/components/ListFilterBar.d.ts +9 -0
  497. package/dist/client/copy/filters/components/ListFilterBar.js +11 -0
  498. package/dist/client/copy/filters/components/conditionWords.d.ts +46 -0
  499. package/dist/client/copy/filters/components/conditionWords.js +95 -0
  500. package/dist/client/copy/filters/components/filterRailModel.d.ts +12 -0
  501. package/dist/client/copy/filters/components/filterRailModel.js +14 -0
  502. package/dist/client/copy/forms/components/DateField.d.ts +13 -0
  503. package/dist/client/copy/forms/components/DateField.js +15 -0
  504. package/dist/client/copy/forms/components/MinorMoneyInput.d.ts +4 -0
  505. package/dist/client/copy/forms/components/MinorMoneyInput.js +6 -0
  506. package/dist/client/copy/forms/components/MultiStepForm.d.ts +10 -0
  507. package/dist/client/copy/forms/components/MultiStepForm.js +12 -0
  508. package/dist/client/copy/forms/components/NewRecord.d.ts +29 -0
  509. package/dist/client/copy/forms/components/NewRecord.js +31 -0
  510. package/dist/client/copy/forms/components/NewRecordButton.d.ts +6 -0
  511. package/dist/client/copy/forms/components/NewRecordButton.js +8 -0
  512. package/dist/client/copy/forms/components/Picker.d.ts +4 -0
  513. package/dist/client/copy/forms/components/Picker.js +6 -0
  514. package/dist/client/copy/forms/components/QuickAdd.d.ts +3 -0
  515. package/dist/client/copy/forms/components/QuickAdd.js +5 -0
  516. package/dist/client/copy/forms/components/RecordPicker.d.ts +6 -0
  517. package/dist/client/copy/forms/components/RecordPicker.js +8 -0
  518. package/dist/client/copy/forms/components/RichTextEditor.d.ts +36 -0
  519. package/dist/client/copy/forms/components/RichTextEditor.js +40 -0
  520. package/dist/client/copy/forms/components/RichTextField.d.ts +3 -0
  521. package/dist/client/copy/forms/components/RichTextField.js +5 -0
  522. package/dist/client/copy/forms/components/SetFieldDialog.d.ts +10 -0
  523. package/dist/client/copy/forms/components/SetFieldDialog.js +9 -0
  524. package/dist/client/copy/forms/components/useRecordInsert.d.ts +7 -0
  525. package/dist/client/copy/forms/components/useRecordInsert.js +9 -0
  526. package/dist/client/copy/help/helpContent.d.ts +71 -0
  527. package/dist/client/copy/help/helpContent.js +73 -0
  528. package/dist/client/copy/lists/bulkActions.d.ts +12 -0
  529. package/dist/client/copy/lists/bulkActions.js +14 -0
  530. package/dist/client/copy/lists/components/AppList.d.ts +28 -0
  531. package/dist/client/copy/lists/components/AppList.js +30 -0
  532. package/dist/client/copy/lists/components/CardsList.d.ts +3 -0
  533. package/dist/client/copy/lists/components/CardsList.js +5 -0
  534. package/dist/client/copy/lists/components/Gallery.d.ts +7 -0
  535. package/dist/client/copy/lists/components/Gallery.js +9 -0
  536. package/dist/client/copy/lists/components/Grid.d.ts +30 -0
  537. package/dist/client/copy/lists/components/Grid.js +29 -0
  538. package/dist/client/copy/lists/components/GridCellEditor.d.ts +5 -0
  539. package/dist/client/copy/lists/components/GridCellEditor.js +7 -0
  540. package/dist/client/copy/lists/components/GridSelection.d.ts +4 -0
  541. package/dist/client/copy/lists/components/GridSelection.js +6 -0
  542. package/dist/client/copy/lists/components/Nested.d.ts +7 -0
  543. package/dist/client/copy/lists/components/Nested.js +9 -0
  544. package/dist/client/copy/lists/components/RowActions.d.ts +1 -0
  545. package/dist/client/copy/lists/components/RowActions.js +3 -0
  546. package/dist/client/copy/lists/components/SavedViews.d.ts +5 -0
  547. package/dist/client/copy/lists/components/SavedViews.js +7 -0
  548. package/dist/client/copy/lists/components/SortMenu.d.ts +5 -0
  549. package/dist/client/copy/lists/components/SortMenu.js +7 -0
  550. package/dist/client/copy/lists/components/TableRoom.d.ts +12 -0
  551. package/dist/client/copy/lists/components/TableRoom.js +14 -0
  552. package/dist/client/copy/lists/components/TableView.d.ts +37 -0
  553. package/dist/client/copy/lists/components/TableView.js +39 -0
  554. package/dist/client/copy/lists/components/appListModel.d.ts +6 -0
  555. package/dist/client/copy/lists/components/appListModel.js +5 -0
  556. package/dist/client/copy/lists/components/myViews.d.ts +4 -0
  557. package/dist/client/copy/lists/components/myViews.js +6 -0
  558. package/dist/client/copy/lists/components/placeOrder.d.ts +4 -0
  559. package/dist/client/copy/lists/components/placeOrder.js +6 -0
  560. package/dist/client/copy/lists/components/useBulkSelection.d.ts +20 -0
  561. package/dist/client/copy/lists/components/useBulkSelection.js +16 -0
  562. package/dist/client/copy/lists/components/useListOrder.d.ts +7 -0
  563. package/dist/client/copy/lists/components/useListOrder.js +9 -0
  564. package/dist/client/copy/public/components/appRooms.d.ts +3 -0
  565. package/dist/client/copy/public/components/appRooms.js +5 -0
  566. package/dist/client/copy/record/components/Actions.d.ts +13 -0
  567. package/dist/client/copy/record/components/Actions.js +15 -0
  568. package/dist/client/copy/record/components/AttachmentList.d.ts +23 -0
  569. package/dist/client/copy/record/components/AttachmentList.js +22 -0
  570. package/dist/client/copy/record/components/DeleteButton.d.ts +22 -0
  571. package/dist/client/copy/record/components/DeleteButton.js +24 -0
  572. package/dist/client/copy/record/components/Dressed.d.ts +5 -0
  573. package/dist/client/copy/record/components/Dressed.js +7 -0
  574. package/dist/client/copy/record/components/EditLayoutButton.d.ts +5 -0
  575. package/dist/client/copy/record/components/EditLayoutButton.js +7 -0
  576. package/dist/client/copy/record/components/Editable.d.ts +25 -0
  577. package/dist/client/copy/record/components/Editable.js +24 -0
  578. package/dist/client/copy/record/components/FieldArranger.d.ts +15 -0
  579. package/dist/client/copy/record/components/FieldArranger.js +17 -0
  580. package/dist/client/copy/record/components/FilePreview.d.ts +13 -0
  581. package/dist/client/copy/record/components/FilePreview.js +15 -0
  582. package/dist/client/copy/record/components/JsonPreview.d.ts +3 -0
  583. package/dist/client/copy/record/components/JsonPreview.js +5 -0
  584. package/dist/client/copy/record/components/JsonView.d.ts +12 -0
  585. package/dist/client/copy/record/components/JsonView.js +14 -0
  586. package/dist/client/copy/record/components/LayoutBuilder.d.ts +23 -0
  587. package/dist/client/copy/record/components/LayoutBuilder.js +25 -0
  588. package/dist/client/copy/record/components/Lightbox.d.ts +5 -0
  589. package/dist/client/copy/record/components/Lightbox.js +7 -0
  590. package/dist/client/copy/record/components/LiveNotices.d.ts +33 -0
  591. package/dist/client/copy/record/components/LiveNotices.js +29 -0
  592. package/dist/client/copy/record/components/PageCurrent.d.ts +1 -0
  593. package/dist/client/copy/record/components/PageCurrent.js +3 -0
  594. package/dist/client/copy/record/components/PageEmptyRun.d.ts +3 -0
  595. package/dist/client/copy/record/components/PageEmptyRun.js +5 -0
  596. package/dist/client/copy/record/components/PageFields.d.ts +5 -0
  597. package/dist/client/copy/record/components/PageFields.js +7 -0
  598. package/dist/client/copy/record/components/PageFlowDiagram.d.ts +33 -0
  599. package/dist/client/copy/record/components/PageFlowDiagram.js +37 -0
  600. package/dist/client/copy/record/components/PageFlows.d.ts +20 -0
  601. package/dist/client/copy/record/components/PageFlows.js +22 -0
  602. package/dist/client/copy/record/components/PageGroups.d.ts +12 -0
  603. package/dist/client/copy/record/components/PageGroups.js +14 -0
  604. package/dist/client/copy/record/components/PageHead.d.ts +8 -0
  605. package/dist/client/copy/record/components/PageHead.js +10 -0
  606. package/dist/client/copy/record/components/PageHistory.d.ts +18 -0
  607. package/dist/client/copy/record/components/PageHistory.js +20 -0
  608. package/dist/client/copy/record/components/PageLayout.d.ts +5 -0
  609. package/dist/client/copy/record/components/PageLayout.js +7 -0
  610. package/dist/client/copy/record/components/PageRelated.d.ts +24 -0
  611. package/dist/client/copy/record/components/PageRelated.js +26 -0
  612. package/dist/client/copy/record/components/PageRoom.d.ts +4 -0
  613. package/dist/client/copy/record/components/PageRoom.js +6 -0
  614. package/dist/client/copy/record/components/PageSectionBox.d.ts +6 -0
  615. package/dist/client/copy/record/components/PageSectionBox.js +10 -0
  616. package/dist/client/copy/record/components/PageTimeline.d.ts +9 -0
  617. package/dist/client/copy/record/components/PageTimeline.js +8 -0
  618. package/dist/client/copy/record/components/Peek.d.ts +3 -0
  619. package/dist/client/copy/record/components/Peek.js +5 -0
  620. package/dist/client/copy/record/components/PeekPanel.d.ts +5 -0
  621. package/dist/client/copy/record/components/PeekPanel.js +7 -0
  622. package/dist/client/copy/record/components/QrCode.d.ts +3 -0
  623. package/dist/client/copy/record/components/QrCode.js +5 -0
  624. package/dist/client/copy/record/components/Record.d.ts +19 -0
  625. package/dist/client/copy/record/components/Record.js +21 -0
  626. package/dist/client/copy/record/components/RecordGone.d.ts +4 -0
  627. package/dist/client/copy/record/components/RecordGone.js +6 -0
  628. package/dist/client/copy/record/components/RecordSummaries.d.ts +1 -0
  629. package/dist/client/copy/record/components/RecordSummaries.js +3 -0
  630. package/dist/client/copy/record/components/RecordTags.d.ts +9 -0
  631. package/dist/client/copy/record/components/RecordTags.js +11 -0
  632. package/dist/client/copy/record/components/RecordTrailNav.d.ts +8 -0
  633. package/dist/client/copy/record/components/RecordTrailNav.js +10 -0
  634. package/dist/client/copy/record/components/RichText.d.ts +4 -0
  635. package/dist/client/copy/record/components/RichText.js +6 -0
  636. package/dist/client/copy/record/components/Value.d.ts +4 -0
  637. package/dist/client/copy/record/components/Value.js +6 -0
  638. package/dist/client/copy/record/components/WorkflowStatus.d.ts +7 -0
  639. package/dist/client/copy/record/components/WorkflowStatus.js +9 -0
  640. package/dist/client/copy/record/components/WriteConfirm.d.ts +11 -0
  641. package/dist/client/copy/record/components/WriteConfirm.js +13 -0
  642. package/dist/client/copy/record/components/groupMoves.d.ts +7 -0
  643. package/dist/client/copy/record/components/groupMoves.js +9 -0
  644. package/dist/client/copy/record/components/jsonModel.d.ts +3 -0
  645. package/dist/client/copy/record/components/jsonModel.js +5 -0
  646. package/dist/client/copy/record/components/pageModel.d.ts +5 -0
  647. package/dist/client/copy/record/components/pageModel.js +7 -0
  648. package/dist/client/copy/record/components/recordSurface.d.ts +6 -0
  649. package/dist/client/copy/record/components/recordSurface.js +8 -0
  650. package/dist/client/copy/record/components/valueModel.d.ts +5 -0
  651. package/dist/client/copy/record/components/valueModel.js +7 -0
  652. package/dist/client/copy/record/fileSource.d.ts +3 -0
  653. package/dist/client/copy/record/fileSource.js +5 -0
  654. package/dist/client/copy/record/insert.d.ts +6 -0
  655. package/dist/client/copy/record/insert.js +8 -0
  656. package/dist/client/copy/record/page.d.ts +4 -0
  657. package/dist/client/copy/record/page.js +6 -0
  658. package/dist/client/copy/record/recordEditValidation.d.ts +4 -0
  659. package/dist/client/copy/record/recordEditValidation.js +6 -0
  660. package/dist/client/copy/record/savedPages.d.ts +4 -0
  661. package/dist/client/copy/record/savedPages.js +6 -0
  662. package/dist/client/copy/record/template.d.ts +9 -0
  663. package/dist/client/copy/record/template.js +11 -0
  664. package/dist/client/copy/record/write.d.ts +30 -0
  665. package/dist/client/copy/record/write.js +26 -0
  666. package/dist/client/copy/shell/app.d.ts +27 -0
  667. package/dist/client/copy/shell/app.js +43 -0
  668. package/dist/client/copy/shell/components/AppIssues.d.ts +10 -0
  669. package/dist/client/copy/shell/components/AppIssues.js +9 -0
  670. package/dist/client/copy/shell/components/Crumbs.d.ts +7 -0
  671. package/dist/client/copy/shell/components/Crumbs.js +17 -0
  672. package/dist/client/copy/shell/components/Dropdown.d.ts +3 -0
  673. package/dist/client/copy/shell/components/Dropdown.js +5 -0
  674. package/dist/client/copy/shell/components/ErrorBoundary.d.ts +4 -0
  675. package/dist/client/copy/shell/components/ErrorBoundary.js +6 -0
  676. package/dist/client/copy/shell/components/FavoriteStar.d.ts +4 -0
  677. package/dist/client/copy/shell/components/FavoriteStar.js +6 -0
  678. package/dist/client/copy/shell/components/MobileNavDrawer.d.ts +4 -0
  679. package/dist/client/copy/shell/components/MobileNavDrawer.js +12 -0
  680. package/dist/client/copy/shell/components/OverflowMenu.d.ts +3 -0
  681. package/dist/client/copy/shell/components/OverflowMenu.js +10 -0
  682. package/dist/client/copy/shell/components/Palette.d.ts +15 -0
  683. package/dist/client/copy/shell/components/Palette.js +18 -0
  684. package/dist/client/copy/shell/components/Prefs.d.ts +4 -0
  685. package/dist/client/copy/shell/components/Prefs.js +11 -0
  686. package/dist/client/copy/shell/components/Prompt.d.ts +1 -0
  687. package/dist/client/copy/shell/components/Prompt.js +3 -0
  688. package/dist/client/copy/shell/components/Rooms.d.ts +6 -0
  689. package/dist/client/copy/shell/components/Rooms.js +8 -0
  690. package/dist/client/copy/shell/components/Sidebar.d.ts +7 -0
  691. package/dist/client/copy/shell/components/Sidebar.js +9 -0
  692. package/dist/client/copy/shell/components/Skeleton.d.ts +5 -0
  693. package/dist/client/copy/shell/components/Skeleton.js +7 -0
  694. package/dist/client/copy/shell/components/TopNav.d.ts +4 -0
  695. package/dist/client/copy/shell/components/TopNav.js +12 -0
  696. package/dist/client/copy/shell/components/Tour.d.ts +4 -0
  697. package/dist/client/copy/shell/components/Tour.js +6 -0
  698. package/dist/client/copy/shell/components/newMenuModel.d.ts +3 -0
  699. package/dist/client/copy/shell/components/newMenuModel.js +5 -0
  700. package/dist/client/copy/shell/components/onDemand.d.ts +3 -0
  701. package/dist/client/copy/shell/components/onDemand.js +5 -0
  702. package/dist/client/copy/shell/components/sidebarModel.d.ts +3 -0
  703. package/dist/client/copy/shell/components/sidebarModel.js +5 -0
  704. package/dist/client/copy/shell/connectionList.d.ts +6 -0
  705. package/dist/client/copy/shell/connectionList.js +8 -0
  706. package/dist/client/copy/shell/core.d.ts +16 -0
  707. package/dist/client/copy/shell/core.js +18 -0
  708. package/dist/client/copy/shell/palette.d.ts +6 -0
  709. package/dist/client/copy/shell/palette.js +8 -0
  710. package/dist/client/copy/shell/prompt.d.ts +1 -0
  711. package/dist/client/copy/shell/prompt.js +3 -0
  712. package/dist/client/copy/shell/requestIdentity.d.ts +9 -0
  713. package/dist/client/copy/shell/requestIdentity.js +11 -0
  714. package/dist/client/copy/shell/resourceRequests.d.ts +4 -0
  715. package/dist/client/copy/shell/resourceRequests.js +6 -0
  716. package/dist/client/copy/shell/sessionIdentity.d.ts +11 -0
  717. package/dist/client/copy/shell/sessionIdentity.js +13 -0
  718. package/dist/client/copy/shell/sessionLifecycle.d.ts +5 -0
  719. package/dist/client/copy/shell/sessionLifecycle.js +7 -0
  720. package/dist/client/copy/shell/startup.d.ts +5 -0
  721. package/dist/client/copy/shell/startup.js +7 -0
  722. package/dist/client/copy/shell/theme.d.ts +5 -0
  723. package/dist/client/copy/shell/theme.js +14 -0
  724. package/dist/client/copy/shell/toast.d.ts +3 -0
  725. package/dist/client/copy/shell/toast.js +5 -0
  726. package/dist/client/copy/shell/updateAttempts.d.ts +6 -0
  727. package/dist/client/copy/shell/updateAttempts.js +8 -0
  728. package/dist/client/copy/shell/visualTheme.d.ts +4 -0
  729. package/dist/client/copy/shell/visualTheme.js +6 -0
  730. package/dist/client/copy/workbench/clauses.d.ts +3 -0
  731. package/dist/client/copy/workbench/clauses.js +5 -0
  732. package/dist/client/copy/workbench/components/ApiOperations.d.ts +21 -0
  733. package/dist/client/copy/workbench/components/ApiOperations.js +23 -0
  734. package/dist/client/copy/workbench/components/Composer.d.ts +105 -0
  735. package/dist/client/copy/workbench/components/Composer.js +92 -0
  736. package/dist/client/copy/workbench/components/Diagram.d.ts +56 -0
  737. package/dist/client/copy/workbench/components/Diagram.js +46 -0
  738. package/dist/client/copy/workbench/components/Export.d.ts +26 -0
  739. package/dist/client/copy/workbench/components/Export.js +25 -0
  740. package/dist/client/copy/workbench/components/HelpPanel.d.ts +10 -0
  741. package/dist/client/copy/workbench/components/HelpPanel.js +12 -0
  742. package/dist/client/copy/workbench/components/History.d.ts +11 -0
  743. package/dist/client/copy/workbench/components/History.js +10 -0
  744. package/dist/client/copy/workbench/components/Landing.d.ts +5 -0
  745. package/dist/client/copy/workbench/components/Landing.js +7 -0
  746. package/dist/client/copy/workbench/components/SchemaExport.d.ts +24 -0
  747. package/dist/client/copy/workbench/components/SchemaExport.js +20 -0
  748. package/dist/client/copy/workbench/components/Summary.d.ts +28 -0
  749. package/dist/client/copy/workbench/components/Summary.js +24 -0
  750. package/dist/client/copy/workbench/components/ThemeLab.d.ts +25 -0
  751. package/dist/client/copy/workbench/components/ThemeLab.js +27 -0
  752. package/dist/client/copy/workbench/components/WorkPanel.d.ts +12 -0
  753. package/dist/client/copy/workbench/components/WorkPanel.js +14 -0
  754. package/dist/client/copy/workbench/composer.d.ts +36 -0
  755. package/dist/client/copy/workbench/composer.js +32 -0
  756. package/dist/client/copy/workbench/composerEntry.d.ts +4 -0
  757. package/dist/client/copy/workbench/composerEntry.js +6 -0
  758. package/dist/client/copy/workbench/export.d.ts +8 -0
  759. package/dist/client/copy/workbench/export.js +7 -0
  760. package/dist/client/copy/workbench/filterbar.d.ts +6 -0
  761. package/dist/client/copy/workbench/filterbar.js +8 -0
  762. package/dist/client/copy/workbench/handoff.d.ts +20 -0
  763. package/dist/client/copy/workbench/handoff.js +19 -0
  764. package/dist/client/copy/workbench/help.d.ts +6 -0
  765. package/dist/client/copy/workbench/help.js +8 -0
  766. package/dist/client/copy/workbench/history.d.ts +3 -0
  767. package/dist/client/copy/workbench/history.js +5 -0
  768. package/dist/client/copy/workbench/schemaexport.d.ts +5 -0
  769. package/dist/client/copy/workbench/schemaexport.js +7 -0
  770. package/dist/client/copy/workbench/tour.d.ts +22 -0
  771. package/dist/client/copy/workbench/tour.js +24 -0
  772. package/dist/client/copy/workbench/views.d.ts +6 -0
  773. package/dist/client/copy/workbench/views.js +8 -0
  774. package/dist/client/core.d.ts +312 -0
  775. package/dist/client/core.js +1067 -0
  776. package/dist/client/customThemes.css +43 -0
  777. package/dist/client/dashboard.d.ts +16 -0
  778. package/dist/client/dashboard.js +35 -0
  779. package/dist/client/deeplink.d.ts +64 -0
  780. package/dist/client/deeplink.js +384 -0
  781. package/dist/client/delete.d.ts +8 -0
  782. package/dist/client/delete.js +35 -0
  783. package/dist/client/density.d.ts +8 -0
  784. package/dist/client/density.js +102 -0
  785. package/dist/client/devtoolsEventClient.d.ts +27 -0
  786. package/dist/client/devtoolsEventClient.js +32 -0
  787. package/dist/client/documents.d.ts +9 -0
  788. package/dist/client/documents.js +23 -0
  789. package/dist/client/dom.d.ts +36 -0
  790. package/dist/client/dom.js +232 -0
  791. package/dist/client/draftRecovery.d.ts +16 -0
  792. package/dist/client/draftRecovery.js +56 -0
  793. package/dist/client/export.d.ts +59 -0
  794. package/dist/client/export.js +217 -0
  795. package/dist/client/features.css +2187 -0
  796. package/dist/client/fieldErrors.d.ts +27 -0
  797. package/dist/client/fieldErrors.js +20 -0
  798. package/dist/client/fileSource.d.ts +10 -0
  799. package/dist/client/fileSource.js +115 -0
  800. package/dist/client/filterbar.d.ts +87 -0
  801. package/dist/client/filterbar.js +168 -0
  802. package/dist/client/firstPaint.d.ts +26 -0
  803. package/dist/client/firstPaint.js +102 -0
  804. package/dist/client/fonts/Barlow-OFL.txt +125 -0
  805. package/dist/client/fonts/IBMPlexMono-OFL.txt +104 -0
  806. package/dist/client/fonts/Inter-OFL.txt +92 -0
  807. package/dist/client/fonts/barlow-400.woff2 +0 -0
  808. package/dist/client/fonts/barlow-600.woff2 +0 -0
  809. package/dist/client/fonts/barlow-semi-condensed-700.woff2 +0 -0
  810. package/dist/client/fonts/ibm-plex-mono-400.woff2 +0 -0
  811. package/dist/client/fonts/ibm-plex-mono-500.woff2 +0 -0
  812. package/dist/client/fonts/inter-latin.woff2 +0 -0
  813. package/dist/client/formControls.css +5 -0
  814. package/dist/client/handoff.d.ts +47 -0
  815. package/dist/client/handoff.js +138 -0
  816. package/dist/client/help.css +151 -0
  817. package/dist/client/help.d.ts +20 -0
  818. package/dist/client/help.js +103 -0
  819. package/dist/client/helpContent.d.ts +95 -0
  820. package/dist/client/helpContent.js +661 -0
  821. package/dist/client/history.d.ts +10 -0
  822. package/dist/client/history.js +181 -0
  823. package/dist/client/historyToken.d.ts +18 -0
  824. package/dist/client/historyToken.js +27 -0
  825. package/dist/client/iconWeight.d.ts +16 -0
  826. package/dist/client/iconWeight.js +44 -0
  827. package/dist/client/index.html +244 -0
  828. package/dist/client/insert.d.ts +50 -0
  829. package/dist/client/insert.js +269 -0
  830. package/dist/client/kit.d.ts +7 -0
  831. package/dist/client/kit.js +1 -0
  832. package/dist/client/layoutDraftRecovery.d.ts +8 -0
  833. package/dist/client/layoutDraftRecovery.js +33 -0
  834. package/dist/client/ledgerLook.css +32 -0
  835. package/dist/client/liveReads.d.ts +23 -0
  836. package/dist/client/liveReads.js +38 -0
  837. package/dist/client/liveState.d.ts +94 -0
  838. package/dist/client/liveState.js +212 -0
  839. package/dist/client/locale.d.ts +141 -0
  840. package/dist/client/locale.js +0 -0
  841. package/dist/client/lumenLook.css +1867 -0
  842. package/dist/client/menu.d.ts +49 -0
  843. package/dist/client/menu.js +131 -0
  844. package/dist/client/menuScope.d.ts +6 -0
  845. package/dist/client/menuScope.js +4 -0
  846. package/dist/client/messages.d.ts +240 -0
  847. package/dist/client/messages.js +370 -0
  848. package/dist/client/motionStill.d.ts +1 -0
  849. package/dist/client/motionStill.js +17 -0
  850. package/dist/client/navigationHold.d.ts +37 -0
  851. package/dist/client/navigationHold.js +503 -0
  852. package/dist/client/nested.d.ts +8 -0
  853. package/dist/client/nested.js +26 -0
  854. package/dist/client/ownWrites.d.ts +33 -0
  855. package/dist/client/ownWrites.js +76 -0
  856. package/dist/client/page.css +4052 -0
  857. package/dist/client/page.d.ts +21 -0
  858. package/dist/client/page.js +187 -0
  859. package/dist/client/pagemarks.d.ts +32 -0
  860. package/dist/client/pagemarks.js +98 -0
  861. package/dist/client/palette.d.ts +35 -0
  862. package/dist/client/palette.js +357 -0
  863. package/dist/client/partsLook.css +1047 -0
  864. package/dist/client/peek.d.ts +11 -0
  865. package/dist/client/peek.js +51 -0
  866. package/dist/client/peekpanel.d.ts +26 -0
  867. package/dist/client/peekpanel.js +121 -0
  868. package/dist/client/pendingWork.d.ts +19 -0
  869. package/dist/client/pendingWork.js +36 -0
  870. package/dist/client/pins.d.ts +24 -0
  871. package/dist/client/pins.js +97 -0
  872. package/dist/client/prefs.d.ts +3 -0
  873. package/dist/client/prefs.js +32 -0
  874. package/dist/client/prompt.d.ts +27 -0
  875. package/dist/client/prompt.js +61 -0
  876. package/dist/client/readGathering.d.ts +4 -0
  877. package/dist/client/readGathering.js +23 -0
  878. package/dist/client/recordCompose.d.ts +11 -0
  879. package/dist/client/recordCompose.js +69 -0
  880. package/dist/client/recordDrafts.d.ts +40 -0
  881. package/dist/client/recordDrafts.js +57 -0
  882. package/dist/client/recordEditValidation.d.ts +12 -0
  883. package/dist/client/recordEditValidation.js +52 -0
  884. package/dist/client/recordIntent.d.ts +6 -0
  885. package/dist/client/recordIntent.js +15 -0
  886. package/dist/client/recordPress.d.ts +12 -0
  887. package/dist/client/recordPress.js +84 -0
  888. package/dist/client/recordSource.d.ts +6 -0
  889. package/dist/client/recordSource.js +15 -0
  890. package/dist/client/recordTrail.d.ts +77 -0
  891. package/dist/client/recordTrail.js +101 -0
  892. package/dist/client/recordWriteRefresh.d.ts +74 -0
  893. package/dist/client/recordWriteRefresh.js +284 -0
  894. package/dist/client/relatedRows.d.ts +4 -0
  895. package/dist/client/relatedRows.js +24 -0
  896. package/dist/client/requestIdentity.d.ts +36 -0
  897. package/dist/client/requestIdentity.js +97 -0
  898. package/dist/client/resourceRequests.d.ts +7 -0
  899. package/dist/client/resourceRequests.js +32 -0
  900. package/dist/client/roleLabels.d.ts +7 -0
  901. package/dist/client/roleLabels.js +24 -0
  902. package/dist/client/rowEditing.d.ts +15 -0
  903. package/dist/client/rowEditing.js +36 -0
  904. package/dist/client/sageLook.css +242 -0
  905. package/dist/client/savedPages.d.ts +15 -0
  906. package/dist/client/savedPages.js +123 -0
  907. package/dist/client/schemaexport.d.ts +14 -0
  908. package/dist/client/schemaexport.js +182 -0
  909. package/dist/client/sessionIdentity.d.ts +39 -0
  910. package/dist/client/sessionIdentity.js +255 -0
  911. package/dist/client/sessionLifecycle.d.ts +33 -0
  912. package/dist/client/sessionLifecycle.js +276 -0
  913. package/dist/client/shellHost.d.ts +70 -0
  914. package/dist/client/shellHost.js +92 -0
  915. package/dist/client/shellMain.d.ts +8 -0
  916. package/dist/client/shellMode.d.ts +433 -0
  917. package/dist/client/shellMode.js +68 -0
  918. package/dist/client/shellStart.d.ts +5 -0
  919. package/dist/client/shellStart.js +54 -0
  920. package/dist/client/shells.d.ts +123 -0
  921. package/dist/client/shells.js +1 -0
  922. package/dist/client/sql.css +139 -0
  923. package/dist/client/startup.d.ts +8 -0
  924. package/dist/client/startup.js +85 -0
  925. package/dist/client/startupHold.d.ts +10 -0
  926. package/dist/client/startupHold.js +73 -0
  927. package/dist/client/structure.css +1296 -0
  928. package/dist/client/style.css +3526 -0
  929. package/dist/client/styleImports.d.ts +3 -0
  930. package/dist/client/surfaces.d.ts +18 -0
  931. package/dist/client/surfaces.js +27 -0
  932. package/dist/client/surfacesLook.css +88 -0
  933. package/dist/client/template.d.ts +75 -0
  934. package/dist/client/template.js +403 -0
  935. package/dist/client/theme.d.ts +14 -0
  936. package/dist/client/theme.js +112 -0
  937. package/dist/client/themeFamilies.css +788 -0
  938. package/dist/client/thmenu.d.ts +12 -0
  939. package/dist/client/thmenu.js +94 -0
  940. package/dist/client/toast.d.ts +7 -0
  941. package/dist/client/toast.js +117 -0
  942. package/dist/client/tour.d.ts +8 -0
  943. package/dist/client/tour.js +176 -0
  944. package/dist/client/transport.d.ts +2 -0
  945. package/dist/client/transport.js +13 -0
  946. package/dist/client/typography.d.ts +4 -0
  947. package/dist/client/typography.js +51 -0
  948. package/dist/client/uiBridge.d.ts +57 -0
  949. package/dist/client/uiBridge.js +30 -0
  950. package/dist/client/updateAttempts.d.ts +46 -0
  951. package/dist/client/updateAttempts.js +131 -0
  952. package/dist/client/url.d.ts +74 -0
  953. package/dist/client/url.js +388 -0
  954. package/dist/client/views.d.ts +19 -0
  955. package/dist/client/views.js +133 -0
  956. package/dist/client/visualTheme.d.ts +62 -0
  957. package/dist/client/visualTheme.js +502 -0
  958. package/dist/client/visualThemes.css +421 -0
  959. package/dist/client/workshopLook.css +126 -0
  960. package/dist/client/write.d.ts +100 -0
  961. package/dist/client/write.js +882 -0
  962. package/dist/client/writePaths.d.ts +16 -0
  963. package/dist/client/writePaths.js +35 -0
  964. package/dist/client/yesNoRule.d.ts +12 -0
  965. package/dist/client/yesNoRule.js +39 -0
  966. package/dist/clientFiles.d.ts +11 -4
  967. package/dist/clientFiles.js +16 -12
  968. package/dist/vite.d.ts +136 -0
  969. package/dist/vite.js +571 -0
  970. package/package.json +130 -3
@@ -0,0 +1,1067 @@
1
+ /**
2
+ * The parts every other client module needs: the API, the navigation stack,
3
+ * the schema mirrors, and DOM building (dom.js, re-exported here).
4
+ *
5
+ * Apart from independent connection-transition, notification and DOM helpers, this
6
+ * file depends on no other client modules. Everything else depends on it,
7
+ * which is what keeps the module
8
+ * graph a fan-out rather than a web — and lets a feature live in its own file
9
+ * without reaching into the renderer.
10
+ */
11
+ import { flushSync } from 'react-dom';
12
+ import { DEFAULT_LIMIT } from '@mistriwork/engine/shared/reads.js';
13
+ import { PAGE_HEADER } from '@mistriwork/engine/shared/pageRoutes.js';
14
+ import { quoteValue } from '@mistriwork/engine/shared/query.js';
15
+ import { connectionGeneration } from './connectionTransition.js';
16
+ import { showToast } from './toast.js';
17
+ import { scopeApiRequest } from './requestIdentity.js';
18
+ import { assertSessionCurrent, captureScopedStorage, captureSessionIdentity, sessionIdentity } from './sessionIdentity.js';
19
+ import { invalidateSession } from './sessionLifecycle.js';
20
+ import { shell } from './shellMode.js';
21
+ import { historyToken } from './historyToken.js';
22
+ import { beginWork } from './pendingWork.js';
23
+ import { composedReads, setComposedConnection } from './composedHook.js';
24
+ import { isWritePath } from './writePaths.js';
25
+ import { firstPaintRead, forgetFirstPaint } from './firstPaint.js';
26
+ import { ownWriteSent } from './ownWrites.js';
27
+ import { trailFor } from './recordTrail.js';
28
+ import { disclosure, el, svgEl, trapFocus } from './dom.js';
29
+ import { columnKind, findTable as sharedFindTable, labelColumn, labelPath as sharedLabelPath, looksLikeDate, primaryKey, referencesFrom, referencesTo, } from '@mistriwork/engine/shared/schema.js';
30
+ import { hopName, hopsFrom as sharedHopsFrom, tableAtPrefix as sharedTableAtPrefix } from '@mistriwork/engine/shared/view.js';
31
+ import { say } from './copy/shell/core.js';
32
+ import { shellById, shellQuery, shellQueryAll, shellRoot } from './shellHost.js';
33
+ import { fetchServer } from './transport.js';
34
+ import { fileReads } from './liveReads.js';
35
+ export { andQuery, splitClauseTail } from '@mistriwork/engine/shared/query.js';
36
+ export { humanName } from '@mistriwork/engine/shared/model.js';
37
+ /* Building DOM and the popups' keyboard manners live in dom.js; re-exported
38
+ so every caller keeps its import. */
39
+ export { disclosure, el, svgEl, trapFocus };
40
+ /** @overload @param {'query' | 'table-filter'} id @returns {HTMLInputElement} */
41
+ /** @overload @param {'querybar'} id @returns {HTMLFormElement} */
42
+ /** @overload @param {string} id @returns {HTMLElement} */
43
+ /** @param {string} id */
44
+ export function $(id) {
45
+ return shellById(id);
46
+ }
47
+ /**
48
+ * @type {{schema: any, stack: any[], page: number, canWrite: boolean, activeConnection?: string | null, navMode: string,
49
+ * connections?: (import('@mistriwork/engine/shared/connection.js').AppSource & Partial<import('@mistriwork/engine/shared/connection.js').PublicConnection>)[],
50
+ * onSwitched?: (isCurrent?: () => boolean) => void | Promise<void>}}
51
+ *
52
+ * `stack` is a navigation stack, and each entry is somewhere you have been —
53
+ * a table with a filter, or one row. The breadcrumb is that stack rendered,
54
+ * so walking back restores the filter you walked away from.
55
+ */
56
+ export const state = { schema: null, stack: [], page: 0, canWrite: false, navMode: 'replace' };
57
+ /* A record page's composed answers (composedHook.ts) go to this connection when a request names none. */
58
+ setComposedConnection(() => state.activeConnection ?? null);
59
+ /* The server's DEFAULT_LIMIT. Small on purpose: the first page of a
60
+ browse should be instant, and paging is one click. */
61
+ const PAGE_SIZE = DEFAULT_LIMIT;
62
+ /**
63
+ * How many rows a page actually holds, which the reader chooses.
64
+ *
65
+ * `PAGE_SIZE` stays the default and stays equal to the server's
66
+ * `DEFAULT_LIMIT` — twenty is right for a first look, and the first look is
67
+ * what most browsing is. It was also the *only* size, which turned a
68
+ * sixty-thousand-row table into three thousand clicks: a table you could read
69
+ * the front of and nothing else.
70
+ *
71
+ * Capped at 250 rather than offering "all". The grid renders every row it is
72
+ * given, so the honest ceiling is the one where the DOM is still the reader's
73
+ * friend; past that the answer is a filter, a sort, or Export.
74
+ */
75
+ export const PAGE_SIZES = [10, 15, 20, 50, 100, 250];
76
+ const PAGE_SIZE_KEY = 'mistri.page-size';
77
+ let chosenPageSize = null;
78
+ export function pageSize() {
79
+ if (chosenPageSize === null) {
80
+ const stored = Number(loadJson(PAGE_SIZE_KEY, PAGE_SIZE));
81
+ /* Validated rather than trusted: the value comes from localStorage, where
82
+ a stale build or a hand edit can leave anything at all, and a page size
83
+ of `null` asks the server for `LIMIT NaN`. */
84
+ chosenPageSize = PAGE_SIZES.includes(stored) ? stored : PAGE_SIZE;
85
+ }
86
+ return chosenPageSize;
87
+ }
88
+ export function setPageSize(size) {
89
+ chosenPageSize = PAGE_SIZES.includes(Number(size)) ? Number(size) : PAGE_SIZE;
90
+ saveJson(PAGE_SIZE_KEY, chosenPageSize);
91
+ /* A page *number* means nothing once the size changes — page 40 of twenty
92
+ is not page 40 of a hundred — so the only honest place to land is the
93
+ front. */
94
+ state.page = 0;
95
+ }
96
+ /* ---------- API ---------- */
97
+ /* An App's search engine did not answer, so a text filter ran on the
98
+ database (the server's `x-mistri-search: database`). Said once per page
99
+ load: the results are still right, only found the slower way. */
100
+ let searchFallbackSaid = false;
101
+ /** @param {Response} res */
102
+ function noteSearchFallback(res) {
103
+ if (searchFallbackSaid || res.headers?.get('x-mistri-search') !== 'database')
104
+ return;
105
+ searchFallbackSaid = true;
106
+ toast(say('searchIsNotAnswering'));
107
+ }
108
+ /**
109
+ * What a reader is told when the server does not answer at all. Offline
110
+ * comes first, because it is the one cause the reader can see and fix; a
111
+ * server on this machine is one they started, so restarting it is theirs to
112
+ * do; anyone else — a hosted App, a phone — can only try again. An App's
113
+ * reader is told the App's name: "tablewalk" is the database browser's, and
114
+ * meant nothing to someone working in Compass.
115
+ * @returns {string}
116
+ */
117
+ export function unansweredSentence() {
118
+ if (typeof navigator !== 'undefined' && navigator.onLine === false)
119
+ return say('problem.offline');
120
+ const host = typeof location === 'undefined' ? '' : location.hostname;
121
+ if (host === 'localhost' || host === '[::1]' || host.startsWith('127.')) {
122
+ return say('isNotAnswering', { app: appNamed() });
123
+ }
124
+ return say('theServerIsNotAnswering');
125
+ }
126
+ /** What an answer that is not JSON says, named by the App a reader is in. */
127
+ export function uninterpretableSentence(status) {
128
+ return say('theServerAnsweredWithSomething', { status }) + say('somethingBetweenThisPage', { app: appNamed() });
129
+ }
130
+ /** The App a reader is in, by its name; in the Workbench, tablewalk. */
131
+ const appNamed = () => (shell().inApp() && shell().app()?.name) || 'tablewalk';
132
+ /* The GET replies the server tags for revalidation (reply.ts sendRevalidated). */
133
+ const REVALIDATED = new Set(['/api/schema', '/api/app', '/api/pages', '/api/runtime']);
134
+ /* What changes a record: a composed page's answers are forgotten when one is sent (writePaths.ts). */
135
+ /** Requests carry the tab's App ID or DB connection ID, never a server-global selection.
136
+ * @template {string} Path
137
+ * @param {Path} path
138
+ * @param {import('@mistriwork/engine/shared/resourceHttp.js').ResourceClientArgs<NoInfer<Path>>} args
139
+ * @returns {Promise<import('@mistriwork/engine/shared/resourceHttp.js').ResourceClientReply<Path>>}
140
+ */
141
+ export async function api(path, ...args) {
142
+ return sent(path, /** @type {Record<string, unknown> | undefined} */ (args[0]), undefined);
143
+ }
144
+ /**
145
+ * A free-form page's own request: `api`, saying which page asks
146
+ * (`x-mistri-page`), so the server refuses a resource or a command the
147
+ * page did not declare. Drift protection, not the boundary: the reader's
148
+ * grants decide the request either way.
149
+ * @param {string} page
150
+ * @param {string} path
151
+ * @param {Record<string, unknown>} body
152
+ * @returns {Promise<any>}
153
+ */
154
+ export async function pageApi(page, path, body) {
155
+ return sent(path, body, { [PAGE_HEADER]: page });
156
+ }
157
+ /**
158
+ * @param {string} path
159
+ * @param {Record<string, unknown> | undefined} body
160
+ * @param {Record<string, string> | undefined} headers
161
+ * @returns {Promise<any>}
162
+ */
163
+ async function sent(path, body, headers) {
164
+ /* Counted while it is out: a navigation keeps the screen it left until
165
+ the room it opened has had its answers (navigationHold.ts). */
166
+ const settled = beginWork();
167
+ const writing = isWritePath(String(path).split('?')[0], body);
168
+ /* Its echo on the live stream is told from a change someone else made by when it was answered (ownWrites.ts). */
169
+ const answered = writing ? ownWriteSent() : undefined;
170
+ try {
171
+ return await request(path, body, headers);
172
+ }
173
+ finally {
174
+ answered?.();
175
+ settled();
176
+ /* Forgotten as a write is sent (request) and again as it is answered,
177
+ before its caller refreshes the page: a compose that left while it
178
+ was out may have read the record before the write landed. */
179
+ if (writing)
180
+ composedReads()?.forget();
181
+ }
182
+ }
183
+ /**
184
+ * @param {string} path
185
+ * @param {Record<string, unknown> | undefined} body
186
+ * @param {Record<string, string> | undefined} headers
187
+ * @returns {Promise<any>}
188
+ */
189
+ async function request(path, body, headers) {
190
+ const parsedPath = new URL(path, window.location.href);
191
+ if (!path.startsWith('/api/') || parsedPath.hash || parsedPath.pathname !== path.split('?')[0]) {
192
+ throw Object.assign(new Error(say('useACanonicalApi')), { outcome: 'not_applied' });
193
+ }
194
+ const identity = captureSessionIdentity();
195
+ const bootstrap = parsedPath.pathname === '/api/whoami' && identity.mode === 'unknown';
196
+ if (!bootstrap)
197
+ assertSessionCurrent(identity);
198
+ /* A read a record page's compose already asked is answered from it
199
+ (composedReads.ts); a write makes every such answer the past. */
200
+ const composing = composedReads();
201
+ const writing = isWritePath(parsedPath.pathname, body);
202
+ if (writing)
203
+ forgetFirstPaint();
204
+ if (composing && writing)
205
+ composing.forget();
206
+ else if (composing && body && composing.may(parsedPath.pathname)) {
207
+ const composed = await composing.reply(parsedPath.pathname, /** @type {Record<string, unknown>} */ (body));
208
+ if (composed !== undefined) {
209
+ assertSessionCurrent(identity);
210
+ return composed;
211
+ }
212
+ }
213
+ if (identity.tenantRequired && parsedPath.pathname !== '/api/whoami' && !parsedPath.pathname.startsWith('/api/auth/')) {
214
+ /* The tenant's lease is the shell's (shellMode.ts): a shell that installed none has no tenant to send through. */
215
+ const tenant = shell().tenant;
216
+ if (!tenant)
217
+ throw Object.assign(new Error(say('theTenantContextIsUnavailable')), { outcome: 'not_applied' });
218
+ if (tenant.isMutation(parsedPath.pathname))
219
+ return await tenant.mutate(path, body, state.activeConnection);
220
+ return await tenant.read(path, body === undefined ? undefined : { ...body }, state.activeConnection);
221
+ }
222
+ if (parsedPath.pathname === '/api/revert' &&
223
+ body &&
224
+ 'expectedId' in body &&
225
+ body.expectedId !== undefined &&
226
+ historyToken(body.expectedId, false) === undefined)
227
+ throw Object.assign(new Error(say('invalidOrdinaryUndoIdentity')), { outcome: 'not_applied' });
228
+ const { url, payload } = scopeApiRequest(path, body === undefined ? undefined : { ...body }, state.activeConnection);
229
+ /* The page arrived with this answer (firstPaint.ts): taken as a reply
230
+ would be, the account it was for held to the session as a reply's is. */
231
+ const carried = firstPaintRead(payload ? 'POST' : 'GET', url, payload);
232
+ if (carried) {
233
+ if (!bootstrap) {
234
+ assertSessionCurrent(identity);
235
+ try {
236
+ assertSessionCurrent(identity, carried.account ?? null);
237
+ if (identity.mode === 'anonymous' && carried.account)
238
+ throw new Error(say('theSignedInAccount'));
239
+ }
240
+ catch (error) {
241
+ invalidateSession('account-changed');
242
+ throw error;
243
+ }
244
+ }
245
+ return carried.body;
246
+ }
247
+ let res;
248
+ try {
249
+ res = await fetchServer(url, {
250
+ credentials: 'same-origin',
251
+ /* The schema, the App, its pages and the runtime carry an ETag
252
+ (reply.ts sendRevalidated): the browser may keep them, and asks
253
+ again with If-None-Match every time, so a 304 answers an unchanged
254
+ one. Everything else is never stored. */
255
+ cache: !payload && REVALIDATED.has(parsedPath.pathname) ? 'no-cache' : 'no-store',
256
+ method: payload ? 'POST' : 'GET',
257
+ headers: {
258
+ ...(payload ? { 'content-type': 'application/json' } : {}),
259
+ ...(identity.mode === 'authenticated' ? { 'x-mistri-account': identity.accountId } : {}),
260
+ ...headers,
261
+ },
262
+ body: payload ? JSON.stringify(payload) : undefined,
263
+ });
264
+ }
265
+ catch {
266
+ /* `fetch` rejects with "Failed to fetch" or "Load failed" depending on the
267
+ browser, and neither says the one thing that is true and useful: the
268
+ server this page came from is not answering. It is a local process, so
269
+ that nearly always means it was stopped — and "Failed to fetch" sends
270
+ people to look at their network. Only on this machine, though: a
271
+ hosted App's reader, or one on a phone, cannot restart anything, and
272
+ one who is offline needs to hear that first. */
273
+ throw new Error(unansweredSentence());
274
+ }
275
+ if (!bootstrap) {
276
+ assertSessionCurrent(identity);
277
+ if (res.status === 401 && identity.mode === 'authenticated') {
278
+ invalidateSession('expired');
279
+ throw Object.assign(new Error(say('yourSessionExpiredReload')), { status: 401 });
280
+ }
281
+ try {
282
+ assertSessionCurrent(identity, res.headers?.get('x-mistri-account'));
283
+ if (identity.mode === 'anonymous' && res.headers?.get('x-mistri-account')) {
284
+ throw new Error(say('theSignedInAccount'));
285
+ }
286
+ }
287
+ catch (error) {
288
+ invalidateSession('account-changed');
289
+ throw error;
290
+ }
291
+ }
292
+ noteSearchFallback(res);
293
+ let data;
294
+ try {
295
+ data = await res.json();
296
+ }
297
+ catch {
298
+ /* An answer that is not JSON is a proxy, a login page, or a crash — none
299
+ of which the caller can do anything with, and all of which read better
300
+ as what they are than as "Unexpected token < in JSON". */
301
+ throw new Error(uninterpretableSentence(res.status));
302
+ }
303
+ if (!bootstrap)
304
+ assertSessionCurrent(identity);
305
+ /* A refused write answers its envelope — `errors` and a `rejected` outcome — at 422 when the App's rules or a
306
+ value refused it and 409 when the database's keys did (server constraints.ts writeRefusalStatus). The form
307
+ reads it as it reads any refused write, the field marked and the draft kept, so it is an answer here, not a
308
+ failure. */
309
+ if ((res.status === 409 || res.status === 422) && Array.isArray(data?.errors) && data.errors.length && data.outcome === 'rejected')
310
+ return data;
311
+ if (!res.ok) {
312
+ /* The status travels with the message. Callers have always had to guess
313
+ the kind of failure from the text of it, which is how "No connection is
314
+ open." — a 409 with a specific meaning and a specific screen to show
315
+ for it — could only be recognised by matching a sentence. */
316
+ const said = data.message ?? data.error ?? say('common.requestFailed', { status: res.status });
317
+ /* `cause` is sent only to the App's author at work (server
318
+ http/refusalReport.ts): the rule, table or column behind a refusal,
319
+ said beside the caller's sentence wherever that sentence is drawn. */
320
+ const failure = Object.assign(new Error(typeof data.cause === 'string' ? say('forTheAuthor', { message: said, cause: data.cause }) : said), {
321
+ status: res.status,
322
+ signIn: undefined,
323
+ ...(typeof data.code === 'string' ? { code: data.code } : {}),
324
+ ...(data.outcome === 'not_applied' || data.outcome === 'unknown' ? { outcome: data.outcome } : {}),
325
+ /* The input a command's refusal is about (`refuse(…, { field })`): its form says the sentence beside that field. */
326
+ ...(typeof data.field === 'string' ? { field: data.field } : {}),
327
+ /* A busy server says when to come back (server/http/reply.ts sendBusy), in seconds: kept in ms for a read's retry (components/mount.tsx). */
328
+ ...(res.status === 503 && data.code === 'server_busy' && Number(res.headers?.get('retry-after')) > 0
329
+ ? { retryAfter: Number(res.headers.get('retry-after')) * 1000 }
330
+ : {}),
331
+ /* Where this failure's trace is, while a --dev server's observer runs:
332
+ its badge offers "Open in observer" (observe/beacon.js). */
333
+ ...(typeof data.observe === 'string' && /^(\/[A-Za-z0-9][\w-]*)*\/_mistri\/observe\//.test(data.observe)
334
+ ? { observe: data.observe }
335
+ : {}),
336
+ // The column names a refusal quotes, for a surface that says them in an App's captions.
337
+ ...(Array.isArray(data.columns) && data.columns.every((column) => typeof column === 'string') ? { columns: data.columns } : {}),
338
+ });
339
+ if (failure.observe)
340
+ window.dispatchEvent(new CustomEvent('mistri:observe', { detail: failure.observe }));
341
+ /* A server that signs people in answers 401 with what to draw. Told
342
+ once, through a seam, so core does not know what a sign-in screen is. */
343
+ /* A visitor browsing an App's public part is already in the App: a read
344
+ past `auth.public` (a member's list or dashboard) answers 401 as
345
+ `members_only`, and the surface that asked offers the sign-in in place
346
+ (TableRoom's NotYours) rather than the whole page turning into it. */
347
+ if (res.status === 401 && data.signIn) {
348
+ failure.signIn = data.signIn;
349
+ if (!(data.code === 'members_only' && shell().publicVisitor()))
350
+ unauthorized(data.signIn);
351
+ }
352
+ throw failure;
353
+ }
354
+ fileReads(data, res.headers?.get('mistri-reads'));
355
+ return data;
356
+ }
357
+ /**
358
+ * Anything that has to be rebuilt when the database underneath changes.
359
+ *
360
+ * A connection switch is not a render: the trail is cleared, the schema is
361
+ * replaced and every per-connection thing — layouts, saved statements, write
362
+ * mode — is reloaded. Long-lived surfaces that are *not* inside `#content`
363
+ * miss all of it. The SQL editor was the case that showed it: painted once
364
+ * from the state it opened with, it went on naming the previous database
365
+ * while the statement it ran went to the new one, and it kept offering "Run
366
+ * as write…" after a switch to a connection the server would refuse.
367
+ *
368
+ * A set rather than the single `state.onSwitched` slot beside it, because the
369
+ * second thing that needed to know would have silently replaced the first.
370
+ */
371
+ const switchWatchers = new Set();
372
+ /** Register a rebuild. Returns the way to stop listening. */
373
+ export function whenConnectionChanges(run) {
374
+ switchWatchers.add(run);
375
+ return () => switchWatchers.delete(run);
376
+ }
377
+ /**
378
+ * Say that the connection changed. Called by the two places that switch —
379
+ * the picker and a deep link into another database — after the new schema
380
+ * and everything keyed to it have landed, so a watcher reads the new state
381
+ * rather than the half-swapped one.
382
+ */
383
+ export function connectionChanged() {
384
+ /* A copy, because a watcher may well unregister itself as its last act. */
385
+ for (const run of [...switchWatchers]) {
386
+ try {
387
+ run();
388
+ }
389
+ catch (err) {
390
+ /* One surface failing to rebuild must not stop the next one. It is
391
+ already the wrong database on screen; making it the wrong database
392
+ everywhere is not an improvement. */
393
+ console.error(err);
394
+ }
395
+ }
396
+ }
397
+ /* ---------- schema helpers ----------
398
+
399
+ The shared rules, with the one schema this client holds already applied:
400
+ the browser has one connection open and keeps its schema in `state`, so a
401
+ caller here names a table and not a schema. Each is the server's function
402
+ under the server's name. For a long time they were copies — the client
403
+ could not import the TypeScript — and the copies drifted: a list limit of
404
+ eight against ten, a date used as a row's label on one side and the key on
405
+ the other. Now there is one rule and this is where the client reaches it. */
406
+ // React roots may render once while a retired context is being unmounted.
407
+ // An absent catalog has no records or command targets, not a fallback owner.
408
+ export const findTable = (id) => (state.schema?.tables ? sharedFindTable(state.schema, id) : undefined);
409
+ export const refsTo = (id) => referencesTo(state.schema, id);
410
+ export const refsFrom = (id) => referencesFrom(state.schema, id);
411
+ export { columnKind, labelColumn, primaryKey };
412
+ /** Whether a column should be treated as a date for presentation. */
413
+ export const looksLikeDateColumn = (col) => Boolean(col) && looksLikeDate(col);
414
+ /* The zoom-aware ruler is the ui package's (packages/ui/src/internal/ruler.ts says why
415
+ every overlay is measured with it); the client reaches it here, under the
416
+ names it always had. */
417
+ export { viewportScale, refreshViewportScale, viewportBox, viewportSize } from '@mistriwork/ui/internal/ruler.js';
418
+ /** Where a row's name lives, as a view path — see labelPath in shared/schema.ts. */
419
+ export const labelPath = (table) => sharedLabelPath(state.schema, table, recordLabel(table));
420
+ /** An explicit record name, or false when that name is unavailable to this reader. */
421
+ export const recordLabel = (table) => shell().recordLabel(table.id);
422
+ /* ---------- paths ----------
423
+
424
+ Every hop is derivable from the schema the page already holds, so proposing
425
+ the next segment of a path is local and instant; asking the server per
426
+ keystroke would make the one interaction that has to feel immediate the one
427
+ that does not. The server still resolves every path for real before
428
+ anything runs. */
429
+ export { hopName };
430
+ export const hopsFrom = (tableId) => sharedHopsFrom(state.schema, tableId);
431
+ /** An empty prefix is the base; a prefix that walks nowhere is null. */
432
+ export const tableAtPrefix = (baseId, prefix) => sharedTableAtPrefix(state.schema, baseId, prefix) ?? null;
433
+ /** How a row is named in a breadcrumb: the readable column, else the key. */
434
+ export function rowLabel(table, row) {
435
+ /* The walked-to name first. A row fetched as a view carries the joined
436
+ label under its path — `party_id.display_name` — while a plain query row
437
+ simply lacks that key and falls through to the table's own label, then
438
+ the primary key. One function for both, so a caller never has to know
439
+ which kind of row it is holding. */
440
+ const configured = recordLabel(table) !== undefined;
441
+ for (const name of configured ? [labelPath(table)] : [labelPath(table), labelColumn(table)]) {
442
+ const value = name != null ? row[name] : undefined;
443
+ if (value !== null && value !== undefined && String(value) !== '')
444
+ return String(value);
445
+ }
446
+ const values = primaryKey(table).map((c) => row[c]);
447
+ if (configured && values.some((value) => value == null))
448
+ return '(row)';
449
+ const pk = values.filter((value) => value != null);
450
+ return pk.length ? pk.join('/') : '(row)';
451
+ }
452
+ /**
453
+ * The primary key of a row, or null when this row cannot supply one.
454
+ *
455
+ * Null rather than a key with `undefined` in it. A projected query — `show
456
+ * quantity`, or a child section showing four summary columns — returns rows
457
+ * that genuinely do not carry the key, and building `{invoice_id: undefined}`
458
+ * out of one produced a link to `~invoice_line:invoice_id=undefined` that
459
+ * landed on "That row is no longer there." Nothing had gone missing; the
460
+ * navigation was built from a row that never had the key to begin with.
461
+ *
462
+ * Callers use the null to decide whether a row is clickable at all, so a row
463
+ * that cannot be opened does not look like one that can.
464
+ */
465
+ export function keyOf(table, row) {
466
+ const columns = primaryKey(table);
467
+ if (!columns.length)
468
+ return null;
469
+ const key = {};
470
+ for (const col of columns) {
471
+ if (row[col] === undefined)
472
+ return null;
473
+ key[col] = row[col];
474
+ }
475
+ return key;
476
+ }
477
+ /** A filter matching exactly one row by its primary key. */
478
+ export function keyFilter(key) {
479
+ return { groups: [Object.entries(key).map(([column, value]) => ({ column, op: '=', value }))] };
480
+ }
481
+ /* ---------- navigation ---------- */
482
+ let navigationGeneration = 0;
483
+ export function invalidateNavigation() {
484
+ navigationGeneration += 1;
485
+ }
486
+ /** Capture permission for background work without starting a new navigation intent. */
487
+ export function captureNavigation() {
488
+ const generation = navigationGeneration;
489
+ const transition = connectionGeneration();
490
+ const connection = state.activeConnection;
491
+ const schema = state.schema;
492
+ const entry = currentEntry();
493
+ return () => generation === navigationGeneration &&
494
+ transition === connectionGeneration() &&
495
+ connection === state.activeConnection &&
496
+ schema === state.schema &&
497
+ entry === currentEntry();
498
+ }
499
+ /** A later intent wins even before either request has changed the visible view. */
500
+ export function beginNavigation() {
501
+ invalidateNavigation();
502
+ return captureNavigation();
503
+ }
504
+ /* A paint is a tick of its own beside the walk's: the content pane
505
+ (components/Content.tsx) writes the address bar on every paint and leaves
506
+ the trail's room alone on a crumb correction, which only ticks the walk.
507
+ Flushed synchronously — `render()` has always finished painting before it
508
+ returned, and the address gate (url.js `whileApplying`) and every caller
509
+ that reads the page straight after depend on that. */
510
+ let paintTick = 0;
511
+ export const paintVersion = () => paintTick;
512
+ /* The room is a third tick, and the one the content pane keys its room by.
513
+ Nearly every paint starts the room over, the way a repaint always did: a
514
+ write that repaints sees itself, another table or record is another room.
515
+ A refinement does not. A page, a page size, or a sort or filter from a
516
+ column header is the same table room asking a different question, and
517
+ the room re-asks it in place (TableRoom's Query is keyed by the
518
+ question), keeping the rows on screen until the answer lands and every
519
+ row decoration's state with them. Only a paint made inside `refine()`
520
+ whose table room is the one already on screen — the same connection,
521
+ depth, table and tab — keeps it; anything else ticks. */
522
+ let roomTick = 0;
523
+ let roomOnScreen = null;
524
+ let refining = false;
525
+ export const roomVersion = () => roomTick;
526
+ /** A table view's identity as a room, or null for anything else. */
527
+ function tableRoomShape() {
528
+ const top = currentEntry();
529
+ if (!top || top.kind !== 'table')
530
+ return null;
531
+ return JSON.stringify([state.activeConnection ?? '', state.stack.length, top.table, top.tab ?? 'rows']);
532
+ }
533
+ /**
534
+ * Paint a refinement of the table room on screen: a page, a page size, a
535
+ * header's sort or filter. The address bar and the trail are written as for
536
+ * any paint; the room is kept when it is still the same table room.
537
+ */
538
+ export function refine(fn) {
539
+ const was = refining;
540
+ refining = true;
541
+ try {
542
+ return fn();
543
+ }
544
+ finally {
545
+ refining = was;
546
+ }
547
+ }
548
+ /* What happens around a paint that may start the room over: the shell
549
+ registers the navigation hold (navigationHold.ts), which keeps the screen
550
+ being left until the new room is complete. A seam, so core stays free of
551
+ the DOM it holds; nothing registered, a paint is only a paint. */
552
+ let paintHold = null;
553
+ /** @param {{ before(roomChanged: boolean): void; after(): void } | null} hold */
554
+ export function setPaintHold(hold) {
555
+ paintHold = hold;
556
+ }
557
+ export function render() {
558
+ if (sessionIdentity().mode === 'locked')
559
+ return;
560
+ paintTick += 1;
561
+ const shape = tableRoomShape();
562
+ const roomChanged = !refining || shape === null || shape !== roomOnScreen;
563
+ if (roomChanged)
564
+ roomTick += 1;
565
+ roomOnScreen = shape;
566
+ paintHold?.before(roomChanged);
567
+ flushSync(tellWalk);
568
+ paintHold?.after();
569
+ }
570
+ /* The walk as something a component can watch. Every render and every
571
+ crumb correction is one tick; a component that subscribes re-reads the
572
+ stack. Kept as a counter rather than a copy of the stack, because the
573
+ stack is mutated in place by design (a label arrives, a root resolves)
574
+ and a copy would miss exactly those corrections. */
575
+ const walkListeners = new Set();
576
+ let walkTick = 0;
577
+ function tellWalk() {
578
+ walkTick += 1;
579
+ for (const fn of walkListeners)
580
+ fn();
581
+ }
582
+ export function subscribeWalk(fn) {
583
+ walkListeners.add(fn);
584
+ return () => walkListeners.delete(fn);
585
+ }
586
+ export const walkVersion = () => walkTick;
587
+ /* Redrawing the trail alone, without re-running the view.
588
+ A row restored from a link knows only its key, so its crumb starts as the
589
+ key and is corrected once the row arrives. Calling render() for that would
590
+ re-fetch the row that just resolved it — and loop. The crumbs are React
591
+ and redraw from the walk's subscribers. */
592
+ export function renderCrumbs() {
593
+ tellWalk();
594
+ }
595
+ /**
596
+ * Move to a view and render.
597
+ *
598
+ * push — a step along a reference; the trail grows
599
+ * replace — the same view, re-run (a sort, an edited filter, a tab)
600
+ * reset — a fresh start; the trail is discarded
601
+ *
602
+ * The distinction is the whole meaning of the breadcrumb. A trail is a walk:
603
+ * every crumb should be reachable from the one before it by following a key.
604
+ * Jumping to an unrelated table is not a step along that walk, so it starts a
605
+ * new one rather than appending browsing history.
606
+ */
607
+ export function go(entry, mode = 'push') {
608
+ if (!allowMutationExit())
609
+ return;
610
+ invalidateNavigation();
611
+ carryView(entry, mode);
612
+ if (mode === 'reset')
613
+ state.stack = [entry];
614
+ /* Replacing the top of an empty stack — the landing has no entry — wrote
615
+ to index -1: a property on the array, not a member of it. The view
616
+ painted (currentEntry reads the same slot) and the address bar did not
617
+ (the URL walks the array), so the landing's first refinement rendered
618
+ with nothing in the bar to send. An empty stack gains its first entry. */
619
+ else if (mode === 'replace' && state.stack.length)
620
+ state.stack[state.stack.length - 1] = entry;
621
+ else
622
+ state.stack.push(entry);
623
+ if (mode !== 'replace')
624
+ state.page = 0;
625
+ /* How the address bar should record this. A step in the walk earns a
626
+ history entry so the browser's Back button undoes it; a refinement of the
627
+ view you are already on does not, or Back would spend three presses
628
+ undoing sort toggles. */
629
+ state.navMode = mode === 'replace' ? 'replace' : 'push';
630
+ render();
631
+ }
632
+ /**
633
+ * Which App view opened a room rides the walk as `view` — its key — and
634
+ * appnav.js reads it where two views share a table. The callers that
635
+ * refine a list (a sort, a header menu, a tab) or open one of its records
636
+ * build a plain `tableView`/`rowView` and know nothing of views, so the
637
+ * walk carries it for them: a same-table refinement in place, and a record
638
+ * of that table opened from it. A caller that names a view — or names
639
+ * none, `view: undefined` — is taken at its word; a fresh start carries
640
+ * nothing.
641
+ */
642
+ function carryView(entry, mode) {
643
+ const top = state.stack[state.stack.length - 1];
644
+ if (mode === 'reset' || !top?.view || !entry || 'view' in entry || entry.table !== top.table)
645
+ return;
646
+ if (entry.kind === 'row' || (entry.kind === 'table' && mode === 'replace'))
647
+ entry.view = top.view;
648
+ }
649
+ export function backTo(index) {
650
+ if (!allowMutationExit())
651
+ return;
652
+ invalidateNavigation();
653
+ state.stack.length = index + 1;
654
+ state.page = 0;
655
+ // Clicking a crumb is a navigation, so Back returns you to where you were.
656
+ state.navMode = 'push';
657
+ render();
658
+ }
659
+ /** A table view, optionally filtered. The query text is what the bar shows. */
660
+ export function tableView(tableId, query, tab) {
661
+ return { kind: 'table', table: tableId, query: query ?? tableId, tab: tab ?? 'rows' };
662
+ }
663
+ /**
664
+ * A breakdown: counts and sums, grouped by something.
665
+ *
666
+ * `table` is the base being counted, so the sidebar highlights it and the
667
+ * crumb reads like a table's. It is deliberately not a `tab` of the table
668
+ * view: the rows of a breakdown are groups rather than records, and a tab
669
+ * would promise they behave like the rows beside them.
670
+ */
671
+ export function breakdownView(tableId, query) {
672
+ return { kind: 'breakdown', table: tableId, query };
673
+ }
674
+ /** A single row. The key is enough to re-fetch it, so nothing goes stale. */
675
+ export function rowView(tableId, key, label) {
676
+ return { kind: 'row', table: tableId, key, label };
677
+ }
678
+ /**
679
+ * A page, with or without a root yet.
680
+ *
681
+ * `table` is the page's base rather than a table being browsed, so that the
682
+ * sidebar highlights the right thing and a page can find its way back to a
683
+ * suggested layout when the id names no configured page.
684
+ */
685
+ export function pageView(pageId, tableId, key, label) {
686
+ return { kind: 'page', pageId, table: tableId, key, label };
687
+ }
688
+ export const currentEntry = () => state.stack[state.stack.length - 1];
689
+ // Registered by the draft store: core must not import the editing/rendering tree.
690
+ let recordMutationPending = () => false;
691
+ /** @param {() => boolean} probe */
692
+ export function setRecordMutationPendingProbe(probe) {
693
+ recordMutationPending = probe;
694
+ }
695
+ // Transient editors supplement the draft/tenant guards; they never settle an
696
+ // operation merely because its dialog unmounted or the URL did not change.
697
+ const surfaceMutationProbes = new Set();
698
+ /** @param {() => boolean} probe */
699
+ export function registerSurfaceMutationPendingProbe(probe) {
700
+ surfaceMutationProbes.add(probe);
701
+ return () => {
702
+ surfaceMutationProbes.delete(probe);
703
+ };
704
+ }
705
+ /** Voluntary navigation cannot discard a tenant operation's uncertain result.
706
+ * Forced session retirement bypasses this guard and still clears private data. */
707
+ export function allowMutationExit() {
708
+ let pending = true;
709
+ try {
710
+ pending = recordMutationPending();
711
+ }
712
+ catch {
713
+ /* An unreadable owner cannot authorize an exit. */
714
+ }
715
+ if (pending) {
716
+ toast(say('waitForThePending'), 'error');
717
+ return false;
718
+ }
719
+ for (const probe of surfaceMutationProbes) {
720
+ let blocked = true;
721
+ try {
722
+ blocked = probe();
723
+ }
724
+ catch {
725
+ /* An unreadable surface cannot authorize exit. */
726
+ }
727
+ if (blocked) {
728
+ toast(say('aChangeIsPending'), 'error');
729
+ return false;
730
+ }
731
+ }
732
+ if (!shell().mutations.hasUnresolved() && !shell().accountBusy())
733
+ return true;
734
+ toast(say('aChangeIsPending'), 'error');
735
+ return false;
736
+ }
737
+ /* How a record opens, when the walk is already looking at pages.
738
+ *
739
+ * A page is a way of reading a record, not a place: someone who chose the
740
+ * page view for a customer wants the invoice they clicked to open the same
741
+ * way, and dropping them into the plain record view — and making them press
742
+ * "As a page" again — is the walk changing shape underneath them.
743
+ *
744
+ * The resolver is the shell's (shellMode.ts) rather than imported because
745
+ * core must not know about pages: `page.js` already imports this file, and
746
+ * the preference for a saved or configured page over the suggested one lives
747
+ * there with the rest of the page machinery. No resolver means nothing changes.
748
+ */
749
+ /** The page a table's records read through here, or null when unavailable or
750
+ cancelled. Current lookup failures reject; cancelled failures are ignored.
751
+ For a deep link
752
+ that arrives as a row while an app is on: the walk would have opened it
753
+ as a page, and a pasted link should land where a click would. */
754
+ export async function pageFor(tableId) {
755
+ const pageResolver = shell().resolvePage;
756
+ if (!pageResolver || !shell().pageAffinity())
757
+ return null;
758
+ const isCurrent = captureNavigation();
759
+ try {
760
+ const pageId = await pageResolver(tableId);
761
+ return isCurrent() ? (pageId ?? null) : null;
762
+ }
763
+ catch (error) {
764
+ if (!isCurrent())
765
+ return null;
766
+ throw error;
767
+ }
768
+ }
769
+ /* Whether pages are the walk's default, not just its current mode.
770
+ *
771
+ * The shell's answer for the same reason the resolver is: an app (appnav.js)
772
+ * reads records through pages by design — that is what makes it an app
773
+ * rather than a browser — but core must not know apps exist. The
774
+ * Workbench's answer is no, and records open the way they always did. */
775
+ /** Whether records open as pages here — the sign that an app is reading. */
776
+ export function prefersPages() {
777
+ return Boolean(shell().pageAffinity());
778
+ }
779
+ /* ---------- who is asked to sign in ---------- */
780
+ let unauthorizedShown = false;
781
+ /** What happens when the server demands a sign-in: the shell's answer (shellStart.js), once per page load. */
782
+ function unauthorized(info) {
783
+ if (unauthorizedShown)
784
+ return;
785
+ unauthorizedShown = true;
786
+ shell().unauthorized(info);
787
+ }
788
+ /* ---------- what may be written ---------- */
789
+ /**
790
+ * Whether a table may be written from here, beyond the connection's own
791
+ * flag. In the Workbench, everything the connection allows; an app answers
792
+ * its scope — the tables its manifest names, or nothing — and every write
793
+ * affordance asks before it appears. The server enforces the same list;
794
+ * this is what keeps a button from promising a write the server refuses.
795
+ */
796
+ export function writeAllowed(tableId) {
797
+ return Boolean(shell().writeScope(tableId));
798
+ }
799
+ /* ---------- the empty word ---------- */
800
+ /**
801
+ * What an empty value reads as. In the workbench, plain DB mode, it is
802
+ * `null`, because that is the truth about the row and the reader is reading
803
+ * the database. An app answers a dash: a record form full of the word `null`
804
+ * is the schema leaking through, and "nothing here" is a form's own word for
805
+ * it, with the truth one hover away. The shell's answer, so core never asks
806
+ * whether an app is on.
807
+ */
808
+ export function emptyWord() {
809
+ return shell().emptyWord() ?? 'null';
810
+ }
811
+ /* ---------- column labels ---------- */
812
+ /**
813
+ * The one place a column's shown name is decided, answered by whoever owns
814
+ * the words — app mode answers the manifest's labels plus the humanized
815
+ * fallback; the workbench, plain DB mode, shows the raw name on every
816
+ * surface. One seam instead of a per-surface `inAppMode()` map, because
817
+ * the surfaces that forgot the map were exactly the ones still showing
818
+ * INVOICE_ID in an app.
819
+ */
820
+ /**
821
+ * What to call a column of a table right now, or null for "the raw name".
822
+ * `column` may be a dotted label path — "account_id.name" — and the
823
+ * source decides how that reads. `contextPath` names a related record
824
+ * already identified by the containing field section.
825
+ */
826
+ export function columnLabel(tableId, column, contextPath = '') {
827
+ return shell().label(tableId, column, contextPath) ?? null;
828
+ }
829
+ /**
830
+ * How a column's values dress — the label seam's twin, for rendering.
831
+ * App mode answers the manifest's display rules; in the workbench every
832
+ * value keeps the explorer's plain face. Returns a rule
833
+ * ({ format?, currency?, tone?, bar? }) or null for "as it is".
834
+ * @returns {any}
835
+ */
836
+ export function columnDisplay(tableId, column) {
837
+ return shell().display(tableId, column) ?? null;
838
+ }
839
+ /**
840
+ * Open one record, in whichever view the walk is already in.
841
+ *
842
+ * Every route into a record goes through here, so the mode is sticky by
843
+ * default and a call site that wants the record view specifically still says
844
+ * `go(rowView(...))` — which is what the table grid and the record view's own
845
+ * related lists do, since neither is in page view to begin with.
846
+ */
847
+ /* How a record opens can be the app's decision — a drawer, one day a
848
+ modal — the shell's answer, as page affinity is: core stays app-ignorant
849
+ and asks. An opener that answers true has handled the click. Who begins
850
+ reading a record's page ahead of the press that opens it
851
+ (recordCompose.ts) is the shell's answer too. */
852
+ /**
853
+ * Begin reading the page a press on this record will open, before the
854
+ * press is over: the same page `openRecord` would choose, asked of the
855
+ * prefetcher, which decides whether the record opens as a page at all.
856
+ * Nothing moves and nothing is drawn; a record that opens some other way
857
+ * asks nothing.
858
+ */
859
+ export function prefetchRecord(tableId, key) {
860
+ const { prefetchRecord: recordPrefetcher, resolvePage: pageResolver, pageAffinity } = shell();
861
+ if (!recordPrefetcher || !pageResolver || !tableId || !key || typeof key !== 'object')
862
+ return;
863
+ const here = currentEntry();
864
+ if (here?.kind === 'page' && !here.key && here.table === tableId) {
865
+ recordPrefetcher(here.pageId, tableId, key);
866
+ return;
867
+ }
868
+ if (!(here?.kind === 'page' || pageAffinity(tableId)))
869
+ return;
870
+ void Promise.resolve(pageResolver(tableId)).then((pageId) => {
871
+ if (pageId)
872
+ recordPrefetcher(pageId, tableId, key);
873
+ }, () => { });
874
+ }
875
+ /* A glance at one record without leaving the list (Space on a row), which
876
+ peekpanel.js draws: the shell's answer, as the opener is, so core and the
877
+ grid stay free of the drawer. */
878
+ /** Glance at a record over the list; false where the shell draws no drawer. */
879
+ export function peekRecord(tableId, key, label, records, list) {
880
+ const recordPeeker = shell().peekRecord;
881
+ if (!recordPeeker)
882
+ return false;
883
+ const branch = unionBranch(tableId, key);
884
+ if (branch)
885
+ recordPeeker(branch.table, branch.key, label);
886
+ else if (branch === undefined)
887
+ recordPeeker(tableId, key, label, records, list);
888
+ return true;
889
+ }
890
+ /** A union row's own record — `{ table, key }`, null where its branch is not this reader's — or undefined for any other table's. */
891
+ function unionBranch(tableId, key) {
892
+ const branches = findTable(tableId)?.union?.branches;
893
+ const branch = branches?.find((b) => b.from === key?.from);
894
+ return branches && (branch ? { table: branch.from, key: { [branch.key]: key.key } } : null);
895
+ }
896
+ export async function openRecord(tableId, key, label, how = 'push', opts = {}) {
897
+ /* A union's row is its branch's record (appUnions.ts): opened there, without the union's list to step through. */
898
+ const branch = unionBranch(tableId, key);
899
+ if (branch !== undefined)
900
+ return branch ? openRecord(branch.table, branch.key, label, how, { direct: opts.direct }) : undefined;
901
+ if (!allowMutationExit())
902
+ return;
903
+ const isCurrent = beginNavigation();
904
+ /* `direct` is the drawer's own "Details →" declining its own answer:
905
+ without it the opener would answer the click it just handed over. */
906
+ /* A registered opener may either consume the click (`true`) or ask for a
907
+ row route (`'row'`) while still taking part in the normal navigation
908
+ fencing. The latter is used by app-owned split workspaces: their detail
909
+ pane is a row surface, but automatic page affinity must not replace it
910
+ with a configured page. */
911
+ const answer = !opts.direct ? shell().openRecord(tableId, key, label, opts.records, opts.list) : false;
912
+ /* `{ under }` is a row route that first stands a list beneath it: a split
913
+ picked at the App's root, where the walk is empty (appnav.js). */
914
+ const under = answer && typeof answer === 'object' ? answer.under : undefined;
915
+ const opening = under ? 'row' : answer;
916
+ /* The list it was opened from rides the record's entry, so the record can
917
+ step to its neighbors (recordTrail.ts). Not in the address: a link is to
918
+ the record, and the list it was reached from is this reader's walk. */
919
+ const trail = trailFor(tableId, key, opts.records, opts.list);
920
+ const trailed = (entry) => (trail ? { ...entry, trail } : entry);
921
+ if (opening === true)
922
+ return;
923
+ /* Rooting the page you are standing on. A rootless page shows its list
924
+ as the chooser, and choosing is not a step of the walk — the entry
925
+ gains its key in place, or the trail reads `invoice › invoice ›
926
+ invoice`, one hollow crumb per change of mind. */
927
+ const here = currentEntry();
928
+ if (here?.kind === 'page' && !here.key && here.table === tableId) {
929
+ go({ ...here, key, label, rootBody: undefined }, 'replace');
930
+ return;
931
+ }
932
+ const pageResolver = shell().resolvePage;
933
+ if (opening !== 'row' && (here?.kind === 'page' || shell().pageAffinity(tableId)) && pageResolver) {
934
+ try {
935
+ const pageId = await pageResolver(tableId);
936
+ if (!isCurrent())
937
+ return;
938
+ if (pageId) {
939
+ go(trailed(pageView(pageId, tableId, key, label)), how);
940
+ return;
941
+ }
942
+ }
943
+ catch {
944
+ /* A page that cannot be resolved is not a reason to go nowhere. */
945
+ }
946
+ }
947
+ if (!isCurrent())
948
+ return;
949
+ /* A split's pick is its list's selection, not a step. The first pick
950
+ stands the row on its list — the split's address is the list and then
951
+ the key, `/thread/inbox/~2`, so the list entry stays under it —
952
+ and every later pick replaces that row, as a rooted page gains its key in
953
+ place above: pushed, each pick was one more crumb and one more Back
954
+ (Crumbs.tsx draws the list and its row as one crumb). Only the split's
955
+ own room: a record opened from anywhere else pushes. */
956
+ const picked = opening === 'row' && here?.kind === 'row' && here.table === tableId;
957
+ if (under && !state.stack.length)
958
+ state.stack.push(under);
959
+ go(trailed(rowView(tableId, key, label)), picked ? 'replace' : how);
960
+ }
961
+ /* ---------- chrome shared between views ---------- */
962
+ /* Whether the compiled SQL is on show. Held here rather than read off a
963
+ button, because the control that sets it moved into a menu and the pane
964
+ should not care which widget last toggled it. */
965
+ let explaining = false;
966
+ export const explainVisible = () => explaining;
967
+ export function setExplaining(on) {
968
+ explaining = on;
969
+ showExplain();
970
+ }
971
+ export function setExplain(sql) {
972
+ $('explain').textContent = sql ?? '';
973
+ lastExplained = sql ?? '';
974
+ showExplain();
975
+ }
976
+ /* The pane is hidden as a whole rather than the <pre> alone, so the control
977
+ that edits the statement cannot outlive the statement it edits. */
978
+ function showExplain() {
979
+ const pane = $('explain-pane');
980
+ if (pane)
981
+ pane.hidden = !explaining || !$('explain').textContent;
982
+ }
983
+ /** The statement the current view compiled to, for anything that wants to run it. */
984
+ let lastExplained = '';
985
+ export const explainedSql = () => lastExplained;
986
+ export function showErrors(errors) {
987
+ const box = $('errors');
988
+ box.replaceChildren(...errors.map((e) => el('p', { text: e.message })));
989
+ box.hidden = !errors.length;
990
+ /* A query that did not run must not be saveable as a filter.
991
+
992
+ The banner said `"quantitee" is not a column on invoice_line`, correctly
993
+ and helpfully — and beside it "+ Save this filter" stayed live, so a typo
994
+ could be given a name and kept. The clause chips stayed ordinary too,
995
+ which is the deeper misdescription: when the query fails *none* of them
996
+ are in effect, so a row of chips reading as the current filter is
997
+ describing something that is not happening.
998
+
999
+ Done here rather than where the bar is built because this is the only
1000
+ moment the app knows: the bar is drawn from the query text, before the
1001
+ answer comes back. */
1002
+ const failed = errors.length > 0;
1003
+ for (const save of shellQueryAll('.view-save')) {
1004
+ if (!(save instanceof HTMLButtonElement))
1005
+ continue;
1006
+ save.disabled = failed;
1007
+ save.title = failed ? say('fixTheQueryBefore') : '';
1008
+ }
1009
+ shellQuery('.views')?.classList.toggle('not-in-effect', failed);
1010
+ }
1011
+ /**
1012
+ * Quote a value for the query bar, only when it needs it.
1013
+ *
1014
+ * The one place the client writes a value into the grammar, and it is the
1015
+ * server's own `quoteValue`, not a copy: the copy's rule ("word characters,
1016
+ * dots and hyphens are safe") let a slug carrying `select` through bare, and
1017
+ * the parser read it as a clause. `quoteValue` asks the parser whether the
1018
+ * bare value reads back as itself, so the two cannot disagree again.
1019
+ */
1020
+ export function quote(value) {
1021
+ return quoteValue(value);
1022
+ }
1023
+ /** A short-lived message at the top of the content area. */
1024
+ /**
1025
+ * A passing message, optionally with one thing to do about it.
1026
+ *
1027
+ * The action exists for the case where the message *is* the moment to act —
1028
+ * "Updated 2 columns" is exactly when someone realises it was the wrong row,
1029
+ * and sending them to a menu to find Undo wastes the seconds in which they
1030
+ * still remember what they did. Anything that needs more than one verb belongs
1031
+ * in a dialog rather than here.
1032
+ */
1033
+ export function toast(message, tone = 'info', action) {
1034
+ const host = $('toast');
1035
+ if (!host || sessionIdentity().mode === 'locked')
1036
+ return;
1037
+ showToast(host, message, tone, action, prefersPages());
1038
+ }
1039
+ /* ---------- persistence ----------
1040
+
1041
+ Every localStorage call is wrapped. It throws in Safari's private mode, it
1042
+ throws when the quota is exceeded, and it is absent entirely in some
1043
+ embedded webviews. A browser that cannot remember your saved filters should
1044
+ still let you browse the database — losing a preference is not a reason to
1045
+ lose the tool. */
1046
+ export function loadJson(key, fallback) {
1047
+ try {
1048
+ const raw = captureScopedStorage(() => window.localStorage).getItem(key);
1049
+ if (!raw)
1050
+ return fallback;
1051
+ const parsed = JSON.parse(raw);
1052
+ return parsed ?? fallback;
1053
+ }
1054
+ catch {
1055
+ // Corrupt or unreadable: start fresh rather than breaking the page.
1056
+ return fallback;
1057
+ }
1058
+ }
1059
+ export function saveJson(key, value) {
1060
+ try {
1061
+ captureScopedStorage(() => window.localStorage).setItem(key, JSON.stringify(value));
1062
+ return true;
1063
+ }
1064
+ catch {
1065
+ return false;
1066
+ }
1067
+ }