@manuscripts/style-guide 1.5.0-LEAN-3180 → 1.5.0-LEAN-3180-1
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/dist/cjs/components/References/CitationViewer.js +25 -3
- package/dist/cjs/components/References/ReferenceForm.js +1 -1
- package/dist/es/components/References/CitationViewer.js +1 -2
- package/dist/es/components/References/ReferenceForm.js +1 -1
- package/dist/types/components/References/ReferenceForm.d.ts +4 -4
- package/dist/types/components/References/ReferencesModal.d.ts +2 -2
- package/package.json +1 -1
|
@@ -14,13 +14,35 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
|
+
if (k2 === undefined) k2 = k;
|
|
19
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
20
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
21
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
22
|
+
}
|
|
23
|
+
Object.defineProperty(o, k2, desc);
|
|
24
|
+
}) : (function(o, m, k, k2) {
|
|
25
|
+
if (k2 === undefined) k2 = k;
|
|
26
|
+
o[k2] = m[k];
|
|
27
|
+
}));
|
|
28
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
29
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
30
|
+
}) : function(o, v) {
|
|
31
|
+
o["default"] = v;
|
|
32
|
+
});
|
|
33
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
17
40
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
18
41
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19
42
|
};
|
|
20
43
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
44
|
exports.CitationViewer = exports.CitedItem = exports.CitedItems = void 0;
|
|
22
|
-
const
|
|
23
|
-
const react_1 = __importDefault(require("react"));
|
|
45
|
+
const react_1 = __importStar(require("react"));
|
|
24
46
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
25
47
|
const ReferenceLine_1 = require("./ReferenceLine");
|
|
26
48
|
exports.CitedItems = styled_components_1.default.div `
|
|
@@ -39,7 +61,7 @@ exports.CitedItem = styled_components_1.default.div `
|
|
|
39
61
|
}
|
|
40
62
|
`;
|
|
41
63
|
const CitationViewer = ({ rids, items, }) => {
|
|
42
|
-
const cited = (0,
|
|
64
|
+
const cited = (0, react_1.useMemo)(() => {
|
|
43
65
|
return rids.flatMap((rid) => items.filter((i) => i._id === rid));
|
|
44
66
|
}, [rids, items]);
|
|
45
67
|
return (react_1.default.createElement(exports.CitedItems, null, cited.map((item) => (react_1.default.createElement(ReferenceLine_1.ReferenceLine, { key: item._id, item: item })))));
|
|
@@ -258,7 +258,7 @@ const ReferenceForm = ({ values, showDelete, handleChange: onChange, handleDelet
|
|
|
258
258
|
react_1.default.createElement(Button_1.IconButton, { defaultColor: true, as: "a", href: `https://doi.org/${values.DOI}`, target: '_blank' },
|
|
259
259
|
react_1.default.createElement(link_icon_1.LinkIcon, null)),
|
|
260
260
|
react_1.default.createElement("div", { "data-tip": true, "data-for": 'delete-button' },
|
|
261
|
-
react_1.default.createElement(DeleteButton, { defaultColor: true, disabled: !showDelete, onClick:
|
|
261
|
+
react_1.default.createElement(DeleteButton, { defaultColor: true, disabled: !showDelete, onClick: () => setShowDeleteDialog(true) },
|
|
262
262
|
react_1.default.createElement(delete_icon_1.DeleteIcon, null)),
|
|
263
263
|
react_1.default.createElement(react_tooltip_1.default, { disable: showDelete, id: 'delete-button', place: "bottom", effect: "solid", offset: { top: 15 }, className: "tooltip" }, "Unable to delete because the item is used in the document"))),
|
|
264
264
|
react_1.default.createElement(Button_1.ButtonGroup, null,
|
|
@@ -13,8 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import { useMemo } from '
|
|
17
|
-
import React from 'react';
|
|
16
|
+
import React, { useMemo } from 'react';
|
|
18
17
|
import styled from 'styled-components';
|
|
19
18
|
import { ReferenceLine } from './ReferenceLine';
|
|
20
19
|
export const CitedItems = styled.div `
|
|
@@ -229,7 +229,7 @@ export const ReferenceForm = ({ values, showDelete, handleChange: onChange, hand
|
|
|
229
229
|
React.createElement(IconButton, { defaultColor: true, as: "a", href: `https://doi.org/${values.DOI}`, target: '_blank' },
|
|
230
230
|
React.createElement(LinkIcon, null)),
|
|
231
231
|
React.createElement("div", { "data-tip": true, "data-for": 'delete-button' },
|
|
232
|
-
React.createElement(DeleteButton, { defaultColor: true, disabled: !showDelete, onClick:
|
|
232
|
+
React.createElement(DeleteButton, { defaultColor: true, disabled: !showDelete, onClick: () => setShowDeleteDialog(true) },
|
|
233
233
|
React.createElement(DeleteIcon, null)),
|
|
234
234
|
React.createElement(ReactTooltip, { disable: showDelete, id: 'delete-button', place: "bottom", effect: "solid", offset: { top: 15 }, className: "tooltip" }, "Unable to delete because the item is used in the document"))),
|
|
235
235
|
React.createElement(ButtonGroup, null,
|
|
@@ -20,12 +20,12 @@ export declare const FormField: import("styled-components").StyledComponent<"div
|
|
|
20
20
|
export declare const ReferenceTextArea: import("styled-components").StyledComponent<"textarea", import("styled-components").DefaultTheme, import("../Form").ErrorProps, never>;
|
|
21
21
|
export declare const FlexForm: import("styled-components").StyledComponent<React.ForwardRefExoticComponent<Pick<React.DetailedHTMLProps<React.FormHTMLAttributes<HTMLFormElement>, HTMLFormElement>, "name" | "slot" | "style" | "title" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "autoComplete" | "method" | "target" | "acceptCharset" | "action" | "encType" | "noValidate"> & React.RefAttributes<HTMLFormElement>>, import("styled-components").DefaultTheme, {}, never>;
|
|
22
22
|
export declare const FormFields: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
23
|
-
export type
|
|
23
|
+
export type ReferencesFormValues = Pick<BibliographyItem, '_id' | 'title' | 'author' | 'DOI' | 'issued' | 'type' | 'container-title' | 'URL' | 'issue' | 'volume' | 'supplement' | 'page'>;
|
|
24
24
|
export declare const ReferenceForm: React.FC<{
|
|
25
|
-
values:
|
|
25
|
+
values: ReferencesFormValues;
|
|
26
26
|
showDelete: boolean;
|
|
27
|
-
handleChange: (values:
|
|
27
|
+
handleChange: (values: ReferencesFormValues) => void;
|
|
28
28
|
handleCancel: () => void;
|
|
29
29
|
handleDelete: () => void;
|
|
30
|
-
handleSave: (values:
|
|
30
|
+
handleSave: (values: ReferencesFormValues) => void;
|
|
31
31
|
}>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BibliographyItem } from '@manuscripts/json-schema';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import {
|
|
4
|
-
export declare const normalize: (item: BibliographyItem) =>
|
|
3
|
+
import { ReferencesFormValues } from './ReferenceForm';
|
|
4
|
+
export declare const normalize: (item: BibliographyItem) => ReferencesFormValues;
|
|
5
5
|
export interface ReferencesModalProps {
|
|
6
6
|
isOpen: boolean;
|
|
7
7
|
handleCancel: () => void;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@manuscripts/style-guide",
|
|
3
3
|
"description": "Shared components for Manuscripts applications",
|
|
4
|
-
"version": "1.5.0-LEAN-3180",
|
|
4
|
+
"version": "1.5.0-LEAN-3180-1",
|
|
5
5
|
"repository": "github:Atypon-OpenSource/manuscripts-style-guide",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"main": "dist/cjs",
|