cabloy 5.1.52 → 5.1.53
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/skills/cabloy-frontend-scaffold/SKILL.md +10 -0
- package/CHANGELOG.md +17 -0
- package/CLAUDE.md +3 -0
- package/cabloy-docs/.vitepress/config.mjs +144 -50
- package/cabloy-docs/ai/introduction.md +44 -0
- package/cabloy-docs/backend/quickstart.md +1 -1
- package/cabloy-docs/editions/cabloy-start.md +3 -3
- package/cabloy-docs/editions/choosing-between-basic-and-start.md +5 -5
- package/cabloy-docs/editions/overview.md +34 -3
- package/cabloy-docs/frontend/css-in-js-guide.md +1 -1
- package/cabloy-docs/frontend/environment-config-guide.md +28 -0
- package/cabloy-docs/frontend/foundation.md +1 -1
- package/cabloy-docs/frontend/introduction.md +69 -1
- package/cabloy-docs/frontend/navigation-guards-guide.md +1 -1
- package/cabloy-docs/frontend/quickstart.md +1 -0
- package/cabloy-docs/frontend/scripts.md +1 -1
- package/cabloy-docs/frontend/ssr-env.md +23 -0
- package/cabloy-docs/frontend/theme-guide.md +140 -7
- package/cabloy-docs/fullstack/cli.md +6 -6
- package/cabloy-docs/fullstack/edition-collaboration-differences.md +1 -1
- package/cabloy-docs/fullstack/introduction.md +39 -1
- package/cabloy-docs/fullstack/vona-zova-integration.md +1 -1
- package/cabloy-docs/index.md +1 -1
- package/cabloy-docs/reference/frontend-directory-structure.md +125 -0
- package/cabloy-docs/reference/introduction.md +47 -0
- package/cabloy-docs/reference/package-map.md +2 -0
- package/cabloy-docs/reference/repo-scripts.md +5 -3
- package/package.json +1 -1
- package/zova/package.original.json +1 -1
- package/zova/packages-cli/cli/package.json +2 -2
- package/zova/packages-cli/cli-set-front/package.json +2 -2
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.tools.metadata.ts +1 -1
- package/zova/packages-cli/cli-set-front/src/lib/bean/toolsMetadata/generateConfig.ts +2 -12
- package/zova/packages-utils/zova-jsx/package.json +2 -2
- package/zova/packages-utils/zova-vite/package.json +2 -2
- package/zova/packages-zova/zova/package.json +3 -3
- package/zova/packages-zova/zova-core/package.json +2 -2
- package/zova/packages-zova/zova-core/src/core/sys/config.ts +1 -1
- package/zova/pnpm-lock.yaml +270 -270
- package/zova/src/front/config/config/config.ts +1 -1
- package/zova/src/suite/a-demo/modules/demo-basic/src/.metadata/locales.ts +0 -15
- package/zova/src/suite/a-devui/modules/devui-adapter/src/bean/meta.themeHandler.ts +1 -0
- package/zova/src/suite/a-home/modules/home-base/src/.metadata/locales.ts +0 -15
- package/zova/src/suite/a-home/modules/home-base/src/service/routerGuards.ts +1 -1
- package/zova/src/suite/a-home/modules/home-base/src/service/ssrLayout.ts +1 -0
- package/zova/src/suite/a-home/modules/home-layoutadmin/src/.metadata/locales.ts +0 -15
- package/zova/src/suite/a-home/modules/home-layoutweb/src/.metadata/locales.ts +0 -15
- package/zova/src/suite/a-home/modules/home-layoutweb/src/component/layoutWeb/controller.tsx +2 -2
- package/zova/src/suite/a-home/modules/home-login/src/.metadata/locales.ts +0 -15
- package/zova/src/suite/a-home/modules/home-passport/src/model/passport.ts +2 -2
- package/zova/src/suite/cabloy-basic/modules/basic-captcha/src/.metadata/locales.ts +0 -15
- package/zova/src/suite/cabloy-basic/modules/basic-form/src/.metadata/locales.ts +0 -15
- package/zova/src/suite/cabloy-basic/modules/basic-page/src/.metadata/locales.ts +0 -15
- package/zova/src/suite/cabloy-basic/modules/basic-pageentry/src/.metadata/locales.ts +0 -15
- package/zova/src/suite/cabloy-basic/modules/basic-table/src/.metadata/locales.ts +0 -15
- package/zova/src/suite-vendor/a-zova/modules/a-interceptor/package.json +1 -1
- package/zova/src/suite-vendor/a-zova/modules/a-interceptor/src/bean/interceptor.jwt.ts +1 -1
- package/zova/src/suite-vendor/a-zova/modules/a-ssr/package.json +1 -1
- package/zova/src/suite-vendor/a-zova/modules/a-ssr/src/lib/ssrMetaStore.ts +1 -0
- package/zova/src/suite-vendor/a-zova/modules/a-style/package.json +1 -1
- package/zova/src/suite-vendor/a-zova/modules/a-style/src/bean/bean.theme.ts +6 -3
- package/zova/src/suite-vendor/a-zova/modules/a-zod/package.json +1 -1
- package/zova/src/suite-vendor/a-zova/modules/a-zod/src/.metadata/locales.ts +0 -15
- package/zova/src/suite-vendor/a-zova/modules/a-zova/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/package.json +6 -6
|
@@ -39,7 +39,7 @@ export default function (sys: ZovaSys) {
|
|
|
39
39
|
config.ssr = {
|
|
40
40
|
cookie: env.SSR_COOKIE === 'true',
|
|
41
41
|
withVona: env.SSR_WITH_VONA === 'true',
|
|
42
|
-
|
|
42
|
+
cookieDisabledOnServer: process.env.SERVER && env.SSR_COOKIE === 'false',
|
|
43
43
|
hmr: env.SSR_WITH_VONA === 'true' && env.META_MODE === 'development',
|
|
44
44
|
};
|
|
45
45
|
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import type { TypeLocaleBase } from 'zova';
|
|
2
|
-
|
|
3
|
-
import { useApp, useComputed } from 'zova';
|
|
4
|
-
|
|
5
1
|
import locale_en_us from '../config/locale/en-us.js';
|
|
6
2
|
import locale_zh_cn from '../config/locale/zh-cn.js';
|
|
7
3
|
|
|
@@ -9,14 +5,3 @@ export const locales = {
|
|
|
9
5
|
'en-us': locale_en_us,
|
|
10
6
|
'zh-cn': locale_zh_cn,
|
|
11
7
|
};
|
|
12
|
-
|
|
13
|
-
export function $useLocale<K extends keyof (typeof locales)[TypeLocaleBase]>(
|
|
14
|
-
key: K,
|
|
15
|
-
...args: any[]
|
|
16
|
-
) {
|
|
17
|
-
const app = useApp();
|
|
18
|
-
const str = `demo-basic::${key}`;
|
|
19
|
-
return useComputed(() => {
|
|
20
|
-
return app.meta.text(str, ...args);
|
|
21
|
-
});
|
|
22
|
-
}
|
|
@@ -26,6 +26,7 @@ export class MetaThemeHandler extends BeanBase implements IThemeHandler {
|
|
|
26
26
|
} else {
|
|
27
27
|
// server
|
|
28
28
|
if (!this.sys.config.ssr.cookie) {
|
|
29
|
+
// BeanTheme applies twice in SSR Web mode so both dark/light markers are available here.
|
|
29
30
|
this.$useMeta({ bodyAttr: { [`data-ssr-theme-dark-${dark}`]: themeName } });
|
|
30
31
|
} else {
|
|
31
32
|
this.$useMeta({
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import type { TypeLocaleBase } from 'zova';
|
|
2
|
-
|
|
3
|
-
import { useApp, useComputed } from 'zova';
|
|
4
|
-
|
|
5
1
|
import locale_en_us from '../config/locale/en-us.js';
|
|
6
2
|
import locale_zh_cn from '../config/locale/zh-cn.js';
|
|
7
3
|
|
|
@@ -9,14 +5,3 @@ export const locales = {
|
|
|
9
5
|
'en-us': locale_en_us,
|
|
10
6
|
'zh-cn': locale_zh_cn,
|
|
11
7
|
};
|
|
12
|
-
|
|
13
|
-
export function $useLocale<K extends keyof (typeof locales)[TypeLocaleBase]>(
|
|
14
|
-
key: K,
|
|
15
|
-
...args: any[]
|
|
16
|
-
) {
|
|
17
|
-
const app = useApp();
|
|
18
|
-
const str = `home-base::${key}`;
|
|
19
|
-
return useComputed(() => {
|
|
20
|
-
return app.meta.text(str, ...args);
|
|
21
|
-
});
|
|
22
|
-
}
|
|
@@ -15,7 +15,7 @@ export class ServiceRouterGuards extends BeanRouterGuardsBase {
|
|
|
15
15
|
protected onRouterGuards(router: BeanRouter) {
|
|
16
16
|
router.beforeEach(async to => {
|
|
17
17
|
if (
|
|
18
|
-
!this.sys.config.ssr.
|
|
18
|
+
!this.sys.config.ssr.cookieDisabledOnServer &&
|
|
19
19
|
to.meta.requiresAuth !== false &&
|
|
20
20
|
!this.$passport.isAuthenticated
|
|
21
21
|
) {
|
|
@@ -20,6 +20,7 @@ export class ServiceSsrLayout extends BeanBase {
|
|
|
20
20
|
this.ctx.meta.$ssr.context.onRendered((err?: Error) => {
|
|
21
21
|
if (err) return;
|
|
22
22
|
if (!this.sys.config.ssr.cookie) {
|
|
23
|
+
// Apply the final browser-selected theme from the SSR dual markers as early as possible.
|
|
23
24
|
this.ctx.meta.$ssr.context._meta.bodyTags += `<script id="__prefersColorSchemeDarkJS">
|
|
24
25
|
document.body.setAttribute('data-theme', window.ssr_themedark_data);
|
|
25
26
|
if(window.ssr_local_themename==='home-theme:orange'){
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import type { TypeLocaleBase } from 'zova';
|
|
2
|
-
|
|
3
|
-
import { useApp, useComputed } from 'zova';
|
|
4
|
-
|
|
5
1
|
import locale_en_us from '../config/locale/en-us.js';
|
|
6
2
|
import locale_zh_cn from '../config/locale/zh-cn.js';
|
|
7
3
|
|
|
@@ -9,14 +5,3 @@ export const locales = {
|
|
|
9
5
|
'en-us': locale_en_us,
|
|
10
6
|
'zh-cn': locale_zh_cn,
|
|
11
7
|
};
|
|
12
|
-
|
|
13
|
-
export function $useLocale<K extends keyof (typeof locales)[TypeLocaleBase]>(
|
|
14
|
-
key: K,
|
|
15
|
-
...args: any[]
|
|
16
|
-
) {
|
|
17
|
-
const app = useApp();
|
|
18
|
-
const str = `home-layoutadmin::${key}`;
|
|
19
|
-
return useComputed(() => {
|
|
20
|
-
return app.meta.text(str, ...args);
|
|
21
|
-
});
|
|
22
|
-
}
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import type { TypeLocaleBase } from 'zova';
|
|
2
|
-
|
|
3
|
-
import { useApp, useComputed } from 'zova';
|
|
4
|
-
|
|
5
1
|
import locale_en_us from '../config/locale/en-us.js';
|
|
6
2
|
import locale_zh_cn from '../config/locale/zh-cn.js';
|
|
7
3
|
|
|
@@ -9,14 +5,3 @@ export const locales = {
|
|
|
9
5
|
'en-us': locale_en_us,
|
|
10
6
|
'zh-cn': locale_zh_cn,
|
|
11
7
|
};
|
|
12
|
-
|
|
13
|
-
export function $useLocale<K extends keyof (typeof locales)[TypeLocaleBase]>(
|
|
14
|
-
key: K,
|
|
15
|
-
...args: any[]
|
|
16
|
-
) {
|
|
17
|
-
const app = useApp();
|
|
18
|
-
const str = `home-layoutweb::${key}`;
|
|
19
|
-
return useComputed(() => {
|
|
20
|
-
return app.meta.text(str, ...args);
|
|
21
|
-
});
|
|
22
|
-
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BeanControllerBase, Use,
|
|
1
|
+
import { BeanControllerBase, Use, UseScope } from 'zova';
|
|
2
2
|
import { Controller } from 'zova-module-a-bean';
|
|
3
3
|
import { $QueryAutoLoad } from 'zova-module-a-model';
|
|
4
4
|
import { ModelTabs, ModelTabsOptions, RouteTabInitial } from 'zova-module-a-routertabs';
|
|
@@ -37,7 +37,7 @@ export class ControllerLayoutWeb extends BeanControllerBase {
|
|
|
37
37
|
|
|
38
38
|
protected async __init__() {
|
|
39
39
|
// belowBreakpoint
|
|
40
|
-
this.belowBreakpoint =
|
|
40
|
+
this.belowBreakpoint = this.$computed(() => {
|
|
41
41
|
let width;
|
|
42
42
|
if (process.env.SERVER) {
|
|
43
43
|
width = 0;
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import type { TypeLocaleBase } from 'zova';
|
|
2
|
-
|
|
3
|
-
import { useApp, useComputed } from 'zova';
|
|
4
|
-
|
|
5
1
|
import locale_en_us from '../config/locale/en-us.js';
|
|
6
2
|
import locale_zh_cn from '../config/locale/zh-cn.js';
|
|
7
3
|
|
|
@@ -9,14 +5,3 @@ export const locales = {
|
|
|
9
5
|
'en-us': locale_en_us,
|
|
10
6
|
'zh-cn': locale_zh_cn,
|
|
11
7
|
};
|
|
12
|
-
|
|
13
|
-
export function $useLocale<K extends keyof (typeof locales)[TypeLocaleBase]>(
|
|
14
|
-
key: K,
|
|
15
|
-
...args: any[]
|
|
16
|
-
) {
|
|
17
|
-
const app = useApp();
|
|
18
|
-
const str = `home-login::${key}`;
|
|
19
|
-
return useComputed(() => {
|
|
20
|
-
return app.meta.text(str, ...args);
|
|
21
|
-
});
|
|
22
|
-
}
|
|
@@ -37,7 +37,7 @@ export class ModelPassport extends BeanModelBase {
|
|
|
37
37
|
: this.$useStateMem({ queryKey: ['passport'] });
|
|
38
38
|
this.jwt = this.$useStateLocal({ queryKey: ['jwt'] });
|
|
39
39
|
this.expireTime = this.$useStateLocal({ queryKey: ['expireTime'] });
|
|
40
|
-
this.accessToken = this.sys.config.ssr.
|
|
40
|
+
this.accessToken = this.sys.config.ssr.cookieDisabledOnServer
|
|
41
41
|
? undefined
|
|
42
42
|
: this.$useStateCookie({ queryKey: ['token'] });
|
|
43
43
|
if (process.env.CLIENT) {
|
|
@@ -153,7 +153,7 @@ export class ModelPassport extends BeanModelBase {
|
|
|
153
153
|
|
|
154
154
|
async ensurePassport() {
|
|
155
155
|
if (process.env.CLIENT) return this.passport;
|
|
156
|
-
if (!this.sys.config.ssr.
|
|
156
|
+
if (!this.sys.config.ssr.cookieDisabledOnServer && !this.isAuthenticated && this.accessToken) {
|
|
157
157
|
this.passport = await this.$api.homeUserPassport.current();
|
|
158
158
|
this._setLocaleTz();
|
|
159
159
|
}
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import type { TypeLocaleBase } from 'zova';
|
|
2
|
-
|
|
3
|
-
import { useApp, useComputed } from 'zova';
|
|
4
|
-
|
|
5
1
|
import locale_en_us from '../config/locale/en-us.js';
|
|
6
2
|
import locale_zh_cn from '../config/locale/zh-cn.js';
|
|
7
3
|
|
|
@@ -9,14 +5,3 @@ export const locales = {
|
|
|
9
5
|
'en-us': locale_en_us,
|
|
10
6
|
'zh-cn': locale_zh_cn,
|
|
11
7
|
};
|
|
12
|
-
|
|
13
|
-
export function $useLocale<K extends keyof (typeof locales)[TypeLocaleBase]>(
|
|
14
|
-
key: K,
|
|
15
|
-
...args: any[]
|
|
16
|
-
) {
|
|
17
|
-
const app = useApp();
|
|
18
|
-
const str = `basic-captcha::${key}`;
|
|
19
|
-
return useComputed(() => {
|
|
20
|
-
return app.meta.text(str, ...args);
|
|
21
|
-
});
|
|
22
|
-
}
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import type { TypeLocaleBase } from 'zova';
|
|
2
|
-
|
|
3
|
-
import { useApp, useComputed } from 'zova';
|
|
4
|
-
|
|
5
1
|
import locale_en_us from '../config/locale/en-us.js';
|
|
6
2
|
import locale_zh_cn from '../config/locale/zh-cn.js';
|
|
7
3
|
|
|
@@ -9,14 +5,3 @@ export const locales = {
|
|
|
9
5
|
'en-us': locale_en_us,
|
|
10
6
|
'zh-cn': locale_zh_cn,
|
|
11
7
|
};
|
|
12
|
-
|
|
13
|
-
export function $useLocale<K extends keyof (typeof locales)[TypeLocaleBase]>(
|
|
14
|
-
key: K,
|
|
15
|
-
...args: any[]
|
|
16
|
-
) {
|
|
17
|
-
const app = useApp();
|
|
18
|
-
const str = `basic-form::${key}`;
|
|
19
|
-
return useComputed(() => {
|
|
20
|
-
return app.meta.text(str, ...args);
|
|
21
|
-
});
|
|
22
|
-
}
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import type { TypeLocaleBase } from 'zova';
|
|
2
|
-
|
|
3
|
-
import { useApp, useComputed } from 'zova';
|
|
4
|
-
|
|
5
1
|
import locale_en_us from '../config/locale/en-us.js';
|
|
6
2
|
import locale_zh_cn from '../config/locale/zh-cn.js';
|
|
7
3
|
|
|
@@ -9,14 +5,3 @@ export const locales = {
|
|
|
9
5
|
'en-us': locale_en_us,
|
|
10
6
|
'zh-cn': locale_zh_cn,
|
|
11
7
|
};
|
|
12
|
-
|
|
13
|
-
export function $useLocale<K extends keyof (typeof locales)[TypeLocaleBase]>(
|
|
14
|
-
key: K,
|
|
15
|
-
...args: any[]
|
|
16
|
-
) {
|
|
17
|
-
const app = useApp();
|
|
18
|
-
const str = `basic-page::${key}`;
|
|
19
|
-
return useComputed(() => {
|
|
20
|
-
return app.meta.text(str, ...args);
|
|
21
|
-
});
|
|
22
|
-
}
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import type { TypeLocaleBase } from 'zova';
|
|
2
|
-
|
|
3
|
-
import { useApp, useComputed } from 'zova';
|
|
4
|
-
|
|
5
1
|
import locale_en_us from '../config/locale/en-us.js';
|
|
6
2
|
import locale_zh_cn from '../config/locale/zh-cn.js';
|
|
7
3
|
|
|
@@ -9,14 +5,3 @@ export const locales = {
|
|
|
9
5
|
'en-us': locale_en_us,
|
|
10
6
|
'zh-cn': locale_zh_cn,
|
|
11
7
|
};
|
|
12
|
-
|
|
13
|
-
export function $useLocale<K extends keyof (typeof locales)[TypeLocaleBase]>(
|
|
14
|
-
key: K,
|
|
15
|
-
...args: any[]
|
|
16
|
-
) {
|
|
17
|
-
const app = useApp();
|
|
18
|
-
const str = `basic-pageentry::${key}`;
|
|
19
|
-
return useComputed(() => {
|
|
20
|
-
return app.meta.text(str, ...args);
|
|
21
|
-
});
|
|
22
|
-
}
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import type { TypeLocaleBase } from 'zova';
|
|
2
|
-
|
|
3
|
-
import { useApp, useComputed } from 'zova';
|
|
4
|
-
|
|
5
1
|
import locale_en_us from '../config/locale/en-us.js';
|
|
6
2
|
import locale_zh_cn from '../config/locale/zh-cn.js';
|
|
7
3
|
|
|
@@ -9,14 +5,3 @@ export const locales = {
|
|
|
9
5
|
'en-us': locale_en_us,
|
|
10
6
|
'zh-cn': locale_zh_cn,
|
|
11
7
|
};
|
|
12
|
-
|
|
13
|
-
export function $useLocale<K extends keyof (typeof locales)[TypeLocaleBase]>(
|
|
14
|
-
key: K,
|
|
15
|
-
...args: any[]
|
|
16
|
-
) {
|
|
17
|
-
const app = useApp();
|
|
18
|
-
const str = `basic-table::${key}`;
|
|
19
|
-
return useComputed(() => {
|
|
20
|
-
return app.meta.text(str, ...args);
|
|
21
|
-
});
|
|
22
|
-
}
|
|
@@ -55,7 +55,7 @@ export class InterceptorJwt
|
|
|
55
55
|
authToken: string | boolean | undefined,
|
|
56
56
|
): Promise<string | undefined> {
|
|
57
57
|
if (!this.sys.config.api.jwt) return;
|
|
58
|
-
if (this.sys.config.ssr.
|
|
58
|
+
if (this.sys.config.ssr.cookieDisabledOnServer) return;
|
|
59
59
|
// use default in scope.config rather than IInterceptorOptionsJwt.options
|
|
60
60
|
const authTokenCurrent = authToken ?? this.scope.config.authToken.default;
|
|
61
61
|
// authToken = authToken ?? this.scope.config.authToken.default;
|
|
@@ -164,6 +164,7 @@ export class CtxSSRMetaStore extends BeanSimple {
|
|
|
164
164
|
ssr_local_themedark=window.matchMedia('(prefers-color-scheme: dark)').matches;
|
|
165
165
|
}
|
|
166
166
|
window.ssr_themedark=window.ssr_local_themedark=ssr_local_themedark;`;
|
|
167
|
+
// Resolve the final browser theme from the SSR dual markers emitted before page render.
|
|
167
168
|
ssr_local_themedark += `Object.defineProperty(window, 'ssr_themedark_data', {
|
|
168
169
|
get: () => {
|
|
169
170
|
let _data=document.body.getAttribute('data-ssr-theme-dark-'+window.ssr_themedark);
|
|
@@ -66,7 +66,7 @@ export class BeanTheme extends BeanModelBase {
|
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
// not use watch.immediate for await done
|
|
69
|
-
await this.
|
|
69
|
+
await this._applyInitialThemeAndSsrDualOutput();
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
protected __dispose__() {
|
|
@@ -77,9 +77,12 @@ export class BeanTheme extends BeanModelBase {
|
|
|
77
77
|
this._dark = this._getDarkFromDarkMode(this.darkMode);
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
-
async
|
|
80
|
+
async _applyInitialThemeAndSsrDualOutput() {
|
|
81
|
+
// When server-side theme cookies are disabled, apply twice during SSR initialization so the
|
|
82
|
+
// server emits both data-ssr-theme-dark-false/true markers and the browser can resolve the
|
|
83
|
+
// final data-theme during bootstrap.
|
|
81
84
|
await this._applyTheme();
|
|
82
|
-
if (this.sys.config.ssr.
|
|
85
|
+
if (this.sys.config.ssr.cookieDisabledOnServer) {
|
|
83
86
|
this.toggleDark();
|
|
84
87
|
await this._applyTheme();
|
|
85
88
|
}
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import type { TypeLocaleBase } from 'zova';
|
|
2
|
-
|
|
3
|
-
import { useApp, useComputed } from 'zova';
|
|
4
|
-
|
|
5
1
|
import locale_en_us from '../config/locale/en-us.js';
|
|
6
2
|
import locale_zh_cn from '../config/locale/zh-cn.js';
|
|
7
3
|
|
|
@@ -9,14 +5,3 @@ export const locales = {
|
|
|
9
5
|
'en-us': locale_en_us,
|
|
10
6
|
'zh-cn': locale_zh_cn,
|
|
11
7
|
};
|
|
12
|
-
|
|
13
|
-
export function $useLocale<K extends keyof (typeof locales)[TypeLocaleBase]>(
|
|
14
|
-
key: K,
|
|
15
|
-
...args: any[]
|
|
16
|
-
) {
|
|
17
|
-
const app = useApp();
|
|
18
|
-
const str = `a-zod::${key}`;
|
|
19
|
-
return useComputed(() => {
|
|
20
|
-
return app.meta.text(str, ...args);
|
|
21
|
-
});
|
|
22
|
-
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zova-module-a-zova",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.62",
|
|
4
4
|
"gitHead": "2c5c19284bab738e492856189acb6fad74b8a7b7",
|
|
5
5
|
"description": "zova",
|
|
6
6
|
"keywords": [
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"@cabloy/word-utils": "^2.1.14",
|
|
44
44
|
"defu": "^6.1.7",
|
|
45
45
|
"luxon": "^3.7.2",
|
|
46
|
-
"zova-jsx": "^1.1.
|
|
46
|
+
"zova-jsx": "^1.1.56"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@cabloy/cli": "^3.1.14",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zova-suite-a-zova",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.94",
|
|
4
4
|
"gitHead": "2c5c19284bab738e492856189acb6fad74b8a7b7",
|
|
5
5
|
"description": "zova",
|
|
6
6
|
"license": "MIT",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"zova-module-a-fetch": "^5.1.17",
|
|
19
19
|
"zova-module-a-form": "^5.1.32",
|
|
20
20
|
"zova-module-a-icon": "^5.1.20",
|
|
21
|
-
"zova-module-a-interceptor": "^5.1.
|
|
21
|
+
"zova-module-a-interceptor": "^5.1.23",
|
|
22
22
|
"zova-module-a-logger": "^5.1.20",
|
|
23
23
|
"zova-module-a-meta": "^5.1.15",
|
|
24
24
|
"zova-module-a-model": "^5.1.24",
|
|
@@ -26,13 +26,13 @@
|
|
|
26
26
|
"zova-module-a-router": "^5.1.23",
|
|
27
27
|
"zova-module-a-routerstack": "^5.1.20",
|
|
28
28
|
"zova-module-a-routertabs": "^5.1.25",
|
|
29
|
-
"zova-module-a-ssr": "^5.1.
|
|
29
|
+
"zova-module-a-ssr": "^5.1.20",
|
|
30
30
|
"zova-module-a-ssrhmr": "^5.1.16",
|
|
31
31
|
"zova-module-a-ssrserver": "^5.1.16",
|
|
32
|
-
"zova-module-a-style": "^5.1.
|
|
32
|
+
"zova-module-a-style": "^5.1.26",
|
|
33
33
|
"zova-module-a-table": "^5.1.27",
|
|
34
|
-
"zova-module-a-zod": "^5.1.
|
|
35
|
-
"zova-module-a-zova": "^5.1.
|
|
34
|
+
"zova-module-a-zod": "^5.1.24",
|
|
35
|
+
"zova-module-a-zova": "^5.1.62"
|
|
36
36
|
},
|
|
37
37
|
"title": "a-zova"
|
|
38
38
|
}
|