@wannaby/wanna-sdk 3.4.0-alpha.1 → 3.4.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.
- package/iframe.html +1 -1
- package/package.json +1 -1
- package/sdk/sdk.js +2 -2
package/iframe.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!-- Copyright © 2024 WANNABY INC. All rights reserved. --><!doctype html><html><head><meta charset="utf-8"><meta http-equiv="x-ua-compatible" content="ie=edge"><title>WANNABY / WEB-AR</title><meta name="description" content="WANNA WEB-AR"><meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=0"><meta name="apple-mobile-web-app-capable" content="yes"><meta name="mobile-web-app-capable" content="yes"><style>body,html{height:100%;margin:0;padding:0}*{touch-action:none}.wrapper{height:100%;position:relative;overflow:hidden}#background-canvases,#debug-canvases,#interactions-layer,.wrapper canvas,.wrapper video{height:100%;width:100%}#canvases-wrapper{width:100%;height:100%;display:grid;grid-auto-columns:1fr;align-content:center;justify-content:center}#canvases-wrapper>*{position:relative;grid-column-start:1;grid-row-start:1}#debug-canvases{display:flex;flex-direction:column;gap:20px}#debug-canvases>div>canvas{position:absolute}#background-canvases{z-index:-1}#debug-canvases,#debug-overlay>canvas,#interactions-layer{position:absolute;top:0;left:0}#interactions-layer{user-select:none;-webkit-user-select:none}#background-canvases canvas:not(.current-background){display:none}#debug{position:absolute;top:200px;right:0;bottom:0;min-width:220px;max-height:calc(100% - 300px);overflow:auto;color:#fff;padding:5px;text-align:right}#debug,#debug *{touch-action:pan-x pan-y}#debug>div{padding:0 5px}.has-substeps>span{font-weight:700}.has-substeps{border:1px solid;margin:5px 0}video{opacity:0;position:absolute;top:0;z-index:-1}.video-mirrored{transform:scaleX(-1)}.video-visible{opacity:1}#screen-loading-stub{width:100%;height:100%;display:none;background:#fff;position:absolute;top:0;left:0;right:0;bottom:0;z-index:99}#play-button{display:none;position:absolute;top:50%;right:0;background-color:transparent;color:transparent;outline:0;border:none}@media (orientation:landscape){.desktopWrapper.arWrapper canvas,.desktopWrapper.arWrapper video{height:100%;width:auto}.desktopWrapper.arWrapper #debug{color:#000}.desktopWrapper.arWrapper #debug>*{border-color:#000}}</style><script defer="defer" src="./core.js?
|
|
1
|
+
<!-- Copyright © 2024 WANNABY INC. All rights reserved. --><!doctype html><html><head><meta charset="utf-8"><meta http-equiv="x-ua-compatible" content="ie=edge"><title>WANNABY / WEB-AR</title><meta name="description" content="WANNA WEB-AR"><meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=0"><meta name="apple-mobile-web-app-capable" content="yes"><meta name="mobile-web-app-capable" content="yes"><style>body,html{height:100%;margin:0;padding:0}*{touch-action:none}.wrapper{height:100%;position:relative;overflow:hidden}#background-canvases,#debug-canvases,#interactions-layer,.wrapper canvas,.wrapper video{height:100%;width:100%}#canvases-wrapper{width:100%;height:100%;display:grid;grid-auto-columns:1fr;align-content:center;justify-content:center}#canvases-wrapper>*{position:relative;grid-column-start:1;grid-row-start:1}#debug-canvases{display:flex;flex-direction:column;gap:20px}#debug-canvases>div>canvas{position:absolute}#background-canvases{z-index:-1}#debug-canvases,#debug-overlay>canvas,#interactions-layer{position:absolute;top:0;left:0}#interactions-layer{user-select:none;-webkit-user-select:none}#background-canvases canvas:not(.current-background){display:none}#debug{position:absolute;top:200px;right:0;bottom:0;min-width:220px;max-height:calc(100% - 300px);overflow:auto;color:#fff;padding:5px;text-align:right}#debug,#debug *{touch-action:pan-x pan-y}#debug>div{padding:0 5px}.has-substeps>span{font-weight:700}.has-substeps{border:1px solid;margin:5px 0}video{opacity:0;position:absolute;top:0;z-index:-1}.video-mirrored{transform:scaleX(-1)}.video-visible{opacity:1}#screen-loading-stub{width:100%;height:100%;display:none;background:#fff;position:absolute;top:0;left:0;right:0;bottom:0;z-index:99}#play-button{display:none;position:absolute;top:50%;right:0;background-color:transparent;color:transparent;outline:0;border:none}@media (orientation:landscape){.desktopWrapper.arWrapper canvas,.desktopWrapper.arWrapper video{height:100%;width:auto}.desktopWrapper.arWrapper #debug{color:#000}.desktopWrapper.arWrapper #debug>*{border-color:#000}}</style><script defer="defer" src="./core.js?f5b4ae2ca3065fee2fa0"></script></head><body><div id="wrapper" class="wrapper"><div id="screen-loading-stub"></div><button id="play-button">play</button><div id="canvases-wrapper"><video autoplay muted playsinline id="video" aria-hidden="true"></video><div id="background-canvases"><canvas></canvas><canvas></canvas><canvas></canvas></div><canvas id="three-canvas"></canvas><div id="debug-overlay"></div></div><div id="debug-canvases"></div><div id="debug"></div><div id="interactions-layer"></div></div></body></html>
|
package/package.json
CHANGED
package/sdk/sdk.js
CHANGED
|
@@ -718,7 +718,7 @@ if(o&&!t)t=performance.now(),a()
|
|
|
718
718
|
else if(!o&&t)return __log()}if(c)if("visible"!==document.visibilityState){if(t)return __log()}else isElementInViewport(r)&&(t=performance.now(),a())},__handleTabVisibility=()=>__handleAll({visibility:!0}),c=function throttle(e,t){var r,n,a=!(arguments.length>2&&void 0!==arguments[2])||arguments[2]
|
|
719
719
|
return function(){clearTimeout(n),!r||Date.now()-r>t?(r=Date.now(),e.apply(this,arguments)):a&&(n=setTimeout((()=>{e.apply(this,arguments)}),t))}}((()=>__handleAll({scroll})),500)
|
|
720
720
|
return document.addEventListener("visibilitychange",__handleTabVisibility),window.addEventListener("scroll",c),{destroy:()=>{window.removeEventListener("scroll",c),document.removeEventListener("visibilitychange",__handleTabVisibility)}}},ur=__webpack_require__("79f0231592bf2e084a8a"),__awaiter=function(e,t,r,n){return new(r||(r=Promise))((function(a,c){function fulfilled(e){try{step(n.next(e))}catch(e){c(e)}}function rejected(e){try{step(n.throw(e))}catch(e){c(e)}}function step(e){e.done?a(e.value):function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}(e.value).then(fulfilled,rejected)}step((n=n.apply(e,t||[])).next())}))}
|
|
721
|
-
function areWasmFeaturesAvailable(){return __awaiter(this,void 0,void 0,(function*(){return yield(0,ur.signExtensions)()}))}const br="3.4.0"
|
|
721
|
+
function areWasmFeaturesAvailable(){return __awaiter(this,void 0,void 0,(function*(){return yield(0,ur.signExtensions)()}))}const br=JSON.parse('{"rE":"3.4.0-alpha.0"}')
|
|
722
722
|
__webpack_require__("c36a504bd4377de37173"),__webpack_require__("11c77252762262fbef7e")
|
|
723
723
|
const lr=
|
|
724
724
|
// Copyright © 2021 WANNABY Inc. All rights reserved.
|
|
@@ -765,7 +765,7 @@ var src_awaiter=function(e,t,r,n){return new(r||(r=Promise))((function(a,c){func
|
|
|
765
765
|
for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n])
|
|
766
766
|
if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var a=0
|
|
767
767
|
for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]])}return r},gr={[c]:hr.STATUS_SDK_LOADED,[E]:hr.STATUS_INITIALIZED,[_]:hr.STATUS_ERROR,[y]:hr.STATUS_RUNNING,[N]:hr.STATUS_PAUSED}
|
|
768
|
-
class PublicSdk extends Gt{constructor(){super(),Object.defineProperty(this,"coreSdkAdapter",{enumerable:!0,configurable:!0,writable:!0,value:_r}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:br}),Object.defineProperty(this,"pipelineStatus",{enumerable:!0,configurable:!0,writable:!0,value:hr.STATUS_PREPARING}),Object.defineProperty(this,"container",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"prevContainer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"iframeSrc",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"prevIframeSrc",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"verbose",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"modelId",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"inDebugMode",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"mode",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"type",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"viewportTracker",{enumerable:!0,configurable:!0,writable:!0,value:null}),this._setDefaultProps()}_setDefaultProps(){this.pipelineStatus=hr.STATUS_PREPARING,this.container=null,this.iframeSrc=null,this.verbose=!1,this.modelId=!1}isReady(){return[hr.STATUS_INITIALIZED,hr.STATUS_RUNNING,hr.STATUS_PAUSED].includes(this.pipelineStatus)}isInitializing(){return[hr.STATUS_SDK_LOADED,hr.STATUS_INITIALIZING].includes(this.pipelineStatus)}isLoaded(){return this.pipelineStatus===hr.STATUS_SDK_LOADED||this.isReady()}_initListeners(){var t=this
|
|
768
|
+
class PublicSdk extends Gt{constructor(){super(),Object.defineProperty(this,"coreSdkAdapter",{enumerable:!0,configurable:!0,writable:!0,value:_r}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:br.rE}),Object.defineProperty(this,"pipelineStatus",{enumerable:!0,configurable:!0,writable:!0,value:hr.STATUS_PREPARING}),Object.defineProperty(this,"container",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"prevContainer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"iframeSrc",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"prevIframeSrc",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"verbose",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"modelId",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"inDebugMode",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"mode",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"type",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"viewportTracker",{enumerable:!0,configurable:!0,writable:!0,value:null}),this._setDefaultProps()}_setDefaultProps(){this.pipelineStatus=hr.STATUS_PREPARING,this.container=null,this.iframeSrc=null,this.verbose=!1,this.modelId=!1}isReady(){return[hr.STATUS_INITIALIZED,hr.STATUS_RUNNING,hr.STATUS_PAUSED].includes(this.pipelineStatus)}isInitializing(){return[hr.STATUS_SDK_LOADED,hr.STATUS_INITIALIZING].includes(this.pipelineStatus)}isLoaded(){return this.pipelineStatus===hr.STATUS_SDK_LOADED||this.isReady()}_initListeners(){var t=this
|
|
769
769
|
Object.values(e).forEach((e=>{e===fe||e===B?this.coreSdkAdapter.prependListener(e,(t=>{this.emit(e,new PublicError(t))})):this.coreSdkAdapter.prependListener(e,(function(){for(var r=arguments.length,n=new Array(r),a=0;a<r;a++)n[a]=arguments[a]
|
|
770
770
|
return t.emit(e,...n)}))})),Object.entries(gr).forEach((e=>{var[t,r]=e
|
|
771
771
|
this.coreSdkAdapter.prependListener(t,(()=>this.pipelineStatus=hr[r]))}))}_logPublicMethodCall(e){this.emit(ye,{type:"log",message:"Call [".concat(e,"] method"),verbose:this.verbose})}_promisifyEvents(e){for(var{triggerEvent:t,successEvent:r,acknowledgeEvent:n,failEvent:a,acknowledgeTimeout:c=5e3,testData:o=(()=>!0),getResolveValue:i=(e=>e)}=e,s=arguments.length,f=new Array(s>1?s-1:0),d=1;d<s;d++)f[d-1]=arguments[d]
|