@flozy/editor 9.5.7 → 9.5.8

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 (256) hide show
  1. package/dist/Editor/ChatEditor.js +26 -19
  2. package/dist/Editor/CommonEditor.js +139 -22
  3. package/dist/Editor/DialogWrapper.js +31 -25
  4. package/dist/Editor/Editor.css +11 -7
  5. package/dist/Editor/Elements/AI/AIInput.js +5 -3
  6. package/dist/Editor/Elements/AI/CustomSelect.js +9 -5
  7. package/dist/Editor/Elements/AI/PopoverAIInput.js +4 -2
  8. package/dist/Editor/Elements/Accordion/Accordion.js +4 -3
  9. package/dist/Editor/Elements/Accordion/AccordionBtnPopup.js +4 -1
  10. package/dist/Editor/Elements/Accordion/AccordionButton.js +6 -2
  11. package/dist/Editor/Elements/Accordion/AccordionTitlePopup.js +4 -1
  12. package/dist/Editor/Elements/AppHeader/AppHeader.js +3 -3
  13. package/dist/Editor/Elements/AppHeader/AppHeaderButton.js +6 -2
  14. package/dist/Editor/Elements/AppHeader/AppHeaderPopup.js +4 -1
  15. package/dist/Editor/Elements/Attachments/AttachmentsButton.js +4 -1
  16. package/dist/Editor/Elements/Button/ButtonPopup.js +4 -1
  17. package/dist/Editor/Elements/Button/ButtonToolIcon.js +6 -2
  18. package/dist/Editor/Elements/Button/EditorButton.js +31 -14
  19. package/dist/Editor/Elements/Carousel/Carousel.js +5 -4
  20. package/dist/Editor/Elements/Carousel/CarouselButton.js +6 -2
  21. package/dist/Editor/Elements/Carousel/CarouselItem.js +3 -2
  22. package/dist/Editor/Elements/ChipText/ChipTextPopup.js +4 -1
  23. package/dist/Editor/Elements/CodeToText/CodeToText.js +5 -4
  24. package/dist/Editor/Elements/CodeToText/HtmlContextMenu.js +6 -2
  25. package/dist/Editor/Elements/Color Picker/ColorButtons.js +60 -14
  26. package/dist/Editor/Elements/Color Picker/ColorPicker.css +25 -1
  27. package/dist/Editor/Elements/Color Picker/ColorPicker.js +10 -7
  28. package/dist/Editor/Elements/Color Picker/Styles.js +15 -13
  29. package/dist/Editor/Elements/Colorbox/ColorboxButton.js +6 -2
  30. package/dist/Editor/Elements/DataView/DataView.js +5 -2
  31. package/dist/Editor/Elements/DataView/DataViewButton.js +6 -2
  32. package/dist/Editor/Elements/DataView/Layouts/ColumnView.js +7 -2
  33. package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/MultiSelect.js +425 -0
  34. package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/Select.js +4 -3
  35. package/dist/Editor/Elements/DataView/Layouts/DataTypes/MultiSelectType.js +25 -5
  36. package/dist/Editor/Elements/DataView/Layouts/DataTypes/TextType.js +7 -2
  37. package/dist/Editor/Elements/DataView/Layouts/FilterSort/SortOptions/ChooseSort.js +13 -12
  38. package/dist/Editor/Elements/DataView/Layouts/FilterSort/SortOptions/index.js +7 -4
  39. package/dist/Editor/Elements/DataView/Layouts/FilterSort/index.js +7 -5
  40. package/dist/Editor/Elements/DataView/Layouts/FilterView.js +9 -7
  41. package/dist/Editor/Elements/DataView/Layouts/Options/AddOptions.js +8 -3
  42. package/dist/Editor/Elements/DataView/Layouts/Options/AddProperty.js +5 -3
  43. package/dist/Editor/Elements/DataView/Layouts/Options/AllProperties.js +6 -5
  44. package/dist/Editor/Elements/DataView/Layouts/Options/ChangeProperty.js +5 -3
  45. package/dist/Editor/Elements/DataView/Layouts/Options/EditOption.js +9 -7
  46. package/dist/Editor/Elements/DataView/Layouts/Options/EditProperty.js +64 -38
  47. package/dist/Editor/Elements/DataView/Layouts/Options/FilterProperty.js +3 -2
  48. package/dist/Editor/Elements/DataView/Layouts/Options/PropertyList.js +3 -2
  49. package/dist/Editor/Elements/DataView/Layouts/Options/index.js +23 -6
  50. package/dist/Editor/Elements/DataView/Layouts/TableStyles.js +4 -1
  51. package/dist/Editor/Elements/DataView/Layouts/TableView.js +6 -4
  52. package/dist/Editor/Elements/DataView/Layouts/ViewData.js +8 -4
  53. package/dist/Editor/Elements/DataView/Layouts/index.js +3 -1
  54. package/dist/Editor/Elements/DataView/Providers/DataViewProvider.js +5 -2
  55. package/dist/Editor/Elements/DataView/styles.js +13 -0
  56. package/dist/Editor/Elements/Divider/Divider.js +5 -3
  57. package/dist/Editor/Elements/Divider/DividerButton.js +6 -2
  58. package/dist/Editor/Elements/Divider/DividerPopup.js +3 -2
  59. package/dist/Editor/Elements/Embed/Embed.js +4 -1
  60. package/dist/Editor/Elements/Embed/EmbedPopup.js +4 -1
  61. package/dist/Editor/Elements/Embed/Image.js +16 -11
  62. package/dist/Editor/Elements/Embed/Video.js +9 -6
  63. package/dist/Editor/Elements/EmbedScript/Code.js +7 -4
  64. package/dist/Editor/Elements/EmbedScript/EmbedScript.js +6 -2
  65. package/dist/Editor/Elements/EmbedScript/EmbedScriptPopup.js +8 -5
  66. package/dist/Editor/Elements/Emoji/EmojiButton.js +6 -2
  67. package/dist/Editor/Elements/Form/FieldPopup.js +4 -1
  68. package/dist/Editor/Elements/Form/Form.js +12 -9
  69. package/dist/Editor/Elements/Form/FormButton.js +6 -2
  70. package/dist/Editor/Elements/Form/FormPopup.js +3 -2
  71. package/dist/Editor/Elements/Form/Workflow/FormWorkflow.js +18 -12
  72. package/dist/Editor/Elements/Form/Workflow/ListWorkflow.js +13 -8
  73. package/dist/Editor/Elements/Form/Workflow/MoreOptions.js +3 -2
  74. package/dist/Editor/Elements/Form/Workflow/Styles.js +24 -22
  75. package/dist/Editor/Elements/Form/Workflow/UserInputs.js +4 -2
  76. package/dist/Editor/Elements/Form/Workflow/index.js +15 -9
  77. package/dist/Editor/Elements/FreeGrid/FreeGrid.js +67 -23
  78. package/dist/Editor/Elements/FreeGrid/FreeGridBox.js +23 -4
  79. package/dist/Editor/Elements/FreeGrid/FreeGridButton.js +6 -2
  80. package/dist/Editor/Elements/FreeGrid/FreeGridItem.js +36 -5
  81. package/dist/Editor/Elements/FreeGrid/Options/AddElement.js +3 -2
  82. package/dist/Editor/Elements/FreeGrid/Options/More.js +10 -4
  83. package/dist/Editor/Elements/FreeGrid/styles.js +3 -0
  84. package/dist/Editor/Elements/Grid/Grid.js +13 -10
  85. package/dist/Editor/Elements/Grid/GridButton.js +9 -5
  86. package/dist/Editor/Elements/Grid/GridItem.js +14 -8
  87. package/dist/Editor/Elements/Grid/GridItemPopup.js +4 -1
  88. package/dist/Editor/Elements/Grid/GridPopup.js +4 -1
  89. package/dist/Editor/Elements/Grid/SectionPopup.js +4 -1
  90. package/dist/Editor/Elements/Link/Link.js +8 -5
  91. package/dist/Editor/Elements/Link/LinkButton.js +4 -1
  92. package/dist/Editor/Elements/List/CheckList.js +14 -9
  93. package/dist/Editor/Elements/NewLine/NewLineButton.js +6 -2
  94. package/dist/Editor/Elements/PageSettings/PageSettingsButton.js +4 -1
  95. package/dist/Editor/Elements/PageSettings/PageSettingsPopup.js +4 -1
  96. package/dist/Editor/Elements/Search/SearchButton.js +6 -3
  97. package/dist/Editor/Elements/Search/SearchList.js +7 -3
  98. package/dist/Editor/Elements/Signature/SignatureButton.js +6 -2
  99. package/dist/Editor/Elements/Signature/SignatureOptions/TypeSignature.js +6 -2
  100. package/dist/Editor/Elements/Signature/SignatureOptions/UploadSignature.js +4 -1
  101. package/dist/Editor/Elements/Signature/SignaturePopup.js +17 -16
  102. package/dist/Editor/Elements/SimpleText/index.js +5 -4
  103. package/dist/Editor/Elements/SimpleText/style.js +2 -2
  104. package/dist/Editor/Elements/Table/DragButton.js +4 -2
  105. package/dist/Editor/Elements/Table/Table.js +23 -11
  106. package/dist/Editor/Elements/Table/TableCell.js +2 -24
  107. package/dist/Editor/Elements/Table/TablePopup.js +4 -1
  108. package/dist/Editor/Elements/Table/TableSelector.js +10 -6
  109. package/dist/Editor/Elements/Table/TableTool.js +8 -4
  110. package/dist/Editor/Elements/Title/title.js +10 -0
  111. package/dist/Editor/Elements/TopBanner/TopBannerButton.js +4 -1
  112. package/dist/Editor/Elements/Variables/VariableButton.js +10 -1
  113. package/dist/Editor/MiniEditor.js +10 -3
  114. package/dist/Editor/Styles/EditorStyles.js +5 -5
  115. package/dist/Editor/Toolbar/Basic/index.js +2 -1
  116. package/dist/Editor/Toolbar/FormatTools/BlockButton.js +6 -2
  117. package/dist/Editor/Toolbar/FormatTools/Dropdown.js +27 -3
  118. package/dist/Editor/Toolbar/FormatTools/FontFamilyAutocomplete.js +4 -3
  119. package/dist/Editor/Toolbar/FormatTools/MarkButton.js +8 -4
  120. package/dist/Editor/Toolbar/FormatTools/TextSize.js +10 -13
  121. package/dist/Editor/Toolbar/Mini/MiniToolbar.js +5 -3
  122. package/dist/Editor/Toolbar/PopupTool/AddTemplates.js +10 -5
  123. package/dist/Editor/Toolbar/PopupTool/ButtonTemplatesCard.js +10 -4
  124. package/dist/Editor/Toolbar/PopupTool/FullViewCard.js +10 -4
  125. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/MiniColorPicker.js +9 -3
  126. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectAlignment.js +42 -35
  127. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectFontSize.js +6 -13
  128. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectList.js +58 -51
  129. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectSuperSubscript.js +29 -22
  130. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectTypography.js +226 -87
  131. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +20 -10
  132. package/dist/Editor/Toolbar/PopupTool/PopperHeader.js +10 -5
  133. package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +71 -11
  134. package/dist/Editor/Toolbar/PopupTool/TemplateCard.js +11 -5
  135. package/dist/Editor/Toolbar/PopupTool/TextFormat.js +122 -42
  136. package/dist/Editor/Toolbar/PopupTool/ThemeTextFormat.js +436 -0
  137. package/dist/Editor/Toolbar/PopupTool/index.js +18 -8
  138. package/dist/Editor/Toolbar/Toolbar.js +20 -10
  139. package/dist/Editor/Toolbar/toolbarGroups.js +48 -6
  140. package/dist/Editor/assets/svg/ClearAllRounded.js +31 -0
  141. package/dist/Editor/assets/svg/ThemeIcons.js +291 -0
  142. package/dist/Editor/common/ColorPickerButton.js +39 -14
  143. package/dist/Editor/common/CustomColorPicker/index.js +131 -0
  144. package/dist/Editor/common/CustomColorPicker/style.js +53 -0
  145. package/dist/Editor/common/CustomDialog/index.js +8 -10
  146. package/dist/Editor/common/CustomDialog2/index.js +94 -0
  147. package/dist/Editor/common/CustomDialog2/style.js +67 -0
  148. package/dist/Editor/common/CustomSelect.js +43 -0
  149. package/dist/Editor/common/DnD/DragHandleButton.js +1 -1
  150. package/dist/Editor/common/FontLoader/FontLoader.js +3 -0
  151. package/dist/Editor/common/Icon.js +46 -1
  152. package/dist/Editor/common/ImageSelector/ImageSelector.js +10 -8
  153. package/dist/Editor/common/ImageSelector/Options/AddLink.js +6 -4
  154. package/dist/Editor/common/ImageSelector/Styles.js +3 -9
  155. package/dist/Editor/common/LinkSettings/NavComponents.js +14 -10
  156. package/dist/Editor/common/LinkSettings/index.js +20 -14
  157. package/dist/Editor/common/LinkSettings/navOptions.js +1 -1
  158. package/dist/Editor/common/MentionsPopup/index.js +6 -2
  159. package/dist/Editor/common/RnD/ContextMenu/CMenus.js +22 -22
  160. package/dist/Editor/common/RnD/ContextMenu/index.js +3 -2
  161. package/dist/Editor/common/RnD/ElementOptions/index.js +7 -2
  162. package/dist/Editor/common/RnD/ElementSettings/OtherSettings/SaveAsTemplate.js +8 -3
  163. package/dist/Editor/common/RnD/ElementSettings/OtherSettings/Settings.js +7 -3
  164. package/dist/Editor/common/RnD/ElementSettings/Settings/AppHeaderSettings.js +3 -2
  165. package/dist/Editor/common/RnD/ElementSettings/Settings/BoxSettings.js +3 -2
  166. package/dist/Editor/common/RnD/ElementSettings/Settings/ButtonSettings.js +3 -2
  167. package/dist/Editor/common/RnD/ElementSettings/Settings/CodeSettings.js +3 -2
  168. package/dist/Editor/common/RnD/ElementSettings/Settings/FormSettings.js +7 -4
  169. package/dist/Editor/common/RnD/ElementSettings/Settings/ImageSettings.js +3 -2
  170. package/dist/Editor/common/RnD/ElementSettings/Settings/TableSettings.js +3 -2
  171. package/dist/Editor/common/RnD/ElementSettings/Settings/TextSettings.js +6 -2
  172. package/dist/Editor/common/RnD/ElementSettings/Settings/VideoSettings.js +3 -2
  173. package/dist/Editor/common/RnD/OptionsPopup/index.js +4 -3
  174. package/dist/Editor/common/RnD/SwitchViewport/SwitchViewport.js +11 -4
  175. package/dist/Editor/common/RnD/Theme/MainThemeProvider.js +17 -0
  176. package/dist/Editor/common/RnD/Theme/ViewportStimulator.js +20 -8
  177. package/dist/Editor/common/RnD/Utils/gridDropItem.js +56 -7
  178. package/dist/Editor/common/RnD/Utils/index.js +3 -0
  179. package/dist/Editor/common/RnD/VirtualElement/ForceAutoAlignment.js +117 -0
  180. package/dist/Editor/common/RnD/VirtualElement/VirtualTextElement.js +134 -0
  181. package/dist/Editor/common/RnD/VirtualElement/helper.js +281 -0
  182. package/dist/Editor/common/RnD/VirtualElement/index.js +188 -105
  183. package/dist/Editor/common/RnD/VirtualElement/styles.js +123 -7
  184. package/dist/Editor/common/RnD/VirtualElement/updateAutoProps.js +5 -3
  185. package/dist/Editor/common/RnD/index.js +59 -7
  186. package/dist/Editor/common/Section/index.js +7 -4
  187. package/dist/Editor/common/Shorthands/elements.js +74 -3
  188. package/dist/Editor/common/SnackBar/index.js +43 -0
  189. package/dist/Editor/common/StyleBuilder/appHeaderStyle.js +4 -4
  190. package/dist/Editor/common/StyleBuilder/boxStyle.js +2 -2
  191. package/dist/Editor/common/StyleBuilder/buttonStyle.js +6 -4
  192. package/dist/Editor/common/StyleBuilder/dividerStyles.js +2 -2
  193. package/dist/Editor/common/StyleBuilder/embedVideoStyle.js +6 -6
  194. package/dist/Editor/common/StyleBuilder/fieldStyle.js +2 -2
  195. package/dist/Editor/common/StyleBuilder/fieldTypes/alignment.js +13 -9
  196. package/dist/Editor/common/StyleBuilder/fieldTypes/backgroundImage.js +11 -3
  197. package/dist/Editor/common/StyleBuilder/fieldTypes/bannerSpacing.js +19 -5
  198. package/dist/Editor/common/StyleBuilder/fieldTypes/borderRadius.js +22 -10
  199. package/dist/Editor/common/StyleBuilder/fieldTypes/buttonLink.js +6 -3
  200. package/dist/Editor/common/StyleBuilder/fieldTypes/card.js +27 -13
  201. package/dist/Editor/common/StyleBuilder/fieldTypes/color.js +43 -14
  202. package/dist/Editor/common/StyleBuilder/fieldTypes/elementSize.js +10 -6
  203. package/dist/Editor/common/StyleBuilder/fieldTypes/fontSize.js +19 -6
  204. package/dist/Editor/common/StyleBuilder/fieldTypes/gridSize.js +6 -2
  205. package/dist/Editor/common/StyleBuilder/fieldTypes/icons.js +5 -2
  206. package/dist/Editor/common/StyleBuilder/fieldTypes/menusArray.js +9 -6
  207. package/dist/Editor/common/StyleBuilder/fieldTypes/metaDataMapping.js +8 -2
  208. package/dist/Editor/common/StyleBuilder/fieldTypes/saveAsTemplate.js +12 -11
  209. package/dist/Editor/common/StyleBuilder/fieldTypes/selectBox.js +6 -2
  210. package/dist/Editor/common/StyleBuilder/fieldTypes/text.js +8 -4
  211. package/dist/Editor/common/StyleBuilder/fieldTypes/textAlign.js +6 -2
  212. package/dist/Editor/common/StyleBuilder/fieldTypes/textOptions.js +21 -12
  213. package/dist/Editor/common/StyleBuilder/formStyle.js +7 -7
  214. package/dist/Editor/common/StyleBuilder/gridItemStyle.js +6 -6
  215. package/dist/Editor/common/StyleBuilder/gridStyle.js +5 -5
  216. package/dist/Editor/common/StyleBuilder/index.js +8 -5
  217. package/dist/Editor/common/StyleBuilder/pageSettingsStyle.js +5 -7
  218. package/dist/Editor/common/Uploader.js +16 -5
  219. package/dist/Editor/commonStyle.js +68 -57
  220. package/dist/Editor/helper/index.js +35 -15
  221. package/dist/Editor/helper/textIndeces.js +58 -0
  222. package/dist/Editor/helper/theme.js +202 -2
  223. package/dist/Editor/hooks/useAutoScroll.js +38 -0
  224. package/dist/Editor/hooks/useDrag.js +16 -10
  225. package/dist/Editor/hooks/useEditorScroll.js +10 -5
  226. package/dist/Editor/hooks/useEditorTheme.js +153 -0
  227. package/dist/Editor/hooks/useMouseMove.js +25 -13
  228. package/dist/Editor/hooks/useTable.js +1 -1
  229. package/dist/Editor/hooks/useThemeValues.js +63 -0
  230. package/dist/Editor/plugins/withEmbeds.js +1 -1
  231. package/dist/Editor/plugins/withHTML.js +10 -7
  232. package/dist/Editor/plugins/withLayout.js +3 -2
  233. package/dist/Editor/plugins/withTable.js +1 -1
  234. package/dist/Editor/theme/ThemeList.js +50 -173
  235. package/dist/Editor/theme/index.js +147 -0
  236. package/dist/Editor/themeSettings/ActiveTheme.js +72 -0
  237. package/dist/Editor/themeSettings/buttons/index.js +290 -0
  238. package/dist/Editor/themeSettings/buttons/style.js +23 -0
  239. package/dist/Editor/themeSettings/colorTheme/index.js +310 -0
  240. package/dist/Editor/themeSettings/colorTheme/style.js +81 -0
  241. package/dist/Editor/themeSettings/fonts/PreviewElement.js +121 -0
  242. package/dist/Editor/themeSettings/fonts/index.js +240 -0
  243. package/dist/Editor/themeSettings/fonts/style.js +61 -0
  244. package/dist/Editor/themeSettings/icons.js +60 -0
  245. package/dist/Editor/themeSettings/index.js +351 -0
  246. package/dist/Editor/themeSettings/style.js +220 -0
  247. package/dist/Editor/themeSettingsAI/icons.js +96 -0
  248. package/dist/Editor/themeSettingsAI/index.js +355 -0
  249. package/dist/Editor/themeSettingsAI/saveTheme.js +205 -0
  250. package/dist/Editor/themeSettingsAI/style.js +259 -0
  251. package/dist/Editor/utils/SlateUtilityFunctions.js +167 -48
  252. package/dist/Editor/utils/draftToSlate.js +3 -2
  253. package/dist/Editor/utils/font.js +40 -37
  254. package/dist/Editor/utils/freegrid.js +2 -2
  255. package/dist/Editor/utils/helper.js +90 -19
  256. package/package.json +2 -2
@@ -1,6 +1,6 @@
1
1
  import React, { useCallback, useMemo, useRef, useImperativeHandle, forwardRef, useState } from "react";
2
- import { Editable, Slate, ReactEditor } from 'slate-react';
3
- import { createEditor, Transforms, Editor } from 'slate';
2
+ import { Editable, Slate, ReactEditor } from "slate-react";
3
+ import { createEditor, Transforms, Editor } from "slate";
4
4
  import withCommon from "./hooks/withCommon";
5
5
  import { getBlock, getMarked, serializeMentions } from "./utils/chatEditor/SlateUtilityFunctions";
6
6
  import MiniTextFormat from "./Toolbar/PopupTool/MiniTextFormat";
@@ -32,15 +32,16 @@ const ChatEditor = /*#__PURE__*/forwardRef((props, ref) => {
32
32
  onBlur = () => {},
33
33
  isMobile = false,
34
34
  debounceTimeOut = 10,
35
+ translation,
35
36
  isMarkDown = false,
36
- markDownContent = ''
37
+ markDownContent = ""
37
38
  } = props;
38
39
  const classes = usePopupStyle(theme);
39
40
  const convertedContent = draftToSlate({
40
41
  data: content && content?.length > 0 ? content : [{
41
- type: 'paragraph',
42
+ type: "paragraph",
42
43
  children: [{
43
- text: ''
44
+ text: ""
44
45
  }]
45
46
  }]
46
47
  });
@@ -147,17 +148,11 @@ const ChatEditor = /*#__PURE__*/forwardRef((props, ref) => {
147
148
  };
148
149
  const {
149
150
  CHARACTERS = [],
150
- hideTools
151
+ hideTools,
152
+ translationMock
151
153
  // needLayout = true,
152
154
  } = otherProps || {};
153
155
  const mentionsRef = useRef();
154
- const customProps = {
155
- ...(otherProps || {}),
156
- hideTools: ["settings", "add_column", "drag", "resize"],
157
- readOnly: isReadOnly,
158
- editorPlaceholder: "Write Something",
159
- page_id: 1
160
- };
161
156
  const [mentions, setMentions] = useMentions({
162
157
  editor,
163
158
  selection: editor?.selection
@@ -218,6 +213,15 @@ const ChatEditor = /*#__PURE__*/forwardRef((props, ref) => {
218
213
  debounced(newValue);
219
214
  debouncedValue.current = newValue;
220
215
  };
216
+ const dummyTranslation = () => {};
217
+ const customProps = {
218
+ ...(otherProps || {}),
219
+ hideTools: ["settings", "add_column", "drag", "resize"],
220
+ readOnly: isReadOnly,
221
+ editorPlaceholder: "Write Something",
222
+ page_id: 1,
223
+ translation: translation || translationMock || dummyTranslation
224
+ };
221
225
  const Element = props => {
222
226
  return getBlock(props);
223
227
  };
@@ -253,7 +257,7 @@ const ChatEditor = /*#__PURE__*/forwardRef((props, ref) => {
253
257
  editor
254
258
  });
255
259
  } else if (event.key === "Enter" && !isMobile) {
256
- const isEmpty = debouncedValue?.current.length === 1 && debouncedValue?.current[0].type === 'paragraph' && debouncedValue?.current[0].children.length === 1 && debouncedValue?.current[0].children[0].text === '';
260
+ const isEmpty = debouncedValue?.current.length === 1 && debouncedValue?.current[0].type === "paragraph" && debouncedValue?.current[0].children.length === 1 && debouncedValue?.current[0].children[0].text === "";
257
261
  if (isEmpty) {
258
262
  event.preventDefault();
259
263
  return;
@@ -293,10 +297,10 @@ const ChatEditor = /*#__PURE__*/forwardRef((props, ref) => {
293
297
  }
294
298
  };
295
299
 
300
+ const html = isMarkDown ? convertMDToHTML(markDownContent) : null;
296
301
  const handleFocus = () => {
297
302
  setIsFocused(true);
298
303
  };
299
- const html = isMarkDown ? convertMDToHTML(markDownContent) : null;
300
304
  return !isMarkDown ? /*#__PURE__*/_jsx(EditorProvider, {
301
305
  theme: theme,
302
306
  editor: editor,
@@ -307,18 +311,20 @@ const ChatEditor = /*#__PURE__*/forwardRef((props, ref) => {
307
311
  children: [toolBar && /*#__PURE__*/_jsx(MiniTextFormat, {
308
312
  classes: classes,
309
313
  editor: editor,
310
- closeMainPopup: handleClose
314
+ closeMainPopup: handleClose,
315
+ customProps: customProps
311
316
  }), /*#__PURE__*/_jsx(Editable, {
312
- onFocus: handleFocus,
313
317
  className: "chatEditorRoot",
314
318
  renderElement: renderElement,
315
319
  renderLeaf: renderLeaf,
316
320
  decorate: decorators,
317
321
  placeholder: "Start typing ...",
318
322
  spellCheck: true,
323
+ onFocus: handleFocus,
319
324
  onBlur: handleBlur,
320
325
  onKeyDown: onKeyDown,
321
- onPaste: handlePaste
326
+ onPaste: handlePaste,
327
+ customProps: customProps
322
328
  }), !readOnly && isFocused ? /*#__PURE__*/_jsx(MentionsPopup, {
323
329
  ref: mentionsRef,
324
330
  mentions: mentions,
@@ -328,7 +334,8 @@ const ChatEditor = /*#__PURE__*/forwardRef((props, ref) => {
328
334
  index: index,
329
335
  chars: chars,
330
336
  type: type,
331
- theme: theme
337
+ theme: theme,
338
+ customProps: customProps
332
339
  }) : null]
333
340
  }, id)
334
341
  }) : /*#__PURE__*/_jsx("div", {
@@ -1,7 +1,7 @@
1
1
  /* eslint-disable no-unused-vars */
2
- import React, { useRef, useCallback, useEffect, useMemo, useState, forwardRef, useImperativeHandle } from "react";
2
+ import React, { useRef, useCallback, useEffect, useMemo, useState, forwardRef, useImperativeHandle, createContext } from "react";
3
3
  import PropTypes from "prop-types";
4
- import { createEditor, Range, Transforms } from "slate";
4
+ import { createEditor, Editor, Range, Transforms } from "slate";
5
5
  import { Slate, Editable, ReactEditor } from "slate-react";
6
6
  import { useDebouncedCallback } from "use-debounce";
7
7
  import { getMarked, getBlock } from "./utils/SlateUtilityFunctions";
@@ -15,9 +15,9 @@ import withCommon from "./hooks/withCommon";
15
15
  import DialogWrapper from "./DialogWrapper";
16
16
  import { serializeToText } from "./utils/serializeToText";
17
17
  import { getPageSettings } from "./utils/pageSettings";
18
- import { getThumbnailImage, invertColor } from "./helper";
18
+ import { getThumbnailImage, invertColor, pageTextStyle } from "./helper";
19
19
  import PopupTool from "./Toolbar/PopupTool";
20
- import { Box, Typography, useTheme } from "@mui/material";
20
+ import { Box, Typography, useTheme, IconButton } from "@mui/material";
21
21
  import Shorthands from "./common/Shorthands";
22
22
  import MiniToolbar from "./Toolbar/Mini/MiniToolbar";
23
23
  import { EditorProvider } from "./hooks/useMouseMove";
@@ -26,9 +26,12 @@ import editorStyles from "./Styles/EditorStyles";
26
26
  import DragAndDrop from "./common/DnD";
27
27
  import Section from "./common/Section";
28
28
  import decorators from "./utils/Decorators";
29
- import { getBreakpointLineSpacing, getTRBLBreakPoints } from "./helper/theme";
29
+ import { getTRBLBreakPoints, getVariableValue, getBreakpointLineSpacing } from "./helper/theme";
30
30
  import { getInitialValue, handleInsertLastElement, isEverythingSelected, isFreeGrid, isFreeGridFragment, isRestrictedNode, outsideEditorClickLabel } from "./utils/helper";
31
31
  import useWindowResize from "./hooks/useWindowResize";
32
+ import { getTheme } from "./theme";
33
+ import ThemeSettings from "./themeSettings";
34
+ import ThemeSettingsAI from "./themeSettingsAI";
32
35
  import PopoverAIInput from "./Elements/AI/PopoverAIInput";
33
36
  import RnDCopy from "./common/RnD/RnDCopy";
34
37
  import SwitchViewport from "./common/RnD/SwitchViewport/SwitchViewport";
@@ -37,9 +40,12 @@ import "./font.css";
37
40
  import "./Editor.css";
38
41
  import "animate.css";
39
42
  import FontLoader from "./common/FontLoader/FontLoader";
43
+ import { ThemeAIIcon, ThemePaintIcon } from "./assets/svg/ThemeIcons";
40
44
  import { CustomDialogComponent } from "./common/CustomDialog";
45
+ import { extractTextWithPath, replaceTextPath } from "./helper/textIndeces.js";
41
46
  import { jsx as _jsx } from "react/jsx-runtime";
42
47
  import { jsxs as _jsxs } from "react/jsx-runtime";
48
+ export const ThemeContext = /*#__PURE__*/createContext(null);
43
49
  const Item = /*#__PURE__*/forwardRef(({
44
50
  children,
45
51
  ...props
@@ -81,6 +87,7 @@ const updateTopBanner = (content = [], setTopBanner) => {
81
87
  return firstNode?.type === "topbanner" ? firstNode : null;
82
88
  });
83
89
  };
90
+ const dummyTranslation = () => {};
84
91
  const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
85
92
  const {
86
93
  id,
@@ -94,13 +101,16 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
94
101
  otherProps,
95
102
  isIframe,
96
103
  theme,
104
+ showThemeButtons,
97
105
  showViewport = false,
98
- overrideWrapperStyles = {}
106
+ overrideWrapperStyles = {},
107
+ translation
99
108
  } = props;
100
109
  const editorWrapper = useRef();
101
110
  const mentionsRef = useRef();
102
111
  const convertedContent = draftToSlate({
103
- data: content
112
+ data: content,
113
+ needLayout: otherProps?.needLayout
104
114
  });
105
115
  const [value, setValue] = useState(convertedContent);
106
116
  const [isInteracted, setIsInteracted] = useState(false);
@@ -125,12 +135,15 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
125
135
  editorClass,
126
136
  fixedWidth = "60%",
127
137
  fullWidth = "80%",
128
- hideTools = []
138
+ hideTools = [],
139
+ translationMock
129
140
  } = otherProps || {};
141
+ const translationFn = translation || translationMock || dummyTranslation;
130
142
  const editor = useMemo(() => {
131
143
  if (collaborativeEditor) return collaborativeEditor;
132
144
  const editor = createEditor();
133
145
  editor.needLayout = needLayout;
146
+ editor.translation = translationFn;
134
147
  return withCommon(editor, {
135
148
  needLayout
136
149
  });
@@ -141,10 +154,11 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
141
154
  const {
142
155
  bannerSpacing,
143
156
  pageBgImage,
144
- pageColor,
157
+ pageColor = "",
145
158
  color: pageTextColor,
146
159
  pageWidth,
147
160
  maxWidth: pageMaxWidth,
161
+ theme: selectedTheme,
148
162
  lineHeight
149
163
  } = pageSt?.pageProps || {
150
164
  bannerSpacing: {
@@ -156,10 +170,17 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
156
170
  };
157
171
  const classes = editorStyles({
158
172
  padHeight: !fullScreen ? otherProps?.padHeight : 20,
159
- placeHolderColor: invertColor(pageColor || "#FFF"),
173
+ placeHolderColor: invertColor(pageColor.startsWith("var") ? getVariableValue(pageColor) : pageColor || "#FFF"),
160
174
  theme,
161
175
  overrideWrapperStyles
162
176
  });
177
+ const [openTheme, setOpenTheme] = useState(false);
178
+ const [openAITheme, setOpenAITheme] = useState(false);
179
+ const [, setThemeUpdated] = useState(0);
180
+ const triggerRender = () => {
181
+ setThemeUpdated(prev => prev + 1); // Incrementing forces a re-render while updating theme
182
+ };
183
+
163
184
  const isMobile = window.matchMedia("(max-width: 899px)")?.matches || false;
164
185
  useEffect(() => {
165
186
  setValue(draftToSlate({
@@ -173,11 +194,11 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
173
194
  const debounced = useDebouncedCallback(
174
195
  // function
175
196
  value => {
197
+ debouncedValue.current = value;
176
198
  const {
177
199
  value: strVal,
178
200
  ...restVal
179
201
  } = getOnSaveData(value);
180
- debouncedValue.current = value;
181
202
  onSave(strVal, restVal);
182
203
  },
183
204
  // delay in ms
@@ -188,7 +209,7 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
188
209
  return {
189
210
  value: JSON.stringify(val),
190
211
  text: text,
191
- title: serializeToText(title?.children) || "Untitled"
212
+ title: serializeToText(title?.children) || ""
192
213
  };
193
214
  };
194
215
  const getTitleSaveData = title => {
@@ -220,7 +241,9 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
220
241
 
221
242
  const onSwitchBreakpoint = b => {
222
243
  setBreakpoint(b);
223
- reRenderAllNodes();
244
+ setTimeout(() => {
245
+ reRenderAllNodes();
246
+ }, 0);
224
247
  };
225
248
  useImperativeHandle(ref, () => ({
226
249
  async getThumbnail(needBackground = false, options = {}) {
@@ -298,6 +321,12 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
298
321
  redo() {
299
322
  editor?.redo();
300
323
  },
324
+ toggleTheme() {
325
+ setOpenTheme(!openTheme);
326
+ },
327
+ toggleAITheme() {
328
+ setOpenAITheme(!openAITheme);
329
+ },
301
330
  getPageSettings: {
302
331
  background: pageBgImage && pageBgImage !== "none" ? `url(${pageBgImage})` : pageColor || ""
303
332
  }
@@ -323,6 +352,7 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
323
352
  ...mentions,
324
353
  CHARACTERS,
325
354
  hideTools: updatedHideTools || [],
355
+ translation: translation || translationFn,
326
356
  editor
327
357
  }) : [];
328
358
  const handleEditorChange = newValue => {
@@ -350,9 +380,10 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
350
380
  isIframe: isIframe,
351
381
  onDrawerOpen: onDrawerOpen,
352
382
  ICON_API: "https://assets.agenciflow.com",
383
+ translation: translationFn,
353
384
  getTitleSaveData
354
385
  };
355
- const lineH = getBreakpointLineSpacing(lineHeight, breakpoint);
386
+ const lineH = getBreakpointLineSpacing(lineHeight, breakpoint || (isMobile ? "xs" : ""));
356
387
  const renderElement = useCallback(props => {
357
388
  return /*#__PURE__*/_jsx(Element, {
358
389
  ...props,
@@ -486,7 +517,7 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
486
517
  };
487
518
  const editorWrapperStyle = useMemo(() => {
488
519
  const style = {
489
- color: pageTextColor || ""
520
+ // color: pageTextColor || "",
490
521
  };
491
522
  if (pageBgImage && pageBgImage !== "none") {
492
523
  style.backgroundImage = `url(${pageBgImage})`;
@@ -497,6 +528,7 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
497
528
  }
498
529
  return style;
499
530
  }, [pageBgImage, pageColor, pageTextColor]);
531
+ const themeProps = getTheme(selectedTheme);
500
532
 
501
533
  // const handleContextMenu = (e) => {
502
534
  // if (!readOnly) {
@@ -505,6 +537,7 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
505
537
  // }
506
538
  // };
507
539
 
540
+ const gradientColor = pageTextStyle(pageTextColor);
508
541
  const handleCursorScroll = container => {
509
542
  try {
510
543
  if (!customProps?.isMobile) {
@@ -526,14 +559,74 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
526
559
  console.log("handleCursorScroll", err);
527
560
  }
528
561
  };
562
+ window.getTextIndeces = () => {
563
+ try {
564
+ const textWithPaths = extractTextWithPath(editor.children, []);
565
+ return textWithPaths;
566
+ } catch (err) {
567
+ console.log(err);
568
+ }
569
+ };
570
+ window.replaceTextIndeces = (path_data = []) => {
571
+ try {
572
+ const replacedJson = replaceTextPath(JSON.parse(JSON.stringify(editor.children)), path_data);
573
+
574
+ // loop delete all
575
+ editor.children.forEach(() => {
576
+ Transforms.delete(editor, {
577
+ at: [0]
578
+ });
579
+ });
580
+
581
+ // Insert new nodes
582
+ Transforms.insertNodes(editor, replacedJson, {
583
+ at: [0]
584
+ });
585
+ } catch (err) {
586
+ console.log(err);
587
+ }
588
+ };
589
+ window.replaceEditorContent = (fragments = []) => {
590
+ try {
591
+ // loop delete all
592
+ editor.children.forEach(() => {
593
+ Transforms.delete(editor, {
594
+ at: [0]
595
+ });
596
+ });
597
+
598
+ // Insert new nodes
599
+ Transforms.insertNodes(editor, fragments, {
600
+ at: [0]
601
+ });
602
+ } catch (err) {
603
+ console.log(err);
604
+ }
605
+ };
529
606
  return /*#__PURE__*/_jsxs(EditorProvider, {
530
607
  theme: theme,
531
608
  editor: editor,
532
- children: [/*#__PURE__*/_jsx(DialogWrapper, {
609
+ openTheme: openTheme,
610
+ setOpenTheme: setOpenTheme,
611
+ triggerRender: triggerRender,
612
+ children: [showThemeButtons ? /*#__PURE__*/_jsxs("div", {
613
+ className: "theme-buttons",
614
+ children: [/*#__PURE__*/_jsx(IconButton, {
615
+ onClick: () => setOpenTheme(true),
616
+ children: /*#__PURE__*/_jsx(ThemePaintIcon, {})
617
+ }), /*#__PURE__*/_jsx(IconButton, {
618
+ onClick: () => setOpenAITheme(true),
619
+ style: {
620
+ marginTop: "4px"
621
+ },
622
+ children: /*#__PURE__*/_jsx(ThemeAIIcon, {})
623
+ })]
624
+ }) : null, /*#__PURE__*/_jsx(DialogWrapper, {
533
625
  classes: classes,
534
626
  ...props,
535
627
  fullScreen: fullScreen,
536
628
  footer: footer || "",
629
+ selectedTheme: selectedTheme,
537
630
  children: /*#__PURE__*/_jsxs(Box, {
538
631
  component: "div",
539
632
  className: `et-wrpr stimulate-${breakpoint} ${editorClass || ""} ${isIframe ? "iframe-editor" : ""}`,
@@ -552,7 +645,12 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
552
645
  children: /*#__PURE__*/_jsxs(Overlay, {
553
646
  children: [/*#__PURE__*/_jsx(Box, {
554
647
  className: `pc-${editorClass || ""} ${hasTopBanner() ? "has-topbanner" : ""} ${!pageColor ? "no-color" : ""} scrollable-content scrollSmooth ${readOnly ? "readOnlyContainer" : ""}`,
555
- sx: classes.slateWrapper,
648
+ sx: {
649
+ ...classes.slateWrapper,
650
+ '& span[data-slate-string="true"]': {
651
+ ...gradientColor
652
+ }
653
+ },
556
654
  id: "slate-wrapper-scroll-container",
557
655
  ref: editorWrapper,
558
656
  onClick: e => {
@@ -563,6 +661,7 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
563
661
  children: /*#__PURE__*/_jsxs(Box, {
564
662
  component: "div",
565
663
  className: "max-content",
664
+ sx: themeProps?.sxProps || {},
566
665
  "data-info": outsideEditorClickLabel,
567
666
  children: [renderTopBanner(), /*#__PURE__*/_jsx("div", {
568
667
  className: "scroll-area",
@@ -607,6 +706,7 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
607
706
  chars: chars,
608
707
  type: type,
609
708
  theme: theme,
709
+ customProps: customProps,
610
710
  otherProps: customProps
611
711
  }) : null, /*#__PURE__*/_jsx(RnDCopy, {
612
712
  readOnly: readOnly
@@ -617,7 +717,8 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
617
717
  theme: theme
618
718
  }) : null, /*#__PURE__*/_jsx(PopoverAIInput, {
619
719
  otherProps: otherProps || {},
620
- editorWrapper: editorWrapper
720
+ editorWrapper: editorWrapper,
721
+ translation: translation || translationMock
621
722
  }), footer && (fullScreen || readOnly) && /*#__PURE__*/_jsx(Typography, {
622
723
  sx: {
623
724
  color: "rgb(100, 116, 139)",
@@ -629,6 +730,18 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
629
730
  "data-info": outsideEditorClickLabel,
630
731
  onClick: handleFooterClick,
631
732
  children: footer
733
+ }), openTheme ? /*#__PURE__*/_jsx(ThemeSettings, {
734
+ open: openTheme,
735
+ setOpen: setOpenTheme,
736
+ editor: editor,
737
+ services: otherProps?.services,
738
+ appTheme: theme,
739
+ customProps: customProps
740
+ }) : null, /*#__PURE__*/_jsx(ThemeSettingsAI, {
741
+ openAITheme: openAITheme,
742
+ setOpenAITheme: setOpenAITheme,
743
+ onSaveTheme: otherProps?.onSaveTheme,
744
+ theme: theme
632
745
  })]
633
746
  })
634
747
  }), !readOnly ? /*#__PURE__*/_jsx(PopupTool, {
@@ -637,14 +750,17 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
637
750
  setIsTextSelected: setIsTextSelected,
638
751
  customProps: customProps,
639
752
  editorWrapper: editorWrapper
640
- }) : null, !readOnly && showViewport ? /*#__PURE__*/_jsx(SwitchViewport, {
753
+ }) : null, !readOnly ? /*#__PURE__*/_jsx(SwitchViewport, {
641
754
  breakpoint: breakpoint,
642
- onChange: b => onSwitchBreakpoint(b)
755
+ show: showViewport,
756
+ onChange: b => onSwitchBreakpoint(b),
757
+ translation: translation || translationMock
643
758
  }) : null]
644
759
  })
645
760
  }), htmlAction.showInput && /*#__PURE__*/_jsx(CodeToText, {
646
761
  ...htmlAction,
647
- handleCodeToText: handleCodeToText
762
+ handleCodeToText: handleCodeToText,
763
+ translation: translation || translationMock
648
764
  })]
649
765
  }, id), /*#__PURE__*/_jsx(FontLoader, {
650
766
  otherProps: {
@@ -660,7 +776,8 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
660
776
  cancelText: "Cancel",
661
777
  onConfirm: () => {
662
778
  handleDeleteAll();
663
- }
779
+ },
780
+ translation: translation || translationMock
664
781
  })]
665
782
  });
666
783
  });
@@ -2,6 +2,7 @@ import React from "react";
2
2
  import { Dialog, DialogTitle, DialogContent, IconButton, Grid } from "@mui/material";
3
3
  import CloseIcon from "@mui/icons-material/Close";
4
4
  import ViewportStimulator from "./common/RnD/Theme/ViewportStimulator";
5
+ import MainThemeProvider from "./common/RnD/Theme/MainThemeProvider";
5
6
  import { jsx as _jsx } from "react/jsx-runtime";
6
7
  import { jsxs as _jsxs } from "react/jsx-runtime";
7
8
  const DialogWrapper = props => {
@@ -9,40 +10,45 @@ const DialogWrapper = props => {
9
10
  fullScreen,
10
11
  onClose,
11
12
  children,
12
- classes
13
+ classes,
14
+ selectedTheme
13
15
  } = props;
14
- return fullScreen ? /*#__PURE__*/_jsxs(Dialog, {
15
- className: `dialogComp`,
16
- open: fullScreen,
17
- fullScreen: fullScreen,
18
- onClose: onClose,
19
- style: {
20
- zIndex: 1000
21
- },
22
- sx: classes.fullScreenWrapper,
23
- children: [/*#__PURE__*/_jsx(DialogTitle, {
16
+ return fullScreen ? /*#__PURE__*/_jsx(MainThemeProvider, {
17
+ userSelectedTheme: selectedTheme,
18
+ children: /*#__PURE__*/_jsxs(Dialog, {
19
+ className: `dialogComp`,
20
+ open: fullScreen,
21
+ fullScreen: fullScreen,
22
+ onClose: onClose,
24
23
  style: {
25
- padding: "6px 8px"
24
+ zIndex: 1000
26
25
  },
27
- children: /*#__PURE__*/_jsx(Grid, {
26
+ sx: classes.fullScreenWrapper,
27
+ children: [/*#__PURE__*/_jsx(DialogTitle, {
28
+ style: {
29
+ padding: "6px 8px"
30
+ },
28
31
  children: /*#__PURE__*/_jsx(Grid, {
29
- style: {
30
- display: "flex",
31
- justifyContent: "end"
32
- },
33
- children: /*#__PURE__*/_jsx(IconButton, {
34
- onClick: onClose,
32
+ children: /*#__PURE__*/_jsx(Grid, {
35
33
  style: {
36
- background: "rgba(255,255,255,0.5)"
34
+ display: "flex",
35
+ justifyContent: "end"
37
36
  },
38
- children: /*#__PURE__*/_jsx(CloseIcon, {})
37
+ children: /*#__PURE__*/_jsx(IconButton, {
38
+ onClick: onClose,
39
+ style: {
40
+ background: "rgba(255,255,255,0.5)"
41
+ },
42
+ children: /*#__PURE__*/_jsx(CloseIcon, {})
43
+ })
39
44
  })
40
45
  })
41
- })
42
- }), /*#__PURE__*/_jsx(DialogContent, {
43
- children: children
44
- })]
46
+ }), /*#__PURE__*/_jsx(DialogContent, {
47
+ children: children
48
+ })]
49
+ })
45
50
  }) : /*#__PURE__*/_jsx(ViewportStimulator, {
51
+ selectedTheme: selectedTheme,
46
52
  children: children
47
53
  });
48
54
  };
@@ -1342,19 +1342,23 @@ code.markcode {
1342
1342
  background-color: #f3f3f3;
1343
1343
  font-family: 'Source Code Pro' !important;
1344
1344
  }
1345
+
1345
1346
  /* Hide the popper when the reference is hidden */
1346
1347
  .hide-popper-on-overlap[data-popper-escaped],
1347
1348
  .hide-popper-on-overlap[data-popper-reference-hidden] {
1348
1349
  visibility: hidden;
1349
1350
  pointer-events: none;
1350
1351
  }
1351
- code.markcode {
1352
- border-radius: 4px;
1353
- padding: 6px 8px;
1354
- margin: 8px 0px;
1355
- display: block;
1356
- background-color: #f3f3f3;
1357
- font-family: 'Source Code Pro' !important;
1352
+
1353
+ .theme-buttons {
1354
+ display: flex;
1355
+ justify-content: end;
1356
+ align-items: center;
1357
+ margin: auto;
1358
+ position: absolute;
1359
+ top: 60px;
1360
+ right: 20px;
1361
+ z-index: 1000;
1358
1362
  }
1359
1363
 
1360
1364
  .hyperLink {
@@ -43,7 +43,8 @@ function AIInput({
43
43
  onClickOutside,
44
44
  startRecording,
45
45
  loading,
46
- isMobile
46
+ isMobile,
47
+ translation
47
48
  }, ref) {
48
49
  const {
49
50
  theme
@@ -115,7 +116,7 @@ function AIInput({
115
116
  children: /*#__PURE__*/_jsx(WaveLoading, {})
116
117
  }) : /*#__PURE__*/_jsx(TextareaAutosize, {
117
118
  className: "ai-input",
118
- placeholder: "Ask AI to write anything...",
119
+ placeholder: translation("askAItoWrite"),
119
120
  ref: inputRef,
120
121
  value: inputValue,
121
122
  onChange: onInputChange,
@@ -150,7 +151,8 @@ function AIInput({
150
151
  children: /*#__PURE__*/_jsx(CustomSelect, {
151
152
  ...props,
152
153
  onSend: onSend,
153
- classes: classes
154
+ classes: classes,
155
+ translation: translation
154
156
  })
155
157
  })]
156
158
  });
@@ -9,7 +9,8 @@ function CustomSelect({
9
9
  options,
10
10
  onSend,
11
11
  show,
12
- btnProps = {}
12
+ btnProps = {},
13
+ translation
13
14
  }) {
14
15
  if (show) {
15
16
  return /*#__PURE__*/_jsx(Box, {
@@ -31,7 +32,8 @@ function CustomSelect({
31
32
  option: option,
32
33
  classes: classes,
33
34
  onSend: onSend,
34
- btnProps: btnProps
35
+ btnProps: btnProps,
36
+ translation: translation
35
37
  }, i);
36
38
  })]
37
39
  }, index);
@@ -46,7 +48,8 @@ function DisplayOption({
46
48
  option,
47
49
  classes,
48
50
  onSend,
49
- btnProps = {}
51
+ btnProps = {},
52
+ translation
50
53
  }) {
51
54
  const {
52
55
  Icon,
@@ -85,7 +88,7 @@ function DisplayOption({
85
88
  children: [/*#__PURE__*/_jsxs("div", {
86
89
  className: "option-label",
87
90
  id: "infinity-select-popover",
88
- children: [Icon && /*#__PURE__*/_jsx(Icon, {}), option.label]
91
+ children: [Icon && /*#__PURE__*/_jsx(Icon, {}), translation(option.label)]
89
92
  }), showChild ? /*#__PURE__*/_jsx(IconButton, {
90
93
  children: /*#__PURE__*/_jsx(FaChevronRight, {
91
94
  color: "#94A3B8",
@@ -108,7 +111,8 @@ function DisplayOption({
108
111
  options: option.options,
109
112
  onSend: onSend,
110
113
  classes: classes,
111
- show: open
114
+ show: open,
115
+ translation: translation
112
116
  })
113
117
  })
114
118
  })]