assign-gingerly 0.0.53 → 0.0.55
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/README.md +847 -5
- package/assignFrom.js +229 -9
- package/assignFrom.ts +338 -9
- package/assignGingerly.js +34 -1
- package/assignGingerly.ts +54 -1
- package/beVigilant.js +73 -0
- package/beVigilant.ts +85 -0
- package/enhanceAll.js +106 -0
- package/enhanceAll.ts +138 -0
- package/handlers/join.js +74 -0
- package/handlers/join.ts +80 -0
- package/handlers/lazyLoad.js +212 -0
- package/handlers/lazyLoad.ts +307 -0
- package/handlers/lazyLoadSwitch.js +58 -0
- package/handlers/lazyLoadSwitch.ts +63 -0
- package/handlers/microDataJoin.js +184 -0
- package/handlers/microDataJoin.ts +270 -0
- package/inferencer/.gitmodules +3 -0
- package/inferencer/.vscode/settings.json +2 -0
- package/inferencer/InferencedPropagator.js +230 -0
- package/inferencer/InferencedPropagator.ts +269 -0
- package/inferencer/LICENSE +21 -0
- package/inferencer/README.md +524 -0
- package/inferencer/Requirements/SupportForPropagator.md +368 -0
- package/inferencer/imports.html +7 -0
- package/inferencer/inferencer.js +254 -0
- package/inferencer/inferencer.ts +292 -0
- package/inferencer/package-lock.json +129 -0
- package/inferencer/package.json +60 -0
- package/inferencer/playwright-report/data/507ad515125e13390ea07de92f22331c913fa068.md +55 -0
- package/inferencer/playwright-report/index.html +90 -0
- package/inferencer/playwright.config.ts +54 -0
- package/inferencer/test-results/.last-run.json +6 -0
- package/inferencer/test-results/inferencer-Inferencer-Enha-535bc-inferencer-tests-in-browser-chromium/error-context.md +55 -0
- package/inferencer/tests/inferencedPropagator.html +428 -0
- package/inferencer/tests/inferencedPropagator.spec.ts +18 -0
- package/inferencer/tests/inferencer.html +355 -0
- package/inferencer/tests/inferencer.spec.ts +19 -0
- package/inferencer/tsconfig.json +19 -0
- package/inferencer/types/.kiro/specs/conversion-template/README.md +128 -0
- package/inferencer/types/.kiro/specs/conversion-template/design.md +360 -0
- package/inferencer/types/.kiro/specs/conversion-template/requirements.md +191 -0
- package/inferencer/types/.kiro/specs/conversion-template/tasks.md +174 -0
- package/inferencer/types/.kiro/steering/coding-standards.md +53 -0
- package/inferencer/types/.kiro/steering/conversion-guide.md +108 -0
- package/inferencer/types/.kiro/steering/declarative-configuration.md +108 -0
- package/inferencer/types/.kiro/steering/emc-json-serializability.md +306 -0
- package/inferencer/types/EnhancementConversionInstructions.md +1854 -0
- package/inferencer/types/LICENSE +21 -0
- package/inferencer/types/NewCustomElement.md +388 -0
- package/inferencer/types/NewCustomElementFeature.md +683 -0
- package/inferencer/types/NewEnhancementInstructions.md +705 -0
- package/inferencer/types/README.md +2 -0
- package/inferencer/types/agrace/types.d.ts +11 -0
- package/inferencer/types/assign-gingerly/types.d.ts +572 -0
- package/inferencer/types/be-a-beacon/types.d.ts +17 -0
- package/inferencer/types/be-bound/types.d.ts +66 -0
- package/inferencer/types/be-buttoned-up/types.d.ts +19 -0
- package/inferencer/types/be-calculating/types.d.ts +54 -0
- package/inferencer/types/be-clonable/types.d.ts +38 -0
- package/inferencer/types/be-committed/types.d.ts +22 -0
- package/inferencer/types/be-consoling/types.d.ts +24 -0
- package/inferencer/types/be-decked-with/types.d.ts +26 -0
- package/inferencer/types/be-delible/types.d.ts +27 -0
- package/inferencer/types/be-dispatching/types.d.ts +34 -0
- package/inferencer/types/be-evanescent/types.d.ts +20 -0
- package/inferencer/types/be-flashy/types.d.ts +21 -0
- package/inferencer/types/be-gone/types.d.ts +25 -0
- package/inferencer/types/be-observing/types.d.ts +55 -0
- package/inferencer/types/be-reflective/types.d.ts +78 -0
- package/inferencer/types/be-reformable/types.d.ts +49 -0
- package/inferencer/types/be-render-neutral/types.d.ts +32 -0
- package/inferencer/types/be-switched/types.d.ts +146 -0
- package/inferencer/types/be-typed/types.d.ts +32 -0
- package/inferencer/types/be-valued/types.d.ts +22 -0
- package/inferencer/types/data-props/types.d.ts +34 -0
- package/inferencer/types/do-inc/types.d.ts +56 -0
- package/inferencer/types/do-invoke/types.d.ts +38 -0
- package/inferencer/types/do-merge/types.d.ts +28 -0
- package/inferencer/types/do-toggle/types.d.ts +31 -0
- package/inferencer/types/face-up/types.d.ts +100 -0
- package/inferencer/types/fetch-for/types.d.ts +36 -0
- package/inferencer/types/folder-picker/types.d.ts +21 -0
- package/inferencer/types/global.d.ts +29 -0
- package/inferencer/types/id-generation/types.d.ts +26 -0
- package/inferencer/types/inferencer/types.d.ts +46 -0
- package/inferencer/types/mount-observer/types.d.ts +363 -0
- package/inferencer/types/nested-regex-groups/types.d.ts +107 -0
- package/inferencer/types/pipe-in/types.d.ts +52 -0
- package/inferencer/types/roundabout/types.d.ts +268 -0
- package/inferencer/types/soak-up/types.d.ts +40 -0
- package/inferencer/types/templ-maker/types.d.ts +43 -0
- package/inferencer/types/time-ticker/types.d.ts +62 -0
- package/inferencer/types/truth-sourcer/types.d.ts +44 -0
- package/inferencer/upSearch.js +27 -0
- package/inferencer/upSearch.ts +26 -0
- package/inferencer/withScopePerimeter.js +27 -0
- package/inferencer/withScopePerimeter.ts +33 -0
- package/inferredAssignments.js +38 -0
- package/inferredAssignments.ts +65 -0
- package/isAllowedImportPath.js +42 -0
- package/isAllowedImportPath.ts +53 -0
- package/package.json +57 -3
- package/paths.js +231 -0
- package/paths.ts +413 -0
- package/processHandlerCommands.js +188 -0
- package/processHandlerCommands.ts +217 -0
- package/resolveIdRef.js +144 -0
- package/resolveIdRef.ts +170 -0
- package/resolveValues.js +41 -2
- package/resolveValues.ts +41 -1
- package/transitionHelper.js +109 -0
- package/transitionHelper.ts +132 -0
- package/types/assign-gingerly/types.d.ts +89 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { ElementEnhancementGateway, SpawnContext } from "../assign-gingerly/types";
|
|
2
|
+
import { Infer } from "../inferencer/types";
|
|
3
|
+
|
|
4
|
+
export interface RemoteSpecifier {
|
|
5
|
+
id?: string;
|
|
6
|
+
evtName?: string;
|
|
7
|
+
prop?: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface EndUserProps {
|
|
11
|
+
handler: string;
|
|
12
|
+
eventArg: string;
|
|
13
|
+
js: string;
|
|
14
|
+
format: string;
|
|
15
|
+
raw: boolean;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface AllProps extends EndUserProps {
|
|
19
|
+
enhancedElement: Element;
|
|
20
|
+
enhKey: string;
|
|
21
|
+
enhElLocalName: string;
|
|
22
|
+
categorized: boolean;
|
|
23
|
+
forAttr: string;
|
|
24
|
+
forArgs: string[];
|
|
25
|
+
handlerObj: EventListenerOrEventListenerObject | Function | undefined;
|
|
26
|
+
defaultEventType: string;
|
|
27
|
+
remoteSpecifiers: RemoteSpecifier[];
|
|
28
|
+
remSpecifierLen: number;
|
|
29
|
+
isOutputEl: boolean;
|
|
30
|
+
checkedRegistry: boolean;
|
|
31
|
+
customHandlers: Map<string, any>;
|
|
32
|
+
propToInfer: { [key: string]: Infer };
|
|
33
|
+
notYetParsedJS: boolean;
|
|
34
|
+
resolved: boolean;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export type AP = AllProps;
|
|
38
|
+
|
|
39
|
+
export type PAP = Partial<AP>;
|
|
40
|
+
|
|
41
|
+
export type ProPAP = Promise<PAP>;
|
|
42
|
+
|
|
43
|
+
export interface Actions {
|
|
44
|
+
init(self: AP, enhancedElement: Element & ElementEnhancementGateway, ctx: SpawnContext, initVals: PAP): Promise<void>;
|
|
45
|
+
categorizeEl(self: AP): PAP;
|
|
46
|
+
getDefltEvtType(self: AP): PAP;
|
|
47
|
+
parseForAttr(self: AP): PAP;
|
|
48
|
+
parseForAttrDSS(self: AP): Promise<PAP>;
|
|
49
|
+
genRemoteSpecifiers(self: AP): PAP;
|
|
50
|
+
getEvtHandler(self: AP): PAP;
|
|
51
|
+
seek(self: AP): Promise<PAP>;
|
|
52
|
+
hydrate(self: AP): Promise<PAP>;
|
|
53
|
+
parseJS(self: AP): Promise<PAP>;
|
|
54
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export interface EndUserProps{
|
|
2
|
+
triggerInsertPosition: InsertPosition;
|
|
3
|
+
cloneInsertPosition: InsertPosition;
|
|
4
|
+
buttonContent: string;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export interface AllProps extends EndUserProps{
|
|
8
|
+
enhancedElement: Element;
|
|
9
|
+
byob?: boolean;
|
|
10
|
+
trigger: HTMLButtonElement;
|
|
11
|
+
resolved: boolean;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export type AP = AllProps;
|
|
15
|
+
|
|
16
|
+
export type PAP = Partial<AP>;
|
|
17
|
+
|
|
18
|
+
export type ProPAP = Promise<PAP>;
|
|
19
|
+
|
|
20
|
+
export interface CustomData {
|
|
21
|
+
triggerSettings: {
|
|
22
|
+
type: string;
|
|
23
|
+
'?.classList?.add': string;
|
|
24
|
+
ariaLabel: string;
|
|
25
|
+
title: string;
|
|
26
|
+
},
|
|
27
|
+
withMethods: string[]
|
|
28
|
+
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
import { SpawnContext } from "../assign-gingerly/types";
|
|
32
|
+
|
|
33
|
+
export interface Actions{
|
|
34
|
+
addCloneBtn(self: AP): ProPAP;
|
|
35
|
+
setBtnContent(self: AP): void;
|
|
36
|
+
beCloned(self: AP): void;
|
|
37
|
+
init(self: AP, enhancedElement: Element, ctx: SpawnContext, initVals: PAP): Promise<void>
|
|
38
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface EndUserProps{
|
|
2
|
+
to: string | undefined;
|
|
3
|
+
nudge: boolean;
|
|
4
|
+
on: string;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export interface AllProps extends EndUserProps {
|
|
8
|
+
enhancedElement: Element;
|
|
9
|
+
resolved: boolean;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export type AP = AllProps;
|
|
13
|
+
|
|
14
|
+
export type PAP = Partial<AP>;
|
|
15
|
+
|
|
16
|
+
export type ProPAP = Promise<PAP>;
|
|
17
|
+
|
|
18
|
+
export interface Actions{
|
|
19
|
+
|
|
20
|
+
hydrate(self: AP): ProPAP;
|
|
21
|
+
init(self: AP, enhancedElement: Element, initVals: PAP): Promise<void>
|
|
22
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ElementEnhancementGateway, SpawnContext } from "../assign-gingerly/types";
|
|
2
|
+
|
|
3
|
+
export type ConsoleLevel = 'log' | 'warn' | 'error' | 'info' | 'debug';
|
|
4
|
+
|
|
5
|
+
export interface EndUserProps{
|
|
6
|
+
level: ConsoleLevel;
|
|
7
|
+
ignore: string[];
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface AllProps extends EndUserProps{
|
|
11
|
+
enhancedElement: Element;
|
|
12
|
+
resolved: boolean;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export type AP = AllProps;
|
|
16
|
+
|
|
17
|
+
export type PAP = Partial<AP>;
|
|
18
|
+
|
|
19
|
+
export type ProPAP = Promise<PAP>;
|
|
20
|
+
|
|
21
|
+
export interface Actions{
|
|
22
|
+
hydrate(self: AP): PAP;
|
|
23
|
+
init(self: AP, enhancedElement: Element & ElementEnhancementGateway, ctx: SpawnContext, initVals: PAP): Promise<void>;
|
|
24
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
|
|
2
|
+
export interface EndUserProps{
|
|
3
|
+
path: string
|
|
4
|
+
src: string
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export interface AllProps extends EndUserProps{
|
|
8
|
+
template: HTMLTemplateElement;
|
|
9
|
+
enhancedElement: Element;
|
|
10
|
+
resolved: boolean;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export type AP = AllProps;
|
|
14
|
+
|
|
15
|
+
export type PAP = Partial<AP>;
|
|
16
|
+
|
|
17
|
+
export type ProPAP = Promise<PAP>;
|
|
18
|
+
|
|
19
|
+
//export type BAP = AP & BEAllProps;
|
|
20
|
+
|
|
21
|
+
export interface Actions{
|
|
22
|
+
act(self: BAP): PAP
|
|
23
|
+
fetchRemoteTemplate(self: BAP): ProPAP
|
|
24
|
+
upShadowSearch(self: BAP): ProPAP
|
|
25
|
+
init(self: BAP, initVals: PAP): Promise<void>
|
|
26
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export interface EndUserProps{
|
|
2
|
+
triggerInsertPosition: InsertPosition;
|
|
3
|
+
buttonContent: string;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export interface AllProps extends EndUserProps{
|
|
7
|
+
enhancedElement: Element;
|
|
8
|
+
byob?: boolean,
|
|
9
|
+
trigger: HTMLButtonElement;
|
|
10
|
+
resolved: boolean,
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export type AP = AllProps;
|
|
14
|
+
|
|
15
|
+
export type PAP = Partial<AP>;
|
|
16
|
+
|
|
17
|
+
export type ProPAP = Promise<PAP>;
|
|
18
|
+
|
|
19
|
+
import { ElementEnhancementGateway, SpawnContext } from "../assign-gingerly/types";
|
|
20
|
+
|
|
21
|
+
export interface Actions{
|
|
22
|
+
|
|
23
|
+
addDeleteBtn(self: AP): ProPAP ;
|
|
24
|
+
setBtnContent(self: AP): void;
|
|
25
|
+
beDeleted(self: AP): void;
|
|
26
|
+
init(self: AP & Actions, enhancedElement: Element & ElementEnhancementGateway, ctx: SpawnContext, initVals: PAP): Promise<void>;
|
|
27
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { ElementEnhancementGateway, SpawnContext } from "../assign-gingerly/types";
|
|
2
|
+
import { StatementsResult } from "../nested-regex-groups/types";
|
|
3
|
+
|
|
4
|
+
export interface DispatchRule {
|
|
5
|
+
dispatch: string;
|
|
6
|
+
dispatchOn?: string;
|
|
7
|
+
qualifiers?: string;
|
|
8
|
+
bubbles?: boolean;
|
|
9
|
+
composed?: boolean;
|
|
10
|
+
cancelable?: boolean;
|
|
11
|
+
replace?: boolean;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface EndUserProps {
|
|
15
|
+
crudeDispatchRules: StatementsResult<DispatchRule>;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface AllProps extends EndUserProps {
|
|
19
|
+
enhancedElement: Element;
|
|
20
|
+
dispatchRules: Array<DispatchRule>;
|
|
21
|
+
resolved: boolean;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export type AP = AllProps;
|
|
25
|
+
|
|
26
|
+
export type PAP = Partial<AP>;
|
|
27
|
+
|
|
28
|
+
export type ProPAP = Promise<PAP>;
|
|
29
|
+
|
|
30
|
+
export interface Actions {
|
|
31
|
+
init(self: AP, enhancedElement: Element & ElementEnhancementGateway, ctx: SpawnContext, initVals: PAP): Promise<void>;
|
|
32
|
+
finishParsing(self: AP): PAP;
|
|
33
|
+
hydrate(self: AP): ProPAP;
|
|
34
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ElementEnhancementGateway, SpawnContext } from "../assign-gingerly/types";
|
|
2
|
+
|
|
3
|
+
export interface EndUserProps{
|
|
4
|
+
whenDefined: string[];
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export interface AllProps extends EndUserProps{
|
|
8
|
+
enhancedElement: Element;
|
|
9
|
+
resolved: boolean;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export type AP = AllProps;
|
|
13
|
+
export type PAP = Partial<AP>;
|
|
14
|
+
export type ProPAP = Promise<PAP>;
|
|
15
|
+
|
|
16
|
+
export interface Actions{
|
|
17
|
+
init(self: AP, enhancedElement: Element & ElementEnhancementGateway, ctx: SpawnContext, initVals: PAP): Promise<void>;
|
|
18
|
+
inferFromParent(self: AP): ProPAP;
|
|
19
|
+
onWhenDefined(self: AP): ProPAP;
|
|
20
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ElementEnhancementGateway, SpawnContext } from "../assign-gingerly/types";
|
|
2
|
+
|
|
3
|
+
export interface EndUserProps{
|
|
4
|
+
duration: number;
|
|
5
|
+
attr: string;
|
|
6
|
+
css: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface AllProps extends EndUserProps{
|
|
10
|
+
enhancedElement: Element;
|
|
11
|
+
resolved: boolean;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export type AP = AllProps;
|
|
15
|
+
export type PAP = Partial<AP>;
|
|
16
|
+
export type ProPAP = Promise<PAP>;
|
|
17
|
+
|
|
18
|
+
export interface Actions{
|
|
19
|
+
init(self: AP, enhancedElement: Element & ElementEnhancementGateway, ctx: SpawnContext, initVals: PAP): Promise<void>;
|
|
20
|
+
hydrate(self: AP): ProPAP;
|
|
21
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ElementEnhancementGateway, SpawnContext } from "../assign-gingerly/types";
|
|
2
|
+
|
|
3
|
+
export interface EndUserProps {
|
|
4
|
+
whenDef: string;
|
|
5
|
+
whenMissing: string;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface AllProps extends EndUserProps {
|
|
9
|
+
enhancedElement: Element;
|
|
10
|
+
onDefined: string[];
|
|
11
|
+
resolved: boolean;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export type AP = AllProps;
|
|
15
|
+
|
|
16
|
+
export type PAP = Partial<AP>;
|
|
17
|
+
|
|
18
|
+
export type ProPAP = Promise<PAP>;
|
|
19
|
+
|
|
20
|
+
export interface Actions {
|
|
21
|
+
init(self: AP, enhancedElement: Element & ElementEnhancementGateway, ctx: SpawnContext, initVals: PAP): Promise<void>;
|
|
22
|
+
parseWhenDef(self: AP): PAP;
|
|
23
|
+
onOnDefined(self: AP): ProPAP;
|
|
24
|
+
hydrateOnMissing(self: AP): ProPAP;
|
|
25
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { StatementsResult } from "../nested-regex-groups/types";
|
|
2
|
+
import { ElementEnhancementGateway, SpawnContext } from "../assign-gingerly/types";
|
|
3
|
+
|
|
4
|
+
export interface RemoteSpecifier {
|
|
5
|
+
id?: string;
|
|
6
|
+
prop?: string;
|
|
7
|
+
path?: string;
|
|
8
|
+
evtName?: string;
|
|
9
|
+
as?: 'number' | 'boolean' | 'string' | 'object' | 'regexp' | 'urlpattern' | 'boolean|number';
|
|
10
|
+
constVal?: any;
|
|
11
|
+
enhKey?: string;
|
|
12
|
+
ish?: boolean;
|
|
13
|
+
host?: boolean;
|
|
14
|
+
self?: boolean;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface ObservingParameters {
|
|
18
|
+
localPropToSet?: string;
|
|
19
|
+
remoteSpecifiers: Array<RemoteSpecifier>;
|
|
20
|
+
punt: boolean;
|
|
21
|
+
aggKey: string;
|
|
22
|
+
interpolatingExpr: string;
|
|
23
|
+
JSExpr: string;
|
|
24
|
+
ONExpr: string;
|
|
25
|
+
action?:
|
|
26
|
+
| 'set'
|
|
27
|
+
| 'toggle'
|
|
28
|
+
| 'increment'
|
|
29
|
+
| 'decrement'
|
|
30
|
+
| 'set-class'
|
|
31
|
+
| 'set-part';
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface EndUserProps {
|
|
35
|
+
parsedStatements: StatementsResult<ObservingParameters>;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface AllProps extends EndUserProps {
|
|
39
|
+
enhancedElement: Element;
|
|
40
|
+
enhKey: string;
|
|
41
|
+
customHandlers: Map<string, any>;
|
|
42
|
+
ws: Array<any>;
|
|
43
|
+
didInferring: boolean;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export type AP = AllProps;
|
|
47
|
+
|
|
48
|
+
export type PAP = Partial<AP>;
|
|
49
|
+
|
|
50
|
+
export type ProPAP = Promise<PAP>;
|
|
51
|
+
|
|
52
|
+
export interface Actions {
|
|
53
|
+
init(self: AP, enhancedElement: Element & ElementEnhancementGateway, ctx: SpawnContext, initVals: PAP): Promise<void>;
|
|
54
|
+
seek(self: AP): ProPAP;
|
|
55
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared context passed via getSharedContext — contains everything
|
|
3
|
+
* the Reflector needs to self-activate on spawn.
|
|
4
|
+
*/
|
|
5
|
+
export interface ReflectorSharedContext {
|
|
6
|
+
/** The ElementInternals instance for custom state manipulation */
|
|
7
|
+
internals: ElementInternals;
|
|
8
|
+
/** The EventTarget the host dispatches property change events on */
|
|
9
|
+
hostPropagator: EventTarget;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Context passed to the Reflector feature constructor
|
|
14
|
+
*/
|
|
15
|
+
export interface FeatureSpawnContext {
|
|
16
|
+
key: string;
|
|
17
|
+
optIn: any;
|
|
18
|
+
injection: any;
|
|
19
|
+
featuresRegistry: any;
|
|
20
|
+
shared?: ReflectorSharedContext;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* A single custom state export rule parsed from --custom-state-exports
|
|
25
|
+
*/
|
|
26
|
+
export interface CustomStateRule {
|
|
27
|
+
/** The custom state name to toggle (e.g. "disabled", "alertTypeIndicatesSuccess") */
|
|
28
|
+
stateName: string;
|
|
29
|
+
/** The property name to observe */
|
|
30
|
+
propName: string;
|
|
31
|
+
/** The condition type */
|
|
32
|
+
conditionType: 'boolean' | 'equals' | 'contains' | 'endsWith' | 'modulo' | 'lessThan' | 'greaterThan' | 'lessThanOrEqual' | 'greaterThanOrEqual';
|
|
33
|
+
/** The comparison value (for non-boolean conditions) */
|
|
34
|
+
compareValue?: string | number;
|
|
35
|
+
/** The modulo divisor (for modulo conditions) */
|
|
36
|
+
moduloDivisor?: number;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Properties that the Reflector feature exposes.
|
|
41
|
+
* With callbackForwarding, hostPropagator is provided via getSharedContext
|
|
42
|
+
* and the feature self-activates — but the setter remains for manual use cases.
|
|
43
|
+
*/
|
|
44
|
+
export interface ReflectorProps {
|
|
45
|
+
/**
|
|
46
|
+
* The EventTarget that the host element uses to propagate property change events.
|
|
47
|
+
* Provided via getSharedContext. Also settable post-spawn for reconnection.
|
|
48
|
+
*/
|
|
49
|
+
hostPropagator: EventTarget | null;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Internal state
|
|
54
|
+
*/
|
|
55
|
+
export interface AllProps extends ReflectorProps {
|
|
56
|
+
/**
|
|
57
|
+
* WeakRef to the host custom element
|
|
58
|
+
*/
|
|
59
|
+
hostRef: WeakRef<HTMLElement> | null;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* The ElementInternals instance from the host (for custom state manipulation)
|
|
63
|
+
*/
|
|
64
|
+
internals: ElementInternals | null;
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Parsed custom state rules from --custom-state-exports CSS property
|
|
68
|
+
*/
|
|
69
|
+
rules: CustomStateRule[];
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* AbortController for cleaning up event listeners
|
|
73
|
+
*/
|
|
74
|
+
abortController: AbortController | null;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export type AP = AllProps;
|
|
78
|
+
export type PAP = Partial<AP>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { ElementEnhancementGateway, SpawnContext } from "../assign-gingerly/types";
|
|
2
|
+
|
|
3
|
+
export interface SubmitOptions {
|
|
4
|
+
onlyAfter: string,
|
|
5
|
+
nudges: boolean,
|
|
6
|
+
disableIfNotAllConditionsAreMet: boolean
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface EndUserProps{
|
|
10
|
+
baseLink: string,
|
|
11
|
+
baseURL: string,
|
|
12
|
+
path: string,
|
|
13
|
+
headers: HeadersInit | undefined,
|
|
14
|
+
updateOn: 'input' | 'change' | 'submit',
|
|
15
|
+
submitOptions: SubmitOptions,
|
|
16
|
+
headerFields: Array<string>
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
type BeforeToken = string;
|
|
20
|
+
type TokenKey = string | undefined
|
|
21
|
+
|
|
22
|
+
export interface IURLBuilder{
|
|
23
|
+
readonly tokens: Array<[BeforeToken, TokenKey]>
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface AllProps extends EndUserProps{
|
|
27
|
+
enhancedElement: Element;
|
|
28
|
+
updateCnt: number,
|
|
29
|
+
readonly urlBuilder: IURLBuilder,
|
|
30
|
+
readonly resolvedBaseURL: true,
|
|
31
|
+
readonly fetchOptions: RequestInit,
|
|
32
|
+
readonly isFetchReady: boolean,
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export type AP = AllProps;
|
|
36
|
+
|
|
37
|
+
export type PAP = Partial<AP>;
|
|
38
|
+
|
|
39
|
+
export type ProPAP = Promise<PAP>;
|
|
40
|
+
|
|
41
|
+
export interface Actions {
|
|
42
|
+
init(self: AP, enhancedElement: Element & ElementEnhancementGateway, ctx: SpawnContext, initVals: PAP): Promise<void>;
|
|
43
|
+
resolveBaseLink(self: AP): PAP;
|
|
44
|
+
specifyDefaultBaseURL(self: AP): PAP;
|
|
45
|
+
hydrate(self: AP): ProPAP;
|
|
46
|
+
updateAction(self: AP): ProPAP;
|
|
47
|
+
parsePath(self: AP): ProPAP;
|
|
48
|
+
suggestFetch(self: AP): ProPAP;
|
|
49
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ElementEnhancementGateway, SpawnContext } from "../assign-gingerly/types";
|
|
2
|
+
|
|
3
|
+
export interface RenderingHTMLScriptElement extends HTMLScriptElement{
|
|
4
|
+
renderer: (vm: any, html: any) => any,
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export interface EndUserProps{
|
|
8
|
+
vm: any,
|
|
9
|
+
with: Array<string>,
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export type Renderer = (vm: any, html: any) => any;
|
|
13
|
+
|
|
14
|
+
export interface AllProps extends EndUserProps{
|
|
15
|
+
enhancedElement: Element;
|
|
16
|
+
renderer: Renderer,
|
|
17
|
+
absorbingObject: any
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export type PAP = Partial<AllProps>;
|
|
21
|
+
|
|
22
|
+
export type AP = AllProps;
|
|
23
|
+
|
|
24
|
+
export type ProPAP = Promise<PAP>;
|
|
25
|
+
|
|
26
|
+
export interface Actions {
|
|
27
|
+
init(self: AP, enhancedElement: Element & ElementEnhancementGateway, ctx: SpawnContext, initVals: PAP): Promise<void>;
|
|
28
|
+
getRenderer(self: AP): PAP;
|
|
29
|
+
doRender(self: AP): void;
|
|
30
|
+
observe(self: AP): ProPAP;
|
|
31
|
+
absorb(self: AP, e?: Event): ProPAP;
|
|
32
|
+
}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { ElementEnhancementGateway, SpawnContext } from "../assign-gingerly/types";
|
|
2
|
+
import { StatementsResult } from "../nested-regex-groups/types";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Parsed specifier for referencing an element's value
|
|
6
|
+
*/
|
|
7
|
+
export interface ValueSpecifier {
|
|
8
|
+
/** Element ID (without #) */
|
|
9
|
+
id?: string;
|
|
10
|
+
/** Property name to observe */
|
|
11
|
+
prop?: string;
|
|
12
|
+
/** Property path (chained accessor) */
|
|
13
|
+
path?: string;
|
|
14
|
+
/** Event name to listen for changes */
|
|
15
|
+
evtName?: string;
|
|
16
|
+
/** Attribute name (source of truth) */
|
|
17
|
+
attr?: string;
|
|
18
|
+
/** Constant value (backtick-delimited) */
|
|
19
|
+
constVal?: string;
|
|
20
|
+
/** Type casting */
|
|
21
|
+
as?: 'number' | 'string' | 'boolean';
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* A two-value comparison statement (lhs op rhs)
|
|
26
|
+
*/
|
|
27
|
+
export interface TwoValueSwitch {
|
|
28
|
+
onOrOff: 'on' | 'off';
|
|
29
|
+
lhsSpecifier: ValueSpecifier;
|
|
30
|
+
rhsSpecifier: ValueSpecifier;
|
|
31
|
+
op: 'eq' | 'equals' | 'lt' | 'gt' | 'lte' | 'gte';
|
|
32
|
+
/** Required (AND) condition */
|
|
33
|
+
req?: boolean;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* A single boolean value switch
|
|
38
|
+
*/
|
|
39
|
+
export interface SingleValSwitch {
|
|
40
|
+
onOrOff: 'on' | 'off';
|
|
41
|
+
specifier: ValueSpecifier;
|
|
42
|
+
/** Required (AND / "only") condition */
|
|
43
|
+
req?: boolean;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* An n-value JavaScript-evaluated switch
|
|
48
|
+
*/
|
|
49
|
+
export interface NValueSwitch {
|
|
50
|
+
dependencies: ValueSpecifier[];
|
|
51
|
+
registeredHandler?: string;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Parsed result from the DSL attribute
|
|
56
|
+
*/
|
|
57
|
+
export interface ParsedStatements {
|
|
58
|
+
twoValueSwitches?: TwoValueSwitch[];
|
|
59
|
+
singleValSwitches?: SingleValSwitch[];
|
|
60
|
+
nValueSwitches?: NValueSwitch[];
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export interface EndUserProps {
|
|
64
|
+
/** Type casting for comparisons */
|
|
65
|
+
as?: 'number' | 'string' | 'boolean';
|
|
66
|
+
/** Use view transitions */
|
|
67
|
+
transitional?: boolean;
|
|
68
|
+
/** Delete content when invalid instead of hiding */
|
|
69
|
+
minMem?: boolean;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export interface AllProps extends EndUserProps {
|
|
73
|
+
enhancedElement: Element & ElementEnhancementGateway;
|
|
74
|
+
/** Raw parsed statements from the DSL */
|
|
75
|
+
parsedStatements: StatementsResult<ParsedStatements>;
|
|
76
|
+
/** The JS expression for CSP-safe evaluation */
|
|
77
|
+
js?: string;
|
|
78
|
+
/** Whether the JS expression has been processed */
|
|
79
|
+
notProcessedJS: boolean;
|
|
80
|
+
/** Hidden style rule */
|
|
81
|
+
hiddenStyle: string;
|
|
82
|
+
/** Whether to use boolish comparison */
|
|
83
|
+
beBoolish: boolean;
|
|
84
|
+
/** Simple lhs value (Part I JSON mode) */
|
|
85
|
+
lhs: any;
|
|
86
|
+
/** Simple rhs value (Part I JSON mode) */
|
|
87
|
+
rhs: any;
|
|
88
|
+
/** Computed final value (true = show content) */
|
|
89
|
+
val: boolean;
|
|
90
|
+
/** Echo of val for change detection */
|
|
91
|
+
echoVal: boolean;
|
|
92
|
+
/** Combined satisfaction of all switches */
|
|
93
|
+
switchesSatisfied: boolean;
|
|
94
|
+
/** Single val switches are satisfied */
|
|
95
|
+
singleValSwitchesSatisfied: boolean;
|
|
96
|
+
/** Single val switch veto */
|
|
97
|
+
singleValSwitchNoGo: boolean;
|
|
98
|
+
/** Two val switches are satisfied */
|
|
99
|
+
twoValSwitchesSatisfied: boolean;
|
|
100
|
+
/** Two val switch veto */
|
|
101
|
+
twoValSwitchNoGo: boolean;
|
|
102
|
+
/** ID ref attribute for tracking cloned content */
|
|
103
|
+
idRefAttr: string;
|
|
104
|
+
/** Toggle inert on hide */
|
|
105
|
+
toggleInert?: boolean;
|
|
106
|
+
/** EMC config reference */
|
|
107
|
+
emc: any;
|
|
108
|
+
resolved: boolean;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export type AP = AllProps;
|
|
112
|
+
export type PAP = Partial<AP>;
|
|
113
|
+
export type ProPAP = Promise<PAP>;
|
|
114
|
+
|
|
115
|
+
export interface Actions {
|
|
116
|
+
init(self: AP, enhancedElement: Element & ElementEnhancementGateway, ctx: SpawnContext, initVals: PAP): Promise<void>;
|
|
117
|
+
hydrate(self: AP): ProPAP;
|
|
118
|
+
onTrue(self: AP): Promise<void>;
|
|
119
|
+
onFalse(self: AP): Promise<void>;
|
|
120
|
+
calcVal(self: AP): PAP;
|
|
121
|
+
calcSwitchesSatisfied(self: AP): PAP;
|
|
122
|
+
onSingleValSwitches(self: AP): Promise<void>;
|
|
123
|
+
onTwoValSwitches(self: AP): Promise<void>;
|
|
124
|
+
onNValSwitches(self: AP): Promise<void>;
|
|
125
|
+
processJS(self: AP): ProPAP;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Event passed to registered n-value handlers.
|
|
130
|
+
* Handlers set `e.r` to the result of their evaluation.
|
|
131
|
+
*/
|
|
132
|
+
export interface AggEvent extends Event {
|
|
133
|
+
/** The return value — set this to the result of the evaluation */
|
|
134
|
+
r: any;
|
|
135
|
+
/** Array of dependency values in declaration order */
|
|
136
|
+
args: Array<any>;
|
|
137
|
+
/** Named map of dependency values (keyed by data-id, id, or prop name) */
|
|
138
|
+
f: { [key: string]: any };
|
|
139
|
+
/** The enhanced element (template or data) */
|
|
140
|
+
target: EventTarget;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Handler function signature for registered n-value handlers
|
|
145
|
+
*/
|
|
146
|
+
export type AggHandler = (e: AggEvent) => void;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ElementEnhancementGateway, SpawnContext } from "../assign-gingerly/types";
|
|
2
|
+
|
|
3
|
+
export interface EndUserProps {
|
|
4
|
+
triggerInsertPosition: InsertPosition;
|
|
5
|
+
labelTextContainer: string;
|
|
6
|
+
buttonContent: string;
|
|
7
|
+
nudge?: boolean;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface AllProps extends EndUserProps{
|
|
11
|
+
enhancedElement: Element;
|
|
12
|
+
byob?: boolean;
|
|
13
|
+
trigger: WeakRef<HTMLButtonElement>
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export type AP = AllProps;
|
|
17
|
+
|
|
18
|
+
export type PAP = Partial<AP>;
|
|
19
|
+
|
|
20
|
+
export type ProPAP = Promise<PAP>;
|
|
21
|
+
|
|
22
|
+
export interface Actions{
|
|
23
|
+
init(self: AP, enhancedElement: Element & ElementEnhancementGateway, ctx: SpawnContext, initVals: PAP): Promise<void>;
|
|
24
|
+
addTypeBtn(self: AP): ProPAP;
|
|
25
|
+
setBtnContent(self: AP): void;
|
|
26
|
+
openDialog(self: AP): Promise<void>
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface ITyper{
|
|
30
|
+
showDialog(): void;
|
|
31
|
+
dispose(): void;
|
|
32
|
+
}
|