@flozy/editor 9.8.3 → 9.8.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Editor/ChatEditor.js +26 -19
- package/dist/Editor/CommonEditor.js +141 -26
- package/dist/Editor/DialogWrapper.js +31 -25
- package/dist/Editor/Editor.css +11 -7
- 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 +15 -5
- 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 +448 -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 +16 -11
- package/dist/Editor/Elements/Embed/Video.js +10 -7
- 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 +54 -6
- 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 +18 -10
- 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 +14 -5
- 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 +23 -11
- 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 +122 -42
- package/dist/Editor/Toolbar/PopupTool/ThemeTextFormat.js +436 -0
- package/dist/Editor/Toolbar/PopupTool/index.js +18 -2
- 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/ResetIconNew.js +23 -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 +31 -1
- package/dist/Editor/common/ImageSelector/ImageSelector.js +10 -8
- package/dist/Editor/common/ImageSelector/Options/AddLink.js +6 -4
- package/dist/Editor/common/ImageSelector/Styles.js +3 -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/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 +73 -9
- 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 +382 -0
- package/dist/Editor/common/RnD/VirtualElement/index.js +187 -103
- package/dist/Editor/common/RnD/VirtualElement/styles.js +155 -7
- package/dist/Editor/common/RnD/VirtualElement/updateAutoProps.js +5 -3
- package/dist/Editor/common/RnD/index.js +69 -13
- package/dist/Editor/common/Section/index.js +7 -4
- package/dist/Editor/common/Shorthands/elements.js +72 -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/lineSpacing.js +7 -6
- 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 +68 -57
- 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/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 +10 -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 +186 -54
- package/dist/Editor/utils/brains.js +1 -2
- 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 +4 -4
@@ -0,0 +1,259 @@
|
|
1
|
+
const style = () => ({
|
2
|
+
".fs-12": {
|
3
|
+
fontSize: "12px"
|
4
|
+
},
|
5
|
+
".fs-14": {
|
6
|
+
fontSize: "14px"
|
7
|
+
},
|
8
|
+
".fw-500": {
|
9
|
+
fontWeight: "500"
|
10
|
+
},
|
11
|
+
".fw-600": {
|
12
|
+
fontWeight: "600"
|
13
|
+
},
|
14
|
+
".pointer": {
|
15
|
+
cursor: "pointer"
|
16
|
+
},
|
17
|
+
".transformNone": {
|
18
|
+
textTransform: "none"
|
19
|
+
},
|
20
|
+
".settingsContainer": {
|
21
|
+
width: "340px",
|
22
|
+
padding: "16px 16px",
|
23
|
+
background: "#fff",
|
24
|
+
".header": {
|
25
|
+
borderBottom: `1px solid #DCE4EC`,
|
26
|
+
paddingBottom: "8px"
|
27
|
+
// marginBottom: "16px",
|
28
|
+
}
|
29
|
+
},
|
30
|
+
|
31
|
+
".title": {
|
32
|
+
fontWeight: "700",
|
33
|
+
fontSize: "14px"
|
34
|
+
},
|
35
|
+
".closeBtn": {
|
36
|
+
width: "26px",
|
37
|
+
height: "26px",
|
38
|
+
BorderRadius: "4px",
|
39
|
+
flexShrik: "0",
|
40
|
+
padding: "4px",
|
41
|
+
background: " #F8FAFC",
|
42
|
+
borderRadius: "4px"
|
43
|
+
},
|
44
|
+
".MuiTabs-scroller": {
|
45
|
+
borderBottom: `1px solid #DCE4EC`
|
46
|
+
},
|
47
|
+
".themeCardWrapper": {
|
48
|
+
borderRadius: "4px",
|
49
|
+
".active": {
|
50
|
+
background: "#ECF2FF"
|
51
|
+
}
|
52
|
+
},
|
53
|
+
".primaryCard, .secondaryCard": {
|
54
|
+
width: "44px",
|
55
|
+
height: "44px",
|
56
|
+
borderRadius: "5px",
|
57
|
+
border: `1px solid #929292`
|
58
|
+
},
|
59
|
+
".flexAlign": {
|
60
|
+
display: "flex",
|
61
|
+
alignItems: "center"
|
62
|
+
},
|
63
|
+
".activeColorBox, .xsColorBox": {
|
64
|
+
width: "24px",
|
65
|
+
height: "24px",
|
66
|
+
borderRadius: "5px",
|
67
|
+
border: `1px solid #929292`
|
68
|
+
},
|
69
|
+
".themeCard": {
|
70
|
+
borderRadius: "7px",
|
71
|
+
padding: "16px",
|
72
|
+
border: "1px solid #F3F3F3",
|
73
|
+
boxShadow: "1px 2px 5px 0px #00000014",
|
74
|
+
position: "relative",
|
75
|
+
flexWrap: "nowrap",
|
76
|
+
".tickIcon": {
|
77
|
+
visibility: "hidden",
|
78
|
+
opacity: "0",
|
79
|
+
position: "absolute",
|
80
|
+
right: "-8px",
|
81
|
+
top: "-8px"
|
82
|
+
},
|
83
|
+
"&.selected": {
|
84
|
+
".tickIcon": {
|
85
|
+
visibility: "visible",
|
86
|
+
opacity: "1"
|
87
|
+
}
|
88
|
+
}
|
89
|
+
},
|
90
|
+
".otherColors": {
|
91
|
+
display: "flex",
|
92
|
+
flexWrap: "wrap",
|
93
|
+
width: "48px",
|
94
|
+
".smallCard": {
|
95
|
+
width: "20px",
|
96
|
+
height: "20px",
|
97
|
+
borderRadius: "5px",
|
98
|
+
border: `1px solid #929292`
|
99
|
+
}
|
100
|
+
},
|
101
|
+
".imageUpload": {
|
102
|
+
background: "#F3F3F3",
|
103
|
+
borderRadius: "12px",
|
104
|
+
padding: "10px",
|
105
|
+
height: "208px",
|
106
|
+
position: "relative",
|
107
|
+
"& .resetIcon": {
|
108
|
+
position: "absolute",
|
109
|
+
right: "10px",
|
110
|
+
top: "10px"
|
111
|
+
},
|
112
|
+
".changeImgText": {
|
113
|
+
position: "absolute",
|
114
|
+
left: "50%",
|
115
|
+
top: "50%",
|
116
|
+
transform: "translate(-50%, -50%)",
|
117
|
+
zIndex: 1,
|
118
|
+
background: "#0000004D",
|
119
|
+
color: "#fff",
|
120
|
+
padding: "6px",
|
121
|
+
borderRadius: "6px",
|
122
|
+
fontSize: "12px",
|
123
|
+
fontWeight: 600,
|
124
|
+
opacity: "0",
|
125
|
+
visibility: "hidden"
|
126
|
+
},
|
127
|
+
"&:hover": {
|
128
|
+
".changeImgText": {
|
129
|
+
opacity: "1",
|
130
|
+
visibility: "visible"
|
131
|
+
}
|
132
|
+
}
|
133
|
+
},
|
134
|
+
".imgUploadInner": {
|
135
|
+
background: "#fff",
|
136
|
+
borderRadius: "10px",
|
137
|
+
border: "0.79px dashed #8360FD",
|
138
|
+
height: "100%"
|
139
|
+
},
|
140
|
+
".outlineBtn": {
|
141
|
+
color: "#2563EB",
|
142
|
+
borderRadius: "8px",
|
143
|
+
boxShadow: "0px 4px 10px 0px #00000026",
|
144
|
+
border: "1px solid #2563EB",
|
145
|
+
background: "#EBF1F9",
|
146
|
+
height: "34px",
|
147
|
+
textTransform: "unset",
|
148
|
+
fontWeight: "bold",
|
149
|
+
"&:hover": {
|
150
|
+
background: "#EBF1F9"
|
151
|
+
}
|
152
|
+
},
|
153
|
+
".seondaryOutlineBtn": {
|
154
|
+
border: "1px solid #D8DDE1",
|
155
|
+
borderRadius: "8px",
|
156
|
+
// boxShadow: "0px 4px 10px 0px #00000026",
|
157
|
+
height: "34px",
|
158
|
+
textTransform: "unset",
|
159
|
+
background: "#f5f6f9 !important",
|
160
|
+
color: "#64748B !important",
|
161
|
+
"&:hover": {
|
162
|
+
border: "1px solid #D8DDE1",
|
163
|
+
background: "#f5f6f9 !important"
|
164
|
+
}
|
165
|
+
},
|
166
|
+
".blueBtn": {
|
167
|
+
boxShadow: "0px 4px 10px 0px #00000026",
|
168
|
+
background: "#2563EB",
|
169
|
+
borderRadius: "8px",
|
170
|
+
textTransform: "unset",
|
171
|
+
height: "34px",
|
172
|
+
color: "#fff",
|
173
|
+
fontWeight: "bold",
|
174
|
+
"&.disabled": {
|
175
|
+
background: "#D9D9DD !important",
|
176
|
+
color: "#fff !important"
|
177
|
+
}
|
178
|
+
},
|
179
|
+
".generatedItem": {
|
180
|
+
border: "1px solid #E4E6E9",
|
181
|
+
borderRadius: "7px",
|
182
|
+
padding: "14px",
|
183
|
+
display: "flex",
|
184
|
+
gap: "16px",
|
185
|
+
position: "relative",
|
186
|
+
justifyContent: "space-between",
|
187
|
+
marginBottom: "12px",
|
188
|
+
".tickIcon": {
|
189
|
+
visibility: "hidden",
|
190
|
+
opacity: "0",
|
191
|
+
position: "absolute",
|
192
|
+
right: "-8px",
|
193
|
+
top: "-8px"
|
194
|
+
},
|
195
|
+
"&.selected": {
|
196
|
+
border: "1px solid #2563EB",
|
197
|
+
boxShadow: " 3px 3px 8px 0px #2563EB40",
|
198
|
+
".tickIcon": {
|
199
|
+
visibility: "visible",
|
200
|
+
opacity: "1"
|
201
|
+
}
|
202
|
+
},
|
203
|
+
".colorBox": {
|
204
|
+
border: "1px solid #929292",
|
205
|
+
height: "28px",
|
206
|
+
width: "28px",
|
207
|
+
borderRadius: "5px"
|
208
|
+
}
|
209
|
+
},
|
210
|
+
".textArea": {
|
211
|
+
background: "#F3F3F3",
|
212
|
+
borderRadius: "12px",
|
213
|
+
padding: "10px",
|
214
|
+
height: "208px",
|
215
|
+
"& textarea": {
|
216
|
+
width: "100%",
|
217
|
+
height: "100% !important",
|
218
|
+
border: "0.79px solid #8360FD",
|
219
|
+
background: "#FFFFFF",
|
220
|
+
borderRadius: "8px",
|
221
|
+
padding: "10px"
|
222
|
+
}
|
223
|
+
},
|
224
|
+
".imageUrl": {
|
225
|
+
height: "auto !important",
|
226
|
+
".MuiOutlinedInput-root": {
|
227
|
+
border: "0.79px solid #8360FD",
|
228
|
+
background: "#FFFFFF",
|
229
|
+
borderRadius: "8px",
|
230
|
+
".tickIcon": {
|
231
|
+
width: "18px"
|
232
|
+
}
|
233
|
+
},
|
234
|
+
"&.invalidUrl": {
|
235
|
+
".MuiInputAdornment-root": {
|
236
|
+
".tickIcon": {
|
237
|
+
".fillPath": {
|
238
|
+
fill: "#D9D9DD!important"
|
239
|
+
}
|
240
|
+
}
|
241
|
+
}
|
242
|
+
}
|
243
|
+
},
|
244
|
+
".saveThemeContainer": {
|
245
|
+
".MuiOutlinedInput-root": {
|
246
|
+
borderRadius: "8px",
|
247
|
+
boxShadow: "0px 4px 16px 0px #0000000D"
|
248
|
+
}
|
249
|
+
},
|
250
|
+
".uploadedImage": {
|
251
|
+
width: "126px",
|
252
|
+
height: "126px",
|
253
|
+
borderRadius: "126px"
|
254
|
+
},
|
255
|
+
".MuiDialog-paper": {
|
256
|
+
borderRadius: "10px"
|
257
|
+
}
|
258
|
+
});
|
259
|
+
export default style;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { Editor, Transforms, Element as SlateElement, Range
|
1
|
+
import { Editor, Transforms, Element as SlateElement, Range } from "slate";
|
2
2
|
import { Box } from "@mui/material";
|
3
3
|
import { sizeMap } from "./font";
|
4
4
|
import Link from "../Elements/Link/Link";
|
@@ -34,12 +34,12 @@ import SimpleText from "../Elements/SimpleText";
|
|
34
34
|
import CheckList from "../Elements/List/CheckList";
|
35
35
|
import { getTextColor, isEmptyTextNode } from "../helper";
|
36
36
|
import Attachments from "../Elements/Attachments/Attachments";
|
37
|
-
import { getBreakPointsValue,
|
37
|
+
import { getBreakPointsValue, textThemeFields, getElementProperty } from "../helper/theme";
|
38
38
|
import Variables from "../Elements/Variables/Variable";
|
39
|
-
import insertNewLine from "./insertNewLine";
|
40
39
|
import Divider from "../Elements/Divider/Divider";
|
41
40
|
import { getBorderColor, getSlateDom } from "./helper";
|
42
41
|
import Code from "../Elements/EmbedScript/Code";
|
42
|
+
import { ReactEditor } from "slate-react";
|
43
43
|
import FreeGrid from "../Elements/FreeGrid/FreeGrid";
|
44
44
|
import FreeGridItem from "../Elements/FreeGrid/FreeGridItem";
|
45
45
|
import FreeGridBox from "../Elements/FreeGrid/FreeGridBox";
|
@@ -47,7 +47,7 @@ import DataView from "../Elements/DataView/DataView";
|
|
47
47
|
import ViewData from "../Elements/DataView/Layouts/ViewData";
|
48
48
|
import ColumnView from "../Elements/DataView/Layouts/ColumnView";
|
49
49
|
import SearchAttachment from "../Elements/Search/SearchAttachment";
|
50
|
-
|
50
|
+
import { wrapThemeBreakpoints } from "../Elements/FreeGrid/breakpointConstants";
|
51
51
|
import { jsx as _jsx } from "react/jsx-runtime";
|
52
52
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
53
53
|
const alignment = ["alignLeft", "alignRight", "alignCenter", "alignJustify"];
|
@@ -56,7 +56,17 @@ const LIST_FORMAT_TYPE = {
|
|
56
56
|
orderedList: "list-item",
|
57
57
|
unorderedList: "list-item"
|
58
58
|
};
|
59
|
-
|
59
|
+
|
60
|
+
// const NEWLINESAFTER = [
|
61
|
+
// "headingOne",
|
62
|
+
// "headingTwo",
|
63
|
+
// "headingThree",
|
64
|
+
// "headingFour",
|
65
|
+
// "headingFive",
|
66
|
+
// "headingSix",
|
67
|
+
// ];
|
68
|
+
|
69
|
+
const THEME_BLOCK_FIELDS = ["headingOne", "headingTwo", "headingThree", "headingFour", "headingFive", "headingSix", "paragraphOne", "paragraphTwo", "paragraphThree"];
|
60
70
|
export const toggleBlock = (editor, format, selection = true, attr = {}) => {
|
61
71
|
const isActive = isBlockActive(editor, format);
|
62
72
|
const isList = list_types.includes(format);
|
@@ -89,8 +99,9 @@ export const toggleBlock = (editor, format, selection = true, attr = {}) => {
|
|
89
99
|
if (!selection) {
|
90
100
|
Transforms.insertText(editor, "");
|
91
101
|
}
|
102
|
+
const forActiveType = THEME_BLOCK_FIELDS.some(f => f === format) ? format : "paragraph";
|
92
103
|
Transforms.setNodes(editor, {
|
93
|
-
type: isActive ?
|
104
|
+
type: isActive ? forActiveType : isList ? LIST_FORMAT_TYPE[format] : format,
|
94
105
|
...attr
|
95
106
|
});
|
96
107
|
if (isList && !isActive) {
|
@@ -99,10 +110,12 @@ export const toggleBlock = (editor, format, selection = true, attr = {}) => {
|
|
99
110
|
children: []
|
100
111
|
});
|
101
112
|
}
|
102
|
-
|
103
|
-
|
104
|
-
|
113
|
+
|
114
|
+
// if (NEWLINESAFTER.indexOf(format) > -1) {
|
115
|
+
// insertNewLine(editor);
|
116
|
+
// }
|
105
117
|
};
|
118
|
+
|
106
119
|
export const addMarkData = (editor, data) => {
|
107
120
|
try {
|
108
121
|
Editor.addMark(editor, data.format, data.value);
|
@@ -111,9 +124,14 @@ export const addMarkData = (editor, data) => {
|
|
111
124
|
}
|
112
125
|
};
|
113
126
|
export const toggleMark = (editor, format) => {
|
114
|
-
const isActive =
|
127
|
+
const isActive = isMarkBtnActive(editor, format);
|
115
128
|
if (isActive) {
|
116
|
-
|
129
|
+
const isThemeSupportedMark = textThemeFields.some(f => f === format);
|
130
|
+
if (isThemeSupportedMark) {
|
131
|
+
Editor.addMark(editor, format, false);
|
132
|
+
} else {
|
133
|
+
Editor.removeMark(editor, format);
|
134
|
+
}
|
117
135
|
} else {
|
118
136
|
Editor.addMark(editor, format, true);
|
119
137
|
}
|
@@ -127,6 +145,58 @@ export const isMarkActive = (editor, format) => {
|
|
127
145
|
return null;
|
128
146
|
}
|
129
147
|
};
|
148
|
+
export const isMarkBtnActive = (editor, format) => {
|
149
|
+
switch (format) {
|
150
|
+
case "bold":
|
151
|
+
{
|
152
|
+
const style = getSelectedElementStyle("font-weight", editor);
|
153
|
+
return style === "700";
|
154
|
+
}
|
155
|
+
case "italic":
|
156
|
+
{
|
157
|
+
const style = getSelectedElementStyle("font-style", editor);
|
158
|
+
return style === format;
|
159
|
+
}
|
160
|
+
// case "underline": {
|
161
|
+
// const style = getSelectedElementStyle("text-decoration");
|
162
|
+
|
163
|
+
// return style?.includes(format);
|
164
|
+
// }
|
165
|
+
// case "strikethrough": {
|
166
|
+
// const style = getSelectedElementStyle("text-decoration");
|
167
|
+
|
168
|
+
// return style?.includes("line-through");
|
169
|
+
// }
|
170
|
+
default:
|
171
|
+
return isMarkActive(editor, format);
|
172
|
+
}
|
173
|
+
};
|
174
|
+
export const getSelectedElementStyle = (styleProperty, editor, format) => {
|
175
|
+
try {
|
176
|
+
if (!editor.selection) {
|
177
|
+
return "";
|
178
|
+
}
|
179
|
+
if (Range.isCollapsed(editor.selection)) {
|
180
|
+
return "";
|
181
|
+
}
|
182
|
+
if (format) {
|
183
|
+
const value = activeMark(editor, format, true);
|
184
|
+
if (value) {
|
185
|
+
return value;
|
186
|
+
}
|
187
|
+
}
|
188
|
+
const domRange = ReactEditor.toDOMRange(editor, editor.selection);
|
189
|
+
const selectedDomNode = domRange.commonAncestorContainer;
|
190
|
+
|
191
|
+
// If it's a text node, get its parent element
|
192
|
+
const selectedElement = selectedDomNode.nodeType === 3 ? selectedDomNode.parentElement : selectedDomNode;
|
193
|
+
if (selectedElement) {
|
194
|
+
return getElementProperty(selectedElement, styleProperty);
|
195
|
+
}
|
196
|
+
} catch (err) {
|
197
|
+
console.log(err);
|
198
|
+
}
|
199
|
+
};
|
130
200
|
export const isBlockActive = (editor, format) => {
|
131
201
|
const [match] = Editor.nodes(editor, {
|
132
202
|
match: n => !Editor.isEditor(n) && SlateElement.isElement(n) && n.type === format
|
@@ -152,7 +222,7 @@ export const upateBlockActive = (editor, format, attr = {}) => {
|
|
152
222
|
});
|
153
223
|
}
|
154
224
|
};
|
155
|
-
export const activeMark = (editor, format) => {
|
225
|
+
export const activeMark = (editor, format, noDefaultValue) => {
|
156
226
|
const defaultMarkData = {
|
157
227
|
color: "#000000",
|
158
228
|
bgColor: "#FFFFFF",
|
@@ -162,7 +232,7 @@ export const activeMark = (editor, format) => {
|
|
162
232
|
};
|
163
233
|
try {
|
164
234
|
const marks = Editor.marks(editor);
|
165
|
-
let defaultValue = defaultMarkData[format];
|
235
|
+
let defaultValue = noDefaultValue ? "" : defaultMarkData[format];
|
166
236
|
const {
|
167
237
|
selection
|
168
238
|
} = editor || {};
|
@@ -179,6 +249,31 @@ export const activeMark = (editor, format) => {
|
|
179
249
|
return null;
|
180
250
|
}
|
181
251
|
};
|
252
|
+
|
253
|
+
// to avoid the styles, that automatically assign from themes
|
254
|
+
const getThemeMarkedLeaf = (leaf, children) => {
|
255
|
+
const {
|
256
|
+
italic,
|
257
|
+
bold
|
258
|
+
} = leaf || {};
|
259
|
+
const style = {};
|
260
|
+
if (italic === false) {
|
261
|
+
style.fontStyle = "normal";
|
262
|
+
}
|
263
|
+
if (bold === false) {
|
264
|
+
style.fontWeight = "normal";
|
265
|
+
}
|
266
|
+
if (Object.keys(style).length) {
|
267
|
+
children = /*#__PURE__*/_jsx(Box, {
|
268
|
+
component: "span",
|
269
|
+
sx: {
|
270
|
+
"& span": style
|
271
|
+
},
|
272
|
+
children: children
|
273
|
+
});
|
274
|
+
}
|
275
|
+
return children;
|
276
|
+
};
|
182
277
|
export const getMarked = (leaf, children, theme) => {
|
183
278
|
const className = leaf?.doublequote ? "doublequote" : "";
|
184
279
|
if (leaf.highlight) {
|
@@ -205,6 +300,7 @@ export const getMarked = (leaf, children, theme) => {
|
|
205
300
|
children: children
|
206
301
|
});
|
207
302
|
}
|
303
|
+
children = getThemeMarkedLeaf(leaf, children);
|
208
304
|
if (leaf.strikethrough) {
|
209
305
|
children = /*#__PURE__*/_jsx("span", {
|
210
306
|
style: {
|
@@ -232,20 +328,27 @@ export const getMarked = (leaf, children, theme) => {
|
|
232
328
|
if (leaf.color || leaf.bgColor || leaf.fontSize || leaf.fontFamily || leaf.fontWeight || className) {
|
233
329
|
const family = leaf?.fontFamily;
|
234
330
|
const textStyles = getTextColor(leaf?.color);
|
331
|
+
const fontSize = {
|
332
|
+
lg: sizeMap[leaf.fontSize] || leaf.fontSize,
|
333
|
+
...getBreakPointsValue(leaf.fontSize, null, "overrideText")
|
334
|
+
};
|
335
|
+
const fontSizesImportant = {};
|
336
|
+
Object.entries(fontSize).forEach(([key, value]) => {
|
337
|
+
fontSizesImportant[key] = `${value} !important`;
|
338
|
+
});
|
339
|
+
const fontSizeWithBreakpoints = wrapThemeBreakpoints(fontSizesImportant, "fontSize", theme);
|
235
340
|
children = /*#__PURE__*/_jsx("span", {
|
236
|
-
style: {
|
237
|
-
background: leaf.bgColor
|
238
|
-
},
|
239
341
|
children: /*#__PURE__*/_jsx(Box, {
|
240
|
-
className: className
|
342
|
+
className: `${className} leaf-item`,
|
241
343
|
component: "span",
|
242
344
|
sx: {
|
243
|
-
|
244
|
-
fontSize:
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
},
|
345
|
+
"& span": {
|
346
|
+
// fontSize: fontSizesImportant,
|
347
|
+
// ...groupByBreakpoint(fontSizesImportant, theme),
|
348
|
+
background: leaf.bgColor,
|
349
|
+
...fontSizeWithBreakpoints
|
350
|
+
},
|
351
|
+
...fontSizeWithBreakpoints,
|
249
352
|
// ...wrapThemeBreakpoints(
|
250
353
|
// {
|
251
354
|
// lg: sizeMap[leaf.fontSize] || leaf.fontSize,
|
@@ -258,11 +361,16 @@ export const getMarked = (leaf, children, theme) => {
|
|
258
361
|
// lg: sizeMap[leaf.fontSize] || leaf.fontSize,
|
259
362
|
// ...getBreakPointsValue(leaf.fontSize, null, "overrideText"),
|
260
363
|
// },
|
261
|
-
|
364
|
+
'& span[data-slate-string="true"]': {
|
365
|
+
...textStyles
|
366
|
+
},
|
262
367
|
fontFamily: family,
|
263
368
|
fontWeight: leaf.fontWeight,
|
264
369
|
WebkitTextFillColor: "unset !important"
|
265
370
|
},
|
371
|
+
style: {
|
372
|
+
"--fontSize_xs": leaf?.fontSize?.xs || "auto"
|
373
|
+
},
|
266
374
|
children: children
|
267
375
|
})
|
268
376
|
});
|
@@ -284,71 +392,94 @@ export const getMarked = (leaf, children, theme) => {
|
|
284
392
|
export const getBlock = props => {
|
285
393
|
const {
|
286
394
|
element,
|
287
|
-
children
|
395
|
+
children,
|
396
|
+
customProps
|
288
397
|
} = props;
|
398
|
+
const {
|
399
|
+
customLineHeight
|
400
|
+
} = customProps || {};
|
289
401
|
const attributes = props.attributes ?? {};
|
290
402
|
const isEmpty = isEmptyTextNode(element);
|
403
|
+
const {
|
404
|
+
translation
|
405
|
+
} = customProps;
|
406
|
+
const commonHeadingProps = () => ({
|
407
|
+
...attributes,
|
408
|
+
...element.attr,
|
409
|
+
className: `edt-headings content-editable ${isEmpty ? "empty" : ""} theme-element`
|
410
|
+
});
|
411
|
+
const commonParaProps = paraType => ({
|
412
|
+
...attributes,
|
413
|
+
...element.attr,
|
414
|
+
className: `edt-paragraphs content-editable ${isEmpty ? "empty" : ""} theme-element ${paraType}`
|
415
|
+
});
|
291
416
|
switch (element.type) {
|
292
417
|
case "headingOne":
|
293
418
|
return /*#__PURE__*/_jsxs("h1", {
|
294
|
-
...
|
295
|
-
|
296
|
-
className: `edt-headings content-editable ${isEmpty ? "empty" : ""}`,
|
297
|
-
placeholder: "Heading 1",
|
419
|
+
...commonHeadingProps(),
|
420
|
+
placeholder: translation("Heading 1"),
|
298
421
|
children: [children, /*#__PURE__*/_jsx("span", {
|
299
422
|
contentEditable: false
|
300
423
|
})]
|
301
424
|
});
|
302
425
|
case "headingTwo":
|
303
426
|
return /*#__PURE__*/_jsxs("h2", {
|
304
|
-
...
|
305
|
-
|
306
|
-
className: `edt-headings content-editable ${isEmpty ? "empty" : ""}`,
|
307
|
-
placeholder: "Heading 2",
|
427
|
+
...commonHeadingProps(),
|
428
|
+
placeholder: translation("Heading 2"),
|
308
429
|
children: [children, /*#__PURE__*/_jsx("span", {
|
309
430
|
contentEditable: false
|
310
431
|
})]
|
311
432
|
});
|
312
433
|
case "headingThree":
|
313
434
|
return /*#__PURE__*/_jsxs("h3", {
|
314
|
-
...
|
315
|
-
|
316
|
-
className: `edt-headings content-editable ${isEmpty ? "empty" : ""}`,
|
317
|
-
placeholder: "Heading 3",
|
435
|
+
...commonHeadingProps(),
|
436
|
+
placeholder: translation("Heading 3"),
|
318
437
|
children: [children, /*#__PURE__*/_jsx("span", {
|
319
438
|
contentEditable: false
|
320
439
|
})]
|
321
440
|
});
|
322
441
|
case "headingFour":
|
323
442
|
return /*#__PURE__*/_jsxs("h4", {
|
324
|
-
...
|
325
|
-
|
326
|
-
className: `edt-headings content-editable ${isEmpty ? "empty" : ""}`,
|
327
|
-
placeholder: "Heading 4",
|
443
|
+
...commonHeadingProps(),
|
444
|
+
placeholder: translation("Heading 4"),
|
328
445
|
children: [children, /*#__PURE__*/_jsx("span", {
|
329
446
|
contentEditable: false
|
330
447
|
})]
|
331
448
|
});
|
332
449
|
case "headingFive":
|
333
450
|
return /*#__PURE__*/_jsxs("h5", {
|
334
|
-
...
|
335
|
-
|
336
|
-
className: `edt-headings content-editable ${isEmpty ? "empty" : ""}`,
|
337
|
-
placeholder: "Heading 5",
|
451
|
+
...commonHeadingProps(),
|
452
|
+
placeholder: translation("Heading 5"),
|
338
453
|
children: [children, /*#__PURE__*/_jsx("span", {
|
339
454
|
contentEditable: false
|
340
455
|
})]
|
341
456
|
});
|
342
457
|
case "headingSix":
|
343
458
|
return /*#__PURE__*/_jsxs("h6", {
|
344
|
-
...
|
345
|
-
|
346
|
-
className: `edt-headings content-editable ${isEmpty ? "empty" : ""}`,
|
347
|
-
placeholder: "Heading 6",
|
459
|
+
...commonHeadingProps(),
|
460
|
+
placeholder: translation("Heading 6"),
|
348
461
|
children: [children, /*#__PURE__*/_jsx("span", {
|
349
462
|
contentEditable: false
|
350
463
|
})]
|
351
464
|
});
|
465
|
+
case "paragraphOne":
|
466
|
+
return /*#__PURE__*/_jsx("p", {
|
467
|
+
...commonParaProps("para1"),
|
468
|
+
placeholder: "Paragraph 1",
|
469
|
+
children: children
|
470
|
+
});
|
471
|
+
case "paragraphTwo":
|
472
|
+
return /*#__PURE__*/_jsx("p", {
|
473
|
+
...commonParaProps("para2"),
|
474
|
+
placeholder: "Paragraph 2",
|
475
|
+
children: children
|
476
|
+
});
|
477
|
+
case "paragraphThree":
|
478
|
+
return /*#__PURE__*/_jsx("p", {
|
479
|
+
...commonParaProps("para3"),
|
480
|
+
placeholder: "Paragraph 3",
|
481
|
+
children: children
|
482
|
+
});
|
352
483
|
case "blockquote":
|
353
484
|
return /*#__PURE__*/_jsx("blockquote", {
|
354
485
|
...attributes,
|
@@ -362,7 +493,7 @@ export const getBlock = props => {
|
|
362
493
|
margin: `${element?.bgColor ? "16px" : "0px"} 0px`,
|
363
494
|
width: element?.bgColor ? "calc(100% - 16px)" : "100%",
|
364
495
|
borderWidth: element?.color ? "0px 0px 0px 3px" : "0px",
|
365
|
-
lineHeight:
|
496
|
+
lineHeight: `${customLineHeight} !important`
|
366
497
|
},
|
367
498
|
children: children
|
368
499
|
});
|
@@ -414,16 +545,17 @@ export const getBlock = props => {
|
|
414
545
|
...attributes,
|
415
546
|
...element.attr,
|
416
547
|
className: `content-editable ${isEmpty ? "empty" : ""}`,
|
417
|
-
placeholder: "List",
|
548
|
+
placeholder: translation("List"),
|
418
549
|
style: {
|
419
|
-
color: firstChildren?.color
|
550
|
+
color: firstChildren?.color,
|
551
|
+
lineHeight: `${customLineHeight} !important`
|
420
552
|
},
|
421
553
|
children: children
|
422
554
|
});
|
423
555
|
case "orderedList":
|
424
556
|
return /*#__PURE__*/_jsx("ol", {
|
425
557
|
style: {
|
426
|
-
lineHeight:
|
558
|
+
lineHeight: `${customLineHeight} !important`
|
427
559
|
},
|
428
560
|
className: "listItemMargin",
|
429
561
|
type: "1",
|
@@ -433,7 +565,7 @@ export const getBlock = props => {
|
|
433
565
|
case "unorderedList":
|
434
566
|
return /*#__PURE__*/_jsx("ul", {
|
435
567
|
style: {
|
436
|
-
lineHeight:
|
568
|
+
lineHeight: `${customLineHeight} !important`
|
437
569
|
},
|
438
570
|
className: "listItemMargin",
|
439
571
|
...attributes,
|
@@ -17,8 +17,7 @@ export const insertBrain = (editor, data, position) => {
|
|
17
17
|
}]
|
18
18
|
};
|
19
19
|
const [currentNode, currentPath] = Editor.node(editor, selection);
|
20
|
-
|
21
|
-
const cleanedText = Node.string(currentNode).replace(/\/(?:b(?:rain|rai|ra|r)?)?/g, "").trim();
|
20
|
+
const cleanedText = Node.string(currentNode).toLowerCase().replace(/\/(?:b(?:rain|rai|ra|r)?)?/g, "").trim();
|
22
21
|
if (cleanedText) {
|
23
22
|
Transforms.delete(editor, {
|
24
23
|
at: Editor.range(editor, currentPath)
|