@next-core/brick-kit 2.117.14 → 2.118.1
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 +34 -0
- package/dist/index.bundle.js +45 -7
- package/dist/index.bundle.js.map +1 -1
- package/dist/index.esm.js +45 -7
- package/dist/index.esm.js.map +1 -1
- package/dist/types/BrickWrapper.d.ts +1 -2
- package/dist/types/BrickWrapper.d.ts.map +1 -1
- package/dist/types/core/Kernel.d.ts +4 -0
- package/dist/types/core/Kernel.d.ts.map +1 -1
- package/dist/types/core/Router.d.ts.map +1 -1
- package/dist/types/core/Runtime.d.ts +1 -0
- package/dist/types/core/Runtime.d.ts.map +1 -1
- package/dist/types/core/StoryboardFunctionRegistryFactory.d.ts.map +1 -1
- package/dist/types/developHelper.d.ts +2 -1
- package/dist/types/developHelper.d.ts.map +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,40 @@
|
|
|
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.118.1](https://github.com/easyops-cn/next-core/compare/@next-core/brick-kit@2.118.0...@next-core/brick-kit@2.118.1) (2022-04-25)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* fix types of BrickWrapper ([5063cf3](https://github.com/easyops-cn/next-core/commit/5063cf347d2b943897b3e4311302300304b26bb5))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
# [2.118.0](https://github.com/easyops-cn/next-core/compare/@next-core/brick-kit@2.117.15...@next-core/brick-kit@2.118.0) (2022-04-24)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Features
|
|
21
|
+
|
|
22
|
+
* support snippet preview ([fa92790](https://github.com/easyops-cn/next-core/commit/fa92790bd9d2f2ebf0bc930a70844e887da006fc))
|
|
23
|
+
* update snippetData type ([07be28c](https://github.com/easyops-cn/next-core/commit/07be28ced614ce35c17aae806a85e0f5231ffcb4))
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
## [2.117.15](https://github.com/easyops-cn/next-core/compare/@next-core/brick-kit@2.117.14...@next-core/brick-kit@2.117.15) (2022-04-22)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
### Bug Fixes
|
|
33
|
+
|
|
34
|
+
* mock _.uniqueId in storyboard functions ([f6d5eb2](https://github.com/easyops-cn/next-core/commit/f6d5eb2a6e00d7c5bd32e60a238b67c14641b840))
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
6
40
|
## [2.117.14](https://github.com/easyops-cn/next-core/compare/@next-core/brick-kit@2.117.13...@next-core/brick-kit@2.117.14) (2022-04-21)
|
|
7
41
|
|
|
8
42
|
**Note:** Version bump only for package @next-core/brick-kit
|
package/dist/index.bundle.js
CHANGED
|
@@ -582,7 +582,7 @@
|
|
|
582
582
|
};
|
|
583
583
|
}();
|
|
584
584
|
|
|
585
|
-
function supply(attemptToVisitGlobals, providedGlobalVariables) {
|
|
585
|
+
function supply(attemptToVisitGlobals, providedGlobalVariables, mock) {
|
|
586
586
|
var globalVariables = _objectSpread__default["default"]({}, providedGlobalVariables); // Allow limited browser builtin values.
|
|
587
587
|
|
|
588
588
|
|
|
@@ -590,7 +590,7 @@
|
|
|
590
590
|
|
|
591
591
|
for (var variableName of attemptToVisitGlobals) {
|
|
592
592
|
if (!Object.prototype.hasOwnProperty.call(globalVariables, variableName)) {
|
|
593
|
-
var variable = supplyIndividual(variableName);
|
|
593
|
+
var variable = supplyIndividual(variableName, mock);
|
|
594
594
|
|
|
595
595
|
if (variable !== undefined) {
|
|
596
596
|
globalVariables[variableName] = variable;
|
|
@@ -618,14 +618,14 @@
|
|
|
618
618
|
var shouldOmitInMoment = new Set(["lang", "langData", "locale", "localeData", "defineLocale", "updateLocale", "updateOffset"]);
|
|
619
619
|
var allowedGlobalObjects = new Set(["Array", "Boolean", "Date", "Infinity", "JSON", "Math", "NaN", "Number", "String", "decodeURI", "decodeURIComponent", "encodeURI", "encodeURIComponent", "isFinite", "isNaN", "parseFloat", "parseInt", "Map", "Set", "URLSearchParams", "WeakMap", "WeakSet", "atob", "btoa"]);
|
|
620
620
|
|
|
621
|
-
function supplyIndividual(variableName) {
|
|
621
|
+
function supplyIndividual(variableName, mock) {
|
|
622
622
|
switch (variableName) {
|
|
623
623
|
case "Object":
|
|
624
624
|
// Do not allow mutable methods like `Object.assign`.
|
|
625
625
|
return delegateMethods(Object, ["entries", "fromEntries", "keys", "values"]);
|
|
626
626
|
|
|
627
627
|
case "_":
|
|
628
|
-
return Object.fromEntries(Object.entries(lodash__default["default"]).filter(entry => !shouldOmitInLodash.has(entry[0])));
|
|
628
|
+
return Object.fromEntries(Object.entries(lodash__default["default"]).filter(entry => !shouldOmitInLodash.has(entry[0])).concat(mock ? [["uniqueId", prefix => "".concat(prefix !== null && prefix !== void 0 ? prefix : "", "42")]] : []));
|
|
629
629
|
|
|
630
630
|
case "moment":
|
|
631
631
|
return Object.assign(function () {
|
|
@@ -1687,7 +1687,7 @@
|
|
|
1687
1687
|
app: currentApp,
|
|
1688
1688
|
storyboardFunctions,
|
|
1689
1689
|
isStoryboardFunction: true
|
|
1690
|
-
})),
|
|
1690
|
+
}), !!collectCoverage),
|
|
1691
1691
|
hooks: collector && {
|
|
1692
1692
|
beforeEvaluate: collector.beforeEvaluate,
|
|
1693
1693
|
beforeCall: collector.beforeCall,
|
|
@@ -3179,6 +3179,11 @@
|
|
|
3179
3179
|
function _dev_only_updateTemplatePreviewSettings(appId, templateId, settings) {
|
|
3180
3180
|
kernel._dev_only_updateTemplatePreviewSettings(appId, templateId, settings);
|
|
3181
3181
|
}
|
|
3182
|
+
/* istanbul ignore next */
|
|
3183
|
+
|
|
3184
|
+
function _dev_only_updateSnippetPreviewSettings(appId, snippetData) {
|
|
3185
|
+
kernel._dev_only_updateSnippetPreviewSettings(appId, snippetData);
|
|
3186
|
+
}
|
|
3182
3187
|
class Runtime {
|
|
3183
3188
|
constructor() {
|
|
3184
3189
|
_defineProperty__default["default"](this, "registerBrickTemplate", registerBrickTemplate);
|
|
@@ -8091,6 +8096,30 @@
|
|
|
8091
8096
|
}
|
|
8092
8097
|
}
|
|
8093
8098
|
|
|
8099
|
+
_dev_only_updateSnippetPreviewSettings(appId, snippetData) {
|
|
8100
|
+
var _snippetData$bricks;
|
|
8101
|
+
|
|
8102
|
+
var {
|
|
8103
|
+
routes
|
|
8104
|
+
} = this.bootstrapData.storyboards.find(item => item.app.id === appId);
|
|
8105
|
+
var previewPath = "${APP.homepage}/_dev_only_/snippet-preview/".concat(snippetData.snippetId);
|
|
8106
|
+
var previewRouteIndex = routes.findIndex(route => route.path === previewPath);
|
|
8107
|
+
var newPreviewRoute = {
|
|
8108
|
+
path: previewPath,
|
|
8109
|
+
bricks: ((_snippetData$bricks = snippetData.bricks) === null || _snippetData$bricks === void 0 ? void 0 : _snippetData$bricks.length) > 0 ? snippetData.bricks : [{
|
|
8110
|
+
brick: "span"
|
|
8111
|
+
}],
|
|
8112
|
+
menu: false,
|
|
8113
|
+
exact: true
|
|
8114
|
+
};
|
|
8115
|
+
|
|
8116
|
+
if (previewRouteIndex === -1) {
|
|
8117
|
+
routes.unshift(newPreviewRoute);
|
|
8118
|
+
} else {
|
|
8119
|
+
routes.splice(previewRouteIndex, 1, newPreviewRoute);
|
|
8120
|
+
}
|
|
8121
|
+
}
|
|
8122
|
+
|
|
8094
8123
|
loadDepsOfStoryboard(storyboard) {
|
|
8095
8124
|
return this.gracefullyLoadDeps(this._loadDepsOfStoryboard, storyboard);
|
|
8096
8125
|
}
|
|
@@ -10223,13 +10252,21 @@
|
|
|
10223
10252
|
|
|
10224
10253
|
try {
|
|
10225
10254
|
var specificTemplatePreviewIndex = lodash.findLastIndex(storyboard.routes, route => route.path.startsWith("${APP.homepage}/_dev_only_/template-preview/"));
|
|
10226
|
-
var
|
|
10255
|
+
var specificSnippetPreviewIndex = lodash.findLastIndex(storyboard.routes, route => route.path.startsWith("${APP.homepage}/_dev_only_/snippet-preview/"));
|
|
10256
|
+
var mergedRoutes = [...storyboard.routes.slice(0, specificTemplatePreviewIndex + 1), ...storyboard.routes.slice(0, specificSnippetPreviewIndex + 1), {
|
|
10227
10257
|
path: "${APP.homepage}/_dev_only_/template-preview/:templateId",
|
|
10228
10258
|
bricks: [{
|
|
10229
10259
|
brick: "span"
|
|
10230
10260
|
}],
|
|
10231
10261
|
menu: false,
|
|
10232
10262
|
exact: true
|
|
10263
|
+
}, {
|
|
10264
|
+
path: "${APP.homepage}/_dev_only_/snippet-preview/:snippetId",
|
|
10265
|
+
bricks: [{
|
|
10266
|
+
brick: "span"
|
|
10267
|
+
}],
|
|
10268
|
+
menu: false,
|
|
10269
|
+
exact: true
|
|
10233
10270
|
}, ...storyboard.routes.slice(specificTemplatePreviewIndex + 1)];
|
|
10234
10271
|
yield locationContext.mountRoutes(mergedRoutes, undefined, mountRoutesResult);
|
|
10235
10272
|
} catch (error) {
|
|
@@ -13147,7 +13184,8 @@
|
|
|
13147
13184
|
/** @deprecated Keep it for backward-compatibility. */
|
|
13148
13185
|
checkoutTplContext: lodash.noop,
|
|
13149
13186
|
updateStoryboard: _dev_only_updateStoryboard,
|
|
13150
|
-
updateTemplatePreviewSettings: _dev_only_updateTemplatePreviewSettings
|
|
13187
|
+
updateTemplatePreviewSettings: _dev_only_updateTemplatePreviewSettings,
|
|
13188
|
+
updateSnippetPreviewSettings: _dev_only_updateSnippetPreviewSettings
|
|
13151
13189
|
};
|
|
13152
13190
|
|
|
13153
13191
|
var _excluded$2 = ["type"];
|