@intlayer/design-system 3.5.5 → 3.5.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (351) hide show
  1. package/dist/.vite/manifest.json +241 -17
  2. package/dist/CodeBlockShiki-BlmZyrr7.cjs +29 -0
  3. package/dist/CodeBlockShiki-BlmZyrr7.cjs.map +1 -0
  4. package/dist/CodeBlockShiki-CcpV9SVi.js +29 -0
  5. package/dist/CodeBlockShiki-CcpV9SVi.js.map +1 -0
  6. package/dist/Form-BB0kpER9.cjs +301 -0
  7. package/dist/Form-BB0kpER9.cjs.map +1 -0
  8. package/dist/Form-BDcoNTLV.cjs.map +1 -1
  9. package/dist/Form-DGLgTAdY.js +302 -0
  10. package/dist/Form-DGLgTAdY.js.map +1 -0
  11. package/dist/Form-DhsgC7kB.js.map +1 -1
  12. package/dist/components/Auth/SignUpForm/signUpForm.content.d.ts +11 -11
  13. package/dist/components/Breadcrumb/index.cjs +5 -2
  14. package/dist/components/Breadcrumb/index.cjs.map +1 -1
  15. package/dist/components/Breadcrumb/index.d.ts.map +1 -1
  16. package/dist/components/Breadcrumb/index.mjs +5 -2
  17. package/dist/components/Breadcrumb/index.mjs.map +1 -1
  18. package/dist/components/ClickOutsideDiv/index.cjs +26 -0
  19. package/dist/components/ClickOutsideDiv/index.cjs.map +1 -0
  20. package/dist/components/ClickOutsideDiv/index.d.ts +6 -0
  21. package/dist/components/ClickOutsideDiv/index.d.ts.map +1 -0
  22. package/dist/components/ClickOutsideDiv/index.mjs +26 -0
  23. package/dist/components/ClickOutsideDiv/index.mjs.map +1 -0
  24. package/dist/components/ContentEditor/ContentEditorCode.cjs +78 -0
  25. package/dist/components/ContentEditor/ContentEditorCode.cjs.map +1 -0
  26. package/dist/components/ContentEditor/ContentEditorCode.d.ts +11 -0
  27. package/dist/components/ContentEditor/ContentEditorCode.d.ts.map +1 -0
  28. package/dist/components/ContentEditor/ContentEditorCode.mjs +78 -0
  29. package/dist/components/ContentEditor/ContentEditorCode.mjs.map +1 -0
  30. package/dist/components/ContentEditor/ContentEditorTextArea.cjs +30 -26
  31. package/dist/components/ContentEditor/ContentEditorTextArea.cjs.map +1 -1
  32. package/dist/components/ContentEditor/ContentEditorTextArea.d.ts +2 -1
  33. package/dist/components/ContentEditor/ContentEditorTextArea.d.ts.map +1 -1
  34. package/dist/components/ContentEditor/ContentEditorTextArea.mjs +30 -26
  35. package/dist/components/ContentEditor/ContentEditorTextArea.mjs.map +1 -1
  36. package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.cjs +3 -3
  37. package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.cjs.map +1 -1
  38. package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.mjs +3 -3
  39. package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.mjs.map +1 -1
  40. package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.cjs +4 -2
  41. package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.cjs.map +1 -1
  42. package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.d.ts +2 -0
  43. package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.d.ts.map +1 -1
  44. package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.mjs +4 -2
  45. package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.mjs.map +1 -1
  46. package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.cjs +161 -69
  47. package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.cjs.map +1 -1
  48. package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.d.ts.map +1 -1
  49. package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.mjs +163 -71
  50. package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.mjs.map +1 -1
  51. package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.cjs +123 -0
  52. package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.cjs.map +1 -1
  53. package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.d.ts +14 -0
  54. package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.d.ts.map +1 -1
  55. package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.mjs +123 -0
  56. package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.mjs.map +1 -1
  57. package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.cjs +9 -2
  58. package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.cjs.map +1 -1
  59. package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.content.cjs +15 -0
  60. package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.content.cjs.map +1 -1
  61. package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.content.d.ts +1 -0
  62. package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.content.d.ts.map +1 -1
  63. package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.content.mjs +15 -0
  64. package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.content.mjs.map +1 -1
  65. package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.d.ts +6 -0
  66. package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.d.ts.map +1 -1
  67. package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.mjs +9 -2
  68. package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.mjs.map +1 -1
  69. package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.cjs +12 -4
  70. package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.cjs.map +1 -1
  71. package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.d.ts +2 -0
  72. package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.d.ts.map +1 -1
  73. package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.mjs +12 -4
  74. package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.mjs.map +1 -1
  75. package/dist/components/DictionaryFieldEditor/EditorView/EditorView.cjs +7 -5
  76. package/dist/components/DictionaryFieldEditor/EditorView/EditorView.cjs.map +1 -1
  77. package/dist/components/DictionaryFieldEditor/EditorView/EditorView.d.ts +2 -0
  78. package/dist/components/DictionaryFieldEditor/EditorView/EditorView.d.ts.map +1 -1
  79. package/dist/components/DictionaryFieldEditor/EditorView/EditorView.mjs +7 -5
  80. package/dist/components/DictionaryFieldEditor/EditorView/EditorView.mjs.map +1 -1
  81. package/dist/components/DictionaryFieldEditor/EditorView/TextEditor.cjs +117 -55
  82. package/dist/components/DictionaryFieldEditor/EditorView/TextEditor.cjs.map +1 -1
  83. package/dist/components/DictionaryFieldEditor/EditorView/TextEditor.d.ts +4 -2
  84. package/dist/components/DictionaryFieldEditor/EditorView/TextEditor.d.ts.map +1 -1
  85. package/dist/components/DictionaryFieldEditor/EditorView/TextEditor.mjs +115 -53
  86. package/dist/components/DictionaryFieldEditor/EditorView/TextEditor.mjs.map +1 -1
  87. package/dist/components/DictionaryFieldEditor/LocaleSelector/LocaleSelector.d.ts +8 -0
  88. package/dist/components/DictionaryFieldEditor/LocaleSelector/LocaleSelector.d.ts.map +1 -0
  89. package/dist/components/DictionaryFieldEditor/LocaleSelector/LocaleSelectorContext.d.ts +13 -0
  90. package/dist/components/DictionaryFieldEditor/LocaleSelector/LocaleSelectorContext.d.ts.map +1 -0
  91. package/dist/components/DictionaryFieldEditor/LocaleSelector/localeSelector.content.d.ts +9 -0
  92. package/dist/components/DictionaryFieldEditor/LocaleSelector/localeSelector.content.d.ts.map +1 -0
  93. package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.cjs +10 -10
  94. package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.cjs.map +1 -1
  95. package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.mjs +10 -10
  96. package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.mjs.map +1 -1
  97. package/dist/components/DictionaryFieldEditor/NodeEditor.cjs +23 -10
  98. package/dist/components/DictionaryFieldEditor/NodeEditor.cjs.map +1 -1
  99. package/dist/components/DictionaryFieldEditor/NodeEditor.d.ts +2 -0
  100. package/dist/components/DictionaryFieldEditor/NodeEditor.d.ts.map +1 -1
  101. package/dist/components/DictionaryFieldEditor/NodeEditor.mjs +23 -10
  102. package/dist/components/DictionaryFieldEditor/NodeEditor.mjs.map +1 -1
  103. package/dist/components/DictionaryFieldEditor/NodeTypeSelector.cjs +1 -1
  104. package/dist/components/DictionaryFieldEditor/NodeTypeSelector.cjs.map +1 -1
  105. package/dist/components/DictionaryFieldEditor/NodeTypeSelector.mjs +1 -1
  106. package/dist/components/DictionaryFieldEditor/NodeTypeSelector.mjs.map +1 -1
  107. package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.cjs +2 -4
  108. package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.cjs.map +1 -1
  109. package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.d.ts.map +1 -1
  110. package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.mjs +3 -5
  111. package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.mjs.map +1 -1
  112. package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.cjs +13 -13
  113. package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.cjs.map +1 -1
  114. package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.mjs +13 -13
  115. package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.mjs.map +1 -1
  116. package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.cjs +73 -0
  117. package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.cjs.map +1 -0
  118. package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.d.ts +7 -0
  119. package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.d.ts.map +1 -0
  120. package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.mjs +73 -0
  121. package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.mjs.map +1 -0
  122. package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.cjs +37 -0
  123. package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.cjs.map +1 -0
  124. package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.d.ts +14 -0
  125. package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.d.ts.map +1 -0
  126. package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.mjs +37 -0
  127. package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.mjs.map +1 -0
  128. package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/index.cjs +8 -0
  129. package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/index.cjs.map +1 -0
  130. package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/index.d.ts +3 -0
  131. package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/index.d.ts.map +1 -0
  132. package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/index.mjs +8 -0
  133. package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/index.mjs.map +1 -0
  134. package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/versionSwitcherDropDown.content.cjs +54 -0
  135. package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/versionSwitcherDropDown.content.cjs.map +1 -0
  136. package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/versionSwitcherDropDown.content.d.ts +10 -0
  137. package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/versionSwitcherDropDown.content.d.ts.map +1 -0
  138. package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/versionSwitcherDropDown.content.mjs +55 -0
  139. package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/versionSwitcherDropDown.content.mjs.map +1 -0
  140. package/dist/components/DictionaryFieldEditor/index.cjs +5 -0
  141. package/dist/components/DictionaryFieldEditor/index.cjs.map +1 -1
  142. package/dist/components/DictionaryFieldEditor/index.d.ts +1 -0
  143. package/dist/components/DictionaryFieldEditor/index.d.ts.map +1 -1
  144. package/dist/components/DictionaryFieldEditor/index.mjs +6 -1
  145. package/dist/components/DictionaryFieldEditor/index.mjs.map +1 -1
  146. package/dist/components/EditableField/EditableFieldInput.cjs +5 -1
  147. package/dist/components/EditableField/EditableFieldInput.cjs.map +1 -1
  148. package/dist/components/EditableField/EditableFieldInput.d.ts.map +1 -1
  149. package/dist/components/EditableField/EditableFieldInput.mjs +6 -2
  150. package/dist/components/EditableField/EditableFieldInput.mjs.map +1 -1
  151. package/dist/components/EditableField/EditableFieldTextArea.cjs +2 -8
  152. package/dist/components/EditableField/EditableFieldTextArea.cjs.map +1 -1
  153. package/dist/components/EditableField/EditableFieldTextArea.d.ts.map +1 -1
  154. package/dist/components/EditableField/EditableFieldTextArea.mjs +2 -8
  155. package/dist/components/EditableField/EditableFieldTextArea.mjs.map +1 -1
  156. package/dist/components/Form/FormLabel.cjs +6 -2
  157. package/dist/components/Form/FormLabel.cjs.map +1 -1
  158. package/dist/components/Form/FormLabel.d.ts.map +1 -1
  159. package/dist/components/Form/FormLabel.mjs +6 -2
  160. package/dist/components/Form/FormLabel.mjs.map +1 -1
  161. package/dist/components/Form/elements/EditableFieldInputElement.d.ts +1 -1
  162. package/dist/components/Form/elements/EditableFieldInputElement.d.ts.map +1 -1
  163. package/dist/components/Form/elements/EditableFieldTextAreaElement.d.ts +1 -1
  164. package/dist/components/Form/elements/EditableFieldTextAreaElement.d.ts.map +1 -1
  165. package/dist/components/Form/elements/SelectElement.d.ts.map +1 -1
  166. package/dist/components/IDE/Code.cjs +77 -0
  167. package/dist/components/IDE/Code.cjs.map +1 -0
  168. package/dist/components/IDE/Code.d.ts +18 -0
  169. package/dist/components/IDE/Code.d.ts.map +1 -0
  170. package/dist/components/IDE/Code.mjs +77 -0
  171. package/dist/components/IDE/Code.mjs.map +1 -0
  172. package/dist/components/IDE/CodeBlock.cjs +54 -0
  173. package/dist/components/IDE/CodeBlock.cjs.map +1 -0
  174. package/dist/components/IDE/CodeBlock.d.ts +12 -0
  175. package/dist/components/IDE/CodeBlock.d.ts.map +1 -0
  176. package/dist/components/IDE/CodeBlock.mjs +54 -0
  177. package/dist/components/IDE/CodeBlock.mjs.map +1 -0
  178. package/dist/components/IDE/CodeBlockClient.cjs +55 -0
  179. package/dist/components/IDE/CodeBlockClient.cjs.map +1 -0
  180. package/dist/components/IDE/CodeBlockClient.mjs +55 -0
  181. package/dist/components/IDE/CodeBlockClient.mjs.map +1 -0
  182. package/dist/components/IDE/CodeBlockLoader.cjs +28 -0
  183. package/dist/components/IDE/CodeBlockLoader.cjs.map +1 -0
  184. package/dist/components/IDE/CodeBlockLoader.d.ts +4 -0
  185. package/dist/components/IDE/CodeBlockLoader.d.ts.map +1 -0
  186. package/dist/components/IDE/CodeBlockLoader.mjs +28 -0
  187. package/dist/components/IDE/CodeBlockLoader.mjs.map +1 -0
  188. package/dist/components/IDE/CodeBlockServer.cjs +53 -0
  189. package/dist/components/IDE/CodeBlockServer.cjs.map +1 -0
  190. package/dist/components/IDE/CodeBlockServer.d.ts +12 -0
  191. package/dist/components/IDE/CodeBlockServer.d.ts.map +1 -0
  192. package/dist/components/IDE/CodeBlockServer.mjs +53 -0
  193. package/dist/components/IDE/CodeBlockServer.mjs.map +1 -0
  194. package/dist/components/IDE/CodeBlockShiki.d.ts +3 -0
  195. package/dist/components/IDE/CodeBlockShiki.d.ts.map +1 -0
  196. package/dist/components/IDE/CodeBlockclient.d.ts +12 -0
  197. package/dist/components/IDE/CodeBlockclient.d.ts.map +1 -0
  198. package/dist/components/IDE/CodeConditionalRenderer.cjs +20 -0
  199. package/dist/components/IDE/CodeConditionalRenderer.cjs.map +1 -0
  200. package/dist/components/IDE/CodeConditionalRenderer.d.ts +4 -0
  201. package/dist/components/IDE/CodeConditionalRenderer.d.ts.map +1 -0
  202. package/dist/components/IDE/CodeConditionalRenderer.mjs +20 -0
  203. package/dist/components/IDE/CodeConditionalRenderer.mjs.map +1 -0
  204. package/dist/components/IDE/CodeContext.cjs +57 -0
  205. package/dist/components/IDE/CodeContext.cjs.map +1 -0
  206. package/dist/components/IDE/CodeContext.d.ts +26 -0
  207. package/dist/components/IDE/CodeContext.d.ts.map +1 -0
  208. package/dist/components/IDE/CodeContext.mjs +57 -0
  209. package/dist/components/IDE/CodeContext.mjs.map +1 -0
  210. package/dist/components/IDE/CodeFormatSelector.cjs +30 -0
  211. package/dist/components/IDE/CodeFormatSelector.cjs.map +1 -0
  212. package/dist/components/IDE/CodeFormatSelector.d.ts +3 -0
  213. package/dist/components/IDE/CodeFormatSelector.d.ts.map +1 -0
  214. package/dist/components/IDE/CodeFormatSelector.mjs +30 -0
  215. package/dist/components/IDE/CodeFormatSelector.mjs.map +1 -0
  216. package/dist/components/IDE/CodeRenderer.cjs +27 -0
  217. package/dist/components/IDE/CodeRenderer.cjs.map +1 -0
  218. package/dist/components/IDE/CodeRenderer.d.ts +5 -0
  219. package/dist/components/IDE/CodeRenderer.d.ts.map +1 -0
  220. package/dist/components/IDE/CodeRenderer.mjs +27 -0
  221. package/dist/components/IDE/CodeRenderer.mjs.map +1 -0
  222. package/dist/components/IDE/ContentDeclarationFormatSelector.cjs +28 -0
  223. package/dist/components/IDE/ContentDeclarationFormatSelector.cjs.map +1 -0
  224. package/dist/components/IDE/ContentDeclarationFormatSelector.d.ts +3 -0
  225. package/dist/components/IDE/ContentDeclarationFormatSelector.d.ts.map +1 -0
  226. package/dist/components/IDE/ContentDeclarationFormatSelector.mjs +28 -0
  227. package/dist/components/IDE/ContentDeclarationFormatSelector.mjs.map +1 -0
  228. package/dist/components/IDE/EditableCodeBlock.d.ts +9 -0
  229. package/dist/components/IDE/EditableCodeBlock.d.ts.map +1 -0
  230. package/dist/components/IDE/MarkDownRender.cjs +2 -3
  231. package/dist/components/IDE/MarkDownRender.cjs.map +1 -1
  232. package/dist/components/IDE/MarkDownRender.d.ts.map +1 -1
  233. package/dist/components/IDE/MarkDownRender.mjs +1 -2
  234. package/dist/components/IDE/MarkDownRender.mjs.map +1 -1
  235. package/dist/components/IDE/PackageManagerSelector.cjs +20 -0
  236. package/dist/components/IDE/PackageManagerSelector.cjs.map +1 -0
  237. package/dist/components/IDE/PackageManagerSelector.d.ts +3 -0
  238. package/dist/components/IDE/PackageManagerSelector.d.ts.map +1 -0
  239. package/dist/components/IDE/PackageManagerSelector.mjs +20 -0
  240. package/dist/components/IDE/PackageManagerSelector.mjs.map +1 -0
  241. package/dist/components/IDE/index.cjs +2 -2
  242. package/dist/components/IDE/index.d.ts +1 -1
  243. package/dist/components/IDE/index.d.ts.map +1 -1
  244. package/dist/components/IDE/index.mjs +1 -1
  245. package/dist/components/LocaleSwitcherContentDropDown/LocaleSelectorContext.d.ts +13 -0
  246. package/dist/components/LocaleSwitcherContentDropDown/LocaleSelectorContext.d.ts.map +1 -0
  247. package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.cjs +218 -0
  248. package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.cjs.map +1 -0
  249. package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.d.ts +8 -0
  250. package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.d.ts.map +1 -0
  251. package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.mjs +218 -0
  252. package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.mjs.map +1 -0
  253. package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.cjs +42 -0
  254. package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.cjs.map +1 -0
  255. package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.d.ts +15 -0
  256. package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.d.ts.map +1 -0
  257. package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.mjs +42 -0
  258. package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.mjs.map +1 -0
  259. package/dist/components/LocaleSwitcherContentDropDown/index.cjs +8 -0
  260. package/dist/components/LocaleSwitcherContentDropDown/index.cjs.map +1 -0
  261. package/dist/components/LocaleSwitcherContentDropDown/index.d.ts +3 -0
  262. package/dist/components/LocaleSwitcherContentDropDown/index.d.ts.map +1 -0
  263. package/dist/components/LocaleSwitcherContentDropDown/index.mjs +8 -0
  264. package/dist/components/LocaleSwitcherContentDropDown/index.mjs.map +1 -0
  265. package/dist/components/LocaleSwitcherContentDropDown/localeSwitcher.content.cjs +118 -0
  266. package/dist/components/LocaleSwitcherContentDropDown/localeSwitcher.content.cjs.map +1 -0
  267. package/dist/components/LocaleSwitcherContentDropDown/localeSwitcher.content.d.ts +18 -0
  268. package/dist/components/LocaleSwitcherContentDropDown/localeSwitcher.content.d.ts.map +1 -0
  269. package/dist/components/LocaleSwitcherContentDropDown/localeSwitcher.content.mjs +119 -0
  270. package/dist/components/LocaleSwitcherContentDropDown/localeSwitcher.content.mjs.map +1 -0
  271. package/dist/components/LocaleSwitcherDropDown/LocaleSwitcher.cjs +14 -22
  272. package/dist/components/LocaleSwitcherDropDown/LocaleSwitcher.cjs.map +1 -1
  273. package/dist/components/LocaleSwitcherDropDown/LocaleSwitcher.d.ts.map +1 -1
  274. package/dist/components/LocaleSwitcherDropDown/LocaleSwitcher.mjs +14 -22
  275. package/dist/components/LocaleSwitcherDropDown/LocaleSwitcher.mjs.map +1 -1
  276. package/dist/components/MarkDownRender/index.cjs +20 -26
  277. package/dist/components/MarkDownRender/index.cjs.map +1 -1
  278. package/dist/components/MarkDownRender/index.d.ts +2 -0
  279. package/dist/components/MarkDownRender/index.d.ts.map +1 -1
  280. package/dist/components/MarkDownRender/index.mjs +20 -26
  281. package/dist/components/MarkDownRender/index.mjs.map +1 -1
  282. package/dist/components/Modal/Modal.cjs +3 -3
  283. package/dist/components/Modal/Modal.cjs.map +1 -1
  284. package/dist/components/Modal/Modal.d.ts +1 -1
  285. package/dist/components/Modal/Modal.d.ts.map +1 -1
  286. package/dist/components/Modal/Modal.mjs +3 -3
  287. package/dist/components/Modal/Modal.mjs.map +1 -1
  288. package/dist/components/SwitchSelector/index.cjs +4 -0
  289. package/dist/components/SwitchSelector/index.cjs.map +1 -1
  290. package/dist/components/SwitchSelector/index.d.ts.map +1 -1
  291. package/dist/components/SwitchSelector/index.mjs +5 -1
  292. package/dist/components/SwitchSelector/index.mjs.map +1 -1
  293. package/dist/components/index.cjs +16 -4
  294. package/dist/components/index.cjs.map +1 -1
  295. package/dist/components/index.d.ts +3 -1
  296. package/dist/components/index.d.ts.map +1 -1
  297. package/dist/components/index.mjs +15 -3
  298. package/dist/components/index.mjs.map +1 -1
  299. package/dist/hooks/index.cjs +8 -1
  300. package/dist/hooks/index.cjs.map +1 -1
  301. package/dist/hooks/index.mjs +9 -2
  302. package/dist/hooks/intlayerAPIHooks.cjs +80 -5
  303. package/dist/hooks/intlayerAPIHooks.cjs.map +1 -1
  304. package/dist/hooks/intlayerAPIHooks.d.ts +12 -2
  305. package/dist/hooks/intlayerAPIHooks.d.ts.map +1 -1
  306. package/dist/hooks/intlayerAPIHooks.mjs +80 -5
  307. package/dist/hooks/intlayerAPIHooks.mjs.map +1 -1
  308. package/dist/hooks/useAsync/useAsyncStateStore.cjs +1 -5
  309. package/dist/hooks/useAsync/useAsyncStateStore.cjs.map +1 -1
  310. package/dist/hooks/useAsync/useAsyncStateStore.d.ts.map +1 -1
  311. package/dist/hooks/useAsync/useAsyncStateStore.mjs +1 -5
  312. package/dist/hooks/useAsync/useAsyncStateStore.mjs.map +1 -1
  313. package/dist/hooks/useGetAllDictionaries.cjs +4 -2
  314. package/dist/hooks/useGetAllDictionaries.cjs.map +1 -1
  315. package/dist/hooks/useGetAllDictionaries.d.ts +4 -1
  316. package/dist/hooks/useGetAllDictionaries.d.ts.map +1 -1
  317. package/dist/hooks/useGetAllDictionaries.mjs +4 -2
  318. package/dist/hooks/useGetAllDictionaries.mjs.map +1 -1
  319. package/dist/hooks/useIntlayerAPI.d.ts +11 -2
  320. package/dist/hooks/useIntlayerAPI.d.ts.map +1 -1
  321. package/dist/hooks/usePersistedStore.cjs +17 -5
  322. package/dist/hooks/usePersistedStore.cjs.map +1 -1
  323. package/dist/hooks/usePersistedStore.d.ts.map +1 -1
  324. package/dist/hooks/usePersistedStore.mjs +17 -5
  325. package/dist/hooks/usePersistedStore.mjs.map +1 -1
  326. package/dist/libs/intlayer-api/ai.cjs +33 -3
  327. package/dist/libs/intlayer-api/ai.cjs.map +1 -1
  328. package/dist/libs/intlayer-api/ai.d.ts +9 -3
  329. package/dist/libs/intlayer-api/ai.d.ts.map +1 -1
  330. package/dist/libs/intlayer-api/ai.mjs +33 -3
  331. package/dist/libs/intlayer-api/ai.mjs.map +1 -1
  332. package/dist/libs/intlayer-api/dictionary.cjs +2 -2
  333. package/dist/libs/intlayer-api/dictionary.cjs.map +1 -1
  334. package/dist/libs/intlayer-api/dictionary.d.ts +3 -3
  335. package/dist/libs/intlayer-api/dictionary.d.ts.map +1 -1
  336. package/dist/libs/intlayer-api/dictionary.mjs +2 -2
  337. package/dist/libs/intlayer-api/dictionary.mjs.map +1 -1
  338. package/dist/libs/intlayer-api/index.cjs +3 -1
  339. package/dist/libs/intlayer-api/index.cjs.map +1 -1
  340. package/dist/libs/intlayer-api/index.d.ts +22 -4
  341. package/dist/libs/intlayer-api/index.d.ts.map +1 -1
  342. package/dist/libs/intlayer-api/index.mjs +3 -1
  343. package/dist/libs/intlayer-api/index.mjs.map +1 -1
  344. package/dist/libs/intlayer-api/tag.cjs +52 -0
  345. package/dist/libs/intlayer-api/tag.cjs.map +1 -0
  346. package/dist/libs/intlayer-api/tag.d.ts +16 -0
  347. package/dist/libs/intlayer-api/tag.d.ts.map +1 -0
  348. package/dist/libs/intlayer-api/tag.mjs +52 -0
  349. package/dist/libs/intlayer-api/tag.mjs.map +1 -0
  350. package/dist/tailwind.css +1 -1
  351. package/package.json +13 -14
@@ -80,7 +80,7 @@ const NavigationViewNode = ({
80
80
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
81
81
  Button,
82
82
  {
83
- label: `${goToTranslation.label.value} ${translationKey}`,
83
+ label: `${goToTranslation.label} ${translationKey}`,
84
84
  isActive: getIsSelected(childKeyPath),
85
85
  variant: "hoverable",
86
86
  color: "text",
@@ -96,7 +96,7 @@ const NavigationViewNode = ({
96
96
  Accordion,
97
97
  {
98
98
  identifier: translationKey,
99
- label: `${goToTranslation.label.value} ${translationKey}`,
99
+ label: `${goToTranslation.label} ${translationKey}`,
100
100
  isActive: getIsSelected(childKeyPath),
101
101
  onClick: () => setFocusedContentKeyPath(childKeyPath),
102
102
  header: translationKey,
@@ -130,7 +130,7 @@ const NavigationViewNode = ({
130
130
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
131
131
  Button,
132
132
  {
133
- label: `${goToEnumeration.label.value} ${key}`,
133
+ label: `${goToEnumeration.label} ${key}`,
134
134
  isActive: getIsSelected(childKeyPath),
135
135
  variant: "hoverable",
136
136
  color: "text",
@@ -146,7 +146,7 @@ const NavigationViewNode = ({
146
146
  Accordion,
147
147
  {
148
148
  identifier: key,
149
- label: `${goToEnumeration.label.value} ${key}`,
149
+ label: `${goToEnumeration.label} ${key}`,
150
150
  isActive: getIsSelected(childKeyPath),
151
151
  onClick: () => setFocusedContentKeyPath(childKeyPath),
152
152
  header: key,
@@ -175,7 +175,7 @@ const NavigationViewNode = ({
175
175
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
176
176
  Button,
177
177
  {
178
- label: `${goToElement.label.value} ${index}`,
178
+ label: `${goToElement.label} ${index}`,
179
179
  isActive: getIsSelected(childKeyPath),
180
180
  variant: "hoverable",
181
181
  color: "text",
@@ -191,7 +191,7 @@ const NavigationViewNode = ({
191
191
  Accordion,
192
192
  {
193
193
  identifier: `${index}`,
194
- label: `${goToElement.label.value} ${index}`,
194
+ label: `${goToElement.label} ${index}`,
195
195
  isActive: getIsSelected(childKeyPath),
196
196
  onClick: () => setFocusedContentKeyPath(childKeyPath),
197
197
  header: index,
@@ -210,7 +210,7 @@ const NavigationViewNode = ({
210
210
  /* @__PURE__ */ jsxRuntimeExports.jsx(
211
211
  Button,
212
212
  {
213
- label: addNewElement.label.value,
213
+ label: addNewElement.label,
214
214
  variant: "hoverable",
215
215
  color: "neutral",
216
216
  textAlign: "left",
@@ -247,7 +247,7 @@ const NavigationViewNode = ({
247
247
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
248
248
  Button,
249
249
  {
250
- label: `${goToField.label.value} ${key}`,
250
+ label: `${goToField.label} ${key}`,
251
251
  isActive: getIsSelected(childKeyPath),
252
252
  variant: "hoverable",
253
253
  color: "text",
@@ -263,7 +263,7 @@ const NavigationViewNode = ({
263
263
  Accordion,
264
264
  {
265
265
  identifier: key,
266
- label: `${goToField.label.value} ${key}`,
266
+ label: `${goToField.label} ${key}`,
267
267
  isActive: getIsSelected(childKeyPath),
268
268
  onClick: () => setFocusedContentKeyPath(childKeyPath),
269
269
  header: camelCaseToSentence(key),
@@ -282,7 +282,7 @@ const NavigationViewNode = ({
282
282
  /* @__PURE__ */ jsxRuntimeExports.jsx(
283
283
  Button,
284
284
  {
285
- label: addNewField.label.value,
285
+ label: addNewField.label,
286
286
  variant: "hoverable",
287
287
  color: "neutral",
288
288
  textAlign: "left",
@@ -1 +1 @@
1
- {"version":3,"file":"NavigationViewNode.mjs","sources":["../../../../src/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.tsx"],"sourcesContent":["import { getConfiguration } from '@intlayer/config/client';\nimport {\n type EnumerationContent,\n NodeType,\n type KeyPath,\n type DictionaryValue,\n isSameKeyPath,\n} from '@intlayer/core';\nimport { ChevronRight, Plus } from 'lucide-react';\nimport { useCallback, type FC } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { useShallow } from 'zustand/react/shallow';\nimport { camelCaseToSentence } from '../../../utils/camelCase';\nimport {\n getDictionaryValueByKeyPath,\n getSectionType,\n} from '../../../utils/dictionary';\nimport { Accordion } from '../../Accordion';\nimport { Button } from '../../Button';\nimport {\n useEditedContentStore,\n useEditionPanelStore,\n} from '../../DictionaryEditor';\nimport { getIsEditableSection } from '../getIsEditableSection';\nimport { navigationViewContent } from './navigationViewNode.content';\n\nexport const traceKeys: string[] = ['filePath', 'id', 'nodeType'];\n\nexport type NodeWrapperProps = {\n dictionaryKey: string;\n keyPath: KeyPath[];\n section: DictionaryValue;\n};\n\nexport const NavigationViewNode: FC<NodeWrapperProps> = ({\n section: sectionProp,\n keyPath,\n dictionaryKey,\n}) => {\n const { locales } = getConfiguration().internationalization;\n const section = getDictionaryValueByKeyPath(sectionProp, keyPath);\n const addEditedContent = useEditedContentStore(\n useShallow((s) => s.addEditedContent)\n );\n const { setFocusedContentKeyPath, focusedContent } = useEditionPanelStore(\n useShallow((s) => ({\n setFocusedContentKeyPath: s.setFocusedContentKeyPath,\n focusedContent: s.focusedContent,\n }))\n );\n const {\n addNewElement,\n addNewField,\n goToElement,\n goToField,\n goToEnumeration,\n goToTranslation,\n } = useDictionary(navigationViewContent);\n const nodeType = getSectionType(section);\n const isEditableSection = getIsEditableSection(section);\n const getIsSelected = useCallback(\n (keyPath: KeyPath[]) =>\n (focusedContent?.keyPath?.length ?? 0) > 0 &&\n isSameKeyPath(keyPath, focusedContent?.keyPath ?? []),\n [focusedContent?.keyPath]\n );\n\n if (isEditableSection) return <>-</>;\n\n if (!section) return <>-</>;\n\n if (typeof section === 'object') {\n if (nodeType === NodeType.ReactNode) {\n return <>React Node</>;\n }\n\n if (nodeType === NodeType.Translation) {\n return (\n <div className=\"flex flex-col justify-between gap-2\">\n {locales.map((translationKey) => {\n const childKeyPath: KeyPath[] = [\n ...keyPath,\n { type: NodeType.Translation, key: translationKey },\n ];\n const subSection = getDictionaryValueByKeyPath(\n sectionProp,\n childKeyPath\n );\n const isEditableSubSection = getIsEditableSection(subSection);\n\n if (isEditableSubSection) {\n return (\n <Button\n label={`${goToTranslation.label.value} ${translationKey}`}\n key={translationKey}\n isActive={getIsSelected(childKeyPath)}\n variant=\"hoverable\"\n color=\"text\"\n className=\"w-full\"\n onClick={() => setFocusedContentKeyPath(childKeyPath)}\n IconRight={ChevronRight}\n >\n {translationKey}\n </Button>\n );\n }\n\n return (\n <Accordion\n key={translationKey}\n identifier={translationKey}\n label={`${goToTranslation.label.value} ${translationKey}`}\n isActive={getIsSelected(childKeyPath)}\n onClick={() => setFocusedContentKeyPath(childKeyPath)}\n header={translationKey}\n >\n <div className=\"flex w-full max-w-full\">\n <div className=\"flex-1 pl-10\">\n <NavigationViewNode\n keyPath={childKeyPath}\n section={sectionProp}\n dictionaryKey={dictionaryKey}\n />\n </div>\n </div>\n </Accordion>\n );\n })}\n </div>\n );\n }\n\n if (nodeType === NodeType.Enumeration) {\n return (\n <div className=\"flex flex-col justify-between gap-2\">\n {Object.keys(\n (section as EnumerationContent<DictionaryValue>)[\n NodeType.Enumeration\n ]\n ).map((key) => {\n const childKeyPath: KeyPath[] = [\n ...keyPath,\n { type: NodeType.Enumeration, key },\n ];\n const subSection = getDictionaryValueByKeyPath(\n sectionProp,\n childKeyPath\n );\n const isEditableSubSection = getIsEditableSection(subSection);\n\n if (isEditableSubSection) {\n return (\n <Button\n label={`${goToEnumeration.label.value} ${key}`}\n key={key}\n isActive={getIsSelected(childKeyPath)}\n variant=\"hoverable\"\n color=\"text\"\n className=\"w-full\"\n onClick={() => setFocusedContentKeyPath(childKeyPath)}\n IconRight={ChevronRight}\n >\n {key}\n </Button>\n );\n }\n\n return (\n <Accordion\n key={key}\n identifier={key}\n label={`${goToEnumeration.label.value} ${key}`}\n isActive={getIsSelected(childKeyPath)}\n onClick={() => setFocusedContentKeyPath(childKeyPath)}\n header={key}\n >\n <div className=\"flex w-full max-w-full\">\n <div className=\"flex-1 pl-10\">\n <NavigationViewNode\n keyPath={childKeyPath}\n section={sectionProp}\n dictionaryKey={dictionaryKey}\n />\n </div>\n </div>\n </Accordion>\n );\n })}\n </div>\n );\n }\n\n if (nodeType === NodeType.Array) {\n return (\n <div className=\"flex flex-col justify-between gap-2\">\n {(section as DictionaryValue[]).map((subSection, index) => {\n const childKeyPath: KeyPath[] = [\n ...keyPath,\n { type: NodeType.Array, key: index },\n ];\n\n const isEditableSubSection = getIsEditableSection(subSection);\n\n if (isEditableSubSection) {\n return (\n <Button\n label={`${goToElement.label.value} ${index}`}\n key={`${index}`}\n isActive={getIsSelected(childKeyPath)}\n variant=\"hoverable\"\n color=\"text\"\n className=\"w-full\"\n onClick={() => setFocusedContentKeyPath(childKeyPath)}\n IconRight={ChevronRight}\n >\n {index}\n </Button>\n );\n }\n\n return (\n <Accordion\n key={`${index}`}\n identifier={`${index}`}\n label={`${goToElement.label.value} ${index}`}\n isActive={getIsSelected(childKeyPath)}\n onClick={() => setFocusedContentKeyPath(childKeyPath)}\n header={index}\n >\n <div className=\"flex w-full max-w-full\">\n <div className=\"flex-1 pl-10\">\n <NavigationViewNode\n keyPath={childKeyPath}\n section={sectionProp}\n dictionaryKey={dictionaryKey}\n />\n </div>\n </div>\n </Accordion>\n );\n })}\n\n <Button\n label={addNewElement.label.value}\n variant=\"hoverable\"\n color=\"neutral\"\n textAlign=\"left\"\n onClick={() => {\n const newKeyPath: KeyPath[] = [\n ...keyPath,\n {\n type: NodeType.Array,\n key: (section as DictionaryValue[]).length,\n },\n ];\n addEditedContent(dictionaryKey, {}, newKeyPath, false);\n setFocusedContentKeyPath(newKeyPath);\n }}\n Icon={Plus}\n >\n {addNewElement.text}\n </Button>\n </div>\n );\n }\n\n const sectionArray = Object.keys(section);\n return (\n <div className=\"flex w-full max-w-full flex-col justify-between gap-2\">\n {sectionArray.map((key) => {\n const childKeyPath: KeyPath[] = [\n ...keyPath,\n { type: NodeType.Object, key },\n ];\n const subSection = getDictionaryValueByKeyPath(\n sectionProp,\n childKeyPath\n );\n const isEditableSubSection = getIsEditableSection(subSection);\n\n if (isEditableSubSection) {\n return (\n <Button\n label={`${goToField.label.value} ${key}`}\n key={key}\n isActive={getIsSelected(childKeyPath)}\n variant=\"hoverable\"\n color=\"text\"\n className=\"w-full\"\n onClick={() => setFocusedContentKeyPath(childKeyPath)}\n IconRight={ChevronRight}\n >\n {camelCaseToSentence(key)}\n </Button>\n );\n }\n\n return (\n <Accordion\n key={key}\n identifier={key}\n label={`${goToField.label.value} ${key}`}\n isActive={getIsSelected(childKeyPath)}\n onClick={() => setFocusedContentKeyPath(childKeyPath)}\n header={camelCaseToSentence(key)}\n >\n <div className=\"flex w-full max-w-full\">\n <div className=\"flex-1 pl-10\">\n <NavigationViewNode\n keyPath={childKeyPath}\n section={sectionProp}\n dictionaryKey={dictionaryKey}\n />\n </div>\n </div>\n </Accordion>\n );\n })}\n\n <Button\n label={addNewField.label.value}\n variant=\"hoverable\"\n color=\"neutral\"\n textAlign=\"left\"\n onClick={() => {\n const newKeyPath: KeyPath[] = [\n ...keyPath,\n { type: NodeType.Object, key: 'newField' },\n ];\n addEditedContent(dictionaryKey, {}, newKeyPath, false);\n setFocusedContentKeyPath(newKeyPath);\n }}\n Icon={Plus}\n >\n {addNewField.text}\n </Button>\n </div>\n );\n }\n\n return (\n <>\n Error loading section --\n {nodeType}\n --\n {JSON.stringify(section)}\n --\n {JSON.stringify(keyPath)}\n </>\n );\n};\n"],"names":["keyPath","jsx","Fragment","jsxs"],"mappings":";;;;;;;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AC5B,GAAG;AAAA,cACH,EAAE,MAAM,SAAS,QAAQ,KAAK,WAAW;AAAA,YAC3C;AACA,6BAAiB,eAAe,IAAI,YAAY,KAAK;AACrD,qCAAyB,UAAU;AAAA,UACrC;AAAA,UACA,MAAM;AAAA,UAEL,UAAY,YAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IACf,GACF;AAAA,EAAA;AAIJ,SACIE,kCAAA,KAAAD,4BAAA,EAAA,UAAA;AAAA,IAAA;AAAA,IAEC;AAAA,IAAS;AAAA,IAET,KAAK,UAAU,OAAO;AAAA,IAAE;AAAA,IAExB,KAAK,UAAU,OAAO;AAAA,EAAA,GACzB;AAEJ;"}
1
+ {"version":3,"file":"NavigationViewNode.mjs","sources":["../../../../src/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.tsx"],"sourcesContent":["import { getConfiguration } from '@intlayer/config/client';\nimport {\n type EnumerationContent,\n NodeType,\n type KeyPath,\n type DictionaryValue,\n isSameKeyPath,\n} from '@intlayer/core';\nimport { ChevronRight, Plus } from 'lucide-react';\nimport { useCallback, type FC } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { useShallow } from 'zustand/react/shallow';\nimport { camelCaseToSentence } from '../../../utils/camelCase';\nimport {\n getDictionaryValueByKeyPath,\n getSectionType,\n} from '../../../utils/dictionary';\nimport { Accordion } from '../../Accordion';\nimport { Button } from '../../Button';\nimport {\n useEditedContentStore,\n useEditionPanelStore,\n} from '../../DictionaryEditor';\nimport { getIsEditableSection } from '../getIsEditableSection';\nimport { navigationViewContent } from './navigationViewNode.content';\n\nexport const traceKeys: string[] = ['filePath', 'id', 'nodeType'];\n\nexport type NodeWrapperProps = {\n dictionaryKey: string;\n keyPath: KeyPath[];\n section: DictionaryValue;\n};\n\nexport const NavigationViewNode: FC<NodeWrapperProps> = ({\n section: sectionProp,\n keyPath,\n dictionaryKey,\n}) => {\n const { locales } = getConfiguration().internationalization;\n const section = getDictionaryValueByKeyPath(sectionProp, keyPath);\n const addEditedContent = useEditedContentStore(\n useShallow((s) => s.addEditedContent)\n );\n const { setFocusedContentKeyPath, focusedContent } = useEditionPanelStore(\n useShallow((s) => ({\n setFocusedContentKeyPath: s.setFocusedContentKeyPath,\n focusedContent: s.focusedContent,\n }))\n );\n const {\n addNewElement,\n addNewField,\n goToElement,\n goToField,\n goToEnumeration,\n goToTranslation,\n } = useDictionary(navigationViewContent);\n const nodeType = getSectionType(section);\n const isEditableSection = getIsEditableSection(section);\n const getIsSelected = useCallback(\n (keyPath: KeyPath[]) =>\n (focusedContent?.keyPath?.length ?? 0) > 0 &&\n isSameKeyPath(keyPath, focusedContent?.keyPath ?? []),\n [focusedContent?.keyPath]\n );\n\n if (isEditableSection) return <>-</>;\n\n if (!section) return <>-</>;\n\n if (typeof section === 'object') {\n if (nodeType === NodeType.ReactNode) {\n return <>React Node</>;\n }\n\n if (nodeType === NodeType.Translation) {\n return (\n <div className=\"flex flex-col justify-between gap-2\">\n {locales.map((translationKey) => {\n const childKeyPath: KeyPath[] = [\n ...keyPath,\n { type: NodeType.Translation, key: translationKey },\n ];\n const subSection = getDictionaryValueByKeyPath(\n sectionProp,\n childKeyPath\n );\n const isEditableSubSection = getIsEditableSection(subSection);\n\n if (isEditableSubSection) {\n return (\n <Button\n label={`${goToTranslation.label} ${translationKey}`}\n key={translationKey}\n isActive={getIsSelected(childKeyPath)}\n variant=\"hoverable\"\n color=\"text\"\n className=\"w-full\"\n onClick={() => setFocusedContentKeyPath(childKeyPath)}\n IconRight={ChevronRight}\n >\n {translationKey}\n </Button>\n );\n }\n\n return (\n <Accordion\n key={translationKey}\n identifier={translationKey}\n label={`${goToTranslation.label} ${translationKey}`}\n isActive={getIsSelected(childKeyPath)}\n onClick={() => setFocusedContentKeyPath(childKeyPath)}\n header={translationKey}\n >\n <div className=\"flex w-full max-w-full\">\n <div className=\"flex-1 pl-10\">\n <NavigationViewNode\n keyPath={childKeyPath}\n section={sectionProp}\n dictionaryKey={dictionaryKey}\n />\n </div>\n </div>\n </Accordion>\n );\n })}\n </div>\n );\n }\n\n if (nodeType === NodeType.Enumeration) {\n return (\n <div className=\"flex flex-col justify-between gap-2\">\n {Object.keys(\n (section as EnumerationContent<DictionaryValue>)[\n NodeType.Enumeration\n ]\n ).map((key) => {\n const childKeyPath: KeyPath[] = [\n ...keyPath,\n { type: NodeType.Enumeration, key },\n ];\n const subSection = getDictionaryValueByKeyPath(\n sectionProp,\n childKeyPath\n );\n const isEditableSubSection = getIsEditableSection(subSection);\n\n if (isEditableSubSection) {\n return (\n <Button\n label={`${goToEnumeration.label} ${key}`}\n key={key}\n isActive={getIsSelected(childKeyPath)}\n variant=\"hoverable\"\n color=\"text\"\n className=\"w-full\"\n onClick={() => setFocusedContentKeyPath(childKeyPath)}\n IconRight={ChevronRight}\n >\n {key}\n </Button>\n );\n }\n\n return (\n <Accordion\n key={key}\n identifier={key}\n label={`${goToEnumeration.label} ${key}`}\n isActive={getIsSelected(childKeyPath)}\n onClick={() => setFocusedContentKeyPath(childKeyPath)}\n header={key}\n >\n <div className=\"flex w-full max-w-full\">\n <div className=\"flex-1 pl-10\">\n <NavigationViewNode\n keyPath={childKeyPath}\n section={sectionProp}\n dictionaryKey={dictionaryKey}\n />\n </div>\n </div>\n </Accordion>\n );\n })}\n </div>\n );\n }\n\n if (nodeType === NodeType.Array) {\n return (\n <div className=\"flex flex-col justify-between gap-2\">\n {(section as DictionaryValue[]).map((subSection, index) => {\n const childKeyPath: KeyPath[] = [\n ...keyPath,\n { type: NodeType.Array, key: index },\n ];\n\n const isEditableSubSection = getIsEditableSection(subSection);\n\n if (isEditableSubSection) {\n return (\n <Button\n label={`${goToElement.label} ${index}`}\n key={`${index}`}\n isActive={getIsSelected(childKeyPath)}\n variant=\"hoverable\"\n color=\"text\"\n className=\"w-full\"\n onClick={() => setFocusedContentKeyPath(childKeyPath)}\n IconRight={ChevronRight}\n >\n {index}\n </Button>\n );\n }\n\n return (\n <Accordion\n key={`${index}`}\n identifier={`${index}`}\n label={`${goToElement.label} ${index}`}\n isActive={getIsSelected(childKeyPath)}\n onClick={() => setFocusedContentKeyPath(childKeyPath)}\n header={index}\n >\n <div className=\"flex w-full max-w-full\">\n <div className=\"flex-1 pl-10\">\n <NavigationViewNode\n keyPath={childKeyPath}\n section={sectionProp}\n dictionaryKey={dictionaryKey}\n />\n </div>\n </div>\n </Accordion>\n );\n })}\n\n <Button\n label={addNewElement.label}\n variant=\"hoverable\"\n color=\"neutral\"\n textAlign=\"left\"\n onClick={() => {\n const newKeyPath: KeyPath[] = [\n ...keyPath,\n {\n type: NodeType.Array,\n key: (section as DictionaryValue[]).length,\n },\n ];\n addEditedContent(dictionaryKey, {}, newKeyPath, false);\n setFocusedContentKeyPath(newKeyPath);\n }}\n Icon={Plus}\n >\n {addNewElement.text}\n </Button>\n </div>\n );\n }\n\n const sectionArray = Object.keys(section);\n return (\n <div className=\"flex w-full max-w-full flex-col justify-between gap-2\">\n {sectionArray.map((key) => {\n const childKeyPath: KeyPath[] = [\n ...keyPath,\n { type: NodeType.Object, key },\n ];\n const subSection = getDictionaryValueByKeyPath(\n sectionProp,\n childKeyPath\n );\n const isEditableSubSection = getIsEditableSection(subSection);\n\n if (isEditableSubSection) {\n return (\n <Button\n label={`${goToField.label} ${key}`}\n key={key}\n isActive={getIsSelected(childKeyPath)}\n variant=\"hoverable\"\n color=\"text\"\n className=\"w-full\"\n onClick={() => setFocusedContentKeyPath(childKeyPath)}\n IconRight={ChevronRight}\n >\n {camelCaseToSentence(key)}\n </Button>\n );\n }\n\n return (\n <Accordion\n key={key}\n identifier={key}\n label={`${goToField.label} ${key}`}\n isActive={getIsSelected(childKeyPath)}\n onClick={() => setFocusedContentKeyPath(childKeyPath)}\n header={camelCaseToSentence(key)}\n >\n <div className=\"flex w-full max-w-full\">\n <div className=\"flex-1 pl-10\">\n <NavigationViewNode\n keyPath={childKeyPath}\n section={sectionProp}\n dictionaryKey={dictionaryKey}\n />\n </div>\n </div>\n </Accordion>\n );\n })}\n\n <Button\n label={addNewField.label}\n variant=\"hoverable\"\n color=\"neutral\"\n textAlign=\"left\"\n onClick={() => {\n const newKeyPath: KeyPath[] = [\n ...keyPath,\n { type: NodeType.Object, key: 'newField' },\n ];\n addEditedContent(dictionaryKey, {}, newKeyPath, false);\n setFocusedContentKeyPath(newKeyPath);\n }}\n Icon={Plus}\n >\n {addNewField.text}\n </Button>\n </div>\n );\n }\n\n return (\n <>\n Error loading section --\n {nodeType}\n --\n {JSON.stringify(section)}\n --\n {JSON.stringify(keyPath)}\n </>\n );\n};\n"],"names":["keyPath","jsx","Fragment","jsxs"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BO,MAAM,YAAsB,CAAC,YAAY,MAAM,UAAU;AAQzD,MAAM,qBAA2C,CAAC;AAAA,EACvD,SAAS;AAAA,EACT;AAAA,EACA;AACF,MAAM;AACJ,QAAM,EAAE,QAAA,IAAY,iBAAA,EAAmB;AACjC,QAAA,UAAU,4BAA4B,aAAa,OAAO;AAChE,QAAM,mBAAmB;AAAA,IACvB,WAAW,CAAC,MAAM,EAAE,gBAAgB;AAAA,EACtC;AACM,QAAA,EAAE,0BAA0B,eAAA,IAAmB;AAAA,IACnD,WAAW,CAAC,OAAO;AAAA,MACjB,0BAA0B,EAAE;AAAA,MAC5B,gBAAgB,EAAE;AAAA,IAAA,EAClB;AAAA,EACJ;AACM,QAAA;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA,IACE,cAAc,qBAAqB;AACjC,QAAA,WAAW,eAAe,OAAO;AACjC,QAAA,oBAAoB,qBAAqB,OAAO;AACtD,QAAM,gBAAgB;AAAA,IACpB,CAACA,cACE,gBAAgB,SAAS,UAAU,KAAK,KACzC,cAAcA,UAAS,gBAAgB,WAAW,CAAA,CAAE;AAAA,IACtD,CAAC,gBAAgB,OAAO;AAAA,EAC1B;AAEI,MAAA,kBAA0B,QAAAC,kCAAA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AA;AAAA,cAAC;AAAA,cAAA;AAAA,gBACC,SAAS;AAAA,gBACT,SAAS;AAAA,gBACT;AAAA,cAAA;AAAA,eAEJ,EACF,CAAA;AAAA,UAAA;AAAA,UAfK;AAAA,QAgBP;AAAA,MAAA,CAEH;AAAA,MAEDA,kCAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,OAAO,YAAY;AAAA,UACnB,SAAQ;AAAA,UACR,OAAM;AAAA,UACN,WAAU;AAAA,UACV,SAAS,MAAM;AACb,kBAAM,aAAwB;AAAA,cAC5B,GAAG;AAAA,cACH,EAAE,MAAM,SAAS,QAAQ,KAAK,WAAW;AAAA,YAC3C;AACA,6BAAiB,eAAe,IAAI,YAAY,KAAK;AACrD,qCAAyB,UAAU;AAAA,UACrC;AAAA,UACA,MAAM;AAAA,UAEL,UAAY,YAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IACf,GACF;AAAA,EAAA;AAIJ,SACIE,kCAAA,KAAAD,4BAAA,EAAA,UAAA;AAAA,IAAA;AAAA,IAEC;AAAA,IAAS;AAAA,IAET,KAAK,UAAU,OAAO;AAAA,IAAE;AAAA,IAExB,KAAK,UAAU,OAAO;AAAA,EAAA,GACzB;AAEJ;"}
@@ -27,10 +27,12 @@ require("../Form/FormField.cjs");
27
27
  require("../../Form-BDcoNTLV.cjs");
28
28
  require("../DictionaryEditor/validDictionaryChangeButtons.content.cjs");
29
29
  require("zod");
30
+ const components_LocaleSwitcherContentDropDown_LocaleSwitcherContent = require("../LocaleSwitcherContentDropDown/LocaleSwitcherContent.cjs");
31
+ require("../LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.cjs");
30
32
  const components_DictionaryFieldEditor_EditorView_EditorView = require("./EditorView/EditorView.cjs");
31
33
  const components_DictionaryFieldEditor_KeyPathBreadcrumb = require("./KeyPathBreadcrumb.cjs");
32
34
  const components_DictionaryFieldEditor_NavigationView_NavigationViewNode = require("./NavigationView/NavigationViewNode.cjs");
33
- const NodeEditor = ({ dictionary }) => {
35
+ const NodeEditor = ({ dictionary, locales }) => {
34
36
  const { content: dictionaryContent, key } = dictionary;
35
37
  const { editedContent, dictionaryRecord, setDictionariesRecord } = components_DictionaryEditor_useEditedContentStore.useEditedContentStore(
36
38
  shallow.useShallow((s) => ({
@@ -54,14 +56,17 @@ const NodeEditor = ({ dictionary }) => {
54
56
  });
55
57
  }, [dictionary, key, setDictionariesRecord, dictionaryRecord]);
56
58
  return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsxs(jsxRuntime.jsxRuntimeExports.Fragment, { children: [
57
- /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
58
- components_DictionaryFieldEditor_KeyPathBreadcrumb.KeyPathBreadcrumb,
59
- {
60
- dictionaryKey: key,
61
- keyPath: focusedKeyPath ?? [],
62
- onClickKeyPath: setFocusedContentKeyPath
63
- }
64
- ),
59
+ /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between gap-2", children: [
60
+ /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
61
+ components_DictionaryFieldEditor_KeyPathBreadcrumb.KeyPathBreadcrumb,
62
+ {
63
+ dictionaryKey: key,
64
+ keyPath: focusedKeyPath ?? [],
65
+ onClickKeyPath: setFocusedContentKeyPath
66
+ }
67
+ ),
68
+ /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(components_LocaleSwitcherContentDropDown_LocaleSwitcherContent.LocaleSwitcherContent, {}) })
69
+ ] }),
65
70
  /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsxs("div", { className: "flex gap-2 max-md:flex-col", children: [
66
71
  /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
67
72
  components_Container_index.Container,
@@ -70,6 +75,7 @@ const NodeEditor = ({ dictionary }) => {
70
75
  background: false,
71
76
  className: "top-6 flex h-full flex-col items-start gap-0.5 overflow-auto p-2 md:sticky md:max-w-[50%]",
72
77
  roundedSize: "xl",
78
+ transparency: "sm",
73
79
  children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
74
80
  components_DictionaryFieldEditor_NavigationView_NavigationViewNode.NavigationViewNode,
75
81
  {
@@ -87,7 +93,14 @@ const NodeEditor = ({ dictionary }) => {
87
93
  background: false,
88
94
  className: "h-full flex-1 overflow-hidden",
89
95
  roundedSize: "xl",
90
- children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(components_DictionaryFieldEditor_EditorView_EditorView.EditorView, { dictionary, dictionaryKey: key })
96
+ children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
97
+ components_DictionaryFieldEditor_EditorView_EditorView.EditorView,
98
+ {
99
+ dictionary,
100
+ dictionaryKey: key,
101
+ locales
102
+ }
103
+ )
91
104
  }
92
105
  ) })
93
106
  ] })
@@ -1 +1 @@
1
- {"version":3,"file":"NodeEditor.cjs","sources":["../../../src/components/DictionaryFieldEditor/NodeEditor.tsx"],"sourcesContent":["'use client';\n\nimport { Dictionary } from '@intlayer/core';\nimport { useEffect, type FC } from 'react';\nimport { useShallow } from 'zustand/react/shallow';\nimport { Container } from '../Container';\nimport {\n useEditedContentStore,\n useEditionPanelStore,\n} from '../DictionaryEditor';\nimport { EditorView } from './EditorView/EditorView';\nimport { KeyPathBreadcrumb } from './KeyPathBreadcrumb';\nimport { NavigationViewNode } from './NavigationView/NavigationViewNode';\n\ntype NodeEditorProps = {\n dictionary: Dictionary;\n};\n\nexport const NodeEditor: FC<NodeEditorProps> = ({ dictionary }) => {\n const { content: dictionaryContent, key } = dictionary;\n const { editedContent, dictionaryRecord, setDictionariesRecord } =\n useEditedContentStore(\n useShallow((s) => ({\n editedContent: s.editedContent,\n dictionaryRecord: s.dictionariesRecord,\n setDictionariesRecord: s.setDictionariesRecord,\n }))\n );\n\n const { focusedContent, setFocusedContentKeyPath } = useEditionPanelStore(\n useShallow((s) => ({\n focusedContent: s.focusedContent,\n setFocusedContentKeyPath: s.setFocusedContentKeyPath,\n }))\n );\n\n const focusedKeyPath = focusedContent?.keyPath;\n\n const section = editedContent[key]?.content ?? dictionaryContent;\n\n useEffect(() => {\n if (dictionaryRecord[key]) return;\n\n setDictionariesRecord({\n [key]: dictionary,\n });\n }, [dictionary, key, setDictionariesRecord, dictionaryRecord]);\n\n return (\n <>\n <KeyPathBreadcrumb\n dictionaryKey={key}\n keyPath={focusedKeyPath ?? []}\n onClickKeyPath={setFocusedContentKeyPath}\n />\n <div className=\"flex gap-2 max-md:flex-col\">\n <Container\n border\n background={false}\n className=\"top-6 flex h-full flex-col items-start gap-0.5 overflow-auto p-2 md:sticky md:max-w-[50%]\"\n roundedSize=\"xl\"\n >\n <NavigationViewNode\n keyPath={[]}\n section={section}\n dictionaryKey={key}\n />\n </Container>\n <div className=\"top-6 flex h-full flex-1 flex-col gap-6 md:sticky\">\n {(focusedKeyPath?.length ?? 0) > 0 && (\n <Container\n border\n background={false}\n className=\"h-full flex-1 overflow-hidden\"\n roundedSize=\"xl\"\n >\n <EditorView dictionary={dictionary} dictionaryKey={key} />\n </Container>\n )}\n </div>\n </div>\n </>\n );\n};\n"],"names":["useEditedContentStore","useShallow","useEditionPanelStore","useEffect","jsxs","Fragment","jsx","KeyPathBreadcrumb","Container","NavigationViewNode","EditorView"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBO,MAAM,aAAkC,CAAC,EAAE,iBAAiB;AACjE,QAAM,EAAE,SAAS,mBAAmB,IAAQ,IAAA;AAC5C,QAAM,EAAE,eAAe,kBAAkB,sBACvC,IAAAA,kDAAA;AAAA,IACEC,QAAA,WAAW,CAAC,OAAO;AAAA,MACjB,eAAe,EAAE;AAAA,MACjB,kBAAkB,EAAE;AAAA,MACpB,uBAAuB,EAAE;AAAA,IAAA,EACzB;AAAA,EACJ;AAEI,QAAA,EAAE,gBAAgB,yBAAA,IAA6BC,iDAAA;AAAA,IACnDD,Q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A,EACF,CAAA;AAAA,EAAA,GACF;AAEJ;;"}
1
+ {"version":3,"file":"NodeEditor.cjs","sources":["../../../src/components/DictionaryFieldEditor/NodeEditor.tsx"],"sourcesContent":["'use client';\n\nimport { type Locales } from '@intlayer/config';\nimport { Dictionary } from '@intlayer/core';\nimport { useEffect, type FC } from 'react';\nimport { useShallow } from 'zustand/react/shallow';\nimport { Container } from '../Container';\nimport {\n useEditedContentStore,\n useEditionPanelStore,\n} from '../DictionaryEditor';\nimport { LocaleSwitcherContent } from '../LocaleSwitcherContentDropDown';\nimport { EditorView } from './EditorView/EditorView';\nimport { KeyPathBreadcrumb } from './KeyPathBreadcrumb';\nimport { NavigationViewNode } from './NavigationView/NavigationViewNode';\n\ntype NodeEditorProps = {\n dictionary: Dictionary;\n locales: Locales[];\n};\n\nexport const NodeEditor: FC<NodeEditorProps> = ({ dictionary, locales }) => {\n const { content: dictionaryContent, key } = dictionary;\n const { editedContent, dictionaryRecord, setDictionariesRecord } =\n useEditedContentStore(\n useShallow((s) => ({\n editedContent: s.editedContent,\n dictionaryRecord: s.dictionariesRecord,\n setDictionariesRecord: s.setDictionariesRecord,\n }))\n );\n\n const { focusedContent, setFocusedContentKeyPath } = useEditionPanelStore(\n useShallow((s) => ({\n focusedContent: s.focusedContent,\n setFocusedContentKeyPath: s.setFocusedContentKeyPath,\n }))\n );\n\n const focusedKeyPath = focusedContent?.keyPath;\n\n const section = editedContent[key]?.content ?? dictionaryContent;\n\n useEffect(() => {\n if (dictionaryRecord[key]) return;\n\n setDictionariesRecord({\n [key]: dictionary,\n });\n }, [dictionary, key, setDictionariesRecord, dictionaryRecord]);\n\n return (\n <>\n <div className=\"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\n <div className=\"flex gap-2 max-md:flex-col\">\n <Container\n border\n background={false}\n className=\"top-6 flex h-full flex-col items-start gap-0.5 overflow-auto p-2 md:sticky md:max-w-[50%]\"\n roundedSize=\"xl\"\n transparency=\"sm\"\n >\n <NavigationViewNode\n keyPath={[]}\n section={section}\n dictionaryKey={key}\n />\n </Container>\n <div className=\"top-6 flex h-full flex-1 flex-col gap-6 md:sticky\">\n {(focusedKeyPath?.length ?? 0) > 0 && (\n <Container\n border\n background={false}\n className=\"h-full flex-1 overflow-hidden\"\n roundedSize=\"xl\"\n >\n <EditorView\n dictionary={dictionary}\n dictionaryKey={key}\n locales={locales}\n />\n </Container>\n )}\n </div>\n </div>\n </>\n );\n};\n"],"names":["useEditedContentStore","useShallow","useEditionPanelStore","useEffect","jsxs","Fragment","jsx","KeyPathBreadcrumb","LocaleSwitcherContent","Container","NavigationViewNode","EditorView"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBO,MAAM,aAAkC,CAAC,EAAE,YAAY,cAAc;AAC1E,QAAM,EAAE,SAAS,mBAAmB,IAAQ,IAAA;AAC5C,QAAM,EAAE,eAAe,kBAAkB,sBACvC,IAAAA,kDAAA;AAAA,IACEC,QAAA,WAAW,CAAC,OAAO;AAAA,MACjB,eAAe,EAAE;AAAA,MACjB,kBAAkB,EAAE;AAAA,MACpB,uBAAuB,EAAE;AAAA,IAAA,EACzB;AAAA,EACJ;AAEI,QAAA,EAAE,gBAAgB,yBAAA,IAA6BC,iDAAA;AAAA,IACnDD,QAAA,WAAW,CAAC,OAAO;AAAA,MACjB,gBAAgB,EAAE;AAAA,MAClB,0BAA0B,EAAE;AAAA,IAAA,EAC5B;AAAA,EACJ;AAEA,QAAM,iBAAiB,gBAAgB;AAEvC,QAAM,UAAU,cAAc,GAAG,GAAG,WAAW;AAE/CE,aAAAA,UAAU,MAAM;AACV,QAAA,iBAAiB,GAAG,EAAG;AAEL,0BAAA;AAAA,MACpB,CAAC,GAAG,GAAG;AAAA,IAAA,CACR;AAAA,KACA,CAAC,YA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
  import { Dictionary } from '@intlayer/core';
2
3
  import { FC } from 'react';
3
4
  type NodeEditorProps = {
4
5
  dictionary: Dictionary;
6
+ locales: Locales[];
5
7
  };
6
8
  export declare const NodeEditor: FC<NodeEditorProps>;
7
9
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"NodeEditor.d.ts","sourceRoot":"","sources":["../../../src/components/DictionaryFieldEditor/NodeEditor.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAa,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAW3C,KAAK,eAAe,GAAG;IACrB,UAAU,EAAE,UAAU,CAAC;CACxB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,EAAE,CAAC,eAAe,CAiE1C,CAAC"}
1
+ {"version":3,"file":"NodeEditor.d.ts","sourceRoot":"","sources":["../../../src/components/DictionaryFieldEditor/NodeEditor.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAa,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAY3C,KAAK,eAAe,GAAG;IACrB,UAAU,EAAE,UAAU,CAAC;IACvB,OAAO,EAAE,OAAO,EAAE,CAAC;CACpB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,EAAE,CAAC,eAAe,CA4E1C,CAAC"}
@@ -25,10 +25,12 @@ import "../Form/FormField.mjs";
25
25
  import "../../Form-DhsgC7kB.js";
26
26
  import "../DictionaryEditor/validDictionaryChangeButtons.content.mjs";
27
27
  import "zod";
28
+ import { LocaleSwitcherContent } from "../LocaleSwitcherContentDropDown/LocaleSwitcherContent.mjs";
29
+ import "../LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.mjs";
28
30
  import { EditorView } from "./EditorView/EditorView.mjs";
29
31
  import { KeyPathBreadcrumb } from "./KeyPathBreadcrumb.mjs";
30
32
  import { NavigationViewNode } from "./NavigationView/NavigationViewNode.mjs";
31
- const NodeEditor = ({ dictionary }) => {
33
+ const NodeEditor = ({ dictionary, locales }) => {
32
34
  const { content: dictionaryContent, key } = dictionary;
33
35
  const { editedContent, dictionaryRecord, setDictionariesRecord } = useEditedContentStore(
34
36
  useShallow((s) => ({
@@ -52,14 +54,17 @@ const NodeEditor = ({ dictionary }) => {
52
54
  });
53
55
  }, [dictionary, key, setDictionariesRecord, dictionaryRecord]);
54
56
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
55
- /* @__PURE__ */ jsxRuntimeExports.jsx(
56
- KeyPathBreadcrumb,
57
- {
58
- dictionaryKey: key,
59
- keyPath: focusedKeyPath ?? [],
60
- onClickKeyPath: setFocusedContentKeyPath
61
- }
62
- ),
57
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between gap-2", children: [
58
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
59
+ KeyPathBreadcrumb,
60
+ {
61
+ dictionaryKey: key,
62
+ keyPath: focusedKeyPath ?? [],
63
+ onClickKeyPath: setFocusedContentKeyPath
64
+ }
65
+ ),
66
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx(LocaleSwitcherContent, {}) })
67
+ ] }),
63
68
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex gap-2 max-md:flex-col", children: [
64
69
  /* @__PURE__ */ jsxRuntimeExports.jsx(
65
70
  Container,
@@ -68,6 +73,7 @@ const NodeEditor = ({ dictionary }) => {
68
73
  background: false,
69
74
  className: "top-6 flex h-full flex-col items-start gap-0.5 overflow-auto p-2 md:sticky md:max-w-[50%]",
70
75
  roundedSize: "xl",
76
+ transparency: "sm",
71
77
  children: /* @__PURE__ */ jsxRuntimeExports.jsx(
72
78
  NavigationViewNode,
73
79
  {
@@ -85,7 +91,14 @@ const NodeEditor = ({ dictionary }) => {
85
91
  background: false,
86
92
  className: "h-full flex-1 overflow-hidden",
87
93
  roundedSize: "xl",
88
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(EditorView, { dictionary, dictionaryKey: key })
94
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(
95
+ EditorView,
96
+ {
97
+ dictionary,
98
+ dictionaryKey: key,
99
+ locales
100
+ }
101
+ )
89
102
  }
90
103
  ) })
91
104
  ] })
@@ -1 +1 @@
1
- {"version":3,"file":"NodeEditor.mjs","sources":["../../../src/components/DictionaryFieldEditor/NodeEditor.tsx"],"sourcesContent":["'use client';\n\nimport { Dictionary } from '@intlayer/core';\nimport { useEffect, type FC } from 'react';\nimport { useShallow } from 'zustand/react/shallow';\nimport { Container } from '../Container';\nimport {\n useEditedContentStore,\n useEditionPanelStore,\n} from '../DictionaryEditor';\nimport { EditorView } from './EditorView/EditorView';\nimport { KeyPathBreadcrumb } from './KeyPathBreadcrumb';\nimport { NavigationViewNode } from './NavigationView/NavigationViewNode';\n\ntype NodeEditorProps = {\n dictionary: Dictionary;\n};\n\nexport const NodeEditor: FC<NodeEditorProps> = ({ dictionary }) => {\n const { content: dictionaryContent, key } = dictionary;\n const { editedContent, dictionaryRecord, setDictionariesRecord } =\n useEditedContentStore(\n useShallow((s) => ({\n editedContent: s.editedContent,\n dictionaryRecord: s.dictionariesRecord,\n setDictionariesRecord: s.setDictionariesRecord,\n }))\n );\n\n const { focusedContent, setFocusedContentKeyPath } = useEditionPanelStore(\n useShallow((s) => ({\n focusedContent: s.focusedContent,\n setFocusedContentKeyPath: s.setFocusedContentKeyPath,\n }))\n );\n\n const focusedKeyPath = focusedContent?.keyPath;\n\n const section = editedContent[key]?.content ?? dictionaryContent;\n\n useEffect(() => {\n if (dictionaryRecord[key]) return;\n\n setDictionariesRecord({\n [key]: dictionary,\n });\n }, [dictionary, key, setDictionariesRecord, dictionaryRecord]);\n\n return (\n <>\n <KeyPathBreadcrumb\n dictionaryKey={key}\n keyPath={focusedKeyPath ?? []}\n onClickKeyPath={setFocusedContentKeyPath}\n />\n <div className=\"flex gap-2 max-md:flex-col\">\n <Container\n border\n background={false}\n className=\"top-6 flex h-full flex-col items-start gap-0.5 overflow-auto p-2 md:sticky md:max-w-[50%]\"\n roundedSize=\"xl\"\n >\n <NavigationViewNode\n keyPath={[]}\n section={section}\n dictionaryKey={key}\n />\n </Container>\n <div className=\"top-6 flex h-full flex-1 flex-col gap-6 md:sticky\">\n {(focusedKeyPath?.length ?? 0) > 0 && (\n <Container\n border\n background={false}\n className=\"h-full flex-1 overflow-hidden\"\n roundedSize=\"xl\"\n >\n <EditorView dictionary={dictionary} dictionaryKey={key} />\n </Container>\n )}\n </div>\n </div>\n </>\n );\n};\n"],"names":["jsxs","Fragment","jsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBO,MAAM,aAAkC,CAAC,EAAE,iBAAiB;AACjE,QAAM,EAAE,SAAS,mBAAmB,IAAQ,IAAA;AAC5C,QAAM,EAAE,eAAe,kBAAkB,sBACvC,IAAA;AAAA,IACE,WAAW,CAAC,OAAO;AAAA,MACjB,eAAe,EAAE;AAAA,MACjB,kBAAkB,EAAE;AAAA,MACpB,uBAAuB,EAAE;AAAA,IAAA,EACzB;AAAA,EACJ;AAEI,QAAA,EAAE,gBAAgB,yBAAA,IAA6B;AAAA,IACnD,WAAW,CAAC,OAAO;AAAA,MACjB,gBAAgB,EAAE;AAAA,MAClB,0BAA0B,EAAE;AAAA,IAAA,EAC5B;AAAA,EACJ;AAEA,QAAM,iBAAiB,gBAAgB;AAEvC,QAAM,UAAU,cAAc,GAAG,GAAG,WAAW;AAE/C,YAAU,MAAM;AACV,QAAA,iBAAiB,GAAG,EAAG;AAEL,0BAAA;AAAA,MACpB,CAAC,GAAG,GAAG;AAAA,IAAA,CACR;AAAA,KACA,CAAC,YAAY,KAAK,uBAAuB,gBAAgB,CAAC;AAE7D,SAEIA,kCAAA,KAAAC,4BAAA,EAAA,UAAA;AAAA,IAAAC,kCAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,eAAe;AAAA,QACf,SAAS,kBAAkB,CAAC;AAAA,QAC5B,gBAAgB;AAAA,MAAA;AAAA,IAClB;AAAA,IACAF,kCAAAA,KAAC,OAAI,EAAA,WAAU,8BACb,UAAA;AAAA,MAAAE,kCAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,QAAM;AAAA,UACN,YAAY;AAAA,UACZ,WAAU;AAAA,UACV,aAAY;AAAA,UAEZ,UAAAA,kCAAA;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,SAAS,CAAC;AAAA,cACV;AAAA,cACA,eAAe;AAAA,YAAA;AAAA,UAAA;AAAA,QACjB;AAAA,MACF;AAAA,4CACC,OAAI,EAAA,WAAU,qDACX,WAAgB,gBAAA,UAAU,KAAK,KAC/BA,kCAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,QAAM;AAAA,UACN,YAAY;AAAA,UACZ,WAAU;AAAA,UACV,aAAY;AAAA,UAEZ,UAACA,kCAAA,IAAA,YAAA,EAAW,YAAwB,eAAe,IAAK,CAAA;AAAA,QAAA;AAAA,MAAA,EAG9D,CAAA;AAAA,IAAA,EACF,CAAA;AAAA,EAAA,GACF;AAEJ;"}
1
+ {"version":3,"file":"NodeEditor.mjs","sources":["../../../src/components/DictionaryFieldEditor/NodeEditor.tsx"],"sourcesContent":["'use client';\n\nimport { type Locales } from '@intlayer/config';\nimport { Dictionary } from '@intlayer/core';\nimport { useEffect, type FC } from 'react';\nimport { useShallow } from 'zustand/react/shallow';\nimport { Container } from '../Container';\nimport {\n useEditedContentStore,\n useEditionPanelStore,\n} from '../DictionaryEditor';\nimport { LocaleSwitcherContent } from '../LocaleSwitcherContentDropDown';\nimport { EditorView } from './EditorView/EditorView';\nimport { KeyPathBreadcrumb } from './KeyPathBreadcrumb';\nimport { NavigationViewNode } from './NavigationView/NavigationViewNode';\n\ntype NodeEditorProps = {\n dictionary: Dictionary;\n locales: Locales[];\n};\n\nexport const NodeEditor: FC<NodeEditorProps> = ({ dictionary, locales }) => {\n const { content: dictionaryContent, key } = dictionary;\n const { editedContent, dictionaryRecord, setDictionariesRecord } =\n useEditedContentStore(\n useShallow((s) => ({\n editedContent: s.editedContent,\n dictionaryRecord: s.dictionariesRecord,\n setDictionariesRecord: s.setDictionariesRecord,\n }))\n );\n\n const { focusedContent, setFocusedContentKeyPath } = useEditionPanelStore(\n useShallow((s) => ({\n focusedContent: s.focusedContent,\n setFocusedContentKeyPath: s.setFocusedContentKeyPath,\n }))\n );\n\n const focusedKeyPath = focusedContent?.keyPath;\n\n const section = editedContent[key]?.content ?? dictionaryContent;\n\n useEffect(() => {\n if (dictionaryRecord[key]) return;\n\n setDictionariesRecord({\n [key]: dictionary,\n });\n }, [dictionary, key, setDictionariesRecord, dictionaryRecord]);\n\n return (\n <>\n <div className=\"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\n <div className=\"flex gap-2 max-md:flex-col\">\n <Container\n border\n background={false}\n className=\"top-6 flex h-full flex-col items-start gap-0.5 overflow-auto p-2 md:sticky md:max-w-[50%]\"\n roundedSize=\"xl\"\n transparency=\"sm\"\n >\n <NavigationViewNode\n keyPath={[]}\n section={section}\n dictionaryKey={key}\n />\n </Container>\n <div className=\"top-6 flex h-full flex-1 flex-col gap-6 md:sticky\">\n {(focusedKeyPath?.length ?? 0) > 0 && (\n <Container\n border\n background={false}\n className=\"h-full flex-1 overflow-hidden\"\n roundedSize=\"xl\"\n >\n <EditorView\n dictionary={dictionary}\n dictionaryKey={key}\n locales={locales}\n />\n </Container>\n )}\n </div>\n </div>\n </>\n );\n};\n"],"names":["jsxs","Fragment","jsx"],"mappings":";;;;;;;;;;;;;;;;;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A;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,SAAS,CAAC;AAAA,cACV;AAAA,cACA,eAAe;AAAA,YAAA;AAAA,UAAA;AAAA,QACjB;AAAA,MACF;AAAA,4CACC,OAAI,EAAA,WAAU,qDACX,WAAgB,gBAAA,UAAU,KAAK,KAC/BA,kCAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,QAAM;AAAA,UACN,YAAY;AAAA,UACZ,WAAU;AAAA,UACV,aAAY;AAAA,UAEZ,UAAAA,kCAAA;AAAA,YAAC;AAAA,YAAA;AAAA,cACC;AAAA,cACA,eAAe;AAAA,cACf;AAAA,YAAA;AAAA,UAAA;AAAA,QACF;AAAA,MAAA,EAGN,CAAA;AAAA,IAAA,EACF,CAAA;AAAA,EAAA,GACF;AAEJ;"}
@@ -99,7 +99,7 @@ const NodeTypeSelector = ({
99
99
  setKeyType(nodeType);
100
100
  }, [nodeType]);
101
101
  return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsxs(components_Select_Select.Select, { value: keyType, onValueChange, children: [
102
- /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(components_Select_Select.Select.Trigger, { className: "w-40", children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(components_Select_Select.Select.Value, { placeholder: triggerPlaceHolder.value }) }),
102
+ /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(components_Select_Select.Select.Trigger, { className: "w-40", children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(components_Select_Select.Select.Value, { placeholder: triggerPlaceHolder }) }),
103
103
  /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsxs(components_Select_Select.Select.Content, { children: [
104
104
  /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(components_Select_Select.Select.Item, { value: core.NodeType.Translation, children: multilingualText }),
105
105
  /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(components_Select_Select.Select.Item, { value: core.NodeType.Text, children: text }),
@@ -1 +1 @@
1
- {"version":3,"file":"NodeTypeSelector.cjs","sources":["../../../src/components/DictionaryFieldEditor/NodeTypeSelector.tsx"],"sourcesContent":["'use client';\n\nimport { getConfiguration } from '@intlayer/config/client';\nimport {\n type DictionaryValue,\n type EnumerationContent,\n type KeyPath,\n NodeType,\n type TranslationContent,\n} from '@intlayer/core';\nimport { type FC, useEffect, useState } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { useShallow } from 'zustand/react/shallow';\nimport { getSectionType } from '../../utils/dictionary';\nimport { useEditedContentStore } from '../DictionaryEditor';\nimport { Select } from '../Select';\nimport { nodeTypeSelectorContent } from './nodeTypeSelector.content';\n\ntype NodeTypeSelectorProps = {\n keyPath: KeyPath[];\n dictionaryKey: string;\n section: DictionaryValue;\n};\n\nexport const NodeTypeSelector: FC<NodeTypeSelectorProps> = ({\n keyPath,\n dictionaryKey,\n section,\n}) => {\n const {\n multilingualText,\n text,\n node,\n array,\n enumeration,\n triggerPlaceHolder,\n } = useDictionary(nodeTypeSelectorContent);\n const nodeType = getSectionType(section);\n const [keyType, setKeyType] = useState<NodeType>(nodeType);\n const { addEditedContent } = useEditedContentStore(\n useShallow((s) => ({\n addEditedContent: s.addEditedContent,\n }))\n );\n const { locales } = getConfiguration().internationalization;\n\n const onValueChange = (keyType: NodeType) => {\n setKeyType(keyType);\n\n switch (keyType) {\n case NodeType.Translation:\n addEditedContent(\n dictionaryKey,\n {\n nodeType: NodeType.Translation,\n [NodeType.Translation]: Object.assign(\n {},\n ...locales.map((locale) => ({\n [locale]: '',\n }))\n ),\n } as TranslationContent<DictionaryValue>,\n keyPath\n );\n break;\n case NodeType.Enumeration:\n addEditedContent(\n dictionaryKey,\n {\n nodeType: NodeType.Enumeration,\n [NodeType.Enumeration]: {\n '1': '',\n '>1': '',\n },\n } as EnumerationContent<DictionaryValue>,\n keyPath\n );\n break;\n case NodeType.Object:\n addEditedContent(dictionaryKey, {}, keyPath);\n break;\n case NodeType.Array:\n addEditedContent(dictionaryKey, [''], keyPath);\n break;\n case NodeType.Text:\n addEditedContent(dictionaryKey, '', keyPath);\n break;\n default:\n addEditedContent(dictionaryKey, {}, keyPath);\n }\n };\n\n useEffect(() => {\n setKeyType(nodeType);\n }, [nodeType]);\n\n return (\n <Select value={keyType} onValueChange={onValueChange}>\n <Select.Trigger className=\"w-40\">\n <Select.Value placeholder={triggerPlaceHolder.value} />\n </Select.Trigger>\n <Select.Content>\n <Select.Item value={NodeType.Translation}>\n {multilingualText}\n </Select.Item>\n <Select.Item value={NodeType.Text}>{text}</Select.Item>\n <Select.Item value={NodeType.Object}>{node}</Select.Item>\n <Select.Item value={NodeType.Array}>{array}</Select.Item>\n <Select.Item value={NodeType.Enumeration}>{enumeration}</Select.Item>\n </Select.Content>\n </Select>\n );\n};\n"],"names":["useDictionary","nodeTypeSelectorContent","getSectionType","useState","useEditedContentStore","useShallow","getConfiguration","keyType","NodeType","useEffect","jsxs","Select","jsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBO,MAAM,mBAA8C,CAAC;AAAA,EAC1D;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACE,QAAA;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA,IACEA,cAAAA,cAAcC,0DAAAA,uBAAuB;AACnC,QAAA,WAAWC,gCAAe,OAAO;AACvC,QAAM,CAAC,SAAS,UAAU,IAAIC,WAAAA,SAAmB,QAAQ;AACnD,QAAA,EAAE,qBAAqBC,kDAAA;AAAA,IAC3BC,QAAA,WAAW,CAAC,OAAO;AAAA,MACjB,kBAAkB,EAAE;AAAA,IAAA,EACpB;AAAA,EACJ;AACA,QAAM,EAAE,QAAA,IAAYC,OAAA,iBAAA,EAAmB;AAEjC,QAAA,gBAAgB,CAACC,aAAsB;AAC3C,eAAWA,QAAO;AAElB,YAAQA,UAAS;AAAA,MACf,KAAKC,KAAS,SAAA;AACZ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AS,aAC1B,UACH,kBAAA;AAAA,uDACCG,yBAAAA,OAAO,MAAP,EAAY,OAAOH,KAAAA,SAAS,MAAO,UAAK,MAAA;AAAA,uDACxCG,yBAAAA,OAAO,MAAP,EAAY,OAAOH,KAAAA,SAAS,QAAS,UAAK,MAAA;AAAA,uDAC1CG,yBAAAA,OAAO,MAAP,EAAY,OAAOH,KAAAA,SAAS,OAAQ,UAAM,OAAA;AAAA,uDAC1CG,yBAAAA,OAAO,MAAP,EAAY,OAAOH,KAAAA,SAAS,aAAc,UAAY,YAAA,CAAA;AAAA,IAAA,EACzD,CAAA;AAAA,EAAA,GACF;AAEJ;;"}
1
+ {"version":3,"file":"NodeTypeSelector.cjs","sources":["../../../src/components/DictionaryFieldEditor/NodeTypeSelector.tsx"],"sourcesContent":["'use client';\n\nimport { getConfiguration } from '@intlayer/config/client';\nimport {\n type DictionaryValue,\n type EnumerationContent,\n type KeyPath,\n NodeType,\n type TranslationContent,\n} from '@intlayer/core';\nimport { type FC, useEffect, useState } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { useShallow } from 'zustand/react/shallow';\nimport { getSectionType } from '../../utils/dictionary';\nimport { useEditedContentStore } from '../DictionaryEditor';\nimport { Select } from '../Select';\nimport { nodeTypeSelectorContent } from './nodeTypeSelector.content';\n\ntype NodeTypeSelectorProps = {\n keyPath: KeyPath[];\n dictionaryKey: string;\n section: DictionaryValue;\n};\n\nexport const NodeTypeSelector: FC<NodeTypeSelectorProps> = ({\n keyPath,\n dictionaryKey,\n section,\n}) => {\n const {\n multilingualText,\n text,\n node,\n array,\n enumeration,\n triggerPlaceHolder,\n } = useDictionary(nodeTypeSelectorContent);\n const nodeType = getSectionType(section);\n const [keyType, setKeyType] = useState<NodeType>(nodeType);\n const { addEditedContent } = useEditedContentStore(\n useShallow((s) => ({\n addEditedContent: s.addEditedContent,\n }))\n );\n const { locales } = getConfiguration().internationalization;\n\n const onValueChange = (keyType: NodeType) => {\n setKeyType(keyType);\n\n switch (keyType) {\n case NodeType.Translation:\n addEditedContent(\n dictionaryKey,\n {\n nodeType: NodeType.Translation,\n [NodeType.Translation]: Object.assign(\n {},\n ...locales.map((locale) => ({\n [locale]: '',\n }))\n ),\n } as TranslationContent<DictionaryValue>,\n keyPath\n );\n break;\n case NodeType.Enumeration:\n addEditedContent(\n dictionaryKey,\n {\n nodeType: NodeType.Enumeration,\n [NodeType.Enumeration]: {\n '1': '',\n '>1': '',\n },\n } as EnumerationContent<DictionaryValue>,\n keyPath\n );\n break;\n case NodeType.Object:\n addEditedContent(dictionaryKey, {}, keyPath);\n break;\n case NodeType.Array:\n addEditedContent(dictionaryKey, [''], keyPath);\n break;\n case NodeType.Text:\n addEditedContent(dictionaryKey, '', keyPath);\n break;\n default:\n addEditedContent(dictionaryKey, {}, keyPath);\n }\n };\n\n useEffect(() => {\n setKeyType(nodeType);\n }, [nodeType]);\n\n return (\n <Select value={keyType} onValueChange={onValueChange}>\n <Select.Trigger className=\"w-40\">\n <Select.Value placeholder={triggerPlaceHolder} />\n </Select.Trigger>\n <Select.Content>\n <Select.Item value={NodeType.Translation}>\n {multilingualText}\n </Select.Item>\n <Select.Item value={NodeType.Text}>{text}</Select.Item>\n <Select.Item value={NodeType.Object}>{node}</Select.Item>\n <Select.Item value={NodeType.Array}>{array}</Select.Item>\n <Select.Item value={NodeType.Enumeration}>{enumeration}</Select.Item>\n </Select.Content>\n </Select>\n );\n};\n"],"names":["useDictionary","nodeTypeSelectorContent","getSectionType","useState","useEditedContentStore","useShallow","getConfiguration","keyType","NodeType","useEffect","jsxs","Select","jsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBO,MAAM,mBAA8C,CAAC;AAAA,EAC1D;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACE,QAAA;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA,IACEA,cAAAA,cAAcC,0DA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CAAC,QAAQ,CAAC;AAEb,SACGC,2BAAAA,kBAAAA,KAAAC,yBAAAA,QAAA,EAAO,OAAO,SAAS,eACtB,UAAA;AAAA,IAACC,2BAAAA,kBAAAA,IAAAD,yBAAAA,OAAO,SAAP,EAAe,WAAU,QACxB,UAACC,iDAAAD,yBAAAA,OAAO,OAAP,EAAa,aAAa,mBAAA,CAAoB,EACjD,CAAA;AAAA,IACAD,2BAAAA,kBAAAA,KAACC,yBAAO,OAAA,SAAP,EACC,UAAA;AAAA,MAAAC,iDAACD,yBAAAA,OAAO,MAAP,EAAY,OAAOH,KAAAA,SAAS,aAC1B,UACH,kBAAA;AAAA,uDACCG,yBAAAA,OAAO,MAAP,EAAY,OAAOH,KAAAA,SAAS,MAAO,UAAK,MAAA;AAAA,uDACxCG,yBAAAA,OAAO,MAAP,EAAY,OAAOH,KAAAA,SAAS,QAAS,UAAK,MAAA;AAAA,uDAC1CG,yBAAAA,OAAO,MAAP,EAAY,OAAOH,KAAAA,SAAS,OAAQ,UAAM,OAAA;AAAA,uDAC1CG,yBAAAA,OAAO,MAAP,EAAY,OAAOH,KAAAA,SAAS,aAAc,UAAY,YAAA,CAAA;AAAA,IAAA,EACzD,CAAA;AAAA,EAAA,GACF;AAEJ;;"}
@@ -97,7 +97,7 @@ const NodeTypeSelector = ({
97
97
  setKeyType(nodeType);
98
98
  }, [nodeType]);
99
99
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(Select, { value: keyType, onValueChange, children: [
100
- /* @__PURE__ */ jsxRuntimeExports.jsx(Select.Trigger, { className: "w-40", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Select.Value, { placeholder: triggerPlaceHolder.value }) }),
100
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Select.Trigger, { className: "w-40", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Select.Value, { placeholder: triggerPlaceHolder }) }),
101
101
  /* @__PURE__ */ jsxRuntimeExports.jsxs(Select.Content, { children: [
102
102
  /* @__PURE__ */ jsxRuntimeExports.jsx(Select.Item, { value: NodeType.Translation, children: multilingualText }),
103
103
  /* @__PURE__ */ jsxRuntimeExports.jsx(Select.Item, { value: NodeType.Text, children: text }),
@@ -1 +1 @@
1
- {"version":3,"file":"NodeTypeSelector.mjs","sources":["../../../src/components/DictionaryFieldEditor/NodeTypeSelector.tsx"],"sourcesContent":["'use client';\n\nimport { getConfiguration } from '@intlayer/config/client';\nimport {\n type DictionaryValue,\n type EnumerationContent,\n type KeyPath,\n NodeType,\n type TranslationContent,\n} from '@intlayer/core';\nimport { type FC, useEffect, useState } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { useShallow } from 'zustand/react/shallow';\nimport { getSectionType } from '../../utils/dictionary';\nimport { useEditedContentStore } from '../DictionaryEditor';\nimport { Select } from '../Select';\nimport { nodeTypeSelectorContent } from './nodeTypeSelector.content';\n\ntype NodeTypeSelectorProps = {\n keyPath: KeyPath[];\n dictionaryKey: string;\n section: DictionaryValue;\n};\n\nexport const NodeTypeSelector: FC<NodeTypeSelectorProps> = ({\n keyPath,\n dictionaryKey,\n section,\n}) => {\n const {\n multilingualText,\n text,\n node,\n array,\n enumeration,\n triggerPlaceHolder,\n } = useDictionary(nodeTypeSelectorContent);\n const nodeType = getSectionType(section);\n const [keyType, setKeyType] = useState<NodeType>(nodeType);\n const { addEditedContent } = useEditedContentStore(\n useShallow((s) => ({\n addEditedContent: s.addEditedContent,\n }))\n );\n const { locales } = getConfiguration().internationalization;\n\n const onValueChange = (keyType: NodeType) => {\n setKeyType(keyType);\n\n switch (keyType) {\n case NodeType.Translation:\n addEditedContent(\n dictionaryKey,\n {\n nodeType: NodeType.Translation,\n [NodeType.Translation]: Object.assign(\n {},\n ...locales.map((locale) => ({\n [locale]: '',\n }))\n ),\n } as TranslationContent<DictionaryValue>,\n keyPath\n );\n break;\n case NodeType.Enumeration:\n addEditedContent(\n dictionaryKey,\n {\n nodeType: NodeType.Enumeration,\n [NodeType.Enumeration]: {\n '1': '',\n '>1': '',\n },\n } as EnumerationContent<DictionaryValue>,\n keyPath\n );\n break;\n case NodeType.Object:\n addEditedContent(dictionaryKey, {}, keyPath);\n break;\n case NodeType.Array:\n addEditedContent(dictionaryKey, [''], keyPath);\n break;\n case NodeType.Text:\n addEditedContent(dictionaryKey, '', keyPath);\n break;\n default:\n addEditedContent(dictionaryKey, {}, keyPath);\n }\n };\n\n useEffect(() => {\n setKeyType(nodeType);\n }, [nodeType]);\n\n return (\n <Select value={keyType} onValueChange={onValueChange}>\n <Select.Trigger className=\"w-40\">\n <Select.Value placeholder={triggerPlaceHolder.value} />\n </Select.Trigger>\n <Select.Content>\n <Select.Item value={NodeType.Translation}>\n {multilingualText}\n </Select.Item>\n <Select.Item value={NodeType.Text}>{text}</Select.Item>\n <Select.Item value={NodeType.Object}>{node}</Select.Item>\n <Select.Item value={NodeType.Array}>{array}</Select.Item>\n <Select.Item value={NodeType.Enumeration}>{enumeration}</Select.Item>\n </Select.Content>\n </Select>\n );\n};\n"],"names":["keyType","jsxs","jsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBO,MAAM,mBAA8C,CAAC;AAAA,EAC1D;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACE,QAAA;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA,IACE,cAAc,uBAAuB;AACnC,QAAA,WAAW,eAAe,OAAO;AACvC,QAAM,CAAC,SAAS,UAAU,IAAI,SAAmB,QAAQ;AACnD,QAAA,EAAE,qBAAqB;AAAA,IAC3B,WAAW,CAAC,OAAO;AAAA,MACjB,kBAAkB,EAAE;AAAA,IAAA,EACpB;AAAA,EACJ;AACA,QAAM,EAAE,QAAA,IAAY,iBAAA,EAAmB;AAEjC,QAAA,gBAAgB,CAACA,aAAsB;AAC3C,eAAWA,QAAO;AAElB,YAAQA,UAAS;AAAA,MACf,KAAK,SAAS;AACZ;AAAA,UACE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,OAAO,MAAP,EAAY,OAAO,SAAS,OAAQ,UAAM,OAAA;AAAA,4CAC1C,OAAO,MAAP,EAAY,OAAO,SAAS,aAAc,UAAY,YAAA,CAAA;AAAA,IAAA,EACzD,CAAA;AAAA,EAAA,GACF;AAEJ;"}
1
+ {"version":3,"file":"NodeTypeSelector.mjs","sources":["../../../src/components/DictionaryFieldEditor/NodeTypeSelector.tsx"],"sourcesContent":["'use client';\n\nimport { getConfiguration } from '@intlayer/config/client';\nimport {\n type DictionaryValue,\n type EnumerationContent,\n type KeyPath,\n NodeType,\n type TranslationContent,\n} from '@intlayer/core';\nimport { type FC, useEffect, useState } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { useShallow } from 'zustand/react/shallow';\nimport { getSectionType } from '../../utils/dictionary';\nimport { useEditedContentStore } from '../DictionaryEditor';\nimport { Select } from '../Select';\nimport { nodeTypeSelectorContent } from './nodeTypeSelector.content';\n\ntype NodeTypeSelectorProps = {\n keyPath: KeyPath[];\n dictionaryKey: string;\n section: DictionaryValue;\n};\n\nexport const NodeTypeSelector: FC<NodeTypeSelectorProps> = ({\n keyPath,\n dictionaryKey,\n section,\n}) => {\n const {\n multilingualText,\n text,\n node,\n array,\n enumeration,\n triggerPlaceHolder,\n } = useDictionary(nodeTypeSelectorContent);\n const nodeType = getSectionType(section);\n const [keyType, setKeyType] = useState<NodeType>(nodeType);\n const { addEditedContent } = useEditedContentStore(\n useShallow((s) => ({\n addEditedContent: s.addEditedContent,\n }))\n );\n const { locales } = getConfiguration().internationalization;\n\n const onValueChange = (keyType: NodeType) => {\n setKeyType(keyType);\n\n switch (keyType) {\n case NodeType.Translation:\n addEditedContent(\n dictionaryKey,\n {\n nodeType: NodeType.Translation,\n [NodeType.Translation]: Object.assign(\n {},\n ...locales.map((locale) => ({\n [locale]: '',\n }))\n ),\n } as TranslationContent<DictionaryValue>,\n keyPath\n );\n break;\n case NodeType.Enumeration:\n addEditedContent(\n dictionaryKey,\n {\n nodeType: NodeType.Enumeration,\n [NodeType.Enumeration]: {\n '1': '',\n '>1': '',\n },\n } as EnumerationContent<DictionaryValue>,\n keyPath\n );\n break;\n case NodeType.Object:\n addEditedContent(dictionaryKey, {}, keyPath);\n break;\n case NodeType.Array:\n addEditedContent(dictionaryKey, [''], keyPath);\n break;\n case NodeType.Text:\n addEditedContent(dictionaryKey, '', keyPath);\n break;\n default:\n addEditedContent(dictionaryKey, {}, keyPath);\n }\n };\n\n useEffect(() => {\n setKeyType(nodeType);\n }, [nodeType]);\n\n return (\n <Select value={keyType} onValueChange={onValueChange}>\n <Select.Trigger className=\"w-40\">\n <Select.Value placeholder={triggerPlaceHolder} />\n </Select.Trigger>\n <Select.Content>\n <Select.Item value={NodeType.Translation}>\n {multilingualText}\n </Select.Item>\n <Select.Item value={NodeType.Text}>{text}</Select.Item>\n <Select.Item value={NodeType.Object}>{node}</Select.Item>\n <Select.Item value={NodeType.Array}>{array}</Select.Item>\n <Select.Item value={NodeType.Enumeration}>{enumeration}</Select.Item>\n </Select.Content>\n </Select>\n );\n};\n"],"names":["keyType","jsxs","jsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBO,MAAM,mBAA8C,CAAC;AAAA,EAC1D;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACE,QAAA;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA,IACE,cAAc,uBAAuB;AACnC,QAAA,WAAW,eAAe,OAAO;AACvC,QAAM,CAAC,SAAS,UAAU,IAAI,SAAmB,QAAQ;AACnD,QAAA,EAAE,qBAAqB;AAAA,IAC3B,WAAW,CAAC,OAAO;AAAA,MACjB,kBAAkB,EAAE;AAAA,IAAA,EACpB;AAAA,EACJ;AACA,QAAM,EAAE,QAAA,IAAY,iBAAA,EAAmB;AAEjC,QAAA,gBAAgB,CAACA,aAAsB;AAC3C,eAAWA,QAAO;AAElB,YAAQA,UAAS;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AAK,MAAA;AAAA,4CAC1C,OAAO,MAAP,EAAY,OAAO,SAAS,OAAQ,UAAM,OAAA;AAAA,4CAC1C,OAAO,MAAP,EAAY,OAAO,SAAS,aAAc,UAAY,YAAA,CAAA;AAAA,IAAA,EACzD,CAAA;AAAA,EAAA,GACF;AAEJ;"}
@@ -43,7 +43,7 @@ const SaveForm = ({ dictionary }) => {
43
43
  const { pushDictionaries } = hooks_intlayerAPIHooks.usePushDictionaries();
44
44
  const SaveFormSchema = components_DictionaryFieldEditor_SaveForm_SaveFormSchema.getSaveFormSchema();
45
45
  const { online } = hooks_useGetAllDictionaries.useGetAllDictionaries();
46
- const { isLoading: isAuditing, auditFile } = hooks_intlayerAPIHooks.useAuditFile();
46
+ const { isLoading: isAuditing, auditContentDeclaration } = hooks_intlayerAPIHooks.useAuditContentDeclaration();
47
47
  const { editedContent, restoreEditedContent, setEditedContent } = components_DictionaryEditor_useEditedContentStore.useEditedContentStore(
48
48
  shallow.useShallow((s) => ({
49
49
  editedContent: s.editedContent,
@@ -78,7 +78,7 @@ const SaveForm = ({ dictionary }) => {
78
78
  }
79
79
  ]);
80
80
  }, [dictionary, editedContent, pushDictionaries]);
81
- const handleOnAuditFile = async () => await auditFile({
81
+ const handleOnAuditFile = async () => await auditContentDeclaration({
82
82
  defaultLocale: project?.defaultLocale ?? intlayer.Locales.ENGLISH,
83
83
  locales: project?.locales ?? [intlayer.Locales.ENGLISH],
84
84
  fileContent: JSON.stringify(editedDictionary ?? dictionary)
@@ -89,7 +89,6 @@ const SaveForm = ({ dictionary }) => {
89
89
  );
90
90
  setEditedContent(dictionary.key, editedDictionary2.content);
91
91
  });
92
- console.log("isLoading", isAuditing);
93
92
  return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsxs(
94
93
  components_Form_layout_FormItemLayout.Form,
95
94
  {
@@ -123,7 +122,6 @@ const SaveForm = ({ dictionary }) => {
123
122
  variant: "outline",
124
123
  color: "text",
125
124
  className: "max-md:w-full",
126
- isLoading: isSubmitting,
127
125
  onClick: () => restoreEditedContent(dictionary.key),
128
126
  children: resetButton.text
129
127
  }
@@ -1 +1 @@
1
- {"version":3,"file":"SaveForm.cjs","sources":["../../../../src/components/DictionaryFieldEditor/SaveForm/SaveForm.tsx"],"sourcesContent":["'use client';\n\nimport { Dictionary as DistantDictionary } from '@intlayer/backend';\nimport { Dictionary } from '@intlayer/core';\nimport { Locales } from 'intlayer';\nimport { ArrowUpFromLine, RotateCcw, Save, WandSparkles } from 'lucide-react';\nimport { useCallback, useMemo, type FC } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { useShallow } from 'zustand/react/shallow';\nimport { useAuth } from '../../../components/Auth';\nimport {\n useAuditFile,\n useGetAllDictionaries,\n usePushDictionaries,\n} from '../../../hooks';\nimport { useEditedContentStore } from '../../DictionaryEditor';\nimport { Form, useForm } from '../../Form';\nimport { saveDictionaryContent } from './saveForm.content';\nimport { getSaveFormSchema } from './SaveFormSchema';\n\ntype DictionaryDetailsProps = {\n dictionary: Dictionary;\n};\n\nexport const SaveForm: FC<DictionaryDetailsProps> = ({ dictionary }) => {\n const { session } = useAuth();\n const project = session?.project;\n const { pushDictionaries } = usePushDictionaries();\n const SaveFormSchema = getSaveFormSchema();\n const { online } = useGetAllDictionaries();\n const { isLoading: isAuditing, auditFile } = useAuditFile();\n\n const { editedContent, restoreEditedContent, setEditedContent } =\n useEditedContentStore(\n useShallow((s) => ({\n editedContent: s.editedContent,\n restoreEditedContent: s.restoreEditedContent,\n setEditedContent: s.setEditedContent,\n }))\n );\n const { form, isSubmitting } = useForm(SaveFormSchema);\n const { auditButton, resetButton, saveButton, publishButton } = useDictionary(\n saveDictionaryContent\n );\n\n const editedDictionary = useMemo(\n () => editedContent[dictionary.key],\n [editedContent, dictionary.key]\n );\n\n const onlineDictionary = useMemo(() => {\n return online?.[dictionary.key];\n }, [online, dictionary.key]);\n\n const isEdited = useMemo(\n () =>\n editedDictionary &&\n onlineDictionary &&\n JSON.stringify(editedDictionary.content) !==\n JSON.stringify(onlineDictionary.content),\n [onlineDictionary, editedDictionary]\n );\n\n const isLocalDictionary = useMemo(\n () => typeof (dictionary as DistantDictionary)?._id === 'undefined',\n [dictionary]\n );\n\n const onSubmitSuccess = useCallback(async () => {\n await pushDictionaries([\n {\n ...dictionary,\n ...editedContent[dictionary.key],\n },\n ]);\n }, [dictionary, editedContent, pushDictionaries]);\n\n const handleOnAuditFile = async () =>\n await auditFile({\n defaultLocale: project?.defaultLocale ?? Locales.ENGLISH,\n locales: project?.locales ?? [Locales.ENGLISH],\n fileContent: JSON.stringify(editedDictionary ?? dictionary),\n }).then((response) => {\n if (!response.data) return;\n\n const editedDictionary = JSON.parse(\n response.data.fileContent\n ) as Dictionary;\n\n setEditedContent(dictionary.key, editedDictionary.content);\n });\n\n console.log('isLoading', isAuditing);\n\n return (\n <Form\n className=\"flex w-full flex-1 flex-row flex-wrap justify-end gap-3\"\n {...form}\n schema={SaveFormSchema}\n onSubmitSuccess={onSubmitSuccess}\n >\n <Form.Button\n type=\"button\"\n label={auditButton.label}\n disabled={isSubmitting}\n Icon={WandSparkles}\n variant=\"outline\"\n color=\"text\"\n className=\"ml-auto max-md:w-full\"\n isLoading={isAuditing}\n onClick={handleOnAuditFile}\n >\n {auditButton.text}\n </Form.Button>\n {isEdited && (\n <Form.Button\n type=\"button\"\n label={resetButton.label}\n disabled={!isEdited || isSubmitting}\n Icon={RotateCcw}\n variant=\"outline\"\n color=\"text\"\n className=\"max-md:w-full\"\n isLoading={isSubmitting}\n onClick={() => restoreEditedContent(dictionary.key)}\n >\n {resetButton.text}\n </Form.Button>\n )}\n {isLocalDictionary ? (\n <Form.Button\n type=\"submit\"\n label={publishButton.label}\n disabled={!isEdited || isSubmitting}\n Icon={ArrowUpFromLine}\n color=\"text\"\n className=\"max-md:w-full\"\n isLoading={isSubmitting}\n >\n {publishButton.text}\n </Form.Button>\n ) : (\n isEdited && (\n <Form.Button\n type=\"submit\"\n label={saveButton.label}\n disabled={!isEdited || isSubmitting}\n Icon={Save}\n color=\"text\"\n className=\"max-md:w-full\"\n isLoading={isSubmitting}\n >\n {saveButton.text}\n </Form.Button>\n )\n )}\n </Form>\n );\n};\n"],"names":["useAuth","usePushDictionaries","getSaveFormSchema","useGetAllDictionaries","useAuditFile","useEditedContentStore","useShallow","useForm","useDictionary","saveDictionaryContent","useMemo","useCallback","Locales","editedDictionary","jsxs","Form","jsx","WandSparkles","RotateCcw","ArrowUpFromLine","Save"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBO,MAAM,WAAuC,CAAC,EAAE,iBAAiB;AAChE,QAAA,EAAE,QAAQ,IAAIA,sCAAQ;AAC5B,QAAM,UAAU,SAAS;AACnB,QAAA,EAAE,iBAAiB,IAAIC,2CAAoB;AACjD,QAAM,iBAAiBC,yDAAAA,kBAAkB;AACnC,QAAA,EAAE,OAAO,IAAIC,kDAAsB;AACzC,QAAM,EAAE,WAAW,YAAY,UAAA,IAAcC,uBAAAA,aAAa;AAE1D,QAAM,EAAE,eAAe,sBAAsB,iBAC3C,IAAAC,kDAAA;AAAA,IACEC,QAAA,WAAW,CAAC,OAAO;AAAA,MACjB,eAAe,EAAE;AAAA,MACjB,sBAAsB,EAAE;AAAA,MACxB,kBAAkB,EAAE;AAAA,IAAA,EACpB;AAAA,EACJ;AACF,QAAM,EAAE,MAAM,iBAAiBC,yBAAAA,QAAQ,cAAc;AACrD,QAAM,EAAE,aAAa,aAAa,YAAY,cAAkB,IAAAC,cAAA;AAAA,IAC9DC,2DAAAA;AAAAA,EACF;AAEA,QAAM,mBAAmBC,WAAA;AAAA,IACvB,MAAM,cAAc,WAAW,GAAG;AAAA,IAClC,CAAC,eAAe,WAAW,GAAG;AAAA,EAChC;AAEM,QAAA,mBAAmBA,WAAAA,QAAQ,MAAM;AAC9B,WAAA,SAAS,WAAW,GAAG;AAAA,EAC7B,GAAA,CAAC,QAAQ,WAAW,GAAG,CAAC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AA,YACV,WAAW;AAAA,YACX,SAAS;AAAA,YAER,UAAY,YAAA;AAAA,UAAA;AAAA,QACf;AAAA,QACC,YACCD,2BAAA,kBAAA;AAAA,UAACD,sCAAAA,KAAK;AAAA,UAAL;AAAA,YACC,MAAK;AAAA,YACL,OAAO,YAAY;AAAA,YACnB,UAAU,CAAC,YAAY;AAAA,YACvB,MAAMG,YAAA;AAAA,YACN,SAAQ;AAAA,YACR,OAAM;AAAA,YACN,WAAU;AAAA,YACV,WAAW;AAAA,YACX,SAAS,MAAM,qBAAqB,WAAW,GAAG;AAAA,YAEjD,UAAY,YAAA;AAAA,UAAA;AAAA,QACf;AAAA,QAED,oBACCF,2BAAA,kBAAA;AAAA,UAACD,sCAAAA,KAAK;AAAA,UAAL;AAAA,YACC,MAAK;AAAA,YACL,OAAO,cAAc;AAAA,YACrB,UAAU,CAAC,YAAY;AAAA,YACvB,MAAMI,YAAA;AAAA,YACN,OAAM;AAAA,YACN,WAAU;AAAA,YACV,WAAW;AAAA,YAEV,UAAc,cAAA;AAAA,UAAA;AAAA,YAGjB,YACEH,2BAAA,kBAAA;AAAA,UAACD,sCAAAA,KAAK;AAAA,UAAL;AAAA,YACC,MAAK;AAAA,YACL,OAAO,WAAW;AAAA,YAClB,UAAU,CAAC,YAAY;AAAA,YACvB,MAAMK,YAAA;AAAA,YACN,OAAM;AAAA,YACN,WAAU;AAAA,YACV,WAAW;AAAA,YAEV,UAAW,WAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MACd;AAAA,IAAA;AAAA,EAGN;AAEJ;;"}
1
+ {"version":3,"file":"SaveForm.cjs","sources":["../../../../src/components/DictionaryFieldEditor/SaveForm/SaveForm.tsx"],"sourcesContent":["'use client';\n\nimport { Dictionary as DistantDictionary } from '@intlayer/backend';\nimport { Dictionary } from '@intlayer/core';\nimport { Locales } from 'intlayer';\nimport { ArrowUpFromLine, RotateCcw, Save, WandSparkles } from 'lucide-react';\nimport { useCallback, useMemo, type FC } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { useShallow } from 'zustand/react/shallow';\nimport { useAuth } from '../../../components/Auth';\nimport {\n useAuditContentDeclaration,\n useGetAllDictionaries,\n usePushDictionaries,\n} from '../../../hooks';\nimport { useEditedContentStore } from '../../DictionaryEditor';\nimport { Form, useForm } from '../../Form';\nimport { saveDictionaryContent } from './saveForm.content';\nimport { getSaveFormSchema } from './SaveFormSchema';\n\ntype DictionaryDetailsProps = {\n dictionary: Dictionary;\n};\n\nexport const SaveForm: FC<DictionaryDetailsProps> = ({ dictionary }) => {\n const { session } = useAuth();\n const project = session?.project;\n const { pushDictionaries } = usePushDictionaries();\n const SaveFormSchema = getSaveFormSchema();\n const { online } = useGetAllDictionaries();\n const { isLoading: isAuditing, auditContentDeclaration } =\n useAuditContentDeclaration();\n\n const { editedContent, restoreEditedContent, setEditedContent } =\n useEditedContentStore(\n useShallow((s) => ({\n editedContent: s.editedContent,\n restoreEditedContent: s.restoreEditedContent,\n setEditedContent: s.setEditedContent,\n }))\n );\n const { form, isSubmitting } = useForm(SaveFormSchema);\n const { auditButton, resetButton, saveButton, publishButton } = useDictionary(\n saveDictionaryContent\n );\n\n const editedDictionary = useMemo(\n () => editedContent[dictionary.key],\n [editedContent, dictionary.key]\n );\n\n const onlineDictionary = useMemo(() => {\n return online?.[dictionary.key];\n }, [online, dictionary.key]);\n\n const isEdited = useMemo(\n () =>\n editedDictionary &&\n onlineDictionary &&\n JSON.stringify(editedDictionary.content) !==\n JSON.stringify(onlineDictionary.content),\n [onlineDictionary, editedDictionary]\n );\n\n const isLocalDictionary = useMemo(\n () => typeof (dictionary as DistantDictionary)?._id === 'undefined',\n [dictionary]\n );\n\n const onSubmitSuccess = useCallback(async () => {\n await pushDictionaries([\n {\n ...dictionary,\n ...editedContent[dictionary.key],\n },\n ]);\n }, [dictionary, editedContent, pushDictionaries]);\n\n const handleOnAuditFile = async () =>\n await auditContentDeclaration({\n defaultLocale: project?.defaultLocale ?? Locales.ENGLISH,\n locales: project?.locales ?? [Locales.ENGLISH],\n fileContent: JSON.stringify(editedDictionary ?? dictionary),\n }).then((response) => {\n if (!response.data) return;\n\n const editedDictionary = JSON.parse(\n response.data.fileContent\n ) as Dictionary;\n\n setEditedContent(dictionary.key, editedDictionary.content);\n });\n\n return (\n <Form\n className=\"flex w-full flex-1 flex-row flex-wrap justify-end gap-3\"\n {...form}\n schema={SaveFormSchema}\n onSubmitSuccess={onSubmitSuccess}\n >\n <Form.Button\n type=\"button\"\n label={auditButton.label}\n disabled={isSubmitting}\n Icon={WandSparkles}\n variant=\"outline\"\n color=\"text\"\n className=\"ml-auto max-md:w-full\"\n isLoading={isAuditing}\n onClick={handleOnAuditFile}\n >\n {auditButton.text}\n </Form.Button>\n {isEdited && (\n <Form.Button\n type=\"button\"\n label={resetButton.label}\n disabled={!isEdited || isSubmitting}\n Icon={RotateCcw}\n variant=\"outline\"\n color=\"text\"\n className=\"max-md:w-full\"\n onClick={() => restoreEditedContent(dictionary.key)}\n >\n {resetButton.text}\n </Form.Button>\n )}\n {isLocalDictionary ? (\n <Form.Button\n type=\"submit\"\n label={publishButton.label}\n disabled={!isEdited || isSubmitting}\n Icon={ArrowUpFromLine}\n color=\"text\"\n className=\"max-md:w-full\"\n isLoading={isSubmitting}\n >\n {publishButton.text}\n </Form.Button>\n ) : (\n isEdited && (\n <Form.Button\n type=\"submit\"\n label={saveButton.label}\n disabled={!isEdited || isSubmitting}\n Icon={Save}\n color=\"text\"\n className=\"max-md:w-full\"\n isLoading={isSubmitting}\n >\n {saveButton.text}\n </Form.Button>\n )\n )}\n </Form>\n );\n};\n"],"names":["useAuth","usePushDictionaries","getSaveFormSchema","useGetAllDictionaries","useAuditContentDeclaration","useEditedContentStore","useShallow","useForm","useDictionary","saveDictionaryContent","useMemo","useCallback","Locales","editedDictionary","jsxs","Form","jsx","WandSparkles","RotateCcw","ArrowUpFromLine","Save"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AA,QACf;AAAA,QAED,oBACCF,2BAAA,kBAAA;AAAA,UAACD,sCAAAA,KAAK;AAAA,UAAL;AAAA,YACC,MAAK;AAAA,YACL,OAAO,cAAc;AAAA,YACrB,UAAU,CAAC,YAAY;AAAA,YACvB,MAAMI,YAAA;AAAA,YACN,OAAM;AAAA,YACN,WAAU;AAAA,YACV,WAAW;AAAA,YAEV,UAAc,cAAA;AAAA,UAAA;AAAA,YAGjB,YACEH,2BAAA,kBAAA;AAAA,UAACD,sCAAAA,KAAK;AAAA,UAAL;AAAA,YACC,MAAK;AAAA,YACL,OAAO,WAAW;AAAA,YAClB,UAAU,CAAC,YAAY;AAAA,YACvB,MAAMK,YAAA;AAAA,YACN,OAAM;AAAA,YACN,WAAU;AAAA,YACV,WAAW;AAAA,YAEV,UAAW,WAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MACd;AAAA,IAAA;AAAA,EAGN;AAEJ;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"SaveForm.d.ts","sourceRoot":"","sources":["../../../../src/components/DictionaryFieldEditor/SaveForm/SaveForm.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAG5C,OAAO,EAAwB,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAetD,KAAK,sBAAsB,GAAG;IAC5B,UAAU,EAAE,UAAU,CAAC;CACxB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,EAAE,CAAC,sBAAsB,CAsI/C,CAAC"}
1
+ {"version":3,"file":"SaveForm.d.ts","sourceRoot":"","sources":["../../../../src/components/DictionaryFieldEditor/SaveForm/SaveForm.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAG5C,OAAO,EAAwB,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAetD,KAAK,sBAAsB,GAAG;IAC5B,UAAU,EAAE,UAAU,CAAC;CACxB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,EAAE,CAAC,sBAAsB,CAoI/C,CAAC"}
@@ -17,7 +17,7 @@ import "../../Auth/SignInForm/useSignInSchema.content.mjs";
17
17
  import "../../Auth/SignUpForm/useSignUpSchema.content.mjs";
18
18
  import "../../../hooks/useScrollBlockage/useScrollBlockageStore.mjs";
19
19
  import "../../../hooks/useAsync/useAsyncStateStore.mjs";
20
- import { usePushDictionaries, useAuditFile } from "../../../hooks/intlayerAPIHooks.mjs";
20
+ import { usePushDictionaries, useAuditContentDeclaration } from "../../../hooks/intlayerAPIHooks.mjs";
21
21
  import { useGetAllDictionaries } from "../../../hooks/useGetAllDictionaries.mjs";
22
22
  import { useAuth } from "../../Auth/useAuth/index.mjs";
23
23
  import "../../Auth/ChangePasswordForm/changePasswordForm.content.mjs";
@@ -41,7 +41,7 @@ const SaveForm = ({ dictionary }) => {
41
41
  const { pushDictionaries } = usePushDictionaries();
42
42
  const SaveFormSchema = getSaveFormSchema();
43
43
  const { online } = useGetAllDictionaries();
44
- const { isLoading: isAuditing, auditFile } = useAuditFile();
44
+ const { isLoading: isAuditing, auditContentDeclaration } = useAuditContentDeclaration();
45
45
  const { editedContent, restoreEditedContent, setEditedContent } = useEditedContentStore(
46
46
  useShallow((s) => ({
47
47
  editedContent: s.editedContent,
@@ -76,7 +76,7 @@ const SaveForm = ({ dictionary }) => {
76
76
  }
77
77
  ]);
78
78
  }, [dictionary, editedContent, pushDictionaries]);
79
- const handleOnAuditFile = async () => await auditFile({
79
+ const handleOnAuditFile = async () => await auditContentDeclaration({
80
80
  defaultLocale: project?.defaultLocale ?? Locales.ENGLISH,
81
81
  locales: project?.locales ?? [Locales.ENGLISH],
82
82
  fileContent: JSON.stringify(editedDictionary ?? dictionary)
@@ -87,7 +87,6 @@ const SaveForm = ({ dictionary }) => {
87
87
  );
88
88
  setEditedContent(dictionary.key, editedDictionary2.content);
89
89
  });
90
- console.log("isLoading", isAuditing);
91
90
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(
92
91
  Form,
93
92
  {
@@ -121,7 +120,6 @@ const SaveForm = ({ dictionary }) => {
121
120
  variant: "outline",
122
121
  color: "text",
123
122
  className: "max-md:w-full",
124
- isLoading: isSubmitting,
125
123
  onClick: () => restoreEditedContent(dictionary.key),
126
124
  children: resetButton.text
127
125
  }