efront 4.22.18 → 4.23.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 (74) hide show
  1. package/#/345/233/275/351/231/205/345/214/226.yml +6 -0
  2. package/apps/kugou/search/search.js +4 -3
  3. package/apps/noice/main.js +1 -1
  4. package/apps/pivot/auth/login.js +4 -4
  5. package/apps/pivot/dht/list.js +5 -5
  6. package/apps/pivot/link/chat.js +1 -1
  7. package/apps/pivot/link/index.js +1 -1
  8. package/apps/pivot/link/list.js +5 -4
  9. package/apps/pivot/share/list.js +6 -5
  10. package/apps/pivot/wow/root.js +3 -2
  11. package/coms/basic/LoadingArray.js +1 -0
  12. package/coms/basic/cross_.js +4 -1
  13. package/coms/basic/data.js +16 -13
  14. package/coms/basic_/WeakMap.js +23 -0
  15. package/coms/compile/Javascript.js +2 -1
  16. package/coms/explorer/context.js +10 -7
  17. package/coms/explorer/edit.js +1 -1
  18. package/coms/explorer/fileitem.js +9 -7
  19. package/coms/explorer/main.js +20 -17
  20. package/coms/frame/chat.js +17 -16
  21. package/coms/frame/list.js +6 -5
  22. package/coms/kugou/bindScroll.js +0 -1
  23. package/coms/kugou/buildScroll.js +5 -4
  24. package/coms/kugou/krc.js +2 -2
  25. package/coms/kugou/player.js +2 -2
  26. package/coms/kugou/song.js +1 -1
  27. package/coms/layer/leftCenter.js +5 -5
  28. package/coms/pivot/checkGeo.js +0 -1
  29. package/coms/zimoli/$eval.js +1 -0
  30. package/coms/zimoli/$mounted.js +1 -0
  31. package/coms/zimoli/$parented.js +1 -0
  32. package/coms/zimoli/$renders.js +1 -0
  33. package/coms/zimoli/$scoped.js +1 -0
  34. package/coms/zimoli/$structed.js +1 -0
  35. package/coms/zimoli/HexEditor.js +1 -1
  36. package/coms/zimoli/appendChild.js +12 -20
  37. package/coms/zimoli/autodragchildren_test.js +1 -1
  38. package/coms/zimoli/checkbox.js +1 -1
  39. package/coms/zimoli/container.js +4 -3
  40. package/coms/zimoli/createItemTarget.js +10 -6
  41. package/coms/zimoli/cross.js +1 -1
  42. package/coms/zimoli/field.js +3 -3
  43. package/coms/zimoli/gallery_test.js +4 -3
  44. package/coms/zimoli/getArgsChildren.js +22 -0
  45. package/coms/zimoli/getGenerator.js +36 -28
  46. package/coms/zimoli/grid.js +2 -2
  47. package/coms/zimoli/isMounted.js +6 -3
  48. package/coms/zimoli/lattice.js +2 -4
  49. package/coms/zimoli/maps.js +1 -2
  50. package/coms/zimoli/menu.js +1 -0
  51. package/coms/zimoli/menuItem.js +4 -3
  52. package/coms/zimoli/menuList.js +8 -8
  53. package/coms/zimoli/menu_test.js +4 -3
  54. package/coms/zimoli/model.js +11 -6
  55. package/coms/zimoli/on.js +28 -20
  56. package/coms/zimoli/picture.js +0 -7
  57. package/coms/zimoli/popup.js +33 -2
  58. package/coms/zimoli/radio.js +1 -1
  59. package/coms/zimoli/remove.js +5 -14
  60. package/coms/zimoli/render.js +193 -99
  61. package/coms/zimoli/scrollbar.js +90 -42
  62. package/coms/zimoli/scrollbar.less +5 -3
  63. package/coms/zimoli/select.js +3 -3
  64. package/coms/zimoli/selectList.js +1 -1
  65. package/coms/zimoli/selectListEdit.js +5 -4
  66. package/coms/zimoli/table.html +6 -4
  67. package/coms/zimoli/table.js +82 -41
  68. package/coms/zimoli/table.less +22 -0
  69. package/coms/zimoli/vbox.less +2 -2
  70. package/coms/zimoli/zimoli.js +15 -8
  71. package/docs/version-desc.md +3 -1
  72. package/docs//347/211/210/346/234/254/350/257/264/346/230/216.md +3 -1
  73. package/package.json +1 -1
  74. package/public/efront.js +1 -1
@@ -6,7 +6,7 @@ function main(title, { fields, options: options0, load, remove, buttons }, edit_
6
6
  return;
7
7
  }
8
8
  var callback = function () {
9
- page.$scope.load();
9
+ page_scope.load();
10
10
  };
11
11
  if (isFunction(edit_ref)) {
12
12
  var p = await edit_ref({ fields, data: o, callback });
@@ -54,12 +54,12 @@ function main(title, { fields, options: options0, load, remove, buttons }, edit_
54
54
  return;
55
55
  }
56
56
  await remove(o);
57
- page.$scope.load();
57
+ page_scope.load();
58
58
  }
59
59
  }
60
60
  ];
61
61
  if (options0) options = options.concat(options0);
62
- renderWithDefaults(page, {
62
+ var page_scope = {
63
63
  title,
64
64
  load() {
65
65
  this.data = load();
@@ -74,9 +74,10 @@ function main(title, { fields, options: options0, load, remove, buttons }, edit_
74
74
  async add() {
75
75
  await edit();
76
76
  },
77
- });
77
+ }
78
+ renderWithDefaults(page, page_scope);
78
79
  on("append")(page, function () {
79
- page.$scope.load();
80
+ page_scope.load();
80
81
  });
81
82
  return page;
82
83
  }
@@ -53,6 +53,5 @@ function bindScroll(titlebar, page) {
53
53
  setOpacity(label, 1 - (titlebar.offsetHeight - topHeight) / (offsetHeight - topHeight));
54
54
  return {};
55
55
  };
56
- if (!page.$renders) page.$renders = [];
57
56
  page.onscroll = refresh;
58
57
  }
@@ -3,7 +3,7 @@ function Main(dataid, datapath, titleid) {
3
3
  var page = createVboxWithState(state);
4
4
  page.initialStyle = 'margin-left:100%';
5
5
  page.innerHTML = buildScroll;
6
- render(page, {
6
+ var pgscope = {
7
7
  list: lattice,
8
8
  song,
9
9
  padding,
@@ -20,7 +20,8 @@ function Main(dataid, datapath, titleid) {
20
20
  config: {},
21
21
  player: kugou$player,
22
22
  datas: []
23
- });
23
+ };
24
+ render(page, pgscope);
24
25
  bindScroll(_titlebar, page);
25
26
  var loadedId, requested = false;
26
27
  function main(params) {
@@ -31,8 +32,8 @@ function Main(dataid, datapath, titleid) {
31
32
  var ranklist = data.from(dataid, {
32
33
  id
33
34
  }, parseSongsList);
34
- page.$scope.config = params;
35
- page.$scope.datas = ranklist;
35
+ pgscope.config = params;
36
+ pgscope.datas = ranklist;
36
37
  if (titleid) {
37
38
  data.from(titleid, {
38
39
  id
package/coms/kugou/krc.js CHANGED
@@ -120,7 +120,7 @@ function createLRC(lrc) {
120
120
  setClass(krcList, index);
121
121
  }
122
122
  }
123
- if (ele && firstChild && firstChild.$mounted) {
123
+ if (ele && firstChild && isMounted(firstChild)) {
124
124
  var marginTop = (firstChild.parentNode.offsetHeight - ele.offsetHeight >> 1) - ele.offsetTop + firstChild.offsetTop;
125
125
  css(firstChild, `margin-top:${marginTop | 0}px;`);
126
126
  }
@@ -166,7 +166,7 @@ function createKRC(krc) {
166
166
  var current_row_word = current_words[current_row_index];
167
167
  var ele = krcList[index];
168
168
  var firstChild = krcList[0];
169
- if (ele && firstChild && firstChild.$mounted) {
169
+ if (ele && firstChild && isMounted(firstChild)) {
170
170
  var marginTop = (firstChild.parentNode.offsetHeight - ele.offsetHeight >> 1) - ele.offsetTop + firstChild.offsetTop;
171
171
  if (index > 0) {
172
172
  if (markerLabel.parentNode !== ele) {
@@ -87,7 +87,7 @@ var oncanplay = on("canplay"), ondataloaded = on("loadeddata");
87
87
  on("keydown")(window, function (event) {
88
88
  var { target } = event;
89
89
  if (/^(input|select|textarea)$/i.test(target.tagName)) return;
90
- var $scope = player.$scope;
90
+ var $scope = $scoped.get(player);
91
91
  if (!$scope.audio && !kugou$musicList.getActived()) return;
92
92
  switch (event.keyCode || event.which) {
93
93
  case 32:
@@ -418,7 +418,7 @@ var createControls = function () {
418
418
  moveupon(player, {
419
419
  end() {
420
420
  var currentHeight = calcPixel(this.offsetHeight), windowHeight = calcPixel(window.innerHeight);
421
- var $scope = this.$scope;
421
+ var $scope = $scoped.get(this);
422
422
  var { deltaTop } = this;
423
423
  removeClass(this, "dragging");
424
424
  if (deltaTop) {
@@ -1,5 +1,5 @@
1
1
  function dplay() {
2
- this.firstChild.$scope.play();
2
+ $scoped.get(this.firstChild).play();
3
3
  }
4
4
  function main(elem) {
5
5
  elem = elem || document.createElement("song");
@@ -38,12 +38,12 @@ function setCurrentPage(page) {
38
38
  var currentLayer = getCurrentLayer();
39
39
  if (page !== leftPage) {
40
40
  if (currentLayer !== leftLayer) {
41
- if (!leftPage.$mounted) appendChild(leftLayer, leftPage);
41
+ if (!isMounted(leftPage)) appendChild(leftLayer, leftPage);
42
42
  } else {
43
43
  remove(leftPage, false);
44
44
  }
45
45
  if (page.parentNode !== currentLayer) appendChild(currentLayer, page, false);
46
- } else if (!leftPage.$mounted) {
46
+ } else if (!isMounted(leftPage)) {
47
47
  appendChild(leftLayer, leftPage, false);
48
48
  }
49
49
  }
@@ -54,16 +54,16 @@ function main(_leftPage) {
54
54
  layer.layer = function (child, old) {
55
55
  remove(old);
56
56
  if (child === leftPage) {
57
- if (!leftPage.$mounted) appendChild(leftLayer, child);
57
+ if (!isMounted(leftPage)) appendChild(leftLayer, child);
58
58
  } else if (child) {
59
59
  var currentLayer = getCurrentLayer();
60
60
  appendChild(currentLayer, child);
61
61
  if (currentLayer === leftLayer) {
62
62
  if (arguments.length > 1) remove(leftPage);
63
- } else if (!leftPage.$mounted) {
63
+ } else if (!isMounted(leftPage)) {
64
64
  appendChild(leftLayer, leftPage);
65
65
  }
66
66
  } else {
67
- if (!leftPage.$mounted) appendChild(leftLayer, leftPage);
67
+ if (!isMounted(leftPage)) appendChild(leftLayer, leftPage);
68
68
  }
69
69
  };
@@ -20,7 +20,6 @@ return async function (a) {
20
20
  var m = /(\d+\.){3}\d+$/.exec(ip);
21
21
  ip = m ? m[0] : ip;
22
22
  var res = await data.from("ipcn", { ip });
23
- console.log(res)
24
23
  if (!res.address && !res.data) res = await baidu(ip);
25
24
  var msg = '加载错误';
26
25
  if (res.message && !res.data && !res.content && !res.address) {
@@ -0,0 +1 @@
1
+ render.eval;
@@ -0,0 +1 @@
1
+ new WeakMap;
@@ -0,0 +1 @@
1
+ new WeakMap;
@@ -0,0 +1 @@
1
+ new WeakMap;
@@ -0,0 +1 @@
1
+ new WeakMap;
@@ -0,0 +1 @@
1
+ new WeakMap;
@@ -1,5 +1,5 @@
1
1
  var toHex = lazy(function (event) {
2
- var data = this.$scope.data;
2
+ var data = $scoped.get(this).data;
3
3
  data.splice(0, data.length);
4
4
  this.innerText.replace(/[a-f\d]{2}/g, function (a) {
5
5
  a = parseInt(a, 16);
@@ -9,9 +9,9 @@ function hasEnterStyle(e) {
9
9
  }
10
10
 
11
11
  function _onappend(node, append = createEvent("append"), mount = createEvent("mounted")) {
12
- if (node.$mounted) return;
12
+ if ($mounted.get(node)) return;
13
13
  if (node.nodeType !== 1 && node.nodeType !== 8) return;
14
- node.$mounted = true;
14
+ $mounted.set(node, true);
15
15
  dispatch(node, append);
16
16
  var children = Array.apply(null, node.childNodes);
17
17
  for (var c of children) {
@@ -19,12 +19,9 @@ function _onappend(node, append = createEvent("append"), mount = createEvent("mo
19
19
  }
20
20
  dispatch(node, mount);
21
21
  }
22
+
22
23
  function appendChild(parent, obj, transition) {
23
- if (transition === false) {
24
- var children = [].concat(obj);
25
- } else {
26
- var children = isArrayLike(obj) ? slice.call(obj, 0) : slice.call(arguments, 1);
27
- }
24
+ var children = getArgsChildren(arguments);
28
25
  if (parent.appendChild) {
29
26
  for (var cx = 0, dx = children.length; cx < dx; cx++) {
30
27
  var o = release(children[cx]);
@@ -43,11 +40,7 @@ function appendChild(parent, obj, transition) {
43
40
  function insertBefore(alreadyMounted, obj, transition) {
44
41
  var parent = alreadyMounted && alreadyMounted.parentNode;
45
42
  if (!parent || !parent.insertBefore) return;
46
- if (transition === false) {
47
- var children = [].concat(obj);
48
- } else {
49
- var children = isArray(obj) ? slice.call(obj, 0) : slice.call(arguments, 1);
50
- }
43
+ var children = getArgsChildren(arguments);
51
44
  for (var cx = 0, dx = children.length; cx < dx; cx++) {
52
45
  var o = release(children[cx]);
53
46
  if (!o) continue;
@@ -60,21 +53,20 @@ function insertBefore(alreadyMounted, obj, transition) {
60
53
  }
61
54
  }
62
55
  }
56
+
63
57
  function insertAfter(alreadyMounted, obj, transition) {
64
58
  var parent = alreadyMounted && alreadyMounted.parentNode;
65
59
  if (!parent || !parent.insertBefore) return;
66
- if (transition === false) {
67
- var children = [].concat(obj);
68
- } else {
69
- var children = isArray(obj) ? slice.call(obj, 0) : slice.call(arguments, 1);
70
- }
71
- children = children.reverse();
60
+ var nextSibling = alreadyMounted.nextSibling;
61
+ var children = getArgsChildren(arguments);
62
+ transition = transition !== false;
63
+ if (!nextSibling) return appendChild(parent, children, transition);
72
64
  for (var cx = 0, dx = children.length; cx < dx; cx++) {
73
65
  var o = release(children[cx]);
74
66
  if (!o) continue;
75
67
  if (o.removeTimer) clearTimeout(o.removeTimer);
76
- parent.insertBefore(o, alreadyMounted.nextSibling);
77
- o.with && insertBefore(alreadyMounted.nextSibling, o.with, transition);
68
+ parent.insertBefore(o, nextSibling);
69
+ o.with && insertBefore(nextSibling, o.with, transition);
78
70
  if (isMounted(parent)) _onappend(o);
79
71
  if (hasEnterStyle(o) && transition !== false) {
80
72
  isFunction(appendChild.transition) && appendChild.transition(o);
@@ -11,7 +11,7 @@ function main() {
11
11
  xsrc: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30],
12
12
  })
13
13
  autodragchildren(xList, xList, function (src, dst) {
14
- var xsrc = xList.$scope.xsrc;
14
+ var xsrc = $scoped.get(xList).xsrc;
15
15
  var src = src.target.index || 0;
16
16
  var dst = xList.children[dst].index || 0;
17
17
  var [e] = xsrc.splice(src, 1);
@@ -46,7 +46,7 @@ function main(elem = document.createElement("checkbox-group")) {
46
46
  value.checked = checked;
47
47
  };
48
48
  elem.setValue = function (value) {
49
- var { options } = this.$scope;
49
+ var { options } = $scoped.get(this);
50
50
  buildValue(value, options);
51
51
  };
52
52
  return elem;
@@ -2,8 +2,9 @@ var change = async function (src) {
2
2
  if (src !== this.$src) return;
3
3
  if (!src) remove(this.with);
4
4
  else if (isNode(src)) {
5
- if (isElement(src) && this.$struct.copys) {
6
- for (var c of this.$struct.copys) {
5
+ var struct = $structed.get(this);
6
+ if (isElement(src) && struct.copys) {
7
+ for (var c of struct.copys) {
7
8
  if (c.name === 'class') {
8
9
  addClass(src, c.value);
9
10
  }
@@ -35,7 +36,7 @@ var onparams = function (params) {
35
36
  };
36
37
  function container(element) {
37
38
  var comment = document.createComment('container');
38
- comment.$struct = element.$struct;
39
+ $structed.set(comment, $structed.get(element));
39
40
  care(comment, gosrc);
40
41
  if (element.hasAttribute && element.hasAttribute('src')) {
41
42
  var src = element.getAttribute('src');
@@ -1,13 +1,17 @@
1
+
1
2
  function createItemTarget(item, target) {
2
3
  var $scope = {};
3
4
  var { itemName, indexName, keyName } = this.$src;
4
5
  if (itemName) $scope[itemName] = item;
5
6
  else $scope.$item = item;
6
- if (target && target.$scope) {
7
- if (indexName) $scope[indexName] = target.$scope[indexName];
8
- if (keyName) $scope[keyName] = target.$scope[keyName];
9
- $scope.$index = target.$scope.$index;
10
- $scope.$key = target.$scope.$key;
7
+ var element = document.createComment('active');
8
+ var tscope = target && $scoped.get(target);
9
+ if (tscope) {
10
+ if (indexName) $scope[indexName] = tscope[indexName];
11
+ if (keyName) $scope[keyName] = tscope[keyName];
12
+ $scope.$index = tscope.$index;
13
+ $scope.$key = tscope.$key;
11
14
  }
12
- return { $scope };
15
+ $scoped.set(element, $scope);
16
+ return element;
13
17
  }
@@ -7,7 +7,7 @@ var location_href = parseURL(location.href);
7
7
  location_href = `${location_href.protocol}//${location_href.host}/`;
8
8
  cross_.setLocation(location_href);
9
9
 
10
- var cookieItemsInSessionStorageKey = "--zimoli-coms-cross";
10
+ var cookieItemsInSessionStorageKey = "紫茉莉:得特呢勒";
11
11
  var cookiesData = sessionStorage.getItem(cookieItemsInSessionStorageKey);
12
12
  if (cookiesData) {
13
13
  try {
@@ -53,13 +53,13 @@ var reshape = function () {
53
53
  };
54
54
  var checkValue = function () {
55
55
  if (!(this.src instanceof Array)) return;
56
- var { field, data } = this.$scope;
56
+ var scope = $scoped.get(this);
57
+ var { field, data } = scope;
57
58
  if (!field || !data) return;
58
59
  var v = data[field.key];
59
60
  if (!this.checked) if (v === this.oldValue || isEmpty(this.oldValue) && isEmpty(v)) return;
60
61
  this.checked = false;
61
62
  this.setAttribute("dirty", '');
62
- var scope = this.$scope;
63
63
  var error = valid(field, data);
64
64
  if (error) {
65
65
  this.setAttribute("error", error);
@@ -120,7 +120,7 @@ function main(elem) {
120
120
  if (head) addClass(head, "head");
121
121
  if (body) addClass(body, "body");
122
122
  if (foot) addClass(foot, "foot");
123
- elem.$renders.push(reshape);
123
+ elem.$renders = [reshape];
124
124
  }
125
125
  return elem;
126
126
  }
@@ -2,13 +2,14 @@ function main() {
2
2
  var items = new Array(100).fill(0).map((_, i) => ({ color: color.random(), name: "item " + (i + 1), height: Math.random() * 100 + 60 }));
3
3
  var layer = div();
4
4
  layer.innerHTML = template;
5
- renderWithDefaults(layer, {
5
+ var scope = {
6
6
  gallery,
7
7
  data: []
8
- });
8
+ };
9
+ renderWithDefaults(layer, scope);
9
10
  layer.querySelector("gallery").go(0);
10
11
  onappend(layer, function () {
11
- layer.$scope.data = items;
12
+ scope.data = items;
12
13
  });
13
14
  return layer;
14
15
  }
@@ -0,0 +1,22 @@
1
+ var getArgsChildren = function (args, from = 1) {
2
+ var obj = args[from];
3
+ if (isArray(obj) && !obj.with) return obj;
4
+ var transition = args[from + 1];
5
+ var children;
6
+ if (isArrayLike(obj)) {
7
+ children = Array.apply(null, obj);
8
+ var ith = obj.with;
9
+ while (ith) {
10
+ if (isNode(ith)) children.push(ith), ith = null;
11
+ else if (isArray(ith)) children.push.apply(children, ith), ith = ith.with;
12
+ else ith = null;
13
+ }
14
+ }
15
+ else if (transition === false || transition === true || !isHandled(obj)) {
16
+ children = [].concat(obj);
17
+ }
18
+ else {
19
+ children = Array.prototype.slice.call(args, from);
20
+ }
21
+ return children;
22
+ }
@@ -1,13 +1,13 @@
1
+ var renderIds = render.stepId;
1
2
  /**
2
3
  * @param {Element} template
3
4
  */
4
- var cloneChildNodes = function (template) {
5
+ var cloneChildNodes = function (template, structs, ids) {
5
6
  var cloned = template.cloneNode(true);
6
7
  var cNodes = cloned.childNodes;
7
- var tNodes = template.childNodes;
8
8
  for (var cx = 0, dx = cNodes.length; cx < dx; cx++) {
9
- cNodes[cx].$struct = tNodes[cx].$struct;
10
- cNodes[cx].$renderid = tNodes[cx].$renderid;
9
+ $structed.set(cNodes[cx], structs[cx]);
10
+ renderIds.set(cNodes[cx], ids[cx]);
11
11
  }
12
12
  return cNodes;
13
13
  }
@@ -23,12 +23,12 @@ var setitem = function (i, v) {
23
23
  if (isFunction(src.set)) return src.set(i);
24
24
  else return src[i] = v;
25
25
  }
26
- var createScope = function (container, index, com) {
26
+ var createScope = function (container, index, com, wrap) {
27
27
  var parsedSrc = container.$src;
28
28
  var wraped = undefined;
29
29
  var origin = com;
30
- if (container.$wrapItem) {
31
- com = container.$wrapItem(com);
30
+ if (wrap) {
31
+ com = wrap(com);
32
32
  }
33
33
  if (com.constructor === Item) {
34
34
  wraped = com;
@@ -60,30 +60,31 @@ var createScope = function (container, index, com) {
60
60
  newScope.$origin = origin;
61
61
  return newScope;
62
62
  }
63
- var update = function (scope, index) {
63
+ var update = function (scope, index, wrap) {
64
64
  var item = getitem.call(this, index);
65
65
  if (!isHandled(item) || item === scope.$origin) return;
66
- var newScope = createScope(this, index, item);
66
+ var newScope = createScope(this, index, item, wrap);
67
67
  extend(scope, newScope);
68
68
  }
69
-
69
+ var generatorScopes = new WeakMap;
70
+ var generators = new WeakMap;
71
+ var wrapItem1 = a => new Item(a);
70
72
  /**
71
73
  * @param {Element} container
72
74
  * @param {Element|string} tagName;
73
75
  */
74
76
  var getGenerator = function (container, tagName = 'item', wrapItem = false) {
75
77
  if (!container) return;
76
- var scopes = container.$parentScopes || [];
77
- if (container.$scope) scopes = scopes.concat(container.$scope);
78
- container.$generatorScopes = scopes;
79
- if (container.$generator) return container.$generator;
78
+ var generator = generators.get(container);
79
+ if (wrapItem) {
80
+ wrapItem = isFunction(wrapItem) ? wrapItem : wrapItem1;
81
+ }
82
+ if (generator) return generator;
83
+ var scopes = render.getScopes(container) || [];
80
84
  var template = document.createElement(container.tagName);
81
85
  var tagTemplate = isElement(tagName);
82
86
  var templates = [];
83
87
  var hasAfter = false;
84
- if (wrapItem) {
85
- container.$wrapItem = isFunction(wrapItem) ? wrapItem : Item;
86
- }
87
88
  for (let a of container.childNodes) {
88
89
  if (a.nodeType === 1 && a.hasAttribute('insert')) {
89
90
  if (!templates.length) a.$isbefore = true;
@@ -111,19 +112,21 @@ var getGenerator = function (container, tagName = 'item', wrapItem = false) {
111
112
 
112
113
  appendChild(template, templates);
113
114
  render.struct(templates);
115
+ var ids, structs;
114
116
  if (tagTemplate) {
115
- render.struct(tagName);
117
+ var tt = $structed.get(tagName);
116
118
  var template0 = templates[0];
117
- template0.$struct = render.mergeStruct(tagName.$struct, template0.$struct);
118
- template0.$renderid = tagName.$renderid;
119
+ tt = render.mergeStruct(tt, $structed.get(template0));
120
+ $structed.set(template0, tt);
121
+ renderIds.set(template0, renderIds.get(tagName));
119
122
  }
120
- if (templates.length) container.$template = template;
123
+
121
124
  /**
122
125
  * @param {number} index;
123
126
  * @param {Object} com;
124
127
  * @param {Element} element;
125
128
  */
126
- return container.$generator = function (index, com, element) {
129
+ generator = function (index, com, element) {
127
130
  if (com === undefined) {
128
131
  com = getitem.call(container, index);
129
132
  }
@@ -133,17 +136,22 @@ var getGenerator = function (container, tagName = 'item', wrapItem = false) {
133
136
  element = document.createElement(tagName);
134
137
  }
135
138
  else {
136
- var childNodes = cloneChildNodes(template);
139
+ var childNodes = cloneChildNodes(template, structs, ids);
137
140
  element = childNodes[0];
138
141
  if (childNodes.length > 1) element.with = Array.prototype.slice.call(childNodes, 1);
139
142
  }
140
- var scopes = container.$generatorScopes;
141
- var newScope = createScope(container, index, com);
142
- element.$scope = newScope;
143
- element.$parentScopes = scopes;
144
- element.$renders = [update.bind(container, newScope, index)];
143
+ var newScope = createScope(container, index, com, wrapItem);
144
+ element.$renders = [update.bind(container, newScope, index, wrapItem)];
145
145
  var newItem = render(element, newScope, scopes, false);
146
146
  if (element.with) newItem.with = render(element.with, newScope, scopes, false);
147
147
  return newItem;
148
148
  };
149
+ if (templates.length) {
150
+ generator.$template = template;
151
+ ids = Array.prototype.map.call(templates, a => renderIds.get(a));
152
+ structs = Array.prototype.map.call(templates, a => $structed.get(a));
153
+ }
154
+ generators.set(container, generator);
155
+ generator.scopes = scopes;
156
+ return generator;
149
157
  };
@@ -290,7 +290,7 @@ function grid(breakpoints) {
290
290
  }
291
291
  extend(grid, grid_prototype);
292
292
  if (!breakpoints) {
293
- if (grid.clientHeight || grid.$mounted) {
293
+ if (grid.clientHeight || $mounted.get(grid)) {
294
294
  createPointsWithChildren.call(grid);
295
295
  } else {
296
296
  on("append")(grid, createPointsWithChildren);
@@ -456,7 +456,7 @@ var grid_prototype = {
456
456
  run(this.breakpoints);
457
457
  },
458
458
  reshape() {
459
- if (this.$mounted || this.offsetWidth || this.offsetHeight) {
459
+ if (this.offsetWidth || this.offsetHeight || $mounted.get(this)) {
460
460
  this._reshape();
461
461
  } else {
462
462
  once("append")(this, this._reshape);
@@ -1,9 +1,12 @@
1
1
  function isMounted(parent) {
2
- if ("$mounted" in parent) return parent.$mounted;
2
+ var m = $mounted.get(parent);
3
+ if (m !== undefined) return m;
3
4
  var temp = parent;
4
5
  while (temp && temp !== document.documentElement) {
5
- if ("$mounted" in temp) {
6
- return parent.$mounted = temp.$mounted;
6
+ if ($mounted.has(temp)) {
7
+ var m = $mounted.get(temp);
8
+ $mounted.set(parent, m);
9
+ return m;
7
10
  }
8
11
  temp = temp.parentNode;
9
12
  }
@@ -29,9 +29,7 @@ function lattice(element, minWidth, _maxWidth, layers) {
29
29
  _box.group = boxCount;
30
30
  if (savedCount === boxCount) return;
31
31
  _box.clean();
32
- [].forEach.call(_box.children, function (c) {
33
- build(c);
34
- });
32
+ [].forEach.call(_box.children, build);
35
33
  return true;
36
34
  };
37
35
  if (layers) {
@@ -105,7 +103,7 @@ function main() {
105
103
  initMinWidth(arg);
106
104
  }
107
105
  });
108
- if (element && element.$scope) {
106
+ if (element && element.$src) {
109
107
  layers = null;
110
108
  }
111
109
  return lattice(element, minWidth || 240, maxWidth, layers);
@@ -185,8 +185,7 @@ function maps(config = {}) {
185
185
  canvas.map.refresh();
186
186
  canvas._default = canvas.map.defaultImage();
187
187
  };
188
- if (canvas.$mounted) reshape();
189
- else once("append")(canvas, reshape);
188
+ once("append")(canvas, reshape);
190
189
  bind('resize')(canvas, reshape);
191
190
 
192
191
  return canvas;
@@ -197,6 +197,7 @@ function main() {
197
197
  while (i < s.length) {
198
198
  src0.push.apply(src0, s.slice(i, i += 1000));
199
199
  }
200
+ elem.src = src0;
200
201
  });
201
202
  menuList(elem, src0, emit, direction);
202
203
  }
@@ -2,10 +2,11 @@ var preventDefault = function (e) { e.preventDefault() };
2
2
  function main(elem, scope, hasIcon) {
3
3
  var item = elem || document.createElement('menu-item');
4
4
  item.innerHTML = menuItem;
5
- if (isObject(scope) && scope !== item.$scope) {
5
+ var ms = $scoped.get(item);
6
+ if (isObject(scope) && scope !== ms) {
6
7
  }
7
- else if (item.$scope) {
8
- var scope = item.$scope;
8
+ else if (ms) {
9
+ var scope = ms;
9
10
  }
10
11
  var menu = scope;
11
12
  if (menu.menu || menu.$item) menu = menu.menu || menu.$item;