@shijiu/jsview 1.9.921 → 1.9.943-next-vue.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.
@@ -1 +1 @@
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(!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:"))return void(this.href=e);let i=e.indexOf("://");if(!(i<0||i>10)||e.startsWith("./")||e.startsWith("/")||(e="./"+e),!0===e.startsWith("/"))e=document.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!==document.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=document.location.href;let e=document.location.pathname.lastIndexOf(window.JsView.Dom.JsSubPath);window.JsView.Dom.MainPath=document.location.origin+document.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 r=o.indexOf("?");r>1&&(this.search=o.substring(r),o=o.substring(0,r));let s=o,a=s.indexOf("://");this.protocol=a>0?s.substring(0,a+1):"";let u=a>1?s.substring(a+3):"";a=u.indexOf("/"),this.host=a>0?u.substring(0,a):"",this.pathname=a>1?u.substring(a):"",this.origin=a>0?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}href="";origin="";protocol="";host="";hostname="";port="";pathname="";search="";hash=""}class i{static SetBackgroundColor(t,o,n){const r=i.TextureManager.GetColorTextureCached(o);let s;n&&(s=new e.ViewRoundCornerMask(n.topLeft,n.topRight,n.bottomLeft,n.bottomRight));const a=new e.ExternalTextureSetting(r,s);t.ResetTexture(a)}static SetBackgroundImage(o,n,r,s,a,u,l){let d,h={};if("string"==typeof n){const e=new t(n);if(e instanceof t==!1)throw Error("Bad Argument.",e);h.url=e.href}else"linear-gradient"==n?.type&&(h.gradient=n);if(h.gradient)if(h.gradient.colors?.length>2){const e=h.gradient.colors,t=[e[0],e[e.length-1]],o=e.slice(1,e.length-1);d=i.TextureManager.CreateLinearGradientTexture(t,o)}else 2==h.gradient.colors?.length?d=i.TextureManager.CreateMiniGradientTexture(!0,h.gradient.colors[0],h.gradient.colors[1],h.gradient.rawValue):console.warn("Failed to create backgroundImage gradient, bad colors.",h.gradient.colors);else h.url&&(d=h.url.includes(".gif")||h.url.includes(".webp")?i.TextureManager.GetGifImage(h.url,!1,null,l):i.TextureManager.GetImage2(h.url,!1,a,u||e.ColorSpace.RGBA_8888));if(d){let t;r&&(t=new e.ViewRoundCornerMask(r.topLeft,r.topRight,r.bottomLeft,r.bottomRight));const i=new e.ExternalTextureSetting(d,t);if(o.ResetTexture(i),s){let e=d.RegisterLoadImageCallback(null,(function(){s({width:d.Width,height:d.Height})}));o.RegisterDetachCallback((()=>{d.UnregisterLoadImageCallback(e)}))}}}static SetMaskedBackgroundImage(o,n,r,s){if("string"==typeof n&&(n=new t(n)),n instanceof t==!1)throw Error("Bad Argument.",n);if("string"==typeof r&&(r=new t(r)),r instanceof t==!1)throw Error("Bad Argument(MaskURL).",r);const a=i.TextureManager.GetImage2(n.href,!1,null,s||e.ColorSpace.RGBA_8888);if(a){const t=i.TextureManager.GetImage2(r.href,!1,null,e.ColorSpace.RGBA_8888),n=new e.ExternalTextureSetting(a,new e.ViewTextureMask(t));o.ResetTexture(n)}}static SetVideoTexture(t,o,n){const r=i.TextureManager.GetColorTexture(o);let s;n&&(s=new e.ViewRoundCornerMask(n.topLeft,n.topRight,n.bottomLeft,n.bottomRight));const a=new e.TextureSetting(r,s);t.ResetTexture(a)}static GetTextWidth(t){return t.str||(t.str=""),t.font||(t.font=e.TextUtils._sDefaultFont),t.size||(t.size=e.TextUtils._sDefaultFontSize),"italic"!==t.italic&&(t.italic=""),"bold"!==t.bold&&(t.bold=""),window.PlatformUtils.GetTextWidth(t)}static RequestSwap(){e.sRenderBridge.RequestSwap()}static SetImgTexSize(e,t){let o={size:t,refNum:0};i.TextureInfo.Cache[e.Source]=o}static RefImgTexSize(e,t){let o=i.TextureInfo.Cache[e.Source];o?(o.refNum>0?o.refNum++:o.refNum=1,t(o.size)):e.RegisterLoadImageCallback(null,(function(){const o={width:e.Width,height:e.Height};t(o);let n=i.TextureInfo.Cache[e.Source];if(n)n.refNum>0?n.refNum++:n.refNum=1;else{let t={size:o,refNum:1};i.TextureInfo.Cache[e.Source]=t}}))}static UnrefImgTexSize(e){if(!e)return;let t=i.TextureInfo.Cache[e.Source];t&&(t.refNum--,t.refNum<=0&&i.TextureInfo.Unused.add(e.Source))}static ClearUnusedTexSize(){for(let e of i.TextureInfo.Unused){let t=i.TextureInfo.Cache[e];t.refNum<-2?(delete i.TextureInfo.Cache[e],i.TextureInfo.Unused.delete(e)):t.refNum<=0?t.refNum--:i.TextureInfo.Unused.delete(e)}}}i.TextureInfo={Cache:{},Unused:new Set},i.TextureManager=null,i.RootView=null,i.RootActivity=null,i.HaltKeyEvent=!1,window.JsvCode.ForgeExtension||(window.JsvCode.ForgeExtension=i);var o=i=window.JsvCode.ForgeExtension;export{e as Forge,o as ForgeExtension};
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(!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:"))return void(this.href=e);let i=e.indexOf("://");if(!(i<0||i>10)||e.startsWith("./")||e.startsWith("/")||(e="./"+e),!0===e.startsWith("/"))e=document.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!==document.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=document.location.href;let e=document.location.pathname.lastIndexOf(window.JsView.Dom.JsSubPath);window.JsView.Dom.MainPath=document.location.origin+document.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 r=o.indexOf("?");r>1&&(this.search=o.substring(r),o=o.substring(0,r));let s=o,a=s.indexOf("://");this.protocol=a>0?s.substring(0,a+1):"";let d=a>1?s.substring(a+3):"";a=d.indexOf("/"),this.host=a>0?d.substring(0,a):"",this.pathname=a>=1?d.substring(a):"",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}href="";origin="";protocol="";host="";hostname="";port="";pathname="";search="";hash=""}class i{static SetBackgroundColor(t,i,o){const n=window.JsvCode.ForgeHandles.TextureManager.GetColorTextureCached(i);let r;o&&(r=new e.ViewRoundCornerMask(o.topLeft,o.topRight,o.bottomLeft,o.bottomRight));const s=new e.ExternalTextureSetting(n,r);t.ResetTexture(s)}static SetBackgroundImage(i,o,n,r,s,a,d){let l,g={};if("string"==typeof o){const e=new t(o);if(e instanceof t==!1)throw Error("Bad Argument.",e);g.url=e.href}else"linear-gradient"==o?.type&&(g.gradient=o);if(g.gradient)if(g.gradient.colors?.length>2){const e=g.gradient.colors,t=[e[0],e[e.length-1]],i=e.slice(1,e.length-1);l=window.JsvCode.ForgeHandles.TextureManager.CreateLinearGradientTexture(t,i)}else 2==g.gradient.colors?.length?l=window.JsvCode.ForgeHandles.TextureManager.CreateMiniGradientTexture(!0,g.gradient.colors[0],g.gradient.colors[1],g.gradient.rawValue):console.warn("Failed to create backgroundImage gradient, bad colors.",g.gradient.colors);else g.url&&(l=g.url.includes(".gif")||g.url.includes(".webp")?window.JsvCode.ForgeHandles.TextureManager.GetGifImage(g.url,!1,null,d):window.JsvCode.ForgeHandles.TextureManager.GetImage2(g.url,!1,s,a||e.ColorSpace.RGBA_8888));if(l){let t;n&&(t=new e.ViewRoundCornerMask(n.topLeft,n.topRight,n.bottomLeft,n.bottomRight));const o=new e.ExternalTextureSetting(l,t);if(i.ResetTexture(o),r){let e=l.RegisterLoadImageCallback(null,(function(){r({width:l.Width,height:l.Height})}));i.RegisterDetachCallback((()=>{l.UnregisterLoadImageCallback(e)}))}}}static SetMaskedBackgroundImage(i,o,n,r){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 s=window.JsvCode.ForgeHandles.TextureManager.GetImage2(o.href,!1,null,r||e.ColorSpace.RGBA_8888);if(s){const t=window.JsvCode.ForgeHandles.TextureManager.GetImage2(n.href,!1,null,e.ColorSpace.RGBA_8888),o=new e.ExternalTextureSetting(s,new e.ViewTextureMask(t));i.ResetTexture(o)}}}export{e as Forge,i as ForgeExtension};
package/dom/index.mjs CHANGED
@@ -90,7 +90,8 @@ async function loadJsViewDomAsync(nativeOrBrowserDebug)
90
90
  if (nativeOrBrowserDebug) {
91
91
  jsviewDom = await loadJsViewDomNative(codeDebugConfig);
92
92
  } else {
93
- window.JsvCode = {}; // native 在java中定义
93
+ // 补充原本由native的ForgeDom生成的JsvCode扩展给内部组件使用的接口类
94
+ window.JsvCode = {};
94
95
 
95
96
  jsviewDom = await loadJsViewDomBrowserDebug(codeDebugConfig);
96
97
  }
@@ -3,11 +3,11 @@
3
3
  */
4
4
 
5
5
  const TargetRevision = {
6
- "CoreRevision": 1021037,
7
- "CoreRevisionAndBranch": "1021037_release_build_js2c",
8
- "JseRevision": "1.0.870",
6
+ "CoreRevision": 1021046,
7
+ "CoreRevisionAndBranch": "1021046_release_build_js2c",
8
+ "JseRevision": "1.0.871",
9
9
  "JseUrl":
10
- "http://cdn.release.qcast.cn/forge_js/forge_js_to_c_5/JsViewES6_js2c_r870.jsv.c47b577f.js"
10
+ "http://cdn.release.qcast.cn/forge_js/forge_js_to_c_5/JsViewES6_js2c_r871.jsv.7f37ecb6.js"
11
11
  };
12
12
 
13
13
  // 不要用export default,update-env脚本不能解析
@@ -83,11 +83,7 @@ export default class JsViewLoader {
83
83
  window.JsView.addKeysMap(this.#config.vendorConfig.bindKeys);
84
84
 
85
85
  // (可选配置)localStorage支持
86
- let storageDomain = this.#config.jsviewConfig.localStorage.domain;
87
- if (storageDomain == "default") {
88
- storageDomain = this.#getHostName();
89
- }
90
- window.JsView.setStorageDomain(storageDomain); // Domain可以为任意字符串,各Domain的localStorage互相隔离
86
+ window.JsView.setStorageDomain(appName); // Domain为app包名
91
87
 
92
88
  const localStorageKeys = this.#config.jsviewConfig.localStorage.presetKeys;
93
89
  window.JsView.enableStorageNames(...localStorageKeys);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shijiu/jsview",
3
- "version": "1.9.921",
3
+ "version": "1.9.943-next-vue.0",
4
4
  "bin": {
5
5
  "jsview-post-build": "./tools/jsview-post-build.js",
6
6
  "jsview-post-install": "./tools/jsview-post-install.js"