@intlayer/design-system 3.5.0 → 3.5.1

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 (344) hide show
  1. package/dist/Form-BDcoNTLV.cjs.map +1 -1
  2. package/dist/Form-DhsgC7kB.js.map +1 -1
  3. package/dist/components/Accordion/Accordion.cjs.map +1 -1
  4. package/dist/components/Accordion/Accordion.mjs.map +1 -1
  5. package/dist/components/Auth/AuthModal/index.cjs.map +1 -1
  6. package/dist/components/Auth/AuthModal/index.mjs.map +1 -1
  7. package/dist/components/Auth/AuthenticationBarrier/AuthenticationBarrierClient.cjs.map +1 -1
  8. package/dist/components/Auth/AuthenticationBarrier/AuthenticationBarrierClient.mjs.map +1 -1
  9. package/dist/components/Auth/AuthenticationBarrier/AuthenticationBarrierServer.cjs.map +1 -1
  10. package/dist/components/Auth/AuthenticationBarrier/AuthenticationBarrierServer.mjs.map +1 -1
  11. package/dist/components/Auth/AuthenticationBarrier/accessValidation.cjs.map +1 -1
  12. package/dist/components/Auth/AuthenticationBarrier/accessValidation.mjs.map +1 -1
  13. package/dist/components/Auth/ChangePasswordForm/ChangePasswordForm.cjs.map +1 -1
  14. package/dist/components/Auth/ChangePasswordForm/ChangePasswordForm.mjs.map +1 -1
  15. package/dist/components/Auth/ChangePasswordForm/ChangePasswordSchema.cjs.map +1 -1
  16. package/dist/components/Auth/ChangePasswordForm/ChangePasswordSchema.mjs.map +1 -1
  17. package/dist/components/Auth/ChangePasswordForm/index.content.cjs.map +1 -1
  18. package/dist/components/Auth/ChangePasswordForm/index.content.d.ts +10 -10
  19. package/dist/components/Auth/ChangePasswordForm/index.content.mjs.map +1 -1
  20. package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.cjs.map +1 -1
  21. package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.mjs.map +1 -1
  22. package/dist/components/Auth/ExternalsLoginButtons/assets/GoogleLogo.cjs.map +1 -1
  23. package/dist/components/Auth/ExternalsLoginButtons/assets/GoogleLogo.mjs.map +1 -1
  24. package/dist/components/Auth/ExternalsLoginButtons/externalsLoginButtons.content.cjs.map +1 -1
  25. package/dist/components/Auth/ExternalsLoginButtons/externalsLoginButtons.content.d.ts +5 -5
  26. package/dist/components/Auth/ExternalsLoginButtons/externalsLoginButtons.content.mjs.map +1 -1
  27. package/dist/components/Auth/ResetPasswordForm/ResetPasswordForm.cjs.map +1 -1
  28. package/dist/components/Auth/ResetPasswordForm/ResetPasswordForm.mjs.map +1 -1
  29. package/dist/components/Auth/ResetPasswordForm/ResetPasswordSchema.cjs.map +1 -1
  30. package/dist/components/Auth/ResetPasswordForm/ResetPasswordSchema.mjs.map +1 -1
  31. package/dist/components/Auth/ResetPasswordForm/index.content.cjs.map +1 -1
  32. package/dist/components/Auth/ResetPasswordForm/index.content.d.ts +7 -7
  33. package/dist/components/Auth/ResetPasswordForm/index.content.mjs.map +1 -1
  34. package/dist/components/Auth/SignInForm/SignInForm.cjs.map +1 -1
  35. package/dist/components/Auth/SignInForm/SignInForm.mjs.map +1 -1
  36. package/dist/components/Auth/SignInForm/SignInSchema.cjs.map +1 -1
  37. package/dist/components/Auth/SignInForm/SignInSchema.mjs.map +1 -1
  38. package/dist/components/Auth/SignInForm/index.content.cjs.map +1 -1
  39. package/dist/components/Auth/SignInForm/index.content.d.ts +13 -13
  40. package/dist/components/Auth/SignInForm/index.content.mjs.map +1 -1
  41. package/dist/components/Auth/SignUpForm/SignUpForm.cjs.map +1 -1
  42. package/dist/components/Auth/SignUpForm/SignUpForm.mjs.map +1 -1
  43. package/dist/components/Auth/SignUpForm/SignUpSchema.cjs.map +1 -1
  44. package/dist/components/Auth/SignUpForm/SignUpSchema.mjs.map +1 -1
  45. package/dist/components/Auth/SignUpForm/index.content.cjs.map +1 -1
  46. package/dist/components/Auth/SignUpForm/index.content.d.ts +11 -11
  47. package/dist/components/Auth/SignUpForm/index.content.mjs.map +1 -1
  48. package/dist/components/Auth/useAuth/index.cjs.map +1 -1
  49. package/dist/components/Auth/useAuth/index.mjs.map +1 -1
  50. package/dist/components/Auth/useAuth/useCSRF.cjs.map +1 -1
  51. package/dist/components/Auth/useAuth/useCSRF.mjs.map +1 -1
  52. package/dist/components/Auth/useAuth/useOAuth2.cjs.map +1 -1
  53. package/dist/components/Auth/useAuth/useOAuth2.mjs.map +1 -1
  54. package/dist/components/Auth/useAuth/useSession.cjs.map +1 -1
  55. package/dist/components/Auth/useAuth/useSession.mjs.map +1 -1
  56. package/dist/components/Auth/useUser/index.cjs.map +1 -1
  57. package/dist/components/Auth/useUser/index.mjs.map +1 -1
  58. package/dist/components/Avatar/index.cjs.map +1 -1
  59. package/dist/components/Avatar/index.mjs.map +1 -1
  60. package/dist/components/Badge/index.cjs.map +1 -1
  61. package/dist/components/Badge/index.mjs.map +1 -1
  62. package/dist/components/Breadcrumb/index.cjs.map +1 -1
  63. package/dist/components/Breadcrumb/index.mjs.map +1 -1
  64. package/dist/components/Button/Button.cjs.map +1 -1
  65. package/dist/components/Button/Button.mjs.map +1 -1
  66. package/dist/components/Command/index.cjs.map +1 -1
  67. package/dist/components/Command/index.mjs.map +1 -1
  68. package/dist/components/Container/index.cjs.map +1 -1
  69. package/dist/components/Container/index.mjs.map +1 -1
  70. package/dist/components/ContentEditor/ContentEditor.cjs.map +1 -1
  71. package/dist/components/ContentEditor/ContentEditor.mjs.map +1 -1
  72. package/dist/components/ContentEditor/ContentEditorTextArea.cjs.map +1 -1
  73. package/dist/components/ContentEditor/ContentEditorTextArea.mjs.map +1 -1
  74. package/dist/components/CopyToClipboard/index.cjs.map +1 -1
  75. package/dist/components/CopyToClipboard/index.mjs.map +1 -1
  76. package/dist/components/DictionaryEditor/DictionaryEditor.cjs.map +1 -1
  77. package/dist/components/DictionaryEditor/DictionaryEditor.mjs.map +1 -1
  78. package/dist/components/DictionaryEditor/ItemLayout.cjs.map +1 -1
  79. package/dist/components/DictionaryEditor/ItemLayout.mjs.map +1 -1
  80. package/dist/components/DictionaryEditor/NodeWrapper/StringWrapper.cjs.map +1 -1
  81. package/dist/components/DictionaryEditor/NodeWrapper/StringWrapper.mjs.map +1 -1
  82. package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.cjs.map +1 -1
  83. package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.mjs.map +1 -1
  84. package/dist/components/DictionaryEditor/useEditedContentStore.cjs.map +1 -1
  85. package/dist/components/DictionaryEditor/useEditedContentStore.mjs.map +1 -1
  86. package/dist/components/DictionaryEditor/useEditionPanelStore.cjs.map +1 -1
  87. package/dist/components/DictionaryEditor/useEditionPanelStore.mjs.map +1 -1
  88. package/dist/components/DictionaryEditor/validDictionaryChangeButtons.content.cjs.map +1 -1
  89. package/dist/components/DictionaryEditor/validDictionaryChangeButtons.content.mjs.map +1 -1
  90. package/dist/components/DictionaryEditor/validDictionaryChangeButtonsSchema.cjs.map +1 -1
  91. package/dist/components/DictionaryEditor/validDictionaryChangeButtonsSchema.mjs.map +1 -1
  92. package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.cjs.map +1 -1
  93. package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.mjs.map +1 -1
  94. package/dist/components/DictionaryFieldEditor/DictionariesSelector/dictionariesSelector.content.cjs.map +1 -1
  95. package/dist/components/DictionaryFieldEditor/DictionariesSelector/dictionariesSelector.content.mjs.map +1 -1
  96. package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.cjs.map +1 -1
  97. package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.mjs.map +1 -1
  98. package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryCreationForm.content.cjs.map +1 -1
  99. package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryCreationForm.content.mjs.map +1 -1
  100. package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryFormSchema.cjs.map +1 -1
  101. package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryFormSchema.mjs.map +1 -1
  102. package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.cjs.map +1 -1
  103. package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.mjs.map +1 -1
  104. package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsSchema.cjs.map +1 -1
  105. package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsSchema.mjs.map +1 -1
  106. package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.cjs.map +1 -1
  107. package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.mjs.map +1 -1
  108. package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.cjs.map +1 -1
  109. package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.mjs.map +1 -1
  110. package/dist/components/DictionaryFieldEditor/EditorView/EditorView.cjs.map +1 -1
  111. package/dist/components/DictionaryFieldEditor/EditorView/EditorView.mjs.map +1 -1
  112. package/dist/components/DictionaryFieldEditor/EditorView/TextEditor.cjs.map +1 -1
  113. package/dist/components/DictionaryFieldEditor/EditorView/TextEditor.mjs.map +1 -1
  114. package/dist/components/DictionaryFieldEditor/EnumKeyInput.cjs.map +1 -1
  115. package/dist/components/DictionaryFieldEditor/EnumKeyInput.mjs.map +1 -1
  116. package/dist/components/DictionaryFieldEditor/JSONEditor.cjs.map +1 -1
  117. package/dist/components/DictionaryFieldEditor/JSONEditor.mjs.map +1 -1
  118. package/dist/components/DictionaryFieldEditor/KeyPathBreadcrumb.cjs.map +1 -1
  119. package/dist/components/DictionaryFieldEditor/KeyPathBreadcrumb.mjs.map +1 -1
  120. package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.cjs.map +1 -1
  121. package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.mjs.map +1 -1
  122. package/dist/components/DictionaryFieldEditor/NavigationView/navigationViewNode.content.cjs.map +1 -1
  123. package/dist/components/DictionaryFieldEditor/NavigationView/navigationViewNode.content.mjs.map +1 -1
  124. package/dist/components/DictionaryFieldEditor/NodeEditor.cjs.map +1 -1
  125. package/dist/components/DictionaryFieldEditor/NodeEditor.mjs.map +1 -1
  126. package/dist/components/DictionaryFieldEditor/NodeTypeSelector.cjs.map +1 -1
  127. package/dist/components/DictionaryFieldEditor/NodeTypeSelector.mjs.map +1 -1
  128. package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.cjs.map +1 -1
  129. package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.mjs.map +1 -1
  130. package/dist/components/DictionaryFieldEditor/SaveForm/SaveFormSchema.cjs.map +1 -1
  131. package/dist/components/DictionaryFieldEditor/SaveForm/SaveFormSchema.mjs.map +1 -1
  132. package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.cjs.map +1 -1
  133. package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.mjs.map +1 -1
  134. package/dist/components/DictionaryFieldEditor/dictionaryFieldEditor.content.cjs.map +1 -1
  135. package/dist/components/DictionaryFieldEditor/dictionaryFieldEditor.content.mjs.map +1 -1
  136. package/dist/components/DictionaryFieldEditor/editorView.content.cjs.map +1 -1
  137. package/dist/components/DictionaryFieldEditor/editorView.content.mjs.map +1 -1
  138. package/dist/components/DictionaryFieldEditor/getIsEditableSection.cjs.map +1 -1
  139. package/dist/components/DictionaryFieldEditor/getIsEditableSection.mjs.map +1 -1
  140. package/dist/components/DictionaryFieldEditor/nodeTypeSelector.content.cjs.map +1 -1
  141. package/dist/components/DictionaryFieldEditor/nodeTypeSelector.content.mjs.map +1 -1
  142. package/dist/components/DropDown/index.cjs.map +1 -1
  143. package/dist/components/DropDown/index.mjs.map +1 -1
  144. package/dist/components/EditableField/EditableFieldInput.cjs.map +1 -1
  145. package/dist/components/EditableField/EditableFieldInput.mjs.map +1 -1
  146. package/dist/components/EditableField/EditableFieldLayout.cjs.map +1 -1
  147. package/dist/components/EditableField/EditableFieldLayout.mjs.map +1 -1
  148. package/dist/components/EditableField/EditableFieldTextArea.cjs.map +1 -1
  149. package/dist/components/EditableField/EditableFieldTextArea.mjs.map +1 -1
  150. package/dist/components/Footer/index.cjs.map +1 -1
  151. package/dist/components/Footer/index.mjs.map +1 -1
  152. package/dist/components/Form/FormBase.cjs.map +1 -1
  153. package/dist/components/Form/FormBase.mjs.map +1 -1
  154. package/dist/components/Form/FormControl.cjs.map +1 -1
  155. package/dist/components/Form/FormControl.mjs.map +1 -1
  156. package/dist/components/Form/FormDescription.cjs.map +1 -1
  157. package/dist/components/Form/FormDescription.mjs.map +1 -1
  158. package/dist/components/Form/FormField.cjs.map +1 -1
  159. package/dist/components/Form/FormField.mjs.map +1 -1
  160. package/dist/components/Form/FormItem.cjs.map +1 -1
  161. package/dist/components/Form/FormItem.mjs.map +1 -1
  162. package/dist/components/Form/FormLabel.cjs.map +1 -1
  163. package/dist/components/Form/FormLabel.mjs.map +1 -1
  164. package/dist/components/Form/FormMessage.cjs.map +1 -1
  165. package/dist/components/Form/FormMessage.mjs.map +1 -1
  166. package/dist/components/Form/elements/FormElementWrapper.cjs.map +1 -1
  167. package/dist/components/Form/elements/FormElementWrapper.mjs.map +1 -1
  168. package/dist/components/Form/layout/FormLabelLayout.cjs.map +1 -1
  169. package/dist/components/Form/layout/FormLabelLayout.mjs.map +1 -1
  170. package/dist/components/Headers/SectionScroller.cjs.map +1 -1
  171. package/dist/components/Headers/SectionScroller.mjs.map +1 -1
  172. package/dist/components/Headers/index.cjs.map +1 -1
  173. package/dist/components/Headers/index.mjs.map +1 -1
  174. package/dist/components/IDE/CodeRender.cjs.map +1 -1
  175. package/dist/components/IDE/CodeRender.mjs.map +1 -1
  176. package/dist/components/IDE/FileList.cjs.map +1 -1
  177. package/dist/components/IDE/FileList.mjs.map +1 -1
  178. package/dist/components/IDE/FileTree.cjs.map +1 -1
  179. package/dist/components/IDE/FileTree.mjs.map +1 -1
  180. package/dist/components/IDE/IDE.cjs +1 -1
  181. package/dist/components/IDE/IDE.cjs.map +1 -1
  182. package/dist/components/IDE/IDE.mjs +1 -1
  183. package/dist/components/IDE/IDE.mjs.map +1 -1
  184. package/dist/components/IDE/MarkDownRender.cjs.map +1 -1
  185. package/dist/components/IDE/MarkDownRender.mjs.map +1 -1
  186. package/dist/components/IDE/createFileTree.cjs.map +1 -1
  187. package/dist/components/IDE/createFileTree.mjs.map +1 -1
  188. package/dist/components/Input/Checkbox.cjs.map +1 -1
  189. package/dist/components/Input/Checkbox.mjs.map +1 -1
  190. package/dist/components/Input/Input.cjs.map +1 -1
  191. package/dist/components/Input/Input.mjs.map +1 -1
  192. package/dist/components/Input/InputPassword.cjs.map +1 -1
  193. package/dist/components/Input/InputPassword.mjs.map +1 -1
  194. package/dist/components/Link/Link.cjs.map +1 -1
  195. package/dist/components/Link/Link.mjs.map +1 -1
  196. package/dist/components/Loader/spinner.cjs.map +1 -1
  197. package/dist/components/Loader/spinner.mjs.map +1 -1
  198. package/dist/components/LocaleSwitcherDropDown/LocaleSwitcher.cjs.map +1 -1
  199. package/dist/components/LocaleSwitcherDropDown/LocaleSwitcher.mjs.map +1 -1
  200. package/dist/components/Logo/LogoCircle.cjs.map +1 -1
  201. package/dist/components/Logo/LogoCircle.mjs.map +1 -1
  202. package/dist/components/Logo/LogoNoFrame.cjs.map +1 -1
  203. package/dist/components/Logo/LogoNoFrame.mjs.map +1 -1
  204. package/dist/components/Logo/LogoSquare.cjs.map +1 -1
  205. package/dist/components/Logo/LogoSquare.mjs.map +1 -1
  206. package/dist/components/Logo/LogoSquircle.cjs.map +1 -1
  207. package/dist/components/Logo/LogoSquircle.mjs.map +1 -1
  208. package/dist/components/Logo/LogoTextOnly.cjs.map +1 -1
  209. package/dist/components/Logo/LogoTextOnly.mjs.map +1 -1
  210. package/dist/components/Logo/LogoWithTextBelowCircle.cjs.map +1 -1
  211. package/dist/components/Logo/LogoWithTextBelowCircle.mjs.map +1 -1
  212. package/dist/components/Logo/LogoWithTextBelowNoFrame.cjs.map +1 -1
  213. package/dist/components/Logo/LogoWithTextBelowNoFrame.mjs.map +1 -1
  214. package/dist/components/Logo/LogoWithTextBelowSquircle.cjs.map +1 -1
  215. package/dist/components/Logo/LogoWithTextBelowSquircle.mjs.map +1 -1
  216. package/dist/components/Logo/LogoWithTextCircle.cjs.map +1 -1
  217. package/dist/components/Logo/LogoWithTextCircle.mjs.map +1 -1
  218. package/dist/components/Logo/LogoWithTextNoFrame.cjs.map +1 -1
  219. package/dist/components/Logo/LogoWithTextNoFrame.mjs.map +1 -1
  220. package/dist/components/Logo/LogoWithTextSquircle.cjs.map +1 -1
  221. package/dist/components/Logo/LogoWithTextSquircle.mjs.map +1 -1
  222. package/dist/components/Logo/index.cjs.map +1 -1
  223. package/dist/components/Logo/index.mjs.map +1 -1
  224. package/dist/components/MarkDownRender/index.cjs.map +1 -1
  225. package/dist/components/MarkDownRender/index.mjs.map +1 -1
  226. package/dist/components/MaxHeightSmoother/index.cjs.map +1 -1
  227. package/dist/components/MaxHeightSmoother/index.mjs.map +1 -1
  228. package/dist/components/MaxWidthSmoother/index.cjs.map +1 -1
  229. package/dist/components/MaxWidthSmoother/index.mjs.map +1 -1
  230. package/dist/components/Modal/Modal.cjs.map +1 -1
  231. package/dist/components/Modal/Modal.mjs.map +1 -1
  232. package/dist/components/Navbar/Burger.cjs.map +1 -1
  233. package/dist/components/Navbar/Burger.mjs.map +1 -1
  234. package/dist/components/Navbar/DesktopNavbar.cjs.map +1 -1
  235. package/dist/components/Navbar/DesktopNavbar.mjs.map +1 -1
  236. package/dist/components/Navbar/MobileNavbar.cjs.map +1 -1
  237. package/dist/components/Navbar/MobileNavbar.mjs.map +1 -1
  238. package/dist/components/Navbar/index.cjs.map +1 -1
  239. package/dist/components/Navbar/index.mjs.map +1 -1
  240. package/dist/components/Navbar/useNavigation.cjs.map +1 -1
  241. package/dist/components/Navbar/useNavigation.mjs.map +1 -1
  242. package/dist/components/Pattern/DotPattern.cjs.map +1 -1
  243. package/dist/components/Pattern/DotPattern.mjs.map +1 -1
  244. package/dist/components/Pattern/GridPattern.cjs.map +1 -1
  245. package/dist/components/Pattern/GridPattern.mjs.map +1 -1
  246. package/dist/components/Pattern/SpotLight.cjs.map +1 -1
  247. package/dist/components/Pattern/SpotLight.mjs.map +1 -1
  248. package/dist/components/Popover/index.cjs.map +1 -1
  249. package/dist/components/Popover/index.mjs.map +1 -1
  250. package/dist/components/PressableSpan/PressableSpan.cjs.map +1 -1
  251. package/dist/components/PressableSpan/PressableSpan.mjs.map +1 -1
  252. package/dist/components/ProfileDropDown/index.cjs.map +1 -1
  253. package/dist/components/ProfileDropDown/index.mjs.map +1 -1
  254. package/dist/components/RightDrawer/RightDrawer.cjs.map +1 -1
  255. package/dist/components/RightDrawer/RightDrawer.mjs.map +1 -1
  256. package/dist/components/RightDrawer/useRightDrawerStore.cjs.map +1 -1
  257. package/dist/components/RightDrawer/useRightDrawerStore.mjs.map +1 -1
  258. package/dist/components/Select/Multiselect.cjs.map +1 -1
  259. package/dist/components/Select/Multiselect.mjs.map +1 -1
  260. package/dist/components/Select/Select.cjs.map +1 -1
  261. package/dist/components/Select/Select.mjs.map +1 -1
  262. package/dist/components/SwitchSelector/index.cjs.map +1 -1
  263. package/dist/components/SwitchSelector/index.mjs.map +1 -1
  264. package/dist/components/TabSelector/TabSelector.cjs.map +1 -1
  265. package/dist/components/TabSelector/TabSelector.mjs.map +1 -1
  266. package/dist/components/Tag/index.cjs.map +1 -1
  267. package/dist/components/Tag/index.mjs.map +1 -1
  268. package/dist/components/TextArea/AutoSizeTextArea.cjs.map +1 -1
  269. package/dist/components/TextArea/AutoSizeTextArea.mjs.map +1 -1
  270. package/dist/components/TextArea/TextArea.cjs.map +1 -1
  271. package/dist/components/TextArea/TextArea.mjs.map +1 -1
  272. package/dist/components/ThemeSwitcherDropDown/DesktopThemeSwitcher.cjs.map +1 -1
  273. package/dist/components/ThemeSwitcherDropDown/DesktopThemeSwitcher.mjs.map +1 -1
  274. package/dist/components/ThemeSwitcherDropDown/MobileThemeSwitcher.cjs.map +1 -1
  275. package/dist/components/ThemeSwitcherDropDown/MobileThemeSwitcher.mjs.map +1 -1
  276. package/dist/components/Toaster/Toast.cjs.map +1 -1
  277. package/dist/components/Toaster/Toast.mjs.map +1 -1
  278. package/dist/components/Toaster/Toaster.cjs.map +1 -1
  279. package/dist/components/Toaster/Toaster.mjs.map +1 -1
  280. package/dist/components/Toaster/useToast.cjs.map +1 -1
  281. package/dist/components/Toaster/useToast.mjs.map +1 -1
  282. package/dist/components/WithResizer/index.cjs.map +1 -1
  283. package/dist/components/WithResizer/index.mjs.map +1 -1
  284. package/dist/hooks/intlayerAPIHooks.cjs.map +1 -1
  285. package/dist/hooks/intlayerAPIHooks.mjs.map +1 -1
  286. package/dist/hooks/useAsync/useAsync.cjs.map +1 -1
  287. package/dist/hooks/useAsync/useAsync.mjs.map +1 -1
  288. package/dist/hooks/useAsync/useAsyncStateStore.cjs.map +1 -1
  289. package/dist/hooks/useAsync/useAsyncStateStore.mjs.map +1 -1
  290. package/dist/hooks/useDevice.cjs.map +1 -1
  291. package/dist/hooks/useDevice.mjs.map +1 -1
  292. package/dist/hooks/useGetAllDictionaries.cjs.map +1 -1
  293. package/dist/hooks/useGetAllDictionaries.mjs.map +1 -1
  294. package/dist/hooks/useGetElementOrWindow.cjs.map +1 -1
  295. package/dist/hooks/useIntlayerAPI.cjs.map +1 -1
  296. package/dist/hooks/useIntlayerAPI.mjs.map +1 -1
  297. package/dist/hooks/useIsMounted.cjs.map +1 -1
  298. package/dist/hooks/useIsMounted.mjs.map +1 -1
  299. package/dist/hooks/useItemSelector.cjs.map +1 -1
  300. package/dist/hooks/useItemSelector.mjs.map +1 -1
  301. package/dist/hooks/usePersistedStore.cjs.map +1 -1
  302. package/dist/hooks/usePersistedStore.mjs.map +1 -1
  303. package/dist/hooks/useScrollBlockage/index.cjs.map +1 -1
  304. package/dist/hooks/useScrollBlockage/index.mjs.map +1 -1
  305. package/dist/hooks/useScrollBlockage/useScrollBlockageStore.cjs.map +1 -1
  306. package/dist/hooks/useScrollBlockage/useScrollBlockageStore.mjs.map +1 -1
  307. package/dist/hooks/useScrollDetection.cjs.map +1 -1
  308. package/dist/hooks/useScrollDetection.mjs.map +1 -1
  309. package/dist/index-BtZWYJhL.cjs.map +1 -1
  310. package/dist/index-D9oaKvKC.js.map +1 -1
  311. package/dist/jsx-runtime-DaNGiM0W.js.map +1 -1
  312. package/dist/jsx-runtime-XHKiWCTo.cjs.map +1 -1
  313. package/dist/libs/intlayer-api/auth.cjs.map +1 -1
  314. package/dist/libs/intlayer-api/auth.mjs.map +1 -1
  315. package/dist/libs/intlayer-api/dictionary.cjs.map +1 -1
  316. package/dist/libs/intlayer-api/dictionary.mjs.map +1 -1
  317. package/dist/libs/intlayer-api/fetcher.cjs.map +1 -1
  318. package/dist/libs/intlayer-api/fetcher.mjs.map +1 -1
  319. package/dist/libs/intlayer-api/organization.cjs.map +1 -1
  320. package/dist/libs/intlayer-api/organization.mjs.map +1 -1
  321. package/dist/libs/intlayer-api/project.cjs.map +1 -1
  322. package/dist/libs/intlayer-api/project.mjs.map +1 -1
  323. package/dist/libs/intlayer-api/stripe.cjs.map +1 -1
  324. package/dist/libs/intlayer-api/stripe.mjs.map +1 -1
  325. package/dist/libs/intlayer-api/user.cjs.map +1 -1
  326. package/dist/libs/intlayer-api/user.mjs.map +1 -1
  327. package/dist/shallow-lhDIFtEp.cjs.map +1 -1
  328. package/dist/shallow-m9BpCkKh.js.map +1 -1
  329. package/dist/tailwind.config.cjs.map +1 -1
  330. package/dist/tailwind.config.mjs.map +1 -1
  331. package/dist/tailwind.css +1 -1
  332. package/dist/utils/camelCase.cjs.map +1 -1
  333. package/dist/utils/camelCase.mjs.map +1 -1
  334. package/dist/utils/capitalize.cjs.map +1 -1
  335. package/dist/utils/capitalize.mjs.map +1 -1
  336. package/dist/utils/dictionary.cjs.map +1 -1
  337. package/dist/utils/dictionary.mjs.map +1 -1
  338. package/dist/utils/isElementAtTopAndNotCovered.cjs.map +1 -1
  339. package/dist/utils/isElementAtTopAndNotCovered.mjs.map +1 -1
  340. package/dist/utils/object.cjs.map +1 -1
  341. package/dist/utils/object.mjs.map +1 -1
  342. package/dist/zod-BV4nCGJE.js.map +1 -1
  343. package/dist/zod-DSrtTSD_.cjs.map +1 -1
  344. package/package.json +14 -14
@@ -1 +1 @@
1
- {"version":3,"file":"DictionaryDetailsSchema.mjs","sources":["../../../../src/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsSchema.ts"],"sourcesContent":["// @ts-ignore react-intlayer not build yet\nimport { t } from 'react-intlayer';\nimport { z } from 'zod';\n\nexport const getDictionaryDetailsSchema = (projectId: string) => {\n // Title Field Error Messages\n const titleRequiredError = t({\n en: 'Please enter a name for your organization.',\n fr: 'Veuillez saisir un nom pour votre organisation.',\n es: 'Por favor, ingrese un nombre para su organización.',\n });\n\n const titleInvalidTypeError = t({\n en: 'The organization name must be a valid string.',\n fr: 'Le nom de votre organisation doit être une chaîne valide.',\n es: 'El nombre de su organización debe ser una cadena válida.',\n });\n\n const titleMinLengthError = t({\n en: 'The organization name must be at least 4 characters long.',\n fr: 'Le nom de votre organisation doit comporter au moins 4 caractères.',\n es: 'El nombre de su organización debe tener al menos 4 caracteres.',\n });\n\n // Key Field Error Messages\n const keyRequiredError = t({\n en: 'Please enter a key for your organization.',\n fr: 'Veuillez saisir une clé pour votre organisation.',\n es: 'Por favor, ingrese una clave para su organización.',\n });\n\n const keyInvalidTypeError = t({\n en: 'The key must be a valid string.',\n fr: 'La clé doit être une chaîne valide.',\n es: 'La clave debe ser una cadena válida.',\n });\n\n const keySpaceError = t({\n en: 'The key cannot contain spaces or special characters.',\n fr: \"La clé ne peut pas contenir d'espaces ou de caractères spéciaux.\",\n es: 'La clave no puede contener espacios o caracteres especiales.',\n });\n\n const keyMinLengthError = t({\n en: 'The key must be at least 4 characters long.',\n fr: 'La clé doit comporter au moins 4 caractères.',\n es: 'La clave debe tener al menos 4 caracteres.',\n });\n\n // Description Field Error Messages\n const descriptionRequiredError = t({\n en: 'Please enter a description for your organization.',\n fr: 'Veuillez saisir une description pour votre organisation.',\n es: 'Por favor, ingrese una descripción para su organización.',\n });\n\n const descriptionInvalidTypeError = t({\n en: 'The description must be a valid string.',\n fr: 'La description doit être une chaîne valide.',\n es: 'La descripción debe ser una cadena válida.',\n });\n\n const requiredErrorProjectId = t({\n en: 'Please select a project',\n fr: 'Veuillez sélectionner un projet',\n es: 'Por favor, seleccione un proyecto',\n });\n\n const invalidTypeErrorProjectId = t({\n en: 'Please select a valid project',\n fr: 'Veuillez sélectionner un projet valide',\n es: 'Por favor, seleccione un proyecto válido',\n });\n\n return z.object({\n title: z\n .string({\n required_error: titleRequiredError,\n invalid_type_error: titleInvalidTypeError,\n })\n // Can be length of 0 or > 4\n .refine((val) => val.length === 0 || val.length >= 4, {\n message: titleMinLengthError,\n })\n .optional(),\n key: z\n .string({\n required_error: keyRequiredError,\n invalid_type_error: keyInvalidTypeError,\n })\n .min(4, { message: keyMinLengthError })\n /**\n * Valid :\n * my-key\n * my_key\n *\n * Invalid :\n * my key\n * my.key\n */\n .regex(/^[a-zA-Z0-9-_]+$/, { message: keySpaceError })\n .default(''),\n description: z\n .string({\n required_error: descriptionRequiredError,\n invalid_type_error: descriptionInvalidTypeError,\n })\n .optional(),\n projectIds: z\n .array(\n z.string({\n required_error: requiredErrorProjectId,\n invalid_type_error: invalidTypeErrorProjectId,\n })\n )\n .default([projectId]),\n });\n};\n\nexport type DictionaryDetailsFormData = z.infer<\n ReturnType<typeof getDictionaryDetailsSchema>\n>;\n"],"names":[],"mappings":";;AAIa,MAAA,6BAA6B,CAAC,cAAsB;AAE/D,QAAM,qBAAqB,EAAE;AAAA,IAC3B,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,EAAA,CACL;AAED,QAAM,wBAAwB,EAAE;AAAA,IAC9B,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,EAAA,CACL;AAED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AAoB,EAAE,SAAS,cAAe,CAAA,EACpD,QAAQ,EAAE;AAAA,IACb,aAAa,EACV,OAAO;AAAA,MACN,gBAAgB;AAAA,MAChB,oBAAoB;AAAA,IACrB,CAAA,EACA,SAAS;AAAA,IACZ,YAAY,EACT;AAAA,MACC,EAAE,OAAO;AAAA,QACP,gBAAgB;AAAA,QAChB,oBAAoB;AAAA,MAAA,CACrB;AAAA,IAAA,EAEF,QAAQ,CAAC,SAAS,CAAC;AAAA,EAAA,CACvB;AACH;"}
1
+ {"version":3,"file":"DictionaryDetailsSchema.mjs","sources":["../../../../src/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsSchema.ts"],"sourcesContent":["// @ts-ignore react-intlayer not build yet\nimport { t } from 'react-intlayer';\nimport { z } from 'zod';\n\nexport const getDictionaryDetailsSchema = (projectId: string) => {\n // Title Field Error Messages\n const titleRequiredError = t({\n en: 'Please enter a name for your organization.',\n fr: 'Veuillez saisir un nom pour votre organisation.',\n es: 'Por favor, ingrese un nombre para su organización.',\n });\n\n const titleInvalidTypeError = t({\n en: 'The organization name must be a valid string.',\n fr: 'Le nom de votre organisation doit être une chaîne valide.',\n es: 'El nombre de su organización debe ser una cadena válida.',\n });\n\n const titleMinLengthError = t({\n en: 'The organization name must be at least 4 characters long.',\n fr: 'Le nom de votre organisation doit comporter au moins 4 caractères.',\n es: 'El nombre de su organización debe tener al menos 4 caracteres.',\n });\n\n // Key Field Error Messages\n const keyRequiredError = t({\n en: 'Please enter a key for your organization.',\n fr: 'Veuillez saisir une clé pour votre organisation.',\n es: 'Por favor, ingrese una clave para su organización.',\n });\n\n const keyInvalidTypeError = t({\n en: 'The key must be a valid string.',\n fr: 'La clé doit être une chaîne valide.',\n es: 'La clave debe ser una cadena válida.',\n });\n\n const keySpaceError = t({\n en: 'The key cannot contain spaces or special characters.',\n fr: \"La clé ne peut pas contenir d'espaces ou de caractères spéciaux.\",\n es: 'La clave no puede contener espacios o caracteres especiales.',\n });\n\n const keyMinLengthError = t({\n en: 'The key must be at least 4 characters long.',\n fr: 'La clé doit comporter au moins 4 caractères.',\n es: 'La clave debe tener al menos 4 caracteres.',\n });\n\n // Description Field Error Messages\n const descriptionRequiredError = t({\n en: 'Please enter a description for your organization.',\n fr: 'Veuillez saisir une description pour votre organisation.',\n es: 'Por favor, ingrese una descripción para su organización.',\n });\n\n const descriptionInvalidTypeError = t({\n en: 'The description must be a valid string.',\n fr: 'La description doit être une chaîne valide.',\n es: 'La descripción debe ser una cadena válida.',\n });\n\n const requiredErrorProjectId = t({\n en: 'Please select a project',\n fr: 'Veuillez sélectionner un projet',\n es: 'Por favor, seleccione un proyecto',\n });\n\n const invalidTypeErrorProjectId = t({\n en: 'Please select a valid project',\n fr: 'Veuillez sélectionner un projet valide',\n es: 'Por favor, seleccione un proyecto válido',\n });\n\n return z.object({\n title: z\n .string({\n required_error: titleRequiredError,\n invalid_type_error: titleInvalidTypeError,\n })\n // Can be length of 0 or > 4\n .refine((val) => val.length === 0 || val.length >= 4, {\n message: titleMinLengthError,\n })\n .optional(),\n key: z\n .string({\n required_error: keyRequiredError,\n invalid_type_error: keyInvalidTypeError,\n })\n .min(4, { message: keyMinLengthError })\n /**\n * Valid :\n * my-key\n * my_key\n *\n * Invalid :\n * my key\n * my.key\n */\n .regex(/^[a-zA-Z0-9-_]+$/, { message: keySpaceError })\n .default(''),\n description: z\n .string({\n required_error: descriptionRequiredError,\n invalid_type_error: descriptionInvalidTypeError,\n })\n .optional(),\n projectIds: z\n .array(\n z.string({\n required_error: requiredErrorProjectId,\n invalid_type_error: invalidTypeErrorProjectId,\n })\n )\n .default([projectId]),\n });\n};\n\nexport type DictionaryDetailsFormData = z.infer<\n ReturnType<typeof getDictionaryDetailsSchema>\n>;\n"],"names":[],"mappings":";;AAIa,MAAA,6BAA6B,CAAC,cAAsB;AAE/D,QAAM,qBAAqB,EAAE;AAAA,IAC3B,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,EAAA,CACL;AAED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AAAA,MAChB,oBAAoB;AAAA,IACrB,CAAA,EACA,IAAI,GAAG,EAAE,SAAS,kBAAkB,CAAC,EAUrC,MAAM,oBAAoB,EAAE,SAAS,cAAe,CAAA,EACpD,QAAQ,EAAE;AAAA,IACb,aAAa,EACV,OAAO;AAAA,MACN,gBAAgB;AAAA,MAChB,oBAAoB;AAAA,IACrB,CAAA,EACA,SAAS;AAAA,IACZ,YAAY,EACT;AAAA,MACC,EAAE,OAAO;AAAA,QACP,gBAAgB;AAAA,QAChB,oBAAoB;AAAA,MACrB,CAAA;AAAA,IAAA,EAEF,QAAQ,CAAC,SAAS,CAAC;AAAA,EAAA,CACvB;AACH;"}
@@ -1 +1 @@
1
- {"version":3,"file":"dictionaryDetails.content.cjs","sources":["../../../../src/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.tsx"],"sourcesContent":["import { t, type DeclarationContent } from 'intlayer';\n\nexport const dictionaryDetailsContent = {\n key: 'dictionary-details',\n content: {\n titleInput: {\n label: t({\n en: 'Title',\n fr: 'Titre',\n es: 'Título',\n }),\n description: t({\n en: 'The title of your dictionary allows you to easily identify it',\n fr: \"Le titre de votre dictionnaire permet de l'identifier facilement\",\n es: 'El título de su diccionario le permite identificar fácilmente',\n }),\n placeholder: t({\n en: 'Enter the title of your dictionary',\n fr: 'Entrez le titre de votre dictionnaire',\n es: 'Ingrese el título de su diccionario',\n }),\n },\n keyInput: {\n label: t({\n en: 'Key',\n fr: 'Clé',\n es: 'Clave',\n }),\n description: t({\n en: 'The key of your dictionary is used to identify it in the application',\n fr: \"La clé de votre dictionnaire est utilisée pour l'identifier dans l'application\",\n es: 'La clave de su diccionario se utiliza para identificarla en la aplicación',\n }),\n placeholder: t({\n en: 'Enter the key of your dictionary',\n fr: 'Entrez la clé de votre dictionnaire',\n es: 'Ingrese la clave de su diccionario',\n }),\n },\n descriptionInput: {\n label: t({\n en: 'Description',\n fr: 'Description',\n es: 'Descripción',\n }),\n placeholder: t({\n en: 'Enter the description of your dictionary',\n fr: 'Entrez la description de votre dictionnaire',\n es: 'Ingrese la descripción de su diccionario',\n }),\n description: t({\n en: 'The description of your dictionary allows you to easily identify it using keywords. It is also used to search for your dictionary, and to assist the AI in understanding your dictionary.',\n fr: \"La description de votre dictionnaire permet d'identifier facilement l'utilisateur en utilisant des mots-clés. Elle est également utilisée pour rechercher votre dictionnaire et pour aider l'IA à comprendre votre dictionnaire.\",\n es: 'La descripción de su diccionario le permite identificar fácilmente el usuario utilizando palabras clave. También se utiliza para buscar su diccionario y para ayudar a la IA a entender su diccionario.',\n }),\n },\n\n projectInput: {\n label: t({\n en: 'Projects',\n fr: 'Projets',\n es: 'Proyectos',\n }),\n description: t({\n en: 'A dictionary can be associated with one or more projects. This allows you load the dictionary on different applications, and share it across different teams.',\n fr: 'Un dictionnaire peut être associé à un ou plusieurs projets. Cela permet de charger le dictionnaire sur différentes applications et de le partager entre différentes équipes.',\n es: 'Un diccionario puede estar asociado con uno o más proyectos. Esto permite cargar el diccionario en diferentes aplicaciones y compartirlo entre diferentes equipos.',\n }),\n placeholder: t({\n en: 'Select one or more projects to associate with your dictionary',\n fr: 'Sélectionnez un ou plusieurs projets à associer à votre dictionnaire',\n es: 'Seleccione uno o más proyectos para asociar con su diccionario',\n }),\n },\n\n saveButton: {\n text: t({\n en: 'Save changes',\n fr: 'Enregistrer les modifications',\n es: 'Guardar cambios',\n }),\n label: t({\n en: 'Click to save changes',\n fr: 'Cliquez pour enregistrer les modifications',\n es: 'Haga clic para guardar los cambios',\n }),\n },\n publishButton: {\n text: t({\n en: 'Publish dictionary',\n fr: 'Publier le dictionnaire',\n es: 'Publicar diccionario',\n }),\n label: t({\n en: 'Click to publish dictionary',\n fr: 'Cliquez pour publier le dictionnaire',\n es: 'Haga clic para publicar el diccionario',\n }),\n },\n },\n} satisfies DeclarationContent;\n"],"names":["t"],"mappings":";;;AAEO,MAAM,2BAA2B;AAAA,EACtC,KAAK;AAAA,EACL,SAAS;AAAA,IACP,YAAY;AAAA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,QACb,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,IACH;AAAA,IAEA,YAAY;AAAA,MACV,MAAMA,SAAAA,EAAE;AAAA,QACN,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,MACD,OAAOA,SAAAA,EAAE;AAAA,QACP,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,IACH;AAAA,IACA,eAAe;AAAA,MACb,MAAMA,SAAAA,EAAE;AAAA,QACN,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,MACD,OAAOA,SAAAA,EAAE;AAAA,QACP,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,IACH;AAAA,EACF;AACF;;"}
1
+ {"version":3,"file":"dictionaryDetails.content.cjs","sources":["../../../../src/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.tsx"],"sourcesContent":["import { t, type DeclarationContent } from 'intlayer';\n\nexport const dictionaryDetailsContent = {\n key: 'dictionary-details',\n content: {\n titleInput: {\n label: t({\n en: 'Title',\n fr: 'Titre',\n es: 'Título',\n }),\n description: t({\n en: 'The title of your dictionary allows you to easily identify it',\n fr: \"Le titre de votre dictionnaire permet de l'identifier facilement\",\n es: 'El título de su diccionario le permite identificar fácilmente',\n }),\n placeholder: t({\n en: 'Enter the title of your dictionary',\n fr: 'Entrez le titre de votre dictionnaire',\n es: 'Ingrese el título de su diccionario',\n }),\n },\n keyInput: {\n label: t({\n en: 'Key',\n fr: 'Clé',\n es: 'Clave',\n }),\n description: t({\n en: 'The key of your dictionary is used to identify it in the application',\n fr: \"La clé de votre dictionnaire est utilisée pour l'identifier dans l'application\",\n es: 'La clave de su diccionario se utiliza para identificarla en la aplicación',\n }),\n placeholder: t({\n en: 'Enter the key of your dictionary',\n fr: 'Entrez la clé de votre dictionnaire',\n es: 'Ingrese la clave de su diccionario',\n }),\n },\n descriptionInput: {\n label: t({\n en: 'Description',\n fr: 'Description',\n es: 'Descripción',\n }),\n placeholder: t({\n en: 'Enter the description of your dictionary',\n fr: 'Entrez la description de votre dictionnaire',\n es: 'Ingrese la descripción de su diccionario',\n }),\n description: t({\n en: 'The description of your dictionary allows you to easily identify it using keywords. It is also used to search for your dictionary, and to assist the AI in understanding your dictionary.',\n fr: \"La description de votre dictionnaire permet d'identifier facilement l'utilisateur en utilisant des mots-clés. Elle est également utilisée pour rechercher votre dictionnaire et pour aider l'IA à comprendre votre dictionnaire.\",\n es: 'La descripción de su diccionario le permite identificar fácilmente el usuario utilizando palabras clave. También se utiliza para buscar su diccionario y para ayudar a la IA a entender su diccionario.',\n }),\n },\n\n projectInput: {\n label: t({\n en: 'Projects',\n fr: 'Projets',\n es: 'Proyectos',\n }),\n description: t({\n en: 'A dictionary can be associated with one or more projects. This allows you load the dictionary on different applications, and share it across different teams.',\n fr: 'Un dictionnaire peut être associé à un ou plusieurs projets. Cela permet de charger le dictionnaire sur différentes applications et de le partager entre différentes équipes.',\n es: 'Un diccionario puede estar asociado con uno o más proyectos. Esto permite cargar el diccionario en diferentes aplicaciones y compartirlo entre diferentes equipos.',\n }),\n placeholder: t({\n en: 'Select one or more projects to associate with your dictionary',\n fr: 'Sélectionnez un ou plusieurs projets à associer à votre dictionnaire',\n es: 'Seleccione uno o más proyectos para asociar con su diccionario',\n }),\n },\n\n saveButton: {\n text: t({\n en: 'Save changes',\n fr: 'Enregistrer les modifications',\n es: 'Guardar cambios',\n }),\n label: t({\n en: 'Click to save changes',\n fr: 'Cliquez pour enregistrer les modifications',\n es: 'Haga clic para guardar los cambios',\n }),\n },\n publishButton: {\n text: t({\n en: 'Publish dictionary',\n fr: 'Publier le dictionnaire',\n es: 'Publicar diccionario',\n }),\n label: t({\n en: 'Click to publish dictionary',\n fr: 'Cliquez pour publier le dictionnaire',\n es: 'Haga clic para publicar el diccionario',\n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,aAAaA,SAAAA,EAAE;AAAA,QACb,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,MACD,aAAaA,SAAAA,EAAE;AAAA,QACb,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MACL,CAAA;AAAA,IACH;AAAA,IAEA,YAAY;AAAA,MACV,MAAMA,SAAAA,EAAE;AAAA,QACN,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,MACD,OAAOA,SAAAA,EAAE;AAAA,QACP,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MACL,CAAA;AAAA,IACH;AAAA,IACA,eAAe;AAAA,MACb,MAAMA,SAAAA,EAAE;AAAA,QACN,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,MACD,OAAOA,SAAAA,EAAE;AAAA,QACP,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MACL,CAAA;AAAA,IAAA;AAAA,EACH;AAEJ;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"dictionaryDetails.content.mjs","sources":["../../../../src/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.tsx"],"sourcesContent":["import { t, type DeclarationContent } from 'intlayer';\n\nexport const dictionaryDetailsContent = {\n key: 'dictionary-details',\n content: {\n titleInput: {\n label: t({\n en: 'Title',\n fr: 'Titre',\n es: 'Título',\n }),\n description: t({\n en: 'The title of your dictionary allows you to easily identify it',\n fr: \"Le titre de votre dictionnaire permet de l'identifier facilement\",\n es: 'El título de su diccionario le permite identificar fácilmente',\n }),\n placeholder: t({\n en: 'Enter the title of your dictionary',\n fr: 'Entrez le titre de votre dictionnaire',\n es: 'Ingrese el título de su diccionario',\n }),\n },\n keyInput: {\n label: t({\n en: 'Key',\n fr: 'Clé',\n es: 'Clave',\n }),\n description: t({\n en: 'The key of your dictionary is used to identify it in the application',\n fr: \"La clé de votre dictionnaire est utilisée pour l'identifier dans l'application\",\n es: 'La clave de su diccionario se utiliza para identificarla en la aplicación',\n }),\n placeholder: t({\n en: 'Enter the key of your dictionary',\n fr: 'Entrez la clé de votre dictionnaire',\n es: 'Ingrese la clave de su diccionario',\n }),\n },\n descriptionInput: {\n label: t({\n en: 'Description',\n fr: 'Description',\n es: 'Descripción',\n }),\n placeholder: t({\n en: 'Enter the description of your dictionary',\n fr: 'Entrez la description de votre dictionnaire',\n es: 'Ingrese la descripción de su diccionario',\n }),\n description: t({\n en: 'The description of your dictionary allows you to easily identify it using keywords. It is also used to search for your dictionary, and to assist the AI in understanding your dictionary.',\n fr: \"La description de votre dictionnaire permet d'identifier facilement l'utilisateur en utilisant des mots-clés. Elle est également utilisée pour rechercher votre dictionnaire et pour aider l'IA à comprendre votre dictionnaire.\",\n es: 'La descripción de su diccionario le permite identificar fácilmente el usuario utilizando palabras clave. También se utiliza para buscar su diccionario y para ayudar a la IA a entender su diccionario.',\n }),\n },\n\n projectInput: {\n label: t({\n en: 'Projects',\n fr: 'Projets',\n es: 'Proyectos',\n }),\n description: t({\n en: 'A dictionary can be associated with one or more projects. This allows you load the dictionary on different applications, and share it across different teams.',\n fr: 'Un dictionnaire peut être associé à un ou plusieurs projets. Cela permet de charger le dictionnaire sur différentes applications et de le partager entre différentes équipes.',\n es: 'Un diccionario puede estar asociado con uno o más proyectos. Esto permite cargar el diccionario en diferentes aplicaciones y compartirlo entre diferentes equipos.',\n }),\n placeholder: t({\n en: 'Select one or more projects to associate with your dictionary',\n fr: 'Sélectionnez un ou plusieurs projets à associer à votre dictionnaire',\n es: 'Seleccione uno o más proyectos para asociar con su diccionario',\n }),\n },\n\n saveButton: {\n text: t({\n en: 'Save changes',\n fr: 'Enregistrer les modifications',\n es: 'Guardar cambios',\n }),\n label: t({\n en: 'Click to save changes',\n fr: 'Cliquez pour enregistrer les modifications',\n es: 'Haga clic para guardar los cambios',\n }),\n },\n publishButton: {\n text: t({\n en: 'Publish dictionary',\n fr: 'Publier le dictionnaire',\n es: 'Publicar diccionario',\n }),\n label: t({\n en: 'Click to publish dictionary',\n fr: 'Cliquez pour publier le dictionnaire',\n es: 'Haga clic para publicar el diccionario',\n }),\n },\n },\n} satisfies DeclarationContent;\n"],"names":[],"mappings":";AAEO,MAAM,2BAA2B;AAAA,EACtC,KAAK;AAAA,EACL,SAAS;AAAA,IACP,YAAY;AAAA,MACV,OAAO,EAAE;AAAA,QACP,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,MACD,aAAa,EAAE;AAAA,QACb,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,MACD,aAAa,EAAE;AAAA,QACb,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,IACH;AAAA,IACA,UAAU;AAAA,MACR,OAAO,EAAE;AAAA,QACP,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,MACD,aAAa,EAAE;AAAA,QACb,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,MACD,aAAa,EAAE;AAAA,QACb,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,IACH;AAAA,IACA,kBAAkB;AAAA,MAChB,OAAO,EAAE;AAAA,QACP,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,MACD,aAAa,EAAE;AAAA,QACb,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,MACD,aAAa,EAAE;AAAA,QACb,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,IACH;AAAA,IAEA,cAAc;AAAA,MACZ,OAAO,EAAE;AAAA,QACP,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,MACD,aAAa,EAAE;AAAA,QACb,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,MACD,aAAa,EAAE;AAAA,QACb,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,IACH;AAAA,IAEA,YAAY;AAAA,MACV,MAAM,EAAE;AAAA,QACN,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,MACD,OAAO,EAAE;AAAA,QACP,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,IACH;AAAA,IACA,eAAe;AAAA,MACb,MAAM,EAAE;AAAA,QACN,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,MACD,OAAO,EAAE;AAAA,QACP,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,IACH;AAAA,EACF;AACF;"}
1
+ {"version":3,"file":"dictionaryDetails.content.mjs","sources":["../../../../src/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.tsx"],"sourcesContent":["import { t, type DeclarationContent } from 'intlayer';\n\nexport const dictionaryDetailsContent = {\n key: 'dictionary-details',\n content: {\n titleInput: {\n label: t({\n en: 'Title',\n fr: 'Titre',\n es: 'Título',\n }),\n description: t({\n en: 'The title of your dictionary allows you to easily identify it',\n fr: \"Le titre de votre dictionnaire permet de l'identifier facilement\",\n es: 'El título de su diccionario le permite identificar fácilmente',\n }),\n placeholder: t({\n en: 'Enter the title of your dictionary',\n fr: 'Entrez le titre de votre dictionnaire',\n es: 'Ingrese el título de su diccionario',\n }),\n },\n keyInput: {\n label: t({\n en: 'Key',\n fr: 'Clé',\n es: 'Clave',\n }),\n description: t({\n en: 'The key of your dictionary is used to identify it in the application',\n fr: \"La clé de votre dictionnaire est utilisée pour l'identifier dans l'application\",\n es: 'La clave de su diccionario se utiliza para identificarla en la aplicación',\n }),\n placeholder: t({\n en: 'Enter the key of your dictionary',\n fr: 'Entrez la clé de votre dictionnaire',\n es: 'Ingrese la clave de su diccionario',\n }),\n },\n descriptionInput: {\n label: t({\n en: 'Description',\n fr: 'Description',\n es: 'Descripción',\n }),\n placeholder: t({\n en: 'Enter the description of your dictionary',\n fr: 'Entrez la description de votre dictionnaire',\n es: 'Ingrese la descripción de su diccionario',\n }),\n description: t({\n en: 'The description of your dictionary allows you to easily identify it using keywords. It is also used to search for your dictionary, and to assist the AI in understanding your dictionary.',\n fr: \"La description de votre dictionnaire permet d'identifier facilement l'utilisateur en utilisant des mots-clés. Elle est également utilisée pour rechercher votre dictionnaire et pour aider l'IA à comprendre votre dictionnaire.\",\n es: 'La descripción de su diccionario le permite identificar fácilmente el usuario utilizando palabras clave. También se utiliza para buscar su diccionario y para ayudar a la IA a entender su diccionario.',\n }),\n },\n\n projectInput: {\n label: t({\n en: 'Projects',\n fr: 'Projets',\n es: 'Proyectos',\n }),\n description: t({\n en: 'A dictionary can be associated with one or more projects. This allows you load the dictionary on different applications, and share it across different teams.',\n fr: 'Un dictionnaire peut être associé à un ou plusieurs projets. Cela permet de charger le dictionnaire sur différentes applications et de le partager entre différentes équipes.',\n es: 'Un diccionario puede estar asociado con uno o más proyectos. Esto permite cargar el diccionario en diferentes aplicaciones y compartirlo entre diferentes equipos.',\n }),\n placeholder: t({\n en: 'Select one or more projects to associate with your dictionary',\n fr: 'Sélectionnez un ou plusieurs projets à associer à votre dictionnaire',\n es: 'Seleccione uno o más proyectos para asociar con su diccionario',\n }),\n },\n\n saveButton: {\n text: t({\n en: 'Save changes',\n fr: 'Enregistrer les modifications',\n es: 'Guardar cambios',\n }),\n label: t({\n en: 'Click to save changes',\n fr: 'Cliquez pour enregistrer les modifications',\n es: 'Haga clic para guardar los cambios',\n }),\n },\n publishButton: {\n text: t({\n en: 'Publish dictionary',\n fr: 'Publier le dictionnaire',\n es: 'Publicar diccionario',\n }),\n label: t({\n en: 'Click to publish dictionary',\n fr: 'Cliquez pour publier le dictionnaire',\n es: 'Haga clic para publicar el diccionario',\n }),\n },\n },\n} satisfies DeclarationContent;\n"],"names":[],"mappings":";AAEO,MAAM,2BAA2B;AAAA,EACtC,KAAK;AAAA,EACL,SAAS;AAAA,IACP,YAAY;AAAA,MACV,OAAO,EAAE;AAAA,QACP,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,MACD,aAAa,EAAE;AAAA,QACb,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,MACD,aAAa,EAAE;AAAA,QACb,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MACL,CAAA;AAAA,IACH;AAAA,IACA,UAAU;AAAA,MACR,OAAO,EAAE;AAAA,QACP,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,MACD,aAAa,EAAE;AAAA,QACb,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,MACD,aAAa,EAAE;AAAA,QACb,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MACL,CAAA;AAAA,IACH;AAAA,IACA,kBAAkB;AAAA,MAChB,OAAO,EAAE;AAAA,QACP,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,MACD,aAAa,EAAE;AAAA,QACb,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,MACD,aAAa,EAAE;AAAA,QACb,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MACL,CAAA;AAAA,IACH;AAAA,IAEA,cAAc;AAAA,MACZ,OAAO,EAAE;AAAA,QACP,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,MACD,aAAa,EAAE;AAAA,QACb,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,MACD,aAAa,EAAE;AAAA,QACb,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MACL,CAAA;AAAA,IACH;AAAA,IAEA,YAAY;AAAA,MACV,MAAM,EAAE;AAAA,QACN,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,MACD,OAAO,EAAE;AAAA,QACP,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MACL,CAAA;AAAA,IACH;AAAA,IACA,eAAe;AAAA,MACb,MAAM,EAAE;AAAA,QACN,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA,CACL;AAAA,MACD,OAAO,EAAE;AAAA,QACP,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MACL,CAAA;AAAA,IAAA;AAAA,EACH;AAEJ;"}
@@ -1 +1 @@
1
- {"version":3,"file":"DictionaryFieldEditor.cjs","sources":["../../../src/components/DictionaryFieldEditor/DictionaryFieldEditor.tsx"],"sourcesContent":["'use client';\n\nimport { Dictionary } from '@intlayer/core';\nimport { ArrowLeft } from 'lucide-react';\nimport { useEffect, useState, type FC } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { useShallow } from 'zustand/react/shallow';\nimport { Button } from '../Button';\nimport { Container } from '../Container';\nimport { useEditedContentStore } from '../DictionaryEditor';\nimport { H2 } from '../Headers';\nimport { SwitchSelector } from '../SwitchSelector';\nimport { DictionaryDetailsForm } from './DictionaryDetails/DictionaryDetailsForm';\nimport { dictionaryFieldEditorContent } from './dictionaryFieldEditor.content';\nimport { JSONEditor } from './JSONEditor';\nimport { NodeEditor } from './NodeEditor';\n\ntype DictionaryFieldEditorProps = {\n dictionary: Dictionary;\n onClickDictionaryList?: () => void;\n};\n\nenum EditorViewType {\n NodeEditor,\n JSONEditor,\n}\n\nexport const DictionaryFieldEditor: FC<DictionaryFieldEditorProps> = ({\n dictionary,\n onClickDictionaryList,\n}) => {\n const { key } = dictionary;\n const [editorView, setEditorView] = useState<EditorViewType>(\n EditorViewType.NodeEditor\n );\n const { dictionaryRecord, setDictionariesRecord } = useEditedContentStore(\n useShallow((s) => ({\n editedContent: s.editedContent,\n dictionaryRecord: s.dictionariesRecord,\n setDictionariesRecord: s.setDictionariesRecord,\n }))\n );\n const { returnToDictionaryList, titleContent, titleInformation } =\n useDictionary(dictionaryFieldEditorContent);\n\n useEffect(() => {\n if (dictionaryRecord[key]) return;\n\n setDictionariesRecord({\n [key]: dictionary,\n });\n }, [dictionary, key, setDictionariesRecord, dictionaryRecord]);\n\n return (\n <div className=\"flex size-full flex-1 flex-col gap-10\">\n <div className=\"flex items-center gap-2\">\n <Button\n onClick={() => onClickDictionaryList?.()}\n variant=\"hoverable\"\n size=\"icon-md\"\n color=\"text\"\n id=\"return-to-dictionary-list\"\n Icon={ArrowLeft}\n label={returnToDictionaryList.label.value}\n />\n <label\n className=\"cursor-pointer text-xs hover:underline\"\n htmlFor=\"return-to-dictionary-list\"\n >\n {returnToDictionaryList.text}\n </label>\n </div>\n\n <Container\n className=\"flex size-full justify-center gap-10 p-6\"\n roundedSize=\"xl\"\n >\n <H2>{titleInformation}</H2>\n\n <DictionaryDetailsForm dictionary={dictionary} />\n </Container>\n\n <Container\n className=\"flex size-full justify-center gap-10 p-6\"\n roundedSize=\"xl\"\n >\n <H2>{titleContent}</H2>\n <SwitchSelector\n defaultValue={editorView}\n onChange={(value) => setEditorView(value)}\n color=\"text\"\n size=\"sm\"\n className=\"ml-auto\"\n choices={[\n {\n content: 'Node editor',\n value: EditorViewType.NodeEditor,\n },\n {\n content: 'JSON editor',\n value: EditorViewType.JSONEditor,\n },\n ]}\n />\n {editorView === EditorViewType.NodeEditor && (\n <NodeEditor dictionary={dictionary} />\n )}\n {editorView === EditorViewType.JSONEditor && (\n <JSONEditor dictionary={dictionary} />\n )}\n </Container>\n </div>\n );\n};\n"],"names":["useState","useEditedContentStore","useShallow","useDictionary","dictionaryFieldEditorContent","useEffect","jsxs","jsx","Button","ArrowLeft","Container","H2","DictionaryDetailsForm","SwitchSelector","NodeEditor","JSONEditor"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BO,MAAM,wBAAwD,CAAC;AAAA,EACpE;AAAA,EACA;AACF,MAAM;AACE,QAAA,EAAE,IAAQ,IAAA;AACV,QAAA,CAAC,YAAY,aAAa,IAAIA,WAAA;AAAA,IAClC;AAAA;AAAA,EAAA;AAEI,QAAA,EAAE,kBAAkB,sBAAA,IAA0BC,kDAAA;AAAA,IAClDC,QAAA,WAAW,CAAC,OAAO;AAAA,MACjB,eAAe,EAAE;AAAA,MACjB,kBAAkB,EAAE;AAAA,MACpB,uBAAuB,EAAE;AAAA,IAAA,EACzB;AAAA,EAAA;AAEJ,QAAM,EAAE,wBAAwB,cAAc,iBAAiB,IAC7DC,cAAAA,cAAcC,+DAAAA,4BAA4B;AAE5CC,aAAAA,UAAU,MAAM;AACV,QAAA,iBAAiB,GAAG,EAAG;AAEL,0BAAA;AAAA,MACpB,CAAC,GAAG,GAAG;AAAA,IAAA,CACR;AAAA,KACA,CAAC,YAAY,KAAK,uBAAuB,gBAAgB,CAAC;AAG3D,SAAAC,2BAAA,kBAAA,KAAC,OAAI,EAAA,WAAU,yCACb,UAAA;AAAA,IAACA,2BAAAA,kBAAAA,KAAA,OAAA,EAAI,WAAU,2BACb,UAAA;AAAA,MAAAC,2BAAA,kBAAA;AAAA,QAACC,yBAAA;AAAA,QAAA;AAAA,UACC,SAAS,MAAM,wBAAwB;AAAA,UACvC,SAAQ;AAAA,UACR,MAAK;AAAA,UACL,OAAM;AAAA,UACN,IAAG;AAAA,UACH,MAAMC,YAAA;AAAA,UACN,OAAO,uBAAuB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ditor.cjs","sources":["../../../src/components/DictionaryFieldEditor/DictionaryFieldEditor.tsx"],"sourcesContent":["'use client';\n\nimport { Dictionary } from '@intlayer/core';\nimport { ArrowLeft } from 'lucide-react';\nimport { useEffect, useState, type FC } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { useShallow } from 'zustand/react/shallow';\nimport { Button } from '../Button';\nimport { Container } from '../Container';\nimport { useEditedContentStore } from '../DictionaryEditor';\nimport { H2 } from '../Headers';\nimport { SwitchSelector } from '../SwitchSelector';\nimport { DictionaryDetailsForm } from './DictionaryDetails/DictionaryDetailsForm';\nimport { dictionaryFieldEditorContent } from './dictionaryFieldEditor.content';\nimport { JSONEditor } from './JSONEditor';\nimport { NodeEditor } from './NodeEditor';\n\ntype DictionaryFieldEditorProps = {\n dictionary: Dictionary;\n onClickDictionaryList?: () => void;\n};\n\nenum EditorViewType {\n NodeEditor,\n JSONEditor,\n}\n\nexport const DictionaryFieldEditor: FC<DictionaryFieldEditorProps> = ({\n dictionary,\n onClickDictionaryList,\n}) => {\n const { key } = dictionary;\n const [editorView, setEditorView] = useState<EditorViewType>(\n EditorViewType.NodeEditor\n );\n const { dictionaryRecord, setDictionariesRecord } = useEditedContentStore(\n useShallow((s) => ({\n editedContent: s.editedContent,\n dictionaryRecord: s.dictionariesRecord,\n setDictionariesRecord: s.setDictionariesRecord,\n }))\n );\n const { returnToDictionaryList, titleContent, titleInformation } =\n useDictionary(dictionaryFieldEditorContent);\n\n useEffect(() => {\n if (dictionaryRecord[key]) return;\n\n setDictionariesRecord({\n [key]: dictionary,\n });\n }, [dictionary, key, setDictionariesRecord, dictionaryRecord]);\n\n return (\n <div className=\"flex size-full flex-1 flex-col gap-10\">\n <div className=\"flex items-center gap-2\">\n <Button\n onClick={() => onClickDictionaryList?.()}\n variant=\"hoverable\"\n size=\"icon-md\"\n color=\"text\"\n id=\"return-to-dictionary-list\"\n Icon={ArrowLeft}\n label={returnToDictionaryList.label.value}\n />\n <label\n className=\"cursor-pointer text-xs hover:underline\"\n htmlFor=\"return-to-dictionary-list\"\n >\n {returnToDictionaryList.text}\n </label>\n </div>\n\n <Container\n className=\"flex size-full justify-center gap-10 p-6\"\n roundedSize=\"xl\"\n >\n <H2>{titleInformation}</H2>\n\n <DictionaryDetailsForm dictionary={dictionary} />\n </Container>\n\n <Container\n className=\"flex size-full justify-center gap-10 p-6\"\n roundedSize=\"xl\"\n >\n <H2>{titleContent}</H2>\n <SwitchSelector\n defaultValue={editorView}\n onChange={(value) => setEditorView(value)}\n color=\"text\"\n size=\"sm\"\n className=\"ml-auto\"\n choices={[\n {\n content: 'Node editor',\n value: EditorViewType.NodeEditor,\n },\n {\n content: 'JSON editor',\n value: EditorViewType.JSONEditor,\n },\n ]}\n />\n {editorView === EditorViewType.NodeEditor && (\n <NodeEditor dictionary={dictionary} />\n )}\n {editorView === EditorViewType.JSONEditor && (\n <JSONEditor dictionary={dictionary} />\n )}\n </Container>\n </div>\n );\n};\n"],"names":["useState","useEditedContentStore","useShallow","useDictionary","dictionaryFieldEditorContent","useEffect","jsxs","jsx","Button","ArrowLeft","Container","H2","DictionaryDetailsForm","SwitchSelector","NodeEditor","JSONEditor"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BO,MAAM,wBAAwD,CAAC;AAAA,EACpE;AAAA,EACA;AACF,MAAM;AACE,QAAA,EAAE,QAAQ;AACV,QAAA,CAAC,YAAY,aAAa,IAAIA,WAAA;AAAA,IAClC;AAAA;AAAA,EACF;AACM,QAAA,EAAE,kBAAkB,sBAAA,IAA0BC,kDAAA;AAAA,IAClDC,QAAA,WAAW,CAAC,OAAO;AAAA,MACjB,eAAe,EAAE;AAAA,MACjB,kBAAkB,EAAE;AAAA,MACpB,uBAAuB,EAAE;AAAA,IAAA,EACzB;AAAA,EACJ;AACA,QAAM,EAAE,wBAAwB,cAAc,iBAAiB,IAC7DC,cAAAA,cAAcC,+DAAAA,4BAA4B;AAE5CC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AAc,KAAK;AAAA,cACxC,OAAM;AAAA,cACN,MAAK;AAAA,cACL,WAAU;AAAA,cACV,SAAS;AAAA,gBACP;AAAA,kBACE,SAAS;AAAA,kBACT,OAAO;AAAA;AAAA,gBACT;AAAA,gBACA;AAAA,kBACE,SAAS;AAAA,kBACT,OAAO;AAAA;AAAA,gBAAA;AAAA,cACT;AAAA,YACF;AAAA,UACF;AAAA,UACC,eAAe,KACbN,2BAAAA,kBAAAA,IAAAO,4CAAAA,YAAA,EAAW,WAAwB,CAAA;AAAA,UAErC,eAAe,KACbP,2BAAAA,kBAAAA,IAAAQ,4CAAA,YAAA,EAAW,WAAwB,CAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAExC,GACF;AAEJ;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"DictionaryFieldEditor.mjs","sources":["../../../src/components/DictionaryFieldEditor/DictionaryFieldEditor.tsx"],"sourcesContent":["'use client';\n\nimport { Dictionary } from '@intlayer/core';\nimport { ArrowLeft } from 'lucide-react';\nimport { useEffect, useState, type FC } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { useShallow } from 'zustand/react/shallow';\nimport { Button } from '../Button';\nimport { Container } from '../Container';\nimport { useEditedContentStore } from '../DictionaryEditor';\nimport { H2 } from '../Headers';\nimport { SwitchSelector } from '../SwitchSelector';\nimport { DictionaryDetailsForm } from './DictionaryDetails/DictionaryDetailsForm';\nimport { dictionaryFieldEditorContent } from './dictionaryFieldEditor.content';\nimport { JSONEditor } from './JSONEditor';\nimport { NodeEditor } from './NodeEditor';\n\ntype DictionaryFieldEditorProps = {\n dictionary: Dictionary;\n onClickDictionaryList?: () => void;\n};\n\nenum EditorViewType {\n NodeEditor,\n JSONEditor,\n}\n\nexport const DictionaryFieldEditor: FC<DictionaryFieldEditorProps> = ({\n dictionary,\n onClickDictionaryList,\n}) => {\n const { key } = dictionary;\n const [editorView, setEditorView] = useState<EditorViewType>(\n EditorViewType.NodeEditor\n );\n const { dictionaryRecord, setDictionariesRecord } = useEditedContentStore(\n useShallow((s) => ({\n editedContent: s.editedContent,\n dictionaryRecord: s.dictionariesRecord,\n setDictionariesRecord: s.setDictionariesRecord,\n }))\n );\n const { returnToDictionaryList, titleContent, titleInformation } =\n useDictionary(dictionaryFieldEditorContent);\n\n useEffect(() => {\n if (dictionaryRecord[key]) return;\n\n setDictionariesRecord({\n [key]: dictionary,\n });\n }, [dictionary, key, setDictionariesRecord, dictionaryRecord]);\n\n return (\n <div className=\"flex size-full flex-1 flex-col gap-10\">\n <div className=\"flex items-center gap-2\">\n <Button\n onClick={() => onClickDictionaryList?.()}\n variant=\"hoverable\"\n size=\"icon-md\"\n color=\"text\"\n id=\"return-to-dictionary-list\"\n Icon={ArrowLeft}\n label={returnToDictionaryList.label.value}\n />\n <label\n className=\"cursor-pointer text-xs hover:underline\"\n htmlFor=\"return-to-dictionary-list\"\n >\n {returnToDictionaryList.text}\n </label>\n </div>\n\n <Container\n className=\"flex size-full justify-center gap-10 p-6\"\n roundedSize=\"xl\"\n >\n <H2>{titleInformation}</H2>\n\n <DictionaryDetailsForm dictionary={dictionary} />\n </Container>\n\n <Container\n className=\"flex size-full justify-center gap-10 p-6\"\n roundedSize=\"xl\"\n >\n <H2>{titleContent}</H2>\n <SwitchSelector\n defaultValue={editorView}\n onChange={(value) => setEditorView(value)}\n color=\"text\"\n size=\"sm\"\n className=\"ml-auto\"\n choices={[\n {\n content: 'Node editor',\n value: EditorViewType.NodeEditor,\n },\n {\n content: 'JSON editor',\n value: EditorViewType.JSONEditor,\n },\n ]}\n />\n {editorView === EditorViewType.NodeEditor && (\n <NodeEditor dictionary={dictionary} />\n )}\n {editorView === EditorViewType.JSONEditor && (\n <JSONEditor dictionary={dictionary} />\n )}\n </Container>\n </div>\n );\n};\n"],"names":["jsxs","jsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BO,MAAM,wBAAwD,CAAC;AAAA,EAC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A,IAEAD,kCAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,WAAU;AAAA,QACV,aAAY;AAAA,QAEZ,UAAA;AAAA,UAAAC,kCAAAA,IAAC,MAAI,UAAa,aAAA,CAAA;AAAA,UAClBA,kCAAA;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,cAAc;AAAA,cACd,UAAU,CAAC,UAAU,cAAc,KAAK;AAAA,cACxC,OAAM;AAAA,cACN,MAAK;AAAA,cACL,WAAU;AAAA,cACV,SAAS;AAAA,gBACP;AAAA,kBACE,SAAS;AAAA,kBACT,OAAO;AAAA;AAAA,gBACT;AAAA,gBACA;AAAA,kBACE,SAAS;AAAA,kBACT,OAAO;AAAA;AAAA,gBACT;AAAA,cACF;AAAA,YAAA;AAAA,UACF;AAAA,UACC,eAAe,KACbA,kCAAAA,IAAA,YAAA,EAAW,WAAwB,CAAA;AAAA,UAErC,eAAe,KACbA,kCAAAA,IAAA,YAAA,EAAW,WAAwB,CAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IAExC;AAAA,EACF,EAAA,CAAA;AAEJ;"}
1
+ {"version":3,"file":"DictionaryFieldEditor.mjs","sources":["../../../src/components/DictionaryFieldEditor/DictionaryFieldEditor.tsx"],"sourcesContent":["'use client';\n\nimport { Dictionary } from '@intlayer/core';\nimport { ArrowLeft } from 'lucide-react';\nimport { useEffect, useState, type FC } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { useShallow } from 'zustand/react/shallow';\nimport { Button } from '../Button';\nimport { Container } from '../Container';\nimport { useEditedContentStore } from '../DictionaryEditor';\nimport { H2 } from '../Headers';\nimport { SwitchSelector } from '../SwitchSelector';\nimport { DictionaryDetailsForm } from './DictionaryDetails/DictionaryDetailsForm';\nimport { dictionaryFieldEditorContent } from './dictionaryFieldEditor.content';\nimport { JSONEditor } from './JSONEditor';\nimport { NodeEditor } from './NodeEditor';\n\ntype DictionaryFieldEditorProps = {\n dictionary: Dictionary;\n onClickDictionaryList?: () => void;\n};\n\nenum EditorViewType {\n NodeEditor,\n JSONEditor,\n}\n\nexport const DictionaryFieldEditor: FC<DictionaryFieldEditorProps> = ({\n dictionary,\n onClickDictionaryList,\n}) => {\n const { key } = dictionary;\n const [editorView, setEditorView] = useState<EditorViewType>(\n EditorViewType.NodeEditor\n );\n const { dictionaryRecord, setDictionariesRecord } = useEditedContentStore(\n useShallow((s) => ({\n editedContent: s.editedContent,\n dictionaryRecord: s.dictionariesRecord,\n setDictionariesRecord: s.setDictionariesRecord,\n }))\n );\n const { returnToDictionaryList, titleContent, titleInformation } =\n useDictionary(dictionaryFieldEditorContent);\n\n useEffect(() => {\n if (dictionaryRecord[key]) return;\n\n setDictionariesRecord({\n [key]: dictionary,\n });\n }, [dictionary, key, setDictionariesRecord, dictionaryRecord]);\n\n return (\n <div className=\"flex size-full flex-1 flex-col gap-10\">\n <div className=\"flex items-center gap-2\">\n <Button\n onClick={() => onClickDictionaryList?.()}\n variant=\"hoverable\"\n size=\"icon-md\"\n color=\"text\"\n id=\"return-to-dictionary-list\"\n Icon={ArrowLeft}\n label={returnToDictionaryList.label.value}\n />\n <label\n className=\"cursor-pointer text-xs hover:underline\"\n htmlFor=\"return-to-dictionary-list\"\n >\n {returnToDictionaryList.text}\n </label>\n </div>\n\n <Container\n className=\"flex size-full justify-center gap-10 p-6\"\n roundedSize=\"xl\"\n >\n <H2>{titleInformation}</H2>\n\n <DictionaryDetailsForm dictionary={dictionary} />\n </Container>\n\n <Container\n className=\"flex size-full justify-center gap-10 p-6\"\n roundedSize=\"xl\"\n >\n <H2>{titleContent}</H2>\n <SwitchSelector\n defaultValue={editorView}\n onChange={(value) => setEditorView(value)}\n color=\"text\"\n size=\"sm\"\n className=\"ml-auto\"\n choices={[\n {\n content: 'Node editor',\n value: EditorViewType.NodeEditor,\n },\n {\n content: 'JSON editor',\n value: EditorViewType.JSONEditor,\n },\n ]}\n />\n {editorView === EditorViewType.NodeEditor && (\n <NodeEditor dictionary={dictionary} />\n )}\n {editorView === EditorViewType.JSONEditor && (\n <JSONEditor dictionary={dictionary} />\n )}\n </Container>\n </div>\n );\n};\n"],"names":["jsxs","jsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BO,MAAM,wBAAwD,CAAC;AAAA,EACpE;AAAA,EACA;AACF,MAAM;AACE,QAAA,EAAE,QAAQ;AACV,QAAA,CAAC,YAAY,aAAa,IAAI;AAAA,IAClC;AAAA;AAAA,EACF;AACM,QAAA,EAAE,kBAAkB,sBAAA,IAA0B;AAAA,IAClD,WAAW,CAAC,OAAO;AAAA,MACjB,eAAe,EAAE;AAAA,MACjB,kBAAkB,EAAE;AAAA,MACpB,uBAAuB,EAAE;AAAA,IAAA,EACzB;AAAA,EACJ;AACA,QAAM,EAAE,wBAAwB,cAAc,iBAAiB,IAC7D,cAAc,4BAA4B;AAE5C,YAAU,MAAM;AACV,QAAA,iBAAiB,GAAG,EAAG;AAEL,0BAAA;AAAA,MACpB,CAAC,GAAG,GAAG;AAAA,IAAA,CACR;AAAA,KACA,CAAC,YAAY,KAAK,uBAAuB,gBAAgB,CAAC;AAG3D,SAAAA,kCAAA,KAAC,OAAI,EAAA,WAAU,yCACb,UAAA;AAAA,IAACA,kCAAAA,KAAA,OAAA,EAAI,WAAU,2BACb,UAAA;AAAA,MAAAC,kCAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,SAAS,MAAM,wBAAwB;AAAA,UACvC,SAAQ;AAAA,UACR,MAAK;AAAA,UACL,OAAM;AAAA,UACN,IAAG;AAAA,UACH,MAAM;AAAA,UACN,OAAO,uBAAuB,MAAM;AAAA,QAAA;AAAA,MACtC;AAAA,MACAA,kCAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,WAAU;AAAA,UACV,SAAQ;AAAA,UAEP,UAAuB,uBAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IAC1B,GACF;AAAA,IAEAD,kCAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,WAAU;AAAA,QACV,aAAY;AAAA,QAEZ,UAAA;AAAA,UAAAC,kCAAAA,IAAC,MAAI,UAAiB,iBAAA,CAAA;AAAA,UAEtBA,sCAAC,yBAAsB,WAAwB,CAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IACjD;AAAA,IAEAD,kCAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,WAAU;AAAA,QACV,aAAY;AAAA,QAEZ,UAAA;AAAA,UAAAC,kCAAAA,IAAC,MAAI,UAAa,aAAA,CAAA;AAAA,UAClBA,kCAAA;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,cAAc;AAAA,cACd,UAAU,CAAC,UAAU,cAAc,KAAK;AAAA,cACxC,OAAM;AAAA,cACN,MAAK;AAAA,cACL,WAAU;AAAA,cACV,SAAS;AAAA,gBACP;AAAA,kBACE,SAAS;AAAA,kBACT,OAAO;AAAA;AAAA,gBACT;AAAA,gBACA;AAAA,kBACE,SAAS;AAAA,kBACT,OAAO;AAAA;AAAA,gBAAA;AAAA,cACT;AAAA,YACF;AAAA,UACF;AAAA,UACC,eAAe,KACbA,kCAAAA,IAAA,YAAA,EAAW,WAAwB,CAAA;AAAA,UAErC,eAAe,KACbA,kCAAAA,IAAA,YAAA,EAAW,WAAwB,CAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAExC,GACF;AAEJ;"}
@@ -1 +1 @@
1
- {"version":3,"file":"EditorView.cjs","sources":["../../../../src/components/DictionaryFieldEditor/EditorView/EditorView.tsx"],"sourcesContent":["'use client';\n\nimport { type KeyPath, type Dictionary } from '@intlayer/core';\nimport { RotateCcw, X } from 'lucide-react';\nimport { useMemo, type FC } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { useShallow } from 'zustand/react/shallow';\nimport { EditableFieldInput } from '../..//EditableField';\nimport {\n camelCaseToSentence,\n sentenceToCamelCase,\n} from '../../../utils/camelCase';\nimport { getDictionaryValueByKeyPath } from '../../../utils/dictionary';\nimport { Button } from '../../Button';\nimport {\n useEditedContentStore,\n useEditionPanelStore,\n} from '../../DictionaryEditor';\nimport { Label } from '../../Label';\nimport { editorViewContent } from '../editorView.content';\nimport { getIsEditableSection } from '../getIsEditableSection';\nimport { NodeTypeSelector } from '../NodeTypeSelector';\nimport { TextEditor } from './TextEditor';\n\ntype EditorViewProps = {\n dictionaryKey: string;\n dictionary: Dictionary;\n};\n\nexport const EditorView: FC<EditorViewProps> = ({\n dictionaryKey,\n dictionary,\n}) => {\n const { focusedContent, setFocusedContentKeyPath } = useEditionPanelStore(\n useShallow((s) => ({\n setFocusedContentKeyPath: s.setFocusedContentKeyPath,\n focusedContent: s.focusedContent,\n }))\n );\n const keyPath = focusedContent?.keyPath ?? [];\n const initialKeyName = keyPath[keyPath.length - 1]?.key ?? '';\n const { titleInput, deleteButton, nodeTypeSelector, restoreButton } =\n useDictionary(editorViewContent);\n\n const {\n editedContent,\n renameEditedContent,\n addEditedContent,\n removeEditedContent,\n } = useEditedContentStore(\n useShallow((s) => ({\n editedContent: s.editedContent,\n renameEditedContent: s.renameEditedContent,\n addEditedContent: s.addEditedContent,\n removeEditedContent: s.removeEditedContent,\n }))\n );\n\n const editedSection = editedContent[dictionaryKey]?.content\n ? getDictionaryValueByKeyPath(editedContent[dictionaryKey].content, keyPath)\n : undefined;\n\n const dictionarySection = getDictionaryValueByKeyPath(\n dictionary.content,\n keyPath\n );\n\n const section = editedSection ?? dictionarySection;\n\n const isEdited = useMemo(\n () =>\n editedSection &&\n JSON.stringify(editedSection) !== JSON.stringify(dictionarySection),\n [editedSection, dictionarySection]\n );\n\n const isEditableSection = getIsEditableSection(section);\n\n const handleRenameNodeKey = (keyName: string) => {\n const camelCaseSentence = sentenceToCamelCase(keyName);\n renameEditedContent(dictionaryKey, camelCaseSentence, keyPath);\n const prevKeyPath: KeyPath[] = keyPath.slice(0, -1);\n const lastKeyPath: KeyPath = keyPath[keyPath.length - 1];\n const newKeyPath: KeyPath[] = [\n ...prevKeyPath,\n { ...lastKeyPath, key: camelCaseSentence } as KeyPath,\n ];\n setFocusedContentKeyPath(newKeyPath);\n };\n\n return (\n <>\n {isEditableSection && (\n <TextEditor\n key={keyPath.join('.')}\n keyPath={keyPath}\n section={section}\n dictionaryKey={dictionaryKey}\n />\n )}\n\n {keyPath.length > 0 ? (\n <form\n className=\"bg-text text-text-dark dark:bg-text-dark dark:text-text flex w-full flex-col items-start justify-between gap-6 px-4 py-2\"\n key={JSON.stringify(focusedContent?.keyPath)}\n >\n <div className=\"flex w-full flex-wrap items-start justify-between gap-6\">\n {typeof initialKeyName === 'string' && (\n <div className=\"flex flex-col gap-3\">\n <Label>{titleInput.label}</Label>\n <div className=\"flex flex-wrap items-center gap-4\">\n <EditableFieldInput\n name=\"key\"\n aria-label=\"Key\"\n key={initialKeyName}\n placeholder={titleInput.placeholder.value}\n defaultValue={camelCaseToSentence(initialKeyName)}\n onSave={(value) => handleRenameNodeKey(value)}\n className=\"h-8\"\n variant=\"invisible\"\n />\n <span className=\"text-neutral dark:text-neutral-dark text-sm\">\n ({initialKeyName})\n </span>\n </div>\n </div>\n )}\n\n <div>\n <Label>{nodeTypeSelector.label}</Label>\n\n <NodeTypeSelector\n keyPath={keyPath}\n dictionaryKey={dictionaryKey}\n section={section}\n />\n </div>\n </div>\n {keyPath.length > 0 && (\n <div className=\"ml-auto flex gap-2\">\n {isEdited && (\n <Button\n label={restoreButton.label.value}\n variant=\"outline\"\n color=\"text-inverse\"\n Icon={RotateCcw}\n onClick={() => removeEditedContent(dictionaryKey, keyPath)}\n >\n {restoreButton.text}\n </Button>\n )}\n <Button\n label={deleteButton.label.value}\n variant=\"outline\"\n color=\"error\"\n Icon={X}\n onClick={() => {\n addEditedContent(dictionaryKey, undefined, keyPath);\n\n const parentKeyPath: KeyPath[] = keyPath.slice(0, -1);\n setFocusedContentKeyPath(parentKeyPath);\n }}\n >\n {deleteButton.text}\n </Button>\n </div>\n )}\n </form>\n ) : (\n <span className=\"h-8\"></span>\n )}\n </>\n );\n};\n"],"names":["useEditionPanelStore","useShallow","useDictionary","editorViewContent","useEditedContentStore","getDictionaryValueByKeyPath","useMemo","getIsEditableSection","sentenceToCamelCase","jsxs","Fragment","jsx","TextEditor","Label","EditableFieldInput","camelCaseToSentence","NodeTypeSelector","Button","RotateCcw","X"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BO,MAAM,aAAkC,CAAC;AAAA,EAC9C;AAAA,EACA;AACF,MAAM;AACE,QAAA,EAAE,gBAAgB,yBAAA,IAA6BA,iDAAA;AAAA,IACnDC,QAAA,WAAW,CAAC,OAAO;AAAA,MACjB,0BAA0B,EAAE;AAAA,MAC5B,gBAAgB,EAAE;AAAA,IAAA,EAClB;AAAA,EAAA;AAEE,QAAA,UAAU,gBAAgB,WAAW;AAC3C,QAAM,iBAAiB,QAAQ,QAAQ,SAAS,CAAC,GAAG,OAAO;AAC3D,QAAM,EAAE,YAAY,cAAc,kBAAkB,kBAClDC,cAAAA,cAAcC,oDAAAA,iBAAiB;AAE3B,QAAA;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA,IACEC,kDAAA;AAAA,IACFH,QAAA,WAAW,CAAC,OAAO;AAAA,MACjB,eAAe,EAAE;AAAA,MACjB,qBAAqB,EAAE;AAAA,MACvB,kBAAkB,EAAE;AAAA,MACpB,qBAAqB,EAAE;AAAA,IAAA,EACvB;AAAA,EAAA;AAGE,QAAA,gBAAgB,cAAc,aAAa,GAAG,UAChDI,iBAA4B,4BAAA,cAAc,aAAa,EAAE,SAAS,OAAO,IACzE;AAEJ,QAAM,oBAAoBA,iBAAA;AAAA,IACxB,WAAW;AAAA,IACX;AAAA,EAAA;AAGF,QAAM,UAAU,iBAAiB;AAEjC,QAAM,WAAWC,WAAA;AAAA,IACf,MACE,iBACA,KAAK,UAAU,aAAa,MAAM,KAAK,UAAU,iBAAiB;AAAA,IACpE,CAAC,eAAe,iB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AiE7C,IAAAR,2BAAA,kBAAA,IAAC,QAAK,EAAA,WAAU,MAAM,CAAA;AAAA,EAE1B,EAAA,CAAA;AAEJ;;"}
1
+ {"version":3,"file":"EditorView.cjs","sources":["../../../../src/components/DictionaryFieldEditor/EditorView/EditorView.tsx"],"sourcesContent":["'use client';\n\nimport { type KeyPath, type Dictionary } from '@intlayer/core';\nimport { RotateCcw, X } from 'lucide-react';\nimport { useMemo, type FC } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { useShallow } from 'zustand/react/shallow';\nimport { EditableFieldInput } from '../..//EditableField';\nimport {\n camelCaseToSentence,\n sentenceToCamelCase,\n} from '../../../utils/camelCase';\nimport { getDictionaryValueByKeyPath } from '../../../utils/dictionary';\nimport { Button } from '../../Button';\nimport {\n useEditedContentStore,\n useEditionPanelStore,\n} from '../../DictionaryEditor';\nimport { Label } from '../../Label';\nimport { editorViewContent } from '../editorView.content';\nimport { getIsEditableSection } from '../getIsEditableSection';\nimport { NodeTypeSelector } from '../NodeTypeSelector';\nimport { TextEditor } from './TextEditor';\n\ntype EditorViewProps = {\n dictionaryKey: string;\n dictionary: Dictionary;\n};\n\nexport const EditorView: FC<EditorViewProps> = ({\n dictionaryKey,\n dictionary,\n}) => {\n const { focusedContent, setFocusedContentKeyPath } = useEditionPanelStore(\n useShallow((s) => ({\n setFocusedContentKeyPath: s.setFocusedContentKeyPath,\n focusedContent: s.focusedContent,\n }))\n );\n const keyPath = focusedContent?.keyPath ?? [];\n const initialKeyName = keyPath[keyPath.length - 1]?.key ?? '';\n const { titleInput, deleteButton, nodeTypeSelector, restoreButton } =\n useDictionary(editorViewContent);\n\n const {\n editedContent,\n renameEditedContent,\n addEditedContent,\n removeEditedContent,\n } = useEditedContentStore(\n useShallow((s) => ({\n editedContent: s.editedContent,\n renameEditedContent: s.renameEditedContent,\n addEditedContent: s.addEditedContent,\n removeEditedContent: s.removeEditedContent,\n }))\n );\n\n const editedSection = editedContent[dictionaryKey]?.content\n ? getDictionaryValueByKeyPath(editedContent[dictionaryKey].content, keyPath)\n : undefined;\n\n const dictionarySection = getDictionaryValueByKeyPath(\n dictionary.content,\n keyPath\n );\n\n const section = editedSection ?? dictionarySection;\n\n const isEdited = useMemo(\n () =>\n editedSection &&\n JSON.stringify(editedSection) !== JSON.stringify(dictionarySection),\n [editedSection, dictionarySection]\n );\n\n const isEditableSection = getIsEditableSection(section);\n\n const handleRenameNodeKey = (keyName: string) => {\n const camelCaseSentence = sentenceToCamelCase(keyName);\n renameEditedContent(dictionaryKey, camelCaseSentence, keyPath);\n const prevKeyPath: KeyPath[] = keyPath.slice(0, -1);\n const lastKeyPath: KeyPath = keyPath[keyPath.length - 1];\n const newKeyPath: KeyPath[] = [\n ...prevKeyPath,\n { ...lastKeyPath, key: camelCaseSentence } as KeyPath,\n ];\n setFocusedContentKeyPath(newKeyPath);\n };\n\n return (\n <>\n {isEditableSection && (\n <TextEditor\n key={keyPath.join('.')}\n keyPath={keyPath}\n section={section}\n dictionaryKey={dictionaryKey}\n />\n )}\n\n {keyPath.length > 0 ? (\n <form\n className=\"bg-text text-text-dark dark:bg-text-dark dark:text-text flex w-full flex-col items-start justify-between gap-6 px-4 py-2\"\n key={JSON.stringify(focusedContent?.keyPath)}\n >\n <div className=\"flex w-full flex-wrap items-start justify-between gap-6\">\n {typeof initialKeyName === 'string' && (\n <div className=\"flex flex-col gap-3\">\n <Label>{titleInput.label}</Label>\n <div className=\"flex flex-wrap items-center gap-4\">\n <EditableFieldInput\n name=\"key\"\n aria-label=\"Key\"\n key={initialKeyName}\n placeholder={titleInput.placeholder.value}\n defaultValue={camelCaseToSentence(initialKeyName)}\n onSave={(value) => handleRenameNodeKey(value)}\n className=\"h-8\"\n variant=\"invisible\"\n />\n <span className=\"text-neutral dark:text-neutral-dark text-sm\">\n ({initialKeyName})\n </span>\n </div>\n </div>\n )}\n\n <div>\n <Label>{nodeTypeSelector.label}</Label>\n\n <NodeTypeSelector\n keyPath={keyPath}\n dictionaryKey={dictionaryKey}\n section={section}\n />\n </div>\n </div>\n {keyPath.length > 0 && (\n <div className=\"ml-auto flex gap-2\">\n {isEdited && (\n <Button\n label={restoreButton.label.value}\n variant=\"outline\"\n color=\"text-inverse\"\n Icon={RotateCcw}\n onClick={() => removeEditedContent(dictionaryKey, keyPath)}\n >\n {restoreButton.text}\n </Button>\n )}\n <Button\n label={deleteButton.label.value}\n variant=\"outline\"\n color=\"error\"\n Icon={X}\n onClick={() => {\n addEditedContent(dictionaryKey, undefined, keyPath);\n\n const parentKeyPath: KeyPath[] = keyPath.slice(0, -1);\n setFocusedContentKeyPath(parentKeyPath);\n }}\n >\n {deleteButton.text}\n </Button>\n </div>\n )}\n </form>\n ) : (\n <span className=\"h-8\"></span>\n )}\n </>\n );\n};\n"],"names":["useEditionPanelStore","useShallow","useDictionary","editorViewContent","useEditedContentStore","getDictionaryValueByKeyPath","useMemo","getIsEditableSection","sentenceToCamelCase","jsxs","Fragment","jsx","TextEditor","Label","EditableFieldInput","camelCaseToSentence","NodeTypeSelector","Button","RotateCcw","X"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BO,MAAM,aAAkC,CAAC;AAAA,EAC9C;AAAA,EACA;AACF,MAAM;AACE,QAAA,EAAE,gBAAgB,yBAAA,IAA6BA,iDAAA;AAAA,IACnDC,QAAA,WAAW,CAAC,OAAO;AAAA,MACjB,0BAA0B,EAAE;AAAA,MAC5B,gBAAgB,EAAE;AAAA,IAAA,EAClB;AAAA,EACJ;AACM,QAAA,UAAU,gBAAgB,WAAW,CAAC;AAC5C,QAAM,iBAAiB,QAAQ,QAAQ,SAAS,CAAC,GAAG,OAAO;AAC3D,QAAM,EAAE,YAAY,cAAc,kBAAkB,cAAc,IAChEC,4BAAcC,qEAAiB;AAE3B,QAAA;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA,IACEC,kDAAA;AAAA,IACFH,QAAA,WAAW,CAA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A,gBAExD,UAAc,cAAA;AAAA,cAAA;AAAA,YACjB;AAAA,YAEFP,2BAAA,kBAAA;AAAA,cAACM,yBAAA;AAAA,cAAA;AAAA,gBACC,OAAO,aAAa,MAAM;AAAA,gBAC1B,SAAQ;AAAA,gBACR,OAAM;AAAA,gBACN,MAAME,YAAA;AAAA,gBACN,SAAS,MAAM;AACI,mCAAA,eAAe,QAAW,OAAO;AAElD,wBAAM,gBAA2B,QAAQ,MAAM,GAAG,EAAE;AACpD,2CAAyB,aAAa;AAAA,gBACxC;AAAA,gBAEC,UAAa,aAAA;AAAA,cAAA;AAAA,YAAA;AAAA,UAChB,EACF,CAAA;AAAA,QAAA;AAAA,MAAA;AAAA,MA7DG,KAAK,UAAU,gBAAgB,OAAO;AAAA,IAiE7C,IAAAR,iDAAC,QAAK,EAAA,WAAU,MAAM,CAAA;AAAA,EAAA,GAE1B;AAEJ;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"EditorView.mjs","sources":["../../../../src/components/DictionaryFieldEditor/EditorView/EditorView.tsx"],"sourcesContent":["'use client';\n\nimport { type KeyPath, type Dictionary } from '@intlayer/core';\nimport { RotateCcw, X } from 'lucide-react';\nimport { useMemo, type FC } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { useShallow } from 'zustand/react/shallow';\nimport { EditableFieldInput } from '../..//EditableField';\nimport {\n camelCaseToSentence,\n sentenceToCamelCase,\n} from '../../../utils/camelCase';\nimport { getDictionaryValueByKeyPath } from '../../../utils/dictionary';\nimport { Button } from '../../Button';\nimport {\n useEditedContentStore,\n useEditionPanelStore,\n} from '../../DictionaryEditor';\nimport { Label } from '../../Label';\nimport { editorViewContent } from '../editorView.content';\nimport { getIsEditableSection } from '../getIsEditableSection';\nimport { NodeTypeSelector } from '../NodeTypeSelector';\nimport { TextEditor } from './TextEditor';\n\ntype EditorViewProps = {\n dictionaryKey: string;\n dictionary: Dictionary;\n};\n\nexport const EditorView: FC<EditorViewProps> = ({\n dictionaryKey,\n dictionary,\n}) => {\n const { focusedContent, setFocusedContentKeyPath } = useEditionPanelStore(\n useShallow((s) => ({\n setFocusedContentKeyPath: s.setFocusedContentKeyPath,\n focusedContent: s.focusedContent,\n }))\n );\n const keyPath = focusedContent?.keyPath ?? [];\n const initialKeyName = keyPath[keyPath.length - 1]?.key ?? '';\n const { titleInput, deleteButton, nodeTypeSelector, restoreButton } =\n useDictionary(editorViewContent);\n\n const {\n editedContent,\n renameEditedContent,\n addEditedContent,\n removeEditedContent,\n } = useEditedContentStore(\n useShallow((s) => ({\n editedContent: s.editedContent,\n renameEditedContent: s.renameEditedContent,\n addEditedContent: s.addEditedContent,\n removeEditedContent: s.removeEditedContent,\n }))\n );\n\n const editedSection = editedContent[dictionaryKey]?.content\n ? getDictionaryValueByKeyPath(editedContent[dictionaryKey].content, keyPath)\n : undefined;\n\n const dictionarySection = getDictionaryValueByKeyPath(\n dictionary.content,\n keyPath\n );\n\n const section = editedSection ?? dictionarySection;\n\n const isEdited = useMemo(\n () =>\n editedSection &&\n JSON.stringify(editedSection) !== JSON.stringify(dictionarySection),\n [editedSection, dictionarySection]\n );\n\n const isEditableSection = getIsEditableSection(section);\n\n const handleRenameNodeKey = (keyName: string) => {\n const camelCaseSentence = sentenceToCamelCase(keyName);\n renameEditedContent(dictionaryKey, camelCaseSentence, keyPath);\n const prevKeyPath: KeyPath[] = keyPath.slice(0, -1);\n const lastKeyPath: KeyPath = keyPath[keyPath.length - 1];\n const newKeyPath: KeyPath[] = [\n ...prevKeyPath,\n { ...lastKeyPath, key: camelCaseSentence } as KeyPath,\n ];\n setFocusedContentKeyPath(newKeyPath);\n };\n\n return (\n <>\n {isEditableSection && (\n <TextEditor\n key={keyPath.join('.')}\n keyPath={keyPath}\n section={section}\n dictionaryKey={dictionaryKey}\n />\n )}\n\n {keyPath.length > 0 ? (\n <form\n className=\"bg-text text-text-dark dark:bg-text-dark dark:text-text flex w-full flex-col items-start justify-between gap-6 px-4 py-2\"\n key={JSON.stringify(focusedContent?.keyPath)}\n >\n <div className=\"flex w-full flex-wrap items-start justify-between gap-6\">\n {typeof initialKeyName === 'string' && (\n <div className=\"flex flex-col gap-3\">\n <Label>{titleInput.label}</Label>\n <div className=\"flex flex-wrap items-center gap-4\">\n <EditableFieldInput\n name=\"key\"\n aria-label=\"Key\"\n key={initialKeyName}\n placeholder={titleInput.placeholder.value}\n defaultValue={camelCaseToSentence(initialKeyName)}\n onSave={(value) => handleRenameNodeKey(value)}\n className=\"h-8\"\n variant=\"invisible\"\n />\n <span className=\"text-neutral dark:text-neutral-dark text-sm\">\n ({initialKeyName})\n </span>\n </div>\n </div>\n )}\n\n <div>\n <Label>{nodeTypeSelector.label}</Label>\n\n <NodeTypeSelector\n keyPath={keyPath}\n dictionaryKey={dictionaryKey}\n section={section}\n />\n </div>\n </div>\n {keyPath.length > 0 && (\n <div className=\"ml-auto flex gap-2\">\n {isEdited && (\n <Button\n label={restoreButton.label.value}\n variant=\"outline\"\n color=\"text-inverse\"\n Icon={RotateCcw}\n onClick={() => removeEditedContent(dictionaryKey, keyPath)}\n >\n {restoreButton.text}\n </Button>\n )}\n <Button\n label={deleteButton.label.value}\n variant=\"outline\"\n color=\"error\"\n Icon={X}\n onClick={() => {\n addEditedContent(dictionaryKey, undefined, keyPath);\n\n const parentKeyPath: KeyPath[] = keyPath.slice(0, -1);\n setFocusedContentKeyPath(parentKeyPath);\n }}\n >\n {deleteButton.text}\n </Button>\n </div>\n )}\n </form>\n ) : (\n <span className=\"h-8\"></span>\n )}\n </>\n );\n};\n"],"names":["jsxs","Fragment","jsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BO,MAAM,aAAkC,CAAC;AAAA,EAC9C;AAAA,EACA;AACF,MAAM;AACE,QAAA,EAAE,gBAAgB,yBAAA,IAA6B;AAAA,IACnD,WAAW,CAAC,OAAO;AAAA,MACjB,0BAA0B,EAAE;AAAA,MAC5B,gBAAgB,EAAE;AAAA,IA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OAAM;AAAA,gBACN,MAAM;AAAA,gBACN,SAAS,MAAM,oBAAoB,eAAe,OAAO;AAAA,gBAExD,UAAc,cAAA;AAAA,cAAA;AAAA,YACjB;AAAA,YAEFA,kCAAA;AAAA,cAAC;AAAA,cAAA;AAAA,gBACC,OAAO,aAAa,MAAM;AAAA,gBAC1B,SAAQ;AAAA,gBACR,OAAM;AAAA,gBACN,MAAM;AAAA,gBACN,SAAS,MAAM;AACI,mCAAA,eAAe,QAAW,OAAO;AAElD,wBAAM,gBAA2B,QAAQ,MAAM,GAAG,EAAE;AACpD,2CAAyB,aAAa;AAAA,gBACxC;AAAA,gBAEC,UAAa,aAAA;AAAA,cAAA;AAAA,YAChB;AAAA,UAAA,GACF;AAAA,QAAA;AAAA,MAAA;AAAA,MA7DG,KAAK,UAAU,gBAAgB,OAAO;AAAA,IAiE7C,IAAAA,kCAAA,IAAC,QAAK,EAAA,WAAU,MAAM,CAAA;AAAA,EAE1B,EAAA,CAAA;AAEJ;"}
1
+ {"version":3,"file":"EditorView.mjs","sources":["../../../../src/components/DictionaryFieldEditor/EditorView/EditorView.tsx"],"sourcesContent":["'use client';\n\nimport { type KeyPath, type Dictionary } from '@intlayer/core';\nimport { RotateCcw, X } from 'lucide-react';\nimport { useMemo, type FC } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { useShallow } from 'zustand/react/shallow';\nimport { EditableFieldInput } from '../..//EditableField';\nimport {\n camelCaseToSentence,\n sentenceToCamelCase,\n} from '../../../utils/camelCase';\nimport { getDictionaryValueByKeyPath } from '../../../utils/dictionary';\nimport { Button } from '../../Button';\nimport {\n useEditedContentStore,\n useEditionPanelStore,\n} from '../../DictionaryEditor';\nimport { Label } from '../../Label';\nimport { editorViewContent } from '../editorView.content';\nimport { getIsEditableSection } from '../getIsEditableSection';\nimport { NodeTypeSelector } from '../NodeTypeSelector';\nimport { TextEditor } from './TextEditor';\n\ntype EditorViewProps = {\n dictionaryKey: string;\n dictionary: Dictionary;\n};\n\nexport const EditorView: FC<EditorViewProps> = ({\n dictionaryKey,\n dictionary,\n}) => {\n const { focusedContent, setFocusedContentKeyPath } = useEditionPanelStore(\n useShallow((s) => ({\n setFocusedContentKeyPath: s.setFocusedContentKeyPath,\n focusedContent: s.focusedContent,\n }))\n );\n const keyPath = focusedContent?.keyPath ?? [];\n const initialKeyName = keyPath[keyPath.length - 1]?.key ?? '';\n const { titleInput, deleteButton, nodeTypeSelector, restoreButton } =\n useDictionary(editorViewContent);\n\n const {\n editedContent,\n renameEditedContent,\n addEditedContent,\n removeEditedContent,\n } = useEditedContentStore(\n useShallow((s) => ({\n editedContent: s.editedContent,\n renameEditedContent: s.renameEditedContent,\n addEditedContent: s.addEditedContent,\n removeEditedContent: s.removeEditedContent,\n }))\n );\n\n const editedSection = editedContent[dictionaryKey]?.content\n ? getDictionaryValueByKeyPath(editedContent[dictionaryKey].content, keyPath)\n : undefined;\n\n const dictionarySection = getDictionaryValueByKeyPath(\n dictionary.content,\n keyPath\n );\n\n const section = editedSection ?? dictionarySection;\n\n const isEdited = useMemo(\n () =>\n editedSection &&\n JSON.stringify(editedSection) !== JSON.stringify(dictionarySection),\n [editedSection, dictionarySection]\n );\n\n const isEditableSection = getIsEditableSection(section);\n\n const handleRenameNodeKey = (keyName: string) => {\n const camelCaseSentence = sentenceToCamelCase(keyName);\n renameEditedContent(dictionaryKey, camelCaseSentence, keyPath);\n const prevKeyPath: KeyPath[] = keyPath.slice(0, -1);\n const lastKeyPath: KeyPath = keyPath[keyPath.length - 1];\n const newKeyPath: KeyPath[] = [\n ...prevKeyPath,\n { ...lastKeyPath, key: camelCaseSentence } as KeyPath,\n ];\n setFocusedContentKeyPath(newKeyPath);\n };\n\n return (\n <>\n {isEditableSection && (\n <TextEditor\n key={keyPath.join('.')}\n keyPath={keyPath}\n section={section}\n dictionaryKey={dictionaryKey}\n />\n )}\n\n {keyPath.length > 0 ? (\n <form\n className=\"bg-text text-text-dark dark:bg-text-dark dark:text-text flex w-full flex-col items-start justify-between gap-6 px-4 py-2\"\n key={JSON.stringify(focusedContent?.keyPath)}\n >\n <div className=\"flex w-full flex-wrap items-start justify-between gap-6\">\n {typeof initialKeyName === 'string' && (\n <div className=\"flex flex-col gap-3\">\n <Label>{titleInput.label}</Label>\n <div className=\"flex flex-wrap items-center gap-4\">\n <EditableFieldInput\n name=\"key\"\n aria-label=\"Key\"\n key={initialKeyName}\n placeholder={titleInput.placeholder.value}\n defaultValue={camelCaseToSentence(initialKeyName)}\n onSave={(value) => handleRenameNodeKey(value)}\n className=\"h-8\"\n variant=\"invisible\"\n />\n <span className=\"text-neutral dark:text-neutral-dark text-sm\">\n ({initialKeyName})\n </span>\n </div>\n </div>\n )}\n\n <div>\n <Label>{nodeTypeSelector.label}</Label>\n\n <NodeTypeSelector\n keyPath={keyPath}\n dictionaryKey={dictionaryKey}\n section={section}\n />\n </div>\n </div>\n {keyPath.length > 0 && (\n <div className=\"ml-auto flex gap-2\">\n {isEdited && (\n <Button\n label={restoreButton.label.value}\n variant=\"outline\"\n color=\"text-inverse\"\n Icon={RotateCcw}\n onClick={() => removeEditedContent(dictionaryKey, keyPath)}\n >\n {restoreButton.text}\n </Button>\n )}\n <Button\n label={deleteButton.label.value}\n variant=\"outline\"\n color=\"error\"\n Icon={X}\n onClick={() => {\n addEditedContent(dictionaryKey, undefined, keyPath);\n\n const parentKeyPath: KeyPath[] = keyPath.slice(0, -1);\n setFocusedContentKeyPath(parentKeyPath);\n }}\n >\n {deleteButton.text}\n </Button>\n </div>\n )}\n </form>\n ) : (\n <span className=\"h-8\"></span>\n )}\n </>\n );\n};\n"],"names":["jsxs","Fragment","jsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BO,MAAM,aAAkC,CAAC;AAAA,EAC9C;AAAA,EACA;AACF,MAAM;AACE,QAAA,EAAE,gBAAgB,yBAAA,IAA6B;AAAA,IACnD,WAAW,CAAC,OAAO;AAAA,MACjB,0BAA0B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A;AAAA,gBACC,OAAO,cAAc,MAAM;AAAA,gBAC3B,SAAQ;AAAA,gBACR,OAAM;AAAA,gBACN,MAAM;AAAA,gBACN,SAAS,MAAM,oBAAoB,eAAe,OAAO;AAAA,gBAExD,UAAc,cAAA;AAAA,cAAA;AAAA,YACjB;AAAA,YAEFA,kCAAA;AAAA,cAAC;AAAA,cAAA;AAAA,gBACC,OAAO,aAAa,MAAM;AAAA,gBAC1B,SAAQ;AAAA,gBACR,OAAM;AAAA,gBACN,MAAM;AAAA,gBACN,SAAS,MAAM;AACI,mCAAA,eAAe,QAAW,OAAO;AAElD,wBAAM,gBAA2B,QAAQ,MAAM,GAAG,EAAE;AACpD,2CAAyB,aAAa;AAAA,gBACxC;AAAA,gBAEC,UAAa,aAAA;AAAA,cAAA;AAAA,YAAA;AAAA,UAChB,EACF,CAAA;AAAA,QAAA;AAAA,MAAA;AAAA,MA7DG,KAAK,UAAU,gBAAgB,OAAO;AAAA,IAiE7C,IAAAA,sCAAC,QAAK,EAAA,WAAU,MAAM,CAAA;AAAA,EAAA,GAE1B;AAEJ;"}
@@ -1 +1 @@
1
- {"version":3,"file":"TextEditor.cjs","sources":["../../../../src/components/DictionaryFieldEditor/EditorView/TextEditor.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n'use client';\n\nimport { getConfiguration } from '@intlayer/config/client';\nimport {\n type EnumerationContent,\n type TranslationContent,\n NodeType,\n type KeyPath,\n type DictionaryValue,\n getLocaleName,\n} from '@intlayer/core';\nimport { Plus, X } from 'lucide-react';\nimport {\n createElement,\n type ReactElement,\n type ReactNode,\n type FC,\n} from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { useShallow } from 'zustand/react/shallow';\nimport { getSectionType } from '../../../utils/dictionary';\nimport { renameKey } from '../../../utils/object';\nimport { Button } from '../../Button';\nimport { ContentEditorTextArea } from '../../ContentEditor/ContentEditorTextArea';\nimport { useEditedContentStore } from '../../DictionaryEditor';\nimport { EnumKeyInput } from '../EnumKeyInput';\nimport { getIsEditableSection } from '../getIsEditableSection';\nimport { navigationViewContent } from '../NavigationView/navigationViewNode.content';\n\nexport const traceKeys: string[] = ['filePath', 'id', 'nodeType'];\n\nconst createReactElement = (element: ReactElement) => {\n if (typeof element === 'string') {\n // If it's a string, simply return it (used for text content)\n return element;\n }\n\n const convertChildrenAsArray = (element: ReactElement): ReactElement => {\n if (element?.props && typeof element.props.children === 'object') {\n const childrenResult: ReactNode[] = [];\n const { children } = element.props;\n\n // Create the children elements recursively, if any\n Object.keys(children).forEach((key) =>\n childrenResult.push(createReactElement(children[key]))\n );\n\n return {\n ...element,\n props: { ...element.props, children: childrenResult },\n };\n }\n\n return {\n ...element,\n props: { ...element.props, children: element.props.children },\n };\n };\n\n const fixedElement = convertChildrenAsArray(element);\n\n const { type, props } = fixedElement;\n\n // Create and return the React element\n return createElement(type ?? 'div', props, ...props.children);\n};\n\nexport type TextEditorProps = {\n dictionaryKey: string;\n keyPath: KeyPath[];\n section: DictionaryValue;\n};\n\nconst TranslationTextEditor: FC<TextEditorProps> = ({\n section,\n keyPath,\n dictionaryKey,\n}: TextEditorProps) => {\n const { locales } = getConfiguration().internationalization;\n const addEditedContent = useEditedContentStore(\n useShallow((s) => s.addEditedContent)\n );\n\n return (\n <table className=\"w-full gap-2\">\n <tbody>\n {locales.map((translationKey) => (\n <tr\n key={translationKey}\n className=\"border-text dark:border-text-dark w-full border-t-[1.5px]\"\n lang={translationKey}\n >\n <td className=\"border-text dark:border-text-dark border-r-[1.5px] p-2\">\n {getLocaleName(translationKey)}\n </td>\n <td className=\"w-full p-2\">\n <ContentEditorTextArea\n variant=\"default\"\n aria-label=\"Edit field\"\n onContentChange={(newValue) =>\n addEditedContent(dictionaryKey, newValue, [\n ...keyPath,\n {\n type: NodeType.Translation,\n key: translationKey,\n },\n ])\n }\n >\n {\n (section as TranslationContent<string>)[NodeType.Translation][\n translationKey\n ] as string\n }\n </ContentEditorTextArea>\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n );\n};\n\nconst EnumerationTextEditor: FC<TextEditorProps> = ({\n section,\n keyPath,\n dictionaryKey,\n}) => {\n const addEditedContent = useEditedContentStore(\n useShallow((s) => s.addEditedContent)\n );\n const { addNewEnumeration } = useDictionary(navigationViewContent);\n\n return (\n <table className=\"w-full table-fixed gap-2\">\n <tbody>\n {Object.keys(\n (section as EnumerationContent<DictionaryValue>)[NodeType.Enumeration]\n ).map((enumKey) => (\n <tr\n key={enumKey}\n className=\"border-text dark:border-text-dark w-full border-y-[1.5px]\"\n >\n <td className=\"border-text dark:border-text-dark w-44 border-r-[1.5px] p-2\">\n <div className=\"flex gap-1\">\n <Button\n label=\"Remove\"\n variant=\"hoverable\"\n size=\"icon-md\"\n color=\"text\"\n Icon={X}\n className=\"w-16\"\n onClick={() =>\n addEditedContent(dictionaryKey, undefined, [\n ...keyPath,\n {\n type: NodeType.Enumeration,\n key: enumKey,\n },\n ])\n }\n />\n <EnumKeyInput\n value={enumKey}\n onChange={(value) => {\n const preValueContent = (\n section as EnumerationContent<string>\n )[NodeType.Enumeration];\n const newValueContent = renameKey(\n preValueContent,\n enumKey as keyof typeof preValueContent,\n value\n );\n const newValue = {\n ...(section as EnumerationContent<string>),\n [NodeType.Enumeration]: newValueContent,\n };\n\n addEditedContent(dictionaryKey, newValue, keyPath);\n }}\n />\n </div>\n </td>\n <td className=\"w-full p-2\">\n <ContentEditorTextArea\n variant=\"default\"\n aria-label=\"Edit field\"\n onContentChange={(newValue) =>\n addEditedContent(dictionaryKey, newValue, [\n ...keyPath,\n {\n type: NodeType.Enumeration,\n key: enumKey,\n },\n ])\n }\n >\n {\n (section as EnumerationContent<string>)[NodeType.Enumeration][\n enumKey as any\n ] as string\n }\n </ContentEditorTextArea>\n </td>\n </tr>\n ))}\n </tbody>\n\n <tfoot>\n <Button\n label={addNewEnumeration.label.value}\n variant=\"hoverable\"\n color=\"neutral\"\n textAlign=\"left\"\n onClick={() =>\n addEditedContent(\n dictionaryKey,\n '',\n [...keyPath, { type: NodeType.Enumeration, key: 'unknown' }],\n false\n )\n }\n Icon={Plus}\n className=\"m-2\"\n >\n {addNewEnumeration.text}\n </Button>\n </tfoot>\n </table>\n );\n};\n\nconst ArrayTextEditor: FC<TextEditorProps> = ({\n section,\n keyPath,\n dictionaryKey,\n}) => {\n const addEditedContent = useEditedContentStore(\n useShallow((s) => s.addEditedContent)\n );\n const { addNewElement } = useDictionary(navigationViewContent);\n\n return (\n <table className=\"w-full gap-2\">\n <tbody>\n {(section as DictionaryValue[]).map((subSection, index) => (\n <tr\n key={JSON.stringify(subSection)}\n className=\"border-text dark:border-text-dark w-full border-t-[1.5px]\"\n >\n <td className=\"border-text dark:border-text-dark border-r-[1.5px] p-2\">\n {index}\n </td>\n <td className=\"w-full p-2\">\n <ContentEditorTextArea\n variant=\"default\"\n aria-label=\"Edit field\"\n onContentChange={(newValue) => {\n addEditedContent(dictionaryKey, newValue, [\n ...keyPath,\n {\n type: NodeType.Array,\n key: index,\n },\n ]);\n }}\n >\n {subSection as string}\n </ContentEditorTextArea>\n </td>\n </tr>\n ))}\n </tbody>\n <tfoot>\n <Button\n label={addNewElement.label.value}\n variant=\"hoverable\"\n color=\"neutral\"\n textAlign=\"left\"\n onClick={() => {\n const newKeyPath: KeyPath[] = [\n ...keyPath,\n {\n type: NodeType.Array,\n key: (section as DictionaryValue[]).length,\n },\n ];\n addEditedContent(dictionaryKey, '', newKeyPath, false);\n }}\n Icon={Plus}\n >\n {addNewElement.text}\n </Button>\n </tfoot>\n </table>\n );\n};\n\nexport const TextEditor: FC<TextEditorProps> = ({\n section,\n keyPath,\n dictionaryKey,\n}) => {\n const addEditedContent = useEditedContentStore(\n useShallow((s) => s.addEditedContent)\n );\n const { tsxNotEditable } = useDictionary(navigationViewContent);\n const nodeType = getSectionType(section);\n const isEditableSection = getIsEditableSection(section);\n\n if (!isEditableSection) return <></>;\n\n if (typeof section === 'object') {\n if (nodeType === NodeType.ReactNode) {\n return (\n <>\n {createReactElement(section as unknown as ReactElement)}\n <span className=\"text-neutral dark:text-neutral-dark text-xs\">\n {tsxNotEditable}\n </span>\n </>\n );\n }\n\n if (nodeType === NodeType.Translation) {\n return (\n <TranslationTextEditor\n dictionaryKey={dictionaryKey}\n keyPath={keyPath}\n section={section}\n />\n );\n }\n\n if (nodeType === NodeType.Enumeration) {\n return (\n <EnumerationTextEditor\n dictionaryKey={dictionaryKey}\n keyPath={keyPath}\n section={section}\n />\n );\n }\n\n if (nodeType === NodeType.Array) {\n return (\n <ArrayTextEditor\n dictionaryKey={dictionaryKey}\n keyPath={keyPath}\n section={section}\n />\n );\n }\n }\n\n if (nodeType === NodeType.Text) {\n return (\n <div className=\"border-text dark:border-text-dark w-full border-t-[1.5px] p-2\">\n <ContentEditorTextArea\n variant=\"default\"\n aria-label=\"Edit field\"\n onContentChange={(newValue) =>\n addEditedContent(dictionaryKey, newValue, keyPath)\n }\n >\n {section as string}\n </ContentEditorTextArea>\n </div>\n );\n }\n\n return <>Error loading section</>;\n};\n"],"names":["element","createElement","getConfiguration","useEditedContentStore","useShallow","jsx","jsxs","getLocaleName","ContentEditorTextArea","NodeType","useDictionary","navigationViewContent","Button","X","EnumKeyInput","renameKey","Plus","getSectionType","getIsEditableSection","Fragment"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BO,MAAM,YAAsB,CAAC,YAAY,MAAM,UAAU;AAEhE,MAAM,qBAAqB,CAAC,YAA0B;AAChD,MAAA,OAAO,YAAY,UAAU;AAExB,WAAA;AAAA,EACT;AAEM,QAAA,yBAAyB,CAACA,aAAwC;AACtE,QAAIA,UAAS,SAAS,OAAOA,SAAQ,MAAM,aAAa,UAAU;AAChE,YAAM,iBAA8B,CAAA;AAC9B,YAAA,EAAE,SAAS,IAAIA,SAAQ;AAGtB,aAAA,KAAK,QAAQ,EAAE;AAAA,QAAQ,CAAC,QAC7B,eAAe,KAAK,mBAAmB,SAAS,GAAG,CAAC,C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,EACF;AAEI,MAAA,aAAaI,cAAS,MAAM;AAE5B,WAAAJ,2BAAAA,kBAAAA,IAAC,OAAI,EAAA,WAAU,iEACb,UAAAA,2BAAA,kBAAA;AAAA,MAACG,+CAAA;AAAA,MAAA;AAAA,QACC,SAAQ;AAAA,QACR,cAAW;AAAA,QACX,iBAAiB,CAAC,aAChB,iBAAiB,eAAe,UAAU,OAAO;AAAA,QAGlD,UAAA;AAAA,MAAA;AAAA,IAEL,EAAA,CAAA;AAAA,EAEJ;AAEA,mGAAS,UAAqB,wBAAA,CAAA;AAChC;;;"}
1
+ {"version":3,"file":"TextEditor.cjs","sources":["../../../../src/components/DictionaryFieldEditor/EditorView/TextEditor.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n'use client';\n\nimport { getConfiguration } from '@intlayer/config/client';\nimport {\n type EnumerationContent,\n type TranslationContent,\n NodeType,\n type KeyPath,\n type DictionaryValue,\n getLocaleName,\n} from '@intlayer/core';\nimport { Plus, X } from 'lucide-react';\nimport {\n createElement,\n type ReactElement,\n type ReactNode,\n type FC,\n} from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { useShallow } from 'zustand/react/shallow';\nimport { getSectionType } from '../../../utils/dictionary';\nimport { renameKey } from '../../../utils/object';\nimport { Button } from '../../Button';\nimport { ContentEditorTextArea } from '../../ContentEditor/ContentEditorTextArea';\nimport { useEditedContentStore } from '../../DictionaryEditor';\nimport { EnumKeyInput } from '../EnumKeyInput';\nimport { getIsEditableSection } from '../getIsEditableSection';\nimport { navigationViewContent } from '../NavigationView/navigationViewNode.content';\n\nexport const traceKeys: string[] = ['filePath', 'id', 'nodeType'];\n\nconst createReactElement = (element: ReactElement) => {\n if (typeof element === 'string') {\n // If it's a string, simply return it (used for text content)\n return element;\n }\n\n const convertChildrenAsArray = (element: ReactElement): ReactElement => {\n if (element?.props && typeof element.props.children === 'object') {\n const childrenResult: ReactNode[] = [];\n const { children } = element.props;\n\n // Create the children elements recursively, if any\n Object.keys(children).forEach((key) =>\n childrenResult.push(createReactElement(children[key]))\n );\n\n return {\n ...element,\n props: { ...element.props, children: childrenResult },\n };\n }\n\n return {\n ...element,\n props: { ...element.props, children: element.props.children },\n };\n };\n\n const fixedElement = convertChildrenAsArray(element);\n\n const { type, props } = fixedElement;\n\n // Create and return the React element\n return createElement(type ?? 'div', props, ...props.children);\n};\n\nexport type TextEditorProps = {\n dictionaryKey: string;\n keyPath: KeyPath[];\n section: DictionaryValue;\n};\n\nconst TranslationTextEditor: FC<TextEditorProps> = ({\n section,\n keyPath,\n dictionaryKey,\n}: TextEditorProps) => {\n const { locales } = getConfiguration().internationalization;\n const addEditedContent = useEditedContentStore(\n useShallow((s) => s.addEditedContent)\n );\n\n return (\n <table className=\"w-full gap-2\">\n <tbody>\n {locales.map((translationKey) => (\n <tr\n key={translationKey}\n className=\"border-text dark:border-text-dark w-full border-t-[1.5px]\"\n lang={translationKey}\n >\n <td className=\"border-text dark:border-text-dark border-r-[1.5px] p-2\">\n {getLocaleName(translationKey)}\n </td>\n <td className=\"w-full p-2\">\n <ContentEditorTextArea\n variant=\"default\"\n aria-label=\"Edit field\"\n onContentChange={(newValue) =>\n addEditedContent(dictionaryKey, newValue, [\n ...keyPath,\n {\n type: NodeType.Translation,\n key: translationKey,\n },\n ])\n }\n >\n {\n (section as TranslationContent<string>)[NodeType.Translation][\n translationKey\n ] as string\n }\n </ContentEditorTextArea>\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n );\n};\n\nconst EnumerationTextEditor: FC<TextEditorProps> = ({\n section,\n keyPath,\n dictionaryKey,\n}) => {\n const addEditedContent = useEditedContentStore(\n useShallow((s) => s.addEditedContent)\n );\n const { addNewEnumeration } = useDictionary(navigationViewContent);\n\n return (\n <table className=\"w-full table-fixed gap-2\">\n <tbody>\n {Object.keys(\n (section as EnumerationContent<DictionaryValue>)[NodeType.Enumeration]\n ).map((enumKey) => (\n <tr\n key={enumKey}\n className=\"border-text dark:border-text-dark w-full border-y-[1.5px]\"\n >\n <td className=\"border-text dark:border-text-dark w-44 border-r-[1.5px] p-2\">\n <div className=\"flex gap-1\">\n <Button\n label=\"Remove\"\n variant=\"hoverable\"\n size=\"icon-md\"\n color=\"text\"\n Icon={X}\n className=\"w-16\"\n onClick={() =>\n addEditedContent(dictionaryKey, undefined, [\n ...keyPath,\n {\n type: NodeType.Enumeration,\n key: enumKey,\n },\n ])\n }\n />\n <EnumKeyInput\n value={enumKey}\n onChange={(value) => {\n const preValueContent = (\n section as EnumerationContent<string>\n )[NodeType.Enumeration];\n const newValueContent = renameKey(\n preValueContent,\n enumKey as keyof typeof preValueContent,\n value\n );\n const newValue = {\n ...(section as EnumerationContent<string>),\n [NodeType.Enumeration]: newValueContent,\n };\n\n addEditedContent(dictionaryKey, newValue, keyPath);\n }}\n />\n </div>\n </td>\n <td className=\"w-full p-2\">\n <ContentEditorTextArea\n variant=\"default\"\n aria-label=\"Edit field\"\n onContentChange={(newValue) =>\n addEditedContent(dictionaryKey, newValue, [\n ...keyPath,\n {\n type: NodeType.Enumeration,\n key: enumKey,\n },\n ])\n }\n >\n {\n (section as EnumerationContent<string>)[NodeType.Enumeration][\n enumKey as any\n ] as string\n }\n </ContentEditorTextArea>\n </td>\n </tr>\n ))}\n </tbody>\n\n <tfoot>\n <Button\n label={addNewEnumeration.label.value}\n variant=\"hoverable\"\n color=\"neutral\"\n textAlign=\"left\"\n onClick={() =>\n addEditedContent(\n dictionaryKey,\n '',\n [...keyPath, { type: NodeType.Enumeration, key: 'unknown' }],\n false\n )\n }\n Icon={Plus}\n className=\"m-2\"\n >\n {addNewEnumeration.text}\n </Button>\n </tfoot>\n </table>\n );\n};\n\nconst ArrayTextEditor: FC<TextEditorProps> = ({\n section,\n keyPath,\n dictionaryKey,\n}) => {\n const addEditedContent = useEditedContentStore(\n useShallow((s) => s.addEditedContent)\n );\n const { addNewElement } = useDictionary(navigationViewContent);\n\n return (\n <table className=\"w-full gap-2\">\n <tbody>\n {(section as DictionaryValue[]).map((subSection, index) => (\n <tr\n key={JSON.stringify(subSection)}\n className=\"border-text dark:border-text-dark w-full border-t-[1.5px]\"\n >\n <td className=\"border-text dark:border-text-dark border-r-[1.5px] p-2\">\n {index}\n </td>\n <td className=\"w-full p-2\">\n <ContentEditorTextArea\n variant=\"default\"\n aria-label=\"Edit field\"\n onContentChange={(newValue) => {\n addEditedContent(dictionaryKey, newValue, [\n ...keyPath,\n {\n type: NodeType.Array,\n key: index,\n },\n ]);\n }}\n >\n {subSection as string}\n </ContentEditorTextArea>\n </td>\n </tr>\n ))}\n </tbody>\n <tfoot>\n <Button\n label={addNewElement.label.value}\n variant=\"hoverable\"\n color=\"neutral\"\n textAlign=\"left\"\n onClick={() => {\n const newKeyPath: KeyPath[] = [\n ...keyPath,\n {\n type: NodeType.Array,\n key: (section as DictionaryValue[]).length,\n },\n ];\n addEditedContent(dictionaryKey, '', newKeyPath, false);\n }}\n Icon={Plus}\n >\n {addNewElement.text}\n </Button>\n </tfoot>\n </table>\n );\n};\n\nexport const TextEditor: FC<TextEditorProps> = ({\n section,\n keyPath,\n dictionaryKey,\n}) => {\n const addEditedContent = useEditedContentStore(\n useShallow((s) => s.addEditedContent)\n );\n const { tsxNotEditable } = useDictionary(navigationViewContent);\n const nodeType = getSectionType(section);\n const isEditableSection = getIsEditableSection(section);\n\n if (!isEditableSection) return <></>;\n\n if (typeof section === 'object') {\n if (nodeType === NodeType.ReactNode) {\n return (\n <>\n {createReactElement(section as unknown as ReactElement)}\n <span className=\"text-neutral dark:text-neutral-dark text-xs\">\n {tsxNotEditable}\n </span>\n </>\n );\n }\n\n if (nodeType === NodeType.Translation) {\n return (\n <TranslationTextEditor\n dictionaryKey={dictionaryKey}\n keyPath={keyPath}\n section={section}\n />\n );\n }\n\n if (nodeType === NodeType.Enumeration) {\n return (\n <EnumerationTextEditor\n dictionaryKey={dictionaryKey}\n keyPath={keyPath}\n section={section}\n />\n );\n }\n\n if (nodeType === NodeType.Array) {\n return (\n <ArrayTextEditor\n dictionaryKey={dictionaryKey}\n keyPath={keyPath}\n section={section}\n />\n );\n }\n }\n\n if (nodeType === NodeType.Text) {\n return (\n <div className=\"border-text dark:border-text-dark w-full border-t-[1.5px] p-2\">\n <ContentEditorTextArea\n variant=\"default\"\n aria-label=\"Edit field\"\n onContentChange={(newValue) =>\n addEditedContent(dictionaryKey, newValue, keyPath)\n }\n >\n {section as string}\n </ContentEditorTextArea>\n </div>\n );\n }\n\n return <>Error loading section</>;\n};\n"],"names":["element","createElement","getConfiguration","useEditedContentStore","useShallow","jsx","jsxs","getLocaleName","ContentEditorTextArea","NodeType","useDictionary","navigationViewContent","Button","X","EnumKeyInput","renameKey","Plus","getSectionType","getIsEditableSection","Fragment"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BO,MAAM,YAAsB,CAAC,YAAY,MAAM,UAAU;AAEhE,MAAM,qBAAqB,CAAC,YAA0B;AAChD,MAAA,OAAO,YAAY,UAAU;AAExB,WAAA;AAAA,EAAA;AAGH,QAAA,yBAAyB,CAACA,aAAwC;AACtE,QAAIA,UAAS,SAAS,OAAOA,SAAQ,MAAM,aAAa,UAAU;AAChE,YAAM,iBAA8B,CAAC;AAC/B,YAAA,EAAE,aAAaA,SAAQ;AAGtB,aAAA,KAAK,QAAQ,EAAE;AAAA,QAAQ,CAAC,QAC7B,eAAe,KAAK,mBAAmB,SAAS,GAAG,CAAC,CAAC;AAAA,MACvD;AAEO,aAAA;AAAA,QACL,GAAGA;AAAAA,QACH,OAAO,EAAE,GAAGA,SAAQ,OAAO,UAAU,eAAe;AAAA,MACtD;AAAA,IAAA;AAGK,WAAA;AAAA,MACL,GAAGA;AAAAA,MACH,OAAO,EAAE,GAAGA,SAAQ,OAAO,UAAUA,SAAQ,MAAM,SAAS;AAAA,IAC9D;AAAA,EACF;AAEM,QAAA,eAAe,uBAAuB,OAAO;AAE7C,QAAA,EAAE,MAAM,MAAA,IAAU;AAGxB,SAAO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../../../../src/components/DictionaryFieldEditor/EditorView/TextEditor.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n'use client';\n\nimport { getConfiguration } from '@intlayer/config/client';\nimport {\n type EnumerationContent,\n type TranslationContent,\n NodeType,\n type KeyPath,\n type DictionaryValue,\n getLocaleName,\n} from '@intlayer/core';\nimport { Plus, X } from 'lucide-react';\nimport {\n createElement,\n type ReactElement,\n type ReactNode,\n type FC,\n} from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { useShallow } from 'zustand/react/shallow';\nimport { getSectionType } from '../../../utils/dictionary';\nimport { renameKey } from '../../../utils/object';\nimport { Button } from '../../Button';\nimport { ContentEditorTextArea } from '../../ContentEditor/ContentEditorTextArea';\nimport { useEditedContentStore } from '../../DictionaryEditor';\nimport { EnumKeyInput } from '../EnumKeyInput';\nimport { getIsEditableSection } from '../getIsEditableSection';\nimport { navigationViewContent } from '../NavigationView/navigationViewNode.content';\n\nexport const traceKeys: string[] = ['filePath', 'id', 'nodeType'];\n\nconst createReactElement = (element: ReactElement) => {\n if (typeof element === 'string') {\n // If it's a string, simply return it (used for text content)\n return element;\n }\n\n const convertChildrenAsArray = (element: ReactElement): ReactElement => {\n if (element?.props && typeof element.props.children === 'object') {\n const childrenResult: ReactNode[] = [];\n const { children } = element.props;\n\n // Create the children elements recursively, if any\n Object.keys(children).forEach((key) =>\n childrenResult.push(createReactElement(children[key]))\n );\n\n return {\n ...element,\n props: { ...element.props, children: childrenResult },\n };\n }\n\n return {\n ...element,\n props: { ...element.props, children: element.props.children },\n };\n };\n\n const fixedElement = convertChildrenAsArray(element);\n\n const { type, props } = fixedElement;\n\n // Create and return the React element\n return createElement(type ?? 'div', props, ...props.children);\n};\n\nexport type TextEditorProps = {\n dictionaryKey: string;\n keyPath: KeyPath[];\n section: DictionaryValue;\n};\n\nconst TranslationTextEditor: FC<TextEditorProps> = ({\n section,\n keyPath,\n dictionaryKey,\n}: TextEditorProps) => {\n const { locales } = getConfiguration().internationalization;\n const addEditedContent = useEditedContentStore(\n useShallow((s) => s.addEditedContent)\n );\n\n return (\n <table className=\"w-full gap-2\">\n <tbody>\n {locales.map((translationKey) => (\n <tr\n key={translationKey}\n className=\"border-text dark:border-text-dark w-full border-t-[1.5px]\"\n lang={translationKey}\n >\n <td className=\"border-text dark:border-text-dark border-r-[1.5px] p-2\">\n {getLocaleName(translationKey)}\n </td>\n <td className=\"w-full p-2\">\n <ContentEditorTextArea\n variant=\"default\"\n aria-label=\"Edit field\"\n onContentChange={(newValue) =>\n addEditedContent(dictionaryKey, newValue, [\n ...keyPath,\n {\n type: NodeType.Translation,\n key: translationKey,\n },\n ])\n }\n >\n {\n (section as TranslationContent<string>)[NodeType.Translation][\n translationKey\n ] as string\n }\n </ContentEditorTextArea>\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n );\n};\n\nconst EnumerationTextEditor: FC<TextEditorProps> = ({\n section,\n keyPath,\n dictionaryKey,\n}) => {\n const addEditedContent = useEditedContentStore(\n useShallow((s) => s.addEditedContent)\n );\n const { addNewEnumeration } = useDictionary(navigationViewContent);\n\n return (\n <table className=\"w-full table-fixed gap-2\">\n <tbody>\n {Object.keys(\n (section as EnumerationContent<DictionaryValue>)[NodeType.Enumeration]\n ).map((enumKey) => (\n <tr\n key={enumKey}\n className=\"border-text dark:border-text-dark w-full border-y-[1.5px]\"\n >\n <td className=\"border-text dark:border-text-dark w-44 border-r-[1.5px] p-2\">\n <div className=\"flex gap-1\">\n <Button\n label=\"Remove\"\n variant=\"hoverable\"\n size=\"icon-md\"\n color=\"text\"\n Icon={X}\n className=\"w-16\"\n onClick={() =>\n addEditedContent(dictionaryKey, undefined, [\n ...keyPath,\n {\n type: NodeType.Enumeration,\n key: enumKey,\n },\n ])\n }\n />\n <EnumKeyInput\n value={enumKey}\n onChange={(value) => {\n const preValueContent = (\n section as EnumerationContent<string>\n )[NodeType.Enumeration];\n const newValueContent = renameKey(\n preValueContent,\n enumKey as keyof typeof preValueContent,\n value\n );\n const newValue = {\n ...(section as EnumerationContent<string>),\n [NodeType.Enumeration]: newValueContent,\n };\n\n addEditedContent(dictionaryKey, newValue, keyPath);\n }}\n />\n </div>\n </td>\n <td className=\"w-full p-2\">\n <ContentEditorTextArea\n variant=\"default\"\n aria-label=\"Edit field\"\n onContentChange={(newValue) =>\n addEditedContent(dictionaryKey, newValue, [\n ...keyPath,\n {\n type: NodeType.Enumeration,\n key: enumKey,\n },\n ])\n }\n >\n {\n (section as EnumerationContent<string>)[NodeType.Enumeration][\n enumKey as any\n ] as string\n }\n </ContentEditorTextArea>\n </td>\n </tr>\n ))}\n </tbody>\n\n <tfoot>\n <Button\n label={addNewEnumeration.label.value}\n variant=\"hoverable\"\n color=\"neutral\"\n textAlign=\"left\"\n onClick={() =>\n addEditedContent(\n dictionaryKey,\n '',\n [...keyPath, { type: NodeType.Enumeration, key: 'unknown' }],\n false\n )\n }\n Icon={Plus}\n className=\"m-2\"\n >\n {addNewEnumeration.text}\n </Button>\n </tfoot>\n </table>\n );\n};\n\nconst ArrayTextEditor: FC<TextEditorProps> = ({\n section,\n keyPath,\n dictionaryKey,\n}) => {\n const addEditedContent = useEditedContentStore(\n useShallow((s) => s.addEditedContent)\n );\n const { addNewElement } = useDictionary(navigationViewContent);\n\n return (\n <table className=\"w-full gap-2\">\n <tbody>\n {(section as DictionaryValue[]).map((subSection, index) => (\n <tr\n key={JSON.stringify(subSection)}\n className=\"border-text dark:border-text-dark w-full border-t-[1.5px]\"\n >\n <td className=\"border-text dark:border-text-dark border-r-[1.5px] p-2\">\n {index}\n </td>\n <td className=\"w-full p-2\">\n <ContentEditorTextArea\n variant=\"default\"\n aria-label=\"Edit field\"\n onContentChange={(newValue) => {\n addEditedContent(dictionaryKey, newValue, [\n ...keyPath,\n {\n type: NodeType.Array,\n key: index,\n },\n ]);\n }}\n >\n {subSection as string}\n </ContentEditorTextArea>\n </td>\n </tr>\n ))}\n </tbody>\n <tfoot>\n <Button\n label={addNewElement.label.value}\n variant=\"hoverable\"\n color=\"neutral\"\n textAlign=\"left\"\n onClick={() => {\n const newKeyPath: KeyPath[] = [\n ...keyPath,\n {\n type: NodeType.Array,\n key: (section as DictionaryValue[]).length,\n },\n ];\n addEditedContent(dictionaryKey, '', newKeyPath, false);\n }}\n Icon={Plus}\n >\n {addNewElement.text}\n </Button>\n </tfoot>\n </table>\n );\n};\n\nexport const TextEditor: FC<TextEditorProps> = ({\n section,\n keyPath,\n dictionaryKey,\n}) => {\n const addEditedContent = useEditedContentStore(\n useShallow((s) => s.addEditedContent)\n );\n const { tsxNotEditable } = useDictionary(navigationViewContent);\n const nodeType = getSectionType(section);\n const isEditableSection = getIsEditableSection(section);\n\n if (!isEditableSection) return <></>;\n\n if (typeof section === 'object') {\n if (nodeType === NodeType.ReactNode) {\n return (\n <>\n {createReactElement(section as unknown as ReactElement)}\n <span className=\"text-neutral dark:text-neutral-dark text-xs\">\n {tsxNotEditable}\n </span>\n </>\n );\n }\n\n if (nodeType === NodeType.Translation) {\n return (\n <TranslationTextEditor\n dictionaryKey={dictionaryKey}\n keyPath={keyPath}\n section={section}\n />\n );\n }\n\n if (nodeType === NodeType.Enumeration) {\n return (\n <EnumerationTextEditor\n dictionaryKey={dictionaryKey}\n keyPath={keyPath}\n section={section}\n />\n );\n }\n\n if (nodeType === NodeType.Array) {\n return (\n <ArrayTextEditor\n dictionaryKey={dictionaryKey}\n keyPath={keyPath}\n section={section}\n />\n );\n }\n }\n\n if (nodeType === NodeType.Text) {\n return (\n <div className=\"border-text dark:border-text-dark w-full border-t-[1.5px] p-2\">\n <ContentEditorTextArea\n variant=\"default\"\n aria-label=\"Edit field\"\n onContentChange={(newValue) =>\n addEditedContent(dictionaryKey, newValue, keyPath)\n }\n >\n {section as string}\n </ContentEditorTextArea>\n </div>\n );\n }\n\n return <>Error loading section</>;\n};\n"],"names":["element","jsx","jsxs","Fragment"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA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AA;AAAA,QACC,SAAQ;AAAA,QACR,cAAW;AAAA,QACX,iBAAiB,CAAC,aAChB,iBAAiB,eAAe,UAAU,OAAO;AAAA,QAGlD,UAAA;AAAA,MAAA;AAAA,IAEL,EAAA,CAAA;AAAA,EAEJ;AAEA,6EAAS,UAAqB,wBAAA,CAAA;AAChC;"}
1
+ {"version":3,"file":"TextEditor.mjs","sources":["../../../../src/components/DictionaryFieldEditor/EditorView/TextEditor.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n'use client';\n\nimport { getConfiguration } from '@intlayer/config/client';\nimport {\n type EnumerationContent,\n type TranslationContent,\n NodeType,\n type KeyPath,\n type DictionaryValue,\n getLocaleName,\n} from '@intlayer/core';\nimport { Plus, X } from 'lucide-react';\nimport {\n createElement,\n type ReactElement,\n type ReactNode,\n type FC,\n} from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { useShallow } from 'zustand/react/shallow';\nimport { getSectionType } from '../../../utils/dictionary';\nimport { renameKey } from '../../../utils/object';\nimport { Button } from '../../Button';\nimport { ContentEditorTextArea } from '../../ContentEditor/ContentEditorTextArea';\nimport { useEditedContentStore } from '../../DictionaryEditor';\nimport { EnumKeyInput } from '../EnumKeyInput';\nimport { getIsEditableSection } from '../getIsEditableSection';\nimport { navigationViewContent } from '../NavigationView/navigationViewNode.content';\n\nexport const traceKeys: string[] = ['filePath', 'id', 'nodeType'];\n\nconst createReactElement = (element: ReactElement) => {\n if (typeof element === 'string') {\n // If it's a string, simply return it (used for text content)\n return element;\n }\n\n const convertChildrenAsArray = (element: ReactElement): ReactElement => {\n if (element?.props && typeof element.props.children === 'object') {\n const childrenResult: ReactNode[] = [];\n const { children } = element.props;\n\n // Create the children elements recursively, if any\n Object.keys(children).forEach((key) =>\n childrenResult.push(createReactElement(children[key]))\n );\n\n return {\n ...element,\n props: { ...element.props, children: childrenResult },\n };\n }\n\n return {\n ...element,\n props: { ...element.props, children: element.props.children },\n };\n };\n\n const fixedElement = convertChildrenAsArray(element);\n\n const { type, props } = fixedElement;\n\n // Create and return the React element\n return createElement(type ?? 'div', props, ...props.children);\n};\n\nexport type TextEditorProps = {\n dictionaryKey: string;\n keyPath: KeyPath[];\n section: DictionaryValue;\n};\n\nconst TranslationTextEditor: FC<TextEditorProps> = ({\n section,\n keyPath,\n dictionaryKey,\n}: TextEditorProps) => {\n const { locales } = getConfiguration().internationalization;\n const addEditedContent = useEditedContentStore(\n useShallow((s) => s.addEditedContent)\n );\n\n return (\n <table className=\"w-full gap-2\">\n <tbody>\n {locales.map((translationKey) => (\n <tr\n key={translationKey}\n className=\"border-text dark:border-text-dark w-full border-t-[1.5px]\"\n lang={translationKey}\n >\n <td className=\"border-text dark:border-text-dark border-r-[1.5px] p-2\">\n {getLocaleName(translationKey)}\n </td>\n <td className=\"w-full p-2\">\n <ContentEditorTextArea\n variant=\"default\"\n aria-label=\"Edit field\"\n onContentChange={(newValue) =>\n addEditedContent(dictionaryKey, newValue, [\n ...keyPath,\n {\n type: NodeType.Translation,\n key: translationKey,\n },\n ])\n }\n >\n {\n (section as TranslationContent<string>)[NodeType.Translation][\n translationKey\n ] as string\n }\n </ContentEditorTextArea>\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n );\n};\n\nconst EnumerationTextEditor: FC<TextEditorProps> = ({\n section,\n keyPath,\n dictionaryKey,\n}) => {\n const addEditedContent = useEditedContentStore(\n useShallow((s) => s.addEditedContent)\n );\n const { addNewEnumeration } = useDictionary(navigationViewContent);\n\n return (\n <table className=\"w-full table-fixed gap-2\">\n <tbody>\n {Object.keys(\n (section as EnumerationContent<DictionaryValue>)[NodeType.Enumeration]\n ).map((enumKey) => (\n <tr\n key={enumKey}\n className=\"border-text dark:border-text-dark w-full border-y-[1.5px]\"\n >\n <td className=\"border-text dark:border-text-dark w-44 border-r-[1.5px] p-2\">\n <div className=\"flex gap-1\">\n <Button\n label=\"Remove\"\n variant=\"hoverable\"\n size=\"icon-md\"\n color=\"text\"\n Icon={X}\n className=\"w-16\"\n onClick={() =>\n addEditedContent(dictionaryKey, undefined, [\n ...keyPath,\n {\n type: NodeType.Enumeration,\n key: enumKey,\n },\n ])\n }\n />\n <EnumKeyInput\n value={enumKey}\n onChange={(value) => {\n const preValueContent = (\n section as EnumerationContent<string>\n )[NodeType.Enumeration];\n const newValueContent = renameKey(\n preValueContent,\n enumKey as keyof typeof preValueContent,\n value\n );\n const newValue = {\n ...(section as EnumerationContent<string>),\n [NodeType.Enumeration]: newValueContent,\n };\n\n addEditedContent(dictionaryKey, newValue, keyPath);\n }}\n />\n </div>\n </td>\n <td className=\"w-full p-2\">\n <ContentEditorTextArea\n variant=\"default\"\n aria-label=\"Edit field\"\n onContentChange={(newValue) =>\n addEditedContent(dictionaryKey, newValue, [\n ...keyPath,\n {\n type: NodeType.Enumeration,\n key: enumKey,\n },\n ])\n }\n >\n {\n (section as EnumerationContent<string>)[NodeType.Enumeration][\n enumKey as any\n ] as string\n }\n </ContentEditorTextArea>\n </td>\n </tr>\n ))}\n </tbody>\n\n <tfoot>\n <Button\n label={addNewEnumeration.label.value}\n variant=\"hoverable\"\n color=\"neutral\"\n textAlign=\"left\"\n onClick={() =>\n addEditedContent(\n dictionaryKey,\n '',\n [...keyPath, { type: NodeType.Enumeration, key: 'unknown' }],\n false\n )\n }\n Icon={Plus}\n className=\"m-2\"\n >\n {addNewEnumeration.text}\n </Button>\n </tfoot>\n </table>\n );\n};\n\nconst ArrayTextEditor: FC<TextEditorProps> = ({\n section,\n keyPath,\n dictionaryKey,\n}) => {\n const addEditedContent = useEditedContentStore(\n useShallow((s) => s.addEditedContent)\n );\n const { addNewElement } = useDictionary(navigationViewContent);\n\n return (\n <table className=\"w-full gap-2\">\n <tbody>\n {(section as DictionaryValue[]).map((subSection, index) => (\n <tr\n key={JSON.stringify(subSection)}\n className=\"border-text dark:border-text-dark w-full border-t-[1.5px]\"\n >\n <td className=\"border-text dark:border-text-dark border-r-[1.5px] p-2\">\n {index}\n </td>\n <td className=\"w-full p-2\">\n <ContentEditorTextArea\n variant=\"default\"\n aria-label=\"Edit field\"\n onContentChange={(newValue) => {\n addEditedContent(dictionaryKey, newValue, [\n ...keyPath,\n {\n type: NodeType.Array,\n key: index,\n },\n ]);\n }}\n >\n {subSection as string}\n </ContentEditorTextArea>\n </td>\n </tr>\n ))}\n </tbody>\n <tfoot>\n <Button\n label={addNewElement.label.value}\n variant=\"hoverable\"\n color=\"neutral\"\n textAlign=\"left\"\n onClick={() => {\n const newKeyPath: KeyPath[] = [\n ...keyPath,\n {\n type: NodeType.Array,\n key: (section as DictionaryValue[]).length,\n },\n ];\n addEditedContent(dictionaryKey, '', newKeyPath, false);\n }}\n Icon={Plus}\n >\n {addNewElement.text}\n </Button>\n </tfoot>\n </table>\n );\n};\n\nexport const TextEditor: FC<TextEditorProps> = ({\n section,\n keyPath,\n dictionaryKey,\n}) => {\n const addEditedContent = useEditedContentStore(\n useShallow((s) => s.addEditedContent)\n );\n const { tsxNotEditable } = useDictionary(navigationViewContent);\n const nodeType = getSectionType(section);\n const isEditableSection = getIsEditableSection(section);\n\n if (!isEditableSection) return <></>;\n\n if (typeof section === 'object') {\n if (nodeType === NodeType.ReactNode) {\n return (\n <>\n {createReactElement(section as unknown as ReactElement)}\n <span className=\"text-neutral dark:text-neutral-dark text-xs\">\n {tsxNotEditable}\n </span>\n </>\n );\n }\n\n if (nodeType === NodeType.Translation) {\n return (\n <TranslationTextEditor\n dictionaryKey={dictionaryKey}\n keyPath={keyPath}\n section={section}\n />\n );\n }\n\n if (nodeType === NodeType.Enumeration) {\n return (\n <EnumerationTextEditor\n dictionaryKey={dictionaryKey}\n keyPath={keyPath}\n section={section}\n />\n );\n }\n\n if (nodeType === NodeType.Array) {\n return (\n <ArrayTextEditor\n dictionaryKey={dictionaryKey}\n keyPath={keyPath}\n section={section}\n />\n );\n }\n }\n\n if (nodeType === NodeType.Text) {\n return (\n <div className=\"border-text dark:border-text-dark w-full border-t-[1.5px] p-2\">\n <ContentEditorTextArea\n variant=\"default\"\n aria-label=\"Edit field\"\n onContentChange={(newValue) =>\n addEditedContent(dictionaryKey, newValue, keyPath)\n }\n >\n {section as string}\n </ContentEditorTextArea>\n </div>\n );\n }\n\n return <>Error loading section</>;\n};\n"],"names":["element","jsx","jsxs","Fragment"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BO,MAAM,YAAsB,CAAC,YAAY,MAAM,UAAU;AAEhE,MAAM,qBAAqB,CAAC,YAA0B;AAChD,MAAA,OAAO,YAAY,UAAU;AAExB,WAAA;AAAA,EAAA;AAGH,QAAA,yBAAyB,CAACA,aAAwC;AACtE,QAAIA,UAAS,SAAS,OAAOA,SAAQ,MAAM,aAAa,UAAU;AAChE,YAAM,iBAA8B,CAAC;AAC/B,YAAA,EAAE,aAAaA,SAAQ;AAGtB,aAAA,KAAK,QAAQ,EAAE;AAAA,QAAQ,CAAC,QAC7B,eAAe,KAAK,mBAAmB,SAAS,GAAG,CAAC,CAAC;AAAA,MACvD;AAEO,aAAA;AAAA,QACL,GAAGA;AAAAA,QACH,OAAO,EAAE,GAAGA,SAAQ,OAAO,UAAU,eAAe;AAAA,MACtD;AAAA,IAAA;AAGK,WAAA;AAAA,MACL,GAAGA;AAAAA,MACH,OAAO,EAAE,GAAGA,SAAQ,OAAO,UAAUA,SAAQ,MAAM,SAAS;AAAA,IAC9D;AAAA,EACF;AAEM,QAAA,eAAe,uBAAuB,OAAO;AAE7C,QAAA,EAAE,MAAM,MAAA,IAAU;AAGxB,SAAO,cAAc,QAAQ,OAAO,OAAO,GAAG,MAAM,QAAQ;AAC9D;AAQA,MAAM,wBAA6C,CAAC;AAAA,EAClD;AAAA,EACA;AAAA,EACA;AACF,MAAuB;AACrB,QAAM,EAAE,QAAA,IAAY,iBAAA,EAAmB;AACvC,QAAM,mBAAmB;AAAA,IACvB,WAAW,CAAC,MAAM,EAAE,gBAAgB;AAAA,EACtC;AAGE,SAAAC,kCAAA,IAAC,W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aAAAA,kCAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC;AAAA,UACA;AAAA,UACA;AAAA,QAAA;AAAA,MACF;AAAA,IAAA;AAAA,EAEJ;AAGE,MAAA,aAAa,SAAS,MAAM;AAE5B,WAAAA,kCAAAA,IAAC,OAAI,EAAA,WAAU,iEACb,UAAAA,kCAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,SAAQ;AAAA,QACR,cAAW;AAAA,QACX,iBAAiB,CAAC,aAChB,iBAAiB,eAAe,UAAU,OAAO;AAAA,QAGlD,UAAA;AAAA,MAAA;AAAA,IAAA,GAEL;AAAA,EAAA;AAIJ,6EAAS,UAAqB,wBAAA,CAAA;AAChC;"}
@@ -1 +1 @@
1
- {"version":3,"file":"EnumKeyInput.cjs","sources":["../../../src/components/DictionaryFieldEditor/EnumKeyInput.tsx"],"sourcesContent":["'use client';\n\nimport { useEffect, useMemo, useState, type FC } from 'react';\nimport { Input } from '../Input';\nimport { Select } from '../Select';\n\nconst extractInitialState = (\n value: string | number\n): { comparator: string | undefined; numberValue: string | undefined } => {\n let comparator;\n let numberValue;\n\n if (typeof value === 'number' || !isNaN(Number(value))) {\n // If value is a number or numeric string, set comparator to '=' and numberValue accordingly\n comparator = '=';\n numberValue = value.toString();\n } else if (typeof value === 'string') {\n // Define possible comparators\n const comparators = ['<=', '>=', '<', '>', '='];\n // Find the comparator that matches the start of the string\n const matchedComparator = comparators.find((comp) =>\n value.startsWith(comp)\n );\n if (matchedComparator) {\n comparator = matchedComparator;\n numberValue = value.slice(matchedComparator.length);\n }\n }\n\n return { comparator, numberValue };\n};\n\ntype EnumKeyInputProps = {\n value: string | number;\n onChange: (value: string) => void;\n};\n\n/**\n * Example of values:\n * - `<1`\n * - `>-44.3`\n * - `=999`\n * - `<=1`\n * - `>=1`\n * - 88\n * - `-1`\n *\n */\nexport const EnumKeyInput: FC<EnumKeyInputProps> = ({ value, onChange }) => {\n const { comparator: initialComparator, numberValue: initialNumberValue } =\n useMemo(() => extractInitialState(value), [value]);\n const [comparator, setComparator] = useState<string | null>(\n initialComparator ?? null\n );\n const [numberValue, setNumberValue] = useState<string | null>(\n initialNumberValue ?? null\n );\n\n useEffect(() => {\n if (\n comparator &&\n numberValue &&\n (comparator !== initialComparator || numberValue !== initialNumberValue)\n ) {\n const newValue = `${comparator}${numberValue}`;\n\n onChange(newValue);\n }\n }, [\n comparator,\n initialComparator,\n initialNumberValue,\n numberValue,\n onChange,\n ]);\n\n return (\n <div className=\"flex gap-1\">\n <Select onValueChange={setComparator} defaultValue={initialComparator}>\n <Select.Trigger className=\"w-20\">\n <Select.Value placeholder=\"Select a comparator\" />\n </Select.Trigger>\n <Select.Content>\n <Select.Item value=\"<\">{`<`}</Select.Item>\n <Select.Item value=\"<=\">{`<=`}</Select.Item>\n <Select.Item value=\"=\">{`=`}</Select.Item>\n <Select.Item value=\">=\">{`>=`}</Select.Item>\n <Select.Item value=\">\">{`>`}</Select.Item>\n </Select.Content>\n </Select>\n <Input\n type=\"number\"\n defaultValue={numberValue ?? undefined}\n onChange={(e) => setNumberValue(e.target.value)}\n className=\"w-full\"\n />\n </div>\n );\n};\n"],"names":["useMemo","useState","useEffect","jsxs","Select","jsx","Input"],"mappings":";;;;;;;;;;AAMA,MAAM,sBAAsB,CAC1B,UACwE;AACpE,MAAA;AACA,MAAA;AAEA,MAAA,OAAO,UAAU,YAAY,CAAC,MAAM,OAAO,KAAK,CAAC,GAAG;AAEzC,iBAAA;AACb,kBAAc,MAAM;EAAS,WACpB,OAAO,UAAU,UAAU;AAEpC,UAAM,cAAc,CAAC,MAAM,MAAM,KAAK,KAAK,GAAG;AAE9C,UAAM,oBAAoB,YAAY;AAAA,MAAK,CAAC,SAC1C,MAAM,WAAW,IAAI;AAAA,IAAA;AAEvB,QAAI,mBAAmB;AACR,mBAAA;AACC,oBAAA,MAAM,MAAM,kBAAkB,MAAM;AAAA,IACpD;AAAA,EACF;AAEO,SAAA,EAAE,YAAY;AACvB;AAkBO,MAAM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AA,MAAA,GAC9B;AAAA,IAAA,GACF;AAAA,IACAC,2BAAA,kBAAA;AAAA,MAACC,uBAAA;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,cAAc,eAAe;AAAA,QAC7B,UAAU,CAAC,MAAM,eAAe,EAAE,OAAO,KAAK;AAAA,QAC9C,WAAU;AAAA,MAAA;AAAA,IACZ;AAAA,EACF,EAAA,CAAA;AAEJ;;"}
1
+ {"version":3,"file":"EnumKeyInput.cjs","sources":["../../../src/components/DictionaryFieldEditor/EnumKeyInput.tsx"],"sourcesContent":["'use client';\n\nimport { useEffect, useMemo, useState, type FC } from 'react';\nimport { Input } from '../Input';\nimport { Select } from '../Select';\n\nconst extractInitialState = (\n value: string | number\n): { comparator: string | undefined; numberValue: string | undefined } => {\n let comparator;\n let numberValue;\n\n if (typeof value === 'number' || !isNaN(Number(value))) {\n // If value is a number or numeric string, set comparator to '=' and numberValue accordingly\n comparator = '=';\n numberValue = value.toString();\n } else if (typeof value === 'string') {\n // Define possible comparators\n const comparators = ['<=', '>=', '<', '>', '='];\n // Find the comparator that matches the start of the string\n const matchedComparator = comparators.find((comp) =>\n value.startsWith(comp)\n );\n if (matchedComparator) {\n comparator = matchedComparator;\n numberValue = value.slice(matchedComparator.length);\n }\n }\n\n return { comparator, numberValue };\n};\n\ntype EnumKeyInputProps = {\n value: string | number;\n onChange: (value: string) => void;\n};\n\n/**\n * Example of values:\n * - `<1`\n * - `>-44.3`\n * - `=999`\n * - `<=1`\n * - `>=1`\n * - 88\n * - `-1`\n *\n */\nexport const EnumKeyInput: FC<EnumKeyInputProps> = ({ value, onChange }) => {\n const { comparator: initialComparator, numberValue: initialNumberValue } =\n useMemo(() => extractInitialState(value), [value]);\n const [comparator, setComparator] = useState<string | null>(\n initialComparator ?? null\n );\n const [numberValue, setNumberValue] = useState<string | null>(\n initialNumberValue ?? null\n );\n\n useEffect(() => {\n if (\n comparator &&\n numberValue &&\n (comparator !== initialComparator || numberValue !== initialNumberValue)\n ) {\n const newValue = `${comparator}${numberValue}`;\n\n onChange(newValue);\n }\n }, [\n comparator,\n initialComparator,\n initialNumberValue,\n numberValue,\n onChange,\n ]);\n\n return (\n <div className=\"flex gap-1\">\n <Select onValueChange={setComparator} defaultValue={initialComparator}>\n <Select.Trigger className=\"w-20\">\n <Select.Value placeholder=\"Select a comparator\" />\n </Select.Trigger>\n <Select.Content>\n <Select.Item value=\"<\">{`<`}</Select.Item>\n <Select.Item value=\"<=\">{`<=`}</Select.Item>\n <Select.Item value=\"=\">{`=`}</Select.Item>\n <Select.Item value=\">=\">{`>=`}</Select.Item>\n <Select.Item value=\">\">{`>`}</Select.Item>\n </Select.Content>\n </Select>\n <Input\n type=\"number\"\n defaultValue={numberValue ?? undefined}\n onChange={(e) => setNumberValue(e.target.value)}\n className=\"w-full\"\n />\n </div>\n );\n};\n"],"names":["useMemo","useState","useEffect","jsxs","Select","jsx","Input"],"mappings":";;;;;;;;;;AAMA,MAAM,sBAAsB,CAC1B,UACwE;AACpE,MAAA;AACA,MAAA;AAEA,MAAA,OAAO,UAAU,YAAY,CAAC,MAAM,OAAO,KAAK,CAAC,GAAG;AAEzC,iBAAA;AACb,kBAAc,MAAM,SAAS;AAAA,EAAA,WACpB,OAAO,UAAU,UAAU;AAEpC,UAAM,cAAc,CAAC,MAAM,MAAM,KAAK,KAAK,GAAG;AAE9C,UAAM,oBAAoB,YAAY;AAAA,MAAK,CAAC,SAC1C,MAAM,WAAW,IAAI;AAAA,IACvB;AACA,QAAI,mBAAmB;AACR,mBAAA;AACC,oBAAA,MAAM,MAAM,kBAAkB,MAAM;AAAA,IAAA;AAAA,EACpD;AAGK,SAAA,EAAE,YAAY,YAAY;AACnC;AAkBO,MAAM,eAAsC,CAAC,EAAE,OAAO,eAAe;AAC1E,QAAM,EAAE,YAAY,mBAAmB,aAAa,mBAAmB,IACrEA,mBAAQ,MAAM,oBAAoB,KAAK,GAAG,CAAC,KAAK,CAAC;AAC7C,QAAA,CAAC,YAAY,aAAa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eAAe,EAAE,OAAO,KAAK;AAAA,QAC9C,WAAU;AAAA,MAAA;AAAA,IAAA;AAAA,EACZ,GACF;AAEJ;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"EnumKeyInput.mjs","sources":["../../../src/components/DictionaryFieldEditor/EnumKeyInput.tsx"],"sourcesContent":["'use client';\n\nimport { useEffect, useMemo, useState, type FC } from 'react';\nimport { Input } from '../Input';\nimport { Select } from '../Select';\n\nconst extractInitialState = (\n value: string | number\n): { comparator: string | undefined; numberValue: string | undefined } => {\n let comparator;\n let numberValue;\n\n if (typeof value === 'number' || !isNaN(Number(value))) {\n // If value is a number or numeric string, set comparator to '=' and numberValue accordingly\n comparator = '=';\n numberValue = value.toString();\n } else if (typeof value === 'string') {\n // Define possible comparators\n const comparators = ['<=', '>=', '<', '>', '='];\n // Find the comparator that matches the start of the string\n const matchedComparator = comparators.find((comp) =>\n value.startsWith(comp)\n );\n if (matchedComparator) {\n comparator = matchedComparator;\n numberValue = value.slice(matchedComparator.length);\n }\n }\n\n return { comparator, numberValue };\n};\n\ntype EnumKeyInputProps = {\n value: string | number;\n onChange: (value: string) => void;\n};\n\n/**\n * Example of values:\n * - `<1`\n * - `>-44.3`\n * - `=999`\n * - `<=1`\n * - `>=1`\n * - 88\n * - `-1`\n *\n */\nexport const EnumKeyInput: FC<EnumKeyInputProps> = ({ value, onChange }) => {\n const { comparator: initialComparator, numberValue: initialNumberValue } =\n useMemo(() => extractInitialState(value), [value]);\n const [comparator, setComparator] = useState<string | null>(\n initialComparator ?? null\n );\n const [numberValue, setNumberValue] = useState<string | null>(\n initialNumberValue ?? null\n );\n\n useEffect(() => {\n if (\n comparator &&\n numberValue &&\n (comparator !== initialComparator || numberValue !== initialNumberValue)\n ) {\n const newValue = `${comparator}${numberValue}`;\n\n onChange(newValue);\n }\n }, [\n comparator,\n initialComparator,\n initialNumberValue,\n numberValue,\n onChange,\n ]);\n\n return (\n <div className=\"flex gap-1\">\n <Select onValueChange={setComparator} defaultValue={initialComparator}>\n <Select.Trigger className=\"w-20\">\n <Select.Value placeholder=\"Select a comparator\" />\n </Select.Trigger>\n <Select.Content>\n <Select.Item value=\"<\">{`<`}</Select.Item>\n <Select.Item value=\"<=\">{`<=`}</Select.Item>\n <Select.Item value=\"=\">{`=`}</Select.Item>\n <Select.Item value=\">=\">{`>=`}</Select.Item>\n <Select.Item value=\">\">{`>`}</Select.Item>\n </Select.Content>\n </Select>\n <Input\n type=\"number\"\n defaultValue={numberValue ?? undefined}\n onChange={(e) => setNumberValue(e.target.value)}\n className=\"w-full\"\n />\n </div>\n );\n};\n"],"names":["jsxs","jsx"],"mappings":";;;;;;;;AAMA,MAAM,sBAAsB,CAC1B,UACwE;AACpE,MAAA;AACA,MAAA;AAEA,MAAA,OAAO,UAAU,YAAY,CAAC,MAAM,OAAO,KAAK,CAAC,GAAG;AAEzC,iBAAA;AACb,kBAAc,MAAM;EAAS,WACpB,OAAO,UAAU,UAAU;AAEpC,UAAM,cAAc,CAAC,MAAM,MAAM,KAAK,KAAK,GAAG;AAE9C,UAAM,oBAAoB,YAAY;AAAA,MAAK,CAAC,SAC1C,MAAM,WAAW,IAAI;AAAA,IAAA;AAEvB,QAAI,mBAAmB;AACR,mBAAA;AACC,oBAAA,MAAM,MAAM,kBAAkB,MAAM;AAAA,IACpD;AAAA,EACF;AAEO,SAAA,EAAE,YAAY;AACvB;AAkBO,MAAM,eAAsC,CAAC,EAAE,OAAO,eAAe;AAC1E,QAAM,EAAE,YAAY,mBAAmB,aAAa,mBAAmB,IACrE,QAAQ,MAAM,oBAAoB,KAAK,GAAG,CAAC,KAAK,CAAC;AAC7C,QAAA,CAAC,YAAY,aAAa,IAAI;AAAA,IAClC,qBAAqB;AAAA,EAAA;AAEjB,QAAA,CAAC,aAAa,cAAc,IAAI;AAAA,IACpC,sBAAsB;AAAA,EAAA;AAGxB,YAAU,MAAM;AACd,QACE,cACA,gBACC,eAAe,qBAAqB,gBAAgB,qBACrD;AACA,YAAM,WAAW,GAAG,UAAU,GAAG,WAAW;AAE5C,eAAS,QAAQ;AAAA,IACnB;AAAA,EAAA,GACC;AAAA,IACD;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA,CACD;AAGC,SAAAA,kCAAA,KAAC,OAAI,EAAA,WAAU,cACb,UAAA;AAAA,IAAAA,kCAAA,KAAC,QAAO,EAAA,eAAe,eAAe,cAAc,mBAClD,UAAA;AAAA,MAACC,kCAAAA,IAAA,OAAO,SAAP,EAAe,WAAU,QACxB,UAACA,sCAAA,OAAO,OAAP,EAAa,aAAY,sBAAA,CAAsB,EAClD,CAAA;AAAA,MACAD,kCAAAA,KAAC,OAAO,SAAP,EACC,UAAA;AAAA,QAAAC,sCAAC,OAAO,MAAP,EAAY,OAAM,KAAK,UAAI,KAAA;AAAA,8CAC3B,OAAO,MAAP,EAAY,OAAM,MAAM,UAAK,MAAA;AAAA,8CAC7B,OAAO,MAAP,EAAY,OAAM,KAAK,UAAI,KAAA;AAAA,8CAC3B,OAAO,MAAP,EAAY,OAAM,MAAM,UAAK,MAAA;AAAA,8CAC7B,OAAO,MAAP,EAAY,OAAM,KAAK,UAAI,KAAA;AAAA,MAAA,GAC9B;AAAA,IAAA,GACF;AAAA,IACAA,kCAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,cAAc,eAAe;AAAA,QAC7B,UAAU,CAAC,MAAM,eAAe,EAAE,OAAO,KAAK;AAAA,QAC9C,WAAU;AAAA,MAAA;AAAA,IACZ;AAAA,EACF,EAAA,CAAA;AAEJ;"}
1
+ {"version":3,"file":"EnumKeyInput.mjs","sources":["../../../src/components/DictionaryFieldEditor/EnumKeyInput.tsx"],"sourcesContent":["'use client';\n\nimport { useEffect, useMemo, useState, type FC } from 'react';\nimport { Input } from '../Input';\nimport { Select } from '../Select';\n\nconst extractInitialState = (\n value: string | number\n): { comparator: string | undefined; numberValue: string | undefined } => {\n let comparator;\n let numberValue;\n\n if (typeof value === 'number' || !isNaN(Number(value))) {\n // If value is a number or numeric string, set comparator to '=' and numberValue accordingly\n comparator = '=';\n numberValue = value.toString();\n } else if (typeof value === 'string') {\n // Define possible comparators\n const comparators = ['<=', '>=', '<', '>', '='];\n // Find the comparator that matches the start of the string\n const matchedComparator = comparators.find((comp) =>\n value.startsWith(comp)\n );\n if (matchedComparator) {\n comparator = matchedComparator;\n numberValue = value.slice(matchedComparator.length);\n }\n }\n\n return { comparator, numberValue };\n};\n\ntype EnumKeyInputProps = {\n value: string | number;\n onChange: (value: string) => void;\n};\n\n/**\n * Example of values:\n * - `<1`\n * - `>-44.3`\n * - `=999`\n * - `<=1`\n * - `>=1`\n * - 88\n * - `-1`\n *\n */\nexport const EnumKeyInput: FC<EnumKeyInputProps> = ({ value, onChange }) => {\n const { comparator: initialComparator, numberValue: initialNumberValue } =\n useMemo(() => extractInitialState(value), [value]);\n const [comparator, setComparator] = useState<string | null>(\n initialComparator ?? null\n );\n const [numberValue, setNumberValue] = useState<string | null>(\n initialNumberValue ?? null\n );\n\n useEffect(() => {\n if (\n comparator &&\n numberValue &&\n (comparator !== initialComparator || numberValue !== initialNumberValue)\n ) {\n const newValue = `${comparator}${numberValue}`;\n\n onChange(newValue);\n }\n }, [\n comparator,\n initialComparator,\n initialNumberValue,\n numberValue,\n onChange,\n ]);\n\n return (\n <div className=\"flex gap-1\">\n <Select onValueChange={setComparator} defaultValue={initialComparator}>\n <Select.Trigger className=\"w-20\">\n <Select.Value placeholder=\"Select a comparator\" />\n </Select.Trigger>\n <Select.Content>\n <Select.Item value=\"<\">{`<`}</Select.Item>\n <Select.Item value=\"<=\">{`<=`}</Select.Item>\n <Select.Item value=\"=\">{`=`}</Select.Item>\n <Select.Item value=\">=\">{`>=`}</Select.Item>\n <Select.Item value=\">\">{`>`}</Select.Item>\n </Select.Content>\n </Select>\n <Input\n type=\"number\"\n defaultValue={numberValue ?? undefined}\n onChange={(e) => setNumberValue(e.target.value)}\n className=\"w-full\"\n />\n </div>\n );\n};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,aAAY,sBAAA,CAAsB,EAClD,CAAA;AAAA,MACAD,kCAAAA,KAAC,OAAO,SAAP,EACC,UAAA;AAAA,QAAAC,sCAAC,OAAO,MAAP,EAAY,OAAM,KAAK,UAAI,KAAA;AAAA,8CAC3B,OAAO,MAAP,EAAY,OAAM,MAAM,UAAK,MAAA;AAAA,8CAC7B,OAAO,MAAP,EAAY,OAAM,KAAK,UAAI,KAAA;AAAA,8CAC3B,OAAO,MAAP,EAAY,OAAM,MAAM,UAAK,MAAA;AAAA,8CAC7B,OAAO,MAAP,EAAY,OAAM,KAAK,UAAI,IAAA,CAAA;AAAA,MAAA,EAC9B,CAAA;AAAA,IAAA,GACF;AAAA,IACAA,kCAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,cAAc,eAAe;AAAA,QAC7B,UAAU,CAAC,MAAM,eAAe,EAAE,OAAO,KAAK;AAAA,QAC9C,WAAU;AAAA,MAAA;AAAA,IAAA;AAAA,EACZ,GACF;AAEJ;"}
@@ -1 +1 @@
1
- {"version":3,"file":"JSONEditor.cjs","sources":["../../../src/components/DictionaryFieldEditor/JSONEditor.tsx"],"sourcesContent":["import { Dictionary } from '@intlayer/core';\nimport type { FC } from 'react';\nimport { useShallow } from 'zustand/react/shallow';\nimport { ContentEditorTextArea } from '../ContentEditor/ContentEditorTextArea';\nimport { useEditedContentStore } from '../DictionaryEditor';\nimport { SaveForm } from './SaveForm/SaveForm';\n\ntype JSONEditorProps = {\n dictionary: Dictionary;\n};\n\nexport const JSONEditor: FC<JSONEditorProps> = ({ dictionary }) => {\n const { setEditedContent, editedContent } = useEditedContentStore(\n useShallow((s) => ({\n editedContent: s.editedContent,\n setEditedContent: s.setEditedContent,\n }))\n );\n\n const isValidJSON = (jsonString: string): boolean => {\n try {\n JSON.parse(jsonString);\n return true; // Valid JSON\n } catch (_error) {\n return false; // Invalid JSON\n }\n };\n\n const displayedContent =\n editedContent[dictionary.key]?.content ?? dictionary?.content ?? {};\n\n return (\n <>\n <ContentEditorTextArea\n key={JSON.stringify(displayedContent)}\n onContentChange={(content) =>\n setEditedContent(dictionary.key, JSON.parse(content))\n }\n validate={isValidJSON}\n className=\"text-sm\"\n variant=\"default\"\n >\n {JSON.stringify(displayedContent, null, 2)}\n </ContentEditorTextArea>\n <SaveForm dictionary={dictionary} />\n </>\n );\n};\n"],"names":["useEditedContentStore","useShallow","jsxs","Fragment","jsx","ContentEditorTextArea","SaveForm"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWO,MAAM,aAAkC,CAAC,EAAE,iBAAiB;AAC3D,QAAA,EAAE,kBAAkB,cAAA,IAAkBA,kDAAA;AAAA,IAC1CC,QAAA,WAAW,CAAC,OAAO;AAAA,MACjB,eAAe,EAAE;AAAA,MACjB,kBAAkB,EAAE;AAAA,IAAA,EACpB;AAAA,EAAA;AAGE,QAAA,cAAc,CAAC,eAAgC;AAC/C,QAAA;AACF,WAAK,MAAM,UAAU;AACd,aAAA;AAAA,aACA,QAAQ;AACR,aAAA;AAAA,IACT;AAAA,EAAA;AAGI,QAAA,mBACJ,cAAc,WAAW,GAAG,GAAG,WAAW,YAAY,WAAW;AAEnE,SAEIC,2BAAA,kBAAA,KAAAC,uCAAA,EAAA,UAAA;AAAA,IAAAC,2BAAA,kBAAA;AAAA,MAACC,+CAAA;AAAA,MAAA;AAAA,QAEC,iBAAiB,CAAC,YAChB,iBAAiB,WAAW,KAAK,KAAK,MAAM,OAAO,CAAC;AAAA,QAEtD,UAAU;AAAA,QACV,WAAU;AAAA,QACV,SAAQ;AAAA,QAEP,UAAK,KAAA,UAAU,kBAAkB,MAAM,CAAC;AAAA,MAAA;AAAA,MARpC,KAAK,UAAU,gBAAgB;AAAA,IAStC;AAAA,IACAD,iDAACE,mDAAAA,YAAS,YAAwB;AAAA,EACpC,EAAA,CAAA;AAEJ;;"}
1
+ {"version":3,"file":"JSONEditor.cjs","sources":["../../../src/components/DictionaryFieldEditor/JSONEditor.tsx"],"sourcesContent":["import { Dictionary } from '@intlayer/core';\nimport type { FC } from 'react';\nimport { useShallow } from 'zustand/react/shallow';\nimport { ContentEditorTextArea } from '../ContentEditor/ContentEditorTextArea';\nimport { useEditedContentStore } from '../DictionaryEditor';\nimport { SaveForm } from './SaveForm/SaveForm';\n\ntype JSONEditorProps = {\n dictionary: Dictionary;\n};\n\nexport const JSONEditor: FC<JSONEditorProps> = ({ dictionary }) => {\n const { setEditedContent, editedContent } = useEditedContentStore(\n useShallow((s) => ({\n editedContent: s.editedContent,\n setEditedContent: s.setEditedContent,\n }))\n );\n\n const isValidJSON = (jsonString: string): boolean => {\n try {\n JSON.parse(jsonString);\n return true; // Valid JSON\n } catch (_error) {\n return false; // Invalid JSON\n }\n };\n\n const displayedContent =\n editedContent[dictionary.key]?.content ?? dictionary?.content ?? {};\n\n return (\n <>\n <ContentEditorTextArea\n key={JSON.stringify(displayedContent)}\n onContentChange={(content) =>\n setEditedContent(dictionary.key, JSON.parse(content))\n }\n validate={isValidJSON}\n className=\"text-sm\"\n variant=\"default\"\n >\n {JSON.stringify(displayedContent, null, 2)}\n </ContentEditorTextArea>\n <SaveForm dictionary={dictionary} />\n </>\n );\n};\n"],"names":["useEditedContentStore","useShallow","jsxs","Fragment","jsx","ContentEditorTextArea","SaveForm"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWO,MAAM,aAAkC,CAAC,EAAE,iBAAiB;AAC3D,QAAA,EAAE,kBAAkB,cAAA,IAAkBA,kDAAA;AAAA,IAC1CC,QAAA,WAAW,CAAC,OAAO;AAAA,MACjB,eAAe,EAAE;AAAA,MACjB,kBAAkB,EAAE;AAAA,IAAA,EACpB;AAAA,EACJ;AAEM,QAAA,cAAc,CAAC,eAAgC;AAC/C,QAAA;AACF,WAAK,MAAM,UAAU;AACd,aAAA;AAAA,aACA,QAAQ;AACR,aAAA;AAAA,IAAA;AAAA,EAEX;AAEM,QAAA,mBACJ,cAAc,WAAW,GAAG,GAAG,WAAW,YAAY,WAAW,CAAC;AAEpE,SAEIC,2BAAA,kBAAA,KAAAC,uCAAA,EAAA,UAAA;AAAA,IAAAC,2BAAA,kBAAA;AAAA,MAACC,+CAAA;AAAA,MAAA;AAAA,QAEC,iBAAiB,CAAC,YAChB,iBAAiB,WAAW,KAAK,KAAK,MAAM,OAAO,CAAC;AAAA,QAEtD,UAAU;AAAA,QACV,WAAU;AAAA,QACV,SAAQ;AAAA,QAEP,UAAK,KAAA,UAAU,kBAAkB,MAAM,CAAC;AAAA,MAAA;AAAA,MARpC,KAAK,UAAU,gBAAgB;AAAA,IAStC;AAAA,IACAD,iDAACE,mDAAAA,YAAS,WAAwB,CAAA;AAAA,EAAA,GACpC;AAEJ;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"JSONEditor.mjs","sources":["../../../src/components/DictionaryFieldEditor/JSONEditor.tsx"],"sourcesContent":["import { Dictionary } from '@intlayer/core';\nimport type { FC } from 'react';\nimport { useShallow } from 'zustand/react/shallow';\nimport { ContentEditorTextArea } from '../ContentEditor/ContentEditorTextArea';\nimport { useEditedContentStore } from '../DictionaryEditor';\nimport { SaveForm } from './SaveForm/SaveForm';\n\ntype JSONEditorProps = {\n dictionary: Dictionary;\n};\n\nexport const JSONEditor: FC<JSONEditorProps> = ({ dictionary }) => {\n const { setEditedContent, editedContent } = useEditedContentStore(\n useShallow((s) => ({\n editedContent: s.editedContent,\n setEditedContent: s.setEditedContent,\n }))\n );\n\n const isValidJSON = (jsonString: string): boolean => {\n try {\n JSON.parse(jsonString);\n return true; // Valid JSON\n } catch (_error) {\n return false; // Invalid JSON\n }\n };\n\n const displayedContent =\n editedContent[dictionary.key]?.content ?? dictionary?.content ?? {};\n\n return (\n <>\n <ContentEditorTextArea\n key={JSON.stringify(displayedContent)}\n onContentChange={(content) =>\n setEditedContent(dictionary.key, JSON.parse(content))\n }\n validate={isValidJSON}\n className=\"text-sm\"\n variant=\"default\"\n >\n {JSON.stringify(displayedContent, null, 2)}\n </ContentEditorTextArea>\n <SaveForm dictionary={dictionary} />\n </>\n );\n};\n"],"names":["jsxs","Fragment","jsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAWO,MAAM,aAAkC,CAAC,EAAE,iBAAiB;AAC3D,QAAA,EAAE,kBAAkB,cAAA,IAAkB;AAAA,IAC1C,WAAW,CAAC,OAAO;AAAA,MACjB,eAAe,EAAE;AAAA,MACjB,kBAAkB,EAAE;AAAA,IAAA,EACpB;AAAA,EAAA;AAGE,QAAA,cAAc,CAAC,eAAgC;AAC/C,QAAA;AACF,WAAK,MAAM,UAAU;AACd,aAAA;AAAA,aACA,QAAQ;AACR,aAAA;AAAA,IACT;AAAA,EAAA;AAGI,QAAA,mBACJ,cAAc,WAAW,GAAG,GAAG,WAAW,YAAY,WAAW;AAEnE,SAEIA,kCAAA,KAAAC,4BAAA,EAAA,UAAA;AAAA,IAAAC,kCAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QAEC,iBAAiB,CAAC,YAChB,iBAAiB,WAAW,KAAK,KAAK,MAAM,OAAO,CAAC;AAAA,QAEtD,UAAU;AAAA,QACV,WAAU;AAAA,QACV,SAAQ;AAAA,QAEP,UAAK,KAAA,UAAU,kBAAkB,MAAM,CAAC;AAAA,MAAA;AAAA,MARpC,KAAK,UAAU,gBAAgB;AAAA,IAStC;AAAA,IACAA,sCAAC,YAAS,YAAwB;AAAA,EACpC,EAAA,CAAA;AAEJ;"}
1
+ {"version":3,"file":"JSONEditor.mjs","sources":["../../../src/components/DictionaryFieldEditor/JSONEditor.tsx"],"sourcesContent":["import { Dictionary } from '@intlayer/core';\nimport type { FC } from 'react';\nimport { useShallow } from 'zustand/react/shallow';\nimport { ContentEditorTextArea } from '../ContentEditor/ContentEditorTextArea';\nimport { useEditedContentStore } from '../DictionaryEditor';\nimport { SaveForm } from './SaveForm/SaveForm';\n\ntype JSONEditorProps = {\n dictionary: Dictionary;\n};\n\nexport const JSONEditor: FC<JSONEditorProps> = ({ dictionary }) => {\n const { setEditedContent, editedContent } = useEditedContentStore(\n useShallow((s) => ({\n editedContent: s.editedContent,\n setEditedContent: s.setEditedContent,\n }))\n );\n\n const isValidJSON = (jsonString: string): boolean => {\n try {\n JSON.parse(jsonString);\n return true; // Valid JSON\n } catch (_error) {\n return false; // Invalid JSON\n }\n };\n\n const displayedContent =\n editedContent[dictionary.key]?.content ?? dictionary?.content ?? {};\n\n return (\n <>\n <ContentEditorTextArea\n key={JSON.stringify(displayedContent)}\n onContentChange={(content) =>\n setEditedContent(dictionary.key, JSON.parse(content))\n }\n validate={isValidJSON}\n className=\"text-sm\"\n variant=\"default\"\n >\n {JSON.stringify(displayedContent, null, 2)}\n </ContentEditorTextArea>\n <SaveForm dictionary={dictionary} />\n </>\n );\n};\n"],"names":["jsxs","Fragment","jsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAWO,MAAM,aAAkC,CAAC,EAAE,iBAAiB;AAC3D,QAAA,EAAE,kBAAkB,cAAA,IAAkB;AAAA,IAC1C,WAAW,CAAC,OAAO;AAAA,MACjB,eAAe,EAAE;AAAA,MACjB,kBAAkB,EAAE;AAAA,IAAA,EACpB;AAAA,EACJ;AAEM,QAAA,cAAc,CAAC,eAAgC;AAC/C,QAAA;AACF,WAAK,MAAM,UAAU;AACd,aAAA;AAAA,aACA,QAAQ;AACR,aAAA;AAAA,IAAA;AAAA,EAEX;AAEM,QAAA,mBACJ,cAAc,WAAW,GAAG,GAAG,WAAW,YAAY,WAAW,CAAC;AAEpE,SAEIA,kCAAA,KAAAC,4BAAA,EAAA,UAAA;AAAA,IAAAC,kCAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QAEC,iBAAiB,CAAC,YAChB,iBAAiB,WAAW,KAAK,KAAK,MAAM,OAAO,CAAC;AAAA,QAEtD,UAAU;AAAA,QACV,WAAU;AAAA,QACV,SAAQ;AAAA,QAEP,UAAK,KAAA,UAAU,kBAAkB,MAAM,CAAC;AAAA,MAAA;AAAA,MARpC,KAAK,UAAU,gBAAgB;AAAA,IAStC;AAAA,IACAA,sCAAC,YAAS,WAAwB,CAAA;AAAA,EAAA,GACpC;AAEJ;"}
@@ -1 +1 @@
1
- {"version":3,"file":"KeyPathBreadcrumb.cjs","sources":["../../../src/components/DictionaryFieldEditor/KeyPathBreadcrumb.tsx"],"sourcesContent":["import type { KeyPath } from '@intlayer/core';\nimport type { FC } from 'react';\nimport { Breadcrumb, type BreadcrumbLink } from '../Breadcrumb';\n\ntype KeyPathBreadcrumbProps = {\n dictionaryKey: string;\n keyPath: KeyPath[];\n onClickKeyPath: (keyPath: KeyPath[]) => void;\n};\n\nexport const KeyPathBreadcrumb: FC<KeyPathBreadcrumbProps> = ({\n keyPath,\n dictionaryKey,\n onClickKeyPath,\n}) => {\n const formattedKeyPath: BreadcrumbLink[] = [\n { text: dictionaryKey, onClick: () => onClickKeyPath([]) },\n ...keyPath.map((el, index) => ({\n onClick: () =>\n onClickKeyPath(\n keyPath\n // With keyPath = [{type: NodeType.Object, key: '0'}, {type: NodeType.Array, key: '0'}, {type: NodeType.Object, key: '1'}]\n // If index is 0 -> onFocusKeyPath([{type: NodeType.Object, key: '0'}])\n // If index is 1 -> onFocusKeyPath([{type: NodeType.Object, key: '0'}, {type: NodeType.Array, key: '0'}])\n .slice(0, index + 1)\n ),\n text: el.key.toString(),\n })),\n ];\n\n return <Breadcrumb links={formattedKeyPath} />;\n};\n"],"names":["jsx","Breadcrumb"],"mappings":";;;;AAUO,MAAM,oBAAgD,CAAC;AAAA,EAC5D;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,QAAM,mBAAqC;AAAA,IACzC,EAAE,MAAM,eAAe,SAAS,MAAM,eAAe,CAAE,CAAA,EAAE;AAAA,IACzD,GAAG,QAAQ,IAAI,CAAC,IAAI,WAAW;AAAA,MAC7B,SAAS,MACP;AAAA,QACE,QAIG,MAAM,GAAG,QAAQ,CAAC;AAAA,MACvB;AAAA,MACF,MAAM,GAAG,IAAI,SAAS;AAAA,IAAA,EACtB;AAAA,EAAA;AAGG,SAAAA,2BAAA,kBAAA,IAACC,4BAAW,YAAA,EAAA,OAAO,iBAAkB,CAAA;AAC9C;;"}
1
+ {"version":3,"file":"KeyPathBreadcrumb.cjs","sources":["../../../src/components/DictionaryFieldEditor/KeyPathBreadcrumb.tsx"],"sourcesContent":["import type { KeyPath } from '@intlayer/core';\nimport type { FC } from 'react';\nimport { Breadcrumb, type BreadcrumbLink } from '../Breadcrumb';\n\ntype KeyPathBreadcrumbProps = {\n dictionaryKey: string;\n keyPath: KeyPath[];\n onClickKeyPath: (keyPath: KeyPath[]) => void;\n};\n\nexport const KeyPathBreadcrumb: FC<KeyPathBreadcrumbProps> = ({\n keyPath,\n dictionaryKey,\n onClickKeyPath,\n}) => {\n const formattedKeyPath: BreadcrumbLink[] = [\n { text: dictionaryKey, onClick: () => onClickKeyPath([]) },\n ...keyPath.map((el, index) => ({\n onClick: () =>\n onClickKeyPath(\n keyPath\n // With keyPath = [{type: NodeType.Object, key: '0'}, {type: NodeType.Array, key: '0'}, {type: NodeType.Object, key: '1'}]\n // If index is 0 -> onFocusKeyPath([{type: NodeType.Object, key: '0'}])\n // If index is 1 -> onFocusKeyPath([{type: NodeType.Object, key: '0'}, {type: NodeType.Array, key: '0'}])\n .slice(0, index + 1)\n ),\n text: el.key.toString(),\n })),\n ];\n\n return <Breadcrumb links={formattedKeyPath} />;\n};\n"],"names":["jsx","Breadcrumb"],"mappings":";;;;AAUO,MAAM,oBAAgD,CAAC;AAAA,EAC5D;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,QAAM,mBAAqC;AAAA,IACzC,EAAE,MAAM,eAAe,SAAS,MAAM,eAAe,CAAE,CAAA,EAAE;AAAA,IACzD,GAAG,QAAQ,IAAI,CAAC,IAAI,WAAW;AAAA,MAC7B,SAAS,MACP;AAAA,QACE,QAIG,MAAM,GAAG,QAAQ,CAAC;AAAA,MACvB;AAAA,MACF,MAAM,GAAG,IAAI,SAAS;AAAA,IAAA,EACtB;AAAA,EACJ;AAEO,SAAAA,2BAAA,kBAAA,IAACC,4BAAW,YAAA,EAAA,OAAO,iBAAkB,CAAA;AAC9C;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"KeyPathBreadcrumb.mjs","sources":["../../../src/components/DictionaryFieldEditor/KeyPathBreadcrumb.tsx"],"sourcesContent":["import type { KeyPath } from '@intlayer/core';\nimport type { FC } from 'react';\nimport { Breadcrumb, type BreadcrumbLink } from '../Breadcrumb';\n\ntype KeyPathBreadcrumbProps = {\n dictionaryKey: string;\n keyPath: KeyPath[];\n onClickKeyPath: (keyPath: KeyPath[]) => void;\n};\n\nexport const KeyPathBreadcrumb: FC<KeyPathBreadcrumbProps> = ({\n keyPath,\n dictionaryKey,\n onClickKeyPath,\n}) => {\n const formattedKeyPath: BreadcrumbLink[] = [\n { text: dictionaryKey, onClick: () => onClickKeyPath([]) },\n ...keyPath.map((el, index) => ({\n onClick: () =>\n onClickKeyPath(\n keyPath\n // With keyPath = [{type: NodeType.Object, key: '0'}, {type: NodeType.Array, key: '0'}, {type: NodeType.Object, key: '1'}]\n // If index is 0 -> onFocusKeyPath([{type: NodeType.Object, key: '0'}])\n // If index is 1 -> onFocusKeyPath([{type: NodeType.Object, key: '0'}, {type: NodeType.Array, key: '0'}])\n .slice(0, index + 1)\n ),\n text: el.key.toString(),\n })),\n ];\n\n return <Breadcrumb links={formattedKeyPath} />;\n};\n"],"names":["jsx"],"mappings":";;AAUO,MAAM,oBAAgD,CAAC;AAAA,EAC5D;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,QAAM,mBAAqC;AAAA,IACzC,EAAE,MAAM,eAAe,SAAS,MAAM,eAAe,CAAE,CAAA,EAAE;AAAA,IACzD,GAAG,QAAQ,IAAI,CAAC,IAAI,WAAW;AAAA,MAC7B,SAAS,MACP;AAAA,QACE,QAIG,MAAM,GAAG,QAAQ,CAAC;AAAA,MACvB;AAAA,MACF,MAAM,GAAG,IAAI,SAAS;AAAA,IAAA,EACtB;AAAA,EAAA;AAGG,SAAAA,kCAAA,IAAC,YAAW,EAAA,OAAO,iBAAkB,CAAA;AAC9C;"}
1
+ {"version":3,"file":"KeyPathBreadcrumb.mjs","sources":["../../../src/components/DictionaryFieldEditor/KeyPathBreadcrumb.tsx"],"sourcesContent":["import type { KeyPath } from '@intlayer/core';\nimport type { FC } from 'react';\nimport { Breadcrumb, type BreadcrumbLink } from '../Breadcrumb';\n\ntype KeyPathBreadcrumbProps = {\n dictionaryKey: string;\n keyPath: KeyPath[];\n onClickKeyPath: (keyPath: KeyPath[]) => void;\n};\n\nexport const KeyPathBreadcrumb: FC<KeyPathBreadcrumbProps> = ({\n keyPath,\n dictionaryKey,\n onClickKeyPath,\n}) => {\n const formattedKeyPath: BreadcrumbLink[] = [\n { text: dictionaryKey, onClick: () => onClickKeyPath([]) },\n ...keyPath.map((el, index) => ({\n onClick: () =>\n onClickKeyPath(\n keyPath\n // With keyPath = [{type: NodeType.Object, key: '0'}, {type: NodeType.Array, key: '0'}, {type: NodeType.Object, key: '1'}]\n // If index is 0 -> onFocusKeyPath([{type: NodeType.Object, key: '0'}])\n // If index is 1 -> onFocusKeyPath([{type: NodeType.Object, key: '0'}, {type: NodeType.Array, key: '0'}])\n .slice(0, index + 1)\n ),\n text: el.key.toString(),\n })),\n ];\n\n return <Breadcrumb links={formattedKeyPath} />;\n};\n"],"names":["jsx"],"mappings":";;AAUO,MAAM,oBAAgD,CAAC;AAAA,EAC5D;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,QAAM,mBAAqC;AAAA,IACzC,EAAE,MAAM,eAAe,SAAS,MAAM,eAAe,CAAE,CAAA,EAAE;AAAA,IACzD,GAAG,QAAQ,IAAI,CAAC,IAAI,WAAW;AAAA,MAC7B,SAAS,MACP;AAAA,QACE,QAIG,MAAM,GAAG,QAAQ,CAAC;AAAA,MACvB;AAAA,MACF,MAAM,GAAG,IAAI,SAAS;AAAA,IAAA,EACtB;AAAA,EACJ;AAEO,SAAAA,kCAAA,IAAC,YAAW,EAAA,OAAO,iBAAkB,CAAA;AAC9C;"}