@zero-library/common 2.2.6 → 2.2.7

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/dist/index.cjs.js CHANGED
@@ -1921,6 +1921,20 @@ var ProtectedView = ({
1921
1921
  ] })
1922
1922
  ] }) });
1923
1923
  };
1924
+ var openLinksNewTabPlugin = () => {
1925
+ const onAnnotationLayerRender = (e) => {
1926
+ e.container.querySelectorAll(".rpv-core__annotation--link a").forEach((linkEle) => {
1927
+ const href = linkEle.getAttribute("href");
1928
+ if (href && isExternal(href)) {
1929
+ linkEle.setAttribute("target", "_blank");
1930
+ linkEle.setAttribute("rel", "noopener noreferrer");
1931
+ }
1932
+ });
1933
+ };
1934
+ return {
1935
+ onAnnotationLayerRender
1936
+ };
1937
+ };
1924
1938
  var PdfPreview_default = ({ password, fileUrl, pageNo = 1, scale = 1, isHasThumbnails = true, onSetPassword, onSetPageNo }) => {
1925
1939
  const embedRef = React16.useRef(null);
1926
1940
  const [sizes, setSizes] = React16.useState([0]);
@@ -2052,10 +2066,11 @@ var PdfPreview_default = ({ password, fileUrl, pageNo = 1, scale = 1, isHasThumb
2052
2066
  plugins: [
2053
2067
  pageNavigationPluginInstance,
2054
2068
  thumbnailPluginInstance,
2055
- zoomPluginInstance
2069
+ zoomPluginInstance,
2056
2070
  // printPluginInstance,
2057
2071
  // rotatePluginInstance,
2058
2072
  // searchPluginInstance,
2073
+ openLinksNewTabPlugin()
2059
2074
  ],
2060
2075
  onPageChange,
2061
2076
  renderError,