You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* refactor: image loading handlers
Some changes to clean up image loading code, and speed up subject image loading.
- lib-classifier: remove `useEffect` from `useSubjectImage`, so that image loading code runs on image load, rather than waiting for the next React render cycle.
- lib-react-components: when there's no delay for `useProgressiveImage`, run the `onLoad` handler immediately, rather than waiting for the next event cycle.
- refactor `onLoad` event handlers to use `load` events, rather than `Image` objects. This brings the event handlers in line with the DOM standard.
* add mock load events to classifier tests
* fix: add frameIndex to onSubjectReady callback
* add frame index to ImageAndText viewer
Copy file name to clipboardexpand all lines: packages/lib-classifier/src/components/Classifier/components/SubjectViewer/components/FlipbookViewer/FlipbookViewer.js
Copy file name to clipboardexpand all lines: packages/lib-classifier/src/components/Classifier/components/SubjectViewer/components/ImageAndTextViewer/ImageAndTextViewerContainer.js
+2
Original file line number
Diff line number
Diff line change
@@ -48,13 +48,15 @@ function ImageAndTextViewerContainer ({
Copy file name to clipboardexpand all lines: packages/lib-classifier/src/components/Classifier/components/SubjectViewer/components/MultiFrameViewer/MultiFrameViewerContainer.js
+1
Original file line number
Diff line number
Diff line change
@@ -77,6 +77,7 @@ function MultiFrameViewerContainer({
77
77
// TODO: replace this with a better function to parse the image location from a subject.
Copy file name to clipboardexpand all lines: packages/lib-classifier/src/components/Classifier/components/SubjectViewer/components/MultiFrameViewer/MultiFrameViewerContainer.spec.js
+5-1
Original file line number
Diff line number
Diff line change
@@ -26,7 +26,11 @@ describe('Component > MultiFrameViewerContainer', function () {
Copy file name to clipboardexpand all lines: packages/lib-classifier/src/components/Classifier/components/SubjectViewer/components/SeparateFramesViewer/components/SeparateFrame/SeparateFrame.js
Copy file name to clipboardexpand all lines: packages/lib-classifier/src/components/Classifier/components/SubjectViewer/components/SingleImageViewer/SingleImageViewerContainer.spec.js
+5-1
Original file line number
Diff line number
Diff line change
@@ -24,7 +24,11 @@ describe('Component > SingleImageViewerContainer', function () {
Copy file name to clipboardexpand all lines: packages/lib-classifier/src/components/Classifier/components/SubjectViewer/components/SingleTextViewer/SingleTextViewerContainer.js
+2
Original file line number
Diff line number
Diff line change
@@ -49,6 +49,7 @@ function DEFAULT_HANDLER() {
49
49
}
50
50
51
51
exportfunctionSingleTextViewerContainer({
52
+
frame =0,
52
53
height ='',
53
54
latest,
54
55
loadingState =asyncStates.initialized,
@@ -57,6 +58,7 @@ export function SingleTextViewerContainer ({
Copy file name to clipboardexpand all lines: packages/lib-react-components/CHANGELOG.md
+1
Original file line number
Diff line number
Diff line change
@@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
13
13
- PlainButton has text-decoration underline on hover even for links.
14
14
- ZooFooter links and labels updated to reflect newly launched FEM pages.
15
15
- Updated styling in ProjectCard's badge component.
16
+
-`useProgressiveImage`: run `onLoad` callbacks immediately when `delay` is 0. Add optional `onLoad` and `onError` event handlers for image `load` events.
0 commit comments