@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/dist/index.esm.js
CHANGED
|
@@ -3180,6 +3180,11 @@ function _dev_only_updateStoryboard(appId, storyboardPatch) {
|
|
|
3180
3180
|
function _dev_only_updateTemplatePreviewSettings(appId, templateId, settings) {
|
|
3181
3181
|
kernel._dev_only_updateTemplatePreviewSettings(appId, templateId, settings);
|
|
3182
3182
|
}
|
|
3183
|
+
/* istanbul ignore next */
|
|
3184
|
+
|
|
3185
|
+
function _dev_only_updateSnippetPreviewSettings(appId, snippetData) {
|
|
3186
|
+
kernel._dev_only_updateSnippetPreviewSettings(appId, snippetData);
|
|
3187
|
+
}
|
|
3183
3188
|
class Runtime {
|
|
3184
3189
|
constructor() {
|
|
3185
3190
|
_defineProperty$1(this, "registerBrickTemplate", registerBrickTemplate);
|
|
@@ -8092,6 +8097,30 @@ class Kernel {
|
|
|
8092
8097
|
}
|
|
8093
8098
|
}
|
|
8094
8099
|
|
|
8100
|
+
_dev_only_updateSnippetPreviewSettings(appId, snippetData) {
|
|
8101
|
+
var _snippetData$bricks;
|
|
8102
|
+
|
|
8103
|
+
var {
|
|
8104
|
+
routes
|
|
8105
|
+
} = this.bootstrapData.storyboards.find(item => item.app.id === appId);
|
|
8106
|
+
var previewPath = "${APP.homepage}/_dev_only_/snippet-preview/".concat(snippetData.snippetId);
|
|
8107
|
+
var previewRouteIndex = routes.findIndex(route => route.path === previewPath);
|
|
8108
|
+
var newPreviewRoute = {
|
|
8109
|
+
path: previewPath,
|
|
8110
|
+
bricks: ((_snippetData$bricks = snippetData.bricks) === null || _snippetData$bricks === void 0 ? void 0 : _snippetData$bricks.length) > 0 ? snippetData.bricks : [{
|
|
8111
|
+
brick: "span"
|
|
8112
|
+
}],
|
|
8113
|
+
menu: false,
|
|
8114
|
+
exact: true
|
|
8115
|
+
};
|
|
8116
|
+
|
|
8117
|
+
if (previewRouteIndex === -1) {
|
|
8118
|
+
routes.unshift(newPreviewRoute);
|
|
8119
|
+
} else {
|
|
8120
|
+
routes.splice(previewRouteIndex, 1, newPreviewRoute);
|
|
8121
|
+
}
|
|
8122
|
+
}
|
|
8123
|
+
|
|
8095
8124
|
loadDepsOfStoryboard(storyboard) {
|
|
8096
8125
|
return this.gracefullyLoadDeps(this._loadDepsOfStoryboard, storyboard);
|
|
8097
8126
|
}
|
|
@@ -10224,13 +10253,21 @@ class Router {
|
|
|
10224
10253
|
|
|
10225
10254
|
try {
|
|
10226
10255
|
var specificTemplatePreviewIndex = findLastIndex(storyboard.routes, route => route.path.startsWith("${APP.homepage}/_dev_only_/template-preview/"));
|
|
10227
|
-
var
|
|
10256
|
+
var specificSnippetPreviewIndex = findLastIndex(storyboard.routes, route => route.path.startsWith("${APP.homepage}/_dev_only_/snippet-preview/"));
|
|
10257
|
+
var mergedRoutes = [...storyboard.routes.slice(0, specificTemplatePreviewIndex + 1), ...storyboard.routes.slice(0, specificSnippetPreviewIndex + 1), {
|
|
10228
10258
|
path: "${APP.homepage}/_dev_only_/template-preview/:templateId",
|
|
10229
10259
|
bricks: [{
|
|
10230
10260
|
brick: "span"
|
|
10231
10261
|
}],
|
|
10232
10262
|
menu: false,
|
|
10233
10263
|
exact: true
|
|
10264
|
+
}, {
|
|
10265
|
+
path: "${APP.homepage}/_dev_only_/snippet-preview/:snippetId",
|
|
10266
|
+
bricks: [{
|
|
10267
|
+
brick: "span"
|
|
10268
|
+
}],
|
|
10269
|
+
menu: false,
|
|
10270
|
+
exact: true
|
|
10234
10271
|
}, ...storyboard.routes.slice(specificTemplatePreviewIndex + 1)];
|
|
10235
10272
|
yield locationContext.mountRoutes(mergedRoutes, undefined, mountRoutesResult);
|
|
10236
10273
|
} catch (error) {
|
|
@@ -13148,7 +13185,8 @@ var developHelper = {
|
|
|
13148
13185
|
/** @deprecated Keep it for backward-compatibility. */
|
|
13149
13186
|
checkoutTplContext: noop,
|
|
13150
13187
|
updateStoryboard: _dev_only_updateStoryboard,
|
|
13151
|
-
updateTemplatePreviewSettings: _dev_only_updateTemplatePreviewSettings
|
|
13188
|
+
updateTemplatePreviewSettings: _dev_only_updateTemplatePreviewSettings,
|
|
13189
|
+
updateSnippetPreviewSettings: _dev_only_updateSnippetPreviewSettings
|
|
13152
13190
|
};
|
|
13153
13191
|
|
|
13154
13192
|
var _excluded$2 = ["type"];
|