@farm.js/react 0.1.0-beta.38 → 0.1.0-beta.39

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.
@@ -1577,13 +1577,13 @@ function createCompilerKeyedCollectionUpdate(previous, value, kind) {
1577
1577
  return value;
1578
1578
  }
1579
1579
  var delegatedRowChangePlaceholder = () => void 0;
1580
- var COMPILER_HMR_REGISTRY = /* @__PURE__ */ Symbol.for("@farm.js/react/compiler-hmr-registry");
1581
1580
  function getCompilerHmrRegistry() {
1581
+ const registryKey = /* @__PURE__ */ Symbol.for("@farm.js/react/compiler-hmr-registry");
1582
1582
  const globalTarget = globalThis;
1583
- const existing = globalTarget[COMPILER_HMR_REGISTRY];
1583
+ const existing = globalTarget[registryKey];
1584
1584
  if (existing instanceof Map) return existing;
1585
1585
  const registry = /* @__PURE__ */ new Map();
1586
- globalTarget[COMPILER_HMR_REGISTRY] = registry;
1586
+ globalTarget[registryKey] = registry;
1587
1587
  return registry;
1588
1588
  }
1589
1589
  function renderTextValue(value) {
@@ -1725,6 +1725,9 @@ function updateAttribute(element, name, value) {
1725
1725
  if (name === "value" && (isInputElement(element) || isTextAreaElement(element))) {
1726
1726
  const nextValue = value === null || value === void 0 ? "" : String(value);
1727
1727
  if (element.value !== nextValue) element.value = nextValue;
1728
+ if (value != null && isInputElement(element) && (element.type !== "number" || element.ownerDocument.activeElement !== element) && element.defaultValue !== nextValue) {
1729
+ element.defaultValue = nextValue;
1730
+ }
1728
1731
  return;
1729
1732
  }
1730
1733
  if (name === "value" && isSelectElement(element)) {
@@ -1748,8 +1751,20 @@ function updateAttribute(element, name, value) {
1748
1751
  } else if (value === true && !stringifiesBoolean) {
1749
1752
  element.setAttribute(attributeName, "");
1750
1753
  } else {
1751
- element.setAttribute(attributeName, String(value));
1754
+ element.setAttribute(attributeName, compilerAttributeValue(element, name, String(value)));
1755
+ }
1756
+ }
1757
+ var JAVASCRIPT_URL = (
1758
+ // oxlint-disable-next-line no-control-regex
1759
+ /^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i
1760
+ );
1761
+ var BLOCKS_JAVASCRIPT_URLS = Number.parseInt(React.version, 10) > 18;
1762
+ function compilerAttributeValue(element, name, value) {
1763
+ if (!BLOCKS_JAVASCRIPT_URLS || name !== "href" && name !== "src" && name !== "action" && name !== "formAction" && name !== "data") {
1764
+ return value;
1752
1765
  }
1766
+ const tag = element.localName;
1767
+ return (name !== "data" || tag === "object") && !tag.includes("-") && JAVASCRIPT_URL.test(value) ? "javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')" : value;
1753
1768
  }
1754
1769
  function createConditionalBlockComponent(owner) {
1755
1770
  class FarmConditionalBlock extends React.Component {
@@ -2529,7 +2544,7 @@ function readKeyedRowBindingValues(props, item, index) {
2529
2544
  var KEYED_ROW_TEMPLATES = /* @__PURE__ */ new WeakMap();
2530
2545
  function createKeyedRowInstance(props, document, key, item, index) {
2531
2546
  const template = props.cloneRows && KEYED_ROW_TEMPLATES.get(props);
2532
- const element = template ? template.cloneNode(true) : createCompilerHostElement(document, props.create(item, index));
2547
+ const element = template ? template.element.cloneNode(true) : createCompilerHostElement(document, props.create(item, index));
2533
2548
  const instance = {
2534
2549
  key,
2535
2550
  element,
@@ -2539,16 +2554,21 @@ function createKeyedRowInstance(props, document, key, item, index) {
2539
2554
  conditionalValues: EMPTY_KEYED_ROW_CONDITIONAL_VALUES
2540
2555
  };
2541
2556
  if (props.cloneRows) {
2542
- const targets = [];
2557
+ let targets = props.targets?.(element);
2543
2558
  let found = true;
2544
- for (const binding of props.bindings) {
2545
- const target = findCompilerHostTarget(element, binding.path);
2546
- found && (found = target !== null);
2547
- targets.push(target);
2559
+ if (!targets || targets.length !== props.bindings.length || !props.bindings.every((_, index2) => targets[index2] != null)) {
2560
+ targets = [];
2561
+ for (const binding of props.bindings) {
2562
+ const target = findCompilerHostTarget(element, binding.path);
2563
+ found && (found = target !== null);
2564
+ targets.push(target);
2565
+ }
2548
2566
  }
2549
2567
  if (found) instance.targets = targets;
2550
2568
  if (template) {
2551
2569
  for (let bindingIndex = 0; bindingIndex < targets.length; bindingIndex += 1) {
2570
+ const value = instance.values[bindingIndex];
2571
+ if (typeof value === "string" && value === template.classNames[bindingIndex]) continue;
2552
2572
  commitKeyedRowBinding(
2553
2573
  props.bindings[bindingIndex],
2554
2574
  instance,
@@ -2574,10 +2594,20 @@ function keyedRowTemplate(props, element, targets) {
2574
2594
  }
2575
2595
  }
2576
2596
  const template = element.cloneNode(true);
2577
- for (const binding of props.bindings) {
2597
+ const classNames = [];
2598
+ const classTargets = /* @__PURE__ */ new Set();
2599
+ for (let bindingIndex = 0; bindingIndex < props.bindings.length; bindingIndex += 1) {
2600
+ const binding = props.bindings[bindingIndex];
2578
2601
  if (binding.kind === "text") findCompilerHostTarget(template, binding.path).textContent = "";
2602
+ if (binding.kind === "attribute" && (binding.name === "className" || binding.name === "class")) {
2603
+ const target = targets[bindingIndex];
2604
+ if (!classTargets.has(target)) {
2605
+ classNames[bindingIndex] = target.getAttribute("class") ?? void 0;
2606
+ classTargets.add(target);
2607
+ }
2608
+ }
2579
2609
  }
2580
- return template;
2610
+ return { element: template, classNames };
2581
2611
  }
2582
2612
  function applyKeyedRowBindings(props, instance, item, index) {
2583
2613
  if (props.bindings.length < 2) {
@@ -4567,13 +4597,7 @@ function reconcileCompilerKeyedMapUpdate(props, dirtyState, collectionToken, ins
4567
4597
  }
4568
4598
  }
4569
4599
  applyKeyedRowBindings(props, instance, item, index);
4570
- const conditionalValues = conditionals?.readValues(props, item, index) || EMPTY_KEYED_ROW_CONDITIONAL_VALUES;
4571
- for (const [id, values] of conditionalValues) {
4572
- if (conditionals?.changed(instance.conditionalValues.get(id), values)) {
4573
- conditionalChanges.push({ key, id, item, index });
4574
- }
4575
- }
4576
- instance.conditionalValues = conditionalValues;
4600
+ conditionals?.refresh(props, instance, key, item, index, conditionalChanges);
4577
4601
  instance.item = item;
4578
4602
  }
4579
4603
  return {
@@ -5988,6 +6012,7 @@ function reconcileCompilerKeyedArrayFilter(props, dirtyState, collectionToken, i
5988
6012
  for (const instance of instances.values()) instance.index = index++;
5989
6013
  return instances;
5990
6014
  }
6015
+ var renderKeyedRowConditional = (item, index, _id, render) => render(item, index);
5991
6016
  function createKeyedRowConditionalRuntime() {
5992
6017
  class FarmKeyedRowConditional extends React.Component {
5993
6018
  constructor() {
@@ -6030,30 +6055,48 @@ function createKeyedRowConditionalRuntime() {
6030
6055
  }
6031
6056
  }
6032
6057
  FarmKeyedRowConditional.displayName = "FarmCompiledKeyedRowConditional";
6033
- return {
6034
- element: (props) => React.createElement(FarmKeyedRowConditional, {
6035
- key: `${props.rowKey}:${props.id}`,
6036
- ...props
6037
- }),
6038
- readValues: readKeyedRowConditionalValues,
6039
- changed: keyedRowConditionalChanged,
6040
- owner: (listeners) => ({
6041
- subscribe(key, id, refresh) {
6042
- let row = listeners.get(key);
6043
- if (!row) {
6044
- row = /* @__PURE__ */ new Map();
6045
- listeners.set(key, row);
6058
+ class ConditionalBlock {
6059
+ constructor(context) {
6060
+ this.context = context;
6061
+ this.listeners = /* @__PURE__ */ new Map();
6062
+ this.owner = {
6063
+ subscribe: (key, id, refresh) => {
6064
+ let row = this.listeners.get(key);
6065
+ if (!row) {
6066
+ row = /* @__PURE__ */ new Map();
6067
+ this.listeners.set(key, row);
6068
+ }
6069
+ row.set(id, refresh);
6070
+ return () => {
6071
+ const current = this.listeners.get(key);
6072
+ if (current?.get(id) !== refresh) return;
6073
+ current.delete(id);
6074
+ if (current.size === 0) this.listeners.delete(key);
6075
+ };
6046
6076
  }
6047
- row.set(id, refresh);
6048
- return () => {
6049
- const current = listeners.get(key);
6050
- if (current?.get(id) !== refresh) return;
6051
- current.delete(id);
6052
- if (current.size === 0) listeners.delete(key);
6053
- };
6077
+ };
6078
+ this.render = (item, index, id, render) => {
6079
+ if (this.context.state.fallback) return render(item, index);
6080
+ const rowKey = keyedRowIdentity(this.context.currentProps.rowKey(item, index));
6081
+ return React.createElement(FarmKeyedRowConditional, {
6082
+ key: `${rowKey}:${id}`,
6083
+ owner: this.owner,
6084
+ rowKey,
6085
+ id,
6086
+ renderVersion: this.context.renderVersion,
6087
+ item,
6088
+ index,
6089
+ render
6090
+ });
6091
+ };
6092
+ }
6093
+ prune(instances) {
6094
+ if (this.listeners.size === 0) return;
6095
+ for (const key of this.listeners.keys()) {
6096
+ if (!instances.has(key)) this.listeners.delete(key);
6054
6097
  }
6055
- }),
6056
- notify(listeners, changes, afterCommit) {
6098
+ }
6099
+ notify(changes, afterCommit) {
6057
6100
  let pending = changes.length;
6058
6101
  const committed = () => {
6059
6102
  pending -= 1;
@@ -6061,12 +6104,25 @@ function createKeyedRowConditionalRuntime() {
6061
6104
  };
6062
6105
  flushSync(() => {
6063
6106
  for (const change of changes) {
6064
- const refresh = listeners.get(change.key)?.get(change.id);
6107
+ const refresh = this.listeners.get(change.key)?.get(change.id);
6065
6108
  if (refresh) refresh(change.item, change.index, committed);
6066
6109
  else committed();
6067
6110
  }
6068
6111
  });
6069
6112
  }
6113
+ }
6114
+ return {
6115
+ create: (context) => new ConditionalBlock(context),
6116
+ readValues: readKeyedRowConditionalValues,
6117
+ refresh(props, instance, key, item, index, changes) {
6118
+ const values = readKeyedRowConditionalValues(props, item, index);
6119
+ for (const [id, next] of values) {
6120
+ if (keyedRowConditionalChanged(instance.conditionalValues.get(id), next)) {
6121
+ changes.push({ key, id, item, index });
6122
+ }
6123
+ }
6124
+ instance.conditionalValues = values;
6125
+ }
6070
6126
  };
6071
6127
  }
6072
6128
  function createKeyedRowHostRuntime() {
@@ -6096,11 +6152,10 @@ function createKeyedRowsBlockComponentCore(owner, options = {}) {
6096
6152
  this.keyedTargets = options.keyedTargets?.(this.props);
6097
6153
  this.renderVersion = 0;
6098
6154
  this.eventHandlers = /* @__PURE__ */ new Map();
6099
- this.conditionalListeners = /* @__PURE__ */ new Map();
6155
+ this.conditionals = options.conditionals?.create(this);
6100
6156
  this.instancesByElement = /* @__PURE__ */ new WeakMap();
6101
6157
  // False after a rebuild without delegated events left surviving rows unindexed.
6102
6158
  this.elementIndexComplete = true;
6103
- this.conditionalOwner = options.conditionals?.owner(this.conditionalListeners);
6104
6159
  this.captureRoot = (root) => {
6105
6160
  this.root = root;
6106
6161
  };
@@ -6136,14 +6191,18 @@ function createKeyedRowsBlockComponentCore(owner, options = {}) {
6136
6191
  const eventTarget = event.target;
6137
6192
  if (!instance || !eventTarget) return;
6138
6193
  const capture = name.endsWith("Capture");
6139
- const matches = (this.currentProps.events || []).filter((descriptor) => descriptor.name === name && descriptor.path !== void 0).map((descriptor) => ({
6140
- descriptor,
6141
- target: findCompilerHostTarget(instance.element, descriptor.path || [])
6142
- })).filter(
6143
- (match) => Boolean(
6144
- match.target && (match.target === eventTarget || match.target.contains(eventTarget))
6145
- )
6146
- ).sort(
6194
+ const descriptors = this.currentProps.events || [];
6195
+ const matches = [];
6196
+ for (let index = 0, length = descriptors.length; index < length; index += 1) {
6197
+ if (!(index in descriptors)) continue;
6198
+ const descriptor = descriptors[index];
6199
+ if (descriptor.name !== name || descriptor.path === void 0) continue;
6200
+ const target = findCompilerHostTarget(instance.element, descriptor.path || []);
6201
+ if (target && (target === eventTarget || target.contains(eventTarget))) {
6202
+ matches.push({ descriptor, target });
6203
+ }
6204
+ }
6205
+ matches.sort(
6147
6206
  (left, right) => capture ? (left.descriptor.path?.length || 0) - (right.descriptor.path?.length || 0) : (right.descriptor.path?.length || 0) - (left.descriptor.path?.length || 0)
6148
6207
  );
6149
6208
  for (const match of matches) {
@@ -6151,18 +6210,6 @@ function createKeyedRowsBlockComponentCore(owner, options = {}) {
6151
6210
  if (event.isPropagationStopped()) break;
6152
6211
  }
6153
6212
  };
6154
- this.rowConditional = (item, index, conditionalId, render) => {
6155
- if (this.state.fallback || !options.conditionals) return render(item, index);
6156
- return options.conditionals.element({
6157
- owner: this.conditionalOwner,
6158
- rowKey: keyedRowIdentity(this.currentProps.rowKey(item, index)),
6159
- id: conditionalId,
6160
- renderVersion: this.renderVersion,
6161
- item,
6162
- index,
6163
- render
6164
- });
6165
- };
6166
6213
  this.refresh = (afterCommit, dirtyState) => {
6167
6214
  if (dirtyState && options.keyedUpdates && this.mounted && this.root && !this.state.fallback) {
6168
6215
  const result = options.keyedUpdates.reconcile(
@@ -6216,7 +6263,7 @@ function createKeyedRowsBlockComponentCore(owner, options = {}) {
6216
6263
  this.instances = positionedInstances;
6217
6264
  this.rebuildElementIndex(this.instances);
6218
6265
  this.pruneEventHandlers();
6219
- this.pruneConditionalListeners();
6266
+ this.conditionals?.prune(this.instances);
6220
6267
  }
6221
6268
  this.commitCurrentCollection(dirtyState);
6222
6269
  afterCommit?.();
@@ -6236,7 +6283,7 @@ function createKeyedRowsBlockComponentCore(owner, options = {}) {
6236
6283
  if (removedRows) {
6237
6284
  this.rebuildElementIndex(this.instances);
6238
6285
  this.pruneEventHandlers();
6239
- this.pruneConditionalListeners();
6286
+ this.conditionals?.prune(this.instances);
6240
6287
  }
6241
6288
  this.commitCurrentCollection(dirtyState);
6242
6289
  afterCommit?.();
@@ -6262,12 +6309,12 @@ function createKeyedRowsBlockComponentCore(owner, options = {}) {
6262
6309
  }
6263
6310
  for (const key of delta.removedKeys) {
6264
6311
  this.eventHandlers.delete(key);
6265
- this.conditionalListeners.delete(key);
6312
+ this.conditionals?.listeners.delete(key);
6266
6313
  }
6267
6314
  } else {
6268
6315
  this.rebuildElementIndex(this.instances);
6269
6316
  this.pruneEventHandlers();
6270
- this.pruneConditionalListeners();
6317
+ this.conditionals?.prune(this.instances);
6271
6318
  }
6272
6319
  this.commitCurrentCollection(dirtyState);
6273
6320
  afterCommit?.();
@@ -6284,7 +6331,7 @@ function createKeyedRowsBlockComponentCore(owner, options = {}) {
6284
6331
  this.instances = filteredInstances;
6285
6332
  if (!this.elementIndexComplete) this.rebuildElementIndex(this.instances);
6286
6333
  this.pruneEventHandlers();
6287
- this.pruneConditionalListeners();
6334
+ this.conditionals?.prune(this.instances);
6288
6335
  this.commitCurrentCollection(dirtyState);
6289
6336
  afterCommit?.();
6290
6337
  return;
@@ -6433,12 +6480,6 @@ function createKeyedRowsBlockComponentCore(owner, options = {}) {
6433
6480
  if (!this.instances.has(key)) this.eventHandlers.delete(key);
6434
6481
  }
6435
6482
  }
6436
- pruneConditionalListeners() {
6437
- if (this.conditionalListeners.size === 0) return;
6438
- for (const key of this.conditionalListeners.keys()) {
6439
- if (!this.instances.has(key)) this.conditionalListeners.delete(key);
6440
- }
6441
- }
6442
6483
  commitCurrentCollection(dirtyState) {
6443
6484
  this.collectionToken = options.keyedUpdates?.commit(
6444
6485
  this.currentProps.items(),
@@ -6493,7 +6534,7 @@ function createKeyedRowsBlockComponentCore(owner, options = {}) {
6493
6534
  this.reactElements = elements;
6494
6535
  this.rebuildElementIndex(instances);
6495
6536
  this.pruneEventHandlers();
6496
- this.pruneConditionalListeners();
6537
+ this.conditionals?.prune(this.instances);
6497
6538
  this.commitCurrentCollection();
6498
6539
  return true;
6499
6540
  }
@@ -6530,7 +6571,7 @@ function createKeyedRowsBlockComponentCore(owner, options = {}) {
6530
6571
  }
6531
6572
  notifyConditionalChanges(changes, afterCommit) {
6532
6573
  if (changes.length === 0) afterCommit?.();
6533
- else options.conditionals.notify(this.conditionalListeners, changes, afterCommit);
6574
+ else this.conditionals.notify(changes, afterCommit);
6534
6575
  }
6535
6576
  refreshDirtyBindings(dirtyState, afterCommit) {
6536
6577
  if (!this.mounted || !this.root || this.state.fallback || this.hasReactOwnedRows() || this.currentProps.hostBlocks || !this.currentProps.structureDependencies || this.currentProps.structureDependencies.some((dependency) => dirtyState.has(dependency)) || this.currentProps.bindings.some((binding) => binding.dependencies === void 0)) {
@@ -6647,22 +6688,14 @@ function createKeyedRowsBlockComponentCore(owner, options = {}) {
6647
6688
  } else {
6648
6689
  applyKeyedRowBindings(this.currentProps, existing, rows.items[index], index);
6649
6690
  }
6650
- const conditionalValues = this.readConditionalValues(
6691
+ options.conditionals?.refresh(
6651
6692
  this.currentProps,
6693
+ existing,
6694
+ key,
6652
6695
  rows.items[index],
6653
- index
6696
+ index,
6697
+ conditionalChanges
6654
6698
  );
6655
- for (const [id, values] of conditionalValues) {
6656
- if (options.conditionals?.changed(existing.conditionalValues.get(id), values)) {
6657
- conditionalChanges.push({
6658
- key,
6659
- id,
6660
- item: rows.items[index],
6661
- index
6662
- });
6663
- }
6664
- }
6665
- existing.conditionalValues = conditionalValues;
6666
6699
  existing.item = rows.items[index];
6667
6700
  existing.index = index;
6668
6701
  }
@@ -6769,22 +6802,14 @@ function createKeyedRowsBlockComponentCore(owner, options = {}) {
6769
6802
  } else {
6770
6803
  applyKeyedRowBindings(this.currentProps, existing, rows.items[index], index);
6771
6804
  }
6772
- const conditionalValues = this.readConditionalValues(
6805
+ options.conditionals?.refresh(
6773
6806
  this.currentProps,
6807
+ existing,
6808
+ key,
6774
6809
  rows.items[index],
6775
- index
6810
+ index,
6811
+ conditionalChanges
6776
6812
  );
6777
- for (const [id, values] of conditionalValues) {
6778
- if (options.conditionals?.changed(existing.conditionalValues.get(id), values)) {
6779
- conditionalChanges.push({
6780
- key,
6781
- id,
6782
- item: rows.items[index],
6783
- index
6784
- });
6785
- }
6786
- }
6787
- existing.conditionalValues = conditionalValues;
6788
6813
  existing.item = rows.items[index];
6789
6814
  existing.index = index;
6790
6815
  }
@@ -6793,7 +6818,7 @@ function createKeyedRowsBlockComponentCore(owner, options = {}) {
6793
6818
  instance.element.remove();
6794
6819
  this.instances.delete(instance.key);
6795
6820
  this.eventHandlers.delete(instance.key);
6796
- this.conditionalListeners.delete(instance.key);
6821
+ this.conditionals?.listeners.delete(instance.key);
6797
6822
  }
6798
6823
  this.commitCurrentCollection(dirtyState);
6799
6824
  this.notifyConditionalChanges(conditionalChanges, afterCommit);
@@ -6834,7 +6859,7 @@ function createKeyedRowsBlockComponentCore(owner, options = {}) {
6834
6859
  this.instancesByElement = /* @__PURE__ */ new WeakMap();
6835
6860
  this.elementIndexComplete = true;
6836
6861
  this.eventHandlers.clear();
6837
- this.conditionalListeners.clear();
6862
+ this.conditionals?.listeners.clear();
6838
6863
  this.commitCurrentCollection(dirtyState);
6839
6864
  afterCommit?.();
6840
6865
  return;
@@ -6867,10 +6892,12 @@ function createKeyedRowsBlockComponentCore(owner, options = {}) {
6867
6892
  let oldIndex = 0;
6868
6893
  for (const key of this.instances.keys()) oldIndices.set(key, oldIndex++);
6869
6894
  }
6870
- for (const [key, instance] of this.instances) {
6871
- if (!nextKeys.has(key)) {
6872
- instance.scope?.cleanup();
6873
- if (hasSurvivingRows) instance.element.remove();
6895
+ if (hasSurvivingRows || options.hostBlocks) {
6896
+ for (const [key, instance] of this.instances) {
6897
+ if (!nextKeys.has(key)) {
6898
+ instance.scope?.cleanup();
6899
+ if (hasSurvivingRows) instance.element.remove();
6900
+ }
6874
6901
  }
6875
6902
  }
6876
6903
  const sequence = hasSurvivingRows ? rows.keys.map((key) => oldIndices.get(key) ?? -1) : [];
@@ -6896,22 +6923,14 @@ function createKeyedRowsBlockComponentCore(owner, options = {}) {
6896
6923
  } else {
6897
6924
  applyKeyedRowBindings(this.currentProps, existing, rows.items[index], index);
6898
6925
  }
6899
- const conditionalValues = this.readConditionalValues(
6926
+ options.conditionals?.refresh(
6900
6927
  this.currentProps,
6928
+ existing,
6929
+ key,
6901
6930
  rows.items[index],
6902
- index
6931
+ index,
6932
+ conditionalChanges
6903
6933
  );
6904
- for (const [id, values] of conditionalValues) {
6905
- if (options.conditionals?.changed(existing.conditionalValues.get(id), values)) {
6906
- conditionalChanges.push({
6907
- key,
6908
- id,
6909
- item: rows.items[index],
6910
- index
6911
- });
6912
- }
6913
- }
6914
- existing.conditionalValues = conditionalValues;
6915
6934
  existing.item = rows.items[index];
6916
6935
  existing.index = index;
6917
6936
  nextInstances.push(existing);
@@ -6974,7 +6993,7 @@ function createKeyedRowsBlockComponentCore(owner, options = {}) {
6974
6993
  this.rebuildElementIndex(this.instances);
6975
6994
  }
6976
6995
  this.pruneEventHandlers();
6977
- this.pruneConditionalListeners();
6996
+ this.conditionals?.prune(this.instances);
6978
6997
  this.commitCurrentCollection(dirtyState);
6979
6998
  this.notifyConditionalChanges(conditionalChanges, afterCommit);
6980
6999
  }
@@ -7047,11 +7066,14 @@ function createKeyedRowsBlockComponentCore(owner, options = {}) {
7047
7066
  this.instancesByElement = /* @__PURE__ */ new WeakMap();
7048
7067
  this.elementIndexComplete = true;
7049
7068
  this.eventHandlers.clear();
7050
- this.conditionalListeners.clear();
7069
+ this.conditionals?.listeners.clear();
7051
7070
  }
7052
7071
  render() {
7053
7072
  this.renderVersion += 1;
7054
- const container = this.currentProps.render(this.rowEvent, this.rowConditional);
7073
+ const container = this.currentProps.render(
7074
+ this.rowEvent,
7075
+ this.conditionals?.render || renderKeyedRowConditional
7076
+ );
7055
7077
  if (!React.isValidElement(container) || typeof container.type !== "string") {
7056
7078
  throw new TypeError(
7057
7079
  `Compiled keyed rows ${this.currentProps.id} must own one host container.`
@@ -7593,6 +7615,14 @@ var keyedRowsPositionHintedRuntimeFeature = {
7593
7615
  })
7594
7616
  })
7595
7617
  };
7618
+ var keyedRowsPlainPositionHintedRuntimeFeature = {
7619
+ name: "keyed-rows:plain-position-hinted",
7620
+ create: (owner) => ({
7621
+ KeyedRows: createKeyedRowsBlockComponentCore(owner, {
7622
+ keyedUpdates: keyedPositionUpdateRuntime
7623
+ })
7624
+ })
7625
+ };
7596
7626
  var keyedRowsBatchPositionHintedRuntimeFeature = {
7597
7627
  name: "keyed-rows:batch-position-hinted",
7598
7628
  create: (owner) => ({
@@ -7617,6 +7647,22 @@ var keyedRowsReorderHintedRuntimeFeature = {
7617
7647
  })
7618
7648
  })
7619
7649
  };
7650
+ var keyedRowsPlainReorderHintedRuntimeFeature = {
7651
+ name: "keyed-rows:plain-reorder-hinted",
7652
+ create: (owner) => ({
7653
+ KeyedRows: createKeyedRowsBlockComponentCore(owner, {
7654
+ keyedUpdates: keyedReorderUpdateRuntime
7655
+ })
7656
+ })
7657
+ };
7658
+ var keyedRowsPlainMapReorderHintedRuntimeFeature = {
7659
+ name: "keyed-rows:plain-map-reorder-hinted",
7660
+ create: (owner) => ({
7661
+ KeyedRows: createKeyedRowsBlockComponentCore(owner, {
7662
+ keyedUpdates: keyedMapReorderUpdateRuntime
7663
+ })
7664
+ })
7665
+ };
7620
7666
  var keyedRowsMapReorderHintedRuntimeFeature = {
7621
7667
  name: "keyed-rows:map-reorder-hinted",
7622
7668
  create: (owner) => ({
@@ -8301,6 +8347,26 @@ function createCompiledComponentWithFeatures(definition, runtimeFeatures) {
8301
8347
  current: definition
8302
8348
  };
8303
8349
  const refreshListeners = /* @__PURE__ */ new Set();
8350
+ const component = createCompiledComponentRuntime(
8351
+ definitionReference,
8352
+ runtimeFeatures,
8353
+ refreshListeners
8354
+ );
8355
+ if (definition.hmrId) {
8356
+ getCompilerHmrRegistry().set(definition.hmrId, {
8357
+ component,
8358
+ definition: definitionReference,
8359
+ refreshListeners,
8360
+ stateSignature,
8361
+ runtimeSignature
8362
+ });
8363
+ }
8364
+ return component;
8365
+ }
8366
+ function createCompiledComponentWithoutRefresh(definition, runtimeFeatures) {
8367
+ return createCompiledComponentRuntime({ current: definition }, runtimeFeatures);
8368
+ }
8369
+ function createCompiledComponentRuntime(definitionReference, runtimeFeatures, refreshListeners) {
8304
8370
  class FarmCompiledComponent extends React.Component {
8305
8371
  constructor(props) {
8306
8372
  super(props);
@@ -8611,7 +8677,7 @@ function createCompiledComponentWithFeatures(definition, runtimeFeatures) {
8611
8677
  }
8612
8678
  componentDidMount() {
8613
8679
  this.mounted = true;
8614
- refreshListeners.add(this.refreshDefinition);
8680
+ refreshListeners?.add(this.refreshDefinition);
8615
8681
  this.componentDidUpdate();
8616
8682
  }
8617
8683
  getSnapshotBeforeUpdate() {
@@ -8667,7 +8733,7 @@ function createCompiledComponentWithFeatures(definition, runtimeFeatures) {
8667
8733
  this.bindingValues.clear();
8668
8734
  this.activeBinding = null;
8669
8735
  this.activeDependencies = null;
8670
- refreshListeners.delete(this.refreshDefinition);
8736
+ refreshListeners?.delete(this.refreshDefinition);
8671
8737
  }
8672
8738
  render() {
8673
8739
  if (this.hasBindingError) throw this.bindingError;
@@ -8709,18 +8775,8 @@ function createCompiledComponentWithFeatures(definition, runtimeFeatures) {
8709
8775
  return renderedElement;
8710
8776
  }
8711
8777
  }
8712
- FarmCompiledComponent.displayName = `FarmCompiled(${definition.displayName})`;
8713
- const component = FarmCompiledComponent;
8714
- if (definition.hmrId) {
8715
- getCompilerHmrRegistry().set(definition.hmrId, {
8716
- component,
8717
- definition: definitionReference,
8718
- refreshListeners,
8719
- stateSignature,
8720
- runtimeSignature
8721
- });
8722
- }
8723
- return component;
8778
+ FarmCompiledComponent.displayName = `FarmCompiled(${definitionReference.current.displayName})`;
8779
+ return FarmCompiledComponent;
8724
8780
  }
8725
8781
  var COMPLETE_RUNTIME_FEATURES = [
8726
8782
  conditionalRuntimeFeature,
@@ -8736,6 +8792,6 @@ function createCompiledComponent(definition) {
8736
8792
  return createCompiledComponentWithFeatures(definition, COMPLETE_RUNTIME_FEATURES);
8737
8793
  }
8738
8794
 
8739
- export { applyCompilerKeyedCollectionMutation, componentRuntimeFeature, conditionalRangesRuntimeFeature, conditionalRuntimeFeature, createCompiledComponent, createCompiledComponentWithFeatures, createCompilerKeyedArrayAppend, createCompilerKeyedArrayBatchInsert, createCompilerKeyedArrayFilter, createCompilerKeyedArrayMapPipeline, createCompilerKeyedArrayMapReorder, createCompilerKeyedArrayMappedRollingWindow, createCompilerKeyedArrayMappedStructuralAppend, createCompilerKeyedArrayMappedStructuralPrepend, createCompilerKeyedArrayPositionUpdate, createCompilerKeyedArrayPrepend, createCompilerKeyedArrayQueuedMapPipeline, createCompilerKeyedArrayReorder, createCompilerKeyedArrayRollingWindow, createCompilerKeyedArrayRollingWindowMapPipeline, createCompilerKeyedArraySlice, createCompilerKeyedArraySort, createCompilerKeyedArrayStructuralAppend, createCompilerKeyedArrayStructuralAppendMapPipeline, createCompilerKeyedArrayStructuralPrepend, createCompilerKeyedArrayStructuralPrependMapPipeline, createCompilerKeyedArrayStructuralReorder, createCompilerKeyedArrayStructuralSort, createCompilerKeyedArrayWindowReplace, createCompilerKeyedCollectionUpdate, createCompilerKeyedMapUpdate, finalizeCompilerKeyedArrayMappedStructuralUpdate, hostConditionalRuntimeFeature, keyedListRuntimeFeature, keyedRangesRuntimeFeature, keyedRowsAllHintedRuntimeFeature, keyedRowsAppendOnlyRuntimeFeature, keyedRowsBatchEveryHintedRuntimeFeature, keyedRowsBatchPositionHintedRuntimeFeature, keyedRowsCompleteAllHintedRuntimeFeature, keyedRowsCompleteBatchEveryHintedRuntimeFeature, keyedRowsCompleteBatchPositionHintedRuntimeFeature, keyedRowsCompleteEveryHintedRuntimeFeature, keyedRowsCompleteFilterHintedRuntimeFeature, keyedRowsCompleteFilterPrependHintedRuntimeFeature, keyedRowsCompleteHintedRuntimeFeature, keyedRowsCompleteMappedRollingWindowHintedRuntimeFeature, keyedRowsCompletePositionHintedRuntimeFeature, keyedRowsCompletePrependHintedRuntimeFeature, keyedRowsCompleteReorderHintedRuntimeFeature, keyedRowsCompleteRuntimeFeature, keyedRowsCompleteStructuralAppendHintedRuntimeFeature, keyedRowsCompleteStructuralAppendMapHintedRuntimeFeature, keyedRowsCompleteStructuralPrependHintedRuntimeFeature, keyedRowsCompleteStructuralPrependMapHintedRuntimeFeature, keyedRowsCompleteWindowEveryHintedRuntimeFeature, keyedRowsCompleteWindowPositionHintedRuntimeFeature, keyedRowsConditionalAllHintedRuntimeFeature, keyedRowsConditionalBatchEveryHintedRuntimeFeature, keyedRowsConditionalBatchPositionHintedRuntimeFeature, keyedRowsConditionalEveryHintedRuntimeFeature, keyedRowsConditionalFilterHintedRuntimeFeature, keyedRowsConditionalFilterPrependHintedRuntimeFeature, keyedRowsConditionalHintedRuntimeFeature, keyedRowsConditionalMappedRollingWindowHintedRuntimeFeature, keyedRowsConditionalPositionHintedRuntimeFeature, keyedRowsConditionalPrependHintedRuntimeFeature, keyedRowsConditionalReorderHintedRuntimeFeature, keyedRowsConditionalRuntimeFeature, keyedRowsConditionalStructuralAppendHintedRuntimeFeature, keyedRowsConditionalStructuralAppendMapHintedRuntimeFeature, keyedRowsConditionalStructuralPrependHintedRuntimeFeature, keyedRowsConditionalStructuralPrependMapHintedRuntimeFeature, keyedRowsConditionalWindowEveryHintedRuntimeFeature, keyedRowsConditionalWindowPositionHintedRuntimeFeature, keyedRowsEveryHintedRuntimeFeature, keyedRowsFilterHintedRuntimeFeature, keyedRowsFilterOnlyRuntimeFeature, keyedRowsFilterPrependHintedRuntimeFeature, keyedRowsHintedRuntimeFeature, keyedRowsHostAllHintedRuntimeFeature, keyedRowsHostBatchEveryHintedRuntimeFeature, keyedRowsHostBatchPositionHintedRuntimeFeature, keyedRowsHostEveryHintedRuntimeFeature, keyedRowsHostFilterHintedRuntimeFeature, keyedRowsHostFilterPrependHintedRuntimeFeature, keyedRowsHostHintedRuntimeFeature, keyedRowsHostMappedRollingWindowHintedRuntimeFeature, keyedRowsHostPositionHintedRuntimeFeature, keyedRowsHostPrependHintedRuntimeFeature, keyedRowsHostReorderHintedRuntimeFeature, keyedRowsHostRuntimeFeature, keyedRowsHostStructuralAppendHintedRuntimeFeature, keyedRowsHostStructuralAppendMapHintedRuntimeFeature, keyedRowsHostStructuralPrependHintedRuntimeFeature, keyedRowsHostStructuralPrependMapHintedRuntimeFeature, keyedRowsHostWindowEveryHintedRuntimeFeature, keyedRowsHostWindowPositionHintedRuntimeFeature, keyedRowsIdentityFilterHintedRuntimeFeature, keyedRowsIdentityFilterOnlyRuntimeFeature, keyedRowsIdentityRuntimeFeature, keyedRowsMapLookupRuntimeFeature, keyedRowsMapReorderHintedRuntimeFeature, keyedRowsMappedRollingWindowHintedRuntimeFeature, keyedRowsMembershipRuntimeFeature, keyedRowsPlainRuntimeFeature, keyedRowsPositionHintedRuntimeFeature, keyedRowsPrependHintedRuntimeFeature, keyedRowsPrependOnlyRuntimeFeature, keyedRowsReorderHintedRuntimeFeature, keyedRowsRuntimeFeature, keyedRowsStructuralAppendHintedRuntimeFeature, keyedRowsStructuralAppendMapHintedRuntimeFeature, keyedRowsStructuralPrependHintedRuntimeFeature, keyedRowsStructuralPrependMapHintedRuntimeFeature, keyedRowsWindowEveryHintedRuntimeFeature, keyedRowsWindowPositionHintedRuntimeFeature, mixedRangesRuntimeFeature };
8795
+ export { applyCompilerKeyedCollectionMutation, componentRuntimeFeature, conditionalRangesRuntimeFeature, conditionalRuntimeFeature, createCompiledComponent, createCompiledComponentWithFeatures, createCompiledComponentWithoutRefresh, createCompilerKeyedArrayAppend, createCompilerKeyedArrayBatchInsert, createCompilerKeyedArrayFilter, createCompilerKeyedArrayMapPipeline, createCompilerKeyedArrayMapReorder, createCompilerKeyedArrayMappedRollingWindow, createCompilerKeyedArrayMappedStructuralAppend, createCompilerKeyedArrayMappedStructuralPrepend, createCompilerKeyedArrayPositionUpdate, createCompilerKeyedArrayPrepend, createCompilerKeyedArrayQueuedMapPipeline, createCompilerKeyedArrayReorder, createCompilerKeyedArrayRollingWindow, createCompilerKeyedArrayRollingWindowMapPipeline, createCompilerKeyedArraySlice, createCompilerKeyedArraySort, createCompilerKeyedArrayStructuralAppend, createCompilerKeyedArrayStructuralAppendMapPipeline, createCompilerKeyedArrayStructuralPrepend, createCompilerKeyedArrayStructuralPrependMapPipeline, createCompilerKeyedArrayStructuralReorder, createCompilerKeyedArrayStructuralSort, createCompilerKeyedArrayWindowReplace, createCompilerKeyedCollectionUpdate, createCompilerKeyedMapUpdate, finalizeCompilerKeyedArrayMappedStructuralUpdate, hostConditionalRuntimeFeature, keyedListRuntimeFeature, keyedRangesRuntimeFeature, keyedRowsAllHintedRuntimeFeature, keyedRowsAppendOnlyRuntimeFeature, keyedRowsBatchEveryHintedRuntimeFeature, keyedRowsBatchPositionHintedRuntimeFeature, keyedRowsCompleteAllHintedRuntimeFeature, keyedRowsCompleteBatchEveryHintedRuntimeFeature, keyedRowsCompleteBatchPositionHintedRuntimeFeature, keyedRowsCompleteEveryHintedRuntimeFeature, keyedRowsCompleteFilterHintedRuntimeFeature, keyedRowsCompleteFilterPrependHintedRuntimeFeature, keyedRowsCompleteHintedRuntimeFeature, keyedRowsCompleteMappedRollingWindowHintedRuntimeFeature, keyedRowsCompletePositionHintedRuntimeFeature, keyedRowsCompletePrependHintedRuntimeFeature, keyedRowsCompleteReorderHintedRuntimeFeature, keyedRowsCompleteRuntimeFeature, keyedRowsCompleteStructuralAppendHintedRuntimeFeature, keyedRowsCompleteStructuralAppendMapHintedRuntimeFeature, keyedRowsCompleteStructuralPrependHintedRuntimeFeature, keyedRowsCompleteStructuralPrependMapHintedRuntimeFeature, keyedRowsCompleteWindowEveryHintedRuntimeFeature, keyedRowsCompleteWindowPositionHintedRuntimeFeature, keyedRowsConditionalAllHintedRuntimeFeature, keyedRowsConditionalBatchEveryHintedRuntimeFeature, keyedRowsConditionalBatchPositionHintedRuntimeFeature, keyedRowsConditionalEveryHintedRuntimeFeature, keyedRowsConditionalFilterHintedRuntimeFeature, keyedRowsConditionalFilterPrependHintedRuntimeFeature, keyedRowsConditionalHintedRuntimeFeature, keyedRowsConditionalMappedRollingWindowHintedRuntimeFeature, keyedRowsConditionalPositionHintedRuntimeFeature, keyedRowsConditionalPrependHintedRuntimeFeature, keyedRowsConditionalReorderHintedRuntimeFeature, keyedRowsConditionalRuntimeFeature, keyedRowsConditionalStructuralAppendHintedRuntimeFeature, keyedRowsConditionalStructuralAppendMapHintedRuntimeFeature, keyedRowsConditionalStructuralPrependHintedRuntimeFeature, keyedRowsConditionalStructuralPrependMapHintedRuntimeFeature, keyedRowsConditionalWindowEveryHintedRuntimeFeature, keyedRowsConditionalWindowPositionHintedRuntimeFeature, keyedRowsEveryHintedRuntimeFeature, keyedRowsFilterHintedRuntimeFeature, keyedRowsFilterOnlyRuntimeFeature, keyedRowsFilterPrependHintedRuntimeFeature, keyedRowsHintedRuntimeFeature, keyedRowsHostAllHintedRuntimeFeature, keyedRowsHostBatchEveryHintedRuntimeFeature, keyedRowsHostBatchPositionHintedRuntimeFeature, keyedRowsHostEveryHintedRuntimeFeature, keyedRowsHostFilterHintedRuntimeFeature, keyedRowsHostFilterPrependHintedRuntimeFeature, keyedRowsHostHintedRuntimeFeature, keyedRowsHostMappedRollingWindowHintedRuntimeFeature, keyedRowsHostPositionHintedRuntimeFeature, keyedRowsHostPrependHintedRuntimeFeature, keyedRowsHostReorderHintedRuntimeFeature, keyedRowsHostRuntimeFeature, keyedRowsHostStructuralAppendHintedRuntimeFeature, keyedRowsHostStructuralAppendMapHintedRuntimeFeature, keyedRowsHostStructuralPrependHintedRuntimeFeature, keyedRowsHostStructuralPrependMapHintedRuntimeFeature, keyedRowsHostWindowEveryHintedRuntimeFeature, keyedRowsHostWindowPositionHintedRuntimeFeature, keyedRowsIdentityFilterHintedRuntimeFeature, keyedRowsIdentityFilterOnlyRuntimeFeature, keyedRowsIdentityRuntimeFeature, keyedRowsMapLookupRuntimeFeature, keyedRowsMapReorderHintedRuntimeFeature, keyedRowsMappedRollingWindowHintedRuntimeFeature, keyedRowsMembershipRuntimeFeature, keyedRowsPlainMapReorderHintedRuntimeFeature, keyedRowsPlainPositionHintedRuntimeFeature, keyedRowsPlainReorderHintedRuntimeFeature, keyedRowsPlainRuntimeFeature, keyedRowsPositionHintedRuntimeFeature, keyedRowsPrependHintedRuntimeFeature, keyedRowsPrependOnlyRuntimeFeature, keyedRowsReorderHintedRuntimeFeature, keyedRowsRuntimeFeature, keyedRowsStructuralAppendHintedRuntimeFeature, keyedRowsStructuralAppendMapHintedRuntimeFeature, keyedRowsStructuralPrependHintedRuntimeFeature, keyedRowsStructuralPrependMapHintedRuntimeFeature, keyedRowsWindowEveryHintedRuntimeFeature, keyedRowsWindowPositionHintedRuntimeFeature, mixedRangesRuntimeFeature };
8740
8796
  //# sourceMappingURL=compiler-runtime.mjs.map
8741
8797
  //# sourceMappingURL=compiler-runtime.mjs.map