draftify-react 0.2.8 → 0.2.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.
- package/dist/draftify-react.es.js +1429 -1439
- package/dist/draftify-react.umd.js +8 -8
- package/index.d.ts +13 -12
- package/package.json +3 -1
package/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { JSX } from "react";
|
|
|
2
2
|
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
|
|
5
|
-
import type { DraftifyBlock } from "draftify";
|
|
5
|
+
import type { DraftifyBlock, DraftifyDocument } from "draftify";
|
|
6
6
|
|
|
7
7
|
/* ─────────────────────────────
|
|
8
8
|
Core domain types
|
|
@@ -136,7 +136,7 @@ export interface UseDraftifyReactReturn {
|
|
|
136
136
|
|
|
137
137
|
promptAction: string;
|
|
138
138
|
setPromptAction: (v: string) => void;
|
|
139
|
-
handlePromptAction: (action: string
|
|
139
|
+
handlePromptAction: (action: string) => void;
|
|
140
140
|
|
|
141
141
|
/* blocks */
|
|
142
142
|
blocksData: BaseBlock[];
|
|
@@ -179,7 +179,7 @@ export interface UseDraftifyReactReturn {
|
|
|
179
179
|
───────────────────────────── */
|
|
180
180
|
|
|
181
181
|
export function useDraftifyReact(
|
|
182
|
-
initialBlocks?: InitialBlocks
|
|
182
|
+
initialBlocks?: InitialBlocks,
|
|
183
183
|
): UseDraftifyReactReturn;
|
|
184
184
|
|
|
185
185
|
/* ─────────────────────────────
|
|
@@ -187,11 +187,12 @@ export function useDraftifyReact(
|
|
|
187
187
|
───────────────────────────── */
|
|
188
188
|
|
|
189
189
|
export interface DraftifyReactProps {
|
|
190
|
-
|
|
190
|
+
draftifyDoc: DraftifyDocument;
|
|
191
191
|
|
|
192
|
-
|
|
192
|
+
setDoc: React.Dispatch<React.SetStateAction<DraftifyDocument>>;
|
|
193
193
|
|
|
194
194
|
options: string[];
|
|
195
|
+
|
|
195
196
|
CustomEditor1?: ({
|
|
196
197
|
customBlock,
|
|
197
198
|
modifyCustom,
|
|
@@ -285,8 +286,8 @@ declare function DraftifyBlocksReader(props: ReaderProps): JSX.Element;
|
|
|
285
286
|
───────────────────────────── */
|
|
286
287
|
|
|
287
288
|
export interface UseDraftifyReactProps {
|
|
288
|
-
|
|
289
|
-
|
|
289
|
+
draftifyDoc: DraftifyDocument;
|
|
290
|
+
setDoc: React.Dispatch<React.SetStateAction<DraftifyDocument>>;
|
|
290
291
|
defaultCustomData1: any;
|
|
291
292
|
defaultCustomData2: any;
|
|
292
293
|
defaultCustomData3: any;
|
|
@@ -314,7 +315,7 @@ export declare function useDraftifyReact(props: UseDraftifyReactProps): {
|
|
|
314
315
|
setPromptAction: React.Dispatch<React.SetStateAction<string>>;
|
|
315
316
|
promptVisibility: boolean;
|
|
316
317
|
setPromptVisiblility: React.Dispatch<React.SetStateAction<boolean>>;
|
|
317
|
-
handlePromptAction: (action: string
|
|
318
|
+
handlePromptAction: (action: string) => void;
|
|
318
319
|
|
|
319
320
|
/* blocks */
|
|
320
321
|
blocksData: DraftifyBlock[];
|
|
@@ -362,7 +363,7 @@ declare function dropHandler(
|
|
|
362
363
|
setFile: React.Dispatch<React.SetStateAction<File | null>>,
|
|
363
364
|
setFileName: React.Dispatch<React.SetStateAction<string>>,
|
|
364
365
|
setCompressing: React.Dispatch<React.SetStateAction<boolean>>,
|
|
365
|
-
setCompressionProgress: React.Dispatch<React.SetStateAction<number
|
|
366
|
+
setCompressionProgress: React.Dispatch<React.SetStateAction<number>>,
|
|
366
367
|
): Promise<void>;
|
|
367
368
|
|
|
368
369
|
declare function onFileChange(
|
|
@@ -370,17 +371,17 @@ declare function onFileChange(
|
|
|
370
371
|
setFile: React.Dispatch<React.SetStateAction<File | null>>,
|
|
371
372
|
setFileName: React.Dispatch<React.SetStateAction<string>>,
|
|
372
373
|
setCompressing: React.Dispatch<React.SetStateAction<boolean>>,
|
|
373
|
-
setCompressionProgress: React.Dispatch<React.SetStateAction<number
|
|
374
|
+
setCompressionProgress: React.Dispatch<React.SetStateAction<number>>,
|
|
374
375
|
): Promise<void>;
|
|
375
376
|
|
|
376
377
|
declare function dragHandler(
|
|
377
378
|
e: React.DragEvent,
|
|
378
|
-
output: React.RefObject<HTMLElement | null
|
|
379
|
+
output: React.RefObject<HTMLElement | null>,
|
|
379
380
|
): void;
|
|
380
381
|
|
|
381
382
|
declare function dragLeaveHandler(
|
|
382
383
|
e: React.DragEvent | React.MouseEvent<HTMLDivElement, MouseEvent>,
|
|
383
|
-
output: React.RefObject<HTMLElement | null
|
|
384
|
+
output: React.RefObject<HTMLElement | null>,
|
|
384
385
|
): void;
|
|
385
386
|
|
|
386
387
|
/* ─────────────────────────────
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "draftify-react",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.9",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/draftify-react.umd.js",
|
|
6
6
|
"module": "dist/draftify-react.es.js",
|
|
@@ -33,9 +33,11 @@
|
|
|
33
33
|
"@fortawesome/free-solid-svg-icons": "^7.1.0",
|
|
34
34
|
"@fortawesome/react-fontawesome": "^3.1.0",
|
|
35
35
|
"browser-image-compression": "^2.0.2",
|
|
36
|
+
"draftify": "^0.1.4",
|
|
36
37
|
"framer-motion": "^12.23.24"
|
|
37
38
|
},
|
|
38
39
|
"devDependencies": {
|
|
40
|
+
"@types/react": "^19.2.9",
|
|
39
41
|
"@vitejs/plugin-react": "^5.0.4",
|
|
40
42
|
"vite": "^7.1.7"
|
|
41
43
|
},
|