@next-core/runtime 1.44.2 → 1.44.3
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/CustomProcessors.js.map +1 -1
- package/dist/cjs/CustomTemplates.js +7 -11
- package/dist/cjs/CustomTemplates.js.map +1 -1
- package/dist/cjs/createRoot.js +4 -4
- package/dist/cjs/createRoot.js.map +1 -1
- package/dist/cjs/getPageInfo.js.map +1 -1
- package/dist/cjs/handleHttpError.js.map +1 -1
- package/dist/cjs/internal/CustomTemplates/bindTemplateProxy.js +4 -5
- package/dist/cjs/internal/CustomTemplates/bindTemplateProxy.js.map +1 -1
- package/dist/cjs/internal/CustomTemplates/expandCustomTemplate.js +4 -7
- package/dist/cjs/internal/CustomTemplates/expandCustomTemplate.js.map +1 -1
- package/dist/cjs/internal/CustomTemplates/setupTemplateProxy.js +21 -24
- package/dist/cjs/internal/CustomTemplates/setupTemplateProxy.js.map +1 -1
- package/dist/cjs/internal/CustomTemplates/setupUseBrickInTemplate.js +4 -7
- package/dist/cjs/internal/CustomTemplates/setupUseBrickInTemplate.js.map +1 -1
- package/dist/cjs/internal/CustomTemplates/utils.js +3 -3
- package/dist/cjs/internal/CustomTemplates/utils.js.map +1 -1
- package/dist/cjs/internal/FormRenderer/expandFormRenderer.js +3 -3
- package/dist/cjs/internal/FormRenderer/expandFormRenderer.js.map +1 -1
- package/dist/cjs/internal/FormRenderer/utils.js +2 -2
- package/dist/cjs/internal/FormRenderer/utils.js.map +1 -1
- package/dist/cjs/internal/Renderer.js +8 -14
- package/dist/cjs/internal/Renderer.js.map +1 -1
- package/dist/cjs/internal/RendererContext.js +8 -10
- package/dist/cjs/internal/RendererContext.js.map +1 -1
- package/dist/cjs/internal/Router.js.map +1 -1
- package/dist/cjs/internal/Runtime.js +14 -14
- package/dist/cjs/internal/Runtime.js.map +1 -1
- package/dist/cjs/internal/bindListeners.js +2 -3
- package/dist/cjs/internal/bindListeners.js.map +1 -1
- package/dist/cjs/internal/compute/WidgetFunctions.js.map +1 -1
- package/dist/cjs/internal/compute/evaluate.js +4 -4
- package/dist/cjs/internal/compute/evaluate.js.map +1 -1
- package/dist/cjs/internal/compute/getGeneralGlobals.js.map +1 -1
- package/dist/cjs/internal/compute/getStorageItem.js +1 -2
- package/dist/cjs/internal/compute/getStorageItem.js.map +1 -1
- package/dist/cjs/internal/compute/listenOnTrackingContext.js.map +1 -1
- package/dist/cjs/internal/compute/setRealProperties.js.map +1 -1
- package/dist/cjs/internal/data/DataStore.js.map +1 -1
- package/dist/cjs/internal/data/getProviderBrick.js.map +1 -1
- package/dist/cjs/internal/data/realTimeDataInspect.js.map +1 -1
- package/dist/cjs/internal/data/resolveData.js.map +1 -1
- package/dist/cjs/internal/data/resolveDataStore.js +2 -4
- package/dist/cjs/internal/data/resolveDataStore.js.map +1 -1
- package/dist/cjs/internal/hasInstalledApp.js.map +1 -1
- package/dist/cjs/internal/historyExtended.js.map +1 -1
- package/dist/cjs/internal/matchPath.js.map +1 -1
- package/dist/cjs/internal/matchRoutes.js.map +1 -1
- package/dist/cjs/internal/matchStoryboard.js +2 -2
- package/dist/cjs/internal/matchStoryboard.js.map +1 -1
- package/dist/cjs/internal/mediaQuery.js.map +1 -1
- package/dist/cjs/internal/mount.js.map +1 -1
- package/dist/cjs/internal/poll.js +3 -3
- package/dist/cjs/internal/poll.js.map +1 -1
- package/dist/cjs/internal/registerAppI18n.js.map +1 -1
- package/dist/cjs/internal/registerCustomTemplates.js.map +1 -1
- package/dist/cjs/internal/secret_internals.js +4 -4
- package/dist/cjs/internal/secret_internals.js.map +1 -1
- package/dist/cjs/internal/setupRootRuntimeContext.js +2 -3
- package/dist/cjs/internal/setupRootRuntimeContext.js.map +1 -1
- package/dist/cjs/isStrictMode.js.map +1 -1
- package/dist/cjs/setLoginStateCookie.js.map +1 -1
- package/dist/cjs/setWatermark.js +4 -4
- package/dist/cjs/setWatermark.js.map +1 -1
- package/dist/cjs/themeAndMode.js +1 -2
- package/dist/cjs/themeAndMode.js.map +1 -1
- package/dist/esm/CustomProcessors.js +5 -5
- package/dist/esm/CustomProcessors.js.map +1 -1
- package/dist/esm/CustomTemplates.js +48 -58
- package/dist/esm/CustomTemplates.js.map +1 -1
- package/dist/esm/Dialog.js +3 -3
- package/dist/esm/Dialog.js.map +1 -1
- package/dist/esm/Notification.js +2 -2
- package/dist/esm/Notification.js.map +1 -1
- package/dist/esm/StoryboardFunctionRegistry.js +18 -18
- package/dist/esm/StoryboardFunctionRegistry.js.map +1 -1
- package/dist/esm/createRoot.js +125 -129
- package/dist/esm/createRoot.js.map +1 -1
- package/dist/esm/fetchByProvider.js +3 -10
- package/dist/esm/fetchByProvider.js.map +1 -1
- package/dist/esm/getBasePath.js +2 -2
- package/dist/esm/getBasePath.js.map +1 -1
- package/dist/esm/getPageInfo.js +5 -5
- package/dist/esm/getPageInfo.js.map +1 -1
- package/dist/esm/getRealValue.js +7 -6
- package/dist/esm/getRealValue.js.map +1 -1
- package/dist/esm/getV2RuntimeFromDll.js +1 -1
- package/dist/esm/getV2RuntimeFromDll.js.map +1 -1
- package/dist/esm/handleHttpError.js +11 -11
- package/dist/esm/handleHttpError.js.map +1 -1
- package/dist/esm/history.js +4 -4
- package/dist/esm/history.js.map +1 -1
- package/dist/esm/internal/CustomTemplates/bindTemplateProxy.js +13 -17
- package/dist/esm/internal/CustomTemplates/bindTemplateProxy.js.map +1 -1
- package/dist/esm/internal/CustomTemplates/constants.js +5 -5
- package/dist/esm/internal/CustomTemplates/constants.js.map +1 -1
- package/dist/esm/internal/CustomTemplates/expandCustomTemplate.js +41 -42
- package/dist/esm/internal/CustomTemplates/expandCustomTemplate.js.map +1 -1
- package/dist/esm/internal/CustomTemplates/setupTemplateProxy.js +43 -46
- package/dist/esm/internal/CustomTemplates/setupTemplateProxy.js.map +1 -1
- package/dist/esm/internal/CustomTemplates/setupUseBrickInTemplate.js +16 -18
- package/dist/esm/internal/CustomTemplates/setupUseBrickInTemplate.js.map +1 -1
- package/dist/esm/internal/CustomTemplates/utils.js +8 -8
- package/dist/esm/internal/CustomTemplates/utils.js.map +1 -1
- package/dist/esm/internal/FormRenderer/constants.js +2 -2
- package/dist/esm/internal/FormRenderer/constants.js.map +1 -1
- package/dist/esm/internal/FormRenderer/expandFormRenderer.js +28 -23
- package/dist/esm/internal/FormRenderer/expandFormRenderer.js.map +1 -1
- package/dist/esm/internal/FormRenderer/getDefaultProperties.js +45 -22
- package/dist/esm/internal/FormRenderer/getDefaultProperties.js.map +1 -1
- package/dist/esm/internal/FormRenderer/utils.js +4 -4
- package/dist/esm/internal/FormRenderer/utils.js.map +1 -1
- package/dist/esm/internal/Renderer.js +517 -580
- package/dist/esm/internal/Renderer.js.map +1 -1
- package/dist/esm/internal/RendererContext.js +132 -148
- package/dist/esm/internal/RendererContext.js.map +1 -1
- package/dist/esm/internal/Router.js +325 -346
- package/dist/esm/internal/Router.js.map +1 -1
- package/dist/esm/internal/Runtime.js +53 -51
- package/dist/esm/internal/Runtime.js.map +1 -1
- package/dist/esm/internal/abortController.js +7 -6
- package/dist/esm/internal/abortController.js.map +1 -1
- package/dist/esm/internal/bindListeners.js +136 -156
- package/dist/esm/internal/bindListeners.js.map +1 -1
- package/dist/esm/internal/compute/StoryboardFunctions.js +1 -1
- package/dist/esm/internal/compute/StoryboardFunctions.js.map +1 -1
- package/dist/esm/internal/compute/WidgetFunctions.js +6 -6
- package/dist/esm/internal/compute/WidgetFunctions.js.map +1 -1
- package/dist/esm/internal/compute/WidgetI18n.js +4 -4
- package/dist/esm/internal/compute/WidgetI18n.js.map +1 -1
- package/dist/esm/internal/compute/checkIf.js +10 -23
- package/dist/esm/internal/compute/checkIf.js.map +1 -1
- package/dist/esm/internal/compute/computeRealProperties.js +22 -35
- package/dist/esm/internal/compute/computeRealProperties.js.map +1 -1
- package/dist/esm/internal/compute/computeRealValue.js +42 -49
- package/dist/esm/internal/compute/computeRealValue.js.map +1 -1
- package/dist/esm/internal/compute/evaluate.js +71 -75
- package/dist/esm/internal/compute/evaluate.js.map +1 -1
- package/dist/esm/internal/compute/getGeneralGlobals.js +5 -5
- package/dist/esm/internal/compute/getGeneralGlobals.js.map +1 -1
- package/dist/esm/internal/compute/getNextStateOfUseBrick.js +1 -1
- package/dist/esm/internal/compute/getStorageItem.js +2 -3
- package/dist/esm/internal/compute/getStorageItem.js.map +1 -1
- package/dist/esm/internal/compute/getTracks.js +5 -5
- package/dist/esm/internal/compute/getTracks.js.map +1 -1
- package/dist/esm/internal/compute/listenOnTrackingContext.js +8 -11
- package/dist/esm/internal/compute/listenOnTrackingContext.js.map +1 -1
- package/dist/esm/internal/compute/markAsComputed.js +2 -2
- package/dist/esm/internal/compute/markAsComputed.js.map +1 -1
- package/dist/esm/internal/compute/setProperties.js +1 -1
- package/dist/esm/internal/compute/setProperties.js.map +1 -1
- package/dist/esm/internal/compute/setRealProperties.js +3 -3
- package/dist/esm/internal/compute/setRealProperties.js.map +1 -1
- package/dist/esm/internal/customizeColorTheme.js +15 -13
- package/dist/esm/internal/customizeColorTheme.js.map +1 -1
- package/dist/esm/internal/data/DataStore.js +161 -177
- package/dist/esm/internal/data/DataStore.js.map +1 -1
- package/dist/esm/internal/data/getProviderBrick.js +21 -28
- package/dist/esm/internal/data/getProviderBrick.js.map +1 -1
- package/dist/esm/internal/data/realTimeDataInspect.js +5 -5
- package/dist/esm/internal/data/realTimeDataInspect.js.map +1 -1
- package/dist/esm/internal/data/resolveData.js +89 -103
- package/dist/esm/internal/data/resolveData.js.map +1 -1
- package/dist/esm/internal/data/resolveDataStore.js +53 -67
- package/dist/esm/internal/data/resolveDataStore.js.map +1 -1
- package/dist/esm/internal/devtools.js +9 -9
- package/dist/esm/internal/devtools.js.map +1 -1
- package/dist/esm/internal/enums.js +1 -1
- package/dist/esm/internal/fulfilStoryboard.js +15 -28
- package/dist/esm/internal/fulfilStoryboard.js.map +1 -1
- package/dist/esm/internal/hasInstalledApp.js +3 -3
- package/dist/esm/internal/hasInstalledApp.js.map +1 -1
- package/dist/esm/internal/historyExtended.js +40 -37
- package/dist/esm/internal/historyExtended.js.map +1 -1
- package/dist/esm/internal/i18n.js +5 -5
- package/dist/esm/internal/i18n.js.map +1 -1
- package/dist/esm/internal/injected.js +1 -1
- package/dist/esm/internal/injected.js.map +1 -1
- package/dist/esm/internal/insertPreviewRoutes.js +3 -3
- package/dist/esm/internal/insertPreviewRoutes.js.map +1 -1
- package/dist/esm/internal/matchPath.js +17 -17
- package/dist/esm/internal/matchPath.js.map +1 -1
- package/dist/esm/internal/matchRoutes.js +18 -25
- package/dist/esm/internal/matchRoutes.js.map +1 -1
- package/dist/esm/internal/matchStoryboard.js +6 -6
- package/dist/esm/internal/matchStoryboard.js.map +1 -1
- package/dist/esm/internal/mediaQuery.js +11 -11
- package/dist/esm/internal/mediaQuery.js.map +1 -1
- package/dist/esm/internal/mount.js +7 -7
- package/dist/esm/internal/mount.js.map +1 -1
- package/dist/esm/internal/poll.js +53 -60
- package/dist/esm/internal/poll.js.map +1 -1
- package/dist/esm/internal/proxyFactories.js +4 -4
- package/dist/esm/internal/proxyFactories.js.map +1 -1
- package/dist/esm/internal/registerAppI18n.js +6 -6
- package/dist/esm/internal/registerAppI18n.js.map +1 -1
- package/dist/esm/internal/registerCustomTemplates.js +3 -3
- package/dist/esm/internal/registerCustomTemplates.js.map +1 -1
- package/dist/esm/internal/secret_internals.js +140 -146
- package/dist/esm/internal/secret_internals.js.map +1 -1
- package/dist/esm/internal/setupRootRuntimeContext.js +6 -7
- package/dist/esm/internal/setupRootRuntimeContext.js.map +1 -1
- package/dist/esm/internal/sse.js +24 -53
- package/dist/esm/internal/sse.js.map +1 -1
- package/dist/esm/internal/test_only.js +1 -1
- package/dist/esm/isStrictMode.js +3 -3
- package/dist/esm/isStrictMode.js.map +1 -1
- package/dist/esm/setAppVariable.js +1 -1
- package/dist/esm/setAppVariable.js.map +1 -1
- package/dist/esm/setLoginStateCookie.js +5 -5
- package/dist/esm/setLoginStateCookie.js.map +1 -1
- package/dist/esm/setUIVersion.js +1 -1
- package/dist/esm/setWatermark.js +13 -13
- package/dist/esm/setWatermark.js.map +1 -1
- package/dist/esm/themeAndMode.js +14 -13
- package/dist/esm/themeAndMode.js.map +1 -1
- package/dist/types/tsdoc-metadata.json +1 -1
- package/package.json +12 -12
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
export
|
|
1
|
+
export let K = /*#__PURE__*/function (K) {
|
|
2
2
|
K["REQUEST_FAILED"] = "REQUEST_FAILED";
|
|
3
3
|
K["SOMETHING_WENT_WRONG"] = "SOMETHING_WENT_WRONG";
|
|
4
4
|
K["LOGIN_TIMEOUT_MESSAGE"] = "LOGIN_TIMEOUT_MESSAGE";
|
|
5
5
|
K["NETWORK_ERROR"] = "NETWORK_ERROR";
|
|
6
6
|
return K;
|
|
7
7
|
}({});
|
|
8
|
-
|
|
8
|
+
const en = {
|
|
9
9
|
[K.REQUEST_FAILED]: "Request Failed",
|
|
10
10
|
[K.SOMETHING_WENT_WRONG]: "Something went wrong!",
|
|
11
11
|
[K.LOGIN_TIMEOUT_MESSAGE]: "You haven't logged in or your login session has expired. Login right now?",
|
|
12
12
|
[K.NETWORK_ERROR]: "Network error, please check your network."
|
|
13
13
|
};
|
|
14
|
-
|
|
14
|
+
const zh = {
|
|
15
15
|
[K.REQUEST_FAILED]: "请求失败",
|
|
16
16
|
[K.SOMETHING_WENT_WRONG]: "出现了一些问题!",
|
|
17
17
|
[K.LOGIN_TIMEOUT_MESSAGE]: "您还未登录或登录信息已过期,现在重新登录?",
|
|
18
18
|
[K.NETWORK_ERROR]: "网络错误,请检查您的网络连接。"
|
|
19
19
|
};
|
|
20
|
-
export
|
|
21
|
-
export
|
|
20
|
+
export const NS = "core/runtime";
|
|
21
|
+
export const locales = {
|
|
22
22
|
en,
|
|
23
23
|
zh
|
|
24
24
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18n.js","names":["K","en","REQUEST_FAILED","SOMETHING_WENT_WRONG","LOGIN_TIMEOUT_MESSAGE","NETWORK_ERROR","zh","NS","locales"],"sources":["../../../src/internal/i18n.ts"],"sourcesContent":["export enum K {\n REQUEST_FAILED = \"REQUEST_FAILED\",\n SOMETHING_WENT_WRONG = \"SOMETHING_WENT_WRONG\",\n LOGIN_TIMEOUT_MESSAGE = \"LOGIN_TIMEOUT_MESSAGE\",\n NETWORK_ERROR = \"NETWORK_ERROR\",\n}\n\nconst en: Locale = {\n [K.REQUEST_FAILED]: \"Request Failed\",\n [K.SOMETHING_WENT_WRONG]: \"Something went wrong!\",\n [K.LOGIN_TIMEOUT_MESSAGE]:\n \"You haven't logged in or your login session has expired. Login right now?\",\n [K.NETWORK_ERROR]: \"Network error, please check your network.\",\n};\n\nconst zh: Locale = {\n [K.REQUEST_FAILED]: \"请求失败\",\n [K.SOMETHING_WENT_WRONG]: \"出现了一些问题!\",\n [K.LOGIN_TIMEOUT_MESSAGE]: \"您还未登录或登录信息已过期,现在重新登录?\",\n [K.NETWORK_ERROR]: \"网络错误,请检查您的网络连接。\",\n};\n\nexport const NS = \"core/runtime\";\n\nexport const locales = { en, zh };\n\ntype Locale = { [key in K]: string };\n"],"mappings":"AAAA,WAAYA,CAAC,0BAADA,CAAC;EAADA,CAAC;EAADA,CAAC;EAADA,CAAC;EAADA,CAAC;EAAA,OAADA,CAAC;AAAA;AAOb,
|
|
1
|
+
{"version":3,"file":"i18n.js","names":["K","en","REQUEST_FAILED","SOMETHING_WENT_WRONG","LOGIN_TIMEOUT_MESSAGE","NETWORK_ERROR","zh","NS","locales"],"sources":["../../../src/internal/i18n.ts"],"sourcesContent":["export enum K {\n REQUEST_FAILED = \"REQUEST_FAILED\",\n SOMETHING_WENT_WRONG = \"SOMETHING_WENT_WRONG\",\n LOGIN_TIMEOUT_MESSAGE = \"LOGIN_TIMEOUT_MESSAGE\",\n NETWORK_ERROR = \"NETWORK_ERROR\",\n}\n\nconst en: Locale = {\n [K.REQUEST_FAILED]: \"Request Failed\",\n [K.SOMETHING_WENT_WRONG]: \"Something went wrong!\",\n [K.LOGIN_TIMEOUT_MESSAGE]:\n \"You haven't logged in or your login session has expired. Login right now?\",\n [K.NETWORK_ERROR]: \"Network error, please check your network.\",\n};\n\nconst zh: Locale = {\n [K.REQUEST_FAILED]: \"请求失败\",\n [K.SOMETHING_WENT_WRONG]: \"出现了一些问题!\",\n [K.LOGIN_TIMEOUT_MESSAGE]: \"您还未登录或登录信息已过期,现在重新登录?\",\n [K.NETWORK_ERROR]: \"网络错误,请检查您的网络连接。\",\n};\n\nexport const NS = \"core/runtime\";\n\nexport const locales = { en, zh };\n\ntype Locale = { [key in K]: string };\n"],"mappings":"AAAA,WAAYA,CAAC,0BAADA,CAAC;EAADA,CAAC;EAADA,CAAC;EAADA,CAAC;EAADA,CAAC;EAAA,OAADA,CAAC;AAAA;AAOb,MAAMC,EAAU,GAAG;EACjB,CAACD,CAAC,CAACE,cAAc,GAAG,gBAAgB;EACpC,CAACF,CAAC,CAACG,oBAAoB,GAAG,uBAAuB;EACjD,CAACH,CAAC,CAACI,qBAAqB,GACtB,2EAA2E;EAC7E,CAACJ,CAAC,CAACK,aAAa,GAAG;AACrB,CAAC;AAED,MAAMC,EAAU,GAAG;EACjB,CAACN,CAAC,CAACE,cAAc,GAAG,MAAM;EAC1B,CAACF,CAAC,CAACG,oBAAoB,GAAG,UAAU;EACpC,CAACH,CAAC,CAACI,qBAAqB,GAAG,uBAAuB;EAClD,CAACJ,CAAC,CAACK,aAAa,GAAG;AACrB,CAAC;AAED,OAAO,MAAME,EAAE,GAAG,cAAc;AAEhC,OAAO,MAAMC,OAAO,GAAG;EAAEP,EAAE;EAAEK;AAAG,CAAC","ignoreList":[]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Allow inject brick packages in a runtime other than Brick Next.
|
|
2
|
-
export
|
|
2
|
+
export const injectedBrickPackages =
|
|
3
3
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
4
4
|
// @ts-ignore
|
|
5
5
|
typeof BRICK_PACKAGES !== "undefined" ? BRICK_PACKAGES : null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"injected.js","names":["injectedBrickPackages","BRICK_PACKAGES"],"sources":["../../../src/internal/injected.ts"],"sourcesContent":["import type { BrickPackage } from \"@next-core/types\";\n\n// Allow inject brick packages in a runtime other than Brick Next.\nexport const injectedBrickPackages: BrickPackage[] | null =\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n typeof BRICK_PACKAGES !== \"undefined\" ? BRICK_PACKAGES : null;\n"],"mappings":"AAEA;AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"injected.js","names":["injectedBrickPackages","BRICK_PACKAGES"],"sources":["../../../src/internal/injected.ts"],"sourcesContent":["import type { BrickPackage } from \"@next-core/types\";\n\n// Allow inject brick packages in a runtime other than Brick Next.\nexport const injectedBrickPackages: BrickPackage[] | null =\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n typeof BRICK_PACKAGES !== \"undefined\" ? BRICK_PACKAGES : null;\n"],"mappings":"AAEA;AACA,OAAO,MAAMA,qBAA4C;AACvD;AACA;AACA,OAAOC,cAAc,KAAK,WAAW,GAAGA,cAAc,GAAG,IAAI","ignoreList":[]}
|
|
@@ -4,8 +4,8 @@ export function insertPreviewRoutes(routes) {
|
|
|
4
4
|
if (window.parent === window) {
|
|
5
5
|
return routes;
|
|
6
6
|
}
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
let mergedRoutes = routes;
|
|
8
|
+
const specificTemplatePreviewIndex = findLastIndex(mergedRoutes, route => route.path.startsWith("${APP.homepage}/_dev_only_/template-preview/"));
|
|
9
9
|
mergedRoutes = [...mergedRoutes.slice(0, specificTemplatePreviewIndex + 1), {
|
|
10
10
|
path: "${APP.homepage}/_dev_only_/template-preview/:templateId",
|
|
11
11
|
bricks: [{
|
|
@@ -14,7 +14,7 @@ export function insertPreviewRoutes(routes) {
|
|
|
14
14
|
menu: false,
|
|
15
15
|
exact: true
|
|
16
16
|
}, ...mergedRoutes.slice(specificTemplatePreviewIndex + 1)];
|
|
17
|
-
|
|
17
|
+
const specificSnippetPreviewIndex = findLastIndex(mergedRoutes, route => route.path.startsWith("${APP.homepage}/_dev_only_/snippet-preview/"));
|
|
18
18
|
mergedRoutes = [...mergedRoutes.slice(0, specificSnippetPreviewIndex + 1), {
|
|
19
19
|
path: "${APP.homepage}/_dev_only_/snippet-preview/:snippetId",
|
|
20
20
|
bricks: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"insertPreviewRoutes.js","names":["findLastIndex","insertPreviewRoutes","routes","window","parent","mergedRoutes","specificTemplatePreviewIndex","route","path","startsWith","slice","bricks","brick","menu","exact","specificSnippetPreviewIndex"],"sources":["../../../src/internal/insertPreviewRoutes.ts"],"sourcesContent":["import { findLastIndex } from \"lodash\";\nimport type { RouteConf } from \"@next-core/types\";\n\nexport function insertPreviewRoutes(routes: RouteConf[]): RouteConf[] {\n // Insert preview routes for iframe only.\n if (window.parent === window) {\n return routes;\n }\n\n let mergedRoutes = routes;\n\n const specificTemplatePreviewIndex = findLastIndex(mergedRoutes, (route) =>\n route.path.startsWith(\"${APP.homepage}/_dev_only_/template-preview/\")\n );\n mergedRoutes = [\n ...mergedRoutes.slice(0, specificTemplatePreviewIndex + 1),\n {\n path: \"${APP.homepage}/_dev_only_/template-preview/:templateId\",\n bricks: [{ brick: \"span\" }],\n menu: false,\n exact: true,\n } as RouteConf,\n ...mergedRoutes.slice(specificTemplatePreviewIndex + 1),\n ];\n\n const specificSnippetPreviewIndex = findLastIndex(mergedRoutes, (route) =>\n route.path.startsWith(\"${APP.homepage}/_dev_only_/snippet-preview/\")\n );\n mergedRoutes = [\n ...mergedRoutes.slice(0, specificSnippetPreviewIndex + 1),\n {\n path: \"${APP.homepage}/_dev_only_/snippet-preview/:snippetId\",\n bricks: [{ brick: \"span\" }],\n menu: false,\n exact: true,\n } as RouteConf,\n ...mergedRoutes.slice(specificSnippetPreviewIndex + 1),\n ];\n\n return mergedRoutes;\n}\n"],"mappings":"AAAA,SAASA,aAAa,QAAQ,QAAQ;AAGtC,OAAO,SAASC,mBAAmBA,CAACC,MAAmB,EAAe;EACpE;EACA,IAAIC,MAAM,CAACC,MAAM,KAAKD,MAAM,EAAE;IAC5B,OAAOD,MAAM;EACf;EAEA,IAAIG,YAAY,GAAGH,MAAM;EAEzB,
|
|
1
|
+
{"version":3,"file":"insertPreviewRoutes.js","names":["findLastIndex","insertPreviewRoutes","routes","window","parent","mergedRoutes","specificTemplatePreviewIndex","route","path","startsWith","slice","bricks","brick","menu","exact","specificSnippetPreviewIndex"],"sources":["../../../src/internal/insertPreviewRoutes.ts"],"sourcesContent":["import { findLastIndex } from \"lodash\";\nimport type { RouteConf } from \"@next-core/types\";\n\nexport function insertPreviewRoutes(routes: RouteConf[]): RouteConf[] {\n // Insert preview routes for iframe only.\n if (window.parent === window) {\n return routes;\n }\n\n let mergedRoutes = routes;\n\n const specificTemplatePreviewIndex = findLastIndex(mergedRoutes, (route) =>\n route.path.startsWith(\"${APP.homepage}/_dev_only_/template-preview/\")\n );\n mergedRoutes = [\n ...mergedRoutes.slice(0, specificTemplatePreviewIndex + 1),\n {\n path: \"${APP.homepage}/_dev_only_/template-preview/:templateId\",\n bricks: [{ brick: \"span\" }],\n menu: false,\n exact: true,\n } as RouteConf,\n ...mergedRoutes.slice(specificTemplatePreviewIndex + 1),\n ];\n\n const specificSnippetPreviewIndex = findLastIndex(mergedRoutes, (route) =>\n route.path.startsWith(\"${APP.homepage}/_dev_only_/snippet-preview/\")\n );\n mergedRoutes = [\n ...mergedRoutes.slice(0, specificSnippetPreviewIndex + 1),\n {\n path: \"${APP.homepage}/_dev_only_/snippet-preview/:snippetId\",\n bricks: [{ brick: \"span\" }],\n menu: false,\n exact: true,\n } as RouteConf,\n ...mergedRoutes.slice(specificSnippetPreviewIndex + 1),\n ];\n\n return mergedRoutes;\n}\n"],"mappings":"AAAA,SAASA,aAAa,QAAQ,QAAQ;AAGtC,OAAO,SAASC,mBAAmBA,CAACC,MAAmB,EAAe;EACpE;EACA,IAAIC,MAAM,CAACC,MAAM,KAAKD,MAAM,EAAE;IAC5B,OAAOD,MAAM;EACf;EAEA,IAAIG,YAAY,GAAGH,MAAM;EAEzB,MAAMI,4BAA4B,GAAGN,aAAa,CAACK,YAAY,EAAGE,KAAK,IACrEA,KAAK,CAACC,IAAI,CAACC,UAAU,CAAC,8CAA8C,CACtE,CAAC;EACDJ,YAAY,GAAG,CACb,GAAGA,YAAY,CAACK,KAAK,CAAC,CAAC,EAAEJ,4BAA4B,GAAG,CAAC,CAAC,EAC1D;IACEE,IAAI,EAAE,yDAAyD;IAC/DG,MAAM,EAAE,CAAC;MAAEC,KAAK,EAAE;IAAO,CAAC,CAAC;IAC3BC,IAAI,EAAE,KAAK;IACXC,KAAK,EAAE;EACT,CAAC,EACD,GAAGT,YAAY,CAACK,KAAK,CAACJ,4BAA4B,GAAG,CAAC,CAAC,CACxD;EAED,MAAMS,2BAA2B,GAAGf,aAAa,CAACK,YAAY,EAAGE,KAAK,IACpEA,KAAK,CAACC,IAAI,CAACC,UAAU,CAAC,6CAA6C,CACrE,CAAC;EACDJ,YAAY,GAAG,CACb,GAAGA,YAAY,CAACK,KAAK,CAAC,CAAC,EAAEK,2BAA2B,GAAG,CAAC,CAAC,EACzD;IACEP,IAAI,EAAE,uDAAuD;IAC7DG,MAAM,EAAE,CAAC;MAAEC,KAAK,EAAE;IAAO,CAAC,CAAC;IAC3BC,IAAI,EAAE,KAAK;IACXC,KAAK,EAAE;EACT,CAAC,EACD,GAAGT,YAAY,CAACK,KAAK,CAACK,2BAA2B,GAAG,CAAC,CAAC,CACvD;EAED,OAAOV,YAAY;AACrB","ignoreList":[]}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
// Ref https://github.com/ReactTraining/react-router/blob/master/packages/react-router/modules/matchPath.js
|
|
2
2
|
|
|
3
3
|
import { pathToRegexp, compile } from "path-to-regexp";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
const cache = new Map();
|
|
5
|
+
const cacheLimit = 10000;
|
|
6
|
+
let cacheCount = 0;
|
|
7
7
|
function compilePath(path, options) {
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
const cacheKey = `${options.end}${options.strict}${options.sensitive}`;
|
|
9
|
+
let pathCache = cache.get(cacheKey);
|
|
10
10
|
if (!pathCache) {
|
|
11
11
|
cache.set(cacheKey, pathCache = new Map());
|
|
12
12
|
}
|
|
13
|
-
|
|
13
|
+
const cacheResult = pathCache.get(path);
|
|
14
14
|
if (cacheResult) {
|
|
15
15
|
return cacheResult;
|
|
16
16
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
const keys = [];
|
|
18
|
+
const regexp = pathToRegexp(path, keys, options);
|
|
19
|
+
const result = {
|
|
20
20
|
regexp,
|
|
21
21
|
keys
|
|
22
22
|
};
|
|
@@ -31,18 +31,18 @@ function compilePath(path, options) {
|
|
|
31
31
|
* Public API for matching a URL pathname to a path.
|
|
32
32
|
*/
|
|
33
33
|
export function matchPath(pathname, options) {
|
|
34
|
-
|
|
34
|
+
const {
|
|
35
35
|
path: p,
|
|
36
36
|
exact = false,
|
|
37
37
|
strict = false,
|
|
38
38
|
sensitive = true
|
|
39
39
|
} = options;
|
|
40
|
-
|
|
40
|
+
const paths = Array.isArray(p) ? p : [p];
|
|
41
41
|
return paths.reduce((matched, path) => {
|
|
42
42
|
if (matched) {
|
|
43
43
|
return matched;
|
|
44
44
|
}
|
|
45
|
-
|
|
45
|
+
const {
|
|
46
46
|
regexp,
|
|
47
47
|
keys
|
|
48
48
|
} = compilePath(path, {
|
|
@@ -50,17 +50,17 @@ export function matchPath(pathname, options) {
|
|
|
50
50
|
strict,
|
|
51
51
|
sensitive
|
|
52
52
|
});
|
|
53
|
-
|
|
53
|
+
const match = regexp.exec(pathname);
|
|
54
54
|
if (!match) {
|
|
55
55
|
return null;
|
|
56
56
|
}
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
const [url, ...values] = match;
|
|
58
|
+
const isExact = pathname === url;
|
|
59
59
|
if (exact && !isExact) {
|
|
60
60
|
return null;
|
|
61
61
|
}
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
const initialParams = {};
|
|
63
|
+
const result = {
|
|
64
64
|
path,
|
|
65
65
|
// the path used to match
|
|
66
66
|
url: path === "/" && url === "" ? "/" : url,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"matchPath.js","names":["pathToRegexp","compile","cache","Map","cacheLimit","cacheCount","compilePath","path","options","cacheKey","
|
|
1
|
+
{"version":3,"file":"matchPath.js","names":["pathToRegexp","compile","cache","Map","cacheLimit","cacheCount","compilePath","path","options","cacheKey","end","strict","sensitive","pathCache","get","set","cacheResult","keys","regexp","result","matchPath","pathname","p","exact","paths","Array","isArray","reduce","matched","match","exec","url","values","isExact","initialParams","params","memo","key","index","name","toPath","pathParams"],"sources":["../../../src/internal/matchPath.ts"],"sourcesContent":["// Ref https://github.com/ReactTraining/react-router/blob/master/packages/react-router/modules/matchPath.js\nimport type { LegacyCompatibleRuntimeContext } from \"@next-core/inject\";\nimport { pathToRegexp, Key, compile } from \"path-to-regexp\";\n\nconst cache: Map<string, Map<string, CompileResult>> = new Map();\nconst cacheLimit = 10000;\nlet cacheCount = 0;\n\nfunction compilePath(path: string, options: CompileOptions): CompileResult {\n const cacheKey = `${options.end}${options.strict}${options.sensitive}`;\n let pathCache = cache.get(cacheKey);\n if (!pathCache) {\n cache.set(cacheKey, (pathCache = new Map()));\n }\n\n const cacheResult = pathCache.get(path);\n if (cacheResult) {\n return cacheResult;\n }\n\n const keys: Key[] = [];\n const regexp = pathToRegexp(path, keys, options);\n const result = { regexp, keys };\n\n if (cacheCount < cacheLimit) {\n pathCache.set(path, result);\n cacheCount++;\n }\n\n return result;\n}\n\n/**\n * Public API for matching a URL pathname to a path.\n */\nexport function matchPath(\n pathname: string,\n options: MatchPathOptions\n): MatchResult | null {\n const { path: p, exact = false, strict = false, sensitive = true } = options;\n\n const paths = Array.isArray(p) ? p : [p];\n\n return paths.reduce<MatchResult | null>((matched, path) => {\n if (matched) {\n return matched;\n }\n const { regexp, keys } = compilePath(path, {\n end: exact,\n strict,\n sensitive,\n });\n const match = regexp.exec(pathname);\n\n if (!match) {\n return null;\n }\n\n const [url, ...values] = match;\n const isExact = pathname === url;\n\n if (exact && !isExact) {\n return null;\n }\n\n const initialParams: MatchResult[\"params\"] = {};\n const result = {\n path, // the path used to match\n url: path === \"/\" && url === \"\" ? \"/\" : url, // the matched portion of the URL\n isExact, // whether or not we matched exactly\n params: keys.reduce((memo, key, index) => {\n memo[key.name] = values[index];\n return memo;\n }, initialParams),\n };\n\n return result;\n }, null);\n}\n\nexport function toPath(\n path: string,\n pathParams?: Record<string, unknown>\n): string {\n return compile(path)(pathParams);\n}\n\ninterface CompileOptions {\n end?: boolean;\n strict?: boolean;\n sensitive?: boolean;\n}\n\ninterface CompileResult {\n regexp: RegExp;\n keys: Key[];\n}\n\ninterface MatchOptions {\n path: string | string[];\n exact?: boolean;\n}\n\nexport type MatchPathOptions = MatchOptions & CompileOptions;\n\nexport type MatchResult = Exclude<\n LegacyCompatibleRuntimeContext[\"match\"],\n undefined\n>;\n"],"mappings":"AAAA;;AAEA,SAASA,YAAY,EAAOC,OAAO,QAAQ,gBAAgB;AAE3D,MAAMC,KAA8C,GAAG,IAAIC,GAAG,CAAC,CAAC;AAChE,MAAMC,UAAU,GAAG,KAAK;AACxB,IAAIC,UAAU,GAAG,CAAC;AAElB,SAASC,WAAWA,CAACC,IAAY,EAAEC,OAAuB,EAAiB;EACzE,MAAMC,QAAQ,GAAG,GAAGD,OAAO,CAACE,GAAG,GAAGF,OAAO,CAACG,MAAM,GAAGH,OAAO,CAACI,SAAS,EAAE;EACtE,IAAIC,SAAS,GAAGX,KAAK,CAACY,GAAG,CAACL,QAAQ,CAAC;EACnC,IAAI,CAAC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CAACE,GAAG,EAAE,GAAGC,MAAM,CAAC,GAAGH,KAAK;IAC9B,MAAMI,OAAO,GAAGZ,QAAQ,KAAKU,GAAG;IAEhC,IAAIR,KAAK,IAAI,CAACU,OAAO,EAAE;MACrB,OAAO,IAAI;IACb;IAEA,MAAMC,aAAoC,GAAG,CAAC,CAAC;IAC/C,MAAMf,MAAM,GAAG;MACbZ,IAAI;MAAE;MACNwB,GAAG,EAAExB,IAAI,KAAK,GAAG,IAAIwB,GAAG,KAAK,EAAE,GAAG,GAAG,GAAGA,GAAG;MAAE;MAC7CE,OAAO;MAAE;MACTE,MAAM,EAAElB,IAAI,CAACU,MAAM,CAAC,CAACS,IAAI,EAAEC,GAAG,EAAEC,KAAK,KAAK;QACxCF,IAAI,CAACC,GAAG,CAACE,IAAI,CAAC,GAAGP,MAAM,CAACM,KAAK,CAAC;QAC9B,OAAOF,IAAI;MACb,CAAC,EAAEF,aAAa;IAClB,CAAC;IAED,OAAOf,MAAM;EACf,CAAC,EAAE,IAAI,CAAC;AACV;AAEA,OAAO,SAASqB,MAAMA,CACpBjC,IAAY,EACZkC,UAAoC,EAC5B;EACR,OAAOxC,OAAO,CAACM,IAAI,CAAC,CAACkC,UAAU,CAAC;AAClC","ignoreList":[]}
|
|
@@ -1,35 +1,28 @@
|
|
|
1
|
-
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
1
|
import { matchPath } from "./matchPath.js";
|
|
3
2
|
import { asyncCheckIf } from "./compute/checkIf.js";
|
|
4
3
|
import { hooks } from "./Runtime.js";
|
|
5
|
-
export function matchRoutes(
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
return {
|
|
20
|
-
match,
|
|
21
|
-
route
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
return "unauthenticated";
|
|
4
|
+
export async function matchRoutes(routes, runtimeContext) {
|
|
5
|
+
for (const route of routes) {
|
|
6
|
+
if (typeof route.path !== "string") {
|
|
7
|
+
// eslint-disable-next-line no-console
|
|
8
|
+
console.error("Invalid route with invalid path:", route);
|
|
9
|
+
throw new Error(`Invalid route with invalid type of path: ${typeof route.path}`);
|
|
10
|
+
}
|
|
11
|
+
const match = matchRoute(route, runtimeContext.app.homepage, runtimeContext.location.pathname);
|
|
12
|
+
if (match && (await asyncCheckIf(route, runtimeContext))) {
|
|
13
|
+
if (runtimeContext.app.noAuthGuard || route.public || !(hooks !== null && hooks !== void 0 && hooks.auth) || hooks.auth.isLoggedIn()) {
|
|
14
|
+
return {
|
|
15
|
+
match,
|
|
16
|
+
route
|
|
17
|
+
};
|
|
25
18
|
}
|
|
19
|
+
return "unauthenticated";
|
|
26
20
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
return _matchRoutes.apply(this, arguments);
|
|
21
|
+
}
|
|
22
|
+
return "missed";
|
|
30
23
|
}
|
|
31
24
|
export function matchRoute(route, homepage, pathname) {
|
|
32
|
-
|
|
25
|
+
const routePath = route.path.replace(/^\$\{APP.homepage\}/, homepage);
|
|
33
26
|
return matchPath(pathname, {
|
|
34
27
|
path: routePath,
|
|
35
28
|
exact: route.exact
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"matchRoutes.js","names":["matchPath","asyncCheckIf","hooks","matchRoutes","
|
|
1
|
+
{"version":3,"file":"matchRoutes.js","names":["matchPath","asyncCheckIf","hooks","matchRoutes","routes","runtimeContext","route","path","console","error","Error","match","matchRoute","app","homepage","location","pathname","noAuthGuard","public","auth","isLoggedIn","routePath","replace","exact"],"sources":["../../../src/internal/matchRoutes.ts"],"sourcesContent":["import type { RouteConf } from \"@next-core/types\";\nimport { MatchResult, matchPath } from \"./matchPath.js\";\nimport { asyncCheckIf } from \"./compute/checkIf.js\";\nimport type { RuntimeContext } from \"./interfaces.js\";\nimport { hooks } from \"./Runtime.js\";\n\ntype MatchRoutesResult =\n | {\n match: MatchResult;\n route: RouteConf;\n }\n | \"missed\"\n | \"unauthenticated\";\n\nexport async function matchRoutes(\n routes: RouteConf[],\n runtimeContext: RuntimeContext\n): Promise<MatchRoutesResult> {\n for (const route of routes) {\n if (typeof route.path !== \"string\") {\n // eslint-disable-next-line no-console\n console.error(\"Invalid route with invalid path:\", route);\n throw new Error(\n `Invalid route with invalid type of path: ${typeof route.path}`\n );\n }\n const match = matchRoute(\n route,\n runtimeContext.app.homepage,\n runtimeContext.location.pathname\n );\n if (match && (await asyncCheckIf(route, runtimeContext))) {\n if (\n runtimeContext.app.noAuthGuard ||\n route.public ||\n !hooks?.auth ||\n hooks.auth.isLoggedIn()\n ) {\n return { match, route };\n }\n return \"unauthenticated\";\n }\n }\n return \"missed\";\n}\n\nexport function matchRoute(\n route: RouteConf,\n homepage: string,\n pathname: string\n) {\n const routePath = route.path.replace(/^\\$\\{APP.homepage\\}/, homepage);\n return matchPath(pathname, {\n path: routePath,\n exact: route.exact,\n });\n}\n"],"mappings":"AACA,SAAsBA,SAAS,QAAQ,gBAAgB;AACvD,SAASC,YAAY,QAAQ,sBAAsB;AAEnD,SAASC,KAAK,QAAQ,cAAc;AAUpC,OAAO,eAAeC,WAAWA,CAC/BC,MAAmB,EACnBC,cAA8B,EACF;EAC5B,KAAK,MAAMC,KAAK,IAAIF,MAAM,EAAE;IAC1B,IAAI,OAAOE,KAAK,CAACC,IAAI,KAAK,QAAQ,EAAE;MAClC;MACAC,OAAO,CAACC,KAAK,CAAC,kCAAkC,EAAEH,KAAK,CAAC;MACxD,MAAM,IAAII,KAAK,CACb,4CAA4C,OAAOJ,KAAK,CAACC,IAAI,EAC/D,CAAC;IACH;IACA,MAAMI,KAAK,GAAGC,UAAU,CACtBN,KAAK,EACLD,cAAc,CAACQ,GAAG,CAACC,QAAQ,EAC3BT,cAAc,CAACU,QAAQ,CAACC,QAC1B,CAAC;IACD,IAAIL,KAAK,KAAK,MAAMV,YAAY,CAACK,KAAK,EAAED,cAAc,CAAC,CAAC,EAAE;MACxD,IACEA,cAAc,CAACQ,GAAG,CAACI,WAAW,IAC9BX,KAAK,CAACY,MAAM,IACZ,EAAChB,KAAK,aAALA,KAAK,eAALA,KAAK,CAAEiB,IAAI,KACZjB,KAAK,CAACiB,IAAI,CAACC,UAAU,CAAC,CAAC,EACvB;QACA,OAAO;UAAET,KAAK;UAAEL;QAAM,CAAC;MACzB;MACA,OAAO,iBAAiB;IAC1B;EACF;EACA,OAAO,QAAQ;AACjB;AAEA,OAAO,SAASM,UAAUA,CACxBN,KAAgB,EAChBQ,QAAgB,EAChBE,QAAgB,EAChB;EACA,MAAMK,SAAS,GAAGf,KAAK,CAACC,IAAI,CAACe,OAAO,CAAC,qBAAqB,EAAER,QAAQ,CAAC;EACrE,OAAOd,SAAS,CAACgB,QAAQ,EAAE;IACzBT,IAAI,EAAEc,SAAS;IACfE,KAAK,EAAEjB,KAAK,CAACiB;EACf,CAAC,CAAC;AACJ","ignoreList":[]}
|
|
@@ -4,12 +4,12 @@ export function matchStoryboard(storyboards, pathname) {
|
|
|
4
4
|
// Put apps with longer homepage before shorter ones.
|
|
5
5
|
// E.g., `/legacy/tool` will match first before `/legacy`.
|
|
6
6
|
// This enables two apps with relationship of parent-child of homepage.
|
|
7
|
-
|
|
8
|
-
var _storyboard$app$homep
|
|
9
|
-
return (_storyboard$app$homep =
|
|
7
|
+
const sortedStoryboards = orderBy(storyboards, storyboard => {
|
|
8
|
+
var _storyboard$app$homep;
|
|
9
|
+
return ((_storyboard$app$homep = storyboard.app.homepage) === null || _storyboard$app$homep === void 0 ? void 0 : _storyboard$app$homep.length) ?? 0;
|
|
10
10
|
}, "desc");
|
|
11
|
-
for (
|
|
12
|
-
|
|
11
|
+
for (const storyboard of sortedStoryboards) {
|
|
12
|
+
const homepage = storyboard.app.homepage;
|
|
13
13
|
if (typeof homepage === "string" && homepage[0] === "/") {
|
|
14
14
|
if (matchHomepage(homepage, pathname)) {
|
|
15
15
|
return storyboard;
|
|
@@ -18,7 +18,7 @@ export function matchStoryboard(storyboards, pathname) {
|
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
export function matchHomepage(homepage, pathname) {
|
|
21
|
-
return homepage === "/" ? pathname === homepage :
|
|
21
|
+
return homepage === "/" ? pathname === homepage : `${pathname.replace(/\/+$/, "")}/`.startsWith(`${homepage.replace(/\/+$/, "")}/`);
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
// istanbul ignore next
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"matchStoryboard.js","names":["orderBy","getRuntime","matchStoryboard","storyboards","pathname","sortedStoryboards","storyboard","_storyboard$app$homep","
|
|
1
|
+
{"version":3,"file":"matchStoryboard.js","names":["orderBy","getRuntime","matchStoryboard","storyboards","pathname","sortedStoryboards","storyboard","_storyboard$app$homep","app","homepage","length","matchHomepage","replace","startsWith","isOutsideApp","_getRuntime$getCurren","process","env","NODE_ENV","getCurrentApp","id","window","STANDALONE_MICRO_APPS","standaloneMode"],"sources":["../../../src/internal/matchStoryboard.ts"],"sourcesContent":["import type { RuntimeStoryboard } from \"@next-core/types\";\nimport { orderBy } from \"lodash\";\nimport { getRuntime } from \"./Runtime.js\";\n\nexport function matchStoryboard(\n storyboards: RuntimeStoryboard[],\n pathname: string\n): RuntimeStoryboard | undefined {\n // Put apps with longer homepage before shorter ones.\n // E.g., `/legacy/tool` will match first before `/legacy`.\n // This enables two apps with relationship of parent-child of homepage.\n const sortedStoryboards = orderBy(\n storyboards,\n (storyboard) => storyboard.app.homepage?.length ?? 0,\n \"desc\"\n );\n for (const storyboard of sortedStoryboards) {\n const homepage = storyboard.app.homepage;\n if (typeof homepage === \"string\" && homepage[0] === \"/\") {\n if (matchHomepage(homepage, pathname)) {\n return storyboard;\n }\n }\n }\n}\n\nexport function matchHomepage(homepage: string, pathname: string) {\n return homepage === \"/\"\n ? pathname === homepage\n : `${pathname.replace(/\\/+$/, \"\")}/`.startsWith(\n `${homepage.replace(/\\/+$/, \"\")}/`\n );\n}\n\n// istanbul ignore next\n/**\n * We say it's an outside app when at least one of the below conditions are true:\n * - target app is not found.\n * - target app is not the current app.\n * - current app is non-standalone mode and target app is standalone mode.\n *\n * Note: when current app is standalone mode, other apps will not be found.\n */\nexport function isOutsideApp(\n storyboard: RuntimeStoryboard | undefined\n): boolean | undefined {\n if (process.env.NODE_ENV === \"test\") {\n return false;\n }\n return (\n !storyboard ||\n // Sometimes `storyboard.app.standaloneMode` is incorrect.\n (getRuntime().getCurrentApp()?.id !== storyboard.app.id &&\n !window.STANDALONE_MICRO_APPS &&\n storyboard.app.standaloneMode)\n );\n}\n"],"mappings":"AACA,SAASA,OAAO,QAAQ,QAAQ;AAChC,SAASC,UAAU,QAAQ,cAAc;AAEzC,OAAO,SAASC,eAAeA,CAC7BC,WAAgC,EAChCC,QAAgB,EACe;EAC/B;EACA;EACA;EACA,MAAMC,iBAAiB,GAAGL,OAAO,CAC/BG,WAAW,EACVG,UAAU;IAAA,IAAAC,qBAAA;IAAA,OAAK,EAAAA,qBAAA,GAAAD,UAAU,CAACE,GAAG,CAACC,QAAQ,cAAAF,qBAAA,uBAAvBA,qBAAA,CAAyBG,MAAM,KAAI,CAAC;EAAA,GACpD,MACF,CAAC;EACD,KAAK,MAAMJ,UAAU,IAAID,iBAAiB,EAAE;IAC1C,MAAMI,QAAQ,GAAGH,UAAU,CAACE,GAAG,CAACC,QAAQ;IACxC,IAAI,OAAOA,QAAQ,KAAK,QAAQ,IAAIA,QAAQ,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE;MACvD,IAAIE,aAAa,CAACF,QAAQ,EAAEL,QAAQ,CAAC,EAAE;QACrC,OAAOE,UAAU;MACnB;IACF;EACF;AACF;AAEA,OAAO,SAASK,aAAaA,CAACF,QAAgB,EAAEL,QAAgB,EAAE;EAChE,OAAOK,QAAQ,KAAK,GAAG,GACnBL,QAAQ,KAAKK,QAAQ,GACrB,GAAGL,QAAQ,CAACQ,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,GAAG,CAACC,UAAU,CAC3C,GAAGJ,QAAQ,CAACG,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,GACjC,CAAC;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASE,YAAYA,CAC1BR,UAAyC,EACpB;EAAA,IAAAS,qBAAA;EACrB,IAAIC,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,MAAM,EAAE;IACnC,OAAO,KAAK;EACd;EACA,OACE,CAACZ,UAAU;EACX;EACC,EAAAS,qBAAA,GAAAd,UAAU,CAAC,CAAC,CAACkB,aAAa,CAAC,CAAC,cAAAJ,qBAAA,uBAA5BA,qBAAA,CAA8BK,EAAE,MAAKd,UAAU,CAACE,GAAG,CAACY,EAAE,IACrD,CAACC,MAAM,CAACC,qBAAqB,IAC7BhB,UAAU,CAACE,GAAG,CAACe,cAAe;AAEpC","ignoreList":[]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import EventTarget from "@ungap/event-target";
|
|
2
|
-
export
|
|
2
|
+
export let MediaBreakpoint = /*#__PURE__*/function (MediaBreakpoint) {
|
|
3
3
|
MediaBreakpoint["xLarge"] = "xLarge";
|
|
4
4
|
MediaBreakpoint["large"] = "large";
|
|
5
5
|
MediaBreakpoint["medium"] = "medium";
|
|
@@ -7,16 +7,16 @@ export var MediaBreakpoint = /*#__PURE__*/function (MediaBreakpoint) {
|
|
|
7
7
|
MediaBreakpoint["xSmall"] = "xSmall";
|
|
8
8
|
return MediaBreakpoint;
|
|
9
9
|
}({});
|
|
10
|
-
export
|
|
11
|
-
export
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
export const mediaBreakpointMinWidthMap = new Map([[MediaBreakpoint.xLarge, "1920px"], [MediaBreakpoint.large, "1600px"], [MediaBreakpoint.medium, "1280px"], [MediaBreakpoint.small, "1024px"], [MediaBreakpoint.xSmall, 0]]);
|
|
11
|
+
export const mediaEventTarget = new EventTarget();
|
|
12
|
+
const breakpointMatchesMap = {};
|
|
13
|
+
const MEDIA = {};
|
|
14
14
|
function handleMatchesChange(data, breakpoint) {
|
|
15
|
-
|
|
15
|
+
let changed = false;
|
|
16
16
|
breakpointMatchesMap[breakpoint] = data.matches;
|
|
17
|
-
for (
|
|
18
|
-
if (breakpointMatchesMap[
|
|
19
|
-
MEDIA.breakpoint =
|
|
17
|
+
for (const [breakpoint] of mediaBreakpointMinWidthMap) {
|
|
18
|
+
if (breakpointMatchesMap[breakpoint] && MEDIA.breakpoint !== breakpoint) {
|
|
19
|
+
MEDIA.breakpoint = breakpoint;
|
|
20
20
|
changed = true;
|
|
21
21
|
break;
|
|
22
22
|
}
|
|
@@ -28,7 +28,7 @@ function handleMatchesChange(data, breakpoint) {
|
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
mediaBreakpointMinWidthMap.forEach((minWidth, breakpoint) => {
|
|
31
|
-
|
|
31
|
+
const mediaQueryList = window.matchMedia(`(min-width: ${minWidth})`);
|
|
32
32
|
handleMatchesChange(mediaQueryList, breakpoint);
|
|
33
33
|
if (mediaQueryList.addEventListener) {
|
|
34
34
|
mediaQueryList.addEventListener("change", event => {
|
|
@@ -40,5 +40,5 @@ mediaBreakpointMinWidthMap.forEach((minWidth, breakpoint) => {
|
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
42
|
});
|
|
43
|
-
export
|
|
43
|
+
export const getMedia = () => MEDIA;
|
|
44
44
|
//# sourceMappingURL=mediaQuery.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mediaQuery.js","names":["EventTarget","MediaBreakpoint","mediaBreakpointMinWidthMap","Map","xLarge","large","medium","small","xSmall","mediaEventTarget","breakpointMatchesMap","MEDIA","handleMatchesChange","data","breakpoint","changed","matches","dispatchEvent","CustomEvent","detail","forEach","minWidth","mediaQueryList","window","matchMedia","
|
|
1
|
+
{"version":3,"file":"mediaQuery.js","names":["EventTarget","MediaBreakpoint","mediaBreakpointMinWidthMap","Map","xLarge","large","medium","small","xSmall","mediaEventTarget","breakpointMatchesMap","MEDIA","handleMatchesChange","data","breakpoint","changed","matches","dispatchEvent","CustomEvent","detail","forEach","minWidth","mediaQueryList","window","matchMedia","addEventListener","event","addListener","getMedia"],"sources":["../../../src/internal/mediaQuery.ts"],"sourcesContent":["import EventTarget from \"@ungap/event-target\";\n\nexport interface Media {\n breakpoint?: MediaBreakpoint;\n}\n\nexport enum MediaBreakpoint {\n xLarge = \"xLarge\",\n large = \"large\",\n medium = \"medium\",\n small = \"small\",\n xSmall = \"xSmall\",\n}\n\nexport const mediaBreakpointMinWidthMap = new Map<\n MediaBreakpoint,\n string | number\n>([\n [MediaBreakpoint.xLarge, \"1920px\"],\n [MediaBreakpoint.large, \"1600px\"],\n [MediaBreakpoint.medium, \"1280px\"],\n [MediaBreakpoint.small, \"1024px\"],\n [MediaBreakpoint.xSmall, 0],\n]);\nexport const mediaEventTarget = new EventTarget();\n\nconst breakpointMatchesMap: Partial<Record<MediaBreakpoint, boolean>> = {};\nconst MEDIA: Media = {};\n\nfunction handleMatchesChange(\n data: { readonly matches: boolean; readonly media: string },\n breakpoint: MediaBreakpoint\n): void {\n let changed = false;\n breakpointMatchesMap[breakpoint] = data.matches;\n\n for (const [breakpoint] of mediaBreakpointMinWidthMap) {\n if (breakpointMatchesMap[breakpoint] && MEDIA.breakpoint !== breakpoint) {\n MEDIA.breakpoint = breakpoint;\n changed = true;\n break;\n }\n }\n\n if (changed) {\n mediaEventTarget.dispatchEvent(\n new CustomEvent(\"change\", { detail: MEDIA })\n );\n }\n}\n\nmediaBreakpointMinWidthMap.forEach((minWidth, breakpoint) => {\n const mediaQueryList = window.matchMedia(`(min-width: ${minWidth})`);\n\n handleMatchesChange(mediaQueryList, breakpoint);\n\n if (mediaQueryList.addEventListener) {\n mediaQueryList.addEventListener(\"change\", (event) => {\n handleMatchesChange(event, breakpoint);\n });\n } else {\n mediaQueryList.addListener((event) => {\n handleMatchesChange(event, breakpoint);\n });\n }\n});\n\nexport const getMedia = (): Media => MEDIA;\n"],"mappings":"AAAA,OAAOA,WAAW,MAAM,qBAAqB;AAM7C,WAAYC,eAAe,0BAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAA,OAAfA,eAAe;AAAA;AAQ3B,OAAO,MAAMC,0BAA0B,GAAG,IAAIC,GAAG,CAG/C,CACA,CAACF,eAAe,CAACG,MAAM,EAAE,QAAQ,CAAC,EAClC,CAACH,eAAe,CAACI,KAAK,EAAE,QAAQ,CAAC,EACjC,CAACJ,eAAe,CAACK,MAAM,EAAE,QAAQ,CAAC,EAClC,CAACL,eAAe,CAACM,KAAK,EAAE,QAAQ,CAAC,EACjC,CAACN,eAAe,CAACO,MAAM,EAAE,CAAC,CAAC,CAC5B,CAAC;AACF,OAAO,MAAMC,gBAAgB,GAAG,IAAIT,WAAW,CAAC,CAAC;AAEjD,MAAMU,oBAA+D,GAAG,CAAC,CAAC;AAC1E,MAAMC,KAAY,GAAG,CAAC,CAAC;AAEvB,SAASC,mBAAmBA,CAC1BC,IAA2D,EAC3DC,UAA2B,EACrB;EACN,IAAIC,OAAO,GAAG,KAAK;EACnBL,oBAAoB,CAACI,UAAU,CAAC,GAAGD,IAAI,CAACG,OAAO;EAE/C,KAAK,MAAM,CAACF,UAAU,CAAC,IAAIZ,0BAA0B,EAAE;IACrD,IAAIQ,oBAAoB,CAACI,UAAU,CAAC,IAAIH,KAAK,CAACG,UAAU,KAAKA,UAAU,EAAE;MACvEH,KAAK,CAACG,UAAU,GAAGA,UAAU;MAC7BC,OAAO,GAAG,IAAI;MACd;IACF;EACF;EAEA,IAAIA,OAAO,EAAE;IACXN,gBAAgB,CAACQ,aAAa,CAC5B,IAAIC,WAAW,CAAC,QAAQ,EAAE;MAAEC,MAAM,EAAER;IAAM,CAAC,CAC7C,CAAC;EACH;AACF;AAEAT,0BAA0B,CAACkB,OAAO,CAAC,CAACC,QAAQ,EAAEP,UAAU,KAAK;EAC3D,MAAMQ,cAAc,GAAGC,MAAM,CAACC,UAAU,CAAC,eAAeH,QAAQ,GAAG,CAAC;EAEpET,mBAAmB,CAACU,cAAc,EAAER,UAAU,CAAC;EAE/C,IAAIQ,cAAc,CAACG,gBAAgB,EAAE;IACnCH,cAAc,CAACG,gBAAgB,CAAC,QAAQ,EAAGC,KAAK,IAAK;MACnDd,mBAAmB,CAACc,KAAK,EAAEZ,UAAU,CAAC;IACxC,CAAC,CAAC;EACJ,CAAC,MAAM;IACLQ,cAAc,CAACK,WAAW,CAAED,KAAK,IAAK;MACpCd,mBAAmB,CAACc,KAAK,EAAEZ,UAAU,CAAC;IACxC,CAAC,CAAC;EACJ;AACF,CAAC,CAAC;AAEF,OAAO,MAAMc,QAAQ,GAAGA,CAAA,KAAajB,KAAK","ignoreList":[]}
|
|
@@ -8,15 +8,15 @@ export function unmountTree(mountPoint) {
|
|
|
8
8
|
}
|
|
9
9
|
export function mountTree(root, initializedElement) {
|
|
10
10
|
window.DISABLE_REACT_FLUSH_SYNC = false;
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
let current = root.child;
|
|
12
|
+
const portalElements = [];
|
|
13
13
|
while (current) {
|
|
14
14
|
if (current.tag === RenderTag.BRICK) {
|
|
15
15
|
var _current$tplHostMetad;
|
|
16
|
-
|
|
16
|
+
const tagName = current.type;
|
|
17
17
|
if (tagName.includes("-") && !customElements.get(tagName)) {
|
|
18
18
|
// eslint-disable-next-line no-console
|
|
19
|
-
console.error(
|
|
19
|
+
console.error(`Undefined custom element: ${tagName}`);
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
// istanbul ignore if
|
|
@@ -24,7 +24,7 @@ export function mountTree(root, initializedElement) {
|
|
|
24
24
|
// eslint-disable-next-line no-console
|
|
25
25
|
console.warn("`basic-bricks.script-brick` is deprecated, please take caution when using it");
|
|
26
26
|
}
|
|
27
|
-
|
|
27
|
+
const element = initializedElement && current === root.child ? initializedElement : document.createElement(tagName);
|
|
28
28
|
current.element = element;
|
|
29
29
|
if (current.slotId) {
|
|
30
30
|
element.setAttribute("slot", current.slotId);
|
|
@@ -61,7 +61,7 @@ export function mountTree(root, initializedElement) {
|
|
|
61
61
|
current = current.sibling;
|
|
62
62
|
} else {
|
|
63
63
|
var _currentReturn;
|
|
64
|
-
|
|
64
|
+
let currentReturn = current.return;
|
|
65
65
|
while (currentReturn) {
|
|
66
66
|
// Append elements inside out
|
|
67
67
|
if (currentReturn.childElements) {
|
|
@@ -75,7 +75,7 @@ export function mountTree(root, initializedElement) {
|
|
|
75
75
|
currentReturn.childElements = undefined;
|
|
76
76
|
}
|
|
77
77
|
if (currentReturn.tag === RenderTag.ROOT && portalElements.length > 0) {
|
|
78
|
-
|
|
78
|
+
const portal = typeof currentReturn.createPortal === "function" ? currentReturn.createPortal() : currentReturn.createPortal;
|
|
79
79
|
portal.append(...portalElements);
|
|
80
80
|
}
|
|
81
81
|
if (currentReturn.sibling) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mount.js","names":["bindTemplateProxy","getTplStateStore","bindListeners","setRealProperties","RenderTag","unmountTree","mountPoint","replaceChildren","mountTree","root","initializedElement","window","DISABLE_REACT_FLUSH_SYNC","current","child","portalElements","tag","BRICK","_current$tplHostMetad","tagName","type","includes","customElements","get","console","error","
|
|
1
|
+
{"version":3,"file":"mount.js","names":["bindTemplateProxy","getTplStateStore","bindListeners","setRealProperties","RenderTag","unmountTree","mountPoint","replaceChildren","mountTree","root","initializedElement","window","DISABLE_REACT_FLUSH_SYNC","current","child","portalElements","tag","BRICK","_current$tplHostMetad","tagName","type","includes","customElements","get","console","error","warn","element","document","createElement","slotId","setAttribute","iid","dataset","tplHostMetadata","tplStateStoreId","properties","events","runtimeContext","$$tplStateStore","tplStateStoreMap","portal","push","return","childElements","sibling","_currentReturn","currentReturn","ROOT","_currentReturn$contai","container","append","undefined","length","createPortal","setTimeout"],"sources":["../../../src/internal/mount.ts"],"sourcesContent":["import { bindTemplateProxy } from \"./CustomTemplates/bindTemplateProxy.js\";\nimport { getTplStateStore } from \"./CustomTemplates/utils.js\";\nimport { bindListeners } from \"./bindListeners.js\";\nimport { setRealProperties } from \"./compute/setRealProperties.js\";\nimport { RenderTag } from \"./enums.js\";\nimport type {\n RenderReturnNode,\n RenderRoot,\n RuntimeBrickElement,\n} from \"./interfaces.js\";\n\nexport function unmountTree(mountPoint: HTMLElement | DocumentFragment) {\n mountPoint.replaceChildren();\n}\n\nexport function mountTree(\n root: RenderRoot,\n initializedElement?: RuntimeBrickElement\n): void {\n window.DISABLE_REACT_FLUSH_SYNC = false;\n let current = root.child;\n const portalElements: RuntimeBrickElement[] = [];\n while (current) {\n if (current.tag === RenderTag.BRICK) {\n const tagName = current.type;\n\n if (tagName.includes(\"-\") && !customElements.get(tagName)) {\n // eslint-disable-next-line no-console\n console.error(`Undefined custom element: ${tagName}`);\n }\n\n // istanbul ignore if\n if (tagName === \"basic-bricks.script-brick\") {\n // eslint-disable-next-line no-console\n console.warn(\n \"`basic-bricks.script-brick` is deprecated, please take caution when using it\"\n );\n }\n\n const element: RuntimeBrickElement =\n initializedElement && current === root.child\n ? initializedElement\n : document.createElement(tagName);\n current.element = element;\n\n if (current.slotId) {\n element.setAttribute(\"slot\", current.slotId);\n }\n if (current.iid) {\n element.dataset.iid = current.iid;\n }\n if (current.tplHostMetadata?.tplStateStoreId) {\n element.dataset.tplStateStoreId =\n current.tplHostMetadata.tplStateStoreId;\n }\n setRealProperties(element, current.properties);\n bindListeners(element, current.events, current.runtimeContext);\n if (current.tplHostMetadata) {\n // 先设置属性,再设置 `$$tplStateStore`,这样,当触发属性设置时,\n // 避免初始化的一次 state update 操作及其 onChange 事件。\n element.$$tplStateStore = getTplStateStore(\n {\n tplStateStoreId: current.tplHostMetadata.tplStateStoreId,\n tplStateStoreMap: current.runtimeContext.tplStateStoreMap,\n },\n \"mount\"\n );\n }\n bindTemplateProxy(current);\n\n if (current.portal) {\n portalElements.push(element);\n } else if (current.return) {\n if (!current.return.childElements) {\n current.return.childElements = [];\n }\n current.return.childElements.push(element);\n }\n }\n\n if (current.child) {\n current = current.child;\n } else if (current.sibling) {\n current = current.sibling;\n } else {\n let currentReturn: RenderReturnNode | null | undefined = current.return;\n while (currentReturn) {\n // Append elements inside out\n if (currentReturn.childElements) {\n if (currentReturn.tag === RenderTag.ROOT) {\n currentReturn.container?.append(...currentReturn.childElements);\n } else {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n currentReturn.element!.append(...currentReturn.childElements);\n }\n currentReturn.childElements = undefined;\n }\n\n if (currentReturn.tag === RenderTag.ROOT && portalElements.length > 0) {\n const portal =\n typeof currentReturn.createPortal === \"function\"\n ? currentReturn.createPortal()\n : currentReturn.createPortal;\n portal.append(...portalElements);\n }\n\n if (currentReturn.sibling) {\n break;\n }\n currentReturn = currentReturn.return;\n }\n current = currentReturn?.sibling;\n }\n }\n setTimeout(() => {\n window.DISABLE_REACT_FLUSH_SYNC = true;\n });\n}\n"],"mappings":"AAAA,SAASA,iBAAiB,QAAQ,wCAAwC;AAC1E,SAASC,gBAAgB,QAAQ,4BAA4B;AAC7D,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,iBAAiB,QAAQ,gCAAgC;AAClE,SAASC,SAAS,QAAQ,YAAY;AAOtC,OAAO,SAASC,WAAWA,CAACC,UAA0C,EAAE;EACtEA,UAAU,CAACC,eAAe,CAAC,CAAC;AAC9B;AAEA,OAAO,SAASC,SAASA,CACvBC,IAAgB,EAChBC,kBAAwC,EAClC;EACNC,MAAM,CAACC,wBAAwB,GAAG,KAAK;EACvC,IAAIC,OAAO,GAAGJ,IAAI,CAACK,KAAK;EACxB,MAAMC,cAAqC,GAAG,EAAE;EAChD,OAAOF,OAAO,EAAE;IACd,IAAIA,OAAO,CAACG,GAAG,KAAKZ,SAAS,CAACa,KAAK,EAAE;MAAA,IAAAC,qBAAA;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