@noego/forge 0.1.7 → 0.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/client.d.ts CHANGED
@@ -132,7 +132,7 @@ declare interface IRoute {
132
132
 
133
133
  export declare function loadRoute(node: any, base_path: string, route: IRoute, combinedParams: any, urlParams: any, query: any): Promise<void>;
134
134
 
135
- declare function makeUrlParser(pattern: string): (pathname: string) => any;
135
+ declare function makeUrlParser(pattern: string): (pathname: string) => Record<string, string> | null;
136
136
 
137
137
  export declare const MANIFEST_STORE: {};
138
138
 
package/dist/client.mjs CHANGED
@@ -5,7 +5,14 @@ import { hydrate as Dt } from "svelte";
5
5
  import Gt from "../src/components/RecursiveRender.svelte";
6
6
  function Vt(t) {
7
7
  const r = new Ft(t);
8
- return (e) => r.match(e) || null;
8
+ return (e) => {
9
+ const n = r.match(e);
10
+ if (!n) return null;
11
+ const o = {};
12
+ for (const [i, a] of Object.entries(n))
13
+ o[i] = decodeURIComponent(a);
14
+ return o;
15
+ };
9
16
  }
10
17
  function Mt(t) {
11
18
  return t.map((r) => {
@@ -438,7 +445,7 @@ function tt(t, r) {
438
445
  0 <= e && t.splice(e, 1);
439
446
  }
440
447
  }
441
- var W = function() {
448
+ var W = (function() {
442
449
  function t(r) {
443
450
  this.initialTeardown = r, this.closed = !1, this._parentage = null, this._finalizers = null;
444
451
  }
@@ -522,11 +529,11 @@ var W = function() {
522
529
  }, t.prototype.remove = function(r) {
523
530
  var e = this._finalizers;
524
531
  e && tt(e, r), r instanceof t && r._removeParent(this);
525
- }, t.EMPTY = function() {
532
+ }, t.EMPTY = (function() {
526
533
  var r = new t();
527
534
  return r.closed = !0, r;
528
- }(), t;
529
- }(), wt = W.EMPTY;
535
+ })(), t;
536
+ })(), wt = W.EMPTY;
530
537
  function mt(t) {
531
538
  return t instanceof W || t && "closed" in t && g(t.remove) && g(t.add) && g(t.unsubscribe);
532
539
  }
@@ -556,7 +563,7 @@ function ft() {
556
563
  function G(t) {
557
564
  t();
558
565
  }
559
- var rt = function(t) {
566
+ var rt = (function(t) {
560
567
  C(r, t);
561
568
  function r(e) {
562
569
  var n = t.call(this) || this;
@@ -587,7 +594,7 @@ var rt = function(t) {
587
594
  this.unsubscribe();
588
595
  }
589
596
  }, r;
590
- }(W), ee = function() {
597
+ })(W), ee = (function() {
591
598
  function t(r) {
592
599
  this.partialObserver = r;
593
600
  }
@@ -618,7 +625,7 @@ var rt = function(t) {
618
625
  F(e);
619
626
  }
620
627
  }, t;
621
- }(), et = function(t) {
628
+ })(), et = (function(t) {
622
629
  C(r, t);
623
630
  function r(e, n, o) {
624
631
  var i = t.call(this) || this, a;
@@ -629,7 +636,7 @@ var rt = function(t) {
629
636
  } : a = e, i.destination = new ee(a), i;
630
637
  }
631
638
  return r;
632
- }(rt);
639
+ })(rt);
633
640
  function F(t) {
634
641
  bt(t);
635
642
  }
@@ -641,9 +648,9 @@ var ne = {
641
648
  next: ft,
642
649
  error: re,
643
650
  complete: ft
644
- }, nt = function() {
651
+ }, nt = (function() {
645
652
  return typeof Symbol == "function" && Symbol.observable || "@@observable";
646
- }();
653
+ })();
647
654
  function gt(t) {
648
655
  return t;
649
656
  }
@@ -654,7 +661,7 @@ function oe(t) {
654
661
  }, e);
655
662
  };
656
663
  }
657
- var P = function() {
664
+ var P = (function() {
658
665
  function t(r) {
659
666
  r && (this._subscribe = r);
660
667
  }
@@ -713,7 +720,7 @@ var P = function() {
713
720
  }, t.create = function(r) {
714
721
  return new t(r);
715
722
  }, t;
716
- }();
723
+ })();
717
724
  function ht(t) {
718
725
  var r;
719
726
  return (r = t ?? Zt.Promise) !== null && r !== void 0 ? r : Promise;
@@ -743,7 +750,7 @@ function q(t) {
743
750
  function N(t, r, e, n, o) {
744
751
  return new ce(t, r, e, n, o);
745
752
  }
746
- var ce = function(t) {
753
+ var ce = (function(t) {
747
754
  C(r, t);
748
755
  function r(e, n, o, i, a, c) {
749
756
  var s = t.call(this, e) || this;
@@ -778,11 +785,11 @@ var ce = function(t) {
778
785
  t.prototype.unsubscribe.call(this), !n && ((e = this.onFinalize) === null || e === void 0 || e.call(this));
779
786
  }
780
787
  }, r;
781
- }(rt), ue = yt(function(t) {
788
+ })(rt), ue = yt(function(t) {
782
789
  return function() {
783
790
  t(this), this.name = "ObjectUnsubscribedError", this.message = "object unsubscribed";
784
791
  };
785
- }), St = function(t) {
792
+ }), St = (function(t) {
786
793
  C(r, t);
787
794
  function r() {
788
795
  var e = t.call(this) || this;
@@ -861,7 +868,7 @@ var ce = function(t) {
861
868
  }, r.create = function(e, n) {
862
869
  return new dt(e, n);
863
870
  }, r;
864
- }(P), dt = function(t) {
871
+ })(P), dt = (function(t) {
865
872
  C(r, t);
866
873
  function r(e, n) {
867
874
  var o = t.call(this) || this;
@@ -880,9 +887,9 @@ var ce = function(t) {
880
887
  var n, o;
881
888
  return (o = (n = this.source) === null || n === void 0 ? void 0 : n.subscribe(e)) !== null && o !== void 0 ? o : wt;
882
889
  }, r;
883
- }(St), _t = function(t) {
890
+ })(St), _t = (function(t) {
884
891
  return t && typeof t.length == "number" && typeof t != "function";
885
- };
892
+ });
886
893
  function Et(t) {
887
894
  return g(t == null ? void 0 : t.then);
888
895
  }
@@ -1357,7 +1364,7 @@ function Ue(t, r, e) {
1357
1364
  D(i, t, c, d, u, h, l, !1);
1358
1365
  } else
1359
1366
  console.log("No matching route found for popstate navigation to:", o, "- using fallback navigation"), window.location.href = o;
1360
- }), function() {
1367
+ }), (function() {
1361
1368
  const n = history.pushState, o = history.replaceState;
1362
1369
  history.pushState = function(...i) {
1363
1370
  const a = n.apply(this, i), c = new Event("pushstate");
@@ -1370,7 +1377,7 @@ function Ue(t, r, e) {
1370
1377
  }
1371
1378
  return a;
1372
1379
  };
1373
- }(), window.addEventListener("pushstate", (n) => {
1380
+ })(), window.addEventListener("pushstate", (n) => {
1374
1381
  const o = n.url || window.location.pathname + window.location.search, i = o.split("?")[0], a = "get", c = r.find((s) => s.method.toLowerCase() === a && e.find((u) => u.parser(i) && u.pattern === s.path));
1375
1382
  if (c) {
1376
1383
  const s = e.find((y) => y.parser(i) && y.pattern === c.path), u = s == null ? void 0 : s.parser(i), f = new URLSearchParams(o.split("?")[1] || ""), h = Object.fromEntries(f.entries());