@protobase/ui 0.113.1 → 0.114.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (192) hide show
  1. package/dist/account/messages.d.ts +2 -2
  2. package/dist/app/app.d.ts +4 -1
  3. package/dist/app/app.js +9 -7
  4. package/dist/app/charts/messages.d.ts +2 -2
  5. package/dist/app/comments/messages.d.ts +2 -2
  6. package/dist/app/confirm-sign-in-messages.d.ts +2 -2
  7. package/dist/app/create/messages.d.ts +2 -2
  8. package/dist/app/delete/messages.d.ts +2 -2
  9. package/dist/app/displays/messages.d.ts +2 -2
  10. package/dist/app/displays/virtual-cards.js +1 -0
  11. package/dist/app/embedded-list/messages.d.ts +2 -2
  12. package/dist/app/export/messages.d.ts +2 -2
  13. package/dist/app/field-messages.d.ts +2 -2
  14. package/dist/app/field-types/workflow/messages.d.ts +2 -2
  15. package/dist/app/field-types/workflow-page/messages.d.ts +2 -2
  16. package/dist/app/field-types/workflow-run/messages.d.ts +2 -2
  17. package/dist/app/first-frame.d.ts +13 -0
  18. package/dist/app/first-frame.js +23 -0
  19. package/dist/app/focus/messages.d.ts +2 -2
  20. package/dist/app/gallery/gallery-layout.d.ts +2 -2
  21. package/dist/app/gallery/messages.d.ts +2 -2
  22. package/dist/app/hand-order/messages.d.ts +2 -2
  23. package/dist/app/import/messages.d.ts +2 -2
  24. package/dist/app/index.html +0 -17
  25. package/dist/app/list-messages.d.ts +2 -2
  26. package/dist/app/main.js +19 -7
  27. package/dist/app/messages.d.ts +2 -2
  28. package/dist/app/pages/messages.d.ts +2 -2
  29. package/dist/app/record-chart/messages.d.ts +2 -2
  30. package/dist/app/record-messages.d.ts +2 -2
  31. package/dist/app/record-mode/shown-layout.d.ts +1 -1
  32. package/dist/app/record-row/messages.d.ts +2 -2
  33. package/dist/app/record-row/record-row.js +1 -0
  34. package/dist/app/refresh-mark.d.ts +2 -1
  35. package/dist/app/refresh-mark.js +3 -1
  36. package/dist/app/reveal-when-loaded.d.ts +8 -2
  37. package/dist/app/reveal-when-loaded.js +12 -5
  38. package/dist/app/runtime/messages.d.ts +2 -2
  39. package/dist/app/saved/messages.d.ts +2 -2
  40. package/dist/app/searches/messages.d.ts +2 -2
  41. package/dist/app/splash-hold.d.ts +0 -1
  42. package/dist/app/splash-hold.js +1 -1
  43. package/dist/app/start-screen.d.ts +0 -9
  44. package/dist/app/start-screen.js +1 -10
  45. package/dist/app/ui-ready.d.ts +11 -0
  46. package/dist/app/ui-ready.js +12 -0
  47. package/dist/app-shell/app-shell.js +3 -1
  48. package/dist/app-shell/close-sidebar.d.ts +10 -0
  49. package/dist/app-shell/close-sidebar.js +17 -0
  50. package/dist/app-shell/drawer.d.ts +7 -1
  51. package/dist/app-shell/drawer.js +26 -7
  52. package/dist/app-shell/index.d.ts +2 -1
  53. package/dist/app-shell/index.js +2 -1
  54. package/dist/app-shell/messages.d.ts +2 -2
  55. package/dist/app-shell/top-bar.js +4 -4
  56. package/dist/assistant-dock/messages.d.ts +2 -2
  57. package/dist/auth/messages.d.ts +2 -2
  58. package/dist/calls/messages.d.ts +2 -2
  59. package/dist/chat/messages.d.ts +2 -2
  60. package/dist/data/query-keys.d.ts +6 -0
  61. package/dist/data/query-keys.js +10 -0
  62. package/dist/data/start-cache/cached-plugins.d.ts +6 -0
  63. package/dist/data/start-cache/cached-plugins.js +10 -0
  64. package/dist/data-grid/data-grid.js +1 -0
  65. package/dist/data-grid/messages.d.ts +2 -2
  66. package/dist/data-grid/row-source.d.ts +5 -0
  67. package/dist/data-grid/use-paged-rows.d.ts +5 -3
  68. package/dist/data-grid/use-paged-rows.js +21 -6
  69. package/dist/filter-panel/messages.d.ts +2 -2
  70. package/dist/index.d.ts +4 -1
  71. package/dist/index.js +4 -1
  72. package/dist/inline-child-table/messages.d.ts +2 -2
  73. package/dist/live/grid-loader.d.ts +1 -0
  74. package/dist/live/grid-loader.js +3 -1
  75. package/dist/live/use-live-rows.js +1 -0
  76. package/dist/mocks/orders.d.ts +1 -1
  77. package/dist/notifications/bell/messages.d.ts +2 -2
  78. package/dist/organizations/members-page.js +13 -7
  79. package/dist/organizations/messages.d.ts +2 -2
  80. package/dist/organizations/use-organizations.d.ts +4 -1
  81. package/dist/organizations/use-organizations.js +25 -19
  82. package/dist/package.js +1 -1
  83. package/dist/plugins/plugin-source.d.ts +24 -4
  84. package/dist/plugins/plugin-source.js +48 -14
  85. package/dist/plugins/use-plugin-loads.d.ts +3 -1
  86. package/dist/plugins/use-plugin-loads.js +24 -7
  87. package/dist/primitives/skeleton.js +1 -0
  88. package/dist/roles/use-active-role.d.ts +4 -1
  89. package/dist/roles/use-active-role.js +18 -13
  90. package/dist/shell/assets/api-provider-BJJrOoO4.js +2 -0
  91. package/dist/shell/assets/app-VoTi41IN.js +16 -0
  92. package/dist/shell/assets/badge-OU9hb6yQ.js +2 -0
  93. package/dist/shell/assets/checkbox-DFfK432Y.js +2 -0
  94. package/dist/shell/assets/createLucideIcon-DGm8SdFI.js +2 -0
  95. package/dist/shell/assets/display-value-CIH2qfgQ.js +2 -0
  96. package/dist/shell/assets/{field-badge-3QmjR1r3.js → field-badge-DX2Mc_fH.js} +2 -2
  97. package/dist/shell/assets/{graph-view-CIk96BRv.js → graph-view-CY9LPr0B.js} +2 -2
  98. package/dist/shell/assets/{html-viewer-ATz2AVBi.js → html-viewer-BPGMH_GA.js} +2 -2
  99. package/dist/shell/assets/{in-place-form-frfvnKaj.js → in-place-form-RWSQGEg4.js} +2 -2
  100. package/dist/shell/assets/index-Bzb-O7ER.js +2 -0
  101. package/dist/shell/assets/index-HnFovy2Q.css +2 -0
  102. package/dist/shell/assets/{intl-cache-bXVNV0Yq.js → intl-cache-D4doUjK1.js} +2 -2
  103. package/dist/shell/assets/{lib-d3-interpolate-Cl0dHO4f.js → lib-d3-interpolate-D3u38iyJ.js} +2 -2
  104. package/dist/shell/assets/{lib-d3-transition-DUHAGQ8z.js → lib-d3-transition-BUpPvFvt.js} +2 -2
  105. package/dist/shell/assets/{lib-d3-zoom-gQh2osrj.js → lib-d3-zoom-BF7SPKNh.js} +2 -2
  106. package/dist/shell/assets/{lib-vis.gl-react-maplibre-CU7gWYjg.js → lib-vis.gl-react-maplibre-C7-0xNFC.js} +2 -2
  107. package/dist/shell/assets/{lib-xyflow-react-DGg_5r7u.js → lib-xyflow-react-CKyW7szC.js} +2 -2
  108. package/dist/shell/assets/maplibre-9ViQO48S.js +2 -0
  109. package/dist/shell/assets/{markdown-content-mNJHzGOa.js → markdown-content-DTB9RQDs.js} +2 -2
  110. package/dist/shell/assets/{record-map-BsXXSshB.js → record-map-CVqCWtfe.js} +2 -2
  111. package/dist/shell/assets/{records-map-D8EBzOu8.js → records-map-ClYSxrVR.js} +2 -2
  112. package/dist/shell/assets/{run-trace-view-Tf6Jwd46.js → run-trace-view-CN16MiXg.js} +2 -2
  113. package/dist/shell/assets/search-picker-BGpvJQRD.js +2 -0
  114. package/dist/shell/assets/shared-protobase-ui-BC8LqGQB.js +2 -0
  115. package/dist/shell/assets/step-catalog-CZY0ZpCC.js +2 -0
  116. package/dist/shell/assets/step-panel-DhD80lsJ.js +2 -0
  117. package/dist/shell/assets/use-app-address-B4Uk3nWy.js +2 -0
  118. package/dist/shell/assets/{use-meta-BqEqOLNe.js → use-meta-D5kYywHm.js} +2 -2
  119. package/dist/shell/assets/{use-sibling-page-Dm7aUfaa.js → use-sibling-page-BJ81HcOP.js} +3 -3
  120. package/dist/shell/assets/value-badge-Dpd8dRqq.js +2 -0
  121. package/dist/shell/assets/{vendor-WWp_xlp2.js → vendor-3etemhgS.js} +4 -4
  122. package/dist/shell/assets/{workflow-canvas-B8ciy9xI.js → workflow-canvas-C1nGpi5w.js} +2 -2
  123. package/dist/shell/assets/{workflow-graph-editor-QT-3e-M9.js → workflow-graph-editor-DAJa4lq6.js} +2 -2
  124. package/dist/shell/assets/workflow-workbench-HramVZEJ.js +4 -0
  125. package/dist/shell/assets/{workflows-Bku4o2su.js → workflows-DlvOln9v.js} +2 -2
  126. package/dist/shell/assets/{workflows-start-kl7rSSay.js → workflows-start-QUKfwFqf.js} +2 -2
  127. package/dist/shell/index.html +16 -19
  128. package/dist/shell/protobase.shell.json +2 -2
  129. package/dist/shell/protobase.sw.js +2 -2
  130. package/dist/shell-source-maps/assets/api-provider-BJJrOoO4.js.map +1 -0
  131. package/dist/shell-source-maps/assets/app-VoTi41IN.js.map +1 -0
  132. package/dist/shell-source-maps/assets/{badge-ChHXC28D.js.map → badge-OU9hb6yQ.js.map} +1 -1
  133. package/dist/shell-source-maps/assets/{checkbox-COOOlJPG.js.map → checkbox-DFfK432Y.js.map} +1 -1
  134. package/dist/shell-source-maps/assets/createLucideIcon-DGm8SdFI.js.map +1 -0
  135. package/dist/shell-source-maps/assets/display-value-CIH2qfgQ.js.map +1 -0
  136. package/dist/shell-source-maps/assets/{field-badge-3QmjR1r3.js.map → field-badge-DX2Mc_fH.js.map} +1 -1
  137. package/dist/shell-source-maps/assets/{graph-view-CIk96BRv.js.map → graph-view-CY9LPr0B.js.map} +1 -1
  138. package/dist/shell-source-maps/assets/{html-viewer-ATz2AVBi.js.map → html-viewer-BPGMH_GA.js.map} +1 -1
  139. package/dist/shell-source-maps/assets/{in-place-form-frfvnKaj.js.map → in-place-form-RWSQGEg4.js.map} +1 -1
  140. package/dist/shell-source-maps/assets/index-Bzb-O7ER.js.map +1 -0
  141. package/dist/shell-source-maps/assets/{intl-cache-bXVNV0Yq.js.map → intl-cache-D4doUjK1.js.map} +1 -1
  142. package/dist/shell-source-maps/assets/{lib-d3-interpolate-Cl0dHO4f.js.map → lib-d3-interpolate-D3u38iyJ.js.map} +1 -1
  143. package/dist/shell-source-maps/assets/{lib-d3-transition-DUHAGQ8z.js.map → lib-d3-transition-BUpPvFvt.js.map} +1 -1
  144. package/dist/shell-source-maps/assets/{lib-d3-zoom-gQh2osrj.js.map → lib-d3-zoom-BF7SPKNh.js.map} +1 -1
  145. package/dist/shell-source-maps/assets/{lib-vis.gl-react-maplibre-CU7gWYjg.js.map → lib-vis.gl-react-maplibre-C7-0xNFC.js.map} +1 -1
  146. package/dist/shell-source-maps/assets/{lib-xyflow-react-DGg_5r7u.js.map → lib-xyflow-react-CKyW7szC.js.map} +1 -1
  147. package/dist/shell-source-maps/assets/{maplibre-BufRSV4y.js.map → maplibre-9ViQO48S.js.map} +1 -1
  148. package/dist/shell-source-maps/assets/{markdown-content-mNJHzGOa.js.map → markdown-content-DTB9RQDs.js.map} +1 -1
  149. package/dist/shell-source-maps/assets/{record-map-BsXXSshB.js.map → record-map-CVqCWtfe.js.map} +1 -1
  150. package/dist/shell-source-maps/assets/{records-map-D8EBzOu8.js.map → records-map-ClYSxrVR.js.map} +1 -1
  151. package/dist/shell-source-maps/assets/{run-trace-view-Tf6Jwd46.js.map → run-trace-view-CN16MiXg.js.map} +1 -1
  152. package/dist/shell-source-maps/assets/{search-picker-BHmYOFF8.js.map → search-picker-BGpvJQRD.js.map} +1 -1
  153. package/dist/shell-source-maps/assets/shared-protobase-ui-BC8LqGQB.js.map +1 -0
  154. package/dist/shell-source-maps/assets/{step-catalog-DZNovnPL.js.map → step-catalog-CZY0ZpCC.js.map} +1 -1
  155. package/dist/shell-source-maps/assets/{step-panel-3aRZ2Dlj.js.map → step-panel-DhD80lsJ.js.map} +1 -1
  156. package/dist/shell-source-maps/assets/{use-app-address-B6k3dkV0.js.map → use-app-address-B4Uk3nWy.js.map} +1 -1
  157. package/dist/shell-source-maps/assets/{use-meta-BqEqOLNe.js.map → use-meta-D5kYywHm.js.map} +1 -1
  158. package/dist/shell-source-maps/assets/{use-sibling-page-Dm7aUfaa.js.map → use-sibling-page-BJ81HcOP.js.map} +1 -1
  159. package/dist/shell-source-maps/assets/{value-badge-BKLV4otJ.js.map → value-badge-Dpd8dRqq.js.map} +1 -1
  160. package/dist/shell-source-maps/assets/{vendor-WWp_xlp2.js.map → vendor-3etemhgS.js.map} +1 -1
  161. package/dist/shell-source-maps/assets/{workflow-canvas-B8ciy9xI.js.map → workflow-canvas-C1nGpi5w.js.map} +1 -1
  162. package/dist/shell-source-maps/assets/{workflow-graph-editor-QT-3e-M9.js.map → workflow-graph-editor-DAJa4lq6.js.map} +1 -1
  163. package/dist/shell-source-maps/assets/{workflow-workbench-C5eHhxQh.js.map → workflow-workbench-HramVZEJ.js.map} +1 -1
  164. package/dist/shell-source-maps/assets/{workflows-Bku4o2su.js.map → workflows-DlvOln9v.js.map} +1 -1
  165. package/dist/shell-source-maps/assets/{workflows-start-kl7rSSay.js.map → workflows-start-QUKfwFqf.js.map} +1 -1
  166. package/dist/status/messages.d.ts +2 -2
  167. package/dist/styles.css +14 -0
  168. package/package.json +5 -5
  169. package/dist/app/hold-start-for-first-loads.d.ts +0 -12
  170. package/dist/app/hold-start-for-first-loads.js +0 -43
  171. package/dist/shell/assets/api-provider-CcDtTh0D.js +0 -2
  172. package/dist/shell/assets/app-C1xWr51x.js +0 -16
  173. package/dist/shell/assets/badge-ChHXC28D.js +0 -2
  174. package/dist/shell/assets/checkbox-COOOlJPG.js +0 -2
  175. package/dist/shell/assets/display-value-fDiKbfJO.js +0 -2
  176. package/dist/shell/assets/index-BkCaPeOq.css +0 -2
  177. package/dist/shell/assets/index-C4cMQVG2.js +0 -2
  178. package/dist/shell/assets/maplibre-BufRSV4y.js +0 -2
  179. package/dist/shell/assets/messages-ClKBpZlk.js +0 -2
  180. package/dist/shell/assets/search-picker-BHmYOFF8.js +0 -2
  181. package/dist/shell/assets/shared-protobase-ui-C1jBhoci.js +0 -2
  182. package/dist/shell/assets/step-catalog-DZNovnPL.js +0 -2
  183. package/dist/shell/assets/step-panel-3aRZ2Dlj.js +0 -2
  184. package/dist/shell/assets/use-app-address-B6k3dkV0.js +0 -2
  185. package/dist/shell/assets/value-badge-BKLV4otJ.js +0 -2
  186. package/dist/shell/assets/workflow-workbench-C5eHhxQh.js +0 -4
  187. package/dist/shell-source-maps/assets/api-provider-CcDtTh0D.js.map +0 -1
  188. package/dist/shell-source-maps/assets/app-C1xWr51x.js.map +0 -1
  189. package/dist/shell-source-maps/assets/display-value-fDiKbfJO.js.map +0 -1
  190. package/dist/shell-source-maps/assets/index-C4cMQVG2.js.map +0 -1
  191. package/dist/shell-source-maps/assets/messages-ClKBpZlk.js.map +0 -1
  192. package/dist/shell-source-maps/assets/shared-protobase-ui-C1jBhoci.js.map +0 -1
@@ -64,20 +64,6 @@
64
64
  transform: rotate(360deg);
65
65
  }
66
66
  }
67
- /* A host's snapshot of the page shown last (start-screen.ts), in place of the spinner, inert, until the app draws */
68
- #pb-snapshot {
69
- position: absolute;
70
- inset: 0;
71
- overflow: hidden;
72
- pointer-events: none;
73
- user-select: none;
74
- }
75
- #pb-snapshot:empty {
76
- display: none;
77
- }
78
- #pb-start:has(#pb-snapshot:not(:empty)) svg {
79
- display: none;
80
- }
81
67
  /* A start that failed: index.html's own words, as the app's translations never loaded */
82
68
  #pb-start [role='alert'] {
83
69
  display: flex;
@@ -107,7 +93,6 @@
107
93
  <!-- As tall as the screen shows, browser toolbars aside, so a page that fills it, such as a map, keeps the bottom bar in view. The page reaches under the status bar and the home indicator, which the shell's bars keep clear of; the sides keep clear of the notch. -->
108
94
  <div id="root" class="h-dvh" style="padding-left: var(--pb-safe-left); padding-right: var(--pb-safe-right)"></div>
109
95
  <div id="pb-start" aria-hidden="true">
110
- <div id="pb-snapshot"></div>
111
96
  <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 12a9 9 0 1 1-6.219-8.56" /></svg>
112
97
  <div role="alert" hidden>
113
98
  <p style="margin: 0">The app did not load. Check your connection, then try again.</p>
@@ -132,8 +117,6 @@
132
117
  // A stylesheet or an image that does not load leaves the app to start
133
118
  if (event && event.type === 'error' && event.target !== window && event.target.tagName !== 'SCRIPT') return
134
119
  stop()
135
- var snapshot = document.getElementById('pb-snapshot')
136
- if (snapshot) snapshot.remove()
137
120
  start.removeAttribute('aria-hidden')
138
121
  start.querySelector('svg').remove()
139
122
  start.querySelector('[role="alert"]').hidden = false
@@ -1,7 +1,7 @@
1
1
  import { MessageValue } from "../locale/messages.js";
2
2
  //#region src/app/list-messages.d.ts
3
3
  export declare const text: {
4
- (id: "sort" | "search" | "clearSearch" | "delete" | "filters" | "created" | "deleteCount" | "couldNotLoadRows" | "export" | "noneYet" | "unreadableFilter" | "searchPlural" | "noList" | "filtersCount" | "newRecord" | "openRecord" | "exportCount" | "actionCount" | "dragToSort" | "noMatchSearch" | "noMatchFilters" | "noMatch" | "clearFilters", values?: Record<string, MessageValue>): string;
5
- rich(id: "sort" | "search" | "clearSearch" | "delete" | "filters" | "created" | "deleteCount" | "couldNotLoadRows" | "export" | "noneYet" | "unreadableFilter" | "searchPlural" | "noList" | "filtersCount" | "newRecord" | "openRecord" | "exportCount" | "actionCount" | "dragToSort" | "noMatchSearch" | "noMatchFilters" | "noMatch" | "clearFilters", values: Record<string, MessageValue | import("react").ReactNode>): import("react").ReactNode;
4
+ (id: "sort" | "search" | "clearSearch" | "delete" | "filters" | "created" | "deleteCount" | "couldNotLoadRows" | "export" | "searchPlural" | "noList" | "filtersCount" | "newRecord" | "openRecord" | "exportCount" | "actionCount" | "dragToSort" | "unreadableFilter" | "noMatchSearch" | "noMatchFilters" | "noMatch" | "noneYet" | "clearFilters", values?: Record<string, MessageValue>): string;
5
+ rich(id: "sort" | "search" | "clearSearch" | "delete" | "filters" | "created" | "deleteCount" | "couldNotLoadRows" | "export" | "searchPlural" | "noList" | "filtersCount" | "newRecord" | "openRecord" | "exportCount" | "actionCount" | "dragToSort" | "unreadableFilter" | "noMatchSearch" | "noMatchFilters" | "noMatch" | "noneYet" | "clearFilters", values: Record<string, MessageValue | import("react").ReactNode>): import("react").ReactNode;
6
6
  };
7
7
  //#endregion
package/dist/app/main.js CHANGED
@@ -3,8 +3,13 @@ import { restorePage } from "./live-update/kept-page.js";
3
3
  import { browserLocale } from "../locale/active-locale.js";
4
4
  import { nativeBridgeOf } from "./native-auth-fetch.js";
5
5
  import { uiFromModule } from "./pages/ui-from-module.js";
6
+ import { browserLoader } from "../plugins/load-plugin.js";
7
+ import { createPluginSource, preloadPlugins } from "../plugins/plugin-source.js";
8
+ import { pluginWaitMs } from "../plugins/use-plugin-loads.js";
6
9
  import { App } from "./app.js";
10
+ import { judgesFirstFrame, showFirstFrame } from "./first-frame.js";
7
11
  import { listenForPresses } from "../lib/press-feedback.js";
12
+ import { cachedPlugins } from "../data/start-cache/cached-plugins.js";
8
13
  import { openStartCache } from "../data/start-cache/open-start-cache.js";
9
14
  import { showKeyboardAccessoryBar } from "./native-keyboard.js";
10
15
  import { applyNativeTextSize } from "./native-text-size.js";
@@ -27,11 +32,18 @@ if (nativeBridge) {
27
32
  const storage = guarded(() => window.sessionStorage, void 0);
28
33
  if (storage) restorePage(storage, window.history);
29
34
  }
30
- openStartCache().then((startCache) => createRoot(root).render(/* @__PURE__ */ jsx(StrictMode, { children: /* @__PURE__ */ jsx(App, {
31
- baseUrl: `${pageApiOrigin() ?? ""}/api/v1`,
32
- ui: uiFromModule(projectUi),
33
- locale: browserLocale(),
34
- nativeBridge,
35
- startCache
36
- }) })));
35
+ const plugins = createPluginSource(browserLoader);
36
+ openStartCache().then(async (startCache) => {
37
+ await preloadPlugins(plugins, cachedPlugins(startCache), pluginWaitMs);
38
+ const app = /* @__PURE__ */ jsx(StrictMode, { children: /* @__PURE__ */ jsx(App, {
39
+ baseUrl: `${pageApiOrigin() ?? ""}/api/v1`,
40
+ ui: uiFromModule(projectUi),
41
+ locale: browserLocale(),
42
+ nativeBridge,
43
+ startCache,
44
+ pluginSource: plugins
45
+ }) });
46
+ if (judgesFirstFrame(window)) return showFirstFrame(root, app);
47
+ createRoot(root).render(app);
48
+ });
37
49
  //#endregion
@@ -1,7 +1,7 @@
1
1
  import { MessageValue } from "../locale/messages.js";
2
2
  //#region src/app/messages.d.ts
3
3
  export declare const text: {
4
- (id: "pages" | "open" | "replace" | "reload" | "leave" | "account" | "remove" | "refreshing" | "fileMissing" | "noMatches" | "loading" | "new" | "assistant" | "noAnswer" | "admin" | "cannotReach" | "tryAgain" | "notFound" | "hr" | "average" | "show" | "noValue" | "noComponent" | "couldNotShow" | "noPage" | "signInPolicy" | "hide" | "noResource" | "somethingWentWrong" | "adminsOnly" | "onlyAdminPolicy" | "ownersOnly" | "onlyOwners" | "chooseResource" | "pickFromSidebar" | "nothingHere" | "operationFailed" | "nothingSaved" | "loadingRecord" | "choose" | "chooseFileFor" | "notUploaded" | "uploadingLabel" | "uploading" | "dropFile" | "chooseFile" | "sales" | "crm" | "catalog" | "inventory" | "tables" | "searchPlural" | "couldNotLoadOptions" | "refreshFailed" | "leaveTitle" | "leaveDescription" | "leaveInputLost" | "stay" | "reloadTitle" | "reloadDraftKept" | "reloadInputLost" | "keepEditing" | "setNewValue" | "signInRefused" | "loadingFrom" | "restWorks" | "staffSession" | "staffSignedIn" | "stopStaffSession" | "openLabel" | "opensNewTab", values?: Record<string, MessageValue>): string;
5
- rich(id: "pages" | "open" | "replace" | "reload" | "leave" | "account" | "remove" | "refreshing" | "fileMissing" | "noMatches" | "loading" | "new" | "assistant" | "noAnswer" | "admin" | "cannotReach" | "tryAgain" | "notFound" | "hr" | "average" | "show" | "noValue" | "noComponent" | "couldNotShow" | "noPage" | "signInPolicy" | "hide" | "noResource" | "somethingWentWrong" | "adminsOnly" | "onlyAdminPolicy" | "ownersOnly" | "onlyOwners" | "chooseResource" | "pickFromSidebar" | "nothingHere" | "operationFailed" | "nothingSaved" | "loadingRecord" | "choose" | "chooseFileFor" | "notUploaded" | "uploadingLabel" | "uploading" | "dropFile" | "chooseFile" | "sales" | "crm" | "catalog" | "inventory" | "tables" | "searchPlural" | "couldNotLoadOptions" | "refreshFailed" | "leaveTitle" | "leaveDescription" | "leaveInputLost" | "stay" | "reloadTitle" | "reloadDraftKept" | "reloadInputLost" | "keepEditing" | "setNewValue" | "signInRefused" | "loadingFrom" | "restWorks" | "staffSession" | "staffSignedIn" | "stopStaffSession" | "openLabel" | "opensNewTab", values: Record<string, MessageValue | import("react").ReactNode>): import("react").ReactNode;
4
+ (id: "pages" | "open" | "replace" | "reload" | "leave" | "account" | "remove" | "refreshing" | "noMatches" | "loading" | "new" | "fileMissing" | "assistant" | "noAnswer" | "admin" | "cannotReach" | "tryAgain" | "notFound" | "hr" | "show" | "noValue" | "noComponent" | "couldNotShow" | "noPage" | "signInPolicy" | "noResource" | "somethingWentWrong" | "adminsOnly" | "onlyAdminPolicy" | "ownersOnly" | "onlyOwners" | "chooseResource" | "pickFromSidebar" | "nothingHere" | "operationFailed" | "nothingSaved" | "loadingRecord" | "choose" | "chooseFileFor" | "notUploaded" | "uploadingLabel" | "uploading" | "dropFile" | "chooseFile" | "average" | "sales" | "crm" | "catalog" | "inventory" | "tables" | "searchPlural" | "couldNotLoadOptions" | "refreshFailed" | "leaveTitle" | "leaveDescription" | "leaveInputLost" | "stay" | "reloadTitle" | "reloadDraftKept" | "reloadInputLost" | "keepEditing" | "hide" | "setNewValue" | "signInRefused" | "loadingFrom" | "restWorks" | "staffSession" | "staffSignedIn" | "stopStaffSession" | "openLabel" | "opensNewTab", values?: Record<string, MessageValue>): string;
5
+ rich(id: "pages" | "open" | "replace" | "reload" | "leave" | "account" | "remove" | "refreshing" | "noMatches" | "loading" | "new" | "fileMissing" | "assistant" | "noAnswer" | "admin" | "cannotReach" | "tryAgain" | "notFound" | "hr" | "show" | "noValue" | "noComponent" | "couldNotShow" | "noPage" | "signInPolicy" | "noResource" | "somethingWentWrong" | "adminsOnly" | "onlyAdminPolicy" | "ownersOnly" | "onlyOwners" | "chooseResource" | "pickFromSidebar" | "nothingHere" | "operationFailed" | "nothingSaved" | "loadingRecord" | "choose" | "chooseFileFor" | "notUploaded" | "uploadingLabel" | "uploading" | "dropFile" | "chooseFile" | "average" | "sales" | "crm" | "catalog" | "inventory" | "tables" | "searchPlural" | "couldNotLoadOptions" | "refreshFailed" | "leaveTitle" | "leaveDescription" | "leaveInputLost" | "stay" | "reloadTitle" | "reloadDraftKept" | "reloadInputLost" | "keepEditing" | "hide" | "setNewValue" | "signInRefused" | "loadingFrom" | "restWorks" | "staffSession" | "staffSignedIn" | "stopStaffSession" | "openLabel" | "opensNewTab", values: Record<string, MessageValue | import("react").ReactNode>): import("react").ReactNode;
6
6
  };
7
7
  //#endregion
@@ -1,7 +1,7 @@
1
1
  import { MessageValue } from "../../locale/messages.js";
2
2
  //#region src/app/pages/messages.d.ts
3
3
  export declare const text: {
4
- (id: "number" | "create" | "saved" | "failed" | "tabs" | "couldNotLoad" | "save" | "cancel" | "couldNotDraw" | "required" | "notFound" | "done" | "nothingYet" | "notSaved" | "wholeNumber" | "somethingWrong" | "noComponent" | "settings" | "noPage" | "noTab" | "unknownBlock" | "needsRecord" | "cannotChange" | "cannotDelete" | "doesNotApply" | "noHandler" | "noInputComponent" | "doneOn" | "refusedOn" | "noAction" | "loadMore" | "timelineCut" | "couldNotCount" | "dateFormat" | "atMost" | "tickEvery" | "nothingToTick" | "forRecords" | "timelineRange" | "timelineNow" | "timelinePoint", values?: Record<string, MessageValue>): string;
5
- rich(id: "number" | "create" | "saved" | "failed" | "tabs" | "couldNotLoad" | "save" | "cancel" | "couldNotDraw" | "required" | "notFound" | "done" | "nothingYet" | "notSaved" | "wholeNumber" | "somethingWrong" | "noComponent" | "settings" | "noPage" | "noTab" | "unknownBlock" | "needsRecord" | "cannotChange" | "cannotDelete" | "doesNotApply" | "noHandler" | "noInputComponent" | "doneOn" | "refusedOn" | "noAction" | "loadMore" | "timelineCut" | "couldNotCount" | "dateFormat" | "atMost" | "tickEvery" | "nothingToTick" | "forRecords" | "timelineRange" | "timelineNow" | "timelinePoint", values: Record<string, MessageValue | import("react").ReactNode>): import("react").ReactNode;
4
+ (id: "number" | "create" | "saved" | "failed" | "tabs" | "couldNotLoad" | "save" | "cancel" | "couldNotDraw" | "required" | "done" | "notFound" | "somethingWrong" | "noComponent" | "nothingYet" | "settings" | "notSaved" | "noPage" | "noTab" | "unknownBlock" | "needsRecord" | "cannotChange" | "cannotDelete" | "doesNotApply" | "noHandler" | "noInputComponent" | "doneOn" | "refusedOn" | "noAction" | "loadMore" | "timelineCut" | "couldNotCount" | "wholeNumber" | "dateFormat" | "atMost" | "tickEvery" | "nothingToTick" | "forRecords" | "timelineRange" | "timelineNow" | "timelinePoint", values?: Record<string, MessageValue>): string;
5
+ rich(id: "number" | "create" | "saved" | "failed" | "tabs" | "couldNotLoad" | "save" | "cancel" | "couldNotDraw" | "required" | "done" | "notFound" | "somethingWrong" | "noComponent" | "nothingYet" | "settings" | "notSaved" | "noPage" | "noTab" | "unknownBlock" | "needsRecord" | "cannotChange" | "cannotDelete" | "doesNotApply" | "noHandler" | "noInputComponent" | "doneOn" | "refusedOn" | "noAction" | "loadMore" | "timelineCut" | "couldNotCount" | "wholeNumber" | "dateFormat" | "atMost" | "tickEvery" | "nothingToTick" | "forRecords" | "timelineRange" | "timelineNow" | "timelinePoint", values: Record<string, MessageValue | import("react").ReactNode>): import("react").ReactNode;
6
6
  };
7
7
  //#endregion
@@ -1,7 +1,7 @@
1
1
  import { MessageValue } from "../../locale/messages.js";
2
2
  //#region src/app/record-chart/messages.d.ts
3
3
  export declare const text: {
4
- (id: "couldNotLoad" | "day" | "maximum" | "hour" | "week" | "range" | "average" | "measure" | "noSamples", values?: Record<string, MessageValue>): string;
5
- rich(id: "couldNotLoad" | "day" | "maximum" | "hour" | "week" | "range" | "average" | "measure" | "noSamples", values: Record<string, MessageValue | import("react").ReactNode>): import("react").ReactNode;
4
+ (id: "couldNotLoad" | "day" | "hour" | "maximum" | "week" | "range" | "average" | "measure" | "noSamples", values?: Record<string, MessageValue>): string;
5
+ rich(id: "couldNotLoad" | "day" | "hour" | "maximum" | "week" | "range" | "average" | "measure" | "noSamples", values: Record<string, MessageValue | import("react").ReactNode>): import("react").ReactNode;
6
6
  };
7
7
  //#endregion
@@ -1,7 +1,7 @@
1
1
  import { MessageValue } from "../locale/messages.js";
2
2
  //#region src/app/record-messages.d.ts
3
3
  export declare const text: {
4
- (id: "edit" | "fetching" | "saved" | "history" | "comments" | "loading" | "couldNotLoad" | "save" | "cancel" | "couldNotSave" | "delete" | "justNow" | "details" | "summary" | "nothingYet" | "notSaved" | "keep" | "discard" | "changedBySomeoneElse" | "lineNumber" | "noRecord" | "openingElsewhere" | "someoneElse" | "unsavedChanges" | "linesChanged" | "linesReloaded" | "unsavedKept" | "continueEditing" | "unsavedRestored" | "savingSubject" | "subjectSaved" | "recordActions" | "relatedRecords" | "lineField" | "tooManyLines", values?: Record<string, MessageValue>): string;
5
- rich(id: "edit" | "fetching" | "saved" | "history" | "comments" | "loading" | "couldNotLoad" | "save" | "cancel" | "couldNotSave" | "delete" | "justNow" | "details" | "summary" | "nothingYet" | "notSaved" | "keep" | "discard" | "changedBySomeoneElse" | "lineNumber" | "noRecord" | "openingElsewhere" | "someoneElse" | "unsavedChanges" | "linesChanged" | "linesReloaded" | "unsavedKept" | "continueEditing" | "unsavedRestored" | "savingSubject" | "subjectSaved" | "recordActions" | "relatedRecords" | "lineField" | "tooManyLines", values: Record<string, MessageValue | import("react").ReactNode>): import("react").ReactNode;
4
+ (id: "edit" | "fetching" | "saved" | "history" | "comments" | "loading" | "couldNotLoad" | "save" | "cancel" | "couldNotSave" | "delete" | "justNow" | "details" | "nothingYet" | "notSaved" | "keep" | "discard" | "summary" | "changedBySomeoneElse" | "lineNumber" | "noRecord" | "openingElsewhere" | "someoneElse" | "unsavedChanges" | "linesChanged" | "linesReloaded" | "unsavedKept" | "continueEditing" | "unsavedRestored" | "savingSubject" | "subjectSaved" | "recordActions" | "relatedRecords" | "lineField" | "tooManyLines", values?: Record<string, MessageValue>): string;
5
+ rich(id: "edit" | "fetching" | "saved" | "history" | "comments" | "loading" | "couldNotLoad" | "save" | "cancel" | "couldNotSave" | "delete" | "justNow" | "details" | "nothingYet" | "notSaved" | "keep" | "discard" | "summary" | "changedBySomeoneElse" | "lineNumber" | "noRecord" | "openingElsewhere" | "someoneElse" | "unsavedChanges" | "linesChanged" | "linesReloaded" | "unsavedKept" | "continueEditing" | "unsavedRestored" | "savingSubject" | "subjectSaved" | "recordActions" | "relatedRecords" | "lineField" | "tooManyLines", values: Record<string, MessageValue | import("react").ReactNode>): import("react").ReactNode;
6
6
  };
7
7
  //#endregion
@@ -1,6 +1,6 @@
1
1
  import { CustomSectionModel, LayoutItemModel } from "@protobase/schema";
2
2
  //#region src/app/record-mode/shown-layout.d.ts
3
- export declare const whenOf: (item: LayoutItemModel) => "always" | (string & {}) | "editing" | "reading" | undefined;
3
+ export declare const whenOf: (item: LayoutItemModel) => "always" | (string & {}) | "reading" | "editing" | undefined;
4
4
  /** The items with a record condition in `when`, those inside tabs, groups and fallbacks too, whose conditions the page evaluates: a group before its items. */
5
5
  export declare const conditionalItems: (items: LayoutItemModel[]) => LayoutItemModel[];
6
6
  /** A shown custom section: `fallbackAt` holds each shown fallback item's place in the whole fallback. */
@@ -1,7 +1,7 @@
1
1
  import { MessageValue } from "../../locale/messages.js";
2
2
  //#region src/app/record-row/messages.d.ts
3
3
  export declare const text: {
4
- (id: "couldNotLoad" | "viewAll" | "new" | "noneMatch" | "couldNotLoadYour" | "noneYet", values?: Record<string, MessageValue>): string;
5
- rich(id: "couldNotLoad" | "viewAll" | "new" | "noneMatch" | "couldNotLoadYour" | "noneYet", values: Record<string, MessageValue | import("react").ReactNode>): import("react").ReactNode;
4
+ (id: "couldNotLoad" | "viewAll" | "new" | "noneMatch" | "noneYet" | "couldNotLoadYour", values?: Record<string, MessageValue>): string;
5
+ rich(id: "couldNotLoad" | "viewAll" | "new" | "noneMatch" | "noneYet" | "couldNotLoadYour", values: Record<string, MessageValue | import("react").ReactNode>): import("react").ReactNode;
6
6
  };
7
7
  //#endregion
@@ -35,6 +35,7 @@ const RecordRow = ({ model, view, display, source, label, isNew }) => {
35
35
  total,
36
36
  rowAt: source.rowAt,
37
37
  loadRows: source.loadRows,
38
+ cachedRows: source.cachedRows,
38
39
  revision: source.revision,
39
40
  latencyMs: 0
40
41
  }, start, Math.max(start, end - 1));
@@ -2,7 +2,8 @@
2
2
  /**
3
3
  * Beside the page's title while the page shows data from the start cache: a small spinner while it refreshes, blank for
4
4
  * its first 180 ms, or a warning, in the same spot, once the refresh failed and the cached data stays. One status region
5
- * says which, so a screen reader hears when the refresh failed.
5
+ * says which, so a screen reader hears when the refresh failed. It is the one thing a refresh shows: the page itself
6
+ * stays as it was drawn (`data-fetching` names it so).
6
7
  */
7
8
  export declare const RefreshMark: ({ failed }: {
8
9
  failed: boolean;
@@ -8,9 +8,11 @@ import { jsx, jsxs } from "react/jsx-runtime";
8
8
  /**
9
9
  * Beside the page's title while the page shows data from the start cache: a small spinner while it refreshes, blank for
10
10
  * its first 180 ms, or a warning, in the same spot, once the refresh failed and the cached data stays. One status region
11
- * says which, so a screen reader hears when the refresh failed.
11
+ * says which, so a screen reader hears when the refresh failed. It is the one thing a refresh shows: the page itself
12
+ * stays as it was drawn (`data-fetching` names it so).
12
13
  */
13
14
  const RefreshMark = ({ failed }) => /* @__PURE__ */ jsxs("span", {
15
+ "data-fetching": true,
14
16
  className: "inline-flex items-center text-muted-foreground",
15
17
  children: [/* @__PURE__ */ jsx("span", {
16
18
  role: "status",
@@ -1,13 +1,19 @@
1
1
  import { ReactNode } from "react";
2
+ import { Query } from "@tanstack/react-query";
2
3
  //#region src/app/reveal-when-loaded.d.ts
3
4
  /** How long a page waits at most for its first data before it shows what it has. */
4
5
  export declare const revealWaitMs = 2000;
6
+ /**
7
+ * Whether the page is the one the app starts with from the start cache: the client holds restored answers and has
8
+ * fetched nothing of its own yet. A page opened later waits for its data as before.
9
+ */
10
+ export declare const startsFromCache: (queries: readonly Pick<Query, "state">[], startedAt: number) => boolean;
5
11
  /**
6
12
  * Draws a page out of sight until the data it asks for when it opens has come, with a skeleton over it meanwhile, so its
7
13
  * parts appear together where they stay instead of each moving the others as it loads. Data asked for in turn, such as
8
14
  * a band shown only when a count has come, is waited for too. It shows what it has after `revealWaitMs` at most, and
9
- * once shown it stays shown: later loads draw in place. Data the page already holds is not waited for, so a page drawn
10
- * from the start cache shows at once.
15
+ * once shown it stays shown: later loads draw in place. Data the page already holds is not waited for, and a page the
16
+ * app starts with from the start cache is shown in its first frame, drawn from what the cache holds.
11
17
  */
12
18
  export declare const RevealWhenLoaded: ({ children }: {
13
19
  children: ReactNode;
@@ -1,7 +1,8 @@
1
1
  import { cn } from "../lib/cn.js";
2
2
  import { Skeleton } from "../primitives/skeleton.js";
3
3
  import { text } from "./messages.js";
4
- import { useEffect, useState } from "react";
4
+ import { ClientStartContext, isRestored } from "../data/start-cache/restored-state.js";
5
+ import { useContext, useEffect, useState } from "react";
5
6
  import { jsx, jsxs } from "react/jsx-runtime";
6
7
  import { useIsFetching, useQueryClient } from "@tanstack/react-query";
7
8
  //#region src/app/reveal-when-loaded.tsx
@@ -12,16 +13,22 @@ const firstLoad = {
12
13
  predicate: (query) => query.state.data === void 0
13
14
  };
14
15
  /**
16
+ * Whether the page is the one the app starts with from the start cache: the client holds restored answers and has
17
+ * fetched nothing of its own yet. A page opened later waits for its data as before.
18
+ */
19
+ const startsFromCache = (queries, startedAt) => queries.some((query) => isRestored(query.state, startedAt)) && !queries.some((query) => query.state.dataUpdatedAt >= startedAt);
20
+ /**
15
21
  * Draws a page out of sight until the data it asks for when it opens has come, with a skeleton over it meanwhile, so its
16
22
  * parts appear together where they stay instead of each moving the others as it loads. Data asked for in turn, such as
17
23
  * a band shown only when a count has come, is waited for too. It shows what it has after `revealWaitMs` at most, and
18
- * once shown it stays shown: later loads draw in place. Data the page already holds is not waited for, so a page drawn
19
- * from the start cache shows at once.
24
+ * once shown it stays shown: later loads draw in place. Data the page already holds is not waited for, and a page the
25
+ * app starts with from the start cache is shown in its first frame, drawn from what the cache holds.
20
26
  */
21
27
  const RevealWhenLoaded = ({ children }) => {
22
28
  const client = useQueryClient();
29
+ const startedAt = useContext(ClientStartContext);
23
30
  const fetching = useIsFetching(firstLoad);
24
- const [shown, setShown] = useState(false);
31
+ const [shown, setShown] = useState(() => startsFromCache(client.getQueryCache().getAll(), startedAt));
25
32
  useEffect(() => {
26
33
  if (shown) return;
27
34
  const latest = setTimeout(() => setShown(true), revealWaitMs);
@@ -57,4 +64,4 @@ const PageSkeleton = () => /* @__PURE__ */ jsxs("div", {
57
64
  ]
58
65
  });
59
66
  //#endregion
60
- export { RevealWhenLoaded, revealWaitMs };
67
+ export { RevealWhenLoaded, revealWaitMs, startsFromCache };
@@ -1,7 +1,7 @@
1
1
  import { MessageValue } from "../../locale/messages.js";
2
2
  //#region src/app/runtime/messages.d.ts
3
3
  export declare const text: {
4
- (id: "close" | "failed" | "update" | "updating" | "immediate" | "weekly" | "scheduled" | "manual" | "job" | "build" | "updatingNow" | "started" | "nextOn" | "succeeded" | "unchanged" | "alreadyLatest" | "onlyAdmin" | "couldNotStart" | "runtimeUpdate" | "updateNow" | "currentVersion" | "latestVersion" | "checkFailed" | "updateAvailable", values?: Record<string, MessageValue>): string;
5
- rich(id: "close" | "failed" | "update" | "updating" | "immediate" | "weekly" | "scheduled" | "manual" | "job" | "build" | "updatingNow" | "started" | "nextOn" | "succeeded" | "unchanged" | "alreadyLatest" | "onlyAdmin" | "couldNotStart" | "runtimeUpdate" | "updateNow" | "currentVersion" | "latestVersion" | "checkFailed" | "updateAvailable", values: Record<string, MessageValue | import("react").ReactNode>): import("react").ReactNode;
4
+ (id: "close" | "failed" | "update" | "succeeded" | "immediate" | "weekly" | "scheduled" | "manual" | "job" | "build" | "updatingNow" | "started" | "nextOn" | "unchanged" | "alreadyLatest" | "onlyAdmin" | "couldNotStart" | "runtimeUpdate" | "updating" | "updateNow" | "currentVersion" | "latestVersion" | "checkFailed" | "updateAvailable", values?: Record<string, MessageValue>): string;
5
+ rich(id: "close" | "failed" | "update" | "succeeded" | "immediate" | "weekly" | "scheduled" | "manual" | "job" | "build" | "updatingNow" | "started" | "nextOn" | "unchanged" | "alreadyLatest" | "onlyAdmin" | "couldNotStart" | "runtimeUpdate" | "updating" | "updateNow" | "currentVersion" | "latestVersion" | "checkFailed" | "updateAvailable", values: Record<string, MessageValue | import("react").ReactNode>): import("react").ReactNode;
6
6
  };
7
7
  //#endregion
@@ -1,7 +1,7 @@
1
1
  import { MessageValue } from "../../locale/messages.js";
2
2
  //#region src/app/saved/messages.d.ts
3
3
  export declare const text: {
4
- (id: "couldNotSave" | "somethingWrong" | "couldNotLoadYour" | "noneYet" | "favorite" | "couldNotTakeOff", values?: Record<string, MessageValue>): string;
5
- rich(id: "couldNotSave" | "somethingWrong" | "couldNotLoadYour" | "noneYet" | "favorite" | "couldNotTakeOff", values: Record<string, MessageValue | import("react").ReactNode>): import("react").ReactNode;
4
+ (id: "couldNotSave" | "somethingWrong" | "noneYet" | "couldNotLoadYour" | "favorite" | "couldNotTakeOff", values?: Record<string, MessageValue>): string;
5
+ rich(id: "couldNotSave" | "somethingWrong" | "noneYet" | "couldNotLoadYour" | "favorite" | "couldNotTakeOff", values: Record<string, MessageValue | import("react").ReactNode>): import("react").ReactNode;
6
6
  };
7
7
  //#endregion
@@ -1,7 +1,7 @@
1
1
  import { MessageValue } from "../../locale/messages.js";
2
2
  //#region src/app/searches/messages.d.ts
3
3
  export declare const text: {
4
- (id: "saved" | "changed" | "removed" | "more" | "viewAll" | "save" | "cancel" | "couldNotSave" | "optional" | "update" | "notFound" | "filters" | "deleteTitle" | "off" | "on" | "noPlural" | "somethingWrong" | "noneMatch" | "firstOf" | "couldNotChange" | "couldNotLoadYour" | "noneYet" | "couldNotTakeOff" | "saveSearch" | "saveAsNew" | "updateName" | "updateNameQuestion" | "updateNounQuestion" | "couldNotRename" | "renameTitle" | "unreadableFilter" | "noResource" | "noSavedYet" | "asMany" | "fewer" | "added" | "filterChanges" | "addedRemoved" | "noRecordsDiff" | "searchSaved" | "openPlural" | "searchUpdated" | "couldNotUpdate" | "noNew", values?: Record<string, MessageValue>): string;
5
- rich(id: "saved" | "changed" | "removed" | "more" | "viewAll" | "save" | "cancel" | "couldNotSave" | "optional" | "update" | "notFound" | "filters" | "deleteTitle" | "off" | "on" | "noPlural" | "somethingWrong" | "noneMatch" | "firstOf" | "couldNotChange" | "couldNotLoadYour" | "noneYet" | "couldNotTakeOff" | "saveSearch" | "saveAsNew" | "updateName" | "updateNameQuestion" | "updateNounQuestion" | "couldNotRename" | "renameTitle" | "unreadableFilter" | "noResource" | "noSavedYet" | "asMany" | "fewer" | "added" | "filterChanges" | "addedRemoved" | "noRecordsDiff" | "searchSaved" | "openPlural" | "searchUpdated" | "couldNotUpdate" | "noNew", values: Record<string, MessageValue | import("react").ReactNode>): import("react").ReactNode;
4
+ (id: "saved" | "changed" | "removed" | "more" | "viewAll" | "save" | "cancel" | "couldNotSave" | "optional" | "update" | "filters" | "notFound" | "deleteTitle" | "off" | "on" | "noPlural" | "somethingWrong" | "noneMatch" | "firstOf" | "couldNotChange" | "noResource" | "unreadableFilter" | "noneYet" | "couldNotLoadYour" | "couldNotTakeOff" | "saveSearch" | "saveAsNew" | "updateName" | "updateNameQuestion" | "updateNounQuestion" | "couldNotRename" | "renameTitle" | "noSavedYet" | "asMany" | "fewer" | "added" | "filterChanges" | "addedRemoved" | "noRecordsDiff" | "searchSaved" | "openPlural" | "searchUpdated" | "couldNotUpdate" | "noNew", values?: Record<string, MessageValue>): string;
5
+ rich(id: "saved" | "changed" | "removed" | "more" | "viewAll" | "save" | "cancel" | "couldNotSave" | "optional" | "update" | "filters" | "notFound" | "deleteTitle" | "off" | "on" | "noPlural" | "somethingWrong" | "noneMatch" | "firstOf" | "couldNotChange" | "noResource" | "unreadableFilter" | "noneYet" | "couldNotLoadYour" | "couldNotTakeOff" | "saveSearch" | "saveAsNew" | "updateName" | "updateNameQuestion" | "updateNounQuestion" | "couldNotRename" | "renameTitle" | "noSavedYet" | "asMany" | "fewer" | "added" | "filterChanges" | "addedRemoved" | "noRecordsDiff" | "searchSaved" | "openPlural" | "searchUpdated" | "couldNotUpdate" | "noNew", values: Record<string, MessageValue | import("react").ReactNode>): import("react").ReactNode;
6
6
  };
7
7
  //#endregion
@@ -13,7 +13,6 @@ export type SplashHold = {
13
13
  * effects, so the splash stays up from the auth check through `/meta` to the plugins without a gap.
14
14
  */
15
15
  export declare const createSplashHold: (hide: () => void) => SplashHold;
16
- export declare const SplashHoldContext: import("react").Context<SplashHold | undefined>;
17
16
  export declare const SplashHoldProvider: ({ value, children }: {
18
17
  value: SplashHold;
19
18
  children: ReactNode;
@@ -44,4 +44,4 @@ const HoldSplash = () => {
44
44
  return null;
45
45
  };
46
46
  //#endregion
47
- export { HoldSplash, SplashHoldContext, SplashHoldProvider, createSplashHold };
47
+ export { HoldSplash, SplashHoldProvider, createSplashHold };
@@ -1,15 +1,6 @@
1
1
  //#region src/app/start-screen.d.ts
2
2
  /** The id of the start screen index.html draws over the app until it has drawn its first page. */
3
3
  export declare const startScreenId = "pb-start";
4
- /**
5
- * The empty element on the start screen a host may fill, as it serves index.html, with the markup of the page the app
6
- * showed last, for example the official app on a switch back to a workspace. It then shows in place of the spinner,
7
- * inert, until the app has drawn its first page with its first data, so the screen changes once. A plain string
8
- * replace of exactly this text fills it; with nothing in it the start is as before.
9
- */
10
- export declare const snapshotPlaceholder = "<div id=\"pb-snapshot\"></div>";
11
- /** Whether the start screen shows a host's snapshot (`snapshotPlaceholder` filled). */
12
- export declare const startsFromSnapshot: (document: Pick<Document, "getElementById">) => boolean;
13
4
  /** The event the app fires at the start screen as it takes it away, which ends index.html's watch for a failed start. */
14
5
  export declare const startScreenHandOff = "pb-start-hand-off";
15
6
  /**
@@ -1,15 +1,6 @@
1
1
  //#region src/app/start-screen.ts
2
2
  /** The id of the start screen index.html draws over the app until it has drawn its first page. */
3
3
  const startScreenId = "pb-start";
4
- /**
5
- * The empty element on the start screen a host may fill, as it serves index.html, with the markup of the page the app
6
- * showed last, for example the official app on a switch back to a workspace. It then shows in place of the spinner,
7
- * inert, until the app has drawn its first page with its first data, so the screen changes once. A plain string
8
- * replace of exactly this text fills it; with nothing in it the start is as before.
9
- */
10
- const snapshotPlaceholder = "<div id=\"pb-snapshot\"></div>";
11
- /** Whether the start screen shows a host's snapshot (`snapshotPlaceholder` filled). */
12
- const startsFromSnapshot = (document) => (document.getElementById("pb-snapshot")?.childNodes.length ?? 0) > 0;
13
4
  /** The event the app fires at the start screen as it takes it away, which ends index.html's watch for a failed start. */
14
5
  const startScreenHandOff = "pb-start-hand-off";
15
6
  /**
@@ -24,4 +15,4 @@ const removeStartScreen = (document) => {
24
15
  start.remove();
25
16
  };
26
17
  //#endregion
27
- export { removeStartScreen, snapshotPlaceholder, startScreenHandOff, startScreenId, startsFromSnapshot };
18
+ export { removeStartScreen, startScreenHandOff, startScreenId };
@@ -0,0 +1,11 @@
1
+ //#region src/app/ui-ready.d.ts
2
+ /**
3
+ * The event the app dispatches on `window` once it has drawn its first page, as it takes index.html's start screen
4
+ * away, and the browser has painted that frame: the next animation frame, then a task after it. With a warm start cache
5
+ * that is the first commit. A host that loads the app out of sight, such as Protobase's official app switching
6
+ * workspaces, shows it then, so the page appears whole instead of blank.
7
+ */
8
+ export declare const uiReadyEvent = "protobase:ui-ready";
9
+ /** Dispatches `uiReadyEvent` on `page` once the frame drawn now has been painted. */
10
+ export declare const tellUiReady: (page?: Pick<Window, "requestAnimationFrame" | "setTimeout" | "dispatchEvent">) => undefined;
11
+ //#endregion
@@ -0,0 +1,12 @@
1
+ //#region src/app/ui-ready.ts
2
+ /**
3
+ * The event the app dispatches on `window` once it has drawn its first page, as it takes index.html's start screen
4
+ * away, and the browser has painted that frame: the next animation frame, then a task after it. With a warm start cache
5
+ * that is the first commit. A host that loads the app out of sight, such as Protobase's official app switching
6
+ * workspaces, shows it then, so the page appears whole instead of blank.
7
+ */
8
+ const uiReadyEvent = "protobase:ui-ready";
9
+ /** Dispatches `uiReadyEvent` on `page` once the frame drawn now has been painted. */
10
+ const tellUiReady = (page = window) => void page.requestAnimationFrame(() => page.setTimeout(() => page.dispatchEvent(new Event(uiReadyEvent)), 0));
11
+ //#endregion
12
+ export { tellUiReady, uiReadyEvent };
@@ -1,13 +1,14 @@
1
1
  import { cn } from "../lib/cn.js";
2
2
  import { useIsDesktop } from "../lib/use-media-query.js";
3
3
  import { BottomBar } from "./bottom-bar.js";
4
+ import { useCloseSidebarEvent } from "./close-sidebar.js";
4
5
  import { Drawer } from "./drawer.js";
5
6
  import { PageScrollContext, usePageGutter, usePageInsets } from "./page-scroll.js";
6
7
  import { Sidebar } from "./sidebar.js";
7
8
  import { useSidebarNoticeShown } from "./sidebar-notice.js";
8
9
  import { TopBarSlotContext } from "./top-bar-slot.js";
9
10
  import { TopBar } from "./top-bar.js";
10
- import { useEffect, useRef, useState } from "react";
11
+ import { useCallback, useEffect, useRef, useState } from "react";
11
12
  import { jsx, jsxs } from "react/jsx-runtime";
12
13
  //#region src/app-shell/app-shell.tsx
13
14
  const drawerId = "app-drawer";
@@ -22,6 +23,7 @@ const AppShell = ({ sidebarMode, activeItem, breadcrumb, titleStatus, staleConte
22
23
  useEffect(() => {
23
24
  if (desktop) setDrawerOpen(false);
24
25
  }, [desktop]);
26
+ useCloseSidebarEvent(useCallback(() => setDrawerOpen(false), []));
25
27
  const tabs = !desktop && bottomBar && bottomBar.length > 0 ? bottomBar : void 0;
26
28
  const [chosen, setPageScroll] = useState();
27
29
  const pageScroll = chosen ?? scrollsByDefault;
@@ -0,0 +1,10 @@
1
+ //#region src/app-shell/close-sidebar.d.ts
2
+ /**
3
+ * The event a host or a plugin dispatches on `window` to close the shell's sidebar where it is a drawer over the page,
4
+ * on a phone: for example Protobase's official app, as it opens its own switcher on a tap on the logo
5
+ * (`logoTapEvent`). Where the sidebar sits beside the page it does nothing.
6
+ */
7
+ export declare const closeSidebarEvent = "protobase:close-sidebar";
8
+ /** Calls `close` on `closeSidebarEvent`. */
9
+ export declare const useCloseSidebarEvent: (close: () => void) => void;
10
+ //#endregion
@@ -0,0 +1,17 @@
1
+ import { useEffect } from "react";
2
+ //#region src/app-shell/close-sidebar.ts
3
+ /**
4
+ * The event a host or a plugin dispatches on `window` to close the shell's sidebar where it is a drawer over the page,
5
+ * on a phone: for example Protobase's official app, as it opens its own switcher on a tap on the logo
6
+ * (`logoTapEvent`). Where the sidebar sits beside the page it does nothing.
7
+ */
8
+ const closeSidebarEvent = "protobase:close-sidebar";
9
+ /** Calls `close` on `closeSidebarEvent`. */
10
+ const useCloseSidebarEvent = (close) => {
11
+ useEffect(() => {
12
+ window.addEventListener(closeSidebarEvent, close);
13
+ return () => window.removeEventListener(closeSidebarEvent, close);
14
+ }, [close]);
15
+ };
16
+ //#endregion
17
+ export { closeSidebarEvent, useCloseSidebarEvent };
@@ -6,6 +6,12 @@ export type DrawerProps = {
6
6
  onClose: () => void;
7
7
  children: ReactNode;
8
8
  };
9
- /** The sidebar on small screens: slides over the page, traps focus, closes on Escape, backdrop tap or navigation. */
9
+ /** How long the drawer takes to slide in and out, and its backdrop to fade. */
10
+ export declare const drawerSlideMs = 200;
11
+ /**
12
+ * The sidebar on small screens: slides over the page, traps focus, closes on Escape, backdrop tap or navigation. It
13
+ * slides in as it opens and out as it closes, however it is closed, such as a host's `protobase:close-sidebar`; with
14
+ * less motion asked for it shows and goes at once.
15
+ */
10
16
  export declare const Drawer: ({ id, open, onClose, children }: DrawerProps) => import("react").JSX.Element | null;
11
17
  //#endregion
@@ -1,17 +1,35 @@
1
+ import { cn } from "../lib/cn.js";
1
2
  import { useFocusTrap } from "../lib/use-focus-trap.js";
2
3
  import { text } from "./messages.js";
3
- import { useRef } from "react";
4
+ import { useEffect, useRef, useState } from "react";
4
5
  import { jsx, jsxs } from "react/jsx-runtime";
5
6
  //#region src/app-shell/drawer.tsx
6
- /** The sidebar on small screens: slides over the page, traps focus, closes on Escape, backdrop tap or navigation. */
7
+ /** How long the drawer takes to slide in and out, and its backdrop to fade. */
8
+ const drawerSlideMs = 200;
9
+ /**
10
+ * The sidebar on small screens: slides over the page, traps focus, closes on Escape, backdrop tap or navigation. It
11
+ * slides in as it opens and out as it closes, however it is closed, such as a host's `protobase:close-sidebar`; with
12
+ * less motion asked for it shows and goes at once.
13
+ */
7
14
  const Drawer = ({ id, open, onClose, children }) => {
8
15
  const panel = useRef(null);
9
16
  useFocusTrap(panel, open, onClose);
10
- if (!open) return null;
17
+ const [leaving, setLeaving] = useState(false);
18
+ const [wasOpen, setWasOpen] = useState(open);
19
+ if (open !== wasOpen) {
20
+ setWasOpen(open);
21
+ setLeaving(!open);
22
+ }
23
+ useEffect(() => {
24
+ if (!leaving) return;
25
+ const gone = setTimeout(() => setLeaving(false), 200);
26
+ return () => clearTimeout(gone);
27
+ }, [leaving]);
28
+ if (!open && !leaving) return null;
11
29
  return /* @__PURE__ */ jsxs("div", {
12
- className: "fixed inset-0 z-50 md:hidden",
30
+ className: cn("fixed inset-0 z-50 md:hidden", leaving && "pointer-events-none"),
13
31
  children: [/* @__PURE__ */ jsx("div", {
14
- className: "absolute inset-0 bg-backdrop/40",
32
+ className: cn("absolute inset-0 bg-backdrop/40 motion-reduce:[animation:none]", leaving ? "[animation:pb-fade-out_200ms_ease-in_forwards]" : "[animation:pb-fade-in_200ms_ease-out]"),
15
33
  onClick: onClose,
16
34
  "aria-hidden": true
17
35
  }), /* @__PURE__ */ jsx("div", {
@@ -20,12 +38,13 @@ const Drawer = ({ id, open, onClose, children }) => {
20
38
  role: "dialog",
21
39
  "aria-modal": "true",
22
40
  "aria-label": text("navigation"),
41
+ "aria-hidden": leaving || void 0,
23
42
  tabIndex: -1,
24
- className: "absolute inset-y-0 left-0 flex w-[calc(15rem+var(--pb-safe-left))] max-w-[85vw] bg-sidebar pl-[var(--pb-safe-left)] shadow-pop outline-none",
43
+ className: cn("absolute inset-y-0 left-0 flex w-[calc(15rem+var(--pb-safe-left))] max-w-[85vw] bg-sidebar pl-[var(--pb-safe-left)] shadow-pop outline-none motion-reduce:[animation:none]", leaving ? "[animation:pb-drawer-out_200ms_ease-in_forwards]" : "[animation:pb-drawer-in_200ms_ease-out]"),
25
44
  onClick: (event) => event.target.closest("a") && onClose(),
26
45
  children
27
46
  })]
28
47
  });
29
48
  };
30
49
  //#endregion
31
- export { Drawer };
50
+ export { Drawer, drawerSlideMs };
@@ -9,10 +9,11 @@ import { LogoMark } from "./logo-mark.js";
9
9
  import { Logo, ShellLogoProps } from "./logo.js";
10
10
  import { AppShell, AppShellProps } from "./app-shell.js";
11
11
  import { logoTapEvent } from "./logo-tap.js";
12
+ import { closeSidebarEvent } from "./close-sidebar.js";
12
13
  import { PageHeader } from "./page-header.js";
13
14
  import { usePageScroll } from "./page-scroll.js";
14
15
  import { useTopBarSlot } from "./top-bar-slot.js";
15
16
  import { topBarButton } from "./top-bar.js";
16
17
  import { Sidebar } from "./sidebar.js";
17
18
  import { StatusDot } from "./status-dot.js";
18
- export { AppShell, type AppShellProps, type BottomBarTab, type Crumb, GlobalSearch, type GlobalSearchModel, Logo, LogoMark, type NavGroup, type NavItem, type NavRecent, type NavRecord, PageHeader, type ProfileMenuItem, type ProfileOrganizations, type ProfileRoles, type ProfileStatus, type ProfileTheme, type RecordMark, type SearchResultGroup, type ShellLogoProps, type ShellUser, type ShownMark, Sidebar, type SidebarMode, StatusDot, logoTapEvent, moveActive, sidebarModes, topBarButton, usePageScroll, useTopBarSlot };
19
+ export { AppShell, type AppShellProps, type BottomBarTab, type Crumb, GlobalSearch, type GlobalSearchModel, Logo, LogoMark, type NavGroup, type NavItem, type NavRecent, type NavRecord, PageHeader, type ProfileMenuItem, type ProfileOrganizations, type ProfileRoles, type ProfileStatus, type ProfileTheme, type RecordMark, type SearchResultGroup, type ShellLogoProps, type ShellUser, type ShownMark, Sidebar, type SidebarMode, StatusDot, closeSidebarEvent, logoTapEvent, moveActive, sidebarModes, topBarButton, usePageScroll, useTopBarSlot };
@@ -1,4 +1,5 @@
1
1
  import { StatusDot } from "./status-dot.js";
2
+ import { closeSidebarEvent } from "./close-sidebar.js";
2
3
  import { usePageScroll } from "./page-scroll.js";
3
4
  import { LogoMark } from "./logo-mark.js";
4
5
  import { Logo } from "./logo.js";
@@ -10,4 +11,4 @@ import { GlobalSearch, moveActive } from "./global-search.js";
10
11
  import { topBarButton } from "./top-bar.js";
11
12
  import { AppShell } from "./app-shell.js";
12
13
  import { PageHeader } from "./page-header.js";
13
- export { AppShell, GlobalSearch, Logo, LogoMark, PageHeader, Sidebar, StatusDot, logoTapEvent, moveActive, sidebarModes, topBarButton, usePageScroll, useTopBarSlot };
14
+ export { AppShell, GlobalSearch, Logo, LogoMark, PageHeader, Sidebar, StatusDot, closeSidebarEvent, logoTapEvent, moveActive, sidebarModes, topBarButton, usePageScroll, useTopBarSlot };
@@ -1,7 +1,7 @@
1
1
  import { MessageValue } from "../locale/messages.js";
2
2
  //#region src/app-shell/messages.d.ts
3
3
  export declare const text: {
4
- (id: "signIn" | "resources" | "system" | "organizations" | "roles" | "breadcrumb" | "theme" | "search" | "tabs" | "navigation" | "more" | "openNavigation" | "backTo" | "closeSearch" | "clearSearch" | "globalSearch" | "searchResults" | "searching" | "noMatches" | "profileMenu" | "signOut" | "light" | "dark" | "recent" | "loading" | "couldNotLoad" | "viewAll" | "couldNotSearch", values?: Record<string, MessageValue>): string;
5
- rich(id: "signIn" | "resources" | "system" | "organizations" | "roles" | "breadcrumb" | "theme" | "search" | "tabs" | "navigation" | "more" | "openNavigation" | "backTo" | "closeSearch" | "clearSearch" | "globalSearch" | "searchResults" | "searching" | "noMatches" | "profileMenu" | "signOut" | "light" | "dark" | "recent" | "loading" | "couldNotLoad" | "viewAll" | "couldNotSearch", values: Record<string, MessageValue | import("react").ReactNode>): import("react").ReactNode;
4
+ (id: "signIn" | "resources" | "organizations" | "system" | "roles" | "breadcrumb" | "theme" | "search" | "tabs" | "navigation" | "more" | "openNavigation" | "backTo" | "closeSearch" | "clearSearch" | "globalSearch" | "searchResults" | "searching" | "noMatches" | "profileMenu" | "signOut" | "light" | "dark" | "recent" | "loading" | "couldNotLoad" | "viewAll" | "couldNotSearch", values?: Record<string, MessageValue>): string;
5
+ rich(id: "signIn" | "resources" | "organizations" | "system" | "roles" | "breadcrumb" | "theme" | "search" | "tabs" | "navigation" | "more" | "openNavigation" | "backTo" | "closeSearch" | "clearSearch" | "globalSearch" | "searchResults" | "searching" | "noMatches" | "profileMenu" | "signOut" | "light" | "dark" | "recent" | "loading" | "couldNotLoad" | "viewAll" | "couldNotSearch", values: Record<string, MessageValue | import("react").ReactNode>): import("react").ReactNode;
6
6
  };
7
7
  //#endregion