@harvard-lts/mirador-hide-nav-plugin 1.0.2 → 1.0.4

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.
Files changed (2) hide show
  1. package/dist/es/index.js +12 -6
  2. package/package.json +3 -3
package/dist/es/index.js CHANGED
@@ -80,11 +80,17 @@ var hideViewerNavigation = /*#__PURE__*/function (_Component) {
80
80
  }
81
81
  _inherits(hideViewerNavigation, _Component);
82
82
  return _createClass(hideViewerNavigation, [{
83
- key: "viewingHint",
84
- value: function viewingHint() {
83
+ key: "isIndividualImage",
84
+ value: function isIndividualImage() {
85
85
  var manifest = this.props.manifest;
86
- if (!(manifest && manifest.getSequences() && manifest.getSequences()[0] && manifest.getSequences()[0].getProperty('viewingHint'))) return [''];
87
- return manifest.getSequences()[0].getProperty('viewingHint');
86
+ var individualValue = 'individuals';
87
+
88
+ // IIIF v2
89
+ if (manifest && manifest.getSequences() && manifest.getSequences()[0] && manifest.getSequences()[0].getProperty('viewingHint')) return manifest.getSequences()[0].getProperty('viewingHint') == individualValue;
90
+
91
+ // IIIF v3
92
+ if (manifest && manifest.getBehavior()) return manifest.getBehavior() == individualValue;
93
+ return false;
88
94
  }
89
95
  }, {
90
96
  key: "render",
@@ -94,8 +100,8 @@ var hideViewerNavigation = /*#__PURE__*/function (_Component) {
94
100
  }, {
95
101
  key: "componentDidUpdate",
96
102
  value: function componentDidUpdate() {
97
- var viewingHint = this.viewingHint();
98
- if (viewingHint == 'individuals') {
103
+ var isIndividualImage = this.isIndividualImage();
104
+ if (isIndividualImage) {
99
105
  window.document.querySelectorAll('.mirador-osd-info').forEach(function (elem) {
100
106
  return elem.remove();
101
107
  });
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "keywords": [
6
6
  "react-component"
7
7
  ],
8
- "version": "1.0.2",
8
+ "version": "1.0.4",
9
9
  "description": "mirador-analytics-plugin React component",
10
10
  "module": "dist/es/index.js",
11
11
  "files": [
@@ -38,8 +38,8 @@
38
38
  "@testing-library/react": "^12.0.0",
39
39
  "babel-jest": "^29.7.0",
40
40
  "babel-loader": "^9.1.2",
41
- "jest": "^29.7.0",
42
- "jest-environment-jsdom": "^29.7.0",
41
+ "jest": "^30.0.2",
42
+ "jest-environment-jsdom": "^30.0.2",
43
43
  "mirador": "^3.4.3",
44
44
  "npm-run-all": "^4.1.5",
45
45
  "rollup": "^3.29.5",