@genesislcap/foundation-utils 14.400.0 → 14.401.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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",
@@ -564,6 +452,21 @@
564
452
  }
565
453
  ]
566
454
  },
455
+ {
456
+ "kind": "javascript-module",
457
+ "path": "src/encoding/index.ts",
458
+ "declarations": [],
459
+ "exports": [
460
+ {
461
+ "kind": "js",
462
+ "name": "*",
463
+ "declaration": {
464
+ "name": "*",
465
+ "package": "./base64"
466
+ }
467
+ }
468
+ ]
469
+ },
567
470
  {
568
471
  "kind": "javascript-module",
569
472
  "path": "src/directives/index.ts",
@@ -1263,7 +1166,112 @@
1263
1166
  },
1264
1167
  {
1265
1168
  "kind": "javascript-module",
1266
- "path": "src/encoding/index.ts",
1169
+ "path": "src/design-system/design-system.ts",
1170
+ "declarations": [
1171
+ {
1172
+ "kind": "function",
1173
+ "name": "assureDesignSystem",
1174
+ "return": {
1175
+ "type": {
1176
+ "text": "DesignSystemModule"
1177
+ }
1178
+ },
1179
+ "parameters": [
1180
+ {
1181
+ "name": "module",
1182
+ "type": {
1183
+ "text": "DesignSystemModule"
1184
+ }
1185
+ }
1186
+ ],
1187
+ "description": "assureDesignSystem.",
1188
+ "privacy": "public"
1189
+ },
1190
+ {
1191
+ "kind": "function",
1192
+ "name": "getCurrentDesignSystem",
1193
+ "return": {
1194
+ "type": {
1195
+ "text": ""
1196
+ }
1197
+ },
1198
+ "parameters": [
1199
+ {
1200
+ "name": "element",
1201
+ "type": {
1202
+ "text": "HTMLElement"
1203
+ },
1204
+ "description": "The starting HTML element"
1205
+ },
1206
+ {
1207
+ "name": "fallbackPrefix",
1208
+ "type": {
1209
+ "text": "string"
1210
+ },
1211
+ "description": "The prefix to fallback to if the provider is not available"
1212
+ }
1213
+ ],
1214
+ "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.",
1215
+ "privacy": "public"
1216
+ },
1217
+ {
1218
+ "kind": "function",
1219
+ "name": "getCurrentDesignSystemPrefix",
1220
+ "return": {
1221
+ "type": {
1222
+ "text": ""
1223
+ }
1224
+ },
1225
+ "parameters": [
1226
+ {
1227
+ "name": "element",
1228
+ "type": {
1229
+ "text": "HTMLElement"
1230
+ },
1231
+ "description": "The starting HTML element"
1232
+ },
1233
+ {
1234
+ "name": "fallbackPrefix",
1235
+ "type": {
1236
+ "text": "string"
1237
+ },
1238
+ "description": "The prefix to fallback to if the provider is not available"
1239
+ }
1240
+ ],
1241
+ "description": "Get the current design system prefix by checking available providers.\nIf no provider is found, falls back to the provided prefix.",
1242
+ "privacy": "public"
1243
+ }
1244
+ ],
1245
+ "exports": [
1246
+ {
1247
+ "kind": "js",
1248
+ "name": "assureDesignSystem",
1249
+ "declaration": {
1250
+ "name": "assureDesignSystem",
1251
+ "module": "src/design-system/design-system.ts"
1252
+ }
1253
+ },
1254
+ {
1255
+ "kind": "js",
1256
+ "name": "getCurrentDesignSystem",
1257
+ "declaration": {
1258
+ "name": "getCurrentDesignSystem",
1259
+ "module": "src/design-system/design-system.ts"
1260
+ }
1261
+ },
1262
+ {
1263
+ "kind": "js",
1264
+ "name": "getCurrentDesignSystemPrefix",
1265
+ "declaration": {
1266
+ "name": "getCurrentDesignSystemPrefix",
1267
+ "module": "src/design-system/design-system.ts"
1268
+ }
1269
+ }
1270
+ ]
1271
+ },
1272
+ {
1273
+ "kind": "javascript-module",
1274
+ "path": "src/design-system/index.ts",
1267
1275
  "declarations": [],
1268
1276
  "exports": [
1269
1277
  {
@@ -1271,7 +1279,7 @@
1271
1279
  "name": "*",
1272
1280
  "declaration": {
1273
1281
  "name": "*",
1274
- "package": "./base64"
1282
+ "package": "./design-system"
1275
1283
  }
1276
1284
  }
1277
1285
  ]
@@ -2564,7 +2572,7 @@
2564
2572
  },
2565
2573
  {
2566
2574
  "kind": "javascript-module",
2567
- "path": "src/serializers/index.ts",
2575
+ "path": "src/route/index.ts",
2568
2576
  "declarations": [],
2569
2577
  "exports": [
2570
2578
  {
@@ -2572,16 +2580,124 @@
2572
2580
  "name": "*",
2573
2581
  "declaration": {
2574
2582
  "name": "*",
2575
- "package": "./json"
2583
+ "package": "./route"
2576
2584
  }
2577
2585
  }
2578
2586
  ]
2579
2587
  },
2580
2588
  {
2581
2589
  "kind": "javascript-module",
2582
- "path": "src/shortcut-manager/index.ts",
2583
- "declarations": [],
2584
- "exports": [
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
+ },
2681
+ {
2682
+ "kind": "javascript-module",
2683
+ "path": "src/serializers/index.ts",
2684
+ "declarations": [],
2685
+ "exports": [
2686
+ {
2687
+ "kind": "js",
2688
+ "name": "*",
2689
+ "declaration": {
2690
+ "name": "*",
2691
+ "package": "./json"
2692
+ }
2693
+ }
2694
+ ]
2695
+ },
2696
+ {
2697
+ "kind": "javascript-module",
2698
+ "path": "src/shortcut-manager/index.ts",
2699
+ "declarations": [],
2700
+ "exports": [
2585
2701
  {
2586
2702
  "kind": "js",
2587
2703
  "name": "*",
@@ -4143,160 +4259,6 @@
4143
4259
  }
4144
4260
  ]
4145
4261
  },
4146
- {
4147
- "kind": "javascript-module",
4148
- "path": "src/directives/sync/index.ts",
4149
- "declarations": [],
4150
- "exports": [
4151
- {
4152
- "kind": "js",
4153
- "name": "*",
4154
- "declaration": {
4155
- "name": "*",
4156
- "package": "./sync"
4157
- }
4158
- }
4159
- ]
4160
- },
4161
- {
4162
- "kind": "javascript-module",
4163
- "path": "src/directives/sync/sync.ts",
4164
- "declarations": [
4165
- {
4166
- "kind": "variable",
4167
- "name": "defaultEventMap",
4168
- "type": {
4169
- "text": "Map<string, EventName>"
4170
- },
4171
- "default": "new Map([\n ['FAST-TEXT-AREA', 'input'],\n ['FAST-TEXT-FIELD', 'input'],\n ['FOUNDATION-TEXT-AREA', 'input'],\n ['FOUNDATION-TEXT-FIELD', 'input'],\n ['INPUT', 'input'],\n ['ZERO-TEXT-FIELD', 'input'],\n])",
4172
- "description": "A map that associates specific HTML element tags with their corresponding default event names.",
4173
- "privacy": "public"
4174
- },
4175
- {
4176
- "kind": "function",
4177
- "name": "sync",
4178
- "return": {
4179
- "type": {
4180
- "text": "CaptureType<TSource>"
4181
- }
4182
- },
4183
- "parameters": [
4184
- {
4185
- "name": "binding",
4186
- "type": {
4187
- "text": "Binding<TSource, TReturn>"
4188
- }
4189
- },
4190
- {
4191
- "name": "conversionType",
4192
- "default": "'string'",
4193
- "type": {
4194
- "text": "ConversionType"
4195
- }
4196
- },
4197
- {
4198
- "name": "eventName",
4199
- "default": "'default'",
4200
- "type": {
4201
- "text": "EventName"
4202
- }
4203
- },
4204
- {
4205
- "name": "keyAttr",
4206
- "optional": true,
4207
- "type": {
4208
- "text": "string"
4209
- }
4210
- }
4211
- ],
4212
- "description": "Creates a synchronization directive that binds a data source to an HTML element,",
4213
- "privacy": "public"
4214
- }
4215
- ],
4216
- "exports": [
4217
- {
4218
- "kind": "js",
4219
- "name": "defaultEventMap",
4220
- "declaration": {
4221
- "name": "defaultEventMap",
4222
- "module": "src/directives/sync/sync.ts"
4223
- }
4224
- },
4225
- {
4226
- "kind": "js",
4227
- "name": "sync",
4228
- "declaration": {
4229
- "name": "sync",
4230
- "module": "src/directives/sync/sync.ts"
4231
- }
4232
- }
4233
- ]
4234
- },
4235
- {
4236
- "kind": "javascript-module",
4237
- "path": "src/directives/when-else/index.ts",
4238
- "declarations": [],
4239
- "exports": [
4240
- {
4241
- "kind": "js",
4242
- "name": "*",
4243
- "declaration": {
4244
- "name": "*",
4245
- "package": "./when-else"
4246
- }
4247
- }
4248
- ]
4249
- },
4250
- {
4251
- "kind": "javascript-module",
4252
- "path": "src/directives/when-else/when-else.ts",
4253
- "declarations": [
4254
- {
4255
- "kind": "function",
4256
- "name": "whenElse",
4257
- "return": {
4258
- "type": {
4259
- "text": "CaptureType<TSource>"
4260
- }
4261
- },
4262
- "parameters": [
4263
- {
4264
- "name": "binding",
4265
- "type": {
4266
- "text": "Binding<TSource, TReturn>"
4267
- },
4268
- "description": "The condition to test for rendering."
4269
- },
4270
- {
4271
- "name": "trueTemplateOrTemplateBinding",
4272
- "type": {
4273
- "text": "WhenTemplate<TSource>"
4274
- },
4275
- "description": "The template or a binding that gets the template to render when the condition is true."
4276
- },
4277
- {
4278
- "name": "falseTemplateOrTemplateBinding",
4279
- "type": {
4280
- "text": "WhenTemplate<TSource>"
4281
- },
4282
- "description": "The template or a binding that gets the template to render when the condition is false."
4283
- }
4284
- ],
4285
- "description": "Directive that allows supplying an \"else\" template to the traditional https://www.fast.design/docs/api/fast-element.when/#when-function directive",
4286
- "privacy": "public"
4287
- }
4288
- ],
4289
- "exports": [
4290
- {
4291
- "kind": "js",
4292
- "name": "whenElse",
4293
- "declaration": {
4294
- "name": "whenElse",
4295
- "module": "src/directives/when-else/when-else.ts"
4296
- }
4297
- }
4298
- ]
4299
- },
4300
4262
  {
4301
4263
  "kind": "javascript-module",
4302
4264
  "path": "src/encoding/base64/decode.ts",
@@ -4451,6 +4413,160 @@
4451
4413
  }
4452
4414
  ]
4453
4415
  },
4416
+ {
4417
+ "kind": "javascript-module",
4418
+ "path": "src/directives/sync/index.ts",
4419
+ "declarations": [],
4420
+ "exports": [
4421
+ {
4422
+ "kind": "js",
4423
+ "name": "*",
4424
+ "declaration": {
4425
+ "name": "*",
4426
+ "package": "./sync"
4427
+ }
4428
+ }
4429
+ ]
4430
+ },
4431
+ {
4432
+ "kind": "javascript-module",
4433
+ "path": "src/directives/sync/sync.ts",
4434
+ "declarations": [
4435
+ {
4436
+ "kind": "variable",
4437
+ "name": "defaultEventMap",
4438
+ "type": {
4439
+ "text": "Map<string, EventName>"
4440
+ },
4441
+ "default": "new Map([\n ['FAST-TEXT-AREA', 'input'],\n ['FAST-TEXT-FIELD', 'input'],\n ['FOUNDATION-TEXT-AREA', 'input'],\n ['FOUNDATION-TEXT-FIELD', 'input'],\n ['INPUT', 'input'],\n ['ZERO-TEXT-FIELD', 'input'],\n])",
4442
+ "description": "A map that associates specific HTML element tags with their corresponding default event names.",
4443
+ "privacy": "public"
4444
+ },
4445
+ {
4446
+ "kind": "function",
4447
+ "name": "sync",
4448
+ "return": {
4449
+ "type": {
4450
+ "text": "CaptureType<TSource>"
4451
+ }
4452
+ },
4453
+ "parameters": [
4454
+ {
4455
+ "name": "binding",
4456
+ "type": {
4457
+ "text": "Binding<TSource, TReturn>"
4458
+ }
4459
+ },
4460
+ {
4461
+ "name": "conversionType",
4462
+ "default": "'string'",
4463
+ "type": {
4464
+ "text": "ConversionType"
4465
+ }
4466
+ },
4467
+ {
4468
+ "name": "eventName",
4469
+ "default": "'default'",
4470
+ "type": {
4471
+ "text": "EventName"
4472
+ }
4473
+ },
4474
+ {
4475
+ "name": "keyAttr",
4476
+ "optional": true,
4477
+ "type": {
4478
+ "text": "string"
4479
+ }
4480
+ }
4481
+ ],
4482
+ "description": "Creates a synchronization directive that binds a data source to an HTML element,",
4483
+ "privacy": "public"
4484
+ }
4485
+ ],
4486
+ "exports": [
4487
+ {
4488
+ "kind": "js",
4489
+ "name": "defaultEventMap",
4490
+ "declaration": {
4491
+ "name": "defaultEventMap",
4492
+ "module": "src/directives/sync/sync.ts"
4493
+ }
4494
+ },
4495
+ {
4496
+ "kind": "js",
4497
+ "name": "sync",
4498
+ "declaration": {
4499
+ "name": "sync",
4500
+ "module": "src/directives/sync/sync.ts"
4501
+ }
4502
+ }
4503
+ ]
4504
+ },
4505
+ {
4506
+ "kind": "javascript-module",
4507
+ "path": "src/directives/when-else/index.ts",
4508
+ "declarations": [],
4509
+ "exports": [
4510
+ {
4511
+ "kind": "js",
4512
+ "name": "*",
4513
+ "declaration": {
4514
+ "name": "*",
4515
+ "package": "./when-else"
4516
+ }
4517
+ }
4518
+ ]
4519
+ },
4520
+ {
4521
+ "kind": "javascript-module",
4522
+ "path": "src/directives/when-else/when-else.ts",
4523
+ "declarations": [
4524
+ {
4525
+ "kind": "function",
4526
+ "name": "whenElse",
4527
+ "return": {
4528
+ "type": {
4529
+ "text": "CaptureType<TSource>"
4530
+ }
4531
+ },
4532
+ "parameters": [
4533
+ {
4534
+ "name": "binding",
4535
+ "type": {
4536
+ "text": "Binding<TSource, TReturn>"
4537
+ },
4538
+ "description": "The condition to test for rendering."
4539
+ },
4540
+ {
4541
+ "name": "trueTemplateOrTemplateBinding",
4542
+ "type": {
4543
+ "text": "WhenTemplate<TSource>"
4544
+ },
4545
+ "description": "The template or a binding that gets the template to render when the condition is true."
4546
+ },
4547
+ {
4548
+ "name": "falseTemplateOrTemplateBinding",
4549
+ "type": {
4550
+ "text": "WhenTemplate<TSource>"
4551
+ },
4552
+ "description": "The template or a binding that gets the template to render when the condition is false."
4553
+ }
4554
+ ],
4555
+ "description": "Directive that allows supplying an \"else\" template to the traditional https://www.fast.design/docs/api/fast-element.when/#when-function directive",
4556
+ "privacy": "public"
4557
+ }
4558
+ ],
4559
+ "exports": [
4560
+ {
4561
+ "kind": "js",
4562
+ "name": "whenElse",
4563
+ "declaration": {
4564
+ "name": "whenElse",
4565
+ "module": "src/directives/when-else/when-else.ts"
4566
+ }
4567
+ }
4568
+ ]
4569
+ },
4454
4570
  {
4455
4571
  "kind": "javascript-module",
4456
4572
  "path": "src/mappers/dto/index.ts",
@@ -13,6 +13,7 @@ export * from './mixins';
13
13
  export * from './observer';
14
14
  export * from './promise';
15
15
  export * from './resource';
16
+ export * from './route';
16
17
  export * from './serializers';
17
18
  export * from './shortcut-manager';
18
19
  export * from './state';
@@ -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,2 @@
1
+ export * from './route';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -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
@@ -13,6 +13,7 @@ export * from './mixins';
13
13
  export * from './observer';
14
14
  export * from './promise';
15
15
  export * from './resource';
16
+ export * from './route';
16
17
  export * from './serializers';
17
18
  export * from './shortcut-manager';
18
19
  export * from './state';
@@ -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) &gt; [@genesislcap/foundation-utils](./foundation-utils.md) &gt; [RouteUtil](./foundation-utils.routeutil.md) &gt; [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) &gt; [@genesislcap/foundation-utils](./foundation-utils.md) &gt; [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) &gt; [@genesislcap/foundation-utils](./foundation-utils.md) &gt; [RouteUtil](./foundation-utils.routeutil.md) &gt; [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) &gt; [@genesislcap/foundation-utils](./foundation-utils.md) &gt; [RouteUtil](./foundation-utils.routeutil.md) &gt; [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.400.0",
4
+ "version": "14.401.0",
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.400.0",
33
- "@genesislcap/genx": "14.400.0",
34
- "@genesislcap/rollup-builder": "14.400.0",
35
- "@genesislcap/ts-builder": "14.400.0",
36
- "@genesislcap/uvu-playwright-builder": "14.400.0",
37
- "@genesislcap/vite-builder": "14.400.0",
38
- "@genesislcap/webpack-builder": "14.400.0",
32
+ "@genesislcap/foundation-testing": "14.401.0",
33
+ "@genesislcap/genx": "14.401.0",
34
+ "@genesislcap/rollup-builder": "14.401.0",
35
+ "@genesislcap/ts-builder": "14.401.0",
36
+ "@genesislcap/uvu-playwright-builder": "14.401.0",
37
+ "@genesislcap/vite-builder": "14.401.0",
38
+ "@genesislcap/webpack-builder": "14.401.0",
39
39
  "@types/json-schema": "^7.0.11"
40
40
  },
41
41
  "dependencies": {
42
- "@genesislcap/expression-builder": "14.400.0",
43
- "@genesislcap/foundation-logger": "14.400.0",
42
+ "@genesislcap/expression-builder": "14.401.0",
43
+ "@genesislcap/foundation-logger": "14.401.0",
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": "e95f4522e1f30ffbd0d7ac427199da5cc7df7de8"
61
+ "gitHead": "acec5783b3e1674b2be3d3a31c056264cef0c5f6"
62
62
  }