@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/dist/index.esm.js
CHANGED
|
@@ -583,7 +583,7 @@ var InstanceApi_postSearchV3 = /*#__PURE__*/function () {
|
|
|
583
583
|
};
|
|
584
584
|
}();
|
|
585
585
|
|
|
586
|
-
function supply(attemptToVisitGlobals, providedGlobalVariables) {
|
|
586
|
+
function supply(attemptToVisitGlobals, providedGlobalVariables, mock) {
|
|
587
587
|
var globalVariables = _objectSpread({}, providedGlobalVariables); // Allow limited browser builtin values.
|
|
588
588
|
|
|
589
589
|
|
|
@@ -591,7 +591,7 @@ function supply(attemptToVisitGlobals, providedGlobalVariables) {
|
|
|
591
591
|
|
|
592
592
|
for (var variableName of attemptToVisitGlobals) {
|
|
593
593
|
if (!Object.prototype.hasOwnProperty.call(globalVariables, variableName)) {
|
|
594
|
-
var variable = supplyIndividual(variableName);
|
|
594
|
+
var variable = supplyIndividual(variableName, mock);
|
|
595
595
|
|
|
596
596
|
if (variable !== undefined) {
|
|
597
597
|
globalVariables[variableName] = variable;
|
|
@@ -619,14 +619,14 @@ var shouldOmitInLodash = new Set([// Omit all mutable methods from lodash.
|
|
|
619
619
|
var shouldOmitInMoment = new Set(["lang", "langData", "locale", "localeData", "defineLocale", "updateLocale", "updateOffset"]);
|
|
620
620
|
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"]);
|
|
621
621
|
|
|
622
|
-
function supplyIndividual(variableName) {
|
|
622
|
+
function supplyIndividual(variableName, mock) {
|
|
623
623
|
switch (variableName) {
|
|
624
624
|
case "Object":
|
|
625
625
|
// Do not allow mutable methods like `Object.assign`.
|
|
626
626
|
return delegateMethods(Object, ["entries", "fromEntries", "keys", "values"]);
|
|
627
627
|
|
|
628
628
|
case "_":
|
|
629
|
-
return Object.fromEntries(Object.entries(lodash).filter(entry => !shouldOmitInLodash.has(entry[0])));
|
|
629
|
+
return Object.fromEntries(Object.entries(lodash).filter(entry => !shouldOmitInLodash.has(entry[0])).concat(mock ? [["uniqueId", prefix => "".concat(prefix !== null && prefix !== void 0 ? prefix : "", "42")]] : []));
|
|
630
630
|
|
|
631
631
|
case "moment":
|
|
632
632
|
return Object.assign(function () {
|
|
@@ -1688,7 +1688,7 @@ function StoryboardFunctionRegistryFactory() {
|
|
|
1688
1688
|
app: currentApp,
|
|
1689
1689
|
storyboardFunctions,
|
|
1690
1690
|
isStoryboardFunction: true
|
|
1691
|
-
})),
|
|
1691
|
+
}), !!collectCoverage),
|
|
1692
1692
|
hooks: collector && {
|
|
1693
1693
|
beforeEvaluate: collector.beforeEvaluate,
|
|
1694
1694
|
beforeCall: collector.beforeCall,
|
|
@@ -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"];
|