x-block-lib 0.9.33 → 0.9.34
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 +93 -75
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1006,55 +1006,67 @@ function getOnEventInfo(e) {
|
|
|
1006
1006
|
}
|
|
1007
1007
|
}
|
|
1008
1008
|
} else if (w === "customSlotEvent") {
|
|
1009
|
-
if (isSlotNode(O.key) && y.type === "comp" && x.meta.slots) {
|
|
1010
|
-
let {
|
|
1011
|
-
if (
|
|
1012
|
-
let y =
|
|
1013
|
-
if (y)
|
|
1014
|
-
id
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1009
|
+
if (isSlotNode(O.key) && D.slot && y.type === "comp" && x.meta.slots) {
|
|
1010
|
+
let { compId: y, slotId: b, eventId: S } = unwrapEventKeyOfCustomSlot(E);
|
|
1011
|
+
if (x.id === y && D.slot === b) {
|
|
1012
|
+
let y = x.meta.slots.find((e) => e.id === b);
|
|
1013
|
+
if (y && y.events) {
|
|
1014
|
+
let b = y.events.find((e) => e.id === S);
|
|
1015
|
+
if (b) return {
|
|
1016
|
+
id: e,
|
|
1017
|
+
kind: w,
|
|
1018
|
+
names: [y.name, b.name],
|
|
1019
|
+
params: convertParams(b.params)
|
|
1020
|
+
};
|
|
1021
|
+
}
|
|
1019
1022
|
}
|
|
1020
1023
|
}
|
|
1021
1024
|
} else if (w === "customSlotPropertyChangeEvent") {
|
|
1022
|
-
if (isSlotNode(O.key) && y.type === "comp" && x.meta.slots) {
|
|
1023
|
-
let {
|
|
1024
|
-
if (
|
|
1025
|
-
let y =
|
|
1026
|
-
if (y)
|
|
1027
|
-
id
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1025
|
+
if (isSlotNode(O.key) && D.slot && y.type === "comp" && x.meta.slots) {
|
|
1026
|
+
let { compId: y, slotId: b, eventId: S } = unwrapEventKeyOfCustomSlot(E);
|
|
1027
|
+
if (x.id === y && D.slot === b) {
|
|
1028
|
+
let y = x.meta.slots.find((e) => e.id === b);
|
|
1029
|
+
if (y && y.properties) {
|
|
1030
|
+
let b = y.properties.find((e) => e.id === S);
|
|
1031
|
+
if (b) return {
|
|
1032
|
+
id: e,
|
|
1033
|
+
kind: w,
|
|
1034
|
+
names: [y.name, b.name],
|
|
1035
|
+
params: makeChangeParams(b.type)
|
|
1036
|
+
};
|
|
1037
|
+
}
|
|
1032
1038
|
}
|
|
1033
1039
|
}
|
|
1034
|
-
} else if (w === "
|
|
1035
|
-
if (isMultipleSlotNode(O.key) && y.type === "comp" && x.meta.slots) {
|
|
1036
|
-
let {
|
|
1037
|
-
if (
|
|
1038
|
-
let y =
|
|
1039
|
-
if (y)
|
|
1040
|
-
id
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1040
|
+
} else if (w === "multipleCustomSlotEvent") {
|
|
1041
|
+
if (isMultipleSlotNode(O.key) && D.slot && y.type === "comp" && x.meta.slots) {
|
|
1042
|
+
let { compId: y, slotId: b, eventId: S } = unwrapEventKeyOfCustomSlot(E);
|
|
1043
|
+
if (x.id === y && D.slot && b) {
|
|
1044
|
+
let y = x.meta.slots.find((e) => e.id === b);
|
|
1045
|
+
if (y && y.events) {
|
|
1046
|
+
let b = y.events.find((e) => e.id === S);
|
|
1047
|
+
if (b) return {
|
|
1048
|
+
id: e,
|
|
1049
|
+
kind: w,
|
|
1050
|
+
names: [y.name, b.name],
|
|
1051
|
+
params: convertParams(b.params)
|
|
1052
|
+
};
|
|
1053
|
+
}
|
|
1045
1054
|
}
|
|
1046
1055
|
}
|
|
1047
|
-
} else if (w === "
|
|
1048
|
-
if (isMultipleSlotNode(O.key) && y.type === "comp" && x.meta.slots) {
|
|
1049
|
-
let {
|
|
1050
|
-
if (
|
|
1051
|
-
let y =
|
|
1052
|
-
if (y)
|
|
1053
|
-
id
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1056
|
+
} else if (w === "multipleCustomSlotPropertyChangeEvent") {
|
|
1057
|
+
if (isMultipleSlotNode(O.key) && D.slot && y.type === "comp" && x.meta.slots) {
|
|
1058
|
+
let { compId: y, slotId: b, eventId: S } = unwrapEventKeyOfCustomSlot(E);
|
|
1059
|
+
if (x.id === y && D.slot === b) {
|
|
1060
|
+
let y = x.meta.slots.find((e) => e.id === b);
|
|
1061
|
+
if (y && y.properties) {
|
|
1062
|
+
let b = y.properties.find((e) => e.id === S);
|
|
1063
|
+
if (b) return {
|
|
1064
|
+
id: e,
|
|
1065
|
+
kind: w,
|
|
1066
|
+
names: [y.name, b.name],
|
|
1067
|
+
params: makeChangeParams(b.type)
|
|
1068
|
+
};
|
|
1069
|
+
}
|
|
1058
1070
|
}
|
|
1059
1071
|
}
|
|
1060
1072
|
} else if (w === "customEvent") {
|
|
@@ -1201,27 +1213,27 @@ function getAllTriggerEventInfos(e) {
|
|
|
1201
1213
|
if (!C) return console.assert(!1, "invalid element", S.key), x;
|
|
1202
1214
|
if (isSlotNode(C.key) && S.slot && y.type === "comp" && b.meta.slots) {
|
|
1203
1215
|
let y = b.meta.slots.find((e) => e.id === S.slot);
|
|
1204
|
-
if (y && y.events) for (let
|
|
1205
|
-
id: makeEventId("customSlotEvent", e, makeEventKeyOfCustomSlot(b.id, y.id, S)),
|
|
1216
|
+
if (y && y.events) for (let S of y.events) x.push({
|
|
1217
|
+
id: makeEventId("customSlotEvent", e, makeEventKeyOfCustomSlot(b.id, y.id, S.id)),
|
|
1206
1218
|
kind: "customSlotEvent",
|
|
1207
|
-
names: [
|
|
1208
|
-
params: convertParams(
|
|
1219
|
+
names: [y.name, S.name],
|
|
1220
|
+
params: convertParams(S.params)
|
|
1209
1221
|
});
|
|
1210
1222
|
}
|
|
1211
1223
|
if (isMultipleSlotNode(C.key) && S.slot && y.type === "comp" && b.meta.slots) {
|
|
1212
1224
|
let y = b.meta.slots.find((e) => e.id === S.slot);
|
|
1213
|
-
if (y && y.events) for (let
|
|
1214
|
-
id: makeEventId("multipleCustomSlotEvent", e, makeEventKeyOfCustomSlot(b.id, y.id, S)),
|
|
1225
|
+
if (y && y.events) for (let S of y.events) x.push({
|
|
1226
|
+
id: makeEventId("multipleCustomSlotEvent", e, makeEventKeyOfCustomSlot(b.id, y.id, S.id)),
|
|
1215
1227
|
kind: "multipleCustomSlotEvent",
|
|
1216
|
-
names: [
|
|
1217
|
-
params: convertParams(
|
|
1228
|
+
names: [y.name, S.name],
|
|
1229
|
+
params: convertParams(S.params)
|
|
1218
1230
|
});
|
|
1219
1231
|
}
|
|
1220
|
-
if (isGlobalityNode(C.key) && y.type === "comp" && b.meta.events) for (let
|
|
1221
|
-
id: makeEventId("customEvent", "globality", e),
|
|
1232
|
+
if (isGlobalityNode(C.key) && y.type === "comp" && b.meta.events) for (let e of b.meta.events) x.push({
|
|
1233
|
+
id: makeEventId("customEvent", "globality", e.id),
|
|
1222
1234
|
kind: "customEvent",
|
|
1223
|
-
names: [
|
|
1224
|
-
params: convertParams(
|
|
1235
|
+
names: [e.name],
|
|
1236
|
+
params: convertParams(e.params)
|
|
1225
1237
|
});
|
|
1226
1238
|
return x;
|
|
1227
1239
|
}
|
|
@@ -1235,29 +1247,35 @@ function getTriggerEventInfo(e) {
|
|
|
1235
1247
|
return;
|
|
1236
1248
|
}
|
|
1237
1249
|
if (x === "customSlotEvent") {
|
|
1238
|
-
if (isSlotNode(T.key) && y.type === "comp" && b.meta.slots) {
|
|
1239
|
-
let {
|
|
1240
|
-
if (
|
|
1241
|
-
let y =
|
|
1242
|
-
if (y)
|
|
1243
|
-
id
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1250
|
+
if (isSlotNode(T.key) && w.slot && y.type === "comp" && b.meta.slots) {
|
|
1251
|
+
let { compId: y, slotId: S, eventId: T } = unwrapEventKeyOfCustomSlot(C);
|
|
1252
|
+
if (b.id === y && w.slot === S) {
|
|
1253
|
+
let y = b.meta.slots.find((e) => e.id === S);
|
|
1254
|
+
if (y && y.events) {
|
|
1255
|
+
let b = y.events.find((e) => e.id === T);
|
|
1256
|
+
if (b) return {
|
|
1257
|
+
id: e,
|
|
1258
|
+
kind: x,
|
|
1259
|
+
names: [y.name, b.name],
|
|
1260
|
+
params: convertParams(b.params)
|
|
1261
|
+
};
|
|
1262
|
+
}
|
|
1248
1263
|
}
|
|
1249
1264
|
}
|
|
1250
|
-
} else if (x === "
|
|
1251
|
-
if (isMultipleSlotNode(T.key) && y.type === "comp" && b.meta.slots) {
|
|
1252
|
-
let {
|
|
1253
|
-
if (
|
|
1254
|
-
let y =
|
|
1255
|
-
if (y)
|
|
1256
|
-
id
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1265
|
+
} else if (x === "multipleCustomSlotEvent") {
|
|
1266
|
+
if (isMultipleSlotNode(T.key) && w.slot && y.type === "comp" && b.meta.slots) {
|
|
1267
|
+
let { compId: y, slotId: S, eventId: T } = unwrapEventKeyOfCustomSlot(C);
|
|
1268
|
+
if (b.id === y && w.slot && S) {
|
|
1269
|
+
let y = b.meta.slots.find((e) => e.id === S);
|
|
1270
|
+
if (y && y.events) {
|
|
1271
|
+
let b = y.events.find((e) => e.id === T);
|
|
1272
|
+
if (b) return {
|
|
1273
|
+
id: e,
|
|
1274
|
+
kind: x,
|
|
1275
|
+
names: [y.name, b.name],
|
|
1276
|
+
params: convertParams(b.params)
|
|
1277
|
+
};
|
|
1278
|
+
}
|
|
1261
1279
|
}
|
|
1262
1280
|
}
|
|
1263
1281
|
} else if (x === "customEvent" && isGlobalityNode(T.key) && y.type === "comp" && b.meta.events) {
|