UNPKG

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.

98 lines (97 loc) 2.81 kB
import { U as e, at as t, ft as n, g as r, lt as i, ut as a } from "./getters-B4oepJRC.js"; import { createContext as o, useContext as s } from "react"; import { jsx as c } from "react/jsx-runtime"; import { styled as l } from "@mui/material/styles"; import u from "@mui/material/Badge"; import d from "@mui/material/IconButton"; import f from "@mui/material/Tooltip"; //#region src/contexts/WorkspaceContext.js var p = /* @__PURE__ */ n(t(), 1), m = o({ current: document.body }), h = l(d, { name: "MiradorMenuButton", slot: "root" })(({ selected: e, theme: t }) => ({ fill: "currentcolor", ...e && { backgroundColor: t.palette.action.selected } })); function g({ "aria-label": e, badge: t = !1, children: n, dispatch: r = () => {}, selected: i = !1, BadgeProps: a = {}, TooltipProps: o = {}, sx: l = {}, ...d }) { let p = s(m), g = /* @__PURE__ */ c(h, { selected: i, "aria-label": e, ...d, sx: l, size: "large", children: t ? /* @__PURE__ */ c(u, { overlap: "rectangular", ...a, children: n }) : n }); return d.disabled ? g : /* @__PURE__ */ c(f, { PopperProps: { container: p?.current }, title: e, ...o, children: g }); } g.propTypes = { "aria-label": p.default.string.isRequired, badge: p.default.bool, BadgeProps: p.default.object, children: p.default.element.isRequired, dispatch: p.default.func, selected: p.default.bool, sx: p.default.object, TooltipProps: p.default.object }; var _ = e(r("MiradorMenuButton"))(g), v = /* @__PURE__ */ a(((e) => { Object.defineProperty(e, "__esModule", { value: !0 }), e.useElementSize = void 0; var t = i(); function n() { var e = (0, t.useState)(null), n = e[0], r = e[1], i = (0, t.useState)({ width: 0, height: 0 }), a = i[0], o = i[1], s = (0, t.useCallback)(function() { n && o({ width: n.offsetWidth, height: n.offsetHeight }); }, [n]); return (typeof window < "u" ? t.useLayoutEffect : t.useEffect)(function() { if (n) { s(); var e = new ResizeObserver(s); return e.observe(n), function() { return e.disconnect(); }; } }, [n, s]), [r, a]; } e.useElementSize = n; })); //#endregion //#region node_modules/merge-refs/dist/index.js function y() { var e = [...arguments].filter(Boolean); return e.length <= 1 ? e[0] || null : function(t) { for (var n = 0, r = e; n < r.length; n++) { var i = r[n]; typeof i == "function" ? i(t) : i && (i.current = t); } }; } //#endregion //#region node_modules/@mui/utils/visuallyHidden/visuallyHidden.mjs var b = { border: 0, clip: "rect(0 0 0 0)", height: "1px", margin: "-1px", overflow: "hidden", padding: 0, position: "absolute", whiteSpace: "nowrap", width: "1px" }; //#endregion export { g as a, _ as i, y as n, m as o, v as r, b as t }; //# sourceMappingURL=visuallyHidden-D8sxji69.js.map