@litejs/ui 26.2.0 → 26.2.1

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.
package/el/dialog.ui CHANGED
@@ -152,7 +152,7 @@
152
152
  .col.ts3 ;txt! _(title, map)
153
153
  .col.js-body ;md! _(body, map)
154
154
  .col
155
- .group ;each! action in actions
155
+ .group ;each! 'action',actions
156
156
  .btn.js-btn
157
157
  ;txt! _(action.title)
158
158
  ;class! "w" + (12/actions.length)
@@ -166,4 +166,3 @@
166
166
  .Modal-content.Modal--blur.grid.p2.anim
167
167
  ;cls! "Modal--blur",!1,1
168
168
  %slot
169
-
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@litejs/ui",
3
- "version": "26.2.0",
3
+ "version": "26.2.1",
4
4
  "description": "UI engine for LiteJS full-stack framework",
5
5
  "license": "MIT",
6
6
  "author": "Lauri Rooden <lauri@rooden.ee>",
@@ -27,6 +27,6 @@
27
27
  "test": "lj t test/index.js"
28
28
  },
29
29
  "devDependencies": {
30
- "@litejs/cli": "26.2.1"
30
+ "@litejs/cli": "26.2.3"
31
31
  }
32
32
  }
package/ui.js CHANGED
@@ -8,7 +8,7 @@
8
8
  // /*** name ***/ code1 /*/ code2 /**/ - `code1` active in source, `code2` commented out; build can swap
9
9
 
10
10
  /*** debug ***/
11
- console.log("LiteJS is in debug mode, but it's fine for production")
11
+ console.log("LiteJS is in debug mode and that's fine for production")
12
12
  /**/
13
13
 
14
14
  !function(window, document, history, localStorage, location, navigator, Function, Object) {
@@ -681,9 +681,10 @@ console.log("LiteJS is in debug mode, but it's fine for production")
681
681
  return child
682
682
  }
683
683
 
684
- addPlugin("start", {
684
+ addPlugin("ui", {
685
685
  d: Function("p", "p.u.i=1")
686
686
  })
687
+ plugins.start = plugins.ui
687
688
  addPlugin("slot", {
688
689
  d: function(plugin) {
689
690
  var slotName = plugin.n || ++elSeq
@@ -1119,36 +1120,29 @@ console.log("LiteJS is in debug mode, but it's fine for production")
1119
1120
  assign(El, {
1120
1121
  $b: assign(bindings, {
1121
1122
  each: function(el, name, list) {
1122
- /*** debug ***/
1123
- if (el._li) throw "Binding each must be type of once: each!" + name
1124
- /**/
1125
-
1126
- var comm = Comm("each " + name, up)
1123
+ var comm = el._c || (el._c = Comm("each " + name, up))
1127
1124
  , pos = 0
1128
1125
  , nodes = []
1129
-
1130
1126
  comm.$s = this
1131
1127
  elReplace(el, comm)
1132
- each(list, add)
1133
- return { a: add, u: up }
1134
-
1135
- function add(item) {
1136
- var clone = nodes[pos] = el.cloneNode(true)
1137
- , subScope = elScope(clone, comm)
1138
- append(comm.parentNode, clone, (pos ? nodes[pos - 1] : comm).nextSibling)
1139
- subScope.$i = pos++
1140
- subScope.$len = list.length
1141
- subScope[name] = item
1142
- clone._b = el._b
1143
- /*** debug ***/
1144
- clone._li = up
1145
- /**/
1146
- render(clone)
1147
- }
1128
+ up()
1129
+ return { u: up }
1130
+
1148
1131
  function up() {
1149
- for (var i = list.length; pos > i; ) elKill(nodes[--pos])
1150
- for (nodes.length = i; pos < i; ) add(list[pos])
1151
- for (; i--; ) nodes[i].$s[name] = list[i]
1132
+ if (!list) return
1133
+ for (var sub, keys = Object.keys(list), i = keys.length; pos > i; ) elKill(nodes[--pos])
1134
+ for (nodes.length = i; pos < i; ) {
1135
+ sub = nodes[pos] = el.cloneNode(true)
1136
+ sub._b = el._b
1137
+ append(comm.parentNode, sub, (pos++ ? nodes[pos - 2] : comm).nextSibling)
1138
+ elScope(sub, comm)
1139
+ }
1140
+ for (; i--; ) {
1141
+ sub = nodes[i].$s
1142
+ sub[name] = list[sub.$k = keys[sub.$i = i]]
1143
+ sub.$len = pos
1144
+ render(nodes[i])
1145
+ }
1152
1146
  }
1153
1147
  },
1154
1148
  el: function(el, tag, fallback) {
@@ -1784,7 +1778,10 @@ console.log("LiteJS is in debug mode, but it's fine for production")
1784
1778
  }), function(res) {
1785
1779
  res = res.concat(sources, next && next.src && next.innerHTML)
1786
1780
  if (res[sources.length = 0]) {
1787
- if (!parser) LiteJS.ui = LiteJS()
1781
+ if (!parser) {
1782
+ var m = res.join("\n").match(/\n%ui\s+(\{[\s\S]*\})\s*$/)
1783
+ LiteJS.ui = LiteJS(m && Function("return " + m[1])())
1784
+ }
1788
1785
  each(res, parser)
1789
1786
  }
1790
1787
  if (isFn(next)) next()
File without changes
File without changes
File without changes