@simoncomputing/mui-bueno-v2 0.18.16 → 0.18.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/CHANGELOG.md CHANGED
@@ -11,48 +11,95 @@ 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.18.18] - 2025-10-08
15
+
16
+ ### Added
17
+
18
+ - `SelectableCitationManager`
19
+
20
+ - Added `readOnly` prop which when true, will hide the ability to create, update, delete and select/unselect citations/attachments. Note: checkboxes will still be visible but will be disabled.
21
+ - Added built-in close button to the top-right corner. Clicking will trigger `onClose`.
22
+
23
+ - `CitationManager`
24
+
25
+ - Added `readOnly` prop which when true, will hide the ability to create, update and delete citations/attachments.
26
+
27
+ - `CitationField`
28
+ - Added built-in close button to the top-right corner of the citation bubble menu. Clicking will close the bubble menu.
29
+
30
+ ### Changed
31
+
32
+ - `CitationField`
33
+
34
+ - Citation/Attachment bubble menu will now open when clicking on citations embedded in the field when the field is `readOnly`. When clicked, the popup will show a readonly view of the citations/attachments -- create, edit, delete and select/unselect actions are hidden, but the user can still download, view, and launch links. Checkboxes will be disabled but still visible.
35
+
36
+ - `CitationField`, `CitationManager`, `SelectableCitationManager`
37
+
38
+ - When adding an attachment, the "Upload a file" button for selecting a file has been relabeled to "Select a file", and "Add new attachment" button has been relabeled to "Upload Attachment"
39
+ - Adjusted spacing of fields on Attachment create/edit screen
40
+
41
+ - `FileUpload`
42
+ - Updated button styling to prevent text wrapping
43
+ - Changed button label from "Upload a file" to "Select a file"
44
+
45
+ ## [0.18.17] - 2025-09-30
46
+
47
+ ### Fixed
48
+
49
+ - `CitationField`
50
+ - Fixed conditional hook React error when `readOnly` changes
51
+
14
52
  ## [0.18.16] - 2025-09-29
15
53
 
16
54
  ### Changed
55
+
17
56
  - `CitationField`
18
57
  - Completely clear out field when empty (including only whitespace characters) instead of resolving to `<p></p>`
19
58
 
20
59
  ## [0.18.15] - 2025-09-29
21
60
 
22
61
  ### Fixed
62
+
23
63
  - `CitationManger`
24
64
  - Clear error when opening/closing modals
25
65
 
26
66
  ## [0.18.14] - 2025-09-29
27
67
 
28
68
  ### Fixed
69
+
29
70
  - `CitationField`, `CitationManger`, `SelectableCitationManager`
30
71
  - Improved error message displayed when API call fails
31
72
 
32
73
  ### Changed
74
+
33
75
  - `CitationField`, `CitationManger`, `SelectableCitationManager`
34
76
  - `onError` param changed from `string` to `obj`
35
77
 
36
78
  ## [0.18.13] - 2025-09-29
37
79
 
38
80
  ### Changed
81
+
39
82
  - `CitationField`, `CitationManger`, `SelectableCitationManager`
40
83
  - Updated errors to allow for backend validation error to display as body of Alert
41
84
 
42
85
  ### Fixed
86
+
43
87
  - `CitationField`, `CitationManger`, `SelectableCitationManager`
88
+
44
89
  - Empty form will display if an error occurs when clicking on the edit button and retrieve API call fails
45
90
 
46
- - `Radio`/`RadioGroup`
91
+ - `Radio`/`RadioGroup`
47
92
  - Fixed `helperText` getting passed to MUI props when it shouldn't
48
93
 
49
94
  ## [0.18.12] - 2025-09-26
50
95
 
51
- ### Added
96
+ ### Added
97
+
52
98
  - `CitationField`, `CitationManger`, `SelectableCitationManager`
53
99
  - `canLaunchUrl` prop which, when defined and returns true, will display a Launch Link icon under the action columnn
54
100
 
55
101
  ### Removed
102
+
56
103
  - `CitationField`, `CitationManger`, `SelectableCitationManager`
57
104
  - `canOpenPublicUrls`. Use `canLaunchUrl` instead
58
105
 
@@ -61,12 +108,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
61
108
  ### Added
62
109
 
63
110
  - `CitationField`
111
+
64
112
  - Added helper text for Classification field
65
113
 
66
114
  - `CitationField`, `CitationManger`, `SelectableCitationManager`
67
115
  - Added `canOpenPublicUrls` prop to enable launch url button to display for public source URLs
68
-
69
116
  - `CitationManger`, `SelectableCitationManager`
117
+
70
118
  - Added tooltips to actions (Edit, Delete, Download, Open URL)
71
119
  - Improved performance of Delete popper by reducing unnecessary re-renders
72
120
 
@@ -1,10 +1,18 @@
1
1
  import { Citation, UnsavedAttachmentCitation } from '../../../../../@types';
2
2
  export type AttachmentFormProps = {
3
- title?: string;
3
+ title: string;
4
4
  onSave: (unsavedAttachment: UnsavedAttachmentCitation) => Promise<void>;
5
5
  onCancel: () => void;
6
- disableFileUpload?: boolean;
7
6
  modifyCitation: Citation | undefined;
7
+ /**
8
+ * If true, file upload is disabled. (Title field is still enabled)
9
+ */
10
+ disableFileUpload?: boolean;
11
+ readOnly?: boolean;
12
+ /**
13
+ * If true, shows a close button inline with title. Intended to be used within modals.
14
+ */
15
+ showCloseBtn?: boolean;
8
16
  };
9
17
  declare const AttachmentForm: (props: AttachmentFormProps) => import("react/jsx-runtime").JSX.Element;
10
18
  export default AttachmentForm;
@@ -67,13 +67,19 @@ export interface BaseCitationManagerProps {
67
67
  * users will be allowed to launch URLs
68
68
  */
69
69
  canLaunchUrl?: (citation: Citation) => boolean;
70
+ /**
71
+ * Whether users can create/edit/delete citations or not
72
+ */
73
+ readOnly?: boolean;
70
74
  }
71
75
  export declare enum CitationManagerState {
72
76
  CITATIONS_TABLE = "Insert Citation/Attachment(s)",
73
77
  ADD_CITATION = "Add Citation",
74
78
  EDIT_CITATION = "Edit Citation",
75
79
  ADD_ATTACHMENT = "Add Attachment",
76
- EDIT_ATTACHMENT = "Edit Attachment"
80
+ EDIT_ATTACHMENT = "Edit Attachment",
81
+ VIEW_CITATION = "View Citation",
82
+ VIEW_ATTACHMENT = "View Attachment"
77
83
  }
78
84
  /**
79
85
  * BaseCitationManager handles creating, updating, deleting, downloading and selecting citations.
@@ -82,5 +88,5 @@ export declare enum CitationManagerState {
82
88
  *
83
89
  * For in-line citations, see CitationField instead.
84
90
  */
85
- export declare function BaseCitationManager({ getCitationsPaginated, onCreateCitation, onUpdateCitation, onDeleteCitation, getCitationById, onDownloadAttachment, onSelectCitations, onCancel, initialSelectedIds, onContentChange, onError, renderAsSelectablePopup, addlActions, canLaunchUrl, }: BaseCitationManagerProps): import("react/jsx-runtime").JSX.Element;
91
+ export declare function BaseCitationManager({ getCitationsPaginated, onCreateCitation, onUpdateCitation, onDeleteCitation, getCitationById, onDownloadAttachment, onSelectCitations, onCancel, initialSelectedIds, onContentChange, onError, renderAsSelectablePopup, addlActions, canLaunchUrl, readOnly, }: BaseCitationManagerProps): import("react/jsx-runtime").JSX.Element;
86
92
  export default BaseCitationManager;
@@ -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({ getCitationsPaginated, onCreateCitation, onUpdateCitation, onDeleteCitation, getCitationById, onDownloadAttachment, canLaunchUrl, ...controlledBubbleMenuProps }: CitationBubbleMenuProps): import("react/jsx-runtime").JSX.Element | null;
27
+ export default function CitationBubbleMenuTipTap({ getCitationsPaginated, onCreateCitation, onUpdateCitation, onDeleteCitation, getCitationById, onDownloadAttachment, canLaunchUrl, readOnly, ...controlledBubbleMenuProps }: CitationBubbleMenuProps): import("react/jsx-runtime").JSX.Element | null;
@@ -1,9 +1,12 @@
1
1
  import { Citation, UnsavedUrlCitation } from '../../../../../@types';
2
2
  export type CitationFormProps = {
3
- title?: string;
3
+ title: string;
4
4
  onSave: (unsavedUrl: UnsavedUrlCitation) => Promise<void>;
5
5
  onCancel: () => void;
6
6
  modifyCitation: Citation | undefined;
7
+ readOnly?: boolean;
8
+ /** If true, shows a close button inline with title. Intended to be used within modals. */
9
+ showCloseBtn?: boolean;
7
10
  };
8
11
  declare const CitationForm: (props: CitationFormProps) => import("react/jsx-runtime").JSX.Element;
9
12
  export default CitationForm;
@@ -34,12 +34,28 @@ export type CitationTableProps = {
34
34
  canSelect?: boolean;
35
35
  /**
36
36
  * When true, create citation & attachment buttons will display.
37
+ *
38
+ * Can be overridden by readOnly
37
39
  */
38
40
  canCreate?: boolean;
39
41
  /**
40
42
  * When true, edit citation icon buttons will display for each row.
43
+ *
44
+ * Can be overridden by readOnly
41
45
  */
42
46
  canEdit?: boolean;
47
+ /**
48
+ * When true, delete citation icon buttons will display for each row.
49
+ *
50
+ * Can be overridden by readOnly
51
+ */
52
+ canDelete?: boolean;
53
+ /**
54
+ * If true, renders as readOnly table. Overrides canCreate, canEdit, canDelete.
55
+ *
56
+ * If canSelect is true, checkboxes will render as disabled.
57
+ */
58
+ readOnly?: boolean;
43
59
  /**
44
60
  * When provided and the function returns true,
45
61
  * users will be allowed to launch URLs
@@ -53,6 +69,8 @@ export type CitationTableProps = {
53
69
  * Used to trigger a re-fetch of table data (via getPaginatedCitations)
54
70
  */
55
71
  refreshKey?: number;
72
+ /** If true, shows a close button inline with title. Intended to be used within modals. */
73
+ showCloseBtn?: boolean;
56
74
  };
57
75
  declare const CitationTable: (props: CitationTableProps) => import("react/jsx-runtime").JSX.Element;
58
76
  export default CitationTable;