@simoncomputing/mui-bueno-v2 0.17.3 → 0.17.4

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/CHANGELOG.md CHANGED
@@ -11,6 +11,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
11
11
  - Minor increment --> singlular/minor changes. Minimal breaking changes.
12
12
  - Patch increment --> singlular/minor changes. Zero breaking changes.
13
13
 
14
+ ## [0.17.4] - 2025-09-16
15
+
16
+ ### Changed
17
+
18
+ - `RichTextField`:
19
+ - Made `onUploadFiles` optional
20
+ - `RichTextControls`:
21
+ - Made `onUploadFiles` optional
22
+ - Hid upload image button when `onUploadFiles` is undefined
23
+
14
24
  ## [0.17.3] - 2025-09-16
15
25
 
16
26
  ### Fixed
@@ -78,11 +78,9 @@ export type CitationFieldProps = {
78
78
  /**
79
79
  * Rich Text field -- uses MUI Tip Tap
80
80
  *
81
- * IMPORTANT: As per Mui TipTap's documentation, it's not efficient to use it as a fully controlled component since the
82
- * editor content has to be serialized to HTML (which is what is stored in Formik). Therefore, keep in mind that what is
83
- * shown in the editor will not match the Formik value until the field __loses focus__.
84
- *
85
- * Recommended to use with `CitationFieldProvider` for cross-field synchronization.
81
+ * Formik -- This field cannot be completely controlled, so keep in mind that the Formik value will not update until the field
82
+ * __loses focus__. This is to prevent issues with converting from rich text to HTML as the user types as it could override
83
+ * their changes unintentionally.
86
84
  */
87
85
  export declare const CitationField: (props: CitationFieldProps) => import("react/jsx-runtime").JSX.Element;
88
86
  export default CitationField;
@@ -1,10 +1,9 @@
1
1
  import { Citation } from '../../../../../@types';
2
2
  interface SyncContextType {
3
3
  citations: Citation[];
4
- isLoaded: boolean;
4
+ resync: () => void;
5
5
  addUpdateCitation: (citation: Citation) => void;
6
6
  deleteCitation: (id: number) => void;
7
- batchUpdate: (newCitations: Citation[]) => void;
8
7
  }
9
8
  export declare const SyncContext: import('react').Context<SyncContextType | undefined>;
10
9
  export declare const useCitationSync: () => SyncContextType;
@@ -4,14 +4,5 @@ type CitationFieldProviderProps = {
4
4
  children: React.ReactNode;
5
5
  getCitations: () => Promise<Citation[]>;
6
6
  };
7
- /**
8
- * CitationFieldProvider ensures `CitationField` stays in sync with other `CitationField` components. Always
9
- * use when multiple `CitationField` components are on the same page.
10
- *
11
- * NOTE: The provider is optimized to reduce excessive API calls. Currently, it will only perform the inital full
12
- * data fetch on initial load. Subsequent changes are updated locally based on what add/update/delete actions
13
- * are made by the user, but any remote additions/updates/deletions will not be fetched. Keep this in mind when
14
- * deciding what level to place the provider in your app so that you can control how often the provider is initialized.
15
- */
16
7
  export declare const CitationFieldProvider: React.FC<CitationFieldProviderProps>;
17
8
  export {};
@@ -40,7 +40,7 @@ export interface CitationMenuProps {
40
40
  *
41
41
  * Currently, this will be called when the data in the citations table changes, and when the content itself changes (ex. clicks on "Add Citation")
42
42
  */
43
- onContentChange?: () => void;
43
+ onContentUpdate?: () => void;
44
44
  /**
45
45
  * Error callback.
46
46
  *
@@ -70,5 +70,5 @@ export declare enum CitationMenuState {
70
70
  *
71
71
  * Intended to be used within a bubble/pop-up/modal/dialog. For in-line citations, see CitationField instead.
72
72
  */
73
- export declare function CitationMenu({ getCitationsPaginated, onCreateCitation, onUpdateCitation, onDeleteCitation, getCitationById, onSelectCitations, onCancel, initialSelectedIds, onContentChange, onError, }: CitationMenuProps): import("react/jsx-runtime").JSX.Element;
73
+ export declare function CitationMenu({ getCitationsPaginated, onCreateCitation, onUpdateCitation, onDeleteCitation, getCitationById, onSelectCitations, onCancel, initialSelectedIds, onContentUpdate, onError, }: CitationMenuProps): import("react/jsx-runtime").JSX.Element;
74
74
  export default CitationMenu;
@@ -19,7 +19,6 @@ export type CitationTableProps = {
19
19
  */
20
20
  onError?: (err: string) => void;
21
21
  setError: React.Dispatch<React.SetStateAction<CitationMenuError | undefined>>;
22
- setSuccess: React.Dispatch<React.SetStateAction<string | undefined>>;
23
22
  };
24
23
  declare const CitationTable: (props: CitationTableProps) => import("react/jsx-runtime").JSX.Element;
25
24
  export default CitationTable;
@@ -1,6 +1,6 @@
1
1
  import { ImageNodeAttributes } from 'mui-tiptap';
2
2
  export type RichTextControlsProps = {
3
- onUploadFiles: (files: File[]) => ImageNodeAttributes[] | Promise<ImageNodeAttributes[]>;
3
+ onUploadFiles?: (files: File[]) => ImageNodeAttributes[] | Promise<ImageNodeAttributes[]>;
4
4
  };
5
5
  export declare const RichTextControls: (props: RichTextControlsProps) => import("react/jsx-runtime").JSX.Element;
6
6
  export default RichTextControls;
@@ -17,7 +17,7 @@ export type RichTextEditorProps = {
17
17
  /**
18
18
  * Handler for uploading files/images. Use this to save your images to your server (ex. S3 Bucket).
19
19
  */
20
- onUploadFiles: (files: File[]) => ImageNodeAttributes[] | Promise<ImageNodeAttributes[]>;
20
+ onUploadFiles?: (files: File[]) => ImageNodeAttributes[] | Promise<ImageNodeAttributes[]>;
21
21
  /**
22
22
  * If `true`, the component becomes readonly.
23
23
  * @default false