@meenainwal/rich-text-editor 1.0.7 → 1.0.9

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 (45) hide show
  1. package/ReadME.md +30 -46
  2. package/dist/core/Editor.d.ts +133 -0
  3. package/dist/core/HistoryManager.d.ts +30 -0
  4. package/dist/core/ImageManager.d.ts +19 -0
  5. package/dist/core/SelectionManager.d.ts +31 -0
  6. package/dist/index.d.ts +11 -0
  7. package/dist/rich-text-editor.css +1 -1
  8. package/dist/style.d.ts +4 -0
  9. package/dist/test-editor.cjs +2 -2
  10. package/dist/test-editor.mjs +535 -232
  11. package/dist/ui/Toolbar.d.ts +19 -0
  12. package/dist/ui/toolbar/EmojiList.d.ts +6 -0
  13. package/dist/ui/toolbar/EmojiPicker.d.ts +19 -0
  14. package/dist/ui/toolbar/ToolbarItem.d.ts +16 -0
  15. package/dist/ui/toolbar/items/AlignCenter.d.ts +2 -0
  16. package/dist/ui/toolbar/items/AlignJustify.d.ts +2 -0
  17. package/dist/ui/toolbar/items/AlignLeft.d.ts +2 -0
  18. package/dist/ui/toolbar/items/AlignRight.d.ts +2 -0
  19. package/dist/ui/toolbar/items/Bold.d.ts +2 -0
  20. package/dist/ui/toolbar/items/BulletList.d.ts +2 -0
  21. package/dist/ui/toolbar/items/ClearFormatting.d.ts +2 -0
  22. package/dist/ui/toolbar/items/Emoji.d.ts +2 -0
  23. package/dist/ui/toolbar/items/FontFamily.d.ts +2 -0
  24. package/dist/ui/toolbar/items/FontSize.d.ts +2 -0
  25. package/dist/ui/toolbar/items/Heading.d.ts +2 -0
  26. package/dist/ui/toolbar/items/HighlightColor.d.ts +2 -0
  27. package/dist/ui/toolbar/items/HorizontalRule.d.ts +2 -0
  28. package/dist/ui/toolbar/items/Image.d.ts +2 -0
  29. package/dist/ui/toolbar/items/Indent.d.ts +2 -0
  30. package/dist/ui/toolbar/items/Italic.d.ts +2 -0
  31. package/dist/ui/toolbar/items/LineHeight.d.ts +2 -0
  32. package/dist/ui/toolbar/items/Link.d.ts +2 -0
  33. package/dist/ui/toolbar/items/OrderedList.d.ts +2 -0
  34. package/dist/ui/toolbar/items/Outdent.d.ts +2 -0
  35. package/dist/ui/toolbar/items/Redo.d.ts +2 -0
  36. package/dist/ui/toolbar/items/Strikethrough.d.ts +2 -0
  37. package/dist/ui/toolbar/items/Table.d.ts +2 -0
  38. package/dist/ui/toolbar/items/TableActions.d.ts +5 -0
  39. package/dist/ui/toolbar/items/TextColor.d.ts +2 -0
  40. package/dist/ui/toolbar/items/Underline.d.ts +2 -0
  41. package/dist/ui/toolbar/items/Undo.d.ts +2 -0
  42. package/dist/ui/toolbar/registry.d.ts +2 -0
  43. package/package.json +15 -10
  44. package/images/Screenshot from 2026-03-07 12-13-13.png +0 -0
  45. package/images/editor-preview.png +0 -0
@@ -0,0 +1,19 @@
1
+ import { CoreEditor } from '../core/Editor';
2
+ export declare class Toolbar {
3
+ private editor;
4
+ private container;
5
+ private savedRange;
6
+ private items;
7
+ private activePicker;
8
+ private statusEl;
9
+ constructor(editor: CoreEditor);
10
+ private createToolbarElement;
11
+ private render;
12
+ private renderButton;
13
+ private renderInput;
14
+ private renderSelect;
15
+ private renderColorPicker;
16
+ get el(): HTMLElement;
17
+ private updateActiveStates;
18
+ updateStatus(text: string, isLoading?: boolean): void;
19
+ }
@@ -0,0 +1,6 @@
1
+ export interface EmojiData {
2
+ emoji: string;
3
+ name: string;
4
+ category: string;
5
+ }
6
+ export declare const EMOJI_LIST: EmojiData[];
@@ -0,0 +1,19 @@
1
+ import { ThemeConfig } from '../../core/Editor';
2
+ export declare class EmojiPicker {
3
+ private container;
4
+ private searchInput;
5
+ private emojiGrid;
6
+ private onSelect;
7
+ private onClose;
8
+ private theme?;
9
+ private dark?;
10
+ constructor(onSelect: (emoji: string) => void, onClose: () => void, theme?: ThemeConfig, dark?: boolean);
11
+ private createPickerElement;
12
+ private setupEvents;
13
+ private renderEmojis;
14
+ private renderGridItems;
15
+ private applyTheme;
16
+ show(referenceEl: HTMLElement): void;
17
+ close(): void;
18
+ get el(): HTMLElement;
19
+ }
@@ -0,0 +1,16 @@
1
+ export type ToolbarItemType = 'button' | 'select' | 'input' | 'divider' | 'color-picker';
2
+ export interface ToolbarItemOption {
3
+ label: string;
4
+ value: string;
5
+ }
6
+ export interface ToolbarItem {
7
+ id?: string;
8
+ type: ToolbarItemType;
9
+ title: string;
10
+ command?: string;
11
+ icon?: string;
12
+ value?: string;
13
+ options?: ToolbarItemOption[];
14
+ placeholder?: string;
15
+ className?: string;
16
+ }
@@ -0,0 +1,2 @@
1
+ import { ToolbarItem } from '../ToolbarItem';
2
+ export declare const alignCenter: ToolbarItem;
@@ -0,0 +1,2 @@
1
+ import { ToolbarItem } from '../ToolbarItem';
2
+ export declare const alignJustify: ToolbarItem;
@@ -0,0 +1,2 @@
1
+ import { ToolbarItem } from '../ToolbarItem';
2
+ export declare const alignLeft: ToolbarItem;
@@ -0,0 +1,2 @@
1
+ import { ToolbarItem } from '../ToolbarItem';
2
+ export declare const alignRight: ToolbarItem;
@@ -0,0 +1,2 @@
1
+ import { ToolbarItem } from '../ToolbarItem';
2
+ export declare const bold: ToolbarItem;
@@ -0,0 +1,2 @@
1
+ import { ToolbarItem } from '../ToolbarItem';
2
+ export declare const bulletList: ToolbarItem;
@@ -0,0 +1,2 @@
1
+ import { ToolbarItem } from '../ToolbarItem';
2
+ export declare const clearFormatting: ToolbarItem;
@@ -0,0 +1,2 @@
1
+ import { ToolbarItem } from '../ToolbarItem';
2
+ export declare const emoji: ToolbarItem;
@@ -0,0 +1,2 @@
1
+ import { ToolbarItem } from '../ToolbarItem';
2
+ export declare const fontFamily: ToolbarItem;
@@ -0,0 +1,2 @@
1
+ import { ToolbarItem } from '../ToolbarItem';
2
+ export declare const fontSize: ToolbarItem;
@@ -0,0 +1,2 @@
1
+ import { ToolbarItem } from '../ToolbarItem';
2
+ export declare const heading: ToolbarItem;
@@ -0,0 +1,2 @@
1
+ import { ToolbarItem } from '../ToolbarItem';
2
+ export declare const highlightColor: ToolbarItem;
@@ -0,0 +1,2 @@
1
+ import { ToolbarItem } from '../ToolbarItem';
2
+ export declare const horizontalRule: ToolbarItem;
@@ -0,0 +1,2 @@
1
+ import { ToolbarItem } from '../ToolbarItem';
2
+ export declare const image: ToolbarItem;
@@ -0,0 +1,2 @@
1
+ import { ToolbarItem } from '../ToolbarItem';
2
+ export declare const indent: ToolbarItem;
@@ -0,0 +1,2 @@
1
+ import { ToolbarItem } from '../ToolbarItem';
2
+ export declare const italic: ToolbarItem;
@@ -0,0 +1,2 @@
1
+ import { ToolbarItem } from '../ToolbarItem';
2
+ export declare const lineHeight: ToolbarItem;
@@ -0,0 +1,2 @@
1
+ import { ToolbarItem } from '../ToolbarItem';
2
+ export declare const link: ToolbarItem;
@@ -0,0 +1,2 @@
1
+ import { ToolbarItem } from '../ToolbarItem';
2
+ export declare const orderedList: ToolbarItem;
@@ -0,0 +1,2 @@
1
+ import { ToolbarItem } from '../ToolbarItem';
2
+ export declare const outdent: ToolbarItem;
@@ -0,0 +1,2 @@
1
+ import { ToolbarItem } from '../ToolbarItem';
2
+ export declare const redo: ToolbarItem;
@@ -0,0 +1,2 @@
1
+ import { ToolbarItem } from '../ToolbarItem';
2
+ export declare const strikethrough: ToolbarItem;
@@ -0,0 +1,2 @@
1
+ import { ToolbarItem } from '../ToolbarItem';
2
+ export declare const table: ToolbarItem;
@@ -0,0 +1,5 @@
1
+ import { ToolbarItem } from '../ToolbarItem';
2
+ export declare const addRow: ToolbarItem;
3
+ export declare const deleteRow: ToolbarItem;
4
+ export declare const addColumn: ToolbarItem;
5
+ export declare const deleteColumn: ToolbarItem;
@@ -0,0 +1,2 @@
1
+ import { ToolbarItem } from '../ToolbarItem';
2
+ export declare const textColor: ToolbarItem;
@@ -0,0 +1,2 @@
1
+ import { ToolbarItem } from '../ToolbarItem';
2
+ export declare const underline: ToolbarItem;
@@ -0,0 +1,2 @@
1
+ import { ToolbarItem } from '../ToolbarItem';
2
+ export declare const undo: ToolbarItem;
@@ -0,0 +1,2 @@
1
+ import { ToolbarItem } from './ToolbarItem';
2
+ export declare const toolbarItems: ToolbarItem[];
package/package.json CHANGED
@@ -1,24 +1,29 @@
1
1
  {
2
2
  "name": "@meenainwal/rich-text-editor",
3
- "version": "1.0.7",
3
+ "version": "1.0.9",
4
4
  "description": "A premium, lightweight, and framework-agnostic rich text editor with a sophisticated Slate & Indigo design.",
5
5
  "type": "module",
6
6
  "files": [
7
- "dist",
8
- "images"
7
+ "dist"
9
8
  ],
10
9
  "main": "./dist/test-editor.cjs",
11
10
  "module": "./dist/test-editor.mjs",
12
11
  "types": "./dist/index.d.ts",
13
- "exports": {
14
- ".": {
15
- "import": "./dist/test-editor.mjs",
16
- "require": "./dist/test-editor.cjs"
17
- }
18
- },
12
+ "exports": {
13
+ ".": {
14
+ "types": "./dist/index.d.ts",
15
+ "import": "./dist/test-editor.mjs",
16
+ "require": "./dist/test-editor.cjs"
17
+ },
18
+ "./style": {
19
+ "types": "./dist/style.d.ts",
20
+ "default": "./dist/rich-text-editor.css"
21
+ },
22
+ "./dist/rich-text-editor.css": "./dist/rich-text-editor.css"
23
+ },
19
24
  "scripts": {
20
25
  "dev": "vite",
21
- "build": "vite build && tsc",
26
+ "build": "vite build && tsc -p tsconfig.types.json && cp src/style.d.ts dist/style.d.ts && sed -i '/import.*\\.css/d' dist/index.d.ts",
22
27
  "preview": "vite preview",
23
28
  "test": "vitest",
24
29
  "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0"
Binary file