@coffre/ui 0.1.18 → 0.3.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 (236) hide show
  1. package/README.md +23 -3
  2. package/dist/{server/_coffre/assets/affordances-CKANXDTG.js → chunks/affordances-DAvsVz7u.js} +12 -7
  3. package/dist/chunks/affordances-DAvsVz7u.js.map +1 -0
  4. package/dist/chunks/directory-CSjWWUQ1.js +370 -0
  5. package/dist/chunks/directory-CSjWWUQ1.js.map +1 -0
  6. package/dist/{server/_coffre/assets/grants-DdKT11Ny.js → chunks/grants-saMQagmG.js} +41 -39
  7. package/dist/chunks/grants-saMQagmG.js.map +1 -0
  8. package/dist/chunks/icons-D-PfAfnH.js +203 -0
  9. package/dist/chunks/icons-D-PfAfnH.js.map +1 -0
  10. package/dist/chunks/mounted-jJmqqV_n.js +17 -0
  11. package/dist/chunks/mounted-jJmqqV_n.js.map +1 -0
  12. package/dist/{server/_coffre/assets/offboarding-CRz-K82H.js → chunks/offboarding-C6l30DZR.js} +70 -69
  13. package/dist/chunks/offboarding-C6l30DZR.js.map +1 -0
  14. package/dist/chunks/page-C5HcNqf2.js +190 -0
  15. package/dist/chunks/page-C5HcNqf2.js.map +1 -0
  16. package/dist/chunks/page-route-Drfw7lmn.js +20 -0
  17. package/dist/chunks/page-route-Drfw7lmn.js.map +1 -0
  18. package/dist/{server/_coffre/assets/principal-page-C-EFwJQw.js → chunks/principal-page-D_91OA0l.js} +105 -103
  19. package/dist/chunks/principal-page-D_91OA0l.js.map +1 -0
  20. package/dist/{server/_coffre/assets → chunks}/project-environments-lEzFHUt4.js +2 -0
  21. package/dist/chunks/project-environments-lEzFHUt4.js.map +1 -0
  22. package/dist/chunks/queries-CQ81o4so.js +376 -0
  23. package/dist/chunks/queries-CQ81o4so.js.map +1 -0
  24. package/dist/{server/_coffre/assets/row-state-C2P57xT1.js → chunks/row-state-0PsrEzOL.js} +22 -21
  25. package/dist/chunks/row-state-0PsrEzOL.js.map +1 -0
  26. package/dist/{server/_coffre/assets → chunks}/signin-errors-BEFlVDbQ.js +2 -0
  27. package/dist/chunks/signin-errors-BEFlVDbQ.js.map +1 -0
  28. package/dist/chunks/theme-B2vQolVR.js +86 -0
  29. package/dist/chunks/theme-B2vQolVR.js.map +1 -0
  30. package/dist/chunks/ui-DixXLQvQ.js +405 -0
  31. package/dist/chunks/ui-DixXLQvQ.js.map +1 -0
  32. package/dist/{server/_coffre/assets/use-action-B-xpvVRO.js → chunks/use-action-CWsg_YWU.js} +8 -6
  33. package/dist/chunks/use-action-CWsg_YWU.js.map +1 -0
  34. package/dist/{server/_coffre/assets/use-change-C8BCf3oU.js → chunks/use-change-c6CeLRin.js} +10 -474
  35. package/dist/chunks/use-change-c6CeLRin.js.map +1 -0
  36. package/dist/chunks/use-shell-jxd7Tzd-.js +26 -0
  37. package/dist/chunks/use-shell-jxd7Tzd-.js.map +1 -0
  38. package/dist/{server/_coffre/assets → chunks}/validation-BQtqPe2V.js +2 -0
  39. package/dist/chunks/validation-BQtqPe2V.js.map +1 -0
  40. package/dist/index.d.ts +386 -18
  41. package/dist/index.js +1147 -0
  42. package/dist/index.js.map +1 -0
  43. package/dist/pages/account.d.ts +9 -0
  44. package/dist/pages/account.js +334 -0
  45. package/dist/pages/account.js.map +1 -0
  46. package/dist/pages/audit.d.ts +3 -0
  47. package/dist/{server/_coffre/assets/audit-qB9G2AQJ.js → pages/audit.js} +102 -100
  48. package/dist/pages/audit.js.map +1 -0
  49. package/dist/pages/device-login.d.ts +9 -0
  50. package/dist/pages/device-login.js +211 -0
  51. package/dist/pages/device-login.js.map +1 -0
  52. package/dist/pages/environment.d.ts +3 -0
  53. package/dist/{server/_coffre/assets/projects._project._environment-C6uybzeU.js → pages/environment.js} +323 -469
  54. package/dist/pages/environment.js.map +1 -0
  55. package/dist/pages/login.d.ts +10 -0
  56. package/dist/pages/login.js +104 -0
  57. package/dist/pages/login.js.map +1 -0
  58. package/dist/pages/project.d.ts +2 -0
  59. package/dist/{server/_coffre/assets/projects._project.index-3CXwkyTh.js → pages/project.js} +223 -225
  60. package/dist/pages/project.js.map +1 -0
  61. package/dist/pages/projects.d.ts +3 -0
  62. package/dist/{server/_coffre/assets/projects.index-iSoBpRFz.js → pages/projects.js} +83 -81
  63. package/dist/pages/projects.js.map +1 -0
  64. package/dist/pages/settings.d.ts +3 -0
  65. package/dist/{server/_coffre/assets/settings-BDQTF5XW.js → pages/settings.js} +20 -18
  66. package/dist/pages/settings.js.map +1 -0
  67. package/dist/pages/token.d.ts +3 -0
  68. package/dist/{server/_coffre/assets/tokens._token-CrBMpcbN.js → pages/token.js} +198 -267
  69. package/dist/pages/token.js.map +1 -0
  70. package/dist/pages/tokens.d.ts +3 -0
  71. package/dist/pages/tokens.js +39 -0
  72. package/dist/pages/tokens.js.map +1 -0
  73. package/dist/pages/unregistered.d.ts +8 -0
  74. package/dist/pages/unregistered.js +54 -0
  75. package/dist/pages/unregistered.js.map +1 -0
  76. package/dist/pages/user.d.ts +3 -0
  77. package/dist/pages/user.js +16 -0
  78. package/dist/pages/user.js.map +1 -0
  79. package/dist/pages/users.d.ts +3 -0
  80. package/dist/pages/users.js +39 -0
  81. package/dist/pages/users.js.map +1 -0
  82. package/dist/project-BqIy8gYR.d.ts +5 -0
  83. package/dist/vite.d.ts +16 -0
  84. package/dist/vite.js +52 -0
  85. package/package.json +36 -21
  86. package/src/assets/icon.svg +1 -0
  87. package/src/components/affordances.ts +10 -4
  88. package/src/components/command-palette.tsx +229 -203
  89. package/src/components/directory.tsx +34 -38
  90. package/src/components/principal.tsx +7 -3
  91. package/src/components/service-tokens.tsx +3 -2
  92. package/src/components/shell.tsx +89 -127
  93. package/src/components/theme.tsx +14 -81
  94. package/src/components/ui.tsx +97 -68
  95. package/src/index.ts +29 -0
  96. package/src/layout.tsx +113 -0
  97. package/src/lib/coffre.ts +8 -4
  98. package/src/lib/mounted.ts +13 -0
  99. package/src/lib/page-context.ts +31 -0
  100. package/src/lib/page-route.ts +22 -0
  101. package/src/lib/preferences.tsx +46 -0
  102. package/src/options.ts +240 -0
  103. package/src/{routes → pages}/account.tsx +7 -24
  104. package/src/{routes → pages}/audit.tsx +5 -16
  105. package/src/{routes/auth.device.tsx → pages/device-login.tsx} +8 -21
  106. package/src/{routes/projects.$project.$environment.tsx → pages/environment.tsx} +43 -52
  107. package/src/{routes → pages}/login.tsx +5 -16
  108. package/src/{routes/projects.$project.index.tsx → pages/project.tsx} +38 -50
  109. package/src/{routes/projects.index.tsx → pages/projects.tsx} +2 -7
  110. package/src/{routes → pages}/settings.tsx +3 -10
  111. package/src/{routes/tokens.$token.tsx → pages/token.tsx} +6 -7
  112. package/src/{routes/tokens.index.tsx → pages/tokens.tsx} +3 -8
  113. package/src/{routes → pages}/unregistered.tsx +1 -6
  114. package/src/pages/user.tsx +10 -0
  115. package/src/{routes/users.index.tsx → pages/users.tsx} +3 -8
  116. package/src/register.ts +55 -0
  117. package/src/router.tsx +31 -62
  118. package/src/styles/globals.css +104 -46
  119. package/src/vite.ts +78 -0
  120. package/dist/client/.assetsignore +0 -2
  121. package/dist/client/_coffre/assets/account-BoLGAxbD.js +0 -2
  122. package/dist/client/_coffre/assets/account-CnnuRTDB.js +0 -1
  123. package/dist/client/_coffre/assets/affordances-CEafRJcN.js +0 -1
  124. package/dist/client/_coffre/assets/audit-CHSvKLWX.js +0 -1
  125. package/dist/client/_coffre/assets/audit-Cn4hmS4u.js +0 -2
  126. package/dist/client/_coffre/assets/auth.device-Co5vrpaA.js +0 -2
  127. package/dist/client/_coffre/assets/auth.device-DAlqWacc.js +0 -1
  128. package/dist/client/_coffre/assets/directory-H8Eh3MnS.js +0 -1
  129. package/dist/client/_coffre/assets/dist-Braunv_x.js +0 -1
  130. package/dist/client/_coffre/assets/globals-CpMrgkV6.css +0 -1
  131. package/dist/client/_coffre/assets/grants-DPDxJXU1.js +0 -1
  132. package/dist/client/_coffre/assets/icons-Dc_-t0lp.js +0 -1
  133. package/dist/client/_coffre/assets/index-sUCIXRgJ.js +0 -12
  134. package/dist/client/_coffre/assets/inter-cyrillic-ext-opsz-normal-CfYZpDVp.woff2 +0 -0
  135. package/dist/client/_coffre/assets/inter-cyrillic-opsz-normal-BFQXbQ-f.woff2 +0 -0
  136. package/dist/client/_coffre/assets/inter-greek-ext-opsz-normal-BmPQvyvo.woff2 +0 -0
  137. package/dist/client/_coffre/assets/inter-greek-opsz-normal-BM0NlUE_.woff2 +0 -0
  138. package/dist/client/_coffre/assets/inter-latin-ext-opsz-normal-DpK-iCPk.woff2 +0 -0
  139. package/dist/client/_coffre/assets/inter-latin-opsz-normal-BwkfbSeq.woff2 +0 -0
  140. package/dist/client/_coffre/assets/inter-vietnamese-opsz-normal-Ci9T9ieq.woff2 +0 -0
  141. package/dist/client/_coffre/assets/jetbrains-mono-cyrillic-ext-wght-normal-EocZY2iu.woff2 +0 -0
  142. package/dist/client/_coffre/assets/jetbrains-mono-cyrillic-wght-normal-D73BlboJ.woff2 +0 -0
  143. package/dist/client/_coffre/assets/jetbrains-mono-greek-wght-normal-Bw9x6K1M.woff2 +0 -0
  144. package/dist/client/_coffre/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2 +0 -0
  145. package/dist/client/_coffre/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2 +0 -0
  146. package/dist/client/_coffre/assets/jetbrains-mono-vietnamese-wght-normal-Bt-aOZkq.woff2 +0 -0
  147. package/dist/client/_coffre/assets/link-DBINMwm6.js +0 -1
  148. package/dist/client/_coffre/assets/login-BZFYfL1Y.js +0 -1
  149. package/dist/client/_coffre/assets/login-CYCKWTOD.js +0 -2
  150. package/dist/client/_coffre/assets/offboarding-Bwpftp3g.js +0 -1
  151. package/dist/client/_coffre/assets/page-C_hnzdaR.js +0 -1
  152. package/dist/client/_coffre/assets/preload-helper-CLkO85Nq.js +0 -1
  153. package/dist/client/_coffre/assets/principal-page-DLho8TSJ.js +0 -1
  154. package/dist/client/_coffre/assets/project-environments-CfIH5kFM.js +0 -1
  155. package/dist/client/_coffre/assets/projects._project._environment-DHRRvQw0.js +0 -3
  156. package/dist/client/_coffre/assets/projects._project._environment-TLI-RjBZ.js +0 -2
  157. package/dist/client/_coffre/assets/projects._project.index-BO-8FZIY.js +0 -2
  158. package/dist/client/_coffre/assets/projects._project.index-DGl921dP.js +0 -1
  159. package/dist/client/_coffre/assets/projects.index-BDn7Bhoo.js +0 -1
  160. package/dist/client/_coffre/assets/row-state-DJ-KLamZ.js +0 -1
  161. package/dist/client/_coffre/assets/settings-q9G1QvR_.js +0 -1
  162. package/dist/client/_coffre/assets/signin-errors-CroZWZgm.js +0 -1
  163. package/dist/client/_coffre/assets/suspense-O8sP0mEC.js +0 -1
  164. package/dist/client/_coffre/assets/tokens._token-B_qczpT9.js +0 -2
  165. package/dist/client/_coffre/assets/tokens._token-T-sqwMbz.js +0 -2
  166. package/dist/client/_coffre/assets/tokens.index-CcXSZnAG.js +0 -1
  167. package/dist/client/_coffre/assets/ui-BXP2IqrW.js +0 -46
  168. package/dist/client/_coffre/assets/unregistered-D2JXJ90x.js +0 -1
  169. package/dist/client/_coffre/assets/use-action-BpzKWhgg.js +0 -1
  170. package/dist/client/_coffre/assets/use-change-CKj3Inq9.js +0 -1
  171. package/dist/client/_coffre/assets/use-shell-W0SusPkz.js +0 -1
  172. package/dist/client/_coffre/assets/useQuery-B-lxFSES.js +0 -1
  173. package/dist/client/_coffre/assets/useSuspenseQuery-BZ-nzHST.js +0 -1
  174. package/dist/client/_coffre/assets/users._user-Bb3BGYHl.js +0 -1
  175. package/dist/client/_coffre/assets/users._user-DXmvKrzE.js +0 -2
  176. package/dist/client/_coffre/assets/users.index-BvzP3qwW.js +0 -1
  177. package/dist/client/_coffre/assets/validation-9Cl_XS-l.js +0 -1
  178. package/dist/server/.vite/manifest.json +0 -668
  179. package/dist/server/_coffre/assets/_tanstack-start-manifest_v-GsKnGGRy.js +0 -162
  180. package/dist/server/_coffre/assets/account-CV-a2IU2.js +0 -329
  181. package/dist/server/_coffre/assets/account-hk6wcIXU.js +0 -162
  182. package/dist/server/_coffre/assets/async-local-storage-C10uQtMM.js +0 -3108
  183. package/dist/server/_coffre/assets/audit-C1_Ej6YB.js +0 -31
  184. package/dist/server/_coffre/assets/auth.device-6JRrWbSV.js +0 -210
  185. package/dist/server/_coffre/assets/auth.device-CLoAxC2T.js +0 -29
  186. package/dist/server/_coffre/assets/directory-B-_rqsPx.js +0 -371
  187. package/dist/server/_coffre/assets/dist-CnnV3t2g.js +0 -908
  188. package/dist/server/_coffre/assets/empty-plugin-adapters-Cq4--YW-.js +0 -5
  189. package/dist/server/_coffre/assets/globals-CpMrgkV6.css +0 -1
  190. package/dist/server/_coffre/assets/icons-DOFT-eWB.js +0 -1704
  191. package/dist/server/_coffre/assets/inter-cyrillic-ext-opsz-normal-CfYZpDVp.woff2 +0 -0
  192. package/dist/server/_coffre/assets/inter-cyrillic-opsz-normal-BFQXbQ-f.woff2 +0 -0
  193. package/dist/server/_coffre/assets/inter-greek-ext-opsz-normal-BmPQvyvo.woff2 +0 -0
  194. package/dist/server/_coffre/assets/inter-greek-opsz-normal-BM0NlUE_.woff2 +0 -0
  195. package/dist/server/_coffre/assets/inter-latin-ext-opsz-normal-DpK-iCPk.woff2 +0 -0
  196. package/dist/server/_coffre/assets/inter-latin-opsz-normal-BwkfbSeq.woff2 +0 -0
  197. package/dist/server/_coffre/assets/inter-vietnamese-opsz-normal-Ci9T9ieq.woff2 +0 -0
  198. package/dist/server/_coffre/assets/jetbrains-mono-cyrillic-ext-wght-normal-EocZY2iu.woff2 +0 -0
  199. package/dist/server/_coffre/assets/jetbrains-mono-cyrillic-wght-normal-D73BlboJ.woff2 +0 -0
  200. package/dist/server/_coffre/assets/jetbrains-mono-greek-wght-normal-Bw9x6K1M.woff2 +0 -0
  201. package/dist/server/_coffre/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2 +0 -0
  202. package/dist/server/_coffre/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2 +0 -0
  203. package/dist/server/_coffre/assets/jetbrains-mono-vietnamese-wght-normal-Bt-aOZkq.woff2 +0 -0
  204. package/dist/server/_coffre/assets/lazyRouteComponent-CqBNCGuZ.js +0 -480
  205. package/dist/server/_coffre/assets/link-42ZWdjzZ.js +0 -422
  206. package/dist/server/_coffre/assets/login-DRKUKkaW.js +0 -22
  207. package/dist/server/_coffre/assets/login-DnwxVl4Y.js +0 -102
  208. package/dist/server/_coffre/assets/matchContext-qLfYbC6_.js +0 -56
  209. package/dist/server/_coffre/assets/page-D6n45dcK.js +0 -3561
  210. package/dist/server/_coffre/assets/projects._project._environment-CS8DdSMY.js +0 -48
  211. package/dist/server/_coffre/assets/projects._project.index-BGfcNpj0.js +0 -23
  212. package/dist/server/_coffre/assets/react-dom-bBoJXlK2.js +0 -1718
  213. package/dist/server/_coffre/assets/router-9BTgJhWG.js +0 -2322
  214. package/dist/server/_coffre/assets/start-DR3rN0St.js +0 -4
  215. package/dist/server/_coffre/assets/suspense-C-2QfDd2.js +0 -602
  216. package/dist/server/_coffre/assets/tokens._token-rY86Cjgp.js +0 -10
  217. package/dist/server/_coffre/assets/tokens.index-Bq5qDW9q.js +0 -37
  218. package/dist/server/_coffre/assets/ui-Cc0CGMtr.js +0 -14881
  219. package/dist/server/_coffre/assets/unregistered-D9ZKLOPJ.js +0 -53
  220. package/dist/server/_coffre/assets/use-shell-DwOzEi87.js +0 -462
  221. package/dist/server/_coffre/assets/useQuery-CTe86qFq.js +0 -8
  222. package/dist/server/_coffre/assets/useRouter-CaUSUNsw.js +0 -473
  223. package/dist/server/_coffre/assets/useSuspenseQuery-CSoHzrMb.js +0 -117
  224. package/dist/server/_coffre/assets/users._user-BmLKYeo_.js +0 -10
  225. package/dist/server/_coffre/assets/users._user-BmiHwQx3.js +0 -14
  226. package/dist/server/_coffre/assets/users.index-BiEax90r.js +0 -37
  227. package/dist/server/index.js +0 -13911
  228. package/src/assets/favicon-32.png +0 -0
  229. package/src/components/agentation.tsx +0 -34
  230. package/src/entry.ts +0 -19
  231. package/src/routeTree.gen.ts +0 -367
  232. package/src/routes/__root.tsx +0 -169
  233. package/src/routes/access.tsx +0 -11
  234. package/src/routes/index.tsx +0 -15
  235. package/src/routes/users.$user.tsx +0 -13
  236. package/src/types.ts +0 -21
@@ -1,480 +0,0 @@
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 };