@source-crafter/xzor-runtime 0.1.18 → 0.1.19

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/model.js CHANGED
@@ -10,7 +10,7 @@ import {
10
10
  setFineHooks,
11
11
  setRenderObserver,
12
12
  setTracking
13
- } from "./index-nxzr7r51.js";
13
+ } from "./index-960nssa4.js";
14
14
 
15
15
  // runtime/entity-set.ts
16
16
  class EntitySet extends Array {
@@ -728,7 +728,7 @@ function removeRange(head, tail) {
728
728
  }
729
729
  function newRow(ctx, item, reads, build) {
730
730
  const frag = document.createDocumentFragment();
731
- const row = { bindings: undefined, ctx, head: frag, tail: frag, item, reads };
731
+ const row = { bindings: undefined, ctx, head: frag, tail: frag, item, reads, set: undefined };
732
732
  within(row, () => build(frag, item));
733
733
  seal(row, frag);
734
734
  return row;
@@ -798,7 +798,7 @@ function reconcile(list, items) {
798
798
  const item = at.get(key);
799
799
  if (item === row.item)
800
800
  continue;
801
- if (state.build.length > 1) {
801
+ if (row.set === undefined && state.build.length > 1) {
802
802
  dropRow(row);
803
803
  rows.delete(key);
804
804
  } else
@@ -820,13 +820,18 @@ function reconcile(list, items) {
820
820
  }
821
821
  function retake(row, item) {
822
822
  row.item = item;
823
+ if (row.set !== undefined)
824
+ row.set(item);
823
825
  for (let b = row.bindings;b !== undefined; b = b.next) {
824
826
  if ((b.flags & ITEM) === 0)
825
827
  continue;
826
828
  if ((b.flags & KIND) === REGION)
827
829
  b.data.item = item;
828
- b.stateHasChanged();
830
+ if (row.set === undefined)
831
+ b.stateHasChanged();
829
832
  }
833
+ if (row.set !== undefined)
834
+ refreshAll(row);
830
835
  }
831
836
  function sameValues(a, b) {
832
837
  if (a.length !== b.length)
@@ -864,7 +869,7 @@ function runKeyed(s, end, run) {
864
869
  return;
865
870
  }
866
871
  const frag = document.createDocumentFragment();
867
- row = { bindings: undefined, ctx: s.ctx, head: frag, tail: frag, item: values, reads: undefined };
872
+ row = { bindings: undefined, ctx: s.ctx, head: frag, tail: frag, item: values, reads: undefined, set: undefined };
868
873
  s.rows.set(key, row);
869
874
  order.push(row);
870
875
  building = row;
@@ -1135,6 +1140,9 @@ var fine = {
1135
1140
  anchor(parent);
1136
1141
  return anchor(parent);
1137
1142
  },
1143
+ rowItem(set) {
1144
+ holder.set = set;
1145
+ },
1138
1146
  regionItem(end, i) {
1139
1147
  const row = holder;
1140
1148
  region(end.previousSibling, end, row.reads[i], row.item, ITEM);
@@ -1912,5 +1920,5 @@ export {
1912
1920
  requiredIdValue
1913
1921
  };
1914
1922
 
1915
- //# debugId=68EBAF2C0CCC917064756E2164756E21
1923
+ //# debugId=A289C126D860800164756E2164756E21
1916
1924
  //# sourceMappingURL=model.js.map