x-block-lib 0.9.29 → 0.9.30

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.
Files changed (2) hide show
  1. package/dist/index.js +141 -116
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -496,7 +496,6 @@ function isFiltedImplementMethodOutput(e, y) {
496
496
  }
497
497
  if (isGlobalityNode(e.key) && b.type === "comp" && x.meta.methods) {
498
498
  for (let { outputs: e } of x.meta.methods) if (e && e.length > 0) return !1;
499
- return !1;
500
499
  }
501
500
  return !0;
502
501
  }
@@ -1071,81 +1070,95 @@ function getOnEventInfo(e) {
1071
1070
  };
1072
1071
  }
1073
1072
  } else if (w === "elementAdaptSlotEvent") {
1074
- if (isGlobalityNode(O.key) && y.type === "comp") {
1075
- let { elementKey: y, slotKey: b, eventKey: x } = unwrapEventKeyOfElementSlot(E), S = getElement(y);
1076
- if (S && S.slots) {
1077
- let y = S.slots.find((e) => e.key === b);
1078
- if (y && y.events) {
1079
- let b = y.events.find((e) => e.key === x);
1080
- if (b) return {
1081
- id: e,
1082
- kind: w,
1083
- names: [
1084
- S.name,
1085
- y.name,
1086
- b.name
1087
- ],
1088
- params: b.params
1089
- };
1073
+ if (isGlobalityNode(O.key) && y.type === "comp" && D.adaptSlot) {
1074
+ let { elementKey: y, slotKey: b, eventKey: x } = unwrapEventKeyOfElementSlot(E), { kind: S, mainKey: C, slotKey: w } = unwrapSlotId(D.adaptSlot);
1075
+ if ((S === "elementSlot" || S === "multipleElementSlot") && y === C && b === w) {
1076
+ let C = getElement(y);
1077
+ if (C && C.slots) {
1078
+ let y = C.slots.find((e) => e.key === b);
1079
+ if (y && y.events) {
1080
+ let b = y.events.find((e) => e.key === x);
1081
+ if (b) return {
1082
+ id: e,
1083
+ kind: S,
1084
+ names: [
1085
+ C.name,
1086
+ y.name,
1087
+ b.name
1088
+ ],
1089
+ params: b.params
1090
+ };
1091
+ }
1090
1092
  }
1091
1093
  }
1092
1094
  }
1093
1095
  } else if (w === "elementAdaptSlotPropertyChangeEvent") {
1094
- if (isGlobalityNode(O.key) && y.type === "comp") {
1095
- let { elementKey: y, slotKey: b, propertyKey: x } = unwrapPropertyKeyOfElementSlot(E), S = getElement(y);
1096
- if (S && S.slots) {
1097
- let y = S.slots.find((e) => e.key === b);
1098
- if (y && y.properties) {
1099
- let b = y.properties.find((e) => e.key === x);
1100
- if (b) return {
1101
- id: e,
1102
- kind: w,
1103
- names: [
1104
- S.name,
1105
- y.name,
1106
- b.name
1107
- ],
1108
- params: makeChangeParams(b.type)
1109
- };
1096
+ if (isGlobalityNode(O.key) && y.type === "comp" && D.adaptSlot) {
1097
+ let { elementKey: y, slotKey: b, propertyKey: x } = unwrapPropertyKeyOfElementSlot(E), { kind: S, mainKey: C, slotKey: w } = unwrapSlotId(D.adaptSlot);
1098
+ if ((S === "elementSlot" || S === "multipleElementSlot") && y === C && b === w) {
1099
+ let C = getElement(y);
1100
+ if (C && C.slots) {
1101
+ let y = C.slots.find((e) => e.key === b);
1102
+ if (y && y.properties) {
1103
+ let b = y.properties.find((e) => e.key === x);
1104
+ if (b) return {
1105
+ id: e,
1106
+ kind: S,
1107
+ names: [
1108
+ C.name,
1109
+ y.name,
1110
+ b.name
1111
+ ],
1112
+ params: makeChangeParams(b.type)
1113
+ };
1114
+ }
1110
1115
  }
1111
1116
  }
1112
1117
  }
1113
1118
  } else if (w === "customAdaptSlotEvent") {
1114
- if (isGlobalityNode(O.key) && y.type === "comp") {
1115
- let { compId: y, slotId: b, eventId: x } = unwrapEventKeyOfCustomSlot(E), C = S[y];
1116
- if (C && C.meta.slots) {
1117
- let y = C.meta.slots.find((e) => e.id === b);
1118
- if (y && y.events) {
1119
- let b = y.events.find((e) => e.id === x);
1120
- if (b) return {
1121
- id: e,
1122
- kind: w,
1123
- names: [
1124
- C.name,
1125
- y.name,
1126
- b.name
1127
- ],
1128
- params: convertParams(b.params)
1129
- };
1119
+ if (isGlobalityNode(O.key) && y.type === "comp" && D.adaptSlot) {
1120
+ let { compId: y, slotId: b, eventId: x } = unwrapEventKeyOfCustomSlot(E), { kind: C, mainKey: w, slotKey: T } = unwrapSlotId(D.adaptSlot);
1121
+ if ((C === "customSlot" || C === "multipleCustomSlot") && y === w && b === T) {
1122
+ let w = S[y];
1123
+ if (w && w.meta.slots) {
1124
+ let y = w.meta.slots.find((e) => e.id === b);
1125
+ if (y && y.events) {
1126
+ let b = y.events.find((e) => e.id === x);
1127
+ if (b) return {
1128
+ id: e,
1129
+ kind: C,
1130
+ names: [
1131
+ w.name,
1132
+ y.name,
1133
+ b.name
1134
+ ],
1135
+ params: convertParams(b.params)
1136
+ };
1137
+ }
1130
1138
  }
1131
1139
  }
1132
1140
  }
1133
1141
  } else if (w === "customAdaptSlotPropertyChangeEvent") {
1134
- let { compId: y, slotId: b, propertyId: x } = unwrapPropertyKeyOfCustomSlot(E), C = S[y];
1135
- if (C && C.meta.slots) {
1136
- let y = C.meta.slots.find((e) => e.id === b);
1137
- if (y && y.properties) {
1138
- let b = y.properties.find((e) => e.id === x);
1139
- if (b) return {
1140
- id: e,
1141
- kind: w,
1142
- names: [
1143
- C.name,
1144
- y.name,
1145
- b.name
1146
- ],
1147
- params: makeChangeParams(b.type)
1148
- };
1142
+ if (isGlobalityNode(O.key) && y.type === "comp" && D.adaptSlot) {
1143
+ let { compId: y, slotId: b, propertyId: x } = unwrapPropertyKeyOfCustomSlot(E), { kind: C, mainKey: w, slotKey: T } = unwrapSlotId(D.adaptSlot);
1144
+ if ((C === "customSlot" || C === "multipleCustomSlot") && y === w && b === T) {
1145
+ let w = S[y];
1146
+ if (w && w.meta.slots) {
1147
+ let y = w.meta.slots.find((e) => e.id === b);
1148
+ if (y && y.properties) {
1149
+ let b = y.properties.find((e) => e.id === x);
1150
+ if (b) return {
1151
+ id: e,
1152
+ kind: C,
1153
+ names: [
1154
+ w.name,
1155
+ y.name,
1156
+ b.name
1157
+ ],
1158
+ params: makeChangeParams(b.type)
1159
+ };
1160
+ }
1161
+ }
1149
1162
  }
1150
1163
  }
1151
1164
  } else if (w === "stateChangeEvent" && isGlobalityNode(O.key)) {
@@ -1449,45 +1462,51 @@ function getCallMethodInfo(e) {
1449
1462
  }
1450
1463
  }
1451
1464
  } else if (S === "elementAdaptSlotMethod") {
1452
- if (isGlobalityNode(E.key) && y.type === "comp") {
1453
- let { elementKey: y, slotKey: b, methodKey: x } = unwrapMethodKeyOfElementSlot(w), C = getElement(y);
1454
- if (C && C.slots) {
1455
- let y = C.slots.find((e) => e.key === b);
1465
+ if (isGlobalityNode(E.key) && y.type === "comp" && T.adaptSlot) {
1466
+ let { elementKey: y, slotKey: b, methodKey: x } = unwrapMethodKeyOfElementSlot(w), { kind: S, mainKey: C, slotKey: E } = unwrapSlotId(T.adaptSlot);
1467
+ if ((S === "elementSlot" || S === "multipleElementSlot") && y === C && b === E) {
1468
+ let C = getElement(y);
1469
+ if (C && C.slots) {
1470
+ let y = C.slots.find((e) => e.key === b);
1471
+ if (y && y.methods) {
1472
+ let b = y.methods.find((e) => e.key === x);
1473
+ if (b) return {
1474
+ id: e,
1475
+ kind: S,
1476
+ names: [
1477
+ C.name,
1478
+ y.name,
1479
+ b.name
1480
+ ],
1481
+ inputs: b.inputs,
1482
+ outputs: b.outputs
1483
+ };
1484
+ }
1485
+ }
1486
+ }
1487
+ }
1488
+ } else if (S === "customAdaptSlotMethod" && isGlobalityNode(E.key) && y.type === "comp" && T.adaptSlot) {
1489
+ let { compId: y, slotId: b, methodId: S } = unwrapMethodKeyOfCustomSlot(w), { kind: C, mainKey: E, slotKey: D } = unwrapSlotId(T.adaptSlot);
1490
+ if ((C === "customSlot" || C === "multipleCustomSlot") && y === E && b === D) {
1491
+ let w = x[y];
1492
+ if (w && w.meta.slots) {
1493
+ let y = w.meta.slots.find((e) => e.id === b);
1456
1494
  if (y && y.methods) {
1457
- let b = y.methods.find((e) => e.key === x);
1495
+ let b = y.methods.find((e) => e.id === S);
1458
1496
  if (b) return {
1459
1497
  id: e,
1460
- kind: S,
1498
+ kind: C,
1461
1499
  names: [
1462
- C.name,
1500
+ w.name,
1463
1501
  y.name,
1464
1502
  b.name
1465
1503
  ],
1466
- inputs: b.inputs,
1467
- outputs: b.outputs
1504
+ inputs: convertInputs(b.inputs),
1505
+ outputs: convertOutputs(b.outputs)
1468
1506
  };
1469
1507
  }
1470
1508
  }
1471
1509
  }
1472
- } else if (S === "customAdaptSlotMethod" && isGlobalityNode(E.key) && y.type === "comp") {
1473
- let { compId: y, slotId: b, methodId: C } = unwrapMethodKeyOfCustomSlot(w), T = x[y];
1474
- if (T && T.meta.slots) {
1475
- let y = T.meta.slots.find((e) => e.id === b);
1476
- if (y && y.methods) {
1477
- let b = y.methods.find((e) => e.id === C);
1478
- if (b) return {
1479
- id: e,
1480
- kind: S,
1481
- names: [
1482
- T.name,
1483
- y.name,
1484
- b.name
1485
- ],
1486
- inputs: convertInputs(b.inputs),
1487
- outputs: convertOutputs(b.outputs)
1488
- };
1489
- }
1490
- }
1491
1510
  }
1492
1511
  }
1493
1512
  function genCallMethodOpts(e) {
@@ -1834,17 +1853,41 @@ function getPropertyInfo(e) {
1834
1853
  };
1835
1854
  }
1836
1855
  } else if (C === "elementAdaptSlotProperty") {
1837
- if (isGlobalityNode(D.key) && y.type === "comp") {
1838
- let { elementKey: y, slotKey: b, propertyKey: x } = unwrapPropertyKeyOfElementSlot(T), S = getElement(y);
1839
- if (S && S.slots) {
1840
- let y = S.slots.find((e) => e.key === b);
1856
+ if (isGlobalityNode(D.key) && y.type === "comp" && E.adaptSlot) {
1857
+ let { elementKey: y, slotKey: b, propertyKey: x } = unwrapPropertyKeyOfElementSlot(T), { kind: S, mainKey: C, slotKey: w } = unwrapSlotId(E.adaptSlot);
1858
+ if ((S === "elementSlot" || S === "multipleElementSlot") && y === C && b === w) {
1859
+ let C = getElement(y);
1860
+ if (C && C.slots) {
1861
+ let y = C.slots.find((e) => e.key === b);
1862
+ if (y && y.properties) {
1863
+ let b = y.properties.find((e) => e.key === x);
1864
+ if (b) return {
1865
+ id: e,
1866
+ kind: S,
1867
+ names: [
1868
+ C.name,
1869
+ y.name,
1870
+ b.name
1871
+ ],
1872
+ meta: { raw: { type: b.type } }
1873
+ };
1874
+ }
1875
+ }
1876
+ }
1877
+ }
1878
+ } else if (C === "customAdaptSlotProperty" && isGlobalityNode(D.key) && y.type === "comp" && E.adaptSlot) {
1879
+ let { compId: y, slotId: b, propertyId: S } = unwrapPropertyKeyOfCustomSlot(T), { kind: C, mainKey: w, slotKey: D } = unwrapSlotId(E.adaptSlot);
1880
+ if ((C === "customSlot" || C === "multipleCustomSlot") && y === w && b === D) {
1881
+ let w = x[y];
1882
+ if (w && w.meta.slots) {
1883
+ let y = w.meta.slots.find((e) => e.id === b);
1841
1884
  if (y && y.properties) {
1842
- let b = y.properties.find((e) => e.key === x);
1885
+ let b = y.properties.find((e) => e.id === S);
1843
1886
  if (b) return {
1844
1887
  id: e,
1845
1888
  kind: C,
1846
1889
  names: [
1847
- S.name,
1890
+ w.name,
1848
1891
  y.name,
1849
1892
  b.name
1850
1893
  ],
@@ -1853,24 +1896,6 @@ function getPropertyInfo(e) {
1853
1896
  }
1854
1897
  }
1855
1898
  }
1856
- } else if (C === "customAdaptSlotProperty" && isGlobalityNode(D.key) && y.type === "comp") {
1857
- let { compId: y, slotId: b, propertyId: S } = unwrapPropertyKeyOfCustomSlot(T), w = x[y];
1858
- if (w && w.meta.slots) {
1859
- let y = w.meta.slots.find((e) => e.id === b);
1860
- if (y && y.properties) {
1861
- let b = y.properties.find((e) => e.id === S);
1862
- if (b) return {
1863
- id: e,
1864
- kind: C,
1865
- names: [
1866
- w.name,
1867
- y.name,
1868
- b.name
1869
- ],
1870
- meta: { raw: { type: b.type } }
1871
- };
1872
- }
1873
- }
1874
1899
  }
1875
1900
  }
1876
1901
  function genPropertyOpts(e, y) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "x-block-lib",
3
3
  "private": false,
4
- "version": "0.9.29",
4
+ "version": "0.9.30",
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.203",
44
+ "x-runtime-lib": "^0.8.204",
45
45
  "x-state-lib": "^0.3.38"
46
46
  },
47
47
  "devDependencies": {