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, useRef, useLayoutEffect, useCallback, Fragment
|
|
33
|
+
import React__default, { useContext, useMemo, useState, useEffect, createContext, useRef, useLayoutEffect, useCallback, 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,
|
|
@@ -649,6 +617,25 @@ function useStyles(resource, scope) {
|
|
|
649
617
|
return styles ? scope ? styles[scope] : styles : void 0;
|
|
650
618
|
}, [resource, scope]);
|
|
651
619
|
}
|
|
620
|
+
var __defProp2 = Object.defineProperty;
|
|
621
|
+
var __defProps2 = Object.defineProperties;
|
|
622
|
+
var __getOwnPropDescs2 = Object.getOwnPropertyDescriptors;
|
|
623
|
+
var __getOwnPropSymbols2 = Object.getOwnPropertySymbols;
|
|
624
|
+
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
625
|
+
var __propIsEnum2 = Object.prototype.propertyIsEnumerable;
|
|
626
|
+
var __defNormalProp2 = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
627
|
+
var __spreadValues2 = (a, b) => {
|
|
628
|
+
for (var prop in b || (b = {}))
|
|
629
|
+
if (__hasOwnProp2.call(b, prop))
|
|
630
|
+
__defNormalProp2(a, prop, b[prop]);
|
|
631
|
+
if (__getOwnPropSymbols2)
|
|
632
|
+
for (var prop of __getOwnPropSymbols2(b)) {
|
|
633
|
+
if (__propIsEnum2.call(b, prop))
|
|
634
|
+
__defNormalProp2(a, prop, b[prop]);
|
|
635
|
+
}
|
|
636
|
+
return a;
|
|
637
|
+
};
|
|
638
|
+
var __spreadProps2 = (a, b) => __defProps2(a, __getOwnPropDescs2(b));
|
|
652
639
|
const BOX_SELECTOR = /&?(xywh=)?(pixel:|percent:|pct:)?([0-9]+(?:\.[0-9]+)?),([0-9]+(?:\.[0-9]+)?),([0-9]+(?:\.[0-9]+)?),([0-9]+(?:\.[0-9]+)?)/;
|
|
653
640
|
const TEMPORAL_SELECTOR = /&?(t=)(npt:)?([0-9]+(.[0-9]+)?)?(,([0-9]+(.[0-9]+)?))?/;
|
|
654
641
|
function parseSelector(source) {
|
|
@@ -793,7 +780,7 @@ function expandTarget(target, options = {}) {
|
|
|
793
780
|
if (!fragment) {
|
|
794
781
|
return {
|
|
795
782
|
type: "SpecificResource",
|
|
796
|
-
source:
|
|
783
|
+
source: __spreadProps2(__spreadValues2({}, target), {
|
|
797
784
|
id
|
|
798
785
|
}),
|
|
799
786
|
selector: null,
|
|
@@ -802,7 +789,7 @@ function expandTarget(target, options = {}) {
|
|
|
802
789
|
}
|
|
803
790
|
return expandTarget({
|
|
804
791
|
type: "SpecificResource",
|
|
805
|
-
source:
|
|
792
|
+
source: __spreadProps2(__spreadValues2({}, target), {
|
|
806
793
|
id
|
|
807
794
|
}),
|
|
808
795
|
selector: {
|
|
@@ -894,7 +881,7 @@ const RenderAnnotationPage = ({
|
|
|
894
881
|
const style = useStyles(page, "atlas");
|
|
895
882
|
const html = useStyles(page, "html");
|
|
896
883
|
useVaultSelector((state) => page.id ? state.iiif.entities.AnnotationPage[page.id] : null, []);
|
|
897
|
-
return /* @__PURE__ */ jsx(Fragment
|
|
884
|
+
return /* @__PURE__ */ jsx(Fragment, {
|
|
898
885
|
children: (_a = page.items) == null ? void 0 : _a.map((annotation) => {
|
|
899
886
|
return /* @__PURE__ */ jsx(RenderAnnotation, {
|
|
900
887
|
id: annotation.id,
|
|
@@ -915,8 +902,8 @@ function RenderImage({
|
|
|
915
902
|
children
|
|
916
903
|
}) {
|
|
917
904
|
var _a, _b, _c, _d;
|
|
918
|
-
return /* @__PURE__ */ jsx(Fragment
|
|
919
|
-
children: !image.service ? /* @__PURE__ */ jsxs(Fragment
|
|
905
|
+
return /* @__PURE__ */ jsx(Fragment, {
|
|
906
|
+
children: !image.service ? /* @__PURE__ */ jsxs(Fragment, {
|
|
920
907
|
children: [/* @__PURE__ */ jsx("world-image", {
|
|
921
908
|
uri: image.id,
|
|
922
909
|
target: image.target.spatial,
|
|
@@ -925,7 +912,7 @@ function RenderImage({
|
|
|
925
912
|
height: image.height
|
|
926
913
|
} : void 0
|
|
927
914
|
}), annotations, children]
|
|
928
|
-
}, "no-service") : /* @__PURE__ */ jsxs(Fragment
|
|
915
|
+
}, "no-service") : /* @__PURE__ */ jsxs(Fragment, {
|
|
929
916
|
children: [/* @__PURE__ */ jsx(TileSet, {
|
|
930
917
|
tiles: {
|
|
931
918
|
id: image.service.id || image.service["@id"] || "unknown",
|
|
@@ -1779,7 +1766,7 @@ function Audio({
|
|
|
1779
1766
|
}, state, actions] = useSimpleMediaPlayer({
|
|
1780
1767
|
duration: media.duration
|
|
1781
1768
|
});
|
|
1782
|
-
return /* @__PURE__ */ jsx(Fragment, {
|
|
1769
|
+
return /* @__PURE__ */ jsx(Fragment$1, {
|
|
1783
1770
|
children: /* @__PURE__ */ jsx(CanvasPortal, {
|
|
1784
1771
|
children: /* @__PURE__ */ jsxs(MediaPlayerProvider, {
|
|
1785
1772
|
state,
|
|
@@ -1807,7 +1794,7 @@ function Video({
|
|
|
1807
1794
|
duration: media.duration
|
|
1808
1795
|
});
|
|
1809
1796
|
const Component = "div";
|
|
1810
|
-
return /* @__PURE__ */ jsxs(Fragment, {
|
|
1797
|
+
return /* @__PURE__ */ jsxs(Fragment$1, {
|
|
1811
1798
|
children: [/* @__PURE__ */ jsxs(CanvasPortal, {
|
|
1812
1799
|
overlay: true,
|
|
1813
1800
|
children: [/* @__PURE__ */ jsx("style", {
|
|
@@ -1965,7 +1952,7 @@ function RenderCanvas({
|
|
|
1965
1952
|
}
|
|
1966
1953
|
throw new Error(strategy.reason || "Unknown image strategy");
|
|
1967
1954
|
}
|
|
1968
|
-
const annotations = /* @__PURE__ */ jsxs(Fragment
|
|
1955
|
+
const annotations = /* @__PURE__ */ jsxs(Fragment, {
|
|
1969
1956
|
children: [virtualPage ? /* @__PURE__ */ jsx(RenderAnnotationPage, {
|
|
1970
1957
|
page: virtualPage
|
|
1971
1958
|
}) : null, strategy.annotations && strategy.annotations.pages ? strategy.annotations.pages.map((page) => {
|
|
@@ -1974,14 +1961,14 @@ function RenderCanvas({
|
|
|
1974
1961
|
}, page.id);
|
|
1975
1962
|
}) : null, children]
|
|
1976
1963
|
});
|
|
1977
|
-
return /* @__PURE__ */ jsxs(Fragment, {
|
|
1964
|
+
return /* @__PURE__ */ jsxs(Fragment$1, {
|
|
1978
1965
|
children: [/* @__PURE__ */ jsxs("world-object", __spreadProps(__spreadValues({
|
|
1979
1966
|
height: canvas.height,
|
|
1980
1967
|
width: canvas.width,
|
|
1981
1968
|
x,
|
|
1982
1969
|
y
|
|
1983
1970
|
}, elementProps), {
|
|
1984
|
-
children: [strategy.type === "images" ? /* @__PURE__ */ jsxs(Fragment, {
|
|
1971
|
+
children: [strategy.type === "images" ? /* @__PURE__ */ jsxs(Fragment$1, {
|
|
1985
1972
|
children: [strategy.images.map((image, idx) => {
|
|
1986
1973
|
return /* @__PURE__ */ jsx(RenderImage, {
|
|
1987
1974
|
isStatic,
|
|
@@ -1996,7 +1983,7 @@ function RenderCanvas({
|
|
|
1996
1983
|
}) : null]
|
|
1997
1984
|
}) : null, strategy.type === "3d-model" ? /* @__PURE__ */ jsx(Model, {
|
|
1998
1985
|
model: strategy.model
|
|
1999
|
-
}) : null, strategy.type === "media" ? /* @__PURE__ */ jsx(Fragment, {
|
|
1986
|
+
}) : null, strategy.type === "media" ? /* @__PURE__ */ jsx(Fragment$1, {
|
|
2000
1987
|
children: strategy.media.type === "Sound" ? /* @__PURE__ */ jsxs(Audio, {
|
|
2001
1988
|
media: strategy.media,
|
|
2002
1989
|
children: [thumbnailFallbackImage, renderMediaControls ? renderMediaControls(strategy) : null]
|