@intlayer/design-system 5.1.5 → 5.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (492) hide show
  1. package/dist/.vite/manifest.json +161 -66
  2. package/dist/{Form-yi0CMK-a.cjs → Form-BpxW17v4.cjs} +3 -3
  3. package/dist/Form-BpxW17v4.cjs.map +1 -0
  4. package/dist/{Form-BZUDRfoN.js → Form-MjLzPGze.js} +3 -3
  5. package/dist/Form-MjLzPGze.js.map +1 -0
  6. package/dist/components/Accordion/Accordion.cjs +1 -1
  7. package/dist/components/Accordion/Accordion.cjs.map +1 -1
  8. package/dist/components/Accordion/Accordion.mjs +1 -1
  9. package/dist/components/Accordion/Accordion.mjs.map +1 -1
  10. package/dist/components/Auth/AuthModal/index.cjs +1 -10
  11. package/dist/components/Auth/AuthModal/index.cjs.map +1 -1
  12. package/dist/components/Auth/AuthModal/index.d.ts.map +1 -1
  13. package/dist/components/Auth/AuthModal/index.mjs +1 -10
  14. package/dist/components/Auth/AuthModal/index.mjs.map +1 -1
  15. package/dist/components/Auth/ChangePasswordForm/ChangePasswordForm.cjs +4 -16
  16. package/dist/components/Auth/ChangePasswordForm/ChangePasswordForm.cjs.map +1 -1
  17. package/dist/components/Auth/ChangePasswordForm/ChangePasswordForm.d.ts +0 -1
  18. package/dist/components/Auth/ChangePasswordForm/ChangePasswordForm.d.ts.map +1 -1
  19. package/dist/components/Auth/ChangePasswordForm/ChangePasswordForm.mjs +4 -16
  20. package/dist/components/Auth/ChangePasswordForm/ChangePasswordForm.mjs.map +1 -1
  21. package/dist/components/Auth/ChangePasswordForm/changePasswordForm.content.cjs +0 -32
  22. package/dist/components/Auth/ChangePasswordForm/changePasswordForm.content.cjs.map +1 -1
  23. package/dist/components/Auth/ChangePasswordForm/changePasswordForm.content.d.ts +0 -32
  24. package/dist/components/Auth/ChangePasswordForm/changePasswordForm.content.d.ts.map +1 -1
  25. package/dist/components/Auth/ChangePasswordForm/changePasswordForm.content.mjs +0 -32
  26. package/dist/components/Auth/ChangePasswordForm/changePasswordForm.content.mjs.map +1 -1
  27. package/dist/components/Auth/DefineNewPasswordForm/DefineNewPasswordForm.cjs +81 -0
  28. package/dist/components/Auth/DefineNewPasswordForm/DefineNewPasswordForm.cjs.map +1 -0
  29. package/dist/components/Auth/DefineNewPasswordForm/DefineNewPasswordForm.d.ts +9 -0
  30. package/dist/components/Auth/DefineNewPasswordForm/DefineNewPasswordForm.d.ts.map +1 -0
  31. package/dist/components/Auth/DefineNewPasswordForm/DefineNewPasswordForm.mjs +81 -0
  32. package/dist/components/Auth/DefineNewPasswordForm/DefineNewPasswordForm.mjs.map +1 -0
  33. package/dist/components/Auth/DefineNewPasswordForm/defineNewPasswordForm.content.cjs +106 -0
  34. package/dist/components/Auth/DefineNewPasswordForm/defineNewPasswordForm.content.cjs.map +1 -0
  35. package/dist/components/{DictionaryEditor/validDictionaryChangeButtons.content.d.ts → Auth/DefineNewPasswordForm/defineNewPasswordForm.content.d.ts} +15 -41
  36. package/dist/components/Auth/DefineNewPasswordForm/defineNewPasswordForm.content.d.ts.map +1 -0
  37. package/dist/components/Auth/DefineNewPasswordForm/defineNewPasswordForm.content.mjs +106 -0
  38. package/dist/components/Auth/DefineNewPasswordForm/defineNewPasswordForm.content.mjs.map +1 -0
  39. package/dist/components/Auth/DefineNewPasswordForm/index.cjs +7 -0
  40. package/dist/components/Auth/DefineNewPasswordForm/index.cjs.map +1 -0
  41. package/dist/components/Auth/DefineNewPasswordForm/index.d.ts +3 -0
  42. package/dist/components/Auth/DefineNewPasswordForm/index.d.ts.map +1 -0
  43. package/dist/components/Auth/DefineNewPasswordForm/index.mjs +7 -0
  44. package/dist/components/Auth/DefineNewPasswordForm/index.mjs.map +1 -0
  45. package/dist/components/Auth/DefineNewPasswordForm/useDefineNewPasswordSchema.cjs +31 -0
  46. package/dist/components/Auth/DefineNewPasswordForm/useDefineNewPasswordSchema.cjs.map +1 -0
  47. package/dist/components/Auth/DefineNewPasswordForm/useDefineNewPasswordSchema.content.cjs +101 -0
  48. package/dist/components/Auth/DefineNewPasswordForm/useDefineNewPasswordSchema.content.cjs.map +1 -0
  49. package/dist/components/Auth/DefineNewPasswordForm/useDefineNewPasswordSchema.content.d.ts +97 -0
  50. package/dist/components/Auth/DefineNewPasswordForm/useDefineNewPasswordSchema.content.d.ts.map +1 -0
  51. package/dist/components/Auth/DefineNewPasswordForm/useDefineNewPasswordSchema.content.mjs +101 -0
  52. package/dist/components/Auth/DefineNewPasswordForm/useDefineNewPasswordSchema.content.mjs.map +1 -0
  53. package/dist/components/Auth/DefineNewPasswordForm/useDefineNewPasswordSchema.d.ts +19 -0
  54. package/dist/components/Auth/DefineNewPasswordForm/useDefineNewPasswordSchema.d.ts.map +1 -0
  55. package/dist/components/Auth/DefineNewPasswordForm/useDefineNewPasswordSchema.mjs +31 -0
  56. package/dist/components/Auth/DefineNewPasswordForm/useDefineNewPasswordSchema.mjs.map +1 -0
  57. package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.cjs +27 -9
  58. package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.cjs.map +1 -1
  59. package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.d.ts +7 -3
  60. package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.d.ts.map +1 -1
  61. package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.mjs +27 -9
  62. package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.mjs.map +1 -1
  63. package/dist/components/Auth/ResetPasswordForm/ResetPasswordForm.cjs +2 -1
  64. package/dist/components/Auth/ResetPasswordForm/ResetPasswordForm.cjs.map +1 -1
  65. package/dist/components/Auth/ResetPasswordForm/ResetPasswordForm.d.ts.map +1 -1
  66. package/dist/components/Auth/ResetPasswordForm/ResetPasswordForm.mjs +2 -1
  67. package/dist/components/Auth/ResetPasswordForm/ResetPasswordForm.mjs.map +1 -1
  68. package/dist/components/Auth/SignInForm/SignInForm.cjs +2 -2
  69. package/dist/components/Auth/SignInForm/SignInForm.cjs.map +1 -1
  70. package/dist/components/Auth/SignInForm/SignInForm.mjs +2 -2
  71. package/dist/components/Auth/SignInForm/SignInForm.mjs.map +1 -1
  72. package/dist/components/Auth/SignUpForm/SignUpForm.cjs +2 -2
  73. package/dist/components/Auth/SignUpForm/SignUpForm.cjs.map +1 -1
  74. package/dist/components/Auth/SignUpForm/SignUpForm.mjs +2 -2
  75. package/dist/components/Auth/SignUpForm/SignUpForm.mjs.map +1 -1
  76. package/dist/components/Auth/VerifyEmailForm/VerifyEmailForm.cjs +3 -3
  77. package/dist/components/Auth/VerifyEmailForm/VerifyEmailForm.cjs.map +1 -1
  78. package/dist/components/Auth/VerifyEmailForm/VerifyEmailForm.d.ts.map +1 -1
  79. package/dist/components/Auth/VerifyEmailForm/VerifyEmailForm.mjs +3 -3
  80. package/dist/components/Auth/VerifyEmailForm/VerifyEmailForm.mjs.map +1 -1
  81. package/dist/components/Auth/index.cjs +4 -0
  82. package/dist/components/Auth/index.cjs.map +1 -1
  83. package/dist/components/Auth/index.d.ts +1 -0
  84. package/dist/components/Auth/index.d.ts.map +1 -1
  85. package/dist/components/Auth/index.mjs +4 -0
  86. package/dist/components/Auth/index.mjs.map +1 -1
  87. package/dist/components/Auth/useAuth/index.cjs +1 -0
  88. package/dist/components/Auth/useAuth/index.cjs.map +1 -1
  89. package/dist/components/Auth/useAuth/index.d.ts +1 -0
  90. package/dist/components/Auth/useAuth/index.d.ts.map +1 -1
  91. package/dist/components/Auth/useAuth/index.mjs +1 -0
  92. package/dist/components/Auth/useAuth/index.mjs.map +1 -1
  93. package/dist/components/Avatar/index.cjs +2 -2
  94. package/dist/components/Avatar/index.cjs.map +1 -1
  95. package/dist/components/Avatar/index.mjs +2 -2
  96. package/dist/components/Avatar/index.mjs.map +1 -1
  97. package/dist/components/Badge/index.cjs +11 -11
  98. package/dist/components/Badge/index.cjs.map +1 -1
  99. package/dist/components/Badge/index.d.ts +2 -2
  100. package/dist/components/Badge/index.d.ts.map +1 -1
  101. package/dist/components/Badge/index.mjs +11 -11
  102. package/dist/components/Badge/index.mjs.map +1 -1
  103. package/dist/components/Button/Button.cjs +25 -25
  104. package/dist/components/Button/Button.cjs.map +1 -1
  105. package/dist/components/Button/Button.d.ts +3 -3
  106. package/dist/components/Button/Button.d.ts.map +1 -1
  107. package/dist/components/Button/Button.mjs +25 -25
  108. package/dist/components/Button/Button.mjs.map +1 -1
  109. package/dist/components/Command/index.cjs +2 -2
  110. package/dist/components/Command/index.cjs.map +1 -1
  111. package/dist/components/Command/index.d.ts.map +1 -1
  112. package/dist/components/Command/index.mjs +2 -2
  113. package/dist/components/Command/index.mjs.map +1 -1
  114. package/dist/components/Container/index.cjs +67 -82
  115. package/dist/components/Container/index.cjs.map +1 -1
  116. package/dist/components/Container/index.d.ts +5 -6
  117. package/dist/components/Container/index.d.ts.map +1 -1
  118. package/dist/components/Container/index.mjs +67 -82
  119. package/dist/components/Container/index.mjs.map +1 -1
  120. package/dist/components/ContentEditor/ContentEditor.cjs +1 -1
  121. package/dist/components/ContentEditor/ContentEditor.cjs.map +1 -1
  122. package/dist/components/ContentEditor/ContentEditor.mjs +1 -1
  123. package/dist/components/ContentEditor/ContentEditor.mjs.map +1 -1
  124. package/dist/components/ContentEditor/ContentEditorTextArea.cjs +2 -2
  125. package/dist/components/ContentEditor/ContentEditorTextArea.cjs.map +1 -1
  126. package/dist/components/ContentEditor/ContentEditorTextArea.d.ts.map +1 -1
  127. package/dist/components/ContentEditor/ContentEditorTextArea.mjs +2 -2
  128. package/dist/components/ContentEditor/ContentEditorTextArea.mjs.map +1 -1
  129. package/dist/components/DictionaryEditor/DictionaryEditor.cjs +1 -1
  130. package/dist/components/DictionaryEditor/DictionaryEditor.mjs +1 -1
  131. package/dist/components/DictionaryEditor/ItemLayout.cjs +3 -3
  132. package/dist/components/DictionaryEditor/ItemLayout.cjs.map +1 -1
  133. package/dist/components/DictionaryEditor/ItemLayout.mjs +3 -3
  134. package/dist/components/DictionaryEditor/ItemLayout.mjs.map +1 -1
  135. package/dist/components/DictionaryEditor/NodeWrapper/ArrayWrapper.cjs +1 -1
  136. package/dist/components/DictionaryEditor/NodeWrapper/ArrayWrapper.mjs +1 -1
  137. package/dist/components/DictionaryEditor/NodeWrapper/ConditionWrapper.cjs +1 -1
  138. package/dist/components/DictionaryEditor/NodeWrapper/ConditionWrapper.mjs +1 -1
  139. package/dist/components/DictionaryEditor/NodeWrapper/EnumerationWrapper.cjs +1 -1
  140. package/dist/components/DictionaryEditor/NodeWrapper/EnumerationWrapper.mjs +1 -1
  141. package/dist/components/DictionaryEditor/NodeWrapper/MarkdownWrapper.cjs +1 -1
  142. package/dist/components/DictionaryEditor/NodeWrapper/MarkdownWrapper.mjs +1 -1
  143. package/dist/components/DictionaryEditor/NodeWrapper/NestedObjectWrapper.cjs +1 -1
  144. package/dist/components/DictionaryEditor/NodeWrapper/NestedObjectWrapper.mjs +1 -1
  145. package/dist/components/DictionaryEditor/NodeWrapper/StringWrapper.cjs +2 -2
  146. package/dist/components/DictionaryEditor/NodeWrapper/StringWrapper.cjs.map +1 -1
  147. package/dist/components/DictionaryEditor/NodeWrapper/StringWrapper.mjs +2 -2
  148. package/dist/components/DictionaryEditor/NodeWrapper/StringWrapper.mjs.map +1 -1
  149. package/dist/components/DictionaryEditor/NodeWrapper/TranslationWrapper.cjs +1 -1
  150. package/dist/components/DictionaryEditor/NodeWrapper/TranslationWrapper.mjs +1 -1
  151. package/dist/components/DictionaryEditor/NodeWrapper/index.cjs +1 -1
  152. package/dist/components/DictionaryEditor/NodeWrapper/index.d.ts.map +1 -1
  153. package/dist/components/DictionaryEditor/NodeWrapper/index.mjs +1 -1
  154. package/dist/components/DictionaryFieldEditor/ContentEditor.cjs +2 -1
  155. package/dist/components/DictionaryFieldEditor/ContentEditor.cjs.map +1 -1
  156. package/dist/components/DictionaryFieldEditor/ContentEditor.d.ts.map +1 -1
  157. package/dist/components/DictionaryFieldEditor/ContentEditor.mjs +2 -1
  158. package/dist/components/DictionaryFieldEditor/ContentEditor.mjs.map +1 -1
  159. package/dist/components/DictionaryFieldEditor/ContentEditorView/TextEditor.cjs +5 -2
  160. package/dist/components/DictionaryFieldEditor/ContentEditorView/TextEditor.cjs.map +1 -1
  161. package/dist/components/DictionaryFieldEditor/ContentEditorView/TextEditor.d.ts.map +1 -1
  162. package/dist/components/DictionaryFieldEditor/ContentEditorView/TextEditor.mjs +5 -2
  163. package/dist/components/DictionaryFieldEditor/ContentEditorView/TextEditor.mjs.map +1 -1
  164. package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.cjs +13 -9
  165. package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.cjs.map +1 -1
  166. package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.d.ts.map +1 -1
  167. package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.mjs +13 -9
  168. package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.mjs.map +1 -1
  169. package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.cjs +6 -18
  170. package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.cjs.map +1 -1
  171. package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.d.ts +0 -1
  172. package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.d.ts.map +1 -1
  173. package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.mjs +8 -20
  174. package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.mjs.map +1 -1
  175. package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.cjs +2 -2
  176. package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.cjs.map +1 -1
  177. package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.mjs +2 -2
  178. package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.mjs.map +1 -1
  179. package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.cjs +37 -18
  180. package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.cjs.map +1 -1
  181. package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.d.ts.map +1 -1
  182. package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.mjs +39 -20
  183. package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.mjs.map +1 -1
  184. package/dist/components/DictionaryFieldEditor/StructureView/StructureView.cjs +8 -2
  185. package/dist/components/DictionaryFieldEditor/StructureView/StructureView.cjs.map +1 -1
  186. package/dist/components/DictionaryFieldEditor/StructureView/StructureView.mjs +8 -2
  187. package/dist/components/DictionaryFieldEditor/StructureView/StructureView.mjs.map +1 -1
  188. package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.cjs +3 -3
  189. package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.cjs.map +1 -1
  190. package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.mjs +3 -3
  191. package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.mjs.map +1 -1
  192. package/dist/components/EditableField/EditableFieldTextArea.cjs +7 -0
  193. package/dist/components/EditableField/EditableFieldTextArea.cjs.map +1 -1
  194. package/dist/components/EditableField/EditableFieldTextArea.mjs +7 -0
  195. package/dist/components/EditableField/EditableFieldTextArea.mjs.map +1 -1
  196. package/dist/components/Footer/index.cjs +1 -1
  197. package/dist/components/Footer/index.cjs.map +1 -1
  198. package/dist/components/Footer/index.mjs +1 -1
  199. package/dist/components/Footer/index.mjs.map +1 -1
  200. package/dist/components/Form/Form.cjs +1 -1
  201. package/dist/components/Form/Form.mjs +1 -1
  202. package/dist/components/Form/FormDescription.cjs +1 -8
  203. package/dist/components/Form/FormDescription.cjs.map +1 -1
  204. package/dist/components/Form/FormDescription.d.ts.map +1 -1
  205. package/dist/components/Form/FormDescription.mjs +1 -8
  206. package/dist/components/Form/FormDescription.mjs.map +1 -1
  207. package/dist/components/Form/FormItem.cjs +1 -1
  208. package/dist/components/Form/FormItem.cjs.map +1 -1
  209. package/dist/components/Form/FormItem.mjs +1 -1
  210. package/dist/components/Form/FormItem.mjs.map +1 -1
  211. package/dist/components/Form/FormLabel.cjs +1 -5
  212. package/dist/components/Form/FormLabel.cjs.map +1 -1
  213. package/dist/components/Form/FormLabel.d.ts.map +1 -1
  214. package/dist/components/Form/FormLabel.mjs +1 -5
  215. package/dist/components/Form/FormLabel.mjs.map +1 -1
  216. package/dist/components/Form/FormMessage.cjs +1 -1
  217. package/dist/components/Form/FormMessage.cjs.map +1 -1
  218. package/dist/components/Form/FormMessage.mjs +1 -1
  219. package/dist/components/Form/FormMessage.mjs.map +1 -1
  220. package/dist/components/Form/elements/AutoSizeTextAreaElement.cjs +1 -1
  221. package/dist/components/Form/elements/AutoSizeTextAreaElement.mjs +1 -1
  222. package/dist/components/Form/elements/CheckboxElement.cjs +1 -1
  223. package/dist/components/Form/elements/CheckboxElement.mjs +1 -1
  224. package/dist/components/Form/elements/EditableFieldInputElement.cjs +1 -1
  225. package/dist/components/Form/elements/EditableFieldInputElement.mjs +1 -1
  226. package/dist/components/Form/elements/EditableFieldTextAreaElement.cjs +1 -1
  227. package/dist/components/Form/elements/EditableFieldTextAreaElement.mjs +1 -1
  228. package/dist/components/Form/elements/FormElement.cjs +1 -1
  229. package/dist/components/Form/elements/FormElement.mjs +1 -1
  230. package/dist/components/Form/elements/InputElement.cjs +1 -1
  231. package/dist/components/Form/elements/InputElement.mjs +1 -1
  232. package/dist/components/Form/elements/InputPasswordElement.cjs +1 -1
  233. package/dist/components/Form/elements/InputPasswordElement.mjs +1 -1
  234. package/dist/components/Form/elements/MultiselectElement.cjs +1 -1
  235. package/dist/components/Form/elements/MultiselectElement.mjs +1 -1
  236. package/dist/components/Form/elements/SelectElement.cjs +1 -1
  237. package/dist/components/Form/elements/SelectElement.mjs +1 -1
  238. package/dist/components/Form/elements/SwitchSelectorElement.cjs +1 -1
  239. package/dist/components/Form/elements/SwitchSelectorElement.mjs +1 -1
  240. package/dist/components/Form/elements/TextAreaElement.cjs +1 -1
  241. package/dist/components/Form/elements/TextAreaElement.mjs +1 -1
  242. package/dist/components/Form/elements/index.cjs +1 -1
  243. package/dist/components/Form/elements/index.mjs +1 -1
  244. package/dist/components/Form/index.cjs +1 -1
  245. package/dist/components/Form/index.mjs +1 -1
  246. package/dist/components/Form/layout/FormItemLayout.cjs +1 -1
  247. package/dist/components/Form/layout/FormItemLayout.mjs +1 -1
  248. package/dist/components/Form/layout/index.cjs +1 -1
  249. package/dist/components/Form/layout/index.mjs +1 -1
  250. package/dist/components/Headers/index.cjs +1 -1
  251. package/dist/components/Headers/index.cjs.map +1 -1
  252. package/dist/components/Headers/index.mjs +1 -1
  253. package/dist/components/Headers/index.mjs.map +1 -1
  254. package/dist/components/IDE/Code.cjs +1 -1
  255. package/dist/components/IDE/Code.cjs.map +1 -1
  256. package/dist/components/IDE/Code.mjs +1 -1
  257. package/dist/components/IDE/Code.mjs.map +1 -1
  258. package/dist/components/IDE/CodeBlockClient.cjs +8 -1
  259. package/dist/components/IDE/CodeBlockClient.cjs.map +1 -1
  260. package/dist/components/IDE/CodeBlockClient.d.ts.map +1 -1
  261. package/dist/components/IDE/CodeBlockClient.mjs +8 -1
  262. package/dist/components/IDE/CodeBlockClient.mjs.map +1 -1
  263. package/dist/components/IDE/CodeBlockServer.cjs +8 -1
  264. package/dist/components/IDE/CodeBlockServer.cjs.map +1 -1
  265. package/dist/components/IDE/CodeBlockServer.d.ts.map +1 -1
  266. package/dist/components/IDE/CodeBlockServer.mjs +8 -1
  267. package/dist/components/IDE/CodeBlockServer.mjs.map +1 -1
  268. package/dist/components/IDE/FileList.cjs +1 -1
  269. package/dist/components/IDE/FileList.cjs.map +1 -1
  270. package/dist/components/IDE/FileList.mjs +1 -1
  271. package/dist/components/IDE/FileList.mjs.map +1 -1
  272. package/dist/components/IDE/FileTree.cjs +1 -1
  273. package/dist/components/IDE/FileTree.cjs.map +1 -1
  274. package/dist/components/IDE/FileTree.mjs +1 -1
  275. package/dist/components/IDE/FileTree.mjs.map +1 -1
  276. package/dist/components/IDE/IDE.cjs +7 -3
  277. package/dist/components/IDE/IDE.cjs.map +1 -1
  278. package/dist/components/IDE/IDE.d.ts +1 -0
  279. package/dist/components/IDE/IDE.d.ts.map +1 -1
  280. package/dist/components/IDE/IDE.mjs +8 -4
  281. package/dist/components/IDE/IDE.mjs.map +1 -1
  282. package/dist/components/Input/Checkbox.cjs +10 -10
  283. package/dist/components/Input/Checkbox.cjs.map +1 -1
  284. package/dist/components/Input/Checkbox.d.ts +1 -1
  285. package/dist/components/Input/Checkbox.mjs +10 -10
  286. package/dist/components/Input/Checkbox.mjs.map +1 -1
  287. package/dist/components/Input/Input.cjs +7 -7
  288. package/dist/components/Input/Input.cjs.map +1 -1
  289. package/dist/components/Input/Input.d.ts.map +1 -1
  290. package/dist/components/Input/Input.mjs +7 -7
  291. package/dist/components/Input/Input.mjs.map +1 -1
  292. package/dist/components/Input/InputPassword.cjs +1 -1
  293. package/dist/components/Input/InputPassword.cjs.map +1 -1
  294. package/dist/components/Input/InputPassword.mjs +1 -1
  295. package/dist/components/Input/InputPassword.mjs.map +1 -1
  296. package/dist/components/Link/Link.cjs +26 -20
  297. package/dist/components/Link/Link.cjs.map +1 -1
  298. package/dist/components/Link/Link.d.ts +1 -1
  299. package/dist/components/Link/Link.d.ts.map +1 -1
  300. package/dist/components/Link/Link.mjs +26 -20
  301. package/dist/components/Link/Link.mjs.map +1 -1
  302. package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.cjs +4 -4
  303. package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.cjs.map +1 -1
  304. package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.mjs +4 -4
  305. package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.mjs.map +1 -1
  306. package/dist/components/LocaleSwitcherDropDown/LocaleSwitcher.cjs +4 -4
  307. package/dist/components/LocaleSwitcherDropDown/LocaleSwitcher.cjs.map +1 -1
  308. package/dist/components/LocaleSwitcherDropDown/LocaleSwitcher.mjs +4 -4
  309. package/dist/components/LocaleSwitcherDropDown/LocaleSwitcher.mjs.map +1 -1
  310. package/dist/components/MarkDownRender/index.cjs +115 -114
  311. package/dist/components/MarkDownRender/index.cjs.map +1 -1
  312. package/dist/components/MarkDownRender/index.d.ts +1 -1
  313. package/dist/components/MarkDownRender/index.d.ts.map +1 -1
  314. package/dist/components/MarkDownRender/index.mjs +115 -114
  315. package/dist/components/MarkDownRender/index.mjs.map +1 -1
  316. package/dist/components/MaxHeightSmoother/index.cjs +1 -1
  317. package/dist/components/MaxHeightSmoother/index.cjs.map +1 -1
  318. package/dist/components/MaxHeightSmoother/index.mjs +1 -1
  319. package/dist/components/MaxHeightSmoother/index.mjs.map +1 -1
  320. package/dist/components/Modal/Modal.cjs +2 -2
  321. package/dist/components/Modal/Modal.cjs.map +1 -1
  322. package/dist/components/Modal/Modal.mjs +2 -2
  323. package/dist/components/Modal/Modal.mjs.map +1 -1
  324. package/dist/components/Navbar/Burger.cjs +1 -1
  325. package/dist/components/Navbar/Burger.cjs.map +1 -1
  326. package/dist/components/Navbar/Burger.mjs +1 -1
  327. package/dist/components/Navbar/Burger.mjs.map +1 -1
  328. package/dist/components/Navbar/DesktopNavbar.cjs +2 -2
  329. package/dist/components/Navbar/DesktopNavbar.cjs.map +1 -1
  330. package/dist/components/Navbar/DesktopNavbar.mjs +2 -2
  331. package/dist/components/Navbar/DesktopNavbar.mjs.map +1 -1
  332. package/dist/components/Navbar/MobileNavbar.cjs +2 -2
  333. package/dist/components/Navbar/MobileNavbar.cjs.map +1 -1
  334. package/dist/components/Navbar/MobileNavbar.mjs +2 -2
  335. package/dist/components/Navbar/MobileNavbar.mjs.map +1 -1
  336. package/dist/components/Pattern/DotPattern.cjs +1 -1
  337. package/dist/components/Pattern/DotPattern.cjs.map +1 -1
  338. package/dist/components/Pattern/DotPattern.mjs +1 -1
  339. package/dist/components/Pattern/DotPattern.mjs.map +1 -1
  340. package/dist/components/Pattern/GridPattern.cjs +1 -1
  341. package/dist/components/Pattern/GridPattern.cjs.map +1 -1
  342. package/dist/components/Pattern/GridPattern.mjs +1 -1
  343. package/dist/components/Pattern/GridPattern.mjs.map +1 -1
  344. package/dist/components/Popover/index.cjs +1 -1
  345. package/dist/components/Popover/index.cjs.map +1 -1
  346. package/dist/components/Popover/index.mjs +1 -1
  347. package/dist/components/Popover/index.mjs.map +1 -1
  348. package/dist/components/RightDrawer/RightDrawer.cjs +1 -1
  349. package/dist/components/RightDrawer/RightDrawer.cjs.map +1 -1
  350. package/dist/components/RightDrawer/RightDrawer.d.ts.map +1 -1
  351. package/dist/components/RightDrawer/RightDrawer.mjs +1 -1
  352. package/dist/components/RightDrawer/RightDrawer.mjs.map +1 -1
  353. package/dist/components/Select/Multiselect.cjs +8 -8
  354. package/dist/components/Select/Multiselect.cjs.map +1 -1
  355. package/dist/components/Select/Multiselect.d.ts.map +1 -1
  356. package/dist/components/Select/Multiselect.mjs +8 -8
  357. package/dist/components/Select/Multiselect.mjs.map +1 -1
  358. package/dist/components/Select/Select.cjs +7 -7
  359. package/dist/components/Select/Select.cjs.map +1 -1
  360. package/dist/components/Select/Select.d.ts.map +1 -1
  361. package/dist/components/Select/Select.mjs +7 -7
  362. package/dist/components/Select/Select.mjs.map +1 -1
  363. package/dist/components/SwitchSelector/index.cjs +11 -11
  364. package/dist/components/SwitchSelector/index.cjs.map +1 -1
  365. package/dist/components/SwitchSelector/index.d.ts +1 -1
  366. package/dist/components/SwitchSelector/index.d.ts.map +1 -1
  367. package/dist/components/SwitchSelector/index.mjs +11 -11
  368. package/dist/components/SwitchSelector/index.mjs.map +1 -1
  369. package/dist/components/TabSelector/TabSelector.cjs +15 -13
  370. package/dist/components/TabSelector/TabSelector.cjs.map +1 -1
  371. package/dist/components/TabSelector/TabSelector.d.ts +1 -1
  372. package/dist/components/TabSelector/TabSelector.d.ts.map +1 -1
  373. package/dist/components/TabSelector/TabSelector.mjs +15 -13
  374. package/dist/components/TabSelector/TabSelector.mjs.map +1 -1
  375. package/dist/components/Tag/index.cjs +6 -7
  376. package/dist/components/Tag/index.cjs.map +1 -1
  377. package/dist/components/Tag/index.d.ts +2 -2
  378. package/dist/components/Tag/index.d.ts.map +1 -1
  379. package/dist/components/Tag/index.mjs +6 -7
  380. package/dist/components/Tag/index.mjs.map +1 -1
  381. package/dist/components/TextArea/AutoSizeTextArea.cjs +1 -0
  382. package/dist/components/TextArea/AutoSizeTextArea.cjs.map +1 -1
  383. package/dist/components/TextArea/AutoSizeTextArea.d.ts.map +1 -1
  384. package/dist/components/TextArea/AutoSizeTextArea.mjs +1 -0
  385. package/dist/components/TextArea/AutoSizeTextArea.mjs.map +1 -1
  386. package/dist/components/TextArea/AutocompleteTextArea.cjs +105 -0
  387. package/dist/components/TextArea/AutocompleteTextArea.cjs.map +1 -0
  388. package/dist/components/TextArea/AutocompleteTextArea.d.ts +9 -0
  389. package/dist/components/TextArea/AutocompleteTextArea.d.ts.map +1 -0
  390. package/dist/components/TextArea/AutocompleteTextArea.mjs +105 -0
  391. package/dist/components/TextArea/AutocompleteTextArea.mjs.map +1 -0
  392. package/dist/components/TextArea/index.cjs +3 -0
  393. package/dist/components/TextArea/index.cjs.map +1 -1
  394. package/dist/components/TextArea/index.d.ts +1 -0
  395. package/dist/components/TextArea/index.d.ts.map +1 -1
  396. package/dist/components/TextArea/index.mjs +4 -1
  397. package/dist/components/TextArea/index.mjs.map +1 -1
  398. package/dist/components/ThemeSwitcherDropDown/DesktopThemeSwitcher.cjs +1 -1
  399. package/dist/components/ThemeSwitcherDropDown/DesktopThemeSwitcher.cjs.map +1 -1
  400. package/dist/components/ThemeSwitcherDropDown/DesktopThemeSwitcher.mjs +1 -1
  401. package/dist/components/ThemeSwitcherDropDown/DesktopThemeSwitcher.mjs.map +1 -1
  402. package/dist/components/Toaster/Toast.cjs +5 -5
  403. package/dist/components/Toaster/Toast.cjs.map +1 -1
  404. package/dist/components/Toaster/Toast.d.ts +1 -1
  405. package/dist/components/Toaster/Toast.d.ts.map +1 -1
  406. package/dist/components/Toaster/Toast.mjs +5 -5
  407. package/dist/components/Toaster/Toast.mjs.map +1 -1
  408. package/dist/components/Toaster/Toaster.cjs +1 -1
  409. package/dist/components/Toaster/Toaster.cjs.map +1 -1
  410. package/dist/components/Toaster/Toaster.mjs +1 -1
  411. package/dist/components/Toaster/Toaster.mjs.map +1 -1
  412. package/dist/components/WithResizer/index.cjs +2 -2
  413. package/dist/components/WithResizer/index.cjs.map +1 -1
  414. package/dist/components/WithResizer/index.mjs +2 -2
  415. package/dist/components/WithResizer/index.mjs.map +1 -1
  416. package/dist/components/index.cjs +12 -1
  417. package/dist/components/index.cjs.map +1 -1
  418. package/dist/components/index.d.ts +1 -0
  419. package/dist/components/index.d.ts.map +1 -1
  420. package/dist/components/index.mjs +12 -1
  421. package/dist/components/index.mjs.map +1 -1
  422. package/dist/hooks/index.cjs +3 -0
  423. package/dist/hooks/index.cjs.map +1 -1
  424. package/dist/hooks/index.mjs +4 -1
  425. package/dist/hooks/intlayerAPIHooks.cjs +18 -4
  426. package/dist/hooks/intlayerAPIHooks.cjs.map +1 -1
  427. package/dist/hooks/intlayerAPIHooks.d.ts +5 -2
  428. package/dist/hooks/intlayerAPIHooks.d.ts.map +1 -1
  429. package/dist/hooks/intlayerAPIHooks.mjs +18 -4
  430. package/dist/hooks/intlayerAPIHooks.mjs.map +1 -1
  431. package/dist/hooks/useGetAllDictionaries.d.ts.map +1 -1
  432. package/dist/hooks/useIntlayerAPI.d.ts +5 -2
  433. package/dist/hooks/useIntlayerAPI.d.ts.map +1 -1
  434. package/dist/index-BCuMWKyy.js.map +1 -1
  435. package/dist/index-BYzBot7l.cjs.map +1 -1
  436. package/dist/{index-BUe-qmA0.js → index-C57uA6Lk.js} +2 -2
  437. package/dist/{index-BUe-qmA0.js.map → index-C57uA6Lk.js.map} +1 -1
  438. package/dist/{index-cg9H6eBs.cjs → index-D02c1QrF.cjs} +2 -2
  439. package/dist/{index-cg9H6eBs.cjs.map → index-D02c1QrF.cjs.map} +1 -1
  440. package/dist/{index-B1w5h_6-.js → index-DixKT3Hi.js} +34 -5
  441. package/dist/index-DixKT3Hi.js.map +1 -0
  442. package/dist/{index-U1U6ySIn.cjs → index-a_-DkvMQ.cjs} +34 -5
  443. package/dist/index-a_-DkvMQ.cjs.map +1 -0
  444. package/dist/tailwind.config.cjs +2 -1395
  445. package/dist/tailwind.config.cjs.map +1 -1
  446. package/dist/tailwind.config.d.ts +3 -282
  447. package/dist/tailwind.config.d.ts.map +1 -1
  448. package/dist/tailwind.config.mjs +2 -1395
  449. package/dist/tailwind.config.mjs.map +1 -1
  450. package/dist/tailwind.css +2 -1
  451. package/dist/zod-BV4nCGJE.js.map +1 -1
  452. package/dist/zod-DSrtTSD_.cjs.map +1 -1
  453. package/package.json +28 -25
  454. package/dist/Form-BZUDRfoN.js.map +0 -1
  455. package/dist/Form-yi0CMK-a.cjs.map +0 -1
  456. package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.cjs +0 -133
  457. package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.cjs.map +0 -1
  458. package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.d.ts +0 -9
  459. package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.d.ts.map +0 -1
  460. package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.mjs +0 -133
  461. package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.mjs.map +0 -1
  462. package/dist/components/DictionaryEditor/validDictionaryChangeButtons.content.cjs +0 -132
  463. package/dist/components/DictionaryEditor/validDictionaryChangeButtons.content.cjs.map +0 -1
  464. package/dist/components/DictionaryEditor/validDictionaryChangeButtons.content.d.ts.map +0 -1
  465. package/dist/components/DictionaryEditor/validDictionaryChangeButtons.content.mjs +0 -132
  466. package/dist/components/DictionaryEditor/validDictionaryChangeButtons.content.mjs.map +0 -1
  467. package/dist/components/DictionaryEditor/validDictionaryChangeButtonsSchema.cjs +0 -8
  468. package/dist/components/DictionaryEditor/validDictionaryChangeButtonsSchema.cjs.map +0 -1
  469. package/dist/components/DictionaryEditor/validDictionaryChangeButtonsSchema.d.ts +0 -4
  470. package/dist/components/DictionaryEditor/validDictionaryChangeButtonsSchema.d.ts.map +0 -1
  471. package/dist/components/DictionaryEditor/validDictionaryChangeButtonsSchema.mjs +0 -8
  472. package/dist/components/DictionaryEditor/validDictionaryChangeButtonsSchema.mjs.map +0 -1
  473. package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.cjs +0 -45
  474. package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.cjs.map +0 -1
  475. package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.d.ts +0 -9
  476. package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.d.ts.map +0 -1
  477. package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.mjs +0 -45
  478. package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.mjs.map +0 -1
  479. package/dist/components/DictionaryFieldEditor/DictionariesSelector/dictionariesSelector.content.cjs +0 -40
  480. package/dist/components/DictionaryFieldEditor/DictionariesSelector/dictionariesSelector.content.cjs.map +0 -1
  481. package/dist/components/DictionaryFieldEditor/DictionariesSelector/dictionariesSelector.content.d.ts +0 -36
  482. package/dist/components/DictionaryFieldEditor/DictionariesSelector/dictionariesSelector.content.d.ts.map +0 -1
  483. package/dist/components/DictionaryFieldEditor/DictionariesSelector/dictionariesSelector.content.mjs +0 -40
  484. package/dist/components/DictionaryFieldEditor/DictionariesSelector/dictionariesSelector.content.mjs.map +0 -1
  485. package/dist/components/DictionaryFieldEditor/SaveForm/SaveFormSchema.cjs +0 -8
  486. package/dist/components/DictionaryFieldEditor/SaveForm/SaveFormSchema.cjs.map +0 -1
  487. package/dist/components/DictionaryFieldEditor/SaveForm/SaveFormSchema.d.ts +0 -4
  488. package/dist/components/DictionaryFieldEditor/SaveForm/SaveFormSchema.d.ts.map +0 -1
  489. package/dist/components/DictionaryFieldEditor/SaveForm/SaveFormSchema.mjs +0 -8
  490. package/dist/components/DictionaryFieldEditor/SaveForm/SaveFormSchema.mjs.map +0 -1
  491. package/dist/index-B1w5h_6-.js.map +0 -1
  492. package/dist/index-U1U6ySIn.cjs.map +0 -1
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { jsxs, jsx } from "react/jsx-runtime";
3
- import { useConfiguration, useDictionariesRecordActions, useEditedContent } from "@intlayer/editor-react";
4
- import { RotateCcw, ArrowUpFromLine, Save, Download } from "lucide-react";
3
+ import { useDictionariesRecordActions, useEditedContent } from "@intlayer/editor-react";
4
+ import { RotateCcw, Download, ArrowUpFromLine, Save } from "lucide-react";
5
5
  import { useMemo } from "react";
6
6
  import { useDictionary } from "react-intlayer";
7
7
  import "../../../hooks/useScrollBlockage/useScrollBlockageStore.mjs";
@@ -9,10 +9,29 @@ import "../../../hooks/useAsync/useAsyncStateStore.mjs";
9
9
  import { useWriteDictionary, usePushDictionaries } from "../../../hooks/intlayerAPIHooks.mjs";
10
10
  import "deepmerge";
11
11
  import { cn } from "../../../utils/cn.mjs";
12
+ import "../../../index-DixKT3Hi.js";
13
+ import "@intlayer/config/client";
14
+ import "../../Button/Button.mjs";
15
+ import { useAuth } from "../../Auth/useAuth/index.mjs";
16
+ import "../../Auth/ExternalsLoginButtons/externalsLoginButtons.content.mjs";
12
17
  import "@hookform/resolvers";
13
18
  import "react-hook-form";
14
19
  import "../../Form/FormField.mjs";
15
- import { F as Form } from "../../../Form-BZUDRfoN.js";
20
+ import { F as Form } from "../../../Form-MjLzPGze.js";
21
+ import "../../Auth/SignInForm/signIn.content.mjs";
22
+ import "zod";
23
+ import "../../Auth/SignInForm/useSignInSchema.content.mjs";
24
+ import "../../Auth/SignUpForm/signUpForm.content.mjs";
25
+ import "../../Auth/SignUpForm/useSignUpSchema.content.mjs";
26
+ import "../../Auth/ChangePasswordForm/changePasswordForm.content.mjs";
27
+ import "../../Auth/ChangePasswordForm/useChangePasswordSchema.content.mjs";
28
+ import "../../Auth/ResetPasswordForm/resetPasswordContent.content.mjs";
29
+ import "../../Auth/ResetPasswordForm/useResetPasswordSchema.content.mjs";
30
+ import "../../Modal/Modal.mjs";
31
+ import "@intlayer/api";
32
+ import "../../Auth/VerifyEmailForm/index.content.mjs";
33
+ import "../../Auth/DefineNewPasswordForm/defineNewPasswordForm.content.mjs";
34
+ import "../../Auth/DefineNewPasswordForm/useDefineNewPasswordSchema.content.mjs";
16
35
  import { saveDictionaryContent } from "./saveForm.content.mjs";
17
36
  const SaveForm = ({
18
37
  dictionary,
@@ -20,14 +39,13 @@ const SaveForm = ({
20
39
  className,
21
40
  ...props
22
41
  }) => {
23
- const { editor } = useConfiguration();
24
42
  const { setLocaleDictionary } = useDictionariesRecordActions();
25
43
  const { writeDictionary, isLoading: isWriting } = useWriteDictionary();
26
44
  const { pushDictionaries, isLoading: isPushing } = usePushDictionaries();
27
45
  const isLoading = isWriting || isPushing;
28
46
  const { editedContent, restoreEditedContent } = useEditedContent();
29
47
  const { resetButton, saveButton, publishButton, downloadButton } = useDictionary(saveDictionaryContent);
30
- const hasIntlayerAccessKey = Boolean(editor.clientId && editor.clientSecret);
48
+ const { isAuthenticated } = useAuth();
31
49
  const editedDictionary = useMemo(
32
50
  () => editedContent?.[dictionary.key],
33
51
  [editedContent, dictionary.key]
@@ -81,7 +99,21 @@ const SaveForm = ({
81
99
  children: resetButton.text
82
100
  }
83
101
  ),
84
- mode.includes("remote") && hasIntlayerAccessKey && isLocalDictionary && /* @__PURE__ */ jsx(
102
+ mode.includes("local") && /* @__PURE__ */ jsx(
103
+ Form.Button,
104
+ {
105
+ label: downloadButton.label.value,
106
+ disabled: !isEdited || isLoading,
107
+ Icon: Download,
108
+ color: "text",
109
+ variant: isAuthenticated ? "outline" : "default",
110
+ className: "max-md:w-full",
111
+ isLoading: isWriting,
112
+ onClick: handleSaveDictionary,
113
+ children: downloadButton.text
114
+ }
115
+ ),
116
+ mode.includes("remote") && isAuthenticated && isLocalDictionary && /* @__PURE__ */ jsx(
85
117
  Form.Button,
86
118
  {
87
119
  label: publishButton.label.value,
@@ -94,7 +126,7 @@ const SaveForm = ({
94
126
  children: publishButton.text
95
127
  }
96
128
  ),
97
- mode.includes("remote") && hasIntlayerAccessKey && isEdited && /* @__PURE__ */ jsx(
129
+ mode.includes("remote") && isAuthenticated && !isLocalDictionary && isEdited && /* @__PURE__ */ jsx(
98
130
  Form.Button,
99
131
  {
100
132
  label: saveButton.label.value,
@@ -106,19 +138,6 @@ const SaveForm = ({
106
138
  onClick: handlePushDictionary,
107
139
  children: saveButton.text
108
140
  }
109
- ),
110
- mode.includes("local") && /* @__PURE__ */ jsx(
111
- Form.Button,
112
- {
113
- label: downloadButton.label.value,
114
- disabled: !isEdited || isLoading,
115
- Icon: Download,
116
- color: "text",
117
- className: "max-md:w-full",
118
- isLoading: isWriting,
119
- onClick: handleSaveDictionary,
120
- children: downloadButton.text
121
- }
122
141
  )
123
142
  ]
124
143
  }
@@ -1 +1 @@
1
- {"version":3,"file":"SaveForm.mjs","sources":["../../../../src/components/DictionaryFieldEditor/SaveForm/SaveForm.tsx"],"sourcesContent":["'use client';\n\nimport type { Dictionary as DistantDictionary } from '@intlayer/backend';\nimport type { Dictionary } from '@intlayer/core';\nimport {\n useConfiguration,\n useDictionariesRecordActions,\n useEditedContent,\n} from '@intlayer/editor-react';\nimport { ArrowUpFromLine, Download, RotateCcw, Save } from 'lucide-react';\nimport {\n type DetailedHTMLProps,\n type FormHTMLAttributes,\n useMemo,\n type FC,\n} from 'react';\nimport { useDictionary } from 'react-intlayer';\nimport { usePushDictionaries, useWriteDictionary } from '../../../hooks';\nimport { cn } from '../../../utils/cn';\nimport { Form } from '../../Form';\nimport { saveDictionaryContent } from './saveForm.content';\n\ntype DictionaryDetailsProps = {\n dictionary: Dictionary;\n mode: ('local' | 'remote')[];\n} & DetailedHTMLProps<FormHTMLAttributes<HTMLFormElement>, HTMLFormElement>;\n\nexport const SaveForm: FC<DictionaryDetailsProps> = ({\n dictionary,\n mode,\n className,\n ...props\n}) => {\n const { editor } = useConfiguration();\n const { setLocaleDictionary } = useDictionariesRecordActions();\n const { writeDictionary, isLoading: isWriting } = useWriteDictionary();\n const { pushDictionaries, isLoading: isPushing } = usePushDictionaries();\n const isLoading = isWriting || isPushing;\n\n const { editedContent, restoreEditedContent } = useEditedContent();\n const { resetButton, saveButton, publishButton, downloadButton } =\n useDictionary(saveDictionaryContent);\n\n const hasIntlayerAccessKey = Boolean(editor.clientId && editor.clientSecret);\n\n const editedDictionary = useMemo(\n () => editedContent?.[dictionary.key],\n [editedContent, dictionary.key]\n );\n\n const isEdited = useMemo(\n () =>\n editedDictionary &&\n JSON.stringify(editedDictionary) !== JSON.stringify(dictionary),\n [editedDictionary, dictionary, mode]\n );\n\n const isLocalDictionary = useMemo(\n () => typeof (dictionary as DistantDictionary)?._id === 'undefined',\n [dictionary]\n );\n\n const handleSaveDictionary = async () => {\n if (!editedContent?.[dictionary.key]) return;\n\n const updatedDictionary = {\n ...dictionary,\n ...editedContent?.[dictionary.key],\n };\n\n await writeDictionary(updatedDictionary).then(() => {\n setLocaleDictionary(editedContent?.[dictionary.key]);\n restoreEditedContent(dictionary.key);\n });\n };\n\n const handlePushDictionary = async () => {\n if (!editedContent?.[dictionary.key]) return;\n\n const updatedDictionary = {\n ...dictionary,\n ...editedContent?.[dictionary.key],\n };\n\n await pushDictionaries([updatedDictionary]).then(() => {\n setLocaleDictionary(editedContent?.[dictionary.key]);\n restoreEditedContent(dictionary.key);\n });\n };\n\n return (\n <form\n className={cn('flex justify-end gap-2 max-md:flex-col', className)}\n {...props}\n >\n {isEdited && (\n <Form.Button\n label={resetButton.label.value}\n disabled={!isEdited}\n Icon={RotateCcw}\n variant=\"outline\"\n color=\"text\"\n className=\"max-md:w-full\"\n onClick={() => restoreEditedContent(dictionary.key)}\n >\n {resetButton.text}\n </Form.Button>\n )}\n {mode.includes('remote') && hasIntlayerAccessKey && isLocalDictionary && (\n <Form.Button\n label={publishButton.label.value}\n disabled={!isEdited}\n Icon={ArrowUpFromLine}\n color=\"text\"\n className=\"max-md:w-full\"\n isLoading={isPushing}\n onClick={handlePushDictionary}\n >\n {publishButton.text}\n </Form.Button>\n )}\n {mode.includes('remote') && hasIntlayerAccessKey && isEdited && (\n <Form.Button\n label={saveButton.label.value}\n disabled={!isEdited || isLoading}\n Icon={Save}\n color=\"text\"\n className=\"max-md:w-full\"\n isLoading={isPushing}\n onClick={handlePushDictionary}\n >\n {saveButton.text}\n </Form.Button>\n )}\n {mode.includes('local') && (\n <Form.Button\n label={downloadButton.label.value}\n disabled={!isEdited || isLoading}\n Icon={Download}\n color=\"text\"\n className=\"max-md:w-full\"\n isLoading={isWriting}\n onClick={handleSaveDictionary}\n >\n {downloadButton.text}\n </Form.Button>\n )}\n </form>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AA2BO,MAAM,WAAuC,CAAC;AAAA,EACnD;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAM;AACE,QAAA,EAAE,OAAO,IAAI,iBAAiB;AAC9B,QAAA,EAAE,oBAAoB,IAAI,6BAA6B;AAC7D,QAAM,EAAE,iBAAiB,WAAW,UAAA,IAAc,mBAAmB;AACrE,QAAM,EAAE,kBAAkB,WAAW,UAAA,IAAc,oBAAoB;AACvE,QAAM,YAAY,aAAa;AAE/B,QAAM,EAAE,eAAe,qBAAqB,IAAI,iBAAiB;AACjE,QAAM,EAAE,aAAa,YAAY,eAAe,eAAe,IAC7D,cAAc,qBAAqB;AAErC,QAAM,uBAAuB,QAAQ,OAAO,YAAY,OAAO,YAAY;AAE3E,QAAM,mBAAmB;AAAA,IACvB,MAAM,g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AG;AAAA,YAEjD,UAAY,YAAA;AAAA,UAAA;AAAA,QACf;AAAA,QAED,KAAK,SAAS,QAAQ,KAAK,wBAAwB,qBAClD;AAAA,UAAC,KAAK;AAAA,UAAL;AAAA,YACC,OAAO,cAAc,MAAM;AAAA,YAC3B,UAAU,CAAC;AAAA,YACX,MAAM;AAAA,YACN,OAAM;AAAA,YACN,WAAU;AAAA,YACV,WAAW;AAAA,YACX,SAAS;AAAA,YAER,UAAc,cAAA;AAAA,UAAA;AAAA,QACjB;AAAA,QAED,KAAK,SAAS,QAAQ,KAAK,wBAAwB,YAClD;AAAA,UAAC,KAAK;AAAA,UAAL;AAAA,YACC,OAAO,WAAW,MAAM;AAAA,YACxB,UAAU,CAAC,YAAY;AAAA,YACvB,MAAM;AAAA,YACN,OAAM;AAAA,YACN,WAAU;AAAA,YACV,WAAW;AAAA,YACX,SAAS;AAAA,YAER,UAAW,WAAA;AAAA,UAAA;AAAA,QACd;AAAA,QAED,KAAK,SAAS,OAAO,KACpB;AAAA,UAAC,KAAK;AAAA,UAAL;AAAA,YACC,OAAO,eAAe,MAAM;AAAA,YAC5B,UAAU,CAAC,YAAY;AAAA,YACvB,MAAM;AAAA,YACN,OAAM;AAAA,YACN,WAAU;AAAA,YACV,WAAW;AAAA,YACX,SAAS;AAAA,YAER,UAAe,eAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MAClB;AAAA,IAAA;AAAA,EAEJ;AAEJ;"}
1
+ {"version":3,"file":"SaveForm.mjs","sources":["../../../../src/components/DictionaryFieldEditor/SaveForm/SaveForm.tsx"],"sourcesContent":["'use client';\n\nimport type { Dictionary as DistantDictionary } from '@intlayer/backend';\nimport type { Dictionary } from '@intlayer/core';\nimport {\n useDictionariesRecordActions,\n useEditedContent,\n} from '@intlayer/editor-react';\nimport { ArrowUpFromLine, Download, RotateCcw, Save } from 'lucide-react';\nimport {\n type DetailedHTMLProps,\n type FormHTMLAttributes,\n useMemo,\n type FC,\n} from 'react';\nimport { useDictionary } from 'react-intlayer';\nimport { usePushDictionaries, useWriteDictionary } from '../../../hooks';\nimport { cn } from '../../../utils/cn';\nimport { useAuth } from '../../Auth';\nimport { Form } from '../../Form';\nimport { saveDictionaryContent } from './saveForm.content';\n\ntype DictionaryDetailsProps = {\n dictionary: Dictionary;\n mode: ('local' | 'remote')[];\n} & DetailedHTMLProps<FormHTMLAttributes<HTMLFormElement>, HTMLFormElement>;\n\nexport const SaveForm: FC<DictionaryDetailsProps> = ({\n dictionary,\n mode,\n className,\n ...props\n}) => {\n const { setLocaleDictionary } = useDictionariesRecordActions();\n const { writeDictionary, isLoading: isWriting } = useWriteDictionary();\n const { pushDictionaries, isLoading: isPushing } = usePushDictionaries();\n const isLoading = isWriting || isPushing;\n\n const { editedContent, restoreEditedContent } = useEditedContent();\n const { resetButton, saveButton, publishButton, downloadButton } =\n useDictionary(saveDictionaryContent);\n const { isAuthenticated } = useAuth();\n\n const editedDictionary = useMemo(\n () => editedContent?.[dictionary.key],\n [editedContent, dictionary.key]\n );\n\n const isEdited = useMemo(\n () =>\n editedDictionary &&\n JSON.stringify(editedDictionary) !== JSON.stringify(dictionary),\n [editedDictionary, dictionary, mode]\n );\n\n const isLocalDictionary = useMemo(\n () => typeof (dictionary as DistantDictionary)?._id === 'undefined',\n [dictionary]\n );\n\n const handleSaveDictionary = async () => {\n if (!editedContent?.[dictionary.key]) return;\n\n const updatedDictionary = {\n ...dictionary,\n ...editedContent?.[dictionary.key],\n };\n\n await writeDictionary(updatedDictionary).then(() => {\n setLocaleDictionary(editedContent?.[dictionary.key]);\n restoreEditedContent(dictionary.key);\n });\n };\n\n const handlePushDictionary = async () => {\n if (!editedContent?.[dictionary.key]) return;\n\n const updatedDictionary = {\n ...dictionary,\n ...editedContent?.[dictionary.key],\n };\n\n await pushDictionaries([updatedDictionary]).then(() => {\n setLocaleDictionary(editedContent?.[dictionary.key]);\n restoreEditedContent(dictionary.key);\n });\n };\n\n return (\n <form\n className={cn('flex justify-end gap-2 max-md:flex-col', className)}\n {...props}\n >\n {isEdited && (\n <Form.Button\n label={resetButton.label.value}\n disabled={!isEdited}\n Icon={RotateCcw}\n variant=\"outline\"\n color=\"text\"\n className=\"max-md:w-full\"\n onClick={() => restoreEditedContent(dictionary.key)}\n >\n {resetButton.text}\n </Form.Button>\n )}\n {mode.includes('local') && (\n <Form.Button\n label={downloadButton.label.value}\n disabled={!isEdited || isLoading}\n Icon={Download}\n color=\"text\"\n variant={isAuthenticated ? 'outline' : 'default'}\n className=\"max-md:w-full\"\n isLoading={isWriting}\n onClick={handleSaveDictionary}\n >\n {downloadButton.text}\n </Form.Button>\n )}\n {mode.includes('remote') && isAuthenticated && isLocalDictionary && (\n <Form.Button\n label={publishButton.label.value}\n disabled={!isEdited}\n Icon={ArrowUpFromLine}\n color=\"text\"\n className=\"max-md:w-full\"\n isLoading={isPushing}\n onClick={handlePushDictionary}\n >\n {publishButton.text}\n </Form.Button>\n )}\n {mode.includes('remote') &&\n isAuthenticated &&\n !isLocalDictionary &&\n isEdited && (\n <Form.Button\n label={saveButton.label.value}\n disabled={!isEdited || isLoading}\n Icon={Save}\n color=\"text\"\n className=\"max-md:w-full\"\n isLoading={isPushing}\n onClick={handlePushDictionary}\n >\n {saveButton.text}\n </Form.Button>\n )}\n </form>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BO,MAAM,WAAuC,CAAC;AAAA,EACnD;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAM;AACE,QAAA,EAAE,oBAAoB,IAAI,6BAA6B;AAC7D,QAAM,EAAE,iBAAiB,WAAW,UAAA,IAAc,mBAAmB;AACrE,QAAM,EAAE,kBAAkB,WAAW,UAAA,IAAc,oBAAoB;AACvE,QAAM,YAAY,aAAa;AAE/B,QAAM,EAAE,eAAe,qBAAqB,IAAI,iBAAiB;AACjE,QAAM,EAAE,aAAa,YAAY,eAAe,eAAe,IAC7D,cAAc,qBAAqB;AAC/B,QA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AAA,YACR,OAAM;AAAA,YACN,WAAU;AAAA,YACV,SAAS,MAAM,qBAAqB,WAAW,GAAG;AAAA,YAEjD,UAAY,YAAA;AAAA,UAAA;AAAA,QACf;AAAA,QAED,KAAK,SAAS,OAAO,KACpB;AAAA,UAAC,KAAK;AAAA,UAAL;AAAA,YACC,OAAO,eAAe,MAAM;AAAA,YAC5B,UAAU,CAAC,YAAY;AAAA,YACvB,MAAM;AAAA,YACN,OAAM;AAAA,YACN,SAAS,kBAAkB,YAAY;AAAA,YACvC,WAAU;AAAA,YACV,WAAW;AAAA,YACX,SAAS;AAAA,YAER,UAAe,eAAA;AAAA,UAAA;AAAA,QAClB;AAAA,QAED,KAAK,SAAS,QAAQ,KAAK,mBAAmB,qBAC7C;AAAA,UAAC,KAAK;AAAA,UAAL;AAAA,YACC,OAAO,cAAc,MAAM;AAAA,YAC3B,UAAU,CAAC;AAAA,YACX,MAAM;AAAA,YACN,OAAM;AAAA,YACN,WAAU;AAAA,YACV,WAAW;AAAA,YACX,SAAS;AAAA,YAER,UAAc,cAAA;AAAA,UAAA;AAAA,QACjB;AAAA,QAED,KAAK,SAAS,QAAQ,KACrB,mBACA,CAAC,qBACD,YACE;AAAA,UAAC,KAAK;AAAA,UAAL;AAAA,YACC,OAAO,WAAW,MAAM;AAAA,YACxB,UAAU,CAAC,YAAY;AAAA,YACvB,MAAM;AAAA,YACN,OAAM;AAAA,YACN,WAAU;AAAA,YACV,WAAW;AAAA,YACX,SAAS;AAAA,YAER,UAAW,WAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MACd;AAAA,IAAA;AAAA,EAEN;AAEJ;"}
@@ -15,6 +15,12 @@ require("clsx");
15
15
  require("tailwind-merge");
16
16
  require("../../Input/Input.cjs");
17
17
  require("../../Input/Checkbox.cjs");
18
+ require("../../../hooks/useScrollBlockage/useScrollBlockageStore.cjs");
19
+ require("../../../hooks/useAsync/useAsyncStateStore.cjs");
20
+ require("@intlayer/api");
21
+ require("@intlayer/config/client");
22
+ require("../../Toaster/Toast.cjs");
23
+ require("deepmerge");
18
24
  const components_DictionaryFieldEditor_NodeTypeSelector = require("../NodeTypeSelector.cjs");
19
25
  const components_DictionaryFieldEditor_StructureView_structureView_content = require("./structureView.content.cjs");
20
26
  const NodeTypeView = ({
@@ -23,7 +29,7 @@ const NodeTypeView = ({
23
29
  keyPath,
24
30
  onNodeTypeChange: onNodeTypeChangeProp
25
31
  }) => {
26
- const locales = editorReact.useConfiguration().internationalization.locales;
32
+ const locales = editorReact.useConfiguration()?.internationalization.locales ?? [];
27
33
  const nodeType = core.getNodeType(section);
28
34
  const children = core.getNodeChildren(section);
29
35
  const onNodeTypeChange = (content) => {
@@ -176,7 +182,7 @@ const NodeView = ({
176
182
  }
177
183
  )
178
184
  ] }),
179
- /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-neutral dark:text-neutral-dark ml-3 text-sm", children: [
185
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-neutral ml-3 text-sm", children: [
180
186
  "( ",
181
187
  utils_camelCase.camelCaseToSentence(sectionKey),
182
188
  " )"
@@ -1 +1 @@
1
- {"version":3,"file":"StructureView.cjs","sources":["../../../../src/components/DictionaryFieldEditor/StructureView/StructureView.tsx"],"sourcesContent":["'use client';\n\nimport {\n type KeyPath,\n type TypedNode,\n type ContentNode,\n getNodeChildren,\n getNodeType,\n isSameKeyPath,\n NodeType,\n getDefaultNode,\n} from '@intlayer/core';\nimport {\n useConfiguration,\n useEditedContentActions,\n useFocusDictionary,\n useFocusDictionaryActions,\n} from '@intlayer/editor-react';\nimport { Plus, Trash } from 'lucide-react';\nimport { type FC } from 'react';\nimport { useDictionary } from 'react-intlayer';\nimport { camelCaseToSentence } from '../../../utils/camelCase';\nimport { Button } from '../../Button';\nimport { Container } from '../../Container';\nimport { EditableFieldInput } from '../../EditableField';\nimport { NodeTypeSelector } from '../NodeTypeSelector';\nimport { structureViewContent } from './structureView.content';\n\ntype NodeTypeViewProps = {\n dictionaryKey: string;\n keyPath: KeyPath[];\n section: ContentNode;\n onNodeTypeChange: (content?: ContentNode) => void;\n};\n\nconst NodeTypeView: FC<NodeTypeViewProps> = ({\n section,\n dictionaryKey,\n keyPath,\n onNodeTypeChange: onNodeTypeChangeProp,\n}) => {\n const locales = useConfiguration().internationalization.locales;\n const nodeType = getNodeType(section);\n const children = getNodeChildren(section);\n\n const onNodeTypeChange = (content?: ContentNode) => {\n const transformedContent = getDefaultNode(\n nodeType,\n locales,\n content\n ) as ContentNode;\n\n onNodeTypeChangeProp(transformedContent);\n };\n\n if (\n nodeType === NodeType.Translation ||\n nodeType === NodeType.Condition ||\n nodeType === NodeType.Enumeration\n ) {\n const firstKey = Object.keys(\n (section as unknown as TypedNode)[nodeType as keyof typeof section]\n )[0];\n const childrenKeyPath = [\n ...keyPath,\n { type: nodeType, key: firstKey },\n ] as KeyPath[];\n\n return (\n <div className=\"flex w-full flex-col gap-1\">\n <NodeTypeSelector\n section={section}\n onValueChange={(nodeType) =>\n onNodeTypeChangeProp(\n getDefaultNode(nodeType, locales) as ContentNode\n )\n }\n />\n\n <NodeTypeView\n section={children}\n keyPath={childrenKeyPath}\n dictionaryKey={dictionaryKey}\n onNodeTypeChange={onNodeTypeChange}\n />\n </div>\n );\n }\n\n if (nodeType === NodeType.Array) {\n const childrenKeyPath = [...keyPath, { type: nodeType, key: 0 } as KeyPath];\n return (\n <div className=\"flex w-full flex-col gap-1\">\n <NodeTypeSelector\n section={section}\n onValueChange={(nodeType) =>\n onNodeTypeChangeProp(\n getDefaultNode(nodeType, locales) as ContentNode\n )\n }\n />\n\n <NodeTypeView\n section={children}\n keyPath={childrenKeyPath}\n dictionaryKey={dictionaryKey}\n onNodeTypeChange={onNodeTypeChange}\n />\n </div>\n );\n }\n\n if (nodeType === NodeType.Object) {\n return (\n <>\n <NodeTypeSelector\n section={section}\n onValueChange={(nodeType) =>\n onNodeTypeChangeProp(\n getDefaultNode(nodeType, locales) as ContentNode\n )\n }\n />\n <div className=\"ml-10 mt-6\">\n <StructureView\n keyPath={keyPath}\n section={section}\n dictionaryKey={dictionaryKey}\n />\n </div>\n </>\n );\n }\n\n return (\n <NodeTypeSelector\n section={section}\n onValueChange={(nodeType) =>\n onNodeTypeChangeProp(getDefaultNode(nodeType, locales) as ContentNode)\n }\n />\n );\n};\n\ntype NodeWrapperProps = {\n sectionKey?: string;\n dictionaryKey: string;\n keyPath: KeyPath[];\n section: ContentNode;\n};\n\nexport const NodeView: FC<NodeWrapperProps> = ({\n sectionKey,\n section,\n keyPath,\n dictionaryKey,\n}) => {\n const { focusedContent, setFocusedContentKeyPath } = useFocusDictionary();\n const { renameEditedContent, addEditedContent } = useEditedContentActions();\n\n const { titleInput, deleteButton } = useDictionary(structureViewContent);\n\n const handleRenameNodeKey = (keyName: string) => {\n renameEditedContent(dictionaryKey, keyName, 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: keyName } as KeyPath,\n ];\n setFocusedContentKeyPath(newKeyPath);\n };\n\n return (\n <Container\n transparency=\"xl\"\n roundedSize=\"xl\"\n className=\"w-full min-w-80 gap-2 overflow-auto px-5 py-2\"\n border\n borderColor=\"text\"\n background=\"none\"\n aria-selected={isSameKeyPath(keyPath, focusedContent?.keyPath ?? [])}\n onClick={() => setFocusedContentKeyPath(keyPath)}\n >\n <div className=\"flex w-full flex-col items-start justify-between gap-3\">\n {typeof sectionKey === 'string' && (\n <div className=\"w-full\">\n <div className=\"flex w-full items-center justify-between gap-10\">\n <EditableFieldInput\n name=\"key\"\n aria-label=\"Key\"\n placeholder={titleInput.placeholder.value}\n defaultValue={sectionKey}\n onSave={(value) => handleRenameNodeKey(value)}\n variant=\"invisible\"\n />\n <Button\n label={deleteButton.label.value}\n variant=\"hoverable\"\n size=\"icon-sm\"\n color=\"text\"\n className=\"translate-x-2\"\n Icon={Trash}\n onClick={() => {\n addEditedContent(dictionaryKey, undefined, keyPath);\n\n const parentKeyPath: KeyPath[] = keyPath.slice(0, -1);\n setFocusedContentKeyPath(parentKeyPath);\n }}\n />\n </div>\n\n <span className=\"text-neutral dark:text-neutral-dark ml-3 text-sm\">\n ( {camelCaseToSentence(sectionKey)} )\n </span>\n </div>\n )}\n <NodeTypeView\n keyPath={keyPath}\n dictionaryKey={dictionaryKey}\n section={section}\n onNodeTypeChange={(content) => {\n addEditedContent(dictionaryKey, content, keyPath);\n }}\n />\n </div>\n </Container>\n );\n};\n\ntype ObjectViewProps = {\n dictionaryKey: string;\n keyPath: KeyPath[];\n section: ContentNode;\n};\n\nexport const ObjectView: FC<ObjectViewProps> = ({\n section,\n keyPath,\n dictionaryKey,\n}) => {\n const { addNodeButton } = useDictionary(structureViewContent);\n const { setFocusedContentKeyPath } = useFocusDictionaryActions();\n const { addEditedContent } = useEditedContentActions();\n\n if (!section || typeof section !== 'object') {\n return <div>Not an object</div>;\n }\n\n return (\n <div className=\"flex flex-col gap-2 overflow-y-scroll\">\n <ul className=\"mr-auto flex flex-col gap-4\">\n {Object.keys(section).map((key) => (\n <li key={key} className=\"flex w-full\">\n <NodeView\n sectionKey={key}\n section={section?.[key as keyof typeof section]}\n keyPath={[...keyPath, { type: NodeType.Object, key }]}\n dictionaryKey={dictionaryKey}\n />\n </li>\n ))}\n </ul>\n <Button\n label={addNodeButton.label.value}\n variant=\"hoverable\"\n size=\"md\"\n color=\"text\"\n Icon={Plus}\n className=\"flex-1\"\n onClick={() => {\n const newKey = 'newKey';\n const newKeyPath = [\n ...keyPath,\n { type: NodeType.Object, key: newKey },\n ] as KeyPath[];\n addEditedContent(dictionaryKey, '', newKeyPath);\n setFocusedContentKeyPath(newKeyPath);\n }}\n >\n {addNodeButton.text}\n </Button>\n </div>\n );\n};\n\ntype StructureViewProps = {\n dictionaryKey: string;\n keyPath: KeyPath[];\n section: ContentNode;\n};\n\nexport const StructureView: FC<StructureViewProps> = ({\n section,\n keyPath,\n dictionaryKey,\n}) => {\n if (\n !section ||\n typeof section !== 'object' ||\n typeof section.nodeType === 'string'\n ) {\n return (\n <NodeView\n sectionKey={'content'}\n section={section}\n keyPath={keyPath}\n dictionaryKey={dictionaryKey}\n />\n );\n }\n\n return (\n <ObjectView\n section={section}\n keyPath={keyPath}\n dictionaryKey={dictionaryKey}\n />\n );\n};\n"],"names":["useConfiguration","getNodeType","getNodeChildren","getDefaultNode","NodeType","jsxs","jsx","NodeTypeSelector","nodeType","Fragment","useFocusDictionary","useEditedContentActions","useDictionary","structureViewContent","Container","isSameKeyPath","EditableFieldInput","Button","Trash","camelCaseToSentence","useFocusDictionaryActions","Plus"],"mappings":";;;;;;;;;;;;;;;;;;;AAmCA,MAAM,eAAsC,CAAC;AAAA,EAC3C;AAAA,EACA;AAAA,EACA;AAAA,EACA,kBAAkB;AACpB,MAAM;AACE,QAAA,UAAUA,YAAAA,mBAAmB,qBAAqB;AAClD,QAAA,WAAWC,iBAAY,OAAO;AAC9B,QAAA,WAAWC,qBAAgB,OAAO;AAElC,QAAA,mBAAmB,CAAC,YAA0B;AAClD,UAAM,qBAAqBC,KAAA;AAAA,MACzB;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAEA,yBAAqB,kBAAkB;AAAA,EACzC;AAGE,MAAA,aAAaC,cAAS,eACtB,aAAaA,cAAS,aACtB,aAAaA,cAAS,aACtB;AACA,UAAM,WAAW,OAAO;AAAA,MACrB,QAAiC,QAAgC;AAAA,MAClE,CAAC;AACH,UAAM,kBAAkB;AAAA,MACtB,GAAG;AAAA,MACH,EAAE,MAAM,UAAU,KAAK,SAAS;AAAA,IAClC;AAGE,WAAAC,2BAAA,KAAC,OAAI,EAAA,WAAU,8BACb,UAAA;AAAA,MAAAC,2BAAA;AAAA,QAACC,kDAAA;AAAA,QAAA;AAAA,UACC;AAAA,UACA,eAAe,CAACC,cACd;AAAA,YACEL,KAAA,eAAeK,WAAU,OAAO;AAAA,UAAA;AAAA,QAClC;AAAA,M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,2BAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,YAAY;AAAA,QACZ,SAAS,UAAU,GAA2B;AAAA,QAC9C,SAAS,CAAC,GAAG,SAAS,EAAE,MAAMF,cAAS,QAAQ,KAAK;AAAA,QACpD;AAAA,MAAA;AAAA,IAAA,KALK,GAOT,CACD,GACH;AAAA,IACAE,2BAAA;AAAA,MAACW,yBAAA;AAAA,MAAA;AAAA,QACC,OAAO,cAAc,MAAM;AAAA,QAC3B,SAAQ;AAAA,QACR,MAAK;AAAA,QACL,OAAM;AAAA,QACN,MAAMI,YAAA;AAAA,QACN,WAAU;AAAA,QACV,SAAS,MAAM;AACb,gBAAM,SAAS;AACf,gBAAM,aAAa;AAAA,YACjB,GAAG;AAAA,YACH,EAAE,MAAMjB,KAAAA,SAAS,QAAQ,KAAK,OAAO;AAAA,UACvC;AACiB,2BAAA,eAAe,IAAI,UAAU;AAC9C,mCAAyB,UAAU;AAAA,QACrC;AAAA,QAEC,UAAc,cAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EACjB,GACF;AAEJ;AAQO,MAAM,gBAAwC,CAAC;AAAA,EACpD;AAAA,EACA;AAAA,EACA;AACF,MAAM;AAEF,MAAA,CAAC,WACD,OAAO,YAAY,YACnB,OAAO,QAAQ,aAAa,UAC5B;AAEE,WAAAE,2BAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,YAAY;AAAA,QACZ;AAAA,QACA;AAAA,QACA;AAAA,MAAA;AAAA,IACF;AAAA,EAAA;AAKF,SAAAA,2BAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,IAAA;AAAA,EACF;AAEJ;;;;"}
1
+ {"version":3,"file":"StructureView.cjs","sources":["../../../../src/components/DictionaryFieldEditor/StructureView/StructureView.tsx"],"sourcesContent":["'use client';\n\nimport {\n type KeyPath,\n type TypedNode,\n type ContentNode,\n getNodeChildren,\n getNodeType,\n isSameKeyPath,\n NodeType,\n getDefaultNode,\n} from '@intlayer/core';\nimport {\n useConfiguration,\n useEditedContentActions,\n useFocusDictionary,\n useFocusDictionaryActions,\n} from '@intlayer/editor-react';\nimport { Plus, Trash } from 'lucide-react';\nimport { type FC } from 'react';\nimport { useDictionary } from 'react-intlayer';\nimport { camelCaseToSentence } from '../../../utils/camelCase';\nimport { Button } from '../../Button';\nimport { Container } from '../../Container';\nimport { EditableFieldInput } from '../../EditableField';\nimport { NodeTypeSelector } from '../NodeTypeSelector';\nimport { structureViewContent } from './structureView.content';\n\ntype NodeTypeViewProps = {\n dictionaryKey: string;\n keyPath: KeyPath[];\n section: ContentNode;\n onNodeTypeChange: (content?: ContentNode) => void;\n};\n\nconst NodeTypeView: FC<NodeTypeViewProps> = ({\n section,\n dictionaryKey,\n keyPath,\n onNodeTypeChange: onNodeTypeChangeProp,\n}) => {\n const locales = useConfiguration()?.internationalization.locales ?? [];\n const nodeType = getNodeType(section);\n const children = getNodeChildren(section);\n\n const onNodeTypeChange = (content?: ContentNode) => {\n const transformedContent = getDefaultNode(\n nodeType,\n locales,\n content\n ) as ContentNode;\n\n onNodeTypeChangeProp(transformedContent);\n };\n\n if (\n nodeType === NodeType.Translation ||\n nodeType === NodeType.Condition ||\n nodeType === NodeType.Enumeration\n ) {\n const firstKey = Object.keys(\n (section as unknown as TypedNode)[nodeType as keyof typeof section]\n )[0];\n const childrenKeyPath = [\n ...keyPath,\n { type: nodeType, key: firstKey },\n ] as KeyPath[];\n\n return (\n <div className=\"flex w-full flex-col gap-1\">\n <NodeTypeSelector\n section={section}\n onValueChange={(nodeType) =>\n onNodeTypeChangeProp(\n getDefaultNode(nodeType, locales) as ContentNode\n )\n }\n />\n\n <NodeTypeView\n section={children}\n keyPath={childrenKeyPath}\n dictionaryKey={dictionaryKey}\n onNodeTypeChange={onNodeTypeChange}\n />\n </div>\n );\n }\n\n if (nodeType === NodeType.Array) {\n const childrenKeyPath = [...keyPath, { type: nodeType, key: 0 } as KeyPath];\n return (\n <div className=\"flex w-full flex-col gap-1\">\n <NodeTypeSelector\n section={section}\n onValueChange={(nodeType) =>\n onNodeTypeChangeProp(\n getDefaultNode(nodeType, locales) as ContentNode\n )\n }\n />\n\n <NodeTypeView\n section={children}\n keyPath={childrenKeyPath}\n dictionaryKey={dictionaryKey}\n onNodeTypeChange={onNodeTypeChange}\n />\n </div>\n );\n }\n\n if (nodeType === NodeType.Object) {\n return (\n <>\n <NodeTypeSelector\n section={section}\n onValueChange={(nodeType) =>\n onNodeTypeChangeProp(\n getDefaultNode(nodeType, locales) as ContentNode\n )\n }\n />\n <div className=\"ml-10 mt-6\">\n <StructureView\n keyPath={keyPath}\n section={section}\n dictionaryKey={dictionaryKey}\n />\n </div>\n </>\n );\n }\n\n return (\n <NodeTypeSelector\n section={section}\n onValueChange={(nodeType) =>\n onNodeTypeChangeProp(getDefaultNode(nodeType, locales) as ContentNode)\n }\n />\n );\n};\n\ntype NodeWrapperProps = {\n sectionKey?: string;\n dictionaryKey: string;\n keyPath: KeyPath[];\n section: ContentNode;\n};\n\nexport const NodeView: FC<NodeWrapperProps> = ({\n sectionKey,\n section,\n keyPath,\n dictionaryKey,\n}) => {\n const { focusedContent, setFocusedContentKeyPath } = useFocusDictionary();\n const { renameEditedContent, addEditedContent } = useEditedContentActions();\n\n const { titleInput, deleteButton } = useDictionary(structureViewContent);\n\n const handleRenameNodeKey = (keyName: string) => {\n renameEditedContent(dictionaryKey, keyName, 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: keyName } as KeyPath,\n ];\n setFocusedContentKeyPath(newKeyPath);\n };\n\n return (\n <Container\n transparency=\"xl\"\n roundedSize=\"xl\"\n className=\"w-full min-w-80 gap-2 overflow-auto px-5 py-2\"\n border\n borderColor=\"text\"\n background=\"none\"\n aria-selected={isSameKeyPath(keyPath, focusedContent?.keyPath ?? [])}\n onClick={() => setFocusedContentKeyPath(keyPath)}\n >\n <div className=\"flex w-full flex-col items-start justify-between gap-3\">\n {typeof sectionKey === 'string' && (\n <div className=\"w-full\">\n <div className=\"flex w-full items-center justify-between gap-10\">\n <EditableFieldInput\n name=\"key\"\n aria-label=\"Key\"\n placeholder={titleInput.placeholder.value}\n defaultValue={sectionKey}\n onSave={(value) => handleRenameNodeKey(value)}\n variant=\"invisible\"\n />\n <Button\n label={deleteButton.label.value}\n variant=\"hoverable\"\n size=\"icon-sm\"\n color=\"text\"\n className=\"translate-x-2\"\n Icon={Trash}\n onClick={() => {\n addEditedContent(dictionaryKey, undefined, keyPath);\n\n const parentKeyPath: KeyPath[] = keyPath.slice(0, -1);\n setFocusedContentKeyPath(parentKeyPath);\n }}\n />\n </div>\n\n <span className=\"text-neutral ml-3 text-sm\">\n ( {camelCaseToSentence(sectionKey)} )\n </span>\n </div>\n )}\n <NodeTypeView\n keyPath={keyPath}\n dictionaryKey={dictionaryKey}\n section={section}\n onNodeTypeChange={(content) => {\n addEditedContent(dictionaryKey, content, keyPath);\n }}\n />\n </div>\n </Container>\n );\n};\n\ntype ObjectViewProps = {\n dictionaryKey: string;\n keyPath: KeyPath[];\n section: ContentNode;\n};\n\nexport const ObjectView: FC<ObjectViewProps> = ({\n section,\n keyPath,\n dictionaryKey,\n}) => {\n const { addNodeButton } = useDictionary(structureViewContent);\n const { setFocusedContentKeyPath } = useFocusDictionaryActions();\n const { addEditedContent } = useEditedContentActions();\n\n if (!section || typeof section !== 'object') {\n return <div>Not an object</div>;\n }\n\n return (\n <div className=\"flex flex-col gap-2 overflow-y-scroll\">\n <ul className=\"mr-auto flex flex-col gap-4\">\n {Object.keys(section).map((key) => (\n <li key={key} className=\"flex w-full\">\n <NodeView\n sectionKey={key}\n section={section?.[key as keyof typeof section]}\n keyPath={[...keyPath, { type: NodeType.Object, key }]}\n dictionaryKey={dictionaryKey}\n />\n </li>\n ))}\n </ul>\n <Button\n label={addNodeButton.label.value}\n variant=\"hoverable\"\n size=\"md\"\n color=\"text\"\n Icon={Plus}\n className=\"flex-1\"\n onClick={() => {\n const newKey = 'newKey';\n const newKeyPath = [\n ...keyPath,\n { type: NodeType.Object, key: newKey },\n ] as KeyPath[];\n addEditedContent(dictionaryKey, '', newKeyPath);\n setFocusedContentKeyPath(newKeyPath);\n }}\n >\n {addNodeButton.text}\n </Button>\n </div>\n );\n};\n\ntype StructureViewProps = {\n dictionaryKey: string;\n keyPath: KeyPath[];\n section: ContentNode;\n};\n\nexport const StructureView: FC<StructureViewProps> = ({\n section,\n keyPath,\n dictionaryKey,\n}) => {\n if (\n !section ||\n typeof section !== 'object' ||\n typeof section.nodeType === 'string'\n ) {\n return (\n <NodeView\n sectionKey={'content'}\n section={section}\n keyPath={keyPath}\n dictionaryKey={dictionaryKey}\n />\n );\n }\n\n return (\n <ObjectView\n section={section}\n keyPath={keyPath}\n dictionaryKey={dictionaryKey}\n />\n );\n};\n"],"names":["useConfiguration","getNodeType","getNodeChildren","getDefaultNode","NodeType","jsxs","jsx","NodeTypeSelector","nodeType","Fragment","useFocusDictionary","useEditedContentActions","useDictionary","structureViewContent","Container","isSameKeyPath","EditableFieldInput","Button","Trash","camelCaseToSentence","useFocusDictionaryActions","Plus"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAmCA,MAAM,eAAsC,CAAC;AAAA,EAC3C;AAAA,EACA;AAAA,EACA;AAAA,EACA,kBAAkB;AACpB,MAAM;AACJ,QAAM,UAAUA,YAAA,iBAAA,GAAoB,qBAAqB,WAAW,CAAC;AAC/D,QAAA,WAAWC,iBAAY,OAAO;AAC9B,QAAA,WAAWC,qBAAgB,OAAO;AAElC,QAAA,mBAAmB,CAAC,YAA0B;AAClD,UAAM,qBAAqBC,KAAA;AAAA,MACzB;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAEA,yBAAqB,kBAAkB;AAAA,EACzC;AAGE,MAAA,aAAaC,cAAS,eACtB,aAAaA,cAAS,aACtB,aAAaA,cAAS,a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C,YAAY;AAAA,QACZ;AAAA,QACA;AAAA,QACA;AAAA,MAAA;AAAA,IACF;AAAA,EAAA;AAKF,SAAAA,2BAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,IAAA;AAAA,EACF;AAEJ;;;;"}
@@ -13,6 +13,12 @@ import "clsx";
13
13
  import "tailwind-merge";
14
14
  import "../../Input/Input.mjs";
15
15
  import "../../Input/Checkbox.mjs";
16
+ import "../../../hooks/useScrollBlockage/useScrollBlockageStore.mjs";
17
+ import "../../../hooks/useAsync/useAsyncStateStore.mjs";
18
+ import "@intlayer/api";
19
+ import "@intlayer/config/client";
20
+ import "../../Toaster/Toast.mjs";
21
+ import "deepmerge";
16
22
  import { NodeTypeSelector } from "../NodeTypeSelector.mjs";
17
23
  import { structureViewContent } from "./structureView.content.mjs";
18
24
  const NodeTypeView = ({
@@ -21,7 +27,7 @@ const NodeTypeView = ({
21
27
  keyPath,
22
28
  onNodeTypeChange: onNodeTypeChangeProp
23
29
  }) => {
24
- const locales = useConfiguration().internationalization.locales;
30
+ const locales = useConfiguration()?.internationalization.locales ?? [];
25
31
  const nodeType = getNodeType(section);
26
32
  const children = getNodeChildren(section);
27
33
  const onNodeTypeChange = (content) => {
@@ -174,7 +180,7 @@ const NodeView = ({
174
180
  }
175
181
  )
176
182
  ] }),
177
- /* @__PURE__ */ jsxs("span", { className: "text-neutral dark:text-neutral-dark ml-3 text-sm", children: [
183
+ /* @__PURE__ */ jsxs("span", { className: "text-neutral ml-3 text-sm", children: [
178
184
  "( ",
179
185
  camelCaseToSentence(sectionKey),
180
186
  " )"
@@ -1 +1 @@
1
- {"version":3,"file":"StructureView.mjs","sources":["../../../../src/components/DictionaryFieldEditor/StructureView/StructureView.tsx"],"sourcesContent":["'use client';\n\nimport {\n type KeyPath,\n type TypedNode,\n type ContentNode,\n getNodeChildren,\n getNodeType,\n isSameKeyPath,\n NodeType,\n getDefaultNode,\n} from '@intlayer/core';\nimport {\n useConfiguration,\n useEditedContentActions,\n useFocusDictionary,\n useFocusDictionaryActions,\n} from '@intlayer/editor-react';\nimport { Plus, Trash } from 'lucide-react';\nimport { type FC } from 'react';\nimport { useDictionary } from 'react-intlayer';\nimport { camelCaseToSentence } from '../../../utils/camelCase';\nimport { Button } from '../../Button';\nimport { Container } from '../../Container';\nimport { EditableFieldInput } from '../../EditableField';\nimport { NodeTypeSelector } from '../NodeTypeSelector';\nimport { structureViewContent } from './structureView.content';\n\ntype NodeTypeViewProps = {\n dictionaryKey: string;\n keyPath: KeyPath[];\n section: ContentNode;\n onNodeTypeChange: (content?: ContentNode) => void;\n};\n\nconst NodeTypeView: FC<NodeTypeViewProps> = ({\n section,\n dictionaryKey,\n keyPath,\n onNodeTypeChange: onNodeTypeChangeProp,\n}) => {\n const locales = useConfiguration().internationalization.locales;\n const nodeType = getNodeType(section);\n const children = getNodeChildren(section);\n\n const onNodeTypeChange = (content?: ContentNode) => {\n const transformedContent = getDefaultNode(\n nodeType,\n locales,\n content\n ) as ContentNode;\n\n onNodeTypeChangeProp(transformedContent);\n };\n\n if (\n nodeType === NodeType.Translation ||\n nodeType === NodeType.Condition ||\n nodeType === NodeType.Enumeration\n ) {\n const firstKey = Object.keys(\n (section as unknown as TypedNode)[nodeType as keyof typeof section]\n )[0];\n const childrenKeyPath = [\n ...keyPath,\n { type: nodeType, key: firstKey },\n ] as KeyPath[];\n\n return (\n <div className=\"flex w-full flex-col gap-1\">\n <NodeTypeSelector\n section={section}\n onValueChange={(nodeType) =>\n onNodeTypeChangeProp(\n getDefaultNode(nodeType, locales) as ContentNode\n )\n }\n />\n\n <NodeTypeView\n section={children}\n keyPath={childrenKeyPath}\n dictionaryKey={dictionaryKey}\n onNodeTypeChange={onNodeTypeChange}\n />\n </div>\n );\n }\n\n if (nodeType === NodeType.Array) {\n const childrenKeyPath = [...keyPath, { type: nodeType, key: 0 } as KeyPath];\n return (\n <div className=\"flex w-full flex-col gap-1\">\n <NodeTypeSelector\n section={section}\n onValueChange={(nodeType) =>\n onNodeTypeChangeProp(\n getDefaultNode(nodeType, locales) as ContentNode\n )\n }\n />\n\n <NodeTypeView\n section={children}\n keyPath={childrenKeyPath}\n dictionaryKey={dictionaryKey}\n onNodeTypeChange={onNodeTypeChange}\n />\n </div>\n );\n }\n\n if (nodeType === NodeType.Object) {\n return (\n <>\n <NodeTypeSelector\n section={section}\n onValueChange={(nodeType) =>\n onNodeTypeChangeProp(\n getDefaultNode(nodeType, locales) as ContentNode\n )\n }\n />\n <div className=\"ml-10 mt-6\">\n <StructureView\n keyPath={keyPath}\n section={section}\n dictionaryKey={dictionaryKey}\n />\n </div>\n </>\n );\n }\n\n return (\n <NodeTypeSelector\n section={section}\n onValueChange={(nodeType) =>\n onNodeTypeChangeProp(getDefaultNode(nodeType, locales) as ContentNode)\n }\n />\n );\n};\n\ntype NodeWrapperProps = {\n sectionKey?: string;\n dictionaryKey: string;\n keyPath: KeyPath[];\n section: ContentNode;\n};\n\nexport const NodeView: FC<NodeWrapperProps> = ({\n sectionKey,\n section,\n keyPath,\n dictionaryKey,\n}) => {\n const { focusedContent, setFocusedContentKeyPath } = useFocusDictionary();\n const { renameEditedContent, addEditedContent } = useEditedContentActions();\n\n const { titleInput, deleteButton } = useDictionary(structureViewContent);\n\n const handleRenameNodeKey = (keyName: string) => {\n renameEditedContent(dictionaryKey, keyName, 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: keyName } as KeyPath,\n ];\n setFocusedContentKeyPath(newKeyPath);\n };\n\n return (\n <Container\n transparency=\"xl\"\n roundedSize=\"xl\"\n className=\"w-full min-w-80 gap-2 overflow-auto px-5 py-2\"\n border\n borderColor=\"text\"\n background=\"none\"\n aria-selected={isSameKeyPath(keyPath, focusedContent?.keyPath ?? [])}\n onClick={() => setFocusedContentKeyPath(keyPath)}\n >\n <div className=\"flex w-full flex-col items-start justify-between gap-3\">\n {typeof sectionKey === 'string' && (\n <div className=\"w-full\">\n <div className=\"flex w-full items-center justify-between gap-10\">\n <EditableFieldInput\n name=\"key\"\n aria-label=\"Key\"\n placeholder={titleInput.placeholder.value}\n defaultValue={sectionKey}\n onSave={(value) => handleRenameNodeKey(value)}\n variant=\"invisible\"\n />\n <Button\n label={deleteButton.label.value}\n variant=\"hoverable\"\n size=\"icon-sm\"\n color=\"text\"\n className=\"translate-x-2\"\n Icon={Trash}\n onClick={() => {\n addEditedContent(dictionaryKey, undefined, keyPath);\n\n const parentKeyPath: KeyPath[] = keyPath.slice(0, -1);\n setFocusedContentKeyPath(parentKeyPath);\n }}\n />\n </div>\n\n <span className=\"text-neutral dark:text-neutral-dark ml-3 text-sm\">\n ( {camelCaseToSentence(sectionKey)} )\n </span>\n </div>\n )}\n <NodeTypeView\n keyPath={keyPath}\n dictionaryKey={dictionaryKey}\n section={section}\n onNodeTypeChange={(content) => {\n addEditedContent(dictionaryKey, content, keyPath);\n }}\n />\n </div>\n </Container>\n );\n};\n\ntype ObjectViewProps = {\n dictionaryKey: string;\n keyPath: KeyPath[];\n section: ContentNode;\n};\n\nexport const ObjectView: FC<ObjectViewProps> = ({\n section,\n keyPath,\n dictionaryKey,\n}) => {\n const { addNodeButton } = useDictionary(structureViewContent);\n const { setFocusedContentKeyPath } = useFocusDictionaryActions();\n const { addEditedContent } = useEditedContentActions();\n\n if (!section || typeof section !== 'object') {\n return <div>Not an object</div>;\n }\n\n return (\n <div className=\"flex flex-col gap-2 overflow-y-scroll\">\n <ul className=\"mr-auto flex flex-col gap-4\">\n {Object.keys(section).map((key) => (\n <li key={key} className=\"flex w-full\">\n <NodeView\n sectionKey={key}\n section={section?.[key as keyof typeof section]}\n keyPath={[...keyPath, { type: NodeType.Object, key }]}\n dictionaryKey={dictionaryKey}\n />\n </li>\n ))}\n </ul>\n <Button\n label={addNodeButton.label.value}\n variant=\"hoverable\"\n size=\"md\"\n color=\"text\"\n Icon={Plus}\n className=\"flex-1\"\n onClick={() => {\n const newKey = 'newKey';\n const newKeyPath = [\n ...keyPath,\n { type: NodeType.Object, key: newKey },\n ] as KeyPath[];\n addEditedContent(dictionaryKey, '', newKeyPath);\n setFocusedContentKeyPath(newKeyPath);\n }}\n >\n {addNodeButton.text}\n </Button>\n </div>\n );\n};\n\ntype StructureViewProps = {\n dictionaryKey: string;\n keyPath: KeyPath[];\n section: ContentNode;\n};\n\nexport const StructureView: FC<StructureViewProps> = ({\n section,\n keyPath,\n dictionaryKey,\n}) => {\n if (\n !section ||\n typeof section !== 'object' ||\n typeof section.nodeType === 'string'\n ) {\n return (\n <NodeView\n sectionKey={'content'}\n section={section}\n keyPath={keyPath}\n dictionaryKey={dictionaryKey}\n />\n );\n }\n\n return (\n <ObjectView\n section={section}\n keyPath={keyPath}\n dictionaryKey={dictionaryKey}\n />\n );\n};\n"],"names":["nodeType"],"mappings":";;;;;;;;;;;;;;;;;AAmCA,MAAM,eAAsC,CAAC;AAAA,EAC3C;AAAA,EACA;AAAA,EACA;AAAA,EACA,kBAAkB;AACpB,MAAM;AACE,QAAA,UAAU,mBAAmB,qBAAqB;AAClD,QAAA,WAAW,YAAY,OAAO;AAC9B,QAAA,WAAW,gBAAgB,OAAO;AAElC,QAAA,mBAAmB,CAAC,YAA0B;AAClD,UAAM,qBAAqB;AAAA,MACzB;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAEA,yBAAqB,kBAAkB;AAAA,EACzC;AAGE,MAAA,aAAa,SAAS,eACtB,aAAa,SAAS,aACtB,aAAa,SAAS,aACtB;AACA,UAAM,WAAW,OAAO;AAAA,MACrB,QAAiC,QAAgC;AAAA,MAClE,CAAC;AACH,UAAM,kBAAkB;AAAA,MACtB,GAAG;AAAA,MACH,EAAE,MAAM,UAAU,KAAK,SAAS;AAAA,IAClC;AAGE,WAAA,qBAAC,OAAI,EAAA,WAAU,8BACb,UAAA;AAAA,MAAA;AAAA,QAAC;AAAA,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OT,CACD,GACH;AAAA,IACA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,OAAO,cAAc,MAAM;AAAA,QAC3B,SAAQ;AAAA,QACR,MAAK;AAAA,QACL,OAAM;AAAA,QACN,MAAM;AAAA,QACN,WAAU;AAAA,QACV,SAAS,MAAM;AACb,gBAAM,SAAS;AACf,gBAAM,aAAa;AAAA,YACjB,GAAG;AAAA,YACH,EAAE,MAAM,SAAS,QAAQ,KAAK,OAAO;AAAA,UACvC;AACiB,2BAAA,eAAe,IAAI,UAAU;AAC9C,mCAAyB,UAAU;AAAA,QACrC;AAAA,QAEC,UAAc,cAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EACjB,GACF;AAEJ;AAQO,MAAM,gBAAwC,CAAC;AAAA,EACpD;AAAA,EACA;AAAA,EACA;AACF,MAAM;AAEF,MAAA,CAAC,WACD,OAAO,YAAY,YACnB,OAAO,QAAQ,aAAa,UAC5B;AAEE,WAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,YAAY;AAAA,QACZ;AAAA,QACA;AAAA,QACA;AAAA,MAAA;AAAA,IACF;AAAA,EAAA;AAKF,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,IAAA;AAAA,EACF;AAEJ;"}
1
+ {"version":3,"file":"StructureView.mjs","sources":["../../../../src/components/DictionaryFieldEditor/StructureView/StructureView.tsx"],"sourcesContent":["'use client';\n\nimport {\n type KeyPath,\n type TypedNode,\n type ContentNode,\n getNodeChildren,\n getNodeType,\n isSameKeyPath,\n NodeType,\n getDefaultNode,\n} from '@intlayer/core';\nimport {\n useConfiguration,\n useEditedContentActions,\n useFocusDictionary,\n useFocusDictionaryActions,\n} from '@intlayer/editor-react';\nimport { Plus, Trash } from 'lucide-react';\nimport { type FC } from 'react';\nimport { useDictionary } from 'react-intlayer';\nimport { camelCaseToSentence } from '../../../utils/camelCase';\nimport { Button } from '../../Button';\nimport { Container } from '../../Container';\nimport { EditableFieldInput } from '../../EditableField';\nimport { NodeTypeSelector } from '../NodeTypeSelector';\nimport { structureViewContent } from './structureView.content';\n\ntype NodeTypeViewProps = {\n dictionaryKey: string;\n keyPath: KeyPath[];\n section: ContentNode;\n onNodeTypeChange: (content?: ContentNode) => void;\n};\n\nconst NodeTypeView: FC<NodeTypeViewProps> = ({\n section,\n dictionaryKey,\n keyPath,\n onNodeTypeChange: onNodeTypeChangeProp,\n}) => {\n const locales = useConfiguration()?.internationalization.locales ?? [];\n const nodeType = getNodeType(section);\n const children = getNodeChildren(section);\n\n const onNodeTypeChange = (content?: ContentNode) => {\n const transformedContent = getDefaultNode(\n nodeType,\n locales,\n content\n ) as ContentNode;\n\n onNodeTypeChangeProp(transformedContent);\n };\n\n if (\n nodeType === NodeType.Translation ||\n nodeType === NodeType.Condition ||\n nodeType === NodeType.Enumeration\n ) {\n const firstKey = Object.keys(\n (section as unknown as TypedNode)[nodeType as keyof typeof section]\n )[0];\n const childrenKeyPath = [\n ...keyPath,\n { type: nodeType, key: firstKey },\n ] as KeyPath[];\n\n return (\n <div className=\"flex w-full flex-col gap-1\">\n <NodeTypeSelector\n section={section}\n onValueChange={(nodeType) =>\n onNodeTypeChangeProp(\n getDefaultNode(nodeType, locales) as ContentNode\n )\n }\n />\n\n <NodeTypeView\n section={children}\n keyPath={childrenKeyPath}\n dictionaryKey={dictionaryKey}\n onNodeTypeChange={onNodeTypeChange}\n />\n </div>\n );\n }\n\n if (nodeType === NodeType.Array) {\n const childrenKeyPath = [...keyPath, { type: nodeType, key: 0 } as KeyPath];\n return (\n <div className=\"flex w-full flex-col gap-1\">\n <NodeTypeSelector\n section={section}\n onValueChange={(nodeType) =>\n onNodeTypeChangeProp(\n getDefaultNode(nodeType, locales) as ContentNode\n )\n }\n />\n\n <NodeTypeView\n section={children}\n keyPath={childrenKeyPath}\n dictionaryKey={dictionaryKey}\n onNodeTypeChange={onNodeTypeChange}\n />\n </div>\n );\n }\n\n if (nodeType === NodeType.Object) {\n return (\n <>\n <NodeTypeSelector\n section={section}\n onValueChange={(nodeType) =>\n onNodeTypeChangeProp(\n getDefaultNode(nodeType, locales) as ContentNode\n )\n }\n />\n <div className=\"ml-10 mt-6\">\n <StructureView\n keyPath={keyPath}\n section={section}\n dictionaryKey={dictionaryKey}\n />\n </div>\n </>\n );\n }\n\n return (\n <NodeTypeSelector\n section={section}\n onValueChange={(nodeType) =>\n onNodeTypeChangeProp(getDefaultNode(nodeType, locales) as ContentNode)\n }\n />\n );\n};\n\ntype NodeWrapperProps = {\n sectionKey?: string;\n dictionaryKey: string;\n keyPath: KeyPath[];\n section: ContentNode;\n};\n\nexport const NodeView: FC<NodeWrapperProps> = ({\n sectionKey,\n section,\n keyPath,\n dictionaryKey,\n}) => {\n const { focusedContent, setFocusedContentKeyPath } = useFocusDictionary();\n const { renameEditedContent, addEditedContent } = useEditedContentActions();\n\n const { titleInput, deleteButton } = useDictionary(structureViewContent);\n\n const handleRenameNodeKey = (keyName: string) => {\n renameEditedContent(dictionaryKey, keyName, 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: keyName } as KeyPath,\n ];\n setFocusedContentKeyPath(newKeyPath);\n };\n\n return (\n <Container\n transparency=\"xl\"\n roundedSize=\"xl\"\n className=\"w-full min-w-80 gap-2 overflow-auto px-5 py-2\"\n border\n borderColor=\"text\"\n background=\"none\"\n aria-selected={isSameKeyPath(keyPath, focusedContent?.keyPath ?? [])}\n onClick={() => setFocusedContentKeyPath(keyPath)}\n >\n <div className=\"flex w-full flex-col items-start justify-between gap-3\">\n {typeof sectionKey === 'string' && (\n <div className=\"w-full\">\n <div className=\"flex w-full items-center justify-between gap-10\">\n <EditableFieldInput\n name=\"key\"\n aria-label=\"Key\"\n placeholder={titleInput.placeholder.value}\n defaultValue={sectionKey}\n onSave={(value) => handleRenameNodeKey(value)}\n variant=\"invisible\"\n />\n <Button\n label={deleteButton.label.value}\n variant=\"hoverable\"\n size=\"icon-sm\"\n color=\"text\"\n className=\"translate-x-2\"\n Icon={Trash}\n onClick={() => {\n addEditedContent(dictionaryKey, undefined, keyPath);\n\n const parentKeyPath: KeyPath[] = keyPath.slice(0, -1);\n setFocusedContentKeyPath(parentKeyPath);\n }}\n />\n </div>\n\n <span className=\"text-neutral ml-3 text-sm\">\n ( {camelCaseToSentence(sectionKey)} )\n </span>\n </div>\n )}\n <NodeTypeView\n keyPath={keyPath}\n dictionaryKey={dictionaryKey}\n section={section}\n onNodeTypeChange={(content) => {\n addEditedContent(dictionaryKey, content, keyPath);\n }}\n />\n </div>\n </Container>\n );\n};\n\ntype ObjectViewProps = {\n dictionaryKey: string;\n keyPath: KeyPath[];\n section: ContentNode;\n};\n\nexport const ObjectView: FC<ObjectViewProps> = ({\n section,\n keyPath,\n dictionaryKey,\n}) => {\n const { addNodeButton } = useDictionary(structureViewContent);\n const { setFocusedContentKeyPath } = useFocusDictionaryActions();\n const { addEditedContent } = useEditedContentActions();\n\n if (!section || typeof section !== 'object') {\n return <div>Not an object</div>;\n }\n\n return (\n <div className=\"flex flex-col gap-2 overflow-y-scroll\">\n <ul className=\"mr-auto flex flex-col gap-4\">\n {Object.keys(section).map((key) => (\n <li key={key} className=\"flex w-full\">\n <NodeView\n sectionKey={key}\n section={section?.[key as keyof typeof section]}\n keyPath={[...keyPath, { type: NodeType.Object, key }]}\n dictionaryKey={dictionaryKey}\n />\n </li>\n ))}\n </ul>\n <Button\n label={addNodeButton.label.value}\n variant=\"hoverable\"\n size=\"md\"\n color=\"text\"\n Icon={Plus}\n className=\"flex-1\"\n onClick={() => {\n const newKey = 'newKey';\n const newKeyPath = [\n ...keyPath,\n { type: NodeType.Object, key: newKey },\n ] as KeyPath[];\n addEditedContent(dictionaryKey, '', newKeyPath);\n setFocusedContentKeyPath(newKeyPath);\n }}\n >\n {addNodeButton.text}\n </Button>\n </div>\n );\n};\n\ntype StructureViewProps = {\n dictionaryKey: string;\n keyPath: KeyPath[];\n section: ContentNode;\n};\n\nexport const StructureView: FC<StructureViewProps> = ({\n section,\n keyPath,\n dictionaryKey,\n}) => {\n if (\n !section ||\n typeof section !== 'object' ||\n typeof section.nodeType === 'string'\n ) {\n return (\n <NodeView\n sectionKey={'content'}\n section={section}\n keyPath={keyPath}\n dictionaryKey={dictionaryKey}\n />\n );\n }\n\n return (\n <ObjectView\n section={section}\n keyPath={keyPath}\n dictionaryKey={dictionaryKey}\n />\n );\n};\n"],"names":["nodeType"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAmCA,MAAM,eAAsC,CAAC;AAAA,EAC3C;AAAA,EACA;AAAA,EACA;AAAA,EACA,kBAAkB;AACpB,MAAM;AACJ,QAAM,UAAU,iBAAA,GAAoB,qBAAqB,WAAW,CAAC;AAC/D,QAAA,WAAW,YAAY,OAAO;AAC9B,QAAA,WAAW,gBAAgB,OAAO;AAElC,QAAA,mBAAmB,CAAC,YAA0B;AAClD,UAAM,qBAAqB;AAAA,MACzB;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAEA,yBAAqB,kBAAkB;AAAA,EACzC;AAGE,MAAA,aAAa,SAAS,eACtB,aAAa,SAAS,aACtB,aAAa,SAAS,aACtB;AACA,UAAM,WAAW,OAAO;AAAA,MACrB,QAAiC,QAAgC;AAAA,MAClE,CAAC;AACH,UAAM,kBAAkB;AAAA,MACtB,GAAG;AAAA,MACH,EAAE,MAAM,UAAU,KAAK,SAAS;AAAA,IAClC;AAGE,WAAA,qBAAC,OAAI,EAAA,WAAU,8BACb,UAAA;AAAA,MAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC;AAAA,UACA,eAAe,CAACA,cACd;AAAA,YACE,eAAeA,WAAU,OAAO;AAAA,UAAA;AAAA,QAClC;AAAA,MAEJ;AAAA,MAEA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,SAAS;AAAA,UACT,SAAS;AAAA,UACT;AAAA,UAC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AS;AACf,gBAAM,aAAa;AAAA,YACjB,GAAG;AAAA,YACH,EAAE,MAAM,SAAS,QAAQ,KAAK,OAAO;AAAA,UACvC;AACiB,2BAAA,eAAe,IAAI,UAAU;AAC9C,mCAAyB,UAAU;AAAA,QACrC;AAAA,QAEC,UAAc,cAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EACjB,GACF;AAEJ;AAQO,MAAM,gBAAwC,CAAC;AAAA,EACpD;AAAA,EACA;AAAA,EACA;AACF,MAAM;AAEF,MAAA,CAAC,WACD,OAAO,YAAY,YACnB,OAAO,QAAQ,aAAa,UAC5B;AAEE,WAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,YAAY;AAAA,QACZ;AAAA,QACA;AAAA,QACA;AAAA,MAAA;AAAA,IACF;AAAA,EAAA;AAKF,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,IAAA;AAAA,EACF;AAEJ;"}
@@ -21,7 +21,7 @@ const VersionSwitcher = ({ panelProps }) => {
21
21
  return /* @__PURE__ */ jsxRuntime.jsx(
22
22
  "div",
23
23
  {
24
- className: "border-text text-text dark:border-text-dark dark:text-text-dark rounded-xl border transition-colors",
24
+ className: "border-text text-text rounded-xl border transition-colors",
25
25
  "aria-label": versionListLabel.value,
26
26
  children: /* @__PURE__ */ jsxRuntime.jsxs(components_DropDown_index.DropDown, { identifier: DROPDOWN_IDENTIFIER, children: [
27
27
  /* @__PURE__ */ jsxRuntime.jsx(components_DropDown_index.DropDown.Trigger, { identifier: DROPDOWN_IDENTIFIER, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex w-full items-center justify-between", children: [
@@ -47,7 +47,7 @@ const VersionSwitcher = ({ panelProps }) => {
47
47
  roundedSize: "2xl",
48
48
  borderColor: "text",
49
49
  "aria-label": versionSwitcherLabel.value,
50
- children: /* @__PURE__ */ jsxRuntime.jsx("ol", { className: "divide-text/20 dark:divide-text-dark/20 divide-y divide-dashed overflow-y-auto p-1", children: availableVersions.reverse().map((version) => /* @__PURE__ */ jsxRuntime.jsx("li", { className: "px-1.5 py-1", children: /* @__PURE__ */ jsxRuntime.jsx(
50
+ children: /* @__PURE__ */ jsxRuntime.jsx("ol", { className: "divide-text/20 divide-y divide-dashed overflow-y-auto p-1", children: availableVersions.reverse().map((version) => /* @__PURE__ */ jsxRuntime.jsx("li", { className: "px-1.5 py-1", children: /* @__PURE__ */ jsxRuntime.jsx(
51
51
  components_Button_Button.Button,
52
52
  {
53
53
  onClick: () => setSelectedVersion(version),
@@ -58,7 +58,7 @@ const VersionSwitcher = ({ panelProps }) => {
58
58
  isFullWidth: true,
59
59
  textAlign: "left",
60
60
  size: "sm",
61
- children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-neutral dark:text-neutral-dark flex flex-1 flex-row items-center justify-between gap-3 px-2 py-1 text-sm", children: version })
61
+ children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-neutral flex flex-1 flex-row items-center justify-between gap-3 px-2 py-1 text-sm", children: version })
62
62
  }
63
63
  ) }, version)) })
64
64
  }
@@ -1 +1 @@
1
- {"version":3,"file":"VersionSwitcher.cjs","sources":["../../../../src/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.tsx"],"sourcesContent":["'use client';\n\nimport { MoveVertical } from 'lucide-react';\nimport { type FC } from 'react';\nimport { useDictionary } from 'react-intlayer';\nimport { Button } from '../../Button';\nimport { Container } from '../../Container';\nimport { DropDown, type PanelProps } from '../../DropDown';\nimport { useVersionSwitcher } from './VersionSwitcherContext';\nimport versionSwitcherContent from './versionSwitcherDropDown.content';\n\nexport type VersionSwitcherProps = {\n panelProps?: Omit<PanelProps, 'identifier'>;\n};\n\nconst DROPDOWN_IDENTIFIER = 'version-switcher';\n\nexport const VersionSwitcher: FC<VersionSwitcherProps> = ({ panelProps }) => {\n const { switchTo, versionSwitcherLabel, versionListLabel } = useDictionary(\n versionSwitcherContent\n );\n const { selectedVersion, availableVersions, setSelectedVersion } =\n useVersionSwitcher();\n\n if (availableVersions.length === 0) {\n return <></>;\n }\n\n return (\n <div\n className=\"border-text text-text dark:border-text-dark dark:text-text-dark rounded-xl border transition-colors\"\n aria-label={versionListLabel.value}\n >\n <DropDown identifier={DROPDOWN_IDENTIFIER}>\n <DropDown.Trigger identifier={DROPDOWN_IDENTIFIER}>\n <div className=\"flex w-full items-center justify-between\">\n <div className=\"px-2\">{selectedVersion ?? 'LTS'}</div>\n <MoveVertical className=\"w-5 self-center\" />\n </div>\n </DropDown.Trigger>\n\n <DropDown.Panel\n identifier={DROPDOWN_IDENTIFIER}\n isOverable\n isFocusable\n className=\"left-auto right-0\"\n {...panelProps}\n >\n <Container\n className=\"max-h-[80vh] min-w-28\"\n separator=\"y\"\n role=\"listbox\"\n transparency=\"sm\"\n border\n roundedSize=\"2xl\"\n borderColor=\"text\"\n aria-label={versionSwitcherLabel.value}\n >\n <ol className=\"divide-text/20 dark:divide-text-dark/20 divide-y divide-dashed overflow-y-auto p-1\">\n {availableVersions.reverse().map((version) => (\n <li className=\"px-1.5 py-1\" key={version}>\n <Button\n onClick={() => setSelectedVersion(version)}\n label={`${switchTo} v${version}`}\n isActive={selectedVersion === version}\n variant=\"hoverable\"\n color=\"text\"\n isFullWidth\n textAlign=\"left\"\n size=\"sm\"\n >\n <div className=\"text-neutral dark:text-neutral-dark flex flex-1 flex-row items-center justify-between gap-3 px-2 py-1 text-sm\">\n {version}\n </div>\n </Button>\n </li>\n ))}\n </ol>\n </Container>\n </DropDown.Panel>\n </DropDown>\n </div>\n );\n};\n"],"names":["useDictionary","versionSwitcherContent","useVersionSwitcher","jsx","Fragment","jsxs","DropDown","MoveVertical","Container","Button"],"mappings":";;;;;;;;;;;AAeA,MAAM,sBAAsB;AAErB,MAAM,kBAA4C,CAAC,EAAE,iBAAiB;AAC3E,QAAM,EAAE,UAAU,sBAAsB,iBAAqB,IAAAA,cAAA;AAAA,IAC3DC;AAAAA,EACF;AACA,QAAM,EAAE,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,UAAU,oBAAoB;AAAA,oBAC9B,SAAQ;AAAA,oBACR,OAAM;AAAA,oBACN,aAAW;AAAA,oBACX,WAAU;AAAA,oBACV,MAAK;AAAA,oBAEL,UAACN,2BAAA,IAAA,OAAA,EAAI,WAAU,iHACZ,UACH,QAAA,CAAA;AAAA,kBAAA;AAAA,gBAAA,EACF,GAd+B,OAejC,CACD,EACH,CAAA;AAAA,cAAA;AAAA,YAAA;AAAA,UACF;AAAA,QAAA;AAAA,MACF,EACF,CAAA;AAAA,IAAA;AAAA,EACF;AAEJ;;"}
1
+ {"version":3,"file":"VersionSwitcher.cjs","sources":["../../../../src/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.tsx"],"sourcesContent":["'use client';\n\nimport { MoveVertical } from 'lucide-react';\nimport { type FC } from 'react';\nimport { useDictionary } from 'react-intlayer';\nimport { Button } from '../../Button';\nimport { Container } from '../../Container';\nimport { DropDown, type PanelProps } from '../../DropDown';\nimport { useVersionSwitcher } from './VersionSwitcherContext';\nimport versionSwitcherContent from './versionSwitcherDropDown.content';\n\nexport type VersionSwitcherProps = {\n panelProps?: Omit<PanelProps, 'identifier'>;\n};\n\nconst DROPDOWN_IDENTIFIER = 'version-switcher';\n\nexport const VersionSwitcher: FC<VersionSwitcherProps> = ({ panelProps }) => {\n const { switchTo, versionSwitcherLabel, versionListLabel } = useDictionary(\n versionSwitcherContent\n );\n const { selectedVersion, availableVersions, setSelectedVersion } =\n useVersionSwitcher();\n\n if (availableVersions.length === 0) {\n return <></>;\n }\n\n return (\n <div\n className=\"border-text text-text rounded-xl border transition-colors\"\n aria-label={versionListLabel.value}\n >\n <DropDown identifier={DROPDOWN_IDENTIFIER}>\n <DropDown.Trigger identifier={DROPDOWN_IDENTIFIER}>\n <div className=\"flex w-full items-center justify-between\">\n <div className=\"px-2\">{selectedVersion ?? 'LTS'}</div>\n <MoveVertical className=\"w-5 self-center\" />\n </div>\n </DropDown.Trigger>\n\n <DropDown.Panel\n identifier={DROPDOWN_IDENTIFIER}\n isOverable\n isFocusable\n className=\"left-auto right-0\"\n {...panelProps}\n >\n <Container\n className=\"max-h-[80vh] min-w-28\"\n separator=\"y\"\n role=\"listbox\"\n transparency=\"sm\"\n border\n roundedSize=\"2xl\"\n borderColor=\"text\"\n aria-label={versionSwitcherLabel.value}\n >\n <ol className=\"divide-text/20 divide-y divide-dashed overflow-y-auto p-1\">\n {availableVersions.reverse().map((version) => (\n <li className=\"px-1.5 py-1\" key={version}>\n <Button\n onClick={() => setSelectedVersion(version)}\n label={`${switchTo} v${version}`}\n isActive={selectedVersion === version}\n variant=\"hoverable\"\n color=\"text\"\n isFullWidth\n textAlign=\"left\"\n size=\"sm\"\n >\n <div className=\"text-neutral flex flex-1 flex-row items-center justify-between gap-3 px-2 py-1 text-sm\">\n {version}\n </div>\n </Button>\n </li>\n ))}\n </ol>\n </Container>\n </DropDown.Panel>\n </DropDown>\n </div>\n );\n};\n"],"names":["useDictionary","versionSwitcherContent","useVersionSwitcher","jsx","Fragment","jsxs","DropDown","MoveVertical","Container","Button"],"mappings":";;;;;;;;;;;AAeA,MAAM,sBAAsB;AAErB,MAAM,kBAA4C,CAAC,EAAE,iBAAiB;AAC3E,QAAM,EAAE,UAAU,sBAAsB,iBAAqB,IAAAA,cAAA;AAAA,IAC3DC;AAAAA,EACF;AACA,QAAM,EAAE,iBAAiB,mBAAmB,mBAAA,IAC1CC,gFAAAA,mBAAmB;AAEjB,MAAA,kBAAkB,WAAW,GAAG;AAClC,WAASC,2BAAA,IAAAC,WAAA,UAAA,EAAA;AAAA,EAAA;AAIT,SAAAD,2BAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAU;AAAA,MACV,cAAY,iBAAiB;AAAA,MAE7B,UAAAE,2BAAA,KAACC,0BAAS,UAAA,EAAA,YAAY,qBACpB,UAAA;AAAA,QAACH,2BAAAA,IAAAG,0BAAA,SAAS,SAAT,EAAiB,YAAY,qBAC5B,UAACD,2BAAAA,KAAA,OAAA,EA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19
  return /* @__PURE__ */ jsx(
20
20
  "div",
21
21
  {
22
- className: "border-text text-text dark:border-text-dark dark:text-text-dark rounded-xl border transition-colors",
22
+ className: "border-text text-text rounded-xl border transition-colors",
23
23
  "aria-label": versionListLabel.value,
24
24
  children: /* @__PURE__ */ jsxs(DropDown, { identifier: DROPDOWN_IDENTIFIER, children: [
25
25
  /* @__PURE__ */ jsx(DropDown.Trigger, { identifier: DROPDOWN_IDENTIFIER, children: /* @__PURE__ */ jsxs("div", { className: "flex w-full items-center justify-between", children: [
@@ -45,7 +45,7 @@ const VersionSwitcher = ({ panelProps }) => {
45
45
  roundedSize: "2xl",
46
46
  borderColor: "text",
47
47
  "aria-label": versionSwitcherLabel.value,
48
- children: /* @__PURE__ */ jsx("ol", { className: "divide-text/20 dark:divide-text-dark/20 divide-y divide-dashed overflow-y-auto p-1", children: availableVersions.reverse().map((version) => /* @__PURE__ */ jsx("li", { className: "px-1.5 py-1", children: /* @__PURE__ */ jsx(
48
+ children: /* @__PURE__ */ jsx("ol", { className: "divide-text/20 divide-y divide-dashed overflow-y-auto p-1", children: availableVersions.reverse().map((version) => /* @__PURE__ */ jsx("li", { className: "px-1.5 py-1", children: /* @__PURE__ */ jsx(
49
49
  Button,
50
50
  {
51
51
  onClick: () => setSelectedVersion(version),
@@ -56,7 +56,7 @@ const VersionSwitcher = ({ panelProps }) => {
56
56
  isFullWidth: true,
57
57
  textAlign: "left",
58
58
  size: "sm",
59
- children: /* @__PURE__ */ jsx("div", { className: "text-neutral dark:text-neutral-dark flex flex-1 flex-row items-center justify-between gap-3 px-2 py-1 text-sm", children: version })
59
+ children: /* @__PURE__ */ jsx("div", { className: "text-neutral flex flex-1 flex-row items-center justify-between gap-3 px-2 py-1 text-sm", children: version })
60
60
  }
61
61
  ) }, version)) })
62
62
  }
@@ -1 +1 @@
1
- {"version":3,"file":"VersionSwitcher.mjs","sources":["../../../../src/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.tsx"],"sourcesContent":["'use client';\n\nimport { MoveVertical } from 'lucide-react';\nimport { type FC } from 'react';\nimport { useDictionary } from 'react-intlayer';\nimport { Button } from '../../Button';\nimport { Container } from '../../Container';\nimport { DropDown, type PanelProps } from '../../DropDown';\nimport { useVersionSwitcher } from './VersionSwitcherContext';\nimport versionSwitcherContent from './versionSwitcherDropDown.content';\n\nexport type VersionSwitcherProps = {\n panelProps?: Omit<PanelProps, 'identifier'>;\n};\n\nconst DROPDOWN_IDENTIFIER = 'version-switcher';\n\nexport const VersionSwitcher: FC<VersionSwitcherProps> = ({ panelProps }) => {\n const { switchTo, versionSwitcherLabel, versionListLabel } = useDictionary(\n versionSwitcherContent\n );\n const { selectedVersion, availableVersions, setSelectedVersion } =\n useVersionSwitcher();\n\n if (availableVersions.length === 0) {\n return <></>;\n }\n\n return (\n <div\n className=\"border-text text-text dark:border-text-dark dark:text-text-dark rounded-xl border transition-colors\"\n aria-label={versionListLabel.value}\n >\n <DropDown identifier={DROPDOWN_IDENTIFIER}>\n <DropDown.Trigger identifier={DROPDOWN_IDENTIFIER}>\n <div className=\"flex w-full items-center justify-between\">\n <div className=\"px-2\">{selectedVersion ?? 'LTS'}</div>\n <MoveVertical className=\"w-5 self-center\" />\n </div>\n </DropDown.Trigger>\n\n <DropDown.Panel\n identifier={DROPDOWN_IDENTIFIER}\n isOverable\n isFocusable\n className=\"left-auto right-0\"\n {...panelProps}\n >\n <Container\n className=\"max-h-[80vh] min-w-28\"\n separator=\"y\"\n role=\"listbox\"\n transparency=\"sm\"\n border\n roundedSize=\"2xl\"\n borderColor=\"text\"\n aria-label={versionSwitcherLabel.value}\n >\n <ol className=\"divide-text/20 dark:divide-text-dark/20 divide-y divide-dashed overflow-y-auto p-1\">\n {availableVersions.reverse().map((version) => (\n <li className=\"px-1.5 py-1\" key={version}>\n <Button\n onClick={() => setSelectedVersion(version)}\n label={`${switchTo} v${version}`}\n isActive={selectedVersion === version}\n variant=\"hoverable\"\n color=\"text\"\n isFullWidth\n textAlign=\"left\"\n size=\"sm\"\n >\n <div className=\"text-neutral dark:text-neutral-dark flex flex-1 flex-row items-center justify-between gap-3 px-2 py-1 text-sm\">\n {version}\n </div>\n </Button>\n </li>\n ))}\n </ol>\n </Container>\n </DropDown.Panel>\n </DropDown>\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;AAeA,MAAM,sBAAsB;AAErB,MAAM,kBAA4C,CAAC,EAAE,iBAAiB;AAC3E,QAAM,EAAE,UAAU,sBAAsB,iBAAqB,IAAA;AAAA,IAC3D;AAAA,EACF;AACA,QAAM,EAAE,iBAAiB,mBAAmB,mBAAA,IAC1C,mBAAmB;AAEjB,MAAA,kBAAkB,WAAW,GAAG;AAClC,WAAS,oBAAA,UAAA,EAAA;AAAA,EAAA;AAIT,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAU;AAAA,MACV,cAAY,iBAAiB;AAAA,MAE7B,UAAA,qBAAC,UAAS,EAAA,YAAY,qBACpB,UAAA;AAAA,QAAC,oBAAA,SAAS,SAAT,EAAiB,YAAY,qBAC5B,UAAC,qBAAA,OAAA,EAAI,WAAU,4CACb,UAAA;AAAA,UAAA,oBAAC,OAAI,EAAA,WAAU,QAAQ,UAAA,mBAAmB,OAAM;AAAA,UAChD,oBAAC,cAAa,EAAA,WAAU,kBAAkB,CAAA;AAAA,QAAA,EAAA,CAC5C,EACF,CAAA;AAAA,QAEA;AAAA,UAAC,SAAS;AAAA,UAAT;AAAA,YACC,YAAY;AAAA,YACZ,YAAU;AAAA,YACV,aAAW;AAAA,YACX,WAAU;AAAA,YACT,GAAG;AAAA,YAEJ,UAAA;AAAA,cAAC;AAAA,cAAA;AAAA,gBACC,WAAU;AAAA,gBACV,WAAU;AAAA,gBACV,MAAK;AAAA,gBACL,cAAa;AAAA,gBACb,QAAM;AAAA,gBACN,aAAY;AAAA,gBACZ,aAAY;AAAA,gBACZ,cAAY,qBAAqB;AAAA,gBAEjC,UAAC,oBAAA,MAAA,EAAG,WAAU,sFACX,UAAkB,kBAAA,QAAA,EAAU,IAAI,CAAC,YAC/B,oBAAA,MAAA,EAAG,WAAU,eACZ,UAAA;AAAA,kBAAC;AAAA,kBAAA;AAAA,oBACC,SAAS,MAAM,mBAAmB,OAAO;AAAA,oBACzC,OAAO,GAAG,QAAQ,KAAK,OAAO;AAAA,oBAC9B,UAAU,oBAAoB;AAAA,oBAC9B,SAAQ;AAAA,oBACR,OAAM;AAAA,oBACN,aAAW;AAAA,oBACX,WAAU;AAAA,oBACV,MAAK;AAAA,oBAEL,UAAC,oBAAA,OAAA,EAAI,WAAU,iHACZ,UACH,QAAA,CAAA;AAAA,kBAAA;AAAA,gBAAA,EACF,GAd+B,OAejC,CACD,EACH,CAAA;AAAA,cAAA;AAAA,YAAA;AAAA,UACF;AAAA,QAAA;AAAA,MACF,EACF,CAAA;AAAA,IAAA;AAAA,EACF;AAEJ;"}
1
+ {"version":3,"file":"VersionSwitcher.mjs","sources":["../../../../src/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.tsx"],"sourcesContent":["'use client';\n\nimport { MoveVertical } from 'lucide-react';\nimport { type FC } from 'react';\nimport { useDictionary } from 'react-intlayer';\nimport { Button } from '../../Button';\nimport { Container } from '../../Container';\nimport { DropDown, type PanelProps } from '../../DropDown';\nimport { useVersionSwitcher } from './VersionSwitcherContext';\nimport versionSwitcherContent from './versionSwitcherDropDown.content';\n\nexport type VersionSwitcherProps = {\n panelProps?: Omit<PanelProps, 'identifier'>;\n};\n\nconst DROPDOWN_IDENTIFIER = 'version-switcher';\n\nexport const VersionSwitcher: FC<VersionSwitcherProps> = ({ panelProps }) => {\n const { switchTo, versionSwitcherLabel, versionListLabel } = useDictionary(\n versionSwitcherContent\n );\n const { selectedVersion, availableVersions, setSelectedVersion } =\n useVersionSwitcher();\n\n if (availableVersions.length === 0) {\n return <></>;\n }\n\n return (\n <div\n className=\"border-text text-text rounded-xl border transition-colors\"\n aria-label={versionListLabel.value}\n >\n <DropDown identifier={DROPDOWN_IDENTIFIER}>\n <DropDown.Trigger identifier={DROPDOWN_IDENTIFIER}>\n <div className=\"flex w-full items-center justify-between\">\n <div className=\"px-2\">{selectedVersion ?? 'LTS'}</div>\n <MoveVertical className=\"w-5 self-center\" />\n </div>\n </DropDown.Trigger>\n\n <DropDown.Panel\n identifier={DROPDOWN_IDENTIFIER}\n isOverable\n isFocusable\n className=\"left-auto right-0\"\n {...panelProps}\n >\n <Container\n className=\"max-h-[80vh] min-w-28\"\n separator=\"y\"\n role=\"listbox\"\n transparency=\"sm\"\n border\n roundedSize=\"2xl\"\n borderColor=\"text\"\n aria-label={versionSwitcherLabel.value}\n >\n <ol className=\"divide-text/20 divide-y divide-dashed overflow-y-auto p-1\">\n {availableVersions.reverse().map((version) => (\n <li className=\"px-1.5 py-1\" key={version}>\n <Button\n onClick={() => setSelectedVersion(version)}\n label={`${switchTo} v${version}`}\n isActive={selectedVersion === version}\n variant=\"hoverable\"\n color=\"text\"\n isFullWidth\n textAlign=\"left\"\n size=\"sm\"\n >\n <div className=\"text-neutral flex flex-1 flex-row items-center justify-between gap-3 px-2 py-1 text-sm\">\n {version}\n </div>\n </Button>\n </li>\n ))}\n </ol>\n </Container>\n </DropDown.Panel>\n </DropDown>\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;AAeA,MAAM,sBAAsB;AAErB,MAAM,kBAA4C,CAAC,EAAE,iBAAiB;AAC3E,QAAM,EAAE,UAAU,sBAAsB,iBAAqB,IAAA;AAAA,IAC3D;AAAA,EACF;AACA,QAAM,EAAE,iBAAiB,mBAAmB,mBAAA,IAC1C,mBAAmB;AAEjB,MAAA,kBAAkB,WAAW,GAAG;AAClC,WAAS,oBAAA,UAAA,EAAA;AAAA,EAAA;AAIT,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAU;AAAA,MACV,cAAY,iBAAiB;AAAA,MAE7B,UAAA,qBAAC,UAAS,EAAA,YAAY,qBACpB,UAAA;AAAA,QAAC,oBAAA,SAA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Input/Checkbox.cjs");
12
+ require("@intlayer/editor-react");
13
+ require("../../hooks/useScrollBlockage/useScrollBlockageStore.cjs");
14
+ require("../../hooks/useAsync/useAsyncStateStore.cjs");
15
+ require("@intlayer/api");
16
+ require("@intlayer/config/client");
17
+ require("../Toaster/Toast.cjs");
18
+ require("deepmerge");
12
19
  const components_EditableField_EditableFieldLayout = require("./EditableFieldLayout.cjs");
13
20
  const EditableFieldTextArea = ({
14
21
  onSave,
@@ -1 +1 @@
1
- {"version":3,"file":"EditableFieldTextArea.cjs","sources":["../../../src/components/EditableField/EditableFieldTextArea.tsx"],"sourcesContent":["'use client';\n\nimport { useRef, useImperativeHandle, type FC, type Ref } from 'react';\nimport { AutoSizedTextArea, type AutoSizedTextAreaProps } from '../TextArea';\nimport { EditableFieldLayout } from './EditableFieldLayout';\n\ntype EditableFieldTextAreaProps = AutoSizedTextAreaProps & {\n onSave?: (value: string) => void;\n onCancel?: () => void;\n};\n\nexport const EditableFieldTextArea: FC<EditableFieldTextAreaProps> = ({\n onSave,\n onCancel,\n ref,\n ...props\n}) => {\n const textAreaRef = useRef<HTMLTextAreaElement>(null);\n\n // Expose the text area ref to parent components\n useImperativeHandle(ref as Ref<HTMLElement>, () => textAreaRef.current!);\n\n const handleSave = () => {\n // Your save logic here\n onSave?.(textAreaRef.current?.value ?? '');\n };\n\n const handleCancel = () => {\n if (textAreaRef.current) {\n textAreaRef.current.value = textAreaRef.current.defaultValue ?? '';\n }\n onCancel?.();\n };\n\n const memoValue =\n (props.value as string) ??\n textAreaRef.current?.value ??\n (props.defaultValue as string) ??\n '';\n\n return (\n <EditableFieldLayout\n value={memoValue}\n onCancel={handleCancel}\n onSave={handleSave}\n onClick={(e) => {\n e.preventDefault();\n e.stopPropagation();\n }}\n >\n <AutoSizedTextArea\n className=\"leading-6\"\n ref={textAreaRef}\n onClick={(e) => {\n e.preventDefault();\n e.stopPropagation();\n }}\n {...props}\n />\n </EditableFieldLayout>\n );\n};\n"],"names":["useRef","useImperativeHandle","jsx","EditableFieldLayout","AutoSizedTextArea"],"mappings":";;;;;;;;;;;;AAWO,MAAM,wBAAwD,CAAC;AAAA,EACpE;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAM;AACE,QAAA,cAAcA,oBAA4B,IAAI;AAGhCC,eAAAA,oBAAA,KAAyB,MAAM,YAAY,OAAQ;AAEvE,QAAM,aAAa,MAAM;AAEd,aAAA,YAAY,SAAS,SAAS,EAAE;AAAA,EAC3C;AAEA,QAAM,eAAe,MAAM;AACzB,QAAI,YAAY,SAAS;AACvB,kBAAY,QAAQ,QAAQ,YAAY,QAAQ,gBAAgB;AAAA,IAAA;AAEvD,eAAA;AAAA,EACb;AAEA,QAAM,YACH,MAAM,SACP,YAAY,SAAS,SACpB,MAAM,gBACP;AAGA,SAAAC,2BAAA;AAAA,IAACC,6CAAA;AAAA,IAAA;AAAA,MACC,OAAO;AAAA,MACP,UAAU;AAAA,MACV,QAAQ;AAAA,MACR,SAAS,CAAC,MAAM;AACd,UAAE,eAAe;AACjB,UAAE,gBAAgB;AAAA,MACpB;AAAA,MAEA,UAAAD,2BAAA;AAAA,QAACE,qCAAA;AAAA,QAAA;AAAA,UACC,WAAU;AAAA,UACV,KAAK;AAAA,UACL,SAAS,CAAC,MAAM;AACd,cAAE,eAAe;AACjB,cAAE,gBAAgB;AAAA,UACpB;AAAA,UACC,GAAG;AAAA,QAAA;AAAA,MAAA;AAAA,IACN;AAAA,EACF;AAEJ;;"}
1
+ {"version":3,"file":"EditableFieldTextArea.cjs","sources":["../../../src/components/EditableField/EditableFieldTextArea.tsx"],"sourcesContent":["'use client';\n\nimport { useRef, useImperativeHandle, type FC, type Ref } from 'react';\nimport { AutoSizedTextArea, type AutoSizedTextAreaProps } from '../TextArea';\nimport { EditableFieldLayout } from './EditableFieldLayout';\n\ntype EditableFieldTextAreaProps = AutoSizedTextAreaProps & {\n onSave?: (value: string) => void;\n onCancel?: () => void;\n};\n\nexport const EditableFieldTextArea: FC<EditableFieldTextAreaProps> = ({\n onSave,\n onCancel,\n ref,\n ...props\n}) => {\n const textAreaRef = useRef<HTMLTextAreaElement>(null);\n\n // Expose the text area ref to parent components\n useImperativeHandle(ref as Ref<HTMLElement>, () => textAreaRef.current!);\n\n const handleSave = () => {\n // Your save logic here\n onSave?.(textAreaRef.current?.value ?? '');\n };\n\n const handleCancel = () => {\n if (textAreaRef.current) {\n textAreaRef.current.value = textAreaRef.current.defaultValue ?? '';\n }\n onCancel?.();\n };\n\n const memoValue =\n (props.value as string) ??\n textAreaRef.current?.value ??\n (props.defaultValue as string) ??\n '';\n\n return (\n <EditableFieldLayout\n value={memoValue}\n onCancel={handleCancel}\n onSave={handleSave}\n onClick={(e) => {\n e.preventDefault();\n e.stopPropagation();\n }}\n >\n <AutoSizedTextArea\n className=\"leading-6\"\n ref={textAreaRef}\n onClick={(e) => {\n e.preventDefault();\n e.stopPropagation();\n }}\n {...props}\n />\n </EditableFieldLayout>\n );\n};\n"],"names":["useRef","useImperativeHandle","jsx","EditableFieldLayout","AutoSizedTextArea"],"mappings":";;;;;;;;;;;;;;;;;;;AAWO,MAAM,wBAAwD,CAAC;AAAA,EACpE;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAM;AACE,QAAA,cAAcA,oBAA4B,IAAI;AAGhCC,eAAAA,oBAAA,KAAyB,MAAM,YAAY,OAAQ;AAEvE,QAAM,aAAa,MAAM;AAEd,aAAA,YAAY,SAAS,SAAS,EAAE;AAAA,EAC3C;AAEA,QAAM,eAAe,MAAM;AACzB,QAAI,YAAY,SAAS;AACvB,kBAAY,QAAQ,QAAQ,YAAY,QAAQ,gBAAgB;AAAA,IAAA;AAEvD,eAAA;AAAA,EACb;AAEA,QAAM,YACH,MAAM,SACP,YAAY,SAAS,SACpB,MAAM,gBACP;AAGA,SAAAC,2BAAA;AAAA,IAACC,6CAAA;AAAA,IAAA;AAAA,MACC,OAAO;AAAA,MACP,UAAU;AAAA,MACV,QAAQ;AAAA,MACR,SAAS,CAAC,MAAM;AACd,UAAE,eAAe;AACjB,UAAE,gBAAgB;AAAA,MACpB;AAAA,MAEA,UAAAD,2BAAA;AAAA,QAACE,qCAAA;AAAA,QAAA;AAAA,UACC,WAAU;AAAA,UACV,KAAK;AAAA,UACL,SAAS,CAAC,MAAM;AACd,cAAE,eAAe;AACjB,cAAE,gBAAgB;AAAA,UACpB;AAAA,UACC,GAAG;AAAA,QAAA;AAAA,MAAA;AAAA,IACN;AAAA,EACF;AAEJ;;"}
@@ -7,6 +7,13 @@ import "tailwind-merge";
7
7
  import "../Input/Input.mjs";
8
8
  import "lucide-react";
9
9
  import "../Input/Checkbox.mjs";
10
+ import "@intlayer/editor-react";
11
+ import "../../hooks/useScrollBlockage/useScrollBlockageStore.mjs";
12
+ import "../../hooks/useAsync/useAsyncStateStore.mjs";
13
+ import "@intlayer/api";
14
+ import "@intlayer/config/client";
15
+ import "../Toaster/Toast.mjs";
16
+ import "deepmerge";
10
17
  import { EditableFieldLayout } from "./EditableFieldLayout.mjs";
11
18
  const EditableFieldTextArea = ({
12
19
  onSave,
@@ -1 +1 @@
1
- {"version":3,"file":"EditableFieldTextArea.mjs","sources":["../../../src/components/EditableField/EditableFieldTextArea.tsx"],"sourcesContent":["'use client';\n\nimport { useRef, useImperativeHandle, type FC, type Ref } from 'react';\nimport { AutoSizedTextArea, type AutoSizedTextAreaProps } from '../TextArea';\nimport { EditableFieldLayout } from './EditableFieldLayout';\n\ntype EditableFieldTextAreaProps = AutoSizedTextAreaProps & {\n onSave?: (value: string) => void;\n onCancel?: () => void;\n};\n\nexport const EditableFieldTextArea: FC<EditableFieldTextAreaProps> = ({\n onSave,\n onCancel,\n ref,\n ...props\n}) => {\n const textAreaRef = useRef<HTMLTextAreaElement>(null);\n\n // Expose the text area ref to parent components\n useImperativeHandle(ref as Ref<HTMLElement>, () => textAreaRef.current!);\n\n const handleSave = () => {\n // Your save logic here\n onSave?.(textAreaRef.current?.value ?? '');\n };\n\n const handleCancel = () => {\n if (textAreaRef.current) {\n textAreaRef.current.value = textAreaRef.current.defaultValue ?? '';\n }\n onCancel?.();\n };\n\n const memoValue =\n (props.value as string) ??\n textAreaRef.current?.value ??\n (props.defaultValue as string) ??\n '';\n\n return (\n <EditableFieldLayout\n value={memoValue}\n onCancel={handleCancel}\n onSave={handleSave}\n onClick={(e) => {\n e.preventDefault();\n e.stopPropagation();\n }}\n >\n <AutoSizedTextArea\n className=\"leading-6\"\n ref={textAreaRef}\n onClick={(e) => {\n e.preventDefault();\n e.stopPropagation();\n }}\n {...props}\n />\n </EditableFieldLayout>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;AAWO,MAAM,wBAAwD,CAAC;AAAA,EACpE;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAM;AACE,QAAA,cAAc,OAA4B,IAAI;AAGhC,sBAAA,KAAyB,MAAM,YAAY,OAAQ;AAEvE,QAAM,aAAa,MAAM;AAEd,aAAA,YAAY,SAAS,SAAS,EAAE;AAAA,EAC3C;AAEA,QAAM,eAAe,MAAM;AACzB,QAAI,YAAY,SAAS;AACvB,kBAAY,QAAQ,QAAQ,YAAY,QAAQ,gBAAgB;AAAA,IAAA;AAEvD,eAAA;AAAA,EACb;AAEA,QAAM,YACH,MAAM,SACP,YAAY,SAAS,SACpB,MAAM,gBACP;AAGA,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,OAAO;AAAA,MACP,UAAU;AAAA,MACV,QAAQ;AAAA,MACR,SAAS,CAAC,MAAM;AACd,UAAE,eAAe;AACjB,UAAE,gBAAgB;AAAA,MACpB;AAAA,MAEA,UAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,WAAU;AAAA,UACV,KAAK;AAAA,UACL,SAAS,CAAC,MAAM;AACd,cAAE,eAAe;AACjB,cAAE,gBAAgB;AAAA,UACpB;AAAA,UACC,GAAG;AAAA,QAAA;AAAA,MAAA;AAAA,IACN;AAAA,EACF;AAEJ;"}
1
+ {"version":3,"file":"EditableFieldTextArea.mjs","sources":["../../../src/components/EditableField/EditableFieldTextArea.tsx"],"sourcesContent":["'use client';\n\nimport { useRef, useImperativeHandle, type FC, type Ref } from 'react';\nimport { AutoSizedTextArea, type AutoSizedTextAreaProps } from '../TextArea';\nimport { EditableFieldLayout } from './EditableFieldLayout';\n\ntype EditableFieldTextAreaProps = AutoSizedTextAreaProps & {\n onSave?: (value: string) => void;\n onCancel?: () => void;\n};\n\nexport const EditableFieldTextArea: FC<EditableFieldTextAreaProps> = ({\n onSave,\n onCancel,\n ref,\n ...props\n}) => {\n const textAreaRef = useRef<HTMLTextAreaElement>(null);\n\n // Expose the text area ref to parent components\n useImperativeHandle(ref as Ref<HTMLElement>, () => textAreaRef.current!);\n\n const handleSave = () => {\n // Your save logic here\n onSave?.(textAreaRef.current?.value ?? '');\n };\n\n const handleCancel = () => {\n if (textAreaRef.current) {\n textAreaRef.current.value = textAreaRef.current.defaultValue ?? '';\n }\n onCancel?.();\n };\n\n const memoValue =\n (props.value as string) ??\n textAreaRef.current?.value ??\n (props.defaultValue as string) ??\n '';\n\n return (\n <EditableFieldLayout\n value={memoValue}\n onCancel={handleCancel}\n onSave={handleSave}\n onClick={(e) => {\n e.preventDefault();\n e.stopPropagation();\n }}\n >\n <AutoSizedTextArea\n className=\"leading-6\"\n ref={textAreaRef}\n onClick={(e) => {\n e.preventDefault();\n e.stopPropagation();\n }}\n {...props}\n />\n </EditableFieldLayout>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAWO,MAAM,wBAAwD,CAAC;AAAA,EACpE;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAM;AACE,QAAA,cAAc,OAA4B,IAAI;AAGhC,sBAAA,KAAyB,MAAM,YAAY,OAAQ;AAEvE,QAAM,aAAa,MAAM;AAEd,aAAA,YAAY,SAAS,SAAS,EAAE;AAAA,EAC3C;AAEA,QAAM,eAAe,MAAM;AACzB,QAAI,YAAY,SAAS;AACvB,kBAAY,QAAQ,QAAQ,YAAY,QAAQ,gBAAgB;AAAA,IAAA;AAEvD,eAAA;AAAA,EACb;AAEA,QAAM,YACH,MAAM,SACP,YAAY,SAAS,SACpB,MAAM,gBACP;AAGA,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,OAAO;AAAA,MACP,UAAU;AAAA,MACV,QAAQ;AAAA,MACR,SAAS,CAAC,MAAM;AACd,UAAE,eAAe;AACjB,UAAE,gBAAgB;AAAA,MACpB;AAAA,MAEA,UAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,WAAU;AAAA,UACV,KAAK;AAAA,UACL,SAAS,CAAC,MAAM;AACd,cAAE,eAAe;AACjB,cAAE,gBAAgB;AAAA,UACpB;AAAA,UACC,GAAG;AAAA,QAAA;AAAA,MAAA;AAAA,IACN;AAAA,EACF;AAEJ;"}
@@ -5,7 +5,7 @@ const components_Logo_index = require("../Logo/index.cjs");
5
5
  const Footer = ({ links }) => /* @__PURE__ */ jsxRuntime.jsxs("footer", { className: "flex flex-auto flex-row flex-wrap items-center justify-around gap-10 p-6", children: [
6
6
  /* @__PURE__ */ jsxRuntime.jsxs("aside", { className: "flex flex-col items-center justify-between md:w-1/4", children: [
7
7
  /* @__PURE__ */ jsxRuntime.jsx(components_Logo_index.Logo, { type: "logoWithTextBelow", width: 80, height: 80 }),
8
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-neutral dark:text-neutral-dark text-center text-xs", children: "© 2024 Intlayer, Inc." })
8
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-neutral text-center text-xs", children: "© 2024 Intlayer, Inc." })
9
9
  ] }),
10
10
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "m-auto flex w-full flex-row flex-wrap justify-around gap-x-3 gap-y-6 md:w-2/3", children: (links ?? []).map(({ title, links: links2 }) => /* @__PURE__ */ jsxRuntime.jsxs(
11
11
  "div",
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../../../src/components/Footer/index.tsx"],"sourcesContent":["import type { FC, ReactNode } from 'react';\nimport { Logo } from '../Logo';\n\nexport type FooterLink = {\n href: string;\n text: ReactNode;\n onClick?: () => void;\n label: string;\n};\n\nexport type LinkGroup = { title: ReactNode; links: FooterLink[] };\n\ntype FooterProps = { links?: LinkGroup[] };\n\nexport const Footer: FC<FooterProps> = ({ links }) => (\n <footer className=\"flex flex-auto flex-row flex-wrap items-center justify-around gap-10 p-6\">\n <aside className=\"flex flex-col items-center justify-between md:w-1/4\">\n <Logo type=\"logoWithTextBelow\" width={80} height={80} />\n <span className=\"text-neutral dark:text-neutral-dark text-center text-xs\">\n © 2024 Intlayer, Inc.\n </span>\n </aside>\n <div className=\"m-auto flex w-full flex-row flex-wrap justify-around gap-x-3 gap-y-6 md:w-2/3\">\n {(links ?? []).map(({ title, links }) => (\n <div\n className=\"flex flex-col gap-2\"\n key={links.map((link) => link.href).join(',')}\n >\n <strong>{title}</strong>\n <div className=\"flex flex-col gap-3 text-sm\">\n {links.map((link) => (\n <a key={link.href} href={link.href} aria-label={link.label}>\n {link.text}\n </a>\n ))}\n </div>\n </div>\n ))}\n </div>\n </footer>\n);\n"],"names":["jsxs","jsx","Logo","links"],"mappings":";;;;AAca,MAAA,SAA0B,CAAC,EAAE,YACvCA,2BAAAA,KAAA,UAAA,EAAO,WAAU,4EAChB,UAAA;AAAA,EAACA,2BAAAA,KAAA,SAAA,EAAM,WAAU,uDACf,UAAA;AAAA,IAAAC,+BAACC,sBAAAA,QAAK,MAAK,qBAAoB,OAAO,IAAI,QAAQ,IAAI;AAAA,IACrDD,2BAAA,IAAA,QAAA,EAAK,WAAU,2DAA0D,UAE1E,wBAAA,CAAA;AAAA,EAAA,GACF;AAAA,EACCA,2BAAAA,IAAA,OAAA,EAAI,WAAU,iFACX,WAAS,SAAA,CAAA,GAAI,IAAI,CAAC,EAAE,OAAO,OAAAE,OAC3B,MAAAH,2BAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAU;AAAA,MAGV,UAAA;AAAA,QAAAC,2BAAAA,IAAC,YAAQ,UAAM,MAAA,CAAA;AAAA,QACfA,2BAAAA,IAAC,SAAI,WAAU,+BACZ,UAAAE,OAAM,IAAI,CAAC,SACTF,2BAAAA,IAAA,KAAA,EAAkB,MAAM,KAAK,MAAM,cAAY,KAAK,OAClD,eAAK,KADA,GAAA,KAAK,IAEb,CACD,EACH,CAAA;AAAA,MAAA;AAAA,IAAA;AAAA,IATKE,OAAM,IAAI,CAAC,SAAS,KAAK,IAAI,EAAE,KAAK,GAAG;AAAA,EAAA,CAW/C,EACH,CAAA;AAAA,EACF,CAAA;;"}
1
+ {"version":3,"file":"index.cjs","sources":["../../../src/components/Footer/index.tsx"],"sourcesContent":["import type { FC, ReactNode } from 'react';\nimport { Logo } from '../Logo';\n\nexport type FooterLink = {\n href: string;\n text: ReactNode;\n onClick?: () => void;\n label: string;\n};\n\nexport type LinkGroup = { title: ReactNode; links: FooterLink[] };\n\ntype FooterProps = { links?: LinkGroup[] };\n\nexport const Footer: FC<FooterProps> = ({ links }) => (\n <footer className=\"flex flex-auto flex-row flex-wrap items-center justify-around gap-10 p-6\">\n <aside className=\"flex flex-col items-center justify-between md:w-1/4\">\n <Logo type=\"logoWithTextBelow\" width={80} height={80} />\n <span className=\"text-neutral text-center text-xs\">\n © 2024 Intlayer, Inc.\n </span>\n </aside>\n <div className=\"m-auto flex w-full flex-row flex-wrap justify-around gap-x-3 gap-y-6 md:w-2/3\">\n {(links ?? []).map(({ title, links }) => (\n <div\n className=\"flex flex-col gap-2\"\n key={links.map((link) => link.href).join(',')}\n >\n <strong>{title}</strong>\n <div className=\"flex flex-col gap-3 text-sm\">\n {links.map((link) => (\n <a key={link.href} href={link.href} aria-label={link.label}>\n {link.text}\n </a>\n ))}\n </div>\n </div>\n ))}\n </div>\n </footer>\n);\n"],"names":["jsxs","jsx","Logo","links"],"mappings":";;;;AAca,MAAA,SAA0B,CAAC,EAAE,YACvCA,2BAAAA,KAAA,UAAA,EAAO,WAAU,4EAChB,UAAA;AAAA,EAACA,2BAAAA,KAAA,SAAA,EAAM,WAAU,uDACf,UAAA;AAAA,IAAAC,+BAACC,sBAAAA,QAAK,MAAK,qBAAoB,OAAO,IAAI,QAAQ,IAAI;AAAA,IACrDD,2BAAA,IAAA,QAAA,EAAK,WAAU,oCAAmC,UAEnD,wBAAA,CAAA;AAAA,EAAA,GACF;AAAA,EACCA,2BAAAA,IAAA,OAAA,EAAI,WAAU,iFACX,WAAS,SAAA,CAAA,GAAI,IAAI,CAAC,EAAE,OAAO,OAAAE,OAC3B,MAAAH,2BAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAU;AAAA,MAGV,UAAA;AAAA,QAAAC,2BAAAA,IAAC,YAAQ,UAAM,MAAA,CAAA;AAAA,QACfA,2BAAAA,IAAC,SAAI,WAAU,+BACZ,UAAAE,OAAM,IAAI,CAAC,SACTF,2BAAAA,IAAA,KAAA,EAAkB,MAAM,KAAK,MAAM,cAAY,KAAK,OAClD,eAAK,KADA,GAAA,KAAK,IAEb,CACD,EACH,CAAA;AAAA,MAAA;AAAA,IAAA;AAAA,IATKE,OAAM,IAAI,CAAC,SAAS,KAAK,IAAI,EAAE,KAAK,GAAG;AAAA,EAAA,CAW/C,EACH,CAAA;AAAA,EACF,CAAA;;"}
@@ -3,7 +3,7 @@ import { Logo } from "../Logo/index.mjs";
3
3
  const Footer = ({ links }) => /* @__PURE__ */ jsxs("footer", { className: "flex flex-auto flex-row flex-wrap items-center justify-around gap-10 p-6", children: [
4
4
  /* @__PURE__ */ jsxs("aside", { className: "flex flex-col items-center justify-between md:w-1/4", children: [
5
5
  /* @__PURE__ */ jsx(Logo, { type: "logoWithTextBelow", width: 80, height: 80 }),
6
- /* @__PURE__ */ jsx("span", { className: "text-neutral dark:text-neutral-dark text-center text-xs", children: "© 2024 Intlayer, Inc." })
6
+ /* @__PURE__ */ jsx("span", { className: "text-neutral text-center text-xs", children: "© 2024 Intlayer, Inc." })
7
7
  ] }),
8
8
  /* @__PURE__ */ jsx("div", { className: "m-auto flex w-full flex-row flex-wrap justify-around gap-x-3 gap-y-6 md:w-2/3", children: (links ?? []).map(({ title, links: links2 }) => /* @__PURE__ */ jsxs(
9
9
  "div",
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../../src/components/Footer/index.tsx"],"sourcesContent":["import type { FC, ReactNode } from 'react';\nimport { Logo } from '../Logo';\n\nexport type FooterLink = {\n href: string;\n text: ReactNode;\n onClick?: () => void;\n label: string;\n};\n\nexport type LinkGroup = { title: ReactNode; links: FooterLink[] };\n\ntype FooterProps = { links?: LinkGroup[] };\n\nexport const Footer: FC<FooterProps> = ({ links }) => (\n <footer className=\"flex flex-auto flex-row flex-wrap items-center justify-around gap-10 p-6\">\n <aside className=\"flex flex-col items-center justify-between md:w-1/4\">\n <Logo type=\"logoWithTextBelow\" width={80} height={80} />\n <span className=\"text-neutral dark:text-neutral-dark text-center text-xs\">\n © 2024 Intlayer, Inc.\n </span>\n </aside>\n <div className=\"m-auto flex w-full flex-row flex-wrap justify-around gap-x-3 gap-y-6 md:w-2/3\">\n {(links ?? []).map(({ title, links }) => (\n <div\n className=\"flex flex-col gap-2\"\n key={links.map((link) => link.href).join(',')}\n >\n <strong>{title}</strong>\n <div className=\"flex flex-col gap-3 text-sm\">\n {links.map((link) => (\n <a key={link.href} href={link.href} aria-label={link.label}>\n {link.text}\n </a>\n ))}\n </div>\n </div>\n ))}\n </div>\n </footer>\n);\n"],"names":["links"],"mappings":";;AAca,MAAA,SAA0B,CAAC,EAAE,YACvC,qBAAA,UAAA,EAAO,WAAU,4EAChB,UAAA;AAAA,EAAC,qBAAA,SAAA,EAAM,WAAU,uDACf,UAAA;AAAA,IAAA,oBAAC,QAAK,MAAK,qBAAoB,OAAO,IAAI,QAAQ,IAAI;AAAA,IACrD,oBAAA,QAAA,EAAK,WAAU,2DAA0D,UAE1E,wBAAA,CAAA;AAAA,EAAA,GACF;AAAA,EACC,oBAAA,OAAA,EAAI,WAAU,iFACX,WAAS,SAAA,CAAA,GAAI,IAAI,CAAC,EAAE,OAAO,OAAAA,OAC3B,MAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAU;AAAA,MAGV,UAAA;AAAA,QAAA,oBAAC,YAAQ,UAAM,MAAA,CAAA;AAAA,QACf,oBAAC,SAAI,WAAU,+BACZ,UAAAA,OAAM,IAAI,CAAC,SACT,oBAAA,KAAA,EAAkB,MAAM,KAAK,MAAM,cAAY,KAAK,OAClD,eAAK,KADA,GAAA,KAAK,IAEb,CACD,EACH,CAAA;AAAA,MAAA;AAAA,IAAA;AAAA,IATKA,OAAM,IAAI,CAAC,SAAS,KAAK,IAAI,EAAE,KAAK,GAAG;AAAA,EAAA,CAW/C,EACH,CAAA;AAAA,EACF,CAAA;"}
1
+ {"version":3,"file":"index.mjs","sources":["../../../src/components/Footer/index.tsx"],"sourcesContent":["import type { FC, ReactNode } from 'react';\nimport { Logo } from '../Logo';\n\nexport type FooterLink = {\n href: string;\n text: ReactNode;\n onClick?: () => void;\n label: string;\n};\n\nexport type LinkGroup = { title: ReactNode; links: FooterLink[] };\n\ntype FooterProps = { links?: LinkGroup[] };\n\nexport const Footer: FC<FooterProps> = ({ links }) => (\n <footer className=\"flex flex-auto flex-row flex-wrap items-center justify-around gap-10 p-6\">\n <aside className=\"flex flex-col items-center justify-between md:w-1/4\">\n <Logo type=\"logoWithTextBelow\" width={80} height={80} />\n <span className=\"text-neutral text-center text-xs\">\n © 2024 Intlayer, Inc.\n </span>\n </aside>\n <div className=\"m-auto flex w-full flex-row flex-wrap justify-around gap-x-3 gap-y-6 md:w-2/3\">\n {(links ?? []).map(({ title, links }) => (\n <div\n className=\"flex flex-col gap-2\"\n key={links.map((link) => link.href).join(',')}\n >\n <strong>{title}</strong>\n <div className=\"flex flex-col gap-3 text-sm\">\n {links.map((link) => (\n <a key={link.href} href={link.href} aria-label={link.label}>\n {link.text}\n </a>\n ))}\n </div>\n </div>\n ))}\n </div>\n </footer>\n);\n"],"names":["links"],"mappings":";;AAca,MAAA,SAA0B,CAAC,EAAE,YACvC,qBAAA,UAAA,EAAO,WAAU,4EAChB,UAAA;AAAA,EAAC,qBAAA,SAAA,EAAM,WAAU,uDACf,UAAA;AAAA,IAAA,oBAAC,QAAK,MAAK,qBAAoB,OAAO,IAAI,QAAQ,IAAI;AAAA,IACrD,oBAAA,QAAA,EAAK,WAAU,oCAAmC,UAEnD,wBAAA,CAAA;AAAA,EAAA,GACF;AAAA,EACC,oBAAA,OAAA,EAAI,WAAU,iFACX,WAAS,SAAA,CAAA,GAAI,IAAI,CAAC,EAAE,OAAO,OAAAA,OAC3B,MAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAU;AAAA,MAGV,UAAA;AAAA,QAAA,oBAAC,YAAQ,UAAM,MAAA,CAAA;AAAA,QACf,oBAAC,SAAI,WAAU,+BACZ,UAAAA,OAAM,IAAI,CAAC,SACT,oBAAA,KAAA,EAAkB,MAAM,KAAK,MAAM,cAAY,KAAK,OAClD,eAAK,KADA,GAAA,KAAK,IAEb,CACD,EACH,CAAA;AAAA,MAAA;AAAA,IAAA;AAAA,IATKA,OAAM,IAAI,CAAC,SAAS,KAAK,IAAI,EAAE,KAAK,GAAG;AAAA,EAAA,CAW/C,EACH,CAAA;AAAA,EACF,CAAA;"}
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  require("../Button/Button.cjs");
4
- const components_Form_layout_FormItemLayout = require("../../Form-yi0CMK-a.cjs");
4
+ const components_Form_layout_FormItemLayout = require("../../Form-BpxW17v4.cjs");
5
5
  require("./FormBase.cjs");
6
6
  require("./FormControl.cjs");
7
7
  require("./FormDescription.cjs");
@@ -1,5 +1,5 @@
1
1
  import "../Button/Button.mjs";
2
- import { F } from "../../Form-BZUDRfoN.js";
2
+ import { F } from "../../Form-MjLzPGze.js";
3
3
  import "./FormBase.mjs";
4
4
  import "./FormControl.mjs";
5
5
  import "./FormDescription.mjs";