ct-rich-text-editor 1.2.6 → 1.2.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.
- package/README.md +217 -217
- package/dist/Provider/EditorProvider.d.ts +1 -0
- package/dist/assets/style.css +4138 -3607
- package/dist/components/AlignMenu/AlignMenuDrop.d.ts +4 -0
- package/dist/components/AutoExpandingDemo.d.ts +7 -0
- package/dist/components/DatePicker/DatePickerWidget.d.ts +9 -0
- package/dist/components/InsertMenu/InsertMenuDrop.d.ts +10 -0
- package/dist/components/ui/calendar.d.ts +9 -0
- package/dist/components/ui/checkbox.d.ts +4 -0
- package/dist/context/ToolbarContext.d.ts +1 -0
- package/dist/hooks/useAutoExpandingHeight.d.ts +15 -0
- package/dist/hooks/useBlockFormat.d.ts +0 -1
- package/dist/hooks/useS3Uploader.d.ts +1 -1
- package/dist/hooks/useVoiceToText.d.ts +11 -0
- package/dist/html2pdf.bundle-b85c32f6.js +46128 -0
- package/dist/html2pdf.bundle-b85c32f6.js.map +1 -0
- package/dist/html2pdf.bundle.min-2dd44ab5.js +21987 -0
- package/dist/html2pdf.bundle.min-2dd44ab5.js.map +1 -0
- package/dist/{index-ffff9c22.js → index-0752dfb0.js} +18 -7
- package/dist/index-0752dfb0.js.map +1 -0
- package/dist/{index-5238e1b7.js → index-2d49fa3f.js} +3823 -1438
- package/dist/index-2d49fa3f.js.map +1 -0
- package/dist/index.js +1 -1
- package/dist/pcm-processor.js +3 -2
- package/dist/plugins/AIChatPlugin.d.ts +1 -2
- package/dist/plugins/CommentBubblePlugin.d.ts +4 -0
- package/dist/types.d.ts +5 -2
- package/dist/ui/Icons.d.ts +3 -1
- package/dist/utils/dateFormats.d.ts +33 -0
- package/dist/utils/export.d.ts +3 -0
- package/package.json +126 -123
- package/dist/index-5238e1b7.js.map +0 -1
- package/dist/index-ffff9c22.js.map +0 -1
package/dist/index.js
CHANGED
package/dist/pcm-processor.js
CHANGED
|
@@ -5,7 +5,8 @@ class PCMProcessor extends AudioWorkletProcessor {
|
|
|
5
5
|
super();
|
|
6
6
|
this.audioBuffer = [];
|
|
7
7
|
this.totalSamples = 0;
|
|
8
|
-
|
|
8
|
+
// Reduced to 1600 samples = 100ms at 16kHz (5x faster, still safe for network transmission)
|
|
9
|
+
this.targetChunkSize = 1600;
|
|
9
10
|
}
|
|
10
11
|
|
|
11
12
|
process(inputs, outputs, parameters) {
|
|
@@ -24,7 +25,7 @@ class PCMProcessor extends AudioWorkletProcessor {
|
|
|
24
25
|
this.audioBuffer.push(pcmData);
|
|
25
26
|
this.totalSamples += pcmData.length;
|
|
26
27
|
|
|
27
|
-
// Send when we have enough data (
|
|
28
|
+
// Send when we have enough data (100ms worth for 5x faster response)
|
|
28
29
|
if (this.totalSamples >= this.targetChunkSize) {
|
|
29
30
|
// Combine all accumulated audio data
|
|
30
31
|
const combinedData = new Int16Array(this.totalSamples);
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { LexicalCommand } from '../../node_modules/lexical';
|
|
2
2
|
|
|
3
3
|
export declare const TOGGLE_AI_CHAT_COMMAND: LexicalCommand<void>;
|
|
4
|
-
export default function AIChatPlugin({
|
|
5
|
-
anchorElem?: HTMLElement;
|
|
4
|
+
export default function AIChatPlugin({ apiKey, }: {
|
|
6
5
|
apiKey?: string;
|
|
7
6
|
}): JSX.Element | null;
|
package/dist/types.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ export interface AlignMenuItem {
|
|
|
14
14
|
export interface FormatTextMenuItem {
|
|
15
15
|
name: string;
|
|
16
16
|
icon: ReactElement<LucideProps>;
|
|
17
|
-
payload:
|
|
17
|
+
payload: FormattingOptions;
|
|
18
18
|
}
|
|
19
19
|
export interface ToolbarProps {
|
|
20
20
|
editable: boolean;
|
|
@@ -27,6 +27,7 @@ export interface ToolbarProps {
|
|
|
27
27
|
enableColorPicker?: boolean;
|
|
28
28
|
enableClearOptions?: boolean;
|
|
29
29
|
enableEmojiPicker?: boolean;
|
|
30
|
+
enableDatePicker?: boolean;
|
|
30
31
|
enableLinks?: boolean;
|
|
31
32
|
enableFormatTextMenu?: boolean;
|
|
32
33
|
enableCodeFormat?: boolean;
|
|
@@ -43,6 +44,7 @@ export interface ToolbarProps {
|
|
|
43
44
|
}
|
|
44
45
|
export interface FormatTextMenuProps {
|
|
45
46
|
hasFormat: Record<TextFormatType, boolean>;
|
|
47
|
+
blockType: keyof typeof blockTypeToBlockName;
|
|
46
48
|
}
|
|
47
49
|
export interface ColorPickerProps {
|
|
48
50
|
title: string;
|
|
@@ -92,6 +94,7 @@ export interface EditorConfigTypes {
|
|
|
92
94
|
enableColorPicker: boolean;
|
|
93
95
|
enableClearOptions: boolean;
|
|
94
96
|
enableEmojiPicker: boolean;
|
|
97
|
+
enableDatePicker: boolean;
|
|
95
98
|
enableLinks: boolean;
|
|
96
99
|
enableFormatTextMenu: boolean;
|
|
97
100
|
enableCodeFormat: boolean;
|
|
@@ -127,7 +130,7 @@ export interface EditorConfigTypes {
|
|
|
127
130
|
};
|
|
128
131
|
}
|
|
129
132
|
export type EditorActionType = "insert_text" | "create_table" | "change_font" | "apply_formatting" | "change_block_type" | "change_alignment" | "unknown";
|
|
130
|
-
export type FormattingOptions = "bold" | "italic" | "strikethrough" | "underline" | "code" | "highlight" | "subscript" | "superscript";
|
|
133
|
+
export type FormattingOptions = "bold" | "italic" | "strikethrough" | "underline" | "code" | "highlight" | "subscript" | "superscript" | "bullet" | "number" | "check" | "quote";
|
|
131
134
|
export type BlockType = "paragraph" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "bullet" | "number" | "check" | "quote" | "code";
|
|
132
135
|
export type TextAlignment = "left" | "center" | "right" | "justify";
|
|
133
136
|
export interface EditorAction {
|
package/dist/ui/Icons.d.ts
CHANGED
|
@@ -37,4 +37,6 @@ declare const ImageIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
|
37
37
|
declare const SendIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
38
38
|
declare const MicrophoneIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
39
39
|
declare const RecordingIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
40
|
-
|
|
40
|
+
declare const AddCommentIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
41
|
+
declare const CheckIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
42
|
+
export { AddImageIcon, BoldIcon, BulletListIcon, CheckBoxIcon, ChevronDownIcon, CodeIcon, FaceSmileIcon, FaceSmileIcon2, HorizontalRuleIcon, ImageIcon, ItalicIcon, LinkIcon, MagicoonIcon, MenuAltIcon, MessageEditIcon, MicrophoneIcon, NoteIcon, NumberListIcon, PenLineIcon, PerspectiveIcon, PlusIcon, RecordingIcon, RedoIcon, SearchTextIcon, SearchTextIcon2, SendIcon, SignatureIcon, SparkleIcon, StrikethroughIcon, SubscriptIcon, SuperscriptIcon, TodoIcon, TranslateIcon, TypeCapitalizeIcon, TypeLowercaseIcon, TypeUppercaseIcon, UnderlineIcon, UndoIcon, UploadIcon, AddCommentIcon, CheckIcon };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Date formatting utilities for the date picker
|
|
3
|
+
*/
|
|
4
|
+
export type DateFormatType = 'full' | 'short' | 'dd-mm-yyyy' | 'mm-dd-yyyy' | 'iso' | 'day-first-full' | 'day-first-short';
|
|
5
|
+
export interface DateFormat {
|
|
6
|
+
id: DateFormatType;
|
|
7
|
+
label: string;
|
|
8
|
+
example: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Available date formats with labels and examples
|
|
12
|
+
*/
|
|
13
|
+
export declare const DATE_FORMATS: DateFormat[];
|
|
14
|
+
/**
|
|
15
|
+
* Format date according to the specified format type
|
|
16
|
+
*/
|
|
17
|
+
export declare const formatDate: (date: Date, format: DateFormatType) => string;
|
|
18
|
+
/**
|
|
19
|
+
* Session storage key for date format preference
|
|
20
|
+
*/
|
|
21
|
+
export declare const DATE_FORMAT_STORAGE_KEY = "editor-date-format-preference";
|
|
22
|
+
/**
|
|
23
|
+
* Default date format
|
|
24
|
+
*/
|
|
25
|
+
export declare const DEFAULT_DATE_FORMAT: DateFormatType;
|
|
26
|
+
/**
|
|
27
|
+
* Get saved date format from session storage
|
|
28
|
+
*/
|
|
29
|
+
export declare const getSavedDateFormat: () => DateFormatType;
|
|
30
|
+
/**
|
|
31
|
+
* Save date format to session storage
|
|
32
|
+
*/
|
|
33
|
+
export declare const saveDateFormat: (format: DateFormatType) => void;
|
package/package.json
CHANGED
|
@@ -1,123 +1,126 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "ct-rich-text-editor",
|
|
3
|
-
"private": false,
|
|
4
|
-
"version": "1.2.
|
|
5
|
-
"type": "module",
|
|
6
|
-
"packageManager": "pnpm@9.0.0",
|
|
7
|
-
"main": "dist/index.js",
|
|
8
|
-
"module": "dist/index.js",
|
|
9
|
-
"types": "dist/index.d.ts",
|
|
10
|
-
"style": "dist/assets/style.css",
|
|
11
|
-
"files": [
|
|
12
|
-
"dist"
|
|
13
|
-
],
|
|
14
|
-
"exports": {
|
|
15
|
-
".": {
|
|
16
|
-
"import": "./dist/index.js",
|
|
17
|
-
"types": "./dist/index.d.ts"
|
|
18
|
-
},
|
|
19
|
-
"./style.css": "./dist/assets/style.css"
|
|
20
|
-
},
|
|
21
|
-
"peerDependencies": {
|
|
22
|
-
"react": "^18.2.0",
|
|
23
|
-
"react-dom": "^18.2.0"
|
|
24
|
-
},
|
|
25
|
-
"scripts": {
|
|
26
|
-
"dev": "vite",
|
|
27
|
-
"build": "tsc && vite build --mode production",
|
|
28
|
-
"preview": "vite preview",
|
|
29
|
-
"prettier:check": "prettier --check \"src/**/*.{js,jsx,ts,tsx}\"",
|
|
30
|
-
"prettier:format": "prettier --write \"src/**/*.{js,jsx,ts,tsx}\"",
|
|
31
|
-
"lint": "eslint \"src/**/*.{js,jsx,ts,tsx}\"",
|
|
32
|
-
"lint:fix": "eslint \"src/**/*.{js,jsx,ts,tsx}\" --fix",
|
|
33
|
-
"format": "pnpm prettier:format && pnpm lint:fix",
|
|
34
|
-
"check": "pnpm prettier:check && pnpm lint",
|
|
35
|
-
"prepare": "husky",
|
|
36
|
-
"prepublishOnly": "pnpm build"
|
|
37
|
-
},
|
|
38
|
-
"dependencies": {
|
|
39
|
-
"@aws-sdk/client-s3": "^3.744.0",
|
|
40
|
-
"@aws-sdk/s3-request-presigner": "^3.744.0",
|
|
41
|
-
"@emotion/react": "^11.10.6",
|
|
42
|
-
"@emotion/styled": "^11.10.6",
|
|
43
|
-
"@lexical/clipboard": "^0.24.0",
|
|
44
|
-
"@lexical/code": "^0.24.0",
|
|
45
|
-
"@lexical/dragon": "^0.24.0",
|
|
46
|
-
"@lexical/history": "^0.24.0",
|
|
47
|
-
"@lexical/html": "^0.24.0",
|
|
48
|
-
"@lexical/link": "^0.24.0",
|
|
49
|
-
"@lexical/list": "^0.24.0",
|
|
50
|
-
"@lexical/react": "^0.24.0",
|
|
51
|
-
"@lexical/rich-text": "^0.24.0",
|
|
52
|
-
"@lexical/selection": "^0.24.0",
|
|
53
|
-
"@lexical/table": "^0.24.0",
|
|
54
|
-
"@lexical/text": "^0.24.0",
|
|
55
|
-
"@lexical/utils": "^0.24.0",
|
|
56
|
-
"@mui/icons-material": "^5.11.9",
|
|
57
|
-
"@mui/material": "^5.11.9",
|
|
58
|
-
"@mui/styles": "^5.11.9",
|
|
59
|
-
"@radix-ui/react-avatar": "^1.1.3",
|
|
60
|
-
"@radix-ui/react-
|
|
61
|
-
"@radix-ui/react-
|
|
62
|
-
"@radix-ui/react-
|
|
63
|
-
"@radix-ui/react-
|
|
64
|
-
"@radix-ui/react-
|
|
65
|
-
"@radix-ui/react-
|
|
66
|
-
"@radix-ui/react-
|
|
67
|
-
"@radix-ui/react-
|
|
68
|
-
"@radix-ui/react-
|
|
69
|
-
"@
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
"
|
|
77
|
-
"
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
"react
|
|
81
|
-
"
|
|
82
|
-
"react-
|
|
83
|
-
"
|
|
84
|
-
"
|
|
85
|
-
"
|
|
86
|
-
"
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
"
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
"@types/
|
|
93
|
-
"@types/
|
|
94
|
-
"@
|
|
95
|
-
"@
|
|
96
|
-
"@
|
|
97
|
-
"
|
|
98
|
-
"
|
|
99
|
-
"
|
|
100
|
-
"
|
|
101
|
-
"
|
|
102
|
-
"eslint
|
|
103
|
-
"eslint-
|
|
104
|
-
"eslint-
|
|
105
|
-
"eslint-plugin-
|
|
106
|
-
"eslint-plugin-
|
|
107
|
-
"
|
|
108
|
-
"
|
|
109
|
-
"
|
|
110
|
-
"
|
|
111
|
-
"
|
|
112
|
-
"
|
|
113
|
-
"
|
|
114
|
-
"
|
|
115
|
-
"
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
"
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "ct-rich-text-editor",
|
|
3
|
+
"private": false,
|
|
4
|
+
"version": "1.2.8",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"packageManager": "pnpm@9.0.0",
|
|
7
|
+
"main": "dist/index.js",
|
|
8
|
+
"module": "dist/index.js",
|
|
9
|
+
"types": "dist/index.d.ts",
|
|
10
|
+
"style": "dist/assets/style.css",
|
|
11
|
+
"files": [
|
|
12
|
+
"dist"
|
|
13
|
+
],
|
|
14
|
+
"exports": {
|
|
15
|
+
".": {
|
|
16
|
+
"import": "./dist/index.js",
|
|
17
|
+
"types": "./dist/index.d.ts"
|
|
18
|
+
},
|
|
19
|
+
"./style.css": "./dist/assets/style.css"
|
|
20
|
+
},
|
|
21
|
+
"peerDependencies": {
|
|
22
|
+
"react": "^18.2.0",
|
|
23
|
+
"react-dom": "^18.2.0"
|
|
24
|
+
},
|
|
25
|
+
"scripts": {
|
|
26
|
+
"dev": "vite",
|
|
27
|
+
"build": "tsc && vite build --mode production",
|
|
28
|
+
"preview": "vite preview",
|
|
29
|
+
"prettier:check": "prettier --check \"src/**/*.{js,jsx,ts,tsx}\"",
|
|
30
|
+
"prettier:format": "prettier --write \"src/**/*.{js,jsx,ts,tsx}\"",
|
|
31
|
+
"lint": "eslint \"src/**/*.{js,jsx,ts,tsx}\"",
|
|
32
|
+
"lint:fix": "eslint \"src/**/*.{js,jsx,ts,tsx}\" --fix",
|
|
33
|
+
"format": "pnpm prettier:format && pnpm lint:fix",
|
|
34
|
+
"check": "pnpm prettier:check && pnpm lint",
|
|
35
|
+
"prepare": "husky",
|
|
36
|
+
"prepublishOnly": "pnpm build"
|
|
37
|
+
},
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"@aws-sdk/client-s3": "^3.744.0",
|
|
40
|
+
"@aws-sdk/s3-request-presigner": "^3.744.0",
|
|
41
|
+
"@emotion/react": "^11.10.6",
|
|
42
|
+
"@emotion/styled": "^11.10.6",
|
|
43
|
+
"@lexical/clipboard": "^0.24.0",
|
|
44
|
+
"@lexical/code": "^0.24.0",
|
|
45
|
+
"@lexical/dragon": "^0.24.0",
|
|
46
|
+
"@lexical/history": "^0.24.0",
|
|
47
|
+
"@lexical/html": "^0.24.0",
|
|
48
|
+
"@lexical/link": "^0.24.0",
|
|
49
|
+
"@lexical/list": "^0.24.0",
|
|
50
|
+
"@lexical/react": "^0.24.0",
|
|
51
|
+
"@lexical/rich-text": "^0.24.0",
|
|
52
|
+
"@lexical/selection": "^0.24.0",
|
|
53
|
+
"@lexical/table": "^0.24.0",
|
|
54
|
+
"@lexical/text": "^0.24.0",
|
|
55
|
+
"@lexical/utils": "^0.24.0",
|
|
56
|
+
"@mui/icons-material": "^5.11.9",
|
|
57
|
+
"@mui/material": "^5.11.9",
|
|
58
|
+
"@mui/styles": "^5.11.9",
|
|
59
|
+
"@radix-ui/react-avatar": "^1.1.3",
|
|
60
|
+
"@radix-ui/react-checkbox": "^1.1.4",
|
|
61
|
+
"@radix-ui/react-dialog": "^1.1.6",
|
|
62
|
+
"@radix-ui/react-dropdown-menu": "^2.1.6",
|
|
63
|
+
"@radix-ui/react-label": "^2.1.2",
|
|
64
|
+
"@radix-ui/react-popover": "^1.1.13",
|
|
65
|
+
"@radix-ui/react-select": "^2.1.6",
|
|
66
|
+
"@radix-ui/react-separator": "^1.1.2",
|
|
67
|
+
"@radix-ui/react-slot": "^1.2.2",
|
|
68
|
+
"@radix-ui/react-tabs": "^1.1.3",
|
|
69
|
+
"@radix-ui/react-tooltip": "^1.1.8",
|
|
70
|
+
"@types/react-signature-canvas": "^1.0.7",
|
|
71
|
+
"axios": "^1.8.1",
|
|
72
|
+
"class-variance-authority": "^0.7.1",
|
|
73
|
+
"classnames": "^2.3.2",
|
|
74
|
+
"clsx": "^2.1.1",
|
|
75
|
+
"emoji-picker-react": "^4.12.0",
|
|
76
|
+
"html2pdf.js": "^0.12.1",
|
|
77
|
+
"lexical": "^0.24.0",
|
|
78
|
+
"lexical-ai-plugin": "0.0.2-alpha",
|
|
79
|
+
"lodash-es": "^4.17.21",
|
|
80
|
+
"lucide-react": "^0.344.0",
|
|
81
|
+
"prettier": "^3.5.1",
|
|
82
|
+
"react-colorful": "^5.6.1",
|
|
83
|
+
"react-router-dom": "^7.2.0",
|
|
84
|
+
"react-signature-canvas": "^1.1.0-alpha.1",
|
|
85
|
+
"sass": "^1.57.1",
|
|
86
|
+
"sonner": "^2.0.3",
|
|
87
|
+
"tailwind-merge": "^3.0.2",
|
|
88
|
+
"tailwindcss": "3",
|
|
89
|
+
"tailwindcss-animate": "^1.0.7"
|
|
90
|
+
},
|
|
91
|
+
"devDependencies": {
|
|
92
|
+
"@types/he": "^1.2.3",
|
|
93
|
+
"@types/lodash-es": "^4.17.12",
|
|
94
|
+
"@types/node": "^22.13.10",
|
|
95
|
+
"@types/react": "^18.0.26",
|
|
96
|
+
"@types/react-dom": "^18.0.9",
|
|
97
|
+
"@typescript-eslint/eslint-plugin": "5.62.0",
|
|
98
|
+
"@typescript-eslint/parser": "5.62.0",
|
|
99
|
+
"@vitejs/plugin-react-swc": "^3.0.0",
|
|
100
|
+
"autoprefixer": "^10.4.18",
|
|
101
|
+
"cross-env": "^7.0.3",
|
|
102
|
+
"eslint": "8.56.0",
|
|
103
|
+
"eslint-config-prettier": "^10.1.1",
|
|
104
|
+
"eslint-import-resolver-typescript": "^3.8.5",
|
|
105
|
+
"eslint-plugin-import": "^2.31.0",
|
|
106
|
+
"eslint-plugin-react": "^7.37.4",
|
|
107
|
+
"eslint-plugin-react-hooks": "^5.2.0",
|
|
108
|
+
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
109
|
+
"eslint-plugin-unused-imports": "^4.1.4",
|
|
110
|
+
"husky": "^9.1.7",
|
|
111
|
+
"lint-staged": "^15.4.3",
|
|
112
|
+
"postcss": "^8.4.35",
|
|
113
|
+
"react": "^18.2.0",
|
|
114
|
+
"react-dom": "^18.2.0",
|
|
115
|
+
"typescript": "^4.9.3",
|
|
116
|
+
"vite": "^4.0.0",
|
|
117
|
+
"vite-plugin-dts": "^4.5.3",
|
|
118
|
+
"vite-tsconfig-paths": "^5.1.4"
|
|
119
|
+
},
|
|
120
|
+
"lint-staged": {
|
|
121
|
+
"*.{js,jsx,ts,tsx}": [
|
|
122
|
+
"prettier --write",
|
|
123
|
+
"eslint --fix"
|
|
124
|
+
]
|
|
125
|
+
}
|
|
126
|
+
}
|