@flozy/editor 9.8.3 → 9.8.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (257) hide show
  1. package/dist/Editor/ChatEditor.js +26 -19
  2. package/dist/Editor/CommonEditor.js +141 -26
  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 +15 -5
  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 +43 -30
  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 +4 -2
  33. package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/MultiSelect.js +448 -0
  34. package/dist/Editor/Elements/DataView/Layouts/DataTypes/MultiSelectType.js +21 -6
  35. package/dist/Editor/Elements/DataView/Layouts/FilterSort/SortOptions/ChooseSort.js +13 -12
  36. package/dist/Editor/Elements/DataView/Layouts/FilterSort/SortOptions/index.js +7 -4
  37. package/dist/Editor/Elements/DataView/Layouts/FilterSort/index.js +7 -5
  38. package/dist/Editor/Elements/DataView/Layouts/FilterView.js +9 -7
  39. package/dist/Editor/Elements/DataView/Layouts/Options/AddOptions.js +8 -3
  40. package/dist/Editor/Elements/DataView/Layouts/Options/AddProperty.js +5 -3
  41. package/dist/Editor/Elements/DataView/Layouts/Options/AllProperties.js +6 -5
  42. package/dist/Editor/Elements/DataView/Layouts/Options/ChangeProperty.js +5 -3
  43. package/dist/Editor/Elements/DataView/Layouts/Options/EditOption.js +9 -7
  44. package/dist/Editor/Elements/DataView/Layouts/Options/EditProperty.js +15 -12
  45. package/dist/Editor/Elements/DataView/Layouts/Options/FilterProperty.js +3 -2
  46. package/dist/Editor/Elements/DataView/Layouts/Options/PropertyList.js +3 -2
  47. package/dist/Editor/Elements/DataView/Layouts/Options/index.js +23 -6
  48. package/dist/Editor/Elements/DataView/Layouts/TableView.js +6 -4
  49. package/dist/Editor/Elements/DataView/Layouts/ViewData.js +8 -4
  50. package/dist/Editor/Elements/DataView/Layouts/index.js +3 -1
  51. package/dist/Editor/Elements/DataView/Providers/DataViewProvider.js +5 -2
  52. package/dist/Editor/Elements/Divider/Divider.js +5 -3
  53. package/dist/Editor/Elements/Divider/DividerButton.js +6 -2
  54. package/dist/Editor/Elements/Divider/DividerPopup.js +3 -2
  55. package/dist/Editor/Elements/Embed/Embed.js +4 -1
  56. package/dist/Editor/Elements/Embed/EmbedPopup.js +4 -1
  57. package/dist/Editor/Elements/Embed/Image.js +16 -11
  58. package/dist/Editor/Elements/Embed/Video.js +10 -7
  59. package/dist/Editor/Elements/EmbedScript/Code.js +7 -4
  60. package/dist/Editor/Elements/EmbedScript/EmbedScript.js +6 -2
  61. package/dist/Editor/Elements/EmbedScript/EmbedScriptPopup.js +8 -5
  62. package/dist/Editor/Elements/Emoji/EmojiButton.js +6 -2
  63. package/dist/Editor/Elements/Form/FieldPopup.js +4 -1
  64. package/dist/Editor/Elements/Form/Form.js +12 -9
  65. package/dist/Editor/Elements/Form/FormButton.js +6 -2
  66. package/dist/Editor/Elements/Form/FormPopup.js +3 -2
  67. package/dist/Editor/Elements/Form/Workflow/FormWorkflow.js +18 -12
  68. package/dist/Editor/Elements/Form/Workflow/ListWorkflow.js +13 -8
  69. package/dist/Editor/Elements/Form/Workflow/MoreOptions.js +3 -2
  70. package/dist/Editor/Elements/Form/Workflow/Styles.js +24 -22
  71. package/dist/Editor/Elements/Form/Workflow/UserInputs.js +4 -2
  72. package/dist/Editor/Elements/Form/Workflow/index.js +15 -9
  73. package/dist/Editor/Elements/FreeGrid/FreeGrid.js +67 -23
  74. package/dist/Editor/Elements/FreeGrid/FreeGridBox.js +31 -6
  75. package/dist/Editor/Elements/FreeGrid/FreeGridButton.js +6 -2
  76. package/dist/Editor/Elements/FreeGrid/FreeGridItem.js +54 -6
  77. package/dist/Editor/Elements/FreeGrid/Options/AddElement.js +3 -2
  78. package/dist/Editor/Elements/FreeGrid/Options/More.js +10 -4
  79. package/dist/Editor/Elements/FreeGrid/styles.js +3 -0
  80. package/dist/Editor/Elements/Grid/Grid.js +13 -10
  81. package/dist/Editor/Elements/Grid/GridButton.js +9 -5
  82. package/dist/Editor/Elements/Grid/GridItem.js +14 -8
  83. package/dist/Editor/Elements/Grid/GridItemPopup.js +4 -1
  84. package/dist/Editor/Elements/Grid/GridPopup.js +4 -1
  85. package/dist/Editor/Elements/Grid/SectionPopup.js +4 -1
  86. package/dist/Editor/Elements/Link/Link.js +8 -5
  87. package/dist/Editor/Elements/Link/LinkButton.js +4 -1
  88. package/dist/Editor/Elements/List/CheckList.js +18 -10
  89. package/dist/Editor/Elements/NewLine/NewLineButton.js +6 -2
  90. package/dist/Editor/Elements/PageSettings/PageSettingsButton.js +4 -1
  91. package/dist/Editor/Elements/PageSettings/PageSettingsPopup.js +4 -1
  92. package/dist/Editor/Elements/Search/SearchButton.js +7 -4
  93. package/dist/Editor/Elements/Search/SearchList.js +10 -5
  94. package/dist/Editor/Elements/Signature/SignatureButton.js +6 -2
  95. package/dist/Editor/Elements/Signature/SignatureOptions/DrawSignature.js +2 -8
  96. package/dist/Editor/Elements/Signature/SignatureOptions/TypeSignature.js +6 -2
  97. package/dist/Editor/Elements/Signature/SignatureOptions/UploadSignature.js +4 -1
  98. package/dist/Editor/Elements/Signature/SignaturePopup.js +17 -16
  99. package/dist/Editor/Elements/SimpleText/index.js +14 -5
  100. package/dist/Editor/Elements/SimpleText/style.js +2 -2
  101. package/dist/Editor/Elements/Table/DragButton.js +4 -2
  102. package/dist/Editor/Elements/Table/Table.js +23 -11
  103. package/dist/Editor/Elements/Table/TablePopup.js +4 -1
  104. package/dist/Editor/Elements/Table/TableSelector.js +10 -6
  105. package/dist/Editor/Elements/Table/TableTool.js +8 -4
  106. package/dist/Editor/Elements/Title/title.js +9 -8
  107. package/dist/Editor/Elements/TopBanner/TopBannerButton.js +4 -1
  108. package/dist/Editor/Elements/Variables/VariableButton.js +10 -1
  109. package/dist/Editor/MiniEditor.js +10 -3
  110. package/dist/Editor/Styles/EditorStyles.js +5 -5
  111. package/dist/Editor/Toolbar/Basic/index.js +2 -1
  112. package/dist/Editor/Toolbar/FormatTools/BlockButton.js +6 -2
  113. package/dist/Editor/Toolbar/FormatTools/Dropdown.js +27 -3
  114. package/dist/Editor/Toolbar/FormatTools/FontFamilyAutocomplete.js +4 -3
  115. package/dist/Editor/Toolbar/FormatTools/MarkButton.js +8 -4
  116. package/dist/Editor/Toolbar/FormatTools/TextSize.js +10 -13
  117. package/dist/Editor/Toolbar/Mini/MiniToolbar.js +17 -5
  118. package/dist/Editor/Toolbar/PopupTool/AddTemplates.js +10 -5
  119. package/dist/Editor/Toolbar/PopupTool/ButtonTemplatesCard.js +10 -4
  120. package/dist/Editor/Toolbar/PopupTool/FullViewCard.js +10 -4
  121. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/MiniColorPicker.js +9 -3
  122. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectAlignment.js +42 -35
  123. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectFontSize.js +6 -13
  124. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectList.js +58 -51
  125. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectSuperSubscript.js +29 -22
  126. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectTypography.js +226 -87
  127. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +20 -10
  128. package/dist/Editor/Toolbar/PopupTool/PopperHeader.js +10 -5
  129. package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +71 -11
  130. package/dist/Editor/Toolbar/PopupTool/TemplateCard.js +11 -5
  131. package/dist/Editor/Toolbar/PopupTool/TextFormat.js +122 -42
  132. package/dist/Editor/Toolbar/PopupTool/ThemeTextFormat.js +436 -0
  133. package/dist/Editor/Toolbar/PopupTool/index.js +18 -2
  134. package/dist/Editor/Toolbar/Toolbar.js +20 -10
  135. package/dist/Editor/Toolbar/toolbarGroups.js +48 -6
  136. package/dist/Editor/assets/svg/ClearAllRounded.js +31 -0
  137. package/dist/Editor/assets/svg/ResetIconNew.js +23 -0
  138. package/dist/Editor/assets/svg/ThemeIcons.js +291 -0
  139. package/dist/Editor/common/ColorPickerButton.js +39 -14
  140. package/dist/Editor/common/CustomColorPicker/index.js +131 -0
  141. package/dist/Editor/common/CustomColorPicker/style.js +53 -0
  142. package/dist/Editor/common/CustomDialog/index.js +8 -10
  143. package/dist/Editor/common/CustomDialog2/index.js +94 -0
  144. package/dist/Editor/common/CustomDialog2/style.js +67 -0
  145. package/dist/Editor/common/CustomSelect.js +43 -0
  146. package/dist/Editor/common/DnD/DragHandleButton.js +1 -1
  147. package/dist/Editor/common/FontLoader/FontLoader.js +3 -0
  148. package/dist/Editor/common/Icon.js +31 -1
  149. package/dist/Editor/common/ImageSelector/ImageSelector.js +10 -8
  150. package/dist/Editor/common/ImageSelector/Options/AddLink.js +6 -4
  151. package/dist/Editor/common/ImageSelector/Styles.js +3 -9
  152. package/dist/Editor/common/LinkSettings/NavComponents.js +14 -10
  153. package/dist/Editor/common/LinkSettings/index.js +20 -14
  154. package/dist/Editor/common/LinkSettings/navOptions.js +1 -1
  155. package/dist/Editor/common/MUIIcon/index.js +0 -3
  156. package/dist/Editor/common/MentionsPopup/index.js +6 -2
  157. package/dist/Editor/common/RnD/ContextMenu/CMenus.js +46 -22
  158. package/dist/Editor/common/RnD/ContextMenu/index.js +3 -2
  159. package/dist/Editor/common/RnD/ElementOptions/index.js +7 -2
  160. package/dist/Editor/common/RnD/ElementSettings/OtherSettings/SaveAsTemplate.js +8 -3
  161. package/dist/Editor/common/RnD/ElementSettings/OtherSettings/Settings.js +7 -3
  162. package/dist/Editor/common/RnD/ElementSettings/Settings/AppHeaderSettings.js +3 -2
  163. package/dist/Editor/common/RnD/ElementSettings/Settings/BoxSettings.js +3 -2
  164. package/dist/Editor/common/RnD/ElementSettings/Settings/ButtonSettings.js +3 -2
  165. package/dist/Editor/common/RnD/ElementSettings/Settings/CodeSettings.js +3 -2
  166. package/dist/Editor/common/RnD/ElementSettings/Settings/FormSettings.js +7 -4
  167. package/dist/Editor/common/RnD/ElementSettings/Settings/ImageSettings.js +3 -2
  168. package/dist/Editor/common/RnD/ElementSettings/Settings/TableSettings.js +3 -2
  169. package/dist/Editor/common/RnD/ElementSettings/Settings/TextSettings.js +6 -2
  170. package/dist/Editor/common/RnD/ElementSettings/Settings/VideoSettings.js +3 -2
  171. package/dist/Editor/common/RnD/OptionsPopup/index.js +4 -3
  172. package/dist/Editor/common/RnD/ShadowElement.js +2 -1
  173. package/dist/Editor/common/RnD/SwitchViewport/SwitchViewport.js +11 -4
  174. package/dist/Editor/common/RnD/Theme/MainThemeProvider.js +17 -0
  175. package/dist/Editor/common/RnD/Theme/ViewportStimulator.js +6 -3
  176. package/dist/Editor/common/RnD/Utils/gridDropItem.js +73 -9
  177. package/dist/Editor/common/RnD/Utils/index.js +3 -0
  178. package/dist/Editor/common/RnD/VirtualElement/BoxHeaderAutoAlignment.js +43 -0
  179. package/dist/Editor/common/RnD/VirtualElement/ForceAutoAlignment.js +44 -0
  180. package/dist/Editor/common/RnD/VirtualElement/VirtualTextElement.js +134 -0
  181. package/dist/Editor/common/RnD/VirtualElement/helper.js +382 -0
  182. package/dist/Editor/common/RnD/VirtualElement/index.js +187 -103
  183. package/dist/Editor/common/RnD/VirtualElement/styles.js +155 -7
  184. package/dist/Editor/common/RnD/VirtualElement/updateAutoProps.js +5 -3
  185. package/dist/Editor/common/RnD/index.js +69 -13
  186. package/dist/Editor/common/Section/index.js +7 -4
  187. package/dist/Editor/common/Shorthands/elements.js +72 -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/lineSpacing.js +7 -6
  207. package/dist/Editor/common/StyleBuilder/fieldTypes/menusArray.js +9 -6
  208. package/dist/Editor/common/StyleBuilder/fieldTypes/metaDataMapping.js +8 -2
  209. package/dist/Editor/common/StyleBuilder/fieldTypes/saveAsTemplate.js +12 -11
  210. package/dist/Editor/common/StyleBuilder/fieldTypes/selectBox.js +6 -2
  211. package/dist/Editor/common/StyleBuilder/fieldTypes/text.js +8 -4
  212. package/dist/Editor/common/StyleBuilder/fieldTypes/textAlign.js +6 -2
  213. package/dist/Editor/common/StyleBuilder/fieldTypes/textOptions.js +21 -12
  214. package/dist/Editor/common/StyleBuilder/formStyle.js +7 -7
  215. package/dist/Editor/common/StyleBuilder/gridItemStyle.js +6 -6
  216. package/dist/Editor/common/StyleBuilder/gridStyle.js +5 -5
  217. package/dist/Editor/common/StyleBuilder/index.js +8 -5
  218. package/dist/Editor/common/StyleBuilder/pageSettingsStyle.js +5 -7
  219. package/dist/Editor/common/SwipeableDrawer/index.js +1 -1
  220. package/dist/Editor/common/Uploader.js +16 -5
  221. package/dist/Editor/commonStyle.js +68 -57
  222. package/dist/Editor/helper/index.js +27 -3
  223. package/dist/Editor/helper/textIndeces.js +58 -0
  224. package/dist/Editor/helper/theme.js +202 -2
  225. package/dist/Editor/hooks/useAutoScroll.js +38 -0
  226. package/dist/Editor/hooks/useEditorTheme.js +153 -0
  227. package/dist/Editor/hooks/useMouseMove.js +9 -3
  228. package/dist/Editor/hooks/useThemeValues.js +63 -0
  229. package/dist/Editor/plugins/withEmbeds.js +1 -1
  230. package/dist/Editor/plugins/withHTML.js +11 -9
  231. package/dist/Editor/plugins/withLayout.js +3 -2
  232. package/dist/Editor/plugins/withLinks.js +10 -0
  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 +149 -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 +186 -54
  252. package/dist/Editor/utils/brains.js +1 -2
  253. package/dist/Editor/utils/draftToSlate.js +3 -2
  254. package/dist/Editor/utils/font.js +40 -37
  255. package/dist/Editor/utils/freegrid.js +3 -3
  256. package/dist/Editor/utils/helper.js +92 -21
  257. package/package.json +4 -4
@@ -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";
@@ -33,14 +33,15 @@ const ChatEditor = /*#__PURE__*/forwardRef((props, ref) => {
33
33
  isMobile = false,
34
34
  debounceTimeOut = 10,
35
35
  isMarkDown = false,
36
- markDownContent = ''
36
+ markDownContent = "",
37
+ translation
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 = {}) {
@@ -275,7 +298,6 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
275
298
  },
276
299
  toggleFullscreen() {
277
300
  setFullScreen(!fullScreen);
278
- Transforms.deselect(editor);
279
301
  },
280
302
  toggleToolbarShow() {
281
303
  setToolbarShow(!toolbarShow);
@@ -299,6 +321,12 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
299
321
  redo() {
300
322
  editor?.redo();
301
323
  },
324
+ toggleTheme() {
325
+ setOpenTheme(!openTheme);
326
+ },
327
+ toggleAITheme() {
328
+ setOpenAITheme(!openAITheme);
329
+ },
302
330
  getPageSettings: {
303
331
  background: pageBgImage && pageBgImage !== "none" ? `url(${pageBgImage})` : pageColor || ""
304
332
  }
@@ -324,6 +352,7 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
324
352
  ...mentions,
325
353
  CHARACTERS,
326
354
  hideTools: updatedHideTools || [],
355
+ translation: translation || translationFn,
327
356
  editor
328
357
  }) : [];
329
358
  const handleEditorChange = newValue => {
@@ -340,6 +369,7 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
340
369
  const onDrawerOpen = status => {
341
370
  setIsDrawerOpen(status);
342
371
  };
372
+ const lineH = getBreakpointLineSpacing(lineHeight, breakpoint || (isMobile ? "xs" : ""));
343
373
  const isReadOnly = readOnly === "readonly";
344
374
  const customProps = {
345
375
  ...(otherProps || {}),
@@ -351,9 +381,10 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
351
381
  isIframe: isIframe,
352
382
  onDrawerOpen: onDrawerOpen,
353
383
  ICON_API: "https://assets.agenciflow.com",
354
- getTitleSaveData
384
+ translation: translationFn,
385
+ getTitleSaveData,
386
+ customLineHeight: lineH
355
387
  };
356
- const lineH = getBreakpointLineSpacing(lineHeight, breakpoint);
357
388
  const renderElement = useCallback(props => {
358
389
  return /*#__PURE__*/_jsx(Element, {
359
390
  ...props,
@@ -486,9 +517,7 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
486
517
  window.open("https://www.flozy.com", "_blank");
487
518
  };
488
519
  const editorWrapperStyle = useMemo(() => {
489
- const style = {
490
- color: pageTextColor || ""
491
- };
520
+ const style = {};
492
521
  if (pageBgImage && pageBgImage !== "none") {
493
522
  style.backgroundImage = `url(${pageBgImage})`;
494
523
  style.backgroundSize = `cover`;
@@ -498,6 +527,7 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
498
527
  }
499
528
  return style;
500
529
  }, [pageBgImage, pageColor, pageTextColor]);
530
+ const themeProps = getTheme(selectedTheme);
501
531
 
502
532
  // const handleContextMenu = (e) => {
503
533
  // if (!readOnly) {
@@ -506,6 +536,7 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
506
536
  // }
507
537
  // };
508
538
 
539
+ const gradientColor = pageTextStyle(pageTextColor);
509
540
  const handleCursorScroll = container => {
510
541
  try {
511
542
  if (!customProps?.isMobile) {
@@ -527,14 +558,74 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
527
558
  console.log("handleCursorScroll", err);
528
559
  }
529
560
  };
561
+ window.getTextIndeces = () => {
562
+ try {
563
+ const textWithPaths = extractTextWithPath(editor.children, []);
564
+ return textWithPaths;
565
+ } catch (err) {
566
+ console.log(err);
567
+ }
568
+ };
569
+ window.replaceTextIndeces = (path_data = []) => {
570
+ try {
571
+ const replacedJson = replaceTextPath(JSON.parse(JSON.stringify(editor.children)), path_data);
572
+
573
+ // loop delete all
574
+ editor.children.forEach(() => {
575
+ Transforms.delete(editor, {
576
+ at: [0]
577
+ });
578
+ });
579
+
580
+ // Insert new nodes
581
+ Transforms.insertNodes(editor, replacedJson, {
582
+ at: [0]
583
+ });
584
+ } catch (err) {
585
+ console.log(err);
586
+ }
587
+ };
588
+ window.replaceEditorContent = (fragments = []) => {
589
+ try {
590
+ // loop delete all
591
+ editor.children.forEach(() => {
592
+ Transforms.delete(editor, {
593
+ at: [0]
594
+ });
595
+ });
596
+
597
+ // Insert new nodes
598
+ Transforms.insertNodes(editor, fragments, {
599
+ at: [0]
600
+ });
601
+ } catch (err) {
602
+ console.log(err);
603
+ }
604
+ };
530
605
  return /*#__PURE__*/_jsxs(EditorProvider, {
531
606
  theme: theme,
532
607
  editor: editor,
533
- children: [/*#__PURE__*/_jsx(DialogWrapper, {
608
+ openTheme: openTheme,
609
+ setOpenTheme: setOpenTheme,
610
+ triggerRender: triggerRender,
611
+ children: [showThemeButtons ? /*#__PURE__*/_jsxs("div", {
612
+ className: "theme-buttons",
613
+ children: [/*#__PURE__*/_jsx(IconButton, {
614
+ onClick: () => setOpenTheme(true),
615
+ children: /*#__PURE__*/_jsx(ThemePaintIcon, {})
616
+ }), /*#__PURE__*/_jsx(IconButton, {
617
+ onClick: () => setOpenAITheme(true),
618
+ style: {
619
+ marginTop: "4px"
620
+ },
621
+ children: /*#__PURE__*/_jsx(ThemeAIIcon, {})
622
+ })]
623
+ }) : null, /*#__PURE__*/_jsx(DialogWrapper, {
534
624
  classes: classes,
535
625
  ...props,
536
626
  fullScreen: fullScreen,
537
627
  footer: footer || "",
628
+ selectedTheme: selectedTheme,
538
629
  children: /*#__PURE__*/_jsxs(Box, {
539
630
  component: "div",
540
631
  className: `et-wrpr stimulate-${breakpoint} ${editorClass || ""} ${isIframe ? "iframe-editor" : ""}`,
@@ -553,7 +644,12 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
553
644
  children: /*#__PURE__*/_jsxs(Overlay, {
554
645
  children: [/*#__PURE__*/_jsx(Box, {
555
646
  className: `pc-${editorClass || ""} ${hasTopBanner() ? "has-topbanner" : ""} ${!pageColor ? "no-color" : ""} scrollable-content scrollSmooth ${readOnly ? "readOnlyContainer" : ""}`,
556
- sx: classes.slateWrapper,
647
+ sx: {
648
+ ...classes.slateWrapper,
649
+ '& span[data-slate-string="true"]': {
650
+ ...gradientColor
651
+ }
652
+ },
557
653
  id: "slate-wrapper-scroll-container",
558
654
  ref: editorWrapper,
559
655
  onClick: e => {
@@ -564,6 +660,7 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
564
660
  children: /*#__PURE__*/_jsxs(Box, {
565
661
  component: "div",
566
662
  className: "max-content",
663
+ sx: themeProps?.sxProps || {},
567
664
  "data-info": outsideEditorClickLabel,
568
665
  children: [renderTopBanner(), /*#__PURE__*/_jsx("div", {
569
666
  className: "scroll-area",
@@ -608,6 +705,7 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
608
705
  chars: chars,
609
706
  type: type,
610
707
  theme: theme,
708
+ customProps: customProps,
611
709
  otherProps: customProps
612
710
  }) : null, /*#__PURE__*/_jsx(RnDCopy, {
613
711
  readOnly: readOnly
@@ -618,7 +716,8 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
618
716
  theme: theme
619
717
  }) : null, /*#__PURE__*/_jsx(PopoverAIInput, {
620
718
  otherProps: otherProps || {},
621
- editorWrapper: editorWrapper
719
+ editorWrapper: editorWrapper,
720
+ translation: translation || translationMock
622
721
  }), footer && (fullScreen || readOnly) && /*#__PURE__*/_jsx(Typography, {
623
722
  sx: {
624
723
  color: "rgb(100, 116, 139)",
@@ -630,6 +729,18 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
630
729
  "data-info": outsideEditorClickLabel,
631
730
  onClick: handleFooterClick,
632
731
  children: footer
732
+ }), openTheme ? /*#__PURE__*/_jsx(ThemeSettings, {
733
+ open: openTheme,
734
+ setOpen: setOpenTheme,
735
+ editor: editor,
736
+ services: otherProps?.services,
737
+ appTheme: theme,
738
+ customProps: customProps
739
+ }) : null, /*#__PURE__*/_jsx(ThemeSettingsAI, {
740
+ openAITheme: openAITheme,
741
+ setOpenAITheme: setOpenAITheme,
742
+ onSaveTheme: otherProps?.onSaveTheme,
743
+ theme: theme
633
744
  })]
634
745
  })
635
746
  }), !readOnly ? /*#__PURE__*/_jsx(PopupTool, {
@@ -638,14 +749,17 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
638
749
  setIsTextSelected: setIsTextSelected,
639
750
  customProps: customProps,
640
751
  editorWrapper: editorWrapper
641
- }) : null, !readOnly && showViewport ? /*#__PURE__*/_jsx(SwitchViewport, {
752
+ }) : null, !readOnly ? /*#__PURE__*/_jsx(SwitchViewport, {
642
753
  breakpoint: breakpoint,
643
- onChange: b => onSwitchBreakpoint(b)
754
+ show: showViewport,
755
+ onChange: b => onSwitchBreakpoint(b),
756
+ translation: translation || translationMock
644
757
  }) : null]
645
758
  })
646
759
  }), htmlAction.showInput && /*#__PURE__*/_jsx(CodeToText, {
647
760
  ...htmlAction,
648
- handleCodeToText: handleCodeToText
761
+ handleCodeToText: handleCodeToText,
762
+ translation: translation || translationMock
649
763
  })]
650
764
  }, id), /*#__PURE__*/_jsx(FontLoader, {
651
765
  otherProps: {
@@ -661,7 +775,8 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
661
775
  cancelText: "Cancel",
662
776
  onConfirm: () => {
663
777
  handleDeleteAll();
664
- }
778
+ },
779
+ translation: translation || translationMock
665
780
  })]
666
781
  });
667
782
  });
@@ -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
  });