@kong-ui-public/i18n 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,9 @@
1
+ import type { App } from 'vue';
2
+ import type { IntlShapeEx } from './types';
3
+ declare const _default: {
4
+ install(app: App, options: {
5
+ i18n: IntlShapeEx;
6
+ }): void;
7
+ };
8
+ export default _default;
9
+ //# sourceMappingURL=Translation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Translation.d.ts","sourceRoot":"","sources":["../../src/Translation.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAc,GAAG,EAAE,MAAM,KAAK,CAAA;AAC1C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;;iBA8D3B,GAAG,WAAW;QAAE,IAAI,EAAE,WAAW,CAAA;KAAE;;AADlD,wBAKC"}
@@ -0,0 +1,4 @@
1
+ import type { IntlShapeEx, SupportedLocales } from './types';
2
+ export declare const createI18n: (locale: SupportedLocales, messages: Record<string, any>, isGlobal?: boolean) => IntlShapeEx;
3
+ export default function useI18n(): IntlShapeEx;
4
+ //# sourceMappingURL=i18n.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../src/i18n.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAA+B,MAAM,SAAS,CAAA;AAQzF,eAAO,MAAM,UAAU,WAAY,gBAAgB,YAAY,OAAO,MAAM,EAAE,GAAG,CAAC,aAAY,OAAO,KAAW,WAoC/G,CAAA;AAGD,MAAM,CAAC,OAAO,UAAU,OAAO,IAAI,WAAW,CAE7C"}
@@ -0,0 +1,3 @@
1
+ export { default as useI18n, createI18n } from './i18n';
2
+ export { default as Translation } from './Translation';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAA;AACvD,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAA"}
@@ -0,0 +1,11 @@
1
+ import type { IntlShape } from '@formatjs/intl';
2
+ import type { Options as IntlMessageFormatOptions } from 'intl-messageformat';
3
+ export type MessageFormatPrimitiveValue = string | number | boolean | null | undefined;
4
+ export type SupportedLocales = 'en-us';
5
+ export type IntlShapeEx = IntlShape & {
6
+ t: (translationKey: string, values?: Record<string, MessageFormatPrimitiveValue> | undefined, opts?: IntlMessageFormatOptions) => string;
7
+ te: (translationKey: string) => boolean;
8
+ tm: (translationKey: string) => Array<string>;
9
+ source: Record<string, any>;
10
+ };
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,KAAK,EAAE,OAAO,IAAI,wBAAwB,EAAE,MAAM,oBAAoB,CAAA;AAE7E,MAAM,MAAM,2BAA2B,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,CAAA;AAEtF,MAAM,MAAM,gBAAgB,GAAG,OAAO,CAAA;AAEtC,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG;IACpC,CAAC,EAAE,CAAC,cAAc,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,2BAA2B,CAAC,GAAG,SAAS,EAAE,IAAI,CAAC,EAAE,wBAAwB,KAAK,MAAM,CAAC;IACzI,EAAE,EAAE,CAAC,cAAc,EAAE,MAAM,KAAK,OAAO,CAAC;IACxC,EAAE,EAAE,CAAC,cAAc,EAAE,MAAM,KAAK,KAAK,CAAC,MAAM,CAAC,CAAC;IAC9C,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC7B,CAAA"}
package/package.json ADDED
@@ -0,0 +1,57 @@
1
+ {
2
+ "name": "@kong-ui-public/i18n",
3
+ "version": "0.2.0",
4
+ "type": "module",
5
+ "main": "./dist/i18n.umd.js",
6
+ "module": "./dist/i18n.es.js",
7
+ "types": "dist/types/index.d.ts",
8
+ "files": [
9
+ "dist"
10
+ ],
11
+ "exports": {
12
+ ".": {
13
+ "import": "./dist/i18n.es.js",
14
+ "require": "./dist/i18n.umd.js"
15
+ },
16
+ "./package.json": "./package.json",
17
+ "./dist/*": "./dist/*"
18
+ },
19
+ "publishConfig": {
20
+ "access": "public"
21
+ },
22
+ "repository": "https://github.com/Kong/public-ui-components/tree/main/packages/core/i18n",
23
+ "bugs": {
24
+ "url": "https://github.com/Kong/public-ui-components/issues"
25
+ },
26
+ "author": "Kong, Inc.",
27
+ "license": "Apache-2.0",
28
+ "volta": {
29
+ "extends": "../../../package.json"
30
+ },
31
+ "peerDependencies": {
32
+ "vue": "^3.2.45"
33
+ },
34
+ "dependencies": {
35
+ "@formatjs/intl": "^2.6.3",
36
+ "flat": "^5.0.2",
37
+ "intl-messageformat": "^10.2.5"
38
+ },
39
+ "scripts": {
40
+ "dev": "cross-env USE_SANDBOX=true vite",
41
+ "build": "run-s typecheck build:package build:types",
42
+ "build:package": "vite build",
43
+ "build:types": "vue-tsc -p './tsconfig.build.json' --emitDeclarationOnly",
44
+ "build:visualize": "BUILD_VISUALIZER='core/i18n' vite build -m production",
45
+ "preview:package": "vite preview --port 4173",
46
+ "preview": "cross-env USE_SANDBOX=true PREVIEW_SANDBOX=true run-s build:package preview:package",
47
+ "lint": "eslint '**/*.{js,jsx,ts,tsx,vue}' --ignore-path '../../../.eslintignore'",
48
+ "lint:fix": "eslint '**/*.{js,jsx,ts,tsx,vue}' --ignore-path '../../../.eslintignore' --fix",
49
+ "stylelint": "stylelint --allow-empty-input './src/**/*.{css,scss,sass,less,styl,vue}'",
50
+ "stylelint:fix": "stylelint --allow-empty-input './src/**/*.{css,scss,sass,less,styl,vue}' --fix",
51
+ "typecheck": "vue-tsc -p './tsconfig.build.json' --noEmit",
52
+ "test:component": "BABEL_ENV=cypress cross-env FORCE_COLOR=1 cypress run --component -b chrome --spec './src/**/*.cy.ts' --project '../../../.'",
53
+ "test:component:open": "BABEL_ENV=cypress cross-env FORCE_COLOR=1 cypress open --component -b chrome --project '../../../.'",
54
+ "test:unit": "cross-env FORCE_COLOR=1 vitest run",
55
+ "test:unit:open": "cross-env FORCE_COLOR=1 vitest --ui"
56
+ }
57
+ }