Package not found. Please check the package name and try again.
@genesislcap/foundation-utils 14.422.2-alpha-1f9504f.0 → 14.423.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 +163 -612
- package/dist/dts/design-system/index.d.ts +0 -1
- package/dist/dts/design-system/index.d.ts.map +1 -1
- package/dist/dts/shortcut-manager/index.d.ts +0 -1
- package/dist/dts/shortcut-manager/index.d.ts.map +1 -1
- package/dist/dts/shortcut-manager/shortcut-listener.d.ts +0 -4
- package/dist/dts/shortcut-manager/shortcut-listener.d.ts.map +1 -1
- package/dist/dts/shortcut-manager/shortcut-manager.d.ts +0 -50
- package/dist/dts/shortcut-manager/shortcut-manager.d.ts.map +1 -1
- package/dist/esm/design-system/index.js +0 -1
- package/dist/esm/shortcut-manager/index.js +0 -1
- package/dist/esm/shortcut-manager/shortcut-listener.js +21 -59
- package/dist/esm/shortcut-manager/shortcut-manager.js +19 -112
- package/dist/foundation-utils.api.json +82 -1272
- package/dist/foundation-utils.d.ts +0 -93
- package/package.json +11 -11
- package/dist/dts/design-system/editable-elements.d.ts +0 -12
- package/dist/dts/design-system/editable-elements.d.ts.map +0 -1
- package/dist/dts/shortcut-manager/shortcut-events.d.ts +0 -16
- package/dist/dts/shortcut-manager/shortcut-events.d.ts.map +0 -1
- package/dist/esm/design-system/editable-elements.js +0 -42
- package/dist/esm/shortcut-manager/shortcut-events.js +0 -13
|
@@ -91,19 +91,11 @@ export declare function assureDesignSystem(module: DesignSystemModule): DesignSy
|
|
|
91
91
|
*/
|
|
92
92
|
export declare const avoidTreeShaking: (...classes: unknown[]) => void;
|
|
93
93
|
|
|
94
|
-
/**
|
|
95
|
-
* Base selectors treated as editable context regardless of design system.
|
|
96
|
-
* Includes native controls, contenteditable, and ARIA-editable roles.
|
|
97
|
-
*/
|
|
98
|
-
export declare const BASE_EDITABLE_ELEMENT_SELECTORS: readonly ["input", "textarea", "select", "[contenteditable=\"true\"]", "[contenteditable=\"\"]", "[role=\"textbox\"]", "[role=\"searchbox\"]", "[role=\"combobox\"]"];
|
|
99
|
-
|
|
100
94
|
/**
|
|
101
95
|
* @internal
|
|
102
96
|
*/
|
|
103
97
|
export declare const BIG_INT_64_BITS = 64;
|
|
104
98
|
|
|
105
|
-
export declare function buildEditableElementSelector(designSystems: readonly ShortcutDesignSystemPrefix[], customEditableSelectors?: readonly string[]): string;
|
|
106
|
-
|
|
107
99
|
/**
|
|
108
100
|
* The builder aka file bundler.
|
|
109
101
|
* @privateRemarks
|
|
@@ -393,10 +385,6 @@ export declare class DefaultShortcutManager implements ShortcutManager {
|
|
|
393
385
|
private keyCombinationMap;
|
|
394
386
|
private _isPausedSubject;
|
|
395
387
|
private _activeContext;
|
|
396
|
-
private executionGuards;
|
|
397
|
-
private editableContextConfig;
|
|
398
|
-
private editableSelector;
|
|
399
|
-
private blockedMessageConfig;
|
|
400
388
|
get isPaused(): boolean;
|
|
401
389
|
get isPaused$(): Observable<boolean>;
|
|
402
390
|
get isPausedSubject(): BehaviorSubject<boolean>;
|
|
@@ -415,14 +403,6 @@ export declare class DefaultShortcutManager implements ShortcutManager {
|
|
|
415
403
|
setActiveContext(context: string): void;
|
|
416
404
|
getActiveContext(): string | undefined;
|
|
417
405
|
clearActiveContext(): void;
|
|
418
|
-
registerExecutionGuard(id: string, guard: () => ShortcutExecutionStatus | boolean): void;
|
|
419
|
-
unregisterExecutionGuard(id: string): void;
|
|
420
|
-
clearExecutionGuards(): void;
|
|
421
|
-
configureEditableContext(config?: ShortcutEditableContextConfig): void;
|
|
422
|
-
getEditableContextConfig(): Required<ShortcutEditableContextConfig>;
|
|
423
|
-
getEditableSelector(): string;
|
|
424
|
-
configureBlockedMessages(config?: ShortcutBlockedMessageConfig): void;
|
|
425
|
-
getBlockedMessages(): Required<ShortcutBlockedMessageConfig>;
|
|
426
406
|
pause(): void;
|
|
427
407
|
resume(): void;
|
|
428
408
|
/**
|
|
@@ -432,9 +412,6 @@ export declare class DefaultShortcutManager implements ShortcutManager {
|
|
|
432
412
|
private normalizeShortcutDefinition;
|
|
433
413
|
private createKeyCombinationKey;
|
|
434
414
|
private isElementFocused;
|
|
435
|
-
private getExecutionStatus;
|
|
436
|
-
private getExecutionGuardStatus;
|
|
437
|
-
private refreshEditableSelector;
|
|
438
415
|
}
|
|
439
416
|
|
|
440
417
|
/**
|
|
@@ -450,11 +427,6 @@ export declare class DefaultShortcutManager implements ShortcutManager {
|
|
|
450
427
|
*/
|
|
451
428
|
export declare const delay: (ms: number) => Promise<void>;
|
|
452
429
|
|
|
453
|
-
/**
|
|
454
|
-
* Design-system specific editable host selectors.
|
|
455
|
-
*/
|
|
456
|
-
export declare const DESIGN_SYSTEM_EDITABLE_ELEMENT_SELECTORS: Record<ShortcutDesignSystemPrefix, readonly string[]>;
|
|
457
|
-
|
|
458
430
|
/**
|
|
459
431
|
* DesignSystemModule.
|
|
460
432
|
* @public
|
|
@@ -487,10 +459,6 @@ export declare interface DTOMapper<TDTO, TEntity> {
|
|
|
487
459
|
toDTO: (entity: Partial<TEntity>) => TDTO;
|
|
488
460
|
}
|
|
489
461
|
|
|
490
|
-
export declare function emitShortcutBlockedEvent(detail: Omit<ShortcutBlockedEventDetail, 'message'> & {
|
|
491
|
-
message?: string;
|
|
492
|
-
}): void;
|
|
493
|
-
|
|
494
462
|
/**
|
|
495
463
|
* Encodes the given value to base64.
|
|
496
464
|
* @public
|
|
@@ -639,7 +607,6 @@ export declare type FoundationLayoutContainer = {
|
|
|
639
607
|
export declare class FoundationShortcutListener extends FASTElement {
|
|
640
608
|
shortcutManager: ShortcutManager;
|
|
641
609
|
private keyListener;
|
|
642
|
-
private stateSubscription;
|
|
643
610
|
private isListening;
|
|
644
611
|
connectedCallback(): void;
|
|
645
612
|
disconnectedCallback(): void;
|
|
@@ -648,9 +615,6 @@ export declare class FoundationShortcutListener extends FASTElement {
|
|
|
648
615
|
private removeKeyListener;
|
|
649
616
|
private handleKeyDown;
|
|
650
617
|
private extractKeyFromCode;
|
|
651
|
-
private getDeepActiveElement;
|
|
652
|
-
private getEventElement;
|
|
653
|
-
private isEditableContext;
|
|
654
618
|
private isInputElement;
|
|
655
619
|
}
|
|
656
620
|
|
|
@@ -2262,32 +2226,6 @@ export declare type ServerRowEntity = {
|
|
|
2262
2226
|
};
|
|
2263
2227
|
};
|
|
2264
2228
|
|
|
2265
|
-
export declare const SHORTCUT_BLOCKED_DEFAULT_MESSAGE = "This shortcut is currently unavailable in this context.";
|
|
2266
|
-
|
|
2267
|
-
export declare const SHORTCUT_BLOCKED_ELEMENT_FOCUS_MESSAGE = "This shortcut is unavailable in the current focus context.";
|
|
2268
|
-
|
|
2269
|
-
export declare const SHORTCUT_BLOCKED_EVENT = "foundation-shortcut-blocked";
|
|
2270
|
-
|
|
2271
|
-
export declare const SHORTCUT_BLOCKED_INPUT_MESSAGE = "This shortcut is unavailable while typing in an input field.";
|
|
2272
|
-
|
|
2273
|
-
export declare const SHORTCUT_BLOCKED_PAUSED_MESSAGE = "Shortcuts are paused.";
|
|
2274
|
-
|
|
2275
|
-
export declare type ShortcutBlockedEventDetail = {
|
|
2276
|
-
shortcutId: string;
|
|
2277
|
-
context?: string;
|
|
2278
|
-
reason: ShortcutBlockedReason;
|
|
2279
|
-
message: string;
|
|
2280
|
-
};
|
|
2281
|
-
|
|
2282
|
-
export declare type ShortcutBlockedMessageConfig = {
|
|
2283
|
-
defaultMessage?: string;
|
|
2284
|
-
inputMessage?: string;
|
|
2285
|
-
pausedMessage?: string;
|
|
2286
|
-
elementFocusMessage?: string;
|
|
2287
|
-
};
|
|
2288
|
-
|
|
2289
|
-
export declare type ShortcutBlockedReason = 'paused' | 'editable-context' | 'element-not-focused' | 'disabled';
|
|
2290
|
-
|
|
2291
2229
|
/**
|
|
2292
2230
|
* A definition of a keyboard shortcut
|
|
2293
2231
|
* @public
|
|
@@ -2308,21 +2246,6 @@ export declare interface ShortcutDefinition {
|
|
|
2308
2246
|
canExecute?: () => ShortcutExecutionStatus;
|
|
2309
2247
|
}
|
|
2310
2248
|
|
|
2311
|
-
export declare type ShortcutDesignSystemPrefix = 'rapid' | 'zero';
|
|
2312
|
-
|
|
2313
|
-
export declare type ShortcutEditableContextConfig = {
|
|
2314
|
-
/**
|
|
2315
|
-
* Which design systems should be considered when detecting editable custom elements.
|
|
2316
|
-
* @default ['rapid']
|
|
2317
|
-
*/
|
|
2318
|
-
designSystems?: ShortcutDesignSystemPrefix[];
|
|
2319
|
-
/**
|
|
2320
|
-
* Optional app-specific selectors for editable host elements.
|
|
2321
|
-
* @default []
|
|
2322
|
-
*/
|
|
2323
|
-
customEditableSelectors?: string[];
|
|
2324
|
-
};
|
|
2325
|
-
|
|
2326
2249
|
/**
|
|
2327
2250
|
* A type which represents the disabled status and tooltip of an item
|
|
2328
2251
|
* @public
|
|
@@ -2367,22 +2290,6 @@ export declare interface ShortcutManager {
|
|
|
2367
2290
|
isPaused: boolean;
|
|
2368
2291
|
isPaused$: Observable<boolean>;
|
|
2369
2292
|
isPausedSubject: BehaviorSubject<boolean>;
|
|
2370
|
-
/**
|
|
2371
|
-
* Register a global execution guard.
|
|
2372
|
-
* @remarks Guards are evaluated before shortcut-specific canExecute checks.
|
|
2373
|
-
*/
|
|
2374
|
-
registerExecutionGuard(id: string, guard: () => ShortcutExecutionStatus | boolean): void;
|
|
2375
|
-
unregisterExecutionGuard(id: string): void;
|
|
2376
|
-
clearExecutionGuards(): void;
|
|
2377
|
-
/**
|
|
2378
|
-
* Configure editable-context detection used by shortcut listeners.
|
|
2379
|
-
* @remarks This is intended to be set once during app startup.
|
|
2380
|
-
*/
|
|
2381
|
-
configureEditableContext(config?: ShortcutEditableContextConfig): void;
|
|
2382
|
-
getEditableContextConfig(): Required<ShortcutEditableContextConfig>;
|
|
2383
|
-
getEditableSelector(): string;
|
|
2384
|
-
configureBlockedMessages(config?: ShortcutBlockedMessageConfig): void;
|
|
2385
|
-
getBlockedMessages(): Required<ShortcutBlockedMessageConfig>;
|
|
2386
2293
|
}
|
|
2387
2294
|
|
|
2388
2295
|
/**
|
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.423.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.
|
|
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.423.0",
|
|
33
|
+
"@genesislcap/genx": "14.423.0",
|
|
34
|
+
"@genesislcap/rollup-builder": "14.423.0",
|
|
35
|
+
"@genesislcap/ts-builder": "14.423.0",
|
|
36
|
+
"@genesislcap/uvu-playwright-builder": "14.423.0",
|
|
37
|
+
"@genesislcap/vite-builder": "14.423.0",
|
|
38
|
+
"@genesislcap/webpack-builder": "14.423.0",
|
|
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.423.0",
|
|
43
|
+
"@genesislcap/foundation-logger": "14.423.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": "
|
|
61
|
+
"gitHead": "ed1a188a19674ed48b3805cc907304148f1daf14"
|
|
62
62
|
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { ShortcutDesignSystemPrefix } from '../shortcut-manager/shortcut-manager';
|
|
2
|
-
/**
|
|
3
|
-
* Base selectors treated as editable context regardless of design system.
|
|
4
|
-
* Includes native controls, contenteditable, and ARIA-editable roles.
|
|
5
|
-
*/
|
|
6
|
-
export declare const BASE_EDITABLE_ELEMENT_SELECTORS: readonly ["input", "textarea", "select", "[contenteditable=\"true\"]", "[contenteditable=\"\"]", "[role=\"textbox\"]", "[role=\"searchbox\"]", "[role=\"combobox\"]"];
|
|
7
|
-
/**
|
|
8
|
-
* Design-system specific editable host selectors.
|
|
9
|
-
*/
|
|
10
|
-
export declare const DESIGN_SYSTEM_EDITABLE_ELEMENT_SELECTORS: Record<ShortcutDesignSystemPrefix, readonly string[]>;
|
|
11
|
-
export declare function buildEditableElementSelector(designSystems: readonly ShortcutDesignSystemPrefix[], customEditableSelectors?: readonly string[]): string;
|
|
12
|
-
//# sourceMappingURL=editable-elements.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"editable-elements.d.ts","sourceRoot":"","sources":["../../../src/design-system/editable-elements.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAWlF;;;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,CAkBR"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export declare const SHORTCUT_BLOCKED_EVENT = "foundation-shortcut-blocked";
|
|
2
|
-
export declare const SHORTCUT_BLOCKED_DEFAULT_MESSAGE = "This shortcut is currently unavailable in this context.";
|
|
3
|
-
export declare const SHORTCUT_BLOCKED_INPUT_MESSAGE = "This shortcut is unavailable while typing in an input field.";
|
|
4
|
-
export declare const SHORTCUT_BLOCKED_PAUSED_MESSAGE = "Shortcuts are paused.";
|
|
5
|
-
export declare const SHORTCUT_BLOCKED_ELEMENT_FOCUS_MESSAGE = "This shortcut is unavailable in the current focus context.";
|
|
6
|
-
export type ShortcutBlockedReason = 'paused' | 'editable-context' | 'element-not-focused' | 'disabled';
|
|
7
|
-
export type ShortcutBlockedEventDetail = {
|
|
8
|
-
shortcutId: string;
|
|
9
|
-
context?: string;
|
|
10
|
-
reason: ShortcutBlockedReason;
|
|
11
|
-
message: string;
|
|
12
|
-
};
|
|
13
|
-
export declare function emitShortcutBlockedEvent(detail: Omit<ShortcutBlockedEventDetail, 'message'> & {
|
|
14
|
-
message?: string;
|
|
15
|
-
}): void;
|
|
16
|
-
//# sourceMappingURL=shortcut-events.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"shortcut-events.d.ts","sourceRoot":"","sources":["../../../src/shortcut-manager/shortcut-events.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,sBAAsB,gCAAgC,CAAC;AAEpE,eAAO,MAAM,gCAAgC,4DACc,CAAC;AAC5D,eAAO,MAAM,8BAA8B,iEACqB,CAAC;AACjE,eAAO,MAAM,+BAA+B,0BAA0B,CAAC;AACvE,eAAO,MAAM,sCAAsC,+DACW,CAAC;AAE/D,MAAM,MAAM,qBAAqB,GAC7B,QAAQ,GACR,kBAAkB,GAClB,qBAAqB,GACrB,UAAU,CAAC;AAEf,MAAM,MAAM,0BAA0B,GAAG;IACvC,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,qBAAqB,CAAC;IAC9B,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,IAAI,CAAC,0BAA0B,EAAE,SAAS,CAAC,GAAG;IAAE,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,GACzE,IAAI,CAaN"}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
const NATIVE_EDITABLE_ELEMENT_SELECTORS = ['input', 'textarea', 'select'];
|
|
2
|
-
const CONTENT_EDITABLE_SELECTORS = ['[contenteditable="true"]', '[contenteditable=""]'];
|
|
3
|
-
const ARIA_EDITABLE_ROLE_SELECTORS = [
|
|
4
|
-
'[role="textbox"]',
|
|
5
|
-
'[role="searchbox"]',
|
|
6
|
-
'[role="combobox"]',
|
|
7
|
-
];
|
|
8
|
-
const DESIGN_SYSTEM_EDITABLE_COMPONENT_NAMES = ['text-field', 'text-area', 'combobox'];
|
|
9
|
-
/**
|
|
10
|
-
* Base selectors treated as editable context regardless of design system.
|
|
11
|
-
* Includes native controls, contenteditable, and ARIA-editable roles.
|
|
12
|
-
*/
|
|
13
|
-
export const BASE_EDITABLE_ELEMENT_SELECTORS = [
|
|
14
|
-
...NATIVE_EDITABLE_ELEMENT_SELECTORS,
|
|
15
|
-
...CONTENT_EDITABLE_SELECTORS,
|
|
16
|
-
...ARIA_EDITABLE_ROLE_SELECTORS,
|
|
17
|
-
];
|
|
18
|
-
const buildDesignSystemEditableSelectors = (prefix) => DESIGN_SYSTEM_EDITABLE_COMPONENT_NAMES.map((name) => `${prefix}-${name}`);
|
|
19
|
-
/**
|
|
20
|
-
* Design-system specific editable host selectors.
|
|
21
|
-
*/
|
|
22
|
-
export const DESIGN_SYSTEM_EDITABLE_ELEMENT_SELECTORS = {
|
|
23
|
-
rapid: buildDesignSystemEditableSelectors('rapid'),
|
|
24
|
-
zero: buildDesignSystemEditableSelectors('zero'),
|
|
25
|
-
};
|
|
26
|
-
export function buildEditableElementSelector(designSystems, customEditableSelectors = []) {
|
|
27
|
-
var _a;
|
|
28
|
-
const selectors = [...BASE_EDITABLE_ELEMENT_SELECTORS];
|
|
29
|
-
for (const designSystem of designSystems) {
|
|
30
|
-
for (const selector of (_a = DESIGN_SYSTEM_EDITABLE_ELEMENT_SELECTORS[designSystem]) !== null && _a !== void 0 ? _a : []) {
|
|
31
|
-
if (!selectors.includes(selector)) {
|
|
32
|
-
selectors.push(selector);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
for (const selector of customEditableSelectors) {
|
|
37
|
-
if (selector && !selectors.includes(selector)) {
|
|
38
|
-
selectors.push(selector);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
return selectors.join(',');
|
|
42
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export const SHORTCUT_BLOCKED_EVENT = 'foundation-shortcut-blocked';
|
|
2
|
-
export const SHORTCUT_BLOCKED_DEFAULT_MESSAGE = 'This shortcut is currently unavailable in this context.';
|
|
3
|
-
export const SHORTCUT_BLOCKED_INPUT_MESSAGE = 'This shortcut is unavailable while typing in an input field.';
|
|
4
|
-
export const SHORTCUT_BLOCKED_PAUSED_MESSAGE = 'Shortcuts are paused.';
|
|
5
|
-
export const SHORTCUT_BLOCKED_ELEMENT_FOCUS_MESSAGE = 'This shortcut is unavailable in the current focus context.';
|
|
6
|
-
export function emitShortcutBlockedEvent(detail) {
|
|
7
|
-
const eventTarget = typeof window !== 'undefined' ? window : typeof document !== 'undefined' ? document : undefined;
|
|
8
|
-
if (!eventTarget)
|
|
9
|
-
return;
|
|
10
|
-
eventTarget.dispatchEvent(new CustomEvent(SHORTCUT_BLOCKED_EVENT, {
|
|
11
|
-
detail: Object.assign(Object.assign({}, detail), { message: detail.message || SHORTCUT_BLOCKED_DEFAULT_MESSAGE }),
|
|
12
|
-
}));
|
|
13
|
-
}
|