marko 5.31.1 → 5.31.3
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/core-tags/components/preserve-tag.js +1 -81
- package/dist/core-tags/core/await/AsyncValue.js +20 -20
- 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 +19 -19
- package/dist/node_modules/@internal/components-entry-legacy/index-browser.js +6 -6
- package/dist/node_modules/@internal/components-registry/index-browser.js +44 -44
- 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 +45 -0
- package/dist/node_modules/@internal/preserve-tag/index.js +34 -0
- package/dist/node_modules/@internal/preserve-tag/package.json +11 -0
- package/dist/node_modules/@internal/require/index-browser.js +6 -4
- package/dist/runtime/RenderResult.js +7 -7
- package/dist/runtime/components/Component.js +88 -88
- package/dist/runtime/components/ComponentDef.js +18 -18
- package/dist/runtime/components/ComponentsContext.js +14 -14
- package/dist/runtime/components/GlobalComponentsContext.js +2 -2
- package/dist/runtime/components/ServerComponent.js +12 -12
- package/dist/runtime/components/State.js +9 -9
- package/dist/runtime/components/attach-detach.js +1 -1
- package/dist/runtime/components/defineComponent.js +5 -5
- package/dist/runtime/components/dom-data.js +5 -5
- package/dist/runtime/components/event-delegation.js +6 -6
- package/dist/runtime/components/legacy/defineComponent-legacy.js +1 -1
- package/dist/runtime/components/legacy/defineRenderer-legacy.js +10 -10
- package/dist/runtime/components/legacy/renderer-legacy.js +32 -32
- package/dist/runtime/components/renderer.js +20 -20
- package/dist/runtime/dom-insert.js +2 -2
- package/dist/runtime/helpers/dynamic-tag.js +9 -9
- package/dist/runtime/helpers/render-tag.js +1 -1
- package/dist/runtime/html/AsyncStream.js +6 -6
- package/dist/runtime/html/StringWriter.js +1 -1
- package/dist/runtime/html/helpers/attr.js +1 -1
- package/dist/runtime/html/helpers/data-marko.js +4 -4
- package/dist/runtime/html/helpers/escape-quotes.js +1 -1
- package/dist/runtime/html/helpers/props-script.js +1 -1
- package/dist/runtime/html/index.js +1 -1
- package/dist/runtime/renderable.js +1 -1
- package/dist/runtime/vdom/AsyncVDOMBuilder.js +27 -27
- package/dist/runtime/vdom/VComponent.js +2 -2
- package/dist/runtime/vdom/VDocumentFragment.js +1 -1
- package/dist/runtime/vdom/VElement.js +15 -15
- package/dist/runtime/vdom/VFragment.js +4 -4
- package/dist/runtime/vdom/VNode.js +2 -2
- package/dist/runtime/vdom/hot-reload.js +11 -11
- package/dist/runtime/vdom/index.js +1 -1
- package/dist/runtime/vdom/morphdom/fragment.js +1 -1
- package/dist/runtime/vdom/morphdom/index.js +36 -36
- package/dist/runtime/vdom/morphdom/specialElHandlers.js +3 -3
- package/package.json +1 -1
- package/src/core-tags/components/preserve-tag.js +1 -81
- package/src/node_modules/@internal/preserve-tag/index-browser.js +45 -0
- package/src/node_modules/@internal/preserve-tag/index.js +34 -0
- package/src/node_modules/@internal/preserve-tag/package.json +11 -0
- package/src/node_modules/@internal/require/index-browser.js +6 -4
- package/src/runtime/components/legacy/defineRenderer-legacy.js +1 -1
@@ -2,11 +2,11 @@
|
|
2
2
|
var specialElHandlers = require("./specialElHandlers");
|
3
3
|
var KeySequence = require("../../components/KeySequence");
|
4
4
|
var componentsUtil = require("@internal/components-util");
|
5
|
-
var existingComponentLookup = componentsUtil.
|
6
|
-
var destroyNodeRecursive = componentsUtil.
|
5
|
+
var existingComponentLookup = componentsUtil._i_;
|
6
|
+
var destroyNodeRecursive = componentsUtil._O_;
|
7
7
|
var addComponentRootToKeyedElements =
|
8
|
-
componentsUtil.
|
9
|
-
var normalizeComponentKey = componentsUtil.
|
8
|
+
componentsUtil._j_;
|
9
|
+
var normalizeComponentKey = componentsUtil._R_;
|
10
10
|
var VElement = require("../vdom").bs_;
|
11
11
|
var virtualizeElement = VElement.ce_;
|
12
12
|
var morphAttrs = VElement.cf_;
|
@@ -14,9 +14,9 @@ var eventDelegation = require("../../components/event-delegation");
|
|
14
14
|
var fragment = require("./fragment");
|
15
15
|
var helpers = require("./helpers");
|
16
16
|
var domData = require("../../components/dom-data");
|
17
|
-
var keysByDOMNode = domData.
|
18
|
-
var componentByDOMNode = domData.
|
19
|
-
var vElementByDOMNode = domData.
|
17
|
+
var keysByDOMNode = domData._G_;
|
18
|
+
var componentByDOMNode = domData._l_;
|
19
|
+
var vElementByDOMNode = domData._H_;
|
20
20
|
var detachedByDOMNode = domData.aT_;
|
21
21
|
|
22
22
|
var insertBefore = helpers.bd_;
|
@@ -24,7 +24,7 @@ var insertAfter = helpers.be_;
|
|
24
24
|
var nextSibling = helpers.cj_;
|
25
25
|
var firstChild = helpers.ay_;
|
26
26
|
var removeChild = helpers.bf_;
|
27
|
-
var createFragmentNode = fragment.
|
27
|
+
var createFragmentNode = fragment._h_;
|
28
28
|
var beginFragmentNode = fragment.cp_;
|
29
29
|
|
30
30
|
var ELEMENT_NODE = 1;
|
@@ -62,8 +62,8 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
62
62
|
var keySequences = Object.create(null);
|
63
63
|
|
64
64
|
if (componentsContext) {
|
65
|
-
globalComponentsContext = componentsContext.
|
66
|
-
isHydrate = globalComponentsContext.
|
65
|
+
globalComponentsContext = componentsContext.o_;
|
66
|
+
isHydrate = globalComponentsContext._W_;
|
67
67
|
}
|
68
68
|
|
69
69
|
function insertVirtualNodeBefore(
|
@@ -83,7 +83,7 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
83
83
|
{
|
84
84
|
if (key) {
|
85
85
|
keysByDOMNode.set(realNode, key);
|
86
|
-
(isAutoKey(key) ? parentComponent : ownerComponent).
|
86
|
+
(isAutoKey(key) ? parentComponent : ownerComponent).J_[
|
87
87
|
key] =
|
88
88
|
realNode;
|
89
89
|
}
|
@@ -105,7 +105,7 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
105
105
|
ownerComponent,
|
106
106
|
parentComponent)
|
107
107
|
{
|
108
|
-
var rootNode = component.
|
108
|
+
var rootNode = component._A_ = insertBefore(
|
109
109
|
createFragmentNode(),
|
110
110
|
referenceNode,
|
111
111
|
referenceNodeParentEl
|
@@ -115,7 +115,7 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
115
115
|
if (key && ownerComponent) {
|
116
116
|
key = normalizeComponentKey(key, parentComponent.id);
|
117
117
|
addComponentRootToKeyedElements(
|
118
|
-
ownerComponent.
|
118
|
+
ownerComponent.J_,
|
119
119
|
key,
|
120
120
|
rootNode,
|
121
121
|
component.id
|
@@ -127,7 +127,7 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
127
127
|
}
|
128
128
|
|
129
129
|
function morphComponent(component, vComponent) {
|
130
|
-
morphChildren(component.
|
130
|
+
morphChildren(component._A_, vComponent, component);
|
131
131
|
}
|
132
132
|
|
133
133
|
var detachedNodes = [];
|
@@ -171,18 +171,18 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
171
171
|
curFromNodeChild = nextSibling(curFromNodeChild);
|
172
172
|
}
|
173
173
|
|
174
|
-
var ownerComponent = curToNodeChild.
|
174
|
+
var ownerComponent = curToNodeChild._J_ || parentComponent;
|
175
175
|
var referenceComponent;
|
176
176
|
|
177
177
|
if (curToNodeType === COMPONENT_NODE) {
|
178
|
-
var component = curToNodeChild.
|
178
|
+
var component = curToNodeChild.r_;
|
179
179
|
if (
|
180
180
|
(matchingFromComponent = existingComponentLookup[component.id]) ===
|
181
181
|
undefined)
|
182
182
|
{
|
183
183
|
if (isHydrate === true) {
|
184
184
|
var rootNode = beginFragmentNode(curFromNodeChild, fromNode);
|
185
|
-
component.
|
185
|
+
component._A_ = rootNode;
|
186
186
|
componentByDOMNode.set(rootNode, component);
|
187
187
|
|
188
188
|
if (ownerComponent && curToNodeKey) {
|
@@ -191,7 +191,7 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
191
191
|
parentComponent.id
|
192
192
|
);
|
193
193
|
addComponentRootToKeyedElements(
|
194
|
-
ownerComponent.
|
194
|
+
ownerComponent.J_,
|
195
195
|
curToNodeKey,
|
196
196
|
rootNode,
|
197
197
|
component.id
|
@@ -215,17 +215,17 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
215
215
|
);
|
216
216
|
}
|
217
217
|
} else {
|
218
|
-
if (matchingFromComponent.
|
218
|
+
if (matchingFromComponent._A_ !== curFromNodeChild) {
|
219
219
|
if (
|
220
220
|
curFromNodeChild && (
|
221
221
|
fromComponent = componentByDOMNode.get(curFromNodeChild)) &&
|
222
|
-
globalComponentsContext.
|
222
|
+
globalComponentsContext.p_[
|
223
223
|
fromComponent.id] ===
|
224
224
|
undefined)
|
225
225
|
{
|
226
226
|
// The component associated with the current real DOM node was not rendered
|
227
227
|
// so we should just remove it out of the real DOM by destroying it
|
228
|
-
curFromNodeChild = nextSibling(fromComponent.
|
228
|
+
curFromNodeChild = nextSibling(fromComponent._A_);
|
229
229
|
destroyComponent(fromComponent);
|
230
230
|
continue;
|
231
231
|
}
|
@@ -233,7 +233,7 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
233
233
|
// We need to move the existing component into
|
234
234
|
// the correct location
|
235
235
|
insertBefore(
|
236
|
-
matchingFromComponent.
|
236
|
+
matchingFromComponent._A_,
|
237
237
|
curFromNodeChild,
|
238
238
|
fromNode
|
239
239
|
);
|
@@ -242,7 +242,7 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
242
242
|
curFromNodeChild && nextSibling(curFromNodeChild);
|
243
243
|
}
|
244
244
|
|
245
|
-
if (!curToNodeChild.
|
245
|
+
if (!curToNodeChild.aa_) {
|
246
246
|
morphComponent(component, curToNodeChild);
|
247
247
|
}
|
248
248
|
}
|
@@ -278,7 +278,7 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
278
278
|
|
279
279
|
if (curFromNodeKey === curToNodeKey) {
|
280
280
|
// Elements line up. Now we just have to make sure they are compatible
|
281
|
-
if (!curToNodeChild.
|
281
|
+
if (!curToNodeChild.aa_) {
|
282
282
|
// We just skip over the fromNode if it is preserved
|
283
283
|
|
284
284
|
if (compareNodeNames(curToNodeChild, curVFromNodeChild)) {
|
@@ -304,7 +304,7 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
304
304
|
}
|
305
305
|
}
|
306
306
|
} else {
|
307
|
-
matchingFromEl = referenceComponent.
|
307
|
+
matchingFromEl = referenceComponent.J_[curToNodeKey];
|
308
308
|
if (
|
309
309
|
matchingFromEl === undefined ||
|
310
310
|
matchingFromEl === curFromNodeChild)
|
@@ -312,7 +312,7 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
312
312
|
if (isHydrate === true && curFromNodeChild) {
|
313
313
|
if (
|
314
314
|
curFromNodeChild.nodeType === ELEMENT_NODE && (
|
315
|
-
curToNodeChild.
|
315
|
+
curToNodeChild.aa_ ||
|
316
316
|
caseInsensitiveCompare(
|
317
317
|
curFromNodeChild.nodeName,
|
318
318
|
curToNodeChild.bZ_ || ""
|
@@ -321,10 +321,10 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
321
321
|
curVFromNodeChild = virtualizeElement(curFromNodeChild);
|
322
322
|
curVFromNodeChild.bZ_ = curToNodeChild.bZ_;
|
323
323
|
keysByDOMNode.set(curFromNodeChild, curToNodeKey);
|
324
|
-
referenceComponent.
|
324
|
+
referenceComponent.J_[curToNodeKey] =
|
325
325
|
curFromNodeChild;
|
326
326
|
|
327
|
-
if (curToNodeChild.
|
327
|
+
if (curToNodeChild.aa_) {
|
328
328
|
vElementByDOMNode.set(curFromNodeChild, curVFromNodeChild);
|
329
329
|
} else {
|
330
330
|
morphEl(
|
@@ -372,11 +372,11 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
372
372
|
);
|
373
373
|
keysByDOMNode.set(fragment, curToNodeKey);
|
374
374
|
vElementByDOMNode.set(fragment, curToNodeChild);
|
375
|
-
referenceComponent.
|
375
|
+
referenceComponent.J_[curToNodeKey] = fragment;
|
376
376
|
removeChild(curFromNodeChild);
|
377
377
|
removeChild(endNode);
|
378
378
|
|
379
|
-
if (!curToNodeChild.
|
379
|
+
if (!curToNodeChild.aa_) {
|
380
380
|
morphChildren(fragment, curToNodeChild, parentComponent);
|
381
381
|
}
|
382
382
|
|
@@ -401,7 +401,7 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
401
401
|
detachedByDOMNode.set(matchingFromEl, undefined);
|
402
402
|
}
|
403
403
|
|
404
|
-
if (!curToNodeChild.
|
404
|
+
if (!curToNodeChild.aa_) {
|
405
405
|
curVFromNodeChild = vElementByDOMNode.get(matchingFromEl);
|
406
406
|
|
407
407
|
if (compareNodeNames(curVFromNodeChild, curToNodeChild)) {
|
@@ -502,7 +502,7 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
502
502
|
curFromNodeChild = fromNextSibling;
|
503
503
|
|
504
504
|
if (
|
505
|
-
!globalComponentsContext.
|
505
|
+
!globalComponentsContext.p_[fromComponent.id])
|
506
506
|
{
|
507
507
|
destroyComponent(fromComponent);
|
508
508
|
}
|
@@ -626,7 +626,7 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
626
626
|
if (fromComponent = componentByDOMNode.get(curFromNodeChild)) {
|
627
627
|
curFromNodeChild = fromNextSibling;
|
628
628
|
if (
|
629
|
-
!globalComponentsContext.
|
629
|
+
!globalComponentsContext.p_[fromComponent.id])
|
630
630
|
{
|
631
631
|
destroyComponent(fromComponent);
|
632
632
|
}
|
@@ -642,7 +642,7 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
642
642
|
referenceComponent = parentComponent;
|
643
643
|
} else {
|
644
644
|
referenceComponent =
|
645
|
-
curVFromNodeChild && curVFromNodeChild.
|
645
|
+
curVFromNodeChild && curVFromNodeChild._J_;
|
646
646
|
}
|
647
647
|
|
648
648
|
detachNode(curFromNodeChild, fromNode, referenceComponent);
|
@@ -662,7 +662,7 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
662
662
|
|
663
663
|
morphAttrs(fromEl, vFromEl, toEl);
|
664
664
|
|
665
|
-
if (toEl.
|
665
|
+
if (toEl.a__) {
|
666
666
|
return;
|
667
667
|
}
|
668
668
|
|
@@ -681,7 +681,7 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
681
681
|
|
682
682
|
|
683
683
|
|
684
|
-
morphChildren(fromNode, toNode, toNode.
|
684
|
+
morphChildren(fromNode, toNode, toNode.r_);
|
685
685
|
|
686
686
|
detachedNodes.forEach(function (node) {
|
687
687
|
var detachedFromComponent = detachedByDOMNode.get(node);
|
@@ -48,8 +48,8 @@ SpecialElHandlers.prototype = {
|
|
48
48
|
syncBooleanAttrProp(fromEl, toEl, "checked");
|
49
49
|
syncBooleanAttrProp(fromEl, toEl, "disabled");
|
50
50
|
|
51
|
-
if (fromEl.value != toEl.
|
52
|
-
fromEl.value = toEl.
|
51
|
+
if (fromEl.value != toEl.e_) {
|
52
|
+
fromEl.value = toEl.e_;
|
53
53
|
}
|
54
54
|
|
55
55
|
if (fromEl.hasAttribute("value") && !toEl.cc_("value")) {
|
@@ -62,7 +62,7 @@ SpecialElHandlers.prototype = {
|
|
62
62
|
return;
|
63
63
|
}
|
64
64
|
|
65
|
-
var newValue = toEl.
|
65
|
+
var newValue = toEl.e_;
|
66
66
|
if (fromEl.value != newValue) {
|
67
67
|
fromEl.value = newValue;
|
68
68
|
}
|
package/package.json
CHANGED
@@ -1,81 +1 @@
|
|
1
|
-
|
2
|
-
var getComponentsContext = ComponentsContext.___getComponentsContext;
|
3
|
-
|
4
|
-
module.exports = function render(input, out) {
|
5
|
-
var isComponent = !input.n;
|
6
|
-
var shouldPreserve = !("i" in input) || input.i;
|
7
|
-
var componentsContext = out.___components;
|
8
|
-
|
9
|
-
if (typeof document === "object") {
|
10
|
-
var isHydrate =
|
11
|
-
componentsContext && componentsContext.___globalContext.___isHydrate;
|
12
|
-
var ownerComponent = out.___assignedComponentDef.___component;
|
13
|
-
var referenceComponent = ownerComponent;
|
14
|
-
var key = out.___assignedKey;
|
15
|
-
var checkKey = key;
|
16
|
-
|
17
|
-
if (key[0] !== "@") {
|
18
|
-
var parentComponent = componentsContext.___componentDef.___component;
|
19
|
-
if (ownerComponent !== parentComponent) {
|
20
|
-
referenceComponent = parentComponent;
|
21
|
-
checkKey += ":" + ownerComponent.id;
|
22
|
-
}
|
23
|
-
}
|
24
|
-
|
25
|
-
var isPreserved =
|
26
|
-
shouldPreserve &&
|
27
|
-
(isHydrate || referenceComponent.___keyedElements[checkKey]);
|
28
|
-
|
29
|
-
if (isComponent) {
|
30
|
-
out.bf(key, ownerComponent, shouldPreserve);
|
31
|
-
|
32
|
-
if (!isPreserved && input.renderBody) {
|
33
|
-
input.renderBody(out);
|
34
|
-
}
|
35
|
-
|
36
|
-
out.ef();
|
37
|
-
} else {
|
38
|
-
if (isPreserved) {
|
39
|
-
if (input.b) {
|
40
|
-
out.___parent.___preserveBody = true;
|
41
|
-
} else {
|
42
|
-
out.beginElement("", null, key, ownerComponent);
|
43
|
-
out.___parent.___preserve = true;
|
44
|
-
out.endElement();
|
45
|
-
}
|
46
|
-
} else if (input.renderBody) {
|
47
|
-
input.renderBody(out);
|
48
|
-
}
|
49
|
-
}
|
50
|
-
} else {
|
51
|
-
if (isComponent) {
|
52
|
-
out.bf(
|
53
|
-
out.___assignedKey,
|
54
|
-
out.___assignedComponentDef.___component,
|
55
|
-
true
|
56
|
-
);
|
57
|
-
}
|
58
|
-
|
59
|
-
if (input.renderBody) {
|
60
|
-
if (shouldPreserve) {
|
61
|
-
var parentPreserved = false;
|
62
|
-
|
63
|
-
if (componentsContext) {
|
64
|
-
parentPreserved = componentsContext.___isPreserved;
|
65
|
-
} else {
|
66
|
-
componentsContext = getComponentsContext(out);
|
67
|
-
}
|
68
|
-
|
69
|
-
componentsContext.___isPreserved = true;
|
70
|
-
input.renderBody(out);
|
71
|
-
componentsContext.___isPreserved = parentPreserved;
|
72
|
-
} else {
|
73
|
-
input.renderBody(out);
|
74
|
-
}
|
75
|
-
}
|
76
|
-
|
77
|
-
if (isComponent) {
|
78
|
-
out.ef();
|
79
|
-
}
|
80
|
-
}
|
81
|
-
};
|
1
|
+
module.exports = require("@internal/preserve-tag");
|
@@ -0,0 +1,45 @@
|
|
1
|
+
module.exports = function render(input, out) {
|
2
|
+
var isComponent = !input.n;
|
3
|
+
var shouldPreserve = !("i" in input) || input.i;
|
4
|
+
var componentsContext = out.___components;
|
5
|
+
var isHydrate =
|
6
|
+
componentsContext && componentsContext.___globalContext.___isHydrate;
|
7
|
+
var ownerComponent = out.___assignedComponentDef.___component;
|
8
|
+
var referenceComponent = ownerComponent;
|
9
|
+
var key = out.___assignedKey;
|
10
|
+
var checkKey = key;
|
11
|
+
|
12
|
+
if (key[0] !== "@") {
|
13
|
+
var parentComponent = componentsContext.___componentDef.___component;
|
14
|
+
if (ownerComponent !== parentComponent) {
|
15
|
+
referenceComponent = parentComponent;
|
16
|
+
checkKey += ":" + ownerComponent.id;
|
17
|
+
}
|
18
|
+
}
|
19
|
+
|
20
|
+
var isPreserved =
|
21
|
+
shouldPreserve &&
|
22
|
+
(isHydrate || referenceComponent.___keyedElements[checkKey]);
|
23
|
+
|
24
|
+
if (isComponent) {
|
25
|
+
out.bf(key, ownerComponent, shouldPreserve);
|
26
|
+
|
27
|
+
if (!isPreserved && input.renderBody) {
|
28
|
+
input.renderBody(out);
|
29
|
+
}
|
30
|
+
|
31
|
+
out.ef();
|
32
|
+
} else {
|
33
|
+
if (isPreserved) {
|
34
|
+
if (input.b) {
|
35
|
+
out.___parent.___preserveBody = true;
|
36
|
+
} else {
|
37
|
+
out.beginElement("", null, key, ownerComponent);
|
38
|
+
out.___parent.___preserve = true;
|
39
|
+
out.endElement();
|
40
|
+
}
|
41
|
+
} else if (input.renderBody) {
|
42
|
+
input.renderBody(out);
|
43
|
+
}
|
44
|
+
}
|
45
|
+
};
|
@@ -0,0 +1,34 @@
|
|
1
|
+
var ComponentsContext = require("../../../runtime/components/ComponentsContext");
|
2
|
+
var getComponentsContext = ComponentsContext.___getComponentsContext;
|
3
|
+
|
4
|
+
module.exports = function render(input, out) {
|
5
|
+
var isComponent = !input.n;
|
6
|
+
var shouldPreserve = !("i" in input) || input.i;
|
7
|
+
var componentsContext = out.___components;
|
8
|
+
|
9
|
+
if (isComponent) {
|
10
|
+
out.bf(out.___assignedKey, out.___assignedComponentDef.___component, true);
|
11
|
+
}
|
12
|
+
|
13
|
+
if (input.renderBody) {
|
14
|
+
if (shouldPreserve) {
|
15
|
+
var parentPreserved = false;
|
16
|
+
|
17
|
+
if (componentsContext) {
|
18
|
+
parentPreserved = componentsContext.___isPreserved;
|
19
|
+
} else {
|
20
|
+
componentsContext = getComponentsContext(out);
|
21
|
+
}
|
22
|
+
|
23
|
+
componentsContext.___isPreserved = true;
|
24
|
+
input.renderBody(out);
|
25
|
+
componentsContext.___isPreserved = parentPreserved;
|
26
|
+
} else {
|
27
|
+
input.renderBody(out);
|
28
|
+
}
|
29
|
+
}
|
30
|
+
|
31
|
+
if (isComponent) {
|
32
|
+
out.ef();
|
33
|
+
}
|
34
|
+
};
|
@@ -2,12 +2,14 @@
|
|
2
2
|
load.e = exists;
|
3
3
|
module.exports = load;
|
4
4
|
|
5
|
-
function load() {
|
6
|
-
|
7
|
-
"The require API cannot be used in the browser in the current environment."
|
8
|
-
);
|
5
|
+
function load(id) {
|
6
|
+
return interopRequire(require(id));
|
9
7
|
}
|
10
8
|
|
11
9
|
function exists() {
|
12
10
|
return false;
|
13
11
|
}
|
12
|
+
|
13
|
+
function interopRequire(mod) {
|
14
|
+
return mod.default || mod;
|
15
|
+
}
|
@@ -148,7 +148,7 @@ module.exports = function defineRenderer(renderingLogic) {
|
|
148
148
|
renderer.template = template;
|
149
149
|
|
150
150
|
makeRenderable(renderer, renderer);
|
151
|
-
renderer.render = renderer.render.bind(
|
151
|
+
renderer.render = renderer.render.bind(renderer);
|
152
152
|
|
153
153
|
return renderer;
|
154
154
|
};
|