@flozy/editor 9.7.4 → 9.7.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 (252) hide show
  1. package/dist/Editor/ChatEditor.js +26 -19
  2. package/dist/Editor/CommonEditor.js +139 -25
  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 +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 +425 -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 +9 -6
  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 +38 -5
  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 +14 -9
  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 +7 -3
  94. package/dist/Editor/Elements/Signature/SignatureButton.js +6 -2
  95. package/dist/Editor/Elements/Signature/SignatureOptions/TypeSignature.js +6 -2
  96. package/dist/Editor/Elements/Signature/SignatureOptions/UploadSignature.js +4 -1
  97. package/dist/Editor/Elements/Signature/SignaturePopup.js +17 -16
  98. package/dist/Editor/Elements/SimpleText/index.js +5 -4
  99. package/dist/Editor/Elements/SimpleText/style.js +2 -2
  100. package/dist/Editor/Elements/Table/DragButton.js +4 -2
  101. package/dist/Editor/Elements/Table/Table.js +24 -12
  102. package/dist/Editor/Elements/Table/TablePopup.js +4 -1
  103. package/dist/Editor/Elements/Table/TableSelector.js +10 -6
  104. package/dist/Editor/Elements/Table/TableTool.js +8 -4
  105. package/dist/Editor/Elements/Title/title.js +9 -8
  106. package/dist/Editor/Elements/TopBanner/TopBannerButton.js +4 -1
  107. package/dist/Editor/Elements/Variables/VariableButton.js +10 -1
  108. package/dist/Editor/MiniEditor.js +10 -3
  109. package/dist/Editor/Styles/EditorStyles.js +5 -5
  110. package/dist/Editor/Toolbar/Basic/index.js +2 -1
  111. package/dist/Editor/Toolbar/FormatTools/BlockButton.js +6 -2
  112. package/dist/Editor/Toolbar/FormatTools/Dropdown.js +27 -3
  113. package/dist/Editor/Toolbar/FormatTools/FontFamilyAutocomplete.js +4 -3
  114. package/dist/Editor/Toolbar/FormatTools/MarkButton.js +8 -4
  115. package/dist/Editor/Toolbar/FormatTools/TextSize.js +10 -13
  116. package/dist/Editor/Toolbar/Mini/MiniToolbar.js +17 -5
  117. package/dist/Editor/Toolbar/PopupTool/AddTemplates.js +10 -5
  118. package/dist/Editor/Toolbar/PopupTool/ButtonTemplatesCard.js +10 -4
  119. package/dist/Editor/Toolbar/PopupTool/FullViewCard.js +10 -4
  120. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/MiniColorPicker.js +9 -3
  121. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectAlignment.js +42 -35
  122. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectFontSize.js +6 -13
  123. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectList.js +58 -51
  124. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectSuperSubscript.js +29 -22
  125. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectTypography.js +226 -87
  126. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +20 -10
  127. package/dist/Editor/Toolbar/PopupTool/PopperHeader.js +10 -5
  128. package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +71 -11
  129. package/dist/Editor/Toolbar/PopupTool/TemplateCard.js +11 -5
  130. package/dist/Editor/Toolbar/PopupTool/TextFormat.js +122 -42
  131. package/dist/Editor/Toolbar/PopupTool/ThemeTextFormat.js +436 -0
  132. package/dist/Editor/Toolbar/PopupTool/index.js +17 -1
  133. package/dist/Editor/Toolbar/Toolbar.js +20 -10
  134. package/dist/Editor/Toolbar/toolbarGroups.js +48 -6
  135. package/dist/Editor/assets/svg/ClearAllRounded.js +31 -0
  136. package/dist/Editor/assets/svg/ThemeIcons.js +291 -0
  137. package/dist/Editor/common/ColorPickerButton.js +39 -14
  138. package/dist/Editor/common/CustomColorPicker/index.js +131 -0
  139. package/dist/Editor/common/CustomColorPicker/style.js +53 -0
  140. package/dist/Editor/common/CustomDialog/index.js +8 -10
  141. package/dist/Editor/common/CustomDialog2/index.js +94 -0
  142. package/dist/Editor/common/CustomDialog2/style.js +67 -0
  143. package/dist/Editor/common/CustomSelect.js +43 -0
  144. package/dist/Editor/common/DnD/DragHandleButton.js +1 -1
  145. package/dist/Editor/common/FontLoader/FontLoader.js +3 -0
  146. package/dist/Editor/common/Icon.js +28 -0
  147. package/dist/Editor/common/ImageSelector/ImageSelector.js +10 -8
  148. package/dist/Editor/common/ImageSelector/Options/AddLink.js +6 -4
  149. package/dist/Editor/common/ImageSelector/Styles.js +3 -9
  150. package/dist/Editor/common/LinkSettings/NavComponents.js +14 -10
  151. package/dist/Editor/common/LinkSettings/index.js +20 -14
  152. package/dist/Editor/common/LinkSettings/navOptions.js +1 -1
  153. package/dist/Editor/common/MUIIcon/index.js +0 -3
  154. package/dist/Editor/common/MentionsPopup/index.js +6 -2
  155. package/dist/Editor/common/RnD/ContextMenu/CMenus.js +46 -22
  156. package/dist/Editor/common/RnD/ContextMenu/index.js +3 -2
  157. package/dist/Editor/common/RnD/ElementOptions/index.js +7 -2
  158. package/dist/Editor/common/RnD/ElementSettings/OtherSettings/SaveAsTemplate.js +8 -3
  159. package/dist/Editor/common/RnD/ElementSettings/OtherSettings/Settings.js +7 -3
  160. package/dist/Editor/common/RnD/ElementSettings/Settings/AppHeaderSettings.js +3 -2
  161. package/dist/Editor/common/RnD/ElementSettings/Settings/BoxSettings.js +3 -2
  162. package/dist/Editor/common/RnD/ElementSettings/Settings/ButtonSettings.js +3 -2
  163. package/dist/Editor/common/RnD/ElementSettings/Settings/CodeSettings.js +3 -2
  164. package/dist/Editor/common/RnD/ElementSettings/Settings/FormSettings.js +7 -4
  165. package/dist/Editor/common/RnD/ElementSettings/Settings/ImageSettings.js +3 -2
  166. package/dist/Editor/common/RnD/ElementSettings/Settings/TableSettings.js +3 -2
  167. package/dist/Editor/common/RnD/ElementSettings/Settings/TextSettings.js +6 -2
  168. package/dist/Editor/common/RnD/ElementSettings/Settings/VideoSettings.js +3 -2
  169. package/dist/Editor/common/RnD/OptionsPopup/index.js +4 -3
  170. package/dist/Editor/common/RnD/ShadowElement.js +2 -1
  171. package/dist/Editor/common/RnD/SwitchViewport/SwitchViewport.js +11 -4
  172. package/dist/Editor/common/RnD/Theme/MainThemeProvider.js +17 -0
  173. package/dist/Editor/common/RnD/Theme/ViewportStimulator.js +6 -3
  174. package/dist/Editor/common/RnD/Utils/gridDropItem.js +55 -8
  175. package/dist/Editor/common/RnD/Utils/index.js +3 -0
  176. package/dist/Editor/common/RnD/VirtualElement/BoxHeaderAutoAlignment.js +43 -0
  177. package/dist/Editor/common/RnD/VirtualElement/ForceAutoAlignment.js +44 -0
  178. package/dist/Editor/common/RnD/VirtualElement/VirtualTextElement.js +134 -0
  179. package/dist/Editor/common/RnD/VirtualElement/helper.js +375 -0
  180. package/dist/Editor/common/RnD/VirtualElement/index.js +187 -103
  181. package/dist/Editor/common/RnD/VirtualElement/styles.js +151 -7
  182. package/dist/Editor/common/RnD/VirtualElement/updateAutoProps.js +5 -3
  183. package/dist/Editor/common/RnD/index.js +64 -13
  184. package/dist/Editor/common/Section/index.js +7 -4
  185. package/dist/Editor/common/Shorthands/elements.js +74 -3
  186. package/dist/Editor/common/SnackBar/index.js +43 -0
  187. package/dist/Editor/common/StyleBuilder/appHeaderStyle.js +4 -4
  188. package/dist/Editor/common/StyleBuilder/boxStyle.js +2 -2
  189. package/dist/Editor/common/StyleBuilder/buttonStyle.js +6 -4
  190. package/dist/Editor/common/StyleBuilder/dividerStyles.js +2 -2
  191. package/dist/Editor/common/StyleBuilder/embedVideoStyle.js +6 -6
  192. package/dist/Editor/common/StyleBuilder/fieldStyle.js +2 -2
  193. package/dist/Editor/common/StyleBuilder/fieldTypes/alignment.js +13 -9
  194. package/dist/Editor/common/StyleBuilder/fieldTypes/backgroundImage.js +11 -3
  195. package/dist/Editor/common/StyleBuilder/fieldTypes/bannerSpacing.js +19 -5
  196. package/dist/Editor/common/StyleBuilder/fieldTypes/borderRadius.js +22 -10
  197. package/dist/Editor/common/StyleBuilder/fieldTypes/buttonLink.js +6 -3
  198. package/dist/Editor/common/StyleBuilder/fieldTypes/card.js +27 -13
  199. package/dist/Editor/common/StyleBuilder/fieldTypes/color.js +43 -14
  200. package/dist/Editor/common/StyleBuilder/fieldTypes/elementSize.js +10 -6
  201. package/dist/Editor/common/StyleBuilder/fieldTypes/fontSize.js +19 -6
  202. package/dist/Editor/common/StyleBuilder/fieldTypes/gridSize.js +6 -2
  203. package/dist/Editor/common/StyleBuilder/fieldTypes/icons.js +5 -2
  204. package/dist/Editor/common/StyleBuilder/fieldTypes/menusArray.js +9 -6
  205. package/dist/Editor/common/StyleBuilder/fieldTypes/metaDataMapping.js +8 -2
  206. package/dist/Editor/common/StyleBuilder/fieldTypes/saveAsTemplate.js +12 -11
  207. package/dist/Editor/common/StyleBuilder/fieldTypes/selectBox.js +6 -2
  208. package/dist/Editor/common/StyleBuilder/fieldTypes/text.js +8 -4
  209. package/dist/Editor/common/StyleBuilder/fieldTypes/textAlign.js +6 -2
  210. package/dist/Editor/common/StyleBuilder/fieldTypes/textOptions.js +21 -12
  211. package/dist/Editor/common/StyleBuilder/formStyle.js +7 -7
  212. package/dist/Editor/common/StyleBuilder/gridItemStyle.js +6 -6
  213. package/dist/Editor/common/StyleBuilder/gridStyle.js +5 -5
  214. package/dist/Editor/common/StyleBuilder/index.js +8 -5
  215. package/dist/Editor/common/StyleBuilder/pageSettingsStyle.js +5 -7
  216. package/dist/Editor/common/Uploader.js +16 -5
  217. package/dist/Editor/commonStyle.js +68 -57
  218. package/dist/Editor/helper/index.js +27 -3
  219. package/dist/Editor/helper/textIndeces.js +58 -0
  220. package/dist/Editor/helper/theme.js +202 -2
  221. package/dist/Editor/hooks/useAutoScroll.js +38 -0
  222. package/dist/Editor/hooks/useEditorTheme.js +153 -0
  223. package/dist/Editor/hooks/useMouseMove.js +9 -3
  224. package/dist/Editor/hooks/useThemeValues.js +63 -0
  225. package/dist/Editor/plugins/withEmbeds.js +1 -1
  226. package/dist/Editor/plugins/withHTML.js +11 -9
  227. package/dist/Editor/plugins/withLayout.js +3 -2
  228. package/dist/Editor/plugins/withLinks.js +9 -0
  229. package/dist/Editor/plugins/withTable.js +1 -1
  230. package/dist/Editor/theme/ThemeList.js +50 -173
  231. package/dist/Editor/theme/index.js +149 -0
  232. package/dist/Editor/themeSettings/ActiveTheme.js +72 -0
  233. package/dist/Editor/themeSettings/buttons/index.js +290 -0
  234. package/dist/Editor/themeSettings/buttons/style.js +23 -0
  235. package/dist/Editor/themeSettings/colorTheme/index.js +310 -0
  236. package/dist/Editor/themeSettings/colorTheme/style.js +81 -0
  237. package/dist/Editor/themeSettings/fonts/PreviewElement.js +121 -0
  238. package/dist/Editor/themeSettings/fonts/index.js +240 -0
  239. package/dist/Editor/themeSettings/fonts/style.js +61 -0
  240. package/dist/Editor/themeSettings/icons.js +60 -0
  241. package/dist/Editor/themeSettings/index.js +351 -0
  242. package/dist/Editor/themeSettings/style.js +220 -0
  243. package/dist/Editor/themeSettingsAI/icons.js +96 -0
  244. package/dist/Editor/themeSettingsAI/index.js +355 -0
  245. package/dist/Editor/themeSettingsAI/saveTheme.js +205 -0
  246. package/dist/Editor/themeSettingsAI/style.js +259 -0
  247. package/dist/Editor/utils/SlateUtilityFunctions.js +178 -50
  248. package/dist/Editor/utils/draftToSlate.js +3 -2
  249. package/dist/Editor/utils/font.js +40 -37
  250. package/dist/Editor/utils/freegrid.js +3 -3
  251. package/dist/Editor/utils/helper.js +92 -21
  252. 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 = {}) {
@@ -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 => {
@@ -351,9 +380,10 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
351
380
  isIframe: isIframe,
352
381
  onDrawerOpen: onDrawerOpen,
353
382
  ICON_API: "https://assets.agenciflow.com",
383
+ translation: translationFn,
354
384
  getTitleSaveData
355
385
  };
356
- const lineH = getBreakpointLineSpacing(lineHeight, breakpoint);
386
+ const lineH = getBreakpointLineSpacing(lineHeight, breakpoint || (isMobile ? "xs" : ""));
357
387
  const renderElement = useCallback(props => {
358
388
  return /*#__PURE__*/_jsx(Element, {
359
389
  ...props,
@@ -486,9 +516,7 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
486
516
  window.open("https://www.flozy.com", "_blank");
487
517
  };
488
518
  const editorWrapperStyle = useMemo(() => {
489
- const style = {
490
- color: pageTextColor || ""
491
- };
519
+ const style = {};
492
520
  if (pageBgImage && pageBgImage !== "none") {
493
521
  style.backgroundImage = `url(${pageBgImage})`;
494
522
  style.backgroundSize = `cover`;
@@ -498,6 +526,7 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
498
526
  }
499
527
  return style;
500
528
  }, [pageBgImage, pageColor, pageTextColor]);
529
+ const themeProps = getTheme(selectedTheme);
501
530
 
502
531
  // const handleContextMenu = (e) => {
503
532
  // if (!readOnly) {
@@ -506,6 +535,7 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
506
535
  // }
507
536
  // };
508
537
 
538
+ const gradientColor = pageTextStyle(pageTextColor);
509
539
  const handleCursorScroll = container => {
510
540
  try {
511
541
  if (!customProps?.isMobile) {
@@ -527,14 +557,74 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
527
557
  console.log("handleCursorScroll", err);
528
558
  }
529
559
  };
560
+ window.getTextIndeces = () => {
561
+ try {
562
+ const textWithPaths = extractTextWithPath(editor.children, []);
563
+ return textWithPaths;
564
+ } catch (err) {
565
+ console.log(err);
566
+ }
567
+ };
568
+ window.replaceTextIndeces = (path_data = []) => {
569
+ try {
570
+ const replacedJson = replaceTextPath(JSON.parse(JSON.stringify(editor.children)), path_data);
571
+
572
+ // loop delete all
573
+ editor.children.forEach(() => {
574
+ Transforms.delete(editor, {
575
+ at: [0]
576
+ });
577
+ });
578
+
579
+ // Insert new nodes
580
+ Transforms.insertNodes(editor, replacedJson, {
581
+ at: [0]
582
+ });
583
+ } catch (err) {
584
+ console.log(err);
585
+ }
586
+ };
587
+ window.replaceEditorContent = (fragments = []) => {
588
+ try {
589
+ // loop delete all
590
+ editor.children.forEach(() => {
591
+ Transforms.delete(editor, {
592
+ at: [0]
593
+ });
594
+ });
595
+
596
+ // Insert new nodes
597
+ Transforms.insertNodes(editor, fragments, {
598
+ at: [0]
599
+ });
600
+ } catch (err) {
601
+ console.log(err);
602
+ }
603
+ };
530
604
  return /*#__PURE__*/_jsxs(EditorProvider, {
531
605
  theme: theme,
532
606
  editor: editor,
533
- children: [/*#__PURE__*/_jsx(DialogWrapper, {
607
+ openTheme: openTheme,
608
+ setOpenTheme: setOpenTheme,
609
+ triggerRender: triggerRender,
610
+ children: [showThemeButtons ? /*#__PURE__*/_jsxs("div", {
611
+ className: "theme-buttons",
612
+ children: [/*#__PURE__*/_jsx(IconButton, {
613
+ onClick: () => setOpenTheme(true),
614
+ children: /*#__PURE__*/_jsx(ThemePaintIcon, {})
615
+ }), /*#__PURE__*/_jsx(IconButton, {
616
+ onClick: () => setOpenAITheme(true),
617
+ style: {
618
+ marginTop: "4px"
619
+ },
620
+ children: /*#__PURE__*/_jsx(ThemeAIIcon, {})
621
+ })]
622
+ }) : null, /*#__PURE__*/_jsx(DialogWrapper, {
534
623
  classes: classes,
535
624
  ...props,
536
625
  fullScreen: fullScreen,
537
626
  footer: footer || "",
627
+ selectedTheme: selectedTheme,
538
628
  children: /*#__PURE__*/_jsxs(Box, {
539
629
  component: "div",
540
630
  className: `et-wrpr stimulate-${breakpoint} ${editorClass || ""} ${isIframe ? "iframe-editor" : ""}`,
@@ -553,7 +643,12 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
553
643
  children: /*#__PURE__*/_jsxs(Overlay, {
554
644
  children: [/*#__PURE__*/_jsx(Box, {
555
645
  className: `pc-${editorClass || ""} ${hasTopBanner() ? "has-topbanner" : ""} ${!pageColor ? "no-color" : ""} scrollable-content scrollSmooth ${readOnly ? "readOnlyContainer" : ""}`,
556
- sx: classes.slateWrapper,
646
+ sx: {
647
+ ...classes.slateWrapper,
648
+ '& span[data-slate-string="true"]': {
649
+ ...gradientColor
650
+ }
651
+ },
557
652
  id: "slate-wrapper-scroll-container",
558
653
  ref: editorWrapper,
559
654
  onClick: e => {
@@ -564,6 +659,7 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
564
659
  children: /*#__PURE__*/_jsxs(Box, {
565
660
  component: "div",
566
661
  className: "max-content",
662
+ sx: themeProps?.sxProps || {},
567
663
  "data-info": outsideEditorClickLabel,
568
664
  children: [renderTopBanner(), /*#__PURE__*/_jsx("div", {
569
665
  className: "scroll-area",
@@ -608,6 +704,7 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
608
704
  chars: chars,
609
705
  type: type,
610
706
  theme: theme,
707
+ customProps: customProps,
611
708
  otherProps: customProps
612
709
  }) : null, /*#__PURE__*/_jsx(RnDCopy, {
613
710
  readOnly: readOnly
@@ -618,7 +715,8 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
618
715
  theme: theme
619
716
  }) : null, /*#__PURE__*/_jsx(PopoverAIInput, {
620
717
  otherProps: otherProps || {},
621
- editorWrapper: editorWrapper
718
+ editorWrapper: editorWrapper,
719
+ translation: translation || translationMock
622
720
  }), footer && (fullScreen || readOnly) && /*#__PURE__*/_jsx(Typography, {
623
721
  sx: {
624
722
  color: "rgb(100, 116, 139)",
@@ -630,6 +728,18 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
630
728
  "data-info": outsideEditorClickLabel,
631
729
  onClick: handleFooterClick,
632
730
  children: footer
731
+ }), openTheme ? /*#__PURE__*/_jsx(ThemeSettings, {
732
+ open: openTheme,
733
+ setOpen: setOpenTheme,
734
+ editor: editor,
735
+ services: otherProps?.services,
736
+ appTheme: theme,
737
+ customProps: customProps
738
+ }) : null, /*#__PURE__*/_jsx(ThemeSettingsAI, {
739
+ openAITheme: openAITheme,
740
+ setOpenAITheme: setOpenAITheme,
741
+ onSaveTheme: otherProps?.onSaveTheme,
742
+ theme: theme
633
743
  })]
634
744
  })
635
745
  }), !readOnly ? /*#__PURE__*/_jsx(PopupTool, {
@@ -638,14 +748,17 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
638
748
  setIsTextSelected: setIsTextSelected,
639
749
  customProps: customProps,
640
750
  editorWrapper: editorWrapper
641
- }) : null, !readOnly && showViewport ? /*#__PURE__*/_jsx(SwitchViewport, {
751
+ }) : null, !readOnly ? /*#__PURE__*/_jsx(SwitchViewport, {
642
752
  breakpoint: breakpoint,
643
- onChange: b => onSwitchBreakpoint(b)
753
+ show: showViewport,
754
+ onChange: b => onSwitchBreakpoint(b),
755
+ translation: translation || translationMock
644
756
  }) : null]
645
757
  })
646
758
  }), htmlAction.showInput && /*#__PURE__*/_jsx(CodeToText, {
647
759
  ...htmlAction,
648
- handleCodeToText: handleCodeToText
760
+ handleCodeToText: handleCodeToText,
761
+ translation: translation || translationMock
649
762
  })]
650
763
  }, id), /*#__PURE__*/_jsx(FontLoader, {
651
764
  otherProps: {
@@ -661,7 +774,8 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
661
774
  cancelText: "Cancel",
662
775
  onConfirm: () => {
663
776
  handleDeleteAll();
664
- }
777
+ },
778
+ translation: translation || translationMock
665
779
  })]
666
780
  });
667
781
  });
@@ -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
  })]