@intlayer/design-system 5.1.4 → 5.1.6

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 (557) hide show
  1. package/dist/.vite/manifest.json +173 -132
  2. package/dist/{Form-yi0CMK-a.cjs → Form-BpxW17v4.cjs} +3 -3
  3. package/dist/Form-BpxW17v4.cjs.map +1 -0
  4. package/dist/{Form-BZUDRfoN.js → Form-MjLzPGze.js} +3 -3
  5. package/dist/Form-MjLzPGze.js.map +1 -0
  6. package/dist/components/Accordion/Accordion.cjs +1 -1
  7. package/dist/components/Accordion/Accordion.cjs.map +1 -1
  8. package/dist/components/Accordion/Accordion.mjs +1 -1
  9. package/dist/components/Accordion/Accordion.mjs.map +1 -1
  10. package/dist/components/Auth/AuthModal/index.cjs +1 -10
  11. package/dist/components/Auth/AuthModal/index.cjs.map +1 -1
  12. package/dist/components/Auth/AuthModal/index.d.ts.map +1 -1
  13. package/dist/components/Auth/AuthModal/index.mjs +1 -10
  14. package/dist/components/Auth/AuthModal/index.mjs.map +1 -1
  15. package/dist/components/Auth/ChangePasswordForm/ChangePasswordForm.cjs +4 -16
  16. package/dist/components/Auth/ChangePasswordForm/ChangePasswordForm.cjs.map +1 -1
  17. package/dist/components/Auth/ChangePasswordForm/ChangePasswordForm.d.ts +0 -1
  18. package/dist/components/Auth/ChangePasswordForm/ChangePasswordForm.d.ts.map +1 -1
  19. package/dist/components/Auth/ChangePasswordForm/ChangePasswordForm.mjs +4 -16
  20. package/dist/components/Auth/ChangePasswordForm/ChangePasswordForm.mjs.map +1 -1
  21. package/dist/components/Auth/ChangePasswordForm/changePasswordForm.content.cjs +0 -32
  22. package/dist/components/Auth/ChangePasswordForm/changePasswordForm.content.cjs.map +1 -1
  23. package/dist/components/Auth/ChangePasswordForm/changePasswordForm.content.d.ts +0 -32
  24. package/dist/components/Auth/ChangePasswordForm/changePasswordForm.content.d.ts.map +1 -1
  25. package/dist/components/Auth/ChangePasswordForm/changePasswordForm.content.mjs +0 -32
  26. package/dist/components/Auth/ChangePasswordForm/changePasswordForm.content.mjs.map +1 -1
  27. package/dist/components/Auth/DefineNewPasswordForm/DefineNewPasswordForm.cjs +81 -0
  28. package/dist/components/Auth/DefineNewPasswordForm/DefineNewPasswordForm.cjs.map +1 -0
  29. package/dist/components/Auth/DefineNewPasswordForm/DefineNewPasswordForm.d.ts +9 -0
  30. package/dist/components/Auth/DefineNewPasswordForm/DefineNewPasswordForm.d.ts.map +1 -0
  31. package/dist/components/Auth/DefineNewPasswordForm/DefineNewPasswordForm.mjs +81 -0
  32. package/dist/components/Auth/DefineNewPasswordForm/DefineNewPasswordForm.mjs.map +1 -0
  33. package/dist/components/Auth/DefineNewPasswordForm/defineNewPasswordForm.content.cjs +106 -0
  34. package/dist/components/Auth/DefineNewPasswordForm/defineNewPasswordForm.content.cjs.map +1 -0
  35. package/dist/components/{DictionaryEditor/validDictionaryChangeButtons.content.d.ts → Auth/DefineNewPasswordForm/defineNewPasswordForm.content.d.ts} +15 -41
  36. package/dist/components/Auth/DefineNewPasswordForm/defineNewPasswordForm.content.d.ts.map +1 -0
  37. package/dist/components/Auth/DefineNewPasswordForm/defineNewPasswordForm.content.mjs +106 -0
  38. package/dist/components/Auth/DefineNewPasswordForm/defineNewPasswordForm.content.mjs.map +1 -0
  39. package/dist/components/Auth/DefineNewPasswordForm/index.cjs +7 -0
  40. package/dist/components/Auth/DefineNewPasswordForm/index.cjs.map +1 -0
  41. package/dist/components/Auth/DefineNewPasswordForm/index.d.ts +3 -0
  42. package/dist/components/Auth/DefineNewPasswordForm/index.d.ts.map +1 -0
  43. package/dist/components/Auth/DefineNewPasswordForm/index.mjs +7 -0
  44. package/dist/components/Auth/DefineNewPasswordForm/index.mjs.map +1 -0
  45. package/dist/components/Auth/DefineNewPasswordForm/useDefineNewPasswordSchema.cjs +31 -0
  46. package/dist/components/Auth/DefineNewPasswordForm/useDefineNewPasswordSchema.cjs.map +1 -0
  47. package/dist/components/Auth/DefineNewPasswordForm/useDefineNewPasswordSchema.content.cjs +101 -0
  48. package/dist/components/Auth/DefineNewPasswordForm/useDefineNewPasswordSchema.content.cjs.map +1 -0
  49. package/dist/components/Auth/DefineNewPasswordForm/useDefineNewPasswordSchema.content.d.ts +97 -0
  50. package/dist/components/Auth/DefineNewPasswordForm/useDefineNewPasswordSchema.content.d.ts.map +1 -0
  51. package/dist/components/Auth/DefineNewPasswordForm/useDefineNewPasswordSchema.content.mjs +101 -0
  52. package/dist/components/Auth/DefineNewPasswordForm/useDefineNewPasswordSchema.content.mjs.map +1 -0
  53. package/dist/components/Auth/DefineNewPasswordForm/useDefineNewPasswordSchema.d.ts +19 -0
  54. package/dist/components/Auth/DefineNewPasswordForm/useDefineNewPasswordSchema.d.ts.map +1 -0
  55. package/dist/components/Auth/DefineNewPasswordForm/useDefineNewPasswordSchema.mjs +31 -0
  56. package/dist/components/Auth/DefineNewPasswordForm/useDefineNewPasswordSchema.mjs.map +1 -0
  57. package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.cjs +27 -9
  58. package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.cjs.map +1 -1
  59. package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.d.ts +7 -3
  60. package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.d.ts.map +1 -1
  61. package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.mjs +27 -9
  62. package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.mjs.map +1 -1
  63. package/dist/components/Auth/ResetPasswordForm/ResetPasswordForm.cjs +2 -1
  64. package/dist/components/Auth/ResetPasswordForm/ResetPasswordForm.cjs.map +1 -1
  65. package/dist/components/Auth/ResetPasswordForm/ResetPasswordForm.d.ts.map +1 -1
  66. package/dist/components/Auth/ResetPasswordForm/ResetPasswordForm.mjs +2 -1
  67. package/dist/components/Auth/ResetPasswordForm/ResetPasswordForm.mjs.map +1 -1
  68. package/dist/components/Auth/SignInForm/SignInForm.cjs +2 -2
  69. package/dist/components/Auth/SignInForm/SignInForm.cjs.map +1 -1
  70. package/dist/components/Auth/SignInForm/SignInForm.mjs +2 -2
  71. package/dist/components/Auth/SignInForm/SignInForm.mjs.map +1 -1
  72. package/dist/components/Auth/SignUpForm/SignUpForm.cjs +2 -2
  73. package/dist/components/Auth/SignUpForm/SignUpForm.cjs.map +1 -1
  74. package/dist/components/Auth/SignUpForm/SignUpForm.mjs +2 -2
  75. package/dist/components/Auth/SignUpForm/SignUpForm.mjs.map +1 -1
  76. package/dist/components/Auth/VerifyEmailForm/VerifyEmailForm.cjs +3 -3
  77. package/dist/components/Auth/VerifyEmailForm/VerifyEmailForm.cjs.map +1 -1
  78. package/dist/components/Auth/VerifyEmailForm/VerifyEmailForm.d.ts.map +1 -1
  79. package/dist/components/Auth/VerifyEmailForm/VerifyEmailForm.mjs +3 -3
  80. package/dist/components/Auth/VerifyEmailForm/VerifyEmailForm.mjs.map +1 -1
  81. package/dist/components/Auth/index.cjs +4 -0
  82. package/dist/components/Auth/index.cjs.map +1 -1
  83. package/dist/components/Auth/index.d.ts +1 -0
  84. package/dist/components/Auth/index.d.ts.map +1 -1
  85. package/dist/components/Auth/index.mjs +4 -0
  86. package/dist/components/Auth/index.mjs.map +1 -1
  87. package/dist/components/Auth/useAuth/index.cjs +1 -0
  88. package/dist/components/Auth/useAuth/index.cjs.map +1 -1
  89. package/dist/components/Auth/useAuth/index.d.ts +1 -0
  90. package/dist/components/Auth/useAuth/index.d.ts.map +1 -1
  91. package/dist/components/Auth/useAuth/index.mjs +1 -0
  92. package/dist/components/Auth/useAuth/index.mjs.map +1 -1
  93. package/dist/components/Avatar/index.cjs +2 -2
  94. package/dist/components/Avatar/index.cjs.map +1 -1
  95. package/dist/components/Avatar/index.mjs +2 -2
  96. package/dist/components/Avatar/index.mjs.map +1 -1
  97. package/dist/components/Badge/index.cjs +11 -11
  98. package/dist/components/Badge/index.cjs.map +1 -1
  99. package/dist/components/Badge/index.d.ts +2 -2
  100. package/dist/components/Badge/index.d.ts.map +1 -1
  101. package/dist/components/Badge/index.mjs +11 -11
  102. package/dist/components/Badge/index.mjs.map +1 -1
  103. package/dist/components/Button/Button.cjs +25 -25
  104. package/dist/components/Button/Button.cjs.map +1 -1
  105. package/dist/components/Button/Button.d.ts +3 -3
  106. package/dist/components/Button/Button.d.ts.map +1 -1
  107. package/dist/components/Button/Button.mjs +25 -25
  108. package/dist/components/Button/Button.mjs.map +1 -1
  109. package/dist/components/Command/index.cjs +2 -2
  110. package/dist/components/Command/index.cjs.map +1 -1
  111. package/dist/components/Command/index.d.ts +1 -1
  112. package/dist/components/Command/index.d.ts.map +1 -1
  113. package/dist/components/Command/index.mjs +2 -2
  114. package/dist/components/Command/index.mjs.map +1 -1
  115. package/dist/components/Container/index.cjs +67 -83
  116. package/dist/components/Container/index.cjs.map +1 -1
  117. package/dist/components/Container/index.d.ts +5 -6
  118. package/dist/components/Container/index.d.ts.map +1 -1
  119. package/dist/components/Container/index.mjs +67 -83
  120. package/dist/components/Container/index.mjs.map +1 -1
  121. package/dist/components/ContentEditor/ContentEditor.cjs +1 -1
  122. package/dist/components/ContentEditor/ContentEditor.cjs.map +1 -1
  123. package/dist/components/ContentEditor/ContentEditor.mjs +1 -1
  124. package/dist/components/ContentEditor/ContentEditor.mjs.map +1 -1
  125. package/dist/components/ContentEditor/ContentEditorTextArea.cjs +2 -2
  126. package/dist/components/ContentEditor/ContentEditorTextArea.cjs.map +1 -1
  127. package/dist/components/ContentEditor/ContentEditorTextArea.d.ts.map +1 -1
  128. package/dist/components/ContentEditor/ContentEditorTextArea.mjs +2 -2
  129. package/dist/components/ContentEditor/ContentEditorTextArea.mjs.map +1 -1
  130. package/dist/components/DictionaryEditor/DictionaryEditor.cjs +4 -4
  131. package/dist/components/DictionaryEditor/DictionaryEditor.cjs.map +1 -1
  132. package/dist/components/DictionaryEditor/DictionaryEditor.d.ts +1 -1
  133. package/dist/components/DictionaryEditor/DictionaryEditor.d.ts.map +1 -1
  134. package/dist/components/DictionaryEditor/DictionaryEditor.mjs +4 -4
  135. package/dist/components/DictionaryEditor/DictionaryEditor.mjs.map +1 -1
  136. package/dist/components/DictionaryEditor/ItemLayout.cjs +3 -3
  137. package/dist/components/DictionaryEditor/ItemLayout.cjs.map +1 -1
  138. package/dist/components/DictionaryEditor/ItemLayout.mjs +3 -3
  139. package/dist/components/DictionaryEditor/ItemLayout.mjs.map +1 -1
  140. package/dist/components/DictionaryEditor/NodeWrapper/ArrayWrapper.cjs +1 -1
  141. package/dist/components/DictionaryEditor/NodeWrapper/ArrayWrapper.mjs +1 -1
  142. package/dist/components/DictionaryEditor/NodeWrapper/ConditionWrapper.cjs +1 -1
  143. package/dist/components/DictionaryEditor/NodeWrapper/ConditionWrapper.mjs +1 -1
  144. package/dist/components/DictionaryEditor/NodeWrapper/EnumerationWrapper.cjs +1 -1
  145. package/dist/components/DictionaryEditor/NodeWrapper/EnumerationWrapper.mjs +1 -1
  146. package/dist/components/DictionaryEditor/NodeWrapper/MarkdownWrapper.cjs +1 -1
  147. package/dist/components/DictionaryEditor/NodeWrapper/MarkdownWrapper.mjs +1 -1
  148. package/dist/components/DictionaryEditor/NodeWrapper/NestedObjectWrapper.cjs +1 -1
  149. package/dist/components/DictionaryEditor/NodeWrapper/NestedObjectWrapper.mjs +1 -1
  150. package/dist/components/DictionaryEditor/NodeWrapper/StringWrapper.cjs +2 -2
  151. package/dist/components/DictionaryEditor/NodeWrapper/StringWrapper.cjs.map +1 -1
  152. package/dist/components/DictionaryEditor/NodeWrapper/StringWrapper.mjs +2 -2
  153. package/dist/components/DictionaryEditor/NodeWrapper/StringWrapper.mjs.map +1 -1
  154. package/dist/components/DictionaryEditor/NodeWrapper/TranslationWrapper.cjs +1 -1
  155. package/dist/components/DictionaryEditor/NodeWrapper/TranslationWrapper.mjs +1 -1
  156. package/dist/components/DictionaryEditor/NodeWrapper/index.cjs +1 -1
  157. package/dist/components/DictionaryEditor/NodeWrapper/index.d.ts.map +1 -1
  158. package/dist/components/DictionaryEditor/NodeWrapper/index.mjs +1 -1
  159. package/dist/components/DictionaryFieldEditor/ContentEditor.cjs +4 -3
  160. package/dist/components/DictionaryFieldEditor/ContentEditor.cjs.map +1 -1
  161. package/dist/components/DictionaryFieldEditor/ContentEditor.d.ts.map +1 -1
  162. package/dist/components/DictionaryFieldEditor/ContentEditor.mjs +5 -4
  163. package/dist/components/DictionaryFieldEditor/ContentEditor.mjs.map +1 -1
  164. package/dist/components/DictionaryFieldEditor/ContentEditorView/TextEditor.cjs +15 -9
  165. package/dist/components/DictionaryFieldEditor/ContentEditorView/TextEditor.cjs.map +1 -1
  166. package/dist/components/DictionaryFieldEditor/ContentEditorView/TextEditor.d.ts.map +1 -1
  167. package/dist/components/DictionaryFieldEditor/ContentEditorView/TextEditor.mjs +15 -9
  168. package/dist/components/DictionaryFieldEditor/ContentEditorView/TextEditor.mjs.map +1 -1
  169. package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.cjs +13 -9
  170. package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.cjs.map +1 -1
  171. package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.d.ts.map +1 -1
  172. package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.mjs +13 -9
  173. package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.mjs.map +1 -1
  174. package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.cjs +94 -134
  175. package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.cjs.map +1 -1
  176. package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.d.ts +0 -1
  177. package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.d.ts.map +1 -1
  178. package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.mjs +98 -138
  179. package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.mjs.map +1 -1
  180. package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.cjs +0 -143
  181. package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.cjs.map +1 -1
  182. package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.d.ts +0 -143
  183. package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.d.ts.map +1 -1
  184. package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.mjs +0 -143
  185. package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.mjs.map +1 -1
  186. package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.cjs +1 -2
  187. package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.cjs.map +1 -1
  188. package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.d.ts +0 -3
  189. package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.d.ts.map +1 -1
  190. package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.mjs +1 -2
  191. package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.mjs.map +1 -1
  192. package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.cjs +52 -71
  193. package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.cjs.map +1 -1
  194. package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.d.ts +1 -1
  195. package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.d.ts.map +1 -1
  196. package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.mjs +52 -71
  197. package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.mjs.map +1 -1
  198. package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.cjs +65 -97
  199. package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.cjs.map +1 -1
  200. package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.d.ts +3 -3
  201. package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.d.ts.map +1 -1
  202. package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.mjs +68 -100
  203. package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.mjs.map +1 -1
  204. package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.cjs +0 -32
  205. package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.cjs.map +1 -1
  206. package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.d.ts +0 -32
  207. package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.d.ts.map +1 -1
  208. package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.mjs +0 -32
  209. package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.mjs.map +1 -1
  210. package/dist/components/DictionaryFieldEditor/StructureView/StructureView.cjs +9 -2
  211. package/dist/components/DictionaryFieldEditor/StructureView/StructureView.cjs.map +1 -1
  212. package/dist/components/DictionaryFieldEditor/StructureView/StructureView.d.ts.map +1 -1
  213. package/dist/components/DictionaryFieldEditor/StructureView/StructureView.mjs +9 -2
  214. package/dist/components/DictionaryFieldEditor/StructureView/StructureView.mjs.map +1 -1
  215. package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.cjs +3 -3
  216. package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.cjs.map +1 -1
  217. package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.mjs +3 -3
  218. package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.mjs.map +1 -1
  219. package/dist/components/DictionaryFieldEditor/index.cjs +0 -2
  220. package/dist/components/DictionaryFieldEditor/index.cjs.map +1 -1
  221. package/dist/components/DictionaryFieldEditor/index.d.ts +0 -1
  222. package/dist/components/DictionaryFieldEditor/index.d.ts.map +1 -1
  223. package/dist/components/DictionaryFieldEditor/index.mjs +0 -2
  224. package/dist/components/DictionaryFieldEditor/index.mjs.map +1 -1
  225. package/dist/components/EditableField/EditableFieldTextArea.cjs +7 -0
  226. package/dist/components/EditableField/EditableFieldTextArea.cjs.map +1 -1
  227. package/dist/components/EditableField/EditableFieldTextArea.mjs +7 -0
  228. package/dist/components/EditableField/EditableFieldTextArea.mjs.map +1 -1
  229. package/dist/components/Footer/index.cjs +1 -1
  230. package/dist/components/Footer/index.cjs.map +1 -1
  231. package/dist/components/Footer/index.mjs +1 -1
  232. package/dist/components/Footer/index.mjs.map +1 -1
  233. package/dist/components/Form/Form.cjs +1 -1
  234. package/dist/components/Form/Form.mjs +1 -1
  235. package/dist/components/Form/FormBase.cjs +0 -1
  236. package/dist/components/Form/FormBase.cjs.map +1 -1
  237. package/dist/components/Form/FormBase.d.ts +1 -4
  238. package/dist/components/Form/FormBase.d.ts.map +1 -1
  239. package/dist/components/Form/FormBase.mjs +0 -1
  240. package/dist/components/Form/FormBase.mjs.map +1 -1
  241. package/dist/components/Form/FormDescription.cjs +1 -8
  242. package/dist/components/Form/FormDescription.cjs.map +1 -1
  243. package/dist/components/Form/FormDescription.d.ts.map +1 -1
  244. package/dist/components/Form/FormDescription.mjs +1 -8
  245. package/dist/components/Form/FormDescription.mjs.map +1 -1
  246. package/dist/components/Form/FormItem.cjs +1 -1
  247. package/dist/components/Form/FormItem.cjs.map +1 -1
  248. package/dist/components/Form/FormItem.mjs +1 -1
  249. package/dist/components/Form/FormItem.mjs.map +1 -1
  250. package/dist/components/Form/FormLabel.cjs +1 -5
  251. package/dist/components/Form/FormLabel.cjs.map +1 -1
  252. package/dist/components/Form/FormLabel.d.ts.map +1 -1
  253. package/dist/components/Form/FormLabel.mjs +1 -5
  254. package/dist/components/Form/FormLabel.mjs.map +1 -1
  255. package/dist/components/Form/FormMessage.cjs +1 -1
  256. package/dist/components/Form/FormMessage.cjs.map +1 -1
  257. package/dist/components/Form/FormMessage.mjs +1 -1
  258. package/dist/components/Form/FormMessage.mjs.map +1 -1
  259. package/dist/components/Form/elements/AutoSizeTextAreaElement.cjs +1 -1
  260. package/dist/components/Form/elements/AutoSizeTextAreaElement.mjs +1 -1
  261. package/dist/components/Form/elements/CheckboxElement.cjs +1 -1
  262. package/dist/components/Form/elements/CheckboxElement.mjs +1 -1
  263. package/dist/components/Form/elements/EditableFieldInputElement.cjs +1 -1
  264. package/dist/components/Form/elements/EditableFieldInputElement.d.ts +1 -1
  265. package/dist/components/Form/elements/EditableFieldInputElement.d.ts.map +1 -1
  266. package/dist/components/Form/elements/EditableFieldInputElement.mjs +1 -1
  267. package/dist/components/Form/elements/EditableFieldTextAreaElement.cjs +1 -1
  268. package/dist/components/Form/elements/EditableFieldTextAreaElement.d.ts +1 -1
  269. package/dist/components/Form/elements/EditableFieldTextAreaElement.d.ts.map +1 -1
  270. package/dist/components/Form/elements/EditableFieldTextAreaElement.mjs +1 -1
  271. package/dist/components/Form/elements/FormElement.cjs +1 -1
  272. package/dist/components/Form/elements/FormElement.mjs +1 -1
  273. package/dist/components/Form/elements/InputElement.cjs +1 -1
  274. package/dist/components/Form/elements/InputElement.mjs +1 -1
  275. package/dist/components/Form/elements/InputPasswordElement.cjs +1 -1
  276. package/dist/components/Form/elements/InputPasswordElement.mjs +1 -1
  277. package/dist/components/Form/elements/MultiselectElement.cjs +1 -1
  278. package/dist/components/Form/elements/MultiselectElement.mjs +1 -1
  279. package/dist/components/Form/elements/SelectElement.cjs +1 -1
  280. package/dist/components/Form/elements/SelectElement.mjs +1 -1
  281. package/dist/components/Form/elements/SwitchSelectorElement.cjs +1 -1
  282. package/dist/components/Form/elements/SwitchSelectorElement.mjs +1 -1
  283. package/dist/components/Form/elements/TextAreaElement.cjs +1 -1
  284. package/dist/components/Form/elements/TextAreaElement.mjs +1 -1
  285. package/dist/components/Form/elements/index.cjs +1 -1
  286. package/dist/components/Form/elements/index.mjs +1 -1
  287. package/dist/components/Form/index.cjs +1 -1
  288. package/dist/components/Form/index.mjs +1 -1
  289. package/dist/components/Form/layout/FormItemLayout.cjs +1 -1
  290. package/dist/components/Form/layout/FormItemLayout.mjs +1 -1
  291. package/dist/components/Form/layout/index.cjs +1 -1
  292. package/dist/components/Form/layout/index.mjs +1 -1
  293. package/dist/components/Headers/index.cjs +1 -1
  294. package/dist/components/Headers/index.cjs.map +1 -1
  295. package/dist/components/Headers/index.mjs +1 -1
  296. package/dist/components/Headers/index.mjs.map +1 -1
  297. package/dist/components/IDE/Code.cjs +1 -1
  298. package/dist/components/IDE/Code.cjs.map +1 -1
  299. package/dist/components/IDE/Code.mjs +1 -1
  300. package/dist/components/IDE/Code.mjs.map +1 -1
  301. package/dist/components/IDE/CodeBlockClient.cjs +8 -1
  302. package/dist/components/IDE/CodeBlockClient.cjs.map +1 -1
  303. package/dist/components/IDE/CodeBlockClient.d.ts.map +1 -1
  304. package/dist/components/IDE/CodeBlockClient.mjs +8 -1
  305. package/dist/components/IDE/CodeBlockClient.mjs.map +1 -1
  306. package/dist/components/IDE/CodeBlockServer.cjs +8 -1
  307. package/dist/components/IDE/CodeBlockServer.cjs.map +1 -1
  308. package/dist/components/IDE/CodeBlockServer.d.ts.map +1 -1
  309. package/dist/components/IDE/CodeBlockServer.mjs +8 -1
  310. package/dist/components/IDE/CodeBlockServer.mjs.map +1 -1
  311. package/dist/components/IDE/FileList.cjs +1 -1
  312. package/dist/components/IDE/FileList.cjs.map +1 -1
  313. package/dist/components/IDE/FileList.mjs +1 -1
  314. package/dist/components/IDE/FileList.mjs.map +1 -1
  315. package/dist/components/IDE/FileTree.cjs +1 -1
  316. package/dist/components/IDE/FileTree.cjs.map +1 -1
  317. package/dist/components/IDE/FileTree.mjs +1 -1
  318. package/dist/components/IDE/FileTree.mjs.map +1 -1
  319. package/dist/components/IDE/IDE.cjs +7 -3
  320. package/dist/components/IDE/IDE.cjs.map +1 -1
  321. package/dist/components/IDE/IDE.d.ts +1 -0
  322. package/dist/components/IDE/IDE.d.ts.map +1 -1
  323. package/dist/components/IDE/IDE.mjs +8 -4
  324. package/dist/components/IDE/IDE.mjs.map +1 -1
  325. package/dist/components/Input/Checkbox.cjs +10 -11
  326. package/dist/components/Input/Checkbox.cjs.map +1 -1
  327. package/dist/components/Input/Checkbox.d.ts +1 -1
  328. package/dist/components/Input/Checkbox.mjs +10 -11
  329. package/dist/components/Input/Checkbox.mjs.map +1 -1
  330. package/dist/components/Input/Input.cjs +7 -7
  331. package/dist/components/Input/Input.cjs.map +1 -1
  332. package/dist/components/Input/Input.d.ts.map +1 -1
  333. package/dist/components/Input/Input.mjs +7 -7
  334. package/dist/components/Input/Input.mjs.map +1 -1
  335. package/dist/components/Input/InputPassword.cjs +1 -1
  336. package/dist/components/Input/InputPassword.cjs.map +1 -1
  337. package/dist/components/Input/InputPassword.mjs +1 -1
  338. package/dist/components/Input/InputPassword.mjs.map +1 -1
  339. package/dist/components/KeyboardScreenAdapter/index.cjs +25 -0
  340. package/dist/components/KeyboardScreenAdapter/index.cjs.map +1 -0
  341. package/dist/components/KeyboardScreenAdapter/index.d.ts +3 -0
  342. package/dist/components/KeyboardScreenAdapter/index.d.ts.map +1 -0
  343. package/dist/components/KeyboardScreenAdapter/index.mjs +25 -0
  344. package/dist/components/KeyboardScreenAdapter/index.mjs.map +1 -0
  345. package/dist/components/Link/Link.cjs +26 -20
  346. package/dist/components/Link/Link.cjs.map +1 -1
  347. package/dist/components/Link/Link.d.ts +1 -1
  348. package/dist/components/Link/Link.d.ts.map +1 -1
  349. package/dist/components/Link/Link.mjs +26 -20
  350. package/dist/components/Link/Link.mjs.map +1 -1
  351. package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.cjs +4 -4
  352. package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.cjs.map +1 -1
  353. package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.mjs +4 -4
  354. package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.mjs.map +1 -1
  355. package/dist/components/LocaleSwitcherDropDown/LocaleSwitcher.cjs +4 -4
  356. package/dist/components/LocaleSwitcherDropDown/LocaleSwitcher.cjs.map +1 -1
  357. package/dist/components/LocaleSwitcherDropDown/LocaleSwitcher.mjs +4 -4
  358. package/dist/components/LocaleSwitcherDropDown/LocaleSwitcher.mjs.map +1 -1
  359. package/dist/components/MarkDownRender/index.cjs +115 -114
  360. package/dist/components/MarkDownRender/index.cjs.map +1 -1
  361. package/dist/components/MarkDownRender/index.d.ts +1 -1
  362. package/dist/components/MarkDownRender/index.d.ts.map +1 -1
  363. package/dist/components/MarkDownRender/index.mjs +115 -114
  364. package/dist/components/MarkDownRender/index.mjs.map +1 -1
  365. package/dist/components/MaxHeightSmoother/index.cjs +3 -1
  366. package/dist/components/MaxHeightSmoother/index.cjs.map +1 -1
  367. package/dist/components/MaxHeightSmoother/index.d.ts.map +1 -1
  368. package/dist/components/MaxHeightSmoother/index.mjs +3 -1
  369. package/dist/components/MaxHeightSmoother/index.mjs.map +1 -1
  370. package/dist/components/Modal/Modal.cjs +16 -14
  371. package/dist/components/Modal/Modal.cjs.map +1 -1
  372. package/dist/components/Modal/Modal.d.ts.map +1 -1
  373. package/dist/components/Modal/Modal.mjs +16 -14
  374. package/dist/components/Modal/Modal.mjs.map +1 -1
  375. package/dist/components/Navbar/Burger.cjs +1 -1
  376. package/dist/components/Navbar/Burger.cjs.map +1 -1
  377. package/dist/components/Navbar/Burger.mjs +1 -1
  378. package/dist/components/Navbar/Burger.mjs.map +1 -1
  379. package/dist/components/Navbar/DesktopNavbar.cjs +2 -2
  380. package/dist/components/Navbar/DesktopNavbar.cjs.map +1 -1
  381. package/dist/components/Navbar/DesktopNavbar.mjs +2 -2
  382. package/dist/components/Navbar/DesktopNavbar.mjs.map +1 -1
  383. package/dist/components/Navbar/MobileNavbar.cjs +2 -2
  384. package/dist/components/Navbar/MobileNavbar.cjs.map +1 -1
  385. package/dist/components/Navbar/MobileNavbar.mjs +2 -2
  386. package/dist/components/Navbar/MobileNavbar.mjs.map +1 -1
  387. package/dist/components/Pattern/DotPattern.cjs +1 -1
  388. package/dist/components/Pattern/DotPattern.cjs.map +1 -1
  389. package/dist/components/Pattern/DotPattern.mjs +1 -1
  390. package/dist/components/Pattern/DotPattern.mjs.map +1 -1
  391. package/dist/components/Pattern/GridPattern.cjs +1 -1
  392. package/dist/components/Pattern/GridPattern.cjs.map +1 -1
  393. package/dist/components/Pattern/GridPattern.mjs +1 -1
  394. package/dist/components/Pattern/GridPattern.mjs.map +1 -1
  395. package/dist/components/Popover/index.cjs +1 -1
  396. package/dist/components/Popover/index.cjs.map +1 -1
  397. package/dist/components/Popover/index.mjs +1 -1
  398. package/dist/components/Popover/index.mjs.map +1 -1
  399. package/dist/components/RightDrawer/RightDrawer.cjs +2 -2
  400. package/dist/components/RightDrawer/RightDrawer.cjs.map +1 -1
  401. package/dist/components/RightDrawer/RightDrawer.d.ts.map +1 -1
  402. package/dist/components/RightDrawer/RightDrawer.mjs +2 -2
  403. package/dist/components/RightDrawer/RightDrawer.mjs.map +1 -1
  404. package/dist/components/Select/Multiselect.cjs +8 -9
  405. package/dist/components/Select/Multiselect.cjs.map +1 -1
  406. package/dist/components/Select/Multiselect.d.ts.map +1 -1
  407. package/dist/components/Select/Multiselect.mjs +9 -10
  408. package/dist/components/Select/Multiselect.mjs.map +1 -1
  409. package/dist/components/Select/Select.cjs +7 -8
  410. package/dist/components/Select/Select.cjs.map +1 -1
  411. package/dist/components/Select/Select.d.ts.map +1 -1
  412. package/dist/components/Select/Select.mjs +7 -8
  413. package/dist/components/Select/Select.mjs.map +1 -1
  414. package/dist/components/SwitchSelector/index.cjs +11 -11
  415. package/dist/components/SwitchSelector/index.cjs.map +1 -1
  416. package/dist/components/SwitchSelector/index.d.ts +1 -1
  417. package/dist/components/SwitchSelector/index.d.ts.map +1 -1
  418. package/dist/components/SwitchSelector/index.mjs +11 -11
  419. package/dist/components/SwitchSelector/index.mjs.map +1 -1
  420. package/dist/components/TabSelector/TabSelector.cjs +15 -13
  421. package/dist/components/TabSelector/TabSelector.cjs.map +1 -1
  422. package/dist/components/TabSelector/TabSelector.d.ts +1 -1
  423. package/dist/components/TabSelector/TabSelector.d.ts.map +1 -1
  424. package/dist/components/TabSelector/TabSelector.mjs +15 -13
  425. package/dist/components/TabSelector/TabSelector.mjs.map +1 -1
  426. package/dist/components/Tag/index.cjs +6 -7
  427. package/dist/components/Tag/index.cjs.map +1 -1
  428. package/dist/components/Tag/index.d.ts +2 -2
  429. package/dist/components/Tag/index.d.ts.map +1 -1
  430. package/dist/components/Tag/index.mjs +6 -7
  431. package/dist/components/Tag/index.mjs.map +1 -1
  432. package/dist/components/TextArea/AutoSizeTextArea.cjs +1 -0
  433. package/dist/components/TextArea/AutoSizeTextArea.cjs.map +1 -1
  434. package/dist/components/TextArea/AutoSizeTextArea.d.ts.map +1 -1
  435. package/dist/components/TextArea/AutoSizeTextArea.mjs +1 -0
  436. package/dist/components/TextArea/AutoSizeTextArea.mjs.map +1 -1
  437. package/dist/components/TextArea/AutocompleteTextArea.cjs +105 -0
  438. package/dist/components/TextArea/AutocompleteTextArea.cjs.map +1 -0
  439. package/dist/components/TextArea/AutocompleteTextArea.d.ts +9 -0
  440. package/dist/components/TextArea/AutocompleteTextArea.d.ts.map +1 -0
  441. package/dist/components/TextArea/AutocompleteTextArea.mjs +105 -0
  442. package/dist/components/TextArea/AutocompleteTextArea.mjs.map +1 -0
  443. package/dist/components/TextArea/index.cjs +3 -0
  444. package/dist/components/TextArea/index.cjs.map +1 -1
  445. package/dist/components/TextArea/index.d.ts +1 -0
  446. package/dist/components/TextArea/index.d.ts.map +1 -1
  447. package/dist/components/TextArea/index.mjs +4 -1
  448. package/dist/components/TextArea/index.mjs.map +1 -1
  449. package/dist/components/ThemeSwitcherDropDown/DesktopThemeSwitcher.cjs +1 -1
  450. package/dist/components/ThemeSwitcherDropDown/DesktopThemeSwitcher.cjs.map +1 -1
  451. package/dist/components/ThemeSwitcherDropDown/DesktopThemeSwitcher.mjs +1 -1
  452. package/dist/components/ThemeSwitcherDropDown/DesktopThemeSwitcher.mjs.map +1 -1
  453. package/dist/components/Toaster/Toast.cjs +5 -5
  454. package/dist/components/Toaster/Toast.cjs.map +1 -1
  455. package/dist/components/Toaster/Toast.d.ts +1 -1
  456. package/dist/components/Toaster/Toast.d.ts.map +1 -1
  457. package/dist/components/Toaster/Toast.mjs +5 -5
  458. package/dist/components/Toaster/Toast.mjs.map +1 -1
  459. package/dist/components/Toaster/Toaster.cjs +1 -1
  460. package/dist/components/Toaster/Toaster.cjs.map +1 -1
  461. package/dist/components/Toaster/Toaster.mjs +1 -1
  462. package/dist/components/Toaster/Toaster.mjs.map +1 -1
  463. package/dist/components/WithResizer/index.cjs +2 -2
  464. package/dist/components/WithResizer/index.cjs.map +1 -1
  465. package/dist/components/WithResizer/index.mjs +2 -2
  466. package/dist/components/WithResizer/index.mjs.map +1 -1
  467. package/dist/components/index.cjs +14 -3
  468. package/dist/components/index.cjs.map +1 -1
  469. package/dist/components/index.d.ts +2 -0
  470. package/dist/components/index.d.ts.map +1 -1
  471. package/dist/components/index.mjs +14 -3
  472. package/dist/components/index.mjs.map +1 -1
  473. package/dist/hooks/index.cjs +5 -0
  474. package/dist/hooks/index.cjs.map +1 -1
  475. package/dist/hooks/index.d.ts +1 -0
  476. package/dist/hooks/index.d.ts.map +1 -1
  477. package/dist/hooks/index.mjs +6 -1
  478. package/dist/hooks/index.mjs.map +1 -1
  479. package/dist/hooks/intlayerAPIHooks.cjs +18 -4
  480. package/dist/hooks/intlayerAPIHooks.cjs.map +1 -1
  481. package/dist/hooks/intlayerAPIHooks.d.ts +5 -2
  482. package/dist/hooks/intlayerAPIHooks.d.ts.map +1 -1
  483. package/dist/hooks/intlayerAPIHooks.mjs +18 -4
  484. package/dist/hooks/intlayerAPIHooks.mjs.map +1 -1
  485. package/dist/hooks/useAsync/useAsyncStateStore.cjs +8 -14
  486. package/dist/hooks/useAsync/useAsyncStateStore.cjs.map +1 -1
  487. package/dist/hooks/useAsync/useAsyncStateStore.d.ts.map +1 -1
  488. package/dist/hooks/useAsync/useAsyncStateStore.mjs +8 -14
  489. package/dist/hooks/useAsync/useAsyncStateStore.mjs.map +1 -1
  490. package/dist/hooks/useGetAllDictionaries.d.ts.map +1 -1
  491. package/dist/hooks/useIntlayerAPI.d.ts +5 -2
  492. package/dist/hooks/useIntlayerAPI.d.ts.map +1 -1
  493. package/dist/hooks/useKeyboardDetector.cjs +27 -0
  494. package/dist/hooks/useKeyboardDetector.cjs.map +1 -0
  495. package/dist/hooks/useKeyboardDetector.d.ts +5 -0
  496. package/dist/hooks/useKeyboardDetector.d.ts.map +1 -0
  497. package/dist/hooks/useKeyboardDetector.mjs +27 -0
  498. package/dist/hooks/useKeyboardDetector.mjs.map +1 -0
  499. package/dist/index-BCuMWKyy.js.map +1 -1
  500. package/dist/index-BYzBot7l.cjs.map +1 -1
  501. package/dist/{index-BUe-qmA0.js → index-C57uA6Lk.js} +2 -2
  502. package/dist/{index-BUe-qmA0.js.map → index-C57uA6Lk.js.map} +1 -1
  503. package/dist/{index-cg9H6eBs.cjs → index-D02c1QrF.cjs} +2 -2
  504. package/dist/{index-cg9H6eBs.cjs.map → index-D02c1QrF.cjs.map} +1 -1
  505. package/dist/{index-BTDHuTxL.js → index-DixKT3Hi.js} +40 -11
  506. package/dist/index-DixKT3Hi.js.map +1 -0
  507. package/dist/{index-Db5Dym4h.cjs → index-a_-DkvMQ.cjs} +40 -11
  508. package/dist/index-a_-DkvMQ.cjs.map +1 -0
  509. package/dist/tailwind.config.cjs +2 -1395
  510. package/dist/tailwind.config.cjs.map +1 -1
  511. package/dist/tailwind.config.d.ts +3 -282
  512. package/dist/tailwind.config.d.ts.map +1 -1
  513. package/dist/tailwind.config.mjs +2 -1395
  514. package/dist/tailwind.config.mjs.map +1 -1
  515. package/dist/tailwind.css +2 -1
  516. package/dist/zod-BV4nCGJE.js.map +1 -1
  517. package/dist/zod-DSrtTSD_.cjs.map +1 -1
  518. package/package.json +28 -25
  519. package/dist/Form-BZUDRfoN.js.map +0 -1
  520. package/dist/Form-yi0CMK-a.cjs.map +0 -1
  521. package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.cjs +0 -120
  522. package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.cjs.map +0 -1
  523. package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.d.ts +0 -9
  524. package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.d.ts.map +0 -1
  525. package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.mjs +0 -120
  526. package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.mjs.map +0 -1
  527. package/dist/components/DictionaryEditor/validDictionaryChangeButtons.content.cjs +0 -132
  528. package/dist/components/DictionaryEditor/validDictionaryChangeButtons.content.cjs.map +0 -1
  529. package/dist/components/DictionaryEditor/validDictionaryChangeButtons.content.d.ts.map +0 -1
  530. package/dist/components/DictionaryEditor/validDictionaryChangeButtons.content.mjs +0 -132
  531. package/dist/components/DictionaryEditor/validDictionaryChangeButtons.content.mjs.map +0 -1
  532. package/dist/components/DictionaryEditor/validDictionaryChangeButtonsSchema.cjs +0 -8
  533. package/dist/components/DictionaryEditor/validDictionaryChangeButtonsSchema.cjs.map +0 -1
  534. package/dist/components/DictionaryEditor/validDictionaryChangeButtonsSchema.d.ts +0 -4
  535. package/dist/components/DictionaryEditor/validDictionaryChangeButtonsSchema.d.ts.map +0 -1
  536. package/dist/components/DictionaryEditor/validDictionaryChangeButtonsSchema.mjs +0 -8
  537. package/dist/components/DictionaryEditor/validDictionaryChangeButtonsSchema.mjs.map +0 -1
  538. package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.cjs +0 -45
  539. package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.cjs.map +0 -1
  540. package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.d.ts +0 -9
  541. package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.d.ts.map +0 -1
  542. package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.mjs +0 -45
  543. package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.mjs.map +0 -1
  544. package/dist/components/DictionaryFieldEditor/DictionariesSelector/dictionariesSelector.content.cjs +0 -40
  545. package/dist/components/DictionaryFieldEditor/DictionariesSelector/dictionariesSelector.content.cjs.map +0 -1
  546. package/dist/components/DictionaryFieldEditor/DictionariesSelector/dictionariesSelector.content.d.ts +0 -36
  547. package/dist/components/DictionaryFieldEditor/DictionariesSelector/dictionariesSelector.content.d.ts.map +0 -1
  548. package/dist/components/DictionaryFieldEditor/DictionariesSelector/dictionariesSelector.content.mjs +0 -40
  549. package/dist/components/DictionaryFieldEditor/DictionariesSelector/dictionariesSelector.content.mjs.map +0 -1
  550. package/dist/components/DictionaryFieldEditor/SaveForm/SaveFormSchema.cjs +0 -8
  551. package/dist/components/DictionaryFieldEditor/SaveForm/SaveFormSchema.cjs.map +0 -1
  552. package/dist/components/DictionaryFieldEditor/SaveForm/SaveFormSchema.d.ts +0 -4
  553. package/dist/components/DictionaryFieldEditor/SaveForm/SaveFormSchema.d.ts.map +0 -1
  554. package/dist/components/DictionaryFieldEditor/SaveForm/SaveFormSchema.mjs +0 -8
  555. package/dist/components/DictionaryFieldEditor/SaveForm/SaveFormSchema.mjs.map +0 -1
  556. package/dist/index-BTDHuTxL.js.map +0 -1
  557. package/dist/index-Db5Dym4h.cjs.map +0 -1
@@ -3,7 +3,6 @@
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
4
4
  const jsxRuntime = require("react/jsx-runtime");
5
5
  const editorReact = require("@intlayer/editor-react");
6
- const intlayer = require("intlayer");
7
6
  const lucideReact = require("lucide-react");
8
7
  const ReactExports = require("react");
9
8
  const reactIntlayer = require("react-intlayer");
@@ -11,123 +10,89 @@ require("../../../hooks/useScrollBlockage/useScrollBlockageStore.cjs");
11
10
  require("../../../hooks/useAsync/useAsyncStateStore.cjs");
12
11
  const hooks_intlayerAPIHooks = require("../../../hooks/intlayerAPIHooks.cjs");
13
12
  require("deepmerge");
14
- require("../../../index-Db5Dym4h.cjs");
13
+ const utils_cn = require("../../../utils/cn.cjs");
14
+ require("../../../index-a_-DkvMQ.cjs");
15
15
  require("@intlayer/config/client");
16
16
  require("../../Button/Button.cjs");
17
+ const components_Auth_useAuth_index = require("../../Auth/useAuth/index.cjs");
17
18
  require("../../Auth/ExternalsLoginButtons/externalsLoginButtons.content.cjs");
18
- const components_Form_FormBase = require("../../Form/FormBase.cjs");
19
+ require("@hookform/resolvers");
20
+ require("react-hook-form");
19
21
  require("../../Form/FormField.cjs");
20
- const components_Form_layout_FormItemLayout = require("../../../Form-yi0CMK-a.cjs");
22
+ const components_Form_layout_FormItemLayout = require("../../../Form-BpxW17v4.cjs");
21
23
  require("../../Auth/SignInForm/signIn.content.cjs");
22
24
  require("zod");
23
25
  require("../../Auth/SignInForm/useSignInSchema.content.cjs");
24
26
  require("../../Auth/SignUpForm/signUpForm.content.cjs");
25
27
  require("../../Auth/SignUpForm/useSignUpSchema.content.cjs");
26
- const components_Auth_useAuth_index = require("../../Auth/useAuth/index.cjs");
27
28
  require("../../Auth/ChangePasswordForm/changePasswordForm.content.cjs");
28
29
  require("../../Auth/ChangePasswordForm/useChangePasswordSchema.content.cjs");
29
30
  require("../../Auth/ResetPasswordForm/resetPasswordContent.content.cjs");
30
31
  require("../../Auth/ResetPasswordForm/useResetPasswordSchema.content.cjs");
31
32
  require("../../Modal/Modal.cjs");
32
- require("clsx");
33
- require("tailwind-merge");
34
33
  require("@intlayer/api");
35
34
  require("../../Auth/VerifyEmailForm/index.content.cjs");
35
+ require("../../Auth/DefineNewPasswordForm/defineNewPasswordForm.content.cjs");
36
+ require("../../Auth/DefineNewPasswordForm/useDefineNewPasswordSchema.content.cjs");
36
37
  const components_DictionaryFieldEditor_SaveForm_saveForm_content = require("./saveForm.content.cjs");
37
- const components_DictionaryFieldEditor_SaveForm_SaveFormSchema = require("./SaveFormSchema.cjs");
38
- const SaveForm = ({ dictionary, mode }) => {
39
- const { session } = components_Auth_useAuth_index.useAuth();
40
- const project = session?.project;
38
+ const SaveForm = ({
39
+ dictionary,
40
+ mode,
41
+ className,
42
+ ...props
43
+ }) => {
41
44
  const { setLocaleDictionary } = editorReact.useDictionariesRecordActions();
42
- const { pushDictionaries } = hooks_intlayerAPIHooks.usePushDictionaries();
43
- const { writeDictionary } = hooks_intlayerAPIHooks.useWriteDictionary();
44
- const SaveFormSchema = components_DictionaryFieldEditor_SaveForm_SaveFormSchema.getSaveFormSchema();
45
- const { isLoading: isAuditing, auditContentDeclaration } = hooks_intlayerAPIHooks.useAuditContentDeclaration();
46
- const { editedContent, restoreEditedContent, setEditedContent } = editorReact.useEditedContent();
47
- const { form, isSubmitting } = components_Form_FormBase.useForm(SaveFormSchema);
48
- const {
49
- auditButton,
50
- resetButton,
51
- saveButton,
52
- publishButton,
53
- downloadButton
54
- } = reactIntlayer.useDictionary(components_DictionaryFieldEditor_SaveForm_saveForm_content.saveDictionaryContent);
45
+ const { writeDictionary, isLoading: isWriting } = hooks_intlayerAPIHooks.useWriteDictionary();
46
+ const { pushDictionaries, isLoading: isPushing } = hooks_intlayerAPIHooks.usePushDictionaries();
47
+ const isLoading = isWriting || isPushing;
48
+ const { editedContent, restoreEditedContent } = editorReact.useEditedContent();
49
+ const { resetButton, saveButton, publishButton, downloadButton } = reactIntlayer.useDictionary(components_DictionaryFieldEditor_SaveForm_saveForm_content.saveDictionaryContent);
50
+ const { isAuthenticated } = components_Auth_useAuth_index.useAuth();
55
51
  const editedDictionary = ReactExports.useMemo(
56
52
  () => editedContent?.[dictionary.key],
57
53
  [editedContent, dictionary.key]
58
54
  );
59
55
  const isEdited = ReactExports.useMemo(
60
- () => editedDictionary && JSON.stringify(editedDictionary.content) !== JSON.stringify(dictionary.content),
56
+ () => editedDictionary && JSON.stringify(editedDictionary) !== JSON.stringify(dictionary),
61
57
  [editedDictionary, dictionary, mode]
62
58
  );
63
59
  const isLocalDictionary = ReactExports.useMemo(
64
60
  () => typeof dictionary?._id === "undefined",
65
61
  [dictionary]
66
62
  );
67
- const onSubmitSuccess = ReactExports.useCallback(async () => {
63
+ const handleSaveDictionary = async () => {
68
64
  if (!editedContent?.[dictionary.key]) return;
69
65
  const updatedDictionary = {
70
66
  ...dictionary,
71
67
  ...editedContent?.[dictionary.key]
72
68
  };
73
- if (mode === "remote") {
74
- await pushDictionaries([updatedDictionary]);
75
- } else {
76
- await writeDictionary(updatedDictionary);
77
- }
78
- setLocaleDictionary(editedContent?.[dictionary.key]);
79
- restoreEditedContent(dictionary.key);
80
- }, [
81
- dictionary,
82
- editedContent,
83
- pushDictionaries,
84
- setLocaleDictionary,
85
- writeDictionary,
86
- restoreEditedContent,
87
- mode
88
- ]);
89
- const handleOnAuditFile = async () => await auditContentDeclaration({
90
- defaultLocale: project?.configuration?.internationalization?.defaultLocale ?? intlayer.Locales.ENGLISH,
91
- locales: project?.configuration?.internationalization?.locales ?? [
92
- intlayer.Locales.ENGLISH
93
- ],
94
- fileContent: JSON.stringify(editedDictionary ?? dictionary)
95
- }).then((response) => {
96
- if (!response.data) return;
97
- const editedDictionary2 = JSON.parse(
98
- response.data.fileContent
99
- );
100
- setEditedContent(dictionary.key, editedDictionary2.content);
101
- });
69
+ await writeDictionary(updatedDictionary).then(() => {
70
+ setLocaleDictionary(editedContent?.[dictionary.key]);
71
+ restoreEditedContent(dictionary.key);
72
+ });
73
+ };
74
+ const handlePushDictionary = async () => {
75
+ if (!editedContent?.[dictionary.key]) return;
76
+ const updatedDictionary = {
77
+ ...dictionary,
78
+ ...editedContent?.[dictionary.key]
79
+ };
80
+ await pushDictionaries([updatedDictionary]).then(() => {
81
+ setLocaleDictionary(editedContent?.[dictionary.key]);
82
+ restoreEditedContent(dictionary.key);
83
+ });
84
+ };
102
85
  return /* @__PURE__ */ jsxRuntime.jsxs(
103
- components_Form_layout_FormItemLayout.Form,
86
+ "form",
104
87
  {
105
- className: "flex w-full flex-1 flex-row flex-wrap justify-end gap-3",
106
- ...form,
107
- schema: SaveFormSchema,
108
- onSubmitSuccess,
88
+ className: utils_cn.cn("flex justify-end gap-2 max-md:flex-col", className),
89
+ ...props,
109
90
  children: [
110
- /* @__PURE__ */ jsxRuntime.jsx(
111
- components_Form_layout_FormItemLayout.Form.Button,
112
- {
113
- type: "button",
114
- label: auditButton.label.value,
115
- disabled: isSubmitting,
116
- Icon: lucideReact.WandSparkles,
117
- variant: "outline",
118
- color: "text",
119
- className: "ml-auto max-md:w-full",
120
- isLoading: isAuditing,
121
- onClick: handleOnAuditFile,
122
- children: auditButton.text
123
- }
124
- ),
125
91
  isEdited && /* @__PURE__ */ jsxRuntime.jsx(
126
92
  components_Form_layout_FormItemLayout.Form.Button,
127
93
  {
128
- type: "button",
129
94
  label: resetButton.label.value,
130
- disabled: !isEdited || isSubmitting,
95
+ disabled: !isEdited,
131
96
  Icon: lucideReact.RotateCcw,
132
97
  variant: "outline",
133
98
  color: "text",
@@ -136,42 +101,45 @@ const SaveForm = ({ dictionary, mode }) => {
136
101
  children: resetButton.text
137
102
  }
138
103
  ),
139
- mode === "remote" ? isLocalDictionary ? /* @__PURE__ */ jsxRuntime.jsx(
104
+ mode.includes("local") && /* @__PURE__ */ jsxRuntime.jsx(
105
+ components_Form_layout_FormItemLayout.Form.Button,
106
+ {
107
+ label: downloadButton.label.value,
108
+ disabled: !isEdited || isLoading,
109
+ Icon: lucideReact.Download,
110
+ color: "text",
111
+ variant: isAuthenticated ? "outline" : "default",
112
+ className: "max-md:w-full",
113
+ isLoading: isWriting,
114
+ onClick: handleSaveDictionary,
115
+ children: downloadButton.text
116
+ }
117
+ ),
118
+ mode.includes("remote") && isAuthenticated && isLocalDictionary && /* @__PURE__ */ jsxRuntime.jsx(
140
119
  components_Form_layout_FormItemLayout.Form.Button,
141
120
  {
142
- type: "submit",
143
121
  label: publishButton.label.value,
144
- disabled: !isEdited || isSubmitting,
122
+ disabled: !isEdited,
145
123
  Icon: lucideReact.ArrowUpFromLine,
146
124
  color: "text",
147
125
  className: "max-md:w-full",
148
- isLoading: isSubmitting,
126
+ isLoading: isPushing,
127
+ onClick: handlePushDictionary,
149
128
  children: publishButton.text
150
129
  }
151
- ) : isEdited && /* @__PURE__ */ jsxRuntime.jsx(
130
+ ),
131
+ mode.includes("remote") && isAuthenticated && !isLocalDictionary && isEdited && /* @__PURE__ */ jsxRuntime.jsx(
152
132
  components_Form_layout_FormItemLayout.Form.Button,
153
133
  {
154
- type: "submit",
155
134
  label: saveButton.label.value,
156
- disabled: !isEdited || isSubmitting,
135
+ disabled: !isEdited || isLoading,
157
136
  Icon: lucideReact.Save,
158
137
  color: "text",
159
138
  className: "max-md:w-full",
160
- isLoading: isSubmitting,
139
+ isLoading: isPushing,
140
+ onClick: handlePushDictionary,
161
141
  children: saveButton.text
162
142
  }
163
- ) : /* @__PURE__ */ jsxRuntime.jsx(
164
- components_Form_layout_FormItemLayout.Form.Button,
165
- {
166
- type: "submit",
167
- label: downloadButton.label.value,
168
- disabled: !isEdited || isSubmitting,
169
- Icon: lucideReact.Download,
170
- color: "text",
171
- className: "max-md:w-full",
172
- isLoading: isSubmitting,
173
- children: downloadButton.text
174
- }
175
143
  )
176
144
  ]
177
145
  }
@@ -1 +1 @@
1
- {"version":3,"file":"SaveForm.cjs","sources":["../../../../src/components/DictionaryFieldEditor/SaveForm/SaveForm.tsx"],"sourcesContent":["'use client';\n\nimport type { Dictionary as DistantDictionary } from '@intlayer/backend';\nimport type { Dictionary } from '@intlayer/core';\nimport {\n useDictionariesRecordActions,\n useEditedContent,\n} from '@intlayer/editor-react';\nimport { Locales } from 'intlayer';\nimport {\n ArrowUpFromLine,\n Download,\n RotateCcw,\n Save,\n WandSparkles,\n} from 'lucide-react';\nimport { useCallback, useMemo, type FC } from 'react';\nimport { useDictionary } from 'react-intlayer';\nimport {\n usePushDictionaries,\n useAuditContentDeclaration,\n useWriteDictionary,\n} from '../../../hooks';\nimport { useAuth } from '../../Auth';\nimport { Form, useForm } from '../../Form';\nimport { saveDictionaryContent } from './saveForm.content';\nimport { getSaveFormSchema } from './SaveFormSchema';\n\ntype DictionaryDetailsProps = {\n dictionary: Dictionary;\n mode: 'local' | 'remote';\n};\n\nexport const SaveForm: FC<DictionaryDetailsProps> = ({ dictionary, mode }) => {\n const { session } = useAuth();\n const project = session?.project;\n const { setLocaleDictionary } = useDictionariesRecordActions();\n const { pushDictionaries } = usePushDictionaries();\n const { writeDictionary } = useWriteDictionary();\n const SaveFormSchema = getSaveFormSchema();\n const { isLoading: isAuditing, auditContentDeclaration } =\n useAuditContentDeclaration();\n\n const { editedContent, restoreEditedContent, setEditedContent } =\n useEditedContent();\n const { form, isSubmitting } = useForm(SaveFormSchema);\n const {\n auditButton,\n resetButton,\n saveButton,\n publishButton,\n downloadButton,\n } = useDictionary(saveDictionaryContent);\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, mode]\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 const handleOnAuditFile = async () =>\n await auditContentDeclaration({\n defaultLocale:\n project?.configuration?.internationalization?.defaultLocale ??\n Locales.ENGLISH,\n locales: project?.configuration?.internationalization?.locales ?? [\n Locales.ENGLISH,\n ],\n fileContent: JSON.stringify(editedDictionary ?? dictionary),\n }).then((response) => {\n if (!response.data) return;\n\n const editedDictionary = JSON.parse(\n response.data.fileContent\n ) as Dictionary;\n\n setEditedContent(dictionary.key, editedDictionary.content);\n });\n\n return (\n <Form\n className=\"flex w-full flex-1 flex-row flex-wrap justify-end gap-3\"\n {...form}\n schema={SaveFormSchema}\n onSubmitSuccess={onSubmitSuccess}\n >\n <Form.Button\n type=\"button\"\n label={auditButton.label.value}\n disabled={isSubmitting}\n Icon={WandSparkles}\n variant=\"outline\"\n color=\"text\"\n className=\"ml-auto max-md:w-full\"\n isLoading={isAuditing}\n onClick={handleOnAuditFile}\n >\n {auditButton.text}\n </Form.Button>\n {isEdited && (\n <Form.Button\n type=\"button\"\n label={resetButton.label.value}\n disabled={!isEdited || isSubmitting}\n Icon={RotateCcw}\n variant=\"outline\"\n color=\"text\"\n className=\"max-md:w-full\"\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 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={!isEdited || isSubmitting}\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={!isEdited || isSubmitting}\n Icon={Download}\n color=\"text\"\n className=\"max-md:w-full\"\n isLoading={isSubmitting}\n >\n {downloadButton.text}\n </Form.Button>\n )}\n </Form>\n );\n};\n"],"names":["useAuth","useDictionariesRecordActions","usePushDictionaries","useWriteDictionary","getSaveFormSchema","useAuditContentDeclaration","useEditedContent","useForm","useDictionary","saveDictionaryContent","useMemo","useCallback","Locales","editedDictionary","jsxs","Form","jsx","WandSparkles","RotateCcw","ArrowUpFromLine","Save","Download"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCO,MAAM,WAAuC,CAAC,EAAE,YAAY,WAAW;AACtE,QAAA,EAAE,QAAQ,IAAIA,sCAAQ;AAC5B,QAAM,UAAU,SAAS;AACnB,QAAA,EAAE,oBAAoB,IAAIC,yCAA6B;AACvD,QAAA,EAAE,iBAAiB,IAAIC,2CAAoB;AAC3C,QAAA,EAAE,gBAAgB,IAAIC,0CAAmB;AAC/C,QAAM,iBAAiBC,yDAAAA,kBAAkB;AACzC,QAAM,EAAE,WAAW,YAAY,wBAAA,IAC7BC,uBAAAA,2BAA2B;AAE7B,QAAM,EAAE,eAAe,sBAAsB,iBAAA,IAC3CC,YAAAA,iBAAiB;AACnB,QAAM,EAAE,MAAM,iBAAiBC,yBAAAA,QAAQ,cAAc;AAC/C,QAAA;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA,IACEC,cAAAA,cAAcC,2DAAAA,qBAAqB;AAEvC,QAAM,mBAAmBC,aAAA;AAAA,IACvB,MAAM,gBAAgB,WAAW,GAAG;AAAA,IACpC,CAAC,eAAe,WAAW,GAAG;AAAA,EAChC;AAEA,QAAM,WAAWA,aAAA;AAAA,IACf,MACE,oBACA,KAAK,UAAU,iBAAiB,OAAO,MACrC,KAAK,UAAU,WAAW,OAAO;AAAA,IACrC,CAAC,kBAAkB,YAAY,IAAI;AAAA,EACrC;AAEA,QAAM,oBAAoBA,aAAA;AAAA,IACxB,MAAM,OAAQ,YAAkC,QAAQ;AAAA,IACxD,CAAC,UAAU;AAAA,EACb;AAEM,QAAA,kBAAkBC,aAAAA,YAAY,YAAY;AAC9C,QAAI,CAAC,gBAAgB,WAAW,GAAG,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QACC,YACCD,2BAAA;AAAA,UAACD,sCAAAA,KAAK;AAAA,UAAL;AAAA,YACC,MAAK;AAAA,YACL,OAAO,YAAY,MAAM;AAAA,YACzB,UAAU,CAAC,YAAY;AAAA,YACvB,MAAMG,YAAA;AAAA,YACN,SAAQ;AAAA,YACR,OAAM;AAAA,YACN,WAAU;AAAA,YACV,SAAS,MAAM,qBAAqB,WAAW,GAAG;AAAA,YAEjD,UAAY,YAAA;AAAA,UAAA;AAAA,QACf;AAAA,QAED,SAAS,WACR,oBACEF,2BAAA;AAAA,UAACD,sCAAAA,KAAK;AAAA,UAAL;AAAA,YACC,MAAK;AAAA,YACL,OAAO,cAAc,MAAM;AAAA,YAC3B,UAAU,CAAC,YAAY;AAAA,YACvB,MAAMI,YAAA;AAAA,YACN,OAAM;AAAA,YACN,WAAU;AAAA,YACV,WAAW;AAAA,YAEV,UAAc,cAAA;AAAA,UAAA;AAAA,YAGjB,YACEH,2BAAA;AAAA,UAACD,sCAAAA,KAAK;AAAA,UAAL;AAAA,YACC,MAAK;AAAA,YACL,OAAO,WAAW,MAAM;AAAA,YACxB,UAAU,CAAC,YAAY;AAAA,YACvB,MAAMK,YAAA;AAAA,YACN,OAAM;AAAA,YACN,WAAU;AAAA,YACV,WAAW;AAAA,YAEV,UAAW,WAAA;AAAA,UAAA;AAAA,QAAA,IAKlBJ,2BAAA;AAAA,UAACD,sCAAAA,KAAK;AAAA,UAAL;AAAA,YACC,MAAK;AAAA,YACL,OAAO,eAAe,MAAM;AAAA,YAC5B,UAAU,CAAC,YAAY;AAAA,YACvB,MAAMM,YAAA;AAAA,YACN,OAAM;AAAA,YACN,WAAU;AAAA,YACV,WAAW;AAAA,YAEV,UAAe,eAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MAClB;AAAA,IAAA;AAAA,EAEJ;AAEJ;;"}
1
+ {"version":3,"file":"SaveForm.cjs","sources":["../../../../src/components/DictionaryFieldEditor/SaveForm/SaveForm.tsx"],"sourcesContent":["'use client';\n\nimport type { 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 {\n type DetailedHTMLProps,\n type FormHTMLAttributes,\n useMemo,\n type FC,\n} from 'react';\nimport { useDictionary } from 'react-intlayer';\nimport { usePushDictionaries, useWriteDictionary } from '../../../hooks';\nimport { cn } from '../../../utils/cn';\nimport { useAuth } from '../../Auth';\nimport { Form } from '../../Form';\nimport { saveDictionaryContent } from './saveForm.content';\n\ntype DictionaryDetailsProps = {\n dictionary: Dictionary;\n mode: ('local' | 'remote')[];\n} & DetailedHTMLProps<FormHTMLAttributes<HTMLFormElement>, HTMLFormElement>;\n\nexport const SaveForm: FC<DictionaryDetailsProps> = ({\n dictionary,\n mode,\n className,\n ...props\n}) => {\n const { setLocaleDictionary } = useDictionariesRecordActions();\n const { writeDictionary, isLoading: isWriting } = useWriteDictionary();\n const { pushDictionaries, isLoading: isPushing } = usePushDictionaries();\n const isLoading = isWriting || isPushing;\n\n const { editedContent, restoreEditedContent } = useEditedContent();\n const { resetButton, saveButton, publishButton, downloadButton } =\n useDictionary(saveDictionaryContent);\n const { isAuthenticated } = useAuth();\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) !== JSON.stringify(dictionary),\n [editedDictionary, dictionary, mode]\n );\n\n const isLocalDictionary = useMemo(\n () => typeof (dictionary as DistantDictionary)?._id === 'undefined',\n [dictionary]\n );\n\n const handleSaveDictionary = async () => {\n if (!editedContent?.[dictionary.key]) return;\n\n const updatedDictionary = {\n ...dictionary,\n ...editedContent?.[dictionary.key],\n };\n\n await writeDictionary(updatedDictionary).then(() => {\n setLocaleDictionary(editedContent?.[dictionary.key]);\n restoreEditedContent(dictionary.key);\n });\n };\n\n const handlePushDictionary = async () => {\n if (!editedContent?.[dictionary.key]) return;\n\n const updatedDictionary = {\n ...dictionary,\n ...editedContent?.[dictionary.key],\n };\n\n await pushDictionaries([updatedDictionary]).then(() => {\n setLocaleDictionary(editedContent?.[dictionary.key]);\n restoreEditedContent(dictionary.key);\n });\n };\n\n return (\n <form\n className={cn('flex justify-end gap-2 max-md:flex-col', className)}\n {...props}\n >\n {isEdited && (\n <Form.Button\n label={resetButton.label.value}\n disabled={!isEdited}\n Icon={RotateCcw}\n variant=\"outline\"\n color=\"text\"\n className=\"max-md:w-full\"\n onClick={() => restoreEditedContent(dictionary.key)}\n >\n {resetButton.text}\n </Form.Button>\n )}\n {mode.includes('local') && (\n <Form.Button\n label={downloadButton.label.value}\n disabled={!isEdited || isLoading}\n Icon={Download}\n color=\"text\"\n variant={isAuthenticated ? 'outline' : 'default'}\n className=\"max-md:w-full\"\n isLoading={isWriting}\n onClick={handleSaveDictionary}\n >\n {downloadButton.text}\n </Form.Button>\n )}\n {mode.includes('remote') && isAuthenticated && isLocalDictionary && (\n <Form.Button\n label={publishButton.label.value}\n disabled={!isEdited}\n Icon={ArrowUpFromLine}\n color=\"text\"\n className=\"max-md:w-full\"\n isLoading={isPushing}\n onClick={handlePushDictionary}\n >\n {publishButton.text}\n </Form.Button>\n )}\n {mode.includes('remote') &&\n isAuthenticated &&\n !isLocalDictionary &&\n isEdited && (\n <Form.Button\n label={saveButton.label.value}\n disabled={!isEdited || isLoading}\n Icon={Save}\n color=\"text\"\n className=\"max-md:w-full\"\n isLoading={isPushing}\n onClick={handlePushDictionary}\n >\n {saveButton.text}\n </Form.Button>\n )}\n </form>\n );\n};\n"],"names":["useDictionariesRecordActions","useWriteDictionary","usePushDictionaries","useEditedContent","useDictionary","saveDictionaryContent","useAuth","useMemo","jsxs","cn","jsx","Form","RotateCcw","Download","ArrowUpFromLine","Save"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BO,MAAM,WA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qBACD,YACEJ,2BAAA;AAAA,UAACC,sCAAAA,KAAK;AAAA,UAAL;AAAA,YACC,OAAO,WAAW,MAAM;AAAA,YACxB,UAAU,CAAC,YAAY;AAAA,YACvB,MAAMI,YAAA;AAAA,YACN,OAAM;AAAA,YACN,WAAU;AAAA,YACV,WAAW;AAAA,YACX,SAAS;AAAA,YAER,UAAW,WAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MACd;AAAA,IAAA;AAAA,EAEN;AAEJ;;"}
@@ -1,9 +1,9 @@
1
1
  import { Dictionary } from '@intlayer/core';
2
- import { FC } from 'react';
2
+ import { DetailedHTMLProps, FormHTMLAttributes, FC } from 'react';
3
3
  type DictionaryDetailsProps = {
4
4
  dictionary: Dictionary;
5
- mode: 'local' | 'remote';
6
- };
5
+ mode: ('local' | 'remote')[];
6
+ } & DetailedHTMLProps<FormHTMLAttributes<HTMLFormElement>, HTMLFormElement>;
7
7
  export declare const SaveForm: FC<DictionaryDetailsProps>;
8
8
  export {};
9
9
  //# sourceMappingURL=SaveForm.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SaveForm.d.ts","sourceRoot":"","sources":["../../../../src/components/DictionaryFieldEditor/SaveForm/SaveForm.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAajD,OAAO,EAAwB,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAYtD,KAAK,sBAAsB,GAAG;IAC5B,UAAU,EAAE,UAAU,CAAC;IACvB,IAAI,EAAE,OAAO,GAAG,QAAQ,CAAC;CAC1B,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,EAAE,CAAC,sBAAsB,CAgK/C,CAAC"}
1
+ {"version":3,"file":"SaveForm.d.ts","sourceRoot":"","sources":["../../../../src/components/DictionaryFieldEditor/SaveForm/SaveForm.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAMjD,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EAEvB,KAAK,EAAE,EACR,MAAM,OAAO,CAAC;AAQf,KAAK,sBAAsB,GAAG;IAC5B,UAAU,EAAE,UAAU,CAAC;IACvB,IAAI,EAAE,CAAC,OAAO,GAAG,QAAQ,CAAC,EAAE,CAAC;CAC9B,GAAG,iBAAiB,CAAC,kBAAkB,CAAC,eAAe,CAAC,EAAE,eAAe,CAAC,CAAC;AAE5E,eAAO,MAAM,QAAQ,EAAE,EAAE,CAAC,sBAAsB,CA4H/C,CAAC"}
@@ -1,131 +1,96 @@
1
1
  "use client";
2
2
  import { jsxs, jsx } from "react/jsx-runtime";
3
3
  import { useDictionariesRecordActions, useEditedContent } from "@intlayer/editor-react";
4
- import { Locales } from "intlayer";
5
- import { WandSparkles, RotateCcw, ArrowUpFromLine, Save, Download } from "lucide-react";
6
- import { useMemo, useCallback } from "react";
4
+ import { RotateCcw, Download, ArrowUpFromLine, Save } from "lucide-react";
5
+ import { useMemo } from "react";
7
6
  import { useDictionary } from "react-intlayer";
8
7
  import "../../../hooks/useScrollBlockage/useScrollBlockageStore.mjs";
9
8
  import "../../../hooks/useAsync/useAsyncStateStore.mjs";
10
- import { usePushDictionaries, useWriteDictionary, useAuditContentDeclaration } from "../../../hooks/intlayerAPIHooks.mjs";
9
+ import { useWriteDictionary, usePushDictionaries } from "../../../hooks/intlayerAPIHooks.mjs";
11
10
  import "deepmerge";
12
- import "../../../index-BTDHuTxL.js";
11
+ import { cn } from "../../../utils/cn.mjs";
12
+ import "../../../index-DixKT3Hi.js";
13
13
  import "@intlayer/config/client";
14
14
  import "../../Button/Button.mjs";
15
+ import { useAuth } from "../../Auth/useAuth/index.mjs";
15
16
  import "../../Auth/ExternalsLoginButtons/externalsLoginButtons.content.mjs";
16
- import { useForm } from "../../Form/FormBase.mjs";
17
+ import "@hookform/resolvers";
18
+ import "react-hook-form";
17
19
  import "../../Form/FormField.mjs";
18
- import { F as Form } from "../../../Form-BZUDRfoN.js";
20
+ import { F as Form } from "../../../Form-MjLzPGze.js";
19
21
  import "../../Auth/SignInForm/signIn.content.mjs";
20
22
  import "zod";
21
23
  import "../../Auth/SignInForm/useSignInSchema.content.mjs";
22
24
  import "../../Auth/SignUpForm/signUpForm.content.mjs";
23
25
  import "../../Auth/SignUpForm/useSignUpSchema.content.mjs";
24
- import { useAuth } from "../../Auth/useAuth/index.mjs";
25
26
  import "../../Auth/ChangePasswordForm/changePasswordForm.content.mjs";
26
27
  import "../../Auth/ChangePasswordForm/useChangePasswordSchema.content.mjs";
27
28
  import "../../Auth/ResetPasswordForm/resetPasswordContent.content.mjs";
28
29
  import "../../Auth/ResetPasswordForm/useResetPasswordSchema.content.mjs";
29
30
  import "../../Modal/Modal.mjs";
30
- import "clsx";
31
- import "tailwind-merge";
32
31
  import "@intlayer/api";
33
32
  import "../../Auth/VerifyEmailForm/index.content.mjs";
33
+ import "../../Auth/DefineNewPasswordForm/defineNewPasswordForm.content.mjs";
34
+ import "../../Auth/DefineNewPasswordForm/useDefineNewPasswordSchema.content.mjs";
34
35
  import { saveDictionaryContent } from "./saveForm.content.mjs";
35
- import { getSaveFormSchema } from "./SaveFormSchema.mjs";
36
- const SaveForm = ({ dictionary, mode }) => {
37
- const { session } = useAuth();
38
- const project = session?.project;
36
+ const SaveForm = ({
37
+ dictionary,
38
+ mode,
39
+ className,
40
+ ...props
41
+ }) => {
39
42
  const { setLocaleDictionary } = useDictionariesRecordActions();
40
- const { pushDictionaries } = usePushDictionaries();
41
- const { writeDictionary } = useWriteDictionary();
42
- const SaveFormSchema = getSaveFormSchema();
43
- const { isLoading: isAuditing, auditContentDeclaration } = useAuditContentDeclaration();
44
- const { editedContent, restoreEditedContent, setEditedContent } = useEditedContent();
45
- const { form, isSubmitting } = useForm(SaveFormSchema);
46
- const {
47
- auditButton,
48
- resetButton,
49
- saveButton,
50
- publishButton,
51
- downloadButton
52
- } = useDictionary(saveDictionaryContent);
43
+ const { writeDictionary, isLoading: isWriting } = useWriteDictionary();
44
+ const { pushDictionaries, isLoading: isPushing } = usePushDictionaries();
45
+ const isLoading = isWriting || isPushing;
46
+ const { editedContent, restoreEditedContent } = useEditedContent();
47
+ const { resetButton, saveButton, publishButton, downloadButton } = useDictionary(saveDictionaryContent);
48
+ const { isAuthenticated } = useAuth();
53
49
  const editedDictionary = useMemo(
54
50
  () => editedContent?.[dictionary.key],
55
51
  [editedContent, dictionary.key]
56
52
  );
57
53
  const isEdited = useMemo(
58
- () => editedDictionary && JSON.stringify(editedDictionary.content) !== JSON.stringify(dictionary.content),
54
+ () => editedDictionary && JSON.stringify(editedDictionary) !== JSON.stringify(dictionary),
59
55
  [editedDictionary, dictionary, mode]
60
56
  );
61
57
  const isLocalDictionary = useMemo(
62
58
  () => typeof dictionary?._id === "undefined",
63
59
  [dictionary]
64
60
  );
65
- const onSubmitSuccess = useCallback(async () => {
61
+ const handleSaveDictionary = async () => {
66
62
  if (!editedContent?.[dictionary.key]) return;
67
63
  const updatedDictionary = {
68
64
  ...dictionary,
69
65
  ...editedContent?.[dictionary.key]
70
66
  };
71
- if (mode === "remote") {
72
- await pushDictionaries([updatedDictionary]);
73
- } else {
74
- await writeDictionary(updatedDictionary);
75
- }
76
- setLocaleDictionary(editedContent?.[dictionary.key]);
77
- restoreEditedContent(dictionary.key);
78
- }, [
79
- dictionary,
80
- editedContent,
81
- pushDictionaries,
82
- setLocaleDictionary,
83
- writeDictionary,
84
- restoreEditedContent,
85
- mode
86
- ]);
87
- const handleOnAuditFile = async () => await auditContentDeclaration({
88
- defaultLocale: project?.configuration?.internationalization?.defaultLocale ?? Locales.ENGLISH,
89
- locales: project?.configuration?.internationalization?.locales ?? [
90
- Locales.ENGLISH
91
- ],
92
- fileContent: JSON.stringify(editedDictionary ?? dictionary)
93
- }).then((response) => {
94
- if (!response.data) return;
95
- const editedDictionary2 = JSON.parse(
96
- response.data.fileContent
97
- );
98
- setEditedContent(dictionary.key, editedDictionary2.content);
99
- });
67
+ await writeDictionary(updatedDictionary).then(() => {
68
+ setLocaleDictionary(editedContent?.[dictionary.key]);
69
+ restoreEditedContent(dictionary.key);
70
+ });
71
+ };
72
+ const handlePushDictionary = async () => {
73
+ if (!editedContent?.[dictionary.key]) return;
74
+ const updatedDictionary = {
75
+ ...dictionary,
76
+ ...editedContent?.[dictionary.key]
77
+ };
78
+ await pushDictionaries([updatedDictionary]).then(() => {
79
+ setLocaleDictionary(editedContent?.[dictionary.key]);
80
+ restoreEditedContent(dictionary.key);
81
+ });
82
+ };
100
83
  return /* @__PURE__ */ jsxs(
101
- Form,
84
+ "form",
102
85
  {
103
- className: "flex w-full flex-1 flex-row flex-wrap justify-end gap-3",
104
- ...form,
105
- schema: SaveFormSchema,
106
- onSubmitSuccess,
86
+ className: cn("flex justify-end gap-2 max-md:flex-col", className),
87
+ ...props,
107
88
  children: [
108
- /* @__PURE__ */ jsx(
109
- Form.Button,
110
- {
111
- type: "button",
112
- label: auditButton.label.value,
113
- disabled: isSubmitting,
114
- Icon: WandSparkles,
115
- variant: "outline",
116
- color: "text",
117
- className: "ml-auto max-md:w-full",
118
- isLoading: isAuditing,
119
- onClick: handleOnAuditFile,
120
- children: auditButton.text
121
- }
122
- ),
123
89
  isEdited && /* @__PURE__ */ jsx(
124
90
  Form.Button,
125
91
  {
126
- type: "button",
127
92
  label: resetButton.label.value,
128
- disabled: !isEdited || isSubmitting,
93
+ disabled: !isEdited,
129
94
  Icon: RotateCcw,
130
95
  variant: "outline",
131
96
  color: "text",
@@ -134,42 +99,45 @@ const SaveForm = ({ dictionary, mode }) => {
134
99
  children: resetButton.text
135
100
  }
136
101
  ),
137
- mode === "remote" ? isLocalDictionary ? /* @__PURE__ */ jsx(
102
+ mode.includes("local") && /* @__PURE__ */ jsx(
103
+ Form.Button,
104
+ {
105
+ label: downloadButton.label.value,
106
+ disabled: !isEdited || isLoading,
107
+ Icon: Download,
108
+ color: "text",
109
+ variant: isAuthenticated ? "outline" : "default",
110
+ className: "max-md:w-full",
111
+ isLoading: isWriting,
112
+ onClick: handleSaveDictionary,
113
+ children: downloadButton.text
114
+ }
115
+ ),
116
+ mode.includes("remote") && isAuthenticated && isLocalDictionary && /* @__PURE__ */ jsx(
138
117
  Form.Button,
139
118
  {
140
- type: "submit",
141
119
  label: publishButton.label.value,
142
- disabled: !isEdited || isSubmitting,
120
+ disabled: !isEdited,
143
121
  Icon: ArrowUpFromLine,
144
122
  color: "text",
145
123
  className: "max-md:w-full",
146
- isLoading: isSubmitting,
124
+ isLoading: isPushing,
125
+ onClick: handlePushDictionary,
147
126
  children: publishButton.text
148
127
  }
149
- ) : isEdited && /* @__PURE__ */ jsx(
128
+ ),
129
+ mode.includes("remote") && isAuthenticated && !isLocalDictionary && isEdited && /* @__PURE__ */ jsx(
150
130
  Form.Button,
151
131
  {
152
- type: "submit",
153
132
  label: saveButton.label.value,
154
- disabled: !isEdited || isSubmitting,
133
+ disabled: !isEdited || isLoading,
155
134
  Icon: Save,
156
135
  color: "text",
157
136
  className: "max-md:w-full",
158
- isLoading: isSubmitting,
137
+ isLoading: isPushing,
138
+ onClick: handlePushDictionary,
159
139
  children: saveButton.text
160
140
  }
161
- ) : /* @__PURE__ */ jsx(
162
- Form.Button,
163
- {
164
- type: "submit",
165
- label: downloadButton.label.value,
166
- disabled: !isEdited || isSubmitting,
167
- Icon: Download,
168
- color: "text",
169
- className: "max-md:w-full",
170
- isLoading: isSubmitting,
171
- children: downloadButton.text
172
- }
173
141
  )
174
142
  ]
175
143
  }
@@ -1 +1 @@
1
- {"version":3,"file":"SaveForm.mjs","sources":["../../../../src/components/DictionaryFieldEditor/SaveForm/SaveForm.tsx"],"sourcesContent":["'use client';\n\nimport type { Dictionary as DistantDictionary } from '@intlayer/backend';\nimport type { Dictionary } from '@intlayer/core';\nimport {\n useDictionariesRecordActions,\n useEditedContent,\n} from '@intlayer/editor-react';\nimport { Locales } from 'intlayer';\nimport {\n ArrowUpFromLine,\n Download,\n RotateCcw,\n Save,\n WandSparkles,\n} from 'lucide-react';\nimport { useCallback, useMemo, type FC } from 'react';\nimport { useDictionary } from 'react-intlayer';\nimport {\n usePushDictionaries,\n useAuditContentDeclaration,\n useWriteDictionary,\n} from '../../../hooks';\nimport { useAuth } from '../../Auth';\nimport { Form, useForm } from '../../Form';\nimport { saveDictionaryContent } from './saveForm.content';\nimport { getSaveFormSchema } from './SaveFormSchema';\n\ntype DictionaryDetailsProps = {\n dictionary: Dictionary;\n mode: 'local' | 'remote';\n};\n\nexport const SaveForm: FC<DictionaryDetailsProps> = ({ dictionary, mode }) => {\n const { session } = useAuth();\n const project = session?.project;\n const { setLocaleDictionary } = useDictionariesRecordActions();\n const { pushDictionaries } = usePushDictionaries();\n const { writeDictionary } = useWriteDictionary();\n const SaveFormSchema = getSaveFormSchema();\n const { isLoading: isAuditing, auditContentDeclaration } =\n useAuditContentDeclaration();\n\n const { editedContent, restoreEditedContent, setEditedContent } =\n useEditedContent();\n const { form, isSubmitting } = useForm(SaveFormSchema);\n const {\n auditButton,\n resetButton,\n saveButton,\n publishButton,\n downloadButton,\n } = useDictionary(saveDictionaryContent);\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, mode]\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 const handleOnAuditFile = async () =>\n await auditContentDeclaration({\n defaultLocale:\n project?.configuration?.internationalization?.defaultLocale ??\n Locales.ENGLISH,\n locales: project?.configuration?.internationalization?.locales ?? [\n Locales.ENGLISH,\n ],\n fileContent: JSON.stringify(editedDictionary ?? dictionary),\n }).then((response) => {\n if (!response.data) return;\n\n const editedDictionary = JSON.parse(\n response.data.fileContent\n ) as Dictionary;\n\n setEditedContent(dictionary.key, editedDictionary.content);\n });\n\n return (\n <Form\n className=\"flex w-full flex-1 flex-row flex-wrap justify-end gap-3\"\n {...form}\n schema={SaveFormSchema}\n onSubmitSuccess={onSubmitSuccess}\n >\n <Form.Button\n type=\"button\"\n label={auditButton.label.value}\n disabled={isSubmitting}\n Icon={WandSparkles}\n variant=\"outline\"\n color=\"text\"\n className=\"ml-auto max-md:w-full\"\n isLoading={isAuditing}\n onClick={handleOnAuditFile}\n >\n {auditButton.text}\n </Form.Button>\n {isEdited && (\n <Form.Button\n type=\"button\"\n label={resetButton.label.value}\n disabled={!isEdited || isSubmitting}\n Icon={RotateCcw}\n variant=\"outline\"\n color=\"text\"\n className=\"max-md:w-full\"\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 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={!isEdited || isSubmitting}\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={!isEdited || isSubmitting}\n Icon={Download}\n color=\"text\"\n className=\"max-md:w-full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,qBAAqB,WAAW,GAAG;AAAA,YAEjD,UAAY,YAAA;AAAA,UAAA;AAAA,QACf;AAAA,QAED,SAAS,WACR,oBACE;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,WAAU;AAAA,YACV,WAAW;AAAA,YAEV,UAAc,cAAA;AAAA,UAAA;AAAA,YAGjB,YACE;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,WAAU;AAAA,YACV,WAAW;AAAA,YAEV,UAAW,WAAA;AAAA,UAAA;AAAA,QAAA,IAKlB;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,WAAU;AAAA,YACV,WAAW;AAAA,YAEV,UAAe,eAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MAClB;AAAA,IAAA;AAAA,EAEJ;AAEJ;"}
1
+ {"version":3,"file":"SaveForm.mjs","sources":["../../../../src/components/DictionaryFieldEditor/SaveForm/SaveForm.tsx"],"sourcesContent":["'use client';\n\nimport type { 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 {\n type DetailedHTMLProps,\n type FormHTMLAttributes,\n useMemo,\n type FC,\n} from 'react';\nimport { useDictionary } from 'react-intlayer';\nimport { usePushDictionaries, useWriteDictionary } from '../../../hooks';\nimport { cn } from '../../../utils/cn';\nimport { useAuth } from '../../Auth';\nimport { Form } from '../../Form';\nimport { saveDictionaryContent } from './saveForm.content';\n\ntype DictionaryDetailsProps = {\n dictionary: Dictionary;\n mode: ('local' | 'remote')[];\n} & DetailedHTMLProps<FormHTMLAttributes<HTMLFormElement>, HTMLFormElement>;\n\nexport const SaveForm: FC<DictionaryDetailsProps> = ({\n dictionary,\n mode,\n className,\n ...props\n}) => {\n const { setLocaleDictionary } = useDictionariesRecordActions();\n const { writeDictionary, isLoading: isWriting } = useWriteDictionary();\n const { pushDictionaries, isLoading: isPushing } = usePushDictionaries();\n const isLoading = isWriting || isPushing;\n\n const { editedContent, restoreEditedContent } = useEditedContent();\n const { resetButton, saveButton, publishButton, downloadButton } =\n useDictionary(saveDictionaryContent);\n const { isAuthenticated } = useAuth();\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) !== JSON.stringify(dictionary),\n [editedDictionary, dictionary, mode]\n );\n\n const isLocalDictionary = useMemo(\n () => typeof (dictionary as DistantDictionary)?._id === 'undefined',\n [dictionary]\n );\n\n const handleSaveDictionary = async () => {\n if (!editedContent?.[dictionary.key]) return;\n\n const updatedDictionary = {\n ...dictionary,\n ...editedContent?.[dictionary.key],\n };\n\n await writeDictionary(updatedDictionary).then(() => {\n setLocaleDictionary(editedContent?.[dictionary.key]);\n restoreEditedContent(dictionary.key);\n });\n };\n\n const handlePushDictionary = async () => {\n if (!editedContent?.[dictionary.key]) return;\n\n const updatedDictionary = {\n ...dictionary,\n ...editedContent?.[dictionary.key],\n };\n\n await pushDictionaries([updatedDictionary]).then(() => {\n setLocaleDictionary(editedContent?.[dictionary.key]);\n restoreEditedContent(dictionary.key);\n });\n };\n\n return (\n <form\n className={cn('flex justify-end gap-2 max-md:flex-col', className)}\n {...props}\n >\n {isEdited && (\n <Form.Button\n label={resetButton.label.value}\n disabled={!isEdited}\n Icon={RotateCcw}\n variant=\"outline\"\n color=\"text\"\n className=\"max-md:w-full\"\n onClick={() => restoreEditedContent(dictionary.key)}\n >\n {resetButton.text}\n </Form.Button>\n )}\n {mode.includes('local') && (\n <Form.Button\n label={downloadButton.label.value}\n disabled={!isEdited || isLoading}\n Icon={Download}\n color=\"text\"\n variant={isAuthenticated ? 'outline' : 'default'}\n className=\"max-md:w-full\"\n isLoading={isWriting}\n onClick={handleSaveDictionary}\n >\n {downloadButton.text}\n </Form.Button>\n )}\n {mode.includes('remote') && isAuthenticated && isLocalDictionary && (\n <Form.Button\n label={publishButton.label.value}\n disabled={!isEdited}\n Icon={ArrowUpFromLine}\n color=\"text\"\n className=\"max-md:w-full\"\n isLoading={isPushing}\n onClick={handlePushDictionary}\n >\n {publishButton.text}\n </Form.Button>\n )}\n {mode.includes('remote') &&\n isAuthenticated &&\n !isLocalDictionary &&\n isEdited && (\n <Form.Button\n label={saveButton.label.value}\n disabled={!isEdited || isLoading}\n Icon={Save}\n color=\"text\"\n className=\"max-md:w-full\"\n isLoading={isPushing}\n onClick={handlePushDictionary}\n >\n {saveButton.text}\n </Form.Button>\n )}\n </form>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BO,MAAM,WAAuC,CAAC;AAAA,EACnD;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAM;AACE,QAAA,EAAE,oBAAoB,IAAI,6BAA6B;AAC7D,QAAM,EAAE,iBAAiB,WAAW,UAAA,IAAc,mBAAmB;AACrE,QAAM,EAAE,kBAAkB,WAAW,UAAA,IAAc,oBAAoB;AACvE,QAAM,YAAY,aAAa;AAE/B,QAAM,EAAE,eAAe,qBAAqB,IAAI,iBAAiB;AACjE,QAAM,EAAE,aAAa,YAAY,eAAe,eAAe,IAC7D,cAAc,qBAAqB;AAC/B,QAAA,EAAE,gBAAgB,IAAI,QAAQ;AAEpC,QAAM,mBAAmB;AAAA,IACvB,M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