@flozy/editor 9.5.4 → 9.5.5
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 +29 -20
- package/dist/Editor/CommonEditor.js +19 -130
- package/dist/Editor/DialogWrapper.js +25 -31
- package/dist/Editor/Editor.css +7 -11
- package/dist/Editor/Elements/AI/AIInput.js +3 -5
- package/dist/Editor/Elements/AI/CustomSelect.js +5 -9
- package/dist/Editor/Elements/AI/PopoverAIInput.js +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 +3 -3
- 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 +11 -16
- package/dist/Editor/Elements/Embed/Video.js +6 -9
- package/dist/Editor/Elements/EmbedScript/Code.js +4 -7
- package/dist/Editor/Elements/EmbedScript/EmbedScript.js +2 -6
- package/dist/Editor/Elements/EmbedScript/EmbedScriptPopup.js +5 -8
- package/dist/Editor/Elements/Emoji/EmojiButton.js +2 -6
- package/dist/Editor/Elements/Form/FieldPopup.js +1 -4
- package/dist/Editor/Elements/Form/Form.js +9 -12
- package/dist/Editor/Elements/Form/FormButton.js +2 -6
- package/dist/Editor/Elements/Form/FormPopup.js +2 -3
- package/dist/Editor/Elements/Form/Workflow/FormWorkflow.js +12 -18
- package/dist/Editor/Elements/Form/Workflow/ListWorkflow.js +8 -13
- package/dist/Editor/Elements/Form/Workflow/MoreOptions.js +2 -3
- package/dist/Editor/Elements/Form/Workflow/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 +3 -21
- package/dist/Editor/Elements/FreeGrid/FreeGridButton.js +2 -6
- package/dist/Editor/Elements/FreeGrid/FreeGridItem.js +4 -34
- 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 +2 -6
- 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 +4 -8
- package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +9 -16
- package/dist/Editor/Toolbar/PopupTool/TemplateCard.js +5 -11
- package/dist/Editor/Toolbar/PopupTool/TextFormat.js +42 -122
- package/dist/Editor/Toolbar/PopupTool/index.js +1 -17
- 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/Styles.js +9 -3
- package/dist/Editor/common/LinkSettings/NavComponents.js +10 -14
- package/dist/Editor/common/LinkSettings/index.js +14 -20
- package/dist/Editor/common/LinkSettings/navOptions.js +1 -1
- package/dist/Editor/common/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/OptionsPopup/index.js +3 -4
- package/dist/Editor/common/RnD/SwitchViewport/SwitchViewport.js +4 -11
- package/dist/Editor/common/RnD/Theme/ViewportStimulator.js +3 -6
- package/dist/Editor/common/RnD/Utils/gridDropItem.js +7 -56
- package/dist/Editor/common/RnD/Utils/index.js +0 -3
- package/dist/Editor/common/RnD/VirtualElement/index.js +103 -187
- package/dist/Editor/common/RnD/VirtualElement/styles.js +7 -123
- package/dist/Editor/common/RnD/VirtualElement/updateAutoProps.js +3 -5
- package/dist/Editor/common/RnD/index.js +7 -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 +57 -68
- package/dist/Editor/helper/index.js +2 -2
- package/dist/Editor/helper/theme.js +2 -202
- package/dist/Editor/hooks/useMouseMove.js +3 -9
- package/dist/Editor/plugins/withEmbeds.js +1 -1
- package/dist/Editor/plugins/withHTML.js +7 -10
- 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 +47 -164
- package/dist/Editor/utils/draftToSlate.js +2 -3
- package/dist/Editor/utils/embed.js +6 -8
- 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/dist/Editor/utils/table.js +6 -9
- package/package.json +2 -2
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/MultiSelect.js +0 -425
- package/dist/Editor/Toolbar/PopupTool/ThemeTextFormat.js +0 -441
- 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 -33
- 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 -285
- package/dist/Editor/themeSettings/buttons/style.js +0 -23
- package/dist/Editor/themeSettings/colorTheme/index.js +0 -305
- 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 -222
- package/dist/Editor/themeSettings/fonts/style.js +0 -60
- package/dist/Editor/themeSettings/icons.js +0 -60
- package/dist/Editor/themeSettings/index.js +0 -331
- package/dist/Editor/themeSettings/style.js +0 -211
- 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,153 +0,0 @@
|
|
1
|
-
import { useSlate } from "slate-react";
|
2
|
-
import { defaultTheme } from "../theme";
|
3
|
-
import { getPageSettings, updatePageSettings } from "../utils/pageSettings";
|
4
|
-
import { HEADING_THEME_FIELDS, PARAGRAPH_THEME_FIELDS } from "../helper/theme";
|
5
|
-
import { useEditorContext } from "./useMouseMove";
|
6
|
-
const MAP_FIELDS = {
|
7
|
-
HEADING: HEADING_THEME_FIELDS,
|
8
|
-
PARAGRAPH: PARAGRAPH_THEME_FIELDS
|
9
|
-
};
|
10
|
-
const MAP_FONT_FIELD_KEYS = {
|
11
|
-
HEADING: "headingFontFamily",
|
12
|
-
PARAGRAPH: "paragraphFontFamily"
|
13
|
-
};
|
14
|
-
function getUpdatePayload(prevTheme = {}, update, actionData) {
|
15
|
-
const {
|
16
|
-
action,
|
17
|
-
fieldName
|
18
|
-
} = actionData || {};
|
19
|
-
const {
|
20
|
-
theme: prev
|
21
|
-
} = prevTheme;
|
22
|
-
let theme = {};
|
23
|
-
let themeProps = {};
|
24
|
-
switch (action) {
|
25
|
-
case "THEME_CHANGE":
|
26
|
-
theme = update;
|
27
|
-
break;
|
28
|
-
case "CSS_VAR_CHANGE":
|
29
|
-
const prevCssVars = prev?.cssVars || {};
|
30
|
-
const prevValue = prevCssVars[fieldName] || {};
|
31
|
-
themeProps = {
|
32
|
-
...(prev || {}),
|
33
|
-
cssVars: {
|
34
|
-
...prevCssVars,
|
35
|
-
[fieldName]: {
|
36
|
-
...prevValue,
|
37
|
-
...update
|
38
|
-
}
|
39
|
-
}
|
40
|
-
};
|
41
|
-
theme = {
|
42
|
-
...prevTheme,
|
43
|
-
theme: themeProps
|
44
|
-
};
|
45
|
-
break;
|
46
|
-
case "ELEMENT_PROPS_CHANGE":
|
47
|
-
const prevEleProps = prev?.elementProps || {};
|
48
|
-
const prevEleValue = prevEleProps[fieldName] || {};
|
49
|
-
themeProps = {
|
50
|
-
...(prev || {}),
|
51
|
-
elementProps: {
|
52
|
-
...prevEleProps,
|
53
|
-
[fieldName]: {
|
54
|
-
...prevEleValue,
|
55
|
-
...update
|
56
|
-
}
|
57
|
-
}
|
58
|
-
};
|
59
|
-
theme = {
|
60
|
-
...prevTheme,
|
61
|
-
theme: themeProps
|
62
|
-
};
|
63
|
-
break;
|
64
|
-
case "OTHER_PROPS_CHANGE":
|
65
|
-
themeProps = {
|
66
|
-
...(prev || {}),
|
67
|
-
otherProps: {
|
68
|
-
...(prev.otherProps || {}),
|
69
|
-
...update
|
70
|
-
}
|
71
|
-
};
|
72
|
-
theme = {
|
73
|
-
...prevTheme,
|
74
|
-
theme: themeProps
|
75
|
-
};
|
76
|
-
break;
|
77
|
-
case "FONT_CHANGE":
|
78
|
-
const {
|
79
|
-
elementProps = {},
|
80
|
-
otherProps = {}
|
81
|
-
} = prev;
|
82
|
-
const {
|
83
|
-
fieldType
|
84
|
-
} = actionData || {};
|
85
|
-
const fields = MAP_FIELDS[fieldType];
|
86
|
-
const fontFieldsUpdate = {};
|
87
|
-
fields?.forEach(field => {
|
88
|
-
const prevFieldData = elementProps[field];
|
89
|
-
fontFieldsUpdate[field] = {
|
90
|
-
...prevFieldData,
|
91
|
-
...update
|
92
|
-
};
|
93
|
-
});
|
94
|
-
const FONT_KEY_FOR_FIELD = MAP_FONT_FIELD_KEYS[fieldType];
|
95
|
-
themeProps = {
|
96
|
-
...(prev || {}),
|
97
|
-
elementProps: {
|
98
|
-
...elementProps,
|
99
|
-
...fontFieldsUpdate
|
100
|
-
},
|
101
|
-
otherProps: {
|
102
|
-
...otherProps,
|
103
|
-
[FONT_KEY_FOR_FIELD]: update?.fontFamily
|
104
|
-
}
|
105
|
-
};
|
106
|
-
theme = {
|
107
|
-
...prevTheme,
|
108
|
-
theme: themeProps
|
109
|
-
};
|
110
|
-
break;
|
111
|
-
default:
|
112
|
-
theme = {
|
113
|
-
...prevTheme,
|
114
|
-
...(update || {})
|
115
|
-
};
|
116
|
-
break;
|
117
|
-
}
|
118
|
-
return theme;
|
119
|
-
}
|
120
|
-
const updateTheme = (editor, pageSt, update, actionData, triggerRender) => {
|
121
|
-
const {
|
122
|
-
pageProps
|
123
|
-
} = pageSt || {};
|
124
|
-
const {
|
125
|
-
theme
|
126
|
-
} = pageProps || {};
|
127
|
-
const updatedTheme = getUpdatePayload(theme, update, actionData);
|
128
|
-
updatePageSettings(editor, {
|
129
|
-
...(pageProps || {}),
|
130
|
-
theme: updatedTheme
|
131
|
-
});
|
132
|
-
triggerRender();
|
133
|
-
};
|
134
|
-
export const useEditorTheme = () => {
|
135
|
-
const editor = useSlate();
|
136
|
-
const {
|
137
|
-
triggerRender
|
138
|
-
} = useEditorContext();
|
139
|
-
const {
|
140
|
-
element: pageSt
|
141
|
-
} = getPageSettings(editor) || {};
|
142
|
-
const {
|
143
|
-
pageProps
|
144
|
-
} = pageSt || {};
|
145
|
-
const {
|
146
|
-
theme
|
147
|
-
} = pageProps || {};
|
148
|
-
return {
|
149
|
-
selectedTheme: theme?.theme || defaultTheme?.theme,
|
150
|
-
updateTheme: (update, actionData) => updateTheme(editor, pageSt, update, actionData, triggerRender),
|
151
|
-
theme
|
152
|
-
};
|
153
|
-
};
|
@@ -1,63 +0,0 @@
|
|
1
|
-
import { useEffect, useState } from "react";
|
2
|
-
import { getElementProperty } from "../helper/theme";
|
3
|
-
import { ReactEditor } from "slate-react";
|
4
|
-
import { Node } from "slate";
|
5
|
-
import { useEditorTheme } from "./useEditorTheme";
|
6
|
-
function useThemeValues() {
|
7
|
-
return {};
|
8
|
-
}
|
9
|
-
export default useThemeValues;
|
10
|
-
export function useButtonStyle(value, key, element) {
|
11
|
-
const [buttonStyle, setButtonStyle] = useState(value);
|
12
|
-
const {
|
13
|
-
selectedTheme
|
14
|
-
} = useEditorTheme();
|
15
|
-
const themeBtnProps = selectedTheme?.elementProps?.button || {};
|
16
|
-
useEffect(() => {
|
17
|
-
const color = getColorValue(value, key, element, themeBtnProps);
|
18
|
-
setButtonStyle({
|
19
|
-
color
|
20
|
-
});
|
21
|
-
}, [value, key, element]);
|
22
|
-
return {
|
23
|
-
buttonStyle
|
24
|
-
};
|
25
|
-
}
|
26
|
-
const DEFAULT_MAP_THEMES = {
|
27
|
-
textColor: "color",
|
28
|
-
bgColor: "backgroundColor"
|
29
|
-
};
|
30
|
-
const hoverMap = (theme, format) => {
|
31
|
-
const hover = theme?.hover || {};
|
32
|
-
const key = DEFAULT_MAP_THEMES[format];
|
33
|
-
return hover[key];
|
34
|
-
};
|
35
|
-
const MAP_THEME_KEYS = {
|
36
|
-
...DEFAULT_MAP_THEMES,
|
37
|
-
textColorHover: hoverMap,
|
38
|
-
bgColorHover: hoverMap
|
39
|
-
};
|
40
|
-
const getColorValue = (val, key, elementProps, themeBtnProps) => {
|
41
|
-
const themeKey = MAP_THEME_KEYS[key];
|
42
|
-
if (elementProps?.type === "button" && !val && themeKey) {
|
43
|
-
if (typeof themeKey === "string") {
|
44
|
-
return themeBtnProps[themeKey];
|
45
|
-
} else {
|
46
|
-
return themeKey(themeBtnProps, key);
|
47
|
-
}
|
48
|
-
}
|
49
|
-
return val;
|
50
|
-
};
|
51
|
-
export function getButtonElementStyle(editor, element, stylePropertyName) {
|
52
|
-
try {
|
53
|
-
const path = ReactEditor.findPath(editor, element);
|
54
|
-
if (path?.length) {
|
55
|
-
const currentEle = Node.get(editor, path);
|
56
|
-
const dom = ReactEditor.toDOMNode(editor, currentEle);
|
57
|
-
const editorBtn = dom?.querySelector(".button.theme-element");
|
58
|
-
return getElementProperty(editorBtn, stylePropertyName);
|
59
|
-
}
|
60
|
-
} catch (err) {
|
61
|
-
// console.log(err);
|
62
|
-
}
|
63
|
-
}
|
@@ -1,147 +0,0 @@
|
|
1
|
-
import { getDevice } from "../helper/theme";
|
2
|
-
const themeClassName = ".theme-element";
|
3
|
-
function getTextStyles(props) {
|
4
|
-
const {
|
5
|
-
fontSize,
|
6
|
-
textDecoration,
|
7
|
-
...rest
|
8
|
-
} = props;
|
9
|
-
const device = getDevice();
|
10
|
-
const fontS = typeof fontSize === "object" ? fontSize[device] : fontSize;
|
11
|
-
return {
|
12
|
-
...rest,
|
13
|
-
'& span[data-slate-string="true"]': {
|
14
|
-
textDecoration,
|
15
|
-
fontSize: fontS
|
16
|
-
}
|
17
|
-
|
18
|
-
// "&::after": {
|
19
|
-
// // for placeholder
|
20
|
-
// fontSize,
|
21
|
-
// },
|
22
|
-
};
|
23
|
-
}
|
24
|
-
|
25
|
-
const transformHeading = (props, elementType) => {
|
26
|
-
return {
|
27
|
-
[`& ${elementType}${themeClassName}`]: getTextStyles(props)
|
28
|
-
};
|
29
|
-
};
|
30
|
-
const transformParagraph = (props, paraType) => {
|
31
|
-
return {
|
32
|
-
[`& p${themeClassName}.${paraType}`]: getTextStyles(props)
|
33
|
-
};
|
34
|
-
};
|
35
|
-
const transformButton = props => {
|
36
|
-
const {
|
37
|
-
borderRadius,
|
38
|
-
lockRadius,
|
39
|
-
bannerSpacing,
|
40
|
-
buttonIcon,
|
41
|
-
hover,
|
42
|
-
...classProps
|
43
|
-
} = props;
|
44
|
-
return {
|
45
|
-
[`& .button${themeClassName}`]: {
|
46
|
-
...classProps,
|
47
|
-
"&:hover": hover
|
48
|
-
},
|
49
|
-
buttonTheme: {
|
50
|
-
borderRadius,
|
51
|
-
lockRadius,
|
52
|
-
bannerSpacing,
|
53
|
-
buttonIcon
|
54
|
-
}
|
55
|
-
};
|
56
|
-
};
|
57
|
-
const transformProps = (elementType, props) => {
|
58
|
-
let transformedProp = {};
|
59
|
-
let otherProps = {};
|
60
|
-
switch (elementType) {
|
61
|
-
case "h1":
|
62
|
-
case "h2":
|
63
|
-
case "h3":
|
64
|
-
case "h4":
|
65
|
-
case "h5":
|
66
|
-
case "h6":
|
67
|
-
transformedProp = transformHeading(props, elementType);
|
68
|
-
break;
|
69
|
-
case "para1":
|
70
|
-
case "para2":
|
71
|
-
case "para3":
|
72
|
-
transformedProp = transformParagraph(props, elementType);
|
73
|
-
break;
|
74
|
-
case "button":
|
75
|
-
const {
|
76
|
-
buttonTheme,
|
77
|
-
...classProps
|
78
|
-
} = transformButton(props, elementType);
|
79
|
-
transformedProp = classProps;
|
80
|
-
otherProps = {
|
81
|
-
buttonTheme
|
82
|
-
};
|
83
|
-
break;
|
84
|
-
default:
|
85
|
-
}
|
86
|
-
return {
|
87
|
-
transformedProp,
|
88
|
-
otherProps
|
89
|
-
};
|
90
|
-
};
|
91
|
-
export const transformTheme = (selectedTheme = {}) => {
|
92
|
-
let sxProps = {};
|
93
|
-
let others = {};
|
94
|
-
const {
|
95
|
-
elementProps
|
96
|
-
} = selectedTheme;
|
97
|
-
if (elementProps) {
|
98
|
-
Object.entries(elementProps).forEach(([key, value]) => {
|
99
|
-
const {
|
100
|
-
transformedProp,
|
101
|
-
otherProps
|
102
|
-
} = transformProps(key, value);
|
103
|
-
sxProps = {
|
104
|
-
...sxProps,
|
105
|
-
...transformedProp
|
106
|
-
};
|
107
|
-
others = {
|
108
|
-
...others,
|
109
|
-
...otherProps
|
110
|
-
};
|
111
|
-
});
|
112
|
-
}
|
113
|
-
return {
|
114
|
-
sxProps,
|
115
|
-
...others
|
116
|
-
};
|
117
|
-
};
|
118
|
-
export const defaultTheme = {
|
119
|
-
theme: {
|
120
|
-
cssVars: {},
|
121
|
-
elementProps: {
|
122
|
-
button: {
|
123
|
-
color: "#FFFFFF",
|
124
|
-
background: "#2563EB",
|
125
|
-
fontFamily: "PoppinsRegular",
|
126
|
-
fontWeight: 400,
|
127
|
-
fontSize: "inherit",
|
128
|
-
borderColor: "transparent",
|
129
|
-
borderRadius: {
|
130
|
-
topLeft: 30,
|
131
|
-
topRight: 30,
|
132
|
-
bottomLeft: 30,
|
133
|
-
bottomRight: 30
|
134
|
-
},
|
135
|
-
bannerSpacing: {
|
136
|
-
left: 16,
|
137
|
-
top: 8,
|
138
|
-
right: 16,
|
139
|
-
bottom: 8
|
140
|
-
}
|
141
|
-
}
|
142
|
-
}
|
143
|
-
}
|
144
|
-
};
|
145
|
-
export function getTheme(selectedTheme) {
|
146
|
-
return transformTheme(selectedTheme?.theme || defaultTheme.theme);
|
147
|
-
}
|
@@ -1,72 +0,0 @@
|
|
1
|
-
import { Grid, Link, Typography } from "@mui/material";
|
2
|
-
import { useEditorTheme } from "../hooks/useEditorTheme";
|
3
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
4
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
5
|
-
import { Fragment as _Fragment } from "react/jsx-runtime";
|
6
|
-
function ActiveTheme(props) {
|
7
|
-
const {
|
8
|
-
onExplore
|
9
|
-
} = props;
|
10
|
-
const {
|
11
|
-
theme
|
12
|
-
} = useEditorTheme();
|
13
|
-
const {
|
14
|
-
colors = {}
|
15
|
-
} = theme?.theme?.cssVars || {};
|
16
|
-
const {
|
17
|
-
id,
|
18
|
-
name,
|
19
|
-
mood_name = ""
|
20
|
-
} = theme || {};
|
21
|
-
const themeColors = Object.values(colors || {});
|
22
|
-
return /*#__PURE__*/_jsxs(Grid, {
|
23
|
-
className: "activeThemeInnner",
|
24
|
-
children: [/*#__PURE__*/_jsx(Typography, {
|
25
|
-
variant: "body1",
|
26
|
-
className: "title activeThemeTitle",
|
27
|
-
children: id ? "Active Theme" : "No theme activated"
|
28
|
-
}), /*#__PURE__*/_jsxs(Grid, {
|
29
|
-
className: "flexAlign",
|
30
|
-
children: [/*#__PURE__*/_jsx(Typography, {
|
31
|
-
variant: "body1",
|
32
|
-
className: "fs-14",
|
33
|
-
children: name
|
34
|
-
}), /*#__PURE__*/_jsxs(Typography, {
|
35
|
-
variant: "body2",
|
36
|
-
className: "fs-12 textSecondary",
|
37
|
-
style: {
|
38
|
-
marginLeft: id ? "4px" : "0px"
|
39
|
-
},
|
40
|
-
children: [id ? ` - ` : null, id ? mood_name : "Select 'Explore More' to activate a theme and customize your design."]
|
41
|
-
})]
|
42
|
-
}), /*#__PURE__*/_jsxs(Grid, {
|
43
|
-
container: true,
|
44
|
-
justifyContent: "space-between",
|
45
|
-
alignItems: "end",
|
46
|
-
sx: {
|
47
|
-
mt: 1
|
48
|
-
},
|
49
|
-
children: [/*#__PURE__*/_jsx(Grid, {
|
50
|
-
className: "flexAlign",
|
51
|
-
sx: {
|
52
|
-
gap: "10px"
|
53
|
-
},
|
54
|
-
children: id ? /*#__PURE__*/_jsx(_Fragment, {
|
55
|
-
children: themeColors?.map((color, i) => {
|
56
|
-
return /*#__PURE__*/_jsx(Grid, {
|
57
|
-
className: "activeColorBox",
|
58
|
-
style: {
|
59
|
-
background: color
|
60
|
-
}
|
61
|
-
}, i);
|
62
|
-
})
|
63
|
-
}) : null
|
64
|
-
}), onExplore && /*#__PURE__*/_jsx(Link, {
|
65
|
-
className: "pointer fs-12 fw-500",
|
66
|
-
onClick: onExplore,
|
67
|
-
children: "Explore More"
|
68
|
-
})]
|
69
|
-
})]
|
70
|
-
});
|
71
|
-
}
|
72
|
-
export default ActiveTheme;
|
@@ -1,285 +0,0 @@
|
|
1
|
-
import React, { useRef, useState } from "react";
|
2
|
-
import { Accordion, AccordionDetails, AccordionSummary, Button, Fade, Grid, IconButton, Popper, Typography, styled } from "@mui/material";
|
3
|
-
import ExpandMoreIcon from "@mui/icons-material/ExpandMore";
|
4
|
-
|
5
|
-
// Style
|
6
|
-
import Style from "./style";
|
7
|
-
import { PenIcon } from "../icons";
|
8
|
-
import StyleBuilder from "../../common/StyleBuilder";
|
9
|
-
import { fontOptions } from "../../utils/font";
|
10
|
-
import { useEditorTheme } from "../../hooks/useEditorTheme";
|
11
|
-
import { getBreakPointsValue, getElementProperty, getTRBLBreakPoints } from "../../helper/theme";
|
12
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
13
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
14
|
-
const buttonStyle = [{
|
15
|
-
tab: "General",
|
16
|
-
value: "size",
|
17
|
-
fields: [{
|
18
|
-
label: "Font Family",
|
19
|
-
key: "fontFamily",
|
20
|
-
type: "textOptions",
|
21
|
-
options: fontOptions,
|
22
|
-
webFont: true,
|
23
|
-
width: 7,
|
24
|
-
renderOption: option => {
|
25
|
-
return /*#__PURE__*/_jsx("span", {
|
26
|
-
style: {
|
27
|
-
fontFamily: option.value
|
28
|
-
},
|
29
|
-
children: option.text
|
30
|
-
});
|
31
|
-
}
|
32
|
-
}, {
|
33
|
-
label: "Font Size",
|
34
|
-
key: "textSize",
|
35
|
-
type: "fontSize",
|
36
|
-
width: 5,
|
37
|
-
placeholder: "16px or 1em"
|
38
|
-
}]
|
39
|
-
}, {
|
40
|
-
tab: "Colors",
|
41
|
-
value: "colors",
|
42
|
-
fields: [{
|
43
|
-
label: "Text Color",
|
44
|
-
key: "textColor",
|
45
|
-
type: "color",
|
46
|
-
needPreview: true
|
47
|
-
}, {
|
48
|
-
label: "Button Color",
|
49
|
-
key: "bgColor",
|
50
|
-
type: "color",
|
51
|
-
themeEnabled: true
|
52
|
-
}]
|
53
|
-
}, {
|
54
|
-
tab: "Banner Spacing",
|
55
|
-
value: "bannerSpacing",
|
56
|
-
fields: [{
|
57
|
-
label: "Banner Spacing",
|
58
|
-
key: "bannerSpacing",
|
59
|
-
type: "bannerSpacing"
|
60
|
-
}]
|
61
|
-
}, {
|
62
|
-
tab: "Border",
|
63
|
-
value: "border",
|
64
|
-
fields: [{
|
65
|
-
label: "Border Radius",
|
66
|
-
key: "borderRadius",
|
67
|
-
type: "borderRadius"
|
68
|
-
}]
|
69
|
-
}, {
|
70
|
-
tab: "Hover Colors",
|
71
|
-
value: "hoverColors",
|
72
|
-
fields: [{
|
73
|
-
label: "Hover Text Color",
|
74
|
-
key: "textColorHover",
|
75
|
-
type: "color",
|
76
|
-
needPreview: true
|
77
|
-
}, {
|
78
|
-
label: "Hover Button Color",
|
79
|
-
key: "bgColorHover",
|
80
|
-
type: "color"
|
81
|
-
}]
|
82
|
-
}];
|
83
|
-
function getBtnSxProps(buttonStyle = {}) {
|
84
|
-
const newStyle = {
|
85
|
-
...buttonStyle
|
86
|
-
};
|
87
|
-
if (newStyle?.bannerSpacing) {
|
88
|
-
newStyle.padding = newStyle?.bannerSpacing;
|
89
|
-
}
|
90
|
-
newStyle.borderRadius = {
|
91
|
-
...getBreakPointsValue(newStyle?.borderRadius || {}, null, "overrideBorderRadius", true)
|
92
|
-
};
|
93
|
-
newStyle.padding = {
|
94
|
-
...getTRBLBreakPoints(newStyle?.bannerSpacing || {})
|
95
|
-
};
|
96
|
-
delete newStyle?.bannerSpacing;
|
97
|
-
if (newStyle?.hover) {
|
98
|
-
newStyle["&:hover"] = newStyle.hover;
|
99
|
-
delete newStyle.hover;
|
100
|
-
}
|
101
|
-
return newStyle;
|
102
|
-
}
|
103
|
-
const MAP_HOVER_KEYS = {
|
104
|
-
color: "textColorHover",
|
105
|
-
background: "bgColorHover"
|
106
|
-
};
|
107
|
-
const MAP_THEME_TO_ELEMENT_KEYS = {
|
108
|
-
color: "textColor",
|
109
|
-
background: "bgColor",
|
110
|
-
fontFamily: (value, prev, buttonEl) => {
|
111
|
-
if (!buttonEl?.current) {
|
112
|
-
return prev;
|
113
|
-
}
|
114
|
-
const val = getElementProperty(buttonEl?.current, "font-family");
|
115
|
-
return {
|
116
|
-
...prev,
|
117
|
-
fontFamily: val
|
118
|
-
};
|
119
|
-
},
|
120
|
-
fontSize: "textSize",
|
121
|
-
borderRadius: "borderRadius",
|
122
|
-
bannerSpacing: "bannerSpacing",
|
123
|
-
lockRadius: "lockRadius",
|
124
|
-
lockbannerSpacing: "lockbannerSpacing",
|
125
|
-
// fontWeight
|
126
|
-
|
127
|
-
hover: (value = {}, prev = {}) => {
|
128
|
-
const props = getProps(value, MAP_HOVER_KEYS);
|
129
|
-
return {
|
130
|
-
...prev,
|
131
|
-
...props
|
132
|
-
};
|
133
|
-
}
|
134
|
-
};
|
135
|
-
const MAP_ELEMENT_TO_THEME_KEYS = {
|
136
|
-
textSize: "fontSize",
|
137
|
-
textColor: "color",
|
138
|
-
bgColor: "background",
|
139
|
-
bannerSpacing: "bannerSpacing",
|
140
|
-
borderRadius: "borderRadius",
|
141
|
-
lockRadius: "lockRadius",
|
142
|
-
lockbannerSpacing: "lockbannerSpacing",
|
143
|
-
textColorHover: (value, prev) => {
|
144
|
-
const hover = {
|
145
|
-
...(prev?.hover || {})
|
146
|
-
};
|
147
|
-
hover.color = value;
|
148
|
-
return {
|
149
|
-
...prev,
|
150
|
-
hover
|
151
|
-
};
|
152
|
-
},
|
153
|
-
bgColorHover: (value, prev) => {
|
154
|
-
const hover = {
|
155
|
-
...(prev?.hover || {})
|
156
|
-
};
|
157
|
-
hover.background = value;
|
158
|
-
return {
|
159
|
-
...prev,
|
160
|
-
hover
|
161
|
-
};
|
162
|
-
},
|
163
|
-
fontFamily: "fontFamily"
|
164
|
-
};
|
165
|
-
function getProps(buttonStyle, MAP_KEYS, buttonEl) {
|
166
|
-
let props = {};
|
167
|
-
Object.entries(buttonStyle).forEach(([key, value]) => {
|
168
|
-
const elementKey = MAP_KEYS[key];
|
169
|
-
if (elementKey) {
|
170
|
-
if (typeof elementKey === "string") {
|
171
|
-
props[elementKey] = value;
|
172
|
-
} else {
|
173
|
-
props = elementKey(value, props, buttonEl);
|
174
|
-
}
|
175
|
-
}
|
176
|
-
});
|
177
|
-
return props;
|
178
|
-
}
|
179
|
-
function convertThemeToElementProps(button = {}, buttonEl) {
|
180
|
-
const props = getProps(button, MAP_THEME_TO_ELEMENT_KEYS, buttonEl);
|
181
|
-
return props;
|
182
|
-
}
|
183
|
-
|
184
|
-
// icons
|
185
|
-
|
186
|
-
const Buttons = props => {
|
187
|
-
const {
|
188
|
-
className,
|
189
|
-
customProps
|
190
|
-
} = props;
|
191
|
-
const [anchorEl, setAnchorEl] = useState();
|
192
|
-
const {
|
193
|
-
selectedTheme,
|
194
|
-
updateTheme
|
195
|
-
} = useEditorTheme();
|
196
|
-
const {
|
197
|
-
button
|
198
|
-
} = selectedTheme?.elementProps || {};
|
199
|
-
const buttonEl = useRef();
|
200
|
-
const elementProps = convertThemeToElementProps(button, buttonEl);
|
201
|
-
|
202
|
-
// State
|
203
|
-
return /*#__PURE__*/_jsxs(Grid, {
|
204
|
-
className: className,
|
205
|
-
children: [/*#__PURE__*/_jsxs(Accordion, {
|
206
|
-
className: "settingAccordion",
|
207
|
-
children: [/*#__PURE__*/_jsx(AccordionSummary, {
|
208
|
-
expandIcon: /*#__PURE__*/_jsx(ExpandMoreIcon, {}),
|
209
|
-
"aria-controls": "panel1-content",
|
210
|
-
id: "panel1-header",
|
211
|
-
children: "Buttons"
|
212
|
-
}), /*#__PURE__*/_jsx(AccordionDetails, {
|
213
|
-
children: /*#__PURE__*/_jsxs(Grid, {
|
214
|
-
container: true,
|
215
|
-
className: "buttonTypeItem",
|
216
|
-
justifyContent: "space-between",
|
217
|
-
alignItems: "center",
|
218
|
-
wrap: "nowrap",
|
219
|
-
onClick: e => setAnchorEl(e.currentTarget),
|
220
|
-
children: [/*#__PURE__*/_jsxs(Grid, {
|
221
|
-
item: true,
|
222
|
-
style: {
|
223
|
-
maxWidth: "calc(100% - 50px)",
|
224
|
-
overflowX: "auto"
|
225
|
-
},
|
226
|
-
children: [/*#__PURE__*/_jsx(Typography, {
|
227
|
-
variant: "body1",
|
228
|
-
className: "fw-600 fs-14",
|
229
|
-
style: {
|
230
|
-
marginBottom: "10px"
|
231
|
-
},
|
232
|
-
children: "Primary Button"
|
233
|
-
}), /*#__PURE__*/_jsx(Button, {
|
234
|
-
sx: getBtnSxProps(button),
|
235
|
-
ref: buttonEl,
|
236
|
-
children: "Button"
|
237
|
-
})]
|
238
|
-
}), /*#__PURE__*/_jsx(IconButton, {
|
239
|
-
className: "editIcon",
|
240
|
-
children: /*#__PURE__*/_jsx(PenIcon, {})
|
241
|
-
})]
|
242
|
-
})
|
243
|
-
})]
|
244
|
-
}), /*#__PURE__*/_jsx(Popper, {
|
245
|
-
open: Boolean(anchorEl),
|
246
|
-
anchorEl: anchorEl,
|
247
|
-
transition: true,
|
248
|
-
sx: {
|
249
|
-
zIndex: "100000",
|
250
|
-
background: "white"
|
251
|
-
},
|
252
|
-
placement: "left-start",
|
253
|
-
children: ({
|
254
|
-
TransitionProps
|
255
|
-
}) => /*#__PURE__*/_jsx(Fade, {
|
256
|
-
...TransitionProps,
|
257
|
-
timeout: 350,
|
258
|
-
children: /*#__PURE__*/_jsx("div", {
|
259
|
-
children: /*#__PURE__*/_jsx(StyleBuilder, {
|
260
|
-
title: "Button",
|
261
|
-
type: "buttonStyle",
|
262
|
-
element: elementProps,
|
263
|
-
onSave: data => {
|
264
|
-
const props = getProps(data, MAP_ELEMENT_TO_THEME_KEYS);
|
265
|
-
updateTheme(props, {
|
266
|
-
action: "ELEMENT_PROPS_CHANGE",
|
267
|
-
fieldName: "button"
|
268
|
-
});
|
269
|
-
setAnchorEl(null);
|
270
|
-
},
|
271
|
-
onClose: () => {
|
272
|
-
setAnchorEl(null);
|
273
|
-
},
|
274
|
-
renderTabs: buttonStyle,
|
275
|
-
customProps: {
|
276
|
-
disableEditTheme: true,
|
277
|
-
translation: customProps?.translation || (() => {})
|
278
|
-
}
|
279
|
-
})
|
280
|
-
})
|
281
|
-
})
|
282
|
-
})]
|
283
|
-
});
|
284
|
-
};
|
285
|
-
export default styled(Buttons)(Style);
|