@intlayer/design-system 5.0.1 → 5.0.3

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.
Files changed (190) hide show
  1. package/dist/.vite/manifest.json +10 -10
  2. package/dist/components/Auth/ChangePasswordForm/ChangePasswordForm.cjs +10 -10
  3. package/dist/components/Auth/ChangePasswordForm/ChangePasswordForm.cjs.map +1 -1
  4. package/dist/components/Auth/ChangePasswordForm/ChangePasswordForm.d.ts.map +1 -1
  5. package/dist/components/Auth/ChangePasswordForm/ChangePasswordForm.mjs +10 -10
  6. package/dist/components/Auth/ChangePasswordForm/ChangePasswordForm.mjs.map +1 -1
  7. package/dist/components/Auth/ChangePasswordForm/changePasswordForm.content.d.ts +150 -10
  8. package/dist/components/Auth/ChangePasswordForm/changePasswordForm.content.d.ts.map +1 -1
  9. package/dist/components/Auth/ChangePasswordForm/useChangePasswordSchema.cjs.map +1 -1
  10. package/dist/components/Auth/ChangePasswordForm/useChangePasswordSchema.content.d.ts +120 -8
  11. package/dist/components/Auth/ChangePasswordForm/useChangePasswordSchema.content.d.ts.map +1 -1
  12. package/dist/components/Auth/ChangePasswordForm/useChangePasswordSchema.d.ts.map +1 -1
  13. package/dist/components/Auth/ChangePasswordForm/useChangePasswordSchema.mjs.map +1 -1
  14. package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.cjs +3 -3
  15. package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.cjs.map +1 -1
  16. package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.d.ts.map +1 -1
  17. package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.mjs +3 -3
  18. package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.mjs.map +1 -1
  19. package/dist/components/Auth/ExternalsLoginButtons/externalsLoginButtons.content.d.ts +75 -5
  20. package/dist/components/Auth/ExternalsLoginButtons/externalsLoginButtons.content.d.ts.map +1 -1
  21. package/dist/components/Auth/ResetPasswordForm/ResetPasswordForm.cjs +6 -6
  22. package/dist/components/Auth/ResetPasswordForm/ResetPasswordForm.cjs.map +1 -1
  23. package/dist/components/Auth/ResetPasswordForm/ResetPasswordForm.d.ts.map +1 -1
  24. package/dist/components/Auth/ResetPasswordForm/ResetPasswordForm.mjs +6 -6
  25. package/dist/components/Auth/ResetPasswordForm/ResetPasswordForm.mjs.map +1 -1
  26. package/dist/components/Auth/ResetPasswordForm/resetPasswordContent.content.d.ts +105 -7
  27. package/dist/components/Auth/ResetPasswordForm/resetPasswordContent.content.d.ts.map +1 -1
  28. package/dist/components/Auth/ResetPasswordForm/useResetPasswordSchema.cjs.map +1 -1
  29. package/dist/components/Auth/ResetPasswordForm/useResetPasswordSchema.content.d.ts +45 -3
  30. package/dist/components/Auth/ResetPasswordForm/useResetPasswordSchema.content.d.ts.map +1 -1
  31. package/dist/components/Auth/ResetPasswordForm/useResetPasswordSchema.d.ts.map +1 -1
  32. package/dist/components/Auth/ResetPasswordForm/useResetPasswordSchema.mjs.map +1 -1
  33. package/dist/components/Auth/SignInForm/SignInForm.cjs +7 -7
  34. package/dist/components/Auth/SignInForm/SignInForm.cjs.map +1 -1
  35. package/dist/components/Auth/SignInForm/SignInForm.d.ts.map +1 -1
  36. package/dist/components/Auth/SignInForm/SignInForm.mjs +7 -7
  37. package/dist/components/Auth/SignInForm/SignInForm.mjs.map +1 -1
  38. package/dist/components/Auth/SignInForm/signIn.content.d.ts +195 -13
  39. package/dist/components/Auth/SignInForm/signIn.content.d.ts.map +1 -1
  40. package/dist/components/Auth/SignInForm/useSignInSchema.cjs.map +1 -1
  41. package/dist/components/Auth/SignInForm/useSignInSchema.content.d.ts +60 -4
  42. package/dist/components/Auth/SignInForm/useSignInSchema.content.d.ts.map +1 -1
  43. package/dist/components/Auth/SignInForm/useSignInSchema.d.ts.map +1 -1
  44. package/dist/components/Auth/SignInForm/useSignInSchema.mjs.map +1 -1
  45. package/dist/components/Auth/SignUpForm/SignUpForm.cjs +8 -8
  46. package/dist/components/Auth/SignUpForm/SignUpForm.cjs.map +1 -1
  47. package/dist/components/Auth/SignUpForm/SignUpForm.d.ts.map +1 -1
  48. package/dist/components/Auth/SignUpForm/SignUpForm.mjs +8 -8
  49. package/dist/components/Auth/SignUpForm/SignUpForm.mjs.map +1 -1
  50. package/dist/components/Auth/SignUpForm/signUpForm.content.d.ts +165 -11
  51. package/dist/components/Auth/SignUpForm/signUpForm.content.d.ts.map +1 -1
  52. package/dist/components/Auth/SignUpForm/useSignUpSchema.cjs.map +1 -1
  53. package/dist/components/Auth/SignUpForm/useSignUpSchema.content.d.ts +105 -7
  54. package/dist/components/Auth/SignUpForm/useSignUpSchema.content.d.ts.map +1 -1
  55. package/dist/components/Auth/SignUpForm/useSignUpSchema.d.ts.map +1 -1
  56. package/dist/components/Auth/SignUpForm/useSignUpSchema.mjs.map +1 -1
  57. package/dist/components/Auth/VerifyEmailForm/VerifyEmailForm.cjs +1 -1
  58. package/dist/components/Auth/VerifyEmailForm/VerifyEmailForm.cjs.map +1 -1
  59. package/dist/components/Auth/VerifyEmailForm/VerifyEmailForm.d.ts.map +1 -1
  60. package/dist/components/Auth/VerifyEmailForm/VerifyEmailForm.mjs +1 -1
  61. package/dist/components/Auth/VerifyEmailForm/VerifyEmailForm.mjs.map +1 -1
  62. package/dist/components/Auth/VerifyEmailForm/index.content.d.ts +60 -4
  63. package/dist/components/Auth/VerifyEmailForm/index.content.d.ts.map +1 -1
  64. package/dist/components/Breadcrumb/breadcrumb.content.d.ts +15 -1
  65. package/dist/components/Breadcrumb/breadcrumb.content.d.ts.map +1 -1
  66. package/dist/components/Breadcrumb/index.cjs.map +1 -1
  67. package/dist/components/Breadcrumb/index.d.ts.map +1 -1
  68. package/dist/components/Breadcrumb/index.mjs.map +1 -1
  69. package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.cjs +4 -4
  70. package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.cjs.map +1 -1
  71. package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.d.ts.map +1 -1
  72. package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.mjs +4 -4
  73. package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.mjs.map +1 -1
  74. package/dist/components/DictionaryEditor/validDictionaryChangeButtons.content.d.ts +114 -8
  75. package/dist/components/DictionaryEditor/validDictionaryChangeButtons.content.d.ts.map +1 -1
  76. package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.cjs.map +1 -1
  77. package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.d.ts.map +1 -1
  78. package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.mjs.map +1 -1
  79. package/dist/components/DictionaryFieldEditor/DictionariesSelector/dictionariesSelector.content.d.ts +30 -2
  80. package/dist/components/DictionaryFieldEditor/DictionariesSelector/dictionariesSelector.content.d.ts.map +1 -1
  81. package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.cjs +6 -6
  82. package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.cjs.map +1 -1
  83. package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.d.ts.map +1 -1
  84. package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.mjs +6 -6
  85. package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.mjs.map +1 -1
  86. package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryCreationForm.content.d.ts +195 -13
  87. package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryCreationForm.content.d.ts.map +1 -1
  88. package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.cjs.map +1 -1
  89. package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.content.d.ts +60 -4
  90. package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.content.d.ts.map +1 -1
  91. package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.d.ts.map +1 -1
  92. package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.mjs.map +1 -1
  93. package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.cjs +22 -17
  94. package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.cjs.map +1 -1
  95. package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.d.ts.map +1 -1
  96. package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.mjs +22 -17
  97. package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.mjs.map +1 -1
  98. package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.d.ts +387 -26
  99. package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.d.ts.map +1 -1
  100. package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.cjs.map +1 -1
  101. package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.content.d.ts +180 -12
  102. package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.content.d.ts.map +1 -1
  103. package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.d.ts.map +1 -1
  104. package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.mjs.map +1 -1
  105. package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.cjs.map +1 -1
  106. package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.d.ts.map +1 -1
  107. package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.mjs.map +1 -1
  108. package/dist/components/DictionaryFieldEditor/EditorView/EditorView.cjs +3 -3
  109. package/dist/components/DictionaryFieldEditor/EditorView/EditorView.cjs.map +1 -1
  110. package/dist/components/DictionaryFieldEditor/EditorView/EditorView.d.ts.map +1 -1
  111. package/dist/components/DictionaryFieldEditor/EditorView/EditorView.mjs +3 -3
  112. package/dist/components/DictionaryFieldEditor/EditorView/EditorView.mjs.map +1 -1
  113. package/dist/components/DictionaryFieldEditor/EditorView/TextEditor.cjs +2 -2
  114. package/dist/components/DictionaryFieldEditor/EditorView/TextEditor.cjs.map +1 -1
  115. package/dist/components/DictionaryFieldEditor/EditorView/TextEditor.d.ts.map +1 -1
  116. package/dist/components/DictionaryFieldEditor/EditorView/TextEditor.mjs +2 -2
  117. package/dist/components/DictionaryFieldEditor/EditorView/TextEditor.mjs.map +1 -1
  118. package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.cjs +2 -2
  119. package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.cjs.map +1 -1
  120. package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.d.ts.map +1 -1
  121. package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.mjs +2 -2
  122. package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.mjs.map +1 -1
  123. package/dist/components/DictionaryFieldEditor/NavigationView/navigationViewNode.content.d.ts +165 -11
  124. package/dist/components/DictionaryFieldEditor/NavigationView/navigationViewNode.content.d.ts.map +1 -1
  125. package/dist/components/DictionaryFieldEditor/NodeTypeSelector.cjs +10 -4
  126. package/dist/components/DictionaryFieldEditor/NodeTypeSelector.cjs.map +1 -1
  127. package/dist/components/DictionaryFieldEditor/NodeTypeSelector.d.ts.map +1 -1
  128. package/dist/components/DictionaryFieldEditor/NodeTypeSelector.mjs +10 -4
  129. package/dist/components/DictionaryFieldEditor/NodeTypeSelector.mjs.map +1 -1
  130. package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.cjs +6 -6
  131. package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.cjs.map +1 -1
  132. package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.d.ts.map +1 -1
  133. package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.mjs +6 -6
  134. package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.mjs.map +1 -1
  135. package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.d.ts +150 -10
  136. package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.d.ts.map +1 -1
  137. package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.cjs +2 -2
  138. package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.cjs.map +1 -1
  139. package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.d.ts.map +1 -1
  140. package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.mjs +2 -2
  141. package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.mjs.map +1 -1
  142. package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.cjs.map +1 -1
  143. package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.d.ts.map +1 -1
  144. package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.mjs.map +1 -1
  145. package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/versionSwitcherDropDown.content.d.ts +45 -3
  146. package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/versionSwitcherDropDown.content.d.ts.map +1 -1
  147. package/dist/components/DictionaryFieldEditor/dictionaryFieldEditor.content.d.ts +60 -4
  148. package/dist/components/DictionaryFieldEditor/dictionaryFieldEditor.content.d.ts.map +1 -1
  149. package/dist/components/DictionaryFieldEditor/editorView.content.d.ts +105 -7
  150. package/dist/components/DictionaryFieldEditor/editorView.content.d.ts.map +1 -1
  151. package/dist/components/DictionaryFieldEditor/nodeTypeSelector.content.cjs +59 -14
  152. package/dist/components/DictionaryFieldEditor/nodeTypeSelector.content.cjs.map +1 -1
  153. package/dist/components/DictionaryFieldEditor/nodeTypeSelector.content.d.ts +135 -6
  154. package/dist/components/DictionaryFieldEditor/nodeTypeSelector.content.d.ts.map +1 -1
  155. package/dist/components/DictionaryFieldEditor/nodeTypeSelector.content.mjs +59 -14
  156. package/dist/components/DictionaryFieldEditor/nodeTypeSelector.content.mjs.map +1 -1
  157. package/dist/components/IDE/CopyButton.cjs +1 -1
  158. package/dist/components/IDE/CopyButton.cjs.map +1 -1
  159. package/dist/components/IDE/CopyButton.content.d.ts +15 -1
  160. package/dist/components/IDE/CopyButton.content.d.ts.map +1 -1
  161. package/dist/components/IDE/CopyButton.d.ts.map +1 -1
  162. package/dist/components/IDE/CopyButton.mjs +1 -1
  163. package/dist/components/IDE/CopyButton.mjs.map +1 -1
  164. package/dist/components/Loader/index.content.d.ts +12 -1
  165. package/dist/components/Loader/index.content.d.ts.map +1 -1
  166. package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.cjs +5 -5
  167. package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.cjs.map +1 -1
  168. package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.d.ts.map +1 -1
  169. package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.mjs +5 -5
  170. package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.mjs.map +1 -1
  171. package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.cjs.map +1 -1
  172. package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.d.ts +6 -6
  173. package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.d.ts.map +1 -1
  174. package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.mjs.map +1 -1
  175. package/dist/components/LocaleSwitcherContentDropDown/localeSwitcher.content.d.ts +105 -7
  176. package/dist/components/LocaleSwitcherContentDropDown/localeSwitcher.content.d.ts.map +1 -1
  177. package/dist/components/LocaleSwitcherDropDown/LocaleSwitcher.cjs +3 -3
  178. package/dist/components/LocaleSwitcherDropDown/LocaleSwitcher.cjs.map +1 -1
  179. package/dist/components/LocaleSwitcherDropDown/LocaleSwitcher.d.ts.map +1 -1
  180. package/dist/components/LocaleSwitcherDropDown/LocaleSwitcher.mjs +3 -3
  181. package/dist/components/LocaleSwitcherDropDown/LocaleSwitcher.mjs.map +1 -1
  182. package/dist/components/LocaleSwitcherDropDown/localeSwitcher.content.d.ts +75 -5
  183. package/dist/components/LocaleSwitcherDropDown/localeSwitcher.content.d.ts.map +1 -1
  184. package/dist/{index-Di_3dNqI.js → index-BVYRWLUL.js} +3 -2
  185. package/dist/index-BVYRWLUL.js.map +1 -0
  186. package/dist/{index-ZARcTrR0.cjs → index-DTQyeqio.cjs} +3 -2
  187. package/dist/index-DTQyeqio.cjs.map +1 -0
  188. package/package.json +19 -19
  189. package/dist/index-Di_3dNqI.js.map +0 -1
  190. package/dist/index-ZARcTrR0.cjs.map +0 -1
@@ -71,7 +71,7 @@ const ValidDictionaryChangeButtons = ({ dictionary, mode }) => {
71
71
  components_Form_layout_FormItemLayout.Form.Button,
72
72
  {
73
73
  type: "button",
74
- label: resetButton.label,
74
+ label: resetButton.label.value,
75
75
  disabled: !isEdited || isSubmitting,
76
76
  className: "ml-auto",
77
77
  Icon: lucideReact.RotateCcw,
@@ -87,7 +87,7 @@ const ValidDictionaryChangeButtons = ({ dictionary, mode }) => {
87
87
  components_Form_layout_FormItemLayout.Form.Button,
88
88
  {
89
89
  type: "submit",
90
- label: publishButton.label,
90
+ label: publishButton.label.value,
91
91
  disabled: !isEdited || isSubmitting,
92
92
  Icon: lucideReact.ArrowUpFromLine,
93
93
  color: "text",
@@ -99,7 +99,7 @@ const ValidDictionaryChangeButtons = ({ dictionary, mode }) => {
99
99
  components_Form_layout_FormItemLayout.Form.Button,
100
100
  {
101
101
  type: "submit",
102
- label: saveButton.label,
102
+ label: saveButton.label.value,
103
103
  disabled: !isEdited || isSubmitting,
104
104
  Icon: lucideReact.Save,
105
105
  color: "text",
@@ -111,7 +111,7 @@ const ValidDictionaryChangeButtons = ({ dictionary, mode }) => {
111
111
  components_Form_layout_FormItemLayout.Form.Button,
112
112
  {
113
113
  type: "submit",
114
- label: downloadButton.label,
114
+ label: downloadButton.label.value,
115
115
  disabled: !isEdited || isSubmitting,
116
116
  Icon: lucideReact.Download,
117
117
  color: "text",
@@ -1 +1 @@
1
- {"version":3,"file":"ValidDictionaryChangeButtons.cjs","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';\n// @ts-ignore react-intlayer not build yet\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}\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}\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}\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}\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":["getValidDictionaryChangeButtonsSchemaSchema","useDictionary","validDictionaryChangeButtonsContent","useDictionariesRecordActions","useWriteDictionary","usePushDictionaries","useEditedContent","useForm","useMemo","useCallback","jsx","jsxs","Form","RotateCcw","ArrowUpFromLine","Save","Download"],"mappings":";;;;;;;;;;;;;;;;;AAsBO,MAAM,+BAET,CAAC,EAAE,YAAY,WAAW;AAC5B,QAAM,2CACJA,+DAAAA,4CAA4C;AAE9C,QAAM,EAAE,aAAa,YAAY,eAAe,eAAe,IAC7DC,4BAAcC,oGAAmC;AAE7C,QAAA,EAAE,oBAAoB,IAAIC,yCAA6B;AACvD,QAAA,EAAE,gBAAgB,IAAIC,0CAAmB;AACzC,QAAA,EAAE,iBAAiB,IAAIC,2CAAoB;AAEjD,QAAM,EAAE,eAAe,qBAAqB,IAAIC,6BAAiB;AAC3D,QAAA,EAAE,MAAM,aAAA,IAAiBC,yBAAA;AAAA,IAC7B;AAAA,EACF;AAEA,QAAM,mBAAmBC,WAAA;AAAA,IACvB,MAAM,gBAAgB,WAAW,GAAG;AAAA,IACpC,CAAC,eAAe,WAAW,GAAG;AAAA,EAChC;AAEA,QAAM,WAAWA,WAAA;AAAA,IACf,MACE,oBACA,KAAK,UAAU,kBAAkB,OAAO,MACtC,KAAK,UAAU,YAAY,OAAO;AAAA,IACtC,CAAC,kBAAkB,UAAU;AAAA,EAC/B;AAEA,QAAM,oBAAoBA,WAAA;AAAA,IACxB,MAAM,OAAQ,YAAkC,QAAQ;AAAA,IACxD,CAAC,UAAU;AAAA,EACb;AAEM,QAAA,kBAAkBC,WAAAA,YAAY,YAAY;AAC9C,QAAI,CAAC,gBAAgB,WAAW,GAAG,EAAG;AAEtC,UAAM,oBAAoB;AAAA,MACxB,GAAG;AAAA,MACH,GAAG,gBAAgB,WAAW,GAAG;AAAA,IACnC;AAEA,QAAI,S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,YACvB,MAAMG,YAAA;AAAA,YACN,OAAM;AAAA,YACN,aAAW;AAAA,YACX,WAAW;AAAA,YAEV,UAAW,WAAA;AAAA,UAAA;AAAA,QAAA,IAKlBL,2BAAA,kBAAA;AAAA,UAACE,sCAAAA,KAAK;AAAA,UAAL;AAAA,YACC,MAAK;AAAA,YACL,OAAO,eAAe;AAAA,YACtB,UAAU,CAAC,YAAY;AAAA,YACvB,MAAMI,YAAA;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;;"}
1
+ {"version":3,"file":"ValidDictionaryChangeButtons.cjs","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":["getValidDictionaryChangeButtonsSchemaSchema","useDictionary","validDictionaryChangeButtonsContent","useDictionariesRecordActions","useWriteDictionary","usePushDictionaries","useEditedContent","useForm","useMemo","useCallback","jsx","jsxs","Form","RotateCcw","ArrowUpFromLine","Save","Download"],"mappings":";;;;;;;;;;;;;;;;;AAqBO,MAAM,+BAET,CAAC,EAAE,YAAY,WAAW;AAC5B,QAAM,2CACJA,+DAAAA,4CAA4C;AAE9C,QAAM,EAAE,aAAa,YAAY,eAAe,eAAe,IAC7DC,4BAAcC,oGAAmC;AAE7C,QAAA,EAAE,oBAAoB,IAAIC,yCAA6B;AACvD,QAAA,EAAE,gBAAgB,IAAIC,0CAAmB;AACzC,QAAA,EAAE,iBAAiB,IAAIC,2CAAoB;AAEjD,QAAM,EAAE,eAAe,qBAAqB,IAAIC,6BAAiB;AAC3D,QAAA,EAAE,MAAM,aAAA,IAAiBC,yBAAA;AAAA,IAC7B;AAAA,EACF;AAEA,QAAM,mBAAmBC,WAAA;AAAA,IACvB,MAAM,gBAAgB,WAAW,GAAG;AAAA,IACpC,CAAC,eAAe,WAAW,GAAG;AAAA,EAChC;AAEA,QAAM,WAAWA,WAAA;AAAA,IACf,MACE,oBACA,KAAK,UAAU,kBAAkB,OAAO,MACtC,KAAK,UAAU,YAAY,OAAO;AAAA,IACtC,CAAC,kBAAkB,UAAU;AAAA,EAC/B;AAEA,QAAM,oBAAoBA,WAAA;AAAA,IACxB,MAAM,OAAQ,YAAkC,QAAQ;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A;AAAA,YACN,OAAM;AAAA,YACN,aAAW;AAAA,YACX,WAAW;AAAA,YAEV,UAAc,cAAA;AAAA,UAAA;AAAA,YAGjB,YACEJ,2BAAA,kBAAA;AAAA,UAACE,sCAAAA,KAAK;AAAA,UAAL;AAAA,YACC,MAAK;AAAA,YACL,OAAO,WAAW,MAAM;AAAA,YACxB,UAAU,CAAC,YAAY;AAAA,YACvB,MAAMG,YAAA;AAAA,YACN,OAAM;AAAA,YACN,aAAW;AAAA,YACX,WAAW;AAAA,YAEV,UAAW,WAAA;AAAA,UAAA;AAAA,QAAA,IAKlBL,2BAAA,kBAAA;AAAA,UAACE,sCAAAA,KAAK;AAAA,UAAL;AAAA,YACC,MAAK;AAAA,YACL,OAAO,eAAe,MAAM;AAAA,YAC5B,UAAU,CAAC,YAAY;AAAA,YACvB,MAAMI,YAAA;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;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ValidDictionaryChangeButtons.d.ts","sourceRoot":"","sources":["../../../src/components/DictionaryEditor/ValidDictionaryChangeButtons.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAMjD,OAAO,EAAwB,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAQtD,KAAK,iCAAiC,GAAG;IACvC,UAAU,EAAE,UAAU,CAAC;IACvB,IAAI,EAAE,OAAO,GAAG,QAAQ,CAAC;CAC1B,CAAC;AAEF,eAAO,MAAM,4BAA4B,EAAE,EAAE,CAC3C,iCAAiC,CAgIlC,CAAC"}
1
+ {"version":3,"file":"ValidDictionaryChangeButtons.d.ts","sourceRoot":"","sources":["../../../src/components/DictionaryEditor/ValidDictionaryChangeButtons.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAMjD,OAAO,EAAwB,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAOtD,KAAK,iCAAiC,GAAG;IACvC,UAAU,EAAE,UAAU,CAAC;IACvB,IAAI,EAAE,OAAO,GAAG,QAAQ,CAAC;CAC1B,CAAC;AAEF,eAAO,MAAM,4BAA4B,EAAE,EAAE,CAC3C,iCAAiC,CAgIlC,CAAC"}
@@ -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';\n// @ts-ignore react-intlayer not build yet\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}\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}\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}\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}\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":";;;;;;;;;;;;;;;AAsBO,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,EA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AAC,YAAY;AAAA,YACvB,WAAU;AAAA,YACV,MAAM;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;AAAA,YACrB,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;AAAA,YAClB,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;AAAA,YACtB,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;"}
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,eAAe,qBAAqB,IAAI,iBAAiB;AAC3D,QAAA,EAAE,MAA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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;"}
@@ -2,20 +2,126 @@ export declare const validDictionaryChangeButtonsContent: {
2
2
  key: string;
3
3
  content: {
4
4
  resetButton: {
5
- text: import('@intlayer/core').TranslationContent<string>;
6
- label: import('@intlayer/core').TranslationContent<string>;
5
+ text: import('@intlayer/core').TypedNodeModel<import("@intlayer/core").NodeType.Translation, {
6
+ en: string;
7
+ fr: string;
8
+ es: string;
9
+ de: string;
10
+ ja: string;
11
+ ko: string;
12
+ zh: string;
13
+ it: string;
14
+ pt: string;
15
+ hi: string;
16
+ ar: string;
17
+ ru: string;
18
+ }>;
19
+ label: import('@intlayer/core').TypedNodeModel<import("@intlayer/core").NodeType.Translation, {
20
+ en: string;
21
+ fr: string;
22
+ es: string;
23
+ de: string;
24
+ ja: string;
25
+ ko: string;
26
+ zh: string;
27
+ it: string;
28
+ pt: string;
29
+ hi: string;
30
+ ar: string;
31
+ ru: string;
32
+ }>;
7
33
  };
8
34
  saveButton: {
9
- text: import('@intlayer/core').TranslationContent<string>;
10
- label: import('@intlayer/core').TranslationContent<string>;
35
+ text: import('@intlayer/core').TypedNodeModel<import("@intlayer/core").NodeType.Translation, {
36
+ en: string;
37
+ fr: string;
38
+ es: string;
39
+ de: string;
40
+ ja: string;
41
+ ko: string;
42
+ zh: string;
43
+ it: string;
44
+ pt: string;
45
+ hi: string;
46
+ ar: string;
47
+ ru: string;
48
+ }>;
49
+ label: import('@intlayer/core').TypedNodeModel<import("@intlayer/core").NodeType.Translation, {
50
+ en: string;
51
+ fr: string;
52
+ es: string;
53
+ de: string;
54
+ ja: string;
55
+ ko: string;
56
+ zh: string;
57
+ it: string;
58
+ pt: string;
59
+ hi: string;
60
+ ar: string;
61
+ ru: string;
62
+ }>;
11
63
  };
12
64
  publishButton: {
13
- text: import('@intlayer/core').TranslationContent<string>;
14
- label: import('@intlayer/core').TranslationContent<string>;
65
+ text: import('@intlayer/core').TypedNodeModel<import("@intlayer/core").NodeType.Translation, {
66
+ en: string;
67
+ fr: string;
68
+ es: string;
69
+ de: string;
70
+ ja: string;
71
+ ko: string;
72
+ zh: string;
73
+ it: string;
74
+ pt: string;
75
+ hi: string;
76
+ ar: string;
77
+ ru: string;
78
+ }>;
79
+ label: import('@intlayer/core').TypedNodeModel<import("@intlayer/core").NodeType.Translation, {
80
+ en: string;
81
+ fr: string;
82
+ es: string;
83
+ de: string;
84
+ ja: string;
85
+ ko: string;
86
+ zh: string;
87
+ it: string;
88
+ pt: string;
89
+ hi: string;
90
+ ar: string;
91
+ ru: string;
92
+ }>;
15
93
  };
16
94
  downloadButton: {
17
- text: import('@intlayer/core').TranslationContent<string>;
18
- label: import('@intlayer/core').TranslationContent<string>;
95
+ text: import('@intlayer/core').TypedNodeModel<import("@intlayer/core").NodeType.Translation, {
96
+ en: string;
97
+ 'en-GB': string;
98
+ fr: string;
99
+ es: string;
100
+ de: string;
101
+ ja: string;
102
+ ko: string;
103
+ zh: string;
104
+ it: string;
105
+ pt: string;
106
+ hi: string;
107
+ ar: string;
108
+ ru: string;
109
+ }>;
110
+ label: import('@intlayer/core').TypedNodeModel<import("@intlayer/core").NodeType.Translation, {
111
+ en: string;
112
+ 'en-GB': string;
113
+ fr: string;
114
+ es: string;
115
+ de: string;
116
+ ja: string;
117
+ ko: string;
118
+ zh: string;
119
+ it: string;
120
+ pt: string;
121
+ hi: string;
122
+ ar: string;
123
+ ru: string;
124
+ }>;
19
125
  };
20
126
  };
21
127
  };
@@ -1 +1 @@
1
- {"version":3,"file":"validDictionaryChangeButtons.content.d.ts","sourceRoot":"","sources":["../../../src/components/DictionaryEditor/validDictionaryChangeButtons.content.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,mCAAmC;;;;;;;;;;;;;;;;;;;;CA8H1B,CAAC"}
1
+ {"version":3,"file":"validDictionaryChangeButtons.content.d.ts","sourceRoot":"","sources":["../../../src/components/DictionaryEditor/validDictionaryChangeButtons.content.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,mCAAmC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8H1B,CAAC"}
@@ -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';\n// @ts-ignore react-intlayer not build yet\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":";;;;;;;;;;;;;;;;AAmBO,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;;"}
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;;"}
@@ -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;AAQzC,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"}
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"}
@@ -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';\n// @ts-ignore react-intlayer not build yet\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":";;;;;;;;;;;;;;AAmBO,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;"}
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;"}
@@ -1,8 +1,36 @@
1
1
  export declare const dictionariesSelectorContent: {
2
2
  key: string;
3
3
  content: {
4
- noDictionaryMessage: import('@intlayer/core').TranslationContent<string>;
5
- dictionaryNotFoundMessage: import('@intlayer/core').TranslationContent<string>;
4
+ noDictionaryMessage: import('@intlayer/core').TypedNodeModel<import("@intlayer/core").NodeType.Translation, {
5
+ en: string;
6
+ 'en-GB': string;
7
+ fr: string;
8
+ es: string;
9
+ de: string;
10
+ ja: string;
11
+ ko: string;
12
+ zh: string;
13
+ it: string;
14
+ pt: string;
15
+ hi: string;
16
+ ar: string;
17
+ ru: string;
18
+ }>;
19
+ dictionaryNotFoundMessage: import('@intlayer/core').TypedNodeModel<import("@intlayer/core").NodeType.Translation, {
20
+ en: string;
21
+ 'en-GB': string;
22
+ fr: string;
23
+ es: string;
24
+ de: string;
25
+ ja: string;
26
+ ko: string;
27
+ zh: string;
28
+ it: string;
29
+ pt: string;
30
+ hi: string;
31
+ ar: string;
32
+ ru: string;
33
+ }>;
6
34
  };
7
35
  };
8
36
  //# sourceMappingURL=dictionariesSelector.content.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"dictionariesSelector.content.d.ts","sourceRoot":"","sources":["../../../../src/components/DictionaryFieldEditor/DictionariesSelector/dictionariesSelector.content.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,2BAA2B;;;;;;CAkClB,CAAC"}
1
+ {"version":3,"file":"dictionariesSelector.content.d.ts","sourceRoot":"","sources":["../../../../src/components/DictionaryFieldEditor/DictionariesSelector/dictionariesSelector.content.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkClB,CAAC"}
@@ -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-ZARcTrR0.cjs");
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
  )
@@ -1 +1 @@
1
- {"version":3,"file":"DictionaryCreationForm.cjs","sources":["../../../../src/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.tsx"],"sourcesContent":["'use client';\n\nimport { type FC } from 'react';\n// @ts-ignore react-intlayer not build yet\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}\n placeholder={keyInput.placeholder}\n isRequired\n />\n\n <Form.MultiSelect name=\"projectIds\" label={projectInput.label}>\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 <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}\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBO,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,UAA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B,UAAuB,uBAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MAC1B;AAAA,IAAA;AAAA,EACF;AAEJ;;"}
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,MACA,WAAU;AAAA,MACT,GAAG;AAAA,MAEJ,UAAA;AAAA,QAAAC,2BAAA,kBAAA;AAAA,UAACD,sCAAAA,KAAK;AAAA,UAAL;AAAA,YACC,MAAK;AAAA,YACL,OAAO,SAAS,MAAM;AAAA,YACtB,aAAa,SAAS,YAAY;AAAA,YAClC,YAAU;AAAA,UAAA;AAAA,QACZ;AAAA,QAEAD,2BAAAA,kBAAAA,KAACC,2CAAK,aAAL,EAAiB,MAAK,cAAa,OAAO,aAAa,MAAM,OAC5D,UAAA;AAAA,UAAAC,2BAAA,kBAAA;AAAA,YAACC,8BAAAA,YAAY;AAAA,YAAZ;AAAA,cACC,eAAe,CAAC,UACd,UAAU,MAAM,KAAK,CAACC,aAAY,OAAOA,SAAQ,GAAG,MAAM,KAAK,GAC3D,QAAQ;AAAA,cAGd,2DAACD,8BAAAA,YAAY,OAAZ,EAAkB,aAAa,aAAa,YAAY,MAAO,CAAA;AAAA,YAAA;AAAA,UAClE;AAAA,UACCD,2BAAAA,kBAAAA,IAAAC,8BAAAA,YAAY,SAAZ,EACC,UAACD,2BAAA,kBAAA,IAAAC,8BAAA,YAAY,MAAZ,EACE,UAAU,UAAA,MAAM,IAAI,CAACC,aACpBF,2BAAA,kBAAA;AAAA,YAACC,8BAAAA,YAAY;AAAA,YAAZ;AAAA,cAEC,OAAO,OAAOC,SAAQ,GAAG;AAAA,cAExB,UAAAA,SAAQ;AAAA,YAAA;AAAA,YAHJ,OAAOA,SAAQ,GAAG;AAAA,UAK1B,CAAA,EACH,CAAA,EACF,CAAA;AAAA,QAAA,GACF;AAAA,QAEAF,2BAAA,kBAAA;AAAA,UAACD,sCAAAA,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;;"}
@@ -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;AAgBhC,eAAO,MAAM,sBAAsB,EAAE,EA+DpC,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"}
@@ -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-Di_3dNqI.js";
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
  )
@@ -1 +1 @@
1
- {"version":3,"file":"DictionaryCreationForm.mjs","sources":["../../../../src/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.tsx"],"sourcesContent":["'use client';\n\nimport { type FC } from 'react';\n// @ts-ignore react-intlayer not build yet\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}\n placeholder={keyInput.placeholder}\n isRequired\n />\n\n <Form.MultiSelect name=\"projectIds\" label={projectInput.label}>\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 <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}\n >\n {createDictionaryButton.text}\n </Form.Button>\n </Form>\n );\n};\n"],"names":["jsxs","jsx","project"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBO,MAAM,yBAA6B,MAAM;AACxC,QAAA,EAAE,QAAQ,IAAI,QAAQ;AAC5B,QAAM,EAAE,YAAY,WAAW,CAAC;AAC1B,QAAA,EAAE,cAAc,IAAI,iBAAiB;AAC3C,QAAM,EAAE,MAAM,SAAS,IAAI,eAAe;AAC1C,QAAM,mBAAmB,oBAAoB,OAAO,SAAS,GAAG,CAAC;AACjE,QAAM,EAAE,MAAM,iBAAiB,QAAQ,gBAAgB;AACvD,QAAM,EAAE,UAAU,wBAAwB,aAAiB,IAAA;AAAA,IACzD;AAAA,EACF;AAEM,QAAA,kBAAkB,OAAO,SAA6B;AAC1D,UAAM,cAAc,IAAI;AAAA,EAC1B;AAGE,SAAAA,kCAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,QAAQ;AAAA,MACR;AAAA,MACA,WAAU;AAAA,MACT,GAAG;AAAA,MAEJ,UAAA;AAAA,QAAAC,kCAAA;AAAA,UAAC,KAAK;AAAA,UAAL;AAAA,YACC,MAAK;AAAA,YACL,OAAO,SAAS;AAAA,YAChB,aAAa,SAAS;AAAA,YACtB,YAAU;AAAA,UAAA;AAAA,QACZ;AAAA,QAEAD,uCAAC,KAAK,aAAL,EAAiB,MAAK,cAAa,OAAO,aAAa,OACtD,UAAA;AAAA,UAAAC,kCAAA;AAAA,YAAC,YAAY;AAAA,YAAZ;AAAA,cACC,eAAe,CAAC,UACd,UAAU,MAAM,KAAK,CAACC,aAAY,OAAOA,SAAQ,GAAG,MAAM,KAAK,GAC3D,QAAQ;AAAA,cAGd,gDAAC,YAAY,OAAZ,EAAkB,aAAa,aAAa,YAAa,CAAA;AAAA,YAAA;AAAA,UAC5D;AAAA,UACCD,kCAAAA,IAAA,YAAY,SAAZ,EACC,UAACA,kCAAA,IAAA,YAAY,MAAZ,EACE,UAAU,UAAA,MAAM,IAAI,CAACC,aACpBD,kCAAA;AAAA,YAAC,YAAY;AAAA,YAAZ;AAAA,cAEC,OAAO,OAAOC,SAAQ,GAAG;AAAA,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;AAAA,YAE7B,UAAuB,uBAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MAC1B;AAAA,IAAA;AAAA,EACF;AAEJ;"}
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;AACxC,QAAA,EAAE,QAAQ,IAAI,QAAQ;AAC5B,QAAM,EAAE,YAAY,WAAW,CAAC;AAC1B,QAAA,EAAE,cAAc,IAAI,iBAAiB;AAC3C,QAAM,EAAE,MAAM,SAAS,IAAI,eAAe;AAC1C,QAAM,mBAAmB,oBAAoB,OAAO,SAAS,GAAG,CAAC;AACjE,QAAM,EAAE,MAAM,iBAAiB,QAAQ,gBAAgB;AACvD,QAAM,EAAE,UAAU,wBAAwB,aAAiB,IAAA;AAAA,IACzD;AAAA,EACF;AAEM,QAAA,kBAAkB,OAAO,SAA6B;AAC1D,UAAM,cAAc,IAAI;AAAA,EAC1B;AAGE,SAAAA,kCAA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