@scalably/ui 0.11.1 → 0.11.3

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.d.cts CHANGED
@@ -917,7 +917,9 @@ interface FileUploadError {
917
917
  }
918
918
  interface FileUploadFile {
919
919
  id: string;
920
- file: File;
920
+ file?: File;
921
+ name?: string;
922
+ type?: string;
921
923
  preview?: string;
922
924
  status: "pending" | "uploading" | "success" | "error";
923
925
  error?: FileUploadError;
@@ -940,6 +942,11 @@ interface FileUploadProps {
940
942
  onUploadSuccess?: (files: File[]) => void;
941
943
  onUploadError?: (error: FileUploadError) => void;
942
944
  onFileRemove?: (fileId: string) => void;
945
+ /**
946
+ * Optional default file source (URL).
947
+ * This is used to display an existing file when the component initializes.
948
+ */
949
+ defaultFileSrc?: string;
943
950
  /**
944
951
  * Accepted file types. Can be:
945
952
  * - MIME types (e.g., 'image/jpeg', 'image/png') - **Recommended**
@@ -2867,6 +2874,12 @@ interface RichTextEditorProps {
2867
2874
  * user can then confirm insertion with "Save".
2868
2875
  */
2869
2876
  onImageUpload?: (file: File) => Promise<string>;
2877
+ /**
2878
+ * Message shown when `onImageUpload` fails. Use a string for fixed copy, or
2879
+ * a function `(error) => string` to derive text from the rejection reason.
2880
+ * When omitted, the editor uses a default English message.
2881
+ */
2882
+ imageUploadErrorMessage?: string | ((error: unknown) => string);
2870
2883
  /**
2871
2884
  * Controls how users are allowed to provide image sources.
2872
2885
  *
@@ -3052,7 +3065,7 @@ interface RichTextEditorProps {
3052
3065
  * @see RichTextViewer - Read-only viewer component for displaying rich text content
3053
3066
  */
3054
3067
  declare const RichTextEditor: {
3055
- ({ value, onChange, label, error, helperText, placeholder, minHeight, simple, disabled, "data-testid": dataTestId, containerClassName, borderContainerClassName, toolbarClassName, contentClassName, editorClassName, labelClassName, messageContainerClassName, onImageUpload, imageSourceMode, maxCharacters, onMaxLengthExceed, immediatelyRender, stickyToolbar, stickyOffset, hideToolbar, withBorder, enableBubbleMenu, enableFloatingMenu, floatingMenuTriggers, plusMenuYOffset, }: RichTextEditorProps): react_jsx_runtime.JSX.Element;
3068
+ ({ value, onChange, label, error, helperText, placeholder, minHeight, simple, disabled, "data-testid": dataTestId, containerClassName, borderContainerClassName, toolbarClassName, contentClassName, editorClassName, labelClassName, messageContainerClassName, onImageUpload, imageUploadErrorMessage, imageSourceMode, maxCharacters, onMaxLengthExceed, immediatelyRender, stickyToolbar, stickyOffset, hideToolbar, withBorder, enableBubbleMenu, enableFloatingMenu, floatingMenuTriggers, plusMenuYOffset, }: RichTextEditorProps): react_jsx_runtime.JSX.Element;
3056
3069
  displayName: string;
3057
3070
  };
3058
3071
 
package/dist/index.d.ts CHANGED
@@ -917,7 +917,9 @@ interface FileUploadError {
917
917
  }
918
918
  interface FileUploadFile {
919
919
  id: string;
920
- file: File;
920
+ file?: File;
921
+ name?: string;
922
+ type?: string;
921
923
  preview?: string;
922
924
  status: "pending" | "uploading" | "success" | "error";
923
925
  error?: FileUploadError;
@@ -940,6 +942,11 @@ interface FileUploadProps {
940
942
  onUploadSuccess?: (files: File[]) => void;
941
943
  onUploadError?: (error: FileUploadError) => void;
942
944
  onFileRemove?: (fileId: string) => void;
945
+ /**
946
+ * Optional default file source (URL).
947
+ * This is used to display an existing file when the component initializes.
948
+ */
949
+ defaultFileSrc?: string;
943
950
  /**
944
951
  * Accepted file types. Can be:
945
952
  * - MIME types (e.g., 'image/jpeg', 'image/png') - **Recommended**
@@ -2867,6 +2874,12 @@ interface RichTextEditorProps {
2867
2874
  * user can then confirm insertion with "Save".
2868
2875
  */
2869
2876
  onImageUpload?: (file: File) => Promise<string>;
2877
+ /**
2878
+ * Message shown when `onImageUpload` fails. Use a string for fixed copy, or
2879
+ * a function `(error) => string` to derive text from the rejection reason.
2880
+ * When omitted, the editor uses a default English message.
2881
+ */
2882
+ imageUploadErrorMessage?: string | ((error: unknown) => string);
2870
2883
  /**
2871
2884
  * Controls how users are allowed to provide image sources.
2872
2885
  *
@@ -3052,7 +3065,7 @@ interface RichTextEditorProps {
3052
3065
  * @see RichTextViewer - Read-only viewer component for displaying rich text content
3053
3066
  */
3054
3067
  declare const RichTextEditor: {
3055
- ({ value, onChange, label, error, helperText, placeholder, minHeight, simple, disabled, "data-testid": dataTestId, containerClassName, borderContainerClassName, toolbarClassName, contentClassName, editorClassName, labelClassName, messageContainerClassName, onImageUpload, imageSourceMode, maxCharacters, onMaxLengthExceed, immediatelyRender, stickyToolbar, stickyOffset, hideToolbar, withBorder, enableBubbleMenu, enableFloatingMenu, floatingMenuTriggers, plusMenuYOffset, }: RichTextEditorProps): react_jsx_runtime.JSX.Element;
3068
+ ({ value, onChange, label, error, helperText, placeholder, minHeight, simple, disabled, "data-testid": dataTestId, containerClassName, borderContainerClassName, toolbarClassName, contentClassName, editorClassName, labelClassName, messageContainerClassName, onImageUpload, imageUploadErrorMessage, imageSourceMode, maxCharacters, onMaxLengthExceed, immediatelyRender, stickyToolbar, stickyOffset, hideToolbar, withBorder, enableBubbleMenu, enableFloatingMenu, floatingMenuTriggers, plusMenuYOffset, }: RichTextEditorProps): react_jsx_runtime.JSX.Element;
3056
3069
  displayName: string;
3057
3070
  };
3058
3071