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