mount-observer 0.1.31 → 0.1.34
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/package.json +2 -2
- package/playwright.config.ts +30 -8
- package/types/assign-gingerly/types.d.ts +6 -0
- package/types/be-bound/types.d.ts +60 -0
- package/types/do-inc/types.d.ts +56 -0
- package/types/do-invoke/types.d.ts +15 -5
- package/types/do-toggle/types.d.ts +27 -0
- package/types/nested-regex-groups/types.d.ts +6 -0
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mount-observer",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.34",
|
|
4
4
|
"description": "Observe and act on css matches.",
|
|
5
5
|
"main": "MountObserver.js",
|
|
6
6
|
"module": "MountObserver.js",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"assign-gingerly": "0.0.
|
|
8
|
+
"assign-gingerly": "0.0.30",
|
|
9
9
|
"id-generation": "0.0.4"
|
|
10
10
|
},
|
|
11
11
|
"devDependencies": {
|
package/playwright.config.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// playwright.config.ts
|
|
2
2
|
import { PlaywrightTestConfig, devices } from '@playwright/test';
|
|
3
|
+
|
|
3
4
|
const config: PlaywrightTestConfig = {
|
|
4
5
|
testIgnore: '**/experimentalCrossScopeRegistering/**',
|
|
5
6
|
webServer: {
|
|
@@ -16,14 +17,35 @@ const config: PlaywrightTestConfig = {
|
|
|
16
17
|
name: 'chromium',
|
|
17
18
|
use: { ...devices['Desktop Chrome'] },
|
|
18
19
|
},
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
20
|
+
{
|
|
21
|
+
name: 'firefox',
|
|
22
|
+
use: { ...devices['Desktop Firefox'] },
|
|
23
|
+
// Tests to skip in Firefox (known failures)
|
|
24
|
+
// Note: experimentalCrossScopeRegistering is already ignored globally
|
|
25
|
+
testIgnore: [
|
|
26
|
+
'**/experimentalCrossScopeRegistering/**',
|
|
27
|
+
'**/id-generation-integration.spec.mjs',
|
|
28
|
+
'**/test-element-mount.spec.mjs',
|
|
29
|
+
'**/test-emc-script.spec.mjs',
|
|
30
|
+
'**/test-enhance-mounted-element.spec.mjs',
|
|
31
|
+
'**/test-mount-globally.spec.mjs',
|
|
32
|
+
],
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
name: 'webkit',
|
|
36
|
+
use: { ...devices['Desktop Safari'] },
|
|
37
|
+
// Tests to skip in WebKit (known failures)
|
|
38
|
+
// Note: experimentalCrossScopeRegistering is already ignored globally
|
|
39
|
+
testIgnore: [
|
|
40
|
+
'**/experimentalCrossScopeRegistering/**',
|
|
41
|
+
'**/test-builtins.spec.mjs',
|
|
42
|
+
'**/test-element-mount.spec.mjs',
|
|
43
|
+
'**/test-emc-script.spec.mjs',
|
|
44
|
+
'**/test-enhance-mounted-element.spec.mjs',
|
|
45
|
+
'**/test-mount-globally.spec.mjs',
|
|
46
|
+
],
|
|
47
|
+
},
|
|
27
48
|
],
|
|
28
49
|
};
|
|
50
|
+
|
|
29
51
|
export default config;
|
|
@@ -298,9 +298,15 @@ export declare function assignGingerly(
|
|
|
298
298
|
export default assignGingerly;
|
|
299
299
|
|
|
300
300
|
export declare class ElementEnhancementGateway{
|
|
301
|
+
//TODO: this isn't right
|
|
301
302
|
enh: ElementEnhancement;
|
|
302
303
|
}
|
|
303
304
|
|
|
304
305
|
export interface ElementEnhancement{
|
|
305
306
|
dispose(regItem: EnhancementConfig): void;
|
|
306
307
|
}
|
|
308
|
+
|
|
309
|
+
export interface ElementInfer{
|
|
310
|
+
value: any;
|
|
311
|
+
eventType: string
|
|
312
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { Specifier } from "../trans-render/dss/types";
|
|
2
|
+
import {AbsorbingObject, SharingObject} from '../trans-render/asmr/types';
|
|
3
|
+
import { StatementsResult } from "../nested-regex-groups/types";
|
|
4
|
+
|
|
5
|
+
export interface EndUserProps{
|
|
6
|
+
bindingRules?: StatementsResult<BindingRule>;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface AllProps extends EndUserProps{
|
|
10
|
+
enhancedElement: Element;
|
|
11
|
+
bindings: Array<Binding>,
|
|
12
|
+
isParsed?: boolean,
|
|
13
|
+
rawStatements?: Array<string>
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export type SignalEnhancement = 'be-value-added' | 'be-propagating' | undefined;
|
|
17
|
+
|
|
18
|
+
export interface BindingRule {
|
|
19
|
+
|
|
20
|
+
localProp?: string,
|
|
21
|
+
localEvent?: string,
|
|
22
|
+
remoteSpecifierString?: string,
|
|
23
|
+
remoteSpecifier?: Specifier,
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface Binding {
|
|
29
|
+
//new and improved
|
|
30
|
+
localAbsObj: AbsorbingObject;
|
|
31
|
+
localShareObj: SharingObject;
|
|
32
|
+
remoteAbsObj: AbsorbingObject;
|
|
33
|
+
remoteShareObj: SharingObject;
|
|
34
|
+
//remoteRef: WeakRef<Element>;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export type AP = AllProps;
|
|
38
|
+
|
|
39
|
+
export type PAP = Partial<AP>;
|
|
40
|
+
|
|
41
|
+
export type ProPAP = Promise<PAP>;
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
export interface Actions{
|
|
45
|
+
noAttrs(self: AP): ProPAP;
|
|
46
|
+
getBindings(self: AP): ProPAP;
|
|
47
|
+
hydrate(self: AP): ProPAP;
|
|
48
|
+
onRawStatements(self: AP): void;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export type WithStatement = string;
|
|
52
|
+
|
|
53
|
+
export type BetweenStatement = string;
|
|
54
|
+
|
|
55
|
+
export type TriggerSource = 'local' | 'remote' | 'tie';
|
|
56
|
+
|
|
57
|
+
export interface SpecificityResult {
|
|
58
|
+
val?: any,
|
|
59
|
+
winner?: TriggerSource;
|
|
60
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { ElementEnhancementGateway } from "../assign-gingerly/types";
|
|
2
|
+
import { StatementsResult } from "../nested-regex-groups/types";
|
|
3
|
+
|
|
4
|
+
export interface EndUserProps{
|
|
5
|
+
parsedStatements: StatementsResult<IncParameters>,
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface AllProps extends EndUserProps{
|
|
9
|
+
enhancedElement: Element & ElementEnhancementGateway;
|
|
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 interface Actions{
|
|
20
|
+
hydrate(self: AP & Actions): ProPAP;
|
|
21
|
+
handleEvent(self: AP, event: Event, incParameters: IncParameters): void;
|
|
22
|
+
init(self: AP, enhancedElement: Element, initVals: PAP): Promise<void>
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export type asOptions =
|
|
26
|
+
| 'number'
|
|
27
|
+
| 'boolean'
|
|
28
|
+
| 'string'
|
|
29
|
+
| 'object'
|
|
30
|
+
| 'regexp'
|
|
31
|
+
| 'urlpattern'
|
|
32
|
+
| 'boolean|number'
|
|
33
|
+
;
|
|
34
|
+
|
|
35
|
+
export type SubPropPath = string;
|
|
36
|
+
export type EventName = string;
|
|
37
|
+
|
|
38
|
+
// export interface Specifier {
|
|
39
|
+
// id?: string,
|
|
40
|
+
// prop?: string,
|
|
41
|
+
// path?: SubPropPath,
|
|
42
|
+
// evtName?: EventName,
|
|
43
|
+
// as?: asOptions,
|
|
44
|
+
// constVal?: any;
|
|
45
|
+
// enhKey?: string;
|
|
46
|
+
// ish?: boolean;
|
|
47
|
+
// host?: boolean;
|
|
48
|
+
// }
|
|
49
|
+
|
|
50
|
+
export interface IncParameters {
|
|
51
|
+
prop?: string | null,
|
|
52
|
+
byAmtS?: string,
|
|
53
|
+
byAmtN?: number,
|
|
54
|
+
targetElementId?: string,
|
|
55
|
+
localEventType?: string,
|
|
56
|
+
}
|
|
@@ -1,15 +1,18 @@
|
|
|
1
|
+
import { ElementEnhancementGateway } from "../assign-gingerly/types";
|
|
2
|
+
import { StatementsResult } from "../nested-regex-groups/types";
|
|
3
|
+
|
|
1
4
|
export interface Specifier {
|
|
2
5
|
selector?: string;
|
|
3
6
|
prop?: string;
|
|
4
7
|
}
|
|
5
8
|
|
|
6
9
|
export interface EndUserProps{
|
|
7
|
-
|
|
10
|
+
invokeParamSet: StatementsResult<InvokingParameters>,
|
|
8
11
|
}
|
|
9
12
|
|
|
10
13
|
export interface AllProps extends EndUserProps{
|
|
11
|
-
enhancedElement: Element;
|
|
12
|
-
|
|
14
|
+
enhancedElement: Element & ElementEnhancementGateway;
|
|
15
|
+
resolved: boolean;
|
|
13
16
|
}
|
|
14
17
|
|
|
15
18
|
export type AP = AllProps;
|
|
@@ -20,9 +23,16 @@ export type ProPAP = Promise<PAP>
|
|
|
20
23
|
|
|
21
24
|
export interface Actions{
|
|
22
25
|
hydrate(self: AP): ProPAP;
|
|
26
|
+
init(self: AP, enhancedElement: Element, initVals: PAP): Promise<void>
|
|
23
27
|
}
|
|
24
28
|
|
|
29
|
+
|
|
30
|
+
|
|
25
31
|
export interface InvokingParameters {
|
|
26
|
-
|
|
27
|
-
|
|
32
|
+
targetSpecifier: {
|
|
33
|
+
hostOrPeerMethodName: string,
|
|
34
|
+
targetElementId?: string,
|
|
35
|
+
},
|
|
36
|
+
//defaults to "click" if not specified
|
|
37
|
+
localEventType: string,
|
|
28
38
|
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ElementEnhancementGateway, ElementInfer } from "../assign-gingerly/types";
|
|
2
|
+
import { StatementsResult } from "../nested-regex-groups/types";
|
|
3
|
+
|
|
4
|
+
export interface EndUserProps{}
|
|
5
|
+
|
|
6
|
+
export interface AllProps extends EndUserProps{
|
|
7
|
+
enhancedElement: Element & ElementEnhancementGateway;
|
|
8
|
+
parsedStatements: StatementsResult<TogglingParameters>;
|
|
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
|
+
init(self: AllProps, enhancedElement: Element, initVals: PAP): void;
|
|
20
|
+
hydrate(self: AP): ProPAP;
|
|
21
|
+
handleEvent(self: AP, e: Event, parsedStatement: TogglingParameters): void;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface TogglingParameters {
|
|
25
|
+
prop?: string | null;
|
|
26
|
+
localEventType?: string;
|
|
27
|
+
}
|
|
@@ -54,6 +54,12 @@ export interface PatternConfig {
|
|
|
54
54
|
name: string;
|
|
55
55
|
pattern: string;
|
|
56
56
|
description?: string;
|
|
57
|
+
/**
|
|
58
|
+
* Default values to merge into the parsed result
|
|
59
|
+
* Keys can use dot notation for nested values
|
|
60
|
+
* Example: { trigger: 'on', 'lhs.id': '#lhs' }
|
|
61
|
+
*/
|
|
62
|
+
defaultVals?: Record<string, string>;
|
|
57
63
|
}
|
|
58
64
|
|
|
59
65
|
/**
|