marko 5.39.2 → 5.39.3

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.
Files changed (85) hide show
  1. package/dist/node_modules/@internal/components-registry/index-browser.js +6 -1
  2. package/dist/node_modules/@internal/components-registry/index.js +1 -1
  3. package/dist/node_modules/@internal/components-util/index-browser.js +11 -11
  4. package/dist/node_modules/@internal/components-util/index.js +4 -4
  5. package/dist/node_modules/@internal/create-readable/index-browser.js +1 -1
  6. package/dist/node_modules/@internal/create-readable/index.js +9 -9
  7. package/dist/node_modules/@internal/preserve-tag/index-browser.js +5 -5
  8. package/dist/node_modules/@internal/preserve-tag/index.js +1 -1
  9. package/dist/node_modules/@internal/set-immediate/index-worker.js +1 -1
  10. package/dist/node_modules/@internal/set-immediate/index.js +1 -1
  11. package/dist/runtime/RenderResult.js +3 -3
  12. package/dist/runtime/components/Component.js +66 -66
  13. package/dist/runtime/components/ComponentDef.js +12 -12
  14. package/dist/runtime/components/ComponentsContext.js +3 -3
  15. package/dist/runtime/components/GlobalComponentsContext.js +3 -3
  16. package/dist/runtime/components/KeySequence.js +3 -3
  17. package/dist/runtime/components/ServerComponent.js +1 -1
  18. package/dist/runtime/components/State.js +18 -18
  19. package/dist/runtime/components/attach-detach.js +7 -7
  20. package/dist/runtime/components/dom-data.js +2 -2
  21. package/dist/runtime/components/event-delegation.js +5 -5
  22. package/dist/runtime/components/legacy/defineRenderer-legacy.js +8 -8
  23. package/dist/runtime/components/legacy/dependencies/index.js +7 -7
  24. package/dist/runtime/components/legacy/renderer-legacy.js +21 -21
  25. package/dist/runtime/components/renderer.js +20 -20
  26. package/dist/runtime/components/update-manager.js +3 -3
  27. package/dist/runtime/createOut.js +1 -1
  28. package/dist/runtime/dom-insert.js +5 -5
  29. package/dist/runtime/helpers/_change-case.js +2 -2
  30. package/dist/runtime/helpers/dynamic-tag.js +9 -9
  31. package/dist/runtime/helpers/load-tag-browser.js +59 -0
  32. package/dist/runtime/helpers/load-tag-event-trigger.js +25 -0
  33. package/dist/runtime/helpers/load-tag-idle-trigger.js +15 -0
  34. package/dist/runtime/helpers/load-tag-media-trigger.js +17 -0
  35. package/dist/runtime/helpers/load-tag-race-trigger.js +22 -0
  36. package/dist/runtime/helpers/load-tag-visible-trigger.js +35 -0
  37. package/dist/runtime/helpers/load-tag.js +168 -0
  38. package/dist/runtime/helpers/render-tag.js +1 -1
  39. package/dist/runtime/helpers/serialize-noop.js +1 -1
  40. package/dist/runtime/helpers/style-value.js +1 -1
  41. package/dist/runtime/helpers/tags-compat/runtime-dom.js +16 -16
  42. package/dist/runtime/helpers/tags-compat/runtime-html.js +2 -2
  43. package/dist/runtime/html/AsyncStream.js +20 -20
  44. package/dist/runtime/html/BufferedWriter.js +1 -1
  45. package/dist/runtime/html/helpers/_dynamic-attr.js +2 -2
  46. package/dist/runtime/html/helpers/attr.js +2 -2
  47. package/dist/runtime/html/helpers/data-marko.js +1 -1
  48. package/dist/runtime/html/helpers/escape-xml.js +1 -1
  49. package/dist/runtime/html/index.js +1 -1
  50. package/dist/runtime/renderable.js +2 -2
  51. package/dist/runtime/vdom/AsyncVDOMBuilder.js +83 -83
  52. package/dist/runtime/vdom/VComment.js +7 -7
  53. package/dist/runtime/vdom/VComponent.js +4 -4
  54. package/dist/runtime/vdom/VDocumentFragment.js +6 -6
  55. package/dist/runtime/vdom/VElement.js +35 -35
  56. package/dist/runtime/vdom/VFragment.js +7 -7
  57. package/dist/runtime/vdom/VNode.js +33 -33
  58. package/dist/runtime/vdom/VText.js +8 -8
  59. package/dist/runtime/vdom/helpers/const-element.js +3 -3
  60. package/dist/runtime/vdom/hot-reload.js +8 -8
  61. package/dist/runtime/vdom/index.js +1 -1
  62. package/dist/runtime/vdom/morphdom/fragment.js +4 -4
  63. package/dist/runtime/vdom/morphdom/helpers.js +5 -5
  64. package/dist/runtime/vdom/morphdom/index.js +57 -57
  65. package/dist/runtime/vdom/vdom.js +15 -15
  66. package/dist/translator/index.js +51 -2
  67. package/dist/translator/tag/custom-tag.js +4 -2
  68. package/dist/translator/tag/native-tag[html]/index.js +37 -11
  69. package/dist/translator/util/get-component-files.js +1 -1
  70. package/dist/translator/util/load-import.js +288 -0
  71. package/package.json +3 -3
  72. package/src/node_modules/@internal/components-registry/index-browser.js +5 -0
  73. package/src/runtime/helpers/load-tag-browser.js +59 -0
  74. package/src/runtime/helpers/load-tag-event-trigger.js +25 -0
  75. package/src/runtime/helpers/load-tag-idle-trigger.js +15 -0
  76. package/src/runtime/helpers/load-tag-media-trigger.js +17 -0
  77. package/src/runtime/helpers/load-tag-race-trigger.js +22 -0
  78. package/src/runtime/helpers/load-tag-visible-trigger.js +35 -0
  79. package/src/runtime/helpers/load-tag.js +168 -0
  80. package/src/runtime/helpers/tags-compat/runtime-dom.js +2 -2
  81. package/src/runtime/helpers/tags-compat/runtime-html.js +1 -1
  82. package/src/translator/index.js +50 -1
  83. package/src/translator/tag/custom-tag.js +4 -2
  84. package/src/translator/tag/native-tag[html]/index.js +42 -16
  85. package/src/translator/util/load-import.js +288 -0
@@ -3,7 +3,7 @@
3
3
  var inherit = require("raptor-util/inherit");
4
4
  var componentsUtil = require("@internal/components-util");
5
5
  var domData = require("../components/dom-data");
6
- var vElementByDOMNode = domData._M_;
6
+ var vElementByDOMNode = domData._N_;
7
7
  var VNode = require("./VNode");
8
8
  var isTextOnly = require("./is-text-only");
9
9
  var ATTR_XLINK_HREF = "xlink:href";
@@ -81,17 +81,17 @@ function assign(a, b) {
81
81
  }
82
82
 
83
83
  function VElementClone(other) {
84
- this.ce_ = other.ce_;
85
- this.cb_ = null;
84
+ this.cf_ = other.cf_;
86
85
  this.cc_ = null;
86
+ this.cd_ = null;
87
87
 
88
- this.ca_ = other.ca_;
89
- this.cf_ = other.cf_;
90
- this._Q_ = other._Q_;
88
+ this.cb_ = other.cb_;
91
89
  this.cg_ = other.cg_;
92
- this.u_ = other.u_;
90
+ this._R_ = other._R_;
93
91
  this.ch_ = other.ch_;
92
+ this.u_ = other.u_;
94
93
  this.ci_ = other.ci_;
94
+ this.cj_ = other.cj_;
95
95
  }
96
96
 
97
97
  function VElement(
@@ -103,7 +103,7 @@ childCount,
103
103
  flags,
104
104
  props)
105
105
  {
106
- this.bY_(childCount, ownerComponent);
106
+ this.bZ_(childCount, ownerComponent);
107
107
 
108
108
  var constId;
109
109
 
@@ -111,21 +111,21 @@ props)
111
111
  constId = props.i;
112
112
  }
113
113
 
114
- this.ca_ = key;
114
+ this.cb_ = key;
115
115
  this.u_ = flags || 0;
116
- this.cf_ = attrs || EMPTY_OBJECT;
117
- this._Q_ = props || EMPTY_OBJECT;
118
- this.cg_ = tagName;
119
- this.ch_ = "";
120
- this.ci_ = constId;
116
+ this.cg_ = attrs || EMPTY_OBJECT;
117
+ this._R_ = props || EMPTY_OBJECT;
118
+ this.ch_ = tagName;
119
+ this.ci_ = "";
120
+ this.cj_ = constId;
121
+ this.ag_ = false;
121
122
  this.af_ = false;
122
- this.ae_ = false;
123
123
  }
124
124
 
125
125
  VElement.prototype = {
126
- c__: 1,
126
+ ca_: 1,
127
127
 
128
- bS_: function () {
128
+ bT_: function () {
129
129
  return new VElementClone(this);
130
130
  },
131
131
 
@@ -137,7 +137,7 @@ VElement.prototype = {
137
137
  * @param {int|null} childCount The number of child nodes (or `null` if not known)
138
138
  */
139
139
  e: function (tagName, attrs, key, ownerComponent, childCount, flags, props) {
140
- var child = this.bR_(
140
+ var child = this.bS_(
141
141
  new VElement(
142
142
  tagName,
143
143
  attrs,
@@ -150,7 +150,7 @@ VElement.prototype = {
150
150
  );
151
151
 
152
152
  if (childCount === 0) {
153
- return this.cj_();
153
+ return this.ck_();
154
154
  } else {
155
155
  return child;
156
156
  }
@@ -163,15 +163,15 @@ VElement.prototype = {
163
163
  * @param {String} value The value for the new Comment node
164
164
  */
165
165
  n: function (node, ownerComponent) {
166
- node = node.bS_();
167
- node._O_ = ownerComponent;
168
- this.bR_(node);
169
- return this.cj_();
166
+ node = node.bT_();
167
+ node._P_ = ownerComponent;
168
+ this.bS_(node);
169
+ return this.ck_();
170
170
  },
171
171
 
172
- br_: function (host, parentNamespaceURI) {
173
- var tagName = this.cg_;
174
- var attributes = this.cf_;
172
+ bs_: function (host, parentNamespaceURI) {
173
+ var tagName = this.ch_;
174
+ var attributes = this.cg_;
175
175
  var namespaceURI = DEFAULT_NS[tagName] || parentNamespaceURI || NS_HTML;
176
176
 
177
177
  var flags = this.u_;
@@ -196,7 +196,7 @@ VElement.prototype = {
196
196
  }
197
197
 
198
198
  if (isTextOnly(tagName)) {
199
- el.textContent = this.ch_;
199
+ el.textContent = this.ci_;
200
200
  }
201
201
  }
202
202
 
@@ -251,7 +251,7 @@ function virtualizeElement(node, virtualizeChildNodes, ownerComponent) {
251
251
  );
252
252
 
253
253
  if (isTextOnly(tagName)) {
254
- vdomEl.ch_ = node.textContent;
254
+ vdomEl.ci_ = node.textContent;
255
255
  } else if (virtualizeChildNodes) {
256
256
  virtualizeChildNodes(node, vdomEl, ownerComponent);
257
257
  }
@@ -259,18 +259,18 @@ function virtualizeElement(node, virtualizeChildNodes, ownerComponent) {
259
259
  return vdomEl;
260
260
  }
261
261
 
262
- VElement.ck_ = virtualizeElement;
262
+ VElement.cl_ = virtualizeElement;
263
263
 
264
- VElement.cl_ = function (fromEl, vFromEl, toEl) {
264
+ VElement.cm_ = function (fromEl, vFromEl, toEl) {
265
265
  var fromFlags = vFromEl.u_;
266
266
  var toFlags = toEl.u_;
267
- var attrs = toEl.cf_;
267
+ var attrs = toEl.cg_;
268
268
 
269
269
  if (toFlags & FLAG_CUSTOM_ELEMENT) {
270
270
  return assign(fromEl, attrs);
271
271
  }
272
272
 
273
- var props = toEl._Q_;
273
+ var props = toEl._R_;
274
274
  var attrName;
275
275
 
276
276
  // We use expando properties to associate the previous HTML
@@ -281,7 +281,7 @@ VElement.cl_ = function (fromEl, vFromEl, toEl) {
281
281
  // real VElement node will not have the expando property
282
282
  // so we build the attribute map from the expando property
283
283
 
284
- var oldAttrs = vFromEl.cf_;
284
+ var oldAttrs = vFromEl.cg_;
285
285
 
286
286
  if (oldAttrs === attrs) {
287
287
  // For constant attributes the same object will be provided
@@ -319,7 +319,7 @@ VElement.cl_ = function (fromEl, vFromEl, toEl) {
319
319
  }
320
320
 
321
321
  var preserve = props && props.pa || EMPTY_OBJECT;
322
- var specialAttrs = specialElHandlers[toEl.cg_] || EMPTY_OBJECT;
322
+ var specialAttrs = specialElHandlers[toEl.ch_] || EMPTY_OBJECT;
323
323
  var specialAttr;
324
324
 
325
325
  // Loop over all of the attributes in the attribute map and compare
@@ -356,7 +356,7 @@ VElement.cl_ = function (fromEl, vFromEl, toEl) {
356
356
  // was not a virtualized node (i.e., a node that was not rendered by a
357
357
  // Marko template, but rather a node that was created from an HTML
358
358
  // string or a real DOM node).
359
- if (toEl.ca_ === null || fromFlags & FLAG_SPREAD_ATTRS) {
359
+ if (toEl.cb_ === null || fromFlags & FLAG_SPREAD_ATTRS) {
360
360
  for (attrName in oldAttrs) {
361
361
  if (!(attrName in attrs)) {
362
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
3
  var keysByDOMNode = domData._p_;
4
- var vElementByDOMNode = domData._M_;
4
+ var vElementByDOMNode = domData._N_;
5
5
  var createFragmentNode = require("./morphdom/fragment")._m_;
6
6
  var VNode = require("./VNode");
7
7
 
8
8
  function VFragment(key, ownerComponent, preserve) {
9
- this.bY_(null /* childCount */, ownerComponent);
10
- this.ca_ = key;
11
- this.af_ = preserve;
9
+ this.bZ_(null /* childCount */, ownerComponent);
10
+ this.cb_ = key;
11
+ this.ag_ = preserve;
12
12
  }
13
13
 
14
14
  VFragment.prototype = {
15
- c__: 12,
16
- br_: function () {
15
+ ca_: 12,
16
+ bs_: function () {
17
17
  var fragment = createFragmentNode();
18
- keysByDOMNode.set(fragment, this.ca_);
18
+ keysByDOMNode.set(fragment, this.cb_);
19
19
  vElementByDOMNode.set(fragment, this);
20
20
  return fragment;
21
21
  }
@@ -3,78 +3,78 @@
3
3
  function VNode() {}
4
4
 
5
5
  VNode.prototype = {
6
- bY_: function (finalChildCount, ownerComponent) {
7
- this.cm_ = finalChildCount;
8
- this.cn_ = 0;
9
- this.ce_ = null;
10
- this.co_ = null;
11
- this.cb_ = null;
6
+ bZ_: function (finalChildCount, ownerComponent) {
7
+ this.cn_ = finalChildCount;
8
+ this.co_ = 0;
9
+ this.cf_ = null;
10
+ this.cp_ = null;
12
11
  this.cc_ = null;
13
- this._O_ = ownerComponent;
12
+ this.cd_ = null;
13
+ this._P_ = ownerComponent;
14
14
  },
15
15
 
16
- get aC_() {
17
- var firstChild = this.ce_;
16
+ get aD_() {
17
+ var firstChild = this.cf_;
18
18
 
19
- if (firstChild && firstChild.cd_) {
20
- var nestedFirstChild = firstChild.aC_;
19
+ if (firstChild && firstChild.ce_) {
20
+ var nestedFirstChild = firstChild.aD_;
21
21
  // The first child is a DocumentFragment node.
22
22
  // If the DocumentFragment node has a first child then we will return that.
23
23
  // Otherwise, the DocumentFragment node is not *really* the first child and
24
24
  // we need to skip to its next sibling
25
- return nestedFirstChild || firstChild.cp_;
25
+ return nestedFirstChild || firstChild.cq_;
26
26
  }
27
27
 
28
28
  return firstChild;
29
29
  },
30
30
 
31
- get cp_() {
32
- var nextSibling = this.cc_;
31
+ get cq_() {
32
+ var nextSibling = this.cd_;
33
33
 
34
34
  if (nextSibling) {
35
- if (nextSibling.cd_) {
36
- var firstChild = nextSibling.aC_;
37
- return firstChild || nextSibling.cp_;
35
+ if (nextSibling.ce_) {
36
+ var firstChild = nextSibling.aD_;
37
+ return firstChild || nextSibling.cq_;
38
38
  }
39
39
  } else {
40
- var parentNode = this.cb_;
41
- if (parentNode && parentNode.cd_) {
42
- return parentNode.cp_;
40
+ var parentNode = this.cc_;
41
+ if (parentNode && parentNode.ce_) {
42
+ return parentNode.cq_;
43
43
  }
44
44
  }
45
45
 
46
46
  return nextSibling;
47
47
  },
48
48
 
49
- bR_: function (child) {
50
- this.cn_++;
49
+ bS_: function (child) {
50
+ this.co_++;
51
51
 
52
- if (hasTextContent(this.cg_)) {
53
- if (child.cq_) {
54
- this.ch_ += child.bZ_;
52
+ if (hasTextContent(this.ch_)) {
53
+ if (child.cr_) {
54
+ this.ci_ += child.c__;
55
55
  } else {
56
56
  throw TypeError();
57
57
  }
58
58
  } else {
59
- var lastChild = this.co_;
59
+ var lastChild = this.cp_;
60
60
 
61
- child.cb_ = this;
61
+ child.cc_ = this;
62
62
 
63
63
  if (lastChild) {
64
- lastChild.cc_ = child;
64
+ lastChild.cd_ = child;
65
65
  } else {
66
- this.ce_ = child;
66
+ this.cf_ = child;
67
67
  }
68
68
 
69
- this.co_ = child;
69
+ this.cp_ = child;
70
70
  }
71
71
 
72
72
  return child;
73
73
  },
74
74
 
75
- cj_: function finishChild() {
76
- if (this.cn_ === this.cm_ && this.cb_) {
77
- return this.cb_.cj_();
75
+ ck_: function finishChild() {
76
+ if (this.co_ === this.cn_ && this.cc_) {
77
+ return this.cc_.ck_();
78
78
  } else {
79
79
  return this;
80
80
  }
@@ -2,21 +2,21 @@
2
2
  var VNode = require("./VNode");
3
3
 
4
4
  function VText(value, ownerComponent) {
5
- this.bY_(-1 /* no children */, ownerComponent);
6
- this.bZ_ = value;
5
+ this.bZ_(-1 /* no children */, ownerComponent);
6
+ this.c__ = value;
7
7
  }
8
8
 
9
9
  VText.prototype = {
10
- cq_: true,
10
+ cr_: true,
11
11
 
12
- c__: 3,
12
+ ca_: 3,
13
13
 
14
- br_: function (host) {
15
- return (host.ownerDocument || host).createTextNode(this.bZ_);
14
+ bs_: function (host) {
15
+ return (host.ownerDocument || host).createTextNode(this.c__);
16
16
  },
17
17
 
18
- bS_: function () {
19
- return new VText(this.bZ_);
18
+ bT_: function () {
19
+ return new VText(this.c__);
20
20
  }
21
21
  };
22
22
 
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
- var VElement = require("../vdom").bz_;
3
+ var VElement = require("../vdom").bA_;
4
4
  var i = 0;
5
5
 
6
6
  module.exports = function (tagName, attrs, childCount) {
@@ -13,12 +13,12 @@ function ConstVElement(tagName, attrs, childCount) {
13
13
 
14
14
  ConstVElement.prototype = Object.create(VElement.prototype);
15
15
  ConstVElement.prototype.e = function (tagName, attrs, childCount) {
16
- var child = this.bR_(
16
+ var child = this.bS_(
17
17
  new ConstVElement(tagName, attrs, childCount)
18
18
  );
19
19
 
20
20
  if (childCount === 0) {
21
- return this.cj_();
21
+ return this.ck_();
22
22
  } else {
23
23
  return child;
24
24
  }
@@ -36,7 +36,7 @@ exports.t = runtime.t = function (typeName) {
36
36
  if (hasLifecycleChanged(instance.__proto__, newProto)) {
37
37
  var renderer = instance.R_;
38
38
  instance.R_ = (input, out) => {
39
- instance.aH_(input, out);
39
+ instance.aI_(input, out);
40
40
  if (instance.onInput) {
41
41
  input = instance.onInput(input, out) || input;
42
42
  }
@@ -44,13 +44,13 @@ exports.t = runtime.t = function (typeName) {
44
44
  instance.R_(input, out);
45
45
  };
46
46
 
47
- instance.cr_ = true;
48
- instance.aq_();
47
+ instance.cs_ = true;
48
+ instance.ar_();
49
49
  instance._z_ = false;
50
50
 
51
- if (instance.ak_) {
52
- instance.ak_.removeAllListeners();
53
- instance.ak_ = null;
51
+ if (instance.al_) {
52
+ instance.al_.removeAllListeners();
53
+ instance.al_ = null;
54
54
  }
55
55
  }
56
56
 
@@ -78,7 +78,7 @@ registry._I_ = function (typeName, id) {
78
78
  if (instances) {
79
79
  instances.add(instance);
80
80
  instance.once("destroy", function () {
81
- if (!instance.cr_) {
81
+ if (!instance.cs_) {
82
82
  instances.delete(instance);
83
83
  }
84
84
  });
@@ -104,7 +104,7 @@ function hasLifecycleChanged(oldProto, newProto) {
104
104
  }
105
105
 
106
106
  function batchUpdate() {
107
- updateManager.aA_(function () {
107
+ updateManager.aB_(function () {
108
108
  var pending = queue;
109
109
  queue = undefined;
110
110
 
@@ -17,7 +17,7 @@ function Template(typeName) {
17
17
  }
18
18
 
19
19
  var AsyncVDOMBuilder = require("./AsyncVDOMBuilder");
20
- require("../createOut").bg_(
20
+ require("../createOut").bh_(
21
21
  Template.prototype.createOut = function createOut(
22
22
  globalData,
23
23
  parent,
@@ -1,5 +1,5 @@
1
1
  "use strict";var helpers = require("./helpers");
2
- var insertBefore = helpers.bh_;
2
+ var insertBefore = helpers.bi_;
3
3
 
4
4
  var fragmentPrototype = {
5
5
  nodeType: 12,
@@ -80,8 +80,8 @@ function createFragmentNode(startNode, nextNode, parentNode) {
80
80
 
81
81
  function beginFragmentNode(startNode, parentNode) {
82
82
  var fragment = createFragmentNode(startNode, null, parentNode);
83
- fragment.cs_ = function (nextNode) {
84
- fragment.cs_ = null;
83
+ fragment.ct_ = function (nextNode) {
84
+ fragment.ct_ = null;
85
85
  insertBefore(
86
86
  fragment.endNode,
87
87
  nextNode,
@@ -92,4 +92,4 @@ function beginFragmentNode(startNode, parentNode) {
92
92
  }
93
93
 
94
94
  exports._m_ = createFragmentNode;
95
- exports.ct_ = beginFragmentNode;
95
+ exports.cu_ = beginFragmentNode;
@@ -35,8 +35,8 @@ function removeChild(node) {
35
35
  node.parentNode.removeChild(node);
36
36
  }
37
37
 
38
- exports.bh_ = insertBefore;
39
- exports.bi_ = insertAfter;
40
- exports.cp_ = nextSibling;
41
- exports.aC_ = firstChild;
42
- exports.bj_ = removeChild;
38
+ exports.bi_ = insertBefore;
39
+ exports.bj_ = insertAfter;
40
+ exports.cq_ = nextSibling;
41
+ exports.aD_ = firstChild;
42
+ exports.bk_ = removeChild;