react-iiif-vault 0.9.10 → 0.9.13
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/.build/types/canvas-panel/Viewer.d.ts +13 -0
- package/.build/types/canvas-panel/index.d.ts +18 -0
- package/.build/types/canvas-panel/render/Annotation.d.ts +8 -0
- package/.build/types/canvas-panel/render/AnnotationPage.d.ts +6 -0
- package/.build/types/canvas-panel/render/Audio.d.ts +6 -0
- package/.build/types/canvas-panel/render/Canvas.d.ts +23 -0
- package/.build/types/canvas-panel/render/DefaultCanvasFallback.d.ts +5 -0
- package/.build/types/canvas-panel/render/Image.d.ts +13 -0
- package/.build/types/canvas-panel/render/Model.d.ts +3 -0
- package/.build/types/canvas-panel/render/Video.d.ts +6 -0
- package/.build/types/context/AnnotationContext.d.ts +5 -0
- package/.build/types/context/CanvasContext.d.ts +5 -0
- package/.build/types/context/CollectionContext.d.ts +5 -0
- package/.build/types/context/ContextBridge.d.ts +22 -0
- package/.build/types/context/ImageServiceLoaderContext.d.ts +4 -0
- package/.build/types/context/ManifestContext.d.ts +5 -0
- package/.build/types/context/MediaContext.d.ts +17 -0
- package/.build/types/context/PortalContext.d.ts +7 -0
- package/.build/types/context/RangeContext.d.ts +5 -0
- package/.build/types/context/ResourceContext.d.ts +14 -0
- package/.build/types/context/VaultContext.d.ts +14 -0
- package/.build/types/context/ViewerPresetContext.d.ts +3 -0
- package/.build/types/context/VisibleCanvasContext.d.ts +4 -0
- package/.build/types/demo/demo.d.ts +1 -0
- package/.build/types/demo/media-controls.d.ts +1 -0
- package/.build/types/demo/viewer-controls.d.ts +1 -0
- package/.build/types/features/rendering-strategy/3d-strategy.d.ts +13 -0
- package/.build/types/features/rendering-strategy/audio-strategy.d.ts +3 -0
- package/.build/types/features/rendering-strategy/choice-types.d.ts +15 -0
- package/.build/types/features/rendering-strategy/image-strategy.d.ts +13 -0
- package/.build/types/features/rendering-strategy/rendering-utils.d.ts +21 -0
- package/.build/types/features/rendering-strategy/resource-types.d.ts +42 -0
- package/.build/types/features/rendering-strategy/strategies.d.ts +22 -0
- package/.build/types/features/rendering-strategy/video-strategy.d.ts +3 -0
- package/.build/types/hooks/useAnnotation.d.ts +8 -0
- package/.build/types/hooks/useAnnotationPageManager.d.ts +10 -0
- package/.build/types/hooks/useAnnotationsAtTime.d.ts +4 -0
- package/.build/types/hooks/useCanvas.d.ts +8 -0
- package/.build/types/hooks/useCanvasClock.d.ts +1 -0
- package/.build/types/hooks/useCanvasSelector.d.ts +0 -0
- package/.build/types/hooks/useCanvasTimeline.d.ts +0 -0
- package/.build/types/hooks/useCollection.d.ts +8 -0
- package/.build/types/hooks/useDispatch.d.ts +2 -0
- package/.build/types/hooks/useEnabledAnnotationPageIds.d.ts +1 -0
- package/.build/types/hooks/useEventListener.d.ts +4 -0
- package/.build/types/hooks/useExistingVault.d.ts +1 -0
- package/.build/types/hooks/useExternalCollection.d.ts +13 -0
- package/.build/types/hooks/useExternalManifest.d.ts +13 -0
- package/.build/types/hooks/useExternalResource.d.ts +16 -0
- package/.build/types/hooks/useImageService.d.ts +9 -0
- package/.build/types/hooks/useImageTile.d.ts +11 -0
- package/.build/types/hooks/useLoadImageService.d.ts +6 -0
- package/.build/types/hooks/useManifest.d.ts +8 -0
- package/.build/types/hooks/usePaintables.d.ts +8 -0
- package/.build/types/hooks/usePaintingAnnotations.d.ts +4 -0
- package/.build/types/hooks/useRange.d.ts +8 -0
- package/.build/types/hooks/useRenderingStrategy.d.ts +14 -0
- package/.build/types/hooks/useResourceEvents.d.ts +3 -0
- package/.build/types/hooks/useResources.d.ts +1 -0
- package/.build/types/hooks/useSearchService.d.ts +2 -0
- package/.build/types/hooks/useSimpleMediaPlayer.d.ts +32 -0
- package/.build/types/hooks/useStyleHelper.d.ts +1 -0
- package/.build/types/hooks/useStyles.d.ts +3 -0
- package/.build/types/hooks/useThumbnail.d.ts +5 -0
- package/.build/types/hooks/useVault.d.ts +2 -0
- package/.build/types/hooks/useVaultEffect.d.ts +2 -0
- package/.build/types/hooks/useVaultSelector.d.ts +2 -0
- package/.build/types/hooks/useVirtualAnnotationPage.d.ts +13 -0
- package/.build/types/hooks/useVirtualAnnotationPageContext.d.ts +9 -0
- package/.build/types/hooks/useVirtualCanvas.d.ts +0 -0
- package/.build/types/index.d.ts +54 -0
- package/.build/types/utility/flatten-annotation-page-ids.d.ts +7 -0
- package/.build/types/viewers/SimpleViewerContext.d.ts +18 -0
- package/.build/types/viewers/SingleCanvasContext.d.ts +1 -0
- package/dist/bundle/cjs/index.js +36 -0
- package/dist/bundle/cjs/index.js.map +1 -0
- package/dist/{esm → bundle/esm}/index.mjs +740 -791
- package/dist/bundle/esm/index.mjs.map +1 -0
- package/dist/canvas-panel/cjs/canvas-panel.js +36 -0
- package/dist/canvas-panel/cjs/canvas-panel.js.map +1 -0
- package/dist/canvas-panel/esm/canvas-panel.mjs +2043 -0
- package/dist/canvas-panel/esm/canvas-panel.mjs.map +1 -0
- package/dist/index.umd.js +121 -31742
- package/dist/index.umd.js.map +1 -0
- package/package.json +38 -28
- package/dist/cjs/index.js +0 -2536
- package/dist/index.d.ts +0 -615
|
@@ -1,218 +1,163 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
(
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
})(commonjsGlobal, (function (exports, React) {
|
|
17
|
-
function _interopNamespace(e) {
|
|
18
|
-
if (e && e.__esModule) return e;
|
|
19
|
-
var n = Object.create(null);
|
|
20
|
-
if (e) {
|
|
21
|
-
Object.keys(e).forEach(function (k) {
|
|
22
|
-
if (k !== 'default') {
|
|
23
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
24
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
25
|
-
enumerable: true,
|
|
26
|
-
get: function () { return e[k]; }
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
});
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
30
16
|
}
|
|
31
|
-
|
|
32
|
-
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
var __objRest = (source, exclude) => {
|
|
21
|
+
var target = {};
|
|
22
|
+
for (var prop in source)
|
|
23
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
24
|
+
target[prop] = source[prop];
|
|
25
|
+
if (source != null && __getOwnPropSymbols)
|
|
26
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
27
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
28
|
+
target[prop] = source[prop];
|
|
29
|
+
}
|
|
30
|
+
return target;
|
|
31
|
+
};
|
|
32
|
+
import * as React from "react";
|
|
33
|
+
import React__default, { useContext, useMemo, useState, useEffect, createContext, useCallback, useRef, useLayoutEffect, Fragment as Fragment$1, useReducer } from "react";
|
|
34
|
+
import { AtlasAuto, mergeStyles, RegionHighlight, TileSet } from "@atlas-viewer/atlas";
|
|
35
|
+
import { globalVault, Vault } from "@iiif/vault";
|
|
36
|
+
import { createAction } from "typesafe-actions";
|
|
37
|
+
import require$$0 from "react-dom";
|
|
38
|
+
import { ImageServiceLoader, getImageServices, getFixedSizeFromImage } from "@atlas-viewer/iiif-image-api";
|
|
39
|
+
function _setPrototypeOf(o, p2) {
|
|
40
|
+
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf2(o2, p3) {
|
|
41
|
+
o2.__proto__ = p3;
|
|
42
|
+
return o2;
|
|
43
|
+
};
|
|
44
|
+
return _setPrototypeOf(o, p2);
|
|
45
|
+
}
|
|
46
|
+
function _inheritsLoose(subClass, superClass) {
|
|
47
|
+
subClass.prototype = Object.create(superClass.prototype);
|
|
48
|
+
subClass.prototype.constructor = subClass;
|
|
49
|
+
_setPrototypeOf(subClass, superClass);
|
|
50
|
+
}
|
|
51
|
+
var changedArray = function changedArray2(a, b) {
|
|
52
|
+
if (a === void 0) {
|
|
53
|
+
a = [];
|
|
33
54
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
function _setPrototypeOf(o, p) {
|
|
38
|
-
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
|
|
39
|
-
o.__proto__ = p;
|
|
40
|
-
return o;
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
return _setPrototypeOf(o, p);
|
|
55
|
+
if (b === void 0) {
|
|
56
|
+
b = [];
|
|
44
57
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
58
|
+
return a.length !== b.length || a.some(function(item, index) {
|
|
59
|
+
return !Object.is(item, b[index]);
|
|
60
|
+
});
|
|
61
|
+
};
|
|
62
|
+
var initialState = {
|
|
63
|
+
error: null
|
|
64
|
+
};
|
|
65
|
+
var ErrorBoundary = /* @__PURE__ */ function(_React$Component) {
|
|
66
|
+
_inheritsLoose(ErrorBoundary2, _React$Component);
|
|
67
|
+
function ErrorBoundary2() {
|
|
68
|
+
var _this;
|
|
69
|
+
for (var _len = arguments.length, _args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
70
|
+
_args[_key] = arguments[_key];
|
|
71
|
+
}
|
|
72
|
+
_this = _React$Component.call.apply(_React$Component, [this].concat(_args)) || this;
|
|
73
|
+
_this.state = initialState;
|
|
74
|
+
_this.resetErrorBoundary = function() {
|
|
75
|
+
var _this$props;
|
|
76
|
+
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
77
|
+
args[_key2] = arguments[_key2];
|
|
78
|
+
}
|
|
79
|
+
_this.props.onReset == null ? void 0 : (_this$props = _this.props).onReset.apply(_this$props, args);
|
|
80
|
+
_this.reset();
|
|
81
|
+
};
|
|
82
|
+
return _this;
|
|
50
83
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
if (b === void 0) {
|
|
58
|
-
b = [];
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
return a.length !== b.length || a.some(function (item, index) {
|
|
62
|
-
return !Object.is(item, b[index]);
|
|
63
|
-
});
|
|
84
|
+
ErrorBoundary2.getDerivedStateFromError = function getDerivedStateFromError(error) {
|
|
85
|
+
return {
|
|
86
|
+
error
|
|
87
|
+
};
|
|
64
88
|
};
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
89
|
+
var _proto = ErrorBoundary2.prototype;
|
|
90
|
+
_proto.reset = function reset() {
|
|
91
|
+
this.setState(initialState);
|
|
68
92
|
};
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
_this = _React$Component.call.apply(_React$Component, [this].concat(_args)) || this;
|
|
81
|
-
_this.state = initialState;
|
|
82
|
-
|
|
83
|
-
_this.resetErrorBoundary = function () {
|
|
84
|
-
var _this$props;
|
|
85
|
-
|
|
86
|
-
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
87
|
-
args[_key2] = arguments[_key2];
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
_this.props.onReset == null ? void 0 : (_this$props = _this.props).onReset.apply(_this$props, args);
|
|
91
|
-
|
|
92
|
-
_this.reset();
|
|
93
|
-
};
|
|
94
|
-
|
|
95
|
-
return _this;
|
|
93
|
+
_proto.componentDidCatch = function componentDidCatch(error, info) {
|
|
94
|
+
var _this$props$onError, _this$props2;
|
|
95
|
+
(_this$props$onError = (_this$props2 = this.props).onError) == null ? void 0 : _this$props$onError.call(_this$props2, error, info);
|
|
96
|
+
};
|
|
97
|
+
_proto.componentDidUpdate = function componentDidUpdate(prevProps, prevState) {
|
|
98
|
+
var error = this.state.error;
|
|
99
|
+
var resetKeys = this.props.resetKeys;
|
|
100
|
+
if (error !== null && prevState.error !== null && changedArray(prevProps.resetKeys, resetKeys)) {
|
|
101
|
+
var _this$props$onResetKe, _this$props3;
|
|
102
|
+
(_this$props$onResetKe = (_this$props3 = this.props).onResetKeysChange) == null ? void 0 : _this$props$onResetKe.call(_this$props3, prevProps.resetKeys, resetKeys);
|
|
103
|
+
this.reset();
|
|
96
104
|
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
105
|
+
};
|
|
106
|
+
_proto.render = function render() {
|
|
107
|
+
var error = this.state.error;
|
|
108
|
+
var _this$props4 = this.props, fallbackRender = _this$props4.fallbackRender, FallbackComponent = _this$props4.FallbackComponent, fallback = _this$props4.fallback;
|
|
109
|
+
if (error !== null) {
|
|
110
|
+
var _props = {
|
|
111
|
+
error,
|
|
112
|
+
resetErrorBoundary: this.resetErrorBoundary
|
|
101
113
|
};
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
_proto.componentDidCatch = function componentDidCatch(error, info) {
|
|
111
|
-
var _this$props$onError, _this$props2;
|
|
112
|
-
|
|
113
|
-
(_this$props$onError = (_this$props2 = this.props).onError) == null ? void 0 : _this$props$onError.call(_this$props2, error, info);
|
|
114
|
-
};
|
|
115
|
-
|
|
116
|
-
_proto.componentDidUpdate = function componentDidUpdate(prevProps, prevState) {
|
|
117
|
-
var error = this.state.error;
|
|
118
|
-
var resetKeys = this.props.resetKeys; // There's an edge case where if the thing that triggered the error
|
|
119
|
-
// happens to *also* be in the resetKeys array, we'd end up resetting
|
|
120
|
-
// the error boundary immediately. This would likely trigger a second
|
|
121
|
-
// error to be thrown.
|
|
122
|
-
// So we make sure that we don't check the resetKeys on the first call
|
|
123
|
-
// of cDU after the error is set
|
|
124
|
-
|
|
125
|
-
if (error !== null && prevState.error !== null && changedArray(prevProps.resetKeys, resetKeys)) {
|
|
126
|
-
var _this$props$onResetKe, _this$props3;
|
|
127
|
-
|
|
128
|
-
(_this$props$onResetKe = (_this$props3 = this.props).onResetKeysChange) == null ? void 0 : _this$props$onResetKe.call(_this$props3, prevProps.resetKeys, resetKeys);
|
|
129
|
-
this.reset();
|
|
130
|
-
}
|
|
131
|
-
};
|
|
132
|
-
|
|
133
|
-
_proto.render = function render() {
|
|
134
|
-
var error = this.state.error;
|
|
135
|
-
var _this$props4 = this.props,
|
|
136
|
-
fallbackRender = _this$props4.fallbackRender,
|
|
137
|
-
FallbackComponent = _this$props4.FallbackComponent,
|
|
138
|
-
fallback = _this$props4.fallback;
|
|
139
|
-
|
|
140
|
-
if (error !== null) {
|
|
141
|
-
var _props = {
|
|
142
|
-
error: error,
|
|
143
|
-
resetErrorBoundary: this.resetErrorBoundary
|
|
144
|
-
};
|
|
145
|
-
|
|
146
|
-
if ( /*#__PURE__*/React__namespace.isValidElement(fallback)) {
|
|
147
|
-
return fallback;
|
|
148
|
-
} else if (typeof fallbackRender === 'function') {
|
|
149
|
-
return fallbackRender(_props);
|
|
150
|
-
} else if (FallbackComponent) {
|
|
151
|
-
return /*#__PURE__*/React__namespace.createElement(FallbackComponent, _props);
|
|
152
|
-
} else {
|
|
153
|
-
throw new Error('react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop');
|
|
154
|
-
}
|
|
114
|
+
if (/* @__PURE__ */ React.isValidElement(fallback)) {
|
|
115
|
+
return fallback;
|
|
116
|
+
} else if (typeof fallbackRender === "function") {
|
|
117
|
+
return fallbackRender(_props);
|
|
118
|
+
} else if (FallbackComponent) {
|
|
119
|
+
return /* @__PURE__ */ React.createElement(FallbackComponent, _props);
|
|
120
|
+
} else {
|
|
121
|
+
throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop");
|
|
155
122
|
}
|
|
156
|
-
|
|
157
|
-
return this.props.children;
|
|
158
|
-
};
|
|
159
|
-
|
|
160
|
-
return ErrorBoundary;
|
|
161
|
-
}(React__namespace.Component);
|
|
162
|
-
|
|
163
|
-
function withErrorBoundary(Component, errorBoundaryProps) {
|
|
164
|
-
var Wrapped = function Wrapped(props) {
|
|
165
|
-
return /*#__PURE__*/React__namespace.createElement(ErrorBoundary, errorBoundaryProps, /*#__PURE__*/React__namespace.createElement(Component, props));
|
|
166
|
-
}; // Format for display in DevTools
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
var name = Component.displayName || Component.name || 'Unknown';
|
|
170
|
-
Wrapped.displayName = "withErrorBoundary(" + name + ")";
|
|
171
|
-
return Wrapped;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
function useErrorHandler(givenError) {
|
|
175
|
-
var _React$useState = React__namespace.useState(null),
|
|
176
|
-
error = _React$useState[0],
|
|
177
|
-
setError = _React$useState[1];
|
|
178
|
-
|
|
179
|
-
if (givenError != null) throw givenError;
|
|
180
|
-
if (error != null) throw error;
|
|
181
|
-
return setError;
|
|
182
|
-
}
|
|
183
|
-
/*
|
|
184
|
-
eslint
|
|
185
|
-
@typescript-eslint/sort-type-union-intersection-members: "off",
|
|
186
|
-
@typescript-eslint/no-throw-literal: "off",
|
|
187
|
-
@typescript-eslint/prefer-nullish-coalescing: "off"
|
|
188
|
-
*/
|
|
189
|
-
|
|
190
|
-
exports.ErrorBoundary = ErrorBoundary;
|
|
191
|
-
exports.useErrorHandler = useErrorHandler;
|
|
192
|
-
exports.withErrorBoundary = withErrorBoundary;
|
|
193
|
-
|
|
194
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
195
|
-
|
|
196
|
-
}));
|
|
197
|
-
|
|
198
|
-
}(reactErrorBoundary_umd, reactErrorBoundary_umd.exports));
|
|
199
|
-
|
|
200
|
-
var __defProp$a = Object.defineProperty;
|
|
201
|
-
var __getOwnPropSymbols$a = Object.getOwnPropertySymbols;
|
|
202
|
-
var __hasOwnProp$a = Object.prototype.hasOwnProperty;
|
|
203
|
-
var __propIsEnum$a = Object.prototype.propertyIsEnumerable;
|
|
204
|
-
var __defNormalProp$a = (obj, key, value) => key in obj ? __defProp$a(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
205
|
-
var __spreadValues$a = (a, b) => {
|
|
206
|
-
for (var prop in b || (b = {}))
|
|
207
|
-
if (__hasOwnProp$a.call(b, prop))
|
|
208
|
-
__defNormalProp$a(a, prop, b[prop]);
|
|
209
|
-
if (__getOwnPropSymbols$a)
|
|
210
|
-
for (var prop of __getOwnPropSymbols$a(b)) {
|
|
211
|
-
if (__propIsEnum$a.call(b, prop))
|
|
212
|
-
__defNormalProp$a(a, prop, b[prop]);
|
|
213
123
|
}
|
|
214
|
-
|
|
215
|
-
};
|
|
124
|
+
return this.props.children;
|
|
125
|
+
};
|
|
126
|
+
return ErrorBoundary2;
|
|
127
|
+
}(React.Component);
|
|
128
|
+
var jsxRuntime = { exports: {} };
|
|
129
|
+
var reactJsxRuntime_production_min = {};
|
|
130
|
+
/**
|
|
131
|
+
* @license React
|
|
132
|
+
* react-jsx-runtime.production.min.js
|
|
133
|
+
*
|
|
134
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
135
|
+
*
|
|
136
|
+
* This source code is licensed under the MIT license found in the
|
|
137
|
+
* LICENSE file in the root directory of this source tree.
|
|
138
|
+
*/
|
|
139
|
+
var f = React__default, k = Symbol.for("react.element"), l = Symbol.for("react.fragment"), m$1 = Object.prototype.hasOwnProperty, n = f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, p = { key: true, ref: true, __self: true, __source: true };
|
|
140
|
+
function q(c, a, g) {
|
|
141
|
+
var b, d = {}, e = null, h = null;
|
|
142
|
+
g !== void 0 && (e = "" + g);
|
|
143
|
+
a.key !== void 0 && (e = "" + a.key);
|
|
144
|
+
a.ref !== void 0 && (h = a.ref);
|
|
145
|
+
for (b in a)
|
|
146
|
+
m$1.call(a, b) && !p.hasOwnProperty(b) && (d[b] = a[b]);
|
|
147
|
+
if (c && c.defaultProps)
|
|
148
|
+
for (b in a = c.defaultProps, a)
|
|
149
|
+
d[b] === void 0 && (d[b] = a[b]);
|
|
150
|
+
return { $$typeof: k, type: c, key: e, ref: h, props: d, _owner: n.current };
|
|
151
|
+
}
|
|
152
|
+
reactJsxRuntime_production_min.Fragment = l;
|
|
153
|
+
reactJsxRuntime_production_min.jsx = q;
|
|
154
|
+
reactJsxRuntime_production_min.jsxs = q;
|
|
155
|
+
{
|
|
156
|
+
jsxRuntime.exports = reactJsxRuntime_production_min;
|
|
157
|
+
}
|
|
158
|
+
const jsx = jsxRuntime.exports.jsx;
|
|
159
|
+
const jsxs = jsxRuntime.exports.jsxs;
|
|
160
|
+
const Fragment = jsxRuntime.exports.Fragment;
|
|
216
161
|
const defaultResourceContext = {
|
|
217
162
|
collection: void 0,
|
|
218
163
|
manifest: void 0,
|
|
@@ -220,21 +165,24 @@ const defaultResourceContext = {
|
|
|
220
165
|
canvas: void 0,
|
|
221
166
|
annotation: void 0
|
|
222
167
|
};
|
|
223
|
-
const ResourceReactContext =
|
|
168
|
+
const ResourceReactContext = React__default.createContext(defaultResourceContext);
|
|
224
169
|
const useResourceContext = () => {
|
|
225
170
|
return useContext(ResourceReactContext);
|
|
226
171
|
};
|
|
227
|
-
function ResourceProvider({
|
|
172
|
+
function ResourceProvider({
|
|
173
|
+
value,
|
|
174
|
+
children
|
|
175
|
+
}) {
|
|
228
176
|
const parentContext = useResourceContext();
|
|
229
177
|
const newContext = useMemo(() => {
|
|
230
|
-
return __spreadValues
|
|
178
|
+
return __spreadValues(__spreadValues({}, parentContext), value);
|
|
231
179
|
}, [value, parentContext]);
|
|
232
|
-
return /* @__PURE__ */
|
|
233
|
-
value: newContext
|
|
234
|
-
|
|
180
|
+
return /* @__PURE__ */ jsx(ResourceReactContext.Provider, {
|
|
181
|
+
value: newContext,
|
|
182
|
+
children
|
|
183
|
+
});
|
|
235
184
|
}
|
|
236
|
-
|
|
237
|
-
const ReactVaultContext = React$1.createContext({
|
|
185
|
+
const ReactVaultContext = React__default.createContext({
|
|
238
186
|
vault: null,
|
|
239
187
|
setVaultInstance: (vault) => {
|
|
240
188
|
}
|
|
@@ -258,13 +206,17 @@ function VaultProvider({
|
|
|
258
206
|
}
|
|
259
207
|
return new Vault();
|
|
260
208
|
});
|
|
261
|
-
return /* @__PURE__ */
|
|
262
|
-
value: {
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
209
|
+
return /* @__PURE__ */ jsx(ReactVaultContext.Provider, {
|
|
210
|
+
value: {
|
|
211
|
+
vault: vaultInstance,
|
|
212
|
+
setVaultInstance
|
|
213
|
+
},
|
|
214
|
+
children: /* @__PURE__ */ jsx(ResourceProvider, {
|
|
215
|
+
value: resources || {},
|
|
216
|
+
children
|
|
217
|
+
})
|
|
218
|
+
});
|
|
266
219
|
}
|
|
267
|
-
|
|
268
220
|
const useVault = () => {
|
|
269
221
|
const { vault } = useContext(ReactVaultContext);
|
|
270
222
|
if (vault === null) {
|
|
@@ -272,27 +224,6 @@ const useVault = () => {
|
|
|
272
224
|
}
|
|
273
225
|
return vault;
|
|
274
226
|
};
|
|
275
|
-
|
|
276
|
-
var __async$1 = (__this, __arguments, generator) => {
|
|
277
|
-
return new Promise((resolve, reject) => {
|
|
278
|
-
var fulfilled = (value) => {
|
|
279
|
-
try {
|
|
280
|
-
step(generator.next(value));
|
|
281
|
-
} catch (e) {
|
|
282
|
-
reject(e);
|
|
283
|
-
}
|
|
284
|
-
};
|
|
285
|
-
var rejected = (value) => {
|
|
286
|
-
try {
|
|
287
|
-
step(generator.throw(value));
|
|
288
|
-
} catch (e) {
|
|
289
|
-
reject(e);
|
|
290
|
-
}
|
|
291
|
-
};
|
|
292
|
-
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
293
|
-
step((generator = generator.apply(__this, __arguments)).next());
|
|
294
|
-
});
|
|
295
|
-
};
|
|
296
227
|
function useExternalResource(idOrRef, { noCache = false } = {}) {
|
|
297
228
|
const id = typeof idOrRef === "string" ? idOrRef : idOrRef.id;
|
|
298
229
|
const vault = useVault();
|
|
@@ -303,9 +234,9 @@ function useExternalResource(idOrRef, { noCache = false } = {}) {
|
|
|
303
234
|
}, [id, vault]);
|
|
304
235
|
const [resource, setResource] = useState(initialData);
|
|
305
236
|
useEffect(() => {
|
|
306
|
-
(() =>
|
|
237
|
+
(async () => {
|
|
307
238
|
try {
|
|
308
|
-
const fetchedResource = initialData && !noCache ? initialData :
|
|
239
|
+
const fetchedResource = initialData && !noCache ? initialData : await vault.load(id);
|
|
309
240
|
const _realId = fetchedResource ? fetchedResource.id || fetchedResource["@id"] : null;
|
|
310
241
|
if (fetchedResource && realId !== _realId) {
|
|
311
242
|
setRealId(_realId);
|
|
@@ -314,7 +245,7 @@ function useExternalResource(idOrRef, { noCache = false } = {}) {
|
|
|
314
245
|
} catch (err) {
|
|
315
246
|
setError(err);
|
|
316
247
|
}
|
|
317
|
-
})
|
|
248
|
+
})();
|
|
318
249
|
}, [id, noCache]);
|
|
319
250
|
return {
|
|
320
251
|
isLoaded: !!resource,
|
|
@@ -325,24 +256,32 @@ function useExternalResource(idOrRef, { noCache = false } = {}) {
|
|
|
325
256
|
cached: !!(resource && resource === initialData)
|
|
326
257
|
};
|
|
327
258
|
}
|
|
328
|
-
|
|
329
259
|
function useExternalManifest(idOrRef, options) {
|
|
330
260
|
const { id, isLoaded, error, resource, requestId, cached } = useExternalResource(idOrRef, options);
|
|
331
261
|
return { id, isLoaded, error, manifest: resource, requestId, cached };
|
|
332
262
|
}
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
263
|
+
function ManifestContext({
|
|
264
|
+
manifest,
|
|
265
|
+
children
|
|
266
|
+
}) {
|
|
267
|
+
return /* @__PURE__ */ jsx(ResourceProvider, {
|
|
268
|
+
value: {
|
|
269
|
+
manifest
|
|
270
|
+
},
|
|
271
|
+
children
|
|
272
|
+
});
|
|
338
273
|
}
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
274
|
+
function CanvasContext({
|
|
275
|
+
canvas,
|
|
276
|
+
children
|
|
277
|
+
}) {
|
|
278
|
+
return /* @__PURE__ */ jsx(ResourceProvider, {
|
|
279
|
+
value: {
|
|
280
|
+
canvas
|
|
281
|
+
},
|
|
282
|
+
children
|
|
283
|
+
});
|
|
344
284
|
}
|
|
345
|
-
|
|
346
285
|
function useVaultSelector(selector, deps = []) {
|
|
347
286
|
const vault = useVault();
|
|
348
287
|
const [selectedState, setSelectedState] = useState(() => selector(vault.getState(), vault));
|
|
@@ -353,15 +292,13 @@ function useVaultSelector(selector, deps = []) {
|
|
|
353
292
|
}, deps);
|
|
354
293
|
return selectedState;
|
|
355
294
|
}
|
|
356
|
-
|
|
357
|
-
const VisibleCanvasReactContext = React$1.createContext([]);
|
|
295
|
+
const VisibleCanvasReactContext = React__default.createContext([]);
|
|
358
296
|
function useVisibleCanvases() {
|
|
359
297
|
const ids = useContext(VisibleCanvasReactContext);
|
|
360
298
|
return useVaultSelector((state) => {
|
|
361
299
|
return ids.map((id) => state.iiif.entities.Canvas[id]).filter(Boolean);
|
|
362
300
|
}, [ids]);
|
|
363
301
|
}
|
|
364
|
-
|
|
365
302
|
const noop = () => {
|
|
366
303
|
};
|
|
367
304
|
const SimpleViewerReactContext = createContext({
|
|
@@ -456,25 +393,32 @@ function SimpleViewerProvider(props) {
|
|
|
456
393
|
}), [nextCanvas, previousCanvas, currentCanvasIndex, canvasList, setCurrentCanvasIndex, internalSetCurrentCanvasId]);
|
|
457
394
|
if (!manifest.manifest) {
|
|
458
395
|
console.warn("The manifest passed to the provider is not a valid IIIF manifest.");
|
|
459
|
-
return /* @__PURE__ */
|
|
396
|
+
return /* @__PURE__ */ jsx("div", {
|
|
397
|
+
children: "Sorry, something went wrong."
|
|
398
|
+
});
|
|
460
399
|
}
|
|
461
400
|
if (!manifest.isLoaded) {
|
|
462
|
-
return /* @__PURE__ */
|
|
401
|
+
return /* @__PURE__ */ jsx("div", {
|
|
402
|
+
children: "Loading..."
|
|
403
|
+
});
|
|
463
404
|
}
|
|
464
|
-
return /* @__PURE__ */
|
|
465
|
-
value: ctx
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
405
|
+
return /* @__PURE__ */ jsx(SimpleViewerReactContext.Provider, {
|
|
406
|
+
value: ctx,
|
|
407
|
+
children: /* @__PURE__ */ jsx(VisibleCanvasReactContext.Provider, {
|
|
408
|
+
value: visible,
|
|
409
|
+
children: /* @__PURE__ */ jsx(ManifestContext, {
|
|
410
|
+
manifest: manifest.manifest.id,
|
|
411
|
+
children: /* @__PURE__ */ jsx(CanvasContext, {
|
|
412
|
+
canvas: currentCanvasId,
|
|
413
|
+
children: props.children
|
|
414
|
+
})
|
|
415
|
+
})
|
|
416
|
+
})
|
|
417
|
+
});
|
|
473
418
|
}
|
|
474
419
|
function useSimpleViewer() {
|
|
475
420
|
return useContext(SimpleViewerReactContext);
|
|
476
421
|
}
|
|
477
|
-
|
|
478
422
|
function useContextBridge() {
|
|
479
423
|
return {
|
|
480
424
|
VaultContext: useContext(ReactVaultContext),
|
|
@@ -484,16 +428,18 @@ function useContextBridge() {
|
|
|
484
428
|
};
|
|
485
429
|
}
|
|
486
430
|
function ContextBridge(props) {
|
|
487
|
-
return /* @__PURE__ */
|
|
431
|
+
return /* @__PURE__ */ jsx(VaultProvider, {
|
|
488
432
|
vault: props.bridge.VaultContext.vault || void 0,
|
|
489
|
-
resources: props.bridge.ResourceContext
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
}
|
|
496
|
-
|
|
433
|
+
resources: props.bridge.ResourceContext,
|
|
434
|
+
children: /* @__PURE__ */ jsx(VisibleCanvasReactContext.Provider, {
|
|
435
|
+
value: props.bridge.VisibleCanvasReactContext,
|
|
436
|
+
children: /* @__PURE__ */ jsx(SimpleViewerReactContext.Provider, {
|
|
437
|
+
value: props.bridge.SimpleViewerReactContext,
|
|
438
|
+
children: props.children
|
|
439
|
+
})
|
|
440
|
+
})
|
|
441
|
+
});
|
|
442
|
+
}
|
|
497
443
|
const IMPORT_ENTITIES = "@iiif/IMPORT_ENTITIES";
|
|
498
444
|
const MODIFY_ENTITY_FIELD = "@iiif/MODIFY_ENTITY_FIELD";
|
|
499
445
|
const REORDER_ENTITY_FIELD = "@iiif/REORDER_ENTITY_FIELD";
|
|
@@ -505,12 +451,10 @@ const reorderEntityField = createAction(REORDER_ENTITY_FIELD)();
|
|
|
505
451
|
const addReference = createAction(ADD_REFERENCE)();
|
|
506
452
|
const removeReference = createAction(REMOVE_REFERENCE)();
|
|
507
453
|
const entityActions = { importEntities, modifyEntityField, reorderEntityField, addReference, removeReference };
|
|
508
|
-
|
|
509
454
|
const ADD_MAPPING = "@iiif/ADD_MAPPING";
|
|
510
455
|
const ADD_MAPPINGS = "@iiif/ADD_MAPPINGS";
|
|
511
456
|
createAction(ADD_MAPPING)();
|
|
512
457
|
createAction(ADD_MAPPINGS)();
|
|
513
|
-
|
|
514
458
|
const SET_META_VALUE = "@iiif/SET_META_VALUE";
|
|
515
459
|
const SET_META_VALUE_DYNAMIC = "@iiif/SET_META_VALUE_DYNAMIC";
|
|
516
460
|
const UNSET_META_VALUE = "@iiif/UNSET_META_VALUE";
|
|
@@ -527,12 +471,10 @@ createAction(REQUEST_ERROR)();
|
|
|
527
471
|
createAction(REQUEST_MISMATCH)();
|
|
528
472
|
createAction(REQUEST_COMPLETE)();
|
|
529
473
|
createAction(REQUEST_OFFLINE_RESOURCE)();
|
|
530
|
-
|
|
531
474
|
const BATCH_ACTIONS = "@iiif/BATCH";
|
|
532
475
|
const BATCH_IMPORT = "@iiif/BATCH_IMPORT";
|
|
533
476
|
createAction(BATCH_ACTIONS)();
|
|
534
477
|
createAction(BATCH_IMPORT)();
|
|
535
|
-
|
|
536
478
|
function useDispatch() {
|
|
537
479
|
const vault = useVault();
|
|
538
480
|
const store = vault.getStore();
|
|
@@ -540,7 +482,6 @@ function useDispatch() {
|
|
|
540
482
|
return (action) => store.dispatch(action);
|
|
541
483
|
}, [store]);
|
|
542
484
|
}
|
|
543
|
-
|
|
544
485
|
function isVaultActivated(obj) {
|
|
545
486
|
return typeof obj !== "string" && obj && obj.bindToVault;
|
|
546
487
|
}
|
|
@@ -642,73 +583,61 @@ function useVirtualAnnotationPage() {
|
|
|
642
583
|
}
|
|
643
584
|
];
|
|
644
585
|
}
|
|
645
|
-
|
|
646
586
|
const VirtualAnnotationPageContext = createContext(null);
|
|
647
587
|
function useVirtualAnnotationPageContext() {
|
|
648
588
|
const ctx = useContext(VirtualAnnotationPageContext);
|
|
649
|
-
return [
|
|
650
|
-
ctx.
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
removeAnnotation: ctx.removeAnnotation
|
|
654
|
-
}
|
|
655
|
-
];
|
|
589
|
+
return [ctx.fullPage, {
|
|
590
|
+
addAnnotation: ctx.addAnnotation,
|
|
591
|
+
removeAnnotation: ctx.removeAnnotation
|
|
592
|
+
}];
|
|
656
593
|
}
|
|
657
|
-
function VirtualAnnotationProvider({
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
594
|
+
function VirtualAnnotationProvider({
|
|
595
|
+
children
|
|
596
|
+
}) {
|
|
597
|
+
const [fullPage, {
|
|
598
|
+
addAnnotation,
|
|
599
|
+
removeAnnotation
|
|
600
|
+
}] = useVirtualAnnotationPage();
|
|
601
|
+
return /* @__PURE__ */ jsx(VirtualAnnotationPageContext.Provider, {
|
|
602
|
+
value: useMemo(() => ({
|
|
603
|
+
fullPage,
|
|
604
|
+
addAnnotation,
|
|
605
|
+
removeAnnotation
|
|
606
|
+
}), [fullPage]),
|
|
607
|
+
children
|
|
608
|
+
});
|
|
609
|
+
}
|
|
610
|
+
function DefaultCanvasFallback({
|
|
611
|
+
width,
|
|
612
|
+
style,
|
|
613
|
+
height
|
|
614
|
+
}) {
|
|
615
|
+
return /* @__PURE__ */ jsx("div", {
|
|
616
|
+
style: __spreadProps(__spreadValues({
|
|
617
|
+
width,
|
|
618
|
+
height,
|
|
619
|
+
minHeight: 500
|
|
620
|
+
}, style || {}), {
|
|
621
|
+
background: "#f9f9f9"
|
|
622
|
+
}),
|
|
623
|
+
children: "Unknown error"
|
|
624
|
+
});
|
|
687
625
|
}
|
|
688
|
-
|
|
689
626
|
var createRoot;
|
|
690
|
-
|
|
691
627
|
var m = require$$0;
|
|
692
628
|
{
|
|
693
|
-
|
|
694
|
-
createRoot = function(c, o) {
|
|
695
|
-
i.usingClientEntryPoint = true;
|
|
696
|
-
try {
|
|
697
|
-
return m.createRoot(c, o);
|
|
698
|
-
} finally {
|
|
699
|
-
i.usingClientEntryPoint = false;
|
|
700
|
-
}
|
|
701
|
-
};
|
|
629
|
+
createRoot = m.createRoot;
|
|
702
630
|
}
|
|
703
|
-
|
|
704
631
|
const ViewerPresetContext = createContext(null);
|
|
705
632
|
function useViewerPreset() {
|
|
706
633
|
return useContext(ViewerPresetContext);
|
|
707
634
|
}
|
|
708
|
-
|
|
709
|
-
const
|
|
710
|
-
|
|
711
|
-
|
|
635
|
+
const PortalContext = React__default.createContext(null);
|
|
636
|
+
const OverlayPortalContext = React__default.createContext(null);
|
|
637
|
+
function CanvasPortal({
|
|
638
|
+
children,
|
|
639
|
+
overlay
|
|
640
|
+
}) {
|
|
712
641
|
const htmlElement = useContext(overlay ? OverlayPortalContext : PortalContext);
|
|
713
642
|
const rootRef = useRef(null);
|
|
714
643
|
const preset = useViewerPreset();
|
|
@@ -726,45 +655,14 @@ function CanvasPortal({ children, overlay }) {
|
|
|
726
655
|
}, []);
|
|
727
656
|
useLayoutEffect(() => {
|
|
728
657
|
if (rootRef.current) {
|
|
729
|
-
rootRef.current.render(/* @__PURE__ */
|
|
730
|
-
value: preset
|
|
731
|
-
|
|
658
|
+
rootRef.current.render(/* @__PURE__ */ jsx(ViewerPresetContext.Provider, {
|
|
659
|
+
value: preset,
|
|
660
|
+
children
|
|
661
|
+
}));
|
|
732
662
|
}
|
|
733
663
|
}, [children, preset]);
|
|
734
664
|
return null;
|
|
735
665
|
}
|
|
736
|
-
|
|
737
|
-
var __defProp$8 = Object.defineProperty;
|
|
738
|
-
var __defProps$6 = Object.defineProperties;
|
|
739
|
-
var __getOwnPropDescs$6 = Object.getOwnPropertyDescriptors;
|
|
740
|
-
var __getOwnPropSymbols$8 = Object.getOwnPropertySymbols;
|
|
741
|
-
var __hasOwnProp$8 = Object.prototype.hasOwnProperty;
|
|
742
|
-
var __propIsEnum$8 = Object.prototype.propertyIsEnumerable;
|
|
743
|
-
var __defNormalProp$8 = (obj, key, value) => key in obj ? __defProp$8(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
744
|
-
var __spreadValues$8 = (a, b) => {
|
|
745
|
-
for (var prop in b || (b = {}))
|
|
746
|
-
if (__hasOwnProp$8.call(b, prop))
|
|
747
|
-
__defNormalProp$8(a, prop, b[prop]);
|
|
748
|
-
if (__getOwnPropSymbols$8)
|
|
749
|
-
for (var prop of __getOwnPropSymbols$8(b)) {
|
|
750
|
-
if (__propIsEnum$8.call(b, prop))
|
|
751
|
-
__defNormalProp$8(a, prop, b[prop]);
|
|
752
|
-
}
|
|
753
|
-
return a;
|
|
754
|
-
};
|
|
755
|
-
var __spreadProps$6 = (a, b) => __defProps$6(a, __getOwnPropDescs$6(b));
|
|
756
|
-
var __objRest = (source, exclude) => {
|
|
757
|
-
var target = {};
|
|
758
|
-
for (var prop in source)
|
|
759
|
-
if (__hasOwnProp$8.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
760
|
-
target[prop] = source[prop];
|
|
761
|
-
if (source != null && __getOwnPropSymbols$8)
|
|
762
|
-
for (var prop of __getOwnPropSymbols$8(source)) {
|
|
763
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$8.call(source, prop))
|
|
764
|
-
target[prop] = source[prop];
|
|
765
|
-
}
|
|
766
|
-
return target;
|
|
767
|
-
};
|
|
768
666
|
function Viewer(_a) {
|
|
769
667
|
var _b = _a, {
|
|
770
668
|
children,
|
|
@@ -786,32 +684,91 @@ function Viewer(_a) {
|
|
|
786
684
|
setPortalElement(portal.current);
|
|
787
685
|
setOverlayPortalElement(overlayPortal.current);
|
|
788
686
|
}, []);
|
|
789
|
-
return /* @__PURE__ */
|
|
790
|
-
fallbackRender: () => /* @__PURE__ */
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
687
|
+
return /* @__PURE__ */ jsxs(ErrorBoundary, {
|
|
688
|
+
fallbackRender: () => /* @__PURE__ */ jsx(ErrorFallback, __spreadValues({}, props)),
|
|
689
|
+
children: [/* @__PURE__ */ jsx(AtlasAuto, __spreadProps(__spreadValues({}, props), {
|
|
690
|
+
containerProps: __spreadValues({
|
|
691
|
+
style: {
|
|
692
|
+
position: "relative"
|
|
693
|
+
}
|
|
694
|
+
}, props.containerProps || {}),
|
|
695
|
+
htmlChildren: /* @__PURE__ */ jsx("div", {
|
|
696
|
+
ref: overlayPortal
|
|
697
|
+
}),
|
|
698
|
+
onCreated: (preset) => {
|
|
699
|
+
setViewerPreset(preset);
|
|
700
|
+
if (props.onCreated) {
|
|
701
|
+
props.onCreated(preset);
|
|
702
|
+
}
|
|
703
|
+
},
|
|
704
|
+
children: /* @__PURE__ */ jsx(ViewerPresetContext.Provider, {
|
|
705
|
+
value: viewerPreset,
|
|
706
|
+
children: /* @__PURE__ */ jsx(PortalContext.Provider, {
|
|
707
|
+
value: portalElement,
|
|
708
|
+
children: /* @__PURE__ */ jsx(OverlayPortalContext.Provider, {
|
|
709
|
+
value: overlayPortalElement,
|
|
710
|
+
children: /* @__PURE__ */ jsx(ContextBridge, {
|
|
711
|
+
bridge,
|
|
712
|
+
children: /* @__PURE__ */ jsx(VirtualAnnotationProvider, {
|
|
713
|
+
children
|
|
714
|
+
})
|
|
715
|
+
})
|
|
716
|
+
})
|
|
717
|
+
})
|
|
718
|
+
})
|
|
719
|
+
})), /* @__PURE__ */ jsx("div", {
|
|
720
|
+
ref: portal
|
|
721
|
+
})]
|
|
722
|
+
});
|
|
723
|
+
}
|
|
724
|
+
function createEventsHelper(vault) {
|
|
725
|
+
return {
|
|
726
|
+
addEventListener(resource, event, listener, scope) {
|
|
727
|
+
if (!resource) {
|
|
728
|
+
return;
|
|
729
|
+
}
|
|
730
|
+
vault.setMetaValue([resource.id, "eventManager", event], (registeredCallbacks) => {
|
|
731
|
+
const callbacks = registeredCallbacks || [];
|
|
732
|
+
for (const registered of callbacks) {
|
|
733
|
+
if (registered.callback === listener) {
|
|
734
|
+
return callbacks;
|
|
735
|
+
}
|
|
736
|
+
}
|
|
737
|
+
return [...callbacks, { callback: listener, scope }];
|
|
738
|
+
});
|
|
739
|
+
return listener;
|
|
740
|
+
},
|
|
741
|
+
removeEventListener(resource, event, listener) {
|
|
742
|
+
if (!resource) {
|
|
743
|
+
return;
|
|
800
744
|
}
|
|
745
|
+
vault.setMetaValue([resource.id, "eventManager", event], (registeredCallbacks) => {
|
|
746
|
+
return (registeredCallbacks || []).filter((registeredCallback) => registeredCallback.callback !== listener);
|
|
747
|
+
});
|
|
748
|
+
},
|
|
749
|
+
getListenersAsProps(resourceOrId, scope) {
|
|
750
|
+
const resource = typeof resourceOrId === "string" ? { id: resourceOrId } : resourceOrId;
|
|
751
|
+
if (!resource || !resource.id) {
|
|
752
|
+
return {};
|
|
753
|
+
}
|
|
754
|
+
const hooks = vault.getResourceMeta(resource.id, "eventManager");
|
|
755
|
+
const props = {};
|
|
756
|
+
if (hooks && resource) {
|
|
757
|
+
for (const hook of Object.keys(hooks)) {
|
|
758
|
+
props[hook] = (e) => {
|
|
759
|
+
const fullResource = vault.get(resource);
|
|
760
|
+
for (const { callback, scope: _scope } of hooks[hook] || []) {
|
|
761
|
+
if (!_scope || scope && _scope.indexOf(scope) !== -1) {
|
|
762
|
+
callback(e, fullResource);
|
|
763
|
+
}
|
|
764
|
+
}
|
|
765
|
+
};
|
|
766
|
+
}
|
|
767
|
+
}
|
|
768
|
+
return props;
|
|
801
769
|
}
|
|
802
|
-
}
|
|
803
|
-
|
|
804
|
-
}, /* @__PURE__ */ React$1.createElement(PortalContext.Provider, {
|
|
805
|
-
value: portalElement
|
|
806
|
-
}, /* @__PURE__ */ React$1.createElement(OverlayPortalContext.Provider, {
|
|
807
|
-
value: overlayPortalElement
|
|
808
|
-
}, /* @__PURE__ */ React$1.createElement(ContextBridge, {
|
|
809
|
-
bridge
|
|
810
|
-
}, /* @__PURE__ */ React$1.createElement(VirtualAnnotationProvider, null, children)))))), /* @__PURE__ */ React$1.createElement("div", {
|
|
811
|
-
ref: portal
|
|
812
|
-
}));
|
|
813
|
-
}
|
|
814
|
-
|
|
770
|
+
};
|
|
771
|
+
}
|
|
815
772
|
function useResourceEvents(resource, scope) {
|
|
816
773
|
const vault = useVault();
|
|
817
774
|
const helper = useMemo(() => createEventsHelper(vault), [vault]);
|
|
@@ -825,7 +782,18 @@ function useResourceEvents(resource, scope) {
|
|
|
825
782
|
return resource ? helper.getListenersAsProps(resource, scope) : {};
|
|
826
783
|
}, [hooks, resource, vault, scope]);
|
|
827
784
|
}
|
|
828
|
-
|
|
785
|
+
function createStylesHelper(vault) {
|
|
786
|
+
return {
|
|
787
|
+
applyStyles(resource, scope, styles) {
|
|
788
|
+
const id = typeof resource === "string" ? resource : resource.id;
|
|
789
|
+
return vault.setMetaValue([id, "styles", scope], styles);
|
|
790
|
+
},
|
|
791
|
+
getAppliedStyles(resource) {
|
|
792
|
+
const id = typeof resource === "string" ? resource : resource.id;
|
|
793
|
+
return vault.getResourceMeta(id, "styles");
|
|
794
|
+
}
|
|
795
|
+
};
|
|
796
|
+
}
|
|
829
797
|
function useStyles(resource, scope) {
|
|
830
798
|
const vault = useVault();
|
|
831
799
|
const helper = useMemo(() => createStylesHelper(vault), [vault]);
|
|
@@ -837,8 +805,26 @@ function useStyles(resource, scope) {
|
|
|
837
805
|
return styles ? scope ? styles[scope] : styles : void 0;
|
|
838
806
|
}, [resource, scope]);
|
|
839
807
|
}
|
|
840
|
-
|
|
841
|
-
|
|
808
|
+
var __defProp2 = Object.defineProperty;
|
|
809
|
+
var __defProps2 = Object.defineProperties;
|
|
810
|
+
var __getOwnPropDescs2 = Object.getOwnPropertyDescriptors;
|
|
811
|
+
var __getOwnPropSymbols2 = Object.getOwnPropertySymbols;
|
|
812
|
+
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
813
|
+
var __propIsEnum2 = Object.prototype.propertyIsEnumerable;
|
|
814
|
+
var __defNormalProp2 = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
815
|
+
var __spreadValues2 = (a, b) => {
|
|
816
|
+
for (var prop in b || (b = {}))
|
|
817
|
+
if (__hasOwnProp2.call(b, prop))
|
|
818
|
+
__defNormalProp2(a, prop, b[prop]);
|
|
819
|
+
if (__getOwnPropSymbols2)
|
|
820
|
+
for (var prop of __getOwnPropSymbols2(b)) {
|
|
821
|
+
if (__propIsEnum2.call(b, prop))
|
|
822
|
+
__defNormalProp2(a, prop, b[prop]);
|
|
823
|
+
}
|
|
824
|
+
return a;
|
|
825
|
+
};
|
|
826
|
+
var __spreadProps2 = (a, b) => __defProps2(a, __getOwnPropDescs2(b));
|
|
827
|
+
const BOX_SELECTOR = /&?(xywh=)?(pixel:|percent:|pct:)?([0-9]+(?:\.[0-9]+)?),([0-9]+(?:\.[0-9]+)?),([0-9]+(?:\.[0-9]+)?),([0-9]+(?:\.[0-9]+)?)/;
|
|
842
828
|
const TEMPORAL_SELECTOR = /&?(t=)(npt:)?([0-9]+(.[0-9]+)?)?(,([0-9]+(.[0-9]+)?))?/;
|
|
843
829
|
function parseSelector(source) {
|
|
844
830
|
if (Array.isArray(source)) {
|
|
@@ -890,7 +876,7 @@ function parseSelector(source) {
|
|
|
890
876
|
const selector = {
|
|
891
877
|
type: "BoxSelector",
|
|
892
878
|
spatial: {
|
|
893
|
-
unit: matchBoxSelector[2] === "percent:" ? "percent" : "pixel",
|
|
879
|
+
unit: matchBoxSelector[2] === "percent:" || matchBoxSelector[2] === "pct:" ? "percent" : "pixel",
|
|
894
880
|
x: parseFloat(matchBoxSelector[3]),
|
|
895
881
|
y: parseFloat(matchBoxSelector[4]),
|
|
896
882
|
width: parseFloat(matchBoxSelector[5]),
|
|
@@ -926,26 +912,6 @@ function parseSelector(source) {
|
|
|
926
912
|
selectors: []
|
|
927
913
|
};
|
|
928
914
|
}
|
|
929
|
-
|
|
930
|
-
var __defProp$7 = Object.defineProperty;
|
|
931
|
-
var __defProps$5 = Object.defineProperties;
|
|
932
|
-
var __getOwnPropDescs$5 = Object.getOwnPropertyDescriptors;
|
|
933
|
-
var __getOwnPropSymbols$7 = Object.getOwnPropertySymbols;
|
|
934
|
-
var __hasOwnProp$7 = Object.prototype.hasOwnProperty;
|
|
935
|
-
var __propIsEnum$7 = Object.prototype.propertyIsEnumerable;
|
|
936
|
-
var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$7(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
937
|
-
var __spreadValues$7 = (a, b) => {
|
|
938
|
-
for (var prop in b || (b = {}))
|
|
939
|
-
if (__hasOwnProp$7.call(b, prop))
|
|
940
|
-
__defNormalProp$7(a, prop, b[prop]);
|
|
941
|
-
if (__getOwnPropSymbols$7)
|
|
942
|
-
for (var prop of __getOwnPropSymbols$7(b)) {
|
|
943
|
-
if (__propIsEnum$7.call(b, prop))
|
|
944
|
-
__defNormalProp$7(a, prop, b[prop]);
|
|
945
|
-
}
|
|
946
|
-
return a;
|
|
947
|
-
};
|
|
948
|
-
var __spreadProps$5 = (a, b) => __defProps$5(a, __getOwnPropDescs$5(b));
|
|
949
915
|
function expandTarget(target, options = {}) {
|
|
950
916
|
if (Array.isArray(target)) {
|
|
951
917
|
return expandTarget(target[0]);
|
|
@@ -1002,7 +968,7 @@ function expandTarget(target, options = {}) {
|
|
|
1002
968
|
if (!fragment) {
|
|
1003
969
|
return {
|
|
1004
970
|
type: "SpecificResource",
|
|
1005
|
-
source:
|
|
971
|
+
source: __spreadProps2(__spreadValues2({}, target), {
|
|
1006
972
|
id
|
|
1007
973
|
}),
|
|
1008
974
|
selector: null,
|
|
@@ -1011,7 +977,7 @@ function expandTarget(target, options = {}) {
|
|
|
1011
977
|
}
|
|
1012
978
|
return expandTarget({
|
|
1013
979
|
type: "SpecificResource",
|
|
1014
|
-
source:
|
|
980
|
+
source: __spreadProps2(__spreadValues2({}, target), {
|
|
1015
981
|
id
|
|
1016
982
|
}),
|
|
1017
983
|
selector: {
|
|
@@ -1027,26 +993,6 @@ function expandTarget(target, options = {}) {
|
|
|
1027
993
|
selectors: []
|
|
1028
994
|
};
|
|
1029
995
|
}
|
|
1030
|
-
|
|
1031
|
-
var __defProp$6 = Object.defineProperty;
|
|
1032
|
-
var __defProps$4 = Object.defineProperties;
|
|
1033
|
-
var __getOwnPropDescs$4 = Object.getOwnPropertyDescriptors;
|
|
1034
|
-
var __getOwnPropSymbols$6 = Object.getOwnPropertySymbols;
|
|
1035
|
-
var __hasOwnProp$6 = Object.prototype.hasOwnProperty;
|
|
1036
|
-
var __propIsEnum$6 = Object.prototype.propertyIsEnumerable;
|
|
1037
|
-
var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1038
|
-
var __spreadValues$6 = (a, b) => {
|
|
1039
|
-
for (var prop in b || (b = {}))
|
|
1040
|
-
if (__hasOwnProp$6.call(b, prop))
|
|
1041
|
-
__defNormalProp$6(a, prop, b[prop]);
|
|
1042
|
-
if (__getOwnPropSymbols$6)
|
|
1043
|
-
for (var prop of __getOwnPropSymbols$6(b)) {
|
|
1044
|
-
if (__propIsEnum$6.call(b, prop))
|
|
1045
|
-
__defNormalProp$6(a, prop, b[prop]);
|
|
1046
|
-
}
|
|
1047
|
-
return a;
|
|
1048
|
-
};
|
|
1049
|
-
var __spreadProps$4 = (a, b) => __defProps$4(a, __getOwnPropDescs$4(b));
|
|
1050
996
|
function useAnnotation(options = {}, deps = []) {
|
|
1051
997
|
const { id, selector } = options;
|
|
1052
998
|
const ctx = useResourceContext();
|
|
@@ -1058,7 +1004,7 @@ function useAnnotation(options = {}, deps = []) {
|
|
|
1058
1004
|
if (!annotation) {
|
|
1059
1005
|
return void 0;
|
|
1060
1006
|
}
|
|
1061
|
-
const newAnnotation = __spreadProps
|
|
1007
|
+
const newAnnotation = __spreadProps(__spreadValues({}, annotation), {
|
|
1062
1008
|
body,
|
|
1063
1009
|
target: expandTarget(annotation.target, { typeMap: vault.getState().iiif.mapping })
|
|
1064
1010
|
});
|
|
@@ -1068,7 +1014,6 @@ function useAnnotation(options = {}, deps = []) {
|
|
|
1068
1014
|
return newAnnotation;
|
|
1069
1015
|
}, [annotation, selector, body, ...deps]);
|
|
1070
1016
|
}
|
|
1071
|
-
|
|
1072
1017
|
function useCanvas(options = {}, deps = []) {
|
|
1073
1018
|
const { id, selector } = options;
|
|
1074
1019
|
const ctx = useResourceContext();
|
|
@@ -1084,30 +1029,15 @@ function useCanvas(options = {}, deps = []) {
|
|
|
1084
1029
|
return canvas;
|
|
1085
1030
|
}, [canvas, selector, ...deps]);
|
|
1086
1031
|
}
|
|
1087
|
-
|
|
1088
|
-
var __defProp$5 = Object.defineProperty;
|
|
1089
|
-
var __getOwnPropSymbols$5 = Object.getOwnPropertySymbols;
|
|
1090
|
-
var __hasOwnProp$5 = Object.prototype.hasOwnProperty;
|
|
1091
|
-
var __propIsEnum$5 = Object.prototype.propertyIsEnumerable;
|
|
1092
|
-
var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1093
|
-
var __spreadValues$5 = (a, b) => {
|
|
1094
|
-
for (var prop in b || (b = {}))
|
|
1095
|
-
if (__hasOwnProp$5.call(b, prop))
|
|
1096
|
-
__defNormalProp$5(a, prop, b[prop]);
|
|
1097
|
-
if (__getOwnPropSymbols$5)
|
|
1098
|
-
for (var prop of __getOwnPropSymbols$5(b)) {
|
|
1099
|
-
if (__propIsEnum$5.call(b, prop))
|
|
1100
|
-
__defNormalProp$5(a, prop, b[prop]);
|
|
1101
|
-
}
|
|
1102
|
-
return a;
|
|
1103
|
-
};
|
|
1104
1032
|
const RenderAnnotation = ({
|
|
1105
1033
|
id,
|
|
1106
1034
|
style: defaultStyle,
|
|
1107
1035
|
className,
|
|
1108
1036
|
interactive
|
|
1109
1037
|
}) => {
|
|
1110
|
-
const annotation = useAnnotation({
|
|
1038
|
+
const annotation = useAnnotation({
|
|
1039
|
+
id
|
|
1040
|
+
});
|
|
1111
1041
|
const style = useStyles(annotation, "atlas");
|
|
1112
1042
|
const html = useStyles(annotation, "html");
|
|
1113
1043
|
const events = useResourceEvents(annotation, ["atlas"]);
|
|
@@ -1119,7 +1049,7 @@ const RenderAnnotation = ({
|
|
|
1119
1049
|
if (!isValid) {
|
|
1120
1050
|
return null;
|
|
1121
1051
|
}
|
|
1122
|
-
return /* @__PURE__ */
|
|
1052
|
+
return /* @__PURE__ */ jsx(RegionHighlight, __spreadValues({
|
|
1123
1053
|
id: annotation.id,
|
|
1124
1054
|
isEditing: true,
|
|
1125
1055
|
region: annotation.target.selector.spatial,
|
|
@@ -1131,7 +1061,6 @@ const RenderAnnotation = ({
|
|
|
1131
1061
|
hrefTarget: (html == null ? void 0 : html.target) || null
|
|
1132
1062
|
}, events));
|
|
1133
1063
|
};
|
|
1134
|
-
|
|
1135
1064
|
const RenderAnnotationPage = ({
|
|
1136
1065
|
className,
|
|
1137
1066
|
page
|
|
@@ -1140,17 +1069,16 @@ const RenderAnnotationPage = ({
|
|
|
1140
1069
|
const style = useStyles(page, "atlas");
|
|
1141
1070
|
const html = useStyles(page, "html");
|
|
1142
1071
|
useVaultSelector((state) => page.id ? state.iiif.entities.AnnotationPage[page.id] : null, []);
|
|
1143
|
-
return /* @__PURE__ */
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1072
|
+
return /* @__PURE__ */ jsx(Fragment$1, {
|
|
1073
|
+
children: (_a = page.items) == null ? void 0 : _a.map((annotation) => {
|
|
1074
|
+
return /* @__PURE__ */ jsx(RenderAnnotation, {
|
|
1075
|
+
id: annotation.id,
|
|
1076
|
+
style,
|
|
1077
|
+
className: (html == null ? void 0 : html.className) || className
|
|
1078
|
+
}, annotation.id);
|
|
1079
|
+
})
|
|
1080
|
+
});
|
|
1151
1081
|
};
|
|
1152
|
-
|
|
1153
|
-
const TileSet = TileSet$1;
|
|
1154
1082
|
function RenderImage({
|
|
1155
1083
|
id,
|
|
1156
1084
|
image,
|
|
@@ -1162,35 +1090,33 @@ function RenderImage({
|
|
|
1162
1090
|
children
|
|
1163
1091
|
}) {
|
|
1164
1092
|
var _a, _b, _c, _d;
|
|
1165
|
-
return /* @__PURE__ */
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
} :
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
}), annotations, children));
|
|
1093
|
+
return /* @__PURE__ */ jsx(Fragment$1, {
|
|
1094
|
+
children: !image.service ? /* @__PURE__ */ jsxs(Fragment$1, {
|
|
1095
|
+
children: [/* @__PURE__ */ jsx("world-image", {
|
|
1096
|
+
uri: image.id,
|
|
1097
|
+
target: image.target.spatial,
|
|
1098
|
+
display: image.width && image.height ? {
|
|
1099
|
+
width: image.width,
|
|
1100
|
+
height: image.height
|
|
1101
|
+
} : void 0
|
|
1102
|
+
}), annotations, children]
|
|
1103
|
+
}, "no-service") : /* @__PURE__ */ jsxs(Fragment$1, {
|
|
1104
|
+
children: [/* @__PURE__ */ jsx(TileSet, {
|
|
1105
|
+
tiles: {
|
|
1106
|
+
id: image.service.id || image.service["@id"] || "unknown",
|
|
1107
|
+
height: image.height,
|
|
1108
|
+
width: image.width,
|
|
1109
|
+
imageService: image.service,
|
|
1110
|
+
thumbnail: thumbnail && thumbnail.type === "fixed" ? thumbnail : void 0
|
|
1111
|
+
},
|
|
1112
|
+
x: ((_a = image.target) == null ? void 0 : _a.spatial.x) + x,
|
|
1113
|
+
y: ((_b = image.target) == null ? void 0 : _b.spatial.y) + y,
|
|
1114
|
+
width: (_c = image.target) == null ? void 0 : _c.spatial.width,
|
|
1115
|
+
height: (_d = image.target) == null ? void 0 : _d.spatial.height
|
|
1116
|
+
}), annotations, children]
|
|
1117
|
+
}, "service")
|
|
1118
|
+
}, id);
|
|
1192
1119
|
}
|
|
1193
|
-
|
|
1194
1120
|
function parseSpecificResource(resource) {
|
|
1195
1121
|
if (resource.type === "SpecificResource") {
|
|
1196
1122
|
return [resource.source, { selector: resource.selector }];
|
|
@@ -1249,7 +1175,6 @@ const unknownResponse = { type: "unknown" };
|
|
|
1249
1175
|
const unsupportedStrategy = (reason) => {
|
|
1250
1176
|
return { type: "unknown", reason, annotations: { pages: [] } };
|
|
1251
1177
|
};
|
|
1252
|
-
|
|
1253
1178
|
function useManifest(options = {}, deps = []) {
|
|
1254
1179
|
const { id, selector } = options;
|
|
1255
1180
|
const ctx = useResourceContext();
|
|
@@ -1266,7 +1191,6 @@ function useManifest(options = {}, deps = []) {
|
|
|
1266
1191
|
return manifest;
|
|
1267
1192
|
}, [manifest, selector, ...deps]);
|
|
1268
1193
|
}
|
|
1269
|
-
|
|
1270
1194
|
function getMeta$1(state, resourceId) {
|
|
1271
1195
|
var _a;
|
|
1272
1196
|
const resourceMeta = (_a = state == null ? void 0 : state.iiif) == null ? void 0 : _a.meta[resourceId];
|
|
@@ -1293,7 +1217,6 @@ function useEnabledAnnotationPageIds(resourceId, availablePageIds) {
|
|
|
1293
1217
|
return pageIds;
|
|
1294
1218
|
}, [resourceId, availablePageIds]);
|
|
1295
1219
|
}
|
|
1296
|
-
|
|
1297
1220
|
function flattenAnnotationPageIds({
|
|
1298
1221
|
canvas,
|
|
1299
1222
|
manifest,
|
|
@@ -1327,26 +1250,6 @@ function flattenAnnotationPageIds({
|
|
|
1327
1250
|
}
|
|
1328
1251
|
return foundIds;
|
|
1329
1252
|
}
|
|
1330
|
-
|
|
1331
|
-
var __defProp$4 = Object.defineProperty;
|
|
1332
|
-
var __defProps$3 = Object.defineProperties;
|
|
1333
|
-
var __getOwnPropDescs$3 = Object.getOwnPropertyDescriptors;
|
|
1334
|
-
var __getOwnPropSymbols$4 = Object.getOwnPropertySymbols;
|
|
1335
|
-
var __hasOwnProp$4 = Object.prototype.hasOwnProperty;
|
|
1336
|
-
var __propIsEnum$4 = Object.prototype.propertyIsEnumerable;
|
|
1337
|
-
var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1338
|
-
var __spreadValues$4 = (a, b) => {
|
|
1339
|
-
for (var prop in b || (b = {}))
|
|
1340
|
-
if (__hasOwnProp$4.call(b, prop))
|
|
1341
|
-
__defNormalProp$4(a, prop, b[prop]);
|
|
1342
|
-
if (__getOwnPropSymbols$4)
|
|
1343
|
-
for (var prop of __getOwnPropSymbols$4(b)) {
|
|
1344
|
-
if (__propIsEnum$4.call(b, prop))
|
|
1345
|
-
__defNormalProp$4(a, prop, b[prop]);
|
|
1346
|
-
}
|
|
1347
|
-
return a;
|
|
1348
|
-
};
|
|
1349
|
-
var __spreadProps$3 = (a, b) => __defProps$3(a, __getOwnPropDescs$3(b));
|
|
1350
1253
|
function getMeta(state, resourceId) {
|
|
1351
1254
|
var _a;
|
|
1352
1255
|
const resourceMeta = (_a = state == null ? void 0 : state.iiif) == null ? void 0 : _a.meta[resourceId];
|
|
@@ -1377,7 +1280,7 @@ function useAnnotationPageManager(resourceId, options = {}) {
|
|
|
1377
1280
|
if (existingResources && !existingResources[resourceId]) {
|
|
1378
1281
|
return existingResources;
|
|
1379
1282
|
}
|
|
1380
|
-
return __spreadProps
|
|
1283
|
+
return __spreadProps(__spreadValues({}, existingResources || {}), {
|
|
1381
1284
|
[resourceId]: false
|
|
1382
1285
|
});
|
|
1383
1286
|
});
|
|
@@ -1404,7 +1307,7 @@ function useAnnotationPageManager(resourceId, options = {}) {
|
|
|
1404
1307
|
if (existingResources && existingResources[resourceId]) {
|
|
1405
1308
|
return existingResources;
|
|
1406
1309
|
}
|
|
1407
|
-
return __spreadProps
|
|
1310
|
+
return __spreadProps(__spreadValues({}, existingResources || {}), {
|
|
1408
1311
|
[resourceId]: true
|
|
1409
1312
|
});
|
|
1410
1313
|
});
|
|
@@ -1416,35 +1319,13 @@ function useAnnotationPageManager(resourceId, options = {}) {
|
|
|
1416
1319
|
setPageDisabled
|
|
1417
1320
|
};
|
|
1418
1321
|
}
|
|
1419
|
-
|
|
1420
1322
|
function useResources(ids, type) {
|
|
1421
1323
|
return useVaultSelector((state, vault) => vault.get(ids.map((id) => ({ id, type }))), [ids, type]);
|
|
1422
1324
|
}
|
|
1423
|
-
|
|
1424
|
-
const ImageServiceLoaderContext = React$1.createContext(new ImageServiceLoader());
|
|
1325
|
+
const ImageServiceLoaderContext = React__default.createContext(new ImageServiceLoader());
|
|
1425
1326
|
function useImageServiceLoader() {
|
|
1426
1327
|
return useContext(ImageServiceLoaderContext);
|
|
1427
1328
|
}
|
|
1428
|
-
|
|
1429
|
-
var __defProp$3 = Object.defineProperty;
|
|
1430
|
-
var __defProps$2 = Object.defineProperties;
|
|
1431
|
-
var __getOwnPropDescs$2 = Object.getOwnPropertyDescriptors;
|
|
1432
|
-
var __getOwnPropSymbols$3 = Object.getOwnPropertySymbols;
|
|
1433
|
-
var __hasOwnProp$3 = Object.prototype.hasOwnProperty;
|
|
1434
|
-
var __propIsEnum$3 = Object.prototype.propertyIsEnumerable;
|
|
1435
|
-
var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1436
|
-
var __spreadValues$3 = (a, b) => {
|
|
1437
|
-
for (var prop in b || (b = {}))
|
|
1438
|
-
if (__hasOwnProp$3.call(b, prop))
|
|
1439
|
-
__defNormalProp$3(a, prop, b[prop]);
|
|
1440
|
-
if (__getOwnPropSymbols$3)
|
|
1441
|
-
for (var prop of __getOwnPropSymbols$3(b)) {
|
|
1442
|
-
if (__propIsEnum$3.call(b, prop))
|
|
1443
|
-
__defNormalProp$3(a, prop, b[prop]);
|
|
1444
|
-
}
|
|
1445
|
-
return a;
|
|
1446
|
-
};
|
|
1447
|
-
var __spreadProps$2 = (a, b) => __defProps$2(a, __getOwnPropDescs$2(b));
|
|
1448
1329
|
function useLoadImageService() {
|
|
1449
1330
|
const loader = useImageServiceLoader();
|
|
1450
1331
|
const [imageServiceStatus, setImageServiceStatus] = useState({});
|
|
@@ -1468,7 +1349,7 @@ function useLoadImageService() {
|
|
|
1468
1349
|
} else if (!imageServiceStatus[imageServiceId]) {
|
|
1469
1350
|
if (!didUnmount.current) {
|
|
1470
1351
|
setImageServiceStatus((r) => {
|
|
1471
|
-
return __spreadProps
|
|
1352
|
+
return __spreadProps(__spreadValues({}, r), {
|
|
1472
1353
|
[imageServiceId]: "loading"
|
|
1473
1354
|
});
|
|
1474
1355
|
});
|
|
@@ -1480,7 +1361,7 @@ function useLoadImageService() {
|
|
|
1480
1361
|
}).then(() => {
|
|
1481
1362
|
if (!didUnmount.current) {
|
|
1482
1363
|
setImageServiceStatus((r) => {
|
|
1483
|
-
return __spreadProps
|
|
1364
|
+
return __spreadProps(__spreadValues({}, r), {
|
|
1484
1365
|
[imageServiceId]: "done"
|
|
1485
1366
|
});
|
|
1486
1367
|
});
|
|
@@ -1492,7 +1373,6 @@ function useLoadImageService() {
|
|
|
1492
1373
|
}, [loader, imageServiceStatus]);
|
|
1493
1374
|
return [loadImageService, imageServiceStatus];
|
|
1494
1375
|
}
|
|
1495
|
-
|
|
1496
1376
|
function usePaintingAnnotations(options = {}) {
|
|
1497
1377
|
const canvas = useCanvas(options.canvasId ? { id: options.canvasId } : void 0);
|
|
1498
1378
|
return useVaultSelector((state, vault) => {
|
|
@@ -1507,7 +1387,6 @@ function usePaintingAnnotations(options = {}) {
|
|
|
1507
1387
|
return flatAnnotations;
|
|
1508
1388
|
}, [canvas]);
|
|
1509
1389
|
}
|
|
1510
|
-
|
|
1511
1390
|
function usePaintables(options, deps = []) {
|
|
1512
1391
|
const vault = useVault();
|
|
1513
1392
|
const paintingAnnotations = usePaintingAnnotations();
|
|
@@ -1551,7 +1430,6 @@ function usePaintables(options, deps = []) {
|
|
|
1551
1430
|
const actions = { makeChoice };
|
|
1552
1431
|
return [paintables, actions];
|
|
1553
1432
|
}
|
|
1554
|
-
|
|
1555
1433
|
function getImageStrategy(canvas, paintables, loadImageService) {
|
|
1556
1434
|
const imageTypes = [];
|
|
1557
1435
|
for (const singleImage of paintables.items) {
|
|
@@ -1625,7 +1503,6 @@ function getImageStrategy(canvas, paintables, loadImageService) {
|
|
|
1625
1503
|
choice: paintables.choice
|
|
1626
1504
|
};
|
|
1627
1505
|
}
|
|
1628
|
-
|
|
1629
1506
|
const supportedFormats = ["model/gltf-binary"];
|
|
1630
1507
|
function get3dStrategy(canvas, paintables) {
|
|
1631
1508
|
const first = paintables.items[0];
|
|
@@ -1641,7 +1518,6 @@ function get3dStrategy(canvas, paintables) {
|
|
|
1641
1518
|
model: resource
|
|
1642
1519
|
};
|
|
1643
1520
|
}
|
|
1644
|
-
|
|
1645
1521
|
function getAudioStrategy(canvas, paintables) {
|
|
1646
1522
|
var _a;
|
|
1647
1523
|
if (!canvas.duration) {
|
|
@@ -1684,7 +1560,6 @@ function getAudioStrategy(canvas, paintables) {
|
|
|
1684
1560
|
}
|
|
1685
1561
|
};
|
|
1686
1562
|
}
|
|
1687
|
-
|
|
1688
1563
|
function getVideoStrategy(canvas, paintables) {
|
|
1689
1564
|
var _a;
|
|
1690
1565
|
const videoPaintables = paintables.items.filter((t) => t.type === "video");
|
|
@@ -1729,26 +1604,6 @@ function getVideoStrategy(canvas, paintables) {
|
|
|
1729
1604
|
}
|
|
1730
1605
|
};
|
|
1731
1606
|
}
|
|
1732
|
-
|
|
1733
|
-
var __defProp$2 = Object.defineProperty;
|
|
1734
|
-
var __defProps$1 = Object.defineProperties;
|
|
1735
|
-
var __getOwnPropDescs$1 = Object.getOwnPropertyDescriptors;
|
|
1736
|
-
var __getOwnPropSymbols$2 = Object.getOwnPropertySymbols;
|
|
1737
|
-
var __hasOwnProp$2 = Object.prototype.hasOwnProperty;
|
|
1738
|
-
var __propIsEnum$2 = Object.prototype.propertyIsEnumerable;
|
|
1739
|
-
var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1740
|
-
var __spreadValues$2 = (a, b) => {
|
|
1741
|
-
for (var prop in b || (b = {}))
|
|
1742
|
-
if (__hasOwnProp$2.call(b, prop))
|
|
1743
|
-
__defNormalProp$2(a, prop, b[prop]);
|
|
1744
|
-
if (__getOwnPropSymbols$2)
|
|
1745
|
-
for (var prop of __getOwnPropSymbols$2(b)) {
|
|
1746
|
-
if (__propIsEnum$2.call(b, prop))
|
|
1747
|
-
__defNormalProp$2(a, prop, b[prop]);
|
|
1748
|
-
}
|
|
1749
|
-
return a;
|
|
1750
|
-
};
|
|
1751
|
-
var __spreadProps$1 = (a, b) => __defProps$1(a, __getOwnPropDescs$1(b));
|
|
1752
1607
|
function useRenderingStrategy(options) {
|
|
1753
1608
|
const manifest = useManifest();
|
|
1754
1609
|
const canvas = useCanvas();
|
|
@@ -1806,21 +1661,96 @@ function useRenderingStrategy(options) {
|
|
|
1806
1661
|
return [strategy, emptyActions];
|
|
1807
1662
|
}
|
|
1808
1663
|
return [
|
|
1809
|
-
__spreadProps
|
|
1664
|
+
__spreadProps(__spreadValues({}, strategy), {
|
|
1810
1665
|
annotations: { pages: enabledPages }
|
|
1811
1666
|
}),
|
|
1812
1667
|
actions
|
|
1813
1668
|
];
|
|
1814
1669
|
}, [strategy, enabledPages]);
|
|
1815
1670
|
}
|
|
1816
|
-
|
|
1817
1671
|
const useVaultEffect = (callback, deps = []) => {
|
|
1818
1672
|
const vault = useVault();
|
|
1819
1673
|
useEffect(() => {
|
|
1820
1674
|
callback(vault);
|
|
1821
1675
|
}, [vault, ...deps]);
|
|
1822
1676
|
};
|
|
1823
|
-
|
|
1677
|
+
function createThumbnailHelper(vault, dependencies = {}) {
|
|
1678
|
+
const imageServiceLoader = dependencies.imageServiceLoader || new ImageServiceLoader();
|
|
1679
|
+
async function getBestThumbnailAtSize(input, request, dereference, candidates = [], dimensions) {
|
|
1680
|
+
if (typeof input === "string") {
|
|
1681
|
+
return { best: getFixedSizeFromImage(input), fallback: [], log: [] };
|
|
1682
|
+
}
|
|
1683
|
+
const fullInput = vault.get(input);
|
|
1684
|
+
if (typeof fullInput === "string") {
|
|
1685
|
+
return { best: getFixedSizeFromImage(fullInput), fallback: [], log: [] };
|
|
1686
|
+
}
|
|
1687
|
+
switch (fullInput.type) {
|
|
1688
|
+
case "Annotation": {
|
|
1689
|
+
const contentResources = fullInput.body;
|
|
1690
|
+
const firstContentResources = vault.get(contentResources[0]);
|
|
1691
|
+
if (dimensions && !firstContentResources.width) {
|
|
1692
|
+
firstContentResources.width = dimensions.width;
|
|
1693
|
+
firstContentResources.height = dimensions.height;
|
|
1694
|
+
}
|
|
1695
|
+
return await imageServiceLoader.getThumbnailFromResource(firstContentResources, request, dereference, candidates);
|
|
1696
|
+
}
|
|
1697
|
+
case "Canvas": {
|
|
1698
|
+
const canvas = fullInput;
|
|
1699
|
+
if (canvas.thumbnail && canvas.thumbnail.length) {
|
|
1700
|
+
const thumbnail = vault.get(canvas.thumbnail[0]);
|
|
1701
|
+
const potentialThumbnails = await imageServiceLoader.getImageCandidates(thumbnail, dereference);
|
|
1702
|
+
if (potentialThumbnails && potentialThumbnails.length) {
|
|
1703
|
+
candidates.push(...potentialThumbnails);
|
|
1704
|
+
}
|
|
1705
|
+
}
|
|
1706
|
+
return getBestThumbnailAtSize(canvas.items[0], request, dereference, candidates, {
|
|
1707
|
+
width: canvas.width,
|
|
1708
|
+
height: canvas.height
|
|
1709
|
+
});
|
|
1710
|
+
}
|
|
1711
|
+
case "AnnotationPage": {
|
|
1712
|
+
const annotationPage = fullInput;
|
|
1713
|
+
return getBestThumbnailAtSize(annotationPage.items[0], request, dereference, candidates, dimensions);
|
|
1714
|
+
}
|
|
1715
|
+
case "Choice": {
|
|
1716
|
+
const choice = fullInput;
|
|
1717
|
+
return getBestThumbnailAtSize(choice.items[0], request, dereference, candidates, dimensions);
|
|
1718
|
+
}
|
|
1719
|
+
case "Collection": {
|
|
1720
|
+
const collection = fullInput;
|
|
1721
|
+
const firstManifest = collection.items[0];
|
|
1722
|
+
return getBestThumbnailAtSize(firstManifest, request, dereference, candidates, dimensions);
|
|
1723
|
+
}
|
|
1724
|
+
case "Manifest": {
|
|
1725
|
+
const manifest = fullInput;
|
|
1726
|
+
const firstCanvas = manifest.items[0];
|
|
1727
|
+
return getBestThumbnailAtSize(firstCanvas, request, dereference, candidates, dimensions);
|
|
1728
|
+
}
|
|
1729
|
+
case "SpecificResource":
|
|
1730
|
+
case "Image":
|
|
1731
|
+
case "Dataset":
|
|
1732
|
+
case "Sound":
|
|
1733
|
+
case "Text":
|
|
1734
|
+
case "TextualBody":
|
|
1735
|
+
case "Video":
|
|
1736
|
+
if (dimensions && !fullInput.width) {
|
|
1737
|
+
fullInput.width = dimensions.width;
|
|
1738
|
+
fullInput.height = dimensions.height;
|
|
1739
|
+
}
|
|
1740
|
+
return imageServiceLoader.getThumbnailFromResource(fullInput, request, dereference, candidates);
|
|
1741
|
+
case "Service":
|
|
1742
|
+
case "Range":
|
|
1743
|
+
case "AnnotationCollection":
|
|
1744
|
+
case "CanvasReference":
|
|
1745
|
+
case "ContentResource":
|
|
1746
|
+
return { best: void 0, fallback: [], log: [] };
|
|
1747
|
+
}
|
|
1748
|
+
return { best: void 0, fallback: [], log: [] };
|
|
1749
|
+
}
|
|
1750
|
+
return {
|
|
1751
|
+
getBestThumbnailAtSize
|
|
1752
|
+
};
|
|
1753
|
+
}
|
|
1824
1754
|
function useThumbnail(request, dereference, { canvasId, manifestId } = {}) {
|
|
1825
1755
|
const vault = useVault();
|
|
1826
1756
|
const loader = useImageServiceLoader();
|
|
@@ -1847,49 +1777,29 @@ function useThumbnail(request, dereference, { canvasId, manifestId } = {}) {
|
|
|
1847
1777
|
}, [subject]);
|
|
1848
1778
|
return thumbnail;
|
|
1849
1779
|
}
|
|
1850
|
-
|
|
1851
|
-
var __defProp$1 = Object.defineProperty;
|
|
1852
|
-
var __defProps = Object.defineProperties;
|
|
1853
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
1854
|
-
var __getOwnPropSymbols$1 = Object.getOwnPropertySymbols;
|
|
1855
|
-
var __hasOwnProp$1 = Object.prototype.hasOwnProperty;
|
|
1856
|
-
var __propIsEnum$1 = Object.prototype.propertyIsEnumerable;
|
|
1857
|
-
var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1858
|
-
var __spreadValues$1 = (a, b) => {
|
|
1859
|
-
for (var prop in b || (b = {}))
|
|
1860
|
-
if (__hasOwnProp$1.call(b, prop))
|
|
1861
|
-
__defNormalProp$1(a, prop, b[prop]);
|
|
1862
|
-
if (__getOwnPropSymbols$1)
|
|
1863
|
-
for (var prop of __getOwnPropSymbols$1(b)) {
|
|
1864
|
-
if (__propIsEnum$1.call(b, prop))
|
|
1865
|
-
__defNormalProp$1(a, prop, b[prop]);
|
|
1866
|
-
}
|
|
1867
|
-
return a;
|
|
1868
|
-
};
|
|
1869
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
1870
1780
|
function getDefaultState(duration) {
|
|
1871
1781
|
return { isMuted: false, playRequested: false, isPlaying: false, isFinished: false, volume: 100, duration };
|
|
1872
1782
|
}
|
|
1873
1783
|
function reducer(state, action) {
|
|
1874
1784
|
switch (action.type) {
|
|
1875
1785
|
case "FINISHED":
|
|
1876
|
-
return __spreadProps(__spreadValues
|
|
1786
|
+
return __spreadProps(__spreadValues({}, state), { isFinished: true, isPlaying: false, playRequested: false });
|
|
1877
1787
|
case "PLAY_PAUSE":
|
|
1878
|
-
return __spreadProps(__spreadValues
|
|
1788
|
+
return __spreadProps(__spreadValues({}, state), { isFinished: false, isPlaying: !state.isPlaying });
|
|
1879
1789
|
case "PLAY_REQUESTED":
|
|
1880
|
-
return __spreadProps(__spreadValues
|
|
1790
|
+
return __spreadProps(__spreadValues({}, state), { isFinished: false, playRequested: true });
|
|
1881
1791
|
case "PAUSE":
|
|
1882
|
-
return __spreadProps(__spreadValues
|
|
1792
|
+
return __spreadProps(__spreadValues({}, state), { isPlaying: false });
|
|
1883
1793
|
case "PLAY":
|
|
1884
|
-
return __spreadProps(__spreadValues
|
|
1794
|
+
return __spreadProps(__spreadValues({}, state), { isFinished: false, playRequested: false, isPlaying: true });
|
|
1885
1795
|
case "MUTE":
|
|
1886
|
-
return __spreadProps(__spreadValues
|
|
1796
|
+
return __spreadProps(__spreadValues({}, state), { isMuted: true });
|
|
1887
1797
|
case "SET_VOLUME":
|
|
1888
|
-
return __spreadProps(__spreadValues
|
|
1798
|
+
return __spreadProps(__spreadValues({}, state), { volume: action.volume, isMuted: action.volume === 0 });
|
|
1889
1799
|
case "TOGGLE_MUTE":
|
|
1890
|
-
return __spreadProps(__spreadValues
|
|
1800
|
+
return __spreadProps(__spreadValues({}, state), { isMuted: !state.isMuted });
|
|
1891
1801
|
case "UNMUTE":
|
|
1892
|
-
return __spreadProps(__spreadValues
|
|
1802
|
+
return __spreadProps(__spreadValues({}, state), { isMuted: false });
|
|
1893
1803
|
}
|
|
1894
1804
|
return state;
|
|
1895
1805
|
}
|
|
@@ -2007,7 +1917,6 @@ function useSimpleMediaPlayer(props) {
|
|
|
2007
1917
|
}
|
|
2008
1918
|
];
|
|
2009
1919
|
}
|
|
2010
|
-
|
|
2011
1920
|
const MediaReactContextState = createContext(null);
|
|
2012
1921
|
const MediaReactContextActions = createContext(null);
|
|
2013
1922
|
const MediaReactContextElements = createContext(null);
|
|
@@ -2040,35 +1949,65 @@ function MediaPlayerProvider({
|
|
|
2040
1949
|
progress,
|
|
2041
1950
|
element
|
|
2042
1951
|
}) {
|
|
2043
|
-
return /* @__PURE__ */
|
|
2044
|
-
value: {
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
1952
|
+
return /* @__PURE__ */ jsx(MediaReactContextElements.Provider, {
|
|
1953
|
+
value: {
|
|
1954
|
+
currentTime,
|
|
1955
|
+
progress,
|
|
1956
|
+
element
|
|
1957
|
+
},
|
|
1958
|
+
children: /* @__PURE__ */ jsx(MediaReactContextActions.Provider, {
|
|
1959
|
+
value: actions,
|
|
1960
|
+
children: /* @__PURE__ */ jsx(MediaReactContextState.Provider, {
|
|
1961
|
+
value: state,
|
|
1962
|
+
children
|
|
1963
|
+
})
|
|
1964
|
+
})
|
|
1965
|
+
});
|
|
1966
|
+
}
|
|
1967
|
+
function Audio({
|
|
1968
|
+
media,
|
|
1969
|
+
children
|
|
1970
|
+
}) {
|
|
1971
|
+
const [{
|
|
1972
|
+
element,
|
|
2057
1973
|
currentTime,
|
|
2058
|
-
progress
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
1974
|
+
progress
|
|
1975
|
+
}, state, actions] = useSimpleMediaPlayer({
|
|
1976
|
+
duration: media.duration
|
|
1977
|
+
});
|
|
1978
|
+
return /* @__PURE__ */ jsx(Fragment, {
|
|
1979
|
+
children: /* @__PURE__ */ jsx(CanvasPortal, {
|
|
1980
|
+
children: /* @__PURE__ */ jsxs(MediaPlayerProvider, {
|
|
1981
|
+
state,
|
|
1982
|
+
actions,
|
|
1983
|
+
currentTime,
|
|
1984
|
+
progress,
|
|
1985
|
+
element,
|
|
1986
|
+
children: [/* @__PURE__ */ jsx("audio", {
|
|
1987
|
+
ref: element,
|
|
1988
|
+
src: media.url
|
|
1989
|
+
}), children]
|
|
1990
|
+
})
|
|
1991
|
+
})
|
|
1992
|
+
});
|
|
1993
|
+
}
|
|
1994
|
+
function Video({
|
|
1995
|
+
media,
|
|
1996
|
+
children
|
|
1997
|
+
}) {
|
|
1998
|
+
const [{
|
|
1999
|
+
element,
|
|
2000
|
+
currentTime,
|
|
2001
|
+
progress
|
|
2002
|
+
}, state, actions] = useSimpleMediaPlayer({
|
|
2003
|
+
duration: media.duration
|
|
2004
|
+
});
|
|
2068
2005
|
const Component = "div";
|
|
2069
|
-
return /* @__PURE__ */
|
|
2070
|
-
|
|
2071
|
-
|
|
2006
|
+
return /* @__PURE__ */ jsxs(Fragment, {
|
|
2007
|
+
children: [/* @__PURE__ */ jsxs(CanvasPortal, {
|
|
2008
|
+
overlay: true,
|
|
2009
|
+
children: [/* @__PURE__ */ jsx("style", {
|
|
2010
|
+
children: `
|
|
2072
2011
|
.video-container {
|
|
2073
2012
|
position: absolute;
|
|
2074
2013
|
top: 0;
|
|
@@ -2081,27 +2020,39 @@ function Video({ media, children }) {
|
|
|
2081
2020
|
justify-content: center;
|
|
2082
2021
|
pointer-events: visible;
|
|
2083
2022
|
}
|
|
2084
|
-
`
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2023
|
+
`
|
|
2024
|
+
}), /* @__PURE__ */ jsx(Component, {
|
|
2025
|
+
className: "video-container",
|
|
2026
|
+
part: "video-container",
|
|
2027
|
+
onClick: () => actions.playPause(),
|
|
2028
|
+
children: /* @__PURE__ */ jsx("video", {
|
|
2029
|
+
ref: element,
|
|
2030
|
+
src: media.url,
|
|
2031
|
+
style: {
|
|
2032
|
+
width: "100%",
|
|
2033
|
+
objectFit: "contain"
|
|
2034
|
+
}
|
|
2035
|
+
})
|
|
2036
|
+
})]
|
|
2037
|
+
}), /* @__PURE__ */ jsx(CanvasPortal, {
|
|
2038
|
+
children: /* @__PURE__ */ jsx(MediaPlayerProvider, {
|
|
2039
|
+
state,
|
|
2040
|
+
actions,
|
|
2041
|
+
currentTime,
|
|
2042
|
+
progress,
|
|
2043
|
+
element,
|
|
2044
|
+
children
|
|
2045
|
+
})
|
|
2046
|
+
})]
|
|
2047
|
+
});
|
|
2048
|
+
}
|
|
2049
|
+
function Model({
|
|
2050
|
+
model
|
|
2051
|
+
}) {
|
|
2052
|
+
return /* @__PURE__ */ jsxs(CanvasPortal, {
|
|
2053
|
+
overlay: true,
|
|
2054
|
+
children: [/* @__PURE__ */ jsx("style", {
|
|
2055
|
+
children: `
|
|
2105
2056
|
.model-container {
|
|
2106
2057
|
position: absolute;
|
|
2107
2058
|
top: 0;
|
|
@@ -2114,33 +2065,22 @@ function Model({ model }) {
|
|
|
2114
2065
|
justify-content: center;
|
|
2115
2066
|
pointer-events: visible;
|
|
2116
2067
|
}
|
|
2117
|
-
`
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
var __spreadValues = (a, b) => {
|
|
2134
|
-
for (var prop in b || (b = {}))
|
|
2135
|
-
if (__hasOwnProp.call(b, prop))
|
|
2136
|
-
__defNormalProp(a, prop, b[prop]);
|
|
2137
|
-
if (__getOwnPropSymbols)
|
|
2138
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
2139
|
-
if (__propIsEnum.call(b, prop))
|
|
2140
|
-
__defNormalProp(a, prop, b[prop]);
|
|
2141
|
-
}
|
|
2142
|
-
return a;
|
|
2143
|
-
};
|
|
2068
|
+
`
|
|
2069
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
2070
|
+
className: "model-container",
|
|
2071
|
+
children: /* @__PURE__ */ jsx("model-viewer", {
|
|
2072
|
+
"interaction-prompt": "none",
|
|
2073
|
+
style: {
|
|
2074
|
+
width: "100%",
|
|
2075
|
+
height: "100%"
|
|
2076
|
+
},
|
|
2077
|
+
"camera-controls": "",
|
|
2078
|
+
"ar-status": "not-presenting",
|
|
2079
|
+
src: model.id
|
|
2080
|
+
})
|
|
2081
|
+
})]
|
|
2082
|
+
});
|
|
2083
|
+
}
|
|
2144
2084
|
function RenderCanvas({
|
|
2145
2085
|
x,
|
|
2146
2086
|
y,
|
|
@@ -2160,7 +2100,9 @@ function RenderCanvas({
|
|
|
2160
2100
|
const helper = useMemo(() => createStylesHelper(vault), [vault]);
|
|
2161
2101
|
const [strategy, actions] = useRenderingStrategy({
|
|
2162
2102
|
strategies: strategies || ["images"],
|
|
2163
|
-
defaultChoices: defaultChoices == null ? void 0 : defaultChoices.map(({
|
|
2103
|
+
defaultChoices: defaultChoices == null ? void 0 : defaultChoices.map(({
|
|
2104
|
+
id
|
|
2105
|
+
}) => id)
|
|
2164
2106
|
});
|
|
2165
2107
|
const choice = strategy.type === "images" ? strategy.choice : void 0;
|
|
2166
2108
|
useEffect(() => {
|
|
@@ -2172,7 +2114,9 @@ function RenderCanvas({
|
|
|
2172
2114
|
if (defaultChoices) {
|
|
2173
2115
|
for (const choice2 of defaultChoices) {
|
|
2174
2116
|
if (typeof choice2.opacity !== "undefined") {
|
|
2175
|
-
helper.applyStyles({
|
|
2117
|
+
helper.applyStyles({
|
|
2118
|
+
id: choice2.id
|
|
2119
|
+
}, "atlas", {
|
|
2176
2120
|
opacity: choice2.opacity
|
|
2177
2121
|
});
|
|
2178
2122
|
}
|
|
@@ -2184,66 +2128,87 @@ function RenderCanvas({
|
|
|
2184
2128
|
onChoiceChange(choice);
|
|
2185
2129
|
}
|
|
2186
2130
|
}, [choice]);
|
|
2187
|
-
const thumbnail = useThumbnail({
|
|
2131
|
+
const thumbnail = useThumbnail({
|
|
2132
|
+
maxWidth: 256,
|
|
2133
|
+
maxHeight: 256
|
|
2134
|
+
});
|
|
2188
2135
|
if (!canvas) {
|
|
2189
2136
|
return null;
|
|
2190
2137
|
}
|
|
2191
2138
|
const accompanyingCanvas = canvas.accompanyingCanvas;
|
|
2192
|
-
const thumbnailFallbackImage = thumbnail && thumbnail.type === "fixed" ? /* @__PURE__ */
|
|
2139
|
+
const thumbnailFallbackImage = thumbnail && thumbnail.type === "fixed" ? /* @__PURE__ */ jsx("world-object", {
|
|
2193
2140
|
height: canvas.height,
|
|
2194
2141
|
width: canvas.width,
|
|
2195
2142
|
x,
|
|
2196
|
-
y
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2143
|
+
y,
|
|
2144
|
+
children: /* @__PURE__ */ jsx("world-image", {
|
|
2145
|
+
uri: thumbnail.id,
|
|
2146
|
+
target: {
|
|
2147
|
+
x: 0,
|
|
2148
|
+
y: 0,
|
|
2149
|
+
width: canvas.width,
|
|
2150
|
+
height: canvas.height
|
|
2151
|
+
},
|
|
2152
|
+
display: thumbnail.width && thumbnail.height ? {
|
|
2153
|
+
width: thumbnail.width,
|
|
2154
|
+
height: thumbnail.height
|
|
2155
|
+
} : void 0
|
|
2156
|
+
})
|
|
2157
|
+
}) : null;
|
|
2205
2158
|
if (strategy.type === "unknown") {
|
|
2206
2159
|
if (thumbnailFallbackImage) {
|
|
2207
2160
|
return thumbnailFallbackImage;
|
|
2208
2161
|
}
|
|
2209
2162
|
throw new Error(strategy.reason || "Unknown image strategy");
|
|
2210
2163
|
}
|
|
2211
|
-
const annotations = /* @__PURE__ */
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2164
|
+
const annotations = /* @__PURE__ */ jsxs(Fragment$1, {
|
|
2165
|
+
children: [virtualPage ? /* @__PURE__ */ jsx(RenderAnnotationPage, {
|
|
2166
|
+
page: virtualPage
|
|
2167
|
+
}) : null, strategy.annotations && strategy.annotations.pages ? strategy.annotations.pages.map((page) => {
|
|
2168
|
+
return /* @__PURE__ */ jsx(RenderAnnotationPage, {
|
|
2169
|
+
page
|
|
2170
|
+
}, page.id);
|
|
2171
|
+
}) : null, children]
|
|
2172
|
+
});
|
|
2173
|
+
return /* @__PURE__ */ jsxs(Fragment, {
|
|
2174
|
+
children: [/* @__PURE__ */ jsxs("world-object", __spreadProps(__spreadValues({
|
|
2175
|
+
height: canvas.height,
|
|
2176
|
+
width: canvas.width,
|
|
2177
|
+
x,
|
|
2178
|
+
y
|
|
2179
|
+
}, elementProps), {
|
|
2180
|
+
children: [strategy.type === "images" ? /* @__PURE__ */ jsxs(Fragment, {
|
|
2181
|
+
children: [strategy.images.map((image, idx) => {
|
|
2182
|
+
return /* @__PURE__ */ jsx(RenderImage, {
|
|
2183
|
+
isStatic,
|
|
2184
|
+
image,
|
|
2185
|
+
id: image.id,
|
|
2186
|
+
thumbnail: idx === 0 ? thumbnail : void 0,
|
|
2187
|
+
annotations
|
|
2188
|
+
}, image.id);
|
|
2189
|
+
}), renderViewerControls ? /* @__PURE__ */ jsx(CanvasPortal, {
|
|
2190
|
+
overlay: true,
|
|
2191
|
+
children: renderViewerControls(strategy)
|
|
2192
|
+
}) : null]
|
|
2193
|
+
}) : null, strategy.type === "3d-model" ? /* @__PURE__ */ jsx(Model, {
|
|
2194
|
+
model: strategy.model
|
|
2195
|
+
}) : null, strategy.type === "media" ? /* @__PURE__ */ jsx(Fragment, {
|
|
2196
|
+
children: strategy.media.type === "Sound" ? /* @__PURE__ */ jsxs(Audio, {
|
|
2197
|
+
media: strategy.media,
|
|
2198
|
+
children: [thumbnailFallbackImage, renderMediaControls ? renderMediaControls(strategy) : null]
|
|
2199
|
+
}) : strategy.media.type === "Video" ? /* @__PURE__ */ jsxs(Video, {
|
|
2200
|
+
media: strategy.media,
|
|
2201
|
+
children: [thumbnailFallbackImage, renderMediaControls ? renderMediaControls(strategy) : null]
|
|
2202
|
+
}) : null
|
|
2203
|
+
}) : null]
|
|
2204
|
+
}), strategy.type), strategy.type === "media" && strategy.media.type === "Sound" && accompanyingCanvas ? /* @__PURE__ */ jsx(CanvasContext, {
|
|
2205
|
+
canvas: accompanyingCanvas.id,
|
|
2206
|
+
children: /* @__PURE__ */ jsx(RenderCanvas, {
|
|
2207
|
+
renderViewerControls
|
|
2208
|
+
})
|
|
2209
|
+
}) : null]
|
|
2210
|
+
});
|
|
2211
|
+
}
|
|
2247
2212
|
const CanvasPanel = {
|
|
2248
2213
|
RenderImage,
|
|
2249
2214
|
RenderCanvas,
|
|
@@ -2251,33 +2216,45 @@ const CanvasPanel = {
|
|
|
2251
2216
|
RenderAnnotation,
|
|
2252
2217
|
Viewer
|
|
2253
2218
|
};
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2219
|
+
function AnnotationContext({
|
|
2220
|
+
annotation,
|
|
2221
|
+
children
|
|
2222
|
+
}) {
|
|
2223
|
+
return /* @__PURE__ */ jsx(ResourceProvider, {
|
|
2224
|
+
value: {
|
|
2225
|
+
annotation
|
|
2226
|
+
},
|
|
2227
|
+
children
|
|
2228
|
+
});
|
|
2229
|
+
}
|
|
2230
|
+
function CollectionContext({
|
|
2231
|
+
collection,
|
|
2232
|
+
children
|
|
2233
|
+
}) {
|
|
2234
|
+
return /* @__PURE__ */ jsx(ResourceProvider, {
|
|
2235
|
+
value: {
|
|
2236
|
+
collection
|
|
2237
|
+
},
|
|
2238
|
+
children
|
|
2239
|
+
});
|
|
2240
|
+
}
|
|
2241
|
+
function RangeContext({
|
|
2242
|
+
range,
|
|
2243
|
+
children
|
|
2244
|
+
}) {
|
|
2245
|
+
return /* @__PURE__ */ jsx(ResourceProvider, {
|
|
2246
|
+
value: {
|
|
2247
|
+
range
|
|
2248
|
+
},
|
|
2249
|
+
children
|
|
2250
|
+
});
|
|
2251
|
+
}
|
|
2273
2252
|
function useAnnotationsAtTime(time, options = {}) {
|
|
2274
2253
|
const allAnnotations = usePaintingAnnotations(options);
|
|
2275
2254
|
return allAnnotations;
|
|
2276
2255
|
}
|
|
2277
|
-
|
|
2278
2256
|
function useCanvasClock(canvasId, autoplay = false) {
|
|
2279
2257
|
}
|
|
2280
|
-
|
|
2281
2258
|
function useCollection(options, deps = []) {
|
|
2282
2259
|
const { id, selector } = options;
|
|
2283
2260
|
const ctx = useResourceContext();
|
|
@@ -2293,7 +2270,6 @@ function useCollection(options, deps = []) {
|
|
|
2293
2270
|
return collection;
|
|
2294
2271
|
}, [collection, selector, ...deps]);
|
|
2295
2272
|
}
|
|
2296
|
-
|
|
2297
2273
|
function useEventListener(resource, name, listener, scope, deps = []) {
|
|
2298
2274
|
const vault = useVault();
|
|
2299
2275
|
const helper = useMemo(() => createEventsHelper(vault), [vault]);
|
|
@@ -2309,37 +2285,14 @@ function useEventListener(resource, name, listener, scope, deps = []) {
|
|
|
2309
2285
|
};
|
|
2310
2286
|
}, [helper, resource, name, ...deps]);
|
|
2311
2287
|
}
|
|
2312
|
-
|
|
2313
2288
|
function useExistingVault() {
|
|
2314
2289
|
const oldContext = useContext(ReactVaultContext);
|
|
2315
2290
|
return oldContext && oldContext.vault ? oldContext.vault : globalVault();
|
|
2316
2291
|
}
|
|
2317
|
-
|
|
2318
2292
|
function useExternalCollection(idOrRef, options) {
|
|
2319
2293
|
const { id, isLoaded, error, resource, requestId, cached } = useExternalResource(idOrRef, options);
|
|
2320
2294
|
return { id, isLoaded, error, manifest: resource, requestId, cached };
|
|
2321
2295
|
}
|
|
2322
|
-
|
|
2323
|
-
var __async = (__this, __arguments, generator) => {
|
|
2324
|
-
return new Promise((resolve, reject) => {
|
|
2325
|
-
var fulfilled = (value) => {
|
|
2326
|
-
try {
|
|
2327
|
-
step(generator.next(value));
|
|
2328
|
-
} catch (e) {
|
|
2329
|
-
reject(e);
|
|
2330
|
-
}
|
|
2331
|
-
};
|
|
2332
|
-
var rejected = (value) => {
|
|
2333
|
-
try {
|
|
2334
|
-
step(generator.throw(value));
|
|
2335
|
-
} catch (e) {
|
|
2336
|
-
reject(e);
|
|
2337
|
-
}
|
|
2338
|
-
};
|
|
2339
|
-
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
2340
|
-
step((generator = generator.apply(__this, __arguments)).next());
|
|
2341
|
-
});
|
|
2342
|
-
};
|
|
2343
2296
|
function useImageService({ cacheKey } = {}) {
|
|
2344
2297
|
const canvas = useCanvas();
|
|
2345
2298
|
const annotations = usePaintingAnnotations();
|
|
@@ -2373,7 +2326,7 @@ function useImageService({ cacheKey } = {}) {
|
|
|
2373
2326
|
}, [key, cacheKey, canvas]);
|
|
2374
2327
|
const data = status === "success" && _data ? _data : initialData;
|
|
2375
2328
|
useEffect(() => {
|
|
2376
|
-
(() =>
|
|
2329
|
+
(async () => {
|
|
2377
2330
|
try {
|
|
2378
2331
|
if (canvas && annotations.length) {
|
|
2379
2332
|
const annotation = annotations[0];
|
|
@@ -2386,11 +2339,11 @@ function useImageService({ cacheKey } = {}) {
|
|
|
2386
2339
|
setIsFetching(true);
|
|
2387
2340
|
setStatus("loading");
|
|
2388
2341
|
try {
|
|
2389
|
-
const loadedService =
|
|
2342
|
+
const loadedService = await imageService.loadService({
|
|
2390
2343
|
id: firstImageService.id || firstImageService["@id"],
|
|
2391
2344
|
width: firstImageService.width || canvas.width,
|
|
2392
2345
|
height: firstImageService.height || canvas.height
|
|
2393
|
-
})
|
|
2346
|
+
}) || void 0;
|
|
2394
2347
|
setData(loadedService);
|
|
2395
2348
|
setStatus("success");
|
|
2396
2349
|
setIsFetching(false);
|
|
@@ -2403,7 +2356,7 @@ function useImageService({ cacheKey } = {}) {
|
|
|
2403
2356
|
setStatus("error");
|
|
2404
2357
|
setError(err);
|
|
2405
2358
|
}
|
|
2406
|
-
})
|
|
2359
|
+
})();
|
|
2407
2360
|
}, [key, cacheKey]);
|
|
2408
2361
|
return useMemo(() => {
|
|
2409
2362
|
return {
|
|
@@ -2414,7 +2367,6 @@ function useImageService({ cacheKey } = {}) {
|
|
|
2414
2367
|
};
|
|
2415
2368
|
}, [data, isFetching, status, error]);
|
|
2416
2369
|
}
|
|
2417
|
-
|
|
2418
2370
|
function useImageTile() {
|
|
2419
2371
|
const imageService = useImageService();
|
|
2420
2372
|
return {
|
|
@@ -2428,7 +2380,6 @@ function useImageTile() {
|
|
|
2428
2380
|
} : null
|
|
2429
2381
|
};
|
|
2430
2382
|
}
|
|
2431
|
-
|
|
2432
2383
|
function useRange(options = {}, deps = []) {
|
|
2433
2384
|
const { id, selector } = options;
|
|
2434
2385
|
const ctx = useResourceContext();
|
|
@@ -2444,15 +2395,13 @@ function useRange(options = {}, deps = []) {
|
|
|
2444
2395
|
return range;
|
|
2445
2396
|
}, [range, selector, ...deps]);
|
|
2446
2397
|
}
|
|
2447
|
-
|
|
2448
2398
|
function useSearchService() {
|
|
2449
2399
|
const manifest = useManifest();
|
|
2450
2400
|
return manifest ? manifest.service.find((service) => service.profile === "SearchService1" || service.profile === "http://iiif.io/api/search/1/search") : void 0;
|
|
2451
2401
|
}
|
|
2452
|
-
|
|
2453
2402
|
function useStyleHelper() {
|
|
2454
2403
|
const vault = useVault();
|
|
2455
2404
|
return useMemo(() => createStylesHelper(vault), [vault]);
|
|
2456
2405
|
}
|
|
2457
|
-
|
|
2458
|
-
|
|
2406
|
+
export { AnnotationContext, CanvasContext, CanvasPanel, CanvasPortal, CollectionContext, ContextBridge, ImageServiceLoaderContext, ManifestContext, MediaPlayerProvider, OverlayPortalContext, PortalContext, RangeContext, ReactVaultContext, ResourceProvider, ResourceReactContext, SimpleViewerProvider, SimpleViewerReactContext, VaultProvider, ViewerPresetContext, VirtualAnnotationProvider, VisibleCanvasReactContext, emptyActions, expandTarget, flattenAnnotationPageIds, formatTime, getImageStrategy, getPaintables, parseSelector, parseSpecificResource, unknownResponse, unsupportedStrategy, useAnnotation, useAnnotationPageManager, useAnnotationsAtTime, useCanvas, useCanvasClock, useCollection, useContextBridge, useDispatch, useEventListener, useExistingVault, useExternalCollection, useExternalManifest, useExternalResource, useImageService, useImageServiceLoader, useImageTile, useLoadImageService, useManifest, useMediaActions, useMediaElements, useMediaState, usePaintables, usePaintingAnnotations, useRange, useRenderingStrategy, useResourceContext, useResourceEvents, useResources, useSearchService, useSimpleMediaPlayer, useSimpleViewer, useStyleHelper, useStyles, useThumbnail, useVault, useVaultEffect, useVaultSelector, useViewerPreset, useVirtualAnnotationPage, useVirtualAnnotationPageContext, useVisibleCanvases };
|
|
2407
|
+
//# sourceMappingURL=index.mjs.map
|