@farm.js/react 0.1.0-beta.25 → 0.1.0-beta.27
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/dist/compiler-runtime.cjs +113 -119
- package/dist/compiler-runtime.cjs.map +1 -1
- package/dist/compiler-runtime.mjs +113 -119
- package/dist/compiler-runtime.mjs.map +1 -1
- package/dist/list.cjs +1 -1
- package/dist/list.cjs.map +1 -1
- package/dist/list.mjs +1 -1
- package/dist/list.mjs.map +1 -1
- package/dist/vite.cjs +165 -45
- package/dist/vite.cjs.map +1 -1
- package/dist/vite.d.mts +2 -0
- package/dist/vite.d.ts +2 -0
- package/dist/vite.mjs +165 -45
- package/dist/vite.mjs.map +1 -1
- package/package.json +5 -5
|
@@ -11,7 +11,7 @@ var React__default = /*#__PURE__*/_interopDefault(React);
|
|
|
11
11
|
|
|
12
12
|
// src/iterable.ts
|
|
13
13
|
var oneShotSnapshots = /* @__PURE__ */ new WeakMap();
|
|
14
|
-
var arrayIterator = Array.prototype[Symbol.iterator];
|
|
14
|
+
var arrayIterator = /* @__PURE__ */ (() => Array.prototype[Symbol.iterator])();
|
|
15
15
|
function materializeIterable(source) {
|
|
16
16
|
if (source == null) return [];
|
|
17
17
|
if (Array.isArray(source) && Object.getPrototypeOf(source) === Array.prototype && source[Symbol.iterator] === arrayIterator) {
|
|
@@ -48,16 +48,16 @@ var COMPILER_KEYED_COLLECTION_DRAFTS = /* @__PURE__ */ new WeakMap();
|
|
|
48
48
|
var COMPILER_KEYED_COLLECTION_UPDATES = /* @__PURE__ */ new WeakMap();
|
|
49
49
|
var COMPILER_KEYED_COMMITTED_COLLECTIONS = /* @__PURE__ */ new WeakSet();
|
|
50
50
|
var COMPILER_KEYED_COMMITTED_ITEM_SNAPSHOTS = /* @__PURE__ */ new WeakMap();
|
|
51
|
-
var NATIVE_ARRAY_PROTOTYPE = Array.prototype;
|
|
52
|
-
var NATIVE_ARRAY_ITERATOR = Array.prototype[Symbol.iterator];
|
|
53
|
-
var NATIVE_ARRAY_FILTER = Array.prototype.filter;
|
|
54
|
-
var NATIVE_ARRAY_MAP = Array.prototype.map;
|
|
55
|
-
var NATIVE_ARRAY_SLICE = Array.prototype.slice;
|
|
56
|
-
var NATIVE_ARRAY_TO_SPLICED = Array.prototype.toSpliced;
|
|
57
|
-
var NATIVE_ARRAY_WITH = Array.prototype.with;
|
|
58
|
-
var NATIVE_ARRAY_TO_REVERSED = Array.prototype.toReversed;
|
|
59
|
-
var NATIVE_ARRAY_TO_SORTED = Array.prototype.toSorted;
|
|
60
|
-
var NATIVE_REFLECT_APPLY = Reflect.apply;
|
|
51
|
+
var NATIVE_ARRAY_PROTOTYPE = /* @__PURE__ */ (() => Array.prototype)();
|
|
52
|
+
var NATIVE_ARRAY_ITERATOR = /* @__PURE__ */ (() => Array.prototype[Symbol.iterator])();
|
|
53
|
+
var NATIVE_ARRAY_FILTER = /* @__PURE__ */ (() => Array.prototype.filter)();
|
|
54
|
+
var NATIVE_ARRAY_MAP = /* @__PURE__ */ (() => Array.prototype.map)();
|
|
55
|
+
var NATIVE_ARRAY_SLICE = /* @__PURE__ */ (() => Array.prototype.slice)();
|
|
56
|
+
var NATIVE_ARRAY_TO_SPLICED = /* @__PURE__ */ (() => Array.prototype.toSpliced)();
|
|
57
|
+
var NATIVE_ARRAY_WITH = /* @__PURE__ */ (() => Array.prototype.with)();
|
|
58
|
+
var NATIVE_ARRAY_TO_REVERSED = /* @__PURE__ */ (() => Array.prototype.toReversed)();
|
|
59
|
+
var NATIVE_ARRAY_TO_SORTED = /* @__PURE__ */ (() => Array.prototype.toSorted)();
|
|
60
|
+
var NATIVE_REFLECT_APPLY = /* @__PURE__ */ (() => Reflect.apply)();
|
|
61
61
|
function compilerObject(value) {
|
|
62
62
|
return typeof value === "object" && value !== null || typeof value === "function" ? value : void 0;
|
|
63
63
|
}
|
|
@@ -2049,11 +2049,11 @@ function keyedIdentityTargetSnapshot(value) {
|
|
|
2049
2049
|
const kind = typeof value;
|
|
2050
2050
|
return value === null || value === void 0 || kind === "string" || kind === "number" || kind === "bigint" ? { eligible: true, key: keyedRowIdentity(value) } : { eligible: false };
|
|
2051
2051
|
}
|
|
2052
|
-
var NATIVE_SET_PROTOTYPE = Set.prototype;
|
|
2053
|
-
var NATIVE_SET_ADD = Set.prototype.add;
|
|
2054
|
-
var NATIVE_SET_DELETE = Set.prototype.delete;
|
|
2055
|
-
var NATIVE_SET_HAS = Set.prototype.has;
|
|
2056
|
-
var NATIVE_SET_VALUES = Set.prototype.values;
|
|
2052
|
+
var NATIVE_SET_PROTOTYPE = /* @__PURE__ */ (() => Set.prototype)();
|
|
2053
|
+
var NATIVE_SET_ADD = /* @__PURE__ */ (() => Set.prototype.add)();
|
|
2054
|
+
var NATIVE_SET_DELETE = /* @__PURE__ */ (() => Set.prototype.delete)();
|
|
2055
|
+
var NATIVE_SET_HAS = /* @__PURE__ */ (() => Set.prototype.has)();
|
|
2056
|
+
var NATIVE_SET_VALUES = /* @__PURE__ */ (() => Set.prototype.values)();
|
|
2057
2057
|
var KEYED_COLLECTION_SNAPSHOT_MAX_DEPTH = 64;
|
|
2058
2058
|
function materializeKeyedMembershipSnapshot(snapshot) {
|
|
2059
2059
|
if (!snapshot.eligible) return void 0;
|
|
@@ -2154,12 +2154,12 @@ function keyedMembershipChangedKeys(previousSnapshot, nextSnapshot) {
|
|
|
2154
2154
|
}
|
|
2155
2155
|
return keys;
|
|
2156
2156
|
}
|
|
2157
|
-
var NATIVE_MAP_PROTOTYPE = Map.prototype;
|
|
2158
|
-
var NATIVE_MAP_GET = Map.prototype.get;
|
|
2159
|
-
var NATIVE_MAP_HAS = Map.prototype.has;
|
|
2160
|
-
var NATIVE_MAP_SET = Map.prototype.set;
|
|
2161
|
-
var NATIVE_MAP_DELETE = Map.prototype.delete;
|
|
2162
|
-
var NATIVE_MAP_ENTRIES = Map.prototype.entries;
|
|
2157
|
+
var NATIVE_MAP_PROTOTYPE = /* @__PURE__ */ (() => Map.prototype)();
|
|
2158
|
+
var NATIVE_MAP_GET = /* @__PURE__ */ (() => Map.prototype.get)();
|
|
2159
|
+
var NATIVE_MAP_HAS = /* @__PURE__ */ (() => Map.prototype.has)();
|
|
2160
|
+
var NATIVE_MAP_SET = /* @__PURE__ */ (() => Map.prototype.set)();
|
|
2161
|
+
var NATIVE_MAP_DELETE = /* @__PURE__ */ (() => Map.prototype.delete)();
|
|
2162
|
+
var NATIVE_MAP_ENTRIES = /* @__PURE__ */ (() => Map.prototype.entries)();
|
|
2163
2163
|
function isSafeKeyedMapLookupValue(value) {
|
|
2164
2164
|
return value === null || value === void 0 || typeof value === "string" || typeof value === "number" || typeof value === "bigint" || typeof value === "boolean";
|
|
2165
2165
|
}
|
|
@@ -2624,18 +2624,21 @@ function commitKeyedRowBinding(binding, instance, bindingIndex, value, target) {
|
|
|
2624
2624
|
instance.values[bindingIndex] = value;
|
|
2625
2625
|
if (!target) return;
|
|
2626
2626
|
if (binding.kind === "text") {
|
|
2627
|
-
|
|
2628
|
-
if (value && text && text === target.lastChild && text.nodeType === 3) {
|
|
2629
|
-
text.data = value;
|
|
2630
|
-
} else {
|
|
2631
|
-
target.textContent = value;
|
|
2632
|
-
}
|
|
2627
|
+
updateTextContent(target, value);
|
|
2633
2628
|
} else if (binding.kind === "style" && binding.name) {
|
|
2634
2629
|
updateStyle(target, binding.name, value);
|
|
2635
2630
|
} else if (binding.kind === "attribute" && binding.name) {
|
|
2636
2631
|
updateAttribute(target, binding.name, value);
|
|
2637
2632
|
}
|
|
2638
2633
|
}
|
|
2634
|
+
function updateTextContent(target, value) {
|
|
2635
|
+
const text = target.firstChild;
|
|
2636
|
+
if (value && text && text === target.lastChild && text.nodeType === 3) {
|
|
2637
|
+
text.data = value;
|
|
2638
|
+
} else {
|
|
2639
|
+
target.textContent = value;
|
|
2640
|
+
}
|
|
2641
|
+
}
|
|
2639
2642
|
function prepareKeyedRowBindingUpdate(props, instance, item, index, bindingIndex) {
|
|
2640
2643
|
const binding = props.bindings[bindingIndex];
|
|
2641
2644
|
const rawValue = binding.read(item, index);
|
|
@@ -4450,92 +4453,92 @@ var keyedAppendOnlyUpdateRuntime = {
|
|
|
4450
4453
|
commit: commitCompilerKeyedCollection,
|
|
4451
4454
|
reconcile: () => void 0
|
|
4452
4455
|
};
|
|
4453
|
-
var keyedFilterUpdateRuntime = {
|
|
4456
|
+
var keyedFilterUpdateRuntime = /* @__PURE__ */ (() => ({
|
|
4454
4457
|
...keyedUpdateRuntime,
|
|
4455
4458
|
filter: reconcileCompilerKeyedArrayFilter
|
|
4456
|
-
};
|
|
4459
|
+
}))();
|
|
4457
4460
|
var keyedFilterOnlyUpdateRuntime = {
|
|
4458
4461
|
append: () => void 0,
|
|
4459
4462
|
commit: commitCompilerKeyedCollection,
|
|
4460
4463
|
reconcile: () => void 0,
|
|
4461
4464
|
filter: reconcileCompilerKeyedArrayFilter
|
|
4462
4465
|
};
|
|
4463
|
-
var keyedPrependUpdateRuntime = {
|
|
4466
|
+
var keyedPrependUpdateRuntime = /* @__PURE__ */ (() => ({
|
|
4464
4467
|
...keyedUpdateRuntime,
|
|
4465
4468
|
prepend: reconcileCompilerKeyedArrayPrepend
|
|
4466
|
-
};
|
|
4469
|
+
}))();
|
|
4467
4470
|
var keyedPrependOnlyUpdateRuntime = {
|
|
4468
4471
|
append: () => void 0,
|
|
4469
4472
|
commit: commitCompilerKeyedCollection,
|
|
4470
4473
|
reconcile: () => void 0,
|
|
4471
4474
|
prepend: reconcileCompilerKeyedArrayPrepend
|
|
4472
4475
|
};
|
|
4473
|
-
var keyedFilterPrependUpdateRuntime = {
|
|
4476
|
+
var keyedFilterPrependUpdateRuntime = /* @__PURE__ */ (() => ({
|
|
4474
4477
|
...keyedFilterUpdateRuntime,
|
|
4475
4478
|
prepend: reconcileCompilerKeyedArrayPrepend
|
|
4476
|
-
};
|
|
4477
|
-
var keyedStructuralPrependUpdateRuntime = {
|
|
4479
|
+
}))();
|
|
4480
|
+
var keyedStructuralPrependUpdateRuntime = /* @__PURE__ */ (() => ({
|
|
4478
4481
|
...keyedFilterPrependUpdateRuntime,
|
|
4479
4482
|
prepend: reconcileCompilerKeyedArrayPrependWithStructural
|
|
4480
|
-
};
|
|
4481
|
-
var keyedPositionUpdateRuntime = {
|
|
4483
|
+
}))();
|
|
4484
|
+
var keyedPositionUpdateRuntime = /* @__PURE__ */ (() => ({
|
|
4482
4485
|
...keyedUpdateRuntime,
|
|
4483
4486
|
position: reconcileCompilerKeyedArrayPosition
|
|
4484
|
-
};
|
|
4485
|
-
var keyedBatchPositionUpdateRuntime = {
|
|
4487
|
+
}))();
|
|
4488
|
+
var keyedBatchPositionUpdateRuntime = /* @__PURE__ */ (() => ({
|
|
4486
4489
|
...keyedUpdateRuntime,
|
|
4487
4490
|
position: reconcileCompilerKeyedArrayPositionWithBatch
|
|
4488
|
-
};
|
|
4489
|
-
var keyedWindowPositionUpdateRuntime = {
|
|
4491
|
+
}))();
|
|
4492
|
+
var keyedWindowPositionUpdateRuntime = /* @__PURE__ */ (() => ({
|
|
4490
4493
|
...keyedUpdateRuntime,
|
|
4491
4494
|
position: reconcileCompilerKeyedArrayPositionWithWindow
|
|
4492
|
-
};
|
|
4493
|
-
var keyedReorderUpdateRuntime = {
|
|
4495
|
+
}))();
|
|
4496
|
+
var keyedReorderUpdateRuntime = /* @__PURE__ */ (() => ({
|
|
4494
4497
|
...keyedUpdateRuntime,
|
|
4495
4498
|
reorder: reconcileCompilerKeyedArrayReorder
|
|
4496
|
-
};
|
|
4497
|
-
var keyedMapReorderUpdateRuntime = {
|
|
4499
|
+
}))();
|
|
4500
|
+
var keyedMapReorderUpdateRuntime = /* @__PURE__ */ (() => ({
|
|
4498
4501
|
...keyedUpdateRuntime,
|
|
4499
4502
|
reorder: reconcileCompilerKeyedArrayReorderWithMap
|
|
4500
|
-
};
|
|
4501
|
-
var keyedCompleteUpdateRuntime = {
|
|
4503
|
+
}))();
|
|
4504
|
+
var keyedCompleteUpdateRuntime = /* @__PURE__ */ (() => ({
|
|
4502
4505
|
...keyedFilterPrependUpdateRuntime,
|
|
4503
4506
|
rollingWindow: reconcileCompilerKeyedArrayRollingWindow
|
|
4504
|
-
};
|
|
4505
|
-
var keyedEveryUpdateRuntime = {
|
|
4507
|
+
}))();
|
|
4508
|
+
var keyedEveryUpdateRuntime = /* @__PURE__ */ (() => ({
|
|
4506
4509
|
...keyedCompleteUpdateRuntime,
|
|
4507
4510
|
position: reconcileCompilerKeyedArrayPosition,
|
|
4508
4511
|
reorder: reconcileCompilerKeyedArrayReorderWithMapAndStructural
|
|
4509
|
-
};
|
|
4510
|
-
var keyedBatchEveryUpdateRuntime = {
|
|
4512
|
+
}))();
|
|
4513
|
+
var keyedBatchEveryUpdateRuntime = /* @__PURE__ */ (() => ({
|
|
4511
4514
|
...keyedEveryUpdateRuntime,
|
|
4512
4515
|
position: reconcileCompilerKeyedArrayPositionWithBatch
|
|
4513
|
-
};
|
|
4514
|
-
var keyedWindowEveryUpdateRuntime = {
|
|
4516
|
+
}))();
|
|
4517
|
+
var keyedWindowEveryUpdateRuntime = /* @__PURE__ */ (() => ({
|
|
4515
4518
|
...keyedEveryUpdateRuntime,
|
|
4516
4519
|
position: reconcileCompilerKeyedArrayPositionWithWindow
|
|
4517
|
-
};
|
|
4518
|
-
var keyedWindowEveryStructuralAppendUpdateRuntime = {
|
|
4520
|
+
}))();
|
|
4521
|
+
var keyedWindowEveryStructuralAppendUpdateRuntime = /* @__PURE__ */ (() => ({
|
|
4519
4522
|
...keyedWindowEveryUpdateRuntime,
|
|
4520
4523
|
append: reconcileCompilerKeyedArrayAppendWithStructural
|
|
4521
|
-
};
|
|
4522
|
-
var keyedWindowEveryStructuralAppendMapUpdateRuntime = {
|
|
4524
|
+
}))();
|
|
4525
|
+
var keyedWindowEveryStructuralAppendMapUpdateRuntime = /* @__PURE__ */ (() => ({
|
|
4523
4526
|
...keyedWindowEveryStructuralAppendUpdateRuntime,
|
|
4524
4527
|
append: reconcileCompilerKeyedArrayAppendMapWithStructural,
|
|
4525
4528
|
commit: commitCompilerKeyedCollectionWithItemSnapshot
|
|
4526
|
-
};
|
|
4527
|
-
var keyedCompleteCompatibilityUpdateRuntime = {
|
|
4529
|
+
}))();
|
|
4530
|
+
var keyedCompleteCompatibilityUpdateRuntime = /* @__PURE__ */ (() => ({
|
|
4528
4531
|
...keyedWindowEveryStructuralAppendMapUpdateRuntime,
|
|
4529
4532
|
prepend: reconcileCompilerKeyedArrayPrependWithStructural
|
|
4530
|
-
};
|
|
4531
|
-
var keyedCompleteStructuralPrependMapUpdateRuntime = {
|
|
4533
|
+
}))();
|
|
4534
|
+
var keyedCompleteStructuralPrependMapUpdateRuntime = /* @__PURE__ */ (() => ({
|
|
4532
4535
|
...keyedCompleteCompatibilityUpdateRuntime,
|
|
4533
4536
|
prepend: reconcileCompilerKeyedArrayPrependMapWithStructural
|
|
4534
|
-
};
|
|
4535
|
-
var keyedMappedRollingWindowUpdateRuntime = {
|
|
4537
|
+
}))();
|
|
4538
|
+
var keyedMappedRollingWindowUpdateRuntime = /* @__PURE__ */ (() => ({
|
|
4536
4539
|
...keyedCompleteStructuralPrependMapUpdateRuntime,
|
|
4537
4540
|
rollingWindow: reconcileCompilerKeyedArrayMappedRollingWindow
|
|
4538
|
-
};
|
|
4541
|
+
}))();
|
|
4539
4542
|
function reconcileCompilerKeyedMapUpdate(props, dirtyState, collectionToken, instances, conditionals) {
|
|
4540
4543
|
const dependency = props.collectionDependency;
|
|
4541
4544
|
if (dependency === void 0) return void 0;
|
|
@@ -8320,6 +8323,7 @@ function createCompiledComponentWithFeatures(definition, runtimeFeatures) {
|
|
|
8320
8323
|
this.trackedBindingsByDependency = [];
|
|
8321
8324
|
this.trackedDependenciesByBinding = /* @__PURE__ */ new Map();
|
|
8322
8325
|
this.bindingValues = /* @__PURE__ */ new Map();
|
|
8326
|
+
this.textNodes = /* @__PURE__ */ new Map();
|
|
8323
8327
|
this.activeBinding = null;
|
|
8324
8328
|
this.activeDependencies = null;
|
|
8325
8329
|
this.renderedDefinition = null;
|
|
@@ -8329,9 +8333,6 @@ function createCompiledComponentWithFeatures(definition, runtimeFeatures) {
|
|
|
8329
8333
|
this.blockRootElements = /* @__PURE__ */ new Set();
|
|
8330
8334
|
this.bindingTargets = /* @__PURE__ */ new Map();
|
|
8331
8335
|
this.bindingTargetRefs = /* @__PURE__ */ new Map();
|
|
8332
|
-
this.captureRoot = (root) => {
|
|
8333
|
-
this.root = root;
|
|
8334
|
-
};
|
|
8335
8336
|
this.refreshDefinition = () => {
|
|
8336
8337
|
if (this.mounted) this.forceUpdate();
|
|
8337
8338
|
};
|
|
@@ -8382,13 +8383,8 @@ function createCompiledComponentWithFeatures(definition, runtimeFeatures) {
|
|
|
8382
8383
|
}
|
|
8383
8384
|
this.blockRuntime = blockRuntime;
|
|
8384
8385
|
}
|
|
8385
|
-
usesHybridReactivity() {
|
|
8386
|
-
return definitionReference.current.reactivity === "hybrid";
|
|
8387
|
-
}
|
|
8388
8386
|
canReuseRenderedElement(currentDefinition, propValues) {
|
|
8389
|
-
return
|
|
8390
|
-
this.mounted && propValues && propValues.every(isCompilerPrimitive) && this.renderedDefinition === currentDefinition && this.renderedElement
|
|
8391
|
-
);
|
|
8387
|
+
return this.mounted && propValues !== null && propValues.every(isCompilerPrimitive) && this.renderedDefinition === currentDefinition;
|
|
8392
8388
|
}
|
|
8393
8389
|
renderCellsForProps(propValues) {
|
|
8394
8390
|
if (!propValues) return { cells: this.cells, commit: () => void 0 };
|
|
@@ -8410,7 +8406,7 @@ function createCompiledComponentWithFeatures(definition, runtimeFeatures) {
|
|
|
8410
8406
|
};
|
|
8411
8407
|
}
|
|
8412
8408
|
tracksBinding(binding) {
|
|
8413
|
-
return
|
|
8409
|
+
return definitionReference.current.reactivity === "hybrid" && binding.tracking === "dynamic";
|
|
8414
8410
|
}
|
|
8415
8411
|
ensureBindingIndex() {
|
|
8416
8412
|
const currentDefinition = definitionReference.current;
|
|
@@ -8472,7 +8468,7 @@ function createCompiledComponentWithFeatures(definition, runtimeFeatures) {
|
|
|
8472
8468
|
return binding.kind === "text" ? renderTextValue(value) : value;
|
|
8473
8469
|
}
|
|
8474
8470
|
primeHybridBindings() {
|
|
8475
|
-
if (
|
|
8471
|
+
if (definitionReference.current.reactivity !== "hybrid") return;
|
|
8476
8472
|
for (const binding of definitionReference.current.bindings) {
|
|
8477
8473
|
if (binding.kind === "block") continue;
|
|
8478
8474
|
if (!this.tracksBinding(binding)) continue;
|
|
@@ -8561,29 +8557,26 @@ function createCompiledComponentWithFeatures(definition, runtimeFeatures) {
|
|
|
8561
8557
|
for (const binding of this.staticBindingsByDependency[dependency] || []) {
|
|
8562
8558
|
affectedBindings.add(binding);
|
|
8563
8559
|
}
|
|
8564
|
-
if (
|
|
8560
|
+
if (definitionReference.current.reactivity === "hybrid") {
|
|
8565
8561
|
for (const binding of this.trackedBindingsByDependency[dependency] || []) {
|
|
8566
8562
|
affectedBindings.add(binding);
|
|
8567
8563
|
}
|
|
8568
8564
|
}
|
|
8569
8565
|
}
|
|
8570
|
-
const
|
|
8566
|
+
const blockRefreshes = [];
|
|
8567
|
+
for (const id of affectedBlockIds) {
|
|
8568
|
+
const binding = this.blockBindings.get(id);
|
|
8569
|
+
const refresh = this.blockRefreshListeners.get(id);
|
|
8570
|
+
if (!binding || !refresh) continue;
|
|
8571
8571
|
let parent = binding.parent;
|
|
8572
8572
|
while (parent !== void 0) {
|
|
8573
|
-
if (affectedBlockIds.has(parent) && this.blockRefreshListeners.has(parent))
|
|
8574
|
-
return true;
|
|
8575
|
-
}
|
|
8573
|
+
if (affectedBlockIds.has(parent) && this.blockRefreshListeners.has(parent)) break;
|
|
8576
8574
|
parent = this.blockBindings.get(parent)?.parent;
|
|
8577
8575
|
}
|
|
8578
|
-
|
|
8579
|
-
}
|
|
8580
|
-
const blockRefreshes = [...affectedBlockIds].map((id) => {
|
|
8581
|
-
const binding = this.blockBindings.get(id);
|
|
8582
|
-
const refresh = this.blockRefreshListeners.get(id);
|
|
8583
|
-
return binding && refresh && !hasAffectedMountedAncestor(binding) ? refresh : void 0;
|
|
8584
|
-
}).filter((refresh) => refresh !== void 0);
|
|
8576
|
+
if (parent === void 0) blockRefreshes.push(refresh);
|
|
8577
|
+
}
|
|
8585
8578
|
for (const binding of affectedBindings) {
|
|
8586
|
-
|
|
8579
|
+
this.applyBinding(binding);
|
|
8587
8580
|
}
|
|
8588
8581
|
let pendingBlockCommits = blockRefreshes.length;
|
|
8589
8582
|
for (const refresh of blockRefreshes) {
|
|
@@ -8609,7 +8602,12 @@ function createCompiledComponentWithFeatures(definition, runtimeFeatures) {
|
|
|
8609
8602
|
if (Object.is(this.bindingValues.get(binding), comparableValue)) return;
|
|
8610
8603
|
}
|
|
8611
8604
|
if (binding.kind === "text") {
|
|
8612
|
-
target
|
|
8605
|
+
if (!this.textNodes.has(target)) {
|
|
8606
|
+
this.textNodes.set(target, [...target.childNodes]);
|
|
8607
|
+
target.textContent = comparableValue;
|
|
8608
|
+
} else {
|
|
8609
|
+
updateTextContent(target, comparableValue);
|
|
8610
|
+
}
|
|
8613
8611
|
} else if (binding.kind === "style") {
|
|
8614
8612
|
updateStyle(target, binding.name, value);
|
|
8615
8613
|
} else {
|
|
@@ -8620,15 +8618,21 @@ function createCompiledComponentWithFeatures(definition, runtimeFeatures) {
|
|
|
8620
8618
|
componentDidMount() {
|
|
8621
8619
|
this.mounted = true;
|
|
8622
8620
|
refreshListeners.add(this.refreshDefinition);
|
|
8623
|
-
this.
|
|
8624
|
-
this.primeHybridBindings();
|
|
8621
|
+
this.componentDidUpdate();
|
|
8625
8622
|
}
|
|
8626
8623
|
getSnapshotBeforeUpdate() {
|
|
8627
8624
|
const currentDefinition = definitionReference.current;
|
|
8628
8625
|
const propValues = currentDefinition.readProps?.(this.props) || null;
|
|
8629
|
-
|
|
8626
|
+
if (this.canReuseRenderedElement(currentDefinition, propValues)) return true;
|
|
8627
|
+
this.textNodes.forEach((children, target) => {
|
|
8628
|
+
target.textContent = "";
|
|
8629
|
+
for (const child of children) target.appendChild(child);
|
|
8630
|
+
});
|
|
8631
|
+
this.textNodes.clear();
|
|
8632
|
+
this.bindingValues.clear();
|
|
8633
|
+
return false;
|
|
8630
8634
|
}
|
|
8631
|
-
componentDidUpdate(
|
|
8635
|
+
componentDidUpdate(previousProps, _previousState, reusedRenderedElement) {
|
|
8632
8636
|
const propValues = definitionReference.current.readProps?.(this.props) || null;
|
|
8633
8637
|
if (propValues) {
|
|
8634
8638
|
if (reusedRenderedElement) this.captureInputSelection();
|
|
@@ -8643,17 +8647,20 @@ function createCompiledComponentWithFeatures(definition, runtimeFeatures) {
|
|
|
8643
8647
|
cell.flush();
|
|
8644
8648
|
}
|
|
8645
8649
|
}
|
|
8646
|
-
this.flushBindingUpdates();
|
|
8647
|
-
return;
|
|
8648
8650
|
}
|
|
8649
|
-
|
|
8650
|
-
|
|
8651
|
-
|
|
8651
|
+
if (!reusedRenderedElement) {
|
|
8652
|
+
this.ensureBindingIndex();
|
|
8653
|
+
this.primeHybridBindings();
|
|
8654
|
+
}
|
|
8655
|
+
if (!propValues && previousProps) {
|
|
8656
|
+
for (const binding of definitionReference.current.bindings) {
|
|
8657
|
+
this.applyBinding(binding, true);
|
|
8658
|
+
}
|
|
8652
8659
|
}
|
|
8660
|
+
if (this.dirtyState.size) this.flushBindingUpdates();
|
|
8653
8661
|
}
|
|
8654
8662
|
componentWillUnmount() {
|
|
8655
8663
|
this.mounted = false;
|
|
8656
|
-
this.dirtyState.clear();
|
|
8657
8664
|
this.inputSelection = null;
|
|
8658
8665
|
this.blockRefreshListeners.clear();
|
|
8659
8666
|
this.bindingTargetRefs.clear();
|
|
@@ -8684,31 +8691,18 @@ function createCompiledComponentWithFeatures(definition, runtimeFeatures) {
|
|
|
8684
8691
|
}
|
|
8685
8692
|
let renderedElement;
|
|
8686
8693
|
const captureCommittedRoot = (root) => {
|
|
8687
|
-
this.
|
|
8688
|
-
if (
|
|
8689
|
-
|
|
8690
|
-
|
|
8691
|
-
|
|
8694
|
+
this.root = root;
|
|
8695
|
+
if (root) {
|
|
8696
|
+
renderCells.commit();
|
|
8697
|
+
this.renderedDefinition = currentDefinition;
|
|
8698
|
+
this.renderedElement = renderedElement;
|
|
8699
|
+
}
|
|
8692
8700
|
};
|
|
8693
|
-
if (element.type === this.blockRuntime.KeyedRanges) {
|
|
8694
|
-
renderedElement = React__default.default.cloneElement(
|
|
8695
|
-
element,
|
|
8696
|
-
{
|
|
8697
|
-
rootRef: captureCommittedRoot
|
|
8698
|
-
}
|
|
8699
|
-
);
|
|
8700
|
-
} else if (element.type === this.blockRuntime.ConditionalRanges) {
|
|
8701
|
+
if (element.type === this.blockRuntime.KeyedRanges || element.type === this.blockRuntime.ConditionalRanges || element.type === this.blockRuntime.MixedRanges) {
|
|
8701
8702
|
renderedElement = React__default.default.cloneElement(
|
|
8702
8703
|
element,
|
|
8703
8704
|
{ rootRef: captureCommittedRoot }
|
|
8704
8705
|
);
|
|
8705
|
-
} else if (element.type === this.blockRuntime.MixedRanges) {
|
|
8706
|
-
renderedElement = React__default.default.cloneElement(
|
|
8707
|
-
element,
|
|
8708
|
-
{
|
|
8709
|
-
rootRef: captureCommittedRoot
|
|
8710
|
-
}
|
|
8711
|
-
);
|
|
8712
8706
|
} else if (typeof element.type !== "string") {
|
|
8713
8707
|
throw new TypeError(
|
|
8714
8708
|
`Compiled component ${currentDefinition.displayName} must return one host element.`
|