@shipfox/client-shell 0.2.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 (252) hide show
  1. package/.turbo/turbo-build.log +2 -0
  2. package/.turbo/turbo-type$colon$emit.log +1 -0
  3. package/.turbo/turbo-type.log +1 -0
  4. package/CHANGELOG.md +26 -0
  5. package/LICENSE +21 -0
  6. package/dist/components/main-layout.d.ts +11 -0
  7. package/dist/components/main-layout.d.ts.map +1 -0
  8. package/dist/components/main-layout.js +39 -0
  9. package/dist/components/main-layout.js.map +1 -0
  10. package/dist/components/nav-bar.d.ts +4 -0
  11. package/dist/components/nav-bar.d.ts.map +1 -0
  12. package/dist/components/nav-bar.js +62 -0
  13. package/dist/components/nav-bar.js.map +1 -0
  14. package/dist/components/nav-tabs.d.ts +6 -0
  15. package/dist/components/nav-tabs.d.ts.map +1 -0
  16. package/dist/components/nav-tabs.js +38 -0
  17. package/dist/components/nav-tabs.js.map +1 -0
  18. package/dist/components/not-found-page.d.ts +2 -0
  19. package/dist/components/not-found-page.d.ts.map +1 -0
  20. package/dist/components/not-found-page.js +25 -0
  21. package/dist/components/not-found-page.js.map +1 -0
  22. package/dist/components/settings-nav.d.ts +5 -0
  23. package/dist/components/settings-nav.d.ts.map +1 -0
  24. package/dist/components/settings-nav.js +45 -0
  25. package/dist/components/settings-nav.js.map +1 -0
  26. package/dist/components/user-menu.d.ts +2 -0
  27. package/dist/components/user-menu.d.ts.map +1 -0
  28. package/dist/components/user-menu.js +76 -0
  29. package/dist/components/user-menu.js.map +1 -0
  30. package/dist/components/workspace-crumb.d.ts +7 -0
  31. package/dist/components/workspace-crumb.d.ts.map +1 -0
  32. package/dist/components/workspace-crumb.js +54 -0
  33. package/dist/components/workspace-crumb.js.map +1 -0
  34. package/dist/components/workspace-switcher.d.ts +5 -0
  35. package/dist/components/workspace-switcher.d.ts.map +1 -0
  36. package/dist/components/workspace-switcher.js +90 -0
  37. package/dist/components/workspace-switcher.js.map +1 -0
  38. package/dist/compose/compose-routes.d.ts +6 -0
  39. package/dist/compose/compose-routes.d.ts.map +1 -0
  40. package/dist/compose/compose-routes.js +53 -0
  41. package/dist/compose/compose-routes.js.map +1 -0
  42. package/dist/compose/errors.d.ts +26 -0
  43. package/dist/compose/errors.d.ts.map +1 -0
  44. package/dist/compose/errors.js +39 -0
  45. package/dist/compose/errors.js.map +1 -0
  46. package/dist/compose/merge-config.d.ts +4 -0
  47. package/dist/compose/merge-config.d.ts.map +1 -0
  48. package/dist/compose/merge-config.js +28 -0
  49. package/dist/compose/merge-config.js.map +1 -0
  50. package/dist/compose/normalize-route-path.d.ts +2 -0
  51. package/dist/compose/normalize-route-path.d.ts.map +1 -0
  52. package/dist/compose/normalize-route-path.js +7 -0
  53. package/dist/compose/normalize-route-path.js.map +1 -0
  54. package/dist/compose/validate-providers.d.ts +3 -0
  55. package/dist/compose/validate-providers.d.ts.map +1 -0
  56. package/dist/compose/validate-providers.js +32 -0
  57. package/dist/compose/validate-providers.js.map +1 -0
  58. package/dist/compose/validate-registries.d.ts +4 -0
  59. package/dist/compose/validate-registries.d.ts.map +1 -0
  60. package/dist/compose/validate-registries.js +50 -0
  61. package/dist/compose/validate-registries.js.map +1 -0
  62. package/dist/config/shell-config.d.ts +10 -0
  63. package/dist/config/shell-config.d.ts.map +1 -0
  64. package/dist/config/shell-config.js +12 -0
  65. package/dist/config/shell-config.js.map +1 -0
  66. package/dist/contract.d.ts +39 -0
  67. package/dist/contract.d.ts.map +1 -0
  68. package/dist/contract.js +5 -0
  69. package/dist/contract.js.map +1 -0
  70. package/dist/index.d.ts +2 -0
  71. package/dist/index.d.ts.map +1 -0
  72. package/dist/index.js +3 -0
  73. package/dist/index.js.map +1 -0
  74. package/dist/runtime/active-workspace.d.ts +4 -0
  75. package/dist/runtime/active-workspace.d.ts.map +1 -0
  76. package/dist/runtime/active-workspace.js +15 -0
  77. package/dist/runtime/active-workspace.js.map +1 -0
  78. package/dist/runtime/anchor-paths.d.ts +9 -0
  79. package/dist/runtime/anchor-paths.d.ts.map +1 -0
  80. package/dist/runtime/anchor-paths.js +18 -0
  81. package/dist/runtime/anchor-paths.js.map +1 -0
  82. package/dist/runtime/anchors.d.ts +19 -0
  83. package/dist/runtime/anchors.d.ts.map +1 -0
  84. package/dist/runtime/anchors.js +125 -0
  85. package/dist/runtime/anchors.js.map +1 -0
  86. package/dist/runtime/assemble-route-tree.d.ts +10 -0
  87. package/dist/runtime/assemble-route-tree.d.ts.map +1 -0
  88. package/dist/runtime/assemble-route-tree.js +30 -0
  89. package/dist/runtime/assemble-route-tree.js.map +1 -0
  90. package/dist/runtime/auth.d.ts +50 -0
  91. package/dist/runtime/auth.d.ts.map +1 -0
  92. package/dist/runtime/auth.js +194 -0
  93. package/dist/runtime/auth.js.map +1 -0
  94. package/dist/runtime/chrome-context.d.ts +10 -0
  95. package/dist/runtime/chrome-context.d.ts.map +1 -0
  96. package/dist/runtime/chrome-context.js +16 -0
  97. package/dist/runtime/chrome-context.js.map +1 -0
  98. package/dist/runtime/compose-client-app.d.ts +13 -0
  99. package/dist/runtime/compose-client-app.d.ts.map +1 -0
  100. package/dist/runtime/compose-client-app.js +93 -0
  101. package/dist/runtime/compose-client-app.js.map +1 -0
  102. package/dist/runtime/define-route.d.ts +19 -0
  103. package/dist/runtime/define-route.d.ts.map +1 -0
  104. package/dist/runtime/define-route.js +12 -0
  105. package/dist/runtime/define-route.js.map +1 -0
  106. package/dist/runtime/index.d.ts +20 -0
  107. package/dist/runtime/index.d.ts.map +1 -0
  108. package/dist/runtime/index.js +21 -0
  109. package/dist/runtime/index.js.map +1 -0
  110. package/dist/runtime/last-workspace.d.ts +4 -0
  111. package/dist/runtime/last-workspace.d.ts.map +1 -0
  112. package/dist/runtime/last-workspace.js +20 -0
  113. package/dist/runtime/last-workspace.js.map +1 -0
  114. package/dist/runtime/nav-order.d.ts +7 -0
  115. package/dist/runtime/nav-order.d.ts.map +1 -0
  116. package/dist/runtime/nav-order.js +8 -0
  117. package/dist/runtime/nav-order.js.map +1 -0
  118. package/dist/runtime/provider-stack.d.ts +14 -0
  119. package/dist/runtime/provider-stack.d.ts.map +1 -0
  120. package/dist/runtime/provider-stack.js +28 -0
  121. package/dist/runtime/provider-stack.js.map +1 -0
  122. package/dist/runtime/registries.d.ts +4 -0
  123. package/dist/runtime/registries.d.ts.map +1 -0
  124. package/dist/runtime/registries.js +23 -0
  125. package/dist/runtime/registries.js.map +1 -0
  126. package/dist/runtime/router-context.d.ts +9 -0
  127. package/dist/runtime/router-context.d.ts.map +1 -0
  128. package/dist/runtime/router-context.js +3 -0
  129. package/dist/runtime/router-context.js.map +1 -0
  130. package/dist/runtime/workspace-setup.d.ts +18 -0
  131. package/dist/runtime/workspace-setup.d.ts.map +1 -0
  132. package/dist/runtime/workspace-setup.js +64 -0
  133. package/dist/runtime/workspace-setup.js.map +1 -0
  134. package/dist/testing/index.d.ts +17 -0
  135. package/dist/testing/index.d.ts.map +1 -0
  136. package/dist/testing/index.js +35 -0
  137. package/dist/testing/index.js.map +1 -0
  138. package/dist/tsconfig.test.tsbuildinfo +1 -0
  139. package/dist/vite/evaluate-features.d.ts +8 -0
  140. package/dist/vite/evaluate-features.d.ts.map +1 -0
  141. package/dist/vite/evaluate-features.js +80 -0
  142. package/dist/vite/evaluate-features.js.map +1 -0
  143. package/dist/vite/generate.d.ts +9 -0
  144. package/dist/vite/generate.d.ts.map +1 -0
  145. package/dist/vite/generate.js +80 -0
  146. package/dist/vite/generate.js.map +1 -0
  147. package/dist/vite/index.d.ts +2 -0
  148. package/dist/vite/index.d.ts.map +1 -0
  149. package/dist/vite/index.js +3 -0
  150. package/dist/vite/index.js.map +1 -0
  151. package/dist/vite/plugin.d.ts +7 -0
  152. package/dist/vite/plugin.d.ts.map +1 -0
  153. package/dist/vite/plugin.js +77 -0
  154. package/dist/vite/plugin.js.map +1 -0
  155. package/package.json +113 -0
  156. package/src/components/main-layout.tsx +45 -0
  157. package/src/components/nav-bar.tsx +41 -0
  158. package/src/components/nav-tabs.test.tsx +60 -0
  159. package/src/components/nav-tabs.tsx +47 -0
  160. package/src/components/not-found-page.tsx +14 -0
  161. package/src/components/settings-nav.tsx +35 -0
  162. package/src/components/user-menu.tsx +59 -0
  163. package/src/components/workspace-crumb.tsx +43 -0
  164. package/src/components/workspace-switcher.tsx +75 -0
  165. package/src/compose/compose-routes.test.ts +112 -0
  166. package/src/compose/compose-routes.ts +60 -0
  167. package/src/compose/errors.ts +54 -0
  168. package/src/compose/merge-config.test.ts +26 -0
  169. package/src/compose/merge-config.ts +27 -0
  170. package/src/compose/normalize-route-path.ts +6 -0
  171. package/src/compose/validate-providers.test.ts +31 -0
  172. package/src/compose/validate-providers.ts +36 -0
  173. package/src/compose/validate-registries.test.ts +92 -0
  174. package/src/compose/validate-registries.ts +61 -0
  175. package/src/config/config-screen.test.tsx +37 -0
  176. package/src/config/shell-config.ts +10 -0
  177. package/src/contract.ts +47 -0
  178. package/src/index.ts +1 -0
  179. package/src/runtime/active-workspace.ts +13 -0
  180. package/src/runtime/anchor-paths.ts +18 -0
  181. package/src/runtime/anchors.tsx +106 -0
  182. package/src/runtime/assemble-route-tree.ts +42 -0
  183. package/src/runtime/auth.tsx +213 -0
  184. package/src/runtime/chrome-context.tsx +22 -0
  185. package/src/runtime/compose-client-app.tsx +122 -0
  186. package/src/runtime/define-route.test.ts +15 -0
  187. package/src/runtime/define-route.ts +33 -0
  188. package/src/runtime/index.ts +19 -0
  189. package/src/runtime/last-workspace.ts +22 -0
  190. package/src/runtime/nav-order.ts +1 -0
  191. package/src/runtime/provider-stack.tsx +39 -0
  192. package/src/runtime/providers.test.tsx +51 -0
  193. package/src/runtime/registries.test.tsx +100 -0
  194. package/src/runtime/registries.ts +42 -0
  195. package/src/runtime/router-context.ts +9 -0
  196. package/src/runtime/routes.test.tsx +48 -0
  197. package/src/runtime/workspace-setup.tsx +61 -0
  198. package/src/testing/index.test.tsx +57 -0
  199. package/src/testing/index.tsx +51 -0
  200. package/src/vite/evaluate-features.test.ts +34 -0
  201. package/src/vite/evaluate-features.ts +93 -0
  202. package/src/vite/generate.test.ts +22 -0
  203. package/src/vite/generate.ts +99 -0
  204. package/src/vite/generated-router.test.tsx +58 -0
  205. package/src/vite/index.ts +1 -0
  206. package/src/vite/plugin.test.ts +181 -0
  207. package/src/vite/plugin.ts +114 -0
  208. package/src/vite/validate.test.ts +166 -0
  209. package/test/default-route-impl.tsx +3 -0
  210. package/test/external/FINDINGS.md +53 -0
  211. package/test/external/README.md +39 -0
  212. package/test/external/fixture/index.html +12 -0
  213. package/test/external/fixture/package.json +32 -0
  214. package/test/external/fixture/src/app.fixture.tsx +72 -0
  215. package/test/external/fixture/src/features/override-impl.tsx +12 -0
  216. package/test/external/fixture/src/features/override.tsx +20 -0
  217. package/test/external/fixture/src/features.collision.ts +15 -0
  218. package/test/external/fixture/src/features.ts +4 -0
  219. package/test/external/fixture/src/link-typecheck.tsx +10 -0
  220. package/test/external/fixture/src/main.tsx +4 -0
  221. package/test/external/fixture/tsconfig.json +15 -0
  222. package/test/external/fixture/vite.config.ts +10 -0
  223. package/test/external/fixture/vitest.config.ts +15 -0
  224. package/test/external/toy-feature/CHANGELOG.md +15 -0
  225. package/test/external/toy-feature/node_modules/.bin/shipfox-biome-check +43 -0
  226. package/test/external/toy-feature/node_modules/.bin/shipfox-biome-format +43 -0
  227. package/test/external/toy-feature/node_modules/.bin/shipfox-biome-lint +43 -0
  228. package/test/external/toy-feature/node_modules/.bin/shipfox-swc +43 -0
  229. package/test/external/toy-feature/node_modules/.bin/shipfox-tsc-check +43 -0
  230. package/test/external/toy-feature/node_modules/.bin/shipfox-tsc-emit +43 -0
  231. package/test/external/toy-feature/package.json +57 -0
  232. package/test/external/toy-feature/src/config.ts +5 -0
  233. package/test/external/toy-feature/src/index.ts +64 -0
  234. package/test/external/toy-feature/src/provider.tsx +33 -0
  235. package/test/external/toy-feature/src/routes/insights.tsx +7 -0
  236. package/test/external/toy-feature/src/routes/settings.tsx +7 -0
  237. package/test/external/toy-feature/tsconfig.build.json +5 -0
  238. package/test/external/toy-feature/tsconfig.json +1 -0
  239. package/test/external/verify.mjs +318 -0
  240. package/test/fixtures/features.ts +56 -0
  241. package/test/named-route-impl.tsx +3 -0
  242. package/test/not-route-impl.ts +1 -0
  243. package/test/render.tsx +67 -0
  244. package/test/search-route-impl.tsx +7 -0
  245. package/test/setup.ts +3 -0
  246. package/test/typecheck/shipfox-app.gen.ts +85 -0
  247. package/test/typecheck/types.tsx +18 -0
  248. package/tsconfig.build.json +10 -0
  249. package/tsconfig.build.tsbuildinfo +1 -0
  250. package/tsconfig.json +1 -0
  251. package/tsconfig.test.json +12 -0
  252. package/vitest.config.ts +22 -0
@@ -0,0 +1,93 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { configureApiClient } from '@shipfox/client-api';
3
+ import { ConfigErrorScreen, getWindowRuntimeConfig, loadConfig, setLoadedConfig } from '@shipfox/client-config';
4
+ import { ThemeProvider } from '@shipfox/react-ui/theme';
5
+ import { Toaster } from '@shipfox/react-ui/toast';
6
+ import { TooltipProvider } from '@shipfox/react-ui/tooltip';
7
+ import { QueryClient } from '@tanstack/react-query';
8
+ import { RouterProvider } from '@tanstack/react-router';
9
+ import { createStore } from 'jotai';
10
+ import { StrictMode, useEffect } from 'react';
11
+ import { createRoot } from 'react-dom/client';
12
+ import { composeRoutes } from '#compose/compose-routes.js';
13
+ import { mergeConfigShapes } from '#compose/merge-config.js';
14
+ import { validateProviderIds } from '#compose/validate-providers.js';
15
+ import { validateNavigation, validateSettingsSections } from '#compose/validate-registries.js';
16
+ import { useAuthState } from './auth.js';
17
+ import { ChromeProvider } from './chrome-context.js';
18
+ import { ShellProviderStack } from './provider-stack.js';
19
+ export function composeClientApp({ features, router, chrome, workspaceSetup }) {
20
+ const routes = composeRoutes(features);
21
+ validateProviderIds(features);
22
+ validateNavigation(features, routes.map((route)=>route.path));
23
+ validateSettingsSections(features, routes.map((route)=>route.path));
24
+ const config = loadConfig(mergeConfigShapes(features), {
25
+ runtime: getWindowRuntimeConfig(),
26
+ build: import.meta.env
27
+ });
28
+ if (config.ok) setLoadedConfig(config.config);
29
+ return {
30
+ mount (element) {
31
+ const root = createRoot(element);
32
+ if (!config.ok) {
33
+ root.render(/*#__PURE__*/ _jsx(StrictMode, {
34
+ children: /*#__PURE__*/ _jsx(ThemeProvider, {
35
+ children: /*#__PURE__*/ _jsx(TooltipProvider, {
36
+ children: /*#__PURE__*/ _jsx(ConfigErrorScreen, {
37
+ errors: config.errors
38
+ })
39
+ })
40
+ })
41
+ }));
42
+ return;
43
+ }
44
+ configureApiClient({
45
+ baseUrl: configApiUrl(config.config)
46
+ });
47
+ const queryClient = new QueryClient();
48
+ root.render(/*#__PURE__*/ _jsx(StrictMode, {
49
+ children: /*#__PURE__*/ _jsx(ChromeProvider, {
50
+ chrome: chrome,
51
+ children: /*#__PURE__*/ _jsxs(ShellProviderStack, {
52
+ features: features,
53
+ queryClient: queryClient,
54
+ store: createStore(),
55
+ children: [
56
+ /*#__PURE__*/ _jsx(RoutedApp, {
57
+ router: router,
58
+ queryClient: queryClient,
59
+ workspaceSetup: workspaceSetup
60
+ }),
61
+ /*#__PURE__*/ _jsx(Toaster, {})
62
+ ]
63
+ })
64
+ })
65
+ }));
66
+ }
67
+ };
68
+ }
69
+ function RoutedApp({ router, queryClient, workspaceSetup }) {
70
+ const auth = useAuthState();
71
+ useEffect(()=>{
72
+ if (!auth.isLoading) router.invalidate();
73
+ }, [
74
+ auth.isLoading,
75
+ router
76
+ ]);
77
+ return /*#__PURE__*/ _jsx(RouterProvider, {
78
+ router: router,
79
+ context: {
80
+ auth,
81
+ queryClient,
82
+ workspaceSetup
83
+ }
84
+ });
85
+ }
86
+ function configApiUrl(config) {
87
+ if (typeof config !== 'object' || config === null || !('apiUrl' in config) || typeof config.apiUrl !== 'string') {
88
+ throw new Error('Composed client configuration must include a string apiUrl.');
89
+ }
90
+ return config.apiUrl;
91
+ }
92
+
93
+ //# sourceMappingURL=compose-client-app.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/runtime/compose-client-app.tsx"],"sourcesContent":["import {configureApiClient} from '@shipfox/client-api';\nimport {\n ConfigErrorScreen,\n getWindowRuntimeConfig,\n loadConfig,\n setLoadedConfig,\n} from '@shipfox/client-config';\nimport {ThemeProvider} from '@shipfox/react-ui/theme';\nimport {Toaster} from '@shipfox/react-ui/toast';\nimport {TooltipProvider} from '@shipfox/react-ui/tooltip';\nimport {QueryClient} from '@tanstack/react-query';\nimport {type AnyRouter, RouterProvider} from '@tanstack/react-router';\nimport {createStore} from 'jotai';\nimport {StrictMode, useEffect} from 'react';\nimport {createRoot} from 'react-dom/client';\nimport {composeRoutes} from '#compose/compose-routes.js';\nimport {mergeConfigShapes} from '#compose/merge-config.js';\nimport {validateProviderIds} from '#compose/validate-providers.js';\nimport {validateNavigation, validateSettingsSections} from '#compose/validate-registries.js';\nimport type {ClientFeature} from '#contract.js';\nimport {useAuthState} from './auth.js';\nimport {ChromeProvider, type ChromeSlots} from './chrome-context.js';\nimport {ShellProviderStack} from './provider-stack.js';\nimport type {WorkspaceSetupGate} from './workspace-setup.js';\n\nexport function composeClientApp({\n features,\n router,\n chrome,\n workspaceSetup,\n}: {\n features: readonly ClientFeature[];\n router: AnyRouter;\n chrome?: ChromeSlots;\n workspaceSetup?: WorkspaceSetupGate;\n}) {\n const routes = composeRoutes(features);\n validateProviderIds(features);\n validateNavigation(\n features,\n routes.map((route) => route.path),\n );\n validateSettingsSections(\n features,\n routes.map((route) => route.path),\n );\n const config = loadConfig(mergeConfigShapes(features), {\n runtime: getWindowRuntimeConfig(),\n build: (import.meta as ImportMeta & {env?: Record<string, unknown>}).env,\n });\n if (config.ok) setLoadedConfig(config.config);\n\n return {\n mount(element: HTMLElement): void {\n const root = createRoot(element);\n if (!config.ok) {\n root.render(\n <StrictMode>\n <ThemeProvider>\n <TooltipProvider>\n <ConfigErrorScreen errors={config.errors} />\n </TooltipProvider>\n </ThemeProvider>\n </StrictMode>,\n );\n return;\n }\n\n configureApiClient({baseUrl: configApiUrl(config.config)});\n const queryClient = new QueryClient();\n root.render(\n <StrictMode>\n <ChromeProvider chrome={chrome}>\n <ShellProviderStack features={features} queryClient={queryClient} store={createStore()}>\n <RoutedApp\n router={router}\n queryClient={queryClient}\n workspaceSetup={workspaceSetup}\n />\n <Toaster />\n </ShellProviderStack>\n </ChromeProvider>\n </StrictMode>,\n );\n },\n };\n}\n\nfunction RoutedApp({\n router,\n queryClient,\n workspaceSetup,\n}: {\n router: AnyRouter;\n queryClient: QueryClient;\n workspaceSetup: WorkspaceSetupGate | undefined;\n}) {\n const auth = useAuthState();\n\n useEffect(() => {\n if (!auth.isLoading) router.invalidate();\n }, [auth.isLoading, router]);\n\n return (\n <RouterProvider\n router={router as never}\n context={{auth, queryClient, workspaceSetup} as never}\n />\n );\n}\n\nfunction configApiUrl(config: unknown): string {\n if (\n typeof config !== 'object' ||\n config === null ||\n !('apiUrl' in config) ||\n typeof config.apiUrl !== 'string'\n ) {\n throw new Error('Composed client configuration must include a string apiUrl.');\n }\n return config.apiUrl;\n}\n"],"names":["configureApiClient","ConfigErrorScreen","getWindowRuntimeConfig","loadConfig","setLoadedConfig","ThemeProvider","Toaster","TooltipProvider","QueryClient","RouterProvider","createStore","StrictMode","useEffect","createRoot","composeRoutes","mergeConfigShapes","validateProviderIds","validateNavigation","validateSettingsSections","useAuthState","ChromeProvider","ShellProviderStack","composeClientApp","features","router","chrome","workspaceSetup","routes","map","route","path","config","runtime","build","env","ok","mount","element","root","render","errors","baseUrl","configApiUrl","queryClient","store","RoutedApp","auth","isLoading","invalidate","context","apiUrl","Error"],"mappings":";AAAA,SAAQA,kBAAkB,QAAO,sBAAsB;AACvD,SACEC,iBAAiB,EACjBC,sBAAsB,EACtBC,UAAU,EACVC,eAAe,QACV,yBAAyB;AAChC,SAAQC,aAAa,QAAO,0BAA0B;AACtD,SAAQC,OAAO,QAAO,0BAA0B;AAChD,SAAQC,eAAe,QAAO,4BAA4B;AAC1D,SAAQC,WAAW,QAAO,wBAAwB;AAClD,SAAwBC,cAAc,QAAO,yBAAyB;AACtE,SAAQC,WAAW,QAAO,QAAQ;AAClC,SAAQC,UAAU,EAAEC,SAAS,QAAO,QAAQ;AAC5C,SAAQC,UAAU,QAAO,mBAAmB;AAC5C,SAAQC,aAAa,QAAO,6BAA6B;AACzD,SAAQC,iBAAiB,QAAO,2BAA2B;AAC3D,SAAQC,mBAAmB,QAAO,iCAAiC;AACnE,SAAQC,kBAAkB,EAAEC,wBAAwB,QAAO,kCAAkC;AAE7F,SAAQC,YAAY,QAAO,YAAY;AACvC,SAAQC,cAAc,QAAyB,sBAAsB;AACrE,SAAQC,kBAAkB,QAAO,sBAAsB;AAGvD,OAAO,SAASC,iBAAiB,EAC/BC,QAAQ,EACRC,MAAM,EACNC,MAAM,EACNC,cAAc,EAMf;IACC,MAAMC,SAASb,cAAcS;IAC7BP,oBAAoBO;IACpBN,mBACEM,UACAI,OAAOC,GAAG,CAAC,CAACC,QAAUA,MAAMC,IAAI;IAElCZ,yBACEK,UACAI,OAAOC,GAAG,CAAC,CAACC,QAAUA,MAAMC,IAAI;IAElC,MAAMC,SAAS5B,WAAWY,kBAAkBQ,WAAW;QACrDS,SAAS9B;QACT+B,OAAO,AAAC,YAA6DC,GAAG;IAC1E;IACA,IAAIH,OAAOI,EAAE,EAAE/B,gBAAgB2B,OAAOA,MAAM;IAE5C,OAAO;QACLK,OAAMC,OAAoB;YACxB,MAAMC,OAAOzB,WAAWwB;YACxB,IAAI,CAACN,OAAOI,EAAE,EAAE;gBACdG,KAAKC,MAAM,eACT,KAAC5B;8BACC,cAAA,KAACN;kCACC,cAAA,KAACE;sCACC,cAAA,KAACN;gCAAkBuC,QAAQT,OAAOS,MAAM;;;;;gBAKhD;YACF;YAEAxC,mBAAmB;gBAACyC,SAASC,aAAaX,OAAOA,MAAM;YAAC;YACxD,MAAMY,cAAc,IAAInC;YACxB8B,KAAKC,MAAM,eACT,KAAC5B;0BACC,cAAA,KAACS;oBAAeK,QAAQA;8BACtB,cAAA,MAACJ;wBAAmBE,UAAUA;wBAAUoB,aAAaA;wBAAaC,OAAOlC;;0CACvE,KAACmC;gCACCrB,QAAQA;gCACRmB,aAAaA;gCACbjB,gBAAgBA;;0CAElB,KAACpB;;;;;QAKX;IACF;AACF;AAEA,SAASuC,UAAU,EACjBrB,MAAM,EACNmB,WAAW,EACXjB,cAAc,EAKf;IACC,MAAMoB,OAAO3B;IAEbP,UAAU;QACR,IAAI,CAACkC,KAAKC,SAAS,EAAEvB,OAAOwB,UAAU;IACxC,GAAG;QAACF,KAAKC,SAAS;QAAEvB;KAAO;IAE3B,qBACE,KAACf;QACCe,QAAQA;QACRyB,SAAS;YAACH;YAAMH;YAAajB;QAAc;;AAGjD;AAEA,SAASgB,aAAaX,MAAe;IACnC,IACE,OAAOA,WAAW,YAClBA,WAAW,QACX,CAAE,CAAA,YAAYA,MAAK,KACnB,OAAOA,OAAOmB,MAAM,KAAK,UACzB;QACA,MAAM,IAAIC,MAAM;IAClB;IACA,OAAOpB,OAAOmB,MAAM;AACtB"}
@@ -0,0 +1,19 @@
1
+ import type { ComponentType } from 'react';
2
+ export interface RouteImplOptions {
3
+ component?: ComponentType;
4
+ loader?: unknown;
5
+ validateSearch?: unknown;
6
+ beforeLoad?: unknown;
7
+ staticData?: unknown;
8
+ pendingComponent?: ComponentType;
9
+ errorComponent?: ComponentType;
10
+ }
11
+ declare const routeImplBrand: unique symbol;
12
+ export interface RouteImpl<O extends RouteImplOptions = RouteImplOptions> {
13
+ readonly options: O;
14
+ readonly [routeImplBrand]: true;
15
+ }
16
+ export declare function defineRoute<const O extends RouteImplOptions>(options: O): RouteImpl<O>;
17
+ export declare function isRouteImpl(value: unknown): value is RouteImpl;
18
+ export {};
19
+ //# sourceMappingURL=define-route.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"define-route.d.ts","sourceRoot":"","sources":["../../src/runtime/define-route.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,OAAO,CAAC;AAEzC,MAAM,WAAW,gBAAgB;IAC/B,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,gBAAgB,CAAC,EAAE,aAAa,CAAC;IACjC,cAAc,CAAC,EAAE,aAAa,CAAC;CAChC;AAED,QAAA,MAAM,cAAc,eAAsB,CAAC;AAE3C,MAAM,WAAW,SAAS,CAAC,CAAC,SAAS,gBAAgB,GAAG,gBAAgB;IACtE,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC;IACpB,QAAQ,CAAC,CAAC,cAAc,CAAC,EAAE,IAAI,CAAC;CACjC;AAED,wBAAgB,WAAW,CAAC,KAAK,CAAC,CAAC,SAAS,gBAAgB,EAAE,OAAO,EAAE,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,CAEtF;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,SAAS,CAS9D"}
@@ -0,0 +1,12 @@
1
+ const routeImplBrand = Symbol('routeImpl');
2
+ export function defineRoute(options) {
3
+ return {
4
+ options,
5
+ [routeImplBrand]: true
6
+ };
7
+ }
8
+ export function isRouteImpl(value) {
9
+ return typeof value === 'object' && value !== null && routeImplBrand in value && 'options' in value && typeof value.options === 'object' && value.options !== null;
10
+ }
11
+
12
+ //# sourceMappingURL=define-route.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/runtime/define-route.ts"],"sourcesContent":["import type {ComponentType} from 'react';\n\nexport interface RouteImplOptions {\n component?: ComponentType;\n loader?: unknown;\n validateSearch?: unknown;\n beforeLoad?: unknown;\n staticData?: unknown;\n pendingComponent?: ComponentType;\n errorComponent?: ComponentType;\n}\n\nconst routeImplBrand = Symbol('routeImpl');\n\nexport interface RouteImpl<O extends RouteImplOptions = RouteImplOptions> {\n readonly options: O;\n readonly [routeImplBrand]: true;\n}\n\nexport function defineRoute<const O extends RouteImplOptions>(options: O): RouteImpl<O> {\n return {options, [routeImplBrand]: true};\n}\n\nexport function isRouteImpl(value: unknown): value is RouteImpl {\n return (\n typeof value === 'object' &&\n value !== null &&\n routeImplBrand in value &&\n 'options' in value &&\n typeof value.options === 'object' &&\n value.options !== null\n );\n}\n"],"names":["routeImplBrand","Symbol","defineRoute","options","isRouteImpl","value"],"mappings":"AAYA,MAAMA,iBAAiBC,OAAO;AAO9B,OAAO,SAASC,YAA8CC,OAAU;IACtE,OAAO;QAACA;QAAS,CAACH,eAAe,EAAE;IAAI;AACzC;AAEA,OAAO,SAASI,YAAYC,KAAc;IACxC,OACE,OAAOA,UAAU,YACjBA,UAAU,QACVL,kBAAkBK,SAClB,aAAaA,SACb,OAAOA,MAAMF,OAAO,KAAK,YACzBE,MAAMF,OAAO,KAAK;AAEtB"}
@@ -0,0 +1,20 @@
1
+ export { WorkspaceCrumb, type WorkspaceCrumbProps } from '#components/workspace-crumb.js';
2
+ export { WorkspaceSwitcher } from '#components/workspace-switcher.js';
3
+ export * from '../compose/compose-routes.js';
4
+ export * from '../compose/errors.js';
5
+ export * from '../compose/merge-config.js';
6
+ export * from '../compose/normalize-route-path.js';
7
+ export * from '../compose/validate-providers.js';
8
+ export * from '../compose/validate-registries.js';
9
+ export * from './active-workspace.js';
10
+ export * from './anchor-paths.js';
11
+ export * from './anchors.js';
12
+ export * from './auth.js';
13
+ export * from './chrome-context.js';
14
+ export * from './compose-client-app.js';
15
+ export * from './define-route.js';
16
+ export * from './last-workspace.js';
17
+ export * from './nav-order.js';
18
+ export * from './router-context.js';
19
+ export * from './workspace-setup.js';
20
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/runtime/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAE,KAAK,mBAAmB,EAAC,MAAM,gCAAgC,CAAC;AACxF,OAAO,EAAC,iBAAiB,EAAC,MAAM,mCAAmC,CAAC;AACpE,cAAc,8BAA8B,CAAC;AAC7C,cAAc,sBAAsB,CAAC;AACrC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oCAAoC,CAAC;AACnD,cAAc,kCAAkC,CAAC;AACjD,cAAc,mCAAmC,CAAC;AAClD,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC"}
@@ -0,0 +1,21 @@
1
+ export { WorkspaceCrumb } from '#components/workspace-crumb.js';
2
+ export { WorkspaceSwitcher } from '#components/workspace-switcher.js';
3
+ export * from '../compose/compose-routes.js';
4
+ export * from '../compose/errors.js';
5
+ export * from '../compose/merge-config.js';
6
+ export * from '../compose/normalize-route-path.js';
7
+ export * from '../compose/validate-providers.js';
8
+ export * from '../compose/validate-registries.js';
9
+ export * from './active-workspace.js';
10
+ export * from './anchor-paths.js';
11
+ export * from './anchors.js';
12
+ export * from './auth.js';
13
+ export * from './chrome-context.js';
14
+ export * from './compose-client-app.js';
15
+ export * from './define-route.js';
16
+ export * from './last-workspace.js';
17
+ export * from './nav-order.js';
18
+ export * from './router-context.js';
19
+ export * from './workspace-setup.js';
20
+
21
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/runtime/index.ts"],"sourcesContent":["export {WorkspaceCrumb, type WorkspaceCrumbProps} from '#components/workspace-crumb.js';\nexport {WorkspaceSwitcher} from '#components/workspace-switcher.js';\nexport * from '../compose/compose-routes.js';\nexport * from '../compose/errors.js';\nexport * from '../compose/merge-config.js';\nexport * from '../compose/normalize-route-path.js';\nexport * from '../compose/validate-providers.js';\nexport * from '../compose/validate-registries.js';\nexport * from './active-workspace.js';\nexport * from './anchor-paths.js';\nexport * from './anchors.js';\nexport * from './auth.js';\nexport * from './chrome-context.js';\nexport * from './compose-client-app.js';\nexport * from './define-route.js';\nexport * from './last-workspace.js';\nexport * from './nav-order.js';\nexport * from './router-context.js';\nexport * from './workspace-setup.js';\n"],"names":["WorkspaceCrumb","WorkspaceSwitcher"],"mappings":"AAAA,SAAQA,cAAc,QAAiC,iCAAiC;AACxF,SAAQC,iBAAiB,QAAO,oCAAoC;AACpE,cAAc,+BAA+B;AAC7C,cAAc,uBAAuB;AACrC,cAAc,6BAA6B;AAC3C,cAAc,qCAAqC;AACnD,cAAc,mCAAmC;AACjD,cAAc,oCAAoC;AAClD,cAAc,wBAAwB;AACtC,cAAc,oBAAoB;AAClC,cAAc,eAAe;AAC7B,cAAc,YAAY;AAC1B,cAAc,sBAAsB;AACpC,cAAc,0BAA0B;AACxC,cAAc,oBAAoB;AAClC,cAAc,sBAAsB;AACpC,cAAc,iBAAiB;AAC/B,cAAc,sBAAsB;AACpC,cAAc,uBAAuB"}
@@ -0,0 +1,4 @@
1
+ export declare const lastWorkspaceIdAtom: import("jotai").WritableAtom<string | undefined, [string | typeof import("jotai/utils").RESET | ((prev: string | undefined) => string | typeof import("jotai/utils").RESET | undefined) | undefined], void>;
2
+ export declare function getLastWorkspaceId(): string | undefined;
3
+ export declare function rememberLastWorkspaceId(workspaceId: string): void;
4
+ //# sourceMappingURL=last-workspace.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"last-workspace.d.ts","sourceRoot":"","sources":["../../src/runtime/last-workspace.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,mBAAmB,6MAA6D,CAAC;AAE9F,wBAAgB,kBAAkB,IAAI,MAAM,GAAG,SAAS,CAUvD;AAED,wBAAgB,uBAAuB,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAGjE"}
@@ -0,0 +1,20 @@
1
+ import { atomWithStorage } from 'jotai/utils';
2
+ const storageKey = 'shipfox.lastWorkspaceId';
3
+ export const lastWorkspaceIdAtom = atomWithStorage(storageKey, undefined);
4
+ export function getLastWorkspaceId() {
5
+ if (typeof window === 'undefined') return undefined;
6
+ try {
7
+ const raw = window.localStorage.getItem(storageKey);
8
+ if (!raw) return undefined;
9
+ const parsed = JSON.parse(raw);
10
+ return typeof parsed === 'string' ? parsed : undefined;
11
+ } catch {
12
+ return undefined;
13
+ }
14
+ }
15
+ export function rememberLastWorkspaceId(workspaceId) {
16
+ if (typeof window === 'undefined') return;
17
+ window.localStorage.setItem(storageKey, JSON.stringify(workspaceId));
18
+ }
19
+
20
+ //# sourceMappingURL=last-workspace.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/runtime/last-workspace.ts"],"sourcesContent":["import {atomWithStorage} from 'jotai/utils';\n\nconst storageKey = 'shipfox.lastWorkspaceId';\n\nexport const lastWorkspaceIdAtom = atomWithStorage<string | undefined>(storageKey, undefined);\n\nexport function getLastWorkspaceId(): string | undefined {\n if (typeof window === 'undefined') return undefined;\n try {\n const raw = window.localStorage.getItem(storageKey);\n if (!raw) return undefined;\n const parsed: unknown = JSON.parse(raw);\n return typeof parsed === 'string' ? parsed : undefined;\n } catch {\n return undefined;\n }\n}\n\nexport function rememberLastWorkspaceId(workspaceId: string): void {\n if (typeof window === 'undefined') return;\n window.localStorage.setItem(storageKey, JSON.stringify(workspaceId));\n}\n"],"names":["atomWithStorage","storageKey","lastWorkspaceIdAtom","undefined","getLastWorkspaceId","window","raw","localStorage","getItem","parsed","JSON","parse","rememberLastWorkspaceId","workspaceId","setItem","stringify"],"mappings":"AAAA,SAAQA,eAAe,QAAO,cAAc;AAE5C,MAAMC,aAAa;AAEnB,OAAO,MAAMC,sBAAsBF,gBAAoCC,YAAYE,WAAW;AAE9F,OAAO,SAASC;IACd,IAAI,OAAOC,WAAW,aAAa,OAAOF;IAC1C,IAAI;QACF,MAAMG,MAAMD,OAAOE,YAAY,CAACC,OAAO,CAACP;QACxC,IAAI,CAACK,KAAK,OAAOH;QACjB,MAAMM,SAAkBC,KAAKC,KAAK,CAACL;QACnC,OAAO,OAAOG,WAAW,WAAWA,SAASN;IAC/C,EAAE,OAAM;QACN,OAAOA;IACT;AACF;AAEA,OAAO,SAASS,wBAAwBC,WAAmB;IACzD,IAAI,OAAOR,WAAW,aAAa;IACnCA,OAAOE,YAAY,CAACO,OAAO,CAACb,YAAYS,KAAKK,SAAS,CAACF;AACzD"}
@@ -0,0 +1,7 @@
1
+ export declare const NAV_ORDER: {
2
+ readonly projects: 100;
3
+ readonly settings: 900;
4
+ readonly runs: 100;
5
+ readonly workflows: 200;
6
+ };
7
+ //# sourceMappingURL=nav-order.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nav-order.d.ts","sourceRoot":"","sources":["../../src/runtime/nav-order.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS;;;;;CAAqE,CAAC"}
@@ -0,0 +1,8 @@
1
+ export const NAV_ORDER = {
2
+ projects: 100,
3
+ settings: 900,
4
+ runs: 100,
5
+ workflows: 200
6
+ };
7
+
8
+ //# sourceMappingURL=nav-order.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/runtime/nav-order.ts"],"sourcesContent":["export const NAV_ORDER = {projects: 100, settings: 900, runs: 100, workflows: 200} as const;\n"],"names":["NAV_ORDER","projects","settings","runs","workflows"],"mappings":"AAAA,OAAO,MAAMA,YAAY;IAACC,UAAU;IAAKC,UAAU;IAAKC,MAAM;IAAKC,WAAW;AAAG,EAAW"}
@@ -0,0 +1,14 @@
1
+ import { type QueryClient } from '@tanstack/react-query';
2
+ import { type createStore } from 'jotai';
3
+ import type { PropsWithChildren } from 'react';
4
+ import type { ClientFeature } from '#contract.js';
5
+ import { type AuthRuntimeProps } from './auth.js';
6
+ type Store = ReturnType<typeof createStore>;
7
+ export declare function ShellProviderStack({ features, queryClient, store, auth, children, }: PropsWithChildren<{
8
+ features: readonly ClientFeature[];
9
+ queryClient: QueryClient;
10
+ store: Store;
11
+ auth?: Pick<AuthRuntimeProps, 'effects'>;
12
+ }>): import("react").JSX.Element;
13
+ export {};
14
+ //# sourceMappingURL=provider-stack.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provider-stack.d.ts","sourceRoot":"","sources":["../../src/runtime/provider-stack.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAC,KAAK,WAAW,EAAsB,MAAM,uBAAuB,CAAC;AAC5E,OAAO,EAAC,KAAK,WAAW,EAA4B,MAAM,OAAO,CAAC;AAClE,OAAO,KAAK,EAAC,iBAAiB,EAAY,MAAM,OAAO,CAAC;AACxD,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,cAAc,CAAC;AAChD,OAAO,EAAc,KAAK,gBAAgB,EAAC,MAAM,WAAW,CAAC;AAE7D,KAAK,KAAK,GAAG,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC;AAE5C,wBAAgB,kBAAkB,CAAC,EACjC,QAAQ,EACR,WAAW,EACX,KAAK,EACL,IAAI,EACJ,QAAQ,GACT,EAAE,iBAAiB,CAAC;IACnB,QAAQ,EAAE,SAAS,aAAa,EAAE,CAAC;IACnC,WAAW,EAAE,WAAW,CAAC;IACzB,KAAK,EAAE,KAAK,CAAC;IACb,IAAI,CAAC,EAAE,IAAI,CAAC,gBAAgB,EAAE,SAAS,CAAC,CAAC;CAC1C,CAAC,+BAiBD"}
@@ -0,0 +1,28 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { ThemeProvider } from '@shipfox/react-ui/theme';
3
+ import { TooltipProvider } from '@shipfox/react-ui/tooltip';
4
+ import { QueryClientProvider } from '@tanstack/react-query';
5
+ import { Provider as JotaiProvider } from 'jotai';
6
+ import { AuthRuntime } from './auth.js';
7
+ export function ShellProviderStack({ features, queryClient, store, auth, children }) {
8
+ const featureProviders = features.flatMap((feature)=>feature.providers ?? []);
9
+ const nestedProviders = featureProviders.reduceRight((content, provider)=>/*#__PURE__*/ _jsx(provider.Component, {
10
+ children: content
11
+ }, provider.id), children);
12
+ return /*#__PURE__*/ _jsx(ThemeProvider, {
13
+ children: /*#__PURE__*/ _jsx(TooltipProvider, {
14
+ children: /*#__PURE__*/ _jsx(QueryClientProvider, {
15
+ client: queryClient,
16
+ children: /*#__PURE__*/ _jsx(JotaiProvider, {
17
+ store: store,
18
+ children: /*#__PURE__*/ _jsx(AuthRuntime, {
19
+ ...auth,
20
+ children: nestedProviders
21
+ })
22
+ })
23
+ })
24
+ })
25
+ });
26
+ }
27
+
28
+ //# sourceMappingURL=provider-stack.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/runtime/provider-stack.tsx"],"sourcesContent":["import {ThemeProvider} from '@shipfox/react-ui/theme';\nimport {TooltipProvider} from '@shipfox/react-ui/tooltip';\nimport {type QueryClient, QueryClientProvider} from '@tanstack/react-query';\nimport {type createStore, Provider as JotaiProvider} from 'jotai';\nimport type {PropsWithChildren, ReactNode} from 'react';\nimport type {ClientFeature} from '#contract.js';\nimport {AuthRuntime, type AuthRuntimeProps} from './auth.js';\n\ntype Store = ReturnType<typeof createStore>;\n\nexport function ShellProviderStack({\n features,\n queryClient,\n store,\n auth,\n children,\n}: PropsWithChildren<{\n features: readonly ClientFeature[];\n queryClient: QueryClient;\n store: Store;\n auth?: Pick<AuthRuntimeProps, 'effects'>;\n}>) {\n const featureProviders = features.flatMap((feature) => feature.providers ?? []);\n const nestedProviders = featureProviders.reduceRight<ReactNode>(\n (content, provider) => <provider.Component key={provider.id}>{content}</provider.Component>,\n children,\n );\n return (\n <ThemeProvider>\n <TooltipProvider>\n <QueryClientProvider client={queryClient}>\n <JotaiProvider store={store}>\n <AuthRuntime {...auth}>{nestedProviders}</AuthRuntime>\n </JotaiProvider>\n </QueryClientProvider>\n </TooltipProvider>\n </ThemeProvider>\n );\n}\n"],"names":["ThemeProvider","TooltipProvider","QueryClientProvider","Provider","JotaiProvider","AuthRuntime","ShellProviderStack","features","queryClient","store","auth","children","featureProviders","flatMap","feature","providers","nestedProviders","reduceRight","content","provider","Component","id","client"],"mappings":";AAAA,SAAQA,aAAa,QAAO,0BAA0B;AACtD,SAAQC,eAAe,QAAO,4BAA4B;AAC1D,SAA0BC,mBAAmB,QAAO,wBAAwB;AAC5E,SAA0BC,YAAYC,aAAa,QAAO,QAAQ;AAGlE,SAAQC,WAAW,QAA8B,YAAY;AAI7D,OAAO,SAASC,mBAAmB,EACjCC,QAAQ,EACRC,WAAW,EACXC,KAAK,EACLC,IAAI,EACJC,QAAQ,EAMR;IACA,MAAMC,mBAAmBL,SAASM,OAAO,CAAC,CAACC,UAAYA,QAAQC,SAAS,IAAI,EAAE;IAC9E,MAAMC,kBAAkBJ,iBAAiBK,WAAW,CAClD,CAACC,SAASC,yBAAa,KAACA,SAASC,SAAS;sBAAoBF;WAAdC,SAASE,EAAE,GAC3DV;IAEF,qBACE,KAACX;kBACC,cAAA,KAACC;sBACC,cAAA,KAACC;gBAAoBoB,QAAQd;0BAC3B,cAAA,KAACJ;oBAAcK,OAAOA;8BACpB,cAAA,KAACJ;wBAAa,GAAGK,IAAI;kCAAGM;;;;;;AAMpC"}
@@ -0,0 +1,4 @@
1
+ import type { ClientFeature, NavTabEntry, SettingsSectionEntry } from '#contract.js';
2
+ export declare function navigationEntries(features: readonly ClientFeature[]): NavTabEntry[];
3
+ export declare function settingsEntries(features: readonly ClientFeature[]): SettingsSectionEntry[];
4
+ //# sourceMappingURL=registries.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registries.d.ts","sourceRoot":"","sources":["../../src/runtime/registries.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,aAAa,EAAE,WAAW,EAAE,oBAAoB,EAAC,MAAM,cAAc,CAAC;AAgBnF,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,SAAS,aAAa,EAAE,GAAG,WAAW,EAAE,CAWnF;AAED,wBAAgB,eAAe,CAAC,QAAQ,EAAE,SAAS,aAAa,EAAE,GAAG,oBAAoB,EAAE,CAW1F"}
@@ -0,0 +1,23 @@
1
+ import { normalizeRoutePath } from '#compose/normalize-route-path.js';
2
+ function byOrder(left, right) {
3
+ return (left.entry.order ?? 500) - (right.entry.order ?? 500) || left.featureIndex - right.featureIndex || left.declarationIndex - right.declarationIndex;
4
+ }
5
+ export function navigationEntries(features) {
6
+ return features.flatMap((feature, featureIndex)=>(feature.navigation ?? []).map((entry, declarationIndex)=>({
7
+ entry,
8
+ featureIndex,
9
+ declarationIndex
10
+ }))).sort(byOrder).map(({ entry })=>({
11
+ ...entry,
12
+ to: normalizeRoutePath(entry.to)
13
+ }));
14
+ }
15
+ export function settingsEntries(features) {
16
+ return features.flatMap((feature, featureIndex)=>(feature.settingsSections ?? []).map((entry, declarationIndex)=>({
17
+ entry,
18
+ featureIndex,
19
+ declarationIndex
20
+ }))).sort(byOrder).map(({ entry })=>entry);
21
+ }
22
+
23
+ //# sourceMappingURL=registries.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/runtime/registries.ts"],"sourcesContent":["import {normalizeRoutePath} from '#compose/normalize-route-path.js';\nimport type {ClientFeature, NavTabEntry, SettingsSectionEntry} from '#contract.js';\n\ninterface Ordered<T> {\n entry: T;\n featureIndex: number;\n declarationIndex: number;\n}\n\nfunction byOrder<T extends {order?: number}>(left: Ordered<T>, right: Ordered<T>): number {\n return (\n (left.entry.order ?? 500) - (right.entry.order ?? 500) ||\n left.featureIndex - right.featureIndex ||\n left.declarationIndex - right.declarationIndex\n );\n}\n\nexport function navigationEntries(features: readonly ClientFeature[]): NavTabEntry[] {\n return features\n .flatMap((feature, featureIndex) =>\n (feature.navigation ?? []).map((entry, declarationIndex) => ({\n entry,\n featureIndex,\n declarationIndex,\n })),\n )\n .sort(byOrder)\n .map(({entry}) => ({...entry, to: normalizeRoutePath(entry.to)}));\n}\n\nexport function settingsEntries(features: readonly ClientFeature[]): SettingsSectionEntry[] {\n return features\n .flatMap((feature, featureIndex) =>\n (feature.settingsSections ?? []).map((entry, declarationIndex) => ({\n entry,\n featureIndex,\n declarationIndex,\n })),\n )\n .sort(byOrder)\n .map(({entry}) => entry);\n}\n"],"names":["normalizeRoutePath","byOrder","left","right","entry","order","featureIndex","declarationIndex","navigationEntries","features","flatMap","feature","navigation","map","sort","to","settingsEntries","settingsSections"],"mappings":"AAAA,SAAQA,kBAAkB,QAAO,mCAAmC;AASpE,SAASC,QAAoCC,IAAgB,EAAEC,KAAiB;IAC9E,OACE,AAACD,CAAAA,KAAKE,KAAK,CAACC,KAAK,IAAI,GAAE,IAAMF,CAAAA,MAAMC,KAAK,CAACC,KAAK,IAAI,GAAE,KACpDH,KAAKI,YAAY,GAAGH,MAAMG,YAAY,IACtCJ,KAAKK,gBAAgB,GAAGJ,MAAMI,gBAAgB;AAElD;AAEA,OAAO,SAASC,kBAAkBC,QAAkC;IAClE,OAAOA,SACJC,OAAO,CAAC,CAACC,SAASL,eACjB,AAACK,CAAAA,QAAQC,UAAU,IAAI,EAAE,AAAD,EAAGC,GAAG,CAAC,CAACT,OAAOG,mBAAsB,CAAA;gBAC3DH;gBACAE;gBACAC;YACF,CAAA,IAEDO,IAAI,CAACb,SACLY,GAAG,CAAC,CAAC,EAACT,KAAK,EAAC,GAAM,CAAA;YAAC,GAAGA,KAAK;YAAEW,IAAIf,mBAAmBI,MAAMW,EAAE;QAAC,CAAA;AAClE;AAEA,OAAO,SAASC,gBAAgBP,QAAkC;IAChE,OAAOA,SACJC,OAAO,CAAC,CAACC,SAASL,eACjB,AAACK,CAAAA,QAAQM,gBAAgB,IAAI,EAAE,AAAD,EAAGJ,GAAG,CAAC,CAACT,OAAOG,mBAAsB,CAAA;gBACjEH;gBACAE;gBACAC;YACF,CAAA,IAEDO,IAAI,CAACb,SACLY,GAAG,CAAC,CAAC,EAACT,KAAK,EAAC,GAAKA;AACtB"}
@@ -0,0 +1,9 @@
1
+ import type { QueryClient } from '@tanstack/react-query';
2
+ import type { AuthStateValue } from './auth.js';
3
+ import type { WorkspaceSetupGate } from './workspace-setup.js';
4
+ export interface RouterContext {
5
+ auth: AuthStateValue | undefined;
6
+ queryClient: QueryClient | undefined;
7
+ workspaceSetup?: WorkspaceSetupGate;
8
+ }
9
+ //# sourceMappingURL=router-context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"router-context.d.ts","sourceRoot":"","sources":["../../src/runtime/router-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,uBAAuB,CAAC;AACvD,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,WAAW,CAAC;AAC9C,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;AAE7D,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,cAAc,GAAG,SAAS,CAAC;IACjC,WAAW,EAAE,WAAW,GAAG,SAAS,CAAC;IACrC,cAAc,CAAC,EAAE,kBAAkB,CAAC;CACrC"}
@@ -0,0 +1,3 @@
1
+ export { };
2
+
3
+ //# sourceMappingURL=router-context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/runtime/router-context.ts"],"sourcesContent":["import type {QueryClient} from '@tanstack/react-query';\nimport type {AuthStateValue} from './auth.js';\nimport type {WorkspaceSetupGate} from './workspace-setup.js';\n\nexport interface RouterContext {\n auth: AuthStateValue | undefined;\n queryClient: QueryClient | undefined;\n workspaceSetup?: WorkspaceSetupGate;\n}\n"],"names":[],"mappings":"AAIA,WAIC"}
@@ -0,0 +1,18 @@
1
+ import type { QueryClient } from '@tanstack/react-query';
2
+ import { type ErrorComponentProps } from '@tanstack/react-router';
3
+ export interface WorkspaceSetupState {
4
+ hideProjectNavigation: boolean;
5
+ }
6
+ export interface WorkspaceSetupRouteOptions {
7
+ queryClient: QueryClient;
8
+ workspaceId: string;
9
+ pathname: string;
10
+ }
11
+ export type WorkspaceSetupGate = (options: WorkspaceSetupRouteOptions) => Promise<WorkspaceSetupState>;
12
+ export declare class WorkspaceSetupLoadError extends Error {
13
+ readonly cause: unknown;
14
+ constructor(cause: unknown);
15
+ }
16
+ export declare function WorkspaceSetupPending(): import("react").JSX.Element;
17
+ export declare function WorkspaceLayoutErrorRoute({ error, reset }: ErrorComponentProps): import("react").JSX.Element;
18
+ //# sourceMappingURL=workspace-setup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workspace-setup.d.ts","sourceRoot":"","sources":["../../src/runtime/workspace-setup.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAC,KAAK,mBAAmB,EAAY,MAAM,wBAAwB,CAAC;AAE3E,MAAM,WAAW,mBAAmB;IAClC,qBAAqB,EAAE,OAAO,CAAC;CAChC;AACD,MAAM,WAAW,0BAA0B;IACzC,WAAW,EAAE,WAAW,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;CAClB;AACD,MAAM,MAAM,kBAAkB,GAAG,CAC/B,OAAO,EAAE,0BAA0B,KAChC,OAAO,CAAC,mBAAmB,CAAC,CAAC;AAElC,qBAAa,uBAAwB,SAAQ,KAAK;aACX,KAAK,EAAE,OAAO;gBAAd,KAAK,EAAE,OAAO;CAIpD;AACD,wBAAgB,qBAAqB,gCAEpC;AACD,wBAAgB,yBAAyB,CAAC,EAAC,KAAK,EAAE,KAAK,EAAC,EAAE,mBAAmB,+BA+B5E"}
@@ -0,0 +1,64 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { ApiError } from '@shipfox/client-api';
3
+ import { Button } from '@shipfox/react-ui/button';
4
+ import { Callout } from '@shipfox/react-ui/callout';
5
+ import { FullPageLoader } from '@shipfox/react-ui/loader';
6
+ import { Header, Text } from '@shipfox/react-ui/typography';
7
+ import { useRouter } from '@tanstack/react-router';
8
+ export class WorkspaceSetupLoadError extends Error {
9
+ constructor(cause){
10
+ super(cause instanceof Error ? cause.message : 'Workspace setup load failed'), this.cause = cause;
11
+ this.name = 'WorkspaceSetupLoadError';
12
+ }
13
+ }
14
+ export function WorkspaceSetupPending() {
15
+ return /*#__PURE__*/ _jsx(FullPageLoader, {});
16
+ }
17
+ export function WorkspaceLayoutErrorRoute({ error, reset }) {
18
+ const router = useRouter();
19
+ const retry = ()=>{
20
+ reset();
21
+ void router.invalidate();
22
+ };
23
+ const setupError = error instanceof WorkspaceSetupLoadError;
24
+ const message = error instanceof ApiError ? error.message : setupError && error.cause instanceof ApiError ? error.cause.message : 'Try again in a moment.';
25
+ return /*#__PURE__*/ _jsx("main", {
26
+ className: "min-h-screen bg-background-subtle-base px-24 py-32 max-[520px]:px-16",
27
+ children: /*#__PURE__*/ _jsxs("div", {
28
+ className: "mx-auto flex w-full max-w-[640px] flex-col gap-24",
29
+ children: [
30
+ /*#__PURE__*/ _jsx(Header, {
31
+ variant: "h1",
32
+ children: setupError ? 'Workspace setup' : 'Workspace'
33
+ }),
34
+ /*#__PURE__*/ _jsx(Callout, {
35
+ role: "alert",
36
+ type: "error",
37
+ children: /*#__PURE__*/ _jsxs("div", {
38
+ className: "flex flex-col gap-8",
39
+ children: [
40
+ /*#__PURE__*/ _jsx(Text, {
41
+ size: "sm",
42
+ bold: true,
43
+ children: setupError ? 'Could not load workspace setup' : 'Could not load workspace'
44
+ }),
45
+ /*#__PURE__*/ _jsx(Text, {
46
+ size: "sm",
47
+ children: message
48
+ }),
49
+ /*#__PURE__*/ _jsx(Button, {
50
+ size: "sm",
51
+ variant: "secondary",
52
+ onClick: retry,
53
+ className: "w-fit",
54
+ children: "Retry"
55
+ })
56
+ ]
57
+ })
58
+ })
59
+ ]
60
+ })
61
+ });
62
+ }
63
+
64
+ //# sourceMappingURL=workspace-setup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/runtime/workspace-setup.tsx"],"sourcesContent":["import {ApiError} from '@shipfox/client-api';\nimport {Button} from '@shipfox/react-ui/button';\nimport {Callout} from '@shipfox/react-ui/callout';\nimport {FullPageLoader} from '@shipfox/react-ui/loader';\nimport {Header, Text} from '@shipfox/react-ui/typography';\nimport type {QueryClient} from '@tanstack/react-query';\nimport {type ErrorComponentProps, useRouter} from '@tanstack/react-router';\n\nexport interface WorkspaceSetupState {\n hideProjectNavigation: boolean;\n}\nexport interface WorkspaceSetupRouteOptions {\n queryClient: QueryClient;\n workspaceId: string;\n pathname: string;\n}\nexport type WorkspaceSetupGate = (\n options: WorkspaceSetupRouteOptions,\n) => Promise<WorkspaceSetupState>;\n\nexport class WorkspaceSetupLoadError extends Error {\n constructor(public override readonly cause: unknown) {\n super(cause instanceof Error ? cause.message : 'Workspace setup load failed');\n this.name = 'WorkspaceSetupLoadError';\n }\n}\nexport function WorkspaceSetupPending() {\n return <FullPageLoader />;\n}\nexport function WorkspaceLayoutErrorRoute({error, reset}: ErrorComponentProps) {\n const router = useRouter();\n const retry = () => {\n reset();\n void router.invalidate();\n };\n const setupError = error instanceof WorkspaceSetupLoadError;\n const message =\n error instanceof ApiError\n ? error.message\n : setupError && error.cause instanceof ApiError\n ? error.cause.message\n : 'Try again in a moment.';\n return (\n <main className=\"min-h-screen bg-background-subtle-base px-24 py-32 max-[520px]:px-16\">\n <div className=\"mx-auto flex w-full max-w-[640px] flex-col gap-24\">\n <Header variant=\"h1\">{setupError ? 'Workspace setup' : 'Workspace'}</Header>\n <Callout role=\"alert\" type=\"error\">\n <div className=\"flex flex-col gap-8\">\n <Text size=\"sm\" bold>\n {setupError ? 'Could not load workspace setup' : 'Could not load workspace'}\n </Text>\n <Text size=\"sm\">{message}</Text>\n <Button size=\"sm\" variant=\"secondary\" onClick={retry} className=\"w-fit\">\n Retry\n </Button>\n </div>\n </Callout>\n </div>\n </main>\n );\n}\n"],"names":["ApiError","Button","Callout","FullPageLoader","Header","Text","useRouter","WorkspaceSetupLoadError","Error","cause","message","name","WorkspaceSetupPending","WorkspaceLayoutErrorRoute","error","reset","router","retry","invalidate","setupError","main","className","div","variant","role","type","size","bold","onClick"],"mappings":";AAAA,SAAQA,QAAQ,QAAO,sBAAsB;AAC7C,SAAQC,MAAM,QAAO,2BAA2B;AAChD,SAAQC,OAAO,QAAO,4BAA4B;AAClD,SAAQC,cAAc,QAAO,2BAA2B;AACxD,SAAQC,MAAM,EAAEC,IAAI,QAAO,+BAA+B;AAE1D,SAAkCC,SAAS,QAAO,yBAAyB;AAc3E,OAAO,MAAMC,gCAAgCC;IAC3C,YAAY,AAAyBC,KAAc,CAAE;QACnD,KAAK,CAACA,iBAAiBD,QAAQC,MAAMC,OAAO,GAAG,qCADZD,QAAAA;QAEnC,IAAI,CAACE,IAAI,GAAG;IACd;AACF;AACA,OAAO,SAASC;IACd,qBAAO,KAACT;AACV;AACA,OAAO,SAASU,0BAA0B,EAACC,KAAK,EAAEC,KAAK,EAAsB;IAC3E,MAAMC,SAASV;IACf,MAAMW,QAAQ;QACZF;QACA,KAAKC,OAAOE,UAAU;IACxB;IACA,MAAMC,aAAaL,iBAAiBP;IACpC,MAAMG,UACJI,iBAAiBd,WACbc,MAAMJ,OAAO,GACbS,cAAcL,MAAML,KAAK,YAAYT,WACnCc,MAAML,KAAK,CAACC,OAAO,GACnB;IACR,qBACE,KAACU;QAAKC,WAAU;kBACd,cAAA,MAACC;YAAID,WAAU;;8BACb,KAACjB;oBAAOmB,SAAQ;8BAAMJ,aAAa,oBAAoB;;8BACvD,KAACjB;oBAAQsB,MAAK;oBAAQC,MAAK;8BACzB,cAAA,MAACH;wBAAID,WAAU;;0CACb,KAAChB;gCAAKqB,MAAK;gCAAKC,IAAI;0CACjBR,aAAa,mCAAmC;;0CAEnD,KAACd;gCAAKqB,MAAK;0CAAMhB;;0CACjB,KAACT;gCAAOyB,MAAK;gCAAKH,SAAQ;gCAAYK,SAASX;gCAAOI,WAAU;0CAAQ;;;;;;;;AAQpF"}
@@ -0,0 +1,17 @@
1
+ import type { Decorator } from '@storybook/react';
2
+ import { type QueryClient as QueryClientInstance } from '@tanstack/react-query';
3
+ import { createStore } from 'jotai';
4
+ import { type PropsWithChildren } from 'react';
5
+ import type { ClientFeature } from '#contract.js';
6
+ type Store = ReturnType<typeof createStore>;
7
+ export interface ShellProvidersOptions {
8
+ features?: readonly ClientFeature[];
9
+ queryClient?: QueryClientInstance;
10
+ store?: Store;
11
+ config?: unknown;
12
+ }
13
+ export declare function ShellProviders({ features, queryClient: providedQueryClient, store: providedStore, config, children, }: PropsWithChildren<ShellProvidersOptions>): import("react").JSX.Element;
14
+ export declare function createShellDecorator(options?: ShellProvidersOptions): Decorator;
15
+ export declare const shellDecorator: Decorator;
16
+ export {};
17
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/testing/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAc,KAAK,WAAW,IAAI,mBAAmB,EAAC,MAAM,uBAAuB,CAAC;AAC3F,OAAO,EAAC,WAAW,EAAC,MAAM,OAAO,CAAC;AAClC,OAAO,EAAC,KAAK,iBAAiB,EAAW,MAAM,OAAO,CAAC;AACvD,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,cAAc,CAAC;AAGhD,KAAK,KAAK,GAAG,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC;AAE5C,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,EAAE,SAAS,aAAa,EAAE,CAAC;IACpC,WAAW,CAAC,EAAE,mBAAmB,CAAC;IAClC,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,wBAAgB,cAAc,CAAC,EAC7B,QAAa,EACb,WAAW,EAAE,mBAAmB,EAChC,KAAK,EAAE,aAAa,EACpB,MAAM,EACN,QAAQ,GACT,EAAE,iBAAiB,CAAC,qBAAqB,CAAC,+BAiB1C;AAED,wBAAgB,oBAAoB,CAAC,OAAO,GAAE,qBAA0B,GAAG,SAAS,CAMnF;AAED,eAAO,MAAM,cAAc,WAAyB,CAAC"}
@@ -0,0 +1,35 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { setLoadedConfig } from '@shipfox/client-config';
3
+ import { QueryClient } from '@tanstack/react-query';
4
+ import { createStore } from 'jotai';
5
+ import { useState } from 'react';
6
+ import { ShellProviderStack } from '../runtime/provider-stack.js';
7
+ export function ShellProviders({ features = [], queryClient: providedQueryClient, store: providedStore, config, children }) {
8
+ const [defaultQueryClient] = useState(()=>new QueryClient({
9
+ defaultOptions: {
10
+ queries: {
11
+ retry: false
12
+ }
13
+ }
14
+ }));
15
+ const [defaultStore] = useState(createStore);
16
+ if (config !== undefined) setLoadedConfig(config);
17
+ return /*#__PURE__*/ _jsx(ShellProviderStack, {
18
+ features: features,
19
+ queryClient: providedQueryClient ?? defaultQueryClient,
20
+ store: providedStore ?? defaultStore,
21
+ auth: {
22
+ effects: false
23
+ },
24
+ children: children
25
+ });
26
+ }
27
+ export function createShellDecorator(options = {}) {
28
+ return (Story)=>/*#__PURE__*/ _jsx(ShellProviders, {
29
+ ...options,
30
+ children: /*#__PURE__*/ _jsx(Story, {})
31
+ });
32
+ }
33
+ export const shellDecorator = createShellDecorator();
34
+
35
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/testing/index.tsx"],"sourcesContent":["import {setLoadedConfig} from '@shipfox/client-config';\nimport type {Decorator} from '@storybook/react';\nimport {QueryClient, type QueryClient as QueryClientInstance} from '@tanstack/react-query';\nimport {createStore} from 'jotai';\nimport {type PropsWithChildren, useState} from 'react';\nimport type {ClientFeature} from '#contract.js';\nimport {ShellProviderStack} from '../runtime/provider-stack.js';\n\ntype Store = ReturnType<typeof createStore>;\n\nexport interface ShellProvidersOptions {\n features?: readonly ClientFeature[];\n queryClient?: QueryClientInstance;\n store?: Store;\n config?: unknown;\n}\n\nexport function ShellProviders({\n features = [],\n queryClient: providedQueryClient,\n store: providedStore,\n config,\n children,\n}: PropsWithChildren<ShellProvidersOptions>) {\n const [defaultQueryClient] = useState(\n () => new QueryClient({defaultOptions: {queries: {retry: false}}}),\n );\n const [defaultStore] = useState(createStore);\n if (config !== undefined) setLoadedConfig(config);\n\n return (\n <ShellProviderStack\n features={features}\n queryClient={providedQueryClient ?? defaultQueryClient}\n store={providedStore ?? defaultStore}\n auth={{effects: false}}\n >\n {children}\n </ShellProviderStack>\n );\n}\n\nexport function createShellDecorator(options: ShellProvidersOptions = {}): Decorator {\n return (Story) => (\n <ShellProviders {...options}>\n <Story />\n </ShellProviders>\n );\n}\n\nexport const shellDecorator = createShellDecorator();\n"],"names":["setLoadedConfig","QueryClient","createStore","useState","ShellProviderStack","ShellProviders","features","queryClient","providedQueryClient","store","providedStore","config","children","defaultQueryClient","defaultOptions","queries","retry","defaultStore","undefined","auth","effects","createShellDecorator","options","Story","shellDecorator"],"mappings":";AAAA,SAAQA,eAAe,QAAO,yBAAyB;AAEvD,SAAQC,WAAW,QAAgD,wBAAwB;AAC3F,SAAQC,WAAW,QAAO,QAAQ;AAClC,SAAgCC,QAAQ,QAAO,QAAQ;AAEvD,SAAQC,kBAAkB,QAAO,+BAA+B;AAWhE,OAAO,SAASC,eAAe,EAC7BC,WAAW,EAAE,EACbC,aAAaC,mBAAmB,EAChCC,OAAOC,aAAa,EACpBC,MAAM,EACNC,QAAQ,EACiC;IACzC,MAAM,CAACC,mBAAmB,GAAGV,SAC3B,IAAM,IAAIF,YAAY;YAACa,gBAAgB;gBAACC,SAAS;oBAACC,OAAO;gBAAK;YAAC;QAAC;IAElE,MAAM,CAACC,aAAa,GAAGd,SAASD;IAChC,IAAIS,WAAWO,WAAWlB,gBAAgBW;IAE1C,qBACE,KAACP;QACCE,UAAUA;QACVC,aAAaC,uBAAuBK;QACpCJ,OAAOC,iBAAiBO;QACxBE,MAAM;YAACC,SAAS;QAAK;kBAEpBR;;AAGP;AAEA,OAAO,SAASS,qBAAqBC,UAAiC,CAAC,CAAC;IACtE,OAAO,CAACC,sBACN,KAAClB;YAAgB,GAAGiB,OAAO;sBACzB,cAAA,KAACC;;AAGP;AAEA,OAAO,MAAMC,iBAAiBH,uBAAuB"}