@shijiu/jsview-vue 0.9.684 → 0.9.766

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.
Files changed (113) hide show
  1. package/dom/bin/jsview-browser-debug-dom.min.js +1 -1
  2. package/dom/bin/jsview-dom.min.js +1 -1
  3. package/dom/bin/jsview-engine-js-browser.min.js +1 -1
  4. package/dom/bin/jsview-forge-define.min.js +1 -1
  5. package/dom/jsv-engine-js-browser.js +6 -0
  6. package/dom/target_core_revision.js +4 -4
  7. package/loader/loader.js +4 -0
  8. package/package.json +1 -1
  9. package/patches/node_modules/@vue/cli-service/lib/config/base.js +1 -1
  10. package/samples/AnimPicture/App.vue +5 -5
  11. package/samples/Basic/components/div/DivLayout.vue +1 -1
  12. package/samples/Basic/components/img/ImageGroup.vue +2 -2
  13. package/samples/Basic/components/img/ImgLayout.vue +79 -15
  14. package/samples/Basic/components/text/TextDirection.vue +104 -0
  15. package/samples/Basic/components/text/TextEmoji.vue +1 -1
  16. package/samples/Basic/components/text/TextGroup1.vue +1 -1
  17. package/samples/Basic/components/text/TextGroup2.vue +11 -1
  18. package/samples/BasicFocusControl/components/BaseBlock.vue +2 -2
  19. package/samples/Collision/App.vue +11 -11
  20. package/samples/DemoHomepage/App.vue +43 -8
  21. package/samples/DemoHomepage/router.js +13 -10
  22. package/samples/DemoHomepage/views/Homepage.vue +83 -96
  23. package/samples/FilterDemo/App.vue +1 -1
  24. package/samples/FlipCard/App.vue +2 -2
  25. package/samples/FlipCard/FlipCard.vue +3 -3
  26. package/samples/GridDemo/App.vue +3 -3
  27. package/samples/GridDemo/ButtonBlock.vue +2 -2
  28. package/samples/GridDemo/FocusItem.vue +2 -2
  29. package/samples/GridDemo/Item.vue +1 -1
  30. package/samples/HashHistory/App.vue +10 -3
  31. package/samples/HashHistory/components/Item.vue +1 -1
  32. package/samples/ImpactStop/App.vue +15 -11
  33. package/samples/Input/InputPanel.vue +1 -1
  34. package/samples/LongImage/Button.vue +1 -1
  35. package/samples/LongImage/ButtonItem.vue +1 -1
  36. package/samples/LongImage/LongImageScroll.vue +2 -2
  37. package/samples/LongText/App.vue +1 -1
  38. package/samples/LongText/Button.vue +1 -1
  39. package/samples/LongText/ButtonItem.vue +1 -1
  40. package/samples/LongText/LongTextScroll.vue +3 -3
  41. package/samples/Marquee/longText.js +2 -2
  42. package/samples/MetroWidgetDemos/Advanced/ButtonItem.vue +4 -4
  43. package/samples/MetroWidgetDemos/Advanced/widgets/Item.vue +3 -4
  44. package/samples/MetroWidgetDemos/Advanced/widgets/WidgetItem.vue +2 -3
  45. package/samples/MetroWidgetDemos/Advanced/widgets/Widgets.vue +1 -1
  46. package/samples/MetroWidgetDemos/Item.vue +3 -19
  47. package/samples/MetroWidgetDemos/PerformanceTest/App.vue +4 -4
  48. package/samples/MetroWidgetDemos/PerformanceTest/components/ContentItem.vue +1 -1
  49. package/samples/MetroWidgetDemos/PerformanceTest/components/MyTab.vue +3 -3
  50. package/samples/MetroWidgetDemos/PingPong/AppPage.vue +2 -2
  51. package/samples/MetroWidgetDemos/PingPong/TabItem.vue +1 -1
  52. package/samples/MetroWidgetDemos/PingPong/ViewSwiper.vue +3 -3
  53. package/samples/MetroWidgetDemos/Simple/RelativeTemplate.vue +2 -2
  54. package/samples/MetroWidgetDemos/WidgetItem.vue +2 -3
  55. package/samples/NinePatchDemo/App.vue +2 -2
  56. package/samples/NinePatchDemo/Item.vue +2 -2
  57. package/samples/Preload/App.vue +1 -1
  58. package/samples/Preload/Item.vue +1 -1
  59. package/samples/QrcodeDemo/App.vue +1 -1
  60. package/samples/SoundPool/App.vue +3 -3
  61. package/samples/SpriteImage/App.vue +5 -0
  62. package/samples/TextBox/App.vue +2 -1
  63. package/samples/TextureAnimation/App2.vue +1 -1
  64. package/samples/ThrowMoveDemo/LRParabolicDemo.vue +33 -47
  65. package/samples/TouchSample/MetroWidgetHorizontal.vue +1 -1
  66. package/samples/TouchSample/MetroWidgetVertical.vue +1 -1
  67. package/samples/TransitPage/App.vue +1 -1
  68. package/samples/VideoDemo/App.vue +8 -8
  69. package/samples/VideoDemo/components/Button.vue +1 -1
  70. package/samples/VideoDemo/components/Controllor.vue +1 -1
  71. package/samples/VisibleSensorDemo/App.vue +3 -3
  72. package/scripts/jsview-run-android.js +5 -4
  73. package/utils/JsViewEngineWidget/JsvFocusBlock.vue +4 -4
  74. package/utils/JsViewEngineWidget/MetroWidget/MetroWidget.vue +65 -39
  75. package/utils/JsViewEngineWidget/TemplateParser.js +138 -146
  76. package/utils/JsViewEngineWidget/WidgetCommon.js +12 -3
  77. package/utils/JsViewPlugin/BrowserPluginLoader.js +4 -2
  78. package/utils/JsViewPlugin/JsvAudio/AudioProxy.js +302 -0
  79. package/utils/JsViewPlugin/JsvAudio/CheckType.js +68 -0
  80. package/utils/JsViewPlugin/JsvAudio/Events.js +17 -0
  81. package/utils/JsViewPlugin/JsvAudio/JsvAudio.vue +176 -0
  82. package/utils/JsViewPlugin/JsvAudio/JsvAudioBridgeProxy.js +40 -0
  83. package/utils/JsViewPlugin/JsvAudio/JsvAudioBrowser.vue +46 -0
  84. package/utils/JsViewPlugin/JsvAudio/PluginLoader.js +140 -0
  85. package/utils/JsViewPlugin/JsvAudio/index.js +26 -0
  86. package/utils/JsViewPlugin/JsvAudio/version.js +24 -0
  87. package/utils/JsViewPlugin/JsvPlayer/index.js +1 -1
  88. package/utils/JsViewPlugin/JsvPlayer/version.js +5 -5
  89. package/utils/JsViewVueTools/JsvHashHistory.js +34 -8
  90. package/utils/JsViewVueTools/JsvImpactTracer.js +2 -2
  91. package/utils/JsViewVueTools/JsvRuntimeBridge.js +46 -8
  92. package/utils/JsViewVueTools/JsvStyleClass.js +9 -0
  93. package/utils/{JsViewVueWidget/utils/text.js → JsViewVueTools/JsvTextTools.js} +3 -4
  94. package/utils/JsViewVueTools/TypeCheckAndSet.js +3 -3
  95. package/utils/JsViewVueTools/index.js +2 -1
  96. package/utils/JsViewVueWidget/BrowserDebugWidget/BrowserTextureAnim.vue +5 -7
  97. package/utils/JsViewVueWidget/JsvActorMove/JsvActorMove.vue +20 -22
  98. package/utils/JsViewVueWidget/JsvApic/JsvApic.vue +4 -4
  99. package/utils/JsViewVueWidget/JsvGrid.vue +1 -9
  100. package/utils/JsViewVueWidget/JsvInput/Cursor.vue +1 -1
  101. package/utils/JsViewVueWidget/JsvMarquee.vue +22 -12
  102. package/utils/JsViewVueWidget/JsvMaskClipDiv.vue +1 -1
  103. package/utils/JsViewVueWidget/JsvNinePatch.vue +63 -53
  104. package/utils/JsViewVueWidget/JsvSpray/JsvSpray.vue +10 -5
  105. package/utils/JsViewVueWidget/JsvSpriteAnim/JsvSpriteAnim.vue +2 -2
  106. package/utils/JsViewVueWidget/JsvSwiper/JsvSwiper.vue +3 -3
  107. package/utils/JsViewVueWidget/JsvSwiper3D/JsvSwiper.vue +1 -1
  108. package/utils/JsViewVueWidget/JsvTextBox.vue +11 -31
  109. package/utils/JsViewVueWidget/JsvTouchContainer.vue +2 -2
  110. package/utils/JsViewVueWidget/JsvTransparentDiv.vue +1 -1
  111. package/utils/JsViewVueWidget/JsvVisibleSensor/JsvVisibleSensor.vue +5 -5
  112. package/utils/JsViewVueWidget/index.js +8 -8
  113. package/utils/JsViewVueWidget/utils/index.js +0 -8
@@ -1 +1 @@
1
- /* eslint-disable */ var o={};window.JsView&&(window.JsView.Dom&&window.JsView.Dom.Extension||(window.JsView.Dom.Extension=o),o=window.JsView.Dom.Extension);var w=o;void 0===window.Forge&&(window.Forge={});var i=window.Forge;export{i as Forge,w as ForgeExtension};
1
+ /* eslint-disable */ void 0===window.Forge&&(window.Forge={});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:"))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("./")||!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)+"/"}let t=window.JsView.Dom.__MainPath;e=e.startsWith("./")?t+e.substring(2):t+e}if(this.href=e,!t)return;let n=this.href,r=n.indexOf("#");r>0&&(this.hash=n.substring(r),n=n.substring(0,r));let s=n.indexOf("?");s>1&&(this.search=n.substring(s),n=n.substring(0,s));let o=n,a=o.indexOf("://");this.protocol=a>0?o.substring(0,a+1):"";let u=a>1?o.substring(a+3):"";if(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:"",this.host.startsWith("[")){let e=this.host.indexOf("]");this.hostname=this.host.substring(0,e+1),e=this.host.substring(e+1).indexOf(":"),this.port=e>1?this.host.substring(e+1):""}else{let e=this.host.indexOf(":");this.hostname=e>0?this.host.substring(0,e):this.host,this.port=e>1?this.host.substring(e+1):""}}replace(e){this.href=e}}window.JsView&&window.JsView.registerUriConverter?.((e=>new t(e,!1).href));class i{static SetBackgroundColor(t,n,r){const s=i.TextureManager.GetColorTextureCached(n);let o;r&&(o=new e.ViewRoundCornerMask(r.topLeft,r.topRight,r.bottomLeft,r.bottomRight));const a=new e.ExternalTextureSetting(s,o);t.ResetTexture(a)}static SetBackgroundImage(n,r,s,o,a,u,h){let l,d={};if("string"==typeof r){const e=new t(r);if(e instanceof t==!1)throw Error("Bad Argument.",e);d.url=e.href}else"linear-gradient"==r?.type&&(d.gradient=r);if(d.gradient)if(d.gradient.colors?.length>2){const e=d.gradient.colors,t=[e[0],e[e.length-1]],n=e.slice(1,e.length-1);l=i.TextureManager.CreateLinearGradientTexture(t,n)}else 2==d.gradient.colors?.length?l=i.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&&(l=d.url.includes(".gif")||d.url.includes(".webp")?i.TextureManager.GetGifImage(d.url,!1,null,h):i.TextureManager.GetImage2(d.url,!1,a,u||e.ColorSpace.RGBA_8888));if(l){let t;s&&(t=new e.ViewRoundCornerMask(s.topLeft,s.topRight,s.bottomLeft,s.bottomRight));const i=new e.ExternalTextureSetting(l,t);if(n.ResetTexture(i),o){let e=l.RegisterLoadImageCallback(null,(function(){o({width:l.Width,height:l.Height})}));n.RegisterDetachCallback((()=>{l.UnregisterLoadImageCallback(e)}))}}}static SetMaskedBackgroundImage(n,r,s,o){if("string"==typeof r&&(r=new t(r)),r instanceof t==!1)throw Error("Bad Argument.",r);if("string"==typeof s&&(s=new t(s)),s instanceof t==!1)throw Error("Bad Argument(MaskURL).",s);const a=i.TextureManager.GetImage2(r.href,!1,null,o||e.ColorSpace.RGBA_8888);if(a){const t=i.TextureManager.GetImage2(s.href,!1,null,e.ColorSpace.RGBA_8888),r=new e.ExternalTextureSetting(a,new e.ViewTextureMask(t));n.ResetTexture(r)}}static SetVideoTexture(t,n,r){const s=i.TextureManager.GetColorTexture(n);let o;r&&(o=new e.ViewRoundCornerMask(r.topLeft,r.topRight,r.bottomLeft,r.bottomRight));const a=new e.TextureSetting(s,o);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 n={size:t,refNum:0};i.TextureInfo.Cache[e.Source]=n}static RefImgTexSize(e,t){let n=i.TextureInfo.Cache[e.Source];n?(n.refNum>0?n.refNum++:n.refNum=1,t(n.size)):e.RegisterLoadImageCallback(null,(function(){const n={width:e.Width,height:e.Height};t(n);let r=i.TextureInfo.Cache[e.Source];if(r)r.refNum>0?r.refNum++:r.refNum=1;else{let t={size:n,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.JsView&&(window.JsView.ForgeExtension||(window.JsView.ForgeExtension=i),i=window.JsView.ForgeExtension);var n=i;export{e as Forge,n as ForgeExtension};
@@ -0,0 +1,6 @@
1
+ // Release entry
2
+ export * from "./bin/jsview-engine-js-browser.min"
3
+
4
+ // Debug entry
5
+ // TODO: 进行编译(yarn build)时,需要关闭掉此require
6
+ // export * from "../deps/jsview-dom/src/engine-js/browser"
@@ -3,11 +3,11 @@
3
3
  */
4
4
 
5
5
  const TargetRevision = {
6
- "CoreRevision": 811211,
7
- "CoreRevisionAndBranch": "811211",
8
- "JseRevision": "1.0.824",
6
+ "CoreRevision": 1021277,
7
+ "CoreRevisionAndBranch": "1021277",
8
+ "JseRevision": "1.0.830",
9
9
  "JseUrl":
10
- "http://cdn.release.qcast.cn/forge_js/master/JsViewES6_react_r824.jsv.a2da4803.js"
10
+ "http://cdn.release.qcast.cn/forge_js/master/JsViewES6_react_r830.jsv.9e271859.js"
11
11
  };
12
12
 
13
13
  // 不要用export default,update-env脚本不能解析
package/loader/loader.js CHANGED
@@ -52,6 +52,10 @@ async function selectJsViewRuntime(js_sub_path, input_designed_map, app_name) {
52
52
  window.JsView.ForgeExt = app_define.ForgeExtension;
53
53
  window.JsView.Dom.JsSubPath = js_sub_path;
54
54
  } else {
55
+ // 在PC环境下没有处理加载EngineJs, 所以在此加载一下
56
+ await import("../dom/jsv-engine-js-browser.js");
57
+
58
+ // 加载jsv-dom的调试版本
55
59
  await import("../dom/jsv-browser-debug-dom.js");
56
60
  }
57
61
  }
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "./dom/*.js",
8
8
  "./loader/*.js"
9
9
  ],
10
- "version": "0.9.684",
10
+ "version": "0.9.766",
11
11
  "bin": {
12
12
  "jsview-post-build": "./scripts/jsview-post-build.js",
13
13
  "jsview-post-install": "./scripts/jsview-post-install.js",
@@ -129,7 +129,7 @@ module.exports = (api, options) => {
129
129
  .loader(require.resolve('vue-loader'))
130
130
  .options({
131
131
  ...vueLoaderCacheConfig,
132
- compilerOptions: { isCustomElement: tag => tag === 'fdiv' }, // QCode Added
132
+ compilerOptions: { isCustomElement: tag => (tag === 'fdiv' || tag === 'audiotrack') }, // QCode Added
133
133
  babelParserPlugins: ['jsx', 'classProperties', 'decorators-legacy']
134
134
  })
135
135
  .end()
@@ -6,7 +6,7 @@
6
6
  * @Description: file content
7
7
  -->
8
8
  <script setup>
9
- import { ref } from "vue";
9
+ import { ref, shallowRef } from "vue";
10
10
  import { useRouter, useRoute } from "vue-router";
11
11
  import { LoopType, JsvApic } from "jsview";
12
12
  import catRun from "./assets/animated_webp.webp";
@@ -53,10 +53,10 @@ const ballCallback = {
53
53
  ballPlay.value = false;
54
54
  },
55
55
  };
56
- let catRunRef = ref(null);
57
- let girlRunRef = ref(null);
58
- let quanRef = ref(null);
59
- let ballRef = ref(null);
56
+ let catRunRef = shallowRef(null);
57
+ let girlRunRef = shallowRef(null);
58
+ let quanRef = shallowRef(null);
59
+ let ballRef = shallowRef(null);
60
60
 
61
61
  const onKeyDown = (ev) => {
62
62
  if (ev.keyCode == 8 || ev.keyCode == 27 || ev.keyCode == 10000) {
@@ -51,7 +51,7 @@
51
51
  </template>
52
52
 
53
53
  <script setup>
54
- import { ref, onUnmounted } from 'vue'
54
+ import { ref, shallowRef, onUnmounted } from 'vue'
55
55
 
56
56
  // v-show 控制
57
57
  let vShow = ref(false);
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div id='item-root'>
3
- <ContentBlock :class=contentClass :style="{top:itemSides.height*0}" :=contentBlockProps :index=0 title="图片显示">
3
+ <ContentBlock :class=contentClass :style="{top:itemSides.height*0}" :=contentBlockProps :index=0 title="img标签ObjectFit">
4
4
  <ImgLayout/>
5
5
  </ContentBlock>
6
6
  </div>
@@ -23,7 +23,7 @@ export default {
23
23
  contentBlockProps() {
24
24
  return {
25
25
  colIndex: 0,
26
- itemSides: this.itemSides
26
+ itemSides:{...this.itemSides, height: this.itemSides.height * 2}
27
27
  }
28
28
  }
29
29
  }
@@ -1,13 +1,54 @@
1
1
  <template>
2
2
  <div id='layout-root'>
3
3
  <div style="{top: 0}">
4
- <div class="content-font" :style="{width: 50, height: titleHeight}">原图</div>
5
- <div :style="{top: titleHeight,
6
- width: imageSize.width+4, height: imageSize.height+4,
7
- backgroundColor: 'rgba(0, 255, 0, 1)' }">
8
- <img :style="{ left: 2, top: 2,
9
- width: imageSize.width, height: imageSize.height}"
10
- :src="testImgPath"/>
4
+ <div id="0列0行" :style="{left: coloumWidth * 0, top: tabLineHeight * 0}">
5
+ <div class="content-font titleStyle"> fill(缩放变形)</div>
6
+ <div class="frameStyle">
7
+ <img class="imageStyle" :style="{ objectFit: 'fill' }"
8
+ :src="testImgPath"/>
9
+ </div>
10
+ </div>
11
+ <div id="1列0行" :style="{left: coloumWidth * 1, top: tabLineHeight * 0}">
12
+ <div class="content-font titleStyle">contain</div>
13
+ <div class="frameStyle">
14
+ <img class="imageStyle" :style="{ objectFit: 'contain' }"
15
+ :src="testImgPath"/>
16
+ </div>
17
+ </div>
18
+ <div id="0列1行" :style="{left: coloumWidth * 0, top: tabLineHeight * 1}">
19
+ <div class="content-font titleStyle">none</div>
20
+ <div class="frameStyle">
21
+ <img class="imageStyle" :style="{ objectFit: 'none' }"
22
+ :src="testImgPath"/>
23
+ </div>
24
+ </div>
25
+ <div id="1列1行" :style="{left: coloumWidth * 1, top: tabLineHeight * 1}">
26
+ <div class="content-font titleStyle">scale-down</div>
27
+ <div class="frameStyle">
28
+ <img class="imageStyle" :style="{ objectFit: 'scale-down' }"
29
+ :src="testImgPath"/>
30
+ </div>
31
+ </div>
32
+ <div id="0列2行" :style="{left: coloumWidth * 0, top: tabLineHeight * 2}">
33
+ <div class="content-font titleStyle">cover</div>
34
+ <div class="frameStyle">
35
+ <img class="imageStyle" :style="{ objectFit: 'cover' }"
36
+ :src="testImgPath"/>
37
+ </div>
38
+ </div>
39
+ <div id="1列2行" :style="{left: coloumWidth * 1, top: tabLineHeight * 2}">
40
+ <div class="content-font titleStyle">none(小图)</div>
41
+ <div class="frameStyle">
42
+ <img class="imageStyle" :style="{ objectFit: 'none' }"
43
+ :src="tinyImgPath"/>
44
+ </div>
45
+ </div>
46
+ <div id="0列3行" :style="{left: coloumWidth * 0, top: tabLineHeight * 3}">
47
+ <div class="content-font titleStyle">scale-down(小图)</div>
48
+ <div class="frameStyle">
49
+ <img class="imageStyle" :style="{ objectFit: 'scale-down' }"
50
+ :src="tinyImgPath"/>
51
+ </div>
11
52
  </div>
12
53
  </div>
13
54
  </div>
@@ -15,27 +56,50 @@
15
56
 
16
57
  <script>
17
58
  import testImgPath from '../../assets/test.jpg';
59
+ import tinyImgPath from '../../assets/icon.png';
18
60
 
19
61
  export default {
20
62
  computed: {
21
63
  testImgPath() {
22
64
  return testImgPath;
23
65
  },
24
- titleHeight() {
25
- return 16;
66
+ tinyImgPath() {
67
+ return tinyImgPath;
26
68
  },
27
- imageSize() {
28
- return {
29
- width: 80,
30
- height: 64,
31
- }
69
+ coloumWidth() {
70
+ return 120;
32
71
  },
72
+ tabLineHeight() {
73
+ return 76; // imageSize.height + 26
74
+ }
33
75
  }
34
76
  }
35
77
 
36
78
  </script>
37
79
 
38
80
 
39
- <style>
81
+ <style scoped>
40
82
  @import "../FontStyle.css";
83
+ </style>
84
+
85
+ <style scoped>
86
+ .titleStyle {
87
+ width: 100;
88
+ height: 16;
89
+ }
90
+
91
+ .imageStyle {
92
+ top: 2;
93
+ left: 2;
94
+ width: 100;
95
+ height: 50;
96
+ }
97
+
98
+ .frameStyle {
99
+ top: 16; /* titleHeight */
100
+ width: 104; /* imageSize.width+4 */
101
+ height: 54; /* imageSize.height+4 */
102
+ background-color: rgba(0, 255, 0, 1)
103
+ }
104
+
41
105
  </style>
@@ -0,0 +1,104 @@
1
+ <script setup>
2
+ const gap = 5;
3
+ const blockSize = {
4
+ width: 180,
5
+ height: 30,
6
+ };
7
+ const unitHeight = 20 + 35;
8
+
9
+ const ltrText = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
10
+ const rtlText = "شلؤيثبلاهتنمةىخحضقسفعررصءغئا";
11
+ </script>
12
+
13
+ <template>
14
+ <div id="layout-root">
15
+ <div
16
+ :style="{
17
+ top: unitHeight * 0,
18
+ }"
19
+ >
20
+ <div class="explain">ltr文字省略尾部</div>
21
+ <div
22
+ class="content-font base"
23
+ :style="{
24
+ direction: 'ltr',
25
+ }"
26
+ >
27
+ {{ ltrText }}
28
+ </div>
29
+ </div>
30
+
31
+ <div
32
+ :style="{
33
+ top: unitHeight * 1,
34
+ }"
35
+ >
36
+ <div class="explain">ltr文字省略头部</div>
37
+ <div
38
+ class="content-font base"
39
+ :style="{
40
+ direction: 'rtl',
41
+ }"
42
+ >
43
+ {{ ltrText }}
44
+ </div>
45
+ </div>
46
+
47
+ <div
48
+ :style="{
49
+ top: unitHeight * 2,
50
+ }"
51
+ >
52
+ <div class="explain">rtl文字省略尾部</div>
53
+ <div
54
+ class="content-font base"
55
+ :style="{
56
+ direction: 'rtl',
57
+ }"
58
+ >
59
+ {{ rtlText }}
60
+ </div>
61
+ </div>
62
+
63
+ <div
64
+ :style="{
65
+ top: unitHeight * 3,
66
+ }"
67
+ >
68
+ <div class="explain">rtl文字省略头部</div>
69
+ <div
70
+ class="content-font base"
71
+ :style="{
72
+ direction: 'ltr',
73
+ }"
74
+ >
75
+ {{ rtlText }}
76
+ </div>
77
+ </div>
78
+ </div>
79
+ </template>
80
+
81
+ <style>
82
+ @import "../FontStyle.css";
83
+
84
+ .base {
85
+ top: 25px;
86
+ width: 180px;
87
+ height: 30px;
88
+ line-height: 30px;
89
+ background-color: rgba(255, 255, 0, 0.5);
90
+ color: #ff0000;
91
+ font-size: 25px;
92
+ white-space: nowrap;
93
+ text-overflow: ellipsis;
94
+ overflow: hidden;
95
+ }
96
+
97
+ .explain {
98
+ width: 180px;
99
+ height: 20px;
100
+ line-height: 20px;
101
+ font-size: 15px;
102
+ color: #000000;
103
+ }
104
+ </style>
@@ -18,7 +18,7 @@
18
18
 
19
19
  <style>
20
20
  .emoji {
21
- top: 100;
21
+ top: 80;
22
22
  width: 300;
23
23
  height: 100;
24
24
  font-size: 20;
@@ -38,7 +38,7 @@ const contentBlockProps = {
38
38
  <ContentBlock
39
39
  :class="contentClass"
40
40
  :style="{ top: itemSides.height * 2 }"
41
- :="{ ...contentBlockProps, itemSides: { ...itemSides, height: 290 } }"
41
+ :="{ ...contentBlockProps, itemSides: { ...itemSides, height: 320 } }"
42
42
  :index="2"
43
43
  title="文字折行"
44
44
  >
@@ -1,6 +1,7 @@
1
1
  <script setup>
2
2
  import ContentBlock from "../ContentBlock";
3
3
  import TextEmoji from "./TextEmoji";
4
+ import TextDirection from "./TextDirection.vue";
4
5
 
5
6
  const props = defineProps({
6
7
  contentClass: String,
@@ -19,10 +20,19 @@ const contentBlockProps = {
19
20
  :style="{ top: itemSides.height * 0 }"
20
21
  :="contentBlockProps"
21
22
  :index="0"
22
- title="文字对齐"
23
+ title="emoji"
23
24
  >
24
25
  <TextEmoji />
25
26
  </ContentBlock>
27
+ <ContentBlock
28
+ :class="contentClass"
29
+ :style="{ top: itemSides.height * 1 }"
30
+ :="{ ...contentBlockProps, itemSides: { ...itemSides, height: 250 } }"
31
+ :index="0"
32
+ title="不同方向文字省略"
33
+ >
34
+ <text-direction />
35
+ </ContentBlock>
26
36
  </div>
27
37
  </template>
28
38
 
@@ -1,5 +1,5 @@
1
1
  <script setup>
2
- import { ref, onMounted } from "vue";
2
+ import { ref, shallowRef, onMounted } from "vue";
3
3
  const props = defineProps({
4
4
  name: String,
5
5
  style: {
@@ -12,7 +12,7 @@ const props = defineProps({
12
12
  });
13
13
 
14
14
  const fullName = ref("");
15
- const blockRef = ref(null);
15
+ const blockRef = shallowRef(null);
16
16
  const hasFocused = ref(false);
17
17
 
18
18
  onMounted(() => {
@@ -7,21 +7,21 @@
7
7
  -->
8
8
  <script setup>
9
9
  import { createImpactTracer, createImpactCallback } from "jsview";
10
- import { ref, onMounted, onBeforeUnmount } from "vue";
10
+ import { ref, shallowRef, onMounted, onBeforeUnmount } from "vue";
11
11
  import { useRouter } from "vue-router";
12
12
 
13
13
  const router = useRouter();
14
14
 
15
- const transEle1 = ref(null),
16
- transEle2 = ref(null),
17
- rotateEle1 = ref(null),
18
- rotateEle2 = ref(null),
19
- rotateEle3 = ref(null),
20
- rotateEle4 = ref(null),
21
- scaleEle1 = ref(null),
22
- scaleEle2 = ref(null),
23
- skewEle1 = ref(null),
24
- skewEle2 = ref(null);
15
+ const transEle1 = shallowRef(null),
16
+ transEle2 = shallowRef(null),
17
+ rotateEle1 = shallowRef(null),
18
+ rotateEle2 = shallowRef(null),
19
+ rotateEle3 = shallowRef(null),
20
+ rotateEle4 = shallowRef(null),
21
+ scaleEle1 = shallowRef(null),
22
+ scaleEle2 = shallowRef(null),
23
+ skewEle1 = shallowRef(null),
24
+ skewEle2 = shallowRef(null);
25
25
 
26
26
  let sensors = [];
27
27
 
@@ -5,23 +5,58 @@
5
5
  * @LastEditTime: 2022-07-12 13:40:15
6
6
  * @Description: file content
7
7
  -->
8
+ <script setup>
9
+ import { shallowRef, onMounted, defineExpose } from "vue";
10
+ import { JsvPreload, buildPreloadInfo, jJsvRuntimeBridge } from "jsview";
11
+
12
+ let backgroundImageUrl = shallowRef(null);
13
+
14
+ let preloadInfo = shallowRef([]);
15
+
16
+ let _onPreloadDone = () => {
17
+ console.log("background load done");
18
+ jJsvRuntimeBridge.notifyPageLoaded();
19
+ };
20
+
21
+ onMounted(() => {
22
+ console.log("simulate async get background url");
23
+ setTimeout(() => {
24
+ console.log("simulate background url got");
25
+ backgroundImageUrl.value =
26
+ "https://qcast-image.oss-cn-qingdao.aliyuncs.com/JsViewVideo/ImageTestSample/BackgroundLongmao.jpg";
27
+ preloadInfo.value = [buildPreloadInfo(backgroundImageUrl.value)];
28
+ }, 0);
29
+ });
30
+ </script>
31
+
8
32
  <script>
9
33
  import { router } from "./router.js";
10
- import { jJsvRuntimeBridge } from "jsview";
11
-
12
34
  export default {
13
35
  Router: router,
14
- mounted() {
15
- jJsvRuntimeBridge.notifyPageLoaded();
16
- },
17
36
  };
18
37
  </script>
19
38
 
20
39
  <template>
21
40
  <div>
22
- <router-view />
41
+ <jsv-preload
42
+ :key="backgroundImageUrl"
43
+ :preloadList="preloadInfo"
44
+ :onPreloadDone="_onPreloadDone"
45
+ />
46
+ <div
47
+ :style="{
48
+ width: 1280,
49
+ height: 720,
50
+ backgroundImage: backgroundImageUrl,
51
+ }"
52
+ />
53
+ <router-view v-slot="{ Component, route }">
54
+ <keep-alive>
55
+ <component v-if="route.meta.keepAlive" :is="Component" />
56
+ </keep-alive>
57
+ <component v-if="!route.meta.keepAlive" :is="Component" />
58
+ </router-view>
23
59
  </div>
24
60
  </template>
25
61
 
26
- <style scoped>
27
- </style>
62
+ <style scoped></style>
@@ -7,6 +7,9 @@ const routeList = [
7
7
  name: "Home",
8
8
  path: "/",
9
9
  component: () => import("./views/Homepage"),
10
+ meta: {
11
+ keepAlive: true // 需要被缓存(测试Router keep alive机制)
12
+ }
10
13
  },
11
14
  {
12
15
  name: "基础示例合集",
@@ -28,11 +31,11 @@ const routeList = [
28
31
  path: "/feature/NinePatchDemo",
29
32
  component: () => import("jsview/samples/NinePatchDemo/App"),
30
33
  },
31
- {
32
- name: "视频",
33
- path: "/feature/VideoDemo",
34
- component: () => import("jsview/samples/VideoDemo/App"),
35
- },
34
+ // {
35
+ // name: "视频",
36
+ // path: "/feature/VideoDemo",
37
+ // component: () => import("jsview/samples/VideoDemo/App"),
38
+ // },
36
39
  {
37
40
  name: "焦点切换demo",
38
41
  path: "/feature/BasicFocusControl",
@@ -154,11 +157,11 @@ const routeList = [
154
157
  // path: "/feature/Collision",
155
158
  // component: () => import("jsview/samples/Collision/App"),
156
159
  // },
157
- // {
158
- // name: "碰撞即停",
159
- // path: "/feature/ImpactStop",
160
- // component: () => import("jsview/samples/ImpactStop/App"),
161
- // },
160
+ {
161
+ name: "碰撞即停",
162
+ path: "/feature/ImpactStop",
163
+ component: () => import("jsview/samples/ImpactStop/App"),
164
+ },
162
165
 
163
166
  // MetroWidget示例
164
167
  {