@flozy/editor 9.7.5 → 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.
- package/dist/Editor/ChatEditor.js +41 -49
- package/dist/Editor/CommonEditor.js +139 -25
- package/dist/Editor/DialogWrapper.js +31 -25
- package/dist/Editor/Editor.css +13 -9
- package/dist/Editor/Elements/AI/AIInput.js +5 -3
- package/dist/Editor/Elements/AI/CustomSelect.js +9 -5
- package/dist/Editor/Elements/AI/PopoverAIInput.js +4 -2
- package/dist/Editor/Elements/Accordion/Accordion.js +4 -3
- package/dist/Editor/Elements/Accordion/AccordionBtnPopup.js +4 -1
- package/dist/Editor/Elements/Accordion/AccordionButton.js +6 -2
- package/dist/Editor/Elements/Accordion/AccordionTitlePopup.js +4 -1
- package/dist/Editor/Elements/AppHeader/AppHeader.js +3 -3
- package/dist/Editor/Elements/AppHeader/AppHeaderButton.js +6 -2
- package/dist/Editor/Elements/AppHeader/AppHeaderPopup.js +4 -1
- package/dist/Editor/Elements/Attachments/AttachmentsButton.js +4 -1
- package/dist/Editor/Elements/Button/ButtonPopup.js +4 -1
- package/dist/Editor/Elements/Button/ButtonToolIcon.js +6 -2
- package/dist/Editor/Elements/Button/EditorButton.js +43 -30
- package/dist/Editor/Elements/Carousel/Carousel.js +5 -4
- package/dist/Editor/Elements/Carousel/CarouselButton.js +6 -2
- package/dist/Editor/Elements/Carousel/CarouselItem.js +3 -2
- package/dist/Editor/Elements/ChipText/ChipTextPopup.js +4 -1
- package/dist/Editor/Elements/CodeToText/CodeToText.js +5 -4
- package/dist/Editor/Elements/CodeToText/HtmlContextMenu.js +6 -2
- package/dist/Editor/Elements/Color Picker/ColorButtons.js +60 -14
- package/dist/Editor/Elements/Color Picker/ColorPicker.css +25 -1
- package/dist/Editor/Elements/Color Picker/ColorPicker.js +10 -7
- package/dist/Editor/Elements/Color Picker/Styles.js +15 -13
- package/dist/Editor/Elements/Colorbox/ColorboxButton.js +6 -2
- package/dist/Editor/Elements/DataView/DataView.js +5 -2
- package/dist/Editor/Elements/DataView/DataViewButton.js +6 -2
- package/dist/Editor/Elements/DataView/Layouts/ColumnView.js +4 -2
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/MultiSelect.js +425 -0
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/MultiSelectType.js +21 -6
- package/dist/Editor/Elements/DataView/Layouts/FilterSort/SortOptions/ChooseSort.js +13 -12
- package/dist/Editor/Elements/DataView/Layouts/FilterSort/SortOptions/index.js +7 -4
- package/dist/Editor/Elements/DataView/Layouts/FilterSort/index.js +7 -5
- package/dist/Editor/Elements/DataView/Layouts/FilterView.js +9 -7
- package/dist/Editor/Elements/DataView/Layouts/Options/AddOptions.js +8 -3
- package/dist/Editor/Elements/DataView/Layouts/Options/AddProperty.js +5 -3
- package/dist/Editor/Elements/DataView/Layouts/Options/AllProperties.js +6 -5
- package/dist/Editor/Elements/DataView/Layouts/Options/ChangeProperty.js +5 -3
- package/dist/Editor/Elements/DataView/Layouts/Options/EditOption.js +9 -7
- package/dist/Editor/Elements/DataView/Layouts/Options/EditProperty.js +15 -12
- package/dist/Editor/Elements/DataView/Layouts/Options/FilterProperty.js +3 -2
- package/dist/Editor/Elements/DataView/Layouts/Options/PropertyList.js +3 -2
- package/dist/Editor/Elements/DataView/Layouts/Options/index.js +23 -6
- package/dist/Editor/Elements/DataView/Layouts/TableView.js +6 -4
- package/dist/Editor/Elements/DataView/Layouts/ViewData.js +8 -4
- package/dist/Editor/Elements/DataView/Layouts/index.js +3 -1
- package/dist/Editor/Elements/DataView/Providers/DataViewProvider.js +5 -2
- package/dist/Editor/Elements/Divider/Divider.js +5 -3
- package/dist/Editor/Elements/Divider/DividerButton.js +6 -2
- package/dist/Editor/Elements/Divider/DividerPopup.js +3 -2
- package/dist/Editor/Elements/Embed/Embed.js +4 -1
- package/dist/Editor/Elements/Embed/EmbedPopup.js +4 -1
- package/dist/Editor/Elements/Embed/Image.js +14 -9
- package/dist/Editor/Elements/Embed/Video.js +9 -6
- package/dist/Editor/Elements/EmbedScript/Code.js +7 -4
- package/dist/Editor/Elements/EmbedScript/EmbedScript.js +6 -2
- package/dist/Editor/Elements/EmbedScript/EmbedScriptPopup.js +8 -5
- package/dist/Editor/Elements/Emoji/EmojiButton.js +6 -2
- package/dist/Editor/Elements/Form/FieldPopup.js +4 -1
- package/dist/Editor/Elements/Form/Form.js +12 -9
- package/dist/Editor/Elements/Form/FormButton.js +6 -2
- package/dist/Editor/Elements/Form/FormPopup.js +3 -2
- package/dist/Editor/Elements/Form/Workflow/FormWorkflow.js +18 -12
- package/dist/Editor/Elements/Form/Workflow/ListWorkflow.js +13 -8
- package/dist/Editor/Elements/Form/Workflow/MoreOptions.js +3 -2
- package/dist/Editor/Elements/Form/Workflow/Styles.js +24 -22
- package/dist/Editor/Elements/Form/Workflow/UserInputs.js +4 -2
- package/dist/Editor/Elements/Form/Workflow/index.js +15 -9
- package/dist/Editor/Elements/FreeGrid/FreeGrid.js +67 -23
- package/dist/Editor/Elements/FreeGrid/FreeGridBox.js +31 -6
- package/dist/Editor/Elements/FreeGrid/FreeGridButton.js +6 -2
- package/dist/Editor/Elements/FreeGrid/FreeGridItem.js +38 -5
- package/dist/Editor/Elements/FreeGrid/Options/AddElement.js +3 -2
- package/dist/Editor/Elements/FreeGrid/Options/More.js +10 -4
- package/dist/Editor/Elements/FreeGrid/styles.js +3 -0
- package/dist/Editor/Elements/Grid/Grid.js +13 -10
- package/dist/Editor/Elements/Grid/GridButton.js +9 -5
- package/dist/Editor/Elements/Grid/GridItem.js +14 -8
- package/dist/Editor/Elements/Grid/GridItemPopup.js +4 -1
- package/dist/Editor/Elements/Grid/GridPopup.js +4 -1
- package/dist/Editor/Elements/Grid/SectionPopup.js +4 -1
- package/dist/Editor/Elements/Link/Link.js +8 -5
- package/dist/Editor/Elements/Link/LinkButton.js +4 -1
- package/dist/Editor/Elements/List/CheckList.js +14 -9
- package/dist/Editor/Elements/NewLine/NewLineButton.js +6 -2
- package/dist/Editor/Elements/PageSettings/PageSettingsButton.js +4 -1
- package/dist/Editor/Elements/PageSettings/PageSettingsPopup.js +4 -1
- package/dist/Editor/Elements/Search/SearchButton.js +7 -4
- package/dist/Editor/Elements/Search/SearchList.js +10 -5
- package/dist/Editor/Elements/Signature/SignatureButton.js +6 -2
- package/dist/Editor/Elements/Signature/SignatureOptions/DrawSignature.js +2 -8
- package/dist/Editor/Elements/Signature/SignatureOptions/TypeSignature.js +6 -2
- package/dist/Editor/Elements/Signature/SignatureOptions/UploadSignature.js +4 -1
- package/dist/Editor/Elements/Signature/SignaturePopup.js +17 -16
- package/dist/Editor/Elements/SimpleText/index.js +5 -4
- package/dist/Editor/Elements/SimpleText/style.js +2 -2
- package/dist/Editor/Elements/Table/DragButton.js +4 -2
- package/dist/Editor/Elements/Table/Table.js +24 -12
- package/dist/Editor/Elements/Table/TablePopup.js +4 -1
- package/dist/Editor/Elements/Table/TableSelector.js +10 -6
- package/dist/Editor/Elements/Table/TableTool.js +8 -4
- package/dist/Editor/Elements/Title/title.js +9 -8
- package/dist/Editor/Elements/TopBanner/TopBannerButton.js +4 -1
- package/dist/Editor/Elements/Variables/VariableButton.js +10 -1
- package/dist/Editor/MiniEditor.js +10 -3
- package/dist/Editor/Styles/EditorStyles.js +5 -5
- package/dist/Editor/Toolbar/Basic/index.js +2 -1
- package/dist/Editor/Toolbar/FormatTools/BlockButton.js +6 -2
- package/dist/Editor/Toolbar/FormatTools/Dropdown.js +27 -3
- package/dist/Editor/Toolbar/FormatTools/FontFamilyAutocomplete.js +4 -3
- package/dist/Editor/Toolbar/FormatTools/MarkButton.js +8 -4
- package/dist/Editor/Toolbar/FormatTools/TextSize.js +10 -13
- package/dist/Editor/Toolbar/Mini/MiniToolbar.js +17 -5
- package/dist/Editor/Toolbar/PopupTool/AddTemplates.js +10 -5
- package/dist/Editor/Toolbar/PopupTool/ButtonTemplatesCard.js +10 -4
- package/dist/Editor/Toolbar/PopupTool/FullViewCard.js +10 -4
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/MiniColorPicker.js +9 -3
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectAlignment.js +42 -35
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectFontSize.js +6 -13
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectList.js +58 -51
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectSuperSubscript.js +29 -22
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectTypography.js +226 -87
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +20 -10
- package/dist/Editor/Toolbar/PopupTool/PopperHeader.js +10 -5
- package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +71 -11
- package/dist/Editor/Toolbar/PopupTool/TemplateCard.js +11 -5
- package/dist/Editor/Toolbar/PopupTool/TextFormat.js +128 -45
- package/dist/Editor/Toolbar/PopupTool/ThemeTextFormat.js +436 -0
- package/dist/Editor/Toolbar/PopupTool/index.js +20 -10
- package/dist/Editor/Toolbar/Toolbar.js +20 -10
- package/dist/Editor/Toolbar/toolbarGroups.js +48 -6
- package/dist/Editor/assets/svg/ClearAllRounded.js +31 -0
- package/dist/Editor/assets/svg/ThemeIcons.js +291 -0
- package/dist/Editor/common/ColorPickerButton.js +39 -14
- package/dist/Editor/common/CustomColorPicker/index.js +131 -0
- package/dist/Editor/common/CustomColorPicker/style.js +53 -0
- package/dist/Editor/common/CustomDialog/index.js +8 -10
- package/dist/Editor/common/CustomDialog2/index.js +94 -0
- package/dist/Editor/common/CustomDialog2/style.js +67 -0
- package/dist/Editor/common/CustomSelect.js +43 -0
- package/dist/Editor/common/DnD/DragHandleButton.js +1 -1
- package/dist/Editor/common/FontLoader/FontLoader.js +3 -0
- package/dist/Editor/common/Icon.js +28 -0
- package/dist/Editor/common/ImageSelector/ImageSelector.js +10 -8
- package/dist/Editor/common/ImageSelector/Options/AddLink.js +6 -4
- package/dist/Editor/common/ImageSelector/Options/Upload.js +1 -1
- package/dist/Editor/common/ImageSelector/Styles.js +3 -9
- package/dist/Editor/common/ImageSelector/UploadStyles.js +9 -9
- package/dist/Editor/common/LinkSettings/NavComponents.js +14 -10
- package/dist/Editor/common/LinkSettings/index.js +20 -14
- package/dist/Editor/common/LinkSettings/navOptions.js +1 -1
- package/dist/Editor/common/MUIIcon/index.js +0 -3
- package/dist/Editor/common/MentionsPopup/index.js +6 -2
- package/dist/Editor/common/RnD/ContextMenu/CMenus.js +46 -22
- package/dist/Editor/common/RnD/ContextMenu/index.js +3 -2
- package/dist/Editor/common/RnD/ElementOptions/index.js +7 -2
- package/dist/Editor/common/RnD/ElementSettings/OtherSettings/SaveAsTemplate.js +8 -3
- package/dist/Editor/common/RnD/ElementSettings/OtherSettings/Settings.js +7 -3
- package/dist/Editor/common/RnD/ElementSettings/Settings/AppHeaderSettings.js +3 -2
- package/dist/Editor/common/RnD/ElementSettings/Settings/BoxSettings.js +3 -2
- package/dist/Editor/common/RnD/ElementSettings/Settings/ButtonSettings.js +3 -2
- package/dist/Editor/common/RnD/ElementSettings/Settings/CodeSettings.js +3 -2
- package/dist/Editor/common/RnD/ElementSettings/Settings/FormSettings.js +7 -4
- package/dist/Editor/common/RnD/ElementSettings/Settings/ImageSettings.js +3 -2
- package/dist/Editor/common/RnD/ElementSettings/Settings/TableSettings.js +3 -2
- package/dist/Editor/common/RnD/ElementSettings/Settings/TextSettings.js +6 -2
- package/dist/Editor/common/RnD/ElementSettings/Settings/VideoSettings.js +3 -2
- package/dist/Editor/common/RnD/ElementSettings/styles.js +0 -1
- package/dist/Editor/common/RnD/OptionsPopup/index.js +4 -3
- package/dist/Editor/common/RnD/ShadowElement.js +2 -1
- package/dist/Editor/common/RnD/SwitchViewport/SwitchViewport.js +11 -4
- package/dist/Editor/common/RnD/Theme/MainThemeProvider.js +17 -0
- package/dist/Editor/common/RnD/Theme/ViewportStimulator.js +6 -3
- package/dist/Editor/common/RnD/Utils/gridDropItem.js +55 -8
- package/dist/Editor/common/RnD/Utils/index.js +3 -0
- package/dist/Editor/common/RnD/VirtualElement/BoxHeaderAutoAlignment.js +43 -0
- package/dist/Editor/common/RnD/VirtualElement/ForceAutoAlignment.js +44 -0
- package/dist/Editor/common/RnD/VirtualElement/VirtualTextElement.js +134 -0
- package/dist/Editor/common/RnD/VirtualElement/helper.js +375 -0
- package/dist/Editor/common/RnD/VirtualElement/index.js +187 -103
- package/dist/Editor/common/RnD/VirtualElement/styles.js +151 -7
- package/dist/Editor/common/RnD/VirtualElement/updateAutoProps.js +5 -3
- package/dist/Editor/common/RnD/index.js +64 -13
- package/dist/Editor/common/Section/index.js +7 -4
- package/dist/Editor/common/Shorthands/elements.js +74 -3
- package/dist/Editor/common/SnackBar/index.js +43 -0
- 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 +6 -4
- 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 +13 -9
- package/dist/Editor/common/StyleBuilder/fieldTypes/backgroundImage.js +11 -3
- package/dist/Editor/common/StyleBuilder/fieldTypes/bannerSpacing.js +19 -5
- package/dist/Editor/common/StyleBuilder/fieldTypes/borderRadius.js +22 -10
- package/dist/Editor/common/StyleBuilder/fieldTypes/buttonLink.js +6 -3
- package/dist/Editor/common/StyleBuilder/fieldTypes/card.js +27 -13
- package/dist/Editor/common/StyleBuilder/fieldTypes/color.js +43 -14
- package/dist/Editor/common/StyleBuilder/fieldTypes/elementSize.js +10 -6
- package/dist/Editor/common/StyleBuilder/fieldTypes/fontSize.js +19 -6
- package/dist/Editor/common/StyleBuilder/fieldTypes/gridSize.js +6 -2
- package/dist/Editor/common/StyleBuilder/fieldTypes/icons.js +5 -2
- package/dist/Editor/common/StyleBuilder/fieldTypes/menusArray.js +9 -6
- package/dist/Editor/common/StyleBuilder/fieldTypes/metaDataMapping.js +8 -2
- package/dist/Editor/common/StyleBuilder/fieldTypes/saveAsTemplate.js +12 -11
- package/dist/Editor/common/StyleBuilder/fieldTypes/selectBox.js +6 -2
- package/dist/Editor/common/StyleBuilder/fieldTypes/text.js +8 -4
- package/dist/Editor/common/StyleBuilder/fieldTypes/textAlign.js +6 -2
- package/dist/Editor/common/StyleBuilder/fieldTypes/textOptions.js +21 -12
- 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 +8 -5
- package/dist/Editor/common/StyleBuilder/pageSettingsStyle.js +5 -7
- package/dist/Editor/common/SwipeableDrawer/index.js +1 -1
- package/dist/Editor/common/Uploader.js +16 -5
- package/dist/Editor/commonStyle.js +23 -12
- package/dist/Editor/helper/index.js +27 -3
- package/dist/Editor/helper/textIndeces.js +58 -0
- package/dist/Editor/helper/theme.js +202 -2
- package/dist/Editor/hooks/useAutoScroll.js +38 -0
- package/dist/Editor/hooks/useDrag.js +1 -1
- package/dist/Editor/hooks/useEditorScroll.js +0 -1
- package/dist/Editor/hooks/useEditorTheme.js +153 -0
- package/dist/Editor/hooks/useMouseMove.js +9 -3
- package/dist/Editor/hooks/useThemeValues.js +63 -0
- package/dist/Editor/plugins/withEmbeds.js +1 -1
- package/dist/Editor/plugins/withHTML.js +11 -9
- package/dist/Editor/plugins/withLayout.js +3 -2
- package/dist/Editor/plugins/withLinks.js +9 -0
- package/dist/Editor/plugins/withTable.js +1 -1
- package/dist/Editor/theme/ThemeList.js +50 -173
- package/dist/Editor/theme/index.js +149 -0
- package/dist/Editor/themeSettings/ActiveTheme.js +72 -0
- package/dist/Editor/themeSettings/buttons/index.js +290 -0
- package/dist/Editor/themeSettings/buttons/style.js +23 -0
- package/dist/Editor/themeSettings/colorTheme/index.js +310 -0
- package/dist/Editor/themeSettings/colorTheme/style.js +81 -0
- package/dist/Editor/themeSettings/fonts/PreviewElement.js +121 -0
- package/dist/Editor/themeSettings/fonts/index.js +240 -0
- package/dist/Editor/themeSettings/fonts/style.js +61 -0
- package/dist/Editor/themeSettings/icons.js +60 -0
- package/dist/Editor/themeSettings/index.js +351 -0
- package/dist/Editor/themeSettings/style.js +220 -0
- package/dist/Editor/themeSettingsAI/icons.js +96 -0
- package/dist/Editor/themeSettingsAI/index.js +355 -0
- package/dist/Editor/themeSettingsAI/saveTheme.js +205 -0
- package/dist/Editor/themeSettingsAI/style.js +259 -0
- package/dist/Editor/utils/SlateUtilityFunctions.js +177 -49
- package/dist/Editor/utils/draftToSlate.js +3 -2
- package/dist/Editor/utils/font.js +40 -37
- package/dist/Editor/utils/freegrid.js +3 -3
- package/dist/Editor/utils/helper.js +92 -21
- package/package.json +3 -3
@@ -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,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:
|
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
|
@@ -189,16 +184,8 @@ const ChatEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
189
184
|
children: children
|
190
185
|
});
|
191
186
|
};
|
192
|
-
const isEmpty = node => {
|
193
|
-
if (node.text && node.text.trim()) return false;
|
194
|
-
if (node.url && node.url.trim()) return false;
|
195
|
-
if (node.children) {
|
196
|
-
return node.children.every(isEmpty);
|
197
|
-
}
|
198
|
-
return true;
|
199
|
-
};
|
200
187
|
const handleEditorChange = newValue => {
|
201
|
-
|
188
|
+
console.log("🚀 ~ handleEditorChange ~ newValue:", newValue);
|
202
189
|
if (editor.children.length === 0) {
|
203
190
|
Transforms.insertNodes(editor, {
|
204
191
|
type: "paragraph",
|
@@ -207,32 +194,34 @@ const ChatEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
207
194
|
}]
|
208
195
|
});
|
209
196
|
} else {
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
children: [{
|
223
|
-
text: ""
|
224
|
-
}]
|
225
|
-
}, {
|
226
|
-
at: [index + 1]
|
227
|
-
});
|
228
|
-
}
|
197
|
+
newValue.forEach((val, index) => {
|
198
|
+
if (val?.type === "table") {
|
199
|
+
const nextNode = newValue[index + 1];
|
200
|
+
if (!nextNode || nextNode.type !== "paragraph") {
|
201
|
+
Transforms.insertNodes(editor, {
|
202
|
+
type: "paragraph",
|
203
|
+
children: [{
|
204
|
+
text: ""
|
205
|
+
}]
|
206
|
+
}, {
|
207
|
+
at: [index + 1]
|
208
|
+
});
|
229
209
|
}
|
230
|
-
}
|
231
|
-
}
|
210
|
+
}
|
211
|
+
});
|
232
212
|
}
|
233
213
|
debounced(newValue);
|
234
214
|
debouncedValue.current = newValue;
|
235
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
|
+
};
|
236
225
|
const Element = props => {
|
237
226
|
return getBlock(props);
|
238
227
|
};
|
@@ -268,7 +257,7 @@ const ChatEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
268
257
|
editor
|
269
258
|
});
|
270
259
|
} else if (event.key === "Enter" && !isMobile) {
|
271
|
-
const isEmpty = debouncedValue?.current.length === 1 && debouncedValue?.current[0].type ===
|
260
|
+
const isEmpty = debouncedValue?.current.length === 1 && debouncedValue?.current[0].type === "paragraph" && debouncedValue?.current[0].children.length === 1 && debouncedValue?.current[0].children[0].text === "";
|
272
261
|
if (isEmpty) {
|
273
262
|
event.preventDefault();
|
274
263
|
return;
|
@@ -308,10 +297,10 @@ const ChatEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
308
297
|
}
|
309
298
|
};
|
310
299
|
|
300
|
+
const html = isMarkDown ? convertMDToHTML(markDownContent) : null;
|
311
301
|
const handleFocus = () => {
|
312
302
|
setIsFocused(true);
|
313
303
|
};
|
314
|
-
const html = isMarkDown ? convertMDToHTML(markDownContent) : null;
|
315
304
|
return !isMarkDown ? /*#__PURE__*/_jsx(EditorProvider, {
|
316
305
|
theme: theme,
|
317
306
|
editor: editor,
|
@@ -322,18 +311,20 @@ const ChatEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
322
311
|
children: [toolBar && /*#__PURE__*/_jsx(MiniTextFormat, {
|
323
312
|
classes: classes,
|
324
313
|
editor: editor,
|
325
|
-
closeMainPopup: handleClose
|
314
|
+
closeMainPopup: handleClose,
|
315
|
+
customProps: customProps
|
326
316
|
}), /*#__PURE__*/_jsx(Editable, {
|
327
|
-
onFocus: handleFocus,
|
328
317
|
className: "chatEditorRoot",
|
329
318
|
renderElement: renderElement,
|
330
319
|
renderLeaf: renderLeaf,
|
331
320
|
decorate: decorators,
|
332
321
|
placeholder: "Start typing ...",
|
333
322
|
spellCheck: true,
|
323
|
+
onFocus: handleFocus,
|
334
324
|
onBlur: handleBlur,
|
335
325
|
onKeyDown: onKeyDown,
|
336
|
-
onPaste: handlePaste
|
326
|
+
onPaste: handlePaste,
|
327
|
+
customProps: customProps
|
337
328
|
}), !readOnly && isFocused ? /*#__PURE__*/_jsx(MentionsPopup, {
|
338
329
|
ref: mentionsRef,
|
339
330
|
mentions: mentions,
|
@@ -343,7 +334,8 @@ const ChatEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
343
334
|
index: index,
|
344
335
|
chars: chars,
|
345
336
|
type: type,
|
346
|
-
theme: theme
|
337
|
+
theme: theme,
|
338
|
+
customProps: customProps
|
347
339
|
}) : null]
|
348
340
|
}, id)
|
349
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 {
|
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) || "
|
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
|
-
|
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
|
-
|
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:
|
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
|
751
|
+
}) : null, !readOnly ? /*#__PURE__*/_jsx(SwitchViewport, {
|
642
752
|
breakpoint: breakpoint,
|
643
|
-
|
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__*/
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
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
|
-
|
24
|
+
zIndex: 1000
|
26
25
|
},
|
27
|
-
|
26
|
+
sx: classes.fullScreenWrapper,
|
27
|
+
children: [/*#__PURE__*/_jsx(DialogTitle, {
|
28
|
+
style: {
|
29
|
+
padding: "6px 8px"
|
30
|
+
},
|
28
31
|
children: /*#__PURE__*/_jsx(Grid, {
|
29
|
-
|
30
|
-
display: "flex",
|
31
|
-
justifyContent: "end"
|
32
|
-
},
|
33
|
-
children: /*#__PURE__*/_jsx(IconButton, {
|
34
|
-
onClick: onClose,
|
32
|
+
children: /*#__PURE__*/_jsx(Grid, {
|
35
33
|
style: {
|
36
|
-
|
34
|
+
display: "flex",
|
35
|
+
justifyContent: "end"
|
37
36
|
},
|
38
|
-
children: /*#__PURE__*/_jsx(
|
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
|
-
|
43
|
-
|
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
|
};
|
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,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
|
-
|
1352
|
-
|
1353
|
-
|
1354
|
-
|
1355
|
-
|
1356
|
-
|
1357
|
-
|
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 {
|