@benjavicente/angular-router-experimental 1.142.13 → 1.142.14

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.
@@ -1,7 +1,6 @@
1
1
  import { batch as e, createAtom as t } from "@tanstack/store";
2
2
  import * as n from "@angular/core";
3
- import { ChangeDetectionStrategy as r, DestroyRef as i, ElementRef as a, EnvironmentInjector as o, InjectionToken as s, Injector as c, Renderer2 as l, ViewContainerRef as u, afterNextRender as d, assertInInjectionContext as f, computed as p, effect as m, inject as h, input as g, inputBinding as _, isDevMode as v, linkedSignal as y, runInInjectionContext as b, signal as x, untracked as S } from "@angular/core";
4
- import { DOCUMENT as C } from "@angular/common";
3
+ import { ChangeDetectionStrategy as r, DOCUMENT as i, DestroyRef as a, ElementRef as o, EnvironmentInjector as s, InjectionToken as c, Injector as l, Renderer2 as u, ViewContainerRef as d, afterNextRender as f, assertInInjectionContext as p, computed as m, effect as h, inject as g, input as _, inputBinding as v, isDevMode as y, linkedSignal as b, runInInjectionContext as x, signal as S, untracked as C } from "@angular/core";
5
4
  //#region ../router-core/dist/esm/utils.js
6
5
  function w(e) {
7
6
  return e[e.length - 1];
@@ -2707,12 +2706,12 @@ function q(e) {
2707
2706
  //#endregion
2708
2707
  //#region src/store/injectSelector.ts
2709
2708
  function En(e, t) {
2710
- return t || (f(e), h(c));
2709
+ return t || (p(e), g(l));
2711
2710
  }
2712
2711
  function Dn(e, t = (e) => e, n) {
2713
- return b(En(Dn, n?.injector), () => {
2714
- let r = typeof e == "function" ? e : () => e, i = y(() => t(r().get()), { equal: n?.compare });
2715
- return m((e) => {
2712
+ return x(En(Dn, n?.injector), () => {
2713
+ let r = typeof e == "function" ? e : () => e, i = b(() => t(r().get()), { equal: n?.compare });
2714
+ return h((e) => {
2716
2715
  let { unsubscribe: n } = r().subscribe((e) => {
2717
2716
  i.set(t(e));
2718
2717
  });
@@ -2955,22 +2954,22 @@ function qn(e) {
2955
2954
  //#endregion
2956
2955
  //#region src/renderer/injectRender.ts
2957
2956
  function Jn(e) {
2958
- let t = h(u), n = h(c), r = [];
2959
- m(() => {
2957
+ let t = g(d), n = g(l), r = [];
2958
+ h(() => {
2960
2959
  let i = e(), a = Yn(i);
2961
2960
  if (Xn(r, a)) return;
2962
2961
  r.length > 0 && t.clear(), r = a;
2963
2962
  let o = i?.component;
2964
2963
  if (!o) return;
2965
- let s = i.providers ?? [], l = c.create({
2964
+ let s = i.providers ?? [], c = l.create({
2966
2965
  providers: s,
2967
2966
  parent: n
2968
- }), u = Object.entries(i.inputs ?? {}).map(([e, t]) => _(e, t));
2967
+ }), u = Object.entries(i.inputs ?? {}).map(([e, t]) => v(e, t));
2969
2968
  t.createComponent(o, {
2970
- injector: l,
2969
+ injector: c,
2971
2970
  bindings: u
2972
2971
  }).changeDetectorRef.markForCheck();
2973
- }), h(i).onDestroy(() => {
2972
+ }), g(a).onDestroy(() => {
2974
2973
  t.clear();
2975
2974
  });
2976
2975
  }
@@ -3044,7 +3043,7 @@ var nr = {
3044
3043
  subscribe: () => ({ unsubscribe: () => {} })
3045
3044
  }, rr = class e {
3046
3045
  constructor() {
3047
- this.state = h(Qn), this.message = p(() => {
3046
+ this.state = g(Qn), this.message = m(() => {
3048
3047
  let e = this.state.error;
3049
3048
  return e instanceof Error ? e.stack ?? e.message : String(e);
3050
3049
  });
@@ -3069,14 +3068,14 @@ var nr = {
3069
3068
  }
3070
3069
  };
3071
3070
  function ir({ parentRouteIsRoot: e }) {
3072
- let t = q({ warn: !1 }), n = h(o), r = h(i), a = J(t.stores.resolvedLocation, (e) => e?.state?.__TSR_key), s = J(t.stores.loadedAt, (e) => e), c, l = 0;
3071
+ let t = q({ warn: !1 }), n = g(s), r = g(a), i = J(t.stores.resolvedLocation, (e) => e?.state?.__TSR_key), o = J(t.stores.loadedAt, (e) => e), c, l = 0;
3073
3072
  r.onDestroy(() => {
3074
3073
  l++;
3075
- }), m(() => {
3074
+ }), h(() => {
3076
3075
  if (!e()) return;
3077
- a(), s();
3076
+ i(), o();
3078
3077
  let r = ++l;
3079
- d({ read: () => {
3078
+ f({ read: () => {
3080
3079
  if (r !== l || !e() || t.isServer) return;
3081
3080
  let n = t.latestLocation.href;
3082
3081
  c !== void 0 && c === n || (c = n, t.emit({
@@ -3088,7 +3087,7 @@ function ir({ parentRouteIsRoot: e }) {
3088
3087
  }
3089
3088
  var ar = class e {
3090
3089
  constructor() {
3091
- this.matchId = g.required(), this.router = q(), this.match = p(() => this.matchSignal()), this.matchSignal = J(() => this.router.stores.matchStores.get(this.matchId()) ?? nr, (e) => e), this.matchData = p(() => {
3090
+ this.matchId = _.required(), this.router = q(), this.match = m(() => this.matchSignal()), this.matchSignal = J(() => this.router.stores.matchStores.get(this.matchId()) ?? nr, (e) => e), this.matchData = m(() => {
3092
3091
  let e = this.match();
3093
3092
  if (!e) return null;
3094
3093
  let t = e.routeId, n = this.router.routesById[t], r = n.parentRoute?.id ?? null, i = (n.options.remountDeps ?? this.router.options.defaultRemountDeps)?.({
@@ -3103,18 +3102,18 @@ var ar = class e {
3103
3102
  match: e,
3104
3103
  parentRouteId: r
3105
3104
  };
3106
- }), this.isFistRouteInRouteTree = p(() => this.matchData()?.parentRouteId === L), this.resolvedNoSsr = p(() => {
3105
+ }), this.isFistRouteInRouteTree = m(() => this.matchData()?.parentRouteId === L), this.resolvedNoSsr = m(() => {
3107
3106
  let e = this.matchData()?.match;
3108
3107
  return e ? e.ssr === !1 || e.ssr === "data-only" : !0;
3109
- }), this.shouldClientOnly = p(() => {
3108
+ }), this.shouldClientOnly = m(() => {
3110
3109
  let e = this.matchData()?.match;
3111
3110
  return e ? this.resolvedNoSsr() || !!e._displayPending : !0;
3112
- }), this.parentRouteIdSignal = p(() => this.matchData()?.parentRouteId ?? ""), this.rootRouteIdSignal = p(() => L), this.hasPendingMatch = p(() => {
3111
+ }), this.parentRouteIdSignal = m(() => this.matchData()?.parentRouteId ?? ""), this.rootRouteIdSignal = m(() => L), this.hasPendingMatch = m(() => {
3113
3112
  let e = this.matchData()?.route.id;
3114
3113
  return e ? !!this.pendingRouteIds()[e] : !1;
3115
3114
  }), this.pendingRouteIds = J(this.router.stores.pendingRouteIds, (e) => e), this.nearestMatchContext = {
3116
3115
  matchId: this.matchId,
3117
- routeId: p(() => this.matchData()?.route.id),
3116
+ routeId: m(() => this.matchData()?.route.id),
3118
3117
  match: this.match,
3119
3118
  hasPending: this.hasPendingMatch
3120
3119
  }, this.catchingErrorMatch = tr({ matchId: this.matchId }), this.render = Jn(() => {
@@ -3162,7 +3161,7 @@ var ar = class e {
3162
3161
  }]
3163
3162
  };
3164
3163
  }
3165
- }), this.onRendered = ir({ parentRouteIsRoot: p(() => this.parentRouteIdSignal() === L) });
3164
+ }), this.onRendered = ir({ parentRouteIsRoot: m(() => this.parentRouteIdSignal() === L) });
3166
3165
  }
3167
3166
  static {
3168
3167
  this.ɵfac = function(t) {
@@ -3191,10 +3190,10 @@ var ar = class e {
3191
3190
  }
3192
3191
  }, or = class e {
3193
3192
  constructor() {
3194
- this.router = q(), this.nearestMatch = h(K), this.currentMatch = J(() => {
3193
+ this.router = q(), this.nearestMatch = g(K), this.currentMatch = J(() => {
3195
3194
  let e = this.nearestMatch.matchId();
3196
3195
  return e ? this.router.stores.matchStores.get(e) ?? nr : nr;
3197
- }, (e) => e), this.routeId = p(() => this.currentMatch()?.routeId), this.route = p(() => this.router.routesById[this.routeId()]), this.parentGlobalNotFound = p(() => this.currentMatch()?.globalNotFound ?? !1), this.childMatchIdByRouteId = J(this.router.stores.childMatchIdByRouteId, (e) => e), this.childMatchId = p(() => {
3196
+ }, (e) => e), this.routeId = m(() => this.currentMatch()?.routeId), this.route = m(() => this.router.routesById[this.routeId()]), this.parentGlobalNotFound = m(() => this.currentMatch()?.globalNotFound ?? !1), this.childMatchIdByRouteId = J(this.router.stores.childMatchIdByRouteId, (e) => e), this.childMatchId = m(() => {
3198
3197
  let e = this.routeId();
3199
3198
  return e ? this.childMatchIdByRouteId()[e] ?? null : null;
3200
3199
  }), this.render = Jn(() => this.parentGlobalNotFound() ? { component: sr(this.router, this.route()) } : this.childMatchId() ? {
@@ -3227,10 +3226,10 @@ function Z(e) {
3227
3226
  return typeof e == "function" ? e() : e;
3228
3227
  }
3229
3228
  function sr(e, t) {
3230
- return (Z(t.options.notFoundComponent) ?? Z(e.options.defaultNotFoundComponent)) || (v() && !t.options.notFoundComponent && console.warn(`A notFoundError was encountered on the route with ID "${t.id}", but a notFoundComponent option was not configured, nor was a router level defaultNotFoundComponent configured. Consider configuring at least one of these to avoid TanStack Router's overly generic defaultNotFoundComponent (<p>Page not found</p>)`), Zn);
3229
+ return (Z(t.options.notFoundComponent) ?? Z(e.options.defaultNotFoundComponent)) || (y() && !t.options.notFoundComponent && console.warn(`A notFoundError was encountered on the route with ID "${t.id}", but a notFoundComponent option was not configured, nor was a router level defaultNotFoundComponent configured. Consider configuring at least one of these to avoid TanStack Router's overly generic defaultNotFoundComponent (<p>Page not found</p>)`), Zn);
3231
3230
  }
3232
3231
  function cr(e, t) {
3233
- return (Z(t.options.errorComponent) ?? Z(e.options.defaultErrorComponent)) || (v() && !t.options.errorComponent && console.warn(`An error was encountered on the route with ID "${t.id}", but an errorComponent option was not configured, nor was a router level defaultErrorComponent configured. Consider configuring at least one of these to avoid TanStack Router's generic defaultErrorComponent.`), rr);
3232
+ return (Z(t.options.errorComponent) ?? Z(e.options.defaultErrorComponent)) || (y() && !t.options.errorComponent && console.warn(`An error was encountered on the route with ID "${t.id}", but an errorComponent option was not configured, nor was a router level defaultErrorComponent configured. Consider configuring at least one of these to avoid TanStack Router's generic defaultErrorComponent.`), rr);
3234
3233
  }
3235
3234
  //#endregion
3236
3235
  //#region ../router-core/dist/esm/scroll-restoration-script/client.js
@@ -3241,8 +3240,8 @@ function lr(e) {
3241
3240
  //#region src/ssr-scroll-restoration.ts
3242
3241
  var ur = "data-tsr-scroll-restoration-inline";
3243
3242
  function dr() {
3244
- let e = q(), t = h(C), n = h(o);
3245
- e.isServer && d(() => {
3243
+ let e = q(), t = g(i), n = g(s);
3244
+ e.isServer && f(() => {
3246
3245
  let n = e.options.scrollRestoration;
3247
3246
  if (!n || typeof n == "function" && !n({ location: e.latestLocation }) || t.querySelector(`script[${ur}]`)) return;
3248
3247
  let r = lr(e);
@@ -3367,15 +3366,15 @@ var hr = class e {
3367
3366
  encapsulation: 2
3368
3367
  });
3369
3368
  }
3370
- }, gr = new s("CONTEXT", {
3369
+ }, gr = new c("CONTEXT", {
3371
3370
  providedIn: "root",
3372
3371
  factory: () => ({})
3373
- }), _r = new s("OPTIONS", {
3372
+ }), _r = new c("OPTIONS", {
3374
3373
  providedIn: "root",
3375
3374
  factory: () => ({})
3376
3375
  });
3377
3376
  function vr(e) {
3378
- let t = h(o);
3377
+ let t = g(s);
3379
3378
  return {
3380
3379
  inject: t.get.bind(t),
3381
3380
  ...e
@@ -3399,12 +3398,12 @@ function yr({ router: e, context: t, options: n }) {
3399
3398
  }
3400
3399
  var br = class e {
3401
3400
  constructor() {
3402
- this.injectedContext = h(gr), this.injectedOptions = h(_r), this.injectedRouter = h(Tn(), { optional: !0 }), this.context = g(this.injectedContext), this.options = g(this.injectedOptions), this.routerInput = g(void 0, { alias: "router" }), this.router = p(() => {
3401
+ this.injectedContext = g(gr), this.injectedOptions = g(_r), this.injectedRouter = g(Tn(), { optional: !0 }), this.context = _(this.injectedContext), this.options = _(this.injectedOptions), this.routerInput = _(void 0, { alias: "router" }), this.router = m(() => {
3403
3402
  let e = this.routerInput();
3404
3403
  if (e) return e;
3405
3404
  if (this.injectedRouter) return this.injectedRouter;
3406
3405
  throw Error("No router provided to <router-provider>. Provide a router with provideTanstackRouter or the router input");
3407
- }), this.updateRouter = m(() => {
3406
+ }), this.updateRouter = h(() => {
3408
3407
  let e = this.router(), t = this.context(), n = this.options();
3409
3408
  e.update({
3410
3409
  ...e.options,
@@ -3415,7 +3414,7 @@ var br = class e {
3415
3414
  }
3416
3415
  });
3417
3416
  }), this.render = Jn(() => {
3418
- let e = S(this.router);
3417
+ let e = C(this.router);
3419
3418
  return {
3420
3419
  component: hr,
3421
3420
  providers: [{
@@ -3749,7 +3748,7 @@ function Zr({ document: e, initialTitle: t, headCollection: n, bodyCollection: r
3749
3748
  i.title === void 0 ? e.title = t : e.title = i.title, n.sync(i.head), r.sync(i.body);
3750
3749
  }
3751
3750
  function Qr(e) {
3752
- let t = n.inject(C), r = n.inject(n.RendererFactory2, { optional: !0 }), i = n.inject(n.DestroyRef), a = J(e.stores.matches, (e) => e), o = r?.createRenderer(null, null) ?? null, s = t.title, c = Dr({
3751
+ let t = n.inject(n.DOCUMENT), r = n.inject(n.RendererFactory2, { optional: !0 }), i = n.inject(n.DestroyRef), a = J(e.stores.matches, (e) => e), o = r?.createRenderer(null, null) ?? null, s = t.title, c = Dr({
3753
3752
  root: t.head,
3754
3753
  bucket: "head",
3755
3754
  renderer: o
@@ -3785,7 +3784,7 @@ function Qr(e) {
3785
3784
  //#endregion
3786
3785
  //#region src/document/provide-tanstack-body-managed-tags.ts
3787
3786
  function $r(e) {
3788
- let t = n.inject(C), r = n.inject(n.RendererFactory2, { optional: !0 }), i = n.inject(n.DestroyRef), a = J(e.stores.matches, (e) => e), o = Ir(e), s = () => o.length === 0 ? $(e).body : Tr([...o, ...$(e).body]), c = r?.createRenderer(null, null) ?? null, l = Dr({
3787
+ let t = n.inject(n.DOCUMENT), r = n.inject(n.RendererFactory2, { optional: !0 }), i = n.inject(n.DestroyRef), a = J(e.stores.matches, (e) => e), o = Ir(e), s = () => o.length === 0 ? $(e).body : Tr([...o, ...$(e).body]), c = r?.createRenderer(null, null) ?? null, l = Dr({
3789
3788
  root: t.body,
3790
3789
  bucket: "body",
3791
3790
  renderer: c
@@ -3814,7 +3813,7 @@ function ti(e) {
3814
3813
  //#endregion
3815
3814
  //#region src/document/provide-tanstack-document-title.ts
3816
3815
  function ni(e) {
3817
- let t = n.inject(C), r = n.inject(n.DestroyRef), i = J(e.stores.matches, (e) => e), a = t.title, o = $(e).title, s = (e) => {
3816
+ let t = n.inject(n.DOCUMENT), r = n.inject(n.DestroyRef), i = J(e.stores.matches, (e) => e), a = t.title, o = $(e).title, s = (e) => {
3818
3817
  e === void 0 ? t.title = a : t.title = e;
3819
3818
  };
3820
3819
  s(o);
@@ -3839,7 +3838,7 @@ function ii(e) {
3839
3838
  //#endregion
3840
3839
  //#region src/document/provide-tanstack-head-managed-tags.ts
3841
3840
  function ai(e) {
3842
- let t = n.inject(C), r = n.inject(n.RendererFactory2, { optional: !0 }), i = n.inject(n.DestroyRef), a = J(e.stores.matches, (e) => e), o = r?.createRenderer(null, null) ?? null, s = Dr({
3841
+ let t = n.inject(n.DOCUMENT), r = n.inject(n.RendererFactory2, { optional: !0 }), i = n.inject(n.DestroyRef), a = J(e.stores.matches, (e) => e), o = r?.createRenderer(null, null) ?? null, s = Dr({
3843
3842
  root: t.head,
3844
3843
  bucket: "head",
3845
3844
  renderer: o
@@ -3931,7 +3930,7 @@ function mi() {
3931
3930
  //#region src/injectIsShell.ts
3932
3931
  function hi() {
3933
3932
  let e = q();
3934
- return p(() => e.isShell());
3933
+ return m(() => e.isShell());
3935
3934
  }
3936
3935
  //#endregion
3937
3936
  //#region src/injectLocation.ts
@@ -4024,32 +4023,32 @@ function yi(e, t, r) {
4024
4023
  //#region src/Link.ts
4025
4024
  var bi = class e {
4026
4025
  constructor() {
4027
- this.passiveEvents = Si(() => ({ touchstart: this.handleTouchStart })), this.options = g.required({ alias: "link" }), this.router = q(), this.isTransitioning = x(!1), this.from = p(() => S(() => this.options().from)), this.disabled = p(() => this._options().disabled ?? !1), this.target = p(() => this._options().target), this._options = p(() => ({
4026
+ this.passiveEvents = Si(() => ({ touchstart: this.handleTouchStart })), this.options = _.required({ alias: "link" }), this.router = q(), this.isTransitioning = S(!1), this.from = m(() => C(() => this.options().from)), this.disabled = m(() => this._options().disabled ?? !1), this.target = m(() => this._options().target), this._options = m(() => ({
4028
4027
  ...this.options(),
4029
4028
  from: this.from()
4030
- })), this.nextLocation = p(() => {
4029
+ })), this.nextLocation = m(() => {
4031
4030
  let e = this.location();
4032
4031
  return this.router.buildLocation({
4033
4032
  _fromLocation: e,
4034
4033
  ...this._options()
4035
4034
  });
4036
- }), this.hrefOption = p(() => {
4035
+ }), this.hrefOption = m(() => {
4037
4036
  if (this._options().disabled) return;
4038
4037
  let e = this.nextLocation().maskedLocation ?? this.nextLocation(), t = e.external;
4039
4038
  return {
4040
4039
  href: t ? e.publicHref : this.router.history.createHref(e.publicHref) || "/",
4041
4040
  external: t
4042
4041
  };
4043
- }), this.externalLink = p(() => {
4042
+ }), this.externalLink = m(() => {
4044
4043
  let e = this.hrefOption();
4045
4044
  if (e?.external) return e.href;
4046
4045
  try {
4047
4046
  return new URL(this.options().to), this.options().to;
4048
4047
  } catch {}
4049
- }), this.preload = p(() => this.options().reloadDocument ? !1 : this.options().preload ?? this.router.options.defaultPreload), this.preloadDelay = p(() => this.options().preloadDelay ?? this.router.options.defaultPreloadDelay ?? 0), this.location = gi(), this.isActiveProps = p(() => {
4048
+ }), this.preload = m(() => this.options().reloadDocument ? !1 : this.options().preload ?? this.router.options.defaultPreload), this.preloadDelay = m(() => this.options().preloadDelay ?? this.router.options.defaultPreloadDelay ?? 0), this.location = gi(), this.isActiveProps = m(() => {
4050
4049
  let e = this.options(), t = this.isActive() ? e.activeProps : e.inactiveProps;
4051
4050
  if (!(!t || typeof t != "object")) return t;
4052
- }), this.isActive = p(() => {
4051
+ }), this.isActive = m(() => {
4053
4052
  if (this.externalLink()) return !1;
4054
4053
  let e = this.options().activeOptions;
4055
4054
  if (e?.exact) {
@@ -4068,7 +4067,7 @@ var bi = class e {
4068
4067
  });
4069
4068
  }, this.preloadViewportIoCallback = (e) => {
4070
4069
  e?.isIntersecting && this.doPreload();
4071
- }, this.viewportPreloader = yi(this.preloadViewportIoCallback, { rootMargin: "100px" }, () => !!this._options().disabled || this.preload() !== "viewport"), this.hasRenderFetched = !1, this.rendererPreloader = m(() => {
4070
+ }, this.viewportPreloader = yi(this.preloadViewportIoCallback, { rootMargin: "100px" }, () => !!this._options().disabled || this.preload() !== "viewport"), this.hasRenderFetched = !1, this.rendererPreloader = h(() => {
4072
4071
  this.hasRenderFetched || !this._options().disabled && this.preload() === "render" && (this.doPreload(), this.hasRenderFetched = !0);
4073
4072
  }), this.handleClick = (e) => {
4074
4073
  let t = e.currentTarget.getAttribute("target"), n = this._options().target, r = n === void 0 ? t : n;
@@ -4141,14 +4140,14 @@ function xi(e) {
4141
4140
  return !!(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey);
4142
4141
  }
4143
4142
  function Si(e) {
4144
- let t = h(a).nativeElement, n = h(i), r = h(l), o = [];
4145
- d(() => {
4146
- for (let [n, i] of Object.entries(e())) {
4147
- let e = r.listen(t, n, i, { passive: !0 });
4148
- o.push(e);
4143
+ let t = g(o).nativeElement, n = g(a), r = g(u), i = [];
4144
+ f(() => {
4145
+ for (let [n, a] of Object.entries(e())) {
4146
+ let e = r.listen(t, n, a, { passive: !0 });
4147
+ i.push(e);
4149
4148
  }
4150
4149
  }), n.onDestroy(() => {
4151
- for (; o.length;) o.pop()?.();
4150
+ for (; i.length;) i.pop()?.();
4152
4151
  });
4153
4152
  }
4154
4153
  //#endregion
@@ -22,6 +22,40 @@ export declare function injectRouteErrorHandler<TRouter extends AnyRouter = Regi
22
22
  export { }
23
23
 
24
24
 
25
+ declare module '@benjavicente/router-core' {
26
+ interface LazyRoute<in out TRoute extends AnyRoute> {
27
+ injectMatch: InjectMatchRoute<TRoute['id']>;
28
+ injectRouteContext: InjectRouteContextRoute<TRoute['id']>;
29
+ injectSearch: InjectSearchRoute<TRoute['id']>;
30
+ injectParams: InjectParamsRoute<TRoute['id']>;
31
+ injectLoaderDeps: InjectLoaderDepsRoute<TRoute['id']>;
32
+ injectLoaderData: InjectLoaderDataRoute<TRoute['id']>;
33
+ injectNavigate: () => UseNavigateResult<TRoute['fullPath']>;
34
+ }
35
+ }
36
+
37
+
38
+ declare module '@benjavicente/router-core' {
39
+ interface UpdatableRouteOptionsExtensions {
40
+ component?: RouteComponent;
41
+ errorComponent?: false | null | undefined | ErrorRouteComponent;
42
+ notFoundComponent?: NotFoundRouteComponent;
43
+ pendingComponent?: RouteComponent;
44
+ }
45
+ interface RootRouteOptionsExtensions {
46
+ }
47
+ interface RouteExtensions<in out TId extends string, in out TFullPath extends string> {
48
+ injectMatch: InjectMatchRoute<TId>;
49
+ injectRouteContext: InjectRouteContextRoute<TId>;
50
+ injectSearch: InjectSearchRoute<TId>;
51
+ injectParams: InjectParamsRoute<TId>;
52
+ injectLoaderDeps: InjectLoaderDepsRoute<TId>;
53
+ injectLoaderData: InjectLoaderDataRoute<TId>;
54
+ injectNavigate: () => UseNavigateResult<TFullPath>;
55
+ }
56
+ }
57
+
58
+
25
59
  declare module '@benjavicente/router-core' {
26
60
  interface RouterOptionsExtensions {
27
61
  /**
@@ -58,36 +92,9 @@ declare module '@benjavicente/router-core' {
58
92
  }
59
93
 
60
94
 
61
- declare module '@benjavicente/router-core' {
62
- interface UpdatableRouteOptionsExtensions {
63
- component?: RouteComponent;
64
- errorComponent?: false | null | undefined | ErrorRouteComponent;
65
- notFoundComponent?: NotFoundRouteComponent;
66
- pendingComponent?: RouteComponent;
67
- }
68
- interface RootRouteOptionsExtensions {
69
- }
70
- interface RouteExtensions<in out TId extends string, in out TFullPath extends string> {
71
- injectMatch: InjectMatchRoute<TId>;
72
- injectRouteContext: InjectRouteContextRoute<TId>;
73
- injectSearch: InjectSearchRoute<TId>;
74
- injectParams: InjectParamsRoute<TId>;
75
- injectLoaderDeps: InjectLoaderDepsRoute<TId>;
76
- injectLoaderData: InjectLoaderDataRoute<TId>;
77
- injectNavigate: () => UseNavigateResult<TFullPath>;
78
- }
79
- }
80
-
81
-
82
- declare module '@benjavicente/router-core' {
83
- interface LazyRoute<in out TRoute extends AnyRoute> {
84
- injectMatch: InjectMatchRoute<TRoute['id']>;
85
- injectRouteContext: InjectRouteContextRoute<TRoute['id']>;
86
- injectSearch: InjectSearchRoute<TRoute['id']>;
87
- injectParams: InjectParamsRoute<TRoute['id']>;
88
- injectLoaderDeps: InjectLoaderDepsRoute<TRoute['id']>;
89
- injectLoaderData: InjectLoaderDataRoute<TRoute['id']>;
90
- injectNavigate: () => UseNavigateResult<TRoute['fullPath']>;
95
+ declare global {
96
+ interface Window {
97
+ __TSR_ROUTER_INJECTION_KEY__?: Angular.InjectionToken<AnyRouter>;
91
98
  }
92
99
  }
93
100
 
@@ -102,10 +109,3 @@ declare module '@benjavicente/router-core' {
102
109
  pendingRouteIds: RouterReadableStore<Record<string, boolean>>;
103
110
  }
104
111
  }
105
-
106
-
107
- declare global {
108
- interface Window {
109
- __TSR_ROUTER_INJECTION_KEY__?: Angular.InjectionToken<AnyRouter>;
110
- }
111
- }
@@ -657,6 +657,40 @@ export declare type UseBlockerOpts<TRouter extends AnyRouter = RegisteredRouter,
657
657
  export { }
658
658
 
659
659
 
660
+ declare module '@benjavicente/router-core' {
661
+ interface LazyRoute<in out TRoute extends AnyRoute> {
662
+ injectMatch: InjectMatchRoute<TRoute['id']>;
663
+ injectRouteContext: InjectRouteContextRoute<TRoute['id']>;
664
+ injectSearch: InjectSearchRoute<TRoute['id']>;
665
+ injectParams: InjectParamsRoute<TRoute['id']>;
666
+ injectLoaderDeps: InjectLoaderDepsRoute<TRoute['id']>;
667
+ injectLoaderData: InjectLoaderDataRoute<TRoute['id']>;
668
+ injectNavigate: () => UseNavigateResult<TRoute['fullPath']>;
669
+ }
670
+ }
671
+
672
+
673
+ declare module '@benjavicente/router-core' {
674
+ interface UpdatableRouteOptionsExtensions {
675
+ component?: RouteComponent;
676
+ errorComponent?: false | null | undefined | ErrorRouteComponent;
677
+ notFoundComponent?: NotFoundRouteComponent;
678
+ pendingComponent?: RouteComponent;
679
+ }
680
+ interface RootRouteOptionsExtensions {
681
+ }
682
+ interface RouteExtensions<in out TId extends string, in out TFullPath extends string> {
683
+ injectMatch: InjectMatchRoute<TId>;
684
+ injectRouteContext: InjectRouteContextRoute<TId>;
685
+ injectSearch: InjectSearchRoute<TId>;
686
+ injectParams: InjectParamsRoute<TId>;
687
+ injectLoaderDeps: InjectLoaderDepsRoute<TId>;
688
+ injectLoaderData: InjectLoaderDataRoute<TId>;
689
+ injectNavigate: () => UseNavigateResult<TFullPath>;
690
+ }
691
+ }
692
+
693
+
660
694
  declare module '@benjavicente/router-core' {
661
695
  interface RouterOptionsExtensions {
662
696
  /**
@@ -693,36 +727,9 @@ declare module '@benjavicente/router-core' {
693
727
  }
694
728
 
695
729
 
696
- declare module '@benjavicente/router-core' {
697
- interface UpdatableRouteOptionsExtensions {
698
- component?: RouteComponent;
699
- errorComponent?: false | null | undefined | ErrorRouteComponent;
700
- notFoundComponent?: NotFoundRouteComponent;
701
- pendingComponent?: RouteComponent;
702
- }
703
- interface RootRouteOptionsExtensions {
704
- }
705
- interface RouteExtensions<in out TId extends string, in out TFullPath extends string> {
706
- injectMatch: InjectMatchRoute<TId>;
707
- injectRouteContext: InjectRouteContextRoute<TId>;
708
- injectSearch: InjectSearchRoute<TId>;
709
- injectParams: InjectParamsRoute<TId>;
710
- injectLoaderDeps: InjectLoaderDepsRoute<TId>;
711
- injectLoaderData: InjectLoaderDataRoute<TId>;
712
- injectNavigate: () => UseNavigateResult<TFullPath>;
713
- }
714
- }
715
-
716
-
717
- declare module '@benjavicente/router-core' {
718
- interface LazyRoute<in out TRoute extends AnyRoute> {
719
- injectMatch: InjectMatchRoute<TRoute['id']>;
720
- injectRouteContext: InjectRouteContextRoute<TRoute['id']>;
721
- injectSearch: InjectSearchRoute<TRoute['id']>;
722
- injectParams: InjectParamsRoute<TRoute['id']>;
723
- injectLoaderDeps: InjectLoaderDepsRoute<TRoute['id']>;
724
- injectLoaderData: InjectLoaderDataRoute<TRoute['id']>;
725
- injectNavigate: () => UseNavigateResult<TRoute['fullPath']>;
730
+ declare global {
731
+ interface Window {
732
+ __TSR_ROUTER_INJECTION_KEY__?: Angular.InjectionToken<AnyRouter>;
726
733
  }
727
734
  }
728
735
 
@@ -737,10 +744,3 @@ declare module '@benjavicente/router-core' {
737
744
  pendingRouteIds: RouterReadableStore<Record<string, boolean>>;
738
745
  }
739
746
  }
740
-
741
-
742
- declare global {
743
- interface Window {
744
- __TSR_ROUTER_INJECTION_KEY__?: Angular.InjectionToken<AnyRouter>;
745
- }
746
- }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@benjavicente/angular-router-experimental",
3
- "version": "1.142.13",
3
+ "version": "1.142.14",
4
4
  "description": "Modern and scalable routing for Angular applications",
5
5
  "author": "Tanner Linsley",
6
6
  "license": "MIT",
@@ -1,4 +1,3 @@
1
- import { DOCUMENT } from '@angular/common'
2
1
  import * as Angular from '@angular/core'
3
2
  import { injectStore } from '../store/injectStore'
4
3
  import { buildMatchManagedDocumentContent } from './build-match-managed-document'
@@ -42,7 +41,7 @@ function applyManagedDocumentContent({
42
41
  * Used by `provideTanstackDocument` when all features are enabled.
43
42
  */
44
43
  export function installUnifiedTanstackDocumentSync(injectedRouter: AnyRouter) {
45
- const document = Angular.inject(DOCUMENT)
44
+ const document = Angular.inject(Angular.DOCUMENT)
46
45
  const rendererFactory = Angular.inject(Angular.RendererFactory2, {
47
46
  optional: true,
48
47
  })
@@ -1,4 +1,3 @@
1
- import { DOCUMENT } from '@angular/common'
2
1
  import * as Angular from '@angular/core'
3
2
  import { injectStore } from '../store/injectStore'
4
3
  import { buildMatchManagedDocumentContent } from './build-match-managed-document'
@@ -14,7 +13,7 @@ import type { ManagedTag } from './managed-document-types'
14
13
  * on the server only (call from an injection context).
15
14
  */
16
15
  export function installTanstackBodyManagedTags(injectedRouter: AnyRouter) {
17
- const document = Angular.inject(DOCUMENT)
16
+ const document = Angular.inject(Angular.DOCUMENT)
18
17
  const rendererFactory = Angular.inject(Angular.RendererFactory2, {
19
18
  optional: true,
20
19
  })
@@ -1,4 +1,3 @@
1
- import { DOCUMENT } from '@angular/common'
2
1
  import * as Angular from '@angular/core'
3
2
  import { injectStore } from '../store/injectStore'
4
3
  import { buildMatchManagedDocumentContent } from './build-match-managed-document'
@@ -7,7 +6,7 @@ import type { AnyRouter } from '@benjavicente/router-core'
7
6
 
8
7
  /** Sync `document.title` from the router (call from an injection context). */
9
8
  export function installTanstackDocumentTitle(injectedRouter: AnyRouter) {
10
- const document = Angular.inject(DOCUMENT)
9
+ const document = Angular.inject(Angular.DOCUMENT)
11
10
  const destroyRef = Angular.inject(Angular.DestroyRef)
12
11
  const activeMatches = injectStore(
13
12
  injectedRouter.stores.matches,
@@ -1,4 +1,3 @@
1
- import { DOCUMENT } from '@angular/common'
2
1
  import * as Angular from '@angular/core'
3
2
  import { injectStore } from '../store/injectStore'
4
3
  import { buildMatchManagedDocumentContent } from './build-match-managed-document'
@@ -10,7 +9,7 @@ import type { ManagedTag } from './managed-document-types'
10
9
 
11
10
  /** Managed `<head>` tags from active matches (call from an injection context). */
12
11
  export function installTanstackHeadManagedTags(injectedRouter: AnyRouter) {
13
- const document = Angular.inject(DOCUMENT)
12
+ const document = Angular.inject(Angular.DOCUMENT)
14
13
  const rendererFactory = Angular.inject(Angular.RendererFactory2, {
15
14
  optional: true,
16
15
  })
@@ -1,4 +1,4 @@
1
- import { DOCUMENT } from '@angular/common'
1
+ import { DOCUMENT } from '@angular/core'
2
2
  import { EnvironmentInjector, afterNextRender, inject } from '@angular/core'
3
3
  import { getScrollRestorationScriptForRouter } from '@benjavicente/router-core/scroll-restoration-script'
4
4
  import { injectRouter } from './injectRouter'