@flozy/editor 3.7.8 → 3.8.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -49,8 +49,8 @@ const ChatEditor = /*#__PURE__*/forwardRef((props, ref) => {
49
49
  if (editor) {
50
50
  insertEmoji(editor, emoji?.native, editor.selection);
51
51
  if (editor.selection) {
52
- const path = editor.selection.anchor.path;
53
- const offset = editor.selection.anchor.offset + emoji?.native.length;
52
+ // const path = editor.selection.anchor.path;
53
+ // const offset = editor.selection.anchor.offset + emoji?.native.length;
54
54
  const position = {
55
55
  anchor: {
56
56
  path: [0],
@@ -830,6 +830,17 @@ blockquote {
830
830
  text-align: center;
831
831
  }
832
832
 
833
+ .removeScroll::-webkit-outer-spin-button,
834
+ .removeScroll::-webkit-inner-spin-button {
835
+ -webkit-appearance: none;
836
+ margin: 0;
837
+ }
838
+
839
+ /* For Firefox */
840
+ .removeScroll {
841
+ -moz-appearance: textfield;
842
+ }
843
+
833
844
  .borderInput:focus-visible {
834
845
  outline: none !important;
835
846
  }
@@ -879,7 +890,7 @@ blockquote {
879
890
  }
880
891
 
881
892
  .sliderInput {
882
- width: 66px;
893
+ width: 30px;
883
894
  padding: 2px 10px;
884
895
  margin-left: 18px;
885
896
  box-shadow: 0px 4px 16px 0px #0000000d;
@@ -5,6 +5,8 @@ import AccordionTitlePopup from "./AccordionTitlePopup";
5
5
  import { IconButton, Tooltip } from "@mui/material";
6
6
  import { GridSettingsIcon } from "../../common/iconslist";
7
7
  import { useEditorSelection } from "../../hooks/useMouseMove";
8
+ import { getTRBLBreakPoints, getBreakPointsValue } from "../../helper/theme";
9
+ import { Box } from "@mui/material";
8
10
  import { jsx as _jsx } from "react/jsx-runtime";
9
11
  import { jsxs as _jsxs } from "react/jsx-runtime";
10
12
  const AccordionSummary = props => {
@@ -25,7 +27,9 @@ const AccordionSummary = props => {
25
27
  const {
26
28
  textColor,
27
29
  bgColor,
28
- borderColor
30
+ borderColor,
31
+ borderRadius,
32
+ bannerSpacing
29
33
  } = element;
30
34
  const ToolBar = () => {
31
35
  return selected && !showTool ? /*#__PURE__*/_jsx("div", {
@@ -62,16 +66,23 @@ const AccordionSummary = props => {
62
66
  const onClose = () => {
63
67
  setOpenSettings(false);
64
68
  };
65
- return /*#__PURE__*/_jsxs("div", {
69
+ return /*#__PURE__*/_jsxs(Box, {
66
70
  className: `accordion-summary-container`,
67
71
  ...attributes,
68
- style: {
72
+ sx: {
69
73
  width: "100%",
70
74
  position: "relative",
71
75
  backgroundColor: bgColor,
72
76
  border: `1px solid ${borderColor}`,
73
- color: textColor
77
+ color: textColor,
78
+ borderRadius: {
79
+ ...getBreakPointsValue(borderRadius || {}, null, "overrideBorderRadius", true)
80
+ },
81
+ padding: {
82
+ ...getTRBLBreakPoints(bannerSpacing)
83
+ }
74
84
  },
85
+ component: "div",
75
86
  children: [children, !readOnly && /*#__PURE__*/_jsx(ToolBar, {}), openSetttings ? /*#__PURE__*/_jsx(AccordionTitlePopup, {
76
87
  element: element,
77
88
  onSave: onSave,
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
2
  import { Checkbox, FormControlLabel, Grid, Slider, Typography, Box } from "@mui/material";
3
3
  import { squreStyle } from "./radiusStyle";
4
- import { getBreakPointsValue } from "../../../helper/theme";
4
+ import { getBreakPointsValue, getCustomizationValue } from "../../../helper/theme";
5
5
  import useWindowResize from "../../../hooks/useWindowResize";
6
6
  import { jsx as _jsx } from "react/jsx-runtime";
7
7
  import { jsxs as _jsxs } from "react/jsx-runtime";
@@ -78,10 +78,12 @@ const BannerSpacing = props => {
78
78
  component: "input",
79
79
  sx: classes.sapcingInput,
80
80
  name: "top",
81
- value: !lockSpacing ? "" : value?.top || 0,
82
- className: "sliderInput",
81
+ value: !lockSpacing ? "" : getCustomizationValue(value?.top),
82
+ className: "sliderInput removeScroll",
83
83
  disabled: !lockSpacing,
84
- onChange: handleChange
84
+ onChange: handleChange,
85
+ type: "number",
86
+ placeholder: "0"
85
87
  })]
86
88
  }), /*#__PURE__*/_jsx(FormControlLabel, {
87
89
  className: "ccheckbox-primary",
@@ -123,50 +125,54 @@ const BannerSpacing = props => {
123
125
  children: [/*#__PURE__*/_jsx("div", {
124
126
  className: "bannerSpaceBoxTop",
125
127
  children: /*#__PURE__*/_jsx("input", {
126
- type: "text",
128
+ type: "number",
127
129
  name: "top",
128
- value: value?.top,
129
- className: "borderInput",
130
+ value: getCustomizationValue(value?.top),
131
+ className: "borderInput removeScroll",
130
132
  style: {
131
133
  ...squreStyle.topRight
132
134
  },
133
- onChange: handleChange
135
+ onChange: handleChange,
136
+ placeholder: "0"
134
137
  })
135
138
  }), /*#__PURE__*/_jsx("div", {
136
139
  className: "bannerSpaceBoxRight",
137
140
  children: /*#__PURE__*/_jsx("input", {
138
- type: "text",
141
+ type: "number",
139
142
  name: "right",
140
- value: value?.right,
141
- className: "borderInput",
143
+ value: getCustomizationValue(value?.right),
144
+ className: "borderInput removeScroll",
142
145
  style: {
143
146
  ...squreStyle.bottomLeft
144
147
  },
145
- onChange: handleChange
148
+ onChange: handleChange,
149
+ placeholder: "0"
146
150
  })
147
151
  }), /*#__PURE__*/_jsx("div", {
148
152
  className: "bannerSpaceBoxBottom",
149
153
  children: /*#__PURE__*/_jsx("input", {
150
- type: "text",
154
+ type: "number",
151
155
  name: "bottom",
152
- value: value?.bottom,
153
- className: "borderInput",
156
+ value: getCustomizationValue(value?.bottom),
157
+ className: "borderInput removeScroll",
154
158
  style: {
155
159
  ...squreStyle.bottomRight
156
160
  },
157
- onChange: handleChange
161
+ onChange: handleChange,
162
+ placeholder: "0"
158
163
  })
159
164
  }), /*#__PURE__*/_jsx("div", {
160
165
  className: "bannerSpaceBoxLeft",
161
166
  children: /*#__PURE__*/_jsx("input", {
162
- type: "text",
167
+ type: "number",
163
168
  name: "left",
164
- className: "borderInput",
165
- value: value?.left,
169
+ className: "borderInput removeScroll",
170
+ value: getCustomizationValue(value?.left),
166
171
  style: {
167
172
  ...squreStyle.topLeft
168
173
  },
169
- onChange: handleChange
174
+ onChange: handleChange,
175
+ placeholder: "0"
170
176
  })
171
177
  })]
172
178
  })
@@ -2,7 +2,7 @@ import React from "react";
2
2
  import { Grid, Typography, Slider, FormControlLabel, Checkbox, Box } from "@mui/material";
3
3
  import { radiusStyle } from "./radiusStyle";
4
4
  import useWindowResize from "../../../hooks/useWindowResize";
5
- import { getBreakPointsValue } from "../../../helper/theme";
5
+ import { getBreakPointsValue, getCustomizationValue } from "../../../helper/theme";
6
6
  import { jsx as _jsx } from "react/jsx-runtime";
7
7
  import { jsxs as _jsxs } from "react/jsx-runtime";
8
8
  const BORDER_RADIUS_KEYS = ["topLeft", "topRight", "bottomLeft", "bottomRight"];
@@ -80,11 +80,13 @@ const BorderRadius = props => {
80
80
  }), /*#__PURE__*/_jsx(Box, {
81
81
  sx: classes.sapcingInput,
82
82
  component: "input",
83
- value: !lockRadius ? "" : value?.topLeft || 0,
84
- className: "sliderInput",
83
+ value: !lockRadius ? "" : getCustomizationValue(value?.topLeft),
84
+ className: "sliderInput removeScroll",
85
85
  name: "topLeft",
86
86
  disabled: !lockRadius,
87
- onChange: handleChange
87
+ onChange: handleChange,
88
+ type: "number",
89
+ placeholder: "0"
88
90
  })]
89
91
  }), /*#__PURE__*/_jsx(FormControlLabel, {
90
92
  className: "ccheckbox-primary",
@@ -125,10 +127,10 @@ const BorderRadius = props => {
125
127
  borderRadius: `${value?.topLeft}px ${value?.topRight}px ${value?.bottomLeft}px ${value?.bottomRight}px`
126
128
  },
127
129
  children: [/*#__PURE__*/_jsx("input", {
128
- type: "text",
130
+ type: "number",
129
131
  name: "topLeft",
130
- value: value?.topLeft,
131
- className: "borderInput",
132
+ value: getCustomizationValue(value?.topLeft),
133
+ className: "borderInput removeScroll",
132
134
  placeholder: "0",
133
135
  style: {
134
136
  ...radiusStyle.topLeft,
@@ -136,10 +138,10 @@ const BorderRadius = props => {
136
138
  },
137
139
  onChange: handleChange
138
140
  }), /*#__PURE__*/_jsx("input", {
139
- type: "text",
141
+ type: "number",
140
142
  name: "topRight",
141
- value: value?.topRight,
142
- className: "borderInput",
143
+ value: getCustomizationValue(value?.topRight),
144
+ className: "borderInput removeScroll",
143
145
  placeholder: "0",
144
146
  style: {
145
147
  ...radiusStyle.topRight,
@@ -148,10 +150,10 @@ const BorderRadius = props => {
148
150
  },
149
151
  onChange: handleChange
150
152
  }), /*#__PURE__*/_jsx("input", {
151
- type: "text",
153
+ type: "number",
152
154
  name: "bottomLeft",
153
- value: value?.bottomLeft,
154
- className: "borderInput",
155
+ value: getCustomizationValue(value?.bottomLeft),
156
+ className: "borderInput removeScroll",
155
157
  placeholder: "0",
156
158
  style: {
157
159
  ...radiusStyle.bottomLeft,
@@ -160,10 +162,10 @@ const BorderRadius = props => {
160
162
  },
161
163
  onChange: handleChange
162
164
  }), /*#__PURE__*/_jsx("input", {
163
- type: "text",
165
+ type: "number",
164
166
  name: "bottomRight",
165
- value: value?.bottomRight,
166
- className: "borderInput",
167
+ value: getCustomizationValue(value?.bottomRight),
168
+ className: "borderInput removeScroll",
167
169
  placeholder: "0",
168
170
  style: {
169
171
  ...radiusStyle.bottomRight,
@@ -97,4 +97,5 @@ export const getTRBLBreakPoints = (value, breakpoint) => {
97
97
  } catch (err) {
98
98
  console.log(err);
99
99
  }
100
- };
100
+ };
101
+ export const getCustomizationValue = value => isNaN(parseInt(value)) ? null : parseInt(value);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flozy/editor",
3
- "version": "3.7.8",
3
+ "version": "3.8.0",
4
4
  "description": "An Editor for flozy app brain",
5
5
  "files": [
6
6
  "dist"