@flozy/editor 3.1.3 → 3.1.5
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.
|
@@ -83,6 +83,10 @@ const EditorButton = props => {
|
|
|
83
83
|
case "webAddress":
|
|
84
84
|
const refUrl = url ? url.includes("http") ? url : `//${url}` : "Link";
|
|
85
85
|
props.component = "a";
|
|
86
|
+
props.tabIndex = 1;
|
|
87
|
+
props.onClick = () => {
|
|
88
|
+
return false;
|
|
89
|
+
};
|
|
86
90
|
if (refUrl !== "Link") {
|
|
87
91
|
props.href = refUrl;
|
|
88
92
|
}
|
|
@@ -91,15 +95,9 @@ const EditorButton = props => {
|
|
|
91
95
|
}
|
|
92
96
|
break;
|
|
93
97
|
case "actionTrigger":
|
|
94
|
-
if (readOnly) {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
} = buttonLink || {};
|
|
98
|
-
const refUrl = url ? url.includes("http") ? url : `//${url}` : "Link";
|
|
99
|
-
props.component = "a";
|
|
100
|
-
if (refUrl !== "Link") {
|
|
101
|
-
props.href = refUrl;
|
|
102
|
-
}
|
|
98
|
+
if (!readOnly) {
|
|
99
|
+
props.component = "button";
|
|
100
|
+
props.onClick = () => {};
|
|
103
101
|
} else {
|
|
104
102
|
props.component = "button";
|
|
105
103
|
props.onClick = handleTrigger;
|
|
@@ -107,6 +105,10 @@ const EditorButton = props => {
|
|
|
107
105
|
break;
|
|
108
106
|
case "page":
|
|
109
107
|
props.component = "a";
|
|
108
|
+
props.tabIndex = 1;
|
|
109
|
+
props.onClick = () => {
|
|
110
|
+
return false;
|
|
111
|
+
};
|
|
110
112
|
const [page, section] = url.split("#");
|
|
111
113
|
props.href = page === "home" ? `#${section}` : `/${url}`;
|
|
112
114
|
if (openInNewTab) {
|
|
@@ -115,10 +117,18 @@ const EditorButton = props => {
|
|
|
115
117
|
break;
|
|
116
118
|
case "email":
|
|
117
119
|
props.component = "a";
|
|
120
|
+
props.tabIndex = 1;
|
|
121
|
+
props.onClick = () => {
|
|
122
|
+
return false;
|
|
123
|
+
};
|
|
118
124
|
props.href = `mailto:${url}`;
|
|
119
125
|
break;
|
|
120
126
|
case "phone":
|
|
121
127
|
props.component = "a";
|
|
128
|
+
props.tabIndex = 1;
|
|
129
|
+
props.onClick = () => {
|
|
130
|
+
return false;
|
|
131
|
+
};
|
|
122
132
|
props.href = `tel:${url}`;
|
|
123
133
|
break;
|
|
124
134
|
case "scrollTopOrBottom":
|
|
@@ -136,6 +146,8 @@ const EditorButton = props => {
|
|
|
136
146
|
}
|
|
137
147
|
};
|
|
138
148
|
break;
|
|
149
|
+
default:
|
|
150
|
+
return {};
|
|
139
151
|
}
|
|
140
152
|
return props;
|
|
141
153
|
};
|
|
@@ -223,7 +235,7 @@ const EditorButton = props => {
|
|
|
223
235
|
sx: {
|
|
224
236
|
display: {
|
|
225
237
|
lg: "inline",
|
|
226
|
-
xs: xsHidden ? "none" : "inline"
|
|
238
|
+
xs: xsHidden ? "none" : "inline-block"
|
|
227
239
|
},
|
|
228
240
|
"& .element-toolbar": {
|
|
229
241
|
display: "none"
|
|
@@ -236,7 +248,8 @@ const EditorButton = props => {
|
|
|
236
248
|
},
|
|
237
249
|
children: /*#__PURE__*/_jsxs("span", {
|
|
238
250
|
style: {
|
|
239
|
-
position: "relative"
|
|
251
|
+
position: "relative",
|
|
252
|
+
display: "inline-block"
|
|
240
253
|
},
|
|
241
254
|
children: [/*#__PURE__*/_jsxs(Box, {
|
|
242
255
|
sx: {
|