marko 5.37.44 → 5.37.46

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.
@@ -9,6 +9,8 @@ const defaultCreateOut = require("../../createOut");
9
9
  const morphdom = require("../../vdom/morphdom");
10
10
  const { _k_ } = require("../../vdom/morphdom/fragment");
11
11
  const dynamicTag = require("../dynamic-tag");
12
+ const Component = require("../../components/Component");
13
+ const noopRenderer = require("../serialize-noop").aJ_;
12
14
 
13
15
  exports.p = function (domCompat) {
14
16
  dynamicTag.bn_ = function tagsToVdom(
@@ -31,6 +33,19 @@ exports.p = function (domCompat) {
31
33
  return renderer;
32
34
  };
33
35
 
36
+ Component.prototype.bo_ =
37
+ Component.prototype.aD_;
38
+ Component.prototype.aD_ = function (customEvents, scopeId) {
39
+ for (const customEvent of customEvents) {
40
+ customEvent[1] = domCompat.resolveRegistered(
41
+ customEvent[1],
42
+ this.ak_
43
+ );
44
+ }
45
+
46
+ this.bo_(customEvents, scopeId);
47
+ };
48
+
34
49
  const TagsCompatId = "tags-compat";
35
50
  const TagsCompat = createRenderer(
36
51
  function (_, out, componentDef, component) {
@@ -40,7 +55,7 @@ exports.p = function (domCompat) {
40
55
 
41
56
  out.bf(out.aa_, component, !newNode);
42
57
  if (newNode) {
43
- out.node({ bo_: () => newNode });
58
+ out.node({ bp_: () => newNode });
44
59
  }
45
60
  out.ef();
46
61
  },
@@ -68,13 +83,6 @@ exports.p = function (domCompat) {
68
83
  )
69
84
  }));
70
85
 
71
- // (
72
- // nodeAccessor: Accessor,
73
- // dynamicTagAttrs?: IntersectionSignal,
74
- // intersection?: IntersectionSignal,
75
- // valueWithIntersection?: ValueSignal
76
- // )
77
-
78
86
  const rendererCache = new WeakMap();
79
87
 
80
88
  domCompat.patchDynamicTag((dynamicTag) => (...args) => {
@@ -87,6 +95,10 @@ exports.p = function (domCompat) {
87
95
  function create5to6Renderer(renderer) {
88
96
  let newRenderer = renderer;
89
97
  if (renderer && typeof renderer !== "string") {
98
+ if (renderer === noopRenderer) {
99
+ return noopRenderer;
100
+ }
101
+
90
102
  const rendererFromAnywhere =
91
103
  renderer._ ||
92
104
  renderer.render ||
@@ -96,24 +108,6 @@ exports.p = function (domCompat) {
96
108
  if (!domCompat.isRenderer(rendererFromAnywhere || renderer)) {
97
109
  newRenderer = rendererCache.get(renderer);
98
110
  if (!newRenderer) {
99
- const { Component } = renderer;
100
- if (Component) {
101
- const setCustomEvents = Component.prototype.aD_;
102
- Component.prototype.aD_ = function (
103
- customEvents,
104
- scopeId)
105
- {
106
- const global = this.ak_;
107
- for (const customEvent of customEvents) {
108
- customEvent[1] = domCompat.resolveRegistered(
109
- customEvent[1],
110
- global
111
- );
112
- }
113
-
114
- setCustomEvents.call(this, customEvents, scopeId);
115
- };
116
- }
117
111
  newRenderer = domCompat.createRenderer(
118
112
  (scope, input) =>
119
113
  renderAndMorph(scope, rendererFromAnywhere, renderer, input),
@@ -127,20 +121,20 @@ exports.p = function (domCompat) {
127
121
  }
128
122
 
129
123
  domCompat.registerRenderer(create5to6Renderer);
130
- domCompat.init(require("../serialize-noop").aJ_);
124
+ domCompat.init(noopRenderer);
131
125
 
132
126
  function renderAndMorph(scope, renderer, renderBody, input) {
133
127
  const out = defaultCreateOut();
134
128
  let host = domCompat.getStartNode(scope);
135
129
  let rootNode = host.fragment;
136
130
  if (!rootNode) {
137
- const component = scope.bp_ =
131
+ const component = scope.bq_ =
138
132
  _l_[scope.m5c];
139
133
  rootNode = component._E_;
140
134
  host = rootNode.startNode;
141
135
  domCompat.setScopeNodes(host, rootNode.endNode);
142
136
  }
143
- const existingComponent = scope.bp_;
137
+ const existingComponent = scope.bq_;
144
138
  const componentsContext = S_(out);
145
139
  const globalComponentsContext = componentsContext.p_;
146
140
  let customEvents;
@@ -180,7 +174,7 @@ exports.p = function (domCompat) {
180
174
  component._E_ = rootNode;
181
175
  component.O_ = normalizedInput;
182
176
  component.W_ = customEvents;
183
- scope.bp_ = component;
177
+ scope.bq_ = component;
184
178
  });
185
179
  }
186
180
 
@@ -79,7 +79,9 @@ exports.p = function (htmlCompat) {
79
79
  }
80
80
  return (input, ...args) => {
81
81
  const out = defaultCreateOut(htmlCompat.$global());
82
+ const branchId = htmlCompat.peekNextScopeId();
82
83
  let customEvents;
84
+ htmlCompat.nextScopeId();
83
85
 
84
86
  if (renderer5) {
85
87
  const normalizedInput = {};
@@ -107,7 +109,7 @@ exports.p = function (htmlCompat) {
107
109
  const component = componentsContext.b_[0];
108
110
  if (component) {
109
111
  component.s_.W_ = customEvents;
110
- htmlCompat.writeSetScopeForComponent(component.id);
112
+ htmlCompat.writeSetScopeForComponent(branchId, component.id);
111
113
  }
112
114
 
113
115
  initComponentsTag({}, out);
@@ -9,7 +9,7 @@ var markoAttr = require("./helpers/data-marko");
9
9
  var escapeXmlHelper = require("./helpers/escape-xml");
10
10
  var StringWriter = require("./StringWriter");
11
11
  var escapeXmlOrNullish = escapeXmlHelper.x;
12
- var escapeXmlString = escapeXmlHelper.bq_;
12
+ var escapeXmlString = escapeXmlHelper.br_;
13
13
  var missingSetTimeout = typeof setTimeout !== "function";
14
14
 
15
15
  function noop() {}
@@ -105,7 +105,7 @@ function AsyncStream(global, writer, parentOut) {
105
105
  this.a__ = null;
106
106
  this.aa_ = null;
107
107
  this.bc_ = null;
108
- this.br_ = false;
108
+ this.bs_ = false;
109
109
  }
110
110
 
111
111
  AsyncStream.DEFAULT_TIMEOUT = 10000;
@@ -126,11 +126,11 @@ AsyncStream.enableAsyncStackTrace = function () {
126
126
  var proto = AsyncStream.prototype = {
127
127
  constructor: AsyncStream,
128
128
  B_: typeof document === "object" && document,
129
- bs_: true,
129
+ bt_: true,
130
130
 
131
131
  [Symbol.asyncIterator]() {
132
- if (this.bt_) {
133
- return this.bt_;
132
+ if (this.bu_) {
133
+ return this.bu_;
134
134
  }
135
135
 
136
136
  const originalWriter = this._state.writer;
@@ -222,7 +222,7 @@ var proto = AsyncStream.prototype = {
222
222
  };
223
223
  }
224
224
 
225
- return this.bt_ = {
225
+ return this.bu_ = {
226
226
  next: iteratorNextFn,
227
227
  return: iteratorReturnFn,
228
228
  throw: iteratorReturnFn,
@@ -345,7 +345,7 @@ var proto = AsyncStream.prototype = {
345
345
  }
346
346
 
347
347
  this._lastCount++;
348
- newStream.br_ = true;
348
+ newStream.bs_ = true;
349
349
  }
350
350
 
351
351
  name = options.name;
@@ -465,7 +465,7 @@ var proto = AsyncStream.prototype = {
465
465
  parentOut._handleChildDone(this);
466
466
  }
467
467
  } else {
468
- if (childOut.br_) {
468
+ if (childOut.bs_) {
469
469
  this._lastCount--;
470
470
  }
471
471
 
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  var attrHelper = require("./attr");
3
- var notEmptyAttr = attrHelper.bu_;
4
- var isEmptyAttrValue = attrHelper.bv_;
3
+ var notEmptyAttr = attrHelper.bv_;
4
+ var isEmptyAttrValue = attrHelper.bw_;
5
5
  var classHelper = require("./class-attr");
6
6
  var styleHelper = require("./style-attr");
7
7
 
@@ -5,8 +5,8 @@
5
5
 
6
6
  module.exports = attr;
7
7
 
8
- attr.bu_ = nonVoidAttr;
9
- attr.bv_ = isVoid;
8
+ attr.bv_ = nonVoidAttr;
9
+ attr.bw_ = isVoid;
10
10
  attr.a = attrAssignment;
11
11
  attr.d = escapeDoubleQuotedAttrValue;
12
12
  attr.s = escapeSingleQuotedAttrValue;
@@ -18,4 +18,4 @@ module.exports.x = function (value) {
18
18
  return escape(value + "");
19
19
  };
20
20
 
21
- exports.bq_ = escape;
21
+ exports.br_ = escape;
@@ -160,7 +160,7 @@ module.exports = function (target, renderer) {
160
160
  finalData = {};
161
161
  }
162
162
 
163
- if (out && out.bs_) {
163
+ if (out && out.bt_) {
164
164
  finalOut = out;
165
165
  shouldEnd = false;
166
166
  extend(out.global, globalData);
@@ -3,21 +3,21 @@ var RenderResult = require("../RenderResult");
3
3
  var attrsHelper = require("./helpers/attrs");
4
4
  var morphdom = require("./morphdom");
5
5
  var vdom = require("./vdom");
6
- var VElement = vdom.bw_;
7
- var VComment = vdom.bx_;
8
- var VDocumentFragment = vdom.by_;
9
- var VText = vdom.bz_;
10
- var VComponent = vdom.bA_;
11
- var VFragment = vdom.bB_;
12
- var virtualizeHTML = vdom.bC_;
6
+ var VElement = vdom.bx_;
7
+ var VComment = vdom.by_;
8
+ var VDocumentFragment = vdom.bz_;
9
+ var VText = vdom.bA_;
10
+ var VComponent = vdom.bB_;
11
+ var VFragment = vdom.bC_;
12
+ var virtualizeHTML = vdom.bD_;
13
13
 
14
14
  var EVENT_UPDATE = "update";
15
15
  var EVENT_FINISH = "finish";
16
16
 
17
17
  function State(tree) {
18
- this.bD_ = new EventEmitter();
19
- this.bE_ = tree;
20
- this.bF_ = false;
18
+ this.bE_ = new EventEmitter();
19
+ this.bF_ = tree;
20
+ this.bG_ = false;
21
21
  }
22
22
 
23
23
  function AsyncVDOMBuilder(globalData, parentNode, parentOut) {
@@ -33,18 +33,18 @@ function AsyncVDOMBuilder(globalData, parentNode, parentOut) {
33
33
  state = new State(parentNode);
34
34
  }
35
35
 
36
- this.bG_ = 1;
37
- this.bH_ = 0;
38
- this.bI_ = null;
39
- this.bJ_ = parentOut;
36
+ this.bH_ = 1;
37
+ this.bI_ = 0;
38
+ this.bJ_ = null;
39
+ this.bK_ = parentOut;
40
40
 
41
41
  this.data = {};
42
42
  this.z_ = state;
43
43
  this.ab_ = parentNode;
44
44
  this.global = globalData || {};
45
- this.bK_ = [parentNode];
46
- this.bL_ = false;
47
- this.bM_ = undefined;
45
+ this.bL_ = [parentNode];
46
+ this.bM_ = false;
47
+ this.bN_ = undefined;
48
48
  this.b_ = null;
49
49
 
50
50
  this.a__ = null;
@@ -53,23 +53,23 @@ function AsyncVDOMBuilder(globalData, parentNode, parentOut) {
53
53
  }
54
54
 
55
55
  var proto = AsyncVDOMBuilder.prototype = {
56
- bs_: true,
56
+ bt_: true,
57
57
  B_: typeof document === "object" && document,
58
58
 
59
59
  bc: function (component, key, ownerComponent) {
60
60
  var vComponent = new VComponent(component, key, ownerComponent);
61
- return this.bN_(vComponent, 0, true);
61
+ return this.bO_(vComponent, 0, true);
62
62
  },
63
63
 
64
64
  bd_: function (component, key, ownerComponent) {
65
65
  var vComponent = new VComponent(component, key, ownerComponent, true);
66
- this.bN_(vComponent, 0);
66
+ this.bO_(vComponent, 0);
67
67
  },
68
68
 
69
- bN_: function (child, childCount, pushToStack) {
70
- this.ab_.bO_(child);
69
+ bO_: function (child, childCount, pushToStack) {
70
+ this.ab_.bP_(child);
71
71
  if (pushToStack === true) {
72
- this.bK_.push(child);
72
+ this.bL_.push(child);
73
73
  this.ab_ = child;
74
74
  }
75
75
  return childCount === 0 ? this : child;
@@ -85,7 +85,7 @@ var proto = AsyncVDOMBuilder.prototype = {
85
85
  flags,
86
86
  props
87
87
  );
88
- return this.bN_(element, childCount);
88
+ return this.bO_(element, childCount);
89
89
  },
90
90
 
91
91
  bm_: function (tagName, attrs, key, componentDef, props) {
@@ -103,7 +103,7 @@ var proto = AsyncVDOMBuilder.prototype = {
103
103
  n: function (node, component) {
104
104
  // NOTE: We do a shallow clone since we assume the node is being reused
105
105
  // and a node can only have one parent node.
106
- var clone = node.bP_();
106
+ var clone = node.bQ_();
107
107
  this.node(clone);
108
108
  clone._M_ = component;
109
109
 
@@ -111,7 +111,7 @@ var proto = AsyncVDOMBuilder.prototype = {
111
111
  },
112
112
 
113
113
  node: function (node) {
114
- this.ab_.bO_(node);
114
+ this.ab_.bP_(node);
115
115
  return this;
116
116
  },
117
117
 
@@ -130,7 +130,7 @@ var proto = AsyncVDOMBuilder.prototype = {
130
130
  text = text.toString();
131
131
  }
132
132
 
133
- this.ab_.bO_(new VText(text, ownerComponent));
133
+ this.ab_.bP_(new VText(text, ownerComponent));
134
134
  return this;
135
135
  },
136
136
 
@@ -165,7 +165,7 @@ var proto = AsyncVDOMBuilder.prototype = {
165
165
  flags,
166
166
  props
167
167
  );
168
- this.bN_(element, childCount, true);
168
+ this.bO_(element, childCount, true);
169
169
  return this;
170
170
  },
171
171
 
@@ -183,7 +183,7 @@ var proto = AsyncVDOMBuilder.prototype = {
183
183
 
184
184
  bf: function (key, component, preserve) {
185
185
  var fragment = new VFragment(key, component, preserve);
186
- this.bN_(fragment, null, true);
186
+ this.bO_(fragment, null, true);
187
187
  return this;
188
188
  },
189
189
 
@@ -192,7 +192,7 @@ var proto = AsyncVDOMBuilder.prototype = {
192
192
  },
193
193
 
194
194
  endElement: function () {
195
- var stack = this.bK_;
195
+ var stack = this.bL_;
196
196
  stack.pop();
197
197
  this.ab_ = stack[stack.length - 1];
198
198
  },
@@ -200,44 +200,44 @@ var proto = AsyncVDOMBuilder.prototype = {
200
200
  end: function () {
201
201
  this.ab_ = undefined;
202
202
 
203
- var remaining = --this.bG_;
204
- var parentOut = this.bJ_;
203
+ var remaining = --this.bH_;
204
+ var parentOut = this.bK_;
205
205
 
206
206
  if (remaining === 0) {
207
207
  if (parentOut) {
208
- parentOut.bQ_();
208
+ parentOut.bR_();
209
209
  } else {
210
- this.bR_();
210
+ this.bS_();
211
211
  }
212
- } else if (remaining - this.bH_ === 0) {
213
- this.bS_();
212
+ } else if (remaining - this.bI_ === 0) {
213
+ this.bT_();
214
214
  }
215
215
 
216
216
  return this;
217
217
  },
218
218
 
219
- bQ_: function () {
220
- var remaining = --this.bG_;
219
+ bR_: function () {
220
+ var remaining = --this.bH_;
221
221
 
222
222
  if (remaining === 0) {
223
- var parentOut = this.bJ_;
223
+ var parentOut = this.bK_;
224
224
  if (parentOut) {
225
- parentOut.bQ_();
225
+ parentOut.bR_();
226
226
  } else {
227
- this.bR_();
227
+ this.bS_();
228
228
  }
229
- } else if (remaining - this.bH_ === 0) {
230
- this.bS_();
229
+ } else if (remaining - this.bI_ === 0) {
230
+ this.bT_();
231
231
  }
232
232
  },
233
233
 
234
- bR_: function () {
234
+ bS_: function () {
235
235
  var state = this.z_;
236
- state.bF_ = true;
237
- state.bD_.emit(EVENT_FINISH, this.n_());
236
+ state.bG_ = true;
237
+ state.bE_.emit(EVENT_FINISH, this.n_());
238
238
  },
239
239
 
240
- bS_: function () {
240
+ bT_: function () {
241
241
  var lastArray = this._last;
242
242
 
243
243
  var i = 0;
@@ -272,7 +272,7 @@ var proto = AsyncVDOMBuilder.prototype = {
272
272
  },
273
273
 
274
274
  beginAsync: function (options) {
275
- if (this.bL_) {
275
+ if (this.bM_) {
276
276
  throw Error(
277
277
  "Tried to render async while in sync mode. Note: Client side await is not currently supported in re-renders (Issue: #942)."
278
278
  );
@@ -282,16 +282,16 @@ var proto = AsyncVDOMBuilder.prototype = {
282
282
 
283
283
  if (options) {
284
284
  if (options.last) {
285
- this.bH_++;
285
+ this.bI_++;
286
286
  }
287
287
  }
288
288
 
289
- this.bG_++;
289
+ this.bH_++;
290
290
 
291
- var documentFragment = this.ab_.bT_();
291
+ var documentFragment = this.ab_.bU_();
292
292
  var asyncOut = new AsyncVDOMBuilder(this.global, documentFragment, this);
293
293
 
294
- state.bD_.emit("beginAsync", {
294
+ state.bE_.emit("beginAsync", {
295
295
  out: asyncOut,
296
296
  parentOut: this
297
297
  });
@@ -304,7 +304,7 @@ var proto = AsyncVDOMBuilder.prototype = {
304
304
  },
305
305
 
306
306
  flush: function () {
307
- var events = this.z_.bD_;
307
+ var events = this.z_.bE_;
308
308
 
309
309
  if (events.listenerCount(EVENT_UPDATE)) {
310
310
  events.emit(EVENT_UPDATE, new RenderResult(this));
@@ -312,22 +312,22 @@ var proto = AsyncVDOMBuilder.prototype = {
312
312
  },
313
313
 
314
314
  ah_: function () {
315
- return this.z_.bE_;
315
+ return this.z_.bF_;
316
316
  },
317
317
 
318
318
  n_: function () {
319
- return this.bU_ || (this.bU_ = new RenderResult(this));
319
+ return this.bV_ || (this.bV_ = new RenderResult(this));
320
320
  },
321
321
 
322
322
  on: function (event, callback) {
323
323
  var state = this.z_;
324
324
 
325
- if (event === EVENT_FINISH && state.bF_) {
325
+ if (event === EVENT_FINISH && state.bG_) {
326
326
  callback(this.n_());
327
327
  } else if (event === "last") {
328
328
  this.onLast(callback);
329
329
  } else {
330
- state.bD_.on(event, callback);
330
+ state.bE_.on(event, callback);
331
331
  }
332
332
 
333
333
  return this;
@@ -336,19 +336,19 @@ var proto = AsyncVDOMBuilder.prototype = {
336
336
  once: function (event, callback) {
337
337
  var state = this.z_;
338
338
 
339
- if (event === EVENT_FINISH && state.bF_) {
339
+ if (event === EVENT_FINISH && state.bG_) {
340
340
  callback(this.n_());
341
341
  } else if (event === "last") {
342
342
  this.onLast(callback);
343
343
  } else {
344
- state.bD_.once(event, callback);
344
+ state.bE_.once(event, callback);
345
345
  }
346
346
 
347
347
  return this;
348
348
  },
349
349
 
350
350
  emit: function (type, arg) {
351
- var events = this.z_.bD_;
351
+ var events = this.z_.bE_;
352
352
  switch (arguments.length) {
353
353
  case 1:
354
354
  events.emit(type);
@@ -364,17 +364,17 @@ var proto = AsyncVDOMBuilder.prototype = {
364
364
  },
365
365
 
366
366
  removeListener: function () {
367
- var events = this.z_.bD_;
367
+ var events = this.z_.bE_;
368
368
  events.removeListener.apply(events, arguments);
369
369
  return this;
370
370
  },
371
371
 
372
372
  sync: function () {
373
- this.bL_ = true;
373
+ this.bM_ = true;
374
374
  },
375
375
 
376
376
  isSync: function () {
377
- return this.bL_;
377
+ return this.bM_;
378
378
  },
379
379
 
380
380
  onLast: function (callback) {
@@ -390,12 +390,12 @@ var proto = AsyncVDOMBuilder.prototype = {
390
390
  },
391
391
 
392
392
  ag_: function (host) {
393
- var node = this.bM_;
393
+ var node = this.bN_;
394
394
  if (!node) {
395
395
  var vdomTree = this.ah_();
396
396
 
397
397
  if (!host) host = this.B_;
398
- this.bM_ = node = vdomTree.bo_(host, null);
398
+ this.bN_ = node = vdomTree.bp_(host, null);
399
399
  morphdom(node, vdomTree, host, this.b_);
400
400
  }
401
401
  return node;
@@ -2,20 +2,20 @@
2
2
  var inherit = require("raptor-util/inherit");
3
3
 
4
4
  function VComment(value, ownerComponent) {
5
- this.bV_(-1 /* no children */, ownerComponent);
6
- this.bW_ = value;
5
+ this.bW_(-1 /* no children */, ownerComponent);
6
+ this.bX_ = value;
7
7
  }
8
8
 
9
9
  VComment.prototype = {
10
- bX_: 8,
10
+ bY_: 8,
11
11
 
12
- bo_: function (host) {
13
- var nodeValue = this.bW_;
12
+ bp_: function (host) {
13
+ var nodeValue = this.bX_;
14
14
  return (host.ownerDocument || host).createComment(nodeValue);
15
15
  },
16
16
 
17
- bP_: function () {
18
- return new VComment(this.bW_);
17
+ bQ_: function () {
18
+ return new VComment(this.bX_);
19
19
  }
20
20
  };
21
21
 
@@ -2,14 +2,14 @@
2
2
  var VNode = require("./VNode");
3
3
 
4
4
  function VComponent(component, key, ownerComponent, preserve) {
5
- this.bV_(null /* childCount */, ownerComponent);
6
- this.bY_ = key;
5
+ this.bW_(null /* childCount */, ownerComponent);
6
+ this.bZ_ = key;
7
7
  this.s_ = component;
8
8
  this.ad_ = preserve;
9
9
  }
10
10
 
11
11
  VComponent.prototype = {
12
- bX_: 2
12
+ bY_: 2
13
13
  };
14
14
 
15
15
  inherit(VComponent, VNode);
@@ -4,25 +4,25 @@ var VNode = require("./VNode");
4
4
 
5
5
  function VDocumentFragmentClone(other) {
6
6
  extend(this, other);
7
- this.bZ_ = null;
8
7
  this.c__ = null;
8
+ this.ca_ = null;
9
9
  }
10
10
 
11
11
  function VDocumentFragment(out) {
12
- this.bV_(null /* childCount */);
12
+ this.bW_(null /* childCount */);
13
13
  this.r_ = out;
14
14
  }
15
15
 
16
16
  VDocumentFragment.prototype = {
17
- bX_: 11,
17
+ bY_: 11,
18
18
 
19
- ca_: true,
19
+ cb_: true,
20
20
 
21
- bP_: function () {
21
+ bQ_: function () {
22
22
  return new VDocumentFragmentClone(this);
23
23
  },
24
24
 
25
- bo_: function (host) {
25
+ bp_: function (host) {
26
26
  return (host.ownerDocument || host).createDocumentFragment();
27
27
  }
28
28
  };