@abduljebar/text-editor 1.2.0 → 2.2.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.
package/package.json CHANGED
@@ -1,81 +1,82 @@
1
- {
2
- "name": "@abduljebar/text-editor",
3
- "version": "1.2.0",
4
- "description": "A professional React text editor with export, save, and validation features",
5
- "type": "module",
6
- "main": "./dist/index.js",
7
- "module": "./dist/index.js",
8
- "types": "./dist/index.d.ts",
9
- "style": "./dist/index.css",
10
- "files": [
11
- "dist",
12
- "README.md"
13
- ],
14
- "exports": {
15
- ".": {
16
- "import": "./dist/index.js",
17
- "types": "./dist/index.d.ts",
18
- "require": "./dist/index.js"
19
- },
20
- "./dist/index.css": "./dist/index.css"
21
- },
22
- "scripts": {
23
- "dev": "vite",
24
- "build": "vite build",
25
- "build:lib": "vite build --config vite.lib.config.ts",
26
- "build:types": "tsc -p tsconfig.build.json",
27
- "lint": "eslint .",
28
- "preview": "vite preview",
29
- "prepublishOnly": "npm run build:lib && npm run build:types",
30
- "type-check": "tsc --noEmit"
31
- },
32
- "keywords": [
33
- "react",
34
- "text-editor",
35
- "rich-text",
36
- "wysiwyg",
37
- "editor",
38
- "contenteditable"
39
- ],
40
- "author": "Abdul Jebar",
41
- "license": "MIT",
42
- "repository": {
43
- "type": "git",
44
- "url": "https://github.com/abduljebar49/text-editor"
45
- },
46
- "homepage": "https://github.com/abduljebar49/text-editor#readme",
47
- "bugs": {
48
- "url": "https://github.com/abduljebar49/text-editor/issues"
49
- },
50
- "peerDependencies": {
51
- "react": "^18.0.0 || ^19.0.0",
52
- "react-dom": "^18.0.0 || ^19.0.0"
53
- },
54
- "devDependencies": {
55
- "@eslint/js": "^9.36.0",
56
- "@tailwindcss/cli": "^4.1.14",
57
- "@tailwindcss/postcss": "^4.1.14",
58
- "@types/node": "^24.6.0",
59
- "@types/react": "^19.1.16",
60
- "@types/react-dom": "^19.1.9",
61
- "@vitejs/plugin-react": "^5.0.4",
62
- "autoprefixer": "^10.4.21",
63
- "eslint": "^9.36.0",
64
- "eslint-plugin-react-hooks": "^5.2.0",
65
- "eslint-plugin-react-refresh": "^0.4.22",
66
- "globals": "^16.4.0",
67
- "postcss": "^8.5.6",
68
- "tailwindcss": "^4.1.14",
69
- "typescript": "~5.9.3",
70
- "typescript-eslint": "^8.45.0",
71
- "vite": "^7.1.7",
72
- "vite-plugin-dts": "^4.5.4"
73
- },
74
- "dependencies": {
75
- "@tailwindcss/vite": "^4.1.14",
76
- "lucide-react": "^0.544.0",
77
- "react": "^18.0.0 || ^19.0.0",
78
- "react-dom": "^18.0.0 || ^19.0.0",
79
- "zustand": "^5.0.8"
80
- }
81
- }
1
+ {
2
+ "name": "@abduljebar/text-editor",
3
+ "version": "2.2.0",
4
+ "description": "A professional React text editor with export, save, and validation features",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "module": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "style": "./dist/index.css",
10
+ "files": [
11
+ "dist",
12
+ "README.md"
13
+ ],
14
+ "exports": {
15
+ ".": {
16
+ "import": "./dist/index.js",
17
+ "types": "./dist/index.d.ts",
18
+ "require": "./dist/index.js"
19
+ },
20
+ "./dist/index.css": "./dist/index.css"
21
+ },
22
+ "scripts": {
23
+ "dev": "vite",
24
+ "build": "vite build",
25
+ "build:lib": "vite build --config vite.lib.config.ts",
26
+ "build:types": "tsc -p tsconfig.build.json",
27
+ "lint": "eslint .",
28
+ "preview": "vite preview",
29
+ "prepublishOnly": "npm run build:lib && npm run build:types",
30
+ "type-check": "tsc --noEmit"
31
+ },
32
+ "keywords": [
33
+ "react",
34
+ "text-editor",
35
+ "rich-text",
36
+ "wysiwyg",
37
+ "editor",
38
+ "contenteditable"
39
+ ],
40
+ "author": "Abdul Jebar",
41
+ "license": "MIT",
42
+ "repository": {
43
+ "type": "git",
44
+ "url": "https://github.com/abduljebar49/text-editor"
45
+ },
46
+ "homepage": "https://github.com/abduljebar49/text-editor#readme",
47
+ "bugs": {
48
+ "url": "https://github.com/abduljebar49/text-editor/issues"
49
+ },
50
+ "peerDependencies": {
51
+ "react": "^18.0.0 || ^19.0.0",
52
+ "react-dom": "^18.0.0 || ^19.0.0"
53
+ },
54
+ "devDependencies": {
55
+ "@eslint/js": "^9.36.0",
56
+ "@tailwindcss/cli": "^4.1.14",
57
+ "@tailwindcss/postcss": "^4.1.14",
58
+ "@types/node": "^24.6.0",
59
+ "@types/react": "^19.1.16",
60
+ "@types/react-dom": "^19.1.9",
61
+ "@vitejs/plugin-react": "^5.0.4",
62
+ "autoprefixer": "^10.4.21",
63
+ "eslint": "^9.36.0",
64
+ "eslint-plugin-react-hooks": "^5.2.0",
65
+ "eslint-plugin-react-refresh": "^0.4.22",
66
+ "globals": "^16.4.0",
67
+ "postcss": "^8.5.6",
68
+ "tailwindcss": "^4.1.14",
69
+ "typescript": "~5.9.3",
70
+ "typescript-eslint": "^8.45.0",
71
+ "vite": "^7.1.7",
72
+ "vite-plugin-dts": "^4.5.4"
73
+ },
74
+ "dependencies": {
75
+ "@tailwindcss/vite": "^4.1.14",
76
+ "clsx": "^2.1.1",
77
+ "lucide-react": "^0.544.0",
78
+ "react": "^18.0.0 || ^19.0.0",
79
+ "react-dom": "^18.0.0 || ^19.0.0",
80
+ "tailwind-merge": "^3.3.1"
81
+ }
82
+ }
@@ -1,26 +0,0 @@
1
- import { z } from 'zod';
2
- export declare const EditorContentSchema: z.ZodObject<{
3
- title: z.ZodString;
4
- content: z.ZodString;
5
- format: z.ZodDefault<z.ZodEnum<{
6
- html: "html";
7
- markdown: "markdown";
8
- }>>;
9
- metadata: z.ZodOptional<z.ZodObject<{
10
- createdAt: z.ZodString;
11
- updatedAt: z.ZodString;
12
- wordCount: z.ZodNumber;
13
- characterCount: z.ZodNumber;
14
- }, z.core.$strip>>;
15
- }, z.core.$strip>;
16
- export declare const ExportOptionsSchema: z.ZodObject<{
17
- includeStyles: z.ZodDefault<z.ZodBoolean>;
18
- includeMeta: z.ZodDefault<z.ZodBoolean>;
19
- format: z.ZodDefault<z.ZodEnum<{
20
- html: "html";
21
- txt: "txt";
22
- }>>;
23
- }, z.core.$strip>;
24
- export type EditorContent = z.infer<typeof EditorContentSchema>;
25
- export type ExportOptions = z.infer<typeof ExportOptionsSchema>;
26
- //# sourceMappingURL=editor.schema.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"editor.schema.d.ts","sourceRoot":"","sources":["../../src/schemas/editor.schema.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;iBAU9B,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;;;;;iBAI9B,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAChE,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
@@ -1,53 +0,0 @@
1
- import { type EditorContent } from '../schemas/editor.schema';
2
- interface EditorState {
3
- content: string;
4
- title: string;
5
- wordCount: number;
6
- characterCount: number;
7
- hasUnsavedChanges: boolean;
8
- activeFormats: string[];
9
- }
10
- interface EditorActions {
11
- updateContent: (content: string) => void;
12
- updateTitle: (title: string) => void;
13
- setActiveFormats: (formats: string[]) => void;
14
- clearEditor: () => void;
15
- setHasUnsavedChanges: (hasChanges: boolean) => void;
16
- executeCommand: (command: string, value?: string) => void;
17
- updateActiveFormats: () => void;
18
- getValidationResult: () => {
19
- success: boolean;
20
- data?: EditorContent;
21
- error?: string;
22
- };
23
- exportToHTML: (options?: {
24
- includeStyles: boolean;
25
- includeMeta: boolean;
26
- }) => string;
27
- initializeContent: (content: string) => void;
28
- }
29
- export declare const useEditorStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<EditorState & EditorActions>, "setState" | "persist"> & {
30
- setState(partial: (EditorState & EditorActions) | Partial<EditorState & EditorActions> | ((state: EditorState & EditorActions) => (EditorState & EditorActions) | Partial<EditorState & EditorActions>), replace?: false | undefined): unknown;
31
- setState(state: (EditorState & EditorActions) | ((state: EditorState & EditorActions) => EditorState & EditorActions), replace: true): unknown;
32
- persist: {
33
- setOptions: (options: Partial<import("zustand/middleware").PersistOptions<EditorState & EditorActions, {
34
- content: string;
35
- title: string;
36
- wordCount: number;
37
- characterCount: number;
38
- }, unknown>>) => void;
39
- clearStorage: () => void;
40
- rehydrate: () => Promise<void> | void;
41
- hasHydrated: () => boolean;
42
- onHydrate: (fn: (state: EditorState & EditorActions) => void) => () => void;
43
- onFinishHydration: (fn: (state: EditorState & EditorActions) => void) => () => void;
44
- getOptions: () => Partial<import("zustand/middleware").PersistOptions<EditorState & EditorActions, {
45
- content: string;
46
- title: string;
47
- wordCount: number;
48
- characterCount: number;
49
- }, unknown>>;
50
- };
51
- }>;
52
- export {};
53
- //# sourceMappingURL=editor.store.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"editor.store.d.ts","sourceRoot":"","sources":["../../src/store/editor.store.ts"],"names":[],"mappings":"AAGA,OAAO,EAAuB,KAAK,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEnF,UAAU,WAAW;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,aAAa,EAAE,MAAM,EAAE,CAAC;CACzB;AAED,UAAU,aAAa;IACrB,aAAa,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,WAAW,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,gBAAgB,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAC9C,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,oBAAoB,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;IACpD,cAAc,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1D,mBAAmB,EAAE,MAAM,IAAI,CAAC;IAChC,mBAAmB,EAAE,MAAM;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,IAAI,CAAC,EAAE,aAAa,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACtF,YAAY,EAAE,CAAC,OAAO,CAAC,EAAE;QAAE,aAAa,EAAE,OAAO,CAAC;QAAC,WAAW,EAAE,OAAO,CAAA;KAAE,KAAK,MAAM,CAAC;IACrF,iBAAiB,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9C;AAgBD,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;EA0M1B,CAAC"}