@next-core/brick-kit 2.127.1 → 2.128.0
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 +33 -0
- package/dist/index.bundle.js +88 -35
- package/dist/index.bundle.js.map +1 -1
- package/dist/index.esm.js +88 -35
- 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,39 @@
|
|
|
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.128.0](https://github.com/easyops-cn/next-core/compare/@next-core/brick-kit@2.127.3...@next-core/brick-kit@2.128.0) (2022-08-18)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **brick-kit:** support location.host and location.hostname ([0548c9f](https://github.com/easyops-cn/next-core/commit/0548c9fab28e58e4194bfedea44c92a39f0c27e2))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## [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)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* **devtools:** emit messages only if applicable ([e0b1edc](https://github.com/easyops-cn/next-core/commit/e0b1edc2182472591728ddc0f874cd8b5c8565fc))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
## [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)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
### Bug Fixes
|
|
32
|
+
|
|
33
|
+
* ignore emitting if devtools is not presented ([9833e81](https://github.com/easyops-cn/next-core/commit/9833e81051f95e140ccd86940a7e6de5a7e526ca))
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
6
39
|
## [2.127.1](https://github.com/easyops-cn/next-core/compare/@next-core/brick-kit@2.127.0...@next-core/brick-kit@2.127.1) (2022-08-10)
|
|
7
40
|
|
|
8
41
|
**Note:** Version bump only for package @next-core/brick-kit
|
package/dist/index.bundle.js
CHANGED
|
@@ -1133,13 +1133,24 @@
|
|
|
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) {
|
|
1143
|
+
var devtools = getDevHook();
|
|
1144
|
+
|
|
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.
|
|
1147
|
+
return;
|
|
1148
|
+
}
|
|
1149
|
+
|
|
1139
1150
|
var emit = () => {
|
|
1140
|
-
var
|
|
1151
|
+
var _devtools$emit;
|
|
1141
1152
|
|
|
1142
|
-
(
|
|
1153
|
+
(_devtools$emit = devtools.emit) === null || _devtools$emit === void 0 ? void 0 : _devtools$emit.call(devtools, {
|
|
1143
1154
|
type,
|
|
1144
1155
|
payload
|
|
1145
1156
|
});
|
|
@@ -1152,41 +1163,78 @@
|
|
|
1152
1163
|
setTimeout(emit, 0);
|
|
1153
1164
|
}
|
|
1154
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
|
+
}
|
|
1155
1193
|
function listenDevtools() {
|
|
1156
|
-
window.addEventListener("message",
|
|
1157
|
-
var
|
|
1194
|
+
window.addEventListener("message", _ref2 => {
|
|
1195
|
+
var {
|
|
1196
|
+
data
|
|
1197
|
+
} = _ref2;
|
|
1158
1198
|
|
|
1159
|
-
if ((
|
|
1199
|
+
if ((data === null || data === void 0 ? void 0 : data.source) !== MESSAGE_SOURCE_PANEL) {
|
|
1160
1200
|
return;
|
|
1161
1201
|
}
|
|
1162
1202
|
|
|
1163
|
-
var payload =
|
|
1203
|
+
var payload = data.payload;
|
|
1164
1204
|
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
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;
|
|
1187
1237
|
}
|
|
1188
|
-
} = payload;
|
|
1189
|
-
reTransformForDevtools(_id, data, transform, from, mapArray, allowInject);
|
|
1190
1238
|
}
|
|
1191
1239
|
});
|
|
1192
1240
|
}
|
|
@@ -1195,9 +1243,9 @@
|
|
|
1195
1243
|
}
|
|
1196
1244
|
|
|
1197
1245
|
function restoreDehydrated(value) {
|
|
1198
|
-
var _getDevHook$restoreDe,
|
|
1246
|
+
var _getDevHook$restoreDe, _getDevHook;
|
|
1199
1247
|
|
|
1200
|
-
return (_getDevHook$restoreDe = (
|
|
1248
|
+
return (_getDevHook$restoreDe = (_getDevHook = getDevHook()) === null || _getDevHook === void 0 ? void 0 : _getDevHook.restoreDehydrated(value)) !== null && _getDevHook$restoreDe !== void 0 ? _getDevHook$restoreDe : value;
|
|
1201
1249
|
}
|
|
1202
1250
|
|
|
1203
1251
|
function getItemFactory(storageType) {
|
|
@@ -1587,10 +1635,14 @@
|
|
|
1587
1635
|
case "location":
|
|
1588
1636
|
return collectCoverage ? {
|
|
1589
1637
|
href: "http://localhost:3000/functions/test",
|
|
1590
|
-
origin: "http://localhost:3000"
|
|
1638
|
+
origin: "http://localhost:3000",
|
|
1639
|
+
host: "localhost:3000",
|
|
1640
|
+
hostname: "localhost"
|
|
1591
1641
|
} : {
|
|
1592
1642
|
href: location.href,
|
|
1593
|
-
origin: location.origin
|
|
1643
|
+
origin: location.origin,
|
|
1644
|
+
host: location.host,
|
|
1645
|
+
hostname: location.hostname
|
|
1594
1646
|
};
|
|
1595
1647
|
}
|
|
1596
1648
|
}
|
|
@@ -8785,6 +8837,7 @@
|
|
|
8785
8837
|
return _asyncToGenerator__default["default"](function* () {
|
|
8786
8838
|
var _this2$bootstrapData$, _this2$bootstrapData$2;
|
|
8787
8839
|
|
|
8840
|
+
listenDevtoolsEagerly();
|
|
8788
8841
|
_this2.mountPoints = mountPoints;
|
|
8789
8842
|
yield Promise.all([_this2.loadCheckLogin(), _this2.loadMicroApps()]);
|
|
8790
8843
|
|