@tanstack/solid-router 1.132.0-alpha.2 → 1.132.0-alpha.4

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 (41) hide show
  1. package/dist/cjs/HeadContent.cjs +9 -6
  2. package/dist/cjs/HeadContent.cjs.map +1 -1
  3. package/dist/cjs/ScriptOnce.cjs +2 -2
  4. package/dist/cjs/ScriptOnce.cjs.map +1 -1
  5. package/dist/cjs/index.cjs +2 -10
  6. package/dist/cjs/index.cjs.map +1 -1
  7. package/dist/cjs/index.d.cts +2 -2
  8. package/dist/cjs/router.cjs +1 -1
  9. package/dist/cjs/router.cjs.map +1 -1
  10. package/dist/cjs/router.d.cts +2 -2
  11. package/dist/cjs/scroll-restoration.cjs +11 -3
  12. package/dist/cjs/scroll-restoration.cjs.map +1 -1
  13. package/dist/esm/HeadContent.js +9 -6
  14. package/dist/esm/HeadContent.js.map +1 -1
  15. package/dist/esm/ScriptOnce.js +2 -2
  16. package/dist/esm/ScriptOnce.js.map +1 -1
  17. package/dist/esm/index.d.ts +2 -2
  18. package/dist/esm/index.js +2 -4
  19. package/dist/esm/router.d.ts +2 -2
  20. package/dist/esm/router.js +1 -1
  21. package/dist/esm/router.js.map +1 -1
  22. package/dist/esm/scroll-restoration.js +11 -3
  23. package/dist/esm/scroll-restoration.js.map +1 -1
  24. package/dist/source/HeadContent.jsx +9 -7
  25. package/dist/source/HeadContent.jsx.map +1 -1
  26. package/dist/source/ScriptOnce.jsx +1 -1
  27. package/dist/source/ScriptOnce.jsx.map +1 -1
  28. package/dist/source/index.d.ts +2 -2
  29. package/dist/source/index.jsx +1 -1
  30. package/dist/source/index.jsx.map +1 -1
  31. package/dist/source/router.d.ts +2 -2
  32. package/dist/source/router.js +1 -1
  33. package/dist/source/router.js.map +1 -1
  34. package/dist/source/scroll-restoration.jsx +11 -3
  35. package/dist/source/scroll-restoration.jsx.map +1 -1
  36. package/package.json +3 -3
  37. package/src/HeadContent.tsx +9 -6
  38. package/src/ScriptOnce.tsx +2 -2
  39. package/src/index.tsx +3 -3
  40. package/src/router.ts +6 -3
  41. package/src/scroll-restoration.tsx +11 -4
@@ -34,9 +34,12 @@ const useTags = () => {
34
34
  const resultMeta = [];
35
35
  const metaByAttribute = {};
36
36
  let title;
37
- [...routeMeta()].reverse().forEach((metas) => {
38
- [...metas].reverse().forEach((m) => {
39
- if (!m) return;
37
+ const routeMetasArray = routeMeta();
38
+ for (let i = routeMetasArray.length - 1; i >= 0; i--) {
39
+ const metas = routeMetasArray[i];
40
+ for (let j = metas.length - 1; j >= 0; j--) {
41
+ const m = metas[j];
42
+ if (!m) continue;
40
43
  if (m.title) {
41
44
  if (!title) {
42
45
  title = {
@@ -48,7 +51,7 @@ const useTags = () => {
48
51
  const attribute = m.name ?? m.property;
49
52
  if (attribute) {
50
53
  if (metaByAttribute[attribute]) {
51
- return;
54
+ continue;
52
55
  } else {
53
56
  metaByAttribute[attribute] = true;
54
57
  }
@@ -60,8 +63,8 @@ const useTags = () => {
60
63
  }
61
64
  });
62
65
  }
63
- });
64
- });
66
+ }
67
+ }
65
68
  if (title) {
66
69
  resultMeta.push(title);
67
70
  }
@@ -1 +1 @@
1
- {"version":3,"file":"HeadContent.cjs","sources":["../../src/HeadContent.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport { MetaProvider } from '@solidjs/meta'\nimport { Asset } from './Asset'\nimport { useRouter } from './useRouter'\nimport { useRouterState } from './useRouterState'\nimport type { RouterManagedTag } from '@tanstack/router-core'\n\nexport const useTags = () => {\n const router = useRouter()\n\n const routeMeta = useRouterState({\n select: (state) => {\n return state.matches.map((match) => match.meta!).filter(Boolean)\n },\n })\n\n const meta: Solid.Accessor<Array<RouterManagedTag>> = Solid.createMemo(() => {\n const resultMeta: Array<RouterManagedTag> = []\n const metaByAttribute: Record<string, true> = {}\n let title: RouterManagedTag | undefined\n ;[...routeMeta()].reverse().forEach((metas) => {\n ;[...metas].reverse().forEach((m) => {\n if (!m) return\n\n if (m.title) {\n if (!title) {\n title = {\n tag: 'title',\n children: m.title,\n }\n }\n } else {\n const attribute = m.name ?? m.property\n if (attribute) {\n if (metaByAttribute[attribute]) {\n return\n } else {\n metaByAttribute[attribute] = true\n }\n }\n\n resultMeta.push({\n tag: 'meta',\n attrs: {\n ...m,\n },\n })\n }\n })\n })\n\n if (title) {\n resultMeta.push(title)\n }\n\n resultMeta.reverse()\n\n return resultMeta\n })\n\n const links = useRouterState({\n select: (state) => {\n const constructed = state.matches\n .map((match) => match.links!)\n .filter(Boolean)\n .flat(1)\n .map((link) => ({\n tag: 'link',\n attrs: {\n ...link,\n },\n })) satisfies Array<RouterManagedTag>\n\n const manifest = router.ssr?.manifest\n\n // These are the assets extracted from the ViteManifest\n // using the `startManifestPlugin`\n const assets = state.matches\n .map((match) => manifest?.routes[match.routeId]?.assets ?? [])\n .filter(Boolean)\n .flat(1)\n .filter((asset) => asset.tag === 'link')\n .map(\n (asset) =>\n ({\n tag: 'link',\n attrs: asset.attrs,\n }) satisfies RouterManagedTag,\n )\n\n return [...constructed, ...assets]\n },\n })\n\n const preloadMeta = useRouterState({\n select: (state) => {\n const preloadMeta: Array<RouterManagedTag> = []\n\n state.matches\n .map((match) => router.looseRoutesById[match.routeId]!)\n .forEach((route) =>\n router.ssr?.manifest?.routes[route.id]?.preloads\n ?.filter(Boolean)\n .forEach((preload) => {\n preloadMeta.push({\n tag: 'link',\n attrs: {\n rel: 'modulepreload',\n href: preload,\n },\n })\n }),\n )\n\n return preloadMeta\n },\n })\n\n const styles = useRouterState({\n select: (state) =>\n (\n state.matches\n .map((match) => match.styles!)\n .flat(1)\n .filter(Boolean) as Array<RouterManagedTag>\n ).map(({ children, ...style }) => ({\n tag: 'style',\n attrs: {\n ...style,\n },\n children,\n })),\n })\n\n const headScripts = useRouterState({\n select: (state) =>\n (\n state.matches\n .map((match) => match.headScripts!)\n .flat(1)\n .filter(Boolean) as Array<RouterManagedTag>\n ).map(({ children, ...script }) => ({\n tag: 'script',\n attrs: {\n ...script,\n },\n children,\n })),\n })\n\n return () =>\n uniqBy(\n [\n ...meta(),\n ...preloadMeta(),\n ...links(),\n ...styles(),\n ...headScripts(),\n ] as Array<RouterManagedTag>,\n (d) => {\n return JSON.stringify(d)\n },\n )\n}\n\n/**\n * @description The `HeadContent` component is used to render meta tags, links, and scripts for the current route.\n * It should be rendered in the `<head>` of your document.\n */\nexport function HeadContent() {\n const tags = useTags()\n return (\n <MetaProvider>\n {tags().map((tag) => (\n <Asset {...tag} />\n ))}\n </MetaProvider>\n )\n}\n\nfunction uniqBy<T>(arr: Array<T>, fn: (item: T) => string) {\n const seen = new Set<string>()\n return arr.filter((item) => {\n const key = fn(item)\n if (seen.has(key)) {\n return false\n }\n seen.add(key)\n return true\n })\n}\n"],"names":["useTags","router","useRouter","routeMeta","useRouterState","select","state","matches","map","match","meta","filter","Boolean","Solid","createMemo","resultMeta","metaByAttribute","title","reverse","forEach","metas","m","tag","children","attribute","name","property","push","attrs","links","constructed","flat","link","manifest","ssr","assets","routes","routeId","asset","preloadMeta","looseRoutesById","route","id","preloads","preload","rel","href","styles","style","headScripts","script","uniqBy","d","JSON","stringify","HeadContent","tags","_$createComponent","MetaProvider","Asset","arr","fn","seen","Set","item","key","has","add"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAOO,MAAMA,UAAUA,MAAM;AAC3B,QAAMC,SAASC,UAAAA,UAAAA;AAEf,QAAMC,YAAYC,eAAAA,eAAe;AAAA,IAC/BC,QAASC,CAAAA,UAAU;AACjB,aAAOA,MAAMC,QAAQC,IAAKC,CAAAA,UAAUA,MAAMC,IAAK,EAAEC,OAAOC,OAAO;AAAA,IACjE;AAAA,EAAA,CACD;AAED,QAAMF,QAAgDG,iBAAMC,WAAW,MAAM;AAC3E,UAAMC,aAAsC,CAAA;AAC5C,UAAMC,kBAAwC,CAAA;AAC9C,QAAIC;AACH,KAAC,GAAGd,UAAAA,CAAW,EAAEe,QAAAA,EAAUC,QAASC,C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IAAAA,OAAc;AAAA,MAClC5B,KAAK;AAAA,MACLM,OAAO;AAAA,QACL,GAAGsB;AAAAA,MAAAA;AAAAA,MAEL3B;AAAAA,IAAAA,EACA;AAAA,EAAA,CACL;AAED,SAAO,MACL4B,OACE,CACE,GAAGzC,MAAAA,GACH,GAAG6B,YAAAA,GACH,GAAGV,MAAAA,GACH,GAAGkB,OAAAA,GACH,GAAGE,YAAAA,CAAa,GAEjBG,CAAAA,MAAM;AACL,WAAOC,KAAKC,UAAUF,CAAC;AAAA,EACzB,CACF;AACJ;AAMO,SAASG,cAAc;AAC5B,QAAMC,OAAOxD,QAAAA;AACb,SAAAyD,MAAAA,gBACGC,KAAAA,cAAY;AAAA,IAAA,IAAAnC,WAAA;AAAA,aACViC,OAAOhD,IAAKc,SAAGmC,sBACbE,MAAAA,OAAUrC,GAAG,CACf;AAAA,IAAC;AAAA,EAAA,CAAA;AAGR;AAEA,SAAS6B,OAAUS,KAAeC,IAAyB;AACzD,QAAMC,2BAAWC,IAAAA;AACjB,SAAOH,IAAIjD,OAAQqD,CAAAA,SAAS;AAC1B,UAAMC,MAAMJ,GAAGG,IAAI;AACnB,QAAIF,KAAKI,IAAID,GAAG,GAAG;AACjB,aAAO;AAAA,IACT;AACAH,SAAKK,IAAIF,GAAG;AACZ,WAAO;AAAA,EACT,CAAC;AACH;;;"}
1
+ {"version":3,"file":"HeadContent.cjs","sources":["../../src/HeadContent.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport { MetaProvider } from '@solidjs/meta'\nimport { Asset } from './Asset'\nimport { useRouter } from './useRouter'\nimport { useRouterState } from './useRouterState'\nimport type { RouterManagedTag } from '@tanstack/router-core'\n\nexport const useTags = () => {\n const router = useRouter()\n\n const routeMeta = useRouterState({\n select: (state) => {\n return state.matches.map((match) => match.meta!).filter(Boolean)\n },\n })\n\n const meta: Solid.Accessor<Array<RouterManagedTag>> = Solid.createMemo(() => {\n const resultMeta: Array<RouterManagedTag> = []\n const metaByAttribute: Record<string, true> = {}\n let title: RouterManagedTag | undefined\n const routeMetasArray = routeMeta()\n for (let i = routeMetasArray.length - 1; i >= 0; i--) {\n const metas = routeMetasArray[i]!\n for (let j = metas.length - 1; j >= 0; j--) {\n const m = metas[j]\n if (!m) continue\n\n if (m.title) {\n if (!title) {\n title = {\n tag: 'title',\n children: m.title,\n }\n }\n } else {\n const attribute = m.name ?? m.property\n if (attribute) {\n if (metaByAttribute[attribute]) {\n continue\n } else {\n metaByAttribute[attribute] = true\n }\n }\n\n resultMeta.push({\n tag: 'meta',\n attrs: {\n ...m,\n },\n })\n }\n }\n }\n\n if (title) {\n resultMeta.push(title)\n }\n\n resultMeta.reverse()\n\n return resultMeta\n })\n\n const links = useRouterState({\n select: (state) => {\n const constructed = state.matches\n .map((match) => match.links!)\n .filter(Boolean)\n .flat(1)\n .map((link) => ({\n tag: 'link',\n attrs: {\n ...link,\n },\n })) satisfies Array<RouterManagedTag>\n\n const manifest = router.ssr?.manifest\n\n // These are the assets extracted from the ViteManifest\n // using the `startManifestPlugin`\n const assets = state.matches\n .map((match) => manifest?.routes[match.routeId]?.assets ?? [])\n .filter(Boolean)\n .flat(1)\n .filter((asset) => asset.tag === 'link')\n .map(\n (asset) =>\n ({\n tag: 'link',\n attrs: asset.attrs,\n }) satisfies RouterManagedTag,\n )\n\n return [...constructed, ...assets]\n },\n })\n\n const preloadMeta = useRouterState({\n select: (state) => {\n const preloadMeta: Array<RouterManagedTag> = []\n\n state.matches\n .map((match) => router.looseRoutesById[match.routeId]!)\n .forEach((route) =>\n router.ssr?.manifest?.routes[route.id]?.preloads\n ?.filter(Boolean)\n .forEach((preload) => {\n preloadMeta.push({\n tag: 'link',\n attrs: {\n rel: 'modulepreload',\n href: preload,\n },\n })\n }),\n )\n\n return preloadMeta\n },\n })\n\n const styles = useRouterState({\n select: (state) =>\n (\n state.matches\n .map((match) => match.styles!)\n .flat(1)\n .filter(Boolean) as Array<RouterManagedTag>\n ).map(({ children, ...style }) => ({\n tag: 'style',\n attrs: {\n ...style,\n },\n children,\n })),\n })\n\n const headScripts = useRouterState({\n select: (state) =>\n (\n state.matches\n .map((match) => match.headScripts!)\n .flat(1)\n .filter(Boolean) as Array<RouterManagedTag>\n ).map(({ children, ...script }) => ({\n tag: 'script',\n attrs: {\n ...script,\n },\n children,\n })),\n })\n\n return () =>\n uniqBy(\n [\n ...meta(),\n ...preloadMeta(),\n ...links(),\n ...styles(),\n ...headScripts(),\n ] as Array<RouterManagedTag>,\n (d) => {\n return JSON.stringify(d)\n },\n )\n}\n\n/**\n * @description The `HeadContent` component is used to render meta tags, links, and scripts for the current route.\n * It should be rendered in the `<head>` of your document.\n */\nexport function HeadContent() {\n const tags = useTags()\n return (\n <MetaProvider>\n {tags().map((tag) => (\n <Asset {...tag} />\n ))}\n </MetaProvider>\n )\n}\n\nfunction uniqBy<T>(arr: Array<T>, fn: (item: T) => string) {\n const seen = new Set<string>()\n return arr.filter((item) => {\n const key = fn(item)\n if (seen.has(key)) {\n return false\n }\n seen.add(key)\n return true\n })\n}\n"],"names":["useTags","router","useRouter","routeMeta","useRouterState","select","state","matches","map","match","meta","filter","Boolean","Solid","createMemo","resultMeta","metaByAttribute","title","routeMetasArray","i","length","metas","j","m","tag","children","attribute","name","property","push","attrs","reverse","links","constructed","flat","link","manifest","ssr","assets","routes","routeId","asset","preloadMeta","looseRoutesById","forEach","route","id","preloads","preload","rel","href","styles","style","headScripts","script","uniqBy","d","JSON","stringify","HeadContent","tags","_$createComponent","MetaProvider","Asset","arr","fn","seen","Set","item","key","has","add"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAOO,MAAMA,UAAUA,MAAM;AAC3B,QAAMC,SAASC,UAAAA,UAAAA;AAEf,QAAMC,YAAYC,eAAAA,eAAe;AAAA,IAC/BC,QAASC,CAAAA,UAAU;AACjB,aAAOA,MAAMC,QAAQC,IAAKC,CAAAA,UAAUA,MAAMC,IAAK,EAAEC,OAAOC,OAAO;AAAA,IACjE;AAAA,EAAA,CACD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AAA,EACA;AAAA,EAAA,CACL;AAED,QAAM4B,cAAcjD,eAAAA,eAAe;AAAA,IACjCC,QAASC,CAAAA,UAELA,MAAMC,QACHC,IAAKC,WAAUA,MAAM4C,WAAY,EACjCnB,KAAK,CAAC,EACNvB,OAAOC,OAAO,EACjBJ,IAAI,CAAC;AAAA,MAAEiB;AAAAA,MAAU,GAAG6B;AAAAA,IAAAA,OAAc;AAAA,MAClC9B,KAAK;AAAA,MACLM,OAAO;AAAA,QACL,GAAGwB;AAAAA,MAAAA;AAAAA,MAEL7B;AAAAA,IAAAA,EACA;AAAA,EAAA,CACL;AAED,SAAO,MACL8B,OACE,CACE,GAAG7C,MAAAA,GACH,GAAGgC,YAAAA,GACH,GAAGV,MAAAA,GACH,GAAGmB,OAAAA,GACH,GAAGE,YAAAA,CAAa,GAEjBG,CAAAA,MAAM;AACL,WAAOC,KAAKC,UAAUF,CAAC;AAAA,EACzB,CACF;AACJ;AAMO,SAASG,cAAc;AAC5B,QAAMC,OAAO5D,QAAAA;AACb,SAAA6D,MAAAA,gBACGC,KAAAA,cAAY;AAAA,IAAA,IAAArC,WAAA;AAAA,aACVmC,OAAOpD,IAAKgB,SAAGqC,sBACbE,MAAAA,OAAUvC,GAAG,CACf;AAAA,IAAC;AAAA,EAAA,CAAA;AAGR;AAEA,SAAS+B,OAAUS,KAAeC,IAAyB;AACzD,QAAMC,2BAAWC,IAAAA;AACjB,SAAOH,IAAIrD,OAAQyD,CAAAA,SAAS;AAC1B,UAAMC,MAAMJ,GAAGG,IAAI;AACnB,QAAIF,KAAKI,IAAID,GAAG,GAAG;AACjB,aAAO;AAAA,IACT;AACAH,SAAKK,IAAIF,GAAG;AACZ,WAAO;AAAA,EACT,CAAC;AACH;;;"}
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const Solid = require("solid-js/web");
4
- var _tmpl$ = /* @__PURE__ */ Solid.template(`<script class=tsr-once>`);
4
+ var _tmpl$ = /* @__PURE__ */ Solid.template(`<script class=$tsr>`);
5
5
  function ScriptOnce({
6
6
  children
7
7
  }) {
@@ -10,7 +10,7 @@ function ScriptOnce({
10
10
  }
11
11
  return (() => {
12
12
  var _el$ = _tmpl$();
13
- Solid.effect(() => _el$.innerHTML = [children].filter(Boolean).join("\n"));
13
+ Solid.effect(() => _el$.innerHTML = [children].filter(Boolean).join("\n") + ";$_TSR.c()");
14
14
  return _el$;
15
15
  })();
16
16
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ScriptOnce.cjs","sources":["../../src/ScriptOnce.tsx"],"sourcesContent":["export function ScriptOnce({\n children,\n}: {\n children: string\n log?: boolean\n sync?: boolean\n}) {\n if (typeof document !== 'undefined') {\n return null\n }\n\n return (\n <script\n class=\"tsr-once\"\n innerHTML={[children].filter(Boolean).join('\\n')}\n />\n )\n}\n"],"names":["ScriptOnce","children","document","_el$","_tmpl$","_$effect","innerHTML","filter","Boolean","join"],"mappings":";;;;AAAO,SAASA,WAAW;AAAA,EACzBC;AAKF,GAAG;AACD,MAAI,OAAOC,aAAa,aAAa;AACnC,WAAO;AAAA,EACT;AAEA,UAAA,MAAA;AAAA,QAAAC,OAAAC,OAAAA;AAAAC,UAAAA,aAAAF,KAAAG,YAGe,CAACL,QAAQ,EAAEM,OAAOC,OAAO,EAAEC,KAAK,IAAI,CAAC;AAAA,WAAAN;AAAAA,EAAA,GAAA;AAGtD;;"}
1
+ {"version":3,"file":"ScriptOnce.cjs","sources":["../../src/ScriptOnce.tsx"],"sourcesContent":["export function ScriptOnce({\n children,\n}: {\n children: string\n log?: boolean\n sync?: boolean\n}) {\n if (typeof document !== 'undefined') {\n return null\n }\n\n return (\n <script\n class=\"$tsr\"\n innerHTML={[children].filter(Boolean).join('\\n') + ';$_TSR.c()'}\n />\n )\n}\n"],"names":["ScriptOnce","children","document","_el$","_tmpl$","_$effect","innerHTML","filter","Boolean","join"],"mappings":";;;;AAAO,SAASA,WAAW;AAAA,EACzBC;AAKF,GAAG;AACD,MAAI,OAAOC,aAAa,aAAa;AACnC,WAAO;AAAA,EACT;AAEA,UAAA,MAAA;AAAA,QAAAC,OAAAC,OAAAA;AAAAC,UAAAA,aAAAF,KAAAG,YAGe,CAACL,QAAQ,EAAEM,OAAOC,OAAO,EAAEC,KAAK,IAAI,IAAI,YAAY;AAAA,WAAAN;AAAAA,EAAA,GAAA;AAGrE;;"}
@@ -58,9 +58,9 @@ Object.defineProperty(exports, "createControlledPromise", {
58
58
  enumerable: true,
59
59
  get: () => routerCore.createControlledPromise
60
60
  });
61
- Object.defineProperty(exports, "decode", {
61
+ Object.defineProperty(exports, "createSerializationAdapter", {
62
62
  enumerable: true,
63
- get: () => routerCore.decode
63
+ get: () => routerCore.createSerializationAdapter
64
64
  });
65
65
  Object.defineProperty(exports, "deepEqual", {
66
66
  enumerable: true,
@@ -82,10 +82,6 @@ Object.defineProperty(exports, "defer", {
82
82
  enumerable: true,
83
83
  get: () => routerCore.defer
84
84
  });
85
- Object.defineProperty(exports, "encode", {
86
- enumerable: true,
87
- get: () => routerCore.encode
88
- });
89
85
  Object.defineProperty(exports, "functionalUpdate", {
90
86
  enumerable: true,
91
87
  get: () => routerCore.functionalUpdate
@@ -146,10 +142,6 @@ Object.defineProperty(exports, "parseSearchWith", {
146
142
  enumerable: true,
147
143
  get: () => routerCore.parseSearchWith
148
144
  });
149
- Object.defineProperty(exports, "pick", {
150
- enumerable: true,
151
- get: () => routerCore.pick
152
- });
153
145
  Object.defineProperty(exports, "redirect", {
154
146
  enumerable: true,
155
147
  get: () => routerCore.redirect
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,5 +1,5 @@
1
- export { defer, TSR_DEFERRED_PROMISE, isMatch, joinPaths, cleanPath, trimPathLeft, trimPathRight, trimPath, resolvePath, parsePathname, interpolatePath, matchPathname, removeBasepath, matchByPath, encode, decode, rootRouteId, defaultSerializeError, defaultParseSearch, defaultStringifySearch, parseSearchWith, stringifySearchWith, pick, functionalUpdate, replaceEqualDeep, isPlainObject, isPlainArray, deepEqual, createControlledPromise, retainSearchParams, stripSearchParams, } from '@tanstack/router-core';
2
- export type { DeferredPromiseState, DeferredPromise, ParsedLocation, RemoveTrailingSlashes, RemoveLeadingSlashes, ActiveOptions, Segment, ResolveRelativePath, RootRouteId, AnyPathParams, ResolveParams, ResolveOptionalParams, ResolveRequiredParams, SearchSchemaInput, AnyContext, RouteContext, PreloadableObj, RoutePathOptions, StaticDataRouteOption, RoutePathOptionsIntersection, UpdatableStaticRouteOption, MetaDescriptor, RouteLinkEntry, ParseParamsFn, SearchFilter, ResolveId, InferFullSearchSchema, InferFullSearchSchemaInput, ErrorRouteProps, ErrorComponentProps, NotFoundRouteProps, TrimPath, TrimPathLeft, TrimPathRight, StringifyParamsFn, ParamsOptions, InferAllParams, InferAllContext, LooseReturnType, LooseAsyncReturnType, ContextReturnType, ContextAsyncReturnType, ResolveLoaderData, ResolveRouteContext, SearchSerializer, SearchParser, TrailingSlashOption, Manifest, RouterManagedTag, ControlledPromise, Constrain, Expand, MergeAll, Assign, IntersectAssign, ResolveValidatorInput, ResolveValidatorOutput, AnyValidator, DefaultValidator, ValidatorFn, AnySchema, AnyValidatorAdapter, AnyValidatorFn, AnyValidatorObj, ResolveValidatorInputFn, ResolveValidatorOutputFn, ResolveSearchValidatorInput, ResolveSearchValidatorInputFn, Validator, ValidatorAdapter, ValidatorObj, NavigateFn, BuildLocationFn, InferDescendantToPaths, RelativeToPath, RelativeToParentPath, RelativeToCurrentPath, Register, AbsoluteToPath, RelativeToPathAutoComplete, NavigateOptions, ToOptions, ToMaskOptions, ToSubOptions, ResolveRoute, SearchParamOptions, PathParamOptions, ToPathOption, LinkOptions, MakeOptionalPathParams, AnyRouterWithContext, ParseRoute, RoutesById, RouteById, RouteIds, RoutesByPath, RouteByPath, RoutePaths, FullSearchSchema, AllParams, AllLoaderData, FullSearchSchemaInput, AllContext, CommitLocationOptions, MatchLocation, ResolveFullSearchSchema, ResolveFullSearchSchemaInput, ResolveAllParamsFromParent, RouteContextParameter, BeforeLoadContextParameter, ResolveAllContext, FullSearchSchemaOption, MakeRemountDepsOptionsUnion, RemountDepsOptions, FileRouteTypes, FileRoutesByPath, UseNavigateResult, AnyRedirect, Redirect, RedirectOptions, ResolvedRedirect, RouteOptions, FileBaseRouteOptions, BaseRouteOptions, UpdatableRouteOptions, RouteLoaderFn, LoaderFnContext, MakeRouteMatch, MakeRouteMatchUnion, RouteMatch, AnyRouteMatch, RouteContextFn, RouteContextOptions, BeforeLoadFn, BeforeLoadContextOptions, ContextOptions, RootRouteOptions, AnyRouteWithContext, LazyRouteOptions, AnyRoute, ResolveFullPath, RouteConstraints, RouterState, ListenerFn, BuildNextOptions, AnyRouter, RegisteredRouter, RouterEvents, RouterEvent, RouterListener, MatchRouteOptions, RouteMask, RouterContextOptions, RouterOptions, RouterConstructorOptions, ControllablePromise, InjectedHtmlEntry, CreateFileRoute, CreateLazyFileRoute, } from '@tanstack/router-core';
1
+ export { defer, TSR_DEFERRED_PROMISE, isMatch, joinPaths, cleanPath, trimPathLeft, trimPathRight, trimPath, resolvePath, parsePathname, interpolatePath, matchPathname, removeBasepath, matchByPath, rootRouteId, defaultSerializeError, defaultParseSearch, defaultStringifySearch, parseSearchWith, stringifySearchWith, functionalUpdate, replaceEqualDeep, isPlainObject, isPlainArray, deepEqual, createControlledPromise, retainSearchParams, stripSearchParams, createSerializationAdapter, } from '@tanstack/router-core';
2
+ export type { DeferredPromiseState, DeferredPromise, ParsedLocation, RemoveTrailingSlashes, RemoveLeadingSlashes, ActiveOptions, Segment, ResolveRelativePath, RootRouteId, AnyPathParams, ResolveParams, ResolveOptionalParams, ResolveRequiredParams, SearchSchemaInput, AnyContext, RouteContext, PreloadableObj, RoutePathOptions, StaticDataRouteOption, RoutePathOptionsIntersection, UpdatableStaticRouteOption, MetaDescriptor, RouteLinkEntry, ParseParamsFn, SearchFilter, ResolveId, InferFullSearchSchema, InferFullSearchSchemaInput, ErrorRouteProps, ErrorComponentProps, NotFoundRouteProps, TrimPath, TrimPathLeft, TrimPathRight, StringifyParamsFn, ParamsOptions, InferAllParams, InferAllContext, LooseReturnType, LooseAsyncReturnType, ContextReturnType, ContextAsyncReturnType, ResolveLoaderData, ResolveRouteContext, SearchSerializer, SearchParser, TrailingSlashOption, Manifest, RouterManagedTag, ControlledPromise, Constrain, Expand, MergeAll, Assign, IntersectAssign, ResolveValidatorInput, ResolveValidatorOutput, AnyValidator, DefaultValidator, ValidatorFn, AnySchema, AnyValidatorAdapter, AnyValidatorFn, AnyValidatorObj, ResolveValidatorInputFn, ResolveValidatorOutputFn, ResolveSearchValidatorInput, ResolveSearchValidatorInputFn, Validator, ValidatorAdapter, ValidatorObj, NavigateFn, BuildLocationFn, InferDescendantToPaths, RelativeToPath, RelativeToParentPath, RelativeToCurrentPath, Register, AbsoluteToPath, RelativeToPathAutoComplete, NavigateOptions, ToOptions, ToMaskOptions, ToSubOptions, ResolveRoute, SearchParamOptions, PathParamOptions, ToPathOption, LinkOptions, MakeOptionalPathParams, AnyRouterWithContext, ParseRoute, RoutesById, RouteById, RouteIds, RoutesByPath, RouteByPath, RoutePaths, FullSearchSchema, AllParams, AllLoaderData, FullSearchSchemaInput, AllContext, CommitLocationOptions, MatchLocation, ResolveFullSearchSchema, ResolveFullSearchSchemaInput, ResolveAllParamsFromParent, RouteContextParameter, BeforeLoadContextParameter, ResolveAllContext, FullSearchSchemaOption, MakeRemountDepsOptionsUnion, RemountDepsOptions, FileRouteTypes, FileRoutesByPath, UseNavigateResult, AnyRedirect, Redirect, RedirectOptions, ResolvedRedirect, RouteOptions, FileBaseRouteOptions, BaseRouteOptions, UpdatableRouteOptions, RouteLoaderFn, LoaderFnContext, MakeRouteMatch, MakeRouteMatchUnion, RouteMatch, AnyRouteMatch, RouteContextFn, RouteContextOptions, BeforeLoadFn, BeforeLoadContextOptions, ContextOptions, RootRouteOptions, AnyRouteWithContext, LazyRouteOptions, AnyRoute, ResolveFullPath, RouteConstraints, RouterState, ListenerFn, BuildNextOptions, AnyRouter, RegisteredRouter, RouterEvents, RouterEvent, RouterListener, MatchRouteOptions, RouteMask, RouterContextOptions, RouterOptions, RouterConstructorOptions, ControllablePromise, InjectedHtmlEntry, CreateFileRoute, CreateLazyFileRoute, Transformer, AnyTransformer, } from '@tanstack/router-core';
3
3
  export { createHistory, createBrowserHistory, createHashHistory, createMemoryHistory, } from '@tanstack/history';
4
4
  export type { BlockerFn, HistoryLocation, RouterHistory, ParsedPath, HistoryState, } from '@tanstack/history';
5
5
  export { useAwaited, Await } from './awaited.cjs';
@@ -15,7 +15,7 @@ if (typeof globalThis !== "undefined") {
15
15
  globalThis.createLazyFileRoute = fileRoute.createLazyFileRoute;
16
16
  } else if (typeof window !== "undefined") {
17
17
  window.createFileRoute = fileRoute.createFileRoute;
18
- window.createFileRoute = fileRoute.createLazyFileRoute;
18
+ window.createLazyFileRoute = fileRoute.createLazyFileRoute;
19
19
  }
20
20
  exports.Router = Router;
21
21
  exports.createRouter = createRouter;
@@ -1 +1 @@
1
- {"version":3,"file":"router.cjs","sources":["../../src/router.ts"],"sourcesContent":["import { RouterCore } from '@tanstack/router-core'\nimport { createFileRoute, createLazyFileRoute } from './fileRoute'\nimport type { RouterHistory } from '@tanstack/history'\nimport type {\n AnyRoute,\n CreateRouterFn,\n RouterConstructorOptions,\n TrailingSlashOption,\n} from '@tanstack/router-core'\nimport type {\n ErrorRouteComponent,\n NotFoundRouteComponent,\n RouteComponent,\n} from './route'\nimport type { JSX } from 'solid-js'\n\ndeclare module '@tanstack/router-core' {\n export interface RouterOptionsExtensions {\n /**\n * The default `component` a route should use if no component is provided.\n *\n * @default Outlet\n * @link [API Docs](https://tanstack.com/router/latest/docs/framework/solid/api/router/RouterOptionsType#defaultcomponent-property)\n */\n defaultComponent?: RouteComponent\n /**\n * The default `errorComponent` a route should use if no error component is provided.\n *\n * @default ErrorComponent\n * @link [API Docs](https://tanstack.com/router/latest/docs/framework/solid/api/router/RouterOptionsType#defaulterrorcomponent-property)\n * @link [Guide](https://tanstack.com/router/latest/docs/framework/solid/guide/data-loading#handling-errors-with-routeoptionserrorcomponent)\n */\n defaultErrorComponent?: ErrorRouteComponent\n /**\n * The default `pendingComponent` a route should use if no pending component is provided.\n *\n * @link [API Docs](https://tanstack.com/router/latest/docs/framework/solid/api/router/RouterOptionsType#defaultpendingcomponent-property)\n * @link [Guide](https://tanstack.com/router/latest/docs/framework/solid/guide/data-loading#showing-a-pending-component)\n */\n defaultPendingComponent?: RouteComponent\n /**\n * The default `notFoundComponent` a route should use if no notFound component is provided.\n *\n * @default NotFound\n * @link [API Docs](https://tanstack.com/router/latest/docs/framework/solid/api/router/RouterOptionsType#defaultnotfoundcomponent-property)\n * @link [Guide](https://tanstack.com/router/latest/docs/framework/solid/guide/not-found-errors#default-router-wide-not-found-handling)\n */\n defaultNotFoundComponent?: NotFoundRouteComponent\n /**\n * A component that will be used to wrap the entire router.\n *\n * This is useful for providing a context to the entire router.\n *\n * @link [API Docs](https://tanstack.com/router/latest/docs/framework/solid/api/router/RouterOptionsType#wrap-property)\n */\n Wrap?: (props: { children: any }) => JSX.Element\n /**\n * A component that will be used to wrap the inner contents of the router.\n *\n * This is useful for providing a context to the inner contents of the router where you also need access to the router context and hooks.\n *\n * @link [API Docs](https://tanstack.com/router/latest/docs/framework/solid/api/router/RouterOptionsType#innerwrap-property)\n */\n InnerWrap?: (props: { children: any }) => JSX.Element\n\n /**\n * The default `onCatch` handler for errors caught by the Router ErrorBoundary\n *\n * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#defaultoncatch-property)\n * @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/data-loading#handling-errors-with-routeoptionsoncatch)\n */\n defaultOnCatch?: (error: Error) => void\n }\n}\n\nexport const createRouter: CreateRouterFn = (options) => {\n return new Router(options)\n}\n\nexport class Router<\n in out TRouteTree extends AnyRoute,\n in out TTrailingSlashOption extends TrailingSlashOption = 'never',\n in out TDefaultStructuralSharingOption extends boolean = false,\n in out TRouterHistory extends RouterHistory = RouterHistory,\n in out TDehydrated extends Record<string, any> = Record<string, any>,\n> extends RouterCore<\n TRouteTree,\n TTrailingSlashOption,\n TDefaultStructuralSharingOption,\n TRouterHistory,\n TDehydrated\n> {\n constructor(\n options: RouterConstructorOptions<\n TRouteTree,\n TTrailingSlashOption,\n TDefaultStructuralSharingOption,\n TRouterHistory,\n TDehydrated\n >,\n ) {\n super(options)\n }\n}\n\nif (typeof globalThis !== 'undefined') {\n ;(globalThis as any).createFileRoute = createFileRoute\n ;(globalThis as any).createLazyFileRoute = createLazyFileRoute\n} else if (typeof window !== 'undefined') {\n ;(window as any).createFileRoute = createFileRoute\n ;(window as any).createFileRoute = createLazyFileRoute\n}\n"],"names":["RouterCore","createFileRoute","createLazyFileRoute"],"mappings":";;;;AA2EO,MAAM,eAA+B,CAAC,YAAY;AACvD,SAAO,IAAI,OAAO,OAAO;AAC3B;AAEO,MAAM,eAMHA,WAAAA,WAMR;AAAA,EACA,YACE,SAOA;AACA,UAAM,OAAO;AAAA,EACf;AACF;AAEA,IAAI,OAAO,eAAe,aAAa;AACnC,aAAmB,kBAAkBC,UAAAA;AACrC,aAAmB,sBAAsBC,UAAAA;AAC7C,WAAW,OAAO,WAAW,aAAa;AACtC,SAAe,kBAAkBD,UAAAA;AACjC,SAAe,kBAAkBC,UAAAA;AACrC;;;"}
1
+ {"version":3,"file":"router.cjs","sources":["../../src/router.ts"],"sourcesContent":["import { RouterCore } from '@tanstack/router-core'\nimport { createFileRoute, createLazyFileRoute } from './fileRoute'\nimport type { RouterHistory } from '@tanstack/history'\nimport type {\n AnyRoute,\n CreateRouterFn,\n RouterConstructorOptions,\n TrailingSlashOption,\n} from '@tanstack/router-core'\nimport type {\n ErrorRouteComponent,\n NotFoundRouteComponent,\n RouteComponent,\n} from './route'\nimport type { JSX } from 'solid-js'\n\ndeclare module '@tanstack/router-core' {\n export interface RouterOptionsExtensions {\n /**\n * The default `component` a route should use if no component is provided.\n *\n * @default Outlet\n * @link [API Docs](https://tanstack.com/router/latest/docs/framework/solid/api/router/RouterOptionsType#defaultcomponent-property)\n */\n defaultComponent?: RouteComponent\n /**\n * The default `errorComponent` a route should use if no error component is provided.\n *\n * @default ErrorComponent\n * @link [API Docs](https://tanstack.com/router/latest/docs/framework/solid/api/router/RouterOptionsType#defaulterrorcomponent-property)\n * @link [Guide](https://tanstack.com/router/latest/docs/framework/solid/guide/data-loading#handling-errors-with-routeoptionserrorcomponent)\n */\n defaultErrorComponent?: ErrorRouteComponent\n /**\n * The default `pendingComponent` a route should use if no pending component is provided.\n *\n * @link [API Docs](https://tanstack.com/router/latest/docs/framework/solid/api/router/RouterOptionsType#defaultpendingcomponent-property)\n * @link [Guide](https://tanstack.com/router/latest/docs/framework/solid/guide/data-loading#showing-a-pending-component)\n */\n defaultPendingComponent?: RouteComponent\n /**\n * The default `notFoundComponent` a route should use if no notFound component is provided.\n *\n * @default NotFound\n * @link [API Docs](https://tanstack.com/router/latest/docs/framework/solid/api/router/RouterOptionsType#defaultnotfoundcomponent-property)\n * @link [Guide](https://tanstack.com/router/latest/docs/framework/solid/guide/not-found-errors#default-router-wide-not-found-handling)\n */\n defaultNotFoundComponent?: NotFoundRouteComponent\n /**\n * A component that will be used to wrap the entire router.\n *\n * This is useful for providing a context to the entire router.\n *\n * @link [API Docs](https://tanstack.com/router/latest/docs/framework/solid/api/router/RouterOptionsType#wrap-property)\n */\n Wrap?: (props: { children: any }) => JSX.Element\n /**\n * A component that will be used to wrap the inner contents of the router.\n *\n * This is useful for providing a context to the inner contents of the router where you also need access to the router context and hooks.\n *\n * @link [API Docs](https://tanstack.com/router/latest/docs/framework/solid/api/router/RouterOptionsType#innerwrap-property)\n */\n InnerWrap?: (props: { children: any }) => JSX.Element\n\n /**\n * The default `onCatch` handler for errors caught by the Router ErrorBoundary\n *\n * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#defaultoncatch-property)\n * @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/data-loading#handling-errors-with-routeoptionsoncatch)\n */\n defaultOnCatch?: (error: Error) => void\n }\n}\n\nexport const createRouter: CreateRouterFn = (options) => {\n return new Router(options)\n}\n\nexport class Router<\n in out TRouteTree extends AnyRoute,\n in out TTrailingSlashOption extends TrailingSlashOption = 'never',\n in out TDefaultStructuralSharingOption extends boolean = false,\n in out TRouterHistory extends RouterHistory = RouterHistory,\n in out TDehydrated extends Record<string, any> = Record<string, any>,\n in out TTransformerConfig = any,\n> extends RouterCore<\n TRouteTree,\n TTrailingSlashOption,\n TDefaultStructuralSharingOption,\n TRouterHistory,\n TDehydrated,\n TTransformerConfig\n> {\n constructor(\n options: RouterConstructorOptions<\n TRouteTree,\n TTrailingSlashOption,\n TDefaultStructuralSharingOption,\n TRouterHistory,\n TDehydrated,\n TTransformerConfig\n >,\n ) {\n super(options)\n }\n}\n\nif (typeof globalThis !== 'undefined') {\n ;(globalThis as any).createFileRoute = createFileRoute\n ;(globalThis as any).createLazyFileRoute = createLazyFileRoute\n} else if (typeof window !== 'undefined') {\n ;(window as any).createFileRoute = createFileRoute\n ;(window as any).createLazyFileRoute = createLazyFileRoute\n}\n"],"names":["RouterCore","createFileRoute","createLazyFileRoute"],"mappings":";;;;AA2EO,MAAM,eAA+B,CAAC,YAAY;AACvD,SAAO,IAAI,OAAO,OAAO;AAC3B;AAEO,MAAM,eAOHA,WAAAA,WAOR;AAAA,EACA,YACE,SAQA;AACA,UAAM,OAAO;AAAA,EACf;AACF;AAEA,IAAI,OAAO,eAAe,aAAa;AACnC,aAAmB,kBAAkBC,UAAAA;AACrC,aAAmB,sBAAsBC,UAAAA;AAC7C,WAAW,OAAO,WAAW,aAAa;AACtC,SAAe,kBAAkBD,UAAAA;AACjC,SAAe,sBAAsBC,UAAAA;AACzC;;;"}
@@ -64,6 +64,6 @@ declare module '@tanstack/router-core' {
64
64
  }
65
65
  }
66
66
  export declare const createRouter: CreateRouterFn;
67
- export declare class Router<in out TRouteTree extends AnyRoute, in out TTrailingSlashOption extends TrailingSlashOption = 'never', in out TDefaultStructuralSharingOption extends boolean = false, in out TRouterHistory extends RouterHistory = RouterHistory, in out TDehydrated extends Record<string, any> = Record<string, any>> extends RouterCore<TRouteTree, TTrailingSlashOption, TDefaultStructuralSharingOption, TRouterHistory, TDehydrated> {
68
- constructor(options: RouterConstructorOptions<TRouteTree, TTrailingSlashOption, TDefaultStructuralSharingOption, TRouterHistory, TDehydrated>);
67
+ export declare class Router<in out TRouteTree extends AnyRoute, in out TTrailingSlashOption extends TrailingSlashOption = 'never', in out TDefaultStructuralSharingOption extends boolean = false, in out TRouterHistory extends RouterHistory = RouterHistory, in out TDehydrated extends Record<string, any> = Record<string, any>, in out TTransformerConfig = any> extends RouterCore<TRouteTree, TTrailingSlashOption, TDefaultStructuralSharingOption, TRouterHistory, TDehydrated, TTransformerConfig> {
68
+ constructor(options: RouterConstructorOptions<TRouteTree, TTrailingSlashOption, TDefaultStructuralSharingOption, TRouterHistory, TDehydrated, TTransformerConfig>);
69
69
  }
@@ -6,12 +6,20 @@ const useRouter = require("./useRouter.cjs");
6
6
  const ScriptOnce = require("./ScriptOnce.cjs");
7
7
  function ScrollRestoration() {
8
8
  const router = useRouter.useRouter();
9
- const getKey = router.options.getScrollRestorationKey || routerCore.defaultGetScrollRestorationKey;
10
- const userKey = getKey(router.latestLocation);
11
- const resolvedKey = userKey !== routerCore.defaultGetScrollRestorationKey(router.latestLocation) ? userKey : void 0;
12
9
  if (!router.isScrollRestoring || !router.isServer) {
13
10
  return null;
14
11
  }
12
+ if (typeof router.options.scrollRestoration === "function") {
13
+ const shouldRestore = router.options.scrollRestoration({
14
+ location: router.latestLocation
15
+ });
16
+ if (!shouldRestore) {
17
+ return null;
18
+ }
19
+ }
20
+ const getKey = router.options.getScrollRestorationKey || routerCore.defaultGetScrollRestorationKey;
21
+ const userKey = getKey(router.latestLocation);
22
+ const resolvedKey = userKey !== routerCore.defaultGetScrollRestorationKey(router.latestLocation) ? userKey : void 0;
15
23
  const restoreScrollOptions = {
16
24
  storageKey: routerCore.storageKey,
17
25
  shouldScrollRestoration: true
@@ -1 +1 @@
1
- {"version":3,"file":"scroll-restoration.cjs","sources":["../../src/scroll-restoration.tsx"],"sourcesContent":["import {\n defaultGetScrollRestorationKey,\n restoreScroll,\n storageKey,\n} from '@tanstack/router-core'\nimport { useRouter } from './useRouter'\nimport { ScriptOnce } from './ScriptOnce'\n\nexport function ScrollRestoration() {\n const router = useRouter()\n const getKey =\n router.options.getScrollRestorationKey || defaultGetScrollRestorationKey\n const userKey = getKey(router.latestLocation)\n const resolvedKey =\n userKey !== defaultGetScrollRestorationKey(router.latestLocation)\n ? userKey\n : undefined\n\n if (!router.isScrollRestoring || !router.isServer) {\n return null\n }\n\n const restoreScrollOptions: Parameters<typeof restoreScroll>[0] = {\n storageKey,\n shouldScrollRestoration: true,\n }\n if (resolvedKey) {\n restoreScrollOptions.key = resolvedKey\n }\n\n return (\n <ScriptOnce\n children={`(${restoreScroll.toString()})(${JSON.stringify(restoreScrollOptions)})`}\n />\n )\n}\n"],"names":["ScrollRestoration","router","useRouter","getKey","options","getScrollRestorationKey","defaultGetScrollRestorationKey","userKey","latestLocation","resolvedKey","undefined","isScrollRestoring","isServer","restoreScrollOptions","storageKey","shouldScrollRestoration","key","_$createComponent","ScriptOnce","children","restoreScroll","toString","JSON","stringify"],"mappings":";;;;;;AAQO,SAASA,oBAAoB;AAClC,QAAMC,SAASC,UAAAA,UAAAA;AACf,QAAMC,SACJF,OAAOG,QAAQC,2BAA2BC,WAAAA;AAC5C,QAAMC,UAAUJ,OAAOF,OAAOO,cAAc;AAC5C,QAAMC,cACJF,YAAYD,WAAAA,+BAA+BL,OAAOO,cAAc,IAC5DD,UACAG;AAEN,MAAI,CAACT,OAAOU,qBAAqB,CAACV,OAAOW,UAAU;AACjD,WAAO;AAAA,EACT;AAEA,QAAMC,uBAA4D;AAAA,IAAA,YAChEC,WAAAA;AAAAA,IACAC,yBAAyB;AAAA,EAAA;AAE3B,MAAIN,aAAa;AACfI,yBAAqBG,MAAMP;AAAAA,EAC7B;AAEA,SAAAQ,MAAAA,gBACGC,WAAAA,YAAU;AAAA,IAAA,IACTC,WAAQ;AAAA,aAAE,IAAIC,WAAAA,cAAcC,SAAAA,CAAU,KAAKC,KAAKC,UAAUV,oBAAoB,CAAC;AAAA,IAAG;AAAA,EAAA,CAAA;AAGxF;;"}
1
+ {"version":3,"file":"scroll-restoration.cjs","sources":["../../src/scroll-restoration.tsx"],"sourcesContent":["import {\n defaultGetScrollRestorationKey,\n restoreScroll,\n storageKey,\n} from '@tanstack/router-core'\nimport { useRouter } from './useRouter'\nimport { ScriptOnce } from './ScriptOnce'\n\nexport function ScrollRestoration() {\n const router = useRouter()\n if (!router.isScrollRestoring || !router.isServer) {\n return null\n }\n if (typeof router.options.scrollRestoration === 'function') {\n const shouldRestore = router.options.scrollRestoration({\n location: router.latestLocation,\n })\n if (!shouldRestore) {\n return null\n }\n }\n const getKey =\n router.options.getScrollRestorationKey || defaultGetScrollRestorationKey\n const userKey = getKey(router.latestLocation)\n const resolvedKey =\n userKey !== defaultGetScrollRestorationKey(router.latestLocation)\n ? userKey\n : undefined\n\n const restoreScrollOptions: Parameters<typeof restoreScroll>[0] = {\n storageKey,\n shouldScrollRestoration: true,\n }\n if (resolvedKey) {\n restoreScrollOptions.key = resolvedKey\n }\n\n return (\n <ScriptOnce\n children={`(${restoreScroll.toString()})(${JSON.stringify(restoreScrollOptions)})`}\n />\n )\n}\n"],"names":["ScrollRestoration","router","useRouter","isScrollRestoring","isServer","options","scrollRestoration","shouldRestore","location","latestLocation","getKey","getScrollRestorationKey","defaultGetScrollRestorationKey","userKey","resolvedKey","undefined","restoreScrollOptions","storageKey","shouldScrollRestoration","key","_$createComponent","ScriptOnce","children","restoreScroll","toString","JSON","stringify"],"mappings":";;;;;;AAQO,SAASA,oBAAoB;AAClC,QAAMC,SAASC,UAAAA,UAAAA;AACf,MAAI,CAACD,OAAOE,qBAAqB,CAACF,OAAOG,UAAU;AACjD,WAAO;AAAA,EACT;AACA,MAAI,OAAOH,OAAOI,QAAQC,sBAAsB,YAAY;AAC1D,UAAMC,gBAAgBN,OAAOI,QAAQC,kBAAkB;AAAA,MACrDE,UAAUP,OAAOQ;AAAAA,IAAAA,CAClB;AACD,QAAI,CAACF,eAAe;AAClB,aAAO;AAAA,IACT;AAAA,EACF;AACA,QAAMG,SACJT,OAAOI,QAAQM,2BAA2BC,WAAAA;AAC5C,QAAMC,UAAUH,OAAOT,OAAOQ,cAAc;AAC5C,QAAMK,cACJD,YAAYD,WAAAA,+BAA+BX,OAAOQ,cAAc,IAC5DI,UACAE;AAEN,QAAMC,uBAA4D;AAAA,IAAA,YAChEC,WAAAA;AAAAA,IACAC,yBAAyB;AAAA,EAAA;AAE3B,MAAIJ,aAAa;AACfE,yBAAqBG,MAAML;AAAAA,EAC7B;AAEA,SAAAM,MAAAA,gBACGC,WAAAA,YAAU;AAAA,IAAA,IACTC,WAAQ;AAAA,aAAE,IAAIC,WAAAA,cAAcC,SAAAA,CAAU,KAAKC,KAAKC,UAAUV,oBAAoB,CAAC;AAAA,IAAG;AAAA,EAAA,CAAA;AAGxF;;"}
@@ -15,9 +15,12 @@ const useTags = () => {
15
15
  const resultMeta = [];
16
16
  const metaByAttribute = {};
17
17
  let title;
18
- [...routeMeta()].reverse().forEach((metas) => {
19
- [...metas].reverse().forEach((m) => {
20
- if (!m) return;
18
+ const routeMetasArray = routeMeta();
19
+ for (let i = routeMetasArray.length - 1; i >= 0; i--) {
20
+ const metas = routeMetasArray[i];
21
+ for (let j = metas.length - 1; j >= 0; j--) {
22
+ const m = metas[j];
23
+ if (!m) continue;
21
24
  if (m.title) {
22
25
  if (!title) {
23
26
  title = {
@@ -29,7 +32,7 @@ const useTags = () => {
29
32
  const attribute = m.name ?? m.property;
30
33
  if (attribute) {
31
34
  if (metaByAttribute[attribute]) {
32
- return;
35
+ continue;
33
36
  } else {
34
37
  metaByAttribute[attribute] = true;
35
38
  }
@@ -41,8 +44,8 @@ const useTags = () => {
41
44
  }
42
45
  });
43
46
  }
44
- });
45
- });
47
+ }
48
+ }
46
49
  if (title) {
47
50
  resultMeta.push(title);
48
51
  }
@@ -1 +1 @@
1
- {"version":3,"file":"HeadContent.js","sources":["../../src/HeadContent.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport { MetaProvider } from '@solidjs/meta'\nimport { Asset } from './Asset'\nimport { useRouter } from './useRouter'\nimport { useRouterState } from './useRouterState'\nimport type { RouterManagedTag } from '@tanstack/router-core'\n\nexport const useTags = () => {\n const router = useRouter()\n\n const routeMeta = useRouterState({\n select: (state) => {\n return state.matches.map((match) => match.meta!).filter(Boolean)\n },\n })\n\n const meta: Solid.Accessor<Array<RouterManagedTag>> = Solid.createMemo(() => {\n const resultMeta: Array<RouterManagedTag> = []\n const metaByAttribute: Record<string, true> = {}\n let title: RouterManagedTag | undefined\n ;[...routeMeta()].reverse().forEach((metas) => {\n ;[...metas].reverse().forEach((m) => {\n if (!m) return\n\n if (m.title) {\n if (!title) {\n title = {\n tag: 'title',\n children: m.title,\n }\n }\n } else {\n const attribute = m.name ?? m.property\n if (attribute) {\n if (metaByAttribute[attribute]) {\n return\n } else {\n metaByAttribute[attribute] = true\n }\n }\n\n resultMeta.push({\n tag: 'meta',\n attrs: {\n ...m,\n },\n })\n }\n })\n })\n\n if (title) {\n resultMeta.push(title)\n }\n\n resultMeta.reverse()\n\n return resultMeta\n })\n\n const links = useRouterState({\n select: (state) => {\n const constructed = state.matches\n .map((match) => match.links!)\n .filter(Boolean)\n .flat(1)\n .map((link) => ({\n tag: 'link',\n attrs: {\n ...link,\n },\n })) satisfies Array<RouterManagedTag>\n\n const manifest = router.ssr?.manifest\n\n // These are the assets extracted from the ViteManifest\n // using the `startManifestPlugin`\n const assets = state.matches\n .map((match) => manifest?.routes[match.routeId]?.assets ?? [])\n .filter(Boolean)\n .flat(1)\n .filter((asset) => asset.tag === 'link')\n .map(\n (asset) =>\n ({\n tag: 'link',\n attrs: asset.attrs,\n }) satisfies RouterManagedTag,\n )\n\n return [...constructed, ...assets]\n },\n })\n\n const preloadMeta = useRouterState({\n select: (state) => {\n const preloadMeta: Array<RouterManagedTag> = []\n\n state.matches\n .map((match) => router.looseRoutesById[match.routeId]!)\n .forEach((route) =>\n router.ssr?.manifest?.routes[route.id]?.preloads\n ?.filter(Boolean)\n .forEach((preload) => {\n preloadMeta.push({\n tag: 'link',\n attrs: {\n rel: 'modulepreload',\n href: preload,\n },\n })\n }),\n )\n\n return preloadMeta\n },\n })\n\n const styles = useRouterState({\n select: (state) =>\n (\n state.matches\n .map((match) => match.styles!)\n .flat(1)\n .filter(Boolean) as Array<RouterManagedTag>\n ).map(({ children, ...style }) => ({\n tag: 'style',\n attrs: {\n ...style,\n },\n children,\n })),\n })\n\n const headScripts = useRouterState({\n select: (state) =>\n (\n state.matches\n .map((match) => match.headScripts!)\n .flat(1)\n .filter(Boolean) as Array<RouterManagedTag>\n ).map(({ children, ...script }) => ({\n tag: 'script',\n attrs: {\n ...script,\n },\n children,\n })),\n })\n\n return () =>\n uniqBy(\n [\n ...meta(),\n ...preloadMeta(),\n ...links(),\n ...styles(),\n ...headScripts(),\n ] as Array<RouterManagedTag>,\n (d) => {\n return JSON.stringify(d)\n },\n )\n}\n\n/**\n * @description The `HeadContent` component is used to render meta tags, links, and scripts for the current route.\n * It should be rendered in the `<head>` of your document.\n */\nexport function HeadContent() {\n const tags = useTags()\n return (\n <MetaProvider>\n {tags().map((tag) => (\n <Asset {...tag} />\n ))}\n </MetaProvider>\n )\n}\n\nfunction uniqBy<T>(arr: Array<T>, fn: (item: T) => string) {\n const seen = new Set<string>()\n return arr.filter((item) => {\n const key = fn(item)\n if (seen.has(key)) {\n return false\n }\n seen.add(key)\n return true\n })\n}\n"],"names":["useTags","router","useRouter","routeMeta","useRouterState","select","state","matches","map","match","meta","filter","Boolean","Solid","createMemo","resultMeta","metaByAttribute","title","reverse","forEach","metas","m","tag","children","attribute","name","property","push","attrs","links","constructed","flat","link","manifest","ssr","assets","routes","routeId","asset","preloadMeta","looseRoutesById","route","id","preloads","preload","rel","href","styles","style","headScripts","script","uniqBy","d","JSON","stringify","HeadContent","tags","_$createComponent","MetaProvider","Asset","arr","fn","seen","Set","item","key","has","add"],"mappings":";;;;;;AAOO,MAAMA,UAAUA,MAAM;AAC3B,QAAMC,SAASC,UAAAA;AAEf,QAAMC,YAAYC,eAAe;AAAA,IAC/BC,QAASC,CAAAA,UAAU;AACjB,aAAOA,MAAMC,QAAQC,IAAKC,CAAAA,UAAUA,MAAMC,IAAK,EAAEC,OAAOC,OAAO;AAAA,IACjE;AAAA,EAAA,CACD;AAED,QAAMF,OAAgDG,MAAMC,WAAW,MAAM;AAC3E,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KAAK,CAAC,EACNpB,OAAOC,OAAO,EACjBJ,IAAI,CAAC;AAAA,MAAEe;AAAAA,MAAU,GAAG2B;AAAAA,IAAAA,OAAc;AAAA,MAClC5B,KAAK;AAAA,MACLM,OAAO;AAAA,QACL,GAAGsB;AAAAA,MAAAA;AAAAA,MAEL3B;AAAAA,IAAAA,EACA;AAAA,EAAA,CACL;AAED,SAAO,MACL4B,OACE,CACE,GAAGzC,KAAAA,GACH,GAAG6B,YAAAA,GACH,GAAGV,MAAAA,GACH,GAAGkB,OAAAA,GACH,GAAGE,YAAAA,CAAa,GAEjBG,CAAAA,MAAM;AACL,WAAOC,KAAKC,UAAUF,CAAC;AAAA,EACzB,CACF;AACJ;AAMO,SAASG,cAAc;AAC5B,QAAMC,OAAOxD,QAAAA;AACb,SAAAyD,gBACGC,cAAY;AAAA,IAAA,IAAAnC,WAAA;AAAA,aACViC,OAAOhD,IAAKc,SAAGmC,gBACbE,OAAUrC,GAAG,CACf;AAAA,IAAC;AAAA,EAAA,CAAA;AAGR;AAEA,SAAS6B,OAAUS,KAAeC,IAAyB;AACzD,QAAMC,2BAAWC,IAAAA;AACjB,SAAOH,IAAIjD,OAAQqD,CAAAA,SAAS;AAC1B,UAAMC,MAAMJ,GAAGG,IAAI;AACnB,QAAIF,KAAKI,IAAID,GAAG,GAAG;AACjB,aAAO;AAAA,IACT;AACAH,SAAKK,IAAIF,GAAG;AACZ,WAAO;AAAA,EACT,CAAC;AACH;"}
1
+ {"version":3,"file":"HeadContent.js","sources":["../../src/HeadContent.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport { MetaProvider } from '@solidjs/meta'\nimport { Asset } from './Asset'\nimport { useRouter } from './useRouter'\nimport { useRouterState } from './useRouterState'\nimport type { RouterManagedTag } from '@tanstack/router-core'\n\nexport const useTags = () => {\n const router = useRouter()\n\n const routeMeta = useRouterState({\n select: (state) => {\n return state.matches.map((match) => match.meta!).filter(Boolean)\n },\n })\n\n const meta: Solid.Accessor<Array<RouterManagedTag>> = Solid.createMemo(() => {\n const resultMeta: Array<RouterManagedTag> = []\n const metaByAttribute: Record<string, true> = {}\n let title: RouterManagedTag | undefined\n const routeMetasArray = routeMeta()\n for (let i = routeMetasArray.length - 1; i >= 0; i--) {\n const metas = routeMetasArray[i]!\n for (let j = metas.length - 1; j >= 0; j--) {\n const m = metas[j]\n if (!m) continue\n\n if (m.title) {\n if (!title) {\n title = {\n tag: 'title',\n children: m.title,\n }\n }\n } else {\n const attribute = m.name ?? m.property\n if (attribute) {\n if (metaByAttribute[attribute]) {\n continue\n } else {\n metaByAttribute[attribute] = true\n }\n }\n\n resultMeta.push({\n tag: 'meta',\n attrs: {\n ...m,\n },\n })\n }\n }\n }\n\n if (title) {\n resultMeta.push(title)\n }\n\n resultMeta.reverse()\n\n return resultMeta\n })\n\n const links = useRouterState({\n select: (state) => {\n const constructed = state.matches\n .map((match) => match.links!)\n .filter(Boolean)\n .flat(1)\n .map((link) => ({\n tag: 'link',\n attrs: {\n ...link,\n },\n })) satisfies Array<RouterManagedTag>\n\n const manifest = router.ssr?.manifest\n\n // These are the assets extracted from the ViteManifest\n // using the `startManifestPlugin`\n const assets = state.matches\n .map((match) => manifest?.routes[match.routeId]?.assets ?? [])\n .filter(Boolean)\n .flat(1)\n .filter((asset) => asset.tag === 'link')\n .map(\n (asset) =>\n ({\n tag: 'link',\n attrs: asset.attrs,\n }) satisfies RouterManagedTag,\n )\n\n return [...constructed, ...assets]\n },\n })\n\n const preloadMeta = useRouterState({\n select: (state) => {\n const preloadMeta: Array<RouterManagedTag> = []\n\n state.matches\n .map((match) => router.looseRoutesById[match.routeId]!)\n .forEach((route) =>\n router.ssr?.manifest?.routes[route.id]?.preloads\n ?.filter(Boolean)\n .forEach((preload) => {\n preloadMeta.push({\n tag: 'link',\n attrs: {\n rel: 'modulepreload',\n href: preload,\n },\n })\n }),\n )\n\n return preloadMeta\n },\n })\n\n const styles = useRouterState({\n select: (state) =>\n (\n state.matches\n .map((match) => match.styles!)\n .flat(1)\n .filter(Boolean) as Array<RouterManagedTag>\n ).map(({ children, ...style }) => ({\n tag: 'style',\n attrs: {\n ...style,\n },\n children,\n })),\n })\n\n const headScripts = useRouterState({\n select: (state) =>\n (\n state.matches\n .map((match) => match.headScripts!)\n .flat(1)\n .filter(Boolean) as Array<RouterManagedTag>\n ).map(({ children, ...script }) => ({\n tag: 'script',\n attrs: {\n ...script,\n },\n children,\n })),\n })\n\n return () =>\n uniqBy(\n [\n ...meta(),\n ...preloadMeta(),\n ...links(),\n ...styles(),\n ...headScripts(),\n ] as Array<RouterManagedTag>,\n (d) => {\n return JSON.stringify(d)\n },\n )\n}\n\n/**\n * @description The `HeadContent` component is used to render meta tags, links, and scripts for the current route.\n * It should be rendered in the `<head>` of your document.\n */\nexport function HeadContent() {\n const tags = useTags()\n return (\n <MetaProvider>\n {tags().map((tag) => (\n <Asset {...tag} />\n ))}\n </MetaProvider>\n )\n}\n\nfunction uniqBy<T>(arr: Array<T>, fn: (item: T) => string) {\n const seen = new Set<string>()\n return arr.filter((item) => {\n const key = fn(item)\n if (seen.has(key)) {\n return false\n }\n seen.add(key)\n return true\n })\n}\n"],"names":["useTags","router","useRouter","routeMeta","useRouterState","select","state","matches","map","match","meta","filter","Boolean","Solid","createMemo","resultMeta","metaByAttribute","title","routeMetasArray","i","length","metas","j","m","tag","children","attribute","name","property","push","attrs","reverse","links","constructed","flat","link","manifest","ssr","assets","routes","routeId","asset","preloadMeta","looseRoutesById","forEach","route","id","preloads","preload","rel","href","styles","style","headScripts","script","uniqBy","d","JSON","stringify","HeadContent","tags","_$createComponent","MetaProvider","Asset","arr","fn","seen","Set","item","key","has","add"],"mappings":";;;;;;AAOO,MAAMA,UAAUA,MAAM;AAC3B,QAAMC,SAASC,UAAAA;AAEf,QAAMC,YAAYC,eAAe;AAAA,IAC/BC,QAASC,CAAAA,UAAU;AACjB,aAAOA,MAAMC,QAAQC,IAAKC,CAAAA,UAAUA,MAAMC,IAAK,EAAEC,OAAOC,OA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AAAA,IAAAA,EACA;AAAA,EAAA,CACL;AAED,QAAM4B,cAAcjD,eAAe;AAAA,IACjCC,QAASC,CAAAA,UAELA,MAAMC,QACHC,IAAKC,WAAUA,MAAM4C,WAAY,EACjCnB,KAAK,CAAC,EACNvB,OAAOC,OAAO,EACjBJ,IAAI,CAAC;AAAA,MAAEiB;AAAAA,MAAU,GAAG6B;AAAAA,IAAAA,OAAc;AAAA,MAClC9B,KAAK;AAAA,MACLM,OAAO;AAAA,QACL,GAAGwB;AAAAA,MAAAA;AAAAA,MAEL7B;AAAAA,IAAAA,EACA;AAAA,EAAA,CACL;AAED,SAAO,MACL8B,OACE,CACE,GAAG7C,KAAAA,GACH,GAAGgC,YAAAA,GACH,GAAGV,MAAAA,GACH,GAAGmB,OAAAA,GACH,GAAGE,YAAAA,CAAa,GAEjBG,CAAAA,MAAM;AACL,WAAOC,KAAKC,UAAUF,CAAC;AAAA,EACzB,CACF;AACJ;AAMO,SAASG,cAAc;AAC5B,QAAMC,OAAO5D,QAAAA;AACb,SAAA6D,gBACGC,cAAY;AAAA,IAAA,IAAArC,WAAA;AAAA,aACVmC,OAAOpD,IAAKgB,SAAGqC,gBACbE,OAAUvC,GAAG,CACf;AAAA,IAAC;AAAA,EAAA,CAAA;AAGR;AAEA,SAAS+B,OAAUS,KAAeC,IAAyB;AACzD,QAAMC,2BAAWC,IAAAA;AACjB,SAAOH,IAAIrD,OAAQyD,CAAAA,SAAS;AAC1B,UAAMC,MAAMJ,GAAGG,IAAI;AACnB,QAAIF,KAAKI,IAAID,GAAG,GAAG;AACjB,aAAO;AAAA,IACT;AACAH,SAAKK,IAAIF,GAAG;AACZ,WAAO;AAAA,EACT,CAAC;AACH;"}
@@ -1,5 +1,5 @@
1
1
  import { template, effect } from "solid-js/web";
2
- var _tmpl$ = /* @__PURE__ */ template(`<script class=tsr-once>`);
2
+ var _tmpl$ = /* @__PURE__ */ template(`<script class=$tsr>`);
3
3
  function ScriptOnce({
4
4
  children
5
5
  }) {
@@ -8,7 +8,7 @@ function ScriptOnce({
8
8
  }
9
9
  return (() => {
10
10
  var _el$ = _tmpl$();
11
- effect(() => _el$.innerHTML = [children].filter(Boolean).join("\n"));
11
+ effect(() => _el$.innerHTML = [children].filter(Boolean).join("\n") + ";$_TSR.c()");
12
12
  return _el$;
13
13
  })();
14
14
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ScriptOnce.js","sources":["../../src/ScriptOnce.tsx"],"sourcesContent":["export function ScriptOnce({\n children,\n}: {\n children: string\n log?: boolean\n sync?: boolean\n}) {\n if (typeof document !== 'undefined') {\n return null\n }\n\n return (\n <script\n class=\"tsr-once\"\n innerHTML={[children].filter(Boolean).join('\\n')}\n />\n )\n}\n"],"names":["ScriptOnce","children","document","_el$","_tmpl$","_$effect","innerHTML","filter","Boolean","join"],"mappings":";;AAAO,SAASA,WAAW;AAAA,EACzBC;AAKF,GAAG;AACD,MAAI,OAAOC,aAAa,aAAa;AACnC,WAAO;AAAA,EACT;AAEA,UAAA,MAAA;AAAA,QAAAC,OAAAC,OAAAA;AAAAC,iBAAAF,KAAAG,YAGe,CAACL,QAAQ,EAAEM,OAAOC,OAAO,EAAEC,KAAK,IAAI,CAAC;AAAA,WAAAN;AAAAA,EAAA,GAAA;AAGtD;"}
1
+ {"version":3,"file":"ScriptOnce.js","sources":["../../src/ScriptOnce.tsx"],"sourcesContent":["export function ScriptOnce({\n children,\n}: {\n children: string\n log?: boolean\n sync?: boolean\n}) {\n if (typeof document !== 'undefined') {\n return null\n }\n\n return (\n <script\n class=\"$tsr\"\n innerHTML={[children].filter(Boolean).join('\\n') + ';$_TSR.c()'}\n />\n )\n}\n"],"names":["ScriptOnce","children","document","_el$","_tmpl$","_$effect","innerHTML","filter","Boolean","join"],"mappings":";;AAAO,SAASA,WAAW;AAAA,EACzBC;AAKF,GAAG;AACD,MAAI,OAAOC,aAAa,aAAa;AACnC,WAAO;AAAA,EACT;AAEA,UAAA,MAAA;AAAA,QAAAC,OAAAC,OAAAA;AAAAC,iBAAAF,KAAAG,YAGe,CAACL,QAAQ,EAAEM,OAAOC,OAAO,EAAEC,KAAK,IAAI,IAAI,YAAY;AAAA,WAAAN;AAAAA,EAAA,GAAA;AAGrE;"}
@@ -1,5 +1,5 @@
1
- export { defer, TSR_DEFERRED_PROMISE, isMatch, joinPaths, cleanPath, trimPathLeft, trimPathRight, trimPath, resolvePath, parsePathname, interpolatePath, matchPathname, removeBasepath, matchByPath, encode, decode, rootRouteId, defaultSerializeError, defaultParseSearch, defaultStringifySearch, parseSearchWith, stringifySearchWith, pick, functionalUpdate, replaceEqualDeep, isPlainObject, isPlainArray, deepEqual, createControlledPromise, retainSearchParams, stripSearchParams, } from '@tanstack/router-core';
2
- export type { DeferredPromiseState, DeferredPromise, ParsedLocation, RemoveTrailingSlashes, RemoveLeadingSlashes, ActiveOptions, Segment, ResolveRelativePath, RootRouteId, AnyPathParams, ResolveParams, ResolveOptionalParams, ResolveRequiredParams, SearchSchemaInput, AnyContext, RouteContext, PreloadableObj, RoutePathOptions, StaticDataRouteOption, RoutePathOptionsIntersection, UpdatableStaticRouteOption, MetaDescriptor, RouteLinkEntry, ParseParamsFn, SearchFilter, ResolveId, InferFullSearchSchema, InferFullSearchSchemaInput, ErrorRouteProps, ErrorComponentProps, NotFoundRouteProps, TrimPath, TrimPathLeft, TrimPathRight, StringifyParamsFn, ParamsOptions, InferAllParams, InferAllContext, LooseReturnType, LooseAsyncReturnType, ContextReturnType, ContextAsyncReturnType, ResolveLoaderData, ResolveRouteContext, SearchSerializer, SearchParser, TrailingSlashOption, Manifest, RouterManagedTag, ControlledPromise, Constrain, Expand, MergeAll, Assign, IntersectAssign, ResolveValidatorInput, ResolveValidatorOutput, AnyValidator, DefaultValidator, ValidatorFn, AnySchema, AnyValidatorAdapter, AnyValidatorFn, AnyValidatorObj, ResolveValidatorInputFn, ResolveValidatorOutputFn, ResolveSearchValidatorInput, ResolveSearchValidatorInputFn, Validator, ValidatorAdapter, ValidatorObj, NavigateFn, BuildLocationFn, InferDescendantToPaths, RelativeToPath, RelativeToParentPath, RelativeToCurrentPath, Register, AbsoluteToPath, RelativeToPathAutoComplete, NavigateOptions, ToOptions, ToMaskOptions, ToSubOptions, ResolveRoute, SearchParamOptions, PathParamOptions, ToPathOption, LinkOptions, MakeOptionalPathParams, AnyRouterWithContext, ParseRoute, RoutesById, RouteById, RouteIds, RoutesByPath, RouteByPath, RoutePaths, FullSearchSchema, AllParams, AllLoaderData, FullSearchSchemaInput, AllContext, CommitLocationOptions, MatchLocation, ResolveFullSearchSchema, ResolveFullSearchSchemaInput, ResolveAllParamsFromParent, RouteContextParameter, BeforeLoadContextParameter, ResolveAllContext, FullSearchSchemaOption, MakeRemountDepsOptionsUnion, RemountDepsOptions, FileRouteTypes, FileRoutesByPath, UseNavigateResult, AnyRedirect, Redirect, RedirectOptions, ResolvedRedirect, RouteOptions, FileBaseRouteOptions, BaseRouteOptions, UpdatableRouteOptions, RouteLoaderFn, LoaderFnContext, MakeRouteMatch, MakeRouteMatchUnion, RouteMatch, AnyRouteMatch, RouteContextFn, RouteContextOptions, BeforeLoadFn, BeforeLoadContextOptions, ContextOptions, RootRouteOptions, AnyRouteWithContext, LazyRouteOptions, AnyRoute, ResolveFullPath, RouteConstraints, RouterState, ListenerFn, BuildNextOptions, AnyRouter, RegisteredRouter, RouterEvents, RouterEvent, RouterListener, MatchRouteOptions, RouteMask, RouterContextOptions, RouterOptions, RouterConstructorOptions, ControllablePromise, InjectedHtmlEntry, CreateFileRoute, CreateLazyFileRoute, } from '@tanstack/router-core';
1
+ export { defer, TSR_DEFERRED_PROMISE, isMatch, joinPaths, cleanPath, trimPathLeft, trimPathRight, trimPath, resolvePath, parsePathname, interpolatePath, matchPathname, removeBasepath, matchByPath, rootRouteId, defaultSerializeError, defaultParseSearch, defaultStringifySearch, parseSearchWith, stringifySearchWith, functionalUpdate, replaceEqualDeep, isPlainObject, isPlainArray, deepEqual, createControlledPromise, retainSearchParams, stripSearchParams, createSerializationAdapter, } from '@tanstack/router-core';
2
+ export type { DeferredPromiseState, DeferredPromise, ParsedLocation, RemoveTrailingSlashes, RemoveLeadingSlashes, ActiveOptions, Segment, ResolveRelativePath, RootRouteId, AnyPathParams, ResolveParams, ResolveOptionalParams, ResolveRequiredParams, SearchSchemaInput, AnyContext, RouteContext, PreloadableObj, RoutePathOptions, StaticDataRouteOption, RoutePathOptionsIntersection, UpdatableStaticRouteOption, MetaDescriptor, RouteLinkEntry, ParseParamsFn, SearchFilter, ResolveId, InferFullSearchSchema, InferFullSearchSchemaInput, ErrorRouteProps, ErrorComponentProps, NotFoundRouteProps, TrimPath, TrimPathLeft, TrimPathRight, StringifyParamsFn, ParamsOptions, InferAllParams, InferAllContext, LooseReturnType, LooseAsyncReturnType, ContextReturnType, ContextAsyncReturnType, ResolveLoaderData, ResolveRouteContext, SearchSerializer, SearchParser, TrailingSlashOption, Manifest, RouterManagedTag, ControlledPromise, Constrain, Expand, MergeAll, Assign, IntersectAssign, ResolveValidatorInput, ResolveValidatorOutput, AnyValidator, DefaultValidator, ValidatorFn, AnySchema, AnyValidatorAdapter, AnyValidatorFn, AnyValidatorObj, ResolveValidatorInputFn, ResolveValidatorOutputFn, ResolveSearchValidatorInput, ResolveSearchValidatorInputFn, Validator, ValidatorAdapter, ValidatorObj, NavigateFn, BuildLocationFn, InferDescendantToPaths, RelativeToPath, RelativeToParentPath, RelativeToCurrentPath, Register, AbsoluteToPath, RelativeToPathAutoComplete, NavigateOptions, ToOptions, ToMaskOptions, ToSubOptions, ResolveRoute, SearchParamOptions, PathParamOptions, ToPathOption, LinkOptions, MakeOptionalPathParams, AnyRouterWithContext, ParseRoute, RoutesById, RouteById, RouteIds, RoutesByPath, RouteByPath, RoutePaths, FullSearchSchema, AllParams, AllLoaderData, FullSearchSchemaInput, AllContext, CommitLocationOptions, MatchLocation, ResolveFullSearchSchema, ResolveFullSearchSchemaInput, ResolveAllParamsFromParent, RouteContextParameter, BeforeLoadContextParameter, ResolveAllContext, FullSearchSchemaOption, MakeRemountDepsOptionsUnion, RemountDepsOptions, FileRouteTypes, FileRoutesByPath, UseNavigateResult, AnyRedirect, Redirect, RedirectOptions, ResolvedRedirect, RouteOptions, FileBaseRouteOptions, BaseRouteOptions, UpdatableRouteOptions, RouteLoaderFn, LoaderFnContext, MakeRouteMatch, MakeRouteMatchUnion, RouteMatch, AnyRouteMatch, RouteContextFn, RouteContextOptions, BeforeLoadFn, BeforeLoadContextOptions, ContextOptions, RootRouteOptions, AnyRouteWithContext, LazyRouteOptions, AnyRoute, ResolveFullPath, RouteConstraints, RouterState, ListenerFn, BuildNextOptions, AnyRouter, RegisteredRouter, RouterEvents, RouterEvent, RouterListener, MatchRouteOptions, RouteMask, RouterContextOptions, RouterOptions, RouterConstructorOptions, ControllablePromise, InjectedHtmlEntry, CreateFileRoute, CreateLazyFileRoute, Transformer, AnyTransformer, } from '@tanstack/router-core';
3
3
  export { createHistory, createBrowserHistory, createHashHistory, createMemoryHistory, } from '@tanstack/history';
4
4
  export type { BlockerFn, HistoryLocation, RouterHistory, ParsedPath, HistoryState, } from '@tanstack/history';
5
5
  export { useAwaited, Await } from './awaited.js';
package/dist/esm/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { PathParamError, SearchParamError, TSR_DEFERRED_PROMISE, cleanPath, componentTypes, createControlledPromise, decode, deepEqual, defaultParseSearch, defaultSerializeError, defaultStringifySearch, defer, encode, functionalUpdate, getInitialRouterState, interpolatePath, isMatch, isNotFound, isPlainArray, isPlainObject, isRedirect, joinPaths, lazyFn, matchByPath, matchPathname, notFound, parsePathname, parseSearchWith, pick, redirect, removeBasepath, replaceEqualDeep, resolvePath, retainSearchParams, rootRouteId, stringifySearchWith, stripSearchParams, trimPath, trimPathLeft, trimPathRight } from "@tanstack/router-core";
1
+ import { PathParamError, SearchParamError, TSR_DEFERRED_PROMISE, cleanPath, componentTypes, createControlledPromise, createSerializationAdapter, deepEqual, defaultParseSearch, defaultSerializeError, defaultStringifySearch, defer, functionalUpdate, getInitialRouterState, interpolatePath, isMatch, isNotFound, isPlainArray, isPlainObject, isRedirect, joinPaths, lazyFn, matchByPath, matchPathname, notFound, parsePathname, parseSearchWith, redirect, removeBasepath, replaceEqualDeep, resolvePath, retainSearchParams, rootRouteId, stringifySearchWith, stripSearchParams, trimPath, trimPathLeft, trimPathRight } from "@tanstack/router-core";
2
2
  import { createBrowserHistory, createHashHistory, createHistory, createMemoryHistory } from "@tanstack/history";
3
3
  import { Await, useAwaited } from "./awaited.js";
4
4
  import { CatchBoundary, ErrorComponent } from "./CatchBoundary.js";
@@ -80,13 +80,12 @@ export {
80
80
  createRoute,
81
81
  createRouteMask,
82
82
  createRouter,
83
- decode,
83
+ createSerializationAdapter,
84
84
  deepEqual,
85
85
  defaultParseSearch,
86
86
  defaultSerializeError,
87
87
  defaultStringifySearch,
88
88
  defer,
89
- encode,
90
89
  functionalUpdate,
91
90
  getInitialRouterState,
92
91
  getRouteApi,
@@ -107,7 +106,6 @@ export {
107
106
  notFound,
108
107
  parsePathname,
109
108
  parseSearchWith,
110
- pick,
111
109
  redirect,
112
110
  removeBasepath,
113
111
  replaceEqualDeep,
@@ -64,6 +64,6 @@ declare module '@tanstack/router-core' {
64
64
  }
65
65
  }
66
66
  export declare const createRouter: CreateRouterFn;
67
- export declare class Router<in out TRouteTree extends AnyRoute, in out TTrailingSlashOption extends TrailingSlashOption = 'never', in out TDefaultStructuralSharingOption extends boolean = false, in out TRouterHistory extends RouterHistory = RouterHistory, in out TDehydrated extends Record<string, any> = Record<string, any>> extends RouterCore<TRouteTree, TTrailingSlashOption, TDefaultStructuralSharingOption, TRouterHistory, TDehydrated> {
68
- constructor(options: RouterConstructorOptions<TRouteTree, TTrailingSlashOption, TDefaultStructuralSharingOption, TRouterHistory, TDehydrated>);
67
+ export declare class Router<in out TRouteTree extends AnyRoute, in out TTrailingSlashOption extends TrailingSlashOption = 'never', in out TDefaultStructuralSharingOption extends boolean = false, in out TRouterHistory extends RouterHistory = RouterHistory, in out TDehydrated extends Record<string, any> = Record<string, any>, in out TTransformerConfig = any> extends RouterCore<TRouteTree, TTrailingSlashOption, TDefaultStructuralSharingOption, TRouterHistory, TDehydrated, TTransformerConfig> {
68
+ constructor(options: RouterConstructorOptions<TRouteTree, TTrailingSlashOption, TDefaultStructuralSharingOption, TRouterHistory, TDehydrated, TTransformerConfig>);
69
69
  }
@@ -13,7 +13,7 @@ if (typeof globalThis !== "undefined") {
13
13
  globalThis.createLazyFileRoute = createLazyFileRoute;
14
14
  } else if (typeof window !== "undefined") {
15
15
  window.createFileRoute = createFileRoute;
16
- window.createFileRoute = createLazyFileRoute;
16
+ window.createLazyFileRoute = createLazyFileRoute;
17
17
  }
18
18
  export {
19
19
  Router,
@@ -1 +1 @@
1
- {"version":3,"file":"router.js","sources":["../../src/router.ts"],"sourcesContent":["import { RouterCore } from '@tanstack/router-core'\nimport { createFileRoute, createLazyFileRoute } from './fileRoute'\nimport type { RouterHistory } from '@tanstack/history'\nimport type {\n AnyRoute,\n CreateRouterFn,\n RouterConstructorOptions,\n TrailingSlashOption,\n} from '@tanstack/router-core'\nimport type {\n ErrorRouteComponent,\n NotFoundRouteComponent,\n RouteComponent,\n} from './route'\nimport type { JSX } from 'solid-js'\n\ndeclare module '@tanstack/router-core' {\n export interface RouterOptionsExtensions {\n /**\n * The default `component` a route should use if no component is provided.\n *\n * @default Outlet\n * @link [API Docs](https://tanstack.com/router/latest/docs/framework/solid/api/router/RouterOptionsType#defaultcomponent-property)\n */\n defaultComponent?: RouteComponent\n /**\n * The default `errorComponent` a route should use if no error component is provided.\n *\n * @default ErrorComponent\n * @link [API Docs](https://tanstack.com/router/latest/docs/framework/solid/api/router/RouterOptionsType#defaulterrorcomponent-property)\n * @link [Guide](https://tanstack.com/router/latest/docs/framework/solid/guide/data-loading#handling-errors-with-routeoptionserrorcomponent)\n */\n defaultErrorComponent?: ErrorRouteComponent\n /**\n * The default `pendingComponent` a route should use if no pending component is provided.\n *\n * @link [API Docs](https://tanstack.com/router/latest/docs/framework/solid/api/router/RouterOptionsType#defaultpendingcomponent-property)\n * @link [Guide](https://tanstack.com/router/latest/docs/framework/solid/guide/data-loading#showing-a-pending-component)\n */\n defaultPendingComponent?: RouteComponent\n /**\n * The default `notFoundComponent` a route should use if no notFound component is provided.\n *\n * @default NotFound\n * @link [API Docs](https://tanstack.com/router/latest/docs/framework/solid/api/router/RouterOptionsType#defaultnotfoundcomponent-property)\n * @link [Guide](https://tanstack.com/router/latest/docs/framework/solid/guide/not-found-errors#default-router-wide-not-found-handling)\n */\n defaultNotFoundComponent?: NotFoundRouteComponent\n /**\n * A component that will be used to wrap the entire router.\n *\n * This is useful for providing a context to the entire router.\n *\n * @link [API Docs](https://tanstack.com/router/latest/docs/framework/solid/api/router/RouterOptionsType#wrap-property)\n */\n Wrap?: (props: { children: any }) => JSX.Element\n /**\n * A component that will be used to wrap the inner contents of the router.\n *\n * This is useful for providing a context to the inner contents of the router where you also need access to the router context and hooks.\n *\n * @link [API Docs](https://tanstack.com/router/latest/docs/framework/solid/api/router/RouterOptionsType#innerwrap-property)\n */\n InnerWrap?: (props: { children: any }) => JSX.Element\n\n /**\n * The default `onCatch` handler for errors caught by the Router ErrorBoundary\n *\n * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#defaultoncatch-property)\n * @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/data-loading#handling-errors-with-routeoptionsoncatch)\n */\n defaultOnCatch?: (error: Error) => void\n }\n}\n\nexport const createRouter: CreateRouterFn = (options) => {\n return new Router(options)\n}\n\nexport class Router<\n in out TRouteTree extends AnyRoute,\n in out TTrailingSlashOption extends TrailingSlashOption = 'never',\n in out TDefaultStructuralSharingOption extends boolean = false,\n in out TRouterHistory extends RouterHistory = RouterHistory,\n in out TDehydrated extends Record<string, any> = Record<string, any>,\n> extends RouterCore<\n TRouteTree,\n TTrailingSlashOption,\n TDefaultStructuralSharingOption,\n TRouterHistory,\n TDehydrated\n> {\n constructor(\n options: RouterConstructorOptions<\n TRouteTree,\n TTrailingSlashOption,\n TDefaultStructuralSharingOption,\n TRouterHistory,\n TDehydrated\n >,\n ) {\n super(options)\n }\n}\n\nif (typeof globalThis !== 'undefined') {\n ;(globalThis as any).createFileRoute = createFileRoute\n ;(globalThis as any).createLazyFileRoute = createLazyFileRoute\n} else if (typeof window !== 'undefined') {\n ;(window as any).createFileRoute = createFileRoute\n ;(window as any).createFileRoute = createLazyFileRoute\n}\n"],"names":[],"mappings":";;AA2EO,MAAM,eAA+B,CAAC,YAAY;AACvD,SAAO,IAAI,OAAO,OAAO;AAC3B;AAEO,MAAM,eAMH,WAMR;AAAA,EACA,YACE,SAOA;AACA,UAAM,OAAO;AAAA,EACf;AACF;AAEA,IAAI,OAAO,eAAe,aAAa;AACnC,aAAmB,kBAAkB;AACrC,aAAmB,sBAAsB;AAC7C,WAAW,OAAO,WAAW,aAAa;AACtC,SAAe,kBAAkB;AACjC,SAAe,kBAAkB;AACrC;"}
1
+ {"version":3,"file":"router.js","sources":["../../src/router.ts"],"sourcesContent":["import { RouterCore } from '@tanstack/router-core'\nimport { createFileRoute, createLazyFileRoute } from './fileRoute'\nimport type { RouterHistory } from '@tanstack/history'\nimport type {\n AnyRoute,\n CreateRouterFn,\n RouterConstructorOptions,\n TrailingSlashOption,\n} from '@tanstack/router-core'\nimport type {\n ErrorRouteComponent,\n NotFoundRouteComponent,\n RouteComponent,\n} from './route'\nimport type { JSX } from 'solid-js'\n\ndeclare module '@tanstack/router-core' {\n export interface RouterOptionsExtensions {\n /**\n * The default `component` a route should use if no component is provided.\n *\n * @default Outlet\n * @link [API Docs](https://tanstack.com/router/latest/docs/framework/solid/api/router/RouterOptionsType#defaultcomponent-property)\n */\n defaultComponent?: RouteComponent\n /**\n * The default `errorComponent` a route should use if no error component is provided.\n *\n * @default ErrorComponent\n * @link [API Docs](https://tanstack.com/router/latest/docs/framework/solid/api/router/RouterOptionsType#defaulterrorcomponent-property)\n * @link [Guide](https://tanstack.com/router/latest/docs/framework/solid/guide/data-loading#handling-errors-with-routeoptionserrorcomponent)\n */\n defaultErrorComponent?: ErrorRouteComponent\n /**\n * The default `pendingComponent` a route should use if no pending component is provided.\n *\n * @link [API Docs](https://tanstack.com/router/latest/docs/framework/solid/api/router/RouterOptionsType#defaultpendingcomponent-property)\n * @link [Guide](https://tanstack.com/router/latest/docs/framework/solid/guide/data-loading#showing-a-pending-component)\n */\n defaultPendingComponent?: RouteComponent\n /**\n * The default `notFoundComponent` a route should use if no notFound component is provided.\n *\n * @default NotFound\n * @link [API Docs](https://tanstack.com/router/latest/docs/framework/solid/api/router/RouterOptionsType#defaultnotfoundcomponent-property)\n * @link [Guide](https://tanstack.com/router/latest/docs/framework/solid/guide/not-found-errors#default-router-wide-not-found-handling)\n */\n defaultNotFoundComponent?: NotFoundRouteComponent\n /**\n * A component that will be used to wrap the entire router.\n *\n * This is useful for providing a context to the entire router.\n *\n * @link [API Docs](https://tanstack.com/router/latest/docs/framework/solid/api/router/RouterOptionsType#wrap-property)\n */\n Wrap?: (props: { children: any }) => JSX.Element\n /**\n * A component that will be used to wrap the inner contents of the router.\n *\n * This is useful for providing a context to the inner contents of the router where you also need access to the router context and hooks.\n *\n * @link [API Docs](https://tanstack.com/router/latest/docs/framework/solid/api/router/RouterOptionsType#innerwrap-property)\n */\n InnerWrap?: (props: { children: any }) => JSX.Element\n\n /**\n * The default `onCatch` handler for errors caught by the Router ErrorBoundary\n *\n * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#defaultoncatch-property)\n * @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/data-loading#handling-errors-with-routeoptionsoncatch)\n */\n defaultOnCatch?: (error: Error) => void\n }\n}\n\nexport const createRouter: CreateRouterFn = (options) => {\n return new Router(options)\n}\n\nexport class Router<\n in out TRouteTree extends AnyRoute,\n in out TTrailingSlashOption extends TrailingSlashOption = 'never',\n in out TDefaultStructuralSharingOption extends boolean = false,\n in out TRouterHistory extends RouterHistory = RouterHistory,\n in out TDehydrated extends Record<string, any> = Record<string, any>,\n in out TTransformerConfig = any,\n> extends RouterCore<\n TRouteTree,\n TTrailingSlashOption,\n TDefaultStructuralSharingOption,\n TRouterHistory,\n TDehydrated,\n TTransformerConfig\n> {\n constructor(\n options: RouterConstructorOptions<\n TRouteTree,\n TTrailingSlashOption,\n TDefaultStructuralSharingOption,\n TRouterHistory,\n TDehydrated,\n TTransformerConfig\n >,\n ) {\n super(options)\n }\n}\n\nif (typeof globalThis !== 'undefined') {\n ;(globalThis as any).createFileRoute = createFileRoute\n ;(globalThis as any).createLazyFileRoute = createLazyFileRoute\n} else if (typeof window !== 'undefined') {\n ;(window as any).createFileRoute = createFileRoute\n ;(window as any).createLazyFileRoute = createLazyFileRoute\n}\n"],"names":[],"mappings":";;AA2EO,MAAM,eAA+B,CAAC,YAAY;AACvD,SAAO,IAAI,OAAO,OAAO;AAC3B;AAEO,MAAM,eAOH,WAOR;AAAA,EACA,YACE,SAQA;AACA,UAAM,OAAO;AAAA,EACf;AACF;AAEA,IAAI,OAAO,eAAe,aAAa;AACnC,aAAmB,kBAAkB;AACrC,aAAmB,sBAAsB;AAC7C,WAAW,OAAO,WAAW,aAAa;AACtC,SAAe,kBAAkB;AACjC,SAAe,sBAAsB;AACzC;"}
@@ -4,12 +4,20 @@ import { useRouter } from "./useRouter.js";
4
4
  import { ScriptOnce } from "./ScriptOnce.js";
5
5
  function ScrollRestoration() {
6
6
  const router = useRouter();
7
- const getKey = router.options.getScrollRestorationKey || defaultGetScrollRestorationKey;
8
- const userKey = getKey(router.latestLocation);
9
- const resolvedKey = userKey !== defaultGetScrollRestorationKey(router.latestLocation) ? userKey : void 0;
10
7
  if (!router.isScrollRestoring || !router.isServer) {
11
8
  return null;
12
9
  }
10
+ if (typeof router.options.scrollRestoration === "function") {
11
+ const shouldRestore = router.options.scrollRestoration({
12
+ location: router.latestLocation
13
+ });
14
+ if (!shouldRestore) {
15
+ return null;
16
+ }
17
+ }
18
+ const getKey = router.options.getScrollRestorationKey || defaultGetScrollRestorationKey;
19
+ const userKey = getKey(router.latestLocation);
20
+ const resolvedKey = userKey !== defaultGetScrollRestorationKey(router.latestLocation) ? userKey : void 0;
13
21
  const restoreScrollOptions = {
14
22
  storageKey,
15
23
  shouldScrollRestoration: true
@@ -1 +1 @@
1
- {"version":3,"file":"scroll-restoration.js","sources":["../../src/scroll-restoration.tsx"],"sourcesContent":["import {\n defaultGetScrollRestorationKey,\n restoreScroll,\n storageKey,\n} from '@tanstack/router-core'\nimport { useRouter } from './useRouter'\nimport { ScriptOnce } from './ScriptOnce'\n\nexport function ScrollRestoration() {\n const router = useRouter()\n const getKey =\n router.options.getScrollRestorationKey || defaultGetScrollRestorationKey\n const userKey = getKey(router.latestLocation)\n const resolvedKey =\n userKey !== defaultGetScrollRestorationKey(router.latestLocation)\n ? userKey\n : undefined\n\n if (!router.isScrollRestoring || !router.isServer) {\n return null\n }\n\n const restoreScrollOptions: Parameters<typeof restoreScroll>[0] = {\n storageKey,\n shouldScrollRestoration: true,\n }\n if (resolvedKey) {\n restoreScrollOptions.key = resolvedKey\n }\n\n return (\n <ScriptOnce\n children={`(${restoreScroll.toString()})(${JSON.stringify(restoreScrollOptions)})`}\n />\n )\n}\n"],"names":["ScrollRestoration","router","useRouter","getKey","options","getScrollRestorationKey","defaultGetScrollRestorationKey","userKey","latestLocation","resolvedKey","undefined","isScrollRestoring","isServer","restoreScrollOptions","storageKey","shouldScrollRestoration","key","_$createComponent","ScriptOnce","children","restoreScroll","toString","JSON","stringify"],"mappings":";;;;AAQO,SAASA,oBAAoB;AAClC,QAAMC,SAASC,UAAAA;AACf,QAAMC,SACJF,OAAOG,QAAQC,2BAA2BC;AAC5C,QAAMC,UAAUJ,OAAOF,OAAOO,cAAc;AAC5C,QAAMC,cACJF,YAAYD,+BAA+BL,OAAOO,cAAc,IAC5DD,UACAG;AAEN,MAAI,CAACT,OAAOU,qBAAqB,CAACV,OAAOW,UAAU;AACjD,WAAO;AAAA,EACT;AAEA,QAAMC,uBAA4D;AAAA,IAChEC;AAAAA,IACAC,yBAAyB;AAAA,EAAA;AAE3B,MAAIN,aAAa;AACfI,yBAAqBG,MAAMP;AAAAA,EAC7B;AAEA,SAAAQ,gBACGC,YAAU;AAAA,IAAA,IACTC,WAAQ;AAAA,aAAE,IAAIC,cAAcC,SAAAA,CAAU,KAAKC,KAAKC,UAAUV,oBAAoB,CAAC;AAAA,IAAG;AAAA,EAAA,CAAA;AAGxF;"}
1
+ {"version":3,"file":"scroll-restoration.js","sources":["../../src/scroll-restoration.tsx"],"sourcesContent":["import {\n defaultGetScrollRestorationKey,\n restoreScroll,\n storageKey,\n} from '@tanstack/router-core'\nimport { useRouter } from './useRouter'\nimport { ScriptOnce } from './ScriptOnce'\n\nexport function ScrollRestoration() {\n const router = useRouter()\n if (!router.isScrollRestoring || !router.isServer) {\n return null\n }\n if (typeof router.options.scrollRestoration === 'function') {\n const shouldRestore = router.options.scrollRestoration({\n location: router.latestLocation,\n })\n if (!shouldRestore) {\n return null\n }\n }\n const getKey =\n router.options.getScrollRestorationKey || defaultGetScrollRestorationKey\n const userKey = getKey(router.latestLocation)\n const resolvedKey =\n userKey !== defaultGetScrollRestorationKey(router.latestLocation)\n ? userKey\n : undefined\n\n const restoreScrollOptions: Parameters<typeof restoreScroll>[0] = {\n storageKey,\n shouldScrollRestoration: true,\n }\n if (resolvedKey) {\n restoreScrollOptions.key = resolvedKey\n }\n\n return (\n <ScriptOnce\n children={`(${restoreScroll.toString()})(${JSON.stringify(restoreScrollOptions)})`}\n />\n )\n}\n"],"names":["ScrollRestoration","router","useRouter","isScrollRestoring","isServer","options","scrollRestoration","shouldRestore","location","latestLocation","getKey","getScrollRestorationKey","defaultGetScrollRestorationKey","userKey","resolvedKey","undefined","restoreScrollOptions","storageKey","shouldScrollRestoration","key","_$createComponent","ScriptOnce","children","restoreScroll","toString","JSON","stringify"],"mappings":";;;;AAQO,SAASA,oBAAoB;AAClC,QAAMC,SAASC,UAAAA;AACf,MAAI,CAACD,OAAOE,qBAAqB,CAACF,OAAOG,UAAU;AACjD,WAAO;AAAA,EACT;AACA,MAAI,OAAOH,OAAOI,QAAQC,sBAAsB,YAAY;AAC1D,UAAMC,gBAAgBN,OAAOI,QAAQC,kBAAkB;AAAA,MACrDE,UAAUP,OAAOQ;AAAAA,IAAAA,CAClB;AACD,QAAI,CAACF,eAAe;AAClB,aAAO;AAAA,IACT;AAAA,EACF;AACA,QAAMG,SACJT,OAAOI,QAAQM,2BAA2BC;AAC5C,QAAMC,UAAUH,OAAOT,OAAOQ,cAAc;AAC5C,QAAMK,cACJD,YAAYD,+BAA+BX,OAAOQ,cAAc,IAC5DI,UACAE;AAEN,QAAMC,uBAA4D;AAAA,IAChEC;AAAAA,IACAC,yBAAyB;AAAA,EAAA;AAE3B,MAAIJ,aAAa;AACfE,yBAAqBG,MAAML;AAAAA,EAC7B;AAEA,SAAAM,gBACGC,YAAU;AAAA,IAAA,IACTC,WAAQ;AAAA,aAAE,IAAIC,cAAcC,SAAAA,CAAU,KAAKC,KAAKC,UAAUV,oBAAoB,CAAC;AAAA,IAAG;AAAA,EAAA,CAAA;AAGxF;"}
@@ -14,11 +14,13 @@ export const useTags = () => {
14
14
  const resultMeta = [];
15
15
  const metaByAttribute = {};
16
16
  let title;
17
- [...routeMeta()].reverse().forEach((metas) => {
18
- ;
19
- [...metas].reverse().forEach((m) => {
17
+ const routeMetasArray = routeMeta();
18
+ for (let i = routeMetasArray.length - 1; i >= 0; i--) {
19
+ const metas = routeMetasArray[i];
20
+ for (let j = metas.length - 1; j >= 0; j--) {
21
+ const m = metas[j];
20
22
  if (!m)
21
- return;
23
+ continue;
22
24
  if (m.title) {
23
25
  if (!title) {
24
26
  title = {
@@ -31,7 +33,7 @@ export const useTags = () => {
31
33
  const attribute = m.name ?? m.property;
32
34
  if (attribute) {
33
35
  if (metaByAttribute[attribute]) {
34
- return;
36
+ continue;
35
37
  }
36
38
  else {
37
39
  metaByAttribute[attribute] = true;
@@ -44,8 +46,8 @@ export const useTags = () => {
44
46
  },
45
47
  });
46
48
  }
47
- });
48
- });
49
+ }
50
+ }
49
51
  if (title) {
50
52
  resultMeta.push(title);
51
53
  }
@@ -1 +1 @@
1
- {"version":3,"file":"HeadContent.jsx","sourceRoot":"","sources":["../../src/HeadContent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAGjD,MAAM,CAAC,MAAM,OAAO,GAAG,GAAG,EAAE;IAC1B,MAAM,MAAM,GAAG,SAAS,EAAE,CAAA;IAE1B,MAAM,SAAS,GAAG,cAAc,CAAC;QAC/B,MAAM,EAAE,CAAC,KAAK,EAAE,EAAE;YAChB,OAAO,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAK,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;QAClE,CAAC;KACF,CAAC,CAAA;IAEF,MAAM,IAAI,GAA4C,KAAK,CAAC,UAAU,CAAC,GAAG,EAAE;QAC1E,MAAM,UAAU,GAA4B,EAAE,CAAA;QAC9C,MAAM,eAAe,GAAyB,EAAE,CAAA;QAChD,IAAI,KAAmC,CACtC;QAAA,CAAC,GAAG,SAAS,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;YAC5C,CAAC;YAAA,CAAC,GAAG,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE;gBAClC,IAAI,CAAC,CAAC;oBAAE,OAAM;gBAEd,IAAI,CAAC,CAAC,KAAK,E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YAClB,OAAO,KAAK,CAAA;QACd,CAAC;QACD,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;QACb,OAAO,IAAI,CAAA;IACb,CAAC,CAAC,CAAA;AACJ,CAAC"}
@@ -2,6 +2,6 @@ export function ScriptOnce({ children, }) {
2
2
  if (typeof document !== 'undefined') {
3
3
  return null;
4
4
  }
5
- return (<script class="tsr-once" innerHTML={[children].filter(Boolean).join('\n')}/>);
5
+ return (<script class="$tsr" innerHTML={[children].filter(Boolean).join('\n') + ';$_TSR.c()'}/>);
6
6
  }
7
7
  //# sourceMappingURL=ScriptOnce.jsx.map
@@ -1 +1 @@
1
- {"version":3,"file":"ScriptOnce.jsx","sourceRoot":"","sources":["../../src/ScriptOnce.tsx"],"names":[],"mappings":"AAAA,MAAM,UAAU,UAAU,CAAC,EACzB,QAAQ,GAKT;IACC,IAAI,OAAO,QAAQ,KAAK,WAAW,EAAE,CAAC;QACpC,OAAO,IAAI,CAAA;IACb,CAAC;IAED,OAAO,CACL,CAAC,MAAM,CACL,KAAK,CAAC,UAAU,CAChB,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EACjD,CACH,CAAA;AACH,CAAC"}
1
+ {"version":3,"file":"ScriptOnce.jsx","sourceRoot":"","sources":["../../src/ScriptOnce.tsx"],"names":[],"mappings":"AAAA,MAAM,UAAU,UAAU,CAAC,EACzB,QAAQ,GAKT;IACC,IAAI,OAAO,QAAQ,KAAK,WAAW,EAAE,CAAC;QACpC,OAAO,IAAI,CAAA;IACb,CAAC;IAED,OAAO,CACL,CAAC,MAAM,CACL,KAAK,CAAC,MAAM,CACZ,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,YAAY,CAAC,EAChE,CACH,CAAA;AACH,CAAC"}
@@ -1,5 +1,5 @@
1
- export { defer, TSR_DEFERRED_PROMISE, isMatch, joinPaths, cleanPath, trimPathLeft, trimPathRight, trimPath, resolvePath, parsePathname, interpolatePath, matchPathname, removeBasepath, matchByPath, encode, decode, rootRouteId, defaultSerializeError, defaultParseSearch, defaultStringifySearch, parseSearchWith, stringifySearchWith, pick, functionalUpdate, replaceEqualDeep, isPlainObject, isPlainArray, deepEqual, createControlledPromise, retainSearchParams, stripSearchParams, } from '@tanstack/router-core';
2
- export type { DeferredPromiseState, DeferredPromise, ParsedLocation, RemoveTrailingSlashes, RemoveLeadingSlashes, ActiveOptions, Segment, ResolveRelativePath, RootRouteId, AnyPathParams, ResolveParams, ResolveOptionalParams, ResolveRequiredParams, SearchSchemaInput, AnyContext, RouteContext, PreloadableObj, RoutePathOptions, StaticDataRouteOption, RoutePathOptionsIntersection, UpdatableStaticRouteOption, MetaDescriptor, RouteLinkEntry, ParseParamsFn, SearchFilter, ResolveId, InferFullSearchSchema, InferFullSearchSchemaInput, ErrorRouteProps, ErrorComponentProps, NotFoundRouteProps, TrimPath, TrimPathLeft, TrimPathRight, StringifyParamsFn, ParamsOptions, InferAllParams, InferAllContext, LooseReturnType, LooseAsyncReturnType, ContextReturnType, ContextAsyncReturnType, ResolveLoaderData, ResolveRouteContext, SearchSerializer, SearchParser, TrailingSlashOption, Manifest, RouterManagedTag, ControlledPromise, Constrain, Expand, MergeAll, Assign, IntersectAssign, ResolveValidatorInput, ResolveValidatorOutput, AnyValidator, DefaultValidator, ValidatorFn, AnySchema, AnyValidatorAdapter, AnyValidatorFn, AnyValidatorObj, ResolveValidatorInputFn, ResolveValidatorOutputFn, ResolveSearchValidatorInput, ResolveSearchValidatorInputFn, Validator, ValidatorAdapter, ValidatorObj, NavigateFn, BuildLocationFn, InferDescendantToPaths, RelativeToPath, RelativeToParentPath, RelativeToCurrentPath, Register, AbsoluteToPath, RelativeToPathAutoComplete, NavigateOptions, ToOptions, ToMaskOptions, ToSubOptions, ResolveRoute, SearchParamOptions, PathParamOptions, ToPathOption, LinkOptions, MakeOptionalPathParams, AnyRouterWithContext, ParseRoute, RoutesById, RouteById, RouteIds, RoutesByPath, RouteByPath, RoutePaths, FullSearchSchema, AllParams, AllLoaderData, FullSearchSchemaInput, AllContext, CommitLocationOptions, MatchLocation, ResolveFullSearchSchema, ResolveFullSearchSchemaInput, ResolveAllParamsFromParent, RouteContextParameter, BeforeLoadContextParameter, ResolveAllContext, FullSearchSchemaOption, MakeRemountDepsOptionsUnion, RemountDepsOptions, FileRouteTypes, FileRoutesByPath, UseNavigateResult, AnyRedirect, Redirect, RedirectOptions, ResolvedRedirect, RouteOptions, FileBaseRouteOptions, BaseRouteOptions, UpdatableRouteOptions, RouteLoaderFn, LoaderFnContext, MakeRouteMatch, MakeRouteMatchUnion, RouteMatch, AnyRouteMatch, RouteContextFn, RouteContextOptions, BeforeLoadFn, BeforeLoadContextOptions, ContextOptions, RootRouteOptions, AnyRouteWithContext, LazyRouteOptions, AnyRoute, ResolveFullPath, RouteConstraints, RouterState, ListenerFn, BuildNextOptions, AnyRouter, RegisteredRouter, RouterEvents, RouterEvent, RouterListener, MatchRouteOptions, RouteMask, RouterContextOptions, RouterOptions, RouterConstructorOptions, ControllablePromise, InjectedHtmlEntry, CreateFileRoute, CreateLazyFileRoute, } from '@tanstack/router-core';
1
+ export { defer, TSR_DEFERRED_PROMISE, isMatch, joinPaths, cleanPath, trimPathLeft, trimPathRight, trimPath, resolvePath, parsePathname, interpolatePath, matchPathname, removeBasepath, matchByPath, rootRouteId, defaultSerializeError, defaultParseSearch, defaultStringifySearch, parseSearchWith, stringifySearchWith, functionalUpdate, replaceEqualDeep, isPlainObject, isPlainArray, deepEqual, createControlledPromise, retainSearchParams, stripSearchParams, createSerializationAdapter, } from '@tanstack/router-core';
2
+ export type { DeferredPromiseState, DeferredPromise, ParsedLocation, RemoveTrailingSlashes, RemoveLeadingSlashes, ActiveOptions, Segment, ResolveRelativePath, RootRouteId, AnyPathParams, ResolveParams, ResolveOptionalParams, ResolveRequiredParams, SearchSchemaInput, AnyContext, RouteContext, PreloadableObj, RoutePathOptions, StaticDataRouteOption, RoutePathOptionsIntersection, UpdatableStaticRouteOption, MetaDescriptor, RouteLinkEntry, ParseParamsFn, SearchFilter, ResolveId, InferFullSearchSchema, InferFullSearchSchemaInput, ErrorRouteProps, ErrorComponentProps, NotFoundRouteProps, TrimPath, TrimPathLeft, TrimPathRight, StringifyParamsFn, ParamsOptions, InferAllParams, InferAllContext, LooseReturnType, LooseAsyncReturnType, ContextReturnType, ContextAsyncReturnType, ResolveLoaderData, ResolveRouteContext, SearchSerializer, SearchParser, TrailingSlashOption, Manifest, RouterManagedTag, ControlledPromise, Constrain, Expand, MergeAll, Assign, IntersectAssign, ResolveValidatorInput, ResolveValidatorOutput, AnyValidator, DefaultValidator, ValidatorFn, AnySchema, AnyValidatorAdapter, AnyValidatorFn, AnyValidatorObj, ResolveValidatorInputFn, ResolveValidatorOutputFn, ResolveSearchValidatorInput, ResolveSearchValidatorInputFn, Validator, ValidatorAdapter, ValidatorObj, NavigateFn, BuildLocationFn, InferDescendantToPaths, RelativeToPath, RelativeToParentPath, RelativeToCurrentPath, Register, AbsoluteToPath, RelativeToPathAutoComplete, NavigateOptions, ToOptions, ToMaskOptions, ToSubOptions, ResolveRoute, SearchParamOptions, PathParamOptions, ToPathOption, LinkOptions, MakeOptionalPathParams, AnyRouterWithContext, ParseRoute, RoutesById, RouteById, RouteIds, RoutesByPath, RouteByPath, RoutePaths, FullSearchSchema, AllParams, AllLoaderData, FullSearchSchemaInput, AllContext, CommitLocationOptions, MatchLocation, ResolveFullSearchSchema, ResolveFullSearchSchemaInput, ResolveAllParamsFromParent, RouteContextParameter, BeforeLoadContextParameter, ResolveAllContext, FullSearchSchemaOption, MakeRemountDepsOptionsUnion, RemountDepsOptions, FileRouteTypes, FileRoutesByPath, UseNavigateResult, AnyRedirect, Redirect, RedirectOptions, ResolvedRedirect, RouteOptions, FileBaseRouteOptions, BaseRouteOptions, UpdatableRouteOptions, RouteLoaderFn, LoaderFnContext, MakeRouteMatch, MakeRouteMatchUnion, RouteMatch, AnyRouteMatch, RouteContextFn, RouteContextOptions, BeforeLoadFn, BeforeLoadContextOptions, ContextOptions, RootRouteOptions, AnyRouteWithContext, LazyRouteOptions, AnyRoute, ResolveFullPath, RouteConstraints, RouterState, ListenerFn, BuildNextOptions, AnyRouter, RegisteredRouter, RouterEvents, RouterEvent, RouterListener, MatchRouteOptions, RouteMask, RouterContextOptions, RouterOptions, RouterConstructorOptions, ControllablePromise, InjectedHtmlEntry, CreateFileRoute, CreateLazyFileRoute, Transformer, AnyTransformer, } from '@tanstack/router-core';
3
3
  export { createHistory, createBrowserHistory, createHashHistory, createMemoryHistory, } from '@tanstack/history';
4
4
  export type { BlockerFn, HistoryLocation, RouterHistory, ParsedPath, HistoryState, } from '@tanstack/history';
5
5
  export { useAwaited, Await } from './awaited';
@@ -1,4 +1,4 @@
1
- export { defer, TSR_DEFERRED_PROMISE, isMatch, joinPaths, cleanPath, trimPathLeft, trimPathRight, trimPath, resolvePath, parsePathname, interpolatePath, matchPathname, removeBasepath, matchByPath, encode, decode, rootRouteId, defaultSerializeError, defaultParseSearch, defaultStringifySearch, parseSearchWith, stringifySearchWith, pick, functionalUpdate, replaceEqualDeep, isPlainObject, isPlainArray, deepEqual, createControlledPromise, retainSearchParams, stripSearchParams, } from '@tanstack/router-core';
1
+ export { defer, TSR_DEFERRED_PROMISE, isMatch, joinPaths, cleanPath, trimPathLeft, trimPathRight, trimPath, resolvePath, parsePathname, interpolatePath, matchPathname, removeBasepath, matchByPath, rootRouteId, defaultSerializeError, defaultParseSearch, defaultStringifySearch, parseSearchWith, stringifySearchWith, functionalUpdate, replaceEqualDeep, isPlainObject, isPlainArray, deepEqual, createControlledPromise, retainSearchParams, stripSearchParams, createSerializationAdapter, } from '@tanstack/router-core';
2
2
  export { createHistory, createBrowserHistory, createHashHistory, createMemoryHistory, } from '@tanstack/history';
3
3
  export { useAwaited, Await } from './awaited';
4
4
  export { CatchBoundary, ErrorComponent } from './CatchBoundary';
@@ -1 +1 @@
1
- {"version":3,"file":"index.jsx","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,oBAAoB,EACpB,OAAO,EACP,SAAS,EACT,SAAS,EACT,YAAY,EACZ,aAAa,EACb,QAAQ,EACR,WAAW,EACX,aAAa,EACb,eAAe,EACf,aAAa,EACb,cAAc,EACd,WAAW,EACX,MAAM,EACN,MAAM,EACN,WAAW,EACX,qBAAqB,EACrB,kBAAkB,EAClB,sBAAsB,EACtB,eAAe,EACf,mBAAmB,EACnB,IAAI,EACJ,gBAAgB,EAChB,gBAAgB,EAChB,aAAa,EACb,YAAY,EACZ,SAAS,EACT,uBAAuB,EACvB,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,uBAAuB,CAAA;AAoK9B,OAAO,EACL,aAAa,EACb,oBAAoB,EACpB,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,mBAAmB,CAAA;AAU1B,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,WAAW,CAAA;AAG7C,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAEzC,OAAO,EACL,SAAS,EACT,eAAe,EACf,eAAe,EACf,SAAS,EACT,eAAe,EACf,mBAAmB,GACpB,MAAM,aAAa,CAAA;AAEpB,cAAc,WAAW,CAAA;AAEzB,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAEzD,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAA;AAUpE,OAAO,EACL,OAAO,EACP,aAAa,EACb,UAAU,EACV,UAAU,EACV,gBAAgB,EAChB,eAAe,GAChB,MAAM,WAAW,CAAA;AAIlB,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAA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MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAEvC,OAAO,EACL,gBAAgB,EAAE,MAAM;EACzB,MAAM,iBAAiB,CAAA;AAExB,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAE7C,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAEzC,OAAO,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;AAClE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AA+B5D,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAEzC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA"}
@@ -65,6 +65,6 @@ declare module '@tanstack/router-core' {
65
65
  }
66
66
  }
67
67
  export declare const createRouter: CreateRouterFn;
68
- export declare class Router<in out TRouteTree extends AnyRoute, in out TTrailingSlashOption extends TrailingSlashOption = 'never', in out TDefaultStructuralSharingOption extends boolean = false, in out TRouterHistory extends RouterHistory = RouterHistory, in out TDehydrated extends Record<string, any> = Record<string, any>> extends RouterCore<TRouteTree, TTrailingSlashOption, TDefaultStructuralSharingOption, TRouterHistory, TDehydrated> {
69
- constructor(options: RouterConstructorOptions<TRouteTree, TTrailingSlashOption, TDefaultStructuralSharingOption, TRouterHistory, TDehydrated>);
68
+ export declare class Router<in out TRouteTree extends AnyRoute, in out TTrailingSlashOption extends TrailingSlashOption = 'never', in out TDefaultStructuralSharingOption extends boolean = false, in out TRouterHistory extends RouterHistory = RouterHistory, in out TDehydrated extends Record<string, any> = Record<string, any>, in out TTransformerConfig = any> extends RouterCore<TRouteTree, TTrailingSlashOption, TDefaultStructuralSharingOption, TRouterHistory, TDehydrated, TTransformerConfig> {
69
+ constructor(options: RouterConstructorOptions<TRouteTree, TTrailingSlashOption, TDefaultStructuralSharingOption, TRouterHistory, TDehydrated, TTransformerConfig>);
70
70
  }
@@ -16,6 +16,6 @@ if (typeof globalThis !== 'undefined') {
16
16
  else if (typeof window !== 'undefined') {
17
17
  ;
18
18
  window.createFileRoute = createFileRoute;
19
- window.createFileRoute = createLazyFileRoute;
19
+ window.createLazyFileRoute = createLazyFileRoute;
20
20
  }
21
21
  //# sourceMappingURL=router.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"router.js","sourceRoot":"","sources":["../../src/router.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAClD,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AA0ElE,MAAM,CAAC,MAAM,YAAY,GAAmB,CAAC,OAAO,EAAE,EAAE;IACtD,OAAO,IAAI,MAAM,CAAC,OAAO,CAAC,CAAA;AAC5B,CAAC,CAAA;AAED,MAAM,OAAO,MAMX,SAAQ,UAMT;IACC,YACE,OAMC;QAED,KAAK,CAAC,OAAO,CAAC,CAAA;IAChB,CAAC;CACF;AAED,IAAI,OAAO,UAAU,KAAK,WAAW,EAAE,CAAC;IACtC,CAAC;IAAC,UAAkB,CAAC,eAAe,GAAG,eAAe,CACrD;IAAC,UAAkB,CAAC,mBAAmB,GAAG,mBAAmB,CAAA;AAChE,CAAC;KAAM,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;IACzC,CAAC;IAAC,MAAc,CAAC,eAAe,GAAG,eAAe,CACjD;IAAC,MAAc,CAAC,eAAe,GAAG,mBAAmB,CAAA;AACxD,CAAC"}
1
+ {"version":3,"file":"router.js","sourceRoot":"","sources":["../../src/router.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAClD,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AA0ElE,MAAM,CAAC,MAAM,YAAY,GAAmB,CAAC,OAAO,EAAE,EAAE;IACtD,OAAO,IAAI,MAAM,CAAC,OAAO,CAAC,CAAA;AAC5B,CAAC,CAAA;AAED,MAAM,OAAO,MAOX,SAAQ,UAOT;IACC,YACE,OAOC;QAED,KAAK,CAAC,OAAO,CAAC,CAAA;IAChB,CAAC;CACF;AAED,IAAI,OAAO,UAAU,KAAK,WAAW,EAAE,CAAC;IACtC,CAAC;IAAC,UAAkB,CAAC,eAAe,GAAG,eAAe,CACrD;IAAC,UAAkB,CAAC,mBAAmB,GAAG,mBAAmB,CAAA;AAChE,CAAC;KAAM,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;IACzC,CAAC;IAAC,MAAc,CAAC,eAAe,GAAG,eAAe,CACjD;IAAC,MAAc,CAAC,mBAAmB,GAAG,mBAAmB,CAAA;AAC5D,CAAC"}
@@ -3,14 +3,22 @@ import { useRouter } from './useRouter';
3
3
  import { ScriptOnce } from './ScriptOnce';
4
4
  export function ScrollRestoration() {
5
5
  const router = useRouter();
6
+ if (!router.isScrollRestoring || !router.isServer) {
7
+ return null;
8
+ }
9
+ if (typeof router.options.scrollRestoration === 'function') {
10
+ const shouldRestore = router.options.scrollRestoration({
11
+ location: router.latestLocation,
12
+ });
13
+ if (!shouldRestore) {
14
+ return null;
15
+ }
16
+ }
6
17
  const getKey = router.options.getScrollRestorationKey || defaultGetScrollRestorationKey;
7
18
  const userKey = getKey(router.latestLocation);
8
19
  const resolvedKey = userKey !== defaultGetScrollRestorationKey(router.latestLocation)
9
20
  ? userKey
10
21
  : undefined;
11
- if (!router.isScrollRestoring || !router.isServer) {
12
- return null;
13
- }
14
22
  const restoreScrollOptions = {
15
23
  storageKey,
16
24
  shouldScrollRestoration: true,
@@ -1 +1 @@
1
- {"version":3,"file":"scroll-restoration.jsx","sourceRoot":"","sources":["../../src/scroll-restoration.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,8BAA8B,EAC9B,aAAa,EACb,UAAU,GACX,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAEzC,MAAM,UAAU,iBAAiB;IAC/B,MAAM,MAAM,GAAG,SAAS,EAAE,CAAA;IAC1B,MAAM,MAAM,GACV,MAAM,CAAC,OAAO,CAAC,uBAAuB,IAAI,8BAA8B,CAAA;IAC1E,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,CAAA;IAC7C,MAAM,WAAW,GACf,OAAO,KAAK,8BAA8B,CAAC,MAAM,CAAC,cAAc,CAAC;QAC/D,CAAC,CAAC,OAAO;QACT,CAAC,CAAC,SAAS,CAAA;IAEf,IAAI,CAAC,MAAM,CAAC,iBAAiB,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;QAClD,OAAO,IAAI,CAAA;IACb,CAAC;IAED,MAAM,oBAAoB,GAAwC;QAChE,UAAU;QACV,uBAAuB,EAAE,IAAI;KAC9B,CAAA;IACD,IAAI,WAAW,EAAE,CAAC;QAChB,oBAAoB,CAAC,GAAG,GAAG,WAAW,CAAA;IACxC,CAAC;IAED,OAAO,CACL,CAAC,UAAU,CACT,QAAQ,CAAC,CAAC,IAAI,aAAa,CAAC,QAAQ,EAAE,KAAK,IAAI,CAAC,SAAS,CAAC,oBAAoB,CAAC,GAAG,CAAC,EACnF,CACH,CAAA;AACH,CAAC"}
1
+ {"version":3,"file":"scroll-restoration.jsx","sourceRoot":"","sources":["../../src/scroll-restoration.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,8BAA8B,EAC9B,aAAa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
1
1
  {
2
2
  "name": "@tanstack/solid-router",
3
- "version": "1.132.0-alpha.2",
3
+ "version": "1.132.0-alpha.4",
4
4
  "description": "Modern and scalable routing for Solid applications",
5
5
  "author": "Tanner Linsley",
6
6
  "license": "MIT",
@@ -88,8 +88,8 @@
88
88
  "isbot": "^5.1.22",
89
89
  "tiny-invariant": "^1.3.3",
90
90
  "tiny-warning": "^1.0.3",
91
- "@tanstack/router-core": "1.132.0-alpha.2",
92
- "@tanstack/history": "1.132.0-alpha.1"
91
+ "@tanstack/history": "1.132.0-alpha.1",
92
+ "@tanstack/router-core": "1.132.0-alpha.4"
93
93
  },
94
94
  "devDependencies": {
95
95
  "@solidjs/testing-library": "^0.8.10",
@@ -18,9 +18,12 @@ export const useTags = () => {
18
18
  const resultMeta: Array<RouterManagedTag> = []
19
19
  const metaByAttribute: Record<string, true> = {}
20
20
  let title: RouterManagedTag | undefined
21
- ;[...routeMeta()].reverse().forEach((metas) => {
22
- ;[...metas].reverse().forEach((m) => {
23
- if (!m) return
21
+ const routeMetasArray = routeMeta()
22
+ for (let i = routeMetasArray.length - 1; i >= 0; i--) {
23
+ const metas = routeMetasArray[i]!
24
+ for (let j = metas.length - 1; j >= 0; j--) {
25
+ const m = metas[j]
26
+ if (!m) continue
24
27
 
25
28
  if (m.title) {
26
29
  if (!title) {
@@ -33,7 +36,7 @@ export const useTags = () => {
33
36
  const attribute = m.name ?? m.property
34
37
  if (attribute) {
35
38
  if (metaByAttribute[attribute]) {
36
- return
39
+ continue
37
40
  } else {
38
41
  metaByAttribute[attribute] = true
39
42
  }
@@ -46,8 +49,8 @@ export const useTags = () => {
46
49
  },
47
50
  })
48
51
  }
49
- })
50
- })
52
+ }
53
+ }
51
54
 
52
55
  if (title) {
53
56
  resultMeta.push(title)
@@ -11,8 +11,8 @@ export function ScriptOnce({
11
11
 
12
12
  return (
13
13
  <script
14
- class="tsr-once"
15
- innerHTML={[children].filter(Boolean).join('\n')}
14
+ class="$tsr"
15
+ innerHTML={[children].filter(Boolean).join('\n') + ';$_TSR.c()'}
16
16
  />
17
17
  )
18
18
  }
package/src/index.tsx CHANGED
@@ -13,15 +13,12 @@ export {
13
13
  matchPathname,
14
14
  removeBasepath,
15
15
  matchByPath,
16
- encode,
17
- decode,
18
16
  rootRouteId,
19
17
  defaultSerializeError,
20
18
  defaultParseSearch,
21
19
  defaultStringifySearch,
22
20
  parseSearchWith,
23
21
  stringifySearchWith,
24
- pick,
25
22
  functionalUpdate,
26
23
  replaceEqualDeep,
27
24
  isPlainObject,
@@ -30,6 +27,7 @@ export {
30
27
  createControlledPromise,
31
28
  retainSearchParams,
32
29
  stripSearchParams,
30
+ createSerializationAdapter,
33
31
  } from '@tanstack/router-core'
34
32
 
35
33
  export type {
@@ -192,6 +190,8 @@ export type {
192
190
  InjectedHtmlEntry,
193
191
  CreateFileRoute,
194
192
  CreateLazyFileRoute,
193
+ Transformer,
194
+ AnyTransformer,
195
195
  } from '@tanstack/router-core'
196
196
 
197
197
  export {
package/src/router.ts CHANGED
@@ -83,12 +83,14 @@ export class Router<
83
83
  in out TDefaultStructuralSharingOption extends boolean = false,
84
84
  in out TRouterHistory extends RouterHistory = RouterHistory,
85
85
  in out TDehydrated extends Record<string, any> = Record<string, any>,
86
+ in out TTransformerConfig = any,
86
87
  > extends RouterCore<
87
88
  TRouteTree,
88
89
  TTrailingSlashOption,
89
90
  TDefaultStructuralSharingOption,
90
91
  TRouterHistory,
91
- TDehydrated
92
+ TDehydrated,
93
+ TTransformerConfig
92
94
  > {
93
95
  constructor(
94
96
  options: RouterConstructorOptions<
@@ -96,7 +98,8 @@ export class Router<
96
98
  TTrailingSlashOption,
97
99
  TDefaultStructuralSharingOption,
98
100
  TRouterHistory,
99
- TDehydrated
101
+ TDehydrated,
102
+ TTransformerConfig
100
103
  >,
101
104
  ) {
102
105
  super(options)
@@ -108,5 +111,5 @@ if (typeof globalThis !== 'undefined') {
108
111
  ;(globalThis as any).createLazyFileRoute = createLazyFileRoute
109
112
  } else if (typeof window !== 'undefined') {
110
113
  ;(window as any).createFileRoute = createFileRoute
111
- ;(window as any).createFileRoute = createLazyFileRoute
114
+ ;(window as any).createLazyFileRoute = createLazyFileRoute
112
115
  }
@@ -8,6 +8,17 @@ import { ScriptOnce } from './ScriptOnce'
8
8
 
9
9
  export function ScrollRestoration() {
10
10
  const router = useRouter()
11
+ if (!router.isScrollRestoring || !router.isServer) {
12
+ return null
13
+ }
14
+ if (typeof router.options.scrollRestoration === 'function') {
15
+ const shouldRestore = router.options.scrollRestoration({
16
+ location: router.latestLocation,
17
+ })
18
+ if (!shouldRestore) {
19
+ return null
20
+ }
21
+ }
11
22
  const getKey =
12
23
  router.options.getScrollRestorationKey || defaultGetScrollRestorationKey
13
24
  const userKey = getKey(router.latestLocation)
@@ -16,10 +27,6 @@ export function ScrollRestoration() {
16
27
  ? userKey
17
28
  : undefined
18
29
 
19
- if (!router.isScrollRestoring || !router.isServer) {
20
- return null
21
- }
22
-
23
30
  const restoreScrollOptions: Parameters<typeof restoreScroll>[0] = {
24
31
  storageKey,
25
32
  shouldScrollRestoration: true,