Skip to content

Commit

Permalink
Update 10.0.1 (ApryseSDK#1006)
Browse files Browse the repository at this point in the history
* Update to 10.0.1

* Package lock

* Update package lock

* Missing dependency
  • Loading branch information
bollain authored Apr 22, 2023
1 parent 552a5b6 commit 87b6505
Show file tree
Hide file tree
Showing 93 changed files with 1,372 additions and 1,109 deletions.
1 change: 1 addition & 0 deletions jest/svgTransform.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
*
*/

// eslint-disable-next-line @typescript-eslint/no-var-requires
const path = require('path');
module.exports = {
process(src, filename) {
Expand Down
1,162 changes: 591 additions & 571 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "webviewer-ui",
"author": "Apryse Software Inc.",
"version": "10.0.0",
"version": "10.0.1",
"description": "WebViewer UI built in React",
"main": "src/index.js",
"scripts": {
Expand Down Expand Up @@ -92,8 +92,8 @@
"eslint-plugin-cypress": "^2.8.1",
"eslint-plugin-import": "^2.20.0",
"eslint-plugin-jsx-a11y": "^6.2.3",
"eslint-plugin-react": "^7.18.0",
"eslint-plugin-no-unsanitized": "^4.0.2",
"eslint-plugin-react": "^7.18.0",
"eslint-plugin-react-hooks": "^2.3.0",
"express": "^4.17.1",
"file-loader": "^5.0.2",
Expand Down Expand Up @@ -124,4 +124,4 @@
"webpack-dev-middleware": "^3.7.2",
"webpack-hot-middleware": "^2.25.0"
}
}
}
2 changes: 2 additions & 0 deletions src/apis/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ import RibbonGroup from './ModularComponents/ribbonGroup';
import ToggleElementButton from './ModularComponents/toggleElementButton';
import ToolGroupButton from './ModularComponents/toolGroupButton';
import Flyout from './ModularComponents/flyout';
import setMultiViewerSyncScrollingMode from './setMultiViewerSyncScrollingMode';

import {
getMeasurementScalePreset,
Expand Down Expand Up @@ -537,6 +538,7 @@ export default (store) => {
importUserSettings: importUserSettings(store),
setGrayscaleDarknessFactor,
setSideWindowVisibility: setSideWindowVisibility(store),
setMultiViewerSyncScrollingMode: setMultiViewerSyncScrollingMode(store),

// undocumented
loadedFromServer: false,
Expand Down
22 changes: 22 additions & 0 deletions src/apis/setMultiViewerSyncScrollingMode.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/**
* Set the scrolling behavior of sync scrolling in semantic compare mode.
* Must be one of the following values:
* - 'SYNC': scroll synchronously in both documents
* - 'SKIP_UNMATCHED': scroll according to the next matched position in both documents
* @method UI.setMultiViewerSyncScrollingMode
* @param {(string)} multiViewerSyncScrollingMode the scrolling behavior of sync scrolling in semantic comparing mode.
* @example
WebViewer(...)
.then(function(instance) {
instance.UI.setMultiViewerSyncScrollingMode('SYNC');
});
*/

import actions from 'actions';
import { SYNC_MODES } from 'constants/multiViewerContants';

export default (store) => (multiViewerComparedSyncScrollingMode) => {
const { TYPES, checkTypes } = window.Core;
checkTypes([multiViewerComparedSyncScrollingMode], [TYPES.ONE_OF(SYNC_MODES.SYNC, SYNC_MODES.SKIP_UNMATCHED)], 'UI.setMultiViewerSyncScrollingMode');
store.dispatch(actions.setMultiViewerSyncScrollingMode(multiViewerComparedSyncScrollingMode));
};
2 changes: 1 addition & 1 deletion src/components/AnnotationPopup/AnnotationPopup.js
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ const AnnotationPopup = ({
<div className="container">
<CustomizablePopup
dataElement={DataElements.ANNOTATION_POPUP}
childrenClassName="main-menu-button"
childrenClassName='main-menu-button'
>
{showViewFileButton && (
<ActionButton
Expand Down
7 changes: 5 additions & 2 deletions src/components/AnnotationStylePopup/AnnotationStylePopup.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ class AnnotationStylePopup extends React.Component {
};

adjustFreeTextBoundingBox = (annotation) => {
if (annotation instanceof window.Core.Annotations.FreeTextAnnotation) {
const { FreeTextAnnotation } = window.Core.Annotations;
if (annotation instanceof FreeTextAnnotation && annotation.getAutoSizeType() !== FreeTextAnnotation.AutoSizeTypes.NONE) {
const doc = core.getDocument();
const pageNumber = annotation['PageNumber'];
const pageInfo = doc.getPageInfo(pageNumber);
Expand Down Expand Up @@ -62,7 +63,9 @@ class AnnotationStylePopup extends React.Component {
if (isToolDefaultStyleUpdateFromAnnotationPopupEnabled) {
setToolStyles(annotation.ToolName, property, value);
}
this.adjustFreeTextBoundingBox(annotation);
if (property === 'FontSize' || property === 'Font') {
this.adjustFreeTextBoundingBox(annotation);
}
});
}

Expand Down
2 changes: 1 addition & 1 deletion src/components/Bookmark/Bookmark.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ const Bookmark = ({
<BookmarkOutlineContextMenuPopup
type={'bookmark'}
anchorButton={`bookmark-more-button-${pageIndex}`}
shouldDisplayDeleteButton
shouldDisplayDeleteButton={true}
onClosePopup={() => setContextMenuOpen(false)}
onRenameClick={() => {
setContextMenuOpen(false);
Expand Down
22 changes: 11 additions & 11 deletions src/components/Bookmark/Bookmark.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ const initialState = {

export const Basic = () => {
return (
<div className="Panel LeftPanel" style={{ width: '330px', minWidth: '330px' }}>
<div className="left-panel-container" style={{ minWidth: '330px' }}>
<div className='Panel LeftPanel' style={{ width: '330px', minWidth: '330px' }}>
<div className='left-panel-container' style={{ minWidth: '330px' }}>
<Provider store={configureStore({ reducer: () => initialState })}>
<Bookmark
text="Double click to rename me"
label="Page 1 - Bookmark Title"
defaultLabel="Page 1"
text='Double click to rename me'
label='Page 1 - Bookmark Title'
defaultLabel='Page 1'
pageIndex={0}
isAdding={false}
isMultiSelectionMode={false}
Expand All @@ -63,15 +63,15 @@ export const Basic = () => {

export const Adding = () => {
return (
<div className="Panel LeftPanel" style={{ width: '330px', minWidth: '330px' }}>
<div className="left-panel-container" style={{ minWidth: '330px' }}>
<div className='Panel LeftPanel' style={{ width: '330px', minWidth: '330px' }}>
<div className='left-panel-container' style={{ minWidth: '330px' }}>
<Provider store={configureStore({ reducer: () => initialState })}>
<Bookmark
text="A bookmark"
label="Page 1 - Bookmark Title"
defaultLabel="Page 1"
text='A bookmark'
label='Page 1 - Bookmark Title'
defaultLabel='Page 1'
pageIndex={0}
isAdding
isAdding={true}
isMultiSelectionMode={false}
setSelected={NOOP}
onSave={NOOP}
Expand Down
8 changes: 4 additions & 4 deletions src/components/BookmarksPanel/BookmarksPanel.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ export const Basic = () => {
};

return (
<div className="Panel LeftPanel" style={{ width: '330px', minWidth: '330px' }}>
<div className="left-panel-container" style={{ minWidth: '330px' }}>
<div className='Panel LeftPanel' style={{ width: '330px', minWidth: '330px' }}>
<div className='left-panel-container' style={{ minWidth: '330px' }}>
<Provider store={configureStore({ reducer: () => initialState })}>
<BookmarksPanel />
</Provider>
Expand Down Expand Up @@ -75,8 +75,8 @@ export const NoBookmarks = () => {
};

return (
<div className="Panel LeftPanel" style={{ width: '330px', minWidth: '330px' }}>
<div className="left-panel-container" style={{ minWidth: '330px' }}>
<div className='Panel LeftPanel' style={{ width: '330px', minWidth: '330px' }}>
<div className='left-panel-container' style={{ minWidth: '330px' }}>
<Provider store={configureStore({ reducer: () => initialState })}>
<BookmarksPanel />
</Provider>
Expand Down
2 changes: 1 addition & 1 deletion src/components/CalibrationPopup/CalibrationPopup.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ const CalibrationPopup = ({ annotation }) => {
ref={inputRef}
type={valueInputType}
value={valueDisplay}
min="0"
min='0'
onChange={onValueInputChange}
onBlur={onValueInputBlur}
placeholder={isFractionalUnit ? hintValues[unitTo] : (unitTo === 'ft-in' ? hintValues['ft-in decimal'] : '')}
Expand Down
4 changes: 2 additions & 2 deletions src/components/ColorPickerOverlay/ColorPickerOverlay.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const ColorPickerOverlay = ({

return createPortal(
<DataElementWrapper
data-element="colorPickerOverlay"
data-element='colorPickerOverlay'
className={classNames({
ColorPickerOverlay: true,
Popup: true,
Expand All @@ -64,7 +64,7 @@ const ColorPickerOverlay = ({
>
<ColorPalette
color={color}
property="TextColor"
property='TextColor'
onStyleChange={onStyleChange}
useMobileMinMaxWidth
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const store = configureStore({ reducer: () => initialState });
const BasicComponent = ({ children }) => {
return (
<Provider store={store}>
<div data-element="textColorButton" />
<div data-element='textColorButton' />
{children}
</Provider>
);
Expand Down
2 changes: 1 addition & 1 deletion src/components/ContextMenuPopup/ContextMenuPopup.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ const ContextMenuPopup = ({
) : (
<CustomizablePopup
dataElement={DataElements.CONTEXT_MENU_POPUP}
childrenClassName="main-menu-button"
childrenClassName='main-menu-button'
>
<ActionButton
className="main-menu-button"
Expand Down
9 changes: 8 additions & 1 deletion src/components/CreateStampModal/CreateStampModal.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState } from 'react';
import React, { useEffect, useState } from 'react';
import classNames from 'classnames';
import { useSelector, useDispatch, useStore } from 'react-redux';
import { FocusTrap } from '@pdftron/webviewer-react-toolkit';
Expand Down Expand Up @@ -27,6 +27,13 @@ const CustomStampModal = () => {
selectors.getUserName(state),
]);
const dispatch = useDispatch();

useEffect(() => {
if (isOpen) {
core.deselectAllAnnotations();
}
}, [isOpen]);

const closeModal = () => {
dispatch(actions.closeElement('customStampModal'));
};
Expand Down
3 changes: 1 addition & 2 deletions src/components/DimensionInput/DimensionInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ const DimensionInput = ({ className, label, initialValue, onChange, unit, maxLen
<div className={classNames({
dimensionInput: true,
[className]: !!className,
})}
>
})}>
<label className="dimension-input-label">
{label}
<div className="dimension-input-container">
Expand Down
2 changes: 1 addition & 1 deletion src/components/Dropdown/Dropdown.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export function DropdownWithInput() {
items={items}
translationPrefix={translationPrefix}
currentSelectionKey={currentSelectionKey}
hasInput
hasInput={true}
/>
</div>
</ReduxProvider>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ const SignatureOptionsDropdown = (props) => {

return (
<DataElementWrapper
className="signature-options-container"
dataElement="signatureOptionsDropdown"
className='signature-options-container'
dataElement='signatureOptionsDropdown'
>
<label>
{t('formField.type')}:
Expand All @@ -81,8 +81,7 @@ const SignatureOptionsDropdown = (props) => {
options={signatureOptions}
isSearchable={false}
isClearable={false}
components={{ IndicatorsContainer: CustomArrowIndicator }}
/>
components={{ IndicatorsContainer: CustomArrowIndicator }} />
</DataElementWrapper>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ const GenericOutlinesPanel = () => {
))}
{isAddingNewOutline && activeOutlinePath === null && (
<DataElementWrapper className="bookmark-outline-single-container editing">
<OutlineContent isAdding text={''} onCancel={() => setAddingNewOutline(false)} />
<OutlineContent isAdding={true} text={''} onCancel={() => setAddingNewOutline(false)} />
</DataElementWrapper>
)}
</div>
Expand Down
Loading

0 comments on commit 87b6505

Please sign in to comment.