zova-module-a-ssr 5.1.40 → 5.1.42

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,5 +1,5 @@
1
1
  /** sys: begin */
2
- export * from '../bean/sys.ssrState.js';
2
+ export * from '../bean/sys.ssrState.ts';
3
3
  import 'zova';
4
4
  declare module 'zova' {
5
5
  }
@@ -13,7 +13,7 @@ declare module 'zova-module-a-ssr' {
13
13
  }
14
14
  /** sys: end */
15
15
  /** sys: begin */
16
- import { SysSsrState } from '../bean/sys.ssrState.js';
16
+ import type { SysSsrState } from '../bean/sys.ssrState.ts';
17
17
  import 'zova';
18
18
  declare module 'zova' {
19
19
  interface IBeanRecordGeneral {
@@ -22,14 +22,14 @@ declare module 'zova' {
22
22
  }
23
23
  /** sys: end */
24
24
  /** config: begin */
25
- export * from '../config/config.js';
26
- import { config } from '../config/config.js';
25
+ export * from '../config/config.ts';
26
+ import { config } from '../config/config.ts';
27
27
  /** config: end */
28
28
  /** monkey: begin */
29
- export * from '../monkey.js';
29
+ export * from '../monkey.ts';
30
30
  /** monkey: end */
31
31
  /** monkeySys: begin */
32
- export * from '../monkeySys.js';
32
+ export * from '../monkeySys.ts';
33
33
  /** monkeySys: end */
34
34
  /** scope: begin */
35
35
  import { BeanScopeBase, type BeanScopeUtil, TypeModuleConfig } from 'zova';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/.metadata/index.ts"],"names":[],"mappings":"AACA,iBAAiB;AACjB,cAAc,yBAAyB,CAAC;AAExC,OAAO,MAAM,CAAC;AACd,OAAO,QAAQ,MAAM,CAAC;CAGrB;AACD,OAAO,QAAQ,mBAAmB,CAAC;IAE3B,UAAiB,WAAW;KAG3B;IAED,UAAiB,WAAW;QAC1B,IAAI,aAAa,IAAI,oBAAoB,CAAC;QAC1C,IAAI,UAAU,IAAI,gBAAgB,CAAC;KAEpC;CACR;AACD,eAAe;AACf,iBAAiB;A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ACjB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,MAAM,CAAC;AACd,OAAO,QAAQ,MAAM,CAAC;IACpB,UAAiB,kBAAkB;QACjC,oBAAoB,EAAE,WAAW,CAAC;KACnC;CACF;AACD,eAAe;AACf,oBAAoB;AACpB,cAAc,qBAAqB,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,kBAAkB;AAClB,oBAAoB;AACpB,cAAc,cAAc,CAAC;AAC7B,kBAAkB;AAClB,uBAAuB;AACvB,cAAc,iBAAiB,CAAC;AAChC,qBAAqB;AACrB,mBAAmB;AACnB,OAAO,EAAE,aAAa,EAAE,KAAK,aAAa,EAAE,gBAAgB,EAAE,MAAM,MAAM,CAAC;AAG3E,qBACa,eAAgB,SAAQ,aAAa;CAAG;AAErD,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,aAAa,CAAC;IACtB,MAAM,EAAE,gBAAgB,CAAC,OAAO,MAAM,CAAC,CAAC;CACvC;AAED,OAAO,MAAM,CAAC;AACd,OAAO,QAAQ,MAAM,CAAC;IACpB,UAAiB,gBAAgB;QAC/B,OAAO,EAAE,eAAe,CAAC;KAC1B;IAED,UAAiB,gBAAgB;QAC/B,OAAO,EAAE,UAAU,CAAC,OAAO,MAAM,CAAC,CAAC;KACpC;CAKF;AAED,iBAAiB"}
@@ -1,3 +1,3 @@
1
1
  export declare const __ThisModule__ = "a-ssr";
2
- export { ScopeModuleASsr as ScopeModule } from './index.js';
2
+ export { ScopeModuleASsr as ScopeModule } from './index.ts';
3
3
  //# sourceMappingURL=this.d.ts.map
@@ -1,5 +1,5 @@
1
1
  import { BeanBase } from 'zova';
2
- import { SSRContextState, SSRContextStateDefer } from '../types/ssr.js';
2
+ import { SSRContextState, SSRContextStateDefer } from '../types/ssr.ts';
3
3
  declare const SymbolSSRState: unique symbol;
4
4
  declare const SymbolSSRStateDefer: unique symbol;
5
5
  export declare class SysSsrState extends BeanBase {
@@ -1,4 +1,4 @@
1
1
  import type { ZovaSys } from 'zova';
2
- import type { ISsrConfig } from '../types/config.js';
2
+ import type { ISsrConfig } from '../types/config.ts';
3
3
  export declare const config: (sys: ZovaSys) => ISsrConfig;
4
4
  //# sourceMappingURL=config.d.ts.map
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export * from './.metadata/index.js';
2
- export * from './lib/index.js';
3
- export * from './types/index.js';
1
+ export * from './.metadata/index.ts';
2
+ export * from './lib/index.ts';
3
+ export * from './types/index.ts';
4
4
  //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import { BeanBase, BeanInfo, BeanScopeBase, BeanSimple, cast } from "zova";
2
2
  import { Scope, Sys } from "zova-module-a-bean";
3
3
  import { isNavigationFailure } from "@cabloy/vue-router";
4
+ import { combineParamsAndQuery } from "@cabloy/utils";
4
5
  import { computed, normalizeClass, normalizeStyle, onActivated, onDeactivated, onUnmounted, ref, useSSRContext, watch } from "vue";
5
6
  import { includeBooleanAttr, isBooleanAttr, isString, stringifyStyle } from "@vue/shared";
6
7
  import { defu } from "defu";
@@ -46,6 +47,22 @@ var config = (sys) => {
46
47
  };
47
48
  //#endregion
48
49
  //#region src/lib/ssrNavigation.ts
50
+ function getCanonicalLocaleRoutePath(route, locale, defaultLocale) {
51
+ if (!route.meta.locale) return;
52
+ const value = locale.normalize(route.params?.locale);
53
+ const canonical = value === defaultLocale ? "" : value;
54
+ if ((route.params?.locale ?? "") === canonical) return;
55
+ const matched = route.matched.findLast((record) => record.path.includes(":locale"));
56
+ if (!matched) return;
57
+ const path = combineParamsAndQuery(matched.path, {
58
+ params: {
59
+ ...route.params,
60
+ locale: canonical || void 0
61
+ },
62
+ query: route.query
63
+ }) + (route.hash ?? "");
64
+ return path !== route.fullPath ? path : void 0;
65
+ }
49
66
  function createSsrNavigationSync(options) {
50
67
  const navigationLocales = /* @__PURE__ */ new WeakMap();
51
68
  return {
@@ -128,6 +145,13 @@ var Monkey = class extends BeanSimple {
128
145
  }
129
146
  });
130
147
  router.beforeEach((to) => {
148
+ const canonicalPath = getCanonicalLocaleRoutePath(to, this.app.meta.locale, this.sys.config.locale.default);
149
+ if (canonicalPath) return {
150
+ path: canonicalPath,
151
+ query: to.query,
152
+ hash: to.hash,
153
+ replace: true
154
+ };
131
155
  navigationSync.beforeEach(to);
132
156
  });
133
157
  router.afterEach((to, from, failure) => {
@@ -630,7 +654,13 @@ var CtxSSR = class extends BeanSimple {
630
654
  }
631
655
  /** @internal */
632
656
  _setLocale(route) {
633
- if (route.meta.locale) this.app.meta.locale.current = route.params?.locale;
657
+ if (route.meta.locale) {
658
+ this.app.meta.locale.current = route.params?.locale;
659
+ if (process.env.SERVER) {
660
+ const canonicalPath = getCanonicalLocaleRoutePath(route, this.app.meta.locale, this.sys.config.locale.default);
661
+ if (canonicalPath) this.app.$redirect(canonicalPath);
662
+ }
663
+ }
634
664
  }
635
665
  get cookieDisabledOnServer() {
636
666
  return process.env.SERVER && !this.profileOptions.useCookie;
@@ -835,8 +865,6 @@ var MonkeySys = class extends BeanSimple {
835
865
  };
836
866
  //#endregion
837
867
  //#region src/.metadata/index.ts
838
- /** monkeySys: end */
839
- /** scope: begin */
840
868
  var _dec;
841
869
  var _dec2;
842
870
  var _class;
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../src/bean/sys.ssrState.ts","../src/config/config.ts","../src/lib/ssrNavigation.ts","../src/lib/useMeta.ts","../src/monkey.ts","../src/lib/utils.ts","../src/lib/ssrMetaStore.ts","../src/lib/ssrProfile.ts","../src/lib/ssr.ts","../src/monkeySys.ts","../src/.metadata/index.ts","../src/lib/bodyReadyObserver.ts"],"sourcesContent":["var _dec, _dec2, _class;\nimport { \"BeanInfo\" as __z_BeanInfo } from \"zova\";\nimport { BeanBase, cast } from 'zova';\nimport { Sys } from 'zova-module-a-bean';\nconst SymbolSSRState = Symbol('SymbolSSRState');\nconst SymbolSSRStateDefer = Symbol('SymbolSSRStateDefer');\nexport let SysSsrState = (_dec = Sys(), _dec2 = __z_BeanInfo({\n module: \"a-ssr\"\n}), _dec(_class = _dec2(_class = class SysSsrState extends BeanBase {\n constructor(...args) {\n super(...args);\n this[SymbolSSRState] = void 0;\n this[SymbolSSRStateDefer] = void 0;\n }\n async __init__() {\n if (process.env.CLIENT) {\n if (cast(window).__INITIAL_STATE__) {\n this[SymbolSSRState] = cast(window).__INITIAL_STATE__;\n delete cast(window).__INITIAL_STATE__;\n document.getElementById('ssr-state-init')?.remove();\n } else {\n this[SymbolSSRState] = {};\n }\n if (cast(window).__INITIAL_STATE_DEFER__) {\n this[SymbolSSRStateDefer] = cast(window).__INITIAL_STATE_DEFER__;\n delete cast(window).__INITIAL_STATE_DEFER__;\n document.getElementById('ssr-state-defer-init')?.remove();\n } else {\n this[SymbolSSRStateDefer] = {};\n }\n }\n }\n get state() {\n return this[SymbolSSRState];\n }\n get stateDefer() {\n return this[SymbolSSRStateDefer];\n }\n}) || _class) || _class);","export const config = sys => {\n const ssrConfig = {\n cookieThemeDarkDefault: sys.env.SSR_COOKIE_THEMEDARK_DEFAULT === 'true'\n };\n return ssrConfig;\n};","export function createSsrNavigationSync(options) {\n const navigationLocales = new WeakMap();\n return {\n beforeEach(to) {\n navigationLocales.set(to, options.getLocale());\n options.setProfile(to);\n options.setRouteLocale(to);\n },\n afterEach(to, from, failure) {\n const locale = navigationLocales.get(to);\n navigationLocales.delete(to);\n if (!failure) return;\n options.setProfile(from);\n if (locale !== undefined) {\n options.setLocale(locale);\n }\n }\n };\n}","// from: quasar/ui/src/composables/use-meta.js\nimport { computed, onActivated, onDeactivated, onUnmounted, watch } from 'vue';\nexport function useMeta(ctx, metaOptions) {\n if (process.env.SERVER) {\n ctx.meta.$ssr.context.__qMetaList.push(typeof metaOptions === 'function' ? metaOptions() : metaOptions);\n } else {\n const meta = {\n active: true\n };\n if (typeof metaOptions === 'function') {\n const content = computed(metaOptions);\n meta.val = content.value;\n watch(content, val => {\n meta.val = val;\n meta.active === true && ctx.meta.$ssr.metaStore.planClientUpdate();\n });\n } else {\n meta.val = metaOptions;\n }\n ctx.meta.$ssr.metaStore.addMetaOptions(meta);\n ctx.meta.$ssr.metaStore.planClientUpdate();\n onActivated(() => {\n try {\n meta.active = true;\n ctx.meta.$ssr.metaStore.planClientUpdate();\n } catch (_err) {}\n });\n onDeactivated(() => {\n try {\n meta.active = false;\n ctx.meta.$ssr.metaStore.planClientUpdate();\n } catch (_err) {}\n });\n onUnmounted(() => {\n try {\n ctx.meta.$ssr.metaStore.removeMetaOptions(meta);\n ctx.meta.$ssr.metaStore.planClientUpdate();\n } catch (_err) {}\n });\n }\n}","import { isNavigationFailure } from '@cabloy/vue-router';\nimport { BeanSimple, cast } from 'zova';\nimport { createSsrNavigationSync } from './lib/ssrNavigation.js';\nimport { useMeta } from './lib/useMeta.js';\nexport class Monkey extends BeanSimple {\n appContextInitialize(ctx) {\n ctx.meta.$ssr = ctx.app.ctx.meta.$ssr;\n if (process.env.CLIENT) {\n ctx.meta.$ssr.handleDirectOrOnHydrated(() => {\n if (!ctx.disposed) {\n ctx.meta.hooks.invokeHook('hydrated');\n }\n });\n }\n if (process.env.SERVER) {\n ctx.meta.$ssr._registerServerContext(ctx);\n }\n }\n controllerLoad(event) {\n event.ctx.meta.$ssr.controllerLoad(event);\n }\n async appInitialize() {\n this.app.meta.event.on('a-router:routerGuards', async (router, next) => {\n if (process.env.CLIENT) {\n const navigationSync = createSsrNavigationSync({\n getLocale: () => this.app.meta.locale.current,\n setLocale: locale => {\n this.app.meta.locale.current = locale;\n },\n setProfile: route => {\n this.ctx.meta.$ssr._setProfile(route.meta.ssrProfile, route.meta.ssrProfileOptions, route.meta.locale);\n },\n setRouteLocale: route => {\n this.ctx.meta.$ssr._setLocale(route);\n }\n });\n router.beforeEach(to => {\n navigationSync.beforeEach(to);\n });\n router.afterEach((to, from, failure) => {\n navigationSync.afterEach(to, from, failure);\n });\n }\n return await next();\n });\n if (process.env.CLIENT && this.ctx.meta.$ssr.isRuntimeSsrPreHydration) {\n this.ctx.meta.$ssr.onHydrated(() => {\n document.documentElement.setAttribute('data-zova-hydrated', this.sys.env.SITE_ID);\n });\n }\n // ssr errorHandler\n if (process.env.SERVER) {\n this._ssrErrorHandler();\n }\n }\n async moduleLoading(_module) {}\n async moduleLoaded(module) {\n // ssrContext.modules\n if (process.env.SERVER && process.env.PROD) {\n if (!this.ctx.meta.$ssr.context.modules) this.ctx.meta.$ssr.context.modules = new Set();\n this.ctx.meta.$ssr.context.modules.add(`@@${module.info.relativeName}`);\n }\n }\n async beanInit(bean, beanInstance) {\n // eslint-disable-next-line\n const self = this;\n // $ssr\n bean.defineProperty(beanInstance, '$ssr', {\n enumerable: false,\n configurable: true,\n get() {\n return self.app.ctx.meta.$ssr;\n }\n });\n // $useMeta\n bean.defineProperty(beanInstance, '$useMeta', {\n enumerable: false,\n configurable: true,\n get() {\n return function (options) {\n const ctx = cast(this).ctx;\n ctx.util.instanceScope(() => {\n useMeta(ctx, options);\n });\n };\n }\n });\n }\n _ssrErrorHandler() {\n if (!process.env.SERVER) return;\n const _eventErrorHandler = this.app.meta.event.on('app:errorHandler', (data, next) => {\n const err = next();\n if (data.load?.kind === 'controller-load') {\n if (_isLoadErrorHandledServer(data.err)) {\n data.load.disposition = 'handled';\n if (!err || !(err instanceof Error)) return err;\n return this._errorHandlerDefaultServer(err);\n }\n return err;\n }\n if (!err || !(err instanceof Error)) return err;\n return this._errorHandlerDefaultServer(err);\n });\n this.ctx.meta.$ssr.context.onRendered(_err => {\n _eventErrorHandler();\n });\n }\n _errorHandlerDefaultServer(err) {\n if (!process.env.SERVER) return err;\n if (isNavigationFailure(err)) {\n if (!this.ctx.meta.$ssr.renderSSRError) {\n this.ctx.meta.$ssr.renderSSRError = err;\n }\n return undefined;\n } else if (err.code === 401) {\n try {\n this.app.$gotoLogin();\n } catch (err) {\n this.ctx.meta.$ssr.renderSSRError = err;\n }\n } else {\n this.ctx.meta.$ssr.renderSSRError = err;\n }\n return undefined;\n }\n}\nfunction _isLoadErrorHandledServer(err) {\n return isNavigationFailure(err) || [301, 302, 401].includes(Number(err.code));\n}","import * as devalue from 'devalue';\nexport function unevalPatch(value) {\n return devalue.uneval(value);\n // return devalue.uneval(value, value => {\n // if (value && typeof value === 'object' && value.toJSON) {\n // return value.toJSON();\n // }\n // });\n}","// from: quasar/ui/src/plugins/Meta.js\nimport { extend } from '@cabloy/extend';\nimport { BeanSimple, cast } from 'zova';\nimport { unevalPatch } from './utils.js';\nexport class CtxSSRMetaStore extends BeanSimple {\n constructor(...args) {\n super(...args);\n this._updateId = 0;\n this._currentClientMeta = void 0;\n this._clientList = [];\n }\n __init__() {\n if (process.env.SERVER) {\n const ssrContext = this.ctx.meta.$ssr.context;\n ssrContext.__qMetaList = [];\n ssrContext.rendered = () => {\n this._onRenderedLast();\n ssrContext.rendered = () => {};\n };\n }\n if (process.env.CLIENT && this.ctx.meta.$ssr.isRuntimeSsrPreHydration) {\n this._currentClientMeta = cast(window).__Q_META__;\n document.getElementById('ssr-meta-init')?.remove();\n }\n }\n _onRenderedLast(err) {\n const app = this.app;\n try {\n if (err) return;\n const ssrContext = this.ctx.meta.$ssr.context;\n this._injectContextState(ssrContext);\n this._injectContextStateDefer(ssrContext);\n this._injectServerMeta(ssrContext);\n } finally {\n this.ctx.meta.$ssr._disposeServerContexts();\n app?.close();\n }\n }\n addMetaOptions(metaOptionsWrapper) {\n this._clientList.push(metaOptionsWrapper);\n }\n removeMetaOptions(metaOptionsWrapper) {\n this._clientList.splice(this._clientList.indexOf(metaOptionsWrapper), 1);\n }\n planClientUpdate() {\n if (this._updateId !== 0) {\n clearTimeout(this._updateId);\n }\n this._updateId = window.setTimeout(() => {\n this._updateId = 0;\n this._updateClientMeta();\n }, 50);\n }\n _updateClientMeta() {\n const data = {\n title: '',\n titleTemplate: undefined,\n meta: {},\n link: {},\n script: {},\n htmlAttr: {},\n bodyAttr: {}\n };\n for (let i = 0; i < this._clientList.length; i++) {\n const {\n active,\n val\n } = this._clientList[i];\n if (active === true) {\n extend(true, data, val);\n }\n }\n normalize(data);\n apply(diff(this._currentClientMeta, data));\n this._currentClientMeta = data;\n }\n _injectServerMeta(ssrContext) {\n const data = {\n title: '',\n titleTemplate: undefined,\n meta: {},\n link: {},\n htmlAttr: {},\n bodyAttr: {},\n bodyStyle: {},\n bodyClass: {},\n noscript: {}\n };\n const list = ssrContext.__qMetaList;\n for (let i = 0; i < list.length; i++) {\n extend(true, data, list[i]);\n }\n normalize(data);\n const nonce = ssrContext.nonce !== void 0 ? ` nonce=\"${ssrContext.nonce}\"` : '';\n const ctx = ssrContext._meta;\n const htmlAttr = Object.keys(data.htmlAttr).filter(htmlFilter);\n if (htmlAttr.length !== 0) {\n ctx.htmlAttrs += (ctx.htmlAttrs.length !== 0 ? ' ' : '') + htmlAttr.map(getAttr(data.htmlAttr)).join(' ');\n }\n ctx.headTags += getHead(data);\n const bodyAttr = Object.keys(data.bodyAttr).filter(bodyFilter);\n if (bodyAttr.length !== 0) {\n ctx.bodyAttrs += (ctx.bodyAttrs.length !== 0 ? ' ' : '') + bodyAttr.map(getAttr(data.bodyAttr)).join(' ');\n }\n const bodyStyle = Object.keys(data.bodyStyle).filter(name => !!data.bodyStyle[name]).map(name => `${name}:${data.bodyStyle[name]};`).join('');\n if (bodyStyle) {\n ctx.bodyAttrs += `${ctx.bodyAttrs.length !== 0 ? ' ' : ''}style=\"${bodyStyle}\"`;\n }\n const _bodyClass = ctx.bodyClasses.split(' ').filter(item => !!item);\n const bodyClass = {};\n _bodyClass.forEach(item => bodyClass[item] = true);\n extend(true, bodyClass, data.bodyClass);\n ctx.bodyClasses = Object.keys(bodyClass).filter(name => bodyClass[name]).map(name => name).join(' ');\n data.title = '\\'\"`';\n ctx.endingHeadTags += `${Object.keys(data.noscript).map(name => `<noscript data-qmeta=\"${name}\">${data.noscript[name]}</noscript>`).join('')}<script${nonce} id=\"ssr-meta-init\">window.__Q_META__=${delete data.bodyStyle && delete data.bodyClass && delete data.noscript && unevalPatch(data)}</script>`;\n const cookieTheme = this.ctx.meta.$ssr.profileOptions.useCookie;\n let ssr_local_themedark = cookieTheme ? `let ssr_cookie_themedark=document.cookie.split('; ')?.find(item=>item.indexOf('themedark=')>-1)?.split('=')[1];\n ssr_cookie_themedark=ssr_cookie_themedark==='true'?true:ssr_cookie_themedark==='false'?false:${this.sys.env.SSR_COOKIE_THEMEDARK_DEFAULT};\n window.ssr_themedark=window.ssr_cookie_themedark=ssr_cookie_themedark;` : `let ssr_local_themedark=window.ssr_load_local('themedark');\n if(ssr_local_themedark===undefined || ssr_local_themedark==='auto'){\n ssr_local_themedark=window.matchMedia('(prefers-color-scheme: dark)').matches;\n }\n window.ssr_themedark=window.ssr_local_themedark=ssr_local_themedark;`;\n // Resolve the final browser theme from the SSR dual markers emitted before page render.\n ssr_local_themedark += `Object.defineProperty(window, 'ssr_themedark_data', {\n get: () => {\n let _data=document.body.getAttribute('data-ssr-theme-dark-'+window.ssr_themedark);\n if(_data===undefined || _data===null){\n _data=window.__INITIAL_STATE__ && window.__INITIAL_STATE__['data-ssr-theme-dark-'+window.ssr_themedark];\n }\n return _data;\n },\n });`;\n const ssr_local_themename = cookieTheme ? '' : `window.ssr_local_themename=window.ssr_load_local('themename','${this.sys.env.STYLE_DEFAULT_THEME}');`;\n ctx.endingHeadTags += `<script id=\"ssr-prefers-color-schema-dark\">\n window.ssr_load_local=function(key,defaultValue){\n const __ssr_local=localStorage.getItem(key);\n const value=__ssr_local?JSON.parse(__ssr_local):undefined;\n return value??defaultValue;\n };\n ${ssr_local_themedark}\n ${ssr_local_themename}\n document.querySelector('#ssr-prefers-color-schema-dark').remove();\n </script>`.replaceAll('\\n', '');\n }\n _injectContextState(ssrContext) {\n const ctx = ssrContext._meta;\n const nonce = ssrContext.nonce !== void 0 ? ` nonce=\"${ssrContext.nonce}\"` : '';\n ctx.endingHeadTags += `<script${nonce} id=\"ssr-state-init\">window.__INITIAL_STATE__=${unevalPatch(ssrContext.state)}</script>`;\n }\n _injectContextStateDefer(ssrContext) {\n const ctx = ssrContext._meta;\n const nonce = ssrContext.nonce !== void 0 ? ` nonce=\"${ssrContext.nonce}\"` : '';\n ctx.endingBodyTags += `<script${nonce} id=\"ssr-state-defer-init\">window.__INITIAL_STATE_DEFER__=${unevalPatch(ssrContext.stateDefer)}</script>`;\n }\n}\nfunction normalize(meta) {\n if (meta.title) {\n meta.title = meta.titleTemplate ? meta.titleTemplate(meta.title) : meta.title;\n delete meta.titleTemplate;\n }\n [['meta', 'content'], ['link', 'href']].forEach(type => {\n const metaType = meta[type[0]];\n const metaProp = type[1];\n for (const name in metaType) {\n const metaLink = metaType[name];\n if (metaLink.template) {\n if (Object.keys(metaLink).length === 1) {\n delete metaType[name];\n } else {\n metaLink[metaProp] = metaLink.template(metaLink[metaProp] || '');\n delete metaLink.template;\n }\n }\n }\n });\n}\nfunction changed(old, def) {\n if (Object.keys(old).length !== Object.keys(def).length) {\n return true;\n }\n for (const key in old) {\n if (old[key] !== def[key]) {\n return true;\n }\n }\n}\nfunction bodyFilter(name) {\n return ['class', 'style'].includes(name) === false;\n}\nfunction htmlFilter(_name) {\n return true;\n // return ['lang', 'dir'].includes(name) === false;\n}\nfunction diff(meta, other) {\n const add = {};\n const remove = {};\n if (meta === void 0) {\n return {\n add: other,\n remove\n };\n }\n if (meta.title !== other.title) {\n add.title = other.title;\n }\n ['meta', 'link', 'script', 'htmlAttr', 'bodyAttr'].forEach(type => {\n const old = meta[type];\n const cur = other[type];\n remove[type] = [];\n if (old === void 0 || old === null) {\n add[type] = cur;\n return;\n }\n add[type] = {};\n for (const key in old) {\n if (Object.prototype.hasOwnProperty.call(cur, key) === false) {\n remove[type].push(key);\n }\n }\n for (const key in cur) {\n if (Object.prototype.hasOwnProperty.call(old, key) === false) {\n add[type][key] = cur[key];\n } else if (changed(old[key], cur[key]) === true) {\n remove[type].push(key);\n add[type][key] = cur[key];\n }\n }\n });\n return {\n add,\n remove\n };\n}\nfunction apply({\n add,\n remove\n}) {\n if (add.title) {\n document.title = add.title;\n }\n if (Object.keys(remove).length !== 0) {\n ['meta', 'link', 'script'].forEach(type => {\n remove[type].forEach(name => {\n document.head.querySelector(`${type}[data-qmeta=\"${name}\"]`)?.remove();\n });\n });\n remove.htmlAttr.filter(htmlFilter).forEach(name => {\n document.documentElement.removeAttribute(name);\n });\n remove.bodyAttr.filter(bodyFilter).forEach(name => {\n document.body.removeAttribute(name);\n });\n }\n ['meta', 'link', 'script'].forEach(type => {\n const metaType = add[type];\n for (const name in metaType) {\n const tag = document.createElement(type);\n for (const att in metaType[name]) {\n if (att !== 'innerHTML') {\n tag.setAttribute(att, metaType[name][att]);\n }\n }\n tag.setAttribute('data-qmeta', name);\n if (type === 'script') {\n tag.innerHTML = metaType[name].innerHTML || '';\n }\n document.head.appendChild(tag);\n }\n });\n Object.keys(add.htmlAttr).filter(htmlFilter).forEach(name => {\n document.documentElement.setAttribute(name, add.htmlAttr[name] || '');\n });\n Object.keys(add.bodyAttr).filter(bodyFilter).forEach(name => {\n document.body.setAttribute(name, add.bodyAttr[name] || '');\n });\n}\nfunction getAttr(seed) {\n return att => {\n const val = seed[att];\n return att + (val !== true && val !== void 0 ? `=\"${val}\"` : '');\n };\n}\nfunction getHead(meta) {\n let output = '';\n if (meta.title) {\n output += `<title>${meta.title}</title>`;\n }\n ['meta', 'link', 'script'].forEach(type => {\n const metaType = meta[type];\n for (const att in metaType) {\n const attrs = Object.keys(metaType[att]).filter(att => att !== 'innerHTML').map(getAttr(metaType[att]));\n output += `<${type} ${attrs.join(' ')} data-qmeta=\"${att}\">`;\n if (type === 'script') {\n output += `${metaType[att].innerHTML || ''}</script>`;\n }\n }\n });\n return output;\n}","export function resolveSsrProfile(routeProfile, defaultProfile) {\n const ssrProfile = routeProfile ?? defaultProfile ?? 'public';\n if (ssrProfile !== 'public' && ssrProfile !== 'session') {\n throw new Error(`invalid SSR profile: ${ssrProfile}`);\n }\n return ssrProfile;\n}\nexport function resolveSsrProfileOptions(ssrProfile, profiles, routeProfileOptions, metaLocale) {\n const profileOptions = profiles[ssrProfile];\n if (!profileOptions) {\n throw new Error(`invalid SSR profile: ${ssrProfile}`);\n }\n const responseCache = routeProfileOptions?.responseCache ?? (ssrProfile === 'public' && metaLocale !== true ? {\n expires: 0\n } : profileOptions.responseCache);\n return Object.freeze({\n useCookie: ssrProfile === 'session' && profileOptions.useCookie,\n responseCache: responseCache === false ? false : Object.freeze({\n ...responseCache\n })\n });\n}","import { includeBooleanAttr, isBooleanAttr, isString, stringifyStyle } from '@vue/shared';\nimport { defu } from 'defu';\nimport { normalizeClass, normalizeStyle, ref, useSSRContext } from 'vue';\nimport { BeanSimple } from 'zova';\nimport { CtxSSRMetaStore } from './ssrMetaStore.js';\nimport { resolveSsrProfile, resolveSsrProfileOptions } from './ssrProfile.js';\nconst SymbolIsRuntimeSsrPreHydration = Symbol('SymbolIsRuntimeSsrPreHydration');\nconst SymbolSSRContext = Symbol('SymbolSSRContext');\nconst SymbolSSRState = Symbol('SymbolSSRState');\nconst SymbolOnHydrateds = Symbol('SymbolOnHydrateds');\nconst SymbolOnHydratePropHasMismatches = Symbol('SymbolOnHydratePropHasMismatches');\nconst SymbolInstanceUpdates = Symbol('SymbolInstanceUpdates');\nconst SymbolHydratingCounter = Symbol('SymbolHydratingCounter');\nconst SymbolServerContexts = Symbol('SymbolServerContexts');\nexport class CtxSSR extends BeanSimple {\n constructor(...args) {\n super(...args);\n this[SymbolIsRuntimeSsrPreHydration] = ref(false);\n this[SymbolSSRContext] = void 0;\n this[SymbolSSRState] = void 0;\n this[SymbolOnHydrateds] = [];\n this[SymbolOnHydratePropHasMismatches] = [];\n this[SymbolInstanceUpdates] = [];\n this[SymbolHydratingCounter] = 0;\n this[SymbolServerContexts] = new Set();\n this._controllerLoadSequence = {};\n this.metaStore = void 0;\n }\n /** @internal */\n initialize() {\n if (process.env.SERVER) {\n this._serverContextRegister();\n }\n // ssr state\n this[SymbolSSRState] = this.sys.bean._getBeanSyncOnly('a-ssr.sys.ssrState');\n // SymbolIsRuntimeSsrPreHydration\n if (process.env.SERVER) {\n this[SymbolIsRuntimeSsrPreHydration].value = true;\n } else if (process.env.CLIENT && document.body.getAttribute('data-server-rendered') !== null) {\n this[SymbolIsRuntimeSsrPreHydration].value = true;\n }\n // onHydratePropHasMismatch\n if (process.env.CLIENT && this.isRuntimeSsrPreHydration) {\n this.onHydratePropHasMismatch((el, key, clientValue, vnode, instance) => {\n return this._onHydratePropHasMismatchDefault(el, key, clientValue, vnode, instance);\n });\n }\n // metaStore\n this.metaStore = this.bean._newBeanSimple(CtxSSRMetaStore, false);\n // fix: flash on page load\n // need not check process.env.DEV, because maybe need remove vite-css-module-id on prod\n if (process.env.CLIENT && this.isRuntimeSsrPreHydration) {\n this.onHydrated(() => {\n document.querySelectorAll('style[vite-css-module-id]').forEach(node => node.remove());\n });\n }\n }\n _serverContextRegister(currentContext = this.ctx) {\n const serverContexts = this[SymbolServerContexts];\n serverContexts.add(currentContext);\n this.context.onRendered(() => {\n serverContexts.delete(currentContext);\n });\n }\n _serverContextsDispose() {\n const serverContexts = this[SymbolServerContexts];\n for (const serverContext of serverContexts) {\n if (serverContext.disposed) continue;\n if (serverContext.bean && serverContext.bean !== serverContext.app?.bean) {\n serverContext.bean.dispose();\n }\n serverContext.dispose();\n }\n serverContexts.clear();\n }\n get isRuntimeSsrPreHydration() {\n return this[SymbolIsRuntimeSsrPreHydration].value;\n }\n get isRuntimeSsrHydrated() {\n return process.env.CLIENT && !this.isRuntimeSsrPreHydration;\n }\n set isRuntimeSsrPreHydration(value) {\n this[SymbolIsRuntimeSsrPreHydration].value = value;\n }\n get context() {\n if (process.env.CLIENT) throw new Error('cannot called in client');\n if (!this[SymbolSSRContext]) {\n this.ctx.util.instanceScope(() => {\n this[SymbolSSRContext] = useSSRContext();\n this._initContext();\n });\n }\n return this[SymbolSSRContext];\n }\n get state() {\n if (process.env.SERVER) {\n return this.context.state;\n } else {\n return this[SymbolSSRState].state;\n }\n }\n get stateDefer() {\n if (process.env.SERVER) {\n return this.context.stateDefer;\n } else {\n return this[SymbolSSRState].stateDefer;\n }\n }\n\n /** @internal */\n controllerLoad(event) {\n if (event.phase === 'prepare') {\n if (process.env.SERVER) {\n event.ctx.meta.state.controllerLoadKey = this._allocateControllerLoadKey(event);\n return;\n }\n if (!process.env.CLIENT || !this.isRuntimeSsrPreHydration) return;\n const key = this._allocateControllerLoadKey(event);\n const snapshot = this.stateDefer.controllerLoad?.[key];\n if (!snapshot || snapshot.version !== 1 || snapshot.controllerBeanName !== event.controllerBeanName) {\n return;\n }\n delete this.stateDefer.controllerLoad[key];\n event.replayError = _createControllerLoadError(snapshot);\n event.replayControllerRecorded = snapshot.controllerRecorded;\n return;\n }\n if (event.phase !== 'fallback' || !process.env.SERVER || !event.error) return;\n const key = event.ctx.meta.state.controllerLoadKey;\n if (!key) return;\n const controllerLoad = this.stateDefer.controllerLoad ??= {};\n controllerLoad[key] = _createControllerLoadErrorSnapshot(event);\n }\n _allocateControllerLoadKey(event) {\n const instance = event.ctx.instance;\n const parts = [];\n let current = instance;\n while (current) {\n const componentType = current.type;\n const name = componentType.__file ?? componentType.name ?? componentType.__name ?? 'anonymous';\n const key = current.vnode.key ?? '';\n parts.unshift(`${name}:${String(key)}`);\n current = current.parent;\n }\n const structuralKey = parts.join('/');\n const occurrence = this._controllerLoadSequence[structuralKey] ?? 0;\n this._controllerLoadSequence[structuralKey] = occurrence + 1;\n return `${structuralKey}#${occurrence}:${event.controllerBeanName ?? ''}`;\n }\n get profile() {\n return resolveSsrProfile(this.state.ssrProfile, this.sys.env.SSR_PROFILE);\n }\n get profileOptions() {\n const profileOptions = this.state.ssrProfileOptions;\n if (profileOptions) return profileOptions;\n return resolveSsrProfileOptions(this.profile, this.sys.config.ssr.profiles);\n }\n\n /** @internal */\n _setProfile(routeProfile, routeProfileOptions, metaLocale) {\n const ssrProfile = resolveSsrProfile(routeProfile, this.sys.env.SSR_PROFILE);\n const ssrProfileOptions = resolveSsrProfileOptions(ssrProfile, this.sys.config.ssr.profiles, routeProfileOptions, metaLocale);\n this.state.ssrProfile = ssrProfile;\n this.state.ssrProfileOptions = ssrProfileOptions;\n }\n\n /** @internal */\n _setLocale(route) {\n if (route.meta.locale) {\n this.app.meta.locale.current = route.params?.locale;\n }\n }\n get cookieDisabledOnServer() {\n return process.env.SERVER && !this.profileOptions.useCookie;\n }\n get renderSSRError() {\n return this.context._meta.renderError;\n }\n set renderSSRError(err) {\n this.context._meta.renderError = err;\n }\n getPerformAction(baseURL) {\n if (process.env.SERVER && baseURL === this.sys.env.SSR_API_BASE_URL) return this.context.performAction;\n return undefined;\n }\n _initContext() {\n const ssrContext = this[SymbolSSRContext];\n ssrContext._meta = defu(ssrContext._meta, {\n htmlAttrs: '',\n headTags: '',\n endingHeadTags: '',\n bodyClasses: '',\n bodyAttrs: 'data-server-rendered',\n bodyTags: '',\n endingBodyTags: '',\n baseUrl: this.sys.util.getAbsoluteUrlFromPagePath(undefined, false, true) // not include publicPath\n });\n ssrContext.state = ssrContext.state || {};\n ssrContext.stateDefer = ssrContext.stateDefer || {};\n }\n\n /**\n * Registers a callback that runs after initial client SSR hydration completes.\n * It does not run for SPA startup or later client navigation.\n */\n onHydrated(fn) {\n this[SymbolOnHydrateds].push(fn);\n }\n onHydratePropHasMismatch(fn) {\n this[SymbolOnHydratePropHasMismatches].push(fn);\n }\n handleDirectOrOnHydrated(fn) {\n if (!process.env.CLIENT) return;\n if (this.isRuntimeSsrPreHydration) {\n this.onHydrated(fn);\n } else {\n return fn();\n }\n }\n _onHydratePropHasMismatchDefault(el, key, clientValue, _vnode, _instance) {\n // expected\n let ignore = false;\n let expected;\n if (key === 'class') {\n ignore = true;\n if (clientValue !== undefined) {\n expected = normalizeClass(clientValue);\n el.setAttribute(key, expected);\n }\n } else if (key === 'style') {\n ignore = true;\n if (clientValue !== undefined) {\n expected = isString(clientValue) ? clientValue : stringifyStyle(normalizeStyle(clientValue));\n el.setAttribute(key, expected);\n }\n } else if (['id', 'name', 'for', 'd', 'aria-labelledby', 'aria-controls'].includes(key)) {\n ignore = true;\n if (clientValue !== undefined) {\n expected = String(clientValue);\n el.setAttribute(key, expected);\n }\n } else if (key === 'value') {\n ignore = true;\n if (clientValue !== undefined) {\n expected = String(clientValue);\n if (el.tagName === 'TEXTAREA') {\n el.value = expected;\n } else {\n el.setAttribute(key, expected);\n }\n }\n } else if (isBooleanAttr(key)) {\n ignore = true;\n if (clientValue !== undefined) {\n const expected = includeBooleanAttr(clientValue);\n if (expected) {\n el.setAttribute(key, '');\n } else {\n el.removeAttribute(key);\n }\n }\n } else if (el.getAttribute(`data-hydrate-ignore-${key}`) !== null) {\n ignore = true;\n if (clientValue !== undefined) {\n expected = String(clientValue);\n el.setAttribute(key, expected);\n }\n }\n if (!ignore) return {\n clientValue\n };\n return {\n ignore: true\n };\n }\n _hydrated() {\n if (!this.isRuntimeSsrPreHydration) return;\n // should be first\n this.isRuntimeSsrPreHydration = false;\n //\n this[SymbolInstanceUpdates].forEach(instance => {\n if (!instance.isUnmounted && instance.zova) {\n try {\n instance.update();\n } catch (err) {\n if (!err.message.includes(\"'insertBefore'\")) {\n throw err;\n }\n }\n }\n });\n this[SymbolInstanceUpdates] = [];\n //\n this[SymbolOnHydrateds].forEach(fn => fn());\n this[SymbolOnHydrateds] = [];\n //\n this[SymbolOnHydratePropHasMismatches] = [];\n }\n\n /** @internal */\n _hydratePropHasMismatch(el, key, clientValue, vnode, instance) {\n for (const fn of this[SymbolOnHydratePropHasMismatches]) {\n const res = fn(el, key, clientValue, vnode, instance);\n if (res.ignore) return res;\n clientValue = res.clientValue;\n }\n return {\n ignore: false,\n clientValue\n };\n }\n\n /** @internal */\n _hydratingRootInc() {\n if (process.env.CLIENT && this.isRuntimeSsrPreHydration) {\n this._hydratingInc();\n }\n }\n\n /** @internal */\n _hydratingRootDec() {\n if (process.env.CLIENT && this.isRuntimeSsrPreHydration) {\n this._hydratingDec();\n }\n }\n\n /** @internal */\n _hydratingInc() {\n ++this[SymbolHydratingCounter];\n }\n\n /** @internal */\n _hydratingDec() {\n if (--this[SymbolHydratingCounter] === 0) {\n this._hydrated();\n }\n }\n\n /** @internal */\n _hydratingInstanceRecord(instance) {\n if (!this[SymbolInstanceUpdates].includes(instance)) {\n this[SymbolInstanceUpdates].push(instance);\n return true;\n }\n return false;\n }\n\n /** @internal */\n _registerServerContext(currentContext) {\n this._serverContextRegister(currentContext);\n }\n\n /** @internal */\n _disposeServerContexts() {\n this._serverContextsDispose();\n }\n}\nfunction _createControllerLoadErrorSnapshot(event) {\n const error = event.error;\n const snapshot = {\n version: 1,\n controllerBeanName: event.controllerBeanName,\n name: error.name || 'Error',\n message: error.message || String(error),\n controllerRecorded: event.controllerRecorded === true\n };\n for (const key of ['code', 'status']) {\n if (typeof error[key] === 'number' || typeof error[key] === 'string') {\n snapshot[key] = error[key];\n }\n }\n for (const key of ['pagePath', 'url']) {\n if (typeof error[key] === 'string') {\n snapshot[key] = error[key];\n }\n }\n return snapshot;\n}\nfunction _createControllerLoadError(snapshot) {\n const error = new Error(snapshot.message);\n error.name = snapshot.name;\n for (const key of ['code', 'status', 'pagePath', 'url']) {\n if (snapshot[key] !== undefined) {\n error[key] = snapshot[key];\n }\n }\n return error;\n}","import { BeanSimple } from 'zova';\nimport { CtxSSR } from './lib/ssr.js';\nexport class MonkeySys extends BeanSimple {\n constructor(moduleSelf) {\n super();\n this._moduleSelf = void 0;\n this._sysSsrState = void 0;\n this._moduleSelf = moduleSelf;\n }\n async getSysSsrState() {\n if (!this._sysSsrState) {\n this._sysSsrState = await this.bean._getBean('a-ssr.sys.ssrState', false);\n }\n return this._sysSsrState;\n }\n async moduleLoading(module) {\n if (this._moduleSelf === module) return;\n await this.getSysSsrState();\n }\n async moduleLoaded(_module) {}\n async configLoaded(_module, _config) {}\n sysContextInitialize(ctx) {\n ctx.meta.$ssr = ctx.bean._newBeanSimple(CtxSSR, false);\n ctx.meta.$ssr.initialize();\n }\n}","var _dec, _dec2, _class;\nimport { \"BeanInfo\" as __z_BeanInfo } from \"zova\";\n// eslint-disable\n/** sys: begin */\nexport * from '../bean/sys.ssrState.js';\nimport 'zova';\n/** sys: end */\n/** sys: begin */\nimport { SysSsrState } from '../bean/sys.ssrState.js';\nimport 'zova';\n/** sys: end */\n/** config: begin */\nexport * from '../config/config.js';\n/** config: end */\n/** monkey: begin */\nexport * from '../monkey.js';\n/** monkey: end */\n/** monkeySys: begin */\nexport * from '../monkeySys.js';\n/** monkeySys: end */\n/** scope: begin */\nimport { BeanScopeBase } from 'zova';\nimport { Scope } from 'zova-module-a-bean';\nexport let ScopeModuleASsr = (_dec = Scope(), _dec2 = __z_BeanInfo({\n module: \"a-ssr\"\n}), _dec(_class = _dec2(_class = class ScopeModuleASsr extends BeanScopeBase {}) || _class) || _class);\nimport 'zova';\n\n/** scope: end */","export function getBodyReadyObserverScript() {\n return `<script id=\"ssr-body-ready-observer\">\n window.ssr_bodyReadyObserverClear=()=>{\n window.ssr_body_ready_condition=undefined;\n window.ssr_body_ready_callback=undefined;\n window.ssr_bodyReadyObserver?.disconnect();\n window.ssr_bodyReadyObserver=undefined;\n document.body.style.display='block';\n document.querySelector('#ssr-body-ready-observer')?.remove();\n };\n window.ssr_bodyReadyObserver = new MutationObserver(() => {\n const __targets=window.ssr_body_ready_condition?.();\n if(__targets){\n try{\n window.ssr_body_ready_callback?.(__targets);\n }finally{\n window.ssr_bodyReadyObserverClear();\n }\n }\n });\n window.ssr_bodyReadyObserver.observe(document.body, {\n subtree: true,\n childList: true,\n });\n document.addEventListener(\"DOMContentLoaded\", () => {\n window.ssr_bodyReadyObserverClear();\n });\n </script>`.replaceAll('\\\\n', '');\n}"],"mappings":";;;;;;;;;AAAA,IAAI;AAAM,IAAA;AAAO,IAAA;AAIjB,IAAM,mBAAiB,OAAO,gBAAgB;AAC9C,IAAM,sBAAsB,OAAO,qBAAqB;AACxD,IAAW,e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,KAAA,GACpB,MAAM,OAAO,SAAS;CAG1B,OAAO;AACT;;;ACjYA,IAAa,YAAb,cAA+B,WAAW;CACxC,YAAY,YAAY;EACtB,MAAM;EACN,KAAK,cAAc,KAAK;EACxB,KAAK,eAAe,KAAK;EACzB,KAAK,cAAc;CACrB;CACA,MAAM,iBAAiB;EACrB,IAAI,CAAC,KAAK,cACR,KAAK,eAAe,MAAM,KAAK,KAAK,SAAS,sBAAsB,KAAK;EAE1E,OAAO,KAAK;CACd;CACA,MAAM,cAAc,QAAQ;EAC1B,IAAI,KAAK,gBAAgB,QAAQ;EACjC,MAAM,KAAK,eAAe;CAC5B;CACA,MAAM,aAAa,SAAS,CAAC;CAC7B,MAAM,aAAa,SAAS,SAAS,CAAC;CACtC,qBAAqB,KAAK;EACxB,IAAI,KAAK,OAAO,IAAI,KAAK,eAAe,QAAQ,KAAK;EACrD,IAAI,KAAK,KAAK,WAAW;CAC3B;AACF;;;;;ACzBA,IAAI;AAAM,IAAA;AAAO,IAAA;AAuBjB,IAAW,mBAAmB,OAAO,MAAM,GAAG,QAAQ,SAAa,EACjE,QAAQ,QACV,CAAC,GAAG,KAAK,SAAS,MAAM,SAAS,MAAM,wBAAwB,cAAc,CAAC,CAAC,KAAK,MAAM,KAAK;;;;ACzB/F,SAAgB,6BAA6B;CAC3C,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;kBA0BQ,WAAW,OAAO,EAAE;AACrC"}
1
+ {"version":3,"file":"index.js","names":["_dec","_dec2","_class","SymbolSSRState","__z_BeanInfo","__z_BeanInfo"],"sources":["../src/bean/sys.ssrState.ts","../src/config/config.ts","../src/lib/ssrNavigation.ts","../src/lib/useMeta.ts","../src/monkey.ts","../src/lib/utils.ts","../src/lib/ssrMetaStore.ts","../src/lib/ssrProfile.ts","../src/lib/ssr.ts","../src/monkeySys.ts","../src/.metadata/index.ts","../src/lib/bodyReadyObserver.ts"],"sourcesContent":["var _dec, _dec2, _class;\nimport { \"BeanInfo\" as __z_BeanInfo } from \"zova\";\nimport { BeanBase, cast } from 'zova';\nimport { Sys } from 'zova-module-a-bean';\nconst SymbolSSRState = Symbol('SymbolSSRState');\nconst SymbolSSRStateDefer = Symbol('SymbolSSRStateDefer');\nexport let SysSsrState = (_dec = Sys(), _dec2 = __z_BeanInfo({\n module: \"a-ssr\"\n}), _dec(_class = _dec2(_class = class SysSsrState extends BeanBase {\n constructor(...args) {\n super(...args);\n this[SymbolSSRState] = void 0;\n this[SymbolSSRStateDefer] = void 0;\n }\n async __init__() {\n if (process.env.CLIENT) {\n if (cast(window).__INITIAL_STATE__) {\n this[SymbolSSRState] = cast(window).__INITIAL_STATE__;\n delete cast(window).__INITIAL_STATE__;\n document.getElementById('ssr-state-init')?.remove();\n } else {\n this[SymbolSSRState] = {};\n }\n if (cast(window).__INITIAL_STATE_DEFER__) {\n this[SymbolSSRStateDefer] = cast(window).__INITIAL_STATE_DEFER__;\n delete cast(window).__INITIAL_STATE_DEFER__;\n document.getElementById('ssr-state-defer-init')?.remove();\n } else {\n this[SymbolSSRStateDefer] = {};\n }\n }\n }\n get state() {\n return this[SymbolSSRState];\n }\n get stateDefer() {\n return this[SymbolSSRStateDefer];\n }\n}) || _class) || _class);","export const config = sys => {\n const ssrConfig = {\n cookieThemeDarkDefault: sys.env.SSR_COOKIE_THEMEDARK_DEFAULT === 'true'\n };\n return ssrConfig;\n};","import { combineParamsAndQuery } from '@cabloy/utils';\n\n// Keep the matched route/alias and existing optional-default URL policy. No new identity.\nexport function getCanonicalLocaleRoutePath(route, locale, defaultLocale) {\n if (!route.meta.locale) return;\n const value = locale.normalize(route.params?.locale);\n const canonical = value === defaultLocale ? '' : value;\n if ((route.params?.locale ?? '') === canonical) return;\n // A synthetic layout parent may retain its original path while its child matches\n // the public alias. The deepest matching record owns the actual destination URL.\n const matched = route.matched.findLast(record => record.path.includes(':locale'));\n if (!matched) return;\n const path = combineParamsAndQuery(matched.path, {\n params: {\n ...route.params,\n locale: canonical || undefined\n },\n query: route.query\n }) + (route.hash ?? '');\n return path !== route.fullPath ? path : undefined;\n}\nexport function createSsrNavigationSync(options) {\n const navigationLocales = new WeakMap();\n return {\n beforeEach(to) {\n navigationLocales.set(to, options.getLocale());\n options.setProfile(to);\n options.setRouteLocale(to);\n },\n afterEach(to, from, failure) {\n const locale = navigationLocales.get(to);\n navigationLocales.delete(to);\n if (!failure) return;\n options.setProfile(from);\n if (locale !== undefined) {\n options.setLocale(locale);\n }\n }\n };\n}","// from: quasar/ui/src/composables/use-meta.js\nimport { computed, onActivated, onDeactivated, onUnmounted, watch } from 'vue';\nexport function useMeta(ctx, metaOptions) {\n if (process.env.SERVER) {\n ctx.meta.$ssr.context.__qMetaList.push(typeof metaOptions === 'function' ? metaOptions() : metaOptions);\n } else {\n const meta = {\n active: true\n };\n if (typeof metaOptions === 'function') {\n const content = computed(metaOptions);\n meta.val = content.value;\n watch(content, val => {\n meta.val = val;\n meta.active === true && ctx.meta.$ssr.metaStore.planClientUpdate();\n });\n } else {\n meta.val = metaOptions;\n }\n ctx.meta.$ssr.metaStore.addMetaOptions(meta);\n ctx.meta.$ssr.metaStore.planClientUpdate();\n onActivated(() => {\n try {\n meta.active = true;\n ctx.meta.$ssr.metaStore.planClientUpdate();\n } catch (_err) {}\n });\n onDeactivated(() => {\n try {\n meta.active = false;\n ctx.meta.$ssr.metaStore.planClientUpdate();\n } catch (_err) {}\n });\n onUnmounted(() => {\n try {\n ctx.meta.$ssr.metaStore.removeMetaOptions(meta);\n ctx.meta.$ssr.metaStore.planClientUpdate();\n } catch (_err) {}\n });\n }\n}","import { isNavigationFailure } from '@cabloy/vue-router';\nimport { BeanSimple, cast } from 'zova';\nimport { createSsrNavigationSync, getCanonicalLocaleRoutePath } from './lib/ssrNavigation.ts';\nimport { useMeta } from './lib/useMeta.ts';\nexport class Monkey extends BeanSimple {\n appContextInitialize(ctx) {\n ctx.meta.$ssr = ctx.app.ctx.meta.$ssr;\n if (process.env.CLIENT) {\n ctx.meta.$ssr.handleDirectOrOnHydrated(() => {\n if (!ctx.disposed) {\n ctx.meta.hooks.invokeHook('hydrated');\n }\n });\n }\n if (process.env.SERVER) {\n ctx.meta.$ssr._registerServerContext(ctx);\n }\n }\n controllerLoad(event) {\n event.ctx.meta.$ssr.controllerLoad(event);\n }\n async appInitialize() {\n this.app.meta.event.on('a-router:routerGuards', async (router, next) => {\n if (process.env.CLIENT) {\n const navigationSync = createSsrNavigationSync({\n getLocale: () => this.app.meta.locale.current,\n setLocale: locale => {\n this.app.meta.locale.current = locale;\n },\n setProfile: route => {\n this.ctx.meta.$ssr._setProfile(route.meta.ssrProfile, route.meta.ssrProfileOptions, route.meta.locale);\n },\n setRouteLocale: route => {\n this.ctx.meta.$ssr._setLocale(route);\n }\n });\n router.beforeEach(to => {\n const canonicalPath = getCanonicalLocaleRoutePath(to, this.app.meta.locale, this.sys.config.locale.default);\n if (canonicalPath) return {\n path: canonicalPath,\n query: to.query,\n hash: to.hash,\n replace: true\n };\n navigationSync.beforeEach(to);\n });\n router.afterEach((to, from, failure) => {\n navigationSync.afterEach(to, from, failure);\n });\n }\n return await next();\n });\n if (process.env.CLIENT && this.ctx.meta.$ssr.isRuntimeSsrPreHydration) {\n this.ctx.meta.$ssr.onHydrated(() => {\n document.documentElement.setAttribute('data-zova-hydrated', this.sys.env.SITE_ID);\n });\n }\n // ssr errorHandler\n if (process.env.SERVER) {\n this._ssrErrorHandler();\n }\n }\n async moduleLoading(_module) {}\n async moduleLoaded(module) {\n // ssrContext.modules\n if (process.env.SERVER && process.env.PROD) {\n if (!this.ctx.meta.$ssr.context.modules) this.ctx.meta.$ssr.context.modules = new Set();\n this.ctx.meta.$ssr.context.modules.add(`@@${module.info.relativeName}`);\n }\n }\n async beanInit(bean, beanInstance) {\n // eslint-disable-next-line\n const self = this;\n // $ssr\n bean.defineProperty(beanInstance, '$ssr', {\n enumerable: false,\n configurable: true,\n get() {\n return self.app.ctx.meta.$ssr;\n }\n });\n // $useMeta\n bean.defineProperty(beanInstance, '$useMeta', {\n enumerable: false,\n configurable: true,\n get() {\n return function (options) {\n const ctx = cast(this).ctx;\n ctx.util.instanceScope(() => {\n useMeta(ctx, options);\n });\n };\n }\n });\n }\n _ssrErrorHandler() {\n if (!process.env.SERVER) return;\n const _eventErrorHandler = this.app.meta.event.on('app:errorHandler', (data, next) => {\n const err = next();\n if (data.load?.kind === 'controller-load') {\n if (_isLoadErrorHandledServer(data.err)) {\n data.load.disposition = 'handled';\n if (!err || !(err instanceof Error)) return err;\n return this._errorHandlerDefaultServer(err);\n }\n return err;\n }\n if (!err || !(err instanceof Error)) return err;\n return this._errorHandlerDefaultServer(err);\n });\n this.ctx.meta.$ssr.context.onRendered(_err => {\n _eventErrorHandler();\n });\n }\n _errorHandlerDefaultServer(err) {\n if (!process.env.SERVER) return err;\n if (isNavigationFailure(err)) {\n if (!this.ctx.meta.$ssr.renderSSRError) {\n this.ctx.meta.$ssr.renderSSRError = err;\n }\n return undefined;\n } else if (err.code === 401) {\n try {\n this.app.$gotoLogin();\n } catch (err) {\n this.ctx.meta.$ssr.renderSSRError = err;\n }\n } else {\n this.ctx.meta.$ssr.renderSSRError = err;\n }\n return undefined;\n }\n}\nfunction _isLoadErrorHandledServer(err) {\n return isNavigationFailure(err) || [301, 302, 401].includes(Number(err.code));\n}","import * as devalue from 'devalue';\nexport function unevalPatch(value) {\n return devalue.uneval(value);\n // return devalue.uneval(value, value => {\n // if (value && typeof value === 'object' && value.toJSON) {\n // return value.toJSON();\n // }\n // });\n}","// from: quasar/ui/src/plugins/Meta.js\nimport { extend } from '@cabloy/extend';\nimport { BeanSimple, cast } from 'zova';\nimport { unevalPatch } from './utils.ts';\nexport class CtxSSRMetaStore extends BeanSimple {\n constructor(...args) {\n super(...args);\n this._updateId = 0;\n this._currentClientMeta = void 0;\n this._clientList = [];\n }\n __init__() {\n if (process.env.SERVER) {\n const ssrContext = this.ctx.meta.$ssr.context;\n ssrContext.__qMetaList = [];\n ssrContext.rendered = () => {\n this._onRenderedLast();\n ssrContext.rendered = () => {};\n };\n }\n if (process.env.CLIENT && this.ctx.meta.$ssr.isRuntimeSsrPreHydration) {\n this._currentClientMeta = cast(window).__Q_META__;\n document.getElementById('ssr-meta-init')?.remove();\n }\n }\n _onRenderedLast(err) {\n const app = this.app;\n try {\n if (err) return;\n const ssrContext = this.ctx.meta.$ssr.context;\n this._injectContextState(ssrContext);\n this._injectContextStateDefer(ssrContext);\n this._injectServerMeta(ssrContext);\n } finally {\n this.ctx.meta.$ssr._disposeServerContexts();\n app?.close();\n }\n }\n addMetaOptions(metaOptionsWrapper) {\n this._clientList.push(metaOptionsWrapper);\n }\n removeMetaOptions(metaOptionsWrapper) {\n this._clientList.splice(this._clientList.indexOf(metaOptionsWrapper), 1);\n }\n planClientUpdate() {\n if (this._updateId !== 0) {\n clearTimeout(this._updateId);\n }\n this._updateId = window.setTimeout(() => {\n this._updateId = 0;\n this._updateClientMeta();\n }, 50);\n }\n _updateClientMeta() {\n const data = {\n title: '',\n titleTemplate: undefined,\n meta: {},\n link: {},\n script: {},\n htmlAttr: {},\n bodyAttr: {}\n };\n for (let i = 0; i < this._clientList.length; i++) {\n const {\n active,\n val\n } = this._clientList[i];\n if (active === true) {\n extend(true, data, val);\n }\n }\n normalize(data);\n apply(diff(this._currentClientMeta, data));\n this._currentClientMeta = data;\n }\n _injectServerMeta(ssrContext) {\n const data = {\n title: '',\n titleTemplate: undefined,\n meta: {},\n link: {},\n htmlAttr: {},\n bodyAttr: {},\n bodyStyle: {},\n bodyClass: {},\n noscript: {}\n };\n const list = ssrContext.__qMetaList;\n for (let i = 0; i < list.length; i++) {\n extend(true, data, list[i]);\n }\n normalize(data);\n const nonce = ssrContext.nonce !== void 0 ? ` nonce=\"${ssrContext.nonce}\"` : '';\n const ctx = ssrContext._meta;\n const htmlAttr = Object.keys(data.htmlAttr).filter(htmlFilter);\n if (htmlAttr.length !== 0) {\n ctx.htmlAttrs += (ctx.htmlAttrs.length !== 0 ? ' ' : '') + htmlAttr.map(getAttr(data.htmlAttr)).join(' ');\n }\n ctx.headTags += getHead(data);\n const bodyAttr = Object.keys(data.bodyAttr).filter(bodyFilter);\n if (bodyAttr.length !== 0) {\n ctx.bodyAttrs += (ctx.bodyAttrs.length !== 0 ? ' ' : '') + bodyAttr.map(getAttr(data.bodyAttr)).join(' ');\n }\n const bodyStyle = Object.keys(data.bodyStyle).filter(name => !!data.bodyStyle[name]).map(name => `${name}:${data.bodyStyle[name]};`).join('');\n if (bodyStyle) {\n ctx.bodyAttrs += `${ctx.bodyAttrs.length !== 0 ? ' ' : ''}style=\"${bodyStyle}\"`;\n }\n const _bodyClass = ctx.bodyClasses.split(' ').filter(item => !!item);\n const bodyClass = {};\n _bodyClass.forEach(item => bodyClass[item] = true);\n extend(true, bodyClass, data.bodyClass);\n ctx.bodyClasses = Object.keys(bodyClass).filter(name => bodyClass[name]).map(name => name).join(' ');\n data.title = '\\'\"`';\n ctx.endingHeadTags += `${Object.keys(data.noscript).map(name => `<noscript data-qmeta=\"${name}\">${data.noscript[name]}</noscript>`).join('')}<script${nonce} id=\"ssr-meta-init\">window.__Q_META__=${delete data.bodyStyle && delete data.bodyClass && delete data.noscript && unevalPatch(data)}</script>`;\n const cookieTheme = this.ctx.meta.$ssr.profileOptions.useCookie;\n let ssr_local_themedark = cookieTheme ? `let ssr_cookie_themedark=document.cookie.split('; ')?.find(item=>item.indexOf('themedark=')>-1)?.split('=')[1];\n ssr_cookie_themedark=ssr_cookie_themedark==='true'?true:ssr_cookie_themedark==='false'?false:${this.sys.env.SSR_COOKIE_THEMEDARK_DEFAULT};\n window.ssr_themedark=window.ssr_cookie_themedark=ssr_cookie_themedark;` : `let ssr_local_themedark=window.ssr_load_local('themedark');\n if(ssr_local_themedark===undefined || ssr_local_themedark==='auto'){\n ssr_local_themedark=window.matchMedia('(prefers-color-scheme: dark)').matches;\n }\n window.ssr_themedark=window.ssr_local_themedark=ssr_local_themedark;`;\n // Resolve the final browser theme from the SSR dual markers emitted before page render.\n ssr_local_themedark += `Object.defineProperty(window, 'ssr_themedark_data', {\n get: () => {\n let _data=document.body.getAttribute('data-ssr-theme-dark-'+window.ssr_themedark);\n if(_data===undefined || _data===null){\n _data=window.__INITIAL_STATE__ && window.__INITIAL_STATE__['data-ssr-theme-dark-'+window.ssr_themedark];\n }\n return _data;\n },\n });`;\n const ssr_local_themename = cookieTheme ? '' : `window.ssr_local_themename=window.ssr_load_local('themename','${this.sys.env.STYLE_DEFAULT_THEME}');`;\n ctx.endingHeadTags += `<script id=\"ssr-prefers-color-schema-dark\">\n window.ssr_load_local=function(key,defaultValue){\n const __ssr_local=localStorage.getItem(key);\n const value=__ssr_local?JSON.parse(__ssr_local):undefined;\n return value??defaultValue;\n };\n ${ssr_local_themedark}\n ${ssr_local_themename}\n document.querySelector('#ssr-prefers-color-schema-dark').remove();\n </script>`.replaceAll('\\n', '');\n }\n _injectContextState(ssrContext) {\n const ctx = ssrContext._meta;\n const nonce = ssrContext.nonce !== void 0 ? ` nonce=\"${ssrContext.nonce}\"` : '';\n ctx.endingHeadTags += `<script${nonce} id=\"ssr-state-init\">window.__INITIAL_STATE__=${unevalPatch(ssrContext.state)}</script>`;\n }\n _injectContextStateDefer(ssrContext) {\n const ctx = ssrContext._meta;\n const nonce = ssrContext.nonce !== void 0 ? ` nonce=\"${ssrContext.nonce}\"` : '';\n ctx.endingBodyTags += `<script${nonce} id=\"ssr-state-defer-init\">window.__INITIAL_STATE_DEFER__=${unevalPatch(ssrContext.stateDefer)}</script>`;\n }\n}\nfunction normalize(meta) {\n if (meta.title) {\n meta.title = meta.titleTemplate ? meta.titleTemplate(meta.title) : meta.title;\n delete meta.titleTemplate;\n }\n [['meta', 'content'], ['link', 'href']].forEach(type => {\n const metaType = meta[type[0]];\n const metaProp = type[1];\n for (const name in metaType) {\n const metaLink = metaType[name];\n if (metaLink.template) {\n if (Object.keys(metaLink).length === 1) {\n delete metaType[name];\n } else {\n metaLink[metaProp] = metaLink.template(metaLink[metaProp] || '');\n delete metaLink.template;\n }\n }\n }\n });\n}\nfunction changed(old, def) {\n if (Object.keys(old).length !== Object.keys(def).length) {\n return true;\n }\n for (const key in old) {\n if (old[key] !== def[key]) {\n return true;\n }\n }\n}\nfunction bodyFilter(name) {\n return ['class', 'style'].includes(name) === false;\n}\nfunction htmlFilter(_name) {\n return true;\n // return ['lang', 'dir'].includes(name) === false;\n}\nfunction diff(meta, other) {\n const add = {};\n const remove = {};\n if (meta === void 0) {\n return {\n add: other,\n remove\n };\n }\n if (meta.title !== other.title) {\n add.title = other.title;\n }\n ['meta', 'link', 'script', 'htmlAttr', 'bodyAttr'].forEach(type => {\n const old = meta[type];\n const cur = other[type];\n remove[type] = [];\n if (old === void 0 || old === null) {\n add[type] = cur;\n return;\n }\n add[type] = {};\n for (const key in old) {\n if (Object.prototype.hasOwnProperty.call(cur, key) === false) {\n remove[type].push(key);\n }\n }\n for (const key in cur) {\n if (Object.prototype.hasOwnProperty.call(old, key) === false) {\n add[type][key] = cur[key];\n } else if (changed(old[key], cur[key]) === true) {\n remove[type].push(key);\n add[type][key] = cur[key];\n }\n }\n });\n return {\n add,\n remove\n };\n}\nfunction apply({\n add,\n remove\n}) {\n if (add.title) {\n document.title = add.title;\n }\n if (Object.keys(remove).length !== 0) {\n ['meta', 'link', 'script'].forEach(type => {\n remove[type].forEach(name => {\n document.head.querySelector(`${type}[data-qmeta=\"${name}\"]`)?.remove();\n });\n });\n remove.htmlAttr.filter(htmlFilter).forEach(name => {\n document.documentElement.removeAttribute(name);\n });\n remove.bodyAttr.filter(bodyFilter).forEach(name => {\n document.body.removeAttribute(name);\n });\n }\n ['meta', 'link', 'script'].forEach(type => {\n const metaType = add[type];\n for (const name in metaType) {\n const tag = document.createElement(type);\n for (const att in metaType[name]) {\n if (att !== 'innerHTML') {\n tag.setAttribute(att, metaType[name][att]);\n }\n }\n tag.setAttribute('data-qmeta', name);\n if (type === 'script') {\n tag.innerHTML = metaType[name].innerHTML || '';\n }\n document.head.appendChild(tag);\n }\n });\n Object.keys(add.htmlAttr).filter(htmlFilter).forEach(name => {\n document.documentElement.setAttribute(name, add.htmlAttr[name] || '');\n });\n Object.keys(add.bodyAttr).filter(bodyFilter).forEach(name => {\n document.body.setAttribute(name, add.bodyAttr[name] || '');\n });\n}\nfunction getAttr(seed) {\n return att => {\n const val = seed[att];\n return att + (val !== true && val !== void 0 ? `=\"${val}\"` : '');\n };\n}\nfunction getHead(meta) {\n let output = '';\n if (meta.title) {\n output += `<title>${meta.title}</title>`;\n }\n ['meta', 'link', 'script'].forEach(type => {\n const metaType = meta[type];\n for (const att in metaType) {\n const attrs = Object.keys(metaType[att]).filter(att => att !== 'innerHTML').map(getAttr(metaType[att]));\n output += `<${type} ${attrs.join(' ')} data-qmeta=\"${att}\">`;\n if (type === 'script') {\n output += `${metaType[att].innerHTML || ''}</script>`;\n }\n }\n });\n return output;\n}","export function resolveSsrProfile(routeProfile, defaultProfile) {\n const ssrProfile = routeProfile ?? defaultProfile ?? 'public';\n if (ssrProfile !== 'public' && ssrProfile !== 'session') {\n throw new Error(`invalid SSR profile: ${ssrProfile}`);\n }\n return ssrProfile;\n}\nexport function resolveSsrProfileOptions(ssrProfile, profiles, routeProfileOptions, metaLocale) {\n const profileOptions = profiles[ssrProfile];\n if (!profileOptions) {\n throw new Error(`invalid SSR profile: ${ssrProfile}`);\n }\n const responseCache = routeProfileOptions?.responseCache ?? (ssrProfile === 'public' && metaLocale !== true ? {\n expires: 0\n } : profileOptions.responseCache);\n return Object.freeze({\n useCookie: ssrProfile === 'session' && profileOptions.useCookie,\n responseCache: responseCache === false ? false : Object.freeze({\n ...responseCache\n })\n });\n}","import { includeBooleanAttr, isBooleanAttr, isString, stringifyStyle } from '@vue/shared';\nimport { defu } from 'defu';\nimport { normalizeClass, normalizeStyle, ref, useSSRContext } from 'vue';\nimport { BeanSimple } from 'zova';\nimport { CtxSSRMetaStore } from './ssrMetaStore.ts';\nimport { getCanonicalLocaleRoutePath } from './ssrNavigation.ts';\nimport { resolveSsrProfile, resolveSsrProfileOptions } from './ssrProfile.ts';\nconst SymbolIsRuntimeSsrPreHydration = Symbol('SymbolIsRuntimeSsrPreHydration');\nconst SymbolSSRContext = Symbol('SymbolSSRContext');\nconst SymbolSSRState = Symbol('SymbolSSRState');\nconst SymbolOnHydrateds = Symbol('SymbolOnHydrateds');\nconst SymbolOnHydratePropHasMismatches = Symbol('SymbolOnHydratePropHasMismatches');\nconst SymbolInstanceUpdates = Symbol('SymbolInstanceUpdates');\nconst SymbolHydratingCounter = Symbol('SymbolHydratingCounter');\nconst SymbolServerContexts = Symbol('SymbolServerContexts');\nexport class CtxSSR extends BeanSimple {\n constructor(...args) {\n super(...args);\n this[SymbolIsRuntimeSsrPreHydration] = ref(false);\n this[SymbolSSRContext] = void 0;\n this[SymbolSSRState] = void 0;\n this[SymbolOnHydrateds] = [];\n this[SymbolOnHydratePropHasMismatches] = [];\n this[SymbolInstanceUpdates] = [];\n this[SymbolHydratingCounter] = 0;\n this[SymbolServerContexts] = new Set();\n this._controllerLoadSequence = {};\n this.metaStore = void 0;\n }\n /** @internal */\n initialize() {\n if (process.env.SERVER) {\n this._serverContextRegister();\n }\n // ssr state\n this[SymbolSSRState] = this.sys.bean._getBeanSyncOnly('a-ssr.sys.ssrState');\n // SymbolIsRuntimeSsrPreHydration\n if (process.env.SERVER) {\n this[SymbolIsRuntimeSsrPreHydration].value = true;\n } else if (process.env.CLIENT && document.body.getAttribute('data-server-rendered') !== null) {\n this[SymbolIsRuntimeSsrPreHydration].value = true;\n }\n // onHydratePropHasMismatch\n if (process.env.CLIENT && this.isRuntimeSsrPreHydration) {\n this.onHydratePropHasMismatch((el, key, clientValue, vnode, instance) => {\n return this._onHydratePropHasMismatchDefault(el, key, clientValue, vnode, instance);\n });\n }\n // metaStore\n this.metaStore = this.bean._newBeanSimple(CtxSSRMetaStore, false);\n // fix: flash on page load\n // need not check process.env.DEV, because maybe need remove vite-css-module-id on prod\n if (process.env.CLIENT && this.isRuntimeSsrPreHydration) {\n this.onHydrated(() => {\n document.querySelectorAll('style[vite-css-module-id]').forEach(node => node.remove());\n });\n }\n }\n _serverContextRegister(currentContext = this.ctx) {\n const serverContexts = this[SymbolServerContexts];\n serverContexts.add(currentContext);\n this.context.onRendered(() => {\n serverContexts.delete(currentContext);\n });\n }\n _serverContextsDispose() {\n const serverContexts = this[SymbolServerContexts];\n for (const serverContext of serverContexts) {\n if (serverContext.disposed) continue;\n if (serverContext.bean && serverContext.bean !== serverContext.app?.bean) {\n serverContext.bean.dispose();\n }\n serverContext.dispose();\n }\n serverContexts.clear();\n }\n get isRuntimeSsrPreHydration() {\n return this[SymbolIsRuntimeSsrPreHydration].value;\n }\n get isRuntimeSsrHydrated() {\n return process.env.CLIENT && !this.isRuntimeSsrPreHydration;\n }\n set isRuntimeSsrPreHydration(value) {\n this[SymbolIsRuntimeSsrPreHydration].value = value;\n }\n get context() {\n if (process.env.CLIENT) throw new Error('cannot called in client');\n if (!this[SymbolSSRContext]) {\n this.ctx.util.instanceScope(() => {\n this[SymbolSSRContext] = useSSRContext();\n this._initContext();\n });\n }\n return this[SymbolSSRContext];\n }\n get state() {\n if (process.env.SERVER) {\n return this.context.state;\n } else {\n return this[SymbolSSRState].state;\n }\n }\n get stateDefer() {\n if (process.env.SERVER) {\n return this.context.stateDefer;\n } else {\n return this[SymbolSSRState].stateDefer;\n }\n }\n\n /** @internal */\n controllerLoad(event) {\n if (event.phase === 'prepare') {\n if (process.env.SERVER) {\n event.ctx.meta.state.controllerLoadKey = this._allocateControllerLoadKey(event);\n return;\n }\n if (!process.env.CLIENT || !this.isRuntimeSsrPreHydration) return;\n const key = this._allocateControllerLoadKey(event);\n const snapshot = this.stateDefer.controllerLoad?.[key];\n if (!snapshot || snapshot.version !== 1 || snapshot.controllerBeanName !== event.controllerBeanName) {\n return;\n }\n delete this.stateDefer.controllerLoad[key];\n event.replayError = _createControllerLoadError(snapshot);\n event.replayControllerRecorded = snapshot.controllerRecorded;\n return;\n }\n if (event.phase !== 'fallback' || !process.env.SERVER || !event.error) return;\n const key = event.ctx.meta.state.controllerLoadKey;\n if (!key) return;\n const controllerLoad = this.stateDefer.controllerLoad ??= {};\n controllerLoad[key] = _createControllerLoadErrorSnapshot(event);\n }\n _allocateControllerLoadKey(event) {\n const instance = event.ctx.instance;\n const parts = [];\n let current = instance;\n while (current) {\n const componentType = current.type;\n const name = componentType.__file ?? componentType.name ?? componentType.__name ?? 'anonymous';\n const key = current.vnode.key ?? '';\n parts.unshift(`${name}:${String(key)}`);\n current = current.parent;\n }\n const structuralKey = parts.join('/');\n const occurrence = this._controllerLoadSequence[structuralKey] ?? 0;\n this._controllerLoadSequence[structuralKey] = occurrence + 1;\n return `${structuralKey}#${occurrence}:${event.controllerBeanName ?? ''}`;\n }\n get profile() {\n return resolveSsrProfile(this.state.ssrProfile, this.sys.env.SSR_PROFILE);\n }\n get profileOptions() {\n const profileOptions = this.state.ssrProfileOptions;\n if (profileOptions) return profileOptions;\n return resolveSsrProfileOptions(this.profile, this.sys.config.ssr.profiles);\n }\n\n /** @internal */\n _setProfile(routeProfile, routeProfileOptions, metaLocale) {\n const ssrProfile = resolveSsrProfile(routeProfile, this.sys.env.SSR_PROFILE);\n const ssrProfileOptions = resolveSsrProfileOptions(ssrProfile, this.sys.config.ssr.profiles, routeProfileOptions, metaLocale);\n this.state.ssrProfile = ssrProfile;\n this.state.ssrProfileOptions = ssrProfileOptions;\n }\n\n /** @internal */\n _setLocale(route) {\n if (route.meta.locale) {\n this.app.meta.locale.current = route.params?.locale;\n if (process.env.SERVER) {\n const canonicalPath = getCanonicalLocaleRoutePath(route, this.app.meta.locale, this.sys.config.locale.default);\n if (canonicalPath) this.app.$redirect(canonicalPath);\n }\n }\n }\n get cookieDisabledOnServer() {\n return process.env.SERVER && !this.profileOptions.useCookie;\n }\n get renderSSRError() {\n return this.context._meta.renderError;\n }\n set renderSSRError(err) {\n this.context._meta.renderError = err;\n }\n getPerformAction(baseURL) {\n if (process.env.SERVER && baseURL === this.sys.env.SSR_API_BASE_URL) return this.context.performAction;\n return undefined;\n }\n _initContext() {\n const ssrContext = this[SymbolSSRContext];\n ssrContext._meta = defu(ssrContext._meta, {\n htmlAttrs: '',\n headTags: '',\n endingHeadTags: '',\n bodyClasses: '',\n bodyAttrs: 'data-server-rendered',\n bodyTags: '',\n endingBodyTags: '',\n baseUrl: this.sys.util.getAbsoluteUrlFromPagePath(undefined, false, true) // not include publicPath\n });\n ssrContext.state = ssrContext.state || {};\n ssrContext.stateDefer = ssrContext.stateDefer || {};\n }\n\n /**\n * Registers a callback that runs after initial client SSR hydration completes.\n * It does not run for SPA startup or later client navigation.\n */\n onHydrated(fn) {\n this[SymbolOnHydrateds].push(fn);\n }\n onHydratePropHasMismatch(fn) {\n this[SymbolOnHydratePropHasMismatches].push(fn);\n }\n handleDirectOrOnHydrated(fn) {\n if (!process.env.CLIENT) return;\n if (this.isRuntimeSsrPreHydration) {\n this.onHydrated(fn);\n } else {\n return fn();\n }\n }\n _onHydratePropHasMismatchDefault(el, key, clientValue, _vnode, _instance) {\n // expected\n let ignore = false;\n let expected;\n if (key === 'class') {\n ignore = true;\n if (clientValue !== undefined) {\n expected = normalizeClass(clientValue);\n el.setAttribute(key, expected);\n }\n } else if (key === 'style') {\n ignore = true;\n if (clientValue !== undefined) {\n expected = isString(clientValue) ? clientValue : stringifyStyle(normalizeStyle(clientValue));\n el.setAttribute(key, expected);\n }\n } else if (['id', 'name', 'for', 'd', 'aria-labelledby', 'aria-controls'].includes(key)) {\n ignore = true;\n if (clientValue !== undefined) {\n expected = String(clientValue);\n el.setAttribute(key, expected);\n }\n } else if (key === 'value') {\n ignore = true;\n if (clientValue !== undefined) {\n expected = String(clientValue);\n if (el.tagName === 'TEXTAREA') {\n el.value = expected;\n } else {\n el.setAttribute(key, expected);\n }\n }\n } else if (isBooleanAttr(key)) {\n ignore = true;\n if (clientValue !== undefined) {\n const expected = includeBooleanAttr(clientValue);\n if (expected) {\n el.setAttribute(key, '');\n } else {\n el.removeAttribute(key);\n }\n }\n } else if (el.getAttribute(`data-hydrate-ignore-${key}`) !== null) {\n ignore = true;\n if (clientValue !== undefined) {\n expected = String(clientValue);\n el.setAttribute(key, expected);\n }\n }\n if (!ignore) return {\n clientValue\n };\n return {\n ignore: true\n };\n }\n _hydrated() {\n if (!this.isRuntimeSsrPreHydration) return;\n // should be first\n this.isRuntimeSsrPreHydration = false;\n //\n this[SymbolInstanceUpdates].forEach(instance => {\n if (!instance.isUnmounted && instance.zova) {\n try {\n instance.update();\n } catch (err) {\n if (!err.message.includes(\"'insertBefore'\")) {\n throw err;\n }\n }\n }\n });\n this[SymbolInstanceUpdates] = [];\n //\n this[SymbolOnHydrateds].forEach(fn => fn());\n this[SymbolOnHydrateds] = [];\n //\n this[SymbolOnHydratePropHasMismatches] = [];\n }\n\n /** @internal */\n _hydratePropHasMismatch(el, key, clientValue, vnode, instance) {\n for (const fn of this[SymbolOnHydratePropHasMismatches]) {\n const res = fn(el, key, clientValue, vnode, instance);\n if (res.ignore) return res;\n clientValue = res.clientValue;\n }\n return {\n ignore: false,\n clientValue\n };\n }\n\n /** @internal */\n _hydratingRootInc() {\n if (process.env.CLIENT && this.isRuntimeSsrPreHydration) {\n this._hydratingInc();\n }\n }\n\n /** @internal */\n _hydratingRootDec() {\n if (process.env.CLIENT && this.isRuntimeSsrPreHydration) {\n this._hydratingDec();\n }\n }\n\n /** @internal */\n _hydratingInc() {\n ++this[SymbolHydratingCounter];\n }\n\n /** @internal */\n _hydratingDec() {\n if (--this[SymbolHydratingCounter] === 0) {\n this._hydrated();\n }\n }\n\n /** @internal */\n _hydratingInstanceRecord(instance) {\n if (!this[SymbolInstanceUpdates].includes(instance)) {\n this[SymbolInstanceUpdates].push(instance);\n return true;\n }\n return false;\n }\n\n /** @internal */\n _registerServerContext(currentContext) {\n this._serverContextRegister(currentContext);\n }\n\n /** @internal */\n _disposeServerContexts() {\n this._serverContextsDispose();\n }\n}\nfunction _createControllerLoadErrorSnapshot(event) {\n const error = event.error;\n const snapshot = {\n version: 1,\n controllerBeanName: event.controllerBeanName,\n name: error.name || 'Error',\n message: error.message || String(error),\n controllerRecorded: event.controllerRecorded === true\n };\n for (const key of ['code', 'status']) {\n if (typeof error[key] === 'number' || typeof error[key] === 'string') {\n snapshot[key] = error[key];\n }\n }\n for (const key of ['pagePath', 'url']) {\n if (typeof error[key] === 'string') {\n snapshot[key] = error[key];\n }\n }\n return snapshot;\n}\nfunction _createControllerLoadError(snapshot) {\n const error = new Error(snapshot.message);\n error.name = snapshot.name;\n for (const key of ['code', 'status', 'pagePath', 'url']) {\n if (snapshot[key] !== undefined) {\n error[key] = snapshot[key];\n }\n }\n return error;\n}","import { BeanSimple } from 'zova';\nimport { CtxSSR } from './lib/ssr.ts';\nexport class MonkeySys extends BeanSimple {\n constructor(moduleSelf) {\n super();\n this._moduleSelf = void 0;\n this._sysSsrState = void 0;\n this._moduleSelf = moduleSelf;\n }\n async getSysSsrState() {\n if (!this._sysSsrState) {\n this._sysSsrState = await this.bean._getBean('a-ssr.sys.ssrState', false);\n }\n return this._sysSsrState;\n }\n async moduleLoading(module) {\n if (this._moduleSelf === module) return;\n await this.getSysSsrState();\n }\n async moduleLoaded(_module) {}\n async configLoaded(_module, _config) {}\n sysContextInitialize(ctx) {\n ctx.meta.$ssr = ctx.bean._newBeanSimple(CtxSSR, false);\n ctx.meta.$ssr.initialize();\n }\n}","var _dec, _dec2, _class;\nimport { \"BeanInfo\" as __z_BeanInfo } from \"zova\";\n// eslint-disable\n/** sys: begin */\nexport * from '../bean/sys.ssrState.ts';\nimport 'zova';\n/** sys: end */\n/** sys: begin */\n\nimport 'zova';\n/** sys: end */\n/** config: begin */\nexport * from '../config/config.ts';\n/** config: end */\n/** monkey: begin */\nexport * from '../monkey.ts';\n/** monkey: end */\n/** monkeySys: begin */\nexport * from '../monkeySys.ts';\n/** monkeySys: end */\n/** scope: begin */\nimport { BeanScopeBase } from 'zova';\nimport { Scope } from 'zova-module-a-bean';\nexport let ScopeModuleASsr = (_dec = Scope(), _dec2 = __z_BeanInfo({\n module: \"a-ssr\"\n}), _dec(_class = _dec2(_class = class ScopeModuleASsr extends BeanScopeBase {}) || _class) || _class);\nimport 'zova';\n\n/** scope: end */","export function getBodyReadyObserverScript() {\n return `<script id=\"ssr-body-ready-observer\">\n window.ssr_bodyReadyObserverClear=()=>{\n window.ssr_body_ready_condition=undefined;\n window.ssr_body_ready_callback=undefined;\n window.ssr_bodyReadyObserver?.disconnect();\n window.ssr_bodyReadyObserver=undefined;\n document.body.style.display='block';\n document.querySelector('#ssr-body-ready-observer')?.remove();\n };\n window.ssr_bodyReadyObserver = new MutationObserver(() => {\n const __targets=window.ssr_body_ready_condition?.();\n if(__targets){\n try{\n window.ssr_body_ready_callback?.(__targets);\n }finally{\n window.ssr_bodyReadyObserverClear();\n }\n }\n });\n window.ssr_bodyReadyObserver.observe(document.body, {\n subtree: true,\n childList: true,\n });\n document.addEventListener(\"DOMContentLoaded\", () => {\n window.ssr_bodyReadyObserverClear();\n });\n </script>`.replaceAll('\\\\n', '');\n}"],"mappings":";;;;;;;;;;AAAA,IAAIA;AAAMC,IAAAA;AAAOC,IAAAA;AAIjB,IAAMC,mBAAiB,OAAO,gBAAgB;AAC9C,IAAM,sBAAsB,OAAO,qBAAqB;AACxD,IAAW,eAAe,SAAO,IAAI,GAAG,UAAQC,SAAa,EAC3D,QAAQ,QACV,CAAC,GAAGJ,OAAK,WAASC,QAAM,WAAS,MAAM,oBAAoB,SAAS;CAClE,YAAY,GAAG,MAAM;EACnB,MAAM,GAAG,IAAI;EACb,KAAKE,oBAAkB,KAAK;EAC5B,KAAK,uBAAuB,KAAK;CACnC;CACA,MAAM,WAAW;EACf,IAAI,QAAQ,IAAI,QAAQ;GACtB,IAAI,KAAK,MAAM,CAAC,CAAC,mBAAmB;IAClC,KAAKA,oBAAkB,KAAK,MAAM,CAAC,CAAC;IACpC,OAAO,KAAK,MAAM,CAAC,CAAC;IACpB,SAAS,eAAe,gBAAgB,CAAC,EAAE,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,SAAgB,6BAA6B;CAC3C,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;kBA0BQ,WAAW,OAAO,EAAE;AACrC"}
@@ -1,6 +1,6 @@
1
- export * from './ssr.js';
2
- export * from './ssrMetaStore.js';
3
- export * from './bodyReadyObserver.js';
4
- export * from './ssrProfile.js';
5
- export * from './utils.js';
1
+ export * from './ssr.ts';
2
+ export * from './ssrMetaStore.ts';
3
+ export * from './bodyReadyObserver.ts';
4
+ export * from './ssrProfile.ts';
5
+ export * from './utils.ts';
6
6
  //# sourceMappingURL=index.d.ts.map
package/dist/lib/ssr.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import type { Functionable } from 'zova';
2
2
  import { BeanSimple } from 'zova';
3
- import type { ISsrProfileOptions, OnHydratePropHasMismatch, SSRContext, TypeSsrProfile, TypeSsrSitePerformAction } from '../types/ssr.js';
4
- import { CtxSSRMetaStore } from './ssrMetaStore.js';
3
+ import type { ISsrProfileOptions, OnHydratePropHasMismatch, SSRContext, TypeSsrProfile, TypeSsrSitePerformAction } from '../types/ssr.ts';
4
+ import { CtxSSRMetaStore } from './ssrMetaStore.ts';
5
5
  declare const SymbolIsRuntimeSsrPreHydration: unique symbol;
6
6
  declare const SymbolSSRContext: unique symbol;
7
7
  declare const SymbolSSRState: unique symbol;
@@ -1 +1 @@
1
- {"version":3,"file":"ssr.d.ts","sourceRoot":"","sources":["../../src/lib/ssr.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAoD,MAAM,MAAM,CAAC;AAM3F,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAGlC,OAAO,KAAK,EACV,kBAAkB,EAElB,wBAAwB,EAExB,UAAU,EAEV,cAAc,EACd,wBAAwB,EACzB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAGpD,QAAA,MAAM,8BAA8B,eAA2C,CAAC;AAChF,QAAA,MAAM,gBAAgB,eA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C,sBAAsB,CAAC,CAAa;IAC7C,OAAO,CAAC,CAAC,oBAAoB,CAAC,CAA+B;IAC7D,OAAO,CAAC,uBAAuB,CAA8B;IAEtD,SAAS,EAAE,eAAe,CAAC;IAgClC,OAAO,CAAC,sBAAsB;IAQ9B,OAAO,CAAC,sBAAsB;IAY9B,IAAI,wBAAwB,YAE3B;IAED,IAAI,oBAAoB,YAEvB;IAED,IAAI,wBAAwB,CAAC,KAAK,SAAA,EAEjC;IAED,IAAI,OAAO,eASV;IAED,IAAI,KAAK,gDAMR;IAED,IAAI,UAAU,qDAMb;IA+BD,OAAO,CAAC,0BAA0B;IAkBlC,IAAI,OAAO,IAAI,cAAc,CAE5B;IAED,IAAI,cAAc,IAAI,QAAQ,CAAC,kBAAkB,CAAC,CAIjD;IAkCD,IAAI,sBAAsB,IAAI,OAAO,CAEpC;IAED,IAAI,cAAc,IAIM,GAAG,CAF1B;IAED,IAAI,cAAc,CAAC,GAAG,EAAE,GAAG,EAE1B;IAED,gBAAgB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,wBAAwB,GAAG,SAAS;IAMxE,OAAO,CAAC,YAAY;IAgBpB;;;OAGG;IACH,UAAU,CAAC,EAAE,EAAE,YAAY;IAI3B,wBAAwB,CAAC,EAAE,EAAE,wBAAwB;IAIrD,wBAAwB,CAAC,EAAE,EAAE,YAAY;IASzC,OAAO,CAAC,gCAAgC;IA6DxC,OAAO,CAAC,SAAS;CAoFlB"}
@@ -1,5 +1,5 @@
1
1
  import { BeanSimple } from 'zova';
2
- import type { SSRMetaOptionsWrapper } from '../types/ssr.js';
2
+ import type { SSRMetaOptionsWrapper } from '../types/ssr.ts';
3
3
  export declare class CtxSSRMetaStore extends BeanSimple {
4
4
  private _updateId;
5
5
  private _currentClientMeta?;
@@ -1,4 +1,7 @@
1
1
  import type { RouteLocationNormalizedGeneric, RouteLocationResolvedGeneric } from '@cabloy/vue-router';
2
+ export declare function getCanonicalLocaleRoutePath(route: TypeSsrNavigationRoute, locale: {
3
+ normalize(value: unknown): string;
4
+ }, defaultLocale: string): string | undefined;
2
5
  export type TypeSsrNavigationRoute = RouteLocationNormalizedGeneric | RouteLocationResolvedGeneric;
3
6
  export interface ISsrNavigationSync {
4
7
  beforeEach(to: TypeSsrNavigationRoute): void;
@@ -1 +1 @@
1
- {"version":3,"file":"ssrNavigation.d.ts","sourceRoot":"","sources":["../../src/lib/ssrNavigation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,8BAA8B,EAC9B,4BAA4B,EAC7B,MAAM,oBAAoB,CAAC;AAE5B,MAAM,MAAM,sBAAsB,GAAG,8BAA8B,GAAG,4BAA4B,CAAC;AAEnG,MAAM,WAAW,kBAAkB;IACjC,UAAU,CAAC,EAAE,EAAE,sBAAsB,GAAG,IAAI,CAAC;IAC7C,SAAS,CAAC,EAAE,EAAE,sBAAsB,EAAE,IAAI,EAAE,sBAAsB,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;CAC7F;AAED,MAAM,WAAW,yBAAyB,CAAC,CAAC;IAC1C,SAAS,IAAI,CAAC,CAAC;IACf,SAAS,CAAC,MAAM,EAAE,CAAC,GAAG,IAAI,CAAC;IAC3B,UAAU,CAAC,KAAK,EAAE,sBAAsB,GAAG,IAAI,CAAC;IAChD,cAAc,CAAC,KAAK,EAAE,sBAAsB,GAAG,IAAI,CAAC;CACrD;AAED,wBAAgB,uBAAuB,CAAC,CAAC,EACvC,OAAO,EAAE,yBAAyB,CAAC,CAAC,CAAC,GACpC,kBAAkB,CAkBpB"}
1
+ {"version":3,"file":"ssrNavigation.d.ts","sourceRoot":"","sources":["../../src/lib/ssrNavigation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,8BAA8B,EAC9B,4BAA4B,EAC7B,MAAM,oBAAoB,CAAC;AAK5B,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,sBAAsB,EAC7B,MAAM,EAAE;IAAE,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAAA;CAAE,EAC7C,aAAa,EAAE,MAAM,GACpB,MAAM,GAAG,SAAS,CAepB;AAED,MAAM,MAAM,sBAAsB,GAAG,8BAA8B,GAAG,4BAA4B,CAAC;AAEnG,MAAM,WAAW,kBAAkB;IACjC,UAAU,CAAC,EAAE,EAAE,sBAAsB,GAAG,IAAI,CAAC;IAC7C,SAAS,CAAC,EAAE,EAAE,sBAAsB,EAAE,IAAI,EAAE,sBAAsB,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;CAC7F;AAED,MAAM,WAAW,yBAAyB,CAAC,CAAC;IAC1C,SAAS,IAAI,CAAC,CAAC;IACf,SAAS,CAAC,MAAM,EAAE,CAAC,GAAG,IAAI,CAAC;IAC3B,UAAU,CAAC,KAAK,EAAE,sBAAsB,GAAG,IAAI,CAAC;IAChD,cAAc,CAAC,KAAK,EAAE,sBAAsB,GAAG,IAAI,CAAC;CACrD;AAED,wBAAgB,uBAAuB,CAAC,CAAC,EACvC,OAAO,EAAE,yBAAyB,CAAC,CAAC,CAAC,GACpC,kBAAkB,CAkBpB"}
@@ -1,5 +1,5 @@
1
1
  import type { ZovaConfigSsrProfile } from 'zova';
2
- import type { ISsrProfileOptions, ISsrRouteProfileOptions, TypeSsrProfile } from '../types/ssr.js';
2
+ import type { ISsrProfileOptions, ISsrRouteProfileOptions, TypeSsrProfile } from '../types/ssr.ts';
3
3
  export declare function resolveSsrProfile(routeProfile: TypeSsrProfile | undefined, defaultProfile: string | undefined): TypeSsrProfile;
4
4
  export declare function resolveSsrProfileOptions(ssrProfile: TypeSsrProfile, profiles: Readonly<Record<TypeSsrProfile, ZovaConfigSsrProfile>>, routeProfileOptions?: Readonly<ISsrRouteProfileOptions>, metaLocale?: boolean): Readonly<ISsrProfileOptions>;
5
5
  //# sourceMappingURL=ssrProfile.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"monkey.d.ts","sourceRoot":"","sources":["../src/monkey.ts"],"names":[],"mappings":"AAAA,OAAO,KA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C,IAAI,EAAE,aAAa,EAAE,YAAY,EAAE,QAAQ;IA0B1D,OAAO,CAAC,gBAAgB;IAoBxB,OAAO,CAAC,0BAA0B;CAkBnC"}
@@ -1,7 +1,7 @@
1
1
  import type { IModule } from '@cabloy/module-info';
2
2
  import type { IMonkeyModuleSys, IMonkeySysContextInitialize, ZovaContext } from 'zova';
3
3
  import { BeanSimple } from 'zova';
4
- import type { SysSsrState } from './bean/sys.ssrState.js';
4
+ import type { SysSsrState } from './bean/sys.ssrState.ts';
5
5
  export declare class MonkeySys extends BeanSimple implements IMonkeyModuleSys, IMonkeySysContextInitialize {
6
6
  private _moduleSelf;
7
7
  private _sysSsrState;
@@ -1,5 +1,5 @@
1
1
  import '@cabloy/vue-router';
2
- import type { ISsrRouteProfileOptions, TypeSsrProfile } from './ssr.js';
2
+ import type { ISsrRouteProfileOptions, TypeSsrProfile } from './ssr.ts';
3
3
  export interface ISsrConfig {
4
4
  cookieThemeDarkDefault: boolean;
5
5
  }
@@ -1,3 +1,3 @@
1
- export * from './config.js';
2
- export * from './ssr.js';
1
+ export * from './config.ts';
2
+ export * from './ssr.ts';
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1,6 +1,6 @@
1
1
  import type { ComponentInternalInstance, VNode } from 'vue';
2
2
  import type { ZovaConfigEnv, ZovaConfigSsrProfile, ZovaConfigSsrResponseCachePolicy } from 'zova';
3
- import type { CtxSSR } from '../lib/ssr.js';
3
+ import type { CtxSSR } from '../lib/ssr.ts';
4
4
  import 'zova';
5
5
  export interface ErrorSSR extends Error {
6
6
  pagePath?: string;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "zova-module-a-ssr",
3
- "version": "5.1.40",
4
- "gitHead": "b88abae0ef9cbe59388093d012c1193d5fa14175",
3
+ "version": "5.1.42",
4
+ "gitHead": "124137dd279fa4cc3f77075d81887c0cad670876",
5
5
  "description": "",
6
6
  "keywords": [
7
7
  "Zova Module"
@@ -1,6 +1,6 @@
1
1
  // eslint-disable
2
2
  /** sys: begin */
3
- export * from '../bean/sys.ssrState.js';
3
+ export * from '../bean/sys.ssrState.ts';
4
4
 
5
5
  import 'zova';
6
6
  declare module 'zova' {
@@ -22,7 +22,7 @@ declare module 'zova-module-a-ssr' {
22
22
  }
23
23
  /** sys: end */
24
24
  /** sys: begin */
25
- import { SysSsrState } from '../bean/sys.ssrState.js';
25
+ import type { SysSsrState } from '../bean/sys.ssrState.ts';
26
26
  import 'zova';
27
27
  declare module 'zova' {
28
28
  export interface IBeanRecordGeneral {
@@ -31,14 +31,14 @@ declare module 'zova' {
31
31
  }
32
32
  /** sys: end */
33
33
  /** config: begin */
34
- export * from '../config/config.js';
35
- import { config } from '../config/config.js';
34
+ export * from '../config/config.ts';
35
+ import { config } from '../config/config.ts';
36
36
  /** config: end */
37
37
  /** monkey: begin */
38
- export * from '../monkey.js';
38
+ export * from '../monkey.ts';
39
39
  /** monkey: end */
40
40
  /** monkeySys: begin */
41
- export * from '../monkeySys.js';
41
+ export * from '../monkeySys.ts';
42
42
  /** monkeySys: end */
43
43
  /** scope: begin */
44
44
  import { BeanScopeBase, type BeanScopeUtil, TypeModuleConfig } from 'zova';
@@ -1,2 +1,2 @@
1
1
  export const __ThisModule__ = 'a-ssr';
2
- export { ScopeModuleASsr as ScopeModule } from './index.js';
2
+ export { ScopeModuleASsr as ScopeModule } from './index.ts';
@@ -1,7 +1,7 @@
1
1
  import { BeanBase, cast } from 'zova';
2
2
  import { Sys } from 'zova-module-a-bean';
3
3
 
4
- import { SSRContextState, SSRContextStateDefer } from '../types/ssr.js';
4
+ import { SSRContextState, SSRContextStateDefer } from '../types/ssr.ts';
5
5
 
6
6
  const SymbolSSRState = Symbol('SymbolSSRState');
7
7
  const SymbolSSRStateDefer = Symbol('SymbolSSRStateDefer');
@@ -1,6 +1,6 @@
1
1
  import type { ZovaSys } from 'zova';
2
2
 
3
- import type { ISsrConfig } from '../types/config.js';
3
+ import type { ISsrConfig } from '../types/config.ts';
4
4
 
5
5
  export const config = (sys: ZovaSys) => {
6
6
  const ssrConfig: ISsrConfig = {
package/src/index.ts CHANGED
@@ -1,3 +1,3 @@
1
- export * from './.metadata/index.js';
2
- export * from './lib/index.js';
3
- export * from './types/index.js';
1
+ export * from './.metadata/index.ts';
2
+ export * from './lib/index.ts';
3
+ export * from './types/index.ts';
package/src/lib/index.ts CHANGED
@@ -1,5 +1,5 @@
1
- export * from './ssr.js';
2
- export * from './ssrMetaStore.js';
3
- export * from './bodyReadyObserver.js';
4
- export * from './ssrProfile.js';
5
- export * from './utils.js';
1
+ export * from './ssr.ts';
2
+ export * from './ssrMetaStore.ts';
3
+ export * from './bodyReadyObserver.ts';
4
+ export * from './ssrProfile.ts';
5
+ export * from './utils.ts';
package/src/lib/ssr.ts CHANGED
@@ -1,13 +1,16 @@
1
+ import type {
2
+ RouteLocationNormalizedGeneric,
3
+ RouteLocationResolvedGeneric,
4
+ } from '@cabloy/vue-router';
1
5
  import type { ComponentInternalInstance, Ref, VNode } from 'vue';
2
6
  import type { Functionable, IControllerLoadEvent, ILocaleRecord, ZovaContext } from 'zova';
3
7
 
4
- import { RouteLocationNormalizedGeneric, RouteLocationResolvedGeneric } from '@cabloy/vue-router';
5
8
  import { includeBooleanAttr, isBooleanAttr, isString, stringifyStyle } from '@vue/shared';
6
9
  import { defu } from 'defu';
7
10
  import { normalizeClass, normalizeStyle, ref, useSSRContext } from 'vue';
8
11
  import { BeanSimple } from 'zova';
9
12
 
10
- import type { SysSsrState } from '../bean/sys.ssrState.js';
13
+ import type { SysSsrState } from '../bean/sys.ssrState.ts';
11
14
  import type {
12
15
  ISsrProfileOptions,
13
16
  ISsrRouteProfileOptions,
@@ -17,10 +20,11 @@ import type {
17
20
  SSRControllerLoadErrorSnapshot,
18
21
  TypeSsrProfile,
19
22
  TypeSsrSitePerformAction,
20
- } from '../types/ssr.js';
23
+ } from '../types/ssr.ts';
21
24
 
22
- import { CtxSSRMetaStore } from './ssrMetaStore.js';
23
- import { resolveSsrProfile, resolveSsrProfileOptions } from './ssrProfile.js';
25
+ import { CtxSSRMetaStore } from './ssrMetaStore.ts';
26
+ import { getCanonicalLocaleRoutePath } from './ssrNavigation.ts';
27
+ import { resolveSsrProfile, resolveSsrProfileOptions } from './ssrProfile.ts';
24
28
 
25
29
  const SymbolIsRuntimeSsrPreHydration = Symbol('SymbolIsRuntimeSsrPreHydration');
26
30
  const SymbolSSRContext = Symbol('SymbolSSRContext');
@@ -212,6 +216,14 @@ export class CtxSSR extends BeanSimple {
212
216
  public _setLocale(route: RouteLocationResolvedGeneric | RouteLocationNormalizedGeneric) {
213
217
  if (route.meta.locale) {
214
218
  this.app.meta.locale.current = route.params?.locale as unknown as keyof ILocaleRecord;
219
+ if (process.env.SERVER) {
220
+ const canonicalPath = getCanonicalLocaleRoutePath(
221
+ route,
222
+ this.app.meta.locale,
223
+ this.sys.config.locale.default,
224
+ );
225
+ if (canonicalPath) this.app.$redirect(canonicalPath);
226
+ }
215
227
  }
216
228
  }
217
229
 
@@ -2,9 +2,9 @@
2
2
  import { extend } from '@cabloy/extend';
3
3
  import { BeanSimple, cast } from 'zova';
4
4
 
5
- import type { SSRContext, SSRMetaOptions, SSRMetaOptionsWrapper } from '../types/ssr.js';
5
+ import type { SSRContext, SSRMetaOptions, SSRMetaOptionsWrapper } from '../types/ssr.ts';
6
6
 
7
- import { unevalPatch } from './utils.js';
7
+ import { unevalPatch } from './utils.ts';
8
8
 
9
9
  export class CtxSSRMetaStore extends BeanSimple {
10
10
  private _updateId: number = 0;
@@ -3,6 +3,30 @@ import type {
3
3
  RouteLocationResolvedGeneric,
4
4
  } from '@cabloy/vue-router';
5
5
 
6
+ import { combineParamsAndQuery } from '@cabloy/utils';
7
+
8
+ // Keep the matched route/alias and existing optional-default URL policy. No new identity.
9
+ export function getCanonicalLocaleRoutePath(
10
+ route: TypeSsrNavigationRoute,
11
+ locale: { normalize(value: unknown): string },
12
+ defaultLocale: string,
13
+ ): string | undefined {
14
+ if (!route.meta.locale) return;
15
+ const value = locale.normalize(route.params?.locale);
16
+ const canonical = value === defaultLocale ? '' : value;
17
+ if ((route.params?.locale ?? '') === canonical) return;
18
+ // A synthetic layout parent may retain its original path while its child matches
19
+ // the public alias. The deepest matching record owns the actual destination URL.
20
+ const matched = route.matched.findLast(record => record.path.includes(':locale'));
21
+ if (!matched) return;
22
+ const path =
23
+ combineParamsAndQuery(matched.path, {
24
+ params: { ...route.params, locale: canonical || undefined },
25
+ query: route.query,
26
+ }) + (route.hash ?? '');
27
+ return path !== route.fullPath ? path : undefined;
28
+ }
29
+
6
30
  export type TypeSsrNavigationRoute = RouteLocationNormalizedGeneric | RouteLocationResolvedGeneric;
7
31
 
8
32
  export interface ISsrNavigationSync {
@@ -5,7 +5,7 @@ import type {
5
5
  ISsrResponseCachePolicy,
6
6
  ISsrRouteProfileOptions,
7
7
  TypeSsrProfile,
8
- } from '../types/ssr.js';
8
+ } from '../types/ssr.ts';
9
9
 
10
10
  export function resolveSsrProfile(
11
11
  routeProfile: TypeSsrProfile | undefined,
@@ -3,7 +3,7 @@ import type { ZovaContext } from 'zova';
3
3
  // from: quasar/ui/src/composables/use-meta.js
4
4
  import { computed, onActivated, onDeactivated, onUnmounted, watch } from 'vue';
5
5
 
6
- import type { SSRMetaOptions, SSRMetaOptionsWrapper } from '../types/ssr.js';
6
+ import type { SSRMetaOptions, SSRMetaOptionsWrapper } from '../types/ssr.ts';
7
7
 
8
8
  export function useMeta(ctx: ZovaContext, metaOptions) {
9
9
  if (process.env.SERVER) {
package/src/monkey.ts CHANGED
@@ -13,10 +13,10 @@ import type {
13
13
  import { isNavigationFailure } from '@cabloy/vue-router';
14
14
  import { BeanSimple, cast } from 'zova';
15
15
 
16
- import type { SSRMetaOptions } from './types/ssr.js';
16
+ import type { SSRMetaOptions } from './types/ssr.ts';
17
17
 
18
- import { createSsrNavigationSync } from './lib/ssrNavigation.js';
19
- import { useMeta } from './lib/useMeta.js';
18
+ import { createSsrNavigationSync, getCanonicalLocaleRoutePath } from './lib/ssrNavigation.ts';
19
+ import { useMeta } from './lib/useMeta.ts';
20
20
 
21
21
  export class Monkey
22
22
  extends BeanSimple
@@ -60,6 +60,13 @@ export class Monkey
60
60
  },
61
61
  });
62
62
  router.beforeEach(to => {
63
+ const canonicalPath = getCanonicalLocaleRoutePath(
64
+ to,
65
+ this.app.meta.locale,
66
+ this.sys.config.locale.default,
67
+ );
68
+ if (canonicalPath)
69
+ return { path: canonicalPath, query: to.query, hash: to.hash, replace: true };
63
70
  navigationSync.beforeEach(to);
64
71
  });
65
72
  router.afterEach((to, from, failure) => {
package/src/monkeySys.ts CHANGED
@@ -3,9 +3,9 @@ import type { IMonkeyModuleSys, IMonkeySysContextInitialize, ZovaContext } from
3
3
 
4
4
  import { BeanSimple } from 'zova';
5
5
 
6
- import type { SysSsrState } from './bean/sys.ssrState.js';
6
+ import type { SysSsrState } from './bean/sys.ssrState.ts';
7
7
 
8
- import { CtxSSR } from './lib/ssr.js';
8
+ import { CtxSSR } from './lib/ssr.ts';
9
9
 
10
10
  export class MonkeySys extends BeanSimple implements IMonkeyModuleSys, IMonkeySysContextInitialize {
11
11
  private _moduleSelf: IModule;
@@ -1,5 +1,5 @@
1
1
  import '@cabloy/vue-router';
2
- import type { ISsrRouteProfileOptions, TypeSsrProfile } from './ssr.js';
2
+ import type { ISsrRouteProfileOptions, TypeSsrProfile } from './ssr.ts';
3
3
 
4
4
  export interface ISsrConfig {
5
5
  cookieThemeDarkDefault: boolean;
@@ -1,2 +1,2 @@
1
- export * from './config.js';
2
- export * from './ssr.js';
1
+ export * from './config.ts';
2
+ export * from './ssr.ts';
package/src/types/ssr.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import type { ComponentInternalInstance, VNode } from 'vue';
2
2
  import type { ZovaConfigEnv, ZovaConfigSsrProfile, ZovaConfigSsrResponseCachePolicy } from 'zova';
3
3
 
4
- import type { CtxSSR } from '../lib/ssr.js';
4
+ import type { CtxSSR } from '../lib/ssr.ts';
5
5
  import 'zova';
6
6
 
7
7
  export interface ErrorSSR extends Error {