@shipfox/client-shell 10.0.1 → 12.0.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 (70) hide show
  1. package/dist/components/user-menu.d.ts.map +1 -1
  2. package/dist/components/user-menu.js +26 -0
  3. package/dist/components/user-menu.js.map +1 -1
  4. package/dist/compose/compose-client-features.d.ts +2 -1
  5. package/dist/compose/compose-client-features.d.ts.map +1 -1
  6. package/dist/compose/compose-client-features.js +5 -3
  7. package/dist/compose/compose-client-features.js.map +1 -1
  8. package/dist/compose/compose-routes.d.ts +6 -2
  9. package/dist/compose/compose-routes.d.ts.map +1 -1
  10. package/dist/compose/compose-routes.js +137 -2
  11. package/dist/compose/compose-routes.js.map +1 -1
  12. package/dist/compose/errors.d.ts +4 -0
  13. package/dist/compose/errors.d.ts.map +1 -1
  14. package/dist/compose/errors.js +6 -0
  15. package/dist/compose/errors.js.map +1 -1
  16. package/dist/compose/validate-registries.d.ts +9 -2
  17. package/dist/compose/validate-registries.d.ts.map +1 -1
  18. package/dist/compose/validate-registries.js +83 -2
  19. package/dist/compose/validate-registries.js.map +1 -1
  20. package/dist/contract.d.ts +23 -3
  21. package/dist/contract.d.ts.map +1 -1
  22. package/dist/contract.js.map +1 -1
  23. package/dist/core/session.d.ts +1 -0
  24. package/dist/core/session.d.ts.map +1 -1
  25. package/dist/core/session.js.map +1 -1
  26. package/dist/hooks/api/session-auth.d.ts.map +1 -1
  27. package/dist/hooks/api/session-auth.js +2 -1
  28. package/dist/hooks/api/session-auth.js.map +1 -1
  29. package/dist/runtime/anchor-paths.d.ts +2 -0
  30. package/dist/runtime/anchor-paths.d.ts.map +1 -1
  31. package/dist/runtime/anchor-paths.js +15 -0
  32. package/dist/runtime/anchor-paths.js.map +1 -1
  33. package/dist/runtime/anchors.d.ts.map +1 -1
  34. package/dist/runtime/anchors.js +6 -3
  35. package/dist/runtime/anchors.js.map +1 -1
  36. package/dist/runtime/assemble-route-tree.d.ts +3 -2
  37. package/dist/runtime/assemble-route-tree.d.ts.map +1 -1
  38. package/dist/runtime/assemble-route-tree.js +76 -5
  39. package/dist/runtime/assemble-route-tree.js.map +1 -1
  40. package/dist/runtime/chrome-context.d.ts +6 -0
  41. package/dist/runtime/chrome-context.d.ts.map +1 -1
  42. package/dist/runtime/chrome-context.js.map +1 -1
  43. package/dist/runtime/index.d.ts +1 -0
  44. package/dist/runtime/index.d.ts.map +1 -1
  45. package/dist/runtime/index.js +1 -0
  46. package/dist/runtime/index.js.map +1 -1
  47. package/dist/runtime/layout-navigation.d.ts +7 -0
  48. package/dist/runtime/layout-navigation.d.ts.map +1 -0
  49. package/dist/runtime/layout-navigation.js +18 -0
  50. package/dist/runtime/layout-navigation.js.map +1 -0
  51. package/dist/runtime/provider-stack.d.ts.map +1 -1
  52. package/dist/runtime/provider-stack.js +7 -3
  53. package/dist/runtime/provider-stack.js.map +1 -1
  54. package/dist/runtime/registries.d.ts +2 -1
  55. package/dist/runtime/registries.d.ts.map +1 -1
  56. package/dist/runtime/registries.js +10 -0
  57. package/dist/runtime/registries.js.map +1 -1
  58. package/dist/runtime/workspace-setup.d.ts +4 -0
  59. package/dist/runtime/workspace-setup.d.ts.map +1 -1
  60. package/dist/runtime/workspace-setup.js +23 -0
  61. package/dist/runtime/workspace-setup.js.map +1 -1
  62. package/dist/tsconfig.test.tsbuildinfo +1 -1
  63. package/dist/vite/generate.d.ts +3 -2
  64. package/dist/vite/generate.d.ts.map +1 -1
  65. package/dist/vite/generate.js +108 -20
  66. package/dist/vite/generate.js.map +1 -1
  67. package/dist/vite/plugin.d.ts.map +1 -1
  68. package/dist/vite/plugin.js +7 -3
  69. package/dist/vite/plugin.js.map +1 -1
  70. package/package.json +3 -3
@@ -4,6 +4,7 @@ import { TooltipProvider } from '@shipfox/react-ui/tooltip';
4
4
  import { QueryClientProvider } from '@tanstack/react-query';
5
5
  import { Provider as JotaiProvider } from 'jotai';
6
6
  import { AuthRuntime } from './auth.js';
7
+ import { LayoutNavigationProvider } from './layout-navigation.js';
7
8
  export function ShellProviderStack({ features, queryClient, store, auth, children }) {
8
9
  const featureProviders = features.flatMap((feature)=>feature.providers ?? []);
9
10
  const nestedProviders = featureProviders.reduceRight((content, provider)=>/*#__PURE__*/ _jsx(provider.Component, {
@@ -15,9 +16,12 @@ export function ShellProviderStack({ features, queryClient, store, auth, childre
15
16
  client: queryClient,
16
17
  children: /*#__PURE__*/ _jsx(JotaiProvider, {
17
18
  store: store,
18
- children: /*#__PURE__*/ _jsx(AuthRuntime, {
19
- ...auth,
20
- children: nestedProviders
19
+ children: /*#__PURE__*/ _jsx(LayoutNavigationProvider, {
20
+ features: features,
21
+ children: /*#__PURE__*/ _jsx(AuthRuntime, {
22
+ ...auth,
23
+ children: nestedProviders
24
+ })
21
25
  })
22
26
  })
23
27
  })
@@ -1 +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"}
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';\nimport {LayoutNavigationProvider} from './layout-navigation.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 <LayoutNavigationProvider features={features}>\n <AuthRuntime {...auth}>{nestedProviders}</AuthRuntime>\n </LayoutNavigationProvider>\n </JotaiProvider>\n </QueryClientProvider>\n </TooltipProvider>\n </ThemeProvider>\n );\n}\n"],"names":["ThemeProvider","TooltipProvider","QueryClientProvider","Provider","JotaiProvider","AuthRuntime","LayoutNavigationProvider","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;AAC7D,SAAQC,wBAAwB,QAAO,yBAAyB;AAIhE,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,KAACZ;kBACC,cAAA,KAACC;sBACC,cAAA,KAACC;gBAAoBqB,QAAQd;0BAC3B,cAAA,KAACL;oBAAcM,OAAOA;8BACpB,cAAA,KAACJ;wBAAyBE,UAAUA;kCAClC,cAAA,KAACH;4BAAa,GAAGM,IAAI;sCAAGM;;;;;;;AAOtC"}
@@ -1,4 +1,5 @@
1
- import type { ClientFeature, NavTabEntry, SettingsSectionEntry } from '#contract.js';
1
+ import type { ClientFeature, LayoutNavigationEntry, NavTabEntry, SettingsSectionEntry } from '#contract.js';
2
2
  export declare function navigationEntries(features: readonly ClientFeature[]): NavTabEntry[];
3
+ export declare function layoutNavigationRegistry(features: readonly ClientFeature[]): ReadonlyMap<string, readonly LayoutNavigationEntry[]>;
3
4
  export declare function settingsEntries(features: readonly ClientFeature[]): SettingsSectionEntry[];
4
5
  //# sourceMappingURL=registries.d.ts.map
@@ -1 +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"}
1
+ {"version":3,"file":"registries.d.ts","sourceRoot":"","sources":["../../src/runtime/registries.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,aAAa,EACb,qBAAqB,EACrB,WAAW,EACX,oBAAoB,EACrB,MAAM,cAAc,CAAC;AAgBtB,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,SAAS,aAAa,EAAE,GAAG,WAAW,EAAE,CAWnF;AAED,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,SAAS,aAAa,EAAE,GACjC,WAAW,CAAC,MAAM,EAAE,SAAS,qBAAqB,EAAE,CAAC,CASvD;AAED,wBAAgB,eAAe,CAAC,QAAQ,EAAE,SAAS,aAAa,EAAE,GAAG,oBAAoB,EAAE,CAW1F"}
@@ -12,6 +12,16 @@ export function navigationEntries(features) {
12
12
  to: normalizeRoutePath(entry.to)
13
13
  }));
14
14
  }
15
+ export function layoutNavigationRegistry(features) {
16
+ const registry = new Map();
17
+ for (const entry of navigationEntries(features)){
18
+ if (entry.scope !== 'layout') continue;
19
+ const entries = registry.get(entry.layout) ?? [];
20
+ entries.push(entry);
21
+ registry.set(entry.layout, entries);
22
+ }
23
+ return registry;
24
+ }
15
25
  export function settingsEntries(features) {
16
26
  return features.flatMap((feature, featureIndex)=>(feature.settingsSections ?? []).map((entry, declarationIndex)=>({
17
27
  entry,
@@ -1 +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"}
1
+ {"version":3,"sources":["../../src/runtime/registries.ts"],"sourcesContent":["import {normalizeRoutePath} from '#compose/normalize-route-path.js';\nimport type {\n ClientFeature,\n LayoutNavigationEntry,\n NavTabEntry,\n SettingsSectionEntry,\n} 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 layoutNavigationRegistry(\n features: readonly ClientFeature[],\n): ReadonlyMap<string, readonly LayoutNavigationEntry[]> {\n const registry = new Map<string, LayoutNavigationEntry[]>();\n for (const entry of navigationEntries(features)) {\n if (entry.scope !== 'layout') continue;\n const entries = registry.get(entry.layout) ?? [];\n entries.push(entry);\n registry.set(entry.layout, entries);\n }\n return registry;\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","layoutNavigationRegistry","registry","Map","scope","entries","get","layout","push","set","settingsEntries","settingsSections"],"mappings":"AAAA,SAAQA,kBAAkB,QAAO,mCAAmC;AAcpE,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,yBACdP,QAAkC;IAElC,MAAMQ,WAAW,IAAIC;IACrB,KAAK,MAAMd,SAASI,kBAAkBC,UAAW;QAC/C,IAAIL,MAAMe,KAAK,KAAK,UAAU;QAC9B,MAAMC,UAAUH,SAASI,GAAG,CAACjB,MAAMkB,MAAM,KAAK,EAAE;QAChDF,QAAQG,IAAI,CAACnB;QACba,SAASO,GAAG,CAACpB,MAAMkB,MAAM,EAAEF;IAC7B;IACA,OAAOH;AACT;AAEA,OAAO,SAASQ,gBAAgBhB,QAAkC;IAChE,OAAOA,SACJC,OAAO,CAAC,CAACC,SAASL,eACjB,AAACK,CAAAA,QAAQe,gBAAgB,IAAI,EAAE,AAAD,EAAGb,GAAG,CAAC,CAACT,OAAOG,mBAAsB,CAAA;gBACjEH;gBACAE;gBACAC;YACF,CAAA,IAEDO,IAAI,CAACb,SACLY,GAAG,CAAC,CAAC,EAACT,KAAK,EAAC,GAAKA;AACtB"}
@@ -2,6 +2,7 @@ import type { QueryClient } from '@tanstack/react-query';
2
2
  import { type ErrorComponentProps } from '@tanstack/react-router';
3
3
  export interface WorkspaceSetupState {
4
4
  hideProjectNavigation: boolean;
5
+ unavailable?: boolean;
5
6
  }
6
7
  export interface WorkspaceSetupRouteOptions {
7
8
  queryClient: QueryClient;
@@ -14,5 +15,8 @@ export declare class WorkspaceSetupLoadError extends Error {
14
15
  constructor(cause: unknown);
15
16
  }
16
17
  export declare function WorkspaceSetupPending(): import("react").JSX.Element;
18
+ export declare function WorkspaceUnavailablePage({ workspaceName }: {
19
+ workspaceName?: string | undefined;
20
+ }): import("react").JSX.Element;
17
21
  export declare function WorkspaceLayoutErrorRoute({ error, reset }: ErrorComponentProps): import("react").JSX.Element;
18
22
  //# sourceMappingURL=workspace-setup.d.ts.map
@@ -1 +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"}
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;IAC/B,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;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;AAED,wBAAgB,wBAAwB,CAAC,EAAC,aAAa,EAAC,EAAE;IAAC,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAAC,+BAc7F;AACD,wBAAgB,yBAAyB,CAAC,EAAC,KAAK,EAAE,KAAK,EAAC,EAAE,mBAAmB,+BA+B5E"}
@@ -14,6 +14,29 @@ export class WorkspaceSetupLoadError extends Error {
14
14
  export function WorkspaceSetupPending() {
15
15
  return /*#__PURE__*/ _jsx(FullPageLoader, {});
16
16
  }
17
+ export function WorkspaceUnavailablePage({ workspaceName }) {
18
+ return /*#__PURE__*/ _jsx("main", {
19
+ className: "min-h-screen bg-background-subtle-base px-24 py-32 max-[520px]:px-16",
20
+ children: /*#__PURE__*/ _jsxs("div", {
21
+ className: "mx-auto flex w-full max-w-[640px] flex-col gap-12",
22
+ children: [
23
+ /*#__PURE__*/ _jsx(Header, {
24
+ variant: "h1",
25
+ children: "Workspace unavailable"
26
+ }),
27
+ /*#__PURE__*/ _jsxs(Text, {
28
+ size: "md",
29
+ className: "text-foreground-neutral-muted",
30
+ children: [
31
+ workspaceName ? `${workspaceName} is currently unavailable.` : 'This workspace is currently unavailable.',
32
+ ' ',
33
+ "Please contact your configured support contact if you need help."
34
+ ]
35
+ })
36
+ ]
37
+ })
38
+ });
39
+ }
17
40
  export function WorkspaceLayoutErrorRoute({ error, reset }) {
18
41
  const router = useRouter();
19
42
  const retry = ()=>{
@@ -1 +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"}
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 unavailable?: 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}\n\nexport function WorkspaceUnavailablePage({workspaceName}: {workspaceName?: string | undefined}) {\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-12\">\n <Header variant=\"h1\">Workspace unavailable</Header>\n <Text size=\"md\" className=\"text-foreground-neutral-muted\">\n {workspaceName\n ? `${workspaceName} is currently unavailable.`\n : 'This workspace is currently unavailable.'}{' '}\n Please contact your configured support contact if you need help.\n </Text>\n </div>\n </main>\n );\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","WorkspaceUnavailablePage","workspaceName","main","className","div","variant","size","WorkspaceLayoutErrorRoute","error","reset","router","retry","invalidate","setupError","role","type","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;AAe3E,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;AAEA,OAAO,SAASU,yBAAyB,EAACC,aAAa,EAAuC;IAC5F,qBACE,KAACC;QAAKC,WAAU;kBACd,cAAA,MAACC;YAAID,WAAU;;8BACb,KAACZ;oBAAOc,SAAQ;8BAAK;;8BACrB,MAACb;oBAAKc,MAAK;oBAAKH,WAAU;;wBACvBF,gBACG,GAAGA,cAAc,0BAA0B,CAAC,GAC5C;wBAA4C;wBAAI;;;;;;AAM9D;AACA,OAAO,SAASM,0BAA0B,EAACC,KAAK,EAAEC,KAAK,EAAsB;IAC3E,MAAMC,SAASjB;IACf,MAAMkB,QAAQ;QACZF;QACA,KAAKC,OAAOE,UAAU;IACxB;IACA,MAAMC,aAAaL,iBAAiBd;IACpC,MAAMG,UACJW,iBAAiBrB,WACbqB,MAAMX,OAAO,GACbgB,cAAcL,MAAMZ,KAAK,YAAYT,WACnCqB,MAAMZ,KAAK,CAACC,OAAO,GACnB;IACR,qBACE,KAACK;QAAKC,WAAU;kBACd,cAAA,MAACC;YAAID,WAAU;;8BACb,KAACZ;oBAAOc,SAAQ;8BAAMQ,aAAa,oBAAoB;;8BACvD,KAACxB;oBAAQyB,MAAK;oBAAQC,MAAK;8BACzB,cAAA,MAACX;wBAAID,WAAU;;0CACb,KAACX;gCAAKc,MAAK;gCAAKU,IAAI;0CACjBH,aAAa,mCAAmC;;0CAEnD,KAACrB;gCAAKc,MAAK;0CAAMT;;0CACjB,KAACT;gCAAOkB,MAAK;gCAAKD,SAAQ;gCAAYY,SAASN;gCAAOR,WAAU;0CAAQ;;;;;;;;AAQpF"}