Skip to content

Commit b524a12

Browse files
committed
Update 11.4
1 parent b744d64 commit b524a12

38 files changed

+5668
-2109
lines changed

package-lock.json

Lines changed: 5468 additions & 929 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -70,22 +70,22 @@
7070
"@babel/plugin-proposal-throw-expressions": "^7.8.3",
7171
"@babel/preset-env": "^7.8.3",
7272
"@babel/preset-react": "^7.8.3",
73-
"@chromatic-com/storybook": "^3.2.6",
73+
"@chromatic-com/storybook": "^1.3.5",
7474
"@google-cloud/translate": "^5.1.4",
7575
"@hot-loader/react-dom": "^17.0.2",
7676
"@pdftron/webviewer-downloader": "^1.4.2",
7777
"@pdftron/webviewer-reading-mode": "1.0.8",
7878
"@reduxjs/toolkit": "^1.8.1",
79-
"@storybook/addon-a11y": "^8.6.7",
80-
"@storybook/addon-actions": "^8.6.7",
81-
"@storybook/addon-essentials": "^8.6.7",
82-
"@storybook/addon-interactions": "^8.6.7",
83-
"@storybook/addon-links": "^8.6.7",
84-
"@storybook/addon-themes": "^8.6.7",
85-
"@storybook/addon-webpack5-compiler-swc": "^3.0.0",
86-
"@storybook/react": "^8.6.7",
87-
"@storybook/react-webpack5": "^8.6.7",
88-
"@storybook/test": "^8.6.7",
79+
"@storybook/addon-a11y": "^8.1.3",
80+
"@storybook/addon-actions": "^8.1.0",
81+
"@storybook/addon-essentials": "^8.1.0",
82+
"@storybook/addon-interactions": "^8.1.2",
83+
"@storybook/addon-links": "^8.1.0",
84+
"@storybook/addon-themes": "^8.1.0",
85+
"@storybook/addon-webpack5-compiler-swc": "^1.0.2",
86+
"@storybook/react": "^8.1.0",
87+
"@storybook/react-webpack5": "^8.1.0",
88+
"@storybook/test": "^8.1.2",
8989
"@testing-library/jest-dom": "^5.11.4",
9090
"@testing-library/react": "^10.4.9",
9191
"@testing-library/react-hooks": "^5.0.3",
@@ -131,8 +131,8 @@
131131
"rimraf": "^3.0.0",
132132
"sass": "^1.34.0",
133133
"sass-loader": "^8.0.2",
134-
"storybook": "^8.6.7",
135-
"storybook-addon-pseudo-states": "^4.0.3",
134+
"storybook": "^8.1.0",
135+
"storybook-addon-pseudo-states": "^3.1.1",
136136
"style-loader": "^1.1.3",
137137
"stylelint": "^13.13.1",
138138
"svg-inline-loader": "^0.8.0",
@@ -145,4 +145,4 @@
145145
"lint-staged": {
146146
"./src/**/*.{js,ts}": "eslint --fix"
147147
}
148-
}
148+
}

src/apis/setTheme.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import highContastLightModeString from '!!raw-loader!../constants/highContrastLi
1010
import darkModeString from '!!raw-loader!../constants/dark.scss';
1111
import highContrastDarkModeString from '!!raw-loader!../constants/highContrastDark.scss';
1212
import Theme from '../constants/theme';
13-
import getRootNode from 'helpers/getRootNode';
1413

1514
/**
1615
* Sets the theme of WebViewer UI. Please note that this does not work in IE11.
@@ -53,10 +52,7 @@ export default (store) => {
5352
};
5453

5554
const setVariables = (themeVarString = '') => {
56-
let root = document.documentElement;
57-
if (window.isApryseWebViewerWebComponent) {
58-
root = getRootNode().host;
59-
}
55+
const root = document.documentElement;
6056
const themeVariables = parse(themeVarString, {});
6157
Object.keys(themeVariables).forEach((key) => {
6258
const themeVariable = themeVariables[key];

src/components/Dropdown/Dropdown.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ function Dropdown({
8181
id = '',
8282
items,
8383
images,
84-
width = DEFAULT_WIDTH,
84+
width = width || DEFAULT_WIDTH,
8585
height,
8686
columns = 1,
8787
currentSelectionKey,

src/components/Icon/svgMap.js

Lines changed: 0 additions & 19 deletions
This file was deleted.

src/components/Icon/svgMap.vite.js

Lines changed: 0 additions & 10 deletions
This file was deleted.

src/components/Icon/svgMap.webpack.js

Lines changed: 0 additions & 10 deletions
This file was deleted.

src/components/MeasurementOverlay/LineMeasurementInput.js

Lines changed: 51 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,22 @@ function LineMeasurementInput({ annotation, isOpen, selectedTool, canModify }) {
2929
const unit = annotation?.DisplayUnits[0] || selectedTool?.Measure?.unit;
3030
const [length, setLength] = useState((annotation?.getLineLength() * factor || 0).toFixed(2));
3131

32+
useEffect(() => {
33+
if (!annotation) {
34+
setAngle(computeAngle());
35+
return;
36+
}
37+
const onAnnotationChanged = () => {
38+
setLength((annotation.getLineLength() * factor).toFixed(2));
39+
setAngle(computeAngle());
40+
};
41+
core.addEventListener('mouseMove', onAnnotationChanged);
42+
43+
return () => {
44+
core.removeEventListener('mouseMove', onAnnotationChanged);
45+
};
46+
}, [annotation, computeAngle, factor, selectedTool]);
47+
3248
const onInputChanged = (event) => {
3349
setLength(event.target.value);
3450
validateLineLength(event);
@@ -68,42 +84,6 @@ function LineMeasurementInput({ annotation, isOpen, selectedTool, canModify }) {
6884
return Math.abs(value1 - value2) < 0.1;
6985
};
7086

71-
const forceLineRedraw = useCallback(() => {
72-
const annotationManager = core.getAnnotationManager();
73-
annotationManager.drawAnnotations(annotation.PageNumber);
74-
annotationManager.trigger('annotationChanged', [[annotation], 'modify', {}]);
75-
}, [annotation]);
76-
77-
const getMaxLineLengthInPts = useCallback(() => {
78-
const currentPageNumber = core.getCurrentPage();
79-
const documentWidth = core.getPageWidth(currentPageNumber);
80-
const documentHeight = core.getPageHeight(currentPageNumber);
81-
const angleInDegrees = annotation.getAngle() * (180 / Math.PI).toFixed(2);
82-
const startPoint = annotation.getStartPoint();
83-
const startX = startPoint.x;
84-
const startY = startPoint.y;
85-
86-
let maxX;
87-
let maxY;
88-
if (Math.abs(angleInDegrees) < 90) {
89-
maxX = documentWidth;
90-
} else {
91-
maxX = 0;
92-
}
93-
94-
if (angleInDegrees > 0) {
95-
maxY = documentHeight;
96-
} else {
97-
maxY = 0;
98-
}
99-
100-
const maxLenX = Math.abs((maxX - startX) / Math.cos(annotation.getAngle()));
101-
const maxLenY = Math.abs((maxY - startY) / Math.sin(annotation.getAngle()));
102-
103-
return Math.min(maxLenX, maxLenY);
104-
}, [annotation]);
105-
106-
10787
const ensureLineIsWithinBounds = useCallback(
10888
(lengthInPts) => {
10989
if (!isApproximatelyEqual(annotation.getLineLength(), lengthInPts)) {
@@ -151,6 +131,41 @@ function LineMeasurementInput({ annotation, isOpen, selectedTool, canModify }) {
151131
);
152132
};
153133

134+
const forceLineRedraw = useCallback(() => {
135+
const annotationManager = core.getAnnotationManager();
136+
annotationManager.drawAnnotations(annotation.PageNumber);
137+
annotationManager.trigger('annotationChanged', [[annotation], 'modify', {}]);
138+
}, [annotation]);
139+
140+
const getMaxLineLengthInPts = useCallback(() => {
141+
const currentPageNumber = core.getCurrentPage();
142+
const documentWidth = core.getPageWidth(currentPageNumber);
143+
const documentHeight = core.getPageHeight(currentPageNumber);
144+
const angleInDegrees = annotation.getAngle() * (180 / Math.PI).toFixed(2);
145+
const startPoint = annotation.getStartPoint();
146+
const startX = startPoint.x;
147+
const startY = startPoint.y;
148+
149+
let maxX;
150+
let maxY;
151+
if (Math.abs(angleInDegrees) < 90) {
152+
maxX = documentWidth;
153+
} else {
154+
maxX = 0;
155+
}
156+
157+
if (angleInDegrees > 0) {
158+
maxY = documentHeight;
159+
} else {
160+
maxY = 0;
161+
}
162+
163+
const maxLenX = Math.abs((maxX - startX) / Math.cos(annotation.getAngle()));
164+
const maxLenY = Math.abs((maxY - startY) / Math.sin(annotation.getAngle()));
165+
166+
return Math.min(maxLenX, maxLenY);
167+
}, [annotation]);
168+
154169
const setLineAngle = (event) => {
155170
const angle = event.target.value;
156171
const angleInRadians = angle * (Math.PI / 180) * -1;
@@ -188,22 +203,6 @@ function LineMeasurementInput({ annotation, isOpen, selectedTool, canModify }) {
188203
}
189204
}, [annotation, ensureLineIsWithinBounds, isOpen]);
190205

191-
useEffect(() => {
192-
if (!annotation) {
193-
setAngle(computeAngle());
194-
return;
195-
}
196-
const onAnnotationChanged = () => {
197-
setLength((annotation.getLineLength() * factor).toFixed(2));
198-
setAngle(computeAngle());
199-
};
200-
core.addEventListener('mouseMove', onAnnotationChanged);
201-
202-
return () => {
203-
core.removeEventListener('mouseMove', onAnnotationChanged);
204-
};
205-
}, [annotation, computeAngle, factor, selectedTool]);
206-
207206
return (
208207
<>
209208
<div className="measurement__detail-item">

src/components/ModularComponents/EditorFileName/EditorFileName.stories.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import core from 'core';
55
import { userEvent, expect, within } from '@storybook/test';
66
import EditorFileName from './EditorFileName';
77
import { OEModularUIMockState } from 'src/helpers/storybookHelper';
8+
89
export default {
910
title: 'ModularComponents/EditorFileName',
1011
component: EditorFileName,
@@ -51,4 +52,4 @@ FileNameButton.play = async ({ canvasElement }) => {
5152
await userEvent.keyboard('{Escape}');
5253
const fileNameButtonAfterClick = await canvas.findByRole('button', { name: /newFileName.docx/i });
5354
expect(fileNameButtonAfterClick).toBeInTheDocument();
54-
};
55+
};

src/components/ModularComponents/Flyout/SpreadsheetFlyouts.stories.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,4 +108,4 @@ export const CellTextAlignmentFlyout = () => {
108108
<Flyout />
109109
</Provider>
110110
);
111-
};
111+
};

0 commit comments

Comments
 (0)