mount-observer 0.0.112 → 0.1.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/Events.js +28 -26
- package/Events.ts +34 -30
- package/MountObserver.js +235 -520
- package/MountObserver.ts +281 -542
- package/README.md +149 -56
- package/attrCoordinates.js +93 -0
- package/attrCoordinates.ts +122 -0
- package/constants.js +6 -0
- package/constants.ts +7 -0
- package/index.js +3 -0
- package/index.ts +19 -0
- package/loadImports.js +47 -0
- package/loadImports.ts +56 -0
- package/package.json +8 -119
- package/playwright.config.ts +0 -1
- package/types.d.ts +86 -0
- package/whereAttr.js +174 -0
- package/whereAttr.ts +221 -0
- package/LICENSE +0 -21
- package/Newish.js +0 -145
- package/Newish.ts +0 -169
- package/ObsAttr.js +0 -18
- package/ObsAttr.ts +0 -18
- package/RootMutObs.js +0 -49
- package/RootMutObs.ts +0 -58
- package/Synthesizer.js +0 -125
- package/Synthesizer.ts +0 -130
- package/bindish.js +0 -15
- package/bindish.ts +0 -22
- package/compose.js +0 -148
- package/compose.ts +0 -164
- package/doCleanup.js +0 -31
- package/doCleanup.ts +0 -34
- package/getWhereAttrSelector.js +0 -83
- package/getWhereAttrSelector.ts +0 -92
- package/preloadContent.js +0 -44
- package/preloadContent.ts +0 -47
- package/readAttrs.ts +0 -60
- package/refid/README.md +0 -259
- package/refid/arr.js +0 -4
- package/refid/arr.ts +0 -4
- package/refid/camelToKebab.js +0 -4
- package/refid/camelToKebab.ts +0 -4
- package/refid/genIds.js +0 -190
- package/refid/genIds.ts +0 -177
- package/refid/getAdjRefs.js +0 -38
- package/refid/getAdjRefs.ts +0 -38
- package/refid/getContext.js +0 -13
- package/refid/getContext.ts +0 -14
- package/refid/getCount.js +0 -8
- package/refid/getCount.ts +0 -8
- package/refid/getIsh.js +0 -35
- package/refid/getIsh.ts +0 -37
- package/refid/hostish.js +0 -18
- package/refid/hostish.ts +0 -20
- package/refid/ism.js +0 -78
- package/refid/ism.ts +0 -81
- package/refid/itemprops.js +0 -60
- package/refid/itemprops.ts +0 -67
- package/refid/joinMatching.js +0 -56
- package/refid/joinMatching.ts +0 -54
- package/refid/nudge.js +0 -23
- package/refid/nudge.ts +0 -23
- package/refid/regIsh.js +0 -27
- package/refid/regIsh.ts +0 -31
- package/refid/secretKeys.js +0 -5
- package/refid/secretKeys.ts +0 -5
- package/refid/splitRefs.js +0 -6
- package/refid/splitRefs.ts +0 -6
- package/refid/stdVal.js +0 -15
- package/refid/stdVal.ts +0 -15
- package/refid/via.js +0 -114
- package/refid/via.ts +0 -113
- package/slotkin/affine.js +0 -39
- package/slotkin/affine.ts +0 -46
- package/slotkin/beKindred.js +0 -45
- package/slotkin/beKindred.ts +0 -55
- package/slotkin/getBreadth.js +0 -19
- package/slotkin/getBreadth.ts +0 -21
- package/slotkin/getFrag.js +0 -22
- package/slotkin/getFrag.ts +0 -21
- package/slotkin/toQuery.js +0 -12
- package/slotkin/toQuery.ts +0 -13
- package/slotkin/wrap.js +0 -13
- package/slotkin/wrap.ts +0 -18
- package/ts-refs/LICENSE +0 -21
- package/ts-refs/README.md +0 -18
- package/ts-refs/be-a-beacon/types.d.ts +0 -22
- package/ts-refs/be-alit/types.d.ts +0 -1
- package/ts-refs/be-based/types.d.ts +0 -32
- package/ts-refs/be-bound/types.d.ts +0 -65
- package/ts-refs/be-buttoned-up/types.d.ts +0 -21
- package/ts-refs/be-calculating/types.d.ts +0 -57
- package/ts-refs/be-clonable/types.d.ts +0 -28
- package/ts-refs/be-committed/types.d.ts +0 -26
- package/ts-refs/be-consoling/types.d.ts +0 -25
- package/ts-refs/be-counted/types.d.ts +0 -88
- package/ts-refs/be-delible/types.d.ts +0 -26
- package/ts-refs/be-directive/types.d.ts +0 -43
- package/ts-refs/be-dispatching/types.d.ts +0 -41
- package/ts-refs/be-elevating/types.d.ts +0 -55
- package/ts-refs/be-enhanced/types.d.ts +0 -32
- package/ts-refs/be-enhancing/types.d.ts +0 -31
- package/ts-refs/be-evanescent/types.d.ts +0 -20
- package/ts-refs/be-eventing/types.d.ts +0 -27
- package/ts-refs/be-exportable/types.d.ts +0 -26
- package/ts-refs/be-fetching/types.d.ts +0 -73
- package/ts-refs/be-flashy/types.d.ts +0 -27
- package/ts-refs/be-formalizing/types.d.ts +0 -29
- package/ts-refs/be-formidable/types.d.ts +0 -64
- package/ts-refs/be-giddy/types.d.ts +0 -26
- package/ts-refs/be-gingerly/types.d.ts +0 -19
- package/ts-refs/be-gone/types.d.ts +0 -24
- package/ts-refs/be-hashing-out/types.d.ts +0 -22
- package/ts-refs/be-hive/types.d.ts +0 -18
- package/ts-refs/be-imbued/types.d.ts +0 -30
- package/ts-refs/be-included/types.d.ts +0 -20
- package/ts-refs/be-inclusive/types.d.ts +0 -30
- package/ts-refs/be-intersectional/types.d.ts +0 -37
- package/ts-refs/be-intl/types.d.ts +0 -28
- package/ts-refs/be-invoking/types.d.ts +0 -28
- package/ts-refs/be-joining/types.d.ts +0 -26
- package/ts-refs/be-kvetching/types.d.ts +0 -24
- package/ts-refs/be-lazy/types.d.ts +0 -29
- package/ts-refs/be-literate/types.d.ts +0 -29
- package/ts-refs/be-mediating/types.d.ts +0 -34
- package/ts-refs/be-methodical/types.d.ts +0 -20
- package/ts-refs/be-modding/types.d.ts +0 -18
- package/ts-refs/be-observant/types.d.ts +0 -27
- package/ts-refs/be-observing/types.d.ts +0 -84
- package/ts-refs/be-parsed/types.d.ts +0 -19
- package/ts-refs/be-parsing/types.d.ts +0 -37
- package/ts-refs/be-persistent/types.d.ts +0 -66
- package/ts-refs/be-propagating/types.d.ts +0 -26
- package/ts-refs/be-reformable/types.d.ts +0 -48
- package/ts-refs/be-render-neutral/types.d.ts +0 -31
- package/ts-refs/be-scoped/types.d.ts +0 -24
- package/ts-refs/be-sharing/types.d.ts +0 -17
- package/ts-refs/be-switched/types.d.ts +0 -155
- package/ts-refs/be-typed/types.d.ts +0 -36
- package/ts-refs/be-value-added/types.d.ts +0 -34
- package/ts-refs/be-valued/types.d.ts +0 -22
- package/ts-refs/be-written/types.d.ts +0 -59
- package/ts-refs/css-charts/types.d.ts +0 -38
- package/ts-refs/css-echarts/types.d.ts +0 -13
- package/ts-refs/data-props/types.d.ts +0 -27
- package/ts-refs/do-inc/types.d.ts +0 -28
- package/ts-refs/do-invoke/types.d.ts +0 -28
- package/ts-refs/do-toggle/types.d.ts +0 -27
- package/ts-refs/em-bower/types.d.ts +0 -24
- package/ts-refs/fetch-for/types.d.ts +0 -37
- package/ts-refs/folder-picker/types.d.ts +0 -43
- package/ts-refs/for-fetch/doc.d.ts +0 -98
- package/ts-refs/for-fetch/types.d.ts +0 -83
- package/ts-refs/mount-observer/types.d.ts +0 -248
- package/ts-refs/mt-si/types.d.ts +0 -21
- package/ts-refs/per-each/types.d.ts +0 -51
- package/ts-refs/soak-up/types.d.ts +0 -36
- package/ts-refs/trans-render/XV/types.d.ts +0 -69
- package/ts-refs/trans-render/asmr/types.d.ts +0 -138
- package/ts-refs/trans-render/be/types.d.ts +0 -198
- package/ts-refs/trans-render/dss/types.d.ts +0 -57
- package/ts-refs/trans-render/froop/types.d.ts +0 -416
- package/ts-refs/trans-render/funions/types.d.ts +0 -12
- package/ts-refs/trans-render/lib/mixins/types.d.ts +0 -42
- package/ts-refs/trans-render/lib/prs/types.d.ts +0 -40
- package/ts-refs/trans-render/lib/types.d.ts +0 -489
- package/ts-refs/trans-render/types.d.ts +0 -583
- package/ts-refs/wc-info/SimpleWCInfo.d.ts +0 -15
- package/ts-refs/when-resolved/types.d.ts +0 -30
- package/ts-refs/xp-as/types.d.ts +0 -20
- package/ts-refs/xtal-element/types.d.ts +0 -43
- package/ts-refs/xtal-frappe-chart/types.d.ts +0 -193
- package/upShadowSearch.js +0 -25
- package/upShadowSearch.ts +0 -23
- package/waitForEvent.js +0 -12
- package/waitForEvent.ts +0 -13
- package/waitForIsh.js +0 -21
- package/waitForIsh.ts +0 -20
|
@@ -1,489 +0,0 @@
|
|
|
1
|
-
import {RHS, ToTransformer} from '../types';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export type matchTypes = 'parts'| 'part' | 'id' | 'classes' | 'class' | 'attribs' | 'attrib' | 'elements' | 'element' | 'names' | 'name' | 'props' | 'placeholders';
|
|
5
|
-
|
|
6
|
-
export interface QueryInfo{
|
|
7
|
-
query: string;
|
|
8
|
-
match: string;
|
|
9
|
-
attrib?: string;
|
|
10
|
-
lhsProp?: string;
|
|
11
|
-
first?: boolean;
|
|
12
|
-
verb?: string;
|
|
13
|
-
havingAlso?: QueryInfo[];
|
|
14
|
-
havingInner?: QueryInfo;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
export type PropSettings<T extends Partial<HTMLElement> = HTMLElement, HostProps = any> = {
|
|
19
|
-
[P in keyof T]?: keyof HostProps;
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export type EventSettings = {[key: string] : ((e: Event) => void) | string | INotify};
|
|
23
|
-
|
|
24
|
-
export interface IMinimalNotify{
|
|
25
|
-
|
|
26
|
-
nudge?: boolean;
|
|
27
|
-
|
|
28
|
-
debug?: boolean;
|
|
29
|
-
|
|
30
|
-
eventListenerOptions?: boolean | AddEventListenerOptions | undefined;
|
|
31
|
-
|
|
32
|
-
doInit?: boolean;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export interface IDIYNotify extends IMinimalNotify{
|
|
36
|
-
doOnly?: (target: Element, key: string, mn: IMinimalNotify, e?: Event) => void;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export interface IValFromEventInstructions<TSelf = any, TProps = any, TActions = TProps> {
|
|
40
|
-
/**
|
|
41
|
-
* Hardcoded value to set on recipient element.
|
|
42
|
-
*/
|
|
43
|
-
val?: any
|
|
44
|
-
/**
|
|
45
|
-
* path to get value from target
|
|
46
|
-
*/
|
|
47
|
-
valFromTarget?: keyof TSelf;
|
|
48
|
-
/**
|
|
49
|
-
* path to get value from target
|
|
50
|
-
*/
|
|
51
|
-
vft?: keyof TSelf | `${keyof TSelf & string}.${string}`;
|
|
52
|
-
/**
|
|
53
|
-
* path to get value from event
|
|
54
|
-
*/
|
|
55
|
-
valFromEvent?: string;
|
|
56
|
-
/**
|
|
57
|
-
* path to get value from event
|
|
58
|
-
*/
|
|
59
|
-
vfe?: string;
|
|
60
|
-
|
|
61
|
-
propName?: string;
|
|
62
|
-
|
|
63
|
-
clone?: boolean;
|
|
64
|
-
|
|
65
|
-
parseValAs?: 'int' | 'float' | 'bool' | 'date' | 'truthy' | 'falsy' | undefined | 'string' | 'object';
|
|
66
|
-
|
|
67
|
-
trueVal?: any;
|
|
68
|
-
|
|
69
|
-
falseVal?: any;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
export interface INotify<TSelf = any, TProps = any, TActions = TProps> extends IMinimalNotify, IValFromEventInstructions<TSelf, TProps, TActions>{
|
|
74
|
-
|
|
75
|
-
navTo?: string;
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
* Pass property or invoke fn onto custom or built-in element hosting the contents of p-u element.
|
|
79
|
-
*/
|
|
80
|
-
//toHost: boolean;
|
|
81
|
-
/**
|
|
82
|
-
* Id of Dom Element. Uses import-like syntax:
|
|
83
|
-
* ./my-id searches for #my-id within ShadowDOM realm of instance.
|
|
84
|
-
* ../my-id searches for #my-id one ShadowDOM level up.
|
|
85
|
-
* /my-id searches from outside any ShadowDOM.
|
|
86
|
-
* @attr
|
|
87
|
-
*/
|
|
88
|
-
toUpShadow?: string;
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
* abbrev of toUpShadow
|
|
92
|
-
*/
|
|
93
|
-
to?: string
|
|
94
|
-
|
|
95
|
-
/**
|
|
96
|
-
* Pass property or invoke fn onto itself
|
|
97
|
-
*/
|
|
98
|
-
toSelf?: boolean;
|
|
99
|
-
|
|
100
|
-
/**
|
|
101
|
-
* Pass property to the nearest previous sibling / ancestor element matching this css pattern, using .previousElement(s)/.parentElement.matches method.
|
|
102
|
-
* Does not pass outside ShadowDOM realm.
|
|
103
|
-
*/
|
|
104
|
-
toNearestUpMatch?: string;
|
|
105
|
-
|
|
106
|
-
toClosest?: string;
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* to closest or host ("itemscope" attribute or shadow DOM boundary)
|
|
110
|
-
*/
|
|
111
|
-
tocoho?: boolean | string; //to closest or host
|
|
112
|
-
|
|
113
|
-
/**
|
|
114
|
-
* Name of property to set on matching (upstream) element.
|
|
115
|
-
* @attr
|
|
116
|
-
*/
|
|
117
|
-
prop?: keyof TProps & string;
|
|
118
|
-
|
|
119
|
-
/**
|
|
120
|
-
* Name of method or property arrow function to invoke on matching (upstream) element.
|
|
121
|
-
*/
|
|
122
|
-
fn?: keyof TActions & string;
|
|
123
|
-
|
|
124
|
-
dispatch?: string;
|
|
125
|
-
|
|
126
|
-
withArgs?: ('self' | 'val' | 'event')[];
|
|
127
|
-
|
|
128
|
-
plusEq?: boolean | string | number;
|
|
129
|
-
|
|
130
|
-
eqConst?: any;
|
|
131
|
-
|
|
132
|
-
toggleProp?: boolean;
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
as?: 'str-attr' | 'bool-attr' | 'obj-attr',
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
thenDo?: (target: Element, key: string, n: INotify, e?: Event) => void;
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
export interface INotifyHookupInfo{
|
|
148
|
-
controller: AbortController;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
export interface IConditional<MCProps extends Partial<HTMLElement> = HTMLElement>{
|
|
152
|
-
/**
|
|
153
|
-
* Name of property to check if truthy
|
|
154
|
-
*/
|
|
155
|
-
if?: keyof MCProps;
|
|
156
|
-
/**
|
|
157
|
-
* If condition value
|
|
158
|
-
*/
|
|
159
|
-
ifVal?: boolean;
|
|
160
|
-
lhs?: string;
|
|
161
|
-
lhsVal?: any;
|
|
162
|
-
rhs?: string;
|
|
163
|
-
rhsVal?: any;
|
|
164
|
-
op?: '==' | '!=' | '>' | '<' | '>=' | '<=' | '===' | '!==' | undefined;
|
|
165
|
-
}
|
|
166
|
-
export type AttribsSettings = { [key: string]: string | boolean | number | undefined | null | string[]};
|
|
167
|
-
export type PSettings<T extends Partial<HTMLElement> = HTMLElement, HostProps = any> = [PropSettings<T, HostProps> | undefined];
|
|
168
|
-
export type PESettings<T extends Partial<HTMLElement> = HTMLElement> = [props: PropSettings<T> | undefined, on: EventSettings | undefined];
|
|
169
|
-
export type PEUnionSettings<T extends Partial<HTMLElement> = HTMLElement> = PSettings<T> | PESettings<T>;
|
|
170
|
-
export type PEASettings<T extends Partial<HTMLElement> = HTMLElement> =
|
|
171
|
-
[props: PropSettings<T> | undefined, events: EventSettings | undefined, attribs: AttribsSettings | undefined];
|
|
172
|
-
export type PEAUnionSettings<T extends Partial<HTMLElement> = HTMLElement> = PEUnionSettings<T> | PEASettings<T>;
|
|
173
|
-
|
|
174
|
-
export type ConditionalSettings<T extends Partial<HTMLElement> = HTMLElement> =
|
|
175
|
-
[boolean, IConditional<T>, ...any]
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
export interface TRElementProps {
|
|
179
|
-
propChangeQueue?: Set<string>;
|
|
180
|
-
inReflectMode?: boolean;
|
|
181
|
-
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
export interface TRElementActions{
|
|
185
|
-
attachQR(): void;
|
|
186
|
-
detachQR(): void;
|
|
187
|
-
attributeChangedCallback?(n: string, ov: string, nv: string): void;
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
// export interface Transform<TMixinComposite = any> extends LogicOp<TMixinComposite>{
|
|
198
|
-
// match: {[key: string]: MatchRHS<TMixinComposite>}
|
|
199
|
-
// }
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
export type MatchRHS<TMixinComposite = any> = string;
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
export interface HasPropChangeQueue{
|
|
209
|
-
propChangeQueue: Set<string> | undefined;
|
|
210
|
-
QR: undefined | ((name: string, self: HasPropChangeQueue) => void);
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
export interface ProxyPropChangeInfo{
|
|
216
|
-
oldVal: any,
|
|
217
|
-
newVal: any,
|
|
218
|
-
prop: string
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
export interface ITSChecker{
|
|
225
|
-
notChanged(host: Element, fragment: Element | DocumentFragment): boolean;
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
export type TargetTuple =
|
|
231
|
-
/**
|
|
232
|
-
* Use the native .closest() function to get the target
|
|
233
|
-
*/
|
|
234
|
-
| ['closest', string]
|
|
235
|
-
/**
|
|
236
|
-
* abbrev for closet
|
|
237
|
-
*/
|
|
238
|
-
| ['c', string]
|
|
239
|
-
/**
|
|
240
|
-
* Find nearest previous sibling, parent, previous sibling of parent, etc that matches this string.
|
|
241
|
-
*/
|
|
242
|
-
| ['upSearch', string]
|
|
243
|
-
/**
|
|
244
|
-
* abbrev for upSearch
|
|
245
|
-
*/
|
|
246
|
-
| ['us', string]
|
|
247
|
-
/**
|
|
248
|
-
* Tries .closest([string value]).
|
|
249
|
-
* If that comes out to null, do .getRootNode().host
|
|
250
|
-
*/
|
|
251
|
-
| ['closestOrHost', string]
|
|
252
|
-
/**
|
|
253
|
-
* abbrev for closestOrHost
|
|
254
|
-
*/
|
|
255
|
-
| ['coh', string]
|
|
256
|
-
/**
|
|
257
|
-
* Find nearest previous element sibling that matches this string
|
|
258
|
-
*/
|
|
259
|
-
| ['previous', string]
|
|
260
|
-
/**
|
|
261
|
-
* Find first element matching string within root node.
|
|
262
|
-
*/
|
|
263
|
-
| ['withinRootNode', string]
|
|
264
|
-
/**
|
|
265
|
-
* abbrev for withinRootNode
|
|
266
|
-
*/
|
|
267
|
-
| ['wrn', string]
|
|
268
|
-
/**
|
|
269
|
-
* hostish
|
|
270
|
-
*/
|
|
271
|
-
| ['h', (boolean | string)?, boolean?]
|
|
272
|
-
| ['hostish', (boolean | string)?, boolean?]
|
|
273
|
-
/**
|
|
274
|
-
* Find first element matching string within itemscope.
|
|
275
|
-
*/
|
|
276
|
-
| ['withinItemScope', string, boolean?]
|
|
277
|
-
/**
|
|
278
|
-
* abbrev for within item scope
|
|
279
|
-
*/
|
|
280
|
-
| ['wis', string, boolean?]
|
|
281
|
-
| ['within', string, string]
|
|
282
|
-
| ['wi', string, string]
|
|
283
|
-
/**
|
|
284
|
-
* First first element matching string within form.
|
|
285
|
-
*/
|
|
286
|
-
| ['withinForm', string]
|
|
287
|
-
/**
|
|
288
|
-
* abbrev for within form
|
|
289
|
-
*/
|
|
290
|
-
| ['wf', string]
|
|
291
|
-
|
|
292
|
-
;
|
|
293
|
-
/**
|
|
294
|
-
* Target selector in upward direction.
|
|
295
|
-
*/
|
|
296
|
-
export type Target =
|
|
297
|
-
| TargetTuple
|
|
298
|
-
/**
|
|
299
|
-
* Use the parent element as the target
|
|
300
|
-
*/
|
|
301
|
-
| 'parent'
|
|
302
|
-
/**
|
|
303
|
-
* abbrev for parent
|
|
304
|
-
*/
|
|
305
|
-
| 'p'
|
|
306
|
-
/**
|
|
307
|
-
* Use the previous element sibling as the target.
|
|
308
|
-
*/
|
|
309
|
-
| 'previousElementSibling'
|
|
310
|
-
/**
|
|
311
|
-
* abbrev for previous element sibling.
|
|
312
|
-
*/
|
|
313
|
-
| 'pes'
|
|
314
|
-
/**
|
|
315
|
-
* Search previous element siblings for target that matches the query.
|
|
316
|
-
*/
|
|
317
|
-
| `previous${camelQry}` |
|
|
318
|
-
|
|
319
|
-
/**
|
|
320
|
-
* Use the parent as the target. If no parent, use root node.
|
|
321
|
-
*/
|
|
322
|
-
'parentOrRootNode' |
|
|
323
|
-
/**
|
|
324
|
-
* abbrev for parent or root node
|
|
325
|
-
*/
|
|
326
|
-
'porn' |
|
|
327
|
-
/**
|
|
328
|
-
* Do "closest" for element with "-"" in the name. If non found, get host of getRootNode()
|
|
329
|
-
*/
|
|
330
|
-
'hostish' |
|
|
331
|
-
/**
|
|
332
|
-
* Use the element itself as the target
|
|
333
|
-
*/
|
|
334
|
-
'self' |
|
|
335
|
-
/**
|
|
336
|
-
* abbrev for self
|
|
337
|
-
*/
|
|
338
|
-
's' |
|
|
339
|
-
`closest${camelQry}` |
|
|
340
|
-
|
|
341
|
-
/**
|
|
342
|
-
* [TODO]
|
|
343
|
-
* do upsearch for matching itemref
|
|
344
|
-
*/
|
|
345
|
-
'nearestScope' |
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
/**
|
|
349
|
-
* Find nearest previous sibling, parent, previous sibling of parent, etc that matches this string.
|
|
350
|
-
*/
|
|
351
|
-
`upSearchFor${camelQry}` |
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
/**
|
|
356
|
-
* Tries .closest matching string. If that's null, does .getRootNode().host
|
|
357
|
-
*/
|
|
358
|
-
`closest${camelQry}OrHost` |
|
|
359
|
-
|
|
360
|
-
/**
|
|
361
|
-
* Searches for first element within the rootNode that matches the camelQry.
|
|
362
|
-
*/
|
|
363
|
-
`${camelQry}WithinRootNode` |
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
/**
|
|
367
|
-
* get host
|
|
368
|
-
*/
|
|
369
|
-
'host' |
|
|
370
|
-
/**
|
|
371
|
-
* abbrev for host
|
|
372
|
-
*/
|
|
373
|
-
'h'
|
|
374
|
-
;
|
|
375
|
-
|
|
376
|
-
export type ScopeTuple = TargetTuple
|
|
377
|
-
/**
|
|
378
|
-
* Similar to closestOrHost, but just get the root fragment via getRootNode()
|
|
379
|
-
*/
|
|
380
|
-
| ['closestOrRootNode', string]
|
|
381
|
-
/**
|
|
382
|
-
* abbrev for closestOrRootNode
|
|
383
|
-
*/
|
|
384
|
-
| ['corn', string]
|
|
385
|
-
;
|
|
386
|
-
/**
|
|
387
|
-
* Outer boundary for transformation
|
|
388
|
-
*/
|
|
389
|
-
export type Scope = Target | ScopeTuple |
|
|
390
|
-
/**
|
|
391
|
-
* use native function getRootNode() to set the target
|
|
392
|
-
*
|
|
393
|
-
*/
|
|
394
|
-
'rootNode' |
|
|
395
|
-
/**
|
|
396
|
-
* abbrev for rootNode
|
|
397
|
-
*/
|
|
398
|
-
'rn' |
|
|
399
|
-
`closest${camelQry}OrRootNode` |
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
'shadowDOM' |
|
|
403
|
-
/**
|
|
404
|
-
* abbrev for shadow DOM
|
|
405
|
-
*/
|
|
406
|
-
'sd'
|
|
407
|
-
|
|
408
|
-
;
|
|
409
|
-
|
|
410
|
-
//https://stackoverflow.com/questions/38123222/proper-way-to-declare-json-object-in-typescript
|
|
411
|
-
type JSONValue =
|
|
412
|
-
| string
|
|
413
|
-
| number
|
|
414
|
-
| boolean
|
|
415
|
-
| null
|
|
416
|
-
| JSONValue[]
|
|
417
|
-
| {[key: string]: JSONValue}
|
|
418
|
-
|
|
419
|
-
interface JSONObject {
|
|
420
|
-
[k: string]: JSONValue
|
|
421
|
-
}
|
|
422
|
-
interface JSONArray extends Array<JSONValue> {}
|
|
423
|
-
|
|
424
|
-
export interface getValArg {
|
|
425
|
-
host?: any;
|
|
426
|
-
}
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
export type keyOfCtxNavElement = keyof ICTXNavElement & string;
|
|
431
|
-
|
|
432
|
-
export type keyofICTXCamelQryPrompt = `${keyof ICTXCamelQryPrompt & string}.${camelQry}`;
|
|
433
|
-
|
|
434
|
-
export type keyofCTXNavRecursive = (keyof ICTXNavRecursive & string) | keyofICTXCamelQryPrompt;
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
export type AffectOptions =
|
|
439
|
-
`${keyOfCtxNavElement}`
|
|
440
|
-
| `${keyofCTXNavRecursive}`
|
|
441
|
-
| `${keyofCTXNavRecursive}.${keyofCTXNavRecursive}`
|
|
442
|
-
//| `${keyofCTXNavRecursive}.${keyofCTXNavRecursive}.${keyofCTXNavRecursive}`
|
|
443
|
-
// | `${keyofCTXNavRecursive}.${keyofCTXNavRecursive}.${keyofCTXNavRecursive}.${keyofCTXNavRecursive}`
|
|
444
|
-
|
|
445
|
-
;
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
export interface ICTXNavRecursive<T = any>{
|
|
450
|
-
$?: T;
|
|
451
|
-
hostCtx?: T;
|
|
452
|
-
}
|
|
453
|
-
|
|
454
|
-
/**
|
|
455
|
-
* E = element
|
|
456
|
-
* P = part
|
|
457
|
-
* C = class
|
|
458
|
-
* I = itemscope
|
|
459
|
-
* A = attribute
|
|
460
|
-
* N = name
|
|
461
|
-
*/
|
|
462
|
-
export type camelQry = `${string}E` | `${string}P` | `${string}C` | `${string}Id` | `${string}I` | `${string}A` | `${string}N` | `${string}M`;
|
|
463
|
-
|
|
464
|
-
export interface ExpectedCamelQry<T = any>{
|
|
465
|
-
[key: camelQry] : ICtxNav<T>
|
|
466
|
-
}
|
|
467
|
-
|
|
468
|
-
export interface ICTXNavElement{
|
|
469
|
-
self?: Element;
|
|
470
|
-
host?: Element;
|
|
471
|
-
}
|
|
472
|
-
|
|
473
|
-
export interface ICTXCamelQryPrompt<T = any>{
|
|
474
|
-
ancestor?: ExpectedCamelQry<T>;
|
|
475
|
-
elder?: ExpectedCamelQry<T>;
|
|
476
|
-
}
|
|
477
|
-
|
|
478
|
-
export interface ICtxNav<T = any> extends ICTXNavRecursive<T>, ICTXNavElement, ICTXCamelQryPrompt<T> {
|
|
479
|
-
beScoped?: EventTarget;
|
|
480
|
-
|
|
481
|
-
xtalState(): Promise<EventTarget | undefined>;
|
|
482
|
-
}
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
export type ConvertOptions = 'bool' | 'int' | 'float' | 'date' | 'truthy' | 'falsy' | 'string' | 'object' | 'regExp' | 'number';
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|