@chialab/pdfjs-lib 1.0.0-alpha.40 → 1.0.0-alpha.41

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.
@@ -46,6 +46,33 @@ if (!("try" in Promise)) {
46
46
  enumerable: false
47
47
  });
48
48
  }
49
+ if (!URL.parse) {
50
+ Object.defineProperty(URL, "parse", {
51
+ enumerable: false,
52
+ value: function parse(input, base) {
53
+ try {
54
+ return new URL(input, base || globalThis.location && globalThis.location.href);
55
+ } catch (_) {
56
+ if (!globalThis.document || !globalThis.document.createElement) {
57
+ return {};
58
+ }
59
+ var a = globalThis.document.createElement("a");
60
+ a.href = base ? base + input : input;
61
+ return {
62
+ href: a.href,
63
+ protocol: a.protocol,
64
+ hostname: a.hostname,
65
+ host: a.host,
66
+ port: a.port,
67
+ pathname: a.pathname.charAt(0) === "/" ? a.pathname : "/" + a.pathname,
68
+ search: a.search,
69
+ hash: a.hash,
70
+ origin: a.origin || a.protocol + "//" + a.host
71
+ };
72
+ }
73
+ }
74
+ });
75
+ }
49
76
 
50
77
  // src/pdf.js/src/shared/util.js
51
78
  var isNodeJS = typeof process === "object" && process + "" === "[object process]" && !process.versions.nw && !(process.versions.electron && process.type && process.type !== "browser");
@@ -48,7 +48,7 @@ import {
48
48
  updateUrlHash,
49
49
  warn,
50
50
  wrapReason
51
- } from "./chunk-AQCSGHG6.js";
51
+ } from "./chunk-5CXGBP2M.js";
52
52
  import {
53
53
  NodeCMapReaderFactory,
54
54
  NodeCanvasFactory,
@@ -63,7 +63,7 @@ import {
63
63
  utf8StringToString,
64
64
  warn,
65
65
  wrapReason
66
- } from "./chunk-AQCSGHG6.js";
66
+ } from "./chunk-5CXGBP2M.js";
67
67
  import {
68
68
  __privateAdd,
69
69
  __privateGet,
@@ -58,6 +58,33 @@ if (!("try" in Promise)) {
58
58
  enumerable: false
59
59
  });
60
60
  }
61
+ if (!URL.parse) {
62
+ Object.defineProperty(URL, "parse", {
63
+ enumerable: false,
64
+ value: function parse(input, base) {
65
+ try {
66
+ return new URL(input, base || globalThis.location && globalThis.location.href);
67
+ } catch (_) {
68
+ if (!globalThis.document || !globalThis.document.createElement) {
69
+ return {};
70
+ }
71
+ var a = globalThis.document.createElement("a");
72
+ a.href = base ? base + input : input;
73
+ return {
74
+ href: a.href,
75
+ protocol: a.protocol,
76
+ hostname: a.hostname,
77
+ host: a.host,
78
+ port: a.port,
79
+ pathname: a.pathname.charAt(0) === "/" ? a.pathname : "/" + a.pathname,
80
+ search: a.search,
81
+ hash: a.hash,
82
+ origin: a.origin || a.protocol + "//" + a.host
83
+ };
84
+ }
85
+ }
86
+ });
87
+ }
61
88
 
62
89
  // src/pdf.js/src/shared/message_handler.js
63
90
  var CallbackKind = {
@@ -6,7 +6,7 @@ import {
6
6
  bidi,
7
7
  convertBlackAndWhiteToRGBA,
8
8
  wrapReason
9
- } from "./chunk-5N6O7ENF.js";
9
+ } from "./chunk-G56GLMCB.js";
10
10
  import {
11
11
  BaseStandardFontDataFactory,
12
12
  CSSConstants,
@@ -9,7 +9,7 @@ import {
9
9
  convertToRGBA,
10
10
  grayToRGBA,
11
11
  wrapReason
12
- } from "./chunk-5N6O7ENF.js";
12
+ } from "./chunk-G56GLMCB.js";
13
13
  import {
14
14
  AbortException,
15
15
  AnnotationActionEventType,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@chialab/pdfjs-lib",
3
3
  "description": "A custom Mozilla's PDF.js build with better Node support and extras.",
4
- "version": "1.0.0-alpha.40",
4
+ "version": "1.0.0-alpha.41",
5
5
  "type": "module",
6
6
  "author": "Chialab <dev@chialab.it>",
7
7
  "license": "MIT",