File tree Expand file tree Collapse file tree 4 files changed +18
-22
lines changed
Expand file tree Collapse file tree 4 files changed +18
-22
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ module.exports = config => {
1616 "node_modules/html2canvas/dist/html2canvas.js" ,
1717 "node_modules/dompurify/dist/purify.js" ,
1818
19+ "test/compiled/deployment/esm/loadGlobals.js" ,
1920 "test/compiled/utils/compare.js" ,
2021
2122 "test/compiled/deployment/esm/*.spec.js" ,
Original file line number Diff line number Diff line change 1- let resolve ;
2- const promise = new Promise ( res => {
3- resolve = res ;
4- } ) ;
5- window . importsReady = function ( jsPDF ) {
6- resolve ( jsPDF ) ;
7- } ;
1+ // UMD build sets up window.jsPDF automatically
2+ // This function just sets up the AcroForm aliases for backward compatibility
83window . loadGlobals = async function loadGlobals ( ) {
9- if ( window . jsPDF && window . Canvg ) {
10- return ;
4+ if ( window . AcroForm && window . Canvg ) {
5+ return ; // Already initialized
116 }
127
13- const jsPDF = await promise ;
14- window . jsPDF = jsPDF . jsPDF ;
8+ // Set up AcroForm aliases from the jsPDF global
9+ const jsPDF = window . jsPDF ;
1510 window . AcroForm = jsPDF . AcroForm ;
1611 window . ChoiceField = jsPDF . AcroFormChoiceField ;
1712 window . ListBox = jsPDF . AcroFormListBox ;
@@ -24,5 +19,7 @@ window.loadGlobals = async function loadGlobals() {
2419 window . TextField = jsPDF . AcroFormTextField ;
2520 window . PasswordField = jsPDF . AcroFormPasswordField ;
2621 window . Appearance = jsPDF . AcroFormAppearance ;
22+
23+ // Set up Canvg global
2724 window . Canvg = window . canvg . Canvg ;
2825} ;
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ module.exports = config => {
1414 "node_modules/canvg/lib/umd.js" ,
1515 "node_modules/html2canvas/dist/html2canvas.js" ,
1616 "node_modules/dompurify/dist/purify.js" ,
17+ "test/compiled/unit/loadGlobals.js" ,
1718 "test/compiled/utils/compare.js" ,
1819 "test/compiled/specs/*.spec.js" ,
1920 { pattern : "test/compiled/specs/*.spec.mjs" , type : "module" } ,
Original file line number Diff line number Diff line change 1- let resolve ;
2- const promise = new Promise ( res => {
3- resolve = res ;
4- } ) ;
5- window . importsReady = function ( jsPDF ) {
6- resolve ( jsPDF ) ;
7- } ;
1+ // UMD build sets up window.jsPDF automatically
2+ // This function just sets up the AcroForm aliases for backward compatibility
83window . loadGlobals = async function loadGlobals ( ) {
9- if ( window . jsPDF && window . Canvg ) {
10- return ;
4+ if ( window . AcroForm && window . Canvg ) {
5+ return ; // Already initialized
116 }
127
13- const jsPDF = await promise ;
14- window . jsPDF = jsPDF . jsPDF ;
8+ // Set up AcroForm aliases from the jsPDF global
9+ const jsPDF = window . jsPDF ;
1510 window . AcroForm = jsPDF . AcroForm ;
1611 window . ChoiceField = jsPDF . AcroFormChoiceField ;
1712 window . ListBox = jsPDF . AcroFormListBox ;
@@ -24,5 +19,7 @@ window.loadGlobals = async function loadGlobals() {
2419 window . TextField = jsPDF . AcroFormTextField ;
2520 window . PasswordField = jsPDF . AcroFormPasswordField ;
2621 window . Appearance = jsPDF . AcroFormAppearance ;
22+
23+ // Set up Canvg global
2724 window . Canvg = window . canvg . Canvg ;
2825} ;
You can’t perform that action at this time.
0 commit comments