@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.esm.js CHANGED
@@ -1882,6 +1882,20 @@ var ProtectedView = ({
1882
1882
  ] })
1883
1883
  ] }) });
1884
1884
  };
1885
+ var openLinksNewTabPlugin = () => {
1886
+ const onAnnotationLayerRender = (e) => {
1887
+ e.container.querySelectorAll(".rpv-core__annotation--link a").forEach((linkEle) => {
1888
+ const href = linkEle.getAttribute("href");
1889
+ if (href && isExternal(href)) {
1890
+ linkEle.setAttribute("target", "_blank");
1891
+ linkEle.setAttribute("rel", "noopener noreferrer");
1892
+ }
1893
+ });
1894
+ };
1895
+ return {
1896
+ onAnnotationLayerRender
1897
+ };
1898
+ };
1885
1899
  var PdfPreview_default = ({ password, fileUrl, pageNo = 1, scale = 1, isHasThumbnails = true, onSetPassword, onSetPageNo }) => {
1886
1900
  const embedRef = useRef(null);
1887
1901
  const [sizes, setSizes] = useState([0]);
@@ -2013,10 +2027,11 @@ var PdfPreview_default = ({ password, fileUrl, pageNo = 1, scale = 1, isHasThumb
2013
2027
  plugins: [
2014
2028
  pageNavigationPluginInstance,
2015
2029
  thumbnailPluginInstance,
2016
- zoomPluginInstance
2030
+ zoomPluginInstance,
2017
2031
  // printPluginInstance,
2018
2032
  // rotatePluginInstance,
2019
2033
  // searchPluginInstance,
2034
+ openLinksNewTabPlugin()
2020
2035
  ],
2021
2036
  onPageChange,
2022
2037
  renderError,