mount-observer 0.1.36 → 0.1.38
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 +171 -5
- package/Synthesizer.js +6 -4
- package/Synthesizer.ts +6 -4
- package/handlers/CedeScript.js +100 -0
- package/handlers/CedeScript.ts +106 -0
- package/handlers/EMCScript.js +8 -1
- package/handlers/EMCScript.ts +9 -1
- package/handlers/ScriptExport.js +0 -1
- package/handlers/ScriptExport.ts +0 -1
- package/handlers/elementIntersection.js +73 -73
- package/index.js +2 -0
- package/index.ts +2 -0
- package/package.json +3 -3
- package/types/assign-gingerly/types.d.ts +154 -1
- package/types/be-reflective/types.d.ts +80 -0
- package/types/do-inc/types.d.ts +2 -2
- package/types/do-merge/types.d.ts +28 -0
- package/types/do-toggle/types.d.ts +6 -2
- package/types/face-up/types.d.ts +102 -0
- package/types/roundabout/types.d.ts +41 -9
- package/types/templ-maker/types.d.ts +45 -0
- package/types/time-ticker/types.d.ts +62 -0
- package/types/truth-sourcer/types.d.ts +46 -0
|
@@ -42,18 +42,17 @@ export type Actions<TProps = any, TActions = TProps> =
|
|
|
42
42
|
//& Partial<{[key in `do_${keyof TActions & string}_on`]: Key<TActions> | Array<Key<TActions>> }>
|
|
43
43
|
;
|
|
44
44
|
|
|
45
|
-
export type Compacts<TProps = any, TActions = TProps> =
|
|
46
|
-
|
|
47
|
-
| Partial<{[key in `negate_${keyof TProps & string}_to_${keyof TProps & string}`]: number}>
|
|
45
|
+
export type Compacts<TProps = any, TActions = TProps, TEvents extends string = string> =
|
|
46
|
+
Partial<{[key in `negate_${keyof TProps & string}_to_${keyof TProps & string}`]: number}>
|
|
48
47
|
| Partial<{[key in `pass_length_of_${keyof TProps & string}_to_${keyof TProps & string}`]: number}>
|
|
49
48
|
| Partial<{[key in `echo_${keyof TProps & string}_to_${keyof TProps & string}`]: number}>
|
|
50
49
|
| Partial<{[key in `echo_${keyof TProps & string}_to_${keyof TProps & string}_after`]: keyof TProps}>
|
|
51
50
|
| Partial<{[key in `when_${keyof TProps & string}_changes_call_${keyof TActions & string}`]: number}>
|
|
52
51
|
| Partial<{[key in `when_${keyof TProps & string}_changes_toggle_${keyof TProps & string}`]: number}>
|
|
53
52
|
| Partial<{[key in `when_${keyof TProps & string}_changes_inc_${keyof TProps & string}_by`]: number}>
|
|
54
|
-
| Partial<{[key in `when_${keyof TProps & string}_changes_dispatch`]: string}>
|
|
55
|
-
| Partial<{[key in `on_${
|
|
56
|
-
| Partial<{[key in `on_${
|
|
53
|
+
| Partial<{[key in `when_${keyof TProps & string}_changes_dispatch`]: string}>
|
|
54
|
+
| Partial<{[key in `on_${TEvents}_of_${keyof TProps & string}_inc_${keyof TProps & string}_by`]: number}>
|
|
55
|
+
| Partial<{[key in `on_${TEvents}_of_${keyof TProps & string}_set_${keyof TProps & string}_to`]: any}>
|
|
57
56
|
;
|
|
58
57
|
|
|
59
58
|
export type Hitches<TProps = any, TActions = TProps> =
|
|
@@ -95,14 +94,48 @@ export interface Merge<TProps = any> extends LogicOp<TProps> {
|
|
|
95
94
|
|
|
96
95
|
export type Merges<TProps = any> = Array<Merge<TProps>>;
|
|
97
96
|
|
|
98
|
-
|
|
97
|
+
/**
|
|
98
|
+
* A yield derives a value from a collection using an index or key.
|
|
99
|
+
* Scenario I: Single selection by index — when the source array or index changes,
|
|
100
|
+
* the target property is set to source[index].
|
|
101
|
+
*/
|
|
102
|
+
export interface YieldConfig<TProps = any> {
|
|
103
|
+
/** The source array/collection property name */
|
|
104
|
+
from: keyof TProps & string;
|
|
105
|
+
/** The index property name (for array index lookup) */
|
|
106
|
+
atIndex?: keyof TProps & string;
|
|
107
|
+
/**
|
|
108
|
+
* Behavior when the index is out of bounds.
|
|
109
|
+
* - 'undefined' (default): set target to undefined
|
|
110
|
+
* - 'clamp': reset the index to 0 (selects first item)
|
|
111
|
+
*/
|
|
112
|
+
outOfBounds?: 'undefined' | 'clamp';
|
|
113
|
+
// Future: atKey, atIndices, keyProp, etc.
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export type Yields<TProps = any> = {
|
|
117
|
+
[K in keyof TProps & string]?: YieldConfig<TProps>;
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
export interface RAConfig<
|
|
121
|
+
TProps = unknown, TActions = TProps, ETProps = TProps,
|
|
122
|
+
TCustomData = unknown, TEvents extends string = string > {
|
|
99
123
|
actions?: Actions<TProps,TActions>,
|
|
100
|
-
compacts?: Compacts<TProps, TActions>,
|
|
124
|
+
compacts?: Compacts<TProps, TActions, TEvents>,
|
|
101
125
|
//onsets?: Onsets<TProps, TActions>,
|
|
102
126
|
handlers?: Handlers<ETProps, TActions>,
|
|
103
127
|
hitches?: Hitches<TProps, TActions>,
|
|
104
128
|
positractions?: Positractions<TProps>,
|
|
105
129
|
merges?: Merges<TProps>,
|
|
130
|
+
yields?: Yields<TProps>,
|
|
131
|
+
/**
|
|
132
|
+
* Properties to explicitly monitor and propagate changes for.
|
|
133
|
+
* Use this to ensure getter/setters are installed for properties
|
|
134
|
+
* that aren't referenced by actions, compacts, merges, etc.
|
|
135
|
+
* but still need to fire propagator events (e.g., attribute-parsed
|
|
136
|
+
* properties that other features subscribe to).
|
|
137
|
+
*/
|
|
138
|
+
propagate?: keyof TProps & string | Array<keyof TProps & string>,
|
|
106
139
|
/**
|
|
107
140
|
* Configure automatic WeakRef wrapping for properties
|
|
108
141
|
*
|
|
@@ -130,7 +163,6 @@ export interface RoundaboutOptions<TProps = unknown, TActions = TProps, ETProps
|
|
|
130
163
|
vm?: TProps & TActions & RoundaboutReady,
|
|
131
164
|
//for enhanced elements, pass in the container, referenced via $0.
|
|
132
165
|
container?: EventTarget,
|
|
133
|
-
propagate?: keyof TProps & string | Array<keyof TProps & string>,
|
|
134
166
|
|
|
135
167
|
//mountObservers?: Set<IMountObserver>
|
|
136
168
|
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { SpawnContext } from "../assign-gingerly/types";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Context passed to the TemplateMaker feature constructor
|
|
5
|
+
*/
|
|
6
|
+
export interface FeatureSpawnContext extends SpawnContext {
|
|
7
|
+
key: string;
|
|
8
|
+
optIn: any;
|
|
9
|
+
injection: any;
|
|
10
|
+
featuresRegistry: any;
|
|
11
|
+
shared?: any;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Tracks whether the seed DOM fragment came from a shadow root or light DOM children.
|
|
16
|
+
*/
|
|
17
|
+
export type TemplateSource = 'shadow' | 'light';
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Properties that the TemplateMaker feature exposes.
|
|
21
|
+
*/
|
|
22
|
+
export interface TemplateMakerProps {
|
|
23
|
+
/**
|
|
24
|
+
* The cloned DocumentFragment from the stored template.
|
|
25
|
+
*/
|
|
26
|
+
clone: DocumentFragment | null;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Internal state
|
|
31
|
+
*/
|
|
32
|
+
export interface AllProps extends TemplateMakerProps {
|
|
33
|
+
/**
|
|
34
|
+
* WeakRef to the host custom element
|
|
35
|
+
*/
|
|
36
|
+
hostRef: WeakRef<Element> | null;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Whether the template source was shadow DOM or light DOM.
|
|
40
|
+
*/
|
|
41
|
+
templateSource: TemplateSource | null;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export type AP = AllProps;
|
|
45
|
+
export type PAP = Partial<AP>;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { SpawnContext } from "../assign-gingerly/types";
|
|
2
|
+
import {FaceUpProps} from "../face-up/types";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Configuration/properties that the TimeTicker feature exposes
|
|
6
|
+
*/
|
|
7
|
+
export interface FeatureProps {
|
|
8
|
+
/**
|
|
9
|
+
* Duration in milliseconds between ticks
|
|
10
|
+
*/
|
|
11
|
+
duration: number;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Whether the ticker is disabled (stops ticking when true)
|
|
15
|
+
*/
|
|
16
|
+
disabled: boolean;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Internal state (not exposed to consumers)
|
|
21
|
+
*/
|
|
22
|
+
export interface AllFeatureProps extends FeatureProps {
|
|
23
|
+
host: WeakRef<Element>;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export type AFP = AllFeatureProps;
|
|
27
|
+
export type PAFP = Partial<AFP>;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Context passed to the feature constructor
|
|
31
|
+
*/
|
|
32
|
+
export interface FeatureSpawnContext extends SpawnContext {
|
|
33
|
+
key: string;
|
|
34
|
+
optIn: any;
|
|
35
|
+
injection: any;
|
|
36
|
+
featuresRegistry: any;
|
|
37
|
+
shared?: any;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface TimeTickerElementEndUserProps<T = any> extends FaceUpProps {
|
|
41
|
+
/**
|
|
42
|
+
* Duration in milliseconds between ticks
|
|
43
|
+
*/
|
|
44
|
+
duration: number;
|
|
45
|
+
|
|
46
|
+
items: T[];
|
|
47
|
+
|
|
48
|
+
name: string;
|
|
49
|
+
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export interface TimeTickerElementAllProps<T = any> extends TimeTickerElementEndUserProps{
|
|
53
|
+
item: T;
|
|
54
|
+
|
|
55
|
+
idx: number;
|
|
56
|
+
|
|
57
|
+
timeTicker: EventTarget;
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export type T = TimeTickerElementAllProps;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { SpawnContext } from "../assign-gingerly/types";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Context passed to the TruthSourcer feature constructor
|
|
5
|
+
*/
|
|
6
|
+
export interface FeatureSpawnContext extends SpawnContext {
|
|
7
|
+
key: string;
|
|
8
|
+
optIn: any;
|
|
9
|
+
injection: any;
|
|
10
|
+
featuresRegistry: any;
|
|
11
|
+
shared?: any;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Properties that the TruthSourcer feature manages
|
|
16
|
+
*/
|
|
17
|
+
export interface TruthSourcerProps {
|
|
18
|
+
/**
|
|
19
|
+
* The EventTarget that the host element uses to propagate property change events.
|
|
20
|
+
* TruthSourcer listens for events matching attribute names to sync property -> attribute.
|
|
21
|
+
*/
|
|
22
|
+
hostPropagator: EventTarget | null;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Internal state
|
|
27
|
+
*/
|
|
28
|
+
export interface AllProps extends TruthSourcerProps {
|
|
29
|
+
/**
|
|
30
|
+
* WeakRef to the host custom element
|
|
31
|
+
*/
|
|
32
|
+
hostRef: WeakRef<HTMLElement> | null;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* The list of observed attribute names (from static observedAttributes)
|
|
36
|
+
*/
|
|
37
|
+
observedAttributes: string[];
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* AbortController for cleaning up event listeners
|
|
41
|
+
*/
|
|
42
|
+
abortController: AbortController | null;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export type AP = AllProps;
|
|
46
|
+
export type PAP = Partial<AP>;
|