@shipfox/client-shell 5.0.0 → 6.0.2
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.
- package/dist/components/main-layout.d.ts.map +1 -1
- package/dist/components/main-layout.js +3 -4
- package/dist/components/main-layout.js.map +1 -1
- package/dist/components/nav-tabs.d.ts.map +1 -1
- package/dist/components/nav-tabs.js +3 -4
- package/dist/components/nav-tabs.js.map +1 -1
- package/dist/components/settings-nav.d.ts.map +1 -1
- package/dist/components/settings-nav.js +3 -4
- package/dist/components/settings-nav.js.map +1 -1
- package/dist/components/workspace-switcher.d.ts.map +1 -1
- package/dist/components/workspace-switcher.js +3 -2
- package/dist/components/workspace-switcher.js.map +1 -1
- package/dist/compose/compose-client-features.d.ts +11 -0
- package/dist/compose/compose-client-features.d.ts.map +1 -0
- package/dist/compose/compose-client-features.js +19 -0
- package/dist/compose/compose-client-features.js.map +1 -0
- package/dist/compose/compose-routes.d.ts +1 -0
- package/dist/compose/compose-routes.d.ts.map +1 -1
- package/dist/compose/compose-routes.js +4 -2
- package/dist/compose/compose-routes.js.map +1 -1
- package/dist/compose/validate-registries.d.ts +9 -2
- package/dist/compose/validate-registries.d.ts.map +1 -1
- package/dist/compose/validate-registries.js +32 -8
- package/dist/compose/validate-registries.js.map +1 -1
- package/dist/contract.d.ts +6 -0
- package/dist/contract.d.ts.map +1 -1
- package/dist/contract.js.map +1 -1
- package/dist/hooks/api/session-auth.d.ts +15 -0
- package/dist/hooks/api/session-auth.d.ts.map +1 -0
- package/dist/hooks/api/session-auth.js +55 -0
- package/dist/hooks/api/session-auth.js.map +1 -0
- package/dist/runtime/active-workspace.d.ts.map +1 -1
- package/dist/runtime/active-workspace.js +2 -4
- package/dist/runtime/active-workspace.js.map +1 -1
- package/dist/runtime/anchors.js +5 -5
- package/dist/runtime/anchors.js.map +1 -1
- package/dist/runtime/auth.d.ts +4 -11
- package/dist/runtime/auth.d.ts.map +1 -1
- package/dist/runtime/auth.js +73 -64
- package/dist/runtime/auth.js.map +1 -1
- package/dist/runtime/compose-client-app.d.ts.map +1 -1
- package/dist/runtime/compose-client-app.js +3 -9
- package/dist/runtime/compose-client-app.js.map +1 -1
- package/dist/runtime/index.d.ts +2 -0
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/index.js +2 -0
- package/dist/runtime/index.js.map +1 -1
- package/dist/runtime/last-workspace.d.ts +6 -3
- package/dist/runtime/last-workspace.d.ts.map +1 -1
- package/dist/runtime/last-workspace.js +12 -21
- package/dist/runtime/last-workspace.js.map +1 -1
- package/dist/runtime/route-inputs.d.ts +18 -0
- package/dist/runtime/route-inputs.d.ts.map +1 -0
- package/dist/runtime/route-inputs.js +49 -0
- package/dist/runtime/route-inputs.js.map +1 -0
- package/dist/tsconfig.test.tsbuildinfo +1 -1
- package/dist/vite/plugin.d.ts.map +1 -1
- package/dist/vite/plugin.js +6 -14
- package/dist/vite/plugin.js.map +1 -1
- package/package.json +10 -11
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { useParams, useSearch } from '@tanstack/react-router';
|
|
2
|
+
import { useMemo } from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* Reads inputs at the dynamic feature-route boundary. Feature routes must immediately
|
|
5
|
+
* validate the result and pass typed values to pages; Shell never interprets feature input.
|
|
6
|
+
*/ export function useRouteSearch(parse) {
|
|
7
|
+
const search = useSearch({
|
|
8
|
+
strict: false
|
|
9
|
+
});
|
|
10
|
+
return useMemo(()=>parse(search), [
|
|
11
|
+
parse,
|
|
12
|
+
search
|
|
13
|
+
]);
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Reads path parameters at the dynamic feature-route boundary without making Shell
|
|
17
|
+
* responsible for a feature's parameter contract.
|
|
18
|
+
*/ export function useRouteParams(parse) {
|
|
19
|
+
const params = useParams({
|
|
20
|
+
strict: false
|
|
21
|
+
});
|
|
22
|
+
return useMemo(()=>parse(params), [
|
|
23
|
+
parse,
|
|
24
|
+
params
|
|
25
|
+
]);
|
|
26
|
+
}
|
|
27
|
+
function optionalRouteString(value) {
|
|
28
|
+
return typeof value === 'string' && value.length > 0 ? value : undefined;
|
|
29
|
+
}
|
|
30
|
+
export function parseWorkspaceParams(input) {
|
|
31
|
+
const wid = optionalRouteString(input.wid);
|
|
32
|
+
return wid ? {
|
|
33
|
+
wid
|
|
34
|
+
} : {};
|
|
35
|
+
}
|
|
36
|
+
export function parseWorkspaceProjectParams(input) {
|
|
37
|
+
const wid = optionalRouteString(input.wid);
|
|
38
|
+
const pid = optionalRouteString(input.pid);
|
|
39
|
+
return {
|
|
40
|
+
...wid ? {
|
|
41
|
+
wid
|
|
42
|
+
} : {},
|
|
43
|
+
...pid ? {
|
|
44
|
+
pid
|
|
45
|
+
} : {}
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
//# sourceMappingURL=route-inputs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/runtime/route-inputs.ts"],"sourcesContent":["import {useParams, useSearch} from '@tanstack/react-router';\nimport {useMemo} from 'react';\n\n/**\n * Reads inputs at the dynamic feature-route boundary. Feature routes must immediately\n * validate the result and pass typed values to pages; Shell never interprets feature input.\n */\nexport function useRouteSearch<T>(parse: (search: Record<string, unknown>) => T): T {\n const search = useSearch({strict: false}) as Record<string, unknown>;\n return useMemo(() => parse(search), [parse, search]);\n}\n\n/**\n * Reads path parameters at the dynamic feature-route boundary without making Shell\n * responsible for a feature's parameter contract.\n */\nexport function useRouteParams<T>(parse: (params: Record<string, unknown>) => T): T {\n const params = useParams({strict: false}) as Record<string, unknown>;\n return useMemo(() => parse(params), [parse, params]);\n}\n\nfunction optionalRouteString(value: unknown): string | undefined {\n return typeof value === 'string' && value.length > 0 ? value : undefined;\n}\n\nexport function parseWorkspaceParams(input: Record<string, unknown>): {wid?: string} {\n const wid = optionalRouteString(input.wid);\n return wid ? {wid} : {};\n}\n\nexport function parseWorkspaceProjectParams(input: Record<string, unknown>): {\n wid?: string;\n pid?: string;\n} {\n const wid = optionalRouteString(input.wid);\n const pid = optionalRouteString(input.pid);\n return {\n ...(wid ? {wid} : {}),\n ...(pid ? {pid} : {}),\n };\n}\n"],"names":["useParams","useSearch","useMemo","useRouteSearch","parse","search","strict","useRouteParams","params","optionalRouteString","value","length","undefined","parseWorkspaceParams","input","wid","parseWorkspaceProjectParams","pid"],"mappings":"AAAA,SAAQA,SAAS,EAAEC,SAAS,QAAO,yBAAyB;AAC5D,SAAQC,OAAO,QAAO,QAAQ;AAE9B;;;CAGC,GACD,OAAO,SAASC,eAAkBC,KAA6C;IAC7E,MAAMC,SAASJ,UAAU;QAACK,QAAQ;IAAK;IACvC,OAAOJ,QAAQ,IAAME,MAAMC,SAAS;QAACD;QAAOC;KAAO;AACrD;AAEA;;;CAGC,GACD,OAAO,SAASE,eAAkBH,KAA6C;IAC7E,MAAMI,SAASR,UAAU;QAACM,QAAQ;IAAK;IACvC,OAAOJ,QAAQ,IAAME,MAAMI,SAAS;QAACJ;QAAOI;KAAO;AACrD;AAEA,SAASC,oBAAoBC,KAAc;IACzC,OAAO,OAAOA,UAAU,YAAYA,MAAMC,MAAM,GAAG,IAAID,QAAQE;AACjE;AAEA,OAAO,SAASC,qBAAqBC,KAA8B;IACjE,MAAMC,MAAMN,oBAAoBK,MAAMC,GAAG;IACzC,OAAOA,MAAM;QAACA;IAAG,IAAI,CAAC;AACxB;AAEA,OAAO,SAASC,4BAA4BF,KAA8B;IAIxE,MAAMC,MAAMN,oBAAoBK,MAAMC,GAAG;IACzC,MAAME,MAAMR,oBAAoBK,MAAMG,GAAG;IACzC,OAAO;QACL,GAAIF,MAAM;YAACA;QAAG,IAAI,CAAC,CAAC;QACpB,GAAIE,MAAM;YAACA;QAAG,IAAI,CAAC,CAAC;IACtB;AACF"}
|