@genesislcap/foundation-utils 15.64.1-alpha-ddbd4ead05.0 → 15.64.1-alpha-a0f02c875a.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.
- package/dist/custom-elements.json +132 -95
- package/dist/dts/design-system/editable-elements.d.ts +12 -0
- package/dist/dts/design-system/editable-elements.d.ts.map +1 -1
- package/dist/dts/shortcut-manager/shortcut-keyboard.d.ts +0 -16
- package/dist/dts/shortcut-manager/shortcut-keyboard.d.ts.map +1 -1
- package/dist/dts/shortcut-manager/shortcut-listener.d.ts +1 -0
- package/dist/dts/shortcut-manager/shortcut-listener.d.ts.map +1 -1
- package/dist/dts/shortcut-manager/shortcut-manager.d.ts +0 -7
- package/dist/dts/shortcut-manager/shortcut-manager.d.ts.map +1 -1
- package/dist/esm/design-system/editable-elements.js +43 -0
- package/dist/esm/shortcut-manager/shortcut-keyboard.js +0 -41
- package/dist/esm/shortcut-manager/shortcut-listener.js +11 -3
- package/dist/esm/shortcut-manager/shortcut-manager.js +1 -13
- package/dist/foundation-utils.api.json +62 -95
- package/dist/foundation-utils.d.ts +14 -7
- package/package.json +9 -9
|
@@ -456,6 +456,82 @@
|
|
|
456
456
|
}
|
|
457
457
|
]
|
|
458
458
|
},
|
|
459
|
+
{
|
|
460
|
+
"kind": "javascript-module",
|
|
461
|
+
"path": "src/directives/index.ts",
|
|
462
|
+
"declarations": [],
|
|
463
|
+
"exports": [
|
|
464
|
+
{
|
|
465
|
+
"kind": "js",
|
|
466
|
+
"name": "*",
|
|
467
|
+
"declaration": {
|
|
468
|
+
"name": "*",
|
|
469
|
+
"package": "./sync"
|
|
470
|
+
}
|
|
471
|
+
},
|
|
472
|
+
{
|
|
473
|
+
"kind": "js",
|
|
474
|
+
"name": "*",
|
|
475
|
+
"declaration": {
|
|
476
|
+
"name": "*",
|
|
477
|
+
"package": "./when-else"
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
]
|
|
481
|
+
},
|
|
482
|
+
{
|
|
483
|
+
"kind": "javascript-module",
|
|
484
|
+
"path": "src/decorators/index.ts",
|
|
485
|
+
"declarations": [],
|
|
486
|
+
"exports": [
|
|
487
|
+
{
|
|
488
|
+
"kind": "js",
|
|
489
|
+
"name": "*",
|
|
490
|
+
"declaration": {
|
|
491
|
+
"name": "*",
|
|
492
|
+
"package": "./renderOnChange"
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
]
|
|
496
|
+
},
|
|
497
|
+
{
|
|
498
|
+
"kind": "javascript-module",
|
|
499
|
+
"path": "src/decorators/renderOnChange.ts",
|
|
500
|
+
"declarations": [
|
|
501
|
+
{
|
|
502
|
+
"kind": "function",
|
|
503
|
+
"name": "renderOnChange",
|
|
504
|
+
"parameters": [
|
|
505
|
+
{
|
|
506
|
+
"name": "target",
|
|
507
|
+
"type": {
|
|
508
|
+
"text": "FASTElement & { render(): void }"
|
|
509
|
+
},
|
|
510
|
+
"description": "The target to define the property change handler on."
|
|
511
|
+
},
|
|
512
|
+
{
|
|
513
|
+
"name": "name",
|
|
514
|
+
"type": {
|
|
515
|
+
"text": "string"
|
|
516
|
+
},
|
|
517
|
+
"description": "The property name."
|
|
518
|
+
}
|
|
519
|
+
],
|
|
520
|
+
"description": "Defines a property changed handler that calls a render() method on the target as an internal observation enhancement.",
|
|
521
|
+
"privacy": "public"
|
|
522
|
+
}
|
|
523
|
+
],
|
|
524
|
+
"exports": [
|
|
525
|
+
{
|
|
526
|
+
"kind": "js",
|
|
527
|
+
"name": "renderOnChange",
|
|
528
|
+
"declaration": {
|
|
529
|
+
"name": "renderOnChange",
|
|
530
|
+
"module": "src/decorators/renderOnChange.ts"
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
]
|
|
534
|
+
},
|
|
459
535
|
{
|
|
460
536
|
"kind": "javascript-module",
|
|
461
537
|
"path": "src/design-system/design-system.ts",
|
|
@@ -606,6 +682,34 @@
|
|
|
606
682
|
}
|
|
607
683
|
}
|
|
608
684
|
]
|
|
685
|
+
},
|
|
686
|
+
{
|
|
687
|
+
"kind": "function",
|
|
688
|
+
"name": "isEditableKeyboardEvent",
|
|
689
|
+
"return": {
|
|
690
|
+
"type": {
|
|
691
|
+
"text": "boolean"
|
|
692
|
+
}
|
|
693
|
+
},
|
|
694
|
+
"parameters": [
|
|
695
|
+
{
|
|
696
|
+
"name": "event",
|
|
697
|
+
"type": {
|
|
698
|
+
"text": "KeyboardEvent"
|
|
699
|
+
},
|
|
700
|
+
"description": "The keyboard event."
|
|
701
|
+
},
|
|
702
|
+
{
|
|
703
|
+
"name": "editableSelector",
|
|
704
|
+
"default": "DEFAULT_EDITABLE_ELEMENT_SELECTOR",
|
|
705
|
+
"type": {
|
|
706
|
+
"text": "string"
|
|
707
|
+
},
|
|
708
|
+
"description": "CSS selector for editable elements. Defaults to the base selectors plus\nrapid editable hosts."
|
|
709
|
+
}
|
|
710
|
+
],
|
|
711
|
+
"description": "Whether a keyboard event comes from an editable element, i.e. the user is typing.",
|
|
712
|
+
"privacy": "public"
|
|
609
713
|
}
|
|
610
714
|
],
|
|
611
715
|
"exports": [
|
|
@@ -632,6 +736,14 @@
|
|
|
632
736
|
"name": "buildEditableElementSelector",
|
|
633
737
|
"module": "src/design-system/editable-elements.ts"
|
|
634
738
|
}
|
|
739
|
+
},
|
|
740
|
+
{
|
|
741
|
+
"kind": "js",
|
|
742
|
+
"name": "isEditableKeyboardEvent",
|
|
743
|
+
"declaration": {
|
|
744
|
+
"name": "isEditableKeyboardEvent",
|
|
745
|
+
"module": "src/design-system/editable-elements.ts"
|
|
746
|
+
}
|
|
635
747
|
}
|
|
636
748
|
]
|
|
637
749
|
},
|
|
@@ -660,7 +772,7 @@
|
|
|
660
772
|
},
|
|
661
773
|
{
|
|
662
774
|
"kind": "javascript-module",
|
|
663
|
-
"path": "src/
|
|
775
|
+
"path": "src/encoding/index.ts",
|
|
664
776
|
"declarations": [],
|
|
665
777
|
"exports": [
|
|
666
778
|
{
|
|
@@ -668,15 +780,7 @@
|
|
|
668
780
|
"name": "*",
|
|
669
781
|
"declaration": {
|
|
670
782
|
"name": "*",
|
|
671
|
-
"package": "./
|
|
672
|
-
}
|
|
673
|
-
},
|
|
674
|
-
{
|
|
675
|
-
"kind": "js",
|
|
676
|
-
"name": "*",
|
|
677
|
-
"declaration": {
|
|
678
|
-
"name": "*",
|
|
679
|
-
"package": "./when-else"
|
|
783
|
+
"package": "./base64"
|
|
680
784
|
}
|
|
681
785
|
}
|
|
682
786
|
]
|
|
@@ -1180,74 +1284,6 @@
|
|
|
1180
1284
|
}
|
|
1181
1285
|
]
|
|
1182
1286
|
},
|
|
1183
|
-
{
|
|
1184
|
-
"kind": "javascript-module",
|
|
1185
|
-
"path": "src/encoding/index.ts",
|
|
1186
|
-
"declarations": [],
|
|
1187
|
-
"exports": [
|
|
1188
|
-
{
|
|
1189
|
-
"kind": "js",
|
|
1190
|
-
"name": "*",
|
|
1191
|
-
"declaration": {
|
|
1192
|
-
"name": "*",
|
|
1193
|
-
"package": "./base64"
|
|
1194
|
-
}
|
|
1195
|
-
}
|
|
1196
|
-
]
|
|
1197
|
-
},
|
|
1198
|
-
{
|
|
1199
|
-
"kind": "javascript-module",
|
|
1200
|
-
"path": "src/decorators/index.ts",
|
|
1201
|
-
"declarations": [],
|
|
1202
|
-
"exports": [
|
|
1203
|
-
{
|
|
1204
|
-
"kind": "js",
|
|
1205
|
-
"name": "*",
|
|
1206
|
-
"declaration": {
|
|
1207
|
-
"name": "*",
|
|
1208
|
-
"package": "./renderOnChange"
|
|
1209
|
-
}
|
|
1210
|
-
}
|
|
1211
|
-
]
|
|
1212
|
-
},
|
|
1213
|
-
{
|
|
1214
|
-
"kind": "javascript-module",
|
|
1215
|
-
"path": "src/decorators/renderOnChange.ts",
|
|
1216
|
-
"declarations": [
|
|
1217
|
-
{
|
|
1218
|
-
"kind": "function",
|
|
1219
|
-
"name": "renderOnChange",
|
|
1220
|
-
"parameters": [
|
|
1221
|
-
{
|
|
1222
|
-
"name": "target",
|
|
1223
|
-
"type": {
|
|
1224
|
-
"text": "FASTElement & { render(): void }"
|
|
1225
|
-
},
|
|
1226
|
-
"description": "The target to define the property change handler on."
|
|
1227
|
-
},
|
|
1228
|
-
{
|
|
1229
|
-
"name": "name",
|
|
1230
|
-
"type": {
|
|
1231
|
-
"text": "string"
|
|
1232
|
-
},
|
|
1233
|
-
"description": "The property name."
|
|
1234
|
-
}
|
|
1235
|
-
],
|
|
1236
|
-
"description": "Defines a property changed handler that calls a render() method on the target as an internal observation enhancement.",
|
|
1237
|
-
"privacy": "public"
|
|
1238
|
-
}
|
|
1239
|
-
],
|
|
1240
|
-
"exports": [
|
|
1241
|
-
{
|
|
1242
|
-
"kind": "js",
|
|
1243
|
-
"name": "renderOnChange",
|
|
1244
|
-
"declaration": {
|
|
1245
|
-
"name": "renderOnChange",
|
|
1246
|
-
"module": "src/decorators/renderOnChange.ts"
|
|
1247
|
-
}
|
|
1248
|
-
}
|
|
1249
|
-
]
|
|
1250
|
-
},
|
|
1251
1287
|
{
|
|
1252
1288
|
"kind": "javascript-module",
|
|
1253
1289
|
"path": "src/error/errorMap.ts",
|
|
@@ -3301,6 +3337,24 @@
|
|
|
3301
3337
|
}
|
|
3302
3338
|
}
|
|
3303
3339
|
]
|
|
3340
|
+
},
|
|
3341
|
+
{
|
|
3342
|
+
"kind": "method",
|
|
3343
|
+
"name": "getEventElement",
|
|
3344
|
+
"privacy": "private",
|
|
3345
|
+
"return": {
|
|
3346
|
+
"type": {
|
|
3347
|
+
"text": "Element | null"
|
|
3348
|
+
}
|
|
3349
|
+
},
|
|
3350
|
+
"parameters": [
|
|
3351
|
+
{
|
|
3352
|
+
"name": "event",
|
|
3353
|
+
"type": {
|
|
3354
|
+
"text": "KeyboardEvent"
|
|
3355
|
+
}
|
|
3356
|
+
}
|
|
3357
|
+
]
|
|
3304
3358
|
}
|
|
3305
3359
|
],
|
|
3306
3360
|
"superclass": {
|
|
@@ -3809,23 +3863,6 @@
|
|
|
3809
3863
|
}
|
|
3810
3864
|
}
|
|
3811
3865
|
},
|
|
3812
|
-
{
|
|
3813
|
-
"kind": "method",
|
|
3814
|
-
"name": "isEditableContext",
|
|
3815
|
-
"return": {
|
|
3816
|
-
"type": {
|
|
3817
|
-
"text": "boolean"
|
|
3818
|
-
}
|
|
3819
|
-
},
|
|
3820
|
-
"parameters": [
|
|
3821
|
-
{
|
|
3822
|
-
"name": "event",
|
|
3823
|
-
"type": {
|
|
3824
|
-
"text": "KeyboardEvent"
|
|
3825
|
-
}
|
|
3826
|
-
}
|
|
3827
|
-
]
|
|
3828
|
-
},
|
|
3829
3866
|
{
|
|
3830
3867
|
"kind": "method",
|
|
3831
3868
|
"name": "configureBlockedMessages",
|
|
@@ -9,4 +9,16 @@ export declare const BASE_EDITABLE_ELEMENT_SELECTORS: readonly ["input", "textar
|
|
|
9
9
|
*/
|
|
10
10
|
export declare const DESIGN_SYSTEM_EDITABLE_ELEMENT_SELECTORS: Record<EditableDesignSystemPrefix, readonly string[]>;
|
|
11
11
|
export declare function buildEditableElementSelector(designSystems: readonly EditableDesignSystemPrefix[], customEditableSelectors?: readonly string[]): string;
|
|
12
|
+
/**
|
|
13
|
+
* Whether a keyboard event comes from an editable element, i.e. the user is typing.
|
|
14
|
+
* @remarks Checks the innermost event target (through shadow roots), then the deep active element.
|
|
15
|
+
* An element counts as editable when it is `contenteditable` or matches / is nested in an element
|
|
16
|
+
* matching `editableSelector`. Pass `shortcutManager.getEditableSelector()` to use the selector
|
|
17
|
+
* configured via `configureEditableContext`.
|
|
18
|
+
* @param event - The keyboard event.
|
|
19
|
+
* @param editableSelector - CSS selector for editable elements. Defaults to the base selectors plus
|
|
20
|
+
* rapid editable hosts.
|
|
21
|
+
* @public
|
|
22
|
+
*/
|
|
23
|
+
export declare function isEditableKeyboardEvent(event: KeyboardEvent, editableSelector?: string): boolean;
|
|
12
24
|
//# sourceMappingURL=editable-elements.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editable-elements.d.ts","sourceRoot":"","sources":["../../../src/design-system/editable-elements.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,0BAA0B,GAAG,OAAO,GAAG,MAAM,CAAC;AAW1D;;;GAGG;AACH,eAAO,MAAM,+BAA+B,uKAIlC,CAAC;AAMX;;GAEG;AACH,eAAO,MAAM,wCAAwC,EAAE,MAAM,CAC3D,0BAA0B,EAC1B,SAAS,MAAM,EAAE,CAIlB,CAAC;AAEF,wBAAgB,4BAA4B,CAC1C,aAAa,EAAE,SAAS,0BAA0B,EAAE,EACpD,uBAAuB,GAAE,SAAS,MAAM,EAAO,GAC9C,MAAM,CASR"}
|
|
1
|
+
{"version":3,"file":"editable-elements.d.ts","sourceRoot":"","sources":["../../../src/design-system/editable-elements.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,0BAA0B,GAAG,OAAO,GAAG,MAAM,CAAC;AAW1D;;;GAGG;AACH,eAAO,MAAM,+BAA+B,uKAIlC,CAAC;AAMX;;GAEG;AACH,eAAO,MAAM,wCAAwC,EAAE,MAAM,CAC3D,0BAA0B,EAC1B,SAAS,MAAM,EAAE,CAIlB,CAAC;AAEF,wBAAgB,4BAA4B,CAC1C,aAAa,EAAE,SAAS,0BAA0B,EAAE,EACpD,uBAAuB,GAAE,SAAS,MAAM,EAAO,GAC9C,MAAM,CASR;AAsCD;;;;;;;;;;GAUG;AACH,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,aAAa,EACpB,gBAAgB,GAAE,MAA0C,GAC3D,OAAO,CAKT"}
|
|
@@ -4,20 +4,4 @@
|
|
|
4
4
|
* @public
|
|
5
5
|
*/
|
|
6
6
|
export declare function extractKeyFromCode(code: string): string;
|
|
7
|
-
/**
|
|
8
|
-
* Resolves the innermost element the keyboard event originated from, looking through shadow roots.
|
|
9
|
-
* @internal
|
|
10
|
-
*/
|
|
11
|
-
export declare function getEventElement(event: KeyboardEvent): Element | null;
|
|
12
|
-
/**
|
|
13
|
-
* Walks `document.activeElement` through nested shadow roots to the deepest focused element.
|
|
14
|
-
* @internal
|
|
15
|
-
*/
|
|
16
|
-
export declare function getDeepActiveElement(): Element | null;
|
|
17
|
-
/**
|
|
18
|
-
* Whether the element is editable for shortcut purposes: `contenteditable`, or matching / nested in
|
|
19
|
-
* an element matching the editable selector.
|
|
20
|
-
* @internal
|
|
21
|
-
*/
|
|
22
|
-
export declare function isEditableElement(element: Element | null, editableSelector: string): boolean;
|
|
23
7
|
//# sourceMappingURL=shortcut-keyboard.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shortcut-keyboard.d.ts","sourceRoot":"","sources":["../../../src/shortcut-manager/shortcut-keyboard.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"shortcut-keyboard.d.ts","sourceRoot":"","sources":["../../../src/shortcut-manager/shortcut-keyboard.ts"],"names":[],"mappings":"AA8BA;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAiBvD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shortcut-listener.d.ts","sourceRoot":"","sources":["../../../src/shortcut-manager/shortcut-listener.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,WAAW,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"shortcut-listener.d.ts","sourceRoot":"","sources":["../../../src/shortcut-manager/shortcut-listener.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAKrE,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD;;;;GAIG;AACH,qBAGa,0BAA2B,SAAQ,WAAW;IAChC,eAAe,EAAE,eAAe,CAAC;IAE1D,OAAO,CAAC,WAAW,CAAiD;IACpE,OAAO,CAAC,WAAW,CAAS;IAE5B,iBAAiB;IAKjB,oBAAoB;IAKpB,OAAO,CAAC,cAAc;IAQtB,OAAO,CAAC,iBAAiB;IAQzB,OAAO,CAAC,aAAa;IA6CrB,OAAO,CAAC,eAAe;CAKxB"}
|
|
@@ -119,12 +119,6 @@ export interface ShortcutManager {
|
|
|
119
119
|
configureEditableContext(config?: ShortcutEditableContextConfig): void;
|
|
120
120
|
getEditableContextConfig(): Required<ShortcutEditableContextConfig>;
|
|
121
121
|
getEditableSelector(): string;
|
|
122
|
-
/**
|
|
123
|
-
* Whether the event's target, or the deep active element, is editable for shortcut purposes.
|
|
124
|
-
* Uses the selector from `configureEditableContext` / `getEditableSelector`.
|
|
125
|
-
* @public
|
|
126
|
-
*/
|
|
127
|
-
isEditableContext(event: KeyboardEvent): boolean;
|
|
128
122
|
configureBlockedMessages(config?: ShortcutBlockedMessageConfig): void;
|
|
129
123
|
getBlockedMessages(): Required<ShortcutBlockedMessageConfig>;
|
|
130
124
|
}
|
|
@@ -168,7 +162,6 @@ export declare class DefaultShortcutManager implements ShortcutManager {
|
|
|
168
162
|
configureEditableContext(config?: ShortcutEditableContextConfig): void;
|
|
169
163
|
getEditableContextConfig(): Required<ShortcutEditableContextConfig>;
|
|
170
164
|
getEditableSelector(): string;
|
|
171
|
-
isEditableContext(event: KeyboardEvent): boolean;
|
|
172
165
|
configureBlockedMessages(config?: ShortcutBlockedMessageConfig): void;
|
|
173
166
|
getBlockedMessages(): Required<ShortcutBlockedMessageConfig>;
|
|
174
167
|
pause(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shortcut-manager.d.ts","sourceRoot":"","sources":["../../../src/shortcut-manager/shortcut-manager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AACnD,OAAO,EAEL,0BAA0B,EAC3B,MAAM,oCAAoC,CAAC;AAG5C,OAAO,EACL,sBAAsB,EAOvB,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"shortcut-manager.d.ts","sourceRoot":"","sources":["../../../src/shortcut-manager/shortcut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AO,EAAE,MAAM,GAAG,IAAI;IAKvC,gBAAgB,IAAI,MAAM,GAAG,SAAS;IAItC,kBAAkB,IAAI,IAAI;IAI1B,sBAAsB,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,uBAAuB,GAAG,OAAO,GAAG,IAAI;IAIxF,wBAAwB,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;IAI1C,oBAAoB,IAAI,IAAI;IAI5B,wBAAwB,CAAC,MAAM,GAAE,6BAAkC,GAAG,IAAI;IAyB1E,wBAAwB,IAAI,QAAQ,CAAC,6BAA6B,CAAC;IAOnE,mBAAmB,IAAI,MAAM;IAI7B,wBAAwB,CAAC,MAAM,GAAE,4BAAiC,GAAG,IAAI;IAgCzE,kBAAkB,IAAI,QAAQ,CAAC,4BAA4B,CAAC;IAI5D,KAAK,IAAI,IAAI;IAIb,MAAM,IAAI,IAAI;IAId;;;OAGG;IACH,OAAO,CAAC,2BAA2B;IAYnC,OAAO,CAAC,uBAAuB;IAkB/B,OAAO,CAAC,gBAAgB;IAOxB,OAAO,CAAC,kBAAkB;IAiB1B,OAAO,CAAC,uBAAuB;IAY/B,OAAO,CAAC,uBAAuB;CAMhC;AAED;;;GAGG;AACH,eAAO,MAAM,eAAe,uEAE3B,CAAC"}
|
|
@@ -28,3 +28,46 @@ export function buildEditableElementSelector(designSystems, customEditableSelect
|
|
|
28
28
|
const customSelectors = customEditableSelectors.filter(Boolean);
|
|
29
29
|
return Array.from(new Set([...BASE_EDITABLE_ELEMENT_SELECTORS, ...designSystemSelectors, ...customSelectors])).join(',');
|
|
30
30
|
}
|
|
31
|
+
const DEFAULT_EDITABLE_ELEMENT_SELECTOR = buildEditableElementSelector(['rapid']);
|
|
32
|
+
const ELEMENT_NODE = 1;
|
|
33
|
+
const isElement = (value) => (value === null || value === void 0 ? void 0 : value.nodeType) === ELEMENT_NODE;
|
|
34
|
+
function getEventElement(event) {
|
|
35
|
+
var _a, _b, _c;
|
|
36
|
+
const path = (_b = (_a = event.composedPath) === null || _a === void 0 ? void 0 : _a.call(event)) !== null && _b !== void 0 ? _b : [];
|
|
37
|
+
return (_c = path.find(isElement)) !== null && _c !== void 0 ? _c : (isElement(event.target) ? event.target : null);
|
|
38
|
+
}
|
|
39
|
+
function getDeepActiveElement() {
|
|
40
|
+
var _a, _b;
|
|
41
|
+
let active = (_a = document.activeElement) !== null && _a !== void 0 ? _a : null;
|
|
42
|
+
while ((_b = active === null || active === void 0 ? void 0 : active.shadowRoot) === null || _b === void 0 ? void 0 : _b.activeElement) {
|
|
43
|
+
active = active.shadowRoot.activeElement;
|
|
44
|
+
}
|
|
45
|
+
return active;
|
|
46
|
+
}
|
|
47
|
+
const isEditableAttributeValue = (value) => value !== null && value.toLowerCase() !== 'false';
|
|
48
|
+
function isEditableElement(element, editableSelector) {
|
|
49
|
+
if (!element)
|
|
50
|
+
return false;
|
|
51
|
+
if (isEditableAttributeValue(element.getAttribute('contenteditable')) ||
|
|
52
|
+
element.isContentEditable) {
|
|
53
|
+
return true;
|
|
54
|
+
}
|
|
55
|
+
if (!editableSelector)
|
|
56
|
+
return false;
|
|
57
|
+
return element.matches(editableSelector) || !!element.closest(editableSelector);
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Whether a keyboard event comes from an editable element, i.e. the user is typing.
|
|
61
|
+
* @remarks Checks the innermost event target (through shadow roots), then the deep active element.
|
|
62
|
+
* An element counts as editable when it is `contenteditable` or matches / is nested in an element
|
|
63
|
+
* matching `editableSelector`. Pass `shortcutManager.getEditableSelector()` to use the selector
|
|
64
|
+
* configured via `configureEditableContext`.
|
|
65
|
+
* @param event - The keyboard event.
|
|
66
|
+
* @param editableSelector - CSS selector for editable elements. Defaults to the base selectors plus
|
|
67
|
+
* rapid editable hosts.
|
|
68
|
+
* @public
|
|
69
|
+
*/
|
|
70
|
+
export function isEditableKeyboardEvent(event, editableSelector = DEFAULT_EDITABLE_ELEMENT_SELECTOR) {
|
|
71
|
+
return (isEditableElement(getEventElement(event), editableSelector) ||
|
|
72
|
+
isEditableElement(getDeepActiveElement(), editableSelector));
|
|
73
|
+
}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
const ELEMENT_NODE = 1;
|
|
2
|
-
const isElement = (value) => (value === null || value === void 0 ? void 0 : value.nodeType) === ELEMENT_NODE;
|
|
3
1
|
const specialKeyMap = {
|
|
4
2
|
Space: 'space',
|
|
5
3
|
Enter: 'enter',
|
|
@@ -49,42 +47,3 @@ export function extractKeyFromCode(code) {
|
|
|
49
47
|
// Handle special keys with direct mapping
|
|
50
48
|
return specialKeyMap[code] || code.toLowerCase();
|
|
51
49
|
}
|
|
52
|
-
/**
|
|
53
|
-
* Resolves the innermost element the keyboard event originated from, looking through shadow roots.
|
|
54
|
-
* @internal
|
|
55
|
-
*/
|
|
56
|
-
export function getEventElement(event) {
|
|
57
|
-
var _a, _b;
|
|
58
|
-
const path = (_b = (_a = event.composedPath) === null || _a === void 0 ? void 0 : _a.call(event)) !== null && _b !== void 0 ? _b : [];
|
|
59
|
-
const fromPath = path.find(isElement);
|
|
60
|
-
return fromPath !== null && fromPath !== void 0 ? fromPath : (isElement(event.target) ? event.target : null);
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* Walks `document.activeElement` through nested shadow roots to the deepest focused element.
|
|
64
|
-
* @internal
|
|
65
|
-
*/
|
|
66
|
-
export function getDeepActiveElement() {
|
|
67
|
-
var _a, _b;
|
|
68
|
-
let active = (_a = document.activeElement) !== null && _a !== void 0 ? _a : null;
|
|
69
|
-
while ((_b = active === null || active === void 0 ? void 0 : active.shadowRoot) === null || _b === void 0 ? void 0 : _b.activeElement) {
|
|
70
|
-
active = active.shadowRoot.activeElement;
|
|
71
|
-
}
|
|
72
|
-
return active;
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* Whether the element is editable for shortcut purposes: `contenteditable`, or matching / nested in
|
|
76
|
-
* an element matching the editable selector.
|
|
77
|
-
* @internal
|
|
78
|
-
*/
|
|
79
|
-
export function isEditableElement(element, editableSelector) {
|
|
80
|
-
if (!element)
|
|
81
|
-
return false;
|
|
82
|
-
const isEditableContent = (value) => value !== null && value !== undefined && value.toLowerCase() !== 'false';
|
|
83
|
-
if (isEditableContent(element.getAttribute('contenteditable')) ||
|
|
84
|
-
element.isContentEditable) {
|
|
85
|
-
return true;
|
|
86
|
-
}
|
|
87
|
-
if (!editableSelector)
|
|
88
|
-
return false;
|
|
89
|
-
return element.matches(editableSelector) || !!element.closest(editableSelector);
|
|
90
|
-
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
2
|
import { customElement, FASTElement } from '@microsoft/fast-element';
|
|
3
3
|
import { inject } from '@microsoft/fast-foundation';
|
|
4
|
+
import { isEditableKeyboardEvent } from '../design-system/editable-elements';
|
|
4
5
|
import { emitShortcutBlockedEvent } from './shortcut-events';
|
|
5
|
-
import { extractKeyFromCode
|
|
6
|
+
import { extractKeyFromCode } from './shortcut-keyboard';
|
|
6
7
|
import { ShortcutManager } from './shortcut-manager';
|
|
7
8
|
/**
|
|
8
9
|
* A custom element that listens for keyboard shortcuts.
|
|
@@ -41,7 +42,8 @@ let FoundationShortcutListener = class FoundationShortcutListener extends FASTEl
|
|
|
41
42
|
var _a, _b;
|
|
42
43
|
const manager = this.shortcutManager;
|
|
43
44
|
const blockedMessages = manager.getBlockedMessages();
|
|
44
|
-
const
|
|
45
|
+
const editableSelector = manager.getEditableSelector();
|
|
46
|
+
const eventTarget = (_a = this.getEventElement(event)) !== null && _a !== void 0 ? _a : this;
|
|
45
47
|
const hasModifier = event.ctrlKey || event.altKey || event.shiftKey || event.metaKey;
|
|
46
48
|
// Extract key from event.code with proper mapping for all key types
|
|
47
49
|
const key = extractKeyFromCode(event.code);
|
|
@@ -50,7 +52,7 @@ let FoundationShortcutListener = class FoundationShortcutListener extends FASTEl
|
|
|
50
52
|
return;
|
|
51
53
|
}
|
|
52
54
|
// Don't handle shortcuts while user is typing in editable fields.
|
|
53
|
-
if (
|
|
55
|
+
if (isEditableKeyboardEvent(event, editableSelector)) {
|
|
54
56
|
if (hasModifier && shortcut.emitBlockedEvent !== false) {
|
|
55
57
|
emitShortcutBlockedEvent({
|
|
56
58
|
shortcutId: shortcut.id,
|
|
@@ -67,6 +69,12 @@ let FoundationShortcutListener = class FoundationShortcutListener extends FASTEl
|
|
|
67
69
|
manager.executeShortcut(shortcut.id, eventTarget);
|
|
68
70
|
}
|
|
69
71
|
}
|
|
72
|
+
getEventElement(event) {
|
|
73
|
+
var _a, _b, _c;
|
|
74
|
+
const path = (_b = (_a = event.composedPath) === null || _a === void 0 ? void 0 : _a.call(event)) !== null && _b !== void 0 ? _b : [];
|
|
75
|
+
const fromPath = path.find((entry) => entry instanceof Element);
|
|
76
|
+
return (_c = fromPath !== null && fromPath !== void 0 ? fromPath : event.target) !== null && _c !== void 0 ? _c : null;
|
|
77
|
+
}
|
|
70
78
|
};
|
|
71
79
|
__decorate([
|
|
72
80
|
inject(ShortcutManager)
|
|
@@ -4,7 +4,6 @@ import { buildEditableElementSelector, } from '../design-system/editable-element
|
|
|
4
4
|
import { logger } from '../utils';
|
|
5
5
|
import { OperatingSystemUtils } from '../utils/os-platform';
|
|
6
6
|
import { SHORTCUT_BLOCKED_DEFAULT_MESSAGE, SHORTCUT_BLOCKED_DEFAULT_TITLE, SHORTCUT_BLOCKED_INPUT_MESSAGE, SHORTCUT_BLOCKED_ELEMENT_FOCUS_MESSAGE, SHORTCUT_BLOCKED_PAUSED_MESSAGE, emitShortcutBlockedEvent, } from './shortcut-events';
|
|
7
|
-
import { getDeepActiveElement, getEventElement, isEditableElement } from './shortcut-keyboard';
|
|
8
7
|
const DEFAULT_SHORTCUT_EDITABLE_CONTEXT_CONFIG = {
|
|
9
8
|
designSystems: ['rapid'],
|
|
10
9
|
customEditableSelectors: [],
|
|
@@ -324,14 +323,6 @@ export class DefaultShortcutManager {
|
|
|
324
323
|
getEditableSelector() {
|
|
325
324
|
return this.editableSelector;
|
|
326
325
|
}
|
|
327
|
-
isEditableContext(event) {
|
|
328
|
-
const editableSelector = this.getEditableSelector();
|
|
329
|
-
const eventElement = getEventElement(event);
|
|
330
|
-
if (eventElement && isEditableElement(eventElement, editableSelector)) {
|
|
331
|
-
return true;
|
|
332
|
-
}
|
|
333
|
-
return isEditableElement(getDeepActiveElement(), editableSelector);
|
|
334
|
-
}
|
|
335
326
|
configureBlockedMessages(config = {}) {
|
|
336
327
|
var _a;
|
|
337
328
|
const normalizeBlockedMessage = (message, fallback) => {
|
|
@@ -393,10 +384,7 @@ export class DefaultShortcutManager {
|
|
|
393
384
|
}
|
|
394
385
|
getExecutionStatus(shortcut) {
|
|
395
386
|
if (this.isPaused) {
|
|
396
|
-
return {
|
|
397
|
-
disabled: true,
|
|
398
|
-
tooltip: this.blockedMessageConfig.pausedMessage.text,
|
|
399
|
-
};
|
|
387
|
+
return { disabled: true, tooltip: this.blockedMessageConfig.pausedMessage.text };
|
|
400
388
|
}
|
|
401
389
|
const guardStatus = this.getExecutionGuardStatus();
|
|
402
390
|
if (guardStatus.disabled) {
|
|
@@ -3636,55 +3636,6 @@
|
|
|
3636
3636
|
"isAbstract": false,
|
|
3637
3637
|
"name": "getShortcutsByContextMap"
|
|
3638
3638
|
},
|
|
3639
|
-
{
|
|
3640
|
-
"kind": "Method",
|
|
3641
|
-
"canonicalReference": "@genesislcap/foundation-utils!DefaultShortcutManager#isEditableContext:member(1)",
|
|
3642
|
-
"docComment": "",
|
|
3643
|
-
"excerptTokens": [
|
|
3644
|
-
{
|
|
3645
|
-
"kind": "Content",
|
|
3646
|
-
"text": "isEditableContext(event: "
|
|
3647
|
-
},
|
|
3648
|
-
{
|
|
3649
|
-
"kind": "Reference",
|
|
3650
|
-
"text": "KeyboardEvent",
|
|
3651
|
-
"canonicalReference": "!KeyboardEvent:interface"
|
|
3652
|
-
},
|
|
3653
|
-
{
|
|
3654
|
-
"kind": "Content",
|
|
3655
|
-
"text": "): "
|
|
3656
|
-
},
|
|
3657
|
-
{
|
|
3658
|
-
"kind": "Content",
|
|
3659
|
-
"text": "boolean"
|
|
3660
|
-
},
|
|
3661
|
-
{
|
|
3662
|
-
"kind": "Content",
|
|
3663
|
-
"text": ";"
|
|
3664
|
-
}
|
|
3665
|
-
],
|
|
3666
|
-
"isStatic": false,
|
|
3667
|
-
"returnTypeTokenRange": {
|
|
3668
|
-
"startIndex": 3,
|
|
3669
|
-
"endIndex": 4
|
|
3670
|
-
},
|
|
3671
|
-
"releaseTag": "Public",
|
|
3672
|
-
"isProtected": false,
|
|
3673
|
-
"overloadIndex": 1,
|
|
3674
|
-
"parameters": [
|
|
3675
|
-
{
|
|
3676
|
-
"parameterName": "event",
|
|
3677
|
-
"parameterTypeTokenRange": {
|
|
3678
|
-
"startIndex": 1,
|
|
3679
|
-
"endIndex": 2
|
|
3680
|
-
},
|
|
3681
|
-
"isOptional": false
|
|
3682
|
-
}
|
|
3683
|
-
],
|
|
3684
|
-
"isOptional": false,
|
|
3685
|
-
"isAbstract": false,
|
|
3686
|
-
"name": "isEditableContext"
|
|
3687
|
-
},
|
|
3688
3639
|
{
|
|
3689
3640
|
"kind": "Property",
|
|
3690
3641
|
"canonicalReference": "@genesislcap/foundation-utils!DefaultShortcutManager#isPaused:member",
|
|
@@ -10228,6 +10179,68 @@
|
|
|
10228
10179
|
"parameters": [],
|
|
10229
10180
|
"name": "isDev"
|
|
10230
10181
|
},
|
|
10182
|
+
{
|
|
10183
|
+
"kind": "Function",
|
|
10184
|
+
"canonicalReference": "@genesislcap/foundation-utils!isEditableKeyboardEvent:function(1)",
|
|
10185
|
+
"docComment": "/**\n * Whether a keyboard event comes from an editable element, i.e. the user is typing.\n *\n * @remarks\n *\n * Checks the innermost event target (through shadow roots), then the deep active element. An element counts as editable when it is `contenteditable` or matches / is nested in an element matching `editableSelector`. Pass `shortcutManager.getEditableSelector()` to use the selector configured via `configureEditableContext`.\n *\n * @param event - The keyboard event.\n *\n * @param editableSelector - CSS selector for editable elements. Defaults to the base selectors plus rapid editable hosts.\n *\n * @public\n */\n",
|
|
10186
|
+
"excerptTokens": [
|
|
10187
|
+
{
|
|
10188
|
+
"kind": "Content",
|
|
10189
|
+
"text": "export declare function isEditableKeyboardEvent(event: "
|
|
10190
|
+
},
|
|
10191
|
+
{
|
|
10192
|
+
"kind": "Reference",
|
|
10193
|
+
"text": "KeyboardEvent",
|
|
10194
|
+
"canonicalReference": "!KeyboardEvent:interface"
|
|
10195
|
+
},
|
|
10196
|
+
{
|
|
10197
|
+
"kind": "Content",
|
|
10198
|
+
"text": ", editableSelector?: "
|
|
10199
|
+
},
|
|
10200
|
+
{
|
|
10201
|
+
"kind": "Content",
|
|
10202
|
+
"text": "string"
|
|
10203
|
+
},
|
|
10204
|
+
{
|
|
10205
|
+
"kind": "Content",
|
|
10206
|
+
"text": "): "
|
|
10207
|
+
},
|
|
10208
|
+
{
|
|
10209
|
+
"kind": "Content",
|
|
10210
|
+
"text": "boolean"
|
|
10211
|
+
},
|
|
10212
|
+
{
|
|
10213
|
+
"kind": "Content",
|
|
10214
|
+
"text": ";"
|
|
10215
|
+
}
|
|
10216
|
+
],
|
|
10217
|
+
"fileUrlPath": "src/design-system/editable-elements.ts",
|
|
10218
|
+
"returnTypeTokenRange": {
|
|
10219
|
+
"startIndex": 5,
|
|
10220
|
+
"endIndex": 6
|
|
10221
|
+
},
|
|
10222
|
+
"releaseTag": "Public",
|
|
10223
|
+
"overloadIndex": 1,
|
|
10224
|
+
"parameters": [
|
|
10225
|
+
{
|
|
10226
|
+
"parameterName": "event",
|
|
10227
|
+
"parameterTypeTokenRange": {
|
|
10228
|
+
"startIndex": 1,
|
|
10229
|
+
"endIndex": 2
|
|
10230
|
+
},
|
|
10231
|
+
"isOptional": false
|
|
10232
|
+
},
|
|
10233
|
+
{
|
|
10234
|
+
"parameterName": "editableSelector",
|
|
10235
|
+
"parameterTypeTokenRange": {
|
|
10236
|
+
"startIndex": 3,
|
|
10237
|
+
"endIndex": 4
|
|
10238
|
+
},
|
|
10239
|
+
"isOptional": true
|
|
10240
|
+
}
|
|
10241
|
+
],
|
|
10242
|
+
"name": "isEditableKeyboardEvent"
|
|
10243
|
+
},
|
|
10231
10244
|
{
|
|
10232
10245
|
"kind": "Function",
|
|
10233
10246
|
"canonicalReference": "@genesislcap/foundation-utils!isFeatureActivated:function(1)",
|
|
@@ -21623,52 +21636,6 @@
|
|
|
21623
21636
|
"parameters": [],
|
|
21624
21637
|
"name": "getShortcutsByContextMap"
|
|
21625
21638
|
},
|
|
21626
|
-
{
|
|
21627
|
-
"kind": "MethodSignature",
|
|
21628
|
-
"canonicalReference": "@genesislcap/foundation-utils!ShortcutManager#isEditableContext:member(1)",
|
|
21629
|
-
"docComment": "/**\n * Whether the event's target, or the deep active element, is editable for shortcut purposes. Uses the selector from `configureEditableContext` / `getEditableSelector`.\n *\n * @public\n */\n",
|
|
21630
|
-
"excerptTokens": [
|
|
21631
|
-
{
|
|
21632
|
-
"kind": "Content",
|
|
21633
|
-
"text": "isEditableContext(event: "
|
|
21634
|
-
},
|
|
21635
|
-
{
|
|
21636
|
-
"kind": "Reference",
|
|
21637
|
-
"text": "KeyboardEvent",
|
|
21638
|
-
"canonicalReference": "!KeyboardEvent:interface"
|
|
21639
|
-
},
|
|
21640
|
-
{
|
|
21641
|
-
"kind": "Content",
|
|
21642
|
-
"text": "): "
|
|
21643
|
-
},
|
|
21644
|
-
{
|
|
21645
|
-
"kind": "Content",
|
|
21646
|
-
"text": "boolean"
|
|
21647
|
-
},
|
|
21648
|
-
{
|
|
21649
|
-
"kind": "Content",
|
|
21650
|
-
"text": ";"
|
|
21651
|
-
}
|
|
21652
|
-
],
|
|
21653
|
-
"isOptional": false,
|
|
21654
|
-
"returnTypeTokenRange": {
|
|
21655
|
-
"startIndex": 3,
|
|
21656
|
-
"endIndex": 4
|
|
21657
|
-
},
|
|
21658
|
-
"releaseTag": "Public",
|
|
21659
|
-
"overloadIndex": 1,
|
|
21660
|
-
"parameters": [
|
|
21661
|
-
{
|
|
21662
|
-
"parameterName": "event",
|
|
21663
|
-
"parameterTypeTokenRange": {
|
|
21664
|
-
"startIndex": 1,
|
|
21665
|
-
"endIndex": 2
|
|
21666
|
-
},
|
|
21667
|
-
"isOptional": false
|
|
21668
|
-
}
|
|
21669
|
-
],
|
|
21670
|
-
"name": "isEditableContext"
|
|
21671
|
-
},
|
|
21672
21639
|
{
|
|
21673
21640
|
"kind": "PropertySignature",
|
|
21674
21641
|
"canonicalReference": "@genesislcap/foundation-utils!ShortcutManager#isPaused:member",
|
|
@@ -456,7 +456,6 @@ export declare class DefaultShortcutManager implements ShortcutManager {
|
|
|
456
456
|
configureEditableContext(config?: ShortcutEditableContextConfig): void;
|
|
457
457
|
getEditableContextConfig(): Required<ShortcutEditableContextConfig>;
|
|
458
458
|
getEditableSelector(): string;
|
|
459
|
-
isEditableContext(event: KeyboardEvent): boolean;
|
|
460
459
|
configureBlockedMessages(config?: ShortcutBlockedMessageConfig): void;
|
|
461
460
|
getBlockedMessages(): Required<ShortcutBlockedMessageConfig>;
|
|
462
461
|
pause(): void;
|
|
@@ -864,6 +863,7 @@ export declare class FoundationShortcutListener extends FASTElement {
|
|
|
864
863
|
private addKeyListener;
|
|
865
864
|
private removeKeyListener;
|
|
866
865
|
private handleKeyDown;
|
|
866
|
+
private getEventElement;
|
|
867
867
|
}
|
|
868
868
|
|
|
869
869
|
/** @public */
|
|
@@ -1115,6 +1115,19 @@ export declare const inSymphonyDesktop: () => boolean;
|
|
|
1115
1115
|
*/
|
|
1116
1116
|
export declare const isDev: () => boolean;
|
|
1117
1117
|
|
|
1118
|
+
/**
|
|
1119
|
+
* Whether a keyboard event comes from an editable element, i.e. the user is typing.
|
|
1120
|
+
* @remarks Checks the innermost event target (through shadow roots), then the deep active element.
|
|
1121
|
+
* An element counts as editable when it is `contenteditable` or matches / is nested in an element
|
|
1122
|
+
* matching `editableSelector`. Pass `shortcutManager.getEditableSelector()` to use the selector
|
|
1123
|
+
* configured via `configureEditableContext`.
|
|
1124
|
+
* @param event - The keyboard event.
|
|
1125
|
+
* @param editableSelector - CSS selector for editable elements. Defaults to the base selectors plus
|
|
1126
|
+
* rapid editable hosts.
|
|
1127
|
+
* @public
|
|
1128
|
+
*/
|
|
1129
|
+
export declare function isEditableKeyboardEvent(event: KeyboardEvent, editableSelector?: string): boolean;
|
|
1130
|
+
|
|
1118
1131
|
/**
|
|
1119
1132
|
* Returns true when `feature.<name>` is present in the current URL query string.
|
|
1120
1133
|
* @public
|
|
@@ -2732,12 +2745,6 @@ export declare interface ShortcutManager {
|
|
|
2732
2745
|
configureEditableContext(config?: ShortcutEditableContextConfig): void;
|
|
2733
2746
|
getEditableContextConfig(): Required<ShortcutEditableContextConfig>;
|
|
2734
2747
|
getEditableSelector(): string;
|
|
2735
|
-
/**
|
|
2736
|
-
* Whether the event's target, or the deep active element, is editable for shortcut purposes.
|
|
2737
|
-
* Uses the selector from `configureEditableContext` / `getEditableSelector`.
|
|
2738
|
-
* @public
|
|
2739
|
-
*/
|
|
2740
|
-
isEditableContext(event: KeyboardEvent): boolean;
|
|
2741
2748
|
configureBlockedMessages(config?: ShortcutBlockedMessageConfig): void;
|
|
2742
2749
|
getBlockedMessages(): Required<ShortcutBlockedMessageConfig>;
|
|
2743
2750
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@genesislcap/foundation-utils",
|
|
3
3
|
"description": "Genesis Foundation Utils",
|
|
4
|
-
"version": "15.64.1-alpha-
|
|
4
|
+
"version": "15.64.1-alpha-a0f02c875a.0",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"license": "SEE LICENSE IN license.txt",
|
|
7
7
|
"main": "dist/esm/index.js",
|
|
@@ -29,17 +29,17 @@
|
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@genesislcap/foundation-testing": "15.64.1-alpha-
|
|
33
|
-
"@genesislcap/genx": "15.64.1-alpha-
|
|
34
|
-
"@genesislcap/ts-builder": "15.64.1-alpha-
|
|
35
|
-
"@genesislcap/uvu-playwright-builder": "15.64.1-alpha-
|
|
36
|
-
"@genesislcap/vite-builder": "15.64.1-alpha-
|
|
37
|
-
"@genesislcap/webpack-builder": "15.64.1-alpha-
|
|
32
|
+
"@genesislcap/foundation-testing": "15.64.1-alpha-a0f02c875a.0",
|
|
33
|
+
"@genesislcap/genx": "15.64.1-alpha-a0f02c875a.0",
|
|
34
|
+
"@genesislcap/ts-builder": "15.64.1-alpha-a0f02c875a.0",
|
|
35
|
+
"@genesislcap/uvu-playwright-builder": "15.64.1-alpha-a0f02c875a.0",
|
|
36
|
+
"@genesislcap/vite-builder": "15.64.1-alpha-a0f02c875a.0",
|
|
37
|
+
"@genesislcap/webpack-builder": "15.64.1-alpha-a0f02c875a.0",
|
|
38
38
|
"@types/json-schema": "^7.0.11"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@genesislcap/expression-builder": "15.64.1-alpha-
|
|
42
|
-
"@genesislcap/foundation-logger": "15.64.1-alpha-
|
|
41
|
+
"@genesislcap/expression-builder": "15.64.1-alpha-a0f02c875a.0",
|
|
42
|
+
"@genesislcap/foundation-logger": "15.64.1-alpha-a0f02c875a.0",
|
|
43
43
|
"@microsoft/fast-components": "2.30.6",
|
|
44
44
|
"@microsoft/fast-element": "1.14.0",
|
|
45
45
|
"@microsoft/fast-foundation": "2.50.0",
|