@genesislcap/foundation-utils 14.400.0 → 14.401.0-hide-status-pill.3
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/custom-elements.json +251 -135
- package/dist/dts/index.d.ts +1 -0
- package/dist/dts/index.d.ts.map +1 -1
- package/dist/dts/route/index.d.ts +2 -0
- package/dist/dts/route/index.d.ts.map +1 -0
- package/dist/dts/route/route.d.ts +31 -0
- package/dist/dts/route/route.d.ts.map +1 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/route/index.js +1 -0
- package/dist/esm/route/route.js +66 -0
- package/dist/foundation-utils.api.json +111 -0
- package/dist/foundation-utils.d.ts +31 -0
- package/docs/api/foundation-utils.md +11 -0
- package/docs/api/foundation-utils.routeutil.destroy.md +17 -0
- package/docs/api/foundation-utils.routeutil.md +115 -0
- package/docs/api/foundation-utils.routeutil.pathname.md +13 -0
- package/docs/api/foundation-utils.routeutil.shared.md +13 -0
- package/docs/api-report.md.api.md +7 -0
- package/package.json +11 -11
|
@@ -127,6 +127,14 @@
|
|
|
127
127
|
"package": "./resource"
|
|
128
128
|
}
|
|
129
129
|
},
|
|
130
|
+
{
|
|
131
|
+
"kind": "js",
|
|
132
|
+
"name": "*",
|
|
133
|
+
"declaration": {
|
|
134
|
+
"name": "*",
|
|
135
|
+
"package": "./route"
|
|
136
|
+
}
|
|
137
|
+
},
|
|
130
138
|
{
|
|
131
139
|
"kind": "js",
|
|
132
140
|
"name": "*",
|
|
@@ -391,126 +399,6 @@
|
|
|
391
399
|
}
|
|
392
400
|
]
|
|
393
401
|
},
|
|
394
|
-
{
|
|
395
|
-
"kind": "javascript-module",
|
|
396
|
-
"path": "src/design-system/design-system.ts",
|
|
397
|
-
"declarations": [
|
|
398
|
-
{
|
|
399
|
-
"kind": "function",
|
|
400
|
-
"name": "assureDesignSystem",
|
|
401
|
-
"return": {
|
|
402
|
-
"type": {
|
|
403
|
-
"text": "DesignSystemModule"
|
|
404
|
-
}
|
|
405
|
-
},
|
|
406
|
-
"parameters": [
|
|
407
|
-
{
|
|
408
|
-
"name": "module",
|
|
409
|
-
"type": {
|
|
410
|
-
"text": "DesignSystemModule"
|
|
411
|
-
}
|
|
412
|
-
}
|
|
413
|
-
],
|
|
414
|
-
"description": "assureDesignSystem.",
|
|
415
|
-
"privacy": "public"
|
|
416
|
-
},
|
|
417
|
-
{
|
|
418
|
-
"kind": "function",
|
|
419
|
-
"name": "getCurrentDesignSystem",
|
|
420
|
-
"return": {
|
|
421
|
-
"type": {
|
|
422
|
-
"text": ""
|
|
423
|
-
}
|
|
424
|
-
},
|
|
425
|
-
"parameters": [
|
|
426
|
-
{
|
|
427
|
-
"name": "element",
|
|
428
|
-
"type": {
|
|
429
|
-
"text": "HTMLElement"
|
|
430
|
-
},
|
|
431
|
-
"description": "The starting HTML element"
|
|
432
|
-
},
|
|
433
|
-
{
|
|
434
|
-
"name": "fallbackPrefix",
|
|
435
|
-
"type": {
|
|
436
|
-
"text": "string"
|
|
437
|
-
},
|
|
438
|
-
"description": "The prefix to fallback to if the provider is not available"
|
|
439
|
-
}
|
|
440
|
-
],
|
|
441
|
-
"description": "Get the current design system provider element and prefix by checking available providers.\nIf no provider is found, falls back to the provided prefix.",
|
|
442
|
-
"privacy": "public"
|
|
443
|
-
},
|
|
444
|
-
{
|
|
445
|
-
"kind": "function",
|
|
446
|
-
"name": "getCurrentDesignSystemPrefix",
|
|
447
|
-
"return": {
|
|
448
|
-
"type": {
|
|
449
|
-
"text": ""
|
|
450
|
-
}
|
|
451
|
-
},
|
|
452
|
-
"parameters": [
|
|
453
|
-
{
|
|
454
|
-
"name": "element",
|
|
455
|
-
"type": {
|
|
456
|
-
"text": "HTMLElement"
|
|
457
|
-
},
|
|
458
|
-
"description": "The starting HTML element"
|
|
459
|
-
},
|
|
460
|
-
{
|
|
461
|
-
"name": "fallbackPrefix",
|
|
462
|
-
"type": {
|
|
463
|
-
"text": "string"
|
|
464
|
-
},
|
|
465
|
-
"description": "The prefix to fallback to if the provider is not available"
|
|
466
|
-
}
|
|
467
|
-
],
|
|
468
|
-
"description": "Get the current design system prefix by checking available providers.\nIf no provider is found, falls back to the provided prefix.",
|
|
469
|
-
"privacy": "public"
|
|
470
|
-
}
|
|
471
|
-
],
|
|
472
|
-
"exports": [
|
|
473
|
-
{
|
|
474
|
-
"kind": "js",
|
|
475
|
-
"name": "assureDesignSystem",
|
|
476
|
-
"declaration": {
|
|
477
|
-
"name": "assureDesignSystem",
|
|
478
|
-
"module": "src/design-system/design-system.ts"
|
|
479
|
-
}
|
|
480
|
-
},
|
|
481
|
-
{
|
|
482
|
-
"kind": "js",
|
|
483
|
-
"name": "getCurrentDesignSystem",
|
|
484
|
-
"declaration": {
|
|
485
|
-
"name": "getCurrentDesignSystem",
|
|
486
|
-
"module": "src/design-system/design-system.ts"
|
|
487
|
-
}
|
|
488
|
-
},
|
|
489
|
-
{
|
|
490
|
-
"kind": "js",
|
|
491
|
-
"name": "getCurrentDesignSystemPrefix",
|
|
492
|
-
"declaration": {
|
|
493
|
-
"name": "getCurrentDesignSystemPrefix",
|
|
494
|
-
"module": "src/design-system/design-system.ts"
|
|
495
|
-
}
|
|
496
|
-
}
|
|
497
|
-
]
|
|
498
|
-
},
|
|
499
|
-
{
|
|
500
|
-
"kind": "javascript-module",
|
|
501
|
-
"path": "src/design-system/index.ts",
|
|
502
|
-
"declarations": [],
|
|
503
|
-
"exports": [
|
|
504
|
-
{
|
|
505
|
-
"kind": "js",
|
|
506
|
-
"name": "*",
|
|
507
|
-
"declaration": {
|
|
508
|
-
"name": "*",
|
|
509
|
-
"package": "./design-system"
|
|
510
|
-
}
|
|
511
|
-
}
|
|
512
|
-
]
|
|
513
|
-
},
|
|
514
402
|
{
|
|
515
403
|
"kind": "javascript-module",
|
|
516
404
|
"path": "src/decorators/index.ts",
|
|
@@ -587,6 +475,21 @@
|
|
|
587
475
|
}
|
|
588
476
|
]
|
|
589
477
|
},
|
|
478
|
+
{
|
|
479
|
+
"kind": "javascript-module",
|
|
480
|
+
"path": "src/encoding/index.ts",
|
|
481
|
+
"declarations": [],
|
|
482
|
+
"exports": [
|
|
483
|
+
{
|
|
484
|
+
"kind": "js",
|
|
485
|
+
"name": "*",
|
|
486
|
+
"declaration": {
|
|
487
|
+
"name": "*",
|
|
488
|
+
"package": "./base64"
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
]
|
|
492
|
+
},
|
|
590
493
|
{
|
|
591
494
|
"kind": "javascript-module",
|
|
592
495
|
"path": "src/env/index.ts",
|
|
@@ -1062,6 +965,126 @@
|
|
|
1062
965
|
}
|
|
1063
966
|
]
|
|
1064
967
|
},
|
|
968
|
+
{
|
|
969
|
+
"kind": "javascript-module",
|
|
970
|
+
"path": "src/design-system/design-system.ts",
|
|
971
|
+
"declarations": [
|
|
972
|
+
{
|
|
973
|
+
"kind": "function",
|
|
974
|
+
"name": "assureDesignSystem",
|
|
975
|
+
"return": {
|
|
976
|
+
"type": {
|
|
977
|
+
"text": "DesignSystemModule"
|
|
978
|
+
}
|
|
979
|
+
},
|
|
980
|
+
"parameters": [
|
|
981
|
+
{
|
|
982
|
+
"name": "module",
|
|
983
|
+
"type": {
|
|
984
|
+
"text": "DesignSystemModule"
|
|
985
|
+
}
|
|
986
|
+
}
|
|
987
|
+
],
|
|
988
|
+
"description": "assureDesignSystem.",
|
|
989
|
+
"privacy": "public"
|
|
990
|
+
},
|
|
991
|
+
{
|
|
992
|
+
"kind": "function",
|
|
993
|
+
"name": "getCurrentDesignSystem",
|
|
994
|
+
"return": {
|
|
995
|
+
"type": {
|
|
996
|
+
"text": ""
|
|
997
|
+
}
|
|
998
|
+
},
|
|
999
|
+
"parameters": [
|
|
1000
|
+
{
|
|
1001
|
+
"name": "element",
|
|
1002
|
+
"type": {
|
|
1003
|
+
"text": "HTMLElement"
|
|
1004
|
+
},
|
|
1005
|
+
"description": "The starting HTML element"
|
|
1006
|
+
},
|
|
1007
|
+
{
|
|
1008
|
+
"name": "fallbackPrefix",
|
|
1009
|
+
"type": {
|
|
1010
|
+
"text": "string"
|
|
1011
|
+
},
|
|
1012
|
+
"description": "The prefix to fallback to if the provider is not available"
|
|
1013
|
+
}
|
|
1014
|
+
],
|
|
1015
|
+
"description": "Get the current design system provider element and prefix by checking available providers.\nIf no provider is found, falls back to the provided prefix.",
|
|
1016
|
+
"privacy": "public"
|
|
1017
|
+
},
|
|
1018
|
+
{
|
|
1019
|
+
"kind": "function",
|
|
1020
|
+
"name": "getCurrentDesignSystemPrefix",
|
|
1021
|
+
"return": {
|
|
1022
|
+
"type": {
|
|
1023
|
+
"text": ""
|
|
1024
|
+
}
|
|
1025
|
+
},
|
|
1026
|
+
"parameters": [
|
|
1027
|
+
{
|
|
1028
|
+
"name": "element",
|
|
1029
|
+
"type": {
|
|
1030
|
+
"text": "HTMLElement"
|
|
1031
|
+
},
|
|
1032
|
+
"description": "The starting HTML element"
|
|
1033
|
+
},
|
|
1034
|
+
{
|
|
1035
|
+
"name": "fallbackPrefix",
|
|
1036
|
+
"type": {
|
|
1037
|
+
"text": "string"
|
|
1038
|
+
},
|
|
1039
|
+
"description": "The prefix to fallback to if the provider is not available"
|
|
1040
|
+
}
|
|
1041
|
+
],
|
|
1042
|
+
"description": "Get the current design system prefix by checking available providers.\nIf no provider is found, falls back to the provided prefix.",
|
|
1043
|
+
"privacy": "public"
|
|
1044
|
+
}
|
|
1045
|
+
],
|
|
1046
|
+
"exports": [
|
|
1047
|
+
{
|
|
1048
|
+
"kind": "js",
|
|
1049
|
+
"name": "assureDesignSystem",
|
|
1050
|
+
"declaration": {
|
|
1051
|
+
"name": "assureDesignSystem",
|
|
1052
|
+
"module": "src/design-system/design-system.ts"
|
|
1053
|
+
}
|
|
1054
|
+
},
|
|
1055
|
+
{
|
|
1056
|
+
"kind": "js",
|
|
1057
|
+
"name": "getCurrentDesignSystem",
|
|
1058
|
+
"declaration": {
|
|
1059
|
+
"name": "getCurrentDesignSystem",
|
|
1060
|
+
"module": "src/design-system/design-system.ts"
|
|
1061
|
+
}
|
|
1062
|
+
},
|
|
1063
|
+
{
|
|
1064
|
+
"kind": "js",
|
|
1065
|
+
"name": "getCurrentDesignSystemPrefix",
|
|
1066
|
+
"declaration": {
|
|
1067
|
+
"name": "getCurrentDesignSystemPrefix",
|
|
1068
|
+
"module": "src/design-system/design-system.ts"
|
|
1069
|
+
}
|
|
1070
|
+
}
|
|
1071
|
+
]
|
|
1072
|
+
},
|
|
1073
|
+
{
|
|
1074
|
+
"kind": "javascript-module",
|
|
1075
|
+
"path": "src/design-system/index.ts",
|
|
1076
|
+
"declarations": [],
|
|
1077
|
+
"exports": [
|
|
1078
|
+
{
|
|
1079
|
+
"kind": "js",
|
|
1080
|
+
"name": "*",
|
|
1081
|
+
"declaration": {
|
|
1082
|
+
"name": "*",
|
|
1083
|
+
"package": "./design-system"
|
|
1084
|
+
}
|
|
1085
|
+
}
|
|
1086
|
+
]
|
|
1087
|
+
},
|
|
1065
1088
|
{
|
|
1066
1089
|
"kind": "javascript-module",
|
|
1067
1090
|
"path": "src/error/errorMap.ts",
|
|
@@ -1261,21 +1284,6 @@
|
|
|
1261
1284
|
}
|
|
1262
1285
|
]
|
|
1263
1286
|
},
|
|
1264
|
-
{
|
|
1265
|
-
"kind": "javascript-module",
|
|
1266
|
-
"path": "src/encoding/index.ts",
|
|
1267
|
-
"declarations": [],
|
|
1268
|
-
"exports": [
|
|
1269
|
-
{
|
|
1270
|
-
"kind": "js",
|
|
1271
|
-
"name": "*",
|
|
1272
|
-
"declaration": {
|
|
1273
|
-
"name": "*",
|
|
1274
|
-
"package": "./base64"
|
|
1275
|
-
}
|
|
1276
|
-
}
|
|
1277
|
-
]
|
|
1278
|
-
},
|
|
1279
1287
|
{
|
|
1280
1288
|
"kind": "javascript-module",
|
|
1281
1289
|
"path": "src/feature-flags/featureFlags.ts",
|
|
@@ -2562,6 +2570,114 @@
|
|
|
2562
2570
|
}
|
|
2563
2571
|
]
|
|
2564
2572
|
},
|
|
2573
|
+
{
|
|
2574
|
+
"kind": "javascript-module",
|
|
2575
|
+
"path": "src/route/index.ts",
|
|
2576
|
+
"declarations": [],
|
|
2577
|
+
"exports": [
|
|
2578
|
+
{
|
|
2579
|
+
"kind": "js",
|
|
2580
|
+
"name": "*",
|
|
2581
|
+
"declaration": {
|
|
2582
|
+
"name": "*",
|
|
2583
|
+
"package": "./route"
|
|
2584
|
+
}
|
|
2585
|
+
}
|
|
2586
|
+
]
|
|
2587
|
+
},
|
|
2588
|
+
{
|
|
2589
|
+
"kind": "javascript-module",
|
|
2590
|
+
"path": "src/route/route.ts",
|
|
2591
|
+
"declarations": [
|
|
2592
|
+
{
|
|
2593
|
+
"kind": "class",
|
|
2594
|
+
"description": "A singleton utility to observe and notify about route changes.\nIt uses both polling and popstate events to detect changes.",
|
|
2595
|
+
"name": "RouteUtil",
|
|
2596
|
+
"members": [
|
|
2597
|
+
{
|
|
2598
|
+
"kind": "field",
|
|
2599
|
+
"name": "pathName",
|
|
2600
|
+
"type": {
|
|
2601
|
+
"text": "string"
|
|
2602
|
+
},
|
|
2603
|
+
"description": "The current pathname of the window location."
|
|
2604
|
+
},
|
|
2605
|
+
{
|
|
2606
|
+
"kind": "field",
|
|
2607
|
+
"name": "routeCheckInterval",
|
|
2608
|
+
"type": {
|
|
2609
|
+
"text": "number | null"
|
|
2610
|
+
},
|
|
2611
|
+
"privacy": "private",
|
|
2612
|
+
"default": "null"
|
|
2613
|
+
},
|
|
2614
|
+
{
|
|
2615
|
+
"kind": "field",
|
|
2616
|
+
"name": "instance",
|
|
2617
|
+
"type": {
|
|
2618
|
+
"text": "RouteUtil"
|
|
2619
|
+
},
|
|
2620
|
+
"privacy": "private",
|
|
2621
|
+
"static": true
|
|
2622
|
+
},
|
|
2623
|
+
{
|
|
2624
|
+
"kind": "field",
|
|
2625
|
+
"name": "shared",
|
|
2626
|
+
"type": {
|
|
2627
|
+
"text": "RouteUtil"
|
|
2628
|
+
},
|
|
2629
|
+
"privacy": "public",
|
|
2630
|
+
"static": true,
|
|
2631
|
+
"description": "Gets the singleton instance of RouteUtil.",
|
|
2632
|
+
"readonly": true
|
|
2633
|
+
},
|
|
2634
|
+
{
|
|
2635
|
+
"kind": "method",
|
|
2636
|
+
"name": "initializeRouteDetection",
|
|
2637
|
+
"privacy": "private",
|
|
2638
|
+
"return": {
|
|
2639
|
+
"type": {
|
|
2640
|
+
"text": "void"
|
|
2641
|
+
}
|
|
2642
|
+
},
|
|
2643
|
+
"description": "Initialize framework-agnostic route detection"
|
|
2644
|
+
},
|
|
2645
|
+
{
|
|
2646
|
+
"kind": "method",
|
|
2647
|
+
"name": "handleRouteChange",
|
|
2648
|
+
"privacy": "private",
|
|
2649
|
+
"return": {
|
|
2650
|
+
"type": {
|
|
2651
|
+
"text": "void"
|
|
2652
|
+
}
|
|
2653
|
+
},
|
|
2654
|
+
"description": "Handle route changes by updating the pathName observable"
|
|
2655
|
+
},
|
|
2656
|
+
{
|
|
2657
|
+
"kind": "method",
|
|
2658
|
+
"name": "destroy",
|
|
2659
|
+
"privacy": "public",
|
|
2660
|
+
"return": {
|
|
2661
|
+
"type": {
|
|
2662
|
+
"text": "void"
|
|
2663
|
+
}
|
|
2664
|
+
},
|
|
2665
|
+
"description": "Clean up route detection listeners and polling."
|
|
2666
|
+
}
|
|
2667
|
+
]
|
|
2668
|
+
}
|
|
2669
|
+
],
|
|
2670
|
+
"exports": [
|
|
2671
|
+
{
|
|
2672
|
+
"kind": "js",
|
|
2673
|
+
"name": "RouteUtil",
|
|
2674
|
+
"declaration": {
|
|
2675
|
+
"name": "RouteUtil",
|
|
2676
|
+
"module": "src/route/route.ts"
|
|
2677
|
+
}
|
|
2678
|
+
}
|
|
2679
|
+
]
|
|
2680
|
+
},
|
|
2565
2681
|
{
|
|
2566
2682
|
"kind": "javascript-module",
|
|
2567
2683
|
"path": "src/serializers/index.ts",
|
package/dist/dts/index.d.ts
CHANGED
package/dist/dts/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,OAAO,CAAC;AACtB,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,OAAO,CAAC;AACtB,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/route/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A singleton utility to observe and notify about route changes.
|
|
3
|
+
* It uses both polling and popstate events to detect changes.
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
6
|
+
export declare class RouteUtil {
|
|
7
|
+
/**
|
|
8
|
+
* The current pathname of the window location.
|
|
9
|
+
*/
|
|
10
|
+
pathName: string;
|
|
11
|
+
private routeCheckInterval;
|
|
12
|
+
private static instance;
|
|
13
|
+
private constructor();
|
|
14
|
+
/**
|
|
15
|
+
* Gets the singleton instance of RouteUtil.
|
|
16
|
+
*/
|
|
17
|
+
static get shared(): RouteUtil;
|
|
18
|
+
/**
|
|
19
|
+
* Initialize framework-agnostic route detection
|
|
20
|
+
*/
|
|
21
|
+
private initializeRouteDetection;
|
|
22
|
+
/**
|
|
23
|
+
* Handle route changes by updating the pathName observable
|
|
24
|
+
*/
|
|
25
|
+
private handleRouteChange;
|
|
26
|
+
/**
|
|
27
|
+
* Clean up route detection listeners and polling.
|
|
28
|
+
*/
|
|
29
|
+
destroy(): void;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=route.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../src/route/route.ts"],"names":[],"mappings":"AAOA;;;;GAIG;AACH,qBAAa,SAAS;IACpB;;OAEG;IACS,QAAQ,EAAE,MAAM,CAA4B;IAExD,OAAO,CAAC,kBAAkB,CAAuB;IACjD,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAY;IAEnC,OAAO;IAIP;;OAEG;IACH,WAAkB,MAAM,IAAI,SAAS,CAKpC;IAED;;OAEG;IACH,OAAO,CAAC,wBAAwB;IAYhC;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAOzB;;OAEG;IACI,OAAO,IAAI,IAAI;CAYvB"}
|
package/dist/esm/index.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './route';
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { createLogger } from '@genesislcap/foundation-logger';
|
|
3
|
+
import { observable } from '@microsoft/fast-element';
|
|
4
|
+
const logger = createLogger('route-util');
|
|
5
|
+
const DEFAULT_ROUTE_POLL_CHANGE = 500;
|
|
6
|
+
/**
|
|
7
|
+
* A singleton utility to observe and notify about route changes.
|
|
8
|
+
* It uses both polling and popstate events to detect changes.
|
|
9
|
+
* @public
|
|
10
|
+
*/
|
|
11
|
+
export class RouteUtil {
|
|
12
|
+
constructor() {
|
|
13
|
+
/**
|
|
14
|
+
* The current pathname of the window location.
|
|
15
|
+
*/
|
|
16
|
+
this.pathName = window.location.pathname;
|
|
17
|
+
this.routeCheckInterval = null;
|
|
18
|
+
this.initializeRouteDetection();
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Gets the singleton instance of RouteUtil.
|
|
22
|
+
*/
|
|
23
|
+
static get shared() {
|
|
24
|
+
if (!RouteUtil.instance) {
|
|
25
|
+
RouteUtil.instance = new RouteUtil();
|
|
26
|
+
}
|
|
27
|
+
return RouteUtil.instance;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Initialize framework-agnostic route detection
|
|
31
|
+
*/
|
|
32
|
+
initializeRouteDetection() {
|
|
33
|
+
// Listen for browser back/forward navigation
|
|
34
|
+
window.addEventListener('popstate', this.handleRouteChange.bind(this));
|
|
35
|
+
// Start polling for route changes every DEFAULT_ROUTE_POLL_CHANGEms
|
|
36
|
+
this.routeCheckInterval = window.setInterval(() => {
|
|
37
|
+
this.handleRouteChange();
|
|
38
|
+
}, DEFAULT_ROUTE_POLL_CHANGE);
|
|
39
|
+
logger.debug('Route detection initialized');
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Handle route changes by updating the pathName observable
|
|
43
|
+
*/
|
|
44
|
+
handleRouteChange() {
|
|
45
|
+
const newPathname = window.location.pathname;
|
|
46
|
+
if (this.pathName !== newPathname) {
|
|
47
|
+
this.pathName = newPathname;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Clean up route detection listeners and polling.
|
|
52
|
+
*/
|
|
53
|
+
destroy() {
|
|
54
|
+
// Remove popstate listener
|
|
55
|
+
window.removeEventListener('popstate', this.handleRouteChange.bind(this));
|
|
56
|
+
// Clear polling interval
|
|
57
|
+
if (this.routeCheckInterval !== null) {
|
|
58
|
+
window.clearInterval(this.routeCheckInterval);
|
|
59
|
+
this.routeCheckInterval = null;
|
|
60
|
+
}
|
|
61
|
+
logger.debug('Route detection cleaned up');
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
__decorate([
|
|
65
|
+
observable
|
|
66
|
+
], RouteUtil.prototype, "pathName", void 0);
|
|
@@ -16946,6 +16946,117 @@
|
|
|
16946
16946
|
],
|
|
16947
16947
|
"name": "respondToVisibility"
|
|
16948
16948
|
},
|
|
16949
|
+
{
|
|
16950
|
+
"kind": "Class",
|
|
16951
|
+
"canonicalReference": "@genesislcap/foundation-utils!RouteUtil:class",
|
|
16952
|
+
"docComment": "/**\n * A singleton utility to observe and notify about route changes. It uses both polling and popstate events to detect changes.\n *\n * @public\n */\n",
|
|
16953
|
+
"excerptTokens": [
|
|
16954
|
+
{
|
|
16955
|
+
"kind": "Content",
|
|
16956
|
+
"text": "export declare class RouteUtil "
|
|
16957
|
+
}
|
|
16958
|
+
],
|
|
16959
|
+
"fileUrlPath": "src/route/route.ts",
|
|
16960
|
+
"releaseTag": "Public",
|
|
16961
|
+
"isAbstract": false,
|
|
16962
|
+
"name": "RouteUtil",
|
|
16963
|
+
"preserveMemberOrder": false,
|
|
16964
|
+
"members": [
|
|
16965
|
+
{
|
|
16966
|
+
"kind": "Method",
|
|
16967
|
+
"canonicalReference": "@genesislcap/foundation-utils!RouteUtil#destroy:member(1)",
|
|
16968
|
+
"docComment": "/**\n * Clean up route detection listeners and polling.\n */\n",
|
|
16969
|
+
"excerptTokens": [
|
|
16970
|
+
{
|
|
16971
|
+
"kind": "Content",
|
|
16972
|
+
"text": "destroy(): "
|
|
16973
|
+
},
|
|
16974
|
+
{
|
|
16975
|
+
"kind": "Content",
|
|
16976
|
+
"text": "void"
|
|
16977
|
+
},
|
|
16978
|
+
{
|
|
16979
|
+
"kind": "Content",
|
|
16980
|
+
"text": ";"
|
|
16981
|
+
}
|
|
16982
|
+
],
|
|
16983
|
+
"isStatic": false,
|
|
16984
|
+
"returnTypeTokenRange": {
|
|
16985
|
+
"startIndex": 1,
|
|
16986
|
+
"endIndex": 2
|
|
16987
|
+
},
|
|
16988
|
+
"releaseTag": "Public",
|
|
16989
|
+
"isProtected": false,
|
|
16990
|
+
"overloadIndex": 1,
|
|
16991
|
+
"parameters": [],
|
|
16992
|
+
"isOptional": false,
|
|
16993
|
+
"isAbstract": false,
|
|
16994
|
+
"name": "destroy"
|
|
16995
|
+
},
|
|
16996
|
+
{
|
|
16997
|
+
"kind": "Property",
|
|
16998
|
+
"canonicalReference": "@genesislcap/foundation-utils!RouteUtil#pathName:member",
|
|
16999
|
+
"docComment": "/**\n * The current pathname of the window location.\n */\n",
|
|
17000
|
+
"excerptTokens": [
|
|
17001
|
+
{
|
|
17002
|
+
"kind": "Content",
|
|
17003
|
+
"text": "pathName: "
|
|
17004
|
+
},
|
|
17005
|
+
{
|
|
17006
|
+
"kind": "Content",
|
|
17007
|
+
"text": "string"
|
|
17008
|
+
},
|
|
17009
|
+
{
|
|
17010
|
+
"kind": "Content",
|
|
17011
|
+
"text": ";"
|
|
17012
|
+
}
|
|
17013
|
+
],
|
|
17014
|
+
"isReadonly": false,
|
|
17015
|
+
"isOptional": false,
|
|
17016
|
+
"releaseTag": "Public",
|
|
17017
|
+
"name": "pathName",
|
|
17018
|
+
"propertyTypeTokenRange": {
|
|
17019
|
+
"startIndex": 1,
|
|
17020
|
+
"endIndex": 2
|
|
17021
|
+
},
|
|
17022
|
+
"isStatic": false,
|
|
17023
|
+
"isProtected": false,
|
|
17024
|
+
"isAbstract": false
|
|
17025
|
+
},
|
|
17026
|
+
{
|
|
17027
|
+
"kind": "Property",
|
|
17028
|
+
"canonicalReference": "@genesislcap/foundation-utils!RouteUtil.shared:member",
|
|
17029
|
+
"docComment": "/**\n * Gets the singleton instance of RouteUtil.\n */\n",
|
|
17030
|
+
"excerptTokens": [
|
|
17031
|
+
{
|
|
17032
|
+
"kind": "Content",
|
|
17033
|
+
"text": "static get shared(): "
|
|
17034
|
+
},
|
|
17035
|
+
{
|
|
17036
|
+
"kind": "Reference",
|
|
17037
|
+
"text": "RouteUtil",
|
|
17038
|
+
"canonicalReference": "@genesislcap/foundation-utils!RouteUtil:class"
|
|
17039
|
+
},
|
|
17040
|
+
{
|
|
17041
|
+
"kind": "Content",
|
|
17042
|
+
"text": ";"
|
|
17043
|
+
}
|
|
17044
|
+
],
|
|
17045
|
+
"isReadonly": true,
|
|
17046
|
+
"isOptional": false,
|
|
17047
|
+
"releaseTag": "Public",
|
|
17048
|
+
"name": "shared",
|
|
17049
|
+
"propertyTypeTokenRange": {
|
|
17050
|
+
"startIndex": 1,
|
|
17051
|
+
"endIndex": 2
|
|
17052
|
+
},
|
|
17053
|
+
"isStatic": true,
|
|
17054
|
+
"isProtected": false,
|
|
17055
|
+
"isAbstract": false
|
|
17056
|
+
}
|
|
17057
|
+
],
|
|
17058
|
+
"implementsTokenRanges": []
|
|
17059
|
+
},
|
|
16949
17060
|
{
|
|
16950
17061
|
"kind": "TypeAlias",
|
|
16951
17062
|
"canonicalReference": "@genesislcap/foundation-utils!ServerRowDTO:type",
|
|
@@ -2158,6 +2158,37 @@ export declare type ResourceType = (typeof ResourceType)[keyof typeof ResourceTy
|
|
|
2158
2158
|
*/
|
|
2159
2159
|
export declare const respondToVisibility: (element: HTMLElement, callback: (arg0: boolean) => any) => (() => void);
|
|
2160
2160
|
|
|
2161
|
+
/**
|
|
2162
|
+
* A singleton utility to observe and notify about route changes.
|
|
2163
|
+
* It uses both polling and popstate events to detect changes.
|
|
2164
|
+
* @public
|
|
2165
|
+
*/
|
|
2166
|
+
export declare class RouteUtil {
|
|
2167
|
+
/**
|
|
2168
|
+
* The current pathname of the window location.
|
|
2169
|
+
*/
|
|
2170
|
+
pathName: string;
|
|
2171
|
+
private routeCheckInterval;
|
|
2172
|
+
private static instance;
|
|
2173
|
+
private constructor();
|
|
2174
|
+
/**
|
|
2175
|
+
* Gets the singleton instance of RouteUtil.
|
|
2176
|
+
*/
|
|
2177
|
+
static get shared(): RouteUtil;
|
|
2178
|
+
/**
|
|
2179
|
+
* Initialize framework-agnostic route detection
|
|
2180
|
+
*/
|
|
2181
|
+
private initializeRouteDetection;
|
|
2182
|
+
/**
|
|
2183
|
+
* Handle route changes by updating the pathName observable
|
|
2184
|
+
*/
|
|
2185
|
+
private handleRouteChange;
|
|
2186
|
+
/**
|
|
2187
|
+
* Clean up route detection listeners and polling.
|
|
2188
|
+
*/
|
|
2189
|
+
destroy(): void;
|
|
2190
|
+
}
|
|
2191
|
+
|
|
2161
2192
|
/**
|
|
2162
2193
|
* The data for a server row DTO.
|
|
2163
2194
|
* @public
|
|
@@ -107,6 +107,17 @@ An in memory database of specific DatabaseRecord types.
|
|
|
107
107
|
|
|
108
108
|
|
|
109
109
|
|
|
110
|
+
</td></tr>
|
|
111
|
+
<tr><td>
|
|
112
|
+
|
|
113
|
+
[RouteUtil](./foundation-utils.routeutil.md)
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
</td><td>
|
|
117
|
+
|
|
118
|
+
A singleton utility to observe and notify about route changes. It uses both polling and popstate events to detect changes.
|
|
119
|
+
|
|
120
|
+
|
|
110
121
|
</td></tr>
|
|
111
122
|
<tr><td>
|
|
112
123
|
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-utils](./foundation-utils.md) > [RouteUtil](./foundation-utils.routeutil.md) > [destroy](./foundation-utils.routeutil.destroy.md)
|
|
4
|
+
|
|
5
|
+
## RouteUtil.destroy() method
|
|
6
|
+
|
|
7
|
+
Clean up route detection listeners and polling.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
destroy(): void;
|
|
13
|
+
```
|
|
14
|
+
**Returns:**
|
|
15
|
+
|
|
16
|
+
void
|
|
17
|
+
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-utils](./foundation-utils.md) > [RouteUtil](./foundation-utils.routeutil.md)
|
|
4
|
+
|
|
5
|
+
## RouteUtil class
|
|
6
|
+
|
|
7
|
+
A singleton utility to observe and notify about route changes. It uses both polling and popstate events to detect changes.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
export declare class RouteUtil
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Properties
|
|
16
|
+
|
|
17
|
+
<table><thead><tr><th>
|
|
18
|
+
|
|
19
|
+
Property
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
</th><th>
|
|
23
|
+
|
|
24
|
+
Modifiers
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
</th><th>
|
|
28
|
+
|
|
29
|
+
Type
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
</th><th>
|
|
33
|
+
|
|
34
|
+
Description
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
</th></tr></thead>
|
|
38
|
+
<tbody><tr><td>
|
|
39
|
+
|
|
40
|
+
[pathName](./foundation-utils.routeutil.pathname.md)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
</td><td>
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
</td><td>
|
|
47
|
+
|
|
48
|
+
string
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
</td><td>
|
|
52
|
+
|
|
53
|
+
The current pathname of the window location.
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
</td></tr>
|
|
57
|
+
<tr><td>
|
|
58
|
+
|
|
59
|
+
[shared](./foundation-utils.routeutil.shared.md)
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
</td><td>
|
|
63
|
+
|
|
64
|
+
`static`
|
|
65
|
+
|
|
66
|
+
`readonly`
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
</td><td>
|
|
70
|
+
|
|
71
|
+
[RouteUtil](./foundation-utils.routeutil.md)
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
</td><td>
|
|
75
|
+
|
|
76
|
+
Gets the singleton instance of RouteUtil.
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
</td></tr>
|
|
80
|
+
</tbody></table>
|
|
81
|
+
|
|
82
|
+
## Methods
|
|
83
|
+
|
|
84
|
+
<table><thead><tr><th>
|
|
85
|
+
|
|
86
|
+
Method
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
</th><th>
|
|
90
|
+
|
|
91
|
+
Modifiers
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
</th><th>
|
|
95
|
+
|
|
96
|
+
Description
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
</th></tr></thead>
|
|
100
|
+
<tbody><tr><td>
|
|
101
|
+
|
|
102
|
+
[destroy()](./foundation-utils.routeutil.destroy.md)
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
</td><td>
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
</td><td>
|
|
109
|
+
|
|
110
|
+
Clean up route detection listeners and polling.
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
</td></tr>
|
|
114
|
+
</tbody></table>
|
|
115
|
+
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-utils](./foundation-utils.md) > [RouteUtil](./foundation-utils.routeutil.md) > [pathName](./foundation-utils.routeutil.pathname.md)
|
|
4
|
+
|
|
5
|
+
## RouteUtil.pathName property
|
|
6
|
+
|
|
7
|
+
The current pathname of the window location.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
pathName: string;
|
|
13
|
+
```
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-utils](./foundation-utils.md) > [RouteUtil](./foundation-utils.routeutil.md) > [shared](./foundation-utils.routeutil.shared.md)
|
|
4
|
+
|
|
5
|
+
## RouteUtil.shared property
|
|
6
|
+
|
|
7
|
+
Gets the singleton instance of RouteUtil.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
static get shared(): RouteUtil;
|
|
13
|
+
```
|
|
@@ -1430,6 +1430,13 @@ export type ResourceType = (typeof ResourceType)[keyof typeof ResourceType];
|
|
|
1430
1430
|
// @public
|
|
1431
1431
|
export const respondToVisibility: (element: HTMLElement, callback: (arg0: boolean) => any) => (() => void);
|
|
1432
1432
|
|
|
1433
|
+
// @public
|
|
1434
|
+
export class RouteUtil {
|
|
1435
|
+
destroy(): void;
|
|
1436
|
+
pathName: string;
|
|
1437
|
+
static get shared(): RouteUtil;
|
|
1438
|
+
}
|
|
1439
|
+
|
|
1433
1440
|
// @public
|
|
1434
1441
|
export type ServerRowDTO = {
|
|
1435
1442
|
DETAILS: {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@genesislcap/foundation-utils",
|
|
3
3
|
"description": "Genesis Foundation Utils",
|
|
4
|
-
"version": "14.
|
|
4
|
+
"version": "14.401.0-hide-status-pill.3",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"license": "SEE LICENSE IN license.txt",
|
|
7
7
|
"main": "dist/esm/index.js",
|
|
@@ -29,18 +29,18 @@
|
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@genesislcap/foundation-testing": "14.
|
|
33
|
-
"@genesislcap/genx": "14.
|
|
34
|
-
"@genesislcap/rollup-builder": "14.
|
|
35
|
-
"@genesislcap/ts-builder": "14.
|
|
36
|
-
"@genesislcap/uvu-playwright-builder": "14.
|
|
37
|
-
"@genesislcap/vite-builder": "14.
|
|
38
|
-
"@genesislcap/webpack-builder": "14.
|
|
32
|
+
"@genesislcap/foundation-testing": "14.401.0-hide-status-pill.3",
|
|
33
|
+
"@genesislcap/genx": "14.401.0-hide-status-pill.3",
|
|
34
|
+
"@genesislcap/rollup-builder": "14.401.0-hide-status-pill.3",
|
|
35
|
+
"@genesislcap/ts-builder": "14.401.0-hide-status-pill.3",
|
|
36
|
+
"@genesislcap/uvu-playwright-builder": "14.401.0-hide-status-pill.3",
|
|
37
|
+
"@genesislcap/vite-builder": "14.401.0-hide-status-pill.3",
|
|
38
|
+
"@genesislcap/webpack-builder": "14.401.0-hide-status-pill.3",
|
|
39
39
|
"@types/json-schema": "^7.0.11"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@genesislcap/expression-builder": "14.
|
|
43
|
-
"@genesislcap/foundation-logger": "14.
|
|
42
|
+
"@genesislcap/expression-builder": "14.401.0-hide-status-pill.3",
|
|
43
|
+
"@genesislcap/foundation-logger": "14.401.0-hide-status-pill.3",
|
|
44
44
|
"@microsoft/fast-components": "2.30.6",
|
|
45
45
|
"@microsoft/fast-element": "1.14.0",
|
|
46
46
|
"@microsoft/fast-foundation": "2.50.0",
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"access": "public"
|
|
59
59
|
},
|
|
60
60
|
"customElements": "dist/custom-elements.json",
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "a33a2f6941402d0a235942ee0d3fb26d5abb3b64"
|
|
62
62
|
}
|