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