inkflow-editor 1.3.0

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 (49) hide show
  1. package/ReadME.md +230 -0
  2. package/dist/EmojiList-B-C3-zN2.js +25 -0
  3. package/dist/core/Editor.d.ts +227 -0
  4. package/dist/core/HistoryManager.d.ts +36 -0
  5. package/dist/core/ImageManager.d.ts +28 -0
  6. package/dist/core/SelectionManager.d.ts +52 -0
  7. package/dist/core/plugins/ImageUploader.d.ts +15 -0
  8. package/dist/index.d.ts +12 -0
  9. package/dist/inkflow-editor.css +1 -0
  10. package/dist/inkflow-editor.mjs +2010 -0
  11. package/dist/style.d.ts +4 -0
  12. package/dist/ui/Toolbar.d.ts +26 -0
  13. package/dist/ui/toolbar/EmojiList.d.ts +6 -0
  14. package/dist/ui/toolbar/EmojiPicker.d.ts +21 -0
  15. package/dist/ui/toolbar/FloatingToolbar.d.ts +16 -0
  16. package/dist/ui/toolbar/InputModal.d.ts +24 -0
  17. package/dist/ui/toolbar/ToolbarItem.d.ts +16 -0
  18. package/dist/ui/toolbar/items/AlignCenter.d.ts +2 -0
  19. package/dist/ui/toolbar/items/AlignJustify.d.ts +2 -0
  20. package/dist/ui/toolbar/items/AlignLeft.d.ts +2 -0
  21. package/dist/ui/toolbar/items/AlignRight.d.ts +2 -0
  22. package/dist/ui/toolbar/items/Bold.d.ts +2 -0
  23. package/dist/ui/toolbar/items/BulletList.d.ts +2 -0
  24. package/dist/ui/toolbar/items/ClearFormatting.d.ts +2 -0
  25. package/dist/ui/toolbar/items/CodeBlock.d.ts +2 -0
  26. package/dist/ui/toolbar/items/Emoji.d.ts +2 -0
  27. package/dist/ui/toolbar/items/FontFamily.d.ts +2 -0
  28. package/dist/ui/toolbar/items/FontSize.d.ts +2 -0
  29. package/dist/ui/toolbar/items/Heading.d.ts +2 -0
  30. package/dist/ui/toolbar/items/HighlightColor.d.ts +2 -0
  31. package/dist/ui/toolbar/items/HorizontalRule.d.ts +2 -0
  32. package/dist/ui/toolbar/items/Image.d.ts +2 -0
  33. package/dist/ui/toolbar/items/Indent.d.ts +2 -0
  34. package/dist/ui/toolbar/items/Italic.d.ts +2 -0
  35. package/dist/ui/toolbar/items/LineHeight.d.ts +2 -0
  36. package/dist/ui/toolbar/items/Link.d.ts +2 -0
  37. package/dist/ui/toolbar/items/MagicFormat.d.ts +2 -0
  38. package/dist/ui/toolbar/items/OrderedList.d.ts +2 -0
  39. package/dist/ui/toolbar/items/Outdent.d.ts +2 -0
  40. package/dist/ui/toolbar/items/Redo.d.ts +2 -0
  41. package/dist/ui/toolbar/items/ResetMagicFormat.d.ts +2 -0
  42. package/dist/ui/toolbar/items/Strikethrough.d.ts +2 -0
  43. package/dist/ui/toolbar/items/Table.d.ts +2 -0
  44. package/dist/ui/toolbar/items/TableActions.d.ts +5 -0
  45. package/dist/ui/toolbar/items/TextColor.d.ts +2 -0
  46. package/dist/ui/toolbar/items/Underline.d.ts +2 -0
  47. package/dist/ui/toolbar/items/Undo.d.ts +2 -0
  48. package/dist/ui/toolbar/registry.d.ts +2 -0
  49. package/package.json +71 -0
@@ -0,0 +1,4 @@
1
+ declare module 'inkflow-editor/style' {
2
+ const content: any;
3
+ export default content;
4
+ }
@@ -0,0 +1,26 @@
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 activeModal;
9
+ private statusEl;
10
+ private charCountEl;
11
+ private saveStatusEl;
12
+ private boundUpdateActiveStates;
13
+ private itemElements;
14
+ constructor(editor: CoreEditor);
15
+ private createToolbarElement;
16
+ private render;
17
+ private renderButton;
18
+ private renderInput;
19
+ private renderSelect;
20
+ private renderColorPicker;
21
+ get el(): HTMLElement;
22
+ private updateActiveStates;
23
+ updateStatus(text: string, isLoading?: boolean): void;
24
+ updateMetrics(): void;
25
+ destroy(): void;
26
+ }
@@ -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,21 @@
1
+ import type { 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 emojiList;
9
+ private theme?;
10
+ private dark?;
11
+ constructor(onSelect: (emoji: string) => void, onClose: () => void, theme?: ThemeConfig, dark?: boolean);
12
+ private loadEmojis;
13
+ private createPickerElement;
14
+ private setupEvents;
15
+ private renderEmojis;
16
+ private renderGridItems;
17
+ private applyTheme;
18
+ show(referenceEl: HTMLElement): void;
19
+ close(): void;
20
+ get el(): HTMLElement;
21
+ }
@@ -0,0 +1,16 @@
1
+ import { CoreEditor } from '../../core/Editor';
2
+ export declare class FloatingToolbar {
3
+ private container;
4
+ private editor;
5
+ private activeModal;
6
+ private savedRange;
7
+ private isVisible;
8
+ constructor(editor: CoreEditor);
9
+ private createContainer;
10
+ private handleCommand;
11
+ private setupListeners;
12
+ private updatePosition;
13
+ private hide;
14
+ destroy(): void;
15
+ setDarkMode(dark: boolean): void;
16
+ }
@@ -0,0 +1,24 @@
1
+ import type { ThemeConfig } from '../../core/Editor';
2
+ export interface ModalField {
3
+ id: string;
4
+ label: string;
5
+ type: 'text' | 'number' | 'file';
6
+ placeholder?: string;
7
+ defaultValue?: string;
8
+ min?: string;
9
+ max?: string;
10
+ }
11
+ export declare class InputModal {
12
+ private container;
13
+ private onConfirm;
14
+ private onClose;
15
+ private dark?;
16
+ private theme?;
17
+ private fields;
18
+ constructor(title: string, fields: ModalField[], onConfirm: (values: Record<string, any>) => void, onClose: () => void, theme?: ThemeConfig, dark?: boolean);
19
+ private createModalElement;
20
+ private setupEvents;
21
+ show(referenceEl: HTMLElement): void;
22
+ close(): void;
23
+ private applyTheme;
24
+ }
@@ -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 codeBlock: 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 magicFormat: 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 resetMagicFormat: 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 ADDED
@@ -0,0 +1,71 @@
1
+ {
2
+ "name": "inkflow-editor",
3
+ "version": "1.3.0",
4
+ "description": "A premium, lightweight, and framework-agnostic WYSIWYG rich text editor with a sophisticated Slate & Indigo design. Highly customizable and optimized for React, Next.js, and Vanilla TypeScript.",
5
+ "type": "module",
6
+ "files": [
7
+ "dist"
8
+ ],
9
+ "main": "./dist/inkflow-editor.mjs",
10
+ "module": "./dist/inkflow-editor.mjs",
11
+ "types": "./dist/index.d.ts",
12
+ "exports": {
13
+ ".": {
14
+ "types": "./dist/index.d.ts",
15
+ "import": "./dist/inkflow-editor.mjs",
16
+ "default": "./dist/inkflow-editor.mjs"
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
+ },
24
+ "scripts": {
25
+ "dev": "vite",
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",
27
+ "preview": "vite preview",
28
+ "test": "vitest",
29
+ "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0"
30
+ },
31
+ "devDependencies": {
32
+ "@types/dompurify": "^3.0.5",
33
+ "@types/jsdom": "^21.1.7",
34
+ "@types/node": "^25.3.5",
35
+ "@vitest/browser": "^4.0.18",
36
+ "jsdom": "^28.1.0",
37
+ "typescript": "^5.9.3",
38
+ "vite": "^7.3.1",
39
+ "vite-plugin-javascript-obfuscator": "^3.1.0",
40
+ "vitest": "^4.0.18"
41
+ },
42
+ "keywords": [
43
+ "rich-text-editor",
44
+ "wysiwyg",
45
+ "editor",
46
+ "vanilla-js",
47
+ "typescript",
48
+ "premium-ui",
49
+ "contenteditable",
50
+ "react-editor",
51
+ "nextjs-editor",
52
+ "customizable-toolbar",
53
+ "table-editor",
54
+ "emoji-picker",
55
+ "dark-mode",
56
+ "lightweight-editor"
57
+ ],
58
+ "author": "Anuj Nainwal",
59
+ "license": "MIT",
60
+ "repository": {
61
+ "type": "git",
62
+ "url": "git+https://github.com/anujnainwal/rich-text-editor.git"
63
+ },
64
+ "bugs": {
65
+ "url": "https://github.com/anujnainwal/rich-text-editor/issues"
66
+ },
67
+ "homepage": "https://github.com/anujnainwal/rich-text-editor#readme",
68
+ "dependencies": {
69
+ "dompurify": "^3.3.3"
70
+ }
71
+ }