ct-rich-text-editor 1.2.7 → 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/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { b, C, E, H, e, a, u, v } from "./index-25cc2475.js";
1
+ import { b, C, E, H, e, a, u, v } from "./index-2d49fa3f.js";
2
2
  import "react/jsx-runtime";
3
3
  import "react";
4
4
  import "axios";
@@ -5,7 +5,8 @@ class PCMProcessor extends AudioWorkletProcessor {
5
5
  super();
6
6
  this.audioBuffer = [];
7
7
  this.totalSamples = 0;
8
- this.targetChunkSize = 8000; // 500ms at 16kHz (8000 samples)
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 (500ms worth)
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({ anchorElem, apiKey, }: {
5
- anchorElem?: HTMLElement;
4
+ export default function AIChatPlugin({ apiKey, }: {
6
5
  apiKey?: string;
7
6
  }): JSX.Element | null;
@@ -0,0 +1,4 @@
1
+ import { default as React } from 'react';
2
+
3
+ declare const CommentBubblePlugin: React.FC;
4
+ export default CommentBubblePlugin;
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: TextFormatType;
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 {
@@ -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,126 +1,126 @@
1
- {
2
- "name": "ct-rich-text-editor",
3
- "private": false,
4
- "version": "1.2.7",
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
- }
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
+ }