@next-core/brick-kit 2.127.2 → 2.127.3
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/CHANGELOG.md +11 -0
- package/dist/index.bundle.js +73 -30
- package/dist/index.bundle.js.map +1 -1
- package/dist/index.esm.js +73 -30
- package/dist/index.esm.js.map +1 -1
- package/dist/types/core/Kernel.d.ts.map +1 -1
- package/dist/types/internal/devtools.d.ts +3 -0
- package/dist/types/internal/devtools.d.ts.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [2.127.3](https://github.com/easyops-cn/next-core/compare/@next-core/brick-kit@2.127.2...@next-core/brick-kit@2.127.3) (2022-08-17)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **devtools:** emit messages only if applicable ([e0b1edc](https://github.com/easyops-cn/next-core/commit/e0b1edc2182472591728ddc0f874cd8b5c8565fc))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
## [2.127.2](https://github.com/easyops-cn/next-core/compare/@next-core/brick-kit@2.127.1...@next-core/brick-kit@2.127.2) (2022-08-11)
|
|
7
18
|
|
|
8
19
|
|
package/dist/index.bundle.js
CHANGED
|
@@ -1133,12 +1133,17 @@
|
|
|
1133
1133
|
var MESSAGE_SOURCE_PANEL = "brick-next-devtools-panel";
|
|
1134
1134
|
var EVALUATION_EDIT = "devtools-evaluation-edit";
|
|
1135
1135
|
var TRANSFORMATION_EDIT = "devtools-transformation-edit";
|
|
1136
|
-
|
|
1136
|
+
var FRAME_ACTIVE_CHANGE = "devtools-frame-active-change";
|
|
1137
|
+
var PANEL_CHANGE = "devtools-panel-change";
|
|
1138
|
+
var frameIsActive = true;
|
|
1139
|
+
var selectedPanel;
|
|
1137
1140
|
/* istanbul ignore next */
|
|
1141
|
+
|
|
1138
1142
|
function devtoolsHookEmit(type, payload) {
|
|
1139
1143
|
var devtools = getDevHook();
|
|
1140
1144
|
|
|
1141
|
-
if (!devtools) {
|
|
1145
|
+
if (!devtools || !(type === "evaluation" ? frameIsActive && (!selectedPanel || selectedPanel === "Evaluations") : type === "transformation" ? frameIsActive && (!selectedPanel || selectedPanel === "Transformations") : true)) {
|
|
1146
|
+
// Ignore messages if current devtools panel is not relevant.
|
|
1142
1147
|
return;
|
|
1143
1148
|
}
|
|
1144
1149
|
|
|
@@ -1158,41 +1163,78 @@
|
|
|
1158
1163
|
setTimeout(emit, 0);
|
|
1159
1164
|
}
|
|
1160
1165
|
}
|
|
1166
|
+
function listenDevtoolsEagerly() {
|
|
1167
|
+
window.addEventListener("message", _ref => {
|
|
1168
|
+
var {
|
|
1169
|
+
data
|
|
1170
|
+
} = _ref;
|
|
1171
|
+
|
|
1172
|
+
if ((data === null || data === void 0 ? void 0 : data.source) !== MESSAGE_SOURCE_PANEL) {
|
|
1173
|
+
return;
|
|
1174
|
+
}
|
|
1175
|
+
|
|
1176
|
+
var payload = data.payload;
|
|
1177
|
+
|
|
1178
|
+
switch (payload === null || payload === void 0 ? void 0 : payload.type) {
|
|
1179
|
+
case FRAME_ACTIVE_CHANGE:
|
|
1180
|
+
{
|
|
1181
|
+
frameIsActive = payload.active;
|
|
1182
|
+
break;
|
|
1183
|
+
}
|
|
1184
|
+
|
|
1185
|
+
case PANEL_CHANGE:
|
|
1186
|
+
{
|
|
1187
|
+
selectedPanel = payload.panel;
|
|
1188
|
+
break;
|
|
1189
|
+
}
|
|
1190
|
+
}
|
|
1191
|
+
});
|
|
1192
|
+
}
|
|
1161
1193
|
function listenDevtools() {
|
|
1162
|
-
window.addEventListener("message",
|
|
1163
|
-
var
|
|
1194
|
+
window.addEventListener("message", _ref2 => {
|
|
1195
|
+
var {
|
|
1196
|
+
data
|
|
1197
|
+
} = _ref2;
|
|
1164
1198
|
|
|
1165
|
-
if ((
|
|
1199
|
+
if ((data === null || data === void 0 ? void 0 : data.source) !== MESSAGE_SOURCE_PANEL) {
|
|
1166
1200
|
return;
|
|
1167
1201
|
}
|
|
1168
1202
|
|
|
1169
|
-
var payload =
|
|
1203
|
+
var payload = data.payload;
|
|
1170
1204
|
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1205
|
+
switch (payload === null || payload === void 0 ? void 0 : payload.type) {
|
|
1206
|
+
case EVALUATION_EDIT:
|
|
1207
|
+
{
|
|
1208
|
+
var {
|
|
1209
|
+
raw,
|
|
1210
|
+
context,
|
|
1211
|
+
id
|
|
1212
|
+
} = payload;
|
|
1213
|
+
evaluate(raw, {
|
|
1214
|
+
data: context.data,
|
|
1215
|
+
event: restoreDehydrated(context.event)
|
|
1216
|
+
}, {
|
|
1217
|
+
isReEvaluation: true,
|
|
1218
|
+
evaluationId: id
|
|
1219
|
+
});
|
|
1220
|
+
break;
|
|
1221
|
+
}
|
|
1222
|
+
|
|
1223
|
+
case TRANSFORMATION_EDIT:
|
|
1224
|
+
{
|
|
1225
|
+
var {
|
|
1226
|
+
data: _data,
|
|
1227
|
+
transform,
|
|
1228
|
+
id: _id,
|
|
1229
|
+
options: {
|
|
1230
|
+
from,
|
|
1231
|
+
mapArray,
|
|
1232
|
+
allowInject
|
|
1233
|
+
}
|
|
1234
|
+
} = payload;
|
|
1235
|
+
reTransformForDevtools(_id, _data, transform, from, mapArray, allowInject);
|
|
1236
|
+
break;
|
|
1193
1237
|
}
|
|
1194
|
-
} = payload;
|
|
1195
|
-
reTransformForDevtools(_id, data, transform, from, mapArray, allowInject);
|
|
1196
1238
|
}
|
|
1197
1239
|
});
|
|
1198
1240
|
}
|
|
@@ -8791,6 +8833,7 @@
|
|
|
8791
8833
|
return _asyncToGenerator__default["default"](function* () {
|
|
8792
8834
|
var _this2$bootstrapData$, _this2$bootstrapData$2;
|
|
8793
8835
|
|
|
8836
|
+
listenDevtoolsEagerly();
|
|
8794
8837
|
_this2.mountPoints = mountPoints;
|
|
8795
8838
|
yield Promise.all([_this2.loadCheckLogin(), _this2.loadMicroApps()]);
|
|
8796
8839
|
|