draftify-react 0.2.8 → 0.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.
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, option?: string) => void;
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
- blocksData: DraftifyBlock[];
190
+ draftifyDoc: DraftifyDocument;
191
191
 
192
- modifyBlocks: React.Dispatch<React.SetStateAction<DraftifyBlock[]>>;
192
+ setDoc: React.Dispatch<React.SetStateAction<DraftifyDocument>>;
193
193
 
194
194
  options: string[];
195
+
195
196
  CustomEditor1?: ({
196
197
  customBlock,
197
198
  modifyCustom,
@@ -249,12 +250,15 @@ export interface DraftifyReactProps {
249
250
  backgroundEnable?: boolean;
250
251
 
251
252
  DraftifyBackground?: string;
253
+
254
+ fontFamily?: string;
252
255
  }
253
256
 
254
257
  declare function DraftifyReact(props: DraftifyReactProps): JSX.Element;
255
258
 
256
259
  export interface ReaderProps {
257
260
  blocksData: DraftifyBlock[];
261
+ fontFamily?: string;
258
262
  CustomOutput1?: ({
259
263
  customBlock,
260
264
  modifyCustom,
@@ -285,8 +289,8 @@ declare function DraftifyBlocksReader(props: ReaderProps): JSX.Element;
285
289
  ───────────────────────────── */
286
290
 
287
291
  export interface UseDraftifyReactProps {
288
- blocksData: DraftifyBlock[];
289
- modifyBlocks: React.Dispatch<React.SetStateAction<DraftifyBlock[]>>;
292
+ draftifyDoc: DraftifyDocument;
293
+ setDoc: React.Dispatch<React.SetStateAction<DraftifyDocument>>;
290
294
  defaultCustomData1: any;
291
295
  defaultCustomData2: any;
292
296
  defaultCustomData3: any;
@@ -314,7 +318,7 @@ export declare function useDraftifyReact(props: UseDraftifyReactProps): {
314
318
  setPromptAction: React.Dispatch<React.SetStateAction<string>>;
315
319
  promptVisibility: boolean;
316
320
  setPromptVisiblility: React.Dispatch<React.SetStateAction<boolean>>;
317
- handlePromptAction: (action: string, option?: string) => void;
321
+ handlePromptAction: (action: string) => void;
318
322
 
319
323
  /* blocks */
320
324
  blocksData: DraftifyBlock[];
@@ -362,7 +366,7 @@ declare function dropHandler(
362
366
  setFile: React.Dispatch<React.SetStateAction<File | null>>,
363
367
  setFileName: React.Dispatch<React.SetStateAction<string>>,
364
368
  setCompressing: React.Dispatch<React.SetStateAction<boolean>>,
365
- setCompressionProgress: React.Dispatch<React.SetStateAction<number>>
369
+ setCompressionProgress: React.Dispatch<React.SetStateAction<number>>,
366
370
  ): Promise<void>;
367
371
 
368
372
  declare function onFileChange(
@@ -370,17 +374,17 @@ declare function onFileChange(
370
374
  setFile: React.Dispatch<React.SetStateAction<File | null>>,
371
375
  setFileName: React.Dispatch<React.SetStateAction<string>>,
372
376
  setCompressing: React.Dispatch<React.SetStateAction<boolean>>,
373
- setCompressionProgress: React.Dispatch<React.SetStateAction<number>>
377
+ setCompressionProgress: React.Dispatch<React.SetStateAction<number>>,
374
378
  ): Promise<void>;
375
379
 
376
380
  declare function dragHandler(
377
381
  e: React.DragEvent,
378
- output: React.RefObject<HTMLElement | null>
382
+ output: React.RefObject<HTMLElement | null>,
379
383
  ): void;
380
384
 
381
385
  declare function dragLeaveHandler(
382
386
  e: React.DragEvent | React.MouseEvent<HTMLDivElement, MouseEvent>,
383
- output: React.RefObject<HTMLElement | null>
387
+ output: React.RefObject<HTMLElement | null>,
384
388
  ): void;
385
389
 
386
390
  /* ─────────────────────────────
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "draftify-react",
3
- "version": "0.2.8",
3
+ "version": "0.3.0",
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
  },