@intlayer/design-system 3.0.3 → 3.1.0

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 (482) hide show
  1. package/dist/.vite/manifest.json +521 -395
  2. package/dist/Form-2XHQV7F_.cjs +295 -0
  3. package/dist/Form-2XHQV7F_.cjs.map +1 -0
  4. package/dist/Form-BO0i3nT9.js +300 -0
  5. package/dist/Form-BO0i3nT9.js.map +1 -0
  6. package/dist/Form-BaHDK0RZ.cjs +298 -0
  7. package/dist/Form-BaHDK0RZ.cjs.map +1 -0
  8. package/dist/Form-BfZMqK2D.js +300 -0
  9. package/dist/Form-BfZMqK2D.js.map +1 -0
  10. package/dist/Form-C13KWSZs.cjs +299 -0
  11. package/dist/Form-C13KWSZs.cjs.map +1 -0
  12. package/dist/Form-C8K2f8ph.js +300 -0
  13. package/dist/Form-C8K2f8ph.js.map +1 -0
  14. package/dist/Form-CKvCgz8c.cjs +299 -0
  15. package/dist/Form-CKvCgz8c.cjs.map +1 -0
  16. package/dist/Form-Cbk5Lhpd.js +299 -0
  17. package/dist/Form-Cbk5Lhpd.js.map +1 -0
  18. package/dist/Form-CiAgFAPb.cjs +300 -0
  19. package/dist/Form-CiAgFAPb.cjs.map +1 -0
  20. package/dist/Form-CnBKDneQ.js +296 -0
  21. package/dist/Form-CnBKDneQ.js.map +1 -0
  22. package/dist/Form-DERuauvB.cjs +300 -0
  23. package/dist/Form-DERuauvB.cjs.map +1 -0
  24. package/dist/Form-DhlDf3ML.cjs +299 -0
  25. package/dist/Form-DhlDf3ML.cjs.map +1 -0
  26. package/dist/Form-DkAZ0Jdf.cjs +299 -0
  27. package/dist/Form-DkAZ0Jdf.cjs.map +1 -0
  28. package/dist/Form-DqnNP4DA.js +300 -0
  29. package/dist/Form-DqnNP4DA.js.map +1 -0
  30. package/dist/Form-DyFBmVya.js +301 -0
  31. package/dist/Form-DyFBmVya.js.map +1 -0
  32. package/dist/Form-FW4Odjfm.js +301 -0
  33. package/dist/Form-FW4Odjfm.js.map +1 -0
  34. package/dist/components/Accordion/Accordion.d.ts +0 -1
  35. package/dist/components/Auth/AuthModal/index.d.ts +0 -1
  36. package/dist/components/Auth/AuthProvider/index.cjs +5 -21
  37. package/dist/components/Auth/AuthProvider/index.cjs.map +1 -1
  38. package/dist/components/Auth/AuthProvider/index.d.ts +4 -3
  39. package/dist/components/Auth/AuthProvider/index.d.ts.map +1 -1
  40. package/dist/components/Auth/AuthProvider/index.mjs +6 -22
  41. package/dist/components/Auth/AuthProvider/index.mjs.map +1 -1
  42. package/dist/components/Auth/AuthProvider/useSession.cjs +7 -3
  43. package/dist/components/Auth/AuthProvider/useSession.cjs.map +1 -1
  44. package/dist/components/Auth/AuthProvider/useSession.d.ts +0 -1
  45. package/dist/components/Auth/AuthProvider/useSession.d.ts.map +1 -1
  46. package/dist/components/Auth/AuthProvider/useSession.mjs +7 -3
  47. package/dist/components/Auth/AuthProvider/useSession.mjs.map +1 -1
  48. package/dist/components/Auth/AuthenticationBarrier/AuthenticationBarrierClient.d.ts +0 -1
  49. package/dist/components/Auth/AuthenticationBarrier/AuthenticationBarrierServer.d.ts +0 -1
  50. package/dist/components/Auth/AuthenticationBarrier/accessValidation.d.ts +0 -1
  51. package/dist/components/Auth/AuthenticationBarrier/index.d.ts +0 -1
  52. package/dist/components/Auth/ChangePasswordForm/ChangePasswordForm.cjs +1 -1
  53. package/dist/components/Auth/ChangePasswordForm/ChangePasswordForm.d.ts +0 -1
  54. package/dist/components/Auth/ChangePasswordForm/ChangePasswordForm.mjs +1 -1
  55. package/dist/components/Auth/ChangePasswordForm/ChangePasswordSchema.cjs.map +1 -1
  56. package/dist/components/Auth/ChangePasswordForm/ChangePasswordSchema.d.ts +0 -1
  57. package/dist/components/Auth/ChangePasswordForm/ChangePasswordSchema.mjs.map +1 -1
  58. package/dist/components/Auth/ChangePasswordForm/index.content.cjs.map +1 -1
  59. package/dist/components/Auth/ChangePasswordForm/index.content.d.ts +10 -10
  60. package/dist/components/Auth/ChangePasswordForm/index.content.mjs.map +1 -1
  61. package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.d.ts +0 -1
  62. package/dist/components/Auth/ExternalsLoginButtons/assets/GithubLogo.d.ts +0 -1
  63. package/dist/components/Auth/ExternalsLoginButtons/assets/GoogleLogo.d.ts +0 -1
  64. package/dist/components/Auth/ExternalsLoginButtons/externalsLoginButtons.content.cjs.map +1 -1
  65. package/dist/components/Auth/ExternalsLoginButtons/externalsLoginButtons.content.d.ts +5 -5
  66. package/dist/components/Auth/ExternalsLoginButtons/externalsLoginButtons.content.mjs.map +1 -1
  67. package/dist/components/Auth/ResetPasswordForm/ResetPasswordForm.cjs +1 -1
  68. package/dist/components/Auth/ResetPasswordForm/ResetPasswordForm.d.ts +0 -1
  69. package/dist/components/Auth/ResetPasswordForm/ResetPasswordForm.mjs +1 -1
  70. package/dist/components/Auth/ResetPasswordForm/ResetPasswordSchema.cjs.map +1 -1
  71. package/dist/components/Auth/ResetPasswordForm/ResetPasswordSchema.d.ts +0 -1
  72. package/dist/components/Auth/ResetPasswordForm/ResetPasswordSchema.mjs.map +1 -1
  73. package/dist/components/Auth/ResetPasswordForm/index.content.cjs.map +1 -1
  74. package/dist/components/Auth/ResetPasswordForm/index.content.d.ts +7 -7
  75. package/dist/components/Auth/ResetPasswordForm/index.content.mjs.map +1 -1
  76. package/dist/components/Auth/SignInForm/SignInForm.cjs +1 -1
  77. package/dist/components/Auth/SignInForm/SignInForm.d.ts +0 -1
  78. package/dist/components/Auth/SignInForm/SignInForm.mjs +1 -1
  79. package/dist/components/Auth/SignInForm/SignInSchema.cjs.map +1 -1
  80. package/dist/components/Auth/SignInForm/SignInSchema.d.ts +0 -1
  81. package/dist/components/Auth/SignInForm/SignInSchema.mjs.map +1 -1
  82. package/dist/components/Auth/SignInForm/index.content.cjs.map +1 -1
  83. package/dist/components/Auth/SignInForm/index.content.d.ts +13 -13
  84. package/dist/components/Auth/SignInForm/index.content.mjs.map +1 -1
  85. package/dist/components/Auth/SignUpForm/SignUpForm.cjs +1 -1
  86. package/dist/components/Auth/SignUpForm/SignUpForm.d.ts +0 -1
  87. package/dist/components/Auth/SignUpForm/SignUpForm.mjs +1 -1
  88. package/dist/components/Auth/SignUpForm/SignUpSchema.cjs.map +1 -1
  89. package/dist/components/Auth/SignUpForm/SignUpSchema.d.ts +0 -1
  90. package/dist/components/Auth/SignUpForm/SignUpSchema.mjs.map +1 -1
  91. package/dist/components/Auth/SignUpForm/index.content.cjs.map +1 -1
  92. package/dist/components/Auth/SignUpForm/index.content.d.ts +11 -11
  93. package/dist/components/Auth/SignUpForm/index.content.mjs.map +1 -1
  94. package/dist/components/Avatar/index.d.ts +0 -1
  95. package/dist/components/Badge/index.d.ts +1 -2
  96. package/dist/components/Breadcrumb/index.d.ts +0 -1
  97. package/dist/components/Button/Button.cjs +1 -0
  98. package/dist/components/Button/Button.cjs.map +1 -1
  99. package/dist/components/Button/Button.d.ts +2 -3
  100. package/dist/components/Button/Button.d.ts.map +1 -1
  101. package/dist/components/Button/Button.mjs +1 -0
  102. package/dist/components/Button/Button.mjs.map +1 -1
  103. package/dist/components/Command/index.d.ts +9 -10
  104. package/dist/components/Command/index.d.ts.map +1 -1
  105. package/dist/components/Container/index.cjs.map +1 -1
  106. package/dist/components/Container/index.d.ts +16 -3
  107. package/dist/components/Container/index.d.ts.map +1 -1
  108. package/dist/components/Container/index.mjs.map +1 -1
  109. package/dist/components/ContentEditor/ContentEditor.d.ts +0 -1
  110. package/dist/components/ContentEditor/ContentEditorTextArea.d.ts +0 -1
  111. package/dist/components/ContentSelector/ContentSelector.d.ts +0 -1
  112. package/dist/components/CopyToClipboard/index.d.ts +0 -1
  113. package/dist/components/DictionaryEditor/DictionaryEditor.cjs +30 -24
  114. package/dist/components/DictionaryEditor/DictionaryEditor.cjs.map +1 -1
  115. package/dist/components/DictionaryEditor/DictionaryEditor.d.ts +0 -7
  116. package/dist/components/DictionaryEditor/DictionaryEditor.d.ts.map +1 -1
  117. package/dist/components/DictionaryEditor/DictionaryEditor.mjs +30 -24
  118. package/dist/components/DictionaryEditor/DictionaryEditor.mjs.map +1 -1
  119. package/dist/components/DictionaryEditor/ItemLayout.cjs +1 -0
  120. package/dist/components/DictionaryEditor/ItemLayout.cjs.map +1 -1
  121. package/dist/components/DictionaryEditor/ItemLayout.d.ts +0 -1
  122. package/dist/components/DictionaryEditor/ItemLayout.d.ts.map +1 -1
  123. package/dist/components/DictionaryEditor/ItemLayout.mjs +1 -0
  124. package/dist/components/DictionaryEditor/ItemLayout.mjs.map +1 -1
  125. package/dist/components/DictionaryEditor/NodeWrapper/ArrayWrapper.d.ts +0 -1
  126. package/dist/components/DictionaryEditor/NodeWrapper/EnumerationWrapper.d.ts +0 -1
  127. package/dist/components/DictionaryEditor/NodeWrapper/NestedObjectWrapper.d.ts +0 -1
  128. package/dist/components/DictionaryEditor/NodeWrapper/StringWrapper.cjs +7 -5
  129. package/dist/components/DictionaryEditor/NodeWrapper/StringWrapper.cjs.map +1 -1
  130. package/dist/components/DictionaryEditor/NodeWrapper/StringWrapper.d.ts +0 -1
  131. package/dist/components/DictionaryEditor/NodeWrapper/StringWrapper.mjs +7 -5
  132. package/dist/components/DictionaryEditor/NodeWrapper/StringWrapper.mjs.map +1 -1
  133. package/dist/components/DictionaryEditor/NodeWrapper/TranslationWrapper.d.ts +0 -1
  134. package/dist/components/DictionaryEditor/NodeWrapper/index.d.ts +0 -1
  135. package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.cjs +111 -19
  136. package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.cjs.map +1 -1
  137. package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.d.ts +1 -5
  138. package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.d.ts.map +1 -1
  139. package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.mjs +112 -20
  140. package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.mjs.map +1 -1
  141. package/dist/components/DictionaryEditor/useEditedContentStore.cjs +18 -20
  142. package/dist/components/DictionaryEditor/useEditedContentStore.cjs.map +1 -1
  143. package/dist/components/DictionaryEditor/useEditedContentStore.d.ts +0 -1
  144. package/dist/components/DictionaryEditor/useEditedContentStore.d.ts.map +1 -1
  145. package/dist/components/DictionaryEditor/useEditedContentStore.mjs +19 -21
  146. package/dist/components/DictionaryEditor/useEditedContentStore.mjs.map +1 -1
  147. package/dist/components/DictionaryEditor/useEditionPanelStore.d.ts +0 -1
  148. package/dist/components/DictionaryEditor/validDictionaryChangeButtons.content.cjs +67 -0
  149. package/dist/components/DictionaryEditor/validDictionaryChangeButtons.content.cjs.map +1 -0
  150. package/dist/components/DictionaryEditor/validDictionaryChangeButtons.content.d.ts +27 -0
  151. package/dist/components/DictionaryEditor/validDictionaryChangeButtons.content.d.ts.map +1 -0
  152. package/dist/components/DictionaryEditor/validDictionaryChangeButtons.content.mjs +67 -0
  153. package/dist/components/DictionaryEditor/validDictionaryChangeButtons.content.mjs.map +1 -0
  154. package/dist/components/DictionaryEditor/validDictionaryChangeButtonsSchema.cjs +8 -0
  155. package/dist/components/DictionaryEditor/validDictionaryChangeButtonsSchema.cjs.map +1 -0
  156. package/dist/components/DictionaryEditor/validDictionaryChangeButtonsSchema.d.ts +4 -0
  157. package/dist/components/DictionaryEditor/validDictionaryChangeButtonsSchema.d.ts.map +1 -0
  158. package/dist/components/DictionaryEditor/validDictionaryChangeButtonsSchema.mjs +8 -0
  159. package/dist/components/DictionaryEditor/validDictionaryChangeButtonsSchema.mjs.map +1 -0
  160. package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.cjs +8 -2
  161. package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.cjs.map +1 -1
  162. package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.d.ts +0 -1
  163. package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.d.ts.map +1 -1
  164. package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.mjs +8 -2
  165. package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.mjs.map +1 -1
  166. package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.cjs +1 -1
  167. package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.cjs.map +1 -1
  168. package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.d.ts +0 -1
  169. package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.d.ts.map +1 -1
  170. package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.mjs +1 -1
  171. package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.mjs.map +1 -1
  172. package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryFormSchema.cjs.map +1 -1
  173. package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryFormSchema.d.ts +2 -3
  174. package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryFormSchema.d.ts.map +1 -1
  175. package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryFormSchema.mjs.map +1 -1
  176. package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.cjs +1 -1
  177. package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.cjs.map +1 -1
  178. package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.d.ts +0 -1
  179. package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.d.ts.map +1 -1
  180. package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.mjs +1 -1
  181. package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.mjs.map +1 -1
  182. package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsSchema.cjs.map +1 -1
  183. package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsSchema.d.ts +2 -3
  184. package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsSchema.d.ts.map +1 -1
  185. package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsSchema.mjs.map +1 -1
  186. package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.cjs +2 -2
  187. package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.cjs.map +1 -1
  188. package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.mjs +2 -2
  189. package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.mjs.map +1 -1
  190. package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.cjs +37 -13
  191. package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.cjs.map +1 -1
  192. package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.d.ts +0 -1
  193. package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.d.ts.map +1 -1
  194. package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.mjs +37 -13
  195. package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.mjs.map +1 -1
  196. package/dist/components/DictionaryFieldEditor/EditorView/EditorView.cjs +21 -6
  197. package/dist/components/DictionaryFieldEditor/EditorView/EditorView.cjs.map +1 -1
  198. package/dist/components/DictionaryFieldEditor/EditorView/EditorView.d.ts +0 -1
  199. package/dist/components/DictionaryFieldEditor/EditorView/EditorView.d.ts.map +1 -1
  200. package/dist/components/DictionaryFieldEditor/EditorView/EditorView.mjs +21 -6
  201. package/dist/components/DictionaryFieldEditor/EditorView/EditorView.mjs.map +1 -1
  202. package/dist/components/DictionaryFieldEditor/EditorView/TextEditor.cjs +29 -14
  203. package/dist/components/DictionaryFieldEditor/EditorView/TextEditor.cjs.map +1 -1
  204. package/dist/components/DictionaryFieldEditor/EditorView/TextEditor.d.ts +0 -1
  205. package/dist/components/DictionaryFieldEditor/EditorView/TextEditor.d.ts.map +1 -1
  206. package/dist/components/DictionaryFieldEditor/EditorView/TextEditor.mjs +29 -14
  207. package/dist/components/DictionaryFieldEditor/EditorView/TextEditor.mjs.map +1 -1
  208. package/dist/components/DictionaryFieldEditor/EnumKeyInput.cjs +1 -0
  209. package/dist/components/DictionaryFieldEditor/EnumKeyInput.cjs.map +1 -1
  210. package/dist/components/DictionaryFieldEditor/EnumKeyInput.d.ts +0 -1
  211. package/dist/components/DictionaryFieldEditor/EnumKeyInput.mjs +1 -0
  212. package/dist/components/DictionaryFieldEditor/EnumKeyInput.mjs.map +1 -1
  213. package/dist/components/DictionaryFieldEditor/KeyPathBreadcrumb.d.ts +0 -1
  214. package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.cjs +18 -2
  215. package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.cjs.map +1 -1
  216. package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.d.ts +0 -1
  217. package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.d.ts.map +1 -1
  218. package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.mjs +18 -2
  219. package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.mjs.map +1 -1
  220. package/dist/components/DictionaryFieldEditor/NodeTypeSelector.cjs +18 -2
  221. package/dist/components/DictionaryFieldEditor/NodeTypeSelector.cjs.map +1 -1
  222. package/dist/components/DictionaryFieldEditor/NodeTypeSelector.d.ts +0 -1
  223. package/dist/components/DictionaryFieldEditor/NodeTypeSelector.d.ts.map +1 -1
  224. package/dist/components/DictionaryFieldEditor/NodeTypeSelector.mjs +18 -2
  225. package/dist/components/DictionaryFieldEditor/NodeTypeSelector.mjs.map +1 -1
  226. package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.cjs +14 -15
  227. package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.cjs.map +1 -1
  228. package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.d.ts +0 -1
  229. package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.d.ts.map +1 -1
  230. package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.mjs +14 -15
  231. package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.mjs.map +1 -1
  232. package/dist/components/DictionaryFieldEditor/SaveForm/SaveFormSchema.d.ts +0 -1
  233. package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.cjs +12 -12
  234. package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.cjs.map +1 -1
  235. package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.d.ts +1 -1
  236. package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.mjs +12 -12
  237. package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.mjs.map +1 -1
  238. package/dist/components/DictionaryFieldEditor/getIsEditableSection.d.ts +0 -1
  239. package/dist/components/DropDown/index.d.ts +0 -1
  240. package/dist/components/DropDown/types.d.ts +0 -1
  241. package/dist/components/EditableField/EditableFieldInput.cjs +12 -5
  242. package/dist/components/EditableField/EditableFieldInput.cjs.map +1 -1
  243. package/dist/components/EditableField/EditableFieldInput.d.ts +2 -4
  244. package/dist/components/EditableField/EditableFieldInput.d.ts.map +1 -1
  245. package/dist/components/EditableField/EditableFieldInput.mjs +13 -6
  246. package/dist/components/EditableField/EditableFieldInput.mjs.map +1 -1
  247. package/dist/components/EditableField/EditableFieldLayout.d.ts +0 -1
  248. package/dist/components/EditableField/EditableFieldTextArea.cjs +17 -4
  249. package/dist/components/EditableField/EditableFieldTextArea.cjs.map +1 -1
  250. package/dist/components/EditableField/EditableFieldTextArea.d.ts +6 -3
  251. package/dist/components/EditableField/EditableFieldTextArea.d.ts.map +1 -1
  252. package/dist/components/EditableField/EditableFieldTextArea.mjs +18 -5
  253. package/dist/components/EditableField/EditableFieldTextArea.mjs.map +1 -1
  254. package/dist/components/Flags/Flag.d.ts +0 -1
  255. package/dist/components/Footer/index.d.ts +0 -1
  256. package/dist/components/Form/Form.cjs +1 -1
  257. package/dist/components/Form/Form.d.ts +2 -1
  258. package/dist/components/Form/Form.d.ts.map +1 -1
  259. package/dist/components/Form/Form.mjs +1 -1
  260. package/dist/components/Form/FormBase.d.ts +0 -1
  261. package/dist/components/Form/FormBase.d.ts.map +1 -1
  262. package/dist/components/Form/FormDescription.d.ts +0 -1
  263. package/dist/components/Form/FormField.d.ts +0 -1
  264. package/dist/components/Form/FormItem.d.ts +0 -1
  265. package/dist/components/Form/FormMessage.d.ts +0 -1
  266. package/dist/components/Form/elements/CheckboxElement.cjs +10 -0
  267. package/dist/components/Form/elements/CheckboxElement.cjs.map +1 -0
  268. package/dist/components/Form/elements/CheckboxElement.d.ts +10 -0
  269. package/dist/components/Form/elements/CheckboxElement.d.ts.map +1 -0
  270. package/dist/components/Form/elements/CheckboxElement.mjs +10 -0
  271. package/dist/components/Form/elements/CheckboxElement.mjs.map +1 -0
  272. package/dist/components/Form/elements/EditableFieldInputElement.cjs +1 -1
  273. package/dist/components/Form/elements/EditableFieldInputElement.d.ts +0 -1
  274. package/dist/components/Form/elements/EditableFieldInputElement.mjs +1 -1
  275. package/dist/components/Form/elements/EditableFieldTextAreaElement.cjs +1 -1
  276. package/dist/components/Form/elements/EditableFieldTextAreaElement.d.ts +0 -1
  277. package/dist/components/Form/elements/EditableFieldTextAreaElement.mjs +1 -1
  278. package/dist/components/Form/elements/FormElement.cjs +1 -1
  279. package/dist/components/Form/elements/FormElement.d.ts +0 -1
  280. package/dist/components/Form/elements/FormElement.mjs +1 -1
  281. package/dist/components/Form/elements/FormElementWrapper.d.ts +0 -1
  282. package/dist/components/Form/elements/InputElement.cjs +2 -1
  283. package/dist/components/Form/elements/InputElement.cjs.map +1 -1
  284. package/dist/components/Form/elements/InputElement.d.ts +2 -3
  285. package/dist/components/Form/elements/InputElement.d.ts.map +1 -1
  286. package/dist/components/Form/elements/InputElement.mjs +2 -1
  287. package/dist/components/Form/elements/InputElement.mjs.map +1 -1
  288. package/dist/components/Form/elements/InputPasswordElement.cjs +2 -1
  289. package/dist/components/Form/elements/InputPasswordElement.cjs.map +1 -1
  290. package/dist/components/Form/elements/InputPasswordElement.d.ts +2 -3
  291. package/dist/components/Form/elements/InputPasswordElement.d.ts.map +1 -1
  292. package/dist/components/Form/elements/InputPasswordElement.mjs +2 -1
  293. package/dist/components/Form/elements/InputPasswordElement.mjs.map +1 -1
  294. package/dist/components/Form/elements/MultiselectElement.cjs +1 -1
  295. package/dist/components/Form/elements/MultiselectElement.d.ts +0 -1
  296. package/dist/components/Form/elements/MultiselectElement.mjs +1 -1
  297. package/dist/components/Form/elements/SelectElement.cjs +1 -1
  298. package/dist/components/Form/elements/SelectElement.d.ts +0 -1
  299. package/dist/components/Form/elements/SelectElement.mjs +1 -1
  300. package/dist/components/Form/elements/SwitchSelectorElement.cjs +1 -1
  301. package/dist/components/Form/elements/SwitchSelectorElement.d.ts +0 -1
  302. package/dist/components/Form/elements/SwitchSelectorElement.mjs +1 -1
  303. package/dist/components/Form/elements/TextAreaElement.cjs +1 -1
  304. package/dist/components/Form/elements/TextAreaElement.d.ts +0 -1
  305. package/dist/components/Form/elements/TextAreaElement.mjs +1 -1
  306. package/dist/components/Form/elements/index.cjs +1 -1
  307. package/dist/components/Form/elements/index.mjs +1 -1
  308. package/dist/components/Form/index.cjs +1 -1
  309. package/dist/components/Form/index.mjs +1 -1
  310. package/dist/components/Form/layout/FormItemLayout.cjs +1 -1
  311. package/dist/components/Form/layout/FormItemLayout.d.ts +1 -2
  312. package/dist/components/Form/layout/FormItemLayout.d.ts.map +1 -1
  313. package/dist/components/Form/layout/FormItemLayout.mjs +1 -1
  314. package/dist/components/Form/layout/FormLabelLayout.d.ts +0 -1
  315. package/dist/components/Form/layout/RequiredStar.d.ts +0 -1
  316. package/dist/components/Form/layout/index.cjs +1 -1
  317. package/dist/components/Form/layout/index.mjs +1 -1
  318. package/dist/components/Headers/index.d.ts +0 -1
  319. package/dist/components/IDE/CodeRender.cjs.map +1 -1
  320. package/dist/components/IDE/CodeRender.d.ts +0 -1
  321. package/dist/components/IDE/CodeRender.mjs.map +1 -1
  322. package/dist/components/IDE/FileList.d.ts +0 -1
  323. package/dist/components/IDE/FileTree.d.ts +0 -1
  324. package/dist/components/IDE/IDE.d.ts +0 -1
  325. package/dist/components/IDE/MarkDownRender.d.ts +0 -1
  326. package/dist/components/InformationTag/index.d.ts +0 -1
  327. package/dist/components/Input/Checkbox.cjs +80 -0
  328. package/dist/components/Input/Checkbox.cjs.map +1 -0
  329. package/dist/components/Input/Checkbox.d.ts +14 -0
  330. package/dist/components/Input/Checkbox.d.ts.map +1 -0
  331. package/dist/components/Input/Checkbox.mjs +80 -0
  332. package/dist/components/Input/Checkbox.mjs.map +1 -0
  333. package/dist/components/Input/Input.d.ts +0 -1
  334. package/dist/components/Input/InputPassword.d.ts +0 -1
  335. package/dist/components/Input/index.cjs +3 -0
  336. package/dist/components/Input/index.cjs.map +1 -1
  337. package/dist/components/Input/index.d.ts +1 -0
  338. package/dist/components/Input/index.d.ts.map +1 -1
  339. package/dist/components/Input/index.mjs +3 -0
  340. package/dist/components/Input/index.mjs.map +1 -1
  341. package/dist/components/Label/index.d.ts +0 -1
  342. package/dist/components/Link/Link.cjs +7 -2
  343. package/dist/components/Link/Link.cjs.map +1 -1
  344. package/dist/components/Link/Link.d.ts +3 -3
  345. package/dist/components/Link/Link.d.ts.map +1 -1
  346. package/dist/components/Link/Link.mjs +7 -2
  347. package/dist/components/Link/Link.mjs.map +1 -1
  348. package/dist/components/Loader/index.d.ts +0 -1
  349. package/dist/components/Loader/spinner.d.ts +0 -1
  350. package/dist/components/LocaleSwitcherDropDown/LocaleSwitcher.d.ts +0 -1
  351. package/dist/components/Logo/LogoCircle.d.ts +0 -1
  352. package/dist/components/Logo/LogoNoFrame.d.ts +0 -1
  353. package/dist/components/Logo/LogoSquare.d.ts +0 -1
  354. package/dist/components/Logo/LogoSquircle.d.ts +0 -1
  355. package/dist/components/Logo/LogoTextOnly.d.ts +0 -1
  356. package/dist/components/Logo/LogoWithTextBelowCircle.d.ts +0 -1
  357. package/dist/components/Logo/LogoWithTextBelowNoFrame.d.ts +0 -1
  358. package/dist/components/Logo/LogoWithTextBelowSquircle.d.ts +0 -1
  359. package/dist/components/Logo/LogoWithTextCircle.d.ts +0 -1
  360. package/dist/components/Logo/LogoWithTextNoFrame.d.ts +0 -1
  361. package/dist/components/Logo/LogoWithTextSquircle.d.ts +0 -1
  362. package/dist/components/Logo/index.d.ts +0 -1
  363. package/dist/components/MarkDownRender/index.d.ts +0 -1
  364. package/dist/components/MaxHeightSmoother/index.d.ts +0 -1
  365. package/dist/components/MaxWidthSmoother/index.d.ts +0 -1
  366. package/dist/components/Modal/Modal.cjs +19 -15
  367. package/dist/components/Modal/Modal.cjs.map +1 -1
  368. package/dist/components/Modal/Modal.d.ts +3 -3
  369. package/dist/components/Modal/Modal.d.ts.map +1 -1
  370. package/dist/components/Modal/Modal.mjs +19 -15
  371. package/dist/components/Modal/Modal.mjs.map +1 -1
  372. package/dist/components/Navbar/Burger.d.ts +0 -1
  373. package/dist/components/Navbar/DesktopNavbar.cjs +10 -26
  374. package/dist/components/Navbar/DesktopNavbar.cjs.map +1 -1
  375. package/dist/components/Navbar/DesktopNavbar.d.ts +6 -6
  376. package/dist/components/Navbar/DesktopNavbar.d.ts.map +1 -1
  377. package/dist/components/Navbar/DesktopNavbar.mjs +10 -26
  378. package/dist/components/Navbar/DesktopNavbar.mjs.map +1 -1
  379. package/dist/components/Navbar/MobileNavbar.cjs +3 -57
  380. package/dist/components/Navbar/MobileNavbar.cjs.map +1 -1
  381. package/dist/components/Navbar/MobileNavbar.d.ts +6 -7
  382. package/dist/components/Navbar/MobileNavbar.d.ts.map +1 -1
  383. package/dist/components/Navbar/MobileNavbar.mjs +3 -57
  384. package/dist/components/Navbar/MobileNavbar.mjs.map +1 -1
  385. package/dist/components/Navbar/index.cjs +4 -2
  386. package/dist/components/Navbar/index.cjs.map +1 -1
  387. package/dist/components/Navbar/index.d.ts +9 -15
  388. package/dist/components/Navbar/index.d.ts.map +1 -1
  389. package/dist/components/Navbar/index.mjs +4 -2
  390. package/dist/components/Navbar/index.mjs.map +1 -1
  391. package/dist/components/Pattern/DotPattern.d.ts +0 -1
  392. package/dist/components/Pattern/GridPattern.d.ts +0 -1
  393. package/dist/components/Pattern/SpotLight.d.ts +0 -1
  394. package/dist/components/Popover/index.d.ts +0 -1
  395. package/dist/components/PressableSpan/PressableSpan.d.ts +0 -1
  396. package/dist/components/ProfileDropDown/index.d.ts +0 -1
  397. package/dist/components/RightDrawer/RightDrawer.d.ts +0 -1
  398. package/dist/components/Select/Multiselect.d.ts +2 -3
  399. package/dist/components/Select/Multiselect.d.ts.map +1 -1
  400. package/dist/components/SwitchSelector/index.d.ts +1 -2
  401. package/dist/components/TabSelector/TabSelector.cjs +2 -0
  402. package/dist/components/TabSelector/TabSelector.cjs.map +1 -1
  403. package/dist/components/TabSelector/TabSelector.d.ts +2 -3
  404. package/dist/components/TabSelector/TabSelector.d.ts.map +1 -1
  405. package/dist/components/TabSelector/TabSelector.mjs +2 -0
  406. package/dist/components/TabSelector/TabSelector.mjs.map +1 -1
  407. package/dist/components/TextArea/AutoSizeTextArea.d.ts +0 -1
  408. package/dist/components/TextArea/TextArea.cjs +1 -0
  409. package/dist/components/TextArea/TextArea.cjs.map +1 -1
  410. package/dist/components/TextArea/TextArea.d.ts +0 -1
  411. package/dist/components/TextArea/TextArea.mjs +1 -0
  412. package/dist/components/TextArea/TextArea.mjs.map +1 -1
  413. package/dist/components/ThemeSwitcherDropDown/DesktopThemeSwitcher.d.ts +0 -1
  414. package/dist/components/ThemeSwitcherDropDown/MobileThemeSwitcher.d.ts +0 -1
  415. package/dist/components/Toaster/Toast.d.ts +1 -1
  416. package/dist/components/Toaster/useToast.d.ts +0 -1
  417. package/dist/components/WithResizer/index.d.ts +0 -1
  418. package/dist/components/index.cjs +4 -3
  419. package/dist/components/index.cjs.map +1 -1
  420. package/dist/components/index.d.ts +0 -1
  421. package/dist/components/index.d.ts.map +1 -1
  422. package/dist/components/index.mjs +4 -3
  423. package/dist/hooks/intlayerAPIHooks.cjs +16 -3
  424. package/dist/hooks/intlayerAPIHooks.cjs.map +1 -1
  425. package/dist/hooks/intlayerAPIHooks.d.ts +0 -1
  426. package/dist/hooks/intlayerAPIHooks.d.ts.map +1 -1
  427. package/dist/hooks/intlayerAPIHooks.mjs +16 -3
  428. package/dist/hooks/intlayerAPIHooks.mjs.map +1 -1
  429. package/dist/hooks/useAsync/useAsync.cjs +1 -5
  430. package/dist/hooks/useAsync/useAsync.cjs.map +1 -1
  431. package/dist/hooks/useAsync/useAsync.d.ts.map +1 -1
  432. package/dist/hooks/useAsync/useAsync.mjs +1 -5
  433. package/dist/hooks/useAsync/useAsync.mjs.map +1 -1
  434. package/dist/hooks/useAsync/useAsyncWrapper.d.ts +0 -1
  435. package/dist/hooks/useGetAllDictionaries.d.ts +0 -1
  436. package/dist/hooks/useItemSelector.d.ts +0 -1
  437. package/dist/index-BUDsCMdX.cjs +204 -0
  438. package/dist/index-BUDsCMdX.cjs.map +1 -0
  439. package/dist/index-C09rI9kw.js +205 -0
  440. package/dist/index-C09rI9kw.js.map +1 -0
  441. package/dist/libs/intlayer-api/auth.d.ts +0 -1
  442. package/dist/libs/intlayer-api/dictionary.d.ts +0 -1
  443. package/dist/libs/intlayer-api/fetcher.cjs +1 -6
  444. package/dist/libs/intlayer-api/fetcher.cjs.map +1 -1
  445. package/dist/libs/intlayer-api/fetcher.d.ts.map +1 -1
  446. package/dist/libs/intlayer-api/fetcher.mjs +1 -6
  447. package/dist/libs/intlayer-api/fetcher.mjs.map +1 -1
  448. package/dist/libs/intlayer-api/index.d.ts +0 -1
  449. package/dist/libs/intlayer-api/organization.d.ts +0 -1
  450. package/dist/libs/intlayer-api/project.d.ts +0 -1
  451. package/dist/libs/intlayer-api/user.d.ts +0 -1
  452. package/dist/tailwind.css +1 -1
  453. package/dist/utils/cn.d.ts +0 -1
  454. package/dist/utils/dictionary.cjs +37 -1
  455. package/dist/utils/dictionary.cjs.map +1 -1
  456. package/dist/utils/dictionary.d.ts +1 -1
  457. package/dist/utils/dictionary.d.ts.map +1 -1
  458. package/dist/utils/dictionary.mjs +38 -2
  459. package/dist/utils/dictionary.mjs.map +1 -1
  460. package/dist/validDictionaryChangeButtons.content-BK9QaXPm.cjs +66 -0
  461. package/dist/validDictionaryChangeButtons.content-BK9QaXPm.cjs.map +1 -0
  462. package/dist/validDictionaryChangeButtons.content-CAAscqJI.cjs +66 -0
  463. package/dist/validDictionaryChangeButtons.content-CAAscqJI.cjs.map +1 -0
  464. package/dist/validDictionaryChangeButtons.content-D7AvoBdl.js +67 -0
  465. package/dist/validDictionaryChangeButtons.content-D7AvoBdl.js.map +1 -0
  466. package/dist/validDictionaryChangeButtons.content-DQwoUNCC.cjs +45 -0
  467. package/dist/validDictionaryChangeButtons.content-DQwoUNCC.cjs.map +1 -0
  468. package/dist/validDictionaryChangeButtons.content-DQxPoIe6.js +67 -0
  469. package/dist/validDictionaryChangeButtons.content-DQxPoIe6.js.map +1 -0
  470. package/dist/validDictionaryChangeButtons.content-JUcjGdBx.cjs +66 -0
  471. package/dist/validDictionaryChangeButtons.content-JUcjGdBx.cjs.map +1 -0
  472. package/dist/validDictionaryChangeButtons.content-ejY3-sbG.js +67 -0
  473. package/dist/validDictionaryChangeButtons.content-ejY3-sbG.js.map +1 -0
  474. package/dist/validDictionaryChangeButtons.content-iyT0lKy7.js +46 -0
  475. package/dist/validDictionaryChangeButtons.content-iyT0lKy7.js.map +1 -0
  476. package/dist/validDictionaryChangeButtons.content-u4qShrQh.cjs +66 -0
  477. package/dist/validDictionaryChangeButtons.content-u4qShrQh.cjs.map +1 -0
  478. package/dist/validDictionaryChangeButtons.content-y4up9NU8.js +67 -0
  479. package/dist/validDictionaryChangeButtons.content-y4up9NU8.js.map +1 -0
  480. package/dist/zod-BV4nCGJE.js.map +1 -1
  481. package/dist/zod-DSrtTSD_.cjs.map +1 -1
  482. package/package.json +81 -54
@@ -15,13 +15,15 @@ require("@intlayer/core");
15
15
  require("clsx");
16
16
  require("tailwind-merge");
17
17
  require("../../Button/Button.cjs");
18
- require("../../TextArea/AutoSizeTextArea.cjs");
19
- require("../../TextArea/TextArea.cjs");
18
+ require("../../EditableField/EditableFieldInput.cjs");
19
+ require("../../EditableField/EditableFieldTextArea.cjs");
20
20
  const components_Form_FormBase = require("../../Form/FormBase.cjs");
21
21
  require("../../Form/FormField.cjs");
22
- const components_Form_layout_FormItemLayout = require("../../../Form-wWTTkxTp.cjs");
22
+ const components_Form_layout_FormItemLayout = require("../../../Form-DERuauvB.cjs");
23
23
  require("../../Toaster/Toast.cjs");
24
24
  const components_Toaster_useToast = require("../../Toaster/useToast.cjs");
25
+ require("../../DictionaryEditor/validDictionaryChangeButtons.content.cjs");
26
+ require("zod");
25
27
  const components_DictionaryFieldEditor_SaveForm_saveForm_content = require("./saveForm.content.cjs");
26
28
  const components_DictionaryFieldEditor_SaveForm_SaveFormSchema = require("./SaveFormSchema.cjs");
27
29
  const SaveForm = ({ dictionary }) => {
@@ -34,10 +36,8 @@ const SaveForm = ({ dictionary }) => {
34
36
  restoreEditedContent: s.restoreEditedContent
35
37
  })
36
38
  );
37
- const { form, isSubmitting } = components_Form_FormBase.useForm(SaveFormSchema, {
38
- defaultValues: dictionary
39
- });
40
- const { updateOrganizationToasts, resetButton, saveButton, publishButton } = reactIntlayer.useDictionary(components_DictionaryFieldEditor_SaveForm_saveForm_content.saveDictionaryContent);
39
+ const { form, isSubmitting } = components_Form_FormBase.useForm(SaveFormSchema);
40
+ const { updateDictionaryToasts, resetButton, saveButton, publishButton } = reactIntlayer.useDictionary(components_DictionaryFieldEditor_SaveForm_saveForm_content.saveDictionaryContent);
41
41
  const { toast } = components_Toaster_useToast.useToast();
42
42
  const editedDictionary = require$$0.useMemo(
43
43
  () => editedContent[dictionary.key],
@@ -62,28 +62,27 @@ const SaveForm = ({ dictionary }) => {
62
62
  }
63
63
  ]).then(() => {
64
64
  toast({
65
- title: updateOrganizationToasts.updated.title.value,
66
- description: updateOrganizationToasts.updated.description,
65
+ title: updateDictionaryToasts.updated.title.value,
66
+ description: updateDictionaryToasts.updated.description,
67
67
  variant: "success"
68
68
  });
69
69
  }).catch((error) => {
70
70
  toast({
71
- title: updateOrganizationToasts.failed.title.value,
71
+ title: updateDictionaryToasts.failed.title.value,
72
72
  description: error.message,
73
73
  variant: "error"
74
74
  });
75
75
  });
76
76
  };
77
- if (!isEdited) return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(jsxRuntime.jsxRuntimeExports.Fragment, {});
78
77
  return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsxs(
79
78
  components_Form_layout_FormItemLayout.Form,
80
79
  {
81
- className: "flex size-full h-full flex-1 flex-row gap-3",
80
+ className: "flex w-full flex-1 flex-row justify-end gap-3",
82
81
  ...form,
83
82
  schema: SaveFormSchema,
84
83
  onSubmitSuccess,
85
84
  children: [
86
- /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
85
+ isEdited && /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
87
86
  components_Form_layout_FormItemLayout.Form.Button,
88
87
  {
89
88
  type: "button",
@@ -107,9 +106,9 @@ const SaveForm = ({ dictionary }) => {
107
106
  Icon: lucideReact.ArrowUpFromLine,
108
107
  color: "text",
109
108
  isLoading: isSubmitting,
110
- children: saveButton.text
109
+ children: publishButton.text
111
110
  }
112
- ) : /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
111
+ ) : isEdited && /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
113
112
  components_Form_layout_FormItemLayout.Form.Button,
114
113
  {
115
114
  type: "submit",
@@ -1 +1 @@
1
- {"version":3,"file":"SaveForm.cjs","sources":["../../../../src/components/DictionaryFieldEditor/SaveForm/SaveForm.tsx"],"sourcesContent":["'use client';\n\nimport { Dictionary as DistantDictionary } from '@intlayer/backend';\nimport { Dictionary } from '@intlayer/core';\nimport { ArrowUpFromLine, RotateCcw, Save } from 'lucide-react';\nimport { useMemo, type FC } from 'react';\nimport { useDictionary } from 'react-intlayer';\nimport { useGetAllDictionaries, usePushDictionaries } from '../../../hooks';\nimport { useEditedContentStore } from '../../DictionaryEditor';\nimport { Form, useForm } from '../../Form';\nimport { useToast } from '../../Toaster';\nimport { saveDictionaryContent } from './saveForm.content';\nimport { getSaveFormSchema } from './SaveFormSchema';\n\ntype DictionaryDetailsProps = {\n dictionary: Dictionary;\n};\n\nexport const SaveForm: FC<DictionaryDetailsProps> = ({ dictionary }) => {\n const { pushDictionaries } = usePushDictionaries();\n const SaveFormSchema = getSaveFormSchema();\n const { online } = useGetAllDictionaries();\n\n const { editedContent, restoreEditedContent } = useEditedContentStore(\n (s) => ({\n editedContent: s.editedContent,\n restoreEditedContent: s.restoreEditedContent,\n })\n );\n const { form, isSubmitting } = useForm(SaveFormSchema, {\n defaultValues: dictionary,\n });\n const { updateOrganizationToasts, resetButton, saveButton, publishButton } =\n useDictionary(saveDictionaryContent);\n const { toast } = useToast();\n\n const editedDictionary = useMemo(\n () => editedContent[dictionary.key],\n [editedContent, dictionary.key]\n );\n\n const onlineDictionary = useMemo(() => {\n return online?.[dictionary.key];\n }, [online, dictionary.key]);\n\n const isEdited = useMemo(\n () =>\n editedDictionary &&\n JSON.stringify(editedDictionary?.content) !==\n JSON.stringify(onlineDictionary?.content),\n [onlineDictionary, editedDictionary]\n );\n\n const isLocalDictionary = useMemo(\n () => typeof (dictionary as DistantDictionary)?._id === 'undefined',\n [dictionary]\n );\n\n const onSubmitSuccess = async () => {\n await pushDictionaries([\n {\n ...dictionary,\n ...editedContent[dictionary.key],\n },\n ])\n .then(() => {\n toast({\n title: updateOrganizationToasts.updated.title.value,\n description: updateOrganizationToasts.updated.description,\n variant: 'success',\n });\n })\n .catch((error) => {\n toast({\n title: updateOrganizationToasts.failed.title.value,\n description: error.message,\n variant: 'error',\n });\n });\n };\n\n if (!isEdited) return <></>;\n\n return (\n <Form\n className=\"flex size-full h-full flex-1 flex-row gap-3\"\n {...form}\n schema={SaveFormSchema}\n onSubmitSuccess={onSubmitSuccess}\n >\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 isLoading={isSubmitting}\n onClick={() => restoreEditedContent(dictionary.key)}\n >\n {resetButton.text}\n </Form.Button>\n {isLocalDictionary ? (\n <Form.Button\n type=\"submit\"\n label={publishButton.label.value}\n disabled={!isEdited || isSubmitting}\n Icon={ArrowUpFromLine}\n color=\"text\"\n isLoading={isSubmitting}\n >\n {saveButton.text}\n </Form.Button>\n ) : (\n <Form.Button\n type=\"submit\"\n label={saveButton.label.value}\n disabled={!isEdited || isSubmitting}\n Icon={Save}\n color=\"text\"\n isLoading={isSubmitting}\n >\n {saveButton.text}\n </Form.Button>\n )}\n </Form>\n );\n};\n"],"names":["usePushDictionaries","getSaveFormSchema","useGetAllDictionaries","useEditedContentStore","useForm","useDictionary","saveDictionaryContent","useToast","useMemo","jsx","Fragment","jsxs","Form","RotateCcw","ArrowUpFromLine","Save"],"mappings":"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"}
1
+ {"version":3,"file":"SaveForm.cjs","sources":["../../../../src/components/DictionaryFieldEditor/SaveForm/SaveForm.tsx"],"sourcesContent":["'use client';\n\nimport { Dictionary as DistantDictionary } from '@intlayer/backend';\nimport { Dictionary } from '@intlayer/core';\nimport { ArrowUpFromLine, RotateCcw, Save } from 'lucide-react';\nimport { useMemo, type FC } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { useGetAllDictionaries, usePushDictionaries } from '../../../hooks';\nimport { useEditedContentStore } from '../../DictionaryEditor';\nimport { Form, useForm } from '../../Form';\nimport { useToast } from '../../Toaster';\nimport { saveDictionaryContent } from './saveForm.content';\nimport { getSaveFormSchema } from './SaveFormSchema';\n\ntype DictionaryDetailsProps = {\n dictionary: Dictionary;\n};\n\nexport const SaveForm: FC<DictionaryDetailsProps> = ({ dictionary }) => {\n const { pushDictionaries } = usePushDictionaries();\n const SaveFormSchema = getSaveFormSchema();\n const { online } = useGetAllDictionaries();\n\n const { editedContent, restoreEditedContent } = useEditedContentStore(\n (s) => ({\n editedContent: s.editedContent,\n restoreEditedContent: s.restoreEditedContent,\n })\n );\n const { form, isSubmitting } = useForm(SaveFormSchema);\n const { updateDictionaryToasts, resetButton, saveButton, publishButton } =\n useDictionary(saveDictionaryContent);\n const { toast } = useToast();\n\n const editedDictionary = useMemo(\n () => editedContent[dictionary.key],\n [editedContent, dictionary.key]\n );\n\n const onlineDictionary = useMemo(() => {\n return online?.[dictionary.key];\n }, [online, dictionary.key]);\n\n const isEdited = useMemo(\n () =>\n editedDictionary &&\n JSON.stringify(editedDictionary?.content) !==\n JSON.stringify(onlineDictionary?.content),\n [onlineDictionary, editedDictionary]\n );\n\n const isLocalDictionary = useMemo(\n () => typeof (dictionary as DistantDictionary)?._id === 'undefined',\n [dictionary]\n );\n\n const onSubmitSuccess = async () => {\n await pushDictionaries([\n {\n ...dictionary,\n ...editedContent[dictionary.key],\n },\n ])\n .then(() => {\n toast({\n title: updateDictionaryToasts.updated.title.value,\n description: updateDictionaryToasts.updated.description,\n variant: 'success',\n });\n })\n .catch((error) => {\n toast({\n title: updateDictionaryToasts.failed.title.value,\n description: error.message,\n variant: 'error',\n });\n });\n };\n\n return (\n <Form\n className=\"flex w-full flex-1 flex-row justify-end gap-3\"\n {...form}\n schema={SaveFormSchema}\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 isLoading={isSubmitting}\n onClick={() => restoreEditedContent(dictionary.key)}\n >\n {resetButton.text}\n </Form.Button>\n )}\n {isLocalDictionary ? (\n <Form.Button\n type=\"submit\"\n label={publishButton.label.value}\n disabled={!isEdited || isSubmitting}\n Icon={ArrowUpFromLine}\n color=\"text\"\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 isLoading={isSubmitting}\n >\n {saveButton.text}\n </Form.Button>\n )\n )}\n </Form>\n );\n};\n"],"names":["usePushDictionaries","getSaveFormSchema","useGetAllDictionaries","useEditedContentStore","useForm","useDictionary","saveDictionaryContent","useToast","useMemo","jsxs","Form","jsx","RotateCcw","ArrowUpFromLine","Save"],"mappings":"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"}
@@ -1,6 +1,5 @@
1
1
  import { Dictionary } from '@intlayer/core';
2
2
  import { FC } from 'react';
3
-
4
3
  type DictionaryDetailsProps = {
5
4
  dictionary: Dictionary;
6
5
  };
@@ -1 +1 @@
1
- {"version":3,"file":"SaveForm.d.ts","sourceRoot":"","sources":["../../../../src/components/DictionaryFieldEditor/SaveForm/SaveForm.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C,OAAO,EAAW,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AASzC,KAAK,sBAAsB,GAAG;IAC5B,UAAU,EAAE,UAAU,CAAC;CACxB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,EAAE,CAAC,sBAAsB,CA8G/C,CAAC"}
1
+ {"version":3,"file":"SaveForm.d.ts","sourceRoot":"","sources":["../../../../src/components/DictionaryFieldEditor/SaveForm/SaveForm.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C,OAAO,EAAW,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAUzC,KAAK,sBAAsB,GAAG;IAC5B,UAAU,EAAE,UAAU,CAAC;CACxB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,EAAE,CAAC,sBAAsB,CA8G/C,CAAC"}
@@ -13,13 +13,15 @@ import "@intlayer/core";
13
13
  import "clsx";
14
14
  import "tailwind-merge";
15
15
  import "../../Button/Button.mjs";
16
- import "../../TextArea/AutoSizeTextArea.mjs";
17
- import "../../TextArea/TextArea.mjs";
16
+ import "../../EditableField/EditableFieldInput.mjs";
17
+ import "../../EditableField/EditableFieldTextArea.mjs";
18
18
  import { useForm } from "../../Form/FormBase.mjs";
19
19
  import "../../Form/FormField.mjs";
20
- import { F as Form } from "../../../Form-Cbu7ff1e.js";
20
+ import { F as Form } from "../../../Form-DyFBmVya.js";
21
21
  import "../../Toaster/Toast.mjs";
22
22
  import { useToast } from "../../Toaster/useToast.mjs";
23
+ import "../../DictionaryEditor/validDictionaryChangeButtons.content.mjs";
24
+ import "zod";
23
25
  import { saveDictionaryContent } from "./saveForm.content.mjs";
24
26
  import { getSaveFormSchema } from "./SaveFormSchema.mjs";
25
27
  const SaveForm = ({ dictionary }) => {
@@ -32,10 +34,8 @@ const SaveForm = ({ dictionary }) => {
32
34
  restoreEditedContent: s.restoreEditedContent
33
35
  })
34
36
  );
35
- const { form, isSubmitting } = useForm(SaveFormSchema, {
36
- defaultValues: dictionary
37
- });
38
- const { updateOrganizationToasts, resetButton, saveButton, publishButton } = useDictionary(saveDictionaryContent);
37
+ const { form, isSubmitting } = useForm(SaveFormSchema);
38
+ const { updateDictionaryToasts, resetButton, saveButton, publishButton } = useDictionary(saveDictionaryContent);
39
39
  const { toast } = useToast();
40
40
  const editedDictionary = useMemo(
41
41
  () => editedContent[dictionary.key],
@@ -60,28 +60,27 @@ const SaveForm = ({ dictionary }) => {
60
60
  }
61
61
  ]).then(() => {
62
62
  toast({
63
- title: updateOrganizationToasts.updated.title.value,
64
- description: updateOrganizationToasts.updated.description,
63
+ title: updateDictionaryToasts.updated.title.value,
64
+ description: updateDictionaryToasts.updated.description,
65
65
  variant: "success"
66
66
  });
67
67
  }).catch((error) => {
68
68
  toast({
69
- title: updateOrganizationToasts.failed.title.value,
69
+ title: updateDictionaryToasts.failed.title.value,
70
70
  description: error.message,
71
71
  variant: "error"
72
72
  });
73
73
  });
74
74
  };
75
- if (!isEdited) return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {});
76
75
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(
77
76
  Form,
78
77
  {
79
- className: "flex size-full h-full flex-1 flex-row gap-3",
78
+ className: "flex w-full flex-1 flex-row justify-end gap-3",
80
79
  ...form,
81
80
  schema: SaveFormSchema,
82
81
  onSubmitSuccess,
83
82
  children: [
84
- /* @__PURE__ */ jsxRuntimeExports.jsx(
83
+ isEdited && /* @__PURE__ */ jsxRuntimeExports.jsx(
85
84
  Form.Button,
86
85
  {
87
86
  type: "button",
@@ -105,9 +104,9 @@ const SaveForm = ({ dictionary }) => {
105
104
  Icon: ArrowUpFromLine,
106
105
  color: "text",
107
106
  isLoading: isSubmitting,
108
- children: saveButton.text
107
+ children: publishButton.text
109
108
  }
110
- ) : /* @__PURE__ */ jsxRuntimeExports.jsx(
109
+ ) : isEdited && /* @__PURE__ */ jsxRuntimeExports.jsx(
111
110
  Form.Button,
112
111
  {
113
112
  type: "submit",
@@ -1 +1 @@
1
- {"version":3,"file":"SaveForm.mjs","sources":["../../../../src/components/DictionaryFieldEditor/SaveForm/SaveForm.tsx"],"sourcesContent":["'use client';\n\nimport { Dictionary as DistantDictionary } from '@intlayer/backend';\nimport { Dictionary } from '@intlayer/core';\nimport { ArrowUpFromLine, RotateCcw, Save } from 'lucide-react';\nimport { useMemo, type FC } from 'react';\nimport { useDictionary } from 'react-intlayer';\nimport { useGetAllDictionaries, usePushDictionaries } from '../../../hooks';\nimport { useEditedContentStore } from '../../DictionaryEditor';\nimport { Form, useForm } from '../../Form';\nimport { useToast } from '../../Toaster';\nimport { saveDictionaryContent } from './saveForm.content';\nimport { getSaveFormSchema } from './SaveFormSchema';\n\ntype DictionaryDetailsProps = {\n dictionary: Dictionary;\n};\n\nexport const SaveForm: FC<DictionaryDetailsProps> = ({ dictionary }) => {\n const { pushDictionaries } = usePushDictionaries();\n const SaveFormSchema = getSaveFormSchema();\n const { online } = useGetAllDictionaries();\n\n const { editedContent, restoreEditedContent } = useEditedContentStore(\n (s) => ({\n editedContent: s.editedContent,\n restoreEditedContent: s.restoreEditedContent,\n })\n );\n const { form, isSubmitting } = useForm(SaveFormSchema, {\n defaultValues: dictionary,\n });\n const { updateOrganizationToasts, resetButton, saveButton, publishButton } =\n useDictionary(saveDictionaryContent);\n const { toast } = useToast();\n\n const editedDictionary = useMemo(\n () => editedContent[dictionary.key],\n [editedContent, dictionary.key]\n );\n\n const onlineDictionary = useMemo(() => {\n return online?.[dictionary.key];\n }, [online, dictionary.key]);\n\n const isEdited = useMemo(\n () =>\n editedDictionary &&\n JSON.stringify(editedDictionary?.content) !==\n JSON.stringify(onlineDictionary?.content),\n [onlineDictionary, editedDictionary]\n );\n\n const isLocalDictionary = useMemo(\n () => typeof (dictionary as DistantDictionary)?._id === 'undefined',\n [dictionary]\n );\n\n const onSubmitSuccess = async () => {\n await pushDictionaries([\n {\n ...dictionary,\n ...editedContent[dictionary.key],\n },\n ])\n .then(() => {\n toast({\n title: updateOrganizationToasts.updated.title.value,\n description: updateOrganizationToasts.updated.description,\n variant: 'success',\n });\n })\n .catch((error) => {\n toast({\n title: updateOrganizationToasts.failed.title.value,\n description: error.message,\n variant: 'error',\n });\n });\n };\n\n if (!isEdited) return <></>;\n\n return (\n <Form\n className=\"flex size-full h-full flex-1 flex-row gap-3\"\n {...form}\n schema={SaveFormSchema}\n onSubmitSuccess={onSubmitSuccess}\n >\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 isLoading={isSubmitting}\n onClick={() => restoreEditedContent(dictionary.key)}\n >\n {resetButton.text}\n </Form.Button>\n {isLocalDictionary ? (\n <Form.Button\n type=\"submit\"\n label={publishButton.label.value}\n disabled={!isEdited || isSubmitting}\n Icon={ArrowUpFromLine}\n color=\"text\"\n isLoading={isSubmitting}\n >\n {saveButton.text}\n </Form.Button>\n ) : (\n <Form.Button\n type=\"submit\"\n label={saveButton.label.value}\n disabled={!isEdited || isSubmitting}\n Icon={Save}\n color=\"text\"\n isLoading={isSubmitting}\n >\n {saveButton.text}\n </Form.Button>\n )}\n </Form>\n );\n};\n"],"names":["jsx","Fragment","jsxs"],"mappings":"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"}
1
+ {"version":3,"file":"SaveForm.mjs","sources":["../../../../src/components/DictionaryFieldEditor/SaveForm/SaveForm.tsx"],"sourcesContent":["'use client';\n\nimport { Dictionary as DistantDictionary } from '@intlayer/backend';\nimport { Dictionary } from '@intlayer/core';\nimport { ArrowUpFromLine, RotateCcw, Save } from 'lucide-react';\nimport { useMemo, type FC } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { useGetAllDictionaries, usePushDictionaries } from '../../../hooks';\nimport { useEditedContentStore } from '../../DictionaryEditor';\nimport { Form, useForm } from '../../Form';\nimport { useToast } from '../../Toaster';\nimport { saveDictionaryContent } from './saveForm.content';\nimport { getSaveFormSchema } from './SaveFormSchema';\n\ntype DictionaryDetailsProps = {\n dictionary: Dictionary;\n};\n\nexport const SaveForm: FC<DictionaryDetailsProps> = ({ dictionary }) => {\n const { pushDictionaries } = usePushDictionaries();\n const SaveFormSchema = getSaveFormSchema();\n const { online } = useGetAllDictionaries();\n\n const { editedContent, restoreEditedContent } = useEditedContentStore(\n (s) => ({\n editedContent: s.editedContent,\n restoreEditedContent: s.restoreEditedContent,\n })\n );\n const { form, isSubmitting } = useForm(SaveFormSchema);\n const { updateDictionaryToasts, resetButton, saveButton, publishButton } =\n useDictionary(saveDictionaryContent);\n const { toast } = useToast();\n\n const editedDictionary = useMemo(\n () => editedContent[dictionary.key],\n [editedContent, dictionary.key]\n );\n\n const onlineDictionary = useMemo(() => {\n return online?.[dictionary.key];\n }, [online, dictionary.key]);\n\n const isEdited = useMemo(\n () =>\n editedDictionary &&\n JSON.stringify(editedDictionary?.content) !==\n JSON.stringify(onlineDictionary?.content),\n [onlineDictionary, editedDictionary]\n );\n\n const isLocalDictionary = useMemo(\n () => typeof (dictionary as DistantDictionary)?._id === 'undefined',\n [dictionary]\n );\n\n const onSubmitSuccess = async () => {\n await pushDictionaries([\n {\n ...dictionary,\n ...editedContent[dictionary.key],\n },\n ])\n .then(() => {\n toast({\n title: updateDictionaryToasts.updated.title.value,\n description: updateDictionaryToasts.updated.description,\n variant: 'success',\n });\n })\n .catch((error) => {\n toast({\n title: updateDictionaryToasts.failed.title.value,\n description: error.message,\n variant: 'error',\n });\n });\n };\n\n return (\n <Form\n className=\"flex w-full flex-1 flex-row justify-end gap-3\"\n {...form}\n schema={SaveFormSchema}\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 isLoading={isSubmitting}\n onClick={() => restoreEditedContent(dictionary.key)}\n >\n {resetButton.text}\n </Form.Button>\n )}\n {isLocalDictionary ? (\n <Form.Button\n type=\"submit\"\n label={publishButton.label.value}\n disabled={!isEdited || isSubmitting}\n Icon={ArrowUpFromLine}\n color=\"text\"\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 isLoading={isSubmitting}\n >\n {saveButton.text}\n </Form.Button>\n )\n )}\n </Form>\n );\n};\n"],"names":["jsxs","jsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAmBO,MAAM,WAAuC,CAAC,EAAE,iBAAiB;AAChE,QAAA,EAAE,qBAAqB;AAC7B,QAAM,iBAAiB;AACjB,QAAA,EAAE,WAAW;AAEb,QAAA,EAAE,eAAe,qBAAA,IAAyB;AAAA,IAC9C,CAAC,OAAO;AAAA,MACN,eAAe,EAAE;AAAA,MACjB,sBAAsB,EAAE;AAAA,IAAA;AAAA,EAC1B;AAEF,QAAM,EAAE,MAAM,aAAa,IAAI,QAAQ,cAAc;AACrD,QAAM,EAAE,wBAAwB,aAAa,YAAY,kBACvD,cAAc,qBAAqB;AAC/B,QAAA,EAAE,UAAU;AAElB,QAAM,mBAAmB;AAAA,IACvB,MAAM,cAAc,WAAW,GAAG;AAAA,IAClC,CAAC,eAAe,WAAW,GAAG;AAAA,EAAA;AAG1B,QAAA,mBAAmB,QAAQ,MAAM;AAC9B,WAAA,SAAS,WAAW,GAAG;AAAA,EAC7B,GAAA,CAAC,QAAQ,WAAW,GAAG,CAAC;AAE3B,QAAM,WAAW;AAAA,IACf,MACE,oBACA,KAAK,UAAU,kBAAkB,OAAO,MACtC,KAAK,UAAU,kBAAkB,OAAO;AAAA,IAC5C,CAAC,kBAAkB,gBAAgB;AAAA,EAAA;AAGrC,QAAM,oBAAoB;AAAA,IACxB,MAAM,OAAQ,YAAkC,QAAQ;AAAA,IACxD,CAAC,UAAU;AAAA,EAAA;AAGb,QAAM,kBAAkB,YAAY;AAClC,UAAM,iBAAiB;AAAA,MACrB;AAAA,QACE,GAAG;AAAA,QACH,GAAG,cAAc,WAAW,GAAG;AAAA,MACjC;AAAA,IAAA,CACD,EACE,KAAK,MAAM;AACJ,YAAA;AAAA,QACJ,OAAO,uBAAuB,QAAQ,MAAM;AAAA,QAC5C,aAAa,uBAAuB,QAAQ;AAAA,QAC5C,SAAS;AAAA,MAAA,CACV;AAAA,IAAA,CACF,EACA,MAAM,CAAC,UAAU;AACV,YAAA;AAAA,QACJ,OAAO,uBAAuB,OAAO,MAAM;AAAA,QAC3C,aAAa,MAAM;AAAA,QACnB,SAAS;AAAA,MAAA,CACV;AAAA,IAAA,CACF;AAAA,EAAA;AAIH,SAAAA,kCAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAU;AAAA,MACT,GAAG;AAAA,MACJ,QAAQ;AAAA,MACR;AAAA,MAEC,UAAA;AAAA,QACC,YAAAC,kCAAA;AAAA,UAAC,KAAK;AAAA,UAAL;AAAA,YACC,MAAK;AAAA,YACL,OAAO,YAAY,MAAM;AAAA,YACzB,UAAU,CAAC,YAAY;AAAA,YACvB,WAAU;AAAA,YACV,MAAM;AAAA,YACN,SAAQ;AAAA,YACR,OAAM;AAAA,YACN,WAAW;AAAA,YACX,SAAS,MAAM,qBAAqB,WAAW,GAAG;AAAA,YAEjD,UAAY,YAAA;AAAA,UAAA;AAAA,QACf;AAAA,QAED,oBACCA,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,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,WAAW;AAAA,YAEV,UAAW,WAAA;AAAA,UAAA;AAAA,QACd;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAKV;"}
@@ -1,5 +1,4 @@
1
1
  import { z } from 'zod';
2
-
3
2
  export declare const getSaveFormSchema: () => z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
4
3
  export type SaveFormData = z.infer<ReturnType<typeof getSaveFormSchema>>;
5
4
  //# sourceMappingURL=SaveFormSchema.d.ts.map
@@ -31,33 +31,33 @@ const saveDictionaryContent = {
31
31
  publishButton: {
32
32
  text: intlayer.t({
33
33
  en: "Publish dictionary",
34
- fr: "Publier les dictionnaires",
34
+ fr: "Publier dictionnaire",
35
35
  es: "Publicar diccionario"
36
36
  }),
37
37
  label: intlayer.t({
38
38
  en: "Click to publish dictionary",
39
- fr: "Cliquez pour publier les dictionnaires",
39
+ fr: "Cliquez pour publier dictionnaire",
40
40
  es: "Haga clic para publicar el diccionario"
41
41
  })
42
42
  },
43
- updateOrganizationToasts: {
43
+ updateDictionaryToasts: {
44
44
  updated: {
45
45
  title: intlayer.t({
46
- en: "Organization updated",
47
- fr: "Organisation mise à jour",
48
- es: "Organización actualizada"
46
+ en: "Dictionary updated",
47
+ fr: "Dictionnaire mis à jour",
48
+ es: "Diccionario actualizado"
49
49
  }),
50
50
  description: intlayer.t({
51
- en: "Your organization has been updated successfully",
52
- fr: "Votre organisation a été mise à jour avec succès",
53
- es: "Su organización se ha actualizado con éxito"
51
+ en: "Your dictionary has been updated successfully",
52
+ fr: "Votre dictionnaire a été mis à jour avec succès",
53
+ es: "Su diccionario se ha actualizado con éxito"
54
54
  })
55
55
  },
56
56
  failed: {
57
57
  title: intlayer.t({
58
- en: "Organization update failed",
59
- fr: "La mise à jour de l'organisation a échoué",
60
- es: "La actualización de la organización ha fallado"
58
+ en: "Dictionary update failed",
59
+ fr: "La mise à jour du dictionnaire a échoué",
60
+ es: "La actualización del diccionario ha fallado"
61
61
  })
62
62
  }
63
63
  }
@@ -1 +1 @@
1
- {"version":3,"file":"saveForm.content.cjs","sources":["../../../../src/components/DictionaryFieldEditor/SaveForm/saveForm.content.tsx"],"sourcesContent":["import { t, type DeclarationContent } from 'intlayer';\n\nexport const saveDictionaryContent = {\n key: 'save-dictionary-details',\n content: {\n resetButton: {\n text: t({\n en: 'Reset changes',\n fr: 'Réinitialiser les modifications',\n es: 'Restablecer cambios',\n }),\n label: t({\n en: 'Click to reset changes',\n fr: 'Cliquez pour réinitialiser les modifications',\n es: 'Haga clic para restablecer los cambios',\n }),\n },\n saveButton: {\n text: t({\n en: 'Save changes',\n fr: 'Enregistrer les modifications',\n es: 'Guardar cambios',\n }),\n label: t({\n en: 'Click to save changes',\n fr: 'Cliquez pour enregistrer les modifications',\n es: 'Haga clic para guardar los cambios',\n }),\n },\n publishButton: {\n text: t({\n en: 'Publish dictionary',\n fr: 'Publier les dictionnaires',\n es: 'Publicar diccionario',\n }),\n label: t({\n en: 'Click to publish dictionary',\n fr: 'Cliquez pour publier les dictionnaires',\n es: 'Haga clic para publicar el diccionario',\n }),\n },\n updateOrganizationToasts: {\n updated: {\n title: t({\n en: 'Organization updated',\n fr: 'Organisation mise à jour',\n es: 'Organización actualizada',\n }),\n description: t({\n en: 'Your organization has been updated successfully',\n fr: 'Votre organisation a été mise à jour avec succès',\n es: 'Su organización se ha actualizado con éxito',\n }),\n },\n failed: {\n title: t({\n en: 'Organization update failed',\n fr: \"La mise à jour de l'organisation a échoué\",\n es: 'La actualización de la organización ha fallado',\n }),\n },\n },\n },\n} satisfies DeclarationContent;\n"],"names":["t"],"mappings":";;;AAEO,MAAM,wBAAwB;AAAA,EACnC,KAAK;AAAA,EACL,SAAS;AAAA,IACP,aAAa;AAAA,MACX,MAAMA,SAAAA,EAAE;AAAA,QACN,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,MACD,OAAOA,SAAAA,EAAE;AAAA,QACP,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,IACH;AAAA,IACA,YAAY;AAAA,MACV,MAAMA,SAAAA,EAAE;AAAA,QACN,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,MACD,OAAOA,SAAAA,EAAE;AAAA,QACP,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,IACH;AAAA,IACA,eAAe;AAAA,MACb,MAAMA,SAAAA,EAAE;AAAA,QACN,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,MACD,OAAOA,SAAAA,EAAE;AAAA,QACP,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,IACH;AAAA,IACA,0BAA0B;AAAA,MACxB,SAAS;AAAA,QACP,OAAOA,SAAAA,EAAE;AAAA,UACP,IAAI;AAAA,UACJ,IAAI;AAAA,UACJ,IAAI;AAAA,QAAA,CACL;AAAA,QACD,aAAaA,SAAAA,EAAE;AAAA,UACb,IAAI;AAAA,UACJ,IAAI;AAAA,UACJ,IAAI;AAAA,QAAA,CACL;AAAA,MACH;AAAA,MACA,QAAQ;AAAA,QACN,OAAOA,SAAAA,EAAE;AAAA,UACP,IAAI;AAAA,UACJ,IAAI;AAAA,UACJ,IAAI;AAAA,QAAA,CACL;AAAA,MACH;AAAA,IACF;AAAA,EACF;AACF;;"}
1
+ {"version":3,"file":"saveForm.content.cjs","sources":["../../../../src/components/DictionaryFieldEditor/SaveForm/saveForm.content.tsx"],"sourcesContent":["import { t, type DeclarationContent } from 'intlayer';\n\nexport const saveDictionaryContent = {\n key: 'save-dictionary-details',\n content: {\n resetButton: {\n text: t({\n en: 'Reset changes',\n fr: 'Réinitialiser les modifications',\n es: 'Restablecer cambios',\n }),\n label: t({\n en: 'Click to reset changes',\n fr: 'Cliquez pour réinitialiser les modifications',\n es: 'Haga clic para restablecer los cambios',\n }),\n },\n saveButton: {\n text: t({\n en: 'Save changes',\n fr: 'Enregistrer les modifications',\n es: 'Guardar cambios',\n }),\n label: t({\n en: 'Click to save changes',\n fr: 'Cliquez pour enregistrer les modifications',\n es: 'Haga clic para guardar los cambios',\n }),\n },\n publishButton: {\n text: t({\n en: 'Publish dictionary',\n fr: 'Publier dictionnaire',\n es: 'Publicar diccionario',\n }),\n label: t({\n en: 'Click to publish dictionary',\n fr: 'Cliquez pour publier dictionnaire',\n es: 'Haga clic para publicar el diccionario',\n }),\n },\n updateDictionaryToasts: {\n updated: {\n title: t({\n en: 'Dictionary updated',\n fr: 'Dictionnaire mis à jour',\n es: 'Diccionario actualizado',\n }),\n description: t({\n en: 'Your dictionary has been updated successfully',\n fr: 'Votre dictionnaire a été mis à jour avec succès',\n es: 'Su diccionario se ha actualizado con éxito',\n }),\n },\n failed: {\n title: t({\n en: 'Dictionary update failed',\n fr: 'La mise à jour du dictionnaire a échoué',\n es: 'La actualización del diccionario ha fallado',\n }),\n },\n },\n },\n} satisfies DeclarationContent;\n"],"names":["t"],"mappings":";;;AAEO,MAAM,wBAAwB;AAAA,EACnC,KAAK;AAAA,EACL,SAAS;AAAA,IACP,aAAa;AAAA,MACX,MAAMA,SAAAA,EAAE;AAAA,QACN,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,MACD,OAAOA,SAAAA,EAAE;AAAA,QACP,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,IACH;AAAA,IACA,YAAY;AAAA,MACV,MAAMA,SAAAA,EAAE;AAAA,QACN,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,MACD,OAAOA,SAAAA,EAAE;AAAA,QACP,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,IACH;AAAA,IACA,eAAe;AAAA,MACb,MAAMA,SAAAA,EAAE;AAAA,QACN,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,MACD,OAAOA,SAAAA,EAAE;AAAA,QACP,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,IACH;AAAA,IACA,wBAAwB;AAAA,MACtB,SAAS;AAAA,QACP,OAAOA,SAAAA,EAAE;AAAA,UACP,IAAI;AAAA,UACJ,IAAI;AAAA,UACJ,IAAI;AAAA,QAAA,CACL;AAAA,QACD,aAAaA,SAAAA,EAAE;AAAA,UACb,IAAI;AAAA,UACJ,IAAI;AAAA,UACJ,IAAI;AAAA,QAAA,CACL;AAAA,MACH;AAAA,MACA,QAAQ;AAAA,QACN,OAAOA,SAAAA,EAAE;AAAA,UACP,IAAI;AAAA,UACJ,IAAI;AAAA,UACJ,IAAI;AAAA,QAAA,CACL;AAAA,MACH;AAAA,IACF;AAAA,EACF;AACF;;"}
@@ -13,7 +13,7 @@ export declare const saveDictionaryContent: {
13
13
  text: import('@intlayer/core').TranslationContent<string>;
14
14
  label: import('@intlayer/core').TranslationContent<string>;
15
15
  };
16
- updateOrganizationToasts: {
16
+ updateDictionaryToasts: {
17
17
  updated: {
18
18
  title: import('@intlayer/core').TranslationContent<string>;
19
19
  description: import('@intlayer/core').TranslationContent<string>;
@@ -29,33 +29,33 @@ const saveDictionaryContent = {
29
29
  publishButton: {
30
30
  text: t({
31
31
  en: "Publish dictionary",
32
- fr: "Publier les dictionnaires",
32
+ fr: "Publier dictionnaire",
33
33
  es: "Publicar diccionario"
34
34
  }),
35
35
  label: t({
36
36
  en: "Click to publish dictionary",
37
- fr: "Cliquez pour publier les dictionnaires",
37
+ fr: "Cliquez pour publier dictionnaire",
38
38
  es: "Haga clic para publicar el diccionario"
39
39
  })
40
40
  },
41
- updateOrganizationToasts: {
41
+ updateDictionaryToasts: {
42
42
  updated: {
43
43
  title: t({
44
- en: "Organization updated",
45
- fr: "Organisation mise à jour",
46
- es: "Organización actualizada"
44
+ en: "Dictionary updated",
45
+ fr: "Dictionnaire mis à jour",
46
+ es: "Diccionario actualizado"
47
47
  }),
48
48
  description: t({
49
- en: "Your organization has been updated successfully",
50
- fr: "Votre organisation a été mise à jour avec succès",
51
- es: "Su organización se ha actualizado con éxito"
49
+ en: "Your dictionary has been updated successfully",
50
+ fr: "Votre dictionnaire a été mis à jour avec succès",
51
+ es: "Su diccionario se ha actualizado con éxito"
52
52
  })
53
53
  },
54
54
  failed: {
55
55
  title: t({
56
- en: "Organization update failed",
57
- fr: "La mise à jour de l'organisation a échoué",
58
- es: "La actualización de la organización ha fallado"
56
+ en: "Dictionary update failed",
57
+ fr: "La mise à jour du dictionnaire a échoué",
58
+ es: "La actualización del diccionario ha fallado"
59
59
  })
60
60
  }
61
61
  }
@@ -1 +1 @@
1
- {"version":3,"file":"saveForm.content.mjs","sources":["../../../../src/components/DictionaryFieldEditor/SaveForm/saveForm.content.tsx"],"sourcesContent":["import { t, type DeclarationContent } from 'intlayer';\n\nexport const saveDictionaryContent = {\n key: 'save-dictionary-details',\n content: {\n resetButton: {\n text: t({\n en: 'Reset changes',\n fr: 'Réinitialiser les modifications',\n es: 'Restablecer cambios',\n }),\n label: t({\n en: 'Click to reset changes',\n fr: 'Cliquez pour réinitialiser les modifications',\n es: 'Haga clic para restablecer los cambios',\n }),\n },\n saveButton: {\n text: t({\n en: 'Save changes',\n fr: 'Enregistrer les modifications',\n es: 'Guardar cambios',\n }),\n label: t({\n en: 'Click to save changes',\n fr: 'Cliquez pour enregistrer les modifications',\n es: 'Haga clic para guardar los cambios',\n }),\n },\n publishButton: {\n text: t({\n en: 'Publish dictionary',\n fr: 'Publier les dictionnaires',\n es: 'Publicar diccionario',\n }),\n label: t({\n en: 'Click to publish dictionary',\n fr: 'Cliquez pour publier les dictionnaires',\n es: 'Haga clic para publicar el diccionario',\n }),\n },\n updateOrganizationToasts: {\n updated: {\n title: t({\n en: 'Organization updated',\n fr: 'Organisation mise à jour',\n es: 'Organización actualizada',\n }),\n description: t({\n en: 'Your organization has been updated successfully',\n fr: 'Votre organisation a été mise à jour avec succès',\n es: 'Su organización se ha actualizado con éxito',\n }),\n },\n failed: {\n title: t({\n en: 'Organization update failed',\n fr: \"La mise à jour de l'organisation a échoué\",\n es: 'La actualización de la organización ha fallado',\n }),\n },\n },\n },\n} satisfies DeclarationContent;\n"],"names":[],"mappings":";AAEO,MAAM,wBAAwB;AAAA,EACnC,KAAK;AAAA,EACL,SAAS;AAAA,IACP,aAAa;AAAA,MACX,MAAM,EAAE;AAAA,QACN,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,MACD,OAAO,EAAE;AAAA,QACP,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,IACH;AAAA,IACA,YAAY;AAAA,MACV,MAAM,EAAE;AAAA,QACN,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,MACD,OAAO,EAAE;AAAA,QACP,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,IACH;AAAA,IACA,eAAe;AAAA,MACb,MAAM,EAAE;AAAA,QACN,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,MACD,OAAO,EAAE;AAAA,QACP,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,IACH;AAAA,IACA,0BAA0B;AAAA,MACxB,SAAS;AAAA,QACP,OAAO,EAAE;AAAA,UACP,IAAI;AAAA,UACJ,IAAI;AAAA,UACJ,IAAI;AAAA,QAAA,CACL;AAAA,QACD,aAAa,EAAE;AAAA,UACb,IAAI;AAAA,UACJ,IAAI;AAAA,UACJ,IAAI;AAAA,QAAA,CACL;AAAA,MACH;AAAA,MACA,QAAQ;AAAA,QACN,OAAO,EAAE;AAAA,UACP,IAAI;AAAA,UACJ,IAAI;AAAA,UACJ,IAAI;AAAA,QAAA,CACL;AAAA,MACH;AAAA,IACF;AAAA,EACF;AACF;"}
1
+ {"version":3,"file":"saveForm.content.mjs","sources":["../../../../src/components/DictionaryFieldEditor/SaveForm/saveForm.content.tsx"],"sourcesContent":["import { t, type DeclarationContent } from 'intlayer';\n\nexport const saveDictionaryContent = {\n key: 'save-dictionary-details',\n content: {\n resetButton: {\n text: t({\n en: 'Reset changes',\n fr: 'Réinitialiser les modifications',\n es: 'Restablecer cambios',\n }),\n label: t({\n en: 'Click to reset changes',\n fr: 'Cliquez pour réinitialiser les modifications',\n es: 'Haga clic para restablecer los cambios',\n }),\n },\n saveButton: {\n text: t({\n en: 'Save changes',\n fr: 'Enregistrer les modifications',\n es: 'Guardar cambios',\n }),\n label: t({\n en: 'Click to save changes',\n fr: 'Cliquez pour enregistrer les modifications',\n es: 'Haga clic para guardar los cambios',\n }),\n },\n publishButton: {\n text: t({\n en: 'Publish dictionary',\n fr: 'Publier dictionnaire',\n es: 'Publicar diccionario',\n }),\n label: t({\n en: 'Click to publish dictionary',\n fr: 'Cliquez pour publier dictionnaire',\n es: 'Haga clic para publicar el diccionario',\n }),\n },\n updateDictionaryToasts: {\n updated: {\n title: t({\n en: 'Dictionary updated',\n fr: 'Dictionnaire mis à jour',\n es: 'Diccionario actualizado',\n }),\n description: t({\n en: 'Your dictionary has been updated successfully',\n fr: 'Votre dictionnaire a été mis à jour avec succès',\n es: 'Su diccionario se ha actualizado con éxito',\n }),\n },\n failed: {\n title: t({\n en: 'Dictionary update failed',\n fr: 'La mise à jour du dictionnaire a échoué',\n es: 'La actualización del diccionario ha fallado',\n }),\n },\n },\n },\n} satisfies DeclarationContent;\n"],"names":[],"mappings":";AAEO,MAAM,wBAAwB;AAAA,EACnC,KAAK;AAAA,EACL,SAAS;AAAA,IACP,aAAa;AAAA,MACX,MAAM,EAAE;AAAA,QACN,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,MACD,OAAO,EAAE;AAAA,QACP,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,IACH;AAAA,IACA,YAAY;AAAA,MACV,MAAM,EAAE;AAAA,QACN,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,MACD,OAAO,EAAE;AAAA,QACP,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,IACH;AAAA,IACA,eAAe;AAAA,MACb,MAAM,EAAE;AAAA,QACN,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,MACD,OAAO,EAAE;AAAA,QACP,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,IACH;AAAA,IACA,wBAAwB;AAAA,MACtB,SAAS;AAAA,QACP,OAAO,EAAE;AAAA,UACP,IAAI;AAAA,UACJ,IAAI;AAAA,UACJ,IAAI;AAAA,QAAA,CACL;AAAA,QACD,aAAa,EAAE;AAAA,UACb,IAAI;AAAA,UACJ,IAAI;AAAA,UACJ,IAAI;AAAA,QAAA,CACL;AAAA,MACH;AAAA,MACA,QAAQ;AAAA,QACN,OAAO,EAAE;AAAA,UACP,IAAI;AAAA,UACJ,IAAI;AAAA,UACJ,IAAI;AAAA,QAAA,CACL;AAAA,MACH;AAAA,IACF;AAAA,EACF;AACF;"}
@@ -1,4 +1,3 @@
1
1
  import { DictionaryValue } from '@intlayer/core';
2
-
3
2
  export declare const getIsEditableSection: (section: DictionaryValue) => boolean;
4
3
  //# sourceMappingURL=getIsEditableSection.d.ts.map
@@ -1,5 +1,4 @@
1
1
  import { DropDownType } from './types';
2
-
3
2
  /**
4
3
  * Trigger allowing to open a dropdown menu.
5
4
  *
@@ -1,5 +1,4 @@
1
1
  import { HTMLAttributes, FC } from 'react';
2
-
3
2
  export type DropDownProps = HTMLAttributes<HTMLDivElement> & {
4
3
  identifier: string;
5
4
  };
@@ -5,24 +5,31 @@ const jsxRuntime = require("../../jsx-runtime-DvCoRj5u.cjs");
5
5
  const require$$0 = require("react");
6
6
  const components_Input_Input = require("../Input/Input.cjs");
7
7
  require("../Input/InputPassword.cjs");
8
+ require("../Input/Checkbox.cjs");
8
9
  const components_EditableField_EditableFieldLayout = require("./EditableFieldLayout.cjs");
9
- const EditableFieldInput = (props) => {
10
+ const EditableFieldInput = require$$0.forwardRef(({ onSave, onCancel, ...props }, ref) => {
10
11
  const inputRef = require$$0.useRef(null);
12
+ const handleSave = () => {
13
+ onSave?.(inputRef.current?.value ?? "");
14
+ };
11
15
  const handleCancel = () => {
12
16
  if (inputRef.current) {
13
17
  inputRef.current.value = inputRef.current.defaultValue ?? "";
14
18
  }
15
- props.onCancel?.(inputRef.current?.value ?? "");
19
+ onCancel?.();
16
20
  };
21
+ require$$0.useImperativeHandle(ref, () => inputRef.current);
22
+ const value = inputRef.current?.value ?? inputRef.current?.defaultValue ?? props.value ?? props.defaultValue;
17
23
  return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
18
24
  components_EditableField_EditableFieldLayout.EditableFieldLayout,
19
25
  {
20
- value: inputRef.current?.value ?? inputRef.current?.defaultValue ?? props.value ?? props.defaultValue,
26
+ value,
21
27
  onCancel: handleCancel,
22
- onSave: () => props.onSave?.(inputRef.current?.value ?? ""),
28
+ onSave: handleSave,
23
29
  children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(components_Input_Input.Input, { ref: inputRef, ...props })
24
30
  }
25
31
  );
26
- };
32
+ });
33
+ EditableFieldInput.displayName = "EditableFieldInput";
27
34
  exports.EditableFieldInput = EditableFieldInput;
28
35
  //# sourceMappingURL=EditableFieldInput.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"EditableFieldInput.cjs","sources":["../../../src/components/EditableField/EditableFieldInput.tsx"],"sourcesContent":["'use client';\n\nimport { type FC, useRef } from 'react';\nimport { Input, type InputProps } from '../Input';\nimport { EditableFieldLayout } from './EditableFieldLayout';\n\ntype EditableFieldInputProps = InputProps & {\n onSave?: (value: string) => void;\n onCancel?: (value: string) => void;\n};\n\nexport const EditableFieldInput: FC<EditableFieldInputProps> = (props) => {\n const inputRef = useRef<HTMLInputElement>(null);\n\n const handleCancel = () => {\n if (inputRef.current) {\n inputRef.current.value = inputRef.current.defaultValue ?? '';\n }\n\n props.onCancel?.(inputRef.current?.value ?? '');\n };\n\n return (\n <EditableFieldLayout\n value={\n inputRef.current?.value ??\n inputRef.current?.defaultValue ??\n (props.value as string) ??\n props.defaultValue\n }\n onCancel={handleCancel}\n onSave={() => props.onSave?.(inputRef.current?.value ?? '')}\n >\n <Input ref={inputRef} {...props} />\n </EditableFieldLayout>\n );\n};\n"],"names":["useRef","jsx","EditableFieldLayout","Input"],"mappings":";;;;;;;;AAWa,MAAA,qBAAkD,CAAC,UAAU;AAClE,QAAA,WAAWA,kBAAyB,IAAI;AAE9C,QAAM,eAAe,MAAM;AACzB,QAAI,SAAS,SAAS;AACpB,eAAS,QAAQ,QAAQ,SAAS,QAAQ,gBAAgB;AAAA,IAC5D;AAEA,UAAM,WAAW,SAAS,SAAS,SAAS,EAAE;AAAA,EAAA;AAI9C,SAAAC,2BAAA,kBAAA;AAAA,IAACC,6CAAA;AAAA,IAAA;AAAA,MACC,OACE,SAAS,SAAS,SAClB,SAAS,SAAS,gBACjB,MAAM,SACP,MAAM;AAAA,MAER,UAAU;AAAA,MACV,QAAQ,MAAM,MAAM,SAAS,SAAS,SAAS,SAAS,EAAE;AAAA,MAE1D,UAACD,2BAAA,kBAAA,IAAAE,8BAAA,EAAM,KAAK,UAAW,GAAG,OAAO;AAAA,IAAA;AAAA,EAAA;AAGvC;;"}
1
+ {"version":3,"file":"EditableFieldInput.cjs","sources":["../../../src/components/EditableField/EditableFieldInput.tsx"],"sourcesContent":["'use client';\n\nimport { forwardRef, useImperativeHandle, useRef } from 'react';\nimport { Input, type InputProps } from '../Input';\nimport { EditableFieldLayout } from './EditableFieldLayout';\n\ntype EditableFieldInputProps = InputProps & {\n onSave?: (value: string) => void;\n onCancel?: () => void;\n};\n\nexport const EditableFieldInput = forwardRef<\n HTMLInputElement,\n EditableFieldInputProps\n>(({ onSave, onCancel, ...props }, ref) => {\n const inputRef = useRef<HTMLInputElement>(null);\n\n const handleSave = () => {\n // Your save logic here\n onSave?.(inputRef.current?.value ?? '');\n };\n\n const handleCancel = () => {\n if (inputRef.current) {\n inputRef.current.value = inputRef.current.defaultValue ?? '';\n }\n onCancel?.();\n };\n\n // Expose the input ref to parent components\n useImperativeHandle(ref, () => inputRef.current!);\n\n const value =\n inputRef.current?.value ??\n inputRef.current?.defaultValue ??\n (props.value as string) ??\n (props.defaultValue as string);\n\n return (\n <EditableFieldLayout\n value={value}\n onCancel={handleCancel}\n onSave={handleSave}\n >\n <Input ref={inputRef} {...props} />\n </EditableFieldLayout>\n );\n});\n\nEditableFieldInput.displayName = 'EditableFieldInput';\n"],"names":["forwardRef","useRef","useImperativeHandle","jsx","EditableFieldLayout","Input"],"mappings":";;;;;;;;;AAWa,MAAA,qBAAqBA,sBAGhC,CAAC,EAAE,QAAQ,UAAU,GAAG,MAAM,GAAG,QAAQ;AACnC,QAAA,WAAWC,kBAAyB,IAAI;AAE9C,QAAM,aAAa,MAAM;AAEd,aAAA,SAAS,SAAS,SAAS,EAAE;AAAA,EAAA;AAGxC,QAAM,eAAe,MAAM;AACzB,QAAI,SAAS,SAAS;AACpB,eAAS,QAAQ,QAAQ,SAAS,QAAQ,gBAAgB;AAAA,IAC5D;AACW;EAAA;AAIOC,aAAAA,oBAAA,KAAK,MAAM,SAAS,OAAQ;AAE1C,QAAA,QACJ,SAAS,SAAS,SAClB,SAAS,SAAS,gBACjB,MAAM,SACN,MAAM;AAGP,SAAAC,2BAAA,kBAAA;AAAA,IAACC,6CAAA;AAAA,IAAA;AAAA,MACC;AAAA,MACA,UAAU;AAAA,MACV,QAAQ;AAAA,MAER,UAACD,2BAAA,kBAAA,IAAAE,8BAAA,EAAM,KAAK,UAAW,GAAG,OAAO;AAAA,IAAA;AAAA,EAAA;AAGvC,CAAC;AAED,mBAAmB,cAAc;;"}
@@ -1,10 +1,8 @@
1
- import { FC } from 'react';
2
1
  import { InputProps } from '../Input';
3
-
4
2
  type EditableFieldInputProps = InputProps & {
5
3
  onSave?: (value: string) => void;
6
- onCancel?: (value: string) => void;
4
+ onCancel?: () => void;
7
5
  };
8
- export declare const EditableFieldInput: FC<EditableFieldInputProps>;
6
+ export declare const EditableFieldInput: import('react').ForwardRefExoticComponent<Omit<EditableFieldInputProps, "ref"> & import('react').RefAttributes<HTMLInputElement>>;
9
7
  export {};
10
8
  //# sourceMappingURL=EditableFieldInput.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"EditableFieldInput.d.ts","sourceRoot":"","sources":["../../../src/components/EditableField/EditableFieldInput.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,EAAU,MAAM,OAAO,CAAC;AACxC,OAAO,EAAS,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AAGlD,KAAK,uBAAuB,GAAG,UAAU,GAAG;IAC1C,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACpC,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,EAAE,CAAC,uBAAuB,CAyB1D,CAAC"}
1
+ {"version":3,"file":"EditableFieldInput.d.ts","sourceRoot":"","sources":["../../../src/components/EditableField/EditableFieldInput.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAS,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AAGlD,KAAK,uBAAuB,GAAG,UAAU,GAAG;IAC1C,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB,CAAC;AAEF,eAAO,MAAM,kBAAkB,mIAoC7B,CAAC"}
@@ -1,27 +1,34 @@
1
1
  "use client";
2
2
  import { j as jsxRuntimeExports } from "../../jsx-runtime-BgSF1HG2.js";
3
- import { useRef } from "react";
3
+ import { forwardRef, useRef, useImperativeHandle } from "react";
4
4
  import { Input } from "../Input/Input.mjs";
5
5
  import "../Input/InputPassword.mjs";
6
+ import "../Input/Checkbox.mjs";
6
7
  import { EditableFieldLayout } from "./EditableFieldLayout.mjs";
7
- const EditableFieldInput = (props) => {
8
+ const EditableFieldInput = forwardRef(({ onSave, onCancel, ...props }, ref) => {
8
9
  const inputRef = useRef(null);
10
+ const handleSave = () => {
11
+ onSave?.(inputRef.current?.value ?? "");
12
+ };
9
13
  const handleCancel = () => {
10
14
  if (inputRef.current) {
11
15
  inputRef.current.value = inputRef.current.defaultValue ?? "";
12
16
  }
13
- props.onCancel?.(inputRef.current?.value ?? "");
17
+ onCancel?.();
14
18
  };
19
+ useImperativeHandle(ref, () => inputRef.current);
20
+ const value = inputRef.current?.value ?? inputRef.current?.defaultValue ?? props.value ?? props.defaultValue;
15
21
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
16
22
  EditableFieldLayout,
17
23
  {
18
- value: inputRef.current?.value ?? inputRef.current?.defaultValue ?? props.value ?? props.defaultValue,
24
+ value,
19
25
  onCancel: handleCancel,
20
- onSave: () => props.onSave?.(inputRef.current?.value ?? ""),
26
+ onSave: handleSave,
21
27
  children: /* @__PURE__ */ jsxRuntimeExports.jsx(Input, { ref: inputRef, ...props })
22
28
  }
23
29
  );
24
- };
30
+ });
31
+ EditableFieldInput.displayName = "EditableFieldInput";
25
32
  export {
26
33
  EditableFieldInput
27
34
  };
@@ -1 +1 @@
1
- {"version":3,"file":"EditableFieldInput.mjs","sources":["../../../src/components/EditableField/EditableFieldInput.tsx"],"sourcesContent":["'use client';\n\nimport { type FC, useRef } from 'react';\nimport { Input, type InputProps } from '../Input';\nimport { EditableFieldLayout } from './EditableFieldLayout';\n\ntype EditableFieldInputProps = InputProps & {\n onSave?: (value: string) => void;\n onCancel?: (value: string) => void;\n};\n\nexport const EditableFieldInput: FC<EditableFieldInputProps> = (props) => {\n const inputRef = useRef<HTMLInputElement>(null);\n\n const handleCancel = () => {\n if (inputRef.current) {\n inputRef.current.value = inputRef.current.defaultValue ?? '';\n }\n\n props.onCancel?.(inputRef.current?.value ?? '');\n };\n\n return (\n <EditableFieldLayout\n value={\n inputRef.current?.value ??\n inputRef.current?.defaultValue ??\n (props.value as string) ??\n props.defaultValue\n }\n onCancel={handleCancel}\n onSave={() => props.onSave?.(inputRef.current?.value ?? '')}\n >\n <Input ref={inputRef} {...props} />\n </EditableFieldLayout>\n );\n};\n"],"names":["jsx"],"mappings":";;;;;;AAWa,MAAA,qBAAkD,CAAC,UAAU;AAClE,QAAA,WAAW,OAAyB,IAAI;AAE9C,QAAM,eAAe,MAAM;AACzB,QAAI,SAAS,SAAS;AACpB,eAAS,QAAQ,QAAQ,SAAS,QAAQ,gBAAgB;AAAA,IAC5D;AAEA,UAAM,WAAW,SAAS,SAAS,SAAS,EAAE;AAAA,EAAA;AAI9C,SAAAA,kCAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,OACE,SAAS,SAAS,SAClB,SAAS,SAAS,gBACjB,MAAM,SACP,MAAM;AAAA,MAER,UAAU;AAAA,MACV,QAAQ,MAAM,MAAM,SAAS,SAAS,SAAS,SAAS,EAAE;AAAA,MAE1D,UAACA,kCAAA,IAAA,OAAA,EAAM,KAAK,UAAW,GAAG,OAAO;AAAA,IAAA;AAAA,EAAA;AAGvC;"}
1
+ {"version":3,"file":"EditableFieldInput.mjs","sources":["../../../src/components/EditableField/EditableFieldInput.tsx"],"sourcesContent":["'use client';\n\nimport { forwardRef, useImperativeHandle, useRef } from 'react';\nimport { Input, type InputProps } from '../Input';\nimport { EditableFieldLayout } from './EditableFieldLayout';\n\ntype EditableFieldInputProps = InputProps & {\n onSave?: (value: string) => void;\n onCancel?: () => void;\n};\n\nexport const EditableFieldInput = forwardRef<\n HTMLInputElement,\n EditableFieldInputProps\n>(({ onSave, onCancel, ...props }, ref) => {\n const inputRef = useRef<HTMLInputElement>(null);\n\n const handleSave = () => {\n // Your save logic here\n onSave?.(inputRef.current?.value ?? '');\n };\n\n const handleCancel = () => {\n if (inputRef.current) {\n inputRef.current.value = inputRef.current.defaultValue ?? '';\n }\n onCancel?.();\n };\n\n // Expose the input ref to parent components\n useImperativeHandle(ref, () => inputRef.current!);\n\n const value =\n inputRef.current?.value ??\n inputRef.current?.defaultValue ??\n (props.value as string) ??\n (props.defaultValue as string);\n\n return (\n <EditableFieldLayout\n value={value}\n onCancel={handleCancel}\n onSave={handleSave}\n >\n <Input ref={inputRef} {...props} />\n </EditableFieldLayout>\n );\n});\n\nEditableFieldInput.displayName = 'EditableFieldInput';\n"],"names":["jsx"],"mappings":";;;;;;;AAWa,MAAA,qBAAqB,WAGhC,CAAC,EAAE,QAAQ,UAAU,GAAG,MAAM,GAAG,QAAQ;AACnC,QAAA,WAAW,OAAyB,IAAI;AAE9C,QAAM,aAAa,MAAM;AAEd,aAAA,SAAS,SAAS,SAAS,EAAE;AAAA,EAAA;AAGxC,QAAM,eAAe,MAAM;AACzB,QAAI,SAAS,SAAS;AACpB,eAAS,QAAQ,QAAQ,SAAS,QAAQ,gBAAgB;AAAA,IAC5D;AACW;EAAA;AAIO,sBAAA,KAAK,MAAM,SAAS,OAAQ;AAE1C,QAAA,QACJ,SAAS,SAAS,SAClB,SAAS,SAAS,gBACjB,MAAM,SACN,MAAM;AAGP,SAAAA,kCAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC;AAAA,MACA,UAAU;AAAA,MACV,QAAQ;AAAA,MAER,UAACA,kCAAA,IAAA,OAAA,EAAM,KAAK,UAAW,GAAG,OAAO;AAAA,IAAA;AAAA,EAAA;AAGvC,CAAC;AAED,mBAAmB,cAAc;"}
@@ -1,5 +1,4 @@
1
1
  import { FC, ReactNode } from 'react';
2
-
3
2
  type EditableFieldLayoutProps = {
4
3
  value: string | null | undefined;
5
4
  onCancel: () => void;
@@ -6,24 +6,37 @@ const require$$0 = require("react");
6
6
  const components_TextArea_AutoSizeTextArea = require("../TextArea/AutoSizeTextArea.cjs");
7
7
  require("../TextArea/TextArea.cjs");
8
8
  const components_EditableField_EditableFieldLayout = require("./EditableFieldLayout.cjs");
9
- const EditableFieldTextArea = (props) => {
9
+ const EditableFieldTextArea = require$$0.forwardRef(({ onSave, onCancel, ...props }, ref) => {
10
10
  const textAreaRef = require$$0.useRef(null);
11
11
  const handleSave = () => {
12
+ onSave?.(textAreaRef.current?.value ?? "");
12
13
  };
13
14
  const handleCancel = () => {
14
15
  if (textAreaRef.current) {
15
16
  textAreaRef.current.value = textAreaRef.current.defaultValue ?? "";
16
17
  }
18
+ onCancel?.();
17
19
  };
20
+ require$$0.useImperativeHandle(ref, () => textAreaRef.current);
21
+ const value = textAreaRef.current?.value ?? textAreaRef.current?.defaultValue ?? props.value ?? props.defaultValue;
18
22
  return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
19
23
  components_EditableField_EditableFieldLayout.EditableFieldLayout,
20
24
  {
21
- value: textAreaRef.current?.value ?? textAreaRef.current?.defaultValue,
25
+ value,
22
26
  onCancel: handleCancel,
23
27
  onSave: handleSave,
24
- children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(components_TextArea_AutoSizeTextArea.AutoSizedTextArea, { className: "leading-6", ref: textAreaRef, ...props })
28
+ children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
29
+ components_TextArea_AutoSizeTextArea.AutoSizedTextArea,
30
+ {
31
+ className: "leading-6",
32
+ ref: textAreaRef,
33
+ ...props
34
+ },
35
+ value
36
+ )
25
37
  }
26
38
  );
27
- };
39
+ });
40
+ EditableFieldTextArea.displayName = "EditableFieldTextArea";
28
41
  exports.EditableFieldTextArea = EditableFieldTextArea;
29
42
  //# sourceMappingURL=EditableFieldTextArea.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"EditableFieldTextArea.cjs","sources":["../../../src/components/EditableField/EditableFieldTextArea.tsx"],"sourcesContent":["'use client';\n\nimport { type FC, useRef } from 'react';\nimport { AutoSizedTextArea, type AutoSizedTextAreaProps } from '../TextArea';\nimport { EditableFieldLayout } from './EditableFieldLayout';\n\nexport const EditableFieldTextArea: FC<AutoSizedTextAreaProps> = (props) => {\n const textAreaRef = useRef<HTMLTextAreaElement>(null);\n\n const handleSave = () => {};\n\n const handleCancel = () => {\n if (textAreaRef.current) {\n textAreaRef.current.value = textAreaRef.current.defaultValue ?? '';\n }\n };\n\n return (\n <EditableFieldLayout\n value={textAreaRef.current?.value ?? textAreaRef.current?.defaultValue}\n onCancel={handleCancel}\n onSave={handleSave}\n >\n <AutoSizedTextArea className=\"leading-6\" ref={textAreaRef} {...props} />\n </EditableFieldLayout>\n );\n};\n"],"names":["useRef","jsx","EditableFieldLayout","AutoSizedTextArea"],"mappings":";;;;;;;;AAMa,MAAA,wBAAoD,CAAC,UAAU;AACpE,QAAA,cAAcA,kBAA4B,IAAI;AAEpD,QAAM,aAAa,MAAM;AAAA,EAAA;AAEzB,QAAM,eAAe,MAAM;AACzB,QAAI,YAAY,SAAS;AACvB,kBAAY,QAAQ,QAAQ,YAAY,QAAQ,gBAAgB;AAAA,IAClE;AAAA,EAAA;AAIA,SAAAC,2BAAA,kBAAA;AAAA,IAACC,6CAAA;AAAA,IAAA;AAAA,MACC,OAAO,YAAY,SAAS,SAAS,YAAY,SAAS;AAAA,MAC1D,UAAU;AAAA,MACV,QAAQ;AAAA,MAER,2DAACC,qCAAkB,mBAAA,EAAA,WAAU,aAAY,KAAK,aAAc,GAAG,OAAO;AAAA,IAAA;AAAA,EAAA;AAG5E;;"}
1
+ {"version":3,"file":"EditableFieldTextArea.cjs","sources":["../../../src/components/EditableField/EditableFieldTextArea.tsx"],"sourcesContent":["'use client';\n\nimport { forwardRef, useRef, useImperativeHandle } from 'react';\nimport { AutoSizedTextArea, type AutoSizedTextAreaProps } from '../TextArea';\nimport { EditableFieldLayout } from './EditableFieldLayout';\n\ntype EditableFieldTextAreaProps = AutoSizedTextAreaProps & {\n onSave?: (value: string) => void;\n onCancel?: () => void;\n};\n\nexport const EditableFieldTextArea = forwardRef<\n HTMLTextAreaElement,\n EditableFieldTextAreaProps\n>(({ onSave, onCancel, ...props }, ref) => {\n const textAreaRef = useRef<HTMLTextAreaElement>(null);\n\n const handleSave = () => {\n // Your save logic here\n onSave?.(textAreaRef.current?.value ?? '');\n };\n\n const handleCancel = () => {\n if (textAreaRef.current) {\n textAreaRef.current.value = textAreaRef.current.defaultValue ?? '';\n }\n onCancel?.();\n };\n\n // Expose the text area ref to parent components\n useImperativeHandle(ref, () => textAreaRef.current!);\n\n const value =\n textAreaRef.current?.value ??\n textAreaRef.current?.defaultValue ??\n (props.value as string) ??\n (props.defaultValue as string);\n\n return (\n <EditableFieldLayout\n value={value}\n onCancel={handleCancel}\n onSave={handleSave}\n >\n <AutoSizedTextArea\n key={value}\n className=\"leading-6\"\n ref={textAreaRef}\n {...props}\n />\n </EditableFieldLayout>\n );\n});\n\nEditableFieldTextArea.displayName = 'EditableFieldTextArea';\n"],"names":["forwardRef","useRef","useImperativeHandle","jsx","EditableFieldLayout","AutoSizedTextArea"],"mappings":";;;;;;;;AAWa,MAAA,wBAAwBA,sBAGnC,CAAC,EAAE,QAAQ,UAAU,GAAG,MAAM,GAAG,QAAQ;AACnC,QAAA,cAAcC,kBAA4B,IAAI;AAEpD,QAAM,aAAa,MAAM;AAEd,aAAA,YAAY,SAAS,SAAS,EAAE;AAAA,EAAA;AAG3C,QAAM,eAAe,MAAM;AACzB,QAAI,YAAY,SAAS;AACvB,kBAAY,QAAQ,QAAQ,YAAY,QAAQ,gBAAgB;AAAA,IAClE;AACW;EAAA;AAIOC,aAAAA,oBAAA,KAAK,MAAM,YAAY,OAAQ;AAE7C,QAAA,QACJ,YAAY,SAAS,SACrB,YAAY,SAAS,gBACpB,MAAM,SACN,MAAM;AAGP,SAAAC,2BAAA,kBAAA;AAAA,IAACC,6CAAA;AAAA,IAAA;AAAA,MACC;AAAA,MACA,UAAU;AAAA,MACV,QAAQ;AAAA,MAER,UAAAD,2BAAA,kBAAA;AAAA,QAACE,qCAAA;AAAA,QAAA;AAAA,UAEC,WAAU;AAAA,UACV,KAAK;AAAA,UACJ,GAAG;AAAA,QAAA;AAAA,QAHC;AAAA,MAIP;AAAA,IAAA;AAAA,EAAA;AAGN,CAAC;AAED,sBAAsB,cAAc;;"}