@simoncomputing/mui-bueno-v3 0.1.12 → 0.1.14

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.
Files changed (30) hide show
  1. package/README.md +1 -1
  2. package/dist/components/Form/Inputs/Autocomplete/Autocomplete.d.ts +6 -6
  3. package/dist/components/Form/Inputs/Checkbox/Checkbox.d.ts +2 -2
  4. package/dist/components/Form/Inputs/CheckboxGroup/CheckboxGroup.d.ts +1 -1
  5. package/dist/components/Form/Inputs/FileUpload/FileUpload.d.ts +1 -1
  6. package/dist/components/Form/Inputs/RadioGroup/RadioGroup.d.ts +1 -1
  7. package/dist/components/Form/Inputs/RangeSlider/RangeSlider.d.ts +1 -1
  8. package/dist/components/Form/Inputs/Select/Select.d.ts +1 -1
  9. package/dist/components/Form/Inputs/TextField/TextField.d.ts +1 -1
  10. package/dist/components/Form/RepeatableFormGroup/RepeatableFormGroup.d.ts +3 -3
  11. package/dist/index.cjs.js +129 -131
  12. package/dist/index.css +1 -1
  13. package/dist/index.d.ts +0 -6
  14. package/dist/index.es.js +24831 -25643
  15. package/dist/index.umd.js +130 -132
  16. package/package.json +136 -137
  17. package/dist/components/Form/Inputs/CitationField/CitationBubbleMenuHandler.d.ts +0 -43
  18. package/dist/components/Form/Inputs/CitationField/CitationField.d.ts +0 -78
  19. package/dist/components/Form/Inputs/CitationField/CitationMenu/AttachmentForm.d.ts +0 -13
  20. package/dist/components/Form/Inputs/CitationField/CitationMenu/CitationBubbleMenu.d.ts +0 -25
  21. package/dist/components/Form/Inputs/CitationField/CitationMenu/CitationForm.d.ts +0 -12
  22. package/dist/components/Form/Inputs/CitationField/CitationMenu/CitationMenu.d.ts +0 -62
  23. package/dist/components/Form/Inputs/CitationField/CitationMenu/CitationTable.d.ts +0 -16
  24. package/dist/components/Form/Inputs/CitationField/CitationNode.d.ts +0 -2
  25. package/dist/components/Form/Inputs/CitationField/CitationNodeComponent.d.ts +0 -7
  26. package/dist/components/Form/Inputs/CitationField/CitationRefreshContext/CitationRefreshContext.d.ts +0 -29
  27. package/dist/components/Form/Inputs/CitationField/MenuButtonEditCitation.d.ts +0 -3
  28. package/dist/components/Form/Inputs/Location/Location.d.ts +0 -69
  29. package/dist/components/Form/Inputs/Location/Location.types.d.ts +0 -85
  30. package/dist/components/Form/Inputs/Location/LocationOption.d.ts +0 -38
package/package.json CHANGED
@@ -1,140 +1,139 @@
1
1
  {
2
- "name": "@simoncomputing/mui-bueno-v3",
3
- "private": false,
4
- "version": "0.1.12",
5
- "type": "module",
6
- "main": "./dist/index.umd.js",
7
- "module": "./dist/index.es.js",
8
- "types": "./dist/index.d.ts",
9
- "files": [
10
- "dist",
11
- "CHANGELOG.md"
12
- ],
13
- "sideEffects": [
14
- "**/*.css"
15
- ],
16
- "exports": {
17
- ".": {
18
- "types": "./dist/index.d.ts",
19
- "import": "./dist/index.es.js",
20
- "require": "./dist/index.umd.js"
21
- },
22
- "./dist/index.css": {
23
- "import": "./dist/index.css",
24
- "require": "./dist/index.css"
25
- }
2
+ "name": "@simoncomputing/mui-bueno-v3",
3
+ "private": false,
4
+ "version": "0.1.14",
5
+ "type": "module",
6
+ "main": "./dist/index.umd.js",
7
+ "module": "./dist/index.es.js",
8
+ "types": "./dist/index.d.ts",
9
+ "files": [
10
+ "dist",
11
+ "CHANGELOG.md"
12
+ ],
13
+ "sideEffects": [
14
+ "**/*.css"
15
+ ],
16
+ "exports": {
17
+ ".": {
18
+ "types": "./dist/index.d.ts",
19
+ "import": "./dist/index.es.js",
20
+ "require": "./dist/index.umd.js"
26
21
  },
27
- "scripts": {
28
- "start": "npm run dev",
29
- "dev": "storybook dev -p 6006",
30
- "build": "storybook build -o dist",
31
- "build:lib": "tsc -b && vite build",
32
- "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
33
- "test": "vitest",
34
- "test:coverage": "vitest --coverage.enabled=true",
35
- "validate": "npm run build:lib && vitest run",
36
- "publishLib": "npm run validate && npm publish --access public",
37
- "publishLib:dryrun": "npm run validate && npm publish --dry-run"
38
- },
39
- "peerDependencies": {
40
- "@emotion/react": "^11.14.0",
41
- "@emotion/styled": "^11.14.0",
42
- "@mui/icons-material": "^6.4.9",
43
- "@mui/material": "^6.4.9",
44
- "@mui/x-date-pickers": "^7.23.3",
45
- "dayjs": "^1.11.13",
46
- "formik": "^2.4.6",
47
- "react": "^19.0.0",
48
- "react-dom": "^19.0.0",
49
- "react-router-dom": "^7.1.1",
50
- "react-hook-form": "^7.59.0"
51
- },
52
- "dependencies": {
53
- "@hookform/resolvers": "^5.1.1",
54
- "@tiptap/core": "^2.11.6",
55
- "@tiptap/extension-blockquote": "^2.11.6",
56
- "@tiptap/extension-bold": "^2.11.6",
57
- "@tiptap/extension-bubble-menu": "^2.11.6",
58
- "@tiptap/extension-bullet-list": "^2.11.6",
59
- "@tiptap/extension-code": "^2.11.6",
60
- "@tiptap/extension-code-block": "^2.11.6",
61
- "@tiptap/extension-color": "^2.11.6",
62
- "@tiptap/extension-document": "^2.11.6",
63
- "@tiptap/extension-dropcursor": "^2.11.6",
64
- "@tiptap/extension-floating-menu": "^2.11.6",
65
- "@tiptap/extension-font-family": "^2.11.6",
66
- "@tiptap/extension-gapcursor": "^2.11.6",
67
- "@tiptap/extension-hard-break": "^2.11.6",
68
- "@tiptap/extension-heading": "^2.11.6",
69
- "@tiptap/extension-highlight": "^2.11.6",
70
- "@tiptap/extension-history": "^2.11.6",
71
- "@tiptap/extension-horizontal-rule": "^2.11.6",
72
- "@tiptap/extension-image": "^2.11.6",
73
- "@tiptap/extension-italic": "^2.11.6",
74
- "@tiptap/extension-link": "^2.11.6",
75
- "@tiptap/extension-list-item": "^2.11.6",
76
- "@tiptap/extension-mention": "^2.11.6",
77
- "@tiptap/extension-ordered-list": "^2.11.6",
78
- "@tiptap/extension-paragraph": "^2.11.6",
79
- "@tiptap/extension-placeholder": "^2.11.6",
80
- "@tiptap/extension-strike": "^2.11.6",
81
- "@tiptap/extension-subscript": "^2.11.6",
82
- "@tiptap/extension-superscript": "^2.11.6",
83
- "@tiptap/extension-table": "^2.11.6",
84
- "@tiptap/extension-table-cell": "^2.11.6",
85
- "@tiptap/extension-table-header": "^2.11.6",
86
- "@tiptap/extension-table-row": "^2.11.6",
87
- "@tiptap/extension-task-item": "^2.11.6",
88
- "@tiptap/extension-task-list": "^2.11.6",
89
- "@tiptap/extension-text": "^2.11.6",
90
- "@tiptap/extension-text-align": "^2.11.6",
91
- "@tiptap/extension-text-style": "^2.11.6",
92
- "@tiptap/extension-underline": "^2.11.6",
93
- "@tiptap/pm": "^2.11.6",
94
- "@tiptap/react": "^2.11.6",
95
- "@tiptap/starter-kit": "^2.11.6",
96
- "@types/autosuggest-highlight": "^3.2.3",
97
- "@types/google.maps": "^3.58.1",
98
- "autosuggest-highlight": "^3.3.4",
99
- "google-maps": "^4.3.3",
100
- "mui-tiptap": "^1.18.0",
101
- "yup": "^1.6.1"
102
- },
103
- "devDependencies": {
104
- "@chromatic-com/storybook": "^3.2.3",
105
- "@storybook/addon-essentials": "^8.4.7",
106
- "@storybook/addon-interactions": "^8.4.7",
107
- "@storybook/addon-links": "^8.4.7",
108
- "@storybook/addon-themes": "^8.4.7",
109
- "@storybook/react": "^8.4.7",
110
- "@storybook/react-vite": "^8.4.7",
111
- "@testing-library/jest-dom": "^6.6.3",
112
- "@testing-library/react": "^16.1.0",
113
- "@testing-library/user-event": "^14.5.2",
114
- "@types/lodash": "^4.17.13",
115
- "@types/node": "^22.10.5",
116
- "@types/react": "^19.0.2",
117
- "@types/react-dom": "^19.0.2",
118
- "@typescript-eslint/eslint-plugin": "^8.19.0",
119
- "@typescript-eslint/parser": "^8.19.0",
120
- "@vitejs/plugin-react": "^4.3.4",
121
- "@vitest/coverage-v8": "^2.1.9",
122
- "eslint": "^9.17.0",
123
- "eslint-config-prettier": "^9.1.0",
124
- "eslint-plugin-prettier": "^5.2.1",
125
- "eslint-plugin-react-hooks": "^5.1.0",
126
- "eslint-plugin-react-refresh": "^0.4.16",
127
- "eslint-plugin-storybook": "^0.11.2",
128
- "jsdom": "^25.0.1",
129
- "prettier": "^3.4.2",
130
- "sass": "^1.83.0",
131
- "storybook": "^8.4.7",
132
- "typescript": "^5.7.2",
133
- "vite": "^6.0.7",
134
- "vite-plugin-dts": "^4.4.0",
135
- "vite-plugin-lib-inject-css": "^2.2.0",
136
- "vite-plugin-svgr": "^4.3.0",
137
- "vitest": "^2.1.9"
138
- },
139
- "packageManager": "pnpm@9.15.2"
22
+ "./dist/index.css": {
23
+ "import": "./dist/index.css",
24
+ "require": "./dist/index.css"
25
+ }
26
+ },
27
+ "scripts": {
28
+ "start": "npm run dev",
29
+ "dev": "storybook dev -p 6006",
30
+ "build": "storybook build -o dist",
31
+ "build:lib": "tsc -b && vite build",
32
+ "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
33
+ "test": "vitest",
34
+ "test:coverage": "vitest --coverage.enabled=true",
35
+ "validate": "npm run build:lib && vitest run",
36
+ "publishLib": "npm run validate && npm publish --access public",
37
+ "publishLib:dryrun": "npm run validate && npm publish --dry-run"
38
+ },
39
+ "peerDependencies": {
40
+ "@emotion/react": "^11.14.0",
41
+ "@emotion/styled": "^11.14.0",
42
+ "@mui/icons-material": "^6.4.9",
43
+ "@mui/material": "^6.4.9",
44
+ "@mui/x-date-pickers": "^7.23.3",
45
+ "dayjs": "^1.11.13",
46
+ "react": "^19.0.0",
47
+ "react-dom": "^19.0.0",
48
+ "react-router-dom": "^7.1.1",
49
+ "react-hook-form": "^7.59.0"
50
+ },
51
+ "dependencies": {
52
+ "@hookform/resolvers": "^5.1.1",
53
+ "@tiptap/core": "^2.11.6",
54
+ "@tiptap/extension-blockquote": "^2.11.6",
55
+ "@tiptap/extension-bold": "^2.11.6",
56
+ "@tiptap/extension-bubble-menu": "^2.11.6",
57
+ "@tiptap/extension-bullet-list": "^2.11.6",
58
+ "@tiptap/extension-code": "^2.11.6",
59
+ "@tiptap/extension-code-block": "^2.11.6",
60
+ "@tiptap/extension-color": "^2.11.6",
61
+ "@tiptap/extension-document": "^2.11.6",
62
+ "@tiptap/extension-dropcursor": "^2.11.6",
63
+ "@tiptap/extension-floating-menu": "^2.11.6",
64
+ "@tiptap/extension-font-family": "^2.11.6",
65
+ "@tiptap/extension-gapcursor": "^2.11.6",
66
+ "@tiptap/extension-hard-break": "^2.11.6",
67
+ "@tiptap/extension-heading": "^2.11.6",
68
+ "@tiptap/extension-highlight": "^2.11.6",
69
+ "@tiptap/extension-history": "^2.11.6",
70
+ "@tiptap/extension-horizontal-rule": "^2.11.6",
71
+ "@tiptap/extension-image": "^2.11.6",
72
+ "@tiptap/extension-italic": "^2.11.6",
73
+ "@tiptap/extension-link": "^2.11.6",
74
+ "@tiptap/extension-list-item": "^2.11.6",
75
+ "@tiptap/extension-mention": "^2.11.6",
76
+ "@tiptap/extension-ordered-list": "^2.11.6",
77
+ "@tiptap/extension-paragraph": "^2.11.6",
78
+ "@tiptap/extension-placeholder": "^2.11.6",
79
+ "@tiptap/extension-strike": "^2.11.6",
80
+ "@tiptap/extension-subscript": "^2.11.6",
81
+ "@tiptap/extension-superscript": "^2.11.6",
82
+ "@tiptap/extension-table": "^2.11.6",
83
+ "@tiptap/extension-table-cell": "^2.11.6",
84
+ "@tiptap/extension-table-header": "^2.11.6",
85
+ "@tiptap/extension-table-row": "^2.11.6",
86
+ "@tiptap/extension-task-item": "^2.11.6",
87
+ "@tiptap/extension-task-list": "^2.11.6",
88
+ "@tiptap/extension-text": "^2.11.6",
89
+ "@tiptap/extension-text-align": "^2.11.6",
90
+ "@tiptap/extension-text-style": "^2.11.6",
91
+ "@tiptap/extension-underline": "^2.11.6",
92
+ "@tiptap/pm": "^2.11.6",
93
+ "@tiptap/react": "^2.11.6",
94
+ "@tiptap/starter-kit": "^2.11.6",
95
+ "@types/autosuggest-highlight": "^3.2.3",
96
+ "@types/google.maps": "^3.58.1",
97
+ "autosuggest-highlight": "^3.3.4",
98
+ "google-maps": "^4.3.3",
99
+ "mui-tiptap": "^1.18.0",
100
+ "yup": "^1.6.1"
101
+ },
102
+ "devDependencies": {
103
+ "@chromatic-com/storybook": "^3.2.3",
104
+ "@storybook/addon-essentials": "^8.6.15",
105
+ "@storybook/addon-interactions": "^8.6.15",
106
+ "@storybook/addon-links": "^8.6.15",
107
+ "@storybook/addon-themes": "^8.6.15",
108
+ "@storybook/react": "^8.6.15",
109
+ "@storybook/react-vite": "^8.6.15",
110
+ "@testing-library/jest-dom": "^6.6.3",
111
+ "@testing-library/react": "^16.1.0",
112
+ "@testing-library/user-event": "^14.5.2",
113
+ "@types/lodash": "^4.17.13",
114
+ "@types/node": "^22.10.5",
115
+ "@types/react": "^19.0.2",
116
+ "@types/react-dom": "^19.0.2",
117
+ "@typescript-eslint/eslint-plugin": "^8.19.0",
118
+ "@typescript-eslint/parser": "^8.19.0",
119
+ "@vitejs/plugin-react": "^4.3.4",
120
+ "@vitest/coverage-v8": "^2.1.9",
121
+ "eslint": "^9.17.0",
122
+ "eslint-config-prettier": "^9.1.0",
123
+ "eslint-plugin-prettier": "^5.2.1",
124
+ "eslint-plugin-react-hooks": "^5.1.0",
125
+ "eslint-plugin-react-refresh": "^0.4.16",
126
+ "eslint-plugin-storybook": "^0.11.2",
127
+ "jsdom": "^25.0.1",
128
+ "prettier": "^3.4.2",
129
+ "sass": "^1.83.0",
130
+ "storybook": "^8.4.7",
131
+ "typescript": "^5.7.2",
132
+ "vite": "^6.0.7",
133
+ "vite-plugin-dts": "^4.4.0",
134
+ "vite-plugin-lib-inject-css": "^2.2.0",
135
+ "vite-plugin-svgr": "^4.3.0",
136
+ "vitest": "^2.1.9"
137
+ },
138
+ "packageManager": "pnpm@9.15.2"
140
139
  }
@@ -1,43 +0,0 @@
1
- import { Extension } from '@tiptap/core';
2
- import { CitationBubbleMenuProps } from './CitationMenu/CitationBubbleMenu';
3
- declare module '@tiptap/core' {
4
- interface Commands<ReturnType> {
5
- citation: {
6
- /**
7
- * Open/show the link bubble menu. Create a link if one doesn't exist at
8
- * the current cursor selection, or edit the existing link if there is
9
- * already a link at the current selection.
10
- *
11
- * If the options are provided, they're used to override the bubble menu
12
- * props, which can be useful for specific positioning needs. Each call to
13
- * `openLinkBubbleMenu` will reset the options based on the provided
14
- * argument, falling back to default behavior if not provided.
15
- *
16
- * For instance, if the anchorEl option is provided, it overrides the
17
- * anchor point for positioning the bubble menu. (The default anchorEl for
18
- * LinkBubbleMenu is to anchor to the location in the editor content where
19
- * the link appears or will appear.)
20
- */
21
- openCitationBubbleMenu: (options?: Partial<CitationBubbleMenuProps>, selectedNodePos?: number) => ReturnType;
22
- /** Close/hide the link bubble menu, canceling any ongoing edits. */
23
- closeCitationBubbleMenu: () => ReturnType;
24
- };
25
- }
26
- }
27
- export type CitationBubbleMenuHandlerStorage = {
28
- isOpen: boolean;
29
- selectedIds: number[];
30
- bubbleMenuOptions: Partial<CitationBubbleMenuProps> | undefined;
31
- selectedNodePos: number | undefined;
32
- };
33
- /**
34
- * To be used in conjunction with the `CitationBubbleMenuTipTap` component, as this
35
- * extension provides editor commands to control the state of the link bubble
36
- * menu.
37
- *
38
- * The Tiptap Link extension (@tiptap/extension-link) should also be installed
39
- * and included in your extensions when using CitationBubbleMenuHandler:
40
- * https://tiptap.dev/api/marks/link.
41
- */
42
- declare const CitationBubbleMenuHandler: Extension<undefined, CitationBubbleMenuHandlerStorage>;
43
- export default CitationBubbleMenuHandler;
@@ -1,78 +0,0 @@
1
- import { TypographyProps } from '@mui/material';
2
- import { Citation, PageState, PageResponse, UnsavedCitation, UnsavedAttachment } from '../../../../@types';
3
- export type CitationFieldProps = {
4
- /**
5
- * Name and ID of the component. Must match a key from initialValues in Formik.
6
- * @required
7
- */
8
- name: string;
9
- /**
10
- * (Optional) Label. NOTE: this won't be floating, it's always static.
11
- */
12
- label?: string;
13
- /**
14
- * Styling for label
15
- */
16
- labelProps?: TypographyProps;
17
- /**
18
- * If `true`, the component becomes readonly.
19
- * @default false
20
- */
21
- readOnly?: boolean;
22
- /**
23
- * Margin for the FormControl
24
- */
25
- margin?: 'dense' | 'none' | 'normal';
26
- renderContentOnly?: never;
27
- /**
28
- * API call for fetching paginated citations. These will populate the "Insert Citation/Attachment(s)" table.
29
- *
30
- * If an error occurs during the API call, notify the user then throw the error so that
31
- * Mui Bueno can handle updating state.
32
- */
33
- fetchExistingCitations: (req: PageState) => Promise<PageResponse<Citation>>;
34
- /**
35
- * API call for creating a new citation/attachment.
36
- *
37
- * If an error occurs during the API call, notify the user then throw the error so that
38
- * Mui Bueno can handle updating state.
39
- */
40
- onCreateCitation: (citation: UnsavedCitation) => Promise<Citation>;
41
- /**
42
- * API call for updating a citation/attachment.
43
- *
44
- * If an error occurs during the API call, notify the user then throw the error so that
45
- * Mui Bueno can handle updating state.
46
- */
47
- onUpdateCitation: (citation: Citation) => Promise<Citation>;
48
- /**
49
- * API call for retrieving a citation by id
50
- *
51
- * If an error occurs during the API call, notify the user then throw the error so that
52
- * Mui Bueno can handle updating state.
53
- */
54
- getCitationById: (id: number) => Promise<Citation>;
55
- /**
56
- * API call for storing an attachment (ex. in an s3 bucket)
57
- *
58
- * If an error occurs during the API call, notify the user then throw the error so that
59
- * Mui Bueno can handle updating state.
60
- */
61
- onStoreAttachment: (citation: UnsavedAttachment) => Promise<Citation>;
62
- /**
63
- * API call for retrieving an array citations by an array ids
64
- *
65
- * If an error occurs during the API call, notify the user then throw the error so that
66
- * Mui Bueno can handle updating state.
67
- */
68
- getCitationsByIds: (ids: number[]) => Promise<Citation[]>;
69
- };
70
- /**
71
- * Rich Text field -- uses MUI Tip Tap
72
- *
73
- * Formik -- This field cannot be completely controlled, so keep in mind that the Formik value will not update until the field
74
- * __loses focus__. This is to prevent issues with converting from rich text to HTML as the user types as it could override
75
- * their changes unintentionally.
76
- */
77
- export declare const CitationField: (props: CitationFieldProps) => import("react/jsx-runtime").JSX.Element;
78
- export default CitationField;
@@ -1,13 +0,0 @@
1
- import { ReactNode } from 'react';
2
- import { Citation, UnsavedAttachment } from '../../../../../@types';
3
- export type NewAttachmentFormProps = {
4
- id?: number;
5
- editMenuTitle: ReactNode;
6
- onSave: (citation: UnsavedAttachment) => Promise<void>;
7
- onCancel: () => void;
8
- getCitationById: (id: number) => Promise<Citation>;
9
- disableFileUpload?: boolean;
10
- onTitleChanged?: (id: number) => void;
11
- };
12
- declare const NewAttachmentForm: (props: NewAttachmentFormProps) => import("react/jsx-runtime").JSX.Element;
13
- export default NewAttachmentForm;
@@ -1,25 +0,0 @@
1
- import { Except } from 'type-fest';
2
- import { ControlledBubbleMenuProps } from 'mui-tiptap';
3
- import { CitationMenuProps } from './CitationMenu';
4
- export type CitationBubbleMenuProps = Partial<Except<ControlledBubbleMenuProps, 'open' | 'editor' | 'children'>> & Omit<CitationMenuProps, 'onSelectCitations' | 'onCancel'>;
5
- /**
6
- * TipTap Wrapper for CitationMenu so that it renders as a bubble/pop-up menu integrated
7
- * with TipTap
8
- *
9
- * A component that renders a bubble menu when viewing, creating, or editing a
10
- * link. Requires the mui-tiptap CitationBubbleMenuHandler extension and Tiptap's
11
- * Link extension (@tiptap/extension-link, https://tiptap.dev/api/marks/link) to
12
- * both be included in your editor `extensions` array.
13
- *
14
- * Pairs well with the `<MenuButtonEditLink />` component.
15
- *
16
- * If you're using `RichTextEditor`, include this component via
17
- * `RichTextEditor`’s `children` render-prop. Otherwise, include the
18
- * `LinkBubbleMenu` as a child of the component where you call `useEditor` and
19
- * render your `RichTextField` or `RichTextContent`. (The bubble menu itself
20
- * will be positioned appropriately no matter where you put it in your React
21
- * tree, as long as it is re-rendered whenever the Tiptap `editor` forces an
22
- * update, which will happen if it's a child of the component using
23
- * `useEditor`).
24
- */
25
- export default function CitationBubbleMenuTipTap({ fetchExistingCitations, onCreateCitation, onUpdateCitation, getCitationById, onStoreAttachment, onTitleChanged, ...controlledBubbleMenuProps }: CitationBubbleMenuProps): import("react/jsx-runtime").JSX.Element | null;
@@ -1,12 +0,0 @@
1
- import { ReactNode } from 'react';
2
- import { Citation, UnsavedCitation } from '../../../../../@types';
3
- export type NewCitationFormProps = {
4
- id?: number;
5
- editMenuTitle: ReactNode;
6
- onSave: (citation: UnsavedCitation) => Promise<void>;
7
- onCancel: () => void;
8
- getCitationById: (id: number) => Promise<Citation>;
9
- onTitleChanged?: (id: number) => void;
10
- };
11
- declare const NewCitationForm: (props: NewCitationFormProps) => import("react/jsx-runtime").JSX.Element;
12
- export default NewCitationForm;
@@ -1,62 +0,0 @@
1
- import { Citation, PageState, PageResponse, UnsavedCitation, UnsavedAttachment } from '../../../../../@types';
2
- export interface CitationMenuProps {
3
- /**
4
- * API call for fetching citations. These will populate the "Insert Citation/Attachment(s)" table.
5
- */
6
- fetchExistingCitations: (req: PageState) => Promise<PageResponse<Citation>>;
7
- /**
8
- * API call for creating a new citation/attachment.
9
- */
10
- onCreateCitation: (citation: UnsavedCitation) => Promise<Citation>;
11
- /**
12
- * API call for updating a citation/attachment.
13
- */
14
- onUpdateCitation: (citation: Citation) => Promise<Citation>;
15
- /**
16
- * API call for retrieving a citation by id
17
- */
18
- getCitationById: (id: number) => Promise<Citation>;
19
- /**
20
- * API call for storing an attachment (ex. in an s3 bucket)
21
- */
22
- onStoreAttachment: (citation: UnsavedAttachment) => Promise<Citation>;
23
- /**
24
- * Set which citations should be pre-checked in the citations table when this component is first rendered (used
25
- * to initialize useState).
26
- */
27
- initialSelectedIds?: number[];
28
- /**
29
- * Callback for when the user clicks the "Select" button. This passes an array of selected citations
30
- * that the user chose to the parent component.
31
- */
32
- onSelectCitations: (citationIds: number[]) => void;
33
- /**
34
- * Callback for when the user clicks the "Cancel" button. If you're using a modal, close your modal here.
35
- */
36
- onCancel: () => void;
37
- /**
38
- * Callback whenever the size of the content potentially changes. Use this if you're using something like
39
- * a Popper, so that it can reposition itself when the dimensions of its content changes.
40
- *
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
- */
43
- onContentUpdate?: () => void;
44
- /**
45
- * Optional callback, used to notify parent that the user has changed their Citation's title.
46
- */
47
- onTitleChanged?: (id: number) => void;
48
- }
49
- export declare enum CitationMenuState {
50
- CITATIONS_TABLE = 0,
51
- ADD_CITATION = 1,
52
- EDIT_CITATION = 2,
53
- ADD_ATTACHMENT = 3,
54
- EDIT_ATTACHMENT = 4
55
- }
56
- /**
57
- * CitationMenu handles creating, updating, and selecting citations.
58
- *
59
- * Intended to be used within a bubble/pop-up/modal/dialog. For in-line citations, see CitationField instead.
60
- */
61
- export declare function CitationMenu({ fetchExistingCitations, onCreateCitation, onUpdateCitation, getCitationById, onStoreAttachment, onSelectCitations, onCancel, initialSelectedIds, onContentUpdate, onTitleChanged, }: CitationMenuProps): import("react/jsx-runtime").JSX.Element | null;
62
- export default CitationMenu;
@@ -1,16 +0,0 @@
1
- import { ReactNode } from 'react';
2
- import { PageState, PageResponse, Citation } from '../../../../../@types';
3
- export type CitationTableProps = {
4
- editMenuTitle: ReactNode;
5
- onCancel: () => void;
6
- onNewCitation: () => void;
7
- onNewAttachment: () => void;
8
- onEditCitation: (citation: Citation) => void;
9
- onEditAttachment: (citation: Citation) => void;
10
- onSelect: (selectedIds: number[]) => void;
11
- fetchExistingCitations: (req: PageState) => Promise<PageResponse<Citation>>;
12
- selectedIds: number[];
13
- toggleCheckbox: (citation: Citation) => void;
14
- };
15
- declare const CitationTable: (props: CitationTableProps) => import("react/jsx-runtime").JSX.Element;
16
- export default CitationTable;
@@ -1,2 +0,0 @@
1
- import { Node } from '@tiptap/core';
2
- export declare const CitationNode: Node<any, any>;
@@ -1,7 +0,0 @@
1
- import { default as React } from 'react';
2
- import { NodeViewProps } from '@tiptap/react';
3
- /**
4
- * Handles API fetch for CitationNode in order to dynamically load the title, based on a citation's id
5
- */
6
- declare const CitationNodeComponent: React.FC<NodeViewProps>;
7
- export default CitationNodeComponent;
@@ -1,29 +0,0 @@
1
- import { Citation } from '../../../../../@types';
2
- type CitationRefreshProviderProps = {
3
- /**
4
- * CitationField(s)
5
- */
6
- children: React.ReactNode;
7
- /**
8
- * array of unqiue ids of citations currently being referenced in the editor
9
- */
10
- citationIds: number[];
11
- /**
12
- * API call for fetching citations. Triggered internally when citationIds changes.
13
- */
14
- getCitationsByIds: (ids: number[]) => Promise<Citation[]>;
15
- /**
16
- * Id of the citation that had a title changed. Used internally to determine whether or
17
- * not to trigger an API refresh of the citation list.
18
- */
19
- titleChangedId: number | undefined;
20
- };
21
- export declare function CitationRefreshProvider({ children, citationIds, getCitationsByIds, titleChangedId, }: CitationRefreshProviderProps): import("react/jsx-runtime").JSX.Element;
22
- export declare const useCitationRefreshContext: () => {
23
- /**
24
- * Array of ALL UNIQUE citations being referenced in the editor.
25
- * (Not to be confused with table of citations in the bubble menu -- this is only the citations actually in the editor itself)
26
- */
27
- citations: Citation[];
28
- };
29
- export {};
@@ -1,3 +0,0 @@
1
- import { MenuButtonProps } from 'mui-tiptap';
2
- export type MenuButtonEditCitationProps = Partial<MenuButtonProps>;
3
- export default function MenuButtonEditCitation(props: MenuButtonEditCitationProps): import("react/jsx-runtime").JSX.Element;