marko 4.28.6 → 4.28.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/CHANGELOG.md +2569 -0
- package/dist/compiler/ast/CustomTag.js +1 -1
- package/dist/core-tags/core/await/renderer.js +11 -3
- package/dist/core-tags/core/await/reorderer-renderer.js +35 -8
- package/dist/node_modules/@internal/components-beginComponent/index-browser.js +5 -5
- package/dist/node_modules/@internal/components-beginComponent/index.js +12 -12
- package/dist/node_modules/@internal/components-define-widget-legacy/index-browser.js +43 -43
- 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 +21 -21
- package/dist/node_modules/@internal/components-entry-legacy/index-browser.js +6 -6
- package/dist/node_modules/@internal/components-entry-legacy/index.js +1 -1
- package/dist/node_modules/@internal/components-registry/index-browser.js +40 -40
- 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 +9 -9
- package/dist/node_modules/@internal/create-readable/index-browser.js +1 -1
- package/dist/node_modules/@internal/create-readable/index.js +8 -8
- package/dist/node_modules/@internal/init-components-tag/index.js +4 -4
- package/dist/node_modules/@internal/preserve-tag/index-browser.js +8 -8
- package/dist/node_modules/@internal/preserve-tag/index.js +5 -5
- 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 +13 -13
- package/dist/runtime/components/Component.js +144 -144
- package/dist/runtime/components/ComponentDef.js +27 -27
- package/dist/runtime/components/ComponentsContext.js +19 -19
- 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 +4 -4
- 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 +9 -9
- package/dist/runtime/components/legacy/helper-getWidgetFromOut.js +3 -3
- package/dist/runtime/components/legacy/renderer-legacy.js +39 -39
- package/dist/runtime/components/renderer.js +34 -34
- package/dist/runtime/components/update-manager.js +10 -10
- 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 +13 -13
- package/dist/runtime/helpers/style-value.js +1 -1
- package/dist/runtime/html/AsyncStream.js +24 -24
- package/dist/runtime/html/BufferedWriter.js +2 -2
- package/dist/runtime/html/StringWriter.js +1 -1
- package/dist/runtime/html/helpers/data-marko.js +2 -2
- package/dist/runtime/html/helpers/escape-xml.js +1 -1
- package/dist/runtime/html/index.js +1 -1
- package/dist/runtime/renderable.js +5 -5
- package/dist/runtime/vdom/AsyncVDOMBuilder.js +43 -43
- package/dist/runtime/vdom/VComponent.js +2 -2
- package/dist/runtime/vdom/VDocumentFragment.js +1 -1
- package/dist/runtime/vdom/VElement.js +12 -12
- package/dist/runtime/vdom/VFragment.js +4 -4
- package/dist/runtime/vdom/VNode.js +2 -2
- package/dist/runtime/vdom/index.js +1 -1
- package/dist/runtime/vdom/morphdom/fragment.js +2 -2
- package/dist/runtime/vdom/morphdom/helpers.js +3 -3
- package/dist/runtime/vdom/morphdom/index.js +43 -43
- package/package.json +1 -1
- package/src/compiler/Normalizer.js +4 -1
- package/src/compiler/ast/CustomTag.js +14 -3
- package/src/core-tags/components/TransformHelper/convertToComponent.js +1 -1
- package/src/core-tags/core/await/renderer.js +14 -3
- package/src/core-tags/core/await/reorderer-renderer.js +78 -43
- package/src/core-tags/migrate/all-tags/widget-in-attrs.js +9 -7
- package/src/runtime/components/legacy/index.js +3 -1
- package/src/runtime/helpers/interop-require.js +1 -1
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
|
|
4
4
|
var domInsert = require("../dom-insert");
|
|
5
5
|
var defaultCreateOut = require("../createOut");
|
|
6
|
-
var getComponentsContext = require("./ComponentsContext").
|
|
6
|
+
var getComponentsContext = require("./ComponentsContext").V_;
|
|
7
7
|
var componentsUtil = require("@internal/components-util");
|
|
8
|
-
var componentLookup = componentsUtil.
|
|
9
|
-
var destroyNodeRecursive = componentsUtil.
|
|
8
|
+
var componentLookup = componentsUtil._o_;
|
|
9
|
+
var destroyNodeRecursive = componentsUtil._T_;
|
|
10
10
|
var EventEmitter = require("events-light");
|
|
11
11
|
var RenderResult = require("../RenderResult");
|
|
12
12
|
var SubscriptionTracker = require("listener-tracker");
|
|
@@ -15,8 +15,8 @@ var updateManager = require("./update-manager");
|
|
|
15
15
|
var morphdom = require("../vdom/morphdom");
|
|
16
16
|
var eventDelegation = require("./event-delegation");
|
|
17
17
|
var domData = require("./dom-data");
|
|
18
|
-
var componentsByDOMNode = domData.
|
|
19
|
-
var keyedElementsByComponentId = domData.
|
|
18
|
+
var componentsByDOMNode = domData._r_;
|
|
19
|
+
var keyedElementsByComponentId = domData._q_;
|
|
20
20
|
var CONTEXT_KEY = "__subtree_context__";
|
|
21
21
|
|
|
22
22
|
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
@@ -58,7 +58,7 @@ function handleCustomEventWithMethodListener(component, targetMethodName, args,
|
|
|
58
58
|
args = extraArgs.concat(args);
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
var targetComponent = componentLookup[component.
|
|
61
|
+
var targetComponent = componentLookup[component.Z_];
|
|
62
62
|
var targetMethod = typeof targetMethodName === "function" ? targetMethodName : targetComponent[targetMethodName];
|
|
63
63
|
if (!targetMethod) {
|
|
64
64
|
throw Error("Method not found: " + targetMethodName);
|
|
@@ -117,8 +117,8 @@ function processUpdateHandlers(component, stateChanges, oldState) {
|
|
|
117
117
|
handlerMethod.call(component, newValue, oldValue);
|
|
118
118
|
});
|
|
119
119
|
|
|
120
|
-
component.
|
|
121
|
-
component.
|
|
120
|
+
component._z_();
|
|
121
|
+
component._u_();
|
|
122
122
|
}
|
|
123
123
|
|
|
124
124
|
return true;
|
|
@@ -158,50 +158,50 @@ var componentProto;
|
|
|
158
158
|
function Component(id) {
|
|
159
159
|
EventEmitter.call(this);
|
|
160
160
|
this.id = id;
|
|
161
|
-
this.
|
|
162
|
-
this.
|
|
163
|
-
this.ak_ = null;
|
|
164
|
-
this._w_ = null;
|
|
165
|
-
this.Z_ = null; // Used to keep track of bubbling DOM events for components rendered on the server
|
|
166
|
-
this.X_ = null;
|
|
167
|
-
this.Y_ = null;
|
|
161
|
+
this.D_ = null;
|
|
162
|
+
this._F_ = null;
|
|
168
163
|
this.al_ = null;
|
|
169
|
-
this.
|
|
170
|
-
this.
|
|
171
|
-
this.
|
|
172
|
-
this.
|
|
173
|
-
this.
|
|
174
|
-
this.
|
|
164
|
+
this._x_ = null;
|
|
165
|
+
this.___ = null; // Used to keep track of bubbling DOM events for components rendered on the server
|
|
166
|
+
this.Y_ = null;
|
|
167
|
+
this.Z_ = null;
|
|
168
|
+
this.am_ = null;
|
|
169
|
+
this.S_ = undefined;
|
|
170
|
+
this._y_ = false;
|
|
171
|
+
this.an_ = undefined;
|
|
172
|
+
this.M_ = false;
|
|
173
|
+
this._d_ = false;
|
|
175
174
|
this.ao_ = false;
|
|
176
|
-
this.
|
|
175
|
+
this.ap_ = false;
|
|
176
|
+
this.F_ = undefined;
|
|
177
177
|
|
|
178
178
|
var ssrKeyedElements = keyedElementsByComponentId[id];
|
|
179
179
|
|
|
180
180
|
if (ssrKeyedElements) {
|
|
181
|
-
this.
|
|
181
|
+
this.O_ = ssrKeyedElements;
|
|
182
182
|
delete keyedElementsByComponentId[id];
|
|
183
183
|
} else {
|
|
184
|
-
this.
|
|
184
|
+
this.O_ = {};
|
|
185
185
|
}
|
|
186
186
|
}
|
|
187
187
|
|
|
188
188
|
Component.prototype = componentProto = {
|
|
189
|
-
|
|
189
|
+
B_: true,
|
|
190
190
|
|
|
191
191
|
subscribeTo: function (target) {
|
|
192
192
|
if (!target) {
|
|
193
193
|
throw TypeError();
|
|
194
194
|
}
|
|
195
195
|
|
|
196
|
-
var subscriptions = this.
|
|
196
|
+
var subscriptions = this.al_ || (this.al_ = new SubscriptionTracker());
|
|
197
197
|
|
|
198
|
-
var subscribeToOptions = target.
|
|
198
|
+
var subscribeToOptions = target.B_ ? COMPONENT_SUBSCRIBE_TO_OPTIONS : NON_COMPONENT_SUBSCRIBE_TO_OPTIONS;
|
|
199
199
|
|
|
200
200
|
return subscriptions.subscribeTo(target, subscribeToOptions);
|
|
201
201
|
},
|
|
202
202
|
|
|
203
203
|
emit: function (eventType) {
|
|
204
|
-
var customEvents = this.
|
|
204
|
+
var customEvents = this.Y_;
|
|
205
205
|
var target;
|
|
206
206
|
|
|
207
207
|
if (customEvents && (target = customEvents[eventType])) {
|
|
@@ -228,10 +228,10 @@ Component.prototype = componentProto = {
|
|
|
228
228
|
getEl: function (key, index) {
|
|
229
229
|
if (key) {
|
|
230
230
|
var resolvedKey = resolveKeyHelper(key, index);
|
|
231
|
-
var keyedElement = this.
|
|
231
|
+
var keyedElement = this.O_["@" + resolvedKey];
|
|
232
232
|
|
|
233
233
|
if (!keyedElement) {
|
|
234
|
-
var keyedComponentRoot = this.
|
|
234
|
+
var keyedComponentRoot = this.O_[resolvedKey];
|
|
235
235
|
|
|
236
236
|
if (keyedComponentRoot) {
|
|
237
237
|
return keyedComponentRoot.nodeType === 1 /** Node.ELEMENT_NODE */
|
|
@@ -257,33 +257,33 @@ Component.prototype = componentProto = {
|
|
|
257
257
|
return els;
|
|
258
258
|
},
|
|
259
259
|
getComponent: function (key, index) {
|
|
260
|
-
var rootNode = this.
|
|
260
|
+
var rootNode = this.O_[resolveKeyHelper(key, index)];
|
|
261
261
|
if (/\[\]$/.test(key)) {
|
|
262
262
|
rootNode = rootNode && rootNode[Object.keys(rootNode)[0]];
|
|
263
263
|
}
|
|
264
264
|
return rootNode && componentsByDOMNode.get(rootNode);
|
|
265
265
|
},
|
|
266
266
|
getComponents: function (key) {
|
|
267
|
-
var lookup = this.
|
|
267
|
+
var lookup = this.O_[key + "[]"];
|
|
268
268
|
return lookup ? Object.keys(lookup).map(function (key) {
|
|
269
269
|
return componentsByDOMNode.get(lookup[key]);
|
|
270
270
|
}).filter(Boolean) : [];
|
|
271
271
|
},
|
|
272
272
|
destroy: function () {
|
|
273
|
-
if (this.
|
|
273
|
+
if (this.M_) {
|
|
274
274
|
return;
|
|
275
275
|
}
|
|
276
276
|
|
|
277
|
-
var root = this.
|
|
277
|
+
var root = this._F_;
|
|
278
278
|
|
|
279
|
-
this.
|
|
279
|
+
this._P_();
|
|
280
280
|
|
|
281
281
|
var nodes = root.nodes;
|
|
282
282
|
|
|
283
283
|
nodes.forEach(function (node) {
|
|
284
284
|
destroyNodeRecursive(node);
|
|
285
285
|
|
|
286
|
-
if (eventDelegation.
|
|
286
|
+
if (eventDelegation.aq_(node) !== false) {
|
|
287
287
|
node.parentNode.removeChild(node);
|
|
288
288
|
}
|
|
289
289
|
});
|
|
@@ -291,129 +291,129 @@ Component.prototype = componentProto = {
|
|
|
291
291
|
root.detached = true;
|
|
292
292
|
|
|
293
293
|
delete componentLookup[this.id];
|
|
294
|
-
this.
|
|
294
|
+
this.O_ = {};
|
|
295
295
|
},
|
|
296
296
|
|
|
297
|
-
|
|
298
|
-
if (this.
|
|
297
|
+
_P_: function () {
|
|
298
|
+
if (this.M_) {
|
|
299
299
|
return;
|
|
300
300
|
}
|
|
301
301
|
|
|
302
|
-
this.
|
|
303
|
-
this.
|
|
302
|
+
this.ar_();
|
|
303
|
+
this.M_ = true;
|
|
304
304
|
|
|
305
|
-
componentsByDOMNode.set(this.
|
|
305
|
+
componentsByDOMNode.set(this._F_, undefined);
|
|
306
306
|
|
|
307
|
-
this.
|
|
307
|
+
this._F_ = null;
|
|
308
308
|
|
|
309
309
|
// Unsubscribe from all DOM events
|
|
310
|
-
this.
|
|
310
|
+
this._w_();
|
|
311
311
|
|
|
312
|
-
var subscriptions = this.
|
|
312
|
+
var subscriptions = this.al_;
|
|
313
313
|
if (subscriptions) {
|
|
314
314
|
subscriptions.removeAllListeners();
|
|
315
|
-
this.
|
|
315
|
+
this.al_ = null;
|
|
316
316
|
}
|
|
317
317
|
},
|
|
318
318
|
|
|
319
319
|
isDestroyed: function () {
|
|
320
|
-
return this.
|
|
320
|
+
return this.M_;
|
|
321
321
|
},
|
|
322
322
|
get state() {
|
|
323
|
-
return this.
|
|
323
|
+
return this.D_;
|
|
324
324
|
},
|
|
325
325
|
set state(newState) {
|
|
326
|
-
var state = this.
|
|
326
|
+
var state = this.D_;
|
|
327
327
|
if (!state && !newState) {
|
|
328
328
|
return;
|
|
329
329
|
}
|
|
330
330
|
|
|
331
331
|
if (!state) {
|
|
332
|
-
state = this.
|
|
332
|
+
state = this.D_ = new this.T_(this);
|
|
333
333
|
}
|
|
334
334
|
|
|
335
|
-
state.
|
|
335
|
+
state.as_(newState || {});
|
|
336
336
|
|
|
337
|
-
if (state.
|
|
338
|
-
this.
|
|
337
|
+
if (state.ao_) {
|
|
338
|
+
this.at_();
|
|
339
339
|
}
|
|
340
340
|
|
|
341
341
|
if (!newState) {
|
|
342
|
-
this.
|
|
342
|
+
this.D_ = null;
|
|
343
343
|
}
|
|
344
344
|
},
|
|
345
345
|
setState: function (name, value) {
|
|
346
|
-
var state = this.
|
|
346
|
+
var state = this.D_;
|
|
347
347
|
|
|
348
348
|
if (!state) {
|
|
349
|
-
state = this.
|
|
349
|
+
state = this.D_ = new this.T_(this);
|
|
350
350
|
}
|
|
351
351
|
if (typeof name == "object") {
|
|
352
352
|
// Merge in the new state with the old state
|
|
353
353
|
var newState = name;
|
|
354
354
|
for (var k in newState) {
|
|
355
355
|
if (hasOwnProperty.call(newState, k)) {
|
|
356
|
-
state.
|
|
356
|
+
state.au_(k, newState[k], true /* ensure:true */);
|
|
357
357
|
}
|
|
358
358
|
}
|
|
359
359
|
} else {
|
|
360
|
-
state.
|
|
360
|
+
state.au_(name, value, true /* ensure:true */);
|
|
361
361
|
}
|
|
362
362
|
},
|
|
363
363
|
|
|
364
364
|
setStateDirty: function (name, value) {
|
|
365
|
-
var state = this.
|
|
365
|
+
var state = this.D_;
|
|
366
366
|
|
|
367
367
|
if (arguments.length == 1) {
|
|
368
368
|
value = state[name];
|
|
369
369
|
}
|
|
370
370
|
|
|
371
|
-
state.
|
|
371
|
+
state.au_(name, value, true /* ensure:true */
|
|
372
372
|
, true /* forceDirty:true */
|
|
373
373
|
);
|
|
374
374
|
},
|
|
375
375
|
|
|
376
376
|
replaceState: function (newState) {
|
|
377
|
-
this.
|
|
377
|
+
this.D_.as_(newState);
|
|
378
378
|
},
|
|
379
379
|
|
|
380
380
|
get input() {
|
|
381
|
-
return this.
|
|
381
|
+
return this.S_;
|
|
382
382
|
},
|
|
383
383
|
set input(newInput) {
|
|
384
|
-
if (this.
|
|
385
|
-
this.
|
|
384
|
+
if (this.ap_) {
|
|
385
|
+
this.S_ = newInput;
|
|
386
386
|
} else {
|
|
387
|
-
this.
|
|
387
|
+
this._m_(newInput);
|
|
388
388
|
}
|
|
389
389
|
},
|
|
390
390
|
|
|
391
|
-
|
|
391
|
+
_m_: function (newInput, onInput, out) {
|
|
392
392
|
onInput = onInput || this.onInput;
|
|
393
393
|
var updatedInput;
|
|
394
394
|
|
|
395
|
-
var oldInput = this.
|
|
396
|
-
this.
|
|
397
|
-
this.
|
|
395
|
+
var oldInput = this.S_;
|
|
396
|
+
this.S_ = undefined;
|
|
397
|
+
this.av_ = out && out[CONTEXT_KEY] || this.av_;
|
|
398
398
|
|
|
399
399
|
if (onInput) {
|
|
400
400
|
// We need to set a flag to preview `this.input = foo` inside
|
|
401
401
|
// onInput causing infinite recursion
|
|
402
|
-
this.
|
|
402
|
+
this.ap_ = true;
|
|
403
403
|
updatedInput = onInput.call(this, newInput || {}, out);
|
|
404
|
-
this.
|
|
404
|
+
this.ap_ = false;
|
|
405
405
|
}
|
|
406
406
|
|
|
407
|
-
newInput = this.
|
|
407
|
+
newInput = this.am_ = updatedInput || newInput;
|
|
408
408
|
|
|
409
|
-
if (this.
|
|
410
|
-
this.
|
|
409
|
+
if (this.ao_ = checkInputChanged(this, oldInput, newInput)) {
|
|
410
|
+
this.at_();
|
|
411
411
|
}
|
|
412
412
|
|
|
413
|
-
if (this.
|
|
414
|
-
this.
|
|
413
|
+
if (this.S_ === undefined) {
|
|
414
|
+
this.S_ = newInput;
|
|
415
415
|
if (newInput && newInput.$global) {
|
|
416
|
-
this.
|
|
416
|
+
this.an_ = newInput.$global;
|
|
417
417
|
}
|
|
418
418
|
}
|
|
419
419
|
|
|
@@ -421,54 +421,54 @@ Component.prototype = componentProto = {
|
|
|
421
421
|
},
|
|
422
422
|
|
|
423
423
|
forceUpdate: function () {
|
|
424
|
-
this.
|
|
425
|
-
this.
|
|
424
|
+
this.ao_ = true;
|
|
425
|
+
this.at_();
|
|
426
426
|
},
|
|
427
427
|
|
|
428
|
-
|
|
429
|
-
if (!this.
|
|
430
|
-
this.
|
|
431
|
-
updateManager.
|
|
428
|
+
at_: function () {
|
|
429
|
+
if (!this._d_) {
|
|
430
|
+
this._d_ = true;
|
|
431
|
+
updateManager.aw_(this);
|
|
432
432
|
}
|
|
433
433
|
},
|
|
434
434
|
|
|
435
435
|
update: function () {
|
|
436
|
-
if (this.
|
|
436
|
+
if (this.M_ === true || this.ax_ === false) {
|
|
437
437
|
return;
|
|
438
438
|
}
|
|
439
439
|
|
|
440
|
-
var input = this.
|
|
441
|
-
var state = this.
|
|
440
|
+
var input = this.S_;
|
|
441
|
+
var state = this.D_;
|
|
442
442
|
|
|
443
|
-
if (this.
|
|
444
|
-
if (processUpdateHandlers(this, state.
|
|
445
|
-
state.
|
|
443
|
+
if (this.ao_ === false && state !== null && state.ao_ === true) {
|
|
444
|
+
if (processUpdateHandlers(this, state.ay_, state.az_, state)) {
|
|
445
|
+
state.ao_ = false;
|
|
446
446
|
}
|
|
447
447
|
}
|
|
448
448
|
|
|
449
|
-
if (this.
|
|
449
|
+
if (this.ax_ === true) {
|
|
450
450
|
// The UI component is still dirty after process state handlers
|
|
451
451
|
// then we should rerender
|
|
452
452
|
|
|
453
453
|
if (this.shouldUpdate(input, state) !== false) {
|
|
454
|
-
this.
|
|
454
|
+
this.aA_();
|
|
455
455
|
}
|
|
456
456
|
}
|
|
457
457
|
|
|
458
|
-
this.
|
|
458
|
+
this._u_();
|
|
459
459
|
},
|
|
460
460
|
|
|
461
|
-
get
|
|
462
|
-
return this.
|
|
461
|
+
get ax_() {
|
|
462
|
+
return this.ao_ === true || this.D_ !== null && this.D_.ao_ === true;
|
|
463
463
|
},
|
|
464
464
|
|
|
465
|
-
|
|
466
|
-
this.
|
|
467
|
-
this.
|
|
468
|
-
this.
|
|
469
|
-
var state = this.
|
|
465
|
+
_u_: function () {
|
|
466
|
+
this.ao_ = false;
|
|
467
|
+
this._d_ = false;
|
|
468
|
+
this.am_ = null;
|
|
469
|
+
var state = this.D_;
|
|
470
470
|
if (state) {
|
|
471
|
-
state.
|
|
471
|
+
state._u_();
|
|
472
472
|
}
|
|
473
473
|
},
|
|
474
474
|
|
|
@@ -476,72 +476,72 @@ Component.prototype = componentProto = {
|
|
|
476
476
|
return true;
|
|
477
477
|
},
|
|
478
478
|
|
|
479
|
-
|
|
479
|
+
aA_: function () {
|
|
480
480
|
var self = this;
|
|
481
|
-
var renderer = self.
|
|
481
|
+
var renderer = self.U_;
|
|
482
482
|
|
|
483
483
|
if (!renderer) {
|
|
484
484
|
throw TypeError();
|
|
485
485
|
}
|
|
486
486
|
|
|
487
|
-
var input = this.
|
|
487
|
+
var input = this.am_ || this.S_;
|
|
488
488
|
|
|
489
|
-
updateManager.
|
|
490
|
-
self.
|
|
489
|
+
updateManager.aB_(function () {
|
|
490
|
+
self._G_(input, false).afterInsert(self.F_);
|
|
491
491
|
});
|
|
492
492
|
|
|
493
|
-
this.
|
|
493
|
+
this._u_();
|
|
494
494
|
},
|
|
495
495
|
|
|
496
|
-
|
|
497
|
-
var host = this.
|
|
498
|
-
var globalData = this.
|
|
499
|
-
var rootNode = this.
|
|
500
|
-
var renderer = this.
|
|
496
|
+
_G_: function (input, isHydrate) {
|
|
497
|
+
var host = this.F_;
|
|
498
|
+
var globalData = this.an_;
|
|
499
|
+
var rootNode = this._F_;
|
|
500
|
+
var renderer = this.U_;
|
|
501
501
|
var createOut = renderer.createOut || defaultCreateOut;
|
|
502
502
|
var out = createOut(globalData);
|
|
503
503
|
out.sync();
|
|
504
|
-
out.
|
|
505
|
-
out[CONTEXT_KEY] = this.
|
|
504
|
+
out.F_ = this.F_;
|
|
505
|
+
out[CONTEXT_KEY] = this.av_;
|
|
506
506
|
|
|
507
507
|
var componentsContext = getComponentsContext(out);
|
|
508
|
-
var globalComponentsContext = componentsContext.
|
|
509
|
-
globalComponentsContext.
|
|
510
|
-
globalComponentsContext.
|
|
508
|
+
var globalComponentsContext = componentsContext.s_;
|
|
509
|
+
globalComponentsContext.aC_ = this;
|
|
510
|
+
globalComponentsContext.aa_ = isHydrate;
|
|
511
511
|
|
|
512
512
|
renderer(input, out);
|
|
513
513
|
|
|
514
514
|
var result = new RenderResult(out);
|
|
515
515
|
|
|
516
|
-
var targetNode = out.
|
|
516
|
+
var targetNode = out.ak_().a_;
|
|
517
517
|
|
|
518
518
|
morphdom(rootNode, targetNode, host, componentsContext);
|
|
519
519
|
|
|
520
520
|
return result;
|
|
521
521
|
},
|
|
522
522
|
|
|
523
|
-
|
|
524
|
-
var root = this.
|
|
523
|
+
aD_: function () {
|
|
524
|
+
var root = this._F_;
|
|
525
525
|
root.remove();
|
|
526
526
|
return root;
|
|
527
527
|
},
|
|
528
528
|
|
|
529
|
-
|
|
530
|
-
var eventListenerHandles = this.
|
|
529
|
+
_w_: function () {
|
|
530
|
+
var eventListenerHandles = this._x_;
|
|
531
531
|
if (eventListenerHandles) {
|
|
532
532
|
eventListenerHandles.forEach(removeListener);
|
|
533
|
-
this.
|
|
533
|
+
this._x_ = null;
|
|
534
534
|
}
|
|
535
535
|
},
|
|
536
536
|
|
|
537
|
-
get
|
|
538
|
-
var state = this.
|
|
539
|
-
return state && state.
|
|
537
|
+
get aE_() {
|
|
538
|
+
var state = this.D_;
|
|
539
|
+
return state && state.E_;
|
|
540
540
|
},
|
|
541
541
|
|
|
542
|
-
|
|
543
|
-
var finalCustomEvents = this.
|
|
544
|
-
this.
|
|
542
|
+
aF_: function (customEvents, scope) {
|
|
543
|
+
var finalCustomEvents = this.Y_ = {};
|
|
544
|
+
this.Z_ = scope;
|
|
545
545
|
|
|
546
546
|
customEvents.forEach(function (customEvent) {
|
|
547
547
|
var eventType = customEvent[0];
|
|
@@ -556,45 +556,45 @@ Component.prototype = componentProto = {
|
|
|
556
556
|
},
|
|
557
557
|
|
|
558
558
|
get el() {
|
|
559
|
-
return walkFragments(this.
|
|
559
|
+
return walkFragments(this._F_);
|
|
560
560
|
},
|
|
561
561
|
|
|
562
562
|
get els() {
|
|
563
|
-
return (this.
|
|
563
|
+
return (this._F_ ? this._F_.nodes : []).filter(function (el) {
|
|
564
564
|
return el.nodeType === ELEMENT_NODE;
|
|
565
565
|
});
|
|
566
566
|
},
|
|
567
567
|
|
|
568
|
-
|
|
569
|
-
|
|
568
|
+
aG_: emit,
|
|
569
|
+
aH_(input, out) {
|
|
570
570
|
this.onCreate && this.onCreate(input, out);
|
|
571
|
-
this.
|
|
571
|
+
this.aG_("create", input, out);
|
|
572
572
|
},
|
|
573
573
|
|
|
574
|
-
|
|
574
|
+
aI_(out) {
|
|
575
575
|
this.onRender && this.onRender(out);
|
|
576
|
-
this.
|
|
576
|
+
this.aG_("render", out);
|
|
577
577
|
},
|
|
578
578
|
|
|
579
|
-
|
|
579
|
+
_z_() {
|
|
580
580
|
this.onUpdate && this.onUpdate();
|
|
581
|
-
this.
|
|
581
|
+
this.aG_("update");
|
|
582
582
|
},
|
|
583
583
|
|
|
584
|
-
|
|
584
|
+
_A_() {
|
|
585
585
|
this.onMount && this.onMount();
|
|
586
|
-
this.
|
|
586
|
+
this.aG_("mount");
|
|
587
587
|
},
|
|
588
588
|
|
|
589
|
-
|
|
589
|
+
ar_() {
|
|
590
590
|
this.onDestroy && this.onDestroy();
|
|
591
|
-
this.
|
|
591
|
+
this.aG_("destroy");
|
|
592
592
|
}
|
|
593
593
|
};
|
|
594
594
|
|
|
595
595
|
componentProto.elId = componentProto.getElId;
|
|
596
|
-
componentProto.
|
|
597
|
-
componentProto.
|
|
596
|
+
componentProto.aJ_ = componentProto.update;
|
|
597
|
+
componentProto.aK_ = componentProto.destroy;
|
|
598
598
|
|
|
599
599
|
// Add all of the following DOM methods to Component.prototype:
|
|
600
600
|
// - appendTo(referenceEl)
|
|
@@ -604,7 +604,7 @@ componentProto.aJ_ = componentProto.destroy;
|
|
|
604
604
|
// - insertAfter(referenceEl)
|
|
605
605
|
// - prependTo(referenceEl)
|
|
606
606
|
domInsert(componentProto, function getEl(component) {
|
|
607
|
-
return component.
|
|
607
|
+
return component.aD_();
|
|
608
608
|
}, function afterInsert(component) {
|
|
609
609
|
return component;
|
|
610
610
|
});
|