draftify-react 0.2.7 → 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/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,
@@ -247,6 +248,8 @@ export interface DraftifyReactProps {
247
248
  localStorageEnable?: boolean;
248
249
 
249
250
  backgroundEnable?: boolean;
251
+
252
+ DraftifyBackground?: string;
250
253
  }
251
254
 
252
255
  declare function DraftifyReact(props: DraftifyReactProps): JSX.Element;
@@ -283,8 +286,8 @@ declare function DraftifyBlocksReader(props: ReaderProps): JSX.Element;
283
286
  ───────────────────────────── */
284
287
 
285
288
  export interface UseDraftifyReactProps {
286
- blocksData: DraftifyBlock[];
287
- modifyBlocks: React.Dispatch<React.SetStateAction<DraftifyBlock[]>>;
289
+ draftifyDoc: DraftifyDocument;
290
+ setDoc: React.Dispatch<React.SetStateAction<DraftifyDocument>>;
288
291
  defaultCustomData1: any;
289
292
  defaultCustomData2: any;
290
293
  defaultCustomData3: any;
@@ -312,7 +315,7 @@ export declare function useDraftifyReact(props: UseDraftifyReactProps): {
312
315
  setPromptAction: React.Dispatch<React.SetStateAction<string>>;
313
316
  promptVisibility: boolean;
314
317
  setPromptVisiblility: React.Dispatch<React.SetStateAction<boolean>>;
315
- handlePromptAction: (action: string, option?: string) => void;
318
+ handlePromptAction: (action: string) => void;
316
319
 
317
320
  /* blocks */
318
321
  blocksData: DraftifyBlock[];
@@ -360,7 +363,7 @@ declare function dropHandler(
360
363
  setFile: React.Dispatch<React.SetStateAction<File | null>>,
361
364
  setFileName: React.Dispatch<React.SetStateAction<string>>,
362
365
  setCompressing: React.Dispatch<React.SetStateAction<boolean>>,
363
- setCompressionProgress: React.Dispatch<React.SetStateAction<number>>
366
+ setCompressionProgress: React.Dispatch<React.SetStateAction<number>>,
364
367
  ): Promise<void>;
365
368
 
366
369
  declare function onFileChange(
@@ -368,17 +371,17 @@ declare function onFileChange(
368
371
  setFile: React.Dispatch<React.SetStateAction<File | null>>,
369
372
  setFileName: React.Dispatch<React.SetStateAction<string>>,
370
373
  setCompressing: React.Dispatch<React.SetStateAction<boolean>>,
371
- setCompressionProgress: React.Dispatch<React.SetStateAction<number>>
374
+ setCompressionProgress: React.Dispatch<React.SetStateAction<number>>,
372
375
  ): Promise<void>;
373
376
 
374
377
  declare function dragHandler(
375
378
  e: React.DragEvent,
376
- output: React.RefObject<HTMLElement | null>
379
+ output: React.RefObject<HTMLElement | null>,
377
380
  ): void;
378
381
 
379
382
  declare function dragLeaveHandler(
380
383
  e: React.DragEvent | React.MouseEvent<HTMLDivElement, MouseEvent>,
381
- output: React.RefObject<HTMLElement | null>
384
+ output: React.RefObject<HTMLElement | null>,
382
385
  ): void;
383
386
 
384
387
  /* ─────────────────────────────
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "draftify-react",
3
- "version": "0.2.7",
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
  },