@farmzone/fz-react-ui 1.1.16 → 1.1.18
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/index.cjs +427 -33
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +21 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.js +431 -37
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1332,6 +1332,15 @@ interface RichEditorThemeOverride {
|
|
|
1332
1332
|
mention?: Partial<RichEditorThemeTokens["mention"]>;
|
|
1333
1333
|
}
|
|
1334
1334
|
|
|
1335
|
+
interface FileAttachment {
|
|
1336
|
+
id: string;
|
|
1337
|
+
name: string;
|
|
1338
|
+
size: number;
|
|
1339
|
+
mimeType: string;
|
|
1340
|
+
file: File;
|
|
1341
|
+
url: string;
|
|
1342
|
+
}
|
|
1343
|
+
|
|
1335
1344
|
type RichEditorHeadingLevel = 1 | 2 | 3 | 4;
|
|
1336
1345
|
interface MentionItem {
|
|
1337
1346
|
id: string;
|
|
@@ -1363,6 +1372,7 @@ interface RichEditorHandle {
|
|
|
1363
1372
|
clearContent: () => void;
|
|
1364
1373
|
focus: () => void;
|
|
1365
1374
|
isEmpty: boolean;
|
|
1375
|
+
attachments: FileAttachment[];
|
|
1366
1376
|
editor: _tiptap_core.Editor | null;
|
|
1367
1377
|
}
|
|
1368
1378
|
interface RichEditorProps {
|
|
@@ -1390,6 +1400,9 @@ interface RichEditorProps {
|
|
|
1390
1400
|
editable?: boolean;
|
|
1391
1401
|
autofocus?: boolean | "start" | "end" | "all" | null;
|
|
1392
1402
|
onSubmit?: () => void;
|
|
1403
|
+
fileFormat?: ReadonlyArray<string>;
|
|
1404
|
+
onFileUpload?: (file: File) => string | Promise<string>;
|
|
1405
|
+
renderFilePreview?: (attachment: FileAttachment, onRemove: () => void) => ReactNode;
|
|
1393
1406
|
}
|
|
1394
1407
|
interface UseRichEditorOptions {
|
|
1395
1408
|
defaultValue?: string;
|
|
@@ -1406,6 +1419,8 @@ interface UseRichEditorOptions {
|
|
|
1406
1419
|
autofocus?: boolean | "start" | "end" | "all" | null;
|
|
1407
1420
|
editorClassName?: string;
|
|
1408
1421
|
additionalExtensions?: Extensions;
|
|
1422
|
+
fileFormat?: ReadonlyArray<string>;
|
|
1423
|
+
onFileUpload?: (file: File) => string | Promise<string>;
|
|
1409
1424
|
onChange?: (html: string) => void;
|
|
1410
1425
|
onSubmit?: () => void;
|
|
1411
1426
|
}
|
|
@@ -1421,6 +1436,7 @@ interface RichEditorToolbarProps {
|
|
|
1421
1436
|
toolbar?: RichEditorToolbarConfig;
|
|
1422
1437
|
className?: string;
|
|
1423
1438
|
zIndex?: number;
|
|
1439
|
+
onImageButtonClick?: () => void;
|
|
1424
1440
|
}
|
|
1425
1441
|
|
|
1426
1442
|
interface UseRichEditorReturn {
|
|
@@ -1431,6 +1447,11 @@ interface UseRichEditorReturn {
|
|
|
1431
1447
|
clearContent: () => void;
|
|
1432
1448
|
focus: () => void;
|
|
1433
1449
|
isEmpty: boolean;
|
|
1450
|
+
attachments: FileAttachment[];
|
|
1451
|
+
removeAttachment: (id: string) => void;
|
|
1452
|
+
hydrateAttachments: (loaded: FileAttachment[]) => void;
|
|
1453
|
+
processFiles: (files: File[]) => void;
|
|
1454
|
+
isUploading: boolean;
|
|
1434
1455
|
}
|
|
1435
1456
|
declare function useRichEditor(options?: UseRichEditorOptions): UseRichEditorReturn;
|
|
1436
1457
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1332,6 +1332,15 @@ interface RichEditorThemeOverride {
|
|
|
1332
1332
|
mention?: Partial<RichEditorThemeTokens["mention"]>;
|
|
1333
1333
|
}
|
|
1334
1334
|
|
|
1335
|
+
interface FileAttachment {
|
|
1336
|
+
id: string;
|
|
1337
|
+
name: string;
|
|
1338
|
+
size: number;
|
|
1339
|
+
mimeType: string;
|
|
1340
|
+
file: File;
|
|
1341
|
+
url: string;
|
|
1342
|
+
}
|
|
1343
|
+
|
|
1335
1344
|
type RichEditorHeadingLevel = 1 | 2 | 3 | 4;
|
|
1336
1345
|
interface MentionItem {
|
|
1337
1346
|
id: string;
|
|
@@ -1363,6 +1372,7 @@ interface RichEditorHandle {
|
|
|
1363
1372
|
clearContent: () => void;
|
|
1364
1373
|
focus: () => void;
|
|
1365
1374
|
isEmpty: boolean;
|
|
1375
|
+
attachments: FileAttachment[];
|
|
1366
1376
|
editor: _tiptap_core.Editor | null;
|
|
1367
1377
|
}
|
|
1368
1378
|
interface RichEditorProps {
|
|
@@ -1390,6 +1400,9 @@ interface RichEditorProps {
|
|
|
1390
1400
|
editable?: boolean;
|
|
1391
1401
|
autofocus?: boolean | "start" | "end" | "all" | null;
|
|
1392
1402
|
onSubmit?: () => void;
|
|
1403
|
+
fileFormat?: ReadonlyArray<string>;
|
|
1404
|
+
onFileUpload?: (file: File) => string | Promise<string>;
|
|
1405
|
+
renderFilePreview?: (attachment: FileAttachment, onRemove: () => void) => ReactNode;
|
|
1393
1406
|
}
|
|
1394
1407
|
interface UseRichEditorOptions {
|
|
1395
1408
|
defaultValue?: string;
|
|
@@ -1406,6 +1419,8 @@ interface UseRichEditorOptions {
|
|
|
1406
1419
|
autofocus?: boolean | "start" | "end" | "all" | null;
|
|
1407
1420
|
editorClassName?: string;
|
|
1408
1421
|
additionalExtensions?: Extensions;
|
|
1422
|
+
fileFormat?: ReadonlyArray<string>;
|
|
1423
|
+
onFileUpload?: (file: File) => string | Promise<string>;
|
|
1409
1424
|
onChange?: (html: string) => void;
|
|
1410
1425
|
onSubmit?: () => void;
|
|
1411
1426
|
}
|
|
@@ -1421,6 +1436,7 @@ interface RichEditorToolbarProps {
|
|
|
1421
1436
|
toolbar?: RichEditorToolbarConfig;
|
|
1422
1437
|
className?: string;
|
|
1423
1438
|
zIndex?: number;
|
|
1439
|
+
onImageButtonClick?: () => void;
|
|
1424
1440
|
}
|
|
1425
1441
|
|
|
1426
1442
|
interface UseRichEditorReturn {
|
|
@@ -1431,6 +1447,11 @@ interface UseRichEditorReturn {
|
|
|
1431
1447
|
clearContent: () => void;
|
|
1432
1448
|
focus: () => void;
|
|
1433
1449
|
isEmpty: boolean;
|
|
1450
|
+
attachments: FileAttachment[];
|
|
1451
|
+
removeAttachment: (id: string) => void;
|
|
1452
|
+
hydrateAttachments: (loaded: FileAttachment[]) => void;
|
|
1453
|
+
processFiles: (files: File[]) => void;
|
|
1454
|
+
isUploading: boolean;
|
|
1434
1455
|
}
|
|
1435
1456
|
declare function useRichEditor(options?: UseRichEditorOptions): UseRichEditorReturn;
|
|
1436
1457
|
|