From 625ad898c51a309c4fcae1e0e0529a9d27e55880 Mon Sep 17 00:00:00 2001 From: kumaradityaraj Date: Wed, 25 Mar 2026 13:11:17 +0530 Subject: [PATCH 01/16] Implemented i18n basic setup Signed-off-by: kumaradityaraj --- packages/i18n/package.json | 28 +++++++ packages/i18n/src/config.ts | 30 +++++++ packages/i18n/src/index.ts | 18 +++++ packages/i18n/src/locales/en/common.json | 6 ++ packages/i18n/src/resources.ts | 25 ++++++ packages/i18n/src/types.d.ts | 25 ++++++ packages/i18n/tsconfig.json | 10 +++ .../package.json | 5 ++ .../src/diagram-editor/DiagramEditor.tsx | 6 ++ .../src/i18n.ts | 22 +++++ pnpm-lock.yaml | 80 +++++++++++++++++++ 11 files changed, 255 insertions(+) create mode 100644 packages/i18n/package.json create mode 100644 packages/i18n/src/config.ts create mode 100644 packages/i18n/src/index.ts create mode 100644 packages/i18n/src/locales/en/common.json create mode 100644 packages/i18n/src/resources.ts create mode 100644 packages/i18n/src/types.d.ts create mode 100644 packages/i18n/tsconfig.json create mode 100644 packages/serverless-workflow-diagram-editor/src/i18n.ts diff --git a/packages/i18n/package.json b/packages/i18n/package.json new file mode 100644 index 0000000..d9cd14f --- /dev/null +++ b/packages/i18n/package.json @@ -0,0 +1,28 @@ +{ + "name": "@serverlessworkflow/i18n", + "version": "1.0.0", + "files": [ + "dist" + ], + "type": "module", + "main": "dist/index.js", + "exports": { + ".": { + "import": "./dist/index.js", + "types": "./dist/index.d.ts" + } + }, + "scripts": { + "clean": "rimraf ./dist", + "build": "pnpm clean && tsc -p tsconfig.json", + "build:prod": "pnpm -run build" + }, + "dependencies": { + "i18next": "^25.10.4", + "react-i18next": "^16.6.1" + }, + "devDependencies": { + "@types/node": "catalog:", + "rimraf": "catalog:" + } +} diff --git a/packages/i18n/src/config.ts b/packages/i18n/src/config.ts new file mode 100644 index 0000000..6510661 --- /dev/null +++ b/packages/i18n/src/config.ts @@ -0,0 +1,30 @@ +/* + * Copyright 2021-Present The Serverless Workflow Specification Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import type { i18n } from "i18next"; +import { initReactI18next } from "react-i18next"; +import { resources, defaultNS } from "./resources"; + +export function setupI18n(instance: i18n) { + return instance.use(initReactI18next).init({ + resources, + defaultNS, + fallbackLng: "en", + interpolation: { + escapeValue: false, + }, + }); +} diff --git a/packages/i18n/src/index.ts b/packages/i18n/src/index.ts new file mode 100644 index 0000000..4eb3dfa --- /dev/null +++ b/packages/i18n/src/index.ts @@ -0,0 +1,18 @@ +/* + * Copyright 2021-Present The Serverless Workflow Specification Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export * from "./config"; +export * from "./resources"; diff --git a/packages/i18n/src/locales/en/common.json b/packages/i18n/src/locales/en/common.json new file mode 100644 index 0000000..7f9d457 --- /dev/null +++ b/packages/i18n/src/locales/en/common.json @@ -0,0 +1,6 @@ +{ + "hello": "Hello", + "welcome": "Welcome to the editor", + "setup": "Setup", + "start": "Start" +} diff --git a/packages/i18n/src/resources.ts b/packages/i18n/src/resources.ts new file mode 100644 index 0000000..0cdf52a --- /dev/null +++ b/packages/i18n/src/resources.ts @@ -0,0 +1,25 @@ +/* + * Copyright 2021-Present The Serverless Workflow Specification Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import enCommon from "./locales/en/common.json"; + +export const resources = { + en: { + common: enCommon, + }, +} as const; + +export const defaultNS = "common"; diff --git a/packages/i18n/src/types.d.ts b/packages/i18n/src/types.d.ts new file mode 100644 index 0000000..7ef1530 --- /dev/null +++ b/packages/i18n/src/types.d.ts @@ -0,0 +1,25 @@ +/* + * Copyright 2021-Present The Serverless Workflow Specification Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import "react-i18next"; +import { resources, defaultNS } from "./resources"; + +declare module "react-i18next" { + interface CustomTypeOptions { + defaultNS: typeof defaultNS; + resources: (typeof resources)["en"]; + } +} diff --git a/packages/i18n/tsconfig.json b/packages/i18n/tsconfig.json new file mode 100644 index 0000000..4444bef --- /dev/null +++ b/packages/i18n/tsconfig.json @@ -0,0 +1,10 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "outDir": "dist", + "rootDir": "src", + "declaration": true, + "emitDeclarationOnly": false + }, + "include": ["src"] +} diff --git a/packages/serverless-workflow-diagram-editor/package.json b/packages/serverless-workflow-diagram-editor/package.json index de855e0..0acae75 100644 --- a/packages/serverless-workflow-diagram-editor/package.json +++ b/packages/serverless-workflow-diagram-editor/package.json @@ -37,6 +37,11 @@ "start": "storybook dev -p 6006 --no-open", "build:storybook": "pnpm clean:storybook && storybook build --output-dir ./dist-storybook" }, + "dependencies": { + "@serverlessworkflow/i18n": "workspace:*", + "i18next": "^25.10.4", + "react-i18next": "^16.6.1" + }, "devDependencies": { "@chromatic-com/storybook": "catalog:", "@storybook/addon-a11y": "catalog:", diff --git a/packages/serverless-workflow-diagram-editor/src/diagram-editor/DiagramEditor.tsx b/packages/serverless-workflow-diagram-editor/src/diagram-editor/DiagramEditor.tsx index a896f45..f497154 100644 --- a/packages/serverless-workflow-diagram-editor/src/diagram-editor/DiagramEditor.tsx +++ b/packages/serverless-workflow-diagram-editor/src/diagram-editor/DiagramEditor.tsx @@ -15,6 +15,8 @@ */ import type { CSSProperties } from "react"; +import "../i18n"; +import { useTranslation } from "react-i18next"; const clickmeBtnStyle: CSSProperties = { border: "2px solid blue", @@ -32,6 +34,7 @@ export type DiagramEditorProps = { export const DiagramEditor = (props: DiagramEditorProps) => { //TODO: Implement the actual component this is just a placeholder + const { t } = useTranslation(); return ( <> @@ -41,6 +44,9 @@ export const DiagramEditor = (props: DiagramEditorProps) => { +
+ {t("welcome")} {t("start")} {t("setup")}{" "} +
); }; diff --git a/packages/serverless-workflow-diagram-editor/src/i18n.ts b/packages/serverless-workflow-diagram-editor/src/i18n.ts new file mode 100644 index 0000000..c302c02 --- /dev/null +++ b/packages/serverless-workflow-diagram-editor/src/i18n.ts @@ -0,0 +1,22 @@ +/* + * Copyright 2021-Present The Serverless Workflow Specification Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import i18n from "i18next"; +import { setupI18n } from "@serverlessworkflow/i18n"; + +await setupI18n(i18n); + +export default i18n; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5eefd81..5c6af1e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -111,7 +111,33 @@ importers: specifier: 'catalog:' version: 5.9.3 + packages/i18n: + dependencies: + i18next: + specifier: ^25.10.4 + version: 25.10.9(typescript@5.9.3) + react-i18next: + specifier: ^16.6.1 + version: 16.6.6(i18next@25.10.9(typescript@5.9.3))(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(typescript@5.9.3) + devDependencies: + '@types/node': + specifier: 'catalog:' + version: 25.5.0 + rimraf: + specifier: 'catalog:' + version: 6.1.3 + packages/serverless-workflow-diagram-editor: + dependencies: + '@serverlessworkflow/i18n': + specifier: workspace:* + version: link:../i18n + i18next: + specifier: ^25.10.4 + version: 25.10.9(typescript@5.9.3) + react-i18next: + specifier: ^16.6.1 + version: 16.6.6(i18next@25.10.9(typescript@5.9.3))(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(typescript@5.9.3) devDependencies: '@chromatic-com/storybook': specifier: 'catalog:' @@ -1611,6 +1637,9 @@ packages: html-escaper@2.0.2: resolution: {integrity: sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==} + html-parse-stringify@3.0.1: + resolution: {integrity: sha512-KknJ50kTInJ7qIScF3jeaFRpMpE8/lfiTdzf/twXyPBLAGrLRTmkz3AdTnKeh40X8k9L2fdYwEp/42WGXIRGcg==} + http-proxy-agent@7.0.2: resolution: {integrity: sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==} engines: {node: '>= 14'} @@ -1624,6 +1653,14 @@ packages: engines: {node: '>=18'} hasBin: true + i18next@25.10.9: + resolution: {integrity: sha512-hQY9/bFoQKGlSKMlaCuLR8w1h5JjieqrsnZvEmj1Ja6Ec7fbyc4cTrCsY9mb9Sd8YQ/swsrKz1S9M8AcvVI70w==} + peerDependencies: + typescript: ^5 || ^6 + peerDependenciesMeta: + typescript: + optional: true + iconv-lite@0.6.3: resolution: {integrity: sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==} engines: {node: '>=0.10.0'} @@ -1865,6 +1902,22 @@ packages: peerDependencies: react: ^19.2.4 + react-i18next@16.6.6: + resolution: {integrity: sha512-ZgL2HUoW34UKUkOV7uSQFE1CDnRPD+tCR3ywSuWH7u2iapnz86U8Bi3Vrs620qNDzCf1F47NxglCEkchCTDOHw==} + peerDependencies: + i18next: '>= 25.10.9' + react: '>= 16.8.0' + react-dom: '*' + react-native: '*' + typescript: ^5 || ^6 + peerDependenciesMeta: + react-dom: + optional: true + react-native: + optional: true + typescript: + optional: true + react-is@17.0.2: resolution: {integrity: sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==} @@ -2234,6 +2287,10 @@ packages: jsdom: optional: true + void-elements@3.1.0: + resolution: {integrity: sha512-Dhxzh5HZuiHQhbvTW9AMetFfBHDMYpo23Uo9btPXgdYP+3T5S+p+jgNy7spra+veYhBP2dCSgxR/i2Y02h5/6w==} + engines: {node: '>=0.10.0'} + w3c-xmlserializer@5.0.0: resolution: {integrity: sha512-o8qghlI8NZHU1lLPrpi2+Uq7abh4GGPpYANlalzWxyWteJOCsr/P+oPBA49TOLu5FTZO4d3F9MnWJfiMo4BkmA==} engines: {node: '>=18'} @@ -3438,6 +3495,10 @@ snapshots: html-escaper@2.0.2: {} + html-parse-stringify@3.0.1: + dependencies: + void-elements: 3.1.0 + http-proxy-agent@7.0.2: dependencies: agent-base: 7.1.4 @@ -3454,6 +3515,12 @@ snapshots: husky@9.1.7: {} + i18next@25.10.9(typescript@5.9.3): + dependencies: + '@babel/runtime': 7.29.2 + optionalDependencies: + typescript: 5.9.3 + iconv-lite@0.6.3: dependencies: safer-buffer: 2.1.2 @@ -3735,6 +3802,17 @@ snapshots: react: 19.2.4 scheduler: 0.27.0 + react-i18next@16.6.6(i18next@25.10.9(typescript@5.9.3))(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(typescript@5.9.3): + dependencies: + '@babel/runtime': 7.29.2 + html-parse-stringify: 3.0.1 + i18next: 25.10.9(typescript@5.9.3) + react: 19.2.4 + use-sync-external-store: 1.6.0(react@19.2.4) + optionalDependencies: + react-dom: 19.2.4(react@19.2.4) + typescript: 5.9.3 + react-is@17.0.2: {} react@19.2.4: {} @@ -4060,6 +4138,8 @@ snapshots: transitivePeerDependencies: - msw + void-elements@3.1.0: {} + w3c-xmlserializer@5.0.0: dependencies: xml-name-validator: 5.0.0 From a3ebcb6acde46a73487a5788294e0b6c0973b622 Mon Sep 17 00:00:00 2001 From: kumaradityaraj Date: Wed, 25 Mar 2026 13:36:51 +0530 Subject: [PATCH 02/16] Resolved copilots suggestions Signed-off-by: kumaradityaraj --- packages/i18n/package.json | 2 +- packages/i18n/src/index.ts | 2 ++ packages/serverless-workflow-diagram-editor/src/i18n.ts | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/i18n/package.json b/packages/i18n/package.json index d9cd14f..454125e 100644 --- a/packages/i18n/package.json +++ b/packages/i18n/package.json @@ -15,7 +15,7 @@ "scripts": { "clean": "rimraf ./dist", "build": "pnpm clean && tsc -p tsconfig.json", - "build:prod": "pnpm -run build" + "build:prod": "pnpm run build" }, "dependencies": { "i18next": "^25.10.4", diff --git a/packages/i18n/src/index.ts b/packages/i18n/src/index.ts index 4eb3dfa..88ff33e 100644 --- a/packages/i18n/src/index.ts +++ b/packages/i18n/src/index.ts @@ -14,5 +14,7 @@ * limitations under the License. */ +import type {} from "./types"; + export * from "./config"; export * from "./resources"; diff --git a/packages/serverless-workflow-diagram-editor/src/i18n.ts b/packages/serverless-workflow-diagram-editor/src/i18n.ts index c302c02..d9d6af0 100644 --- a/packages/serverless-workflow-diagram-editor/src/i18n.ts +++ b/packages/serverless-workflow-diagram-editor/src/i18n.ts @@ -17,6 +17,6 @@ import i18n from "i18next"; import { setupI18n } from "@serverlessworkflow/i18n"; -await setupI18n(i18n); +void setupI18n(i18n); export default i18n; From 6f76d97fe6d6ddfc10e1e2da2bf8434a965e9061 Mon Sep 17 00:00:00 2001 From: kumaradityaraj Date: Wed, 25 Mar 2026 13:42:17 +0530 Subject: [PATCH 03/16] Resolved dependency issue Signed-off-by: kumaradityaraj --- packages/i18n/package.json | 6 ++-- .../package.json | 6 ++-- pnpm-lock.yaml | 31 +++++++++++-------- pnpm-workspace.yaml | 2 ++ 4 files changed, 25 insertions(+), 20 deletions(-) diff --git a/packages/i18n/package.json b/packages/i18n/package.json index 454125e..7556645 100644 --- a/packages/i18n/package.json +++ b/packages/i18n/package.json @@ -17,12 +17,10 @@ "build": "pnpm clean && tsc -p tsconfig.json", "build:prod": "pnpm run build" }, - "dependencies": { - "i18next": "^25.10.4", - "react-i18next": "^16.6.1" - }, "devDependencies": { "@types/node": "catalog:", + "i18next": "catalog:", + "react-i18next": "catalog:", "rimraf": "catalog:" } } diff --git a/packages/serverless-workflow-diagram-editor/package.json b/packages/serverless-workflow-diagram-editor/package.json index 0acae75..4ee1f40 100644 --- a/packages/serverless-workflow-diagram-editor/package.json +++ b/packages/serverless-workflow-diagram-editor/package.json @@ -38,9 +38,7 @@ "build:storybook": "pnpm clean:storybook && storybook build --output-dir ./dist-storybook" }, "dependencies": { - "@serverlessworkflow/i18n": "workspace:*", - "i18next": "^25.10.4", - "react-i18next": "^16.6.1" + "@serverlessworkflow/i18n": "workspace:*" }, "devDependencies": { "@chromatic-com/storybook": "catalog:", @@ -57,11 +55,13 @@ "@types/react-dom": "catalog:", "@vitest/coverage-v8": "catalog:", "@vitest/ui": "catalog:", + "i18next": "catalog:", "jsdom": "catalog:", "oxfmt": "catalog:", "oxlint": "catalog:", "react": "catalog:", "react-dom": "catalog:", + "react-i18next": "catalog:", "rimraf": "catalog:", "storybook": "catalog:", "vite": "catalog:", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5c6af1e..acf9fdb 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -51,6 +51,9 @@ catalogs: husky: specifier: ^9.1.7 version: 9.1.7 + i18next: + specifier: ^25.10.4 + version: 25.10.9 jsdom: specifier: ^25.0.0 version: 25.0.1 @@ -69,6 +72,9 @@ catalogs: react-dom: specifier: ^19.2.4 version: 19.2.4 + react-i18next: + specifier: ^16.6.1 + version: 16.6.6 rimraf: specifier: ^6.1.3 version: 6.1.3 @@ -112,17 +118,16 @@ importers: version: 5.9.3 packages/i18n: - dependencies: - i18next: - specifier: ^25.10.4 - version: 25.10.9(typescript@5.9.3) - react-i18next: - specifier: ^16.6.1 - version: 16.6.6(i18next@25.10.9(typescript@5.9.3))(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(typescript@5.9.3) devDependencies: '@types/node': specifier: 'catalog:' version: 25.5.0 + i18next: + specifier: 'catalog:' + version: 25.10.9(typescript@5.9.3) + react-i18next: + specifier: 'catalog:' + version: 16.6.6(i18next@25.10.9(typescript@5.9.3))(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(typescript@5.9.3) rimraf: specifier: 'catalog:' version: 6.1.3 @@ -132,12 +137,6 @@ importers: '@serverlessworkflow/i18n': specifier: workspace:* version: link:../i18n - i18next: - specifier: ^25.10.4 - version: 25.10.9(typescript@5.9.3) - react-i18next: - specifier: ^16.6.1 - version: 16.6.6(i18next@25.10.9(typescript@5.9.3))(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(typescript@5.9.3) devDependencies: '@chromatic-com/storybook': specifier: 'catalog:' @@ -181,6 +180,9 @@ importers: '@vitest/ui': specifier: 'catalog:' version: 4.1.1(vitest@4.1.1) + i18next: + specifier: 'catalog:' + version: 25.10.9(typescript@5.9.3) jsdom: specifier: 'catalog:' version: 25.0.1 @@ -196,6 +198,9 @@ importers: react-dom: specifier: 'catalog:' version: 19.2.4(react@19.2.4) + react-i18next: + specifier: 'catalog:' + version: 16.6.6(i18next@25.10.9(typescript@5.9.3))(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(typescript@5.9.3) rimraf: specifier: 'catalog:' version: 6.1.3 diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 7994462..0a0d1ca 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -29,6 +29,8 @@ catalog: vite: ^6.0.0 vite-tsconfig-paths: ^6.1.1 vitest: ^4.1.0 + i18next: ^25.10.4 + react-i18next: ^16.6.1 cleanupUnusedCatalogs: true onlyBuiltDependencies: - "@swc/core" From 001c00e249ccba9f5ac98416bc616828443b1b4c Mon Sep 17 00:00:00 2001 From: kumaradityaraj Date: Wed, 25 Mar 2026 14:03:23 +0530 Subject: [PATCH 04/16] Resolved copilot reviews Signed-off-by: kumaradityaraj --- packages/i18n/package.json | 7 ++++-- packages/i18n/src/config.ts | 15 ++++++++++-- .../package.json | 6 ++--- .../src/i18n.ts | 5 ++-- pnpm-lock.yaml | 24 +++++++++++-------- 5 files changed, 37 insertions(+), 20 deletions(-) diff --git a/packages/i18n/package.json b/packages/i18n/package.json index 7556645..a953284 100644 --- a/packages/i18n/package.json +++ b/packages/i18n/package.json @@ -17,10 +17,13 @@ "build": "pnpm clean && tsc -p tsconfig.json", "build:prod": "pnpm run build" }, + "dependencies": { + "@serverlessworkflow/i18n": "workspace:*", + "i18next": "catalog:", + "react-i18next": "catalog:" + }, "devDependencies": { "@types/node": "catalog:", - "i18next": "catalog:", - "react-i18next": "catalog:", "rimraf": "catalog:" } } diff --git a/packages/i18n/src/config.ts b/packages/i18n/src/config.ts index 6510661..82baefb 100644 --- a/packages/i18n/src/config.ts +++ b/packages/i18n/src/config.ts @@ -18,13 +18,24 @@ import type { i18n } from "i18next"; import { initReactI18next } from "react-i18next"; import { resources, defaultNS } from "./resources"; -export function setupI18n(instance: i18n) { - return instance.use(initReactI18next).init({ +export async function setupI18n(instance: i18n) { + if (instance.isInitialized) { + return instance; + } + + await instance.use(initReactI18next).init({ resources, defaultNS, fallbackLng: "en", + interpolation: { escapeValue: false, }, + + react: { + useSuspense: false, + }, }); + + return instance; } diff --git a/packages/serverless-workflow-diagram-editor/package.json b/packages/serverless-workflow-diagram-editor/package.json index 4ee1f40..fbe5a2f 100644 --- a/packages/serverless-workflow-diagram-editor/package.json +++ b/packages/serverless-workflow-diagram-editor/package.json @@ -38,7 +38,9 @@ "build:storybook": "pnpm clean:storybook && storybook build --output-dir ./dist-storybook" }, "dependencies": { - "@serverlessworkflow/i18n": "workspace:*" + "@serverlessworkflow/i18n": "workspace:*", + "i18next": "catalog:", + "react-i18next": "catalog:" }, "devDependencies": { "@chromatic-com/storybook": "catalog:", @@ -55,13 +57,11 @@ "@types/react-dom": "catalog:", "@vitest/coverage-v8": "catalog:", "@vitest/ui": "catalog:", - "i18next": "catalog:", "jsdom": "catalog:", "oxfmt": "catalog:", "oxlint": "catalog:", "react": "catalog:", "react-dom": "catalog:", - "react-i18next": "catalog:", "rimraf": "catalog:", "storybook": "catalog:", "vite": "catalog:", diff --git a/packages/serverless-workflow-diagram-editor/src/i18n.ts b/packages/serverless-workflow-diagram-editor/src/i18n.ts index d9d6af0..18bc5e5 100644 --- a/packages/serverless-workflow-diagram-editor/src/i18n.ts +++ b/packages/serverless-workflow-diagram-editor/src/i18n.ts @@ -17,6 +17,5 @@ import i18n from "i18next"; import { setupI18n } from "@serverlessworkflow/i18n"; -void setupI18n(i18n); - -export default i18n; +const i18nReady = setupI18n(i18n); +export { i18nReady }; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index acf9fdb..29da452 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -118,16 +118,20 @@ importers: version: 5.9.3 packages/i18n: - devDependencies: - '@types/node': - specifier: 'catalog:' - version: 25.5.0 + dependencies: + '@serverlessworkflow/i18n': + specifier: workspace:* + version: 'link:' i18next: specifier: 'catalog:' version: 25.10.9(typescript@5.9.3) react-i18next: specifier: 'catalog:' version: 16.6.6(i18next@25.10.9(typescript@5.9.3))(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(typescript@5.9.3) + devDependencies: + '@types/node': + specifier: 'catalog:' + version: 25.5.0 rimraf: specifier: 'catalog:' version: 6.1.3 @@ -137,6 +141,12 @@ importers: '@serverlessworkflow/i18n': specifier: workspace:* version: link:../i18n + i18next: + specifier: 'catalog:' + version: 25.10.9(typescript@5.9.3) + react-i18next: + specifier: 'catalog:' + version: 16.6.6(i18next@25.10.9(typescript@5.9.3))(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(typescript@5.9.3) devDependencies: '@chromatic-com/storybook': specifier: 'catalog:' @@ -180,9 +190,6 @@ importers: '@vitest/ui': specifier: 'catalog:' version: 4.1.1(vitest@4.1.1) - i18next: - specifier: 'catalog:' - version: 25.10.9(typescript@5.9.3) jsdom: specifier: 'catalog:' version: 25.0.1 @@ -198,9 +205,6 @@ importers: react-dom: specifier: 'catalog:' version: 19.2.4(react@19.2.4) - react-i18next: - specifier: 'catalog:' - version: 16.6.6(i18next@25.10.9(typescript@5.9.3))(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(typescript@5.9.3) rimraf: specifier: 'catalog:' version: 6.1.3 From 4cfa4b99ca1b0b40f56359d75dd542ae3a5e4531 Mon Sep 17 00:00:00 2001 From: kumaradityaraj Date: Fri, 27 Mar 2026 13:44:24 +0530 Subject: [PATCH 05/16] i18n setup provider Signed-off-by: kumaradityaraj --- packages/i18n/package.json | 4 +- packages/i18n/src/TranslationProvider.tsx | 51 +++++++++++++++++++ packages/i18n/src/{config.ts => i18n.ts} | 25 +++++---- packages/i18n/src/index.ts | 6 +-- packages/i18n/src/resources.ts | 25 --------- packages/i18n/src/types.d.ts | 25 --------- packages/i18n/tsconfig.json | 1 + .../src/diagram-editor/DiagramEditor.tsx | 14 ++--- .../src/i18n.ts | 21 -------- pnpm-lock.yaml | 32 +++++++++--- pnpm-workspace.yaml | 6 +-- 11 files changed, 105 insertions(+), 105 deletions(-) create mode 100644 packages/i18n/src/TranslationProvider.tsx rename packages/i18n/src/{config.ts => i18n.ts} (73%) delete mode 100644 packages/i18n/src/resources.ts delete mode 100644 packages/i18n/src/types.d.ts delete mode 100644 packages/serverless-workflow-diagram-editor/src/i18n.ts diff --git a/packages/i18n/package.json b/packages/i18n/package.json index a953284..b983984 100644 --- a/packages/i18n/package.json +++ b/packages/i18n/package.json @@ -18,12 +18,14 @@ "build:prod": "pnpm run build" }, "dependencies": { - "@serverlessworkflow/i18n": "workspace:*", "i18next": "catalog:", "react-i18next": "catalog:" }, "devDependencies": { "@types/node": "catalog:", + "@types/react": "catalog:", + "@types/react-dom": "catalog:", + "@types/react-i18next": "^8.1.0", "rimraf": "catalog:" } } diff --git a/packages/i18n/src/TranslationProvider.tsx b/packages/i18n/src/TranslationProvider.tsx new file mode 100644 index 0000000..c733d3e --- /dev/null +++ b/packages/i18n/src/TranslationProvider.tsx @@ -0,0 +1,51 @@ +/* + * Copyright 2021-Present The Serverless Workflow Specification Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import React, { createContext, useContext, useEffect, useState } from "react"; +import { I18nextProvider } from "react-i18next"; +import i18n from "./i18n"; + +type LanguageContextType = { + language: string; + changeLanguage: (lng: string) => void; +}; + +const LanguageContext = createContext({ + language: "en", + changeLanguage: () => {}, +}); + +export const useLanguage = () => useContext(LanguageContext); + +export function TranslationProvider({ children }: { children: React.ReactNode }) { + const [language, setLanguage] = useState(i18n.language); + + useEffect(() => { + const handler = (lng: string) => setLanguage(lng); + i18n.on("languageChanged", handler); + return () => i18n.off("languageChanged", handler); + }, []); + + const changeLanguage = (lng: string) => { + i18n.changeLanguage(lng); + }; + + return ( + + {children} + + ); +} diff --git a/packages/i18n/src/config.ts b/packages/i18n/src/i18n.ts similarity index 73% rename from packages/i18n/src/config.ts rename to packages/i18n/src/i18n.ts index 82baefb..4d93afa 100644 --- a/packages/i18n/src/config.ts +++ b/packages/i18n/src/i18n.ts @@ -14,28 +14,27 @@ * limitations under the License. */ -import type { i18n } from "i18next"; +import i18n from "i18next"; import { initReactI18next } from "react-i18next"; -import { resources, defaultNS } from "./resources"; -export async function setupI18n(instance: i18n) { - if (instance.isInitialized) { - return instance; - } +import en from "./locales/en/common.json"; - await instance.use(initReactI18next).init({ - resources, - defaultNS, +if (!i18n.isInitialized) { + i18n.use(initReactI18next).init({ + resources: { + en: { common: en }, + }, + lng: "en", fallbackLng: "en", - + ns: ["common"], + defaultNS: "common", interpolation: { escapeValue: false, }, - react: { useSuspense: false, }, }); - - return instance; } + +export default i18n; diff --git a/packages/i18n/src/index.ts b/packages/i18n/src/index.ts index 88ff33e..bf2a23c 100644 --- a/packages/i18n/src/index.ts +++ b/packages/i18n/src/index.ts @@ -14,7 +14,5 @@ * limitations under the License. */ -import type {} from "./types"; - -export * from "./config"; -export * from "./resources"; +export { TranslationProvider, useLanguage } from "./TranslationProvider"; +export { default as i18n } from "./i18n"; diff --git a/packages/i18n/src/resources.ts b/packages/i18n/src/resources.ts deleted file mode 100644 index 0cdf52a..0000000 --- a/packages/i18n/src/resources.ts +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2021-Present The Serverless Workflow Specification Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import enCommon from "./locales/en/common.json"; - -export const resources = { - en: { - common: enCommon, - }, -} as const; - -export const defaultNS = "common"; diff --git a/packages/i18n/src/types.d.ts b/packages/i18n/src/types.d.ts deleted file mode 100644 index 7ef1530..0000000 --- a/packages/i18n/src/types.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2021-Present The Serverless Workflow Specification Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import "react-i18next"; -import { resources, defaultNS } from "./resources"; - -declare module "react-i18next" { - interface CustomTypeOptions { - defaultNS: typeof defaultNS; - resources: (typeof resources)["en"]; - } -} diff --git a/packages/i18n/tsconfig.json b/packages/i18n/tsconfig.json index 4444bef..8d11274 100644 --- a/packages/i18n/tsconfig.json +++ b/packages/i18n/tsconfig.json @@ -1,5 +1,6 @@ { "extends": "../../tsconfig.base.json", + "types": ["node"], "compilerOptions": { "outDir": "dist", "rootDir": "src", diff --git a/packages/serverless-workflow-diagram-editor/src/diagram-editor/DiagramEditor.tsx b/packages/serverless-workflow-diagram-editor/src/diagram-editor/DiagramEditor.tsx index f497154..988ce79 100644 --- a/packages/serverless-workflow-diagram-editor/src/diagram-editor/DiagramEditor.tsx +++ b/packages/serverless-workflow-diagram-editor/src/diagram-editor/DiagramEditor.tsx @@ -14,9 +14,9 @@ * limitations under the License. */ -import type { CSSProperties } from "react"; -import "../i18n"; +import { CSSProperties } from "react"; import { useTranslation } from "react-i18next"; +import { TranslationProvider } from "@serverlessworkflow/i18n"; const clickmeBtnStyle: CSSProperties = { border: "2px solid blue", @@ -33,20 +33,20 @@ export type DiagramEditorProps = { }; export const DiagramEditor = (props: DiagramEditorProps) => { - //TODO: Implement the actual component this is just a placeholder const { t } = useTranslation(); - return ( - <> +

Hello from DiagramEditor component!

Read-only: {props.isReadOnly ? "true" : "false"}

Content: {props.content}

+ +
- {t("welcome")} {t("start")} {t("setup")}{" "} + {t("welcome")} {t("start")} {t("setup")}
- +
); }; diff --git a/packages/serverless-workflow-diagram-editor/src/i18n.ts b/packages/serverless-workflow-diagram-editor/src/i18n.ts deleted file mode 100644 index 18bc5e5..0000000 --- a/packages/serverless-workflow-diagram-editor/src/i18n.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2021-Present The Serverless Workflow Specification Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import i18n from "i18next"; -import { setupI18n } from "@serverlessworkflow/i18n"; - -const i18nReady = setupI18n(i18n); -export { i18nReady }; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 29da452..ae1f07e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -34,7 +34,7 @@ catalogs: specifier: ^14.6.1 version: 14.6.1 '@types/node': - specifier: ^25.3.3 + specifier: ^25.5.0 version: 25.5.0 '@types/react': specifier: ^19.2.14 @@ -52,7 +52,7 @@ catalogs: specifier: ^9.1.7 version: 9.1.7 i18next: - specifier: ^25.10.4 + specifier: ^25.10.9 version: 25.10.9 jsdom: specifier: ^25.0.0 @@ -73,7 +73,7 @@ catalogs: specifier: ^19.2.4 version: 19.2.4 react-i18next: - specifier: ^16.6.1 + specifier: ^16.6.6 version: 16.6.6 rimraf: specifier: ^6.1.3 @@ -119,9 +119,6 @@ importers: packages/i18n: dependencies: - '@serverlessworkflow/i18n': - specifier: workspace:* - version: 'link:' i18next: specifier: 'catalog:' version: 25.10.9(typescript@5.9.3) @@ -132,6 +129,15 @@ importers: '@types/node': specifier: 'catalog:' version: 25.5.0 + '@types/react': + specifier: 'catalog:' + version: 19.2.14 + '@types/react-dom': + specifier: 'catalog:' + version: 19.2.3(@types/react@19.2.14) + '@types/react-i18next': + specifier: ^8.1.0 + version: 8.1.0(i18next@25.10.9(typescript@5.9.3))(react@19.2.4)(typescript@5.9.3) rimraf: specifier: 'catalog:' version: 6.1.3 @@ -1235,6 +1241,10 @@ packages: peerDependencies: '@types/react': ^19.2.0 + '@types/react-i18next@8.1.0': + resolution: {integrity: sha512-d4xhcjX5b3roNMObRNMfb1HinHQlQLPo8xlDj60dnHeeAw2bBymR2cy/l1giJpHzo/ZFgSvgVUvIWr4kCrenCg==} + deprecated: This is a stub types definition. react-i18next provides its own type definitions, so you do not need this installed. + '@types/react@19.2.14': resolution: {integrity: sha512-ilcTH/UniCkMdtexkoCN0bI7pMcJDvmQFPvuPvmEaYA/NSfFTAgdUSLAoVjaRJm7+6PvcM+q1zYOwS4wTYMF9w==} @@ -3086,6 +3096,16 @@ snapshots: dependencies: '@types/react': 19.2.14 + '@types/react-i18next@8.1.0(i18next@25.10.9(typescript@5.9.3))(react@19.2.4)(typescript@5.9.3)': + dependencies: + react-i18next: 16.6.6(i18next@25.10.9(typescript@5.9.3))(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(typescript@5.9.3) + transitivePeerDependencies: + - i18next + - react + - react-dom + - react-native + - typescript + '@types/react@19.2.14': dependencies: csstype: 3.2.3 diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 0a0d1ca..1f54703 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -10,18 +10,20 @@ catalog: "@testing-library/jest-dom": ^6.9.1 "@testing-library/react": ^16.3.2 "@testing-library/user-event": ^14.6.1 - "@types/node": ^25.3.3 + "@types/node": ^25.5.0 "@types/react": ^19.2.14 "@types/react-dom": ^19.2.3 "@vitest/coverage-v8": ^4.1.0 "@vitest/ui": ^4.1.0 husky: ^9.1.7 + i18next: ^25.10.9 jsdom: ^25.0.0 lint-staged: ^16.4.0 oxfmt: ^0.41.0 oxlint: ^1.56.0 react: ^19.2.4 react-dom: ^19.2.4 + react-i18next: ^16.6.6 rimraf: ^6.1.3 storybook: ^10.2.19 syncpack: ^14.2.0 @@ -29,8 +31,6 @@ catalog: vite: ^6.0.0 vite-tsconfig-paths: ^6.1.1 vitest: ^4.1.0 - i18next: ^25.10.4 - react-i18next: ^16.6.1 cleanupUnusedCatalogs: true onlyBuiltDependencies: - "@swc/core" From a7ed3aa21cfdc992762e69ad184aa5f539e0d07d Mon Sep 17 00:00:00 2001 From: kumaradityaraj Date: Fri, 27 Mar 2026 13:56:51 +0530 Subject: [PATCH 06/16] i18n setup provider error resolve Signed-off-by: kumaradityaraj --- packages/i18n/package.json | 4 ++++ pnpm-lock.yaml | 10 ++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/packages/i18n/package.json b/packages/i18n/package.json index b983984..ce9df34 100644 --- a/packages/i18n/package.json +++ b/packages/i18n/package.json @@ -27,5 +27,9 @@ "@types/react-dom": "catalog:", "@types/react-i18next": "^8.1.0", "rimraf": "catalog:" + }, + "peerDependencies": { + "react": "^19.0.0", + "react-dom": "^19.0.0" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ae1f07e..83cf6d5 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -122,6 +122,12 @@ importers: i18next: specifier: 'catalog:' version: 25.10.9(typescript@5.9.3) + react: + specifier: ^19.0.0 + version: 19.2.4 + react-dom: + specifier: ^19.0.0 + version: 19.2.4(react@19.2.4) react-i18next: specifier: 'catalog:' version: 16.6.6(i18next@25.10.9(typescript@5.9.3))(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(typescript@5.9.3) @@ -137,7 +143,7 @@ importers: version: 19.2.3(@types/react@19.2.14) '@types/react-i18next': specifier: ^8.1.0 - version: 8.1.0(i18next@25.10.9(typescript@5.9.3))(react@19.2.4)(typescript@5.9.3) + version: 8.1.0(i18next@25.10.9(typescript@5.9.3))(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(typescript@5.9.3) rimraf: specifier: 'catalog:' version: 6.1.3 @@ -3096,7 +3102,7 @@ snapshots: dependencies: '@types/react': 19.2.14 - '@types/react-i18next@8.1.0(i18next@25.10.9(typescript@5.9.3))(react@19.2.4)(typescript@5.9.3)': + '@types/react-i18next@8.1.0(i18next@25.10.9(typescript@5.9.3))(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(typescript@5.9.3)': dependencies: react-i18next: 16.6.6(i18next@25.10.9(typescript@5.9.3))(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(typescript@5.9.3) transitivePeerDependencies: From bebe43654b233906e8b48036ccf22f59e0a84421 Mon Sep 17 00:00:00 2001 From: kumaradityaraj Date: Wed, 1 Apr 2026 13:36:36 +0530 Subject: [PATCH 07/16] Changed the approach and implemented i18n similar to kie-tools Signed-off-by: kumaradityaraj --- .../package.json | 4 +-- .../src/diagram-editor/DiagramEditor.tsx | 34 ++++++++++++++----- .../src/i18n/SwdEditorI18n.ts | 9 +++++ .../src/i18n/index.ts | 2 ++ .../src/i18n/locales/en.ts | 5 +++ .../src/i18n/locales/index.ts | 1 + .../src/i18n/setup.ts | 19 +++++++++++ 7 files changed, 63 insertions(+), 11 deletions(-) create mode 100644 packages/serverless-workflow-diagram-editor/src/i18n/SwdEditorI18n.ts create mode 100644 packages/serverless-workflow-diagram-editor/src/i18n/index.ts create mode 100644 packages/serverless-workflow-diagram-editor/src/i18n/locales/en.ts create mode 100644 packages/serverless-workflow-diagram-editor/src/i18n/locales/index.ts create mode 100644 packages/serverless-workflow-diagram-editor/src/i18n/setup.ts diff --git a/packages/serverless-workflow-diagram-editor/package.json b/packages/serverless-workflow-diagram-editor/package.json index fbe5a2f..ab4a7e7 100644 --- a/packages/serverless-workflow-diagram-editor/package.json +++ b/packages/serverless-workflow-diagram-editor/package.json @@ -38,9 +38,7 @@ "build:storybook": "pnpm clean:storybook && storybook build --output-dir ./dist-storybook" }, "dependencies": { - "@serverlessworkflow/i18n": "workspace:*", - "i18next": "catalog:", - "react-i18next": "catalog:" + "@serverlessworkflow/i18n": "workspace:*" }, "devDependencies": { "@chromatic-com/storybook": "catalog:", diff --git a/packages/serverless-workflow-diagram-editor/src/diagram-editor/DiagramEditor.tsx b/packages/serverless-workflow-diagram-editor/src/diagram-editor/DiagramEditor.tsx index 988ce79..f5901f4 100644 --- a/packages/serverless-workflow-diagram-editor/src/diagram-editor/DiagramEditor.tsx +++ b/packages/serverless-workflow-diagram-editor/src/diagram-editor/DiagramEditor.tsx @@ -15,8 +15,13 @@ */ import { CSSProperties } from "react"; -import { useTranslation } from "react-i18next"; -import { TranslationProvider } from "@serverlessworkflow/i18n"; +import { + swdEditorDictionaries, + SwdEditorI18nContext, + swdEditorI18nDefaults, + useSwdEditorI18n, +} from "../i18n"; +import { I18nDictionariesProvider } from "@serverlessworkflow/i18n/dist/react-components"; const clickmeBtnStyle: CSSProperties = { border: "2px solid blue", @@ -30,12 +35,27 @@ const clickmeBtnStyle: CSSProperties = { export type DiagramEditorProps = { content: string; isReadOnly: boolean; + locale: string; }; export const DiagramEditor = (props: DiagramEditorProps) => { - const { t } = useTranslation(); return ( - + + + + ); +}; + +const DiagramEditorInner = (props: DiagramEditorProps) => { + const { i18n } = useSwdEditorI18n(); + + return ( + <>

Hello from DiagramEditor component!

Read-only: {props.isReadOnly ? "true" : "false"}

Content: {props.content}

@@ -44,9 +64,7 @@ export const DiagramEditor = (props: DiagramEditorProps) => { Click me! -
- {t("welcome")} {t("start")} {t("setup")} -
-
+

{i18n.hello}

+ ); }; diff --git a/packages/serverless-workflow-diagram-editor/src/i18n/SwdEditorI18n.ts b/packages/serverless-workflow-diagram-editor/src/i18n/SwdEditorI18n.ts new file mode 100644 index 0000000..bd5a07d --- /dev/null +++ b/packages/serverless-workflow-diagram-editor/src/i18n/SwdEditorI18n.ts @@ -0,0 +1,9 @@ +import { ReferenceDictionary } from "@serverlessworkflow/i18n/dist/core"; + +interface SwdEditorDictionary extends ReferenceDictionary<{}> {} + +export interface SwdEditorI18n extends SwdEditorDictionary {} + +export interface SwdEditorI18n { + hello: string; +} diff --git a/packages/serverless-workflow-diagram-editor/src/i18n/index.ts b/packages/serverless-workflow-diagram-editor/src/i18n/index.ts new file mode 100644 index 0000000..0a73ed3 --- /dev/null +++ b/packages/serverless-workflow-diagram-editor/src/i18n/index.ts @@ -0,0 +1,2 @@ +export * from "./SwdEditorI18n"; +export * from "./setup"; diff --git a/packages/serverless-workflow-diagram-editor/src/i18n/locales/en.ts b/packages/serverless-workflow-diagram-editor/src/i18n/locales/en.ts new file mode 100644 index 0000000..15ceac9 --- /dev/null +++ b/packages/serverless-workflow-diagram-editor/src/i18n/locales/en.ts @@ -0,0 +1,5 @@ +import { SwdEditorI18n } from "../SwdEditorI18n"; + +export const en: SwdEditorI18n = { + hello: "Welcome to the editor", +}; diff --git a/packages/serverless-workflow-diagram-editor/src/i18n/locales/index.ts b/packages/serverless-workflow-diagram-editor/src/i18n/locales/index.ts new file mode 100644 index 0000000..0c08df1 --- /dev/null +++ b/packages/serverless-workflow-diagram-editor/src/i18n/locales/index.ts @@ -0,0 +1 @@ +export { en } from "./en"; diff --git a/packages/serverless-workflow-diagram-editor/src/i18n/setup.ts b/packages/serverless-workflow-diagram-editor/src/i18n/setup.ts new file mode 100644 index 0000000..901dd60 --- /dev/null +++ b/packages/serverless-workflow-diagram-editor/src/i18n/setup.ts @@ -0,0 +1,19 @@ +import * as React from "react"; +import { useContext } from "react"; +import { en } from "./locales"; +import { I18nContextType } from "@serverlessworkflow/i18n/dist/react-components"; +import { SwdEditorI18n } from "./SwdEditorI18n"; +import { I18nDefaults, I18nDictionaries } from "@serverlessworkflow/i18n/dist/core"; + +export const swdEditorI18nDefaults: I18nDefaults = { + locale: "en", + dictionary: en, +}; +export const swdEditorDictionaries: I18nDictionaries = new Map([["en", en]]); +export const SwdEditorI18nContext = React.createContext>( + {} as never, +); + +export function useSwdEditorI18n(): I18nContextType { + return useContext(SwdEditorI18nContext); +} From 89fe327b8232f67e675cbf195e55f376c14015a0 Mon Sep 17 00:00:00 2001 From: kumaradityaraj Date: Wed, 1 Apr 2026 13:39:25 +0530 Subject: [PATCH 08/16] adding license Signed-off-by: kumaradityaraj --- .../src/i18n/SwdEditorI18n.ts | 16 ++++++++++++++++ .../src/i18n/index.ts | 16 ++++++++++++++++ .../src/i18n/locales/en.ts | 16 ++++++++++++++++ .../src/i18n/locales/index.ts | 16 ++++++++++++++++ .../src/i18n/setup.ts | 16 ++++++++++++++++ 5 files changed, 80 insertions(+) diff --git a/packages/serverless-workflow-diagram-editor/src/i18n/SwdEditorI18n.ts b/packages/serverless-workflow-diagram-editor/src/i18n/SwdEditorI18n.ts index bd5a07d..213b830 100644 --- a/packages/serverless-workflow-diagram-editor/src/i18n/SwdEditorI18n.ts +++ b/packages/serverless-workflow-diagram-editor/src/i18n/SwdEditorI18n.ts @@ -1,3 +1,19 @@ +/* + * Copyright 2021-Present The Serverless Workflow Specification Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import { ReferenceDictionary } from "@serverlessworkflow/i18n/dist/core"; interface SwdEditorDictionary extends ReferenceDictionary<{}> {} diff --git a/packages/serverless-workflow-diagram-editor/src/i18n/index.ts b/packages/serverless-workflow-diagram-editor/src/i18n/index.ts index 0a73ed3..16d5d38 100644 --- a/packages/serverless-workflow-diagram-editor/src/i18n/index.ts +++ b/packages/serverless-workflow-diagram-editor/src/i18n/index.ts @@ -1,2 +1,18 @@ +/* + * Copyright 2021-Present The Serverless Workflow Specification Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + export * from "./SwdEditorI18n"; export * from "./setup"; diff --git a/packages/serverless-workflow-diagram-editor/src/i18n/locales/en.ts b/packages/serverless-workflow-diagram-editor/src/i18n/locales/en.ts index 15ceac9..6f109ef 100644 --- a/packages/serverless-workflow-diagram-editor/src/i18n/locales/en.ts +++ b/packages/serverless-workflow-diagram-editor/src/i18n/locales/en.ts @@ -1,3 +1,19 @@ +/* + * Copyright 2021-Present The Serverless Workflow Specification Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import { SwdEditorI18n } from "../SwdEditorI18n"; export const en: SwdEditorI18n = { diff --git a/packages/serverless-workflow-diagram-editor/src/i18n/locales/index.ts b/packages/serverless-workflow-diagram-editor/src/i18n/locales/index.ts index 0c08df1..f55c535 100644 --- a/packages/serverless-workflow-diagram-editor/src/i18n/locales/index.ts +++ b/packages/serverless-workflow-diagram-editor/src/i18n/locales/index.ts @@ -1 +1,17 @@ +/* + * Copyright 2021-Present The Serverless Workflow Specification Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + export { en } from "./en"; diff --git a/packages/serverless-workflow-diagram-editor/src/i18n/setup.ts b/packages/serverless-workflow-diagram-editor/src/i18n/setup.ts index 901dd60..32e4d3f 100644 --- a/packages/serverless-workflow-diagram-editor/src/i18n/setup.ts +++ b/packages/serverless-workflow-diagram-editor/src/i18n/setup.ts @@ -1,3 +1,19 @@ +/* + * Copyright 2021-Present The Serverless Workflow Specification Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import * as React from "react"; import { useContext } from "react"; import { en } from "./locales"; From 6a69e43b884f0c954de04c2671bebcdf57b9f7dc Mon Sep 17 00:00:00 2001 From: kumaradityaraj Date: Wed, 1 Apr 2026 13:47:55 +0530 Subject: [PATCH 09/16] Syncing Signed-off-by: kumaradityaraj --- packages/i18n/package.json | 17 +- packages/i18n/src/TranslationProvider.tsx | 51 -- packages/i18n/src/api/I18nChannelApi.js | 16 + packages/i18n/src/api/I18nChannelApi.ts | 19 + packages/i18n/src/api/I18nEnvelopeApi.js | 16 + packages/i18n/src/api/I18nEnvelopeApi.ts | 19 + packages/i18n/src/api/index.js | 17 + packages/i18n/src/{ => api}/index.ts | 4 +- packages/i18n/src/core/Dictionary.js | 16 + packages/i18n/src/core/Dictionary.ts | 48 ++ packages/i18n/src/core/I18n.js | 49 ++ packages/i18n/src/core/I18n.ts | 61 ++ packages/i18n/src/core/Wrapped.js | 18 + packages/i18n/src/core/Wrapped.ts | 26 + packages/i18n/src/core/immutableDeepMerge.js | 36 + packages/i18n/src/core/immutableDeepMerge.ts | 51 ++ packages/i18n/src/core/index.js | 18 + packages/i18n/src/core/index.ts | 19 + packages/i18n/src/envelope/I18nService.js | 36 + packages/i18n/src/envelope/I18nService.ts | 37 + packages/i18n/src/envelope/index.js | 16 + packages/i18n/src/envelope/index.ts | 17 + packages/i18n/src/locales/en/common.json | 6 - .../i18n/src/react-components/I18nContext.js | 16 + .../i18n/src/react-components/I18nContext.ts | 24 + .../I18nDictionariesProvider.js | 42 + .../I18nDictionariesProvider.tsx | 58 ++ .../i18n/src/react-components/I18nHtml.js | 24 + .../i18n/src/react-components/I18nHtml.tsx | 30 + .../I18nWrapped.js} | 33 +- .../i18n/src/react-components/I18nWrapped.tsx | 48 ++ .../react-components/I18nWrappedTemplate.js | 34 + .../react-components/I18nWrappedTemplate.tsx | 46 ++ packages/i18n/src/react-components/index.js | 20 + packages/i18n/src/react-components/index.ts | 21 + packages/i18n/tsconfig.json | 8 +- pnpm-lock.yaml | 776 ++++++++---------- pnpm-workspace.yaml | 2 - 38 files changed, 1265 insertions(+), 530 deletions(-) delete mode 100644 packages/i18n/src/TranslationProvider.tsx create mode 100644 packages/i18n/src/api/I18nChannelApi.js create mode 100644 packages/i18n/src/api/I18nChannelApi.ts create mode 100644 packages/i18n/src/api/I18nEnvelopeApi.js create mode 100644 packages/i18n/src/api/I18nEnvelopeApi.ts create mode 100644 packages/i18n/src/api/index.js rename packages/i18n/src/{ => api}/index.ts (84%) create mode 100644 packages/i18n/src/core/Dictionary.js create mode 100644 packages/i18n/src/core/Dictionary.ts create mode 100644 packages/i18n/src/core/I18n.js create mode 100644 packages/i18n/src/core/I18n.ts create mode 100644 packages/i18n/src/core/Wrapped.js create mode 100644 packages/i18n/src/core/Wrapped.ts create mode 100644 packages/i18n/src/core/immutableDeepMerge.js create mode 100644 packages/i18n/src/core/immutableDeepMerge.ts create mode 100644 packages/i18n/src/core/index.js create mode 100644 packages/i18n/src/core/index.ts create mode 100644 packages/i18n/src/envelope/I18nService.js create mode 100644 packages/i18n/src/envelope/I18nService.ts create mode 100644 packages/i18n/src/envelope/index.js create mode 100644 packages/i18n/src/envelope/index.ts delete mode 100644 packages/i18n/src/locales/en/common.json create mode 100644 packages/i18n/src/react-components/I18nContext.js create mode 100644 packages/i18n/src/react-components/I18nContext.ts create mode 100644 packages/i18n/src/react-components/I18nDictionariesProvider.js create mode 100644 packages/i18n/src/react-components/I18nDictionariesProvider.tsx create mode 100644 packages/i18n/src/react-components/I18nHtml.js create mode 100644 packages/i18n/src/react-components/I18nHtml.tsx rename packages/i18n/src/{i18n.ts => react-components/I18nWrapped.js} (59%) create mode 100644 packages/i18n/src/react-components/I18nWrapped.tsx create mode 100644 packages/i18n/src/react-components/I18nWrappedTemplate.js create mode 100644 packages/i18n/src/react-components/I18nWrappedTemplate.tsx create mode 100644 packages/i18n/src/react-components/index.js create mode 100644 packages/i18n/src/react-components/index.ts diff --git a/packages/i18n/package.json b/packages/i18n/package.json index ce9df34..b16539d 100644 --- a/packages/i18n/package.json +++ b/packages/i18n/package.json @@ -2,31 +2,22 @@ "name": "@serverlessworkflow/i18n", "version": "1.0.0", "files": [ - "dist" + "dist", + "src" ], "type": "module", "main": "dist/index.js", - "exports": { - ".": { - "import": "./dist/index.js", - "types": "./dist/index.d.ts" - } - }, "scripts": { "clean": "rimraf ./dist", "build": "pnpm clean && tsc -p tsconfig.json", "build:prod": "pnpm run build" }, - "dependencies": { - "i18next": "catalog:", - "react-i18next": "catalog:" - }, "devDependencies": { "@types/node": "catalog:", "@types/react": "catalog:", "@types/react-dom": "catalog:", - "@types/react-i18next": "^8.1.0", - "rimraf": "catalog:" + "rimraf": "catalog:", + "typescript": "catalog:" }, "peerDependencies": { "react": "^19.0.0", diff --git a/packages/i18n/src/TranslationProvider.tsx b/packages/i18n/src/TranslationProvider.tsx deleted file mode 100644 index c733d3e..0000000 --- a/packages/i18n/src/TranslationProvider.tsx +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2021-Present The Serverless Workflow Specification Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import React, { createContext, useContext, useEffect, useState } from "react"; -import { I18nextProvider } from "react-i18next"; -import i18n from "./i18n"; - -type LanguageContextType = { - language: string; - changeLanguage: (lng: string) => void; -}; - -const LanguageContext = createContext({ - language: "en", - changeLanguage: () => {}, -}); - -export const useLanguage = () => useContext(LanguageContext); - -export function TranslationProvider({ children }: { children: React.ReactNode }) { - const [language, setLanguage] = useState(i18n.language); - - useEffect(() => { - const handler = (lng: string) => setLanguage(lng); - i18n.on("languageChanged", handler); - return () => i18n.off("languageChanged", handler); - }, []); - - const changeLanguage = (lng: string) => { - i18n.changeLanguage(lng); - }; - - return ( - - {children} - - ); -} diff --git a/packages/i18n/src/api/I18nChannelApi.js b/packages/i18n/src/api/I18nChannelApi.js new file mode 100644 index 0000000..54ffc94 --- /dev/null +++ b/packages/i18n/src/api/I18nChannelApi.js @@ -0,0 +1,16 @@ +/* + * Copyright 2021-Present The Serverless Workflow Specification Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +export {}; diff --git a/packages/i18n/src/api/I18nChannelApi.ts b/packages/i18n/src/api/I18nChannelApi.ts new file mode 100644 index 0000000..11816ca --- /dev/null +++ b/packages/i18n/src/api/I18nChannelApi.ts @@ -0,0 +1,19 @@ +/* + * Copyright 2021-Present The Serverless Workflow Specification Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface I18nChannelApi { + editorI18n_getLocale(): Promise; +} diff --git a/packages/i18n/src/api/I18nEnvelopeApi.js b/packages/i18n/src/api/I18nEnvelopeApi.js new file mode 100644 index 0000000..54ffc94 --- /dev/null +++ b/packages/i18n/src/api/I18nEnvelopeApi.js @@ -0,0 +1,16 @@ +/* + * Copyright 2021-Present The Serverless Workflow Specification Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +export {}; diff --git a/packages/i18n/src/api/I18nEnvelopeApi.ts b/packages/i18n/src/api/I18nEnvelopeApi.ts new file mode 100644 index 0000000..4af31cb --- /dev/null +++ b/packages/i18n/src/api/I18nEnvelopeApi.ts @@ -0,0 +1,19 @@ +/* + * Copyright 2021-Present The Serverless Workflow Specification Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface I18nEnvelopeApi { + editorI18n_localeChange(locale: string): void; +} diff --git a/packages/i18n/src/api/index.js b/packages/i18n/src/api/index.js new file mode 100644 index 0000000..c1972e6 --- /dev/null +++ b/packages/i18n/src/api/index.js @@ -0,0 +1,17 @@ +/* + * Copyright 2021-Present The Serverless Workflow Specification Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +export * from "./I18nChannelApi"; +export * from "./I18nEnvelopeApi"; diff --git a/packages/i18n/src/index.ts b/packages/i18n/src/api/index.ts similarity index 84% rename from packages/i18n/src/index.ts rename to packages/i18n/src/api/index.ts index bf2a23c..cf967b3 100644 --- a/packages/i18n/src/index.ts +++ b/packages/i18n/src/api/index.ts @@ -14,5 +14,5 @@ * limitations under the License. */ -export { TranslationProvider, useLanguage } from "./TranslationProvider"; -export { default as i18n } from "./i18n"; +export * from "./I18nChannelApi"; +export * from "./I18nEnvelopeApi"; diff --git a/packages/i18n/src/core/Dictionary.js b/packages/i18n/src/core/Dictionary.js new file mode 100644 index 0000000..54ffc94 --- /dev/null +++ b/packages/i18n/src/core/Dictionary.js @@ -0,0 +1,16 @@ +/* + * Copyright 2021-Present The Serverless Workflow Specification Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +export {}; diff --git a/packages/i18n/src/core/Dictionary.ts b/packages/i18n/src/core/Dictionary.ts new file mode 100644 index 0000000..bd9155b --- /dev/null +++ b/packages/i18n/src/core/Dictionary.ts @@ -0,0 +1,48 @@ +/* + * Copyright 2021-Present The Serverless Workflow Specification Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Wrapped } from "./Wrapped"; + +export interface I18nDefaults> { + locale: string; + dictionary: D; +} + +export type I18nDictionaries> = Map< + string, + TranslatedDictionary +>; + +export type DictionaryInterpolation = (...args: Array) => string; + +export type ReferenceDictionary> = { + [K in keyof D]: D[K] extends string + ? string + : D[K] extends (...args: any[]) => string + ? DictionaryInterpolation + : D[K] extends Wrapped + ? Wrapped + : D[K] extends Array> + ? Array> + : D[K] extends Record + ? ReferenceDictionary + : never; +}; + +// Locales that aren't the default should implement this interface +export type TranslatedDictionary> = DeepOptional; + +type DeepOptional = { [K in keyof D]?: DeepOptional }; diff --git a/packages/i18n/src/core/I18n.js b/packages/i18n/src/core/I18n.js new file mode 100644 index 0000000..b3cdc4f --- /dev/null +++ b/packages/i18n/src/core/I18n.js @@ -0,0 +1,49 @@ +/* + * Copyright 2021-Present The Serverless Workflow Specification Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { immutableDeepMerge } from "./immutableDeepMerge"; +export class I18n { + defaults; + dictionaries; + initialLocale; + locale; + dictionary; + constructor(defaults, dictionaries, initialLocale = defaults.locale) { + this.defaults = defaults; + this.dictionaries = dictionaries; + this.initialLocale = initialLocale; + this.locale = initialLocale; + this.updateDictionary(); + } + setLocale(locale) { + this.locale = locale; + this.updateDictionary(); + return this; + } + updateDictionary() { + const selectedDictionary = + this.dictionaries.get(this.locale) ?? + this.dictionaries.get(this.locale.split("-").shift()) ?? + {}; + this.dictionary = immutableDeepMerge(this.defaults.dictionary, selectedDictionary); + return this; + } + getCurrent() { + return this.dictionary; + } + getLocale() { + return this.locale; + } +} diff --git a/packages/i18n/src/core/I18n.ts b/packages/i18n/src/core/I18n.ts new file mode 100644 index 0000000..d0e4c9c --- /dev/null +++ b/packages/i18n/src/core/I18n.ts @@ -0,0 +1,61 @@ +/* + * Copyright 2021-Present The Serverless Workflow Specification Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { + I18nDefaults, + I18nDictionaries, + ReferenceDictionary, + TranslatedDictionary, +} from "./Dictionary"; +import { immutableDeepMerge } from "./immutableDeepMerge"; + +export class I18n> { + private locale: string; + private dictionary!: D; + + constructor( + private readonly defaults: I18nDefaults, + private readonly dictionaries: I18nDictionaries, + private readonly initialLocale = defaults.locale, + ) { + this.locale = initialLocale; + this.updateDictionary(); + } + + public setLocale(locale: string): I18n { + this.locale = locale; + this.updateDictionary(); + return this; + } + + private updateDictionary(): I18n { + const selectedDictionary = + this.dictionaries.get(this.locale) ?? + this.dictionaries.get(this.locale.split("-").shift()!) ?? + {}; + + this.dictionary = immutableDeepMerge(this.defaults.dictionary, selectedDictionary) as D; + return this; + } + + public getCurrent(): D { + return this.dictionary; + } + + public getLocale(): string { + return this.locale; + } +} diff --git a/packages/i18n/src/core/Wrapped.js b/packages/i18n/src/core/Wrapped.js new file mode 100644 index 0000000..70a029f --- /dev/null +++ b/packages/i18n/src/core/Wrapped.js @@ -0,0 +1,18 @@ +/* + * Copyright 2021-Present The Serverless Workflow Specification Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +export function wrapped(wrappedName) { + return { nameValue: wrappedName }; +} diff --git a/packages/i18n/src/core/Wrapped.ts b/packages/i18n/src/core/Wrapped.ts new file mode 100644 index 0000000..17e58da --- /dev/null +++ b/packages/i18n/src/core/Wrapped.ts @@ -0,0 +1,26 @@ +/* + * Copyright 2021-Present The Serverless Workflow Specification Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface Wrapped { + nameValue: Name; +} + +export function wrapped(wrappedName: Name): Wrapped { + return { nameValue: wrappedName }; +} + +export type ExtractWrappedComponentNames = + Component extends Wrapped ? Name : never; diff --git a/packages/i18n/src/core/immutableDeepMerge.js b/packages/i18n/src/core/immutableDeepMerge.js new file mode 100644 index 0000000..f3a7336 --- /dev/null +++ b/packages/i18n/src/core/immutableDeepMerge.js @@ -0,0 +1,36 @@ +/* + * Copyright 2021-Present The Serverless Workflow Specification Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +function deepMerge(target, source) { + Object.keys(source).forEach((key) => { + const sourceValue = source[key]; + if (!sourceValue) { + return; + } + if (typeof sourceValue === "string" || typeof sourceValue === "function") { + target[key] = sourceValue; + } else { + target[key] = deepMerge(createObjectCopy(target[key]), sourceValue); + } + }); + return target; +} +export function immutableDeepMerge(target, source) { + const targetCopy = createObjectCopy(target); + return deepMerge(targetCopy, source); +} +function createObjectCopy(obj) { + return Object.assign({}, obj); +} diff --git a/packages/i18n/src/core/immutableDeepMerge.ts b/packages/i18n/src/core/immutableDeepMerge.ts new file mode 100644 index 0000000..7a49bd3 --- /dev/null +++ b/packages/i18n/src/core/immutableDeepMerge.ts @@ -0,0 +1,51 @@ +/* + * Copyright 2021-Present The Serverless Workflow Specification Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { DictionaryInterpolation, ReferenceDictionary, TranslatedDictionary } from "./Dictionary"; + +function deepMerge>( + target: ReferenceDictionary, + source: TranslatedDictionary>, +): ReferenceDictionary { + (Object.keys(source) as Array>).forEach((key) => { + const sourceValue = source[key]; + + if (!sourceValue) { + return; + } + if (typeof sourceValue === "string" || typeof sourceValue === "function") { + target[key] = sourceValue as ReferenceDictionary[typeof key]; + } else { + target[key] = deepMerge( + createObjectCopy(target[key] as ReferenceDictionary), + sourceValue as TranslatedDictionary>, + ) as ReferenceDictionary[typeof key]; + } + }); + return target; +} + +export function immutableDeepMerge>( + target: ReferenceDictionary, + source: TranslatedDictionary>, +) { + const targetCopy = createObjectCopy(target); + return deepMerge(targetCopy, source); +} + +function createObjectCopy>(obj?: T) { + return Object.assign({} as T, obj); +} diff --git a/packages/i18n/src/core/index.js b/packages/i18n/src/core/index.js new file mode 100644 index 0000000..4fea22f --- /dev/null +++ b/packages/i18n/src/core/index.js @@ -0,0 +1,18 @@ +/* + * Copyright 2021-Present The Serverless Workflow Specification Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +export * from "./I18n"; +export * from "./Dictionary"; +export * from "./Wrapped"; diff --git a/packages/i18n/src/core/index.ts b/packages/i18n/src/core/index.ts new file mode 100644 index 0000000..ec44e83 --- /dev/null +++ b/packages/i18n/src/core/index.ts @@ -0,0 +1,19 @@ +/* + * Copyright 2021-Present The Serverless Workflow Specification Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export * from "./I18n"; +export * from "./Dictionary"; +export * from "./Wrapped"; diff --git a/packages/i18n/src/envelope/I18nService.js b/packages/i18n/src/envelope/I18nService.js new file mode 100644 index 0000000..af27270 --- /dev/null +++ b/packages/i18n/src/envelope/I18nService.js @@ -0,0 +1,36 @@ +/* + * Copyright 2021-Present The Serverless Workflow Specification Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +export class I18nService { + onLocaleChangeSubscriptions; + constructor(onLocaleChangeSubscriptions = []) { + this.onLocaleChangeSubscriptions = onLocaleChangeSubscriptions; + } + executeOnLocaleChangeSubscriptions(locale) { + this.onLocaleChangeSubscriptions.forEach((onLocaleChange) => { + onLocaleChange?.(locale); + }); + } + subscribeToLocaleChange(onLocaleChange) { + this.onLocaleChangeSubscriptions.push(onLocaleChange); + return onLocaleChange; + } + unsubscribeToLocaleChange(onLocaleChange) { + const index = this.onLocaleChangeSubscriptions.indexOf(onLocaleChange); + if (index > -1) { + this.onLocaleChangeSubscriptions.splice(index, 1); + } + } +} diff --git a/packages/i18n/src/envelope/I18nService.ts b/packages/i18n/src/envelope/I18nService.ts new file mode 100644 index 0000000..e0288c8 --- /dev/null +++ b/packages/i18n/src/envelope/I18nService.ts @@ -0,0 +1,37 @@ +/* + * Copyright 2021-Present The Serverless Workflow Specification Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export class I18nService { + constructor(private readonly onLocaleChangeSubscriptions: Array<(locale: string) => void> = []) {} + + public executeOnLocaleChangeSubscriptions(locale: string) { + this.onLocaleChangeSubscriptions.forEach((onLocaleChange) => { + onLocaleChange?.(locale); + }); + } + + public subscribeToLocaleChange(onLocaleChange: (locale: string) => void) { + this.onLocaleChangeSubscriptions.push(onLocaleChange); + return onLocaleChange; + } + + public unsubscribeToLocaleChange(onLocaleChange: (locale: string) => void) { + const index = this.onLocaleChangeSubscriptions.indexOf(onLocaleChange); + if (index > -1) { + this.onLocaleChangeSubscriptions.splice(index, 1); + } + } +} diff --git a/packages/i18n/src/envelope/index.js b/packages/i18n/src/envelope/index.js new file mode 100644 index 0000000..799a127 --- /dev/null +++ b/packages/i18n/src/envelope/index.js @@ -0,0 +1,16 @@ +/* + * Copyright 2021-Present The Serverless Workflow Specification Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +export * from "./I18nService"; diff --git a/packages/i18n/src/envelope/index.ts b/packages/i18n/src/envelope/index.ts new file mode 100644 index 0000000..fefa6cd --- /dev/null +++ b/packages/i18n/src/envelope/index.ts @@ -0,0 +1,17 @@ +/* + * Copyright 2021-Present The Serverless Workflow Specification Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export * from "./I18nService"; diff --git a/packages/i18n/src/locales/en/common.json b/packages/i18n/src/locales/en/common.json deleted file mode 100644 index 7f9d457..0000000 --- a/packages/i18n/src/locales/en/common.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "hello": "Hello", - "welcome": "Welcome to the editor", - "setup": "Setup", - "start": "Start" -} diff --git a/packages/i18n/src/react-components/I18nContext.js b/packages/i18n/src/react-components/I18nContext.js new file mode 100644 index 0000000..54ffc94 --- /dev/null +++ b/packages/i18n/src/react-components/I18nContext.js @@ -0,0 +1,16 @@ +/* + * Copyright 2021-Present The Serverless Workflow Specification Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +export {}; diff --git a/packages/i18n/src/react-components/I18nContext.ts b/packages/i18n/src/react-components/I18nContext.ts new file mode 100644 index 0000000..2ec3b1f --- /dev/null +++ b/packages/i18n/src/react-components/I18nContext.ts @@ -0,0 +1,24 @@ +/* + * Copyright 2021-Present The Serverless Workflow Specification Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import * as React from "react"; +import { ReferenceDictionary } from "../core"; + +export interface I18nContextType> { + locale: string; + setLocale: React.Dispatch; + i18n: D; +} diff --git a/packages/i18n/src/react-components/I18nDictionariesProvider.js b/packages/i18n/src/react-components/I18nDictionariesProvider.js new file mode 100644 index 0000000..620e640 --- /dev/null +++ b/packages/i18n/src/react-components/I18nDictionariesProvider.js @@ -0,0 +1,42 @@ +import { jsx as _jsx } from "react/jsx-runtime"; +/* + * Copyright 2021-Present The Serverless Workflow Specification Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import * as React from "react"; +import { useCallback, useMemo, useState } from "react"; +import { I18n } from "../core"; +export const I18nDictionariesProvider = (props) => { + const [locale, setLocale] = useState(props.initialLocale ?? props.defaults.locale); + const i18n = useMemo( + () => new I18n(props.defaults, props.dictionaries, locale), + [locale, props.defaults, props.dictionaries], + ); + const setNewLocale = useCallback( + (newLocale) => { + i18n.setLocale(newLocale); + setLocale(newLocale); + }, + [i18n], + ); + const value = useMemo( + () => ({ + locale, + setLocale: setNewLocale, + i18n: i18n.getCurrent(), + }), + [i18n, locale, setNewLocale], + ); + return _jsx(props.ctx.Provider, { value: value, children: props.children }); +}; diff --git a/packages/i18n/src/react-components/I18nDictionariesProvider.tsx b/packages/i18n/src/react-components/I18nDictionariesProvider.tsx new file mode 100644 index 0000000..9d120a7 --- /dev/null +++ b/packages/i18n/src/react-components/I18nDictionariesProvider.tsx @@ -0,0 +1,58 @@ +/* + * Copyright 2021-Present The Serverless Workflow Specification Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import * as React from "react"; +import { useCallback, useMemo, useState } from "react"; +import { I18n, I18nDefaults, I18nDictionaries, ReferenceDictionary } from "../core"; +import { I18nContextType } from "./I18nContext"; + +export interface I18nDictionariesProviderProps> { + defaults: I18nDefaults; + dictionaries: I18nDictionaries; + initialLocale?: string; + ctx: React.Context>; + children: React.ReactNode; +} + +export const I18nDictionariesProvider = >( + props: I18nDictionariesProviderProps, +) => { + const [locale, setLocale] = useState(props.initialLocale ?? props.defaults.locale); + + const i18n = useMemo( + () => new I18n(props.defaults, props.dictionaries, locale), + [locale, props.defaults, props.dictionaries], + ); + + const setNewLocale = useCallback( + (newLocale: string) => { + i18n.setLocale(newLocale); + setLocale(newLocale); + }, + [i18n], + ); + + const value = useMemo( + () => ({ + locale, + setLocale: setNewLocale, + i18n: i18n.getCurrent(), + }), + [i18n, locale, setNewLocale], + ); + + return {props.children}; +}; diff --git a/packages/i18n/src/react-components/I18nHtml.js b/packages/i18n/src/react-components/I18nHtml.js new file mode 100644 index 0000000..849d80e --- /dev/null +++ b/packages/i18n/src/react-components/I18nHtml.js @@ -0,0 +1,24 @@ +import { jsx as _jsx } from "react/jsx-runtime"; +/* + * Copyright 2021-Present The Serverless Workflow Specification Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import * as React from "react"; +export const I18nHtml = ({ children }) => { + let htmlText = children; + if (Array.isArray(htmlText)) { + htmlText = htmlText.join(""); + } + return _jsx("p", { style: { display: "inline" }, dangerouslySetInnerHTML: { __html: htmlText } }); +}; diff --git a/packages/i18n/src/react-components/I18nHtml.tsx b/packages/i18n/src/react-components/I18nHtml.tsx new file mode 100644 index 0000000..d534988 --- /dev/null +++ b/packages/i18n/src/react-components/I18nHtml.tsx @@ -0,0 +1,30 @@ +/* + * Copyright 2021-Present The Serverless Workflow Specification Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import * as React from "react"; +import { FunctionComponent } from "react"; + +interface Props { + children: string | string[]; +} + +export const I18nHtml: FunctionComponent = ({ children }) => { + let htmlText = children; + if (Array.isArray(htmlText)) { + htmlText = htmlText.join(""); + } + return

; +}; diff --git a/packages/i18n/src/i18n.ts b/packages/i18n/src/react-components/I18nWrapped.js similarity index 59% rename from packages/i18n/src/i18n.ts rename to packages/i18n/src/react-components/I18nWrapped.js index 4d93afa..9d8583d 100644 --- a/packages/i18n/src/i18n.ts +++ b/packages/i18n/src/react-components/I18nWrapped.js @@ -1,3 +1,4 @@ +import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime"; /* * Copyright 2021-Present The Serverless Workflow Specification Authors * @@ -13,28 +14,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - -import i18n from "i18next"; -import { initReactI18next } from "react-i18next"; - -import en from "./locales/en/common.json"; - -if (!i18n.isInitialized) { - i18n.use(initReactI18next).init({ - resources: { - en: { common: en }, - }, - lng: "en", - fallbackLng: "en", - ns: ["common"], - defaultNS: "common", - interpolation: { - escapeValue: false, - }, - react: { - useSuspense: false, - }, +import * as React from "react"; +export function I18nWrapped(props) { + return _jsx(_Fragment, { + children: Object.values(props.children).map((piece) => { + if (typeof piece === "string" || typeof piece === "number") { + return piece; + } + return props.components?.[piece.name]; + }), }); } - -export default i18n; diff --git a/packages/i18n/src/react-components/I18nWrapped.tsx b/packages/i18n/src/react-components/I18nWrapped.tsx new file mode 100644 index 0000000..5e57212 --- /dev/null +++ b/packages/i18n/src/react-components/I18nWrapped.tsx @@ -0,0 +1,48 @@ +/* + * Copyright 2021-Present The Serverless Workflow Specification Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import * as React from "react"; +import { ExtractWrappedComponentNames, Wrapped } from "../core"; + +type Components> = { + [K in ExtractWrappedComponentNames]: React.ReactNode; +}; + +interface ComponentChildren { + [x: number]: string | number | Component; +} + +interface Children { + [x: number]: string | number; +} + +interface Props { + components: Component extends Wrapped ? Components : undefined; + children: Component extends Wrapped ? ComponentChildren : Children; +} + +export function I18nWrapped(props: Props) { + return ( + <> + {Object.values(props.children).map((piece: any) => { + if (typeof piece === "string" || typeof piece === "number") { + return piece; + } + return props.components?.[piece.name as ExtractWrappedComponentNames]; + })} + + ); +} diff --git a/packages/i18n/src/react-components/I18nWrappedTemplate.js b/packages/i18n/src/react-components/I18nWrappedTemplate.js new file mode 100644 index 0000000..4c3f87a --- /dev/null +++ b/packages/i18n/src/react-components/I18nWrappedTemplate.js @@ -0,0 +1,34 @@ +import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime"; +/* + * Copyright 2021-Present The Serverless Workflow Specification Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import * as React from "react"; +// component to replace placeholders in text with React components +export const I18nWrappedTemplate = ({ text, interpolationMap }) => { + // Matches {key} where key is one of the placeholder keys + const interpolationMapRegex = new RegExp( + `\\{(${Object.keys(interpolationMap).join("|")})\\}`, + "g", + ); + return _jsx(_Fragment, { + children: text + .split(interpolationMapRegex) + .map((value, i) => + value in interpolationMap + ? _jsx(React.Fragment, { children: interpolationMap[value] }, i) + : value, + ), + }); +}; diff --git a/packages/i18n/src/react-components/I18nWrappedTemplate.tsx b/packages/i18n/src/react-components/I18nWrappedTemplate.tsx new file mode 100644 index 0000000..af78dc2 --- /dev/null +++ b/packages/i18n/src/react-components/I18nWrappedTemplate.tsx @@ -0,0 +1,46 @@ +/* + * Copyright 2021-Present The Serverless Workflow Specification Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import * as React from "react"; + +// component to replace placeholders in text with React components +export const I18nWrappedTemplate = ({ + text, + interpolationMap, +}: { + text: string; + interpolationMap: Record; +}) => { + // Matches {key} where key is one of the placeholder keys + const interpolationMapRegex = new RegExp( + `\\{(${Object.keys(interpolationMap).join("|")})\\}`, + "g", + ); + + return ( + <> + {text + .split(interpolationMapRegex) + .map((value, i) => + value in interpolationMap ? ( + {interpolationMap[value]} + ) : ( + value + ), + )} + + ); +}; diff --git a/packages/i18n/src/react-components/index.js b/packages/i18n/src/react-components/index.js new file mode 100644 index 0000000..d273bb5 --- /dev/null +++ b/packages/i18n/src/react-components/index.js @@ -0,0 +1,20 @@ +/* + * Copyright 2021-Present The Serverless Workflow Specification Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +export * from "./I18nContext"; +export * from "./I18nDictionariesProvider"; +export * from "./I18nHtml"; +export * from "./I18nWrapped"; +export * from "./I18nWrappedTemplate"; diff --git a/packages/i18n/src/react-components/index.ts b/packages/i18n/src/react-components/index.ts new file mode 100644 index 0000000..16ad12c --- /dev/null +++ b/packages/i18n/src/react-components/index.ts @@ -0,0 +1,21 @@ +/* + * Copyright 2021-Present The Serverless Workflow Specification Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export * from "./I18nContext"; +export * from "./I18nDictionariesProvider"; +export * from "./I18nHtml"; +export * from "./I18nWrapped"; +export * from "./I18nWrappedTemplate"; diff --git a/packages/i18n/tsconfig.json b/packages/i18n/tsconfig.json index 8d11274..e8a91ff 100644 --- a/packages/i18n/tsconfig.json +++ b/packages/i18n/tsconfig.json @@ -5,7 +5,11 @@ "outDir": "dist", "rootDir": "src", "declaration": true, - "emitDeclarationOnly": false + "emitDeclarationOnly": false, + "paths": { + "@serverlessworkflow/i18n": ["./i18n/src"] + } }, - "include": ["src"] + "include": ["src"], + "exclude": ["node_modules", "dist"] } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 83cf6d5..58d1a3d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8,7 +8,7 @@ catalogs: default: '@chromatic-com/storybook': specifier: ^5.0.1 - version: 5.0.2 + version: 5.1.1 '@storybook/addon-a11y': specifier: ^10.2.19 version: 10.3.3 @@ -44,16 +44,13 @@ catalogs: version: 19.2.3 '@vitest/coverage-v8': specifier: ^4.1.0 - version: 4.1.1 + version: 4.1.2 '@vitest/ui': specifier: ^4.1.0 - version: 4.1.1 + version: 4.1.2 husky: specifier: ^9.1.7 version: 9.1.7 - i18next: - specifier: ^25.10.9 - version: 25.10.9 jsdom: specifier: ^25.0.0 version: 25.0.1 @@ -65,16 +62,13 @@ catalogs: version: 0.41.0 oxlint: specifier: ^1.56.0 - version: 1.56.0 + version: 1.58.0 react: specifier: ^19.2.4 version: 19.2.4 react-dom: specifier: ^19.2.4 version: 19.2.4 - react-i18next: - specifier: ^16.6.6 - version: 16.6.6 rimraf: specifier: ^6.1.3 version: 6.1.3 @@ -83,7 +77,7 @@ catalogs: version: 10.3.3 syncpack: specifier: ^14.2.0 - version: 14.2.1 + version: 14.3.0 typescript: specifier: ^5.9.3 version: 5.9.3 @@ -95,7 +89,7 @@ catalogs: version: 6.1.1 vitest: specifier: ^4.1.0 - version: 4.1.1 + version: 4.1.2 importers: @@ -112,25 +106,19 @@ importers: version: 0.41.0 syncpack: specifier: 'catalog:' - version: 14.2.1 + version: 14.3.0 typescript: specifier: 'catalog:' version: 5.9.3 packages/i18n: dependencies: - i18next: - specifier: 'catalog:' - version: 25.10.9(typescript@5.9.3) react: specifier: ^19.0.0 version: 19.2.4 react-dom: specifier: ^19.0.0 version: 19.2.4(react@19.2.4) - react-i18next: - specifier: 'catalog:' - version: 16.6.6(i18next@25.10.9(typescript@5.9.3))(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(typescript@5.9.3) devDependencies: '@types/node': specifier: 'catalog:' @@ -141,40 +129,34 @@ importers: '@types/react-dom': specifier: 'catalog:' version: 19.2.3(@types/react@19.2.14) - '@types/react-i18next': - specifier: ^8.1.0 - version: 8.1.0(i18next@25.10.9(typescript@5.9.3))(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(typescript@5.9.3) rimraf: specifier: 'catalog:' version: 6.1.3 + typescript: + specifier: 'catalog:' + version: 5.9.3 packages/serverless-workflow-diagram-editor: dependencies: '@serverlessworkflow/i18n': specifier: workspace:* version: link:../i18n - i18next: - specifier: 'catalog:' - version: 25.10.9(typescript@5.9.3) - react-i18next: - specifier: 'catalog:' - version: 16.6.6(i18next@25.10.9(typescript@5.9.3))(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(typescript@5.9.3) devDependencies: '@chromatic-com/storybook': specifier: 'catalog:' - version: 5.0.2(storybook@10.3.3(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)) + version: 5.1.1(storybook@10.3.3(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)) '@storybook/addon-a11y': specifier: 'catalog:' version: 10.3.3(storybook@10.3.3(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)) '@storybook/addon-docs': specifier: 'catalog:' - version: 10.3.3(@types/react@19.2.14)(esbuild@0.27.4)(rollup@4.60.0)(storybook@10.3.3(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4))(vite@6.4.1(@types/node@25.5.0)(yaml@2.8.3)) + version: 10.3.3(@types/react@19.2.14)(esbuild@0.27.4)(rollup@4.60.1)(storybook@10.3.3(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4))(vite@6.4.1(@types/node@25.5.0)(yaml@2.8.3)) '@storybook/addon-vitest': specifier: 'catalog:' - version: 10.3.3(@vitest/runner@4.1.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(storybook@10.3.3(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4))(vitest@4.1.1) + version: 10.3.3(@vitest/runner@4.1.2)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(storybook@10.3.3(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4))(vitest@4.1.2) '@storybook/react-vite': specifier: 'catalog:' - version: 10.3.3(esbuild@0.27.4)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(rollup@4.60.0)(storybook@10.3.3(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4))(typescript@5.9.3)(vite@6.4.1(@types/node@25.5.0)(yaml@2.8.3)) + version: 10.3.3(esbuild@0.27.4)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(rollup@4.60.1)(storybook@10.3.3(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4))(typescript@5.9.3)(vite@6.4.1(@types/node@25.5.0)(yaml@2.8.3)) '@testing-library/dom': specifier: 'catalog:' version: 10.4.1 @@ -198,10 +180,10 @@ importers: version: 19.2.3(@types/react@19.2.14) '@vitest/coverage-v8': specifier: 'catalog:' - version: 4.1.1(vitest@4.1.1) + version: 4.1.2(vitest@4.1.2) '@vitest/ui': specifier: 'catalog:' - version: 4.1.1(vitest@4.1.1) + version: 4.1.2(vitest@4.1.2) jsdom: specifier: 'catalog:' version: 25.0.1 @@ -210,7 +192,7 @@ importers: version: 0.41.0 oxlint: specifier: 'catalog:' - version: 1.56.0 + version: 1.58.0 react: specifier: 'catalog:' version: 19.2.4 @@ -231,7 +213,7 @@ importers: version: 6.1.1(typescript@5.9.3)(vite@6.4.1(@types/node@25.5.0)(yaml@2.8.3)) vitest: specifier: 'catalog:' - version: 4.1.1(@types/node@25.5.0)(@vitest/ui@4.1.1)(jsdom@25.0.1)(vite@6.4.1(@types/node@25.5.0)(yaml@2.8.3)) + version: 4.1.2(@types/node@25.5.0)(@vitest/ui@4.1.2)(jsdom@25.0.1)(vite@6.4.1(@types/node@25.5.0)(yaml@2.8.3)) packages: @@ -316,8 +298,8 @@ packages: resolution: {integrity: sha512-6zABk/ECA/QYSCQ1NGiVwwbQerUCZ+TQbp64Q3AgmfNvurHH0j8TtXa1qbShXA6qqkpAj4V5W8pP6mLe1mcMqA==} engines: {node: '>=18'} - '@chromatic-com/storybook@5.0.2': - resolution: {integrity: sha512-uLd5gyvcz8q83GI0rYWjml45ryO3ZJwZLretLEZvWFJ3UlFk5C5Km9cwRcKZgZp0F3zYwbb8nEe6PJdgA1eKxg==} + '@chromatic-com/storybook@5.1.1': + resolution: {integrity: sha512-BPoAXHM71XgeCK2u0jKr9i8apeQMm/Z9IWGyndA2FMijfQG9m8ox45DdWh/pxFkK5ClhGgirv5QwMhFIeHmThg==} engines: {node: '>=20.0.0', yarn: '>=1.22.18'} peerDependencies: storybook: ^0.0.0-0 || ^10.1.0 || ^10.1.0-0 || ^10.2.0-0 || ^10.3.0-0 || ^10.4.0-0 @@ -818,124 +800,124 @@ packages: cpu: [x64] os: [win32] - '@oxlint/binding-android-arm-eabi@1.56.0': - resolution: {integrity: sha512-IyfYPthZyiSKwAv/dLjeO18SaK8MxLI9Yss2JrRDyweQAkuL3LhEy7pwIwI7uA3KQc1Vdn20kdmj3q0oUIQL6A==} + '@oxlint/binding-android-arm-eabi@1.58.0': + resolution: {integrity: sha512-1T7UN3SsWWxpWyWGn1cT3ASNJOo+pI3eUkmEl7HgtowapcV8kslYpFQcYn431VuxghXakPNlbjRwhqmR37PFOg==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm] os: [android] - '@oxlint/binding-android-arm64@1.56.0': - resolution: {integrity: sha512-Ga5zYrzH6vc/VFxhn6MmyUnYEfy9vRpwTIks99mY3j6Nz30yYpIkWryI0QKPCgvGUtDSXVLEaMum5nA+WrNOSg==} + '@oxlint/binding-android-arm64@1.58.0': + resolution: {integrity: sha512-GryzujxuiRv2YFF7bRy8mKcxlbuAN+euVUtGJt9KKbLT8JBUIosamVhcthLh+VEr6KE6cjeVMAQxKAzJcoN7dg==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [android] - '@oxlint/binding-darwin-arm64@1.56.0': - resolution: {integrity: sha512-ogmbdJysnw/D4bDcpf1sPLpFThZ48lYp4aKYm10Z/6Nh1SON6NtnNhTNOlhEY296tDFItsZUz+2tgcSYqh8Eyw==} + '@oxlint/binding-darwin-arm64@1.58.0': + resolution: {integrity: sha512-7/bRSJIwl4GxeZL9rPZ11anNTyUO9epZrfEJH/ZMla3+/gbQ6xZixh9nOhsZ0QwsTW7/5J2A/fHbD1udC5DQQA==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [darwin] - '@oxlint/binding-darwin-x64@1.56.0': - resolution: {integrity: sha512-x8QE1h+RAtQ2g+3KPsP6Fk/tdz6zJQUv5c7fTrJxXV3GHOo+Ry5p/PsogU4U+iUZg0rj6hS+E4xi+mnwwlDCWQ==} + '@oxlint/binding-darwin-x64@1.58.0': + resolution: {integrity: sha512-EqdtJSiHweS2vfILNrpyJ6HUwpEq2g7+4Zx1FPi4hu3Hu7tC3znF6ufbXO8Ub2LD4mGgznjI7kSdku9NDD1Mkg==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [darwin] - '@oxlint/binding-freebsd-x64@1.56.0': - resolution: {integrity: sha512-6G+WMZvwJpMvY7my+/SHEjb7BTk/PFbePqLpmVmUJRIsJMy/UlyYqjpuh0RCgYYkPLcnXm1rUM04kbTk8yS1Yg==} + '@oxlint/binding-freebsd-x64@1.58.0': + resolution: {integrity: sha512-VQt5TH4M42mY20F545G637RKxV/yjwVtKk2vfXuazfReSIiuvWBnv+FVSvIV5fKVTJNjt3GSJibh6JecbhGdBw==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [freebsd] - '@oxlint/binding-linux-arm-gnueabihf@1.56.0': - resolution: {integrity: sha512-YYHBsk/sl7fYwQOok+6W5lBPeUEvisznV/HZD2IfZmF3Bns6cPC3Z0vCtSEOaAWTjYWN3jVsdu55jMxKlsdlhg==} + '@oxlint/binding-linux-arm-gnueabihf@1.58.0': + resolution: {integrity: sha512-fBYcj4ucwpAtjJT3oeBdFBYKvNyjRSK+cyuvBOTQjh0jvKp4yeA4S/D0IsCHus/VPaNG5L48qQkh+Vjy3HL2/Q==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm] os: [linux] - '@oxlint/binding-linux-arm-musleabihf@1.56.0': - resolution: {integrity: sha512-+AZK8rOUr78y8WT6XkDb04IbMRqauNV+vgT6f8ZLOH8wnpQ9i7Nol0XLxAu+Cq7Sb+J9wC0j6Km5hG8rj47/yQ==} + '@oxlint/binding-linux-arm-musleabihf@1.58.0': + resolution: {integrity: sha512-0BeuFfwlUHlJ1xpEdSD1YO3vByEFGPg36uLjK1JgFaxFb4W6w17F8ET8sz5cheZ4+x5f2xzdnRrrWv83E3Yd8g==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm] os: [linux] - '@oxlint/binding-linux-arm64-gnu@1.56.0': - resolution: {integrity: sha512-urse2SnugwJRojUkGSSeH2LPMaje5Q50yQtvtL9HFckiyeqXzoFwOAZqD5TR29R2lq7UHidfFDM9EGcchcbb8A==} + '@oxlint/binding-linux-arm64-gnu@1.58.0': + resolution: {integrity: sha512-TXlZgnPTlxrQzxG9ZXU7BNwx1Ilrr17P3GwZY0If2EzrinqRH3zXPc3HrRcBJgcsoZNMuNL5YivtkJYgp467UQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] libc: [glibc] - '@oxlint/binding-linux-arm64-musl@1.56.0': - resolution: {integrity: sha512-rkTZkBfJ4TYLjansjSzL6mgZOdN5IvUnSq3oNJSLwBcNvy3dlgQtpHPrRxrCEbbcp7oQ6If0tkNaqfOsphYZ9g==} + '@oxlint/binding-linux-arm64-musl@1.58.0': + resolution: {integrity: sha512-zSoYRo5dxHLcUx93Stl2hW3hSNjPt99O70eRVWt5A1zwJ+FPjeCCANCD2a9R4JbHsdcl11TIQOjyigcRVOH2mw==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] libc: [musl] - '@oxlint/binding-linux-ppc64-gnu@1.56.0': - resolution: {integrity: sha512-uqL1kMH3u69/e1CH2EJhP3CP28jw2ExLsku4o8RVAZ7fySo9zOyI2fy9pVlTAp4voBLVgzndXi3SgtdyCTa2aA==} + '@oxlint/binding-linux-ppc64-gnu@1.58.0': + resolution: {integrity: sha512-NQ0U/lqxH2/VxBYeAIvMNUK1y0a1bJ3ZicqkF2c6wfakbEciP9jvIE4yNzCFpZaqeIeRYaV7AVGqEO1yrfVPjA==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [ppc64] os: [linux] libc: [glibc] - '@oxlint/binding-linux-riscv64-gnu@1.56.0': - resolution: {integrity: sha512-j0CcMBOgV6KsRaBdsebIeiy7hCjEvq2KdEsiULf2LZqAq0v1M1lWjelhCV57LxsqaIGChXFuFJ0RiFrSRHPhSg==} + '@oxlint/binding-linux-riscv64-gnu@1.58.0': + resolution: {integrity: sha512-X9J+kr3gIC9FT8GuZt0ekzpNUtkBVzMVU4KiKDSlocyQuEgi3gBbXYN8UkQiV77FTusLDPsovjo95YedHr+3yg==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [riscv64] os: [linux] libc: [glibc] - '@oxlint/binding-linux-riscv64-musl@1.56.0': - resolution: {integrity: sha512-7VDOiL8cDG3DQ/CY3yKjbV1c4YPvc4vH8qW09Vv+5ukq3l/Kcyr6XGCd5NvxUmxqDb2vjMpM+eW/4JrEEsUetA==} + '@oxlint/binding-linux-riscv64-musl@1.58.0': + resolution: {integrity: sha512-CDze3pi1OO3Wvb/QsXjmLEY4XPKGM6kIo82ssNOgmcl1IdndF9VSGAE38YLhADWmOac7fjqhBw82LozuUVxD0Q==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [riscv64] os: [linux] libc: [musl] - '@oxlint/binding-linux-s390x-gnu@1.56.0': - resolution: {integrity: sha512-JGRpX0M+ikD3WpwJ7vKcHKV6Kg0dT52BW2Eu2BupXotYeqGXBrbY+QPkAyKO6MNgKozyTNaRh3r7g+VWgyAQYQ==} + '@oxlint/binding-linux-s390x-gnu@1.58.0': + resolution: {integrity: sha512-b/89glbxFaEAcA6Uf1FvCNecBJEgcUTsV1quzrqXM/o4R1M4u+2KCVuyGCayN2UpsRWtGGLb+Ver0tBBpxaPog==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [s390x] os: [linux] libc: [glibc] - '@oxlint/binding-linux-x64-gnu@1.56.0': - resolution: {integrity: sha512-dNaICPvtmuxFP/VbqdofrLqdS3bM/AKJN3LMJD52si44ea7Be1cBk6NpfIahaysG9Uo+L98QKddU9CD5L8UHnQ==} + '@oxlint/binding-linux-x64-gnu@1.58.0': + resolution: {integrity: sha512-0/yYpkq9VJFCEcuRlrViGj8pJUFFvNS4EkEREaN7CB1EcLXJIaVSSa5eCihwBGXtOZxhnblWgxks9juRdNQI7w==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] libc: [glibc] - '@oxlint/binding-linux-x64-musl@1.56.0': - resolution: {integrity: sha512-pF1vOtM+GuXmbklM1hV8WMsn6tCNPvkUzklj/Ej98JhlanbmA2RB1BILgOpwSuCTRTIYx2MXssmEyQQ90QF5aA==} + '@oxlint/binding-linux-x64-musl@1.58.0': + resolution: {integrity: sha512-hr6FNvmcAXiH+JxSvaJ4SJ1HofkdqEElXICW9sm3/Rd5eC3t7kzvmLyRAB3NngKO2wzXRCAm4Z/mGWfrsS4X8w==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] libc: [musl] - '@oxlint/binding-openharmony-arm64@1.56.0': - resolution: {integrity: sha512-bp8NQ4RE6fDIFLa4bdBiOA+TAvkNkg+rslR+AvvjlLTYXLy9/uKAYLQudaQouWihLD/hgkrXIKKzXi5IXOewwg==} + '@oxlint/binding-openharmony-arm64@1.58.0': + resolution: {integrity: sha512-R+O368VXgRql1K6Xar+FEo7NEwfo13EibPMoTv3sesYQedRXd6m30Dh/7lZMxnrQVFfeo4EOfYIP4FpcgWQNHg==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [openharmony] - '@oxlint/binding-win32-arm64-msvc@1.56.0': - resolution: {integrity: sha512-PxT4OJDfMOQBzo3OlzFb9gkoSD+n8qSBxyVq2wQSZIHFQYGEqIRTo9M0ZStvZm5fdhMqaVYpOnJvH2hUMEDk/g==} + '@oxlint/binding-win32-arm64-msvc@1.58.0': + resolution: {integrity: sha512-Q0FZiAY/3c4YRj4z3h9K1PgaByrifrfbBoODSeX7gy97UtB7pySPUQfC2B/GbxWU6k7CzQrRy5gME10PltLAFQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [win32] - '@oxlint/binding-win32-ia32-msvc@1.56.0': - resolution: {integrity: sha512-PTRy6sIEPqy2x8PTP1baBNReN/BNEFmde0L+mYeHmjXE1Vlcc9+I5nsqENsB2yAm5wLkzPoTNCMY/7AnabT4/A==} + '@oxlint/binding-win32-ia32-msvc@1.58.0': + resolution: {integrity: sha512-Y8FKBABrSPp9H0QkRLHDHOSUgM/309a3IvOVgPcVxYcX70wxJrk608CuTg7w+C6vEd724X5wJoNkBcGYfH7nNQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [ia32] os: [win32] - '@oxlint/binding-win32-x64-msvc@1.56.0': - resolution: {integrity: sha512-ZHa0clocjLmIDr+1LwoWtxRcoYniAvERotvwKUYKhH41NVfl0Y4LNbyQkwMZzwDvKklKGvGZ5+DAG58/Ik47tQ==} + '@oxlint/binding-win32-x64-msvc@1.58.0': + resolution: {integrity: sha512-bCn5rbiz5My+Bj7M09sDcnqW0QJyINRVxdZ65x1/Y2tGrMwherwK/lpk+HRQCKvXa8pcaQdF5KY5j54VGZLwNg==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [win32] @@ -952,141 +934,141 @@ packages: rollup: optional: true - '@rollup/rollup-android-arm-eabi@4.60.0': - resolution: {integrity: sha512-WOhNW9K8bR3kf4zLxbfg6Pxu2ybOUbB2AjMDHSQx86LIF4rH4Ft7vmMwNt0loO0eonglSNy4cpD3MKXXKQu0/A==} + '@rollup/rollup-android-arm-eabi@4.60.1': + resolution: {integrity: sha512-d6FinEBLdIiK+1uACUttJKfgZREXrF0Qc2SmLII7W2AD8FfiZ9Wjd+rD/iRuf5s5dWrr1GgwXCvPqOuDquOowA==} cpu: [arm] os: [android] - '@rollup/rollup-android-arm64@4.60.0': - resolution: {integrity: sha512-u6JHLll5QKRvjciE78bQXDmqRqNs5M/3GVqZeMwvmjaNODJih/WIrJlFVEihvV0MiYFmd+ZyPr9wxOVbPAG2Iw==} + '@rollup/rollup-android-arm64@4.60.1': + resolution: {integrity: sha512-YjG/EwIDvvYI1YvYbHvDz/BYHtkY4ygUIXHnTdLhG+hKIQFBiosfWiACWortsKPKU/+dUwQQCKQM3qrDe8c9BA==} cpu: [arm64] os: [android] - '@rollup/rollup-darwin-arm64@4.60.0': - resolution: {integrity: sha512-qEF7CsKKzSRc20Ciu2Zw1wRrBz4g56F7r/vRwY430UPp/nt1x21Q/fpJ9N5l47WWvJlkNCPJz3QRVw008fi7yA==} + '@rollup/rollup-darwin-arm64@4.60.1': + resolution: {integrity: sha512-mjCpF7GmkRtSJwon+Rq1N8+pI+8l7w5g9Z3vWj4T7abguC4Czwi3Yu/pFaLvA3TTeMVjnu3ctigusqWUfjZzvw==} cpu: [arm64] os: [darwin] - '@rollup/rollup-darwin-x64@4.60.0': - resolution: {integrity: sha512-WADYozJ4QCnXCH4wPB+3FuGmDPoFseVCUrANmA5LWwGmC6FL14BWC7pcq+FstOZv3baGX65tZ378uT6WG8ynTw==} + '@rollup/rollup-darwin-x64@4.60.1': + resolution: {integrity: sha512-haZ7hJ1JT4e9hqkoT9R/19XW2QKqjfJVv+i5AGg57S+nLk9lQnJ1F/eZloRO3o9Scy9CM3wQ9l+dkXtcBgN5Ew==} cpu: [x64] os: [darwin] - '@rollup/rollup-freebsd-arm64@4.60.0': - resolution: {integrity: sha512-6b8wGHJlDrGeSE3aH5mGNHBjA0TTkxdoNHik5EkvPHCt351XnigA4pS7Wsj/Eo9Y8RBU6f35cjN9SYmCFBtzxw==} + '@rollup/rollup-freebsd-arm64@4.60.1': + resolution: {integrity: sha512-czw90wpQq3ZsAVBlinZjAYTKduOjTywlG7fEeWKUA7oCmpA8xdTkxZZlwNJKWqILlq0wehoZcJYfBvOyhPTQ6w==} cpu: [arm64] os: [freebsd] - '@rollup/rollup-freebsd-x64@4.60.0': - resolution: {integrity: sha512-h25Ga0t4jaylMB8M/JKAyrvvfxGRjnPQIR8lnCayyzEjEOx2EJIlIiMbhpWxDRKGKF8jbNH01NnN663dH638mA==} + '@rollup/rollup-freebsd-x64@4.60.1': + resolution: {integrity: sha512-KVB2rqsxTHuBtfOeySEyzEOB7ltlB/ux38iu2rBQzkjbwRVlkhAGIEDiiYnO2kFOkJp+Z7pUXKyrRRFuFUKt+g==} cpu: [x64] os: [freebsd] - '@rollup/rollup-linux-arm-gnueabihf@4.60.0': - resolution: {integrity: sha512-RzeBwv0B3qtVBWtcuABtSuCzToo2IEAIQrcyB/b2zMvBWVbjo8bZDjACUpnaafaxhTw2W+imQbP2BD1usasK4g==} + '@rollup/rollup-linux-arm-gnueabihf@4.60.1': + resolution: {integrity: sha512-L+34Qqil+v5uC0zEubW7uByo78WOCIrBvci69E7sFASRl0X7b/MB6Cqd1lky/CtcSVTydWa2WZwFuWexjS5o6g==} cpu: [arm] os: [linux] libc: [glibc] - '@rollup/rollup-linux-arm-musleabihf@4.60.0': - resolution: {integrity: sha512-Sf7zusNI2CIU1HLzuu9Tc5YGAHEZs5Lu7N1ssJG4Tkw6e0MEsN7NdjUDDfGNHy2IU+ENyWT+L2obgWiguWibWQ==} + '@rollup/rollup-linux-arm-musleabihf@4.60.1': + resolution: {integrity: sha512-n83O8rt4v34hgFzlkb1ycniJh7IR5RCIqt6mz1VRJD6pmhRi0CXdmfnLu9dIUS6buzh60IvACM842Ffb3xd6Gg==} cpu: [arm] os: [linux] libc: [musl] - '@rollup/rollup-linux-arm64-gnu@4.60.0': - resolution: {integrity: sha512-DX2x7CMcrJzsE91q7/O02IJQ5/aLkVtYFryqCjduJhUfGKG6yJV8hxaw8pZa93lLEpPTP/ohdN4wFz7yp/ry9A==} + '@rollup/rollup-linux-arm64-gnu@4.60.1': + resolution: {integrity: sha512-Nql7sTeAzhTAja3QXeAI48+/+GjBJ+QmAH13snn0AJSNL50JsDqotyudHyMbO2RbJkskbMbFJfIJKWA6R1LCJQ==} cpu: [arm64] os: [linux] libc: [glibc] - '@rollup/rollup-linux-arm64-musl@4.60.0': - resolution: {integrity: sha512-09EL+yFVbJZlhcQfShpswwRZ0Rg+z/CsSELFCnPt3iK+iqwGsI4zht3secj5vLEs957QvFFXnzAT0FFPIxSrkQ==} + '@rollup/rollup-linux-arm64-musl@4.60.1': + resolution: {integrity: sha512-+pUymDhd0ys9GcKZPPWlFiZ67sTWV5UU6zOJat02M1+PiuSGDziyRuI/pPue3hoUwm2uGfxdL+trT6Z9rxnlMA==} cpu: [arm64] os: [linux] libc: [musl] - '@rollup/rollup-linux-loong64-gnu@4.60.0': - resolution: {integrity: sha512-i9IcCMPr3EXm8EQg5jnja0Zyc1iFxJjZWlb4wr7U2Wx/GrddOuEafxRdMPRYVaXjgbhvqalp6np07hN1w9kAKw==} + '@rollup/rollup-linux-loong64-gnu@4.60.1': + resolution: {integrity: sha512-VSvgvQeIcsEvY4bKDHEDWcpW4Yw7BtlKG1GUT4FzBUlEKQK0rWHYBqQt6Fm2taXS+1bXvJT6kICu5ZwqKCnvlQ==} cpu: [loong64] os: [linux] libc: [glibc] - '@rollup/rollup-linux-loong64-musl@4.60.0': - resolution: {integrity: sha512-DGzdJK9kyJ+B78MCkWeGnpXJ91tK/iKA6HwHxF4TAlPIY7GXEvMe8hBFRgdrR9Ly4qebR/7gfUs9y2IoaVEyog==} + '@rollup/rollup-linux-loong64-musl@4.60.1': + resolution: {integrity: sha512-4LqhUomJqwe641gsPp6xLfhqWMbQV04KtPp7/dIp0nzPxAkNY1AbwL5W0MQpcalLYk07vaW9Kp1PBhdpZYYcEw==} cpu: [loong64] os: [linux] libc: [musl] - '@rollup/rollup-linux-ppc64-gnu@4.60.0': - resolution: {integrity: sha512-RwpnLsqC8qbS8z1H1AxBA1H6qknR4YpPR9w2XX0vo2Sz10miu57PkNcnHVaZkbqyw/kUWfKMI73jhmfi9BRMUQ==} + '@rollup/rollup-linux-ppc64-gnu@4.60.1': + resolution: {integrity: sha512-tLQQ9aPvkBxOc/EUT6j3pyeMD6Hb8QF2BTBnCQWP/uu1lhc9AIrIjKnLYMEroIz/JvtGYgI9dF3AxHZNaEH0rw==} cpu: [ppc64] os: [linux] libc: [glibc] - '@rollup/rollup-linux-ppc64-musl@4.60.0': - resolution: {integrity: sha512-Z8pPf54Ly3aqtdWC3G4rFigZgNvd+qJlOE52fmko3KST9SoGfAdSRCwyoyG05q1HrrAblLbk1/PSIV+80/pxLg==} + '@rollup/rollup-linux-ppc64-musl@4.60.1': + resolution: {integrity: sha512-RMxFhJwc9fSXP6PqmAz4cbv3kAyvD1etJFjTx4ONqFP9DkTkXsAMU4v3Vyc5BgzC+anz7nS/9tp4obsKfqkDHg==} cpu: [ppc64] os: [linux] libc: [musl] - '@rollup/rollup-linux-riscv64-gnu@4.60.0': - resolution: {integrity: sha512-3a3qQustp3COCGvnP4SvrMHnPQ9d1vzCakQVRTliaz8cIp/wULGjiGpbcqrkv0WrHTEp8bQD/B3HBjzujVWLOA==} + '@rollup/rollup-linux-riscv64-gnu@4.60.1': + resolution: {integrity: sha512-QKgFl+Yc1eEk6MmOBfRHYF6lTxiiiV3/z/BRrbSiW2I7AFTXoBFvdMEyglohPj//2mZS4hDOqeB0H1ACh3sBbg==} cpu: [riscv64] os: [linux] libc: [glibc] - '@rollup/rollup-linux-riscv64-musl@4.60.0': - resolution: {integrity: sha512-pjZDsVH/1VsghMJ2/kAaxt6dL0psT6ZexQVrijczOf+PeP2BUqTHYejk3l6TlPRydggINOeNRhvpLa0AYpCWSQ==} + '@rollup/rollup-linux-riscv64-musl@4.60.1': + resolution: {integrity: sha512-RAjXjP/8c6ZtzatZcA1RaQr6O1TRhzC+adn8YZDnChliZHviqIjmvFwHcxi4JKPSDAt6Uhf/7vqcBzQJy0PDJg==} cpu: [riscv64] os: [linux] libc: [musl] - '@rollup/rollup-linux-s390x-gnu@4.60.0': - resolution: {integrity: sha512-3ObQs0BhvPgiUVZrN7gqCSvmFuMWvWvsjG5ayJ3Lraqv+2KhOsp+pUbigqbeWqueGIsnn+09HBw27rJ+gYK4VQ==} + '@rollup/rollup-linux-s390x-gnu@4.60.1': + resolution: {integrity: sha512-wcuocpaOlaL1COBYiA89O6yfjlp3RwKDeTIA0hM7OpmhR1Bjo9j31G1uQVpDlTvwxGn2nQs65fBFL5UFd76FcQ==} cpu: [s390x] os: [linux] libc: [glibc] - '@rollup/rollup-linux-x64-gnu@4.60.0': - resolution: {integrity: sha512-EtylprDtQPdS5rXvAayrNDYoJhIz1/vzN2fEubo3yLE7tfAw+948dO0g4M0vkTVFhKojnF+n6C8bDNe+gDRdTg==} + '@rollup/rollup-linux-x64-gnu@4.60.1': + resolution: {integrity: sha512-77PpsFQUCOiZR9+LQEFg9GClyfkNXj1MP6wRnzYs0EeWbPcHs02AXu4xuUbM1zhwn3wqaizle3AEYg5aeoohhg==} cpu: [x64] os: [linux] libc: [glibc] - '@rollup/rollup-linux-x64-musl@4.60.0': - resolution: {integrity: sha512-k09oiRCi/bHU9UVFqD17r3eJR9bn03TyKraCrlz5ULFJGdJGi7VOmm9jl44vOJvRJ6P7WuBi/s2A97LxxHGIdw==} + '@rollup/rollup-linux-x64-musl@4.60.1': + resolution: {integrity: sha512-5cIATbk5vynAjqqmyBjlciMJl1+R/CwX9oLk/EyiFXDWd95KpHdrOJT//rnUl4cUcskrd0jCCw3wpZnhIHdD9w==} cpu: [x64] os: [linux] libc: [musl] - '@rollup/rollup-openbsd-x64@4.60.0': - resolution: {integrity: sha512-1o/0/pIhozoSaDJoDcec+IVLbnRtQmHwPV730+AOD29lHEEo4F5BEUB24H0OBdhbBBDwIOSuf7vgg0Ywxdfiiw==} + '@rollup/rollup-openbsd-x64@4.60.1': + resolution: {integrity: sha512-cl0w09WsCi17mcmWqqglez9Gk8isgeWvoUZ3WiJFYSR3zjBQc2J5/ihSjpl+VLjPqjQ/1hJRcqBfLjssREQILw==} cpu: [x64] os: [openbsd] - '@rollup/rollup-openharmony-arm64@4.60.0': - resolution: {integrity: sha512-pESDkos/PDzYwtyzB5p/UoNU/8fJo68vcXM9ZW2V0kjYayj1KaaUfi1NmTUTUpMn4UhU4gTuK8gIaFO4UGuMbA==} + '@rollup/rollup-openharmony-arm64@4.60.1': + resolution: {integrity: sha512-4Cv23ZrONRbNtbZa37mLSueXUCtN7MXccChtKpUnQNgF010rjrjfHx3QxkS2PI7LqGT5xXyYs1a7LbzAwT0iCA==} cpu: [arm64] os: [openharmony] - '@rollup/rollup-win32-arm64-msvc@4.60.0': - resolution: {integrity: sha512-hj1wFStD7B1YBeYmvY+lWXZ7ey73YGPcViMShYikqKT1GtstIKQAtfUI6yrzPjAy/O7pO0VLXGmUVWXQMaYgTQ==} + '@rollup/rollup-win32-arm64-msvc@4.60.1': + resolution: {integrity: sha512-i1okWYkA4FJICtr7KpYzFpRTHgy5jdDbZiWfvny21iIKky5YExiDXP+zbXzm3dUcFpkEeYNHgQ5fuG236JPq0g==} cpu: [arm64] os: [win32] - '@rollup/rollup-win32-ia32-msvc@4.60.0': - resolution: {integrity: sha512-SyaIPFoxmUPlNDq5EHkTbiKzmSEmq/gOYFI/3HHJ8iS/v1mbugVa7dXUzcJGQfoytp9DJFLhHH4U3/eTy2Bq4w==} + '@rollup/rollup-win32-ia32-msvc@4.60.1': + resolution: {integrity: sha512-u09m3CuwLzShA0EYKMNiFgcjjzwqtUMLmuCJLeZWjjOYA3IT2Di09KaxGBTP9xVztWyIWjVdsB2E9goMjZvTQg==} cpu: [ia32] os: [win32] - '@rollup/rollup-win32-x64-gnu@4.60.0': - resolution: {integrity: sha512-RdcryEfzZr+lAr5kRm2ucN9aVlCCa2QNq4hXelZxb8GG0NJSazq44Z3PCCc8wISRuCVnGs0lQJVX5Vp6fKA+IA==} + '@rollup/rollup-win32-x64-gnu@4.60.1': + resolution: {integrity: sha512-k+600V9Zl1CM7eZxJgMyTUzmrmhB/0XZnF4pRypKAlAgxmedUA+1v9R+XOFv56W4SlHEzfeMtzujLJD22Uz5zg==} cpu: [x64] os: [win32] - '@rollup/rollup-win32-x64-msvc@4.60.0': - resolution: {integrity: sha512-PrsWNQ8BuE00O3Xsx3ALh2Df8fAj9+cvvX9AIA6o4KpATR98c9mud4XtDWVvsEuyia5U4tVSTKygawyJkjm60w==} + '@rollup/rollup-win32-x64-msvc@4.60.1': + resolution: {integrity: sha512-lWMnixq/QzxyhTV6NjQJ4SFo1J6PvOX8vUx5Wb4bBPsEb+8xZ89Bz6kOXpfXj9ak9AHTQVQzlgzBEc1SyM27xQ==} cpu: [x64] os: [win32] @@ -1247,21 +1229,17 @@ packages: peerDependencies: '@types/react': ^19.2.0 - '@types/react-i18next@8.1.0': - resolution: {integrity: sha512-d4xhcjX5b3roNMObRNMfb1HinHQlQLPo8xlDj60dnHeeAw2bBymR2cy/l1giJpHzo/ZFgSvgVUvIWr4kCrenCg==} - deprecated: This is a stub types definition. react-i18next provides its own type definitions, so you do not need this installed. - '@types/react@19.2.14': resolution: {integrity: sha512-ilcTH/UniCkMdtexkoCN0bI7pMcJDvmQFPvuPvmEaYA/NSfFTAgdUSLAoVjaRJm7+6PvcM+q1zYOwS4wTYMF9w==} '@types/resolve@1.20.6': resolution: {integrity: sha512-A4STmOXPhMUtHH+S6ymgE2GiBSMqf4oTvcQZMcHzokuTLVYzXTB8ttjcgxOVaAp2lGwEdzZ0J+cRbbeevQj1UQ==} - '@vitest/coverage-v8@4.1.1': - resolution: {integrity: sha512-nZ4RWwGCoGOQRMmU/Q9wlUY540RVRxJZ9lxFsFfy0QV7Zmo5VVBhB6Sl9Xa0KIp2iIs3zWfPlo9LcY1iqbpzCw==} + '@vitest/coverage-v8@4.1.2': + resolution: {integrity: sha512-sPK//PHO+kAkScb8XITeB1bf7fsk85Km7+rt4eeuRR3VS1/crD47cmV5wicisJmjNdfeokTZwjMk4Mj2d58Mgg==} peerDependencies: - '@vitest/browser': 4.1.1 - vitest: 4.1.1 + '@vitest/browser': 4.1.2 + vitest: 4.1.2 peerDependenciesMeta: '@vitest/browser': optional: true @@ -1269,11 +1247,11 @@ packages: '@vitest/expect@3.2.4': resolution: {integrity: sha512-Io0yyORnB6sikFlt8QW5K7slY4OjqNX9jmJQ02QDda8lyM6B5oNgVWoSoKPac8/kgnCUzuHQKrSLtu/uOqqrig==} - '@vitest/expect@4.1.1': - resolution: {integrity: sha512-xAV0fqBTk44Rn6SjJReEQkHP3RrqbJo6JQ4zZ7/uVOiJZRarBtblzrOfFIZeYUrukp2YD6snZG6IBqhOoHTm+A==} + '@vitest/expect@4.1.2': + resolution: {integrity: sha512-gbu+7B0YgUJ2nkdsRJrFFW6X7NTP44WlhiclHniUhxADQJH5Szt9mZ9hWnJPJ8YwOK5zUOSSlSvyzRf0u1DSBQ==} - '@vitest/mocker@4.1.1': - resolution: {integrity: sha512-h3BOylsfsCLPeceuCPAAJ+BvNwSENgJa4hXoXu4im0bs9Lyp4URc4JYK4pWLZ4pG/UQn7AT92K6IByi6rE6g3A==} + '@vitest/mocker@4.1.2': + resolution: {integrity: sha512-Ize4iQtEALHDttPRCmN+FKqOl2vxTiNUhzobQFFt/BM1lRUTG7zRCLOykG/6Vo4E4hnUdfVLo5/eqKPukcWW7Q==} peerDependencies: msw: ^2.4.9 vite: ^6.0.0 || ^7.0.0 || ^8.0.0 @@ -1286,31 +1264,31 @@ packages: '@vitest/pretty-format@3.2.4': resolution: {integrity: sha512-IVNZik8IVRJRTr9fxlitMKeJeXFFFN0JaB9PHPGQ8NKQbGpfjlTx9zO4RefN8gp7eqjNy8nyK3NZmBzOPeIxtA==} - '@vitest/pretty-format@4.1.1': - resolution: {integrity: sha512-GM+TEQN5WhOygr1lp7skeVjdLPqqWMHsfzXrcHAqZJi/lIVh63H0kaRCY8MDhNWikx19zBUK8ceaLB7X5AH9NQ==} + '@vitest/pretty-format@4.1.2': + resolution: {integrity: sha512-dwQga8aejqeuB+TvXCMzSQemvV9hNEtDDpgUKDzOmNQayl2OG241PSWeJwKRH3CiC+sESrmoFd49rfnq7T4RnA==} - '@vitest/runner@4.1.1': - resolution: {integrity: sha512-f7+FPy75vN91QGWsITueq0gedwUZy1fLtHOCMeQpjs8jTekAHeKP80zfDEnhrleviLHzVSDXIWuCIOFn3D3f8A==} + '@vitest/runner@4.1.2': + resolution: {integrity: sha512-Gr+FQan34CdiYAwpGJmQG8PgkyFVmARK8/xSijia3eTFgVfpcpztWLuP6FttGNfPLJhaZVP/euvujeNYar36OQ==} - '@vitest/snapshot@4.1.1': - resolution: {integrity: sha512-kMVSgcegWV2FibXEx9p9WIKgje58lcTbXgnJixfcg15iK8nzCXhmalL0ZLtTWLW9PH1+1NEDShiFFedB3tEgWg==} + '@vitest/snapshot@4.1.2': + resolution: {integrity: sha512-g7yfUmxYS4mNxk31qbOYsSt2F4m1E02LFqO53Xpzg3zKMhLAPZAjjfyl9e6z7HrW6LvUdTwAQR3HHfLjpko16A==} '@vitest/spy@3.2.4': resolution: {integrity: sha512-vAfasCOe6AIK70iP5UD11Ac4siNUNJ9i/9PZ3NKx07sG6sUxeag1LWdNrMWeKKYBLlzuK+Gn65Yd5nyL6ds+nw==} - '@vitest/spy@4.1.1': - resolution: {integrity: sha512-6Ti/KT5OVaiupdIZEuZN7l3CZcR0cxnxt70Z0//3CtwgObwA6jZhmVBA3yrXSVN3gmwjgd7oDNLlsXz526gpRA==} + '@vitest/spy@4.1.2': + resolution: {integrity: sha512-DU4fBnbVCJGNBwVA6xSToNXrkZNSiw59H8tcuUspVMsBDBST4nfvsPsEHDHGtWRRnqBERBQu7TrTKskmjqTXKA==} - '@vitest/ui@4.1.1': - resolution: {integrity: sha512-k0qNVLmCISxoGWvdhOeynlZVrfjx7Xjp95kIptN0fZYyONCgVcKIPn53MpFZ7S+fO6YdKNhgIfl0nu92Q0CCOg==} + '@vitest/ui@4.1.2': + resolution: {integrity: sha512-/irhyeAcKS2u6Zokagf9tqZJ0t8S6kMZq4ZG9BHZv7I+fkRrYfQX4w7geYeC2r6obThz39PDxvXQzZX+qXqGeg==} peerDependencies: - vitest: 4.1.1 + vitest: 4.1.2 '@vitest/utils@3.2.4': resolution: {integrity: sha512-fB2V0JFrQSMsCo9HiSq3Ezpdv4iYaXRG1Sx8edX3MwxfyNn83mKiGzOcH+Fkxt4MHxr3y42fQi1oeAInqgX2QA==} - '@vitest/utils@4.1.1': - resolution: {integrity: sha512-cNxAlaB3sHoCdL6pj6yyUXv9Gry1NHNg0kFTXdvSIZXLHsqKH7chiWOkwJ5s5+d/oMwcoG9T0bKU38JZWKusrQ==} + '@vitest/utils@4.1.2': + resolution: {integrity: sha512-xw2/TiX82lQHA06cgbqRKFb5lCAy3axQ4H4SoUFhUsg+wztiet+co86IAMDtF6Vm1hc7J6j09oh/rgDn+JdKIQ==} acorn@8.16.0: resolution: {integrity: sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw==} @@ -1362,25 +1340,25 @@ packages: asynckit@0.4.0: resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} - axe-core@4.11.1: - resolution: {integrity: sha512-BASOg+YwO2C+346x3LZOeoovTIoTrRqEsqMa6fmfAV0P+U9mFr9NsyOEpiYvFjbc64NMrSswhV50WdXzdb/Z5A==} + axe-core@4.11.2: + resolution: {integrity: sha512-byD6KPdvo72y/wj2T/4zGEvvlis+PsZsn/yPS3pEO+sFpcrqRpX/TJCxvVaEsNeMrfQbCr7w163YqoD9IYwHXw==} engines: {node: '>=4'} balanced-match@4.0.4: resolution: {integrity: sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==} engines: {node: 18 || 20 || >=22} - baseline-browser-mapping@2.10.10: - resolution: {integrity: sha512-sUoJ3IMxx4AyRqO4MLeHlnGDkyXRoUG0/AI9fjK+vS72ekpV0yWVY7O0BVjmBcRtkNcsAO2QDZ4tdKKGoI6YaQ==} + baseline-browser-mapping@2.10.13: + resolution: {integrity: sha512-BL2sTuHOdy0YT1lYieUxTw/QMtPBC3pmlJC6xk8BBYVv6vcw3SGdKemQ+Xsx9ik2F/lYDO9tqsFQH1r9PFuHKw==} engines: {node: '>=6.0.0'} hasBin: true - brace-expansion@5.0.4: - resolution: {integrity: sha512-h+DEnpVvxmfVefa4jFbCf5HdH5YMDXRsmKflpf1pILZWRFlTbJpxeU55nJl4Smt5HQaGzg1o6RHFPJaOqnmBDg==} + brace-expansion@5.0.5: + resolution: {integrity: sha512-VZznLgtwhn+Mact9tfiwx64fA9erHH/MCXEUfB/0bX/6Fz6ny5EGTXYltMocqg4xFAQZtnO3DHWWXi8RiuN7cQ==} engines: {node: 18 || 20 || >=22} - browserslist@4.28.1: - resolution: {integrity: sha512-ZC5Bd0LgJXgwGqUknZY/vkUQ04r8NXnJZ3yYi4vDmSiZmC/pdSN0NbNRPxZpbtO4uAfDUAFffO8IZoM3Gj8IkA==} + browserslist@4.28.2: + resolution: {integrity: sha512-48xSriZYYg+8qXna9kwqjIVzuQxi+KYWp2+5nCYnYKPTr0LvD89Jqk2Or5ogxz0NUMfIjhh2lIUX/LyX9B4oIg==} engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} hasBin: true @@ -1392,8 +1370,8 @@ packages: resolution: {integrity: sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==} engines: {node: '>= 0.4'} - caniuse-lite@1.0.30001781: - resolution: {integrity: sha512-RdwNCyMsNBftLjW6w01z8bKEvT6e/5tpPVEgtn22TiLGlstHOVecsX2KHFkD5e/vRnIE4EGzpuIODb3mtswtkw==} + caniuse-lite@1.0.30001784: + resolution: {integrity: sha512-WU346nBTklUV9YfUl60fqRbU5ZqyXlqvo1SgigE1OAXK5bFL8LL9q1K7aap3N739l4BvNqnkm3YrGHiY9sfUQw==} chai@5.3.3: resolution: {integrity: sha512-4zNhdJD/iOjSH0A05ea+Ke6MU5mmpQcbQsSOkgdaUMJ9zTlDTD/GYlwohmIE2u0gaxHYiVHEn1Fw9mZ/ktJWgw==} @@ -1505,8 +1483,8 @@ packages: resolution: {integrity: sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==} engines: {node: '>= 0.4'} - electron-to-chromium@1.5.321: - resolution: {integrity: sha512-L2C7Q279W2D/J4PLZLk7sebOILDSWos7bMsMNN06rK482umHUrh/3lM8G7IlHFOYip2oAg5nha1rCMxr/rs6ZQ==} + electron-to-chromium@1.5.330: + resolution: {integrity: sha512-jFNydB5kFtYUobh4IkWUnXeyDbjf/r9gcUEXe1xcrcUxIGfTdzPXA+ld6zBRbwvgIGVzDll/LTIiDztEtckSnA==} emoji-regex@10.6.0: resolution: {integrity: sha512-toUI84YS5YmxW219erniWD0CIVOo46xGKColeNQRgOzDorgBi1v4D71/OFzgD9GO2UGKIv1C3Sp8DAn0+j5w7A==} @@ -1594,8 +1572,8 @@ packages: resolution: {integrity: sha512-sJslQKU2uM33qH5nqewAwVB2QgR6w1aMNsYUp3aN5rMRyXEwJGmZvaWzeJFNTOXWlHQyBFCWrdj3fV/fsTOX8w==} engines: {node: '>= 10.4.0'} - flatted@3.4.0: - resolution: {integrity: sha512-kC6Bb+ooptOIvWj5B63EQWkF0FEnNjV2ZNkLMLZRDDduIiWeFF4iKnslwhiWxjAdbg4NzTNo6h0qLuvFrcx+Sw==} + flatted@3.4.2: + resolution: {integrity: sha512-PjDse7RzhcPkIJwy5t7KPWQSZ9cAbzQXcafsetQoD7sOJRQlGikNbx7yZp2OotDnJyrDcbyRq3Ttb18iYOqkxA==} form-data@4.0.5: resolution: {integrity: sha512-8RipRLol37bNs2bhoV67fiTEvdTrbMUYcFTiy3+wuuOnUog2QBHCZWXDRijWQfAkhBj2Uf5UnVaiWwA5vdd82w==} @@ -1662,9 +1640,6 @@ packages: html-escaper@2.0.2: resolution: {integrity: sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==} - html-parse-stringify@3.0.1: - resolution: {integrity: sha512-KknJ50kTInJ7qIScF3jeaFRpMpE8/lfiTdzf/twXyPBLAGrLRTmkz3AdTnKeh40X8k9L2fdYwEp/42WGXIRGcg==} - http-proxy-agent@7.0.2: resolution: {integrity: sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==} engines: {node: '>= 14'} @@ -1678,14 +1653,6 @@ packages: engines: {node: '>=18'} hasBin: true - i18next@25.10.9: - resolution: {integrity: sha512-hQY9/bFoQKGlSKMlaCuLR8w1h5JjieqrsnZvEmj1Ja6Ec7fbyc4cTrCsY9mb9Sd8YQ/swsrKz1S9M8AcvVI70w==} - peerDependencies: - typescript: ^5 || ^6 - peerDependenciesMeta: - typescript: - optional: true - iconv-lite@0.6.3: resolution: {integrity: sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==} engines: {node: '>=0.10.0'} @@ -1819,8 +1786,8 @@ packages: resolution: {integrity: sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==} engines: {node: '>=4'} - minimatch@10.2.4: - resolution: {integrity: sha512-oRjTw/97aTBN0RHbYCdtF1MQfvusSIBQM0IZEgzl6426+8jSC0nF1a/GmnVLpfB9yyr6g6FTqWqiZVbxrtaCIg==} + minimatch@10.2.5: + resolution: {integrity: sha512-MULkVLfKGYDFYejP07QOurDLLQpcjk7Fw+7jXS2R2czRQzR56yHRveU5NDJEOviH+hETZKSkIk5c+T23GjFUMg==} engines: {node: 18 || 20 || >=22} minimist@1.2.8: @@ -1864,12 +1831,12 @@ packages: engines: {node: ^20.19.0 || >=22.12.0} hasBin: true - oxlint@1.56.0: - resolution: {integrity: sha512-Q+5Mj5PVaH/R6/fhMMFzw4dT+KPB+kQW4kaL8FOIq7tfhlnEVp6+3lcWqFruuTNlUo9srZUW3qH7Id4pskeR6g==} + oxlint@1.58.0: + resolution: {integrity: sha512-t4s9leczDMqlvOSjnbCQe7gtoLkWgBGZ7sBdCJ9EOj5IXFSG/X7OAzK4yuH4iW+4cAYe8kLFbC8tuYMwWZm+Cg==} engines: {node: ^20.19.0 || >=22.12.0} hasBin: true peerDependencies: - oxlint-tsgolint: '>=0.15.0' + oxlint-tsgolint: '>=0.18.0' peerDependenciesMeta: oxlint-tsgolint: optional: true @@ -1927,22 +1894,6 @@ packages: peerDependencies: react: ^19.2.4 - react-i18next@16.6.6: - resolution: {integrity: sha512-ZgL2HUoW34UKUkOV7uSQFE1CDnRPD+tCR3ywSuWH7u2iapnz86U8Bi3Vrs620qNDzCf1F47NxglCEkchCTDOHw==} - peerDependencies: - i18next: '>= 25.10.9' - react: '>= 16.8.0' - react-dom: '*' - react-native: '*' - typescript: ^5 || ^6 - peerDependenciesMeta: - react-dom: - optional: true - react-native: - optional: true - typescript: - optional: true - react-is@17.0.2: resolution: {integrity: sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==} @@ -1975,8 +1926,8 @@ packages: engines: {node: 20 || >=22} hasBin: true - rollup@4.60.0: - resolution: {integrity: sha512-yqjxruMGBQJ2gG4HtjZtAfXArHomazDHoFwFFmZZl0r7Pdo7qCIXKqKHZc8yeoMgzJJ+pO6pEEHa+V7uzWlrAQ==} + rollup@4.60.1: + resolution: {integrity: sha512-VmtB2rFU/GroZ4oL8+ZqXgSA38O6GR8KSIvWmEFv63pQ0G6KaBH9s07PO8XTXP4vI+3UJUEypOfjkGfmSBBR0w==} engines: {node: '>=18.0.0', npm: '>=8.0.0'} hasBin: true @@ -2090,48 +2041,48 @@ packages: symbol-tree@3.2.4: resolution: {integrity: sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==} - syncpack-darwin-arm64@14.2.1: - resolution: {integrity: sha512-SGrC163UWiL68TRo8rmPQFgbT83ieT7zQ1GKyoPZ3TAGNQ+6a/3GMXlZQ+HKV3ydVyB2t60H5CsQFlz13QHTqA==} + syncpack-darwin-arm64@14.3.0: + resolution: {integrity: sha512-gpbkBzO7yqa3BONc4EU3jY07yiPSZdoAxcpnz8REV9Bc6FkmKfOejCpYIh8RaogGPS4gOLJ/RUJEECqAaHTcjA==} cpu: [arm64] os: [darwin] - syncpack-darwin-x64@14.2.1: - resolution: {integrity: sha512-ZqAJb4FEez3zpuOHUKZNSBWiYGH4FqmN5pI/AzM2N81oSGTYLaI+H4Wmi6rtZdQXRX2ZzQRs4lQrLTdmVv7oQg==} + syncpack-darwin-x64@14.3.0: + resolution: {integrity: sha512-wTpl6Qj5qGIHrYhpCrlNnosmhQqvUoidqqmxtdM3f+j+b+OkTtpkUl2tdE28h3aeEEUPf9ClQnHuwRJMYNlrJw==} cpu: [x64] os: [darwin] - syncpack-linux-arm64-musl@14.2.1: - resolution: {integrity: sha512-vfopyN7ne++jnV4uAsoH8NHbio/6+yfdc9VfXt+9ZQiuR1AxtjT2Hylv6re5e6c1j0MPWaCRtaZBZhDUi0ZPdA==} + syncpack-linux-arm64-musl@14.3.0: + resolution: {integrity: sha512-AezJ5dv0s+l/p1l4/wBatYhM6SZEKLcyNKggSOX5uISzqbSKwj/Aak13pBXWarzS+N6LnOl4PMcwRMJPOUfN/g==} cpu: [arm64] os: [linux] - syncpack-linux-arm64@14.2.1: - resolution: {integrity: sha512-yjyG1v1lYBmWaD+aGXt4eovZ3k+d/nwHU8AZkFJh2jxBy6He2qTclR7+eI/BFcmiAehncbGNksYhL2h2RlC0Rg==} + syncpack-linux-arm64@14.3.0: + resolution: {integrity: sha512-Vcf9zWkJGRqb5mGPKi9E+s/mB/Tw08LmKGRaiyKJjK8bhd1Ds65O8A2lOidy3jg0NOOojqREmDsli74Xd0z6KA==} cpu: [arm64] os: [linux] - syncpack-linux-x64-musl@14.2.1: - resolution: {integrity: sha512-2/LMs6nFWPV2P0XOmMo63Erzv8OQ9skszXdalrhU2ilBO7f6B4sup6NsMKIXJeYHNso94TcLdAxyiGQ4sCdmTw==} + syncpack-linux-x64-musl@14.3.0: + resolution: {integrity: sha512-tIRF0lvBJcoIwcO05/Q6j30CAg0jzn+A5eQL+06Ncq8CE5i8fBWrVwN1U/QQ4fzT+tondNWH/2BR5zlaB1VUpQ==} cpu: [x64] os: [linux] - syncpack-linux-x64@14.2.1: - resolution: {integrity: sha512-rfDzLxiJng7XIVShO7ygrAvrGdCloaKhMm2c4Q8blxVTHgSNcmL4cHRP/Zcvj7pmYGkwok6DtAetgxV47XpoGA==} + syncpack-linux-x64@14.3.0: + resolution: {integrity: sha512-n/4iBJnoOCe5An+WYlaqfSxOKQ7Id3TZTpxOpI60Cucq3yqwq0JHQUielj6JBtVaxvo2rAsTwbCLyp2aB0SD2g==} cpu: [x64] os: [linux] - syncpack-windows-arm64@14.2.1: - resolution: {integrity: sha512-T+qP9ERY8dg6HWAgFtxNKxp67EJ7CIstHeQ8jQAiSmKGNt+HEzzVCipSGMb9yu9SGjVQHuvn2wAf33LppYfivA==} + syncpack-windows-arm64@14.3.0: + resolution: {integrity: sha512-ZTX0rSUTJZjIde3qPKLEqU7IEt4KxFsmq6gKLfESx5rB1rxk/B1Ljv6nTYph5QVItEzHQHUXDWnqa9yCb15myw==} cpu: [arm64] os: [win32] - syncpack-windows-x64@14.2.1: - resolution: {integrity: sha512-yoK6eHbzTgKuaL4dU/AFNaIHqRletqR8w5aBGBzdAY39n2MrNbfGVBUeDglRBYnSoE+PgLtqwbHULIlhPratPw==} + syncpack-windows-x64@14.3.0: + resolution: {integrity: sha512-zvbphZw40wFZYeEW2oJYqA9Uw6IOwNIpgFmVNdWdGmShPF/Zu1cavHEcGwtQmvVzwuTEyiu67uxQ3hDC2q6vtg==} cpu: [x64] os: [win32] - syncpack@14.2.1: - resolution: {integrity: sha512-9CE0+MCThNPt0/yXD5cFaJQw2jxslaB3Ck1ASeP9uFji+lE3KWmfGRBzy8x5sjhygUz6Vt+a84w+ycIzATQicA==} + syncpack@14.3.0: + resolution: {integrity: sha512-8/WtPPxxGFqE21JPFz6Bpw0m9BT3lzMYDcewJFj++EBPmCaDWowTnx0R4V7ofH/1z3HAIaAps6g2GHL76l1Y2g==} engines: {node: '>=14.17.0'} hasBin: true @@ -2277,18 +2228,18 @@ packages: yaml: optional: true - vitest@4.1.1: - resolution: {integrity: sha512-yF+o4POL41rpAzj5KVILUxm1GCjKnELvaqmU9TLLUbMfDzuN0UpUR9uaDs+mCtjPe+uYPksXDRLQGGPvj1cTmA==} + vitest@4.1.2: + resolution: {integrity: sha512-xjR1dMTVHlFLh98JE3i/f/WePqJsah4A0FK9cc8Ehp9Udk0AZk6ccpIZhh1qJ/yxVWRZ+Q54ocnD8TXmkhspGg==} engines: {node: ^20.0.0 || ^22.0.0 || >=24.0.0} hasBin: true peerDependencies: '@edge-runtime/vm': '*' '@opentelemetry/api': ^1.9.0 '@types/node': ^20.0.0 || ^22.0.0 || >=24.0.0 - '@vitest/browser-playwright': 4.1.1 - '@vitest/browser-preview': 4.1.1 - '@vitest/browser-webdriverio': 4.1.1 - '@vitest/ui': 4.1.1 + '@vitest/browser-playwright': 4.1.2 + '@vitest/browser-preview': 4.1.2 + '@vitest/browser-webdriverio': 4.1.2 + '@vitest/ui': 4.1.2 happy-dom: '*' jsdom: '*' vite: ^6.0.0 || ^7.0.0 || ^8.0.0 @@ -2312,10 +2263,6 @@ packages: jsdom: optional: true - void-elements@3.1.0: - resolution: {integrity: sha512-Dhxzh5HZuiHQhbvTW9AMetFfBHDMYpo23Uo9btPXgdYP+3T5S+p+jgNy7spra+veYhBP2dCSgxR/i2Y02h5/6w==} - engines: {node: '>=0.10.0'} - w3c-xmlserializer@5.0.0: resolution: {integrity: sha512-o8qghlI8NZHU1lLPrpi2+Uq7abh4GGPpYANlalzWxyWteJOCsr/P+oPBA49TOLu5FTZO4d3F9MnWJfiMo4BkmA==} engines: {node: '>=18'} @@ -2432,7 +2379,7 @@ snapshots: dependencies: '@babel/compat-data': 7.29.0 '@babel/helper-validator-option': 7.27.1 - browserslist: 4.28.1 + browserslist: 4.28.2 lru-cache: 5.1.1 semver: 6.3.1 @@ -2496,7 +2443,7 @@ snapshots: '@bcoe/v8-coverage@1.0.2': {} - '@chromatic-com/storybook@5.0.2(storybook@10.3.3(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4))': + '@chromatic-com/storybook@5.1.1(storybook@10.3.3(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4))': dependencies: '@neoconfetti/react': 1.0.0 chromatic: 13.3.5 @@ -2776,146 +2723,146 @@ snapshots: '@oxfmt/binding-win32-x64-msvc@0.41.0': optional: true - '@oxlint/binding-android-arm-eabi@1.56.0': + '@oxlint/binding-android-arm-eabi@1.58.0': optional: true - '@oxlint/binding-android-arm64@1.56.0': + '@oxlint/binding-android-arm64@1.58.0': optional: true - '@oxlint/binding-darwin-arm64@1.56.0': + '@oxlint/binding-darwin-arm64@1.58.0': optional: true - '@oxlint/binding-darwin-x64@1.56.0': + '@oxlint/binding-darwin-x64@1.58.0': optional: true - '@oxlint/binding-freebsd-x64@1.56.0': + '@oxlint/binding-freebsd-x64@1.58.0': optional: true - '@oxlint/binding-linux-arm-gnueabihf@1.56.0': + '@oxlint/binding-linux-arm-gnueabihf@1.58.0': optional: true - '@oxlint/binding-linux-arm-musleabihf@1.56.0': + '@oxlint/binding-linux-arm-musleabihf@1.58.0': optional: true - '@oxlint/binding-linux-arm64-gnu@1.56.0': + '@oxlint/binding-linux-arm64-gnu@1.58.0': optional: true - '@oxlint/binding-linux-arm64-musl@1.56.0': + '@oxlint/binding-linux-arm64-musl@1.58.0': optional: true - '@oxlint/binding-linux-ppc64-gnu@1.56.0': + '@oxlint/binding-linux-ppc64-gnu@1.58.0': optional: true - '@oxlint/binding-linux-riscv64-gnu@1.56.0': + '@oxlint/binding-linux-riscv64-gnu@1.58.0': optional: true - '@oxlint/binding-linux-riscv64-musl@1.56.0': + '@oxlint/binding-linux-riscv64-musl@1.58.0': optional: true - '@oxlint/binding-linux-s390x-gnu@1.56.0': + '@oxlint/binding-linux-s390x-gnu@1.58.0': optional: true - '@oxlint/binding-linux-x64-gnu@1.56.0': + '@oxlint/binding-linux-x64-gnu@1.58.0': optional: true - '@oxlint/binding-linux-x64-musl@1.56.0': + '@oxlint/binding-linux-x64-musl@1.58.0': optional: true - '@oxlint/binding-openharmony-arm64@1.56.0': + '@oxlint/binding-openharmony-arm64@1.58.0': optional: true - '@oxlint/binding-win32-arm64-msvc@1.56.0': + '@oxlint/binding-win32-arm64-msvc@1.58.0': optional: true - '@oxlint/binding-win32-ia32-msvc@1.56.0': + '@oxlint/binding-win32-ia32-msvc@1.58.0': optional: true - '@oxlint/binding-win32-x64-msvc@1.56.0': + '@oxlint/binding-win32-x64-msvc@1.58.0': optional: true '@polka/url@1.0.0-next.29': {} - '@rollup/pluginutils@5.3.0(rollup@4.60.0)': + '@rollup/pluginutils@5.3.0(rollup@4.60.1)': dependencies: '@types/estree': 1.0.8 estree-walker: 2.0.2 picomatch: 4.0.4 optionalDependencies: - rollup: 4.60.0 + rollup: 4.60.1 - '@rollup/rollup-android-arm-eabi@4.60.0': + '@rollup/rollup-android-arm-eabi@4.60.1': optional: true - '@rollup/rollup-android-arm64@4.60.0': + '@rollup/rollup-android-arm64@4.60.1': optional: true - '@rollup/rollup-darwin-arm64@4.60.0': + '@rollup/rollup-darwin-arm64@4.60.1': optional: true - '@rollup/rollup-darwin-x64@4.60.0': + '@rollup/rollup-darwin-x64@4.60.1': optional: true - '@rollup/rollup-freebsd-arm64@4.60.0': + '@rollup/rollup-freebsd-arm64@4.60.1': optional: true - '@rollup/rollup-freebsd-x64@4.60.0': + '@rollup/rollup-freebsd-x64@4.60.1': optional: true - '@rollup/rollup-linux-arm-gnueabihf@4.60.0': + '@rollup/rollup-linux-arm-gnueabihf@4.60.1': optional: true - '@rollup/rollup-linux-arm-musleabihf@4.60.0': + '@rollup/rollup-linux-arm-musleabihf@4.60.1': optional: true - '@rollup/rollup-linux-arm64-gnu@4.60.0': + '@rollup/rollup-linux-arm64-gnu@4.60.1': optional: true - '@rollup/rollup-linux-arm64-musl@4.60.0': + '@rollup/rollup-linux-arm64-musl@4.60.1': optional: true - '@rollup/rollup-linux-loong64-gnu@4.60.0': + '@rollup/rollup-linux-loong64-gnu@4.60.1': optional: true - '@rollup/rollup-linux-loong64-musl@4.60.0': + '@rollup/rollup-linux-loong64-musl@4.60.1': optional: true - '@rollup/rollup-linux-ppc64-gnu@4.60.0': + '@rollup/rollup-linux-ppc64-gnu@4.60.1': optional: true - '@rollup/rollup-linux-ppc64-musl@4.60.0': + '@rollup/rollup-linux-ppc64-musl@4.60.1': optional: true - '@rollup/rollup-linux-riscv64-gnu@4.60.0': + '@rollup/rollup-linux-riscv64-gnu@4.60.1': optional: true - '@rollup/rollup-linux-riscv64-musl@4.60.0': + '@rollup/rollup-linux-riscv64-musl@4.60.1': optional: true - '@rollup/rollup-linux-s390x-gnu@4.60.0': + '@rollup/rollup-linux-s390x-gnu@4.60.1': optional: true - '@rollup/rollup-linux-x64-gnu@4.60.0': + '@rollup/rollup-linux-x64-gnu@4.60.1': optional: true - '@rollup/rollup-linux-x64-musl@4.60.0': + '@rollup/rollup-linux-x64-musl@4.60.1': optional: true - '@rollup/rollup-openbsd-x64@4.60.0': + '@rollup/rollup-openbsd-x64@4.60.1': optional: true - '@rollup/rollup-openharmony-arm64@4.60.0': + '@rollup/rollup-openharmony-arm64@4.60.1': optional: true - '@rollup/rollup-win32-arm64-msvc@4.60.0': + '@rollup/rollup-win32-arm64-msvc@4.60.1': optional: true - '@rollup/rollup-win32-ia32-msvc@4.60.0': + '@rollup/rollup-win32-ia32-msvc@4.60.1': optional: true - '@rollup/rollup-win32-x64-gnu@4.60.0': + '@rollup/rollup-win32-x64-gnu@4.60.1': optional: true - '@rollup/rollup-win32-x64-msvc@4.60.0': + '@rollup/rollup-win32-x64-msvc@4.60.1': optional: true '@standard-schema/spec@1.1.0': {} @@ -2923,13 +2870,13 @@ snapshots: '@storybook/addon-a11y@10.3.3(storybook@10.3.3(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4))': dependencies: '@storybook/global': 5.0.0 - axe-core: 4.11.1 + axe-core: 4.11.2 storybook: 10.3.3(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4) - '@storybook/addon-docs@10.3.3(@types/react@19.2.14)(esbuild@0.27.4)(rollup@4.60.0)(storybook@10.3.3(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4))(vite@6.4.1(@types/node@25.5.0)(yaml@2.8.3))': + '@storybook/addon-docs@10.3.3(@types/react@19.2.14)(esbuild@0.27.4)(rollup@4.60.1)(storybook@10.3.3(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4))(vite@6.4.1(@types/node@25.5.0)(yaml@2.8.3))': dependencies: '@mdx-js/react': 3.1.1(@types/react@19.2.14)(react@19.2.4) - '@storybook/csf-plugin': 10.3.3(esbuild@0.27.4)(rollup@4.60.0)(storybook@10.3.3(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4))(vite@6.4.1(@types/node@25.5.0)(yaml@2.8.3)) + '@storybook/csf-plugin': 10.3.3(esbuild@0.27.4)(rollup@4.60.1)(storybook@10.3.3(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4))(vite@6.4.1(@types/node@25.5.0)(yaml@2.8.3)) '@storybook/icons': 2.0.1(react-dom@19.2.4(react@19.2.4))(react@19.2.4) '@storybook/react-dom-shim': 10.3.3(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(storybook@10.3.3(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)) react: 19.2.4 @@ -2943,21 +2890,21 @@ snapshots: - vite - webpack - '@storybook/addon-vitest@10.3.3(@vitest/runner@4.1.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(storybook@10.3.3(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4))(vitest@4.1.1)': + '@storybook/addon-vitest@10.3.3(@vitest/runner@4.1.2)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(storybook@10.3.3(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4))(vitest@4.1.2)': dependencies: '@storybook/global': 5.0.0 '@storybook/icons': 2.0.1(react-dom@19.2.4(react@19.2.4))(react@19.2.4) storybook: 10.3.3(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4) optionalDependencies: - '@vitest/runner': 4.1.1 - vitest: 4.1.1(@types/node@25.5.0)(@vitest/ui@4.1.1)(jsdom@25.0.1)(vite@6.4.1(@types/node@25.5.0)(yaml@2.8.3)) + '@vitest/runner': 4.1.2 + vitest: 4.1.2(@types/node@25.5.0)(@vitest/ui@4.1.2)(jsdom@25.0.1)(vite@6.4.1(@types/node@25.5.0)(yaml@2.8.3)) transitivePeerDependencies: - react - react-dom - '@storybook/builder-vite@10.3.3(esbuild@0.27.4)(rollup@4.60.0)(storybook@10.3.3(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4))(vite@6.4.1(@types/node@25.5.0)(yaml@2.8.3))': + '@storybook/builder-vite@10.3.3(esbuild@0.27.4)(rollup@4.60.1)(storybook@10.3.3(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4))(vite@6.4.1(@types/node@25.5.0)(yaml@2.8.3))': dependencies: - '@storybook/csf-plugin': 10.3.3(esbuild@0.27.4)(rollup@4.60.0)(storybook@10.3.3(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4))(vite@6.4.1(@types/node@25.5.0)(yaml@2.8.3)) + '@storybook/csf-plugin': 10.3.3(esbuild@0.27.4)(rollup@4.60.1)(storybook@10.3.3(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4))(vite@6.4.1(@types/node@25.5.0)(yaml@2.8.3)) storybook: 10.3.3(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4) ts-dedent: 2.2.0 vite: 6.4.1(@types/node@25.5.0)(yaml@2.8.3) @@ -2966,13 +2913,13 @@ snapshots: - rollup - webpack - '@storybook/csf-plugin@10.3.3(esbuild@0.27.4)(rollup@4.60.0)(storybook@10.3.3(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4))(vite@6.4.1(@types/node@25.5.0)(yaml@2.8.3))': + '@storybook/csf-plugin@10.3.3(esbuild@0.27.4)(rollup@4.60.1)(storybook@10.3.3(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4))(vite@6.4.1(@types/node@25.5.0)(yaml@2.8.3))': dependencies: storybook: 10.3.3(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4) unplugin: 2.3.11 optionalDependencies: esbuild: 0.27.4 - rollup: 4.60.0 + rollup: 4.60.1 vite: 6.4.1(@types/node@25.5.0)(yaml@2.8.3) '@storybook/global@5.0.0': {} @@ -2988,11 +2935,11 @@ snapshots: react-dom: 19.2.4(react@19.2.4) storybook: 10.3.3(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4) - '@storybook/react-vite@10.3.3(esbuild@0.27.4)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(rollup@4.60.0)(storybook@10.3.3(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4))(typescript@5.9.3)(vite@6.4.1(@types/node@25.5.0)(yaml@2.8.3))': + '@storybook/react-vite@10.3.3(esbuild@0.27.4)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(rollup@4.60.1)(storybook@10.3.3(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4))(typescript@5.9.3)(vite@6.4.1(@types/node@25.5.0)(yaml@2.8.3))': dependencies: '@joshwooding/vite-plugin-react-docgen-typescript': 0.6.4(typescript@5.9.3)(vite@6.4.1(@types/node@25.5.0)(yaml@2.8.3)) - '@rollup/pluginutils': 5.3.0(rollup@4.60.0) - '@storybook/builder-vite': 10.3.3(esbuild@0.27.4)(rollup@4.60.0)(storybook@10.3.3(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4))(vite@6.4.1(@types/node@25.5.0)(yaml@2.8.3)) + '@rollup/pluginutils': 5.3.0(rollup@4.60.1) + '@storybook/builder-vite': 10.3.3(esbuild@0.27.4)(rollup@4.60.1)(storybook@10.3.3(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4))(vite@6.4.1(@types/node@25.5.0)(yaml@2.8.3)) '@storybook/react': 10.3.3(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(storybook@10.3.3(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4))(typescript@5.9.3) empathic: 2.0.0 magic-string: 0.30.21 @@ -3102,26 +3049,16 @@ snapshots: dependencies: '@types/react': 19.2.14 - '@types/react-i18next@8.1.0(i18next@25.10.9(typescript@5.9.3))(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(typescript@5.9.3)': - dependencies: - react-i18next: 16.6.6(i18next@25.10.9(typescript@5.9.3))(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(typescript@5.9.3) - transitivePeerDependencies: - - i18next - - react - - react-dom - - react-native - - typescript - '@types/react@19.2.14': dependencies: csstype: 3.2.3 '@types/resolve@1.20.6': {} - '@vitest/coverage-v8@4.1.1(vitest@4.1.1)': + '@vitest/coverage-v8@4.1.2(vitest@4.1.2)': dependencies: '@bcoe/v8-coverage': 1.0.2 - '@vitest/utils': 4.1.1 + '@vitest/utils': 4.1.2 ast-v8-to-istanbul: 1.0.0 istanbul-lib-coverage: 3.2.2 istanbul-lib-report: 3.0.1 @@ -3130,7 +3067,7 @@ snapshots: obug: 2.1.1 std-env: 4.0.0 tinyrainbow: 3.1.0 - vitest: 4.1.1(@types/node@25.5.0)(@vitest/ui@4.1.1)(jsdom@25.0.1)(vite@6.4.1(@types/node@25.5.0)(yaml@2.8.3)) + vitest: 4.1.2(@types/node@25.5.0)(@vitest/ui@4.1.2)(jsdom@25.0.1)(vite@6.4.1(@types/node@25.5.0)(yaml@2.8.3)) '@vitest/expect@3.2.4': dependencies: @@ -3140,18 +3077,18 @@ snapshots: chai: 5.3.3 tinyrainbow: 2.0.0 - '@vitest/expect@4.1.1': + '@vitest/expect@4.1.2': dependencies: '@standard-schema/spec': 1.1.0 '@types/chai': 5.2.3 - '@vitest/spy': 4.1.1 - '@vitest/utils': 4.1.1 + '@vitest/spy': 4.1.2 + '@vitest/utils': 4.1.2 chai: 6.2.2 tinyrainbow: 3.1.0 - '@vitest/mocker@4.1.1(vite@6.4.1(@types/node@25.5.0)(yaml@2.8.3))': + '@vitest/mocker@4.1.2(vite@6.4.1(@types/node@25.5.0)(yaml@2.8.3))': dependencies: - '@vitest/spy': 4.1.1 + '@vitest/spy': 4.1.2 estree-walker: 3.0.3 magic-string: 0.30.21 optionalDependencies: @@ -3161,19 +3098,19 @@ snapshots: dependencies: tinyrainbow: 2.0.0 - '@vitest/pretty-format@4.1.1': + '@vitest/pretty-format@4.1.2': dependencies: tinyrainbow: 3.1.0 - '@vitest/runner@4.1.1': + '@vitest/runner@4.1.2': dependencies: - '@vitest/utils': 4.1.1 + '@vitest/utils': 4.1.2 pathe: 2.0.3 - '@vitest/snapshot@4.1.1': + '@vitest/snapshot@4.1.2': dependencies: - '@vitest/pretty-format': 4.1.1 - '@vitest/utils': 4.1.1 + '@vitest/pretty-format': 4.1.2 + '@vitest/utils': 4.1.2 magic-string: 0.30.21 pathe: 2.0.3 @@ -3181,18 +3118,18 @@ snapshots: dependencies: tinyspy: 4.0.4 - '@vitest/spy@4.1.1': {} + '@vitest/spy@4.1.2': {} - '@vitest/ui@4.1.1(vitest@4.1.1)': + '@vitest/ui@4.1.2(vitest@4.1.2)': dependencies: - '@vitest/utils': 4.1.1 + '@vitest/utils': 4.1.2 fflate: 0.8.2 - flatted: 3.4.0 + flatted: 3.4.2 pathe: 2.0.3 sirv: 3.0.2 tinyglobby: 0.2.15 tinyrainbow: 3.1.0 - vitest: 4.1.1(@types/node@25.5.0)(@vitest/ui@4.1.1)(jsdom@25.0.1)(vite@6.4.1(@types/node@25.5.0)(yaml@2.8.3)) + vitest: 4.1.2(@types/node@25.5.0)(@vitest/ui@4.1.2)(jsdom@25.0.1)(vite@6.4.1(@types/node@25.5.0)(yaml@2.8.3)) '@vitest/utils@3.2.4': dependencies: @@ -3200,9 +3137,9 @@ snapshots: loupe: 3.2.1 tinyrainbow: 2.0.0 - '@vitest/utils@4.1.1': + '@vitest/utils@4.1.2': dependencies: - '@vitest/pretty-format': 4.1.1 + '@vitest/pretty-format': 4.1.2 convert-source-map: 2.0.0 tinyrainbow: 3.1.0 @@ -3242,23 +3179,23 @@ snapshots: asynckit@0.4.0: {} - axe-core@4.11.1: {} + axe-core@4.11.2: {} balanced-match@4.0.4: {} - baseline-browser-mapping@2.10.10: {} + baseline-browser-mapping@2.10.13: {} - brace-expansion@5.0.4: + brace-expansion@5.0.5: dependencies: balanced-match: 4.0.4 - browserslist@4.28.1: + browserslist@4.28.2: dependencies: - baseline-browser-mapping: 2.10.10 - caniuse-lite: 1.0.30001781 - electron-to-chromium: 1.5.321 + baseline-browser-mapping: 2.10.13 + caniuse-lite: 1.0.30001784 + electron-to-chromium: 1.5.330 node-releases: 2.0.36 - update-browserslist-db: 1.2.3(browserslist@4.28.1) + update-browserslist-db: 1.2.3(browserslist@4.28.2) bundle-name@4.1.0: dependencies: @@ -3269,7 +3206,7 @@ snapshots: es-errors: 1.3.0 function-bind: 1.1.2 - caniuse-lite@1.0.30001781: {} + caniuse-lite@1.0.30001784: {} chai@5.3.3: dependencies: @@ -3353,7 +3290,7 @@ snapshots: es-errors: 1.3.0 gopd: 1.2.0 - electron-to-chromium@1.5.321: {} + electron-to-chromium@1.5.330: {} emoji-regex@10.6.0: {} @@ -3462,7 +3399,7 @@ snapshots: filesize@10.1.6: {} - flatted@3.4.0: {} + flatted@3.4.2: {} form-data@4.0.5: dependencies: @@ -3501,7 +3438,7 @@ snapshots: glob@13.0.6: dependencies: - minimatch: 10.2.4 + minimatch: 10.2.5 minipass: 7.1.3 path-scurry: 2.0.2 @@ -3530,10 +3467,6 @@ snapshots: html-escaper@2.0.2: {} - html-parse-stringify@3.0.1: - dependencies: - void-elements: 3.1.0 - http-proxy-agent@7.0.2: dependencies: agent-base: 7.1.4 @@ -3550,12 +3483,6 @@ snapshots: husky@9.1.7: {} - i18next@25.10.9(typescript@5.9.3): - dependencies: - '@babel/runtime': 7.29.2 - optionalDependencies: - typescript: 5.9.3 - iconv-lite@0.6.3: dependencies: safer-buffer: 2.1.2 @@ -3701,9 +3628,9 @@ snapshots: min-indent@1.0.1: {} - minimatch@10.2.4: + minimatch@10.2.5: dependencies: - brace-expansion: 5.0.4 + brace-expansion: 5.0.5 minimist@1.2.8: {} @@ -3756,27 +3683,27 @@ snapshots: '@oxfmt/binding-win32-ia32-msvc': 0.41.0 '@oxfmt/binding-win32-x64-msvc': 0.41.0 - oxlint@1.56.0: + oxlint@1.58.0: optionalDependencies: - '@oxlint/binding-android-arm-eabi': 1.56.0 - '@oxlint/binding-android-arm64': 1.56.0 - '@oxlint/binding-darwin-arm64': 1.56.0 - '@oxlint/binding-darwin-x64': 1.56.0 - '@oxlint/binding-freebsd-x64': 1.56.0 - '@oxlint/binding-linux-arm-gnueabihf': 1.56.0 - '@oxlint/binding-linux-arm-musleabihf': 1.56.0 - '@oxlint/binding-linux-arm64-gnu': 1.56.0 - '@oxlint/binding-linux-arm64-musl': 1.56.0 - '@oxlint/binding-linux-ppc64-gnu': 1.56.0 - '@oxlint/binding-linux-riscv64-gnu': 1.56.0 - '@oxlint/binding-linux-riscv64-musl': 1.56.0 - '@oxlint/binding-linux-s390x-gnu': 1.56.0 - '@oxlint/binding-linux-x64-gnu': 1.56.0 - '@oxlint/binding-linux-x64-musl': 1.56.0 - '@oxlint/binding-openharmony-arm64': 1.56.0 - '@oxlint/binding-win32-arm64-msvc': 1.56.0 - '@oxlint/binding-win32-ia32-msvc': 1.56.0 - '@oxlint/binding-win32-x64-msvc': 1.56.0 + '@oxlint/binding-android-arm-eabi': 1.58.0 + '@oxlint/binding-android-arm64': 1.58.0 + '@oxlint/binding-darwin-arm64': 1.58.0 + '@oxlint/binding-darwin-x64': 1.58.0 + '@oxlint/binding-freebsd-x64': 1.58.0 + '@oxlint/binding-linux-arm-gnueabihf': 1.58.0 + '@oxlint/binding-linux-arm-musleabihf': 1.58.0 + '@oxlint/binding-linux-arm64-gnu': 1.58.0 + '@oxlint/binding-linux-arm64-musl': 1.58.0 + '@oxlint/binding-linux-ppc64-gnu': 1.58.0 + '@oxlint/binding-linux-riscv64-gnu': 1.58.0 + '@oxlint/binding-linux-riscv64-musl': 1.58.0 + '@oxlint/binding-linux-s390x-gnu': 1.58.0 + '@oxlint/binding-linux-x64-gnu': 1.58.0 + '@oxlint/binding-linux-x64-musl': 1.58.0 + '@oxlint/binding-openharmony-arm64': 1.58.0 + '@oxlint/binding-win32-arm64-msvc': 1.58.0 + '@oxlint/binding-win32-ia32-msvc': 1.58.0 + '@oxlint/binding-win32-x64-msvc': 1.58.0 package-json-from-dist@1.0.1: {} @@ -3837,17 +3764,6 @@ snapshots: react: 19.2.4 scheduler: 0.27.0 - react-i18next@16.6.6(i18next@25.10.9(typescript@5.9.3))(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(typescript@5.9.3): - dependencies: - '@babel/runtime': 7.29.2 - html-parse-stringify: 3.0.1 - i18next: 25.10.9(typescript@5.9.3) - react: 19.2.4 - use-sync-external-store: 1.6.0(react@19.2.4) - optionalDependencies: - react-dom: 19.2.4(react@19.2.4) - typescript: 5.9.3 - react-is@17.0.2: {} react@19.2.4: {} @@ -3883,35 +3799,35 @@ snapshots: glob: 13.0.6 package-json-from-dist: 1.0.1 - rollup@4.60.0: + rollup@4.60.1: dependencies: '@types/estree': 1.0.8 optionalDependencies: - '@rollup/rollup-android-arm-eabi': 4.60.0 - '@rollup/rollup-android-arm64': 4.60.0 - '@rollup/rollup-darwin-arm64': 4.60.0 - '@rollup/rollup-darwin-x64': 4.60.0 - '@rollup/rollup-freebsd-arm64': 4.60.0 - '@rollup/rollup-freebsd-x64': 4.60.0 - '@rollup/rollup-linux-arm-gnueabihf': 4.60.0 - '@rollup/rollup-linux-arm-musleabihf': 4.60.0 - '@rollup/rollup-linux-arm64-gnu': 4.60.0 - '@rollup/rollup-linux-arm64-musl': 4.60.0 - '@rollup/rollup-linux-loong64-gnu': 4.60.0 - '@rollup/rollup-linux-loong64-musl': 4.60.0 - '@rollup/rollup-linux-ppc64-gnu': 4.60.0 - '@rollup/rollup-linux-ppc64-musl': 4.60.0 - '@rollup/rollup-linux-riscv64-gnu': 4.60.0 - '@rollup/rollup-linux-riscv64-musl': 4.60.0 - '@rollup/rollup-linux-s390x-gnu': 4.60.0 - '@rollup/rollup-linux-x64-gnu': 4.60.0 - '@rollup/rollup-linux-x64-musl': 4.60.0 - '@rollup/rollup-openbsd-x64': 4.60.0 - '@rollup/rollup-openharmony-arm64': 4.60.0 - '@rollup/rollup-win32-arm64-msvc': 4.60.0 - '@rollup/rollup-win32-ia32-msvc': 4.60.0 - '@rollup/rollup-win32-x64-gnu': 4.60.0 - '@rollup/rollup-win32-x64-msvc': 4.60.0 + '@rollup/rollup-android-arm-eabi': 4.60.1 + '@rollup/rollup-android-arm64': 4.60.1 + '@rollup/rollup-darwin-arm64': 4.60.1 + '@rollup/rollup-darwin-x64': 4.60.1 + '@rollup/rollup-freebsd-arm64': 4.60.1 + '@rollup/rollup-freebsd-x64': 4.60.1 + '@rollup/rollup-linux-arm-gnueabihf': 4.60.1 + '@rollup/rollup-linux-arm-musleabihf': 4.60.1 + '@rollup/rollup-linux-arm64-gnu': 4.60.1 + '@rollup/rollup-linux-arm64-musl': 4.60.1 + '@rollup/rollup-linux-loong64-gnu': 4.60.1 + '@rollup/rollup-linux-loong64-musl': 4.60.1 + '@rollup/rollup-linux-ppc64-gnu': 4.60.1 + '@rollup/rollup-linux-ppc64-musl': 4.60.1 + '@rollup/rollup-linux-riscv64-gnu': 4.60.1 + '@rollup/rollup-linux-riscv64-musl': 4.60.1 + '@rollup/rollup-linux-s390x-gnu': 4.60.1 + '@rollup/rollup-linux-x64-gnu': 4.60.1 + '@rollup/rollup-linux-x64-musl': 4.60.1 + '@rollup/rollup-openbsd-x64': 4.60.1 + '@rollup/rollup-openharmony-arm64': 4.60.1 + '@rollup/rollup-win32-arm64-msvc': 4.60.1 + '@rollup/rollup-win32-ia32-msvc': 4.60.1 + '@rollup/rollup-win32-x64-gnu': 4.60.1 + '@rollup/rollup-win32-x64-msvc': 4.60.1 fsevents: 2.3.3 rrweb-cssom@0.7.1: {} @@ -4014,40 +3930,40 @@ snapshots: symbol-tree@3.2.4: {} - syncpack-darwin-arm64@14.2.1: + syncpack-darwin-arm64@14.3.0: optional: true - syncpack-darwin-x64@14.2.1: + syncpack-darwin-x64@14.3.0: optional: true - syncpack-linux-arm64-musl@14.2.1: + syncpack-linux-arm64-musl@14.3.0: optional: true - syncpack-linux-arm64@14.2.1: + syncpack-linux-arm64@14.3.0: optional: true - syncpack-linux-x64-musl@14.2.1: + syncpack-linux-x64-musl@14.3.0: optional: true - syncpack-linux-x64@14.2.1: + syncpack-linux-x64@14.3.0: optional: true - syncpack-windows-arm64@14.2.1: + syncpack-windows-arm64@14.3.0: optional: true - syncpack-windows-x64@14.2.1: + syncpack-windows-x64@14.3.0: optional: true - syncpack@14.2.1: + syncpack@14.3.0: optionalDependencies: - syncpack-darwin-arm64: 14.2.1 - syncpack-darwin-x64: 14.2.1 - syncpack-linux-arm64: 14.2.1 - syncpack-linux-arm64-musl: 14.2.1 - syncpack-linux-x64: 14.2.1 - syncpack-linux-x64-musl: 14.2.1 - syncpack-windows-arm64: 14.2.1 - syncpack-windows-x64: 14.2.1 + syncpack-darwin-arm64: 14.3.0 + syncpack-darwin-x64: 14.3.0 + syncpack-linux-arm64: 14.3.0 + syncpack-linux-arm64-musl: 14.3.0 + syncpack-linux-x64: 14.3.0 + syncpack-linux-x64-musl: 14.3.0 + syncpack-windows-arm64: 14.3.0 + syncpack-windows-x64: 14.3.0 tiny-invariant@1.3.3: {} @@ -4111,9 +4027,9 @@ snapshots: picomatch: 4.0.4 webpack-virtual-modules: 0.6.2 - update-browserslist-db@1.2.3(browserslist@4.28.1): + update-browserslist-db@1.2.3(browserslist@4.28.2): dependencies: - browserslist: 4.28.1 + browserslist: 4.28.2 escalade: 3.2.0 picocolors: 1.1.1 @@ -4137,22 +4053,22 @@ snapshots: fdir: 6.5.0(picomatch@4.0.4) picomatch: 4.0.4 postcss: 8.5.8 - rollup: 4.60.0 + rollup: 4.60.1 tinyglobby: 0.2.15 optionalDependencies: '@types/node': 25.5.0 fsevents: 2.3.3 yaml: 2.8.3 - vitest@4.1.1(@types/node@25.5.0)(@vitest/ui@4.1.1)(jsdom@25.0.1)(vite@6.4.1(@types/node@25.5.0)(yaml@2.8.3)): + vitest@4.1.2(@types/node@25.5.0)(@vitest/ui@4.1.2)(jsdom@25.0.1)(vite@6.4.1(@types/node@25.5.0)(yaml@2.8.3)): dependencies: - '@vitest/expect': 4.1.1 - '@vitest/mocker': 4.1.1(vite@6.4.1(@types/node@25.5.0)(yaml@2.8.3)) - '@vitest/pretty-format': 4.1.1 - '@vitest/runner': 4.1.1 - '@vitest/snapshot': 4.1.1 - '@vitest/spy': 4.1.1 - '@vitest/utils': 4.1.1 + '@vitest/expect': 4.1.2 + '@vitest/mocker': 4.1.2(vite@6.4.1(@types/node@25.5.0)(yaml@2.8.3)) + '@vitest/pretty-format': 4.1.2 + '@vitest/runner': 4.1.2 + '@vitest/snapshot': 4.1.2 + '@vitest/spy': 4.1.2 + '@vitest/utils': 4.1.2 es-module-lexer: 2.0.0 expect-type: 1.3.0 magic-string: 0.30.21 @@ -4168,13 +4084,11 @@ snapshots: why-is-node-running: 2.3.0 optionalDependencies: '@types/node': 25.5.0 - '@vitest/ui': 4.1.1(vitest@4.1.1) + '@vitest/ui': 4.1.2(vitest@4.1.2) jsdom: 25.0.1 transitivePeerDependencies: - msw - void-elements@3.1.0: {} - w3c-xmlserializer@5.0.0: dependencies: xml-name-validator: 5.0.0 diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 1f54703..095beb9 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -16,14 +16,12 @@ catalog: "@vitest/coverage-v8": ^4.1.0 "@vitest/ui": ^4.1.0 husky: ^9.1.7 - i18next: ^25.10.9 jsdom: ^25.0.0 lint-staged: ^16.4.0 oxfmt: ^0.41.0 oxlint: ^1.56.0 react: ^19.2.4 react-dom: ^19.2.4 - react-i18next: ^16.6.6 rimraf: ^6.1.3 storybook: ^10.2.19 syncpack: ^14.2.0 From 5b65d94cd71aeaea4603be13a374474053cfa220 Mon Sep 17 00:00:00 2001 From: kumaradityaraj Date: Wed, 1 Apr 2026 13:56:11 +0530 Subject: [PATCH 10/16] fixed ts.config Signed-off-by: kumaradityaraj --- packages/i18n/src/api/I18nChannelApi.js | 16 ------ packages/i18n/src/api/I18nEnvelopeApi.js | 16 ------ packages/i18n/src/api/index.js | 17 ------- packages/i18n/src/core/Dictionary.js | 16 ------ packages/i18n/src/core/I18n.js | 49 ------------------- packages/i18n/src/core/Wrapped.js | 18 ------- packages/i18n/src/core/immutableDeepMerge.js | 36 -------------- packages/i18n/src/core/index.js | 18 ------- packages/i18n/src/envelope/I18nService.js | 36 -------------- packages/i18n/src/envelope/index.js | 16 ------ .../i18n/src/react-components/I18nContext.js | 16 ------ .../I18nDictionariesProvider.js | 42 ---------------- .../i18n/src/react-components/I18nHtml.js | 24 --------- .../i18n/src/react-components/I18nWrapped.js | 27 ---------- .../react-components/I18nWrappedTemplate.js | 34 ------------- packages/i18n/src/react-components/index.js | 20 -------- packages/i18n/tsconfig.json | 17 +++---- 17 files changed, 8 insertions(+), 410 deletions(-) delete mode 100644 packages/i18n/src/api/I18nChannelApi.js delete mode 100644 packages/i18n/src/api/I18nEnvelopeApi.js delete mode 100644 packages/i18n/src/api/index.js delete mode 100644 packages/i18n/src/core/Dictionary.js delete mode 100644 packages/i18n/src/core/I18n.js delete mode 100644 packages/i18n/src/core/Wrapped.js delete mode 100644 packages/i18n/src/core/immutableDeepMerge.js delete mode 100644 packages/i18n/src/core/index.js delete mode 100644 packages/i18n/src/envelope/I18nService.js delete mode 100644 packages/i18n/src/envelope/index.js delete mode 100644 packages/i18n/src/react-components/I18nContext.js delete mode 100644 packages/i18n/src/react-components/I18nDictionariesProvider.js delete mode 100644 packages/i18n/src/react-components/I18nHtml.js delete mode 100644 packages/i18n/src/react-components/I18nWrapped.js delete mode 100644 packages/i18n/src/react-components/I18nWrappedTemplate.js delete mode 100644 packages/i18n/src/react-components/index.js diff --git a/packages/i18n/src/api/I18nChannelApi.js b/packages/i18n/src/api/I18nChannelApi.js deleted file mode 100644 index 54ffc94..0000000 --- a/packages/i18n/src/api/I18nChannelApi.js +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright 2021-Present The Serverless Workflow Specification Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export {}; diff --git a/packages/i18n/src/api/I18nEnvelopeApi.js b/packages/i18n/src/api/I18nEnvelopeApi.js deleted file mode 100644 index 54ffc94..0000000 --- a/packages/i18n/src/api/I18nEnvelopeApi.js +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright 2021-Present The Serverless Workflow Specification Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export {}; diff --git a/packages/i18n/src/api/index.js b/packages/i18n/src/api/index.js deleted file mode 100644 index c1972e6..0000000 --- a/packages/i18n/src/api/index.js +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright 2021-Present The Serverless Workflow Specification Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export * from "./I18nChannelApi"; -export * from "./I18nEnvelopeApi"; diff --git a/packages/i18n/src/core/Dictionary.js b/packages/i18n/src/core/Dictionary.js deleted file mode 100644 index 54ffc94..0000000 --- a/packages/i18n/src/core/Dictionary.js +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright 2021-Present The Serverless Workflow Specification Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export {}; diff --git a/packages/i18n/src/core/I18n.js b/packages/i18n/src/core/I18n.js deleted file mode 100644 index b3cdc4f..0000000 --- a/packages/i18n/src/core/I18n.js +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2021-Present The Serverless Workflow Specification Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { immutableDeepMerge } from "./immutableDeepMerge"; -export class I18n { - defaults; - dictionaries; - initialLocale; - locale; - dictionary; - constructor(defaults, dictionaries, initialLocale = defaults.locale) { - this.defaults = defaults; - this.dictionaries = dictionaries; - this.initialLocale = initialLocale; - this.locale = initialLocale; - this.updateDictionary(); - } - setLocale(locale) { - this.locale = locale; - this.updateDictionary(); - return this; - } - updateDictionary() { - const selectedDictionary = - this.dictionaries.get(this.locale) ?? - this.dictionaries.get(this.locale.split("-").shift()) ?? - {}; - this.dictionary = immutableDeepMerge(this.defaults.dictionary, selectedDictionary); - return this; - } - getCurrent() { - return this.dictionary; - } - getLocale() { - return this.locale; - } -} diff --git a/packages/i18n/src/core/Wrapped.js b/packages/i18n/src/core/Wrapped.js deleted file mode 100644 index 70a029f..0000000 --- a/packages/i18n/src/core/Wrapped.js +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright 2021-Present The Serverless Workflow Specification Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export function wrapped(wrappedName) { - return { nameValue: wrappedName }; -} diff --git a/packages/i18n/src/core/immutableDeepMerge.js b/packages/i18n/src/core/immutableDeepMerge.js deleted file mode 100644 index f3a7336..0000000 --- a/packages/i18n/src/core/immutableDeepMerge.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2021-Present The Serverless Workflow Specification Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -function deepMerge(target, source) { - Object.keys(source).forEach((key) => { - const sourceValue = source[key]; - if (!sourceValue) { - return; - } - if (typeof sourceValue === "string" || typeof sourceValue === "function") { - target[key] = sourceValue; - } else { - target[key] = deepMerge(createObjectCopy(target[key]), sourceValue); - } - }); - return target; -} -export function immutableDeepMerge(target, source) { - const targetCopy = createObjectCopy(target); - return deepMerge(targetCopy, source); -} -function createObjectCopy(obj) { - return Object.assign({}, obj); -} diff --git a/packages/i18n/src/core/index.js b/packages/i18n/src/core/index.js deleted file mode 100644 index 4fea22f..0000000 --- a/packages/i18n/src/core/index.js +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright 2021-Present The Serverless Workflow Specification Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export * from "./I18n"; -export * from "./Dictionary"; -export * from "./Wrapped"; diff --git a/packages/i18n/src/envelope/I18nService.js b/packages/i18n/src/envelope/I18nService.js deleted file mode 100644 index af27270..0000000 --- a/packages/i18n/src/envelope/I18nService.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2021-Present The Serverless Workflow Specification Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export class I18nService { - onLocaleChangeSubscriptions; - constructor(onLocaleChangeSubscriptions = []) { - this.onLocaleChangeSubscriptions = onLocaleChangeSubscriptions; - } - executeOnLocaleChangeSubscriptions(locale) { - this.onLocaleChangeSubscriptions.forEach((onLocaleChange) => { - onLocaleChange?.(locale); - }); - } - subscribeToLocaleChange(onLocaleChange) { - this.onLocaleChangeSubscriptions.push(onLocaleChange); - return onLocaleChange; - } - unsubscribeToLocaleChange(onLocaleChange) { - const index = this.onLocaleChangeSubscriptions.indexOf(onLocaleChange); - if (index > -1) { - this.onLocaleChangeSubscriptions.splice(index, 1); - } - } -} diff --git a/packages/i18n/src/envelope/index.js b/packages/i18n/src/envelope/index.js deleted file mode 100644 index 799a127..0000000 --- a/packages/i18n/src/envelope/index.js +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright 2021-Present The Serverless Workflow Specification Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export * from "./I18nService"; diff --git a/packages/i18n/src/react-components/I18nContext.js b/packages/i18n/src/react-components/I18nContext.js deleted file mode 100644 index 54ffc94..0000000 --- a/packages/i18n/src/react-components/I18nContext.js +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright 2021-Present The Serverless Workflow Specification Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export {}; diff --git a/packages/i18n/src/react-components/I18nDictionariesProvider.js b/packages/i18n/src/react-components/I18nDictionariesProvider.js deleted file mode 100644 index 620e640..0000000 --- a/packages/i18n/src/react-components/I18nDictionariesProvider.js +++ /dev/null @@ -1,42 +0,0 @@ -import { jsx as _jsx } from "react/jsx-runtime"; -/* - * Copyright 2021-Present The Serverless Workflow Specification Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import * as React from "react"; -import { useCallback, useMemo, useState } from "react"; -import { I18n } from "../core"; -export const I18nDictionariesProvider = (props) => { - const [locale, setLocale] = useState(props.initialLocale ?? props.defaults.locale); - const i18n = useMemo( - () => new I18n(props.defaults, props.dictionaries, locale), - [locale, props.defaults, props.dictionaries], - ); - const setNewLocale = useCallback( - (newLocale) => { - i18n.setLocale(newLocale); - setLocale(newLocale); - }, - [i18n], - ); - const value = useMemo( - () => ({ - locale, - setLocale: setNewLocale, - i18n: i18n.getCurrent(), - }), - [i18n, locale, setNewLocale], - ); - return _jsx(props.ctx.Provider, { value: value, children: props.children }); -}; diff --git a/packages/i18n/src/react-components/I18nHtml.js b/packages/i18n/src/react-components/I18nHtml.js deleted file mode 100644 index 849d80e..0000000 --- a/packages/i18n/src/react-components/I18nHtml.js +++ /dev/null @@ -1,24 +0,0 @@ -import { jsx as _jsx } from "react/jsx-runtime"; -/* - * Copyright 2021-Present The Serverless Workflow Specification Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import * as React from "react"; -export const I18nHtml = ({ children }) => { - let htmlText = children; - if (Array.isArray(htmlText)) { - htmlText = htmlText.join(""); - } - return _jsx("p", { style: { display: "inline" }, dangerouslySetInnerHTML: { __html: htmlText } }); -}; diff --git a/packages/i18n/src/react-components/I18nWrapped.js b/packages/i18n/src/react-components/I18nWrapped.js deleted file mode 100644 index 9d8583d..0000000 --- a/packages/i18n/src/react-components/I18nWrapped.js +++ /dev/null @@ -1,27 +0,0 @@ -import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime"; -/* - * Copyright 2021-Present The Serverless Workflow Specification Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import * as React from "react"; -export function I18nWrapped(props) { - return _jsx(_Fragment, { - children: Object.values(props.children).map((piece) => { - if (typeof piece === "string" || typeof piece === "number") { - return piece; - } - return props.components?.[piece.name]; - }), - }); -} diff --git a/packages/i18n/src/react-components/I18nWrappedTemplate.js b/packages/i18n/src/react-components/I18nWrappedTemplate.js deleted file mode 100644 index 4c3f87a..0000000 --- a/packages/i18n/src/react-components/I18nWrappedTemplate.js +++ /dev/null @@ -1,34 +0,0 @@ -import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime"; -/* - * Copyright 2021-Present The Serverless Workflow Specification Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import * as React from "react"; -// component to replace placeholders in text with React components -export const I18nWrappedTemplate = ({ text, interpolationMap }) => { - // Matches {key} where key is one of the placeholder keys - const interpolationMapRegex = new RegExp( - `\\{(${Object.keys(interpolationMap).join("|")})\\}`, - "g", - ); - return _jsx(_Fragment, { - children: text - .split(interpolationMapRegex) - .map((value, i) => - value in interpolationMap - ? _jsx(React.Fragment, { children: interpolationMap[value] }, i) - : value, - ), - }); -}; diff --git a/packages/i18n/src/react-components/index.js b/packages/i18n/src/react-components/index.js deleted file mode 100644 index d273bb5..0000000 --- a/packages/i18n/src/react-components/index.js +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright 2021-Present The Serverless Workflow Specification Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export * from "./I18nContext"; -export * from "./I18nDictionariesProvider"; -export * from "./I18nHtml"; -export * from "./I18nWrapped"; -export * from "./I18nWrappedTemplate"; diff --git a/packages/i18n/tsconfig.json b/packages/i18n/tsconfig.json index e8a91ff..f74da5e 100644 --- a/packages/i18n/tsconfig.json +++ b/packages/i18n/tsconfig.json @@ -1,15 +1,14 @@ { "extends": "../../tsconfig.base.json", - "types": ["node"], "compilerOptions": { - "outDir": "dist", - "rootDir": "src", + "baseUrl": ".", "declaration": true, - "emitDeclarationOnly": false, - "paths": { - "@serverlessworkflow/i18n": ["./i18n/src"] - } + "declarationMap": true, + "sourceMap": true, + + "rootDirs": ["./src", "./tests"], + "outDir": "./dist" }, - "include": ["src"], - "exclude": ["node_modules", "dist"] + "include": ["src/**/*"], + "exclude": ["node_modules", "dist", "dist-storybook"] } From 44ff6f355a4a93873ca00949179f7dc32aac5b58 Mon Sep 17 00:00:00 2001 From: kumaradityaraj Date: Wed, 1 Apr 2026 14:05:15 +0530 Subject: [PATCH 11/16] copilot suggestions Signed-off-by: kumaradityaraj --- packages/i18n/package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/i18n/package.json b/packages/i18n/package.json index b16539d..50291ce 100644 --- a/packages/i18n/package.json +++ b/packages/i18n/package.json @@ -6,7 +6,6 @@ "src" ], "type": "module", - "main": "dist/index.js", "scripts": { "clean": "rimraf ./dist", "build": "pnpm clean && tsc -p tsconfig.json", From 95ba43b6bd19353733f0a215e1ea07e112bea4bd Mon Sep 17 00:00:00 2001 From: kumaradityaraj Date: Thu, 2 Apr 2026 14:04:54 +0530 Subject: [PATCH 12/16] new implementation Signed-off-by: kumaradityaraj --- packages/i18n/package.json | 8 + packages/i18n/src/api/I18nEnvelopeApi.ts | 19 - packages/i18n/src/api/index.ts | 18 - packages/i18n/src/core/Dictionary.ts | 48 -- packages/i18n/src/core/I18n.ts | 61 -- packages/i18n/src/core/Wrapped.ts | 26 - .../src/core/createI18n.ts} | 16 +- packages/i18n/src/core/immutableDeepMerge.ts | 51 -- packages/i18n/src/core/index.ts | 19 - packages/i18n/src/envelope/I18nService.ts | 37 -- packages/i18n/src/{envelope => }/index.ts | 4 +- .../i18n/src/react-components/I18nContext.ts | 24 - .../I18nDictionariesProvider.tsx | 58 -- .../i18n/src/react-components/I18nWrapped.tsx | 48 -- .../react-components/I18nWrappedTemplate.tsx | 46 -- packages/i18n/src/react-components/index.ts | 21 - packages/i18n/src/react/I18nProvider.tsx | 46 ++ .../I18nHtml.tsx => utils/detectLocale.ts} | 28 +- .../src/diagram-editor/DiagramEditor.tsx | 38 +- .../src/i18n/index.ts | 18 - .../src/i18n/locales/en.ts | 10 +- .../src/i18n/locales/fr.ts} | 10 +- .../src/i18n/locales/index.ts | 8 +- .../src/i18n/setup.ts | 35 -- pnpm-lock.yaml | 556 +++++++++--------- 25 files changed, 398 insertions(+), 855 deletions(-) delete mode 100644 packages/i18n/src/api/I18nEnvelopeApi.ts delete mode 100644 packages/i18n/src/api/index.ts delete mode 100644 packages/i18n/src/core/Dictionary.ts delete mode 100644 packages/i18n/src/core/I18n.ts delete mode 100644 packages/i18n/src/core/Wrapped.ts rename packages/{serverless-workflow-diagram-editor/src/i18n/SwdEditorI18n.ts => i18n/src/core/createI18n.ts} (68%) delete mode 100644 packages/i18n/src/core/immutableDeepMerge.ts delete mode 100644 packages/i18n/src/core/index.ts delete mode 100644 packages/i18n/src/envelope/I18nService.ts rename packages/i18n/src/{envelope => }/index.ts (85%) delete mode 100644 packages/i18n/src/react-components/I18nContext.ts delete mode 100644 packages/i18n/src/react-components/I18nDictionariesProvider.tsx delete mode 100644 packages/i18n/src/react-components/I18nWrapped.tsx delete mode 100644 packages/i18n/src/react-components/I18nWrappedTemplate.tsx delete mode 100644 packages/i18n/src/react-components/index.ts create mode 100644 packages/i18n/src/react/I18nProvider.tsx rename packages/i18n/src/{react-components/I18nHtml.tsx => utils/detectLocale.ts} (51%) delete mode 100644 packages/serverless-workflow-diagram-editor/src/i18n/index.ts rename packages/{i18n/src/api/I18nChannelApi.ts => serverless-workflow-diagram-editor/src/i18n/locales/fr.ts} (78%) delete mode 100644 packages/serverless-workflow-diagram-editor/src/i18n/setup.ts diff --git a/packages/i18n/package.json b/packages/i18n/package.json index 50291ce..75287b2 100644 --- a/packages/i18n/package.json +++ b/packages/i18n/package.json @@ -6,6 +6,14 @@ "src" ], "type": "module", + "main": "./dist/index.js", + "types": "./dist/index.d.ts", + "exports": { + ".": { + "import": "./dist/index.js", + "types": "./dist/index.d.ts" + } + }, "scripts": { "clean": "rimraf ./dist", "build": "pnpm clean && tsc -p tsconfig.json", diff --git a/packages/i18n/src/api/I18nEnvelopeApi.ts b/packages/i18n/src/api/I18nEnvelopeApi.ts deleted file mode 100644 index 4af31cb..0000000 --- a/packages/i18n/src/api/I18nEnvelopeApi.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright 2021-Present The Serverless Workflow Specification Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export interface I18nEnvelopeApi { - editorI18n_localeChange(locale: string): void; -} diff --git a/packages/i18n/src/api/index.ts b/packages/i18n/src/api/index.ts deleted file mode 100644 index cf967b3..0000000 --- a/packages/i18n/src/api/index.ts +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright 2021-Present The Serverless Workflow Specification Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export * from "./I18nChannelApi"; -export * from "./I18nEnvelopeApi"; diff --git a/packages/i18n/src/core/Dictionary.ts b/packages/i18n/src/core/Dictionary.ts deleted file mode 100644 index bd9155b..0000000 --- a/packages/i18n/src/core/Dictionary.ts +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2021-Present The Serverless Workflow Specification Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { Wrapped } from "./Wrapped"; - -export interface I18nDefaults> { - locale: string; - dictionary: D; -} - -export type I18nDictionaries> = Map< - string, - TranslatedDictionary ->; - -export type DictionaryInterpolation = (...args: Array) => string; - -export type ReferenceDictionary> = { - [K in keyof D]: D[K] extends string - ? string - : D[K] extends (...args: any[]) => string - ? DictionaryInterpolation - : D[K] extends Wrapped - ? Wrapped - : D[K] extends Array> - ? Array> - : D[K] extends Record - ? ReferenceDictionary - : never; -}; - -// Locales that aren't the default should implement this interface -export type TranslatedDictionary> = DeepOptional; - -type DeepOptional = { [K in keyof D]?: DeepOptional }; diff --git a/packages/i18n/src/core/I18n.ts b/packages/i18n/src/core/I18n.ts deleted file mode 100644 index d0e4c9c..0000000 --- a/packages/i18n/src/core/I18n.ts +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright 2021-Present The Serverless Workflow Specification Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { - I18nDefaults, - I18nDictionaries, - ReferenceDictionary, - TranslatedDictionary, -} from "./Dictionary"; -import { immutableDeepMerge } from "./immutableDeepMerge"; - -export class I18n> { - private locale: string; - private dictionary!: D; - - constructor( - private readonly defaults: I18nDefaults, - private readonly dictionaries: I18nDictionaries, - private readonly initialLocale = defaults.locale, - ) { - this.locale = initialLocale; - this.updateDictionary(); - } - - public setLocale(locale: string): I18n { - this.locale = locale; - this.updateDictionary(); - return this; - } - - private updateDictionary(): I18n { - const selectedDictionary = - this.dictionaries.get(this.locale) ?? - this.dictionaries.get(this.locale.split("-").shift()!) ?? - {}; - - this.dictionary = immutableDeepMerge(this.defaults.dictionary, selectedDictionary) as D; - return this; - } - - public getCurrent(): D { - return this.dictionary; - } - - public getLocale(): string { - return this.locale; - } -} diff --git a/packages/i18n/src/core/Wrapped.ts b/packages/i18n/src/core/Wrapped.ts deleted file mode 100644 index 17e58da..0000000 --- a/packages/i18n/src/core/Wrapped.ts +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2021-Present The Serverless Workflow Specification Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export interface Wrapped { - nameValue: Name; -} - -export function wrapped(wrappedName: Name): Wrapped { - return { nameValue: wrappedName }; -} - -export type ExtractWrappedComponentNames = - Component extends Wrapped ? Name : never; diff --git a/packages/serverless-workflow-diagram-editor/src/i18n/SwdEditorI18n.ts b/packages/i18n/src/core/createI18n.ts similarity index 68% rename from packages/serverless-workflow-diagram-editor/src/i18n/SwdEditorI18n.ts rename to packages/i18n/src/core/createI18n.ts index 213b830..dc8e472 100644 --- a/packages/serverless-workflow-diagram-editor/src/i18n/SwdEditorI18n.ts +++ b/packages/i18n/src/core/createI18n.ts @@ -14,12 +14,16 @@ * limitations under the License. */ -import { ReferenceDictionary } from "@serverlessworkflow/i18n/dist/core"; +export type Dictionary = Record; +export type Dictionaries = Record; -interface SwdEditorDictionary extends ReferenceDictionary<{}> {} +export function createI18n(dictionaries: Dictionaries, locale: string) { + function t(key: string): string { + return dictionaries[locale]?.[key] ?? key; + } -export interface SwdEditorI18n extends SwdEditorDictionary {} - -export interface SwdEditorI18n { - hello: string; + return { + t, + locale, + }; } diff --git a/packages/i18n/src/core/immutableDeepMerge.ts b/packages/i18n/src/core/immutableDeepMerge.ts deleted file mode 100644 index 7a49bd3..0000000 --- a/packages/i18n/src/core/immutableDeepMerge.ts +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2021-Present The Serverless Workflow Specification Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { DictionaryInterpolation, ReferenceDictionary, TranslatedDictionary } from "./Dictionary"; - -function deepMerge>( - target: ReferenceDictionary, - source: TranslatedDictionary>, -): ReferenceDictionary { - (Object.keys(source) as Array>).forEach((key) => { - const sourceValue = source[key]; - - if (!sourceValue) { - return; - } - if (typeof sourceValue === "string" || typeof sourceValue === "function") { - target[key] = sourceValue as ReferenceDictionary[typeof key]; - } else { - target[key] = deepMerge( - createObjectCopy(target[key] as ReferenceDictionary), - sourceValue as TranslatedDictionary>, - ) as ReferenceDictionary[typeof key]; - } - }); - return target; -} - -export function immutableDeepMerge>( - target: ReferenceDictionary, - source: TranslatedDictionary>, -) { - const targetCopy = createObjectCopy(target); - return deepMerge(targetCopy, source); -} - -function createObjectCopy>(obj?: T) { - return Object.assign({} as T, obj); -} diff --git a/packages/i18n/src/core/index.ts b/packages/i18n/src/core/index.ts deleted file mode 100644 index ec44e83..0000000 --- a/packages/i18n/src/core/index.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright 2021-Present The Serverless Workflow Specification Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export * from "./I18n"; -export * from "./Dictionary"; -export * from "./Wrapped"; diff --git a/packages/i18n/src/envelope/I18nService.ts b/packages/i18n/src/envelope/I18nService.ts deleted file mode 100644 index e0288c8..0000000 --- a/packages/i18n/src/envelope/I18nService.ts +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 2021-Present The Serverless Workflow Specification Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export class I18nService { - constructor(private readonly onLocaleChangeSubscriptions: Array<(locale: string) => void> = []) {} - - public executeOnLocaleChangeSubscriptions(locale: string) { - this.onLocaleChangeSubscriptions.forEach((onLocaleChange) => { - onLocaleChange?.(locale); - }); - } - - public subscribeToLocaleChange(onLocaleChange: (locale: string) => void) { - this.onLocaleChangeSubscriptions.push(onLocaleChange); - return onLocaleChange; - } - - public unsubscribeToLocaleChange(onLocaleChange: (locale: string) => void) { - const index = this.onLocaleChangeSubscriptions.indexOf(onLocaleChange); - if (index > -1) { - this.onLocaleChangeSubscriptions.splice(index, 1); - } - } -} diff --git a/packages/i18n/src/envelope/index.ts b/packages/i18n/src/index.ts similarity index 85% rename from packages/i18n/src/envelope/index.ts rename to packages/i18n/src/index.ts index fefa6cd..f1e375f 100644 --- a/packages/i18n/src/envelope/index.ts +++ b/packages/i18n/src/index.ts @@ -14,4 +14,6 @@ * limitations under the License. */ -export * from "./I18nService"; +export * from "./react/I18nProvider"; +export * from "./core/createI18n"; +export * from "./utils/detectLocale"; diff --git a/packages/i18n/src/react-components/I18nContext.ts b/packages/i18n/src/react-components/I18nContext.ts deleted file mode 100644 index 2ec3b1f..0000000 --- a/packages/i18n/src/react-components/I18nContext.ts +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2021-Present The Serverless Workflow Specification Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import * as React from "react"; -import { ReferenceDictionary } from "../core"; - -export interface I18nContextType> { - locale: string; - setLocale: React.Dispatch; - i18n: D; -} diff --git a/packages/i18n/src/react-components/I18nDictionariesProvider.tsx b/packages/i18n/src/react-components/I18nDictionariesProvider.tsx deleted file mode 100644 index 9d120a7..0000000 --- a/packages/i18n/src/react-components/I18nDictionariesProvider.tsx +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright 2021-Present The Serverless Workflow Specification Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import * as React from "react"; -import { useCallback, useMemo, useState } from "react"; -import { I18n, I18nDefaults, I18nDictionaries, ReferenceDictionary } from "../core"; -import { I18nContextType } from "./I18nContext"; - -export interface I18nDictionariesProviderProps> { - defaults: I18nDefaults; - dictionaries: I18nDictionaries; - initialLocale?: string; - ctx: React.Context>; - children: React.ReactNode; -} - -export const I18nDictionariesProvider = >( - props: I18nDictionariesProviderProps, -) => { - const [locale, setLocale] = useState(props.initialLocale ?? props.defaults.locale); - - const i18n = useMemo( - () => new I18n(props.defaults, props.dictionaries, locale), - [locale, props.defaults, props.dictionaries], - ); - - const setNewLocale = useCallback( - (newLocale: string) => { - i18n.setLocale(newLocale); - setLocale(newLocale); - }, - [i18n], - ); - - const value = useMemo( - () => ({ - locale, - setLocale: setNewLocale, - i18n: i18n.getCurrent(), - }), - [i18n, locale, setNewLocale], - ); - - return {props.children}; -}; diff --git a/packages/i18n/src/react-components/I18nWrapped.tsx b/packages/i18n/src/react-components/I18nWrapped.tsx deleted file mode 100644 index 5e57212..0000000 --- a/packages/i18n/src/react-components/I18nWrapped.tsx +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2021-Present The Serverless Workflow Specification Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import * as React from "react"; -import { ExtractWrappedComponentNames, Wrapped } from "../core"; - -type Components> = { - [K in ExtractWrappedComponentNames]: React.ReactNode; -}; - -interface ComponentChildren { - [x: number]: string | number | Component; -} - -interface Children { - [x: number]: string | number; -} - -interface Props { - components: Component extends Wrapped ? Components : undefined; - children: Component extends Wrapped ? ComponentChildren : Children; -} - -export function I18nWrapped(props: Props) { - return ( - <> - {Object.values(props.children).map((piece: any) => { - if (typeof piece === "string" || typeof piece === "number") { - return piece; - } - return props.components?.[piece.name as ExtractWrappedComponentNames]; - })} - - ); -} diff --git a/packages/i18n/src/react-components/I18nWrappedTemplate.tsx b/packages/i18n/src/react-components/I18nWrappedTemplate.tsx deleted file mode 100644 index af78dc2..0000000 --- a/packages/i18n/src/react-components/I18nWrappedTemplate.tsx +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2021-Present The Serverless Workflow Specification Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import * as React from "react"; - -// component to replace placeholders in text with React components -export const I18nWrappedTemplate = ({ - text, - interpolationMap, -}: { - text: string; - interpolationMap: Record; -}) => { - // Matches {key} where key is one of the placeholder keys - const interpolationMapRegex = new RegExp( - `\\{(${Object.keys(interpolationMap).join("|")})\\}`, - "g", - ); - - return ( - <> - {text - .split(interpolationMapRegex) - .map((value, i) => - value in interpolationMap ? ( - {interpolationMap[value]} - ) : ( - value - ), - )} - - ); -}; diff --git a/packages/i18n/src/react-components/index.ts b/packages/i18n/src/react-components/index.ts deleted file mode 100644 index 16ad12c..0000000 --- a/packages/i18n/src/react-components/index.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2021-Present The Serverless Workflow Specification Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export * from "./I18nContext"; -export * from "./I18nDictionariesProvider"; -export * from "./I18nHtml"; -export * from "./I18nWrapped"; -export * from "./I18nWrappedTemplate"; diff --git a/packages/i18n/src/react/I18nProvider.tsx b/packages/i18n/src/react/I18nProvider.tsx new file mode 100644 index 0000000..9e82fd1 --- /dev/null +++ b/packages/i18n/src/react/I18nProvider.tsx @@ -0,0 +1,46 @@ +/* + * Copyright 2021-Present The Serverless Workflow Specification Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import React, { createContext, useContext, useMemo } from "react"; +import { createI18n, Dictionaries } from "../core/createI18n"; + +type I18nContextType = ReturnType; + +const I18nContext = createContext(null); + +export const I18nProvider = ({ + children, + locale, + dictionaries, +}: { + children: React.ReactNode; + locale: string; + dictionaries: Dictionaries; +}) => { + const i18n = useMemo(() => { + return createI18n(dictionaries, locale); + }, [locale, dictionaries]); + + return {children}; +}; + +export const useI18n = () => { + const ctx = useContext(I18nContext); + if (!ctx) { + throw new Error("useI18n must be used inside I18nProvider"); + } + return ctx; +}; diff --git a/packages/i18n/src/react-components/I18nHtml.tsx b/packages/i18n/src/utils/detectLocale.ts similarity index 51% rename from packages/i18n/src/react-components/I18nHtml.tsx rename to packages/i18n/src/utils/detectLocale.ts index d534988..bd1de45 100644 --- a/packages/i18n/src/react-components/I18nHtml.tsx +++ b/packages/i18n/src/utils/detectLocale.ts @@ -14,17 +14,23 @@ * limitations under the License. */ -import * as React from "react"; -import { FunctionComponent } from "react"; +export function detectLocale(supportedLocales: readonly string[], fallback: string = "en"): string { + if (typeof navigator === "undefined") { + return fallback; + } + const languages = + navigator.languages && navigator.languages.length > 0 + ? navigator.languages + : [navigator.language]; -interface Props { - children: string | string[]; -} + const normalizedSupported = supportedLocales.map((l) => l.toLowerCase().trim()); + for (const lang of languages) { + if (!lang) continue; -export const I18nHtml: FunctionComponent = ({ children }) => { - let htmlText = children; - if (Array.isArray(htmlText)) { - htmlText = htmlText.join(""); + const short = lang.split("-")[0]?.toLowerCase().trim(); + if (short && normalizedSupported.includes(short)) { + return short; + } } - return

; -}; + return fallback; +} diff --git a/packages/serverless-workflow-diagram-editor/src/diagram-editor/DiagramEditor.tsx b/packages/serverless-workflow-diagram-editor/src/diagram-editor/DiagramEditor.tsx index 92eb1b9..7b5a1ed 100644 --- a/packages/serverless-workflow-diagram-editor/src/diagram-editor/DiagramEditor.tsx +++ b/packages/serverless-workflow-diagram-editor/src/diagram-editor/DiagramEditor.tsx @@ -14,17 +14,10 @@ * limitations under the License. */ -import { CSSProperties } from "react"; -import { - swdEditorDictionaries, - SwdEditorI18nContext, - swdEditorI18nDefaults, - useSwdEditorI18n, -} from "../i18n"; -import { I18nDictionariesProvider } from "@serverlessworkflow/i18n/dist/react-components"; import * as React from "react"; import { Diagram, DiagramRef } from "../react-flow/diagram/Diagram"; - +import { I18nProvider, useI18n, detectLocale } from "@serverlessworkflow/i18n"; +import { dictionaries } from "../i18n/locales"; /** * DiagramEditor component API */ @@ -34,23 +27,15 @@ export type DiagramEditorRef = { export type DiagramEditorProps = { isReadOnly: boolean; - locale: string; + locale?: string; }; -export const DiagramEditor = (props: DiagramEditorProps) => { - return ( - - - - ); +const Content = () => { + const { t } = useI18n(); + return

{t("save")}

; }; -export const DiagramEditorInner = (props: DiagramEditorProps) => { +export const DiagramEditor = (props: DiagramEditorProps) => { // TODO: i18n // TODO: store, context // TODO: ErrorBoundary / fallback @@ -58,7 +43,8 @@ export const DiagramEditorInner = (props: DiagramEditorProps) => { // Refs const diagramDivRef = React.useRef(null); const diagramRef = React.useRef(null); - const { i18n } = useSwdEditorI18n(); + const supportedLocales = Object.keys(dictionaries); + const locale = detectLocale(supportedLocales); // Allow imperatively controlling the Editor // React.useImperativeHandle( @@ -73,8 +59,10 @@ export const DiagramEditorInner = (props: DiagramEditorProps) => { return ( <> - -

{i18n.hello}

+ + + + ); }; diff --git a/packages/serverless-workflow-diagram-editor/src/i18n/index.ts b/packages/serverless-workflow-diagram-editor/src/i18n/index.ts deleted file mode 100644 index 16d5d38..0000000 --- a/packages/serverless-workflow-diagram-editor/src/i18n/index.ts +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright 2021-Present The Serverless Workflow Specification Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export * from "./SwdEditorI18n"; -export * from "./setup"; diff --git a/packages/serverless-workflow-diagram-editor/src/i18n/locales/en.ts b/packages/serverless-workflow-diagram-editor/src/i18n/locales/en.ts index 6f109ef..9885bd0 100644 --- a/packages/serverless-workflow-diagram-editor/src/i18n/locales/en.ts +++ b/packages/serverless-workflow-diagram-editor/src/i18n/locales/en.ts @@ -14,8 +14,10 @@ * limitations under the License. */ -import { SwdEditorI18n } from "../SwdEditorI18n"; +export const en = { + save: "Save", + delete: "Delete", + cancel: "Cancel", +} as const; -export const en: SwdEditorI18n = { - hello: "Welcome to the editor", -}; +export type TranslationKeys = keyof typeof en; diff --git a/packages/i18n/src/api/I18nChannelApi.ts b/packages/serverless-workflow-diagram-editor/src/i18n/locales/fr.ts similarity index 78% rename from packages/i18n/src/api/I18nChannelApi.ts rename to packages/serverless-workflow-diagram-editor/src/i18n/locales/fr.ts index 11816ca..ee0928a 100644 --- a/packages/i18n/src/api/I18nChannelApi.ts +++ b/packages/serverless-workflow-diagram-editor/src/i18n/locales/fr.ts @@ -14,6 +14,10 @@ * limitations under the License. */ -export interface I18nChannelApi { - editorI18n_getLocale(): Promise; -} +import type { TranslationKeys } from "./en"; + +export const fr: Record = { + save: "Sauvegarder", + delete: "Supprimer", + cancel: "Annuler", +}; diff --git a/packages/serverless-workflow-diagram-editor/src/i18n/locales/index.ts b/packages/serverless-workflow-diagram-editor/src/i18n/locales/index.ts index f55c535..4806f68 100644 --- a/packages/serverless-workflow-diagram-editor/src/i18n/locales/index.ts +++ b/packages/serverless-workflow-diagram-editor/src/i18n/locales/index.ts @@ -14,4 +14,10 @@ * limitations under the License. */ -export { en } from "./en"; +import { en } from "./en"; +import { fr } from "./fr"; + +export const dictionaries = { + en, + fr, +}; diff --git a/packages/serverless-workflow-diagram-editor/src/i18n/setup.ts b/packages/serverless-workflow-diagram-editor/src/i18n/setup.ts deleted file mode 100644 index 32e4d3f..0000000 --- a/packages/serverless-workflow-diagram-editor/src/i18n/setup.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2021-Present The Serverless Workflow Specification Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import * as React from "react"; -import { useContext } from "react"; -import { en } from "./locales"; -import { I18nContextType } from "@serverlessworkflow/i18n/dist/react-components"; -import { SwdEditorI18n } from "./SwdEditorI18n"; -import { I18nDefaults, I18nDictionaries } from "@serverlessworkflow/i18n/dist/core"; - -export const swdEditorI18nDefaults: I18nDefaults = { - locale: "en", - dictionary: en, -}; -export const swdEditorDictionaries: I18nDictionaries = new Map([["en", en]]); -export const SwdEditorI18nContext = React.createContext>( - {} as never, -); - -export function useSwdEditorI18n(): I18nContextType { - return useContext(SwdEditorI18nContext); -} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3f2645d..2266abe 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -11,16 +11,16 @@ catalogs: version: 5.1.1 '@storybook/addon-a11y': specifier: ^10.2.19 - version: 10.3.3 + version: 10.3.4 '@storybook/addon-docs': specifier: ^10.2.19 - version: 10.3.3 + version: 10.3.4 '@storybook/addon-vitest': specifier: ^10.2.19 - version: 10.3.3 + version: 10.3.4 '@storybook/react-vite': specifier: ^10.2.19 - version: 10.3.3 + version: 10.3.4 '@testing-library/dom': specifier: ^10.4.1 version: 10.4.1 @@ -50,7 +50,7 @@ catalogs: version: 4.1.2 '@xyflow/react': specifier: ^12.10.1 - version: 12.10.1 + version: 12.10.2 husky: specifier: ^9.1.7 version: 9.1.7 @@ -65,7 +65,7 @@ catalogs: version: 0.41.0 oxlint: specifier: ^1.56.0 - version: 1.57.0 + version: 1.58.0 react: specifier: ^19.2.4 version: 19.2.4 @@ -77,7 +77,7 @@ catalogs: version: 6.1.3 storybook: specifier: ^10.2.19 - version: 10.3.3 + version: 10.3.4 syncpack: specifier: ^14.2.0 version: 14.3.0 @@ -146,23 +146,23 @@ importers: version: link:../i18n '@xyflow/react': specifier: 'catalog:' - version: 12.10.1(@types/react@19.2.14)(react-dom@19.2.4(react@19.2.4))(react@19.2.4) + version: 12.10.2(@types/react@19.2.14)(react-dom@19.2.4(react@19.2.4))(react@19.2.4) devDependencies: '@chromatic-com/storybook': specifier: 'catalog:' - version: 5.1.1(storybook@10.3.3(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)) + version: 5.1.1(storybook@10.3.4(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)) '@storybook/addon-a11y': specifier: 'catalog:' - version: 10.3.3(storybook@10.3.3(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)) + version: 10.3.4(storybook@10.3.4(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)) '@storybook/addon-docs': specifier: 'catalog:' - version: 10.3.3(@types/react@19.2.14)(esbuild@0.27.4)(rollup@4.60.1)(storybook@10.3.3(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4))(vite@6.4.1(@types/node@25.5.0)(yaml@2.8.3)) + version: 10.3.4(@types/react@19.2.14)(esbuild@0.27.5)(rollup@4.60.1)(storybook@10.3.4(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4))(vite@6.4.1(@types/node@25.5.0)(yaml@2.8.3)) '@storybook/addon-vitest': specifier: 'catalog:' - version: 10.3.3(@vitest/runner@4.1.2)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(storybook@10.3.3(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4))(vitest@4.1.2) + version: 10.3.4(@vitest/runner@4.1.2)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(storybook@10.3.4(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4))(vitest@4.1.2) '@storybook/react-vite': specifier: 'catalog:' - version: 10.3.3(esbuild@0.27.4)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(rollup@4.60.1)(storybook@10.3.3(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4))(typescript@5.9.3)(vite@6.4.1(@types/node@25.5.0)(yaml@2.8.3)) + version: 10.3.4(esbuild@0.27.5)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(rollup@4.60.1)(storybook@10.3.4(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4))(typescript@5.9.3)(vite@6.4.1(@types/node@25.5.0)(yaml@2.8.3)) '@testing-library/dom': specifier: 'catalog:' version: 10.4.1 @@ -198,7 +198,7 @@ importers: version: 0.41.0 oxlint: specifier: 'catalog:' - version: 1.57.0 + version: 1.58.0 react: specifier: 'catalog:' version: 19.2.4 @@ -210,7 +210,7 @@ importers: version: 6.1.3 storybook: specifier: 'catalog:' - version: 10.3.3(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4) + version: 10.3.4(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4) vite: specifier: 'catalog:' version: 6.4.1(@types/node@25.5.0)(yaml@2.8.3) @@ -344,8 +344,8 @@ packages: cpu: [ppc64] os: [aix] - '@esbuild/aix-ppc64@0.27.4': - resolution: {integrity: sha512-cQPwL2mp2nSmHHJlCyoXgHGhbEPMrEEU5xhkcy3Hs/O7nGZqEpZ2sUtLaL9MORLtDfRvVl2/3PAuEkYZH0Ty8Q==} + '@esbuild/aix-ppc64@0.27.5': + resolution: {integrity: sha512-nGsF/4C7uzUj+Nj/4J+Zt0bYQ6bz33Phz8Lb2N80Mti1HjGclTJdXZ+9APC4kLvONbjxN1zfvYNd8FEcbBK/MQ==} engines: {node: '>=18'} cpu: [ppc64] os: [aix] @@ -356,8 +356,8 @@ packages: cpu: [arm64] os: [android] - '@esbuild/android-arm64@0.27.4': - resolution: {integrity: sha512-gdLscB7v75wRfu7QSm/zg6Rx29VLdy9eTr2t44sfTW7CxwAtQghZ4ZnqHk3/ogz7xao0QAgrkradbBzcqFPasw==} + '@esbuild/android-arm64@0.27.5': + resolution: {integrity: sha512-Oeghq+XFgh1pUGd1YKs4DDoxzxkoUkvko+T/IVKwlghKLvvjbGFB3ek8VEDBmNvqhwuL0CQS3cExdzpmUyIrgA==} engines: {node: '>=18'} cpu: [arm64] os: [android] @@ -368,8 +368,8 @@ packages: cpu: [arm] os: [android] - '@esbuild/android-arm@0.27.4': - resolution: {integrity: sha512-X9bUgvxiC8CHAGKYufLIHGXPJWnr0OCdR0anD2e21vdvgCI8lIfqFbnoeOz7lBjdrAGUhqLZLcQo6MLhTO2DKQ==} + '@esbuild/android-arm@0.27.5': + resolution: {integrity: sha512-Cv781jd0Rfj/paoNrul1/r4G0HLvuFKYh7C9uHZ2Pl8YXstzvCyyeWENTFR9qFnRzNMCjXmsulZuvosDg10Mog==} engines: {node: '>=18'} cpu: [arm] os: [android] @@ -380,8 +380,8 @@ packages: cpu: [x64] os: [android] - '@esbuild/android-x64@0.27.4': - resolution: {integrity: sha512-PzPFnBNVF292sfpfhiyiXCGSn9HZg5BcAz+ivBuSsl6Rk4ga1oEXAamhOXRFyMcjwr2DVtm40G65N3GLeH1Lvw==} + '@esbuild/android-x64@0.27.5': + resolution: {integrity: sha512-nQD7lspbzerlmtNOxYMFAGmhxgzn8Z7m9jgFkh6kpkjsAhZee1w8tJW3ZlW+N9iRePz0oPUDrYrXidCPSImD0Q==} engines: {node: '>=18'} cpu: [x64] os: [android] @@ -392,8 +392,8 @@ packages: cpu: [arm64] os: [darwin] - '@esbuild/darwin-arm64@0.27.4': - resolution: {integrity: sha512-b7xaGIwdJlht8ZFCvMkpDN6uiSmnxxK56N2GDTMYPr2/gzvfdQN8rTfBsvVKmIVY/X7EM+/hJKEIbbHs9oA4tQ==} + '@esbuild/darwin-arm64@0.27.5': + resolution: {integrity: sha512-I+Ya/MgC6rr8oRWGRDF3BXDfP8K1BVUggHqN6VI2lUZLdDi1IM1v2cy0e3lCPbP+pVcK3Tv8cgUhHse1kaNZZw==} engines: {node: '>=18'} cpu: [arm64] os: [darwin] @@ -404,8 +404,8 @@ packages: cpu: [x64] os: [darwin] - '@esbuild/darwin-x64@0.27.4': - resolution: {integrity: sha512-sR+OiKLwd15nmCdqpXMnuJ9W2kpy0KigzqScqHI3Hqwr7IXxBp3Yva+yJwoqh7rE8V77tdoheRYataNKL4QrPw==} + '@esbuild/darwin-x64@0.27.5': + resolution: {integrity: sha512-MCjQUtC8wWJn/pIPM7vQaO69BFgwPD1jriEdqwTCKzWjGgkMbcg+M5HzrOhPhuYe1AJjXlHmD142KQf+jnYj8A==} engines: {node: '>=18'} cpu: [x64] os: [darwin] @@ -416,8 +416,8 @@ packages: cpu: [arm64] os: [freebsd] - '@esbuild/freebsd-arm64@0.27.4': - resolution: {integrity: sha512-jnfpKe+p79tCnm4GVav68A7tUFeKQwQyLgESwEAUzyxk/TJr4QdGog9sqWNcUbr/bZt/O/HXouspuQDd9JxFSw==} + '@esbuild/freebsd-arm64@0.27.5': + resolution: {integrity: sha512-X6xVS+goSH0UelYXnuf4GHLwpOdc8rgK/zai+dKzBMnncw7BTQIwquOodE7EKvY2UVUetSqyAfyZC1D+oqLQtg==} engines: {node: '>=18'} cpu: [arm64] os: [freebsd] @@ -428,8 +428,8 @@ packages: cpu: [x64] os: [freebsd] - '@esbuild/freebsd-x64@0.27.4': - resolution: {integrity: sha512-2kb4ceA/CpfUrIcTUl1wrP/9ad9Atrp5J94Lq69w7UwOMolPIGrfLSvAKJp0RTvkPPyn6CIWrNy13kyLikZRZQ==} + '@esbuild/freebsd-x64@0.27.5': + resolution: {integrity: sha512-233X1FGo3a8x1ekLB6XT69LfZ83vqz+9z3TSEQCTYfMNY880A97nr81KbPcAMl9rmOFp11wO0dP+eB18KU/Ucg==} engines: {node: '>=18'} cpu: [x64] os: [freebsd] @@ -440,8 +440,8 @@ packages: cpu: [arm64] os: [linux] - '@esbuild/linux-arm64@0.27.4': - resolution: {integrity: sha512-7nQOttdzVGth1iz57kxg9uCz57dxQLHWxopL6mYuYthohPKEK0vU0C3O21CcBK6KDlkYVcnDXY099HcCDXd9dA==} + '@esbuild/linux-arm64@0.27.5': + resolution: {integrity: sha512-euKkilsNOv7x/M1NKsx5znyprbpsRFIzTV6lWziqJch7yWYayfLtZzDxDTl+LSQDJYAjd9TVb/Kt5UKIrj2e4A==} engines: {node: '>=18'} cpu: [arm64] os: [linux] @@ -452,8 +452,8 @@ packages: cpu: [arm] os: [linux] - '@esbuild/linux-arm@0.27.4': - resolution: {integrity: sha512-aBYgcIxX/wd5n2ys0yESGeYMGF+pv6g0DhZr3G1ZG4jMfruU9Tl1i2Z+Wnj9/KjGz1lTLCcorqE2viePZqj4Eg==} + '@esbuild/linux-arm@0.27.5': + resolution: {integrity: sha512-0wkVrYHG4sdCCN/bcwQ7yYMXACkaHc3UFeaEOwSVW6e5RycMageYAFv+JS2bKLwHyeKVUvtoVH+5/RHq0fgeFw==} engines: {node: '>=18'} cpu: [arm] os: [linux] @@ -464,8 +464,8 @@ packages: cpu: [ia32] os: [linux] - '@esbuild/linux-ia32@0.27.4': - resolution: {integrity: sha512-oPtixtAIzgvzYcKBQM/qZ3R+9TEUd1aNJQu0HhGyqtx6oS7qTpvjheIWBbes4+qu1bNlo2V4cbkISr8q6gRBFA==} + '@esbuild/linux-ia32@0.27.5': + resolution: {integrity: sha512-hVRQX4+P3MS36NxOy24v/Cdsimy/5HYePw+tmPqnNN1fxV0bPrFWR6TMqwXPwoTM2VzbkA+4lbHWUKDd5ZDA/w==} engines: {node: '>=18'} cpu: [ia32] os: [linux] @@ -476,8 +476,8 @@ packages: cpu: [loong64] os: [linux] - '@esbuild/linux-loong64@0.27.4': - resolution: {integrity: sha512-8mL/vh8qeCoRcFH2nM8wm5uJP+ZcVYGGayMavi8GmRJjuI3g1v6Z7Ni0JJKAJW+m0EtUuARb6Lmp4hMjzCBWzA==} + '@esbuild/linux-loong64@0.27.5': + resolution: {integrity: sha512-mKqqRuOPALI8nDzhOBmIS0INvZOOFGGg5n1osGIXAx8oersceEbKd4t1ACNTHM3sJBXGFAlEgqM+svzjPot+ZQ==} engines: {node: '>=18'} cpu: [loong64] os: [linux] @@ -488,8 +488,8 @@ packages: cpu: [mips64el] os: [linux] - '@esbuild/linux-mips64el@0.27.4': - resolution: {integrity: sha512-1RdrWFFiiLIW7LQq9Q2NES+HiD4NyT8Itj9AUeCl0IVCA459WnPhREKgwrpaIfTOe+/2rdntisegiPWn/r/aAw==} + '@esbuild/linux-mips64el@0.27.5': + resolution: {integrity: sha512-EE/QXH9IyaAj1qeuIV5+/GZkBTipgGO782Ff7Um3vPS9cvLhJJeATy4Ggxikz2inZ46KByamMn6GqtqyVjhenA==} engines: {node: '>=18'} cpu: [mips64el] os: [linux] @@ -500,8 +500,8 @@ packages: cpu: [ppc64] os: [linux] - '@esbuild/linux-ppc64@0.27.4': - resolution: {integrity: sha512-tLCwNG47l3sd9lpfyx9LAGEGItCUeRCWeAx6x2Jmbav65nAwoPXfewtAdtbtit/pJFLUWOhpv0FpS6GQAmPrHA==} + '@esbuild/linux-ppc64@0.27.5': + resolution: {integrity: sha512-0V2iF1RGxBf1b7/BjurA5jfkl7PtySjom1r6xOK2q9KWw/XCpAdtB6KNMO+9xx69yYfSCRR9FE0TyKfHA2eQMw==} engines: {node: '>=18'} cpu: [ppc64] os: [linux] @@ -512,8 +512,8 @@ packages: cpu: [riscv64] os: [linux] - '@esbuild/linux-riscv64@0.27.4': - resolution: {integrity: sha512-BnASypppbUWyqjd1KIpU4AUBiIhVr6YlHx/cnPgqEkNoVOhHg+YiSVxM1RLfiy4t9cAulbRGTNCKOcqHrEQLIw==} + '@esbuild/linux-riscv64@0.27.5': + resolution: {integrity: sha512-rYxThBx6G9HN6tFNuvB/vykeLi4VDsm5hE5pVwzqbAjZEARQrWu3noZSfbEnPZ/CRXP3271GyFk/49up2W190g==} engines: {node: '>=18'} cpu: [riscv64] os: [linux] @@ -524,8 +524,8 @@ packages: cpu: [s390x] os: [linux] - '@esbuild/linux-s390x@0.27.4': - resolution: {integrity: sha512-+eUqgb/Z7vxVLezG8bVB9SfBie89gMueS+I0xYh2tJdw3vqA/0ImZJ2ROeWwVJN59ihBeZ7Tu92dF/5dy5FttA==} + '@esbuild/linux-s390x@0.27.5': + resolution: {integrity: sha512-uEP2q/4qgd8goEUc4QIdU/1P2NmEtZ/zX5u3OpLlCGhJIuBIv0s0wr7TB2nBrd3/A5XIdEkkS5ZLF0ULuvaaYQ==} engines: {node: '>=18'} cpu: [s390x] os: [linux] @@ -536,8 +536,8 @@ packages: cpu: [x64] os: [linux] - '@esbuild/linux-x64@0.27.4': - resolution: {integrity: sha512-S5qOXrKV8BQEzJPVxAwnryi2+Iq5pB40gTEIT69BQONqR7JH1EPIcQ/Uiv9mCnn05jff9umq/5nqzxlqTOg9NA==} + '@esbuild/linux-x64@0.27.5': + resolution: {integrity: sha512-+Gq47Wqq6PLOOZuBzVSII2//9yyHNKZLuwfzCemqexqOQCSz0zy0O26kIzyp9EMNMK+nZ0tFHBZrCeVUuMs/ew==} engines: {node: '>=18'} cpu: [x64] os: [linux] @@ -548,8 +548,8 @@ packages: cpu: [arm64] os: [netbsd] - '@esbuild/netbsd-arm64@0.27.4': - resolution: {integrity: sha512-xHT8X4sb0GS8qTqiwzHqpY00C95DPAq7nAwX35Ie/s+LO9830hrMd3oX0ZMKLvy7vsonee73x0lmcdOVXFzd6Q==} + '@esbuild/netbsd-arm64@0.27.5': + resolution: {integrity: sha512-3F/5EG8VHfN/I+W5cO1/SV2H9Q/5r7vcHabMnBqhHK2lTWOh3F8vixNzo8lqxrlmBtZVFpW8pmITHnq54+Tq4g==} engines: {node: '>=18'} cpu: [arm64] os: [netbsd] @@ -560,8 +560,8 @@ packages: cpu: [x64] os: [netbsd] - '@esbuild/netbsd-x64@0.27.4': - resolution: {integrity: sha512-RugOvOdXfdyi5Tyv40kgQnI0byv66BFgAqjdgtAKqHoZTbTF2QqfQrFwa7cHEORJf6X2ht+l9ABLMP0dnKYsgg==} + '@esbuild/netbsd-x64@0.27.5': + resolution: {integrity: sha512-28t+Sj3CPN8vkMOlZotOmDgilQwVvxWZl7b8rxpn73Tt/gCnvrHxQUMng4uu3itdFvrtba/1nHejvxqz8xgEMA==} engines: {node: '>=18'} cpu: [x64] os: [netbsd] @@ -572,8 +572,8 @@ packages: cpu: [arm64] os: [openbsd] - '@esbuild/openbsd-arm64@0.27.4': - resolution: {integrity: sha512-2MyL3IAaTX+1/qP0O1SwskwcwCoOI4kV2IBX1xYnDDqthmq5ArrW94qSIKCAuRraMgPOmG0RDTA74mzYNQA9ow==} + '@esbuild/openbsd-arm64@0.27.5': + resolution: {integrity: sha512-Doz/hKtiuVAi9hMsBMpwBANhIZc8l238U2Onko3t2xUp8xtM0ZKdDYHMnm/qPFVthY8KtxkXaocwmMh6VolzMA==} engines: {node: '>=18'} cpu: [arm64] os: [openbsd] @@ -584,8 +584,8 @@ packages: cpu: [x64] os: [openbsd] - '@esbuild/openbsd-x64@0.27.4': - resolution: {integrity: sha512-u8fg/jQ5aQDfsnIV6+KwLOf1CmJnfu1ShpwqdwC0uA7ZPwFws55Ngc12vBdeUdnuWoQYx/SOQLGDcdlfXhYmXQ==} + '@esbuild/openbsd-x64@0.27.5': + resolution: {integrity: sha512-WfGVaa1oz5A7+ZFPkERIbIhKT4olvGl1tyzTRaB5yoZRLqC0KwaO95FeZtOdQj/oKkjW57KcVF944m62/0GYtA==} engines: {node: '>=18'} cpu: [x64] os: [openbsd] @@ -596,8 +596,8 @@ packages: cpu: [arm64] os: [openharmony] - '@esbuild/openharmony-arm64@0.27.4': - resolution: {integrity: sha512-JkTZrl6VbyO8lDQO3yv26nNr2RM2yZzNrNHEsj9bm6dOwwu9OYN28CjzZkH57bh4w0I2F7IodpQvUAEd1mbWXg==} + '@esbuild/openharmony-arm64@0.27.5': + resolution: {integrity: sha512-Xh+VRuh6OMh3uJ0JkCjI57l+DVe7VRGBYymen8rFPnTVgATBwA6nmToxM2OwTlSvrnWpPKkrQUj93+K9huYC6A==} engines: {node: '>=18'} cpu: [arm64] os: [openharmony] @@ -608,8 +608,8 @@ packages: cpu: [x64] os: [sunos] - '@esbuild/sunos-x64@0.27.4': - resolution: {integrity: sha512-/gOzgaewZJfeJTlsWhvUEmUG4tWEY2Spp5M20INYRg2ZKl9QPO3QEEgPeRtLjEWSW8FilRNacPOg8R1uaYkA6g==} + '@esbuild/sunos-x64@0.27.5': + resolution: {integrity: sha512-aC1gpJkkaUADHuAdQfuVTnqVUTLqqUNhAvEwHwVWcnVVZvNlDPGA0UveZsfXJJ9T6k9Po4eHi3c02gbdwO3g6w==} engines: {node: '>=18'} cpu: [x64] os: [sunos] @@ -620,8 +620,8 @@ packages: cpu: [arm64] os: [win32] - '@esbuild/win32-arm64@0.27.4': - resolution: {integrity: sha512-Z9SExBg2y32smoDQdf1HRwHRt6vAHLXcxD2uGgO/v2jK7Y718Ix4ndsbNMU/+1Qiem9OiOdaqitioZwxivhXYg==} + '@esbuild/win32-arm64@0.27.5': + resolution: {integrity: sha512-0UNx2aavV0fk6UpZcwXFLztA2r/k9jTUa7OW7SAea1VYUhkug99MW1uZeXEnPn5+cHOd0n8myQay6TlFnBR07w==} engines: {node: '>=18'} cpu: [arm64] os: [win32] @@ -632,8 +632,8 @@ packages: cpu: [ia32] os: [win32] - '@esbuild/win32-ia32@0.27.4': - resolution: {integrity: sha512-DAyGLS0Jz5G5iixEbMHi5KdiApqHBWMGzTtMiJ72ZOLhbu/bzxgAe8Ue8CTS3n3HbIUHQz/L51yMdGMeoxXNJw==} + '@esbuild/win32-ia32@0.27.5': + resolution: {integrity: sha512-5nlJ3AeJWCTSzR7AEqVjT/faWyqKU86kCi1lLmxVqmNR+j4HrYdns+eTGjS/vmrzCIe8inGQckUadvS0+JkKdQ==} engines: {node: '>=18'} cpu: [ia32] os: [win32] @@ -644,17 +644,17 @@ packages: cpu: [x64] os: [win32] - '@esbuild/win32-x64@0.27.4': - resolution: {integrity: sha512-+knoa0BDoeXgkNvvV1vvbZX4+hizelrkwmGJBdT17t8FNPwG2lKemmuMZlmaNQ3ws3DKKCxpb4zRZEIp3UxFCg==} + '@esbuild/win32-x64@0.27.5': + resolution: {integrity: sha512-PWypQR+d4FLfkhBIV+/kHsUELAnMpx1bRvvsn3p+/sAERbnCzFrtDRG2Xw5n+2zPxBK2+iaP+vetsRl4Ti7WgA==} engines: {node: '>=18'} cpu: [x64] os: [win32] - '@joshwooding/vite-plugin-react-docgen-typescript@0.6.4': - resolution: {integrity: sha512-6PyZBYKnnVNqOSB0YFly+62R7dmov8segT27A+RVTBVd4iAE6kbW9QBJGlyR2yG4D4ohzhZSTIu7BK1UTtmFFA==} + '@joshwooding/vite-plugin-react-docgen-typescript@0.7.0': + resolution: {integrity: sha512-qvsTEwEFefhdirGOPnu9Wp6ChfIwy2dBCRuETU3uE+4cC+PFoxMSiiEhxk4lOluA34eARHA0OxqsEUYDqRMgeQ==} peerDependencies: typescript: '>= 4.3.x' - vite: ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 + vite: ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0 peerDependenciesMeta: typescript: optional: true @@ -806,124 +806,124 @@ packages: cpu: [x64] os: [win32] - '@oxlint/binding-android-arm-eabi@1.57.0': - resolution: {integrity: sha512-C7EiyfAJG4B70496eV543nKiq5cH0o/xIh/ufbjQz3SIvHhlDDsyn+mRFh+aW8KskTyUpyH2LGWL8p2oN6bl1A==} + '@oxlint/binding-android-arm-eabi@1.58.0': + resolution: {integrity: sha512-1T7UN3SsWWxpWyWGn1cT3ASNJOo+pI3eUkmEl7HgtowapcV8kslYpFQcYn431VuxghXakPNlbjRwhqmR37PFOg==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm] os: [android] - '@oxlint/binding-android-arm64@1.57.0': - resolution: {integrity: sha512-9i80AresjZ/FZf5xK8tKFbhQnijD4s1eOZw6/FHUwD59HEZbVLRc2C88ADYJfLZrF5XofWDiRX/Ja9KefCLy7w==} + '@oxlint/binding-android-arm64@1.58.0': + resolution: {integrity: sha512-GryzujxuiRv2YFF7bRy8mKcxlbuAN+euVUtGJt9KKbLT8JBUIosamVhcthLh+VEr6KE6cjeVMAQxKAzJcoN7dg==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [android] - '@oxlint/binding-darwin-arm64@1.57.0': - resolution: {integrity: sha512-0eUfhRz5L2yKa9I8k3qpyl37XK3oBS5BvrgdVIx599WZK63P8sMbg+0s4IuxmIiZuBK68Ek+Z+gcKgeYf0otsg==} + '@oxlint/binding-darwin-arm64@1.58.0': + resolution: {integrity: sha512-7/bRSJIwl4GxeZL9rPZ11anNTyUO9epZrfEJH/ZMla3+/gbQ6xZixh9nOhsZ0QwsTW7/5J2A/fHbD1udC5DQQA==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [darwin] - '@oxlint/binding-darwin-x64@1.57.0': - resolution: {integrity: sha512-UvrSuzBaYOue+QMAcuDITe0k/Vhj6KZGjfnI6x+NkxBTke/VoM7ZisaxgNY0LWuBkTnd1OmeQfEQdQ48fRjkQg==} + '@oxlint/binding-darwin-x64@1.58.0': + resolution: {integrity: sha512-EqdtJSiHweS2vfILNrpyJ6HUwpEq2g7+4Zx1FPi4hu3Hu7tC3znF6ufbXO8Ub2LD4mGgznjI7kSdku9NDD1Mkg==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [darwin] - '@oxlint/binding-freebsd-x64@1.57.0': - resolution: {integrity: sha512-wtQq0dCoiw4bUwlsNVDJJ3pxJA218fOezpgtLKrbQqUtQJcM9yP8z+I9fu14aHg0uyAxIY+99toL6uBa2r7nxA==} + '@oxlint/binding-freebsd-x64@1.58.0': + resolution: {integrity: sha512-VQt5TH4M42mY20F545G637RKxV/yjwVtKk2vfXuazfReSIiuvWBnv+FVSvIV5fKVTJNjt3GSJibh6JecbhGdBw==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [freebsd] - '@oxlint/binding-linux-arm-gnueabihf@1.57.0': - resolution: {integrity: sha512-qxFWl2BBBFcT4djKa+OtMdnLgoHEJXpqjyGwz8OhW35ImoCwR5qtAGqApNYce5260FQqoAHW8S8eZTjiX67Tsg==} + '@oxlint/binding-linux-arm-gnueabihf@1.58.0': + resolution: {integrity: sha512-fBYcj4ucwpAtjJT3oeBdFBYKvNyjRSK+cyuvBOTQjh0jvKp4yeA4S/D0IsCHus/VPaNG5L48qQkh+Vjy3HL2/Q==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm] os: [linux] - '@oxlint/binding-linux-arm-musleabihf@1.57.0': - resolution: {integrity: sha512-SQoIsBU7J0bDW15/f0/RvxHfY3Y0+eB/caKBQtNFbuerTiA6JCYx9P1MrrFTwY2dTm/lMgTSgskvCEYk2AtG/Q==} + '@oxlint/binding-linux-arm-musleabihf@1.58.0': + resolution: {integrity: sha512-0BeuFfwlUHlJ1xpEdSD1YO3vByEFGPg36uLjK1JgFaxFb4W6w17F8ET8sz5cheZ4+x5f2xzdnRrrWv83E3Yd8g==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm] os: [linux] - '@oxlint/binding-linux-arm64-gnu@1.57.0': - resolution: {integrity: sha512-jqxYd1W6WMeozsCmqe9Rzbu3SRrGTyGDAipRlRggetyYbUksJqJKvUNTQtZR/KFoJPb+grnSm5SHhdWrywv3RQ==} + '@oxlint/binding-linux-arm64-gnu@1.58.0': + resolution: {integrity: sha512-TXlZgnPTlxrQzxG9ZXU7BNwx1Ilrr17P3GwZY0If2EzrinqRH3zXPc3HrRcBJgcsoZNMuNL5YivtkJYgp467UQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] libc: [glibc] - '@oxlint/binding-linux-arm64-musl@1.57.0': - resolution: {integrity: sha512-i66WyEPVEvq9bxRUCJ/MP5EBfnTDN3nhwEdFZFTO5MmLLvzngfWEG3NSdXQzTT3vk5B9i6C2XSIYBh+aG6uqyg==} + '@oxlint/binding-linux-arm64-musl@1.58.0': + resolution: {integrity: sha512-zSoYRo5dxHLcUx93Stl2hW3hSNjPt99O70eRVWt5A1zwJ+FPjeCCANCD2a9R4JbHsdcl11TIQOjyigcRVOH2mw==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] libc: [musl] - '@oxlint/binding-linux-ppc64-gnu@1.57.0': - resolution: {integrity: sha512-oMZDCwz4NobclZU3pH+V1/upVlJZiZvne4jQP+zhJwt+lmio4XXr4qG47CehvrW1Lx2YZiIHuxM2D4YpkG3KVA==} + '@oxlint/binding-linux-ppc64-gnu@1.58.0': + resolution: {integrity: sha512-NQ0U/lqxH2/VxBYeAIvMNUK1y0a1bJ3ZicqkF2c6wfakbEciP9jvIE4yNzCFpZaqeIeRYaV7AVGqEO1yrfVPjA==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [ppc64] os: [linux] libc: [glibc] - '@oxlint/binding-linux-riscv64-gnu@1.57.0': - resolution: {integrity: sha512-uoBnjJ3MMEBbfnWC1jSFr7/nSCkcQYa72NYoNtLl1imshDnWSolYCjzb8LVCwYCCfLJXD+0gBLD7fyC14c0+0g==} + '@oxlint/binding-linux-riscv64-gnu@1.58.0': + resolution: {integrity: sha512-X9J+kr3gIC9FT8GuZt0ekzpNUtkBVzMVU4KiKDSlocyQuEgi3gBbXYN8UkQiV77FTusLDPsovjo95YedHr+3yg==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [riscv64] os: [linux] libc: [glibc] - '@oxlint/binding-linux-riscv64-musl@1.57.0': - resolution: {integrity: sha512-BdrwD7haPZ8a9KrZhKJRSj6jwCor+Z8tHFZ3PT89Y3Jq5v3LfMfEePeAmD0LOTWpiTmzSzdmyw9ijneapiVHKQ==} + '@oxlint/binding-linux-riscv64-musl@1.58.0': + resolution: {integrity: sha512-CDze3pi1OO3Wvb/QsXjmLEY4XPKGM6kIo82ssNOgmcl1IdndF9VSGAE38YLhADWmOac7fjqhBw82LozuUVxD0Q==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [riscv64] os: [linux] libc: [musl] - '@oxlint/binding-linux-s390x-gnu@1.57.0': - resolution: {integrity: sha512-BNs+7ZNsRstVg2tpNxAXfMX/Iv5oZh204dVyb8Z37+/gCh+yZqNTlg6YwCLIMPSk5wLWIGOaQjT0GUOahKYImw==} + '@oxlint/binding-linux-s390x-gnu@1.58.0': + resolution: {integrity: sha512-b/89glbxFaEAcA6Uf1FvCNecBJEgcUTsV1quzrqXM/o4R1M4u+2KCVuyGCayN2UpsRWtGGLb+Ver0tBBpxaPog==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [s390x] os: [linux] libc: [glibc] - '@oxlint/binding-linux-x64-gnu@1.57.0': - resolution: {integrity: sha512-AghS18w+XcENcAX0+BQGLiqjpqpaxKJa4cWWP0OWNLacs27vHBxu7TYkv9LUSGe5w8lOJHeMxcYfZNOAPqw2bg==} + '@oxlint/binding-linux-x64-gnu@1.58.0': + resolution: {integrity: sha512-0/yYpkq9VJFCEcuRlrViGj8pJUFFvNS4EkEREaN7CB1EcLXJIaVSSa5eCihwBGXtOZxhnblWgxks9juRdNQI7w==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] libc: [glibc] - '@oxlint/binding-linux-x64-musl@1.57.0': - resolution: {integrity: sha512-E/FV3GB8phu/Rpkhz5T96hAiJlGzn91qX5yj5gU754P5cmVGXY1Jw/VSjDSlZBCY3VHjsVLdzgdkJaomEmcNOg==} + '@oxlint/binding-linux-x64-musl@1.58.0': + resolution: {integrity: sha512-hr6FNvmcAXiH+JxSvaJ4SJ1HofkdqEElXICW9sm3/Rd5eC3t7kzvmLyRAB3NngKO2wzXRCAm4Z/mGWfrsS4X8w==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] libc: [musl] - '@oxlint/binding-openharmony-arm64@1.57.0': - resolution: {integrity: sha512-xvZ2yZt0nUVfU14iuGv3V25jpr9pov5N0Wr28RXnHFxHCRxNDMtYPHV61gGLhN9IlXM96gI4pyYpLSJC5ClLCQ==} + '@oxlint/binding-openharmony-arm64@1.58.0': + resolution: {integrity: sha512-R+O368VXgRql1K6Xar+FEo7NEwfo13EibPMoTv3sesYQedRXd6m30Dh/7lZMxnrQVFfeo4EOfYIP4FpcgWQNHg==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [openharmony] - '@oxlint/binding-win32-arm64-msvc@1.57.0': - resolution: {integrity: sha512-Z4D8Pd0AyHBKeazhdIXeUUy5sIS3Mo0veOlzlDECg6PhRRKgEsBJCCV1n+keUZtQ04OP+i7+itS3kOykUyNhDg==} + '@oxlint/binding-win32-arm64-msvc@1.58.0': + resolution: {integrity: sha512-Q0FZiAY/3c4YRj4z3h9K1PgaByrifrfbBoODSeX7gy97UtB7pySPUQfC2B/GbxWU6k7CzQrRy5gME10PltLAFQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [win32] - '@oxlint/binding-win32-ia32-msvc@1.57.0': - resolution: {integrity: sha512-StOZ9nFMVKvevicbQfql6Pouu9pgbeQnu60Fvhz2S6yfMaii+wnueLnqQ5I1JPgNF0Syew4voBlAaHD13wH6tw==} + '@oxlint/binding-win32-ia32-msvc@1.58.0': + resolution: {integrity: sha512-Y8FKBABrSPp9H0QkRLHDHOSUgM/309a3IvOVgPcVxYcX70wxJrk608CuTg7w+C6vEd724X5wJoNkBcGYfH7nNQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [ia32] os: [win32] - '@oxlint/binding-win32-x64-msvc@1.57.0': - resolution: {integrity: sha512-6PuxhYgth8TuW0+ABPOIkGdBYw+qYGxgIdXPHSVpiCDm+hqTTWCmC739St1Xni0DJBt8HnSHTG67i1y6gr8qrA==} + '@oxlint/binding-win32-x64-msvc@1.58.0': + resolution: {integrity: sha512-bCn5rbiz5My+Bj7M09sDcnqW0QJyINRVxdZ65x1/Y2tGrMwherwK/lpk+HRQCKvXa8pcaQdF5KY5j54VGZLwNg==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [win32] @@ -1081,23 +1081,23 @@ packages: '@standard-schema/spec@1.1.0': resolution: {integrity: sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==} - '@storybook/addon-a11y@10.3.3': - resolution: {integrity: sha512-1yELCE8NXUJKcfS2k97pujtVw4z95PCwyoy2I6VAPiG/nRnJI8M6ned08YmCMEJhLBgGA1+GBh9HO4uk+xPcYA==} + '@storybook/addon-a11y@10.3.4': + resolution: {integrity: sha512-TylBS2+MUPRfgzBKiygL1JoUBnTqEKo5oCEfjHneJZKzYE1UNgdMdk/fiyanaGKTZBKBxWbShxZhT2gLs8kqMA==} peerDependencies: - storybook: ^10.3.3 + storybook: ^10.3.4 - '@storybook/addon-docs@10.3.3': - resolution: {integrity: sha512-trJQTpOtuOEuNv1Rn8X2Sopp5hSPpb0u0soEJ71BZAbxe4d2Y1d/1MYcxBdRKwncum6sCTsnxTpqQ/qvSJKlTQ==} + '@storybook/addon-docs@10.3.4': + resolution: {integrity: sha512-ohS8fX8UIP3LN6+mDZJLCDS4Qd2rsmGwes6V6fD0sbLOmIyCVY5y68r6NHMMGJKFRwadDQOmtOt8Vc6snExrIQ==} peerDependencies: - storybook: ^10.3.3 + storybook: ^10.3.4 - '@storybook/addon-vitest@10.3.3': - resolution: {integrity: sha512-9bbUAgraZhHh35WuWJn/83B0KvkcsP8dNpzbhssMeWQTfu92TR3DqRNeGTNSlyZvhbGfwiwT3TfBzzM4dX1feg==} + '@storybook/addon-vitest@10.3.4': + resolution: {integrity: sha512-lSn8opaHVzDxLtMy28FnSkyx6uP1oQVnGzodNunTjrbJ8Ue8JVK+fjWtC/JfErIio0avlq79mgC5tfHSWlPr9w==} peerDependencies: '@vitest/browser': ^3.0.0 || ^4.0.0 '@vitest/browser-playwright': ^4.0.0 '@vitest/runner': ^3.0.0 || ^4.0.0 - storybook: ^10.3.3 + storybook: ^10.3.4 vitest: ^3.0.0 || ^4.0.0 peerDependenciesMeta: '@vitest/browser': @@ -1109,18 +1109,18 @@ packages: vitest: optional: true - '@storybook/builder-vite@10.3.3': - resolution: {integrity: sha512-awspKCTZvXyeV3KabL0id62mFbxR5u/5yyGQultwCiSb2/yVgBfip2MAqLyS850pvTiB6QFVM9deOyd2/G/bEA==} + '@storybook/builder-vite@10.3.4': + resolution: {integrity: sha512-dNQyBZpBKvwmhSTpjrsuxxY8FqFCh0hgu5+46h2WbgQ2Te3pO458heWkGb+QO7mC6FmkXO6j6zgYzXticD6F2A==} peerDependencies: - storybook: ^10.3.3 + storybook: ^10.3.4 vite: ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0 - '@storybook/csf-plugin@10.3.3': - resolution: {integrity: sha512-Utlh7zubm+4iOzBBfzLW4F4vD99UBtl2Do4edlzK2F7krQIcFvR2ontjAE8S1FQVLZAC3WHalCOS+Ch8zf3knA==} + '@storybook/csf-plugin@10.3.4': + resolution: {integrity: sha512-WPP0Z39o82WiohPkhPOs6z+9yJ+bVvqPz4d+QUPfE6FMvOOBLojlwOcGx6Xmclyn5H/CKwywFrjuz4mBO/nHhA==} peerDependencies: esbuild: '*' rollup: '*' - storybook: ^10.3.3 + storybook: ^10.3.4 vite: '*' webpack: '*' peerDependenciesMeta: @@ -1142,27 +1142,27 @@ packages: react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 - '@storybook/react-dom-shim@10.3.3': - resolution: {integrity: sha512-lkhuh4G3UTreU9M3Iz5Dt32c6U+l/4XuvqLtbe1sDHENZH6aPj7y0b5FwnfHyvuTvYRhtbo29xZrF5Bp9kCC0w==} + '@storybook/react-dom-shim@10.3.4': + resolution: {integrity: sha512-VIm9YzreGubnOtQOZ6iqEfj6KncHvAkrCR/IilqnJq7DidPWuykrFszyajTASRMiY+p+TElOW+O1PGpv55qNGw==} peerDependencies: react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 - storybook: ^10.3.3 + storybook: ^10.3.4 - '@storybook/react-vite@10.3.3': - resolution: {integrity: sha512-qHdlBe1hjqFAGXa8JL7bWTLbP/gDqXbWDm+SYCB646NHh5yvVDkZLwigP5Y+UL7M2ASfqFtosnroUK9tcCM2dw==} + '@storybook/react-vite@10.3.4': + resolution: {integrity: sha512-xaMt7NdvlAb+CwXn5TOiluQ+0WkkMN3mZhCThocpblWGoyfmHH7bgQ5ZwzT+IIp8DGOsAi/HkNmSyS7Z8HRLJg==} peerDependencies: react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 - storybook: ^10.3.3 + storybook: ^10.3.4 vite: ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0 - '@storybook/react@10.3.3': - resolution: {integrity: sha512-cGG5TbR8Tdx9zwlpsWyBEfWrejm5iWdYF26EwIhwuKq9GFUTAVrQzo0Rs7Tqc3ZyVhRS/YfsRiWSEH+zmq2JiQ==} + '@storybook/react@10.3.4': + resolution: {integrity: sha512-I5ifYqjrqyuhOFjalpy47kMKMXX7QU/qmHj0h/547s9Bg6sEU7xRhJnneXx1RJsEJTySjC4SmGfEU+FJz4Foiw==} peerDependencies: react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 - storybook: ^10.3.3 + storybook: ^10.3.4 typescript: '>= 4.9.x' peerDependenciesMeta: typescript: @@ -1314,14 +1314,17 @@ packages: '@vitest/utils@4.1.2': resolution: {integrity: sha512-xw2/TiX82lQHA06cgbqRKFb5lCAy3axQ4H4SoUFhUsg+wztiet+co86IAMDtF6Vm1hc7J6j09oh/rgDn+JdKIQ==} - '@xyflow/react@12.10.1': - resolution: {integrity: sha512-5eSWtIK/+rkldOuFbOOz44CRgQRjtS9v5nufk77DV+XBnfCGL9HAQ8PG00o2ZYKqkEU/Ak6wrKC95Tu+2zuK3Q==} + '@webcontainer/env@1.1.1': + resolution: {integrity: sha512-6aN99yL695Hi9SuIk1oC88l9o0gmxL1nGWWQ/kNy81HigJ0FoaoTXpytCj6ItzgyCEwA9kF1wixsTuv5cjsgng==} + + '@xyflow/react@12.10.2': + resolution: {integrity: sha512-CgIi6HwlcHXwlkTpr0fxLv/0sRVNZ8IdwKLzzeCscaYBwpvfcH1QFOCeaTCuEn1FQEs/B8CjnTSjhs8udgmBgQ==} peerDependencies: react: '>=17' react-dom: '>=17' - '@xyflow/system@0.0.75': - resolution: {integrity: sha512-iXs+AGFLi8w/VlAoc/iSxk+CxfT6o64Uw/k0CKASOPqjqz6E0rb5jFZgJtXGZCpfQI6OQpu5EnumP5fGxQheaQ==} + '@xyflow/system@0.0.76': + resolution: {integrity: sha512-hvwvnRS1B3REwVDlWexsq7YQaPZeG3/mKo1jv38UmnpWmxihp14bW6VtEOuHEwJX2FvzFw8k77LyKSk/wiZVNA==} acorn@8.16.0: resolution: {integrity: sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw==} @@ -1557,8 +1560,8 @@ packages: resolution: {integrity: sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==} engines: {node: '>= 0.4'} - electron-to-chromium@1.5.330: - resolution: {integrity: sha512-jFNydB5kFtYUobh4IkWUnXeyDbjf/r9gcUEXe1xcrcUxIGfTdzPXA+ld6zBRbwvgIGVzDll/LTIiDztEtckSnA==} + electron-to-chromium@1.5.331: + resolution: {integrity: sha512-IbxXrsTlD3hRodkLnbxAPP4OuJYdWCeM3IOdT+CpcMoIwIoDfCmRpEtSPfwBXxVkg9xmBeY7Lz2Eo2TDn/HC3Q==} emoji-regex@10.6.0: resolution: {integrity: sha512-toUI84YS5YmxW219erniWD0CIVOo46xGKColeNQRgOzDorgBi1v4D71/OFzgD9GO2UGKIv1C3Sp8DAn0+j5w7A==} @@ -1599,8 +1602,8 @@ packages: engines: {node: '>=18'} hasBin: true - esbuild@0.27.4: - resolution: {integrity: sha512-Rq4vbHnYkK5fws5NF7MYTU68FPRE1ajX7heQ/8QXXWqNgqqJ/GkmmyxIzUnf2Sr/bakf8l54716CcMGHYhMrrQ==} + esbuild@0.27.5: + resolution: {integrity: sha512-zdQoHBjuDqKsvV5OPaWansOwfSQ0Js+Uj9J85TBvj3bFW1JjWTSULMRwdQAc8qMeIScbClxeMK0jlrtB9linhA==} engines: {node: '>=18'} hasBin: true @@ -1883,8 +1886,8 @@ packages: engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} hasBin: true - node-releases@2.0.36: - resolution: {integrity: sha512-TdC8FSgHz8Mwtw9g5L4gR/Sh9XhSP/0DEkQxfEFXOpiul5IiHgHan2VhYYb6agDSfp4KuvltmGApc8HMgUrIkA==} + node-releases@2.0.37: + resolution: {integrity: sha512-1h5gKZCF+pO/o3Iqt5Jp7wc9rH3eJJ0+nh/CIoiRwjRxde/hAHyLPXYN4V3CqKAbiZPSeJFSWHmJsbkicta0Eg==} nwsapi@2.2.23: resolution: {integrity: sha512-7wfH4sLbt4M0gCDzGE6vzQBo0bfTKjU7Sfpqy/7gs1qBfYz2vEJH6vXcBKpO3+6Yu1telwd0t9HpyOoLEQQbIQ==} @@ -1905,12 +1908,12 @@ packages: engines: {node: ^20.19.0 || >=22.12.0} hasBin: true - oxlint@1.57.0: - resolution: {integrity: sha512-DGFsuBX5MFZX9yiDdtKjTrYPq45CZ8Fft6qCltJITYZxfwYjVdGf/6wycGYTACloauwIPxUnYhBVeZbHvleGhw==} + oxlint@1.58.0: + resolution: {integrity: sha512-t4s9leczDMqlvOSjnbCQe7gtoLkWgBGZ7sBdCJ9EOj5IXFSG/X7OAzK4yuH4iW+4cAYe8kLFbC8tuYMwWZm+Cg==} engines: {node: ^20.19.0 || >=22.12.0} hasBin: true peerDependencies: - oxlint-tsgolint: '>=0.15.0' + oxlint-tsgolint: '>=0.18.0' peerDependenciesMeta: oxlint-tsgolint: optional: true @@ -2067,8 +2070,8 @@ packages: std-env@4.0.0: resolution: {integrity: sha512-zUMPtQ/HBY3/50VbpkupYHbRroTRZJPRLvreamgErJVys0ceuzMkD44J/QjqhHjOzK42GQ3QZIeFG1OYfOtKqQ==} - storybook@10.3.3: - resolution: {integrity: sha512-tMoRAts9EVqf+mEMPLC6z1DPyHbcPe+CV1MhLN55IKsl0HxNjvVGK44rVPSePbltPE6vIsn4bdRj6CCUt8SJwQ==} + storybook@10.3.4: + resolution: {integrity: sha512-866YXZy9k59tLPl9SN3KZZOFeBC/swxkuBVtW8iQjJIzfCrvk7zXQd8RSQ4ignmCdArVvY4lGMCAT4yNaZSt1g==} hasBin: true peerDependencies: prettier: ^2 || ^3 @@ -2532,13 +2535,13 @@ snapshots: '@bcoe/v8-coverage@1.0.2': {} - '@chromatic-com/storybook@5.1.1(storybook@10.3.3(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4))': + '@chromatic-com/storybook@5.1.1(storybook@10.3.4(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4))': dependencies: '@neoconfetti/react': 1.0.0 chromatic: 13.3.5 filesize: 10.1.6 jsonfile: 6.2.0 - storybook: 10.3.3(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4) + storybook: 10.3.4(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4) strip-ansi: 7.2.0 transitivePeerDependencies: - '@chromatic-com/cypress' @@ -2567,160 +2570,160 @@ snapshots: '@esbuild/aix-ppc64@0.25.12': optional: true - '@esbuild/aix-ppc64@0.27.4': + '@esbuild/aix-ppc64@0.27.5': optional: true '@esbuild/android-arm64@0.25.12': optional: true - '@esbuild/android-arm64@0.27.4': + '@esbuild/android-arm64@0.27.5': optional: true '@esbuild/android-arm@0.25.12': optional: true - '@esbuild/android-arm@0.27.4': + '@esbuild/android-arm@0.27.5': optional: true '@esbuild/android-x64@0.25.12': optional: true - '@esbuild/android-x64@0.27.4': + '@esbuild/android-x64@0.27.5': optional: true '@esbuild/darwin-arm64@0.25.12': optional: true - '@esbuild/darwin-arm64@0.27.4': + '@esbuild/darwin-arm64@0.27.5': optional: true '@esbuild/darwin-x64@0.25.12': optional: true - '@esbuild/darwin-x64@0.27.4': + '@esbuild/darwin-x64@0.27.5': optional: true '@esbuild/freebsd-arm64@0.25.12': optional: true - '@esbuild/freebsd-arm64@0.27.4': + '@esbuild/freebsd-arm64@0.27.5': optional: true '@esbuild/freebsd-x64@0.25.12': optional: true - '@esbuild/freebsd-x64@0.27.4': + '@esbuild/freebsd-x64@0.27.5': optional: true '@esbuild/linux-arm64@0.25.12': optional: true - '@esbuild/linux-arm64@0.27.4': + '@esbuild/linux-arm64@0.27.5': optional: true '@esbuild/linux-arm@0.25.12': optional: true - '@esbuild/linux-arm@0.27.4': + '@esbuild/linux-arm@0.27.5': optional: true '@esbuild/linux-ia32@0.25.12': optional: true - '@esbuild/linux-ia32@0.27.4': + '@esbuild/linux-ia32@0.27.5': optional: true '@esbuild/linux-loong64@0.25.12': optional: true - '@esbuild/linux-loong64@0.27.4': + '@esbuild/linux-loong64@0.27.5': optional: true '@esbuild/linux-mips64el@0.25.12': optional: true - '@esbuild/linux-mips64el@0.27.4': + '@esbuild/linux-mips64el@0.27.5': optional: true '@esbuild/linux-ppc64@0.25.12': optional: true - '@esbuild/linux-ppc64@0.27.4': + '@esbuild/linux-ppc64@0.27.5': optional: true '@esbuild/linux-riscv64@0.25.12': optional: true - '@esbuild/linux-riscv64@0.27.4': + '@esbuild/linux-riscv64@0.27.5': optional: true '@esbuild/linux-s390x@0.25.12': optional: true - '@esbuild/linux-s390x@0.27.4': + '@esbuild/linux-s390x@0.27.5': optional: true '@esbuild/linux-x64@0.25.12': optional: true - '@esbuild/linux-x64@0.27.4': + '@esbuild/linux-x64@0.27.5': optional: true '@esbuild/netbsd-arm64@0.25.12': optional: true - '@esbuild/netbsd-arm64@0.27.4': + '@esbuild/netbsd-arm64@0.27.5': optional: true '@esbuild/netbsd-x64@0.25.12': optional: true - '@esbuild/netbsd-x64@0.27.4': + '@esbuild/netbsd-x64@0.27.5': optional: true '@esbuild/openbsd-arm64@0.25.12': optional: true - '@esbuild/openbsd-arm64@0.27.4': + '@esbuild/openbsd-arm64@0.27.5': optional: true '@esbuild/openbsd-x64@0.25.12': optional: true - '@esbuild/openbsd-x64@0.27.4': + '@esbuild/openbsd-x64@0.27.5': optional: true '@esbuild/openharmony-arm64@0.25.12': optional: true - '@esbuild/openharmony-arm64@0.27.4': + '@esbuild/openharmony-arm64@0.27.5': optional: true '@esbuild/sunos-x64@0.25.12': optional: true - '@esbuild/sunos-x64@0.27.4': + '@esbuild/sunos-x64@0.27.5': optional: true '@esbuild/win32-arm64@0.25.12': optional: true - '@esbuild/win32-arm64@0.27.4': + '@esbuild/win32-arm64@0.27.5': optional: true '@esbuild/win32-ia32@0.25.12': optional: true - '@esbuild/win32-ia32@0.27.4': + '@esbuild/win32-ia32@0.27.5': optional: true '@esbuild/win32-x64@0.25.12': optional: true - '@esbuild/win32-x64@0.27.4': + '@esbuild/win32-x64@0.27.5': optional: true - '@joshwooding/vite-plugin-react-docgen-typescript@0.6.4(typescript@5.9.3)(vite@6.4.1(@types/node@25.5.0)(yaml@2.8.3))': + '@joshwooding/vite-plugin-react-docgen-typescript@0.7.0(typescript@5.9.3)(vite@6.4.1(@types/node@25.5.0)(yaml@2.8.3))': dependencies: glob: 13.0.6 react-docgen-typescript: 2.4.0(typescript@5.9.3) @@ -2812,61 +2815,61 @@ snapshots: '@oxfmt/binding-win32-x64-msvc@0.41.0': optional: true - '@oxlint/binding-android-arm-eabi@1.57.0': + '@oxlint/binding-android-arm-eabi@1.58.0': optional: true - '@oxlint/binding-android-arm64@1.57.0': + '@oxlint/binding-android-arm64@1.58.0': optional: true - '@oxlint/binding-darwin-arm64@1.57.0': + '@oxlint/binding-darwin-arm64@1.58.0': optional: true - '@oxlint/binding-darwin-x64@1.57.0': + '@oxlint/binding-darwin-x64@1.58.0': optional: true - '@oxlint/binding-freebsd-x64@1.57.0': + '@oxlint/binding-freebsd-x64@1.58.0': optional: true - '@oxlint/binding-linux-arm-gnueabihf@1.57.0': + '@oxlint/binding-linux-arm-gnueabihf@1.58.0': optional: true - '@oxlint/binding-linux-arm-musleabihf@1.57.0': + '@oxlint/binding-linux-arm-musleabihf@1.58.0': optional: true - '@oxlint/binding-linux-arm64-gnu@1.57.0': + '@oxlint/binding-linux-arm64-gnu@1.58.0': optional: true - '@oxlint/binding-linux-arm64-musl@1.57.0': + '@oxlint/binding-linux-arm64-musl@1.58.0': optional: true - '@oxlint/binding-linux-ppc64-gnu@1.57.0': + '@oxlint/binding-linux-ppc64-gnu@1.58.0': optional: true - '@oxlint/binding-linux-riscv64-gnu@1.57.0': + '@oxlint/binding-linux-riscv64-gnu@1.58.0': optional: true - '@oxlint/binding-linux-riscv64-musl@1.57.0': + '@oxlint/binding-linux-riscv64-musl@1.58.0': optional: true - '@oxlint/binding-linux-s390x-gnu@1.57.0': + '@oxlint/binding-linux-s390x-gnu@1.58.0': optional: true - '@oxlint/binding-linux-x64-gnu@1.57.0': + '@oxlint/binding-linux-x64-gnu@1.58.0': optional: true - '@oxlint/binding-linux-x64-musl@1.57.0': + '@oxlint/binding-linux-x64-musl@1.58.0': optional: true - '@oxlint/binding-openharmony-arm64@1.57.0': + '@oxlint/binding-openharmony-arm64@1.58.0': optional: true - '@oxlint/binding-win32-arm64-msvc@1.57.0': + '@oxlint/binding-win32-arm64-msvc@1.58.0': optional: true - '@oxlint/binding-win32-ia32-msvc@1.57.0': + '@oxlint/binding-win32-ia32-msvc@1.58.0': optional: true - '@oxlint/binding-win32-x64-msvc@1.57.0': + '@oxlint/binding-win32-x64-msvc@1.58.0': optional: true '@polka/url@1.0.0-next.29': {} @@ -2956,21 +2959,21 @@ snapshots: '@standard-schema/spec@1.1.0': {} - '@storybook/addon-a11y@10.3.3(storybook@10.3.3(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4))': + '@storybook/addon-a11y@10.3.4(storybook@10.3.4(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4))': dependencies: '@storybook/global': 5.0.0 axe-core: 4.11.2 - storybook: 10.3.3(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4) + storybook: 10.3.4(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4) - '@storybook/addon-docs@10.3.3(@types/react@19.2.14)(esbuild@0.27.4)(rollup@4.60.1)(storybook@10.3.3(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4))(vite@6.4.1(@types/node@25.5.0)(yaml@2.8.3))': + '@storybook/addon-docs@10.3.4(@types/react@19.2.14)(esbuild@0.27.5)(rollup@4.60.1)(storybook@10.3.4(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4))(vite@6.4.1(@types/node@25.5.0)(yaml@2.8.3))': dependencies: '@mdx-js/react': 3.1.1(@types/react@19.2.14)(react@19.2.4) - '@storybook/csf-plugin': 10.3.3(esbuild@0.27.4)(rollup@4.60.1)(storybook@10.3.3(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4))(vite@6.4.1(@types/node@25.5.0)(yaml@2.8.3)) + '@storybook/csf-plugin': 10.3.4(esbuild@0.27.5)(rollup@4.60.1)(storybook@10.3.4(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4))(vite@6.4.1(@types/node@25.5.0)(yaml@2.8.3)) '@storybook/icons': 2.0.1(react-dom@19.2.4(react@19.2.4))(react@19.2.4) - '@storybook/react-dom-shim': 10.3.3(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(storybook@10.3.3(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)) + '@storybook/react-dom-shim': 10.3.4(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(storybook@10.3.4(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)) react: 19.2.4 react-dom: 19.2.4(react@19.2.4) - storybook: 10.3.3(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4) + storybook: 10.3.4(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4) ts-dedent: 2.2.0 transitivePeerDependencies: - '@types/react' @@ -2979,11 +2982,11 @@ snapshots: - vite - webpack - '@storybook/addon-vitest@10.3.3(@vitest/runner@4.1.2)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(storybook@10.3.3(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4))(vitest@4.1.2)': + '@storybook/addon-vitest@10.3.4(@vitest/runner@4.1.2)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(storybook@10.3.4(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4))(vitest@4.1.2)': dependencies: '@storybook/global': 5.0.0 '@storybook/icons': 2.0.1(react-dom@19.2.4(react@19.2.4))(react@19.2.4) - storybook: 10.3.3(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4) + storybook: 10.3.4(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4) optionalDependencies: '@vitest/runner': 4.1.2 vitest: 4.1.2(@types/node@25.5.0)(@vitest/ui@4.1.2)(jsdom@25.0.1)(vite@6.4.1(@types/node@25.5.0)(yaml@2.8.3)) @@ -2991,10 +2994,10 @@ snapshots: - react - react-dom - '@storybook/builder-vite@10.3.3(esbuild@0.27.4)(rollup@4.60.1)(storybook@10.3.3(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4))(vite@6.4.1(@types/node@25.5.0)(yaml@2.8.3))': + '@storybook/builder-vite@10.3.4(esbuild@0.27.5)(rollup@4.60.1)(storybook@10.3.4(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4))(vite@6.4.1(@types/node@25.5.0)(yaml@2.8.3))': dependencies: - '@storybook/csf-plugin': 10.3.3(esbuild@0.27.4)(rollup@4.60.1)(storybook@10.3.3(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4))(vite@6.4.1(@types/node@25.5.0)(yaml@2.8.3)) - storybook: 10.3.3(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4) + '@storybook/csf-plugin': 10.3.4(esbuild@0.27.5)(rollup@4.60.1)(storybook@10.3.4(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4))(vite@6.4.1(@types/node@25.5.0)(yaml@2.8.3)) + storybook: 10.3.4(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4) ts-dedent: 2.2.0 vite: 6.4.1(@types/node@25.5.0)(yaml@2.8.3) transitivePeerDependencies: @@ -3002,12 +3005,12 @@ snapshots: - rollup - webpack - '@storybook/csf-plugin@10.3.3(esbuild@0.27.4)(rollup@4.60.1)(storybook@10.3.3(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4))(vite@6.4.1(@types/node@25.5.0)(yaml@2.8.3))': + '@storybook/csf-plugin@10.3.4(esbuild@0.27.5)(rollup@4.60.1)(storybook@10.3.4(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4))(vite@6.4.1(@types/node@25.5.0)(yaml@2.8.3))': dependencies: - storybook: 10.3.3(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4) + storybook: 10.3.4(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4) unplugin: 2.3.11 optionalDependencies: - esbuild: 0.27.4 + esbuild: 0.27.5 rollup: 4.60.1 vite: 6.4.1(@types/node@25.5.0)(yaml@2.8.3) @@ -3018,25 +3021,25 @@ snapshots: react: 19.2.4 react-dom: 19.2.4(react@19.2.4) - '@storybook/react-dom-shim@10.3.3(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(storybook@10.3.3(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4))': + '@storybook/react-dom-shim@10.3.4(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(storybook@10.3.4(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4))': dependencies: react: 19.2.4 react-dom: 19.2.4(react@19.2.4) - storybook: 10.3.3(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4) + storybook: 10.3.4(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4) - '@storybook/react-vite@10.3.3(esbuild@0.27.4)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(rollup@4.60.1)(storybook@10.3.3(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4))(typescript@5.9.3)(vite@6.4.1(@types/node@25.5.0)(yaml@2.8.3))': + '@storybook/react-vite@10.3.4(esbuild@0.27.5)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(rollup@4.60.1)(storybook@10.3.4(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4))(typescript@5.9.3)(vite@6.4.1(@types/node@25.5.0)(yaml@2.8.3))': dependencies: - '@joshwooding/vite-plugin-react-docgen-typescript': 0.6.4(typescript@5.9.3)(vite@6.4.1(@types/node@25.5.0)(yaml@2.8.3)) + '@joshwooding/vite-plugin-react-docgen-typescript': 0.7.0(typescript@5.9.3)(vite@6.4.1(@types/node@25.5.0)(yaml@2.8.3)) '@rollup/pluginutils': 5.3.0(rollup@4.60.1) - '@storybook/builder-vite': 10.3.3(esbuild@0.27.4)(rollup@4.60.1)(storybook@10.3.3(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4))(vite@6.4.1(@types/node@25.5.0)(yaml@2.8.3)) - '@storybook/react': 10.3.3(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(storybook@10.3.3(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4))(typescript@5.9.3) + '@storybook/builder-vite': 10.3.4(esbuild@0.27.5)(rollup@4.60.1)(storybook@10.3.4(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4))(vite@6.4.1(@types/node@25.5.0)(yaml@2.8.3)) + '@storybook/react': 10.3.4(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(storybook@10.3.4(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4))(typescript@5.9.3) empathic: 2.0.0 magic-string: 0.30.21 react: 19.2.4 react-docgen: 8.0.3 react-dom: 19.2.4(react@19.2.4) resolve: 1.22.11 - storybook: 10.3.3(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4) + storybook: 10.3.4(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4) tsconfig-paths: 4.2.0 vite: 6.4.1(@types/node@25.5.0)(yaml@2.8.3) transitivePeerDependencies: @@ -3046,15 +3049,15 @@ snapshots: - typescript - webpack - '@storybook/react@10.3.3(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(storybook@10.3.3(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4))(typescript@5.9.3)': + '@storybook/react@10.3.4(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(storybook@10.3.4(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4))(typescript@5.9.3)': dependencies: '@storybook/global': 5.0.0 - '@storybook/react-dom-shim': 10.3.3(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(storybook@10.3.3(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)) + '@storybook/react-dom-shim': 10.3.4(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(storybook@10.3.4(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)) react: 19.2.4 react-docgen: 8.0.3 react-docgen-typescript: 2.4.0(typescript@5.9.3) react-dom: 19.2.4(react@19.2.4) - storybook: 10.3.3(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4) + storybook: 10.3.4(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4) optionalDependencies: typescript: 5.9.3 transitivePeerDependencies: @@ -3253,9 +3256,11 @@ snapshots: convert-source-map: 2.0.0 tinyrainbow: 3.1.0 - '@xyflow/react@12.10.1(@types/react@19.2.14)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)': + '@webcontainer/env@1.1.1': {} + + '@xyflow/react@12.10.2(@types/react@19.2.14)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)': dependencies: - '@xyflow/system': 0.0.75 + '@xyflow/system': 0.0.76 classcat: 5.0.5 react: 19.2.4 react-dom: 19.2.4(react@19.2.4) @@ -3264,7 +3269,7 @@ snapshots: - '@types/react' - immer - '@xyflow/system@0.0.75': + '@xyflow/system@0.0.76': dependencies: '@types/d3-drag': 3.0.7 '@types/d3-interpolate': 3.0.4 @@ -3326,8 +3331,8 @@ snapshots: dependencies: baseline-browser-mapping: 2.10.13 caniuse-lite: 1.0.30001784 - electron-to-chromium: 1.5.330 - node-releases: 2.0.36 + electron-to-chromium: 1.5.331 + node-releases: 2.0.37 update-browserslist-db: 1.2.3(browserslist@4.28.2) bundle-name@4.1.0: @@ -3461,7 +3466,7 @@ snapshots: es-errors: 1.3.0 gopd: 1.2.0 - electron-to-chromium@1.5.330: {} + electron-to-chromium@1.5.331: {} emoji-regex@10.6.0: {} @@ -3517,34 +3522,34 @@ snapshots: '@esbuild/win32-ia32': 0.25.12 '@esbuild/win32-x64': 0.25.12 - esbuild@0.27.4: + esbuild@0.27.5: optionalDependencies: - '@esbuild/aix-ppc64': 0.27.4 - '@esbuild/android-arm': 0.27.4 - '@esbuild/android-arm64': 0.27.4 - '@esbuild/android-x64': 0.27.4 - '@esbuild/darwin-arm64': 0.27.4 - '@esbuild/darwin-x64': 0.27.4 - '@esbuild/freebsd-arm64': 0.27.4 - '@esbuild/freebsd-x64': 0.27.4 - '@esbuild/linux-arm': 0.27.4 - '@esbuild/linux-arm64': 0.27.4 - '@esbuild/linux-ia32': 0.27.4 - '@esbuild/linux-loong64': 0.27.4 - '@esbuild/linux-mips64el': 0.27.4 - '@esbuild/linux-ppc64': 0.27.4 - '@esbuild/linux-riscv64': 0.27.4 - '@esbuild/linux-s390x': 0.27.4 - '@esbuild/linux-x64': 0.27.4 - '@esbuild/netbsd-arm64': 0.27.4 - '@esbuild/netbsd-x64': 0.27.4 - '@esbuild/openbsd-arm64': 0.27.4 - '@esbuild/openbsd-x64': 0.27.4 - '@esbuild/openharmony-arm64': 0.27.4 - '@esbuild/sunos-x64': 0.27.4 - '@esbuild/win32-arm64': 0.27.4 - '@esbuild/win32-ia32': 0.27.4 - '@esbuild/win32-x64': 0.27.4 + '@esbuild/aix-ppc64': 0.27.5 + '@esbuild/android-arm': 0.27.5 + '@esbuild/android-arm64': 0.27.5 + '@esbuild/android-x64': 0.27.5 + '@esbuild/darwin-arm64': 0.27.5 + '@esbuild/darwin-x64': 0.27.5 + '@esbuild/freebsd-arm64': 0.27.5 + '@esbuild/freebsd-x64': 0.27.5 + '@esbuild/linux-arm': 0.27.5 + '@esbuild/linux-arm64': 0.27.5 + '@esbuild/linux-ia32': 0.27.5 + '@esbuild/linux-loong64': 0.27.5 + '@esbuild/linux-mips64el': 0.27.5 + '@esbuild/linux-ppc64': 0.27.5 + '@esbuild/linux-riscv64': 0.27.5 + '@esbuild/linux-s390x': 0.27.5 + '@esbuild/linux-x64': 0.27.5 + '@esbuild/netbsd-arm64': 0.27.5 + '@esbuild/netbsd-x64': 0.27.5 + '@esbuild/openbsd-arm64': 0.27.5 + '@esbuild/openbsd-x64': 0.27.5 + '@esbuild/openharmony-arm64': 0.27.5 + '@esbuild/sunos-x64': 0.27.5 + '@esbuild/win32-arm64': 0.27.5 + '@esbuild/win32-ia32': 0.27.5 + '@esbuild/win32-x64': 0.27.5 escalade@3.2.0: {} @@ -3813,7 +3818,7 @@ snapshots: nanoid@3.3.11: {} - node-releases@2.0.36: {} + node-releases@2.0.37: {} nwsapi@2.2.23: {} @@ -3854,27 +3859,27 @@ snapshots: '@oxfmt/binding-win32-ia32-msvc': 0.41.0 '@oxfmt/binding-win32-x64-msvc': 0.41.0 - oxlint@1.57.0: + oxlint@1.58.0: optionalDependencies: - '@oxlint/binding-android-arm-eabi': 1.57.0 - '@oxlint/binding-android-arm64': 1.57.0 - '@oxlint/binding-darwin-arm64': 1.57.0 - '@oxlint/binding-darwin-x64': 1.57.0 - '@oxlint/binding-freebsd-x64': 1.57.0 - '@oxlint/binding-linux-arm-gnueabihf': 1.57.0 - '@oxlint/binding-linux-arm-musleabihf': 1.57.0 - '@oxlint/binding-linux-arm64-gnu': 1.57.0 - '@oxlint/binding-linux-arm64-musl': 1.57.0 - '@oxlint/binding-linux-ppc64-gnu': 1.57.0 - '@oxlint/binding-linux-riscv64-gnu': 1.57.0 - '@oxlint/binding-linux-riscv64-musl': 1.57.0 - '@oxlint/binding-linux-s390x-gnu': 1.57.0 - '@oxlint/binding-linux-x64-gnu': 1.57.0 - '@oxlint/binding-linux-x64-musl': 1.57.0 - '@oxlint/binding-openharmony-arm64': 1.57.0 - '@oxlint/binding-win32-arm64-msvc': 1.57.0 - '@oxlint/binding-win32-ia32-msvc': 1.57.0 - '@oxlint/binding-win32-x64-msvc': 1.57.0 + '@oxlint/binding-android-arm-eabi': 1.58.0 + '@oxlint/binding-android-arm64': 1.58.0 + '@oxlint/binding-darwin-arm64': 1.58.0 + '@oxlint/binding-darwin-x64': 1.58.0 + '@oxlint/binding-freebsd-x64': 1.58.0 + '@oxlint/binding-linux-arm-gnueabihf': 1.58.0 + '@oxlint/binding-linux-arm-musleabihf': 1.58.0 + '@oxlint/binding-linux-arm64-gnu': 1.58.0 + '@oxlint/binding-linux-arm64-musl': 1.58.0 + '@oxlint/binding-linux-ppc64-gnu': 1.58.0 + '@oxlint/binding-linux-riscv64-gnu': 1.58.0 + '@oxlint/binding-linux-riscv64-musl': 1.58.0 + '@oxlint/binding-linux-s390x-gnu': 1.58.0 + '@oxlint/binding-linux-x64-gnu': 1.58.0 + '@oxlint/binding-linux-x64-musl': 1.58.0 + '@oxlint/binding-openharmony-arm64': 1.58.0 + '@oxlint/binding-win32-arm64-msvc': 1.58.0 + '@oxlint/binding-win32-ia32-msvc': 1.58.0 + '@oxlint/binding-win32-x64-msvc': 1.58.0 package-json-from-dist@1.0.1: {} @@ -4047,7 +4052,7 @@ snapshots: std-env@4.0.0: {} - storybook@10.3.3(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4): + storybook@10.3.4(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4): dependencies: '@storybook/global': 5.0.0 '@storybook/icons': 2.0.1(react-dom@19.2.4(react@19.2.4))(react@19.2.4) @@ -4055,7 +4060,8 @@ snapshots: '@testing-library/user-event': 14.6.1(@testing-library/dom@10.4.1) '@vitest/expect': 3.2.4 '@vitest/spy': 3.2.4 - esbuild: 0.27.4 + '@webcontainer/env': 1.1.1 + esbuild: 0.27.5 open: 10.2.0 recast: 0.23.11 semver: 7.7.4 From 891f88f194427040cb45156c87ed0fdf21a3d5e3 Mon Sep 17 00:00:00 2001 From: kumaradityaraj Date: Tue, 7 Apr 2026 18:06:09 +0530 Subject: [PATCH 13/16] tests and readme added Signed-off-by: kumaradityaraj --- packages/i18n/README.md | 103 ++++++++++++++++++ packages/i18n/package.json | 16 ++- packages/i18n/tests/I18nProvider.test.tsx | 40 +++++++ packages/i18n/tests/createI18n.test.ts | 35 ++++++ packages/i18n/tests/detectLocale.test.ts | 38 +++++++ packages/i18n/tests/setupTests.ts | 32 ++++++ packages/i18n/vitest.config.ts | 32 ++++++ .../src/diagram-editor/DiagramEditor.tsx | 6 +- pnpm-lock.yaml | 27 +++++ 9 files changed, 324 insertions(+), 5 deletions(-) create mode 100644 packages/i18n/README.md create mode 100644 packages/i18n/tests/I18nProvider.test.tsx create mode 100644 packages/i18n/tests/createI18n.test.ts create mode 100644 packages/i18n/tests/detectLocale.test.ts create mode 100644 packages/i18n/tests/setupTests.ts create mode 100644 packages/i18n/vitest.config.ts diff --git a/packages/i18n/README.md b/packages/i18n/README.md new file mode 100644 index 0000000..8e0bd6b --- /dev/null +++ b/packages/i18n/README.md @@ -0,0 +1,103 @@ + + +# i18n Usage Guide + +This guide explains how to use the `@serverlessworkflow/i18n` package inside your project (e.g., in the `DiagramEditor`). + +--- + +## What this package provides + +- `I18nProvider` → React context provider for translations +- `useI18n()` → Hook to access translations +- `detectLocale()` → Automatically detect user language +- `createI18n()` → Core translation logic (used internally) + +--- + +## Step 1: Define your dictionaries + +Create a file like: + +```ts +// i18n/locales.ts + +export const dictionaries = { + en: { + save: "Save", + }, + fr: { + save: "Enregistrer", + }, +}; +``` + +- Keys (`save`) must be consistent across languages. + +--- + +## Step 2: Detect or pass locale + +You can either: + +- Pass `locale` manually via props +- Or auto-detect using `detectLocale` + +Example: + +```ts +const supportedLocales = Object.keys(dictionaries); + +const locale = props.locale ?? detectLocale(supportedLocales); +``` + +--- + +## Step 3: Wrap your app with `I18nProvider` + +```tsx +import { I18nProvider } from "@serverlessworkflow/i18n"; +import { dictionaries } from "../i18n/locales"; + + + {/* your app */} +; +``` + +--- + +## Step 4: Use translations with `useI18n` + +Inside any child component: + +```tsx +import { useI18n } from "@serverlessworkflow/i18n"; + +const Content = () => { + const { t } = useI18n(); + + return

{t("save")}

; +}; +``` + +- If the key is missing, it will return the key itself: + +```ts +t("unknown") → "unknown" +``` + +--- diff --git a/packages/i18n/package.json b/packages/i18n/package.json index 75287b2..4c35458 100644 --- a/packages/i18n/package.json +++ b/packages/i18n/package.json @@ -16,15 +16,25 @@ }, "scripts": { "clean": "rimraf ./dist", - "build": "pnpm clean && tsc -p tsconfig.json", - "build:prod": "pnpm run build" + "build:dev": "pnpm clean && tsc -p tsconfig.json", + "build:prod": "pnpm run build", + "test": "vitest run --passWithNoTests" }, "devDependencies": { + "@storybook/addon-vitest": "catalog:", + "@storybook/react-vite": "catalog:", + "@testing-library/jest-dom": "catalog:", + "@testing-library/react": "catalog:", "@types/node": "catalog:", "@types/react": "catalog:", "@types/react-dom": "catalog:", + "@vitest/coverage-v8": "catalog:", + "@vitest/ui": "catalog:", "rimraf": "catalog:", - "typescript": "catalog:" + "typescript": "catalog:", + "vite": "catalog:", + "vite-tsconfig-paths": "catalog:", + "vitest": "catalog:" }, "peerDependencies": { "react": "^19.0.0", diff --git a/packages/i18n/tests/I18nProvider.test.tsx b/packages/i18n/tests/I18nProvider.test.tsx new file mode 100644 index 0000000..f306b72 --- /dev/null +++ b/packages/i18n/tests/I18nProvider.test.tsx @@ -0,0 +1,40 @@ +/* + * Copyright 2021-Present The Serverless Workflow Specification Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { render, screen } from "@testing-library/react"; +import { describe, it, expect } from "vitest"; +import { I18nProvider, useI18n } from "../src/react/I18nProvider"; + +const dictionaries = { + en: { save: "Save" }, +}; + +const TestComponent = () => { + const { t } = useI18n(); + return {t("save")}; +}; + +describe("I18nProvider", () => { + it("provides translation", () => { + render( + + + , + ); + + expect(screen.getByText("Save")).toBeInTheDocument(); + }); +}); diff --git a/packages/i18n/tests/createI18n.test.ts b/packages/i18n/tests/createI18n.test.ts new file mode 100644 index 0000000..645c006 --- /dev/null +++ b/packages/i18n/tests/createI18n.test.ts @@ -0,0 +1,35 @@ +/* + * Copyright 2021-Present The Serverless Workflow Specification Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { describe, it, expect } from "vitest"; +import { createI18n } from "../src/core/createI18n"; + +describe("createI18n", () => { + const dictionaries = { + en: { save: "Save" }, + fr: { save: "Enregistrer" }, + }; + + it("returns correct translation", () => { + const i18n = createI18n(dictionaries, "en"); + expect(i18n.t("save")).toBe("Save"); + }); + + it("returns key if missing", () => { + const i18n = createI18n(dictionaries, "fr"); + expect(i18n.t("cancel")).toBe("cancel"); + }); +}); diff --git a/packages/i18n/tests/detectLocale.test.ts b/packages/i18n/tests/detectLocale.test.ts new file mode 100644 index 0000000..19b5401 --- /dev/null +++ b/packages/i18n/tests/detectLocale.test.ts @@ -0,0 +1,38 @@ +/* + * Copyright 2021-Present The Serverless Workflow Specification Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { describe, it, expect, vi } from "vitest"; +import { detectLocale } from "../src/utils/detectLocale"; + +describe("detectLocale", () => { + it("detects supported language", () => { + vi.stubGlobal("navigator", { + languages: ["fr-FR"], + }); + + const result = detectLocale(["en", "fr"]); + expect(result).toBe("fr"); + }); + + it("falls back if no match", () => { + vi.stubGlobal("navigator", { + languages: ["de-DE"], + }); + + const result = detectLocale(["en", "fr"]); + expect(result).toBe("en"); + }); +}); diff --git a/packages/i18n/tests/setupTests.ts b/packages/i18n/tests/setupTests.ts new file mode 100644 index 0000000..bff6cfb --- /dev/null +++ b/packages/i18n/tests/setupTests.ts @@ -0,0 +1,32 @@ +/* + * Copyright 2021-Present The Serverless Workflow Specification Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { afterEach, vi } from "vitest"; +import { cleanup } from "@testing-library/react"; +import "@testing-library/jest-dom/vitest"; + +afterEach(() => { + cleanup(); +}); + +vi.stubGlobal( + "ResizeObserver", + class { + observe() {} + unobserve() {} + disconnect() {} + }, +); diff --git a/packages/i18n/vitest.config.ts b/packages/i18n/vitest.config.ts new file mode 100644 index 0000000..31c771f --- /dev/null +++ b/packages/i18n/vitest.config.ts @@ -0,0 +1,32 @@ +/* + * Copyright 2021-Present The Serverless Workflow Specification Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { defineConfig } from "vitest/config"; +import tsconfigPaths from "vite-tsconfig-paths"; + +export default defineConfig({ + plugins: [ + tsconfigPaths({ + projects: ["./tsconfig.test.json"], + }), + ], + test: { + globals: true, + environment: "jsdom", + setupFiles: ["./tests/setupTests.ts"], + css: true, + }, +}); diff --git a/packages/serverless-workflow-diagram-editor/src/diagram-editor/DiagramEditor.tsx b/packages/serverless-workflow-diagram-editor/src/diagram-editor/DiagramEditor.tsx index 7b5a1ed..49e05b8 100644 --- a/packages/serverless-workflow-diagram-editor/src/diagram-editor/DiagramEditor.tsx +++ b/packages/serverless-workflow-diagram-editor/src/diagram-editor/DiagramEditor.tsx @@ -43,8 +43,10 @@ export const DiagramEditor = (props: DiagramEditorProps) => { // Refs const diagramDivRef = React.useRef(null); const diagramRef = React.useRef(null); - const supportedLocales = Object.keys(dictionaries); - const locale = detectLocale(supportedLocales); + const locale = React.useMemo(() => { + const supportedLocales = Object.keys(dictionaries); + return props.locale ?? detectLocale(supportedLocales); + }, [props.locale]); // Allow imperatively controlling the Editor // React.useImperativeHandle( diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2266abe..8bac44e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -123,6 +123,18 @@ importers: specifier: ^19.0.0 version: 19.2.4(react@19.2.4) devDependencies: + '@storybook/addon-vitest': + specifier: 'catalog:' + version: 10.3.4(@vitest/runner@4.1.2)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(storybook@10.3.4(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4))(vitest@4.1.2) + '@storybook/react-vite': + specifier: 'catalog:' + version: 10.3.4(esbuild@0.27.5)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(rollup@4.60.1)(storybook@10.3.4(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4))(typescript@5.9.3)(vite@6.4.1(@types/node@25.5.0)(yaml@2.8.3)) + '@testing-library/jest-dom': + specifier: 'catalog:' + version: 6.9.1 + '@testing-library/react': + specifier: 'catalog:' + version: 16.3.2(@testing-library/dom@10.4.1)(@types/react-dom@19.2.3(@types/react@19.2.14))(@types/react@19.2.14)(react-dom@19.2.4(react@19.2.4))(react@19.2.4) '@types/node': specifier: 'catalog:' version: 25.5.0 @@ -132,12 +144,27 @@ importers: '@types/react-dom': specifier: 'catalog:' version: 19.2.3(@types/react@19.2.14) + '@vitest/coverage-v8': + specifier: 'catalog:' + version: 4.1.2(vitest@4.1.2) + '@vitest/ui': + specifier: 'catalog:' + version: 4.1.2(vitest@4.1.2) rimraf: specifier: 'catalog:' version: 6.1.3 typescript: specifier: 'catalog:' version: 5.9.3 + vite: + specifier: 'catalog:' + version: 6.4.1(@types/node@25.5.0)(yaml@2.8.3) + vite-tsconfig-paths: + specifier: 'catalog:' + version: 6.1.1(typescript@5.9.3)(vite@6.4.1(@types/node@25.5.0)(yaml@2.8.3)) + vitest: + specifier: 'catalog:' + version: 4.1.2(@types/node@25.5.0)(@vitest/ui@4.1.2)(jsdom@25.0.1)(vite@6.4.1(@types/node@25.5.0)(yaml@2.8.3)) packages/serverless-workflow-diagram-editor: dependencies: From f34c637391f66bc2a40911506fae2d4bb7b44e9b Mon Sep 17 00:00:00 2001 From: kumaradityaraj Date: Tue, 7 Apr 2026 18:10:20 +0530 Subject: [PATCH 14/16] package.json correction Signed-off-by: kumaradityaraj --- packages/i18n/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/i18n/package.json b/packages/i18n/package.json index 4c35458..750b056 100644 --- a/packages/i18n/package.json +++ b/packages/i18n/package.json @@ -17,7 +17,7 @@ "scripts": { "clean": "rimraf ./dist", "build:dev": "pnpm clean && tsc -p tsconfig.json", - "build:prod": "pnpm run build", + "build:prod": "pnpm run build:dev", "test": "vitest run --passWithNoTests" }, "devDependencies": { From 98627519042e1947967358f2795a3938d6d3ace3 Mon Sep 17 00:00:00 2001 From: kumaradityaraj Date: Tue, 7 Apr 2026 18:17:40 +0530 Subject: [PATCH 15/16] package.json correction Signed-off-by: kumaradityaraj --- packages/i18n/package.json | 7 +------ pnpm-lock.yaml | 15 --------------- 2 files changed, 1 insertion(+), 21 deletions(-) diff --git a/packages/i18n/package.json b/packages/i18n/package.json index 750b056..9cbe7db 100644 --- a/packages/i18n/package.json +++ b/packages/i18n/package.json @@ -17,22 +17,17 @@ "scripts": { "clean": "rimraf ./dist", "build:dev": "pnpm clean && tsc -p tsconfig.json", - "build:prod": "pnpm run build:dev", + "build:prod": "pnpm run build:dev && pnpm test", "test": "vitest run --passWithNoTests" }, "devDependencies": { - "@storybook/addon-vitest": "catalog:", - "@storybook/react-vite": "catalog:", "@testing-library/jest-dom": "catalog:", "@testing-library/react": "catalog:", "@types/node": "catalog:", "@types/react": "catalog:", "@types/react-dom": "catalog:", - "@vitest/coverage-v8": "catalog:", - "@vitest/ui": "catalog:", "rimraf": "catalog:", "typescript": "catalog:", - "vite": "catalog:", "vite-tsconfig-paths": "catalog:", "vitest": "catalog:" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8bac44e..d5cb78f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -123,12 +123,6 @@ importers: specifier: ^19.0.0 version: 19.2.4(react@19.2.4) devDependencies: - '@storybook/addon-vitest': - specifier: 'catalog:' - version: 10.3.4(@vitest/runner@4.1.2)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(storybook@10.3.4(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4))(vitest@4.1.2) - '@storybook/react-vite': - specifier: 'catalog:' - version: 10.3.4(esbuild@0.27.5)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(rollup@4.60.1)(storybook@10.3.4(@testing-library/dom@10.4.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4))(typescript@5.9.3)(vite@6.4.1(@types/node@25.5.0)(yaml@2.8.3)) '@testing-library/jest-dom': specifier: 'catalog:' version: 6.9.1 @@ -144,21 +138,12 @@ importers: '@types/react-dom': specifier: 'catalog:' version: 19.2.3(@types/react@19.2.14) - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 4.1.2(vitest@4.1.2) - '@vitest/ui': - specifier: 'catalog:' - version: 4.1.2(vitest@4.1.2) rimraf: specifier: 'catalog:' version: 6.1.3 typescript: specifier: 'catalog:' version: 5.9.3 - vite: - specifier: 'catalog:' - version: 6.4.1(@types/node@25.5.0)(yaml@2.8.3) vite-tsconfig-paths: specifier: 'catalog:' version: 6.1.1(typescript@5.9.3)(vite@6.4.1(@types/node@25.5.0)(yaml@2.8.3)) From 08f7b31ea5d1fe9470f9d95700d3c8663dcc0b02 Mon Sep 17 00:00:00 2001 From: kumaradityaraj Date: Tue, 7 Apr 2026 18:32:19 +0530 Subject: [PATCH 16/16] copilot suggestion Signed-off-by: kumaradityaraj --- packages/i18n/vitest.config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/i18n/vitest.config.ts b/packages/i18n/vitest.config.ts index 31c771f..eb8f072 100644 --- a/packages/i18n/vitest.config.ts +++ b/packages/i18n/vitest.config.ts @@ -20,7 +20,7 @@ import tsconfigPaths from "vite-tsconfig-paths"; export default defineConfig({ plugins: [ tsconfigPaths({ - projects: ["./tsconfig.test.json"], + projects: ["./tsconfig.json"], }), ], test: {