@digipair/skill-web-pdf 0.65.0-alpha4 → 0.65.1

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/index.cjs.js CHANGED
@@ -2013,7 +2013,6 @@ function _object_spread_props(target, source) {
2013
2013
  }));
2014
2014
  }
2015
2015
 
2016
- const PDFJS_URL = 'https://cdn.jsdelivr.net/npm/pdfjs-dist@4.0.269/build/pdf.min.mjs';
2017
2016
  class InputPdfElement extends r$2 {
2018
2017
  get content() {
2019
2018
  return this._content;
@@ -2047,8 +2046,11 @@ class InputPdfElement extends r$2 {
2047
2046
  input.click();
2048
2047
  }
2049
2048
  async extractText(file) {
2050
- const pdfjs = await (function (t) { return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(t)); }); })(PDFJS_URL);
2051
- pdfjs.GlobalWorkerOptions.workerSrc = './pdf.worker.min.mjs';
2049
+ const globalInstance = typeof window === 'undefined' ? global : window;
2050
+ const config = globalInstance.__DIGIPAIR_CONFIG__;
2051
+ const version = 'latest';
2052
+ const pdfjs = await (function (t) { return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(t)); }); })(`${config.BASE_URL}/pdfjs-dist@${version}/build/pdf.min.mjs`);
2053
+ pdfjs.GlobalWorkerOptions.workerSrc = `${config.BASE_URL}/pdfjs-dist@${version}/build/pdf.worker.min.mjs`;
2052
2054
  const pdf = await pdfjs.getDocument(file).promise;
2053
2055
  let text = '';
2054
2056
  for(let i = 1; i <= pdf.numPages; i++){
package/index.esm.js CHANGED
@@ -1991,7 +1991,6 @@ function _object_spread_props(target, source) {
1991
1991
  }));
1992
1992
  }
1993
1993
 
1994
- const PDFJS_URL = 'https://cdn.jsdelivr.net/npm/pdfjs-dist@4.0.269/build/pdf.min.mjs';
1995
1994
  class InputPdfElement extends r$2 {
1996
1995
  get content() {
1997
1996
  return this._content;
@@ -2025,8 +2024,11 @@ class InputPdfElement extends r$2 {
2025
2024
  input.click();
2026
2025
  }
2027
2026
  async extractText(file) {
2028
- const pdfjs = await import(PDFJS_URL);
2029
- pdfjs.GlobalWorkerOptions.workerSrc = './pdf.worker.min.mjs';
2027
+ const globalInstance = typeof window === 'undefined' ? global : window;
2028
+ const config = globalInstance.__DIGIPAIR_CONFIG__;
2029
+ const version = 'latest';
2030
+ const pdfjs = await import(`${config.BASE_URL}/pdfjs-dist@${version}/build/pdf.min.mjs`);
2031
+ pdfjs.GlobalWorkerOptions.workerSrc = `${config.BASE_URL}/pdfjs-dist@${version}/build/pdf.worker.min.mjs`;
2030
2032
  const pdf = await pdfjs.getDocument(file).promise;
2031
2033
  let text = '';
2032
2034
  for(let i = 1; i <= pdf.numPages; i++){
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digipair/skill-web-pdf",
3
- "version": "0.65.0-alpha4",
3
+ "version": "0.65.1",
4
4
  "keywords": [
5
5
  "digipair",
6
6
  "web"
File without changes