@flozy/editor 5.5.7 → 5.5.8

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.
Files changed (198) hide show
  1. package/dist/Editor/ChatEditor.js +34 -25
  2. package/dist/Editor/CommonEditor.js +13 -26
  3. package/dist/Editor/Editor.css +19 -102
  4. package/dist/Editor/Elements/AI/AIInput.js +1 -0
  5. package/dist/Editor/Elements/AI/CustomSelect.js +10 -17
  6. package/dist/Editor/Elements/AI/PopoverAIInput.js +53 -59
  7. package/dist/Editor/Elements/AI/Styles.js +6 -24
  8. package/dist/Editor/Elements/Accordion/Accordion.js +1 -8
  9. package/dist/Editor/Elements/AppHeader/AppHeader.js +6 -6
  10. package/dist/Editor/Elements/Button/EditorButton.js +1 -6
  11. package/dist/Editor/Elements/Carousel/CarouselItem.js +3 -11
  12. package/dist/Editor/Elements/Color Picker/ColorButtons.js +5 -7
  13. package/dist/Editor/Elements/Color Picker/Styles.js +3 -8
  14. package/dist/Editor/Elements/Color Picker/defaultColors.js +2 -2
  15. package/dist/Editor/Elements/Divider/Divider.js +20 -36
  16. package/dist/Editor/Elements/Embed/Image.js +16 -51
  17. package/dist/Editor/Elements/Embed/Video.js +3 -26
  18. package/dist/Editor/Elements/Form/Form.js +2 -38
  19. package/dist/Editor/Elements/Form/FormElements/FormCheckbox.js +1 -7
  20. package/dist/Editor/Elements/Form/FormElements/FormDate.js +1 -7
  21. package/dist/Editor/Elements/Form/FormElements/FormEmail.js +1 -7
  22. package/dist/Editor/Elements/Form/FormElements/FormNumbers.js +1 -7
  23. package/dist/Editor/Elements/Form/FormElements/FormRadioButton.js +1 -7
  24. package/dist/Editor/Elements/Form/FormElements/FormText.js +1 -7
  25. package/dist/Editor/Elements/Form/FormElements/FormTextArea.js +1 -6
  26. package/dist/Editor/Elements/Form/FormPopup.js +9 -12
  27. package/dist/Editor/Elements/Form/Workflow/Styles.js +0 -2
  28. package/dist/Editor/Elements/FreeGrid/FreeGrid.js +1 -1
  29. package/dist/Editor/Elements/FreeGrid/FreeGridBox.js +2 -4
  30. package/dist/Editor/Elements/FreeGrid/FreeGridItem.js +1 -20
  31. package/dist/Editor/Elements/FreeGrid/breakpointConstants.js +4 -4
  32. package/dist/Editor/Elements/FreeGrid/styles.js +1 -1
  33. package/dist/Editor/Elements/Grid/GridButton.js +2 -2
  34. package/dist/Editor/Elements/Grid/GridItem.js +36 -47
  35. package/dist/Editor/Elements/Grid/Styles.js +0 -50
  36. package/dist/Editor/Elements/Link/LinkButton.js +1 -1
  37. package/dist/Editor/Elements/Search/SearchButton.js +0 -1
  38. package/dist/Editor/Elements/Signature/Signature.css +1 -1
  39. package/dist/Editor/Elements/Signature/SignatureOptions/TypeSignature.js +2 -2
  40. package/dist/Editor/Elements/Signature/SignaturePopup.js +52 -17
  41. package/dist/Editor/Elements/SimpleText/style.js +0 -15
  42. package/dist/Editor/Elements/Table/Styles.js +78 -88
  43. package/dist/Editor/Elements/Table/Table.js +140 -263
  44. package/dist/Editor/Elements/Table/TableCell.js +111 -365
  45. package/dist/Editor/Elements/Table/TablePopup.js +3 -9
  46. package/dist/Editor/Elements/Table/TableRow.js +2 -10
  47. package/dist/Editor/Elements/TopBanner/TopBanner.js +1 -2
  48. package/dist/Editor/MiniEditor.js +2 -21
  49. package/dist/Editor/Styles/EditorStyles.js +4 -13
  50. package/dist/Editor/Toolbar/FormatTools/BlockButton.js +0 -10
  51. package/dist/Editor/Toolbar/FormatTools/Dropdown.js +12 -7
  52. package/dist/Editor/Toolbar/FormatTools/FontFamilyAutocomplete.js +4 -26
  53. package/dist/Editor/Toolbar/FormatTools/MarkButton.js +0 -3
  54. package/dist/Editor/Toolbar/FormatTools/TextSize.js +5 -5
  55. package/dist/Editor/Toolbar/Mini/MiniToolbar.js +8 -8
  56. package/dist/Editor/Toolbar/Mini/Styles.js +1 -9
  57. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/InfinityAITool.js +3 -7
  58. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +4 -6
  59. package/dist/Editor/Toolbar/PopupTool/PopperHeader.js +15 -19
  60. package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +58 -547
  61. package/dist/Editor/Toolbar/PopupTool/TextFormat.js +16 -28
  62. package/dist/Editor/Toolbar/PopupTool/index.js +5 -3
  63. package/dist/Editor/Toolbar/Toolbar.js +0 -6
  64. package/dist/Editor/Toolbar/toolbarGroups.js +0 -4
  65. package/dist/Editor/assets/svg/BrainIcon.js +2 -2
  66. package/dist/Editor/assets/svg/SettingsIcon.js +4 -4
  67. package/dist/Editor/common/ColorPickerButton.js +45 -85
  68. package/dist/Editor/common/DnD/Draggable.js +1 -2
  69. package/dist/Editor/common/FontLoader/FontLoader.js +2 -2
  70. package/dist/Editor/common/Icon.js +21 -54
  71. package/dist/Editor/common/ImageSelector/Options/Upload.js +1 -2
  72. package/dist/Editor/common/ImageSelector/Styles.js +6 -47
  73. package/dist/Editor/common/ImageSelector/UploadStyles.js +6 -18
  74. package/dist/Editor/common/LinkSettings/NavComponents.js +1 -2
  75. package/dist/Editor/common/LinkSettings/index.js +1 -2
  76. package/dist/Editor/common/MentionsPopup/Styles.js +8 -142
  77. package/dist/Editor/common/MentionsPopup/index.js +1 -1
  78. package/dist/Editor/common/RnD/ElementSettings/Settings/FormSettings.js +12 -107
  79. package/dist/Editor/common/RnD/GuideLines/styles.js +3 -3
  80. package/dist/Editor/common/RnD/ShadowElement.js +1 -1
  81. package/dist/Editor/common/RnD/VirtualElement/index.js +1 -5
  82. package/dist/Editor/common/RnD/index.js +3 -4
  83. package/dist/Editor/common/Section/index.js +3 -3
  84. package/dist/Editor/common/Section/styles.js +1 -5
  85. package/dist/Editor/common/Shorthands/elements.js +1 -13
  86. package/dist/Editor/common/StyleBuilder/fieldStyle.js +1 -2
  87. package/dist/Editor/common/StyleBuilder/fieldTypes/backgroundImage.js +3 -4
  88. package/dist/Editor/common/StyleBuilder/fieldTypes/bannerSpacing.js +7 -35
  89. package/dist/Editor/common/StyleBuilder/fieldTypes/borderRadius.js +2 -15
  90. package/dist/Editor/common/StyleBuilder/fieldTypes/color.js +1 -2
  91. package/dist/Editor/common/StyleBuilder/fieldTypes/fontSize.js +1 -1
  92. package/dist/Editor/common/StyleBuilder/fieldTypes/icons.js +0 -2
  93. package/dist/Editor/common/StyleBuilder/fieldTypes/radiusStyle.js +11 -11
  94. package/dist/Editor/common/StyleBuilder/fieldTypes/saveAsTemplate.js +6 -22
  95. package/dist/Editor/common/StyleBuilder/fieldTypes/selectBox.js +2 -21
  96. package/dist/Editor/common/StyleBuilder/fieldTypes/text.js +4 -20
  97. package/dist/Editor/common/StyleBuilder/fieldTypes/textOptions.js +2 -12
  98. package/dist/Editor/common/StyleBuilder/formStyle.js +149 -268
  99. package/dist/Editor/common/StyleBuilder/index.js +20 -101
  100. package/dist/Editor/common/StyleBuilder/tableStyle.js +25 -69
  101. package/dist/Editor/common/SwipeableDrawer/style.js +4 -15
  102. package/dist/Editor/common/ToolbarIcon.js +1 -1
  103. package/dist/Editor/common/Uploader.js +37 -39
  104. package/dist/Editor/common/iconListV2.js +74 -598
  105. package/dist/Editor/common/iconslist.js +19 -25
  106. package/dist/Editor/commonStyle.js +15 -421
  107. package/dist/Editor/helper/deserialize/index.js +2 -31
  108. package/dist/Editor/helper/index.js +2 -15
  109. package/dist/Editor/helper/theme.js +1 -15
  110. package/dist/Editor/hooks/useBreakpoints.js +1 -1
  111. package/dist/Editor/plugins/withCustomDeleteBackward.js +1 -1
  112. package/dist/Editor/plugins/withEmbeds.js +26 -30
  113. package/dist/Editor/plugins/withHTML.js +12 -100
  114. package/dist/Editor/plugins/withLayout.js +0 -1
  115. package/dist/Editor/utils/SlateUtilityFunctions.js +11 -31
  116. package/dist/Editor/utils/brains.js +1 -1
  117. package/dist/Editor/utils/chatEditor/SlateUtilityFunctions.js +1 -26
  118. package/dist/Editor/utils/customHooks/useResize.js +4 -7
  119. package/dist/Editor/utils/customHooks/useTableResize.js +2 -6
  120. package/dist/Editor/utils/embed.js +1 -2
  121. package/dist/Editor/utils/events.js +1 -0
  122. package/dist/Editor/utils/font.js +4 -11
  123. package/dist/Editor/utils/formfield.js +4 -8
  124. package/dist/Editor/utils/helper.js +2 -100
  125. package/dist/Editor/utils/insertNewLine.js +1 -19
  126. package/dist/Editor/utils/serializeToText.js +0 -2
  127. package/dist/Editor/utils/table.js +24 -228
  128. package/package.json +2 -2
  129. package/dist/Editor/Elements/DataView/DataView.js +0 -124
  130. package/dist/Editor/Elements/DataView/DataViewButton.js +0 -23
  131. package/dist/Editor/Elements/DataView/Layouts/ColumnView.js +0 -83
  132. package/dist/Editor/Elements/DataView/Layouts/DataTypes/CheckType.js +0 -33
  133. package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/Select.js +0 -180
  134. package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/SimpleSelect.js +0 -62
  135. package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/styles.js +0 -68
  136. package/dist/Editor/Elements/DataView/Layouts/DataTypes/DateType.js +0 -35
  137. package/dist/Editor/Elements/DataView/Layouts/DataTypes/MultiSelectType.js +0 -39
  138. package/dist/Editor/Elements/DataView/Layouts/DataTypes/NumberType.js +0 -30
  139. package/dist/Editor/Elements/DataView/Layouts/DataTypes/PersonType.js +0 -30
  140. package/dist/Editor/Elements/DataView/Layouts/DataTypes/SelectType.js +0 -35
  141. package/dist/Editor/Elements/DataView/Layouts/DataTypes/TextType.js +0 -36
  142. package/dist/Editor/Elements/DataView/Layouts/DataTypes/index.js +0 -17
  143. package/dist/Editor/Elements/DataView/Layouts/FilterSort/SortOptions/ChooseField.js +0 -29
  144. package/dist/Editor/Elements/DataView/Layouts/FilterSort/SortOptions/ChooseSort.js +0 -38
  145. package/dist/Editor/Elements/DataView/Layouts/FilterSort/SortOptions/index.js +0 -86
  146. package/dist/Editor/Elements/DataView/Layouts/FilterSort/index.js +0 -71
  147. package/dist/Editor/Elements/DataView/Layouts/FilterSort/styles.js +0 -138
  148. package/dist/Editor/Elements/DataView/Layouts/FilterView.js +0 -213
  149. package/dist/Editor/Elements/DataView/Layouts/Formula.js +0 -29
  150. package/dist/Editor/Elements/DataView/Layouts/Options/AddOptions.js +0 -113
  151. package/dist/Editor/Elements/DataView/Layouts/Options/AddProperty.js +0 -44
  152. package/dist/Editor/Elements/DataView/Layouts/Options/AllProperties.js +0 -146
  153. package/dist/Editor/Elements/DataView/Layouts/Options/ChangeProperty.js +0 -79
  154. package/dist/Editor/Elements/DataView/Layouts/Options/ColumnsList.js +0 -57
  155. package/dist/Editor/Elements/DataView/Layouts/Options/Constants.js +0 -101
  156. package/dist/Editor/Elements/DataView/Layouts/Options/EditOption.js +0 -174
  157. package/dist/Editor/Elements/DataView/Layouts/Options/EditProperty.js +0 -241
  158. package/dist/Editor/Elements/DataView/Layouts/Options/FilterProperty.js +0 -45
  159. package/dist/Editor/Elements/DataView/Layouts/Options/PropertyList.js +0 -32
  160. package/dist/Editor/Elements/DataView/Layouts/Options/index.js +0 -110
  161. package/dist/Editor/Elements/DataView/Layouts/Options/styles.js +0 -217
  162. package/dist/Editor/Elements/DataView/Layouts/TableStyles.js +0 -131
  163. package/dist/Editor/Elements/DataView/Layouts/TableView.js +0 -253
  164. package/dist/Editor/Elements/DataView/Layouts/ViewData.js +0 -85
  165. package/dist/Editor/Elements/DataView/Layouts/colStyles.js +0 -10
  166. package/dist/Editor/Elements/DataView/Layouts/index.js +0 -25
  167. package/dist/Editor/Elements/DataView/Providers/DataViewProvider.js +0 -277
  168. package/dist/Editor/Elements/DataView/Utils/globalSearch.js +0 -15
  169. package/dist/Editor/Elements/DataView/Utils/multiSortRows.js +0 -88
  170. package/dist/Editor/Elements/DataView/styles.js +0 -169
  171. package/dist/Editor/Elements/Table/AddRowCol.js +0 -77
  172. package/dist/Editor/Elements/Table/DragButton.js +0 -142
  173. package/dist/Editor/Elements/Table/DragStyles.js +0 -70
  174. package/dist/Editor/Elements/Table/Draggable.js +0 -25
  175. package/dist/Editor/Elements/Table/Droppable.js +0 -53
  176. package/dist/Editor/Elements/Table/TableTool.js +0 -101
  177. package/dist/Editor/Elements/Table/tableHelper.js +0 -71
  178. package/dist/Editor/assets/svg/ArrowDownIcon.js +0 -25
  179. package/dist/Editor/assets/svg/ArrowUpIcon.js +0 -25
  180. package/dist/Editor/assets/svg/CalenderIconTick.js +0 -64
  181. package/dist/Editor/assets/svg/ChervDown.js +0 -18
  182. package/dist/Editor/assets/svg/ChervUp.js +0 -18
  183. package/dist/Editor/assets/svg/DataTableIcon.js +0 -50
  184. package/dist/Editor/assets/svg/DuplicateIcon.js +0 -23
  185. package/dist/Editor/assets/svg/EyeIcon.js +0 -23
  186. package/dist/Editor/assets/svg/EyeSlash.js +0 -43
  187. package/dist/Editor/assets/svg/HashtagIcon.js +0 -33
  188. package/dist/Editor/assets/svg/PlusIcon.js +0 -23
  189. package/dist/Editor/assets/svg/SelectRoundedIcon.js +0 -24
  190. package/dist/Editor/assets/svg/SortByIcon.js +0 -33
  191. package/dist/Editor/assets/svg/TableIcons.js +0 -220
  192. package/dist/Editor/assets/svg/TickOutlined.js +0 -23
  193. package/dist/Editor/assets/svg/TrashCanIcon.js +0 -38
  194. package/dist/Editor/common/Select/index.js +0 -20
  195. package/dist/Editor/common/Select/styles.js +0 -17
  196. package/dist/Editor/helper/enforceDateFormat.js +0 -41
  197. package/dist/Editor/hooks/useTable.js +0 -210
  198. package/dist/Editor/utils/dataView.js +0 -43
@@ -1,174 +0,0 @@
1
- import React, { useEffect, useRef, useState } from "react";
2
- import { Box, IconButton, TextField, List, ListItemButton, ListItemIcon, ListItemText, FormControlLabel } from "@mui/material";
3
- import CloseIcon from "@mui/icons-material/Close";
4
- import ColorButtons from "../../../Color Picker/ColorButtons";
5
- import ColorPickerStyles from "../../../Color Picker/Styles";
6
- import { DEFAULT_OPTION_COLORS } from "./Constants";
7
- import Icon from "../../../../common/Icon";
8
- import { useEditorContext } from "../../../../hooks/useMouseMove";
9
- import { jsx as _jsx } from "react/jsx-runtime";
10
- import { jsxs as _jsxs } from "react/jsx-runtime";
11
- const EditOption = props => {
12
- const {
13
- classes,
14
- onClose,
15
- mode,
16
- onEvent
17
- } = props;
18
- const [edit, setEdit] = useState({
19
- ...(mode?.edit || {})
20
- });
21
- const editData = useRef({
22
- ...edit
23
- });
24
- const {
25
- theme
26
- } = useEditorContext();
27
- const {
28
- optionIndex
29
- } = edit;
30
- const selectedOption = edit?.options[optionIndex] || {};
31
- const pickerStyles = ColorPickerStyles(theme);
32
- useEffect(() => {
33
- return () => {
34
- // on un-mount update the option change
35
- if (editData?.current) {
36
- delete editData?.current?.edited;
37
- onEvent("updateProperty", {
38
- ...editData?.current
39
- });
40
- }
41
- };
42
- }, []);
43
- const onChange = e => {
44
- const updatedOptions = edit?.options.map((m, i) => {
45
- if (i === edit?.optionIndex) {
46
- return {
47
- ...m,
48
- [e.target.name]: e?.target?.value
49
- };
50
- }
51
- return m;
52
- });
53
-
54
- // for delete
55
- if (edit?.optionIndex > -1 && e?.target?.delete) {
56
- updatedOptions.splice(edit?.optionIndex, 1);
57
- }
58
- const latest = {
59
- ...edit,
60
- options: [...updatedOptions]
61
- };
62
- setEdit({
63
- ...latest
64
- });
65
- editData.current = {
66
- ...latest,
67
- edited: true
68
- };
69
-
70
- // if delete go back
71
- if (e?.target?.delete) {
72
- onEvent("editProperty", {
73
- edit: {
74
- ...latest
75
- }
76
- });
77
- }
78
- };
79
- const onBack = () => {
80
- onEvent("editProperty", {
81
- edit: {
82
- ...edit
83
- }
84
- });
85
- };
86
- const onDeleteOption = () => {
87
- onChange({
88
- target: {
89
- delete: true
90
- }
91
- });
92
- };
93
- const onColorChange = color => {
94
- onChange({
95
- target: {
96
- name: "color",
97
- value: color
98
- }
99
- });
100
- };
101
- return /*#__PURE__*/_jsxs(Box, {
102
- sx: classes.addProperty,
103
- children: [/*#__PURE__*/_jsxs(Box, {
104
- className: "fe-dv-ap-title",
105
- children: [/*#__PURE__*/_jsxs("span", {
106
- children: [/*#__PURE__*/_jsx(IconButton, {
107
- className: "tv-act-ico",
108
- size: "small",
109
- onClick: onBack,
110
- children: /*#__PURE__*/_jsx(Icon, {
111
- icon: 'leftArrow'
112
- })
113
- }), "Edit Option"]
114
- }), /*#__PURE__*/_jsx(IconButton, {
115
- className: "tv-act-ico bg br1",
116
- size: "small",
117
- sx: {
118
- '& svg': {
119
- '& path': {
120
- strokeWidth: 0
121
- }
122
- }
123
- },
124
- onClick: onClose,
125
- children: /*#__PURE__*/_jsx(CloseIcon, {})
126
- })]
127
- }), /*#__PURE__*/_jsx(Box, {
128
- className: "fe-dv-ap-opt-content mt-1 mb",
129
- children: /*#__PURE__*/_jsx(FormControlLabel, {
130
- className: "ml-0",
131
- label: "Option Name",
132
- control: /*#__PURE__*/_jsx(TextField, {
133
- size: "small",
134
- name: "value",
135
- value: selectedOption?.value,
136
- onChange: onChange,
137
- fullWidth: true,
138
- placeholder: "Option Name"
139
- }),
140
- labelPlacement: "top"
141
- })
142
- }), /*#__PURE__*/_jsxs(Box, {
143
- className: "label-desc mt-1",
144
- children: [/*#__PURE__*/_jsx(Box, {
145
- className: "label-tp mb",
146
- children: "Choose Color"
147
- }), /*#__PURE__*/_jsx(Box, {
148
- className: "ml",
149
- children: /*#__PURE__*/_jsx(ColorButtons, {
150
- classes: pickerStyles,
151
- onSelect: onColorChange,
152
- activeColor: selectedOption?.color,
153
- defaultColors: DEFAULT_OPTION_COLORS
154
- })
155
- })]
156
- }), /*#__PURE__*/_jsx(List, {
157
- className: "fe-dv-opt-list st",
158
- children: /*#__PURE__*/_jsxs(ListItemButton, {
159
- onClick: onDeleteOption,
160
- children: [/*#__PURE__*/_jsx(ListItemIcon, {
161
- children: /*#__PURE__*/_jsx(Icon, {
162
- icon: 'trashIcon'
163
- })
164
- }), /*#__PURE__*/_jsx(ListItemText, {
165
- children: "Delete Option"
166
- })]
167
- })
168
- })]
169
- });
170
- };
171
- EditOption.defaultProps = {
172
- onEvent: () => {}
173
- };
174
- export default EditOption;
@@ -1,241 +0,0 @@
1
- import React, { useEffect, useRef, useState } from "react";
2
- import { Box, IconButton, TextField, List, ListItemButton, ListItemText, ListItemIcon, FormControlLabel, Divider } from "@mui/material";
3
- import { TYPE_ICONS, TYPE_LABELS } from "./Constants";
4
- import AddOptions from "./AddOptions";
5
- import FilterProperty from "./FilterProperty";
6
- import Icon from "../../../../common/Icon";
7
- import CloseIcon from "@mui/icons-material/Close";
8
- import { jsx as _jsx } from "react/jsx-runtime";
9
- import { jsxs as _jsxs } from "react/jsx-runtime";
10
- const EditProperty = props => {
11
- const {
12
- classes,
13
- onClose,
14
- mode,
15
- onEvent
16
- } = props;
17
- const [edit, setEdit] = useState({
18
- ...(mode?.edit || {})
19
- });
20
- const editData = useRef({
21
- ...edit
22
- });
23
- useEffect(() => {
24
- return () => {
25
- // on un-mount update the label
26
- if (edit?.label !== editData?.current?.label) {
27
- onEvent("updateProperty", {
28
- ...editData?.current
29
- }, false);
30
- }
31
- };
32
- }, []);
33
- const onChange = key => e => {
34
- const latest = {
35
- ...edit,
36
- [key]: e?.target?.value
37
- };
38
- setEdit({
39
- ...edit,
40
- [key]: e?.target?.value
41
- });
42
- editData.current = {
43
- ...latest
44
- };
45
- };
46
- const onChangeProperty = () => {
47
- onEvent("changeProperty", {
48
- edit: {
49
- ...edit
50
- }
51
- });
52
- };
53
- const onBack = () => {
54
- onEvent("allProperties", {
55
- edit: null
56
- });
57
- };
58
- const onUpdate = data => {
59
- const latest = {
60
- ...edit,
61
- ...data
62
- };
63
- setEdit({
64
- ...edit,
65
- ...data
66
- });
67
- editData.current = {
68
- ...latest
69
- };
70
- onEvent("updateProperty", {
71
- ...editData?.current
72
- });
73
- };
74
- const onAction = action => () => {
75
- switch (action) {
76
- case "Visibilty":
77
- onUpdate({
78
- visible: !edit?.visible
79
- });
80
- onEvent("close");
81
- break;
82
- case "Duplicate":
83
- onEvent("addProperty", {
84
- type: editData?.current?.type,
85
- overrides: {
86
- ...editData?.current
87
- }
88
- }, false);
89
- onEvent("close");
90
- break;
91
- case "Delete":
92
- onEvent("deleteProperty", {
93
- ...editData?.current
94
- });
95
- onEvent("close");
96
- break;
97
- default:
98
- return;
99
- }
100
- };
101
- return /*#__PURE__*/_jsxs(Box, {
102
- sx: classes.addProperty,
103
- children: [/*#__PURE__*/_jsxs(Box, {
104
- className: "fe-dv-ap-title",
105
- children: [/*#__PURE__*/_jsxs("span", {
106
- children: [/*#__PURE__*/_jsx(IconButton, {
107
- className: "tv-act-ico",
108
- size: "small",
109
- onClick: onBack,
110
- sx: {
111
- paddingLeft: '0px',
112
- '&:hover': {
113
- background: 'transparent !important'
114
- },
115
- '& svg': {
116
- width: '14px !important',
117
- height: '14px !important'
118
- }
119
- },
120
- children: /*#__PURE__*/_jsx(Icon, {
121
- icon: 'leftArrow'
122
- })
123
- }), "Edit Property"]
124
- }), /*#__PURE__*/_jsx(IconButton, {
125
- className: "tv-act-ico bg br1",
126
- size: "small",
127
- onClick: onClose,
128
- sx: {
129
- '& svg': {
130
- '& path': {
131
- strokeWidth: 0
132
- }
133
- }
134
- },
135
- children: /*#__PURE__*/_jsx(CloseIcon, {})
136
- })]
137
- }), /*#__PURE__*/_jsxs(Box, {
138
- className: "fe-dv-ap-opt-content",
139
- children: [/*#__PURE__*/_jsx(FormControlLabel, {
140
- label: "Field Name",
141
- labelPlacement: "top",
142
- sx: {
143
- '& .MuiFormControl-root': {
144
- marginBottom: '4px'
145
- }
146
- },
147
- control: /*#__PURE__*/_jsx(TextField, {
148
- size: "small",
149
- value: edit?.label,
150
- onChange: onChange("label"),
151
- fullWidth: true,
152
- placeholder: "Field Name"
153
- })
154
- }), /*#__PURE__*/_jsx(List, {
155
- className: "fe-dv-opt-list st",
156
- children: /*#__PURE__*/_jsxs(ListItemButton, {
157
- sx: {
158
- paddingBottom: '12px'
159
- },
160
- onClick: onChangeProperty,
161
- children: [/*#__PURE__*/_jsx(ListItemText, {
162
- children: "Type"
163
- }), /*#__PURE__*/_jsxs(ListItemIcon, {
164
- sx: {
165
- display: 'flex',
166
- alignItems: "center",
167
- gap: 1
168
- },
169
- children: [/*#__PURE__*/_jsx(Box, {
170
- sx: {
171
- background: "#64748B1F",
172
- borderRadius: '4px',
173
- display: 'flex',
174
- alignItems: 'center',
175
- padding: '2px',
176
- '& svg': {
177
- width: '16px',
178
- height: '16px'
179
- }
180
- },
181
- children: /*#__PURE__*/_jsx(Icon, {
182
- icon: `${TYPE_ICONS[edit?.type]}`
183
- })
184
- }), /*#__PURE__*/_jsx("span", {
185
- className: "label-tp",
186
- children: TYPE_LABELS[edit?.type]
187
- }), /*#__PURE__*/_jsx(Icon, {
188
- icon: 'rightArrow'
189
- })]
190
- })]
191
- })
192
- }), /*#__PURE__*/_jsx(Divider, {
193
- className: "divider_sty"
194
- }), /*#__PURE__*/_jsx(AddOptions, {
195
- edit: edit,
196
- onUpdate: onUpdate,
197
- onEvent: onEvent
198
- }), /*#__PURE__*/_jsx(FilterProperty, {
199
- edit: edit,
200
- onUpdate: onUpdate,
201
- onEvent: onEvent
202
- }), /*#__PURE__*/_jsxs(List, {
203
- className: "fe-dv-opt-list",
204
- children: [/*#__PURE__*/_jsxs(ListItemButton, {
205
- onClick: onAction("Visibilty"),
206
- children: [/*#__PURE__*/_jsx(ListItemIcon, {
207
- children: edit?.visible ? /*#__PURE__*/_jsx(Icon, {
208
- icon: 'eyeSlash'
209
- }) : /*#__PURE__*/_jsx(Icon, {
210
- icon: 'eyeIcon'
211
- })
212
- }), /*#__PURE__*/_jsxs(ListItemText, {
213
- children: [edit?.visible ? "Hide" : "Show", " in View"]
214
- })]
215
- }), /*#__PURE__*/_jsxs(ListItemButton, {
216
- onClick: onAction("Duplicate"),
217
- children: [/*#__PURE__*/_jsx(ListItemIcon, {
218
- children: /*#__PURE__*/_jsx(Icon, {
219
- icon: 'duplicateIcon'
220
- })
221
- }), /*#__PURE__*/_jsx(ListItemText, {
222
- children: "Duplicate Property"
223
- })]
224
- }), /*#__PURE__*/_jsxs(ListItemButton, {
225
- onClick: onAction("Delete"),
226
- children: [/*#__PURE__*/_jsx(ListItemIcon, {
227
- children: /*#__PURE__*/_jsx(Icon, {
228
- icon: 'trashIcon'
229
- })
230
- }), /*#__PURE__*/_jsx(ListItemText, {
231
- children: "Delete Property"
232
- })]
233
- })]
234
- })]
235
- })]
236
- });
237
- };
238
- EditProperty.defaultProps = {
239
- onEvent: () => {}
240
- };
241
- export default EditProperty;
@@ -1,45 +0,0 @@
1
- import React from "react";
2
- import { List, ListItemButton, ListItemText, ListItemIcon } from "@mui/material";
3
- import { FILTER_TYPES } from "./Constants";
4
- import { useDataView } from "../../Providers/DataViewProvider";
5
- import Icon from "../../../../common/Icon";
6
- import { jsx as _jsx } from "react/jsx-runtime";
7
- import { jsxs as _jsxs } from "react/jsx-runtime";
8
- const FilterProperty = props => {
9
- const {
10
- sort
11
- } = useDataView();
12
- const {
13
- edit,
14
- onEvent
15
- } = props;
16
- const handleChangeOption = m => () => {
17
- onEvent("addSort", {
18
- key: edit?.key,
19
- ...(sort[0] || {}),
20
- newKey: edit?.key,
21
- operator: m?.operator
22
- });
23
- };
24
- return /*#__PURE__*/_jsx(List, {
25
- className: "fe-dv-opt-list mt",
26
- children: FILTER_TYPES?.map(({
27
- ...m
28
- }, i) => {
29
- return /*#__PURE__*/_jsxs(ListItemButton, {
30
- onClick: handleChangeOption(m),
31
- children: [/*#__PURE__*/_jsx(ListItemIcon, {
32
- children: /*#__PURE__*/_jsx(Icon, {
33
- icon: m?.Icon
34
- })
35
- }), /*#__PURE__*/_jsx(ListItemText, {
36
- primary: m.label
37
- })]
38
- }, i);
39
- })
40
- });
41
- };
42
- FilterProperty.defaultProps = {
43
- onEvent: () => {}
44
- };
45
- export default FilterProperty;
@@ -1,32 +0,0 @@
1
- import React from "react";
2
- import { List, ListItemButton, ListItemIcon, ListItemText } from "@mui/material";
3
- import { PROPERTY_TYPES } from "./Constants";
4
- import Icon from "../../../../common/Icon";
5
- import { jsx as _jsx } from "react/jsx-runtime";
6
- import { jsxs as _jsxs } from "react/jsx-runtime";
7
- const PropertyList = props => {
8
- const {
9
- onSelect,
10
- selected
11
- } = props;
12
- return /*#__PURE__*/_jsx(List, {
13
- children: PROPERTY_TYPES?.map(({
14
- ...rest
15
- }, i) => {
16
- return /*#__PURE__*/_jsxs(ListItemButton, {
17
- className: selected?.type === rest?.type ? "active" : "",
18
- onClick: onSelect(rest),
19
- children: [/*#__PURE__*/_jsx(ListItemIcon, {
20
- className: "needBg",
21
- children: /*#__PURE__*/_jsx(Icon, {
22
- icon: rest?.Icon
23
- })
24
- }), /*#__PURE__*/_jsx(ListItemText, {
25
- primary: rest?.label
26
- })]
27
- }, i);
28
- })
29
- });
30
- };
31
- PropertyList.defaultProps = {};
32
- export default PropertyList;
@@ -1,110 +0,0 @@
1
- import React from "react";
2
- import { Popover, SwipeableDrawer } from "@mui/material";
3
- import useOptionsStyles from "./styles";
4
- import AddProperty from "./AddProperty";
5
- import EditProperty from "./EditProperty";
6
- import ChangeProperty from "./ChangeProperty";
7
- import AllProperties from "./AllProperties";
8
- import EditOption from "./EditOption";
9
- import { useTheme } from "@emotion/react";
10
- import { useEditorContext } from "../../../../hooks/useMouseMove";
11
- import { jsx as _jsx } from "react/jsx-runtime";
12
- const POSITIONS = {
13
- addProperty: {
14
- anchorOrigin: {
15
- vertical: "bottom",
16
- horizontal: "right"
17
- },
18
- transformOrigin: {
19
- vertical: "top",
20
- horizontal: "right"
21
- }
22
- },
23
- allProperties: {
24
- anchorOrigin: {
25
- vertical: "bottom",
26
- horizontal: "right"
27
- },
28
- transformOrigin: {
29
- vertical: "top",
30
- horizontal: "right"
31
- }
32
- }
33
- };
34
- const PropertySettings = props => {
35
- const {
36
- theme: appTheme
37
- } = useEditorContext();
38
- const theme = useTheme();
39
- const {
40
- open,
41
- anchorEl,
42
- mode,
43
- onClose,
44
- onEvent
45
- } = props;
46
- const classes = useOptionsStyles(theme, appTheme);
47
- const isMobile = window.matchMedia("(max-width: 899px)")?.matches || false;
48
- const PoperComponent = isMobile ? SwipeableDrawer : Popover;
49
- const renderMode = () => {
50
- switch (mode?.type) {
51
- case "addProperty":
52
- return /*#__PURE__*/_jsx(AddProperty, {
53
- classes: classes,
54
- onClose: onClose,
55
- onEvent: onEvent,
56
- mode: mode
57
- });
58
- case "editProperty":
59
- return /*#__PURE__*/_jsx(EditProperty, {
60
- classes: classes,
61
- onClose: onClose,
62
- onEvent: onEvent,
63
- mode: mode
64
- });
65
- case "changeProperty":
66
- return /*#__PURE__*/_jsx(ChangeProperty, {
67
- classes: classes,
68
- onClose: onClose,
69
- onEvent: onEvent,
70
- mode: mode
71
- });
72
- case "allProperties":
73
- return /*#__PURE__*/_jsx(AllProperties, {
74
- classes: classes,
75
- onClose: onClose,
76
- onEvent: onEvent,
77
- mode: mode
78
- });
79
- case "editOption":
80
- return /*#__PURE__*/_jsx(EditOption, {
81
- classes: classes,
82
- onClose: onClose,
83
- onEvent: onEvent,
84
- mode: mode
85
- });
86
- default:
87
- return null;
88
- }
89
- };
90
- return /*#__PURE__*/_jsx(PoperComponent, {
91
- open: open,
92
- anchorEl: anchorEl,
93
- anchorOrigin: {
94
- vertical: "top",
95
- horizontal: "right"
96
- },
97
- transformOrigin: {
98
- vertical: "top",
99
- horizontal: "right"
100
- },
101
- onClose: onClose,
102
- anchor: "bottom",
103
- sx: classes.popover
104
- // override position
105
- ,
106
- ...(POSITIONS[mode?.type] || {}),
107
- children: renderMode()
108
- });
109
- };
110
- export default PropertySettings;