@pdf-viewer/react
Version:
A react-pdf-viewer component for React and Next.js. Suitable for react-pdf document.
72 lines (71 loc) • 3.06 kB
JavaScript
import { jsx as t, jsxs as S } from "react/jsx-runtime";
import { useFullScreenContext as T } from "../../../contexts/FullScreenContext.js";
import { UIButton as d } from "../../ui/Button.js";
import { FullScreenIcon as u } from "../../icons/FullScreenIcon.js";
import { useToolbarComponentContext as x } from "../../../contexts/ToolbarComponentContext.js";
import { useIconContext as C } from "../../../contexts/IconContext.js";
import { useViewportContext as F } from "../../../contexts/ViewportContext.js";
import { MenuItem as I } from "./MenuItem.js";
import c from "../../ui/RPTooltip.js";
import { useLocalizationContext as h } from "../../../contexts/LocalizationContext.js";
import { useIconToolContext as s } from "../../../contexts/IconToolContext.js";
import { useToolComponentContext as b } from "../../../contexts/ToolComponentContext.js";
import "react";
import "../../../utils/hooks/useFullScreen.js";
import "../../../clsx-0c6e471a.js";
import "../../../utils/withRef.js";
import "../../../contexts/LayoutContainerContext.js";
import "../../../index-f563c6f0.js";
import "../../../index-35c7f4a2.js";
import "react-dom";
import "../../../floating-ui.react-dom-6b2fe0df.js";
import "../../../utils/appConsole.js";
import "../../../utils/hooks/useLocalization.js";
import "../../../th_TH-d627cd51.js";
const j = () => {
const { fullScreenIcon: r } = C(), { fullScreenIcon: n } = s();
return r || n || /* @__PURE__ */ t(u, {});
}, p = ({ children: r, className: n, localeMessages: o }) => /* @__PURE__ */ t(c, { className: n, content: o == null ? void 0 : o.fullScreenTooltip, children: r }), k = ({
toggleFullScreen: r,
isSupported: n,
localeMessages: o
}) => /* @__PURE__ */ t(I, { onClick: r, disabled: !n, children: /* @__PURE__ */ S(p, { className: "rp-menu-item", localeMessages: o, children: [
/* @__PURE__ */ t("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ t(u, {}) }),
o == null ? void 0 : o.fullScreenTooltip
] }) }), Z = () => {
const { isFullScreen: r, toggleFullScreen: n, isSupported: o } = T(), { fullscreenTool: l = !0 } = x(), { fullscreenTool: i = !0 } = b(), { isSmallScreen: f } = F(), { localeMessages: e } = h(), m = e == null ? void 0 : e.fullScreenTooltip;
return !l || !i ? null : f ? /* @__PURE__ */ t(
k,
{
isFullScreen: r,
toggleFullScreen: n,
isSupported: o,
localeMessages: e
}
) : typeof l == "function" ? /* @__PURE__ */ t(c, { content: m, children: /* @__PURE__ */ t(
l,
{
isFullScreen: r,
toggleFullScreen: n,
isSupported: o
}
) }) : typeof i == "function" ? /* @__PURE__ */ t(c, { content: m, children: /* @__PURE__ */ t(
i,
{
isFullScreen: r,
toggleFullScreen: n,
isSupported: o
}
) }) : /* @__PURE__ */ t(p, { localeMessages: e, children: /* @__PURE__ */ t(
d,
{
disabled: !o,
onClick: n,
"aria-label": r ? "Exit full screen" : "Enter full screen",
children: /* @__PURE__ */ t(j, {})
}
) });
};
export {
Z as FullScreenTool
};