@abduljebar/text-editor 1.1.2 → 1.1.4
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/App.d.ts.map +1 -1
- package/dist/components/TextEditor.d.ts +4 -2
- package/dist/components/TextEditor.d.ts.map +1 -1
- package/dist/components/Toolbar.d.ts +2 -1
- package/dist/components/Toolbar.d.ts.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4344 -1486
- package/dist/index.umd.cjs +26 -26
- package/dist/store/editor.store.d.ts +53 -0
- package/dist/store/editor.store.d.ts.map +1 -0
- package/dist/types/editor.d.ts +5 -1
- package/dist/types/editor.d.ts.map +1 -1
- package/package.json +6 -2
|
@@ -0,0 +1,53 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
package/dist/types/editor.d.ts
CHANGED
|
@@ -2,7 +2,11 @@ export interface TextEditorProps {
|
|
|
2
2
|
initialContent?: string;
|
|
3
3
|
onSave?: (content: string, html: string) => void;
|
|
4
4
|
onExport?: (html: string) => void;
|
|
5
|
-
|
|
5
|
+
onChange?: (content: string, html: string, title?: string) => void;
|
|
6
|
+
showButtons?: boolean;
|
|
7
|
+
showSaveTitle?: boolean;
|
|
8
|
+
showStatusBar?: boolean;
|
|
9
|
+
height?: string | number;
|
|
6
10
|
}
|
|
7
11
|
export interface ToolbarButton {
|
|
8
12
|
command: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../../src/types/editor.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../../src/types/editor.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC9B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACjD,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACnE,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,iBAAiB,EAAE,OAAO,CAAC;CAC5B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abduljebar/text-editor",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.4",
|
|
4
4
|
"description": "A professional React text editor with export, save, and validation features",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -73,8 +73,12 @@
|
|
|
73
73
|
},
|
|
74
74
|
"dependencies": {
|
|
75
75
|
"@tailwindcss/vite": "^4.1.14",
|
|
76
|
+
"clsx": "^2.1.1",
|
|
76
77
|
"lucide-react": "^0.544.0",
|
|
77
78
|
"react": "^18.0.0 || ^19.0.0",
|
|
78
|
-
"react-dom": "^18.0.0 || ^19.0.0"
|
|
79
|
+
"react-dom": "^18.0.0 || ^19.0.0",
|
|
80
|
+
"tailwind-merge": "^3.3.1",
|
|
81
|
+
"zod": "^4.1.12",
|
|
82
|
+
"zustand": "^5.0.8"
|
|
79
83
|
}
|
|
80
84
|
}
|