marko 5.39.44 → 5.39.45

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.
@@ -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.bC_;
7
- var VComment = vdom.bD_;
8
- var VDocumentFragment = vdom.bE_;
9
- var VText = vdom.bF_;
10
- var VComponent = vdom.bG_;
11
- var VFragment = vdom.bH_;
12
- var virtualizeHTML = vdom.bI_;
6
+ var VElement = vdom.bE_;
7
+ var VComment = vdom.bF_;
8
+ var VDocumentFragment = vdom.bG_;
9
+ var VText = vdom.bH_;
10
+ var VComponent = vdom.bI_;
11
+ var VFragment = vdom.bJ_;
12
+ var virtualizeHTML = vdom.bK_;
13
13
 
14
14
  var EVENT_UPDATE = "update";
15
15
  var EVENT_FINISH = "finish";
16
16
 
17
17
  function State(tree) {
18
- this.bJ_ = new EventEmitter();
19
- this.bK_ = tree;
20
- this.bL_ = false;
18
+ this.bL_ = new EventEmitter();
19
+ this.bM_ = tree;
20
+ this.bN_ = 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.bM_ = 1;
37
- this.bN_ = 0;
38
- this.bO_ = null;
39
- this.bP_ = parentOut;
36
+ this.bO_ = 1;
37
+ this.bP_ = 0;
38
+ this.bQ_ = null;
39
+ this.bR_ = parentOut;
40
40
 
41
41
  this.data = {};
42
42
  this.A_ = state;
43
43
  this.ae_ = parentNode;
44
44
  this.global = globalData || {};
45
- this.bQ_ = [parentNode];
46
- this.bR_ = false;
47
- this.bS_ = undefined;
45
+ this.bS_ = [parentNode];
46
+ this.bT_ = false;
47
+ this.bU_ = undefined;
48
48
  this.b_ = null;
49
49
 
50
50
  this.ac_ = null;
@@ -53,23 +53,23 @@ function AsyncVDOMBuilder(globalData, parentNode, parentOut) {
53
53
  }
54
54
 
55
55
  var proto = AsyncVDOMBuilder.prototype = {
56
- bx_: true,
56
+ bz_: true,
57
57
  C_: 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.bT_(vComponent, 0, true);
61
+ return this.bV_(vComponent, 0, true);
62
62
  },
63
63
 
64
64
  bg_: function (component, key, ownerComponent) {
65
65
  var vComponent = new VComponent(component, key, ownerComponent, true);
66
- this.bT_(vComponent, 0);
66
+ this.bV_(vComponent, 0);
67
67
  },
68
68
 
69
- bT_: function (child, childCount, pushToStack) {
70
- this.ae_.bU_(child);
69
+ bV_: function (child, childCount, pushToStack) {
70
+ this.ae_.bW_(child);
71
71
  if (pushToStack === true) {
72
- this.bQ_.push(child);
72
+ this.bS_.push(child);
73
73
  this.ae_ = 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.bT_(element, childCount);
88
+ return this.bV_(element, childCount);
89
89
  },
90
90
 
91
91
  bp_: 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.bV_();
106
+ var clone = node.bX_();
107
107
  this.node(clone);
108
108
  clone._P_ = component;
109
109
 
@@ -111,7 +111,7 @@ var proto = AsyncVDOMBuilder.prototype = {
111
111
  },
112
112
 
113
113
  node: function (node) {
114
- this.ae_.bU_(node);
114
+ this.ae_.bW_(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.ae_.bU_(new VText(text, ownerComponent));
133
+ this.ae_.bW_(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.bT_(element, childCount, true);
168
+ this.bV_(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.bT_(fragment, null, true);
186
+ this.bV_(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.bQ_;
195
+ var stack = this.bS_;
196
196
  stack.pop();
197
197
  this.ae_ = stack[stack.length - 1];
198
198
  },
@@ -200,44 +200,44 @@ var proto = AsyncVDOMBuilder.prototype = {
200
200
  end: function () {
201
201
  this.ae_ = undefined;
202
202
 
203
- var remaining = --this.bM_;
204
- var parentOut = this.bP_;
203
+ var remaining = --this.bO_;
204
+ var parentOut = this.bR_;
205
205
 
206
206
  if (remaining === 0) {
207
207
  if (parentOut) {
208
- parentOut.bW_();
208
+ parentOut.bY_();
209
209
  } else {
210
- this.bX_();
210
+ this.bZ_();
211
211
  }
212
- } else if (remaining - this.bN_ === 0) {
213
- this.bY_();
212
+ } else if (remaining - this.bP_ === 0) {
213
+ this.c__();
214
214
  }
215
215
 
216
216
  return this;
217
217
  },
218
218
 
219
- bW_: function () {
220
- var remaining = --this.bM_;
219
+ bY_: function () {
220
+ var remaining = --this.bO_;
221
221
 
222
222
  if (remaining === 0) {
223
- var parentOut = this.bP_;
223
+ var parentOut = this.bR_;
224
224
  if (parentOut) {
225
- parentOut.bW_();
225
+ parentOut.bY_();
226
226
  } else {
227
- this.bX_();
227
+ this.bZ_();
228
228
  }
229
- } else if (remaining - this.bN_ === 0) {
230
- this.bY_();
229
+ } else if (remaining - this.bP_ === 0) {
230
+ this.c__();
231
231
  }
232
232
  },
233
233
 
234
- bX_: function () {
234
+ bZ_: function () {
235
235
  var state = this.A_;
236
- state.bL_ = true;
237
- state.bJ_.emit(EVENT_FINISH, this.n_());
236
+ state.bN_ = true;
237
+ state.bL_.emit(EVENT_FINISH, this.n_());
238
238
  },
239
239
 
240
- bY_: function () {
240
+ c__: function () {
241
241
  var lastArray = this._last;
242
242
 
243
243
  var i = 0;
@@ -273,7 +273,7 @@ var proto = AsyncVDOMBuilder.prototype = {
273
273
  },
274
274
 
275
275
  beginAsync: function (options) {
276
- if (this.bR_) {
276
+ if (this.bT_) {
277
277
  throw Error(
278
278
  "Tried to render async while in sync mode. Note: Client side await is not currently supported in re-renders (Issue: #942)."
279
279
  );
@@ -283,16 +283,16 @@ var proto = AsyncVDOMBuilder.prototype = {
283
283
 
284
284
  if (options) {
285
285
  if (options.last) {
286
- this.bN_++;
286
+ this.bP_++;
287
287
  }
288
288
  }
289
289
 
290
- this.bM_++;
290
+ this.bO_++;
291
291
 
292
- var documentFragment = this.ae_.bZ_();
292
+ var documentFragment = this.ae_.ca_();
293
293
  var asyncOut = new AsyncVDOMBuilder(this.global, documentFragment, this);
294
294
 
295
- state.bJ_.emit("beginAsync", {
295
+ state.bL_.emit("beginAsync", {
296
296
  out: asyncOut,
297
297
  parentOut: this
298
298
  });
@@ -305,7 +305,7 @@ var proto = AsyncVDOMBuilder.prototype = {
305
305
  },
306
306
 
307
307
  flush: function () {
308
- var events = this.A_.bJ_;
308
+ var events = this.A_.bL_;
309
309
 
310
310
  if (events.listenerCount(EVENT_UPDATE)) {
311
311
  events.emit(EVENT_UPDATE, new RenderResult(this));
@@ -313,22 +313,22 @@ var proto = AsyncVDOMBuilder.prototype = {
313
313
  },
314
314
 
315
315
  ak_: function () {
316
- return this.A_.bK_;
316
+ return this.A_.bM_;
317
317
  },
318
318
 
319
319
  n_: function () {
320
- return this.c__ || (this.c__ = new RenderResult(this));
320
+ return this.cb_ || (this.cb_ = new RenderResult(this));
321
321
  },
322
322
 
323
323
  on: function (event, callback) {
324
324
  var state = this.A_;
325
325
 
326
- if (event === EVENT_FINISH && state.bL_) {
326
+ if (event === EVENT_FINISH && state.bN_) {
327
327
  callback(this.n_());
328
328
  } else if (event === "last") {
329
329
  this.onLast(callback);
330
330
  } else {
331
- state.bJ_.on(event, callback);
331
+ state.bL_.on(event, callback);
332
332
  }
333
333
 
334
334
  return this;
@@ -337,19 +337,19 @@ var proto = AsyncVDOMBuilder.prototype = {
337
337
  once: function (event, callback) {
338
338
  var state = this.A_;
339
339
 
340
- if (event === EVENT_FINISH && state.bL_) {
340
+ if (event === EVENT_FINISH && state.bN_) {
341
341
  callback(this.n_());
342
342
  } else if (event === "last") {
343
343
  this.onLast(callback);
344
344
  } else {
345
- state.bJ_.once(event, callback);
345
+ state.bL_.once(event, callback);
346
346
  }
347
347
 
348
348
  return this;
349
349
  },
350
350
 
351
351
  emit: function (type, arg) {
352
- var events = this.A_.bJ_;
352
+ var events = this.A_.bL_;
353
353
  switch (arguments.length) {
354
354
  case 1:
355
355
  events.emit(type);
@@ -365,17 +365,17 @@ var proto = AsyncVDOMBuilder.prototype = {
365
365
  },
366
366
 
367
367
  removeListener: function () {
368
- var events = this.A_.bJ_;
368
+ var events = this.A_.bL_;
369
369
  events.removeListener.apply(events, arguments);
370
370
  return this;
371
371
  },
372
372
 
373
373
  sync: function () {
374
- this.bR_ = true;
374
+ this.bT_ = true;
375
375
  },
376
376
 
377
377
  isSync: function () {
378
- return this.bR_;
378
+ return this.bT_;
379
379
  },
380
380
 
381
381
  onLast: function (callback) {
@@ -391,12 +391,12 @@ var proto = AsyncVDOMBuilder.prototype = {
391
391
  },
392
392
 
393
393
  aj_: function (host) {
394
- var node = this.bS_;
394
+ var node = this.bU_;
395
395
  if (!node) {
396
396
  var vdomTree = this.ak_();
397
397
 
398
398
  if (!host) host = this.C_;
399
- this.bS_ = node = vdomTree.bu_(host, null);
399
+ this.bU_ = node = vdomTree.bv_(host, null);
400
400
  morphdom(node, vdomTree, host, this.b_);
401
401
  }
402
402
  return node;
@@ -2,20 +2,20 @@
2
2
  var inherit = require("raptor-util/inherit");
3
3
 
4
4
  function VComment(value, ownerComponent) {
5
- this.ca_(-1 /* no children */, ownerComponent);
6
- this.cb_ = value;
5
+ this.cc_(-1 /* no children */, ownerComponent);
6
+ this.cd_ = value;
7
7
  }
8
8
 
9
9
  VComment.prototype = {
10
- cc_: 8,
10
+ ce_: 8,
11
11
 
12
- bu_: function (host) {
13
- var nodeValue = this.cb_;
12
+ bv_: function (host) {
13
+ var nodeValue = this.cd_;
14
14
  return (host.ownerDocument || host).createComment(nodeValue);
15
15
  },
16
16
 
17
- bV_: function () {
18
- return new VComment(this.cb_);
17
+ bX_: function () {
18
+ return new VComment(this.cd_);
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.ca_(null /* childCount */, ownerComponent);
6
- this.cd_ = key;
5
+ this.cc_(null /* childCount */, ownerComponent);
6
+ this.cf_ = key;
7
7
  this.s_ = component;
8
8
  this.ag_ = preserve;
9
9
  }
10
10
 
11
11
  VComponent.prototype = {
12
- cc_: 2
12
+ ce_: 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.ce_ = null;
8
- this.cf_ = null;
7
+ this.cg_ = null;
8
+ this.ch_ = null;
9
9
  }
10
10
 
11
11
  function VDocumentFragment(out) {
12
- this.ca_(null /* childCount */);
12
+ this.cc_(null /* childCount */);
13
13
  this.r_ = out;
14
14
  }
15
15
 
16
16
  VDocumentFragment.prototype = {
17
- cc_: 11,
17
+ ce_: 11,
18
18
 
19
- cg_: true,
19
+ ci_: true,
20
20
 
21
- bV_: function () {
21
+ bX_: function () {
22
22
  return new VDocumentFragmentClone(this);
23
23
  },
24
24
 
25
- bu_: function (host) {
25
+ bv_: function (host) {
26
26
  return (host.ownerDocument || host).createDocumentFragment();
27
27
  }
28
28
  };
@@ -81,17 +81,17 @@ function assign(a, b) {
81
81
  }
82
82
 
83
83
  function VElementClone(other) {
84
- this.ch_ = other.ch_;
85
- this.ce_ = null;
86
- this.cf_ = null;
87
-
88
- this.cd_ = other.cd_;
89
- this.ci_ = other.ci_;
90
- this._R_ = other._R_;
91
84
  this.cj_ = other.cj_;
92
- this.u_ = other.u_;
85
+ this.cg_ = null;
86
+ this.ch_ = null;
87
+
88
+ this.cf_ = other.cf_;
93
89
  this.ck_ = other.ck_;
90
+ this._R_ = other._R_;
94
91
  this.cl_ = other.cl_;
92
+ this.u_ = other.u_;
93
+ this.cm_ = other.cm_;
94
+ this.cn_ = other.cn_;
95
95
  }
96
96
 
97
97
  function VElement(
@@ -103,7 +103,7 @@ childCount,
103
103
  flags,
104
104
  props)
105
105
  {
106
- this.ca_(childCount, ownerComponent);
106
+ this.cc_(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.cd_ = key;
114
+ this.cf_ = key;
115
115
  this.u_ = flags || 0;
116
- this.ci_ = attrs || EMPTY_OBJECT;
116
+ this.ck_ = attrs || EMPTY_OBJECT;
117
117
  this._R_ = props || EMPTY_OBJECT;
118
- this.cj_ = tagName;
119
- this.ck_ = "";
120
- this.cl_ = constId;
118
+ this.cl_ = tagName;
119
+ this.cm_ = "";
120
+ this.cn_ = constId;
121
121
  this.ag_ = false;
122
122
  this.af_ = false;
123
123
  }
124
124
 
125
125
  VElement.prototype = {
126
- cc_: 1,
126
+ ce_: 1,
127
127
 
128
- bV_: function () {
128
+ bX_: 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.bU_(
140
+ var child = this.bW_(
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.cm_();
153
+ return this.co_();
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.bV_();
166
+ node = node.bX_();
167
167
  node._P_ = ownerComponent;
168
- this.bU_(node);
169
- return this.cm_();
168
+ this.bW_(node);
169
+ return this.co_();
170
170
  },
171
171
 
172
- bu_: function (host, parentNamespaceURI) {
173
- var tagName = this.cj_;
174
- var attributes = this.ci_;
172
+ bv_: function (host, parentNamespaceURI) {
173
+ var tagName = this.cl_;
174
+ var attributes = this.ck_;
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.ck_;
199
+ el.textContent = this.cm_;
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.ck_ = node.textContent;
254
+ vdomEl.cm_ = node.textContent;
255
255
  } else if (virtualizeChildNodes) {
256
256
  virtualizeChildNodes(node, vdomEl, ownerComponent);
257
257
  }
@@ -259,12 +259,12 @@ function virtualizeElement(node, virtualizeChildNodes, ownerComponent) {
259
259
  return vdomEl;
260
260
  }
261
261
 
262
- VElement.cn_ = virtualizeElement;
262
+ VElement.cp_ = virtualizeElement;
263
263
 
264
- VElement.co_ = function (fromEl, vFromEl, toEl) {
264
+ VElement.cq_ = function (fromEl, vFromEl, toEl) {
265
265
  var fromFlags = vFromEl.u_;
266
266
  var toFlags = toEl.u_;
267
- var attrs = toEl.ci_;
267
+ var attrs = toEl.ck_;
268
268
 
269
269
  if (toFlags & FLAG_CUSTOM_ELEMENT) {
270
270
  return assign(fromEl, attrs);
@@ -281,7 +281,7 @@ VElement.co_ = 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.ci_;
284
+ var oldAttrs = vFromEl.ck_;
285
285
 
286
286
  if (oldAttrs === attrs) {
287
287
  // For constant attributes the same object will be provided
@@ -319,7 +319,7 @@ VElement.co_ = function (fromEl, vFromEl, toEl) {
319
319
  }
320
320
 
321
321
  var preserve = props && props.pa || EMPTY_OBJECT;
322
- var specialAttrs = specialElHandlers[toEl.cj_] || EMPTY_OBJECT;
322
+ var specialAttrs = specialElHandlers[toEl.cl_] || 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.co_ = 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.cd_ === null || fromFlags & FLAG_SPREAD_ATTRS) {
359
+ if (toEl.cf_ === null || fromFlags & FLAG_SPREAD_ATTRS) {
360
360
  for (attrName in oldAttrs) {
361
361
  if (!(attrName in attrs)) {
362
362
  if (specialAttr = specialAttrs[attrName]) {
@@ -6,16 +6,16 @@ var createFragmentNode = require("./morphdom/fragment")._m_;
6
6
  var VNode = require("./VNode");
7
7
 
8
8
  function VFragment(key, ownerComponent, preserve) {
9
- this.ca_(null /* childCount */, ownerComponent);
10
- this.cd_ = key;
9
+ this.cc_(null /* childCount */, ownerComponent);
10
+ this.cf_ = key;
11
11
  this.ag_ = preserve;
12
12
  }
13
13
 
14
14
  VFragment.prototype = {
15
- cc_: 12,
16
- bu_: function () {
15
+ ce_: 12,
16
+ bv_: function () {
17
17
  var fragment = createFragmentNode();
18
- keysByDOMNode.set(fragment, this.cd_);
18
+ keysByDOMNode.set(fragment, this.cf_);
19
19
  vElementByDOMNode.set(fragment, this);
20
20
  return fragment;
21
21
  }