@flozy/editor 4.0.2 → 4.0.3

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 (110) hide show
  1. package/dist/Editor/ChatEditor.js +14 -9
  2. package/dist/Editor/CommonEditor.js +110 -167
  3. package/dist/Editor/Editor.css +3 -43
  4. package/dist/Editor/Elements/AI/AIInput.js +33 -31
  5. package/dist/Editor/Elements/AI/CustomSelect.js +12 -19
  6. package/dist/Editor/Elements/AI/PopoverAIInput.js +97 -73
  7. package/dist/Editor/Elements/AI/Styles.js +2 -2
  8. package/dist/Editor/Elements/AI/helper.js +3 -5
  9. package/dist/Editor/Elements/Accordion/AccordionSummary.js +4 -15
  10. package/dist/Editor/Elements/AppHeader/AppHeader.js +3 -3
  11. package/dist/Editor/Elements/Button/EditorButton.js +16 -28
  12. package/dist/Editor/Elements/Carousel/CarouselButton.js +1 -2
  13. package/dist/Editor/Elements/Color Picker/ColorButtons.js +15 -60
  14. package/dist/Editor/Elements/Color Picker/ColorPicker.css +1 -25
  15. package/dist/Editor/Elements/Color Picker/ColorPicker.js +4 -4
  16. package/dist/Editor/Elements/Color Picker/Styles.js +1 -3
  17. package/dist/Editor/Elements/Form/Workflow/FormWorkflow.js +3 -12
  18. package/dist/Editor/Elements/Form/Workflow/UserInputs.js +1 -2
  19. package/dist/Editor/Elements/Grid/Grid.js +0 -2
  20. package/dist/Editor/Elements/Grid/GridItem.js +1 -3
  21. package/dist/Editor/Elements/Link/Link.js +1 -6
  22. package/dist/Editor/Elements/Link/LinkButton.js +2 -4
  23. package/dist/Editor/Elements/Link/LinkPopup.js +14 -73
  24. package/dist/Editor/Elements/NewLine/NewLineButton.js +1 -2
  25. package/dist/Editor/Elements/Signature/Signature.css +6 -13
  26. package/dist/Editor/Elements/Signature/SignatureOptions/UploadSignature.js +1 -2
  27. package/dist/Editor/Elements/Signature/SignaturePopup.js +30 -185
  28. package/dist/Editor/Elements/SimpleText/index.js +1 -11
  29. package/dist/Editor/Elements/SimpleText/style.js +1 -1
  30. package/dist/Editor/MiniEditor.js +1 -3
  31. package/dist/Editor/Toolbar/Basic/index.js +2 -4
  32. package/dist/Editor/Toolbar/FormatTools/Dropdown.js +3 -27
  33. package/dist/Editor/Toolbar/FormatTools/MarkButton.js +2 -2
  34. package/dist/Editor/Toolbar/FormatTools/TextSize.js +13 -7
  35. package/dist/Editor/Toolbar/Mini/MiniToolbar.js +5 -34
  36. package/dist/Editor/Toolbar/PopupTool/ButtonTemplatesCard.js +13 -12
  37. package/dist/Editor/Toolbar/PopupTool/FullViewCard.js +13 -12
  38. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/CustomSelectTool.js +0 -3
  39. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectFontSize.js +11 -4
  40. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectTypography.js +86 -213
  41. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +2 -4
  42. package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +44 -123
  43. package/dist/Editor/Toolbar/PopupTool/TextFormat.js +44 -106
  44. package/dist/Editor/Toolbar/PopupTool/index.js +3 -5
  45. package/dist/Editor/Toolbar/toolbarGroups.js +11 -53
  46. package/dist/Editor/assets/svg/AIIcons.js +1 -153
  47. package/dist/Editor/common/ColorPickerButton.js +9 -25
  48. package/dist/Editor/common/DnD/DragHandleButton.js +1 -1
  49. package/dist/Editor/common/EditorIcons.js +7 -7
  50. package/dist/Editor/common/Icon.js +24 -51
  51. package/dist/Editor/common/ImageList.js +3 -16
  52. package/dist/Editor/common/ImageSelector/ImageSelector.js +9 -30
  53. package/dist/Editor/common/ImageSelector/Styles.js +1 -2
  54. package/dist/Editor/common/LinkSettings/NavComponents.js +2 -5
  55. package/dist/Editor/common/LinkSettings/index.js +2 -4
  56. package/dist/Editor/common/LinkSettings/navOptions.js +2 -7
  57. package/dist/Editor/common/LinkSettings/style.js +8 -11
  58. package/dist/Editor/common/MentionsPopup/Styles.js +1 -1
  59. package/dist/Editor/common/Shorthands/elements.js +9 -63
  60. package/dist/Editor/common/StyleBuilder/buttonStyle.js +2 -4
  61. package/dist/Editor/common/StyleBuilder/fieldTypes/bannerSpacing.js +23 -39
  62. package/dist/Editor/common/StyleBuilder/fieldTypes/borderRadius.js +23 -33
  63. package/dist/Editor/common/StyleBuilder/fieldTypes/buttonLink.js +1 -1
  64. package/dist/Editor/common/StyleBuilder/fieldTypes/color.js +7 -31
  65. package/dist/Editor/common/StyleBuilder/fieldTypes/fontSize.js +4 -13
  66. package/dist/Editor/common/StyleBuilder/fieldTypes/textOptions.js +4 -14
  67. package/dist/Editor/common/StyleBuilder/index.js +1 -1
  68. package/dist/Editor/commonStyle.js +0 -6
  69. package/dist/Editor/helper/theme.js +4 -191
  70. package/dist/Editor/hooks/useMouseMove.js +1 -4
  71. package/dist/Editor/hooks/useWindowMessage.js +7 -10
  72. package/dist/Editor/plugins/withEmbeds.js +1 -1
  73. package/dist/Editor/plugins/withHTML.js +1 -1
  74. package/dist/Editor/plugins/withTable.js +1 -1
  75. package/dist/Editor/theme/ThemeList.js +173 -50
  76. package/dist/Editor/utils/SlateUtilityFunctions.js +25 -161
  77. package/dist/Editor/utils/button.js +17 -1
  78. package/dist/Editor/utils/font.js +37 -40
  79. package/dist/Editor/utils/helper.js +1 -30
  80. package/package.json +1 -2
  81. package/dist/Editor/Elements/AI/VoiceToText/AudioWave.js +0 -73
  82. package/dist/Editor/Elements/AI/VoiceToText/index.js +0 -184
  83. package/dist/Editor/Elements/AI/VoiceToText/style.js +0 -40
  84. package/dist/Editor/Elements/Link/LinkPopupStyles.js +0 -28
  85. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectSuperSubscript.js +0 -59
  86. package/dist/Editor/Toolbar/PopupTool/ThemeTextFormat.js +0 -438
  87. package/dist/Editor/assets/svg/ThemeIcons.js +0 -291
  88. package/dist/Editor/common/CustomColorPicker/index.js +0 -106
  89. package/dist/Editor/common/CustomColorPicker/style.js +0 -53
  90. package/dist/Editor/common/CustomDialog/index.js +0 -94
  91. package/dist/Editor/common/CustomDialog/style.js +0 -67
  92. package/dist/Editor/common/CustomSelect.js +0 -33
  93. package/dist/Editor/common/iconListV2.js +0 -843
  94. package/dist/Editor/hooks/useEditorTheme.js +0 -139
  95. package/dist/Editor/theme/index.js +0 -144
  96. package/dist/Editor/themeSettings/ActiveTheme.js +0 -72
  97. package/dist/Editor/themeSettings/buttons/index.js +0 -290
  98. package/dist/Editor/themeSettings/buttons/style.js +0 -21
  99. package/dist/Editor/themeSettings/colorTheme/index.js +0 -290
  100. package/dist/Editor/themeSettings/colorTheme/style.js +0 -77
  101. package/dist/Editor/themeSettings/fonts/PreviewElement.js +0 -123
  102. package/dist/Editor/themeSettings/fonts/index.js +0 -213
  103. package/dist/Editor/themeSettings/fonts/style.js +0 -44
  104. package/dist/Editor/themeSettings/icons.js +0 -60
  105. package/dist/Editor/themeSettings/index.js +0 -320
  106. package/dist/Editor/themeSettings/style.js +0 -152
  107. package/dist/Editor/themeSettingsAI/icons.js +0 -96
  108. package/dist/Editor/themeSettingsAI/index.js +0 -356
  109. package/dist/Editor/themeSettingsAI/saveTheme.js +0 -190
  110. package/dist/Editor/themeSettingsAI/style.js +0 -247
@@ -1,184 +0,0 @@
1
- import { useState, useEffect, useRef, cloneElement } from "react";
2
- import PropTypes from "prop-types";
3
- import STTStyles from "./style";
4
- import { Grid, IconButton, Box } from "@mui/material";
5
- import { AudioWave } from "./AudioWave";
6
- import { CloseGreyCircle, PauseRecordingIcon, TickBlueCircle } from "../../../assets/svg/AIIcons";
7
- import { jsx as _jsx } from "react/jsx-runtime";
8
- import { jsxs as _jsxs } from "react/jsx-runtime";
9
- function STT(props) {
10
- const {
11
- otherProps,
12
- onSend,
13
- setIsRecording
14
- } = props;
15
- const {
16
- services
17
- } = otherProps;
18
- const classes = STTStyles();
19
- const [mediaRecorder, setMediaRecorder] = useState(null);
20
- const [audioChunks, setAudioChunks] = useState([]);
21
- const [chunkIndex, setChunkIndex] = useState(0);
22
- const audioChunksRef = useRef([]);
23
- const [transcription, setTranscription] = useState("");
24
- const [showPause, setShowPause] = useState(true);
25
- const setChunk = event => {
26
- if (event.data.size > 0) {
27
- setAudioChunks(prev => {
28
- const updatedChunks = [...prev, event.data];
29
- audioChunksRef.current = updatedChunks; // Update ref manually
30
- return updatedChunks;
31
- });
32
- }
33
- };
34
- const sendChunck = async (isLast = false) => {
35
- if (audioChunksRef.current.length > 0) {
36
- const audioBlob = new Blob(audioChunksRef.current, {
37
- type: "audio/webm"
38
- });
39
- const formData = new FormData();
40
- formData.append("audio", audioBlob, `audio_chunk_${chunkIndex}.wav`);
41
- formData.append("chunkIndex", chunkIndex); // Send chunk index to the backend
42
- if (isLast) {
43
- formData.append("isLastChunk", true); // Send chunk index to the backend
44
- } else {
45
- formData.append("isLastChunk", false);
46
- setChunkIndex(prevIndex => prevIndex + 1);
47
- }
48
- const result = await services("speechToText", {
49
- formData
50
- });
51
- setTranscription(result?.data || "");
52
- await sendChunck();
53
- }
54
- };
55
- const handleStopRecording = () => {
56
- sendChunck(true);
57
- setAudioChunks([]);
58
- };
59
- const startRecording = async () => {
60
- setTranscription("");
61
- const stream = await navigator.mediaDevices.getUserMedia({
62
- audio: true
63
- });
64
- const recorder = new MediaRecorder(stream);
65
- setMediaRecorder(recorder);
66
- recorder.ondataavailable = setChunk;
67
- recorder.onstop = handleStopRecording;
68
- recorder.start(100);
69
- setIsRecording(true);
70
- setTimeout(() => {
71
- sendChunck();
72
- }, 2000);
73
- };
74
- useEffect(() => {
75
- startRecording();
76
- }, []);
77
- const stopRecording = () => {
78
- if (mediaRecorder) {
79
- mediaRecorder.stop();
80
-
81
- // Stop all tracks to release the microphone
82
- if (mediaRecorder.stream) {
83
- mediaRecorder.stream.getTracks().forEach(track => track.stop());
84
- }
85
- setChunkIndex(0);
86
- setShowPause(false);
87
- }
88
- };
89
- const sendToInfiniti = async () => {
90
- setIsRecording(false);
91
- await onSend("", {
92
- inputValue: transcription
93
- });
94
- stopRecording();
95
- setShowPause(true);
96
- };
97
- const closeRecording = () => {
98
- setAudioChunks([]);
99
- stopRecording();
100
- setIsRecording(false);
101
- setShowPause(true);
102
- setTranscription("");
103
- };
104
- useEffect(() => {
105
- audioChunksRef.current = audioChunks;
106
- }, [audioChunks]);
107
- const transcriptionText = typeof transcription === "string" && transcription?.replace(/\s+/g, "")?.length; // Remove all whitespace characters like \n \t
108
-
109
- return /*#__PURE__*/_jsxs(Grid, {
110
- xs: 12,
111
- sx: classes.AudioVizualizerContainer,
112
- children: [transcriptionText ? /*#__PURE__*/_jsx(Grid, {
113
- xs: 12,
114
- sx: classes.TranscriptionContainer,
115
- children: /*#__PURE__*/_jsx("pre", {
116
- style: {
117
- whiteSpace: "pre-wrap",
118
- wordWrap: "break-word",
119
- fontFamily: "inherit",
120
- margin: 0
121
- },
122
- children: transcription
123
- })
124
- }) : null, /*#__PURE__*/_jsxs(Grid, {
125
- xs: 12,
126
- sx: classes.AudioVizualizerContent,
127
- children: [/*#__PURE__*/_jsx(Box, {
128
- children: /*#__PURE__*/_jsx(IconButton, {
129
- onClick: closeRecording,
130
- children: /*#__PURE__*/_jsx(CloseGreyCircle, {})
131
- })
132
- }), /*#__PURE__*/_jsx(Box, {
133
- sx: classes.AudioVisualiser,
134
- children: /*#__PURE__*/_jsx(AudioWave, {
135
- audioChunks: audioChunks
136
- })
137
- }), /*#__PURE__*/_jsx(Box, {
138
- children: showPause ? /*#__PURE__*/_jsx(IconButton, {
139
- onClick: stopRecording,
140
- children: /*#__PURE__*/_jsx(PauseRecordingIcon, {})
141
- }) : /*#__PURE__*/_jsx(IconButton, {
142
- onClick: sendToInfiniti,
143
- disabled: !transcriptionText,
144
- style: !transcriptionText ? {
145
- opacity: 0.5
146
- } : {},
147
- children: /*#__PURE__*/_jsx(TickBlueCircle, {})
148
- })
149
- })]
150
- })]
151
- });
152
- }
153
- const withHOC = STT => {
154
- const Container = props => {
155
- const classes = STTStyles();
156
- const {
157
- children
158
- } = props;
159
- const [isRecording, setIsRecording] = useState(false);
160
- return /*#__PURE__*/_jsx(Grid, {
161
- xs: 12,
162
- children: /*#__PURE__*/_jsx(Grid, {
163
- className: classes.SttContainer,
164
- children: !isRecording ? /*#__PURE__*/_jsx(Grid, {
165
- xs: 12,
166
- children: /*#__PURE__*/cloneElement(children, {
167
- startRecording: () => setIsRecording(true)
168
- })
169
- }) : /*#__PURE__*/_jsx(STT, {
170
- ...props,
171
- setIsRecording: setIsRecording
172
- })
173
- })
174
- });
175
- };
176
- return Container;
177
- };
178
- STT.defaultProps = {
179
- classes: {}
180
- };
181
- STT.propTypes = {
182
- classes: PropTypes.object
183
- };
184
- export const VoiceToText = withHOC(STT);
@@ -1,40 +0,0 @@
1
- const styles = () => ({
2
- SttContainer: {
3
- display: "flex",
4
- width: "100%",
5
- padding: "12px",
6
- zIndex: 1
7
- },
8
- STTInput: {
9
- width: "100%",
10
- borderRadius: "8px",
11
- "&& .MuiOutlinedInput-root .MuiOutlinedInput-notchedOutline": {
12
- borderColor: "#2563EB"
13
- },
14
- "&& .MuiOutlinedInput-root": {
15
- background: "rgba(252, 250, 255, 1)"
16
- }
17
- },
18
- AudioVizualizerContainer: {
19
- width: "100%",
20
- display: "flex",
21
- background: "rgba(252, 250, 255, 1)",
22
- borderRadius: "8px",
23
- border: "1px solid #2563EB",
24
- alignItems: "center",
25
- flexWrap: "wrap"
26
- },
27
- AudioVizualizerContent: {
28
- display: "flex",
29
- height: "50px",
30
- width: "100%"
31
- },
32
- AudioVisualiser: {
33
- flexGrow: "1",
34
- height: "100%"
35
- },
36
- TranscriptionContainer: {
37
- padding: "12px"
38
- }
39
- });
40
- export default styles;
@@ -1,28 +0,0 @@
1
- const LinkPopupStyles = themeType => ({
2
- addLinkField: {
3
- "& .MuiOutlinedInput-input": {
4
- fontSize: "12px",
5
- fontWeight: 500,
6
- color: themeType === "dark" ? "#FFFFFF !important" : "#000000 !important"
7
- },
8
- "& .MuiFormHelperText-root": {
9
- color: themeType === "dark" ? "#FFFFFF !important" : "#000000 !important"
10
- },
11
- "& .MuiOutlinedInput-root": {
12
- boxShadow: "0px 4px 10px rgba(0, 0, 0, 0.16)",
13
- color: themeType === "dark" ? "#FFFFFF !important" : "#000000 !important",
14
- borderRadius: "7px",
15
- "& fieldset": {
16
- borderColor: "#D8DDE1"
17
- },
18
- "&:hover fieldset": {
19
- borderColor: "#64748B"
20
- },
21
- "&.Mui-focused fieldset": {
22
- borderColor: "#2563EB"
23
- },
24
- "& .MuiFormLabel-root": {}
25
- }
26
- }
27
- });
28
- export default LinkPopupStyles;
@@ -1,59 +0,0 @@
1
- import { useMemo } from "react";
2
- import { activeMark, toggleMark } from "../../../utils/SlateUtilityFunctions";
3
- import CustomSelectTool from "./CustomSelectTool";
4
- import { jsx as _jsx } from "react/jsx-runtime";
5
- import { jsxs as _jsxs } from "react/jsx-runtime";
6
- function Label({
7
- label,
8
- type
9
- }) {
10
- return /*#__PURE__*/_jsxs("span", {
11
- children: [/*#__PURE__*/_jsx("strong", {
12
- children: label
13
- }), " ", type]
14
- });
15
- }
16
- const superSubscriptOptions = [{
17
- id: 9,
18
- format: "superscript",
19
- type: "mark",
20
- title: /*#__PURE__*/_jsx(Label, {
21
- label: "X²",
22
- type: "Superscript"
23
- }),
24
- label: "X²",
25
- group: "superSubscript",
26
- value: "superscript"
27
- }, {
28
- id: 10,
29
- format: "subscript",
30
- type: "mark",
31
- title: /*#__PURE__*/_jsx(Label, {
32
- label: "X₂",
33
- type: "Subscript"
34
- }),
35
- label: "X₂",
36
- group: "superSubscript",
37
- value: "subscript"
38
- }];
39
- function SelectSuperSubscript({
40
- editor,
41
- classes,
42
- closeMainPopup
43
- }) {
44
- const selectedMark = useMemo(() => {
45
- return superSubscriptOptions.find(option => activeMark(editor, option.format));
46
- }, [editor]);
47
- const onChange = format => {
48
- toggleMark(editor, format);
49
- closeMainPopup();
50
- };
51
- return /*#__PURE__*/_jsx(CustomSelectTool, {
52
- options: superSubscriptOptions,
53
- editor: editor,
54
- onChange: onChange,
55
- value: selectedMark?.value || "superscript",
56
- classes: classes
57
- });
58
- }
59
- export default SelectSuperSubscript;