marko 5.24.0 → 5.25.0

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 (59) hide show
  1. package/dist/runtime/components/entry/index-browser.js +2 -6
  2. package/dist/runtime/components/registry/index-browser.js +444 -20
  3. package/dist/runtime/components/registry/index.js +1 -1
  4. package/dist/runtime/components/renderer.js +4 -4
  5. package/dist/runtime/components/update-manager.js +7 -7
  6. package/dist/runtime/components/util/index-browser.js +4 -4
  7. package/dist/runtime/components/util/index.js +2 -2
  8. package/dist/runtime/createOut.js +1 -1
  9. package/dist/runtime/dom-insert.js +4 -4
  10. package/dist/runtime/helpers/_change-case.js +2 -2
  11. package/dist/runtime/helpers/dynamic-tag.js +4 -4
  12. package/dist/runtime/helpers/repeatable.js +12 -0
  13. package/dist/runtime/helpers/self-iterator.js +3 -0
  14. package/dist/runtime/helpers/style-value.js +1 -1
  15. package/dist/runtime/html/AsyncStream.js +14 -14
  16. package/dist/runtime/html/BufferedWriter.js +2 -2
  17. package/dist/runtime/html/create-readable/index-browser.js +1 -1
  18. package/dist/runtime/html/create-readable/index.js +9 -9
  19. package/dist/runtime/html/helpers/_dynamic-attr.js +2 -2
  20. package/dist/runtime/html/helpers/attr.js +3 -3
  21. package/dist/runtime/html/helpers/data-marko.js +1 -1
  22. package/dist/runtime/html/helpers/escape-quotes.js +1 -1
  23. package/dist/runtime/html/helpers/escape-xml.js +1 -1
  24. package/dist/runtime/html/index.js +2 -2
  25. package/dist/runtime/renderable.js +5 -5
  26. package/dist/runtime/setImmediate/index-browser.js +1 -1
  27. package/dist/runtime/setImmediate/index-worker.js +2 -2
  28. package/dist/runtime/setImmediate/index.js +2 -2
  29. package/dist/runtime/vdom/AsyncVDOMBuilder.js +74 -74
  30. package/dist/runtime/vdom/VComponent.js +3 -3
  31. package/dist/runtime/vdom/VDocumentFragment.js +7 -7
  32. package/dist/runtime/vdom/VElement.js +44 -44
  33. package/dist/runtime/vdom/VFragment.js +5 -5
  34. package/dist/runtime/vdom/VNode.js +32 -32
  35. package/dist/runtime/vdom/VText.js +8 -8
  36. package/dist/runtime/vdom/helpers/v-element.js +1 -1
  37. package/dist/runtime/vdom/helpers/v-text.js +1 -1
  38. package/dist/runtime/vdom/hot-reload.js +4 -4
  39. package/dist/runtime/vdom/index.js +2 -2
  40. package/dist/runtime/vdom/morphdom/fragment.js +4 -4
  41. package/dist/runtime/vdom/morphdom/helpers.js +4 -4
  42. package/dist/runtime/vdom/morphdom/index.js +36 -36
  43. package/dist/runtime/vdom/morphdom/specialElHandlers.js +6 -6
  44. package/dist/runtime/vdom/preserve-attrs.js +1 -1
  45. package/dist/runtime/vdom/vdom.js +14 -14
  46. package/docs/body-content.md +37 -18
  47. package/docs/typescript.md +12 -12
  48. package/index.d.ts +4 -2
  49. package/package.json +3 -3
  50. package/src/runtime/components/entry/index-browser.js +2 -6
  51. package/src/runtime/components/registry/index-browser.js +451 -27
  52. package/src/runtime/helpers/repeatable.js +12 -0
  53. package/src/runtime/helpers/self-iterator.js +3 -0
  54. package/dist/runtime/components/init-components/index-browser.js +0 -453
  55. package/dist/runtime/components/init-components/index.js +0 -2
  56. package/dist/runtime/components/init-components/package.json +0 -11
  57. package/src/runtime/components/init-components/index-browser.js +0 -453
  58. package/src/runtime/components/init-components/index.js +0 -1
  59. package/src/runtime/components/init-components/package.json +0 -11
@@ -37,7 +37,7 @@ customEvents)
37
37
  var component = componentDef && componentDef.h_;
38
38
  if (typeof tag === "string") {
39
39
  if (renderBody) {
40
- out.aM_(
40
+ out.aJ_(
41
41
  tag,
42
42
  attrs,
43
43
  key,
@@ -45,9 +45,9 @@ customEvents)
45
45
  addEvents(componentDef, customEvents, props));
46
46
 
47
47
  renderBody(out);
48
- out.aN_();
48
+ out.aK_();
49
49
  } else {
50
- out.aO_(
50
+ out.aL_(
51
51
  tag,
52
52
  attrs,
53
53
  key,
@@ -144,7 +144,7 @@ function attrsToCamelCase(attrs) {
144
144
  var result = {};
145
145
 
146
146
  for (var key in attrs) {
147
- result[changeCase.aL_(key)] = attrs[key];
147
+ result[changeCase.aI_(key)] = attrs[key];
148
148
  }
149
149
 
150
150
  return result;
@@ -0,0 +1,12 @@
1
+ "use strict";module.exports = function repeatable(a, b) {
2
+ if (a) {
3
+ if (Array.isArray(a)) {
4
+ a.push(b);
5
+ return a;
6
+ }
7
+
8
+ return [a, b];
9
+ }
10
+
11
+ return b;
12
+ };
@@ -0,0 +1,3 @@
1
+ "use strict";module.exports = function* selfIterator() {
2
+ yield this;
3
+ };
@@ -28,7 +28,7 @@ module.exports = function styleHelper(style) {
28
28
  value += "px";
29
29
  }
30
30
 
31
- styles += changeCase.aK_(name) + ":" + value + ";";
31
+ styles += changeCase.aH_(name) + ":" + value + ";";
32
32
  }
33
33
  }
34
34
  }
@@ -8,7 +8,7 @@ var markoAttr = require("./helpers/data-marko");
8
8
  var escapeXmlHelper = require("./helpers/escape-xml");
9
9
  var parseHTML = require("../vdom/parse-html");
10
10
  var escapeXmlOrNullish = escapeXmlHelper.x;
11
- var escapeXmlString = escapeXmlHelper.aP_;
11
+ var escapeXmlString = escapeXmlHelper.aM_;
12
12
  var selfClosingTags = require("self-closing-tags");
13
13
 
14
14
  function noop() {}
@@ -93,8 +93,8 @@ function AsyncStream(global, writer, parentOut) {
93
93
 
94
94
  this.g_ = null;
95
95
  this.i_ = null;
96
- this.ay_ = null;
97
- this.aQ_ = false;
96
+ this.av_ = null;
97
+ this.aN_ = false;
98
98
  }
99
99
 
100
100
  AsyncStream.DEFAULT_TIMEOUT = 10000;
@@ -115,7 +115,7 @@ AsyncStream.enableAsyncStackTrace = function () {
115
115
  var proto = AsyncStream.prototype = {
116
116
  constructor: AsyncStream,
117
117
  Y_: typeof document === "object" && document,
118
- aR_: true,
118
+ aO_: true,
119
119
 
120
120
  sync: function () {
121
121
  this._sync = true;
@@ -154,7 +154,7 @@ var proto = AsyncStream.prototype = {
154
154
  return this._state.writer.toString();
155
155
  },
156
156
 
157
- aS_: function () {
157
+ aP_: function () {
158
158
  this._result = this._result || new RenderResult(this);
159
159
  return this._result;
160
160
  },
@@ -205,7 +205,7 @@ var proto = AsyncStream.prototype = {
205
205
  }
206
206
 
207
207
  this._lastCount++;
208
- newStream.aQ_ = true;
208
+ newStream.aN_ = true;
209
209
  }
210
210
 
211
211
  name = options.name;
@@ -249,7 +249,7 @@ var proto = AsyncStream.prototype = {
249
249
  if (state.writer.end) {
250
250
  state.writer.end();
251
251
  } else {
252
- state.events.emit("finish", this.aS_());
252
+ state.events.emit("finish", this.aP_());
253
253
  }
254
254
  },
255
255
 
@@ -321,7 +321,7 @@ var proto = AsyncStream.prototype = {
321
321
  parentOut._handleChildDone(this);
322
322
  }
323
323
  } else {
324
- if (childOut.aQ_) {
324
+ if (childOut.aN_) {
325
325
  this._lastCount--;
326
326
  }
327
327
 
@@ -362,7 +362,7 @@ var proto = AsyncStream.prototype = {
362
362
  var state = this._state;
363
363
 
364
364
  if (event === "finish" && state.finished === true) {
365
- callback(this.aS_());
365
+ callback(this.aP_());
366
366
  } else if (event === "last") {
367
367
  this.onLast(callback);
368
368
  } else {
@@ -376,7 +376,7 @@ var proto = AsyncStream.prototype = {
376
376
  var state = this._state;
377
377
 
378
378
  if (event === "finish" && state.finished === true) {
379
- callback(this.aS_());
379
+ callback(this.aP_());
380
380
  } else if (event === "last") {
381
381
  this.onLast(callback);
382
382
  } else {
@@ -501,7 +501,7 @@ var proto = AsyncStream.prototype = {
501
501
  return newOut;
502
502
  },
503
503
 
504
- aO_: function (
504
+ aL_: function (
505
505
  tagName,
506
506
  elementAttrs,
507
507
  key,
@@ -535,7 +535,7 @@ var proto = AsyncStream.prototype = {
535
535
  this.write(str);
536
536
  },
537
537
 
538
- aM_: function (
538
+ aJ_: function (
539
539
  name,
540
540
  elementAttrs,
541
541
  key,
@@ -652,13 +652,13 @@ var proto = AsyncStream.prototype = {
652
652
  c: function (componentDef, key, customEvents) {
653
653
  this.g_ = componentDef;
654
654
  this.i_ = key;
655
- this.ay_ = customEvents;
655
+ this.av_ = customEvents;
656
656
  }
657
657
  };
658
658
 
659
659
  // alias:
660
660
  proto.w = proto.write;
661
- proto.aN_ = proto.endElement;
661
+ proto.aK_ = proto.endElement;
662
662
 
663
663
  module.exports = AsyncStream;
664
664
 
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
 
3
3
  const immediate = require("../setImmediate");
4
- const setImmediate = immediate.aA_;
5
- const clearImmediate = immediate.aT_;
4
+ const setImmediate = immediate.ax_;
5
+ const clearImmediate = immediate.aQ_;
6
6
  const StringWriter = require("./StringWriter");
7
7
 
8
8
  /**
@@ -17,7 +17,7 @@ module.exports = function (data) {
17
17
  data && data.$global,
18
18
  facade,
19
19
  undefined,
20
- this.aU_);
20
+ this.aR_);
21
21
 
22
22
  out.once("error", (err) => {
23
23
  facade.write = facade.end = noop;
@@ -17,9 +17,9 @@ if (String(OutgoingMessageProto.flush).indexOf("deprecated") !== -1) {
17
17
  class Readable extends stream.Readable {
18
18
  constructor(template, data) {
19
19
  super();
20
- this.aV_ = template;
21
- this.aW_ = data;
22
- this.aX_ = false;
20
+ this.aS_ = template;
21
+ this.aT_ = data;
22
+ this.aU_ = false;
23
23
  }
24
24
 
25
25
  write(data) {
@@ -33,19 +33,19 @@ class Readable extends stream.Readable {
33
33
  }
34
34
 
35
35
  _read() {
36
- if (this.aX_) {
36
+ if (this.aU_) {
37
37
  return;
38
38
  }
39
39
 
40
- this.aX_ = true;
41
- var template = this.aV_;
42
- var data = this.aW_;
40
+ this.aU_ = true;
41
+ var template = this.aS_;
42
+ var data = this.aT_;
43
43
  var globalData = data && data.$global;
44
- var out = this.aV_.createOut(
44
+ var out = this.aS_.createOut(
45
45
  globalData,
46
46
  this,
47
47
  undefined,
48
- template.aU_);
48
+ template.aR_);
49
49
 
50
50
  template.render(data, out);
51
51
  out.end();
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  var attrHelper = require("./attr");
3
- var notEmptyAttr = attrHelper.aY_;
4
- var isEmptyAttrValue = attrHelper.aZ_;
3
+ var notEmptyAttr = attrHelper.aV_;
4
+ var isEmptyAttrValue = attrHelper.aW_;
5
5
  var classHelper = require("./class-attr");
6
6
  var styleHelper = require("./style-attr");
7
7
 
@@ -2,12 +2,12 @@
2
2
 
3
3
  var escapeQuoteHelpers = require("./escape-quotes");
4
4
  var escapeDoubleQuotes = escapeQuoteHelpers.y_;
5
- var escapeSingleQuotes = escapeQuoteHelpers.b__;
5
+ var escapeSingleQuotes = escapeQuoteHelpers.aX_;
6
6
 
7
7
  module.exports = maybeEmptyAttr;
8
8
 
9
- maybeEmptyAttr.aY_ = notEmptyAttr;
10
- maybeEmptyAttr.aZ_ = isEmpty;
9
+ maybeEmptyAttr.aV_ = notEmptyAttr;
10
+ maybeEmptyAttr.aW_ = isEmpty;
11
11
 
12
12
  function maybeEmptyAttr(name, value) {
13
13
  if (isEmpty(value)) {
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
 
3
3
  var escapeQuoteHelpers = require("./escape-quotes");
4
- var escapeSingleQuotes = escapeQuoteHelpers.b__;
4
+ var escapeSingleQuotes = escapeQuoteHelpers.aX_;
5
5
  var escapeDoubleQuotes = escapeQuoteHelpers.y_;
6
6
  var FLAG_WILL_RERENDER_IN_BROWSER = 1;
7
7
  // var FLAG_HAS_RENDER_BODY = 2;
@@ -6,7 +6,7 @@ exports.d = function (value) {
6
6
 
7
7
  exports.y_ = escapeDoubleQuotes;
8
8
 
9
- exports.b__ = escapeSingleQuotes;
9
+ exports.aX_ = escapeSingleQuotes;
10
10
 
11
11
  function escapeSingleQuotes(value, startPos) {
12
12
  return escapeQuote(value, startPos, "'", "'");
@@ -12,7 +12,7 @@ module.exports.x = function (value) {
12
12
  return escapeXML(value + "");
13
13
  };
14
14
 
15
- exports.aP_ = escapeXML;
15
+ exports.aM_ = escapeXML;
16
16
 
17
17
  function escapeXML(str) {
18
18
  var len = str.length;
@@ -15,13 +15,13 @@ exports.t = function createTemplate(typeName) {
15
15
  };
16
16
 
17
17
  function Template(typeName) {
18
- this.ba_ = typeName;
18
+ this.aY_ = typeName;
19
19
  }
20
20
 
21
21
  Template.prototype.stream = require("./create-readable");
22
22
 
23
23
  var AsyncStream = require("./AsyncStream");
24
- require("../createOut").aG_(
24
+ require("../createOut").aD_(
25
25
  Template.prototype.createOut = function createOut(
26
26
  globalData,
27
27
  writer,
@@ -1,5 +1,5 @@
1
1
  "use strict";var defaultCreateOut = require("./createOut");
2
- var setImmediate = require("./setImmediate").aA_;
2
+ var setImmediate = require("./setImmediate").ax_;
3
3
  var extend = require("raptor-util/extend");
4
4
 
5
5
  function safeRender(renderFunc, finalData, finalOut, shouldEnd) {
@@ -70,7 +70,7 @@ module.exports = function (target, renderer) {
70
70
  }
71
71
 
72
72
  render(localData, out);
73
- return out.aS_();
73
+ return out.aP_();
74
74
  },
75
75
 
76
76
  /**
@@ -96,7 +96,7 @@ module.exports = function (target, renderer) {
96
96
  var finalData;
97
97
  var globalData;
98
98
  var render = renderFunc || this._;
99
- var shouldBuffer = this.aU_;
99
+ var shouldBuffer = this.aR_;
100
100
  var shouldEnd = true;
101
101
 
102
102
  if (data) {
@@ -108,7 +108,7 @@ module.exports = function (target, renderer) {
108
108
  finalData = {};
109
109
  }
110
110
 
111
- if (out && out.aR_) {
111
+ if (out && out.aO_) {
112
112
  finalOut = out;
113
113
  shouldEnd = false;
114
114
  extend(out.global, globalData);
@@ -127,7 +127,7 @@ module.exports = function (target, renderer) {
127
127
  if (callback) {
128
128
  finalOut.
129
129
  on("finish", function () {
130
- callback(null, finalOut.aS_());
130
+ callback(null, finalOut.aP_());
131
131
  }).
132
132
  once("error", callback);
133
133
  }
@@ -10,7 +10,7 @@ window.addEventListener("message", function (ev) {
10
10
  }
11
11
  });
12
12
 
13
- exports.aA_ = function (callback) {
13
+ exports.ax_ = function (callback) {
14
14
  if (queue.push(callback) === 1) {
15
15
  window.postMessage(msg, "*");
16
16
  }
@@ -1,2 +1,2 @@
1
- "use strict";exports.aA_ = setTimeout;
2
- exports.aT_ = clearTimeout;
1
+ "use strict";exports.ax_ = setTimeout;
2
+ exports.aQ_ = clearTimeout;
@@ -1,2 +1,2 @@
1
- "use strict";exports.aA_ = setImmediate;
2
- exports.aT_ = clearImmediate;
1
+ "use strict";exports.ax_ = setImmediate;
2
+ exports.aQ_ = clearImmediate;