x-block-lib 0.9.21 → 0.9.22
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/index.js +4 -13
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -8649,14 +8649,14 @@ function setTheme(e) {
|
|
|
8649
8649
|
break;
|
|
8650
8650
|
}
|
|
8651
8651
|
}
|
|
8652
|
-
var reactivityTypes = ["get_app_property_v1", "get_app_state_v1"];
|
|
8653
8652
|
function addUnique(e, y) {
|
|
8654
8653
|
e.find((e) => e === y) || e.push(y);
|
|
8655
8654
|
}
|
|
8655
|
+
var watchEffectTypes = ["get_app_property_v1", "get_app_state_v1"];
|
|
8656
8656
|
function gatherWatchEffectBlocks(e) {
|
|
8657
8657
|
let y = [];
|
|
8658
8658
|
function b(e) {
|
|
8659
|
-
for (let x of e.getChildren(!0))
|
|
8659
|
+
for (let x of e.getChildren(!0)) watchEffectTypes.includes(x.type) && y.push(x), b(x);
|
|
8660
8660
|
}
|
|
8661
8661
|
return b(e), y;
|
|
8662
8662
|
}
|
|
@@ -8665,21 +8665,12 @@ function makeWatchEffectBlocks(e) {
|
|
|
8665
8665
|
for (let b of e) b.type === "get_app_property_v1" ? addUnique(y, makeTriggerId("propertyTrigger", b.property.id)) : b.type === "get_app_state_v1" ? addUnique(y, makeTriggerId("stateTrigger", b.state.id)) : console.assert(!1);
|
|
8666
8666
|
return y;
|
|
8667
8667
|
}
|
|
8668
|
-
function gatherAppBindBlocks(e) {
|
|
8669
|
-
let y = [];
|
|
8670
|
-
for (let b of e.getChildren(!0)) if (reactivityTypes.includes(b.type)) y.push(b);
|
|
8671
|
-
else if (b.type === "object_get_v1") {
|
|
8672
|
-
let e = b.getInputTargetBlock("OBJECT");
|
|
8673
|
-
e && reactivityTypes.includes(e.type) && y.push(b);
|
|
8674
|
-
}
|
|
8675
|
-
return y;
|
|
8676
|
-
}
|
|
8677
8668
|
function makeAppBindBlocks(e) {
|
|
8678
8669
|
let y = [];
|
|
8679
8670
|
for (let b of e) {
|
|
8680
8671
|
if (b.type !== "app_bind_entry_v1") continue;
|
|
8681
8672
|
let e = b;
|
|
8682
|
-
e.bindType === "property" ? addUnique(y, e.property.id) : e.bindType === "state" ? addUnique(y, e.state.id) : console.assert(!1);
|
|
8673
|
+
e.bindType === "property" ? addUnique(y, makeTriggerId("propertyTrigger", e.property.id)) : e.bindType === "state" ? addUnique(y, makeTriggerId("stateTrigger", e.state.id)) : console.assert(!1);
|
|
8683
8674
|
}
|
|
8684
8675
|
return y;
|
|
8685
8676
|
}
|
|
@@ -8696,7 +8687,7 @@ function buildReactivity(e) {
|
|
|
8696
8687
|
let b = makeWatchEffectBlocks(gatherWatchEffectBlocks(e));
|
|
8697
8688
|
for (let x of b) y.watchEffect[x] || (y.watchEffect[x] = []), addUnique(y.watchEffect[x], e.id);
|
|
8698
8689
|
} else if (e.type === "app_bind_v1") {
|
|
8699
|
-
let b = makeAppBindBlocks(
|
|
8690
|
+
let b = makeAppBindBlocks(e.getChildren(!0));
|
|
8700
8691
|
y.bind.sets[e.id] = b;
|
|
8701
8692
|
for (let x of b) y.bind.triggers[x] || (y.bind.triggers[x] = []), addUnique(y.bind.triggers[x], e.id);
|
|
8702
8693
|
}
|