eddyter 1.4.18 → 1.4.19
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.
- package/dist/AIChatPlugin-BUWq8ixX.js +1042 -0
- package/dist/{CombinedAutocompletGrammarPlugin-BXOz6IRb.js → CombinedAutocompletGrammarPlugin-Dq25w8tq.js} +388 -337
- package/dist/{CommentBubblePlugin-kiMehQkL.js → CommentBubblePlugin-B77d3Qq6.js} +4 -4
- package/dist/CommentPlugin-BJQyKmrN.js +212 -0
- package/dist/{NotePanelPlugin-FirMseLu.js → NotePanelPlugin-BqOdcg07.js} +3 -3
- package/dist/{TextEnhancePlugin-oXbL_F1i.js → TextEnhancePlugin-BnmdRgUu.js} +2 -2
- package/dist/assets/style.css +1 -1
- package/dist/components/AnimatedPlaceholderText.d.ts +2 -0
- package/dist/components/DividerPicker/DividerPicker.d.ts +17 -0
- package/dist/components/EditorialDivider/EditorialDividerView.d.ts +23 -0
- package/dist/components/EmojiPickerWidget/EmojiPickerWidget.d.ts +1 -1
- package/dist/components/LockedFeature/LockedFeature.d.ts +4 -0
- package/dist/components/Toolbar/styles.d.ts +19 -1
- package/dist/components/UnifiedColorPicker/UnifiedColorPicker.d.ts +1 -0
- package/dist/components/ui/button.d.ts +1 -1
- package/dist/components/ui/separator.d.ts +4 -1
- package/dist/constants.d.ts +12 -1
- package/dist/editorConfig.d.ts +7 -0
- package/dist/{generateDocxThumbnail-RE7yNAXP.js → generateDocxThumbnail-DBMxjZ83.js} +1 -1
- package/dist/{generatePdfThumbnail-CnldK2yE.js → generatePdfThumbnail-Cv2-ZCzh.js} +4 -4
- package/dist/{generateXlsxThumbnail-BpBB4ePK.js → generateXlsxThumbnail-UHmNc7Fa.js} +1 -1
- package/dist/hooks/useEditorToolbar.d.ts +1 -1
- package/dist/{index-CL0adQ5R.js → index-BaWQzoL2.js} +11 -11
- package/dist/{index-CXyZgoBl.js → index-Bex3G_eE.js} +18704 -15777
- package/dist/index-C_mjLQUF.js +796 -0
- package/dist/{index-C8ZUqYRj.js → index-ChSepytp.js} +26 -26
- package/dist/index-Cl_A9eof.js +1508 -0
- package/dist/{index-B4W_mfNI.js → index-DcHU8PlQ.js} +120 -123
- package/dist/{index-CKRp6axU.js → index-q_TW8dU1.js} +19 -19
- package/dist/index.js +7 -7
- package/dist/nodes/AsterismNode.d.ts +22 -0
- package/dist/nodes/ButtonNode.d.ts +37 -0
- package/dist/nodes/ColumnNode.d.ts +44 -0
- package/dist/nodes/ColumnsNode.d.ts +45 -0
- package/dist/nodes/EditorialFieldNode.d.ts +32 -0
- package/dist/nodes/FaqNode.d.ts +28 -0
- package/dist/nodes/ImagePlaceholderNode.d.ts +15 -0
- package/dist/nodes/LabeledRuleNode.d.ts +33 -0
- package/dist/nodes/OrnamentDividerNode.d.ts +22 -0
- package/dist/nodes/PullQuoteRulesNode.d.ts +32 -0
- package/dist/nodes/SectionNumberHeadingNode.d.ts +42 -0
- package/dist/plugins/BlockLayoutPlugin.d.ts +29 -0
- package/dist/plugins/ColumnAddButtonPlugin.d.ts +12 -0
- package/dist/plugins/CommentPlugin.commands.d.ts +1 -0
- package/dist/plugins/CustomHorizontalRulePlugin/CustomHorizontalRuleNode.d.ts +12 -2
- package/dist/plugins/CustomHorizontalRulePlugin/HorizontalRuleCustomizationDialog.d.ts +2 -1
- package/dist/plugins/CustomHorizontalRulePlugin/styles.d.ts +38 -0
- package/dist/plugins/EditorialFloatingToolbarPlugin.d.ts +8 -0
- package/dist/plugins/EditorialTypographyPlugin.d.ts +18 -0
- package/dist/plugins/PatternsPlugin.d.ts +12 -0
- package/dist/{sparkles-CTAYmQOE.js → sparkles-C-XoMho5.js} +1 -1
- package/dist/types.d.ts +11 -0
- package/dist/ui/Icons.d.ts +34 -9
- package/dist/{useVoiceToText-U0yKgS5Q.js → useVoiceToText-BzaLSbRi.js} +17 -17
- package/package.json +1 -1
- package/dist/AIChatPlugin-DsUPycjT.js +0 -872
- package/dist/CommentPlugin-DIuM-Jao.js +0 -154
- package/dist/index-DZAvLKar.js +0 -1431
- package/dist/index-F2-F96Nx.js +0 -720
- package/dist/square-CupR-YWR.js +0 -7
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { LineStyle } from './CustomHorizontalRuleNode';
|
|
2
|
+
export declare const PREDEFINED_COLORS: string[];
|
|
3
|
+
export declare const PREDEFINED_STROKES: number[];
|
|
4
|
+
export declare const STYLE_OPTIONS: {
|
|
5
|
+
value: LineStyle;
|
|
6
|
+
label: string;
|
|
7
|
+
}[];
|
|
8
|
+
export declare const DIALOG_CLASSES: {
|
|
9
|
+
content: string;
|
|
10
|
+
closeButton: string;
|
|
11
|
+
header: string;
|
|
12
|
+
headerBadgeWrapper: string;
|
|
13
|
+
headerBadgeDot: string;
|
|
14
|
+
headerBadgeText: string;
|
|
15
|
+
headerTitle: string;
|
|
16
|
+
body: string;
|
|
17
|
+
sectionContainer: string;
|
|
18
|
+
sectionHeader: string;
|
|
19
|
+
sectionLabel: string;
|
|
20
|
+
};
|
|
21
|
+
export declare const COLOR_CLASSES: {
|
|
22
|
+
customWrapper: string;
|
|
23
|
+
customPreview: string;
|
|
24
|
+
colorInput: string;
|
|
25
|
+
hexInput: string;
|
|
26
|
+
};
|
|
27
|
+
export declare const THICKNESS_CLASSES: {
|
|
28
|
+
inputWrapper: string;
|
|
29
|
+
input: string;
|
|
30
|
+
slider: string;
|
|
31
|
+
};
|
|
32
|
+
export declare const PREVIEW_CLASSES: {
|
|
33
|
+
container: string;
|
|
34
|
+
box: string;
|
|
35
|
+
};
|
|
36
|
+
export declare const FOOTER_CLASSES: {
|
|
37
|
+
container: string;
|
|
38
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Floating mini-toolbar shown when an editorial block is selected. Offers a
|
|
4
|
+
* variant picker plus Duplicate / Delete, consistent with other Eddyter blocks.
|
|
5
|
+
* (The drag handle is provided separately by DraggableBlockPlugin.)
|
|
6
|
+
*/
|
|
7
|
+
declare const EditorialFloatingToolbarPlugin: React.FC;
|
|
8
|
+
export default EditorialFloatingToolbarPlugin;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { LexicalCommand } from '../../node_modules/lexical';
|
|
2
|
+
import { AsterismVariant } from '../nodes/AsterismNode';
|
|
3
|
+
import { OrnamentVariant } from '../nodes/OrnamentDividerNode';
|
|
4
|
+
import { LabeledRuleStyle } from '../nodes/LabeledRuleNode';
|
|
5
|
+
import { SectionHeadingAlign } from '../nodes/SectionNumberHeadingNode';
|
|
6
|
+
import { PullQuoteRules } from '../nodes/PullQuoteRulesNode';
|
|
7
|
+
export declare const INSERT_ORNAMENT_DIVIDER_COMMAND: LexicalCommand<OrnamentVariant | undefined>;
|
|
8
|
+
export declare const INSERT_ASTERISM_COMMAND: LexicalCommand<AsterismVariant | undefined>;
|
|
9
|
+
export declare const INSERT_LABELED_RULE_COMMAND: LexicalCommand<LabeledRuleStyle | undefined>;
|
|
10
|
+
export declare const INSERT_SECTION_HEADING_COMMAND: LexicalCommand<SectionHeadingAlign | undefined>;
|
|
11
|
+
export declare const INSERT_PULL_QUOTE_RULES_COMMAND: LexicalCommand<PullQuoteRules | undefined>;
|
|
12
|
+
/**
|
|
13
|
+
* Registers insert commands for all editorial-typography blocks and the
|
|
14
|
+
* field-navigation behaviour (Tab between fields, Enter to advance/exit,
|
|
15
|
+
* Backspace at start to remove an empty block).
|
|
16
|
+
*/
|
|
17
|
+
declare const EditorialTypographyPlugin: React.FC;
|
|
18
|
+
export default EditorialTypographyPlugin;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { LexicalCommand } from '../../node_modules/lexical';
|
|
2
|
+
export type PatternId = "hero" | "feature" | "three" | "cta";
|
|
3
|
+
export declare const INSERT_PATTERN_COMMAND: LexicalCommand<PatternId>;
|
|
4
|
+
export interface PatternMeta {
|
|
5
|
+
id: PatternId;
|
|
6
|
+
name: string;
|
|
7
|
+
description: string;
|
|
8
|
+
}
|
|
9
|
+
/** Product-defined patterns surfaced in the slash menu. */
|
|
10
|
+
export declare const PATTERNS: PatternMeta[];
|
|
11
|
+
declare const PatternsPlugin: React.FC;
|
|
12
|
+
export default PatternsPlugin;
|
package/dist/types.d.ts
CHANGED
|
@@ -61,6 +61,10 @@ export interface ToolbarProps {
|
|
|
61
61
|
enableBugReport?: boolean;
|
|
62
62
|
enablePreview?: boolean;
|
|
63
63
|
enableHtmlCanvas?: boolean;
|
|
64
|
+
enableColumns?: boolean;
|
|
65
|
+
enableButtonBlock?: boolean;
|
|
66
|
+
enablePatterns?: boolean;
|
|
67
|
+
enableFaq?: boolean;
|
|
64
68
|
fonts?: string[];
|
|
65
69
|
editor: LexicalEditor;
|
|
66
70
|
activeEditor: LexicalEditor;
|
|
@@ -177,6 +181,13 @@ export interface EditorConfigTypes {
|
|
|
177
181
|
enableDragHandle?: boolean;
|
|
178
182
|
enablePreview?: boolean;
|
|
179
183
|
enableHtmlCanvas?: boolean;
|
|
184
|
+
enableEditorialDividers?: boolean;
|
|
185
|
+
enableSectionHeading?: boolean;
|
|
186
|
+
enablePullQuote?: boolean;
|
|
187
|
+
enableColumns?: boolean;
|
|
188
|
+
enableButtonBlock?: boolean;
|
|
189
|
+
enablePatterns?: boolean;
|
|
190
|
+
enableFaq?: boolean;
|
|
180
191
|
};
|
|
181
192
|
enableFloatingMenu: boolean;
|
|
182
193
|
htmlViewOption: boolean;
|
package/dist/ui/Icons.d.ts
CHANGED
|
@@ -4,12 +4,12 @@ declare const StrikethroughIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
|
4
4
|
declare const CodeIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
declare const LinkIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
declare const TodoIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
declare const NoteIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
declare const FaceSmileIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare const NoteIcon: (props: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
declare const FaceSmileIcon: (props: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
declare const MagicoonIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
10
10
|
declare const PerspectiveIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
11
11
|
declare const BoldIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
12
|
-
declare const PlusIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
declare const PlusIcon: (props: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
|
|
13
13
|
declare const ChevronDownIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
14
14
|
declare const SubscriptIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
15
15
|
declare const SuperscriptIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -40,7 +40,7 @@ declare const MicrophoneIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
|
40
40
|
declare const RecordingIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
41
41
|
declare const AddCommentIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
42
42
|
declare const CheckIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
43
|
-
declare const
|
|
43
|
+
declare const TextQuoteIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
44
44
|
declare const StopCircleIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
45
45
|
declare const PauseCircleIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
46
46
|
declare const PlayCircleIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -54,9 +54,9 @@ declare const Heading5Icon: () => import("react/jsx-runtime").JSX.Element;
|
|
|
54
54
|
declare const Heading6Icon: () => import("react/jsx-runtime").JSX.Element;
|
|
55
55
|
declare const TableIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
56
56
|
declare const HighlighterIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
57
|
-
declare const LightbulbIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
57
|
+
declare const LightbulbIcon: (props: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
|
|
58
58
|
declare const ClearFormattingIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
59
|
-
declare const CrossIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
59
|
+
declare const CrossIcon: (props: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
|
|
60
60
|
declare const FileIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
61
61
|
declare const AlignLeftIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
62
62
|
declare const AlignCenterIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -80,9 +80,9 @@ declare const TrashIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
|
80
80
|
declare const ExternalLinkIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
81
81
|
declare const WrapTextLeftIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
82
82
|
declare const WrapTextRightIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
83
|
-
declare const BugIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
83
|
+
declare const BugIcon: (props: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
|
|
84
84
|
declare const LockIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
85
|
-
declare const AiSparkle: () => import("react/jsx-runtime").JSX.Element;
|
|
85
|
+
declare const AiSparkle: (props: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
|
|
86
86
|
declare const CodeSquare: () => import("react/jsx-runtime").JSX.Element;
|
|
87
87
|
declare const InlineAutocomplete: () => import("react/jsx-runtime").JSX.Element;
|
|
88
88
|
declare const OmegaIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -90,4 +90,29 @@ declare const LineSpacingIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
|
90
90
|
declare const MiceIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
91
91
|
declare const PlayIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
92
92
|
declare const PushIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
93
|
-
|
|
93
|
+
declare const ExportPdfIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
94
|
+
declare const ExportDocIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
95
|
+
declare const EyeIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
96
|
+
declare const ProfessionalIcon: (props: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
|
|
97
|
+
declare const FriendlyIcon: (props: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
|
|
98
|
+
declare const CasualIcon: (props: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
|
|
99
|
+
declare const FormalIcon: (props: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
|
|
100
|
+
declare const ConfidentIcon: (props: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
|
|
101
|
+
declare const EmpatheticIcon: (props: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
|
|
102
|
+
declare const EnthusiasticIcon: (props: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
|
|
103
|
+
declare const NeutralIcon: (props: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
|
|
104
|
+
declare const PersuasiveIcon: (props: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
|
|
105
|
+
declare const RespectfulIcon: (props: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
|
|
106
|
+
declare const PauseIcon: (props: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
|
|
107
|
+
declare const QuoteIcon: (props: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
|
|
108
|
+
declare const StyledDividerIcon: (props: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
|
|
109
|
+
declare const HeroIcon: (props: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
|
|
110
|
+
declare const FeatureRowIcon: (props: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
|
|
111
|
+
declare const ThreeUpIcon: (props: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
|
|
112
|
+
declare const CTABandIcon: (props: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
|
|
113
|
+
declare const FaqIcon: (props: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
|
|
114
|
+
declare const ColumnsIcon: (props: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
|
|
115
|
+
declare const MinusIcon: (props: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
|
|
116
|
+
declare const MergeIcon: (props: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
|
|
117
|
+
declare const SplitIcon: (props: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
|
|
118
|
+
export { AddCommentIcon, AddImageIcon, AdjustToneIcon, AIChatIcon, AIIcon, AlignBottomIcon, AlignCenterIcon, AlignJustifyIcon, AlignLeftIcon, AlignMiddleIcon, AlignRightIcon, AlignTopIcon, BoldIcon, BugIcon, BulletListIcon, ChartBarIcon, CheckBoxIcon, CheckIcon, ChevronDownIcon, CodeIcon, CompleteSentenceIcon, DisableIcon, EmojifyIcon, FaceSmileIcon, FileIcon, FixGrammarIcon, GenerateImageIcon, Heading1Icon, Heading2Icon, Heading3Icon, Heading4Icon, Heading5Icon, Heading6Icon, HorizontalRuleIcon, HtmlViewIcon, ImageIcon, ItalicIcon, LinkIcon, LockIcon, MagicoonIcon, MakeLongerIcon, MakeShorterIcon, MenuAltIcon, MessageEditIcon, MicrophoneIcon, NoteIcon, NumberListIcon, PauseCircleIcon, ParagraphIcon, PenLineIcon, PerspectiveIcon, PlayCircleIcon, PlusIcon, TextQuoteIcon, RecordingIcon, RedoIcon, SearchTextIcon, SearchTextIcon2, SendIcon, SignatureIcon, SimplifyIcon, SparkleIcon, StopCircleIcon, StrikethroughIcon, SubscriptIcon, SuperscriptIcon, TodoIcon, TranslateIcon, TypeCapitalizeIcon, TypeLowercaseIcon, TypeUppercaseIcon, UnderlineIcon, UndoIcon, UploadIcon, TableIcon, HighlighterIcon, LightbulbIcon, ClearFormattingIcon, CrossIcon, DownloadIcon, TrashIcon, ExternalLinkIcon, WrapTextLeftIcon, WrapTextRightIcon, AiSparkle, CodeSquare, InlineAutocomplete, OmegaIcon, LineSpacingIcon, MiceIcon, PlayIcon, PushIcon, ExportPdfIcon, ExportDocIcon, EyeIcon, ProfessionalIcon, FriendlyIcon, CasualIcon, FormalIcon, ConfidentIcon, EmpatheticIcon, EnthusiasticIcon, NeutralIcon, PersuasiveIcon, RespectfulIcon, PauseIcon, QuoteIcon, StyledDividerIcon, HeroIcon, FeatureRowIcon, ThreeUpIcon, CTABandIcon, FaqIcon, ColumnsIcon, MinusIcon, MergeIcon, SplitIcon };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { c as K,
|
|
2
|
-
import { useState as
|
|
1
|
+
import { c as K, ah as Q, ai as X, t as V, aj as Y, ak as ee } from "./index-Bex3G_eE.js";
|
|
2
|
+
import { useState as y, useRef as c, useEffect as re, useCallback as b } from "react";
|
|
3
3
|
const se = K("Mic", [
|
|
4
4
|
["path", { d: "M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z", key: "131961" }],
|
|
5
5
|
["path", { d: "M19 10v2a7 7 0 0 1-14 0v-2", key: "1vc78b" }],
|
|
6
6
|
["line", { x1: "12", x2: "12", y1: "19", y2: "22", key: "x3vr5v" }]
|
|
7
7
|
]), ce = ({ onTranscriptUpdate: P, onSessionEnd: W, apiKey: C }) => {
|
|
8
|
-
const [u, x] =
|
|
8
|
+
const [u, x] = y(!1), [l, M] = y(!1), [z, D] = y(!1), [G, m] = y(null), [J, T] = y(!1), [R, N] = y(0), A = c(null), h = c(null), o = c(null), w = c(null), B = c(-1), f = c(""), S = c(""), L = c(!1), a = c(null), g = c(0), I = c(0);
|
|
9
9
|
re(() => {
|
|
10
10
|
if (u && !l)
|
|
11
11
|
return g.current === 0 && (g.current = Date.now() - I.current), a.current = setInterval(() => {
|
|
@@ -33,7 +33,7 @@ const se = K("Mic", [
|
|
|
33
33
|
});
|
|
34
34
|
A.current = r;
|
|
35
35
|
const E = `wss://streaming.assemblyai.com/v3/ws?token=${e.token}`, t = new WebSocket(E);
|
|
36
|
-
|
|
36
|
+
h.current = t, t.onopen = () => {
|
|
37
37
|
T(!0), D(!1);
|
|
38
38
|
}, t.onmessage = (i) => {
|
|
39
39
|
try {
|
|
@@ -41,8 +41,8 @@ const se = K("Mic", [
|
|
|
41
41
|
if (n.type === "Turn") {
|
|
42
42
|
if (n.transcript !== void 0) {
|
|
43
43
|
n.turn_order !== B.current && (B.current !== -1 && f.current && (S.current += f.current + " "), B.current = n.turn_order, f.current = ""), f.current = n.transcript;
|
|
44
|
-
const
|
|
45
|
-
if (P(
|
|
44
|
+
const q = S.current + f.current;
|
|
45
|
+
if (P(q), n.end_of_turn) {
|
|
46
46
|
S.current += f.current + " ", f.current = "";
|
|
47
47
|
const v = S.current.trim();
|
|
48
48
|
P(v);
|
|
@@ -67,7 +67,7 @@ const se = K("Mic", [
|
|
|
67
67
|
s,
|
|
68
68
|
"pcm-processor"
|
|
69
69
|
);
|
|
70
|
-
|
|
70
|
+
w.current = i, i.port.onmessage = (n) => {
|
|
71
71
|
t.readyState === WebSocket.OPEN && t.send(n.data);
|
|
72
72
|
}, d.connect(i);
|
|
73
73
|
} catch {
|
|
@@ -93,21 +93,21 @@ const se = K("Mic", [
|
|
|
93
93
|
}
|
|
94
94
|
}, [P, C]), U = (e, r, E) => {
|
|
95
95
|
const t = e.createScriptProcessor(1024, 1, 1);
|
|
96
|
-
|
|
96
|
+
w.current = t;
|
|
97
97
|
let s = [], d = 0;
|
|
98
98
|
const i = 1600;
|
|
99
99
|
t.onaudioprocess = (n) => {
|
|
100
100
|
if (E.readyState === WebSocket.OPEN) {
|
|
101
101
|
const v = n.inputBuffer.getChannelData(0), O = new Int16Array(v.length);
|
|
102
102
|
for (let p = 0; p < v.length; p++) {
|
|
103
|
-
const
|
|
104
|
-
O[p] =
|
|
103
|
+
const k = Math.max(-1, Math.min(1, v[p]));
|
|
104
|
+
O[p] = k < 0 ? k * 32768 : k * 32767;
|
|
105
105
|
}
|
|
106
106
|
if (s.push(O), d += O.length, d >= i) {
|
|
107
107
|
const p = new Int16Array(d);
|
|
108
|
-
let
|
|
109
|
-
for (const
|
|
110
|
-
p.set(
|
|
108
|
+
let k = 0;
|
|
109
|
+
for (const F of s)
|
|
110
|
+
p.set(F, k), k += F.length;
|
|
111
111
|
E.send(p.buffer), s = [], d = 0;
|
|
112
112
|
}
|
|
113
113
|
}
|
|
@@ -116,10 +116,10 @@ const se = K("Mic", [
|
|
|
116
116
|
!u || l || (M(!0), o.current && o.current.state === "running" && o.current.suspend());
|
|
117
117
|
}, [u, l]), $ = b(() => {
|
|
118
118
|
!u || !l || (M(!1), g.current = Date.now() - I.current, o.current && o.current.state === "suspended" && o.current.resume());
|
|
119
|
-
}, [u, l]),
|
|
119
|
+
}, [u, l]), j = b(async () => {
|
|
120
120
|
L.current = !0;
|
|
121
121
|
const e = R;
|
|
122
|
-
if (x(!1), M(!1), N(0), g.current = 0, I.current = 0, a.current && (clearInterval(a.current), a.current = null),
|
|
122
|
+
if (x(!1), M(!1), N(0), g.current = 0, I.current = 0, a.current && (clearInterval(a.current), a.current = null), w.current && (w.current.disconnect(), w.current = null), o.current && (o.current.close(), o.current = null), A.current && (A.current.getTracks().forEach((r) => r.stop()), A.current = null), h.current && (h.current.readyState === WebSocket.OPEN && h.current.close(1e3, "Recording stopped"), h.current = null), T(!1), e > 0)
|
|
123
123
|
try {
|
|
124
124
|
const r = await Y(e, C);
|
|
125
125
|
W && r.credits && W({
|
|
@@ -133,8 +133,8 @@ const se = K("Mic", [
|
|
|
133
133
|
});
|
|
134
134
|
}
|
|
135
135
|
}, [R, W, C]), H = b(() => {
|
|
136
|
-
u ?
|
|
137
|
-
}, [u, _,
|
|
136
|
+
u ? j() : _();
|
|
137
|
+
}, [u, _, j]);
|
|
138
138
|
return {
|
|
139
139
|
isRecording: u,
|
|
140
140
|
isPaused: l,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eddyter",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.4.
|
|
4
|
+
"version": "1.4.19",
|
|
5
5
|
"description": "Plug and Play AI Rich Text Editor for any website, blog, CRM, ERP, or web app. Built on Lexical with AI writing assistance, dark mode, and real-time collaboration.",
|
|
6
6
|
"homepage": "https://www.eddyter.com",
|
|
7
7
|
"repository": {
|