@flozy/editor 5.4.0 → 5.4.1

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 (192) hide show
  1. package/dist/Editor/ChatEditor.js +34 -25
  2. package/dist/Editor/CommonEditor.js +15 -29
  3. package/dist/Editor/Editor.css +18 -100
  4. package/dist/Editor/Elements/AI/AIInput.js +1 -0
  5. package/dist/Editor/Elements/AI/CustomSelect.js +11 -19
  6. package/dist/Editor/Elements/AI/PopoverAIInput.js +52 -58
  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 +2 -9
  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 -7
  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 -39
  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/FreeGrid/FreeGrid.js +1 -1
  28. package/dist/Editor/Elements/FreeGrid/FreeGridItem.js +1 -20
  29. package/dist/Editor/Elements/FreeGrid/breakpointConstants.js +4 -4
  30. package/dist/Editor/Elements/FreeGrid/styles.js +1 -2
  31. package/dist/Editor/Elements/Grid/GridButton.js +2 -2
  32. package/dist/Editor/Elements/Grid/GridItem.js +36 -47
  33. package/dist/Editor/Elements/Grid/Styles.js +0 -50
  34. package/dist/Editor/Elements/Link/LinkButton.js +1 -1
  35. package/dist/Editor/Elements/List/CheckList.js +1 -2
  36. package/dist/Editor/Elements/Search/SearchAttachment.js +0 -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/index.js +1 -8
  42. package/dist/Editor/Elements/SimpleText/style.js +1 -20
  43. package/dist/Editor/Elements/Table/Styles.js +79 -82
  44. package/dist/Editor/Elements/Table/Table.js +140 -258
  45. package/dist/Editor/Elements/Table/TableCell.js +111 -365
  46. package/dist/Editor/Elements/Table/TablePopup.js +3 -9
  47. package/dist/Editor/Elements/Table/TableRow.js +2 -10
  48. package/dist/Editor/Elements/TopBanner/TopBanner.js +1 -2
  49. package/dist/Editor/MiniEditor.js +1 -15
  50. package/dist/Editor/Styles/EditorStyles.js +4 -13
  51. package/dist/Editor/Toolbar/FormatTools/BlockButton.js +0 -10
  52. package/dist/Editor/Toolbar/FormatTools/Dropdown.js +12 -7
  53. package/dist/Editor/Toolbar/FormatTools/FontFamilyAutocomplete.js +4 -26
  54. package/dist/Editor/Toolbar/FormatTools/MarkButton.js +0 -3
  55. package/dist/Editor/Toolbar/FormatTools/TextSize.js +5 -5
  56. package/dist/Editor/Toolbar/Mini/MiniToolbar.js +6 -3
  57. package/dist/Editor/Toolbar/Mini/Styles.js +1 -4
  58. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/InfinityAITool.js +3 -7
  59. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +4 -6
  60. package/dist/Editor/Toolbar/PopupTool/PopperHeader.js +15 -19
  61. package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +57 -555
  62. package/dist/Editor/Toolbar/PopupTool/TextFormat.js +16 -73
  63. package/dist/Editor/Toolbar/PopupTool/index.js +5 -3
  64. package/dist/Editor/Toolbar/Toolbar.js +0 -6
  65. package/dist/Editor/Toolbar/toolbarGroups.js +0 -4
  66. package/dist/Editor/assets/svg/BrainIcon.js +2 -2
  67. package/dist/Editor/assets/svg/SettingsIcon.js +4 -4
  68. package/dist/Editor/common/ColorPickerButton.js +45 -85
  69. package/dist/Editor/common/DnD/Draggable.js +1 -2
  70. package/dist/Editor/common/FontLoader/FontLoader.js +4 -4
  71. package/dist/Editor/common/Icon.js +20 -23
  72. package/dist/Editor/common/ImageSelector/Options/Upload.js +1 -2
  73. package/dist/Editor/common/ImageSelector/Styles.js +6 -47
  74. package/dist/Editor/common/ImageSelector/UploadStyles.js +6 -18
  75. package/dist/Editor/common/LinkSettings/NavComponents.js +1 -2
  76. package/dist/Editor/common/LinkSettings/index.js +1 -2
  77. package/dist/Editor/common/MentionsPopup/Styles.js +8 -143
  78. package/dist/Editor/common/MentionsPopup/index.js +1 -1
  79. package/dist/Editor/common/RnD/ElementSettings/Settings/FormSettings.js +12 -108
  80. package/dist/Editor/common/RnD/GuideLines/styles.js +3 -3
  81. package/dist/Editor/common/RnD/ShadowElement.js +1 -1
  82. package/dist/Editor/common/RnD/SwitchViewport/SwitchViewport.js +2 -14
  83. package/dist/Editor/common/RnD/Utils/gridDropItem.js +6 -9
  84. package/dist/Editor/common/RnD/VirtualElement/index.js +1 -5
  85. package/dist/Editor/common/RnD/index.js +2 -3
  86. package/dist/Editor/common/Section/index.js +3 -3
  87. package/dist/Editor/common/Section/styles.js +1 -5
  88. package/dist/Editor/common/Shorthands/elements.js +1 -13
  89. package/dist/Editor/common/StyleBuilder/fieldStyle.js +1 -2
  90. package/dist/Editor/common/StyleBuilder/fieldTypes/backgroundImage.js +3 -9
  91. package/dist/Editor/common/StyleBuilder/fieldTypes/bannerSpacing.js +7 -35
  92. package/dist/Editor/common/StyleBuilder/fieldTypes/borderRadius.js +2 -15
  93. package/dist/Editor/common/StyleBuilder/fieldTypes/card.js +2 -10
  94. package/dist/Editor/common/StyleBuilder/fieldTypes/color.js +1 -2
  95. package/dist/Editor/common/StyleBuilder/fieldTypes/fontSize.js +1 -1
  96. package/dist/Editor/common/StyleBuilder/fieldTypes/icons.js +0 -2
  97. package/dist/Editor/common/StyleBuilder/fieldTypes/index.js +1 -3
  98. package/dist/Editor/common/StyleBuilder/fieldTypes/radiusStyle.js +11 -11
  99. package/dist/Editor/common/StyleBuilder/fieldTypes/saveAsTemplate.js +6 -22
  100. package/dist/Editor/common/StyleBuilder/fieldTypes/selectBox.js +2 -21
  101. package/dist/Editor/common/StyleBuilder/fieldTypes/text.js +4 -20
  102. package/dist/Editor/common/StyleBuilder/fieldTypes/textOptions.js +2 -12
  103. package/dist/Editor/common/StyleBuilder/formStyle.js +149 -268
  104. package/dist/Editor/common/StyleBuilder/index.js +20 -101
  105. package/dist/Editor/common/StyleBuilder/pageSettingsStyle.js +0 -4
  106. package/dist/Editor/common/StyleBuilder/tableStyle.js +25 -69
  107. package/dist/Editor/common/SwipeableDrawer/style.js +4 -15
  108. package/dist/Editor/common/ToolbarIcon.js +1 -1
  109. package/dist/Editor/common/Uploader.js +36 -46
  110. package/dist/Editor/common/iconListV2.js +60 -616
  111. package/dist/Editor/common/iconslist.js +17 -23
  112. package/dist/Editor/commonStyle.js +11 -417
  113. package/dist/Editor/helper/deserialize/index.js +1 -4
  114. package/dist/Editor/helper/index.js +4 -17
  115. package/dist/Editor/helper/theme.js +1 -24
  116. package/dist/Editor/hooks/useMouseMove.js +2 -5
  117. package/dist/Editor/plugins/withCustomDeleteBackward.js +4 -36
  118. package/dist/Editor/plugins/withEmbeds.js +26 -30
  119. package/dist/Editor/plugins/withHTML.js +10 -61
  120. package/dist/Editor/plugins/withLayout.js +0 -1
  121. package/dist/Editor/utils/SlateUtilityFunctions.js +12 -39
  122. package/dist/Editor/utils/brains.js +1 -1
  123. package/dist/Editor/utils/button.js +4 -4
  124. package/dist/Editor/utils/chatEditor/SlateUtilityFunctions.js +1 -26
  125. package/dist/Editor/utils/customHooks/useResize.js +4 -7
  126. package/dist/Editor/utils/customHooks/useTableResize.js +2 -6
  127. package/dist/Editor/utils/embed.js +1 -2
  128. package/dist/Editor/utils/events.js +1 -0
  129. package/dist/Editor/utils/font.js +4 -11
  130. package/dist/Editor/utils/formfield.js +4 -8
  131. package/dist/Editor/utils/helper.js +2 -103
  132. package/dist/Editor/utils/insertNewLine.js +1 -19
  133. package/dist/Editor/utils/pageSettings.js +2 -14
  134. package/dist/Editor/utils/serializeToText.js +0 -2
  135. package/dist/Editor/utils/table.js +24 -228
  136. package/package.json +2 -2
  137. package/dist/Editor/Elements/DataView/DataView.js +0 -124
  138. package/dist/Editor/Elements/DataView/DataViewButton.js +0 -23
  139. package/dist/Editor/Elements/DataView/Layouts/ColumnView.js +0 -67
  140. package/dist/Editor/Elements/DataView/Layouts/DataTypes/CheckType.js +0 -33
  141. package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/Select.js +0 -162
  142. package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/SimpleSelect.js +0 -40
  143. package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/styles.js +0 -67
  144. package/dist/Editor/Elements/DataView/Layouts/DataTypes/DateType.js +0 -35
  145. package/dist/Editor/Elements/DataView/Layouts/DataTypes/MultiSelectType.js +0 -39
  146. package/dist/Editor/Elements/DataView/Layouts/DataTypes/NumberType.js +0 -30
  147. package/dist/Editor/Elements/DataView/Layouts/DataTypes/PersonType.js +0 -30
  148. package/dist/Editor/Elements/DataView/Layouts/DataTypes/SelectType.js +0 -35
  149. package/dist/Editor/Elements/DataView/Layouts/DataTypes/TextType.js +0 -36
  150. package/dist/Editor/Elements/DataView/Layouts/DataTypes/index.js +0 -17
  151. package/dist/Editor/Elements/DataView/Layouts/FilterSort/SortOptions/ChooseField.js +0 -29
  152. package/dist/Editor/Elements/DataView/Layouts/FilterSort/SortOptions/ChooseSort.js +0 -38
  153. package/dist/Editor/Elements/DataView/Layouts/FilterSort/SortOptions/index.js +0 -74
  154. package/dist/Editor/Elements/DataView/Layouts/FilterSort/index.js +0 -64
  155. package/dist/Editor/Elements/DataView/Layouts/FilterSort/styles.js +0 -106
  156. package/dist/Editor/Elements/DataView/Layouts/FilterView.js +0 -174
  157. package/dist/Editor/Elements/DataView/Layouts/Formula.js +0 -29
  158. package/dist/Editor/Elements/DataView/Layouts/Options/AddOptions.js +0 -113
  159. package/dist/Editor/Elements/DataView/Layouts/Options/AddProperty.js +0 -37
  160. package/dist/Editor/Elements/DataView/Layouts/Options/AllProperties.js +0 -111
  161. package/dist/Editor/Elements/DataView/Layouts/Options/ChangeProperty.js +0 -60
  162. package/dist/Editor/Elements/DataView/Layouts/Options/ColumnsList.js +0 -36
  163. package/dist/Editor/Elements/DataView/Layouts/Options/Constants.js +0 -101
  164. package/dist/Editor/Elements/DataView/Layouts/Options/EditOption.js +0 -160
  165. package/dist/Editor/Elements/DataView/Layouts/Options/EditProperty.js +0 -190
  166. package/dist/Editor/Elements/DataView/Layouts/Options/FilterProperty.js +0 -42
  167. package/dist/Editor/Elements/DataView/Layouts/Options/PropertyList.js +0 -30
  168. package/dist/Editor/Elements/DataView/Layouts/Options/index.js +0 -110
  169. package/dist/Editor/Elements/DataView/Layouts/Options/styles.js +0 -179
  170. package/dist/Editor/Elements/DataView/Layouts/TableStyles.js +0 -112
  171. package/dist/Editor/Elements/DataView/Layouts/TableView.js +0 -227
  172. package/dist/Editor/Elements/DataView/Layouts/ViewData.js +0 -80
  173. package/dist/Editor/Elements/DataView/Layouts/colStyles.js +0 -10
  174. package/dist/Editor/Elements/DataView/Layouts/index.js +0 -25
  175. package/dist/Editor/Elements/DataView/Providers/DataViewProvider.js +0 -281
  176. package/dist/Editor/Elements/DataView/Utils/globalSearch.js +0 -15
  177. package/dist/Editor/Elements/DataView/Utils/multiSortRows.js +0 -74
  178. package/dist/Editor/Elements/DataView/styles.js +0 -154
  179. package/dist/Editor/Elements/Table/AddRowCol.js +0 -77
  180. package/dist/Editor/Elements/Table/DragButton.js +0 -142
  181. package/dist/Editor/Elements/Table/DragStyles.js +0 -70
  182. package/dist/Editor/Elements/Table/Draggable.js +0 -25
  183. package/dist/Editor/Elements/Table/Droppable.js +0 -53
  184. package/dist/Editor/Elements/Table/TableTool.js +0 -101
  185. package/dist/Editor/Elements/Table/tableHelper.js +0 -71
  186. package/dist/Editor/assets/svg/TableIcons.js +0 -220
  187. package/dist/Editor/common/Select/index.js +0 -20
  188. package/dist/Editor/common/Select/styles.js +0 -17
  189. package/dist/Editor/common/StyleBuilder/fieldTypes/lineSpacing.js +0 -79
  190. package/dist/Editor/helper/enforceDateFormat.js +0 -41
  191. package/dist/Editor/hooks/useTable.js +0 -210
  192. package/dist/Editor/utils/dataView.js +0 -43
@@ -1,220 +0,0 @@
1
- import React from "react";
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
- import { jsxs as _jsxs } from "react/jsx-runtime";
4
- export function PaintIcon() {
5
- return /*#__PURE__*/_jsxs("svg", {
6
- width: "22",
7
- height: "22",
8
- viewBox: "0 0 22 22",
9
- fill: "none",
10
- xmlns: "http://www.w3.org/2000/svg",
11
- children: [/*#__PURE__*/_jsx("path", {
12
- d: "M6.42594 16.4984L2.75011 12.8226C1.52177 11.5943 1.52177 10.3751 2.75011 9.14676L8.87344 3.02344L15.6109 9.76097C15.9501 10.1001 15.9501 10.6501 15.6109 10.9893L10.0926 16.5076C8.88261 17.7176 7.65427 17.7176 6.42594 16.4984Z",
13
- stroke: "#64748B",
14
- strokeWidth: "1.5",
15
- strokeMiterlimit: "10",
16
- strokeLinecap: "round",
17
- strokeLinejoin: "round"
18
- }), /*#__PURE__*/_jsx("path", {
19
- d: "M7.65405 1.78906L8.88239 3.01736",
20
- stroke: "#64748B",
21
- strokeWidth: "1.5",
22
- strokeMiterlimit: "10",
23
- strokeLinecap: "round",
24
- strokeLinejoin: "round"
25
- }), /*#__PURE__*/_jsx("path", {
26
- d: "M1.89746 10.9253L15.7575 10.3203",
27
- stroke: "#64748B",
28
- strokeWidth: "1.5",
29
- strokeMiterlimit: "10",
30
- strokeLinecap: "round",
31
- strokeLinejoin: "round"
32
- }), /*#__PURE__*/_jsx("path", {
33
- d: "M2.75 20.168H14.6667",
34
- stroke: "#64748B",
35
- strokeWidth: "1.5",
36
- strokeMiterlimit: "10",
37
- strokeLinecap: "round",
38
- strokeLinejoin: "round"
39
- }), /*#__PURE__*/_jsx("path", {
40
- d: "M17.2791 13.75C17.2791 13.75 15.5833 15.5925 15.5833 16.72C15.5833 17.655 16.3441 18.4158 17.2791 18.4158C18.2141 18.4158 18.9749 17.655 18.9749 16.72C18.9749 15.5925 17.2791 13.75 17.2791 13.75Z",
41
- stroke: "#64748B",
42
- strokeWidth: "1.5",
43
- strokeLinecap: "round",
44
- strokeLinejoin: "round"
45
- })]
46
- });
47
- }
48
- export function DuplicateIcon() {
49
- return /*#__PURE__*/_jsxs("svg", {
50
- width: "19",
51
- height: "19",
52
- viewBox: "0 0 19 19",
53
- fill: "none",
54
- xmlns: "http://www.w3.org/2000/svg",
55
- children: [/*#__PURE__*/_jsx("path", {
56
- d: "M12.6666 10.2112V13.5362C12.6666 16.307 11.5583 17.4154 8.78742 17.4154H5.46242C2.69159 17.4154 1.58325 16.307 1.58325 13.5362V10.2112C1.58325 7.44036 2.69159 6.33203 5.46242 6.33203H8.78742C11.5583 6.33203 12.6666 7.44036 12.6666 10.2112Z",
57
- stroke: "#64748B",
58
- strokeWidth: "1.5",
59
- strokeLinecap: "round",
60
- strokeLinejoin: "round"
61
- }), /*#__PURE__*/_jsx("path", {
62
- d: "M17.4166 5.4612V8.7862C17.4166 11.557 16.3083 12.6654 13.5374 12.6654H12.6666V10.2112C12.6666 7.44036 11.5583 6.33203 8.78742 6.33203H6.33325V5.4612C6.33325 2.69036 7.44158 1.58203 10.2124 1.58203H13.5374C16.3083 1.58203 17.4166 2.69036 17.4166 5.4612Z",
63
- stroke: "#64748B",
64
- strokeWidth: "1.5",
65
- strokeLinecap: "round",
66
- strokeLinejoin: "round"
67
- })]
68
- });
69
- }
70
- export function AboveArrow() {
71
- return /*#__PURE__*/_jsxs("svg", {
72
- width: "22",
73
- height: "22",
74
- viewBox: "0 0 22 22",
75
- fill: "none",
76
- xmlns: "http://www.w3.org/2000/svg",
77
- children: [/*#__PURE__*/_jsx("path", {
78
- d: "M16.5642 8.77344L11 3.20927L5.43588 8.77344",
79
- stroke: "#64748B",
80
- strokeWidth: "1.5",
81
- strokeMiterlimit: "10",
82
- strokeLinecap: "round",
83
- strokeLinejoin: "round"
84
- }), /*#__PURE__*/_jsx("path", {
85
- d: "M11 18.793L11 3.36547",
86
- stroke: "#64748B",
87
- strokeWidth: "1.5",
88
- strokeMiterlimit: "10",
89
- strokeLinecap: "round",
90
- strokeLinejoin: "round"
91
- })]
92
- });
93
- }
94
- export function BelowArrow() {
95
- return /*#__PURE__*/_jsxs("svg", {
96
- width: "22",
97
- height: "22",
98
- viewBox: "0 0 22 22",
99
- fill: "none",
100
- xmlns: "http://www.w3.org/2000/svg",
101
- children: [/*#__PURE__*/_jsx("path", {
102
- d: "M16.5642 13.2266L11 18.7907L5.43588 13.2266",
103
- stroke: "#64748B",
104
- strokeWidth: "1.5",
105
- strokeMiterlimit: "10",
106
- strokeLinecap: "round",
107
- strokeLinejoin: "round"
108
- }), /*#__PURE__*/_jsx("path", {
109
- d: "M11 3.20703L11 18.6345",
110
- stroke: "#64748B",
111
- strokeWidth: "1.5",
112
- strokeMiterlimit: "10",
113
- strokeLinecap: "round",
114
- strokeLinejoin: "round"
115
- })]
116
- });
117
- }
118
- export function RightArrow() {
119
- return /*#__PURE__*/_jsxs("svg", {
120
- width: "22",
121
- height: "22",
122
- viewBox: "0 0 22 22",
123
- fill: "none",
124
- xmlns: "http://www.w3.org/2000/svg",
125
- children: [/*#__PURE__*/_jsx("path", {
126
- d: "M13.2275 16.5625L18.7917 10.9983L13.2275 5.43417",
127
- stroke: "#64748B",
128
- strokeWidth: "1.5",
129
- strokeMiterlimit: "10",
130
- strokeLinecap: "round",
131
- strokeLinejoin: "round"
132
- }), /*#__PURE__*/_jsx("path", {
133
- d: "M3.20825 11H18.6358",
134
- stroke: "#64748B",
135
- strokeWidth: "1.5",
136
- strokeMiterlimit: "10",
137
- strokeLinecap: "round",
138
- strokeLinejoin: "round"
139
- })]
140
- });
141
- }
142
- export function LeftArrow() {
143
- return /*#__PURE__*/_jsxs("svg", {
144
- width: "22",
145
- height: "22",
146
- viewBox: "0 0 22 22",
147
- fill: "none",
148
- xmlns: "http://www.w3.org/2000/svg",
149
- children: [/*#__PURE__*/_jsx("path", {
150
- d: "M8.77246 16.5625L3.20829 10.9983L8.77246 5.43417",
151
- stroke: "#64748B",
152
- strokeWidth: "1.5",
153
- strokeMiterlimit: "10",
154
- strokeLinecap: "round",
155
- strokeLinejoin: "round"
156
- }), /*#__PURE__*/_jsx("path", {
157
- d: "M18.7917 11L3.36425 11",
158
- stroke: "#64748B",
159
- strokeWidth: "1.5",
160
- strokeMiterlimit: "10",
161
- strokeLinecap: "round",
162
- strokeLinejoin: "round"
163
- })]
164
- });
165
- }
166
- export function SettingsIcon() {
167
- return /*#__PURE__*/_jsxs("svg", {
168
- width: "20",
169
- height: "20",
170
- viewBox: "0 0 20 20",
171
- fill: "none",
172
- xmlns: "http://www.w3.org/2000/svg",
173
- children: [/*#__PURE__*/_jsx("path", {
174
- d: "M10 12.5C11.3807 12.5 12.5 11.3807 12.5 10C12.5 8.61929 11.3807 7.5 10 7.5C8.61929 7.5 7.5 8.61929 7.5 10C7.5 11.3807 8.61929 12.5 10 12.5Z",
175
- stroke: "#0F172A",
176
- strokeWidth: "1.5",
177
- strokeMiterlimit: "10",
178
- strokeLinecap: "round",
179
- strokeLinejoin: "round"
180
- }), /*#__PURE__*/_jsx("path", {
181
- d: "M1.66675 10.7339V9.26718C1.66675 8.40052 2.37508 7.68385 3.25008 7.68385C4.75841 7.68385 5.37508 6.61718 4.61675 5.30885C4.18341 4.55885 4.44175 3.58385 5.20008 3.15052L6.64175 2.32552C7.30008 1.93385 8.15008 2.16718 8.54175 2.82552L8.63341 2.98385C9.38341 4.29218 10.6167 4.29218 11.3751 2.98385L11.4667 2.82552C11.8584 2.16718 12.7084 1.93385 13.3667 2.32552L14.8084 3.15052C15.5667 3.58385 15.8251 4.55885 15.3917 5.30885C14.6334 6.61718 15.2501 7.68385 16.7584 7.68385C17.6251 7.68385 18.3417 8.39218 18.3417 9.26718V10.7339C18.3417 11.6005 17.6334 12.3172 16.7584 12.3172C15.2501 12.3172 14.6334 13.3838 15.3917 14.6922C15.8251 15.4505 15.5667 16.4172 14.8084 16.8505L13.3667 17.6755C12.7084 18.0672 11.8584 17.8339 11.4667 17.1755L11.3751 17.0172C10.6251 15.7089 9.39175 15.7089 8.63341 17.0172L8.54175 17.1755C8.15008 17.8339 7.30008 18.0672 6.64175 17.6755L5.20008 16.8505C4.44175 16.4172 4.18341 15.4422 4.61675 14.6922C5.37508 13.3838 4.75841 12.3172 3.25008 12.3172C2.37508 12.3172 1.66675 11.6005 1.66675 10.7339Z",
182
- stroke: "#0F172A",
183
- strokeWidth: "1.5",
184
- strokeMiterlimit: "10",
185
- strokeLinecap: "round",
186
- strokeLinejoin: "round"
187
- })]
188
- });
189
- }
190
- export function MoreIcon() {
191
- return /*#__PURE__*/_jsxs("svg", {
192
- width: "18",
193
- height: "4",
194
- viewBox: "0 0 18 4",
195
- fill: "none",
196
- xmlns: "http://www.w3.org/2000/svg",
197
- children: [/*#__PURE__*/_jsx("path", {
198
- d: "M9.99846 2.00034C9.99846 1.44825 9.55081 1.00069 8.99862 1.00069C8.44642 1.00069 7.99878 1.44825 7.99878 2.00034C7.99878 2.55244 8.44642 3 8.99862 3C9.55081 3 9.99846 2.55244 9.99846 2.00034Z",
199
- fill: "#0F172A",
200
- stroke: "#0F172A",
201
- strokeWidth: "1.5",
202
- strokeLinecap: "round",
203
- strokeLinejoin: "round"
204
- }), /*#__PURE__*/_jsx("path", {
205
- d: "M16.9972 2.00034C16.9972 1.44825 16.5496 1.00069 15.9974 1.00069C15.4452 1.00069 14.9976 1.44825 14.9976 2.00034C14.9976 2.55244 15.4452 3 15.9974 3C16.5496 3 16.9972 2.55244 16.9972 2.00034Z",
206
- fill: "#0F172A",
207
- stroke: "#0F172A",
208
- strokeWidth: "1.5",
209
- strokeLinecap: "round",
210
- strokeLinejoin: "round"
211
- }), /*#__PURE__*/_jsx("path", {
212
- d: "M2.99968 2.00034C2.99968 1.44825 2.55203 1.00069 1.99984 1.00069C1.44764 1.00069 1 1.44825 1 2.00034C1 2.55244 1.44764 3 1.99984 3C2.55203 3 2.99968 2.55244 2.99968 2.00034Z",
213
- fill: "#0F172A",
214
- stroke: "#0F172A",
215
- strokeWidth: "1.5",
216
- strokeLinecap: "round",
217
- strokeLinejoin: "round"
218
- })]
219
- });
220
- }
@@ -1,20 +0,0 @@
1
- import { Select as Core } from "@mui/material";
2
- import SelectStyles from "./styles";
3
- import { useEditorContext } from "../../hooks/useMouseMove";
4
- import { jsx as _jsx } from "react/jsx-runtime";
5
- function Select(props) {
6
- const {
7
- children,
8
- ...rest
9
- } = props;
10
- const {
11
- theme
12
- } = useEditorContext();
13
- const classes = SelectStyles(theme);
14
- return /*#__PURE__*/_jsx(Core, {
15
- MenuProps: classes.MenuProps,
16
- ...rest,
17
- children: children
18
- });
19
- }
20
- export default Select;
@@ -1,17 +0,0 @@
1
- const SelectStyles = (theme = {}) => {
2
- const {
3
- textColor,
4
- background
5
- } = theme?.palette?.editor || {};
6
- return {
7
- MenuProps: {
8
- PaperProps: {
9
- sx: {
10
- color: textColor,
11
- background
12
- }
13
- }
14
- }
15
- };
16
- };
17
- export default SelectStyles;
@@ -1,79 +0,0 @@
1
- import React, { useState } from "react";
2
- import { Grid, Slider, Typography, Box } from "@mui/material";
3
- import { getBreakPointsValue } from "../../../helper/theme";
4
- import useWindowResize from "../../../hooks/useWindowResize";
5
- import { useEditorContext } from "../../../hooks/useMouseMove";
6
- import { jsx as _jsx } from "react/jsx-runtime";
7
- import { jsxs as _jsxs } from "react/jsx-runtime";
8
- const LineSpacing = props => {
9
- const {
10
- value: val,
11
- data,
12
- onChange
13
- } = props;
14
- const {
15
- theme
16
- } = useEditorContext();
17
- const {
18
- key
19
- } = data;
20
- const [size] = useWindowResize();
21
- const pro_value = getBreakPointsValue(val, size?.device);
22
- const [value, setValue] = useState(pro_value);
23
- let breakpointValue = getBreakPointsValue(val, null);
24
- breakpointValue = typeof breakpointValue['lg'] === 'object' ? breakpointValue['lg'] : breakpointValue;
25
- useState(() => {
26
- setValue(pro_value);
27
- }, [pro_value]);
28
- const handleChange = e => {
29
- onChange({
30
- [key]: {
31
- ...breakpointValue,
32
- [size?.device]: e.target.value
33
- }
34
- });
35
- };
36
- return /*#__PURE__*/_jsxs(Grid, {
37
- item: true,
38
- xs: 12,
39
- children: [/*#__PURE__*/_jsx(Typography, {
40
- variant: "body1",
41
- color: "primary",
42
- style: {
43
- fontSize: "14px",
44
- fontWeight: 500
45
- },
46
- children: data?.label
47
- }), /*#__PURE__*/_jsxs(Grid, {
48
- container: true,
49
- wrap: "nowrap",
50
- className: "sld-wrpr",
51
- children: [/*#__PURE__*/_jsx(Slider, {
52
- className: "spacingSlider",
53
- defaultValue: value || 1.43,
54
- "aria-label": "Default",
55
- valueLabelDisplay: "auto",
56
- min: 0.5,
57
- max: 3.0,
58
- step: 0.1,
59
- name: "lineHeight",
60
- onChange: handleChange
61
- }), /*#__PURE__*/_jsx(Box, {
62
- component: "input",
63
- sx: {
64
- background: theme?.palette?.editor?.background,
65
- color: theme?.palette?.editor?.textColor
66
- },
67
- name: "lineHeight",
68
- value: pro_value,
69
- className: "sliderInput",
70
- onChange: handleChange,
71
- type: "number",
72
- placeholder: "0",
73
- disabled: true,
74
- defaultValue: pro_value || 1.43
75
- })]
76
- })]
77
- });
78
- };
79
- export default LineSpacing;
@@ -1,41 +0,0 @@
1
- function enforceDateFormat(inputElement) {
2
- inputElement.addEventListener("input", event => {
3
- const input = event.target;
4
- let value = input.value;
5
-
6
- // Allow only numbers and forward slashes
7
- value = value.replace(/[^\d/]/g, "");
8
-
9
- // Enforce MM/DD/YYYY structure
10
- if (value.length > 10) {
11
- value = value.slice(0, 10);
12
- }
13
- const parts = value.split("/");
14
- if (parts.length > 1) {
15
- parts[0] = parts[0].slice(0, 2); // Limit MM to 2 digits
16
- if (parts[0] > 12) parts[0] = "12"; // Max month value
17
- }
18
-
19
- if (parts.length > 2) {
20
- parts[1] = parts[1].slice(0, 2); // Limit DD to 2 digits
21
- if (parts[1] > 31) parts[1] = "31"; // Max day value
22
- }
23
-
24
- if (parts.length > 3) {
25
- parts[2] = parts[2].slice(0, 4); // Limit YYYY to 4 digits
26
- }
27
-
28
- input.value = parts.join("/");
29
-
30
- // Optionally, validate the full date
31
- if (input.value.length === 10) {
32
- const [month, day, year] = input.value.split("/").map(Number);
33
- const isValidDate = !isNaN(Date.parse(`${year}-${month}-${day}`));
34
- if (!isValidDate) {
35
- input.value = ""; // Clear input if invalid
36
- alert("Invalid date format. Please enter a valid MM/DD/YYYY date.");
37
- }
38
- }
39
- });
40
- }
41
- export default enforceDateFormat;
@@ -1,210 +0,0 @@
1
- import { ClickAwayListener } from "@mui/material";
2
- import { createContext, useContext, useEffect, useMemo, useState } from "react";
3
- import { clearCellText } from "../utils/table";
4
- import { Editor, Element, Transforms } from "slate";
5
- import { DndContext, DragOverlay, PointerSensor, useSensor, useSensors } from "@dnd-kit/core";
6
- import { encodeToBase64, isHavingSelection } from "../utils/helper";
7
- import { serializeToText } from "../utils/serializeToText";
8
- import { createCopiedTableStructure, getRectangleBounds, tableNodeToDom } from "../Elements/Table/tableHelper";
9
-
10
- // const selectFirstCell = (tablePath, editor, updateTableSelection) => {
11
- // const firstCell = [...tablePath, 0, 0];
12
-
13
- // const end = Editor.end(editor, firstCell);
14
-
15
- // Transforms.select(editor, {
16
- // anchor: end,
17
- // focus: end,
18
- // });
19
-
20
- // updateTableSelection({
21
- // startCellPath: firstCell,
22
- // endCellPath: [],
23
- // isDragging: false,
24
- // });
25
- // };
26
- import { jsx as _jsx } from "react/jsx-runtime";
27
- import { jsxs as _jsxs } from "react/jsx-runtime";
28
- const handleDragEnd = (dragData, editor, resetAll) => {
29
- const {
30
- active,
31
- over
32
- } = dragData;
33
- if (over) {
34
- const {
35
- dragType,
36
- path: startCellPath
37
- } = active?.data?.current || {};
38
- const {
39
- path: overCellPath
40
- } = over?.data?.current || {};
41
- if (startCellPath?.length) {
42
- if (dragType === "row") {
43
- const startRowPath = startCellPath.slice(0, -1);
44
- const overRowPath = overCellPath.slice(0, -1);
45
- Transforms.moveNodes(editor, {
46
- at: startRowPath,
47
- to: overRowPath
48
- });
49
- } else {
50
- const [startCol] = startCellPath.slice(-1);
51
- const [overCol] = overCellPath.slice(-1);
52
- const [tableData] = Editor.nodes(editor, {
53
- at: startCellPath,
54
- match: n => !Editor.isEditor(n) && Element.isElement(n) && n.type === "table"
55
- });
56
- const [tableNode, tablePath] = tableData;
57
- const rows = tableNode?.rows || 0;
58
- for (let row = 0; row < rows; row++) {
59
- const startColPath = [...tablePath, row, startCol];
60
- const overColPath = [...tablePath, row, overCol];
61
- Transforms.moveNodes(editor, {
62
- at: startColPath,
63
- to: overColPath
64
- });
65
- }
66
- }
67
- resetAll();
68
- }
69
- }
70
- };
71
- const TableContext = /*#__PURE__*/createContext();
72
- export function getDefaultTableSelection() {
73
- return {
74
- startCellPath: [],
75
- endCellPath: [],
76
- isDragging: false
77
- };
78
- }
79
- export const TableProvider = ({
80
- editor,
81
- children,
82
- otherProps = {}
83
- }) => {
84
- const [hoverPath, setHoverPath] = useState(null);
85
- const [tableSelection, setTableSelection] = useState(getDefaultTableSelection());
86
- const [tableResizing, setTableResizing] = useState(null);
87
-
88
- // for the button events (like onclick,...etc) inside draggable component to work correctly
89
- const sensors = useSensors(useSensor(PointerSensor, {
90
- activationConstraint: {
91
- delay: 250,
92
- distance: 0 // throws exceeded distance error
93
- }
94
- }));
95
-
96
- const getSelectedCells = () => {
97
- return getRectangleBounds(tableSelection);
98
- };
99
- const updateTableSelection = update => {
100
- setTableSelection(prev => ({
101
- ...prev,
102
- ...update
103
- }));
104
- };
105
- const resetAll = () => {
106
- setTableSelection(getDefaultTableSelection());
107
- Transforms.deselect(editor);
108
-
109
- // hide drag icons after drag completion
110
- setTimeout(() => setHoverPath(null), 200);
111
- };
112
- const values = useMemo(() => {
113
- return {
114
- hoverPath,
115
- setHoverPath,
116
- editor,
117
- getSelectedCells,
118
- updateTableSelection,
119
- tableSelection,
120
- tableResizing,
121
- setTableResizing,
122
- otherProps,
123
- resetAll
124
- };
125
- }, [hoverPath, editor?.selection, tableSelection, tableResizing]);
126
- useEffect(() => {
127
- let isTextSelected;
128
- const handleKeyDown = event => {
129
- const isCutKey = (event.ctrlKey || event.metaKey) && event.key === "x";
130
- if (isCutKey) {
131
- isTextSelected = isHavingSelection(editor);
132
- } else if (event.key === "Backspace") {
133
- const selectedCells = getSelectedCells();
134
- if (selectedCells?.length > 1) {
135
- selectedCells.forEach(currentCellPath => {
136
- clearCellText(editor, currentCellPath);
137
- });
138
- }
139
- }
140
- };
141
- const handleCopy = (event, isCut) => {
142
- try {
143
- const isTextSelected = isHavingSelection(editor);
144
- const {
145
- startCellPath
146
- } = tableSelection || {};
147
- const customCopy = startCellPath?.length;
148
- if (customCopy && !isTextSelected) {
149
- event.preventDefault(); // Prevent default copy behavior
150
-
151
- const {
152
- tablePath
153
- } = otherProps;
154
- const [node] = Editor.node(editor, tablePath);
155
- const copiedTableNode = createCopiedTableStructure(editor, tableSelection, node, tablePath);
156
- const tableNode = [copiedTableNode];
157
- const encodedTableNode = encodeToBase64(tableNode);
158
- event.clipboardData.setData("application/x-slate-fragment", encodedTableNode);
159
- const textData = serializeToText(tableNode);
160
- event.clipboardData.setData("text/plain", textData);
161
- const tableDom = tableNodeToDom(copiedTableNode);
162
- event.clipboardData.setData("text/html", tableDom?.outerHTML);
163
- if (isCut) {
164
- clearCellText(editor, startCellPath);
165
- }
166
- }
167
- } catch (err) {
168
- console.log(err);
169
- }
170
- };
171
- const handleCut = e => {
172
- // unable to find the text selected or not here, that why handling it on handleKeyDown
173
-
174
- if (!isTextSelected) {
175
- e.preventDefault();
176
- handleCopy(e, true);
177
- }
178
- };
179
- window.addEventListener("keydown", handleKeyDown);
180
- window.addEventListener("copy", handleCopy);
181
- window.addEventListener("cut", handleCut);
182
- return () => {
183
- window.removeEventListener("keydown", handleKeyDown);
184
- window.removeEventListener("copy", handleCopy);
185
- window.removeEventListener("cut", handleCut);
186
- };
187
- }, [tableSelection, editor, tableSelection]);
188
-
189
- // useEffect(() => {
190
- // selectFirstCell(tablePath, editor, updateTableSelection);
191
- // }, []);
192
-
193
- return /*#__PURE__*/_jsx(TableContext.Provider, {
194
- value: values,
195
- children: /*#__PURE__*/_jsxs(DndContext, {
196
- sensors: sensors,
197
- onDragEnd: data => handleDragEnd(data, editor, resetAll),
198
- children: [/*#__PURE__*/_jsx(ClickAwayListener, {
199
- onClickAway: () => setTableSelection(getDefaultTableSelection()),
200
- children: /*#__PURE__*/_jsx("div", {
201
- children: children
202
- })
203
- }), /*#__PURE__*/_jsx(DragOverlay, {})]
204
- })
205
- });
206
- };
207
- function useTable() {
208
- return useContext(TableContext);
209
- }
210
- export default useTable;
@@ -1,43 +0,0 @@
1
- import { Transforms } from "slate";
2
- import insertNewLine from "./insertNewLine";
3
- const getDefaultDatView = () => ({
4
- type: "dataView",
5
- title: "",
6
- layouts: [{
7
- key: "view1",
8
- type: "table",
9
- label: "Table 1 View",
10
- value: "table1",
11
- filter: [],
12
- sort: []
13
- }],
14
- properties: [{
15
- key: "column1",
16
- label: "Task",
17
- type: "text",
18
- visible: true,
19
- default: true
20
- }],
21
- rows: [{
22
- id: new Date().getTime(),
23
- column1: ""
24
- }],
25
- children: [{
26
- type: "viewData",
27
- children: [{
28
- text: ""
29
- }]
30
- }]
31
- });
32
- export const insertDataView = editor => {
33
- try {
34
- Transforms.insertNodes(editor, {
35
- ...getDefaultDatView()
36
- }, {
37
- at: editor?.selection.focus.path
38
- });
39
- insertNewLine(editor);
40
- } catch (err) {
41
- console.log(err);
42
- }
43
- };