@shijiu/jsview 2.2.201 → 2.2.373

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.
@@ -0,0 +1,2 @@
1
+ /* eslint-disable */ let t={sRenderBridge:null,sActivityManager:null,DesignMap:null};window.Forge=t;let s=function(t){},e=function(t){},i=function(t){},n=function(t){throw new Error(t)};class r{constructor(){this.i=[],this.h=[],this.l=[],this.o={}}RequestAlterId(t,s){this.o[t]=s}AddToQueue(t,s){this.i.push(s),this.h.push(t)}HasUpdate(){return this.i.length>0}ReadSyncList(){if(this.l.length>0){for(let t of this.l)t();this.l=[]}let t=this.i;return this.RenewSyncList(),t}AddStartSyncCallback(t){this.l.push(t)}RenewSyncList(){if(this.h)for(let t of this.h)t.RenewSyncInfo(this,null);this.i=[],this.h=[]}ProcAlterIds(t,s){for(let e=0;e<t.length;e++)if(this.o.hasOwnProperty(t[e])){let i=this.o[t[e]];i.OnAlterId(s[e]),i.RenewSyncInfo(this,null)}else console.error(`Error: ProcAlterIds not found proxyId=${t[e]}`);this.o={}}}class h{constructor(t,s=null,e=null){this.u=t,this.PrefSyncInfo=null,this.p=null,this.S=!1,this.v=s,this.SuffSyncInfo=null,this.N=null,this.I=!1,this.InitPackage(e),this.RenewSyncInfo(this.u,null),this.RenewSyncInfo(this.v,null)}AddStartSyncCallback(t){this.u.AddStartSyncCallback(t)}CallToNative(s,e,i=!1){let n={fn:s,a:e};return i?(this.N.push(n),this.I||(this.v.AddToQueue(this,this.SuffSyncInfo),this.I=!0)):(this.p.push(n),this.S||(this.u.AddToQueue(this,this.PrefSyncInfo),this.S=!0)),t.sRenderBridge.RequestSwap(),n}RequestAlterId(t,s=!1){s?this.v.RequestAlterId(t,this):this.u.RequestAlterId(t,this)}SuffCallToNative(t,s){return{fn:t,a:s}}AlterCallParams(t,s){t&&(t.a=s)}RenewSyncInfo(t,s){s||(s={}),this.S=!1,this.I=!1,t&&t==this.u&&(this.p=[],this.PrefSyncInfo={tl:this.p,...s}),t&&t==this.v&&(this.N=[],this.SuffSyncInfo={tl:this.N,...s})}InitPackage(t){}OnAlterId(t){}}let l=new r,a=new r;class o extends h{constructor(t){super(l,a,{id:t}),this.C=null,this.R=t}InitPackage(t){this.R=t.id}RenewSyncInfo(t,s){super.RenewSyncInfo(t,{tt:1,id:this.R})}NeedAlterId(t,s){this.C=t,super.RequestAlterId(this.R,s)}OnAlterId(t){this.R=t,this.C.TexId=t,this.C=null}}let u=new class extends h{constructor(){super(l,a)}RenewSyncInfo(t,s){super.RenewSyncInfo(t,{tt:0})}};let c=new class{constructor(){this.A=[1]}AddData(t){return this.A.push(t),this.A.length-1}TakeArray(){const t=this.A;return this.A=[1],t}PickArray(){return this.A}GetSize(){return this.A.length}ResetForNextSwap(){this.A=[1]}};let d=1;class p{constructor(t,s,e=!1){this.O=s,this.TexId=t,this.k=!1,this.P=0,this.D=0,this.G=null,this.F={},this._=e}GetTextureId(){return this.TexId}RequestSyncerAlterId(){this.O.NeedAlterId(this,this._)}RegisterLoadImageCallback(t,s,e){if(null==s)return 0;if(this.k)return s({width:this.P,height:this.D},e),0;{this.B();const t=d++,i=this,n=(n,r,h)=>{s({width:n,height:r,extra:h?JSON.parse(h):null},e),delete i.F[t]};this.F[t]=n;const r=c.AddData(n);return this.O.CallToNative(1,[t,r],this._),t}}UnregisterLoadImageCallback(t){t>0&&void 0!==this.F[t]&&delete this.F[t]}DispatchCommand(s,e){this.O.CallToNative(3,[s,e],this._),t.sRenderBridge.RequestSwap()}B(){if(null==this.G){const t=this;this.G=(s,e,i)=>{t.k=!0,t.P=s,t.D=e};const s=c.AddData(this.G);this.O.CallToNative(1,[d++,s],this._)}}EnableBackgroundLoad(){this.k||(this.B(),this.O.CallToNative(4,null,this._))}DisableBackgroundLoad(){this.O.CallToNative(5,null,this._)}RequestToUnload(){this.O.CallToNative(6,null,this._)}DisableAutoRecycle(){this.O.CallToNative(7,null,this._)}}class f extends p{constructor(t,s,e=!1){super(t,s,e),this.V=null}registerOnStart(t){this.U();let s=this.V,e=++s.IdGen;if(s.StartMapCount++,s.StartMapCount>0&&0==s.GlobalStartCallbackId){s.GlobalStartCallbackId=e;const t=()=>{for(let t in s.OnStartMap)s.OnStartMap[t]?.()},i=c.AddData(t);this.O.CallToNative(10,[s.GlobalStartCallbackId,i],this._)}return s.OnStartMap[e]=t,e}unregisterOnStart(t){if(!this.V)return;let s=this.V;s.OnStartMap.hasOwnProperty(t)&&s.StartMapCount--,0==s.StartMapCount&&0!=s.GlobalStartCallbackId&&(this.O.CallToNative(11,[s.GlobalStartCallbackId],this._),s.GlobalStartCallbackId=0)}registerOnEnd(t){this.U();let s=this.V,e=++s.IdGen;if(s.EndMapCount++,s.EndMapCount>0&&0==s.GlobalEndCallbackId){s.GlobalEndCallbackId=e;const t=()=>{for(let t in s.OnEndMap)s.OnEndMap[t]?.()},i=c.AddData(t);this.O.CallToNative(12,[s.GlobalEndCallbackId,i],this._)}return s.OnEndMap[e]=t,e}unregisterOnEnd(t){if(!this.V)return;let s=this.V;s.OnEndMap.hasOwnProperty(t)&&s.EndMapCount--,0==s.EndMapCount&&0!=s.GlobalEndCallbackId&&(this.O.CallToNative(13,[s.GlobalEndCallbackId],this._),s.GlobalEndCallbackId=0)}U(){this.V||(this.V={IdGen:1,GlobalStartCallbackId:0,OnStartMap:{},StartMapCount:0,GlobalEndCallbackId:0,OnEndMap:{},EndMapCount:0})}}class y extends f{constructor(t,s){super(t,s,!0)}}let S=global.NativeGetIdGroupIntf();const v=10;class w{constructor(t){this.W=t,this.J=0,this.q=0,this.K=new Array(v),this.j=0;for(let t=0;t<v;t++)this.K[t]={start:0,end:0,expired:!0}}genId(){this.K[this.J].expired&&this.Y();let t=this.K[this.J],s=t.start;return t.start++,t.start>t.end&&(t.expired=!0,this.J=(this.J+1)%v,this.j--),s}Y(){let t=20*(v-this.j);if(t>0){let s=S.GetIdArray(this.W,t);if(s){let t=JSON.parse(s);this.X(t[0],t[1])}}}X(t,s){let e=s-t+1,i=Math.floor(e/20),n=t;for(let t=0;t<i;t++){let t=this.K[this.q];t.start=n,t.end=n+20-1,t.expired=!1,this.q=(this.q+1)%v,n=t.end+1}this.j+=i,this.j>v&&console.error(`team over size to ${this.j}`)}}let m=new class{constructor(){this.$=new w(0),this.Z=new w(1),this.et=new w(2),this.it=new w(3)}genViewId(){return this.$.genId()}genTextureId(){return this.Z.genId()}genAnimationId(){return this.et.genId()}genSensorId(){return this.it.genId()}};var x,N,g;!function(t){t.RGBA_8888="RGBA_8888",t.RGBA_4444="RGBA_4444",t.RGBA_5551="RGBA_5551",t.RGB_565="RGB_565",t.RGB_ETC1="RGB_ETC1",t.RGBA_ETC1="RGBA_ETC1"}(x||(x={})),function(t){t.L=1,t.M=0,t.Q=3,t.H=2}(N||(N={})),function(t){t.AUTO=0,t.SYNC=1,t.ASYNC=2}(g||(g={}));class I{constructor(){this.O=u}GetId(){return 0}GetColorTexture(t){let s=m.genTextureId();this.O.CallToNative(1,[t,s]);let e=new p(s,new o(s));return e.RequestSyncerAlterId(),e}GetImage(t,s,e){return this.GetImage2(t,s,null,null,e)}GetImage2(t,s,e,n=x.RGBA_8888,r="",h=!1){if(!t||0==t.length)return i("GetImage2, url is not setted!"),null;let l=m.genTextureId(),a=0,u=0;e&&(a=e.width,u=e.height),n||(n=x.RGBA_8888),r||(r="");let c=null!=h&&h;this.O.CallToNative(2,[t,a,u,n,r,c,l]);let d=new p(l,new o(l));return d.RequestSyncerAlterId(),d}GetQRCodeTexture(t,s,e,i=g.AUTO,n=N.Q,r="#ffffff",h="#000000",l=-1){let a=m.genTextureId();return this.O.CallToNative(3,[t,s,e,n,r,h,l,i,a]),new p(a,new o(a))}GetDownloadTexture(t,s,e){if(!t)return i("GetDownloadTexture, url is null!"),null;let n=m.genTextureId();return this.O.CallToNative(4,[t,s,e,n]),new p(n,new o(n))}GetDomProxyTexture(t){let s=m.genTextureId();return this.O.CallToNative(5,[t,s],!0),new y(s,new o(s))}GetCanvasTexture(t,s){let e=m.genTextureId();return this.O.CallToNative(6,[t,s,e],!1),new p(e,new o(e))}GetPluginTexture(t,s){let e=m.genTextureId();return this.O.CallToNative(7,[t,s,e],!1),new p(e,new o(e))}GetCapturedTexture(){let t=m.genTextureId();return this.O.CallToNative(8,[t],!1),new p(t,new o(t))}}let b=new class{constructor(){this.nt=1}get count(){return this.nt}update(){this.nt<Number.MAX_SAFE_INTEGER?++this.nt:this.nt=1}},C=new r,R=new r;let A=new class extends h{constructor(){super(C,R)}RenewSyncInfo(t){super.RenewSyncInfo(t,{tt:0})}};class O extends h{constructor(t){super(C,R,{id:t}),this.rt=t}InitPackage(t){this.rt=t.id}RenewSyncInfo(t){super.RenewSyncInfo(t,{tt:1,id:this.rt})}}let T=new r,k=new r;class E extends h{constructor(t){super(T,k,{id:t}),this.ht=t}InitPackage(t){this.ht=t.id}RenewSyncInfo(t){super.RenewSyncInfo(t,{tt:1,id:this.ht})}}let P=new class extends h{constructor(){super(T,k)}RenewSyncInfo(t){super.RenewSyncInfo(t,{tt:0})}},D=new r;class G extends h{constructor(t){super(null,D,{id:t}),this.lt=t}InitPackage(t){this.lt=t.id}RenewSyncInfo(t,s){super.RenewSyncInfo(t,{tt:1,id:this.lt})}}let L=new class extends h{constructor(){super(null,D)}RenewSyncInfo(t,s){super.RenewSyncInfo(t,{tt:0})}};var F=null,M=null;class _{constructor(){this.ot={width:160,height:90,x:2/160,y:2/90,perspective:2/160,scaleRatio:1,designedWidth:1280},this.SwapCurrentTime=Date.now(),this.SwapCurrentCount=0,this.ct=new Map,this.dt=this.ft.bind(this),this.yt={hdl:null},this.St=!0,this.vt=-1,this.wt=!1,this.xt=1,this.St=!1,this.Nt(),this.It=!1,this.bt=[],this.Ct=1,this.Rt.OnScreenHide&&window.JsView?.onVisibilityChange((t=>{'{"status":"hide"}'===t&&this.Rt.OnScreenHide()}))}Nt(){void 0!==global.NativeSendImpactSensorSyncData&&global.NativeSendImpactSensorSyncData.bind(this.yt),void 0!==global.NativeSetStepFpsSwitch&&(F=global.NativeSetStepFpsSwitch.bind(this.yt)),void 0!==global.NativeSetGlobalConfig&&(M=global.NativeSetGlobalConfig.bind(this.yt)),this.Rt=global.NativeGetRenderIntf(),this.Rt.RegisterSwapFunc((()=>{this.RequestSwap()})),this.At=this.At.bind(this),this.Rt.RegisterPreDomSyncFunc((()=>{this.Ot()})),this.Rt.RegisterOnScreenInfo(this.Tt.bind(this))}SetStepFpsSwitch(t){this.St?F&&F(t):(console.warn("SetStepFpsSwitch(): API link status no ready!"),this.bt.push((()=>{this.SetStepFpsSwitch(t)})))}SetGlobalConfig(t){if(this.St){if(M){let s=JSON.stringify(t);console.log("SetGlobalConfig set with "+s),M(s),console.log("SetGlobalConfig set done")}}else console.warn("SetGlobalConfig(): API link status no ready!"),this.bt.push((()=>{this.SetGlobalConfig(t)}))}kt(){if(this.bt.length>0){for(let t=0;t<this.bt.length;t++)this.bt[t]();this.bt=[]}}RequestSwap(){this.wt?this.Ct++:(this.wt=!0,this.Ct++,this.xt++,this.Et(this.xt))}Et(t){let s=this,e=this.Ct;Promise.resolve().then((()=>{e==s.Ct?s.InstantPerformSwap():t==this.xt&&s.Et(t)}))}NotifyNetTypeStatus(t,s){}EnableRequestSwap(t){this.It=t,this.Rt.EnableRequestSwap(t)}InstantPerformSwap(){this.wt&&(this.wt=!1,this.xt++,this.At(!1))}Pt(t,s,e,i,n){let r=null,h=null,l=null,a=null,o=null;if(t.HasUpdate()&&(l=t.ReadSyncList()),s.HasUpdate()&&(h=s.ReadSyncList()),e.HasUpdate()&&(r=e.ReadSyncList()),i?.HasUpdate()&&(a=i.ReadSyncList()),null==r&&null==h&&null==l&&null==a||(o=this.Rt.SyncForgeJsCall(JSON.stringify({TexSync:l,AnimSync:h,ViewSync:r,SensorSync:a}),n)),o){let s;this.wt=!1,s=JSON.parse(o).TexSyncRet,s&&this.Dt(t,s)}}Ot(){this.Pt(l,C,T,null,c.PickArray())}At(t){if(!this.It)return void(this.wt=!1);b.update();let s=c.GetSize();if(this.Pt(l,C,T,null,c.PickArray()),this.ct.size>0&&this.ct.forEach(this.dt),this.Pt(a,R,k,D,c.PickArray()),s==c.GetSize())c.ResetForNextSwap();else{let t=c.GetSize();t>50&&console.warn("Warning: temp sync store kept with large size = "+t)}t=!!t,this.wt=!1,this.SwapCurrentTime=Date.now(),this.SwapCurrentCount++,this.Rt.DoRequestSwap(t)}GetScreenInfo(){return this.ot}SetForgeRtHandler(t){this.yt.hdl=t,this.St=!0,this.Rt.SetForgeRtHandler(t),this.kt()}InitScreenBuffer(t,s){isNaN(t)&&(t=1),isNaN(s)&&(s=1280);var e=s*t,i=e/16*9;this.ot.width=Math.floor(e),this.ot.height=Math.floor(i),this.ot.x=2/this.ot.width,this.ot.y=2/this.ot.height,this.ot.perspective=this.ot.x,this.ot.scaleRatio=t,this.ot.designedWidth=s}InitNativeScreenBuffer(){if(this.St){var t=JSON.stringify({displayScaleRatio:this.ot.scaleRatio,designedMapWidth:this.ot.designedWidth});this.Rt.InitScreenBuffer(t)}else console.warn("InitNativeScreenBuffer(): API link status no ready!")}SyncBackStatus(t,s){this.Rt.SyncBackStatus(t,s)}TakeAndSyncBackStatus(){1==this.Rt.TakeAndSyncBackStatus()&&this.RequestSwap()}Tt(t,s,e,i,n){this.ot.width=t,this.ot.height=s,this.ot.x=e,this.ot.y=i,this.ot.perspective=n}HasPendingRenderBreak(){return!!this.St&&this.Rt.HasPendingRenderBreak()}FinishRenderBreak(t){this.St?this.Rt.FinishRenderBreak(t):(console.warn("FinishRenderBreak(): API link status no ready, delay"),this.bt.push((()=>{this.Rt.FinishRenderBreak(t)})))}AddWillSwapListener(t,s){this.ct.set(t,s)}AddSwappedOnceObserver(t){this.St?this.Rt.AddSwappedOnceObserver(t):(console.warn("AddSwappedOnceObserver(): API link status no ready, delay"),this.bt.push((()=>{this.Rt.AddSwappedOnceObserver(t)})))}ActiveComponent(t){this.St?this.Rt.ActiveComponent(t):(console.warn("ActiveComponent(): API link status no ready, delay"),this.bt.push((()=>{this.Rt.ActiveComponent(t)})))}ShutdownComponents(t){this.St?this.Rt.ShutdownComponents(t):(console.warn("ShutdownComponents(): API link status no ready, delay"),this.bt.push((()=>{this.Rt.ShutdownComponents(t)})))}ft(t){t()}Dt(t,s){let e;e=s.idAlter,e&&t.ProcAlterIds(e.proxy,e.real)}}class B{constructor(){this.Gt=!1,this.Lt=0,this.Ft=!1,this.Mt=0,this._t=0,this.Bt=!1,this.Vt=!1,this.Ut=0,this.Wt=0,this.Jt=void 0!==window.jRuntimeBridge?.getSystemUptimeMillis,this.Jt&&(this.Bt=!0,this.qt())}SetTranslateDelay(t){B.sKeyTranslateDelay=t}CheckKey(t){if(!t.timeStamp||this.Gt)return!1;this.Ft=!0;const s=Date.now(),i=t.timeStamp;!this.Bt&&i-this.Lt>3e3&&(this.Mt=s,this._t=i,this.Lt=i);let n=s-this.Mt;(n<0||n>5e3)&&(this.Jt?this.qt():(this.Mt=s,this._t=i),n=0);return n+this._t-i>B.CONST_MAX_PASSING_GAP&&Math.abs(this.Wt-i)<B.CONST_MIN_VALID_KEY_GAP&&!t.repeat?(!this.Vt&&this.Bt&&(this.Ut++,this.Ut>50&&e("More than 50 keys are expired...")),!0):(this.Vt||(this.Vt=!0),this.Wt=i,!1)}toggleKeyGuard(){this.Gt=!this.Gt}IsActive(){return this.Ft}qt(){this.Mt=Date.now(),this._t=window.jRuntimeBridge.getSystemUptimeMillis()-B.sKeyTranslateDelay}}B.CONST_MAX_PASSING_GAP=20,B.CONST_MIN_VALID_KEY_GAP=180,B.sKeyTranslateDelay=5;let V,U=new B;class W{constructor(n,r,h){var l;if(this.Kt=null,this.Ht=1280,this.zt=!1,this.jt=0,l=4,console.log.bind(console),l>0&&console.error.bind(console),l>1&&(s=console.error.bind(console)),l>2&&(e=console.warn.bind(console)),l>3&&(i=console.log.bind(console)),l>4&&console.debug.bind(console),this.Yt=new I,this.Xt=new _,t.sRenderBridge=this.Xt,isNaN(h)&&(h=1280),this.Ht=h,this.zt=!1,this.Qt(n,r,h),this.$t={keyProc:null,keyUpProc:null},this.Zt(this.$t),this.ts=this.Xt.InstantPerformSwap.bind(this.Xt),null!=n){this.jt=n.canvasNativeHandle;for(let t in this.$t)n[t]=this.$t[t]}t.sActivityManager=this,console.log("manager done")}GetTextureManager(){return this.Yt}DelayedActivateCanvas(t){if(0==this.jt){this.jt=t.canvasNativeHandle,this.ss(t);for(let s in this.$t)t[s]=this.$t[s];this.Xt.InitNativeScreenBuffer(),this.Xt.RequestSwap()}else s("Error: already activated")}GetCanvasHandler(){return this.jt}StartActivity(t){this.Kt=t}Qt(t,s,e){this.ss(t),this.Xt.InitScreenBuffer(s,e)}ss(t){null!=t&&(this.Xt.SetForgeRtHandler(t.frtNativeHandle),t.renderBridge=this.Xt,this.Xt.EnableRequestSwap(!0))}es(t){if(this.zt)return!0;var s=!0;if(this.Kt){if(U.CheckKey(t))return console.log("keyEventGuard ignore keys"),!1;U.IsActive()&&this.Xt.InstantPerformSwap(),s=!this.Kt.DispatchKeyDown(t),this.Xt.TakeAndSyncBackStatus()}return s}ns(t){if(this.zt)return!0;var s=!0;return this.Kt&&(s=!this.Kt.DispatchKeyUp(t),this.Xt.TakeAndSyncBackStatus()),s}Zt(t){t.keyProc=this.es.bind(this),t.keyUpProc=this.ns.bind(this)}}class J{constructor(){this.rs=null}Init(t){let s=1280,e=1;try{if(K){let t=K();"number"==typeof t.width&&(s=t.width),"number"==typeof t.displayScale&&(e=t.displayScale)}}catch(t){console.log("Note: DesignMap failed")}this.rs=new W(t,e,s),q?q(this.rs):console.error("FATAL: no found entry")}getActivityManager(){return this.rs}}let q=null,K=null;class H{constructor(t){this.PageName=t,this.hs=null,this.ls=null,this.SubPages=[],this.os=null,this.zt=!1}OnRenderFrame(){s("OnRenderFrame() MUST override")}OnKeyDown(t){return!1}OnKeyUp(t){return!1}DispatchKeyDown(t){if(this.zt)return!0;let s=!1;return this.hs&&(s=this.hs.DispatchKeyDown(t)),s||(s=this.OnKeyDown(t)),s}OnCustomEvent(t){return!1}BubbleCustomEvent(t){this.OnCustomEvent(t)||this.os&&this.os.BubbleCustomEvent(t)}DispatchKeyUp(t){if(this.zt)return!0;let s=!1;return this.hs&&(s=this.hs.DispatchKeyUp(t)),s||(s=this.OnKeyUp(t)),s}PrintLastFocusPage(){let t="------"+this.PageName+"\n",s=this.os;return s&&(t+=s.PrintLastFocusPage()),t}IsFocus(){return!this.os||this.os.hs==this}us(){return this.IsFocus()&&!this.hs}SetParent(t){null!=t?(this.os=t,t.SubPages.push(this)):n("ERROR: parent is null")}SetParentPage(t){this.SetParent(t)}OnRemoveFromTree(){if(this.os=null,this.SubPages&&this.SubPages.length>0){for(let t of this.SubPages)t.OnRemoveFromTree();this.SubPages=[]}}RemoveSubPage(t){t==this.hs&&(this.hs=null),t==this.ls&&(this.ls=null);for(let s=0;s<this.SubPages.length;s++)if(t==this.SubPages[s]){this.SubPages.splice(s,1);break}}ClearSubPages(){this.SubPages=[],this.hs=null,this.ls=null}GetParentPage(){return this.os}Focus(t=!1){if(this.IsFocus()){if(!t)return void i("requestFocus(): Already focused name="+this.PageName);if(this.us())return void i("requestFocus(): Already focused name="+this.PageName)}if(z)return void j.push(this);if(z=!0,this.os){let s,e=[],i=this;for(;i.os&&!i.IsFocus();)e.push(i),i=i.os;s=t&&0==e.length?this.hs:e[e.length-1].os?.hs;let r=[];for(;s;)r.push(s),s=s.hs;for(let t=r.length-1;t>=0;t--)r[t].cs();for(let t=e.length-1;t>=0;t--)e[t].ds();if(t)this.ls=null;else{let t=e[0];for(;t.ls&&null==t.hs;)t.ls.ds(),t=t.hs,t||n("ERROR: focus chain is broken")}}z=!1;let s=j.length;if(s>0){let t=j;j=[];for(let e=0;e<s;e++)t[e].Focus()}}ReturnFocusToParent(){this.os&&(this.IsFocus()&&this.os.Focus(!0),this.os.hs==this&&(this.os.hs=null),this.os.ls==this&&(this.os.ls=null))}ds(){this.os?(this.os.hs=this,this.os.ls=this,this.OnFocus()):s("No dispatcher")}cs(){this.os?this.os.hs==this?(this.os.hs=null,this.OnBlur()):e("Not focus yet, page name="+this.PageName):s("No dispacher")}GetFocusChild(){return this.hs}OnFocus(){e("No overrided Page OnFocus event, page name="+this.PageName)}OnBlur(){e("No overrided Page OnBlur event, page name="+this.PageName)}KeyLock(){this.zt=!0}UnKeyLock(){this.zt=!1}}let z=!1,j=[];var Y;!function(t){t.VIEW_COMMAND=0,t.TEXTURE_COMMAND=1,t.ANIM_COMMAND=2,t.SYNC_COMMAND=3,t.APIC_PLAY=0,t.APIC_STOP=1,t.GET_BOUNDING_RECT=0,t.FILTER_VIEW_WAVE=1,t.TRANSLATE_FRAME_ALT_SPEED=0,t.FREE_MOVE_RUN_CMDPACKS=1,t.EXE_DEFAULT=0,t.EXE_AFTER_RENDER=1}(Y||(Y={}));const X=(t,s)=>{let e=0,i=0,n=0;return isNaN(t)||(e|=1,i=t),isNaN(s)||(e|=2,n=s),{e:e,x:i,y:n}};var Q,$,Z;!function(t){t.ActEvent_ActFinish=1,t.ActEvent_Speed_X_Revert=2,t.ActEvent_Speed_Y_Revert=3,t.ActEvent_ActReject=4,t.ActEvent_ActDragStart=5,t.ActEvent_ActDragEnd=6,t.ActEvent_ActFlingStart=7,t.ActEvent_ActFlingProgress=8,t.ActEvent_ActFlingEnd=9,t.ActEvent_ActTouchDown=10,t.ActEvent_ActTouchRelease=11,t.ActEvent_ActFlingCancel=12,t.ActEvent_ActFlingDrop=13,t.ActEvent_MovementSync=14}(Q||(Q={})),function(t){t.GroupType_ActionAssoc=10,t.GroupType_Fling=11,t.GroupType_Invalid_Ext=65535}($||($={})),function(t){t.FLING_ON_PROGRESS_INTERVAL=200}(Z||(Z={}));const tt=(t,s)=>{t.gtype=s.g,t.once=s.m?0:1;let e=s.s;e&&(t.name=e),t.brk=s.brk?1:0};const st=51;function et(t){return t?JSON.stringify(t.Package()):null}let it=new class{constructor(){this.O=A}CreateTranslate(t,s,e,i,n,r,h){n!=1/0&&null!=n||(console.warn("translate animation duration invalid="+n),n=0),this.O.CallToNative(1,[t,s,e,i,n,et(r),h])}CreateRotate(t,s,e,i,n,r,h){n!=1/0&&null!=n||(console.warn("rotate animation duration invalid="+n),n=0),this.O.CallToNative(2,[t,s,e.x,e.y,e.z,i.x,i.y,i.z,n,et(r),h])}CreateScale(t,s,e,i,n,r,h,l,a,o,u){a!=1/0&&null!=a||(console.warn("scale animation duration invalid="+a),a=0),this.O.CallToNative(3,[t,s,e,i,n,r,h,l,a,et(o),u])}CreateTranslateFrame(t,s,e,i,n,r,h,l){this.O.CallToNative(5,[t,s,e,i,!!n,r,h,l])}CreateCssKeyframe(t,s,e,i,n,r){s!=1/0&&null!=s||(console.warn("css animation duration invalid="+s),s=0),this.O.CallToNative(6,[t,s,e,i,n,r])}CreateFreeMoveAnimation(t,s,e,i){this.O.CallToNative(7,[t,s?c.AddData(s):0,e,i?1:0])}CreateShaderAnimation(t,s,e){this.O.CallToNative(8,[t,s,e])}};class nt{constructor(){this.AnimNativeId=m.genAnimationId(),this.O=new O(this.AnimNativeId),this.ps=null,this.fs=null}SetAnimationListener(t){this.ys(t)}AddAnimationListener(t){this.ps&&t.AddInherit(this.ps),this.ys(t)}RemoveAnimationListener(){this.ps=null}Enable(t){this.O.CallToNative(2,[t])}EnableInfinite(){return this.O.CallToNative(3,null),this}SetRepeat(t){return this.O.CallToNative(5,[t]),this}EnableDelay(t){return this.O.CallToNative(4,[t]),this}SetStartPos(t){return t>=0&&t<=1?this.O.CallToNative(6,[t]):console.warn("Warning: SetStartPos() out of range"),this}ys(t){let s=!0;if(this.ps&&(s=this.ps.ListenerEnabledFlags==t.ListenerEnabledFlags),this.ps=t,null!=this.ps&&(null==this.fs||!s)){let t=this;this.fs=s=>{t.ps?.InvokeFromNativeForge(s)};let s=c.AddData(this.fs);this.O.CallToNative(1,[s,this.ps.ListenerEnabledFlags])}}}var rt,ht;!function(t){t.ReleaseAfterEndCallback=1,t.KeepTransform=2,t.AckFinalProgress=4,t.AckRepeat=8}(rt||(rt={})),function(t){t.AltSpeed=(t,s,e)=>{let i={S60:Math.floor(100*s/55)/100,T:e};t?.DispatchAnimCommand(Y.TRANSLATE_FRAME_ALT_SPEED,JSON.stringify(i))},t.RunFreeMoveCmdPacks=(t,s)=>{t?.DispatchAnimCommand(Y.FREE_MOVE_RUN_CMDPACKS,JSON.stringify(s))}}(ht||(ht={}));class lt{constructor(){this.Ss="COMMON"}Type(){return this.Ss}ToSyncJsonObj(t){return t||(t={}),t.typ=this.Ss,t}}let at=new class{constructor(){this.vs={},this.ws=0}add(t){let s=t.view.ViewId;return this.vs.hasOwnProperty(s)&&(this.vs[s]=t),s}remove(t){this.vs[t]&&delete this.vs[t]}get(t){return this.vs[t]}clear(){this.vs={},this.ws=0}};class ot{constructor(){this.SensorId=m.genViewId(),this.xs=new G(this.SensorId),this.CreateSensor()}CreateSensor(){}CreateTypedSensor(t){L.CallToNative(1,[this.SensorId,t],!0)}Recycle(){this.xs.CallToNative(1,null,!0)}}class ut{constructor(t,s,e,i){this.Texture=t,this.MaskSetting=s,void 0===i&&(i=!0),this.HasAlpha=i}ToSyncJsonObj(t=void 0){return t||(t={}),t.texId=this.Texture?this.Texture.TexId:0,t.alpha=this.HasAlpha,this.MaskSetting?t.mask=this.MaskSetting.ToSyncJsonObj():t.mask=null,t}}var ct;!function(t){var s,e,i;(s=t.ControlType||(t.ControlType={})).DoKeepInRender=1,s.RecycleKeptView=2,(e=t.SyncedType||(t.SyncedType={})).Synced=0,e.NotSynced=1,e.RequestKeepInRender=2,e.OnKeepingInRender=3,e.RecycleKeeping=4,(i=t.TextureCoordAnchor||(t.TextureCoordAnchor={})).LeftTop=1,i.CenterTop=2,i.RightTop=3,i.LeftMiddle=4,i.Center=5,i.RightMiddle=6,i.LeftBottom=7,i.CenterBottom=8,i.RightBottom=9}(ct||(ct={}));let dt=new class{constructor(){this.O=P}CreateNativeView(t,s,e){this.O.CallToNative(1,[t,s],e)}CreateJsRootView(t){this.O.CallToNative(2,[t])}CreateDomProxyView(t,s,e){this.O.CallToNative(3,[t,s,e?1:0],!0)}};class pt{constructor(t,s,e=!1){this.Visibility=void 0,this.O=new E(t),this.ViewId=t,this.TextureSetting=null,this.Ns=null,this._=e,this.gs=null,this.CreateView(s)}CreateView(t=void 0){}ResetTexture(t=null){if(!this.Ns){this.Ns=this.O.CallToNative(1,null,this._);let t=this;this.O.AddStartSyncCallback((()=>{this.TextureSetting?t.O.AlterCallParams(t.Ns,[t.TextureSetting.ToSyncJsonObj()]):t.O.AlterCallParams(t.Ns,[null]),t.Ns=null}))}this.TextureSetting=t}BindedPageBase(t){}SetVisibility(t){if("INHERIT"!==t&&void 0!==t||(t="VISIBLE"),this.Visibility!=t){this.Visibility=t;let s=0;switch(t){case"VISIBLE":s=1;break;case"GONE":s=2;break;case"HIDDEN":s=3;break;default:return void console.error("unknown visible type="+t)}this.O.CallToNative(2,[s],this._)}}AddView(t,s){let e={x:0,y:0,width:0,height:0};s&&(e=this.Is(s)),this.O.CallToNative(3,[t.ViewId,s?1:0,e.x,e.y,e.width,e.height],this._)}ClearViews(){this.O.CallToNative(4,null,this._)}ResetTextureCssTransform(t,s){t=t||"",s=s||"",this.O.CallToNative(5,[t,s],this._)}SetTextureCoord(t,s,e,i,n=ct.TextureCoordAnchor.Center){this.O.CallToNative(9,[t,s,e,i,n],this._)}ResetLayoutParams(t){let s;null!=t?(s=this.Is(t),this.O.CallToNative(6,[s.x,s.y,s.width,s.height],this._)):n("ResetLayoutParams(): new params is null")}Is(t){return{x:isNaN(t.x)?0:t.x,y:isNaN(t.y)?0:t.y,width:isNaN(t.width)?0:t.width,height:isNaN(t.height)?0:t.height}}GetBoundingClientRect(){return new Promise(((t,s)=>{null!=this.gs&&(this.gs=null),this.gs=e=>{null!=this.gs&&(this.gs=null);const i=JSON.parse(e);0==i.status?t(i.data):s(i.error)};const e=c.AddData(this.gs);this.O.CallToNative(12,[e],this._)}))}StartAnimation(t,s,e){let i=t?t.AnimNativeId:0;this.O.CallToNative(7,[i,isNaN(e)?0:e],this._)}StopAnimation(){this.O.CallToNative(8,null,this._)}DispatchAnimCommand(t,s){this.O.CallToNative(13,[t,s],this._)}StartTextureAnimation(t){let s=t?t.AnimNativeId:0;this.O.CallToNative(10,[s],this._)}StopTextureAnimation(){this.O.CallToNative(11,null,this._)}DragEnables(t){this.O.CallToNative(14,[t],this._)}SetTapListener(t=void 0){if(null!=t){const s=c.AddData(t);this.O.CallToNative(15,[s],this._)}else this.O.CallToNative(15,[0],this._)}EnableAutoSize(){this.O.CallToNative(16,[],this._)}RegisterFlexAssigned(t=void 0){if(null!=t){const s=c.AddData(t);this.O.CallToNative(17,[s],this._)}else this.O.CallToNative(17,[0],this._)}EnableVisibleTestRect(){this.O.CallToNative(18,[],this._)}Capture2Texture(t,s=void 0){if(!t)return void console.error("Error: Capture2Texture need target texture");let e=t.GetTextureId();if(!s)return void console.error("Error: Capture2Texture need callback");const i=c.AddData(s);this.O.CallToNative(19,[e,i],this._)}}class ft extends pt{constructor(t=null){!t||t instanceof ut||n("ERROR:LayoutView need TextureSetting as parameter"),super(m.genViewId(),{DomDepends:!1}),this.Visibility="VISIBLE",t&&this.ResetTexture(t)}CreateView(t){dt.CreateNativeView(this.ViewId,0,t.DomDepends)}}function yt(t){let s=[];if(t instanceof Array)for(let e of t)e instanceof pt&&s.push(e.ViewId);return s}class St extends ot{constructor(t,s,e,i){super(),this.InitSet(t,s,e,i)}CreateSensor(){this.CreateTypedSensor(3)}InitSet(t,s,e,i){let n=0;e&&(n=c.AddData((t=>{1==t?e.OnBeginContact?.():2==t&&e.OnEndContact?.()}))),this.xs.CallToNative(20,[t.ViewId,s.ViewId,n,i?i.SensorId:0],!0)}}let vt={StartTrace:(t,s,e,i)=>new St(t,s,e,i),Callback:class{constructor(t,s){this.OnBeginContact=t,this.OnEndContact=s}UpdateImpactCallback(t){this.OnBeginContact=t}UpdateLeaveCallback(t){this.OnEndContact=t}},AutoFroze:class extends ot{constructor(t,s){super(),this.InitSet(),this.bs(yt(t)),this.Cs(yt(s)),this.Rs()}CreateSensor(){this.CreateTypedSensor(2)}InitSet(){this.xs.CallToNative(25,null,!0)}UpdatePreImpactList(t){this.bs(yt(t)),this.Rs()}UpdateOnImpactList(t){this.Cs(yt(t)),this.Rs()}bs(t){this.xs.CallToNative(26,[...t],!0)}Cs(t){this.xs.CallToNative(27,[...t],!0)}Rs(){this.xs.CallToNative(28,null,!0)}}};var wt;!function(t){t[t.NONE=0]="NONE",t[t.TEXT=1]="TEXT",t[t.PASSWORD=2]="PASSWORD",t[t.TEXT_AREA=3]="TEXT_AREA",t[t.CONTENT_EDITABLE=4]="CONTENT_EDITABLE",t[t.SEARCH=5]="SEARCH",t[t.URL=6]="URL",t[t.EMAIL=7]="EMAIL",t[t.TELEPHONE=8]="TELEPHONE",t[t.NUMBER=9]="NUMBER"}(wt||(wt={}));var mt,xt;!function(t){var s;(s=t.UniformType||(t.UniformType={}))[s.FLOAT=1]="FLOAT"}(mt||(mt={})),function(t){var s,e;(s=t.Type||(t.Type={}))[s.GRAY_DOWN=1]="GRAY_DOWN",s[s.WAVE=2]="WAVE",(e=t.Wave||(t.Wave={}))[e.CIRCLE_WAVE=1]="CIRCLE_WAVE",e[e.RECTANGLE_WAVE=2]="RECTANGLE_WAVE"}(xt||(xt={}));let Nt=0;class gt{constructor(){this.sourceList=[]}addSource(t,s,e,i,n){i=i??{type:xt.Wave.CIRCLE_WAVE},n=n??{timeDecay:3,distanceDecay:10,speed:100,frequency:8,waveNum:2};const r=++Nt;let h=0,l=0,a=0;return i.type==xt.Wave.RECTANGLE_WAVE&&(h=i.width,l=i.height,a=i.radius),this.sourceList.push(r,t,s,e,h,l,a,n.timeDecay,n.distanceDecay,n.speed,n.frequency,n.waveNum),r}getSourceList(){const t=this.sourceList;return this.sourceList=[],t}}class It extends pt{constructor(t,s){super(m.genViewId(),{DomElementId:t,UseMaskView:s},!0),this.Visibility="VISIBLE"}CreateView(t){dt.CreateDomProxyView(this.ViewId,t.DomElementId,t.UseMaskView)}RegisterOnProxyReady(t){t?.()}}var bt;!function(t){t.sDefaultFont="黑体",t.sDefaultFontSize=30,t.sDefaultFontColor="#FFFFFF",t.sDefaultBackgroundColor="rgba(0, 0, 0, 0)"}(bt||(bt={}));let Ct=t;Ct.Run=function(t){return V=new J,V.Init(t),V},Ct.InitStarter=function(s,e){t.DesignMap=e,q=s,K=e},Ct.NewDomProxyView=function(t,s){return new It(t,s)},Ct.sFrameCount=b,Ct.NativeConstant=Y,Ct.PageBase=H,Ct.ReactActivity=class extends H{constructor(t,s){super(t),this.Yt=s.GetTextureManager()}GetTextureManager(){return this.Yt}SetContentView(t,s){this.As=t,this.Os=s}},Ct.ViewTextureMask=class extends lt{constructor(t){super(),this.Ss="TEXTURE",this.ImageTexture=t}ToSyncJsonObj(t){return t||(t={}),t.texId=this.ImageTexture.TexId,super.ToSyncJsonObj(t)}},Ct.ViewRoundCornerMask=class extends lt{constructor(t,s,e,i){super(),this.Ss="CORNER",this.Ts=t,this.ks=isNaN(s)?t:s,this.Es=isNaN(e)?t:e,this.Ps=isNaN(i)?t:i}ToSyncJsonObj(t){return t||(t={}),t.tl=this.Ts,t.tr=this.ks,t.bl=this.Es,t.br=this.Ps,super.ToSyncJsonObj(t)}},Ct.sViewStore=at,Ct.ViewInfo=class{constructor(t,s){this.view=t,this.layout_params=s}},Ct.LayoutView=ft,Ct.AutoStretchView=class extends ft{constructor(t=null){super(t)}CreateView(t){dt.CreateNativeView(this.ViewId,12,t.DomDepends)}},Ct.EditControlView=class extends ft{constructor(t=null){super(t),this.Ds()}CreateView(t){dt.CreateNativeView(this.ViewId,5,t.DomDepends)}showIme(t,s,e){t!=wt.NONE?(void 0!==e&&null!=e||(e=s.length>0?s.length:0),e<0?e=0:e>s.length&&(e=s.length>0?s.length:0),this.O.CallToNative(5001,[t,s,e],this._)):console.log("showIme inputType error")}hideIme(){this.O.CallToNative(5002,null,this._)}updateCursorOffset(t,s){this.O.CallToNative(5003,[t,s],this._)}OnTextChanged(t,s){}OnStatusChanged(t){}OnEditAction(t){}Gs(t){if(t){var s=JSON.parse(t),e=s.text,i=s.status,n=s.action;if(void 0!==e){let t=s.select_start;this.OnTextChanged(decodeURIComponent(e),t)}else i?this.OnStatusChanged(i):n&&this.OnEditAction(n)}else console.log("EditControlView","_ImeEventListener input_data error")}Ds(){const t=c.AddData(this.Gs.bind(this));this.O.CallToNative(5004,[t])}},Ct.FilterView=class extends ft{constructor(t=null,s){super(t),this.Ls=s??xt.Type.GRAY_DOWN,this.O.CallToNative(10002,[this.Ls,[]],this._)}CreateView(t){dt.CreateNativeView(this.ViewId,10,t.DomDepends)}FilterSwitch(t){this.O.CallToNative(10001,[t],this._)}AddWaveSourceList(t){if(this.Ls==xt.Type.WAVE){const s={T:1,L:t.getSourceList()};this.DispatchCommand(Y.FILTER_VIEW_WAVE,JSON.stringify(s))}else console.error("FilterView error: add wave source while filter view type is GRAY_DOWN.")}AddWaveSourceSingle(t,s,e,i={type:xt.Wave.CIRCLE_WAVE},n={timeDecay:3,distanceDecay:10,speed:100,frequency:8,waveNum:2}){if(this.Ls==xt.Type.WAVE){const r=new gt,h=r.addSource(t,s,e,i,n);return this.AddWaveSourceList(r),h}return console.error("FilterView error: add wave source while filter view type is GRAY_DOWN."),-1}RemoveSource(t){if(this.Ls==xt.Type.WAVE){const s={T:2,L:t instanceof Array?t:[t]};this.DispatchCommand(Y.FILTER_VIEW_WAVE,JSON.stringify(s))}else console.error("FilterView error: remove wave source while filter view type is GRAY_DOWN.")}DispatchCommand(t,s){s&&this.O.CallToNative(10003,[t,s],this._)}},Ct.FragShaderView=class extends ft{constructor(t=null){super(t)}CreateView(t){dt.CreateNativeView(this.ViewId,11,t.DomDepends)}SetShaderInfo(t,s,e,i){const n={shaderStr:t,uniformParams:s,textureParams:e};let r=0;null!=i&&(r=c.AddData(i)),this.O.CallToNative(7001,[JSON.stringify(n),r],this._)}},Ct.NativeSharedView=class extends ft{constructor(t){super(t),this.Fs=window.JsView?window.JsView.getJsContextId():0,this.Ms=null,this.SetTrackId(this.Fs+"_"+this.ViewId)}CreateView(t){dt.CreateNativeView(this.ViewId,9,t.DomDepends)}GetTrackId(){return this.Ms}SetTrackId(t){this.Ms=t,this.O.CallToNative(10101,[this.Ms],this._)}SetOverSize(t){this.O.CallToNative(10102,[isNaN(t)?0:t],this._)}},Ct.NinePatchView=class extends ft{CreateView(t){dt.CreateNativeView(this.ViewId,4,t.DomDepends)}SetRepeat(t,s){this.O.CallToNative(4001,[t,s],this._)}SetPadding(t,s){this.O.CallToNative(4002,[t,s],this._)}SetImageDspSize(t,s){this.O.CallToNative(4003,[t,s],this._)}SetDesignMapWidth(t){this.O.CallToNative(4004,[t],this._)}EnableAlphaMix(t){this.O.CallToNative(4005,[t.TexId],this._)}},Ct.PreloadView=class extends ft{constructor(t=null){super(t)}CreateView(t){dt.CreateNativeView(this.ViewId,7,t.DomDepends)}},Ct.SprayView=class extends ft{constructor(t=null){super(t)}SetSprayInfo(t,s,e,i,n,r,h,l,a,o,u,c,d,p,f,y,S,v,w,m,x,N,g){this.O.CallToNative(6001,[t,s,e,i,n,r,h,l,a,o,u,c,d,p,!!f,!!y,!!S,v,w,m,x,N,g],this._)}CreateView(t){dt.CreateNativeView(this.ViewId,6,t.DomDepends)}},Ct.TextInputType=wt,Ct.FilterViewType=xt,Ct.TextureSetting=ut,Ct.ExternalTextureSetting=ut,Ct.TextUtils=bt,Ct.VisibleSensor=class extends ot{constructor(t,s=null){super(),this.InitSet(t,s)}CreateSensor(){this.CreateTypedSensor(1)}InitSet(t,s){let e=0;s&&(e=c.AddData(((t,e,i,n)=>{s(1==t,1==e,1==i,1==n)}))),this.xs.CallToNative(11,[t.ViewId,e],!0)}ResetArea(t){"number"!=typeof t.horizon&&(console.log("horizon not set, default to 1.0"),t.horizon=1),"number"!=typeof t.vertical&&(console.log("vertical not set, default to 1.0"),t.vertical=1),this.xs.CallToNative(12,[t.horizon,t.vertical],!0)}Enable(t){this.xs.CallToNative(13,[!!t],!0)}ResetContainer(t){let s;s=t?t.ViewId:0,this.xs.CallToNative(14,[s],!0)}},Ct.EnvBlockerSensor=class extends ot{constructor(t){super(),this.InitSet(t)}CreateSensor(){this.CreateTypedSensor(4)}InitSet(t){this.xs.CallToNative(30,[t.ViewId],!0)}ResetTopGID(t){this._s(0,t)}ResetBottomGID(t){this._s(1,t)}ResetLeftGID(t){this._s(2,t)}ResetRightGID(t){this._s(3,t)}_s(t,s){this.xs.CallToNative(31,[t,isNaN(s)?0:parseInt(s)],!0)}Enable(t){this.xs.CallToNative(32,[t],!0)}},Ct.sImpactSensorManager=vt,Ct.TextureInstantLoad=g,Ct.QRCodeLevel=N,Ct.ColorSpace=x,Ct.TextureManager=I,Ct.FreeMoveExternType=$,Ct.AnimationListener=class{constructor(t,s,e){this.ListenerEnabledFlags=0,this.InvokeAnimationStart=t,this.Bs=t,t&&(this.ListenerEnabledFlags|=1),this.InvokeAnimationEnd=s,this.Vs=s,s&&(this.ListenerEnabledFlags|=2),this.InvokeViewNoVisible=e,this.Us=e,e&&(this.ListenerEnabledFlags|=4),this.InvokeAnimRepeat=null,this.Ws=null,this.InvokeAnimFinal=null,this.Js=null,this.qs=null,this.Ks=[]}OnStart(t){return this.InvokeAnimationStart=this.Bs=t,t?this.ListenerEnabledFlags|=1:this.ListenerEnabledFlags&=30,this}OnEnd(t){return this.InvokeAnimationEnd=this.Vs=t,t?this.ListenerEnabledFlags|=2:this.ListenerEnabledFlags&=29,this}OnRepeat(t){return this.InvokeAnimRepeat=this.Ws=t,t?this.ListenerEnabledFlags|=8:this.ListenerEnabledFlags&=23,this}OnFinalProgress(t){return this.InvokeAnimFinal=this.Js=t,t?this.ListenerEnabledFlags|=16:this.ListenerEnabledFlags&=15,this}AddInherit(t){if(t){if(0==this.Ks.length){var s=this;this.InvokeAnimationStart=function(){s.Bs&&s.Bs();for(var t=0;t<s.Ks.length;t++)s.Ks[t].InvokeAnimationStart?.()},this.InvokeAnimationEnd=function(t){s.Vs&&s.Vs(t);for(var e=0;e<s.Ks.length;e++)s.Ks[e].InvokeAnimationEnd?.(t)},this.InvokeViewNoVisible=function(){s.Us&&s.Us();for(var t=0;t<s.Ks.length;t++)s.Ks[t].InvokeViewNoVisible?.()},this.InvokeAnimFinal=function(t){s.Js&&s.Js(t);for(var e=0;e<s.Ks.length;e++)s.Ks[e].InvokeAnimFinal?.(t)},this.InvokeAnimRepeat=function(t){s.Ws&&s.Ws(t);for(var e=0;e<s.Ks.length;e++)s.Ks[e].InvokeAnimRepeat?.(t)},this.ListenerEnabledFlags=31}this.Ks.push(t)}}InvokeFromNativeForge(t){switch(t.type){case"end":this.InvokeAnimationEnd?.(1==t.normalEnd);break;case"novisible":this.InvokeViewNoVisible?.();break;case"final":this.InvokeAnimFinal?.(t.progress);break;case"repeat":this.InvokeAnimRepeat?.(t.timesCount)}}},Ct.AnimFireCommand=ht,Ct.AnimationEnable=rt,Ct.TranslateAnimation=class extends nt{constructor(t,s,e,i,n,r){super(),it.CreateTranslate(t,s,e,i,n,r,this.AnimNativeId)}},Ct.RotateAnimation=class extends nt{constructor(t,s,e,i,n,r){super(),it.CreateRotate(t,s,e,i,n,r,this.AnimNativeId)}},Ct.ScaleAnimation=class extends nt{constructor(t,s,e,i,n,r,h,l,a=200,o=200){super(),it.CreateScale(t,s,e,i,n,r,a,o,h,l,this.AnimNativeId)}},Ct.TranslateFrameAnimation=class extends nt{constructor(t,s,e,i,n,r){super();let h=Math.floor(100*e/55)/100;it.CreateTranslateFrame(t,s,h,h,i,n,r,this.AnimNativeId)}},Ct.CssKeyframeAnimation=class extends nt{constructor(t,s,e,i,n){super(),it.CreateCssKeyframe(t,s,e,i,n,this.AnimNativeId)}},Ct.ShaderAnimation=class extends nt{constructor(t,s){super(),it.CreateShaderAnimation(t,s,this.AnimNativeId)}},Ct.FreeMoveAnimation=class extends nt{constructor(t,s,e){super(),this.Hs=t,it.CreateFreeMoveAnimation(this.AnimNativeId,t,s,e)}},Ct.FreeMoveActEvtType=Q,Ct.FreeMoveCmdPackBuilder=class{static InitActCmdPack(t,s,e,i){return{t:1,cmds:i,tkn:isNaN(e)?0:e,spd:isNaN(t)?0:t,acc:isNaN(s)?0:s}}static InitStateCmdPack(t){return{t:2,cmd:t}}},Ct.FreeMoveConditionSet=class{static AppendSubCmd(t,s){const e="cmds";t.hasOwnProperty("cmdPacks")?console.error("Error: conflict with command pack list"):(t.hasOwnProperty(e)||(t[e]=[]),t[e]?.push(s))}static SetCmdList(t,s){s instanceof Array&&(t.hasOwnProperty("cmdPacks")?console.error("Error: conflict with command pack list"):t.cmds=s)}static SetCmdPackList(t,s){s instanceof Array&&(t.hasOwnProperty("cmds")?console.error("Error: conflict with sub-command list"):t.cmdPacks=s)}static InitCommonInfo(){return{g:0,m:!1,s:null,brk:!1}}static UpdateCommonInfo(t,s,e,i,n){t.g=s??0,t.m=e??!1,t.s=i??null,t.brk=n}static ReachPosition(t,s,e){let i=X(t,s),n={subt:1,react:1,e:i.e,xv:i.x,yv:i.y};return tt(n,e),n}static AcrossPosition(t,s,e){let i=X(t,s),n={subt:1,react:2,e:i.e,xv:i.x,yv:i.y};return tt(n,e),n}static BoxPosition(t,s,e,i,n){let r=0,h=0,l=0,a=0,o=0;isNaN(t)||(r=t,o|=1),isNaN(s)||(h=s,o|=2),isNaN(e)||(l=e,o|=4),isNaN(i)||(a=i,o|=8);let u={subt:1,react:7,de:o,lv:r,tv:h,rv:l,bv:a};return tt(u,n),u}static StartMove(t,s){return this.OnMovement(s,1,1,t)}static OnMovement(t,s,e,i){let n={subt:1,react:9,xv:s,yv:e,e:i};return tt(n,t),n}static OffsetPosition(t,s,e,i,n){let r=0,h=0,l=0,a=0,o=0;isNaN(t)||(r=t,o|=1),isNaN(s)||(h=s,o|=2),isNaN(e)||(l=e,o|=4),isNaN(i)||(a=i,o|=8);let u={subt:1,react:8,de:o,lv:r,tv:h,rv:l,bv:a};return tt(u,n),u}static WallPosition(t,s,e,i){let n,r=X(s,e);switch(t){case"left":n=4;break;case"top":n=3;break;case"right":n=5;break;case"bottom":n=6;break;default:return console.error("WallPosition undefined direction",t),null}let h={subt:1,react:n,e:r.e,xv:r.x,yv:r.y};return tt(h,i),h}static ReachSpeed(t,s,e){let i=X(t,s),n={subt:2,react:1,e:i.e,xv:i.x,yv:i.y};return tt(n,e),n}static AcrossSpeed(t,s,e){let i=X(t,s),n={subt:2,react:2,e:i.e,xv:i.x,yv:i.y};return tt(n,e),n}static TouchCount(t,s){let e={subt:5,react:2,tct:s};return tt(e,t),e}static OnNexusEvent(t,s,e){let i={subt:3,nexus:t,etyp:s};return tt(i,e),i}static OnDragStart(t,s){let e={subt:3,nexus:s,etyp:Q.ActEvent_ActDragStart};return tt(e,t),e}static OnDragEnd(t,s){let e={subt:3,nexus:s,etyp:Q.ActEvent_ActDragEnd};return tt(e,t),e}static OnTouchDown(t,s){let e={subt:3,nexus:s,etyp:Q.ActEvent_ActTouchDown};return tt(e,t),e}static OnTouchRelease(t,s){let e={subt:3,nexus:s,etyp:Q.ActEvent_ActTouchRelease};return tt(e,t),e}static OnFlingStart(t,s){let e={subt:3,nexus:s,etyp:Q.ActEvent_ActFlingStart};return tt(e,t),e}static OnFlingProgress(t,s){let e={subt:3,nexus:s,etyp:Q.ActEvent_ActFlingProgress};return tt(e,t),e}static OnFlingEnd(t,s){let e={subt:3,nexus:s,etyp:Q.ActEvent_ActFlingEnd};return tt(e,t),e}static OnFlingCancel(t,s){let e={subt:3,nexus:s,etyp:Q.ActEvent_ActFlingCancel};return tt(e,t),e}static OnFlingDrop(t,s){let e={subt:3,nexus:s,etyp:Q.ActEvent_ActFlingDrop};return tt(e,t),e}static OnHitBlock(t,s){let e={subt:4,blkGid:t};return tt(e,s),e}static OnNextTick(t,s){let e={subt:5,react:1,tgap:t};return s.m=!1,tt(e,s),e}static MovementSyncNexus(t,s){let e={subt:3,nexus:s,etyp:Q.ActEvent_MovementSync};return tt(e,t),e}},Ct.FreeMoveActionBuilder=class{static SetSpeed(t,s){let e=X(t,s);return{typ:2,set:{xv:e.x,yv:e.y,xye:e.e}}}static SetAccel(t,s){let e=X(t,s);return{typ:7,set:{xye:e.e,xv:e.x,yv:e.y}}}static AltSpeed(t,s,e){if(!e)return null;let i=X(t,s);return{typ:5,set:{xv:i.x,yv:i.y,xye:i.e,tim:Math.floor(e)}}}static StopMoving(){return{typ:3}}static StopMovingExact(){return{typ:9}}static BrakeToPos(t,s){let e=X(t,s);return{typ:4,set:{xv:Math.floor(e.x),yv:Math.floor(e.y),xye:e.e}}}static SetArrowSpeed(t,s,e,i){let n=X(t,s),r=X(e,i);return{typ:6,set:{xye:n.e,xv:Math.floor(n.x),yv:Math.floor(n.y),xye1:r.e,xv1:r.x,yv1:r.y}}}static TeleportTo(t,s,e){let i=X(t,s);return{typ:8,set:{xye:i.e,xv:Math.floor(i.x),yv:Math.floor(i.y),isAbs:!e}}}static AckMovementSync(t,s,e,i,n,r){return{typ:10,set:{hstart:t,hend:s,vstart:e,vend:i,xye:n,st:r}}}},Ct.FreeMoveStateBuilder=class{static FireEcho(t){return{typ:52,set:{tkn:t}}}static FireNexusEvent(t,s){return isNaN(s)||0==s?null:{typ:55,set:{etyp:isNaN(t)?0:t,nexus:s}}}static NewCondition(t){return{typ:st,set:{sub:1,set:t}}}static DelActionAssocCondition(){return{typ:st,set:{sub:5}}}static RemoveAllCondtions(){return{typ:st,set:{sub:6}}}static RemoveByGroup(t){return{typ:st,set:{sub:4,gt:t}}}static ActiveCondition(t,s){return{typ:st,set:{sub:2,gt:isNaN(t)||t<=0?$.GroupType_Invalid_Ext:t,sn:s}}}static DeactiveCondition(t,s){return{typ:st,set:{sub:3,gt:isNaN(t)||t<=0?$.GroupType_Invalid_Ext:t,sn:s}}}static SetOffsetPos(t,s){let e=X(t,s);return{typ:53,set:{xv:Math.floor(e.x),yv:Math.floor(e.y),xye:e.e}}}static SetPos(t,s){let e=X(t,s);return{typ:54,set:{xv:Math.floor(e.x),yv:Math.floor(e.y),xye:e.e}}}static TouchLockSwitch(t,s,e=-1){return{typ:59,set:{il:t,dir:s,ut:e}}}static SetTouchAttractChild(t){return{typ:60,set:{cid:t?t.AnimNativeId:0}}}static SetHitWallOverflow(){return{typ:56}}static RevertWithHitBlock(){return{typ:57}}static StartMovementSync(t,s,e,i,n,r){return{typ:61,set:{hstart:s,hend:e,vstart:i,vend:n,xye:r,nexus:t}}}static StopMovementSync(){return{typ:62}}};export{t as default};
2
+
@@ -1,2 +1,2 @@
1
- /* eslint-disable */ void 0===window.Forge?(window.Forge={},console.log("Define forge browser")):console.log("Define using JsView forge engine-js");var e=window.Forge;class t{constructor(e,t){if(this.href="",this.origin="",this.protocol="",this.host="",this.hostname="",this.port="",this.pathname="",this.search="",this.hash="",!e)return;if(!0===e.startsWith("url")){let t=e.indexOf("(")+1,i=e.lastIndexOf(")");if("undefined"===(e=e.substring(t,i).trim())||"null"===e||0===e.length)return}if(!0===e.startsWith("data:")||!0===e.startsWith("jsvtexturestore:"))return void(this.href=e);let i=e.indexOf("://");if(!(i<0||i>10)||e.startsWith("./")||e.startsWith("/")||(e="./"+e),!0===e.startsWith("/"))e=window.location.origin+e;else if(!0===e.startsWith("./")&&void 0!==window.JsView&&void 0!==window.JsView.Dom.JsSubPath){if(void 0===window.JsView.Dom.MainPath||"undefined"===window.JsView.Dom.MainPathRef||window.JsView.Dom.MainPathRef!==window.location.href){window.JsView.Dom.JsSubPath.startsWith("/")||(window.JsView.Dom.JsSubPath="/"+window.JsView.Dom.JsSubPath),window.JsView.Dom.JsSubPath.endsWith("/")||(window.JsView.Dom.JsSubPath=window.JsView.Dom.JsSubPath+"/"),window.JsView.Dom.MainPathRef=window.location.href;let e=window.location.pathname.lastIndexOf(window.JsView.Dom.JsSubPath);window.JsView.Dom.MainPath=window.location.origin+window.location.pathname.substring(0,e)}e=window.JsView.Dom.MainPath+e.substring(1)}if(this.href=e,!t)return;let o=this.href,n=o.indexOf("#");n>0&&(this.hash=o.substring(n),o=o.substring(0,n));let s=o.indexOf("?");s>1&&(this.search=o.substring(s),o=o.substring(0,s));let r=o,a=r.indexOf("://");this.protocol=a>0?r.substring(0,a+1):"";let h=a>1?r.substring(a+3):"";a=h.indexOf("/"),this.host=a>0?h.substring(0,a):"",this.pathname=a>=1?h.substring(a):"","file:"==this.protocol&&(this.host="",this.pathname=h),this.origin=this.protocol+"//"+this.host,a=this.host.indexOf(":"),this.hostname=a>0?this.host.substring(0,a):this.host,this.port=a>1?this.host.substring(a+1):""}replace(e){this.href=e}}class i{static SetBackgroundColor(t,i,o){const n=window.JsvCode.ForgeHandles.TextureManager.GetColorTextureCached(i);let s;o&&(s=new e.ViewRoundCornerMask(o.topLeft,o.topRight,o.bottomLeft,o.bottomRight));const r=new e.ExternalTextureSetting(n,s);t.ResetTexture(r)}static SetBackgroundImage(i,o,n,s,r,a,h){let w,d={};if("string"==typeof o){const e=new t(o);if(e instanceof t==!1)throw Error("Bad Argument.",e);d.url=e.href}else"linear-gradient"==o?.type&&(d.gradient=o);if(d.gradient)if(d.gradient.colors?.length>2){const e=d.gradient.colors,t=[e[0],e[e.length-1]],i=e.slice(1,e.length-1);w=window.JsvCode.ForgeHandles.TextureManager.CreateLinearGradientTexture(t,i)}else 2==d.gradient.colors?.length?w=window.JsvCode.ForgeHandles.TextureManager.CreateMiniGradientTexture(!0,d.gradient.colors[0],d.gradient.colors[1],d.gradient.rawValue):console.warn("Failed to create backgroundImage gradient, bad colors.",d.gradient.colors);else d.url&&(w=d.url.includes(".gif")||d.url.includes(".webp")?window.JsvCode.ForgeHandles.TextureManager.GetGifImage(d.url,!1,null,h):window.JsvCode.ForgeHandles.TextureManager.GetImage2(d.url,!1,r,a||e.ColorSpace.RGBA_8888));if(w){let t;n&&(t=new e.ViewRoundCornerMask(n.topLeft,n.topRight,n.bottomLeft,n.bottomRight));const o=new e.ExternalTextureSetting(w,t);if(i.ResetTexture(o),s){let e=w.RegisterLoadImageCallback(null,(function(){s({width:w.Width,height:w.Height})}));i.RegisterDetachCallback((()=>{w.UnregisterLoadImageCallback(e)}))}}}static SetMaskedBackgroundImage(i,o,n,s){if("string"==typeof o&&(o=new t(o)),o instanceof t==!1)throw Error("Bad Argument.",o);if("string"==typeof n&&(n=new t(n)),n instanceof t==!1)throw Error("Bad Argument(MaskURL).",n);const r=window.JsvCode.ForgeHandles.TextureManager.GetImage2(o.href,!1,null,s||e.ColorSpace.RGBA_8888);if(r){const t=window.JsvCode.ForgeHandles.TextureManager.GetImage2(n.href,!1,null,e.ColorSpace.RGBA_8888),o=new e.ExternalTextureSetting(r,new e.ViewTextureMask(t));i.ResetTexture(o)}}}export{e as Forge,i as ForgeExtension};
1
+ /* eslint-disable */ if(void 0===window.Forge)throw new Error("Error: EngineJs missing");var t=window.Forge;class e{constructor(t,e){if(this.href="",this.origin="",this.protocol="",this.host="",this.hostname="",this.port="",this.pathname="",this.search="",this.hash="",!t)return;if(!0===t.startsWith("url")){let e=t.indexOf("(")+1,r=t.lastIndexOf(")");if("undefined"===(t=t.substring(e,r).trim())||"null"===t||0===t.length)return}if(!0===t.startsWith("data:")||!0===t.startsWith("jsvtexturestore:"))return void(this.href=t);let r=t.indexOf("://");if(!(r<0||r>10)||t.startsWith("./")||t.startsWith("/")||(t="./"+t),!0===t.startsWith("/")?t=window.location.origin+t:!0===t.startsWith("./")&&void 0!==window.JsView&&(t=window.location.jsvGetLocation()+t.substring(2)),this.href=t,!e)return;let i=this.href,s=i.indexOf("#");s>0&&(this.hash=i.substring(s),i=i.substring(0,s));let n=i.indexOf("?");n>1&&(this.search=i.substring(n),i=i.substring(0,n));let o=i,a=o.indexOf("://");this.protocol=a>0?o.substring(0,a+1):"";let h=a>1?o.substring(a+3):"";a=h.indexOf("/"),this.host=a>0?h.substring(0,a):"",this.pathname=a>=1?h.substring(a):"","file:"==this.protocol&&(this.host="",this.pathname=h),this.origin=this.protocol+"//"+this.host,a=this.host.indexOf(":"),this.hostname=a>0?this.host.substring(0,a):this.host,this.port=a>1?this.host.substring(a+1):""}replace(t){this.href=t}}class r{static SetBackgroundColor(e,r,i){const s=window.JsvCode.ForgeHandles.TextureManager.GetColorTextureCached(r);let n;i&&(n=new t.ViewRoundCornerMask(i.topLeft,i.topRight,i.bottomLeft,i.bottomRight));const o=new t.ExternalTextureSetting(s,n);e.ResetTexture(o)}static SetBackgroundImage(r,i,s,n,o,a,h){let g,l={};if("string"==typeof i){const t=new e(i);if(t instanceof e==!1)throw Error("Bad Argument.",t);l.url=t.href}else"linear-gradient"==i?.type&&(l.gradient=i);if(l.gradient)if(l.gradient.colors?.length>2){const t=l.gradient.colors,e=[t[0],t[t.length-1]],r=t.slice(1,t.length-1);g=window.JsvCode.ForgeHandles.TextureManager.CreateLinearGradientTexture(e,r)}else 2==l.gradient.colors?.length?g=window.JsvCode.ForgeHandles.TextureManager.CreateMiniGradientTexture(!0,l.gradient.colors[0],l.gradient.colors[1],l.gradient.rawValue):console.warn("Failed to create backgroundImage gradient, bad colors.",l.gradient.colors);else l.url&&(g=l.url.includes(".gif")||l.url.includes(".webp")?window.JsvCode.ForgeHandles.TextureManager.GetGifImage(l.url,!1,null,h):window.JsvCode.ForgeHandles.TextureManager.GetImage2(l.url,!1,o,a||t.ColorSpace.RGBA_8888));if(g){let e;s&&(e=new t.ViewRoundCornerMask(s.topLeft,s.topRight,s.bottomLeft,s.bottomRight));const i=new t.ExternalTextureSetting(g,e);if(r.ResetTexture(i),n){let t=g.RegisterLoadImageCallback(null,(function(){n({width:g.Width,height:g.Height})}));r.RegisterDetachCallback((()=>{g.UnregisterLoadImageCallback(t)}))}}}static SetMaskedBackgroundImage(r,i,s,n){if("string"==typeof i&&(i=new e(i)),i instanceof e==!1)throw Error("Bad Argument.",i);if("string"==typeof s&&(s=new e(s)),s instanceof e==!1)throw Error("Bad Argument(MaskURL).",s);const o=window.JsvCode.ForgeHandles.TextureManager.GetImage2(i.href,!1,null,n||t.ColorSpace.RGBA_8888);if(o){const e=window.JsvCode.ForgeHandles.TextureManager.GetImage2(s.href,!1,null,t.ColorSpace.RGBA_8888),i=new t.ExternalTextureSetting(o,new t.ViewTextureMask(e));r.ResetTexture(i)}}}export{t as Forge,r as ForgeExtension};
2
2
 
package/dom/index.mjs CHANGED
@@ -8,6 +8,7 @@ function getCodeDebugConfig() {
8
8
  domBrowserPath: './code/src/dom-2.0/dom-env/browser/index.ts',
9
9
  domNativePath: './code/src/dom-2.0/dom-env/native/index.ts',
10
10
  engineBrowserPath: './code/src/dom-2.0/engine-js/browser/index.ts',
11
+ engineNativePath: './code/src/dom-2.0/engine-js/native/index.ts',
11
12
  forgeDefinePath: './code/src/dom-2.0/engine-js/index.ts',
12
13
  };
13
14
 
@@ -31,17 +32,6 @@ async function loadJsViewDomNative(codeDebugConfig) {
31
32
  }
32
33
 
33
34
  async function loadJsViewDomBrowserDebug(codeDebugConfig) {
34
- // 在PC环境下没有处理加载EngineJs, 所以在此加载一下
35
- if (codeDebugConfig.enableDebug == false) {
36
- await import("./bin/jsview-engine-js-browser.min.js");
37
- } else {
38
- // 兼容webpack写法
39
- await import(
40
- /* webpackExclude: /@shijiu\/jsview\/dom\/code\/node_modules\// */
41
- `${codeDebugConfig.engineBrowserPath}`
42
- );
43
- }
44
-
45
35
  // 加载jsv-dom的调试版本
46
36
  let domBrowser = null;
47
37
  if (codeDebugConfig.enableDebug == false) {
@@ -87,17 +77,53 @@ async function loadJsViewDomAsync(nativeOrBrowserDebug) {
87
77
  if (nativeOrBrowserDebug) {
88
78
  jsviewDom = await loadJsViewDomNative(codeDebugConfig);
89
79
  } else {
90
- // 补充原本由native的ForgeDom生成的JsvCode扩展给内部组件使用的接口类
91
- window.JsvCode = {};
92
-
93
80
  jsviewDom = await loadJsViewDomBrowserDebug(codeDebugConfig);
94
81
  }
95
82
 
96
83
  return jsviewDom;
97
84
  }
98
85
 
86
+ async function loadEngineJs(nativeOrBrowserDebug, run_app_func, design_map_query_func) {
87
+ const codeDebugConfig = getCodeDebugConfig();
88
+ let forge_ref;
89
+
90
+ if (nativeOrBrowserDebug) {
91
+ // Native engineJs 加载
92
+ if (codeDebugConfig.enableDebug == false) {
93
+ forge_ref = await import("./bin/jsview-engine-js-native.min.js");
94
+ } else {
95
+ // 兼容webpack写法
96
+ forge_ref = await import(
97
+ /* webpackExclude: /@shijiu\/jsview\/dom\/code\/node_modules\// */
98
+ `${codeDebugConfig.engineNativePath}`
99
+ );
100
+ }
101
+ } else {
102
+ // Browser engineJs 加载
103
+ if (codeDebugConfig.enableDebug == false) {
104
+ forge_ref = await import("./bin/jsview-engine-js-browser.min.js");
105
+ } else {
106
+ // 兼容webpack写法
107
+ forge_ref = await import(
108
+ /* webpackExclude: /@shijiu\/jsview\/dom\/code\/node_modules\// */
109
+ `${codeDebugConfig.engineBrowserPath}`
110
+ );
111
+ }
112
+ }
113
+
114
+ // 设置主执行入口
115
+ forge_ref.default.InitStarter(run_app_func, design_map_query_func);
116
+
117
+ await getForgeDefineAsync(); // 触发首次加载forge-define
118
+
119
+ if (window.JsView) {
120
+ window._BootEngineEmb.resolveFunc();
121
+ }
122
+ }
123
+
99
124
  export {
100
125
  getCodeDebugConfig,
101
126
  getForgeDefineAsync,
102
127
  loadJsViewDomAsync,
128
+ loadEngineJs,
103
129
  }
@@ -3,12 +3,14 @@
3
3
  */
4
4
 
5
5
  const TargetRevision = {
6
- "CoreRevision": 1021852,
7
- "CoreRevisionAndBranch": "1021852",
8
- "JseRevision": "1.0.963",
6
+ "CoreRevision": 1021977,
7
+ "CoreRevisionAndBranch": "1021977",
8
+ "JseRevision":
9
+ "embedded",
9
10
  "JseUrl":
10
- "http://cdn.release.qcast.cn/forge_js/master/JsViewES6_js2c_r963.jsv.4b3a9429.js",
11
- "JseName": "JsViewES6_js2c_r963.jsv.4b3a9429.js",
11
+ "embedded",
12
+ "JseName":
13
+ "embedded",
12
14
  "JsidtName": "libjsidt.102.7.so",
13
15
  };
14
16
 
@@ -0,0 +1,19 @@
1
+ import appConfig from "/src/appConfig/app.config.mjs";
2
+ import jsviewVendorConfig from "/src/appConfig/jsview.config.mjs";
3
+ import { PERMISSION } from "/src/appConfig/permission.js";
4
+
5
+ import JsViewLoader from './jsview-loader.js';
6
+
7
+ let loader = JsViewLoader;
8
+ // 根据JsViewConfig, 判断厂商是否设置了使用远程loader启动
9
+ const remoteLoader = jsviewVendorConfig.jsviewConfig.remoteLoader;
10
+ if (remoteLoader) {
11
+ loader = (await import(remoteLoader)).default;
12
+ }
13
+
14
+ export {
15
+ appConfig,
16
+ jsviewVendorConfig,
17
+ PERMISSION,
18
+ loader as JsViewLoader,
19
+ }
@@ -1,5 +1,5 @@
1
1
  import JsViewDefConfig from "./jsview.config.default"
2
- import { loadJsViewDomAsync } from '../dom'
2
+ import { loadJsViewDomAsync, loadEngineJs } from '../dom'
3
3
  import TargetRevision from "../dom/target_core_revision"
4
4
 
5
5
  const CYCLE_TIME = 10000;
@@ -59,27 +59,28 @@ export default class JsViewLoader {
59
59
  return this.#config;
60
60
  }
61
61
 
62
- initForgeEnv() {
63
- if (typeof window.Forge === 'undefined') { // Browser没有默认Forge
64
- window.Forge = {};
65
- }
66
-
67
- window.Forge.DesignMap = this.#makeForgeDesignedMap.bind(this);
68
- window.Forge.RunApp = this.#runForgeApp.bind(this);
69
- }
70
-
71
62
  async initJsViewEnv(appName, onLoaded, permission) {
72
- // 加载JsView Dom
63
+ // 加载嵌入到 dom 模块中的 EngineJs
64
+ await loadEngineJs(
65
+ !!window.JsView,
66
+ this.#runForgeApp.bind(this),
67
+ this.#makeForgeDesignedMap.bind(this)
68
+ );
69
+
70
+ // 加载JsView Dom
73
71
  const jsviewDom = await loadJsViewDomAsync(window.JsView);
74
72
 
75
- // 加载Forge
73
+ // 加载ForgeFront
76
74
  jsviewDom.InitEnv();
77
75
 
78
76
  if (window.JsView) {
79
77
  this.#forgeAppClass = jsviewDom.NativeForgeApp;
80
78
 
81
- // /static/js/: (可选配置)填写main.js或者bundle.js相对于index.html的相对位置,用于image/import.then的相对寻址
82
- window.JsView.Dom.JsSubPath = this.#config.jsviewConfig.jsSubPath;
79
+ // /static/js/: (可选配置)填写main.js或者bundle.js相对于index.html的相对位置,
80
+ // 用于image / import.then的相对寻址
81
+ if (typeof this.#config.jsviewConfig.jsRelativeDepth == "number") {
82
+ window.location?.jsvSetRelativeDepth(this.#config.jsviewConfig.jsRelativeDepth)
83
+ }
83
84
  } else {
84
85
  this.#forgeAppClass = jsviewDom.BrowserForgeApp;
85
86
  }
@@ -182,9 +183,8 @@ export default class JsViewLoader {
182
183
  }
183
184
 
184
185
  // 检查配套引擎的版本
185
- if (window.JsView.CodeRevision !== TargetRevision.CoreRevision /* Native引擎版本(由APK启动参数 CORE 决定) */
186
- || window.Forge.Version !== TargetRevision.JseRevision) {/* JS引擎版本(由APK启动参数 ENGINEJS 决定) */
187
- console.warn(`Warning: JsView Engine version miss matched, some effect will be lost or crash!! current using core=${window.JsView.CodeRevision} engine=${window.Forge.Version}(but core should be ${TargetRevision.CoreRevision}, engine should be ${TargetRevision.JseRevision} url=${TargetRevision.JseUrl})`);
186
+ if (window.JsView.CodeRevision !== TargetRevision.CoreRevision /* Native引擎版本(由APK启动参数 CORE 决定) */) {
187
+ console.warn(`Warning: JsView Engine version miss matched, some effect will be lost or crash!! current using core=${window.JsView.CodeRevision} (but core should be ${TargetRevision.CoreRevision})`);
188
188
  }
189
189
  }
190
190
 
@@ -1,24 +1,18 @@
1
+
1
2
  async function main() {
2
- const { default: appConfig } = await import("/src/appConfig/app.config.mjs");
3
- const { default: jsviewVendorConfig } = await import("/src/appConfig/jsview.config.mjs");
4
- const { PERMISSION } = await import("/src/appConfig/permission.js");
3
+ const {
4
+ appConfig,
5
+ jsviewVendorConfig,
6
+ PERMISSION,
7
+ JsViewLoader,
8
+ } = await import('./jsview-config.js');
5
9
 
6
- let JsViewLoader = null;
7
- // 根据JsViewConfig, 判断厂商是否设置了使用远程loader启动
8
- const remoteLoader = jsviewVendorConfig.jsviewConfig.remoteLoader;
9
- if (remoteLoader) {
10
- JsViewLoader = (await import(remoteLoader)).default;
11
- } else {
12
- JsViewLoader = (await import('./jsview-loader.js')).default;
13
- }
14
10
  const jsviewLoader = new JsViewLoader();
15
11
 
16
12
  // 使用vendor配置值覆盖默认配置。
17
13
  const config = jsviewLoader.mergeConfig(jsviewVendorConfig);
18
14
  console.log("JsView config: " + JSON.stringify(config));
19
15
 
20
- jsviewLoader.initForgeEnv();
21
-
22
16
  // 初始化jsview运行环境。
23
17
  const onInitJsViewEnv = async function () {
24
18
  // JsView环境加载完毕后,加载vue/react的main.js文件。
@@ -25,8 +25,8 @@ export default {
25
25
  },
26
26
 
27
27
  // (可选配置)填写main.js或者bundle.js相对于index.html的相对位置,
28
- // 用于image/import.then的相对寻址, vue3默认值是/js/
29
- jsSubPath: '/js/'
28
+ // 用于image/import.then的相对寻址, vue3默认值是1
29
+ jsRelativeDepth: 1,
30
30
  },
31
31
 
32
32
  vendorConfig: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shijiu/jsview",
3
- "version": "2.2.201",
3
+ "version": "2.2.373",
4
4
  "bin": {
5
5
  "jsview-post-build": "./tools/jsview-post-build.js",
6
6
  "jsview-post-install": "./tools/jsview-post-install.js"
@@ -25,7 +25,7 @@ const jsviewConfig = defineConfig({
25
25
  rollupOptions: {
26
26
  output: {
27
27
  assetFileNames: (chunkInfo) => chunkInfo.name.endsWith('.css') ? 'css/[name].[hash].css' : 'assets/[name].[hash].[ext]',
28
- chunkFileNames: process.env['JSVIEW_KEEP_CHUNKNAME'] ? 'js/[name].[hash].js' : 'js/chunk.jsv.[hash].js',
28
+ chunkFileNames: process.env['JSVIEW_KEEP_CHUNKNAME'] ? 'js/[name].[hash].js' : 'js/chunk.jsv2.[hash].js',
29
29
  // chunkFileNames: 'js/[name].[hash].js',
30
30
  entryFileNames: 'js/main.jsv.[hash].js',
31
31
  format: 'esm',
@@ -225,6 +225,7 @@ function getOptions(framework)
225
225
  options.appJsviewConfigFile = path.resolve(options.appConfigDir, 'jsview.config.mjs');
226
226
  options.appPrivKeyFile = path.resolve(options.appConfigDir, 'app_sign_private_key.crt');
227
227
  options.appPubKeyFile = path.resolve(options.appConfigDir, 'app_sign_public_key.pem');
228
+ options.appConfigSVKeysDir = path.resolve(options.appConfigDir, 'signVerifyKeys');
228
229
 
229
230
  options.distDir = path.resolve(options.projectDir, 'dist');
230
231
  if (framework == 'vue') {