@flozy/editor 10.3.9 → 10.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Editor/CommonEditor.js +2 -3
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/MultiSelectType.js +7 -20
- package/dist/Editor/Elements/DataView/Layouts/Options/AddOptions.js +1 -5
- package/dist/Editor/Elements/DataView/Layouts/Options/EditOption.js +2 -3
- package/dist/Editor/Elements/DataView/Layouts/Options/index.js +0 -11
- package/dist/Editor/Elements/Embed/Image.js +2 -3
- package/dist/Editor/Elements/EmbedScript/Code.js +2 -14
- package/dist/Editor/Elements/EmbedScript/EmbedScriptPopup.js +28 -57
- package/dist/Editor/Elements/Form/Form.js +168 -181
- package/dist/Editor/Elements/Form/FormElements/FormText.js +6 -23
- package/dist/Editor/Elements/Form/FormElements/FormTextArea.js +2 -3
- package/dist/Editor/Elements/Form/FormField.js +4 -10
- package/dist/Editor/Elements/FreeGrid/FreeGrid.js +1 -5
- package/dist/Editor/Elements/FreeGrid/Options/More.js +1 -1
- package/dist/Editor/Elements/FreeGrid/styles.js +7 -61
- package/dist/Editor/Elements/List/CheckList.js +2 -3
- package/dist/Editor/Elements/Search/SearchAttachment.js +9 -40
- package/dist/Editor/Elements/Search/SearchButton.js +8 -9
- package/dist/Editor/Elements/Search/SearchList.js +7 -9
- package/dist/Editor/Elements/SimpleText/index.js +1 -6
- package/dist/Editor/Elements/Table/TableCell.js +3 -7
- package/dist/Editor/Toolbar/PopupTool/TextFormat.js +18 -43
- package/dist/Editor/assets/svg/SettingsIcon.js +0 -1
- package/dist/Editor/common/Icon.js +1 -3
- package/dist/Editor/common/LinkSettings/NavComponents.js +8 -34
- package/dist/Editor/common/LinkSettings/index.js +69 -85
- package/dist/Editor/common/LinkSettings/style.js +30 -245
- package/dist/Editor/common/RnD/ElementOptions/Actions.js +14 -13
- package/dist/Editor/common/RnD/ElementOptions/Icons/LinkIcon.js +0 -1
- package/dist/Editor/common/RnD/ElementOptions/index.js +2 -2
- package/dist/Editor/common/RnD/ElementOptions/styles.js +1 -28
- package/dist/Editor/common/RnD/ElementSettings/OtherSettings/Settings.js +4 -4
- package/dist/Editor/common/RnD/ElementSettings/styles.js +12 -147
- package/dist/Editor/common/RnD/OptionsPopup/index.js +5 -8
- package/dist/Editor/common/RnD/OptionsPopup/style.js +19 -121
- package/dist/Editor/common/RnD/SwitchViewport/SwitchViewport.js +6 -0
- package/dist/Editor/common/Select/index.js +0 -2
- package/dist/Editor/common/Shorthands/elements.js +11 -11
- package/dist/Editor/common/StyleBuilder/fieldTypes/lineSpacing.js +6 -7
- package/dist/Editor/common/StyleBuilder/fieldTypes/menusArray.js +6 -13
- package/dist/Editor/common/StyleBuilder/pageSettingsStyle.js +7 -5
- package/dist/Editor/common/iconListV2.js +6 -101
- package/dist/Editor/common/iconslist.js +0 -3
- package/dist/Editor/commonStyle.js +1 -70
- package/dist/Editor/hooks/useMouseMove.js +5 -2
- package/dist/Editor/utils/SlateUtilityFunctions.js +10 -12
- package/dist/Editor/utils/form.js +4 -4
- package/dist/Editor/utils/formfield.js +2 -8
- package/package.json +1 -1
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/MultiSelect.js +0 -452
- package/dist/Editor/Elements/EmbedScript/styles.js +0 -89
- package/dist/Editor/assets/svg/ClearAllRounded.js +0 -31
- package/dist/Editor/assets/svg/ResetIconNew.js +0 -23
- package/dist/Editor/common/SnackBar/index.js +0 -43
@@ -1,10 +1,5 @@
|
|
1
|
-
import React
|
2
|
-
import Box from "@mui/material
|
3
|
-
import Card from "@mui/material/Card";
|
4
|
-
import CardMedia from "@mui/material/CardMedia";
|
5
|
-
import CardContent from "@mui/material/CardContent";
|
6
|
-
import Typography from "@mui/material/Typography";
|
7
|
-
import Skeleton from "@mui/material/Skeleton";
|
1
|
+
import React from "react";
|
2
|
+
import { Box, Card, CardMedia, CardContent, Typography } from "@mui/material";
|
8
3
|
import Icon from "../../common/Icon";
|
9
4
|
import { useEditorContext } from "../../hooks/useMouseMove";
|
10
5
|
import { jsx as _jsx } from "react/jsx-runtime";
|
@@ -20,26 +15,13 @@ const SearchAttachment = props => {
|
|
20
15
|
metadata
|
21
16
|
} = customProps;
|
22
17
|
const {
|
23
|
-
|
24
|
-
|
18
|
+
title,
|
19
|
+
type
|
25
20
|
} = element;
|
26
21
|
const {
|
27
22
|
theme
|
28
23
|
} = useEditorContext();
|
29
|
-
const [title, setTitle] = useState("");
|
30
|
-
const [showSkeleton, setShowSkeleton] = useState(false);
|
31
24
|
const label = Boolean(title?.trim()) ? title : 'Untitled';
|
32
|
-
useEffect(() => {
|
33
|
-
const fetchTitle = async id => {
|
34
|
-
setShowSkeleton(true);
|
35
|
-
const title = await customProps?.services('getDocTitle', id);
|
36
|
-
setTitle(title?.data);
|
37
|
-
setShowSkeleton(false);
|
38
|
-
};
|
39
|
-
if (id) {
|
40
|
-
fetchTitle(id);
|
41
|
-
}
|
42
|
-
}, []);
|
43
25
|
const handleClick = () => {
|
44
26
|
if (metadata && metadata?.actionHandler) {
|
45
27
|
metadata?.actionHandler(type, element);
|
@@ -56,15 +38,15 @@ const SearchAttachment = props => {
|
|
56
38
|
children: /*#__PURE__*/_jsxs(Card, {
|
57
39
|
sx: {
|
58
40
|
display: "flex",
|
59
|
-
justifyContent:
|
60
|
-
alignItems:
|
41
|
+
justifyContent: "flex-start",
|
42
|
+
alignItems: "flex-end",
|
61
43
|
width: "fit-content",
|
62
44
|
maxWidth: '250px',
|
63
45
|
padding: "0px 10px",
|
64
46
|
boxShadow: "none",
|
65
47
|
border: `1px solid ${theme?.palette?.primary?.slashBrainBorder} !important`,
|
66
48
|
borderRadius: "7px !important",
|
67
|
-
background:
|
49
|
+
background: `${theme?.palette?.containers?.slashBrainCardBg} !important`,
|
68
50
|
cursor: 'pointer',
|
69
51
|
margin: '4px 0px',
|
70
52
|
lineHeight: 1.43,
|
@@ -94,12 +76,7 @@ const SearchAttachment = props => {
|
|
94
76
|
width: "unset !important"
|
95
77
|
}
|
96
78
|
},
|
97
|
-
children:
|
98
|
-
variant: "circular",
|
99
|
-
width: 14,
|
100
|
-
height: 14,
|
101
|
-
animation: "wave"
|
102
|
-
}) : /*#__PURE__*/_jsx(Icon, {
|
79
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
103
80
|
icon: "docsIcon"
|
104
81
|
})
|
105
82
|
}), /*#__PURE__*/_jsx(CardContent, {
|
@@ -117,15 +94,7 @@ const SearchAttachment = props => {
|
|
117
94
|
width: "unset !important"
|
118
95
|
}
|
119
96
|
},
|
120
|
-
children:
|
121
|
-
variant: "text",
|
122
|
-
width: 140,
|
123
|
-
height: 20,
|
124
|
-
animation: "wave",
|
125
|
-
sx: {
|
126
|
-
borderRadius: "4px"
|
127
|
-
}
|
128
|
-
}) : /*#__PURE__*/_jsxs(Typography, {
|
97
|
+
children: /*#__PURE__*/_jsxs(Typography, {
|
129
98
|
sx: {
|
130
99
|
fontWeight: "500",
|
131
100
|
background: theme?.palette?.text?.slashBrainText,
|
@@ -30,7 +30,6 @@ const SearchButton = /*#__PURE__*/forwardRef((props, ref) => {
|
|
30
30
|
const [skip, setSkip] = useState(0);
|
31
31
|
const [search, setSearch] = useState("");
|
32
32
|
const [isLoading, setIsLoading] = useState(false);
|
33
|
-
const [total, setTotal] = useState(0);
|
34
33
|
const [debouncedSearch] = useDebounce(search, 300);
|
35
34
|
const limit = 20;
|
36
35
|
const observer = useRef();
|
@@ -64,24 +63,24 @@ const SearchButton = /*#__PURE__*/forwardRef((props, ref) => {
|
|
64
63
|
}
|
65
64
|
};
|
66
65
|
useEffect(() => {
|
67
|
-
getDocs(
|
66
|
+
getDocs({
|
67
|
+
debouncedSearch,
|
68
|
+
skip,
|
69
|
+
limit,
|
70
|
+
current_doc_id: currentId
|
71
|
+
});
|
68
72
|
}, [skip, debouncedSearch]);
|
69
73
|
const getDocs = async () => {
|
70
|
-
if (isLoading) return;
|
71
|
-
if (total > 0 && mapData?.length >= total) return;
|
72
74
|
setIsLoading(true);
|
73
75
|
try {
|
74
76
|
if (otherProps?.services) {
|
75
77
|
const result = await otherProps?.services("getDocs", {
|
76
78
|
skip,
|
77
79
|
limit,
|
78
|
-
search
|
80
|
+
search,
|
79
81
|
current_doc_id: currentId
|
80
82
|
});
|
81
|
-
|
82
|
-
const totalCount = result?.data?.total || 0;
|
83
|
-
setMapData(prev => skip === 0 ? docs : [...prev, ...docs]);
|
84
|
-
setTotal(totalCount);
|
83
|
+
setMapData(prev => skip === 0 ? result.data : [...prev, ...result.data]);
|
85
84
|
}
|
86
85
|
} catch (error) {
|
87
86
|
console.error("Error fetching documents:", error);
|
@@ -259,7 +259,7 @@ const SearchAndDocList = ({
|
|
259
259
|
xs: 12,
|
260
260
|
children: /*#__PURE__*/_jsx(Typography, {
|
261
261
|
sx: {
|
262
|
-
display: mapData?.length === 0
|
262
|
+
display: mapData?.length === 0 ? 'flex' : 'none',
|
263
263
|
alignItems: "center",
|
264
264
|
justifyContent: "center",
|
265
265
|
color: theme?.palette?.text?.secondary,
|
@@ -269,17 +269,15 @@ const SearchAndDocList = ({
|
|
269
269
|
},
|
270
270
|
children: "No docs"
|
271
271
|
})
|
272
|
-
}), /*#__PURE__*/_jsx(Grid, {
|
272
|
+
}), isLoading && /*#__PURE__*/_jsx(Grid, {
|
273
273
|
item: true,
|
274
|
-
xs: 12,
|
275
274
|
sx: {
|
276
|
-
display:
|
277
|
-
alignItems: "center",
|
275
|
+
display: "flex",
|
278
276
|
justifyContent: "center",
|
279
|
-
|
280
|
-
|
281
|
-
padding: '
|
282
|
-
|
277
|
+
alignItems: 'center',
|
278
|
+
minHeight: '400px',
|
279
|
+
padding: '0px 16px 8px',
|
280
|
+
position: 'absolute'
|
283
281
|
},
|
284
282
|
children: /*#__PURE__*/_jsx(CircularProgress, {})
|
285
283
|
})]
|
@@ -5,7 +5,6 @@ import { Box } from "@mui/material";
|
|
5
5
|
import { isTextSelected } from "../../utils/helper";
|
6
6
|
import { useEditorContext } from "../../hooks/useMouseMove";
|
7
7
|
import SimpleTextStyle from "./style";
|
8
|
-
import { getBreakpointLineSpacing, getDevice } from "../../helper/theme";
|
9
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
10
9
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
11
10
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
@@ -30,12 +29,8 @@ const SimpleText = props => {
|
|
30
29
|
} = customProps;
|
31
30
|
// const { element: pageSt } = getPageSettings(editor) || {};
|
32
31
|
// const { pageColor } = pageSt?.pageProps || {};
|
33
|
-
const breakpoint = getDevice(window.innerWidth);
|
34
|
-
const lineH = element?.children[0]?.lineHeight;
|
35
|
-
const lineHeight = getBreakpointLineSpacing(lineH, breakpoint);
|
36
32
|
const classes = SimpleTextStyle({
|
37
|
-
pageColor: "#FFFFFF"
|
38
|
-
lineHeight
|
33
|
+
pageColor: "#FFFFFF"
|
39
34
|
});
|
40
35
|
const selected = useSelected();
|
41
36
|
const path = ReactEditor.findPath(editor, element);
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import React, { useState, useEffect, useMemo } from "react";
|
2
|
-
import { Editor, Path,
|
2
|
+
import { Editor, Path, Transforms } from "slate";
|
3
3
|
import { Box } from "@mui/material";
|
4
4
|
import { useSlateStatic, ReactEditor } from "slate-react";
|
5
5
|
import useTableResize from "../../utils/customHooks/useTableResize";
|
@@ -132,12 +132,8 @@ const TableCell = props => {
|
|
132
132
|
const isFirstRow = row === 0;
|
133
133
|
const isFirstColumn = column === 0;
|
134
134
|
const [hoverRow, hoverCol] = hoverPath ? hoverPath.slice(-2) : [];
|
135
|
-
const
|
136
|
-
|
137
|
-
} = editor;
|
138
|
-
const isHavingSelection = selection && !Range.isCollapsed(selection);
|
139
|
-
const showColDrag = isFirstRow && hoverCol === column && !resizing && !readOnly && !hideTools.includes("drag") && !isHavingSelection;
|
140
|
-
const showRowDrag = isFirstColumn && hoverRow === row && !resizing && !readOnly && !hideTools.includes("drag") && !isHavingSelection;
|
135
|
+
const showColDrag = isFirstRow && hoverCol === column && !resizing && !readOnly && !hideTools.includes("drag");
|
136
|
+
const showRowDrag = isFirstColumn && hoverRow === row && !resizing && !readOnly && !hideTools.includes("drag");
|
141
137
|
const [parentProps] = tableNode || [{}];
|
142
138
|
const [rowProps] = rowNode || [{}];
|
143
139
|
const tableDOM = table.getDOMNode(path, true);
|
@@ -14,9 +14,8 @@ import SelectSuperSubscript from "./MiniTextFormat/SelectSuperSubscript";
|
|
14
14
|
import { ColorResetIcon, TextDefaultStyleIcon } from "../../common/iconListV2";
|
15
15
|
import FontFamilyAutocomplete from "../FormatTools/FontFamilyAutocomplete";
|
16
16
|
import { useEditorContext } from "../../hooks/useMouseMove";
|
17
|
-
import LineSpacing from "../../common/StyleBuilder/fieldTypes/lineSpacing";
|
18
|
-
import { getPageSettings } from "../../utils/pageSettings";
|
19
|
-
import { getDevice } from "../../helper/theme";
|
17
|
+
// import LineSpacing from "../../common/StyleBuilder/fieldTypes/lineSpacing";
|
18
|
+
// import { getPageSettings } from "../../utils/pageSettings";
|
20
19
|
import { jsx as _jsx } from "react/jsx-runtime";
|
21
20
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
22
21
|
const allTools = toolbarGroups.flat();
|
@@ -37,15 +36,15 @@ const TextFormat = props => {
|
|
37
36
|
const {
|
38
37
|
translation
|
39
38
|
} = customProps;
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
const pageSettingLine = pageSt?.pageProps?.lineHeight;
|
39
|
+
|
40
|
+
// const { element: pageSt } = getPageSettings(editor) || {};
|
41
|
+
// const pageSettingLine = pageSt?.pageProps?.lineHeight;
|
44
42
|
const {
|
45
43
|
fontFamilies,
|
46
44
|
theme
|
47
45
|
} = useEditorContext();
|
48
|
-
const
|
46
|
+
// const { activeBreakPoint } = useEditorContext();
|
47
|
+
// const breakpoint = activeBreakPoint === "" ? "lg" : activeBreakPoint;
|
49
48
|
const fontWeight = allTools.find(f => f.format === "fontWeight");
|
50
49
|
const fontStyle = allTools.filter(f => f.type === "mark" && f.format !== "strikethrough" && f.format !== "superscript" && f.format !== "subscript");
|
51
50
|
const fontAlign = allTools.filter(f => f.format?.indexOf("align") >= 0);
|
@@ -62,8 +61,12 @@ const TextFormat = props => {
|
|
62
61
|
color: "",
|
63
62
|
bgColor: ""
|
64
63
|
};
|
65
|
-
|
66
|
-
|
64
|
+
|
65
|
+
// let lineSpacingValue = activeMark(editor, "lineHeight");
|
66
|
+
// lineSpacingValue =
|
67
|
+
// lineSpacingValue?.[breakpoint] !== undefined
|
68
|
+
// ? lineSpacingValue
|
69
|
+
// : pageSettingLine;
|
67
70
|
const handleColorPicker = type => e => {
|
68
71
|
setType(type);
|
69
72
|
setAnchorEl(e.currentTarget);
|
@@ -104,13 +107,11 @@ const TextFormat = props => {
|
|
104
107
|
value
|
105
108
|
});
|
106
109
|
};
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
});
|
113
|
-
};
|
110
|
+
|
111
|
+
// const handleLineSpacing = (data) => {
|
112
|
+
// const [[format, value]] = Object.entries(data);
|
113
|
+
// addMarkData(editor, { format, value });
|
114
|
+
// };
|
114
115
|
return /*#__PURE__*/_jsxs(Grid, {
|
115
116
|
container: true,
|
116
117
|
sx: classes.textFormatWrapper,
|
@@ -385,32 +386,6 @@ const TextFormat = props => {
|
|
385
386
|
xs: 12,
|
386
387
|
sx: classes.dividerGrid,
|
387
388
|
children: /*#__PURE__*/_jsx(Divider, {})
|
388
|
-
}), /*#__PURE__*/_jsxs(Grid, {
|
389
|
-
item: true,
|
390
|
-
xs: 12,
|
391
|
-
children: [/*#__PURE__*/_jsx(Typography, {
|
392
|
-
variant: "body1",
|
393
|
-
color: "primary",
|
394
|
-
sx: classes.typoLabel,
|
395
|
-
children: "Line Spacing"
|
396
|
-
}), /*#__PURE__*/_jsx(Grid, {
|
397
|
-
item: true,
|
398
|
-
xs: 12,
|
399
|
-
className: "typo-icons",
|
400
|
-
sx: classes.evenSpace,
|
401
|
-
children: /*#__PURE__*/_jsx(LineSpacing, {
|
402
|
-
value: lineSpacingValue,
|
403
|
-
onChange: handleLineSpacing,
|
404
|
-
data: {
|
405
|
-
key: 'lineHeight'
|
406
|
-
}
|
407
|
-
})
|
408
|
-
})]
|
409
|
-
}), /*#__PURE__*/_jsx(Grid, {
|
410
|
-
item: true,
|
411
|
-
xs: 12,
|
412
|
-
sx: classes.dividerGrid,
|
413
|
-
children: /*#__PURE__*/_jsx(Divider, {})
|
414
389
|
}), /*#__PURE__*/_jsx(Grid, {
|
415
390
|
item: true,
|
416
391
|
xs: 12,
|
@@ -7,7 +7,6 @@ const SettingsIcon = props => {
|
|
7
7
|
viewBox: "0 0 18 18",
|
8
8
|
fill: "none",
|
9
9
|
xmlns: "http://www.w3.org/2000/svg",
|
10
|
-
className: "settingsIcon",
|
11
10
|
...props,
|
12
11
|
children: [/*#__PURE__*/_jsx("path", {
|
13
12
|
d: "M9 11.25C10.2426 11.25 11.25 10.2426 11.25 9C11.25 7.75736 10.2426 6.75 9 6.75C7.75736 6.75 6.75 7.75736 6.75 9C6.75 10.2426 7.75736 11.25 9 11.25Z",
|
@@ -45,7 +45,6 @@ import TrashIcon from "../assets/svg/TrashCanIcon";
|
|
45
45
|
import DataTableIcon from "../assets/svg/DataTableIcon";
|
46
46
|
import ChervDown from "../assets/svg/ChervDown";
|
47
47
|
import ChervUp from "../assets/svg/ChervUp";
|
48
|
-
import ResetIconNew from "../assets/svg/ResetIconNew";
|
49
48
|
import { jsx as _jsx } from "react/jsx-runtime";
|
50
49
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
51
50
|
const iconList = {
|
@@ -330,8 +329,7 @@ const iconList = {
|
|
330
329
|
stroke: "#64748B",
|
331
330
|
color: "#64748B"
|
332
331
|
}
|
333
|
-
})
|
334
|
-
resetIconNew: /*#__PURE__*/_jsx(ResetIconNew, {})
|
332
|
+
})
|
335
333
|
};
|
336
334
|
export const icons = {
|
337
335
|
...iconList
|
@@ -1,8 +1,7 @@
|
|
1
|
-
import { Autocomplete, Checkbox, FormControlLabel,
|
1
|
+
import { Autocomplete, Checkbox, FormControlLabel, MenuItem, TextField, Typography, createFilterOptions } from "@mui/material";
|
2
2
|
import { useEffect, useMemo, useState } from "react";
|
3
3
|
import { useSlate } from "slate-react";
|
4
4
|
import Select from "../Select";
|
5
|
-
import { CheckedBoxCheckIcon } from "../iconListV2";
|
6
5
|
import { jsx as _jsx } from "react/jsx-runtime";
|
7
6
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
8
7
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
@@ -32,19 +31,11 @@ const OpenInNewTab = props => {
|
|
32
31
|
className: "ccheckbox-primary",
|
33
32
|
control: /*#__PURE__*/_jsx(Checkbox, {
|
34
33
|
checked: openInNewTab,
|
35
|
-
onChange: onNewTabChange
|
36
|
-
className: "checkBox",
|
37
|
-
checkedIcon: /*#__PURE__*/_jsx(IconButton, {
|
38
|
-
className: "checkedIcon",
|
39
|
-
children: /*#__PURE__*/_jsx(CheckedBoxCheckIcon, {})
|
40
|
-
}),
|
41
|
-
icon: /*#__PURE__*/_jsx(IconButton, {
|
42
|
-
className: "unCheckedIcon"
|
43
|
-
})
|
34
|
+
onChange: onNewTabChange
|
44
35
|
}),
|
45
36
|
label: /*#__PURE__*/_jsx(Typography, {
|
46
37
|
variant: "body2",
|
47
|
-
children: "Open in new tab"
|
38
|
+
children: translation("Open in new tab")
|
48
39
|
})
|
49
40
|
}) : null;
|
50
41
|
};
|
@@ -56,11 +47,6 @@ export const TextInput = props => {
|
|
56
47
|
...props,
|
57
48
|
onChange: e => {
|
58
49
|
props.onChange(e.target.value);
|
59
|
-
},
|
60
|
-
sx: {
|
61
|
-
"&::placeholder": {
|
62
|
-
color: "gray"
|
63
|
-
}
|
64
50
|
}
|
65
51
|
}), /*#__PURE__*/_jsx(OpenInNewTab, {
|
66
52
|
...props
|
@@ -72,8 +58,7 @@ export const SelectPage = props => {
|
|
72
58
|
value,
|
73
59
|
onChange,
|
74
60
|
services,
|
75
|
-
translation
|
76
|
-
classes
|
61
|
+
translation
|
77
62
|
} = props;
|
78
63
|
const [pages, setPages] = useState([]);
|
79
64
|
const editor = useSlate();
|
@@ -131,8 +116,7 @@ export const SelectPage = props => {
|
|
131
116
|
setValue: val => onChange(val?.value || ""),
|
132
117
|
placeholder: translation("Select Page"),
|
133
118
|
options: pages,
|
134
|
-
disabled: isCurrentPage
|
135
|
-
classes: classes
|
119
|
+
disabled: isCurrentPage
|
136
120
|
}), /*#__PURE__*/_jsx(FreeSoloCreateOption, {
|
137
121
|
label: section?.label,
|
138
122
|
setValue: val => {
|
@@ -146,8 +130,7 @@ export const SelectPage = props => {
|
|
146
130
|
options: page?.sections?.map(p => ({
|
147
131
|
label: p,
|
148
132
|
value: p
|
149
|
-
}))
|
150
|
-
classes: classes
|
133
|
+
}))
|
151
134
|
}), isCurrentPage ? null : /*#__PURE__*/_jsx(OpenInNewTab, {
|
152
135
|
...props
|
153
136
|
})]
|
@@ -161,7 +144,6 @@ export const Trigger = props => {
|
|
161
144
|
return /*#__PURE__*/_jsx(Typography, {
|
162
145
|
variant: "subtitle1",
|
163
146
|
gutterBottom: true,
|
164
|
-
className: "trigger-text",
|
165
147
|
children: `${translation("Choosing this will trigger the")} ${translation(nav.type)} ${translation("step")}`
|
166
148
|
});
|
167
149
|
};
|
@@ -213,8 +195,7 @@ export function FreeSoloCreateOption({
|
|
213
195
|
setValue,
|
214
196
|
options = [],
|
215
197
|
placeholder = "",
|
216
|
-
disabled = false
|
217
|
-
classes
|
198
|
+
disabled = false
|
218
199
|
}) {
|
219
200
|
return /*#__PURE__*/_jsx(Autocomplete, {
|
220
201
|
freeSolo: true,
|
@@ -280,13 +261,6 @@ export function FreeSoloCreateOption({
|
|
280
261
|
sx: {
|
281
262
|
marginTop: "10px"
|
282
263
|
},
|
283
|
-
disabled: disabled
|
284
|
-
slotProps: {
|
285
|
-
popper: {
|
286
|
-
sx: {
|
287
|
-
...classes.customAutoComplete
|
288
|
-
}
|
289
|
-
}
|
290
|
-
}
|
264
|
+
disabled: disabled
|
291
265
|
});
|
292
266
|
}
|
@@ -4,8 +4,8 @@ import DialogTitle from "@mui/material/DialogTitle";
|
|
4
4
|
import DialogContent from "@mui/material/DialogContent";
|
5
5
|
import DialogActions from "@mui/material/DialogActions";
|
6
6
|
import IconButton from "@mui/material/IconButton";
|
7
|
-
import
|
8
|
-
import { Box, FormControl, FormControlLabel, Grid, MenuItem, Radio, RadioGroup, Typography
|
7
|
+
import CloseIcon from "@mui/icons-material/Close";
|
8
|
+
import { Box, FormControl, FormControlLabel, Grid, MenuItem, Radio, RadioGroup, Typography } from "@mui/material";
|
9
9
|
import { useState } from "react";
|
10
10
|
import LinkSettingsStyles from "./style";
|
11
11
|
import { getNavOptions } from "./navOptions";
|
@@ -43,10 +43,10 @@ export default function LinkSettings(props) {
|
|
43
43
|
allowTrigger
|
44
44
|
} = props;
|
45
45
|
const {
|
46
|
+
isMobile,
|
46
47
|
tagName,
|
47
48
|
translation
|
48
49
|
} = customProps;
|
49
|
-
const isMobile = useMediaQuery('(max-width: 899px)');
|
50
50
|
const navOptions = getNavOptions(customProps.hideTools, tagName, allowTrigger);
|
51
51
|
const classes = LinkSettingsStyles(theme);
|
52
52
|
const [nav, setNav] = useState(getNav(navType, navOptions));
|
@@ -64,71 +64,67 @@ export default function LinkSettings(props) {
|
|
64
64
|
});
|
65
65
|
};
|
66
66
|
if (isMobile) {
|
67
|
-
return /*#__PURE__*/
|
67
|
+
return /*#__PURE__*/_jsxs(SwipeableDrawer, {
|
68
68
|
open: true,
|
69
69
|
onClose: handleClose,
|
70
|
-
children: /*#__PURE__*/
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
}
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
translation: translation
|
129
|
-
})
|
130
|
-
})]
|
131
|
-
})
|
70
|
+
children: [/*#__PURE__*/_jsx(Typography, {
|
71
|
+
variant: "subtitle1",
|
72
|
+
gutterBottom: true,
|
73
|
+
sx: {
|
74
|
+
fontWeight: 600
|
75
|
+
},
|
76
|
+
children: translation("dialogueTitle")
|
77
|
+
}), /*#__PURE__*/_jsx(Select, {
|
78
|
+
size: "small",
|
79
|
+
fullWidth: true,
|
80
|
+
value: nav?.value,
|
81
|
+
onChange: e => {
|
82
|
+
const {
|
83
|
+
value
|
84
|
+
} = e.target;
|
85
|
+
const selected = getNav(value, navOptions);
|
86
|
+
setNav(selected);
|
87
|
+
setNavValue("");
|
88
|
+
},
|
89
|
+
displayEmpty: true,
|
90
|
+
MenuProps: {
|
91
|
+
sx: classes.customSelect,
|
92
|
+
disablePortal: true
|
93
|
+
},
|
94
|
+
children: navOptions.map((navOption, i) => {
|
95
|
+
return /*#__PURE__*/_jsx(MenuItem, {
|
96
|
+
value: navOption.value,
|
97
|
+
children: /*#__PURE__*/_jsx(Typography, {
|
98
|
+
variant: "body2",
|
99
|
+
children: translation(navOption.label)
|
100
|
+
})
|
101
|
+
}, i);
|
102
|
+
})
|
103
|
+
}), /*#__PURE__*/_jsx(Box, {
|
104
|
+
sx: {
|
105
|
+
paddingTop: "14px"
|
106
|
+
},
|
107
|
+
children: NavSettings && /*#__PURE__*/_jsx(NavSettings, {
|
108
|
+
placeholder: translation(nav?.placeholder),
|
109
|
+
nav: nav,
|
110
|
+
onChange: onChange,
|
111
|
+
value: navValue,
|
112
|
+
openInNewTab: openInNewTab,
|
113
|
+
onNewTabChange: () => setOpenInNewTab(prev => !prev),
|
114
|
+
services: customProps.services,
|
115
|
+
classes: classes,
|
116
|
+
translation: translation
|
117
|
+
})
|
118
|
+
}), /*#__PURE__*/_jsx(Box, {
|
119
|
+
component: "div",
|
120
|
+
sx: classes.mobileActionBtns,
|
121
|
+
children: /*#__PURE__*/_jsx(ActionsButtons, {
|
122
|
+
classes: classes,
|
123
|
+
onCancel: handleClose,
|
124
|
+
onSave: onSubmit,
|
125
|
+
translation: translation
|
126
|
+
})
|
127
|
+
})]
|
132
128
|
});
|
133
129
|
} else {
|
134
130
|
return /*#__PURE__*/_jsxs(Dialog, {
|
@@ -138,25 +134,15 @@ export default function LinkSettings(props) {
|
|
138
134
|
fullWidth: true,
|
139
135
|
maxWidth: "sm",
|
140
136
|
disablePortal: true,
|
141
|
-
children: [/*#__PURE__*/
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
}
|
148
|
-
className: "dialog-title",
|
149
|
-
children: [/*#__PURE__*/_jsx(DialogTitle, {
|
150
|
-
children: translation("dialogueTitle")
|
151
|
-
}), /*#__PURE__*/_jsx(IconButton, {
|
152
|
-
"aria-label": "close",
|
153
|
-
onClick: handleClose,
|
154
|
-
sx: classes.closeIcon,
|
155
|
-
children: /*#__PURE__*/_jsx(CloseRoundedIcon, {})
|
156
|
-
})]
|
137
|
+
children: [/*#__PURE__*/_jsx(DialogTitle, {
|
138
|
+
children: translation("dialogueTitle")
|
139
|
+
}), /*#__PURE__*/_jsx(IconButton, {
|
140
|
+
"aria-label": "close",
|
141
|
+
onClick: handleClose,
|
142
|
+
sx: classes.closeIcon,
|
143
|
+
children: /*#__PURE__*/_jsx(CloseIcon, {})
|
157
144
|
}), /*#__PURE__*/_jsx(DialogContent, {
|
158
145
|
dividers: true,
|
159
|
-
className: "link-settings-content",
|
160
146
|
children: /*#__PURE__*/_jsxs(Grid, {
|
161
147
|
container: true,
|
162
148
|
spacing: 2,
|
@@ -164,9 +150,7 @@ export default function LinkSettings(props) {
|
|
164
150
|
item: true,
|
165
151
|
xs: 6,
|
166
152
|
sx: classes.gridDivider,
|
167
|
-
className: "radioBtnGrp",
|
168
153
|
children: /*#__PURE__*/_jsx(FormControl, {
|
169
|
-
sx: classes.customRadioBtn,
|
170
154
|
children: /*#__PURE__*/_jsx(RadioGroup, {
|
171
155
|
value: nav?.value,
|
172
156
|
children: navOptions?.map((navOption, i) => {
|