@shijiu/jsview-vue 0.0.1-beta.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.
Files changed (252) hide show
  1. package/docs/IMPORT_CHANGE_LOG.txt +3 -0
  2. package/docs/git_commit.md +15 -0
  3. package/docs/test_version_up.txt +1 -0
  4. package/dom/bin/jsview-dom-1.0.313.tgz +0 -0
  5. package/dom/browser-root-style.css +21 -0
  6. package/dom/jsv-browser-debug-dom.js +8 -0
  7. package/dom/jsv-dom.js +6 -0
  8. package/dom/jsv-forge-define.js +6 -0
  9. package/dom/target_core_revision.js +14 -0
  10. package/load/header_script_loader.js +134 -0
  11. package/load/jsview-main.js +42 -0
  12. package/load/jsview.config.default.js +37 -0
  13. package/load/jsview.default.config.js +37 -0
  14. package/load/loader.js +172 -0
  15. package/load/loader_webkit.js +40 -0
  16. package/package.json +27 -0
  17. package/patch/node_modules/@babel/preset-env/lib/available-plugins.js +219 -0
  18. package/patch/node_modules/@vue/cli-plugin-typescript/index.js +100 -0
  19. package/patch/node_modules/@vue/cli-service/lib/commands/serve.js +395 -0
  20. package/patch/node_modules/@vue/cli-service/lib/config/app.js +272 -0
  21. package/patch/node_modules/@vue/cli-service/lib/config/assets.js +70 -0
  22. package/patch/node_modules/@vue/cli-service/lib/config/base.js +212 -0
  23. package/patch/node_modules/@vue/compiler-sfc/dist/compiler-sfc.cjs.js +2566 -0
  24. package/patch/node_modules/@vue/compiler-sfc/dist/jsview-css-to-js.js +274 -0
  25. package/patch/node_modules/@vue/runtime-dom/dist/runtime-dom.esm-bundler.js +1596 -0
  26. package/patch/node_modules/postcss-js/objectifier.js +90 -0
  27. package/patch/node_modules/vue-loader/dist/resolveScript.js +70 -0
  28. package/patch/package-lock.json +30051 -0
  29. package/samples/AdvanceMetroWidget/App.vue +123 -0
  30. package/samples/AdvanceMetroWidget/Frame.vue +101 -0
  31. package/samples/AdvanceMetroWidget/Item.vue +58 -0
  32. package/samples/AdvanceMetroWidget/data.js +137 -0
  33. package/samples/AnimPicture/App.vue +224 -0
  34. package/samples/AnimPicture/assets/animated_webp.webp +0 -0
  35. package/samples/AnimPicture/assets/ball_3.webp +0 -0
  36. package/samples/AnimPicture/assets/girl_run.gif +0 -0
  37. package/samples/AnimPicture/assets/quan.webp +0 -0
  38. package/samples/Basic/App.vue +129 -0
  39. package/samples/Basic/assets/border.png +0 -0
  40. package/samples/Basic/assets/border2.png +0 -0
  41. package/samples/Basic/assets/icon.png +0 -0
  42. package/samples/Basic/assets/test.jpg +0 -0
  43. package/samples/Basic/components/ContentBlock.vue +36 -0
  44. package/samples/Basic/components/FontStyle.css +10 -0
  45. package/samples/Basic/components/TitleBar.vue +29 -0
  46. package/samples/Basic/components/anim/AnimGroup.vue +68 -0
  47. package/samples/Basic/components/anim/AnimKeyframeBasic.vue +102 -0
  48. package/samples/Basic/components/anim/AnimKeyframeComposite.vue +53 -0
  49. package/samples/Basic/components/anim/AnimTransition.vue +116 -0
  50. package/samples/Basic/components/div/DivBackground.vue +15 -0
  51. package/samples/Basic/components/div/DivClip.vue +81 -0
  52. package/samples/Basic/components/div/DivCssScoped.vue +27 -0
  53. package/samples/Basic/components/div/DivCssVar.vue +50 -0
  54. package/samples/Basic/components/div/DivGroup1.vue +33 -0
  55. package/samples/Basic/components/div/DivGroup2.vue +41 -0
  56. package/samples/Basic/components/div/DivLayout.vue +12 -0
  57. package/samples/Basic/components/div/DivRadius.vue +47 -0
  58. package/samples/Basic/components/text/TextAlign.vue +48 -0
  59. package/samples/Basic/components/text/TextFontStyle.vue +58 -0
  60. package/samples/Basic/components/text/TextGroup.vue +32 -0
  61. package/samples/Basic/components/text/TextOverflow.vue +78 -0
  62. package/samples/BasicFocusControl/App.vue +125 -0
  63. package/samples/BasicFocusControl/components/BaseBlock.vue +51 -0
  64. package/samples/BasicFocusControl/components/MainArea.vue +98 -0
  65. package/samples/BasicFocusControl/components/MainAreaLeftBlock.vue +21 -0
  66. package/samples/BasicFocusControl/components/MainAreaRightBlock.vue +30 -0
  67. package/samples/BasicFocusControl/components/SideBar.vue +73 -0
  68. package/samples/BasicFocusControl/components/SideBarBlock.vue +30 -0
  69. package/samples/ClassNameDemo/App.vue +119 -0
  70. package/samples/ClassNameDemo/assets/bg.jpg +0 -0
  71. package/samples/ClassNameDemo/assets/coupon_content.png +0 -0
  72. package/samples/ClassNameDemo/assets/coupon_left.png +0 -0
  73. package/samples/ClassNameDemo/assets/coupon_mid.png +0 -0
  74. package/samples/ClassNameDemo/assets/coupon_right.png +0 -0
  75. package/samples/ClassNameDemo/assets/focus_border.png +0 -0
  76. package/samples/ClassNameDemo/assets/holder_logo.png +0 -0
  77. package/samples/ClassNameDemo/assets/jrbm.png +0 -0
  78. package/samples/ClassNameDemo/assets/line_left.png +0 -0
  79. package/samples/ClassNameDemo/assets/line_mid.png +0 -0
  80. package/samples/ClassNameDemo/assets/line_right.png +0 -0
  81. package/samples/ClassNameDemo/assets/loading.png +0 -0
  82. package/samples/ClassNameDemo/assets/logo.png +0 -0
  83. package/samples/ClassNameDemo/assets/mcjx.png +0 -0
  84. package/samples/ClassNameDemo/assets/tao.png +0 -0
  85. package/samples/ClassNameDemo/assets/tmall.png +0 -0
  86. package/samples/ClassNameDemo/components/ContentItem.vue +253 -0
  87. package/samples/ClassNameDemo/components/LoadingView.vue +43 -0
  88. package/samples/ClassNameDemo/components/TitleView.vue +24 -0
  89. package/samples/ClassNameDemo/data.js +24 -0
  90. package/samples/ColorSpace/App.vue +135 -0
  91. package/samples/ColorSpace/bmpDemo.bmp +0 -0
  92. package/samples/ColorSpace/jpegDemo.jpeg +0 -0
  93. package/samples/ColorSpace/pngDemo.png +0 -0
  94. package/samples/ColorSpace/pngNoAlphaDemo.png +0 -0
  95. package/samples/DemoHomepage/App.vue +31 -0
  96. package/samples/DemoHomepage/components/BodyFrame.vue +82 -0
  97. package/samples/DemoHomepage/components/Dialog.vue +94 -0
  98. package/samples/DemoHomepage/components/Item.vue +77 -0
  99. package/samples/DemoHomepage/components/TabFrame.vue +86 -0
  100. package/samples/DemoHomepage/router.js +132 -0
  101. package/samples/DemoHomepage/views/Homepage.vue +186 -0
  102. package/samples/FlipCard/App.vue +80 -0
  103. package/samples/FlipCard/FlipCard.vue +124 -0
  104. package/samples/FlipCard/assets/blue_egg.png +0 -0
  105. package/samples/FlipCard/assets/red_egg.png +0 -0
  106. package/samples/FlipCard/data.js +13 -0
  107. package/samples/FlowMultiWidget/App.vue +91 -0
  108. package/samples/FlowMultiWidget/assets/nine_patch_focus.png +0 -0
  109. package/samples/FlowMultiWidget/components/Block.vue +107 -0
  110. package/samples/FlowMultiWidget/components/FlowPage.vue +60 -0
  111. package/samples/FlowMultiWidget/components/Item.vue +103 -0
  112. package/samples/FlowMultiWidget/components/MenuItem.vue +72 -0
  113. package/samples/FlowMultiWidget/components/MyMenu.vue +90 -0
  114. package/samples/FlowMultiWidget/data.js +446 -0
  115. package/samples/HashHistory/App.vue +124 -0
  116. package/samples/HashHistory/components/HorizontalButtonList.vue +114 -0
  117. package/samples/HashHistory/components/Item.vue +74 -0
  118. package/samples/HashHistory/router.js +30 -0
  119. package/samples/HashHistory/views/BasePage.vue +19 -0
  120. package/samples/HashHistory/views/MainPage.vue +68 -0
  121. package/samples/HashHistory/views/SubPage.vue +79 -0
  122. package/samples/HashHistory/views/SubPageFirst.vue +10 -0
  123. package/samples/HashHistory/views/SubPageSecond.vue +10 -0
  124. package/samples/LongImage/App.vue +96 -0
  125. package/samples/LongImage/Button.vue +153 -0
  126. package/samples/LongImage/LongImageScroll.vue +127 -0
  127. package/samples/LongImage/Scroll.vue +16 -0
  128. package/samples/LongImage/assets/1280x7200.jpg +0 -0
  129. package/samples/LongText/App.vue +111 -0
  130. package/samples/LongText/Button.vue +153 -0
  131. package/samples/LongText/LongTextScroll.vue +225 -0
  132. package/samples/LongText/Scroll.vue +16 -0
  133. package/samples/Preload/App.vue +146 -0
  134. package/samples/Preload/data.js +23 -0
  135. package/samples/Preload/images/awesomeface.png +0 -0
  136. package/samples/Preload/images/cat.jpg +0 -0
  137. package/samples/Preload/images/rank.png +0 -0
  138. package/samples/Preload/images/rank_focus.png +0 -0
  139. package/samples/Preload/images/rule.png +0 -0
  140. package/samples/Preload/images/rule_focus.png +0 -0
  141. package/samples/Preload/images/start.png +0 -0
  142. package/samples/Preload/images/start_focus.png +0 -0
  143. package/samples/Preload/preloadItem.vue +22 -0
  144. package/samples/QrcodeDemo/App.vue +73 -0
  145. package/samples/SimpleWidgetDemo/App.vue +204 -0
  146. package/samples/SimpleWidgetDemo/Item.vue +83 -0
  147. package/samples/SimpleWidgetDemo/assets/bg.jpg +0 -0
  148. package/samples/SimpleWidgetDemo/assets/coupon_content.png +0 -0
  149. package/samples/SimpleWidgetDemo/assets/coupon_left.png +0 -0
  150. package/samples/SimpleWidgetDemo/assets/coupon_mid.png +0 -0
  151. package/samples/SimpleWidgetDemo/assets/coupon_right.png +0 -0
  152. package/samples/SimpleWidgetDemo/assets/focus_border.png +0 -0
  153. package/samples/SimpleWidgetDemo/assets/holder_logo.png +0 -0
  154. package/samples/SimpleWidgetDemo/assets/jrbm.png +0 -0
  155. package/samples/SimpleWidgetDemo/assets/line_left.png +0 -0
  156. package/samples/SimpleWidgetDemo/assets/line_mid.png +0 -0
  157. package/samples/SimpleWidgetDemo/assets/line_right.png +0 -0
  158. package/samples/SimpleWidgetDemo/assets/loading.png +0 -0
  159. package/samples/SimpleWidgetDemo/assets/logo.png +0 -0
  160. package/samples/SimpleWidgetDemo/assets/mcjx.png +0 -0
  161. package/samples/SimpleWidgetDemo/assets/tao.png +0 -0
  162. package/samples/SimpleWidgetDemo/assets/tmall.png +0 -0
  163. package/samples/SimpleWidgetDemo/border.png +0 -0
  164. package/samples/SimpleWidgetDemo/components/ContentItem.vue +412 -0
  165. package/samples/SimpleWidgetDemo/components/MyTab.vue +117 -0
  166. package/samples/SimpleWidgetDemo/data.js +110 -0
  167. package/samples/SprayView/App.vue +270 -0
  168. package/samples/SprayView/assets/snow.png +0 -0
  169. package/samples/SpriteImage/App.vue +174 -0
  170. package/samples/SpriteImage/images/cat_run.png +0 -0
  171. package/samples/SpriteImage/images/egg_break.json +116 -0
  172. package/samples/SpriteImage/images/egg_break.png +0 -0
  173. package/samples/SpriteImage/images/sprite.png +0 -0
  174. package/samples/TextBox/App.vue +179 -0
  175. package/samples/TextBox/RenderCenter.vue +109 -0
  176. package/samples/TextBox/RenderLeft.vue +109 -0
  177. package/samples/TextBox/RenderOneLine.vue +120 -0
  178. package/samples/TextBox/RenderRight.vue +107 -0
  179. package/samples/TextShadowDemo/App.vue +98 -0
  180. package/samples/TextureSize/App.vue +142 -0
  181. package/samples/TextureSize/bmpDemo.bmp +0 -0
  182. package/samples/TextureSize/jpegDemo.jpeg +0 -0
  183. package/samples/TextureSize/jpgDemo.jpg +0 -0
  184. package/samples/TextureSize/pngDemo.png +0 -0
  185. package/samples/TextureSize/pngNoAlphaDemo.png +0 -0
  186. package/samples/ThrowMoveDemo/AccelerateDemo.vue +118 -0
  187. package/samples/ThrowMoveDemo/App.vue +114 -0
  188. package/samples/ThrowMoveDemo/LRParabolicDemo.vue +116 -0
  189. package/samples/ThrowMoveDemo/TargetDemo.vue +117 -0
  190. package/samples/ThrowMoveDemo/UDParabolicDemo.vue +122 -0
  191. package/samples/TransitPage/App.vue +41 -0
  192. package/samples/VideoDemo/App.vue +137 -0
  193. package/samples/VideoDemo/components/Button.vue +69 -0
  194. package/samples/VideoDemo/components/Controllor.vue +195 -0
  195. package/samples/VideoDemo/components/VideoFrame.vue +152 -0
  196. package/scripts/git-commit-empty.js +21 -0
  197. package/scripts/install-local-packages.js +121 -0
  198. package/scripts/make-js.sh +181 -0
  199. package/scripts/post-build.js +132 -0
  200. package/scripts/post-install.js +127 -0
  201. package/scripts/pre-pack.js +2 -0
  202. package/scripts/run-android.js +64 -0
  203. package/utils/JsViewEngineWidget/bin/shijiu-jsview-vue-widget-1.0.1.tgz +0 -0
  204. package/utils/JsViewEngineWidget/index.d.ts +32 -0
  205. package/utils/JsViewEngineWidget/index.js +6 -0
  206. package/utils/JsViewVueTools/DebugContentShellJBridge.js +16 -0
  207. package/utils/JsViewVueTools/DebugTool.js +21 -0
  208. package/utils/JsViewVueTools/DefaultKeyMap.js +12 -0
  209. package/utils/JsViewVueTools/JsvDynamicCssStyle.js +73 -0
  210. package/utils/JsViewVueTools/JsvDynamicKeyFrames.js +128 -0
  211. package/utils/JsViewVueTools/JsvHashHistory.js +112 -0
  212. package/utils/JsViewVueTools/JsvRuntimeBridge.js +417 -0
  213. package/utils/JsViewVueTools/JsvStyleClass.js +290 -0
  214. package/utils/JsViewVueWidget/BrowserDebugWidget/BrowserPreload.vue +80 -0
  215. package/utils/JsViewVueWidget/BrowserDebugWidget/BrowserQrcode.vue +148 -0
  216. package/utils/JsViewVueWidget/BrowserDebugWidget/BrowserSpray.vue +55 -0
  217. package/utils/JsViewVueWidget/BrowserDebugWidget/JsvApic/ApicDataBase.js +29 -0
  218. package/utils/JsViewVueWidget/BrowserDebugWidget/JsvApic/BrowserApic.vue +124 -0
  219. package/utils/JsViewVueWidget/BrowserDebugWidget/JsvApic/GifData.js +83 -0
  220. package/utils/JsViewVueWidget/BrowserDebugWidget/JsvApic/LoopToolBase.js +25 -0
  221. package/utils/JsViewVueWidget/BrowserDebugWidget/JsvApic/NormalLoopTool.js +61 -0
  222. package/utils/JsViewVueWidget/BrowserDebugWidget/JsvApic/PartLoopTool.js +119 -0
  223. package/utils/JsViewVueWidget/BrowserDebugWidget/JsvApic/Viewer.js +106 -0
  224. package/utils/JsViewVueWidget/BrowserDebugWidget/JsvApic/WebpData.js +141 -0
  225. package/utils/JsViewVueWidget/BrowserDebugWidget/WidgetLoader.js +20 -0
  226. package/utils/JsViewVueWidget/BrowserDebugWidget/WidgetWrapper.js +11 -0
  227. package/utils/JsViewVueWidget/JsvActorMove/ActorControlBase.js +204 -0
  228. package/utils/JsViewVueWidget/JsvActorMove/JsvActorMove.vue +64 -0
  229. package/utils/JsViewVueWidget/JsvActorMove/JsvActorMoveControl.js +427 -0
  230. package/utils/JsViewVueWidget/JsvActorMove/index.js +12 -0
  231. package/utils/JsViewVueWidget/JsvApic/JsvApic.vue +179 -0
  232. package/utils/JsViewVueWidget/JsvApic/index.js +17 -0
  233. package/utils/JsViewVueWidget/JsvMarquee.vue +197 -0
  234. package/utils/JsViewVueWidget/JsvNativeSharedDiv.vue +92 -0
  235. package/utils/JsViewVueWidget/JsvNinePatch.vue +76 -0
  236. package/utils/JsViewVueWidget/JsvPreload/JsvPreload.vue +351 -0
  237. package/utils/JsViewVueWidget/JsvPreload/index.js +21 -0
  238. package/utils/JsViewVueWidget/JsvQrcode/JsvQrcode.vue +140 -0
  239. package/utils/JsViewVueWidget/JsvQrcode/index.js +18 -0
  240. package/utils/JsViewVueWidget/JsvSpray/JsvSpray.vue +140 -0
  241. package/utils/JsViewVueWidget/JsvSpray/index.js +15 -0
  242. package/utils/JsViewVueWidget/JsvSpriteAnim/JsvSpriteAnim.vue +448 -0
  243. package/utils/JsViewVueWidget/JsvSpriteAnim/SpriteController.js +57 -0
  244. package/utils/JsViewVueWidget/JsvSpriteAnim/index.js +6 -0
  245. package/utils/JsViewVueWidget/JsvSwiper/Indicator.vue +35 -0
  246. package/utils/JsViewVueWidget/JsvSwiper/JsvSwiper.vue +495 -0
  247. package/utils/JsViewVueWidget/JsvSwiper/index.js +10 -0
  248. package/utils/JsViewVueWidget/JsvSwiper3D/Indicator.vue +35 -0
  249. package/utils/JsViewVueWidget/JsvSwiper3D/JsvSwiper.vue +404 -0
  250. package/utils/JsViewVueWidget/JsvSwiper3D/index.js +10 -0
  251. package/utils/JsViewVueWidget/JsvTextBox.vue +111 -0
  252. package/utils/JsViewVueWidget/JsvVideo.vue +36 -0
@@ -0,0 +1,3 @@
1
+ 2021.9.1
2
+ ====================================
3
+ 1. 代码从jsview-export-react-sample分离后出版上传
@@ -0,0 +1,15 @@
1
+ 提交规范:
2
+
3
+ 主模块:子模块:改动点
4
+
5
+ 主模块: react_js 或者 java_app
6
+
7
+ 子模块:
8
+ react_js
9
+ 红包雨
10
+ Video播放
11
+ 简易Simplewidget
12
+ ...
13
+ java_app: DemoApp
14
+
15
+ 例如: react_js:红包雨:提交XXXX修改
@@ -0,0 +1 @@
1
+ +8332
Binary file
@@ -0,0 +1,21 @@
1
+ *{
2
+ margin:0px;
3
+ }
4
+ div{
5
+ position: absolute;
6
+ background-size: 100% 100%;
7
+ white-space: pre-wrap;
8
+ pointer-events: none;
9
+ }
10
+
11
+ video {
12
+ position: absolute;
13
+ background-size: 100% 100%;
14
+ }
15
+
16
+ img{
17
+ position: absolute;
18
+ pointer-events: none;
19
+ }
20
+
21
+
@@ -0,0 +1,8 @@
1
+ import "./browser-root-style.css"
2
+
3
+ // Release entry
4
+ export * from "jsview-dom/jsview-browser-debug-dom.min"
5
+
6
+ // Debug entry
7
+ // TODO: 进行编译(yarn build)时,需要关闭掉此require
8
+ // export * from "./code/src/dom-browser-hook/index"
package/dom/jsv-dom.js ADDED
@@ -0,0 +1,6 @@
1
+ // Release entry
2
+ export * from "jsview-dom/jsview-dom.min"
3
+
4
+ // Debug entry
5
+ // TODO: 进行编译(yarn build)时,需要关闭掉此require
6
+ // export * from "./code/src/dom-wrapper/index"
@@ -0,0 +1,6 @@
1
+ // Release entry
2
+ export * from "jsview-dom/jsview-forge-define.min"
3
+
4
+ // Debug entry
5
+ // TODO: 进行编译(yarn build)时,需要关闭掉此require
6
+ // export * from "./code/src/forge/index"
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Created by ludl on 1/27/21.
3
+ */
4
+
5
+ const TargetRevision = {
6
+ "CoreRevision": 810895,
7
+ "JseRevision": "1.0.772",
8
+ "JseUrl":
9
+ "http://cdn.release.qcast.cn/forge_js/master/JsViewES6_react_r772.jsv.91a55796.js"
10
+ };
11
+
12
+ // 不要用export default,update-env脚本不能解析
13
+ // export default TargetRevision;
14
+ module.exports = TargetRevision;
@@ -0,0 +1,134 @@
1
+ /**
2
+ * Created by ludl on 3/30/20.
3
+ */
4
+
5
+ function alterUrl(origin_url, js_sub_path) {
6
+ console.log(`++++++++ origin_url=${origin_url} js_sub_path = ${js_sub_path}`);
7
+ let schema_idx = origin_url.indexOf("://");
8
+ if (schema_idx < 0 || schema_idx > 10) {
9
+ // 非schema打头方式,认为是相对路径
10
+ if (!origin_url.startsWith('./') && !origin_url.startsWith('/')) {
11
+ origin_url = "./" + origin_url; // 补充相对路径头信息
12
+ }
13
+ }
14
+
15
+ if (origin_url.startsWith('./') || origin_url.startsWith('/')) {
16
+ const main_js_path = window.JsView.getAppUrl();
17
+ let idx = main_js_path.indexOf('?');
18
+ const host_path = (idx > 0 ? main_js_path.substring(0, idx) : main_js_path);
19
+ idx = host_path.lastIndexOf(js_sub_path);
20
+ const path_header = host_path.substring(0, idx);
21
+
22
+ let ret;
23
+ if (origin_url.startsWith('./')) {
24
+ ret = path_header + origin_url.substring(1);
25
+ } else {
26
+ // start with '/'
27
+ // remove protocal
28
+ let host_parser = main_js_path;
29
+ idx = host_parser.indexOf('://');
30
+ const protocol = (idx > 0 ? host_parser.substring(0, idx) : "");
31
+ host_parser = (idx > 1 ? host_parser.substring(idx + 3) : "");
32
+
33
+ // Get host
34
+ idx = host_parser.indexOf('/');
35
+ const host = (idx > 0 ? host_parser.substring(0, idx) : "");
36
+
37
+ ret = `${protocol}://${host}${origin_url}`;
38
+ }
39
+
40
+ return ret;
41
+ }
42
+ return origin_url;
43
+ }
44
+
45
+ class LoadingScriptElement {
46
+ constructor(js_sub_path) {
47
+ console.log(`++++++++ js_sub_path=${js_sub_path}`);
48
+ this.src = null;
49
+ this.onerror = null;
50
+ this.onload = null;
51
+ this.charset = null;
52
+ this.timeout = 120;
53
+ this._JsSubPath = js_sub_path;
54
+ }
55
+
56
+ setAttribute(name, value) {
57
+ console.log(`ScriptElement.setAttribute() name=${name}, value=`, value);
58
+ this[name] = value;
59
+ }
60
+
61
+ jsvActiveScript() {
62
+ if (this.src !== null) {
63
+ const url_href = alterUrl(this.src, this._JsSubPath);
64
+ console.log(`load script with url=${url_href}`);
65
+ const _this = this;
66
+ window.JsView.runJsWithUrl(url_href, false, (is_success, err_code) => {
67
+ _this.onLoadResult(is_success, err_code);
68
+ });
69
+ }
70
+ }
71
+
72
+ onLoadResult(is_success, err_code) {
73
+ console.log(`[Head]onLoadResult ${is_success} ${err_code}`);
74
+ if (is_success) {
75
+ if (this.onload) {
76
+ this.onload();
77
+ }
78
+ } else {
79
+ if (this.onerror) {
80
+ this.onerror({ type: `[Head]jsvErr_${err_code}`, target: this });
81
+ }
82
+ }
83
+ }
84
+ }
85
+
86
+ class LoadingHeader {
87
+ constructor() {
88
+ console.log("Document header construct");
89
+ }
90
+
91
+ appendChild(node) {
92
+ if (node instanceof LoadingScriptElement) {
93
+ console.log("Found append script in head.");
94
+ node.jsvActiveScript();
95
+ }
96
+ }
97
+ }
98
+
99
+ class LoadingDocument {
100
+ constructor(js_sub_path) {
101
+ this.head = new LoadingHeader();
102
+ this._JsSubPath = js_sub_path;
103
+ }
104
+
105
+ createElement(name) {
106
+ console.log(`HeaderDocument.createElement() name=${name}`);
107
+ switch (name) {
108
+ case "script":
109
+ return new LoadingScriptElement(this._JsSubPath);
110
+ default:
111
+ console.warn(`HeaderDocument.createElement() name=${name}`);
112
+ return null;
113
+ }
114
+ }
115
+
116
+ getElementsByTagName(name) {
117
+ if (name.toLowerCase() === "head") {
118
+ return [this.head];
119
+ }
120
+ if (name.toLowerCase() === "link"
121
+ || name.toLowerCase() === "script"
122
+ || name.toLowerCase() === "style") {
123
+ return [];
124
+ }
125
+
126
+ throw Error("LoadingDocument.getElementsByTagName() name=" + name + " is UNIMPLEMENTED.");
127
+ }
128
+ }
129
+
130
+ function initHeaderScriptLoader(js_sub_path) {
131
+ window.document = new LoadingDocument(js_sub_path);
132
+ }
133
+
134
+ export default initHeaderScriptLoader;
@@ -0,0 +1,42 @@
1
+ import JsViewDefConfig from "./jsview.default.config"
2
+ import JsViewVendorConfig from "/src/appConfig/jsview.config"
3
+ import { loadJsViewEnv } from './loader'
4
+
5
+ function deepMerge(target, source) {
6
+ const isObject = (obj) => obj && typeof obj === 'object';
7
+
8
+ if (!isObject(target) || !isObject(source)) {
9
+ return source;
10
+ }
11
+
12
+ Object.keys(source).forEach(key => {
13
+ const targetValue = target[key];
14
+ const sourceValue = source[key];
15
+
16
+ if (Array.isArray(targetValue) && Array.isArray(sourceValue)) {
17
+ target[key] = targetValue.concat(sourceValue);
18
+ } else if (isObject(targetValue) && isObject(sourceValue)) {
19
+ target[key] = deepMerge(Object.assign({}, targetValue), sourceValue);
20
+ } else {
21
+ target[key] = sourceValue;
22
+ }
23
+ });
24
+
25
+ return target;
26
+ }
27
+
28
+ function main() {
29
+ // 使用vendor配置值覆盖默认配置。
30
+ let config = JsViewDefConfig;
31
+ deepMerge(config, JsViewVendorConfig);
32
+ console.log("JsView config: " + JSON.stringify(config));
33
+
34
+ // 加载jsview运行环境。
35
+ loadJsViewEnv(config, () => {
36
+ // JsView环境加载完毕后,加载vue的main.js文件。
37
+ import('/src/main.ts');
38
+ })
39
+ }
40
+
41
+ // webpack运行入口
42
+ main();
@@ -0,0 +1,37 @@
1
+ export default {
2
+ jsviewConfig: {
3
+ // (可选配置)localStorage支持
4
+ // domain可以为任意字符串,各Domain的localStorage互相隔离, 默认值是hostname
5
+ // presetKeys为预置key,可以直接使用localStorage.xxx的形式,避免undefined错误
6
+ localStorage: {
7
+ domain: "default",
8
+ presetKeys: [
9
+ "value1",
10
+ "value2"
11
+ ],
12
+ },
13
+
14
+ // (可选配置)填写main.js或者bundle.js相对于index.html的相对位置,
15
+ // 用于image/import.then的相对寻址, vue3默认值是/js/
16
+ jsSubPath: "/js/",
17
+ },
18
+
19
+ vendorConfig: {
20
+ // (可选配置)设置屏幕坐标映射值,screenWidth为屏幕画布定义的宽度,displayScale为清晰度,
21
+ // 默认值是画布宽度1280px, 清晰度为1.0
22
+ designedMap: {
23
+ screenWidth: 1280,
24
+ displayScale: 1.0
25
+ },
26
+
27
+ // (可选配置)按键接受的扩展,例如将静音按键(JAVA键值为164)映射为JS键值20001,
28
+ // PS:注意"164"的引号
29
+ bindKeys: {
30
+ keys: {
31
+ 164: 20001
32
+ },
33
+ syncKeys: {
34
+ }
35
+ },
36
+ }
37
+ }
@@ -0,0 +1,37 @@
1
+ export default {
2
+ jsviewConfig: {
3
+ // (可选配置)localStorage支持
4
+ // domain可以为任意字符串,各Domain的localStorage互相隔离, 默认值是hostname
5
+ // presetKeys为预置key,可以直接使用localStorage.xxx的形式,避免undefined错误
6
+ localStorage: {
7
+ domain: "default",
8
+ presetKeys: [
9
+ "value1",
10
+ "value2"
11
+ ],
12
+ },
13
+
14
+ // (可选配置)填写main.js或者bundle.js相对于index.html的相对位置,
15
+ // 用于image/import.then的相对寻址, vue3默认值是/js/
16
+ jsSubPath: "/js/",
17
+ },
18
+
19
+ vendorConfig: {
20
+ // (可选配置)设置屏幕坐标映射值,screenWidth为屏幕画布定义的宽度,displayScale为清晰度,
21
+ // 默认值是画布宽度1280px, 清晰度为1.0
22
+ designedMap: {
23
+ screenWidth: 1280,
24
+ displayScale: 1.0
25
+ },
26
+
27
+ // (可选配置)按键接受的扩展,例如将静音按键(JAVA键值为164)映射为JS键值20001,
28
+ // PS:注意"164"的引号
29
+ bindKeys: {
30
+ keys: {
31
+ 164: 20001
32
+ },
33
+ syncKeys: {
34
+ }
35
+ },
36
+ }
37
+ }
package/load/loader.js ADDED
@@ -0,0 +1,172 @@
1
+ import initHeaderScriptLoader from "./header_script_loader";
2
+ import TargetRevision from "../dom/target_core_revision"
3
+ import AppData from '/src/appConfig/app_config.json'
4
+
5
+ // Forge define
6
+ if (typeof window.Forge === 'undefined') { window.Forge = {}; }
7
+ const Forge = window.Forge;
8
+
9
+ function initDesignedMap(input_designed_map) {
10
+ window.Forge.DesignMap = function () {
11
+ let designMap = { width: 1280, displayScale: 1.0 };
12
+ try {
13
+ if (input_designed_map) {
14
+ const new_designed_map = {
15
+ width: input_designed_map.screenWidth,
16
+ displayScale: input_designed_map.displayScale
17
+ };
18
+ designMap = new_designed_map;
19
+ }
20
+ } catch (e) {
21
+ console.error("load designed map failed");
22
+ }
23
+
24
+ // 设置播放器的屏幕坐标尺寸
25
+ if (window.JsView && window.JsView.setVideoDesignMapWidth) {
26
+ window.JsView.setVideoDesignMapWidth(designMap.width);
27
+ } else {
28
+ // 借助Audio标签设置基类BaseMedia的屏幕尺寸配置,绕开react的unref语法检测
29
+ if (Audio.setDesignMapWidth) {
30
+ Audio.setDesignMapWidth(designMap.width);
31
+ }
32
+ }
33
+
34
+ return designMap;
35
+ };
36
+ }
37
+
38
+ // eslint-disable-next-line no-unused-vars
39
+ let sJsViewForgeAppDefine = null;
40
+ async function selectJsViewRuntime(js_sub_path, input_designed_map, app_name) {
41
+ // 初始Forge的启动入口
42
+ initEntry();
43
+
44
+ initDesignedMap(input_designed_map);
45
+ if (window.JsView) {
46
+ if (app_name && window.JsView.notifyAppName) {
47
+ window.JsView.notifyAppName(app_name);
48
+ }
49
+ initHeaderScriptLoader(js_sub_path);
50
+ const app_define = await import("../dom/jsv-dom.js");
51
+ sJsViewForgeAppDefine = app_define.JsViewForgeApp;
52
+ window.JsView.ForgeExt = app_define.ForgeExtension;
53
+ window.JsView.Dom.JsSubPath = js_sub_path;
54
+ } else {
55
+ await import("../dom/jsv-browser-debug-dom.js");
56
+ }
57
+ }
58
+
59
+ // 当confirmEntry和Forge.RunApp都被调用完成后,才会进行JsViewForgeApp运行
60
+ // eslint-disable-next-line no-var
61
+ let sActivityManager = null;
62
+ // eslint-disable-next-line no-var
63
+ let sEntryConfirmed = false;
64
+ let sJsViewApp = null;
65
+
66
+ function startForgeApp() {
67
+ if (sActivityManager !== null && sEntryConfirmed) {
68
+ console.log("Forge.RunApp().");
69
+ // eslint-disable-next-line new-cap
70
+ sJsViewApp = new sJsViewForgeAppDefine(sActivityManager);
71
+ console.log(sJsViewApp);
72
+ }
73
+ }
74
+
75
+ function confirmEntry() {
76
+ sEntryConfirmed = true;
77
+ if (window.JsView) {
78
+ checkEngineVersion();
79
+ }
80
+ startForgeApp();
81
+ }
82
+
83
+ function initEntry() {
84
+ Forge.RunApp = function (activity_manager) {
85
+ console.log("Call from Forge.Run");
86
+ sActivityManager = activity_manager;
87
+ startForgeApp();
88
+ };
89
+ }
90
+
91
+ async function runMain() {
92
+ console.log("main.js loaded...");
93
+
94
+ // 确定并进行Forge模块的启动
95
+ confirmEntry();
96
+
97
+ console.log("main.js done...");
98
+ }
99
+
100
+ function checkEngineVersion() {
101
+ // 检查配套引擎的版本
102
+ if (
103
+ window.JsView.CodeRevision !== TargetRevision.CoreRevision /* Native引擎版本(由APK启动参数 CORE 决定) */ ||
104
+ window.Forge.Version !== TargetRevision.JseRevision /* JS引擎版本(由APK启动参数 ENGINEJS 决定) */
105
+ ) {
106
+ console.warn(
107
+ `Warning: JsView Engine version miss matched, some effect will be lost. url should be ${TargetRevision.JseUrl}`
108
+ );
109
+ }
110
+ }
111
+
112
+ function getHostName() {
113
+ const full_url = window.location.href;
114
+ let idx = full_url.indexOf("://");
115
+ // const protocol = (idx > 0 ? full_url.substring(0, idx + 1) : "");
116
+ const host_path = idx > 1 ? full_url.substring(idx + 3) : "";
117
+
118
+ idx = host_path.indexOf("/");
119
+ const host = idx > 0 ? host_path.substring(0, idx) : "";
120
+
121
+ return host;
122
+ }
123
+
124
+ async function startApp(config, onLoaded) {
125
+ console.log("StartApp...");
126
+ if (window.JsView) {
127
+ // 运行在JsView引擎中
128
+
129
+ // (可选配置)按键接受的扩展,例如将静音按键(JAVA键值为164)映射为JS键值20001,PS:注意"164"的引号
130
+ window.JsView.addKeysMap(config.vendorConfig.bindKeys);
131
+
132
+ // (可选配置)localStorage支持
133
+ let storageDomain = config.jsviewConfig.localStorage.domain;
134
+ if(storageDomain == "default") {
135
+ storageDomain = getHostName();
136
+ }
137
+ window.JsView.setStorageDomain(storageDomain); // Domain可以为任意字符串,各Domain的localStorage互相隔离
138
+ window.JsView.enableStorageNames(...config.jsviewConfig.localStorage.presetKeys);
139
+
140
+ // JsView Dom相关配置
141
+ window.JsView.Dom.Render = function () {
142
+ onLoaded()
143
+ };
144
+ } else {
145
+ await onLoaded()
146
+ }
147
+ }
148
+
149
+ async function loadJsViewEnv(config, onLoaded) {
150
+ // 参数说明:
151
+ // /static/js/: (可选配置)填写main.js或者bundle.js相对于index.html的相对位置,用于image/import.then的相对寻址
152
+ // {screenWidth:1280, displayScale:1.0}: (可选配置)设置屏幕坐标映射值,前者为屏幕画布定义的宽度,后者为清晰度,
153
+ // 默认值是画布宽度1280px, 清晰度为1.0
154
+ await selectJsViewRuntime(config.jsviewConfig.jsSubPath,
155
+ config.vendorConfig.designedMap,
156
+ AppData.AppName);
157
+
158
+ if (!window.JsView) {
159
+ await import("../utils/JsViewVueWidget/BrowserDebugWidget/WidgetLoader");
160
+ }
161
+
162
+ await startApp(config, onLoaded);
163
+
164
+ // 环境启动后,动态加载React框架和main
165
+ runMain();
166
+
167
+ console.log("index.js loaded AppName=" + AppData.AppName);
168
+ }
169
+
170
+ export {
171
+ loadJsViewEnv,
172
+ };
@@ -0,0 +1,40 @@
1
+ window.JsvDisableReactWrapper = true; // 设置标识位,有部分高阶组件根据此标识位决定元素的搭建方式
2
+
3
+ // Forge define
4
+ if (typeof window.Forge === 'undefined') { window.Forge = {}; }
5
+ const Forge = window.Forge;
6
+
7
+ // const sForgeReactAppDefine = null;
8
+ function loadJsViewProxy(callback, js_sub_path) {
9
+ callback();
10
+ }
11
+
12
+ // 当confirmEntry和Forge.RunApp都被调用完成后,才会进行ForgeReactApp运行
13
+ let sActivityManager = null;
14
+ let sEntryConfirmed = false;
15
+ // let sReactApp = null;
16
+
17
+ function startForgeApp() {
18
+ if (sActivityManager !== null && sEntryConfirmed) {
19
+ console.log("Forge.RunApp().");
20
+ // sReactApp = new sForgeReactAppDefine(sActivityManager);
21
+ }
22
+ }
23
+
24
+ function confirmEntry() {
25
+ sEntryConfirmed = true;
26
+ startForgeApp();
27
+ }
28
+
29
+ function initEntry() {
30
+ Forge.RunApp = function (activity_manager) {
31
+ sActivityManager = activity_manager;
32
+ startForgeApp();
33
+ };
34
+ }
35
+
36
+ export {
37
+ loadJsViewProxy,
38
+ initEntry,
39
+ confirmEntry
40
+ };
package/package.json ADDED
@@ -0,0 +1,27 @@
1
+ {
2
+ "name": "@shijiu/jsview-vue",
3
+ "version": "0.0.1-beta.0",
4
+ "bin": {
5
+ "jsview-post-build": "./scripts/post-build.js",
6
+ "jsview-post-install": "./scripts/post-install.js",
7
+ "jsview-install-local-packages": "./scripts/install-local-packages.js"
8
+ },
9
+ "scripts": {
10
+ },
11
+ "repository": "system/jsview-vue",
12
+ "bugs": "http://gitlab.qcast.cn/system/jsview-vue/issues",
13
+ "keywords": [
14
+ "jsview",
15
+ "vue",
16
+ "jsview-vue",
17
+ "jsview-dom",
18
+ "jsview-utils",
19
+ "jsview-docs"
20
+ ],
21
+ "author": "mengxk",
22
+ "homepage": "http://gitlab.qcast.cn/system/jsview-vue",
23
+ "license": "MIT",
24
+ "engines": {
25
+ "node": ">=14.0.0"
26
+ }
27
+ }