@flozy/editor 4.9.7 → 4.9.9
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/Editor/Editor.css +0 -1
- package/dist/Editor/Elements/Embed/Video.js +9 -2
- package/dist/Editor/Elements/Grid/GridItem.js +22 -25
- package/dist/Editor/Elements/Grid/Providers/GridProvider.js +15 -3
- package/dist/Editor/Elements/Grid/Styles.js +27 -1
- package/dist/Editor/Elements/Search/SearchList.js +1 -20
- package/dist/Editor/Elements/Table/Table.js +12 -3
- package/dist/Editor/common/Section/index.js +11 -18
- package/dist/Editor/common/StyleBuilder/tableStyle.js +52 -99
- package/dist/Editor/common/iconslist.js +2 -0
- package/dist/Editor/hooks/useTable.js +8 -4
- package/dist/Editor/utils/helper.js +5 -1
- package/package.json +1 -1
package/dist/Editor/Editor.css
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import React, { useState, useEffect } from "react";
|
1
|
+
import React, { useState, useEffect, useRef } from "react";
|
2
2
|
import { useSlateStatic, ReactEditor } from "slate-react";
|
3
3
|
import { Node, Transforms } from "slate";
|
4
4
|
import { IconButton, Tooltip, Box, useTheme } from "@mui/material";
|
@@ -24,6 +24,13 @@ const VideoContent = props => {
|
|
24
24
|
alt,
|
25
25
|
videoSX
|
26
26
|
} = props;
|
27
|
+
const iframeRef = useRef(null);
|
28
|
+
useEffect(() => {
|
29
|
+
if (iframeRef.current) {
|
30
|
+
iframeRef.current.src = "about:blank"; // reloading the iframe
|
31
|
+
iframeRef.current.src = embedURL;
|
32
|
+
}
|
33
|
+
}, [embedURL, iframeRef.current]);
|
27
34
|
return resizing ? /*#__PURE__*/_jsx("div", {
|
28
35
|
style: {
|
29
36
|
width: "100%",
|
@@ -37,6 +44,7 @@ const VideoContent = props => {
|
|
37
44
|
icon: "videoPlayer"
|
38
45
|
})
|
39
46
|
}) : /*#__PURE__*/_jsx(Box, {
|
47
|
+
ref: iframeRef,
|
40
48
|
component: "iframe",
|
41
49
|
className: "embedd-iframe",
|
42
50
|
sx: {
|
@@ -52,7 +60,6 @@ const VideoContent = props => {
|
|
52
60
|
background: bgColor || "transparent",
|
53
61
|
...videoSX
|
54
62
|
},
|
55
|
-
src: embedURL,
|
56
63
|
title: alt,
|
57
64
|
allowFullScreen: true
|
58
65
|
});
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/* eslint-disable no-unused-vars */
|
2
2
|
import React, { useEffect, useState, useRef } from "react";
|
3
|
-
import { Button, Dialog, DialogActions, DialogContent, useTheme } from "@mui/material";
|
3
|
+
import { Button, Dialog, DialogActions, DialogContent, useTheme, Popper } from "@mui/material";
|
4
4
|
import { Node, Path, Transforms } from "slate";
|
5
5
|
import { useSlateStatic, ReactEditor } from "slate-react";
|
6
6
|
import GridItemPopup from "./GridItemPopup";
|
@@ -13,7 +13,7 @@ import { isEmptyNode } from "../../utils/helper";
|
|
13
13
|
import { onAddGridItem } from "../../utils/gridItem";
|
14
14
|
import useTableResize from "../../utils/customHooks/useTableResize";
|
15
15
|
import GridStyles from "./Styles";
|
16
|
-
import { useGrid } from "./Providers/GridProvider";
|
16
|
+
import { useGrid, getChildCount } from "./Providers/GridProvider";
|
17
17
|
import { jsx as _jsx } from "react/jsx-runtime";
|
18
18
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
19
19
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
@@ -37,27 +37,23 @@ const Resizer = ({
|
|
37
37
|
};
|
38
38
|
const GridItemToolbar = props => {
|
39
39
|
const {
|
40
|
+
classes,
|
40
41
|
selected,
|
41
42
|
showTool,
|
42
43
|
onSettings,
|
43
|
-
onAddColumn
|
44
|
+
onAddColumn,
|
45
|
+
columnRef
|
44
46
|
} = props;
|
45
|
-
return selected && !showTool ? /*#__PURE__*/_jsxs(
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
display: "flex",
|
52
|
-
flexDirection: "row"
|
53
|
-
},
|
47
|
+
return selected && !showTool ? /*#__PURE__*/_jsxs(Popper, {
|
48
|
+
anchorEl: columnRef?.current,
|
49
|
+
open: true,
|
50
|
+
placement: "top-end",
|
51
|
+
sx: classes.popTools,
|
52
|
+
className: "gi-tool-pp",
|
54
53
|
children: [/*#__PURE__*/_jsx(Tooltip, {
|
55
54
|
title: "Column Settings",
|
56
55
|
arrow: true,
|
57
56
|
children: /*#__PURE__*/_jsx(IconButton, {
|
58
|
-
sx: {
|
59
|
-
marginRight: "4px"
|
60
|
-
},
|
61
57
|
size: "small",
|
62
58
|
onClick: onSettings,
|
63
59
|
children: /*#__PURE__*/_jsx(GridSettingsIcon, {})
|
@@ -66,9 +62,6 @@ const GridItemToolbar = props => {
|
|
66
62
|
title: "Add Column",
|
67
63
|
arrow: true,
|
68
64
|
children: /*#__PURE__*/_jsx(IconButton, {
|
69
|
-
sx: {
|
70
|
-
marginRight: "4px"
|
71
|
-
},
|
72
65
|
size: "small",
|
73
66
|
onClick: onAddColumn,
|
74
67
|
children: /*#__PURE__*/_jsx(AddIcon, {})
|
@@ -84,9 +77,13 @@ const GridItem = props => {
|
|
84
77
|
updateColumnWidth,
|
85
78
|
updateColNodes
|
86
79
|
} = useGrid() || {};
|
80
|
+
const {
|
81
|
+
hoverPath,
|
82
|
+
theme: appTheme
|
83
|
+
} = useEditorContext();
|
87
84
|
const columnRef = useRef(null);
|
88
85
|
const theme = useTheme();
|
89
|
-
const classes = GridStyles(theme);
|
86
|
+
const classes = GridStyles(theme, appTheme);
|
90
87
|
const {
|
91
88
|
attributes,
|
92
89
|
children,
|
@@ -123,13 +120,11 @@ const GridItem = props => {
|
|
123
120
|
} = alignment || {};
|
124
121
|
const editor = useSlateStatic();
|
125
122
|
const path = ReactEditor.findPath(editor, element);
|
126
|
-
const {
|
127
|
-
hoverPath
|
128
|
-
} = useEditorContext();
|
129
123
|
const selected = hoverPath === path.join(",");
|
130
124
|
const [showTool] = useEditorSelection(editor);
|
131
125
|
const [parentDOM, setParentDOM] = useState({});
|
132
126
|
const [alert, setAlert] = useState(null);
|
127
|
+
const childCount = getChildCount(editor, path);
|
133
128
|
const [size, onMouseDown, resizing, onLoad, isDone] = useTableResize({
|
134
129
|
...parentDOM
|
135
130
|
});
|
@@ -146,7 +141,7 @@ const GridItem = props => {
|
|
146
141
|
} catch (err) {
|
147
142
|
console.log(err);
|
148
143
|
}
|
149
|
-
}, [columnRef?.current, minWidth]);
|
144
|
+
}, [columnRef?.current, minWidth, childCount]);
|
150
145
|
useEffect(() => {
|
151
146
|
if (isDone || isRightCol) {
|
152
147
|
initDoms();
|
@@ -164,7 +159,7 @@ const GridItem = props => {
|
|
164
159
|
if (resizing) {
|
165
160
|
updateColumnWidth({
|
166
161
|
left: size?.width / parentDOM?.gridWidth * 100
|
167
|
-
});
|
162
|
+
}, path);
|
168
163
|
}
|
169
164
|
}, [resizing, size]);
|
170
165
|
const initDoms = () => {
|
@@ -307,10 +302,12 @@ const GridItem = props => {
|
|
307
302
|
className: "element-selector-dots br",
|
308
303
|
children: " "
|
309
304
|
}), /*#__PURE__*/_jsx(GridItemToolbar, {
|
305
|
+
classes: classes,
|
310
306
|
selected: selected,
|
311
307
|
showTool: showTool,
|
312
308
|
onSettings: onSettings,
|
313
|
-
onAddColumn: onAddColumn
|
309
|
+
onAddColumn: onAddColumn,
|
310
|
+
columnRef: columnRef
|
314
311
|
})]
|
315
312
|
}), /*#__PURE__*/_jsx(Box, {
|
316
313
|
ref: columnRef,
|
@@ -24,12 +24,24 @@ const getAdjacentColumnPath = (editor, currentPath, direction = "next") => {
|
|
24
24
|
}; // Return the adjacent column's path
|
25
25
|
};
|
26
26
|
|
27
|
-
const isSingleColumn = (editor,
|
27
|
+
const isSingleColumn = (editor, currentPath) => {
|
28
28
|
try {
|
29
|
+
const parentPath = Path.parent(currentPath); // Get the parent grid path
|
29
30
|
const gridNode = Node.get(editor, parentPath);
|
30
31
|
return gridNode?.children?.length === 1;
|
31
32
|
} catch (err) {
|
32
33
|
console.log(err);
|
34
|
+
return false;
|
35
|
+
}
|
36
|
+
};
|
37
|
+
export const getChildCount = (editor, currentPath) => {
|
38
|
+
try {
|
39
|
+
const parentPath = Path.parent(currentPath); // Get the parent grid path
|
40
|
+
const gridNode = Node.get(editor, parentPath);
|
41
|
+
return gridNode?.children?.length;
|
42
|
+
} catch (err) {
|
43
|
+
console.log(err);
|
44
|
+
return 0;
|
33
45
|
}
|
34
46
|
};
|
35
47
|
export const GridProvider = ({
|
@@ -69,11 +81,11 @@ export const GridProvider = ({
|
|
69
81
|
*
|
70
82
|
* @param {*} data - contains {left: calculatedWidth}
|
71
83
|
*/
|
72
|
-
const updateColumnWidth = data => {
|
84
|
+
const updateColumnWidth = (data, currentColPath) => {
|
73
85
|
// logic to update right column width
|
74
86
|
const right = columnWidths?.right - (data?.left - columnWidths?.left);
|
75
87
|
const diff = right !== widths?.right;
|
76
|
-
if (isSingleColumn(editor,
|
88
|
+
if (isSingleColumn(editor, currentColPath) && data?.left <= 100) {
|
77
89
|
setWidths({
|
78
90
|
...data,
|
79
91
|
right: right
|
@@ -1,4 +1,4 @@
|
|
1
|
-
const GridStyles = theme => ({
|
1
|
+
const GridStyles = (theme, appTheme) => ({
|
2
2
|
gridButton: {
|
3
3
|
background: "#007FFF",
|
4
4
|
color: "#fff",
|
@@ -86,6 +86,32 @@ const GridStyles = theme => ({
|
|
86
86
|
}
|
87
87
|
}
|
88
88
|
}
|
89
|
+
},
|
90
|
+
popTools: {
|
91
|
+
zIndex: 1000,
|
92
|
+
"& button": {
|
93
|
+
borderRadius: "8px",
|
94
|
+
marginRight: "4px",
|
95
|
+
border: "1px solid rgba(37, 99, 235, 0.32)",
|
96
|
+
boxShadow: "0px 0px 10px 0px rgba(0, 0, 0, 0.16)",
|
97
|
+
background: appTheme?.palette?.editor?.background,
|
98
|
+
color: "#64748B",
|
99
|
+
"& svg": {
|
100
|
+
width: "16px",
|
101
|
+
height: "16px",
|
102
|
+
"& .fillStroke": {
|
103
|
+
stroke: "#64748B"
|
104
|
+
}
|
105
|
+
},
|
106
|
+
"&:hover": {
|
107
|
+
background: appTheme?.palette?.editor?.background,
|
108
|
+
border: "1px solid #2684ff",
|
109
|
+
color: "#2684ff",
|
110
|
+
"& .fillStroke": {
|
111
|
+
stroke: "#2684ff"
|
112
|
+
}
|
113
|
+
}
|
114
|
+
}
|
89
115
|
}
|
90
116
|
});
|
91
117
|
export default GridStyles;
|
@@ -113,26 +113,7 @@ const SearchAndDocList = ({
|
|
113
113
|
overflowY: 'auto',
|
114
114
|
overflowX: 'hidden',
|
115
115
|
padding: '0px 16px 8px',
|
116
|
-
marginBottom: '20px'
|
117
|
-
scrollbarWidth: "thin",
|
118
|
-
scrollbarColor: `${theme?.palette?.primary?.slashBrainBorder} transparent`,
|
119
|
-
"&::-webkit-scrollbar": {
|
120
|
-
width: "3px",
|
121
|
-
height: "3px !important",
|
122
|
-
borderRadius: "10px"
|
123
|
-
},
|
124
|
-
"&::-webkit-scrollbar-thumb": {
|
125
|
-
backgroundColor: theme?.palette?.primary?.slashBrainBorder,
|
126
|
-
borderRadius: "10px",
|
127
|
-
width: "3px !important"
|
128
|
-
},
|
129
|
-
"&::-webkit-scrollbar-thumb:hover": {
|
130
|
-
backgroundColor: theme?.palette?.primary?.slashBrainBorder
|
131
|
-
},
|
132
|
-
"&::-webkit-scrollbar-track": {
|
133
|
-
background: "transparent",
|
134
|
-
borderRadius: "10px"
|
135
|
-
}
|
116
|
+
marginBottom: '20px'
|
136
117
|
},
|
137
118
|
children: [mapData?.map((doc, index) => {
|
138
119
|
const title = doc?.title?.trim() === "" ? 'Untitled' : doc?.title;
|
@@ -78,7 +78,11 @@ const Table = props => {
|
|
78
78
|
const {
|
79
79
|
bgColor,
|
80
80
|
borderColor,
|
81
|
-
xsHidden
|
81
|
+
xsHidden,
|
82
|
+
fontFamily,
|
83
|
+
fontWeight,
|
84
|
+
textSize,
|
85
|
+
textColor
|
82
86
|
} = element;
|
83
87
|
const editor = useSlateStatic();
|
84
88
|
const selected = useSelected();
|
@@ -190,7 +194,8 @@ const Table = props => {
|
|
190
194
|
editor: editor,
|
191
195
|
otherProps: {
|
192
196
|
dragRowBtnCls,
|
193
|
-
tablePath: path
|
197
|
+
tablePath: path,
|
198
|
+
openSetttings
|
194
199
|
},
|
195
200
|
children: [/*#__PURE__*/_jsxs("div", {
|
196
201
|
style: {
|
@@ -213,7 +218,11 @@ const Table = props => {
|
|
213
218
|
style: {
|
214
219
|
background: bgColor,
|
215
220
|
border: borderColor ? `1px solid ${borderColor}` : "",
|
216
|
-
width: "auto"
|
221
|
+
width: "auto",
|
222
|
+
fontFamily,
|
223
|
+
fontWeight,
|
224
|
+
fontSize: textSize,
|
225
|
+
color: textColor
|
217
226
|
},
|
218
227
|
ref: tableRef,
|
219
228
|
children: /*#__PURE__*/_jsx(TableBody, {
|
@@ -9,7 +9,7 @@ import { getBreakPointsValue, getTRBLBreakPoints, groupByBreakpoint } from "../.
|
|
9
9
|
import DragHandle from "../DnD/DragHandleButton";
|
10
10
|
import { useEditorSelection } from "../../hooks/useMouseMove";
|
11
11
|
import SectionStyle from "./styles";
|
12
|
-
|
12
|
+
import useWindowResize from "../../hooks/useWindowResize";
|
13
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
14
14
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
15
15
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
@@ -45,11 +45,8 @@ const Section = props => {
|
|
45
45
|
const path = ReactEditor.findPath(editor, element);
|
46
46
|
const anchorEl = useRef(null);
|
47
47
|
const popperEl = useRef(null);
|
48
|
-
|
49
|
-
|
50
|
-
// const isSectionFullWidth =
|
51
|
-
// sectionGridSize && sectionGridSize[size?.device] >= 12;
|
52
|
-
|
48
|
+
const [size] = useWindowResize();
|
49
|
+
const isSectionFullWidth = sectionGridSize && sectionGridSize[size?.device] >= 12;
|
53
50
|
const [isHovering, setIsHovering] = useState(false);
|
54
51
|
const onMouseEnter = () => {
|
55
52
|
setIsHovering(true);
|
@@ -80,9 +77,6 @@ const Section = props => {
|
|
80
77
|
children: /*#__PURE__*/_jsx(Tooltip, {
|
81
78
|
title: "Section Settings",
|
82
79
|
children: /*#__PURE__*/_jsx(IconButton, {
|
83
|
-
sx: {
|
84
|
-
marginBottom: '25px !important'
|
85
|
-
},
|
86
80
|
onClick: onSettings,
|
87
81
|
children: /*#__PURE__*/_jsx(TuneIcon, {})
|
88
82
|
})
|
@@ -155,16 +149,11 @@ const Section = props => {
|
|
155
149
|
className: "ed-section-inner",
|
156
150
|
sx: {
|
157
151
|
position: "relative",
|
158
|
-
...edInnerSp
|
159
|
-
outline: isHovering ? `1px dashed ${theme?.palette?.editor?.inputFieldBorder}` : 'none'
|
160
|
-
// borderRadius: '5px'
|
152
|
+
...edInnerSp
|
161
153
|
},
|
162
|
-
|
163
154
|
ref: anchorEl,
|
164
|
-
children: [isHovering ? /*#__PURE__*/_jsx(Popper, {
|
165
|
-
open: isHovering
|
166
|
-
// open={isHovering && isSectionFullWidth} //commenting for ui demo if okay remove this comment before dev
|
167
|
-
,
|
155
|
+
children: [isHovering && isSectionFullWidth ? /*#__PURE__*/_jsx(Popper, {
|
156
|
+
open: isHovering && isSectionFullWidth,
|
168
157
|
anchorEl: anchorEl?.current,
|
169
158
|
placement: "top-start",
|
170
159
|
sx: {
|
@@ -187,7 +176,11 @@ const Section = props => {
|
|
187
176
|
fromPopper: true
|
188
177
|
})]
|
189
178
|
})
|
190
|
-
}) : /*#__PURE__*/
|
179
|
+
}) : /*#__PURE__*/_jsxs(_Fragment, {
|
180
|
+
children: [!readOnly && !showTool ? /*#__PURE__*/_jsx(DragHandle, {
|
181
|
+
...props
|
182
|
+
}) : null, /*#__PURE__*/_jsx(Toolbar, {})]
|
183
|
+
}), children]
|
191
184
|
}), openSetttings ? /*#__PURE__*/_jsx(SectionPopup, {
|
192
185
|
element: {
|
193
186
|
...element,
|
@@ -1,65 +1,17 @@
|
|
1
1
|
import { toolbarGroups } from "../../Toolbar/toolbarGroups";
|
2
2
|
import { fontOptions } from "../../utils/font";
|
3
|
+
import { capitalizeFirstLetter } from "../../utils/helper";
|
3
4
|
import { jsx as _jsx } from "react/jsx-runtime";
|
4
|
-
const tableStyle = [{
|
5
|
-
tab: "Table",
|
6
|
-
value: "tableSettings",
|
7
|
-
fields: [{
|
8
|
-
label: "Table Background",
|
9
|
-
key: "table.bgColor",
|
10
|
-
type: "color"
|
11
|
-
}, {
|
12
|
-
label: "Cell Border",
|
13
|
-
key: "table.borderColor",
|
14
|
-
type: "color"
|
15
|
-
}]
|
16
|
-
}, {
|
17
|
-
tab: "Row",
|
18
|
-
value: "rowSettings",
|
19
|
-
fields: [{
|
20
|
-
label: "Row Background",
|
21
|
-
key: "row.bgColor",
|
22
|
-
type: "color"
|
23
|
-
}, {
|
24
|
-
label: "Row Border",
|
25
|
-
key: "row.borderColor",
|
26
|
-
type: "color"
|
27
|
-
}]
|
28
|
-
}, {
|
29
|
-
tab: "Column",
|
30
|
-
value: "columnSettings",
|
31
|
-
fields: [{
|
32
|
-
label: "Entire Column Background",
|
33
|
-
key: "col.entireBgColor",
|
34
|
-
type: "color"
|
35
|
-
}, {
|
36
|
-
label: "Selected Cell Background",
|
37
|
-
key: "col.bgColor",
|
38
|
-
type: "color"
|
39
|
-
}, {
|
40
|
-
label: "Selected Cell Border Color",
|
41
|
-
key: "col.borderColor",
|
42
|
-
type: "color"
|
43
|
-
}]
|
44
|
-
}, {
|
45
|
-
tab: "Visibility",
|
46
|
-
value: "visibility",
|
47
|
-
fields: [{
|
48
|
-
label: "Hide on Mobile",
|
49
|
-
key: "table.xsHidden",
|
50
|
-
type: "selectBox",
|
51
|
-
placeholder: "Hide on Mobile"
|
52
|
-
}]
|
53
|
-
}];
|
54
|
-
export default tableStyle;
|
55
5
|
const allTools = toolbarGroups.flat();
|
56
6
|
const fontWeight = allTools.find(f => f.format === "fontWeight");
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
7
|
+
function getKey(prefix, key) {
|
8
|
+
const settingKey = prefix === "col" ? capitalizeFirstLetter(key) : key;
|
9
|
+
return `${prefix}.${settingKey}`;
|
10
|
+
}
|
11
|
+
function getCommonSettings(prefix) {
|
12
|
+
let settings = [{
|
61
13
|
label: "Font Family",
|
62
|
-
key: "
|
14
|
+
key: "fontFamily",
|
63
15
|
type: "textOptions",
|
64
16
|
webFont: true,
|
65
17
|
options: fontOptions,
|
@@ -73,70 +25,71 @@ export const tableRowStyle = [{
|
|
73
25
|
}
|
74
26
|
}, {
|
75
27
|
label: "Font Weight",
|
76
|
-
key: "
|
28
|
+
key: "fontWeight",
|
77
29
|
type: "textOptions",
|
78
30
|
options: fontWeight?.options,
|
79
31
|
width: 7
|
80
32
|
}, {
|
81
33
|
label: "Font Size",
|
82
|
-
key: "
|
34
|
+
key: "textSize",
|
83
35
|
type: "fontSize",
|
84
36
|
width: 5,
|
85
37
|
placeholder: "16px or 1em"
|
86
38
|
}, {
|
87
39
|
label: "Text Color",
|
88
|
-
key: "
|
40
|
+
key: "textColor",
|
89
41
|
type: "color"
|
90
42
|
}, {
|
91
43
|
label: "Background",
|
92
|
-
key: "
|
44
|
+
key: "bgColor",
|
93
45
|
type: "color"
|
94
46
|
}, {
|
95
47
|
label: "Border",
|
96
|
-
key: "
|
48
|
+
key: "borderColor",
|
97
49
|
type: "color"
|
98
|
-
}]
|
99
|
-
|
100
|
-
|
101
|
-
|
50
|
+
}];
|
51
|
+
|
52
|
+
// modify keys based on setting type (prefix)
|
53
|
+
settings = settings.map(s => ({
|
54
|
+
...s,
|
55
|
+
key: getKey(prefix, s.key)
|
56
|
+
}));
|
57
|
+
return settings;
|
58
|
+
}
|
59
|
+
const tableStyle = [{
|
60
|
+
tab: "Table",
|
61
|
+
value: "tableSettings",
|
62
|
+
fields: getCommonSettings("table")
|
63
|
+
}, {
|
64
|
+
tab: "Selected cell",
|
102
65
|
value: "columnSettings",
|
103
66
|
fields: [{
|
104
|
-
label: "
|
105
|
-
key: "col.
|
106
|
-
type: "textOptions",
|
107
|
-
webFont: true,
|
108
|
-
options: fontOptions,
|
109
|
-
renderOption: option => {
|
110
|
-
return /*#__PURE__*/_jsx("span", {
|
111
|
-
style: {
|
112
|
-
fontFamily: option.value
|
113
|
-
},
|
114
|
-
children: option.text
|
115
|
-
});
|
116
|
-
}
|
117
|
-
}, {
|
118
|
-
label: "Font Weight",
|
119
|
-
key: "col.entireFontWeight",
|
120
|
-
type: "textOptions",
|
121
|
-
options: fontWeight?.options,
|
122
|
-
width: 7
|
123
|
-
}, {
|
124
|
-
label: "Font Size",
|
125
|
-
key: "col.entireTextSize",
|
126
|
-
type: "fontSize",
|
127
|
-
width: 5,
|
128
|
-
placeholder: "16px or 1em"
|
129
|
-
}, {
|
130
|
-
label: "Entire Text Color",
|
131
|
-
key: "col.entireTextColor",
|
132
|
-
type: "color"
|
133
|
-
}, {
|
134
|
-
label: "Background",
|
135
|
-
key: "col.entireBgColor",
|
67
|
+
label: "Selected Cell Background",
|
68
|
+
key: "col.bgColor",
|
136
69
|
type: "color"
|
137
70
|
}, {
|
138
|
-
label: "Border",
|
139
|
-
key: "col.
|
71
|
+
label: "Selected Cell Border Color",
|
72
|
+
key: "col.borderColor",
|
140
73
|
type: "color"
|
141
74
|
}]
|
75
|
+
}, {
|
76
|
+
tab: "Visibility",
|
77
|
+
value: "visibility",
|
78
|
+
fields: [{
|
79
|
+
label: "Hide on Mobile",
|
80
|
+
key: "table.xsHidden",
|
81
|
+
type: "selectBox",
|
82
|
+
placeholder: "Hide on Mobile"
|
83
|
+
}]
|
84
|
+
}];
|
85
|
+
export default tableStyle;
|
86
|
+
export const tableRowStyle = [{
|
87
|
+
tab: "Row",
|
88
|
+
value: "rowSettings",
|
89
|
+
fields: getCommonSettings("row")
|
90
|
+
}];
|
91
|
+
export const tableColumnStyle = [{
|
92
|
+
tab: "Column",
|
93
|
+
value: "columnSettings",
|
94
|
+
fields: getCommonSettings("col")
|
142
95
|
}];
|
@@ -1274,6 +1274,7 @@ export const GridSettingsIcon = props => /*#__PURE__*/_jsxs("svg", {
|
|
1274
1274
|
children: [/*#__PURE__*/_jsx("path", {
|
1275
1275
|
d: "M11 13.75C12.5188 13.75 13.75 12.5188 13.75 11C13.75 9.48122 12.5188 8.25 11 8.25C9.48122 8.25 8.25 9.48122 8.25 11C8.25 12.5188 9.48122 13.75 11 13.75Z",
|
1276
1276
|
stroke: "#64748B",
|
1277
|
+
className: "fillStroke",
|
1277
1278
|
strokeWidth: "1.5",
|
1278
1279
|
strokeMiterlimit: "10",
|
1279
1280
|
strokeLinecap: "round",
|
@@ -1281,6 +1282,7 @@ export const GridSettingsIcon = props => /*#__PURE__*/_jsxs("svg", {
|
|
1281
1282
|
}), /*#__PURE__*/_jsx("path", {
|
1282
1283
|
d: "M1.8335 11.8066V10.1933C1.8335 9.23998 2.61266 8.45165 3.57516 8.45165C5.23433 8.45165 5.91266 7.27832 5.0785 5.83915C4.60183 5.01415 4.886 3.94165 5.72016 3.46498L7.306 2.55748C8.03016 2.12665 8.96516 2.38332 9.396 3.10748L9.49683 3.28165C10.3218 4.72082 11.6785 4.72082 12.5127 3.28165L12.6135 3.10748C13.0443 2.38332 13.9793 2.12665 14.7035 2.55748L16.2893 3.46498C17.1235 3.94165 17.4077 5.01415 16.931 5.83915C16.0968 7.27832 16.7752 8.45165 18.4343 8.45165C19.3877 8.45165 20.176 9.23082 20.176 10.1933V11.8066C20.176 12.76 19.3968 13.5483 18.4343 13.5483C16.7752 13.5483 16.0968 14.7216 16.931 16.1608C17.4077 16.995 17.1235 18.0583 16.2893 18.535L14.7035 19.4425C13.9793 19.8733 13.0443 19.6166 12.6135 18.8925L12.5127 18.7183C11.6877 17.2791 10.331 17.2791 9.49683 18.7183L9.396 18.8925C8.96516 19.6166 8.03016 19.8733 7.306 19.4425L5.72016 18.535C4.886 18.0583 4.60183 16.9858 5.0785 16.1608C5.91266 14.7216 5.23433 13.5483 3.57516 13.5483C2.61266 13.5483 1.8335 12.76 1.8335 11.8066Z",
|
1283
1284
|
stroke: "#64748B",
|
1285
|
+
className: "fillStroke",
|
1284
1286
|
strokeWidth: "1.5",
|
1285
1287
|
strokeMiterlimit: "10",
|
1286
1288
|
strokeLinecap: "round",
|
@@ -61,8 +61,11 @@ export function getDefaultTableSelection() {
|
|
61
61
|
export const TableProvider = ({
|
62
62
|
editor,
|
63
63
|
children,
|
64
|
-
otherProps
|
64
|
+
otherProps = {}
|
65
65
|
}) => {
|
66
|
+
const {
|
67
|
+
openSetttings
|
68
|
+
} = otherProps;
|
66
69
|
const [hoverPath, setHoverPath] = useState(null);
|
67
70
|
const [tableSelection, setTableSelection] = useState(getDefaultTableSelection());
|
68
71
|
const [tableResizing, setTableResizing] = useState(null);
|
@@ -148,9 +151,10 @@ export const TableProvider = ({
|
|
148
151
|
};
|
149
152
|
}, [tableSelection, editor, tableSelection]);
|
150
153
|
useEffect(() => {
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
+
if (!openSetttings) {
|
155
|
+
resetAll();
|
156
|
+
}
|
157
|
+
}, [openSetttings]);
|
154
158
|
return /*#__PURE__*/_jsx(TableContext.Provider, {
|
155
159
|
value: values,
|
156
160
|
children: /*#__PURE__*/_jsx(DndContext, {
|
@@ -567,4 +567,8 @@ export const isPageSettings = (event, editor) => {
|
|
567
567
|
isPageSettingsNode = true;
|
568
568
|
return isPageSettingsNode;
|
569
569
|
}
|
570
|
-
};
|
570
|
+
};
|
571
|
+
export function capitalizeFirstLetter(str) {
|
572
|
+
if (!str) return str;
|
573
|
+
return str.charAt(0).toUpperCase() + str.slice(1);
|
574
|
+
}
|