@unvired/turboforms-embed-sdk 2.0.10 → 2.0.11

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.
@@ -185,7 +185,7 @@ function V(t,n,r=!1){if(r||console.log("[Lib:FormUtils] \u25B6 attachNestedForms
185
185
  </div>
186
186
  ${(J=e.themeData)!=null&&J.isCard?"</div>":""}
187
187
  <div id="sticky-footer" class="${e.showFooter===!1?"footer-hidden":""}">
188
- <div class="build-version">SDK v2.0.10</div>
188
+ <div class="build-version">SDK v2.0.11</div>
189
189
 
190
190
  <button class="footer-btn footer-btn-secondary" id="prevBtn" style="display:none" onclick="FormOnPrevious()">
191
191
  <i class="bi bi-chevron-left"></i> Previous
@@ -248,4 +248,4 @@ function V(t,n,r=!1){if(r||console.log("[Lib:FormUtils] \u25B6 attachNestedForms
248
248
 
249
249
  // === SCRIPT_SEPARATOR ===
250
250
 
251
- `);if(!window.__unviredSdkScriptsLoaded&&!window.__unviredSdkScriptsLoading){window.__unviredSdkScriptsLoading=!0,console.log("[SDK:10] \u{1F527} Loading SDK scripts (jQuery, Formio, Recogito, LESS, components)...");let d=c=>{if(v){let w=v.querySelector(".sdk-loader-text");w&&(w.textContent=c)}};if(d("Loading Core Components..."),m[0]&&m[0].trim()){let c=document.createElement("script");c.textContent=m[0],c.setAttribute("data-unvired-script","jquery"),document.head.appendChild(c)}if(m[4]&&m[4].trim()){let c=document.createElement("script");c.textContent=m[4],c.setAttribute("data-unvired-script","choices"),document.head.appendChild(c)}if(d("Loading Formio Library..."),m[5]&&m[5].trim()){let c=document.createElement("script");c.textContent=m[5],c.setAttribute("data-unvired-script","formio"),document.head.appendChild(c),console.log("[SDK:10.2] \u2705 Bundled Formio library injected.")}if(e.showComments){d("Loading Annotation Tools...");for(let c=1;c<=2;c++)if(m[c]&&m[c].trim()){let w=document.createElement("script");w.textContent=m[c],w.setAttribute("data-unvired-script",`recogito-${c}`),document.head.appendChild(w),await new Promise(x=>setTimeout(x,0))}}else console.log("[SDK:10.3] \u26A1 Skipping Recogito (comments disabled, optimized load)");if(d("Initializing Engine..."),m[3]&&m[3].trim()){let c=document.createElement("script");c.textContent=m[3],c.setAttribute("data-unvired-script","less"),document.head.appendChild(c)}window.form=window.form||{},window.platform=window.platform||{},window.ResizeObserver=window.ResizeObserver||ResizeObserver,typeof browserMD5File!="undefined"&&(window.form.BMF=new browserMD5File),window.less=window.less||{},typeof window.__Html5QrcodeLibrary__!="undefined"&&(window.html5QrCode=window.__Html5QrcodeLibrary__),typeof window.Html5QrcodeScanner=="undefined"&&(window.Html5QrcodeScanner=class{constructor(){console.warn("Barcode library (Html5QrcodeScanner) is not loaded.")}render(){}clear(){}}),d("Initializing Components...");for(let c=6;c<m.length;c++){let w=m[c];if(w&&w.trim()){let x=document.createElement("script");x.textContent=w,x.setAttribute("data-unvired-script",`script-${c}`),document.head.appendChild(x),c%5===0&&await new Promise(I=>setTimeout(I,0))}}window.__unviredSdkScriptsLoaded=!0,window.__unviredSdkScriptsLoading=!1,console.log("[SDK:10.6] \u2705 All SDK scripts injected successfully"),document.addEventListener("click",function(c){let w=document.getElementById("unvired-more-btn"),x=document.getElementById("moreTooltip");w&&x&&!w.contains(c.target)&&!x.contains(c.target)&&(x.style.display="none")})}else if(window.__unviredSdkScriptsLoading)window.__unviredSdkScriptsLoaded||(console.warn("\u26A0\uFE0F Scripts marked as loading but not yet loaded - waiting..."),window.__unviredSdkScriptsLoaded=!0,window.__unviredSdkScriptsLoading=!1);else{if(console.log("[SDK:10] \u2705 SDK scripts already loaded \u2014 skipping injection"),typeof window.Formio=="undefined"){let d="ErrorCode : 005, Formio library not available even though scripts were loaded.";throw console.error("[SDK:10.7] \u274C",d),v&&v.classList.add("hidden"),a({type:"ERROR",errorMessage:d,data:{technicalError:new Error(d),formioPath:"bundled",timestamp:new Date().toISOString()}}),new Error(d)}console.log("[SDK:10] \u2705 Formio verified (previously loaded)")}window.FORM_TEMPLATE=y,window.FORM_PREVIOUS_DATA=n,window.FORM_MODE=e.mode,window.FORM_COMMENTS_DATA=e.commentsData,window.FORM_VOB_ARR=e.vobArr,window.FORM_PLATFORM=e.platform,window.FORM_LANGUAGE=e.language,window.FORM_TRASLATIONS=e.translations,window.FORM_ENV=e.environmentVariable,window.FORM_THEME_DATA=e.themeData,window.FORM_USER_DATA=e.userData,window.FORM_USERS_LIST=e.usersList,window.FORM_CONTROL_DATA=e.controlData,window.FORM_PRIVATE_EXTERNAL=e.privateExternal,window.FORM_PERMISSION=e.permission,window.FORM_ATTACHMENT_FILE_KEYS=i,window.sendEventCallback=a,window.FORM_EVENTS={FORM_RENDER:"FORM_RENDER",SAVE:"FORM_SAVE",SUBMIT:"FORM_SUBMIT",SUBMIT_ERROR:"FORM_SUBMIT_ERROR",BACK_NAVIGATION:"FORM_BACK_NAVIGATION",ONCHANGE:"FORM_ONCHANGE",FORM_LOADED:"FORM_LOADED"};let b=o.querySelector("#form-back-btn"),S=o.querySelector("#unvired-more-btn");b&&(e.showBackButton?b.style.setProperty("display","flex","important"):b.style.setProperty("display","none","important")),S&&!e.showMoreButton&&S.style.setProperty("display","none","important"),window.__unviredFormsOptions=e,window.checkDocumentsVisibility(),typeof window.checkMoreButtonVisibility=="function"&&window.checkMoreButtonVisibility(),e.platform==="web"?window.platform={isBrowser:!0,isAndroid:!1,iosPlatform:!1}:e.platform==="android"?window.platform={isBrowser:!1,isAndroid:!0,iosPlatform:!1}:e.platform==="ios"&&(window.platform={isBrowser:!1,isAndroid:!1,iosPlatform:!0});let M={};if(((Q=e.environmentVariable)==null?void 0:Q.length)>0)for(let d of e.environmentVariable)for(let c in d)M[c]=d[c];Object.keys(M).length>0&&(window.env=M);let E=o.querySelector("#sticky-header"),D=o.querySelector("#sticky-footer"),H=o.querySelector("#formio-wrapper"),W=o.querySelector("#comments-header");e.mode==="pdf"||e.mode==="print"?(o.classList.add(`${e.mode}-mode`),H&&H.classList.add(`${e.mode}-mode`),E&&(E.style.display="none"),D&&(D.style.display="none")):(E&&(E.style.display="flex"),D&&(D.style.display="flex")),W&&(W.style.display="none"),e.themeData&&Object.keys(e.themeData).length>0&&(window.FORM_THEME_DATA=e.themeData),e.language&&(window.FORMIO_LANGUAGE=e.language),e.translations&&(window.FORMIO_I18N=e.translations),e.userData&&(window.firstName=e.userData.firstName,window.lastName=e.userData.lastName,window.form=window.form||{},Object.assign(window.form,e.userData)),window.less=window.less||{},Object.assign(window.less,{async:!0,environment:"production",fileAsync:!1,onReady:!0,useFileCache:!0});let q=n;if(n&&(console.log("[SDK:13] \u{1F517} Processing file IDs in submission data (fetching from IndexedDB)..."),q=await ie(n,a,i),console.log("[SDK:13] \u2705 File IDs processed \u2014 handing off to form renderer")),v){let d=v.querySelector(".sdk-loader-text");d&&(d.textContent="Initializing Form...")}return typeof window.loadRNform!="function"?(console.log("[SDK:14] \u23F3 loadRNform not ready yet \u2014 waiting for web-unvired-formio.js to signal..."),await new Promise(d=>{let c=()=>{document.removeEventListener("LoadRNformReady",c),console.log("[SDK:14] \u2705 loadRNform is now ready (LoadRNformReady event received)"),d()};document.addEventListener("LoadRNformReady",c),typeof window.loadRNform=="function"&&c()})):console.log("[SDK:14] \u2705 loadRNform already available \u2014 invoking immediately"),console.log("[SDK:14] \u{1F680} Handing off to loadRNform (web-unvired-formio.js)..."),await window.loadRNform(y,q,e.themeData,e.mode,e.language,e.translations,e.controlData,e.privateExternal,e.permission,i),he(),{sendAction:d=>{var c;d.type==="SET_IMAGE_DATA"&&((c=window.setImageData)==null||c.call(window,d.imageData,d.controlId,d.fileName))},destroy:()=>{o.innerHTML=""}}}window.closeDocumentsModal=function(){if(typeof $!="undefined"&&$.fn.modal)$("#documentsModal").modal("hide");else{let t=document.getElementById("documentsModal");t&&(t.style.display="none",t.classList.remove("active"))}};window.checkDocumentsVisibility=async function(){let t=document.getElementById("documentsOption"),n=document.getElementById("documentsDivider"),r=await U();t.style.display=r?"block":"none",n&&(n.style.display=r?"block":"none"),typeof window.checkMoreButtonVisibility=="function"&&window.checkMoreButtonVisibility()};window.insertAppDocument=async function(t){try{return await le(t),console.log("[AppDocument] \u2705 Document inserted",{id:t==null?void 0:t.id}),await window.checkDocumentsVisibility(),!0}catch(n){return console.error("[AppDocument] \u274C Failed to insert document",n),!1}};window.deleteAppDocument=async function(t){try{return await ce(t),console.log("[AppDocument] \u2705 Document deleted",{id:t}),await window.checkDocumentsVisibility(),!0}catch(n){return console.error("[AppDocument] \u274C Failed to delete document",n),!1}};window.getAllDocuments=se;window.hasDocuments=U;function Ae(){return"2.0.10"}function me(t){let n=typeof t=="string"?document.getElementById(t):t;n||(n=document.querySelector(".tf-formio-sdk")||document.body);let r=n.querySelectorAll("table"),o=0,e=null;return r.forEach(i=>{let s=i.getBoundingClientRect().width;s>o&&(o=s,e=i)}),{maxWidth:o,widestTable:e}}window.getMaxTableWidth=me;typeof window!="undefined"&&(window.UnviredForms=window.UnviredForms||{loadUnviredForms:ke,getBuildVersion:Ae,getMaxTableWidth:me});export{Ae as getBuildVersion,me as getMaxTableWidth,ke as loadUnviredForms};
251
+ `);if(!window.__unviredSdkScriptsLoaded&&!window.__unviredSdkScriptsLoading){window.__unviredSdkScriptsLoading=!0,console.log("[SDK:10] \u{1F527} Loading SDK scripts (jQuery, Formio, Recogito, LESS, components)...");let d=c=>{if(v){let w=v.querySelector(".sdk-loader-text");w&&(w.textContent=c)}};if(d("Loading Core Components..."),m[0]&&m[0].trim()){let c=document.createElement("script");c.textContent=m[0],c.setAttribute("data-unvired-script","jquery"),document.head.appendChild(c)}if(m[4]&&m[4].trim()){let c=document.createElement("script");c.textContent=m[4],c.setAttribute("data-unvired-script","choices"),document.head.appendChild(c)}if(d("Loading Formio Library..."),m[5]&&m[5].trim()){let c=document.createElement("script");c.textContent=m[5],c.setAttribute("data-unvired-script","formio"),document.head.appendChild(c),console.log("[SDK:10.2] \u2705 Bundled Formio library injected.")}if(e.showComments){d("Loading Annotation Tools...");for(let c=1;c<=2;c++)if(m[c]&&m[c].trim()){let w=document.createElement("script");w.textContent=m[c],w.setAttribute("data-unvired-script",`recogito-${c}`),document.head.appendChild(w),await new Promise(x=>setTimeout(x,0))}}else console.log("[SDK:10.3] \u26A1 Skipping Recogito (comments disabled, optimized load)");if(d("Initializing Engine..."),m[3]&&m[3].trim()){let c=document.createElement("script");c.textContent=m[3],c.setAttribute("data-unvired-script","less"),document.head.appendChild(c)}window.form=window.form||{},window.platform=window.platform||{},window.ResizeObserver=window.ResizeObserver||ResizeObserver,typeof browserMD5File!="undefined"&&(window.form.BMF=new browserMD5File),window.less=window.less||{},typeof window.__Html5QrcodeLibrary__!="undefined"&&(window.html5QrCode=window.__Html5QrcodeLibrary__),typeof window.Html5QrcodeScanner=="undefined"&&(window.Html5QrcodeScanner=class{constructor(){console.warn("Barcode library (Html5QrcodeScanner) is not loaded.")}render(){}clear(){}}),d("Initializing Components...");for(let c=6;c<m.length;c++){let w=m[c];if(w&&w.trim()){let x=document.createElement("script");x.textContent=w,x.setAttribute("data-unvired-script",`script-${c}`),document.head.appendChild(x),c%5===0&&await new Promise(I=>setTimeout(I,0))}}window.__unviredSdkScriptsLoaded=!0,window.__unviredSdkScriptsLoading=!1,console.log("[SDK:10.6] \u2705 All SDK scripts injected successfully"),document.addEventListener("click",function(c){let w=document.getElementById("unvired-more-btn"),x=document.getElementById("moreTooltip");w&&x&&!w.contains(c.target)&&!x.contains(c.target)&&(x.style.display="none")})}else if(window.__unviredSdkScriptsLoading)window.__unviredSdkScriptsLoaded||(console.warn("\u26A0\uFE0F Scripts marked as loading but not yet loaded - waiting..."),window.__unviredSdkScriptsLoaded=!0,window.__unviredSdkScriptsLoading=!1);else{if(console.log("[SDK:10] \u2705 SDK scripts already loaded \u2014 skipping injection"),typeof window.Formio=="undefined"){let d="ErrorCode : 005, Formio library not available even though scripts were loaded.";throw console.error("[SDK:10.7] \u274C",d),v&&v.classList.add("hidden"),a({type:"ERROR",errorMessage:d,data:{technicalError:new Error(d),formioPath:"bundled",timestamp:new Date().toISOString()}}),new Error(d)}console.log("[SDK:10] \u2705 Formio verified (previously loaded)")}window.FORM_TEMPLATE=y,window.FORM_PREVIOUS_DATA=n,window.FORM_MODE=e.mode,window.FORM_COMMENTS_DATA=e.commentsData,window.FORM_VOB_ARR=e.vobArr,window.FORM_PLATFORM=e.platform,window.FORM_LANGUAGE=e.language,window.FORM_TRASLATIONS=e.translations,window.FORM_ENV=e.environmentVariable,window.FORM_THEME_DATA=e.themeData,window.FORM_USER_DATA=e.userData,window.FORM_USERS_LIST=e.usersList,window.FORM_CONTROL_DATA=e.controlData,window.FORM_PRIVATE_EXTERNAL=e.privateExternal,window.FORM_PERMISSION=e.permission,window.FORM_ATTACHMENT_FILE_KEYS=i,window.sendEventCallback=a,window.FORM_EVENTS={FORM_RENDER:"FORM_RENDER",SAVE:"FORM_SAVE",SUBMIT:"FORM_SUBMIT",SUBMIT_ERROR:"FORM_SUBMIT_ERROR",BACK_NAVIGATION:"FORM_BACK_NAVIGATION",ONCHANGE:"FORM_ONCHANGE",FORM_LOADED:"FORM_LOADED"};let b=o.querySelector("#form-back-btn"),S=o.querySelector("#unvired-more-btn");b&&(e.showBackButton?b.style.setProperty("display","flex","important"):b.style.setProperty("display","none","important")),S&&!e.showMoreButton&&S.style.setProperty("display","none","important"),window.__unviredFormsOptions=e,window.checkDocumentsVisibility(),typeof window.checkMoreButtonVisibility=="function"&&window.checkMoreButtonVisibility(),e.platform==="web"?window.platform={isBrowser:!0,isAndroid:!1,iosPlatform:!1}:e.platform==="android"?window.platform={isBrowser:!1,isAndroid:!0,iosPlatform:!1}:e.platform==="ios"&&(window.platform={isBrowser:!1,isAndroid:!1,iosPlatform:!0});let M={};if(((Q=e.environmentVariable)==null?void 0:Q.length)>0)for(let d of e.environmentVariable)for(let c in d)M[c]=d[c];Object.keys(M).length>0&&(window.env=M);let E=o.querySelector("#sticky-header"),D=o.querySelector("#sticky-footer"),H=o.querySelector("#formio-wrapper"),W=o.querySelector("#comments-header");e.mode==="pdf"||e.mode==="print"?(o.classList.add(`${e.mode}-mode`),H&&H.classList.add(`${e.mode}-mode`),E&&(E.style.display="none"),D&&(D.style.display="none")):(E&&(E.style.display="flex"),D&&(D.style.display="flex")),W&&(W.style.display="none"),e.themeData&&Object.keys(e.themeData).length>0&&(window.FORM_THEME_DATA=e.themeData),e.language&&(window.FORMIO_LANGUAGE=e.language),e.translations&&(window.FORMIO_I18N=e.translations),e.userData&&(window.firstName=e.userData.firstName,window.lastName=e.userData.lastName,window.form=window.form||{},Object.assign(window.form,e.userData)),window.less=window.less||{},Object.assign(window.less,{async:!0,environment:"production",fileAsync:!1,onReady:!0,useFileCache:!0});let q=n;if(n&&(console.log("[SDK:13] \u{1F517} Processing file IDs in submission data (fetching from IndexedDB)..."),q=await ie(n,a,i),console.log("[SDK:13] \u2705 File IDs processed \u2014 handing off to form renderer")),v){let d=v.querySelector(".sdk-loader-text");d&&(d.textContent="Initializing Form...")}return typeof window.loadRNform!="function"?(console.log("[SDK:14] \u23F3 loadRNform not ready yet \u2014 waiting for web-unvired-formio.js to signal..."),await new Promise(d=>{let c=()=>{document.removeEventListener("LoadRNformReady",c),console.log("[SDK:14] \u2705 loadRNform is now ready (LoadRNformReady event received)"),d()};document.addEventListener("LoadRNformReady",c),typeof window.loadRNform=="function"&&c()})):console.log("[SDK:14] \u2705 loadRNform already available \u2014 invoking immediately"),console.log("[SDK:14] \u{1F680} Handing off to loadRNform (web-unvired-formio.js)..."),await window.loadRNform(y,q,e.themeData,e.mode,e.language,e.translations,e.controlData,e.privateExternal,e.permission,i),he(),{sendAction:d=>{var c;d.type==="SET_IMAGE_DATA"&&((c=window.setImageData)==null||c.call(window,d.imageData,d.controlId,d.fileName))},destroy:()=>{o.innerHTML=""}}}window.closeDocumentsModal=function(){if(typeof $!="undefined"&&$.fn.modal)$("#documentsModal").modal("hide");else{let t=document.getElementById("documentsModal");t&&(t.style.display="none",t.classList.remove("active"))}};window.checkDocumentsVisibility=async function(){let t=document.getElementById("documentsOption"),n=document.getElementById("documentsDivider"),r=await U();t.style.display=r?"block":"none",n&&(n.style.display=r?"block":"none"),typeof window.checkMoreButtonVisibility=="function"&&window.checkMoreButtonVisibility()};window.insertAppDocument=async function(t){try{return await le(t),console.log("[AppDocument] \u2705 Document inserted",{id:t==null?void 0:t.id}),await window.checkDocumentsVisibility(),!0}catch(n){return console.error("[AppDocument] \u274C Failed to insert document",n),!1}};window.deleteAppDocument=async function(t){try{return await ce(t),console.log("[AppDocument] \u2705 Document deleted",{id:t}),await window.checkDocumentsVisibility(),!0}catch(n){return console.error("[AppDocument] \u274C Failed to delete document",n),!1}};window.getAllDocuments=se;window.hasDocuments=U;function Ae(){return"2.0.11"}function me(t){let n=typeof t=="string"?document.getElementById(t):t;n||(n=document.querySelector(".tf-formio-sdk")||document.body);let r=n.querySelectorAll("table"),o=0,e=null;return r.forEach(i=>{let s=i.getBoundingClientRect().width;s>o&&(o=s,e=i)}),{maxWidth:o,widestTable:e}}window.getMaxTableWidth=me;typeof window!="undefined"&&(window.UnviredForms=window.UnviredForms||{loadUnviredForms:ke,getBuildVersion:Ae,getMaxTableWidth:me});export{Ae as getBuildVersion,me as getMaxTableWidth,ke as loadUnviredForms};
@@ -42662,7 +42662,7 @@ window.CommentOnBack = CommentOnBack;
42662
42662
 
42663
42663
 
42664
42664
  <div id="sticky-footer">
42665
- <div class="build-version">SDK v2.0.10</div>
42665
+ <div class="build-version">SDK v2.0.11</div>
42666
42666
  <div class="relative-position">
42667
42667
  <button id="unvired-more-btn" class="ui button primary dataGrid-addRow" onclick="toggleTooltip()">
42668
42668
  <i class="icon options"></i>
@@ -185,7 +185,7 @@ var TurboForms=(()=>{var V=Object.defineProperty;var ye=Object.getOwnPropertyDes
185
185
  </div>
186
186
  ${(ee=e.themeData)!=null&&ee.isCard?"</div>":""}
187
187
  <div id="sticky-footer" class="${e.showFooter===!1?"footer-hidden":""}">
188
- <div class="build-version">SDK v2.0.10</div>
188
+ <div class="build-version">SDK v2.0.11</div>
189
189
 
190
190
  <button class="footer-btn footer-btn-secondary" id="prevBtn" style="display:none" onclick="FormOnPrevious()">
191
191
  <i class="bi bi-chevron-left"></i> Previous
@@ -248,4 +248,4 @@ var TurboForms=(()=>{var V=Object.defineProperty;var ye=Object.getOwnPropertyDes
248
248
 
249
249
  // === SCRIPT_SEPARATOR ===
250
250
 
251
- `);if(!window.__unviredSdkScriptsLoaded&&!window.__unviredSdkScriptsLoading){window.__unviredSdkScriptsLoading=!0,console.log("[SDK:10] \u{1F527} Loading SDK scripts (jQuery, Formio, Recogito, LESS, components)...");let d=c=>{if(v){let w=v.querySelector(".sdk-loader-text");w&&(w.textContent=c)}};if(d("Loading Core Components..."),m[0]&&m[0].trim()){let c=document.createElement("script");c.textContent=m[0],c.setAttribute("data-unvired-script","jquery"),document.head.appendChild(c)}if(m[4]&&m[4].trim()){let c=document.createElement("script");c.textContent=m[4],c.setAttribute("data-unvired-script","choices"),document.head.appendChild(c)}if(d("Loading Formio Library..."),m[5]&&m[5].trim()){let c=document.createElement("script");c.textContent=m[5],c.setAttribute("data-unvired-script","formio"),document.head.appendChild(c),console.log("[SDK:10.2] \u2705 Bundled Formio library injected.")}if(e.showComments){d("Loading Annotation Tools...");for(let c=1;c<=2;c++)if(m[c]&&m[c].trim()){let w=document.createElement("script");w.textContent=m[c],w.setAttribute("data-unvired-script",`recogito-${c}`),document.head.appendChild(w),await new Promise(x=>setTimeout(x,0))}}else console.log("[SDK:10.3] \u26A1 Skipping Recogito (comments disabled, optimized load)");if(d("Initializing Engine..."),m[3]&&m[3].trim()){let c=document.createElement("script");c.textContent=m[3],c.setAttribute("data-unvired-script","less"),document.head.appendChild(c)}window.form=window.form||{},window.platform=window.platform||{},window.ResizeObserver=window.ResizeObserver||ResizeObserver,typeof browserMD5File!="undefined"&&(window.form.BMF=new browserMD5File),window.less=window.less||{},typeof window.__Html5QrcodeLibrary__!="undefined"&&(window.html5QrCode=window.__Html5QrcodeLibrary__),typeof window.Html5QrcodeScanner=="undefined"&&(window.Html5QrcodeScanner=class{constructor(){console.warn("Barcode library (Html5QrcodeScanner) is not loaded.")}render(){}clear(){}}),d("Initializing Components...");for(let c=6;c<m.length;c++){let w=m[c];if(w&&w.trim()){let x=document.createElement("script");x.textContent=w,x.setAttribute("data-unvired-script",`script-${c}`),document.head.appendChild(x),c%5===0&&await new Promise(I=>setTimeout(I,0))}}window.__unviredSdkScriptsLoaded=!0,window.__unviredSdkScriptsLoading=!1,console.log("[SDK:10.6] \u2705 All SDK scripts injected successfully"),document.addEventListener("click",function(c){let w=document.getElementById("unvired-more-btn"),x=document.getElementById("moreTooltip");w&&x&&!w.contains(c.target)&&!x.contains(c.target)&&(x.style.display="none")})}else if(window.__unviredSdkScriptsLoading)window.__unviredSdkScriptsLoaded||(console.warn("\u26A0\uFE0F Scripts marked as loading but not yet loaded - waiting..."),window.__unviredSdkScriptsLoaded=!0,window.__unviredSdkScriptsLoading=!1);else{if(console.log("[SDK:10] \u2705 SDK scripts already loaded \u2014 skipping injection"),typeof window.Formio=="undefined"){let d="ErrorCode : 005, Formio library not available even though scripts were loaded.";throw console.error("[SDK:10.7] \u274C",d),v&&v.classList.add("hidden"),a({type:"ERROR",errorMessage:d,data:{technicalError:new Error(d),formioPath:"bundled",timestamp:new Date().toISOString()}}),new Error(d)}console.log("[SDK:10] \u2705 Formio verified (previously loaded)")}window.FORM_TEMPLATE=y,window.FORM_PREVIOUS_DATA=n,window.FORM_MODE=e.mode,window.FORM_COMMENTS_DATA=e.commentsData,window.FORM_VOB_ARR=e.vobArr,window.FORM_PLATFORM=e.platform,window.FORM_LANGUAGE=e.language,window.FORM_TRASLATIONS=e.translations,window.FORM_ENV=e.environmentVariable,window.FORM_THEME_DATA=e.themeData,window.FORM_USER_DATA=e.userData,window.FORM_USERS_LIST=e.usersList,window.FORM_CONTROL_DATA=e.controlData,window.FORM_PRIVATE_EXTERNAL=e.privateExternal,window.FORM_PERMISSION=e.permission,window.FORM_ATTACHMENT_FILE_KEYS=i,window.sendEventCallback=a,window.FORM_EVENTS={FORM_RENDER:"FORM_RENDER",SAVE:"FORM_SAVE",SUBMIT:"FORM_SUBMIT",SUBMIT_ERROR:"FORM_SUBMIT_ERROR",BACK_NAVIGATION:"FORM_BACK_NAVIGATION",ONCHANGE:"FORM_ONCHANGE",FORM_LOADED:"FORM_LOADED"};let b=o.querySelector("#form-back-btn"),S=o.querySelector("#unvired-more-btn");b&&(e.showBackButton?b.style.setProperty("display","flex","important"):b.style.setProperty("display","none","important")),S&&!e.showMoreButton&&S.style.setProperty("display","none","important"),window.__unviredFormsOptions=e,window.checkDocumentsVisibility(),typeof window.checkMoreButtonVisibility=="function"&&window.checkMoreButtonVisibility(),e.platform==="web"?window.platform={isBrowser:!0,isAndroid:!1,iosPlatform:!1}:e.platform==="android"?window.platform={isBrowser:!1,isAndroid:!0,iosPlatform:!1}:e.platform==="ios"&&(window.platform={isBrowser:!1,isAndroid:!1,iosPlatform:!0});let M={};if(((te=e.environmentVariable)==null?void 0:te.length)>0)for(let d of e.environmentVariable)for(let c in d)M[c]=d[c];Object.keys(M).length>0&&(window.env=M);let E=o.querySelector("#sticky-header"),D=o.querySelector("#sticky-footer"),q=o.querySelector("#formio-wrapper"),G=o.querySelector("#comments-header");e.mode==="pdf"||e.mode==="print"?(o.classList.add(`${e.mode}-mode`),q&&q.classList.add(`${e.mode}-mode`),E&&(E.style.display="none"),D&&(D.style.display="none")):(E&&(E.style.display="flex"),D&&(D.style.display="flex")),G&&(G.style.display="none"),e.themeData&&Object.keys(e.themeData).length>0&&(window.FORM_THEME_DATA=e.themeData),e.language&&(window.FORMIO_LANGUAGE=e.language),e.translations&&(window.FORMIO_I18N=e.translations),e.userData&&(window.firstName=e.userData.firstName,window.lastName=e.userData.lastName,window.form=window.form||{},Object.assign(window.form,e.userData)),window.less=window.less||{},Object.assign(window.less,{async:!0,environment:"production",fileAsync:!1,onReady:!0,useFileCache:!0});let Y=n;if(n&&(console.log("[SDK:13] \u{1F517} Processing file IDs in submission data (fetching from IndexedDB)..."),Y=await se(n,a,i),console.log("[SDK:13] \u2705 File IDs processed \u2014 handing off to form renderer")),v){let d=v.querySelector(".sdk-loader-text");d&&(d.textContent="Initializing Form...")}return typeof window.loadRNform!="function"?(console.log("[SDK:14] \u23F3 loadRNform not ready yet \u2014 waiting for web-unvired-formio.js to signal..."),await new Promise(d=>{let c=()=>{document.removeEventListener("LoadRNformReady",c),console.log("[SDK:14] \u2705 loadRNform is now ready (LoadRNformReady event received)"),d()};document.addEventListener("LoadRNformReady",c),typeof window.loadRNform=="function"&&c()})):console.log("[SDK:14] \u2705 loadRNform already available \u2014 invoking immediately"),console.log("[SDK:14] \u{1F680} Handing off to loadRNform (web-unvired-formio.js)..."),await window.loadRNform(y,Y,e.themeData,e.mode,e.language,e.translations,e.controlData,e.privateExternal,e.permission,i),be(),{sendAction:d=>{var c;d.type==="SET_IMAGE_DATA"&&((c=window.setImageData)==null||c.call(window,d.imageData,d.controlId,d.fileName))},destroy:()=>{o.innerHTML=""}}}window.closeDocumentsModal=function(){if(typeof $!="undefined"&&$.fn.modal)$("#documentsModal").modal("hide");else{let t=document.getElementById("documentsModal");t&&(t.style.display="none",t.classList.remove("active"))}};window.checkDocumentsVisibility=async function(){let t=document.getElementById("documentsOption"),n=document.getElementById("documentsDivider"),r=await z();t.style.display=r?"block":"none",n&&(n.style.display=r?"block":"none"),typeof window.checkMoreButtonVisibility=="function"&&window.checkMoreButtonVisibility()};window.insertAppDocument=async function(t){try{return await ue(t),console.log("[AppDocument] \u2705 Document inserted",{id:t==null?void 0:t.id}),await window.checkDocumentsVisibility(),!0}catch(n){return console.error("[AppDocument] \u274C Failed to insert document",n),!1}};window.deleteAppDocument=async function(t){try{return await de(t),console.log("[AppDocument] \u2705 Document deleted",{id:t}),await window.checkDocumentsVisibility(),!0}catch(n){return console.error("[AppDocument] \u274C Failed to delete document",n),!1}};window.getAllDocuments=ce;window.hasDocuments=z;function ve(){return"2.0.10"}function W(t){let n=typeof t=="string"?document.getElementById(t):t;n||(n=document.querySelector(".tf-formio-sdk")||document.body);let r=n.querySelectorAll("table"),o=0,e=null;return r.forEach(i=>{let s=i.getBoundingClientRect().width;s>o&&(o=s,e=i)}),{maxWidth:o,widestTable:e}}window.getMaxTableWidth=W;typeof window!="undefined"&&(window.UnviredForms=window.UnviredForms||{loadUnviredForms:ge,getBuildVersion:ve,getMaxTableWidth:W});return Se(Re);})();
251
+ `);if(!window.__unviredSdkScriptsLoaded&&!window.__unviredSdkScriptsLoading){window.__unviredSdkScriptsLoading=!0,console.log("[SDK:10] \u{1F527} Loading SDK scripts (jQuery, Formio, Recogito, LESS, components)...");let d=c=>{if(v){let w=v.querySelector(".sdk-loader-text");w&&(w.textContent=c)}};if(d("Loading Core Components..."),m[0]&&m[0].trim()){let c=document.createElement("script");c.textContent=m[0],c.setAttribute("data-unvired-script","jquery"),document.head.appendChild(c)}if(m[4]&&m[4].trim()){let c=document.createElement("script");c.textContent=m[4],c.setAttribute("data-unvired-script","choices"),document.head.appendChild(c)}if(d("Loading Formio Library..."),m[5]&&m[5].trim()){let c=document.createElement("script");c.textContent=m[5],c.setAttribute("data-unvired-script","formio"),document.head.appendChild(c),console.log("[SDK:10.2] \u2705 Bundled Formio library injected.")}if(e.showComments){d("Loading Annotation Tools...");for(let c=1;c<=2;c++)if(m[c]&&m[c].trim()){let w=document.createElement("script");w.textContent=m[c],w.setAttribute("data-unvired-script",`recogito-${c}`),document.head.appendChild(w),await new Promise(x=>setTimeout(x,0))}}else console.log("[SDK:10.3] \u26A1 Skipping Recogito (comments disabled, optimized load)");if(d("Initializing Engine..."),m[3]&&m[3].trim()){let c=document.createElement("script");c.textContent=m[3],c.setAttribute("data-unvired-script","less"),document.head.appendChild(c)}window.form=window.form||{},window.platform=window.platform||{},window.ResizeObserver=window.ResizeObserver||ResizeObserver,typeof browserMD5File!="undefined"&&(window.form.BMF=new browserMD5File),window.less=window.less||{},typeof window.__Html5QrcodeLibrary__!="undefined"&&(window.html5QrCode=window.__Html5QrcodeLibrary__),typeof window.Html5QrcodeScanner=="undefined"&&(window.Html5QrcodeScanner=class{constructor(){console.warn("Barcode library (Html5QrcodeScanner) is not loaded.")}render(){}clear(){}}),d("Initializing Components...");for(let c=6;c<m.length;c++){let w=m[c];if(w&&w.trim()){let x=document.createElement("script");x.textContent=w,x.setAttribute("data-unvired-script",`script-${c}`),document.head.appendChild(x),c%5===0&&await new Promise(I=>setTimeout(I,0))}}window.__unviredSdkScriptsLoaded=!0,window.__unviredSdkScriptsLoading=!1,console.log("[SDK:10.6] \u2705 All SDK scripts injected successfully"),document.addEventListener("click",function(c){let w=document.getElementById("unvired-more-btn"),x=document.getElementById("moreTooltip");w&&x&&!w.contains(c.target)&&!x.contains(c.target)&&(x.style.display="none")})}else if(window.__unviredSdkScriptsLoading)window.__unviredSdkScriptsLoaded||(console.warn("\u26A0\uFE0F Scripts marked as loading but not yet loaded - waiting..."),window.__unviredSdkScriptsLoaded=!0,window.__unviredSdkScriptsLoading=!1);else{if(console.log("[SDK:10] \u2705 SDK scripts already loaded \u2014 skipping injection"),typeof window.Formio=="undefined"){let d="ErrorCode : 005, Formio library not available even though scripts were loaded.";throw console.error("[SDK:10.7] \u274C",d),v&&v.classList.add("hidden"),a({type:"ERROR",errorMessage:d,data:{technicalError:new Error(d),formioPath:"bundled",timestamp:new Date().toISOString()}}),new Error(d)}console.log("[SDK:10] \u2705 Formio verified (previously loaded)")}window.FORM_TEMPLATE=y,window.FORM_PREVIOUS_DATA=n,window.FORM_MODE=e.mode,window.FORM_COMMENTS_DATA=e.commentsData,window.FORM_VOB_ARR=e.vobArr,window.FORM_PLATFORM=e.platform,window.FORM_LANGUAGE=e.language,window.FORM_TRASLATIONS=e.translations,window.FORM_ENV=e.environmentVariable,window.FORM_THEME_DATA=e.themeData,window.FORM_USER_DATA=e.userData,window.FORM_USERS_LIST=e.usersList,window.FORM_CONTROL_DATA=e.controlData,window.FORM_PRIVATE_EXTERNAL=e.privateExternal,window.FORM_PERMISSION=e.permission,window.FORM_ATTACHMENT_FILE_KEYS=i,window.sendEventCallback=a,window.FORM_EVENTS={FORM_RENDER:"FORM_RENDER",SAVE:"FORM_SAVE",SUBMIT:"FORM_SUBMIT",SUBMIT_ERROR:"FORM_SUBMIT_ERROR",BACK_NAVIGATION:"FORM_BACK_NAVIGATION",ONCHANGE:"FORM_ONCHANGE",FORM_LOADED:"FORM_LOADED"};let b=o.querySelector("#form-back-btn"),S=o.querySelector("#unvired-more-btn");b&&(e.showBackButton?b.style.setProperty("display","flex","important"):b.style.setProperty("display","none","important")),S&&!e.showMoreButton&&S.style.setProperty("display","none","important"),window.__unviredFormsOptions=e,window.checkDocumentsVisibility(),typeof window.checkMoreButtonVisibility=="function"&&window.checkMoreButtonVisibility(),e.platform==="web"?window.platform={isBrowser:!0,isAndroid:!1,iosPlatform:!1}:e.platform==="android"?window.platform={isBrowser:!1,isAndroid:!0,iosPlatform:!1}:e.platform==="ios"&&(window.platform={isBrowser:!1,isAndroid:!1,iosPlatform:!0});let M={};if(((te=e.environmentVariable)==null?void 0:te.length)>0)for(let d of e.environmentVariable)for(let c in d)M[c]=d[c];Object.keys(M).length>0&&(window.env=M);let E=o.querySelector("#sticky-header"),D=o.querySelector("#sticky-footer"),q=o.querySelector("#formio-wrapper"),G=o.querySelector("#comments-header");e.mode==="pdf"||e.mode==="print"?(o.classList.add(`${e.mode}-mode`),q&&q.classList.add(`${e.mode}-mode`),E&&(E.style.display="none"),D&&(D.style.display="none")):(E&&(E.style.display="flex"),D&&(D.style.display="flex")),G&&(G.style.display="none"),e.themeData&&Object.keys(e.themeData).length>0&&(window.FORM_THEME_DATA=e.themeData),e.language&&(window.FORMIO_LANGUAGE=e.language),e.translations&&(window.FORMIO_I18N=e.translations),e.userData&&(window.firstName=e.userData.firstName,window.lastName=e.userData.lastName,window.form=window.form||{},Object.assign(window.form,e.userData)),window.less=window.less||{},Object.assign(window.less,{async:!0,environment:"production",fileAsync:!1,onReady:!0,useFileCache:!0});let Y=n;if(n&&(console.log("[SDK:13] \u{1F517} Processing file IDs in submission data (fetching from IndexedDB)..."),Y=await se(n,a,i),console.log("[SDK:13] \u2705 File IDs processed \u2014 handing off to form renderer")),v){let d=v.querySelector(".sdk-loader-text");d&&(d.textContent="Initializing Form...")}return typeof window.loadRNform!="function"?(console.log("[SDK:14] \u23F3 loadRNform not ready yet \u2014 waiting for web-unvired-formio.js to signal..."),await new Promise(d=>{let c=()=>{document.removeEventListener("LoadRNformReady",c),console.log("[SDK:14] \u2705 loadRNform is now ready (LoadRNformReady event received)"),d()};document.addEventListener("LoadRNformReady",c),typeof window.loadRNform=="function"&&c()})):console.log("[SDK:14] \u2705 loadRNform already available \u2014 invoking immediately"),console.log("[SDK:14] \u{1F680} Handing off to loadRNform (web-unvired-formio.js)..."),await window.loadRNform(y,Y,e.themeData,e.mode,e.language,e.translations,e.controlData,e.privateExternal,e.permission,i),be(),{sendAction:d=>{var c;d.type==="SET_IMAGE_DATA"&&((c=window.setImageData)==null||c.call(window,d.imageData,d.controlId,d.fileName))},destroy:()=>{o.innerHTML=""}}}window.closeDocumentsModal=function(){if(typeof $!="undefined"&&$.fn.modal)$("#documentsModal").modal("hide");else{let t=document.getElementById("documentsModal");t&&(t.style.display="none",t.classList.remove("active"))}};window.checkDocumentsVisibility=async function(){let t=document.getElementById("documentsOption"),n=document.getElementById("documentsDivider"),r=await z();t.style.display=r?"block":"none",n&&(n.style.display=r?"block":"none"),typeof window.checkMoreButtonVisibility=="function"&&window.checkMoreButtonVisibility()};window.insertAppDocument=async function(t){try{return await ue(t),console.log("[AppDocument] \u2705 Document inserted",{id:t==null?void 0:t.id}),await window.checkDocumentsVisibility(),!0}catch(n){return console.error("[AppDocument] \u274C Failed to insert document",n),!1}};window.deleteAppDocument=async function(t){try{return await de(t),console.log("[AppDocument] \u2705 Document deleted",{id:t}),await window.checkDocumentsVisibility(),!0}catch(n){return console.error("[AppDocument] \u274C Failed to delete document",n),!1}};window.getAllDocuments=ce;window.hasDocuments=z;function ve(){return"2.0.11"}function W(t){let n=typeof t=="string"?document.getElementById(t):t;n||(n=document.querySelector(".tf-formio-sdk")||document.body);let r=n.querySelectorAll("table"),o=0,e=null;return r.forEach(i=>{let s=i.getBoundingClientRect().width;s>o&&(o=s,e=i)}),{maxWidth:o,widestTable:e}}window.getMaxTableWidth=W;typeof window!="undefined"&&(window.UnviredForms=window.UnviredForms||{loadUnviredForms:ge,getBuildVersion:ve,getMaxTableWidth:W});return Se(Re);})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unvired/turboforms-embed-sdk",
3
- "version": "2.0.10",
3
+ "version": "2.0.11",
4
4
  "description": "Reusable vanilla JS form library that works with React, Angular, Ionic, etc.",
5
5
  "main": "dist/turboforms.js",
6
6
  "types": "dist/index.d.ts",