@next-core/runtime 1.2.1 → 1.3.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/dist/cjs/Dialog.js +49 -0
- package/dist/cjs/Dialog.js.map +1 -0
- package/dist/cjs/Notification.js +30 -0
- package/dist/cjs/Notification.js.map +1 -0
- package/dist/cjs/StoryboardFunctionRegistry.js +14 -0
- package/dist/cjs/StoryboardFunctionRegistry.js.map +1 -1
- package/dist/cjs/handleHttpError.js +33 -18
- package/dist/cjs/handleHttpError.js.map +1 -1
- package/dist/cjs/index.js +19 -3
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/internal/CustomTemplates/utils.js +1 -1
- package/dist/cjs/internal/CustomTemplates/utils.js.map +1 -1
- package/dist/cjs/internal/Renderer.js +2 -3
- package/dist/cjs/internal/Renderer.js.map +1 -1
- package/dist/cjs/internal/Runtime.js +21 -11
- package/dist/cjs/internal/Runtime.js.map +1 -1
- package/dist/cjs/internal/bindListeners.js +7 -2
- package/dist/cjs/internal/bindListeners.js.map +1 -1
- package/dist/cjs/internal/compute/checkIf.js +4 -0
- package/dist/cjs/internal/compute/checkIf.js.map +1 -1
- package/dist/cjs/internal/compute/getNextStateOfUseBrick.js +4 -4
- package/dist/cjs/internal/compute/getNextStateOfUseBrick.js.map +1 -1
- package/dist/cjs/internal/enums.js +4 -4
- package/dist/cjs/internal/enums.js.map +1 -1
- package/dist/cjs/internal/historyExtended.js +21 -0
- package/dist/cjs/internal/historyExtended.js.map +1 -1
- package/dist/cjs/internal/i18n.js +31 -0
- package/dist/cjs/internal/i18n.js.map +1 -0
- package/dist/cjs/internal/mediaQuery.js +4 -4
- package/dist/cjs/internal/mediaQuery.js.map +1 -1
- package/dist/cjs/internal/secret_internals.js +5 -0
- package/dist/cjs/internal/secret_internals.js.map +1 -1
- package/dist/esm/CustomTemplates.js.map +1 -1
- package/dist/esm/Dialog.js +40 -0
- package/dist/esm/Dialog.js.map +1 -0
- package/dist/esm/Notification.js +21 -0
- package/dist/esm/Notification.js.map +1 -0
- package/dist/esm/StoryboardFunctionRegistry.js +12 -0
- package/dist/esm/StoryboardFunctionRegistry.js.map +1 -1
- package/dist/esm/handleHttpError.js +32 -17
- package/dist/esm/handleHttpError.js.map +1 -1
- package/dist/esm/index.js +4 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/internal/CustomTemplates/bindTemplateProxy.js +2 -2
- package/dist/esm/internal/CustomTemplates/bindTemplateProxy.js.map +1 -1
- package/dist/esm/internal/CustomTemplates/setupTemplateProxy.js +2 -2
- package/dist/esm/internal/CustomTemplates/setupTemplateProxy.js.map +1 -1
- package/dist/esm/internal/CustomTemplates/utils.js +1 -1
- package/dist/esm/internal/CustomTemplates/utils.js.map +1 -1
- package/dist/esm/internal/Renderer.js +2 -3
- package/dist/esm/internal/Renderer.js.map +1 -1
- package/dist/esm/internal/Runtime.js +21 -11
- package/dist/esm/internal/Runtime.js.map +1 -1
- package/dist/esm/internal/bindListeners.js +7 -2
- package/dist/esm/internal/bindListeners.js.map +1 -1
- package/dist/esm/internal/checkInstalledApps.js.map +1 -1
- package/dist/esm/internal/compute/checkIf.js +5 -0
- package/dist/esm/internal/compute/checkIf.js.map +1 -1
- package/dist/esm/internal/compute/getNextStateOfUseBrick.js +3 -3
- package/dist/esm/internal/compute/getNextStateOfUseBrick.js.map +1 -1
- package/dist/esm/internal/compute/listenOnTrackingContext.js.map +1 -1
- package/dist/esm/internal/data/DataStore.js.map +1 -1
- package/dist/esm/internal/data/FlowApiProvider.js +6 -6
- package/dist/esm/internal/data/FlowApiProvider.js.map +1 -1
- package/dist/esm/internal/enums.js +3 -3
- package/dist/esm/internal/enums.js.map +1 -1
- package/dist/esm/internal/historyExtended.js +21 -0
- package/dist/esm/internal/historyExtended.js.map +1 -1
- package/dist/esm/internal/i18n.js +22 -0
- package/dist/esm/internal/i18n.js.map +1 -0
- package/dist/esm/internal/loadBootstrapData.js +19 -18
- package/dist/esm/internal/loadBootstrapData.js.map +1 -1
- package/dist/esm/internal/mediaQuery.js +3 -3
- package/dist/esm/internal/mediaQuery.js.map +1 -1
- package/dist/esm/internal/menu/interfaces.js +4 -0
- package/dist/esm/internal/menu/interfaces.js.map +1 -1
- package/dist/esm/internal/menu/mergeMenu.js +11 -10
- package/dist/esm/internal/menu/mergeMenu.js.map +1 -1
- package/dist/esm/internal/secret_internals.js +5 -0
- package/dist/esm/internal/secret_internals.js.map +1 -1
- package/dist/types/Dialog.d.ts +14 -0
- package/dist/types/Notification.d.ts +10 -0
- package/dist/types/index.d.ts +4 -1
- package/dist/types/internal/Runtime.d.ts +1 -4
- package/dist/types/internal/i18n.d.ts +14 -0
- package/dist/types/tsdoc-metadata.json +11 -0
- package/package.json +16 -12
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.Dialog = void 0;
|
|
8
|
+
exports.loadDialogService = loadDialogService;
|
|
9
|
+
var __secret_internals = _interopRequireWildcard(require("./internal/secret_internals.js"));
|
|
10
|
+
let brick;
|
|
11
|
+
function show(options) {
|
|
12
|
+
if (brick) {
|
|
13
|
+
brick.resolve(options);
|
|
14
|
+
} else {
|
|
15
|
+
if (options.type === "confirm") {
|
|
16
|
+
if (confirm(options.content)) {
|
|
17
|
+
setTimeout(() => {
|
|
18
|
+
var _options$onOk;
|
|
19
|
+
(_options$onOk = options.onOk) === null || _options$onOk === void 0 ? void 0 : _options$onOk.call(options);
|
|
20
|
+
}, 1);
|
|
21
|
+
} else {
|
|
22
|
+
setTimeout(() => {
|
|
23
|
+
var _options$onCancel;
|
|
24
|
+
(_options$onCancel = options.onCancel) === null || _options$onCancel === void 0 ? void 0 : _options$onCancel.call(options);
|
|
25
|
+
}, 1);
|
|
26
|
+
}
|
|
27
|
+
} else {
|
|
28
|
+
alert(options.content);
|
|
29
|
+
if (options.onOk) {
|
|
30
|
+
setTimeout(() => {
|
|
31
|
+
options.onOk();
|
|
32
|
+
}, 1000);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
function loadDialogService(tagName) {
|
|
38
|
+
__secret_internals.loadBricks([tagName]).then(() => {
|
|
39
|
+
brick = document.createElement(tagName);
|
|
40
|
+
}, error => {
|
|
41
|
+
// eslint-disable-next-line no-console
|
|
42
|
+
console.error("Load dialog service failed:", error);
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
const Dialog = Object.freeze({
|
|
46
|
+
show
|
|
47
|
+
});
|
|
48
|
+
exports.Dialog = Dialog;
|
|
49
|
+
//# sourceMappingURL=Dialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Dialog.js","names":["__secret_internals","_interopRequireWildcard","require","brick","show","options","resolve","type","confirm","content","setTimeout","_options$onOk","onOk","call","_options$onCancel","onCancel","alert","loadDialogService","tagName","loadBricks","then","document","createElement","error","console","Dialog","Object","freeze","exports"],"sources":["../../src/Dialog.ts"],"sourcesContent":["import * as __secret_internals from \"./internal/secret_internals.js\";\n\nlet brick: {\n resolve(options: DialogOptions): void;\n};\n\nfunction show(options: DialogOptions) {\n if (brick) {\n brick.resolve(options);\n } else {\n if (options.type === \"confirm\") {\n if (confirm(options.content)) {\n setTimeout(() => {\n options.onOk?.();\n }, 1);\n } else {\n setTimeout(() => {\n options.onCancel?.();\n }, 1);\n }\n } else {\n alert(options.content);\n if (options.onOk) {\n setTimeout(() => {\n options.onOk!();\n }, 1000);\n }\n }\n }\n}\n\nexport function loadDialogService(tagName: string) {\n __secret_internals.loadBricks([tagName]).then(\n () => {\n brick = document.createElement(tagName) as any;\n },\n (error: unknown) => {\n // eslint-disable-next-line no-console\n console.error(\"Load dialog service failed:\", error);\n }\n );\n}\n\nexport interface DialogOptions {\n type?: \"success\" | \"error\" | \"warn\" | \"info\" | \"confirm\";\n title?: string | null;\n content: string;\n whiteSpace?: string;\n onOk?: () => void;\n onCancel?: () => void;\n}\n\nexport const Dialog = Object.freeze({\n show,\n});\n"],"mappings":";;;;;;;;AAAA,IAAAA,kBAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAIC,KAEH;AAED,SAASC,IAAIA,CAACC,OAAsB,EAAE;EACpC,IAAIF,KAAK,EAAE;IACTA,KAAK,CAACG,OAAO,CAACD,OAAO,CAAC;EACxB,CAAC,MAAM;IACL,IAAIA,OAAO,CAACE,IAAI,KAAK,SAAS,EAAE;MAC9B,IAAIC,OAAO,CAACH,OAAO,CAACI,OAAO,CAAC,EAAE;QAC5BC,UAAU,CAAC,MAAM;UAAA,IAAAC,aAAA;UACf,CAAAA,aAAA,GAAAN,OAAO,CAACO,IAAI,cAAAD,aAAA,uBAAZA,aAAA,CAAAE,IAAA,CAAAR,OAAO,CAAS;QAClB,CAAC,EAAE,CAAC,CAAC;MACP,CAAC,MAAM;QACLK,UAAU,CAAC,MAAM;UAAA,IAAAI,iBAAA;UACf,CAAAA,iBAAA,GAAAT,OAAO,CAACU,QAAQ,cAAAD,iBAAA,uBAAhBA,iBAAA,CAAAD,IAAA,CAAAR,OAAO,CAAa;QACtB,CAAC,EAAE,CAAC,CAAC;MACP;IACF,CAAC,MAAM;MACLW,KAAK,CAACX,OAAO,CAACI,OAAO,CAAC;MACtB,IAAIJ,OAAO,CAACO,IAAI,EAAE;QAChBF,UAAU,CAAC,MAAM;UACfL,OAAO,CAACO,IAAI,EAAG;QACjB,CAAC,EAAE,IAAI,CAAC;MACV;IACF;EACF;AACF;AAEO,SAASK,iBAAiBA,CAACC,OAAe,EAAE;EACjDlB,kBAAkB,CAACmB,UAAU,CAAC,CAACD,OAAO,CAAC,CAAC,CAACE,IAAI,CAC3C,MAAM;IACJjB,KAAK,GAAGkB,QAAQ,CAACC,aAAa,CAACJ,OAAO,CAAQ;EAChD,CAAC,EACAK,KAAc,IAAK;IAClB;IACAC,OAAO,CAACD,KAAK,CAAC,6BAA6B,EAAEA,KAAK,CAAC;EACrD,CAAC,CACF;AACH;AAWO,MAAME,MAAM,GAAGC,MAAM,CAACC,MAAM,CAAC;EAClCvB;AACF,CAAC,CAAC;AAACwB,OAAA,CAAAH,MAAA,GAAAA,MAAA"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.Notification = void 0;
|
|
8
|
+
exports.loadNotificationService = loadNotificationService;
|
|
9
|
+
var __secret_internals = _interopRequireWildcard(require("./internal/secret_internals.js"));
|
|
10
|
+
let brick;
|
|
11
|
+
function show(options) {
|
|
12
|
+
if (brick) {
|
|
13
|
+
brick.resolve(options);
|
|
14
|
+
} else {
|
|
15
|
+
alert(options.message);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
function loadNotificationService(tagName) {
|
|
19
|
+
__secret_internals.loadBricks([tagName]).then(() => {
|
|
20
|
+
brick = document.createElement(tagName);
|
|
21
|
+
}, error => {
|
|
22
|
+
// eslint-disable-next-line no-console
|
|
23
|
+
console.error("Load notification service failed:", error);
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
const Notification = Object.freeze({
|
|
27
|
+
show
|
|
28
|
+
});
|
|
29
|
+
exports.Notification = Notification;
|
|
30
|
+
//# sourceMappingURL=Notification.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Notification.js","names":["__secret_internals","_interopRequireWildcard","require","brick","show","options","resolve","alert","message","loadNotificationService","tagName","loadBricks","then","document","createElement","error","console","Notification","Object","freeze","exports"],"sources":["../../src/Notification.ts"],"sourcesContent":["import * as __secret_internals from \"./internal/secret_internals.js\";\n\nlet brick: {\n resolve(options: NotificationOptions): void;\n};\n\nfunction show(options: NotificationOptions) {\n if (brick) {\n brick.resolve(options);\n } else {\n alert(options.message);\n }\n}\n\nexport function loadNotificationService(tagName: string) {\n __secret_internals.loadBricks([tagName]).then(\n () => {\n brick = document.createElement(tagName) as any;\n },\n (error: unknown) => {\n // eslint-disable-next-line no-console\n console.error(\"Load notification service failed:\", error);\n }\n );\n}\n\nexport interface NotificationOptions {\n type?: \"success\" | \"error\" | \"warn\" | \"info\";\n message: string;\n}\n\nexport const Notification = Object.freeze({\n show,\n});\n"],"mappings":";;;;;;;;AAAA,IAAAA,kBAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAIC,KAEH;AAED,SAASC,IAAIA,CAACC,OAA4B,EAAE;EAC1C,IAAIF,KAAK,EAAE;IACTA,KAAK,CAACG,OAAO,CAACD,OAAO,CAAC;EACxB,CAAC,MAAM;IACLE,KAAK,CAACF,OAAO,CAACG,OAAO,CAAC;EACxB;AACF;AAEO,SAASC,uBAAuBA,CAACC,OAAe,EAAE;EACvDV,kBAAkB,CAACW,UAAU,CAAC,CAACD,OAAO,CAAC,CAAC,CAACE,IAAI,CAC3C,MAAM;IACJT,KAAK,GAAGU,QAAQ,CAACC,aAAa,CAACJ,OAAO,CAAQ;EAChD,CAAC,EACAK,KAAc,IAAK;IAClB;IACAC,OAAO,CAACD,KAAK,CAAC,mCAAmC,EAAEA,KAAK,CAAC;EAC3D,CAAC,CACF;AACH;AAOO,MAAME,YAAY,GAAGC,MAAM,CAACC,MAAM,CAAC;EACxCf;AACF,CAAC,CAAC;AAACgB,OAAA,CAAAH,YAAA,GAAAA,YAAA"}
|
|
@@ -8,6 +8,20 @@ var _cook = require("@next-core/cook");
|
|
|
8
8
|
var _supply = require("@next-core/supply");
|
|
9
9
|
var _storyboard = require("@next-core/utils/storyboard");
|
|
10
10
|
var _getGeneralGlobals = require("./internal/compute/getGeneralGlobals.js");
|
|
11
|
+
/** @internal */
|
|
12
|
+
|
|
13
|
+
/** @internal */
|
|
14
|
+
|
|
15
|
+
/** @internal */
|
|
16
|
+
|
|
17
|
+
/** @internal */
|
|
18
|
+
|
|
19
|
+
/** @internal */
|
|
20
|
+
|
|
21
|
+
/** @internal */
|
|
22
|
+
|
|
23
|
+
/** @internal */
|
|
24
|
+
|
|
11
25
|
/** @internal */
|
|
12
26
|
function StoryboardFunctionRegistryFactory({
|
|
13
27
|
widgetId,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StoryboardFunctionRegistry.js","names":["_cook","require","_supply","_storyboard","_getGeneralGlobals","StoryboardFunctionRegistryFactory","widgetId","widgetVersion","collectCoverage","registeredFunctions","Map","storyboardFunctions","Proxy","Object","freeze","get","target","key","getStoryboardFunction","currentApp","registerStoryboardFunctions","functions","app","clear","Array","isArray","fn","deps","strictCollectMemberUsageInFunction","hasPermissionsCheck","has","set","name","source","typescript","undefined","processed","cooked","collector","createCollector","precooked","precookFunction","hooks","beforeVisit","cook","function","rules","noVar","globalVariables","supply","attemptToVisitGlobals","getGeneralGlobals","isStoryboardFunction","beforeEvaluate","beforeCall","beforeBranch","updateStoryboardFunction","data","newFn","checkPermissionsUsage","functionNames","checkedFunctions","Set","add","some"],"sources":["../../src/StoryboardFunctionRegistry.ts"],"sourcesContent":["import type { MicroApp, StoryboardFunction } from \"@next-core/types\";\nimport { cook, precookFunction, EstreeNode } from \"@next-core/cook\";\nimport { supply } from \"@next-core/supply\";\nimport { strictCollectMemberUsageInFunction } from \"@next-core/utils/storyboard\";\nimport { getGeneralGlobals } from \"./internal/compute/getGeneralGlobals.js\";\n\n/** @internal */\nexport type ReadonlyStoryboardFunctions = Readonly<Record<string, Function>>;\n\n/** @internal */\nexport type StoryboardFunctionPatch = Pick<\n StoryboardFunction,\n \"source\" | \"typescript\"\n>;\n\n/** @internal */\nexport interface StoryboardFunctionRegistry {\n /** A readonly proxy for accessing cooked storyboard functions. */\n storyboardFunctions: ReadonlyStoryboardFunctions;\n\n /** Register storyboard functions. */\n registerStoryboardFunctions(\n functions: StoryboardFunction[] | undefined,\n app?: PartialMicroApp\n ): void;\n\n /** Update a storyboard function during debugging. */\n updateStoryboardFunction(name: string, data: StoryboardFunctionPatch): void;\n\n checkPermissionsUsage(functionNames: string[]): boolean;\n}\n\n/** @internal */\nexport interface RuntimeStoryboardFunction {\n source: string;\n typescript?: boolean;\n processed?: boolean;\n cooked?: Function;\n deps: Set<string>;\n hasPermissionsCheck: boolean;\n}\n\n/** @internal */\nexport interface FunctionCoverageCollector {\n beforeVisit(node: EstreeNode): void;\n beforeEvaluate(node: EstreeNode): void;\n beforeCall(node: EstreeNode): void;\n beforeBranch(node: EstreeNode, branch: string): void;\n}\n\n/** @internal */\nexport interface FunctionCoverageSettings {\n createCollector(name: string): FunctionCoverageCollector;\n}\n\n/** @internal */\nexport type PartialMicroApp = Pick<MicroApp, \"id\" | \"isBuildPush\">;\n\n/** @internal */\nexport function StoryboardFunctionRegistryFactory({\n widgetId,\n widgetVersion,\n collectCoverage,\n}: {\n widgetId?: string;\n widgetVersion?: string;\n collectCoverage?: FunctionCoverageSettings;\n} = {}): StoryboardFunctionRegistry {\n const registeredFunctions = new Map<string, RuntimeStoryboardFunction>();\n\n // Use `Proxy` with a frozen target, to make a readonly function registry.\n const storyboardFunctions = new Proxy(Object.freeze({}), {\n get(target, key) {\n return getStoryboardFunction(key as string);\n },\n }) as ReadonlyStoryboardFunctions;\n\n let currentApp: PartialMicroApp | undefined;\n\n function registerStoryboardFunctions(\n functions: StoryboardFunction[],\n app?: PartialMicroApp\n ): void {\n if (app) {\n currentApp = app;\n }\n registeredFunctions.clear();\n if (Array.isArray(functions)) {\n for (const fn of functions) {\n const deps = strictCollectMemberUsageInFunction(fn, \"FN\");\n const hasPermissionsCheck = strictCollectMemberUsageInFunction(\n fn,\n \"PERMISSIONS\"\n ).has(\"check\");\n registeredFunctions.set(fn.name, {\n source: fn.source,\n typescript: fn.typescript,\n deps,\n hasPermissionsCheck,\n });\n }\n }\n }\n\n function getStoryboardFunction(name: string): Function | undefined {\n const fn = registeredFunctions.get(name);\n if (!fn) {\n return undefined;\n }\n if (fn.processed) {\n return fn.cooked;\n }\n let collector: FunctionCoverageCollector | undefined;\n if (collectCoverage) {\n collector = collectCoverage.createCollector(name);\n }\n const precooked = precookFunction(fn.source, {\n typescript: fn.typescript,\n hooks: collector && {\n beforeVisit: collector.beforeVisit,\n },\n });\n fn.cooked = cook(precooked.function, fn.source, {\n rules: {\n noVar: true,\n },\n globalVariables: supply(\n precooked.attemptToVisitGlobals,\n getGeneralGlobals(precooked.attemptToVisitGlobals, {\n collectCoverage,\n widgetId,\n widgetVersion,\n app: currentApp,\n storyboardFunctions,\n isStoryboardFunction: true,\n }),\n !!collectCoverage\n ),\n hooks: collector && {\n beforeEvaluate: collector.beforeEvaluate,\n beforeCall: collector.beforeCall,\n beforeBranch: collector.beforeBranch,\n },\n }) as Function;\n fn.processed = true;\n return fn.cooked;\n }\n\n return {\n storyboardFunctions,\n registerStoryboardFunctions,\n updateStoryboardFunction(\n name: string,\n data: StoryboardFunctionPatch\n ): void {\n const newFn = {\n ...data,\n name,\n };\n const deps = strictCollectMemberUsageInFunction(newFn, \"FN\");\n const hasPermissionsCheck = strictCollectMemberUsageInFunction(\n newFn,\n \"PERMISSIONS\"\n ).has(\"check\");\n registeredFunctions.set(name, {\n source: data.source,\n typescript: data.typescript,\n deps,\n hasPermissionsCheck,\n });\n },\n /**\n * Check whether listed functions attempt to call `PERMISSIONS.check()`,\n * includes in nested `FN.*()` calls.\n */\n checkPermissionsUsage(functionNames) {\n const checkedFunctions = new Set<string>();\n const hasPermissionsCheck = (name: string): boolean => {\n if (!checkedFunctions.has(name)) {\n checkedFunctions.add(name);\n const fn = registeredFunctions.get(name);\n return (\n !!fn &&\n (fn.hasPermissionsCheck || [...fn.deps].some(hasPermissionsCheck))\n );\n }\n return false;\n };\n return functionNames.some(hasPermissionsCheck);\n },\n };\n}\n"],"mappings":";;;;;;AACA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,kBAAA,GAAAH,OAAA;
|
|
1
|
+
{"version":3,"file":"StoryboardFunctionRegistry.js","names":["_cook","require","_supply","_storyboard","_getGeneralGlobals","StoryboardFunctionRegistryFactory","widgetId","widgetVersion","collectCoverage","registeredFunctions","Map","storyboardFunctions","Proxy","Object","freeze","get","target","key","getStoryboardFunction","currentApp","registerStoryboardFunctions","functions","app","clear","Array","isArray","fn","deps","strictCollectMemberUsageInFunction","hasPermissionsCheck","has","set","name","source","typescript","undefined","processed","cooked","collector","createCollector","precooked","precookFunction","hooks","beforeVisit","cook","function","rules","noVar","globalVariables","supply","attemptToVisitGlobals","getGeneralGlobals","isStoryboardFunction","beforeEvaluate","beforeCall","beforeBranch","updateStoryboardFunction","data","newFn","checkPermissionsUsage","functionNames","checkedFunctions","Set","add","some"],"sources":["../../src/StoryboardFunctionRegistry.ts"],"sourcesContent":["import type { MicroApp, StoryboardFunction } from \"@next-core/types\";\nimport { cook, precookFunction, EstreeNode } from \"@next-core/cook\";\nimport { supply } from \"@next-core/supply\";\nimport { strictCollectMemberUsageInFunction } from \"@next-core/utils/storyboard\";\nimport { getGeneralGlobals } from \"./internal/compute/getGeneralGlobals.js\";\n\n/** @internal */\nexport type ReadonlyStoryboardFunctions = Readonly<Record<string, Function>>;\n\n/** @internal */\nexport type StoryboardFunctionPatch = Pick<\n StoryboardFunction,\n \"source\" | \"typescript\"\n>;\n\n/** @internal */\nexport interface StoryboardFunctionRegistry {\n /** A readonly proxy for accessing cooked storyboard functions. */\n storyboardFunctions: ReadonlyStoryboardFunctions;\n\n /** Register storyboard functions. */\n registerStoryboardFunctions(\n functions: StoryboardFunction[] | undefined,\n app?: PartialMicroApp\n ): void;\n\n /** Update a storyboard function during debugging. */\n updateStoryboardFunction(name: string, data: StoryboardFunctionPatch): void;\n\n checkPermissionsUsage(functionNames: string[]): boolean;\n}\n\n/** @internal */\nexport interface RuntimeStoryboardFunction {\n source: string;\n typescript?: boolean;\n processed?: boolean;\n cooked?: Function;\n deps: Set<string>;\n hasPermissionsCheck: boolean;\n}\n\n/** @internal */\nexport interface FunctionCoverageCollector {\n beforeVisit(node: EstreeNode): void;\n beforeEvaluate(node: EstreeNode): void;\n beforeCall(node: EstreeNode): void;\n beforeBranch(node: EstreeNode, branch: string): void;\n}\n\n/** @internal */\nexport interface FunctionCoverageSettings {\n createCollector(name: string): FunctionCoverageCollector;\n}\n\n/** @internal */\nexport type PartialMicroApp = Pick<MicroApp, \"id\" | \"isBuildPush\">;\n\n/** @internal */\nexport function StoryboardFunctionRegistryFactory({\n widgetId,\n widgetVersion,\n collectCoverage,\n}: {\n widgetId?: string;\n widgetVersion?: string;\n collectCoverage?: FunctionCoverageSettings;\n} = {}): StoryboardFunctionRegistry {\n const registeredFunctions = new Map<string, RuntimeStoryboardFunction>();\n\n // Use `Proxy` with a frozen target, to make a readonly function registry.\n const storyboardFunctions = new Proxy(Object.freeze({}), {\n get(target, key) {\n return getStoryboardFunction(key as string);\n },\n }) as ReadonlyStoryboardFunctions;\n\n let currentApp: PartialMicroApp | undefined;\n\n function registerStoryboardFunctions(\n functions: StoryboardFunction[],\n app?: PartialMicroApp\n ): void {\n if (app) {\n currentApp = app;\n }\n registeredFunctions.clear();\n if (Array.isArray(functions)) {\n for (const fn of functions) {\n const deps = strictCollectMemberUsageInFunction(fn, \"FN\");\n const hasPermissionsCheck = strictCollectMemberUsageInFunction(\n fn,\n \"PERMISSIONS\"\n ).has(\"check\");\n registeredFunctions.set(fn.name, {\n source: fn.source,\n typescript: fn.typescript,\n deps,\n hasPermissionsCheck,\n });\n }\n }\n }\n\n function getStoryboardFunction(name: string): Function | undefined {\n const fn = registeredFunctions.get(name);\n if (!fn) {\n return undefined;\n }\n if (fn.processed) {\n return fn.cooked;\n }\n let collector: FunctionCoverageCollector | undefined;\n if (collectCoverage) {\n collector = collectCoverage.createCollector(name);\n }\n const precooked = precookFunction(fn.source, {\n typescript: fn.typescript,\n hooks: collector && {\n beforeVisit: collector.beforeVisit,\n },\n });\n fn.cooked = cook(precooked.function, fn.source, {\n rules: {\n noVar: true,\n },\n globalVariables: supply(\n precooked.attemptToVisitGlobals,\n getGeneralGlobals(precooked.attemptToVisitGlobals, {\n collectCoverage,\n widgetId,\n widgetVersion,\n app: currentApp,\n storyboardFunctions,\n isStoryboardFunction: true,\n }),\n !!collectCoverage\n ),\n hooks: collector && {\n beforeEvaluate: collector.beforeEvaluate,\n beforeCall: collector.beforeCall,\n beforeBranch: collector.beforeBranch,\n },\n }) as Function;\n fn.processed = true;\n return fn.cooked;\n }\n\n return {\n storyboardFunctions,\n registerStoryboardFunctions,\n updateStoryboardFunction(\n name: string,\n data: StoryboardFunctionPatch\n ): void {\n const newFn = {\n ...data,\n name,\n };\n const deps = strictCollectMemberUsageInFunction(newFn, \"FN\");\n const hasPermissionsCheck = strictCollectMemberUsageInFunction(\n newFn,\n \"PERMISSIONS\"\n ).has(\"check\");\n registeredFunctions.set(name, {\n source: data.source,\n typescript: data.typescript,\n deps,\n hasPermissionsCheck,\n });\n },\n /**\n * Check whether listed functions attempt to call `PERMISSIONS.check()`,\n * includes in nested `FN.*()` calls.\n */\n checkPermissionsUsage(functionNames) {\n const checkedFunctions = new Set<string>();\n const hasPermissionsCheck = (name: string): boolean => {\n if (!checkedFunctions.has(name)) {\n checkedFunctions.add(name);\n const fn = registeredFunctions.get(name);\n return (\n !!fn &&\n (fn.hasPermissionsCheck || [...fn.deps].some(hasPermissionsCheck))\n );\n }\n return false;\n };\n return functionNames.some(hasPermissionsCheck);\n },\n };\n}\n"],"mappings":";;;;;;AACA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,kBAAA,GAAAH,OAAA;AAEA;;AAGA;;AAMA;;AAiBA;;AAUA;;AAQA;;AAKA;;AAGA;AAC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AAD,8CAAkC,EAC5D8B,KAAK,EACL,aAAa,CACd,CAAC5B,GAAG,CAAC,OAAO,CAAC;MACdrB,mBAAmB,CAACsB,GAAG,CAACC,IAAI,EAAE;QAC5BC,MAAM,EAAEwB,IAAI,CAACxB,MAAM;QACnBC,UAAU,EAAEuB,IAAI,CAACvB,UAAU;QAC3BP,IAAI;QACJE;MACF,CAAC,CAAC;IACJ,CAAC;IACD;AACJ;AACA;AACA;IACI8B,qBAAqBA,CAACC,aAAa,EAAE;MACnC,MAAMC,gBAAgB,GAAG,IAAIC,GAAG,EAAU;MAC1C,MAAMjC,mBAAmB,GAAIG,IAAY,IAAc;QACrD,IAAI,CAAC6B,gBAAgB,CAAC/B,GAAG,CAACE,IAAI,CAAC,EAAE;UAC/B6B,gBAAgB,CAACE,GAAG,CAAC/B,IAAI,CAAC;UAC1B,MAAMN,EAAE,GAAGjB,mBAAmB,CAACM,GAAG,CAACiB,IAAI,CAAC;UACxC,OACE,CAAC,CAACN,EAAE,KACHA,EAAE,CAACG,mBAAmB,IAAI,CAAC,GAAGH,EAAE,CAACC,IAAI,CAAC,CAACqC,IAAI,CAACnC,mBAAmB,CAAC,CAAC;QAEtE;QACA,OAAO,KAAK;MACd,CAAC;MACD,OAAO+B,aAAa,CAACI,IAAI,CAACnC,mBAAmB,CAAC;IAChD;EACF,CAAC;AACH"}
|
|
@@ -7,8 +7,11 @@ exports.handleHttpError = handleHttpError;
|
|
|
7
7
|
exports.httpErrorToString = httpErrorToString;
|
|
8
8
|
exports.isUnauthenticatedError = isUnauthenticatedError;
|
|
9
9
|
var _http = require("@next-core/http");
|
|
10
|
+
var _i18n = require("@next-core/i18n");
|
|
10
11
|
var _Runtime = require("./internal/Runtime.js");
|
|
11
12
|
var _history = require("./history.js");
|
|
13
|
+
var _i18n2 = require("./internal/i18n.js");
|
|
14
|
+
var _Dialog = require("./Dialog.js");
|
|
12
15
|
/**
|
|
13
16
|
* 将 http 请求错误转换为可读的字符串。
|
|
14
17
|
*
|
|
@@ -65,20 +68,17 @@ function handleHttpError(error) {
|
|
|
65
68
|
return;
|
|
66
69
|
}
|
|
67
70
|
unauthenticatedConfirming = true;
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
setTimeout(() => {
|
|
80
|
-
unauthenticatedConfirming = false;
|
|
81
|
-
}, 1);
|
|
71
|
+
_Dialog.Dialog.show({
|
|
72
|
+
type: "confirm",
|
|
73
|
+
content: _i18n.i18n.t(`${_i18n2.NS}:${_i18n2.K.LOGIN_TIMEOUT_MESSAGE}`),
|
|
74
|
+
onOk() {
|
|
75
|
+
redirectToLogin();
|
|
76
|
+
unauthenticatedConfirming = false;
|
|
77
|
+
},
|
|
78
|
+
onCancel() {
|
|
79
|
+
unauthenticatedConfirming = false;
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
82
|
return;
|
|
83
83
|
}
|
|
84
84
|
|
|
@@ -87,11 +87,26 @@ function handleHttpError(error) {
|
|
|
87
87
|
const message = httpErrorToString(error);
|
|
88
88
|
if (message !== lastErrorMessage) {
|
|
89
89
|
lastErrorMessage = message;
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
90
|
+
_Dialog.Dialog.show({
|
|
91
|
+
type: "error",
|
|
92
|
+
title: _i18n.i18n.t(`${_i18n2.NS}:${_i18n2.K.REQUEST_FAILED}`),
|
|
93
|
+
content: message,
|
|
94
|
+
whiteSpace: "pre-wrap",
|
|
95
|
+
onOk() {
|
|
96
|
+
lastErrorMessage = undefined;
|
|
97
|
+
}
|
|
98
|
+
});
|
|
94
99
|
}
|
|
95
100
|
return;
|
|
96
101
|
}
|
|
102
|
+
function redirectToLogin() {
|
|
103
|
+
const ssoEnabled = (0, _Runtime.getRuntime)().getFeatureFlags()["sso-enabled"];
|
|
104
|
+
const history = (0, _history.getHistory)();
|
|
105
|
+
history.push(ssoEnabled ? "/sso-auth/login" : "/auth/login", {
|
|
106
|
+
from: {
|
|
107
|
+
...history.location,
|
|
108
|
+
state: undefined
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
}
|
|
97
112
|
//# sourceMappingURL=handleHttpError.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handleHttpError.js","names":["_http","require","_Runtime","_history","httpErrorToString","error","Event","target","HTMLScriptElement","src","HttpFetchError","HttpResponseError","responseJson","msg","toString","isUnauthenticatedError","response","status","code","unauthenticatedConfirming","lastErrorMessage","handleHttpError","HttpAbortError","window","NO_AUTH_GUARD","
|
|
1
|
+
{"version":3,"file":"handleHttpError.js","names":["_http","require","_i18n","_Runtime","_history","_i18n2","_Dialog","httpErrorToString","error","Event","target","HTMLScriptElement","src","HttpFetchError","HttpResponseError","responseJson","msg","toString","isUnauthenticatedError","response","status","code","unauthenticatedConfirming","lastErrorMessage","handleHttpError","HttpAbortError","window","NO_AUTH_GUARD","Dialog","show","type","content","i18n","t","NS","K","LOGIN_TIMEOUT_MESSAGE","onOk","redirectToLogin","onCancel","console","message","title","REQUEST_FAILED","whiteSpace","undefined","ssoEnabled","getRuntime","getFeatureFlags","history","getHistory","push","from","location","state"],"sources":["../../src/handleHttpError.ts"],"sourcesContent":["import {\n HttpAbortError,\n HttpFetchError,\n HttpResponseError,\n} from \"@next-core/http\";\nimport { i18n } from \"@next-core/i18n\";\nimport { getRuntime } from \"./internal/Runtime.js\";\nimport { getHistory } from \"./history.js\";\nimport { K, NS } from \"./internal/i18n.js\";\nimport { Dialog } from \"./Dialog.js\";\n\n/**\n * 将 http 请求错误转换为可读的字符串。\n *\n * @remarks\n *\n * 将依次尝试读取返回的 JSON 格式数据的字符串类型的 `error` 和 `msg` 字段,如果没有找到则返回 `error.toString()` 的结果。\n *\n * @param error - 错误对象。\n *\n * @returns 转换为字符串的错误信息。\n */\nexport function httpErrorToString(error: unknown): string {\n if (error instanceof Event && error.target instanceof HTMLScriptElement) {\n return error.target.src;\n }\n if (error instanceof HttpFetchError) {\n // return i18next.t(`${NS_BRICK_KIT}:${K.NETWORK_ERROR}`);\n return \"网络错误,请检查您的网络连接。\";\n }\n if (error instanceof HttpResponseError) {\n if (error.responseJson) {\n if (typeof error.responseJson.error === \"string\") {\n return error.responseJson.error;\n } else if (typeof error.responseJson.msg === \"string\") {\n return error.responseJson.msg;\n }\n }\n }\n if (error == null) {\n return \"Unknown error\";\n }\n return error.toString();\n}\n\nexport function isUnauthenticatedError(error: unknown): boolean {\n return (\n error instanceof HttpResponseError &&\n error.response.status === 401 &&\n !!error.responseJson &&\n error.responseJson.code === 100003\n );\n}\n\nlet unauthenticatedConfirming = false;\n\nlet lastErrorMessage: string | undefined;\n\n/**\n * 处理 http 请求错误(使用 AntDesign 模态框弹出错误信息)。\n *\n * @param error - 错误对象。\n */\nexport function handleHttpError(error: unknown) {\n // Do nothing if aborted http requests\n if (error instanceof HttpAbortError) {\n return;\n }\n\n // Redirect to login page if not logged in.\n if (isUnauthenticatedError(error) && !window.NO_AUTH_GUARD) {\n if (unauthenticatedConfirming) {\n return;\n }\n unauthenticatedConfirming = true;\n Dialog.show({\n type: \"confirm\",\n content: i18n.t(`${NS}:${K.LOGIN_TIMEOUT_MESSAGE}`),\n onOk() {\n redirectToLogin();\n unauthenticatedConfirming = false;\n },\n onCancel() {\n unauthenticatedConfirming = false;\n },\n });\n return;\n }\n\n // eslint-disable-next-line no-console\n console.error(error);\n\n const message = httpErrorToString(error);\n if (message !== lastErrorMessage) {\n lastErrorMessage = message;\n Dialog.show({\n type: \"error\",\n title: i18n.t(`${NS}:${K.REQUEST_FAILED}`),\n content: message,\n whiteSpace: \"pre-wrap\",\n onOk() {\n lastErrorMessage = undefined;\n },\n });\n }\n return;\n}\n\nfunction redirectToLogin() {\n const ssoEnabled = getRuntime().getFeatureFlags()[\"sso-enabled\"];\n const history = getHistory();\n history.push(ssoEnabled ? \"/sso-auth/login\" : \"/auth/login\", {\n from: {\n ...history.location,\n state: undefined,\n },\n });\n}\n"],"mappings":";;;;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASM,iBAAiBA,CAACC,KAAc,EAAU;EACxD,IAAIA,KAAK,YAAYC,KAAK,IAAID,KAAK,CAACE,MAAM,YAAYC,iBAAiB,EAAE;IACvE,OAAOH,KAAK,CAACE,MAAM,CAACE,GAAG;EACzB;EACA,IAAIJ,KAAK,YAAYK,oBAAc,EAAE;IACnC;IACA,OAAO,iBAAiB;EAC1B;EACA,IAAIL,KAAK,YAAYM,uBAAiB,EAAE;IACtC,IAAIN,KAAK,CAACO,YAAY,EAAE;MACtB,IAAI,OAAOP,KAAK,CAACO,YAAY,CAACP,KAAK,KAAK,QAAQ,EAAE;QAChD,OAAOA,KAAK,CAACO,YAAY,CAACP,KAAK;MACjC,CAAC,MAAM,IAAI,OAAOA,KAAK,CAACO,YAAY,CAACC,GAAG,KAAK,QAAQ,EAAE;QACrD,OAAOR,KAAK,CAACO,YAAY,CAACC,GAAG;MAC/B;IACF;EACF;EACA,IAAIR,KAAK,IAAI,IAAI,EAAE;IACjB,OAAO,eAAe;EACxB;EACA,OAAOA,KAAK,CAACS,QAAQ,EAAE;AACzB;AAEO,SAASC,sBAAsBA,CAACV,KAAc,EAAW;EAC9D,OACEA,KAAK,YAAYM,uBAAiB,IAClCN,KAAK,CAACW,QAAQ,CAACC,MAAM,KAAK,GAAG,IAC7B,CAAC,CAACZ,KAAK,CAACO,YAAY,IACpBP,KAAK,CAACO,YAAY,CAACM,IAAI,KAAK,MAAM;AAEtC;AAEA,IAAIC,yBAAyB,G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MAAMC,OAAO,GAAG,IAAAC,mBAAU,GAAE;EAC5BD,OAAO,CAACE,IAAI,CAACL,UAAU,GAAG,iBAAiB,GAAG,aAAa,EAAE;IAC3DM,IAAI,EAAE;MACJ,GAAGH,OAAO,CAACI,QAAQ;MACnBC,KAAK,EAAET;IACT;EACF,CAAC,CAAC;AACJ"}
|
package/dist/cjs/index.js
CHANGED
|
@@ -18,8 +18,22 @@ var _exportNames = {
|
|
|
18
18
|
registerWidgetFunctions: true,
|
|
19
19
|
registerWidgetI18n: true,
|
|
20
20
|
StoryboardFunctionRegistryFactory: true,
|
|
21
|
-
matchPath: true
|
|
21
|
+
matchPath: true,
|
|
22
|
+
Notification: true,
|
|
23
|
+
Dialog: true
|
|
22
24
|
};
|
|
25
|
+
Object.defineProperty(exports, "Dialog", {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
get: function () {
|
|
28
|
+
return _Dialog.Dialog;
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
Object.defineProperty(exports, "Notification", {
|
|
32
|
+
enumerable: true,
|
|
33
|
+
get: function () {
|
|
34
|
+
return _Notification.Notification;
|
|
35
|
+
}
|
|
36
|
+
});
|
|
23
37
|
Object.defineProperty(exports, "StoryboardFunctionRegistryFactory", {
|
|
24
38
|
enumerable: true,
|
|
25
39
|
get: function () {
|
|
@@ -196,12 +210,14 @@ Object.keys(_history).forEach(function (key) {
|
|
|
196
210
|
});
|
|
197
211
|
});
|
|
198
212
|
var _Runtime = require("./internal/Runtime.js");
|
|
199
|
-
var
|
|
200
|
-
exports.__secret_internals =
|
|
213
|
+
var __secret_internals = _interopRequireWildcard(require("./internal/secret_internals.js"));
|
|
214
|
+
exports.__secret_internals = __secret_internals;
|
|
201
215
|
var _themeAndMode = require("./themeAndMode.js");
|
|
202
216
|
var _checkIf = require("./internal/compute/checkIf.js");
|
|
203
217
|
var _WidgetFunctions = require("./internal/compute/WidgetFunctions.js");
|
|
204
218
|
var _WidgetI18n = require("./internal/compute/WidgetI18n.js");
|
|
205
219
|
var _StoryboardFunctionRegistry = require("./StoryboardFunctionRegistry.js");
|
|
206
220
|
var _matchPath = require("./internal/matchPath.js");
|
|
221
|
+
var _Notification = require("./Notification.js");
|
|
222
|
+
var _Dialog = require("./Dialog.js");
|
|
207
223
|
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_auth","require","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_CustomProcessors","_CustomTemplates","_fetchByProvider","_getBasePath","_getPageInfo","_handleHttpError","_history","_Runtime","
|
|
1
|
+
{"version":3,"file":"index.js","names":["_auth","require","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_CustomProcessors","_CustomTemplates","_fetchByProvider","_getBasePath","_getPageInfo","_handleHttpError","_history","_Runtime","__secret_internals","_interopRequireWildcard","_themeAndMode","_checkIf","_WidgetFunctions","_WidgetI18n","_StoryboardFunctionRegistry","_matchPath","_Notification","_Dialog"],"sources":["../../src/index.ts"],"sourcesContent":["export * from \"./auth.js\";\nexport * from \"./CustomProcessors.js\";\nexport * from \"./CustomTemplates.js\";\nexport * from \"./fetchByProvider.js\";\nexport * from \"./getBasePath.js\";\nexport * from \"./getPageInfo.js\";\nexport * from \"./handleHttpError.js\";\nexport * from \"./history.js\";\nexport { createRuntime, getRuntime } from \"./internal/Runtime.js\";\nimport * as __secret_internals from \"./internal/secret_internals.js\";\nexport { __secret_internals };\nexport {\n getCssPropertyValue,\n getCurrentTheme,\n getCurrentMode,\n batchSetAppsLocalTheme,\n applyTheme,\n} from \"./themeAndMode.js\";\nexport {\n checkIfOfComputed,\n checkIfByTransform,\n} from \"./internal/compute/checkIf.js\";\nexport { registerWidgetFunctions } from \"./internal/compute/WidgetFunctions.js\";\nexport { registerWidgetI18n } from \"./internal/compute/WidgetI18n.js\";\nexport { StoryboardFunctionRegistryFactory } from \"./StoryboardFunctionRegistry.js\";\nexport { matchPath } from \"./internal/matchPath.js\";\nexport { Notification, type NotificationOptions } from \"./Notification.js\";\nexport { Dialog, type DialogOptions } from \"./Dialog.js\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,KAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAL,KAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAb,KAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAS,iBAAA,GAAAb,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAW,iBAAA,EAAAV,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAS,iBAAA,CAAAT,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,iBAAA,CAAAT,GAAA;IAAA;EAAA;AAAA;AACA,IAAAU,gBAAA,GAAAd,OAAA;AAAAC,MAAA,CA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AA,OAAA,CAAAL,GAAA,MAAAe,QAAA,CAAAf,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAO,QAAA,CAAAf,GAAA;IAAA;EAAA;AAAA;AACA,IAAAgB,QAAA,GAAApB,OAAA;AACA,IAAAqB,kBAAA,GAAAC,uBAAA,CAAAtB,OAAA;AAAqES,OAAA,CAAAY,kBAAA,GAAAA,kBAAA;AAErE,IAAAE,aAAA,GAAAvB,OAAA;AAOA,IAAAwB,QAAA,GAAAxB,OAAA;AAIA,IAAAyB,gBAAA,GAAAzB,OAAA;AACA,IAAA0B,WAAA,GAAA1B,OAAA;AACA,IAAA2B,2BAAA,GAAA3B,OAAA;AACA,IAAA4B,UAAA,GAAA5B,OAAA;AACA,IAAA6B,aAAA,GAAA7B,OAAA;AACA,IAAA8B,OAAA,GAAA9B,OAAA"}
|
|
@@ -30,7 +30,7 @@ function getTplHostElement(runtimeContext, using, extraInfo) {
|
|
|
30
30
|
}
|
|
31
31
|
function getTagNameOfCustomTemplate(brick, appId) {
|
|
32
32
|
// When a template is registered by an app, it's namespace maybe missed.
|
|
33
|
-
if (!brick.includes(".") && appId) {
|
|
33
|
+
if (!brick.includes(".") && brick.startsWith("tpl-") && appId) {
|
|
34
34
|
const tagName = `${appId}.${brick}`;
|
|
35
35
|
if (_CustomTemplates.customTemplates.get(tagName)) {
|
|
36
36
|
return tagName;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","names":["_CustomTemplates","require","getTplStateStore","tplStateStoreId","tplStateStoreMap","using","extraInfo","Error","store","get","getTplHostElement","runtimeContext","hostElement","hostBrick","element","getTagNameOfCustomTemplate","brick","appId","includes","tagName","customTemplates"],"sources":["../../../../src/internal/CustomTemplates/utils.ts"],"sourcesContent":["import type { DataStore } from \"../data/DataStore.js\";\nimport type { RuntimeBrickElement, RuntimeContext } from \"../interfaces.js\";\nimport { customTemplates } from \"../../CustomTemplates.js\";\n\ntype MinimalTplStateStoreContext = Pick<\n RuntimeContext,\n \"tplStateStoreId\" | \"tplStateStoreMap\"\n>;\n\nexport function getTplStateStore(\n { tplStateStoreId, tplStateStoreMap }: MinimalTplStateStoreContext,\n using: string,\n extraInfo?: string\n): DataStore<\"STATE\"> {\n if (!tplStateStoreId) {\n throw new Error(\n `Using \"${using}\" outside of a custom template${extraInfo ?? \"\"}`\n );\n }\n const store = tplStateStoreMap.get(tplStateStoreId);\n if (!store) {\n throw new Error(\n `Template state store is not found when using \"${using}\"${\n extraInfo ?? \"\"\n }.\\nThis is a bug of Brick Next, please report it.`\n );\n }\n return store!;\n}\n\nexport function getTplHostElement(\n runtimeContext: MinimalTplStateStoreContext,\n using: string,\n extraInfo?: string\n): RuntimeBrickElement {\n const store = getTplStateStore(runtimeContext, using, extraInfo);\n const hostElement = store.hostBrick!.element;\n if (!hostElement) {\n throw new Error(\n `Template host element is gone when using \"${using}\"${\n extraInfo ?? \"\"\n }.\\nThis is a bug of Brick Next, please report it.`\n );\n }\n return hostElement!;\n}\n\nexport function getTagNameOfCustomTemplate(\n brick: string,\n appId?: string\n): false | string {\n // When a template is registered by an app, it's namespace maybe missed.\n if (!brick.includes(\".\") && appId) {\n const tagName = `${appId}.${brick}`;\n if (customTemplates.get(tagName)) {\n return tagName;\n }\n }\n if (customTemplates.get(brick)) {\n return brick;\n }\n return false;\n}\n"],"mappings":";;;;;;;;AAEA,IAAAA,gBAAA,GAAAC,OAAA;AAOO,SAASC,gBAAgBA,CAC9B;EAAEC,eAAe;EAAEC;AAA8C,CAAC,EAClEC,KAAa,EACbC,SAAkB,EACE;EACpB,IAAI,CAACH,eAAe,EAAE;IACpB,MAAM,IAAII,KAAK,CACZ,UAASF,KAAM,iCAAgCC,SAAS,aAATA,SAAS,cAATA,SAAS,GAAI,EAAG,EAAC,CAClE;EACH;EACA,MAAME,KAAK,GAAGJ,gBAAgB,CAACK,GAAG,CAACN,eAAe,CAAC;EACnD,IAAI,CAACK,KAAK,EAAE;IACV,MAAM,IAAID,KAAK,CACZ,iDAAgDF,KAAM,IACrDC,SAAS,aAATA,SAAS,cAATA,SAAS,GAAI,EACd,mDAAkD,CACpD;EACH;EACA,OAAOE,KAAK;AACd;AAEO,SAASE,iBAAiBA,CAC/BC,cAA2C,EAC3CN,KAAa,EACbC,SAAkB,EACG;EACrB,MAAME,KAAK,GAAGN,gBAAgB,CAACS,cAAc,EAAEN,KAAK,EAAEC,SAAS,CAAC;EAChE,MAAMM,WAAW,GAAGJ,KAAK,CAACK,SAAS,CAAEC,OAAO;EAC5C,IAAI,CAACF,WAAW,EAAE;IAChB,MAAM,IAAIL,KAAK,CACZ,6CAA4CF,KAAM,IACjDC,SAAS,aAATA,SAAS,cAATA,SAAS,GAAI,EACd,mDAAkD,CACpD;EACH;EACA,OAAOM,WAAW;AACpB;AAEO,SAASG,0BAA0BA,CACxCC,KAAa,EACbC,KAAc,EACE;EAChB;EACA,IAAI,CAACD,KAAK,CAACE,QAAQ,CAAC,GAAG,CAAC,
|
|
1
|
+
{"version":3,"file":"utils.js","names":["_CustomTemplates","require","getTplStateStore","tplStateStoreId","tplStateStoreMap","using","extraInfo","Error","store","get","getTplHostElement","runtimeContext","hostElement","hostBrick","element","getTagNameOfCustomTemplate","brick","appId","includes","startsWith","tagName","customTemplates"],"sources":["../../../../src/internal/CustomTemplates/utils.ts"],"sourcesContent":["import type { DataStore } from \"../data/DataStore.js\";\nimport type { RuntimeBrickElement, RuntimeContext } from \"../interfaces.js\";\nimport { customTemplates } from \"../../CustomTemplates.js\";\n\ntype MinimalTplStateStoreContext = Pick<\n RuntimeContext,\n \"tplStateStoreId\" | \"tplStateStoreMap\"\n>;\n\nexport function getTplStateStore(\n { tplStateStoreId, tplStateStoreMap }: MinimalTplStateStoreContext,\n using: string,\n extraInfo?: string\n): DataStore<\"STATE\"> {\n if (!tplStateStoreId) {\n throw new Error(\n `Using \"${using}\" outside of a custom template${extraInfo ?? \"\"}`\n );\n }\n const store = tplStateStoreMap.get(tplStateStoreId);\n if (!store) {\n throw new Error(\n `Template state store is not found when using \"${using}\"${\n extraInfo ?? \"\"\n }.\\nThis is a bug of Brick Next, please report it.`\n );\n }\n return store!;\n}\n\nexport function getTplHostElement(\n runtimeContext: MinimalTplStateStoreContext,\n using: string,\n extraInfo?: string\n): RuntimeBrickElement {\n const store = getTplStateStore(runtimeContext, using, extraInfo);\n const hostElement = store.hostBrick!.element;\n if (!hostElement) {\n throw new Error(\n `Template host element is gone when using \"${using}\"${\n extraInfo ?? \"\"\n }.\\nThis is a bug of Brick Next, please report it.`\n );\n }\n return hostElement!;\n}\n\nexport function getTagNameOfCustomTemplate(\n brick: string,\n appId?: string\n): false | string {\n // When a template is registered by an app, it's namespace maybe missed.\n if (!brick.includes(\".\") && brick.startsWith(\"tpl-\") && appId) {\n const tagName = `${appId}.${brick}`;\n if (customTemplates.get(tagName)) {\n return tagName;\n }\n }\n if (customTemplates.get(brick)) {\n return brick;\n }\n return false;\n}\n"],"mappings":";;;;;;;;AAEA,IAAAA,gBAAA,GAAAC,OAAA;AAOO,SAASC,gBAAgBA,CAC9B;EAAEC,eAAe;EAAEC;AAA8C,CAAC,EAClEC,KAAa,EACbC,SAAkB,EACE;EACpB,IAAI,CAACH,eAAe,EAAE;IACpB,MAAM,IAAII,KAAK,CACZ,UAASF,KAAM,iCAAgCC,SAAS,aAATA,SAAS,cAATA,SAAS,GAAI,EAAG,EAAC,CAClE;EACH;EACA,MAAME,KAAK,GAAGJ,gBAAgB,CAACK,GAAG,CAACN,eAAe,CAAC;EACnD,IAAI,CAACK,KAAK,EAAE;IACV,MAAM,IAAID,KAAK,CACZ,iDAAgDF,KAAM,IACrDC,SAAS,aAATA,SAAS,cAATA,SAAS,GAAI,EACd,mDAAkD,CACpD;EACH;EACA,OAAOE,KAAK;AACd;AAEO,SAASE,iBAAiBA,CAC/BC,cAA2C,EAC3CN,KAAa,EACbC,SAAkB,EACG;EACrB,MAAME,KAAK,GAAGN,gBAAgB,CAACS,cAAc,EAAEN,KAAK,EAAEC,SAAS,CAAC;EAChE,MAAMM,WAAW,GAAGJ,KAAK,CAACK,SAAS,CAAEC,OAAO;EAC5C,IAAI,CAACF,WAAW,EAAE;IAChB,MAAM,IAAIL,KAAK,CACZ,6CAA4CF,KAAM,IACjDC,SAAS,aAATA,SAAS,cAATA,SAAS,GAAI,EACd,mDAAkD,CACpD;EACH;EACA,OAAOM,WAAW;AACpB;AAEO,SAASG,0BAA0BA,CACxCC,KAAa,EACbC,KAAc,EACE;EAChB;EACA,IAAI,CAACD,KAAK,CAACE,QAAQ,CAAC,GAAG,CAAC,IAAIF,KAAK,CAACG,UAAU,CAAC,MAAM,CAAC,IAAIF,KAAK,EAAE;IAC7D,MAAMG,OAAO,GAAI,GAAEH,KAAM,IAAGD,KAAM,EAAC;IACnC,IAAIK,gCAAe,CAACZ,GAAG,CAACW,OAAO,CAAC,EAAE;MAChC,OAAOA,OAAO;IAChB;EACF;EACA,IAAIC,gCAAe,CAACZ,GAAG,CAACO,KAAK,CAAC,EAAE;IAC9B,OAAOA,KAAK;EACd;EACA,OAAO,KAAK;AACd"}
|
|
@@ -215,7 +215,7 @@ async function renderBrick(returnNode, brickConf, _runtimeContext, rendererConte
|
|
|
215
215
|
return controlledOutput;
|
|
216
216
|
}
|
|
217
217
|
|
|
218
|
-
//
|
|
218
|
+
// Widgets need to be defined before rendering.
|
|
219
219
|
if (/\.tpl-/.test(brickName) && !_CustomTemplates.customTemplates.get(brickName)) {
|
|
220
220
|
await (0, _loader.loadBricksImperatively)([brickName], (0, _Runtime.getBrickPackages)());
|
|
221
221
|
}
|
|
@@ -227,8 +227,7 @@ async function renderBrick(returnNode, brickConf, _runtimeContext, rendererConte
|
|
|
227
227
|
throw new Error(`Maximum custom template stack overflowed: "${tplTagName}"`);
|
|
228
228
|
}
|
|
229
229
|
tplStack.set(tplTagName, tplCount + 1);
|
|
230
|
-
}
|
|
231
|
-
if (brickName.includes(".")) {
|
|
230
|
+
} else if (brickName.includes("-") && !customElements.get(brickName)) {
|
|
232
231
|
output.blockingList.push((0, _loader.enqueueStableLoadBricks)([brickName], (0, _Runtime.getBrickPackages)()));
|
|
233
232
|
}
|
|
234
233
|
const brick = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Renderer.js","names":["_loader","require","_general","_lodash","_checkIf","_computeRealProperties","_resolveData","_computeRealValue","_checkPermissions","_listenOnTrackingContext","_matchRoutes","_constants","_expandCustomTemplate","_utils","_CustomTemplates","_Runtime","_enums","_getTracks","_isStrictMode","renderRoutes","returnNode","routes","_runtimeContext","rendererContext","slotId","matched","matchRoutes","output","blockingList","menuRequests","unauthenticated","route","runtimeContext","match","ctxStore","define","context","pendingPermissionsPreCheck","push","preCheckPermissionsForBrickOrRoute","type","redirectTo","redirect","asyncComputeRealValue","resolved","resolveData","transform","console","error","Error","path","loadMenu","menu","newOutput","mergeRenderOutput","renderBricks","bricks","tplStack","noMemoize","rendered","Promise","all","map","brickConf","index","renderBrick","Map","forEach","item","hasTrackingControls","memoizeControlNode","node","key","_runtimeContext$app","brick","template","tplStateStoreId","symbolForTplStateStoreId","hasOwnProperty","symbolForTPlExternalForEachItem","forEachItem","Array","isArray","length","strict","isStrictMode","warnAboutStrictMode","asyncCheckBrickIf","brickName","startsWith","ensureValidControlBrick","dataSource","renderControlNode","_slots$slot","computedDataSource","slot","String","slots","childrenToSlots","children","renderForEach","controlledOutput","contextNames","stateNames","getTracks","renderId","listener","currentRenderId","tplStateStoreMap","values","store","waitForAll","rerenderControlNode","debouncedListener","debounce","contextName","onChange","tplStateStore","getTplStateStore","test","customTemplates","get","loadBricksImperatively","getBrickPackages","tplTagName","getTagNameOfCustomTemplate","app","id","_tplStack$get","tplCount","set","includes","enqueueStableLoadBricks","tag","RenderTag","BRICK","return","events","portal","iid","ref","trackingContextList","loadProperties","properties","asyncComputeRealProperties","computedPropsFromHost","symbolForAsyncComputedPropsFromHost","_brick$properties","computed","propName","propValue","Object","entries","asyncProperties","then","listenOnTrackingContext","registerBrickLifeCycle","lifeCycle","expandedBrickConf","expandCustomTemplate","undefined","childRuntimeContext","loadChildren","childSlotId","slotConf","childrenOutput","child","i","j","flat","menuConf","warn","rest","last","sibling","assign","originalSlots","newSlots","process","env","NODE_ENV","_child$slot"],"sources":["../../../src/internal/Renderer.ts"],"sourcesContent":["import type {\n BrickConf,\n BrickConfInTemplate,\n ContextConf,\n MenuConf,\n RouteConf,\n SlotConfOfBricks,\n SlotsConf,\n StaticMenuConf,\n} from \"@next-core/types\";\nimport {\n enqueueStableLoadBricks,\n loadBricksImperatively,\n} from \"@next-core/loader\";\nimport { hasOwnProperty } from \"@next-core/utils/general\";\nimport { debounce } from \"lodash\";\nimport { asyncCheckBrickIf } from \"./compute/checkIf.js\";\nimport { asyncComputeRealProperties } from \"./compute/computeRealProperties.js\";\nimport { resolveData } from \"./data/resolveData.js\";\nimport { asyncComputeRealValue } from \"./compute/computeRealValue.js\";\nimport { preCheckPermissionsForBrickOrRoute } from \"./checkPermissions.js\";\nimport {\n TrackingContextItem,\n listenOnTrackingContext,\n} from \"./compute/listenOnTrackingContext.js\";\nimport { RendererContext } from \"./RendererContext.js\";\nimport { matchRoutes } from \"./matchRoutes.js\";\nimport {\n RuntimeBrickConfWithTplSymbols,\n symbolForAsyncComputedPropsFromHost,\n symbolForTPlExternalForEachItem,\n symbolForTplStateStoreId,\n} from \"./CustomTemplates/constants.js\";\nimport { expandCustomTemplate } from \"./CustomTemplates/expandCustomTemplate.js\";\nimport type { RenderBrick, RenderNode, RuntimeContext } from \"./interfaces.js\";\nimport {\n getTagNameOfCustomTemplate,\n getTplStateStore,\n} from \"./CustomTemplates/utils.js\";\nimport { customTemplates } from \"../CustomTemplates.js\";\nimport type { NextHistoryState } from \"./historyExtended.js\";\nimport { getBrickPackages } from \"./Runtime.js\";\nimport { RenderTag } from \"./enums.js\";\nimport { getTracks } from \"./compute/getTracks.js\";\nimport { isStrictMode, warnAboutStrictMode } from \"../isStrictMode.js\";\n\nexport interface RenderOutput {\n node?: RenderBrick;\n unauthenticated?: boolean;\n redirect?: {\n path: string;\n state?: NextHistoryState;\n };\n route?: RouteConf;\n blockingList: (Promise<unknown> | undefined)[];\n menuRequests: (Promise<StaticMenuConf | undefined> | undefined)[];\n hasTrackingControls?: boolean;\n}\n\nexport async function renderRoutes(\n returnNode: RenderNode,\n routes: RouteConf[],\n _runtimeContext: RuntimeContext,\n rendererContext: RendererContext,\n slotId?: string\n): Promise<RenderOutput> {\n const matched = await matchRoutes(routes, _runtimeContext);\n const output: RenderOutput = {\n blockingList: [],\n menuRequests: [],\n };\n switch (matched) {\n case \"missed\":\n break;\n case \"unauthenticated\":\n output.unauthenticated = true;\n break;\n default: {\n const route = (output.route = matched.route);\n const runtimeContext = {\n ..._runtimeContext,\n match: matched.match,\n };\n runtimeContext.ctxStore.define(route.context, runtimeContext);\n runtimeContext.pendingPermissionsPreCheck.push(\n preCheckPermissionsForBrickOrRoute(route, runtimeContext)\n );\n switch (route.type) {\n case \"redirect\": {\n let redirectTo: unknown;\n if (typeof route.redirect === \"string\") {\n redirectTo = await asyncComputeRealValue(\n route.redirect,\n runtimeContext\n );\n } else {\n const resolved = (await resolveData(\n {\n transform: \"redirect\",\n ...route.redirect,\n },\n runtimeContext\n )) as { redirect?: unknown };\n redirectTo = resolved.redirect;\n }\n if (typeof redirectTo !== \"string\") {\n // eslint-disable-next-line no-console\n console.error(\"Unexpected redirect result:\", redirectTo);\n throw new Error(\n `Unexpected type of redirect result: ${typeof redirectTo}`\n );\n }\n output.redirect = { path: redirectTo };\n break;\n }\n case \"routes\": {\n output.menuRequests.push(loadMenu(route.menu, runtimeContext));\n const newOutput = await renderRoutes(\n returnNode,\n route.routes,\n runtimeContext,\n rendererContext,\n slotId\n );\n mergeRenderOutput(output, newOutput);\n break;\n }\n default: {\n output.menuRequests.push(loadMenu(route.menu, runtimeContext));\n const newOutput = await renderBricks(\n returnNode,\n route.bricks,\n runtimeContext,\n rendererContext,\n slotId\n );\n mergeRenderOutput(output, newOutput);\n }\n }\n }\n }\n return output;\n}\n\nexport async function renderBricks(\n returnNode: RenderNode,\n bricks: BrickConf[],\n runtimeContext: RuntimeContext,\n rendererContext: RendererContext,\n slotId?: string,\n tplStack?: Map<string, number>,\n noMemoize?: boolean\n): Promise<RenderOutput> {\n const output: RenderOutput = {\n blockingList: [],\n menuRequests: [],\n };\n // 多个构件并行异步转换,但转换的结果按原顺序串行合并。\n const rendered = await Promise.all(\n bricks.map((brickConf, index) =>\n renderBrick(\n returnNode,\n brickConf,\n runtimeContext,\n rendererContext,\n slotId,\n index,\n tplStack && new Map(tplStack)\n )\n )\n );\n\n rendered.forEach((item, index) => {\n if (!noMemoize && item.hasTrackingControls) {\n // Memoize a render node before it's been merged.\n rendererContext.memoizeControlNode(slotId, index, item.node, returnNode);\n }\n mergeRenderOutput(output, item);\n });\n\n return output;\n}\n\nexport async function renderBrick(\n returnNode: RenderNode,\n brickConf: RuntimeBrickConfWithTplSymbols,\n _runtimeContext: RuntimeContext,\n rendererContext: RendererContext,\n slotId?: string,\n key?: number,\n tplStack = new Map<string, number>()\n): Promise<RenderOutput> {\n const output: RenderOutput = {\n blockingList: [],\n menuRequests: [],\n };\n\n if (!brickConf.brick) {\n if ((brickConf as { template?: string }).template) {\n // eslint-disable-next-line no-console\n console.error(\"Legacy templates are dropped in v3:\", brickConf);\n } else {\n // eslint-disable-next-line no-console\n console.error(\"Invalid brick:\", brickConf);\n }\n return output;\n }\n\n const tplStateStoreId = brickConf[symbolForTplStateStoreId];\n const runtimeContext = {\n ..._runtimeContext,\n tplStateStoreId,\n };\n\n if (hasOwnProperty(brickConf, symbolForTPlExternalForEachItem)) {\n // The external bricks of a template should restore their `forEachItem`\n // from their host.\n runtimeContext.forEachItem = brickConf[symbolForTPlExternalForEachItem];\n }\n\n const { context } = brickConf as { context?: ContextConf[] };\n // istanbul ignore next\n if (Array.isArray(context) && context.length > 0) {\n const strict = isStrictMode(runtimeContext);\n warnAboutStrictMode(\n strict,\n \"Defining context on bricks\",\n \"check your brick:\",\n brickConf\n );\n if (!strict) {\n runtimeContext.ctxStore.define(context, runtimeContext);\n }\n }\n\n runtimeContext.pendingPermissionsPreCheck.push(\n preCheckPermissionsForBrickOrRoute(brickConf, runtimeContext)\n );\n\n if (!(await asyncCheckBrickIf(brickConf, runtimeContext))) {\n return output;\n }\n\n const brickName = brickConf.brick;\n if (brickName.startsWith(\":\")) {\n ensureValidControlBrick(brickName);\n\n const { dataSource } = brickConf;\n\n const renderControlNode = async () => {\n // First, compute the `dataSource`\n const computedDataSource = await asyncComputeRealValue(\n dataSource,\n runtimeContext\n );\n\n // Then, get the matched slot.\n const slot =\n brickName === \":forEach\"\n ? \"\"\n : brickName === \":switch\"\n ? String(computedDataSource)\n : computedDataSource\n ? \"\"\n : \"else\";\n\n // Don't forget to transpile children to slots.\n const slots = childrenToSlots(brickConf.children, brickConf.slots);\n\n // Then, get the bricks in that matched slot.\n const bricks =\n slots &&\n hasOwnProperty(slots, slot) &&\n (slots[slot] as SlotConfOfBricks)?.bricks;\n\n if (!Array.isArray(bricks)) {\n return output;\n }\n\n switch (brickName) {\n case \":forEach\": {\n if (!Array.isArray(computedDataSource)) {\n return output;\n }\n return renderForEach(\n returnNode,\n computedDataSource,\n bricks,\n runtimeContext,\n rendererContext,\n slotId,\n tplStack\n );\n }\n case \":if\":\n case \":switch\": {\n return renderBricks(\n returnNode,\n bricks,\n runtimeContext,\n rendererContext,\n slotId,\n tplStack,\n true\n );\n }\n }\n };\n\n const controlledOutput = await renderControlNode();\n\n const { contextNames, stateNames } = getTracks(dataSource);\n if (contextNames || stateNames) {\n controlledOutput.hasTrackingControls = true;\n let renderId = 0;\n const listener = async () => {\n const currentRenderId = ++renderId;\n const output = await renderControlNode();\n output.blockingList.push(\n ...[...runtimeContext.tplStateStoreMap.values()].map((store) =>\n store.waitForAll()\n ),\n ...runtimeContext.pendingPermissionsPreCheck\n );\n await Promise.all(output.blockingList);\n // Ignore stale renders\n if (renderId === currentRenderId) {\n rendererContext.rerenderControlNode(\n slotId,\n key as number,\n output.node,\n returnNode\n );\n }\n };\n const debouncedListener = debounce(listener);\n if (contextNames) {\n for (const contextName of contextNames) {\n runtimeContext.ctxStore.onChange(contextName, debouncedListener);\n }\n }\n if (stateNames) {\n for (const contextName of stateNames) {\n const tplStateStore = getTplStateStore(\n runtimeContext,\n \"STATE\",\n `: \"${dataSource}\"`\n );\n tplStateStore.onChange(contextName, debouncedListener);\n }\n }\n }\n\n return controlledOutput;\n }\n\n // Custom templates need to be defined before rendering.\n if (/\\.tpl-/.test(brickName) && !customTemplates.get(brickName)) {\n await loadBricksImperatively([brickName], getBrickPackages());\n }\n\n const tplTagName = getTagNameOfCustomTemplate(\n brickName,\n runtimeContext.app?.id\n );\n\n if (tplTagName) {\n const tplCount = tplStack.get(tplTagName) ?? 0;\n if (tplCount >= 10) {\n throw new Error(\n `Maximum custom template stack overflowed: \"${tplTagName}\"`\n );\n }\n tplStack.set(tplTagName, tplCount + 1);\n }\n\n if (brickName.includes(\".\")) {\n output.blockingList.push(\n enqueueStableLoadBricks([brickName], getBrickPackages())\n );\n }\n\n const brick: RenderBrick = {\n tag: RenderTag.BRICK,\n type: tplTagName || brickName,\n return: returnNode,\n slotId,\n events: brickConf.events,\n runtimeContext,\n portal: brickConf.portal,\n iid: brickConf.iid,\n ref: (brickConf as BrickConfInTemplate).ref,\n };\n\n output.node = brick;\n\n // 加载构件属性和加载子构件等任务,可以并行。\n const blockingList: Promise<unknown>[] = [];\n\n const trackingContextList: TrackingContextItem[] = [];\n const loadProperties = async () => {\n brick.properties = await asyncComputeRealProperties(\n brickConf.properties,\n runtimeContext,\n trackingContextList\n );\n const computedPropsFromHost =\n brickConf[symbolForAsyncComputedPropsFromHost];\n if (computedPropsFromHost) {\n brick.properties ??= {};\n const computed = await computedPropsFromHost;\n for (const [propName, propValue] of Object.entries(computed)) {\n brick.properties[propName] = propValue;\n }\n }\n return brick.properties;\n };\n const asyncProperties = loadProperties();\n blockingList.push(asyncProperties);\n\n asyncProperties.then(() => {\n listenOnTrackingContext(brick, trackingContextList);\n });\n\n rendererContext.registerBrickLifeCycle(brick, brickConf.lifeCycle);\n\n let expandedBrickConf = brickConf;\n if (tplTagName) {\n expandedBrickConf = expandCustomTemplate(\n tplTagName,\n brickConf,\n brick,\n asyncProperties\n );\n }\n\n if (expandedBrickConf.portal) {\n // A portal brick has no slotId.\n brick.slotId = undefined;\n }\n\n let childRuntimeContext: RuntimeContext;\n if (tplTagName) {\n // There is a boundary for `forEachItem` between template internals and externals.\n childRuntimeContext = {\n ...runtimeContext,\n };\n delete childRuntimeContext.forEachItem;\n } else {\n childRuntimeContext = runtimeContext;\n }\n\n const loadChildren = async () => {\n const slots = childrenToSlots(\n expandedBrickConf.children,\n expandedBrickConf.slots\n );\n if (!slots) {\n return;\n }\n const rendered = await Promise.all(\n Object.entries(slots).map(([childSlotId, slotConf]) =>\n slotConf.type !== \"routes\"\n ? renderBricks(\n brick,\n (slotConf as SlotConfOfBricks).bricks,\n childRuntimeContext,\n rendererContext,\n childSlotId,\n tplStack\n )\n : renderRoutes(\n brick,\n slotConf.routes,\n childRuntimeContext,\n rendererContext,\n childSlotId\n )\n )\n );\n\n const childrenOutput: RenderOutput = {\n ...output,\n node: undefined,\n blockingList: [],\n };\n for (const item of rendered) {\n mergeRenderOutput(childrenOutput, item);\n }\n if (childrenOutput.node) {\n brick.child = childrenOutput.node;\n }\n mergeRenderOutput(output, {\n ...childrenOutput,\n node: undefined,\n });\n };\n blockingList.push(loadChildren());\n\n await Promise.all(blockingList);\n\n return output;\n}\n\ntype ValidControlBrick = \":forEach\" | \":if\" | \":switch\";\n\nfunction ensureValidControlBrick(\n brick: string\n): asserts brick is ValidControlBrick {\n if (brick !== \":forEach\" && brick !== \":if\" && brick !== \":switch\") {\n throw new Error(`Unknown storyboard control node: \"${brick}\"`);\n }\n}\n\nasync function renderForEach(\n returnNode: RenderNode,\n dataSource: unknown[],\n bricks: BrickConf[],\n runtimeContext: RuntimeContext,\n rendererContext: RendererContext,\n slotId: string | undefined,\n tplStack?: Map<string, number>\n): Promise<RenderOutput> {\n const output: RenderOutput = {\n blockingList: [],\n menuRequests: [],\n };\n\n const rendered = await Promise.all(\n dataSource.map((item, i) =>\n Promise.all(\n bricks.map((brickConf, j) =>\n renderBrick(\n returnNode,\n brickConf,\n {\n ...runtimeContext,\n forEachItem: item,\n },\n rendererContext,\n slotId,\n i * j,\n tplStack && new Map(tplStack)\n )\n )\n )\n )\n );\n\n // 多层构件并行异步转换,但转换的结果按原顺序串行合并。\n for (const item of rendered.flat()) {\n mergeRenderOutput(output, item);\n }\n return output;\n}\n\nfunction loadMenu(\n menuConf: MenuConf | undefined,\n runtimeContext: RuntimeContext\n) {\n if (!menuConf) {\n return;\n }\n\n // istanbul ignore next\n if ((menuConf as { type?: \"brick\" }).type === \"brick\") {\n // eslint-disable-next-line no-console\n console.error(\"Set menu with brick is dropped in v3:\", menuConf);\n throw new Error(\"Set menu with brick is dropped in v3\");\n }\n\n // istanbul ignore next\n if (menuConf.type === \"resolve\") {\n // eslint-disable-next-line no-console\n console.warn(\"Set menu with resolve is not supported in v3 yet:\", menuConf);\n return;\n }\n\n return asyncComputeRealValue(\n menuConf,\n runtimeContext\n ) as Promise<StaticMenuConf>;\n}\n\nfunction mergeRenderOutput(\n output: RenderOutput,\n newOutput: RenderOutput\n): void {\n const { blockingList, node, menuRequests, hasTrackingControls, ...rest } =\n newOutput;\n output.blockingList.push(...blockingList);\n output.menuRequests.push(...menuRequests);\n\n if (node) {\n if (output.node) {\n let last = output.node;\n while (last.sibling) {\n last = last.sibling;\n }\n last.sibling = node;\n } else {\n output.node = node;\n }\n }\n\n Object.assign(output, rest);\n}\n\nexport function childrenToSlots(\n children: BrickConf[] | undefined,\n originalSlots: SlotsConf | undefined\n) {\n let newSlots = originalSlots;\n // istanbul ignore next\n if (\n process.env.NODE_ENV === \"development\" &&\n children &&\n !Array.isArray(children)\n ) {\n // eslint-disable-next-line no-console\n console.warn(\n \"Specified brick children but not array:\",\n `<${typeof children}>`,\n children\n );\n }\n if (Array.isArray(children) && !newSlots) {\n newSlots = {};\n for (const child of children) {\n const slot = child.slot ?? \"\";\n if (!hasOwnProperty(newSlots, slot)) {\n newSlots[slot] = {\n type: \"bricks\",\n bricks: [],\n };\n }\n (newSlots[slot] as SlotConfOfBricks).bricks.push(child);\n }\n }\n return newSlots;\n}\n"],"mappings":";;;;;;;;;AAUA,IAAAA,OAAA,GAAAC,OAAA;AAIA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,sBAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AACA,IAAAM,iBAAA,GAAAN,OAAA;AACA,IAAAO,iBAAA,GAAAP,OAAA;AACA,IAAAQ,wBAAA,GAAAR,OAAA;AAKA,IAAAS,YAAA,GAAAT,OAAA;AACA,IAAAU,UAAA,GAAAV,OAAA;AAMA,IAAAW,qBAAA,GAAAX,OAAA;AAEA,IAAAY,MAAA,GAAAZ,OAAA;AAIA,IAAAa,gBAAA,GAAAb,OAAA;AAEA,IAAAc,QAAA,GAAAd,OAAA;AACA,IAAAe,MAAA,GAAAf,OAAA;AACA,IAAAgB,UAAA,GAAAhB,OAAA;AACA,IAAAiB,aAAA,GAAAjB,OAAA;AAeO,eAAekB,YAAYA,CAChCC,UAAsB,EACtBC,MAAmB,EACnBC,eAA+B,EAC/BC,eAAgC,EAChCC,MAAe,EACQ;EACvB,MAAMC,OAAO,GAAG,MAAM,IAAAC,wBAAW,EAACL,MAAM,EAAEC,eAAe,CAAC;EAC1D,MAAMK,MAAoB,GAAG;IAC3BC,YAAY,EAAE,EAAE;IAChBC,YAAY,EAAE;EAChB,CAAC;EACD,QAAQJ,OAAO;IACb,KAAK,QAAQ;MACX;IACF,KAAK,iBAAiB;MACpBE,MA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AOW,QAAQ;AACjB"}
|
|
1
|
+
{"version":3,"file":"Renderer.js","names":["_loader","require","_general","_lodash","_checkIf","_computeRealProperties","_resolveData","_computeRealValue","_checkPermissions","_listenOnTrackingContext","_matchRoutes","_constants","_expandCustomTemplate","_utils","_CustomTemplates","_Runtime","_enums","_getTracks","_isStrictMode","renderRoutes","returnNode","routes","_runtimeContext","rendererContext","slotId","matched","matchRoutes","output","blockingList","menuRequests","unauthenticated","route","runtimeContext","match","ctxStore","define","context","pendingPermissionsPreCheck","push","preCheckPermissionsForBrickOrRoute","type","redirectTo","redirect","asyncComputeRealValue","resolved","resolveData","transform","console","error","Error","path","loadMenu","menu","newOutput","mergeRenderOutput","renderBricks","bricks","tplStack","noMemoize","rendered","Promise","all","map","brickConf","index","renderBrick","Map","forEach","item","hasTrackingControls","memoizeControlNode","node","key","_runtimeContext$app","brick","template","tplStateStoreId","symbolForTplStateStoreId","hasOwnProperty","symbolForTPlExternalForEachItem","forEachItem","Array","isArray","length","strict","isStrictMode","warnAboutStrictMode","asyncCheckBrickIf","brickName","startsWith","ensureValidControlBrick","dataSource","renderControlNode","_slots$slot","computedDataSource","slot","String","slots","childrenToSlots","children","renderForEach","controlledOutput","contextNames","stateNames","getTracks","renderId","listener","currentRenderId","tplStateStoreMap","values","store","waitForAll","rerenderControlNode","debouncedListener","debounce","contextName","onChange","tplStateStore","getTplStateStore","test","customTemplates","get","loadBricksImperatively","getBrickPackages","tplTagName","getTagNameOfCustomTemplate","app","id","_tplStack$get","tplCount","set","includes","customElements","enqueueStableLoadBricks","tag","RenderTag","BRICK","return","events","portal","iid","ref","trackingContextList","loadProperties","properties","asyncComputeRealProperties","computedPropsFromHost","symbolForAsyncComputedPropsFromHost","_brick$properties","computed","propName","propValue","Object","entries","asyncProperties","then","listenOnTrackingContext","registerBrickLifeCycle","lifeCycle","expandedBrickConf","expandCustomTemplate","undefined","childRuntimeContext","loadChildren","childSlotId","slotConf","childrenOutput","child","i","j","flat","menuConf","warn","rest","last","sibling","assign","originalSlots","newSlots","process","env","NODE_ENV","_child$slot"],"sources":["../../../src/internal/Renderer.ts"],"sourcesContent":["import type {\n BrickConf,\n BrickConfInTemplate,\n ContextConf,\n MenuConf,\n RouteConf,\n SlotConfOfBricks,\n SlotsConf,\n StaticMenuConf,\n} from \"@next-core/types\";\nimport {\n enqueueStableLoadBricks,\n loadBricksImperatively,\n} from \"@next-core/loader\";\nimport { hasOwnProperty } from \"@next-core/utils/general\";\nimport { debounce } from \"lodash\";\nimport { asyncCheckBrickIf } from \"./compute/checkIf.js\";\nimport { asyncComputeRealProperties } from \"./compute/computeRealProperties.js\";\nimport { resolveData } from \"./data/resolveData.js\";\nimport { asyncComputeRealValue } from \"./compute/computeRealValue.js\";\nimport { preCheckPermissionsForBrickOrRoute } from \"./checkPermissions.js\";\nimport {\n TrackingContextItem,\n listenOnTrackingContext,\n} from \"./compute/listenOnTrackingContext.js\";\nimport { RendererContext } from \"./RendererContext.js\";\nimport { matchRoutes } from \"./matchRoutes.js\";\nimport {\n RuntimeBrickConfWithTplSymbols,\n symbolForAsyncComputedPropsFromHost,\n symbolForTPlExternalForEachItem,\n symbolForTplStateStoreId,\n} from \"./CustomTemplates/constants.js\";\nimport { expandCustomTemplate } from \"./CustomTemplates/expandCustomTemplate.js\";\nimport type { RenderBrick, RenderNode, RuntimeContext } from \"./interfaces.js\";\nimport {\n getTagNameOfCustomTemplate,\n getTplStateStore,\n} from \"./CustomTemplates/utils.js\";\nimport { customTemplates } from \"../CustomTemplates.js\";\nimport type { NextHistoryState } from \"./historyExtended.js\";\nimport { getBrickPackages } from \"./Runtime.js\";\nimport { RenderTag } from \"./enums.js\";\nimport { getTracks } from \"./compute/getTracks.js\";\nimport { isStrictMode, warnAboutStrictMode } from \"../isStrictMode.js\";\n\nexport interface RenderOutput {\n node?: RenderBrick;\n unauthenticated?: boolean;\n redirect?: {\n path: string;\n state?: NextHistoryState;\n };\n route?: RouteConf;\n blockingList: (Promise<unknown> | undefined)[];\n menuRequests: (Promise<StaticMenuConf | undefined> | undefined)[];\n hasTrackingControls?: boolean;\n}\n\nexport async function renderRoutes(\n returnNode: RenderNode,\n routes: RouteConf[],\n _runtimeContext: RuntimeContext,\n rendererContext: RendererContext,\n slotId?: string\n): Promise<RenderOutput> {\n const matched = await matchRoutes(routes, _runtimeContext);\n const output: RenderOutput = {\n blockingList: [],\n menuRequests: [],\n };\n switch (matched) {\n case \"missed\":\n break;\n case \"unauthenticated\":\n output.unauthenticated = true;\n break;\n default: {\n const route = (output.route = matched.route);\n const runtimeContext = {\n ..._runtimeContext,\n match: matched.match,\n };\n runtimeContext.ctxStore.define(route.context, runtimeContext);\n runtimeContext.pendingPermissionsPreCheck.push(\n preCheckPermissionsForBrickOrRoute(route, runtimeContext)\n );\n switch (route.type) {\n case \"redirect\": {\n let redirectTo: unknown;\n if (typeof route.redirect === \"string\") {\n redirectTo = await asyncComputeRealValue(\n route.redirect,\n runtimeContext\n );\n } else {\n const resolved = (await resolveData(\n {\n transform: \"redirect\",\n ...route.redirect,\n },\n runtimeContext\n )) as { redirect?: unknown };\n redirectTo = resolved.redirect;\n }\n if (typeof redirectTo !== \"string\") {\n // eslint-disable-next-line no-console\n console.error(\"Unexpected redirect result:\", redirectTo);\n throw new Error(\n `Unexpected type of redirect result: ${typeof redirectTo}`\n );\n }\n output.redirect = { path: redirectTo };\n break;\n }\n case \"routes\": {\n output.menuRequests.push(loadMenu(route.menu, runtimeContext));\n const newOutput = await renderRoutes(\n returnNode,\n route.routes,\n runtimeContext,\n rendererContext,\n slotId\n );\n mergeRenderOutput(output, newOutput);\n break;\n }\n default: {\n output.menuRequests.push(loadMenu(route.menu, runtimeContext));\n const newOutput = await renderBricks(\n returnNode,\n route.bricks,\n runtimeContext,\n rendererContext,\n slotId\n );\n mergeRenderOutput(output, newOutput);\n }\n }\n }\n }\n return output;\n}\n\nexport async function renderBricks(\n returnNode: RenderNode,\n bricks: BrickConf[],\n runtimeContext: RuntimeContext,\n rendererContext: RendererContext,\n slotId?: string,\n tplStack?: Map<string, number>,\n noMemoize?: boolean\n): Promise<RenderOutput> {\n const output: RenderOutput = {\n blockingList: [],\n menuRequests: [],\n };\n // 多个构件并行异步转换,但转换的结果按原顺序串行合并。\n const rendered = await Promise.all(\n bricks.map((brickConf, index) =>\n renderBrick(\n returnNode,\n brickConf,\n runtimeContext,\n rendererContext,\n slotId,\n index,\n tplStack && new Map(tplStack)\n )\n )\n );\n\n rendered.forEach((item, index) => {\n if (!noMemoize && item.hasTrackingControls) {\n // Memoize a render node before it's been merged.\n rendererContext.memoizeControlNode(slotId, index, item.node, returnNode);\n }\n mergeRenderOutput(output, item);\n });\n\n return output;\n}\n\nexport async function renderBrick(\n returnNode: RenderNode,\n brickConf: RuntimeBrickConfWithTplSymbols,\n _runtimeContext: RuntimeContext,\n rendererContext: RendererContext,\n slotId?: string,\n key?: number,\n tplStack = new Map<string, number>()\n): Promise<RenderOutput> {\n const output: RenderOutput = {\n blockingList: [],\n menuRequests: [],\n };\n\n if (!brickConf.brick) {\n if ((brickConf as { template?: string }).template) {\n // eslint-disable-next-line no-console\n console.error(\"Legacy templates are dropped in v3:\", brickConf);\n } else {\n // eslint-disable-next-line no-console\n console.error(\"Invalid brick:\", brickConf);\n }\n return output;\n }\n\n const tplStateStoreId = brickConf[symbolForTplStateStoreId];\n const runtimeContext = {\n ..._runtimeContext,\n tplStateStoreId,\n };\n\n if (hasOwnProperty(brickConf, symbolForTPlExternalForEachItem)) {\n // The external bricks of a template should restore their `forEachItem`\n // from their host.\n runtimeContext.forEachItem = brickConf[symbolForTPlExternalForEachItem];\n }\n\n const { context } = brickConf as { context?: ContextConf[] };\n // istanbul ignore next\n if (Array.isArray(context) && context.length > 0) {\n const strict = isStrictMode(runtimeContext);\n warnAboutStrictMode(\n strict,\n \"Defining context on bricks\",\n \"check your brick:\",\n brickConf\n );\n if (!strict) {\n runtimeContext.ctxStore.define(context, runtimeContext);\n }\n }\n\n runtimeContext.pendingPermissionsPreCheck.push(\n preCheckPermissionsForBrickOrRoute(brickConf, runtimeContext)\n );\n\n if (!(await asyncCheckBrickIf(brickConf, runtimeContext))) {\n return output;\n }\n\n const brickName = brickConf.brick;\n if (brickName.startsWith(\":\")) {\n ensureValidControlBrick(brickName);\n\n const { dataSource } = brickConf;\n\n const renderControlNode = async () => {\n // First, compute the `dataSource`\n const computedDataSource = await asyncComputeRealValue(\n dataSource,\n runtimeContext\n );\n\n // Then, get the matched slot.\n const slot =\n brickName === \":forEach\"\n ? \"\"\n : brickName === \":switch\"\n ? String(computedDataSource)\n : computedDataSource\n ? \"\"\n : \"else\";\n\n // Don't forget to transpile children to slots.\n const slots = childrenToSlots(brickConf.children, brickConf.slots);\n\n // Then, get the bricks in that matched slot.\n const bricks =\n slots &&\n hasOwnProperty(slots, slot) &&\n (slots[slot] as SlotConfOfBricks)?.bricks;\n\n if (!Array.isArray(bricks)) {\n return output;\n }\n\n switch (brickName) {\n case \":forEach\": {\n if (!Array.isArray(computedDataSource)) {\n return output;\n }\n return renderForEach(\n returnNode,\n computedDataSource,\n bricks,\n runtimeContext,\n rendererContext,\n slotId,\n tplStack\n );\n }\n case \":if\":\n case \":switch\": {\n return renderBricks(\n returnNode,\n bricks,\n runtimeContext,\n rendererContext,\n slotId,\n tplStack,\n true\n );\n }\n }\n };\n\n const controlledOutput = await renderControlNode();\n\n const { contextNames, stateNames } = getTracks(dataSource);\n if (contextNames || stateNames) {\n controlledOutput.hasTrackingControls = true;\n let renderId = 0;\n const listener = async () => {\n const currentRenderId = ++renderId;\n const output = await renderControlNode();\n output.blockingList.push(\n ...[...runtimeContext.tplStateStoreMap.values()].map((store) =>\n store.waitForAll()\n ),\n ...runtimeContext.pendingPermissionsPreCheck\n );\n await Promise.all(output.blockingList);\n // Ignore stale renders\n if (renderId === currentRenderId) {\n rendererContext.rerenderControlNode(\n slotId,\n key as number,\n output.node,\n returnNode\n );\n }\n };\n const debouncedListener = debounce(listener);\n if (contextNames) {\n for (const contextName of contextNames) {\n runtimeContext.ctxStore.onChange(contextName, debouncedListener);\n }\n }\n if (stateNames) {\n for (const contextName of stateNames) {\n const tplStateStore = getTplStateStore(\n runtimeContext,\n \"STATE\",\n `: \"${dataSource}\"`\n );\n tplStateStore.onChange(contextName, debouncedListener);\n }\n }\n }\n\n return controlledOutput;\n }\n\n // Widgets need to be defined before rendering.\n if (/\\.tpl-/.test(brickName) && !customTemplates.get(brickName)) {\n await loadBricksImperatively([brickName], getBrickPackages());\n }\n\n const tplTagName = getTagNameOfCustomTemplate(\n brickName,\n runtimeContext.app?.id\n );\n\n if (tplTagName) {\n const tplCount = tplStack.get(tplTagName) ?? 0;\n if (tplCount >= 10) {\n throw new Error(\n `Maximum custom template stack overflowed: \"${tplTagName}\"`\n );\n }\n tplStack.set(tplTagName, tplCount + 1);\n } else if (brickName.includes(\"-\") && !customElements.get(brickName)) {\n output.blockingList.push(\n enqueueStableLoadBricks([brickName], getBrickPackages())\n );\n }\n\n const brick: RenderBrick = {\n tag: RenderTag.BRICK,\n type: tplTagName || brickName,\n return: returnNode,\n slotId,\n events: brickConf.events,\n runtimeContext,\n portal: brickConf.portal,\n iid: brickConf.iid,\n ref: (brickConf as BrickConfInTemplate).ref,\n };\n\n output.node = brick;\n\n // 加载构件属性和加载子构件等任务,可以并行。\n const blockingList: Promise<unknown>[] = [];\n\n const trackingContextList: TrackingContextItem[] = [];\n const loadProperties = async () => {\n brick.properties = await asyncComputeRealProperties(\n brickConf.properties,\n runtimeContext,\n trackingContextList\n );\n const computedPropsFromHost =\n brickConf[symbolForAsyncComputedPropsFromHost];\n if (computedPropsFromHost) {\n brick.properties ??= {};\n const computed = await computedPropsFromHost;\n for (const [propName, propValue] of Object.entries(computed)) {\n brick.properties[propName] = propValue;\n }\n }\n return brick.properties;\n };\n const asyncProperties = loadProperties();\n blockingList.push(asyncProperties);\n\n asyncProperties.then(() => {\n listenOnTrackingContext(brick, trackingContextList);\n });\n\n rendererContext.registerBrickLifeCycle(brick, brickConf.lifeCycle);\n\n let expandedBrickConf = brickConf;\n if (tplTagName) {\n expandedBrickConf = expandCustomTemplate(\n tplTagName,\n brickConf,\n brick,\n asyncProperties\n );\n }\n\n if (expandedBrickConf.portal) {\n // A portal brick has no slotId.\n brick.slotId = undefined;\n }\n\n let childRuntimeContext: RuntimeContext;\n if (tplTagName) {\n // There is a boundary for `forEachItem` between template internals and externals.\n childRuntimeContext = {\n ...runtimeContext,\n };\n delete childRuntimeContext.forEachItem;\n } else {\n childRuntimeContext = runtimeContext;\n }\n\n const loadChildren = async () => {\n const slots = childrenToSlots(\n expandedBrickConf.children,\n expandedBrickConf.slots\n );\n if (!slots) {\n return;\n }\n const rendered = await Promise.all(\n Object.entries(slots).map(([childSlotId, slotConf]) =>\n slotConf.type !== \"routes\"\n ? renderBricks(\n brick,\n (slotConf as SlotConfOfBricks).bricks,\n childRuntimeContext,\n rendererContext,\n childSlotId,\n tplStack\n )\n : renderRoutes(\n brick,\n slotConf.routes,\n childRuntimeContext,\n rendererContext,\n childSlotId\n )\n )\n );\n\n const childrenOutput: RenderOutput = {\n ...output,\n node: undefined,\n blockingList: [],\n };\n for (const item of rendered) {\n mergeRenderOutput(childrenOutput, item);\n }\n if (childrenOutput.node) {\n brick.child = childrenOutput.node;\n }\n mergeRenderOutput(output, {\n ...childrenOutput,\n node: undefined,\n });\n };\n blockingList.push(loadChildren());\n\n await Promise.all(blockingList);\n\n return output;\n}\n\ntype ValidControlBrick = \":forEach\" | \":if\" | \":switch\";\n\nfunction ensureValidControlBrick(\n brick: string\n): asserts brick is ValidControlBrick {\n if (brick !== \":forEach\" && brick !== \":if\" && brick !== \":switch\") {\n throw new Error(`Unknown storyboard control node: \"${brick}\"`);\n }\n}\n\nasync function renderForEach(\n returnNode: RenderNode,\n dataSource: unknown[],\n bricks: BrickConf[],\n runtimeContext: RuntimeContext,\n rendererContext: RendererContext,\n slotId: string | undefined,\n tplStack?: Map<string, number>\n): Promise<RenderOutput> {\n const output: RenderOutput = {\n blockingList: [],\n menuRequests: [],\n };\n\n const rendered = await Promise.all(\n dataSource.map((item, i) =>\n Promise.all(\n bricks.map((brickConf, j) =>\n renderBrick(\n returnNode,\n brickConf,\n {\n ...runtimeContext,\n forEachItem: item,\n },\n rendererContext,\n slotId,\n i * j,\n tplStack && new Map(tplStack)\n )\n )\n )\n )\n );\n\n // 多层构件并行异步转换,但转换的结果按原顺序串行合并。\n for (const item of rendered.flat()) {\n mergeRenderOutput(output, item);\n }\n return output;\n}\n\nfunction loadMenu(\n menuConf: MenuConf | undefined,\n runtimeContext: RuntimeContext\n) {\n if (!menuConf) {\n return;\n }\n\n // istanbul ignore next\n if ((menuConf as { type?: \"brick\" }).type === \"brick\") {\n // eslint-disable-next-line no-console\n console.error(\"Set menu with brick is dropped in v3:\", menuConf);\n throw new Error(\"Set menu with brick is dropped in v3\");\n }\n\n // istanbul ignore next\n if (menuConf.type === \"resolve\") {\n // eslint-disable-next-line no-console\n console.warn(\"Set menu with resolve is not supported in v3 yet:\", menuConf);\n return;\n }\n\n return asyncComputeRealValue(\n menuConf,\n runtimeContext\n ) as Promise<StaticMenuConf>;\n}\n\nfunction mergeRenderOutput(\n output: RenderOutput,\n newOutput: RenderOutput\n): void {\n const { blockingList, node, menuRequests, hasTrackingControls, ...rest } =\n newOutput;\n output.blockingList.push(...blockingList);\n output.menuRequests.push(...menuRequests);\n\n if (node) {\n if (output.node) {\n let last = output.node;\n while (last.sibling) {\n last = last.sibling;\n }\n last.sibling = node;\n } else {\n output.node = node;\n }\n }\n\n Object.assign(output, rest);\n}\n\nexport function childrenToSlots(\n children: BrickConf[] | undefined,\n originalSlots: SlotsConf | undefined\n) {\n let newSlots = originalSlots;\n // istanbul ignore next\n if (\n process.env.NODE_ENV === \"development\" &&\n children &&\n !Array.isArray(children)\n ) {\n // eslint-disable-next-line no-console\n console.warn(\n \"Specified brick children but not array:\",\n `<${typeof children}>`,\n children\n );\n }\n if (Array.isArray(children) && !newSlots) {\n newSlots = {};\n for (const child of children) {\n const slot = child.slot ?? \"\";\n if (!hasOwnProperty(newSlots, slot)) {\n newSlots[slot] = {\n type: \"bricks\",\n bricks: [],\n };\n }\n (newSlots[slot] as SlotConfOfBricks).bricks.push(child);\n }\n }\n return newSlots;\n}\n"],"mappings":";;;;;;;;;AAUA,IAAAA,OAAA,GAAAC,OAAA;AAIA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,sBAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AACA,IAAAM,iBAAA,GAAAN,OAAA;AACA,IAAAO,iBAAA,GAAAP,OAAA;AACA,IAAAQ,wBAAA,GAAAR,OAAA;AAKA,IAAAS,YAAA,GAAAT,OAAA;AACA,IAAAU,UAAA,GAAAV,OAAA;AAMA,IAAAW,qBAAA,GAAAX,OAAA;AAEA,IAAAY,MAAA,GAAAZ,OAAA;AAIA,IAAAa,gBAAA,GAAAb,OAAA;AAEA,IAAAc,QAAA,GAAAd,OAAA;AACA,IAAAe,MAAA,GAAAf,OAAA;AACA,IAAAgB,UAAA,GAAAhB,OAAA;AACA,IAAAiB,aAAA,GAAAjB,OAAA;AAeO,eAAekB,YAAYA,CAChCC,UAAsB,EACtBC,MAAmB,EACnBC,eAA+B,EAC/BC,eAAgC,EAChCC,MAAe,EACQ;EACvB,MAAMC,OAAO,GAAG,MAAM,IAAAC,wBAAW,EAACL,MAAM,EAAEC,eAAe,CAAC;EAC1D,MAAMK,MAAoB,GAAG;IAC3BC,YAAY,EAAE,EAAE;IAChBC,YAAY,EAAE;EAChB,CAAC;EACD,QAAQJ,OAAO;IACb,KAAK,QAAQ;MACX;IACF,KAAK,iBAAiB;MACpBE,MAAM,CAACG,eAAe,GAAG,IAAI;MAC7B;IACF;MAAS;QACP,MAAMC,KAAK,GAAIJ,MAAM,CAACI,KAAK,GAAGN,OAAO,CAACM,KAAM;QAC5C,MAAMC,cAAc,GAAG;UACrB,GAAG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