react-iiif-vault 0.9.12 → 0.9.15
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/features/rendering-strategy/resource-types.d.ts +1 -1
- package/.build/types/index.d.ts +1 -3
- package/dist/bundle/cjs/index.js +3 -11
- package/dist/bundle/cjs/index.js.map +1 -1
- package/dist/bundle/esm/index.mjs +37 -50
- 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 +37 -50
- 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 +5 -5
- package/.build/types/features/rendering-strategy/selector-extensions.d.ts +0 -53
- package/.build/types/utility/expand-target.d.ts +0 -19
- package/.build/types/utility/parse-selector.d.ts +0 -7
|
@@ -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,
|
|
@@ -805,6 +773,25 @@ function useStyles(resource, scope) {
|
|
|
805
773
|
return styles ? scope ? styles[scope] : styles : void 0;
|
|
806
774
|
}, [resource, scope]);
|
|
807
775
|
}
|
|
776
|
+
var __defProp2 = Object.defineProperty;
|
|
777
|
+
var __defProps2 = Object.defineProperties;
|
|
778
|
+
var __getOwnPropDescs2 = Object.getOwnPropertyDescriptors;
|
|
779
|
+
var __getOwnPropSymbols2 = Object.getOwnPropertySymbols;
|
|
780
|
+
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
781
|
+
var __propIsEnum2 = Object.prototype.propertyIsEnumerable;
|
|
782
|
+
var __defNormalProp2 = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
783
|
+
var __spreadValues2 = (a, b) => {
|
|
784
|
+
for (var prop in b || (b = {}))
|
|
785
|
+
if (__hasOwnProp2.call(b, prop))
|
|
786
|
+
__defNormalProp2(a, prop, b[prop]);
|
|
787
|
+
if (__getOwnPropSymbols2)
|
|
788
|
+
for (var prop of __getOwnPropSymbols2(b)) {
|
|
789
|
+
if (__propIsEnum2.call(b, prop))
|
|
790
|
+
__defNormalProp2(a, prop, b[prop]);
|
|
791
|
+
}
|
|
792
|
+
return a;
|
|
793
|
+
};
|
|
794
|
+
var __spreadProps2 = (a, b) => __defProps2(a, __getOwnPropDescs2(b));
|
|
808
795
|
const BOX_SELECTOR = /&?(xywh=)?(pixel:|percent:|pct:)?([0-9]+(?:\.[0-9]+)?),([0-9]+(?:\.[0-9]+)?),([0-9]+(?:\.[0-9]+)?),([0-9]+(?:\.[0-9]+)?)/;
|
|
809
796
|
const TEMPORAL_SELECTOR = /&?(t=)(npt:)?([0-9]+(.[0-9]+)?)?(,([0-9]+(.[0-9]+)?))?/;
|
|
810
797
|
function parseSelector(source) {
|
|
@@ -949,7 +936,7 @@ function expandTarget(target, options = {}) {
|
|
|
949
936
|
if (!fragment) {
|
|
950
937
|
return {
|
|
951
938
|
type: "SpecificResource",
|
|
952
|
-
source:
|
|
939
|
+
source: __spreadProps2(__spreadValues2({}, target), {
|
|
953
940
|
id
|
|
954
941
|
}),
|
|
955
942
|
selector: null,
|
|
@@ -958,7 +945,7 @@ function expandTarget(target, options = {}) {
|
|
|
958
945
|
}
|
|
959
946
|
return expandTarget({
|
|
960
947
|
type: "SpecificResource",
|
|
961
|
-
source:
|
|
948
|
+
source: __spreadProps2(__spreadValues2({}, target), {
|
|
962
949
|
id
|
|
963
950
|
}),
|
|
964
951
|
selector: {
|
|
@@ -1050,7 +1037,7 @@ const RenderAnnotationPage = ({
|
|
|
1050
1037
|
const style = useStyles(page, "atlas");
|
|
1051
1038
|
const html = useStyles(page, "html");
|
|
1052
1039
|
useVaultSelector((state) => page.id ? state.iiif.entities.AnnotationPage[page.id] : null, []);
|
|
1053
|
-
return /* @__PURE__ */ jsx(Fragment
|
|
1040
|
+
return /* @__PURE__ */ jsx(Fragment, {
|
|
1054
1041
|
children: (_a = page.items) == null ? void 0 : _a.map((annotation) => {
|
|
1055
1042
|
return /* @__PURE__ */ jsx(RenderAnnotation, {
|
|
1056
1043
|
id: annotation.id,
|
|
@@ -1071,8 +1058,8 @@ function RenderImage({
|
|
|
1071
1058
|
children
|
|
1072
1059
|
}) {
|
|
1073
1060
|
var _a, _b, _c, _d;
|
|
1074
|
-
return /* @__PURE__ */ jsx(Fragment
|
|
1075
|
-
children: !image.service ? /* @__PURE__ */ jsxs(Fragment
|
|
1061
|
+
return /* @__PURE__ */ jsx(Fragment, {
|
|
1062
|
+
children: !image.service ? /* @__PURE__ */ jsxs(Fragment, {
|
|
1076
1063
|
children: [/* @__PURE__ */ jsx("world-image", {
|
|
1077
1064
|
uri: image.id,
|
|
1078
1065
|
target: image.target.spatial,
|
|
@@ -1081,7 +1068,7 @@ function RenderImage({
|
|
|
1081
1068
|
height: image.height
|
|
1082
1069
|
} : void 0
|
|
1083
1070
|
}), annotations, children]
|
|
1084
|
-
}, "no-service") : /* @__PURE__ */ jsxs(Fragment
|
|
1071
|
+
}, "no-service") : /* @__PURE__ */ jsxs(Fragment, {
|
|
1085
1072
|
children: [/* @__PURE__ */ jsx(TileSet, {
|
|
1086
1073
|
tiles: {
|
|
1087
1074
|
id: image.service.id || image.service["@id"] || "unknown",
|
|
@@ -1956,7 +1943,7 @@ function Audio({
|
|
|
1956
1943
|
}, state, actions] = useSimpleMediaPlayer({
|
|
1957
1944
|
duration: media.duration
|
|
1958
1945
|
});
|
|
1959
|
-
return /* @__PURE__ */ jsx(Fragment, {
|
|
1946
|
+
return /* @__PURE__ */ jsx(Fragment$1, {
|
|
1960
1947
|
children: /* @__PURE__ */ jsx(CanvasPortal, {
|
|
1961
1948
|
children: /* @__PURE__ */ jsxs(MediaPlayerProvider, {
|
|
1962
1949
|
state,
|
|
@@ -1984,7 +1971,7 @@ function Video({
|
|
|
1984
1971
|
duration: media.duration
|
|
1985
1972
|
});
|
|
1986
1973
|
const Component = "div";
|
|
1987
|
-
return /* @__PURE__ */ jsxs(Fragment, {
|
|
1974
|
+
return /* @__PURE__ */ jsxs(Fragment$1, {
|
|
1988
1975
|
children: [/* @__PURE__ */ jsxs(CanvasPortal, {
|
|
1989
1976
|
overlay: true,
|
|
1990
1977
|
children: [/* @__PURE__ */ jsx("style", {
|
|
@@ -2142,7 +2129,7 @@ function RenderCanvas({
|
|
|
2142
2129
|
}
|
|
2143
2130
|
throw new Error(strategy.reason || "Unknown image strategy");
|
|
2144
2131
|
}
|
|
2145
|
-
const annotations = /* @__PURE__ */ jsxs(Fragment
|
|
2132
|
+
const annotations = /* @__PURE__ */ jsxs(Fragment, {
|
|
2146
2133
|
children: [virtualPage ? /* @__PURE__ */ jsx(RenderAnnotationPage, {
|
|
2147
2134
|
page: virtualPage
|
|
2148
2135
|
}) : null, strategy.annotations && strategy.annotations.pages ? strategy.annotations.pages.map((page) => {
|
|
@@ -2151,14 +2138,14 @@ function RenderCanvas({
|
|
|
2151
2138
|
}, page.id);
|
|
2152
2139
|
}) : null, children]
|
|
2153
2140
|
});
|
|
2154
|
-
return /* @__PURE__ */ jsxs(Fragment, {
|
|
2141
|
+
return /* @__PURE__ */ jsxs(Fragment$1, {
|
|
2155
2142
|
children: [/* @__PURE__ */ jsxs("world-object", __spreadProps(__spreadValues({
|
|
2156
2143
|
height: canvas.height,
|
|
2157
2144
|
width: canvas.width,
|
|
2158
2145
|
x,
|
|
2159
2146
|
y
|
|
2160
2147
|
}, elementProps), {
|
|
2161
|
-
children: [strategy.type === "images" ? /* @__PURE__ */ jsxs(Fragment, {
|
|
2148
|
+
children: [strategy.type === "images" ? /* @__PURE__ */ jsxs(Fragment$1, {
|
|
2162
2149
|
children: [strategy.images.map((image, idx) => {
|
|
2163
2150
|
return /* @__PURE__ */ jsx(RenderImage, {
|
|
2164
2151
|
isStatic,
|
|
@@ -2173,7 +2160,7 @@ function RenderCanvas({
|
|
|
2173
2160
|
}) : null]
|
|
2174
2161
|
}) : null, strategy.type === "3d-model" ? /* @__PURE__ */ jsx(Model, {
|
|
2175
2162
|
model: strategy.model
|
|
2176
|
-
}) : null, strategy.type === "media" ? /* @__PURE__ */ jsx(Fragment, {
|
|
2163
|
+
}) : null, strategy.type === "media" ? /* @__PURE__ */ jsx(Fragment$1, {
|
|
2177
2164
|
children: strategy.media.type === "Sound" ? /* @__PURE__ */ jsxs(Audio, {
|
|
2178
2165
|
media: strategy.media,
|
|
2179
2166
|
children: [thumbnailFallbackImage, renderMediaControls ? renderMediaControls(strategy) : null]
|