@next-core/runtime 1.55.1 → 1.55.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.
@@ -1 +1 @@
1
- {"version":3,"file":"Router.js","names":["_history2","require","_http","_cook","_lodash","_history3","_Renderer","_DataStore","_resolveData","_mount","_matchStoryboard","_StoryboardFunctions","_RendererContext","_themeAndMode","_Runtime","_getPageInfo","_markAsComputed","_handleHttpError","_abortController","_setLoginStateCookie","_registerCustomTemplates","_fulfilStoryboard","_enums","_insertPreviewRoutes","_devtools","_setUIVersion","_setAppVariable","_setWatermark","_routeMatchedMap","_ErrorNode","_storyboards","WeakMap","_rendering","_nextRender","_runtimeContext","_rendererContext","_rendererContextTrashCan","_redirectCount","_renderId","_currentApp","_previousApp","_navConfig","_Router_brand","WeakSet","Router","constructor","storyboards","_classPrivateMethodInitSpec2","default","_classPrivateFieldInitSpec2","Set","_classPrivateFieldSet2","history","getHistory","window","addEventListener","event","message","_assertClassBrand2","_getBlockMessageBeforePageLave","call","preventDefault","returnValue","block","location","action","getRenderId","_classPrivateFieldGet6","getRuntimeContext","getRecentApps","currentApp","previousApp","getNavConfig","bootstrap","initAbortController","nextPrevLocation","listen","prevLocation","_queuedRender","catch","handleHttpError","exports","detail","_classPrivateFieldGet2","previousMessage","getBlockMessage","dispatchBeforePageLeave","unblock","_safeRedirect","to","state","from","_this$redirectCount","_this$redirectCount2","pathname","search","hash","process","env","NODE_ENV","console","error","Error","replace","next","_preRender","nextRender","undefined","_prevLocation$state","_location$state","_location$state2","_classPrivateFieldGet4","ignoreRendering","omittedLocationProps","key","notify","locationsAreEqual","noIncremental","_classPrivateFieldGet3","didPerformIncrementalRender","abortPendingRequest","dispatchPageLeave","storyboard","matchStoryboard","isOutsideApp","reload","devtoolsHookEmit","_render","_hooks$flowApi","_hooks$pageView","_classPrivateFieldGet5","_storyboard$app","renderId","uniqueId","resetAllComputedMarks","clearResolveCache","hooks","flowApi","clearCollectWidgetContract","finishPageView","pageView","create","app","currentAppId","id","BOOTSTRAP_UNION_FILE","setAppVariable","appId","version","currentVersion","fulfilStoryboard","setWatermark","appChanged","clearExpressionASTCache","clearFunctionASTCache","flags","getRuntime","getFeatureFlags","prevRendererContext","redirectTo","status","add","redirectToLogin","setLoginStateCookie","main","document","querySelector","portal","renderRoot","tag","RenderTag","ROOT","container","createPortal","cleanUpPreviousRender","_hooks$messageDispatc","unmountTree","item","dispatchOnUnmount","dispose","clear","messageDispatcher","reset","dispatchEvent","CustomEvent","setTheme","getLocalAppsTheme","theme","setMode","_hooks$checkInstalled","_hooks$auth","_hooks$checkPermissio","_storyboard$meta","_hooks$flowApi2","_storyboard$meta2","checkInstalledApps","preCheckInstalledApps","_internalApiGetAppInBootstrapData","routeHelper","bailout","output","unauthenticated","redirect","path","mergeMenus","menuRequests","menuConfs","Promise","all","mergeMenuConfs","returnNode","isUnauthenticatedError","NO_AUTH_GUARD","HttpAbortError","noAuthGuardLoginPath","getMiscSettings","failed","node","ErrorNode","blockingList","rendererContext","RendererContext","runtimeContext","query","URLSearchParams","sys","auth","getAuth","getPageInfo","settings","brand","getBrandSettings","ctxStore","DataStore","pendingPermissionsPreCheck","checkPermissions","preCheckPermissions","tplStateStoreMap","Map","formStateStoreMap","registerCustomTemplates","registerStoryboardFunctions","meta","functions","collectContract","contracts","stores","clearMatchedRoutes","rootMenuRequestNode","renderRoutes","insertPreviewRoutes","routes","getDataStores","postAsyncRender","child","menuRequestNode","setInitialMenuRequestNode","getMenuRequests","result","route","type","dispatchBeforePageLoad","applyTheme","applyMode","setUIVersion","uiVersion","mountTree","scrollTo","dispatchPageLoad","dispatchAnchorLoad","dispatchOnMount","initializeScrollIntoView","initializeMediaChange","initializeMessageDispatcher","store","mountAsyncData","pageTitle","title","isLoggedIn","PageNotFoundError","navConfig","breadcrumb","menuConf","overwrite","items","push"],"sources":["../../../src/internal/Router.ts"],"sourcesContent":["import { Action, locationsAreEqual } from \"history\";\nimport type {\n BreadcrumbItemConf,\n MicroApp,\n StaticMenuConf,\n Storyboard,\n} from \"@next-core/types\";\nimport { HttpAbortError } from \"@next-core/http\";\nimport {\n clearExpressionASTCache,\n clearFunctionASTCache,\n} from \"@next-core/cook\";\nimport { uniqueId } from \"lodash\";\nimport { NextHistoryState, NextLocation, getHistory } from \"../history.js\";\nimport {\n RenderOutput,\n getDataStores,\n postAsyncRender,\n renderRoutes,\n} from \"./Renderer.js\";\nimport { DataStore } from \"./data/DataStore.js\";\nimport { clearResolveCache } from \"./data/resolveData.js\";\nimport { mountTree, unmountTree } from \"./mount.js\";\nimport { isOutsideApp, matchStoryboard } from \"./matchStoryboard.js\";\nimport { registerStoryboardFunctions } from \"./compute/StoryboardFunctions.js\";\nimport { RendererContext, RouteHelper } from \"./RendererContext.js\";\nimport {\n applyMode,\n applyTheme,\n getLocalAppsTheme,\n setMode,\n setTheme,\n} from \"../themeAndMode.js\";\nimport {\n _internalApiGetAppInBootstrapData,\n getRuntime,\n hooks,\n} from \"./Runtime.js\";\nimport { getPageInfo } from \"../getPageInfo.js\";\nimport type {\n MenuRequestNode,\n RenderRoot,\n RuntimeContext,\n} from \"./interfaces.js\";\nimport { resetAllComputedMarks } from \"./compute/markAsComputed.js\";\nimport { handleHttpError, isUnauthenticatedError } from \"../handleHttpError.js\";\nimport { abortPendingRequest, initAbortController } from \"./abortController.js\";\nimport { setLoginStateCookie } from \"../setLoginStateCookie.js\";\nimport { registerCustomTemplates } from \"./registerCustomTemplates.js\";\nimport { fulfilStoryboard } from \"./fulfilStoryboard.js\";\nimport { RenderTag } from \"./enums.js\";\nimport { insertPreviewRoutes } from \"./insertPreviewRoutes.js\";\nimport { devtoolsHookEmit } from \"./devtools.js\";\nimport { setUIVersion } from \"../setUIVersion.js\";\nimport { setAppVariable } from \"../setAppVariable.js\";\nimport { setWatermark } from \"../setWatermark.js\";\nimport { clearMatchedRoutes } from \"./routeMatchedMap.js\";\nimport { ErrorNode, PageNotFoundError } from \"./ErrorNode.js\";\n\ntype RenderTask = InitialRenderTask | SubsequentRenderTask;\n\ninterface InitialRenderTask {\n location: NextLocation;\n prevLocation?: undefined;\n action?: undefined;\n}\n\ninterface SubsequentRenderTask {\n location: NextLocation;\n prevLocation: NextLocation;\n action: Action;\n}\n\nexport class Router {\n readonly #storyboards: Storyboard[];\n #rendering = false;\n #nextRender?: RenderTask;\n #runtimeContext?: RuntimeContext;\n #rendererContext?: RendererContext;\n #rendererContextTrashCan = new Set<RendererContext | undefined>();\n #redirectCount = 0;\n #renderId?: string;\n #currentApp?: MicroApp;\n #previousApp?: MicroApp;\n #navConfig?: {\n breadcrumb?: BreadcrumbItemConf[];\n };\n\n constructor(storyboards: Storyboard[]) {\n this.#storyboards = storyboards;\n\n const history = getHistory();\n window.addEventListener(\"beforeunload\", (event) => {\n const message = this.#getBlockMessageBeforePageLave({});\n // See examples in https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers/onbeforeunload\n if (message) {\n // Cancel the event\n // If you prevent default behavior in Mozilla Firefox prompt will always be shown\n event.preventDefault();\n // Chrome requires returnValue to be set\n event.returnValue = \"\";\n } else {\n // the absence of a returnValue property on the event will guarantee the browser unload happens\n delete event.returnValue;\n }\n });\n\n history.block((location, action) =>\n this.#getBlockMessageBeforePageLave({ location, action })\n );\n }\n\n getRenderId() {\n return this.#renderId;\n }\n\n getRuntimeContext() {\n return this.#runtimeContext;\n }\n\n getRecentApps() {\n return {\n currentApp: this.#currentApp,\n previousApp: this.#previousApp,\n };\n }\n\n getNavConfig() {\n return this.#navConfig;\n }\n\n #getBlockMessageBeforePageLave(detail: {\n location?: NextLocation;\n action?: Action;\n }): string | undefined {\n const history = getHistory();\n const previousMessage = history.getBlockMessage();\n this.#rendererContext?.dispatchBeforePageLeave(detail);\n const message = history.getBlockMessage();\n if (!previousMessage && message) {\n // Auto unblock only if new block was introduced by `onBeforePageLeave`.\n history.unblock();\n }\n return message;\n }\n\n #safeRedirect(\n to: string,\n state: NextHistoryState | undefined,\n from: NextLocation\n ): void {\n if (this.#redirectCount++ > 10) {\n const message = `Infinite redirect detected: from \"${from.pathname}${from.search}${from.hash}\" to \"${to}\"`;\n // istanbul ignore else: error cannot be caught in test\n if (process.env.NODE_ENV === \"test\") {\n // eslint-disable-next-line no-console\n console.error(message);\n return;\n } else {\n throw new Error(message);\n }\n }\n getHistory().replace(to, state);\n }\n\n bootstrap() {\n initAbortController();\n const history = getHistory();\n let nextPrevLocation = history.location;\n history.listen((location, action) => {\n const prevLocation = nextPrevLocation;\n nextPrevLocation = location;\n if (this.#rendering) {\n this.#nextRender = { location, prevLocation, action };\n } else {\n this.#queuedRender({\n location,\n prevLocation,\n action,\n }).catch(handleHttpError);\n }\n });\n return this.#queuedRender({ location: history.location });\n }\n\n async #queuedRender(next: RenderTask) {\n this.#rendering = true;\n try {\n await this.#preRender(next);\n } finally {\n this.#rendering = false;\n if (this.#nextRender) {\n const nextRender = this.#nextRender;\n this.#nextRender = undefined;\n await this.#queuedRender(nextRender);\n }\n }\n }\n\n async #preRender({ location, prevLocation, action }: RenderTask) {\n if (prevLocation) {\n let ignoreRendering: boolean | undefined;\n const omittedLocationProps: Partial<NextLocation> = {\n hash: undefined,\n state: undefined,\n };\n // Omit the \"key\" when checking whether locations are equal in certain situations.\n if (\n // When current location is triggered by browser action of hash link.\n location.key === undefined ||\n // When current location is triggered by browser action of non-push-or-replace,\n // such as goBack or goForward,\n (action === \"POP\" &&\n // and the previous location was triggered by hash link,\n (prevLocation.key === undefined ||\n // or the previous location specified notify false.\n prevLocation.state?.notify === false))\n ) {\n omittedLocationProps.key = undefined;\n }\n if (\n locationsAreEqual(\n { ...prevLocation, ...omittedLocationProps },\n { ...location, ...omittedLocationProps }\n ) ||\n (action !== \"POP\" && location.state?.notify === false)\n ) {\n // Ignore rendering if location not changed except hash, state and optional key.\n // Ignore rendering if notify is `false`.\n ignoreRendering = true;\n }\n\n if (!ignoreRendering && !location.state?.noIncremental) {\n ignoreRendering =\n await this.#rendererContext?.didPerformIncrementalRender(\n location,\n prevLocation\n );\n }\n\n if (ignoreRendering) {\n return;\n }\n\n abortPendingRequest();\n this.#rendererContext?.dispatchPageLeave();\n\n if (action === \"POP\") {\n const storyboard = matchStoryboard(\n this.#storyboards,\n location.pathname\n );\n // When a browser action of goBack or goForward is performing,\n // force reload when the target page is a page of an outside app.\n if (isOutsideApp(storyboard)) {\n window.location.reload();\n return;\n }\n }\n\n devtoolsHookEmit(\"locationChange\");\n }\n\n return this.#render(location);\n }\n\n async #render(location: NextLocation): Promise<void> {\n const renderId = (this.#renderId = uniqueId(\"render-id-\"));\n\n resetAllComputedMarks();\n clearResolveCache();\n hooks?.flowApi?.clearCollectWidgetContract();\n\n const history = getHistory();\n history.unblock();\n\n // const renderStartTime = performance.now();\n const finishPageView = hooks?.pageView?.create();\n\n const storyboard = matchStoryboard(this.#storyboards, location.pathname);\n\n const previousApp = this.#runtimeContext?.app;\n const currentAppId = storyboard?.app?.id;\n // dynamically change the value of the APP variable, if it's union app\n if (\n window.BOOTSTRAP_UNION_FILE &&\n currentAppId &&\n currentAppId !== previousApp?.id\n ) {\n setAppVariable({\n appId: currentAppId,\n version: storyboard.app.currentVersion!,\n });\n }\n\n if (storyboard?.app) {\n await fulfilStoryboard(storyboard);\n }\n\n const currentApp = (this.#currentApp = storyboard?.app);\n\n setWatermark();\n\n // Storyboard maybe re-assigned, e.g. when open launchpad.\n const appChanged =\n previousApp && currentApp\n ? previousApp.id !== currentApp.id\n : previousApp !== currentApp;\n\n clearExpressionASTCache();\n if (appChanged) {\n clearFunctionASTCache();\n }\n\n // TODO: handle favicon\n\n // Set `Router::#currentApp` before calling `getFeatureFlags()`\n const flags = getRuntime().getFeatureFlags();\n const prevRendererContext = this.#rendererContext;\n\n const redirectTo = (to: string, state?: NextHistoryState): void => {\n finishPageView?.({\n status: \"redirected\",\n });\n this.#rendererContextTrashCan.add(prevRendererContext);\n this.#safeRedirect(to, state, location);\n };\n\n const redirectToLogin = (): void => {\n const to = flags[\"sso-enabled\"] ? \"/sso-auth/login\" : \"/auth/login\";\n setLoginStateCookie(location);\n redirectTo(to, { from: location });\n };\n\n const main = document.querySelector(\"#main-mount-point\") as HTMLElement;\n const portal = document.querySelector(\"#portal-mount-point\") as HTMLElement;\n\n const renderRoot: RenderRoot = {\n tag: RenderTag.ROOT,\n container: main,\n createPortal: portal,\n };\n\n const cleanUpPreviousRender = (): void => {\n unmountTree(main);\n unmountTree(portal);\n\n // Note: redirects can lead to multiple trash renderer contexts.\n this.#rendererContextTrashCan.add(prevRendererContext);\n for (const item of this.#rendererContextTrashCan) {\n if (item) {\n item.dispatchOnUnmount();\n item.dispose();\n }\n }\n this.#rendererContextTrashCan.clear();\n hooks?.messageDispatcher?.reset();\n\n if (appChanged) {\n this.#previousApp = previousApp;\n window.dispatchEvent(\n new CustomEvent(\"app.change\", {\n detail: {\n previousApp,\n currentApp,\n },\n })\n );\n }\n };\n\n setTheme(\n (currentApp &&\n (getLocalAppsTheme()[currentApp.id] || currentApp.theme)) ||\n \"light\"\n );\n setMode(\"default\");\n\n if (currentApp) {\n hooks?.checkInstalledApps?.preCheckInstalledApps(\n storyboard,\n (appId) => !!_internalApiGetAppInBootstrapData(appId)\n );\n\n const routeHelper: RouteHelper = {\n bailout: (output) => {\n if (output.unauthenticated) {\n redirectToLogin();\n return true;\n }\n if (output.redirect) {\n redirectTo(output.redirect.path, output.redirect.state);\n return true;\n }\n // Reset redirect count if no redirect is set.\n this.#redirectCount = 0;\n },\n mergeMenus: async (menuRequests) => {\n const menuConfs = await Promise.all(menuRequests);\n this.#navConfig = mergeMenuConfs(menuConfs);\n window.dispatchEvent(\n new CustomEvent(\"navConfig.change\", { detail: this.#navConfig })\n );\n },\n catch: async (error, returnNode) => {\n if (isUnauthenticatedError(error) && !window.NO_AUTH_GUARD) {\n redirectToLogin();\n return;\n } else if (error instanceof HttpAbortError) {\n this.#rendererContextTrashCan.add(prevRendererContext);\n return;\n } else {\n const noAuthGuardLoginPath =\n getRuntime().getMiscSettings().noAuthGuardLoginPath;\n if (isUnauthenticatedError(error) && noAuthGuardLoginPath) {\n redirectTo(noAuthGuardLoginPath as string, { from: location });\n return;\n }\n return {\n failed: true,\n output: {\n node: await ErrorNode(error, returnNode, true),\n blockingList: [],\n },\n };\n }\n },\n };\n\n const rendererContext = (this.#rendererContext = new RendererContext(\n \"page\",\n { routeHelper, renderId }\n ));\n\n const runtimeContext: RuntimeContext = (this.#runtimeContext = {\n app: currentApp,\n location,\n query: new URLSearchParams(location.search),\n flags,\n sys: {\n ...hooks?.auth?.getAuth(),\n ...getPageInfo(),\n settings: {\n brand: getRuntime().getBrandSettings(),\n },\n },\n ctxStore: new DataStore(\"CTX\", undefined, rendererContext),\n pendingPermissionsPreCheck: [\n hooks?.checkPermissions?.preCheckPermissions(storyboard),\n ],\n tplStateStoreMap: new Map<string, DataStore<\"STATE\">>(),\n formStateStoreMap: new Map<string, DataStore<\"FORM_STATE\">>(),\n });\n\n this.#navConfig = undefined;\n\n registerCustomTemplates(storyboard);\n registerStoryboardFunctions(storyboard.meta?.functions, currentApp);\n hooks?.flowApi?.collectContract(storyboard.meta?.contracts);\n\n let failed = false;\n let output: RenderOutput;\n let stores: DataStore<\"CTX\" | \"STATE\" | \"FORM_STATE\">[] = [];\n\n try {\n clearMatchedRoutes();\n const rootMenuRequestNode: MenuRequestNode = {};\n output = await renderRoutes(\n renderRoot,\n insertPreviewRoutes(storyboard.routes),\n runtimeContext,\n rendererContext,\n [],\n rootMenuRequestNode\n );\n if (routeHelper.bailout(output)) {\n return;\n }\n\n stores = getDataStores(runtimeContext);\n\n await postAsyncRender(output, runtimeContext, stores);\n\n rootMenuRequestNode.child = output.menuRequestNode;\n rendererContext.setInitialMenuRequestNode(rootMenuRequestNode);\n await routeHelper.mergeMenus(rendererContext.getMenuRequests());\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error(\"Router failed:\", error);\n\n const result = await routeHelper.catch(error, renderRoot);\n if (!result) {\n return;\n }\n ({ failed, output } = result);\n }\n renderRoot.child = output.node;\n\n cleanUpPreviousRender();\n\n if ((output.route && output.route.type !== \"routes\") || failed) {\n if (!failed) {\n // There is a window to set theme and mode by `lifeCycle.onBeforePageLoad`.\n rendererContext.dispatchBeforePageLoad();\n }\n applyTheme();\n applyMode();\n\n setUIVersion(currentApp?.uiVersion);\n mountTree(renderRoot);\n\n // Scroll to top after each rendering.\n // See https://github.com/ReactTraining/react-router/blob/master/packages/react-router-dom/docs/guides/scroll-restoration.md\n window.scrollTo(0, 0);\n\n if (!failed) {\n rendererContext.dispatchPageLoad();\n rendererContext.dispatchAnchorLoad();\n rendererContext.dispatchOnMount();\n rendererContext.initializeScrollIntoView();\n rendererContext.initializeMediaChange();\n rendererContext.initializeMessageDispatcher();\n\n for (const store of stores) {\n store.mountAsyncData();\n }\n\n finishPageView?.({\n status: \"ok\",\n path: output.path,\n pageTitle: document.title,\n });\n } else {\n finishPageView?.({ status: \"failed\" });\n }\n devtoolsHookEmit(\"rendered\");\n\n return;\n }\n } else if (\n !window.NO_AUTH_GUARD &&\n hooks?.auth &&\n !hooks.auth.isLoggedIn()\n ) {\n // Todo(steve): refine after api-gateway supports fetching storyboards before logged in.\n // Redirect to login if no storyboard is matched.\n redirectToLogin();\n return;\n } else {\n cleanUpPreviousRender();\n }\n\n applyTheme();\n applyMode();\n\n const node = await ErrorNode(\n new PageNotFoundError(currentApp ? \"page not found\" : \"app not found\"),\n renderRoot,\n true\n );\n renderRoot.child = node;\n\n mountTree(renderRoot);\n\n // Scroll to top after each rendering.\n window.scrollTo(0, 0);\n finishPageView?.({ status: \"not-found\" });\n devtoolsHookEmit(\"rendered\");\n }\n}\n\nfunction mergeMenuConfs(menuConfs: StaticMenuConf[]) {\n const navConfig = {\n breadcrumb: [] as BreadcrumbItemConf[],\n };\n for (const menuConf of menuConfs) {\n const { breadcrumb } = menuConf;\n if (breadcrumb) {\n if (breadcrumb.overwrite) {\n navConfig.breadcrumb = breadcrumb.items;\n } else {\n navConfig.breadcrumb.push(...breadcrumb.items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S,EAC1B,IAAI6D,4BAAiB,CAACjN,UAAU,GAAG,gBAAgB,GAAG,eAAe,CAAC,EACtEkG,UAAU,EACV,IACF,CAAC;EACDA,UAAU,CAACsF,KAAK,GAAGrC,IAAI;EAEvB,IAAAiD,gBAAS,EAAClG,UAAU,CAAC;;EAErB;EACAlH,MAAM,CAACqN,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC;EACrBhI,cAAc,aAAdA,cAAc,eAAdA,cAAc,CAAG;IAAEqB,MAAM,EAAE;EAAY,CAAC,CAAC;EACzC,IAAAlC,0BAAgB,EAAC,UAAU,CAAC;AAC9B;AAGF,SAASmF,cAAcA,CAACH,SAA2B,EAAE;EACnD,MAAM0E,SAAS,GAAG;IAChBC,UAAU,EAAE;EACd,CAAC;EACD,KAAK,MAAMC,QAAQ,IAAI5E,SAAS,EAAE;IAChC,MAAM;MAAE2E;IAAW,CAAC,GAAGC,QAAQ;IAC/B,IAAID,UAAU,EAAE;MACd,IAAIA,UAAU,CAACE,SAAS,EAAE;QACxBH,SAAS,CAACC,UAAU,GAAGA,UAAU,CAACG,KAAK;MACzC,CAAC,MAAM;QACLJ,SAAS,CAACC,UAAU,CAACI,IAAI,CAAC,GAAGJ,UAAU,CAACG,KAAK,CAAC;MAChD;IACF;EACF;EACA,OAAOJ,SAAS;AAClB","ignoreList":[]}
1
+ {"version":3,"file":"Router.js","names":["_history2","require","_http","_cook","_lodash","_history3","_Renderer","_DataStore","_resolveData","_mount","_matchStoryboard","_StoryboardFunctions","_RendererContext","_themeAndMode","_Runtime","_getPageInfo","_markAsComputed","_handleHttpError","_abortController","_setLoginStateCookie","_registerCustomTemplates","_fulfilStoryboard","_enums","_insertPreviewRoutes","_devtools","_setUIVersion","_setAppVariable","_setWatermark","_routeMatchedMap","_ErrorNode","_storyboards","WeakMap","_rendering","_nextRender","_runtimeContext","_rendererContext","_rendererContextTrashCan","_redirectCount","_renderId","_currentApp","_previousApp","_navConfig","_Router_brand","WeakSet","Router","constructor","storyboards","_classPrivateMethodInitSpec2","default","_classPrivateFieldInitSpec2","Set","_classPrivateFieldSet2","history","getHistory","window","addEventListener","event","message","_assertClassBrand2","_getBlockMessageBeforePageLave","call","preventDefault","returnValue","block","location","action","getRenderId","_classPrivateFieldGet6","getRuntimeContext","getRecentApps","currentApp","previousApp","getNavConfig","bootstrap","initAbortController","nextPrevLocation","listen","prevLocation","_queuedRender","catch","handleHttpError","exports","detail","_classPrivateFieldGet2","previousMessage","getBlockMessage","dispatchBeforePageLeave","unblock","_safeRedirect","to","state","from","_this$redirectCount","_this$redirectCount2","pathname","search","hash","process","env","NODE_ENV","console","error","Error","replace","next","_preRender","nextRender","undefined","_prevLocation$state","_location$state","_location$state2","_classPrivateFieldGet4","ignoreRendering","omittedLocationProps","key","notify","locationsAreEqual","noIncremental","_classPrivateFieldGet3","didPerformIncrementalRender","abortPendingRequest","dispatchPageLeave","storyboard","matchStoryboard","isOutsideApp","reload","devtoolsHookEmit","_render","isBootstrap","_hooks$flowApi","_hooks$pageView","_classPrivateFieldGet5","_storyboard$app","renderId","uniqueId","resetAllComputedMarks","clearResolveCache","hooks","flowApi","clearCollectWidgetContract","finishPageView","pageView","create","app","currentAppId","id","BOOTSTRAP_UNION_FILE","setAppVariable","appId","version","currentVersion","fulfilStoryboard","setWatermark","appChanged","clearExpressionASTCache","clearFunctionASTCache","flags","getRuntime","getFeatureFlags","prevRendererContext","redirectTo","status","add","redirectToLogin","setLoginStateCookie","main","document","querySelector","portal","renderRoot","tag","RenderTag","ROOT","container","createPortal","cleanUpPreviousRender","_hooks$messageDispatc","unmountTree","item","dispatchOnUnmount","dispose","clear","messageDispatcher","reset","dispatchEvent","CustomEvent","setTheme","getLocalAppsTheme","theme","setMode","_hooks$checkInstalled","_hooks$auth","_hooks$checkPermissio","_storyboard$meta","_hooks$flowApi2","_storyboard$meta2","checkInstalledApps","preCheckInstalledApps","_internalApiGetAppInBootstrapData","routeHelper","bailout","output","unauthenticated","redirect","path","mergeMenus","menuRequests","menuConfs","Promise","all","mergeMenuConfs","returnNode","isCurrentBootstrap","isReCatch","isUnauthenticatedError","NO_AUTH_GUARD","HttpAbortError","noAuthGuardLoginPath","getMiscSettings","failed","node","ErrorNode","blockingList","rendererContext","RendererContext","runtimeContext","query","URLSearchParams","sys","auth","getAuth","getPageInfo","settings","brand","getBrandSettings","ctxStore","DataStore","pendingPermissionsPreCheck","checkPermissions","preCheckPermissions","tplStateStoreMap","Map","formStateStoreMap","registerCustomTemplates","registerStoryboardFunctions","meta","functions","collectContract","contracts","stores","clearMatchedRoutes","rootMenuRequestNode","renderRoutes","insertPreviewRoutes","routes","getDataStores","postAsyncRender","child","menuRequestNode","setInitialMenuRequestNode","getMenuRequests","result","route","type","dispatchBeforePageLoad","applyTheme","applyMode","setUIVersion","uiVersion","mountTree","scrollTo","dispatchPageLoad","dispatchAnchorLoad","dispatchOnMount","initializeScrollIntoView","initializeMediaChange","initializeMessageDispatcher","store","mountAsyncData","pageTitle","title","isLoggedIn","PageNotFoundError","navConfig","breadcrumb","menuConf","overwrite","items","push"],"sources":["../../../src/internal/Router.ts"],"sourcesContent":["import { Action, locationsAreEqual } from \"history\";\nimport type {\n BreadcrumbItemConf,\n MicroApp,\n StaticMenuConf,\n Storyboard,\n} from \"@next-core/types\";\nimport { HttpAbortError } from \"@next-core/http\";\nimport {\n clearExpressionASTCache,\n clearFunctionASTCache,\n} from \"@next-core/cook\";\nimport { uniqueId } from \"lodash\";\nimport { NextHistoryState, NextLocation, getHistory } from \"../history.js\";\nimport {\n RenderOutput,\n getDataStores,\n postAsyncRender,\n renderRoutes,\n} from \"./Renderer.js\";\nimport { DataStore } from \"./data/DataStore.js\";\nimport { clearResolveCache } from \"./data/resolveData.js\";\nimport { mountTree, unmountTree } from \"./mount.js\";\nimport { isOutsideApp, matchStoryboard } from \"./matchStoryboard.js\";\nimport { registerStoryboardFunctions } from \"./compute/StoryboardFunctions.js\";\nimport { RendererContext, RouteHelper } from \"./RendererContext.js\";\nimport {\n applyMode,\n applyTheme,\n getLocalAppsTheme,\n setMode,\n setTheme,\n} from \"../themeAndMode.js\";\nimport {\n _internalApiGetAppInBootstrapData,\n getRuntime,\n hooks,\n} from \"./Runtime.js\";\nimport { getPageInfo } from \"../getPageInfo.js\";\nimport type {\n MenuRequestNode,\n RenderRoot,\n RuntimeContext,\n} from \"./interfaces.js\";\nimport { resetAllComputedMarks } from \"./compute/markAsComputed.js\";\nimport { handleHttpError, isUnauthenticatedError } from \"../handleHttpError.js\";\nimport { abortPendingRequest, initAbortController } from \"./abortController.js\";\nimport { setLoginStateCookie } from \"../setLoginStateCookie.js\";\nimport { registerCustomTemplates } from \"./registerCustomTemplates.js\";\nimport { fulfilStoryboard } from \"./fulfilStoryboard.js\";\nimport { RenderTag } from \"./enums.js\";\nimport { insertPreviewRoutes } from \"./insertPreviewRoutes.js\";\nimport { devtoolsHookEmit } from \"./devtools.js\";\nimport { setUIVersion } from \"../setUIVersion.js\";\nimport { setAppVariable } from \"../setAppVariable.js\";\nimport { setWatermark } from \"../setWatermark.js\";\nimport { clearMatchedRoutes } from \"./routeMatchedMap.js\";\nimport { ErrorNode, PageNotFoundError } from \"./ErrorNode.js\";\n\ntype RenderTask = InitialRenderTask | SubsequentRenderTask;\n\ninterface InitialRenderTask {\n location: NextLocation;\n prevLocation?: undefined;\n action?: undefined;\n}\n\ninterface SubsequentRenderTask {\n location: NextLocation;\n prevLocation: NextLocation;\n action: Action;\n}\n\nexport class Router {\n readonly #storyboards: Storyboard[];\n #rendering = false;\n #nextRender?: RenderTask;\n #runtimeContext?: RuntimeContext;\n #rendererContext?: RendererContext;\n #rendererContextTrashCan = new Set<RendererContext | undefined>();\n #redirectCount = 0;\n #renderId?: string;\n #currentApp?: MicroApp;\n #previousApp?: MicroApp;\n #navConfig?: {\n breadcrumb?: BreadcrumbItemConf[];\n };\n\n constructor(storyboards: Storyboard[]) {\n this.#storyboards = storyboards;\n\n const history = getHistory();\n window.addEventListener(\"beforeunload\", (event) => {\n const message = this.#getBlockMessageBeforePageLave({});\n // See examples in https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers/onbeforeunload\n if (message) {\n // Cancel the event\n // If you prevent default behavior in Mozilla Firefox prompt will always be shown\n event.preventDefault();\n // Chrome requires returnValue to be set\n event.returnValue = \"\";\n } else {\n // the absence of a returnValue property on the event will guarantee the browser unload happens\n delete event.returnValue;\n }\n });\n\n history.block((location, action) =>\n this.#getBlockMessageBeforePageLave({ location, action })\n );\n }\n\n getRenderId() {\n return this.#renderId;\n }\n\n // istanbul ignore next\n getRuntimeContext() {\n return this.#runtimeContext;\n }\n\n getRecentApps() {\n return {\n currentApp: this.#currentApp,\n previousApp: this.#previousApp,\n };\n }\n\n getNavConfig() {\n return this.#navConfig;\n }\n\n #getBlockMessageBeforePageLave(detail: {\n location?: NextLocation;\n action?: Action;\n }): string | undefined {\n const history = getHistory();\n const previousMessage = history.getBlockMessage();\n this.#rendererContext?.dispatchBeforePageLeave(detail);\n const message = history.getBlockMessage();\n if (!previousMessage && message) {\n // Auto unblock only if new block was introduced by `onBeforePageLeave`.\n history.unblock();\n }\n return message;\n }\n\n #safeRedirect(\n to: string,\n state: NextHistoryState | undefined,\n from: NextLocation\n ): void {\n if (this.#redirectCount++ > 10) {\n const message = `Infinite redirect detected: from \"${from.pathname}${from.search}${from.hash}\" to \"${to}\"`;\n // istanbul ignore else: error cannot be caught in test\n if (process.env.NODE_ENV === \"test\") {\n // eslint-disable-next-line no-console\n console.error(message);\n return;\n } else {\n throw new Error(message);\n }\n }\n getHistory().replace(to, state);\n }\n\n bootstrap() {\n initAbortController();\n const history = getHistory();\n let nextPrevLocation = history.location;\n history.listen((location, action) => {\n const prevLocation = nextPrevLocation;\n nextPrevLocation = location;\n if (this.#rendering) {\n this.#nextRender = { location, prevLocation, action };\n } else {\n this.#queuedRender({\n location,\n prevLocation,\n action,\n }).catch(handleHttpError);\n }\n });\n return this.#queuedRender({ location: history.location });\n }\n\n async #queuedRender(next: RenderTask) {\n this.#rendering = true;\n try {\n await this.#preRender(next);\n } finally {\n this.#rendering = false;\n if (this.#nextRender) {\n const nextRender = this.#nextRender;\n this.#nextRender = undefined;\n await this.#queuedRender(nextRender);\n }\n }\n }\n\n async #preRender({ location, prevLocation, action }: RenderTask) {\n if (prevLocation) {\n let ignoreRendering: boolean | undefined;\n const omittedLocationProps: Partial<NextLocation> = {\n hash: undefined,\n state: undefined,\n };\n // Omit the \"key\" when checking whether locations are equal in certain situations.\n if (\n // When current location is triggered by browser action of hash link.\n location.key === undefined ||\n // When current location is triggered by browser action of non-push-or-replace,\n // such as goBack or goForward,\n (action === \"POP\" &&\n // and the previous location was triggered by hash link,\n (prevLocation.key === undefined ||\n // or the previous location specified notify false.\n prevLocation.state?.notify === false))\n ) {\n omittedLocationProps.key = undefined;\n }\n if (\n locationsAreEqual(\n { ...prevLocation, ...omittedLocationProps },\n { ...location, ...omittedLocationProps }\n ) ||\n (action !== \"POP\" && location.state?.notify === false)\n ) {\n // Ignore rendering if location not changed except hash, state and optional key.\n // Ignore rendering if notify is `false`.\n ignoreRendering = true;\n }\n\n if (!ignoreRendering && !location.state?.noIncremental) {\n ignoreRendering =\n await this.#rendererContext?.didPerformIncrementalRender(\n location,\n prevLocation\n );\n }\n\n if (ignoreRendering) {\n return;\n }\n\n abortPendingRequest();\n this.#rendererContext?.dispatchPageLeave();\n\n if (action === \"POP\") {\n const storyboard = matchStoryboard(\n this.#storyboards,\n location.pathname\n );\n // When a browser action of goBack or goForward is performing,\n // force reload when the target page is a page of an outside app.\n if (isOutsideApp(storyboard)) {\n window.location.reload();\n return;\n }\n }\n\n devtoolsHookEmit(\"locationChange\");\n }\n\n return this.#render(location, !prevLocation);\n }\n\n async #render(location: NextLocation, isBootstrap: boolean): Promise<void> {\n const renderId = (this.#renderId = uniqueId(\"render-id-\"));\n\n resetAllComputedMarks();\n clearResolveCache();\n hooks?.flowApi?.clearCollectWidgetContract();\n\n const history = getHistory();\n history.unblock();\n\n // const renderStartTime = performance.now();\n const finishPageView = hooks?.pageView?.create();\n\n const storyboard = matchStoryboard(this.#storyboards, location.pathname);\n\n const previousApp = this.#runtimeContext?.app;\n const currentAppId = storyboard?.app?.id;\n // dynamically change the value of the APP variable, if it's union app\n if (\n window.BOOTSTRAP_UNION_FILE &&\n currentAppId &&\n currentAppId !== previousApp?.id\n ) {\n setAppVariable({\n appId: currentAppId,\n version: storyboard.app.currentVersion!,\n });\n }\n\n if (storyboard?.app) {\n await fulfilStoryboard(storyboard);\n }\n\n const currentApp = (this.#currentApp = storyboard?.app);\n\n setWatermark();\n\n // Storyboard maybe re-assigned, e.g. when open launchpad.\n const appChanged =\n previousApp && currentApp\n ? previousApp.id !== currentApp.id\n : previousApp !== currentApp;\n\n clearExpressionASTCache();\n if (appChanged) {\n clearFunctionASTCache();\n }\n\n // TODO: handle favicon\n\n // Set `Router::#currentApp` before calling `getFeatureFlags()`\n const flags = getRuntime().getFeatureFlags();\n const prevRendererContext = this.#rendererContext;\n\n const redirectTo = (to: string, state?: NextHistoryState): void => {\n finishPageView?.({\n status: \"redirected\",\n });\n this.#rendererContextTrashCan.add(prevRendererContext);\n this.#safeRedirect(to, state, location);\n };\n\n const redirectToLogin = (): void => {\n const to = flags[\"sso-enabled\"] ? \"/sso-auth/login\" : \"/auth/login\";\n setLoginStateCookie(location);\n redirectTo(to, { from: location });\n };\n\n const main = document.querySelector(\"#main-mount-point\") as HTMLElement;\n const portal = document.querySelector(\"#portal-mount-point\") as HTMLElement;\n\n const renderRoot: RenderRoot = {\n tag: RenderTag.ROOT,\n container: main,\n createPortal: portal,\n };\n\n const cleanUpPreviousRender = (): void => {\n unmountTree(main);\n unmountTree(portal);\n\n // Note: redirects can lead to multiple trash renderer contexts.\n this.#rendererContextTrashCan.add(prevRendererContext);\n for (const item of this.#rendererContextTrashCan) {\n if (item) {\n item.dispatchOnUnmount();\n item.dispose();\n }\n }\n this.#rendererContextTrashCan.clear();\n hooks?.messageDispatcher?.reset();\n\n if (appChanged) {\n this.#previousApp = previousApp;\n window.dispatchEvent(\n new CustomEvent(\"app.change\", {\n detail: {\n previousApp,\n currentApp,\n },\n })\n );\n }\n };\n\n setTheme(\n (currentApp &&\n (getLocalAppsTheme()[currentApp.id] || currentApp.theme)) ||\n \"light\"\n );\n setMode(\"default\");\n\n if (currentApp) {\n hooks?.checkInstalledApps?.preCheckInstalledApps(\n storyboard,\n (appId) => !!_internalApiGetAppInBootstrapData(appId)\n );\n\n const routeHelper: RouteHelper = {\n bailout: (output) => {\n if (output.unauthenticated) {\n redirectToLogin();\n return true;\n }\n if (output.redirect) {\n redirectTo(output.redirect.path, output.redirect.state);\n return true;\n }\n // Reset redirect count if no redirect is set.\n this.#redirectCount = 0;\n },\n mergeMenus: async (menuRequests) => {\n const menuConfs = await Promise.all(menuRequests);\n this.#navConfig = mergeMenuConfs(menuConfs);\n window.dispatchEvent(\n new CustomEvent(\"navConfig.change\", { detail: this.#navConfig })\n );\n },\n catch: async (error, returnNode, isCurrentBootstrap, isReCatch) => {\n if (isUnauthenticatedError(error) && !window.NO_AUTH_GUARD) {\n redirectToLogin();\n return;\n } else if (error instanceof HttpAbortError) {\n this.#rendererContextTrashCan.add(prevRendererContext);\n return;\n } else {\n const noAuthGuardLoginPath =\n getRuntime().getMiscSettings().noAuthGuardLoginPath;\n if (isUnauthenticatedError(error) && noAuthGuardLoginPath) {\n redirectTo(noAuthGuardLoginPath as string, { from: location });\n return;\n }\n if (isCurrentBootstrap) {\n throw error;\n }\n return {\n failed: true,\n output: {\n node: await ErrorNode(error, returnNode, !isReCatch),\n blockingList: [],\n },\n };\n }\n },\n };\n\n const rendererContext = (this.#rendererContext = new RendererContext(\n \"page\",\n { routeHelper, renderId }\n ));\n\n const runtimeContext: RuntimeContext = (this.#runtimeContext = {\n app: currentApp,\n location,\n query: new URLSearchParams(location.search),\n flags,\n sys: {\n ...hooks?.auth?.getAuth(),\n ...getPageInfo(),\n settings: {\n brand: getRuntime().getBrandSettings(),\n },\n },\n ctxStore: new DataStore(\"CTX\", undefined, rendererContext),\n pendingPermissionsPreCheck: [\n hooks?.checkPermissions?.preCheckPermissions(storyboard),\n ],\n tplStateStoreMap: new Map<string, DataStore<\"STATE\">>(),\n formStateStoreMap: new Map<string, DataStore<\"FORM_STATE\">>(),\n });\n\n this.#navConfig = undefined;\n\n registerCustomTemplates(storyboard);\n registerStoryboardFunctions(storyboard.meta?.functions, currentApp);\n hooks?.flowApi?.collectContract(storyboard.meta?.contracts);\n\n let failed = false;\n let output: RenderOutput;\n let stores: DataStore<\"CTX\" | \"STATE\" | \"FORM_STATE\">[] = [];\n\n try {\n clearMatchedRoutes();\n const rootMenuRequestNode: MenuRequestNode = {};\n output = await renderRoutes(\n renderRoot,\n insertPreviewRoutes(storyboard.routes),\n runtimeContext,\n rendererContext,\n [],\n rootMenuRequestNode\n );\n if (routeHelper.bailout(output)) {\n return;\n }\n\n stores = getDataStores(runtimeContext);\n\n await postAsyncRender(output, runtimeContext, stores);\n\n rootMenuRequestNode.child = output.menuRequestNode;\n rendererContext.setInitialMenuRequestNode(rootMenuRequestNode);\n await routeHelper.mergeMenus(rendererContext.getMenuRequests());\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error(\"Router failed:\", error);\n const result = await routeHelper.catch(error, renderRoot, isBootstrap);\n if (!result) {\n return;\n }\n ({ failed, output } = result);\n }\n renderRoot.child = output.node;\n\n cleanUpPreviousRender();\n\n if ((output.route && output.route.type !== \"routes\") || failed) {\n if (!failed) {\n // There is a window to set theme and mode by `lifeCycle.onBeforePageLoad`.\n rendererContext.dispatchBeforePageLoad();\n }\n applyTheme();\n applyMode();\n\n setUIVersion(currentApp?.uiVersion);\n mountTree(renderRoot);\n\n // Scroll to top after each rendering.\n // See https://github.com/ReactTraining/react-router/blob/master/packages/react-router-dom/docs/guides/scroll-restoration.md\n window.scrollTo(0, 0);\n\n if (!failed) {\n rendererContext.dispatchPageLoad();\n rendererContext.dispatchAnchorLoad();\n rendererContext.dispatchOnMount();\n rendererContext.initializeScrollIntoView();\n rendererContext.initializeMediaChange();\n rendererContext.initializeMessageDispatcher();\n\n for (const store of stores) {\n store.mountAsyncData();\n }\n\n finishPageView?.({\n status: \"ok\",\n path: output.path,\n pageTitle: document.title,\n });\n } else {\n finishPageView?.({ status: \"failed\" });\n }\n devtoolsHookEmit(\"rendered\");\n\n return;\n }\n } else if (\n !window.NO_AUTH_GUARD &&\n hooks?.auth &&\n !hooks.auth.isLoggedIn()\n ) {\n // Todo(steve): refine after api-gateway supports fetching storyboards before logged in.\n // Redirect to login if no storyboard is matched.\n redirectToLogin();\n return;\n } else {\n cleanUpPreviousRender();\n }\n\n applyTheme();\n applyMode();\n\n const node = await ErrorNode(\n new PageNotFoundError(currentApp ? \"page not found\" : \"app not found\"),\n renderRoot,\n true\n );\n renderRoot.child = node;\n\n mountTree(renderRoot);\n\n // Scroll to top after each rendering.\n window.scrollTo(0, 0);\n finishPageView?.({ status: \"not-found\" });\n devtoolsHookEmit(\"rendered\");\n }\n}\n\nfunction mergeMenuConfs(menuConfs: StaticMenuConf[]) {\n const navConfig = {\n breadcrumb: [] as BreadcrumbItemConf[],\n };\n for (const menuConf of menuConfs) {\n const { breadcrumb } = menuConf;\n if (breadcrumb) {\n if (breadcrumb.overwrite) {\n navConfig.breadcrumb = breadcrumb.items;\n } else {\n navConfig.breadcrumb.push(...breadcrumb.items);\n }\n }\n }\n return navConfig;\n}\n"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AAOA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AAIA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AAMA,IAAAM,UAAA,GAAAN,OAAA;AACA,IAAAO,YAAA,GAAAP,OAAA;AACA,IAAAQ,MAAA,GAAAR,OAAA;AACA,IAAAS,gBAAA,GAAAT,OAAA;AACA,IAAAU,oBAAA,GAAAV,O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,aAAdA,cAAc,eAAdA,cAAc,CAAG;IAAEqB,MAAM,EAAE;EAAY,CAAC,CAAC;EACzC,IAAAnC,0BAAgB,EAAC,UAAU,CAAC;AAC9B;AAGF,SAASoF,cAAcA,CAACH,SAA2B,EAAE;EACnD,MAAM4E,SAAS,GAAG;IAChBC,UAAU,EAAE;EACd,CAAC;EACD,KAAK,MAAMC,QAAQ,IAAI9E,SAAS,EAAE;IAChC,MAAM;MAAE6E;IAAW,CAAC,GAAGC,QAAQ;IAC/B,IAAID,UAAU,EAAE;MACd,IAAIA,UAAU,CAACE,SAAS,EAAE;QACxBH,SAAS,CAACC,UAAU,GAAGA,UAAU,CAACG,KAAK;MACzC,CAAC,MAAM;QACLJ,SAAS,CAACC,UAAU,CAACI,IAAI,CAAC,GAAGJ,UAAU,CAACG,KAAK,CAAC;MAChD;IACF;EACF;EACA,OAAOJ,SAAS;AAClB","ignoreList":[]}
@@ -16,6 +16,7 @@ let K = exports.K = /*#__PURE__*/function (K) {
16
16
  K["UNKNOWN_ERROR"] = "UNKNOWN_ERROR";
17
17
  K["GO_BACK_TO_PREVIOUS_PAGE"] = "GO_BACK_TO_PREVIOUS_PAGE";
18
18
  K["GO_BACK_HOME"] = "GO_BACK_HOME";
19
+ K["RELOAD"] = "RELOAD";
19
20
  return K;
20
21
  }({});
21
22
  const en = {
@@ -29,7 +30,8 @@ const en = {
29
30
  [K.APP_NOT_FOUND]: "App not found, maybe the URL is wrong or you don't have permission to access",
30
31
  [K.UNKNOWN_ERROR]: "Oops! Something went wrong",
31
32
  [K.GO_BACK_TO_PREVIOUS_PAGE]: "Go back to previous page",
32
- [K.GO_BACK_HOME]: "Go back to home page"
33
+ [K.GO_BACK_HOME]: "Go back to home page",
34
+ [K.RELOAD]: "Reload"
33
35
  };
34
36
  const zh = {
35
37
  [K.REQUEST_FAILED]: "请求失败",
@@ -42,7 +44,8 @@ const zh = {
42
44
  [K.APP_NOT_FOUND]: "请求的微应用无法找到, 可能是 URL 错误或者无权限访问",
43
45
  [K.UNKNOWN_ERROR]: "糟糕!页面出现了一些问题",
44
46
  [K.GO_BACK_TO_PREVIOUS_PAGE]: "回到上一页",
45
- [K.GO_BACK_HOME]: "回到首页"
47
+ [K.GO_BACK_HOME]: "回到首页",
48
+ [K.RELOAD]: "刷新"
46
49
  };
47
50
  const NS = exports.NS = "core/runtime";
48
51
  const locales = exports.locales = {
@@ -1 +1 @@
1
- {"version":3,"file":"i18n.js","names":["K","exports","en","REQUEST_FAILED","SOMETHING_WENT_WRONG","LOGIN_TIMEOUT_MESSAGE","NETWORK_ERROR","LICENSE_EXPIRED","NO_PERMISSION","PAGE_NOT_FOUND","APP_NOT_FOUND","UNKNOWN_ERROR","GO_BACK_TO_PREVIOUS_PAGE","GO_BACK_HOME","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 LICENSE_EXPIRED = \"LICENSE_EXPIRED\",\n NO_PERMISSION = \"NO_PERMISSION\",\n PAGE_NOT_FOUND = \"PAGE_NOT_FOUND\",\n APP_NOT_FOUND = \"APP_NOT_FOUND\",\n UNKNOWN_ERROR = \"UNKNOWN_ERROR\",\n GO_BACK_TO_PREVIOUS_PAGE = \"GO_BACK_TO_PREVIOUS_PAGE\",\n GO_BACK_HOME = \"GO_BACK_HOME\",\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 [K.LICENSE_EXPIRED]:\n \"The license authorization has expired, please contact the platform administrator\",\n [K.NO_PERMISSION]:\n \"Unauthorized access, unable to retrieve the required resources for this page\",\n [K.PAGE_NOT_FOUND]: \"Page not found, please check the URL\",\n [K.APP_NOT_FOUND]:\n \"App not found, maybe the URL is wrong or you don't have permission to access\",\n [K.UNKNOWN_ERROR]: \"Oops! Something went wrong\",\n [K.GO_BACK_TO_PREVIOUS_PAGE]: \"Go back to previous page\",\n [K.GO_BACK_HOME]: \"Go back to home page\",\n};\n\nconst zh: Locale = {\n [K.REQUEST_FAILED]: \"请求失败\",\n [K.SOMETHING_WENT_WRONG]: \"出现了一些问题!\",\n [K.LOGIN_TIMEOUT_MESSAGE]: \"您还未登录或登录信息已过期,现在重新登录?\",\n [K.NETWORK_ERROR]: \"网络错误,请检查您的网络连接。\",\n [K.LICENSE_EXPIRED]: \"License 授权失效,请联系平台管理员\",\n [K.NO_PERMISSION]: \"没有权限,无法获取页面所需要的资源\",\n [K.PAGE_NOT_FOUND]: \"请求的页面未找到,请确认 URL 是否正确\",\n [K.APP_NOT_FOUND]: \"请求的微应用无法找到, 可能是 URL 错误或者无权限访问\",\n [K.UNKNOWN_ERROR]: \"糟糕!页面出现了一些问题\",\n [K.GO_BACK_TO_PREVIOUS_PAGE]: \"回到上一页\",\n [K.GO_BACK_HOME]: \"回到首页\",\n};\n\nexport const NS = \"core/runtime\";\n\nexport const locales = { en, zh };\n\ntype Locale = { [key in K]: string };\n"],"mappings":";;;;;;IAAYA,CAAC,GAAAC,OAAA,CAAAD,CAAA,0BAADA,CAAC;EAADA,CAAC;EAADA,CAAC;EAADA,CAAC;EAADA,CAAC;EAADA,CAAC;EAADA,CAAC;EAADA,CAAC;EAADA,CAAC;EAADA,CAAC;EAADA,CAAC;EAADA,CAAC;EAAA,OAADA,CAAC;AAAA;AAcb,MAAME,EAAU,GAAG;EACjB,CAACF,CAAC,CAACG,cAAc,GAAG,gBAAgB;EACpC,CAACH,CAAC,CAACI,oBAAoB,GAAG,uBAAuB;EACjD,CAACJ,CAAC,CAACK,qBAAqB,GACtB,2EAA2E;EAC7E,CAACL,CAAC,CAACM,aAAa,GAAG,2CAA2C;EAC9D,CAACN,CAAC,CAACO,eAAe,GAChB,kFAAkF;EACpF,CAACP,CAAC,CAACQ,aAAa,GACd,8EAA8E;EAChF,CAACR,CAAC,CAACS,cAAc,GAAG,sCAAsC;EAC1D,CAACT,CAAC,CAACU,aAAa,GACd,8EAA8E;EAChF,CAACV,CAAC,CAACW,aAAa,GAAG,4BAA4B;EAC/C,CAACX,CAAC,CAACY,wBAAwB,GAAG,0BAA0B;EACxD,CAACZ,CAAC,CAACa,YAAY,GAAG;AACpB,CAAC;AAED,MAAMC,EAAU,GAAG;EACjB,CAACd,CAAC,CAACG,cAAc,GAAG,MAAM;EAC1B,CAACH,CAAC,CAACI,oBAAoB,GAAG,UAAU;EACpC,CAACJ,CAAC,CAACK,qBAAqB,GAAG,uBAAuB;EAClD,CAACL,CAAC,CAACM,aAAa,GAAG,iBAAiB;EACpC,CAACN,CAAC,CAACO,eAAe,GAAG,uBAAuB;EAC5C,CAACP,CAAC,CAACQ,aAAa,GAAG,mBAAmB;EACtC,CAACR,CAAC,CAACS,cAAc,GAAG,uBAAuB;EAC3C,CAACT,CAAC,CAACU,aAAa,GAAG,+BAA+B;EAClD,CAACV,CAAC,CAACW,aAAa,GAAG,cAAc;EACjC,CAACX,CAAC,CAACY,wBAAwB,GAAG,OAAO;EACrC,CAACZ,CAAC,CAACa,YAAY,GAAG;AACpB,CAAC;AAEM,MAAME,EAAE,GAAAd,OAAA,CAAAc,EAAA,GAAG,cAAc;AAEzB,MAAMC,OAAO,GAAAf,OAAA,CAAAe,OAAA,GAAG;EAAEd,EAAE;EAAEY;AAAG,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"i18n.js","names":["K","exports","en","REQUEST_FAILED","SOMETHING_WENT_WRONG","LOGIN_TIMEOUT_MESSAGE","NETWORK_ERROR","LICENSE_EXPIRED","NO_PERMISSION","PAGE_NOT_FOUND","APP_NOT_FOUND","UNKNOWN_ERROR","GO_BACK_TO_PREVIOUS_PAGE","GO_BACK_HOME","RELOAD","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 LICENSE_EXPIRED = \"LICENSE_EXPIRED\",\n NO_PERMISSION = \"NO_PERMISSION\",\n PAGE_NOT_FOUND = \"PAGE_NOT_FOUND\",\n APP_NOT_FOUND = \"APP_NOT_FOUND\",\n UNKNOWN_ERROR = \"UNKNOWN_ERROR\",\n GO_BACK_TO_PREVIOUS_PAGE = \"GO_BACK_TO_PREVIOUS_PAGE\",\n GO_BACK_HOME = \"GO_BACK_HOME\",\n RELOAD = \"RELOAD\",\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 [K.LICENSE_EXPIRED]:\n \"The license authorization has expired, please contact the platform administrator\",\n [K.NO_PERMISSION]:\n \"Unauthorized access, unable to retrieve the required resources for this page\",\n [K.PAGE_NOT_FOUND]: \"Page not found, please check the URL\",\n [K.APP_NOT_FOUND]:\n \"App not found, maybe the URL is wrong or you don't have permission to access\",\n [K.UNKNOWN_ERROR]: \"Oops! Something went wrong\",\n [K.GO_BACK_TO_PREVIOUS_PAGE]: \"Go back to previous page\",\n [K.GO_BACK_HOME]: \"Go back to home page\",\n [K.RELOAD]: \"Reload\",\n};\n\nconst zh: Locale = {\n [K.REQUEST_FAILED]: \"请求失败\",\n [K.SOMETHING_WENT_WRONG]: \"出现了一些问题!\",\n [K.LOGIN_TIMEOUT_MESSAGE]: \"您还未登录或登录信息已过期,现在重新登录?\",\n [K.NETWORK_ERROR]: \"网络错误,请检查您的网络连接。\",\n [K.LICENSE_EXPIRED]: \"License 授权失效,请联系平台管理员\",\n [K.NO_PERMISSION]: \"没有权限,无法获取页面所需要的资源\",\n [K.PAGE_NOT_FOUND]: \"请求的页面未找到,请确认 URL 是否正确\",\n [K.APP_NOT_FOUND]: \"请求的微应用无法找到, 可能是 URL 错误或者无权限访问\",\n [K.UNKNOWN_ERROR]: \"糟糕!页面出现了一些问题\",\n [K.GO_BACK_TO_PREVIOUS_PAGE]: \"回到上一页\",\n [K.GO_BACK_HOME]: \"回到首页\",\n [K.RELOAD]: \"刷新\",\n};\n\nexport const NS = \"core/runtime\";\n\nexport const locales = { en, zh };\n\ntype Locale = { [key in K]: string };\n"],"mappings":";;;;;;IAAYA,CAAC,GAAAC,OAAA,CAAAD,CAAA,0BAADA,CAAC;EAADA,CAAC;EAADA,CAAC;EAADA,CAAC;EAADA,CAAC;EAADA,CAAC;EAADA,CAAC;EAADA,CAAC;EAADA,CAAC;EAADA,CAAC;EAADA,CAAC;EAADA,CAAC;EAADA,CAAC;EAAA,OAADA,CAAC;AAAA;AAeb,MAAME,EAAU,GAAG;EACjB,CAACF,CAAC,CAACG,cAAc,GAAG,gBAAgB;EACpC,CAACH,CAAC,CAACI,oBAAoB,GAAG,uBAAuB;EACjD,CAACJ,CAAC,CAACK,qBAAqB,GACtB,2EAA2E;EAC7E,CAACL,CAAC,CAACM,aAAa,GAAG,2CAA2C;EAC9D,CAACN,CAAC,CAACO,eAAe,GAChB,kFAAkF;EACpF,CAACP,CAAC,CAACQ,aAAa,GACd,8EAA8E;EAChF,CAACR,CAAC,CAACS,cAAc,GAAG,sCAAsC;EAC1D,CAACT,CAAC,CAACU,aAAa,GACd,8EAA8E;EAChF,CAACV,CAAC,CAACW,aAAa,GAAG,4BAA4B;EAC/C,CAACX,CAAC,CAACY,wBAAwB,GAAG,0BAA0B;EACxD,CAACZ,CAAC,CAACa,YAAY,GAAG,sBAAsB;EACxC,CAACb,CAAC,CAACc,MAAM,GAAG;AACd,CAAC;AAED,MAAMC,EAAU,GAAG;EACjB,CAACf,CAAC,CAACG,cAAc,GAAG,MAAM;EAC1B,CAACH,CAAC,CAACI,oBAAoB,GAAG,UAAU;EACpC,CAACJ,CAAC,CAACK,qBAAqB,GAAG,uBAAuB;EAClD,CAACL,CAAC,CAACM,aAAa,GAAG,iBAAiB;EACpC,CAACN,CAAC,CAACO,eAAe,GAAG,uBAAuB;EAC5C,CAACP,CAAC,CAACQ,aAAa,GAAG,mBAAmB;EACtC,CAACR,CAAC,CAACS,cAAc,GAAG,uBAAuB;EAC3C,CAACT,CAAC,CAACU,aAAa,GAAG,+BAA+B;EAClD,CAACV,CAAC,CAACW,aAAa,GAAG,cAAc;EACjC,CAACX,CAAC,CAACY,wBAAwB,GAAG,OAAO;EACrC,CAACZ,CAAC,CAACa,YAAY,GAAG,MAAM;EACxB,CAACb,CAAC,CAACc,MAAM,GAAG;AACd,CAAC;AAEM,MAAME,EAAE,GAAAf,OAAA,CAAAe,EAAA,GAAG,cAAc;AAEzB,MAAMC,OAAO,GAAAhB,OAAA,CAAAgB,OAAA,GAAG;EAAEf,EAAE;EAAEa;AAAG,CAAC","ignoreList":[]}
@@ -5,6 +5,7 @@ import { httpErrorToString } from "../handleHttpError.js";
5
5
  import { RenderTag } from "./enums.js";
6
6
  import { _internalApiGetPresetBricks, getBrickPackages } from "./Runtime.js";
7
7
  import { K, NS } from "./i18n.js";
8
+ import { getBasePath } from "../getBasePath.js";
8
9
  export class PageNotFoundError extends Error {
9
10
  constructor(message) {
10
11
  // Pass remaining arguments (including vendor specific ones) to parent constructor
@@ -34,7 +35,7 @@ export async function ErrorNode(error, returnNode, pageLevel) {
34
35
  const errorBrick = presetBricks.error ?? "illustrations.error-message";
35
36
  if (errorBrick !== false) {
36
37
  const linkBrick = "eo-link";
37
- const bricks = showLink ? [errorBrick, linkBrick] : [errorBrick];
38
+ const bricks = (showLink ? [errorBrick, linkBrick] : [errorBrick]).filter(brick => !customElements.get(brick));
38
39
  try {
39
40
  await Promise.race([loadBricksImperatively(bricks, getBrickPackages()),
40
41
  // Timeout after 3 seconds
@@ -56,21 +57,7 @@ export async function ErrorNode(error, returnNode, pageLevel) {
56
57
  return: returnNode
57
58
  };
58
59
  if (showLink) {
59
- node.child = {
60
- tag: RenderTag.BRICK,
61
- type: linkBrick,
62
- properties: {
63
- textContent: showLink === "home" ? i18n.t(`${NS}:${K.GO_BACK_HOME}`) : i18n.t(`${NS}:${K.GO_BACK_TO_PREVIOUS_PAGE}`),
64
- url: showLink === "home" ? "/" : undefined
65
- },
66
- events: showLink === "home" ? undefined : {
67
- click: {
68
- action: "history.goBack"
69
- }
70
- },
71
- runtimeContext: null,
72
- return: node
73
- };
60
+ node.child = getLinkNode(showLink, linkBrick, node, "");
74
61
  }
75
62
  return node;
76
63
  } catch (e) {
@@ -79,11 +66,12 @@ export async function ErrorNode(error, returnNode, pageLevel) {
79
66
  }
80
67
  }
81
68
  }
82
- return {
69
+ const useDefaultError = pageLevel && !!customElements.get("easyops-default-error");
70
+ const node = {
83
71
  tag: RenderTag.BRICK,
84
- type: "div",
72
+ type: useDefaultError ? "easyops-default-error" : "div",
85
73
  properties: {
86
- textContent: showDescription ? `${title}: ${httpErrorToString(error)}` : title,
74
+ errorTitle: title,
87
75
  dataset: {
88
76
  errorBoundary: ""
89
77
  },
@@ -94,6 +82,38 @@ export async function ErrorNode(error, returnNode, pageLevel) {
94
82
  runtimeContext: null,
95
83
  return: returnNode
96
84
  };
85
+ const descriptionNode = {
86
+ tag: RenderTag.BRICK,
87
+ type: "div",
88
+ properties: {
89
+ textContent: useDefaultError ? showDescription ? httpErrorToString(error) : "" : showDescription ? `${title}: ${httpErrorToString(error)}` : title
90
+ },
91
+ runtimeContext: null,
92
+ return: node
93
+ };
94
+ node.child = descriptionNode;
95
+ if (pageLevel && showLink) {
96
+ descriptionNode.sibling = getLinkNode(showLink, "a", node, useDefaultError ? "link" : "");
97
+ }
98
+ return node;
99
+ }
100
+ function getLinkNode(showLink, brick, parent, slotId) {
101
+ return {
102
+ tag: RenderTag.BRICK,
103
+ type: brick,
104
+ slotId,
105
+ properties: {
106
+ textContent: showLink === "home" ? i18n.t(`${NS}:${K.GO_BACK_HOME}`) : showLink === "reload" ? i18n.t(`${NS}:${K.RELOAD}`) : i18n.t(`${NS}:${K.GO_BACK_TO_PREVIOUS_PAGE}`),
107
+ href: showLink === "home" ? getBasePath() : showLink === "reload" ? location.href : undefined
108
+ },
109
+ events: showLink === "previous" ? {
110
+ click: {
111
+ action: "history.goBack"
112
+ }
113
+ } : undefined,
114
+ runtimeContext: null,
115
+ return: parent
116
+ };
97
117
  }
98
118
  function getRefinedErrorConf(error) {
99
119
  var _error$response, _error$responseJson;
@@ -108,11 +128,12 @@ function getRefinedErrorConf(error) {
108
128
  title: i18n.t(`${NS}:${K.PAGE_NOT_FOUND}`)
109
129
  };
110
130
  }
111
- if (error instanceof BrickLoadError || error instanceof Error && error.name === "ChunkLoadError") {
131
+ if (error instanceof BrickLoadError || error instanceof Error && error.name === "ChunkLoadError" || error instanceof Event && error.type === "error" && error.target instanceof HTMLScriptElement) {
112
132
  return {
113
133
  showDescription: true,
114
134
  title: i18n.t(`${NS}:${K.NETWORK_ERROR}`),
115
- variant: "internet-disconnected"
135
+ variant: "internet-disconnected",
136
+ showLink: "reload"
116
137
  };
117
138
  }
118
139
  if (error instanceof HttpResponseError && ((_error$response = error.response) === null || _error$response === void 0 ? void 0 : _error$response.status) === 403) {
@@ -1 +1 @@
1
- {"version":3,"file":"ErrorNode.js","names":["loadBricksImperatively","BrickLoadError","HttpResponseError","i18n","httpErrorToString","RenderTag","_internalApiGetPresetBricks","getBrickPackages","K","NS","PageNotFoundError","Error","constructor","message","name","captureStackTrace","ErrorNode","error","returnNode","pageLevel","title","variant","showLink","showDescription","getRefinedErrorConf","presetBricks","errorBrick","linkBrick","bricks","Promise","race","_resolve","reject","setTimeout","node","tag","BRICK","type","properties","errorTitle","description","undefined","dataset","errorBoundary","runtimeContext","return","child","textContent","t","GO_BACK_HOME","GO_BACK_TO_PREVIOUS_PAGE","url","events","click","action","e","console","join","style","color","_error$response","_error$responseJson","APP_NOT_FOUND","PAGE_NOT_FOUND","NETWORK_ERROR","response","status","NO_PERMISSION","responseJson","code","LICENSE_EXPIRED","UNKNOWN_ERROR"],"sources":["../../../src/internal/ErrorNode.ts"],"sourcesContent":["import { loadBricksImperatively, BrickLoadError } from \"@next-core/loader\";\nimport { HttpResponseError } from \"@next-core/http\";\nimport { i18n } from \"@next-core/i18n\";\nimport { httpErrorToString } from \"../handleHttpError.js\";\nimport { RenderTag } from \"./enums.js\";\nimport type { RenderChildNode, RenderReturnNode } from \"./interfaces.js\";\nimport { _internalApiGetPresetBricks, getBrickPackages } from \"./Runtime.js\";\nimport { K, NS } from \"./i18n.js\";\n\ntype ErrorMessageVariant =\n | \"internet-disconnected\"\n | \"no-permission\"\n | \"license-expired\"\n | \"not-found\"\n | \"unknown-error\";\n\ninterface ErrorMessageConfig {\n title: string;\n variant: ErrorMessageVariant;\n showLink?: \"home\" | \"previous\";\n showDescription?: boolean;\n}\n\nexport class PageNotFoundError extends Error {\n constructor(message: \"page not found\" | \"app not found\") {\n // Pass remaining arguments (including vendor specific ones) to parent constructor\n super(message);\n\n this.name = \"PageNotFoundError\";\n\n // Maintains proper stack trace for where our error was thrown (only available on V8)\n // istanbul ignore else\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, BrickLoadError);\n }\n }\n}\n\n/**\n * Will always resolve\n */\nexport async function ErrorNode(\n error: unknown,\n returnNode: RenderReturnNode,\n pageLevel?: boolean\n): Promise<RenderChildNode> {\n const { title, variant, showLink, showDescription } =\n getRefinedErrorConf(error);\n\n if (pageLevel) {\n const presetBricks = _internalApiGetPresetBricks();\n const errorBrick = presetBricks.error ?? \"illustrations.error-message\";\n if (errorBrick !== false) {\n const linkBrick = \"eo-link\";\n const bricks = showLink ? [errorBrick, linkBrick] : [errorBrick];\n try {\n await Promise.race([\n loadBricksImperatively(bricks, getBrickPackages()),\n // Timeout after 3 seconds\n new Promise<void>((_resolve, reject) =>\n setTimeout(() => {\n reject(new Error(\"timeout\"));\n }, 3e3)\n ),\n ]);\n const node: RenderChildNode = {\n tag: RenderTag.BRICK,\n type: errorBrick,\n properties: {\n errorTitle: title,\n description: showDescription ? httpErrorToString(error) : undefined,\n variant,\n dataset: {\n errorBoundary: \"\",\n },\n },\n runtimeContext: null!,\n return: returnNode,\n };\n\n if (showLink) {\n node.child = {\n tag: RenderTag.BRICK,\n type: linkBrick,\n properties: {\n textContent:\n showLink === \"home\"\n ? i18n.t(`${NS}:${K.GO_BACK_HOME}`)\n : i18n.t(`${NS}:${K.GO_BACK_TO_PREVIOUS_PAGE}`),\n url: showLink === \"home\" ? \"/\" : undefined,\n },\n events:\n showLink === \"home\"\n ? undefined\n : {\n click: {\n action: \"history.goBack\",\n },\n },\n runtimeContext: null!,\n return: node,\n };\n }\n\n return node;\n } catch (e) {\n // eslint-disable-next-line no-console\n console.error(\"Failed to load brick:\", bricks.join(\", \"), e);\n }\n }\n }\n\n return {\n tag: RenderTag.BRICK,\n type: \"div\",\n properties: {\n textContent: showDescription\n ? `${title}: ${httpErrorToString(error)}`\n : title,\n dataset: {\n errorBoundary: \"\",\n },\n style: {\n color: \"var(--color-error)\",\n },\n },\n runtimeContext: null!,\n return: returnNode,\n };\n}\n\nfunction getRefinedErrorConf(error: unknown): ErrorMessageConfig {\n if (error instanceof PageNotFoundError) {\n return error.message === \"app not found\"\n ? {\n showLink: \"home\",\n title: i18n.t(`${NS}:${K.APP_NOT_FOUND}`),\n variant: \"no-permission\",\n }\n : {\n showLink: \"home\",\n variant: \"not-found\",\n title: i18n.t(`${NS}:${K.PAGE_NOT_FOUND}`),\n };\n }\n\n if (\n error instanceof BrickLoadError ||\n (error instanceof Error && error.name === \"ChunkLoadError\")\n ) {\n return {\n showDescription: true,\n title: i18n.t(`${NS}:${K.NETWORK_ERROR}`),\n variant: \"internet-disconnected\",\n };\n }\n\n if (error instanceof HttpResponseError && error.response?.status === 403) {\n return {\n showLink: \"previous\",\n showDescription: true,\n title: i18n.t(`${NS}:${K.NO_PERMISSION}`),\n variant: \"no-permission\",\n };\n }\n\n if (\n error instanceof HttpResponseError &&\n error.responseJson?.code === \"200000\"\n ) {\n return {\n showDescription: true,\n title: i18n.t(`${NS}:${K.LICENSE_EXPIRED}`),\n variant: \"license-expired\",\n };\n }\n\n return {\n showLink: \"previous\",\n showDescription: true,\n title: i18n.t(`${NS}:${K.UNKNOWN_ERROR}`),\n variant: \"unknown-error\",\n };\n}\n"],"mappings":"AAAA,SAASA,sBAAsB,EAAEC,cAAc,QAAQ,mBAAmB;AAC1E,SAASC,iBAAiB,QAAQ,iBAAiB;AACnD,SAASC,IAAI,QAAQ,iBAAiB;AACtC,SAASC,iBAAiB,QAAQ,uBAAuB;AACzD,SAASC,SAAS,QAAQ,YAAY;AAEtC,SAASC,2BAA2B,EAAEC,gBAAgB,QAAQ,cAAc;AAC5E,SAASC,CAAC,EAAEC,EAAE,QAAQ,WAAW;AAgBjC,OAAO,MAAMC,iBAAiB,SAASC,KAAK,CAAC;EAC3CC,WAAWA,CAACC,OAA2C,EAAE;IACvD;IACA,KAAK,CAACA,OAAO,CAAC;IAEd,IAAI,CAACC,IAAI,GAAG,mBAAmB;;IAE/B;IACA;IACA,IAAIH,KAAK,CAACI,iBAAiB,EAAE;MAC3BJ,KAAK,CAACI,iBAAiB,CAAC,IAAI,EAAEd,cAAc,CAAC;IAC/C;EACF;AACF;;AAEA;AACA;AACA;AACA,OAAO,eAAee,SAASA,CAC7BC,KAAc,EACdC,UAA4B,EAC5BC,SAAmB,EACO;EAC1B,MAAM;IAAEC,KAAK;IAAEC,OAAO;IAAEC,QAAQ;IAAEC;EAAgB,CAAC,GACjDC,mBAAmB,CAACP,KAAK,CAAC;EAE5B,IAAIE,SAAS,EAAE;IACb,MAAMM,YAAY,GAAGnB,2BAA2B,CAAC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js","names":["loadBricksImperatively","BrickLoadError","HttpResponseError","i18n","httpErrorToString","RenderTag","_internalApiGetPresetBricks","getBrickPackages","K","NS","getBasePath","PageNotFoundError","Error","constructor","message","name","captureStackTrace","ErrorNode","error","returnNode","pageLevel","title","variant","showLink","showDescription","getRefinedErrorConf","presetBricks","errorBrick","linkBrick","bricks","filter","brick","customElements","get","Promise","race","_resolve","reject","setTimeout","node","tag","BRICK","type","properties","errorTitle","description","undefined","dataset","errorBoundary","runtimeContext","return","child","getLinkNode","e","console","join","useDefaultError","style","color","descriptionNode","textContent","sibling","parent","slotId","t","GO_BACK_HOME","RELOAD","GO_BACK_TO_PREVIOUS_PAGE","href","location","events","click","action","_error$response","_error$responseJson","APP_NOT_FOUND","PAGE_NOT_FOUND","Event","target","HTMLScriptElement","NETWORK_ERROR","response","status","NO_PERMISSION","responseJson","code","LICENSE_EXPIRED","UNKNOWN_ERROR"],"sources":["../../../src/internal/ErrorNode.ts"],"sourcesContent":["import { loadBricksImperatively, BrickLoadError } from \"@next-core/loader\";\nimport { HttpResponseError } from \"@next-core/http\";\nimport { i18n } from \"@next-core/i18n\";\nimport { httpErrorToString } from \"../handleHttpError.js\";\nimport { RenderTag } from \"./enums.js\";\nimport type { RenderChildNode, RenderReturnNode } from \"./interfaces.js\";\nimport { _internalApiGetPresetBricks, getBrickPackages } from \"./Runtime.js\";\nimport { K, NS } from \"./i18n.js\";\nimport { getBasePath } from \"../getBasePath.js\";\n\ntype ErrorMessageVariant =\n | \"internet-disconnected\"\n | \"no-permission\"\n | \"license-expired\"\n | \"not-found\"\n | \"unknown-error\";\n\ninterface ErrorMessageConfig {\n title: string;\n variant: ErrorMessageVariant;\n showLink?: LinkType;\n showDescription?: boolean;\n}\n\ntype LinkType = \"home\" | \"previous\" | \"reload\";\n\nexport class PageNotFoundError extends Error {\n constructor(message: \"page not found\" | \"app not found\") {\n // Pass remaining arguments (including vendor specific ones) to parent constructor\n super(message);\n\n this.name = \"PageNotFoundError\";\n\n // Maintains proper stack trace for where our error was thrown (only available on V8)\n // istanbul ignore else\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, BrickLoadError);\n }\n }\n}\n\n/**\n * Will always resolve\n */\nexport async function ErrorNode(\n error: unknown,\n returnNode: RenderReturnNode,\n pageLevel?: boolean\n): Promise<RenderChildNode> {\n const { title, variant, showLink, showDescription } =\n getRefinedErrorConf(error);\n\n if (pageLevel) {\n const presetBricks = _internalApiGetPresetBricks();\n const errorBrick = presetBricks.error ?? \"illustrations.error-message\";\n if (errorBrick !== false) {\n const linkBrick = \"eo-link\";\n const bricks = (showLink ? [errorBrick, linkBrick] : [errorBrick]).filter(\n (brick) => !customElements.get(brick)\n );\n try {\n await Promise.race([\n loadBricksImperatively(bricks, getBrickPackages()),\n // Timeout after 3 seconds\n new Promise<void>((_resolve, reject) =>\n setTimeout(() => {\n reject(new Error(\"timeout\"));\n }, 3e3)\n ),\n ]);\n const node: RenderChildNode = {\n tag: RenderTag.BRICK,\n type: errorBrick,\n properties: {\n errorTitle: title,\n description: showDescription ? httpErrorToString(error) : undefined,\n variant,\n dataset: {\n errorBoundary: \"\",\n },\n },\n runtimeContext: null!,\n return: returnNode,\n };\n\n if (showLink) {\n node.child = getLinkNode(showLink, linkBrick, node, \"\");\n }\n\n return node;\n } catch (e) {\n // eslint-disable-next-line no-console\n console.error(\"Failed to load brick:\", bricks.join(\", \"), e);\n }\n }\n }\n\n const useDefaultError =\n pageLevel && !!customElements.get(\"easyops-default-error\");\n\n const node: RenderChildNode = {\n tag: RenderTag.BRICK,\n type: useDefaultError ? \"easyops-default-error\" : \"div\",\n properties: {\n errorTitle: title,\n dataset: {\n errorBoundary: \"\",\n },\n style: {\n color: \"var(--color-error)\",\n },\n },\n runtimeContext: null!,\n return: returnNode,\n };\n\n const descriptionNode: RenderChildNode = {\n tag: RenderTag.BRICK,\n type: \"div\",\n properties: {\n textContent: useDefaultError\n ? showDescription\n ? httpErrorToString(error)\n : \"\"\n : showDescription\n ? `${title}: ${httpErrorToString(error)}`\n : title,\n },\n runtimeContext: null!,\n return: node,\n };\n\n node.child = descriptionNode;\n\n if (pageLevel && showLink) {\n descriptionNode.sibling = getLinkNode(\n showLink,\n \"a\",\n node,\n useDefaultError ? \"link\" : \"\"\n );\n }\n\n return node;\n}\n\nfunction getLinkNode(\n showLink: LinkType | undefined,\n brick: string,\n parent: RenderReturnNode,\n slotId: string\n): RenderChildNode {\n return {\n tag: RenderTag.BRICK,\n type: brick,\n slotId,\n properties: {\n textContent:\n showLink === \"home\"\n ? i18n.t(`${NS}:${K.GO_BACK_HOME}`)\n : showLink === \"reload\"\n ? i18n.t(`${NS}:${K.RELOAD}`)\n : i18n.t(`${NS}:${K.GO_BACK_TO_PREVIOUS_PAGE}`),\n href:\n showLink === \"home\"\n ? getBasePath()\n : showLink === \"reload\"\n ? location.href\n : undefined,\n },\n events:\n showLink === \"previous\"\n ? {\n click: {\n action: \"history.goBack\",\n },\n }\n : undefined,\n runtimeContext: null!,\n return: parent,\n };\n}\n\nfunction getRefinedErrorConf(error: unknown): ErrorMessageConfig {\n if (error instanceof PageNotFoundError) {\n return error.message === \"app not found\"\n ? {\n showLink: \"home\",\n title: i18n.t(`${NS}:${K.APP_NOT_FOUND}`),\n variant: \"no-permission\",\n }\n : {\n showLink: \"home\",\n variant: \"not-found\",\n title: i18n.t(`${NS}:${K.PAGE_NOT_FOUND}`),\n };\n }\n\n if (\n error instanceof BrickLoadError ||\n (error instanceof Error && error.name === \"ChunkLoadError\") ||\n (error instanceof Event &&\n error.type === \"error\" &&\n error.target instanceof HTMLScriptElement)\n ) {\n return {\n showDescription: true,\n title: i18n.t(`${NS}:${K.NETWORK_ERROR}`),\n variant: \"internet-disconnected\",\n showLink: \"reload\",\n };\n }\n\n if (error instanceof HttpResponseError && error.response?.status === 403) {\n return {\n showLink: \"previous\",\n showDescription: true,\n title: i18n.t(`${NS}:${K.NO_PERMISSION}`),\n variant: \"no-permission\",\n };\n }\n\n if (\n error instanceof HttpResponseError &&\n error.responseJson?.code === \"200000\"\n ) {\n return {\n showDescription: true,\n title: i18n.t(`${NS}:${K.LICENSE_EXPIRED}`),\n variant: \"license-expired\",\n };\n }\n\n return {\n showLink: \"previous\",\n showDescription: true,\n title: i18n.t(`${NS}:${K.UNKNOWN_ERROR}`),\n variant: \"unknown-error\",\n };\n}\n"],"mappings":"AAAA,SAASA,sBAAsB,EAAEC,cAAc,QAAQ,mBAAmB;AAC1E,SAASC,iBAAiB,QAAQ,iBAAiB;AACnD,SAASC,IAAI,QAAQ,iBAAiB;AACtC,SAASC,iBAAiB,QAAQ,uBAAuB;AACzD,SAASC,SAAS,QAAQ,YAAY;AAEtC,SAASC,2BAA2B,EAAEC,gBAAgB,QAAQ,cAAc;AAC5E,SAASC,CAAC,EAAEC,EAAE,QAAQ,WAAW;AACjC,SAASC,WAAW,QAAQ,mBAAmB;AAkB/C,OAAO,MAAMC,iBAAiB,SAASC,KAAK,CAAC;EAC3CC,WAAWA,CAACC,OAA2C,EAAE;IACvD;IACA,KAAK,CAACA,OAAO,CAAC;IAEd,IAAI,CAACC,IAAI,GAAG,mBAAmB;;IAE/B;IACA;IACA,IAAIH,KAAK,CAACI,iBAAiB,EAAE;MAC3BJ,KAAK,CAACI,iBAAiB,CAAC,IAAI,EAAEf,cAAc,CAAC;IAC/C;EACF;AACF;;AAEA;AACA;AACA;AACA,OAAO,eAAegB,SAASA,CAC7BC,KAAc,EACdC,UAA4B,EAC5BC,SAAmB,EACO;EAC1B,MAAM;IAAEC,KAAK;IAAEC,OAAO;IAAEC,QAAQ;IAAEC;EAAgB,CAAC,GACjDC,mBAAmB,CAACP,KAAK,CAAC;EAE5B,IAAIE,SAAS,EAAE;IACb,MAAMM,YAAY,GAAGpB,2BAA2B,CAAC,CAAC;IAClD,MAAMqB,UAAU,GAAGD,YAAY,CAACR,KAAK,IAAI,6BAA6B;IACtE,IAAIS,UAAU,KAAK,KAAK,EAAE;MACxB,MAAMC,SAAS,GAAG,SAAS;MAC3B,MAAM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E,IAAI;MACrBH,KAAK,EAAElB,IAAI,CAAC6D,CAAC,CAAC,GAAGvD,EAAE,IAAID,CAAC,CAACwE,aAAa,EAAE,CAAC;MACzC1D,OAAO,EAAE,uBAAuB;MAChCC,QAAQ,EAAE;IACZ,CAAC;EACH;EAEA,IAAIL,KAAK,YAAYhB,iBAAiB,IAAI,EAAAuE,eAAA,GAAAvD,KAAK,CAAC+D,QAAQ,cAAAR,eAAA,uBAAdA,eAAA,CAAgBS,MAAM,MAAK,GAAG,EAAE;IACxE,OAAO;MACL3D,QAAQ,EAAE,UAAU;MACpBC,eAAe,EAAE,IAAI;MACrBH,KAAK,EAAElB,IAAI,CAAC6D,CAAC,CAAC,GAAGvD,EAAE,IAAID,CAAC,CAAC2E,aAAa,EAAE,CAAC;MACzC7D,OAAO,EAAE;IACX,CAAC;EACH;EAEA,IACEJ,KAAK,YAAYhB,iBAAiB,IAClC,EAAAwE,mBAAA,GAAAxD,KAAK,CAACkE,YAAY,cAAAV,mBAAA,uBAAlBA,mBAAA,CAAoBW,IAAI,MAAK,QAAQ,EACrC;IACA,OAAO;MACL7D,eAAe,EAAE,IAAI;MACrBH,KAAK,EAAElB,IAAI,CAAC6D,CAAC,CAAC,GAAGvD,EAAE,IAAID,CAAC,CAAC8E,eAAe,EAAE,CAAC;MAC3ChE,OAAO,EAAE;IACX,CAAC;EACH;EAEA,OAAO;IACLC,QAAQ,EAAE,UAAU;IACpBC,eAAe,EAAE,IAAI;IACrBH,KAAK,EAAElB,IAAI,CAAC6D,CAAC,CAAC,GAAGvD,EAAE,IAAID,CAAC,CAAC+E,aAAa,EAAE,CAAC;IACzCjE,OAAO,EAAE;EACX,CAAC;AACH","ignoreList":[]}
@@ -116,7 +116,7 @@ export class RendererContext {
116
116
  * Will always resolve
117
117
  */
118
118
  reCatch(error, returnNode) {
119
- return _classPrivateFieldGet(_routeHelper, this).catch(error, returnNode);
119
+ return _classPrivateFieldGet(_routeHelper, this).catch(error, returnNode, false, true);
120
120
  }
121
121
  async didPerformIncrementalRender(location, prevLocation) {
122
122
  let finalResult = false;