pdfjs-reader-core 0.2.11 → 0.2.13

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 CHANGED
@@ -7779,10 +7779,10 @@ var init_PDFLoadingScreen = __esm({
7779
7779
  init_utils();
7780
7780
  import_jsx_runtime19 = require("react/jsx-runtime");
7781
7781
  phaseMessages = {
7782
- initializing: "Initializing...",
7783
- fetching: "Loading document...",
7784
- parsing: "Processing pages...",
7785
- rendering: "Preparing view..."
7782
+ initializing: "Preparing viewer",
7783
+ fetching: "Loading document",
7784
+ parsing: "Processing pages",
7785
+ rendering: "Almost ready"
7786
7786
  };
7787
7787
  PDFLoadingScreen = (0, import_react33.memo)(function PDFLoadingScreen2({
7788
7788
  progress,
@@ -7794,95 +7794,224 @@ var init_PDFLoadingScreen = __esm({
7794
7794
  }) {
7795
7795
  const hasProgress = progress !== void 0 && progress >= 0;
7796
7796
  const hasBytes = bytesLoaded !== void 0 && totalBytes !== void 0 && totalBytes > 0;
7797
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
7797
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
7798
7798
  "div",
7799
7799
  {
7800
7800
  className: cn(
7801
7801
  "pdf-loading-screen",
7802
- "flex flex-col items-center justify-center",
7803
- "w-full h-full min-h-[400px]",
7804
- "bg-slate-50 dark:bg-slate-800",
7805
7802
  className
7806
7803
  ),
7804
+ style: {
7805
+ display: "flex",
7806
+ flexDirection: "column",
7807
+ alignItems: "center",
7808
+ justifyContent: "center",
7809
+ width: "100%",
7810
+ height: "100%",
7811
+ minHeight: "400px",
7812
+ background: "linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%)",
7813
+ fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'
7814
+ },
7807
7815
  role: "status",
7808
7816
  "aria-live": "polite",
7809
7817
  "aria-label": phaseMessages[phase],
7810
- children: [
7811
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "pdf-loading-skeleton", children: [
7812
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "pdf-loading-icon", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
7813
- "svg",
7814
- {
7815
- width: "48",
7816
- height: "56",
7817
- viewBox: "0 0 48 56",
7818
- fill: "none",
7819
- xmlns: "http://www.w3.org/2000/svg",
7820
- className: "pdf-document-icon",
7821
- children: [
7822
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
7823
- "path",
7824
- {
7825
- d: "M4 4C4 1.79086 5.79086 0 8 0H30L44 14V52C44 54.2091 42.2091 56 40 56H8C5.79086 56 4 54.2091 4 52V4Z",
7826
- className: "fill-white dark:fill-slate-700"
7827
- }
7828
- ),
7829
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
7830
- "path",
7831
- {
7832
- d: "M30 0L44 14H34C31.7909 14 30 12.2091 30 10V0Z",
7833
- className: "fill-slate-200 dark:fill-slate-600"
7834
- }
7835
- ),
7836
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("rect", { x: "10", y: "22", width: "24", height: "3", rx: "1.5", className: "fill-slate-200 dark:fill-slate-600" }),
7837
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("rect", { x: "10", y: "28", width: "20", height: "3", rx: "1.5", className: "fill-slate-200 dark:fill-slate-600" }),
7838
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("rect", { x: "10", y: "34", width: "22", height: "3", rx: "1.5", className: "fill-slate-200 dark:fill-slate-600" }),
7839
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("rect", { x: "10", y: "40", width: "16", height: "3", rx: "1.5", className: "fill-slate-200 dark:fill-slate-600" }),
7840
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
7841
- "path",
7842
- {
7843
- d: "M4 4C4 1.79086 5.79086 0 8 0H30L44 14V52C44 54.2091 42.2091 56 40 56H8C5.79086 56 4 54.2091 4 52V4Z",
7844
- className: "stroke-slate-300 dark:stroke-slate-500",
7845
- strokeWidth: "1",
7846
- fill: "none"
7847
- }
7848
- )
7849
- ]
7850
- }
7851
- ) }),
7852
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "pdf-skeleton-lines", children: [
7853
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "pdf-skeleton-line pdf-skeleton-line-1" }),
7854
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "pdf-skeleton-line pdf-skeleton-line-2" }),
7855
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "pdf-skeleton-line pdf-skeleton-line-3" })
7856
- ] })
7857
- ] }),
7858
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "pdf-loading-info", children: [
7859
- documentName && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "pdf-loading-document-name", children: documentName }),
7860
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "pdf-loading-message", children: phaseMessages[phase] }),
7861
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "pdf-loading-progress-container", children: [
7862
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "pdf-loading-progress-track", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
7818
+ children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
7819
+ "div",
7820
+ {
7821
+ style: {
7822
+ display: "flex",
7823
+ flexDirection: "column",
7824
+ alignItems: "center",
7825
+ padding: "48px 40px",
7826
+ background: "white",
7827
+ borderRadius: "20px",
7828
+ boxShadow: "0 10px 40px -10px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.05)"
7829
+ },
7830
+ children: [
7831
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
7863
7832
  "div",
7864
7833
  {
7865
- className: cn(
7866
- "pdf-loading-progress-fill",
7867
- !hasProgress && "pdf-loading-progress-indeterminate"
7868
- ),
7869
- style: hasProgress ? { width: `${Math.min(100, progress)}%` } : void 0
7834
+ className: "pdf-loading-icon-container",
7835
+ style: {
7836
+ position: "relative",
7837
+ marginBottom: "32px"
7838
+ },
7839
+ children: [
7840
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
7841
+ "div",
7842
+ {
7843
+ className: "pdf-loading-glow",
7844
+ style: {
7845
+ position: "absolute",
7846
+ top: "50%",
7847
+ left: "50%",
7848
+ width: "120px",
7849
+ height: "120px",
7850
+ transform: "translate(-50%, -50%)",
7851
+ background: "radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, transparent 70%)",
7852
+ borderRadius: "50%"
7853
+ }
7854
+ }
7855
+ ),
7856
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
7857
+ "svg",
7858
+ {
7859
+ width: "72",
7860
+ height: "88",
7861
+ viewBox: "0 0 72 88",
7862
+ fill: "none",
7863
+ xmlns: "http://www.w3.org/2000/svg",
7864
+ className: "pdf-document-icon",
7865
+ style: {
7866
+ position: "relative",
7867
+ zIndex: 1,
7868
+ filter: "drop-shadow(0 8px 16px rgba(0, 0, 0, 0.1))"
7869
+ },
7870
+ children: [
7871
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
7872
+ "path",
7873
+ {
7874
+ d: "M4 8C4 3.58172 7.58172 0 12 0H44L68 24V80C68 84.4183 64.4183 88 60 88H12C7.58172 88 4 84.4183 4 80V8Z",
7875
+ fill: "#ffffff",
7876
+ stroke: "#e2e8f0",
7877
+ strokeWidth: "2"
7878
+ }
7879
+ ),
7880
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
7881
+ "path",
7882
+ {
7883
+ d: "M44 0L68 24H52C47.5817 24 44 20.4183 44 16V0Z",
7884
+ fill: "#dbeafe"
7885
+ }
7886
+ ),
7887
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
7888
+ "rect",
7889
+ {
7890
+ x: "14",
7891
+ y: "36",
7892
+ width: "44",
7893
+ height: "20",
7894
+ rx: "4",
7895
+ fill: "#3b82f6"
7896
+ }
7897
+ ),
7898
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
7899
+ "text",
7900
+ {
7901
+ x: "36",
7902
+ y: "50",
7903
+ textAnchor: "middle",
7904
+ fill: "white",
7905
+ style: {
7906
+ fontSize: "12px",
7907
+ fontWeight: 700,
7908
+ fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'
7909
+ },
7910
+ children: "PDF"
7911
+ }
7912
+ ),
7913
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("rect", { className: "pdf-line-1", x: "14", y: "64", width: "44", height: "4", rx: "2", fill: "#e2e8f0" }),
7914
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("rect", { className: "pdf-line-2", x: "14", y: "72", width: "32", height: "4", rx: "2", fill: "#e2e8f0" })
7915
+ ]
7916
+ }
7917
+ )
7918
+ ]
7870
7919
  }
7871
- ) }),
7872
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "pdf-loading-progress-details", children: [
7873
- hasProgress && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("span", { className: "pdf-loading-progress-percent", children: [
7874
- Math.round(progress),
7875
- "%"
7876
- ] }),
7877
- hasBytes && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("span", { className: "pdf-loading-progress-bytes", children: [
7878
- formatBytes(bytesLoaded),
7879
- " / ",
7880
- formatBytes(totalBytes)
7881
- ] })
7920
+ ),
7921
+ documentName && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
7922
+ "p",
7923
+ {
7924
+ style: {
7925
+ fontSize: "13px",
7926
+ fontWeight: 500,
7927
+ color: "#64748b",
7928
+ marginBottom: "8px",
7929
+ maxWidth: "240px",
7930
+ overflow: "hidden",
7931
+ textOverflow: "ellipsis",
7932
+ whiteSpace: "nowrap",
7933
+ textAlign: "center"
7934
+ },
7935
+ children: documentName
7936
+ }
7937
+ ),
7938
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
7939
+ "p",
7940
+ {
7941
+ style: {
7942
+ fontSize: "16px",
7943
+ fontWeight: 600,
7944
+ color: "#1e293b",
7945
+ marginBottom: "24px",
7946
+ textAlign: "center"
7947
+ },
7948
+ children: [
7949
+ phaseMessages[phase],
7950
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("span", { className: "pdf-loading-dots", style: { display: "inline-block", width: "24px", textAlign: "left" }, children: [
7951
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "pdf-dot-1", children: "." }),
7952
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "pdf-dot-2", children: "." }),
7953
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "pdf-dot-3", children: "." })
7954
+ ] })
7955
+ ]
7956
+ }
7957
+ ),
7958
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { style: { width: "240px" }, children: [
7959
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
7960
+ "div",
7961
+ {
7962
+ style: {
7963
+ width: "100%",
7964
+ height: "8px",
7965
+ borderRadius: "4px",
7966
+ background: "#e2e8f0",
7967
+ overflow: "hidden"
7968
+ },
7969
+ children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
7970
+ "div",
7971
+ {
7972
+ className: cn(
7973
+ "pdf-loading-progress-fill",
7974
+ !hasProgress && "pdf-loading-progress-indeterminate"
7975
+ ),
7976
+ style: {
7977
+ height: "100%",
7978
+ borderRadius: "4px",
7979
+ background: "linear-gradient(90deg, #3b82f6 0%, #60a5fa 50%, #3b82f6 100%)",
7980
+ backgroundSize: "200% 100%",
7981
+ transition: "width 300ms ease-out",
7982
+ ...hasProgress ? { width: `${Math.min(100, progress)}%` } : {}
7983
+ }
7984
+ }
7985
+ )
7986
+ }
7987
+ ),
7988
+ (hasProgress || hasBytes) && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
7989
+ "div",
7990
+ {
7991
+ style: {
7992
+ display: "flex",
7993
+ justifyContent: "space-between",
7994
+ marginTop: "12px",
7995
+ fontSize: "13px",
7996
+ fontWeight: 500
7997
+ },
7998
+ children: [
7999
+ hasProgress && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("span", { style: { color: "#3b82f6" }, children: [
8000
+ Math.round(progress),
8001
+ "%"
8002
+ ] }),
8003
+ hasBytes && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("span", { style: { color: "#94a3b8", fontFamily: "ui-monospace, monospace", fontSize: "12px" }, children: [
8004
+ formatBytes(bytesLoaded),
8005
+ " / ",
8006
+ formatBytes(totalBytes)
8007
+ ] })
8008
+ ]
8009
+ }
8010
+ )
7882
8011
  ] })
7883
- ] })
7884
- ] })
7885
- ]
8012
+ ]
8013
+ }
8014
+ )
7886
8015
  }
7887
8016
  );
7888
8017
  });