marko 5.35.7 → 5.35.8
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/bin/markoc.js +0 -2
- package/dist/compiler/index.js +2 -0
- package/dist/core-tags/core/await/AsyncValue.js +1 -0
- package/dist/core-tags/core/await/renderer.js +1 -0
- package/dist/node-require/hot-reload.js +1 -3
- package/dist/node-require/index.js +1 -1
- package/dist/node_modules/@internal/components-define-widget-legacy/index-browser.js +4 -2
- package/dist/node_modules/@internal/components-entry/index.js +13 -13
- package/dist/node_modules/@internal/components-entry-legacy/index-browser.js +4 -3
- package/dist/node_modules/@internal/components-registry/index-browser.js +40 -36
- package/dist/node_modules/@internal/components-registry/index.js +2 -2
- package/dist/node_modules/@internal/components-util/index-browser.js +16 -16
- package/dist/node_modules/@internal/components-util/index.js +7 -7
- package/dist/node_modules/@internal/create-readable/index-browser.js +2 -2
- package/dist/node_modules/@internal/create-readable/index.js +9 -9
- package/dist/node_modules/@internal/preserve-tag/index-browser.js +5 -5
- package/dist/node_modules/@internal/preserve-tag/index.js +1 -1
- package/dist/node_modules/@internal/require/index-webpack.js +1 -0
- package/dist/node_modules/@internal/set-immediate/index-browser.js +1 -1
- package/dist/node_modules/@internal/set-immediate/index-worker.js +2 -2
- package/dist/node_modules/@internal/set-immediate/index.js +2 -2
- package/dist/runtime/RenderResult.js +4 -3
- package/dist/runtime/components/Component.js +107 -106
- package/dist/runtime/components/ComponentDef.js +25 -25
- package/dist/runtime/components/ComponentsContext.js +6 -6
- package/dist/runtime/components/GlobalComponentsContext.js +3 -3
- package/dist/runtime/components/KeySequence.js +3 -3
- package/dist/runtime/components/ServerComponent.js +8 -7
- package/dist/runtime/components/State.js +20 -24
- package/dist/runtime/components/attach-detach.js +7 -7
- package/dist/runtime/components/defineComponent.js +0 -1
- package/dist/runtime/components/dom-data.js +5 -5
- package/dist/runtime/components/event-delegation.js +10 -10
- package/dist/runtime/components/legacy/defineRenderer-legacy.js +14 -13
- package/dist/runtime/components/legacy/dependencies/index.js +9 -10
- package/dist/runtime/components/legacy/jquery.js +1 -0
- package/dist/runtime/components/legacy/renderer-legacy.js +33 -32
- package/dist/runtime/components/renderer.js +29 -29
- 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/dynamic-tag.js +18 -13
- package/dist/runtime/helpers/render-tag.js +1 -1
- package/dist/runtime/helpers/serialize-noop.js +5 -0
- package/dist/runtime/helpers/style-value.js +1 -1
- package/dist/runtime/helpers/tags-compat/dom-debug.mjs +1 -0
- package/dist/runtime/helpers/tags-compat/dom.mjs +1 -0
- package/dist/runtime/helpers/tags-compat/html-debug.js +1 -1
- package/dist/runtime/helpers/tags-compat/html-debug.mjs +3 -2
- package/dist/runtime/helpers/tags-compat/html.js +3 -1
- package/dist/runtime/helpers/tags-compat/html.mjs +3 -2
- package/dist/runtime/helpers/tags-compat/runtime-dom.js +38 -35
- package/dist/runtime/helpers/tags-compat/runtime-html.js +24 -65
- package/dist/runtime/html/AsyncStream.js +25 -24
- package/dist/runtime/html/BufferedWriter.js +2 -2
- package/dist/runtime/html/helpers/_dynamic-attr.js +2 -2
- package/dist/runtime/html/helpers/attr.js +4 -3
- package/dist/runtime/html/helpers/attrs.js +1 -0
- package/dist/runtime/html/helpers/data-marko.js +2 -3
- package/dist/runtime/html/helpers/escape-quotes.js +1 -1
- package/dist/runtime/html/helpers/escape-xml.js +1 -1
- package/dist/runtime/html/helpers/merge-attrs.js +1 -0
- package/dist/runtime/html/index.js +1 -1
- package/dist/runtime/renderable.js +5 -5
- package/dist/runtime/vdom/AsyncVDOMBuilder.js +86 -85
- package/dist/runtime/vdom/VComponent.js +4 -4
- package/dist/runtime/vdom/VDocumentFragment.js +7 -7
- package/dist/runtime/vdom/VElement.js +41 -42
- package/dist/runtime/vdom/VFragment.js +9 -9
- package/dist/runtime/vdom/VNode.js +34 -35
- package/dist/runtime/vdom/VText.js +8 -8
- package/dist/runtime/vdom/helpers/attrs.js +1 -0
- package/dist/runtime/vdom/helpers/const-element.js +3 -3
- package/dist/runtime/vdom/hot-reload.js +14 -14
- package/dist/runtime/vdom/index.js +1 -1
- package/dist/runtime/vdom/morphdom/fragment.js +5 -5
- package/dist/runtime/vdom/morphdom/helpers.js +5 -5
- package/dist/runtime/vdom/morphdom/index.js +67 -68
- package/dist/runtime/vdom/vdom.js +14 -14
- package/dist/taglib/index.js +1 -0
- package/index.d.ts +1 -5
- package/package.json +2 -2
- package/src/compiler/index.js +2 -0
- package/src/core-tags/core/await/AsyncValue.js +1 -0
- package/src/core-tags/core/await/renderer.js +1 -0
- package/src/node-require/hot-reload.js +0 -2
- package/src/node-require/index.js +1 -1
- package/src/node_modules/@internal/components-define-widget-legacy/index-browser.js +4 -2
- package/src/node_modules/@internal/components-entry/index.js +2 -2
- package/src/node_modules/@internal/components-entry-legacy/index-browser.js +1 -0
- package/src/node_modules/@internal/components-registry/index-browser.js +8 -4
- package/src/node_modules/@internal/components-util/index-browser.js +1 -1
- package/src/node_modules/@internal/create-readable/index-browser.js +1 -1
- package/src/node_modules/@internal/require/index-webpack.js +1 -0
- package/src/runtime/RenderResult.js +1 -0
- package/src/runtime/components/Component.js +2 -1
- package/src/runtime/components/ComponentDef.js +4 -4
- package/src/runtime/components/ServerComponent.js +1 -0
- package/src/runtime/components/State.js +6 -10
- package/src/runtime/components/defineComponent.js +0 -1
- package/src/runtime/components/legacy/defineRenderer-legacy.js +1 -0
- package/src/runtime/components/legacy/dependencies/index.js +0 -1
- package/src/runtime/components/legacy/jquery.js +1 -0
- package/src/runtime/components/legacy/renderer-legacy.js +1 -0
- package/src/runtime/helpers/dynamic-tag.js +11 -6
- package/src/runtime/helpers/serialize-noop.js +5 -0
- package/src/runtime/helpers/tags-compat/dom-debug.mjs +1 -0
- package/src/runtime/helpers/tags-compat/dom.mjs +1 -0
- package/src/runtime/helpers/tags-compat/html-debug.js +1 -1
- package/src/runtime/helpers/tags-compat/html-debug.mjs +3 -2
- package/src/runtime/helpers/tags-compat/html.js +3 -1
- package/src/runtime/helpers/tags-compat/html.mjs +3 -2
- package/src/runtime/helpers/tags-compat/runtime-dom.js +23 -20
- package/src/runtime/helpers/tags-compat/runtime-html.js +18 -59
- package/src/runtime/html/AsyncStream.js +1 -0
- package/src/runtime/html/helpers/attr.js +1 -0
- package/src/runtime/html/helpers/attrs.js +1 -0
- package/src/runtime/html/helpers/data-marko.js +0 -1
- package/src/runtime/html/helpers/merge-attrs.js +1 -0
- package/src/runtime/vdom/AsyncVDOMBuilder.js +1 -0
- package/src/runtime/vdom/VElement.js +1 -2
- package/src/runtime/vdom/VNode.js +0 -1
- package/src/runtime/vdom/helpers/attrs.js +1 -0
- package/src/runtime/vdom/morphdom/index.js +0 -1
- package/src/taglib/index.js +1 -0
- package/tags-html.d.ts +7 -9
|
@@ -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.bz_;
|
|
7
|
+
var VDocumentFragment = vdom.bA_;
|
|
8
|
+
var VText = vdom.bB_;
|
|
9
|
+
var VComponent = vdom.bC_;
|
|
10
|
+
var VFragment = vdom.bD_;
|
|
11
|
+
var virtualizeHTML = vdom.bE_;
|
|
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.bF_ = new EventEmitter();
|
|
18
|
+
this.bG_ = tree;
|
|
19
|
+
this.bH_ = false;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
function AsyncVDOMBuilder(globalData, parentNode, parentOut) {
|
|
@@ -32,44 +32,44 @@ function AsyncVDOMBuilder(globalData, parentNode, parentOut) {
|
|
|
32
32
|
state = new State(parentNode);
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
this.
|
|
36
|
-
this.
|
|
37
|
-
this.
|
|
38
|
-
this.
|
|
35
|
+
this.bI_ = 1;
|
|
36
|
+
this.bJ_ = 0;
|
|
37
|
+
this.bK_ = null;
|
|
38
|
+
this.bL_ = parentOut;
|
|
39
39
|
|
|
40
40
|
this.data = {};
|
|
41
41
|
this.z_ = state;
|
|
42
|
-
this.
|
|
42
|
+
this.ab_ = parentNode;
|
|
43
43
|
this.global = globalData || {};
|
|
44
|
-
this.
|
|
45
|
-
this.
|
|
46
|
-
this.
|
|
44
|
+
this.bM_ = [parentNode];
|
|
45
|
+
this.bN_ = false;
|
|
46
|
+
this.bO_ = undefined;
|
|
47
47
|
this.b_ = null;
|
|
48
48
|
|
|
49
|
-
this._Z_ = null;
|
|
50
49
|
this.a__ = null;
|
|
51
|
-
this.
|
|
50
|
+
this.aa_ = null;
|
|
51
|
+
this.bc_ = null;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
var proto = AsyncVDOMBuilder.prototype = {
|
|
55
|
-
|
|
55
|
+
bt_: true,
|
|
56
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.bP_(vComponent, 0, true);
|
|
61
61
|
},
|
|
62
62
|
|
|
63
|
-
|
|
63
|
+
bd_: function (component, key, ownerComponent) {
|
|
64
64
|
var vComponent = new VComponent(component, key, ownerComponent, true);
|
|
65
|
-
this.
|
|
65
|
+
this.bP_(vComponent, 0);
|
|
66
66
|
},
|
|
67
67
|
|
|
68
|
-
|
|
69
|
-
this.
|
|
68
|
+
bP_: function (child, childCount, pushToStack) {
|
|
69
|
+
this.ab_.bQ_(child);
|
|
70
70
|
if (pushToStack === true) {
|
|
71
|
-
this.
|
|
72
|
-
this.
|
|
71
|
+
this.bM_.push(child);
|
|
72
|
+
this.ab_ = child;
|
|
73
73
|
}
|
|
74
74
|
return childCount === 0 ? this : child;
|
|
75
75
|
},
|
|
@@ -84,10 +84,10 @@ var proto = AsyncVDOMBuilder.prototype = {
|
|
|
84
84
|
flags,
|
|
85
85
|
props
|
|
86
86
|
);
|
|
87
|
-
return this.
|
|
87
|
+
return this.bP_(element, childCount);
|
|
88
88
|
},
|
|
89
89
|
|
|
90
|
-
|
|
90
|
+
bm_: function (tagName, attrs, key, componentDef, props) {
|
|
91
91
|
return this.element(
|
|
92
92
|
tagName,
|
|
93
93
|
attrsHelper(attrs),
|
|
@@ -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.bR_();
|
|
106
106
|
this.node(clone);
|
|
107
|
-
clone.
|
|
107
|
+
clone._M_ = component;
|
|
108
108
|
|
|
109
109
|
return this;
|
|
110
110
|
},
|
|
111
111
|
|
|
112
112
|
node: function (node) {
|
|
113
|
-
this.
|
|
113
|
+
this.ab_.bQ_(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.ab_.bQ_(new VText(text, ownerComponent));
|
|
133
133
|
return this;
|
|
134
134
|
},
|
|
135
135
|
|
|
@@ -160,11 +160,11 @@ var proto = AsyncVDOMBuilder.prototype = {
|
|
|
160
160
|
flags,
|
|
161
161
|
props
|
|
162
162
|
);
|
|
163
|
-
this.
|
|
163
|
+
this.bP_(element, childCount, true);
|
|
164
164
|
return this;
|
|
165
165
|
},
|
|
166
166
|
|
|
167
|
-
|
|
167
|
+
bk_: function (tagName, attrs, key, componentDef, props) {
|
|
168
168
|
return this.beginElement(
|
|
169
169
|
tagName,
|
|
170
170
|
attrsHelper(attrs),
|
|
@@ -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.bP_(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.bM_;
|
|
191
191
|
stack.pop();
|
|
192
|
-
this.
|
|
192
|
+
this.ab_ = stack[stack.length - 1];
|
|
193
193
|
},
|
|
194
194
|
|
|
195
195
|
end: function () {
|
|
196
|
-
this.
|
|
196
|
+
this.ab_ = undefined;
|
|
197
197
|
|
|
198
|
-
var remaining = --this.
|
|
199
|
-
var parentOut = this.
|
|
198
|
+
var remaining = --this.bI_;
|
|
199
|
+
var parentOut = this.bL_;
|
|
200
200
|
|
|
201
201
|
if (remaining === 0) {
|
|
202
202
|
if (parentOut) {
|
|
203
|
-
parentOut.
|
|
203
|
+
parentOut.bS_();
|
|
204
204
|
} else {
|
|
205
|
-
this.
|
|
205
|
+
this.bT_();
|
|
206
206
|
}
|
|
207
|
-
} else if (remaining - this.
|
|
208
|
-
this.
|
|
207
|
+
} else if (remaining - this.bJ_ === 0) {
|
|
208
|
+
this.bU_();
|
|
209
209
|
}
|
|
210
210
|
|
|
211
211
|
return this;
|
|
212
212
|
},
|
|
213
213
|
|
|
214
|
-
|
|
215
|
-
var remaining = --this.
|
|
214
|
+
bS_: function () {
|
|
215
|
+
var remaining = --this.bI_;
|
|
216
216
|
|
|
217
217
|
if (remaining === 0) {
|
|
218
|
-
var parentOut = this.
|
|
218
|
+
var parentOut = this.bL_;
|
|
219
219
|
if (parentOut) {
|
|
220
|
-
parentOut.
|
|
220
|
+
parentOut.bS_();
|
|
221
221
|
} else {
|
|
222
|
-
this.
|
|
222
|
+
this.bT_();
|
|
223
223
|
}
|
|
224
|
-
} else if (remaining - this.
|
|
225
|
-
this.
|
|
224
|
+
} else if (remaining - this.bJ_ === 0) {
|
|
225
|
+
this.bU_();
|
|
226
226
|
}
|
|
227
227
|
},
|
|
228
228
|
|
|
229
|
-
|
|
229
|
+
bT_: function () {
|
|
230
230
|
var state = this.z_;
|
|
231
|
-
state.
|
|
232
|
-
state.
|
|
231
|
+
state.bH_ = true;
|
|
232
|
+
state.bF_.emit(EVENT_FINISH, this.bv_());
|
|
233
233
|
},
|
|
234
234
|
|
|
235
|
-
|
|
235
|
+
bU_: function () {
|
|
236
236
|
var lastArray = this._last;
|
|
237
237
|
|
|
238
238
|
var i = 0;
|
|
@@ -267,7 +267,7 @@ var proto = AsyncVDOMBuilder.prototype = {
|
|
|
267
267
|
},
|
|
268
268
|
|
|
269
269
|
beginAsync: function (options) {
|
|
270
|
-
if (this.
|
|
270
|
+
if (this.bN_) {
|
|
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
|
);
|
|
@@ -277,16 +277,16 @@ var proto = AsyncVDOMBuilder.prototype = {
|
|
|
277
277
|
|
|
278
278
|
if (options) {
|
|
279
279
|
if (options.last) {
|
|
280
|
-
this.
|
|
280
|
+
this.bJ_++;
|
|
281
281
|
}
|
|
282
282
|
}
|
|
283
283
|
|
|
284
|
-
this.
|
|
284
|
+
this.bI_++;
|
|
285
285
|
|
|
286
|
-
var documentFragment = this.
|
|
286
|
+
var documentFragment = this.ab_.bV_();
|
|
287
287
|
var asyncOut = new AsyncVDOMBuilder(this.global, documentFragment, this);
|
|
288
288
|
|
|
289
|
-
state.
|
|
289
|
+
state.bF_.emit("beginAsync", {
|
|
290
290
|
out: asyncOut,
|
|
291
291
|
parentOut: this
|
|
292
292
|
});
|
|
@@ -299,30 +299,30 @@ var proto = AsyncVDOMBuilder.prototype = {
|
|
|
299
299
|
},
|
|
300
300
|
|
|
301
301
|
flush: function () {
|
|
302
|
-
var events = this.z_.
|
|
302
|
+
var events = this.z_.bF_;
|
|
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.z_.
|
|
309
|
+
ah_: function () {
|
|
310
|
+
return this.z_.bG_;
|
|
311
311
|
},
|
|
312
312
|
|
|
313
|
-
|
|
314
|
-
return this.
|
|
313
|
+
bv_: function () {
|
|
314
|
+
return this.bW_ || (this.bW_ = new RenderResult(this));
|
|
315
315
|
},
|
|
316
316
|
|
|
317
317
|
on: function (event, callback) {
|
|
318
318
|
var state = this.z_;
|
|
319
319
|
|
|
320
|
-
if (event === EVENT_FINISH && state.
|
|
321
|
-
callback(this.
|
|
320
|
+
if (event === EVENT_FINISH && state.bH_) {
|
|
321
|
+
callback(this.bv_());
|
|
322
322
|
} else if (event === "last") {
|
|
323
323
|
this.onLast(callback);
|
|
324
324
|
} else {
|
|
325
|
-
state.
|
|
325
|
+
state.bF_.on(event, callback);
|
|
326
326
|
}
|
|
327
327
|
|
|
328
328
|
return this;
|
|
@@ -331,19 +331,19 @@ var proto = AsyncVDOMBuilder.prototype = {
|
|
|
331
331
|
once: function (event, callback) {
|
|
332
332
|
var state = this.z_;
|
|
333
333
|
|
|
334
|
-
if (event === EVENT_FINISH && state.
|
|
335
|
-
callback(this.
|
|
334
|
+
if (event === EVENT_FINISH && state.bH_) {
|
|
335
|
+
callback(this.bv_());
|
|
336
336
|
} else if (event === "last") {
|
|
337
337
|
this.onLast(callback);
|
|
338
338
|
} else {
|
|
339
|
-
state.
|
|
339
|
+
state.bF_.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.z_.
|
|
346
|
+
var events = this.z_.bF_;
|
|
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.z_.
|
|
362
|
+
var events = this.z_.bF_;
|
|
363
363
|
events.removeListener.apply(events, arguments);
|
|
364
364
|
return this;
|
|
365
365
|
},
|
|
366
366
|
|
|
367
367
|
sync: function () {
|
|
368
|
-
this.
|
|
368
|
+
this.bN_ = true;
|
|
369
369
|
},
|
|
370
370
|
|
|
371
371
|
isSync: function () {
|
|
372
|
-
return this.
|
|
372
|
+
return this.bN_;
|
|
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
|
+
ag_: function (host) {
|
|
388
|
+
var node = this.bO_;
|
|
389
389
|
if (!node) {
|
|
390
|
-
var vdomTree = this.
|
|
390
|
+
var vdomTree = this.ah_();
|
|
391
391
|
|
|
392
392
|
if (!host) host = this.B_;
|
|
393
|
-
this.
|
|
393
|
+
this.bO_ = node = vdomTree.bo_(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.ag_(host);
|
|
401
401
|
var html = "";
|
|
402
402
|
|
|
403
403
|
var child = docFragment.firstChild;
|
|
@@ -418,6 +418,7 @@ var proto = AsyncVDOMBuilder.prototype = {
|
|
|
418
418
|
},
|
|
419
419
|
|
|
420
420
|
then: function (fn, fnErr) {
|
|
421
|
+
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
421
422
|
var out = this;
|
|
422
423
|
var promise = new Promise(function (resolve, reject) {
|
|
423
424
|
out.on("error", reject).on(EVENT_FINISH, function (result) {
|
|
@@ -435,15 +436,15 @@ var proto = AsyncVDOMBuilder.prototype = {
|
|
|
435
436
|
isVDOM: true,
|
|
436
437
|
|
|
437
438
|
c: function (componentDef, key, customEvents) {
|
|
438
|
-
this.
|
|
439
|
-
this.
|
|
440
|
-
this.
|
|
439
|
+
this.a__ = componentDef;
|
|
440
|
+
this.aa_ = key;
|
|
441
|
+
this.bc_ = customEvents;
|
|
441
442
|
}
|
|
442
443
|
};
|
|
443
444
|
|
|
444
445
|
proto.e = proto.element;
|
|
445
446
|
proto.be = proto.beginElement;
|
|
446
|
-
proto.ee = proto.
|
|
447
|
+
proto.ee = proto.bl_ = proto.endElement;
|
|
447
448
|
proto.t = proto.text;
|
|
448
449
|
proto.h = proto.w = proto.write = proto.html;
|
|
449
450
|
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
var VNode = require("./VNode");
|
|
3
3
|
|
|
4
4
|
function VComponent(component, key, ownerComponent, preserve) {
|
|
5
|
-
this.
|
|
6
|
-
this.
|
|
5
|
+
this.bX_(null /* childCount */, ownerComponent);
|
|
6
|
+
this.bY_ = key;
|
|
7
7
|
this.s_ = component;
|
|
8
|
-
this.
|
|
8
|
+
this.ad_ = preserve;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
VComponent.prototype = {
|
|
12
|
-
|
|
12
|
+
bZ_: 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.
|
|
8
|
-
this.
|
|
7
|
+
this.c__ = null;
|
|
8
|
+
this.ca_ = null;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
function VDocumentFragment(out) {
|
|
12
|
-
this.
|
|
12
|
+
this.bX_(null /* childCount */);
|
|
13
13
|
this.r_ = out;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
VDocumentFragment.prototype = {
|
|
17
|
-
|
|
17
|
+
bZ_: 11,
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
cb_: true,
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
bR_: function () {
|
|
22
22
|
return new VDocumentFragmentClone(this);
|
|
23
23
|
},
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
bo_: function (host) {
|
|
26
26
|
return (host.ownerDocument || host).createDocumentFragment();
|
|
27
27
|
}
|
|
28
28
|
};
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
1
|
+
"use strict"; // eslint-disable-next-line no-constant-binary-expression
|
|
3
2
|
|
|
4
3
|
var inherit = require("raptor-util/inherit");
|
|
5
4
|
var componentsUtil = require("@internal/components-util");
|
|
6
5
|
var domData = require("../components/dom-data");
|
|
7
|
-
var vElementByDOMNode = domData.
|
|
6
|
+
var vElementByDOMNode = domData._K_;
|
|
8
7
|
var VNode = require("./VNode");
|
|
9
8
|
var ATTR_XLINK_HREF = "xlink:href";
|
|
10
9
|
var xmlnsRegExp = /^xmlns(:|$)/;
|
|
@@ -81,17 +80,17 @@ function assign(a, b) {
|
|
|
81
80
|
}
|
|
82
81
|
|
|
83
82
|
function VElementClone(other) {
|
|
84
|
-
this.c__ = other.c__;
|
|
85
|
-
this.bX_ = null;
|
|
86
|
-
this.bY_ = null;
|
|
87
|
-
|
|
88
|
-
this.bV_ = other.bV_;
|
|
89
|
-
this.ca_ = other.ca_;
|
|
90
|
-
this._N_ = other._N_;
|
|
91
|
-
this.cb_ = other.cb_;
|
|
92
|
-
this.u_ = other.u_;
|
|
93
83
|
this.cc_ = other.cc_;
|
|
84
|
+
this.c__ = null;
|
|
85
|
+
this.ca_ = null;
|
|
86
|
+
|
|
87
|
+
this.bY_ = other.bY_;
|
|
94
88
|
this.cd_ = other.cd_;
|
|
89
|
+
this._O_ = other._O_;
|
|
90
|
+
this.ce_ = other.ce_;
|
|
91
|
+
this.u_ = other.u_;
|
|
92
|
+
this.cf_ = other.cf_;
|
|
93
|
+
this.cg_ = other.cg_;
|
|
95
94
|
}
|
|
96
95
|
|
|
97
96
|
function VElement(
|
|
@@ -103,7 +102,7 @@ childCount,
|
|
|
103
102
|
flags,
|
|
104
103
|
props)
|
|
105
104
|
{
|
|
106
|
-
this.
|
|
105
|
+
this.bX_(childCount, ownerComponent);
|
|
107
106
|
|
|
108
107
|
var constId;
|
|
109
108
|
|
|
@@ -111,21 +110,21 @@ props)
|
|
|
111
110
|
constId = props.i;
|
|
112
111
|
}
|
|
113
112
|
|
|
114
|
-
this.
|
|
113
|
+
this.bY_ = key;
|
|
115
114
|
this.u_ = flags || 0;
|
|
116
|
-
this.
|
|
117
|
-
this.
|
|
118
|
-
this.
|
|
119
|
-
this.
|
|
120
|
-
this.
|
|
115
|
+
this.cd_ = attrs || EMPTY_OBJECT;
|
|
116
|
+
this._O_ = props || EMPTY_OBJECT;
|
|
117
|
+
this.ce_ = tagName;
|
|
118
|
+
this.cf_ = "";
|
|
119
|
+
this.cg_ = constId;
|
|
120
|
+
this.ad_ = false;
|
|
121
121
|
this.ac_ = false;
|
|
122
|
-
this.ab_ = false;
|
|
123
122
|
}
|
|
124
123
|
|
|
125
124
|
VElement.prototype = {
|
|
126
|
-
|
|
125
|
+
bZ_: 1,
|
|
127
126
|
|
|
128
|
-
|
|
127
|
+
bR_: function () {
|
|
129
128
|
return new VElementClone(this);
|
|
130
129
|
},
|
|
131
130
|
|
|
@@ -137,7 +136,7 @@ VElement.prototype = {
|
|
|
137
136
|
* @param {int|null} childCount The number of child nodes (or `null` if not known)
|
|
138
137
|
*/
|
|
139
138
|
e: function (tagName, attrs, key, ownerComponent, childCount, flags, props) {
|
|
140
|
-
var child = this.
|
|
139
|
+
var child = this.bQ_(
|
|
141
140
|
new VElement(
|
|
142
141
|
tagName,
|
|
143
142
|
attrs,
|
|
@@ -150,7 +149,7 @@ VElement.prototype = {
|
|
|
150
149
|
);
|
|
151
150
|
|
|
152
151
|
if (childCount === 0) {
|
|
153
|
-
return this.
|
|
152
|
+
return this.ch_();
|
|
154
153
|
} else {
|
|
155
154
|
return child;
|
|
156
155
|
}
|
|
@@ -163,15 +162,15 @@ VElement.prototype = {
|
|
|
163
162
|
* @param {String} value The value for the new Comment node
|
|
164
163
|
*/
|
|
165
164
|
n: function (node, ownerComponent) {
|
|
166
|
-
node = node.
|
|
167
|
-
node.
|
|
168
|
-
this.
|
|
169
|
-
return this.
|
|
165
|
+
node = node.bR_();
|
|
166
|
+
node._M_ = ownerComponent;
|
|
167
|
+
this.bQ_(node);
|
|
168
|
+
return this.ch_();
|
|
170
169
|
},
|
|
171
170
|
|
|
172
|
-
|
|
173
|
-
var tagName = this.
|
|
174
|
-
var attributes = this.
|
|
171
|
+
bo_: function (host, parentNamespaceURI) {
|
|
172
|
+
var tagName = this.ce_;
|
|
173
|
+
var attributes = this.cd_;
|
|
175
174
|
var namespaceURI = DEFAULT_NS[tagName] || parentNamespaceURI || NS_HTML;
|
|
176
175
|
|
|
177
176
|
var flags = this.u_;
|
|
@@ -196,7 +195,7 @@ VElement.prototype = {
|
|
|
196
195
|
}
|
|
197
196
|
|
|
198
197
|
if (tagName === "textarea") {
|
|
199
|
-
el.defaultValue = this.
|
|
198
|
+
el.defaultValue = this.cf_;
|
|
200
199
|
}
|
|
201
200
|
}
|
|
202
201
|
|
|
@@ -224,7 +223,7 @@ function virtualizeElement(node, virtualizeChildNodes, ownerComponent) {
|
|
|
224
223
|
var attrName = attr.name;
|
|
225
224
|
if (!xmlnsRegExp.test(attrName)) {
|
|
226
225
|
if (attrName === "data-marko") {
|
|
227
|
-
props = componentsUtil.
|
|
226
|
+
props = componentsUtil._r_(node);
|
|
228
227
|
} else if (attr.namespaceURI === NS_XLINK) {
|
|
229
228
|
attrs[ATTR_XLINK_HREF] = attr.value;
|
|
230
229
|
} else {
|
|
@@ -250,8 +249,8 @@ function virtualizeElement(node, virtualizeChildNodes, ownerComponent) {
|
|
|
250
249
|
props
|
|
251
250
|
);
|
|
252
251
|
|
|
253
|
-
if (vdomEl.
|
|
254
|
-
vdomEl.
|
|
252
|
+
if (vdomEl.ce_ === "textarea") {
|
|
253
|
+
vdomEl.cf_ = node.value;
|
|
255
254
|
} else if (virtualizeChildNodes) {
|
|
256
255
|
virtualizeChildNodes(node, vdomEl, ownerComponent);
|
|
257
256
|
}
|
|
@@ -259,18 +258,18 @@ function virtualizeElement(node, virtualizeChildNodes, ownerComponent) {
|
|
|
259
258
|
return vdomEl;
|
|
260
259
|
}
|
|
261
260
|
|
|
262
|
-
VElement.
|
|
261
|
+
VElement.ci_ = virtualizeElement;
|
|
263
262
|
|
|
264
|
-
VElement.
|
|
263
|
+
VElement.cj_ = function (fromEl, vFromEl, toEl) {
|
|
265
264
|
var fromFlags = vFromEl.u_;
|
|
266
265
|
var toFlags = toEl.u_;
|
|
267
|
-
var attrs = toEl.
|
|
266
|
+
var attrs = toEl.cd_;
|
|
268
267
|
|
|
269
268
|
if (toFlags & FLAG_CUSTOM_ELEMENT) {
|
|
270
269
|
return assign(fromEl, attrs);
|
|
271
270
|
}
|
|
272
271
|
|
|
273
|
-
var props = toEl.
|
|
272
|
+
var props = toEl._O_;
|
|
274
273
|
var attrName;
|
|
275
274
|
|
|
276
275
|
// We use expando properties to associate the previous HTML
|
|
@@ -281,7 +280,7 @@ VElement.cg_ = function (fromEl, vFromEl, toEl) {
|
|
|
281
280
|
// real VElement node will not have the expando property
|
|
282
281
|
// so we build the attribute map from the expando property
|
|
283
282
|
|
|
284
|
-
var oldAttrs = vFromEl.
|
|
283
|
+
var oldAttrs = vFromEl.cd_;
|
|
285
284
|
|
|
286
285
|
if (oldAttrs === attrs) {
|
|
287
286
|
// For constant attributes the same object will be provided
|
|
@@ -319,7 +318,7 @@ VElement.cg_ = function (fromEl, vFromEl, toEl) {
|
|
|
319
318
|
}
|
|
320
319
|
|
|
321
320
|
var preserve = props && props.pa || EMPTY_OBJECT;
|
|
322
|
-
var specialAttrs = specialElHandlers[toEl.
|
|
321
|
+
var specialAttrs = specialElHandlers[toEl.ce_] || EMPTY_OBJECT;
|
|
323
322
|
var specialAttr;
|
|
324
323
|
|
|
325
324
|
// Loop over all of the attributes in the attribute map and compare
|
|
@@ -357,7 +356,7 @@ VElement.cg_ = function (fromEl, vFromEl, toEl) {
|
|
|
357
356
|
// was not a virtualized node (i.e., a node that was not rendered by a
|
|
358
357
|
// Marko template, but rather a node that was created from an HTML
|
|
359
358
|
// string or a real DOM node).
|
|
360
|
-
if (toEl.
|
|
359
|
+
if (toEl.bY_ === null || fromFlags & FLAG_SPREAD_ATTRS) {
|
|
361
360
|
for (attrName in oldAttrs) {
|
|
362
361
|
if (!(attrName in attrs)) {
|
|
363
362
|
if (specialAttr = specialAttrs[attrName]) {
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
"use strict";var inherit = require("raptor-util/inherit");
|
|
2
2
|
var domData = require("../components/dom-data");
|
|
3
|
-
var keysByDOMNode = domData.
|
|
4
|
-
var vElementByDOMNode = domData.
|
|
5
|
-
var createFragmentNode = require("./morphdom/fragment").
|
|
3
|
+
var keysByDOMNode = domData._n_;
|
|
4
|
+
var vElementByDOMNode = domData._K_;
|
|
5
|
+
var createFragmentNode = require("./morphdom/fragment")._k_;
|
|
6
6
|
var VNode = require("./VNode");
|
|
7
7
|
|
|
8
8
|
function VFragment(key, ownerComponent, preserve) {
|
|
9
|
-
this.
|
|
10
|
-
this.
|
|
11
|
-
this.
|
|
9
|
+
this.bX_(null /* childCount */, ownerComponent);
|
|
10
|
+
this.bY_ = key;
|
|
11
|
+
this.ad_ = preserve;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
VFragment.prototype = {
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
bZ_: 12,
|
|
16
|
+
bo_: function () {
|
|
17
17
|
var fragment = createFragmentNode();
|
|
18
|
-
keysByDOMNode.set(fragment, this.
|
|
18
|
+
keysByDOMNode.set(fragment, this.bY_);
|
|
19
19
|
vElementByDOMNode.set(fragment, this);
|
|
20
20
|
return fragment;
|
|
21
21
|
}
|