@payload-enchants/translator 1.1.16 → 1.1.17

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,4 @@
1
- /// <reference types="react" resolution-mode="require"/>
1
+ /// <reference types="react" />
2
2
  import './styles.scss';
3
3
  export declare const CustomSaveButton: () => import("react").JSX.Element;
4
4
  //# sourceMappingURL=CustomSaveButton.d.ts.map
@@ -1,4 +1,4 @@
1
- /// <reference types="react" resolution-mode="require"/>
1
+ /// <reference types="react" />
2
2
  import type { Locale } from 'payload/config';
3
3
  export declare const LocaleLabel: ({ locale }: {
4
4
  locale: Locale;
@@ -1,4 +1,4 @@
1
- /// <reference types="react" resolution-mode="require"/>
1
+ /// <reference types="react" />
2
2
  import type { TranslateResolver } from '../../../resolvers/types';
3
3
  export declare const ResolverButton: ({ resolver: { key: resolverKey }, }: {
4
4
  resolver: TranslateResolver;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/client/components/ResolverButton/ResolverButton.tsx"],"sourcesContent":["import { Button } from '@payloadcms/ui/elements';\nimport { useTranslation } from '@payloadcms/ui/providers/Translation';\n\nimport type { TranslateResolver } from '../../../resolvers/types';\nimport { useTranslator } from '../../providers/Translator/context';\n\nexport const ResolverButton = ({\n resolver: { key: resolverKey },\n}: {\n resolver: TranslateResolver;\n}) => {\n const { openTranslator } = useTranslator();\n\n const { t } = useTranslation();\n\n const handleClick = () => openTranslator({ resolverKey });\n\n return (\n <Button onClick={handleClick} size='small'>\n {t(`plugin-translator:resolver_${resolverKey}_buttonLabel`)}\n </Button>\n );\n};\n"],"names":["Button","useTranslation","useTranslator","ResolverButton","resolver","key","resolverKey","openTranslator","t","handleClick","onClick","size"],"rangeMappings":";;;;;;;;;;;;;;;","mappings":";AAAA,SAASA,MAAM,QAAQ,0BAA0B;AACjD,SAASC,cAAc,QAAQ,uCAAuC;AAGtE,SAASC,aAAa,QAAQ,qCAAqC;AAEnE,OAAO,MAAMC,iBAAiB,CAAC,EAC7BC,UAAU,EAAEC,KAAKC,WAAW,EAAE,EAG/B;IACC,MAAM,EAAEC,cAAc,EAAE,GAAGL;IAE3B,MAAM,EAAEM,CAAC,EAAE,GAAGP;IAEd,MAAMQ,cAAc,IAAMF,eAAe;YAAED;QAAY;IAEvD,qBACE,KAACN;QAAOU,SAASD;QAAaE,MAAK;kBAChCH,EAAE,CAAC,2BAA2B,EAAEF,YAAY,YAAY,CAAC;;AAGhE,EAAE"}
1
+ {"version":3,"sources":["../../../../src/client/components/ResolverButton/ResolverButton.tsx"],"sourcesContent":["import { Button } from '@payloadcms/ui/elements';\nimport { useTranslation } from '@payloadcms/ui/providers/Translation';\n\nimport type { TranslateResolver } from '../../../resolvers/types';\nimport { useTranslator } from '../../providers/Translator/context';\n\nexport const ResolverButton = ({\n resolver: { key: resolverKey },\n}: {\n resolver: TranslateResolver;\n}) => {\n const { openTranslator } = useTranslator();\n\n const { t } = useTranslation();\n\n const handleClick = () => openTranslator({ resolverKey });\n\n return (\n <Button onClick={handleClick} size='small'>\n {t(`plugin-translator:resolver_${resolverKey}_buttonLabel` as Parameters<typeof t>[0])}\n </Button>\n );\n};\n"],"names":["Button","useTranslation","useTranslator","ResolverButton","resolver","key","resolverKey","openTranslator","t","handleClick","onClick","size"],"rangeMappings":";;;;;;;;;;;;;;;","mappings":";AAAA,SAASA,MAAM,QAAQ,0BAA0B;AACjD,SAASC,cAAc,QAAQ,uCAAuC;AAGtE,SAASC,aAAa,QAAQ,qCAAqC;AAEnE,OAAO,MAAMC,iBAAiB,CAAC,EAC7BC,UAAU,EAAEC,KAAKC,WAAW,EAAE,EAG/B;IACC,MAAM,EAAEC,cAAc,EAAE,GAAGL;IAE3B,MAAM,EAAEM,CAAC,EAAE,GAAGP;IAEd,MAAMQ,cAAc,IAAMF,eAAe;YAAED;QAAY;IAEvD,qBACE,KAACN;QAAOU,SAASD;QAAaE,MAAK;kBAChCH,EAAE,CAAC,2BAA2B,EAAEF,YAAY,YAAY,CAAC;;AAGhE,EAAE"}
@@ -1,3 +1,3 @@
1
- /// <reference types="react" resolution-mode="require"/>
1
+ /// <reference types="react" />
2
2
  export declare const Content: () => import("react").JSX.Element;
3
3
  //# sourceMappingURL=Content.d.ts.map
@@ -1,4 +1,4 @@
1
- /// <reference types="react" resolution-mode="require"/>
1
+ /// <reference types="react" />
2
2
  import './styles.scss';
3
3
  export declare const TranslatorModal: () => import("react").JSX.Element | undefined;
4
4
  //# sourceMappingURL=TranslatorModal.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/client/providers/Translator/TranslatorProvider.tsx"],"sourcesContent":["import { toast } from '@payloadcms/ui/elements';\nimport { useModal } from '@payloadcms/ui/elements/Modal';\nimport { useAllFormFields } from '@payloadcms/ui/forms/Form';\nimport { useConfig } from '@payloadcms/ui/providers/Config';\nimport { useDocumentInfo } from '@payloadcms/ui/providers/DocumentInfo';\nimport { useLocale } from '@payloadcms/ui/providers/Locale';\nimport { useTranslation } from '@payloadcms/ui/providers/Translation';\nimport { getFormState } from '@payloadcms/ui/utilities/getFormState';\nimport { reduceFieldsToValues } from '@payloadcms/ui/utilities/reduceFieldsToValues';\nimport { type ReactNode, useMemo, useState } from 'react';\n\nimport type { TranslateResolver } from '../../../resolvers/types';\nimport type { TranslateArgs } from '../../../translate/types';\nimport { createClient } from '../../api';\nimport { TranslatorContext } from './context';\n\nconst modalSlug = 'translator-modal';\n\nexport const TranslatorProvider = ({ children }: { children: ReactNode }) => {\n const [resolver, setResolver] = useState<null | string>(null);\n\n const [data, dispatch] = useAllFormFields();\n\n const { collectionSlug, globalSlug, id } = useDocumentInfo();\n\n const modal = useModal();\n\n const { t } = useTranslation();\n\n const resolverT = (\n key:\n | 'buttonLabel'\n | 'errorMessage'\n | 'modalTitle'\n | 'submitButtonLabelEmpty'\n | 'submitButtonLabelFull'\n | 'successMessage',\n ) => {\n if (!resolver) return '';\n\n return t(`plugin-translator:resolver_${resolver}_${key}`);\n };\n\n const locale = useLocale();\n\n const {\n admin: { custom },\n localization,\n routes: { api },\n serverURL,\n } = useConfig();\n\n const apiClient = createClient({ api, serverURL });\n\n const resolverConfig = useMemo(() => {\n if (!resolver) return null;\n\n const resolvers = (custom?.translator?.resolvers as TranslateResolver[]) || undefined;\n\n if (!resolvers) return null;\n\n const resolverConfig = resolvers.find((each) => each.key === resolver);\n\n return resolverConfig ?? null;\n }, [custom, resolver]);\n\n if (!localization)\n throw new Error('Localization config is not provided and PluginTranslator is used');\n\n const localesOptions = localization.locales.filter((each) => each.code !== locale.code);\n\n const [localeToTranslateFrom, setLocaleToTranslateFrom] = useState(() => {\n const defaultFromOptions = localesOptions.find(\n (each) => localization.defaultLocale === each.code,\n );\n\n if (defaultFromOptions) return defaultFromOptions.code;\n\n return localesOptions[0].code;\n });\n\n const closeTranslator = () => modal.closeModal(modalSlug);\n\n const submit = async ({ emptyOnly }: { emptyOnly: boolean }) => {\n if (!resolver) return;\n\n const args: TranslateArgs = {\n collectionSlug,\n data: reduceFieldsToValues(data, true),\n emptyOnly,\n globalSlug,\n id: id === null ? undefined : id,\n locale: locale.code,\n localeFrom: localeToTranslateFrom,\n resolver,\n };\n\n const result = await apiClient.translate(args);\n\n if (!result.success) {\n toast.error(resolverT('errorMessage'));\n\n return;\n }\n\n dispatch({\n state: await getFormState({\n apiRoute: api,\n body: {\n collectionSlug,\n data: result.translatedData,\n globalSlug,\n locale: locale.code,\n schemaPath: collectionSlug || globalSlug || '',\n },\n serverURL,\n }),\n type: 'REPLACE_STATE',\n });\n\n if (resolverConfig) toast.success(resolverT('successMessage'));\n closeTranslator();\n };\n\n return (\n <TranslatorContext.Provider\n value={{\n closeTranslator,\n localeToTranslateFrom,\n localesOptions,\n modalSlug,\n openTranslator: ({ resolverKey }) => {\n setResolver(resolverKey);\n modal.openModal(modalSlug);\n },\n resolver: resolverConfig,\n resolverT,\n setLocaleToTranslateFrom,\n submit,\n }}\n >\n {children}\n </TranslatorContext.Provider>\n );\n};\n"],"names":["toast","useModal","useAllFormFields","useConfig","useDocumentInfo","useLocale","useTranslation","getFormState","reduceFieldsToValues","useMemo","useState","createClient","TranslatorContext","modalSlug","TranslatorProvider","children","resolver","setResolver","data","dispatch","collectionSlug","globalSlug","id","modal","t","resolverT","key","locale","admin","custom","localization","routes","api","serverURL","apiClient","resolverConfig","resolvers","translator","undefined","find","each","Error","localesOptions","locales","filter","code","localeToTranslateFrom","setLocaleToTranslateFrom","defaultFromOptions","defaultLocale","closeTranslator","closeModal","submit","emptyOnly","args","localeFrom","result","translate","success","error","state","apiRoute","body","translatedData","schemaPath","type","Provider","value","openTranslator","resolverKey","openModal"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";AAAA,SAASA,KAAK,QAAQ,0BAA0B;AAChD,SAASC,QAAQ,QAAQ,gCAAgC;AACzD,SAASC,gBAAgB,QAAQ,4BAA4B;AAC7D,SAASC,SAAS,QAAQ,kCAAkC;AAC5D,SAASC,eAAe,QAAQ,wCAAwC;AACxE,SAASC,SAAS,QAAQ,kCAAkC;AAC5D,SAASC,cAAc,QAAQ,uCAAuC;AACtE,SAASC,YAAY,QAAQ,wCAAwC;AACrE,SAASC,oBAAoB,QAAQ,gDAAgD;AACrF,SAAyBC,OAAO,EAAEC,QAAQ,QAAQ,QAAQ;AAI1D,SAASC,YAAY,QAAQ,YAAY;AACzC,SAASC,iBAAiB,QAAQ,YAAY;AAE9C,MAAMC,YAAY;AAElB,OAAO,MAAMC,qBAAqB,CAAC,EAAEC,QAAQ,EAA2B;IACtE,MAAM,CAACC,UAAUC,YAAY,GAAGP,SAAwB;IAExD,MAAM,CAACQ,MAAMC,SAAS,GAAGjB;IAEzB,MAAM,EAAEkB,cAAc,EAAEC,UAAU,EAAEC,EAAE,EAAE,GAAGlB;IAE3C,MAAMmB,QAAQtB;IAEd,MAAM,EAAEuB,CAAC,EAAE,GAAGlB;IAEd,MAAMmB,YAAY,CAChBC;QAQ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,YAAYT;YACZ9B;QACF;QAEA,MAAMwC,SAAS,MAAMtB,UAAUuB,SAAS,CAACH;QAEzC,IAAI,CAACE,OAAOE,OAAO,EAAE;YACnB1D,MAAM2D,KAAK,CAAClC,UAAU;YAEtB;QACF;QAEAN,SAAS;YACPyC,OAAO,MAAMrD,aAAa;gBACxBsD,UAAU7B;gBACV8B,MAAM;oBACJ1C;oBACAF,MAAMsC,OAAOO,cAAc;oBAC3B1C;oBACAM,QAAQA,OAAOkB,IAAI;oBACnBmB,YAAY5C,kBAAkBC,cAAc;gBAC9C;gBACAY;YACF;YACAgC,MAAM;QACR;QAEA,IAAI9B,gBAAgBnC,MAAM0D,OAAO,CAACjC,UAAU;QAC5CyB;IACF;IAEA,qBACE,KAACtC,kBAAkBsD,QAAQ;QACzBC,OAAO;YACLjB;YACAJ;YACAJ;YACA7B;YACAuD,gBAAgB,CAAC,EAAEC,WAAW,EAAE;gBAC9BpD,YAAYoD;gBACZ9C,MAAM+C,SAAS,CAACzD;YAClB;YACAG,UAAUmB;YACVV;YACAsB;YACAK;QACF;kBAECrC;;AAGP,EAAE"}
1
+ {"version":3,"sources":["../../../../src/client/providers/Translator/TranslatorProvider.tsx"],"sourcesContent":["import { toast } from '@payloadcms/ui/elements';\nimport { useModal } from '@payloadcms/ui/elements/Modal';\nimport { useAllFormFields } from '@payloadcms/ui/forms/Form';\nimport { useConfig } from '@payloadcms/ui/providers/Config';\nimport { useDocumentInfo } from '@payloadcms/ui/providers/DocumentInfo';\nimport { useLocale } from '@payloadcms/ui/providers/Locale';\nimport { useTranslation } from '@payloadcms/ui/providers/Translation';\nimport { getFormState } from '@payloadcms/ui/utilities/getFormState';\nimport { reduceFieldsToValues } from '@payloadcms/ui/utilities/reduceFieldsToValues';\nimport { type ReactNode, useMemo, useState } from 'react';\n\nimport type { TranslateResolver } from '../../../resolvers/types';\nimport type { TranslateArgs } from '../../../translate/types';\nimport { createClient } from '../../api';\nimport { TranslatorContext } from './context';\n\nconst modalSlug = 'translator-modal';\n\nexport const TranslatorProvider = ({ children }: { children: ReactNode }) => {\n const [resolver, setResolver] = useState<null | string>(null);\n\n const [data, dispatch] = useAllFormFields();\n\n const { collectionSlug, globalSlug, id } = useDocumentInfo();\n\n const modal = useModal();\n\n const { t } = useTranslation();\n\n const resolverT = (\n key:\n | 'buttonLabel'\n | 'errorMessage'\n | 'modalTitle'\n | 'submitButtonLabelEmpty'\n | 'submitButtonLabelFull'\n | 'successMessage',\n ) => {\n if (!resolver) return '';\n\n return t(`plugin-translator:resolver_${resolver}_${key}` as Parameters<typeof t>[0]);\n };\n\n const locale = useLocale();\n\n const {\n admin: { custom },\n localization,\n routes: { api },\n serverURL,\n } = useConfig();\n\n const apiClient = createClient({ api, serverURL });\n\n const resolverConfig = useMemo(() => {\n if (!resolver) return null;\n\n const resolvers = (custom?.translator?.resolvers as TranslateResolver[]) || undefined;\n\n if (!resolvers) return null;\n\n const resolverConfig = resolvers.find((each) => each.key === resolver);\n\n return resolverConfig ?? null;\n }, [custom, resolver]);\n\n if (!localization)\n throw new Error('Localization config is not provided and PluginTranslator is used');\n\n const localesOptions = localization.locales.filter((each) => each.code !== locale.code);\n\n const [localeToTranslateFrom, setLocaleToTranslateFrom] = useState(() => {\n const defaultFromOptions = localesOptions.find(\n (each) => localization.defaultLocale === each.code,\n );\n\n if (defaultFromOptions) return defaultFromOptions.code;\n\n return localesOptions[0].code;\n });\n\n const closeTranslator = () => modal.closeModal(modalSlug);\n\n const submit = async ({ emptyOnly }: { emptyOnly: boolean }) => {\n if (!resolver) return;\n\n const args: TranslateArgs = {\n collectionSlug,\n data: reduceFieldsToValues(data, true),\n emptyOnly,\n globalSlug,\n id: id === null ? undefined : id,\n locale: locale.code,\n localeFrom: localeToTranslateFrom,\n resolver,\n };\n\n const result = await apiClient.translate(args);\n\n if (!result.success) {\n toast.error(resolverT('errorMessage'));\n\n return;\n }\n\n dispatch({\n state: await getFormState({\n apiRoute: api,\n body: {\n collectionSlug,\n data: result.translatedData,\n globalSlug,\n locale: locale.code,\n schemaPath: collectionSlug || globalSlug || '',\n },\n serverURL,\n }),\n type: 'REPLACE_STATE',\n });\n\n if (resolverConfig) toast.success(resolverT('successMessage'));\n closeTranslator();\n };\n\n return (\n <TranslatorContext.Provider\n value={{\n closeTranslator,\n localeToTranslateFrom,\n localesOptions,\n modalSlug,\n openTranslator: ({ resolverKey }) => {\n setResolver(resolverKey);\n modal.openModal(modalSlug);\n },\n resolver: resolverConfig,\n resolverT,\n setLocaleToTranslateFrom,\n submit,\n }}\n >\n {children}\n </TranslatorContext.Provider>\n );\n};\n"],"names":["toast","useModal","useAllFormFields","useConfig","useDocumentInfo","useLocale","useTranslation","getFormState","reduceFieldsToValues","useMemo","useState","createClient","TranslatorContext","modalSlug","TranslatorProvider","children","resolver","setResolver","data","dispatch","collectionSlug","globalSlug","id","modal","t","resolverT","key","locale","admin","custom","localization","routes","api","serverURL","apiClient","resolverConfig","resolvers","translator","undefined","find","each","Error","localesOptions","locales","filter","code","localeToTranslateFrom","setLocaleToTranslateFrom","defaultFromOptions","defaultLocale","closeTranslator","closeModal","submit","emptyOnly","args","localeFrom","result","translate","success","error","state","apiRoute","body","translatedData","schemaPath","type","Provider","value","openTranslator","resolverKey","openModal"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";AAAA,SAASA,KAAK,QAAQ,0BAA0B;AAChD,SAASC,QAAQ,QAAQ,gCAAgC;AACzD,SAASC,gBAAgB,QAAQ,4BAA4B;AAC7D,SAASC,SAAS,QAAQ,kCAAkC;AAC5D,SAASC,eAAe,QAAQ,wCAAwC;AACxE,SAASC,SAAS,QAAQ,kCAAkC;AAC5D,SAASC,cAAc,QAAQ,uCAAuC;AACtE,SAASC,YAAY,QAAQ,wCAAwC;AACrE,SAASC,oBAAoB,QAAQ,gDAAgD;AACrF,SAAyBC,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AAI,CAC5C,CAACC,OAASV,aAAamB,aAAa,KAAKT,KAAKK,IAAI;QAGpD,IAAIG,oBAAoB,OAAOA,mBAAmBH,IAAI;QAEtD,OAAOH,cAAc,CAAC,EAAE,CAACG,IAAI;IAC/B;IAEA,MAAMK,kBAAkB,IAAM3B,MAAM4B,UAAU,CAACtC;IAE/C,MAAMuC,SAAS,OAAO,EAAEC,SAAS,EAA0B;QACzD,IAAI,CAACrC,UAAU;QAEf,MAAMsC,OAAsB;YAC1BlC;YACAF,MAAMV,qBAAqBU,MAAM;YACjCmC;YACAhC;YACAC,IAAIA,OAAO,OAAOgB,YAAYhB;YAC9BK,QAAQA,OAAOkB,IAAI;YACnBU,YAAYT;YACZ9B;QACF;QAEA,MAAMwC,SAAS,MAAMtB,UAAUuB,SAAS,CAACH;QAEzC,IAAI,CAACE,OAAOE,OAAO,EAAE;YACnB1D,MAAM2D,KAAK,CAAClC,UAAU;YAEtB;QACF;QAEAN,SAAS;YACPyC,OAAO,MAAMrD,aAAa;gBACxBsD,UAAU7B;gBACV8B,MAAM;oBACJ1C;oBACAF,MAAMsC,OAAOO,cAAc;oBAC3B1C;oBACAM,QAAQA,OAAOkB,IAAI;oBACnBmB,YAAY5C,kBAAkBC,cAAc;gBAC9C;gBACAY;YACF;YACAgC,MAAM;QACR;QAEA,IAAI9B,gBAAgBnC,MAAM0D,OAAO,CAACjC,UAAU;QAC5CyB;IACF;IAEA,qBACE,KAACtC,kBAAkBsD,QAAQ;QACzBC,OAAO;YACLjB;YACAJ;YACAJ;YACA7B;YACAuD,gBAAgB,CAAC,EAAEC,WAAW,EAAE;gBAC9BpD,YAAYoD;gBACZ9C,MAAM+C,SAAS,CAACzD;YAClB;YACAG,UAAUmB;YACVV;YACAsB;YACAK;QACF;kBAECrC;;AAGP,EAAE"}
@@ -1,4 +1,4 @@
1
- /// <reference types="react" resolution-mode="require"/>
1
+ /// <reference types="react" />
2
2
  import type { Locale } from 'payload/config';
3
3
  import type { TranslateResolver } from '../../../resolvers/types';
4
4
  type TranslatorContextData = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@payload-enchants/translator",
3
- "version": "1.1.16",
3
+ "version": "1.1.17",
4
4
  "private": false,
5
5
  "bugs": "https://github.com/r1tsuu/payload-enchants/issues",
6
6
  "repository": "https://github.com/r1tsuu/payload-enchants",
@@ -46,17 +46,17 @@
46
46
  "bson-objectid": "^2.0.4"
47
47
  },
48
48
  "devDependencies": {
49
- "@payloadcms/translations": "3.0.0-beta.29",
50
- "@payloadcms/ui": "3.0.0-beta.29",
49
+ "@payloadcms/translations": "3.0.0-beta.32",
50
+ "@payloadcms/ui": "3.0.0-beta.32",
51
51
  "@types/react": "18.2.64",
52
- "payload": "3.0.0-beta.29",
52
+ "payload": "3.0.0-beta.32",
53
53
  "react": "18.2.0",
54
54
  "typescript": "^5.4.2"
55
55
  },
56
56
  "peerDependencies": {
57
- "@payloadcms/translations": "^3.0.0-beta.29",
58
- "@payloadcms/ui": "^3.0.0-beta.29",
59
- "payload": "^3.0.0-beta.29"
57
+ "@payloadcms/translations": "^3.0.0-beta.32",
58
+ "@payloadcms/ui": "^3.0.0-beta.32",
59
+ "payload": "^3.0.0-beta.32"
60
60
  },
61
61
  "publishConfig": {
62
62
  "registry": "https://registry.npmjs.org/"