@flozy/editor 9.5.8 → 9.6.0
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 +23 -139
- package/dist/Editor/DialogWrapper.js +25 -31
- package/dist/Editor/Editor.css +9 -13
- 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 +2 -4
- 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 +14 -31
- 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 -7
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/Select.js +3 -4
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/MultiSelectType.js +5 -25
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/TextType.js +2 -7
- 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 +38 -64
- 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/TableStyles.js +1 -4
- 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/DataView/styles.js +0 -13
- 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 +9 -14
- 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 +4 -23
- package/dist/Editor/Elements/FreeGrid/FreeGridButton.js +2 -6
- package/dist/Editor/Elements/FreeGrid/FreeGridItem.js +5 -36
- 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 +3 -6
- package/dist/Editor/Elements/Search/SearchList.js +3 -7
- package/dist/Editor/Elements/Signature/SignatureButton.js +2 -6
- 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 +11 -23
- package/dist/Editor/Elements/Table/TableCell.js +24 -2
- 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 +0 -10
- 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 +3 -5
- 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 +45 -128
- package/dist/Editor/Toolbar/PopupTool/index.js +17 -21
- 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 -46
- package/dist/Editor/common/ImageSelector/ImageSelector.js +8 -10
- package/dist/Editor/common/ImageSelector/Options/AddLink.js +4 -6
- package/dist/Editor/common/ImageSelector/Options/Upload.js +1 -1
- package/dist/Editor/common/ImageSelector/Styles.js +9 -3
- package/dist/Editor/common/ImageSelector/UploadStyles.js +9 -9
- 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/MentionsPopup/index.js +2 -6
- package/dist/Editor/common/RnD/ContextMenu/CMenus.js +22 -22
- 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/ElementSettings/styles.js +1 -0
- package/dist/Editor/common/RnD/OptionsPopup/index.js +3 -4
- package/dist/Editor/common/RnD/SwitchViewport/SwitchViewport.js +4 -11
- package/dist/Editor/common/RnD/Theme/ViewportStimulator.js +8 -20
- package/dist/Editor/common/RnD/Utils/gridDropItem.js +7 -56
- package/dist/Editor/common/RnD/Utils/index.js +0 -3
- package/dist/Editor/common/RnD/VirtualElement/index.js +105 -188
- package/dist/Editor/common/RnD/VirtualElement/styles.js +7 -123
- package/dist/Editor/common/RnD/VirtualElement/updateAutoProps.js +3 -5
- package/dist/Editor/common/RnD/index.js +14 -59
- 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/Uploader.js +5 -16
- package/dist/Editor/commonStyle.js +12 -23
- package/dist/Editor/helper/index.js +15 -35
- package/dist/Editor/helper/theme.js +2 -202
- package/dist/Editor/hooks/useDrag.js +11 -17
- package/dist/Editor/hooks/useEditorScroll.js +6 -10
- package/dist/Editor/hooks/useMouseMove.js +13 -25
- package/dist/Editor/hooks/useTable.js +1 -1
- 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/withTable.js +1 -1
- package/dist/Editor/theme/ThemeList.js +173 -50
- package/dist/Editor/utils/SlateUtilityFunctions.js +49 -168
- package/dist/Editor/utils/draftToSlate.js +2 -3
- package/dist/Editor/utils/font.js +37 -40
- package/dist/Editor/utils/freegrid.js +2 -2
- package/dist/Editor/utils/helper.js +19 -90
- package/package.json +3 -3
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/MultiSelect.js +0 -425
- package/dist/Editor/Toolbar/PopupTool/ThemeTextFormat.js +0 -436
- package/dist/Editor/assets/svg/ClearAllRounded.js +0 -31
- 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/ForceAutoAlignment.js +0 -117
- package/dist/Editor/common/RnD/VirtualElement/VirtualTextElement.js +0 -134
- package/dist/Editor/common/RnD/VirtualElement/helper.js +0 -281
- 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 -147
- 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,
|
@@ -517,7 +487,7 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
517
487
|
};
|
518
488
|
const editorWrapperStyle = useMemo(() => {
|
519
489
|
const style = {
|
520
|
-
|
490
|
+
color: pageTextColor || ""
|
521
491
|
};
|
522
492
|
if (pageBgImage && pageBgImage !== "none") {
|
523
493
|
style.backgroundImage = `url(${pageBgImage})`;
|
@@ -528,7 +498,6 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
528
498
|
}
|
529
499
|
return style;
|
530
500
|
}, [pageBgImage, pageColor, pageTextColor]);
|
531
|
-
const themeProps = getTheme(selectedTheme);
|
532
501
|
|
533
502
|
// const handleContextMenu = (e) => {
|
534
503
|
// if (!readOnly) {
|
@@ -537,7 +506,6 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
537
506
|
// }
|
538
507
|
// };
|
539
508
|
|
540
|
-
const gradientColor = pageTextStyle(pageTextColor);
|
541
509
|
const handleCursorScroll = container => {
|
542
510
|
try {
|
543
511
|
if (!customProps?.isMobile) {
|
@@ -559,74 +527,14 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
559
527
|
console.log("handleCursorScroll", err);
|
560
528
|
}
|
561
529
|
};
|
562
|
-
window.getTextIndeces = () => {
|
563
|
-
try {
|
564
|
-
const textWithPaths = extractTextWithPath(editor.children, []);
|
565
|
-
return textWithPaths;
|
566
|
-
} catch (err) {
|
567
|
-
console.log(err);
|
568
|
-
}
|
569
|
-
};
|
570
|
-
window.replaceTextIndeces = (path_data = []) => {
|
571
|
-
try {
|
572
|
-
const replacedJson = replaceTextPath(JSON.parse(JSON.stringify(editor.children)), path_data);
|
573
|
-
|
574
|
-
// loop delete all
|
575
|
-
editor.children.forEach(() => {
|
576
|
-
Transforms.delete(editor, {
|
577
|
-
at: [0]
|
578
|
-
});
|
579
|
-
});
|
580
|
-
|
581
|
-
// Insert new nodes
|
582
|
-
Transforms.insertNodes(editor, replacedJson, {
|
583
|
-
at: [0]
|
584
|
-
});
|
585
|
-
} catch (err) {
|
586
|
-
console.log(err);
|
587
|
-
}
|
588
|
-
};
|
589
|
-
window.replaceEditorContent = (fragments = []) => {
|
590
|
-
try {
|
591
|
-
// loop delete all
|
592
|
-
editor.children.forEach(() => {
|
593
|
-
Transforms.delete(editor, {
|
594
|
-
at: [0]
|
595
|
-
});
|
596
|
-
});
|
597
|
-
|
598
|
-
// Insert new nodes
|
599
|
-
Transforms.insertNodes(editor, fragments, {
|
600
|
-
at: [0]
|
601
|
-
});
|
602
|
-
} catch (err) {
|
603
|
-
console.log(err);
|
604
|
-
}
|
605
|
-
};
|
606
530
|
return /*#__PURE__*/_jsxs(EditorProvider, {
|
607
531
|
theme: theme,
|
608
532
|
editor: editor,
|
609
|
-
|
610
|
-
setOpenTheme: setOpenTheme,
|
611
|
-
triggerRender: triggerRender,
|
612
|
-
children: [showThemeButtons ? /*#__PURE__*/_jsxs("div", {
|
613
|
-
className: "theme-buttons",
|
614
|
-
children: [/*#__PURE__*/_jsx(IconButton, {
|
615
|
-
onClick: () => setOpenTheme(true),
|
616
|
-
children: /*#__PURE__*/_jsx(ThemePaintIcon, {})
|
617
|
-
}), /*#__PURE__*/_jsx(IconButton, {
|
618
|
-
onClick: () => setOpenAITheme(true),
|
619
|
-
style: {
|
620
|
-
marginTop: "4px"
|
621
|
-
},
|
622
|
-
children: /*#__PURE__*/_jsx(ThemeAIIcon, {})
|
623
|
-
})]
|
624
|
-
}) : null, /*#__PURE__*/_jsx(DialogWrapper, {
|
533
|
+
children: [/*#__PURE__*/_jsx(DialogWrapper, {
|
625
534
|
classes: classes,
|
626
535
|
...props,
|
627
536
|
fullScreen: fullScreen,
|
628
537
|
footer: footer || "",
|
629
|
-
selectedTheme: selectedTheme,
|
630
538
|
children: /*#__PURE__*/_jsxs(Box, {
|
631
539
|
component: "div",
|
632
540
|
className: `et-wrpr stimulate-${breakpoint} ${editorClass || ""} ${isIframe ? "iframe-editor" : ""}`,
|
@@ -645,12 +553,7 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
645
553
|
children: /*#__PURE__*/_jsxs(Overlay, {
|
646
554
|
children: [/*#__PURE__*/_jsx(Box, {
|
647
555
|
className: `pc-${editorClass || ""} ${hasTopBanner() ? "has-topbanner" : ""} ${!pageColor ? "no-color" : ""} scrollable-content scrollSmooth ${readOnly ? "readOnlyContainer" : ""}`,
|
648
|
-
sx:
|
649
|
-
...classes.slateWrapper,
|
650
|
-
'& span[data-slate-string="true"]': {
|
651
|
-
...gradientColor
|
652
|
-
}
|
653
|
-
},
|
556
|
+
sx: classes.slateWrapper,
|
654
557
|
id: "slate-wrapper-scroll-container",
|
655
558
|
ref: editorWrapper,
|
656
559
|
onClick: e => {
|
@@ -661,7 +564,6 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
661
564
|
children: /*#__PURE__*/_jsxs(Box, {
|
662
565
|
component: "div",
|
663
566
|
className: "max-content",
|
664
|
-
sx: themeProps?.sxProps || {},
|
665
567
|
"data-info": outsideEditorClickLabel,
|
666
568
|
children: [renderTopBanner(), /*#__PURE__*/_jsx("div", {
|
667
569
|
className: "scroll-area",
|
@@ -706,7 +608,6 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
706
608
|
chars: chars,
|
707
609
|
type: type,
|
708
610
|
theme: theme,
|
709
|
-
customProps: customProps,
|
710
611
|
otherProps: customProps
|
711
612
|
}) : null, /*#__PURE__*/_jsx(RnDCopy, {
|
712
613
|
readOnly: readOnly
|
@@ -717,8 +618,7 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
717
618
|
theme: theme
|
718
619
|
}) : null, /*#__PURE__*/_jsx(PopoverAIInput, {
|
719
620
|
otherProps: otherProps || {},
|
720
|
-
editorWrapper: editorWrapper
|
721
|
-
translation: translation || translationMock
|
621
|
+
editorWrapper: editorWrapper
|
722
622
|
}), footer && (fullScreen || readOnly) && /*#__PURE__*/_jsx(Typography, {
|
723
623
|
sx: {
|
724
624
|
color: "rgb(100, 116, 139)",
|
@@ -730,18 +630,6 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
730
630
|
"data-info": outsideEditorClickLabel,
|
731
631
|
onClick: handleFooterClick,
|
732
632
|
children: footer
|
733
|
-
}), openTheme ? /*#__PURE__*/_jsx(ThemeSettings, {
|
734
|
-
open: openTheme,
|
735
|
-
setOpen: setOpenTheme,
|
736
|
-
editor: editor,
|
737
|
-
services: otherProps?.services,
|
738
|
-
appTheme: theme,
|
739
|
-
customProps: customProps
|
740
|
-
}) : null, /*#__PURE__*/_jsx(ThemeSettingsAI, {
|
741
|
-
openAITheme: openAITheme,
|
742
|
-
setOpenAITheme: setOpenAITheme,
|
743
|
-
onSaveTheme: otherProps?.onSaveTheme,
|
744
|
-
theme: theme
|
745
633
|
})]
|
746
634
|
})
|
747
635
|
}), !readOnly ? /*#__PURE__*/_jsx(PopupTool, {
|
@@ -750,17 +638,14 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
750
638
|
setIsTextSelected: setIsTextSelected,
|
751
639
|
customProps: customProps,
|
752
640
|
editorWrapper: editorWrapper
|
753
|
-
}) : null, !readOnly ? /*#__PURE__*/_jsx(SwitchViewport, {
|
641
|
+
}) : null, !readOnly && showViewport ? /*#__PURE__*/_jsx(SwitchViewport, {
|
754
642
|
breakpoint: breakpoint,
|
755
|
-
|
756
|
-
onChange: b => onSwitchBreakpoint(b),
|
757
|
-
translation: translation || translationMock
|
643
|
+
onChange: b => onSwitchBreakpoint(b)
|
758
644
|
}) : null]
|
759
645
|
})
|
760
646
|
}), htmlAction.showInput && /*#__PURE__*/_jsx(CodeToText, {
|
761
647
|
...htmlAction,
|
762
|
-
handleCodeToText: handleCodeToText
|
763
|
-
translation: translation || translationMock
|
648
|
+
handleCodeToText: handleCodeToText
|
764
649
|
})]
|
765
650
|
}, id), /*#__PURE__*/_jsx(FontLoader, {
|
766
651
|
otherProps: {
|
@@ -776,8 +661,7 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
776
661
|
cancelText: "Cancel",
|
777
662
|
onConfirm: () => {
|
778
663
|
handleDeleteAll();
|
779
|
-
}
|
780
|
-
translation: translation || translationMock
|
664
|
+
}
|
781
665
|
})]
|
782
666
|
});
|
783
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
@@ -1282,8 +1282,8 @@ blockquote {
|
|
1282
1282
|
}
|
1283
1283
|
@media (max-width: 899px) {
|
1284
1284
|
/* Qa validation required */
|
1285
|
-
|
1286
|
-
|
1285
|
+
/* .MuiPopover-root {
|
1286
|
+
z-index: 1302 !important;
|
1287
1287
|
} */
|
1288
1288
|
|
1289
1289
|
canvas {
|
@@ -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
|
});
|