@flozy/editor 4.0.2 → 4.0.3
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/Editor/ChatEditor.js +14 -9
- package/dist/Editor/CommonEditor.js +110 -167
- package/dist/Editor/Editor.css +3 -43
- package/dist/Editor/Elements/AI/AIInput.js +33 -31
- package/dist/Editor/Elements/AI/CustomSelect.js +12 -19
- package/dist/Editor/Elements/AI/PopoverAIInput.js +97 -73
- package/dist/Editor/Elements/AI/Styles.js +2 -2
- package/dist/Editor/Elements/AI/helper.js +3 -5
- package/dist/Editor/Elements/Accordion/AccordionSummary.js +4 -15
- package/dist/Editor/Elements/AppHeader/AppHeader.js +3 -3
- package/dist/Editor/Elements/Button/EditorButton.js +16 -28
- package/dist/Editor/Elements/Carousel/CarouselButton.js +1 -2
- package/dist/Editor/Elements/Color Picker/ColorButtons.js +15 -60
- package/dist/Editor/Elements/Color Picker/ColorPicker.css +1 -25
- package/dist/Editor/Elements/Color Picker/ColorPicker.js +4 -4
- package/dist/Editor/Elements/Color Picker/Styles.js +1 -3
- package/dist/Editor/Elements/Form/Workflow/FormWorkflow.js +3 -12
- package/dist/Editor/Elements/Form/Workflow/UserInputs.js +1 -2
- package/dist/Editor/Elements/Grid/Grid.js +0 -2
- package/dist/Editor/Elements/Grid/GridItem.js +1 -3
- package/dist/Editor/Elements/Link/Link.js +1 -6
- package/dist/Editor/Elements/Link/LinkButton.js +2 -4
- package/dist/Editor/Elements/Link/LinkPopup.js +14 -73
- package/dist/Editor/Elements/NewLine/NewLineButton.js +1 -2
- package/dist/Editor/Elements/Signature/Signature.css +6 -13
- package/dist/Editor/Elements/Signature/SignatureOptions/UploadSignature.js +1 -2
- package/dist/Editor/Elements/Signature/SignaturePopup.js +30 -185
- package/dist/Editor/Elements/SimpleText/index.js +1 -11
- package/dist/Editor/Elements/SimpleText/style.js +1 -1
- package/dist/Editor/MiniEditor.js +1 -3
- package/dist/Editor/Toolbar/Basic/index.js +2 -4
- package/dist/Editor/Toolbar/FormatTools/Dropdown.js +3 -27
- package/dist/Editor/Toolbar/FormatTools/MarkButton.js +2 -2
- package/dist/Editor/Toolbar/FormatTools/TextSize.js +13 -7
- package/dist/Editor/Toolbar/Mini/MiniToolbar.js +5 -34
- package/dist/Editor/Toolbar/PopupTool/ButtonTemplatesCard.js +13 -12
- package/dist/Editor/Toolbar/PopupTool/FullViewCard.js +13 -12
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/CustomSelectTool.js +0 -3
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectFontSize.js +11 -4
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectTypography.js +86 -213
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +2 -4
- package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +44 -123
- package/dist/Editor/Toolbar/PopupTool/TextFormat.js +44 -106
- package/dist/Editor/Toolbar/PopupTool/index.js +3 -5
- package/dist/Editor/Toolbar/toolbarGroups.js +11 -53
- package/dist/Editor/assets/svg/AIIcons.js +1 -153
- package/dist/Editor/common/ColorPickerButton.js +9 -25
- package/dist/Editor/common/DnD/DragHandleButton.js +1 -1
- package/dist/Editor/common/EditorIcons.js +7 -7
- package/dist/Editor/common/Icon.js +24 -51
- package/dist/Editor/common/ImageList.js +3 -16
- package/dist/Editor/common/ImageSelector/ImageSelector.js +9 -30
- package/dist/Editor/common/ImageSelector/Styles.js +1 -2
- package/dist/Editor/common/LinkSettings/NavComponents.js +2 -5
- package/dist/Editor/common/LinkSettings/index.js +2 -4
- package/dist/Editor/common/LinkSettings/navOptions.js +2 -7
- package/dist/Editor/common/LinkSettings/style.js +8 -11
- package/dist/Editor/common/MentionsPopup/Styles.js +1 -1
- package/dist/Editor/common/Shorthands/elements.js +9 -63
- package/dist/Editor/common/StyleBuilder/buttonStyle.js +2 -4
- package/dist/Editor/common/StyleBuilder/fieldTypes/bannerSpacing.js +23 -39
- package/dist/Editor/common/StyleBuilder/fieldTypes/borderRadius.js +23 -33
- package/dist/Editor/common/StyleBuilder/fieldTypes/buttonLink.js +1 -1
- package/dist/Editor/common/StyleBuilder/fieldTypes/color.js +7 -31
- package/dist/Editor/common/StyleBuilder/fieldTypes/fontSize.js +4 -13
- package/dist/Editor/common/StyleBuilder/fieldTypes/textOptions.js +4 -14
- package/dist/Editor/common/StyleBuilder/index.js +1 -1
- package/dist/Editor/commonStyle.js +0 -6
- package/dist/Editor/helper/theme.js +4 -191
- package/dist/Editor/hooks/useMouseMove.js +1 -4
- package/dist/Editor/hooks/useWindowMessage.js +7 -10
- package/dist/Editor/plugins/withEmbeds.js +1 -1
- package/dist/Editor/plugins/withHTML.js +1 -1
- package/dist/Editor/plugins/withTable.js +1 -1
- package/dist/Editor/theme/ThemeList.js +173 -50
- package/dist/Editor/utils/SlateUtilityFunctions.js +25 -161
- package/dist/Editor/utils/button.js +17 -1
- package/dist/Editor/utils/font.js +37 -40
- package/dist/Editor/utils/helper.js +1 -30
- package/package.json +1 -2
- package/dist/Editor/Elements/AI/VoiceToText/AudioWave.js +0 -73
- package/dist/Editor/Elements/AI/VoiceToText/index.js +0 -184
- package/dist/Editor/Elements/AI/VoiceToText/style.js +0 -40
- package/dist/Editor/Elements/Link/LinkPopupStyles.js +0 -28
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectSuperSubscript.js +0 -59
- package/dist/Editor/Toolbar/PopupTool/ThemeTextFormat.js +0 -438
- package/dist/Editor/assets/svg/ThemeIcons.js +0 -291
- package/dist/Editor/common/CustomColorPicker/index.js +0 -106
- package/dist/Editor/common/CustomColorPicker/style.js +0 -53
- package/dist/Editor/common/CustomDialog/index.js +0 -94
- package/dist/Editor/common/CustomDialog/style.js +0 -67
- package/dist/Editor/common/CustomSelect.js +0 -33
- package/dist/Editor/common/iconListV2.js +0 -843
- package/dist/Editor/hooks/useEditorTheme.js +0 -139
- package/dist/Editor/theme/index.js +0 -144
- package/dist/Editor/themeSettings/ActiveTheme.js +0 -72
- package/dist/Editor/themeSettings/buttons/index.js +0 -290
- package/dist/Editor/themeSettings/buttons/style.js +0 -21
- package/dist/Editor/themeSettings/colorTheme/index.js +0 -290
- package/dist/Editor/themeSettings/colorTheme/style.js +0 -77
- package/dist/Editor/themeSettings/fonts/PreviewElement.js +0 -123
- package/dist/Editor/themeSettings/fonts/index.js +0 -213
- package/dist/Editor/themeSettings/fonts/style.js +0 -44
- package/dist/Editor/themeSettings/icons.js +0 -60
- package/dist/Editor/themeSettings/index.js +0 -320
- package/dist/Editor/themeSettings/style.js +0 -152
- package/dist/Editor/themeSettingsAI/icons.js +0 -96
- package/dist/Editor/themeSettingsAI/index.js +0 -356
- package/dist/Editor/themeSettingsAI/saveTheme.js +0 -190
- package/dist/Editor/themeSettingsAI/style.js +0 -247
@@ -1,5 +1,5 @@
|
|
1
1
|
import React, { useState } from "react";
|
2
|
-
import { Dialog, DialogTitle, DialogContent, DialogActions, Button, IconButton, Grid, TextField, Typography, Tabs, Tab
|
2
|
+
import { Dialog, DialogTitle, DialogContent, DialogActions, Button, IconButton, Grid, TextField, Typography, Tabs, Tab } from "@mui/material";
|
3
3
|
import CloseIcon from "@mui/icons-material/Close";
|
4
4
|
import DatePicker from "react-datepicker";
|
5
5
|
import "react-datepicker/dist/react-datepicker.css";
|
@@ -9,7 +9,6 @@ import { DrawSignature, PencilIcon, TypeSignature, UploadSignature } from "../..
|
|
9
9
|
import useCommonStyle from "../../commonStyle";
|
10
10
|
import { useEditorContext } from "../../hooks/useMouseMove";
|
11
11
|
import { validationMethods } from "../Form/FormElements/validations";
|
12
|
-
import { CalenderDownIconSignature, CalenderIconSignature } from "../../common/iconListV2";
|
13
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
14
13
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
15
14
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
@@ -33,14 +32,12 @@ const SignaturePopup = props => {
|
|
33
32
|
const [open, setOpen] = useState(false);
|
34
33
|
const [tab, setTab] = useState(0);
|
35
34
|
const SeletectedTab = SignatureOptions[tab];
|
36
|
-
const defaultName = metadata?.signatureDetails?.name;
|
37
|
-
const defaultEmail = metadata?.signatureDetails?.email;
|
38
35
|
const [signedData, setSignedData] = useState({
|
39
36
|
signedOn: new Date(),
|
40
37
|
signature: "",
|
41
38
|
signedText: "",
|
42
|
-
signedBy:
|
43
|
-
signedByEmail:
|
39
|
+
signedBy: "",
|
40
|
+
signedByEmail: ""
|
44
41
|
});
|
45
42
|
const [brush, setBrush] = useState({
|
46
43
|
size: 1,
|
@@ -136,15 +133,7 @@ const SignaturePopup = props => {
|
|
136
133
|
open: open,
|
137
134
|
onClose: handleClose,
|
138
135
|
fullWidth: true,
|
139
|
-
|
140
|
-
sx: {
|
141
|
-
borderRadius: '8px',
|
142
|
-
boxShadow: "0px 4px 10px 0px #00000029",
|
143
|
-
overflowY: tab === 0 ? "hidden" : "auto",
|
144
|
-
maxWidth: "560px",
|
145
|
-
...classes.signaturePopup
|
146
|
-
}
|
147
|
-
},
|
136
|
+
sx: classes.signaturePopup,
|
148
137
|
children: /*#__PURE__*/_jsx(Grid, {
|
149
138
|
container: true,
|
150
139
|
children: /*#__PURE__*/_jsxs(Grid, {
|
@@ -165,13 +154,9 @@ const SignaturePopup = props => {
|
|
165
154
|
item: true,
|
166
155
|
children: /*#__PURE__*/_jsx(Typography, {
|
167
156
|
variant: "h6",
|
168
|
-
className:
|
157
|
+
className: "popupTitle",
|
169
158
|
color: "primary",
|
170
|
-
|
171
|
-
fontWeight: 600,
|
172
|
-
color: "#000000"
|
173
|
-
},
|
174
|
-
children: "Signature"
|
159
|
+
children: "SIGNATURE"
|
175
160
|
})
|
176
161
|
}), /*#__PURE__*/_jsx(Grid, {
|
177
162
|
item: true,
|
@@ -211,39 +196,24 @@ const SignaturePopup = props => {
|
|
211
196
|
children: [/*#__PURE__*/_jsx(Tab, {
|
212
197
|
label: /*#__PURE__*/_jsxs(Grid, {
|
213
198
|
className: "dflex alignCenter",
|
214
|
-
children: [/*#__PURE__*/_jsx(DrawSignature, {
|
215
|
-
fill: tab === 0 ? "#2563EB" : "#A2B0B9"
|
216
|
-
}), /*#__PURE__*/_jsx("span", {
|
199
|
+
children: [/*#__PURE__*/_jsx(DrawSignature, {}), /*#__PURE__*/_jsx("span", {
|
217
200
|
className: "ml-1",
|
218
|
-
style: {
|
219
|
-
textTransform: "none"
|
220
|
-
},
|
221
201
|
children: "Draw Signature"
|
222
202
|
})]
|
223
203
|
})
|
224
204
|
}), /*#__PURE__*/_jsx(Tab, {
|
225
205
|
label: /*#__PURE__*/_jsxs(Grid, {
|
226
206
|
className: "dflex alignCenter",
|
227
|
-
children: [/*#__PURE__*/_jsx(TypeSignature, {
|
228
|
-
fill: tab === 1 ? "#2563EB" : "#A2B0B9"
|
229
|
-
}), /*#__PURE__*/_jsx("span", {
|
207
|
+
children: [/*#__PURE__*/_jsx(TypeSignature, {}), /*#__PURE__*/_jsx("span", {
|
230
208
|
className: "ml-1",
|
231
|
-
style: {
|
232
|
-
textTransform: "none"
|
233
|
-
},
|
234
209
|
children: "Type Signature"
|
235
210
|
})]
|
236
211
|
})
|
237
212
|
}), /*#__PURE__*/_jsx(Tab, {
|
238
213
|
label: /*#__PURE__*/_jsxs(Grid, {
|
239
214
|
className: "dflex alignCenter",
|
240
|
-
children: [/*#__PURE__*/_jsx(UploadSignature, {
|
241
|
-
fill: tab === 2 ? "#2563EB" : "#A2B0B9"
|
242
|
-
}), /*#__PURE__*/_jsx("span", {
|
215
|
+
children: [/*#__PURE__*/_jsx(UploadSignature, {}), /*#__PURE__*/_jsx("span", {
|
243
216
|
className: "ml-1",
|
244
|
-
style: {
|
245
|
-
textTransform: "none"
|
246
|
-
},
|
247
217
|
children: "Upload Signature"
|
248
218
|
})]
|
249
219
|
})
|
@@ -274,9 +244,7 @@ const SignaturePopup = props => {
|
|
274
244
|
xs: 6,
|
275
245
|
style: {
|
276
246
|
display: "flex",
|
277
|
-
alignItems: "center"
|
278
|
-
fontSize: "14px",
|
279
|
-
fontFamily: '"Inter", sans-serif"'
|
247
|
+
alignItems: "center"
|
280
248
|
},
|
281
249
|
children: [/*#__PURE__*/_jsx(Grid, {
|
282
250
|
style: {
|
@@ -284,11 +252,6 @@ const SignaturePopup = props => {
|
|
284
252
|
},
|
285
253
|
children: /*#__PURE__*/_jsx("label", {
|
286
254
|
htmlFor: "signedBy",
|
287
|
-
style: {
|
288
|
-
fontFamily: '"Inter", sans-serif',
|
289
|
-
fontWeight: 500,
|
290
|
-
fontSize: "14px"
|
291
|
-
},
|
292
255
|
children: "Name:"
|
293
256
|
})
|
294
257
|
}), /*#__PURE__*/_jsx(Grid, {
|
@@ -299,28 +262,8 @@ const SignaturePopup = props => {
|
|
299
262
|
id: "signedBy",
|
300
263
|
name: "signedBy",
|
301
264
|
placeholder: "Enter Name",
|
302
|
-
defaultValue: defaultName || "",
|
303
265
|
size: "small",
|
304
|
-
onChange: onChange
|
305
|
-
sx: {
|
306
|
-
'& .MuiOutlinedInput-root': {
|
307
|
-
borderRadius: '10px',
|
308
|
-
'& fieldset': {
|
309
|
-
borderColor: "1px solid #D8DDE1"
|
310
|
-
}
|
311
|
-
// '&:hover fieldset': {
|
312
|
-
// borderColor: 'yourHoverColor',
|
313
|
-
// },
|
314
|
-
// '&.Mui-focused fieldset': {
|
315
|
-
// borderColor: 'yourFocusedColor',
|
316
|
-
// },
|
317
|
-
},
|
318
|
-
|
319
|
-
'& .MuiInputBase-input::placeholder': {
|
320
|
-
fontFamily: '"Inter", sans-serif"',
|
321
|
-
fontSize: "14px"
|
322
|
-
}
|
323
|
-
}
|
266
|
+
onChange: onChange
|
324
267
|
})
|
325
268
|
})]
|
326
269
|
}), /*#__PURE__*/_jsxs(Grid, {
|
@@ -334,14 +277,8 @@ const SignaturePopup = props => {
|
|
334
277
|
style: {
|
335
278
|
marginRight: "8px"
|
336
279
|
},
|
337
|
-
xs: 2,
|
338
280
|
children: /*#__PURE__*/_jsx("label", {
|
339
281
|
htmlFor: "signedOn",
|
340
|
-
style: {
|
341
|
-
fontFamily: '"Inter", sans-serif',
|
342
|
-
fontWeight: 500,
|
343
|
-
fontSize: "14px"
|
344
|
-
},
|
345
282
|
children: "Date:"
|
346
283
|
})
|
347
284
|
}), /*#__PURE__*/_jsx(Grid, {
|
@@ -351,72 +288,23 @@ const SignaturePopup = props => {
|
|
351
288
|
},
|
352
289
|
xs: 12,
|
353
290
|
children: /*#__PURE__*/_jsx(DatePicker, {
|
354
|
-
|
291
|
+
showIcon: true,
|
292
|
+
id: "signedOn",
|
293
|
+
name: "signedOn",
|
294
|
+
selected: signedData?.signedOn ? new Date(signedData?.signedOn) : new Date(),
|
295
|
+
value: signedData?.signedOn || "",
|
296
|
+
dateFormat: "MM/dd/yyyy",
|
355
297
|
onChange: date => {
|
356
298
|
setSignedData({
|
357
299
|
...signedData,
|
358
|
-
signedOn: date
|
300
|
+
signedOn: date ? new Date(date).toISOString().split("T")[0] : ""
|
359
301
|
});
|
360
|
-
}
|
361
|
-
dateFormat: "yyyy/MM/dd",
|
362
|
-
customInput: /*#__PURE__*/_jsx(TextField, {
|
363
|
-
fullWidth: true,
|
364
|
-
name: "signedOn",
|
365
|
-
placeholder: "Select Date",
|
366
|
-
size: "small",
|
367
|
-
InputProps: {
|
368
|
-
startAdornment: /*#__PURE__*/_jsx(InputAdornment, {
|
369
|
-
position: "start",
|
370
|
-
sx: {
|
371
|
-
padding: 0,
|
372
|
-
// Remove padding around the InputAdornment
|
373
|
-
margin: 0 // Remove any margins
|
374
|
-
},
|
375
|
-
children: /*#__PURE__*/_jsx(IconButton, {
|
376
|
-
children: /*#__PURE__*/_jsx(CalenderIconSignature, {})
|
377
|
-
})
|
378
|
-
}),
|
379
|
-
endAdornment: /*#__PURE__*/_jsx(InputAdornment, {
|
380
|
-
position: "end",
|
381
|
-
children: /*#__PURE__*/_jsx(IconButton, {
|
382
|
-
children: /*#__PURE__*/_jsx(CalenderDownIconSignature, {})
|
383
|
-
})
|
384
|
-
}),
|
385
|
-
sx: {
|
386
|
-
"& .MuiOutlinedInput-notchedOutline": {
|
387
|
-
borderColor: "transparent" // Remove the internal border
|
388
|
-
},
|
389
|
-
|
390
|
-
"& .MuiInputBase-input": {
|
391
|
-
border: "none",
|
392
|
-
// Ensure no border inside the input field
|
393
|
-
padding: "4px 0",
|
394
|
-
// Adjust padding for consistency
|
395
|
-
boxShadow: "none !important",
|
396
|
-
color: "#778599 !important"
|
397
|
-
}
|
398
|
-
}
|
399
|
-
},
|
400
|
-
sx: {
|
401
|
-
"& .MuiOutlinedInput-root": {
|
402
|
-
borderRadius: "10px",
|
403
|
-
backgroundColor: "#fff",
|
404
|
-
padding: "0px !important",
|
405
|
-
"&:hover fieldset": {
|
406
|
-
borderColor: "#D8DDE1" // Keeps the border on hover only around the outer field
|
407
|
-
},
|
408
|
-
|
409
|
-
"& fieldset": {
|
410
|
-
borderColor: "#D8DDE1" // Keeps the outer border light
|
411
|
-
}
|
412
|
-
}
|
413
|
-
}
|
414
|
-
})
|
302
|
+
}
|
415
303
|
})
|
416
304
|
})]
|
417
305
|
}), /*#__PURE__*/_jsxs(Grid, {
|
418
306
|
item: true,
|
419
|
-
xs:
|
307
|
+
xs: 6,
|
420
308
|
style: {
|
421
309
|
display: "flex",
|
422
310
|
alignItems: "center"
|
@@ -425,47 +313,20 @@ const SignaturePopup = props => {
|
|
425
313
|
style: {
|
426
314
|
marginRight: "8px"
|
427
315
|
},
|
428
|
-
xs: 1,
|
429
316
|
children: /*#__PURE__*/_jsx("label", {
|
430
317
|
htmlFor: "signedByEmail",
|
431
|
-
style: {
|
432
|
-
fontFamily: '"Inter", sans-serif',
|
433
|
-
fontWeight: 500,
|
434
|
-
fontSize: "14px"
|
435
|
-
},
|
436
318
|
children: "Email:"
|
437
319
|
})
|
438
320
|
}), /*#__PURE__*/_jsx(Grid, {
|
439
|
-
container: true,
|
440
321
|
item: true,
|
441
|
-
xs:
|
322
|
+
xs: 12,
|
442
323
|
children: /*#__PURE__*/_jsx(TextField, {
|
443
324
|
fullWidth: true,
|
444
325
|
id: "signedByEmail",
|
445
326
|
name: "signedByEmail",
|
446
327
|
placeholder: "Enter Email",
|
447
328
|
size: "small",
|
448
|
-
onChange: onChange
|
449
|
-
sx: {
|
450
|
-
'& .MuiOutlinedInput-root': {
|
451
|
-
borderRadius: '10px',
|
452
|
-
'& fieldset': {
|
453
|
-
borderColor: "1px solid #D8DDE1"
|
454
|
-
}
|
455
|
-
// '&:hover fieldset': {
|
456
|
-
// borderColor: 'yourHoverColor',
|
457
|
-
// },
|
458
|
-
// '&.Mui-focused fieldset': {
|
459
|
-
// borderColor: 'yourFocusedColor',
|
460
|
-
// },
|
461
|
-
},
|
462
|
-
|
463
|
-
'& .MuiInputBase-input::placeholder': {
|
464
|
-
fontFamily: '"Inter", sans-serif"',
|
465
|
-
fontSize: "14px"
|
466
|
-
}
|
467
|
-
},
|
468
|
-
defaultValue: defaultEmail || ""
|
329
|
+
onChange: onChange
|
469
330
|
})
|
470
331
|
})]
|
471
332
|
})]
|
@@ -482,30 +343,14 @@ const SignaturePopup = props => {
|
|
482
343
|
children: [/*#__PURE__*/_jsx(Grid, {
|
483
344
|
item: true,
|
484
345
|
sx: {
|
485
|
-
mr:
|
346
|
+
mr: 4
|
486
347
|
},
|
487
|
-
children: /*#__PURE__*/
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
children: [/*#__PURE__*/_jsx("input", {
|
494
|
-
type: "color",
|
495
|
-
className: "brushcolorpic signColorPicker",
|
496
|
-
onChange: onBrushColor,
|
497
|
-
size: "4",
|
498
|
-
value: brush?.color
|
499
|
-
}), /*#__PURE__*/_jsx("span", {
|
500
|
-
style: {
|
501
|
-
marginLeft: "10px",
|
502
|
-
fontFamily: '"Inter", sans-serif',
|
503
|
-
fontSize: "14px",
|
504
|
-
fontWeight: 500,
|
505
|
-
color: "#333"
|
506
|
-
},
|
507
|
-
children: brush.color
|
508
|
-
})]
|
348
|
+
children: /*#__PURE__*/_jsx("input", {
|
349
|
+
type: "color",
|
350
|
+
className: "brushcolorpic signColorPicker",
|
351
|
+
onChange: onBrushColor,
|
352
|
+
size: "4",
|
353
|
+
value: brush?.color
|
509
354
|
})
|
510
355
|
}), /*#__PURE__*/_jsx(Grid, {
|
511
356
|
item: true,
|
@@ -536,7 +381,7 @@ const SignaturePopup = props => {
|
|
536
381
|
children: [!readOnly ? /*#__PURE__*/_jsx(Button, {
|
537
382
|
onClick: handleClear,
|
538
383
|
className: "secondaryBtn",
|
539
|
-
children: "
|
384
|
+
children: "Delete"
|
540
385
|
}) : null, /*#__PURE__*/_jsx(Button, {
|
541
386
|
onClick: handleSave,
|
542
387
|
className: `primaryBtn ${isEmpty ? "disabled" : ""}`,
|
@@ -6,7 +6,6 @@ import { isTextSelected } from "../../utils/helper";
|
|
6
6
|
import { useEditorContext } from "../../hooks/useMouseMove";
|
7
7
|
import SimpleTextStyle from "./style";
|
8
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
9
|
-
import { Fragment as _Fragment } from "react/jsx-runtime";
|
10
9
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
11
10
|
const SimpleText = props => {
|
12
11
|
const {
|
@@ -46,16 +45,7 @@ const SimpleText = props => {
|
|
46
45
|
sx: classes.root,
|
47
46
|
children: [children, openAI ? null : /*#__PURE__*/_jsx("span", {
|
48
47
|
className: "placeholder-simple-text",
|
49
|
-
children: isEmptyEditor ? editorPlaceholder || "Write Something..." : showPlaceHolder ? opacity && selected ?
|
50
|
-
children: ["Type ", /*#__PURE__*/_jsx("span", {
|
51
|
-
style: {
|
52
|
-
backgroundColor: '#F2F6FA',
|
53
|
-
padding: "0px 2px",
|
54
|
-
borderRadius: "2px"
|
55
|
-
},
|
56
|
-
children: "/"
|
57
|
-
}), " to browse elements"]
|
58
|
-
}) : "" : ""
|
48
|
+
children: isEmptyEditor ? editorPlaceholder || "Write Something..." : showPlaceHolder ? opacity && selected ? "Type / to browse elements" : "" : ""
|
59
49
|
})]
|
60
50
|
});
|
61
51
|
};
|
@@ -23,8 +23,7 @@ const MiniEditor = props => {
|
|
23
23
|
miniEditorPlaceholder,
|
24
24
|
className,
|
25
25
|
otherProps,
|
26
|
-
onSave
|
27
|
-
theme
|
26
|
+
onSave
|
28
27
|
} = props;
|
29
28
|
const {
|
30
29
|
CHARACTERS = []
|
@@ -133,7 +132,6 @@ const MiniEditor = props => {
|
|
133
132
|
editor: editor,
|
134
133
|
initialValue: content,
|
135
134
|
onChange: onChange,
|
136
|
-
theme: theme,
|
137
135
|
children: [/*#__PURE__*/_jsx(BasicToolbar, {
|
138
136
|
...props
|
139
137
|
}), /*#__PURE__*/_jsx(Editable, {
|
@@ -25,8 +25,7 @@ const BasicToolbar = props => {
|
|
25
25
|
hideTextColor = false,
|
26
26
|
hideResetIcon = true,
|
27
27
|
onResetClick = () => {}
|
28
|
-
}
|
29
|
-
theme
|
28
|
+
}
|
30
29
|
} = props;
|
31
30
|
// state
|
32
31
|
const [activeColor, setActiveColor] = useState("#000000");
|
@@ -66,8 +65,7 @@ const BasicToolbar = props => {
|
|
66
65
|
item: true,
|
67
66
|
children: /*#__PURE__*/_jsx(LinkButton, {
|
68
67
|
active: isBlockActive(editor, link.format),
|
69
|
-
editor: editor
|
70
|
-
theme: theme
|
68
|
+
editor: editor
|
71
69
|
}, link.id)
|
72
70
|
}), !hideTextColor && /*#__PURE__*/_jsx(Grid, {
|
73
71
|
item: true,
|
@@ -1,32 +1,8 @@
|
|
1
1
|
import React from "react";
|
2
2
|
import { Select, MenuItem } from "@mui/material";
|
3
|
-
import { addMarkData, activeMark
|
3
|
+
import { addMarkData, activeMark } from "../../utils/SlateUtilityFunctions.js";
|
4
4
|
import { fontFamilyMap } from "../../utils/font";
|
5
|
-
import { toolbarGroups } from "../toolbarGroups.js";
|
6
5
|
import { jsx as _jsx } from "react/jsx-runtime";
|
7
|
-
const allTools = toolbarGroups.flat();
|
8
|
-
const fontWeight = allTools.find(f => f.format === "fontWeight");
|
9
|
-
const getValue = (editor, format) => {
|
10
|
-
switch (format) {
|
11
|
-
case "fontFamily":
|
12
|
-
{
|
13
|
-
const style = getSelectedElementStyle("font-family", editor);
|
14
|
-
const val = Object.entries(fontFamilyMap).find(([key, value]) => value === style)?.[0];
|
15
|
-
return val || fontFamilyMap.PoppinsRegular;
|
16
|
-
}
|
17
|
-
case "fontWeight":
|
18
|
-
{
|
19
|
-
const {
|
20
|
-
options
|
21
|
-
} = fontWeight || {};
|
22
|
-
const fontWeightStyle = getSelectedElementStyle("font-weight", editor);
|
23
|
-
const selected = options?.find(o => o.value === fontWeightStyle || o.numVal === fontWeightStyle);
|
24
|
-
return selected?.value;
|
25
|
-
}
|
26
|
-
default:
|
27
|
-
return activeMark(editor, format);
|
28
|
-
}
|
29
|
-
};
|
30
6
|
const Dropdown = ({
|
31
7
|
classes,
|
32
8
|
editor,
|
@@ -34,7 +10,7 @@ const Dropdown = ({
|
|
34
10
|
options,
|
35
11
|
width
|
36
12
|
}) => {
|
37
|
-
const value =
|
13
|
+
const value = activeMark(editor, format);
|
38
14
|
const changeMarkData = (event, format) => {
|
39
15
|
event.preventDefault();
|
40
16
|
const value = event.target.value;
|
@@ -52,7 +28,7 @@ const Dropdown = ({
|
|
52
28
|
width: width || "100%",
|
53
29
|
height: "36px",
|
54
30
|
borderRadius: "10px",
|
55
|
-
fontSize: "
|
31
|
+
fontSize: "14px"
|
56
32
|
},
|
57
33
|
MenuProps: {
|
58
34
|
PaperProps: {
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import React from "react";
|
2
2
|
import Icon from "../../common/Icon";
|
3
3
|
import Button from "../../common/Button";
|
4
|
-
import { toggleMark,
|
4
|
+
import { toggleMark, isMarkActive } from "../../utils/SlateUtilityFunctions.js";
|
5
5
|
import { jsx as _jsx } from "react/jsx-runtime";
|
6
6
|
const MarkButton = ({
|
7
7
|
editor,
|
@@ -9,7 +9,7 @@ const MarkButton = ({
|
|
9
9
|
title
|
10
10
|
}) => {
|
11
11
|
return /*#__PURE__*/_jsx(Button, {
|
12
|
-
active:
|
12
|
+
active: isMarkActive(editor, format),
|
13
13
|
format: format,
|
14
14
|
onMouseDown: e => {
|
15
15
|
e.preventDefault();
|
@@ -1,8 +1,9 @@
|
|
1
1
|
import React, { useEffect, useRef, useState } from "react";
|
2
2
|
import { TextField, IconButton } from "@mui/material";
|
3
|
-
import { addMarkData, activeMark } from "../../utils/SlateUtilityFunctions.js";
|
3
|
+
import { addMarkData, activeMark, isBlockActive } from "../../utils/SlateUtilityFunctions.js";
|
4
|
+
import { headingMap, sizeMap } from "../../utils/font.js";
|
4
5
|
import { TextMinusIcon, TextPlusIcon } from "../../common/iconslist.js";
|
5
|
-
import { getBreakPointsValue
|
6
|
+
import { getBreakPointsValue } from "../../helper/theme.js";
|
6
7
|
import useWindowResize from "../../hooks/useWindowResize.js";
|
7
8
|
import { BREAKPOINTS_DEVICES } from "../../helper/theme.js";
|
8
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
@@ -16,8 +17,7 @@ const TextSize = ({
|
|
16
17
|
}) => {
|
17
18
|
const [size] = useWindowResize();
|
18
19
|
const val = activeMark(editor, format);
|
19
|
-
const
|
20
|
-
const value = noFontSize ? getTextSizeVal(editor) : getBreakPointsValue(val, size?.device);
|
20
|
+
const value = getBreakPointsValue(val, size?.device);
|
21
21
|
const [fontSize, setFontSize] = useState();
|
22
22
|
const timerRef = useRef();
|
23
23
|
useEffect(() => {
|
@@ -55,7 +55,13 @@ const TextSize = ({
|
|
55
55
|
};
|
56
56
|
const getSizeVal = () => {
|
57
57
|
try {
|
58
|
-
|
58
|
+
let size = `${value}`?.indexOf("px") >= 0 ? value : sizeMap[value] || value;
|
59
|
+
Object.entries(headingMap).forEach(([format, value]) => {
|
60
|
+
if (isBlockActive(editor, format) && isNaN(parseInt(size))) {
|
61
|
+
size = value;
|
62
|
+
}
|
63
|
+
});
|
64
|
+
return parseInt(size);
|
59
65
|
} catch (err) {
|
60
66
|
return "";
|
61
67
|
}
|
@@ -87,9 +93,9 @@ const TextSize = ({
|
|
87
93
|
inputProps: {
|
88
94
|
style: {
|
89
95
|
width: fullWidth ? "100%" : "30px",
|
90
|
-
|
96
|
+
textAlign: "center",
|
91
97
|
height: "19px",
|
92
|
-
fontSize: "
|
98
|
+
fontSize: "14px"
|
93
99
|
}
|
94
100
|
},
|
95
101
|
fullWidth: fullWidth,
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import React, { useEffect,
|
1
|
+
import React, { useEffect, useState } from "react";
|
2
2
|
import { useSlate } from "slate-react";
|
3
3
|
import { Box, Dialog, IconButton, Paper, Popper, Tooltip } from "@mui/material";
|
4
4
|
import MENU_OPTIONS from "./Options/Options";
|
@@ -18,11 +18,6 @@ const POPUP_TYPES = {
|
|
18
18
|
addElement: AddElements,
|
19
19
|
addTemplate: AddTemplates
|
20
20
|
};
|
21
|
-
const POPUP_OFFSETS = {
|
22
|
-
textFormat: [80, 5],
|
23
|
-
addElement: [60, 5],
|
24
|
-
addTemplate: [20, 5]
|
25
|
-
};
|
26
21
|
const FULLSCREEN_POPUP = {
|
27
22
|
addTemplate: true
|
28
23
|
};
|
@@ -49,7 +44,6 @@ const MiniToolbar = props => {
|
|
49
44
|
const {
|
50
45
|
hideTools
|
51
46
|
} = customProps;
|
52
|
-
const boxRef = useRef(null); // Add ref to get the Box element
|
53
47
|
const UPDATED_MENU_OPTIONS = MENU_OPTIONS.filter(f => (hideTools || [])?.indexOf(f.type) === -1);
|
54
48
|
const {
|
55
49
|
popupType
|
@@ -88,42 +82,26 @@ const MiniToolbar = props => {
|
|
88
82
|
};
|
89
83
|
const closePopper = data => {
|
90
84
|
setData(data);
|
91
|
-
setToolTip(false);
|
92
|
-
};
|
93
|
-
|
94
|
-
// Calculate center of Box for Popper/Modal positioning
|
95
|
-
const getBoxCenter = () => {
|
96
|
-
if (boxRef.current) {
|
97
|
-
const rect = boxRef.current.getBoundingClientRect();
|
98
|
-
return {
|
99
|
-
top: rect.top + rect.height / 2,
|
100
|
-
left: rect.left + rect.width / 2
|
101
|
-
};
|
102
|
-
}
|
103
|
-
return {
|
104
|
-
top: 0,
|
105
|
-
left: 0
|
106
|
-
};
|
85
|
+
setToolTip("false");
|
107
86
|
};
|
108
87
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
109
88
|
children: [/*#__PURE__*/_jsx(Box, {
|
110
89
|
component: "div",
|
111
90
|
className: "mini-tool-wrpr-ei",
|
112
91
|
sx: classes.root,
|
113
|
-
ref: boxRef,
|
114
92
|
children: UPDATED_MENU_OPTIONS.map(({
|
115
93
|
type,
|
116
94
|
label,
|
117
95
|
icon: Icon
|
118
96
|
}) => {
|
119
|
-
const isDisabled = popupType === type || type ===
|
97
|
+
const isDisabled = popupType === type || type === 'undo' ? !canUndo : type === 'redo' ? !canRedo : false; // for textFormat type
|
120
98
|
|
121
99
|
return /*#__PURE__*/_jsx(Tooltip, {
|
122
100
|
arrow: true,
|
123
101
|
title: label,
|
124
102
|
disableHoverListener: toolTip,
|
125
103
|
children: /*#__PURE__*/_jsx(IconButton, {
|
126
|
-
className: `${type === popper ? "active" : ""} ${type ===
|
104
|
+
className: `${type === popper ? "active" : ""} ${type === 'undo' && !canUndo || type === 'redo' && !canRedo ? "disabled" : ""}`,
|
127
105
|
onClick: handleClick(type),
|
128
106
|
disabled: isDisabled,
|
129
107
|
children: type === "page-settings" ? /*#__PURE__*/_jsx(PageSettingsButton, {
|
@@ -145,18 +123,11 @@ const MiniToolbar = props => {
|
|
145
123
|
}), /*#__PURE__*/_jsx(DialogComp, {
|
146
124
|
open: open,
|
147
125
|
onClose: onClose,
|
148
|
-
anchorEl: anchorEl
|
149
|
-
,
|
126
|
+
anchorEl: anchorEl,
|
150
127
|
placement: "top",
|
151
128
|
sx: popupStyles.popupWrapper,
|
152
129
|
className: `tools-drawer ${fullScreen ? "fullscreen" : ""}`,
|
153
130
|
fullScreen: fullScreen,
|
154
|
-
modifiers: [{
|
155
|
-
name: "offset",
|
156
|
-
options: {
|
157
|
-
offset: POPUP_OFFSETS[popper] || [0, 10] // Add some space between anchor and popper
|
158
|
-
}
|
159
|
-
}],
|
160
131
|
children: PopupComponent ? /*#__PURE__*/_jsxs(Paper, {
|
161
132
|
className: "papper-wrpr",
|
162
133
|
style: {
|