@intlayer/design-system 5.0.1 → 5.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.vite/manifest.json +10 -10
- package/dist/components/Auth/ChangePasswordForm/ChangePasswordForm.cjs +10 -10
- package/dist/components/Auth/ChangePasswordForm/ChangePasswordForm.cjs.map +1 -1
- package/dist/components/Auth/ChangePasswordForm/ChangePasswordForm.d.ts.map +1 -1
- package/dist/components/Auth/ChangePasswordForm/ChangePasswordForm.mjs +10 -10
- package/dist/components/Auth/ChangePasswordForm/ChangePasswordForm.mjs.map +1 -1
- package/dist/components/Auth/ChangePasswordForm/useChangePasswordSchema.cjs.map +1 -1
- package/dist/components/Auth/ChangePasswordForm/useChangePasswordSchema.d.ts.map +1 -1
- package/dist/components/Auth/ChangePasswordForm/useChangePasswordSchema.mjs.map +1 -1
- package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.cjs +3 -3
- package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.cjs.map +1 -1
- package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.d.ts.map +1 -1
- package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.mjs +3 -3
- package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.mjs.map +1 -1
- package/dist/components/Auth/ResetPasswordForm/ResetPasswordForm.cjs +6 -6
- package/dist/components/Auth/ResetPasswordForm/ResetPasswordForm.cjs.map +1 -1
- package/dist/components/Auth/ResetPasswordForm/ResetPasswordForm.d.ts.map +1 -1
- package/dist/components/Auth/ResetPasswordForm/ResetPasswordForm.mjs +6 -6
- package/dist/components/Auth/ResetPasswordForm/ResetPasswordForm.mjs.map +1 -1
- package/dist/components/Auth/ResetPasswordForm/useResetPasswordSchema.cjs.map +1 -1
- package/dist/components/Auth/ResetPasswordForm/useResetPasswordSchema.d.ts.map +1 -1
- package/dist/components/Auth/ResetPasswordForm/useResetPasswordSchema.mjs.map +1 -1
- package/dist/components/Auth/SignInForm/SignInForm.cjs +7 -7
- package/dist/components/Auth/SignInForm/SignInForm.cjs.map +1 -1
- package/dist/components/Auth/SignInForm/SignInForm.d.ts.map +1 -1
- package/dist/components/Auth/SignInForm/SignInForm.mjs +7 -7
- package/dist/components/Auth/SignInForm/SignInForm.mjs.map +1 -1
- package/dist/components/Auth/SignInForm/useSignInSchema.cjs.map +1 -1
- package/dist/components/Auth/SignInForm/useSignInSchema.d.ts.map +1 -1
- package/dist/components/Auth/SignInForm/useSignInSchema.mjs.map +1 -1
- package/dist/components/Auth/SignUpForm/SignUpForm.cjs +8 -8
- package/dist/components/Auth/SignUpForm/SignUpForm.cjs.map +1 -1
- package/dist/components/Auth/SignUpForm/SignUpForm.d.ts.map +1 -1
- package/dist/components/Auth/SignUpForm/SignUpForm.mjs +8 -8
- package/dist/components/Auth/SignUpForm/SignUpForm.mjs.map +1 -1
- package/dist/components/Auth/SignUpForm/useSignUpSchema.cjs.map +1 -1
- package/dist/components/Auth/SignUpForm/useSignUpSchema.d.ts.map +1 -1
- package/dist/components/Auth/SignUpForm/useSignUpSchema.mjs.map +1 -1
- package/dist/components/Auth/VerifyEmailForm/VerifyEmailForm.cjs +1 -1
- package/dist/components/Auth/VerifyEmailForm/VerifyEmailForm.cjs.map +1 -1
- package/dist/components/Auth/VerifyEmailForm/VerifyEmailForm.d.ts.map +1 -1
- package/dist/components/Auth/VerifyEmailForm/VerifyEmailForm.mjs +1 -1
- package/dist/components/Auth/VerifyEmailForm/VerifyEmailForm.mjs.map +1 -1
- package/dist/components/Breadcrumb/index.cjs.map +1 -1
- package/dist/components/Breadcrumb/index.d.ts.map +1 -1
- package/dist/components/Breadcrumb/index.mjs.map +1 -1
- package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.cjs +4 -4
- package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.cjs.map +1 -1
- package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.d.ts.map +1 -1
- package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.mjs +4 -4
- package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.cjs +6 -6
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.mjs +6 -6
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.cjs +22 -17
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.mjs +22 -17
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/EditorView/EditorView.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/EditorView/EditorView.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/EditorView/EditorView.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/EditorView/TextEditor.cjs +2 -2
- package/dist/components/DictionaryFieldEditor/EditorView/TextEditor.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/EditorView/TextEditor.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/EditorView/TextEditor.mjs +2 -2
- package/dist/components/DictionaryFieldEditor/EditorView/TextEditor.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.cjs +2 -2
- package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.mjs +2 -2
- package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/NodeTypeSelector.cjs +10 -4
- package/dist/components/DictionaryFieldEditor/NodeTypeSelector.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/NodeTypeSelector.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/NodeTypeSelector.mjs +10 -4
- package/dist/components/DictionaryFieldEditor/NodeTypeSelector.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.cjs +6 -6
- package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.mjs +6 -6
- package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.cjs +2 -2
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.mjs +2 -2
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/nodeTypeSelector.content.cjs +59 -14
- package/dist/components/DictionaryFieldEditor/nodeTypeSelector.content.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/nodeTypeSelector.content.d.ts +4 -1
- package/dist/components/DictionaryFieldEditor/nodeTypeSelector.content.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/nodeTypeSelector.content.mjs +59 -14
- package/dist/components/DictionaryFieldEditor/nodeTypeSelector.content.mjs.map +1 -1
- package/dist/components/IDE/CopyButton.cjs +1 -1
- package/dist/components/IDE/CopyButton.cjs.map +1 -1
- package/dist/components/IDE/CopyButton.d.ts.map +1 -1
- package/dist/components/IDE/CopyButton.mjs +1 -1
- package/dist/components/IDE/CopyButton.mjs.map +1 -1
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.cjs +5 -5
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.cjs.map +1 -1
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.d.ts.map +1 -1
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.mjs +5 -5
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.mjs.map +1 -1
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.cjs.map +1 -1
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.d.ts +6 -6
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.d.ts.map +1 -1
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.mjs.map +1 -1
- package/dist/components/LocaleSwitcherDropDown/LocaleSwitcher.cjs +3 -3
- package/dist/components/LocaleSwitcherDropDown/LocaleSwitcher.cjs.map +1 -1
- package/dist/components/LocaleSwitcherDropDown/LocaleSwitcher.d.ts.map +1 -1
- package/dist/components/LocaleSwitcherDropDown/LocaleSwitcher.mjs +3 -3
- package/dist/components/LocaleSwitcherDropDown/LocaleSwitcher.mjs.map +1 -1
- package/dist/{index-Di_3dNqI.js → index-BVYRWLUL.js} +3 -2
- package/dist/index-BVYRWLUL.js.map +1 -0
- package/dist/{index-ZARcTrR0.cjs → index-DTQyeqio.cjs} +3 -2
- package/dist/index-DTQyeqio.cjs.map +1 -0
- package/package.json +19 -19
- package/dist/index-Di_3dNqI.js.map +0 -1
- package/dist/index-ZARcTrR0.cjs.map +0 -1
|
@@ -69,7 +69,7 @@ const ValidDictionaryChangeButtons = ({ dictionary, mode }) => {
|
|
|
69
69
|
Form.Button,
|
|
70
70
|
{
|
|
71
71
|
type: "button",
|
|
72
|
-
label: resetButton.label,
|
|
72
|
+
label: resetButton.label.value,
|
|
73
73
|
disabled: !isEdited || isSubmitting,
|
|
74
74
|
className: "ml-auto",
|
|
75
75
|
Icon: RotateCcw,
|
|
@@ -85,7 +85,7 @@ const ValidDictionaryChangeButtons = ({ dictionary, mode }) => {
|
|
|
85
85
|
Form.Button,
|
|
86
86
|
{
|
|
87
87
|
type: "submit",
|
|
88
|
-
label: publishButton.label,
|
|
88
|
+
label: publishButton.label.value,
|
|
89
89
|
disabled: !isEdited || isSubmitting,
|
|
90
90
|
Icon: ArrowUpFromLine,
|
|
91
91
|
color: "text",
|
|
@@ -97,7 +97,7 @@ const ValidDictionaryChangeButtons = ({ dictionary, mode }) => {
|
|
|
97
97
|
Form.Button,
|
|
98
98
|
{
|
|
99
99
|
type: "submit",
|
|
100
|
-
label: saveButton.label,
|
|
100
|
+
label: saveButton.label.value,
|
|
101
101
|
disabled: !isEdited || isSubmitting,
|
|
102
102
|
Icon: Save,
|
|
103
103
|
color: "text",
|
|
@@ -109,7 +109,7 @@ const ValidDictionaryChangeButtons = ({ dictionary, mode }) => {
|
|
|
109
109
|
Form.Button,
|
|
110
110
|
{
|
|
111
111
|
type: "submit",
|
|
112
|
-
label: downloadButton.label,
|
|
112
|
+
label: downloadButton.label.value,
|
|
113
113
|
disabled: !isEdited || isSubmitting,
|
|
114
114
|
Icon: Download,
|
|
115
115
|
color: "text",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ValidDictionaryChangeButtons.mjs","sources":["../../../src/components/DictionaryEditor/ValidDictionaryChangeButtons.tsx"],"sourcesContent":["'use client';\n\nimport { Dictionary as DistantDictionary } from '@intlayer/backend';\nimport type { Dictionary } from '@intlayer/core';\nimport {\n useDictionariesRecordActions,\n useEditedContent,\n} from '@intlayer/editor-react';\nimport { ArrowUpFromLine, Download, RotateCcw, Save } from 'lucide-react';\nimport { useCallback, useMemo, type FC } from 'react';\
|
|
1
|
+
{"version":3,"file":"ValidDictionaryChangeButtons.mjs","sources":["../../../src/components/DictionaryEditor/ValidDictionaryChangeButtons.tsx"],"sourcesContent":["'use client';\n\nimport { Dictionary as DistantDictionary } from '@intlayer/backend';\nimport type { Dictionary } from '@intlayer/core';\nimport {\n useDictionariesRecordActions,\n useEditedContent,\n} from '@intlayer/editor-react';\nimport { ArrowUpFromLine, Download, RotateCcw, Save } from 'lucide-react';\nimport { useCallback, useMemo, type FC } from 'react';\nimport { useDictionary } from 'react-intlayer';\nimport { usePushDictionaries, useWriteDictionary } from '../../hooks';\nimport { Form, useForm } from '../Form';\nimport { validDictionaryChangeButtonsContent } from './validDictionaryChangeButtons.content';\nimport { getValidDictionaryChangeButtonsSchemaSchema } from './validDictionaryChangeButtonsSchema';\n\ntype ValidDictionaryChangeButtonsProps = {\n dictionary: Dictionary;\n mode: 'local' | 'remote';\n};\n\nexport const ValidDictionaryChangeButtons: FC<\n ValidDictionaryChangeButtonsProps\n> = ({ dictionary, mode }) => {\n const ValidDictionaryChangeButtonsSchemaSchema =\n getValidDictionaryChangeButtonsSchemaSchema();\n\n const { resetButton, saveButton, publishButton, downloadButton } =\n useDictionary(validDictionaryChangeButtonsContent);\n\n const { setLocaleDictionary } = useDictionariesRecordActions();\n const { writeDictionary } = useWriteDictionary();\n const { pushDictionaries } = usePushDictionaries();\n\n const { editedContent, restoreEditedContent } = useEditedContent();\n const { form, isSubmitting } = useForm(\n ValidDictionaryChangeButtonsSchemaSchema\n );\n\n const editedDictionary = useMemo(\n () => editedContent?.[dictionary.key],\n [editedContent, dictionary.key]\n );\n\n const isEdited = useMemo(\n () =>\n editedDictionary &&\n JSON.stringify(editedDictionary?.content) !==\n JSON.stringify(dictionary?.content),\n [editedDictionary, dictionary]\n );\n\n const isLocalDictionary = useMemo(\n () => typeof (dictionary as DistantDictionary)?._id === 'undefined',\n [dictionary]\n );\n\n const onSubmitSuccess = useCallback(async () => {\n if (!editedContent?.[dictionary.key]) return;\n\n const updatedDictionary = {\n ...dictionary,\n ...editedContent?.[dictionary.key],\n };\n\n if (mode === 'remote') {\n await pushDictionaries([updatedDictionary]);\n } else {\n await writeDictionary(updatedDictionary);\n }\n setLocaleDictionary(editedContent?.[dictionary.key]);\n restoreEditedContent(dictionary.key);\n }, [\n dictionary,\n editedContent,\n pushDictionaries,\n setLocaleDictionary,\n writeDictionary,\n restoreEditedContent,\n mode,\n ]);\n\n return (\n <div className=\"mb-4\">\n <Form\n className=\"flex w-full flex-row flex-wrap justify-end gap-3\"\n {...form}\n schema={ValidDictionaryChangeButtonsSchemaSchema}\n onSubmitSuccess={onSubmitSuccess}\n >\n {isEdited && (\n <Form.Button\n type=\"button\"\n label={resetButton.label.value}\n disabled={!isEdited || isSubmitting}\n className=\"ml-auto\"\n Icon={RotateCcw}\n variant=\"outline\"\n color=\"text\"\n isFullWidth\n isLoading={isSubmitting}\n onClick={() => restoreEditedContent(dictionary.key)}\n >\n {resetButton.text}\n </Form.Button>\n )}\n {mode === 'remote' ? (\n isLocalDictionary ? (\n <Form.Button\n type=\"submit\"\n label={publishButton.label.value}\n disabled={!isEdited || isSubmitting}\n Icon={ArrowUpFromLine}\n color=\"text\"\n isFullWidth\n isLoading={isSubmitting}\n >\n {publishButton.text}\n </Form.Button>\n ) : (\n isEdited && (\n <Form.Button\n type=\"submit\"\n label={saveButton.label.value}\n disabled={!isEdited || isSubmitting}\n Icon={Save}\n color=\"text\"\n isFullWidth\n isLoading={isSubmitting}\n >\n {saveButton.text}\n </Form.Button>\n )\n )\n ) : (\n <Form.Button\n type=\"submit\"\n label={downloadButton.label.value}\n disabled={!isEdited || isSubmitting}\n Icon={Download}\n color=\"text\"\n isFullWidth\n isLoading={isSubmitting}\n >\n {downloadButton.text}\n </Form.Button>\n )}\n </Form>\n </div>\n );\n};\n"],"names":["jsx","jsxs"],"mappings":";;;;;;;;;;;;;;;AAqBO,MAAM,+BAET,CAAC,EAAE,YAAY,WAAW;AAC5B,QAAM,2CACJ,4CAA4C;AAE9C,QAAM,EAAE,aAAa,YAAY,eAAe,eAAe,IAC7D,cAAc,mCAAmC;AAE7C,QAAA,EAAE,oBAAoB,IAAI,6BAA6B;AACvD,QAAA,EAAE,gBAAgB,IAAI,mBAAmB;AACzC,QAAA,EAAE,iBAAiB,IAAI,oBAAoB;AAEjD,QAAM,EAAE,e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AAM;AAAA,YACN,SAAQ;AAAA,YACR,OAAM;AAAA,YACN,aAAW;AAAA,YACX,WAAW;AAAA,YACX,SAAS,MAAM,qBAAqB,WAAW,GAAG;AAAA,YAEjD,UAAY,YAAA;AAAA,UAAA;AAAA,QACf;AAAA,QAED,SAAS,WACR,oBACEA,kCAAA;AAAA,UAAC,KAAK;AAAA,UAAL;AAAA,YACC,MAAK;AAAA,YACL,OAAO,cAAc,MAAM;AAAA,YAC3B,UAAU,CAAC,YAAY;AAAA,YACvB,MAAM;AAAA,YACN,OAAM;AAAA,YACN,aAAW;AAAA,YACX,WAAW;AAAA,YAEV,UAAc,cAAA;AAAA,UAAA;AAAA,YAGjB,YACEA,kCAAA;AAAA,UAAC,KAAK;AAAA,UAAL;AAAA,YACC,MAAK;AAAA,YACL,OAAO,WAAW,MAAM;AAAA,YACxB,UAAU,CAAC,YAAY;AAAA,YACvB,MAAM;AAAA,YACN,OAAM;AAAA,YACN,aAAW;AAAA,YACX,WAAW;AAAA,YAEV,UAAW,WAAA;AAAA,UAAA;AAAA,QAAA,IAKlBA,kCAAA;AAAA,UAAC,KAAK;AAAA,UAAL;AAAA,YACC,MAAK;AAAA,YACL,OAAO,eAAe,MAAM;AAAA,YAC5B,UAAU,CAAC,YAAY;AAAA,YACvB,MAAM;AAAA,YACN,OAAM;AAAA,YACN,aAAW;AAAA,YACX,WAAW;AAAA,YAEV,UAAe,eAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MAClB;AAAA,IAAA;AAAA,EAAA,GAGN;AAEJ;"}
|
package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DictionariesSelector.cjs","sources":["../../../../src/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.tsx"],"sourcesContent":["'use client';\n\nimport { Locales } from '@intlayer/config';\nimport { useFocusDictionary } from '@intlayer/editor-react';\nimport { useMemo, type FC } from 'react';\
|
|
1
|
+
{"version":3,"file":"DictionariesSelector.cjs","sources":["../../../../src/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.tsx"],"sourcesContent":["'use client';\n\nimport { Locales } from '@intlayer/config';\nimport { useFocusDictionary } from '@intlayer/editor-react';\nimport { useMemo, type FC } from 'react';\nimport { useDictionary } from 'react-intlayer';\nimport { useGetAllDictionaries } from '../../../hooks';\nimport { Loader } from '../../Loader';\nimport { DictionaryFieldEditor } from '../DictionaryFieldEditor';\nimport { dictionariesSelectorContent } from './dictionariesSelector.content';\n\ntype DictionariesSelectorProps = {\n onClickDictionaryList: () => void;\n isDarkMode?: boolean;\n availableLocales: Locales[];\n mode: 'local' | 'remote';\n};\n\nexport const DictionariesSelector: FC<DictionariesSelectorProps> = ({\n onClickDictionaryList,\n isDarkMode,\n availableLocales,\n mode,\n}) => {\n const { online, locale, isLoading } = useGetAllDictionaries();\n const { focusedContent } = useFocusDictionary();\n const { noDictionaryMessage, dictionaryNotFoundMessage } = useDictionary(\n dictionariesSelectorContent\n );\n const dictionary = useMemo(\n () =>\n focusedContent?.dictionaryKey\n ? (online?.[focusedContent?.dictionaryKey] ??\n locale?.[focusedContent?.dictionaryKey])\n : null,\n [online, locale, focusedContent?.dictionaryKey]\n );\n\n if (isLoading) return <Loader />;\n\n if (!focusedContent?.dictionaryKey) return noDictionaryMessage;\n\n if (!dictionary) return dictionaryNotFoundMessage;\n\n return (\n <DictionaryFieldEditor\n dictionary={dictionary}\n onClickDictionaryList={onClickDictionaryList}\n isDarkMode={isDarkMode}\n availableLocales={availableLocales}\n mode={mode}\n />\n );\n};\n"],"names":["useGetAllDictionaries","useFocusDictionary","useDictionary","dictionariesSelectorContent","useMemo","jsx","Loader","DictionaryFieldEditor"],"mappings":";;;;;;;;;;;;;;;;AAkBO,MAAM,uBAAsD,CAAC;AAAA,EAClE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,QAAM,EAAE,QAAQ,QAAQ,UAAA,IAAcA,4BAAAA,sBAAsB;AACtD,QAAA,EAAE,eAAe,IAAIC,+BAAmB;AACxC,QAAA,EAAE,qBAAqB,0BAAA,IAA8BC,cAAA;AAAA,IACzDC,mFAAAA;AAAAA,EACF;AACA,QAAM,aAAaC,WAAA;AAAA,IACjB,MACE,gBAAgB,gBACX,SAAS,gBAAgB,aAAa,KACvC,SAAS,gBAAgB,aAAa,IACtC;AAAA,IACN,CAAC,QAAQ,QAAQ,gBAAgB,aAAa;AAAA,EAChD;AAEI,MAAA,UAAkB,QAAAC,iDAACC,wBAAAA,QAAO,CAAA,CAAA;AAE1B,MAAA,CAAC,gBAAgB,cAAsB,QAAA;AAEvC,MAAA,CAAC,WAAmB,QAAA;AAGtB,SAAAD,2BAAA,kBAAA;AAAA,IAACE,uDAAA;AAAA,IAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IAAA;AAAA,EACF;AAEJ;;"}
|
package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DictionariesSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAE3C,OAAO,EAAW,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"DictionariesSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAE3C,OAAO,EAAW,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAOzC,KAAK,yBAAyB,GAAG;IAC/B,qBAAqB,EAAE,MAAM,IAAI,CAAC;IAClC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,gBAAgB,EAAE,OAAO,EAAE,CAAC;IAC5B,IAAI,EAAE,OAAO,GAAG,QAAQ,CAAC;CAC1B,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,EAAE,CAAC,yBAAyB,CAmC9D,CAAC"}
|
package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DictionariesSelector.mjs","sources":["../../../../src/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.tsx"],"sourcesContent":["'use client';\n\nimport { Locales } from '@intlayer/config';\nimport { useFocusDictionary } from '@intlayer/editor-react';\nimport { useMemo, type FC } from 'react';\
|
|
1
|
+
{"version":3,"file":"DictionariesSelector.mjs","sources":["../../../../src/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.tsx"],"sourcesContent":["'use client';\n\nimport { Locales } from '@intlayer/config';\nimport { useFocusDictionary } from '@intlayer/editor-react';\nimport { useMemo, type FC } from 'react';\nimport { useDictionary } from 'react-intlayer';\nimport { useGetAllDictionaries } from '../../../hooks';\nimport { Loader } from '../../Loader';\nimport { DictionaryFieldEditor } from '../DictionaryFieldEditor';\nimport { dictionariesSelectorContent } from './dictionariesSelector.content';\n\ntype DictionariesSelectorProps = {\n onClickDictionaryList: () => void;\n isDarkMode?: boolean;\n availableLocales: Locales[];\n mode: 'local' | 'remote';\n};\n\nexport const DictionariesSelector: FC<DictionariesSelectorProps> = ({\n onClickDictionaryList,\n isDarkMode,\n availableLocales,\n mode,\n}) => {\n const { online, locale, isLoading } = useGetAllDictionaries();\n const { focusedContent } = useFocusDictionary();\n const { noDictionaryMessage, dictionaryNotFoundMessage } = useDictionary(\n dictionariesSelectorContent\n );\n const dictionary = useMemo(\n () =>\n focusedContent?.dictionaryKey\n ? (online?.[focusedContent?.dictionaryKey] ??\n locale?.[focusedContent?.dictionaryKey])\n : null,\n [online, locale, focusedContent?.dictionaryKey]\n );\n\n if (isLoading) return <Loader />;\n\n if (!focusedContent?.dictionaryKey) return noDictionaryMessage;\n\n if (!dictionary) return dictionaryNotFoundMessage;\n\n return (\n <DictionaryFieldEditor\n dictionary={dictionary}\n onClickDictionaryList={onClickDictionaryList}\n isDarkMode={isDarkMode}\n availableLocales={availableLocales}\n mode={mode}\n />\n );\n};\n"],"names":["jsx"],"mappings":";;;;;;;;;;;;;;AAkBO,MAAM,uBAAsD,CAAC;AAAA,EAClE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,QAAM,EAAE,QAAQ,QAAQ,UAAA,IAAc,sBAAsB;AACtD,QAAA,EAAE,eAAe,IAAI,mBAAmB;AACxC,QAAA,EAAE,qBAAqB,0BAAA,IAA8B;AAAA,IACzD;AAAA,EACF;AACA,QAAM,aAAa;AAAA,IACjB,MACE,gBAAgB,gBACX,SAAS,gBAAgB,aAAa,KACvC,SAAS,gBAAgB,aAAa,IACtC;AAAA,IACN,CAAC,QAAQ,QAAQ,gBAAgB,aAAa;AAAA,EAChD;AAEI,MAAA,UAAkB,QAAAA,sCAAC,QAAO,CAAA,CAAA;AAE1B,MAAA,CAAC,gBAAgB,cAAsB,QAAA;AAEvC,MAAA,CAAC,WAAmB,QAAA;AAGtB,SAAAA,kCAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IAAA;AAAA,EACF;AAEJ;"}
|
package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.cjs
CHANGED
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
4
4
|
const jsxRuntime = require("../../../jsx-runtime-CgFM7lM3.cjs");
|
|
5
5
|
const reactIntlayer = require("react-intlayer");
|
|
6
6
|
const hooks_intlayerAPIHooks = require("../../../hooks/intlayerAPIHooks.cjs");
|
|
7
|
-
require("../../../index-
|
|
7
|
+
require("../../../index-DTQyeqio.cjs");
|
|
8
8
|
require("@intlayer/config/client");
|
|
9
9
|
require("@intlayer/api");
|
|
10
10
|
require("../../Button/Button.cjs");
|
|
@@ -61,17 +61,17 @@ const DictionaryCreationForm = () => {
|
|
|
61
61
|
components_Form_layout_FormItemLayout.Form.Input,
|
|
62
62
|
{
|
|
63
63
|
name: "key",
|
|
64
|
-
label: keyInput.label,
|
|
65
|
-
placeholder: keyInput.placeholder,
|
|
64
|
+
label: keyInput.label.value,
|
|
65
|
+
placeholder: keyInput.placeholder.value,
|
|
66
66
|
isRequired: true
|
|
67
67
|
}
|
|
68
68
|
),
|
|
69
|
-
/* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsxs(components_Form_layout_FormItemLayout.Form.MultiSelect, { name: "projectIds", label: projectInput.label, children: [
|
|
69
|
+
/* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsxs(components_Form_layout_FormItemLayout.Form.MultiSelect, { name: "projectIds", label: projectInput.label.value, children: [
|
|
70
70
|
/* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
|
|
71
71
|
components_Select_Multiselect.MultiSelect.Trigger,
|
|
72
72
|
{
|
|
73
73
|
getBadgeValue: (value) => projects?.data?.find((project2) => String(project2._id) === value)?.name ?? value,
|
|
74
|
-
children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(components_Select_Multiselect.MultiSelect.Input, { placeholder: projectInput.placeholder })
|
|
74
|
+
children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(components_Select_Multiselect.MultiSelect.Input, { placeholder: projectInput.placeholder.value })
|
|
75
75
|
}
|
|
76
76
|
),
|
|
77
77
|
/* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(components_Select_Multiselect.MultiSelect.Content, { children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(components_Select_Multiselect.MultiSelect.List, { children: projects?.data?.map((project2) => /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
|
|
@@ -90,7 +90,7 @@ const DictionaryCreationForm = () => {
|
|
|
90
90
|
type: "submit",
|
|
91
91
|
color: "text",
|
|
92
92
|
isLoading: isSubmitting,
|
|
93
|
-
label: createDictionaryButton.ariaLabel,
|
|
93
|
+
label: createDictionaryButton.ariaLabel.value,
|
|
94
94
|
children: createDictionaryButton.text
|
|
95
95
|
}
|
|
96
96
|
)
|
package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DictionaryCreationForm.cjs","sources":["../../../../src/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.tsx"],"sourcesContent":["'use client';\n\nimport { type FC } from 'react';\
|
|
1
|
+
{"version":3,"file":"DictionaryCreationForm.cjs","sources":["../../../../src/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.tsx"],"sourcesContent":["'use client';\n\nimport { type FC } from 'react';\nimport { useDictionary } from 'react-intlayer';\nimport {\n useAddDictionary,\n useGetProjects,\n} from '../../../hooks/intlayerAPIHooks';\nimport { useAuth } from '../../Auth';\nimport { Form, useForm } from '../../Form';\nimport { MultiSelect } from '../../Select';\nimport { dictionaryFormContent } from './dictionaryCreationForm.content';\nimport {\n useDictionarySchema,\n type DictionaryFormData,\n} from './useDictionaryFormSchema';\n\nexport const DictionaryCreationForm: FC = () => {\n const { session } = useAuth();\n const { project } = session ?? {};\n const { addDictionary } = useAddDictionary();\n const { data: projects } = useGetProjects();\n const DictionarySchema = useDictionarySchema(String(project?._id));\n const { form, isSubmitting } = useForm(DictionarySchema);\n const { keyInput, createDictionaryButton, projectInput } = useDictionary(\n dictionaryFormContent\n );\n\n const onSubmitSuccess = async (data: DictionaryFormData) => {\n await addDictionary(data);\n };\n\n return (\n <Form\n schema={DictionarySchema}\n onSubmitSuccess={onSubmitSuccess}\n className=\"w-full max-w-[400px]\"\n {...form}\n >\n <Form.Input\n name=\"key\"\n label={keyInput.label.value}\n placeholder={keyInput.placeholder.value}\n isRequired\n />\n\n <Form.MultiSelect name=\"projectIds\" label={projectInput.label.value}>\n <MultiSelect.Trigger\n getBadgeValue={(value) =>\n projects?.data?.find((project) => String(project._id) === value)\n ?.name ?? value\n }\n >\n <MultiSelect.Input placeholder={projectInput.placeholder.value} />\n </MultiSelect.Trigger>\n <MultiSelect.Content>\n <MultiSelect.List>\n {projects?.data?.map((project) => (\n <MultiSelect.Item\n key={String(project._id)}\n value={String(project._id)}\n >\n {project.name}\n </MultiSelect.Item>\n ))}\n </MultiSelect.List>\n </MultiSelect.Content>\n </Form.MultiSelect>\n\n <Form.Button\n className=\"ml-auto mt-12\"\n type=\"submit\"\n color=\"text\"\n isLoading={isSubmitting}\n label={createDictionaryButton.ariaLabel.value}\n >\n {createDictionaryButton.text}\n </Form.Button>\n </Form>\n );\n};\n"],"names":["useAuth","useAddDictionary","useGetProjects","useDictionarySchema","useForm","useDictionary","dictionaryFormContent","jsxs","Form","jsx","MultiSelect","project"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBO,MAAM,yBAA6B,MAAM;AACxC,QAAA,EAAE,QAAQ,IAAIA,sCAAQ;AAC5B,QAAM,EAAE,YAAY,WAAW,CAAC;AAC1B,QAAA,EAAE,cAAc,IAAIC,wCAAiB;AAC3C,QAAM,EAAE,MAAM,SAAS,IAAIC,sCAAe;AAC1C,QAAM,mBAAmBC,gFAAA,oBAAoB,OAAO,SAAS,GAAG,CAAC;AACjE,QAAM,EAAE,MAAM,iBAAiBC,yBAAAA,QAAQ,gBAAgB;AACvD,QAAM,EAAE,UAAU,wBAAwB,aAAiB,IAAAC,cAAA;AAAA,IACzDC,uFAAAA;AAAAA,EACF;AAEM,QAAA,kBAAkB,OAAO,SAA6B;AAC1D,UAAM,cAAc,IAAI;AAAA,EAC1B;AAGE,SAAAC,2BAAA,kBAAA;AAAA,IAACC,sCAAA;AAAA,IAAA;AAAA,MACC,QAAQ;AAAA,MACR;AAAA,MAC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AEJ;;"}
|
package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DictionaryCreationForm.d.ts","sourceRoot":"","sources":["../../../../src/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"DictionaryCreationForm.d.ts","sourceRoot":"","sources":["../../../../src/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAehC,eAAO,MAAM,sBAAsB,EAAE,EA+DpC,CAAC"}
|
package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.mjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { j as jsxRuntimeExports } from "../../../jsx-runtime-DQkoUcjV.js";
|
|
3
3
|
import { useDictionary } from "react-intlayer";
|
|
4
4
|
import { useAddDictionary, useGetProjects } from "../../../hooks/intlayerAPIHooks.mjs";
|
|
5
|
-
import "../../../index-
|
|
5
|
+
import "../../../index-BVYRWLUL.js";
|
|
6
6
|
import "@intlayer/config/client";
|
|
7
7
|
import "@intlayer/api";
|
|
8
8
|
import "../../Button/Button.mjs";
|
|
@@ -59,17 +59,17 @@ const DictionaryCreationForm = () => {
|
|
|
59
59
|
Form.Input,
|
|
60
60
|
{
|
|
61
61
|
name: "key",
|
|
62
|
-
label: keyInput.label,
|
|
63
|
-
placeholder: keyInput.placeholder,
|
|
62
|
+
label: keyInput.label.value,
|
|
63
|
+
placeholder: keyInput.placeholder.value,
|
|
64
64
|
isRequired: true
|
|
65
65
|
}
|
|
66
66
|
),
|
|
67
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs(Form.MultiSelect, { name: "projectIds", label: projectInput.label, children: [
|
|
67
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(Form.MultiSelect, { name: "projectIds", label: projectInput.label.value, children: [
|
|
68
68
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
69
69
|
MultiSelect.Trigger,
|
|
70
70
|
{
|
|
71
71
|
getBadgeValue: (value) => projects?.data?.find((project2) => String(project2._id) === value)?.name ?? value,
|
|
72
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx(MultiSelect.Input, { placeholder: projectInput.placeholder })
|
|
72
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(MultiSelect.Input, { placeholder: projectInput.placeholder.value })
|
|
73
73
|
}
|
|
74
74
|
),
|
|
75
75
|
/* @__PURE__ */ jsxRuntimeExports.jsx(MultiSelect.Content, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(MultiSelect.List, { children: projects?.data?.map((project2) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
@@ -88,7 +88,7 @@ const DictionaryCreationForm = () => {
|
|
|
88
88
|
type: "submit",
|
|
89
89
|
color: "text",
|
|
90
90
|
isLoading: isSubmitting,
|
|
91
|
-
label: createDictionaryButton.ariaLabel,
|
|
91
|
+
label: createDictionaryButton.ariaLabel.value,
|
|
92
92
|
children: createDictionaryButton.text
|
|
93
93
|
}
|
|
94
94
|
)
|
package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DictionaryCreationForm.mjs","sources":["../../../../src/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.tsx"],"sourcesContent":["'use client';\n\nimport { type FC } from 'react';\
|
|
1
|
+
{"version":3,"file":"DictionaryCreationForm.mjs","sources":["../../../../src/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.tsx"],"sourcesContent":["'use client';\n\nimport { type FC } from 'react';\nimport { useDictionary } from 'react-intlayer';\nimport {\n useAddDictionary,\n useGetProjects,\n} from '../../../hooks/intlayerAPIHooks';\nimport { useAuth } from '../../Auth';\nimport { Form, useForm } from '../../Form';\nimport { MultiSelect } from '../../Select';\nimport { dictionaryFormContent } from './dictionaryCreationForm.content';\nimport {\n useDictionarySchema,\n type DictionaryFormData,\n} from './useDictionaryFormSchema';\n\nexport const DictionaryCreationForm: FC = () => {\n const { session } = useAuth();\n const { project } = session ?? {};\n const { addDictionary } = useAddDictionary();\n const { data: projects } = useGetProjects();\n const DictionarySchema = useDictionarySchema(String(project?._id));\n const { form, isSubmitting } = useForm(DictionarySchema);\n const { keyInput, createDictionaryButton, projectInput } = useDictionary(\n dictionaryFormContent\n );\n\n const onSubmitSuccess = async (data: DictionaryFormData) => {\n await addDictionary(data);\n };\n\n return (\n <Form\n schema={DictionarySchema}\n onSubmitSuccess={onSubmitSuccess}\n className=\"w-full max-w-[400px]\"\n {...form}\n >\n <Form.Input\n name=\"key\"\n label={keyInput.label.value}\n placeholder={keyInput.placeholder.value}\n isRequired\n />\n\n <Form.MultiSelect name=\"projectIds\" label={projectInput.label.value}>\n <MultiSelect.Trigger\n getBadgeValue={(value) =>\n projects?.data?.find((project) => String(project._id) === value)\n ?.name ?? value\n }\n >\n <MultiSelect.Input placeholder={projectInput.placeholder.value} />\n </MultiSelect.Trigger>\n <MultiSelect.Content>\n <MultiSelect.List>\n {projects?.data?.map((project) => (\n <MultiSelect.Item\n key={String(project._id)}\n value={String(project._id)}\n >\n {project.name}\n </MultiSelect.Item>\n ))}\n </MultiSelect.List>\n </MultiSelect.Content>\n </Form.MultiSelect>\n\n <Form.Button\n className=\"ml-auto mt-12\"\n type=\"submit\"\n color=\"text\"\n isLoading={isSubmitting}\n label={createDictionaryButton.ariaLabel.value}\n >\n {createDictionaryButton.text}\n </Form.Button>\n </Form>\n );\n};\n"],"names":["jsxs","jsx","project"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBO,MAAM,yBAA6B,MAAM;AAC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AAA,cAExB,UAAAA,SAAQ;AAAA,YAAA;AAAA,YAHJ,OAAOA,SAAQ,GAAG;AAAA,UAK1B,CAAA,EACH,CAAA,EACF,CAAA;AAAA,QAAA,GACF;AAAA,QAEAD,kCAAA;AAAA,UAAC,KAAK;AAAA,UAAL;AAAA,YACC,WAAU;AAAA,YACV,MAAK;AAAA,YACL,OAAM;AAAA,YACN,WAAW;AAAA,YACX,OAAO,uBAAuB,UAAU;AAAA,YAEvC,UAAuB,uBAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MAC1B;AAAA,IAAA;AAAA,EACF;AAEJ;"}
|
package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDictionaryFormSchema.cjs","sources":["../../../../src/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"useDictionaryFormSchema.cjs","sources":["../../../../src/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.ts"],"sourcesContent":["import { useDictionary } from 'react-intlayer';\nimport { z } from 'zod';\nimport { dictionaryFormSchemaContent } from './useDictionaryFormSchema.content';\n\nexport const useDictionarySchema = (projectId: string) => {\n const {\n requiredErrorName,\n invalidTypeErrorName,\n requiredErrorProjectId,\n invalidTypeErrorProjectId,\n } = useDictionary(dictionaryFormSchemaContent);\n\n return z.object({\n key: z\n .string({\n required_error: requiredErrorName,\n invalid_type_error: invalidTypeErrorName,\n })\n .min(1, { message: invalidTypeErrorName })\n .default(''),\n projectIds: z\n .array(\n z.string({\n required_error: requiredErrorProjectId,\n invalid_type_error: invalidTypeErrorProjectId,\n })\n )\n .default([projectId]),\n });\n};\n\nexport type DictionaryFormData = z.infer<\n ReturnType<typeof useDictionarySchema>\n>;\n"],"names":["useDictionary","dictionaryFormSchemaContent","z"],"mappings":";;;;;AAIa,MAAA,sBAAsB,CAAC,cAAsB;AAClD,QAAA;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA,IACEA,cAAAA,cAAcC,wFAAAA,2BAA2B;AAE7C,SAAOC,IAAAA,EAAE,OAAO;AAAA,IACd,KAAKA,MACF,OAAO;AAAA,MACN,gBAAgB;AAAA,MAChB,oBAAoB;AAAA,IAAA,CACrB,EACA,IAAI,GAAG,EAAE,SAAS,sBAAsB,EACxC,QAAQ,EAAE;AAAA,IACb,YAAYA,IACT,EAAA;AAAA,MACCA,IAAAA,EAAE,OAAO;AAAA,QACP,gBAAgB;AAAA,QAChB,oBAAoB;AAAA,MACrB,CAAA;AAAA,IAAA,EAEF,QAAQ,CAAC,SAAS,CAAC;AAAA,EAAA,CACvB;AACH;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDictionaryFormSchema.d.ts","sourceRoot":"","sources":["../../../../src/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useDictionaryFormSchema.d.ts","sourceRoot":"","sources":["../../../../src/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,mBAAmB,cAAe,MAAM;;;;;;;;;EAyBpD,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CACtC,UAAU,CAAC,OAAO,mBAAmB,CAAC,CACvC,CAAC"}
|
package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDictionaryFormSchema.mjs","sources":["../../../../src/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"useDictionaryFormSchema.mjs","sources":["../../../../src/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.ts"],"sourcesContent":["import { useDictionary } from 'react-intlayer';\nimport { z } from 'zod';\nimport { dictionaryFormSchemaContent } from './useDictionaryFormSchema.content';\n\nexport const useDictionarySchema = (projectId: string) => {\n const {\n requiredErrorName,\n invalidTypeErrorName,\n requiredErrorProjectId,\n invalidTypeErrorProjectId,\n } = useDictionary(dictionaryFormSchemaContent);\n\n return z.object({\n key: z\n .string({\n required_error: requiredErrorName,\n invalid_type_error: invalidTypeErrorName,\n })\n .min(1, { message: invalidTypeErrorName })\n .default(''),\n projectIds: z\n .array(\n z.string({\n required_error: requiredErrorProjectId,\n invalid_type_error: invalidTypeErrorProjectId,\n })\n )\n .default([projectId]),\n });\n};\n\nexport type DictionaryFormData = z.infer<\n ReturnType<typeof useDictionarySchema>\n>;\n"],"names":[],"mappings":";;;AAIa,MAAA,sBAAsB,CAAC,cAAsB;AAClD,QAAA;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA,IACE,cAAc,2BAA2B;AAE7C,SAAO,EAAE,OAAO;AAAA,IACd,KAAK,EACF,OAAO;AAAA,MACN,gBAAgB;AAAA,MAChB,oBAAoB;AAAA,IAAA,CACrB,EACA,IAAI,GAAG,EAAE,SAAS,sBAAsB,EACxC,QAAQ,EAAE;AAAA,IACb,YAAY,EACT;AAAA,MACC,EAAE,OAAO;AAAA,QACP,gBAAgB;AAAA,QAChB,oBAAoB;AAAA,MACrB,CAAA;AAAA,IAAA,EAEF,QAAQ,CAAC,SAAS,CAAC;AAAA,EAAA,CACvB;AACH;"}
|
|
@@ -10,7 +10,7 @@ require("../../../hooks/useScrollBlockage/useScrollBlockageStore.cjs");
|
|
|
10
10
|
require("../../../hooks/useAsync/useAsyncStateStore.cjs");
|
|
11
11
|
const hooks_intlayerAPIHooks = require("../../../hooks/intlayerAPIHooks.cjs");
|
|
12
12
|
require("deepmerge");
|
|
13
|
-
require("../../../index-
|
|
13
|
+
require("../../../index-DTQyeqio.cjs");
|
|
14
14
|
require("@intlayer/config/client");
|
|
15
15
|
require("@intlayer/api");
|
|
16
16
|
require("../../Button/Button.cjs");
|
|
@@ -49,7 +49,7 @@ const DictionaryDetailsForm = ({
|
|
|
49
49
|
const { data: tags, isLoading: isLoadingTags } = hooks_intlayerAPIHooks.useGetTags();
|
|
50
50
|
const dictionaryValue = {
|
|
51
51
|
...dictionary,
|
|
52
|
-
|
|
52
|
+
version: dictionary.version ?? "-1"
|
|
53
53
|
};
|
|
54
54
|
const DictionaryDetailsSchema = components_DictionaryFieldEditor_DictionaryDetails_useDictionaryDetailsSchema.useDictionaryDetailsSchema(
|
|
55
55
|
String(project?._id)
|
|
@@ -130,7 +130,7 @@ const DictionaryDetailsForm = ({
|
|
|
130
130
|
{
|
|
131
131
|
name: "key",
|
|
132
132
|
label: keyInput.label,
|
|
133
|
-
placeholder: keyInput.label,
|
|
133
|
+
placeholder: keyInput.label.value,
|
|
134
134
|
description: keyInput.description,
|
|
135
135
|
disabled: isSubmitting,
|
|
136
136
|
isRequired: true
|
|
@@ -141,7 +141,7 @@ const DictionaryDetailsForm = ({
|
|
|
141
141
|
{
|
|
142
142
|
name: "title",
|
|
143
143
|
label: titleInput.label,
|
|
144
|
-
placeholder: titleInput.placeholder,
|
|
144
|
+
placeholder: titleInput.placeholder.value,
|
|
145
145
|
description: titleInput.description,
|
|
146
146
|
disabled: isSubmitting
|
|
147
147
|
}
|
|
@@ -152,7 +152,7 @@ const DictionaryDetailsForm = ({
|
|
|
152
152
|
{
|
|
153
153
|
name: "description",
|
|
154
154
|
label: descriptionInput.label,
|
|
155
|
-
placeholder: descriptionInput.placeholder,
|
|
155
|
+
placeholder: descriptionInput.placeholder.value,
|
|
156
156
|
description: descriptionInput.description,
|
|
157
157
|
disabled: isSubmitting
|
|
158
158
|
}
|
|
@@ -162,14 +162,14 @@ const DictionaryDetailsForm = ({
|
|
|
162
162
|
components_Form_layout_FormItemLayout.Form.MultiSelect,
|
|
163
163
|
{
|
|
164
164
|
name: "projectIds",
|
|
165
|
-
label: projectInput.label,
|
|
166
|
-
description: projectInput.description,
|
|
165
|
+
label: projectInput.label.value,
|
|
166
|
+
description: projectInput.description.value,
|
|
167
167
|
children: [
|
|
168
168
|
/* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
|
|
169
169
|
components_Select_Multiselect.MultiSelect.Trigger,
|
|
170
170
|
{
|
|
171
171
|
getBadgeValue: (value) => projects?.data?.find((project2) => String(project2._id) === value)?.name ?? value,
|
|
172
|
-
children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(components_Select_Multiselect.MultiSelect.Input, { placeholder: projectInput.placeholder })
|
|
172
|
+
children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(components_Select_Multiselect.MultiSelect.Input, { placeholder: projectInput.placeholder.value })
|
|
173
173
|
}
|
|
174
174
|
),
|
|
175
175
|
/* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(components_Select_Multiselect.MultiSelect.Content, { children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(components_Loader_index.Loader, { isLoading: isLoadingProjects, children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(components_Select_Multiselect.MultiSelect.List, { children: projects?.data?.map((project2) => /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
|
|
@@ -187,14 +187,14 @@ const DictionaryDetailsForm = ({
|
|
|
187
187
|
components_Form_layout_FormItemLayout.Form.MultiSelect,
|
|
188
188
|
{
|
|
189
189
|
name: "tags",
|
|
190
|
-
label: tagsSelect.label,
|
|
191
|
-
description: tagsSelect.description,
|
|
190
|
+
label: tagsSelect.label.value,
|
|
191
|
+
description: tagsSelect.description.value,
|
|
192
192
|
children: [
|
|
193
193
|
/* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
|
|
194
194
|
components_Select_Multiselect.MultiSelect.Trigger,
|
|
195
195
|
{
|
|
196
196
|
getBadgeValue: (value) => projects?.data?.find((project2) => String(project2._id) === value)?.name ?? value,
|
|
197
|
-
children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(components_Select_Multiselect.MultiSelect.Input, { placeholder: tagsSelect.placeholder })
|
|
197
|
+
children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(components_Select_Multiselect.MultiSelect.Input, { placeholder: tagsSelect.placeholder.value })
|
|
198
198
|
}
|
|
199
199
|
),
|
|
200
200
|
/* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(components_Select_Multiselect.MultiSelect.Content, { children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(components_Loader_index.Loader, { isLoading: isLoadingProjects, children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(components_Select_Multiselect.MultiSelect.List, { children: tags?.data?.map((tag) => /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
|
|
@@ -214,10 +214,15 @@ const DictionaryDetailsForm = ({
|
|
|
214
214
|
components_Form_layout_FormItemLayout.Form.Select,
|
|
215
215
|
{
|
|
216
216
|
name: "publishedVersion",
|
|
217
|
-
description: publishedVersionSelect.description,
|
|
217
|
+
description: publishedVersionSelect.description.value,
|
|
218
218
|
label: publishedVersionSelect.label,
|
|
219
219
|
children: [
|
|
220
|
-
/* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(components_Select_Select.Select.Trigger, { children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
|
|
220
|
+
/* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(components_Select_Select.Select.Trigger, { children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
|
|
221
|
+
components_Select_Select.Select.Value,
|
|
222
|
+
{
|
|
223
|
+
placeholder: publishedVersionSelect.placeholder.value
|
|
224
|
+
}
|
|
225
|
+
) }),
|
|
221
226
|
/* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsxs(components_Select_Select.Select.Content, { children: [
|
|
222
227
|
/* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(components_Select_Select.Select.Item, { value: "-1", children: "LTS" }),
|
|
223
228
|
dictionary.availableVersions?.map(
|
|
@@ -234,7 +239,7 @@ const DictionaryDetailsForm = ({
|
|
|
234
239
|
components_Form_layout_FormItemLayout.Form.Button,
|
|
235
240
|
{
|
|
236
241
|
type: "button",
|
|
237
|
-
label: auditButton.label,
|
|
242
|
+
label: auditButton.label.value,
|
|
238
243
|
Icon: lucideReact.WandSparkles,
|
|
239
244
|
variant: "outline",
|
|
240
245
|
color: "text",
|
|
@@ -249,7 +254,7 @@ const DictionaryDetailsForm = ({
|
|
|
249
254
|
components_Form_layout_FormItemLayout.Form.Button,
|
|
250
255
|
{
|
|
251
256
|
type: "submit",
|
|
252
|
-
label: publishButton.label,
|
|
257
|
+
label: publishButton.label.value,
|
|
253
258
|
disabled: isSubmitting || !isFormEdited || isLoading,
|
|
254
259
|
Icon: lucideReact.ArrowUpFromLine,
|
|
255
260
|
color: "text",
|
|
@@ -261,7 +266,7 @@ const DictionaryDetailsForm = ({
|
|
|
261
266
|
components_Form_layout_FormItemLayout.Form.Button,
|
|
262
267
|
{
|
|
263
268
|
type: "submit",
|
|
264
|
-
label: saveButton.label,
|
|
269
|
+
label: saveButton.label.value,
|
|
265
270
|
disabled: isSubmitting || !isFormEdited || isLoading,
|
|
266
271
|
Icon: lucideReact.Save,
|
|
267
272
|
color: "text",
|
|
@@ -273,7 +278,7 @@ const DictionaryDetailsForm = ({
|
|
|
273
278
|
components_Form_layout_FormItemLayout.Form.Button,
|
|
274
279
|
{
|
|
275
280
|
type: "submit",
|
|
276
|
-
label: downloadButton.label,
|
|
281
|
+
label: downloadButton.label.value,
|
|
277
282
|
disabled: isSubmitting || !isFormEdited || isLoading,
|
|
278
283
|
Icon: lucideReact.Download,
|
|
279
284
|
color: "text",
|
package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DictionaryDetailsForm.cjs","sources":["../../../../src/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.tsx"],"sourcesContent":["'use client';\n\nimport {\n DictionaryAPI,\n Dictionary as DistantDictionary,\n} from '@intlayer/backend';\nimport { Dictionary } from '@intlayer/core';\nimport {\n useDictionariesRecordActions,\n useEditedContent,\n} from '@intlayer/editor-react';\nimport { ArrowUpFromLine, Download, Save, WandSparkles } from 'lucide-react';\nimport { type FC, useEffect, useMemo } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport {\n useAuditContentDeclarationMetadata,\n useGetProjects,\n useGetTags,\n usePushDictionaries,\n useWriteDictionary,\n} from '../../../hooks';\nimport { useAuth } from '../../Auth';\nimport { Form, useForm } from '../../Form';\nimport { Loader } from '../../Loader';\nimport { MultiSelect, Select } from '../../Select';\nimport { dictionaryDetailsContent } from './dictionaryDetails.content';\nimport {\n useDictionaryDetailsSchema,\n DictionaryDetailsFormData,\n} from './useDictionaryDetailsSchema';\n\ntype DictionaryDetailsProps = {\n dictionary: Dictionary;\n mode: 'local' | 'remote';\n};\n\nexport const DictionaryDetailsForm: FC<DictionaryDetailsProps> = ({\n dictionary,\n mode,\n}) => {\n const { session } = useAuth();\n const { project } = session ?? {};\n const { setLocaleDictionary } = useDictionariesRecordActions();\n const { pushDictionaries } = usePushDictionaries();\n const { data: projects, isLoading: isLoadingProjects } = useGetProjects();\n const { data: tags, isLoading: isLoadingTags } = useGetTags();\n const dictionaryValue = {\n ...dictionary,\n publishedVersion: dictionary.publishedVersion ?? '-1',\n };\n\n const DictionaryDetailsSchema = useDictionaryDetailsSchema(\n String(project?._id)\n );\n const { form, isSubmitting } = useForm(DictionaryDetailsSchema, {\n defaultValues: dictionaryValue,\n });\n const {\n titleInput,\n keyInput,\n descriptionInput,\n publishedVersionSelect,\n publishButton,\n saveButton,\n projectInput,\n tagsSelect,\n auditButton,\n downloadButton,\n } = useDictionary(dictionaryDetailsContent);\n const { auditContentDeclaration, isLoading: isAuditing } =\n useAuditContentDeclarationMetadata();\n const { writeDictionary } = useWriteDictionary();\n\n useEffect(() => {\n form.reset(dictionaryValue);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [dictionary, form?.reset]);\n\n const isFormEdited = form.formState.isDirty;\n const isLocalDictionary =\n typeof (dictionary as DistantDictionary)?._id === 'undefined';\n\n const onSubmitSuccess = async (data: DictionaryDetailsFormData) => {\n const updatedDictionary = {\n ...dictionary,\n ...data,\n };\n\n if (mode === 'remote') {\n await pushDictionaries([updatedDictionary]);\n } else {\n await writeDictionary(updatedDictionary);\n }\n\n setLocaleDictionary(updatedDictionary);\n };\n\n const handleOnAuditFile = async () => {\n const updatedDictionary = form.getValues();\n await auditContentDeclaration({\n fileContent: JSON.stringify({ ...dictionary, ...updatedDictionary }),\n }).then((response) => {\n if (!response.data) return;\n\n try {\n const editedDictionary = JSON.parse(response.data.fileContent) as\n | Partial<Dictionary>\n | undefined;\n\n form.reset({\n ...updatedDictionary,\n ...editedDictionary,\n publishedVersion: updatedDictionary.publishedVersion ?? '-1',\n });\n } catch (error) {\n console.error(error);\n }\n });\n };\n\n const isLoading = isSubmitting || isLoadingTags;\n\n const { editedContent } = useEditedContent();\n const editedDictionary = useMemo(\n () => editedContent?.[dictionary.key],\n [editedContent, dictionary.key]\n );\n const isEdited = useMemo(\n () =>\n editedDictionary &&\n dictionary &&\n JSON.stringify(editedDictionary.content) !==\n JSON.stringify(dictionary.content),\n [dictionary, editedDictionary]\n );\n\n return (\n <Form\n className=\"flex size-full flex-1 flex-col gap-8\"\n {...form}\n schema={DictionaryDetailsSchema}\n onSubmitSuccess={onSubmitSuccess}\n >\n <div className=\"flex size-full flex-1 gap-8 max-md:flex-col\">\n <Form.EditableFieldInput\n name=\"key\"\n label={keyInput.label}\n placeholder={keyInput.label}\n description={keyInput.description}\n disabled={isSubmitting}\n isRequired\n />\n <Form.EditableFieldInput\n name=\"title\"\n label={titleInput.label}\n placeholder={titleInput.placeholder}\n description={titleInput.description}\n disabled={isSubmitting}\n />\n </div>\n <Form.EditableFieldTextArea\n name=\"description\"\n label={descriptionInput.label}\n placeholder={descriptionInput.placeholder}\n description={descriptionInput.description}\n disabled={isSubmitting}\n />\n <div className=\"flex size-full flex-1 gap-8 max-md:flex-col\">\n <Form.MultiSelect\n name=\"projectIds\"\n label={projectInput.label}\n description={projectInput.description}\n >\n <MultiSelect.Trigger\n getBadgeValue={(value) =>\n projects?.data?.find((project) => String(project._id) === value)\n ?.name ?? value\n }\n >\n <MultiSelect.Input placeholder={projectInput.placeholder} />\n </MultiSelect.Trigger>\n <MultiSelect.Content>\n <Loader isLoading={isLoadingProjects}>\n <MultiSelect.List>\n {projects?.data?.map((project) => (\n <MultiSelect.Item\n key={String(project._id)}\n value={String(project._id)}\n >\n {project.name}\n </MultiSelect.Item>\n ))}\n </MultiSelect.List>\n </Loader>\n </MultiSelect.Content>\n </Form.MultiSelect>\n\n <Form.MultiSelect\n name=\"tags\"\n label={tagsSelect.label}\n description={tagsSelect.description}\n >\n <MultiSelect.Trigger\n getBadgeValue={(value) =>\n projects?.data?.find((project) => String(project._id) === value)\n ?.name ?? value\n }\n >\n <MultiSelect.Input placeholder={tagsSelect.placeholder} />\n </MultiSelect.Trigger>\n <MultiSelect.Content>\n <Loader isLoading={isLoadingProjects}>\n <MultiSelect.List>\n {tags?.data?.map((tag) => (\n <MultiSelect.Item\n key={String(tag.key)}\n value={String(tag.key)}\n >\n {tag.name ?? tag.key}\n </MultiSelect.Item>\n ))}\n </MultiSelect.List>\n </Loader>\n </MultiSelect.Content>\n </Form.MultiSelect>\n </div>\n {((dictionary as DictionaryAPI).availableVersions?.length ?? 0) > 1 && (\n <div className=\"flex size-full flex-1 gap-8 max-md:flex-col\">\n <Form.Select\n name=\"publishedVersion\"\n description={publishedVersionSelect.description}\n label={publishedVersionSelect.label}\n >\n <Select.Trigger>\n <Select.Value placeholder={publishedVersionSelect.placeholder} />\n </Select.Trigger>\n <Select.Content>\n <Select.Item value=\"-1\">LTS</Select.Item>\n {(dictionary as DictionaryAPI).availableVersions?.map(\n (version) => (\n <Select.Item value={version} key={version}>\n {version}\n </Select.Item>\n )\n )}\n </Select.Content>\n </Form.Select>\n <div className=\"w-full\" />\n </div>\n )}\n\n <div className=\"flex flex-wrap items-center justify-end gap-2 max-md:flex-col\">\n <Form.Button\n type=\"button\"\n label={auditButton.label}\n Icon={WandSparkles}\n variant=\"outline\"\n color=\"text\"\n className=\"max-md:w-full\"\n onClick={handleOnAuditFile}\n disabled={isSubmitting || isAuditing}\n isLoading={isAuditing}\n >\n {auditButton.text}\n </Form.Button>\n\n {mode === 'remote' ? (\n isLocalDictionary ? (\n <Form.Button\n type=\"submit\"\n label={publishButton.label}\n disabled={isSubmitting || !isFormEdited || isLoading}\n Icon={ArrowUpFromLine}\n color=\"text\"\n className=\"max-md:w-full\"\n isLoading={isSubmitting}\n >\n {publishButton.text}\n </Form.Button>\n ) : (\n isEdited && (\n <Form.Button\n type=\"submit\"\n label={saveButton.label}\n disabled={isSubmitting || !isFormEdited || isLoading}\n Icon={Save}\n color=\"text\"\n className=\"max-md:w-full\"\n isLoading={isSubmitting}\n >\n {saveButton.text}\n </Form.Button>\n )\n )\n ) : (\n <Form.Button\n type=\"submit\"\n label={downloadButton.label}\n disabled={isSubmitting || !isFormEdited || isLoading}\n Icon={Download}\n color=\"text\"\n className=\"max-md:w-full\"\n isLoading={isSubmitting}\n >\n {downloadButton.text}\n </Form.Button>\n )}\n </div>\n </Form>\n );\n};\n"],"names":["useAuth","useDictionariesRecordActions","usePushDictionaries","useGetProjects","useGetTags","useDictionaryDetailsSchema","useForm","useDictionary","dictionaryDetailsContent","useAuditContentDeclarationMetadata","useWriteDictionary","useEffect","editedDictionary","useEditedContent","useMemo","jsxs","Form","jsx","MultiSelect","project","Loader","Select","WandSparkles","ArrowUpFromLine","Save","Download"],"mappings":";;;;;;;;;;;;;;;;;;;;;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,gBAAgB;AAAA,cAC3C,MAAMO,YAAA;AAAA,cACN,OAAM;AAAA,cACN,WAAU;AAAA,cACV,WAAW;AAAA,cAEV,UAAc,cAAA;AAAA,YAAA;AAAA,cAGjB,YACEN,2BAAA,kBAAA;AAAA,YAACD,sCAAAA,KAAK;AAAA,YAAL;AAAA,cACC,MAAK;AAAA,cACL,OAAO,WAAW;AAAA,cAClB,UAAU,gBAAgB,CAAC,gBAAgB;AAAA,cAC3C,MAAMQ,YAAA;AAAA,cACN,OAAM;AAAA,cACN,WAAU;AAAA,cACV,WAAW;AAAA,cAEV,UAAW,WAAA;AAAA,YAAA;AAAA,UAAA,IAKlBP,2BAAA,kBAAA;AAAA,YAACD,sCAAAA,KAAK;AAAA,YAAL;AAAA,cACC,MAAK;AAAA,cACL,OAAO,eAAe;AAAA,cACtB,UAAU,gBAAgB,CAAC,gBAAgB;AAAA,cAC3C,MAAMS,YAAA;AAAA,cACN,OAAM;AAAA,cACN,WAAU;AAAA,cACV,WAAW;AAAA,cAEV,UAAe,eAAA;AAAA,YAAA;AAAA,UAAA;AAAA,QAClB,EAEJ,CAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EACF;AAEJ;;"}
|
|
1
|
+
{"version":3,"file":"DictionaryDetailsForm.cjs","sources":["../../../../src/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.tsx"],"sourcesContent":["'use client';\n\nimport {\n DictionaryAPI,\n Dictionary as DistantDictionary,\n} from '@intlayer/backend';\nimport { Dictionary } from '@intlayer/core';\nimport {\n useDictionariesRecordActions,\n useEditedContent,\n} from '@intlayer/editor-react';\nimport { ArrowUpFromLine, Download, Save, WandSparkles } from 'lucide-react';\nimport { type FC, useEffect, useMemo } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport {\n useAuditContentDeclarationMetadata,\n useGetProjects,\n useGetTags,\n usePushDictionaries,\n useWriteDictionary,\n} from '../../../hooks';\nimport { useAuth } from '../../Auth';\nimport { Form, useForm } from '../../Form';\nimport { Loader } from '../../Loader';\nimport { MultiSelect, Select } from '../../Select';\nimport { dictionaryDetailsContent } from './dictionaryDetails.content';\nimport {\n useDictionaryDetailsSchema,\n DictionaryDetailsFormData,\n} from './useDictionaryDetailsSchema';\n\ntype DictionaryDetailsProps = {\n dictionary: Dictionary;\n mode: 'local' | 'remote';\n};\n\nexport const DictionaryDetailsForm: FC<DictionaryDetailsProps> = ({\n dictionary,\n mode,\n}) => {\n const { session } = useAuth();\n const { project } = session ?? {};\n const { setLocaleDictionary } = useDictionariesRecordActions();\n const { pushDictionaries } = usePushDictionaries();\n const { data: projects, isLoading: isLoadingProjects } = useGetProjects();\n const { data: tags, isLoading: isLoadingTags } = useGetTags();\n const dictionaryValue = {\n ...dictionary,\n version: dictionary.version ?? '-1',\n };\n\n const DictionaryDetailsSchema = useDictionaryDetailsSchema(\n String(project?._id)\n );\n const { form, isSubmitting } = useForm(DictionaryDetailsSchema, {\n defaultValues: dictionaryValue,\n });\n const {\n titleInput,\n keyInput,\n descriptionInput,\n publishedVersionSelect,\n publishButton,\n saveButton,\n projectInput,\n tagsSelect,\n auditButton,\n downloadButton,\n } = useDictionary(dictionaryDetailsContent);\n const { auditContentDeclaration, isLoading: isAuditing } =\n useAuditContentDeclarationMetadata();\n const { writeDictionary } = useWriteDictionary();\n\n useEffect(() => {\n form.reset(dictionaryValue);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [dictionary, form?.reset]);\n\n const isFormEdited = form.formState.isDirty;\n const isLocalDictionary =\n typeof (dictionary as DistantDictionary)?._id === 'undefined';\n\n const onSubmitSuccess = async (data: DictionaryDetailsFormData) => {\n const updatedDictionary = {\n ...dictionary,\n ...data,\n };\n\n if (mode === 'remote') {\n await pushDictionaries([updatedDictionary]);\n } else {\n await writeDictionary(updatedDictionary);\n }\n\n setLocaleDictionary(updatedDictionary);\n };\n\n const handleOnAuditFile = async () => {\n const updatedDictionary = form.getValues();\n await auditContentDeclaration({\n fileContent: JSON.stringify({ ...dictionary, ...updatedDictionary }),\n }).then((response) => {\n if (!response.data) return;\n\n try {\n const editedDictionary = JSON.parse(response.data.fileContent) as\n | Partial<Dictionary>\n | undefined;\n\n form.reset({\n ...updatedDictionary,\n ...editedDictionary,\n publishedVersion: updatedDictionary.publishedVersion ?? '-1',\n });\n } catch (error) {\n console.error(error);\n }\n });\n };\n\n const isLoading = isSubmitting || isLoadingTags;\n\n const { editedContent } = useEditedContent();\n const editedDictionary = useMemo(\n () => editedContent?.[dictionary.key],\n [editedContent, dictionary.key]\n );\n const isEdited = useMemo(\n () =>\n editedDictionary &&\n dictionary &&\n JSON.stringify(editedDictionary.content) !==\n JSON.stringify(dictionary.content),\n [dictionary, editedDictionary]\n );\n\n return (\n <Form\n className=\"flex size-full flex-1 flex-col gap-8\"\n {...form}\n schema={DictionaryDetailsSchema}\n onSubmitSuccess={onSubmitSuccess}\n >\n <div className=\"flex size-full flex-1 gap-8 max-md:flex-col\">\n <Form.EditableFieldInput\n name=\"key\"\n label={keyInput.label}\n placeholder={keyInput.label.value}\n description={keyInput.description}\n disabled={isSubmitting}\n isRequired\n />\n <Form.EditableFieldInput\n name=\"title\"\n label={titleInput.label}\n placeholder={titleInput.placeholder.value}\n description={titleInput.description}\n disabled={isSubmitting}\n />\n </div>\n <Form.EditableFieldTextArea\n name=\"description\"\n label={descriptionInput.label}\n placeholder={descriptionInput.placeholder.value}\n description={descriptionInput.description}\n disabled={isSubmitting}\n />\n <div className=\"flex size-full flex-1 gap-8 max-md:flex-col\">\n <Form.MultiSelect\n name=\"projectIds\"\n label={projectInput.label.value}\n description={projectInput.description.value}\n >\n <MultiSelect.Trigger\n getBadgeValue={(value) =>\n projects?.data?.find((project) => String(project._id) === value)\n ?.name ?? value\n }\n >\n <MultiSelect.Input placeholder={projectInput.placeholder.value} />\n </MultiSelect.Trigger>\n <MultiSelect.Content>\n <Loader isLoading={isLoadingProjects}>\n <MultiSelect.List>\n {projects?.data?.map((project) => (\n <MultiSelect.Item\n key={String(project._id)}\n value={String(project._id)}\n >\n {project.name}\n </MultiSelect.Item>\n ))}\n </MultiSelect.List>\n </Loader>\n </MultiSelect.Content>\n </Form.MultiSelect>\n\n <Form.MultiSelect\n name=\"tags\"\n label={tagsSelect.label.value}\n description={tagsSelect.description.value}\n >\n <MultiSelect.Trigger\n getBadgeValue={(value) =>\n projects?.data?.find((project) => String(project._id) === value)\n ?.name ?? value\n }\n >\n <MultiSelect.Input placeholder={tagsSelect.placeholder.value} />\n </MultiSelect.Trigger>\n <MultiSelect.Content>\n <Loader isLoading={isLoadingProjects}>\n <MultiSelect.List>\n {tags?.data?.map((tag) => (\n <MultiSelect.Item\n key={String(tag.key)}\n value={String(tag.key)}\n >\n {tag.name ?? tag.key}\n </MultiSelect.Item>\n ))}\n </MultiSelect.List>\n </Loader>\n </MultiSelect.Content>\n </Form.MultiSelect>\n </div>\n {((dictionary as DictionaryAPI).availableVersions?.length ?? 0) > 1 && (\n <div className=\"flex size-full flex-1 gap-8 max-md:flex-col\">\n <Form.Select\n name=\"publishedVersion\"\n description={publishedVersionSelect.description.value}\n label={publishedVersionSelect.label}\n >\n <Select.Trigger>\n <Select.Value\n placeholder={publishedVersionSelect.placeholder.value}\n />\n </Select.Trigger>\n <Select.Content>\n <Select.Item value=\"-1\">LTS</Select.Item>\n {(dictionary as DictionaryAPI).availableVersions?.map(\n (version) => (\n <Select.Item value={version} key={version}>\n {version}\n </Select.Item>\n )\n )}\n </Select.Content>\n </Form.Select>\n <div className=\"w-full\" />\n </div>\n )}\n\n <div className=\"flex flex-wrap items-center justify-end gap-2 max-md:flex-col\">\n <Form.Button\n type=\"button\"\n label={auditButton.label.value}\n Icon={WandSparkles}\n variant=\"outline\"\n color=\"text\"\n className=\"max-md:w-full\"\n onClick={handleOnAuditFile}\n disabled={isSubmitting || isAuditing}\n isLoading={isAuditing}\n >\n {auditButton.text}\n </Form.Button>\n\n {mode === 'remote' ? (\n isLocalDictionary ? (\n <Form.Button\n type=\"submit\"\n label={publishButton.label.value}\n disabled={isSubmitting || !isFormEdited || isLoading}\n Icon={ArrowUpFromLine}\n color=\"text\"\n className=\"max-md:w-full\"\n isLoading={isSubmitting}\n >\n {publishButton.text}\n </Form.Button>\n ) : (\n isEdited && (\n <Form.Button\n type=\"submit\"\n label={saveButton.label.value}\n disabled={isSubmitting || !isFormEdited || isLoading}\n Icon={Save}\n color=\"text\"\n className=\"max-md:w-full\"\n isLoading={isSubmitting}\n >\n {saveButton.text}\n </Form.Button>\n )\n )\n ) : (\n <Form.Button\n type=\"submit\"\n label={downloadButton.label.value}\n disabled={isSubmitting || !isFormEdited || isLoading}\n Icon={Download}\n color=\"text\"\n className=\"max-md:w-full\"\n isLoading={isSubmitting}\n >\n {downloadButton.text}\n </Form.Button>\n )}\n </div>\n </Form>\n );\n};\n"],"names":["useAuth","useDictionariesRecordActions","usePushDictionaries","useGetProjects","useGetTags","useDictionaryDetailsSchema","useForm","useDictionary","dictionaryDetailsContent","useAuditContentDeclarationMetadata","useWriteDictionary","useEffect","editedDictionary","useEditedContent","useMemo","jsxs","Form","jsx","MultiSelect","project","Loader","Select","WandSparkles","ArrowUpFromLine","Save","Download"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqCO,MAAM,wBAAoD,CAAC;AAAA,EAChE;AAAA,EACA;AACF,MAAM;AACE,QAAA,EAAE,QAAQ,IAAIA,sCAAQ;AAC5B,QAAM,EAAE,YAAY,WAAW,CAAC;AAC1B,QAAA,EAAE,oBAAoB,IAAIC,yCAA6B;AACvD,QAAA,EAAE,iBAAiB,IAAIC,2CAAoB;AACjD,QAAM,EAAE,MAAM,UAAU,WAAW,kBAAA,IAAsBC,uBAAAA,eAAe;AACxE,QAAM,EAAE,MAAM,MAAM,WAAW,cAAA,IAAkBC,uBAAAA,WAAW;AAC5D,QAAM,kBAAkB;AAAA,IACtB,GAAG;AAAA,IACH,SAAS,WAAW,WAAW;AAAA,EACjC;AAEA,QAAM,0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WAAW;AAAA,cAEV,UAAW,WAAA;AAAA,YAAA;AAAA,UAAA,IAKlBP,2BAAA,kBAAA;AAAA,YAACD,sCAAAA,KAAK;AAAA,YAAL;AAAA,cACC,MAAK;AAAA,cACL,OAAO,eAAe,MAAM;AAAA,cAC5B,UAAU,gBAAgB,CAAC,gBAAgB;AAAA,cAC3C,MAAMS,YAAA;AAAA,cACN,OAAM;AAAA,cACN,WAAU;AAAA,cACV,WAAW;AAAA,cAEV,UAAe,eAAA;AAAA,YAAA;AAAA,UAAA;AAAA,QAClB,EAEJ,CAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EACF;AAEJ;;"}
|
package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DictionaryDetailsForm.d.ts","sourceRoot":"","sources":["../../../../src/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAM5C,OAAO,EAAE,KAAK,EAAE,EAAsB,MAAM,OAAO,CAAC;AAoBpD,KAAK,sBAAsB,GAAG;IAC5B,UAAU,EAAE,UAAU,CAAC;IACvB,IAAI,EAAE,OAAO,GAAG,QAAQ,CAAC;CAC1B,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,EAAE,CAAC,sBAAsB,
|
|
1
|
+
{"version":3,"file":"DictionaryDetailsForm.d.ts","sourceRoot":"","sources":["../../../../src/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAM5C,OAAO,EAAE,KAAK,EAAE,EAAsB,MAAM,OAAO,CAAC;AAoBpD,KAAK,sBAAsB,GAAG;IAC5B,UAAU,EAAE,UAAU,CAAC;IACvB,IAAI,EAAE,OAAO,GAAG,QAAQ,CAAC;CAC1B,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,EAAE,CAAC,sBAAsB,CAoR5D,CAAC"}
|