@aurigma/ui-framework
Version:
A platform which allows building print product personalization editors based on Aurigma's Customer's Canvas.
1 lines • 1.62 kB
JavaScript
(window.multistep_editor_jsonpFunction=window.multistep_editor_jsonpFunction||[]).push([[13],{937:function(e,t,i){"use strict";i.r(t),i.d(t,"AuWidget3DViewer",(function(){return h})),i.d(t,"widget",(function(){return h}));var s,r=i(0),a=i(2),o=i(1),n=i(736),d=i(737),l=i(545);class m{constructor(e,t,i){this.preloader=!0,this.axesHelperEnabled=!1,this.orbitsControlEnabled=!0,this.container=e,this.onLoadCallback=i,this.backgroundColor=t.backgroundColor||l.a,this.orbitsControl=t.orbitsControl,this.distance=t.distance,this.camera=t.cameraButtons,this.pauseAtEnd=t.pauseAtEnd,this.preloader=t.preloader,this.modelType=null!=t.modelType?t.modelType:s.default,this.items=t.items.map((e=>{const t=Object.assign({},e);return t.model=o.a.addTimestampToURL(e.model),t}))}}!function(e){e.default="default",e.blender="blender"}(s||(s={}));let h=class extends d.a{updateParams(e){var t;if(o.a.isEmptyArray(e.items))return;const i=e.items.some((e=>0===e.images.filter((e=>e)).length)),s=e.items.some((e=>o.a.isEmptyString(e.model)));if(i||s)return;this.origamiViewer=null,this.speed=null!==(t=e.animationSpeed)&&void 0!==t?t:this.speed,this._preloaderLockingSum=0,this.showPreloader(!0);const r=this.querySelectorShadow("#divContainer"),a=new m(r,e,(()=>{this.showPreloader(!1),this.SetAnimationSpeed(this.speed),this.PlayAnimation(),setTimeout((()=>{this.image=this.origamiViewer.renderer.domElement.toDataURL(),this.emitChange({image:this.image})}),1500)}));this.origamiViewer=new window.Aurigma.Origami.Viewer(a),setTimeout((()=>this.applyInterfaceParams(e)),250)}};h=Object(r.a)([Object(a.a)("au-widget-3d-viewer",n)],h)}}]);