marko 5.31.7 → 5.31.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (34) hide show
  1. package/dist/runtime/components/update-manager.js +4 -17
  2. package/dist/runtime/createOut.js +1 -1
  3. package/dist/runtime/dom-insert.js +3 -3
  4. package/dist/runtime/helpers/_change-case.js +2 -2
  5. package/dist/runtime/helpers/dynamic-tag.js +4 -4
  6. package/dist/runtime/helpers/style-value.js +1 -1
  7. package/dist/runtime/html/AsyncStream.js +12 -12
  8. package/dist/runtime/html/helpers/_dynamic-attr.js +2 -2
  9. package/dist/runtime/html/helpers/attr.js +3 -3
  10. package/dist/runtime/html/helpers/data-marko.js +1 -1
  11. package/dist/runtime/html/helpers/escape-quotes.js +1 -1
  12. package/dist/runtime/html/helpers/escape-xml.js +1 -1
  13. package/dist/runtime/html/index.js +1 -1
  14. package/dist/runtime/renderable.js +3 -3
  15. package/dist/runtime/vdom/AsyncVDOMBuilder.js +70 -70
  16. package/dist/runtime/vdom/VComponent.js +3 -3
  17. package/dist/runtime/vdom/VDocumentFragment.js +6 -6
  18. package/dist/runtime/vdom/VElement.js +38 -38
  19. package/dist/runtime/vdom/VFragment.js +5 -5
  20. package/dist/runtime/vdom/VNode.js +31 -31
  21. package/dist/runtime/vdom/VText.js +8 -8
  22. package/dist/runtime/vdom/helpers/v-element.js +1 -1
  23. package/dist/runtime/vdom/helpers/v-text.js +1 -1
  24. package/dist/runtime/vdom/hot-reload.js +2 -2
  25. package/dist/runtime/vdom/index.js +1 -1
  26. package/dist/runtime/vdom/morphdom/fragment.js +4 -4
  27. package/dist/runtime/vdom/morphdom/helpers.js +4 -4
  28. package/dist/runtime/vdom/morphdom/index.js +33 -33
  29. package/dist/runtime/vdom/morphdom/specialElHandlers.js +6 -6
  30. package/dist/runtime/vdom/preserve-attrs.js +1 -1
  31. package/dist/runtime/vdom/vdom.js +14 -14
  32. package/docs/concise.md +22 -0
  33. package/package.json +1 -1
  34. 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.bZ_ === "option") {
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.cj_;
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.cc_("value")) {
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.cm_) {
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.cc_("multiple")) {
87
+ if (!toEl.cb_("multiple")) {
88
88
  var selected = 0;
89
89
  forEachOption(
90
90
  toEl,
91
91
  function (option, i) {
92
- if (option.cc_("selected")) {
92
+ if (option.cb_("selected")) {
93
93
  selected = i;
94
94
  }
95
95
  },
@@ -12,4 +12,4 @@ function removePreservedAttributes(attrs, props) {
12
12
  return attrs;
13
13
  }
14
14
 
15
- require("./VElement").cd_ = removePreservedAttributes;
15
+ require("./VElement").cc_ = removePreservedAttributes;
@@ -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.bJ_(virtualize(curChild, ownerComponent));
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.ce_(node, virtualizeChildNodes, ownerComponent);
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.bJ_(virtualize(curChild, ownerComponent));
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.bJ_(vdomNode || new VText(value.toString()));
69
- return this.cb_();
68
+ this.bI_(vdomNode || new VText(value.toString()));
69
+ return this.ca_();
70
70
  };
71
71
 
72
- Node_prototype.bO_ = function () {
73
- return this.bJ_(new VDocumentFragment());
72
+ Node_prototype.bN_ = function () {
73
+ return this.bI_(new VDocumentFragment());
74
74
  };
75
75
 
76
- exports.bt_ = VDocumentFragment;
77
- exports.bs_ = VElement;
78
- exports.bu_ = VText;
79
- exports.bv_ = VComponent;
80
- exports.bw_ = VFragment;
81
- exports.ce_ = virtualize;
82
- exports.bx_ = virtualizeHTML;
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "marko",
3
- "version": "5.31.7",
3
+ "version": "5.31.9",
4
4
  "description": "UI Components + streaming, async, high performance, HTML templating for Node.js and the browser.",
5
5
  "keywords": [
6
6
  "front-end",
@@ -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
- if (batch.___queue) {
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
- var batch = batchStack[batchStackLen - 1];
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 queued
87
+ // add the component to the unbatched queue
101
88
  scheduleUpdates();
102
89
  unbatchedQueue.push(component);
103
90
  }