@intlayer/design-system 3.0.2 → 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
@@ -1,17 +1,33 @@
1
1
  "use client";
2
2
  import { j as jsxRuntimeExports } from "../../jsx-runtime-BgSF1HG2.js";
3
3
  import { ArrowLeft } from "lucide-react";
4
+ import { useEffect } from "react";
4
5
  import { useDictionary } from "react-intlayer";
5
6
  import { Button } from "../Button/Button.mjs";
6
7
  import { Container } from "../Container/index.mjs";
7
8
  import { useEditedContentStore } from "../DictionaryEditor/useEditedContentStore.mjs";
8
9
  import { useEditionPanelStore } from "../DictionaryEditor/useEditionPanelStore.mjs";
9
10
  import "@intlayer/core";
10
- import "react";
11
11
  import "clsx";
12
12
  import "tailwind-merge";
13
- import "../TextArea/AutoSizeTextArea.mjs";
14
- import "../TextArea/TextArea.mjs";
13
+ import "../EditableField/EditableFieldInput.mjs";
14
+ import "../EditableField/EditableFieldTextArea.mjs";
15
+ import "../../hooks/useScrollBlockage/useScrollBlockageStore.mjs";
16
+ import "../../hooks/useAsync/useAsyncStateStore.mjs";
17
+ import "../Auth/AuthProvider/index.mjs";
18
+ import "../../libs/intlayer-api/auth.mjs";
19
+ import "../../libs/intlayer-api/dictionary.mjs";
20
+ import "../../libs/intlayer-api/organization.mjs";
21
+ import "../../libs/intlayer-api/project.mjs";
22
+ import "../../libs/intlayer-api/user.mjs";
23
+ import "@intlayer/dictionaries-entry";
24
+ import "deepmerge";
25
+ import "../Form/FormBase.mjs";
26
+ import "../Form/FormField.mjs";
27
+ import "../../Form-DyFBmVya.js";
28
+ import "../Toaster/Toast.mjs";
29
+ import "../DictionaryEditor/validDictionaryChangeButtons.content.mjs";
30
+ import "zod";
15
31
  import { H2 } from "../Headers/index.mjs";
16
32
  import { DictionaryDetailsForm } from "./DictionaryDetails/DictionaryDetailsForm.mjs";
17
33
  import { dictionaryFieldEditorContent } from "./dictionaryFieldEditor.content.mjs";
@@ -24,24 +40,32 @@ const DictionaryFieldEditor = ({
24
40
  onClickDictionaryList
25
41
  }) => {
26
42
  const { content: dictionaryContent, key } = dictionary;
27
- const editedContent = useEditedContentStore((s) => s.editedContent);
28
- const { returnToDictionaryList, titleContent, titleInformation } = useDictionary(dictionaryFieldEditorContent);
29
- const { focusedContent, setFocusedContentKeyPath, setFocusedContent } = useEditionPanelStore((s) => ({
30
- focusedContent: s.focusedContent,
31
- setFocusedContentKeyPath: s.setFocusedContentKeyPath,
32
- setFocusedContent: s.setFocusedContent
43
+ const { editedContent, dictionaryRecord, setDictionariesRecord } = useEditedContentStore((s) => ({
44
+ editedContent: s.editedContent,
45
+ dictionaryRecord: s.dictionariesRecord,
46
+ setDictionariesRecord: s.setDictionariesRecord
33
47
  }));
48
+ const { returnToDictionaryList, titleContent, titleInformation } = useDictionary(dictionaryFieldEditorContent);
49
+ const { focusedContent, setFocusedContentKeyPath } = useEditionPanelStore(
50
+ (s) => ({
51
+ focusedContent: s.focusedContent,
52
+ setFocusedContentKeyPath: s.setFocusedContentKeyPath
53
+ })
54
+ );
34
55
  const focusedKeyPath = focusedContent?.keyPath;
35
56
  const section = editedContent[key]?.content ?? dictionaryContent;
57
+ useEffect(() => {
58
+ if (dictionaryRecord[key]) return;
59
+ setDictionariesRecord({
60
+ [key]: dictionary
61
+ });
62
+ }, [dictionary, key, setDictionariesRecord, dictionaryRecord]);
36
63
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex size-full flex-1 flex-col gap-10", children: [
37
64
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2", children: [
38
65
  /* @__PURE__ */ jsxRuntimeExports.jsx(
39
66
  Button,
40
67
  {
41
- onClick: () => {
42
- setFocusedContent(null);
43
- onClickDictionaryList?.();
44
- },
68
+ onClick: () => onClickDictionaryList?.(),
45
69
  variant: "hoverable",
46
70
  size: "icon-md",
47
71
  color: "text",
@@ -1 +1 @@
1
- {"version":3,"file":"DictionaryFieldEditor.mjs","sources":["../../../src/components/DictionaryFieldEditor/DictionaryFieldEditor.tsx"],"sourcesContent":["'use client';\n\nimport { Dictionary } from '@intlayer/core';\nimport { ArrowLeft } from 'lucide-react';\nimport { type FC } from 'react';\nimport { useDictionary } from 'react-intlayer';\nimport { Button } from '../Button';\nimport { Container } from '../Container';\nimport {\n useEditedContentStore,\n useEditionPanelStore,\n} from '../DictionaryEditor';\nimport { H2 } from '../Headers';\nimport { DictionaryDetailsForm } from './DictionaryDetails/DictionaryDetailsForm';\nimport { dictionaryFieldEditorContent } from './dictionaryFieldEditor.content';\nimport { EditorView } from './EditorView/EditorView';\nimport { KeyPathBreadcrumb } from './KeyPathBreadcrumb';\nimport { NavigationViewNode } from './NavigationView/NavigationViewNode';\nimport { SaveForm } from './SaveForm/SaveForm';\n\ntype DictionaryFieldEditorProps = {\n dictionary: Dictionary;\n onClickDictionaryList?: () => void;\n};\n\nexport const DictionaryFieldEditor: FC<DictionaryFieldEditorProps> = ({\n dictionary,\n onClickDictionaryList,\n}) => {\n const { content: dictionaryContent, key } = dictionary;\n const editedContent = useEditedContentStore((s) => s.editedContent);\n const { returnToDictionaryList, titleContent, titleInformation } =\n useDictionary(dictionaryFieldEditorContent);\n\n const { focusedContent, setFocusedContentKeyPath, setFocusedContent } =\n useEditionPanelStore((s) => ({\n focusedContent: s.focusedContent,\n setFocusedContentKeyPath: s.setFocusedContentKeyPath,\n setFocusedContent: s.setFocusedContent,\n }));\n\n const focusedKeyPath = focusedContent?.keyPath;\n\n const section = editedContent[key]?.content ?? dictionaryContent;\n\n return (\n <div className=\"flex size-full flex-1 flex-col gap-10\">\n <div className=\"flex items-center gap-2\">\n <Button\n onClick={() => {\n setFocusedContent(null);\n onClickDictionaryList?.();\n }}\n variant=\"hoverable\"\n size=\"icon-md\"\n color=\"text\"\n id=\"return-to-dictionary-list\"\n Icon={ArrowLeft}\n label={returnToDictionaryList.label.value}\n />\n <label\n className=\"cursor-pointer text-xs hover:underline\"\n htmlFor=\"return-to-dictionary-list\"\n >\n {returnToDictionaryList.text}\n </label>\n </div>\n\n <Container\n className=\"flex size-full justify-center gap-10 p-6\"\n roundedSize=\"xl\"\n >\n <H2>{titleInformation}</H2>\n\n <DictionaryDetailsForm dictionary={dictionary} />\n </Container>\n\n <Container\n className=\"flex size-full justify-center gap-10 p-6\"\n roundedSize=\"xl\"\n >\n <H2>{titleContent}</H2>\n\n <KeyPathBreadcrumb\n dictionaryKey={key}\n keyPath={focusedKeyPath ?? []}\n onClickKeyPath={setFocusedContentKeyPath}\n />\n <div className=\"flex gap-2 max-md:flex-col\">\n <Container\n border\n background={false}\n className=\"top-6 flex h-full flex-col items-start gap-0.5 overflow-auto p-2 md:sticky md:max-w-[50%]\"\n roundedSize=\"xl\"\n >\n <NavigationViewNode\n keyPath={[]}\n section={section}\n dictionaryKey={key}\n />\n </Container>\n <div className=\"top-6 flex h-full flex-1 flex-col gap-6 md:sticky\">\n {(focusedKeyPath?.length ?? 0) > 0 && (\n <Container\n border\n background={false}\n className=\"h-full flex-1 overflow-hidden\"\n roundedSize=\"xl\"\n >\n <EditorView dictionary={dictionary} dictionaryKey={key} />\n </Container>\n )}\n <SaveForm dictionary={dictionary} />\n </div>\n </div>\n </Container>\n </div>\n );\n};\n"],"names":["jsxs","jsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAyBO,MAAM,wBAAwD,CAAC;AAAA,EACpE;AAAA,EACA;AACF,MAAM;AACJ,QAAM,EAAE,SAAS,mBAAmB,IAAA,IAAQ;AAC5C,QAAM,gBAAgB,sBAAsB,CAAC,MAAM,EAAE,aAAa;AAClE,QAAM,EAAE,wBAAwB,cAAc,iBAAiB,IAC7D,cAAc,4BAA4B;AAE5C,QAAM,EAAE,gBAAgB,0BAA0B,sBAChD,qBAAqB,CAAC,OAAO;AAAA,IAC3B,gBAAgB,EAAE;AAAA,IAClB,0BAA0B,EAAE;AAAA,IAC5B,mBAAmB,EAAE;AAAA,EACrB,EAAA;AAEJ,QAAM,iBAAiB,gBAAgB;AAEvC,QAAM,UAAU,cAAc,GAAG,GAAG,WAAW;AAG7C,SAAAA,kCAAA,KAAC,OAAI,EA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AAA,oBACV;AAAA,oBACA,eAAe;AAAA,kBAAA;AAAA,gBACjB;AAAA,cAAA;AAAA,YACF;AAAA,YACAD,kCAAAA,KAAC,OAAI,EAAA,WAAU,qDACX,UAAA;AAAA,eAAgB,gBAAA,UAAU,KAAK,KAC/BC,kCAAA;AAAA,gBAAC;AAAA,gBAAA;AAAA,kBACC,QAAM;AAAA,kBACN,YAAY;AAAA,kBACZ,WAAU;AAAA,kBACV,aAAY;AAAA,kBAEZ,UAACA,kCAAA,IAAA,YAAA,EAAW,YAAwB,eAAe,KAAK;AAAA,gBAAA;AAAA,cAC1D;AAAA,cAEFA,sCAAC,YAAS,YAAwB;AAAA,YAAA,GACpC;AAAA,UAAA,GACF;AAAA,QAAA;AAAA,MAAA;AAAA,IACF;AAAA,EACF,EAAA,CAAA;AAEJ;"}
1
+ {"version":3,"file":"DictionaryFieldEditor.mjs","sources":["../../../src/components/DictionaryFieldEditor/DictionaryFieldEditor.tsx"],"sourcesContent":["'use client';\n\nimport { Dictionary } from '@intlayer/core';\nimport { ArrowLeft } from 'lucide-react';\nimport { useEffect, type FC } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { Button } from '../Button';\nimport { Container } from '../Container';\nimport {\n useEditedContentStore,\n useEditionPanelStore,\n} from '../DictionaryEditor';\nimport { H2 } from '../Headers';\nimport { DictionaryDetailsForm } from './DictionaryDetails/DictionaryDetailsForm';\nimport { dictionaryFieldEditorContent } from './dictionaryFieldEditor.content';\nimport { EditorView } from './EditorView/EditorView';\nimport { KeyPathBreadcrumb } from './KeyPathBreadcrumb';\nimport { NavigationViewNode } from './NavigationView/NavigationViewNode';\nimport { SaveForm } from './SaveForm/SaveForm';\n\ntype DictionaryFieldEditorProps = {\n dictionary: Dictionary;\n onClickDictionaryList?: () => void;\n};\n\nexport const DictionaryFieldEditor: FC<DictionaryFieldEditorProps> = ({\n dictionary,\n onClickDictionaryList,\n}) => {\n const { content: dictionaryContent, key } = dictionary;\n const { editedContent, dictionaryRecord, setDictionariesRecord } =\n useEditedContentStore((s) => ({\n editedContent: s.editedContent,\n dictionaryRecord: s.dictionariesRecord,\n setDictionariesRecord: s.setDictionariesRecord,\n }));\n const { returnToDictionaryList, titleContent, titleInformation } =\n useDictionary(dictionaryFieldEditorContent);\n\n const { focusedContent, setFocusedContentKeyPath } = useEditionPanelStore(\n (s) => ({\n focusedContent: s.focusedContent,\n setFocusedContentKeyPath: s.setFocusedContentKeyPath,\n })\n );\n\n const focusedKeyPath = focusedContent?.keyPath;\n\n const section = editedContent[key]?.content ?? dictionaryContent;\n\n useEffect(() => {\n if (dictionaryRecord[key]) return;\n\n setDictionariesRecord({\n [key]: dictionary,\n });\n }, [dictionary, key, setDictionariesRecord, dictionaryRecord]);\n\n return (\n <div className=\"flex size-full flex-1 flex-col gap-10\">\n <div className=\"flex items-center gap-2\">\n <Button\n onClick={() => onClickDictionaryList?.()}\n variant=\"hoverable\"\n size=\"icon-md\"\n color=\"text\"\n id=\"return-to-dictionary-list\"\n Icon={ArrowLeft}\n label={returnToDictionaryList.label.value}\n />\n <label\n className=\"cursor-pointer text-xs hover:underline\"\n htmlFor=\"return-to-dictionary-list\"\n >\n {returnToDictionaryList.text}\n </label>\n </div>\n\n <Container\n className=\"flex size-full justify-center gap-10 p-6\"\n roundedSize=\"xl\"\n >\n <H2>{titleInformation}</H2>\n\n <DictionaryDetailsForm dictionary={dictionary} />\n </Container>\n\n <Container\n className=\"flex size-full justify-center gap-10 p-6\"\n roundedSize=\"xl\"\n >\n <H2>{titleContent}</H2>\n\n <KeyPathBreadcrumb\n dictionaryKey={key}\n keyPath={focusedKeyPath ?? []}\n onClickKeyPath={setFocusedContentKeyPath}\n />\n <div className=\"flex gap-2 max-md:flex-col\">\n <Container\n border\n background={false}\n className=\"top-6 flex h-full flex-col items-start gap-0.5 overflow-auto p-2 md:sticky md:max-w-[50%]\"\n roundedSize=\"xl\"\n >\n <NavigationViewNode\n keyPath={[]}\n section={section}\n dictionaryKey={key}\n />\n </Container>\n <div className=\"top-6 flex h-full flex-1 flex-col gap-6 md:sticky\">\n {(focusedKeyPath?.length ?? 0) > 0 && (\n <Container\n border\n background={false}\n className=\"h-full flex-1 overflow-hidden\"\n roundedSize=\"xl\"\n >\n <EditorView dictionary={dictionary} dictionaryKey={key} />\n </Container>\n )}\n <SaveForm dictionary={dictionary} />\n </div>\n </div>\n </Container>\n </div>\n );\n};\n"],"names":["jsxs","jsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BO,MAAM,wBAAwD,CAAC;AAAA,EACpE;AAAA,EACA;AACF,MAAM;AACJ,QAAM,EAAE,SAAS,mBAAmB,IAAA,IAAQ;AAC5C,QAAM,EAAE,eAAe,kBAAkB,0BACvC,sBAAsB,CAAC,OAAO;AAAA,IAC5B,eAAe,EAAE;AAAA,IACjB,kBAAkB,EAAE;AAAA,IACpB,uBAAuB,EAAE;AAAA,EACzB,EAAA;AACJ,QAAM,EAAE,wBAAwB,cAAc,iBAAiB,IAC7D,cAAc,4BAA4B;AAEtC,QAAA,EAAE,gBAAgB,yBAAA,IAA6B;AAAA,IACnD,CAAC,OAAO;AAAA,MACN,gBAAgB,EAAE;AAAA,MAClB,0BAA0B,EAAE;AAAA,IAAA;AAAA,EAC9B;AAGF,QAAM,iBAAiB,gBAAgB;AAEvC,QAAM,UAAU,cAAc,GAAG,GAAG,WAAW;AAE/C,YAAU,MAAM;AACV,QAAA,iBAAiB,GAAG,EAAG;AAEL,0BAAA;AAAA,MACpB,CAAC,GAAG,GAAG;AAAA,IAAA,CACR;AAAA,KACA,CAAC,YAAY,KAAK,uBAAuB,gBAAgB,CAAC;AAG3D,SAAAA,kCAAA,KAAC,OAAI,EAAA,WAAU,yCACb,UAAA;AAAA,IAACA,kCAAAA,KAAA,OAAA,EAAI,WAAU,2BACb,UAAA;AAAA,MAAAC,kCAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,SAAS,MAAM,wBAAw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C,kCAAA;AAAA,gBAAC;AAAA,gBAAA;AAAA,kBACC,QAAM;AAAA,kBACN,YAAY;AAAA,kBACZ,WAAU;AAAA,kBACV,aAAY;AAAA,kBAEZ,UAACA,kCAAA,IAAA,YAAA,EAAW,YAAwB,eAAe,KAAK;AAAA,gBAAA;AAAA,cAC1D;AAAA,cAEFA,sCAAC,YAAS,YAAwB;AAAA,YAAA,GACpC;AAAA,UAAA,GACF;AAAA,QAAA;AAAA,MAAA;AAAA,IACF;AAAA,EACF,EAAA,CAAA;AAEJ;"}
@@ -5,17 +5,32 @@ const jsxRuntime = require("../../../jsx-runtime-DvCoRj5u.cjs");
5
5
  const lucideReact = require("lucide-react");
6
6
  const reactIntlayer = require("react-intlayer");
7
7
  const components_EditableField_EditableFieldInput = require("../../EditableField/EditableFieldInput.cjs");
8
- require("react");
9
- require("../../TextArea/AutoSizeTextArea.cjs");
10
- require("../../TextArea/TextArea.cjs");
11
- require("clsx");
12
- require("tailwind-merge");
13
- const components_Button_Button = require("../../Button/Button.cjs");
8
+ require("../../EditableField/EditableFieldTextArea.cjs");
14
9
  const utils_camelCase = require("../../../utils/camelCase.cjs");
15
10
  const utils_dictionary = require("../../../utils/dictionary.cjs");
11
+ const components_Button_Button = require("../../Button/Button.cjs");
16
12
  const components_DictionaryEditor_useEditedContentStore = require("../../DictionaryEditor/useEditedContentStore.cjs");
17
13
  const components_DictionaryEditor_useEditionPanelStore = require("../../DictionaryEditor/useEditionPanelStore.cjs");
18
14
  require("@intlayer/core");
15
+ require("react");
16
+ require("clsx");
17
+ require("tailwind-merge");
18
+ require("../../../hooks/useScrollBlockage/useScrollBlockageStore.cjs");
19
+ require("../../../hooks/useAsync/useAsyncStateStore.cjs");
20
+ require("../../Auth/AuthProvider/index.cjs");
21
+ require("../../../libs/intlayer-api/auth.cjs");
22
+ require("../../../libs/intlayer-api/dictionary.cjs");
23
+ require("../../../libs/intlayer-api/organization.cjs");
24
+ require("../../../libs/intlayer-api/project.cjs");
25
+ require("../../../libs/intlayer-api/user.cjs");
26
+ require("@intlayer/dictionaries-entry");
27
+ require("deepmerge");
28
+ require("../../Form/FormBase.cjs");
29
+ require("../../Form/FormField.cjs");
30
+ require("../../../Form-DERuauvB.cjs");
31
+ require("../../Toaster/Toast.cjs");
32
+ require("../../DictionaryEditor/validDictionaryChangeButtons.content.cjs");
33
+ require("zod");
19
34
  const components_Label_index = require("../../Label/index.cjs");
20
35
  const components_DictionaryFieldEditor_editorView_content = require("../editorView.content.cjs");
21
36
  const components_DictionaryFieldEditor_getIsEditableSection = require("../getIsEditableSection.cjs");
@@ -1 +1 @@
1
- {"version":3,"file":"EditorView.cjs","sources":["../../../../src/components/DictionaryFieldEditor/EditorView/EditorView.tsx"],"sourcesContent":["'use client';\n\nimport { type KeyPath, type Dictionary } from '@intlayer/core';\nimport { X } from 'lucide-react';\nimport { type FC } from 'react';\nimport { useDictionary } from 'react-intlayer';\nimport { EditableFieldInput } from '../..//EditableField';\nimport {\n camelCaseToSentence,\n sentenceToCamelCase,\n} from '../../../utils/camelCase';\nimport { getDictionaryValueByKeyPath } from '../../../utils/dictionary';\nimport { Button } from '../../Button';\nimport {\n useEditedContentStore,\n useEditionPanelStore,\n} from '../../DictionaryEditor';\nimport { Label } from '../../Label';\nimport { editorViewContent } from '../editorView.content';\nimport { getIsEditableSection } from '../getIsEditableSection';\nimport { NodeTypeSelector } from '../NodeTypeSelector';\nimport { TextEditor } from './TextEditor';\n\ntype EditorViewProps = {\n dictionaryKey: string;\n dictionary: Dictionary;\n};\n\nexport const EditorView: FC<EditorViewProps> = ({\n dictionaryKey,\n dictionary,\n}) => {\n const { focusedContent, setFocusedContentKeyPath } = useEditionPanelStore(\n (s) => ({\n setFocusedContentKeyPath: s.setFocusedContentKeyPath,\n focusedContent: s.focusedContent,\n })\n );\n const keyPath = focusedContent?.keyPath ?? [];\n const initialKeyName = keyPath[keyPath.length - 1]?.key ?? '';\n const { titleInput, deleteButton, nodeTypeSelector } =\n useDictionary(editorViewContent);\n\n const { editedContent, renameEditedContent, addEditedContent } =\n useEditedContentStore((s) => ({\n editedContent: s.editedContent,\n renameEditedContent: s.renameEditedContent,\n addEditedContent: s.addEditedContent,\n }));\n\n const section = editedContent[dictionaryKey]?.content\n ? getDictionaryValueByKeyPath(editedContent[dictionaryKey].content, keyPath)\n : getDictionaryValueByKeyPath(dictionary.content, keyPath);\n\n const isEditableSection = getIsEditableSection(section);\n\n const handleRenameNodeKey = (keyName: string) => {\n const camelCaseSentence = sentenceToCamelCase(keyName);\n renameEditedContent(dictionaryKey, camelCaseSentence, keyPath);\n const prevKeyPath: KeyPath[] = keyPath.slice(0, -1);\n const lastKeyPath: KeyPath = keyPath[keyPath.length - 1];\n const newKeyPath: KeyPath[] = [\n ...prevKeyPath,\n { ...lastKeyPath, key: camelCaseSentence } as KeyPath,\n ];\n setFocusedContentKeyPath(newKeyPath);\n };\n\n return (\n <>\n {isEditableSection && (\n <TextEditor\n key={keyPath.join('.')}\n keyPath={keyPath}\n section={section}\n dictionaryKey={dictionaryKey}\n />\n )}\n {keyPath.length > 0 ? (\n <form\n className=\"bg-text text-text-dark dark:bg-text-dark dark:text-text flex w-full flex-col items-start justify-between gap-6 px-4 py-2\"\n key={JSON.stringify(focusedContent?.keyPath)}\n >\n <div className=\"flex w-full flex-wrap items-start justify-between gap-6\">\n {typeof initialKeyName === 'string' && (\n <div className=\"flex flex-col gap-3\">\n <Label>{titleInput.label}</Label>\n <div className=\"flex flex-wrap items-center gap-4\">\n <EditableFieldInput\n name=\"key\"\n aria-label=\"Key\"\n key={initialKeyName}\n placeholder={titleInput.placeholder.value}\n defaultValue={camelCaseToSentence(initialKeyName)}\n onSave={(value) => handleRenameNodeKey(value)}\n className=\"h-8\"\n variant=\"invisible\"\n />\n <span className=\"text-neutral dark:text-neutral-dark text-sm\">\n ({initialKeyName})\n </span>\n </div>\n </div>\n )}\n\n <div>\n <Label>{nodeTypeSelector.label}</Label>\n\n <NodeTypeSelector\n keyPath={keyPath}\n dictionaryKey={dictionaryKey}\n section={section}\n />\n </div>\n </div>\n {keyPath.length > 0 && (\n <Button\n label={deleteButton.label.value}\n variant=\"outline\"\n color=\"error\"\n className=\"ml-auto\"\n Icon={X}\n onClick={() => {\n addEditedContent(dictionaryKey, undefined, keyPath);\n\n const parentKeyPath: KeyPath[] = keyPath.slice(0, -1);\n setFocusedContentKeyPath(parentKeyPath);\n }}\n >\n {deleteButton.text}\n </Button>\n )}\n </form>\n ) : (\n <span className=\"h-8\"></span>\n )}\n </>\n );\n};\n"],"names":["useEditionPanelStore","useDictionary","editorViewContent","useEditedContentStore","getDictionaryValueByKeyPath","getIsEditableSection","sentenceToCamelCase","jsxs","Fragment","jsx","TextEditor","Label","EditableFieldInput","camelCaseToSentence","NodeTypeSelector","Button","X"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA4BO,MAAM,aAAkC,CAAC;AAAA,EAC9C;AAAA,EACA;AACF,MAAM;AACE,QAAA,EAAE,gBAAgB,yBAAA,IAA6BA,iDAAA;AAAA,IACnD,CAAC,OAAO;AAAA,MACN,0BAA0B,EAAE;AAAA,MAC5B,gBAAgB,EAAE;AAAA,IAAA;AAAA,EACpB;AAEI,QAAA,UAAU,gBAAgB,WAAW;AAC3C,QAAM,iBAAiB,QAAQ,QAAQ,SAAS,CAAC,GAAG,OAAO;AAC3D,QAAM,EAAE,YAAY,cAAc,iBAAiB,IACjDC,cAAAA,cAAcC,oDAAAA,iBAAiB;AAEjC,QAAM,EAAE,eAAe,qBAAqB,qBAC1CC,kDAAAA,sBAAsB,CAAC,OAAO;AAAA,IAC5B,eAAe,EAAE;AAAA,IACjB,qBAAqB,EAAE;AAAA,IACvB,kBAAkB,EAAE;AAAA,EACpB,EAAA;AAEJ,QAAM,UAAU,cAAc,aAAa,GAAG,UAC1CC,iBAA4B,4BAAA,cAAc,aAAa,EAAE,SAAS,OAAO,IACzEA,iBAAAA,4BAA4B,WAAW,SAAS,OAAO;AAErD,QAAA,oBAAoBC,2EAAqB,OA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gBACAN,2BAAAA,kBAAAA,KAAC,QAAK,EAAA,WAAU,+CAA8C,UAAA;AAAA,kBAAA;AAAA,kBAC1D;AAAA,kBAAe;AAAA,gBAAA,GACnB;AAAA,cAAA,GACF;AAAA,YAAA,GACF;AAAA,8DAGD,OACC,EAAA,UAAA;AAAA,cAACE,2BAAAA,kBAAAA,IAAAE,uBAAAA,OAAA,EAAO,2BAAiB,MAAM,CAAA;AAAA,cAE/BF,2BAAA,kBAAA;AAAA,gBAACK,kDAAA;AAAA,gBAAA;AAAA,kBACC;AAAA,kBACA;AAAA,kBACA;AAAA,gBAAA;AAAA,cACF;AAAA,YAAA,GACF;AAAA,UAAA,GACF;AAAA,UACC,QAAQ,SAAS,KAChBL,2BAAA,kBAAA;AAAA,YAACM,yBAAA;AAAA,YAAA;AAAA,cACC,OAAO,aAAa,MAAM;AAAA,cAC1B,SAAQ;AAAA,cACR,OAAM;AAAA,cACN,WAAU;AAAA,cACV,MAAMC,YAAA;AAAA,cACN,SAAS,MAAM;AACI,iCAAA,eAAe,QAAW,OAAO;AAElD,sBAAM,gBAA2B,QAAQ,MAAM,GAAG,EAAE;AACpD,yCAAyB,aAAa;AAAA,cACxC;AAAA,cAEC,UAAa,aAAA;AAAA,YAAA;AAAA,UAChB;AAAA,QAAA;AAAA,MAAA;AAAA,MAjDG,KAAK,UAAU,gBAAgB,OAAO;AAAA,IAqD7C,IAAAP,2BAAA,kBAAA,IAAC,QAAK,EAAA,WAAU,MAAM,CAAA;AAAA,EAE1B,EAAA,CAAA;AAEJ;;"}
1
+ {"version":3,"file":"EditorView.cjs","sources":["../../../../src/components/DictionaryFieldEditor/EditorView/EditorView.tsx"],"sourcesContent":["'use client';\n\nimport { type KeyPath, type Dictionary } from '@intlayer/core';\nimport { X } from 'lucide-react';\nimport { type FC } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { EditableFieldInput } from '../..//EditableField';\nimport {\n camelCaseToSentence,\n sentenceToCamelCase,\n} from '../../../utils/camelCase';\nimport { getDictionaryValueByKeyPath } from '../../../utils/dictionary';\nimport { Button } from '../../Button';\nimport {\n useEditedContentStore,\n useEditionPanelStore,\n} from '../../DictionaryEditor';\nimport { Label } from '../../Label';\nimport { editorViewContent } from '../editorView.content';\nimport { getIsEditableSection } from '../getIsEditableSection';\nimport { NodeTypeSelector } from '../NodeTypeSelector';\nimport { TextEditor } from './TextEditor';\n\ntype EditorViewProps = {\n dictionaryKey: string;\n dictionary: Dictionary;\n};\n\nexport const EditorView: FC<EditorViewProps> = ({\n dictionaryKey,\n dictionary,\n}) => {\n const { focusedContent, setFocusedContentKeyPath } = useEditionPanelStore(\n (s) => ({\n setFocusedContentKeyPath: s.setFocusedContentKeyPath,\n focusedContent: s.focusedContent,\n })\n );\n const keyPath = focusedContent?.keyPath ?? [];\n const initialKeyName = keyPath[keyPath.length - 1]?.key ?? '';\n const { titleInput, deleteButton, nodeTypeSelector } =\n useDictionary(editorViewContent);\n\n const { editedContent, renameEditedContent, addEditedContent } =\n useEditedContentStore((s) => ({\n editedContent: s.editedContent,\n renameEditedContent: s.renameEditedContent,\n addEditedContent: s.addEditedContent,\n }));\n\n const section = editedContent[dictionaryKey]?.content\n ? getDictionaryValueByKeyPath(editedContent[dictionaryKey].content, keyPath)\n : getDictionaryValueByKeyPath(dictionary.content, keyPath);\n\n const isEditableSection = getIsEditableSection(section);\n\n const handleRenameNodeKey = (keyName: string) => {\n const camelCaseSentence = sentenceToCamelCase(keyName);\n renameEditedContent(dictionaryKey, camelCaseSentence, keyPath);\n const prevKeyPath: KeyPath[] = keyPath.slice(0, -1);\n const lastKeyPath: KeyPath = keyPath[keyPath.length - 1];\n const newKeyPath: KeyPath[] = [\n ...prevKeyPath,\n { ...lastKeyPath, key: camelCaseSentence } as KeyPath,\n ];\n setFocusedContentKeyPath(newKeyPath);\n };\n\n return (\n <>\n {isEditableSection && (\n <TextEditor\n key={keyPath.join('.')}\n keyPath={keyPath}\n section={section}\n dictionaryKey={dictionaryKey}\n />\n )}\n {keyPath.length > 0 ? (\n <form\n className=\"bg-text text-text-dark dark:bg-text-dark dark:text-text flex w-full flex-col items-start justify-between gap-6 px-4 py-2\"\n key={JSON.stringify(focusedContent?.keyPath)}\n >\n <div className=\"flex w-full flex-wrap items-start justify-between gap-6\">\n {typeof initialKeyName === 'string' && (\n <div className=\"flex flex-col gap-3\">\n <Label>{titleInput.label}</Label>\n <div className=\"flex flex-wrap items-center gap-4\">\n <EditableFieldInput\n name=\"key\"\n aria-label=\"Key\"\n key={initialKeyName}\n placeholder={titleInput.placeholder.value}\n defaultValue={camelCaseToSentence(initialKeyName)}\n onSave={(value) => handleRenameNodeKey(value)}\n className=\"h-8\"\n variant=\"invisible\"\n />\n <span className=\"text-neutral dark:text-neutral-dark text-sm\">\n ({initialKeyName})\n </span>\n </div>\n </div>\n )}\n\n <div>\n <Label>{nodeTypeSelector.label}</Label>\n\n <NodeTypeSelector\n keyPath={keyPath}\n dictionaryKey={dictionaryKey}\n section={section}\n />\n </div>\n </div>\n {keyPath.length > 0 && (\n <Button\n label={deleteButton.label.value}\n variant=\"outline\"\n color=\"error\"\n className=\"ml-auto\"\n Icon={X}\n onClick={() => {\n addEditedContent(dictionaryKey, undefined, keyPath);\n\n const parentKeyPath: KeyPath[] = keyPath.slice(0, -1);\n setFocusedContentKeyPath(parentKeyPath);\n }}\n >\n {deleteButton.text}\n </Button>\n )}\n </form>\n ) : (\n <span className=\"h-8\"></span>\n )}\n </>\n );\n};\n"],"names":["useEditionPanelStore","useDictionary","editorViewContent","useEditedContentStore","getDictionaryValueByKeyPath","getIsEditableSection","sentenceToCamelCase","jsxs","Fragment","jsx","TextEditor","Label","EditableFieldInput","camelCaseToSentence","NodeTypeSelector","Button","X"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BO,MAAM,aAAkC,CAAC;AAAA,EAC9C;AAAA,EACA;AACF,MAAM;AACE,QAAA,EAAE,gBAAgB,yBAAA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,cACN,SAAS,MAAM;AACI,iCAAA,eAAe,QAAW,OAAO;AAElD,sBAAM,gBAA2B,QAAQ,MAAM,GAAG,EAAE;AACpD,yCAAyB,aAAa;AAAA,cACxC;AAAA,cAEC,UAAa,aAAA;AAAA,YAAA;AAAA,UAChB;AAAA,QAAA;AAAA,MAAA;AAAA,MAjDG,KAAK,UAAU,gBAAgB,OAAO;AAAA,IAqD7C,IAAAP,2BAAA,kBAAA,IAAC,QAAK,EAAA,WAAU,MAAM,CAAA;AAAA,EAE1B,EAAA,CAAA;AAEJ;;"}
@@ -1,6 +1,5 @@
1
1
  import { Dictionary } from '@intlayer/core';
2
2
  import { FC } from 'react';
3
-
4
3
  type EditorViewProps = {
5
4
  dictionaryKey: string;
6
5
  dictionary: Dictionary;
@@ -1 +1 @@
1
- {"version":3,"file":"EditorView.d.ts","sourceRoot":"","sources":["../../../../src/components/DictionaryFieldEditor/EditorView/EditorView.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAgB,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE/D,OAAO,EAAE,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAmBhC,KAAK,eAAe,GAAG;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,UAAU,CAAC;CACxB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,EAAE,CAAC,eAAe,CA8G1C,CAAC"}
1
+ {"version":3,"file":"EditorView.d.ts","sourceRoot":"","sources":["../../../../src/components/DictionaryFieldEditor/EditorView/EditorView.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAgB,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE/D,OAAO,EAAE,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAoBhC,KAAK,eAAe,GAAG;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,UAAU,CAAC;CACxB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,EAAE,CAAC,eAAe,CA8G1C,CAAC"}
@@ -3,17 +3,32 @@ import { j as jsxRuntimeExports } from "../../../jsx-runtime-BgSF1HG2.js";
3
3
  import { X } from "lucide-react";
4
4
  import { useDictionary } from "react-intlayer";
5
5
  import { EditableFieldInput } from "../../EditableField/EditableFieldInput.mjs";
6
- import "react";
7
- import "../../TextArea/AutoSizeTextArea.mjs";
8
- import "../../TextArea/TextArea.mjs";
9
- import "clsx";
10
- import "tailwind-merge";
11
- import { Button } from "../../Button/Button.mjs";
6
+ import "../../EditableField/EditableFieldTextArea.mjs";
12
7
  import { camelCaseToSentence, sentenceToCamelCase } from "../../../utils/camelCase.mjs";
13
8
  import { getDictionaryValueByKeyPath } from "../../../utils/dictionary.mjs";
9
+ import { Button } from "../../Button/Button.mjs";
14
10
  import { useEditedContentStore } from "../../DictionaryEditor/useEditedContentStore.mjs";
15
11
  import { useEditionPanelStore } from "../../DictionaryEditor/useEditionPanelStore.mjs";
16
12
  import "@intlayer/core";
13
+ import "react";
14
+ import "clsx";
15
+ import "tailwind-merge";
16
+ import "../../../hooks/useScrollBlockage/useScrollBlockageStore.mjs";
17
+ import "../../../hooks/useAsync/useAsyncStateStore.mjs";
18
+ import "../../Auth/AuthProvider/index.mjs";
19
+ import "../../../libs/intlayer-api/auth.mjs";
20
+ import "../../../libs/intlayer-api/dictionary.mjs";
21
+ import "../../../libs/intlayer-api/organization.mjs";
22
+ import "../../../libs/intlayer-api/project.mjs";
23
+ import "../../../libs/intlayer-api/user.mjs";
24
+ import "@intlayer/dictionaries-entry";
25
+ import "deepmerge";
26
+ import "../../Form/FormBase.mjs";
27
+ import "../../Form/FormField.mjs";
28
+ import "../../../Form-DyFBmVya.js";
29
+ import "../../Toaster/Toast.mjs";
30
+ import "../../DictionaryEditor/validDictionaryChangeButtons.content.mjs";
31
+ import "zod";
17
32
  import { Label } from "../../Label/index.mjs";
18
33
  import { editorViewContent } from "../editorView.content.mjs";
19
34
  import { getIsEditableSection } from "../getIsEditableSection.mjs";
@@ -1 +1 @@
1
- {"version":3,"file":"EditorView.mjs","sources":["../../../../src/components/DictionaryFieldEditor/EditorView/EditorView.tsx"],"sourcesContent":["'use client';\n\nimport { type KeyPath, type Dictionary } from '@intlayer/core';\nimport { X } from 'lucide-react';\nimport { type FC } from 'react';\nimport { useDictionary } from 'react-intlayer';\nimport { EditableFieldInput } from '../..//EditableField';\nimport {\n camelCaseToSentence,\n sentenceToCamelCase,\n} from '../../../utils/camelCase';\nimport { getDictionaryValueByKeyPath } from '../../../utils/dictionary';\nimport { Button } from '../../Button';\nimport {\n useEditedContentStore,\n useEditionPanelStore,\n} from '../../DictionaryEditor';\nimport { Label } from '../../Label';\nimport { editorViewContent } from '../editorView.content';\nimport { getIsEditableSection } from '../getIsEditableSection';\nimport { NodeTypeSelector } from '../NodeTypeSelector';\nimport { TextEditor } from './TextEditor';\n\ntype EditorViewProps = {\n dictionaryKey: string;\n dictionary: Dictionary;\n};\n\nexport const EditorView: FC<EditorViewProps> = ({\n dictionaryKey,\n dictionary,\n}) => {\n const { focusedContent, setFocusedContentKeyPath } = useEditionPanelStore(\n (s) => ({\n setFocusedContentKeyPath: s.setFocusedContentKeyPath,\n focusedContent: s.focusedContent,\n })\n );\n const keyPath = focusedContent?.keyPath ?? [];\n const initialKeyName = keyPath[keyPath.length - 1]?.key ?? '';\n const { titleInput, deleteButton, nodeTypeSelector } =\n useDictionary(editorViewContent);\n\n const { editedContent, renameEditedContent, addEditedContent } =\n useEditedContentStore((s) => ({\n editedContent: s.editedContent,\n renameEditedContent: s.renameEditedContent,\n addEditedContent: s.addEditedContent,\n }));\n\n const section = editedContent[dictionaryKey]?.content\n ? getDictionaryValueByKeyPath(editedContent[dictionaryKey].content, keyPath)\n : getDictionaryValueByKeyPath(dictionary.content, keyPath);\n\n const isEditableSection = getIsEditableSection(section);\n\n const handleRenameNodeKey = (keyName: string) => {\n const camelCaseSentence = sentenceToCamelCase(keyName);\n renameEditedContent(dictionaryKey, camelCaseSentence, keyPath);\n const prevKeyPath: KeyPath[] = keyPath.slice(0, -1);\n const lastKeyPath: KeyPath = keyPath[keyPath.length - 1];\n const newKeyPath: KeyPath[] = [\n ...prevKeyPath,\n { ...lastKeyPath, key: camelCaseSentence } as KeyPath,\n ];\n setFocusedContentKeyPath(newKeyPath);\n };\n\n return (\n <>\n {isEditableSection && (\n <TextEditor\n key={keyPath.join('.')}\n keyPath={keyPath}\n section={section}\n dictionaryKey={dictionaryKey}\n />\n )}\n {keyPath.length > 0 ? (\n <form\n className=\"bg-text text-text-dark dark:bg-text-dark dark:text-text flex w-full flex-col items-start justify-between gap-6 px-4 py-2\"\n key={JSON.stringify(focusedContent?.keyPath)}\n >\n <div className=\"flex w-full flex-wrap items-start justify-between gap-6\">\n {typeof initialKeyName === 'string' && (\n <div className=\"flex flex-col gap-3\">\n <Label>{titleInput.label}</Label>\n <div className=\"flex flex-wrap items-center gap-4\">\n <EditableFieldInput\n name=\"key\"\n aria-label=\"Key\"\n key={initialKeyName}\n placeholder={titleInput.placeholder.value}\n defaultValue={camelCaseToSentence(initialKeyName)}\n onSave={(value) => handleRenameNodeKey(value)}\n className=\"h-8\"\n variant=\"invisible\"\n />\n <span className=\"text-neutral dark:text-neutral-dark text-sm\">\n ({initialKeyName})\n </span>\n </div>\n </div>\n )}\n\n <div>\n <Label>{nodeTypeSelector.label}</Label>\n\n <NodeTypeSelector\n keyPath={keyPath}\n dictionaryKey={dictionaryKey}\n section={section}\n />\n </div>\n </div>\n {keyPath.length > 0 && (\n <Button\n label={deleteButton.label.value}\n variant=\"outline\"\n color=\"error\"\n className=\"ml-auto\"\n Icon={X}\n onClick={() => {\n addEditedContent(dictionaryKey, undefined, keyPath);\n\n const parentKeyPath: KeyPath[] = keyPath.slice(0, -1);\n setFocusedContentKeyPath(parentKeyPath);\n }}\n >\n {deleteButton.text}\n </Button>\n )}\n </form>\n ) : (\n <span className=\"h-8\"></span>\n )}\n </>\n );\n};\n"],"names":["jsxs","Fragment","jsx"],"mappings":";;;;;;;;;;;;;;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yB,aAAa;AAAA,cACxC;AAAA,cAEC,UAAa,aAAA;AAAA,YAAA;AAAA,UAChB;AAAA,QAAA;AAAA,MAAA;AAAA,MAjDG,KAAK,UAAU,gBAAgB,OAAO;AAAA,IAqD7C,IAAAA,kCAAA,IAAC,QAAK,EAAA,WAAU,MAAM,CAAA;AAAA,EAE1B,EAAA,CAAA;AAEJ;"}
1
+ {"version":3,"file":"EditorView.mjs","sources":["../../../../src/components/DictionaryFieldEditor/EditorView/EditorView.tsx"],"sourcesContent":["'use client';\n\nimport { type KeyPath, type Dictionary } from '@intlayer/core';\nimport { X } from 'lucide-react';\nimport { type FC } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { EditableFieldInput } from '../..//EditableField';\nimport {\n camelCaseToSentence,\n sentenceToCamelCase,\n} from '../../../utils/camelCase';\nimport { getDictionaryValueByKeyPath } from '../../../utils/dictionary';\nimport { Button } from '../../Button';\nimport {\n useEditedContentStore,\n useEditionPanelStore,\n} from '../../DictionaryEditor';\nimport { Label } from '../../Label';\nimport { editorViewContent } from '../editorView.content';\nimport { getIsEditableSection } from '../getIsEditableSection';\nimport { NodeTypeSelector } from '../NodeTypeSelector';\nimport { TextEditor } from './TextEditor';\n\ntype EditorViewProps = {\n dictionaryKey: string;\n dictionary: Dictionary;\n};\n\nexport const EditorView: FC<EditorViewProps> = ({\n dictionaryKey,\n dictionary,\n}) => {\n const { focusedContent, setFocusedContentKeyPath } = useEditionPanelStore(\n (s) => ({\n setFocusedContentKeyPath: s.setFocusedContentKeyPath,\n focusedContent: s.focusedContent,\n })\n );\n const keyPath = focusedContent?.keyPath ?? [];\n const initialKeyName = keyPath[keyPath.length - 1]?.key ?? '';\n const { titleInput, deleteButton, nodeTypeSelector } =\n useDictionary(editorViewContent);\n\n const { editedContent, renameEditedContent, addEditedContent } =\n useEditedContentStore((s) => ({\n editedContent: s.editedContent,\n renameEditedContent: s.renameEditedContent,\n addEditedContent: s.addEditedContent,\n }));\n\n const section = editedContent[dictionaryKey]?.content\n ? getDictionaryValueByKeyPath(editedContent[dictionaryKey].content, keyPath)\n : getDictionaryValueByKeyPath(dictionary.content, keyPath);\n\n const isEditableSection = getIsEditableSection(section);\n\n const handleRenameNodeKey = (keyName: string) => {\n const camelCaseSentence = sentenceToCamelCase(keyName);\n renameEditedContent(dictionaryKey, camelCaseSentence, keyPath);\n const prevKeyPath: KeyPath[] = keyPath.slice(0, -1);\n const lastKeyPath: KeyPath = keyPath[keyPath.length - 1];\n const newKeyPath: KeyPath[] = [\n ...prevKeyPath,\n { ...lastKeyPath, key: camelCaseSentence } as KeyPath,\n ];\n setFocusedContentKeyPath(newKeyPath);\n };\n\n return (\n <>\n {isEditableSection && (\n <TextEditor\n key={keyPath.join('.')}\n keyPath={keyPath}\n section={section}\n dictionaryKey={dictionaryKey}\n />\n )}\n {keyPath.length > 0 ? (\n <form\n className=\"bg-text text-text-dark dark:bg-text-dark dark:text-text flex w-full flex-col items-start justify-between gap-6 px-4 py-2\"\n key={JSON.stringify(focusedContent?.keyPath)}\n >\n <div className=\"flex w-full flex-wrap items-start justify-between gap-6\">\n {typeof initialKeyName === 'string' && (\n <div className=\"flex flex-col gap-3\">\n <Label>{titleInput.label}</Label>\n <div className=\"flex flex-wrap items-center gap-4\">\n <EditableFieldInput\n name=\"key\"\n aria-label=\"Key\"\n key={initialKeyName}\n placeholder={titleInput.placeholder.value}\n defaultValue={camelCaseToSentence(initialKeyName)}\n onSave={(value) => handleRenameNodeKey(value)}\n className=\"h-8\"\n variant=\"invisible\"\n />\n <span className=\"text-neutral dark:text-neutral-dark text-sm\">\n ({initialKeyName})\n </span>\n </div>\n </div>\n )}\n\n <div>\n <Label>{nodeTypeSelector.label}</Label>\n\n <NodeTypeSelector\n keyPath={keyPath}\n dictionaryKey={dictionaryKey}\n section={section}\n />\n </div>\n </div>\n {keyPath.length > 0 && (\n <Button\n label={deleteButton.label.value}\n variant=\"outline\"\n color=\"error\"\n className=\"ml-auto\"\n Icon={X}\n onClick={() => {\n addEditedContent(dictionaryKey, undefined, keyPath);\n\n const parentKeyPath: KeyPath[] = keyPath.slice(0, -1);\n setFocusedContentKeyPath(parentKeyPath);\n }}\n >\n {deleteButton.text}\n </Button>\n )}\n </form>\n ) : (\n <span className=\"h-8\"></span>\n )}\n </>\n );\n};\n"],"names":["jsxs","Fragment","jsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BO,MAAM,aAAkC,CAAC;AAAA,EAC9C;AAAA,EACA;AACF,MAAM;AACE,QAAA,EAAE,gBAAgB,yBAAA,IAA6B;AAAA,IACnD,CAAC,OAAO;AAAA,MACN,0BAA0B,EAAE;AAAA,MAC5B,gBAAgB,EAAE;AAAA,IAAA;AAAA,EACpB;AAEI,QAAA,UAAU,gBAAgB,WAAW;AAC3C,QAAM,iBAAiB,QAAQ,QAAQ,SAAS,CAAC,GAAG,OAAO;AAC3D,QAAM,EAAE,YAAY,cAAc,iBAAiB,IACjD,cAAc,iBAAiB;AAEjC,QAAM,EAAE,eAAe,qBAAqB,qBAC1C,sBAAsB,CAAC,OAAO;AAAA,IAC5B,eAAe,EAAE;AAAA,IACjB,qBAAqB,EAAE;AAAA,IACvB,kBAAkB,EAAE;AAAA,EACpB,EAAA;AAEJ,QAAM,UAAU,cAAc,aAAa,GAAG,UAC1C,4BAA4B,cAAc,aAAa,EAAE,SAAS,OAAO,IACzE,4BAA4B,WAAW,SAAS,OAAO;AAErD,QAAA,oBAAoB,qBAAqB,OAAO;AAEhD,QAAA,sBAAsB,CAAC,YAAoB;AACzC,UAAA,oBAAoB,oBAAoB,OAAO;AACjC,wBAAA,eAAe,mBAAmB,OAAO;AAC7D,UAAM,cAAyB,QAAQ,MAAM,GAAG,EAAE;AAClD,UAAM,cAAuB,QAAQ,QAAQ,SAAS,CAAC;AACvD,UAAM,aAAwB;AAAA,MAC5B,GAAG;AAAA,MACH,EAAE,GAAG,aAAa,KAAK,kBAAkB;AAAA,IAA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AAAA,UACC,QAAQ,SAAS,KAChBA,kCAAA;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,OAAO,aAAa,MAAM;AAAA,cAC1B,SAAQ;AAAA,cACR,OAAM;AAAA,cACN,WAAU;AAAA,cACV,MAAM;AAAA,cACN,SAAS,MAAM;AACI,iCAAA,eAAe,QAAW,OAAO;AAElD,sBAAM,gBAA2B,QAAQ,MAAM,GAAG,EAAE;AACpD,yCAAyB,aAAa;AAAA,cACxC;AAAA,cAEC,UAAa,aAAA;AAAA,YAAA;AAAA,UAChB;AAAA,QAAA;AAAA,MAAA;AAAA,MAjDG,KAAK,UAAU,gBAAgB,OAAO;AAAA,IAqD7C,IAAAA,kCAAA,IAAC,QAAK,EAAA,WAAU,MAAM,CAAA;AAAA,EAE1B,EAAA,CAAA;AAEJ;"}
@@ -12,9 +12,27 @@ const utils_object = require("../../../utils/object.cjs");
12
12
  const components_Button_Button = require("../../Button/Button.cjs");
13
13
  const components_ContentEditor_ContentEditorTextArea = require("../../ContentEditor/ContentEditorTextArea.cjs");
14
14
  const components_DictionaryEditor_useEditedContentStore = require("../../DictionaryEditor/useEditedContentStore.cjs");
15
- const components_DictionaryEditor_useEditionPanelStore = require("../../DictionaryEditor/useEditionPanelStore.cjs");
15
+ require("../../DictionaryEditor/useEditionPanelStore.cjs");
16
16
  require("clsx");
17
17
  require("tailwind-merge");
18
+ require("../../EditableField/EditableFieldInput.cjs");
19
+ require("../../EditableField/EditableFieldTextArea.cjs");
20
+ require("../../../hooks/useScrollBlockage/useScrollBlockageStore.cjs");
21
+ require("../../../hooks/useAsync/useAsyncStateStore.cjs");
22
+ require("../../Auth/AuthProvider/index.cjs");
23
+ require("../../../libs/intlayer-api/auth.cjs");
24
+ require("../../../libs/intlayer-api/dictionary.cjs");
25
+ require("../../../libs/intlayer-api/organization.cjs");
26
+ require("../../../libs/intlayer-api/project.cjs");
27
+ require("../../../libs/intlayer-api/user.cjs");
28
+ require("@intlayer/dictionaries-entry");
29
+ require("deepmerge");
30
+ require("../../Form/FormBase.cjs");
31
+ require("../../Form/FormField.cjs");
32
+ require("../../../Form-DERuauvB.cjs");
33
+ require("../../Toaster/Toast.cjs");
34
+ require("../../DictionaryEditor/validDictionaryChangeButtons.content.cjs");
35
+ require("zod");
18
36
  const components_DictionaryFieldEditor_EnumKeyInput = require("../EnumKeyInput.cjs");
19
37
  const components_DictionaryFieldEditor_getIsEditableSection = require("../getIsEditableSection.cjs");
20
38
  const components_DictionaryFieldEditor_NavigationView_navigationViewNode_content = require("../NavigationView/navigationViewNode.content.cjs");
@@ -51,7 +69,7 @@ const TranslationTextEditor = ({
51
69
  }) => {
52
70
  const { locales } = client.getConfiguration().internationalization;
53
71
  const addEditedContent = components_DictionaryEditor_useEditedContentStore.useEditedContentStore((s) => s.addEditedContent);
54
- return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx("table", { className: "w-full gap-2", children: locales.map((translationKey) => /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsxs(
72
+ return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx("table", { className: "w-full gap-2", children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx("tbody", { children: locales.map((translationKey) => /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsxs(
55
73
  "tr",
56
74
  {
57
75
  className: "border-text dark:border-text-dark w-full border-t-[1.5px]",
@@ -76,7 +94,7 @@ const TranslationTextEditor = ({
76
94
  ]
77
95
  },
78
96
  translationKey
79
- )) });
97
+ )) }) });
80
98
  };
81
99
  const EnumerationTextEditor = ({
82
100
  section,
@@ -86,7 +104,7 @@ const EnumerationTextEditor = ({
86
104
  const addEditedContent = components_DictionaryEditor_useEditedContentStore.useEditedContentStore((s) => s.addEditedContent);
87
105
  const { addNewEnumeration } = reactIntlayer.useDictionary(components_DictionaryFieldEditor_NavigationView_navigationViewNode_content.navigationViewContent);
88
106
  return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsxs("table", { className: "w-full table-fixed gap-2", children: [
89
- Object.keys(
107
+ /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx("tbody", { children: Object.keys(
90
108
  section[core.NodeType.Enumeration]
91
109
  ).map((enumKey) => /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsxs(
92
110
  "tr",
@@ -150,8 +168,8 @@ const EnumerationTextEditor = ({
150
168
  ]
151
169
  },
152
170
  enumKey
153
- )),
154
- /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
171
+ )) }),
172
+ /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx("tfoot", { children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
155
173
  components_Button_Button.Button,
156
174
  {
157
175
  label: addNewEnumeration.label.value,
@@ -168,7 +186,7 @@ const EnumerationTextEditor = ({
168
186
  className: "m-2",
169
187
  children: addNewEnumeration.text
170
188
  }
171
- )
189
+ ) })
172
190
  ] });
173
191
  };
174
192
  const ArrayTextEditor = ({
@@ -177,12 +195,9 @@ const ArrayTextEditor = ({
177
195
  dictionaryKey
178
196
  }) => {
179
197
  const addEditedContent = components_DictionaryEditor_useEditedContentStore.useEditedContentStore((s) => s.addEditedContent);
180
- components_DictionaryEditor_useEditionPanelStore.useEditionPanelStore(
181
- (s) => s.setFocusedContentKeyPath
182
- );
183
198
  const { addNewElement } = reactIntlayer.useDictionary(components_DictionaryFieldEditor_NavigationView_navigationViewNode_content.navigationViewContent);
184
199
  return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsxs("table", { className: "w-full gap-2", children: [
185
- section.map((subSection, index) => /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsxs(
200
+ /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx("tbody", { children: section.map((subSection, index) => /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsxs(
186
201
  "tr",
187
202
  {
188
203
  className: "border-text dark:border-text-dark w-full border-t-[1.5px]",
@@ -208,8 +223,8 @@ const ArrayTextEditor = ({
208
223
  ]
209
224
  },
210
225
  JSON.stringify(subSection)
211
- )),
212
- /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
226
+ )) }),
227
+ /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx("tfoot", { children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
213
228
  components_Button_Button.Button,
214
229
  {
215
230
  label: addNewElement.label.value,
@@ -229,7 +244,7 @@ const ArrayTextEditor = ({
229
244
  Icon: lucideReact.Plus,
230
245
  children: addNewElement.text
231
246
  }
232
- )
247
+ ) })
233
248
  ] });
234
249
  };
235
250
  const TextEditor = ({
@@ -1 +1 @@
1
- {"version":3,"file":"TextEditor.cjs","sources":["../../../../src/components/DictionaryFieldEditor/EditorView/TextEditor.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n'use client';\n\nimport { getConfiguration } from '@intlayer/config/client';\nimport {\n type EnumerationContent,\n type TranslationContent,\n type RecursiveDictionaryValue,\n NodeType,\n type KeyPath,\n type DictionaryValue,\n getLocaleName,\n} from '@intlayer/core';\nimport { Plus, X } from 'lucide-react';\nimport {\n createElement,\n type ReactElement,\n type ReactNode,\n type FC,\n} from 'react';\nimport { useDictionary } from 'react-intlayer';\nimport { getSectionType } from '../../../utils/dictionary';\nimport { renameKey } from '../../../utils/object';\nimport { Button } from '../../Button';\nimport { ContentEditorTextArea } from '../../ContentEditor/ContentEditorTextArea';\nimport {\n useEditedContentStore,\n useEditionPanelStore,\n} from '../../DictionaryEditor';\nimport { EnumKeyInput } from '../EnumKeyInput';\nimport { getIsEditableSection } from '../getIsEditableSection';\nimport { navigationViewContent } from '../NavigationView/navigationViewNode.content';\n\nexport const traceKeys: string[] = ['filePath', 'id', 'nodeType'];\n\nconst createReactElement = (element: ReactElement) => {\n if (typeof element === 'string') {\n // If it's a string, simply return it (used for text content)\n return element;\n }\n\n const convertChildrenAsArray = (element: ReactElement): ReactElement => {\n if (element?.props && typeof element.props.children === 'object') {\n const childrenResult: ReactNode[] = [];\n const { children } = element.props;\n\n // Create the children elements recursively, if any\n Object.keys(children).forEach((key) =>\n childrenResult.push(createReactElement(children[key]))\n );\n\n return {\n ...element,\n props: { ...element.props, children: childrenResult },\n };\n }\n\n return {\n ...element,\n props: { ...element.props, children: element.props.children },\n };\n };\n\n const fixedElement = convertChildrenAsArray(element);\n\n const { type, props } = fixedElement;\n\n // Create and return the React element\n return createElement(type ?? 'div', props, ...props.children);\n};\n\nexport type TextEditorProps = {\n dictionaryKey: string;\n keyPath: KeyPath[];\n section: DictionaryValue;\n};\n\nconst TranslationTextEditor: FC<TextEditorProps> = ({\n section,\n keyPath,\n dictionaryKey,\n}: TextEditorProps) => {\n const { locales } = getConfiguration().internationalization;\n const addEditedContent = useEditedContentStore((s) => s.addEditedContent);\n\n return (\n <table className=\"w-full gap-2\">\n {locales.map((translationKey) => (\n <tr\n key={translationKey}\n className=\"border-text dark:border-text-dark w-full border-t-[1.5px]\"\n lang={translationKey}\n >\n <td className=\"border-text dark:border-text-dark border-r-[1.5px] p-2\">\n {getLocaleName(translationKey)}\n </td>\n <td className=\"w-full p-2\">\n <ContentEditorTextArea\n variant=\"default\"\n aria-label=\"Edit field\"\n onContentChange={(newValue) =>\n addEditedContent(dictionaryKey, newValue, [\n ...keyPath,\n {\n type: NodeType.Translation,\n key: translationKey,\n },\n ])\n }\n >\n {\n (section as TranslationContent<string>)[NodeType.Translation][\n translationKey\n ] as string\n }\n </ContentEditorTextArea>\n </td>\n </tr>\n ))}\n </table>\n );\n};\n\nconst EnumerationTextEditor: FC<TextEditorProps> = ({\n section,\n keyPath,\n dictionaryKey,\n}) => {\n const addEditedContent = useEditedContentStore((s) => s.addEditedContent);\n const { addNewEnumeration } = useDictionary(navigationViewContent);\n\n return (\n <table className=\"w-full table-fixed gap-2\">\n {Object.keys(\n (section as EnumerationContent<DictionaryValue>)[NodeType.Enumeration]\n ).map((enumKey) => (\n <tr\n key={enumKey}\n className=\"border-text dark:border-text-dark w-full border-y-[1.5px]\"\n >\n <td className=\"border-text dark:border-text-dark w-44 border-r-[1.5px] p-2\">\n <div className=\"flex gap-1\">\n <Button\n label=\"Remove\"\n variant=\"hoverable\"\n size=\"icon-md\"\n color=\"text\"\n Icon={X}\n className=\"w-16\"\n onClick={() =>\n addEditedContent(dictionaryKey, undefined, [\n ...keyPath,\n {\n type: NodeType.Enumeration,\n key: enumKey,\n },\n ])\n }\n />\n <EnumKeyInput\n value={enumKey}\n onChange={(value) => {\n const preValueContent = (\n section as EnumerationContent<string>\n )[NodeType.Enumeration];\n const newValueContent = renameKey(\n preValueContent,\n enumKey as keyof typeof preValueContent,\n value\n );\n const newValue = {\n ...(section as EnumerationContent<string>),\n [NodeType.Enumeration]: newValueContent,\n };\n\n addEditedContent(dictionaryKey, newValue, keyPath);\n }}\n />\n </div>\n </td>\n <td className=\"w-full p-2\">\n <ContentEditorTextArea\n variant=\"default\"\n aria-label=\"Edit field\"\n onContentChange={(newValue) =>\n addEditedContent(dictionaryKey, newValue, [\n ...keyPath,\n {\n type: NodeType.Enumeration,\n key: enumKey,\n },\n ])\n }\n >\n {\n (section as EnumerationContent<string>)[NodeType.Enumeration][\n enumKey as any\n ] as string\n }\n </ContentEditorTextArea>\n </td>\n </tr>\n ))}\n <Button\n label={addNewEnumeration.label.value}\n variant=\"hoverable\"\n color=\"neutral\"\n textAlign=\"left\"\n onClick={() =>\n addEditedContent(\n dictionaryKey,\n '',\n [...keyPath, { type: NodeType.Enumeration, key: 'unknown' }],\n false\n )\n }\n Icon={Plus}\n className=\"m-2\"\n >\n {addNewEnumeration.text}\n </Button>\n </table>\n );\n};\n\nconst ArrayTextEditor: FC<TextEditorProps> = ({\n section,\n keyPath,\n dictionaryKey,\n}) => {\n const addEditedContent = useEditedContentStore((s) => s.addEditedContent);\n const setFocusedContentKeyPath = useEditionPanelStore(\n (s) => s.setFocusedContentKeyPath\n );\n const { addNewElement } = useDictionary(navigationViewContent);\n\n return (\n <table className=\"w-full gap-2\">\n {(section as DictionaryValue[]).map((subSection, index) => (\n <tr\n key={JSON.stringify(subSection)}\n className=\"border-text dark:border-text-dark w-full border-t-[1.5px]\"\n >\n <td className=\"border-text dark:border-text-dark border-r-[1.5px] p-2\">\n {index}\n </td>\n <td className=\"w-full p-2\">\n <ContentEditorTextArea\n variant=\"default\"\n aria-label=\"Edit field\"\n onContentChange={(newValue) => {\n addEditedContent(dictionaryKey, newValue, [\n ...keyPath,\n {\n type: NodeType.Array,\n key: index,\n },\n ]);\n }}\n >\n {subSection as string}\n </ContentEditorTextArea>\n </td>\n </tr>\n ))}\n\n <Button\n label={addNewElement.label.value}\n variant=\"hoverable\"\n color=\"neutral\"\n textAlign=\"left\"\n onClick={() => {\n const newKeyPath: KeyPath[] = [\n ...keyPath,\n {\n type: NodeType.Array,\n key: (section as DictionaryValue[]).length,\n },\n ];\n addEditedContent(dictionaryKey, '', newKeyPath, false);\n }}\n Icon={Plus}\n >\n {addNewElement.text}\n </Button>\n </table>\n );\n};\n\nexport const TextEditor: FC<TextEditorProps> = ({\n section,\n keyPath,\n dictionaryKey,\n}) => {\n const addEditedContent = useEditedContentStore((s) => s.addEditedContent);\n const { tsxNotEditable } = useDictionary(navigationViewContent);\n const nodeType = getSectionType(section);\n const isEditableSection = getIsEditableSection(section);\n\n if (!isEditableSection) return <></>;\n\n if (typeof section === 'object') {\n if (nodeType === NodeType.ReactNode) {\n return (\n <>\n {createReactElement(section as unknown as ReactElement)}\n <span className=\"text-neutral dark:text-neutral-dark text-xs\">\n {tsxNotEditable}\n </span>\n </>\n );\n }\n\n if (nodeType === NodeType.Translation) {\n return (\n <TranslationTextEditor\n dictionaryKey={dictionaryKey}\n keyPath={keyPath}\n section={section}\n />\n );\n }\n\n if (nodeType === NodeType.Enumeration) {\n return (\n <EnumerationTextEditor\n dictionaryKey={dictionaryKey}\n keyPath={keyPath}\n section={section}\n />\n );\n }\n\n if (nodeType === NodeType.Array) {\n return (\n <ArrayTextEditor\n dictionaryKey={dictionaryKey}\n keyPath={keyPath}\n section={section}\n />\n );\n }\n }\n\n if (nodeType === NodeType.Text) {\n return (\n <div className=\"border-text dark:border-text-dark w-full border-t-[1.5px] p-2\">\n <ContentEditorTextArea\n variant=\"default\"\n aria-label=\"Edit field\"\n onContentChange={(newValue) =>\n addEditedContent(dictionaryKey, newValue, keyPath)\n }\n >\n {section as string}\n </ContentEditorTextArea>\n </div>\n );\n }\n\n return <>Error loading section</>;\n};\n"],"names":["element","createElement","getConfiguration","useEditedContentStore","jsxs","jsx","getLocaleName","ContentEditorTextArea","NodeType","useDictionary","navigationViewContent","Button","X","EnumKeyInput","renameKey","Plus","useEditionPanelStore","getSectionType","getIsEditableSection","Fragment"],"mappings":";;;;;;;;;;;;;;;;;;;;AAiCO,MAAM,YAAsB,CAAC,YAAY,MAAM,UAAU;AAEhE,MAAM,qBAAqB,CAAC,YAA0B;AAChD,MAAA,OAAO,YAAY,UAAU;AAExB,WAAA;AAAA,EACT;AAEM,QAAA,yBAAyB,CAACA,aAAwC;AACtE,QAAIA,UAAS,SAAS,OAAOA,SAAQ,MAAM,aAAa,UAAU;AAChE,YAAM,iBAA8B,CAAA;AAC9B,YAAA,EAAE,SAAS,IAAIA,SAAQ;AAGtB,aAAA,KAAK,QAAQ,EAAE;AAAA,QAAQ,CAAC,QAC7B,eAAe,KAAK,mBAAmB,SAAS,GAAG,CAAC,CAAC;AAAA,MAAA;AAGhD,aAAA;AAAA,QACL,GAAGA;AAAAA,QACH,OAAO,EAAE,GAAGA,SAAQ,OAAO,UAAU,eAAe;AAAA,MAAA;AAAA,IAExD;AAEO,WAAA;AAAA,MACL,GAAGA;AAAAA,MACH,OAAO,EAAE,GAAGA,SAAQ,OAAO,UAAUA,SAAQ,MAAM,SAAS;AAAA,IAAA;AAAA,EAC9D;AAGI,QAAA,eAAe,uBAAuB,OAAO;AAE7C,QAAA,EAAE,MAAM,MAAU,IAAA;AAGxB,SAAOC,WAAAA,cAAc,QAAQ,OAAO,OAAO,GAAG,MAA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,KAAAe,uCAAA,EAAA,UAAA;AAAA,QAAA,mBAAmB,OAAkC;AAAA,QACrDd,2BAAA,kBAAA,IAAA,QAAA,EAAK,WAAU,+CACb,UACH,gBAAA;AAAA,MACF,EAAA,CAAA;AAAA,IAEJ;AAEI,QAAA,aAAaG,cAAS,aAAa;AAEnC,aAAAH,2BAAA,kBAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC;AAAA,UACA;AAAA,UACA;AAAA,QAAA;AAAA,MAAA;AAAA,IAGN;AAEI,QAAA,aAAaG,cAAS,aAAa;AAEnC,aAAAH,2BAAA,kBAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC;AAAA,UACA;AAAA,UACA;AAAA,QAAA;AAAA,MAAA;AAAA,IAGN;AAEI,QAAA,aAAaG,cAAS,OAAO;AAE7B,aAAAH,2BAAA,kBAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC;AAAA,UACA;AAAA,UACA;AAAA,QAAA;AAAA,MAAA;AAAA,IAGN;AAAA,EACF;AAEI,MAAA,aAAaG,cAAS,MAAM;AAE5B,WAAAH,2BAAAA,kBAAAA,IAAC,OAAI,EAAA,WAAU,iEACb,UAAAA,2BAAA,kBAAA;AAAA,MAACE,+CAAA;AAAA,MAAA;AAAA,QACC,SAAQ;AAAA,QACR,cAAW;AAAA,QACX,iBAAiB,CAAC,aAChB,iBAAiB,eAAe,UAAU,OAAO;AAAA,QAGlD,UAAA;AAAA,MAAA;AAAA,IAEL,EAAA,CAAA;AAAA,EAEJ;AAEA,mGAAS,UAAqB,wBAAA,CAAA;AAChC;;;"}
1
+ {"version":3,"file":"TextEditor.cjs","sources":["../../../../src/components/DictionaryFieldEditor/EditorView/TextEditor.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n'use client';\n\nimport { getConfiguration } from '@intlayer/config/client';\nimport {\n type EnumerationContent,\n type TranslationContent,\n NodeType,\n type KeyPath,\n type DictionaryValue,\n getLocaleName,\n} from '@intlayer/core';\nimport { Plus, X } from 'lucide-react';\nimport {\n createElement,\n type ReactElement,\n type ReactNode,\n type FC,\n} from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { getSectionType } from '../../../utils/dictionary';\nimport { renameKey } from '../../../utils/object';\nimport { Button } from '../../Button';\nimport { ContentEditorTextArea } from '../../ContentEditor/ContentEditorTextArea';\nimport { useEditedContentStore } from '../../DictionaryEditor';\nimport { EnumKeyInput } from '../EnumKeyInput';\nimport { getIsEditableSection } from '../getIsEditableSection';\nimport { navigationViewContent } from '../NavigationView/navigationViewNode.content';\n\nexport const traceKeys: string[] = ['filePath', 'id', 'nodeType'];\n\nconst createReactElement = (element: ReactElement) => {\n if (typeof element === 'string') {\n // If it's a string, simply return it (used for text content)\n return element;\n }\n\n const convertChildrenAsArray = (element: ReactElement): ReactElement => {\n if (element?.props && typeof element.props.children === 'object') {\n const childrenResult: ReactNode[] = [];\n const { children } = element.props;\n\n // Create the children elements recursively, if any\n Object.keys(children).forEach((key) =>\n childrenResult.push(createReactElement(children[key]))\n );\n\n return {\n ...element,\n props: { ...element.props, children: childrenResult },\n };\n }\n\n return {\n ...element,\n props: { ...element.props, children: element.props.children },\n };\n };\n\n const fixedElement = convertChildrenAsArray(element);\n\n const { type, props } = fixedElement;\n\n // Create and return the React element\n return createElement(type ?? 'div', props, ...props.children);\n};\n\nexport type TextEditorProps = {\n dictionaryKey: string;\n keyPath: KeyPath[];\n section: DictionaryValue;\n};\n\nconst TranslationTextEditor: FC<TextEditorProps> = ({\n section,\n keyPath,\n dictionaryKey,\n}: TextEditorProps) => {\n const { locales } = getConfiguration().internationalization;\n const addEditedContent = useEditedContentStore((s) => s.addEditedContent);\n\n return (\n <table className=\"w-full gap-2\">\n <tbody>\n {locales.map((translationKey) => (\n <tr\n key={translationKey}\n className=\"border-text dark:border-text-dark w-full border-t-[1.5px]\"\n lang={translationKey}\n >\n <td className=\"border-text dark:border-text-dark border-r-[1.5px] p-2\">\n {getLocaleName(translationKey)}\n </td>\n <td className=\"w-full p-2\">\n <ContentEditorTextArea\n variant=\"default\"\n aria-label=\"Edit field\"\n onContentChange={(newValue) =>\n addEditedContent(dictionaryKey, newValue, [\n ...keyPath,\n {\n type: NodeType.Translation,\n key: translationKey,\n },\n ])\n }\n >\n {\n (section as TranslationContent<string>)[NodeType.Translation][\n translationKey\n ] as string\n }\n </ContentEditorTextArea>\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n );\n};\n\nconst EnumerationTextEditor: FC<TextEditorProps> = ({\n section,\n keyPath,\n dictionaryKey,\n}) => {\n const addEditedContent = useEditedContentStore((s) => s.addEditedContent);\n const { addNewEnumeration } = useDictionary(navigationViewContent);\n\n return (\n <table className=\"w-full table-fixed gap-2\">\n <tbody>\n {Object.keys(\n (section as EnumerationContent<DictionaryValue>)[NodeType.Enumeration]\n ).map((enumKey) => (\n <tr\n key={enumKey}\n className=\"border-text dark:border-text-dark w-full border-y-[1.5px]\"\n >\n <td className=\"border-text dark:border-text-dark w-44 border-r-[1.5px] p-2\">\n <div className=\"flex gap-1\">\n <Button\n label=\"Remove\"\n variant=\"hoverable\"\n size=\"icon-md\"\n color=\"text\"\n Icon={X}\n className=\"w-16\"\n onClick={() =>\n addEditedContent(dictionaryKey, undefined, [\n ...keyPath,\n {\n type: NodeType.Enumeration,\n key: enumKey,\n },\n ])\n }\n />\n <EnumKeyInput\n value={enumKey}\n onChange={(value) => {\n const preValueContent = (\n section as EnumerationContent<string>\n )[NodeType.Enumeration];\n const newValueContent = renameKey(\n preValueContent,\n enumKey as keyof typeof preValueContent,\n value\n );\n const newValue = {\n ...(section as EnumerationContent<string>),\n [NodeType.Enumeration]: newValueContent,\n };\n\n addEditedContent(dictionaryKey, newValue, keyPath);\n }}\n />\n </div>\n </td>\n <td className=\"w-full p-2\">\n <ContentEditorTextArea\n variant=\"default\"\n aria-label=\"Edit field\"\n onContentChange={(newValue) =>\n addEditedContent(dictionaryKey, newValue, [\n ...keyPath,\n {\n type: NodeType.Enumeration,\n key: enumKey,\n },\n ])\n }\n >\n {\n (section as EnumerationContent<string>)[NodeType.Enumeration][\n enumKey as any\n ] as string\n }\n </ContentEditorTextArea>\n </td>\n </tr>\n ))}\n </tbody>\n\n <tfoot>\n <Button\n label={addNewEnumeration.label.value}\n variant=\"hoverable\"\n color=\"neutral\"\n textAlign=\"left\"\n onClick={() =>\n addEditedContent(\n dictionaryKey,\n '',\n [...keyPath, { type: NodeType.Enumeration, key: 'unknown' }],\n false\n )\n }\n Icon={Plus}\n className=\"m-2\"\n >\n {addNewEnumeration.text}\n </Button>\n </tfoot>\n </table>\n );\n};\n\nconst ArrayTextEditor: FC<TextEditorProps> = ({\n section,\n keyPath,\n dictionaryKey,\n}) => {\n const addEditedContent = useEditedContentStore((s) => s.addEditedContent);\n const { addNewElement } = useDictionary(navigationViewContent);\n\n return (\n <table className=\"w-full gap-2\">\n <tbody>\n {(section as DictionaryValue[]).map((subSection, index) => (\n <tr\n key={JSON.stringify(subSection)}\n className=\"border-text dark:border-text-dark w-full border-t-[1.5px]\"\n >\n <td className=\"border-text dark:border-text-dark border-r-[1.5px] p-2\">\n {index}\n </td>\n <td className=\"w-full p-2\">\n <ContentEditorTextArea\n variant=\"default\"\n aria-label=\"Edit field\"\n onContentChange={(newValue) => {\n addEditedContent(dictionaryKey, newValue, [\n ...keyPath,\n {\n type: NodeType.Array,\n key: index,\n },\n ]);\n }}\n >\n {subSection as string}\n </ContentEditorTextArea>\n </td>\n </tr>\n ))}\n </tbody>\n <tfoot>\n <Button\n label={addNewElement.label.value}\n variant=\"hoverable\"\n color=\"neutral\"\n textAlign=\"left\"\n onClick={() => {\n const newKeyPath: KeyPath[] = [\n ...keyPath,\n {\n type: NodeType.Array,\n key: (section as DictionaryValue[]).length,\n },\n ];\n addEditedContent(dictionaryKey, '', newKeyPath, false);\n }}\n Icon={Plus}\n >\n {addNewElement.text}\n </Button>\n </tfoot>\n </table>\n );\n};\n\nexport const TextEditor: FC<TextEditorProps> = ({\n section,\n keyPath,\n dictionaryKey,\n}) => {\n const addEditedContent = useEditedContentStore((s) => s.addEditedContent);\n const { tsxNotEditable } = useDictionary(navigationViewContent);\n const nodeType = getSectionType(section);\n const isEditableSection = getIsEditableSection(section);\n\n if (!isEditableSection) return <></>;\n\n if (typeof section === 'object') {\n if (nodeType === NodeType.ReactNode) {\n return (\n <>\n {createReactElement(section as unknown as ReactElement)}\n <span className=\"text-neutral dark:text-neutral-dark text-xs\">\n {tsxNotEditable}\n </span>\n </>\n );\n }\n\n if (nodeType === NodeType.Translation) {\n return (\n <TranslationTextEditor\n dictionaryKey={dictionaryKey}\n keyPath={keyPath}\n section={section}\n />\n );\n }\n\n if (nodeType === NodeType.Enumeration) {\n return (\n <EnumerationTextEditor\n dictionaryKey={dictionaryKey}\n keyPath={keyPath}\n section={section}\n />\n );\n }\n\n if (nodeType === NodeType.Array) {\n return (\n <ArrayTextEditor\n dictionaryKey={dictionaryKey}\n keyPath={keyPath}\n section={section}\n />\n );\n }\n }\n\n if (nodeType === NodeType.Text) {\n return (\n <div className=\"border-text dark:border-text-dark w-full border-t-[1.5px] p-2\">\n <ContentEditorTextArea\n variant=\"default\"\n aria-label=\"Edit field\"\n onContentChange={(newValue) =>\n addEditedContent(dictionaryKey, newValue, keyPath)\n }\n >\n {section as string}\n </ContentEditorTextArea>\n </div>\n );\n }\n\n return <>Error loading section</>;\n};\n"],"names":["element","createElement","getConfiguration","useEditedContentStore","jsx","jsxs","getLocaleName","ContentEditorTextArea","NodeType","useDictionary","navigationViewContent","Button","X","EnumKeyInput","renameKey","Plus","getSectionType","getIsEditableSection","Fragment"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BO,MAAM,YAAsB,CAAC,YAAY,MAAM,UAAU;AAEhE,MAAM,qBAAqB,CAAC,YAA0B;AAChD,MAAA,OAAO,YAAY,UAAU;AAExB,WAAA;AAAA,EACT;AAEM,QAAA,yBAAyB,CAACA,aAAwC;AACtE,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A;AAAA,QAAC;AAAA,QAAA;AAAA,UACC;AAAA,UACA;AAAA,UACA;AAAA,QAAA;AAAA,MAAA;AAAA,IAGN;AAAA,EACF;AAEI,MAAA,aAAaI,cAAS,MAAM;AAE5B,WAAAJ,2BAAAA,kBAAAA,IAAC,OAAI,EAAA,WAAU,iEACb,UAAAA,2BAAA,kBAAA;AAAA,MAACG,+CAAA;AAAA,MAAA;AAAA,QACC,SAAQ;AAAA,QACR,cAAW;AAAA,QACX,iBAAiB,CAAC,aAChB,iBAAiB,eAAe,UAAU,OAAO;AAAA,QAGlD,UAAA;AAAA,MAAA;AAAA,IAEL,EAAA,CAAA;AAAA,EAEJ;AAEA,mGAAS,UAAqB,wBAAA,CAAA;AAChC;;;"}
@@ -1,6 +1,5 @@
1
1
  import { KeyPath, DictionaryValue } from '@intlayer/core';
2
2
  import { FC } from 'react';
3
-
4
3
  export declare const traceKeys: string[];
5
4
  export type TextEditorProps = {
6
5
  dictionaryKey: string;
@@ -1 +1 @@
1
- {"version":3,"file":"TextEditor.d.ts","sourceRoot":"","sources":["../../../../src/components/DictionaryFieldEditor/EditorView/TextEditor.tsx"],"names":[],"mappings":"AAIA,OAAO,EAKL,KAAK,OAAO,EACZ,KAAK,eAAe,EAErB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAIL,KAAK,EAAE,EACR,MAAM,OAAO,CAAC;AAcf,eAAO,MAAM,SAAS,EAAE,MAAM,EAAmC,CAAC;AAsClE,MAAM,MAAM,eAAe,GAAG;IAC5B,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,OAAO,EAAE,CAAC;IACnB,OAAO,EAAE,eAAe,CAAC;CAC1B,CAAC;AAsNF,eAAO,MAAM,UAAU,EAAE,EAAE,CAAC,eAAe,CAwE1C,CAAC"}
1
+ {"version":3,"file":"TextEditor.d.ts","sourceRoot":"","sources":["../../../../src/components/DictionaryFieldEditor/EditorView/TextEditor.tsx"],"names":[],"mappings":"AAIA,OAAO,EAIL,KAAK,OAAO,EACZ,KAAK,eAAe,EAErB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAIL,KAAK,EAAE,EACR,MAAM,OAAO,CAAC;AAYf,eAAO,MAAM,SAAS,EAAE,MAAM,EAAmC,CAAC;AAsClE,MAAM,MAAM,eAAe,GAAG;IAC5B,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,OAAO,EAAE,CAAC;IACnB,OAAO,EAAE,eAAe,CAAC;CAC1B,CAAC;AA6NF,eAAO,MAAM,UAAU,EAAE,EAAE,CAAC,eAAe,CAwE1C,CAAC"}
@@ -10,9 +10,27 @@ import { renameKey } from "../../../utils/object.mjs";
10
10
  import { Button } from "../../Button/Button.mjs";
11
11
  import { ContentEditorTextArea } from "../../ContentEditor/ContentEditorTextArea.mjs";
12
12
  import { useEditedContentStore } from "../../DictionaryEditor/useEditedContentStore.mjs";
13
- import { useEditionPanelStore } from "../../DictionaryEditor/useEditionPanelStore.mjs";
13
+ import "../../DictionaryEditor/useEditionPanelStore.mjs";
14
14
  import "clsx";
15
15
  import "tailwind-merge";
16
+ import "../../EditableField/EditableFieldInput.mjs";
17
+ import "../../EditableField/EditableFieldTextArea.mjs";
18
+ import "../../../hooks/useScrollBlockage/useScrollBlockageStore.mjs";
19
+ import "../../../hooks/useAsync/useAsyncStateStore.mjs";
20
+ import "../../Auth/AuthProvider/index.mjs";
21
+ import "../../../libs/intlayer-api/auth.mjs";
22
+ import "../../../libs/intlayer-api/dictionary.mjs";
23
+ import "../../../libs/intlayer-api/organization.mjs";
24
+ import "../../../libs/intlayer-api/project.mjs";
25
+ import "../../../libs/intlayer-api/user.mjs";
26
+ import "@intlayer/dictionaries-entry";
27
+ import "deepmerge";
28
+ import "../../Form/FormBase.mjs";
29
+ import "../../Form/FormField.mjs";
30
+ import "../../../Form-DyFBmVya.js";
31
+ import "../../Toaster/Toast.mjs";
32
+ import "../../DictionaryEditor/validDictionaryChangeButtons.content.mjs";
33
+ import "zod";
16
34
  import { EnumKeyInput } from "../EnumKeyInput.mjs";
17
35
  import { getIsEditableSection } from "../getIsEditableSection.mjs";
18
36
  import { navigationViewContent } from "../NavigationView/navigationViewNode.content.mjs";
@@ -49,7 +67,7 @@ const TranslationTextEditor = ({
49
67
  }) => {
50
68
  const { locales } = getConfiguration().internationalization;
51
69
  const addEditedContent = useEditedContentStore((s) => s.addEditedContent);
52
- return /* @__PURE__ */ jsxRuntimeExports.jsx("table", { className: "w-full gap-2", children: locales.map((translationKey) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
70
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("table", { className: "w-full gap-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx("tbody", { children: locales.map((translationKey) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
53
71
  "tr",
54
72
  {
55
73
  className: "border-text dark:border-text-dark w-full border-t-[1.5px]",
@@ -74,7 +92,7 @@ const TranslationTextEditor = ({
74
92
  ]
75
93
  },
76
94
  translationKey
77
- )) });
95
+ )) }) });
78
96
  };
79
97
  const EnumerationTextEditor = ({
80
98
  section,
@@ -84,7 +102,7 @@ const EnumerationTextEditor = ({
84
102
  const addEditedContent = useEditedContentStore((s) => s.addEditedContent);
85
103
  const { addNewEnumeration } = useDictionary(navigationViewContent);
86
104
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("table", { className: "w-full table-fixed gap-2", children: [
87
- Object.keys(
105
+ /* @__PURE__ */ jsxRuntimeExports.jsx("tbody", { children: Object.keys(
88
106
  section[NodeType.Enumeration]
89
107
  ).map((enumKey) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
90
108
  "tr",
@@ -148,8 +166,8 @@ const EnumerationTextEditor = ({
148
166
  ]
149
167
  },
150
168
  enumKey
151
- )),
152
- /* @__PURE__ */ jsxRuntimeExports.jsx(
169
+ )) }),
170
+ /* @__PURE__ */ jsxRuntimeExports.jsx("tfoot", { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
153
171
  Button,
154
172
  {
155
173
  label: addNewEnumeration.label.value,
@@ -166,7 +184,7 @@ const EnumerationTextEditor = ({
166
184
  className: "m-2",
167
185
  children: addNewEnumeration.text
168
186
  }
169
- )
187
+ ) })
170
188
  ] });
171
189
  };
172
190
  const ArrayTextEditor = ({
@@ -175,12 +193,9 @@ const ArrayTextEditor = ({
175
193
  dictionaryKey
176
194
  }) => {
177
195
  const addEditedContent = useEditedContentStore((s) => s.addEditedContent);
178
- useEditionPanelStore(
179
- (s) => s.setFocusedContentKeyPath
180
- );
181
196
  const { addNewElement } = useDictionary(navigationViewContent);
182
197
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("table", { className: "w-full gap-2", children: [
183
- section.map((subSection, index) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
198
+ /* @__PURE__ */ jsxRuntimeExports.jsx("tbody", { children: section.map((subSection, index) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
184
199
  "tr",
185
200
  {
186
201
  className: "border-text dark:border-text-dark w-full border-t-[1.5px]",
@@ -206,8 +221,8 @@ const ArrayTextEditor = ({
206
221
  ]
207
222
  },
208
223
  JSON.stringify(subSection)
209
- )),
210
- /* @__PURE__ */ jsxRuntimeExports.jsx(
224
+ )) }),
225
+ /* @__PURE__ */ jsxRuntimeExports.jsx("tfoot", { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
211
226
  Button,
212
227
  {
213
228
  label: addNewElement.label.value,
@@ -227,7 +242,7 @@ const ArrayTextEditor = ({
227
242
  Icon: Plus,
228
243
  children: addNewElement.text
229
244
  }
230
- )
245
+ ) })
231
246
  ] });
232
247
  };
233
248
  const TextEditor = ({