Comparing version 0.0.1-rc.0 to 0.0.2-dev.16
@@ -1,5 +0,107 @@ | ||
export * from './I18NProvider'; | ||
export * from './useTranslate'; | ||
export * from './i18n'; | ||
export * from './en'; | ||
import React, { FC } from 'react'; | ||
import * as react_i18next from 'react-i18next'; | ||
import { I18nextProviderProps, UseTranslationOptions } from 'react-i18next'; | ||
export { Trans } from 'react-i18next'; | ||
import * as i18next from 'i18next'; | ||
import { InitOptions, Callback, Resource, ReadCallback } from 'i18next'; | ||
declare type I18nProviderProps = { | ||
fallback?: React.ReactNode; | ||
options?: InitOptions; | ||
callback?: Callback; | ||
} & Omit<Partial<I18nextProviderProps>, 'i18n'> & Pick<I18nextProviderProps, 'i18n'>; | ||
declare const I18nProvider: FC<I18nProviderProps>; | ||
declare const useTranslate: (options?: UseTranslationOptions<any>) => react_i18next.TFunction<react_i18next.Namespace<string>, any>; | ||
declare type ImportFn = (language: string, namespace: string, callback: ReadCallback) => void; | ||
/** | ||
* Default i18next instance used by chakra-admin. | ||
* It uses the following plugins: | ||
* - [i18next-browser-languagedetector](https://www.npmjs.com/package/i18next-browser-languagedetector) | ||
* - [i18next-polyglot](https://www.npmjs.com/package/i18next-polyglot) | ||
* - [i18next-chained-backend](https://www.npmjs.com/package/i18next-chained-backend) | ||
* - [i18next-http-backend](https://www.npmjs.com/package/i18next-http-backend) | ||
* - [i18next-resources-to-backend](https://www.npmjs.com/package/i18next-resources-to-backend) | ||
* - [react-i18next](https://www.npmjs.com/package/react-i18next) | ||
* | ||
* Note: it is not initialized, it is supposed to be initialized by the <Admin> component of the chakra-admin package. | ||
* | ||
* | ||
* @example | ||
* | ||
* // if you are using the chakra-admin package | ||
* ```tsx | ||
* import { defaultI18n, Admin, Resource } from 'chakra-admin' | ||
* | ||
* const App = () => { | ||
* return ( | ||
* <Admin | ||
* i18n={defaultI18n} | ||
* ... // other props | ||
* > | ||
* ... // resources and routes | ||
* </Admin> | ||
* ``` | ||
* | ||
*/ | ||
declare const defaultI18n: i18next.i18n; | ||
/** | ||
* Factory function for default options for i18next used by chakra-admin. | ||
* for all options refer to i18next documentaion: https://www.i18next.com/overview/configuration-options | ||
* | ||
* @param defaultResource - default i18n resource used by ca-i18n | ||
* @returns default options for i18next used by chakra-admin | ||
*/ | ||
declare const getDefaultI18nOptions: (defaultResource: Resource | ImportFn) => { | ||
debug: boolean; | ||
fallbackLng: string; | ||
backend: { | ||
backends: i18next.BackendModule<object>[]; | ||
}; | ||
interpolation: { | ||
escapeValue: boolean; | ||
format: (value: any, format: any, lng: any) => any; | ||
}; | ||
}; | ||
declare const en: { | ||
translation: { | ||
ca: { | ||
action: { | ||
create: string; | ||
close: string; | ||
edit: string; | ||
show: string; | ||
delete: string; | ||
cancel: string; | ||
confirm_delete: string; | ||
submit: string; | ||
}; | ||
page: { | ||
list: string; | ||
edit: string; | ||
create: string; | ||
show: string; | ||
}; | ||
input: { | ||
single_image: { | ||
label: string; | ||
while_dragging: string; | ||
}; | ||
}; | ||
pagination: { | ||
page_info: string; | ||
many: string; | ||
back_to_top: string; | ||
}; | ||
message: { | ||
delete_title: string; | ||
delete_content: string; | ||
required_field: string; | ||
}; | ||
}; | ||
}; | ||
}; | ||
export { I18nProvider, I18nProviderProps, defaultI18n, en, getDefaultI18nOptions, useTranslate }; |
{ | ||
"name": "ca-i18n", | ||
"version": "0.0.1-rc.0", | ||
"version": "0.0.2-dev.16", | ||
"description": "", | ||
"main": "lib/index.js", | ||
"module": "lib/index.esm.js", | ||
"module": "lib/index.mjs", | ||
"types": "lib/index.d.ts", | ||
@@ -11,7 +11,2 @@ "files": [ | ||
], | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1", | ||
"build": "rollup -c", | ||
"start": "rollup -c -w" | ||
}, | ||
"author": "Hyperting S.r.l.", | ||
@@ -25,21 +20,35 @@ "license": "MIT", | ||
"peerDependencies": { | ||
"react": ">= 17.0.2", | ||
"react-dom": ">= 17.0.2" | ||
"react": ">= 18", | ||
"react-dom": ">= 18" | ||
}, | ||
"dependencies": { | ||
"i18next": "^21.6.6", | ||
"react-i18next": "^11.15.3", | ||
"i18next-browser-languagedetector": "^6.1.2", | ||
"i18next-polyglot": "^0.1.0", | ||
"i18next-chained-backend": "^3.0.2", | ||
"i18next-http-backend": "^1.2.6", | ||
"i18next-polyglot": "^0.1.0", | ||
"i18next-resources-to-backend": "^1.0.0", | ||
"luxon": "^2.3.0" | ||
"luxon": "^2.3.0", | ||
"react-i18next": "^11.15.3" | ||
}, | ||
"devDependencies": { | ||
"ca-test-utils": "^0.0.1-rc.0" | ||
"eslint-config-custom": "0.0.0", | ||
"tsconfig": "0.0.0", | ||
"tsup-config": "0.0.0", | ||
"ca-test-utils": "0.0.2-dev.16", | ||
"eslint": "^8.25.0", | ||
"react": "^18.2.0", | ||
"typescript": "^4.5.2", | ||
"tsup": "^6.2.3", | ||
"@types/luxon": "^2.0.2", | ||
"@types/react": "^18.0.21" | ||
}, | ||
"publishConfig": { | ||
"registry": "https://registry.npmjs.org/" | ||
"registry": "https://registry.npmjs.org" | ||
}, | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1", | ||
"build": "tsup src/index.ts", | ||
"dev": "npm run build -- --watch" | ||
} | ||
} |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 2 instances in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
0
1
15100
10
6
398