marko 5.33.8 → 5.33.10
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/core-tags/core/await/AsyncValue.js +21 -21
- package/dist/core-tags/core/await/renderer.js +11 -11
- package/dist/core-tags/core/await/reorderer-renderer.js +3 -3
- package/dist/node_modules/@internal/components-beginComponent/index-browser.js +4 -4
- package/dist/node_modules/@internal/components-beginComponent/index.js +11 -11
- package/dist/node_modules/@internal/components-define-widget-legacy/index-browser.js +45 -45
- package/dist/node_modules/@internal/components-define-widget-legacy/index.js +3 -3
- package/dist/node_modules/@internal/components-endComponent/index.js +3 -3
- package/dist/node_modules/@internal/components-entry/index-browser.js +2 -2
- package/dist/node_modules/@internal/components-entry/index.js +16 -16
- package/dist/node_modules/@internal/components-entry-legacy/index-browser.js +6 -6
- package/dist/node_modules/@internal/components-registry/index-browser.js +46 -46
- package/dist/node_modules/@internal/components-registry/index.js +2 -2
- package/dist/node_modules/@internal/components-util/index-browser.js +20 -20
- package/dist/node_modules/@internal/components-util/index.js +10 -10
- package/dist/node_modules/@internal/create-readable/index-browser.js +1 -1
- package/dist/node_modules/@internal/create-readable/index.js +9 -9
- package/dist/node_modules/@internal/preserve-tag/index-browser.js +7 -7
- package/dist/node_modules/@internal/preserve-tag/index.js +5 -5
- package/dist/node_modules/@internal/set-immediate/index-browser.js +4 -2
- package/dist/node_modules/@internal/set-immediate/index-worker.js +31 -2
- package/dist/node_modules/@internal/set-immediate/index.js +3 -2
- package/dist/node_modules/@internal/set-immediate/queueMicrotask.js +8 -0
- package/dist/runtime/RenderResult.js +8 -8
- package/dist/runtime/components/Component.js +145 -145
- package/dist/runtime/components/ComponentDef.js +28 -28
- package/dist/runtime/components/ComponentsContext.js +15 -15
- package/dist/runtime/components/GlobalComponentsContext.js +4 -4
- package/dist/runtime/components/KeySequence.js +3 -3
- package/dist/runtime/components/ServerComponent.js +13 -13
- package/dist/runtime/components/State.js +26 -26
- package/dist/runtime/components/attach-detach.js +8 -8
- package/dist/runtime/components/defineComponent.js +5 -5
- package/dist/runtime/components/dom-data.js +5 -5
- package/dist/runtime/components/event-delegation.js +10 -10
- package/dist/runtime/components/legacy/defineComponent-legacy.js +1 -1
- package/dist/runtime/components/legacy/defineRenderer-legacy.js +16 -16
- package/dist/runtime/components/legacy/dependencies/index.js +7 -7
- package/dist/runtime/components/legacy/renderer-legacy.js +43 -43
- package/dist/runtime/components/renderer.js +36 -36
- package/dist/runtime/components/update-manager.js +4 -4
- package/dist/runtime/createOut.js +1 -1
- package/dist/runtime/dom-insert.js +5 -5
- package/dist/runtime/helpers/_change-case.js +2 -2
- package/dist/runtime/helpers/class-value.js +2 -5
- package/dist/runtime/helpers/dynamic-tag.js +16 -16
- package/dist/runtime/helpers/render-tag.js +1 -1
- package/dist/runtime/helpers/style-value.js +3 -3
- package/dist/runtime/helpers/tags-compat/runtime-dom.js +21 -21
- package/dist/runtime/helpers/tags-compat/runtime-html.js +8 -8
- package/dist/runtime/html/AsyncStream.js +31 -28
- package/dist/runtime/html/BufferedWriter.js +2 -2
- package/dist/runtime/html/StringWriter.js +1 -1
- package/dist/runtime/html/helpers/_dynamic-attr.js +2 -2
- package/dist/runtime/html/helpers/attr.js +4 -4
- package/dist/runtime/html/helpers/data-marko.js +6 -6
- package/dist/runtime/html/helpers/escape-quotes.js +2 -2
- package/dist/runtime/html/helpers/escape-xml.js +1 -1
- package/dist/runtime/html/helpers/props-script.js +1 -1
- package/dist/runtime/html/index.js +2 -2
- package/dist/runtime/renderable.js +5 -5
- package/dist/runtime/vdom/AsyncVDOMBuilder.js +96 -96
- package/dist/runtime/vdom/VComponent.js +5 -5
- package/dist/runtime/vdom/VDocumentFragment.js +7 -7
- package/dist/runtime/vdom/VElement.js +55 -51
- package/dist/runtime/vdom/VFragment.js +9 -9
- package/dist/runtime/vdom/VNode.js +22 -22
- package/dist/runtime/vdom/VText.js +4 -4
- package/dist/runtime/vdom/helpers/const-element.js +3 -3
- package/dist/runtime/vdom/hot-reload.js +19 -19
- package/dist/runtime/vdom/index.js +2 -2
- package/dist/runtime/vdom/morphdom/fragment.js +2 -2
- package/dist/runtime/vdom/morphdom/helpers.js +4 -4
- package/dist/runtime/vdom/morphdom/index.js +68 -68
- package/dist/runtime/vdom/vdom.js +12 -12
- package/package.json +3 -3
- package/src/core-tags/core/await/AsyncValue.js +1 -1
- package/src/node_modules/@internal/components-registry/index-browser.js +2 -2
- package/src/node_modules/@internal/set-immediate/index-browser.js +2 -0
- package/src/node_modules/@internal/set-immediate/index-worker.js +31 -2
- package/src/node_modules/@internal/set-immediate/index.js +1 -0
- package/src/node_modules/@internal/set-immediate/queueMicrotask.js +8 -0
- package/src/runtime/helpers/class-value.js +2 -5
- package/src/runtime/helpers/style-value.js +2 -2
- package/src/runtime/html/AsyncStream.js +4 -1
- package/src/runtime/vdom/VElement.js +15 -11
- package/src/runtime/vdom/hot-reload.js +2 -2
- package/dist/runtime/queueMicrotask.js +0 -14
- package/src/runtime/queueMicrotask.js +0 -14
@@ -3,20 +3,20 @@ var RenderResult = require("../RenderResult");
|
|
3
3
|
var attrsHelper = require("./helpers/attrs");
|
4
4
|
var morphdom = require("./morphdom");
|
5
5
|
var vdom = require("./vdom");
|
6
|
-
var VElement = vdom.
|
7
|
-
var VDocumentFragment = vdom.
|
8
|
-
var VText = vdom.
|
9
|
-
var VComponent = vdom.
|
10
|
-
var VFragment = vdom.
|
11
|
-
var virtualizeHTML = vdom.
|
6
|
+
var VElement = vdom.bw_;
|
7
|
+
var VDocumentFragment = vdom.bx_;
|
8
|
+
var VText = vdom.by_;
|
9
|
+
var VComponent = vdom.bz_;
|
10
|
+
var VFragment = vdom.bA_;
|
11
|
+
var virtualizeHTML = vdom.bB_;
|
12
12
|
|
13
13
|
var EVENT_UPDATE = "update";
|
14
14
|
var EVENT_FINISH = "finish";
|
15
15
|
|
16
16
|
function State(tree) {
|
17
|
-
this.
|
18
|
-
this.
|
19
|
-
this.
|
17
|
+
this.bC_ = new EventEmitter();
|
18
|
+
this.bD_ = tree;
|
19
|
+
this.bE_ = false;
|
20
20
|
}
|
21
21
|
|
22
22
|
function AsyncVDOMBuilder(globalData, parentNode, parentOut) {
|
@@ -27,49 +27,49 @@ function AsyncVDOMBuilder(globalData, parentNode, parentOut) {
|
|
27
27
|
var state;
|
28
28
|
|
29
29
|
if (parentOut) {
|
30
|
-
state = parentOut.
|
30
|
+
state = parentOut.z_;
|
31
31
|
} else {
|
32
32
|
state = new State(parentNode);
|
33
33
|
}
|
34
34
|
|
35
|
-
this.
|
36
|
-
this.
|
37
|
-
this.
|
38
|
-
this.
|
35
|
+
this.bF_ = 1;
|
36
|
+
this.bG_ = 0;
|
37
|
+
this.bH_ = null;
|
38
|
+
this.bI_ = parentOut;
|
39
39
|
|
40
40
|
this.data = {};
|
41
|
-
this.
|
42
|
-
this.
|
41
|
+
this.z_ = state;
|
42
|
+
this.aa_ = parentNode;
|
43
43
|
this.global = globalData || {};
|
44
|
-
this.
|
45
|
-
this.
|
46
|
-
this.
|
44
|
+
this.bJ_ = [parentNode];
|
45
|
+
this.bK_ = false;
|
46
|
+
this.bL_ = undefined;
|
47
47
|
this.b_ = null;
|
48
48
|
|
49
|
-
this.
|
50
|
-
this.
|
51
|
-
this.
|
49
|
+
this._Z_ = null;
|
50
|
+
this.a__ = null;
|
51
|
+
this.ba_ = null;
|
52
52
|
}
|
53
53
|
|
54
54
|
var proto = AsyncVDOMBuilder.prototype = {
|
55
|
-
|
56
|
-
|
55
|
+
bq_: true,
|
56
|
+
B_: typeof document === "object" && document,
|
57
57
|
|
58
58
|
bc: function (component, key, ownerComponent) {
|
59
59
|
var vComponent = new VComponent(component, key, ownerComponent);
|
60
|
-
return this.
|
60
|
+
return this.bM_(vComponent, 0, true);
|
61
61
|
},
|
62
62
|
|
63
|
-
|
63
|
+
bb_: function (component, key, ownerComponent) {
|
64
64
|
var vComponent = new VComponent(component, key, ownerComponent, true);
|
65
|
-
this.
|
65
|
+
this.bM_(vComponent, 0);
|
66
66
|
},
|
67
67
|
|
68
|
-
|
69
|
-
this.
|
68
|
+
bM_: function (child, childCount, pushToStack) {
|
69
|
+
this.aa_.bN_(child);
|
70
70
|
if (pushToStack === true) {
|
71
|
-
this.
|
72
|
-
this.
|
71
|
+
this.bJ_.push(child);
|
72
|
+
this.aa_ = child;
|
73
73
|
}
|
74
74
|
return childCount === 0 ? this : child;
|
75
75
|
},
|
@@ -84,15 +84,15 @@ var proto = AsyncVDOMBuilder.prototype = {
|
|
84
84
|
flags,
|
85
85
|
props
|
86
86
|
);
|
87
|
-
return this.
|
87
|
+
return this.bM_(element, childCount);
|
88
88
|
},
|
89
89
|
|
90
|
-
|
90
|
+
bk_: function (tagName, attrs, key, componentDef, props) {
|
91
91
|
return this.element(
|
92
92
|
tagName,
|
93
93
|
attrsHelper(attrs),
|
94
94
|
key,
|
95
|
-
componentDef.
|
95
|
+
componentDef.s_,
|
96
96
|
0,
|
97
97
|
0,
|
98
98
|
props
|
@@ -102,15 +102,15 @@ var proto = AsyncVDOMBuilder.prototype = {
|
|
102
102
|
n: function (node, component) {
|
103
103
|
// NOTE: We do a shallow clone since we assume the node is being reused
|
104
104
|
// and a node can only have one parent node.
|
105
|
-
var clone = node.
|
105
|
+
var clone = node.bO_();
|
106
106
|
this.node(clone);
|
107
|
-
clone.
|
107
|
+
clone._L_ = component;
|
108
108
|
|
109
109
|
return this;
|
110
110
|
},
|
111
111
|
|
112
112
|
node: function (node) {
|
113
|
-
this.
|
113
|
+
this.aa_.bN_(node);
|
114
114
|
return this;
|
115
115
|
},
|
116
116
|
|
@@ -129,7 +129,7 @@ var proto = AsyncVDOMBuilder.prototype = {
|
|
129
129
|
text = text.toString();
|
130
130
|
}
|
131
131
|
|
132
|
-
this.
|
132
|
+
this.aa_.bN_(new VText(text, ownerComponent));
|
133
133
|
return this;
|
134
134
|
},
|
135
135
|
|
@@ -160,16 +160,16 @@ var proto = AsyncVDOMBuilder.prototype = {
|
|
160
160
|
flags,
|
161
161
|
props
|
162
162
|
);
|
163
|
-
this.
|
163
|
+
this.bM_(element, childCount, true);
|
164
164
|
return this;
|
165
165
|
},
|
166
166
|
|
167
|
-
|
167
|
+
bi_: function (tagName, attrs, key, componentDef, props) {
|
168
168
|
return this.beginElement(
|
169
169
|
tagName,
|
170
170
|
attrsHelper(attrs),
|
171
171
|
key,
|
172
|
-
componentDef.
|
172
|
+
componentDef.s_,
|
173
173
|
0,
|
174
174
|
0,
|
175
175
|
props
|
@@ -178,7 +178,7 @@ var proto = AsyncVDOMBuilder.prototype = {
|
|
178
178
|
|
179
179
|
bf: function (key, component, preserve) {
|
180
180
|
var fragment = new VFragment(key, component, preserve);
|
181
|
-
this.
|
181
|
+
this.bM_(fragment, null, true);
|
182
182
|
return this;
|
183
183
|
},
|
184
184
|
|
@@ -187,52 +187,52 @@ var proto = AsyncVDOMBuilder.prototype = {
|
|
187
187
|
},
|
188
188
|
|
189
189
|
endElement: function () {
|
190
|
-
var stack = this.
|
190
|
+
var stack = this.bJ_;
|
191
191
|
stack.pop();
|
192
|
-
this.
|
192
|
+
this.aa_ = stack[stack.length - 1];
|
193
193
|
},
|
194
194
|
|
195
195
|
end: function () {
|
196
|
-
this.
|
196
|
+
this.aa_ = undefined;
|
197
197
|
|
198
|
-
var remaining = --this.
|
199
|
-
var parentOut = this.
|
198
|
+
var remaining = --this.bF_;
|
199
|
+
var parentOut = this.bI_;
|
200
200
|
|
201
201
|
if (remaining === 0) {
|
202
202
|
if (parentOut) {
|
203
|
-
parentOut.
|
203
|
+
parentOut.bP_();
|
204
204
|
} else {
|
205
|
-
this.
|
205
|
+
this.bQ_();
|
206
206
|
}
|
207
|
-
} else if (remaining - this.
|
208
|
-
this.
|
207
|
+
} else if (remaining - this.bG_ === 0) {
|
208
|
+
this.bR_();
|
209
209
|
}
|
210
210
|
|
211
211
|
return this;
|
212
212
|
},
|
213
213
|
|
214
|
-
|
215
|
-
var remaining = --this.
|
214
|
+
bP_: function () {
|
215
|
+
var remaining = --this.bF_;
|
216
216
|
|
217
217
|
if (remaining === 0) {
|
218
|
-
var parentOut = this.
|
218
|
+
var parentOut = this.bI_;
|
219
219
|
if (parentOut) {
|
220
|
-
parentOut.
|
220
|
+
parentOut.bP_();
|
221
221
|
} else {
|
222
|
-
this.
|
222
|
+
this.bQ_();
|
223
223
|
}
|
224
|
-
} else if (remaining - this.
|
225
|
-
this.
|
224
|
+
} else if (remaining - this.bG_ === 0) {
|
225
|
+
this.bR_();
|
226
226
|
}
|
227
227
|
},
|
228
228
|
|
229
|
-
|
230
|
-
var state = this.
|
231
|
-
state.
|
232
|
-
state.
|
229
|
+
bQ_: function () {
|
230
|
+
var state = this.z_;
|
231
|
+
state.bE_ = true;
|
232
|
+
state.bC_.emit(EVENT_FINISH, this.bs_());
|
233
233
|
},
|
234
234
|
|
235
|
-
|
235
|
+
bR_: function () {
|
236
236
|
var lastArray = this._last;
|
237
237
|
|
238
238
|
var i = 0;
|
@@ -267,26 +267,26 @@ var proto = AsyncVDOMBuilder.prototype = {
|
|
267
267
|
},
|
268
268
|
|
269
269
|
beginAsync: function (options) {
|
270
|
-
if (this.
|
270
|
+
if (this.bK_) {
|
271
271
|
throw Error(
|
272
272
|
"Tried to render async while in sync mode. Note: Client side await is not currently supported in re-renders (Issue: #942)."
|
273
273
|
);
|
274
274
|
}
|
275
275
|
|
276
|
-
var state = this.
|
276
|
+
var state = this.z_;
|
277
277
|
|
278
278
|
if (options) {
|
279
279
|
if (options.last) {
|
280
|
-
this.
|
280
|
+
this.bG_++;
|
281
281
|
}
|
282
282
|
}
|
283
283
|
|
284
|
-
this.
|
284
|
+
this.bF_++;
|
285
285
|
|
286
|
-
var documentFragment = this.
|
286
|
+
var documentFragment = this.aa_.bS_();
|
287
287
|
var asyncOut = new AsyncVDOMBuilder(this.global, documentFragment, this);
|
288
288
|
|
289
|
-
state.
|
289
|
+
state.bC_.emit("beginAsync", {
|
290
290
|
out: asyncOut,
|
291
291
|
parentOut: this
|
292
292
|
});
|
@@ -299,51 +299,51 @@ var proto = AsyncVDOMBuilder.prototype = {
|
|
299
299
|
},
|
300
300
|
|
301
301
|
flush: function () {
|
302
|
-
var events = this.
|
302
|
+
var events = this.z_.bC_;
|
303
303
|
|
304
304
|
if (events.listenerCount(EVENT_UPDATE)) {
|
305
305
|
events.emit(EVENT_UPDATE, new RenderResult(this));
|
306
306
|
}
|
307
307
|
},
|
308
308
|
|
309
|
-
|
310
|
-
return this.
|
309
|
+
ag_: function () {
|
310
|
+
return this.z_.bD_;
|
311
311
|
},
|
312
312
|
|
313
|
-
|
314
|
-
return this.
|
313
|
+
bs_: function () {
|
314
|
+
return this.bT_ || (this.bT_ = new RenderResult(this));
|
315
315
|
},
|
316
316
|
|
317
317
|
on: function (event, callback) {
|
318
|
-
var state = this.
|
318
|
+
var state = this.z_;
|
319
319
|
|
320
|
-
if (event === EVENT_FINISH && state.
|
321
|
-
callback(this.
|
320
|
+
if (event === EVENT_FINISH && state.bE_) {
|
321
|
+
callback(this.bs_());
|
322
322
|
} else if (event === "last") {
|
323
323
|
this.onLast(callback);
|
324
324
|
} else {
|
325
|
-
state.
|
325
|
+
state.bC_.on(event, callback);
|
326
326
|
}
|
327
327
|
|
328
328
|
return this;
|
329
329
|
},
|
330
330
|
|
331
331
|
once: function (event, callback) {
|
332
|
-
var state = this.
|
332
|
+
var state = this.z_;
|
333
333
|
|
334
|
-
if (event === EVENT_FINISH && state.
|
335
|
-
callback(this.
|
334
|
+
if (event === EVENT_FINISH && state.bE_) {
|
335
|
+
callback(this.bs_());
|
336
336
|
} else if (event === "last") {
|
337
337
|
this.onLast(callback);
|
338
338
|
} else {
|
339
|
-
state.
|
339
|
+
state.bC_.once(event, callback);
|
340
340
|
}
|
341
341
|
|
342
342
|
return this;
|
343
343
|
},
|
344
344
|
|
345
345
|
emit: function (type, arg) {
|
346
|
-
var events = this.
|
346
|
+
var events = this.z_.bC_;
|
347
347
|
switch (arguments.length) {
|
348
348
|
case 1:
|
349
349
|
events.emit(type);
|
@@ -359,17 +359,17 @@ var proto = AsyncVDOMBuilder.prototype = {
|
|
359
359
|
},
|
360
360
|
|
361
361
|
removeListener: function () {
|
362
|
-
var events = this.
|
362
|
+
var events = this.z_.bC_;
|
363
363
|
events.removeListener.apply(events, arguments);
|
364
364
|
return this;
|
365
365
|
},
|
366
366
|
|
367
367
|
sync: function () {
|
368
|
-
this.
|
368
|
+
this.bK_ = true;
|
369
369
|
},
|
370
370
|
|
371
371
|
isSync: function () {
|
372
|
-
return this.
|
372
|
+
return this.bK_;
|
373
373
|
},
|
374
374
|
|
375
375
|
onLast: function (callback) {
|
@@ -384,20 +384,20 @@ var proto = AsyncVDOMBuilder.prototype = {
|
|
384
384
|
return this;
|
385
385
|
},
|
386
386
|
|
387
|
-
|
388
|
-
var node = this.
|
387
|
+
af_: function (host) {
|
388
|
+
var node = this.bL_;
|
389
389
|
if (!node) {
|
390
|
-
var vdomTree = this.
|
390
|
+
var vdomTree = this.ag_();
|
391
391
|
|
392
|
-
if (!host) host = this.
|
393
|
-
this.
|
392
|
+
if (!host) host = this.B_;
|
393
|
+
this.bL_ = node = vdomTree.bm_(host, null);
|
394
394
|
morphdom(node, vdomTree, host, this.b_);
|
395
395
|
}
|
396
396
|
return node;
|
397
397
|
},
|
398
398
|
|
399
399
|
toString: function (host) {
|
400
|
-
var docFragment = this.
|
400
|
+
var docFragment = this.af_(host);
|
401
401
|
var html = "";
|
402
402
|
|
403
403
|
var child = docFragment.firstChild;
|
@@ -435,15 +435,15 @@ var proto = AsyncVDOMBuilder.prototype = {
|
|
435
435
|
isVDOM: true,
|
436
436
|
|
437
437
|
c: function (componentDef, key, customEvents) {
|
438
|
-
this.
|
439
|
-
this.
|
440
|
-
this.
|
438
|
+
this._Z_ = componentDef;
|
439
|
+
this.a__ = key;
|
440
|
+
this.ba_ = customEvents;
|
441
441
|
}
|
442
442
|
};
|
443
443
|
|
444
444
|
proto.e = proto.element;
|
445
445
|
proto.be = proto.beginElement;
|
446
|
-
proto.ee = proto.
|
446
|
+
proto.ee = proto.bj_ = proto.endElement;
|
447
447
|
proto.t = proto.text;
|
448
448
|
proto.h = proto.w = proto.write = proto.html;
|
449
449
|
|
@@ -2,14 +2,14 @@
|
|
2
2
|
var VNode = require("./VNode");
|
3
3
|
|
4
4
|
function VComponent(component, key, ownerComponent, preserve) {
|
5
|
-
this.
|
6
|
-
this.
|
7
|
-
this.
|
8
|
-
this.
|
5
|
+
this.bU_(null /* childCount */, ownerComponent);
|
6
|
+
this.bV_ = key;
|
7
|
+
this.s_ = component;
|
8
|
+
this.ac_ = preserve;
|
9
9
|
}
|
10
10
|
|
11
11
|
VComponent.prototype = {
|
12
|
-
|
12
|
+
bW_: 2
|
13
13
|
};
|
14
14
|
|
15
15
|
inherit(VComponent, VNode);
|
@@ -4,25 +4,25 @@ var VNode = require("./VNode");
|
|
4
4
|
|
5
5
|
function VDocumentFragmentClone(other) {
|
6
6
|
extend(this, other);
|
7
|
-
this.bW_ = null;
|
8
7
|
this.bX_ = null;
|
8
|
+
this.bY_ = null;
|
9
9
|
}
|
10
10
|
|
11
11
|
function VDocumentFragment(out) {
|
12
|
-
this.
|
13
|
-
this.
|
12
|
+
this.bU_(null /* childCount */);
|
13
|
+
this.r_ = out;
|
14
14
|
}
|
15
15
|
|
16
16
|
VDocumentFragment.prototype = {
|
17
|
-
|
17
|
+
bW_: 11,
|
18
18
|
|
19
|
-
|
19
|
+
bZ_: true,
|
20
20
|
|
21
|
-
|
21
|
+
bO_: function () {
|
22
22
|
return new VDocumentFragmentClone(this);
|
23
23
|
},
|
24
24
|
|
25
|
-
|
25
|
+
bm_: function (host) {
|
26
26
|
return (host.ownerDocument || host).createDocumentFragment();
|
27
27
|
}
|
28
28
|
};
|