@intlayer/design-system 3.3.2 → 3.3.4

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 (471) hide show
  1. package/dist/.vite/manifest.json +233 -180
  2. package/dist/{Form-DERuauvB.cjs → Form-BDcoNTLV.cjs} +2 -2
  3. package/dist/{Form-DERuauvB.cjs.map → Form-BDcoNTLV.cjs.map} +1 -1
  4. package/dist/{Form-CQpKjeW6.js → Form-DhsgC7kB.js} +2 -2
  5. package/dist/{Form-CQpKjeW6.js.map → Form-DhsgC7kB.js.map} +1 -1
  6. package/dist/components/Accordion/Accordion.cjs +1 -1
  7. package/dist/components/Accordion/Accordion.mjs +1 -1
  8. package/dist/components/Auth/AuthModal/index.cjs +1 -1
  9. package/dist/components/Auth/AuthModal/index.mjs +1 -1
  10. package/dist/components/Auth/AuthenticationBarrier/AuthenticationBarrierClient.cjs +1 -1
  11. package/dist/components/Auth/AuthenticationBarrier/AuthenticationBarrierClient.mjs +1 -1
  12. package/dist/components/Auth/ChangePasswordForm/ChangePasswordForm.cjs +2 -2
  13. package/dist/components/Auth/ChangePasswordForm/ChangePasswordForm.mjs +2 -2
  14. package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.cjs +1 -1
  15. package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.mjs +1 -1
  16. package/dist/components/Auth/ExternalsLoginButtons/assets/GithubLogo.cjs +1 -1
  17. package/dist/components/Auth/ExternalsLoginButtons/assets/GithubLogo.mjs +1 -1
  18. package/dist/components/Auth/ExternalsLoginButtons/assets/GoogleLogo.cjs +1 -1
  19. package/dist/components/Auth/ExternalsLoginButtons/assets/GoogleLogo.mjs +1 -1
  20. package/dist/components/Auth/ResetPasswordForm/ResetPasswordForm.cjs +2 -2
  21. package/dist/components/Auth/ResetPasswordForm/ResetPasswordForm.mjs +2 -2
  22. package/dist/components/Auth/SignInForm/SignInForm.cjs +2 -2
  23. package/dist/components/Auth/SignInForm/SignInForm.mjs +2 -2
  24. package/dist/components/Auth/SignUpForm/SignUpForm.cjs +2 -2
  25. package/dist/components/Auth/SignUpForm/SignUpForm.mjs +2 -2
  26. package/dist/components/Avatar/index.cjs +1 -1
  27. package/dist/components/Avatar/index.mjs +1 -1
  28. package/dist/components/Badge/index.cjs +1 -1
  29. package/dist/components/Badge/index.d.ts +1 -1
  30. package/dist/components/Badge/index.mjs +1 -1
  31. package/dist/components/Breadcrumb/index.cjs +39 -20
  32. package/dist/components/Breadcrumb/index.cjs.map +1 -1
  33. package/dist/components/Breadcrumb/index.d.ts +2 -2
  34. package/dist/components/Breadcrumb/index.d.ts.map +1 -1
  35. package/dist/components/Breadcrumb/index.mjs +39 -20
  36. package/dist/components/Breadcrumb/index.mjs.map +1 -1
  37. package/dist/components/Button/Button.cjs +10 -4
  38. package/dist/components/Button/Button.cjs.map +1 -1
  39. package/dist/components/Button/Button.d.ts +2 -2
  40. package/dist/components/Button/Button.d.ts.map +1 -1
  41. package/dist/components/Button/Button.mjs +10 -4
  42. package/dist/components/Button/Button.mjs.map +1 -1
  43. package/dist/components/Command/index.cjs +1 -1
  44. package/dist/components/Command/index.d.ts.map +1 -1
  45. package/dist/components/Command/index.mjs +1 -1
  46. package/dist/components/Container/index.cjs +11 -2
  47. package/dist/components/Container/index.cjs.map +1 -1
  48. package/dist/components/Container/index.d.ts +2 -0
  49. package/dist/components/Container/index.d.ts.map +1 -1
  50. package/dist/components/Container/index.mjs +11 -2
  51. package/dist/components/Container/index.mjs.map +1 -1
  52. package/dist/components/ContentEditor/ContentEditor.cjs +1 -1
  53. package/dist/components/ContentEditor/ContentEditor.mjs +1 -1
  54. package/dist/components/ContentEditor/ContentEditorTextArea.cjs +18 -5
  55. package/dist/components/ContentEditor/ContentEditorTextArea.cjs.map +1 -1
  56. package/dist/components/ContentEditor/ContentEditorTextArea.d.ts +2 -0
  57. package/dist/components/ContentEditor/ContentEditorTextArea.d.ts.map +1 -1
  58. package/dist/components/ContentEditor/ContentEditorTextArea.mjs +18 -5
  59. package/dist/components/ContentEditor/ContentEditorTextArea.mjs.map +1 -1
  60. package/dist/components/ContentSelector/ContentSelector.cjs +1 -1
  61. package/dist/components/ContentSelector/ContentSelector.mjs +1 -1
  62. package/dist/components/CopyToClipboard/index.cjs +1 -1
  63. package/dist/components/CopyToClipboard/index.mjs +1 -1
  64. package/dist/components/DictionaryEditor/DictionaryEditor.cjs +11 -5
  65. package/dist/components/DictionaryEditor/DictionaryEditor.cjs.map +1 -1
  66. package/dist/components/DictionaryEditor/DictionaryEditor.d.ts.map +1 -1
  67. package/dist/components/DictionaryEditor/DictionaryEditor.mjs +11 -5
  68. package/dist/components/DictionaryEditor/DictionaryEditor.mjs.map +1 -1
  69. package/dist/components/DictionaryEditor/ItemLayout.cjs +1 -1
  70. package/dist/components/DictionaryEditor/ItemLayout.mjs +1 -1
  71. package/dist/components/DictionaryEditor/NodeWrapper/ArrayWrapper.cjs +2 -2
  72. package/dist/components/DictionaryEditor/NodeWrapper/ArrayWrapper.mjs +2 -2
  73. package/dist/components/DictionaryEditor/NodeWrapper/EnumerationWrapper.cjs +2 -2
  74. package/dist/components/DictionaryEditor/NodeWrapper/EnumerationWrapper.mjs +2 -2
  75. package/dist/components/DictionaryEditor/NodeWrapper/NestedObjectWrapper.cjs +2 -2
  76. package/dist/components/DictionaryEditor/NodeWrapper/NestedObjectWrapper.mjs +2 -2
  77. package/dist/components/DictionaryEditor/NodeWrapper/StringWrapper.cjs +1 -1
  78. package/dist/components/DictionaryEditor/NodeWrapper/StringWrapper.mjs +1 -1
  79. package/dist/components/DictionaryEditor/NodeWrapper/TranslationWrapper.cjs +2 -2
  80. package/dist/components/DictionaryEditor/NodeWrapper/TranslationWrapper.mjs +2 -2
  81. package/dist/components/DictionaryEditor/NodeWrapper/index.cjs +2 -2
  82. package/dist/components/DictionaryEditor/NodeWrapper/index.d.ts +2 -2
  83. package/dist/components/DictionaryEditor/NodeWrapper/index.d.ts.map +1 -1
  84. package/dist/components/DictionaryEditor/NodeWrapper/index.mjs +2 -2
  85. package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.cjs +2 -2
  86. package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.mjs +2 -2
  87. package/dist/components/DictionaryEditor/useEditedContentStore.cjs +13 -10
  88. package/dist/components/DictionaryEditor/useEditedContentStore.cjs.map +1 -1
  89. package/dist/components/DictionaryEditor/useEditedContentStore.d.ts +1 -0
  90. package/dist/components/DictionaryEditor/useEditedContentStore.d.ts.map +1 -1
  91. package/dist/components/DictionaryEditor/useEditedContentStore.mjs +13 -10
  92. package/dist/components/DictionaryEditor/useEditedContentStore.mjs.map +1 -1
  93. package/dist/components/DictionaryEditor/validDictionaryChangeButtons.content.cjs +6 -6
  94. package/dist/components/DictionaryEditor/validDictionaryChangeButtons.content.cjs.map +1 -1
  95. package/dist/components/DictionaryEditor/validDictionaryChangeButtons.content.mjs +6 -6
  96. package/dist/components/DictionaryEditor/validDictionaryChangeButtons.content.mjs.map +1 -1
  97. package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.cjs +2 -2
  98. package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.mjs +2 -2
  99. package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.cjs +2 -2
  100. package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.mjs +2 -2
  101. package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.cjs +2 -2
  102. package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.mjs +2 -2
  103. package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.cjs +36 -55
  104. package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.cjs.map +1 -1
  105. package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.d.ts.map +1 -1
  106. package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.mjs +37 -56
  107. package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.mjs.map +1 -1
  108. package/dist/components/DictionaryFieldEditor/EditorView/EditorView.cjs +50 -23
  109. package/dist/components/DictionaryFieldEditor/EditorView/EditorView.cjs.map +1 -1
  110. package/dist/components/DictionaryFieldEditor/EditorView/EditorView.d.ts.map +1 -1
  111. package/dist/components/DictionaryFieldEditor/EditorView/EditorView.mjs +51 -24
  112. package/dist/components/DictionaryFieldEditor/EditorView/EditorView.mjs.map +1 -1
  113. package/dist/components/DictionaryFieldEditor/EditorView/TextEditor.cjs +2 -2
  114. package/dist/components/DictionaryFieldEditor/EditorView/TextEditor.mjs +2 -2
  115. package/dist/components/DictionaryFieldEditor/EnumKeyInput.cjs +1 -1
  116. package/dist/components/DictionaryFieldEditor/EnumKeyInput.mjs +1 -1
  117. package/dist/components/DictionaryFieldEditor/JSONEditor.cjs +59 -0
  118. package/dist/components/DictionaryFieldEditor/JSONEditor.cjs.map +1 -0
  119. package/dist/components/DictionaryFieldEditor/JSONEditor.d.ts +8 -0
  120. package/dist/components/DictionaryFieldEditor/JSONEditor.d.ts.map +1 -0
  121. package/dist/components/DictionaryFieldEditor/JSONEditor.mjs +59 -0
  122. package/dist/components/DictionaryFieldEditor/JSONEditor.mjs.map +1 -0
  123. package/dist/components/DictionaryFieldEditor/KeyPathBreadcrumb.cjs +1 -1
  124. package/dist/components/DictionaryFieldEditor/KeyPathBreadcrumb.mjs +1 -1
  125. package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.cjs +2 -2
  126. package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.mjs +2 -2
  127. package/dist/components/DictionaryFieldEditor/NodeEditor.cjs +98 -0
  128. package/dist/components/DictionaryFieldEditor/NodeEditor.cjs.map +1 -0
  129. package/dist/components/DictionaryFieldEditor/NodeEditor.d.ts +8 -0
  130. package/dist/components/DictionaryFieldEditor/NodeEditor.d.ts.map +1 -0
  131. package/dist/components/DictionaryFieldEditor/NodeEditor.mjs +98 -0
  132. package/dist/components/DictionaryFieldEditor/NodeEditor.mjs.map +1 -0
  133. package/dist/components/DictionaryFieldEditor/NodeTypeSelector.cjs +2 -2
  134. package/dist/components/DictionaryFieldEditor/NodeTypeSelector.mjs +2 -2
  135. package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.cjs +6 -4
  136. package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.cjs.map +1 -1
  137. package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.d.ts.map +1 -1
  138. package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.mjs +6 -4
  139. package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.mjs.map +1 -1
  140. package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.cjs +6 -6
  141. package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.cjs.map +1 -1
  142. package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.mjs +6 -6
  143. package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.mjs.map +1 -1
  144. package/dist/components/DictionaryFieldEditor/editorView.content.cjs +12 -0
  145. package/dist/components/DictionaryFieldEditor/editorView.content.cjs.map +1 -1
  146. package/dist/components/DictionaryFieldEditor/editorView.content.d.ts +4 -0
  147. package/dist/components/DictionaryFieldEditor/editorView.content.d.ts.map +1 -1
  148. package/dist/components/DictionaryFieldEditor/editorView.content.mjs +12 -0
  149. package/dist/components/DictionaryFieldEditor/editorView.content.mjs.map +1 -1
  150. package/dist/components/DropDown/index.cjs +1 -1
  151. package/dist/components/DropDown/index.mjs +1 -1
  152. package/dist/components/EditableField/EditableFieldInput.cjs +1 -1
  153. package/dist/components/EditableField/EditableFieldInput.mjs +1 -1
  154. package/dist/components/EditableField/EditableFieldLayout.cjs +9 -3
  155. package/dist/components/EditableField/EditableFieldLayout.cjs.map +1 -1
  156. package/dist/components/EditableField/EditableFieldLayout.d.ts +3 -3
  157. package/dist/components/EditableField/EditableFieldLayout.d.ts.map +1 -1
  158. package/dist/components/EditableField/EditableFieldLayout.mjs +9 -3
  159. package/dist/components/EditableField/EditableFieldLayout.mjs.map +1 -1
  160. package/dist/components/EditableField/EditableFieldTextArea.cjs +23 -6
  161. package/dist/components/EditableField/EditableFieldTextArea.cjs.map +1 -1
  162. package/dist/components/EditableField/EditableFieldTextArea.d.ts.map +1 -1
  163. package/dist/components/EditableField/EditableFieldTextArea.mjs +24 -7
  164. package/dist/components/EditableField/EditableFieldTextArea.mjs.map +1 -1
  165. package/dist/components/Flags/Flag.cjs +1 -1
  166. package/dist/components/Flags/Flag.mjs +1 -1
  167. package/dist/components/Footer/index.cjs +1 -1
  168. package/dist/components/Footer/index.mjs +1 -1
  169. package/dist/components/Form/Form.cjs +2 -2
  170. package/dist/components/Form/Form.mjs +2 -2
  171. package/dist/components/Form/FormBase.cjs +1 -1
  172. package/dist/components/Form/FormBase.d.ts.map +1 -1
  173. package/dist/components/Form/FormBase.mjs +1 -1
  174. package/dist/components/Form/FormControl.cjs +1 -1
  175. package/dist/components/Form/FormControl.mjs +1 -1
  176. package/dist/components/Form/FormDescription.cjs +1 -1
  177. package/dist/components/Form/FormDescription.mjs +1 -1
  178. package/dist/components/Form/FormField.cjs +1 -1
  179. package/dist/components/Form/FormField.mjs +1 -1
  180. package/dist/components/Form/FormItem.cjs +1 -1
  181. package/dist/components/Form/FormItem.mjs +1 -1
  182. package/dist/components/Form/FormLabel.cjs +1 -1
  183. package/dist/components/Form/FormLabel.mjs +1 -1
  184. package/dist/components/Form/FormMessage.cjs +1 -1
  185. package/dist/components/Form/FormMessage.mjs +1 -1
  186. package/dist/components/Form/elements/CheckboxElement.cjs +2 -2
  187. package/dist/components/Form/elements/CheckboxElement.mjs +2 -2
  188. package/dist/components/Form/elements/EditableFieldInputElement.cjs +2 -2
  189. package/dist/components/Form/elements/EditableFieldInputElement.mjs +2 -2
  190. package/dist/components/Form/elements/EditableFieldTextAreaElement.cjs +2 -2
  191. package/dist/components/Form/elements/EditableFieldTextAreaElement.mjs +2 -2
  192. package/dist/components/Form/elements/FormElement.cjs +2 -2
  193. package/dist/components/Form/elements/FormElement.mjs +2 -2
  194. package/dist/components/Form/elements/FormElementWrapper.cjs +1 -1
  195. package/dist/components/Form/elements/FormElementWrapper.mjs +1 -1
  196. package/dist/components/Form/elements/InputElement.cjs +2 -2
  197. package/dist/components/Form/elements/InputElement.mjs +2 -2
  198. package/dist/components/Form/elements/InputPasswordElement.cjs +2 -2
  199. package/dist/components/Form/elements/InputPasswordElement.mjs +2 -2
  200. package/dist/components/Form/elements/MultiselectElement.cjs +2 -2
  201. package/dist/components/Form/elements/MultiselectElement.mjs +2 -2
  202. package/dist/components/Form/elements/SelectElement.cjs +2 -2
  203. package/dist/components/Form/elements/SelectElement.mjs +2 -2
  204. package/dist/components/Form/elements/SwitchSelectorElement.cjs +2 -2
  205. package/dist/components/Form/elements/SwitchSelectorElement.mjs +2 -2
  206. package/dist/components/Form/elements/TextAreaElement.cjs +2 -2
  207. package/dist/components/Form/elements/TextAreaElement.mjs +2 -2
  208. package/dist/components/Form/elements/index.cjs +1 -1
  209. package/dist/components/Form/elements/index.mjs +1 -1
  210. package/dist/components/Form/index.cjs +1 -1
  211. package/dist/components/Form/index.mjs +1 -1
  212. package/dist/components/Form/layout/FormItemLayout.cjs +2 -2
  213. package/dist/components/Form/layout/FormItemLayout.mjs +2 -2
  214. package/dist/components/Form/layout/FormLabelLayout.cjs +1 -1
  215. package/dist/components/Form/layout/FormLabelLayout.mjs +1 -1
  216. package/dist/components/Form/layout/RequiredStar.cjs +1 -1
  217. package/dist/components/Form/layout/RequiredStar.mjs +1 -1
  218. package/dist/components/Form/layout/index.cjs +1 -1
  219. package/dist/components/Form/layout/index.mjs +1 -1
  220. package/dist/components/Headers/index.cjs +1 -1
  221. package/dist/components/Headers/index.mjs +1 -1
  222. package/dist/components/IDE/CodeRender.cjs +1 -1
  223. package/dist/components/IDE/CodeRender.mjs +1 -1
  224. package/dist/components/IDE/FileList.cjs +1 -1
  225. package/dist/components/IDE/FileList.mjs +1 -1
  226. package/dist/components/IDE/FileTree.cjs +1 -1
  227. package/dist/components/IDE/FileTree.mjs +1 -1
  228. package/dist/components/IDE/IDE.cjs +1 -1
  229. package/dist/components/IDE/IDE.mjs +1 -1
  230. package/dist/components/IDE/MarkDownRender.cjs +1 -1
  231. package/dist/components/IDE/MarkDownRender.mjs +1 -1
  232. package/dist/components/InformationTag/index.cjs +1 -1
  233. package/dist/components/InformationTag/index.mjs +1 -1
  234. package/dist/components/Input/Checkbox.cjs +1 -1
  235. package/dist/components/Input/Checkbox.d.ts +1 -1
  236. package/dist/components/Input/Checkbox.mjs +1 -1
  237. package/dist/components/Input/Input.cjs +1 -1
  238. package/dist/components/Input/Input.mjs +1 -1
  239. package/dist/components/Input/InputPassword.cjs +1 -1
  240. package/dist/components/Input/InputPassword.mjs +1 -1
  241. package/dist/components/Label/index.cjs +1 -1
  242. package/dist/components/Label/index.mjs +1 -1
  243. package/dist/components/Link/Link.cjs +1 -1
  244. package/dist/components/Link/Link.d.ts +1 -1
  245. package/dist/components/Link/Link.mjs +1 -1
  246. package/dist/components/Loader/index.cjs +1 -1
  247. package/dist/components/Loader/index.mjs +1 -1
  248. package/dist/components/Loader/spinner.cjs +1 -1
  249. package/dist/components/Loader/spinner.mjs +1 -1
  250. package/dist/components/LocaleSwitcherDropDown/LocaleSwitcher.cjs +1 -1
  251. package/dist/components/LocaleSwitcherDropDown/LocaleSwitcher.mjs +1 -1
  252. package/dist/components/Logo/LogoCircle.cjs +1 -1
  253. package/dist/components/Logo/LogoCircle.mjs +1 -1
  254. package/dist/components/Logo/LogoNoFrame.cjs +1 -1
  255. package/dist/components/Logo/LogoNoFrame.mjs +1 -1
  256. package/dist/components/Logo/LogoSquare.cjs +1 -1
  257. package/dist/components/Logo/LogoSquare.mjs +1 -1
  258. package/dist/components/Logo/LogoSquircle.cjs +1 -1
  259. package/dist/components/Logo/LogoSquircle.mjs +1 -1
  260. package/dist/components/Logo/LogoTextOnly.cjs +1 -1
  261. package/dist/components/Logo/LogoTextOnly.mjs +1 -1
  262. package/dist/components/Logo/LogoWithTextBelowCircle.cjs +1 -1
  263. package/dist/components/Logo/LogoWithTextBelowCircle.mjs +1 -1
  264. package/dist/components/Logo/LogoWithTextBelowNoFrame.cjs +1 -1
  265. package/dist/components/Logo/LogoWithTextBelowNoFrame.mjs +1 -1
  266. package/dist/components/Logo/LogoWithTextBelowSquircle.cjs +1 -1
  267. package/dist/components/Logo/LogoWithTextBelowSquircle.mjs +1 -1
  268. package/dist/components/Logo/LogoWithTextCircle.cjs +1 -1
  269. package/dist/components/Logo/LogoWithTextCircle.mjs +1 -1
  270. package/dist/components/Logo/LogoWithTextNoFrame.cjs +1 -1
  271. package/dist/components/Logo/LogoWithTextNoFrame.mjs +1 -1
  272. package/dist/components/Logo/LogoWithTextSquircle.cjs +1 -1
  273. package/dist/components/Logo/LogoWithTextSquircle.mjs +1 -1
  274. package/dist/components/Logo/index.cjs +1 -1
  275. package/dist/components/Logo/index.mjs +1 -1
  276. package/dist/components/MarkDownRender/index.cjs +1 -1
  277. package/dist/components/MarkDownRender/index.mjs +1 -1
  278. package/dist/components/MaxHeightSmoother/index.cjs +1 -1
  279. package/dist/components/MaxHeightSmoother/index.mjs +1 -1
  280. package/dist/components/MaxWidthSmoother/index.cjs +1 -1
  281. package/dist/components/MaxWidthSmoother/index.mjs +1 -1
  282. package/dist/components/Modal/Modal.cjs +1 -1
  283. package/dist/components/Modal/Modal.cjs.map +1 -1
  284. package/dist/components/Modal/Modal.d.ts.map +1 -1
  285. package/dist/components/Modal/Modal.mjs +1 -1
  286. package/dist/components/Modal/Modal.mjs.map +1 -1
  287. package/dist/components/Navbar/Burger.cjs +1 -1
  288. package/dist/components/Navbar/Burger.mjs +1 -1
  289. package/dist/components/Navbar/DesktopNavbar.cjs +1 -1
  290. package/dist/components/Navbar/DesktopNavbar.mjs +1 -1
  291. package/dist/components/Navbar/MobileNavbar.cjs +1 -1
  292. package/dist/components/Navbar/MobileNavbar.mjs +1 -1
  293. package/dist/components/Navbar/index.cjs +1 -1
  294. package/dist/components/Navbar/index.mjs +1 -1
  295. package/dist/components/Pattern/DotPattern.cjs +1 -1
  296. package/dist/components/Pattern/DotPattern.mjs +1 -1
  297. package/dist/components/Pattern/GridPattern.cjs +1 -1
  298. package/dist/components/Pattern/GridPattern.mjs +1 -1
  299. package/dist/components/Pattern/SpotLight.cjs +1 -1
  300. package/dist/components/Pattern/SpotLight.mjs +1 -1
  301. package/dist/components/Popover/index.cjs +1 -1
  302. package/dist/components/Popover/index.mjs +1 -1
  303. package/dist/components/PressableSpan/PressableSpan.cjs +1 -1
  304. package/dist/components/PressableSpan/PressableSpan.mjs +1 -1
  305. package/dist/components/ProfileDropDown/index.cjs +1 -1
  306. package/dist/components/ProfileDropDown/index.mjs +1 -1
  307. package/dist/components/RightDrawer/RightDrawer.cjs +1 -1
  308. package/dist/components/RightDrawer/RightDrawer.mjs +1 -1
  309. package/dist/components/Select/Multiselect.cjs +1 -1
  310. package/dist/components/Select/Multiselect.d.ts.map +1 -1
  311. package/dist/components/Select/Multiselect.mjs +1 -1
  312. package/dist/components/Select/Select.cjs +1 -1
  313. package/dist/components/Select/Select.mjs +1 -1
  314. package/dist/components/SwitchSelector/index.cjs +1 -1
  315. package/dist/components/SwitchSelector/index.d.ts +1 -1
  316. package/dist/components/SwitchSelector/index.mjs +1 -1
  317. package/dist/components/TabSelector/TabSelector.cjs +1 -1
  318. package/dist/components/TabSelector/TabSelector.d.ts +1 -1
  319. package/dist/components/TabSelector/TabSelector.mjs +1 -1
  320. package/dist/components/Tag/index.cjs +1 -1
  321. package/dist/components/Tag/index.mjs +1 -1
  322. package/dist/components/TextArea/AutoSizeTextArea.cjs +1 -1
  323. package/dist/components/TextArea/AutoSizeTextArea.mjs +1 -1
  324. package/dist/components/TextArea/TextArea.cjs +1 -1
  325. package/dist/components/TextArea/TextArea.mjs +1 -1
  326. package/dist/components/ThemeSwitcherDropDown/DesktopThemeSwitcher.cjs +1 -1
  327. package/dist/components/ThemeSwitcherDropDown/DesktopThemeSwitcher.mjs +1 -1
  328. package/dist/components/ThemeSwitcherDropDown/MobileThemeSwitcher.cjs +1 -1
  329. package/dist/components/ThemeSwitcherDropDown/MobileThemeSwitcher.mjs +1 -1
  330. package/dist/components/Toaster/Toast.cjs +1 -1
  331. package/dist/components/Toaster/Toast.mjs +1 -1
  332. package/dist/components/Toaster/Toaster.cjs +1 -1
  333. package/dist/components/Toaster/Toaster.mjs +1 -1
  334. package/dist/components/WithResizer/index.cjs +1 -1
  335. package/dist/components/WithResizer/index.mjs +1 -1
  336. package/dist/components/index.cjs +3 -1
  337. package/dist/components/index.cjs.map +1 -1
  338. package/dist/components/index.d.ts +1 -0
  339. package/dist/components/index.d.ts.map +1 -1
  340. package/dist/components/index.mjs +3 -1
  341. package/dist/components/index.mjs.map +1 -1
  342. package/dist/hooks/intlayerAPIHooks.cjs +1 -1
  343. package/dist/hooks/intlayerAPIHooks.mjs +1 -1
  344. package/dist/hooks/useAsync/useAsync.cjs.map +1 -1
  345. package/dist/hooks/useAsync/useAsync.mjs.map +1 -1
  346. package/dist/{index-BZQDMSxb.cjs → index-BtZWYJhL.cjs} +2 -2
  347. package/dist/index-BtZWYJhL.cjs.map +1 -0
  348. package/dist/{index-pLq_417z.js → index-D9oaKvKC.js} +2 -2
  349. package/dist/index-D9oaKvKC.js.map +1 -0
  350. package/dist/{jsx-runtime-BgSF1HG2.js → jsx-runtime-DaNGiM0W.js} +15 -9
  351. package/dist/{jsx-runtime-BgSF1HG2.js.map → jsx-runtime-DaNGiM0W.js.map} +1 -1
  352. package/dist/{jsx-runtime-DvCoRj5u.cjs → jsx-runtime-XHKiWCTo.cjs} +15 -9
  353. package/dist/{jsx-runtime-DvCoRj5u.cjs.map → jsx-runtime-XHKiWCTo.cjs.map} +1 -1
  354. package/dist/tailwind.css +1 -1
  355. package/dist/zod-BV4nCGJE.js.map +1 -1
  356. package/dist/zod-DSrtTSD_.cjs.map +1 -1
  357. package/package.json +47 -45
  358. package/tailwind.config.d.ts +8 -0
  359. package/tailwind.config.js +215 -0
  360. package/dist/Form-2XHQV7F_.cjs +0 -295
  361. package/dist/Form-2XHQV7F_.cjs.map +0 -1
  362. package/dist/Form-BO0i3nT9.js +0 -300
  363. package/dist/Form-BO0i3nT9.js.map +0 -1
  364. package/dist/Form-BaHDK0RZ.cjs +0 -298
  365. package/dist/Form-BaHDK0RZ.cjs.map +0 -1
  366. package/dist/Form-BfZMqK2D.js +0 -300
  367. package/dist/Form-BfZMqK2D.js.map +0 -1
  368. package/dist/Form-C13KWSZs.cjs +0 -299
  369. package/dist/Form-C13KWSZs.cjs.map +0 -1
  370. package/dist/Form-C8K2f8ph.js +0 -300
  371. package/dist/Form-C8K2f8ph.js.map +0 -1
  372. package/dist/Form-CKvCgz8c.cjs +0 -299
  373. package/dist/Form-CKvCgz8c.cjs.map +0 -1
  374. package/dist/Form-Cbk5Lhpd.js +0 -299
  375. package/dist/Form-Cbk5Lhpd.js.map +0 -1
  376. package/dist/Form-Cbu7ff1e.js +0 -278
  377. package/dist/Form-Cbu7ff1e.js.map +0 -1
  378. package/dist/Form-CiAgFAPb.cjs +0 -300
  379. package/dist/Form-CiAgFAPb.cjs.map +0 -1
  380. package/dist/Form-CnBKDneQ.js +0 -296
  381. package/dist/Form-CnBKDneQ.js.map +0 -1
  382. package/dist/Form-DhlDf3ML.cjs +0 -299
  383. package/dist/Form-DhlDf3ML.cjs.map +0 -1
  384. package/dist/Form-DkAZ0Jdf.cjs +0 -299
  385. package/dist/Form-DkAZ0Jdf.cjs.map +0 -1
  386. package/dist/Form-DqnNP4DA.js +0 -300
  387. package/dist/Form-DqnNP4DA.js.map +0 -1
  388. package/dist/Form-DyFBmVya.js +0 -301
  389. package/dist/Form-DyFBmVya.js.map +0 -1
  390. package/dist/Form-FW4Odjfm.js +0 -301
  391. package/dist/Form-FW4Odjfm.js.map +0 -1
  392. package/dist/Form-wWTTkxTp.cjs +0 -277
  393. package/dist/Form-wWTTkxTp.cjs.map +0 -1
  394. package/dist/TabSelector-BmkzVPXl.js +0 -660
  395. package/dist/TabSelector-BmkzVPXl.js.map +0 -1
  396. package/dist/TabSelector-o_NRBvPQ.cjs +0 -659
  397. package/dist/TabSelector-o_NRBvPQ.cjs.map +0 -1
  398. package/dist/components/Auth/AuthProvider/index.cjs +0 -55
  399. package/dist/components/Auth/AuthProvider/index.cjs.map +0 -1
  400. package/dist/components/Auth/AuthProvider/index.d.ts +0 -31
  401. package/dist/components/Auth/AuthProvider/index.d.ts.map +0 -1
  402. package/dist/components/Auth/AuthProvider/index.mjs +0 -55
  403. package/dist/components/Auth/AuthProvider/index.mjs.map +0 -1
  404. package/dist/components/Auth/AuthProvider/useCSRF.cjs +0 -22
  405. package/dist/components/Auth/AuthProvider/useCSRF.cjs.map +0 -1
  406. package/dist/components/Auth/AuthProvider/useCSRF.d.ts +0 -5
  407. package/dist/components/Auth/AuthProvider/useCSRF.d.ts.map +0 -1
  408. package/dist/components/Auth/AuthProvider/useCSRF.mjs +0 -22
  409. package/dist/components/Auth/AuthProvider/useCSRF.mjs.map +0 -1
  410. package/dist/components/Auth/AuthProvider/useOAuth2.cjs +0 -26
  411. package/dist/components/Auth/AuthProvider/useOAuth2.cjs.map +0 -1
  412. package/dist/components/Auth/AuthProvider/useOAuth2.d.ts +0 -4
  413. package/dist/components/Auth/AuthProvider/useOAuth2.d.ts.map +0 -1
  414. package/dist/components/Auth/AuthProvider/useOAuth2.mjs +0 -26
  415. package/dist/components/Auth/AuthProvider/useOAuth2.mjs.map +0 -1
  416. package/dist/components/Auth/AuthProvider/useSession.cjs +0 -70
  417. package/dist/components/Auth/AuthProvider/useSession.cjs.map +0 -1
  418. package/dist/components/Auth/AuthProvider/useSession.d.ts +0 -8
  419. package/dist/components/Auth/AuthProvider/useSession.d.ts.map +0 -1
  420. package/dist/components/Auth/AuthProvider/useSession.mjs +0 -70
  421. package/dist/components/Auth/AuthProvider/useSession.mjs.map +0 -1
  422. package/dist/hooks/useAsync/useProxyState.d.ts +0 -3
  423. package/dist/hooks/useAsync/useProxyState.d.ts.map +0 -1
  424. package/dist/hooks/usePersistenceStore.cjs +0 -22
  425. package/dist/hooks/usePersistenceStore.cjs.map +0 -1
  426. package/dist/hooks/usePersistenceStore.d.ts +0 -2
  427. package/dist/hooks/usePersistenceStore.d.ts.map +0 -1
  428. package/dist/hooks/usePersistenceStore.mjs +0 -22
  429. package/dist/hooks/usePersistenceStore.mjs.map +0 -1
  430. package/dist/index-BUDsCMdX.cjs +0 -204
  431. package/dist/index-BUDsCMdX.cjs.map +0 -1
  432. package/dist/index-BZQDMSxb.cjs.map +0 -1
  433. package/dist/index-C09rI9kw.js +0 -205
  434. package/dist/index-C09rI9kw.js.map +0 -1
  435. package/dist/index-pLq_417z.js.map +0 -1
  436. package/dist/stripe-BsI0lJWz.js +0 -22
  437. package/dist/stripe-BsI0lJWz.js.map +0 -1
  438. package/dist/stripe-C-u5RvGh.js +0 -22
  439. package/dist/stripe-C-u5RvGh.js.map +0 -1
  440. package/dist/stripe-CF_E65Vu.js +0 -22
  441. package/dist/stripe-CF_E65Vu.js.map +0 -1
  442. package/dist/stripe-CpGvfq6T.cjs +0 -21
  443. package/dist/stripe-CpGvfq6T.cjs.map +0 -1
  444. package/dist/stripe-DEv4DjAL.cjs +0 -21
  445. package/dist/stripe-DEv4DjAL.cjs.map +0 -1
  446. package/dist/stripe-DuG0uaEn.cjs +0 -21
  447. package/dist/stripe-DuG0uaEn.cjs.map +0 -1
  448. package/dist/useProxyState-D5GLrY2y.js +0 -20
  449. package/dist/useProxyState-D5GLrY2y.js.map +0 -1
  450. package/dist/useProxyState-DewdF3no.cjs +0 -19
  451. package/dist/useProxyState-DewdF3no.cjs.map +0 -1
  452. package/dist/validDictionaryChangeButtons.content-BK9QaXPm.cjs +0 -66
  453. package/dist/validDictionaryChangeButtons.content-BK9QaXPm.cjs.map +0 -1
  454. package/dist/validDictionaryChangeButtons.content-CAAscqJI.cjs +0 -66
  455. package/dist/validDictionaryChangeButtons.content-CAAscqJI.cjs.map +0 -1
  456. package/dist/validDictionaryChangeButtons.content-D7AvoBdl.js +0 -67
  457. package/dist/validDictionaryChangeButtons.content-D7AvoBdl.js.map +0 -1
  458. package/dist/validDictionaryChangeButtons.content-DQwoUNCC.cjs +0 -45
  459. package/dist/validDictionaryChangeButtons.content-DQwoUNCC.cjs.map +0 -1
  460. package/dist/validDictionaryChangeButtons.content-DQxPoIe6.js +0 -67
  461. package/dist/validDictionaryChangeButtons.content-DQxPoIe6.js.map +0 -1
  462. package/dist/validDictionaryChangeButtons.content-JUcjGdBx.cjs +0 -66
  463. package/dist/validDictionaryChangeButtons.content-JUcjGdBx.cjs.map +0 -1
  464. package/dist/validDictionaryChangeButtons.content-ejY3-sbG.js +0 -67
  465. package/dist/validDictionaryChangeButtons.content-ejY3-sbG.js.map +0 -1
  466. package/dist/validDictionaryChangeButtons.content-iyT0lKy7.js +0 -46
  467. package/dist/validDictionaryChangeButtons.content-iyT0lKy7.js.map +0 -1
  468. package/dist/validDictionaryChangeButtons.content-u4qShrQh.cjs +0 -66
  469. package/dist/validDictionaryChangeButtons.content-u4qShrQh.cjs.map +0 -1
  470. package/dist/validDictionaryChangeButtons.content-y4up9NU8.js +0 -67
  471. package/dist/validDictionaryChangeButtons.content-y4up9NU8.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"usePersistenceStore.d.ts","sourceRoot":"","sources":["../../src/hooks/usePersistenceStore.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,mBAAmB,GAAI,CAAC,OAAO,MAAM,iBAAiB,CAAC,8EAoBnE,CAAC"}
@@ -1,22 +0,0 @@
1
- "use client";
2
- import { useState, useEffect } from "react";
3
- const usePersistenceStore = (key, initialValue) => {
4
- const [state, setState] = useState(() => {
5
- const persistedState = sessionStorage.getItem(key);
6
- if (persistedState) {
7
- return JSON.parse(persistedState);
8
- }
9
- return initialValue;
10
- });
11
- useEffect(() => {
12
- const persistedState = sessionStorage.getItem(key);
13
- if (persistedState) {
14
- setState(JSON.parse(persistedState));
15
- }
16
- }, [key, initialValue]);
17
- return [state, setState];
18
- };
19
- export {
20
- usePersistenceStore
21
- };
22
- //# sourceMappingURL=usePersistenceStore.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"usePersistenceStore.mjs","sources":["../../src/hooks/usePersistenceStore.ts"],"sourcesContent":["'use client';\n\nimport { useState, useEffect } from 'react';\n\nexport const usePersistenceStore = <T>(key: string, initialValue?: T) => {\n const [state, setState] = useState<T>(() => {\n const persistedState = sessionStorage.getItem(key);\n\n if (persistedState) {\n return JSON.parse(persistedState);\n }\n\n return initialValue as T;\n });\n\n useEffect(() => {\n const persistedState = sessionStorage.getItem(key);\n\n if (persistedState) {\n setState(JSON.parse(persistedState));\n }\n }, [key, initialValue]);\n\n return [state, setState] as const;\n};\n"],"names":[],"mappings":";;AAIa,MAAA,sBAAsB,CAAI,KAAa,iBAAqB;AACvE,QAAM,CAAC,OAAO,QAAQ,IAAI,SAAY,MAAM;AACpC,UAAA,iBAAiB,eAAe,QAAQ,GAAG;AAEjD,QAAI,gBAAgB;AACX,aAAA,KAAK,MAAM,cAAc;AAAA,IAClC;AAEO,WAAA;AAAA,EAAA,CACR;AAED,YAAU,MAAM;AACR,UAAA,iBAAiB,eAAe,QAAQ,GAAG;AAEjD,QAAI,gBAAgB;AACT,eAAA,KAAK,MAAM,cAAc,CAAC;AAAA,IACrC;AAAA,EAAA,GACC,CAAC,KAAK,YAAY,CAAC;AAEf,SAAA,CAAC,OAAO,QAAQ;AACzB;"}
@@ -1,204 +0,0 @@
1
- "use client";
2
- "use strict";
3
- const jsxRuntime = require("./jsx-runtime-DvCoRj5u.cjs");
4
- const core = require("@intlayer/core");
5
- const require$$0 = require("react");
6
- const lucideReact = require("lucide-react");
7
- const components_DictionaryEditor_ItemLayout = require("./components/DictionaryEditor/ItemLayout.cjs");
8
- const components_DictionaryEditor_NodeWrapper_StringWrapper = require("./components/DictionaryEditor/NodeWrapper/StringWrapper.cjs");
9
- const components_DictionaryEditor_useEditedContentStore = require("./components/DictionaryEditor/useEditedContentStore.cjs");
10
- const ArrayWrapper = (props) => {
11
- const {
12
- keyPath,
13
- section,
14
- onFocusKeyPath,
15
- onClickEdit,
16
- focusedKeyPath = []
17
- } = props;
18
- return section.map((subSection, key) => {
19
- const newKeyPathEl = {
20
- key,
21
- type: core.NodeType.Array
22
- };
23
- const newKeyPath = [...keyPath, newKeyPathEl];
24
- return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
25
- components_DictionaryEditor_ItemLayout.ItemLayout,
26
- {
27
- level: keyPath.length,
28
- title: `${key}`,
29
- description: "",
30
- isSelected: core.isSameKeyPath(newKeyPath, focusedKeyPath),
31
- onClick: (e) => {
32
- e.stopPropagation();
33
- onFocusKeyPath(newKeyPath);
34
- },
35
- rightParam: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
36
- lucideReact.Edit,
37
- {
38
- size: 16,
39
- role: "button",
40
- "aria-label": "Open the editor",
41
- onClick: (e) => {
42
- e.stopPropagation();
43
- onClickEdit?.(newKeyPath);
44
- }
45
- }
46
- ),
47
- children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(NodeWrapper, { ...props, keyPath: newKeyPath, section: subSection })
48
- },
49
- JSON.stringify(subSection)
50
- );
51
- });
52
- };
53
- const EnumerationWrapper = (props) => {
54
- const { keyPath, section } = props;
55
- return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx("div", { className: "ml-2 grid grid-cols-[auto,1fr] gap-2", children: Object.keys(section).filter((key) => !traceKeys.includes(key)).map((key) => {
56
- const newKeyPathEl = {
57
- type: core.NodeType.Enumeration,
58
- key
59
- };
60
- const newKeyPath = [...keyPath, newKeyPathEl];
61
- const subSection = section.enumeration[key];
62
- return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsxs(jsxRuntime.jsxRuntimeExports.Fragment, { children: [
63
- /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx("span", { className: "flex items-center font-bold", children: key }),
64
- /* @__PURE__ */ require$$0.createElement(
65
- NodeWrapper,
66
- {
67
- ...props,
68
- key,
69
- keyPath: newKeyPath,
70
- section: subSection
71
- }
72
- )
73
- ] });
74
- }) });
75
- };
76
- const NestedObjectWrapper = (props) => {
77
- const {
78
- keyPath,
79
- section,
80
- focusedKeyPath = [],
81
- onClickEdit,
82
- onFocusKeyPath
83
- } = props;
84
- return Object.keys(section).filter((key) => !traceKeys.includes(key)).map((key) => {
85
- const newKeyPathEl = { key, type: core.NodeType.Object };
86
- const newKeyPath = [...keyPath, newKeyPathEl];
87
- return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
88
- components_DictionaryEditor_ItemLayout.ItemLayout,
89
- {
90
- level: keyPath.length,
91
- title: key,
92
- description: "",
93
- isSelected: core.isSameKeyPath(newKeyPath, focusedKeyPath),
94
- onClick: (e) => {
95
- e.stopPropagation();
96
- onFocusKeyPath(newKeyPath);
97
- },
98
- rightParam: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
99
- lucideReact.Edit,
100
- {
101
- size: 16,
102
- role: "button",
103
- "aria-label": "Open the editor",
104
- onClick: (e) => {
105
- e.stopPropagation();
106
- onClickEdit?.(newKeyPath);
107
- }
108
- }
109
- ),
110
- children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(NodeWrapper, { ...props, keyPath: newKeyPath, section: section[key] })
111
- },
112
- key
113
- );
114
- });
115
- };
116
- const TranslationWrapper = (props) => {
117
- const { keyPath, section, locale } = props;
118
- const newKeyPathEl = {
119
- type: core.NodeType.Translation,
120
- key: locale
121
- };
122
- const newKeyPath = [...keyPath, newKeyPathEl];
123
- const subSection = section.translation[locale];
124
- return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(NodeWrapper, { ...props, keyPath: newKeyPath, section: subSection });
125
- };
126
- const traceKeys = ["filePath", "id", "nodeType"];
127
- const isReactNode = (node) => typeof node?.key !== "undefined" && typeof node?.props !== "undefined";
128
- const createReactElement = (element) => {
129
- if (typeof element === "string") {
130
- return element;
131
- }
132
- const convertChildrenAsArray = (element2) => {
133
- if (element2?.props && typeof element2.props.children === "object") {
134
- const childrenResult = [];
135
- const { children } = element2.props;
136
- Object.keys(children).forEach((key) => {
137
- childrenResult.push(createReactElement(children[key]));
138
- });
139
- return {
140
- ...element2,
141
- props: { ...element2.props, children: childrenResult }
142
- };
143
- }
144
- return {
145
- ...element2,
146
- props: { ...element2.props, children: element2.props.children }
147
- };
148
- };
149
- const fixedElement = convertChildrenAsArray(element);
150
- const { type, props } = fixedElement;
151
- return require$$0.createElement(type ?? "div", props, ...props.children);
152
- };
153
- const NodeWrapper = (props) => {
154
- const { section } = props;
155
- components_DictionaryEditor_useEditedContentStore.useEditedContentStore((s) => ({
156
- addEditedContent: s.addEditedContent
157
- }));
158
- if (typeof section === "object") {
159
- if (isReactNode(section)) {
160
- return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsxs(jsxRuntime.jsxRuntimeExports.Fragment, { children: [
161
- createReactElement(section),
162
- /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx("span", { className: "text-neutral dark:text-neutral-dark text-xs", children: "React node not editable" })
163
- ] });
164
- }
165
- if (section.nodeType === core.NodeType.Translation) {
166
- return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
167
- TranslationWrapper,
168
- {
169
- ...props,
170
- section
171
- }
172
- );
173
- }
174
- if (section.nodeType === core.NodeType.Enumeration) {
175
- return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
176
- EnumerationWrapper,
177
- {
178
- ...props,
179
- section
180
- }
181
- );
182
- }
183
- if (Array.isArray(section)) {
184
- return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(ArrayWrapper, { ...props, section });
185
- }
186
- return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
187
- NestedObjectWrapper,
188
- {
189
- ...props,
190
- section
191
- }
192
- );
193
- }
194
- if (typeof section === "string") {
195
- return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(components_DictionaryEditor_NodeWrapper_StringWrapper.StringWrapper, { ...props, section });
196
- }
197
- };
198
- exports.ArrayWrapper = ArrayWrapper;
199
- exports.EnumerationWrapper = EnumerationWrapper;
200
- exports.NestedObjectWrapper = NestedObjectWrapper;
201
- exports.NodeWrapper = NodeWrapper;
202
- exports.TranslationWrapper = TranslationWrapper;
203
- exports.traceKeys = traceKeys;
204
- //# sourceMappingURL=index-BUDsCMdX.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-BUDsCMdX.cjs","sources":["../src/components/DictionaryEditor/NodeWrapper/ArrayWrapper.tsx","../src/components/DictionaryEditor/NodeWrapper/EnumerationWrapper.tsx","../src/components/DictionaryEditor/NodeWrapper/NestedObjectWrapper.tsx","../src/components/DictionaryEditor/NodeWrapper/TranslationWrapper.tsx","../src/components/DictionaryEditor/NodeWrapper/index.tsx"],"sourcesContent":["/* eslint-disable import/no-cycle */\nimport {\n isSameKeyPath,\n NodeType,\n type DictionaryValue,\n type KeyPath,\n} from '@intlayer/core';\nimport { Edit } from 'lucide-react';\nimport type { FC } from 'react';\nimport { ItemLayout } from '../ItemLayout';\nimport { NodeWrapper, type NodeWrapperProps } from './index';\n\ntype ArrayWrapperProps = Omit<NodeWrapperProps, 'section'> & {\n section: DictionaryValue[];\n};\n\nexport const ArrayWrapper: FC<ArrayWrapperProps> = (props) => {\n const {\n keyPath,\n section,\n onFocusKeyPath,\n onClickEdit,\n focusedKeyPath = [],\n } = props;\n\n return section.map((subSection, key) => {\n const newKeyPathEl: KeyPath = {\n key,\n type: NodeType.Array,\n };\n const newKeyPath: KeyPath[] = [...keyPath, newKeyPathEl];\n\n return (\n <ItemLayout\n level={keyPath.length}\n key={JSON.stringify(subSection)}\n title={`${key}`}\n description=\"\"\n isSelected={isSameKeyPath(newKeyPath, focusedKeyPath)}\n onClick={(e) => {\n e.stopPropagation();\n onFocusKeyPath(newKeyPath);\n }}\n rightParam={\n <Edit\n size={16}\n role=\"button\"\n aria-label=\"Open the editor\"\n onClick={(e) => {\n e.stopPropagation();\n\n onClickEdit?.(newKeyPath);\n }}\n />\n }\n >\n <NodeWrapper {...props} keyPath={newKeyPath} section={subSection} />\n </ItemLayout>\n );\n });\n};\n","/* eslint-disable import/no-cycle */\nimport {\n type KeyPath,\n NodeType,\n type EnumerationContent,\n type DictionaryValue,\n} from '@intlayer/core';\nimport type { FC } from 'react';\nimport { NodeWrapper, traceKeys, type NodeWrapperProps } from './index';\n\ntype EnumerationWrapperProps = Omit<NodeWrapperProps, 'section'> & {\n section: EnumerationContent<DictionaryValue>;\n};\n\nexport const EnumerationWrapper: FC<EnumerationWrapperProps> = (props) => {\n const { keyPath, section } = props;\n\n return (\n <div className=\"ml-2 grid grid-cols-[auto,1fr] gap-2\">\n {Object.keys(section)\n .filter((key) => !traceKeys.includes(key))\n .map((key) => {\n const newKeyPathEl: KeyPath = {\n type: NodeType.Enumeration,\n key,\n };\n const newKeyPath: KeyPath[] = [...keyPath, newKeyPathEl];\n\n const subSection =\n section.enumeration[key as keyof (typeof section)['enumeration']]!;\n\n return (\n <>\n <span className=\"flex items-center font-bold\">{key}</span>\n <NodeWrapper\n {...props}\n key={key}\n keyPath={newKeyPath}\n section={subSection}\n />\n </>\n );\n })}\n </div>\n );\n};\n","/* eslint-disable import/no-cycle */\n\nimport {\n type KeyPath,\n isSameKeyPath,\n type DictionaryValue,\n NodeType,\n} from '@intlayer/core';\nimport { Edit } from 'lucide-react';\nimport type { FC } from 'react';\nimport { ItemLayout } from '../ItemLayout';\nimport { NodeWrapper, traceKeys, type NodeWrapperProps } from './index';\n\ntype NestedObjectWrapperProps = Omit<NodeWrapperProps, 'section'> & {\n section: Record<string, DictionaryValue>;\n};\n\nexport const NestedObjectWrapper: FC<NestedObjectWrapperProps> = (props) => {\n const {\n keyPath,\n section,\n focusedKeyPath = [],\n onClickEdit,\n onFocusKeyPath,\n } = props;\n\n return Object.keys(section)\n .filter((key) => !traceKeys.includes(key))\n .map((key) => {\n const newKeyPathEl: KeyPath = { key, type: NodeType.Object };\n const newKeyPath: KeyPath[] = [...keyPath, newKeyPathEl];\n\n return (\n <ItemLayout\n level={keyPath.length}\n key={key}\n title={key}\n description=\"\"\n isSelected={isSameKeyPath(newKeyPath, focusedKeyPath)}\n onClick={(e) => {\n e.stopPropagation();\n\n onFocusKeyPath(newKeyPath);\n }}\n rightParam={\n <Edit\n size={16}\n role=\"button\"\n aria-label=\"Open the editor\"\n onClick={(e) => {\n e.stopPropagation();\n\n onClickEdit?.(newKeyPath);\n }}\n />\n }\n >\n <NodeWrapper {...props} keyPath={newKeyPath} section={section[key]} />\n </ItemLayout>\n );\n });\n};\n","/* eslint-disable import/no-cycle */\n\nimport {\n type KeyPath,\n NodeType,\n type TranslationContent,\n type DictionaryValue,\n} from '@intlayer/core';\nimport type { FC } from 'react';\nimport { NodeWrapper, type NodeWrapperProps } from './index';\n\ntype TranslationWrapperProps = Omit<NodeWrapperProps, 'section'> & {\n section: TranslationContent<DictionaryValue>;\n};\n\nexport const TranslationWrapper: FC<TranslationWrapperProps> = (props) => {\n const { keyPath, section, locale } = props;\n\n const newKeyPathEl: KeyPath = {\n type: NodeType.Translation,\n key: locale,\n };\n\n const newKeyPath: KeyPath[] = [...keyPath, newKeyPathEl];\n\n const subSection =\n section.translation[\n locale as unknown as keyof (typeof section)['translation']\n ]!;\n\n return <NodeWrapper {...props} keyPath={newKeyPath} section={subSection} />;\n};\n","/* eslint-disable import/no-cycle */\n'use client';\n\nimport type { Locales } from '@intlayer/config/client';\nimport {\n type EnumerationContent,\n type TranslationContent,\n NodeType,\n type KeyPath,\n type DictionaryValue,\n type Dictionary,\n} from '@intlayer/core';\nimport {\n createElement,\n type ReactElement,\n type ReactNode,\n type FC,\n} from 'react';\nimport { ArrayWrapper } from './ArrayWrapper';\nimport { EnumerationWrapper } from './EnumerationWrapper';\nimport { NestedObjectWrapper } from './NestedObjectWrapper';\nimport { StringWrapper } from './StringWrapper';\nimport { TranslationWrapper } from './TranslationWrapper';\nimport { useEditedContentStore } from '../useEditedContentStore';\n\nexport const traceKeys: string[] = ['filePath', 'id', 'nodeType'];\n\nconst isReactNode = (node: Record<string, unknown>): boolean =>\n typeof node?.key !== 'undefined' && typeof node?.props !== 'undefined';\n\nexport type NodeWrapperProps = {\n keyPath: KeyPath[];\n section: DictionaryValue;\n onContentChange: (content: { keyPath: KeyPath[]; newValue: string }) => void;\n locale: Locales;\n editedContent: Dictionary;\n focusedKeyPath: KeyPath[] | undefined;\n onFocusKeyPath: (keyPath: KeyPath[]) => void;\n onClickEdit?: (keyPath: KeyPath[]) => void;\n};\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 const NodeWrapper: FC<NodeWrapperProps> = (props) => {\n const { section } = props;\n\n const { addEditedContent } = useEditedContentStore((s) => ({\n addEditedContent: s.addEditedContent,\n }));\n\n if (typeof section === 'object') {\n if (isReactNode(section as Record<string, unknown>)) {\n return (\n <>\n {createReactElement(section as unknown as ReactElement)}\n <span className=\"text-neutral dark:text-neutral-dark text-xs\">\n React node not editable\n </span>\n </>\n );\n }\n\n if (\n (section as TranslationContent<DictionaryValue>).nodeType ===\n NodeType.Translation\n ) {\n return (\n <TranslationWrapper\n {...props}\n section={section as TranslationContent<DictionaryValue>}\n />\n );\n }\n\n if (\n (section as EnumerationContent<DictionaryValue>).nodeType ===\n NodeType.Enumeration\n ) {\n return (\n <EnumerationWrapper\n {...props}\n section={section as EnumerationContent<DictionaryValue>}\n />\n );\n }\n\n if (Array.isArray(section)) {\n return <ArrayWrapper {...props} section={section as DictionaryValue[]} />;\n }\n\n return (\n <NestedObjectWrapper\n {...props}\n section={section as Record<string, DictionaryValue>}\n />\n );\n }\n\n if (typeof section === 'string') {\n return <StringWrapper {...props} section={section} />;\n }\n};\n"],"names":["NodeType","jsx","ItemLayout","isSameKeyPath","Edit","jsxs","Fragment","createElement","element","useEditedContentStore","StringWrapper"],"mappings":";;;;;;;;;AAgBa,MAAA,eAAsC,CAAC,UAAU;AACtD,QAAA;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,iBAAiB,CAAC;AAAA,EAChB,IAAA;AAEJ,SAAO,QAAQ,IAAI,CAAC,YAAY,QAAQ;AACtC,UAAM,eAAwB;AAAA,MAC5B;AAAA,MACA,MAAMA,KAAS,SAAA;AAAA,IAAA;AAEjB,UAAM,aAAwB,CAAC,GAAG,SAAS,YAAY;AAGrD,WAAAC,2BAAA,kBAAA;AAAA,MAACC,uCAAA;AAAA,MAAA;AAAA,QACC,OAAO,QAAQ;AAAA,QAEf,OAAO,GAAG,GAAG;AAAA,QACb,aAAY;AAAA,QACZ,YAAYC,KAAAA,cAAc,YAAY,cAAc;AAAA,QACpD,SAAS,CAAC,MAAM;AACd,YAAE,gBAAgB;AAClB,yBAAe,UAAU;AAAA,QAC3B;AAAA,QACA,YACEF,2BAAA,kBAAA;AAAA,UAACG,YAAA;AAAA,UAAA;AAAA,YACC,MAAM;AAAA,YACN,MAAK;AAAA,YACL,cAAW;AAAA,YACX,SAAS,CAAC,MAAM;AACd,gBAAE,gBAAgB;AAElB,4BAAc,UAAU;AAAA,YAC1B;AAAA,UAAA;AAAA,QACF;AAAA,QAGF,2DAAC,aAAa,EAAA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AO,GAAG;AAC1B,aAAQA,2BAAAA,kBAAAA,IAAA,cAAA,EAAc,GAAG,OAAO,QAAuC,CAAA;AAAA,IACzE;AAGE,WAAAA,2BAAA,kBAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACE,GAAG;AAAA,QACJ;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AAEI,MAAA,OAAO,YAAY,UAAU;AAC/B,WAAQA,2BAAAA,kBAAAA,IAAAS,sDAAAA,eAAA,EAAe,GAAG,OAAO,QAAkB,CAAA;AAAA,EACrD;AACF;;;;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-BZQDMSxb.cjs","sources":["../src/components/DictionaryEditor/NodeWrapper/ArrayWrapper.tsx","../src/components/DictionaryEditor/NodeWrapper/EnumerationWrapper.tsx","../src/components/DictionaryEditor/NodeWrapper/NestedObjectWrapper.tsx","../src/components/DictionaryEditor/NodeWrapper/TranslationWrapper.tsx","../src/components/DictionaryEditor/NodeWrapper/index.tsx"],"sourcesContent":["/* eslint-disable import/no-cycle */\nimport {\n isSameKeyPath,\n NodeType,\n type DictionaryValue,\n type KeyPath,\n} from '@intlayer/core';\nimport { Edit } from 'lucide-react';\nimport type { FC } from 'react';\nimport { ItemLayout } from '../ItemLayout';\nimport { NodeWrapper, type NodeWrapperProps } from './index';\n\ntype ArrayWrapperProps = Omit<NodeWrapperProps, 'section'> & {\n section: DictionaryValue[];\n};\n\nexport const ArrayWrapper: FC<ArrayWrapperProps> = (props) => {\n const {\n keyPath,\n section,\n onFocusKeyPath,\n onClickEdit,\n focusedKeyPath = [],\n } = props;\n\n return section.map((subSection, key) => {\n const newKeyPathEl: KeyPath = {\n key,\n type: NodeType.Array,\n };\n const newKeyPath: KeyPath[] = [...keyPath, newKeyPathEl];\n\n return (\n <ItemLayout\n level={keyPath.length}\n key={JSON.stringify(subSection)}\n title={`${key}`}\n description=\"\"\n isSelected={isSameKeyPath(newKeyPath, focusedKeyPath)}\n onClick={(e) => {\n e.stopPropagation();\n onFocusKeyPath(newKeyPath);\n }}\n rightParam={\n <Edit\n size={16}\n role=\"button\"\n aria-label=\"Open the editor\"\n onClick={(e) => {\n e.stopPropagation();\n\n onClickEdit?.(newKeyPath);\n }}\n />\n }\n >\n <NodeWrapper {...props} keyPath={newKeyPath} section={subSection} />\n </ItemLayout>\n );\n });\n};\n","/* eslint-disable import/no-cycle */\nimport {\n type KeyPath,\n NodeType,\n type EnumerationContent,\n type DictionaryValue,\n} from '@intlayer/core';\nimport type { FC } from 'react';\nimport { NodeWrapper, traceKeys, type NodeWrapperProps } from './index';\n\ntype EnumerationWrapperProps = Omit<NodeWrapperProps, 'section'> & {\n section: EnumerationContent<DictionaryValue>;\n};\n\nexport const EnumerationWrapper: FC<EnumerationWrapperProps> = (props) => {\n const { keyPath, section } = props;\n\n return (\n <div className=\"ml-2 grid grid-cols-[auto,1fr] gap-2\">\n {Object.keys(section)\n .filter((key) => !traceKeys.includes(key))\n .map((key) => {\n const newKeyPathEl: KeyPath = {\n type: NodeType.Enumeration,\n key,\n };\n const newKeyPath: KeyPath[] = [...keyPath, newKeyPathEl];\n\n const subSection =\n section.enumeration[key as keyof (typeof section)['enumeration']]!;\n\n return (\n <>\n <span className=\"flex items-center font-bold\">{key}</span>\n <NodeWrapper\n {...props}\n key={key}\n keyPath={newKeyPath}\n section={subSection}\n />\n </>\n );\n })}\n </div>\n );\n};\n","/* eslint-disable import/no-cycle */\n\nimport {\n type KeyPath,\n isSameKeyPath,\n type DictionaryValue,\n NodeType,\n} from '@intlayer/core';\nimport { Edit } from 'lucide-react';\nimport type { FC } from 'react';\nimport { ItemLayout } from '../ItemLayout';\nimport { NodeWrapper, traceKeys, type NodeWrapperProps } from './index';\n\ntype NestedObjectWrapperProps = Omit<NodeWrapperProps, 'section'> & {\n section: Record<string, DictionaryValue>;\n};\n\nexport const NestedObjectWrapper: FC<NestedObjectWrapperProps> = (props) => {\n const {\n keyPath,\n section,\n focusedKeyPath = [],\n onClickEdit,\n onFocusKeyPath,\n } = props;\n\n return Object.keys(section)\n .filter((key) => !traceKeys.includes(key))\n .map((key) => {\n const newKeyPathEl: KeyPath = { key, type: NodeType.Object };\n const newKeyPath: KeyPath[] = [...keyPath, newKeyPathEl];\n\n return (\n <ItemLayout\n level={keyPath.length}\n key={key}\n title={key}\n description=\"\"\n isSelected={isSameKeyPath(newKeyPath, focusedKeyPath)}\n onClick={(e) => {\n e.stopPropagation();\n\n onFocusKeyPath(newKeyPath);\n }}\n rightParam={\n <Edit\n size={16}\n role=\"button\"\n aria-label=\"Open the editor\"\n onClick={(e) => {\n e.stopPropagation();\n\n onClickEdit?.(newKeyPath);\n }}\n />\n }\n >\n <NodeWrapper {...props} keyPath={newKeyPath} section={section[key]} />\n </ItemLayout>\n );\n });\n};\n","/* eslint-disable import/no-cycle */\n\nimport {\n type KeyPath,\n NodeType,\n type TranslationContent,\n type DictionaryValue,\n} from '@intlayer/core';\nimport type { FC } from 'react';\nimport { NodeWrapper, type NodeWrapperProps } from './index';\n\ntype TranslationWrapperProps = Omit<NodeWrapperProps, 'section'> & {\n section: TranslationContent<DictionaryValue>;\n};\n\nexport const TranslationWrapper: FC<TranslationWrapperProps> = (props) => {\n const { keyPath, section, locale } = props;\n\n const newKeyPathEl: KeyPath = {\n type: NodeType.Translation,\n key: locale,\n };\n\n const newKeyPath: KeyPath[] = [...keyPath, newKeyPathEl];\n\n const subSection =\n section.translation[\n locale as unknown as keyof (typeof section)['translation']\n ]!;\n\n return <NodeWrapper {...props} keyPath={newKeyPath} section={subSection} />;\n};\n","/* eslint-disable import/no-cycle */\n'use client';\n\nimport type { Locales } from '@intlayer/config/client';\nimport {\n type EnumerationContent,\n type TranslationContent,\n NodeType,\n type KeyPath,\n type DictionaryValue,\n type Dictionary,\n} from '@intlayer/core';\nimport {\n createElement,\n type ReactElement,\n type ReactNode,\n type FC,\n} from 'react';\nimport { ArrayWrapper } from './ArrayWrapper';\nimport { EnumerationWrapper } from './EnumerationWrapper';\nimport { NestedObjectWrapper } from './NestedObjectWrapper';\nimport { StringWrapper } from './StringWrapper';\nimport { TranslationWrapper } from './TranslationWrapper';\n\nexport const traceKeys: string[] = ['filePath', 'id', 'nodeType'];\n\nconst isReactNode = (node: Record<string, unknown>): boolean =>\n typeof node?.key !== 'undefined' && typeof node?.props !== 'undefined';\n\nexport type NodeWrapperProps = {\n keyPath: KeyPath[];\n section: DictionaryValue;\n onContentChange: (content: { keyPath: KeyPath[]; newValue: string }) => void;\n locale: Locales;\n editedContent: Dictionary;\n focusedKeyPath: KeyPath[] | undefined;\n onFocusKeyPath: (keyPath: KeyPath[]) => void;\n onClickEdit?: (keyPath: KeyPath[]) => void;\n};\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 const NodeWrapper: FC<NodeWrapperProps> = (props) => {\n const { section } = props;\n\n if (typeof section === 'object') {\n if (isReactNode(section as Record<string, unknown>)) {\n return (\n <>\n {createReactElement(section as unknown as ReactElement)}\n <span className=\"text-neutral dark:text-neutral-dark text-xs\">\n React node not editable\n </span>\n </>\n );\n }\n\n if (\n (section as TranslationContent<DictionaryValue>).nodeType ===\n NodeType.Translation\n ) {\n return (\n <TranslationWrapper\n {...props}\n section={section as TranslationContent<DictionaryValue>}\n />\n );\n }\n\n if (\n (section as EnumerationContent<DictionaryValue>).nodeType ===\n NodeType.Enumeration\n ) {\n return (\n <EnumerationWrapper\n {...props}\n section={section as EnumerationContent<DictionaryValue>}\n />\n );\n }\n\n if (Array.isArray(section)) {\n return <ArrayWrapper {...props} section={section as DictionaryValue[]} />;\n }\n\n return (\n <NestedObjectWrapper\n {...props}\n section={section as Record<string, DictionaryValue>}\n />\n );\n }\n\n if (typeof section === 'string') {\n return <StringWrapper {...props} section={section} />;\n }\n};\n"],"names":["NodeType","jsx","ItemLayout","isSameKeyPath","Edit","jsxs","Fragment","createElement","element","StringWrapper"],"mappings":";;;;;;;;AAgBa,MAAA,eAAsC,CAAC,UAAU;AACtD,QAAA;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,iBAAiB,CAAC;AAAA,EAChB,IAAA;AAEJ,SAAO,QAAQ,IAAI,CAAC,YAAY,QAAQ;AACtC,UAAM,eAAwB;AAAA,MAC5B;AAAA,MACA,MAAMA,KAAS,SAAA;AAAA,IAAA;AAEjB,UAAM,aAAwB,CAAC,GAAG,SAAS,YAAY;AAGrD,WAAAC,2BAAA,kBAAA;AAAA,MAACC,uCAAA;AAAA,MAAA;AAAA,QACC,OAAO,QAAQ;AAAA,QAEf,OAAO,GAAG,GAAG;AAAA,QACb,aAAY;AAAA,QACZ,YAAYC,KAAAA,cAAc,YAAY,cAAc;AAAA,QACpD,SAAS,CAAC,MAAM;AACd,YAAE,gBAAgB;AAClB,yBAAe,UAAU;AAAA,QAC3B;AAAA,QACA,YACEF,2BAAA,kBAAA;AAAA,UAACG,YAAA;AAAA,UAAA;AAAA,YACC,MAAM;AAAA,YACN,MAAK;AAAA,YACL,cAAW;AAAA,YACX,SAAS,CAAC,MAAM;AACd,gBAAE,gBAAgB;AAElB,4BAAc,UAAU;AAAA,YAC1B;AAAA,UAAA;AAAA,QACF;AAAA,QAGF,2DAAC,aAAa,EAAA,GAAG,OAAO,SAAS,YAAY,SAAS,YAAY;AAAA,MAAA;AAAA,MArB7D,KAAK,UAAU,UAAU;AAAA,IAAA;AAAA,EAsB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,MAAA;AAAA,IAAA;AAAA,EAGN;AAEI,MAAA,OAAO,YAAY,UAAU;AAC/B,WAAQA,2BAAAA,kBAAAA,IAAAQ,sDAAAA,eAAA,EAAe,GAAG,OAAO,QAAkB,CAAA;AAAA,EACrD;AACF;;;;;;;"}
@@ -1,205 +0,0 @@
1
- "use client";
2
- import { j as jsxRuntimeExports } from "./jsx-runtime-BgSF1HG2.js";
3
- import { NodeType, isSameKeyPath } from "@intlayer/core";
4
- import { createElement } from "react";
5
- import { Edit } from "lucide-react";
6
- import { ItemLayout } from "./components/DictionaryEditor/ItemLayout.mjs";
7
- import { StringWrapper } from "./components/DictionaryEditor/NodeWrapper/StringWrapper.mjs";
8
- import { useEditedContentStore } from "./components/DictionaryEditor/useEditedContentStore.mjs";
9
- const ArrayWrapper = (props) => {
10
- const {
11
- keyPath,
12
- section,
13
- onFocusKeyPath,
14
- onClickEdit,
15
- focusedKeyPath = []
16
- } = props;
17
- return section.map((subSection, key) => {
18
- const newKeyPathEl = {
19
- key,
20
- type: NodeType.Array
21
- };
22
- const newKeyPath = [...keyPath, newKeyPathEl];
23
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
24
- ItemLayout,
25
- {
26
- level: keyPath.length,
27
- title: `${key}`,
28
- description: "",
29
- isSelected: isSameKeyPath(newKeyPath, focusedKeyPath),
30
- onClick: (e) => {
31
- e.stopPropagation();
32
- onFocusKeyPath(newKeyPath);
33
- },
34
- rightParam: /* @__PURE__ */ jsxRuntimeExports.jsx(
35
- Edit,
36
- {
37
- size: 16,
38
- role: "button",
39
- "aria-label": "Open the editor",
40
- onClick: (e) => {
41
- e.stopPropagation();
42
- onClickEdit?.(newKeyPath);
43
- }
44
- }
45
- ),
46
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(NodeWrapper, { ...props, keyPath: newKeyPath, section: subSection })
47
- },
48
- JSON.stringify(subSection)
49
- );
50
- });
51
- };
52
- const EnumerationWrapper = (props) => {
53
- const { keyPath, section } = props;
54
- return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ml-2 grid grid-cols-[auto,1fr] gap-2", children: Object.keys(section).filter((key) => !traceKeys.includes(key)).map((key) => {
55
- const newKeyPathEl = {
56
- type: NodeType.Enumeration,
57
- key
58
- };
59
- const newKeyPath = [...keyPath, newKeyPathEl];
60
- const subSection = section.enumeration[key];
61
- return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
62
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "flex items-center font-bold", children: key }),
63
- /* @__PURE__ */ createElement(
64
- NodeWrapper,
65
- {
66
- ...props,
67
- key,
68
- keyPath: newKeyPath,
69
- section: subSection
70
- }
71
- )
72
- ] });
73
- }) });
74
- };
75
- const NestedObjectWrapper = (props) => {
76
- const {
77
- keyPath,
78
- section,
79
- focusedKeyPath = [],
80
- onClickEdit,
81
- onFocusKeyPath
82
- } = props;
83
- return Object.keys(section).filter((key) => !traceKeys.includes(key)).map((key) => {
84
- const newKeyPathEl = { key, type: NodeType.Object };
85
- const newKeyPath = [...keyPath, newKeyPathEl];
86
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
87
- ItemLayout,
88
- {
89
- level: keyPath.length,
90
- title: key,
91
- description: "",
92
- isSelected: isSameKeyPath(newKeyPath, focusedKeyPath),
93
- onClick: (e) => {
94
- e.stopPropagation();
95
- onFocusKeyPath(newKeyPath);
96
- },
97
- rightParam: /* @__PURE__ */ jsxRuntimeExports.jsx(
98
- Edit,
99
- {
100
- size: 16,
101
- role: "button",
102
- "aria-label": "Open the editor",
103
- onClick: (e) => {
104
- e.stopPropagation();
105
- onClickEdit?.(newKeyPath);
106
- }
107
- }
108
- ),
109
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(NodeWrapper, { ...props, keyPath: newKeyPath, section: section[key] })
110
- },
111
- key
112
- );
113
- });
114
- };
115
- const TranslationWrapper = (props) => {
116
- const { keyPath, section, locale } = props;
117
- const newKeyPathEl = {
118
- type: NodeType.Translation,
119
- key: locale
120
- };
121
- const newKeyPath = [...keyPath, newKeyPathEl];
122
- const subSection = section.translation[locale];
123
- return /* @__PURE__ */ jsxRuntimeExports.jsx(NodeWrapper, { ...props, keyPath: newKeyPath, section: subSection });
124
- };
125
- const traceKeys = ["filePath", "id", "nodeType"];
126
- const isReactNode = (node) => typeof node?.key !== "undefined" && typeof node?.props !== "undefined";
127
- const createReactElement = (element) => {
128
- if (typeof element === "string") {
129
- return element;
130
- }
131
- const convertChildrenAsArray = (element2) => {
132
- if (element2?.props && typeof element2.props.children === "object") {
133
- const childrenResult = [];
134
- const { children } = element2.props;
135
- Object.keys(children).forEach((key) => {
136
- childrenResult.push(createReactElement(children[key]));
137
- });
138
- return {
139
- ...element2,
140
- props: { ...element2.props, children: childrenResult }
141
- };
142
- }
143
- return {
144
- ...element2,
145
- props: { ...element2.props, children: element2.props.children }
146
- };
147
- };
148
- const fixedElement = convertChildrenAsArray(element);
149
- const { type, props } = fixedElement;
150
- return createElement(type ?? "div", props, ...props.children);
151
- };
152
- const NodeWrapper = (props) => {
153
- const { section } = props;
154
- useEditedContentStore((s) => ({
155
- addEditedContent: s.addEditedContent
156
- }));
157
- if (typeof section === "object") {
158
- if (isReactNode(section)) {
159
- return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
160
- createReactElement(section),
161
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-neutral dark:text-neutral-dark text-xs", children: "React node not editable" })
162
- ] });
163
- }
164
- if (section.nodeType === NodeType.Translation) {
165
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
166
- TranslationWrapper,
167
- {
168
- ...props,
169
- section
170
- }
171
- );
172
- }
173
- if (section.nodeType === NodeType.Enumeration) {
174
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
175
- EnumerationWrapper,
176
- {
177
- ...props,
178
- section
179
- }
180
- );
181
- }
182
- if (Array.isArray(section)) {
183
- return /* @__PURE__ */ jsxRuntimeExports.jsx(ArrayWrapper, { ...props, section });
184
- }
185
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
186
- NestedObjectWrapper,
187
- {
188
- ...props,
189
- section
190
- }
191
- );
192
- }
193
- if (typeof section === "string") {
194
- return /* @__PURE__ */ jsxRuntimeExports.jsx(StringWrapper, { ...props, section });
195
- }
196
- };
197
- export {
198
- ArrayWrapper as A,
199
- EnumerationWrapper as E,
200
- NodeWrapper as N,
201
- TranslationWrapper as T,
202
- NestedObjectWrapper as a,
203
- traceKeys as t
204
- };
205
- //# sourceMappingURL=index-C09rI9kw.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-C09rI9kw.js","sources":["../src/components/DictionaryEditor/NodeWrapper/ArrayWrapper.tsx","../src/components/DictionaryEditor/NodeWrapper/EnumerationWrapper.tsx","../src/components/DictionaryEditor/NodeWrapper/NestedObjectWrapper.tsx","../src/components/DictionaryEditor/NodeWrapper/TranslationWrapper.tsx","../src/components/DictionaryEditor/NodeWrapper/index.tsx"],"sourcesContent":["/* eslint-disable import/no-cycle */\nimport {\n isSameKeyPath,\n NodeType,\n type DictionaryValue,\n type KeyPath,\n} from '@intlayer/core';\nimport { Edit } from 'lucide-react';\nimport type { FC } from 'react';\nimport { ItemLayout } from '../ItemLayout';\nimport { NodeWrapper, type NodeWrapperProps } from './index';\n\ntype ArrayWrapperProps = Omit<NodeWrapperProps, 'section'> & {\n section: DictionaryValue[];\n};\n\nexport const ArrayWrapper: FC<ArrayWrapperProps> = (props) => {\n const {\n keyPath,\n section,\n onFocusKeyPath,\n onClickEdit,\n focusedKeyPath = [],\n } = props;\n\n return section.map((subSection, key) => {\n const newKeyPathEl: KeyPath = {\n key,\n type: NodeType.Array,\n };\n const newKeyPath: KeyPath[] = [...keyPath, newKeyPathEl];\n\n return (\n <ItemLayout\n level={keyPath.length}\n key={JSON.stringify(subSection)}\n title={`${key}`}\n description=\"\"\n isSelected={isSameKeyPath(newKeyPath, focusedKeyPath)}\n onClick={(e) => {\n e.stopPropagation();\n onFocusKeyPath(newKeyPath);\n }}\n rightParam={\n <Edit\n size={16}\n role=\"button\"\n aria-label=\"Open the editor\"\n onClick={(e) => {\n e.stopPropagation();\n\n onClickEdit?.(newKeyPath);\n }}\n />\n }\n >\n <NodeWrapper {...props} keyPath={newKeyPath} section={subSection} />\n </ItemLayout>\n );\n });\n};\n","/* eslint-disable import/no-cycle */\nimport {\n type KeyPath,\n NodeType,\n type EnumerationContent,\n type DictionaryValue,\n} from '@intlayer/core';\nimport type { FC } from 'react';\nimport { NodeWrapper, traceKeys, type NodeWrapperProps } from './index';\n\ntype EnumerationWrapperProps = Omit<NodeWrapperProps, 'section'> & {\n section: EnumerationContent<DictionaryValue>;\n};\n\nexport const EnumerationWrapper: FC<EnumerationWrapperProps> = (props) => {\n const { keyPath, section } = props;\n\n return (\n <div className=\"ml-2 grid grid-cols-[auto,1fr] gap-2\">\n {Object.keys(section)\n .filter((key) => !traceKeys.includes(key))\n .map((key) => {\n const newKeyPathEl: KeyPath = {\n type: NodeType.Enumeration,\n key,\n };\n const newKeyPath: KeyPath[] = [...keyPath, newKeyPathEl];\n\n const subSection =\n section.enumeration[key as keyof (typeof section)['enumeration']]!;\n\n return (\n <>\n <span className=\"flex items-center font-bold\">{key}</span>\n <NodeWrapper\n {...props}\n key={key}\n keyPath={newKeyPath}\n section={subSection}\n />\n </>\n );\n })}\n </div>\n );\n};\n","/* eslint-disable import/no-cycle */\n\nimport {\n type KeyPath,\n isSameKeyPath,\n type DictionaryValue,\n NodeType,\n} from '@intlayer/core';\nimport { Edit } from 'lucide-react';\nimport type { FC } from 'react';\nimport { ItemLayout } from '../ItemLayout';\nimport { NodeWrapper, traceKeys, type NodeWrapperProps } from './index';\n\ntype NestedObjectWrapperProps = Omit<NodeWrapperProps, 'section'> & {\n section: Record<string, DictionaryValue>;\n};\n\nexport const NestedObjectWrapper: FC<NestedObjectWrapperProps> = (props) => {\n const {\n keyPath,\n section,\n focusedKeyPath = [],\n onClickEdit,\n onFocusKeyPath,\n } = props;\n\n return Object.keys(section)\n .filter((key) => !traceKeys.includes(key))\n .map((key) => {\n const newKeyPathEl: KeyPath = { key, type: NodeType.Object };\n const newKeyPath: KeyPath[] = [...keyPath, newKeyPathEl];\n\n return (\n <ItemLayout\n level={keyPath.length}\n key={key}\n title={key}\n description=\"\"\n isSelected={isSameKeyPath(newKeyPath, focusedKeyPath)}\n onClick={(e) => {\n e.stopPropagation();\n\n onFocusKeyPath(newKeyPath);\n }}\n rightParam={\n <Edit\n size={16}\n role=\"button\"\n aria-label=\"Open the editor\"\n onClick={(e) => {\n e.stopPropagation();\n\n onClickEdit?.(newKeyPath);\n }}\n />\n }\n >\n <NodeWrapper {...props} keyPath={newKeyPath} section={section[key]} />\n </ItemLayout>\n );\n });\n};\n","/* eslint-disable import/no-cycle */\n\nimport {\n type KeyPath,\n NodeType,\n type TranslationContent,\n type DictionaryValue,\n} from '@intlayer/core';\nimport type { FC } from 'react';\nimport { NodeWrapper, type NodeWrapperProps } from './index';\n\ntype TranslationWrapperProps = Omit<NodeWrapperProps, 'section'> & {\n section: TranslationContent<DictionaryValue>;\n};\n\nexport const TranslationWrapper: FC<TranslationWrapperProps> = (props) => {\n const { keyPath, section, locale } = props;\n\n const newKeyPathEl: KeyPath = {\n type: NodeType.Translation,\n key: locale,\n };\n\n const newKeyPath: KeyPath[] = [...keyPath, newKeyPathEl];\n\n const subSection =\n section.translation[\n locale as unknown as keyof (typeof section)['translation']\n ]!;\n\n return <NodeWrapper {...props} keyPath={newKeyPath} section={subSection} />;\n};\n","/* eslint-disable import/no-cycle */\n'use client';\n\nimport type { Locales } from '@intlayer/config/client';\nimport {\n type EnumerationContent,\n type TranslationContent,\n NodeType,\n type KeyPath,\n type DictionaryValue,\n type Dictionary,\n} from '@intlayer/core';\nimport {\n createElement,\n type ReactElement,\n type ReactNode,\n type FC,\n} from 'react';\nimport { ArrayWrapper } from './ArrayWrapper';\nimport { EnumerationWrapper } from './EnumerationWrapper';\nimport { NestedObjectWrapper } from './NestedObjectWrapper';\nimport { StringWrapper } from './StringWrapper';\nimport { TranslationWrapper } from './TranslationWrapper';\nimport { useEditedContentStore } from '../useEditedContentStore';\n\nexport const traceKeys: string[] = ['filePath', 'id', 'nodeType'];\n\nconst isReactNode = (node: Record<string, unknown>): boolean =>\n typeof node?.key !== 'undefined' && typeof node?.props !== 'undefined';\n\nexport type NodeWrapperProps = {\n keyPath: KeyPath[];\n section: DictionaryValue;\n onContentChange: (content: { keyPath: KeyPath[]; newValue: string }) => void;\n locale: Locales;\n editedContent: Dictionary;\n focusedKeyPath: KeyPath[] | undefined;\n onFocusKeyPath: (keyPath: KeyPath[]) => void;\n onClickEdit?: (keyPath: KeyPath[]) => void;\n};\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 const NodeWrapper: FC<NodeWrapperProps> = (props) => {\n const { section } = props;\n\n const { addEditedContent } = useEditedContentStore((s) => ({\n addEditedContent: s.addEditedContent,\n }));\n\n if (typeof section === 'object') {\n if (isReactNode(section as Record<string, unknown>)) {\n return (\n <>\n {createReactElement(section as unknown as ReactElement)}\n <span className=\"text-neutral dark:text-neutral-dark text-xs\">\n React node not editable\n </span>\n </>\n );\n }\n\n if (\n (section as TranslationContent<DictionaryValue>).nodeType ===\n NodeType.Translation\n ) {\n return (\n <TranslationWrapper\n {...props}\n section={section as TranslationContent<DictionaryValue>}\n />\n );\n }\n\n if (\n (section as EnumerationContent<DictionaryValue>).nodeType ===\n NodeType.Enumeration\n ) {\n return (\n <EnumerationWrapper\n {...props}\n section={section as EnumerationContent<DictionaryValue>}\n />\n );\n }\n\n if (Array.isArray(section)) {\n return <ArrayWrapper {...props} section={section as DictionaryValue[]} />;\n }\n\n return (\n <NestedObjectWrapper\n {...props}\n section={section as Record<string, DictionaryValue>}\n />\n );\n }\n\n if (typeof section === 'string') {\n return <StringWrapper {...props} section={section} />;\n }\n};\n"],"names":["jsx","jsxs","Fragment","element"],"mappings":";;;;;;;;AAgBa,MAAA,eAAsC,CAAC,UAAU;AACtD,QAAA;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,iBAAiB,CAAC;AAAA,EAChB,IAAA;AAEJ,SAAO,QAAQ,IAAI,CAAC,YAAY,QAAQ;AACtC,UAAM,eAAwB;AAAA,MAC5B;AAAA,MACA,MAAM,SAAS;AAAA,IAAA;AAEjB,UAAM,aAAwB,CAAC,GAAG,SAAS,YAAY;AAGrD,WAAAA,kCAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,OAAO,QAAQ;AAAA,QAEf,OAAO,GAAG,GAAG;AAAA,QACb,aAAY;AAAA,QACZ,YAAY,cAAc,YAAY,cAAc;AAAA,QACpD,SAAS,CAAC,MAAM;AACd,YAAE,gBAAgB;AAClB,yBAAe,UAAU;AAAA,QAC3B;AAAA,QACA,YACEA,kCAAA;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,MAAM;AAAA,YACN,MAAK;AAAA,YACL,cAAW;AAAA,YACX,SAAS,CAAC,MAAM;AACd,gBAAE,gBAAgB;AAElB,4BAAc,UAAU;AAAA,YAC1B;AAAA,UAAA;AAAA,QACF;AAAA,QAGF,gDAAC,aAAa,EAAA,GAAG,OAAO,SAAS,YAAY,SAAS,YAAY;AAAA,MAAA;AAAA,MArB7D,KAAK,UAAU,UAAU;AAAA,IAAA;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QA,kCAAAA,IAAA,eAAA,EAAe,GAAG,OAAO,QAAkB,CAAA;AAAA,EACrD;AACF;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-pLq_417z.js","sources":["../src/components/DictionaryEditor/NodeWrapper/ArrayWrapper.tsx","../src/components/DictionaryEditor/NodeWrapper/EnumerationWrapper.tsx","../src/components/DictionaryEditor/NodeWrapper/NestedObjectWrapper.tsx","../src/components/DictionaryEditor/NodeWrapper/TranslationWrapper.tsx","../src/components/DictionaryEditor/NodeWrapper/index.tsx"],"sourcesContent":["/* eslint-disable import/no-cycle */\nimport {\n isSameKeyPath,\n NodeType,\n type DictionaryValue,\n type KeyPath,\n} from '@intlayer/core';\nimport { Edit } from 'lucide-react';\nimport type { FC } from 'react';\nimport { ItemLayout } from '../ItemLayout';\nimport { NodeWrapper, type NodeWrapperProps } from './index';\n\ntype ArrayWrapperProps = Omit<NodeWrapperProps, 'section'> & {\n section: DictionaryValue[];\n};\n\nexport const ArrayWrapper: FC<ArrayWrapperProps> = (props) => {\n const {\n keyPath,\n section,\n onFocusKeyPath,\n onClickEdit,\n focusedKeyPath = [],\n } = props;\n\n return section.map((subSection, key) => {\n const newKeyPathEl: KeyPath = {\n key,\n type: NodeType.Array,\n };\n const newKeyPath: KeyPath[] = [...keyPath, newKeyPathEl];\n\n return (\n <ItemLayout\n level={keyPath.length}\n key={JSON.stringify(subSection)}\n title={`${key}`}\n description=\"\"\n isSelected={isSameKeyPath(newKeyPath, focusedKeyPath)}\n onClick={(e) => {\n e.stopPropagation();\n onFocusKeyPath(newKeyPath);\n }}\n rightParam={\n <Edit\n size={16}\n role=\"button\"\n aria-label=\"Open the editor\"\n onClick={(e) => {\n e.stopPropagation();\n\n onClickEdit?.(newKeyPath);\n }}\n />\n }\n >\n <NodeWrapper {...props} keyPath={newKeyPath} section={subSection} />\n </ItemLayout>\n );\n });\n};\n","/* eslint-disable import/no-cycle */\nimport {\n type KeyPath,\n NodeType,\n type EnumerationContent,\n type DictionaryValue,\n} from '@intlayer/core';\nimport type { FC } from 'react';\nimport { NodeWrapper, traceKeys, type NodeWrapperProps } from './index';\n\ntype EnumerationWrapperProps = Omit<NodeWrapperProps, 'section'> & {\n section: EnumerationContent<DictionaryValue>;\n};\n\nexport const EnumerationWrapper: FC<EnumerationWrapperProps> = (props) => {\n const { keyPath, section } = props;\n\n return (\n <div className=\"ml-2 grid grid-cols-[auto,1fr] gap-2\">\n {Object.keys(section)\n .filter((key) => !traceKeys.includes(key))\n .map((key) => {\n const newKeyPathEl: KeyPath = {\n type: NodeType.Enumeration,\n key,\n };\n const newKeyPath: KeyPath[] = [...keyPath, newKeyPathEl];\n\n const subSection =\n section.enumeration[key as keyof (typeof section)['enumeration']]!;\n\n return (\n <>\n <span className=\"flex items-center font-bold\">{key}</span>\n <NodeWrapper\n {...props}\n key={key}\n keyPath={newKeyPath}\n section={subSection}\n />\n </>\n );\n })}\n </div>\n );\n};\n","/* eslint-disable import/no-cycle */\n\nimport {\n type KeyPath,\n isSameKeyPath,\n type DictionaryValue,\n NodeType,\n} from '@intlayer/core';\nimport { Edit } from 'lucide-react';\nimport type { FC } from 'react';\nimport { ItemLayout } from '../ItemLayout';\nimport { NodeWrapper, traceKeys, type NodeWrapperProps } from './index';\n\ntype NestedObjectWrapperProps = Omit<NodeWrapperProps, 'section'> & {\n section: Record<string, DictionaryValue>;\n};\n\nexport const NestedObjectWrapper: FC<NestedObjectWrapperProps> = (props) => {\n const {\n keyPath,\n section,\n focusedKeyPath = [],\n onClickEdit,\n onFocusKeyPath,\n } = props;\n\n return Object.keys(section)\n .filter((key) => !traceKeys.includes(key))\n .map((key) => {\n const newKeyPathEl: KeyPath = { key, type: NodeType.Object };\n const newKeyPath: KeyPath[] = [...keyPath, newKeyPathEl];\n\n return (\n <ItemLayout\n level={keyPath.length}\n key={key}\n title={key}\n description=\"\"\n isSelected={isSameKeyPath(newKeyPath, focusedKeyPath)}\n onClick={(e) => {\n e.stopPropagation();\n\n onFocusKeyPath(newKeyPath);\n }}\n rightParam={\n <Edit\n size={16}\n role=\"button\"\n aria-label=\"Open the editor\"\n onClick={(e) => {\n e.stopPropagation();\n\n onClickEdit?.(newKeyPath);\n }}\n />\n }\n >\n <NodeWrapper {...props} keyPath={newKeyPath} section={section[key]} />\n </ItemLayout>\n );\n });\n};\n","/* eslint-disable import/no-cycle */\n\nimport {\n type KeyPath,\n NodeType,\n type TranslationContent,\n type DictionaryValue,\n} from '@intlayer/core';\nimport type { FC } from 'react';\nimport { NodeWrapper, type NodeWrapperProps } from './index';\n\ntype TranslationWrapperProps = Omit<NodeWrapperProps, 'section'> & {\n section: TranslationContent<DictionaryValue>;\n};\n\nexport const TranslationWrapper: FC<TranslationWrapperProps> = (props) => {\n const { keyPath, section, locale } = props;\n\n const newKeyPathEl: KeyPath = {\n type: NodeType.Translation,\n key: locale,\n };\n\n const newKeyPath: KeyPath[] = [...keyPath, newKeyPathEl];\n\n const subSection =\n section.translation[\n locale as unknown as keyof (typeof section)['translation']\n ]!;\n\n return <NodeWrapper {...props} keyPath={newKeyPath} section={subSection} />;\n};\n","/* eslint-disable import/no-cycle */\n'use client';\n\nimport type { Locales } from '@intlayer/config/client';\nimport {\n type EnumerationContent,\n type TranslationContent,\n NodeType,\n type KeyPath,\n type DictionaryValue,\n type Dictionary,\n} from '@intlayer/core';\nimport {\n createElement,\n type ReactElement,\n type ReactNode,\n type FC,\n} from 'react';\nimport { ArrayWrapper } from './ArrayWrapper';\nimport { EnumerationWrapper } from './EnumerationWrapper';\nimport { NestedObjectWrapper } from './NestedObjectWrapper';\nimport { StringWrapper } from './StringWrapper';\nimport { TranslationWrapper } from './TranslationWrapper';\n\nexport const traceKeys: string[] = ['filePath', 'id', 'nodeType'];\n\nconst isReactNode = (node: Record<string, unknown>): boolean =>\n typeof node?.key !== 'undefined' && typeof node?.props !== 'undefined';\n\nexport type NodeWrapperProps = {\n keyPath: KeyPath[];\n section: DictionaryValue;\n onContentChange: (content: { keyPath: KeyPath[]; newValue: string }) => void;\n locale: Locales;\n editedContent: Dictionary;\n focusedKeyPath: KeyPath[] | undefined;\n onFocusKeyPath: (keyPath: KeyPath[]) => void;\n onClickEdit?: (keyPath: KeyPath[]) => void;\n};\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 const NodeWrapper: FC<NodeWrapperProps> = (props) => {\n const { section } = props;\n\n if (typeof section === 'object') {\n if (isReactNode(section as Record<string, unknown>)) {\n return (\n <>\n {createReactElement(section as unknown as ReactElement)}\n <span className=\"text-neutral dark:text-neutral-dark text-xs\">\n React node not editable\n </span>\n </>\n );\n }\n\n if (\n (section as TranslationContent<DictionaryValue>).nodeType ===\n NodeType.Translation\n ) {\n return (\n <TranslationWrapper\n {...props}\n section={section as TranslationContent<DictionaryValue>}\n />\n );\n }\n\n if (\n (section as EnumerationContent<DictionaryValue>).nodeType ===\n NodeType.Enumeration\n ) {\n return (\n <EnumerationWrapper\n {...props}\n section={section as EnumerationContent<DictionaryValue>}\n />\n );\n }\n\n if (Array.isArray(section)) {\n return <ArrayWrapper {...props} section={section as DictionaryValue[]} />;\n }\n\n return (\n <NestedObjectWrapper\n {...props}\n section={section as Record<string, DictionaryValue>}\n />\n );\n }\n\n if (typeof section === 'string') {\n return <StringWrapper {...props} section={section} />;\n }\n};\n"],"names":["jsx","jsxs","Fragment","element"],"mappings":";;;;;;;A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,YAAY,UAAU;AAC3B,QAAA,YAAY,OAAkC,GAAG;AACnD,aAEKF,kCAAA,KAAAC,4BAAA,EAAA,UAAA;AAAA,QAAA,mBAAmB,OAAkC;AAAA,QACrDF,kCAAA,IAAA,QAAA,EAAK,WAAU,+CAA8C,UAE9D,2BAAA;AAAA,MACF,EAAA,CAAA;AAAA,IAEJ;AAGG,QAAA,QAAgD,aACjD,SAAS,aACT;AAEE,aAAAA,kCAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACE,GAAG;AAAA,UACJ;AAAA,QAAA;AAAA,MAAA;AAAA,IAGN;AAGG,QAAA,QAAgD,aACjD,SAAS,aACT;AAEE,aAAAA,kCAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACE,GAAG;AAAA,UACJ;AAAA,QAAA;AAAA,MAAA;AAAA,IAGN;AAEI,QAAA,MAAM,QAAQ,OAAO,GAAG;AAC1B,aAAQA,kCAAAA,IAAA,cAAA,EAAc,GAAG,OAAO,QAAuC,CAAA;AAAA,IACzE;AAGE,WAAAA,kCAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACE,GAAG;AAAA,QACJ;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AAEI,MAAA,OAAO,YAAY,UAAU;AAC/B,WAAQA,kCAAAA,IAAA,eAAA,EAAe,GAAG,OAAO,QAAkB,CAAA;AAAA,EACrD;AACF;"}
@@ -1,22 +0,0 @@
1
- import { getConfiguration } from "@intlayer/config/client";
2
- import { fetcher } from "./libs/intlayer-api/fetcher.mjs";
3
- const backendURL = getConfiguration().editor.backendURL;
4
- const STRIPE_API_ROUTE = `${backendURL}/api/stripe`;
5
- const getStripeAPI = (authAPIOptions = {}) => {
6
- const getCheckoutSession = async (body, otherOptions = {}) => await fetcher(
7
- `${STRIPE_API_ROUTE}/checkout-session`,
8
- authAPIOptions,
9
- otherOptions,
10
- {
11
- method: "POST",
12
- body
13
- }
14
- );
15
- return {
16
- getCheckoutSession
17
- };
18
- };
19
- export {
20
- getStripeAPI as g
21
- };
22
- //# sourceMappingURL=stripe-BsI0lJWz.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"stripe-BsI0lJWz.js","sources":["../src/libs/intlayer-api/stripe.ts"],"sourcesContent":["import type {\n GetCheckoutSessionBody,\n GetCheckoutSessionResult,\n} from '@intlayer/backend';\nimport { getConfiguration } from '@intlayer/config/client';\nimport { fetcher, type FetcherOptions } from './fetcher';\n\nconst backendURL = getConfiguration().editor.backendURL;\nconst STRIPE_API_ROUTE = `${backendURL}/api/stripe`;\n\nexport const getStripeAPI = (authAPIOptions: FetcherOptions = {}) => {\n /**\n * Retrieves a checkout session.\n * @param body - Checkout session body.\n */\n const getCheckoutSession = async (\n body?: GetCheckoutSessionBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetCheckoutSessionResult>(\n `${STRIPE_API_ROUTE}/checkout-session`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body,\n }\n );\n\n return {\n getCheckoutSession,\n };\n};\n"],"names":[],"mappings":";;AAOA,MAAM,aAAa,iBAAiB,EAAE,OAAO;AAC7C,MAAM,mBAAmB,GAAG,UAAU;AAE/B,MAAM,eAAe,CAAC,iBAAiC,OAAO;AAKnE,QAAM,qBAAqB,OACzB,MACA,eAA+B,CAAA,MAE/B,MAAM;AAAA,IACJ,GAAG,gBAAgB;AAAA,IACnB;AAAA,IACA;AAAA,IACA;AAAA,MACE,QAAQ;AAAA,MACR;AAAA,IACF;AAAA,EAAA;AAGG,SAAA;AAAA,IACL;AAAA,EAAA;AAEJ;"}
@@ -1,22 +0,0 @@
1
- import { getConfiguration } from "@intlayer/config/client";
2
- import { fetcher } from "./libs/intlayer-api/fetcher.mjs";
3
- const backendURL = getConfiguration().editor.backendURL;
4
- const STRIPE_API_ROUTE = `${backendURL}/api/stripe`;
5
- const getStripeAPI = (authAPIOptions = {}) => {
6
- const getCheckoutSession = async (body, otherOptions = {}) => await fetcher(
7
- `${STRIPE_API_ROUTE}/create-checkout-session`,
8
- authAPIOptions,
9
- otherOptions,
10
- {
11
- method: "POST",
12
- body
13
- }
14
- );
15
- return {
16
- getCheckoutSession
17
- };
18
- };
19
- export {
20
- getStripeAPI as g
21
- };
22
- //# sourceMappingURL=stripe-C-u5RvGh.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"stripe-C-u5RvGh.js","sources":["../src/libs/intlayer-api/stripe.ts"],"sourcesContent":["import type {\n GetCheckoutSessionBody,\n GetCheckoutSessionResult,\n} from '@intlayer/backend';\nimport { getConfiguration } from '@intlayer/config/client';\nimport { fetcher, type FetcherOptions } from './fetcher';\n\nconst backendURL = getConfiguration().editor.backendURL;\nconst STRIPE_API_ROUTE = `${backendURL}/api/stripe`;\n\nexport const getStripeAPI = (authAPIOptions: FetcherOptions = {}) => {\n /**\n * Retrieves a checkout session.\n * @param body - Checkout session body.\n */\n const getCheckoutSession = async (\n body?: GetCheckoutSessionBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetCheckoutSessionResult>(\n `${STRIPE_API_ROUTE}/create-checkout-session`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body,\n }\n );\n\n return {\n getCheckoutSession,\n };\n};\n"],"names":[],"mappings":";;AAOA,MAAM,aAAa,iBAAiB,EAAE,OAAO;AAC7C,MAAM,mBAAmB,GAAG,UAAU;AAE/B,MAAM,eAAe,CAAC,iBAAiC,OAAO;AAKnE,QAAM,qBAAqB,OACzB,MACA,eAA+B,CAAA,MAE/B,MAAM;AAAA,IACJ,GAAG,gBAAgB;AAAA,IACnB;AAAA,IACA;AAAA,IACA;AAAA,MACE,QAAQ;AAAA,MACR;AAAA,IACF;AAAA,EAAA;AAGG,SAAA;AAAA,IACL;AAAA,EAAA;AAEJ;"}