marko 5.31.7 → 5.31.9
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/runtime/components/update-manager.js +4 -17
- package/dist/runtime/createOut.js +1 -1
- package/dist/runtime/dom-insert.js +3 -3
- package/dist/runtime/helpers/_change-case.js +2 -2
- package/dist/runtime/helpers/dynamic-tag.js +4 -4
- package/dist/runtime/helpers/style-value.js +1 -1
- package/dist/runtime/html/AsyncStream.js +12 -12
- package/dist/runtime/html/helpers/_dynamic-attr.js +2 -2
- package/dist/runtime/html/helpers/attr.js +3 -3
- package/dist/runtime/html/helpers/data-marko.js +1 -1
- package/dist/runtime/html/helpers/escape-quotes.js +1 -1
- package/dist/runtime/html/helpers/escape-xml.js +1 -1
- package/dist/runtime/html/index.js +1 -1
- package/dist/runtime/renderable.js +3 -3
- package/dist/runtime/vdom/AsyncVDOMBuilder.js +70 -70
- package/dist/runtime/vdom/VComponent.js +3 -3
- package/dist/runtime/vdom/VDocumentFragment.js +6 -6
- package/dist/runtime/vdom/VElement.js +38 -38
- package/dist/runtime/vdom/VFragment.js +5 -5
- package/dist/runtime/vdom/VNode.js +31 -31
- package/dist/runtime/vdom/VText.js +8 -8
- package/dist/runtime/vdom/helpers/v-element.js +1 -1
- package/dist/runtime/vdom/helpers/v-text.js +1 -1
- package/dist/runtime/vdom/hot-reload.js +2 -2
- package/dist/runtime/vdom/index.js +1 -1
- package/dist/runtime/vdom/morphdom/fragment.js +4 -4
- package/dist/runtime/vdom/morphdom/helpers.js +4 -4
- package/dist/runtime/vdom/morphdom/index.js +33 -33
- package/dist/runtime/vdom/morphdom/specialElHandlers.js +6 -6
- package/dist/runtime/vdom/preserve-attrs.js +1 -1
- package/dist/runtime/vdom/vdom.js +14 -14
- package/docs/concise.md +22 -0
- package/package.json +1 -1
- package/src/runtime/components/update-manager.js +4 -17
@@ -13,13 +13,13 @@ function forEachOption(el, fn, i) {
|
|
13
13
|
var curChild = el.ay_;
|
14
14
|
|
15
15
|
while (curChild) {
|
16
|
-
if (curChild.
|
16
|
+
if (curChild.bY_ === "option") {
|
17
17
|
fn(curChild, ++i);
|
18
18
|
} else {
|
19
19
|
i = forEachOption(curChild, fn, i);
|
20
20
|
}
|
21
21
|
|
22
|
-
curChild = curChild.
|
22
|
+
curChild = curChild.ci_;
|
23
23
|
}
|
24
24
|
|
25
25
|
return i;
|
@@ -52,13 +52,13 @@ SpecialElHandlers.prototype = {
|
|
52
52
|
fromEl.value = toEl.e_;
|
53
53
|
}
|
54
54
|
|
55
|
-
if (fromEl.hasAttribute("value") && !toEl.
|
55
|
+
if (fromEl.hasAttribute("value") && !toEl.cb_("value")) {
|
56
56
|
fromEl.removeAttribute("value");
|
57
57
|
}
|
58
58
|
},
|
59
59
|
|
60
60
|
textarea: function (fromEl, toEl) {
|
61
|
-
if (toEl.
|
61
|
+
if (toEl.cl_) {
|
62
62
|
return;
|
63
63
|
}
|
64
64
|
|
@@ -84,12 +84,12 @@ SpecialElHandlers.prototype = {
|
|
84
84
|
}
|
85
85
|
},
|
86
86
|
select: function (fromEl, toEl) {
|
87
|
-
if (!toEl.
|
87
|
+
if (!toEl.cb_("multiple")) {
|
88
88
|
var selected = 0;
|
89
89
|
forEachOption(
|
90
90
|
toEl,
|
91
91
|
function (option, i) {
|
92
|
-
if (option.
|
92
|
+
if (option.cb_("selected")) {
|
93
93
|
selected = i;
|
94
94
|
}
|
95
95
|
},
|
@@ -11,7 +11,7 @@ var specialHtmlRegexp = /[&<]/;
|
|
11
11
|
function virtualizeChildNodes(node, vdomParent, ownerComponent) {
|
12
12
|
var curChild = node.firstChild;
|
13
13
|
while (curChild) {
|
14
|
-
vdomParent.
|
14
|
+
vdomParent.bI_(virtualize(curChild, ownerComponent));
|
15
15
|
curChild = curChild.nextSibling;
|
16
16
|
}
|
17
17
|
}
|
@@ -19,7 +19,7 @@ function virtualizeChildNodes(node, vdomParent, ownerComponent) {
|
|
19
19
|
function virtualize(node, ownerComponent) {
|
20
20
|
switch (node.nodeType) {
|
21
21
|
case 1:
|
22
|
-
return VElement.
|
22
|
+
return VElement.cd_(node, virtualizeChildNodes, ownerComponent);
|
23
23
|
case 3:
|
24
24
|
return new VText(node.nodeValue, ownerComponent);
|
25
25
|
case 11:
|
@@ -38,7 +38,7 @@ function virtualizeHTML(html, ownerComponent) {
|
|
38
38
|
var curChild = parseHTML(html);
|
39
39
|
|
40
40
|
while (curChild) {
|
41
|
-
vdomFragment.
|
41
|
+
vdomFragment.bI_(virtualize(curChild, ownerComponent));
|
42
42
|
curChild = curChild.nextSibling;
|
43
43
|
}
|
44
44
|
|
@@ -65,18 +65,18 @@ Node_prototype.t = function (value) {
|
|
65
65
|
}
|
66
66
|
}
|
67
67
|
|
68
|
-
this.
|
69
|
-
return this.
|
68
|
+
this.bI_(vdomNode || new VText(value.toString()));
|
69
|
+
return this.ca_();
|
70
70
|
};
|
71
71
|
|
72
|
-
Node_prototype.
|
73
|
-
return this.
|
72
|
+
Node_prototype.bN_ = function () {
|
73
|
+
return this.bI_(new VDocumentFragment());
|
74
74
|
};
|
75
75
|
|
76
|
-
exports.
|
77
|
-
exports.
|
78
|
-
exports.
|
79
|
-
exports.
|
80
|
-
exports.
|
81
|
-
exports.
|
82
|
-
exports.
|
76
|
+
exports.bs_ = VDocumentFragment;
|
77
|
+
exports.br_ = VElement;
|
78
|
+
exports.bt_ = VText;
|
79
|
+
exports.bu_ = VComponent;
|
80
|
+
exports.bv_ = VFragment;
|
81
|
+
exports.cd_ = virtualize;
|
82
|
+
exports.bw_ = virtualizeHTML;
|
package/docs/concise.md
CHANGED
@@ -38,6 +38,28 @@ _output.html_
|
|
38
38
|
|
39
39
|
> **ProTip:** These shorthand attributes are available within the HTML syntax as well
|
40
40
|
|
41
|
+
## Attributes on multiple lines
|
42
|
+
|
43
|
+
If a component has lots of attributes, you can spread them across multiple lines by surrounding them with square brackets
|
44
|
+
|
45
|
+
_input.marko_
|
46
|
+
|
47
|
+
```marko
|
48
|
+
div [
|
49
|
+
id="hello"
|
50
|
+
class=["class1", "class2", "class3"]
|
51
|
+
style={ border: "1px solid red" }
|
52
|
+
] -- hello
|
53
|
+
```
|
54
|
+
|
55
|
+
_output.html_
|
56
|
+
|
57
|
+
```html
|
58
|
+
<div id="hello" class="class1 class2 class3" style="border:1px solid red">
|
59
|
+
hello
|
60
|
+
</div>
|
61
|
+
```
|
62
|
+
|
41
63
|
## Text
|
42
64
|
|
43
65
|
Text in concise mode is denoted by two or more dashes (`--`).
|
package/package.json
CHANGED
@@ -53,9 +53,7 @@ function batchUpdate(func) {
|
|
53
53
|
// is the outer batched update. After the outer
|
54
54
|
// batched update completes we invoke the "afterUpdate"
|
55
55
|
// event listeners.
|
56
|
-
var batch =
|
57
|
-
___queue: null,
|
58
|
-
};
|
56
|
+
var batch = [];
|
59
57
|
|
60
58
|
batchStack.push(batch);
|
61
59
|
|
@@ -65,9 +63,7 @@ function batchUpdate(func) {
|
|
65
63
|
try {
|
66
64
|
// Update all of the components that where queued up
|
67
65
|
// in this batch (if any)
|
68
|
-
|
69
|
-
updateComponents(batch.___queue);
|
70
|
-
}
|
66
|
+
updateComponents(batch);
|
71
67
|
} finally {
|
72
68
|
// Now that we have completed the update of all the components
|
73
69
|
// in this batch we need to remove it off the top of the stack
|
@@ -84,20 +80,11 @@ function queueComponentUpdate(component) {
|
|
84
80
|
// If the stack has a non-zero length then we know that a batch has
|
85
81
|
// been started so we can just queue the component on the top batch. When
|
86
82
|
// the batch is ended this component will be updated.
|
87
|
-
|
88
|
-
|
89
|
-
// We default the batch queue to null to avoid creating an Array instance
|
90
|
-
// unnecessarily. If it is null then we create a new Array, otherwise
|
91
|
-
// we push it onto the existing Array queue
|
92
|
-
if (batch.___queue) {
|
93
|
-
batch.___queue.push(component);
|
94
|
-
} else {
|
95
|
-
batch.___queue = [component];
|
96
|
-
}
|
83
|
+
batchStack[batchStackLen - 1].push(component);
|
97
84
|
} else {
|
98
85
|
// We are not within a batched update. We need to schedule a batch update
|
99
86
|
// for the nextTick (if that hasn't been done already) and we will
|
100
|
-
// add the component to the unbatched
|
87
|
+
// add the component to the unbatched queue
|
101
88
|
scheduleUpdates();
|
102
89
|
unbatchedQueue.push(component);
|
103
90
|
}
|