@coffre/ui 0.1.10 → 0.1.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/_coffre/assets/account-CyJDFhek.js +2 -0
- package/dist/client/_coffre/assets/account-DHSs5h2f.js +1 -0
- package/dist/client/_coffre/assets/affordances-BQD5B421.js +1 -0
- package/dist/client/_coffre/assets/audit-Bcyp_dU1.js +2 -0
- package/dist/client/_coffre/assets/audit-rMy9mU9Q.js +1 -0
- package/dist/client/_coffre/assets/auth.device-DuvaComb.js +1 -0
- package/dist/client/_coffre/assets/auth.device-yBt_sLZW.js +2 -0
- package/dist/client/_coffre/assets/directory-C4BMGC7-.js +1 -0
- package/dist/client/_coffre/assets/dist-BNkBTkxj.js +1 -0
- package/dist/client/_coffre/assets/globals-BJkzu6T5.css +1 -0
- package/dist/client/_coffre/assets/grants-CyDW25eX.js +1 -0
- package/dist/client/_coffre/assets/icons-BRl8DlXW.js +1 -0
- package/dist/client/_coffre/assets/index-CA1mtrIx.js +12 -0
- package/dist/client/_coffre/assets/link-CqlAJWBd.js +1 -0
- package/dist/client/_coffre/assets/login-B73b6bsJ.js +1 -0
- package/dist/client/_coffre/assets/login-BO1KAGPU.js +2 -0
- package/dist/client/_coffre/assets/offboarding--5vSKNHv.js +1 -0
- package/dist/client/_coffre/assets/page-Dngv8FMr.js +1 -0
- package/dist/client/_coffre/assets/preload-helper-DBha3tys.js +1 -0
- package/dist/client/_coffre/assets/principal-page-C4qDD-d8.js +1 -0
- package/dist/client/_coffre/assets/projects._project._environment-eBKxOZ0_.js +2 -0
- package/dist/client/_coffre/assets/projects._project._environment-or_AX6o5.js +3 -0
- package/dist/client/_coffre/assets/projects._project.index-DHdXfEh-.js +2 -0
- package/dist/client/_coffre/assets/projects._project.index-iynQgenH.js +1 -0
- package/dist/client/_coffre/assets/projects.index-CGW8mRil.js +1 -0
- package/dist/client/_coffre/assets/row-state-BlarvG7E.js +1 -0
- package/dist/client/_coffre/assets/settings-D-7RJIDf.js +1 -0
- package/dist/client/_coffre/assets/suspense-q_eJaZ18.js +1 -0
- package/dist/client/_coffre/assets/tokens._token-0u7midqA.js +2 -0
- package/dist/client/_coffre/assets/tokens._token-C53NqScg.js +1 -0
- package/dist/client/_coffre/assets/tokens.index-DBZTLnbi.js +1 -0
- package/dist/client/_coffre/assets/ui-BPWFJNz7.js +46 -0
- package/dist/client/_coffre/assets/unregistered-CLhgtwUt.js +1 -0
- package/dist/client/_coffre/assets/use-action-LULgF26O.js +1 -0
- package/dist/client/_coffre/assets/use-change-Bd6NZJj9.js +1 -0
- package/dist/client/_coffre/assets/use-shell-Dx92Huhb.js +1 -0
- package/dist/client/_coffre/assets/useQuery-BIIZz1CB.js +1 -0
- package/dist/client/_coffre/assets/useSuspenseQuery-tP9HFZ8w.js +1 -0
- package/dist/client/_coffre/assets/users._user-BXtaL8Ee.js +2 -0
- package/dist/client/_coffre/assets/users._user-CNYVkXaY.js +1 -0
- package/dist/client/_coffre/assets/users.index-Cs9tibIv.js +1 -0
- package/dist/server/.vite/manifest.json +342 -246
- package/dist/server/_coffre/assets/_tanstack-start-manifest_v-T9tMsCwo.js +162 -0
- package/dist/server/_coffre/assets/{account-CUQYGCYh.js → account-BUhhOS5-.js} +150 -117
- package/dist/server/_coffre/assets/{account-DMlUoBxQ.js → account-B_h55GCs.js} +10 -24
- package/dist/server/_coffre/assets/{affordances-BNaXjMOb.js → affordances-CKANXDTG.js} +2 -22
- package/dist/server/_coffre/assets/{async-local-storage-C0cwgkEr.js → async-local-storage-C10uQtMM.js} +3 -2
- package/dist/server/_coffre/assets/{audit-CCdSLmvK.js → audit-B8Ck358-.js} +46 -16
- package/dist/server/_coffre/assets/audit-DFsXfeAQ.js +31 -0
- package/dist/server/_coffre/assets/{auth.device-BoFM1jcf.js → auth.device-BXf_JjT7.js} +5 -5
- package/dist/server/_coffre/assets/{auth.device-C05u5ROO.js → auth.device-cqjWACvB.js} +7 -5
- package/dist/server/_coffre/assets/{directory-GsnYkse0.js → directory-C9SfNgpM.js} +87 -112
- package/dist/server/_coffre/assets/{use-action-DwEmf58L.js → dist-CnnV3t2g.js} +3 -48
- package/dist/server/_coffre/assets/globals-BJkzu6T5.css +1 -0
- package/dist/server/_coffre/assets/grants--315KmXu.js +158 -0
- package/dist/server/_coffre/assets/{page-BdnhpwvH.js → icons-CWsTEfpn.js} +125 -436
- package/dist/server/_coffre/assets/lazyRouteComponent-CqBNCGuZ.js +480 -0
- package/dist/server/_coffre/assets/link-42ZWdjzZ.js +422 -0
- package/dist/server/_coffre/assets/{login-DUtCQju5.js → login-CQSkYW_D.js} +7 -5
- package/dist/server/_coffre/assets/{login-B2njIq_o.js → login-LBpXXfsQ.js} +2 -2
- package/dist/server/_coffre/assets/matchContext-qLfYbC6_.js +56 -0
- package/dist/server/_coffre/assets/{offboarding-8yMa7ViM.js → offboarding-CykelNis.js} +11 -79
- package/dist/server/_coffre/assets/page-BGeDoQO5.js +3531 -0
- package/dist/server/_coffre/assets/{principal-page-B8zPcS2b.js → principal-page-CRdoAQOq.js} +51 -42
- package/dist/server/_coffre/assets/{projects._project._environment-DdIOc7wx.js → projects._project._environment-BXU1Mee5.js} +4 -11
- package/dist/server/_coffre/assets/{projects._project._environment-BZ5Z80V8.js → projects._project._environment-BrDqn8kW.js} +129 -748
- package/dist/server/_coffre/assets/{projects._project.index-CuEAUwGn.js → projects._project.index-CAxBU4tY.js} +134 -96
- package/dist/server/_coffre/assets/{projects._project.index-DvbcU1kh.js → projects._project.index-CYyUVTCl.js} +5 -4
- package/dist/server/_coffre/assets/{projects.index-5HI0wOuG.js → projects.index-D6ZoDE_0.js} +57 -55
- package/dist/server/_coffre/assets/{react-dom-qCTiwGGR.js → react-dom-bBoJXlK2.js} +417 -51
- package/dist/server/_coffre/assets/{router-CQDoql8s.js → router-Bu2qtyqw.js} +376 -92
- package/dist/server/_coffre/assets/row-state-CAItu3n_.js +117 -0
- package/dist/server/_coffre/assets/{settings-BVz78wjP.js → settings-ByeF6hBa.js} +8 -6
- package/dist/server/_coffre/assets/suspense-beD01bb8.js +602 -0
- package/dist/server/_coffre/assets/tokens._token-CM01QPCq.js +10 -0
- package/dist/server/_coffre/assets/{tokens._token-CWs3Mtki.js → tokens._token-D2E4P3Qc.js} +97 -79
- package/dist/server/_coffre/assets/{tokens.index-Ck0LN7aC.js → tokens.index-Cmrgn3mU.js} +9 -6
- package/dist/server/_coffre/assets/{ui-D_slKpSF.js → ui-DvlGkmaH.js} +7 -836
- package/dist/server/_coffre/assets/{unregistered-Z17da4Rc.js → unregistered-DSArejP9.js} +5 -3
- package/dist/server/_coffre/assets/use-action-C2wz34kq.js +47 -0
- package/dist/server/_coffre/assets/use-change-CJpGSNIq.js +1212 -0
- package/dist/server/_coffre/assets/use-shell-C3iYcyP1.js +462 -0
- package/dist/server/_coffre/assets/useQuery-ChxaQ4Cb.js +8 -0
- package/dist/server/_coffre/assets/{useStore-DWGPqzXR.js → useRouter-CaUSUNsw.js} +1 -420
- package/dist/server/_coffre/assets/useSuspenseQuery-BjAmlGZl.js +117 -0
- package/dist/server/_coffre/assets/users._user-BVeR9fZP.js +10 -0
- package/dist/server/_coffre/assets/{users._user-CMwj-VI9.js → users._user-Cih2Etf4.js} +4 -5
- package/dist/server/_coffre/assets/{users.index-fWHv6A30.js → users.index-Bo2_a95G.js} +9 -6
- package/dist/server/index.js +6 -5
- package/package.json +5 -3
- package/src/components/directory.tsx +75 -104
- package/src/components/grants.tsx +60 -112
- package/src/components/icons.tsx +0 -34
- package/src/components/offboarding.tsx +1 -52
- package/src/components/principal-page.tsx +54 -67
- package/src/components/principal-picker.tsx +7 -16
- package/src/components/row-state.tsx +95 -0
- package/src/components/service-tokens.tsx +75 -64
- package/src/components/shell.tsx +1 -1
- package/src/lib/announce.ts +36 -0
- package/src/lib/changes.ts +498 -0
- package/src/lib/coffre.ts +1 -1
- package/src/lib/optimistic.ts +233 -0
- package/src/lib/queries.ts +385 -0
- package/src/lib/use-action.ts +20 -15
- package/src/lib/use-change.ts +42 -0
- package/src/lib/use-shell.ts +17 -0
- package/src/router.tsx +17 -9
- package/src/routes/__root.tsx +8 -38
- package/src/routes/account.tsx +163 -154
- package/src/routes/audit.tsx +51 -72
- package/src/routes/auth.device.tsx +4 -2
- package/src/routes/login.tsx +3 -2
- package/src/routes/projects.$project.$environment.tsx +223 -238
- package/src/routes/projects.$project.index.tsx +136 -118
- package/src/routes/projects.index.tsx +117 -145
- package/src/routes/settings.tsx +7 -7
- package/src/routes/tokens.$token.tsx +14 -17
- package/src/routes/tokens.index.tsx +8 -4
- package/src/routes/unregistered.tsx +3 -2
- package/src/routes/users.$user.tsx +4 -4
- package/src/routes/users.index.tsx +8 -4
- package/src/shared/models.ts +1 -5
- package/src/styles/globals.css +80 -50
- package/dist/client/_coffre/assets/account-B48wuSF8.js +0 -1
- package/dist/client/_coffre/assets/account-BkNyIDT7.js +0 -2
- package/dist/client/_coffre/assets/affordances-CmoY-8Xf.js +0 -1
- package/dist/client/_coffre/assets/audit-BvwKYb-5.js +0 -2
- package/dist/client/_coffre/assets/audit-D02H-zxS.js +0 -1
- package/dist/client/_coffre/assets/auth.device-BP5FY0K1.js +0 -1
- package/dist/client/_coffre/assets/auth.device-DYOONgFF.js +0 -2
- package/dist/client/_coffre/assets/coffre-BBp7cKVa.js +0 -1
- package/dist/client/_coffre/assets/directory-Bu0EIxqI.js +0 -1
- package/dist/client/_coffre/assets/globals-Bh2x1gBM.css +0 -1
- package/dist/client/_coffre/assets/grants-DavcwofW.js +0 -1
- package/dist/client/_coffre/assets/index-CDPlq5rM.js +0 -12
- package/dist/client/_coffre/assets/login-C-wTm_t1.js +0 -2
- package/dist/client/_coffre/assets/login-CLLv1om9.js +0 -1
- package/dist/client/_coffre/assets/offboarding-DWsE2FSa.js +0 -1
- package/dist/client/_coffre/assets/page-DbSS7pYH.js +0 -1
- package/dist/client/_coffre/assets/preload-helper-DduCCcmc.js +0 -46
- package/dist/client/_coffre/assets/principal-page-Bp_iwuSd.js +0 -1
- package/dist/client/_coffre/assets/projects._project._environment-BMeX_B8l.js +0 -2
- package/dist/client/_coffre/assets/projects._project._environment-CT0A-hIU.js +0 -3
- package/dist/client/_coffre/assets/projects._project.index-C_xYOGLT.js +0 -2
- package/dist/client/_coffre/assets/projects._project.index-Chcf-cUd.js +0 -1
- package/dist/client/_coffre/assets/projects.index-CfOtb1X5.js +0 -2
- package/dist/client/_coffre/assets/projects.index-DSjOhLDh.js +0 -1
- package/dist/client/_coffre/assets/settings-BC9cUJNK.js +0 -1
- package/dist/client/_coffre/assets/settings-Bkj_E21y.js +0 -2
- package/dist/client/_coffre/assets/tokens._token-BA0KqvaW.js +0 -1
- package/dist/client/_coffre/assets/tokens._token-Dh9jLOkm.js +0 -2
- package/dist/client/_coffre/assets/tokens.index-BgAMWkHT.js +0 -2
- package/dist/client/_coffre/assets/tokens.index-CHueIAv1.js +0 -1
- package/dist/client/_coffre/assets/unregistered-D5go1AfR.js +0 -1
- package/dist/client/_coffre/assets/use-action-l__xZDYY.js +0 -1
- package/dist/client/_coffre/assets/users._user-Dwqa0gv5.js +0 -1
- package/dist/client/_coffre/assets/users._user-xJAb3T6Y.js +0 -2
- package/dist/client/_coffre/assets/users.index-BJoF-L37.js +0 -2
- package/dist/client/_coffre/assets/users.index-YUjtbTGy.js +0 -1
- package/dist/server/_coffre/assets/_tanstack-start-manifest_v-BKg2AlPu.js +0 -133
- package/dist/server/_coffre/assets/audit-CThXn2v7.js +0 -74
- package/dist/server/_coffre/assets/coffre-C2ANsTAz.js +0 -281
- package/dist/server/_coffre/assets/globals-Bh2x1gBM.css +0 -1
- package/dist/server/_coffre/assets/grants-B6k4Fu9z.js +0 -243
- package/dist/server/_coffre/assets/projects.index-uiomWX_l.js +0 -54
- package/dist/server/_coffre/assets/settings-4oRyDizv.js +0 -18
- package/dist/server/_coffre/assets/tokens._token-CF_deAwq.js +0 -18
- package/dist/server/_coffre/assets/tokens.index-DF_07KEe.js +0 -10
- package/dist/server/_coffre/assets/users._user-DUzwkSKT.js +0 -10
- package/dist/server/_coffre/assets/users.index-BbuweTwH.js +0 -10
- package/src/components/syncs.tsx +0 -581
|
@@ -0,0 +1,480 @@
|
|
|
1
|
+
import { i as require_react, r as require_jsx_runtime, s as __toESM, t as useRouter } from "./useRouter-CaUSUNsw.js";
|
|
2
|
+
import { L as replaceEqualDeep, N as isModuleNotFoundError, R as reactUse, S as invariant, l as joinPaths, m as trimPathRight, n as useStore, p as trimPathLeft } from "./react-dom-bBoJXlK2.js";
|
|
3
|
+
import { a as redirect, n as matchContext, o as rootRouteId, t as dummyMatchContext } from "./matchContext-qLfYbC6_.js";
|
|
4
|
+
import { t as Link } from "./link-42ZWdjzZ.js";
|
|
5
|
+
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.15/node_modules/@tanstack/router-core/dist/esm/route.js
|
|
6
|
+
var BaseRoute = class {
|
|
7
|
+
get to() {
|
|
8
|
+
return this._to;
|
|
9
|
+
}
|
|
10
|
+
get id() {
|
|
11
|
+
return this._id;
|
|
12
|
+
}
|
|
13
|
+
get path() {
|
|
14
|
+
return this._path;
|
|
15
|
+
}
|
|
16
|
+
get fullPath() {
|
|
17
|
+
return this._fullPath;
|
|
18
|
+
}
|
|
19
|
+
constructor(options) {
|
|
20
|
+
this.init = (opts) => {
|
|
21
|
+
this.originalIndex = opts.originalIndex;
|
|
22
|
+
const options = this.options;
|
|
23
|
+
const isRoot = !options?.path && !options?.id;
|
|
24
|
+
this.parentRoute = this.options.getParentRoute?.();
|
|
25
|
+
if (isRoot) this._path = rootRouteId;
|
|
26
|
+
else if (!this.parentRoute) invariant();
|
|
27
|
+
let path = isRoot ? rootRouteId : options?.path;
|
|
28
|
+
if (path && path !== "/") path = trimPathLeft(path);
|
|
29
|
+
const customId = options?.id || path;
|
|
30
|
+
let id = isRoot ? rootRouteId : joinPaths([this.parentRoute.id === "__root__" ? "" : this.parentRoute.id, customId]);
|
|
31
|
+
if (path === "__root__") path = "/";
|
|
32
|
+
if (id !== "__root__") id = joinPaths(["/", id]);
|
|
33
|
+
const fullPath = id === "__root__" ? "/" : joinPaths([this.parentRoute.fullPath, path]);
|
|
34
|
+
this._path = path;
|
|
35
|
+
this._id = id;
|
|
36
|
+
this._fullPath = fullPath;
|
|
37
|
+
this._to = trimPathRight(fullPath);
|
|
38
|
+
};
|
|
39
|
+
this.addChildren = (children) => {
|
|
40
|
+
return this._addFileChildren(children);
|
|
41
|
+
};
|
|
42
|
+
this._addFileChildren = (children) => {
|
|
43
|
+
if (Array.isArray(children)) this.children = children;
|
|
44
|
+
if (typeof children === "object" && children !== null) this.children = Object.values(children);
|
|
45
|
+
return this;
|
|
46
|
+
};
|
|
47
|
+
this._addFileTypes = () => {
|
|
48
|
+
return this;
|
|
49
|
+
};
|
|
50
|
+
this.updateLoader = (options) => {
|
|
51
|
+
Object.assign(this.options, options);
|
|
52
|
+
return this;
|
|
53
|
+
};
|
|
54
|
+
this.update = (options) => {
|
|
55
|
+
Object.assign(this.options, options);
|
|
56
|
+
return this;
|
|
57
|
+
};
|
|
58
|
+
this.lazy = (lazyFn) => {
|
|
59
|
+
this.lazyFn = lazyFn;
|
|
60
|
+
return this;
|
|
61
|
+
};
|
|
62
|
+
this.redirect = (opts) => redirect({
|
|
63
|
+
from: this.fullPath,
|
|
64
|
+
...opts
|
|
65
|
+
});
|
|
66
|
+
this.options = options || {};
|
|
67
|
+
this.isRoot = !options?.getParentRoute;
|
|
68
|
+
if (options?.id && options?.path) throw new Error(`Route cannot have both an 'id' and a 'path' option.`);
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
var BaseRootRoute = class extends BaseRoute {
|
|
72
|
+
constructor(options) {
|
|
73
|
+
super(options);
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
//#endregion
|
|
77
|
+
//#region ../../node_modules/.pnpm/@tanstack+react-router@1.170.18_react-dom@19.2.7_react@19.2.7__react@19.2.7/node_modules/@tanstack/react-router/dist/esm/useMatch.js
|
|
78
|
+
var import_react = /* @__PURE__ */ __toESM(require_react(), 1);
|
|
79
|
+
var dummyStore = {
|
|
80
|
+
get() {},
|
|
81
|
+
subscribe() {
|
|
82
|
+
return { unsubscribe() {} };
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
function useStructuralSharing(opts, router) {
|
|
86
|
+
const previousResult = import_react.useRef();
|
|
87
|
+
return (slice) => {
|
|
88
|
+
const selected = opts?.select ? opts.select(slice) : slice;
|
|
89
|
+
if (opts?.structuralSharing ?? router.options.defaultStructuralSharing) return previousResult.current = replaceEqualDeep(previousResult.current, selected);
|
|
90
|
+
return selected;
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Read and select the nearest or targeted route match.
|
|
95
|
+
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/useMatchHook
|
|
96
|
+
*/
|
|
97
|
+
function useMatch(opts) {
|
|
98
|
+
const router = useRouter();
|
|
99
|
+
const nearestMatchId = import_react.useContext(opts.from ? dummyMatchContext : matchContext);
|
|
100
|
+
const matchStore = opts.from ? router.stores.getRouteMatchStore(opts.from) : router.stores.matchStores.get(nearestMatchId);
|
|
101
|
+
{
|
|
102
|
+
const match = matchStore?.get();
|
|
103
|
+
if (!match) {
|
|
104
|
+
if (opts.shouldThrow ?? true) invariant();
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
return opts.select ? opts.select(match) : match;
|
|
108
|
+
}
|
|
109
|
+
const selector = useStructuralSharing(opts, router);
|
|
110
|
+
const matchSelection = useStore(matchStore ?? dummyStore, (match) => match ? selector(match) : dummyStore);
|
|
111
|
+
if (matchSelection !== dummyStore) return matchSelection;
|
|
112
|
+
if (opts.shouldThrow ?? true) invariant();
|
|
113
|
+
}
|
|
114
|
+
//#endregion
|
|
115
|
+
//#region ../../node_modules/.pnpm/@tanstack+react-router@1.170.18_react-dom@19.2.7_react@19.2.7__react@19.2.7/node_modules/@tanstack/react-router/dist/esm/useLoaderData.js
|
|
116
|
+
/**
|
|
117
|
+
* Read and select the current route's loader data with type‑safety.
|
|
118
|
+
*
|
|
119
|
+
* Options:
|
|
120
|
+
* - `from`/`strict`: Choose which route's data to read and strictness
|
|
121
|
+
* - `select`: Map the loader data to a derived value
|
|
122
|
+
* - `structuralSharing`: Enable structural sharing for stable references
|
|
123
|
+
*
|
|
124
|
+
* @returns The loader data (or selected value) for the matched route.
|
|
125
|
+
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/useLoaderDataHook
|
|
126
|
+
*/
|
|
127
|
+
function useLoaderData(opts) {
|
|
128
|
+
return useMatch({
|
|
129
|
+
from: opts.from,
|
|
130
|
+
strict: opts.strict,
|
|
131
|
+
structuralSharing: opts.structuralSharing,
|
|
132
|
+
select: (match) => {
|
|
133
|
+
return opts.select ? opts.select(match.loaderData) : match.loaderData;
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
//#endregion
|
|
138
|
+
//#region ../../node_modules/.pnpm/@tanstack+react-router@1.170.18_react-dom@19.2.7_react@19.2.7__react@19.2.7/node_modules/@tanstack/react-router/dist/esm/useLoaderDeps.js
|
|
139
|
+
/**
|
|
140
|
+
* Read and select the current route's loader dependencies object.
|
|
141
|
+
*
|
|
142
|
+
* Options:
|
|
143
|
+
* - `from`: Choose which route's loader deps to read
|
|
144
|
+
* - `select`: Map the deps to a derived value
|
|
145
|
+
* - `structuralSharing`: Enable structural sharing for stable references
|
|
146
|
+
*
|
|
147
|
+
* @returns The loader deps (or selected value) for the matched route.
|
|
148
|
+
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/useLoaderDepsHook
|
|
149
|
+
*/
|
|
150
|
+
function useLoaderDeps(opts) {
|
|
151
|
+
const { select, ...rest } = opts;
|
|
152
|
+
return useMatch({
|
|
153
|
+
...rest,
|
|
154
|
+
select: (match) => {
|
|
155
|
+
return select ? select(match.loaderDeps) : match.loaderDeps;
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
//#endregion
|
|
160
|
+
//#region ../../node_modules/.pnpm/@tanstack+react-router@1.170.18_react-dom@19.2.7_react@19.2.7__react@19.2.7/node_modules/@tanstack/react-router/dist/esm/useParams.js
|
|
161
|
+
/**
|
|
162
|
+
* Access the current route's path parameters with type-safety.
|
|
163
|
+
*
|
|
164
|
+
* Options:
|
|
165
|
+
* - `from`/`strict`: Specify the matched route and whether to enforce strict typing
|
|
166
|
+
* - `select`: Project the params object to a derived value for memoized renders
|
|
167
|
+
* - `structuralSharing`: Enable structural sharing for stable references
|
|
168
|
+
* - `shouldThrow`: Throw if the route is not found in strict contexts
|
|
169
|
+
*
|
|
170
|
+
* @returns The params object (or selected value) for the matched route.
|
|
171
|
+
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/useParamsHook
|
|
172
|
+
*/
|
|
173
|
+
function useParams(opts) {
|
|
174
|
+
return useMatch({
|
|
175
|
+
from: opts.from,
|
|
176
|
+
shouldThrow: opts.shouldThrow,
|
|
177
|
+
structuralSharing: opts.structuralSharing,
|
|
178
|
+
strict: opts.strict,
|
|
179
|
+
select: (match) => {
|
|
180
|
+
const params = opts.strict === false ? match.params : match._strictParams;
|
|
181
|
+
return opts.select ? opts.select(params) : params;
|
|
182
|
+
}
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
//#endregion
|
|
186
|
+
//#region ../../node_modules/.pnpm/@tanstack+react-router@1.170.18_react-dom@19.2.7_react@19.2.7__react@19.2.7/node_modules/@tanstack/react-router/dist/esm/useSearch.js
|
|
187
|
+
/**
|
|
188
|
+
* Read and select the current route's search parameters with type-safety.
|
|
189
|
+
*
|
|
190
|
+
* Options:
|
|
191
|
+
* - `from`/`strict`: Control which route's search is read and how strictly it's typed
|
|
192
|
+
* - `select`: Map the search object to a derived value for render optimization
|
|
193
|
+
* - `structuralSharing`: Enable structural sharing for stable references
|
|
194
|
+
* - `shouldThrow`: Throw when the route is not found (strict contexts)
|
|
195
|
+
*
|
|
196
|
+
* @returns The search object (or selected value) for the matched route.
|
|
197
|
+
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/useSearchHook
|
|
198
|
+
*/
|
|
199
|
+
function useSearch(opts) {
|
|
200
|
+
return useMatch({
|
|
201
|
+
from: opts.from,
|
|
202
|
+
strict: opts.strict,
|
|
203
|
+
shouldThrow: opts.shouldThrow,
|
|
204
|
+
structuralSharing: opts.structuralSharing,
|
|
205
|
+
select: (match) => {
|
|
206
|
+
return opts.select ? opts.select(match.search) : match.search;
|
|
207
|
+
}
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
//#endregion
|
|
211
|
+
//#region ../../node_modules/.pnpm/@tanstack+react-router@1.170.18_react-dom@19.2.7_react@19.2.7__react@19.2.7/node_modules/@tanstack/react-router/dist/esm/useNavigate.js
|
|
212
|
+
/**
|
|
213
|
+
* Imperative navigation hook.
|
|
214
|
+
*
|
|
215
|
+
* Returns a stable `navigate(options)` function to change the current location
|
|
216
|
+
* programmatically. Prefer the `Link` component for user-initiated navigation,
|
|
217
|
+
* and use this hook from effects, callbacks, or handlers where imperative
|
|
218
|
+
* navigation is required.
|
|
219
|
+
*
|
|
220
|
+
* Options:
|
|
221
|
+
* - `from`: Optional route base used to resolve relative `to` paths.
|
|
222
|
+
*
|
|
223
|
+
* @returns A function that accepts `NavigateOptions`.
|
|
224
|
+
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/useNavigateHook
|
|
225
|
+
*/
|
|
226
|
+
function useNavigate(_defaultOpts) {
|
|
227
|
+
const router = useRouter();
|
|
228
|
+
return import_react.useCallback((options) => {
|
|
229
|
+
return router.navigate({
|
|
230
|
+
...options,
|
|
231
|
+
from: options.from ?? _defaultOpts?.from
|
|
232
|
+
});
|
|
233
|
+
}, [_defaultOpts?.from, router]);
|
|
234
|
+
}
|
|
235
|
+
//#endregion
|
|
236
|
+
//#region ../../node_modules/.pnpm/@tanstack+react-router@1.170.18_react-dom@19.2.7_react@19.2.7__react@19.2.7/node_modules/@tanstack/react-router/dist/esm/useRouteContext.js
|
|
237
|
+
function useRouteContext(opts) {
|
|
238
|
+
return useMatch({
|
|
239
|
+
...opts,
|
|
240
|
+
select: (match) => opts.select ? opts.select(match.context) : match.context
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
//#endregion
|
|
244
|
+
//#region ../../node_modules/.pnpm/@tanstack+react-router@1.170.18_react-dom@19.2.7_react@19.2.7__react@19.2.7/node_modules/@tanstack/react-router/dist/esm/route.js
|
|
245
|
+
var import_jsx_runtime = require_jsx_runtime();
|
|
246
|
+
var Route = class extends BaseRoute {
|
|
247
|
+
/**
|
|
248
|
+
* @deprecated Use the `createRoute` function instead.
|
|
249
|
+
*/
|
|
250
|
+
constructor(options) {
|
|
251
|
+
super(options);
|
|
252
|
+
this.useMatch = (opts) => {
|
|
253
|
+
return useMatch({
|
|
254
|
+
select: opts?.select,
|
|
255
|
+
from: this.id,
|
|
256
|
+
structuralSharing: opts?.structuralSharing
|
|
257
|
+
});
|
|
258
|
+
};
|
|
259
|
+
this.useRouteContext = (opts) => {
|
|
260
|
+
return useRouteContext({
|
|
261
|
+
...opts,
|
|
262
|
+
from: this.id
|
|
263
|
+
});
|
|
264
|
+
};
|
|
265
|
+
this.useSearch = (opts) => {
|
|
266
|
+
return useSearch({
|
|
267
|
+
select: opts?.select,
|
|
268
|
+
structuralSharing: opts?.structuralSharing,
|
|
269
|
+
from: this.id
|
|
270
|
+
});
|
|
271
|
+
};
|
|
272
|
+
this.useParams = (opts) => {
|
|
273
|
+
return useParams({
|
|
274
|
+
select: opts?.select,
|
|
275
|
+
structuralSharing: opts?.structuralSharing,
|
|
276
|
+
from: this.id
|
|
277
|
+
});
|
|
278
|
+
};
|
|
279
|
+
this.useLoaderDeps = (opts) => {
|
|
280
|
+
return useLoaderDeps({
|
|
281
|
+
...opts,
|
|
282
|
+
from: this.id
|
|
283
|
+
});
|
|
284
|
+
};
|
|
285
|
+
this.useLoaderData = (opts) => {
|
|
286
|
+
return useLoaderData({
|
|
287
|
+
...opts,
|
|
288
|
+
from: this.id
|
|
289
|
+
});
|
|
290
|
+
};
|
|
291
|
+
this.useNavigate = () => {
|
|
292
|
+
return useNavigate({ from: this.fullPath });
|
|
293
|
+
};
|
|
294
|
+
this.Link = import_react.forwardRef((props, ref) => {
|
|
295
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Link, {
|
|
296
|
+
ref,
|
|
297
|
+
from: this.fullPath,
|
|
298
|
+
...props
|
|
299
|
+
});
|
|
300
|
+
});
|
|
301
|
+
}
|
|
302
|
+
};
|
|
303
|
+
/**
|
|
304
|
+
* Creates a non-root Route instance for code-based routing.
|
|
305
|
+
*
|
|
306
|
+
* Use this to define a route that will be composed into a route tree
|
|
307
|
+
* (typically via a parent route's `addChildren`). If you're using file-based
|
|
308
|
+
* routing, prefer `createFileRoute`.
|
|
309
|
+
*
|
|
310
|
+
* @param options Route options (path, component, loader, context, etc.).
|
|
311
|
+
* @returns A Route instance to be attached to the route tree.
|
|
312
|
+
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/createRouteFunction
|
|
313
|
+
*/
|
|
314
|
+
function createRoute(options) {
|
|
315
|
+
return new Route(options);
|
|
316
|
+
}
|
|
317
|
+
/**
|
|
318
|
+
* Creates a root route factory that requires a router context type.
|
|
319
|
+
*
|
|
320
|
+
* Use when your root route expects `context` to be provided to `createRouter`.
|
|
321
|
+
* The returned function behaves like `createRootRoute` but enforces a context type.
|
|
322
|
+
*
|
|
323
|
+
* @returns A factory function to configure and return a root route.
|
|
324
|
+
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/createRootRouteWithContextFunction
|
|
325
|
+
*/
|
|
326
|
+
function createRootRouteWithContext() {
|
|
327
|
+
return (options) => {
|
|
328
|
+
return createRootRoute(options);
|
|
329
|
+
};
|
|
330
|
+
}
|
|
331
|
+
var RootRoute = class extends BaseRootRoute {
|
|
332
|
+
/**
|
|
333
|
+
* @deprecated `RootRoute` is now an internal implementation detail. Use `createRootRoute()` instead.
|
|
334
|
+
*/
|
|
335
|
+
constructor(options) {
|
|
336
|
+
super(options);
|
|
337
|
+
this.useMatch = (opts) => {
|
|
338
|
+
return useMatch({
|
|
339
|
+
select: opts?.select,
|
|
340
|
+
from: this.id,
|
|
341
|
+
structuralSharing: opts?.structuralSharing
|
|
342
|
+
});
|
|
343
|
+
};
|
|
344
|
+
this.useRouteContext = (opts) => {
|
|
345
|
+
return useRouteContext({
|
|
346
|
+
...opts,
|
|
347
|
+
from: this.id
|
|
348
|
+
});
|
|
349
|
+
};
|
|
350
|
+
this.useSearch = (opts) => {
|
|
351
|
+
return useSearch({
|
|
352
|
+
select: opts?.select,
|
|
353
|
+
structuralSharing: opts?.structuralSharing,
|
|
354
|
+
from: this.id
|
|
355
|
+
});
|
|
356
|
+
};
|
|
357
|
+
this.useParams = (opts) => {
|
|
358
|
+
return useParams({
|
|
359
|
+
select: opts?.select,
|
|
360
|
+
structuralSharing: opts?.structuralSharing,
|
|
361
|
+
from: this.id
|
|
362
|
+
});
|
|
363
|
+
};
|
|
364
|
+
this.useLoaderDeps = (opts) => {
|
|
365
|
+
return useLoaderDeps({
|
|
366
|
+
...opts,
|
|
367
|
+
from: this.id
|
|
368
|
+
});
|
|
369
|
+
};
|
|
370
|
+
this.useLoaderData = (opts) => {
|
|
371
|
+
return useLoaderData({
|
|
372
|
+
...opts,
|
|
373
|
+
from: this.id
|
|
374
|
+
});
|
|
375
|
+
};
|
|
376
|
+
this.useNavigate = () => {
|
|
377
|
+
return useNavigate({ from: this.fullPath });
|
|
378
|
+
};
|
|
379
|
+
this.Link = import_react.forwardRef((props, ref) => {
|
|
380
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Link, {
|
|
381
|
+
ref,
|
|
382
|
+
from: this.fullPath,
|
|
383
|
+
...props
|
|
384
|
+
});
|
|
385
|
+
});
|
|
386
|
+
}
|
|
387
|
+
};
|
|
388
|
+
/**
|
|
389
|
+
* Creates a root Route instance used to build your route tree.
|
|
390
|
+
*
|
|
391
|
+
* Typically paired with `createRouter({ routeTree })`. If you need to require
|
|
392
|
+
* a typed router context, use `createRootRouteWithContext` instead.
|
|
393
|
+
*
|
|
394
|
+
* @param options Root route options (component, error, pending, etc.).
|
|
395
|
+
* @returns A root route instance.
|
|
396
|
+
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/createRootRouteFunction
|
|
397
|
+
*/
|
|
398
|
+
function createRootRoute(options) {
|
|
399
|
+
return new RootRoute(options);
|
|
400
|
+
}
|
|
401
|
+
//#endregion
|
|
402
|
+
//#region ../../node_modules/.pnpm/@tanstack+react-router@1.170.18_react-dom@19.2.7_react@19.2.7__react@19.2.7/node_modules/@tanstack/react-router/dist/esm/fileRoute.js
|
|
403
|
+
/**
|
|
404
|
+
* Creates a file-based Route factory for a given path.
|
|
405
|
+
*
|
|
406
|
+
* Used by TanStack Router's file-based routing to associate a file with a
|
|
407
|
+
* route. The returned function accepts standard route options. In normal usage
|
|
408
|
+
* the `path` string is inserted and maintained by the `tsr` generator.
|
|
409
|
+
*
|
|
410
|
+
* @param path File path literal for the route (usually auto-generated).
|
|
411
|
+
* @returns A function that accepts Route options and returns a Route instance.
|
|
412
|
+
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/createFileRouteFunction
|
|
413
|
+
*/
|
|
414
|
+
function createFileRoute(path) {
|
|
415
|
+
return new FileRoute(path, { silent: true }).createRoute;
|
|
416
|
+
}
|
|
417
|
+
/**
|
|
418
|
+
@deprecated It's no longer recommended to use the `FileRoute` class directly.
|
|
419
|
+
Instead, use `createFileRoute('/path/to/file')(options)` to create a file route.
|
|
420
|
+
*/
|
|
421
|
+
var FileRoute = class {
|
|
422
|
+
constructor(path, _opts) {
|
|
423
|
+
this.path = path;
|
|
424
|
+
this.createRoute = (options) => {
|
|
425
|
+
const route = createRoute(options);
|
|
426
|
+
route.isRoot = false;
|
|
427
|
+
return route;
|
|
428
|
+
};
|
|
429
|
+
this.silent = _opts?.silent;
|
|
430
|
+
}
|
|
431
|
+
};
|
|
432
|
+
//#endregion
|
|
433
|
+
//#region ../../node_modules/.pnpm/@tanstack+react-router@1.170.18_react-dom@19.2.7_react@19.2.7__react@19.2.7/node_modules/@tanstack/react-router/dist/esm/lazyRouteComponent.js
|
|
434
|
+
/**
|
|
435
|
+
* Wrap a dynamic import to create a route component that supports
|
|
436
|
+
* `.preload()` and friendly reload-on-module-missing behavior.
|
|
437
|
+
*
|
|
438
|
+
* @param importer Function returning a module promise
|
|
439
|
+
* @param exportName Named export to use (default: `default`)
|
|
440
|
+
* @returns A lazy route component compatible with TanStack Router
|
|
441
|
+
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/lazyRouteComponentFunction
|
|
442
|
+
*/
|
|
443
|
+
function lazyRouteComponent(importer, exportName) {
|
|
444
|
+
let loadPromise;
|
|
445
|
+
let comp;
|
|
446
|
+
let error;
|
|
447
|
+
let reload;
|
|
448
|
+
const load = () => {
|
|
449
|
+
if (!loadPromise) loadPromise = importer().then((res) => {
|
|
450
|
+
loadPromise = void 0;
|
|
451
|
+
comp = res[exportName ?? "default"];
|
|
452
|
+
}).catch((err) => {
|
|
453
|
+
error = err;
|
|
454
|
+
if (isModuleNotFoundError(error)) {
|
|
455
|
+
if (error instanceof Error && typeof window !== "undefined" && typeof sessionStorage !== "undefined") {
|
|
456
|
+
const storageKey = `tanstack_router_reload:${error.message}`;
|
|
457
|
+
if (!sessionStorage.getItem(storageKey)) {
|
|
458
|
+
sessionStorage.setItem(storageKey, "1");
|
|
459
|
+
reload = true;
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
});
|
|
464
|
+
return loadPromise;
|
|
465
|
+
};
|
|
466
|
+
const lazyComp = function Lazy(props) {
|
|
467
|
+
if (reload) {
|
|
468
|
+
window.location.reload();
|
|
469
|
+
throw new Promise(() => {});
|
|
470
|
+
}
|
|
471
|
+
if (error) throw error;
|
|
472
|
+
if (!comp) if (reactUse) reactUse(load());
|
|
473
|
+
else throw load();
|
|
474
|
+
return import_react.createElement(comp, props);
|
|
475
|
+
};
|
|
476
|
+
lazyComp.preload = load;
|
|
477
|
+
return lazyComp;
|
|
478
|
+
}
|
|
479
|
+
//#endregion
|
|
480
|
+
export { useStructuralSharing as a, useNavigate as i, createFileRoute as n, createRootRouteWithContext as r, lazyRouteComponent as t };
|