x-block-lib 0.9.23 → 0.9.24
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.
|
@@ -24,7 +24,6 @@ interface AppBindEntryV1 extends AppBindEntryV1Type {
|
|
|
24
24
|
export type AppBindEntryBlockV1 = Blockly.BlockSvg & AppBindEntryV1;
|
|
25
25
|
declare const APP_BIND_ENTRY_V1: {
|
|
26
26
|
init: (this: AppBindEntryBlockV1) => void;
|
|
27
|
-
initData_: (this: AppBindEntryBlockV1) => void;
|
|
28
27
|
saveExtraState: (this: AppBindEntryBlockV1) => {
|
|
29
28
|
bindType: "" | BindType;
|
|
30
29
|
node: {
|
|
@@ -5,7 +5,7 @@ interface NodeInfo {
|
|
|
5
5
|
name: string;
|
|
6
6
|
alias: string;
|
|
7
7
|
}
|
|
8
|
-
type Filter = 'onEvent' | 'triggerEvent' | 'callMethod' | 'implementMethod' | 'getProperty' | 'setProperty';
|
|
8
|
+
type Filter = 'onEvent' | 'triggerEvent' | 'callMethod' | 'implementMethod' | 'implementMethodOutput' | 'getProperty' | 'setProperty';
|
|
9
9
|
export declare function isAvailOfNode(filter: Filter): boolean;
|
|
10
10
|
export declare function getAllNodeInfos(filter: Filter): NodeInfo[];
|
|
11
11
|
export declare function getNodeInfo(nodeid: string): NodeInfo | undefined;
|
package/dist/index.js
CHANGED
|
@@ -477,6 +477,26 @@ function isFiltedImplementMethod(e, y) {
|
|
|
477
477
|
}
|
|
478
478
|
return !(isGlobalityNode(e.key) && b.type === "comp" && x.meta.methods && x.meta.methods.length > 0);
|
|
479
479
|
}
|
|
480
|
+
function isFiltedImplementMethodOutput(e, y) {
|
|
481
|
+
let { activeObject: b, activeComp: x } = globalState.app;
|
|
482
|
+
if (isSlotNode(e.key) && y && b.type === "comp" && x.meta.slots) {
|
|
483
|
+
let e = x.meta.slots.find((e) => e.id === y);
|
|
484
|
+
if (e && e.methods) {
|
|
485
|
+
for (let { outputs: y } of e.methods) if (y && y.length > 0) return !1;
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
if (isMultipleSlotNode(e.key) && y && b.type === "comp" && x.meta.slots) {
|
|
489
|
+
let e = x.meta.slots.find((e) => e.id === y);
|
|
490
|
+
if (e && e.methods) {
|
|
491
|
+
for (let { outputs: y } of e.methods) if (y && y.length > 0) return !1;
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
if (isGlobalityNode(e.key) && b.type === "comp" && x.meta.methods) {
|
|
495
|
+
for (let { outputs: e } of x.meta.methods) if (e && e.length > 0) return !1;
|
|
496
|
+
return !1;
|
|
497
|
+
}
|
|
498
|
+
return !0;
|
|
499
|
+
}
|
|
480
500
|
function isFiltedGetProperty(e, y, b, x, S) {
|
|
481
501
|
let { activeObject: C, activeComp: w, depends: T } = globalState.app;
|
|
482
502
|
if (finalProperties[e.key] && finalProperties[e.key][y] && finalProperties[e.key][y].length > 0) return !1;
|
|
@@ -556,7 +576,7 @@ function isFiltedSetProperty(e, y, b, x, S) {
|
|
|
556
576
|
return !0;
|
|
557
577
|
}
|
|
558
578
|
function isFilted(e, y, b, x, S, C) {
|
|
559
|
-
return e ? e === "onEvent" ? isFiltedOnEvent(y, b, x, S, C) : e === "triggerEvent" ? isFiltedTriggerEvent(y, x) : e === "callMethod" ? isFiltedCallMethod(y, S, C) : e === "implementMethod" ? isFiltedImplementMethod(y, x) : e === "getProperty" ? isFiltedGetProperty(y, b, x, S, C) : e === "setProperty" ? isFiltedSetProperty(y, b, x, S, C) : !1 : !1;
|
|
579
|
+
return e ? e === "onEvent" ? isFiltedOnEvent(y, b, x, S, C) : e === "triggerEvent" ? isFiltedTriggerEvent(y, x) : e === "callMethod" ? isFiltedCallMethod(y, S, C) : e === "implementMethod" ? isFiltedImplementMethod(y, x) : e === "implementMethodOutput" ? isFiltedImplementMethodOutput(y, x) : e === "getProperty" ? isFiltedGetProperty(y, b, x, S, C) : e === "setProperty" ? isFiltedSetProperty(y, b, x, S, C) : !1 : !1;
|
|
560
580
|
}
|
|
561
581
|
function isAvailOfNode(e) {
|
|
562
582
|
let { activeObject: y } = globalState.app, b = getTag(y.type, y.subtype);
|
|
@@ -1504,22 +1524,22 @@ function getAllImplementMethodInfos(e) {
|
|
|
1504
1524
|
if (!C) return console.assert(!1, "inavlid element", S.key), x;
|
|
1505
1525
|
if (isSlotNode(C.key) && S.slot && y.type === "comp" && b.meta.slots) {
|
|
1506
1526
|
let y = b.meta.slots.find((e) => e.id === S.slot);
|
|
1507
|
-
if (y && y.methods) for (let
|
|
1508
|
-
id: makeMethodId("customSlotMethod", e, makeMethodKeyOfCustomSlot(b.id, y.id, S)),
|
|
1527
|
+
if (y && y.methods) for (let S of y.methods) x.push({
|
|
1528
|
+
id: makeMethodId("customSlotMethod", e, makeMethodKeyOfCustomSlot(b.id, y.id, S.id)),
|
|
1509
1529
|
kind: "customSlotMethod",
|
|
1510
|
-
names: [
|
|
1511
|
-
inputs: convertInputs(
|
|
1512
|
-
outputs: convertInputs(
|
|
1530
|
+
names: [y.name, S.name],
|
|
1531
|
+
inputs: convertInputs(S.inputs),
|
|
1532
|
+
outputs: convertInputs(S.outputs)
|
|
1513
1533
|
});
|
|
1514
1534
|
}
|
|
1515
1535
|
if (isMultipleSlotNode(C.key) && S.slot && y.type === "comp" && b.meta.slots) {
|
|
1516
1536
|
let y = b.meta.slots.find((e) => e.id === S.slot);
|
|
1517
|
-
if (y && y.methods) for (let
|
|
1518
|
-
id: makeMethodId("multipleCustomSlotMethod", e, makeMethodKeyOfCustomSlot(b.id, y.id, S)),
|
|
1537
|
+
if (y && y.methods) for (let S of y.methods) x.push({
|
|
1538
|
+
id: makeMethodId("multipleCustomSlotMethod", e, makeMethodKeyOfCustomSlot(b.id, y.id, S.id)),
|
|
1519
1539
|
kind: "multipleCustomSlotMethod",
|
|
1520
|
-
names: [
|
|
1521
|
-
inputs: convertInputs(
|
|
1522
|
-
outputs: convertOutputs(
|
|
1540
|
+
names: [y.name, S.name],
|
|
1541
|
+
inputs: convertInputs(S.inputs),
|
|
1542
|
+
outputs: convertOutputs(S.outputs)
|
|
1523
1543
|
});
|
|
1524
1544
|
}
|
|
1525
1545
|
if (isGlobalityNode(C.key) && y.type === "comp" && b.meta.methods) for (let { id: y, name: S, inputs: C, outputs: w } of b.meta.methods) x.push({
|
|
@@ -1541,31 +1561,37 @@ function getImplementMethodInfo(e) {
|
|
|
1541
1561
|
return;
|
|
1542
1562
|
}
|
|
1543
1563
|
if (x === "customSlotMethod") {
|
|
1544
|
-
if (isSlotNode(T.key) && y.type === "comp" && b.meta.slots) {
|
|
1545
|
-
let { slotId: y, methodId: S } = unwrapMethodKeyOfCustomSlot(C)
|
|
1546
|
-
if (
|
|
1547
|
-
let
|
|
1548
|
-
if (
|
|
1549
|
-
id
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1564
|
+
if (isSlotNode(T.key) && w.slot && y.type === "comp" && b.meta.slots) {
|
|
1565
|
+
let { slotId: y, methodId: S } = unwrapMethodKeyOfCustomSlot(C);
|
|
1566
|
+
if (y === w.slot) {
|
|
1567
|
+
let C = b.meta.slots.find((e) => e.id === y);
|
|
1568
|
+
if (C && C.methods) {
|
|
1569
|
+
let y = C.methods.find((e) => e.id === S);
|
|
1570
|
+
if (y) return {
|
|
1571
|
+
id: e,
|
|
1572
|
+
kind: x,
|
|
1573
|
+
names: [y.name],
|
|
1574
|
+
inputs: convertInputs(y.inputs),
|
|
1575
|
+
outputs: convertOutputs(y.outputs)
|
|
1576
|
+
};
|
|
1577
|
+
}
|
|
1555
1578
|
}
|
|
1556
1579
|
}
|
|
1557
1580
|
} else if (x === "multipleSlotMethod") {
|
|
1558
|
-
if (isMultipleSlotNode(T.key) && y.type === "comp" && b.meta.slots) {
|
|
1559
|
-
let { slotId: y, methodId: S } = unwrapMethodKeyOfCustomSlot(C)
|
|
1560
|
-
if (w
|
|
1561
|
-
let
|
|
1562
|
-
if (
|
|
1563
|
-
id
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1581
|
+
if (isMultipleSlotNode(T.key) && w.slot && y.type === "comp" && b.meta.slots) {
|
|
1582
|
+
let { slotId: y, methodId: S } = unwrapMethodKeyOfCustomSlot(C);
|
|
1583
|
+
if (w.slot === y) {
|
|
1584
|
+
let C = b.meta.slots.find((e) => e.id === y);
|
|
1585
|
+
if (C && C.methods) {
|
|
1586
|
+
let y = C.methods.find((e) => e.id === S);
|
|
1587
|
+
if (y) return {
|
|
1588
|
+
id: e,
|
|
1589
|
+
kind: x,
|
|
1590
|
+
names: [y.name],
|
|
1591
|
+
inputs: convertInputs(y.inputs),
|
|
1592
|
+
outputs: convertOutputs(y.outputs)
|
|
1593
|
+
};
|
|
1594
|
+
}
|
|
1569
1595
|
}
|
|
1570
1596
|
}
|
|
1571
1597
|
} else if (x === "customMethod" && isGlobalityNode(T.key) && y.type === "comp" && b.meta.methods) {
|
|
@@ -1655,20 +1681,20 @@ function getAllPropertyInfos(e, y) {
|
|
|
1655
1681
|
}
|
|
1656
1682
|
if (isSlotNode(E.key) && T.slot && b.type === "comp" && x.meta.slots) {
|
|
1657
1683
|
let y = x.meta.slots.find((e) => e.id === T.slot);
|
|
1658
|
-
if (y && y.properties) for (let
|
|
1659
|
-
id: makePropertyId("customSlotProperty", e, b),
|
|
1684
|
+
if (y && y.properties) for (let b of y.properties) C.push({
|
|
1685
|
+
id: makePropertyId("customSlotProperty", e, makePropertyKeyOfCustomSlot("placeholder", y.id, b.id)),
|
|
1660
1686
|
kind: "customSlotProperty",
|
|
1661
|
-
names: [
|
|
1662
|
-
meta: { raw: { type:
|
|
1687
|
+
names: [y.name, b.name],
|
|
1688
|
+
meta: { raw: { type: b.type } }
|
|
1663
1689
|
});
|
|
1664
1690
|
}
|
|
1665
1691
|
if (isMultipleSlotNode(E.key) && T.slot && b.type === "comp" && x.meta.slots) {
|
|
1666
1692
|
let y = x.meta.slots.find((e) => e.id === T.slot);
|
|
1667
|
-
if (y && y.properties) for (let
|
|
1668
|
-
id: makePropertyId("multipleCustomSlotProperty", e, b),
|
|
1693
|
+
if (y && y.properties) for (let b of y.properties) C.push({
|
|
1694
|
+
id: makePropertyId("multipleCustomSlotProperty", e, makePropertyKeyOfCustomSlot("placeholder", y.id, b.id)),
|
|
1669
1695
|
kind: "multipleCustomSlotProperty",
|
|
1670
|
-
names: [
|
|
1671
|
-
meta: { raw: { type:
|
|
1696
|
+
names: [y.name, b.name],
|
|
1697
|
+
meta: { raw: { type: b.type } }
|
|
1672
1698
|
});
|
|
1673
1699
|
}
|
|
1674
1700
|
if (isGlobalityNode(E.key) && b.type === "comp" && x.meta.properties) for (let { id: y, name: b, type: S } of x.meta.properties) C.push({
|
|
@@ -1763,28 +1789,34 @@ function getPropertyInfo(e) {
|
|
|
1763
1789
|
}
|
|
1764
1790
|
} else if (C === "customSlotProperty") {
|
|
1765
1791
|
if (isSlotNode(D.key) && E.slot && y.type === "comp" && b.meta.slots) {
|
|
1766
|
-
let y
|
|
1767
|
-
if (
|
|
1768
|
-
let
|
|
1769
|
-
if (
|
|
1770
|
-
id
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1792
|
+
let { slotId: y, propertyId: x } = unwrapPropertyKeyOfCustomSlot(T);
|
|
1793
|
+
if (E.slot === y) {
|
|
1794
|
+
let S = b.meta.slots.find((e) => e.id === y);
|
|
1795
|
+
if (S && S.properties) {
|
|
1796
|
+
let y = S.properties.find((e) => e.id === x);
|
|
1797
|
+
if (y) return {
|
|
1798
|
+
id: e,
|
|
1799
|
+
kind: C,
|
|
1800
|
+
names: [S.name, y.name],
|
|
1801
|
+
meta: { raw: { type: y.type } }
|
|
1802
|
+
};
|
|
1803
|
+
}
|
|
1775
1804
|
}
|
|
1776
1805
|
}
|
|
1777
|
-
} else if (C === "
|
|
1806
|
+
} else if (C === "multipleCustomSlotProperty") {
|
|
1778
1807
|
if (isMultipleSlotNode(D.key) && E.slot && y.type === "comp" && b.meta.slots) {
|
|
1779
|
-
let y
|
|
1780
|
-
if (
|
|
1781
|
-
let
|
|
1782
|
-
if (
|
|
1783
|
-
id
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1808
|
+
let { slotId: y, propertyId: x } = unwrapPropertyKeyOfCustomSlot(T);
|
|
1809
|
+
if (E.slot === y) {
|
|
1810
|
+
let S = b.meta.slots.find((e) => e.id === y);
|
|
1811
|
+
if (S && S.properties) {
|
|
1812
|
+
let y = S.properties.find((e) => e.id === x);
|
|
1813
|
+
if (y) return {
|
|
1814
|
+
id: e,
|
|
1815
|
+
kind: C,
|
|
1816
|
+
names: [S.name, y.name],
|
|
1817
|
+
meta: { raw: { type: y.type } }
|
|
1818
|
+
};
|
|
1819
|
+
}
|
|
1788
1820
|
}
|
|
1789
1821
|
}
|
|
1790
1822
|
} else if (C === "customProperty") {
|
|
@@ -2025,7 +2057,7 @@ Blocks.app_bind_container_v1 = { init: function() {
|
|
|
2025
2057
|
return "";
|
|
2026
2058
|
}, Blocks.app_bind_entry_v1 = {
|
|
2027
2059
|
init: function() {
|
|
2028
|
-
this.node = {
|
|
2060
|
+
this.bindType = "", this.node = {
|
|
2029
2061
|
id: "",
|
|
2030
2062
|
key: "",
|
|
2031
2063
|
alias: ""
|
|
@@ -2037,15 +2069,7 @@ Blocks.app_bind_container_v1 = { init: function() {
|
|
|
2037
2069
|
id: "",
|
|
2038
2070
|
name: "",
|
|
2039
2071
|
type: "string"
|
|
2040
|
-
}, this.appendDummyInput().appendField(new FieldDropdown(() => this.genBindTypeOpts_()), "BIND_TYPE").appendField(new FieldDropdown(() => this.genNodeOpts_()), "NODE").appendField(new FieldDropdown(() => this.genPropertyOpts_()), "PROPERTY").appendField(new FieldDropdown(() => this.genStateOpts_()), "STATE"), this.setOutput(!0, "BindEntry")
|
|
2041
|
-
},
|
|
2042
|
-
initData_: function() {
|
|
2043
|
-
if (!this.bindType) return;
|
|
2044
|
-
let e = getAllBindTypes()?.[0];
|
|
2045
|
-
if (!e) return;
|
|
2046
|
-
this.bindType = e;
|
|
2047
|
-
let y = this.getField("BIND_TYPE");
|
|
2048
|
-
y.getOptions(!1), y.setValue(this.bindType), this.onBindTypeChange_(y.getValue());
|
|
2072
|
+
}, this.appendDummyInput().appendField(new FieldDropdown(() => this.genBindTypeOpts_()), "BIND_TYPE").appendField(new FieldDropdown(() => this.genNodeOpts_()), "NODE").appendField(new FieldDropdown(() => this.genPropertyOpts_()), "PROPERTY").appendField(new FieldDropdown(() => this.genStateOpts_()), "STATE"), this.setOutput(!0, "BindEntry");
|
|
2049
2073
|
},
|
|
2050
2074
|
saveExtraState: function() {
|
|
2051
2075
|
return {
|
|
@@ -2056,8 +2080,8 @@ Blocks.app_bind_container_v1 = { init: function() {
|
|
|
2056
2080
|
};
|
|
2057
2081
|
},
|
|
2058
2082
|
loadExtraState: function(e) {
|
|
2059
|
-
this.bindType = e.bindType ?? "", this.node.id = e.node?.id ?? "", this.node.key = e.node?.key ?? "", this.node.alias = e.node?.alias ?? "", this.property.id = e.property?.id ?? "", this.property.kind = e.property?.kind ?? "", this.property.names = e.property?.names ?? [], this.state.id = e.state?.id ?? "", this.state.name = e.state?.name ?? "", this.state.type = e.state?.type ?? "string", setTimeout(() => {
|
|
2060
|
-
this.
|
|
2083
|
+
this.bindType = e.bindType ?? "", this.node.id = e.node?.id ?? "", this.node.key = e.node?.key ?? "", this.node.alias = e.node?.alias ?? "", this.property.id = e.property?.id ?? "", this.property.kind = e.property?.kind ?? "", this.property.names = e.property?.names ?? [], this.state.id = e.state?.id ?? "", this.state.name = e.state?.name ?? "", this.state.type = e.state?.type ?? "string", this.updateShape_(), setTimeout(() => {
|
|
2084
|
+
this.checkWarning_();
|
|
2061
2085
|
}, 0);
|
|
2062
2086
|
},
|
|
2063
2087
|
genBindTypeOpts_: function() {
|
|
@@ -2120,9 +2144,7 @@ Blocks.app_bind_container_v1 = { init: function() {
|
|
|
2120
2144
|
console.assert(!1);
|
|
2121
2145
|
return;
|
|
2122
2146
|
}
|
|
2123
|
-
this.property.id = y.id, this.property.kind = y.kind, this.property.names = y.names,
|
|
2124
|
-
this.updateShape_();
|
|
2125
|
-
}, 0);
|
|
2147
|
+
this.property.id = y.id, this.property.kind = y.kind, this.property.names = y.names, this.updateShape_();
|
|
2126
2148
|
},
|
|
2127
2149
|
onStateChange_: function(e) {
|
|
2128
2150
|
let y = getStateInfo(e);
|
|
@@ -2130,13 +2152,13 @@ Blocks.app_bind_container_v1 = { init: function() {
|
|
|
2130
2152
|
console.assert(!1);
|
|
2131
2153
|
return;
|
|
2132
2154
|
}
|
|
2133
|
-
this.state.id = y.id, this.state.name = y.name, this.state.type = y.type,
|
|
2134
|
-
this.updateShape_();
|
|
2135
|
-
}, 0);
|
|
2155
|
+
this.state.id = y.id, this.state.name = y.name, this.state.type = y.type, this.updateShape_();
|
|
2136
2156
|
},
|
|
2137
2157
|
updateShape_: function() {
|
|
2138
2158
|
let e = this.getFieldValue("BIND_TYPE");
|
|
2139
|
-
e === "property" ? (this.setStyle("property_blocks"), this.getField("NODE").setVisible(!0), this.getField("PROPERTY").setVisible(!0), this.getField("STATE").setVisible(!1)) : e === "state" && (this.setStyle("state_blocks"), this.getField("NODE").setVisible(!1), this.getField("PROPERTY").setVisible(!1), this.getField("STATE").setVisible(!0)),
|
|
2159
|
+
e === "property" ? (this.setStyle("property_blocks"), this.getField("NODE").setVisible(!0), this.getField("PROPERTY").setVisible(!0), this.getField("STATE").setVisible(!1)) : e === "state" && (this.setStyle("state_blocks"), this.getField("NODE").setVisible(!1), this.getField("PROPERTY").setVisible(!1), this.getField("STATE").setVisible(!0)), setTimeout(() => {
|
|
2160
|
+
this.render();
|
|
2161
|
+
}, 0);
|
|
2140
2162
|
},
|
|
2141
2163
|
checkWarning_: function() {
|
|
2142
2164
|
if (this.bindType === "property") {
|
|
@@ -2318,17 +2340,16 @@ Blocks.app_bind_container_v1 = { init: function() {
|
|
|
2318
2340
|
this.setWarningText(null);
|
|
2319
2341
|
}
|
|
2320
2342
|
}, javascriptGenerator.forBlock.on_app_event_v1 = function(e) {
|
|
2321
|
-
let y = javascriptGenerator.quote_, b = e, x = "
|
|
2322
|
-
if (b.event.params) for (let
|
|
2343
|
+
let y = javascriptGenerator.quote_, b = e, x = "";
|
|
2344
|
+
if (b.event.params) for (let e = 0; e < b.event.params.length; e++) {
|
|
2345
|
+
let y = b.event.params[e];
|
|
2346
|
+
x += `const __param$${y.key}__ = __params__[${e}];\n`;
|
|
2347
|
+
}
|
|
2323
2348
|
let S = javascriptGenerator.statementToCode(b, "HANDLE");
|
|
2324
|
-
return `__onEventV1__(${y(b.event.id)}, async (
|
|
2349
|
+
return `__onEventV1__(${y(b.event.id)}, async (__params__, __instance__) => {
|
|
2325
2350
|
try {
|
|
2326
|
-
${addIndent(S, 2)} } catch (e) {
|
|
2327
|
-
|
|
2328
|
-
__messageV1__('error', e.message);
|
|
2329
|
-
} else {
|
|
2330
|
-
__messageV1__('error', e);
|
|
2331
|
-
}
|
|
2351
|
+
${addIndent(x, 4)}${addIndent(S, 2)} } catch (e) {
|
|
2352
|
+
__messageV1__('error', e);
|
|
2332
2353
|
}
|
|
2333
2354
|
});
|
|
2334
2355
|
`;
|
|
@@ -2472,14 +2493,14 @@ ${addIndent(S, 2)} } catch (e) {
|
|
|
2472
2493
|
this.setWarningText(null);
|
|
2473
2494
|
}
|
|
2474
2495
|
}, javascriptGenerator.forBlock.trigger_app_event_v1 = function(e) {
|
|
2475
|
-
let y = javascriptGenerator.quote_, b = e, x = "
|
|
2476
|
-
b.getInput("INSTANCE") && (x = javascriptGenerator.valueToCode(b, "INSTANCE", Order.NONE) || "''");
|
|
2477
|
-
let S = "";
|
|
2496
|
+
let y = javascriptGenerator.quote_, b = e, x = "[";
|
|
2478
2497
|
if (b.event.params) for (let e = 0; e < b.event.params.length; e++) {
|
|
2479
2498
|
let y = javascriptGenerator.valueToCode(b, "PARAM" + e, Order.NONE);
|
|
2480
|
-
|
|
2499
|
+
e !== 0 && (x += ", "), x += y;
|
|
2481
2500
|
}
|
|
2482
|
-
|
|
2501
|
+
x += "]";
|
|
2502
|
+
let S = "''";
|
|
2503
|
+
return b.getInput("INSTANCE") && (S = javascriptGenerator.valueToCode(b, "INSTANCE", Order.NONE) || "''"), `await __triggerEventV1__(${y(b.event.id)}, ${x}, ${S});\n`;
|
|
2483
2504
|
}, defineBlocksWithJsonArray([{
|
|
2484
2505
|
type: "watch_effect_v1",
|
|
2485
2506
|
message0: "%{BKY_APP_V1_WATCH_EFFECT_TITLE}",
|
|
@@ -8670,7 +8691,7 @@ function makeAppBindBlocks(e) {
|
|
|
8670
8691
|
for (let b of e) {
|
|
8671
8692
|
if (b.type !== "app_bind_entry_v1") continue;
|
|
8672
8693
|
let e = b;
|
|
8673
|
-
e.bindType === "property" ? addUnique(y, makeTriggerId("propertyTrigger", e.property.id)) : e.bindType === "state"
|
|
8694
|
+
e.bindType === "property" ? addUnique(y, makeTriggerId("propertyTrigger", e.property.id)) : e.bindType === "state" && addUnique(y, makeTriggerId("stateTrigger", e.state.id));
|
|
8674
8695
|
}
|
|
8675
8696
|
return y;
|
|
8676
8697
|
}
|
|
@@ -9104,32 +9125,16 @@ function createShadowOfLogicBooleanV1(e, y) {
|
|
|
9104
9125
|
let C = xmlUtils$2.createTextNode(y ? "TRUE" : "FALSE");
|
|
9105
9126
|
return S.appendChild(C), x.appendChild(S), b.appendChild(x), b;
|
|
9106
9127
|
}
|
|
9107
|
-
function triggerEventAvail() {
|
|
9108
|
-
let { activeObject: e, activeComp: y } = globalState.app;
|
|
9109
|
-
return !(e.type !== "comp" || !y.meta.events || y.meta.events.length <= 0);
|
|
9110
|
-
}
|
|
9111
9128
|
function stateAvail$1() {
|
|
9112
9129
|
let { activeObject: e, activeComp: y } = globalState.app;
|
|
9113
9130
|
return !(e.type !== "comp" || !y.meta.states || y.meta.states.length <= 0);
|
|
9114
9131
|
}
|
|
9115
|
-
function ImplMethodAvail() {
|
|
9116
|
-
let { activeObject: e, activeComp: y } = globalState.app;
|
|
9117
|
-
return !(e.type !== "comp" || !y.meta.methods || y.meta.methods.length <= 0);
|
|
9118
|
-
}
|
|
9119
|
-
function methodOutputAvail() {
|
|
9120
|
-
let { activeObject: e, activeComp: y } = globalState.app;
|
|
9121
|
-
if (e.type !== "comp") return !1;
|
|
9122
|
-
if (y.meta.methods) {
|
|
9123
|
-
for (let { outputs: e } of y.meta.methods) if (e && e.length > 0) return !0;
|
|
9124
|
-
}
|
|
9125
|
-
return !1;
|
|
9126
|
-
}
|
|
9127
9132
|
function callback$11() {
|
|
9128
9133
|
let e = [];
|
|
9129
|
-
return e.push(createLabel(localeMsg("LABEL_EVENT"))), isAvailOfNode("onEvent") && e.push(createBlock$1("on_app_event_v1")),
|
|
9134
|
+
return e.push(createLabel(localeMsg("LABEL_EVENT"))), isAvailOfNode("onEvent") && e.push(createBlock$1("on_app_event_v1")), isAvailOfNode("triggerEvent") && e.push(createBlock$1("trigger_app_event_v1")), e.push(createBlock$1("app_bind_v1", [createMutation([{
|
|
9130
9135
|
key: "items",
|
|
9131
9136
|
value: "2"
|
|
9132
|
-
}])])), e.push(createBlock$1("watch_effect_v1")), (isAvailOfNode("getProperty") || isAvailOfNode("setProperty")) && e.push(createLabel(localeMsg("LABEL_PROPERTY"))), isAvailOfNode("getProperty") && e.push(createBlock$1("get_app_property_v1")), isAvailOfNode("setProperty") && e.push(createBlock$1("set_app_property_v1")), stateAvail$1() && (e.push(createLabel(localeMsg("LABEL_STATE"))), e.push(createBlock$1("get_app_state_v1")), e.push(createBlock$1("set_app_state_v1"))), (isAvailOfNode("callMethod") ||
|
|
9137
|
+
}])])), e.push(createBlock$1("watch_effect_v1")), (isAvailOfNode("getProperty") || isAvailOfNode("setProperty")) && e.push(createLabel(localeMsg("LABEL_PROPERTY"))), isAvailOfNode("getProperty") && e.push(createBlock$1("get_app_property_v1")), isAvailOfNode("setProperty") && e.push(createBlock$1("set_app_property_v1")), stateAvail$1() && (e.push(createLabel(localeMsg("LABEL_STATE"))), e.push(createBlock$1("get_app_state_v1")), e.push(createBlock$1("set_app_state_v1"))), (isAvailOfNode("callMethod") || isAvailOfNode("implementMethod")) && e.push(createLabel(localeMsg("LABEL_METHOD"))), isAvailOfNode("callMethod") && e.push(createBlock$1("call_app_method_v1")), isAvailOfNode("implementMethod") && (e.push(createBlock$1("implement_app_method_v1")), isAvailOfNode("implementMethodOutput") && e.push(createBlock$1("set_app_method_output_v1")), e.push(createBlock$1("procedure_return_v1"))), e;
|
|
9133
9138
|
}
|
|
9134
9139
|
const appCompCategoryV1 = {
|
|
9135
9140
|
name: "APP_COMP_CATEGORY",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "x-block-lib",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.9.
|
|
4
|
+
"version": "0.9.24",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
43
|
"x-essential-lib": "^0.9.24",
|
|
44
|
-
"x-runtime-lib": "^0.8.
|
|
44
|
+
"x-runtime-lib": "^0.8.200",
|
|
45
45
|
"x-state-lib": "^0.3.38"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|