react-iiif-vault 0.9.13 → 0.9.14
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/dist/bundle/cjs/index.js +3 -11
- package/dist/bundle/cjs/index.js.map +1 -1
- package/dist/bundle/esm/index.mjs +16 -48
- package/dist/bundle/esm/index.mjs.map +1 -1
- package/dist/canvas-panel/cjs/canvas-panel.js +3 -11
- package/dist/canvas-panel/cjs/canvas-panel.js.map +1 -1
- package/dist/canvas-panel/esm/canvas-panel.mjs +16 -48
- package/dist/canvas-panel/esm/canvas-panel.mjs.map +1 -1
- package/dist/index.umd.js +27 -35
- package/dist/index.umd.js.map +1 -1
- package/package.json +2 -2
|
@@ -30,18 +30,19 @@ var __objRest = (source, exclude) => {
|
|
|
30
30
|
return target;
|
|
31
31
|
};
|
|
32
32
|
import * as React from "react";
|
|
33
|
-
import React__default, { useContext, useMemo, useState, useEffect, createContext, useCallback, useRef, useLayoutEffect, Fragment
|
|
33
|
+
import React__default, { useContext, useMemo, useState, useEffect, createContext, useCallback, useRef, useLayoutEffect, Fragment, useReducer } from "react";
|
|
34
34
|
import { AtlasAuto, mergeStyles, RegionHighlight, TileSet } from "@atlas-viewer/atlas";
|
|
35
|
+
import { jsx, jsxs, Fragment as Fragment$1 } from "react/jsx-runtime";
|
|
35
36
|
import { globalVault, Vault } from "@iiif/vault";
|
|
36
37
|
import { createAction } from "typesafe-actions";
|
|
37
38
|
import require$$0 from "react-dom";
|
|
38
39
|
import { ImageServiceLoader, getImageServices, getFixedSizeFromImage } from "@atlas-viewer/iiif-image-api";
|
|
39
|
-
function _setPrototypeOf(o,
|
|
40
|
-
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf2(o2,
|
|
41
|
-
o2.__proto__ =
|
|
40
|
+
function _setPrototypeOf(o, p) {
|
|
41
|
+
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf2(o2, p2) {
|
|
42
|
+
o2.__proto__ = p2;
|
|
42
43
|
return o2;
|
|
43
44
|
};
|
|
44
|
-
return _setPrototypeOf(o,
|
|
45
|
+
return _setPrototypeOf(o, p);
|
|
45
46
|
}
|
|
46
47
|
function _inheritsLoose(subClass, superClass) {
|
|
47
48
|
subClass.prototype = Object.create(superClass.prototype);
|
|
@@ -125,39 +126,6 @@ var ErrorBoundary = /* @__PURE__ */ function(_React$Component) {
|
|
|
125
126
|
};
|
|
126
127
|
return ErrorBoundary2;
|
|
127
128
|
}(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;
|
|
161
129
|
const defaultResourceContext = {
|
|
162
130
|
collection: void 0,
|
|
163
131
|
manifest: void 0,
|
|
@@ -1069,7 +1037,7 @@ const RenderAnnotationPage = ({
|
|
|
1069
1037
|
const style = useStyles(page, "atlas");
|
|
1070
1038
|
const html = useStyles(page, "html");
|
|
1071
1039
|
useVaultSelector((state) => page.id ? state.iiif.entities.AnnotationPage[page.id] : null, []);
|
|
1072
|
-
return /* @__PURE__ */ jsx(Fragment
|
|
1040
|
+
return /* @__PURE__ */ jsx(Fragment, {
|
|
1073
1041
|
children: (_a = page.items) == null ? void 0 : _a.map((annotation) => {
|
|
1074
1042
|
return /* @__PURE__ */ jsx(RenderAnnotation, {
|
|
1075
1043
|
id: annotation.id,
|
|
@@ -1090,8 +1058,8 @@ function RenderImage({
|
|
|
1090
1058
|
children
|
|
1091
1059
|
}) {
|
|
1092
1060
|
var _a, _b, _c, _d;
|
|
1093
|
-
return /* @__PURE__ */ jsx(Fragment
|
|
1094
|
-
children: !image.service ? /* @__PURE__ */ jsxs(Fragment
|
|
1061
|
+
return /* @__PURE__ */ jsx(Fragment, {
|
|
1062
|
+
children: !image.service ? /* @__PURE__ */ jsxs(Fragment, {
|
|
1095
1063
|
children: [/* @__PURE__ */ jsx("world-image", {
|
|
1096
1064
|
uri: image.id,
|
|
1097
1065
|
target: image.target.spatial,
|
|
@@ -1100,7 +1068,7 @@ function RenderImage({
|
|
|
1100
1068
|
height: image.height
|
|
1101
1069
|
} : void 0
|
|
1102
1070
|
}), annotations, children]
|
|
1103
|
-
}, "no-service") : /* @__PURE__ */ jsxs(Fragment
|
|
1071
|
+
}, "no-service") : /* @__PURE__ */ jsxs(Fragment, {
|
|
1104
1072
|
children: [/* @__PURE__ */ jsx(TileSet, {
|
|
1105
1073
|
tiles: {
|
|
1106
1074
|
id: image.service.id || image.service["@id"] || "unknown",
|
|
@@ -1975,7 +1943,7 @@ function Audio({
|
|
|
1975
1943
|
}, state, actions] = useSimpleMediaPlayer({
|
|
1976
1944
|
duration: media.duration
|
|
1977
1945
|
});
|
|
1978
|
-
return /* @__PURE__ */ jsx(Fragment, {
|
|
1946
|
+
return /* @__PURE__ */ jsx(Fragment$1, {
|
|
1979
1947
|
children: /* @__PURE__ */ jsx(CanvasPortal, {
|
|
1980
1948
|
children: /* @__PURE__ */ jsxs(MediaPlayerProvider, {
|
|
1981
1949
|
state,
|
|
@@ -2003,7 +1971,7 @@ function Video({
|
|
|
2003
1971
|
duration: media.duration
|
|
2004
1972
|
});
|
|
2005
1973
|
const Component = "div";
|
|
2006
|
-
return /* @__PURE__ */ jsxs(Fragment, {
|
|
1974
|
+
return /* @__PURE__ */ jsxs(Fragment$1, {
|
|
2007
1975
|
children: [/* @__PURE__ */ jsxs(CanvasPortal, {
|
|
2008
1976
|
overlay: true,
|
|
2009
1977
|
children: [/* @__PURE__ */ jsx("style", {
|
|
@@ -2161,7 +2129,7 @@ function RenderCanvas({
|
|
|
2161
2129
|
}
|
|
2162
2130
|
throw new Error(strategy.reason || "Unknown image strategy");
|
|
2163
2131
|
}
|
|
2164
|
-
const annotations = /* @__PURE__ */ jsxs(Fragment
|
|
2132
|
+
const annotations = /* @__PURE__ */ jsxs(Fragment, {
|
|
2165
2133
|
children: [virtualPage ? /* @__PURE__ */ jsx(RenderAnnotationPage, {
|
|
2166
2134
|
page: virtualPage
|
|
2167
2135
|
}) : null, strategy.annotations && strategy.annotations.pages ? strategy.annotations.pages.map((page) => {
|
|
@@ -2170,14 +2138,14 @@ function RenderCanvas({
|
|
|
2170
2138
|
}, page.id);
|
|
2171
2139
|
}) : null, children]
|
|
2172
2140
|
});
|
|
2173
|
-
return /* @__PURE__ */ jsxs(Fragment, {
|
|
2141
|
+
return /* @__PURE__ */ jsxs(Fragment$1, {
|
|
2174
2142
|
children: [/* @__PURE__ */ jsxs("world-object", __spreadProps(__spreadValues({
|
|
2175
2143
|
height: canvas.height,
|
|
2176
2144
|
width: canvas.width,
|
|
2177
2145
|
x,
|
|
2178
2146
|
y
|
|
2179
2147
|
}, elementProps), {
|
|
2180
|
-
children: [strategy.type === "images" ? /* @__PURE__ */ jsxs(Fragment, {
|
|
2148
|
+
children: [strategy.type === "images" ? /* @__PURE__ */ jsxs(Fragment$1, {
|
|
2181
2149
|
children: [strategy.images.map((image, idx) => {
|
|
2182
2150
|
return /* @__PURE__ */ jsx(RenderImage, {
|
|
2183
2151
|
isStatic,
|
|
@@ -2192,7 +2160,7 @@ function RenderCanvas({
|
|
|
2192
2160
|
}) : null]
|
|
2193
2161
|
}) : null, strategy.type === "3d-model" ? /* @__PURE__ */ jsx(Model, {
|
|
2194
2162
|
model: strategy.model
|
|
2195
|
-
}) : null, strategy.type === "media" ? /* @__PURE__ */ jsx(Fragment, {
|
|
2163
|
+
}) : null, strategy.type === "media" ? /* @__PURE__ */ jsx(Fragment$1, {
|
|
2196
2164
|
children: strategy.media.type === "Sound" ? /* @__PURE__ */ jsxs(Audio, {
|
|
2197
2165
|
media: strategy.media,
|
|
2198
2166
|
children: [thumbnailFallbackImage, renderMediaControls ? renderMediaControls(strategy) : null]
|