@simoncomputing/mui-bueno-v2 0.17.5 → 0.18.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 +23 -0
- package/dist/@types/index.d.ts +2 -0
- package/dist/components/Form/Inputs/CitationField/CitationBubbleMenuHandler.d.ts +1 -1
- package/dist/components/Form/Inputs/CitationField/CitationField.d.ts +5 -1
- package/dist/components/Form/Inputs/CitationField/CitationManager/AttachmentForm.d.ts +13 -0
- package/dist/components/Form/Inputs/CitationField/{CitationMenu/CitationMenu.d.ts → CitationManager/BaseCitationManager.d.ts} +13 -16
- package/dist/components/Form/Inputs/CitationField/{CitationMenu → CitationManager}/CitationAlert.d.ts +4 -4
- package/dist/components/Form/Inputs/CitationField/{CitationMenu → CitationManager}/CitationBubbleMenu.d.ts +4 -4
- package/dist/components/Form/Inputs/CitationField/{CitationMenu → CitationManager}/CitationForm.d.ts +2 -2
- package/dist/components/Form/Inputs/CitationField/CitationManager/CitationManager.d.ts +7 -0
- package/dist/components/Form/Inputs/CitationField/{CitationMenu → CitationManager}/CitationTable.d.ts +4 -3
- package/dist/components/Form/Inputs/CitationField/CitationManager/SelectableCitationManager.d.ts +9 -0
- package/dist/index.cjs.js +94 -94
- package/dist/index.d.ts +4 -2
- package/dist/index.es.js +9077 -9023
- package/dist/index.umd.js +99 -99
- package/package.json +1 -1
- package/dist/components/Form/Inputs/CitationField/CitationMenu/AttachmentForm.d.ts +0 -13
package/CHANGELOG.md
CHANGED
|
@@ -11,6 +11,29 @@ 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.0] - 2025-09-22
|
|
15
|
+
|
|
16
|
+
### Added
|
|
17
|
+
|
|
18
|
+
- `TableColumn`
|
|
19
|
+
- Added `tableCellSx` styling `TableCell` in `Table` and/or `PaginatedTable`
|
|
20
|
+
- `CitationManager`:
|
|
21
|
+
- Basic table offering CRUD operations for citations. Replaces `CitationMenu`.
|
|
22
|
+
- `SelectableCitationManager`
|
|
23
|
+
- Condensed table offering CRUD operations for citations, including selecting citations. Intended to be used in modals/popups. Replaces `CitationMenu`.
|
|
24
|
+
- `CitationField`, `CitationManager`, `SelectableCitationManager`:
|
|
25
|
+
- added `onDownloadAttachment` prop to support downloading attachments
|
|
26
|
+
|
|
27
|
+
### Changed
|
|
28
|
+
|
|
29
|
+
- `CitationField`, `CitationManager`, `SelectableCitationManager`:
|
|
30
|
+
- made `onDeleteCitation` prop optional
|
|
31
|
+
|
|
32
|
+
### Removed
|
|
33
|
+
|
|
34
|
+
- `CitationMenu`
|
|
35
|
+
- Replaced with `CitationManager` & `SelectableCitationManager`. See `Added` section.
|
|
36
|
+
|
|
14
37
|
## [0.17.5] - 2025-09-22
|
|
15
38
|
|
|
16
39
|
### Added
|
package/dist/@types/index.d.ts
CHANGED
|
@@ -113,6 +113,7 @@ export type EnvironmentInfo = {
|
|
|
113
113
|
* within the object. isMobile in case your styling depends on whether the user is viewing
|
|
114
114
|
* on a phone vs tablet/desktop
|
|
115
115
|
* @property {string} sortName - (Optional) Passed instead of `fieldName` to onSortChange(fieldName, ...). Useful if you're rendering the same object in 2+ columns and need a way to differentiate when sorting.
|
|
116
|
+
* @property {SxProps<Theme>} tableCellSx - (Optional) styles applies to TableCell (non-mobile)
|
|
116
117
|
*/
|
|
117
118
|
export type TableColumn<T, K extends keyof T> = {
|
|
118
119
|
key?: string;
|
|
@@ -120,6 +121,7 @@ export type TableColumn<T, K extends keyof T> = {
|
|
|
120
121
|
fieldName: K;
|
|
121
122
|
render?: (value: T[K], object: T, isMobile: boolean) => React.ReactNode;
|
|
122
123
|
sortName?: string;
|
|
124
|
+
tableCellSx?: SxProps<Theme>;
|
|
123
125
|
};
|
|
124
126
|
|
|
125
127
|
// Sort order for Tables
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Extension } from '@tiptap/core';
|
|
2
|
-
import { CitationBubbleMenuProps } from './
|
|
2
|
+
import { CitationBubbleMenuProps } from './CitationManager/CitationBubbleMenu';
|
|
3
3
|
declare module '@tiptap/core' {
|
|
4
4
|
interface Commands<ReturnType> {
|
|
5
5
|
citationBubbleMenu: {
|
|
@@ -60,13 +60,17 @@ export type CitationFieldProps = {
|
|
|
60
60
|
*
|
|
61
61
|
* Error handling is supported internally.
|
|
62
62
|
*/
|
|
63
|
-
onDeleteCitation
|
|
63
|
+
onDeleteCitation?: (id: number) => Promise<void>;
|
|
64
64
|
/**
|
|
65
65
|
* API call for retrieving a citation by id
|
|
66
66
|
*
|
|
67
67
|
* Error handling is supported internally.
|
|
68
68
|
*/
|
|
69
69
|
getCitationById: (id: number) => Promise<Citation>;
|
|
70
|
+
/**
|
|
71
|
+
* API call to download the attachment
|
|
72
|
+
*/
|
|
73
|
+
onDownloadAttachment?: (citation: Citation) => Promise<void>;
|
|
70
74
|
/**
|
|
71
75
|
* Error callback.
|
|
72
76
|
*
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Citation, UnsavedAttachmentCitation } from '../../../../../@types';
|
|
2
|
+
import { CitationManagerError } from './CitationAlert';
|
|
3
|
+
export type AttachmentFormProps = {
|
|
4
|
+
id?: number;
|
|
5
|
+
title?: string;
|
|
6
|
+
onSave: (unsavedAttachment: UnsavedAttachmentCitation) => Promise<void>;
|
|
7
|
+
onCancel: () => void;
|
|
8
|
+
getCitationById: (id: number) => Promise<Citation>;
|
|
9
|
+
disableFileUpload?: boolean;
|
|
10
|
+
setError: React.Dispatch<React.SetStateAction<CitationManagerError | undefined>>;
|
|
11
|
+
};
|
|
12
|
+
declare const AttachmentForm: (props: AttachmentFormProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export default AttachmentForm;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Citation, PageState, PageResponse, UnsavedCitation } from '../../../../../@types';
|
|
2
|
-
export interface
|
|
2
|
+
export interface BaseCitationManagerProps {
|
|
3
3
|
/**
|
|
4
4
|
* API call for fetching citations. These will populate the "Insert Citation/Attachment(s)" table.
|
|
5
5
|
*/
|
|
@@ -15,11 +15,15 @@ export interface CitationMenuProps {
|
|
|
15
15
|
/**
|
|
16
16
|
* API call for deleting a citation/attachment.
|
|
17
17
|
*/
|
|
18
|
-
onDeleteCitation
|
|
18
|
+
onDeleteCitation?: (id: number) => Promise<void>;
|
|
19
19
|
/**
|
|
20
20
|
* API call for retrieving a citation by id
|
|
21
21
|
*/
|
|
22
22
|
getCitationById: (id: number) => Promise<Citation>;
|
|
23
|
+
/**
|
|
24
|
+
* API call to download the attachment
|
|
25
|
+
*/
|
|
26
|
+
onDownloadAttachment?: (citation: Citation) => Promise<void>;
|
|
23
27
|
/**
|
|
24
28
|
* Set which citations should be pre-checked in the citations table when this component is first rendered (used
|
|
25
29
|
* to initialize useState).
|
|
@@ -54,16 +58,7 @@ export interface CitationMenuProps {
|
|
|
54
58
|
*/
|
|
55
59
|
renderAsSelectablePopup?: boolean;
|
|
56
60
|
}
|
|
57
|
-
|
|
58
|
-
* Error for CitationMenu
|
|
59
|
-
* title = human-friendly/shortened version of the error (ex. "Failed to create citation")
|
|
60
|
-
* err = the actual error thrown by the exception that was caught
|
|
61
|
-
*/
|
|
62
|
-
export type CitationMenuError = {
|
|
63
|
-
title: string;
|
|
64
|
-
err: string;
|
|
65
|
-
};
|
|
66
|
-
export declare enum CitationMenuState {
|
|
61
|
+
export declare enum CitationManagerState {
|
|
67
62
|
CITATIONS_TABLE = "Insert Citation/Attachment(s)",
|
|
68
63
|
ADD_CITATION = "Add Citation",
|
|
69
64
|
EDIT_CITATION = "Edit Citation",
|
|
@@ -71,9 +66,11 @@ export declare enum CitationMenuState {
|
|
|
71
66
|
EDIT_ATTACHMENT = "Edit Attachment"
|
|
72
67
|
}
|
|
73
68
|
/**
|
|
74
|
-
*
|
|
69
|
+
* BaseCitationManager handles creating, updating, deleting, downloading and selecting citations.
|
|
70
|
+
*
|
|
71
|
+
* INTERNAL COMPONENT. Use wrapper instead: `SelectableCitationManager` or `CitationManager`
|
|
75
72
|
*
|
|
76
|
-
*
|
|
73
|
+
* For in-line citations, see CitationField instead.
|
|
77
74
|
*/
|
|
78
|
-
export declare function
|
|
79
|
-
export default
|
|
75
|
+
export declare function BaseCitationManager({ getCitationsPaginated, onCreateCitation, onUpdateCitation, onDeleteCitation, getCitationById, onDownloadAttachment, onSelectCitations, onCancel, initialSelectedIds, onContentChange, onError, renderAsSelectablePopup, }: BaseCitationManagerProps): import("react/jsx-runtime").JSX.Element;
|
|
76
|
+
export default BaseCitationManager;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
type Props = {
|
|
2
|
-
error?:
|
|
3
|
-
setError: React.Dispatch<React.SetStateAction<
|
|
2
|
+
error?: CitationManagerError;
|
|
3
|
+
setError: React.Dispatch<React.SetStateAction<CitationManagerError | undefined>>;
|
|
4
4
|
success?: string;
|
|
5
5
|
setSuccess: React.Dispatch<React.SetStateAction<string | undefined>>;
|
|
6
6
|
};
|
|
7
7
|
/**
|
|
8
|
-
* Error for
|
|
8
|
+
* Error for BaseCitationManager, CitationManager & SelectableCitationManager
|
|
9
9
|
* title = human-friendly/shortened version of the error (ex. "Failed to create citation")
|
|
10
10
|
* err = the actual error thrown by the exception that was caught
|
|
11
11
|
*/
|
|
12
|
-
export type
|
|
12
|
+
export type CitationManagerError = {
|
|
13
13
|
title: string;
|
|
14
14
|
err: string;
|
|
15
15
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Except } from 'type-fest';
|
|
2
2
|
import { ControlledBubbleMenuProps } from 'mui-tiptap';
|
|
3
|
-
import {
|
|
4
|
-
export type CitationBubbleMenuProps = Partial<Except<ControlledBubbleMenuProps, 'open' | 'editor' | 'children'>> & Omit<
|
|
3
|
+
import { BaseCitationManagerProps } from './BaseCitationManager';
|
|
4
|
+
export type CitationBubbleMenuProps = Partial<Except<ControlledBubbleMenuProps, 'open' | 'editor' | 'children'>> & Omit<BaseCitationManagerProps, 'onCancel' | 'onSelectCitations'> & {
|
|
5
5
|
onChanged?: (ids: number[]) => void;
|
|
6
6
|
};
|
|
7
7
|
/**
|
|
8
|
-
* TipTap Wrapper for
|
|
8
|
+
* TipTap Wrapper for SelectableCitationManager so that it renders as a bubble/pop-up menu integrated
|
|
9
9
|
* with TipTap
|
|
10
10
|
*
|
|
11
11
|
* A component that renders a bubble menu when viewing, creating, or editing a
|
|
@@ -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, ...controlledBubbleMenuProps }: CitationBubbleMenuProps): import("react/jsx-runtime").JSX.Element | null;
|
|
27
|
+
export default function CitationBubbleMenuTipTap({ getCitationsPaginated, onCreateCitation, onUpdateCitation, onDeleteCitation, getCitationById, onDownloadAttachment, ...controlledBubbleMenuProps }: CitationBubbleMenuProps): import("react/jsx-runtime").JSX.Element | null;
|
package/dist/components/Form/Inputs/CitationField/{CitationMenu → CitationManager}/CitationForm.d.ts
RENAMED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Citation, UnsavedUrlCitation } from '../../../../../@types';
|
|
2
|
-
import {
|
|
2
|
+
import { CitationManagerError } from './CitationAlert';
|
|
3
3
|
export type CitationFormProps = {
|
|
4
4
|
id?: number;
|
|
5
5
|
title?: string;
|
|
6
6
|
onSave: (unsavedUrl: UnsavedUrlCitation) => Promise<void>;
|
|
7
7
|
onCancel: () => void;
|
|
8
8
|
getCitationById: (id: number) => Promise<Citation>;
|
|
9
|
-
setError: React.Dispatch<React.SetStateAction<
|
|
9
|
+
setError: React.Dispatch<React.SetStateAction<CitationManagerError | undefined>>;
|
|
10
10
|
};
|
|
11
11
|
declare const CitationForm: (props: CitationFormProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
12
|
export default CitationForm;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { BaseCitationManagerProps } from './BaseCitationManager';
|
|
2
|
+
export type CitationManagerProps = Omit<BaseCitationManagerProps, 'initialSelectedIds' | 'onSelectCitations' | 'onCancel' | 'onContentChange' | 'renderAsSelectablePopup'>;
|
|
3
|
+
/**
|
|
4
|
+
* CitationManager is a basic table that handles creating, updating, and deleting citations.
|
|
5
|
+
*/
|
|
6
|
+
export declare function CitationManager({ ...rest }: CitationManagerProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export default CitationManager;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PageState, PageResponse, Citation } from '../../../../../@types';
|
|
2
|
-
import {
|
|
2
|
+
import { CitationManagerError } from './CitationAlert';
|
|
3
3
|
export type CitationTableProps = {
|
|
4
4
|
title: string;
|
|
5
5
|
onCancel: () => void;
|
|
@@ -7,7 +7,8 @@ export type CitationTableProps = {
|
|
|
7
7
|
onNewAttachment: () => void;
|
|
8
8
|
onEditCitation: (citation: Citation) => void;
|
|
9
9
|
onEditAttachment: (citation: Citation) => void;
|
|
10
|
-
onDeleteCitation
|
|
10
|
+
onDeleteCitation?: (id: number) => Promise<void>;
|
|
11
|
+
onDownloadAttachment?: (citation: Citation) => Promise<void>;
|
|
11
12
|
onSelect: (selectedIds: number[]) => void;
|
|
12
13
|
getCitationsPaginated: (req: PageState) => Promise<PageResponse<Citation>>;
|
|
13
14
|
selectedIds: number[];
|
|
@@ -19,7 +20,7 @@ export type CitationTableProps = {
|
|
|
19
20
|
* help debug issues so developers can see specific details about an error.
|
|
20
21
|
*/
|
|
21
22
|
onError?: (err: string) => void;
|
|
22
|
-
setError: React.Dispatch<React.SetStateAction<
|
|
23
|
+
setError: React.Dispatch<React.SetStateAction<CitationManagerError | undefined>>;
|
|
23
24
|
setSuccess: React.Dispatch<React.SetStateAction<string | undefined>>;
|
|
24
25
|
/**
|
|
25
26
|
* When true, the Source, Accessed At & Classification columns will not be displayed
|
package/dist/components/Form/Inputs/CitationField/CitationManager/SelectableCitationManager.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { BaseCitationManagerProps } from './BaseCitationManager';
|
|
2
|
+
export type SelectableCitationManagerProps = Omit<BaseCitationManagerProps, 'renderAsSelectablePopup'>;
|
|
3
|
+
/**
|
|
4
|
+
* SelectableCitationManager is a condensed table that handles creating, updating, deleting and selecting citations.
|
|
5
|
+
*
|
|
6
|
+
* It's intended to be used in a pop-up/modal.
|
|
7
|
+
*/
|
|
8
|
+
export declare function SelectableCitationManager({ ...rest }: SelectableCitationManagerProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export default SelectableCitationManager;
|