@simoncomputing/mui-bueno-v2 0.16.1 → 0.17.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/CHANGELOG.md CHANGED
@@ -11,6 +11,25 @@ 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.0] - 2025-09-TBD
15
+
16
+ ### Changed
17
+
18
+ - `CitationField`:
19
+ - Renamed `fetchExistingCitations` to `getCitationsPaginated`
20
+ - Renamed menu button to "Insert Citation/Attachments" (formerly "Insert Citation")
21
+ - `CitationFieldProvider`: Renamed `fetchExistingCitations` to `getCitations`
22
+
23
+ ### Fixed
24
+
25
+ - `CitationField`: Fixed citation link not displaying initially for newly uploaded attachments.
26
+
27
+ ## [0.16.2] - 2025-08-15
28
+
29
+ ### Added
30
+
31
+ - `Table`: Made mobile cards horizontally scrollable when the contents are too wide to fit in the card. Made the mobile cards column names avoid text wrap to make them easier to read.
32
+
14
33
  ## [0.16.1] - 2025-08-12
15
34
 
16
35
  ### Added
@@ -164,7 +164,7 @@ export type CheckboxOption =
164
164
 
165
165
  /**
166
166
  * Used for CitationField
167
- * Represents a citation (web article/attachment/other url)
167
+ * Represents a citation (url or attachment)
168
168
  */
169
169
  export type Citation = {
170
170
  id: number;
@@ -172,9 +172,13 @@ export type Citation = {
172
172
  updatedBy?: number;
173
173
  deletedBy?: number;
174
174
 
175
+ title: string;
176
+
177
+ // for attachments
175
178
  fileName?: string;
179
+
180
+ // for urls
176
181
  url?: string;
177
- title: string;
178
182
  source?: string; // publisher
179
183
  accessedAt?: string | null;
180
184
  classification?: string; // public, unclassified
@@ -186,12 +190,9 @@ export type Citation = {
186
190
  */
187
191
  export type UnsavedCitation = {
188
192
  id?: number;
193
+ type: 'Url' | 'Attachment';
194
+ file?: File;
189
195
  } & Omit<Citation, 'id'>;
190
196
 
191
- /**
192
- * Used for CitationField
193
- * Used to represent a (potentially) unsaved Attachment (same as UnsavedCitation but with a File obj)
194
- */
195
- export type UnsavedAttachment = {
196
- file?: File;
197
- } & UnsavedCitation;
197
+ type UnsavedUrlCitation = Omit<UnsavedCitation, 'type'> & { type: 'Url' };
198
+ type UnsavedAttachmentCitation = Omit<UnsavedCitation, 'type'> & { type: 'Attachment' };
@@ -1,4 +1,4 @@
1
- import { Citation, PageState, PageResponse, UnsavedCitation, UnsavedAttachment } from '../../../../@types';
1
+ import { Citation, PageState, PageResponse, UnsavedCitation } from '../../../../@types';
2
2
  export type CitationFieldProps = {
3
3
  /**
4
4
  * Name and ID of the component. Must match a key from initialValues in Formik.
@@ -42,13 +42,13 @@ export type CitationFieldProps = {
42
42
  *
43
43
  * Error handling is supported internally.
44
44
  */
45
- fetchExistingCitations: (req: PageState) => Promise<PageResponse<Citation>>;
45
+ getCitationsPaginated: (req: PageState) => Promise<PageResponse<Citation>>;
46
46
  /**
47
47
  * API call for creating a new citation/attachment.
48
48
  *
49
49
  * Error handling is supported internally.
50
50
  */
51
- onCreateCitation: (citation: UnsavedCitation) => Promise<Citation>;
51
+ onCreateCitation: (unsavedCitation: UnsavedCitation) => Promise<Citation>;
52
52
  /**
53
53
  * API call for updating a citation/attachment.
54
54
  *
@@ -67,12 +67,6 @@ export type CitationFieldProps = {
67
67
  * Error handling is supported internally.
68
68
  */
69
69
  getCitationById: (id: number) => Promise<Citation>;
70
- /**
71
- * API call for storing an attachment (ex. in an s3 bucket)
72
- *
73
- * Error handling is supported internally.
74
- */
75
- onStoreAttachment: (citation: UnsavedAttachment) => Promise<Citation>;
76
70
  /**
77
71
  * Error callback.
78
72
  *
@@ -2,7 +2,7 @@ import { default as React } from 'react';
2
2
  import { Citation } from '../../../../../@types';
3
3
  type CitationFieldProviderProps = {
4
4
  children: React.ReactNode;
5
- fetchExistingCitations: () => Promise<Citation[]>;
5
+ getCitations: () => Promise<Citation[]>;
6
6
  };
7
7
  export declare const CitationFieldProvider: React.FC<CitationFieldProviderProps>;
8
8
  export {};
@@ -1,8 +1,8 @@
1
- import { Citation, UnsavedAttachment } from '../../../../../@types';
1
+ import { Citation, UnsavedAttachmentCitation } from '../../../../../@types';
2
2
  import { CitationMenuError } from './CitationMenu';
3
3
  export type NewAttachmentFormProps = {
4
4
  id?: number;
5
- onSave: (citation: UnsavedAttachment) => Promise<void>;
5
+ onSave: (unsavedAttachment: UnsavedAttachmentCitation) => Promise<void>;
6
6
  onCancel: () => void;
7
7
  getCitationById: (id: number) => Promise<Citation>;
8
8
  disableFileUpload?: boolean;
@@ -24,4 +24,4 @@ export type CitationBubbleMenuProps = Partial<Except<ControlledBubbleMenuProps,
24
24
  * update, which will happen if it's a child of the component using
25
25
  * `useEditor`).
26
26
  */
27
- export default function CitationBubbleMenuTipTap({ fetchExistingCitations, onCreateCitation, onUpdateCitation, onDeleteCitation, getCitationById, onStoreAttachment, ...controlledBubbleMenuProps }: CitationBubbleMenuProps): import("react/jsx-runtime").JSX.Element | null;
27
+ export default function CitationBubbleMenuTipTap({ getCitationsPaginated, onCreateCitation, onUpdateCitation, onDeleteCitation, getCitationById, ...controlledBubbleMenuProps }: CitationBubbleMenuProps): import("react/jsx-runtime").JSX.Element | null;
@@ -1,8 +1,8 @@
1
- import { Citation, UnsavedCitation } from '../../../../../@types';
1
+ import { Citation, UnsavedUrlCitation } from '../../../../../@types';
2
2
  import { CitationMenuError } from './CitationMenu';
3
3
  export type CitationFormProps = {
4
4
  id?: number;
5
- onSave: (citation: UnsavedCitation) => Promise<void>;
5
+ onSave: (unsavedUrl: UnsavedUrlCitation) => Promise<void>;
6
6
  onCancel: () => void;
7
7
  getCitationById: (id: number) => Promise<Citation>;
8
8
  setError: React.Dispatch<React.SetStateAction<CitationMenuError | undefined>>;
@@ -1,9 +1,9 @@
1
- import { Citation, PageState, PageResponse, UnsavedCitation, UnsavedAttachment } from '../../../../../@types';
1
+ import { Citation, PageState, PageResponse, UnsavedCitation } from '../../../../../@types';
2
2
  export interface CitationMenuProps {
3
3
  /**
4
4
  * API call for fetching citations. These will populate the "Insert Citation/Attachment(s)" table.
5
5
  */
6
- fetchExistingCitations: (req: PageState) => Promise<PageResponse<Citation>>;
6
+ getCitationsPaginated: (req: PageState) => Promise<PageResponse<Citation>>;
7
7
  /**
8
8
  * API call for creating a new citation/attachment.
9
9
  */
@@ -20,10 +20,6 @@ export interface CitationMenuProps {
20
20
  * API call for retrieving a citation by id
21
21
  */
22
22
  getCitationById: (id: number) => Promise<Citation>;
23
- /**
24
- * API call for storing an attachment (ex. in an s3 bucket)
25
- */
26
- onStoreAttachment: (citation: UnsavedAttachment) => Promise<Citation>;
27
23
  /**
28
24
  * Set which citations should be pre-checked in the citations table when this component is first rendered (used
29
25
  * to initialize useState).
@@ -74,5 +70,5 @@ export declare enum CitationMenuState {
74
70
  *
75
71
  * Intended to be used within a bubble/pop-up/modal/dialog. For in-line citations, see CitationField instead.
76
72
  */
77
- export declare function CitationMenu({ fetchExistingCitations, onCreateCitation, onUpdateCitation, onDeleteCitation, getCitationById, onStoreAttachment, onSelectCitations, onCancel, initialSelectedIds, onContentUpdate, 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;
78
74
  export default CitationMenu;
@@ -8,7 +8,7 @@ export type CitationTableProps = {
8
8
  onEditAttachment: (citation: Citation) => void;
9
9
  onDeleteCitation: (id: number) => Promise<void>;
10
10
  onSelect: (selectedIds: number[]) => void;
11
- fetchExistingCitations: (req: PageState) => Promise<PageResponse<Citation>>;
11
+ getCitationsPaginated: (req: PageState) => Promise<PageResponse<Citation>>;
12
12
  selectedIds: number[];
13
13
  setSelectedIds: React.Dispatch<React.SetStateAction<number[]>>;
14
14
  /**