@r2u/javascript-ar-sdk 6.15.0 → 6.16.0

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.
@@ -120,4 +120,4 @@
120
120
  box-shadow: none;
121
121
  }
122
122
  }
123
- `;var p=function(e,o){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&o.indexOf(n)<0&&(t[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)o.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(t[n[r]]=e[n[r]])}return t};var v=e=>{const{exitImgSrc:o="https://sdk.r2u.io/assets/exit-icon.png",expandImgSrc:t="https://sdk.r2u.io/assets/expand-icon.png",popup:r=!0,children:i=null,waterMarkPosition:l,refViewerPopup:u,ModelViewerElement:d,refViewerFunctions:v}=e,f=p(e,["exitImgSrc","expandImgSrc","popup","children","waterMarkPosition","refViewerPopup","ModelViewerElement","refViewerFunctions"]),[m,g]=(0,n.useState)(!1),b=()=>{g(!1)};(0,n.useEffect)((()=>{u&&u.current&&u.current.addEventListener("mousedown",(e=>(e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),!1)))}),[u]);const w=(0,n.useRef)(null),[h,x]=(0,n.useState)(!1);return n.createElement(s,{expanded:m,bloom:h},n.createElement("div",{className:"viewer-container"},f.glbSrc&&n.createElement(d,Object.assign({ref:v,componentDidMount:f.componentDidMount,onClick:f.onClick,onSessionTimeCollect:f.onSessionTimeCollect},f),i,r&&n.createElement("button",{className:"expand-button",type:"button",onClick:()=>{g(!0)}},n.createElement("img",{className:"expand-image",alt:"",src:t})),l&&n.createElement(a.Z,{position:l}))),r&&m&&n.createElement("div",{className:"background",onMouseDown:b},n.createElement("div",{className:"viewer-container popup"},f.glbSrc&&n.createElement(d,Object.assign({ref:w,componentDidMount:f.componentDidMount,onClick:f.onClick,onSessionTimeCollect:f.onSessionTimeCollect},f,{enableBloomButton:!1}),i,f.bloom&&n.createElement("button",{className:"bloomButton",type:"button",onMouseDown:e=>e.stopPropagation(),onClick:()=>{x(!h),w.current&&w.current.updateBloom(!h)}},h?n.createElement(c.cu,{className:"lamp"}):n.createElement(c.H_,{className:"lamp"})),n.createElement("button",{className:"exit-button",type:"button",onClick:b},n.createElement("img",{alt:"",src:o})),l&&n.createElement(a.Z,{position:l})))))},f=t(1841),m=t.n(f),g=t(7523),b=t(7374),w=t(2297),h=function(e,o,t,n){return new(t||(t=Promise))((function(r,i){function l(e){try{a(n.next(e))}catch(e){i(e)}}function u(e){try{a(n.throw(e))}catch(e){i(e)}}function a(e){var o;e.done?r(e.value):(o=e.value,o instanceof t?o:new t((function(e){e(o)}))).then(l,u)}a((n=n.apply(e,o||[])).next())}))};function x(e,o){return h(this,void 0,void 0,(function*(){const t=`/viewer-customization/customer/${u.Z.customer._id}/products/${e}?customization=${encodeURI(JSON.stringify(o))}`;return(yield(0,w.U2)(t))||{}}))}function y(e){return h(this,void 0,void 0,(function*(){const{status:o}=yield(0,w.U2)(`/job-status/${e}`);return["waiting","processing"].includes(o)?y(e):o}))}var k=t(5865);const E=({materialSlots:e,modelSlots:o})=>{e.sort(((e,o)=>e.slot>o.slot?1:e.slot<o.slot?-1:0)),o.sort(((e,o)=>e.slot>o.slot?1:e.slot<o.slot?-1:0)),o.forEach((e=>{E(e.activeModel)}))};var S=E;class C extends Error{constructor(e){super(e),this.name="ViewerError"}}var M=function(e,o,t,n){return new(t||(t=Promise))((function(r,i){function l(e){try{a(n.next(e))}catch(e){i(e)}}function u(e){try{a(n.throw(e))}catch(e){i(e)}}function a(e){var o;e.done?r(e.value):(o=e.value,o instanceof t?o:new t((function(e){e(o)}))).then(l,u)}a((n=n.apply(e,o||[])).next())}))};var P={create:({element:e,sku:o,name:t,popup:i=!0,progressBarPosition:a="top",progressBarColor:c,poster:d,autoRotate:s=!0,viewerProps:p})=>M(void 0,void 0,void 0,(function*(){return new Promise(((f,E)=>M(void 0,void 0,void 0,(function*(){if(!u.Z.init)return E(new Error("R2U - Not initialized"));if(!o)return E(new Error("R2U - Missing SKU"));const{glb:P,name:z,viewerOptions:O}=yield(0,g.Z)(o);let R=P;const A=u.Z.customer.waterMarkPosition,I=O||u.Z.customer.viewerOptions||void 0,N=(0,n.createRef)(),H=(0,n.createRef)(),V=(0,n.createRef)(),j=o=>M(void 0,void 0,void 0,(function*(){return new Promise(((l,u)=>M(void 0,void 0,void 0,(function*(){try{const{glb:u}=yield(0,g.Z)(o);R=u,r.render(n.createElement(v,Object.assign({glbSrc:R,alt:t||z,autoRotate:s,poster:d,refViewer:N,refViewerPopup:H,refViewerFunctions:V,waterMarkPosition:A,progressBarPosition:a,progressBarColor:c,popup:i},I,p,{componentDidMount:b.E9.componentDidMount,onClick:e=>{b.E9.onClick(),(null==p?void 0:p.onClick)&&(null==p||p.onClick(e))},onSessionTimeCollect:b.E9.onSessionTimeCollect,ModelViewerElement:m(),onLoad:l})),e)}catch(e){u(e)}}))))})),B=(...e)=>{var o;null===(o=V.current)||void 0===o||o.insertModelNode(...e)},$=(...e)=>M(void 0,void 0,void 0,(function*(){var o;yield null===(o=V.current)||void 0===o?void 0:o.insertSlotModelNode(...e)})),Z=(...e)=>{var o;null===(o=V.current)||void 0===o||o.deleteModelNode(...e)},T=(...e)=>{var o;null===(o=V.current)||void 0===o||o.updateBloom(...e)},U=(...e)=>{var o;null===(o=V.current)||void 0===o||o.setMaterial(...e)},D=()=>{var e;return(null===(e=V.current)||void 0===e?void 0:e.getAllSlotsMaterials())||null},F=()=>{var e;return(null===(e=V.current)||void 0===e?void 0:e.getAllSlotsModels())||null},_=(...e)=>{var o;null===(o=V.current)||void 0===o||o.setModel(...e)},L=(...e)=>{var o;null===(o=V.current)||void 0===o||o.setCamera(...e)},G=(...e)=>{var o;null===(o=V.current)||void 0===o||o.updateShadow(...e)},J=(...e)=>{var o;null===(o=V.current)||void 0===o||o.updateFog(...e)},Q=(...e)=>{var o;null===(o=V.current)||void 0===o||o.updateBloomProps(...e)},K=(...e)=>{var o;null===(o=V.current)||void 0===o||o.updateEnvironment(...e)},q=()=>{var e;return(null===(e=V.current)||void 0===e?void 0:e.getCamera())||null},W=()=>M(void 0,void 0,void 0,(function*(){if(!V.current)throw new C("Viewer not completely loaded!");const e=V.current.getCurrentCustomization();if(!e)throw new C("No customization returned!");S(e);const t=yield x(o,e);if(!t.glb){const n=yield V.current.getCustomizedModel();if(!n)throw new C("Could not export the customization glb!");t.glb=yield function(e,o,t){return h(this,void 0,void 0,(function*(){const n=`/viewer-customization/customer/${u.Z.customer._id}/products/${e}/upload-customization-data?customization=${encodeURI(JSON.stringify(o))}`,r=yield(0,w.U2)(n),i=new File([t],r.filename),l=new FormData;return Object.keys(r.fields).forEach((e=>l.append(e,r.fields[e]))),l.append("file",i),yield fetch(r.url,{method:"POST",body:l}),r.url.concat(r.fields.key)}))}(o,e,n)}if(!t.usdz){const e=yield function(e,o){return h(this,void 0,void 0,(function*(){const t=`/viewer-customization/customers/${u.Z.customer._id}/products/${e}/convert`;return yield(0,w.v_)(t,{filename:o})}))}(o,t.glb.split("/").pop());if("success"!==(yield y(e.jobId)))throw new C("Error while converting to usdz!");t.usdz=e.usdz}return x(o,e),t})),X=()=>M(void 0,void 0,void 0,(function*(){try{const e=yield W();return(0,k.activateAR)({glb:e.glb,usdz:e.usdz,mode:"ar_preferred"}),!0}catch(e){return console.error(`Error opening AR: ${e.message}`),!1}})),Y=e=>M(void 0,void 0,void 0,(function*(){try{const o=yield W(),t=`https://viewer.r2u.io/?glb=${encodeURIComponent(o.glb)}&usdz=${encodeURIComponent(o.usdz)}&autoOpen=1`;return r.render(n.createElement(l(),Object.assign({},{"data-url":t},{value:t,style:{width:"100%",height:"100%"},renderAs:"svg"})),e),!0}catch(e){return console.error(`Error generating QR Code: ${e.message}`),!1}})),ee=(...e)=>{V.current&&V.current.downloadGlb(...e)},oe=e=>M(void 0,void 0,void 0,(function*(){const o=setInterval((()=>{V.current&&(clearInterval(o),e())}),200);setTimeout((()=>{if(!V.current)throw clearInterval(o),new Error("Internal error: Unable to load viewerRefFunctions.")}),1e4)})),te=(...e)=>M(void 0,void 0,void 0,(function*(){yield oe((()=>{var o;return null===(o=V.current)||void 0===o?void 0:o.insertHotspot(...e)}))})),ne=(...e)=>M(void 0,void 0,void 0,(function*(){yield oe((()=>{var o;return null===(o=V.current)||void 0===o?void 0:o.updateHotspot(...e)}))})),re=(...e)=>M(void 0,void 0,void 0,(function*(){yield oe((()=>{var o;return null===(o=V.current)||void 0===o?void 0:o.deleteHotspot(...e)}))})),ie=(...e)=>M(void 0,void 0,void 0,(function*(){yield oe((()=>{var o;return null===(o=V.current)||void 0===o?void 0:o.showHotspot(...e)}))})),le=(...e)=>M(void 0,void 0,void 0,(function*(){yield oe((()=>{var o;return null===(o=V.current)||void 0===o?void 0:o.hideHotspot(...e)}))})),ue=(...e)=>M(void 0,void 0,void 0,(function*(){yield oe((()=>{var o;return null===(o=V.current)||void 0===o?void 0:o.focusHotspot(...e)}))})),ae=()=>{var e;return(null===(e=V.current)||void 0===e?void 0:e.getActiveHotspotId())||null},ce=(...e)=>M(void 0,void 0,void 0,(function*(){yield oe((()=>{var o;return null===(o=V.current)||void 0===o?void 0:o.lookToHotspot(...e)}))})),de=()=>{var e;return(null===(e=V.current)||void 0===e?void 0:e.getAllSlots())||null},se=(...e)=>{var o;return(null===(o=V.current)||void 0===o?void 0:o.getAnimationIds(...e))||[]},pe=(...e)=>{var o;null===(o=V.current)||void 0===o||o.playAnimation(...e)},ve=()=>{var e;null===(e=V.current)||void 0===e||e.pauseAnimation()},fe=(...e)=>M(void 0,void 0,void 0,(function*(){var o;null===(o=V.current)||void 0===o||o.stopAnimation(...e)}));r.render(n.createElement(v,Object.assign({glbSrc:R,alt:t||z,autoRotate:s,poster:d,refViewer:N,refViewerPopup:H,refViewerFunctions:V,waterMarkPosition:A,progressBarPosition:a,progressBarColor:c,popup:i},I,p,{componentDidMount:b.E9.componentDidMount,onClick:e=>{b.E9.onClick(),(null==p?void 0:p.onClick)&&(null==p||p.onClick(e))},onSessionTimeCollect:b.E9.onSessionTimeCollect,ModelViewerElement:m(),onLoad:()=>{f({setSku:j,insertModelNode:B,insertSlotModelNode:$,deleteModelNode:Z,setMaterial:U,getAllSlotsMaterials:D,updateBloom:T,getAllSlotsModels:F,setModel:_,setCamera:L,updateShadow:G,updateFog:J,updateBloomProps:Q,updateEnvironment:K,getCamera:q,insertHotspot:te,updateHotspot:ne,deleteHotspot:re,showHotspot:ie,hideHotspot:le,focusHotspot:ue,getActiveHotspotId:ae,lookToHotspot:ce,customization:{openAR:X,renderQRCode:Y},getAllSlots:de,getAnimationIds:se,playAnimation:pe,pauseAnimation:ve,stopAnimation:fe,downloadGlb:ee})}})),e)}))))}))}},5671:function(e,o,t){function n(e,o){if(!(e instanceof o))throw new TypeError("Cannot call a class as a function")}t.d(o,{Z:function(){return n}})},3144:function(e,o,t){function n(e,o){for(var t=0;t<o.length;t++){var n=o[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function r(e,o,t){return o&&n(e.prototype,o),t&&n(e,t),e}t.d(o,{Z:function(){return r}})},4942:function(e,o,t){function n(e,o,t){return o in e?Object.defineProperty(e,o,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[o]=t,e}t.d(o,{Z:function(){return n}})},1002:function(e,o,t){function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}t.d(o,{Z:function(){return n}})}}]);
123
+ `;var p=function(e,o){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&o.indexOf(n)<0&&(t[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)o.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(t[n[r]]=e[n[r]])}return t};var v=e=>{const{exitImgSrc:o="https://sdk.r2u.io/assets/exit-icon.png",expandImgSrc:t="https://sdk.r2u.io/assets/expand-icon.png",popup:r=!0,children:i=null,waterMarkPosition:l,refViewerPopup:u,ModelViewerElement:d,refViewerFunctions:v}=e,f=p(e,["exitImgSrc","expandImgSrc","popup","children","waterMarkPosition","refViewerPopup","ModelViewerElement","refViewerFunctions"]),[m,g]=(0,n.useState)(!1),b=()=>{g(!1)};(0,n.useEffect)((()=>{u&&u.current&&u.current.addEventListener("mousedown",(e=>(e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),!1)))}),[u]);const w=(0,n.useRef)(null),[h,x]=(0,n.useState)(!1);return n.createElement(s,{expanded:m,bloom:h},n.createElement("div",{className:"viewer-container"},f.glbSrc&&n.createElement(d,Object.assign({ref:v,componentDidMount:f.componentDidMount,onClick:f.onClick,onSessionTimeCollect:f.onSessionTimeCollect},f),i,r&&n.createElement("button",{className:"expand-button",type:"button",onClick:()=>{g(!0)}},n.createElement("img",{className:"expand-image",alt:"",src:t})),l&&n.createElement(a.Z,{position:l}))),r&&m&&n.createElement("div",{className:"background",onMouseDown:b},n.createElement("div",{className:"viewer-container popup"},f.glbSrc&&n.createElement(d,Object.assign({ref:w,componentDidMount:f.componentDidMount,onClick:f.onClick,onSessionTimeCollect:f.onSessionTimeCollect},f,{enableBloomButton:!1}),i,f.bloom&&n.createElement("button",{className:"bloomButton",type:"button",onMouseDown:e=>e.stopPropagation(),onClick:()=>{x(!h),w.current&&w.current.updateBloom(!h)}},h?n.createElement(c.cu,{className:"lamp"}):n.createElement(c.H_,{className:"lamp"})),n.createElement("button",{className:"exit-button",type:"button",onClick:b},n.createElement("img",{alt:"",src:o})),l&&n.createElement(a.Z,{position:l})))))},f=t(1841),m=t.n(f),g=t(7523),b=t(7374),w=t(2297),h=function(e,o,t,n){return new(t||(t=Promise))((function(r,i){function l(e){try{a(n.next(e))}catch(e){i(e)}}function u(e){try{a(n.throw(e))}catch(e){i(e)}}function a(e){var o;e.done?r(e.value):(o=e.value,o instanceof t?o:new t((function(e){e(o)}))).then(l,u)}a((n=n.apply(e,o||[])).next())}))};function x(e,o){return h(this,void 0,void 0,(function*(){const t=`/viewer-customization/customer/${u.Z.customer._id}/products/${e}?customization=${encodeURI(JSON.stringify(o))}`;return(yield(0,w.U2)(t))||{}}))}function y(e){return h(this,void 0,void 0,(function*(){const{status:o}=yield(0,w.U2)(`/job-status/${e}`);return["waiting","processing"].includes(o)?y(e):o}))}var k=t(5865);const E=({materialSlots:e,modelSlots:o})=>{e.sort(((e,o)=>e.slot>o.slot?1:e.slot<o.slot?-1:0)),o.sort(((e,o)=>e.slot>o.slot?1:e.slot<o.slot?-1:0)),o.forEach((e=>{E(e.activeModel)}))};var S=E;class C extends Error{constructor(e){super(e),this.name="ViewerError"}}var M=function(e,o,t,n){return new(t||(t=Promise))((function(r,i){function l(e){try{a(n.next(e))}catch(e){i(e)}}function u(e){try{a(n.throw(e))}catch(e){i(e)}}function a(e){var o;e.done?r(e.value):(o=e.value,o instanceof t?o:new t((function(e){e(o)}))).then(l,u)}a((n=n.apply(e,o||[])).next())}))};var P={create:({element:e,sku:o,name:t,popup:i=!0,progressBarPosition:a="top",progressBarColor:c,poster:d,autoRotate:s=!0,viewerProps:p})=>M(void 0,void 0,void 0,(function*(){return new Promise(((f,E)=>M(void 0,void 0,void 0,(function*(){if(!u.Z.init)return E(new Error("R2U - Not initialized"));if(!o)return E(new Error("R2U - Missing SKU"));const{glb:P,name:z,viewerOptions:O}=yield(0,g.Z)(o);let R=P;const N=u.Z.customer.waterMarkPosition,H=O||u.Z.customer.viewerOptions||void 0,I=(0,n.createRef)(),A=(0,n.createRef)(),V=(0,n.createRef)(),j=o=>M(void 0,void 0,void 0,(function*(){return new Promise(((l,u)=>M(void 0,void 0,void 0,(function*(){try{const{glb:u}=yield(0,g.Z)(o);R=u,r.render(n.createElement(v,Object.assign({glbSrc:R,alt:t||z,autoRotate:s,poster:d,refViewer:I,refViewerPopup:A,refViewerFunctions:V,waterMarkPosition:N,progressBarPosition:a,progressBarColor:c,popup:i},H,p,{componentDidMount:b.E9.componentDidMount,onClick:e=>{b.E9.onClick(),(null==p?void 0:p.onClick)&&(null==p||p.onClick(e))},onSessionTimeCollect:b.E9.onSessionTimeCollect,ModelViewerElement:m(),onLoad:l})),e)}catch(e){u(e)}}))))})),B=(...e)=>{var o;null===(o=V.current)||void 0===o||o.insertModelNode(...e)},T=(...e)=>M(void 0,void 0,void 0,(function*(){var o;yield null===(o=V.current)||void 0===o?void 0:o.insertSlotModelNode(...e)})),$=(...e)=>{var o;null===(o=V.current)||void 0===o||o.deleteModelNode(...e)},Z=(...e)=>{var o;null===(o=V.current)||void 0===o||o.updateBloom(...e)},U=(...e)=>{var o;null===(o=V.current)||void 0===o||o.setMaterial(...e)},D=()=>{var e;return(null===(e=V.current)||void 0===e?void 0:e.getAllSlotsMaterials())||null},F=()=>{var e;return(null===(e=V.current)||void 0===e?void 0:e.getAllSlotsModels())||null},_=(...e)=>{var o;null===(o=V.current)||void 0===o||o.setModel(...e)},L=(...e)=>{var o;null===(o=V.current)||void 0===o||o.setCamera(...e)},G=(...e)=>{var o;null===(o=V.current)||void 0===o||o.updateShadow(...e)},J=(...e)=>{var o;null===(o=V.current)||void 0===o||o.updateFog(...e)},Q=(...e)=>{var o;null===(o=V.current)||void 0===o||o.updateBloomProps(...e)},K=(...e)=>{var o;null===(o=V.current)||void 0===o||o.updateEnvironment(...e)},q=()=>{var e;return(null===(e=V.current)||void 0===e?void 0:e.getCamera())||null},W=()=>M(void 0,void 0,void 0,(function*(){if(!V.current)throw new C("Viewer not completely loaded!");const e=V.current.getCurrentCustomization();if(!e)throw new C("No customization returned!");S(e);const t=yield x(o,e);if(!t.glb){const n=yield V.current.getCustomizedModel();if(!n)throw new C("Could not export the customization glb!");t.glb=yield function(e,o,t){return h(this,void 0,void 0,(function*(){const n=`/viewer-customization/customer/${u.Z.customer._id}/products/${e}/upload-customization-data?customization=${encodeURI(JSON.stringify(o))}`,r=yield(0,w.U2)(n),i=new File([t],r.filename),l=new FormData;return Object.keys(r.fields).forEach((e=>l.append(e,r.fields[e]))),l.append("file",i),yield fetch(r.url,{method:"POST",body:l}),r.url.concat(r.fields.key)}))}(o,e,n)}if(!t.usdz){const e=yield function(e,o){return h(this,void 0,void 0,(function*(){const t=`/viewer-customization/customers/${u.Z.customer._id}/products/${e}/convert`;return yield(0,w.v_)(t,{filename:o})}))}(o,t.glb.split("/").pop());if("success"!==(yield y(e.jobId)))throw new C("Error while converting to usdz!");t.usdz=e.usdz}return x(o,e),t})),X=()=>M(void 0,void 0,void 0,(function*(){try{const e=yield W();return(0,k.activateAR)({glb:e.glb,usdz:e.usdz,mode:"ar_preferred"}),!0}catch(e){return console.error(`Error opening AR: ${e.message}`),!1}})),Y=e=>M(void 0,void 0,void 0,(function*(){try{const o=yield W(),t=`https://viewer.r2u.io/?glb=${encodeURIComponent(o.glb)}&usdz=${encodeURIComponent(o.usdz)}&autoOpen=1`;return r.render(n.createElement(l(),Object.assign({},{"data-url":t},{value:t,style:{width:"100%",height:"100%"},renderAs:"svg"})),e),!0}catch(e){return console.error(`Error generating QR Code: ${e.message}`),!1}})),ee=(...e)=>{V.current&&V.current.downloadGlb(...e)},oe=e=>M(void 0,void 0,void 0,(function*(){const o=setInterval((()=>{V.current&&(clearInterval(o),e())}),200);setTimeout((()=>{if(!V.current)throw clearInterval(o),new Error("Internal error: Unable to load viewerRefFunctions.")}),1e4)})),te=(...e)=>M(void 0,void 0,void 0,(function*(){yield oe((()=>{var o;return null===(o=V.current)||void 0===o?void 0:o.insertHotspot(...e)}))})),ne=(...e)=>M(void 0,void 0,void 0,(function*(){yield oe((()=>{var o;return null===(o=V.current)||void 0===o?void 0:o.updateHotspot(...e)}))})),re=(...e)=>M(void 0,void 0,void 0,(function*(){yield oe((()=>{var o;return null===(o=V.current)||void 0===o?void 0:o.deleteHotspot(...e)}))})),ie=(...e)=>M(void 0,void 0,void 0,(function*(){yield oe((()=>{var o;return null===(o=V.current)||void 0===o?void 0:o.showHotspot(...e)}))})),le=(...e)=>M(void 0,void 0,void 0,(function*(){yield oe((()=>{var o;return null===(o=V.current)||void 0===o?void 0:o.hideHotspot(...e)}))})),ue=(...e)=>M(void 0,void 0,void 0,(function*(){yield oe((()=>{var o;return null===(o=V.current)||void 0===o?void 0:o.focusHotspot(...e)}))})),ae=()=>{var e;return(null===(e=V.current)||void 0===e?void 0:e.getActiveHotspotId())||null},ce=(...e)=>M(void 0,void 0,void 0,(function*(){yield oe((()=>{var o;return null===(o=V.current)||void 0===o?void 0:o.lookToHotspot(...e)}))})),de=()=>{var e;return(null===(e=V.current)||void 0===e?void 0:e.getSceneTree())||null},se=(...e)=>{var o;null===(o=V.current)||void 0===o||o.playAnimation(...e)},pe=()=>{var e;null===(e=V.current)||void 0===e||e.pauseAnimation()},ve=(...e)=>M(void 0,void 0,void 0,(function*(){var o;null===(o=V.current)||void 0===o||o.stopAnimation(...e)}));r.render(n.createElement(v,Object.assign({glbSrc:R,alt:t||z,autoRotate:s,poster:d,refViewer:I,refViewerPopup:A,refViewerFunctions:V,waterMarkPosition:N,progressBarPosition:a,progressBarColor:c,popup:i},H,p,{componentDidMount:b.E9.componentDidMount,onClick:e=>{b.E9.onClick(),(null==p?void 0:p.onClick)&&(null==p||p.onClick(e))},onSessionTimeCollect:b.E9.onSessionTimeCollect,ModelViewerElement:m(),onLoad:()=>{f({setSku:j,insertModelNode:B,insertSlotModelNode:T,deleteModelNode:$,setMaterial:U,getAllSlotsMaterials:D,updateBloom:Z,getAllSlotsModels:F,setModel:_,setCamera:L,updateShadow:G,updateFog:J,updateBloomProps:Q,updateEnvironment:K,getCamera:q,insertHotspot:te,updateHotspot:ne,deleteHotspot:re,showHotspot:ie,hideHotspot:le,focusHotspot:ue,getActiveHotspotId:ae,lookToHotspot:ce,customization:{openAR:X,renderQRCode:Y},getSceneTree:de,playAnimation:se,pauseAnimation:pe,stopAnimation:ve,downloadGlb:ee})}})),e)}))))}))}},5671:function(e,o,t){function n(e,o){if(!(e instanceof o))throw new TypeError("Cannot call a class as a function")}t.d(o,{Z:function(){return n}})},3144:function(e,o,t){function n(e,o){for(var t=0;t<o.length;t++){var n=o[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function r(e,o,t){return o&&n(e.prototype,o),t&&n(e,t),e}t.d(o,{Z:function(){return r}})},4942:function(e,o,t){function n(e,o,t){return o in e?Object.defineProperty(e,o,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[o]=t,e}t.d(o,{Z:function(){return n}})},1002:function(e,o,t){function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}t.d(o,{Z:function(){return n}})}}]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@r2u/javascript-ar-sdk",
3
- "version": "6.15.0",
3
+ "version": "6.16.0",
4
4
  "main": "dist/index.js",
5
5
  "unpkg": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -26,7 +26,7 @@
26
26
  "dependencies": {
27
27
  "@r2u/analytics": "^4.3.3",
28
28
  "@r2u/react-ar-components": "^5.4.15",
29
- "@r2u/viewer": "^1.6.0",
29
+ "@r2u/viewer": "^1.7.0",
30
30
  "@types/react-slick": "^0.23.10",
31
31
  "i18next": "^20.2.1",
32
32
  "i18next-chained-backend": "^2.1.0",