@next-core/brick-kit 2.117.15 → 2.118.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 +12 -0
- package/dist/index.bundle.js +40 -2
- package/dist/index.bundle.js.map +1 -1
- package/dist/index.esm.js +40 -2
- package/dist/index.esm.js.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/developHelper.d.ts +2 -1
- package/dist/types/developHelper.d.ts.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,18 @@
|
|
|
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.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)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* support snippet preview ([fa92790](https://github.com/easyops-cn/next-core/commit/fa92790bd9d2f2ebf0bc930a70844e887da006fc))
|
|
12
|
+
* update snippetData type ([07be28c](https://github.com/easyops-cn/next-core/commit/07be28ced614ce35c17aae806a85e0f5231ffcb4))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
6
18
|
## [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)
|
|
7
19
|
|
|
8
20
|
|
package/dist/index.bundle.js
CHANGED
|
@@ -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"];
|