UNPKG

@pdf-viewer/react

Version:

A react-pdf-viewer component for React and Next.js. Suitable for react-pdf document.

56 lines (55 loc) 2.79 kB
import { jsx as o, Fragment as T, jsxs as e } from "react/jsx-runtime"; import p from "../../../../ui/RPTooltip.js"; import { G as f } from "../../../../../index-3bf64864.js"; import { TextSelectionDefaultIcon as x } from "../../../../icons/TextSelectionDefaultIcon.js"; import { HandModeDefaultIcon as S } from "../../../../icons/HandModeDefaultIcon.js"; import { CheckIcon as d } from "../../../../icons/CheckIcon.js"; import { MenuItem as l } from "../../MenuItem.js"; import { SelectionMode as i } from "../../../../../utils/types.js"; import { MenuSeparator as N } from "../../MenuSeparator.js"; import { useSelectionModeContext as I } from "../../../../../contexts/SelectionModeContext.js"; import { useLocalizationContext as b } from "../../../../../contexts/LocalizationContext.js"; import "react"; import "../../../../../index-c9a2990a.js"; import "react-dom"; import "../../../../../floating-ui.react-dom-d22a10b4.js"; import "../../../../../utils/withRef.js"; import "../../../../../clsx-0c6e471a.js"; import "../../../../../de_DE-a553b162.js"; import "../../../../../utils/appConsole.js"; import "../../../../../utils/hooks/useLocalization.js"; const J = (a) => { const { icons: u, isToolVisible: h = !0 } = a, { textSelectionIcon: n, handModeIcon: m } = u ?? {}, { selectionMode: r, setSelectionMode: c } = I(), { localeMessages: t } = b(); return h ? /* @__PURE__ */ o(T, { children: /* @__PURE__ */ e(f, { children: [ /* @__PURE__ */ o( l, { onClick: () => c(i.TEXT), "aria-label": t == null ? void 0 : t.textSelectionTooltip, "aria-checked": r === i.TEXT, children: /* @__PURE__ */ e(p, { className: "rp-menu-item", content: t == null ? void 0 : t.textSelectionTooltip, children: [ /* @__PURE__ */ o("div", { className: "rp-menu-item-left", children: n || /* @__PURE__ */ o(x, { "aria-hidden": "true" }) }), t == null ? void 0 : t.textSelectionLabel, r === i.TEXT ? /* @__PURE__ */ o(d, { className: "rp-menu-item-right", "aria-hidden": "true" }) : null ] }) } ), /* @__PURE__ */ o( l, { onClick: () => c(i.HAND), "aria-label": t == null ? void 0 : t.handToolTooltip, "aria-checked": r === i.HAND, children: /* @__PURE__ */ e(p, { className: "rp-menu-item", content: t == null ? void 0 : t.handToolTooltip, children: [ /* @__PURE__ */ o("div", { className: "rp-menu-item-left", children: m || /* @__PURE__ */ o(S, { "aria-hidden": "true" }) }), t == null ? void 0 : t.handToolLabel, r === i.HAND ? /* @__PURE__ */ o(d, { className: "rp-menu-item-right", "aria-hidden": "true" }) : null ] }) } ), /* @__PURE__ */ o(N, {}) ] }) }) : null; }; export { J as SelectionModeTool };