@flozy/editor 11.0.6 → 11.0.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 (160) hide show
  1. package/dist/Editor/ChatEditor.js +17 -16
  2. package/dist/Editor/CommonEditor.js +141 -28
  3. package/dist/Editor/DialogWrapper.js +31 -25
  4. package/dist/Editor/Editor.css +39 -11
  5. package/dist/Editor/Elements/AI/PopoverAIInput.js +11 -3
  6. package/dist/Editor/Elements/AI/Styles.js +1 -0
  7. package/dist/Editor/Elements/Accordion/Accordion.js +28 -22
  8. package/dist/Editor/Elements/Accordion/AccordionButton.js +12 -3
  9. package/dist/Editor/Elements/AppHeader/AppHeader.js +3 -3
  10. package/dist/Editor/Elements/Attachments/AttachmentStyles.js +16 -0
  11. package/dist/Editor/Elements/Attachments/Attachments.js +153 -11
  12. package/dist/Editor/Elements/Attachments/AttachmentsButton.js +8 -3
  13. package/dist/Editor/Elements/Button/EditorButton.js +23 -7
  14. package/dist/Editor/Elements/Color Picker/ColorButtons.js +61 -14
  15. package/dist/Editor/Elements/Color Picker/ColorPicker.css +25 -1
  16. package/dist/Editor/Elements/Color Picker/ColorPicker.js +10 -7
  17. package/dist/Editor/Elements/Color Picker/Styles.js +15 -13
  18. package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/Select.js +134 -55
  19. package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/SelectV1.js +7 -8
  20. package/dist/Editor/Elements/DataView/Layouts/DataTypes/PersonType.js +8 -3
  21. package/dist/Editor/Elements/DataView/Layouts/Options/EditProperty.js +1 -1
  22. package/dist/Editor/Elements/DataView/Layouts/TableStyles.js +1 -1
  23. package/dist/Editor/Elements/Embed/Embed.js +36 -43
  24. package/dist/Editor/Elements/Embed/Image.js +236 -23
  25. package/dist/Editor/Elements/Embed/Video.js +245 -15
  26. package/dist/Editor/Elements/Form/Form.js +35 -10
  27. package/dist/Editor/Elements/Form/FormField.js +1 -1
  28. package/dist/Editor/Elements/Form/Workflow/Styles.js +24 -22
  29. package/dist/Editor/Elements/Form/Workflow/constant.js +25 -1
  30. package/dist/Editor/Elements/FreeGrid/FreeGrid.js +31 -74
  31. package/dist/Editor/Elements/FreeGrid/FreeGridBox.js +9 -5
  32. package/dist/Editor/Elements/FreeGrid/FreeGridItem.js +3 -1
  33. package/dist/Editor/Elements/FreeGrid/Options/More.js +7 -7
  34. package/dist/Editor/Elements/FreeGrid/helper.js +194 -0
  35. package/dist/Editor/Elements/FreeGrid/styles.js +15 -0
  36. package/dist/Editor/Elements/Grid/GridItem.js +1 -1
  37. package/dist/Editor/Elements/PageSettings/PageSettingsButton.js +2 -1
  38. package/dist/Editor/Elements/Signature/SignatureOptions/TypeSignature.js +3 -2
  39. package/dist/Editor/Elements/Signature/SignaturePopup.js +24 -6
  40. package/dist/Editor/Elements/SimpleText/style.js +2 -2
  41. package/dist/Editor/Elements/Table/Table.js +5 -4
  42. package/dist/Editor/Elements/Table/TableCell.js +10 -3
  43. package/dist/Editor/Elements/Title/title.js +10 -11
  44. package/dist/Editor/Elements/TopBanner/TopBanner.js +4 -2
  45. package/dist/Editor/Elements/TopBanner/TopBannerButton.js +5 -3
  46. package/dist/Editor/Elements/Variables/VariableButton.js +10 -1
  47. package/dist/Editor/MiniEditor.js +2 -1
  48. package/dist/Editor/Styles/EditorStyles.js +23 -5
  49. package/dist/Editor/Toolbar/FormatTools/Dropdown.js +27 -3
  50. package/dist/Editor/Toolbar/FormatTools/FontFamilyAutocomplete.js +4 -3
  51. package/dist/Editor/Toolbar/FormatTools/MarkButton.js +2 -2
  52. package/dist/Editor/Toolbar/FormatTools/TextSize.js +33 -29
  53. package/dist/Editor/Toolbar/Mini/MiniToolbar.js +2 -1
  54. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/MiniColorPicker.js +4 -2
  55. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectFontSize.js +25 -23
  56. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectList.js +25 -7
  57. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectTypography.js +167 -42
  58. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +24 -8
  59. package/dist/Editor/Toolbar/PopupTool/PopperHeader.js +2 -1
  60. package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +70 -10
  61. package/dist/Editor/Toolbar/PopupTool/TextFormat.js +73 -14
  62. package/dist/Editor/Toolbar/PopupTool/ThemeTextFormat.js +439 -0
  63. package/dist/Editor/Toolbar/PopupTool/index.js +7 -4
  64. package/dist/Editor/Toolbar/toolbarGroups.js +56 -10
  65. package/dist/Editor/assets/svg/BackIcon.js +18 -0
  66. package/dist/Editor/assets/svg/ThemeIcons.js +293 -0
  67. package/dist/Editor/common/ColorPickerButton.js +38 -16
  68. package/dist/Editor/common/CustomColorPicker/index.js +130 -0
  69. package/dist/Editor/common/CustomColorPicker/style.js +53 -0
  70. package/dist/Editor/common/CustomDialog2/index.js +94 -0
  71. package/dist/Editor/common/CustomDialog2/style.js +67 -0
  72. package/dist/Editor/common/CustomSelect.js +43 -0
  73. package/dist/Editor/common/DnD/DragHandleButton.js +1 -1
  74. package/dist/Editor/common/FontLoader/FontLoader.js +4 -0
  75. package/dist/Editor/common/Icon.js +28 -0
  76. package/dist/Editor/common/ImageSelector/ImageSelector.js +45 -7
  77. package/dist/Editor/common/ImageSelector/Options/Upload.js +26 -11
  78. package/dist/Editor/common/ImageSelector/Styles.js +3 -9
  79. package/dist/Editor/common/LinkSettings/NavComponents.js +6 -2
  80. package/dist/Editor/common/MentionsPopup/index.js +9 -1
  81. package/dist/Editor/common/RnD/ElementSettings/OtherSettings/Settings.js +2 -1
  82. package/dist/Editor/common/RnD/ElementSettings/Settings/AppHeaderSettings.js +3 -2
  83. package/dist/Editor/common/RnD/ElementSettings/Settings/BoxSettings.js +3 -2
  84. package/dist/Editor/common/RnD/ElementSettings/Settings/ButtonSettings.js +3 -2
  85. package/dist/Editor/common/RnD/ElementSettings/Settings/CodeSettings.js +3 -2
  86. package/dist/Editor/common/RnD/ElementSettings/Settings/FormSettings.js +4 -2
  87. package/dist/Editor/common/RnD/ElementSettings/Settings/ImageSettings.js +20 -7
  88. package/dist/Editor/common/RnD/ElementSettings/Settings/TableSettings.js +3 -2
  89. package/dist/Editor/common/RnD/ElementSettings/Settings/TextSettings.js +9 -1
  90. package/dist/Editor/common/RnD/ElementSettings/Settings/VideoSettings.js +20 -7
  91. package/dist/Editor/common/RnD/GuideLines/styles.js +1 -1
  92. package/dist/Editor/common/RnD/SwitchViewport/SwitchViewport.js +11 -2
  93. package/dist/Editor/common/RnD/Theme/MainThemeProvider.js +17 -0
  94. package/dist/Editor/common/RnD/Theme/ViewportStimulator.js +6 -3
  95. package/dist/Editor/common/RnD/Utils/gridDropItem.js +28 -11
  96. package/dist/Editor/common/RnD/Utils/index.js +3 -1
  97. package/dist/Editor/common/RnD/VirtualElement/VirtualTextElement.js +52 -63
  98. package/dist/Editor/common/RnD/VirtualElement/helper.js +320 -130
  99. package/dist/Editor/common/RnD/VirtualElement/styles.js +22 -0
  100. package/dist/Editor/common/RnD/index.js +61 -14
  101. package/dist/Editor/common/Shorthands/elements.js +62 -4
  102. package/dist/Editor/common/StyleBuilder/buttonStyle.js +4 -2
  103. package/dist/Editor/common/StyleBuilder/embedVideoStyle.js +4 -0
  104. package/dist/Editor/common/StyleBuilder/fieldStyle.js +1 -0
  105. package/dist/Editor/common/StyleBuilder/fieldTypes/backgroundImage.js +15 -2
  106. package/dist/Editor/common/StyleBuilder/fieldTypes/bannerSpacing.js +12 -2
  107. package/dist/Editor/common/StyleBuilder/fieldTypes/borderRadius.js +15 -7
  108. package/dist/Editor/common/StyleBuilder/fieldTypes/card.js +16 -8
  109. package/dist/Editor/common/StyleBuilder/fieldTypes/color.js +36 -10
  110. package/dist/Editor/common/StyleBuilder/fieldTypes/embedUpload.js +115 -0
  111. package/dist/Editor/common/StyleBuilder/fieldTypes/fontSize.js +16 -7
  112. package/dist/Editor/common/StyleBuilder/fieldTypes/index.js +3 -1
  113. package/dist/Editor/common/StyleBuilder/fieldTypes/menusArray.js +2 -0
  114. package/dist/Editor/common/StyleBuilder/fieldTypes/text.js +1 -0
  115. package/dist/Editor/common/StyleBuilder/fieldTypes/textOptions.js +15 -7
  116. package/dist/Editor/common/StyleBuilder/formStyle.js +19 -13
  117. package/dist/Editor/common/StyleBuilder/index.js +8 -4
  118. package/dist/Editor/common/Uploader.js +125 -17
  119. package/dist/Editor/common/UploaderWithProgress.js +183 -0
  120. package/dist/Editor/common/iconslist.js +21 -0
  121. package/dist/Editor/commonStyle.js +136 -63
  122. package/dist/Editor/helper/index.js +10 -2
  123. package/dist/Editor/helper/textIndeces.js +58 -0
  124. package/dist/Editor/helper/theme.js +203 -2
  125. package/dist/Editor/hooks/useEditorTheme.js +153 -0
  126. package/dist/Editor/hooks/useMouseMove.js +9 -3
  127. package/dist/Editor/hooks/useTable.js +62 -1
  128. package/dist/Editor/hooks/useThemeValues.js +63 -0
  129. package/dist/Editor/plugins/withEmbeds.js +12 -1
  130. package/dist/Editor/plugins/withHTML.js +58 -3
  131. package/dist/Editor/plugins/withTable.js +1 -1
  132. package/dist/Editor/service/fileupload.js +70 -0
  133. package/dist/Editor/theme/ThemeList.js +50 -173
  134. package/dist/Editor/theme/index.js +149 -0
  135. package/dist/Editor/themeSettings/ActiveTheme.js +82 -0
  136. package/dist/Editor/themeSettings/buttons/index.js +300 -0
  137. package/dist/Editor/themeSettings/buttons/style.js +23 -0
  138. package/dist/Editor/themeSettings/colorTheme/index.js +310 -0
  139. package/dist/Editor/themeSettings/colorTheme/style.js +81 -0
  140. package/dist/Editor/themeSettings/fonts/PreviewElement.js +121 -0
  141. package/dist/Editor/themeSettings/fonts/index.js +240 -0
  142. package/dist/Editor/themeSettings/fonts/style.js +62 -0
  143. package/dist/Editor/themeSettings/icons.js +60 -0
  144. package/dist/Editor/themeSettings/index.js +380 -0
  145. package/dist/Editor/themeSettings/style.js +299 -0
  146. package/dist/Editor/themeSettingsAI/icons.js +96 -0
  147. package/dist/Editor/themeSettingsAI/index.js +355 -0
  148. package/dist/Editor/themeSettingsAI/saveTheme.js +202 -0
  149. package/dist/Editor/themeSettingsAI/style.js +332 -0
  150. package/dist/Editor/utils/SlateUtilityFunctions.js +192 -40
  151. package/dist/Editor/utils/accordion.js +67 -39
  152. package/dist/Editor/utils/button.js +1 -17
  153. package/dist/Editor/utils/draftToSlate.js +3 -2
  154. package/dist/Editor/utils/events.js +94 -89
  155. package/dist/Editor/utils/font.js +40 -37
  156. package/dist/Editor/utils/formfield.js +2 -2
  157. package/dist/Editor/utils/helper.js +100 -23
  158. package/dist/Editor/utils/insertAppHeader.js +8 -4
  159. package/package.json +4 -4
  160. package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/MultiSelect.js +0 -454
@@ -247,6 +247,9 @@ const useFreeGridStyles = ({
247
247
  },
248
248
  "& > .simple-text": {
249
249
  display: "none"
250
+ },
251
+ "& > .edt-paragraphs": {
252
+ display: "none"
250
253
  }
251
254
  },
252
255
  "& .fgi_type_form": {
@@ -309,6 +312,12 @@ const useFreeGridStyles = ({
309
312
  "& .toolbtn.remove": {
310
313
  display: "none"
311
314
  }
315
+ },
316
+ "& .edt-headings": {
317
+ margin: "0px"
318
+ },
319
+ "& .edt-paragraphs": {
320
+ margin: "0px"
312
321
  }
313
322
  },
314
323
  "& .fgi_type_embedScript": {
@@ -350,6 +359,12 @@ const useFreeGridStyles = ({
350
359
  "& .fgi_type_text": {
351
360
  "& .edt-headings": {
352
361
  margin: "0px"
362
+ },
363
+ "& .edt-paragraphs": {
364
+ margin: "0px"
365
+ },
366
+ "& blockquote": {
367
+ margin: "0px !important"
353
368
  }
354
369
  },
355
370
  /** element toolbar hide */
@@ -292,7 +292,7 @@ const GridItem = props => {
292
292
  ...getBRProps,
293
293
  display: "flex",
294
294
  flexDirection: flexDirection || "column",
295
- background: bgColor || "transparent",
295
+ background: bgColor,
296
296
  borderColor: getBorderColor(),
297
297
  borderWidth: borderWidth || "1px",
298
298
  borderStyle: borderStyle || "solid",
@@ -46,7 +46,8 @@ const PageSettingsButton = props => {
46
46
  const onSave = data => {
47
47
  try {
48
48
  const updateData = {
49
- ...data
49
+ ...data,
50
+ isUploading: false
50
51
  };
51
52
  delete updateData.children;
52
53
  updatePageSettings(editor, updateData);
@@ -1,7 +1,7 @@
1
1
  import React, { useState } from "react";
2
2
  import { signedTextFonts } from "../../../utils/font";
3
3
  import { Grid, Button, TextField, InputAdornment, IconButton, Typography } from "@mui/material";
4
- import ClearRoundedIcon from '@mui/icons-material/ClearRounded';
4
+ import ClearRoundedIcon from "@mui/icons-material/ClearRounded";
5
5
  import { jsx as _jsx } from "react/jsx-runtime";
6
6
  import { jsxs as _jsxs } from "react/jsx-runtime";
7
7
  const TypeSignature = props => {
@@ -80,7 +80,8 @@ const TypeSignature = props => {
80
80
  children: /*#__PURE__*/_jsx(ClearRoundedIcon, {})
81
81
  })
82
82
  })
83
- }
83
+ },
84
+ autoComplete: "typeName"
84
85
  })
85
86
  })
86
87
  })
@@ -92,9 +92,17 @@ const SignaturePopup = props => {
92
92
  };
93
93
  const onChange = e => {
94
94
  e?.stopPropagation();
95
+ const {
96
+ name,
97
+ value
98
+ } = e.target;
99
+ const fieldMap = {
100
+ name: "signedBy",
101
+ email: "signedByEmail"
102
+ };
95
103
  setSignedData({
96
104
  ...signedData,
97
- [e.target.name]: e.target.value
105
+ [fieldMap[name] || name]: value
98
106
  });
99
107
  };
100
108
  const onBrushSize = val => () => {
@@ -311,15 +319,19 @@ const SignaturePopup = props => {
311
319
  xs: 12,
312
320
  children: /*#__PURE__*/_jsx(TextField, {
313
321
  fullWidth: true,
314
- id: "signedBy",
315
- name: "signedBy",
322
+ id: "name",
323
+ name: "name",
316
324
  placeholder: translation("Enter Name"),
317
325
  value: signedData.signedBy || ""
318
326
  // defaultValue={defaultName || ""}
319
327
  ,
320
328
  size: "small",
321
329
  onChange: onChange,
322
- sx: classes.signaturePopUpNameField
330
+ sx: classes.signaturePopUpNameField,
331
+ autoComplete: "name",
332
+ inputProps: {
333
+ autoComplete: "name"
334
+ }
323
335
  })
324
336
  })]
325
337
  }), /*#__PURE__*/_jsxs(Grid, {
@@ -439,14 +451,20 @@ const SignaturePopup = props => {
439
451
  item: true,
440
452
  children: /*#__PURE__*/_jsx(TextField, {
441
453
  fullWidth: true,
442
- id: "signedByEmail",
443
- name: "signedByEmail",
454
+ id: "email",
455
+ name: "email",
456
+ type: "email",
444
457
  placeholder: translation("Enter Email"),
445
458
  size: "small",
446
459
  onChange: onChange,
447
460
  sx: classes.signaturePopUpNameField,
448
461
  value: signedData.signedByEmail || ""
449
462
  // defaultValue={defaultEmail || ""}
463
+ ,
464
+ autoComplete: "email",
465
+ inputProps: {
466
+ autoComplete: "email"
467
+ }
450
468
  })
451
469
  })]
452
470
  })]
@@ -35,8 +35,8 @@ const SimpleTextStyle = ({
35
35
  height: "24px",
36
36
  overflow: "hidden",
37
37
  fontSize: "14px",
38
- display: 'inline-flex',
39
- alignItems: 'center',
38
+ display: "inline-flex",
39
+ alignItems: "center",
40
40
  "& .bg-pad-sl": {
41
41
  padding: "2px 4px 2px 4px",
42
42
  background: "transparent",
@@ -291,7 +291,8 @@ const Table = props => {
291
291
  dragRowBtnCls,
292
292
  tablePath: path,
293
293
  openSetttings,
294
- exandTools
294
+ exandTools,
295
+ tableNode: element
295
296
  },
296
297
  children: [/*#__PURE__*/_jsxs("div", {
297
298
  style: {
@@ -307,7 +308,7 @@ const Table = props => {
307
308
  onScroll: handleScroll,
308
309
  onMouseOver: onMouseOver,
309
310
  onMouseLeave: onMouseLeave,
310
- className: !hideTools.includes("add_column") ? "custom-scroll" : '',
311
+ className: "custom-scroll",
311
312
  children: [/*#__PURE__*/_jsx(TableComp, {
312
313
  className: readOnly ? "readOnly" : "",
313
314
  sx: {
@@ -345,8 +346,8 @@ const Table = props => {
345
346
  handleAction: handleAction,
346
347
  exandTools: exandTools,
347
348
  openSetttings: openSetttings,
348
- translation: translation,
349
- hideTools: hideTools
349
+ hideTools: hideTools,
350
+ translation: translation
350
351
  }), /*#__PURE__*/_jsx(MoreTableSettings, {
351
352
  exandTools: exandTools,
352
353
  handleAction: handleAction,
@@ -13,7 +13,7 @@ import { Droppable } from "./Droppable";
13
13
  import { useDndContext } from "@dnd-kit/core";
14
14
  import { getNodeWithType } from "../../utils/helper";
15
15
  import { ResizeIcon } from "../../common/iconListV2";
16
- import { isEmptyTextNode } from "../../helper";
16
+ import { getTextColor, isEmptyTextNode } from "../../helper";
17
17
  import SimpleText from "../SimpleText";
18
18
  import { jsx as _jsx } from "react/jsx-runtime";
19
19
  import { Fragment as _Fragment } from "react/jsx-runtime";
@@ -443,8 +443,10 @@ const TableCell = props => {
443
443
  };
444
444
  const showRowDragBtn = (showRowDrag || isRowDragging) && containerEle?.scrollLeft <= 0;
445
445
  const TableResizer = isMobile && hoverCol === column ? MobileResizer : Resizer;
446
+ const cellTextColor = entireTextColor || rowProps?.textColor || parentProps?.textColor;
447
+ const textStyles = cellTextColor ? getTextColor(cellTextColor) : "inherit";
446
448
  return /*#__PURE__*/_jsxs(_Fragment, {
447
- children: [/*#__PURE__*/_jsxs("td", {
449
+ children: [/*#__PURE__*/_jsxs(Box, {
448
450
  ...element.attr,
449
451
  ...attributes,
450
452
  className: `editor-table-cell ${hasSelected ? "selection" : ""}`,
@@ -455,14 +457,19 @@ const TableCell = props => {
455
457
  fontFamily: entireFontFamily || "inherit",
456
458
  fontWeight: entireFontWeight || "inherit",
457
459
  fontSize: entireTextSize || "inherit",
458
- color: entireTextColor || "inherit",
459
460
  cursor: "text",
460
461
  verticalAlign: "top",
461
462
  padding: "0px",
462
463
  ...(sizeProps || {})
463
464
  },
465
+ sx: {
466
+ '& span[data-slate-string="true"]': {
467
+ ...textStyles
468
+ }
469
+ },
464
470
  ...tbProps,
465
471
  "data-cell": path.toString(),
472
+ component: "td",
466
473
  children: [isFirstRow && currentDraggingType === "col" ? /*#__PURE__*/_jsx(Droppable, {
467
474
  ...dndProps,
468
475
  dragType: currentDraggingType,
@@ -1,8 +1,14 @@
1
1
  import React, { useEffect, useState } from "react";
2
- import { Editor, Text } from "slate";
2
+ import { Text } from "slate";
3
3
  import { useSlate } from "slate-react";
4
- import { getNodeText } from "../../utils/helper";
4
+ import { getNodeText, getNodeWithType } from "../../utils/helper";
5
5
  import { jsx as _jsx } from "react/jsx-runtime";
6
+ const isEmptyTextNode = node => {
7
+ if (Text.isText(node)) {
8
+ return !node.text.trim();
9
+ }
10
+ return false;
11
+ };
6
12
  const Title = props => {
7
13
  const {
8
14
  attributes,
@@ -31,9 +37,8 @@ const useDetectExitFromTitle = (titleNode, onSaveTitle) => {
31
37
  if (!editor.selection) return;
32
38
 
33
39
  // Get the current node where the cursor is
34
- const [nodeEntry] = Editor.nodes(editor, {
35
- at: editor.selection,
36
- match: n => n.type === "title"
40
+ const [nodeEntry] = getNodeWithType(editor, "title", {
41
+ at: editor.selection
37
42
  });
38
43
  if (nodeEntry) {
39
44
  setWasInsideTitle(true); // User was inside the title
@@ -47,10 +52,4 @@ const useDetectExitFromTitle = (titleNode, onSaveTitle) => {
47
52
  }
48
53
  }, [editor.selection]);
49
54
  return null;
50
- };
51
- const isEmptyTextNode = node => {
52
- if (Text.isText(node)) {
53
- return !node.text.trim();
54
- }
55
- return false;
56
55
  };
@@ -28,8 +28,9 @@ export const TopBannerToolbar = props => {
28
28
  }
29
29
  };
30
30
  const onSelectImage = img => {
31
+ const embedURL = typeof img === "string" ? img : img?.embedURL ? img?.embedURL : null;
31
32
  updateTopBanner(editor, {
32
- url: img
33
+ url: embedURL
33
34
  });
34
35
  handleClose();
35
36
  };
@@ -56,7 +57,8 @@ export const TopBannerToolbar = props => {
56
57
  open: open,
57
58
  onClose: handleClose,
58
59
  customProps: customProps,
59
- onSelectImage: onSelectImage
60
+ onSelectImage: onSelectImage,
61
+ disableProgress: true
60
62
  })]
61
63
  });
62
64
  };
@@ -17,9 +17,10 @@ const TopBannerButton = props => {
17
17
  translation
18
18
  } = customProps;
19
19
  const onSelectImage = url => {
20
- if (url) {
20
+ const embedURL = typeof url === "string" ? url : url?.embedURL ? url?.embedURL : null;
21
+ if (embedURL) {
21
22
  insertTopBanner(editor, {
22
- url
23
+ url: embedURL
23
24
  });
24
25
  }
25
26
  setOpen(false);
@@ -42,7 +43,8 @@ const TopBannerButton = props => {
42
43
  open: open,
43
44
  onClose: handleClose,
44
45
  customProps: customProps,
45
- onSelectImage: onSelectImage
46
+ onSelectImage: onSelectImage,
47
+ disableProgress: true
46
48
  })]
47
49
  });
48
50
  };
@@ -34,7 +34,8 @@ const VariableButton = props => {
34
34
  PaperProps: {
35
35
  style: {
36
36
  maxHeight: 300,
37
- overflowY: "auto"
37
+ overflowY: "auto",
38
+ transformOrigin: 'top left'
38
39
  },
39
40
  sx: {
40
41
  "&::-webkit-scrollbar-track": {
@@ -44,6 +45,14 @@ const VariableButton = props => {
44
45
  borderRadius: "16px"
45
46
  }
46
47
  }
48
+ },
49
+ anchorOrigin: {
50
+ vertical: 'bottom',
51
+ horizontal: 'right'
52
+ },
53
+ transformOrigin: {
54
+ vertical: 'top',
55
+ horizontal: 'right'
47
56
  }
48
57
  },
49
58
  children: [/*#__PURE__*/_jsx(MenuItem, {
@@ -45,12 +45,13 @@ const MiniEditor = props => {
45
45
  const {
46
46
  translationMock
47
47
  } = otherProps;
48
+ const dummyTranslation = () => {};
48
49
  const customProps = {
49
50
  ...(otherProps || {}),
50
51
  readOnly: isReadOnly,
51
52
  editorPlaceholder: miniEditorPlaceholder,
52
53
  page_id: id,
53
- translation: translation || translationMock
54
+ translation: translation || translationMock || dummyTranslation
54
55
  };
55
56
  const [mentions, setMentions] = useMentions({
56
57
  editor,
@@ -14,6 +14,9 @@ const editorStyles = ({
14
14
  "*": {
15
15
  boxSizing: "border-box"
16
16
  },
17
+ "& .blockQuoteComp": {
18
+ backgroundColor: `${theme?.palette?.editor?.colorBoxBg} !important`
19
+ },
17
20
  "&.iframe-editor": {
18
21
  "& .mini-tool-wrpr-ei": {
19
22
  display: "none"
@@ -133,7 +136,11 @@ const editorStyles = ({
133
136
  },
134
137
  "& .accordion-summary-collapse-btn": {
135
138
  padding: "4px",
136
- width: '5px'
139
+ width: "5px",
140
+ "& svg:hover": {
141
+ background: theme?.palette?.editor?.tv_hover_bg,
142
+ borderRadius: "4px"
143
+ }
137
144
  },
138
145
  "& .workflow-icon-btn": {
139
146
  pointerEvents: "none",
@@ -215,6 +222,17 @@ const editorStyles = ({
215
222
  borderRadius: "12px",
216
223
  "& svg": {
217
224
  marginRight: "8px"
225
+ },
226
+ "& .circularProgress-cls": {
227
+ "& svg": {
228
+ width: "15px !important",
229
+ height: "15px !important"
230
+ }
231
+ },
232
+ "& .uploadCancel": {
233
+ color: theme?.palette?.editor?.closeButtonSvgStroke,
234
+ width: "25px !important",
235
+ height: "25px !important"
218
236
  }
219
237
  },
220
238
  "& .content-editable.empty": {
@@ -242,7 +260,7 @@ const editorStyles = ({
242
260
  }
243
261
  },
244
262
  "& .section-tw": {
245
- background: 'transparent !important',
263
+ background: "transparent !important",
246
264
  "& button": {
247
265
  padding: "2px",
248
266
  borderRadius: "0px",
@@ -291,8 +309,8 @@ const editorStyles = ({
291
309
  }
292
310
  },
293
311
  "& ::selection": {
294
- background: 'rgba(35, 131, 226, 0.35)!important',
295
- color: 'inherit'
312
+ // background: 'rgba(35, 131, 226, 0.35)!important',
313
+ color: "inherit"
296
314
  },
297
315
  "&.readOnlyContainer": {
298
316
  "& .max-content": {
@@ -302,7 +320,7 @@ const editorStyles = ({
302
320
  },
303
321
  fullScreenWrapper: {
304
322
  "& .editor-wrapper": {
305
- paddingTop: '20px'
323
+ paddingTop: "20px"
306
324
  },
307
325
  "& .MuiDialog-paper, & .MuiPopover-paper": {
308
326
  background: `${theme?.palette?.editor?.background} !important`
@@ -1,8 +1,32 @@
1
1
  import React from "react";
2
2
  import { Select, MenuItem } from "@mui/material";
3
- import { addMarkData, activeMark } from "../../utils/SlateUtilityFunctions.js";
3
+ import { addMarkData, activeMark, getSelectedElementStyle } from "../../utils/SlateUtilityFunctions.js";
4
+ import { toolbarGroups } from "../toolbarGroups.js";
4
5
  import KeyboardArrowDownRoundedIcon from "@mui/icons-material/KeyboardArrowDownRounded";
6
+ import { googleFontList as defaultFonts } from "../../common/FontLoader/FontList.js";
5
7
  import { jsx as _jsx } from "react/jsx-runtime";
8
+ const allTools = toolbarGroups.flat();
9
+ const fontWeight = allTools.find(f => f.format === "fontWeight");
10
+ export const getValue = (editor, format) => {
11
+ switch (format) {
12
+ case "fontFamily":
13
+ {
14
+ const style = getSelectedElementStyle("font-family", editor, format);
15
+ return style || defaultFonts[0];
16
+ }
17
+ case "fontWeight":
18
+ {
19
+ const {
20
+ options
21
+ } = fontWeight || {};
22
+ const fontWeightStyle = getSelectedElementStyle("font-weight", editor, format);
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
+ };
6
30
  const Dropdown = ({
7
31
  classes,
8
32
  editor,
@@ -10,7 +34,7 @@ const Dropdown = ({
10
34
  options,
11
35
  width
12
36
  }) => {
13
- const value = activeMark(editor, format);
37
+ const value = activeMark(editor, format, true) || getValue(editor, format);
14
38
  const changeMarkData = (event, format) => {
15
39
  event.preventDefault();
16
40
  const value = event.target.value;
@@ -20,7 +44,7 @@ const Dropdown = ({
20
44
  });
21
45
  };
22
46
  return /*#__PURE__*/_jsx(Select, {
23
- value: value,
47
+ value: value || options?.[0]?.value,
24
48
  className: "editor-dd",
25
49
  onChange: e => changeMarkData(e, format),
26
50
  MenuProps: {
@@ -1,9 +1,10 @@
1
1
  import React from "react";
2
2
  import { Autocomplete, TextField } from "@mui/material";
3
- import { activeMark, addMarkData } from "../../utils/SlateUtilityFunctions.js";
3
+ import { addMarkData } from "../../utils/SlateUtilityFunctions.js";
4
4
  import usePopupStyle from "../PopupTool/PopupToolStyle.js";
5
5
  import { useEditorContext } from "../../hooks/useMouseMove.js";
6
- import KeyboardArrowDownRoundedIcon from '@mui/icons-material/KeyboardArrowDownRounded';
6
+ import KeyboardArrowDownRoundedIcon from "@mui/icons-material/KeyboardArrowDownRounded";
7
+ import { getValue } from "./Dropdown.js";
7
8
  import { jsx as _jsx } from "react/jsx-runtime";
8
9
  const FontFamilyAutocomplete = ({
9
10
  editor,
@@ -14,7 +15,7 @@ const FontFamilyAutocomplete = ({
14
15
  val = "",
15
16
  webFont = false
16
17
  }) => {
17
- const markValue = activeMark(editor, format);
18
+ const markValue = getValue(editor, format);
18
19
  const value = !webFont ? markValue : val;
19
20
  const changeMarkData = (event, newValue, format) => {
20
21
  if (!webFont) {
@@ -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, isMarkActive } from "../../utils/SlateUtilityFunctions.js";
4
+ import { toggleMark, isMarkBtnActive } from "../../utils/SlateUtilityFunctions.js";
5
5
  import { jsx as _jsx } from "react/jsx-runtime";
6
6
  const MarkButton = ({
7
7
  editor,
@@ -13,7 +13,7 @@ const MarkButton = ({
13
13
  translation
14
14
  } = customProps;
15
15
  return /*#__PURE__*/_jsx(Button, {
16
- active: isMarkActive(editor, format),
16
+ active: isMarkBtnActive(editor, format),
17
17
  format: format,
18
18
  onMouseDown: e => {
19
19
  e.preventDefault();
@@ -1,27 +1,36 @@
1
1
  import React, { useEffect, useRef, useState } from "react";
2
2
  import { TextField, IconButton } from "@mui/material";
3
- import { addMarkData, activeMark, isBlockActive } from "../../utils/SlateUtilityFunctions.js";
4
- import { headingMap, sizeMap } from "../../utils/font.js";
5
- import { getBreakPointsValue } from "../../helper/theme.js";
3
+ import { addMarkData, activeMark } from "../../utils/SlateUtilityFunctions.js";
4
+ import { getBreakPointsValue, getTextSizeVal } from "../../helper/theme.js";
6
5
  import useWindowResize from "../../hooks/useWindowResize.js";
7
6
  import { BREAKPOINTS_DEVICES } from "../../helper/theme.js";
8
7
  import { TextSizeDownArrow, TextSizeUpArrow } from "../../common/iconListV2.js";
9
8
  import { jsx as _jsx } from "react/jsx-runtime";
10
9
  import { jsxs as _jsxs } from "react/jsx-runtime";
11
10
  import { Fragment as _Fragment } from "react/jsx-runtime";
12
- const TextSize = ({
13
- classes,
14
- editor,
15
- format,
16
- fullWidth
17
- }) => {
18
- const [size] = useWindowResize();
19
- const val = activeMark(editor, format);
20
- const value = getBreakPointsValue(val, size?.device);
11
+ const TextSize = props => {
12
+ const {
13
+ classes,
14
+ editor,
15
+ format,
16
+ fullWidth,
17
+ fromMiniTextFormat,
18
+ setResizedSize,
19
+ resizedSize
20
+ } = props;
21
21
  const [fontSize, setFontSize] = useState();
22
+ const sizeValue = fromMiniTextFormat ? resizedSize : fontSize;
23
+ const setSizeValue = fromMiniTextFormat ? setResizedSize : setFontSize;
22
24
  const timerRef = useRef();
25
+ const [size] = useWindowResize();
26
+ const val = activeMark(editor, format);
27
+
28
+ // const noFontSize =
29
+ // val === "normal" || (typeof val === "object" && !Object.keys(val)?.length);
30
+
31
+ const value = getTextSizeVal(editor);
23
32
  useEffect(() => {
24
- setFontSize(getSizeVal());
33
+ setSizeValue(getSizeVal());
25
34
  }, [value]);
26
35
  const updateMarkData = newVal => {
27
36
  let upData = {
@@ -48,38 +57,33 @@ const TextSize = ({
48
57
  if (value) {
49
58
  let inc = parseInt(value);
50
59
  inc = inc > 200 ? 200 : inc;
60
+ setSizeValue(inc);
51
61
  updateMarkData(inc);
52
62
  } else {
53
- setFontSize(null);
63
+ setSizeValue(null);
54
64
  }
55
65
  };
56
66
  const getSizeVal = () => {
57
67
  try {
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);
68
+ return parseInt(value);
65
69
  } catch (err) {
66
70
  return "";
67
71
  }
68
72
  };
69
- const combinedOldVal = getSizeVal();
70
73
  const onIncreaseSize = () => {
71
- let inc = (combinedOldVal || 0) + 1;
72
- inc = inc > 200 ? 200 : inc;
73
- updateMarkData(inc);
74
+ const newValue = Math.min((sizeValue || 16) + 1, 200);
75
+ setSizeValue(newValue);
76
+ updateMarkData(newValue);
74
77
  };
75
78
  const onDecreaseSize = () => {
76
- const newVal = combinedOldVal - 1 < 0 ? 0 : combinedOldVal - 1;
77
- updateMarkData(newVal);
79
+ const newValue = sizeValue ? Math.max(sizeValue - 1, 1) : 16;
80
+ setSizeValue(newValue);
81
+ updateMarkData(newValue);
78
82
  };
79
83
  const onChange = e => {
80
84
  clearTimeout(timerRef.current);
81
85
  const value = e.target.value;
82
- setFontSize(value);
86
+ setSizeValue(value);
83
87
  timerRef.current = setTimeout(() => {
84
88
  onChangeSize(value);
85
89
  }, 500);
@@ -87,7 +91,7 @@ const TextSize = ({
87
91
  return /*#__PURE__*/_jsx(_Fragment, {
88
92
  children: /*#__PURE__*/_jsx(TextField, {
89
93
  sx: classes?.textSize,
90
- value: fontSize,
94
+ value: sizeValue || 16,
91
95
  onChange: onChange,
92
96
  size: "small",
93
97
  inputProps: {
@@ -215,7 +215,8 @@ const MiniToolbar = props => {
215
215
  setPopper: setPopper,
216
216
  onClose: onClose,
217
217
  search: search,
218
- onSearch: onSearch
218
+ onSearch: onSearch,
219
+ closeMainPopup: onClose
219
220
  })]
220
221
  }) : null
221
222
  })]
@@ -12,7 +12,8 @@ function MiniColorPicker(props) {
12
12
  classes,
13
13
  id,
14
14
  editor,
15
- customProps
15
+ customProps,
16
+ type
16
17
  } = props;
17
18
  const [openColorTool, setOpenColorTool] = useState(null);
18
19
  const {
@@ -38,7 +39,8 @@ function MiniColorPicker(props) {
38
39
  classes: classes,
39
40
  forMiniTool: true,
40
41
  openColorTool: openColorTool,
41
- closeColorTool: () => setOpenColorTool(null)
42
+ closeColorTool: () => setOpenColorTool(null),
43
+ type: type
42
44
  }, id)]
43
45
  });
44
46
  }