@spcsn/taro-runtime 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/LICENSE +174 -0
- package/README.md +49 -0
- package/dist/bom/URL.d.ts +51 -0
- package/dist/bom/URL.js +188 -0
- package/dist/bom/URL.js.map +1 -0
- package/dist/bom/URLSearchParams.d.ts +1 -0
- package/dist/bom/URLSearchParams.js +103 -0
- package/dist/bom/URLSearchParams.js.map +1 -0
- package/dist/bom/document.d.ts +3 -0
- package/dist/bom/document.js +93 -0
- package/dist/bom/document.js.map +1 -0
- package/dist/bom/getComputedStyle.d.ts +4 -0
- package/dist/bom/getComputedStyle.js +9 -0
- package/dist/bom/getComputedStyle.js.map +1 -0
- package/dist/bom/history.d.ts +30 -0
- package/dist/bom/history.js +108 -0
- package/dist/bom/history.js.map +1 -0
- package/dist/bom/location.d.ts +37 -0
- package/dist/bom/location.js +200 -0
- package/dist/bom/location.js.map +1 -0
- package/dist/bom/navigator.d.ts +1 -0
- package/dist/bom/navigator.js +22 -0
- package/dist/bom/navigator.js.map +1 -0
- package/dist/bom/raf.d.ts +4 -0
- package/dist/bom/raf.js +28 -0
- package/dist/bom/raf.js.map +1 -0
- package/dist/bom/window.d.ts +23 -0
- package/dist/bom/window.js +74 -0
- package/dist/bom/window.js.map +1 -0
- package/dist/constants/index.d.ts +57 -0
- package/dist/constants/index.js +63 -0
- package/dist/constants/index.js.map +1 -0
- package/dist/current.d.ts +19 -0
- package/dist/current.js +11 -0
- package/dist/current.js.map +1 -0
- package/dist/dom/anchor-element.d.ts +13 -0
- package/dist/dom/anchor-element.js +42 -0
- package/dist/dom/anchor-element.js.map +1 -0
- package/dist/dom/class-list.d.ts +16 -0
- package/dist/dom/class-list.js +79 -0
- package/dist/dom/class-list.js.map +1 -0
- package/dist/dom/document.d.ts +21 -0
- package/dist/dom/document.js +74 -0
- package/dist/dom/document.js.map +1 -0
- package/dist/dom/element.d.ts +39 -0
- package/dist/dom/element.js +261 -0
- package/dist/dom/element.js.map +1 -0
- package/dist/dom/event-source.d.ts +7 -0
- package/dist/dom/event-source.js +18 -0
- package/dist/dom/event-source.js.map +1 -0
- package/dist/dom/event-target.d.ts +8 -0
- package/dist/dom/event-target.js +72 -0
- package/dist/dom/event-target.js.map +1 -0
- package/dist/dom/event.d.ts +24 -0
- package/dist/dom/event.js +124 -0
- package/dist/dom/event.js.map +1 -0
- package/dist/dom/form.d.ts +9 -0
- package/dist/dom/form.js +30 -0
- package/dist/dom/form.js.map +1 -0
- package/dist/dom/node.d.ts +76 -0
- package/dist/dom/node.js +213 -0
- package/dist/dom/node.js.map +1 -0
- package/dist/dom/node_types.d.ts +10 -0
- package/dist/dom/root.d.ts +16 -0
- package/dist/dom/root.js +127 -0
- package/dist/dom/root.js.map +1 -0
- package/dist/dom/style.d.ts +14 -0
- package/dist/dom/style.js +138 -0
- package/dist/dom/style.js.map +1 -0
- package/dist/dom/style_properties.d.ts +3 -0
- package/dist/dom/style_properties.js +374 -0
- package/dist/dom/style_properties.js.map +1 -0
- package/dist/dom/svg.d.ts +3 -0
- package/dist/dom/svg.js +7 -0
- package/dist/dom/svg.js.map +1 -0
- package/dist/dom/text.d.ts +14 -0
- package/dist/dom/text.js +43 -0
- package/dist/dom/text.js.map +1 -0
- package/dist/dom/transfer.d.ts +7 -0
- package/dist/dom/transfer.js +16 -0
- package/dist/dom/transfer.js.map +1 -0
- package/dist/dom/tree.d.ts +4 -0
- package/dist/dom/tree.js +31 -0
- package/dist/dom/tree.js.map +1 -0
- package/dist/dom-external/element.d.ts +3 -0
- package/dist/dom-external/index.d.ts +1 -0
- package/dist/dom-external/mutation-observer/implements.d.ts +52 -0
- package/dist/dom-external/mutation-observer/implements.js +101 -0
- package/dist/dom-external/mutation-observer/implements.js.map +1 -0
- package/dist/dom-external/mutation-observer/index.d.ts +13 -0
- package/dist/dom-external/mutation-observer/index.js +32 -0
- package/dist/dom-external/mutation-observer/index.js.map +1 -0
- package/dist/dom-external/mutation-observer/record.d.ts +24 -0
- package/dist/dom-external/node.d.ts +5 -0
- package/dist/dsl/common.d.ts +14 -0
- package/dist/dsl/common.js +278 -0
- package/dist/dsl/common.js.map +1 -0
- package/dist/dsl/instance.d.ts +92 -0
- package/dist/emitter/emitter.d.ts +4 -0
- package/dist/emitter/emitter.js +7 -0
- package/dist/emitter/emitter.js.map +1 -0
- package/dist/env.d.ts +7 -0
- package/dist/env.js +10 -0
- package/dist/env.js.map +1 -0
- package/dist/hydrate.d.ts +10 -0
- package/dist/hydrate.js +62 -0
- package/dist/hydrate.js.map +1 -0
- package/dist/index.cjs.d.ts +35 -0
- package/dist/index.cjs.js +3776 -0
- package/dist/index.cjs.js.map +1 -0
- package/dist/index.d.ts +35 -0
- package/dist/index.js +34 -0
- package/dist/interface/animate.d.ts +81 -0
- package/dist/interface/element.d.ts +4 -0
- package/dist/interface/event-target.d.ts +11 -0
- package/dist/interface/event.d.ts +15 -0
- package/dist/interface/hydrate.d.ts +30 -0
- package/dist/interface/index.d.ts +8 -0
- package/dist/interface/node.d.ts +7 -0
- package/dist/interface/options.d.ts +5 -0
- package/dist/interface/utils.d.ts +2 -0
- package/dist/next-tick.d.ts +2 -0
- package/dist/next-tick.js +35 -0
- package/dist/next-tick.js.map +1 -0
- package/dist/options.d.ts +2 -0
- package/dist/options.js +9 -0
- package/dist/options.js.map +1 -0
- package/dist/perf.d.ts +9 -0
- package/dist/perf.js +36 -0
- package/dist/perf.js.map +1 -0
- package/dist/polyfill/array.d.ts +2 -0
- package/dist/polyfill/array.js +36 -0
- package/dist/polyfill/array.js.map +1 -0
- package/dist/polyfill/index.d.ts +2 -0
- package/dist/polyfill/index.js +20 -0
- package/dist/polyfill/index.js.map +1 -0
- package/dist/polyfill/intersection-observer.d.ts +1 -0
- package/dist/polyfill/intersection-observer.js +494 -0
- package/dist/polyfill/intersection-observer.js.map +1 -0
- package/dist/polyfill/object.d.ts +3 -0
- package/dist/polyfill/object.js +63 -0
- package/dist/polyfill/object.js.map +1 -0
- package/dist/runtime.esm.d.ts +35 -0
- package/dist/runtime.esm.js +3644 -0
- package/dist/runtime.esm.js.map +1 -0
- package/dist/utils/cache.d.ts +12 -0
- package/dist/utils/cache.js +26 -0
- package/dist/utils/cache.js.map +1 -0
- package/dist/utils/index.d.ts +25 -0
- package/dist/utils/index.js +82 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/lodash.d.ts +2 -0
- package/dist/utils/lodash.js +33 -0
- package/dist/utils/lodash.js.map +1 -0
- package/dist/utils/router.d.ts +7 -0
- package/dist/utils/router.js +19 -0
- package/dist/utils/router.js.map +1 -0
- package/package.json +45 -0
|
@@ -0,0 +1,374 @@
|
|
|
1
|
+
//#region src/dom/style_properties.ts
|
|
2
|
+
const WEBKIT = "webkit";
|
|
3
|
+
const styleProperties = [
|
|
4
|
+
"all",
|
|
5
|
+
"appearance",
|
|
6
|
+
"backdropFilter",
|
|
7
|
+
"blockOverflow",
|
|
8
|
+
"blockSize",
|
|
9
|
+
"bottom",
|
|
10
|
+
"clear",
|
|
11
|
+
"contain",
|
|
12
|
+
"content",
|
|
13
|
+
"continue",
|
|
14
|
+
"cursor",
|
|
15
|
+
"direction",
|
|
16
|
+
"display",
|
|
17
|
+
"filter",
|
|
18
|
+
"float",
|
|
19
|
+
"gap",
|
|
20
|
+
"height",
|
|
21
|
+
"inset",
|
|
22
|
+
"isolation",
|
|
23
|
+
"left",
|
|
24
|
+
"letterSpacing",
|
|
25
|
+
"lightingColor",
|
|
26
|
+
"markerSide",
|
|
27
|
+
"mixBlendMode",
|
|
28
|
+
"opacity",
|
|
29
|
+
"order",
|
|
30
|
+
"position",
|
|
31
|
+
"quotes",
|
|
32
|
+
"resize",
|
|
33
|
+
"right",
|
|
34
|
+
"rowGap",
|
|
35
|
+
"tabSize",
|
|
36
|
+
"tableLayout",
|
|
37
|
+
"top",
|
|
38
|
+
"userSelect",
|
|
39
|
+
"verticalAlign",
|
|
40
|
+
"visibility",
|
|
41
|
+
"voiceFamily",
|
|
42
|
+
"volume",
|
|
43
|
+
"whiteSpace",
|
|
44
|
+
"widows",
|
|
45
|
+
"width",
|
|
46
|
+
"zIndex",
|
|
47
|
+
"pointerEvents",
|
|
48
|
+
"aspectRatio"
|
|
49
|
+
];
|
|
50
|
+
function combine(prefix, list, excludeSelf) {
|
|
51
|
+
!excludeSelf && styleProperties.push(prefix);
|
|
52
|
+
list.forEach((item) => {
|
|
53
|
+
styleProperties.push(prefix + item);
|
|
54
|
+
if (prefix === WEBKIT) styleProperties.push("Webkit" + item);
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
const color = "Color";
|
|
58
|
+
const style = "Style";
|
|
59
|
+
const width = "Width";
|
|
60
|
+
const image = "Image";
|
|
61
|
+
const size = "Size";
|
|
62
|
+
const color_style_width = [
|
|
63
|
+
color,
|
|
64
|
+
style,
|
|
65
|
+
width
|
|
66
|
+
];
|
|
67
|
+
const fitlength_fitwidth_image = [
|
|
68
|
+
"FitLength",
|
|
69
|
+
"FitWidth",
|
|
70
|
+
image
|
|
71
|
+
];
|
|
72
|
+
const fitlength_fitwidth_image_radius = [...fitlength_fitwidth_image, "Radius"];
|
|
73
|
+
const color_style_width_fitlength_fitwidth_image = [...color_style_width, ...fitlength_fitwidth_image];
|
|
74
|
+
const endRadius_startRadius = ["EndRadius", "StartRadius"];
|
|
75
|
+
const bottom_left_right_top = [
|
|
76
|
+
"Bottom",
|
|
77
|
+
"Left",
|
|
78
|
+
"Right",
|
|
79
|
+
"Top"
|
|
80
|
+
];
|
|
81
|
+
const end_start = ["End", "Start"];
|
|
82
|
+
const content_items_self = [
|
|
83
|
+
"Content",
|
|
84
|
+
"Items",
|
|
85
|
+
"Self"
|
|
86
|
+
];
|
|
87
|
+
const blockSize_height_inlineSize_width = [
|
|
88
|
+
"BlockSize",
|
|
89
|
+
"Height",
|
|
90
|
+
"InlineSize",
|
|
91
|
+
width
|
|
92
|
+
];
|
|
93
|
+
const after_before = ["After", "Before"];
|
|
94
|
+
combine("borderBlock", color_style_width);
|
|
95
|
+
combine("borderBlockEnd", color_style_width);
|
|
96
|
+
combine("borderBlockStart", color_style_width);
|
|
97
|
+
combine("outline", [...color_style_width, "Offset"]);
|
|
98
|
+
combine("border", [
|
|
99
|
+
...color_style_width,
|
|
100
|
+
"Boundary",
|
|
101
|
+
"Break",
|
|
102
|
+
"Collapse",
|
|
103
|
+
"Radius",
|
|
104
|
+
"Spacing"
|
|
105
|
+
]);
|
|
106
|
+
combine("borderFit", ["Length", width]);
|
|
107
|
+
combine("borderInline", color_style_width);
|
|
108
|
+
combine("borderInlineEnd", color_style_width);
|
|
109
|
+
combine("borderInlineStart", color_style_width);
|
|
110
|
+
combine("borderLeft", color_style_width_fitlength_fitwidth_image);
|
|
111
|
+
combine("borderRight", color_style_width_fitlength_fitwidth_image);
|
|
112
|
+
combine("borderTop", color_style_width_fitlength_fitwidth_image);
|
|
113
|
+
combine("borderBottom", color_style_width_fitlength_fitwidth_image);
|
|
114
|
+
combine("textDecoration", [
|
|
115
|
+
color,
|
|
116
|
+
style,
|
|
117
|
+
"Line"
|
|
118
|
+
]);
|
|
119
|
+
combine("textEmphasis", [
|
|
120
|
+
color,
|
|
121
|
+
style,
|
|
122
|
+
"Position"
|
|
123
|
+
]);
|
|
124
|
+
combine("scrollMargin", bottom_left_right_top);
|
|
125
|
+
combine("scrollPadding", bottom_left_right_top);
|
|
126
|
+
combine("padding", bottom_left_right_top);
|
|
127
|
+
combine("margin", [...bottom_left_right_top, "Trim"]);
|
|
128
|
+
combine("scrollMarginBlock", end_start);
|
|
129
|
+
combine("scrollMarginInline", end_start);
|
|
130
|
+
combine("scrollPaddingBlock", end_start);
|
|
131
|
+
combine("scrollPaddingInline", end_start);
|
|
132
|
+
combine("gridColumn", end_start);
|
|
133
|
+
combine("gridRow", end_start);
|
|
134
|
+
combine("insetBlock", end_start);
|
|
135
|
+
combine("insetInline", end_start);
|
|
136
|
+
combine("marginBlock", end_start);
|
|
137
|
+
combine("marginInline", end_start);
|
|
138
|
+
combine("paddingBlock", end_start);
|
|
139
|
+
combine("paddingInline", end_start);
|
|
140
|
+
combine("pause", after_before);
|
|
141
|
+
combine("cue", after_before);
|
|
142
|
+
combine("mask", [
|
|
143
|
+
"Clip",
|
|
144
|
+
"Composite",
|
|
145
|
+
image,
|
|
146
|
+
"Mode",
|
|
147
|
+
"Origin",
|
|
148
|
+
"Position",
|
|
149
|
+
"Repeat",
|
|
150
|
+
size,
|
|
151
|
+
"Type"
|
|
152
|
+
]);
|
|
153
|
+
combine("borderImage", [
|
|
154
|
+
"Outset",
|
|
155
|
+
"Repeat",
|
|
156
|
+
"Slice",
|
|
157
|
+
"Source",
|
|
158
|
+
"Transform",
|
|
159
|
+
width
|
|
160
|
+
]);
|
|
161
|
+
combine("maskBorder", [
|
|
162
|
+
"Mode",
|
|
163
|
+
"Outset",
|
|
164
|
+
"Repeat",
|
|
165
|
+
"Slice",
|
|
166
|
+
"Source",
|
|
167
|
+
width
|
|
168
|
+
]);
|
|
169
|
+
combine("font", [
|
|
170
|
+
"Family",
|
|
171
|
+
"FeatureSettings",
|
|
172
|
+
"Kerning",
|
|
173
|
+
"LanguageOverride",
|
|
174
|
+
"MaxSize",
|
|
175
|
+
"MinSize",
|
|
176
|
+
"OpticalSizing",
|
|
177
|
+
"Palette",
|
|
178
|
+
size,
|
|
179
|
+
"SizeAdjust",
|
|
180
|
+
"Stretch",
|
|
181
|
+
style,
|
|
182
|
+
"Weight",
|
|
183
|
+
"VariationSettings"
|
|
184
|
+
]);
|
|
185
|
+
combine("transform", [
|
|
186
|
+
"Box",
|
|
187
|
+
"Origin",
|
|
188
|
+
style
|
|
189
|
+
]);
|
|
190
|
+
combine("background", [
|
|
191
|
+
color,
|
|
192
|
+
image,
|
|
193
|
+
"Attachment",
|
|
194
|
+
"BlendMode",
|
|
195
|
+
"Clip",
|
|
196
|
+
"Origin",
|
|
197
|
+
"Position",
|
|
198
|
+
"Repeat",
|
|
199
|
+
size
|
|
200
|
+
]);
|
|
201
|
+
combine("listStyle", [
|
|
202
|
+
image,
|
|
203
|
+
"Position",
|
|
204
|
+
"Type"
|
|
205
|
+
]);
|
|
206
|
+
combine("scrollSnap", [
|
|
207
|
+
"Align",
|
|
208
|
+
"Stop",
|
|
209
|
+
"Type"
|
|
210
|
+
]);
|
|
211
|
+
combine("grid", [
|
|
212
|
+
"Area",
|
|
213
|
+
"AutoColumns",
|
|
214
|
+
"AutoFlow",
|
|
215
|
+
"AutoRows"
|
|
216
|
+
]);
|
|
217
|
+
combine("gridTemplate", [
|
|
218
|
+
"Areas",
|
|
219
|
+
"Columns",
|
|
220
|
+
"Rows"
|
|
221
|
+
]);
|
|
222
|
+
combine("overflow", [
|
|
223
|
+
"Block",
|
|
224
|
+
"Inline",
|
|
225
|
+
"Wrap",
|
|
226
|
+
"X",
|
|
227
|
+
"Y"
|
|
228
|
+
]);
|
|
229
|
+
combine("transition", [
|
|
230
|
+
"Delay",
|
|
231
|
+
"Duration",
|
|
232
|
+
"Property",
|
|
233
|
+
"TimingFunction"
|
|
234
|
+
]);
|
|
235
|
+
combine("color", [
|
|
236
|
+
"Adjust",
|
|
237
|
+
"InterpolationFilters",
|
|
238
|
+
"Scheme"
|
|
239
|
+
]);
|
|
240
|
+
combine("textAlign", ["All", "Last"]);
|
|
241
|
+
combine("page", [
|
|
242
|
+
"BreakAfter",
|
|
243
|
+
"BreakBefore",
|
|
244
|
+
"BreakInside"
|
|
245
|
+
]);
|
|
246
|
+
combine("animation", [
|
|
247
|
+
"Delay",
|
|
248
|
+
"Direction",
|
|
249
|
+
"Duration",
|
|
250
|
+
"FillMode",
|
|
251
|
+
"IterationCount",
|
|
252
|
+
"Name",
|
|
253
|
+
"PlayState",
|
|
254
|
+
"TimingFunction"
|
|
255
|
+
]);
|
|
256
|
+
combine("flex", [
|
|
257
|
+
"Basis",
|
|
258
|
+
"Direction",
|
|
259
|
+
"Flow",
|
|
260
|
+
"Grow",
|
|
261
|
+
"Shrink",
|
|
262
|
+
"Wrap"
|
|
263
|
+
]);
|
|
264
|
+
combine("offset", [
|
|
265
|
+
...after_before,
|
|
266
|
+
...end_start,
|
|
267
|
+
"Anchor",
|
|
268
|
+
"Distance",
|
|
269
|
+
"Path",
|
|
270
|
+
"Position",
|
|
271
|
+
"Rotate"
|
|
272
|
+
]);
|
|
273
|
+
combine("perspective", ["Origin"]);
|
|
274
|
+
combine("clip", ["Path", "Rule"]);
|
|
275
|
+
combine("flow", ["From", "Into"]);
|
|
276
|
+
combine("align", [
|
|
277
|
+
"Content",
|
|
278
|
+
"Items",
|
|
279
|
+
"Self"
|
|
280
|
+
], true);
|
|
281
|
+
combine("alignment", ["Adjust", "Baseline"], true);
|
|
282
|
+
combine("borderStart", endRadius_startRadius, true);
|
|
283
|
+
combine("borderEnd", endRadius_startRadius, true);
|
|
284
|
+
combine("borderCorner", [
|
|
285
|
+
"Fit",
|
|
286
|
+
image,
|
|
287
|
+
"ImageTransform"
|
|
288
|
+
], true);
|
|
289
|
+
combine("borderTopLeft", fitlength_fitwidth_image_radius, true);
|
|
290
|
+
combine("borderTopRight", fitlength_fitwidth_image_radius, true);
|
|
291
|
+
combine("borderBottomLeft", fitlength_fitwidth_image_radius, true);
|
|
292
|
+
combine("borderBottomRight", fitlength_fitwidth_image_radius, true);
|
|
293
|
+
combine("column", [
|
|
294
|
+
"s",
|
|
295
|
+
"Count",
|
|
296
|
+
"Fill",
|
|
297
|
+
"Gap",
|
|
298
|
+
"Rule",
|
|
299
|
+
"RuleColor",
|
|
300
|
+
"RuleStyle",
|
|
301
|
+
"RuleWidth",
|
|
302
|
+
"Span",
|
|
303
|
+
width
|
|
304
|
+
], true);
|
|
305
|
+
combine("break", [...after_before, "Inside"], true);
|
|
306
|
+
combine("wrap", [
|
|
307
|
+
...after_before,
|
|
308
|
+
"Flow",
|
|
309
|
+
"Inside",
|
|
310
|
+
"Through"
|
|
311
|
+
], true);
|
|
312
|
+
combine("justify", content_items_self, true);
|
|
313
|
+
combine("place", content_items_self, true);
|
|
314
|
+
combine("max", [...blockSize_height_inlineSize_width, "Lines"], true);
|
|
315
|
+
combine("min", blockSize_height_inlineSize_width, true);
|
|
316
|
+
combine("line", [
|
|
317
|
+
"Break",
|
|
318
|
+
"Clamp",
|
|
319
|
+
"Grid",
|
|
320
|
+
"Height",
|
|
321
|
+
"Padding",
|
|
322
|
+
"Snap"
|
|
323
|
+
], true);
|
|
324
|
+
combine("inline", [
|
|
325
|
+
"BoxAlign",
|
|
326
|
+
size,
|
|
327
|
+
"Sizing"
|
|
328
|
+
], true);
|
|
329
|
+
combine("text", [
|
|
330
|
+
"CombineUpright",
|
|
331
|
+
"GroupAlign",
|
|
332
|
+
"Height",
|
|
333
|
+
"Indent",
|
|
334
|
+
"Justify",
|
|
335
|
+
"Orientation",
|
|
336
|
+
"Overflow",
|
|
337
|
+
"Shadow",
|
|
338
|
+
"SpaceCollapse",
|
|
339
|
+
"SpaceTrim",
|
|
340
|
+
"Spacing",
|
|
341
|
+
"Transform",
|
|
342
|
+
"UnderlinePosition",
|
|
343
|
+
"Wrap"
|
|
344
|
+
], true);
|
|
345
|
+
combine("shape", [
|
|
346
|
+
"ImageThreshold",
|
|
347
|
+
"Inside",
|
|
348
|
+
"Margin",
|
|
349
|
+
"Outside"
|
|
350
|
+
], true);
|
|
351
|
+
combine("word", [
|
|
352
|
+
"Break",
|
|
353
|
+
"Spacing",
|
|
354
|
+
"Wrap"
|
|
355
|
+
], true);
|
|
356
|
+
combine("object", ["Fit", "Position"], true);
|
|
357
|
+
combine("box", [
|
|
358
|
+
"DecorationBreak",
|
|
359
|
+
"Shadow",
|
|
360
|
+
"Sizing",
|
|
361
|
+
"Snap"
|
|
362
|
+
], true);
|
|
363
|
+
combine(WEBKIT, [
|
|
364
|
+
"LineClamp",
|
|
365
|
+
"BoxOrient",
|
|
366
|
+
"TextFillColor",
|
|
367
|
+
"TextStroke",
|
|
368
|
+
"TextStrokeColor",
|
|
369
|
+
"TextStrokeWidth"
|
|
370
|
+
], true);
|
|
371
|
+
//#endregion
|
|
372
|
+
export { styleProperties };
|
|
373
|
+
|
|
374
|
+
//# sourceMappingURL=style_properties.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"style_properties.js","names":[],"sources":["../../src/dom/style_properties.ts"],"sourcesContent":["/*\n *\n * https://www.w3.org/Style/CSS/all-properties.en.html\n */\n\nconst WEBKIT = 'webkit';\n\nconst styleProperties = [\n 'all',\n 'appearance',\n 'backdropFilter',\n 'blockOverflow',\n 'blockSize',\n 'bottom',\n 'clear',\n 'contain',\n 'content',\n 'continue',\n 'cursor',\n 'direction',\n 'display',\n 'filter',\n 'float',\n 'gap',\n 'height',\n 'inset',\n 'isolation',\n 'left',\n 'letterSpacing',\n 'lightingColor',\n 'markerSide',\n 'mixBlendMode',\n 'opacity',\n 'order',\n 'position',\n 'quotes',\n 'resize',\n 'right',\n 'rowGap',\n 'tabSize',\n 'tableLayout',\n 'top',\n 'userSelect',\n 'verticalAlign',\n 'visibility',\n 'voiceFamily',\n 'volume',\n 'whiteSpace',\n 'widows',\n 'width',\n 'zIndex',\n 'pointerEvents',\n 'aspectRatio',\n\n /** 非常用 style */\n // 'azimuth',\n // 'backfaceVisibility',\n // 'baselineShift',\n // 'captionSide',\n // 'chains',\n // 'dominantBaseline',\n // 'elevation',\n // 'emptyCells',\n // 'forcedColorAdjust',\n // 'glyphOrientationVertical',\n // 'hangingPunctuation',\n // 'hyphenateCharacter',\n // 'hyphens',\n // 'imageOrientation',\n // 'imageResolution',\n // 'orphans',\n // 'playDuring',\n // 'pointerEvents',\n // 'regionFragment',\n // 'richness',\n // 'running',\n // 'scrollBehavior',\n // 'speechRate',\n // 'stress',\n // 'stringSet',\n // 'unicodeBidi',\n // 'willChange',\n // 'writingMode',\n];\n\n// 减少文件体积\nfunction combine(prefix: string, list: string[], excludeSelf?: boolean) {\n !excludeSelf && styleProperties.push(prefix);\n list.forEach((item) => {\n styleProperties.push(prefix + item);\n if (prefix === WEBKIT) {\n styleProperties.push('Webkit' + item);\n }\n });\n}\n\nconst color = 'Color';\nconst style = 'Style';\nconst width = 'Width';\nconst image = 'Image';\nconst size = 'Size';\nconst color_style_width = [color, style, width];\nconst fitlength_fitwidth_image = ['FitLength', 'FitWidth', image];\nconst fitlength_fitwidth_image_radius = [...fitlength_fitwidth_image, 'Radius'];\nconst color_style_width_fitlength_fitwidth_image = [...color_style_width, ...fitlength_fitwidth_image];\nconst endRadius_startRadius = ['EndRadius', 'StartRadius'];\nconst bottom_left_right_top = ['Bottom', 'Left', 'Right', 'Top'];\nconst end_start = ['End', 'Start'];\nconst content_items_self = ['Content', 'Items', 'Self'];\nconst blockSize_height_inlineSize_width = ['BlockSize', 'Height', 'InlineSize', width];\nconst after_before = ['After', 'Before'];\n\ncombine('borderBlock', color_style_width);\ncombine('borderBlockEnd', color_style_width);\ncombine('borderBlockStart', color_style_width);\ncombine('outline', [...color_style_width, 'Offset']);\ncombine('border', [...color_style_width, 'Boundary', 'Break', 'Collapse', 'Radius', 'Spacing']);\ncombine('borderFit', ['Length', width]);\ncombine('borderInline', color_style_width);\ncombine('borderInlineEnd', color_style_width);\ncombine('borderInlineStart', color_style_width);\ncombine('borderLeft', color_style_width_fitlength_fitwidth_image);\ncombine('borderRight', color_style_width_fitlength_fitwidth_image);\ncombine('borderTop', color_style_width_fitlength_fitwidth_image);\ncombine('borderBottom', color_style_width_fitlength_fitwidth_image);\ncombine('textDecoration', [color, style, 'Line']);\ncombine('textEmphasis', [color, style, 'Position']);\ncombine('scrollMargin', bottom_left_right_top);\ncombine('scrollPadding', bottom_left_right_top);\ncombine('padding', bottom_left_right_top);\ncombine('margin', [...bottom_left_right_top, 'Trim']);\ncombine('scrollMarginBlock', end_start);\ncombine('scrollMarginInline', end_start);\ncombine('scrollPaddingBlock', end_start);\ncombine('scrollPaddingInline', end_start);\ncombine('gridColumn', end_start);\ncombine('gridRow', end_start);\ncombine('insetBlock', end_start);\ncombine('insetInline', end_start);\ncombine('marginBlock', end_start);\ncombine('marginInline', end_start);\ncombine('paddingBlock', end_start);\ncombine('paddingInline', end_start);\ncombine('pause', after_before);\ncombine('cue', after_before);\ncombine('mask', ['Clip', 'Composite', image, 'Mode', 'Origin', 'Position', 'Repeat', size, 'Type']);\ncombine('borderImage', ['Outset', 'Repeat', 'Slice', 'Source', 'Transform', width]);\ncombine('maskBorder', ['Mode', 'Outset', 'Repeat', 'Slice', 'Source', width]);\ncombine('font', [\n 'Family',\n 'FeatureSettings',\n 'Kerning',\n 'LanguageOverride',\n 'MaxSize',\n 'MinSize',\n 'OpticalSizing',\n 'Palette',\n size,\n 'SizeAdjust',\n 'Stretch',\n style,\n 'Weight',\n 'VariationSettings',\n]);\ncombine('transform', ['Box', 'Origin', style]);\ncombine('background', [color, image, 'Attachment', 'BlendMode', 'Clip', 'Origin', 'Position', 'Repeat', size]);\ncombine('listStyle', [image, 'Position', 'Type']);\ncombine('scrollSnap', ['Align', 'Stop', 'Type']);\ncombine('grid', ['Area', 'AutoColumns', 'AutoFlow', 'AutoRows']);\ncombine('gridTemplate', ['Areas', 'Columns', 'Rows']);\ncombine('overflow', ['Block', 'Inline', 'Wrap', 'X', 'Y']);\ncombine('transition', ['Delay', 'Duration', 'Property', 'TimingFunction']);\ncombine('color', ['Adjust', 'InterpolationFilters', 'Scheme']);\ncombine('textAlign', ['All', 'Last']);\ncombine('page', ['BreakAfter', 'BreakBefore', 'BreakInside']);\ncombine('animation', [\n 'Delay',\n 'Direction',\n 'Duration',\n 'FillMode',\n 'IterationCount',\n 'Name',\n 'PlayState',\n 'TimingFunction',\n]);\ncombine('flex', ['Basis', 'Direction', 'Flow', 'Grow', 'Shrink', 'Wrap']);\ncombine('offset', [...after_before, ...end_start, 'Anchor', 'Distance', 'Path', 'Position', 'Rotate']);\ncombine('perspective', ['Origin']);\ncombine('clip', ['Path', 'Rule']);\ncombine('flow', ['From', 'Into']);\n\ncombine('align', ['Content', 'Items', 'Self'], true);\ncombine('alignment', ['Adjust', 'Baseline'], true);\ncombine('borderStart', endRadius_startRadius, true);\ncombine('borderEnd', endRadius_startRadius, true);\ncombine('borderCorner', ['Fit', image, 'ImageTransform'], true);\ncombine('borderTopLeft', fitlength_fitwidth_image_radius, true);\ncombine('borderTopRight', fitlength_fitwidth_image_radius, true);\ncombine('borderBottomLeft', fitlength_fitwidth_image_radius, true);\ncombine('borderBottomRight', fitlength_fitwidth_image_radius, true);\ncombine('column', ['s', 'Count', 'Fill', 'Gap', 'Rule', 'RuleColor', 'RuleStyle', 'RuleWidth', 'Span', width], true);\ncombine('break', [...after_before, 'Inside'], true);\ncombine('wrap', [...after_before, 'Flow', 'Inside', 'Through'], true);\ncombine('justify', content_items_self, true);\ncombine('place', content_items_self, true);\ncombine('max', [...blockSize_height_inlineSize_width, 'Lines'], true);\ncombine('min', blockSize_height_inlineSize_width, true);\ncombine('line', ['Break', 'Clamp', 'Grid', 'Height', 'Padding', 'Snap'], true);\ncombine('inline', ['BoxAlign', size, 'Sizing'], true);\ncombine(\n 'text',\n [\n 'CombineUpright',\n 'GroupAlign',\n 'Height',\n 'Indent',\n 'Justify',\n 'Orientation',\n 'Overflow',\n 'Shadow',\n 'SpaceCollapse',\n 'SpaceTrim',\n 'Spacing',\n 'Transform',\n 'UnderlinePosition',\n 'Wrap',\n ],\n true,\n);\ncombine('shape', ['ImageThreshold', 'Inside', 'Margin', 'Outside'], true);\ncombine('word', ['Break', 'Spacing', 'Wrap'], true);\ncombine('object', ['Fit', 'Position'], true);\ncombine('box', ['DecorationBreak', 'Shadow', 'Sizing', 'Snap'], true);\n\ncombine(WEBKIT, ['LineClamp', 'BoxOrient', 'TextFillColor', 'TextStroke', 'TextStrokeColor', 'TextStrokeWidth'], true);\n\n/** 非常用 style */\n// combine('caret', [color, 'Shape'])\n// combine('counter', ['Increment', 'Reset', 'Set'], true)\n// combine('dropInitial', ['AfterAdjust', 'AfterAlign', 'BeforeAdjust', 'BeforeAlign', size, 'Value'], true)\n// combine('flood', [color, 'Opacity'], true)\n// combine('footnote', ['Display', 'Policy'], true)\n// combine('hyphenateLimit', ['Chars', 'Last', 'Lines', 'Zone'], true)\n// combine('initialLetters', ['Align', 'Wrap'])\n// combine('ruby', ['Align', 'Merge', 'Position'], true)\n// combine('lineStacking', ['Ruby', 'Shift', 'Strategy'])\n// combine('bookmark', ['Label', 'Level', 'State'], true)\n// combine('speak', ['Header', 'Numeral', 'Punctuation'])\n// combine('pitch', ['Range'])\n// combine('nav', ['Down', 'Left', 'Right', 'Up'], true)\n// combine('fontSynthesis', ['SmallCaps', style, 'Weight'])\n// combine('fontVariant', ['Alternates', 'Caps', 'EastAsian', 'Emoji', 'Ligatures', 'Numeric', 'Position'])\n\nexport { styleProperties };\n"],"mappings":";AAKA,MAAM,SAAS;AAEf,MAAM,kBAAkB;CACtB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AA+BF;AAGA,SAAS,QAAQ,QAAgB,MAAgB,aAAuB;CACtE,CAAC,eAAe,gBAAgB,KAAK,MAAM;CAC3C,KAAK,SAAS,SAAS;EACrB,gBAAgB,KAAK,SAAS,IAAI;EAClC,IAAI,WAAW,QACb,gBAAgB,KAAK,WAAW,IAAI;CAExC,CAAC;AACH;AAEA,MAAM,QAAQ;AACd,MAAM,QAAQ;AACd,MAAM,QAAQ;AACd,MAAM,QAAQ;AACd,MAAM,OAAO;AACb,MAAM,oBAAoB;CAAC;CAAO;CAAO;AAAK;AAC9C,MAAM,2BAA2B;CAAC;CAAa;CAAY;AAAK;AAChE,MAAM,kCAAkC,CAAC,GAAG,0BAA0B,QAAQ;AAC9E,MAAM,6CAA6C,CAAC,GAAG,mBAAmB,GAAG,wBAAwB;AACrG,MAAM,wBAAwB,CAAC,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,QAAQ;CAAC;CAAS;CAAW;AAAM,GAAG,IAAI;AAClD,QAAQ,UAAU,CAAC,OAAO,UAAU,GAAG,IAAI;AAC3C,QAAQ,OAAO;CAAC;CAAmB;CAAU;CAAU;AAAM,GAAG,IAAI;AAEpE,QAAQ,QAAQ;CAAC;CAAa;CAAa;CAAiB;CAAc;CAAmB;AAAiB,GAAG,IAAI"}
|
package/dist/dom/svg.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"svg.js","names":[],"sources":["../../src/dom/svg.ts"],"sourcesContent":["import { TaroElement } from './element';\n\n// for Vue3\nexport class SVGElement extends TaroElement {}\n"],"mappings":";;AAGA,IAAa,aAAb,cAAgC,YAAY,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { TaroNode } from './node';
|
|
2
|
+
import { NodeType } from './node_types';
|
|
3
|
+
export declare class TaroText extends TaroNode {
|
|
4
|
+
_value: string;
|
|
5
|
+
nodeType: NodeType;
|
|
6
|
+
nodeName: string;
|
|
7
|
+
constructor(value: any);
|
|
8
|
+
set textContent(text: string);
|
|
9
|
+
get textContent(): string;
|
|
10
|
+
set nodeValue(text: string);
|
|
11
|
+
get nodeValue(): string;
|
|
12
|
+
set data(text: string);
|
|
13
|
+
get data(): string;
|
|
14
|
+
}
|
package/dist/dom/text.js
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { MutationObserver } from "../dom-external/mutation-observer/index.js";
|
|
2
|
+
import { TaroNode } from "./node.js";
|
|
3
|
+
import { Shortcuts } from "@spcsn/taro-shared";
|
|
4
|
+
//#region src/dom/text.ts
|
|
5
|
+
var TaroText = class extends TaroNode {
|
|
6
|
+
constructor(value) {
|
|
7
|
+
super();
|
|
8
|
+
this.nodeType = 3;
|
|
9
|
+
this.nodeName = "#text";
|
|
10
|
+
this._value = value;
|
|
11
|
+
}
|
|
12
|
+
set textContent(text) {
|
|
13
|
+
MutationObserver.record({
|
|
14
|
+
target: this,
|
|
15
|
+
type: "characterData",
|
|
16
|
+
oldValue: this._value
|
|
17
|
+
});
|
|
18
|
+
this._value = text;
|
|
19
|
+
this.enqueueUpdate({
|
|
20
|
+
path: `${this._path}.${Shortcuts.Text}`,
|
|
21
|
+
value: text
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
get textContent() {
|
|
25
|
+
return this._value;
|
|
26
|
+
}
|
|
27
|
+
set nodeValue(text) {
|
|
28
|
+
this.textContent = text;
|
|
29
|
+
}
|
|
30
|
+
get nodeValue() {
|
|
31
|
+
return this._value;
|
|
32
|
+
}
|
|
33
|
+
set data(text) {
|
|
34
|
+
this.textContent = text;
|
|
35
|
+
}
|
|
36
|
+
get data() {
|
|
37
|
+
return this._value;
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
//#endregion
|
|
41
|
+
export { TaroText };
|
|
42
|
+
|
|
43
|
+
//# sourceMappingURL=text.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text.js","names":[],"sources":["../../src/dom/text.ts"],"sourcesContent":["import { Shortcuts } from '@spcsn/taro-shared';\n\nimport { MutationObserver, MutationRecordType } from '../dom-external/mutation-observer';\nimport { TaroNode } from './node';\nimport { NodeType } from './node_types';\n\nexport class TaroText extends TaroNode {\n public _value: string;\n public nodeType = NodeType.TEXT_NODE;\n public nodeName = '#text';\n\n constructor(value) {\n super();\n this._value = value;\n }\n\n public set textContent(text: string) {\n MutationObserver.record({\n target: this,\n type: MutationRecordType.CHARACTER_DATA,\n oldValue: this._value,\n });\n this._value = text;\n this.enqueueUpdate({\n path: `${this._path}.${Shortcuts.Text}`,\n value: text,\n });\n }\n\n public get textContent(): string {\n return this._value;\n }\n\n public set nodeValue(text: string) {\n this.textContent = text;\n }\n\n public get nodeValue(): string {\n return this._value;\n }\n\n public set data(text: string) {\n this.textContent = text;\n }\n\n public get data(): string {\n return this._value;\n }\n}\n"],"mappings":";;;;AAMA,IAAa,WAAb,cAA8B,SAAS;CAKrC,YAAY,OAAO;EACjB,MAAM;;kBAHU;EAIhB,KAAK,SAAS;CAChB;CAEA,IAAW,YAAY,MAAc;EACnC,iBAAiB,OAAO;GACtB,QAAQ;GACR,MAAA;GACA,UAAU,KAAK;EACjB,CAAC;EACD,KAAK,SAAS;EACd,KAAK,cAAc;GACjB,MAAM,GAAG,KAAK,MAAM,GAAG,UAAU;GACjC,OAAO;EACT,CAAC;CACH;CAEA,IAAW,cAAsB;EAC/B,OAAO,KAAK;CACd;CAEA,IAAW,UAAU,MAAc;EACjC,KAAK,cAAc;CACrB;CAEA,IAAW,YAAoB;EAC7B,OAAO,KAAK;CACd;CAEA,IAAW,KAAK,MAAc;EAC5B,KAAK,cAAc;CACrB;CAEA,IAAW,OAAe;EACxB,OAAO,KAAK;CACd;AACF"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { TaroElement } from "./element.js";
|
|
2
|
+
//#region src/dom/transfer.ts
|
|
3
|
+
var TransferElement = class extends TaroElement {
|
|
4
|
+
constructor(dataName) {
|
|
5
|
+
super();
|
|
6
|
+
this.dataName = dataName;
|
|
7
|
+
this.isTransferElement = true;
|
|
8
|
+
}
|
|
9
|
+
get _path() {
|
|
10
|
+
return this.dataName;
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
//#endregion
|
|
14
|
+
export { TransferElement };
|
|
15
|
+
|
|
16
|
+
//# sourceMappingURL=transfer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transfer.js","names":[],"sources":["../../src/dom/transfer.ts"],"sourcesContent":["import { TaroElement } from './element';\n\nexport class TransferElement extends TaroElement {\n public isTransferElement = true;\n\n constructor(public dataName: string) {\n super();\n }\n\n public get _path() {\n return this.dataName;\n }\n}\n"],"mappings":";;AAEA,IAAa,kBAAb,cAAqC,YAAY;CAG/C,YAAY,UAAyB;EACnC,MAAM;EADW,KAAA,WAAA;2BAFQ;CAI3B;CAEA,IAAW,QAAQ;EACjB,OAAO,KAAK;CACd;AACF"}
|
package/dist/dom/tree.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
//#region src/dom/tree.ts
|
|
2
|
+
function returnTrue() {
|
|
3
|
+
return true;
|
|
4
|
+
}
|
|
5
|
+
function treeToArray(root, predict) {
|
|
6
|
+
const array = [];
|
|
7
|
+
const filter = predict ?? returnTrue;
|
|
8
|
+
let object = root;
|
|
9
|
+
while (object) {
|
|
10
|
+
if (object.nodeType === 1 && filter(object)) array.push(object);
|
|
11
|
+
object = following(object, root);
|
|
12
|
+
}
|
|
13
|
+
return array;
|
|
14
|
+
}
|
|
15
|
+
function following(el, root) {
|
|
16
|
+
const firstChild = el.firstChild;
|
|
17
|
+
const isElmentTypeValid = el.nodeType === 1 || el.nodeType === 9;
|
|
18
|
+
if (firstChild && isElmentTypeValid) return firstChild;
|
|
19
|
+
let current = el;
|
|
20
|
+
do {
|
|
21
|
+
if (current === root) return null;
|
|
22
|
+
const nextSibling = current.nextSibling;
|
|
23
|
+
if (nextSibling) return nextSibling;
|
|
24
|
+
current = current.parentElement;
|
|
25
|
+
} while (current);
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
//#endregion
|
|
29
|
+
export { treeToArray };
|
|
30
|
+
|
|
31
|
+
//# sourceMappingURL=tree.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tree.js","names":[],"sources":["../../src/dom/tree.ts"],"sourcesContent":["import { NodeType } from './node_types';\n\nimport type { TaroElement } from './element';\n\ntype Filter = (element: TaroElement) => boolean;\n\nfunction returnTrue() {\n return true;\n}\n\nexport function treeToArray(root: TaroElement, predict?: Filter): TaroElement[] {\n const array: TaroElement[] = [];\n const filter = predict ?? returnTrue;\n\n let object: TaroElement | null = root;\n\n while (object) {\n if (object.nodeType === NodeType.ELEMENT_NODE && filter(object)) {\n array.push(object);\n }\n\n object = following(object, root);\n }\n\n return array;\n}\n\nfunction following(el: TaroElement, root: TaroElement): TaroElement | null {\n const firstChild = el.firstChild;\n const isElmentTypeValid = el.nodeType === NodeType.ELEMENT_NODE || el.nodeType === NodeType.DOCUMENT_NODE;\n\n // 如果当前 el 不是 element 或 document 元素,则可以直接不递归他的子元素了\n if (firstChild && isElmentTypeValid) {\n return firstChild as TaroElement;\n }\n\n let current: TaroElement | null = el;\n\n do {\n if (current === root) {\n return null;\n }\n\n const nextSibling = current.nextSibling;\n\n if (nextSibling) {\n return nextSibling as TaroElement;\n }\n current = current.parentElement;\n } while (current);\n\n return null;\n}\n"],"mappings":";AAMA,SAAS,aAAa;CACpB,OAAO;AACT;AAEA,SAAgB,YAAY,MAAmB,SAAiC;CAC9E,MAAM,QAAuB,CAAC;CAC9B,MAAM,SAAS,WAAW;CAE1B,IAAI,SAA6B;CAEjC,OAAO,QAAQ;EACb,IAAI,OAAO,aAAA,KAAsC,OAAO,MAAM,GAC5D,MAAM,KAAK,MAAM;EAGnB,SAAS,UAAU,QAAQ,IAAI;CACjC;CAEA,OAAO;AACT;AAEA,SAAS,UAAU,IAAiB,MAAuC;CACzE,MAAM,aAAa,GAAG;CACtB,MAAM,oBAAoB,GAAG,aAAA,KAAsC,GAAG,aAAA;CAGtE,IAAI,cAAc,mBAChB,OAAO;CAGT,IAAI,UAA8B;CAElC,GAAG;EACD,IAAI,YAAY,MACd,OAAO;EAGT,MAAM,cAAc,QAAQ;EAE5B,IAAI,aACF,OAAO;EAET,UAAU,QAAQ;CACpB,SAAS;CAET,OAAO;AACT"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { TaroNode } from '../../dom/node';
|
|
2
|
+
import type { MutationRecord } from './record';
|
|
3
|
+
export type MutationCallback = (mutations: MutationRecord[]) => any;
|
|
4
|
+
/**
|
|
5
|
+
* @see https://dom.spec.whatwg.org/#dictdef-mutationobserverinit
|
|
6
|
+
*/
|
|
7
|
+
export interface MutationObserverInit {
|
|
8
|
+
attributeFilter?: string[];
|
|
9
|
+
attributeOldValue?: boolean;
|
|
10
|
+
attributes?: boolean;
|
|
11
|
+
characterData?: boolean;
|
|
12
|
+
characterDataOldValue?: boolean;
|
|
13
|
+
childList?: boolean;
|
|
14
|
+
subtree?: boolean;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* The MutationObserver provides the ability
|
|
18
|
+
* to watch for changes being made to the DOM tree.
|
|
19
|
+
* It will invoke a specified callback function
|
|
20
|
+
* when DOM changes occur.
|
|
21
|
+
* @see https://dom.spec.whatwg.org/#mutationobserver
|
|
22
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver
|
|
23
|
+
*/
|
|
24
|
+
export declare class MutationObserverImpl {
|
|
25
|
+
callback: MutationCallback;
|
|
26
|
+
target: TaroNode | null;
|
|
27
|
+
options: MutationObserverInit;
|
|
28
|
+
records: MutationRecord[];
|
|
29
|
+
constructor(callback: MutationCallback);
|
|
30
|
+
/**
|
|
31
|
+
* Configures the MutationObserver
|
|
32
|
+
* to begin receiving notifications
|
|
33
|
+
* through its callback function
|
|
34
|
+
* when DOM changes matching the given options occur.
|
|
35
|
+
*
|
|
36
|
+
* Options matching is to be implemented.
|
|
37
|
+
*/
|
|
38
|
+
observe(target: TaroNode, options?: MutationObserverInit): void;
|
|
39
|
+
/**
|
|
40
|
+
* Stop the MutationObserver instance
|
|
41
|
+
* from receiving further notifications
|
|
42
|
+
* until and unless observe() is called again.
|
|
43
|
+
*/
|
|
44
|
+
disconnect(): void;
|
|
45
|
+
/**
|
|
46
|
+
* Removes all pending notifications
|
|
47
|
+
* from the MutationObserver's notification queue
|
|
48
|
+
* and returns them in a new Array of MutationRecord objects.
|
|
49
|
+
*/
|
|
50
|
+
takeRecords(): MutationRecord[];
|
|
51
|
+
}
|
|
52
|
+
export declare function recordMutation(record: MutationRecord): void;
|