@manuscripts/style-guide 1.5.0-LEAN-2992 → 1.5.0-LEAN-3180-3
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/Dialog.js +3 -3
- package/dist/cjs/components/References/BibliographyItemSource.js +91 -0
- package/dist/cjs/components/References/CitationEditor.js +146 -0
- package/dist/cjs/components/References/CitationViewer.js +69 -0
- package/dist/cjs/components/References/ReferenceForm.js +415 -0
- package/dist/cjs/components/References/ReferenceLine.js +52 -0
- package/dist/cjs/components/References/ReferenceSearch.js +124 -0
- package/dist/cjs/components/References/ReferenceSearchResults.js +68 -0
- package/dist/cjs/components/References/ReferenceSearchResultsPlaceholder.js +43 -0
- package/dist/cjs/components/References/ReferenceSearchSection.js +118 -0
- package/dist/cjs/components/References/ReferencesModal.js +219 -0
- package/dist/cjs/components/References/SearchInput.js +103 -0
- package/dist/cjs/components/{Menus → References}/index.js +4 -1
- package/dist/cjs/components/SelectField.js +25 -0
- package/dist/cjs/components/Sidebar.js +44 -0
- package/dist/cjs/components/StyledModal.js +80 -3
- package/dist/cjs/components/icons/delete-icon.js +15 -0
- package/dist/cjs/components/icons/link-icon.js +11 -0
- package/dist/cjs/components/icons/template-icon.js +11 -0
- package/dist/cjs/hooks/use-scroll-detection.js +53 -0
- package/dist/cjs/index.js +1 -4
- package/dist/es/components/Dialog.js +2 -2
- package/dist/es/components/References/BibliographyItemSource.js +64 -0
- package/dist/es/components/References/CitationEditor.js +116 -0
- package/dist/es/components/References/CitationViewer.js +39 -0
- package/dist/es/components/References/ReferenceForm.js +385 -0
- package/dist/es/components/References/ReferenceLine.js +42 -0
- package/dist/es/components/References/ReferenceSearch.js +94 -0
- package/dist/es/components/References/ReferenceSearchResults.js +61 -0
- package/dist/es/components/References/ReferenceSearchResultsPlaceholder.js +36 -0
- package/dist/es/components/References/ReferenceSearchSection.js +88 -0
- package/dist/es/components/References/ReferencesModal.js +188 -0
- package/dist/es/components/References/SearchInput.js +73 -0
- package/dist/es/components/References/index.js +4 -0
- package/dist/es/components/SelectField.js +18 -0
- package/dist/es/components/Sidebar.js +18 -0
- package/dist/es/components/StyledModal.js +81 -3
- package/dist/es/components/icons/delete-icon.js +8 -0
- package/dist/es/components/icons/link-icon.js +4 -0
- package/dist/es/components/icons/template-icon.js +4 -0
- package/dist/es/hooks/use-scroll-detection.js +49 -0
- package/dist/es/index.js +1 -4
- package/dist/types/components/Dialog.d.ts +1 -1
- package/dist/types/components/References/BibliographyItemSource.d.ts +38 -0
- package/dist/types/components/References/CitationEditor.d.ts +18 -0
- package/dist/types/components/{Menus/Submenu.d.ts → References/CitationViewer.d.ts} +8 -9
- package/dist/types/components/References/ReferenceForm.d.ts +35 -0
- package/dist/types/components/References/ReferenceLine.d.ts +10 -0
- package/dist/types/components/{Menus/Shortcut.d.ts → References/ReferenceSearch.d.ts} +11 -8
- package/dist/types/components/References/ReferenceSearchResults.d.ts +26 -0
- package/dist/types/components/References/ReferenceSearchResultsPlaceholder.d.ts +2 -0
- package/dist/types/components/References/ReferenceSearchSection.d.ts +25 -0
- package/dist/types/components/References/ReferencesModal.d.ts +14 -0
- package/dist/types/components/{Menus/Menus.d.ts → References/SearchInput.d.ts} +4 -10
- package/dist/types/components/References/index.d.ts +4 -0
- package/dist/{cjs/lib/menus.js → types/components/SelectField.d.ts} +11 -6
- package/dist/types/components/Sidebar.d.ts +2 -0
- package/dist/types/components/StyledModal.d.ts +26 -4
- package/dist/types/components/icons/delete-icon.d.ts +2 -0
- package/dist/types/components/icons/link-icon.d.ts +2 -0
- package/dist/types/components/icons/template-icon.d.ts +2 -0
- package/dist/{es/lib/menus.js → types/hooks/use-scroll-detection.d.ts} +7 -3
- package/dist/types/index.d.ts +1 -4
- package/package.json +2 -1
- package/dist/cjs/components/Menus/Menus.js +0 -62
- package/dist/cjs/components/Menus/Shortcut.js +0 -64
- package/dist/cjs/components/Menus/Submenu.js +0 -119
- package/dist/cjs/components/SimpleModal.js +0 -95
- package/dist/cjs/hooks/use-menus.js +0 -89
- package/dist/es/components/Menus/Menus.js +0 -55
- package/dist/es/components/Menus/Shortcut.js +0 -57
- package/dist/es/components/Menus/Submenu.js +0 -112
- package/dist/es/components/Menus/index.js +0 -1
- package/dist/es/components/SimpleModal.js +0 -88
- package/dist/es/hooks/use-menus.js +0 -85
- package/dist/types/components/Menus/index.d.ts +0 -1
- package/dist/types/components/SimpleModal.d.ts +0 -41
- package/dist/types/hooks/use-menus.d.ts +0 -7
- package/dist/types/lib/menus.d.ts +0 -38
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* ©
|
|
2
|
+
* © 2024 Atypon Systems LLC
|
|
3
3
|
*
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
* you may not use this file except in compliance with the License.
|
|
@@ -13,13 +13,12 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
+
import { BibliographyItem } from '@manuscripts/json-schema';
|
|
16
17
|
import React from 'react';
|
|
17
|
-
|
|
18
|
-
export declare const
|
|
19
|
-
export
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
handleClick: (position: number[]) => void;
|
|
18
|
+
export declare const CitedItems: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
19
|
+
export declare const CitedItem: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
20
|
+
export interface CitationViewerProps {
|
|
21
|
+
rids: string[];
|
|
22
|
+
items: BibliographyItem[];
|
|
23
23
|
}
|
|
24
|
-
export declare const
|
|
25
|
-
export {};
|
|
24
|
+
export declare const CitationViewer: React.FC<CitationViewerProps>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* © 2023 Atypon Systems LLC
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { BibliographyItem } from '@manuscripts/json-schema';
|
|
17
|
+
import React, { MutableRefObject } from 'react';
|
|
18
|
+
export declare const LabelContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
19
|
+
export declare const FormField: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
20
|
+
export declare const ReferenceTextArea: import("styled-components").StyledComponent<"textarea", import("styled-components").DefaultTheme, import("../Form").ErrorProps, never>;
|
|
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
|
+
export declare const FormFields: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
23
|
+
export type ReferenceFormValues = Pick<BibliographyItem, '_id' | 'title' | 'author' | 'DOI' | 'issued' | 'type' | 'container-title' | 'URL' | 'issue' | 'volume' | 'supplement' | 'page'>;
|
|
24
|
+
export interface ReferenceFormActions {
|
|
25
|
+
reset: () => void;
|
|
26
|
+
}
|
|
27
|
+
export declare const ReferenceForm: React.FC<{
|
|
28
|
+
values: ReferenceFormValues;
|
|
29
|
+
showDelete: boolean;
|
|
30
|
+
onChange: (values: ReferenceFormValues) => void;
|
|
31
|
+
onCancel: () => void;
|
|
32
|
+
onDelete: () => void;
|
|
33
|
+
onSave: (values: ReferenceFormValues) => void;
|
|
34
|
+
actionsRef?: MutableRefObject<ReferenceFormActions | undefined>;
|
|
35
|
+
}>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { BibliographyItem } from '@manuscripts/json-schema';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export declare const Metadata: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
4
|
+
export declare const MetadataContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
5
|
+
export declare const metadata: (item: BibliographyItem) => string;
|
|
6
|
+
export declare const issuedYear: (item: Partial<BibliographyItem>) => string;
|
|
7
|
+
export declare const authors: (item: BibliographyItem) => string;
|
|
8
|
+
export declare const ReferenceLine: React.FC<{
|
|
9
|
+
item: BibliographyItem;
|
|
10
|
+
}>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* ©
|
|
2
|
+
* © 2023 Atypon Systems LLC
|
|
3
3
|
*
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
* you may not use this file except in compliance with the License.
|
|
@@ -13,11 +13,14 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
+
import { BibliographyItem } from '@manuscripts/json-schema';
|
|
16
17
|
import React from 'react';
|
|
17
|
-
import {
|
|
18
|
-
export declare const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
import { BibliographyItemSource } from './BibliographyItemSource';
|
|
19
|
+
export declare const ReferenceSearch: React.FC<{
|
|
20
|
+
query?: string;
|
|
21
|
+
sources: BibliographyItemSource[];
|
|
22
|
+
items: BibliographyItem[];
|
|
23
|
+
onAdd: () => void;
|
|
24
|
+
onCite: (items: BibliographyItem[]) => void;
|
|
25
|
+
onCancel: () => void;
|
|
26
|
+
}>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* © 2023 Atypon Systems LLC
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { BibliographyItem } from '@manuscripts/json-schema';
|
|
17
|
+
import React from 'react';
|
|
18
|
+
export declare const ReferenceSearchResultsContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
19
|
+
export declare const ReferenceSearchResult: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
20
|
+
export declare const ReferenceSearchResults: React.FC<{
|
|
21
|
+
items: BibliographyItem[];
|
|
22
|
+
total: number;
|
|
23
|
+
isSelected: (item: BibliographyItem) => boolean;
|
|
24
|
+
onSelect: (item: BibliographyItem) => void;
|
|
25
|
+
onShowMore: () => void;
|
|
26
|
+
}>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* © 2023 Atypon Systems LLC
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { BibliographyItem } from '@manuscripts/json-schema';
|
|
17
|
+
import React from 'react';
|
|
18
|
+
import { BibliographyItemSource } from './BibliographyItemSource';
|
|
19
|
+
export declare const Arrow: import("styled-components").StyledComponent<React.SFC<React.SVGAttributes<SVGElement>>, import("styled-components").DefaultTheme, {}, never>;
|
|
20
|
+
export declare const ReferenceSearchSection: React.FC<{
|
|
21
|
+
query: string;
|
|
22
|
+
source: BibliographyItemSource;
|
|
23
|
+
isSelected: (item: BibliographyItem) => boolean;
|
|
24
|
+
onSelect: (item: BibliographyItem) => void;
|
|
25
|
+
}>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { BibliographyItem } from '@manuscripts/json-schema';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { ReferenceFormValues } from './ReferenceForm';
|
|
4
|
+
export declare const normalize: (item: BibliographyItem) => ReferenceFormValues;
|
|
5
|
+
export interface ReferencesModalProps {
|
|
6
|
+
isOpen: boolean;
|
|
7
|
+
onCancel: () => void;
|
|
8
|
+
items: BibliographyItem[];
|
|
9
|
+
item?: BibliographyItem;
|
|
10
|
+
citationCounts: Map<string, number>;
|
|
11
|
+
onSave: (item: BibliographyItem) => void;
|
|
12
|
+
onDelete: (item: BibliographyItem) => void;
|
|
13
|
+
}
|
|
14
|
+
export declare const ReferencesModal: React.FC<ReferencesModalProps>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* ©
|
|
2
|
+
* © 2023 Atypon Systems LLC
|
|
3
3
|
*
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
* you may not use this file except in compliance with the License.
|
|
@@ -13,12 +13,6 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import React, {
|
|
17
|
-
import {
|
|
18
|
-
|
|
19
|
-
menus: Menu[];
|
|
20
|
-
innerRef: Ref<HTMLDivElement>;
|
|
21
|
-
handleClick: (position: number[]) => void;
|
|
22
|
-
}
|
|
23
|
-
export declare const Menus: React.FC<MenusProps>;
|
|
24
|
-
export {};
|
|
16
|
+
import React, { InputHTMLAttributes } from 'react';
|
|
17
|
+
export declare const SearchWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
18
|
+
export declare const SearchInput: React.FC<InputHTMLAttributes<HTMLInputElement>>;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/*!
|
|
3
2
|
* © 2024 Atypon Systems LLC
|
|
4
3
|
*
|
|
@@ -14,9 +13,15 @@
|
|
|
14
13
|
* See the License for the specific language governing permissions and
|
|
15
14
|
* limitations under the License.
|
|
16
15
|
*/
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
16
|
+
import { FieldProps } from 'formik';
|
|
17
|
+
import React from 'react';
|
|
18
|
+
export type OptionType = {
|
|
19
|
+
label: string;
|
|
20
|
+
value: string;
|
|
21
21
|
};
|
|
22
|
-
|
|
22
|
+
interface Props {
|
|
23
|
+
id?: string;
|
|
24
|
+
options: OptionType[];
|
|
25
|
+
}
|
|
26
|
+
export declare const SelectField: React.FC<Props & FieldProps>;
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const SidebarStyles: import("styled-components").FlattenInterpolation<import("styled-components").ThemeProps<import("styled-components").DefaultTheme>>;
|
|
2
|
+
export declare const SidebarContent: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
@@ -14,13 +14,35 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import React from 'react';
|
|
17
|
-
import
|
|
17
|
+
import ReactModal from 'react-modal';
|
|
18
18
|
import { ThemeProps } from 'styled-components';
|
|
19
19
|
interface Props {
|
|
20
|
-
modalClassName?:
|
|
20
|
+
modalClassName?: ReactModal.Classes;
|
|
21
21
|
}
|
|
22
|
-
export declare const
|
|
23
|
-
export declare const
|
|
22
|
+
export declare const ModalContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
23
|
+
export declare const ModalHeader: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
24
|
+
export declare const CloseButton: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {
|
|
25
|
+
type: "button" | "reset" | "submit";
|
|
26
|
+
} & {
|
|
27
|
+
danger?: boolean | undefined;
|
|
28
|
+
disabled?: boolean | undefined;
|
|
29
|
+
mini?: boolean | undefined;
|
|
30
|
+
} & {
|
|
31
|
+
defaultColor?: boolean | undefined;
|
|
32
|
+
size?: number | undefined;
|
|
33
|
+
iconColor?: string | undefined;
|
|
34
|
+
} & {
|
|
35
|
+
defaultColor: boolean;
|
|
36
|
+
} & {
|
|
37
|
+
size?: number | undefined;
|
|
38
|
+
}, "type" | "defaultColor">;
|
|
39
|
+
export declare const ModalBody: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
40
|
+
export declare const ModalSidebar: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
41
|
+
export declare const ModalSidebarHeader: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
42
|
+
export declare const ModalSidebarTitle: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
43
|
+
export declare const ModelContent: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
44
|
+
export declare const ScrollableModalContent: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
45
|
+
export declare const StyledModal: import("styled-components").StyledComponent<React.FC<ReactModal.Props & ThemeProps<ReactModal> & Props>, import("styled-components").DefaultTheme, {
|
|
24
46
|
closeTimeoutMS: 800;
|
|
25
47
|
overlayClassName: {
|
|
26
48
|
base: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* ©
|
|
2
|
+
* © 2023 Atypon Systems LLC
|
|
3
3
|
*
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
* you may not use this file except in compliance with the License.
|
|
@@ -13,6 +13,10 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
export const
|
|
17
|
-
|
|
16
|
+
export declare const useScrollDetection: (topTrigger: number, bottomTrigger: number) => {
|
|
17
|
+
ref: (node: HTMLDivElement | null) => void;
|
|
18
|
+
triggers: {
|
|
19
|
+
bottom: boolean;
|
|
20
|
+
top: boolean;
|
|
21
|
+
};
|
|
18
22
|
};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -34,7 +34,6 @@ export * from './components/FileManager';
|
|
|
34
34
|
export * from './components/FileManager/util';
|
|
35
35
|
export * from './components/Resizer';
|
|
36
36
|
export * from './components/SaveStatus';
|
|
37
|
-
export * from './components/SimpleModal';
|
|
38
37
|
export * from './components/StyledModal';
|
|
39
38
|
export * from './components/TextField';
|
|
40
39
|
export * from './components/TextFieldContainer';
|
|
@@ -54,15 +53,13 @@ export * from './components/Text';
|
|
|
54
53
|
export * from './components/ManuscriptNoteList';
|
|
55
54
|
export * from './components/Comments';
|
|
56
55
|
export * from './components/RelativeDate';
|
|
57
|
-
export * from './components/
|
|
56
|
+
export * from './components/References';
|
|
58
57
|
export * from './hooks/use-dropdown';
|
|
59
58
|
export * from './hooks/use-files';
|
|
60
|
-
export * from './hooks/use-menus';
|
|
61
59
|
export { useDeepCompareMemo, useDeepCompareCallback, } from './hooks/use-deep-compare';
|
|
62
60
|
export * from './lib/authors';
|
|
63
61
|
export * from './lib/capabilities';
|
|
64
62
|
export * from './lib/files';
|
|
65
63
|
export * from './lib/comments';
|
|
66
|
-
export * from './lib/menus';
|
|
67
64
|
export { default as errorsDecoder } from './lib/errors-decoder';
|
|
68
65
|
export * from './types';
|
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-
|
|
4
|
+
"version": "1.5.0-LEAN-3180-3",
|
|
5
5
|
"repository": "github:Atypon-OpenSource/manuscripts-style-guide",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"main": "dist/cjs",
|
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
"@manuscripts/json-schema": "2.2.1",
|
|
41
41
|
"@reach/tabs": "^0.11.2",
|
|
42
42
|
"formik": "^2.2.9",
|
|
43
|
+
"fuzzysort": "^2.0.4",
|
|
43
44
|
"date-fns": "^2.29.3",
|
|
44
45
|
"lodash-es": "^4.17.21",
|
|
45
46
|
"tooltip.js": "^1.3.3",
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*!
|
|
3
|
-
* © 2019 Atypon Systems LLC
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
18
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19
|
-
};
|
|
20
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
exports.Menus = void 0;
|
|
22
|
-
const react_1 = __importDefault(require("react"));
|
|
23
|
-
const react_modal_1 = __importDefault(require("react-modal"));
|
|
24
|
-
const styled_components_1 = __importDefault(require("styled-components"));
|
|
25
|
-
const Submenu_1 = require("./Submenu");
|
|
26
|
-
react_modal_1.default.setAppElement('#root');
|
|
27
|
-
const MenusContainer = styled_components_1.default.div `
|
|
28
|
-
display: flex;
|
|
29
|
-
font-size: 14px;
|
|
30
|
-
`;
|
|
31
|
-
const MenuHeading = styled_components_1.default.div `
|
|
32
|
-
padding: 4px 8px;
|
|
33
|
-
cursor: pointer;
|
|
34
|
-
border: 1px solid transparent;
|
|
35
|
-
border-bottom: none;
|
|
36
|
-
`;
|
|
37
|
-
const MenuContainer = styled_components_1.default.div `
|
|
38
|
-
position: relative;
|
|
39
|
-
|
|
40
|
-
& ${MenuHeading} {
|
|
41
|
-
background-color: #fff;
|
|
42
|
-
color: ${(props) => (props.isEnabled ? '#353535' : '#e2e2e2')};
|
|
43
|
-
|
|
44
|
-
&:hover {
|
|
45
|
-
background-color: ${(props) => (props.isEnabled ? '#f2fbfc' : '#fff')};
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
`;
|
|
49
|
-
const Menus = ({ menus, innerRef, handleClick, }) => {
|
|
50
|
-
return (react_1.default.createElement(MenusContainer, { ref: innerRef }, menus.map((menu, index) => {
|
|
51
|
-
return (react_1.default.createElement(MenuContainer, { key: `menu-${index}`, isEnabled: menu.isEnabled },
|
|
52
|
-
react_1.default.createElement(MenuHeading, { onMouseDown: (e) => {
|
|
53
|
-
e.preventDefault();
|
|
54
|
-
handleClick([index]);
|
|
55
|
-
}, isOpen: menu.isOpen },
|
|
56
|
-
react_1.default.createElement(Submenu_1.Text, null, menu.label)),
|
|
57
|
-
menu.isEnabled && menu.isOpen && menu.submenu && (react_1.default.createElement(Submenu_1.SubmenusContainer, null, menu.submenu.map((submenu, sindex) => {
|
|
58
|
-
return (react_1.default.createElement(Submenu_1.Submenu, { key: `${index}-${sindex}`, menu: submenu, handleClick: (i) => handleClick([index, sindex, ...i]) }));
|
|
59
|
-
})))));
|
|
60
|
-
})));
|
|
61
|
-
};
|
|
62
|
-
exports.Menus = Menus;
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*!
|
|
3
|
-
* © 2019 Atypon Systems LLC
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
18
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19
|
-
};
|
|
20
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
exports.Shortcut = exports.ShortcutContainer = void 0;
|
|
22
|
-
const react_1 = __importDefault(require("react"));
|
|
23
|
-
const styled_components_1 = __importDefault(require("styled-components"));
|
|
24
|
-
const isMac = /Mac/.test(window.navigator.platform);
|
|
25
|
-
exports.ShortcutContainer = styled_components_1.default.div `
|
|
26
|
-
display: inline-flex;
|
|
27
|
-
color: #6e6e6e;
|
|
28
|
-
margin-left: 16px;
|
|
29
|
-
flex-shrink: 0;
|
|
30
|
-
justify-content: flex-end;
|
|
31
|
-
`;
|
|
32
|
-
const macModifiers = {
|
|
33
|
-
Option: '⌥',
|
|
34
|
-
CommandOrControl: '⌘',
|
|
35
|
-
Shift: '⇧',
|
|
36
|
-
};
|
|
37
|
-
const pcModifiers = {
|
|
38
|
-
Option: 'Alt',
|
|
39
|
-
CommandOrControl: 'Ctrl',
|
|
40
|
-
Shift: 'Shift',
|
|
41
|
-
};
|
|
42
|
-
const modifiers = isMac ? macModifiers : pcModifiers;
|
|
43
|
-
const system = isMac ? 'mac' : 'pc';
|
|
44
|
-
const separator = isMac ? '' : '-';
|
|
45
|
-
const Character = styled_components_1.default.span `
|
|
46
|
-
display: inline-block;
|
|
47
|
-
min-width: 1ch;
|
|
48
|
-
`;
|
|
49
|
-
const parts = (shortcut) => {
|
|
50
|
-
const nodes = [];
|
|
51
|
-
for (const part of shortcut[system].split('+')) {
|
|
52
|
-
const modifier = modifiers[part];
|
|
53
|
-
if (modifier) {
|
|
54
|
-
nodes.push(modifier);
|
|
55
|
-
nodes.push(separator);
|
|
56
|
-
}
|
|
57
|
-
else {
|
|
58
|
-
nodes.push(react_1.default.createElement(Character, { key: part }, part));
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
return nodes;
|
|
62
|
-
};
|
|
63
|
-
const Shortcut = ({ shortcut }) => (react_1.default.createElement(exports.ShortcutContainer, null, parts(shortcut)));
|
|
64
|
-
exports.Shortcut = Shortcut;
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*!
|
|
3
|
-
* © 2019 Atypon Systems LLC
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
18
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19
|
-
};
|
|
20
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
exports.Submenu = exports.SubmenusContainer = exports.Text = void 0;
|
|
22
|
-
const TriangleCollapsed_1 = __importDefault(require("@manuscripts/assets/react/TriangleCollapsed"));
|
|
23
|
-
const react_1 = __importDefault(require("react"));
|
|
24
|
-
const styled_components_1 = __importDefault(require("styled-components"));
|
|
25
|
-
const menus_1 = require("../../lib/menus");
|
|
26
|
-
const Shortcut_1 = require("./Shortcut");
|
|
27
|
-
exports.Text = styled_components_1.default.div `
|
|
28
|
-
flex: 1 0 auto;
|
|
29
|
-
`;
|
|
30
|
-
const SubmenuContainer = styled_components_1.default.div `
|
|
31
|
-
position: relative;
|
|
32
|
-
`;
|
|
33
|
-
exports.SubmenusContainer = styled_components_1.default.div `
|
|
34
|
-
background: #fff;
|
|
35
|
-
border: 1px solid #e2e2e2;
|
|
36
|
-
border-radius: 4px;
|
|
37
|
-
box-shadow: 0 4px 9px 0 rgba(84, 83, 83, 0.3);
|
|
38
|
-
color: #353535;
|
|
39
|
-
min-width: 150px;
|
|
40
|
-
max-height: 70vh;
|
|
41
|
-
overflow-y: auto;
|
|
42
|
-
padding: 4px 0;
|
|
43
|
-
white-space: nowrap;
|
|
44
|
-
width: auto;
|
|
45
|
-
z-index: 10;
|
|
46
|
-
|
|
47
|
-
position: absolute;
|
|
48
|
-
|
|
49
|
-
&[data-placement='bottom-start'] {
|
|
50
|
-
border-top-left-radius: 0;
|
|
51
|
-
border-top-right-radius: 0;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
&[data-placement='right-start'] {
|
|
55
|
-
top: 8px;
|
|
56
|
-
}
|
|
57
|
-
`;
|
|
58
|
-
const NestedSubmenusContainer = (0, styled_components_1.default)(exports.SubmenusContainer) `
|
|
59
|
-
top: 0;
|
|
60
|
-
left: 100%;
|
|
61
|
-
`;
|
|
62
|
-
const Separator = styled_components_1.default.div `
|
|
63
|
-
height: 0;
|
|
64
|
-
border-bottom: 1px solid #e2e2e2;
|
|
65
|
-
margin: 4px 0;
|
|
66
|
-
`;
|
|
67
|
-
const Active = styled_components_1.default.div `
|
|
68
|
-
width: 16px;
|
|
69
|
-
display: inline-flex;
|
|
70
|
-
flex-shrink: 0;
|
|
71
|
-
justify-content: center;
|
|
72
|
-
align-items: center;
|
|
73
|
-
`;
|
|
74
|
-
const Arrow = (0, styled_components_1.default)(TriangleCollapsed_1.default) `
|
|
75
|
-
margin-left: 8px;
|
|
76
|
-
`;
|
|
77
|
-
const Container = styled_components_1.default.div `
|
|
78
|
-
align-items: center;
|
|
79
|
-
cursor: pointer;
|
|
80
|
-
display: flex;
|
|
81
|
-
padding: 8px 16px 8px 4px;
|
|
82
|
-
position: relative;
|
|
83
|
-
${(props) => props.isOpen && 'background: #f2fbfc;'}
|
|
84
|
-
|
|
85
|
-
&:hover {
|
|
86
|
-
background: #f2fbfc;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
&.disabled {
|
|
90
|
-
cursor: default;
|
|
91
|
-
opacity: 0.4;
|
|
92
|
-
}
|
|
93
|
-
`;
|
|
94
|
-
const activeContent = (menu) => (menu.isActive ? '✓' : '');
|
|
95
|
-
const Submenu = ({ menu, handleClick }) => {
|
|
96
|
-
if ((0, menus_1.isMenuSeparator)(menu)) {
|
|
97
|
-
return react_1.default.createElement(Separator, null);
|
|
98
|
-
}
|
|
99
|
-
if (!menu.submenu) {
|
|
100
|
-
return (react_1.default.createElement(Container, { isOpen: menu.isOpen, className: menu.isEnabled ? '' : 'disabled', onMouseDown: (e) => {
|
|
101
|
-
e.preventDefault();
|
|
102
|
-
handleClick([]);
|
|
103
|
-
} },
|
|
104
|
-
react_1.default.createElement(Active, null, activeContent(menu)),
|
|
105
|
-
react_1.default.createElement(exports.Text, null, menu.label),
|
|
106
|
-
menu.shortcut && react_1.default.createElement(Shortcut_1.Shortcut, { shortcut: menu.shortcut })));
|
|
107
|
-
}
|
|
108
|
-
return (react_1.default.createElement(SubmenuContainer, null,
|
|
109
|
-
react_1.default.createElement(Container, { onMouseDown: (e) => {
|
|
110
|
-
e.preventDefault();
|
|
111
|
-
handleClick([]);
|
|
112
|
-
}, isOpen: menu.isOpen, className: menu.isEnabled ? '' : 'disabled' },
|
|
113
|
-
react_1.default.createElement(Active, null, activeContent(menu)),
|
|
114
|
-
react_1.default.createElement(exports.Text, null, menu.label),
|
|
115
|
-
menu.submenu && react_1.default.createElement(Arrow, null),
|
|
116
|
-
menu.shortcut && react_1.default.createElement(Shortcut_1.Shortcut, { shortcut: menu.shortcut })),
|
|
117
|
-
menu.submenu && menu.isOpen && (react_1.default.createElement(NestedSubmenusContainer, null, menu.submenu.map((submenu, index) => (react_1.default.createElement(exports.Submenu, { key: `menu-${index}`, menu: submenu, handleClick: (i) => handleClick([index, ...i]) })))))));
|
|
118
|
-
};
|
|
119
|
-
exports.Submenu = Submenu;
|