mirador
Version:
An open-source, web-based 'multi-up' viewer that supports zoom-pan-rotate functionality, ability to display/compare simple images, and images with annotations.
138 lines (137 loc) • 3.03 kB
JavaScript
import { f as e, h as t } from "./getters-B4oepJRC.js";
import { t as n } from "./action-types-DjIbTE-A.js";
//#region src/state/actions/window.js
function r(e, t = !1) {
return {
pan: t,
type: n.FOCUS_WINDOW,
windowId: e
};
}
function i({ companionWindows: r, manifest: i, ...a }) {
return (o, s) => {
let { config: c, workspace: { windowIds: l = [] } } = e(s()), u = l.length, d = a.id || `window-${t()}`, f = `cw-${t()}`, p = [{
content: "thumbnailNavigation",
default: !0,
id: f,
position: a.thumbnailNavigationPosition || c.thumbnailNavigation.defaultPosition,
windowId: d
}, ...(r || []).map((e, n) => ({
...e,
id: `cw-${t()}`
}))];
(a.sideBarPanel || c.window.defaultSideBarPanel || c.window.sideBarPanel) && p.unshift({
content: a.sideBarPanel || a.defaultSearchQuery && "search" || c.window.defaultSideBarPanel || c.window.sideBarPanel,
default: !0,
id: `cw-${t()}`,
position: "left",
windowId: d
});
let m = {
canvasId: void 0,
collectionIndex: 0,
companionAreaOpen: !0,
companionWindowIds: p.map((e) => e.id),
draggingEnabled: !0,
highlightAllAnnotations: c.window.highlightAllAnnotations || !1,
id: d,
manifestId: null,
maximized: !1,
rangeId: null,
rotation: null,
selectedAnnotations: {},
sideBarOpen: c.window.sideBarOpenByDefault === void 0 ? c.window.sideBarOpen || !!a.defaultSearchQuery : c.window.sideBarOpenByDefault || !!a.defaultSearchQuery,
sideBarPanel: a.sideBarPanel || c.window.defaultSideBarPanel || c.window.sideBarPanel,
thumbnailNavigationId: f
};
o({
companionWindows: p,
elasticLayout: {
...c.window.elastic || {
height: 400,
width: 480
},
x: 200 + (Math.floor(u / 10) * 50 + u * 30 % 300),
y: 200 + u * 50 % 300
},
manifest: i,
type: n.ADD_WINDOW,
window: {
...m,
...a
}
});
};
}
function a(e, t) {
return {
id: e,
payload: t,
type: n.UPDATE_WINDOW
};
}
function o(e) {
return {
type: n.MAXIMIZE_WINDOW,
windowId: e
};
}
function s(e) {
return {
type: n.MINIMIZE_WINDOW,
windowId: e
};
}
function c(e, t) {
return {
id: e,
payload: { companionAreaOpen: t },
type: n.UPDATE_WINDOW
};
}
function l(e) {
return {
type: n.REMOVE_WINDOW,
windowId: e
};
}
function u(e) {
return {
type: n.TOGGLE_WINDOW_SIDE_BAR,
windowId: e
};
}
function d(e, t) {
return (r, i) => {
let { windows: a } = i(), { thumbnailNavigationId: o } = a[e];
r({
id: o,
payload: { position: t },
type: n.UPDATE_COMPANION_WINDOW
});
};
}
function f(e, t) {
return {
type: n.SET_WINDOW_VIEW_TYPE,
viewType: t,
windowId: e
};
}
function p(e, t = [], r) {
return {
dialogCollectionPath: t,
manifestId: e,
type: n.SHOW_COLLECTION_DIALOG,
windowId: r
};
}
function m(e) {
return {
type: n.HIDE_COLLECTION_DIALOG,
windowId: e
};
}
//#endregion
export { s as a, d as c, u as d, a as f, o as i, f as l, r as n, l as o, m as r, c as s, i as t, p as u };
//# sourceMappingURL=window-COQOIAli.js.map