@page-speed/lightbox 0.1.4 → 0.1.5

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.
@@ -18069,7 +18069,7 @@ var require_pdf = __commonJS({
18069
18069
  }
18070
18070
  });
18071
18071
 
18072
- // node_modules/.pnpm/@page-speed+pdf-viewer@0.1.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@page-speed/pdf-viewer/dist/index.js
18072
+ // node_modules/.pnpm/@page-speed+pdf-viewer@0.1.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@page-speed/pdf-viewer/dist/index.js
18073
18073
  var dist_exports = {};
18074
18074
  __export(dist_exports, {
18075
18075
  PDFCanvas: () => PDFCanvas,
@@ -18102,7 +18102,7 @@ import { jsx as jsx22, jsxs } from "react/jsx-runtime";
18102
18102
  import { useEffect as useEffect32, useState as useState7 } from "react";
18103
18103
  import { jsx as jsx32, jsxs as jsxs2 } from "react/jsx-runtime";
18104
18104
  import { jsx as jsx42, jsxs as jsxs3 } from "react/jsx-runtime";
18105
- function usePDFDocument(url, onError) {
18105
+ function usePDFDocument(url, onError, withCredentials = false) {
18106
18106
  const [document2, setDocument] = useState5(null);
18107
18107
  const [loading, setLoading] = useState5(true);
18108
18108
  const [error, setError] = useState5(null);
@@ -18122,7 +18122,7 @@ function usePDFDocument(url, onError) {
18122
18122
  }
18123
18123
  const loadingTask = pdfjsLib.getDocument({
18124
18124
  url,
18125
- withCredentials: true,
18125
+ withCredentials,
18126
18126
  rangeChunkSize: 65536
18127
18127
  // For linearized PDFs
18128
18128
  });
@@ -18154,7 +18154,7 @@ function usePDFDocument(url, onError) {
18154
18154
  }
18155
18155
  };
18156
18156
  loadPDF();
18157
- }, [url, onError]);
18157
+ }, [url, onError, withCredentials]);
18158
18158
  return { document: document2, pdfDoc, loading, error };
18159
18159
  }
18160
18160
  function usePageState({
@@ -18544,9 +18544,10 @@ function PDFViewer({
18544
18544
  enablePrint = true,
18545
18545
  enableFullscreen = true,
18546
18546
  initialPage = 1,
18547
- initialZoom = "auto"
18547
+ initialZoom = "auto",
18548
+ withCredentials = false
18548
18549
  } = config;
18549
- const { document: document2, pdfDoc, loading, error } = usePDFDocument(url, onError);
18550
+ const { document: document2, pdfDoc, loading, error } = usePDFDocument(url, onError, withCredentials);
18550
18551
  const pageState = usePageState({
18551
18552
  totalPages: document2?.numPages || 0,
18552
18553
  initialPage
@@ -18685,7 +18686,7 @@ function createProgressiveFetchHandler(onProgress) {
18685
18686
  }
18686
18687
  var DEFAULT_SCALE, CACHE_SIZE, MIN_ZOOM, MAX_ZOOM, ZOOM_STEP, PDFViewer_default, linearizedPDFConfig;
18687
18688
  var init_dist = __esm({
18688
- "node_modules/.pnpm/@page-speed+pdf-viewer@0.1.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@page-speed/pdf-viewer/dist/index.js"() {
18689
+ "node_modules/.pnpm/@page-speed+pdf-viewer@0.1.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@page-speed/pdf-viewer/dist/index.js"() {
18689
18690
  "use client";
18690
18691
  DEFAULT_SCALE = 1.5;
18691
18692
  CACHE_SIZE = 50 * 1024 * 1024;
package/dist/index.cjs CHANGED
@@ -18065,7 +18065,7 @@ var require_pdf = __commonJS({
18065
18065
  }
18066
18066
  });
18067
18067
 
18068
- // node_modules/.pnpm/@page-speed+pdf-viewer@0.1.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@page-speed/pdf-viewer/dist/index.js
18068
+ // node_modules/.pnpm/@page-speed+pdf-viewer@0.1.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@page-speed/pdf-viewer/dist/index.js
18069
18069
  var dist_exports = {};
18070
18070
  __export(dist_exports, {
18071
18071
  PDFCanvas: () => PDFCanvas,
@@ -18086,7 +18086,7 @@ __export(dist_exports, {
18086
18086
  useSearch: () => useSearch,
18087
18087
  useZoom: () => useZoom
18088
18088
  });
18089
- function usePDFDocument(url, onError) {
18089
+ function usePDFDocument(url, onError, withCredentials = false) {
18090
18090
  const [document2, setDocument] = (0, import_react9.useState)(null);
18091
18091
  const [loading, setLoading] = (0, import_react9.useState)(true);
18092
18092
  const [error, setError] = (0, import_react9.useState)(null);
@@ -18106,7 +18106,7 @@ function usePDFDocument(url, onError) {
18106
18106
  }
18107
18107
  const loadingTask = pdfjsLib.getDocument({
18108
18108
  url,
18109
- withCredentials: true,
18109
+ withCredentials,
18110
18110
  rangeChunkSize: 65536
18111
18111
  // For linearized PDFs
18112
18112
  });
@@ -18138,7 +18138,7 @@ function usePDFDocument(url, onError) {
18138
18138
  }
18139
18139
  };
18140
18140
  loadPDF();
18141
- }, [url, onError]);
18141
+ }, [url, onError, withCredentials]);
18142
18142
  return { document: document2, pdfDoc, loading, error };
18143
18143
  }
18144
18144
  function usePageState({
@@ -18528,9 +18528,10 @@ function PDFViewer({
18528
18528
  enablePrint = true,
18529
18529
  enableFullscreen = true,
18530
18530
  initialPage = 1,
18531
- initialZoom = "auto"
18531
+ initialZoom = "auto",
18532
+ withCredentials = false
18532
18533
  } = config;
18533
- const { document: document2, pdfDoc, loading, error } = usePDFDocument(url, onError);
18534
+ const { document: document2, pdfDoc, loading, error } = usePDFDocument(url, onError, withCredentials);
18534
18535
  const pageState = usePageState({
18535
18536
  totalPages: document2?.numPages || 0,
18536
18537
  initialPage
@@ -18669,7 +18670,7 @@ function createProgressiveFetchHandler(onProgress) {
18669
18670
  }
18670
18671
  var import_react8, import_react9, import_react10, import_react11, import_react12, import_react13, import_react14, import_jsx_runtime5, import_jsx_runtime6, import_react15, import_jsx_runtime7, import_jsx_runtime8, DEFAULT_SCALE, CACHE_SIZE, MIN_ZOOM, MAX_ZOOM, ZOOM_STEP, PDFViewer_default, linearizedPDFConfig;
18671
18672
  var init_dist = __esm({
18672
- "node_modules/.pnpm/@page-speed+pdf-viewer@0.1.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@page-speed/pdf-viewer/dist/index.js"() {
18673
+ "node_modules/.pnpm/@page-speed+pdf-viewer@0.1.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@page-speed/pdf-viewer/dist/index.js"() {
18673
18674
  "use client";
18674
18675
  import_react8 = require("react");
18675
18676
  import_react9 = require("react");
package/dist/index.js CHANGED
@@ -18069,7 +18069,7 @@ var require_pdf = __commonJS({
18069
18069
  }
18070
18070
  });
18071
18071
 
18072
- // node_modules/.pnpm/@page-speed+pdf-viewer@0.1.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@page-speed/pdf-viewer/dist/index.js
18072
+ // node_modules/.pnpm/@page-speed+pdf-viewer@0.1.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@page-speed/pdf-viewer/dist/index.js
18073
18073
  var dist_exports = {};
18074
18074
  __export(dist_exports, {
18075
18075
  PDFCanvas: () => PDFCanvas,
@@ -18102,7 +18102,7 @@ import { jsx as jsx22, jsxs } from "react/jsx-runtime";
18102
18102
  import { useEffect as useEffect32, useState as useState7 } from "react";
18103
18103
  import { jsx as jsx32, jsxs as jsxs2 } from "react/jsx-runtime";
18104
18104
  import { jsx as jsx42, jsxs as jsxs3 } from "react/jsx-runtime";
18105
- function usePDFDocument(url, onError) {
18105
+ function usePDFDocument(url, onError, withCredentials = false) {
18106
18106
  const [document2, setDocument] = useState5(null);
18107
18107
  const [loading, setLoading] = useState5(true);
18108
18108
  const [error, setError] = useState5(null);
@@ -18122,7 +18122,7 @@ function usePDFDocument(url, onError) {
18122
18122
  }
18123
18123
  const loadingTask = pdfjsLib.getDocument({
18124
18124
  url,
18125
- withCredentials: true,
18125
+ withCredentials,
18126
18126
  rangeChunkSize: 65536
18127
18127
  // For linearized PDFs
18128
18128
  });
@@ -18154,7 +18154,7 @@ function usePDFDocument(url, onError) {
18154
18154
  }
18155
18155
  };
18156
18156
  loadPDF();
18157
- }, [url, onError]);
18157
+ }, [url, onError, withCredentials]);
18158
18158
  return { document: document2, pdfDoc, loading, error };
18159
18159
  }
18160
18160
  function usePageState({
@@ -18544,9 +18544,10 @@ function PDFViewer({
18544
18544
  enablePrint = true,
18545
18545
  enableFullscreen = true,
18546
18546
  initialPage = 1,
18547
- initialZoom = "auto"
18547
+ initialZoom = "auto",
18548
+ withCredentials = false
18548
18549
  } = config;
18549
- const { document: document2, pdfDoc, loading, error } = usePDFDocument(url, onError);
18550
+ const { document: document2, pdfDoc, loading, error } = usePDFDocument(url, onError, withCredentials);
18550
18551
  const pageState = usePageState({
18551
18552
  totalPages: document2?.numPages || 0,
18552
18553
  initialPage
@@ -18685,7 +18686,7 @@ function createProgressiveFetchHandler(onProgress) {
18685
18686
  }
18686
18687
  var DEFAULT_SCALE, CACHE_SIZE, MIN_ZOOM, MAX_ZOOM, ZOOM_STEP, PDFViewer_default, linearizedPDFConfig;
18687
18688
  var init_dist = __esm({
18688
- "node_modules/.pnpm/@page-speed+pdf-viewer@0.1.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@page-speed/pdf-viewer/dist/index.js"() {
18689
+ "node_modules/.pnpm/@page-speed+pdf-viewer@0.1.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@page-speed/pdf-viewer/dist/index.js"() {
18689
18690
  "use client";
18690
18691
  DEFAULT_SCALE = 1.5;
18691
18692
  CACHE_SIZE = 50 * 1024 * 1024;
@@ -18069,7 +18069,7 @@ var require_pdf = __commonJS({
18069
18069
  }
18070
18070
  });
18071
18071
 
18072
- // node_modules/.pnpm/@page-speed+pdf-viewer@0.1.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@page-speed/pdf-viewer/dist/index.js
18072
+ // node_modules/.pnpm/@page-speed+pdf-viewer@0.1.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@page-speed/pdf-viewer/dist/index.js
18073
18073
  var dist_exports = {};
18074
18074
  __export(dist_exports, {
18075
18075
  PDFCanvas: () => PDFCanvas,
@@ -18102,7 +18102,7 @@ import { jsx as jsx22, jsxs } from "react/jsx-runtime";
18102
18102
  import { useEffect as useEffect32, useState as useState7 } from "react";
18103
18103
  import { jsx as jsx32, jsxs as jsxs2 } from "react/jsx-runtime";
18104
18104
  import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
18105
- function usePDFDocument(url, onError) {
18105
+ function usePDFDocument(url, onError, withCredentials = false) {
18106
18106
  const [document2, setDocument] = useState3(null);
18107
18107
  const [loading, setLoading] = useState3(true);
18108
18108
  const [error, setError] = useState3(null);
@@ -18122,7 +18122,7 @@ function usePDFDocument(url, onError) {
18122
18122
  }
18123
18123
  const loadingTask = pdfjsLib.getDocument({
18124
18124
  url,
18125
- withCredentials: true,
18125
+ withCredentials,
18126
18126
  rangeChunkSize: 65536
18127
18127
  // For linearized PDFs
18128
18128
  });
@@ -18154,7 +18154,7 @@ function usePDFDocument(url, onError) {
18154
18154
  }
18155
18155
  };
18156
18156
  loadPDF();
18157
- }, [url, onError]);
18157
+ }, [url, onError, withCredentials]);
18158
18158
  return { document: document2, pdfDoc, loading, error };
18159
18159
  }
18160
18160
  function usePageState({
@@ -18544,9 +18544,10 @@ function PDFViewer({
18544
18544
  enablePrint = true,
18545
18545
  enableFullscreen = true,
18546
18546
  initialPage = 1,
18547
- initialZoom = "auto"
18547
+ initialZoom = "auto",
18548
+ withCredentials = false
18548
18549
  } = config;
18549
- const { document: document2, pdfDoc, loading, error } = usePDFDocument(url, onError);
18550
+ const { document: document2, pdfDoc, loading, error } = usePDFDocument(url, onError, withCredentials);
18550
18551
  const pageState = usePageState({
18551
18552
  totalPages: document2?.numPages || 0,
18552
18553
  initialPage
@@ -18685,7 +18686,7 @@ function createProgressiveFetchHandler(onProgress) {
18685
18686
  }
18686
18687
  var DEFAULT_SCALE, CACHE_SIZE, MIN_ZOOM, MAX_ZOOM, ZOOM_STEP, PDFViewer_default, linearizedPDFConfig;
18687
18688
  var init_dist = __esm({
18688
- "node_modules/.pnpm/@page-speed+pdf-viewer@0.1.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@page-speed/pdf-viewer/dist/index.js"() {
18689
+ "node_modules/.pnpm/@page-speed+pdf-viewer@0.1.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@page-speed/pdf-viewer/dist/index.js"() {
18689
18690
  "use client";
18690
18691
  DEFAULT_SCALE = 1.5;
18691
18692
  CACHE_SIZE = 50 * 1024 * 1024;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@page-speed/lightbox",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "High-performance, feature-rich lightbox for OpenSite platform",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",
@@ -80,7 +80,7 @@
80
80
  },
81
81
  "dependencies": {
82
82
  "@page-speed/img": "^0.4.3",
83
- "@page-speed/pdf-viewer": "0.1.2",
83
+ "@page-speed/pdf-viewer": "0.1.3",
84
84
  "clsx": "^2.1.1",
85
85
  "tailwind-merge": "^3.4.0"
86
86
  }