@intlayer/design-system 9.0.0-canary.0 → 9.0.0-canary.10

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 (282) hide show
  1. package/dist/esm/api/hooks/ai.mjs +20 -1
  2. package/dist/esm/api/hooks/ai.mjs.map +1 -1
  3. package/dist/esm/api/hooks/asset.mjs +78 -0
  4. package/dist/esm/api/hooks/asset.mjs.map +1 -0
  5. package/dist/esm/api/hooks/dictionary.mjs +15 -3
  6. package/dist/esm/api/hooks/dictionary.mjs.map +1 -1
  7. package/dist/esm/api/hooks/utils.mjs +1 -1
  8. package/dist/esm/api/index.mjs +4 -3
  9. package/dist/esm/api/useAuth/useOAuth2.mjs +2 -2
  10. package/dist/esm/api/useAuth/useSession.mjs +1 -1
  11. package/dist/esm/api/useIntlayerAPI.mjs +6 -1
  12. package/dist/esm/api/useIntlayerAPI.mjs.map +1 -1
  13. package/dist/esm/components/Command/index.mjs +8 -8
  14. package/dist/esm/components/Command/index.mjs.map +1 -1
  15. package/dist/esm/components/DictionaryEditor/DictionaryEditor.mjs +1 -1
  16. package/dist/esm/components/DictionaryEditor/NodeWrapper/BooleanWrapper.mjs +1 -1
  17. package/dist/esm/components/DictionaryEditor/NodeWrapper/FileWrapper.mjs +1 -1
  18. package/dist/esm/components/DictionaryEditor/NodeWrapper/MarkdownWrapper.mjs.map +1 -1
  19. package/dist/esm/components/DictionaryEditor/NodeWrapper/NumberWrapper.mjs +1 -1
  20. package/dist/esm/components/DictionaryEditor/NodeWrapper/StringWrapper.mjs +1 -1
  21. package/dist/esm/components/DictionaryEditor/NodeWrapper/index.mjs +1 -1
  22. package/dist/esm/components/DictionaryFieldEditor/ContentEditor.mjs +105 -36
  23. package/dist/esm/components/DictionaryFieldEditor/ContentEditor.mjs.map +1 -1
  24. package/dist/esm/components/DictionaryFieldEditor/ContentEditorView/TextEditor.mjs +32 -10
  25. package/dist/esm/components/DictionaryFieldEditor/ContentEditorView/TextEditor.mjs.map +1 -1
  26. package/dist/esm/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.mjs +120 -35
  27. package/dist/esm/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.mjs.map +1 -1
  28. package/dist/esm/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryCreationForm.content.mjs +246 -0
  29. package/dist/esm/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryCreationForm.content.mjs.map +1 -1
  30. package/dist/esm/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.mjs +10 -2
  31. package/dist/esm/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.mjs.map +1 -1
  32. package/dist/esm/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.mjs +377 -18
  33. package/dist/esm/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.mjs.map +1 -1
  34. package/dist/esm/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.mjs +506 -0
  35. package/dist/esm/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.mjs.map +1 -1
  36. package/dist/esm/components/DictionaryFieldEditor/DictionaryFieldEditor.mjs +10 -6
  37. package/dist/esm/components/DictionaryFieldEditor/DictionaryFieldEditor.mjs.map +1 -1
  38. package/dist/esm/components/DictionaryFieldEditor/JSONEditor.mjs +1 -1
  39. package/dist/esm/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.mjs +1 -1
  40. package/dist/esm/components/DictionaryFieldEditor/SaveForm/SaveForm.mjs +9 -9
  41. package/dist/esm/components/DictionaryFieldEditor/SaveForm/SaveForm.mjs.map +1 -1
  42. package/dist/esm/components/DictionaryFieldEditor/StructureEditor.mjs +1 -1
  43. package/dist/esm/components/DictionaryFieldEditor/StructureView/StructureView.mjs +2 -2
  44. package/dist/esm/components/DictionaryFieldEditor/StructureView/StructureView.mjs.map +1 -1
  45. package/dist/esm/components/DictionaryFieldEditor/contentEditor.content.mjs +79 -0
  46. package/dist/esm/components/DictionaryFieldEditor/contentEditor.content.mjs.map +1 -0
  47. package/dist/esm/components/Form/Form.mjs +3 -43
  48. package/dist/esm/components/Form/Form.mjs.map +1 -1
  49. package/dist/esm/components/Form/elements/FormElement.mjs +2 -3
  50. package/dist/esm/components/Form/elements/FormElement.mjs.map +1 -1
  51. package/dist/esm/components/Form/elements/MultiselectElement.mjs +2 -3
  52. package/dist/esm/components/Form/elements/MultiselectElement.mjs.map +1 -1
  53. package/dist/esm/components/Form/elements/OTPElement.mjs +2 -3
  54. package/dist/esm/components/Form/elements/OTPElement.mjs.map +1 -1
  55. package/dist/esm/components/Form/elements/SelectElement.mjs +2 -3
  56. package/dist/esm/components/Form/elements/SelectElement.mjs.map +1 -1
  57. package/dist/esm/components/Form/elements/SwitchSelectorElement.mjs +2 -3
  58. package/dist/esm/components/Form/elements/SwitchSelectorElement.mjs.map +1 -1
  59. package/dist/esm/components/Form/index.mjs +21 -2
  60. package/dist/esm/components/Form/layout/FormItemLayout.mjs +8 -5
  61. package/dist/esm/components/Form/layout/FormItemLayout.mjs.map +1 -1
  62. package/dist/esm/components/LanguageBackground/LanguageBackground.mjs +3 -8
  63. package/dist/esm/components/LanguageBackground/LanguageBackground.mjs.map +1 -1
  64. package/dist/esm/components/MarkDownRender/MarkDownRender.mjs +1 -1
  65. package/dist/esm/components/MarkDownRender/MarkDownRender.mjs.map +1 -1
  66. package/dist/esm/components/MarkdownEditor/MarkdownEditor.mjs +113 -0
  67. package/dist/esm/components/MarkdownEditor/MarkdownEditor.mjs.map +1 -0
  68. package/dist/esm/components/MarkdownEditor/extensions.mjs +103 -0
  69. package/dist/esm/components/MarkdownEditor/extensions.mjs.map +1 -0
  70. package/dist/esm/components/MarkdownEditor/generative/AICompletionCommands.mjs +51 -0
  71. package/dist/esm/components/MarkdownEditor/generative/AICompletionCommands.mjs.map +1 -0
  72. package/dist/esm/components/MarkdownEditor/generative/AISelector.mjs +100 -0
  73. package/dist/esm/components/MarkdownEditor/generative/AISelector.mjs.map +1 -0
  74. package/dist/esm/components/MarkdownEditor/generative/AISelectorCommands.mjs +81 -0
  75. package/dist/esm/components/MarkdownEditor/generative/AISelectorCommands.mjs.map +1 -0
  76. package/dist/esm/components/MarkdownEditor/generative/GenerativeMenuSwitch.mjs +47 -0
  77. package/dist/esm/components/MarkdownEditor/generative/GenerativeMenuSwitch.mjs.map +1 -0
  78. package/dist/esm/components/MarkdownEditor/generative/useAICompletion.mjs +83 -0
  79. package/dist/esm/components/MarkdownEditor/generative/useAICompletion.mjs.map +1 -0
  80. package/dist/esm/components/MarkdownEditor/imageUpload.mjs +47 -0
  81. package/dist/esm/components/MarkdownEditor/imageUpload.mjs.map +1 -0
  82. package/dist/esm/components/MarkdownEditor/index.mjs +4 -0
  83. package/dist/esm/components/MarkdownEditor/markdownEditor.content.mjs +1140 -0
  84. package/dist/esm/components/MarkdownEditor/markdownEditor.content.mjs.map +1 -0
  85. package/dist/esm/components/MarkdownEditor/novel/components/editor-bubble-item.mjs +20 -0
  86. package/dist/esm/components/MarkdownEditor/novel/components/editor-bubble-item.mjs.map +1 -0
  87. package/dist/esm/components/MarkdownEditor/novel/components/editor-bubble.mjs +39 -0
  88. package/dist/esm/components/MarkdownEditor/novel/components/editor-bubble.mjs.map +1 -0
  89. package/dist/esm/components/MarkdownEditor/novel/components/editor-command-item.mjs +25 -0
  90. package/dist/esm/components/MarkdownEditor/novel/components/editor-command-item.mjs.map +1 -0
  91. package/dist/esm/components/MarkdownEditor/novel/components/editor-command.mjs +61 -0
  92. package/dist/esm/components/MarkdownEditor/novel/components/editor-command.mjs.map +1 -0
  93. package/dist/esm/components/MarkdownEditor/novel/components/editor.mjs +27 -0
  94. package/dist/esm/components/MarkdownEditor/novel/components/editor.mjs.map +1 -0
  95. package/dist/esm/components/MarkdownEditor/novel/components/index.mjs +8 -0
  96. package/dist/esm/components/MarkdownEditor/novel/extensions/ai-highlight.mjs +74 -0
  97. package/dist/esm/components/MarkdownEditor/novel/extensions/ai-highlight.mjs.map +1 -0
  98. package/dist/esm/components/MarkdownEditor/novel/extensions/custom-keymap.mjs +37 -0
  99. package/dist/esm/components/MarkdownEditor/novel/extensions/custom-keymap.mjs.map +1 -0
  100. package/dist/esm/components/MarkdownEditor/novel/extensions/image-resizer.mjs +49 -0
  101. package/dist/esm/components/MarkdownEditor/novel/extensions/image-resizer.mjs.map +1 -0
  102. package/dist/esm/components/MarkdownEditor/novel/extensions/index.mjs +51 -0
  103. package/dist/esm/components/MarkdownEditor/novel/extensions/index.mjs.map +1 -0
  104. package/dist/esm/components/MarkdownEditor/novel/extensions/slash-command.mjs +79 -0
  105. package/dist/esm/components/MarkdownEditor/novel/extensions/slash-command.mjs.map +1 -0
  106. package/dist/esm/components/MarkdownEditor/novel/extensions/updated-image.mjs +17 -0
  107. package/dist/esm/components/MarkdownEditor/novel/extensions/updated-image.mjs.map +1 -0
  108. package/dist/esm/components/MarkdownEditor/novel/index.mjs +17 -0
  109. package/dist/esm/components/MarkdownEditor/novel/plugins/index.mjs +3 -0
  110. package/dist/esm/components/MarkdownEditor/novel/plugins/upload-images.mjs +92 -0
  111. package/dist/esm/components/MarkdownEditor/novel/plugins/upload-images.mjs.map +1 -0
  112. package/dist/esm/components/MarkdownEditor/novel/utils/atoms.mjs +39 -0
  113. package/dist/esm/components/MarkdownEditor/novel/utils/atoms.mjs.map +1 -0
  114. package/dist/esm/components/MarkdownEditor/novel/utils/index.mjs +38 -0
  115. package/dist/esm/components/MarkdownEditor/novel/utils/index.mjs.map +1 -0
  116. package/dist/esm/components/MarkdownEditor/selectors/ColorSelector.mjs +176 -0
  117. package/dist/esm/components/MarkdownEditor/selectors/ColorSelector.mjs.map +1 -0
  118. package/dist/esm/components/MarkdownEditor/selectors/LinkSelector.mjs +95 -0
  119. package/dist/esm/components/MarkdownEditor/selectors/LinkSelector.mjs.map +1 -0
  120. package/dist/esm/components/MarkdownEditor/selectors/NodeSelector.mjs +139 -0
  121. package/dist/esm/components/MarkdownEditor/selectors/NodeSelector.mjs.map +1 -0
  122. package/dist/esm/components/MarkdownEditor/selectors/TextButtons.mjs +81 -0
  123. package/dist/esm/components/MarkdownEditor/selectors/TextButtons.mjs.map +1 -0
  124. package/dist/esm/components/MarkdownEditor/slashCommand.mjs +161 -0
  125. package/dist/esm/components/MarkdownEditor/slashCommand.mjs.map +1 -0
  126. package/dist/esm/components/Pattern/GridDistortionPattern.mjs +275 -0
  127. package/dist/esm/components/Pattern/GridDistortionPattern.mjs.map +1 -0
  128. package/dist/esm/components/Pattern/index.mjs +2 -1
  129. package/dist/esm/components/SwitchSelector/useSwitchSelector.mjs +0 -1
  130. package/dist/esm/components/SwitchSelector/useSwitchSelector.mjs.map +1 -1
  131. package/dist/esm/components/Table/Table.mjs +1 -1
  132. package/dist/esm/components/Table/Table.mjs.map +1 -1
  133. package/dist/esm/components/Tag/index.mjs +0 -9
  134. package/dist/esm/components/Tag/index.mjs.map +1 -1
  135. package/dist/esm/components/Toaster/Toast.mjs +1 -1
  136. package/dist/esm/components/Toaster/Toast.mjs.map +1 -1
  137. package/dist/esm/components/index.mjs +27 -6
  138. package/dist/esm/hooks/useIsMounted.mjs +4 -2
  139. package/dist/esm/hooks/useIsMounted.mjs.map +1 -1
  140. package/dist/esm/providers/ReactQueryProvider.mjs +1 -1
  141. package/dist/esm/routes.mjs +2 -1
  142. package/dist/esm/routes.mjs.map +1 -1
  143. package/dist/esm/utils/cn.mjs +2 -8
  144. package/dist/types/api/hooks/ai.d.ts +5 -1
  145. package/dist/types/api/hooks/ai.d.ts.map +1 -1
  146. package/dist/types/api/hooks/asset.d.ts +27 -0
  147. package/dist/types/api/hooks/asset.d.ts.map +1 -0
  148. package/dist/types/api/hooks/audit.d.ts +1 -1
  149. package/dist/types/api/hooks/dictionary.d.ts.map +1 -1
  150. package/dist/types/api/index.d.ts +4 -3
  151. package/dist/types/api/useIntlayerAPI.d.ts +41 -276
  152. package/dist/types/api/useIntlayerAPI.d.ts.map +1 -1
  153. package/dist/types/components/Badge/index.d.ts +1 -1
  154. package/dist/types/components/Breadcrumb/index.d.ts +1 -1
  155. package/dist/types/components/Button/Button.d.ts +3 -3
  156. package/dist/types/components/CollapsibleTable/CollapsibleTable.d.ts +1 -1
  157. package/dist/types/components/Command/index.d.ts.map +1 -1
  158. package/dist/types/components/Container/index.d.ts +2 -2
  159. package/dist/types/components/DictionaryEditor/NodeWrapper/MarkdownWrapper.d.ts.map +1 -1
  160. package/dist/types/components/DictionaryFieldEditor/ContentEditor.d.ts.map +1 -1
  161. package/dist/types/components/DictionaryFieldEditor/ContentEditorView/TextEditor.d.ts.map +1 -1
  162. package/dist/types/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.d.ts.map +1 -1
  163. package/dist/types/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryCreationForm.content.d.ts +246 -0
  164. package/dist/types/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryCreationForm.content.d.ts.map +1 -1
  165. package/dist/types/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.d.ts +10 -1
  166. package/dist/types/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.d.ts.map +1 -1
  167. package/dist/types/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.d.ts +2 -0
  168. package/dist/types/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.d.ts.map +1 -1
  169. package/dist/types/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.d.ts +506 -0
  170. package/dist/types/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.d.ts.map +1 -1
  171. package/dist/types/components/DictionaryFieldEditor/DictionaryFieldEditor.d.ts +2 -1
  172. package/dist/types/components/DictionaryFieldEditor/DictionaryFieldEditor.d.ts.map +1 -1
  173. package/dist/types/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.d.ts +1 -1
  174. package/dist/types/components/DictionaryFieldEditor/contentEditor.content.d.ts +80 -0
  175. package/dist/types/components/DictionaryFieldEditor/contentEditor.content.d.ts.map +1 -0
  176. package/dist/types/components/Form/Form.d.ts +27 -47
  177. package/dist/types/components/Form/Form.d.ts.map +1 -1
  178. package/dist/types/components/Form/elements/AutoSizeTextAreaElement.d.ts +1 -1
  179. package/dist/types/components/Form/elements/CheckboxElement.d.ts +1 -1
  180. package/dist/types/components/Form/elements/EditableFieldInputElement.d.ts +1 -1
  181. package/dist/types/components/Form/elements/EditableFieldTextAreaElement.d.ts +1 -1
  182. package/dist/types/components/Form/elements/FormElement.d.ts.map +1 -1
  183. package/dist/types/components/Form/elements/InputElement.d.ts +1 -1
  184. package/dist/types/components/Form/elements/InputPasswordElement.d.ts +1 -1
  185. package/dist/types/components/Form/elements/MultiselectElement.d.ts +1 -1
  186. package/dist/types/components/Form/elements/MultiselectElement.d.ts.map +1 -1
  187. package/dist/types/components/Form/elements/OTPElement.d.ts +1 -1
  188. package/dist/types/components/Form/elements/OTPElement.d.ts.map +1 -1
  189. package/dist/types/components/Form/elements/SearchInputElement.d.ts +1 -1
  190. package/dist/types/components/Form/elements/SelectElement.d.ts +1 -1
  191. package/dist/types/components/Form/elements/SelectElement.d.ts.map +1 -1
  192. package/dist/types/components/Form/elements/SwitchSelectorElement.d.ts +1 -1
  193. package/dist/types/components/Form/elements/SwitchSelectorElement.d.ts.map +1 -1
  194. package/dist/types/components/Form/elements/TextAreaElement.d.ts +1 -1
  195. package/dist/types/components/Form/index.d.ts +22 -3
  196. package/dist/types/components/Form/layout/FormItemLayout.d.ts.map +1 -1
  197. package/dist/types/components/IDE/CopyCode.d.ts +1 -1
  198. package/dist/types/components/Input/Checkbox.d.ts +2 -2
  199. package/dist/types/components/Input/Radio.d.ts +2 -2
  200. package/dist/types/components/LanguageBackground/LanguageBackground.d.ts.map +1 -1
  201. package/dist/types/components/Link/Link.d.ts +1 -1
  202. package/dist/types/components/MarkDownRender/MarkDownRender.d.ts.map +1 -1
  203. package/dist/types/components/MarkdownEditor/MarkdownEditor.d.ts +31 -0
  204. package/dist/types/components/MarkdownEditor/MarkdownEditor.d.ts.map +1 -0
  205. package/dist/types/components/MarkdownEditor/extensions.d.ts +11 -0
  206. package/dist/types/components/MarkdownEditor/extensions.d.ts.map +1 -0
  207. package/dist/types/components/MarkdownEditor/generative/AICompletionCommands.d.ts +18 -0
  208. package/dist/types/components/MarkdownEditor/generative/AICompletionCommands.d.ts.map +1 -0
  209. package/dist/types/components/MarkdownEditor/generative/AISelector.d.ts +22 -0
  210. package/dist/types/components/MarkdownEditor/generative/AISelector.d.ts.map +1 -0
  211. package/dist/types/components/MarkdownEditor/generative/AISelectorCommands.d.ts +17 -0
  212. package/dist/types/components/MarkdownEditor/generative/AISelectorCommands.d.ts.map +1 -0
  213. package/dist/types/components/MarkdownEditor/generative/GenerativeMenuSwitch.d.ts +26 -0
  214. package/dist/types/components/MarkdownEditor/generative/GenerativeMenuSwitch.d.ts.map +1 -0
  215. package/dist/types/components/MarkdownEditor/generative/useAICompletion.d.ts +30 -0
  216. package/dist/types/components/MarkdownEditor/generative/useAICompletion.d.ts.map +1 -0
  217. package/dist/types/components/MarkdownEditor/imageUpload.d.ts +29 -0
  218. package/dist/types/components/MarkdownEditor/imageUpload.d.ts.map +1 -0
  219. package/dist/types/components/MarkdownEditor/index.d.ts +3 -0
  220. package/dist/types/components/MarkdownEditor/markdownEditor.content.d.ts +1135 -0
  221. package/dist/types/components/MarkdownEditor/markdownEditor.content.d.ts.map +1 -0
  222. package/dist/types/components/MarkdownEditor/novel/components/editor-bubble-item.d.ts +14 -0
  223. package/dist/types/components/MarkdownEditor/novel/components/editor-bubble-item.d.ts.map +1 -0
  224. package/dist/types/components/MarkdownEditor/novel/components/editor-bubble.d.ts +18 -0
  225. package/dist/types/components/MarkdownEditor/novel/components/editor-bubble.d.ts.map +1 -0
  226. package/dist/types/components/MarkdownEditor/novel/components/editor-command-item.d.ts +28 -0
  227. package/dist/types/components/MarkdownEditor/novel/components/editor-command-item.d.ts.map +1 -0
  228. package/dist/types/components/MarkdownEditor/novel/components/editor-command.d.ts +34 -0
  229. package/dist/types/components/MarkdownEditor/novel/components/editor-command.d.ts.map +1 -0
  230. package/dist/types/components/MarkdownEditor/novel/components/editor.d.ts +23 -0
  231. package/dist/types/components/MarkdownEditor/novel/components/editor.d.ts.map +1 -0
  232. package/dist/types/components/MarkdownEditor/novel/components/index.d.ts +8 -0
  233. package/dist/types/components/MarkdownEditor/novel/extensions/ai-highlight.d.ts +36 -0
  234. package/dist/types/components/MarkdownEditor/novel/extensions/ai-highlight.d.ts.map +1 -0
  235. package/dist/types/components/MarkdownEditor/novel/extensions/custom-keymap.d.ts +17 -0
  236. package/dist/types/components/MarkdownEditor/novel/extensions/custom-keymap.d.ts.map +1 -0
  237. package/dist/types/components/MarkdownEditor/novel/extensions/image-resizer.d.ts +7 -0
  238. package/dist/types/components/MarkdownEditor/novel/extensions/image-resizer.d.ts.map +1 -0
  239. package/dist/types/components/MarkdownEditor/novel/extensions/index.d.ts +30 -0
  240. package/dist/types/components/MarkdownEditor/novel/extensions/index.d.ts.map +1 -0
  241. package/dist/types/components/MarkdownEditor/novel/extensions/slash-command.d.ts +38 -0
  242. package/dist/types/components/MarkdownEditor/novel/extensions/slash-command.d.ts.map +1 -0
  243. package/dist/types/components/MarkdownEditor/novel/extensions/updated-image.d.ts +8 -0
  244. package/dist/types/components/MarkdownEditor/novel/extensions/updated-image.d.ts.map +1 -0
  245. package/dist/types/components/MarkdownEditor/novel/index.d.ts +16 -0
  246. package/dist/types/components/MarkdownEditor/novel/plugins/index.d.ts +2 -0
  247. package/dist/types/components/MarkdownEditor/novel/plugins/upload-images.d.ts +22 -0
  248. package/dist/types/components/MarkdownEditor/novel/plugins/upload-images.d.ts.map +1 -0
  249. package/dist/types/components/MarkdownEditor/novel/utils/atoms.d.ts +21 -0
  250. package/dist/types/components/MarkdownEditor/novel/utils/atoms.d.ts.map +1 -0
  251. package/dist/types/components/MarkdownEditor/novel/utils/index.d.ts +10 -0
  252. package/dist/types/components/MarkdownEditor/novel/utils/index.d.ts.map +1 -0
  253. package/dist/types/components/MarkdownEditor/selectors/ColorSelector.d.ts +17 -0
  254. package/dist/types/components/MarkdownEditor/selectors/ColorSelector.d.ts.map +1 -0
  255. package/dist/types/components/MarkdownEditor/selectors/LinkSelector.d.ts +15 -0
  256. package/dist/types/components/MarkdownEditor/selectors/LinkSelector.d.ts.map +1 -0
  257. package/dist/types/components/MarkdownEditor/selectors/NodeSelector.d.ts +22 -0
  258. package/dist/types/components/MarkdownEditor/selectors/NodeSelector.d.ts.map +1 -0
  259. package/dist/types/components/MarkdownEditor/selectors/TextButtons.d.ts +11 -0
  260. package/dist/types/components/MarkdownEditor/selectors/TextButtons.d.ts.map +1 -0
  261. package/dist/types/components/MarkdownEditor/slashCommand.d.ts +29 -0
  262. package/dist/types/components/MarkdownEditor/slashCommand.d.ts.map +1 -0
  263. package/dist/types/components/Pagination/Pagination.d.ts +1 -1
  264. package/dist/types/components/Pattern/GridDistortionPattern.d.ts +15 -0
  265. package/dist/types/components/Pattern/GridDistortionPattern.d.ts.map +1 -0
  266. package/dist/types/components/Pattern/index.d.ts +2 -1
  267. package/dist/types/components/SwitchSelector/SwitchSelector.d.ts +3 -3
  268. package/dist/types/components/SwitchSelector/VerticalSwitchSelector.d.ts +1 -1
  269. package/dist/types/components/SwitchSelector/useSwitchSelector.d.ts +10 -2
  270. package/dist/types/components/SwitchSelector/useSwitchSelector.d.ts.map +1 -1
  271. package/dist/types/components/TabSelector/TabSelector.d.ts +2 -2
  272. package/dist/types/components/Tag/index.d.ts +2 -2
  273. package/dist/types/components/Tag/index.d.ts.map +1 -1
  274. package/dist/types/components/index.d.ts +29 -8
  275. package/dist/types/hooks/index.d.ts +1 -1
  276. package/dist/types/routes.d.ts +2 -1
  277. package/dist/types/routes.d.ts.map +1 -1
  278. package/dist/types/utils/cn.d.ts +2 -7
  279. package/package.json +69 -39
  280. package/src/components/MarkdownEditor/markdown-editor.css +297 -0
  281. package/dist/esm/utils/cn.mjs.map +0 -1
  282. package/dist/types/utils/cn.d.ts.map +0 -1
@@ -1,23 +1,48 @@
1
1
  'use client';
2
2
 
3
+ import { useGetDictionaries } from "../../api/hooks/dictionary.mjs";
3
4
  import { Container } from "../Container/index.mjs";
4
5
  import { LocaleSwitcherContent } from "../LocaleSwitcherContentDropDown/LocaleSwitcherContent.mjs";
6
+ import { Pagination } from "../Pagination/Pagination.mjs";
5
7
  import { TextEditorContainer } from "./ContentEditorView/TextEditor.mjs";
6
8
  import { getIsEditableSection } from "./getIsEditableSection.mjs";
7
9
  import { KeyPathBreadcrumb } from "./KeyPathBreadcrumb.mjs";
8
10
  import { NavigationViewNode } from "./NavigationView/NavigationViewNode.mjs";
9
- import { useDeferredValue, useEffect, useTransition } from "react";
10
- import { jsx, jsxs } from "react/jsx-runtime";
11
11
  import { useEditedContent, useEditorLocale, useFocusUnmergedDictionary } from "@intlayer/editor-react";
12
+ import { useCallback, useDeferredValue, useEffect, useMemo, useState, useTransition } from "react";
13
+ import { jsx, jsxs } from "react/jsx-runtime";
14
+ import { useIntlayer } from "react-intlayer";
12
15
  import { getContentNodeByKeyPath } from "@intlayer/core/dictionaryManipulator";
13
16
 
14
17
  //#region src/components/DictionaryFieldEditor/ContentEditor.tsx
18
+ /** Render a variant (named string or structured object) for display. */
19
+ const formatVariant = (variant) => variant !== null && typeof variant === "object" ? JSON.stringify(variant) : variant ?? "";
15
20
  const ContentEditor = ({ dictionary, isDarkMode }) => {
16
- const { content, key, localId } = dictionary;
21
+ const { itemPagination, variantSwitcher } = useIntlayer("content-editor");
17
22
  const { editedContent } = useEditedContent();
18
23
  const { focusedContent, setFocusedContentKeyPath: _setFocusedContentKeyPath } = useFocusUnmergedDictionary();
19
24
  const [, startTransition] = useTransition();
20
25
  const setFocusedContentKeyPath = (keyPath) => startTransition(() => _setFocusedContentKeyPath(keyPath));
26
+ const [activeDictionary, setActiveDictionary] = useState(dictionary);
27
+ useEffect(() => {
28
+ setActiveDictionary(dictionary);
29
+ }, [dictionary]);
30
+ const hasQualifier = dictionary.item !== void 0 || dictionary.variant !== void 0;
31
+ const { data: siblingsData } = useGetDictionaries({ keys: [dictionary.key] }, { enabled: hasQualifier && !!dictionary.key });
32
+ const allSiblings = useMemo(() => siblingsData?.data ?? [], [siblingsData]);
33
+ const itemDicts = useMemo(() => {
34
+ if (dictionary.item === void 0) return [];
35
+ return allSiblings.filter((d) => d.item !== void 0).sort((a, b) => (a.item ?? 0) - (b.item ?? 0));
36
+ }, [dictionary, allSiblings]);
37
+ const variantDicts = useMemo(() => {
38
+ if (dictionary.variant === void 0) return [];
39
+ return allSiblings.filter((d) => d.variant !== void 0);
40
+ }, [dictionary, allSiblings]);
41
+ const switchSibling = useCallback((sibling) => {
42
+ setActiveDictionary(sibling);
43
+ setFocusedContentKeyPath([]);
44
+ }, [setFocusedContentKeyPath]);
45
+ const { content, key, localId } = activeDictionary;
21
46
  const focusedKeyPath = focusedContent?.keyPath;
22
47
  const section = typeof editedContent?.[localId]?.content === "undefined" ? content : editedContent?.[localId]?.content;
23
48
  const currentLocale = useEditorLocale();
@@ -30,39 +55,83 @@ const ContentEditor = ({ dictionary, isDarkMode }) => {
30
55
  useEffect(() => {
31
56
  if (typeof focusedSection === "undefined") setFocusedContentKeyPath(focusedContent?.keyPath?.slice(0, -1) ?? []);
32
57
  }, []);
33
- return /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsxs("div", {
34
- className: "mb-6 flex items-center justify-between gap-2",
35
- children: [/* @__PURE__ */ jsx(KeyPathBreadcrumb, {
36
- dictionaryKey: key,
37
- keyPath: focusedKeyPath ?? [],
38
- onClickKeyPath: setFocusedContentKeyPath
39
- }), /* @__PURE__ */ jsx("div", {
40
- className: "flex items-center gap-2",
41
- children: /* @__PURE__ */ jsx(LocaleSwitcherContent, {})
42
- })]
43
- }), /* @__PURE__ */ jsxs("div", {
44
- className: "flex flex-1 gap-2 overflow-visible max-md:flex-col",
45
- children: [typeof section === "object" && section && !isEditableBaseSection && Object.keys(section).length > 0 && /* @__PURE__ */ jsx(Container, {
46
- border: true,
47
- background: "none",
48
- className: "top-10 flex h-full flex-col items-start gap-0.5 overflow-auto p-2 md:sticky md:max-w-[50%]",
49
- roundedSize: "2xl",
50
- transparency: "xs",
51
- children: /* @__PURE__ */ jsx(NavigationViewNode, {
52
- keyPath: [],
53
- section,
54
- dictionary
55
- })
56
- }), (isEditableFocusedSection || (deferredKeyPath ?? []).length > 0) && /* @__PURE__ */ jsx("div", {
57
- className: isStale ? "pointer-events-none flex-1 opacity-50 transition-opacity" : "flex-1 transition-opacity",
58
- children: /* @__PURE__ */ jsx(TextEditorContainer, {
59
- keyPath: deferredKeyPath ?? [],
60
- section: deferredSection,
61
- dictionary,
62
- isDarkMode
63
- })
64
- })]
65
- })] });
58
+ const currentItemIndex = itemDicts.findIndex((dictionary) => dictionary.localId === activeDictionary.localId);
59
+ const currentVariant = activeDictionary.variant;
60
+ return /* @__PURE__ */ jsxs("div", { children: [
61
+ hasQualifier && /* @__PURE__ */ jsxs("div", {
62
+ className: "mb-4 flex flex-wrap items-center gap-4",
63
+ children: [itemDicts.length > 0 && /* @__PURE__ */ jsxs("div", {
64
+ className: "flex items-center gap-2",
65
+ children: [/* @__PURE__ */ jsx("span", {
66
+ className: "font-medium text-muted text-xs",
67
+ children: itemPagination.label
68
+ }), /* @__PURE__ */ jsx(Pagination, {
69
+ currentPage: currentItemIndex >= 0 ? currentItemIndex + 1 : 1,
70
+ totalPages: itemDicts.length,
71
+ onPageChange: (page) => {
72
+ const target = itemDicts[page - 1];
73
+ if (target) switchSibling(target);
74
+ },
75
+ size: "sm"
76
+ })]
77
+ }), variantDicts.length > 0 && /* @__PURE__ */ jsxs("div", {
78
+ className: "flex flex-wrap items-center gap-2",
79
+ children: [
80
+ /* @__PURE__ */ jsxs("span", {
81
+ className: "font-medium text-muted text-xs",
82
+ children: [variantSwitcher.label, ":"]
83
+ }),
84
+ variantDicts.map((sibling) => {
85
+ const isActive = sibling.localId === activeDictionary.localId;
86
+ return /* @__PURE__ */ jsx("button", {
87
+ type: "button",
88
+ onClick: () => !isActive && switchSibling(sibling),
89
+ className: `rounded-lg px-3 py-1 text-xs transition-colors ${isActive ? "bg-text font-semibold text-text-opposite" : "cursor-pointer border border-border hover:bg-text/10"}`,
90
+ children: formatVariant(sibling.variant)
91
+ }, sibling.localId);
92
+ }),
93
+ currentVariant !== void 0 && !variantDicts.some((d) => d.localId === dictionary.localId) && /* @__PURE__ */ jsx("span", {
94
+ className: "rounded-lg bg-text px-3 py-1 font-semibold text-text-opposite text-xs",
95
+ children: formatVariant(currentVariant)
96
+ })
97
+ ]
98
+ })]
99
+ }),
100
+ /* @__PURE__ */ jsxs("div", {
101
+ className: "mb-6 flex items-center justify-between gap-2",
102
+ children: [/* @__PURE__ */ jsx(KeyPathBreadcrumb, {
103
+ dictionaryKey: key,
104
+ keyPath: focusedKeyPath ?? [],
105
+ onClickKeyPath: setFocusedContentKeyPath
106
+ }), /* @__PURE__ */ jsx("div", {
107
+ className: "flex items-center gap-2",
108
+ children: /* @__PURE__ */ jsx(LocaleSwitcherContent, {})
109
+ })]
110
+ }),
111
+ /* @__PURE__ */ jsxs("div", {
112
+ className: "flex flex-1 gap-2 overflow-visible max-md:flex-col",
113
+ children: [typeof section === "object" && section && !isEditableBaseSection && Object.keys(section).length > 0 && /* @__PURE__ */ jsx(Container, {
114
+ border: true,
115
+ background: "none",
116
+ className: "top-10 flex h-full flex-col items-start gap-0.5 overflow-auto p-2 md:sticky md:max-w-[50%]",
117
+ roundedSize: "2xl",
118
+ transparency: "xs",
119
+ children: /* @__PURE__ */ jsx(NavigationViewNode, {
120
+ keyPath: [],
121
+ section,
122
+ dictionary: activeDictionary
123
+ })
124
+ }), (isEditableFocusedSection || (deferredKeyPath ?? []).length > 0) && /* @__PURE__ */ jsx("div", {
125
+ className: isStale ? "pointer-events-none flex-1 opacity-50 transition-opacity" : "flex-1 transition-opacity",
126
+ children: /* @__PURE__ */ jsx(TextEditorContainer, {
127
+ keyPath: deferredKeyPath ?? [],
128
+ section: deferredSection,
129
+ dictionary: activeDictionary,
130
+ isDarkMode
131
+ })
132
+ })]
133
+ })
134
+ ] });
66
135
  };
67
136
 
68
137
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"ContentEditor.mjs","names":[],"sources":["../../../../src/components/DictionaryFieldEditor/ContentEditor.tsx"],"sourcesContent":["'use client';\n\nimport { getContentNodeByKeyPath } from '@intlayer/core/dictionaryManipulator';\nimport {\n useEditedContent,\n useEditorLocale,\n useFocusUnmergedDictionary,\n} from '@intlayer/editor-react';\nimport type { Dictionary, LocalDictionaryId } from '@intlayer/types/dictionary';\nimport { type FC, useDeferredValue, useEffect, useTransition } from 'react';\nimport { Container } from '../Container';\nimport { LocaleSwitcherContent } from '../LocaleSwitcherContentDropDown';\nimport { TextEditorContainer } from './ContentEditorView/TextEditor';\nimport { getIsEditableSection } from './getIsEditableSection';\nimport { KeyPathBreadcrumb } from './KeyPathBreadcrumb';\nimport { NavigationViewNode } from './NavigationView/NavigationViewNode';\n\ntype NodeEditorProps = {\n dictionary: Dictionary;\n isDarkMode?: boolean;\n};\n\nexport const ContentEditor: FC<NodeEditorProps> = ({\n dictionary,\n isDarkMode,\n}) => {\n const { content, key, localId } = dictionary;\n const { editedContent } = useEditedContent();\n const {\n focusedContent,\n setFocusedContentKeyPath: _setFocusedContentKeyPath,\n } = useFocusUnmergedDictionary();\n const [, startTransition] = useTransition();\n const setFocusedContentKeyPath: typeof _setFocusedContentKeyPath = (\n keyPath\n ) => startTransition(() => _setFocusedContentKeyPath(keyPath));\n\n const focusedKeyPath = focusedContent?.keyPath;\n const section =\n typeof editedContent?.[localId as LocalDictionaryId]?.content ===\n 'undefined'\n ? content\n : editedContent?.[localId as LocalDictionaryId]?.content;\n\n const currentLocale = useEditorLocale();\n const focusedSection = getContentNodeByKeyPath(\n section,\n focusedKeyPath ?? [],\n currentLocale\n );\n\n // Defer the expensive right-panel render so navigation clicks feel instant.\n // The stale section stays visible while React computes the new one in background.\n const deferredKeyPath = useDeferredValue(focusedKeyPath);\n const deferredSection = useDeferredValue(focusedSection);\n const isStale = deferredSection !== focusedSection;\n\n const isEditableBaseSection = getIsEditableSection(section);\n const isEditableFocusedSection = getIsEditableSection(deferredSection);\n\n useEffect(() => {\n if (typeof focusedSection === 'undefined') {\n setFocusedContentKeyPath(focusedContent?.keyPath?.slice(0, -1) ?? []);\n }\n }, []);\n\n return (\n <div>\n <div className=\"mb-6 flex items-center justify-between gap-2\">\n <KeyPathBreadcrumb\n dictionaryKey={key}\n keyPath={focusedKeyPath ?? []}\n onClickKeyPath={setFocusedContentKeyPath}\n />\n <div className=\"flex items-center gap-2\">\n <LocaleSwitcherContent />\n </div>\n </div>\n <div className=\"flex flex-1 gap-2 overflow-visible max-md:flex-col\">\n {typeof section === 'object' &&\n section &&\n !isEditableBaseSection &&\n Object.keys(section).length > 0 && (\n <Container\n border\n background=\"none\"\n className=\"top-10 flex h-full flex-col items-start gap-0.5 overflow-auto p-2 md:sticky md:max-w-[50%]\"\n roundedSize=\"2xl\"\n transparency=\"xs\"\n >\n <NavigationViewNode\n keyPath={[]}\n section={section}\n dictionary={dictionary}\n />\n </Container>\n )}\n {(isEditableFocusedSection || (deferredKeyPath ?? []).length > 0) && (\n <div\n className={\n isStale\n ? 'pointer-events-none flex-1 opacity-50 transition-opacity'\n : 'flex-1 transition-opacity'\n }\n >\n <TextEditorContainer\n keyPath={deferredKeyPath ?? []}\n section={deferredSection}\n dictionary={dictionary}\n isDarkMode={isDarkMode}\n />\n </div>\n )}\n </div>\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;AAsBA,MAAa,iBAAsC,EACjD,YACA,iBACI;CACJ,MAAM,EAAE,SAAS,KAAK,YAAY;CAClC,MAAM,EAAE,kBAAkB,kBAAkB;CAC5C,MAAM,EACJ,gBACA,0BAA0B,8BACxB,4BAA4B;CAChC,MAAM,GAAG,mBAAmB,eAAe;CAC3C,MAAM,4BACJ,YACG,sBAAsB,0BAA0B,QAAQ,CAAC;CAE9D,MAAM,iBAAiB,gBAAgB;CACvC,MAAM,UACJ,OAAO,gBAAgB,UAA+B,YACtD,cACI,UACA,gBAAgB,UAA+B;CAErD,MAAM,gBAAgB,iBAAiB;CACvC,MAAM,iBAAiB,wBACrB,SACA,kBAAkB,EAAE,EACpB,cACD;CAID,MAAM,kBAAkB,iBAAiB,eAAe;CACxD,MAAM,kBAAkB,iBAAiB,eAAe;CACxD,MAAM,UAAU,oBAAoB;CAEpC,MAAM,wBAAwB,qBAAqB,QAAQ;CAC3D,MAAM,2BAA2B,qBAAqB,gBAAgB;AAEtE,iBAAgB;AACd,MAAI,OAAO,mBAAmB,YAC5B,0BAAyB,gBAAgB,SAAS,MAAM,GAAG,GAAG,IAAI,EAAE,CAAC;IAEtE,EAAE,CAAC;AAEN,QACE,qBAAC,OAAD,aACE,qBAAC,OAAD;EAAK,WAAU;YAAf,CACE,oBAAC,mBAAD;GACE,eAAe;GACf,SAAS,kBAAkB,EAAE;GAC7B,gBAAgB;GAChB,GACF,oBAAC,OAAD;GAAK,WAAU;aACb,oBAAC,uBAAD,EAAyB;GACrB,EACF;KACN,qBAAC,OAAD;EAAK,WAAU;YAAf,CACG,OAAO,YAAY,YAClB,WACA,CAAC,yBACD,OAAO,KAAK,QAAQ,CAAC,SAAS,KAC5B,oBAAC,WAAD;GACE;GACA,YAAW;GACX,WAAU;GACV,aAAY;GACZ,cAAa;aAEb,oBAAC,oBAAD;IACE,SAAS,EAAE;IACF;IACG;IACZ;GACQ,IAEd,6BAA6B,mBAAmB,EAAE,EAAE,SAAS,MAC7D,oBAAC,OAAD;GACE,WACE,UACI,6DACA;aAGN,oBAAC,qBAAD;IACE,SAAS,mBAAmB,EAAE;IAC9B,SAAS;IACG;IACA;IACZ;GACE,EAEJ;IACF"}
1
+ {"version":3,"file":"ContentEditor.mjs","names":[],"sources":["../../../../src/components/DictionaryFieldEditor/ContentEditor.tsx"],"sourcesContent":["'use client';\n\nimport { useGetDictionaries } from '@api/index';\nimport { getContentNodeByKeyPath } from '@intlayer/core/dictionaryManipulator';\nimport {\n useEditedContent,\n useEditorLocale,\n useFocusUnmergedDictionary,\n} from '@intlayer/editor-react';\nimport type { Dictionary, LocalDictionaryId } from '@intlayer/types/dictionary';\nimport {\n type FC,\n useCallback,\n useDeferredValue,\n useEffect,\n useMemo,\n useState,\n useTransition,\n} from 'react';\nimport { useIntlayer } from 'react-intlayer';\nimport { Container } from '../Container';\nimport { LocaleSwitcherContent } from '../LocaleSwitcherContentDropDown';\nimport { Pagination } from '../Pagination';\nimport { TextEditorContainer } from './ContentEditorView/TextEditor';\nimport { getIsEditableSection } from './getIsEditableSection';\nimport { KeyPathBreadcrumb } from './KeyPathBreadcrumb';\nimport { NavigationViewNode } from './NavigationView/NavigationViewNode';\n\ntype NodeEditorProps = {\n dictionary: Dictionary;\n isDarkMode?: boolean;\n};\n\n/** Render a variant (named string or structured object) for display. */\nconst formatVariant = (\n variant: string | Record<string, string | number> | undefined\n): string =>\n variant !== null && typeof variant === 'object'\n ? JSON.stringify(variant)\n : (variant ?? '');\n\nexport const ContentEditor: FC<NodeEditorProps> = ({\n dictionary,\n isDarkMode,\n}) => {\n const { itemPagination, variantSwitcher } = useIntlayer('content-editor');\n const { editedContent } = useEditedContent();\n const {\n focusedContent,\n setFocusedContentKeyPath: _setFocusedContentKeyPath,\n } = useFocusUnmergedDictionary();\n const [, startTransition] = useTransition();\n const setFocusedContentKeyPath: typeof _setFocusedContentKeyPath = (\n keyPath\n ) => startTransition(() => _setFocusedContentKeyPath(keyPath));\n\n const [activeDictionary, setActiveDictionary] =\n useState<Dictionary>(dictionary);\n\n // Re-sync the locally tracked dictionary whenever the incoming prop changes\n // identity — not only when its `localId` changes. After a save, the query\n // refetches and hands back the same `localId` with fresh content; keying the\n // effect on `localId` alone left `activeDictionary` (the render source) stale\n // until a full page reload. The prop reference is stable across unrelated\n // re-renders (query data / store entry), so sibling switches made via\n // `switchSibling` are preserved.\n useEffect(() => {\n setActiveDictionary(dictionary);\n }, [dictionary]);\n\n const hasQualifier =\n dictionary.item !== undefined || dictionary.variant !== undefined;\n\n const { data: siblingsData } = useGetDictionaries(\n { keys: [dictionary.key] },\n { enabled: hasQualifier && !!dictionary.key }\n );\n\n const allSiblings = useMemo<Dictionary[]>(\n () => (siblingsData?.data ?? []) as unknown as Dictionary[],\n [siblingsData]\n );\n\n const itemDicts = useMemo<Dictionary[]>(() => {\n if (dictionary.item === undefined) return [];\n return allSiblings\n .filter((d) => d.item !== undefined)\n .sort((a, b) => (a.item ?? 0) - (b.item ?? 0));\n }, [dictionary, allSiblings]);\n\n const variantDicts = useMemo<Dictionary[]>(() => {\n if (dictionary.variant === undefined) return [];\n return allSiblings.filter((d) => d.variant !== undefined);\n }, [dictionary, allSiblings]);\n\n const switchSibling = useCallback(\n (sibling: Dictionary) => {\n setActiveDictionary(sibling);\n setFocusedContentKeyPath([]);\n },\n [setFocusedContentKeyPath]\n );\n\n const { content, key, localId } = activeDictionary;\n const focusedKeyPath = focusedContent?.keyPath;\n const section =\n typeof editedContent?.[localId as LocalDictionaryId]?.content ===\n 'undefined'\n ? content\n : editedContent?.[localId as LocalDictionaryId]?.content;\n\n const currentLocale = useEditorLocale();\n const focusedSection = getContentNodeByKeyPath(\n section,\n focusedKeyPath ?? [],\n currentLocale\n );\n\n const deferredKeyPath = useDeferredValue(focusedKeyPath);\n const deferredSection = useDeferredValue(focusedSection);\n const isStale = deferredSection !== focusedSection;\n\n const isEditableBaseSection = getIsEditableSection(section);\n const isEditableFocusedSection = getIsEditableSection(deferredSection);\n\n useEffect(() => {\n if (typeof focusedSection === 'undefined') {\n setFocusedContentKeyPath(focusedContent?.keyPath?.slice(0, -1) ?? []);\n }\n }, []);\n\n const currentItemIndex = itemDicts.findIndex(\n (dictionary) => dictionary.localId === activeDictionary.localId\n );\n const currentVariant = activeDictionary.variant;\n\n return (\n <div>\n {/* Qualifier navigation controls */}\n {hasQualifier && (\n <div className=\"mb-4 flex flex-wrap items-center gap-4\">\n {itemDicts.length > 0 && (\n <div className=\"flex items-center gap-2\">\n <span className=\"font-medium text-muted text-xs\">\n {itemPagination.label}\n </span>\n <Pagination\n currentPage={currentItemIndex >= 0 ? currentItemIndex + 1 : 1}\n totalPages={itemDicts.length}\n onPageChange={(page) => {\n const target = itemDicts[page - 1];\n if (target) switchSibling(target);\n }}\n size=\"sm\"\n />\n </div>\n )}\n\n {variantDicts.length > 0 && (\n <div className=\"flex flex-wrap items-center gap-2\">\n <span className=\"font-medium text-muted text-xs\">\n {variantSwitcher.label}:\n </span>\n {variantDicts.map((sibling) => {\n const isActive = sibling.localId === activeDictionary.localId;\n return (\n <button\n key={sibling.localId}\n type=\"button\"\n onClick={() => !isActive && switchSibling(sibling)}\n className={`rounded-lg px-3 py-1 text-xs transition-colors ${\n isActive\n ? 'bg-text font-semibold text-text-opposite'\n : 'cursor-pointer border border-border hover:bg-text/10'\n }`}\n >\n {formatVariant(sibling.variant)}\n </button>\n );\n })}\n {currentVariant !== undefined &&\n !variantDicts.some((d) => d.localId === dictionary.localId) && (\n <span className=\"rounded-lg bg-text px-3 py-1 font-semibold text-text-opposite text-xs\">\n {formatVariant(currentVariant)}\n </span>\n )}\n </div>\n )}\n </div>\n )}\n\n <div className=\"mb-6 flex items-center justify-between gap-2\">\n <KeyPathBreadcrumb\n dictionaryKey={key}\n keyPath={focusedKeyPath ?? []}\n onClickKeyPath={setFocusedContentKeyPath}\n />\n <div className=\"flex items-center gap-2\">\n <LocaleSwitcherContent />\n </div>\n </div>\n <div className=\"flex flex-1 gap-2 overflow-visible max-md:flex-col\">\n {typeof section === 'object' &&\n section &&\n !isEditableBaseSection &&\n Object.keys(section).length > 0 && (\n <Container\n border\n background=\"none\"\n className=\"top-10 flex h-full flex-col items-start gap-0.5 overflow-auto p-2 md:sticky md:max-w-[50%]\"\n roundedSize=\"2xl\"\n transparency=\"xs\"\n >\n <NavigationViewNode\n keyPath={[]}\n section={section}\n dictionary={activeDictionary}\n />\n </Container>\n )}\n {(isEditableFocusedSection || (deferredKeyPath ?? []).length > 0) && (\n <div\n className={\n isStale\n ? 'pointer-events-none flex-1 opacity-50 transition-opacity'\n : 'flex-1 transition-opacity'\n }\n >\n <TextEditorContainer\n keyPath={deferredKeyPath ?? []}\n section={deferredSection}\n dictionary={activeDictionary}\n isDarkMode={isDarkMode}\n />\n </div>\n )}\n </div>\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAkCA,MAAM,iBACJ,YAEA,YAAY,QAAQ,OAAO,YAAY,WACnC,KAAK,UAAU,QAAQ,GACtB,WAAW;AAElB,MAAa,iBAAsC,EACjD,YACA,iBACI;CACJ,MAAM,EAAE,gBAAgB,oBAAoB,YAAY,iBAAiB;CACzE,MAAM,EAAE,kBAAkB,kBAAkB;CAC5C,MAAM,EACJ,gBACA,0BAA0B,8BACxB,4BAA4B;CAChC,MAAM,GAAG,mBAAmB,eAAe;CAC3C,MAAM,4BACJ,YACG,sBAAsB,0BAA0B,QAAQ,CAAC;CAE9D,MAAM,CAAC,kBAAkB,uBACvB,SAAqB,WAAW;AASlC,iBAAgB;AACd,sBAAoB,WAAW;IAC9B,CAAC,WAAW,CAAC;CAEhB,MAAM,eACJ,WAAW,SAAS,UAAa,WAAW,YAAY;CAE1D,MAAM,EAAE,MAAM,iBAAiB,mBAC7B,EAAE,MAAM,CAAC,WAAW,IAAI,EAAE,EAC1B,EAAE,SAAS,gBAAgB,CAAC,CAAC,WAAW,KAAK,CAC9C;CAED,MAAM,cAAc,cACX,cAAc,QAAQ,EAAE,EAC/B,CAAC,aAAa,CACf;CAED,MAAM,YAAY,cAA4B;AAC5C,MAAI,WAAW,SAAS,OAAW,QAAO,EAAE;AAC5C,SAAO,YACJ,QAAQ,MAAM,EAAE,SAAS,OAAU,CACnC,MAAM,GAAG,OAAO,EAAE,QAAQ,MAAM,EAAE,QAAQ,GAAG;IAC/C,CAAC,YAAY,YAAY,CA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aAAa,SAAS,KACrB,qBAAC,OAAD;IAAK,WAAU;cAAf;KACE,qBAAC,QAAD;MAAM,WAAU;gBAAhB,CACG,gBAAgB,OAAM,IAClB;;KACN,aAAa,KAAK,YAAY;MAC7B,MAAM,WAAW,QAAQ,YAAY,iBAAiB;AACtD,aACE,oBAAC,UAAD;OAEE,MAAK;OACL,eAAe,CAAC,YAAY,cAAc,QAAQ;OAClD,WAAW,kDACT,WACI,6CACA;iBAGL,cAAc,QAAQ,QAAQ;OACxB,EAVF,QAAQ,QAUN;OAEX;KACD,mBAAmB,UAClB,CAAC,aAAa,MAAM,MAAM,EAAE,YAAY,WAAW,QAAQ,IACzD,oBAAC,QAAD;MAAM,WAAU;gBACb,cAAc,eAAe;MACzB;KAEP;MAEJ;;EAGR,qBAAC,OAAD;GAAK,WAAU;aAAf,CACE,oBAAC,mBAAD;IACE,eAAe;IACf,SAAS,kBAAkB,EAAE;IAC7B,gBAAgB;IAChB,GACF,oBAAC,OAAD;IAAK,WAAU;cACb,oBAAC,uBAAD,EAAyB;IACrB,EACF;;EACN,qBAAC,OAAD;GAAK,WAAU;aAAf,CACG,OAAO,YAAY,YAClB,WACA,CAAC,yBACD,OAAO,KAAK,QAAQ,CAAC,SAAS,KAC5B,oBAAC,WAAD;IACE;IACA,YAAW;IACX,WAAU;IACV,aAAY;IACZ,cAAa;cAEb,oBAAC,oBAAD;KACE,SAAS,EAAE;KACF;KACT,YAAY;KACZ;IACQ,IAEd,6BAA6B,mBAAmB,EAAE,EAAE,SAAS,MAC7D,oBAAC,OAAD;IACE,WACE,UACI,6DACA;cAGN,oBAAC,qBAAD;KACE,SAAS,mBAAmB,EAAE;KAC9B,SAAS;KACT,YAAY;KACA;KACZ;IACE,EAEJ;;EACF"}
@@ -13,10 +13,10 @@ import { renameKey } from "./object.mjs";
13
13
  import { Label } from "../../Label/index.mjs";
14
14
  import { EnumKeyInput } from "../EnumKeyInput.mjs";
15
15
  import { SafeHtmlRenderer } from "./SafeHtmlRenderer.mjs";
16
+ import { useConfiguration, useEditedContent } from "@intlayer/editor-react";
16
17
  import { Fragment, Suspense, lazy, memo, useState } from "react";
17
18
  import { Plus, Trash, WandSparkles } from "lucide-react";
18
19
  import { jsx, jsxs } from "react/jsx-runtime";
19
- import { useConfiguration, useEditedContent } from "@intlayer/editor-react";
20
20
  import { useIntlayer, useLocale } from "react-intlayer";
21
21
  import { getLocaleName } from "@intlayer/core/localization";
22
22
  import { getEmptyNode, getNodeType } from "@intlayer/core/dictionaryManipulator";
@@ -25,6 +25,7 @@ import { camelCaseToSentence } from "@intlayer/config/client";
25
25
 
26
26
  //#region src/components/DictionaryFieldEditor/ContentEditorView/TextEditor.tsx
27
27
  const LazyMarkdownRenderer = lazy(() => import("../../MarkDownRender/index.mjs").then((m) => ({ default: m.MarkdownRenderer })));
28
+ const LazyMarkdownEditor = lazy(() => import("../../MarkdownEditor/index.mjs").then((m) => ({ default: m.MarkdownEditor })));
28
29
  const CollapsibleEditor = memo(function CollapsibleEditor({ label, ...editorProps }) {
29
30
  const [hasOpened, setHasOpened] = useState(false);
30
31
  return /* @__PURE__ */ jsx(Accordion, {
@@ -498,13 +499,21 @@ const HtmlTextEditor = ({ section, keyPath, dictionary }) => {
498
499
  };
499
500
  const MarkdownTextEditor = ({ section, keyPath, dictionary, isDarkMode }) => {
500
501
  const [mode, setMode] = useState(0);
501
- const toggleContent = [{
502
- content: "Edit",
503
- value: 0
504
- }, {
505
- content: "Preview",
506
- value: 1
507
- }];
502
+ const { addEditedContent } = useEditedContent();
503
+ const toggleContent = [
504
+ {
505
+ content: "Edit",
506
+ value: 0
507
+ },
508
+ {
509
+ content: "Raw",
510
+ value: 1
511
+ },
512
+ {
513
+ content: "Preview",
514
+ value: 2
515
+ }
516
+ ];
508
517
  const childKeyPath = [...keyPath, { type: NodeTypes.MARKDOWN }];
509
518
  const content = section[NodeTypes.MARKDOWN] ?? "";
510
519
  return /* @__PURE__ */ jsxs("div", {
@@ -516,11 +525,24 @@ const MarkdownTextEditor = ({ section, keyPath, dictionary, isDarkMode }) => {
516
525
  color: "text",
517
526
  size: "sm",
518
527
  className: "ml-auto"
519
- }), /* @__PURE__ */ jsx(TextEditorContainer, {
528
+ }), mode === 0 && typeof content === "string" ? /* @__PURE__ */ jsx(Container, {
529
+ border: true,
530
+ background: "none",
531
+ roundedSize: "2xl",
532
+ padding: "lg",
533
+ className: "w-full",
534
+ children: /* @__PURE__ */ jsx(Suspense, {
535
+ fallback: /* @__PURE__ */ jsx(Loader, {}),
536
+ children: /* @__PURE__ */ jsx(LazyMarkdownEditor, {
537
+ defaultValue: content,
538
+ onChange: (markdown) => addEditedContent(dictionary.localId, markdown, childKeyPath)
539
+ }, JSON.stringify(childKeyPath))
540
+ })
541
+ }) : /* @__PURE__ */ jsx(TextEditorContainer, {
520
542
  section: content,
521
543
  keyPath: childKeyPath,
522
544
  dictionary,
523
- renderSection: mode === 1 ? (content) => /* @__PURE__ */ jsx(Suspense, {
545
+ renderSection: mode === 2 ? (content) => /* @__PURE__ */ jsx(Suspense, {
524
546
  fallback: /* @__PURE__ */ jsx(Loader, {}),
525
547
  children: /* @__PURE__ */ jsx(LazyMarkdownRenderer, {
526
548
  isDarkMode,
@@ -1 +1 @@
1
- {"version":3,"file":"TextEditor.mjs","names":["ContentEditorTextAreaBase","ContentEditorInputBase"],"sources":["../../../../../src/components/DictionaryFieldEditor/ContentEditorView/TextEditor.tsx"],"sourcesContent":["'use client';\n\nimport { useAuditContentDeclarationField } from '@api/index';\nimport { Accordion } from '@components/Accordion';\nimport { Button } from '@components/Button';\nimport { Container } from '@components/Container';\nimport {\n ContentEditorInput as ContentEditorInputBase,\n type ContentEditorInputProps as ContentEditorInputPropsBase,\n} from '@components/ContentEditor/ContentEditorInput';\nimport {\n ContentEditorTextArea as ContentEditorTextAreaBase,\n type ContentEditorTextAreaProps as ContentEditorTextAreaPropsBase,\n} from '@components/ContentEditor/ContentEditorTextArea';\nimport { renameKey } from '@components/DictionaryFieldEditor/ContentEditorView/object';\nimport { Label } from '@components/Label';\nimport { Loader } from '@components/Loader';\nimport { useLocaleSwitcherContent } from '@components/LocaleSwitcherContentDropDown';\nimport {\n SwitchSelector,\n type SwitchSelectorChoices,\n type SwitchSelectorProps,\n} from '@components/SwitchSelector';\nimport { camelCaseToSentence } from '@intlayer/config/client';\nimport {\n getEmptyNode,\n getNodeType,\n} from '@intlayer/core/dictionaryManipulator';\nimport { getLocaleName } from '@intlayer/core/localization';\nimport type {\n ConditionContent,\n EnumerationContent,\n FileContent,\n GenderContent,\n HTMLContent,\n InsertionContent,\n MarkdownContent,\n PluralContent,\n TranslationContent,\n} from '@intlayer/core/transpiler';\nimport { useConfiguration, useEditedContent } from '@intlayer/editor-react';\nimport type { ContentNode, Dictionary } from '@intlayer/types/dictionary';\nimport type { KeyPath } from '@intlayer/types/keyPath';\nimport * as NodeTypes from '@intlayer/types/nodeType';\nimport { Plus, Trash, WandSparkles } from 'lucide-react';\nimport {\n type FC,\n Fragment,\n lazy,\n memo,\n type ReactNode,\n Suspense,\n useState,\n} from 'react';\nimport { useIntlayer, useLocale } from 'react-intlayer';\nimport { EnumKeyInput } from '../EnumKeyInput';\nimport { SafeHtmlRenderer } from './SafeHtmlRenderer';\n\nconst LazyMarkdownRenderer = lazy(() =>\n import('@components/MarkDownRender').then((m) => ({\n default: m.MarkdownRenderer,\n }))\n);\n\n// Renders children only after the accordion is first opened (mount-once pattern).\n// Prevents deeply nested sub-trees from mounting on initial render.\ntype CollapsibleEditorProps = TextEditorProps & { label: string };\nconst CollapsibleEditor = memo<CollapsibleEditorProps>(\n function CollapsibleEditor({ label, ...editorProps }) {\n const [hasOpened, setHasOpened] = useState(false);\n return (\n <Accordion\n header={label}\n label={label}\n onToggle={(isOpen) => {\n if (isOpen && !hasOpened) setHasOpened(true);\n }}\n >\n {hasOpened ? <TextEditor {...editorProps} /> : null}\n </Accordion>\n );\n }\n);\n\nexport const traceKeys: string[] = ['filePath', 'id', 'nodeType'];\n\ntype ContentEditorTextAreaProps = Omit<\n ContentEditorTextAreaPropsBase,\n 'onContentChange'\n> & {\n keyPath: KeyPath[];\n dictionary: Dictionary;\n};\n\nconst ContentEditorTextArea: FC<ContentEditorTextAreaProps> = ({\n keyPath,\n dictionary,\n ...props\n}) => {\n const { editedContent, addEditedContent } = useEditedContent();\n const configuration = useConfiguration();\n const { mutate: auditContentDeclarationField, isPending: isAuditing } =\n useAuditContentDeclarationField();\n\n return (\n <ContentEditorTextAreaBase\n variant=\"default\"\n onContentChange={(newValue) =>\n addEditedContent(dictionary.localId!, newValue, keyPath)\n }\n additionalButtons={\n <Button\n Icon={WandSparkles}\n label=\"Audit\"\n variant=\"hoverable\"\n size=\"icon-sm\"\n color=\"text\"\n className=\"cursor-pointer hover:scale-110\"\n isLoading={isAuditing}\n onClick={() => {\n auditContentDeclarationField(\n {\n fileContent: JSON.stringify({\n ...dictionary,\n ...(editedContent?.[dictionary.localId!] ?? {}),\n }),\n keyPath,\n locales: configuration?.internationalization.locales ?? [],\n aiOptions: {\n apiKey: configuration?.ai?.apiKey,\n model: configuration?.ai?.model,\n temperature: configuration?.ai?.temperature,\n },\n },\n {\n onSuccess: (response) => {\n if (!response?.data) return;\n\n try {\n const editedContent = response.data.fileContent as string;\n\n addEditedContent(\n dictionary.localId!,\n editedContent,\n keyPath\n );\n } catch (error) {\n console.error(error);\n }\n },\n }\n );\n }}\n />\n }\n {...props}\n />\n );\n};\n\ntype ContentEditorInputProps = Omit<\n ContentEditorInputPropsBase,\n 'onContentChange'\n> & {\n keyPath: KeyPath[];\n dictionary: Dictionary;\n};\n\nconst ContentEditorInput: FC<ContentEditorInputProps> = ({\n keyPath,\n dictionary,\n ...props\n}) => {\n const { addEditedContent } = useEditedContent();\n\n return (\n <ContentEditorInputBase\n variant=\"default\"\n onContentChange={(newValue) =>\n addEditedContent(dictionary.localId!, newValue, keyPath)\n }\n {...props}\n />\n );\n};\n\nconst toggleContent = [\n {\n content: 'False',\n value: false,\n },\n {\n content: 'True',\n value: true,\n },\n] as SwitchSelectorChoices<boolean>;\n\ntype ContentEditorToggleProps = SwitchSelectorProps & {\n dictionary: Dictionary;\n keyPath: KeyPath[];\n};\n\nconst ContentEditorToggle: FC<ContentEditorToggleProps> = ({\n dictionary,\n keyPath,\n ...props\n}) => {\n const { addEditedContent } = useEditedContent();\n\n return (\n <SwitchSelector\n choices={toggleContent}\n value={true}\n onChange={(value) =>\n addEditedContent(dictionary.localId!, value, keyPath)\n }\n color=\"text\"\n size=\"sm\"\n {...props}\n />\n );\n};\n\nexport type TextEditorProps = {\n dictionary: Dictionary;\n keyPath: KeyPath[];\n section: ContentNode;\n isDarkMode?: boolean;\n renderSection?: (content: string) => ReactNode;\n onContentChange?: (newValue: string) => void;\n};\n\nconst TranslationTextEditor: FC<TextEditorProps> = ({\n section,\n keyPath,\n dictionary,\n renderSection,\n}: TextEditorProps) => {\n const { locale, defaultLocale } = useLocale();\n const { selectedLocales } = useLocaleSwitcherContent();\n\n const content: any = (section as TranslationContent<string>)[\n NodeTypes.TRANSLATION\n ];\n\n return (\n <table className=\"w-full\">\n <tbody className=\"flex w-full flex-col gap-2\">\n {selectedLocales.map((translationKey) => {\n const uniqueKey = `${JSON.stringify(keyPath)}-translation-${translationKey}`;\n return (\n <Fragment key={uniqueKey}>\n <tr className=\"mt-2 w-full p-2 text-xs\">\n <td className=\"flex w-full\">\n {getLocaleName(translationKey, locale)}\n </td>\n </tr>\n <tr className=\"flex\">\n <td className=\"flex w-full\">\n <TextEditorContainer\n section={\n content[translationKey] ??\n getEmptyNode(content[defaultLocale])\n }\n keyPath={[\n ...keyPath,\n { type: NodeTypes.TRANSLATION, key: translationKey },\n ]}\n dictionary={dictionary}\n renderSection={renderSection}\n />\n </td>\n </tr>\n </Fragment>\n );\n })}\n </tbody>\n </table>\n );\n};\n\nconst EnumerationTextEditor: FC<TextEditorProps> = ({\n section,\n keyPath,\n dictionary,\n renderSection,\n}) => {\n const { addEditedContent } = useEditedContent();\n const { addNewEnumeration, removeEnumeration } =\n useIntlayer('navigation-view');\n\n const content = (section as EnumerationContent<string>)[\n NodeTypes.ENUMERATION\n ];\n const firstKey = Object.keys(content)[0] as keyof typeof content;\n\n return (\n <div className=\"flex flex-col gap-2\">\n <table className=\"w-full\">\n <tbody className=\"flex w-full flex-col gap-2\">\n {Object.keys(\n (section as EnumerationContent<ContentNode>)[NodeTypes.ENUMERATION]\n ).map((enumKey) => {\n const childrenKeyPath = [\n ...keyPath,\n { type: NodeTypes.ENUMERATION, key: enumKey },\n ] as KeyPath[];\n const uniqueKey = `${JSON.stringify(keyPath)}-enumeration-${enumKey}`;\n\n return (\n <Fragment key={uniqueKey}>\n <tr className=\"mt-2 w-full\">\n <td className=\"flex w-full\">\n <div className=\"flex flex-1\">\n <Button\n label={removeEnumeration.label.value}\n variant=\"hoverable\"\n size=\"sm\"\n color=\"error\"\n className=\"ml-auto text-neutral hover:text-error\"\n Icon={Trash}\n onClick={() =>\n addEditedContent(\n dictionary.localId!,\n undefined,\n childrenKeyPath\n )\n }\n >\n {removeEnumeration.text}\n </Button>\n </div>\n </td>\n </tr>\n <tr className=\"w-full p-2\">\n <td className=\"flex w-full\">\n <EnumKeyInput\n value={enumKey}\n onChange={(value) => {\n const preValueContent = (\n section as EnumerationContent<string>\n )[NodeTypes.ENUMERATION];\n\n const newValueContent = renameKey(\n preValueContent,\n enumKey as keyof typeof preValueContent,\n value\n );\n const newValue = {\n ...(section as EnumerationContent<string>),\n [NodeTypes.ENUMERATION]: newValueContent,\n };\n\n console.log('newValue', newValue);\n\n addEditedContent(\n dictionary.localId!,\n newValue,\n keyPath\n );\n }}\n />\n </td>\n </tr>\n <tr className=\"block w-full\">\n <td className=\"flex w-full\">\n <TextEditor\n section={\n content[enumKey as keyof typeof content] ??\n getEmptyNode(content[firstKey])\n }\n keyPath={childrenKeyPath}\n dictionary={dictionary}\n renderSection={renderSection}\n />\n </td>\n </tr>\n </Fragment>\n );\n })}\n </tbody>\n </table>\n\n <Button\n label={addNewEnumeration.label.value}\n variant=\"hoverable\"\n color=\"neutral\"\n textAlign=\"left\"\n isFullWidth\n onClick={() =>\n addEditedContent(\n dictionary.localId!,\n getEmptyNode(content[firstKey]) ?? '',\n [...keyPath, { type: NodeTypes.ENUMERATION, key: 'unknown' }]\n )\n }\n Icon={Plus}\n className=\"m-2\"\n >\n {addNewEnumeration.text}\n </Button>\n </div>\n );\n};\n\nconst ConditionTextEditor: FC<TextEditorProps> = ({\n section,\n keyPath,\n dictionary,\n renderSection,\n}) => {\n const content = (section as ConditionContent<string>)[NodeTypes.CONDITION];\n\n return (\n <table className=\"w-full\">\n <tbody className=\"flex w-full flex-col gap-2\">\n {['true', 'false', 'fallback'].map((condKey) => {\n const uniqueKey = `${JSON.stringify(keyPath)}-condition-${condKey}`;\n return (\n <Fragment key={uniqueKey}>\n <tr className=\"mt-2 block w-full p-2 text-xs\">\n <td className=\"flex w-full\">{String(condKey)}</td>\n </tr>\n <tr className=\"block w-full\">\n <td className=\"flex w-full\">\n <TextEditorContainer\n section={\n content[condKey as keyof typeof content] ??\n getEmptyNode(content.true)\n }\n keyPath={[\n ...keyPath,\n {\n type: NodeTypes.CONDITION,\n key: condKey,\n } as KeyPath,\n ]}\n dictionary={dictionary}\n renderSection={renderSection}\n />\n </td>\n </tr>\n </Fragment>\n );\n })}\n </tbody>\n </table>\n );\n};\n\nconst GenderTextEditor: FC<TextEditorProps> = ({\n section,\n keyPath,\n dictionary,\n renderSection,\n}) => {\n const content = (section as GenderContent<string>)[NodeTypes.GENDER];\n\n return (\n <table className=\"w-full\">\n <tbody className=\"flex w-full flex-col gap-2\">\n {['male', 'female', 'fallback'].map((condKey) => {\n const uniqueKey = `${JSON.stringify(keyPath)}-gender-${condKey}`;\n return (\n <Fragment key={uniqueKey}>\n <tr className=\"mt-2 block w-full p-2 text-xs\">\n <td className=\"flex w-full\">{String(condKey)}</td>\n </tr>\n <tr className=\"block w-full\">\n <td className=\"flex w-full\">\n <TextEditorContainer\n section={\n content[condKey as keyof typeof content] ??\n getEmptyNode(content.male)\n }\n keyPath={[\n ...keyPath,\n {\n type: NodeTypes.GENDER,\n key: condKey,\n } as KeyPath,\n ]}\n dictionary={dictionary}\n renderSection={renderSection}\n />\n </td>\n </tr>\n </Fragment>\n );\n })}\n </tbody>\n </table>\n );\n};\n\nconst PLURAL_CATEGORIES = ['zero', 'one', 'two', 'few', 'many', 'other'];\n\nconst PluralTextEditor: FC<TextEditorProps> = ({\n section,\n keyPath,\n dictionary,\n renderSection,\n}) => {\n const content = (section as PluralContent<string>)[NodeTypes.PLURAL];\n\n return (\n <table className=\"w-full\">\n <tbody className=\"flex w-full flex-col gap-2\">\n {PLURAL_CATEGORIES.map((pluralKey) => {\n const uniqueKey = `${JSON.stringify(keyPath)}-plural-${pluralKey}`;\n return (\n <Fragment key={uniqueKey}>\n <tr className=\"mt-2 block w-full p-2 text-xs\">\n <td className=\"flex w-full\">{pluralKey}</td>\n </tr>\n <tr className=\"block w-full\">\n <td className=\"flex w-full\">\n <TextEditorContainer\n section={\n content[pluralKey as keyof typeof content] ??\n getEmptyNode(content.other)\n }\n keyPath={[\n ...keyPath,\n {\n type: NodeTypes.PLURAL,\n key: pluralKey,\n } as KeyPath,\n ]}\n dictionary={dictionary}\n renderSection={renderSection}\n />\n </td>\n </tr>\n </Fragment>\n );\n })}\n </tbody>\n </table>\n );\n};\n\nconst ArrayTextEditor: FC<TextEditorProps> = ({\n section,\n keyPath,\n dictionary,\n renderSection,\n}) => {\n const { addEditedContent } = useEditedContent();\n const { addNewElement, removeElement } = useIntlayer('navigation-view');\n\n return (\n <div className=\"flex flex-col gap-2\">\n <table className=\"w-full\">\n <tbody className=\"flex w-full flex-col gap-2\">\n {(section as unknown as ContentNode[]).map((subSection, index) => {\n const uniqueKey = `${JSON.stringify(keyPath)}-array-${index}`;\n return (\n <Fragment key={uniqueKey}>\n <tr className=\"mt-2 w-full p-2\">\n <td className=\"flex w-full\">\n <div className=\"flex w-full items-center justify-between gap-2\">\n <span className=\"text-xs\">{String(index)}</span>\n <Button\n label={removeElement.label.value}\n variant=\"hoverable\"\n size=\"sm\"\n color=\"error\"\n className=\"ml-auto text-neutral hover:text-error\"\n onClick={() => {\n const newKeyPath: KeyPath[] = [\n ...keyPath,\n {\n type: NodeTypes.ARRAY,\n key: index, // Fixed: Use index instead of length\n },\n ];\n addEditedContent(\n dictionary.localId!,\n undefined,\n newKeyPath\n );\n }}\n Icon={Trash}\n >\n {removeElement.text}\n </Button>\n </div>\n </td>\n </tr>\n\n <tr className=\"block w-full\">\n <td className=\"flex w-full\">\n <TextEditorContainer\n section={\n subSection ??\n getEmptyNode((section as unknown as ContentNode[])[0])\n }\n keyPath={[\n ...keyPath,\n {\n type: NodeTypes.ARRAY,\n key: index,\n },\n ]}\n dictionary={dictionary}\n renderSection={renderSection}\n />\n </td>\n </tr>\n </Fragment>\n );\n })}\n </tbody>\n </table>\n <Button\n label={addNewElement.label.value}\n variant=\"hoverable\"\n color=\"neutral\"\n textAlign=\"left\"\n isFullWidth\n onClick={() => {\n const newKeyPath: KeyPath[] = [\n ...keyPath,\n {\n type: NodeTypes.ARRAY,\n key: (section as unknown as ContentNode[]).length, // Keeps length for adding new items\n },\n ];\n addEditedContent(\n dictionary.localId!,\n getEmptyNode((section as unknown as ContentNode[])[0]) ?? '',\n newKeyPath,\n false\n );\n }}\n Icon={Plus}\n >\n {addNewElement.text}\n </Button>\n </div>\n );\n};\n\nconst ObjectTextEditor: FC<TextEditorProps> = ({\n section,\n keyPath,\n dictionary,\n renderSection,\n}) => {\n const typedSection = section as unknown as Record<string, ContentNode>;\n const firstKey = Object.keys(typedSection)[0] as keyof typeof section;\n\n return (\n <table className=\"w-full\">\n <tbody className=\"flex flex-col gap-2\">\n {Object.keys(typedSection).map((key) => {\n const childKeyPath: KeyPath[] = [\n ...keyPath,\n { type: NodeTypes.OBJECT, key },\n ];\n const subSection =\n typedSection[key as keyof typeof section] ??\n getEmptyNode(typedSection[firstKey]);\n const uniqueKey = `${JSON.stringify(keyPath)}-object-${key}`;\n // Collapse any object/array (typed or plain) — only true primitives render inline.\n // getIsEditableSection can't be used here: it inspects getNodeChildren(), which for\n // translation nodes returns the first locale value (a string), causing translation\n // subtrees to be mistakenly treated as leaves and mounted all at once.\n const isLeaf = subSection === null || typeof subSection !== 'object';\n\n if (isLeaf) {\n return (\n <Fragment key={uniqueKey}>\n <tr className=\"mt-2 p-2 text-xs\">\n <td className=\"flex w-full\">{String(key)}</td>\n </tr>\n <tr className=\"block w-full\">\n <td className=\"flex w-full\">\n <TextEditor\n section={subSection}\n keyPath={childKeyPath}\n dictionary={dictionary}\n renderSection={renderSection}\n />\n </td>\n </tr>\n </Fragment>\n );\n }\n\n return (\n <tr\n key={uniqueKey}\n className=\"block w-full border-neutral/10 border-t py-1\"\n >\n <td className=\"flex w-full\">\n <CollapsibleEditor\n label={camelCaseToSentence(key)}\n section={subSection}\n keyPath={childKeyPath}\n dictionary={dictionary}\n renderSection={renderSection}\n />\n </td>\n </tr>\n );\n })}\n </tbody>\n </table>\n );\n};\n\nenum MarkdownViewMode {\n Edit,\n Preview,\n}\n\nenum HtmlViewMode {\n Edit,\n Preview,\n}\n\nconst HtmlTextEditor: FC<TextEditorProps> = ({\n section,\n keyPath,\n dictionary,\n}) => {\n const [mode, setMode] = useState(HtmlViewMode.Edit);\n const toggleContent = [\n {\n content: 'Edit',\n value: HtmlViewMode.Edit,\n },\n {\n content: 'Preview',\n value: HtmlViewMode.Preview,\n },\n ] as SwitchSelectorChoices<HtmlViewMode>;\n const childKeyPath: KeyPath[] = [...keyPath, { type: NodeTypes.HTML }];\n\n const content = (section as HTMLContent<ContentNode>)[\n NodeTypes.HTML\n ] as ContentNode;\n\n return (\n <div className=\"flex w-full flex-col justify-center gap-6 p-2\">\n <SwitchSelector\n choices={toggleContent}\n value={mode}\n onChange={setMode}\n color=\"text\"\n size=\"sm\"\n className=\"ml-auto\"\n />\n\n <TextEditorContainer\n section={content}\n keyPath={childKeyPath}\n dictionary={dictionary}\n renderSection={\n mode === HtmlViewMode.Preview\n ? (rawContent) => <SafeHtmlRenderer rawContent={rawContent} />\n : undefined\n }\n />\n </div>\n );\n};\n\nconst MarkdownTextEditor: FC<TextEditorProps> = ({\n section,\n keyPath,\n dictionary,\n isDarkMode,\n}) => {\n const [mode, setMode] = useState(MarkdownViewMode.Edit);\n const toggleContent = [\n {\n content: 'Edit',\n value: MarkdownViewMode.Edit,\n },\n {\n content: 'Preview',\n value: MarkdownViewMode.Preview,\n },\n ] as SwitchSelectorChoices<MarkdownViewMode>;\n const childKeyPath: KeyPath[] = [...keyPath, { type: NodeTypes.MARKDOWN }];\n\n const content = ((section as MarkdownContent<ContentNode>)[\n NodeTypes.MARKDOWN\n ] ?? '') as ContentNode;\n\n return (\n <div className=\"flex w-full flex-col justify-center gap-6 p-2\">\n <SwitchSelector\n choices={toggleContent}\n value={mode}\n onChange={setMode}\n color=\"text\"\n size=\"sm\"\n className=\"ml-auto\"\n />\n\n <TextEditorContainer\n section={content}\n keyPath={childKeyPath}\n dictionary={dictionary}\n renderSection={\n mode === MarkdownViewMode.Preview\n ? (content) => (\n <Suspense fallback={<Loader />}>\n <LazyMarkdownRenderer isDarkMode={isDarkMode}>\n {content}\n </LazyMarkdownRenderer>\n </Suspense>\n )\n : undefined\n }\n />\n </div>\n );\n};\n\nconst InsertionTextEditor: FC<TextEditorProps> = ({\n section,\n keyPath,\n ...props\n}) => {\n const childKeyPath: KeyPath[] = [...keyPath, { type: NodeTypes.INSERTION }];\n\n const content = (section as InsertionContent<ContentNode>)[\n NodeTypes.INSERTION\n ];\n\n return (\n <div className=\"flex w-full flex-col justify-center gap-6 p-2\">\n <TextEditorContainer\n section={content}\n keyPath={childKeyPath}\n {...props}\n />\n </div>\n );\n};\n\nconst FileTextEditor: FC<TextEditorProps> = ({\n section,\n keyPath,\n ...props\n}) => {\n const childKeyPath: KeyPath[] = [...keyPath, { type: NodeTypes.FILE }];\n\n const fileUrl = (section as FileContent)[NodeTypes.FILE];\n const { content } = section as FileContent;\n\n return (\n <div className=\"flex w-full flex-col justify-center gap-6 p-2\">\n <span className=\"text-neutral text-sm\">{fileUrl} </span>\n <TextEditorContainer\n section={content}\n keyPath={childKeyPath}\n {...props}\n />\n </div>\n );\n};\n\nconst NestedTextEditor: FC<TextEditorProps> = ({\n keyPath,\n dictionary,\n renderSection,\n section,\n ...props\n}) => {\n const { addEditedContent } = useEditedContent();\n\n const content = (section as any)[NodeTypes.NESTED];\n const childrenKeyPath = [...keyPath, { type: NodeTypes.NESTED }] as KeyPath[];\n\n return (\n <div className=\"flex w-full flex-col gap-4 p-2\">\n <Label>Dictionary key</Label>\n <ContentEditorInputBase\n aria-label=\"Edit field\"\n type=\"text\"\n variant=\"default\"\n {...props}\n onContentChange={(newValue) => {\n addEditedContent(\n dictionary.localId!,\n {\n ...content,\n dictionaryKey: String(newValue),\n },\n childrenKeyPath\n );\n }}\n >\n {content.dictionaryKey ?? ''}\n </ContentEditorInputBase>\n\n <Label>Path (optional)</Label>\n <ContentEditorInputBase\n aria-label=\"Edit field\"\n type=\"text\"\n variant=\"default\"\n {...props}\n onContentChange={(newValue) => {\n addEditedContent(\n dictionary.localId!,\n {\n ...content,\n path: newValue !== '' ? newValue : undefined,\n },\n childrenKeyPath\n );\n }}\n >\n {content.path ?? ''}\n </ContentEditorInputBase>\n </div>\n );\n};\n\nexport const TextEditor = memo<TextEditorProps>(function TextEditor({\n section,\n keyPath,\n dictionary,\n renderSection,\n isDarkMode,\n}) {\n const { tsxNotEditable } = useIntlayer('navigation-view');\n const nodeType = getNodeType(section);\n\n if (nodeType === NodeTypes.REACT_NODE) {\n return (\n <div className=\"flex w-full flex-col gap-2\">\n <span>(React Node)</span>\n <span className=\"flex text-neutral text-xs\">{tsxNotEditable}</span>\n </div>\n );\n }\n\n if (nodeType === NodeTypes.NESTED) {\n return (\n <NestedTextEditor\n dictionary={dictionary}\n renderSection={renderSection}\n keyPath={keyPath}\n section={section}\n />\n );\n }\n\n if (nodeType === NodeTypes.TRANSLATION) {\n return (\n <TranslationTextEditor\n dictionary={dictionary}\n renderSection={renderSection}\n keyPath={keyPath}\n section={section}\n />\n );\n }\n\n if (nodeType === NodeTypes.ENUMERATION) {\n return (\n <EnumerationTextEditor\n dictionary={dictionary}\n renderSection={renderSection}\n keyPath={keyPath}\n section={section}\n />\n );\n }\n\n if (nodeType === NodeTypes.CONDITION) {\n return (\n <ConditionTextEditor\n dictionary={dictionary}\n renderSection={renderSection}\n keyPath={keyPath}\n section={section}\n />\n );\n }\n\n if (nodeType === NodeTypes.GENDER) {\n return (\n <GenderTextEditor\n dictionary={dictionary}\n renderSection={renderSection}\n keyPath={keyPath}\n section={section}\n />\n );\n }\n\n if (nodeType === NodeTypes.PLURAL) {\n return (\n <PluralTextEditor\n dictionary={dictionary}\n renderSection={renderSection}\n keyPath={keyPath}\n section={section}\n />\n );\n }\n\n if (nodeType === NodeTypes.INSERTION) {\n return (\n <InsertionTextEditor\n dictionary={dictionary}\n renderSection={renderSection}\n keyPath={keyPath}\n section={section}\n />\n );\n }\n\n if (nodeType === NodeTypes.MARKDOWN) {\n return (\n <MarkdownTextEditor\n dictionary={dictionary}\n keyPath={keyPath}\n section={section}\n isDarkMode={isDarkMode}\n />\n );\n }\n\n if (nodeType === NodeTypes.HTML) {\n return (\n <HtmlTextEditor\n dictionary={dictionary}\n keyPath={keyPath}\n section={section}\n />\n );\n }\n\n if (nodeType === NodeTypes.FILE) {\n return (\n <FileTextEditor\n dictionary={dictionary}\n renderSection={renderSection}\n keyPath={keyPath}\n section={section}\n />\n );\n }\n\n if (nodeType === NodeTypes.ARRAY) {\n return (\n <ArrayTextEditor\n dictionary={dictionary}\n renderSection={renderSection}\n keyPath={keyPath}\n section={section}\n />\n );\n }\n\n if (nodeType === NodeTypes.OBJECT) {\n return (\n <ObjectTextEditor\n dictionary={dictionary}\n renderSection={renderSection}\n keyPath={keyPath}\n section={section}\n />\n );\n }\n\n if (nodeType === NodeTypes.NUMBER) {\n return (\n <div className=\"w-full p-2\">\n <ContentEditorInput\n dictionary={dictionary}\n keyPath={keyPath}\n type=\"number\"\n aria-label=\"Edit field\"\n >\n {section as number}\n </ContentEditorInput>\n </div>\n );\n }\n\n if (nodeType === NodeTypes.TEXT) {\n return (\n <div className=\"w-full p-2\">\n {typeof renderSection === 'function' ? (\n renderSection(section as string)\n ) : (\n <ContentEditorTextArea\n variant=\"default\"\n aria-label=\"Edit field\"\n keyPath={keyPath}\n dictionary={dictionary}\n >\n {section as string}\n </ContentEditorTextArea>\n )}\n </div>\n );\n }\n\n if (nodeType === NodeTypes.BOOLEAN) {\n return (\n <div className=\"w-full p-2\">\n <ContentEditorToggle\n dictionary={dictionary}\n keyPath={keyPath}\n value={section as boolean}\n />\n </div>\n );\n }\n\n return (\n <div className=\"w-full p-2\">\n Error. Format not supported.\n {JSON.stringify(section, null, 2)}\n {JSON.stringify(keyPath, null, 2)}\n NodeType : {nodeType}\n </div>\n );\n});\n\nexport const TextEditorContainer = memo<TextEditorProps>(\n function TextEditorContainer(props) {\n return (\n <Container\n border\n background=\"none\"\n className=\"top-6 flex h-full flex-1 flex-col gap-6 overflow-hidden p-2 md:sticky\"\n roundedSize=\"2xl\"\n >\n <TextEditor {...props} />\n </Container>\n );\n }\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA0DA,MAAM,uBAAuB,WAC3B,OAAO,kCAA8B,MAAM,OAAO,EAChD,SAAS,EAAE,kBACZ,EAAE,CACJ;AAKD,MAAM,oBAAoB,KACxB,SAAS,kBAAkB,EAAE,OAAO,GAAG,eAAe;CACpD,MAAM,CAAC,WAAW,gBAAgB,SAAS,MAAM;AACjD,QACE,oBAAC,WAAD;EACE,QAAQ;EACD;EACP,WAAW,WAAW;AACpB,OAAI,UAAU,CAAC,UAAW,cAAa,KAAK;;YAG7C,YAAY,oBAAC,YAAD,EAAY,GAAI,aAAe,IAAG;EACrC;EAGjB;AAED,MAAa,YAAsB;CAAC;CAAY;CAAM;CAAW;AAUjE,MAAM,y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EACT;AAIN,KAAI,aAAa,UAAU,OACzB,QACE,oBAAC,kBAAD;EACc;EACG;EACN;EACA;EACT;AAIN,KAAI,aAAa,UAAU,OACzB,QACE,oBAAC,OAAD;EAAK,WAAU;YACb,oBAAC,oBAAD;GACc;GACH;GACT,MAAK;GACL,cAAW;aAEV;GACkB;EACjB;AAIV,KAAI,aAAa,UAAU,KACzB,QACE,oBAAC,OAAD;EAAK,WAAU;YACZ,OAAO,kBAAkB,aACxB,cAAc,QAAkB,GAEhC,oBAAC,uBAAD;GACE,SAAQ;GACR,cAAW;GACF;GACG;aAEX;GACqB;EAEtB;AAIV,KAAI,aAAa,UAAU,QACzB,QACE,oBAAC,OAAD;EAAK,WAAU;YACb,oBAAC,qBAAD;GACc;GACH;GACT,OAAO;GACP;EACE;AAIV,QACE,qBAAC,OAAD;EAAK,WAAU;YAAf;GAA4B;GAEzB,KAAK,UAAU,SAAS,MAAM,EAAE;GAChC,KAAK,UAAU,SAAS,MAAM,EAAE;GAAC;GACtB;GACR;;EAER;AAEF,MAAa,sBAAsB,KACjC,SAAS,oBAAoB,OAAO;AAClC,QACE,oBAAC,WAAD;EACE;EACA,YAAW;EACX,WAAU;EACV,aAAY;YAEZ,oBAAC,YAAD,EAAY,GAAI,OAAS;EACf;EAGjB"}
1
+ {"version":3,"file":"TextEditor.mjs","names":["ContentEditorTextAreaBase","ContentEditorInputBase"],"sources":["../../../../../src/components/DictionaryFieldEditor/ContentEditorView/TextEditor.tsx"],"sourcesContent":["'use client';\n\nimport { useAuditContentDeclarationField } from '@api/index';\nimport { Accordion } from '@components/Accordion';\nimport { Button } from '@components/Button';\nimport { Container } from '@components/Container';\nimport {\n ContentEditorInput as ContentEditorInputBase,\n type ContentEditorInputProps as ContentEditorInputPropsBase,\n} from '@components/ContentEditor/ContentEditorInput';\nimport {\n ContentEditorTextArea as ContentEditorTextAreaBase,\n type ContentEditorTextAreaProps as ContentEditorTextAreaPropsBase,\n} from '@components/ContentEditor/ContentEditorTextArea';\nimport { renameKey } from '@components/DictionaryFieldEditor/ContentEditorView/object';\nimport { Label } from '@components/Label';\nimport { Loader } from '@components/Loader';\nimport { useLocaleSwitcherContent } from '@components/LocaleSwitcherContentDropDown';\nimport {\n SwitchSelector,\n type SwitchSelectorChoices,\n type SwitchSelectorProps,\n} from '@components/SwitchSelector';\nimport { camelCaseToSentence } from '@intlayer/config/client';\nimport {\n getEmptyNode,\n getNodeType,\n} from '@intlayer/core/dictionaryManipulator';\nimport { getLocaleName } from '@intlayer/core/localization';\nimport type {\n ConditionContent,\n EnumerationContent,\n FileContent,\n GenderContent,\n HTMLContent,\n InsertionContent,\n MarkdownContent,\n PluralContent,\n TranslationContent,\n} from '@intlayer/core/transpiler';\nimport { useConfiguration, useEditedContent } from '@intlayer/editor-react';\nimport type { ContentNode, Dictionary } from '@intlayer/types/dictionary';\nimport type { KeyPath } from '@intlayer/types/keyPath';\nimport * as NodeTypes from '@intlayer/types/nodeType';\nimport { Plus, Trash, WandSparkles } from 'lucide-react';\nimport {\n type FC,\n Fragment,\n lazy,\n memo,\n type ReactNode,\n Suspense,\n useState,\n} from 'react';\nimport { useIntlayer, useLocale } from 'react-intlayer';\nimport { EnumKeyInput } from '../EnumKeyInput';\nimport { SafeHtmlRenderer } from './SafeHtmlRenderer';\n\nconst LazyMarkdownRenderer = lazy(() =>\n import('@components/MarkDownRender').then((m) => ({\n default: m.MarkdownRenderer,\n }))\n);\n\n// Lazy-loaded so the Tiptap/Novel editor bundle is only fetched when a markdown\n// field is actually edited.\nconst LazyMarkdownEditor = lazy(() =>\n import('@components/MarkdownEditor').then((m) => ({\n default: m.MarkdownEditor,\n }))\n);\n\n// Renders children only after the accordion is first opened (mount-once pattern).\n// Prevents deeply nested sub-trees from mounting on initial render.\ntype CollapsibleEditorProps = TextEditorProps & { label: string };\nconst CollapsibleEditor = memo<CollapsibleEditorProps>(\n function CollapsibleEditor({ label, ...editorProps }) {\n const [hasOpened, setHasOpened] = useState(false);\n return (\n <Accordion\n header={label}\n label={label}\n onToggle={(isOpen) => {\n if (isOpen && !hasOpened) setHasOpened(true);\n }}\n >\n {hasOpened ? <TextEditor {...editorProps} /> : null}\n </Accordion>\n );\n }\n);\n\nexport const traceKeys: string[] = ['filePath', 'id', 'nodeType'];\n\ntype ContentEditorTextAreaProps = Omit<\n ContentEditorTextAreaPropsBase,\n 'onContentChange'\n> & {\n keyPath: KeyPath[];\n dictionary: Dictionary;\n};\n\nconst ContentEditorTextArea: FC<ContentEditorTextAreaProps> = ({\n keyPath,\n dictionary,\n ...props\n}) => {\n const { editedContent, addEditedContent } = useEditedContent();\n const configuration = useConfiguration();\n const { mutate: auditContentDeclarationField, isPending: isAuditing } =\n useAuditContentDeclarationField();\n\n return (\n <ContentEditorTextAreaBase\n variant=\"default\"\n onContentChange={(newValue) =>\n addEditedContent(dictionary.localId!, newValue, keyPath)\n }\n additionalButtons={\n <Button\n Icon={WandSparkles}\n label=\"Audit\"\n variant=\"hoverable\"\n size=\"icon-sm\"\n color=\"text\"\n className=\"cursor-pointer hover:scale-110\"\n isLoading={isAuditing}\n onClick={() => {\n auditContentDeclarationField(\n {\n fileContent: JSON.stringify({\n ...dictionary,\n ...(editedContent?.[dictionary.localId!] ?? {}),\n }),\n keyPath,\n locales: configuration?.internationalization.locales ?? [],\n aiOptions: {\n apiKey: configuration?.ai?.apiKey,\n model: configuration?.ai?.model,\n temperature: configuration?.ai?.temperature,\n },\n },\n {\n onSuccess: (response) => {\n if (!response?.data) return;\n\n try {\n const editedContent = response.data.fileContent as string;\n\n addEditedContent(\n dictionary.localId!,\n editedContent,\n keyPath\n );\n } catch (error) {\n console.error(error);\n }\n },\n }\n );\n }}\n />\n }\n {...props}\n />\n );\n};\n\ntype ContentEditorInputProps = Omit<\n ContentEditorInputPropsBase,\n 'onContentChange'\n> & {\n keyPath: KeyPath[];\n dictionary: Dictionary;\n};\n\nconst ContentEditorInput: FC<ContentEditorInputProps> = ({\n keyPath,\n dictionary,\n ...props\n}) => {\n const { addEditedContent } = useEditedContent();\n\n return (\n <ContentEditorInputBase\n variant=\"default\"\n onContentChange={(newValue) =>\n addEditedContent(dictionary.localId!, newValue, keyPath)\n }\n {...props}\n />\n );\n};\n\nconst toggleContent = [\n {\n content: 'False',\n value: false,\n },\n {\n content: 'True',\n value: true,\n },\n] as SwitchSelectorChoices<boolean>;\n\ntype ContentEditorToggleProps = SwitchSelectorProps & {\n dictionary: Dictionary;\n keyPath: KeyPath[];\n};\n\nconst ContentEditorToggle: FC<ContentEditorToggleProps> = ({\n dictionary,\n keyPath,\n ...props\n}) => {\n const { addEditedContent } = useEditedContent();\n\n return (\n <SwitchSelector\n choices={toggleContent}\n value={true}\n onChange={(value) =>\n addEditedContent(dictionary.localId!, value, keyPath)\n }\n color=\"text\"\n size=\"sm\"\n {...props}\n />\n );\n};\n\nexport type TextEditorProps = {\n dictionary: Dictionary;\n keyPath: KeyPath[];\n section: ContentNode;\n isDarkMode?: boolean;\n renderSection?: (content: string) => ReactNode;\n onContentChange?: (newValue: string) => void;\n};\n\nconst TranslationTextEditor: FC<TextEditorProps> = ({\n section,\n keyPath,\n dictionary,\n renderSection,\n}: TextEditorProps) => {\n const { locale, defaultLocale } = useLocale();\n const { selectedLocales } = useLocaleSwitcherContent();\n\n const content: any = (section as TranslationContent<string>)[\n NodeTypes.TRANSLATION\n ];\n\n return (\n <table className=\"w-full\">\n <tbody className=\"flex w-full flex-col gap-2\">\n {selectedLocales.map((translationKey) => {\n const uniqueKey = `${JSON.stringify(keyPath)}-translation-${translationKey}`;\n return (\n <Fragment key={uniqueKey}>\n <tr className=\"mt-2 w-full p-2 text-xs\">\n <td className=\"flex w-full\">\n {getLocaleName(translationKey, locale)}\n </td>\n </tr>\n <tr className=\"flex\">\n <td className=\"flex w-full\">\n <TextEditorContainer\n section={\n content[translationKey] ??\n getEmptyNode(content[defaultLocale])\n }\n keyPath={[\n ...keyPath,\n { type: NodeTypes.TRANSLATION, key: translationKey },\n ]}\n dictionary={dictionary}\n renderSection={renderSection}\n />\n </td>\n </tr>\n </Fragment>\n );\n })}\n </tbody>\n </table>\n );\n};\n\nconst EnumerationTextEditor: FC<TextEditorProps> = ({\n section,\n keyPath,\n dictionary,\n renderSection,\n}) => {\n const { addEditedContent } = useEditedContent();\n const { addNewEnumeration, removeEnumeration } =\n useIntlayer('navigation-view');\n\n const content = (section as EnumerationContent<string>)[\n NodeTypes.ENUMERATION\n ];\n const firstKey = Object.keys(content)[0] as keyof typeof content;\n\n return (\n <div className=\"flex flex-col gap-2\">\n <table className=\"w-full\">\n <tbody className=\"flex w-full flex-col gap-2\">\n {Object.keys(\n (section as EnumerationContent<ContentNode>)[NodeTypes.ENUMERATION]\n ).map((enumKey) => {\n const childrenKeyPath = [\n ...keyPath,\n { type: NodeTypes.ENUMERATION, key: enumKey },\n ] as KeyPath[];\n const uniqueKey = `${JSON.stringify(keyPath)}-enumeration-${enumKey}`;\n\n return (\n <Fragment key={uniqueKey}>\n <tr className=\"mt-2 w-full\">\n <td className=\"flex w-full\">\n <div className=\"flex flex-1\">\n <Button\n label={removeEnumeration.label.value}\n variant=\"hoverable\"\n size=\"sm\"\n color=\"error\"\n className=\"ml-auto text-neutral hover:text-error\"\n Icon={Trash}\n onClick={() =>\n addEditedContent(\n dictionary.localId!,\n undefined,\n childrenKeyPath\n )\n }\n >\n {removeEnumeration.text}\n </Button>\n </div>\n </td>\n </tr>\n <tr className=\"w-full p-2\">\n <td className=\"flex w-full\">\n <EnumKeyInput\n value={enumKey}\n onChange={(value) => {\n const preValueContent = (\n section as EnumerationContent<string>\n )[NodeTypes.ENUMERATION];\n\n const newValueContent = renameKey(\n preValueContent,\n enumKey as keyof typeof preValueContent,\n value\n );\n const newValue = {\n ...(section as EnumerationContent<string>),\n [NodeTypes.ENUMERATION]: newValueContent,\n };\n\n console.log('newValue', newValue);\n\n addEditedContent(\n dictionary.localId!,\n newValue,\n keyPath\n );\n }}\n />\n </td>\n </tr>\n <tr className=\"block w-full\">\n <td className=\"flex w-full\">\n <TextEditor\n section={\n content[enumKey as keyof typeof content] ??\n getEmptyNode(content[firstKey])\n }\n keyPath={childrenKeyPath}\n dictionary={dictionary}\n renderSection={renderSection}\n />\n </td>\n </tr>\n </Fragment>\n );\n })}\n </tbody>\n </table>\n\n <Button\n label={addNewEnumeration.label.value}\n variant=\"hoverable\"\n color=\"neutral\"\n textAlign=\"left\"\n isFullWidth\n onClick={() =>\n addEditedContent(\n dictionary.localId!,\n getEmptyNode(content[firstKey]) ?? '',\n [...keyPath, { type: NodeTypes.ENUMERATION, key: 'unknown' }]\n )\n }\n Icon={Plus}\n className=\"m-2\"\n >\n {addNewEnumeration.text}\n </Button>\n </div>\n );\n};\n\nconst ConditionTextEditor: FC<TextEditorProps> = ({\n section,\n keyPath,\n dictionary,\n renderSection,\n}) => {\n const content = (section as ConditionContent<string>)[NodeTypes.CONDITION];\n\n return (\n <table className=\"w-full\">\n <tbody className=\"flex w-full flex-col gap-2\">\n {['true', 'false', 'fallback'].map((condKey) => {\n const uniqueKey = `${JSON.stringify(keyPath)}-condition-${condKey}`;\n return (\n <Fragment key={uniqueKey}>\n <tr className=\"mt-2 block w-full p-2 text-xs\">\n <td className=\"flex w-full\">{String(condKey)}</td>\n </tr>\n <tr className=\"block w-full\">\n <td className=\"flex w-full\">\n <TextEditorContainer\n section={\n content[condKey as keyof typeof content] ??\n getEmptyNode(content.true)\n }\n keyPath={[\n ...keyPath,\n {\n type: NodeTypes.CONDITION,\n key: condKey,\n } as KeyPath,\n ]}\n dictionary={dictionary}\n renderSection={renderSection}\n />\n </td>\n </tr>\n </Fragment>\n );\n })}\n </tbody>\n </table>\n );\n};\n\nconst GenderTextEditor: FC<TextEditorProps> = ({\n section,\n keyPath,\n dictionary,\n renderSection,\n}) => {\n const content = (section as GenderContent<string>)[NodeTypes.GENDER];\n\n return (\n <table className=\"w-full\">\n <tbody className=\"flex w-full flex-col gap-2\">\n {['male', 'female', 'fallback'].map((condKey) => {\n const uniqueKey = `${JSON.stringify(keyPath)}-gender-${condKey}`;\n return (\n <Fragment key={uniqueKey}>\n <tr className=\"mt-2 block w-full p-2 text-xs\">\n <td className=\"flex w-full\">{String(condKey)}</td>\n </tr>\n <tr className=\"block w-full\">\n <td className=\"flex w-full\">\n <TextEditorContainer\n section={\n content[condKey as keyof typeof content] ??\n getEmptyNode(content.male)\n }\n keyPath={[\n ...keyPath,\n {\n type: NodeTypes.GENDER,\n key: condKey,\n } as KeyPath,\n ]}\n dictionary={dictionary}\n renderSection={renderSection}\n />\n </td>\n </tr>\n </Fragment>\n );\n })}\n </tbody>\n </table>\n );\n};\n\nconst PLURAL_CATEGORIES = ['zero', 'one', 'two', 'few', 'many', 'other'];\n\nconst PluralTextEditor: FC<TextEditorProps> = ({\n section,\n keyPath,\n dictionary,\n renderSection,\n}) => {\n const content = (section as PluralContent<string>)[NodeTypes.PLURAL];\n\n return (\n <table className=\"w-full\">\n <tbody className=\"flex w-full flex-col gap-2\">\n {PLURAL_CATEGORIES.map((pluralKey) => {\n const uniqueKey = `${JSON.stringify(keyPath)}-plural-${pluralKey}`;\n return (\n <Fragment key={uniqueKey}>\n <tr className=\"mt-2 block w-full p-2 text-xs\">\n <td className=\"flex w-full\">{pluralKey}</td>\n </tr>\n <tr className=\"block w-full\">\n <td className=\"flex w-full\">\n <TextEditorContainer\n section={\n content[pluralKey as keyof typeof content] ??\n getEmptyNode(content.other)\n }\n keyPath={[\n ...keyPath,\n {\n type: NodeTypes.PLURAL,\n key: pluralKey,\n } as KeyPath,\n ]}\n dictionary={dictionary}\n renderSection={renderSection}\n />\n </td>\n </tr>\n </Fragment>\n );\n })}\n </tbody>\n </table>\n );\n};\n\nconst ArrayTextEditor: FC<TextEditorProps> = ({\n section,\n keyPath,\n dictionary,\n renderSection,\n}) => {\n const { addEditedContent } = useEditedContent();\n const { addNewElement, removeElement } = useIntlayer('navigation-view');\n\n return (\n <div className=\"flex flex-col gap-2\">\n <table className=\"w-full\">\n <tbody className=\"flex w-full flex-col gap-2\">\n {(section as unknown as ContentNode[]).map((subSection, index) => {\n const uniqueKey = `${JSON.stringify(keyPath)}-array-${index}`;\n return (\n <Fragment key={uniqueKey}>\n <tr className=\"mt-2 w-full p-2\">\n <td className=\"flex w-full\">\n <div className=\"flex w-full items-center justify-between gap-2\">\n <span className=\"text-xs\">{String(index)}</span>\n <Button\n label={removeElement.label.value}\n variant=\"hoverable\"\n size=\"sm\"\n color=\"error\"\n className=\"ml-auto text-neutral hover:text-error\"\n onClick={() => {\n const newKeyPath: KeyPath[] = [\n ...keyPath,\n {\n type: NodeTypes.ARRAY,\n key: index, // Fixed: Use index instead of length\n },\n ];\n addEditedContent(\n dictionary.localId!,\n undefined,\n newKeyPath\n );\n }}\n Icon={Trash}\n >\n {removeElement.text}\n </Button>\n </div>\n </td>\n </tr>\n\n <tr className=\"block w-full\">\n <td className=\"flex w-full\">\n <TextEditorContainer\n section={\n subSection ??\n getEmptyNode((section as unknown as ContentNode[])[0])\n }\n keyPath={[\n ...keyPath,\n {\n type: NodeTypes.ARRAY,\n key: index,\n },\n ]}\n dictionary={dictionary}\n renderSection={renderSection}\n />\n </td>\n </tr>\n </Fragment>\n );\n })}\n </tbody>\n </table>\n <Button\n label={addNewElement.label.value}\n variant=\"hoverable\"\n color=\"neutral\"\n textAlign=\"left\"\n isFullWidth\n onClick={() => {\n const newKeyPath: KeyPath[] = [\n ...keyPath,\n {\n type: NodeTypes.ARRAY,\n key: (section as unknown as ContentNode[]).length, // Keeps length for adding new items\n },\n ];\n addEditedContent(\n dictionary.localId!,\n getEmptyNode((section as unknown as ContentNode[])[0]) ?? '',\n newKeyPath,\n false\n );\n }}\n Icon={Plus}\n >\n {addNewElement.text}\n </Button>\n </div>\n );\n};\n\nconst ObjectTextEditor: FC<TextEditorProps> = ({\n section,\n keyPath,\n dictionary,\n renderSection,\n}) => {\n const typedSection = section as unknown as Record<string, ContentNode>;\n const firstKey = Object.keys(typedSection)[0] as keyof typeof section;\n\n return (\n <table className=\"w-full\">\n <tbody className=\"flex flex-col gap-2\">\n {Object.keys(typedSection).map((key) => {\n const childKeyPath: KeyPath[] = [\n ...keyPath,\n { type: NodeTypes.OBJECT, key },\n ];\n const subSection =\n typedSection[key as keyof typeof section] ??\n getEmptyNode(typedSection[firstKey]);\n const uniqueKey = `${JSON.stringify(keyPath)}-object-${key}`;\n // Collapse any object/array (typed or plain) — only true primitives render inline.\n // getIsEditableSection can't be used here: it inspects getNodeChildren(), which for\n // translation nodes returns the first locale value (a string), causing translation\n // subtrees to be mistakenly treated as leaves and mounted all at once.\n const isLeaf = subSection === null || typeof subSection !== 'object';\n\n if (isLeaf) {\n return (\n <Fragment key={uniqueKey}>\n <tr className=\"mt-2 p-2 text-xs\">\n <td className=\"flex w-full\">{String(key)}</td>\n </tr>\n <tr className=\"block w-full\">\n <td className=\"flex w-full\">\n <TextEditor\n section={subSection}\n keyPath={childKeyPath}\n dictionary={dictionary}\n renderSection={renderSection}\n />\n </td>\n </tr>\n </Fragment>\n );\n }\n\n return (\n <tr\n key={uniqueKey}\n className=\"block w-full border-neutral/10 border-t py-1\"\n >\n <td className=\"flex w-full\">\n <CollapsibleEditor\n label={camelCaseToSentence(key)}\n section={subSection}\n keyPath={childKeyPath}\n dictionary={dictionary}\n renderSection={renderSection}\n />\n </td>\n </tr>\n );\n })}\n </tbody>\n </table>\n );\n};\n\nenum MarkdownViewMode {\n Edit,\n Raw,\n Preview,\n}\n\nenum HtmlViewMode {\n Edit,\n Preview,\n}\n\nconst HtmlTextEditor: FC<TextEditorProps> = ({\n section,\n keyPath,\n dictionary,\n}) => {\n const [mode, setMode] = useState(HtmlViewMode.Edit);\n const toggleContent = [\n {\n content: 'Edit',\n value: HtmlViewMode.Edit,\n },\n {\n content: 'Preview',\n value: HtmlViewMode.Preview,\n },\n ] as SwitchSelectorChoices<HtmlViewMode>;\n const childKeyPath: KeyPath[] = [...keyPath, { type: NodeTypes.HTML }];\n\n const content = (section as HTMLContent<ContentNode>)[\n NodeTypes.HTML\n ] as ContentNode;\n\n return (\n <div className=\"flex w-full flex-col justify-center gap-6 p-2\">\n <SwitchSelector\n choices={toggleContent}\n value={mode}\n onChange={setMode}\n color=\"text\"\n size=\"sm\"\n className=\"ml-auto\"\n />\n\n <TextEditorContainer\n section={content}\n keyPath={childKeyPath}\n dictionary={dictionary}\n renderSection={\n mode === HtmlViewMode.Preview\n ? (rawContent) => <SafeHtmlRenderer rawContent={rawContent} />\n : undefined\n }\n />\n </div>\n );\n};\n\nconst MarkdownTextEditor: FC<TextEditorProps> = ({\n section,\n keyPath,\n dictionary,\n isDarkMode,\n}) => {\n const [mode, setMode] = useState(MarkdownViewMode.Edit);\n const { addEditedContent } = useEditedContent();\n const toggleContent = [\n {\n content: 'Edit',\n value: MarkdownViewMode.Edit,\n },\n {\n content: 'Raw',\n value: MarkdownViewMode.Raw,\n },\n {\n content: 'Preview',\n value: MarkdownViewMode.Preview,\n },\n ] as SwitchSelectorChoices<MarkdownViewMode>;\n const childKeyPath: KeyPath[] = [...keyPath, { type: NodeTypes.MARKDOWN }];\n\n const content = ((section as MarkdownContent<ContentNode>)[\n NodeTypes.MARKDOWN\n ] ?? '') as ContentNode;\n\n // The WYSIWYG editor only handles a plain markdown string. When the markdown\n // node wraps another node (e.g. `md(t({ ... }))`), fall back to the recursive\n // editor so the inner translation/nested structure stays editable.\n const isStringLeaf = typeof content === 'string';\n\n return (\n <div className=\"flex w-full flex-col justify-center gap-6 p-2\">\n <SwitchSelector\n choices={toggleContent}\n value={mode}\n onChange={setMode}\n color=\"text\"\n size=\"sm\"\n className=\"ml-auto\"\n />\n\n {mode === MarkdownViewMode.Edit && isStringLeaf ? (\n <Container\n border\n background=\"none\"\n roundedSize=\"2xl\"\n padding=\"lg\"\n className=\"w-full\"\n >\n <Suspense fallback={<Loader />}>\n <LazyMarkdownEditor\n key={JSON.stringify(childKeyPath)}\n defaultValue={content}\n onChange={(markdown) =>\n addEditedContent(dictionary.localId!, markdown, childKeyPath)\n }\n />\n </Suspense>\n </Container>\n ) : (\n <TextEditorContainer\n section={content}\n keyPath={childKeyPath}\n dictionary={dictionary}\n renderSection={\n mode === MarkdownViewMode.Preview\n ? (content) => (\n <Suspense fallback={<Loader />}>\n <LazyMarkdownRenderer isDarkMode={isDarkMode}>\n {content}\n </LazyMarkdownRenderer>\n </Suspense>\n )\n : undefined\n }\n />\n )}\n </div>\n );\n};\n\nconst InsertionTextEditor: FC<TextEditorProps> = ({\n section,\n keyPath,\n ...props\n}) => {\n const childKeyPath: KeyPath[] = [...keyPath, { type: NodeTypes.INSERTION }];\n\n const content = (section as InsertionContent<ContentNode>)[\n NodeTypes.INSERTION\n ];\n\n return (\n <div className=\"flex w-full flex-col justify-center gap-6 p-2\">\n <TextEditorContainer\n section={content}\n keyPath={childKeyPath}\n {...props}\n />\n </div>\n );\n};\n\nconst FileTextEditor: FC<TextEditorProps> = ({\n section,\n keyPath,\n ...props\n}) => {\n const childKeyPath: KeyPath[] = [...keyPath, { type: NodeTypes.FILE }];\n\n const fileUrl = (section as FileContent)[NodeTypes.FILE];\n const { content } = section as FileContent;\n\n return (\n <div className=\"flex w-full flex-col justify-center gap-6 p-2\">\n <span className=\"text-neutral text-sm\">{fileUrl} </span>\n <TextEditorContainer\n section={content}\n keyPath={childKeyPath}\n {...props}\n />\n </div>\n );\n};\n\nconst NestedTextEditor: FC<TextEditorProps> = ({\n keyPath,\n dictionary,\n renderSection,\n section,\n ...props\n}) => {\n const { addEditedContent } = useEditedContent();\n\n const content = (section as any)[NodeTypes.NESTED];\n const childrenKeyPath = [...keyPath, { type: NodeTypes.NESTED }] as KeyPath[];\n\n return (\n <div className=\"flex w-full flex-col gap-4 p-2\">\n <Label>Dictionary key</Label>\n <ContentEditorInputBase\n aria-label=\"Edit field\"\n type=\"text\"\n variant=\"default\"\n {...props}\n onContentChange={(newValue) => {\n addEditedContent(\n dictionary.localId!,\n {\n ...content,\n dictionaryKey: String(newValue),\n },\n childrenKeyPath\n );\n }}\n >\n {content.dictionaryKey ?? ''}\n </ContentEditorInputBase>\n\n <Label>Path (optional)</Label>\n <ContentEditorInputBase\n aria-label=\"Edit field\"\n type=\"text\"\n variant=\"default\"\n {...props}\n onContentChange={(newValue) => {\n addEditedContent(\n dictionary.localId!,\n {\n ...content,\n path: newValue !== '' ? newValue : undefined,\n },\n childrenKeyPath\n );\n }}\n >\n {content.path ?? ''}\n </ContentEditorInputBase>\n </div>\n );\n};\n\nexport const TextEditor = memo<TextEditorProps>(function TextEditor({\n section,\n keyPath,\n dictionary,\n renderSection,\n isDarkMode,\n}) {\n const { tsxNotEditable } = useIntlayer('navigation-view');\n const nodeType = getNodeType(section);\n\n if (nodeType === NodeTypes.REACT_NODE) {\n return (\n <div className=\"flex w-full flex-col gap-2\">\n <span>(React Node)</span>\n <span className=\"flex text-neutral text-xs\">{tsxNotEditable}</span>\n </div>\n );\n }\n\n if (nodeType === NodeTypes.NESTED) {\n return (\n <NestedTextEditor\n dictionary={dictionary}\n renderSection={renderSection}\n keyPath={keyPath}\n section={section}\n />\n );\n }\n\n if (nodeType === NodeTypes.TRANSLATION) {\n return (\n <TranslationTextEditor\n dictionary={dictionary}\n renderSection={renderSection}\n keyPath={keyPath}\n section={section}\n />\n );\n }\n\n if (nodeType === NodeTypes.ENUMERATION) {\n return (\n <EnumerationTextEditor\n dictionary={dictionary}\n renderSection={renderSection}\n keyPath={keyPath}\n section={section}\n />\n );\n }\n\n if (nodeType === NodeTypes.CONDITION) {\n return (\n <ConditionTextEditor\n dictionary={dictionary}\n renderSection={renderSection}\n keyPath={keyPath}\n section={section}\n />\n );\n }\n\n if (nodeType === NodeTypes.GENDER) {\n return (\n <GenderTextEditor\n dictionary={dictionary}\n renderSection={renderSection}\n keyPath={keyPath}\n section={section}\n />\n );\n }\n\n if (nodeType === NodeTypes.PLURAL) {\n return (\n <PluralTextEditor\n dictionary={dictionary}\n renderSection={renderSection}\n keyPath={keyPath}\n section={section}\n />\n );\n }\n\n if (nodeType === NodeTypes.INSERTION) {\n return (\n <InsertionTextEditor\n dictionary={dictionary}\n renderSection={renderSection}\n keyPath={keyPath}\n section={section}\n />\n );\n }\n\n if (nodeType === NodeTypes.MARKDOWN) {\n return (\n <MarkdownTextEditor\n dictionary={dictionary}\n keyPath={keyPath}\n section={section}\n isDarkMode={isDarkMode}\n />\n );\n }\n\n if (nodeType === NodeTypes.HTML) {\n return (\n <HtmlTextEditor\n dictionary={dictionary}\n keyPath={keyPath}\n section={section}\n />\n );\n }\n\n if (nodeType === NodeTypes.FILE) {\n return (\n <FileTextEditor\n dictionary={dictionary}\n renderSection={renderSection}\n keyPath={keyPath}\n section={section}\n />\n );\n }\n\n if (nodeType === NodeTypes.ARRAY) {\n return (\n <ArrayTextEditor\n dictionary={dictionary}\n renderSection={renderSection}\n keyPath={keyPath}\n section={section}\n />\n );\n }\n\n if (nodeType === NodeTypes.OBJECT) {\n return (\n <ObjectTextEditor\n dictionary={dictionary}\n renderSection={renderSection}\n keyPath={keyPath}\n section={section}\n />\n );\n }\n\n if (nodeType === NodeTypes.NUMBER) {\n return (\n <div className=\"w-full p-2\">\n <ContentEditorInput\n dictionary={dictionary}\n keyPath={keyPath}\n type=\"number\"\n aria-label=\"Edit field\"\n >\n {section as number}\n </ContentEditorInput>\n </div>\n );\n }\n\n if (nodeType === NodeTypes.TEXT) {\n return (\n <div className=\"w-full p-2\">\n {typeof renderSection === 'function' ? (\n renderSection(section as string)\n ) : (\n <ContentEditorTextArea\n variant=\"default\"\n aria-label=\"Edit field\"\n keyPath={keyPath}\n dictionary={dictionary}\n >\n {section as string}\n </ContentEditorTextArea>\n )}\n </div>\n );\n }\n\n if (nodeType === NodeTypes.BOOLEAN) {\n return (\n <div className=\"w-full p-2\">\n <ContentEditorToggle\n dictionary={dictionary}\n keyPath={keyPath}\n value={section as boolean}\n />\n </div>\n );\n }\n\n return (\n <div className=\"w-full p-2\">\n Error. Format not supported.\n {JSON.stringify(section, null, 2)}\n {JSON.stringify(keyPath, null, 2)}\n NodeType : {nodeType}\n </div>\n );\n});\n\nexport const TextEditorContainer = memo<TextEditorProps>(\n function TextEditorContainer(props) {\n return (\n <Container\n border\n background=\"none\"\n className=\"top-6 flex h-full flex-1 flex-col gap-6 overflow-hidden p-2 md:sticky\"\n roundedSize=\"2xl\"\n >\n <TextEditor {...props} />\n </Container>\n );\n }\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA0DA,MAAM,uBAAuB,WAC3B,OAAO,kCAA8B,MAAM,OAAO,EAChD,SAAS,EAAE,kBACZ,EAAE,CACJ;AAID,MAAM,qBAAqB,WACzB,OAAO,kCAA8B,MAAM,OAAO,EAChD,SAAS,EAAE,gBACZ,EAAE,CACJ;AAKD,MAAM,oBAAoB,KACxB,SAAS,kBAAkB,EAAE,OAAO,GAAG,eAAe;CACpD,MAAM,CAAC,WAAW,gBAAgB,SAAS,MAAM;AACjD,QACE,oBAAC,WAAD;EACE,QAAQ;EACD;EACP,WAAW,WAAW;AACpB,OAAI,UAAU,CAAC,UAAW,cAAa,KAAK;;YAG7C,YAAY,oBAAC,YAAD,EAAY,GAAI,aAAe,IAAG;EACrC;EAGjB;AAED,MAAa,YAAsB;CAAC;CAAY;CAAM;CAAW;AAUjE,MAAM,yBAAyD,EAC7D,SACA,YACA,GAAG,YACC;CACJ,MAAM,EAAE,eAAe,qBAAqB,kBAAkB;CAC9D,MAAM,gBAAgB,kBAAkB;CACxC,MAAM,EAAE,QAAQ,8BAA8B,WAAW,eACvD,iCAAiC;AAEnC,QACE,oBAACA,yBAAD;EACE,SAAQ;EACR,kBAAkB,aAChB,iBAAiB,WAAW,SAAU,UAAU,QAAQ;EAE1D,mBACE,oBAAC,QAAD;GACE,MAAM;GACN,OAAM;GACN,SAAQ;GACR,MAAK;GACL,OAAM;GACN,WAAU;GACV,WAAW;GACX,eAAe;AACb,iCACE;KACE,aAAa,KAAK,UAAU;MAC1B,GAAG;MACH,GAAI,gBAAgB,WAAW,YAAa,EAAE;MAC/C,CAAC;KACF;KACA,SAAS,eAAe,qBAAqB,WAAW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