@shijiu/jsview-vue-samples 2.3.0 → 3.0.0-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.
Files changed (320) hide show
  1. package/ABImageAlt/App.vue +114 -0
  2. package/ABImageAlt/Item.vue +133 -0
  3. package/{MetroWidgetDemos/SkeletonDiagram/assets/imageList.json → ABImageAlt/assets/imageList.js} +9 -1
  4. package/ABImageAlt/data.js +17 -0
  5. package/AI_Check_Rules.txt +5 -0
  6. package/AnimPicture/App.vue +20 -10
  7. package/ApicSwitch/App.vue +90 -0
  8. package/ApicSwitch/TabItem.vue +65 -0
  9. package/ApicSwitch/WebpShow.vue +24 -0
  10. package/ApicSwitch/data.js +50 -0
  11. package/Basic/AI_skills_update.md +1 -0
  12. package/Basic/components/div/ColorFormatTest.vue +93 -0
  13. package/Basic/components/div/DivRadius.vue +97 -15
  14. package/Basic/components/div/DivTag3Group.vue +30 -0
  15. package/Basic/components/img/ImageType.vue +65 -0
  16. package/Basic/components/panel/Panel2.vue +13 -1
  17. package/Basic/components/text/TextAlign.vue +7 -1
  18. package/BlobLoadTest/App.vue +201 -0
  19. package/BreakLinesApi/App.vue +82 -0
  20. package/CanvasDrawChart/App.vue +11 -0
  21. package/CanvasDrawChart/Graph1.vue +104 -0
  22. package/CanvasDrawChart/Graph2.vue +115 -0
  23. package/CssPreprocessor/Scss/PanelData.js +1 -1
  24. package/CssPreprocessor/Scss/components/scss-group4/ScssMaps.vue +4 -3
  25. package/CssPreprocessor/Scss/components/scss-group5/ScssImporting.vue +2 -2
  26. package/DashPath/App.vue +17 -16
  27. package/DashPath/AppForOperator.vue +2 -4
  28. package/DemoForOperator/AnimPic/AnimPic.vue +24 -2
  29. package/DemoForOperator/Banger/Banger/Banger.vue +73 -9
  30. package/DemoForOperator/Blur/Blur.vue +146 -0
  31. package/DemoForOperator/Blur/BlurInOut/BlurInOut.vue +158 -0
  32. package/DemoForOperator/Blur/BlurInOut/StaticBgSlide.vue +162 -0
  33. package/DemoForOperator/Blur/BlurPopup/BlurPopup.vue +113 -0
  34. package/DemoForOperator/BookFlip/App.vue +115 -0
  35. package/DemoForOperator/BookFlip/BookFlip/FlipPage.vue +179 -0
  36. package/DemoForOperator/BookFlip/BookFlip/FlippingBook.vue +310 -0
  37. package/DemoForOperator/BookFlip/BookFlip/flip.glsl +135 -0
  38. package/DemoForOperator/BookFlip/BookPage.vue +82 -0
  39. package/DemoForOperator/Bounce/Bounce.vue +33 -1
  40. package/DemoForOperator/Bounce/FreeMoveBuilder.js +1 -1
  41. package/DemoForOperator/ChunLian/Couplets.vue +44 -1
  42. package/DemoForOperator/ClickSpriteAnim/App.vue +130 -0
  43. package/DemoForOperator/ClickSpriteAnim/Item.vue +74 -0
  44. package/DemoForOperator/DominantColor/App.vue +187 -0
  45. package/DemoForOperator/EpisodeList/EpisodeList/Controller.vue +0 -3
  46. package/DemoForOperator/EpisodeList/EpisodeList/EpisodeList.vue +76 -2
  47. package/DemoForOperator/Firework1/App.vue +13 -2
  48. package/DemoForOperator/Firework1/Fireworks.vue +68 -11
  49. package/DemoForOperator/FlipPage/FlipPage/FlipPage.vue +30 -1
  50. package/DemoForOperator/Focus/Alpha/AlphaFocusBox.vue +27 -2
  51. package/DemoForOperator/Focus/Alpha/Item.vue +1 -0
  52. package/DemoForOperator/Focus/Light/Item.vue +1 -0
  53. package/DemoForOperator/Focus/Light/LightFocusBox.vue +42 -1
  54. package/DemoForOperator/Focus/Normal/Item.vue +1 -0
  55. package/DemoForOperator/Focus/Normal/NormalFocusBox.vue +12 -0
  56. package/DemoForOperator/FrameShadow/App.vue +193 -0
  57. package/DemoForOperator/FrameShadow/FrameShadow.vue +61 -0
  58. package/DemoForOperator/FullscreenIn/App.vue +1 -1
  59. package/DemoForOperator/FullscreenIn/FullscreenPoster.vue +18 -3
  60. package/DemoForOperator/Genie/App.vue +20 -6
  61. package/DemoForOperator/Genie/App2.vue +61 -0
  62. package/DemoForOperator/Genie/geniePakcer/GenieImage.vue +298 -0
  63. package/DemoForOperator/Genie/geniePakcer/GenieSlot.vue +292 -0
  64. package/DemoForOperator/Genie/geniePakcer/GenieTools.ts +463 -0
  65. package/DemoForOperator/GrayFilter/GrayFilter.vue +21 -0
  66. package/DemoForOperator/Jigsaw/JigsawFull.vue +58 -11
  67. package/DemoForOperator/Jigsaw/JigsawSingle.vue +47 -9
  68. package/DemoForOperator/LongChatBox/App.vue +36 -0
  69. package/DemoForOperator/LongChatBox/Bubble.vue +116 -0
  70. package/DemoForOperator/LongChatBox/LongChat.vue +205 -0
  71. package/DemoForOperator/LongChatBox/testData.js +14 -0
  72. package/DemoForOperator/Particle/Drop/DropParticle.vue +33 -1
  73. package/DemoForOperator/Particle/Explode/ExplodeParticle.vue +23 -2
  74. package/DemoForOperator/PosterAnim/PosterAnim.js +21 -0
  75. package/DemoForOperator/PosterOverflow/PosterOverflow.vue +16 -0
  76. package/DemoForOperator/Resize/App.vue +157 -0
  77. package/DemoForOperator/Resize/Resize/Item.vue +234 -0
  78. package/DemoForOperator/Resize/Resize/Resize.vue +96 -0
  79. package/DemoForOperator/Ripple/Ripple.vue +16 -1
  80. package/DemoForOperator/ScreenShootScale/App.vue +96 -0
  81. package/DemoForOperator/ScreenShootScale/Back.vue +86 -0
  82. package/DemoForOperator/ScreenShootScale/Front.vue +133 -0
  83. package/DemoForOperator/ScreenShootScale/Item.vue +62 -0
  84. package/DemoForOperator/ScreenShootScale/ScreenShootScale.vue +109 -0
  85. package/DemoForOperator/SmoothSwiper/App.vue +50 -0
  86. package/DemoForOperator/Sound/Bounce/App.vue +56 -0
  87. package/DemoForOperator/Sound/Bounce/Bounce.vue +87 -0
  88. package/DemoForOperator/Sound/Bounce/FreeMoveBuilder.js +146 -0
  89. package/DemoForOperator/Sound/Bounce/bgmusic.mp3 +0 -0
  90. package/DemoForOperator/Sound/Bounce/coin.mp3 +0 -0
  91. package/DemoForOperator/Sound/FocusMove/App.vue +134 -0
  92. package/DemoForOperator/Sound/FocusMove/Item.vue +43 -0
  93. package/DemoForOperator/Sound/FocusMove/move.mp3 +0 -0
  94. package/DemoForOperator/Sound/Rain/App.vue +11 -0
  95. package/DemoForOperator/Sound/Rain/Raining/Rain.vue +69 -0
  96. package/DemoForOperator/Sound/Rain/Raining/RainScene.vue +118 -0
  97. package/DemoForOperator/Sound/Sound/Sound.vue +24 -0
  98. package/DemoForOperator/Sound/Sound/index.js +4 -0
  99. package/DemoForOperator/Sound/Sound/useSound.js +112 -0
  100. package/DemoForOperator/Sprite/Sprite.vue +62 -5
  101. package/DemoForOperator/Stretch/Stretch/Stretch.vue +52 -2
  102. package/DemoForOperator/Swiper/App.vue +101 -0
  103. package/DemoForOperator/Swiper/Item.vue +56 -0
  104. package/DemoForOperator/Swiper/ParallaxSlide.vue +164 -0
  105. package/DemoForOperator/TabContent/TabContent/TabContent.vue +39 -1
  106. package/DemoForOperator/TabContentVertical/App.vue +104 -0
  107. package/DemoForOperator/TabContentVertical/ContentPage.vue +67 -0
  108. package/DemoForOperator/TabContentVertical/Item.vue +94 -0
  109. package/DemoForOperator/TabContentVertical/PageItem.vue +40 -0
  110. package/DemoForOperator/TabContentVertical/TabContent/CreepFocus.vue +160 -0
  111. package/DemoForOperator/TabContentVertical/TabContent/Item.vue +63 -0
  112. package/DemoForOperator/TabContentVertical/TabContent/TabContent.vue +184 -0
  113. package/DemoForOperator/TabContentVertical/TabContent/TabItem.vue +368 -0
  114. package/DemoForOperator/TabContentVertical/TabContent/TabWidget.vue +259 -0
  115. package/DemoForOperator/TabContentVertical/TabContent/Util.js +3 -0
  116. package/DemoForOperator/TabContentVertical/TabContent/ViewSwiper.vue +110 -0
  117. package/DemoForOperator/TabContentVertical/assets/children_science.png +0 -0
  118. package/DemoForOperator/TabContentVertical/assets/documentary.png +0 -0
  119. package/DemoForOperator/TabContentVertical/assets/free.png +0 -0
  120. package/DemoForOperator/TabContentVertical/assets/game.png +0 -0
  121. package/DemoForOperator/TabContentVertical/assets/home_selected.png +0 -0
  122. package/DemoForOperator/TabContentVertical/assets/movie_ticket.png +0 -0
  123. package/DemoForOperator/TabContentVertical/assets/my_account.png +0 -0
  124. package/DemoForOperator/TabContentVertical/assets/opera.png +0 -0
  125. package/DemoForOperator/TabContentVertical/assets/sports.png +0 -0
  126. package/DemoForOperator/TabContentVertical/assets/tv_drama.png +0 -0
  127. package/DemoForOperator/TabContentVertical/assets/variety_show.png +0 -0
  128. package/DemoForOperator/TabContentVertical/assets/vip.png +0 -0
  129. package/DemoForOperator/TabContentVertical/testData.js +76 -0
  130. package/DemoForOperator/Vortex/Vortex/Vortex.vue +26 -0
  131. package/DemoForOperator/routeList.js +125 -2
  132. package/DemoHomepage/App.vue +74 -1
  133. package/DemoHomepage/components/BodyFrame.vue +1 -0
  134. package/DemoHomepage/components/Item.vue +11 -0
  135. package/DemoHomepage/components/TabFrame.vue +1 -1
  136. package/DemoHomepage/router.js +772 -135
  137. package/DemoHomepage/views/Homepage.vue +60 -2
  138. package/DemoHomepage/watchTest.vue +50 -0
  139. package/FilterDemo/AnimatePic.vue +63 -17
  140. package/FilterDemo/App.vue +3 -3
  141. package/FlexCellDemo/AI_skills_update.md +4 -0
  142. package/FlexCellDemo/TestFrame1.vue +12 -2
  143. package/FlexCellDemo/TestFrame2.vue +10 -1
  144. package/FlexCellDemo/TestFrame3.vue +114 -59
  145. package/FpsLimit/App.vue +102 -0
  146. package/FreeMoveChildAttract/App.vue +18 -8
  147. package/FreeMoveLink/App.vue +49 -20
  148. package/GiftRain/components/SpriteTranslate.vue +68 -48
  149. package/HashHistory/App.vue +2 -2
  150. package/HashHistory/router.js +1 -1
  151. package/Hover/App.vue +144 -0
  152. package/HttpRequestSSE/SSEReader.js +200 -0
  153. package/ImpactStop/App.vue +2 -2
  154. package/Input/FullKeyboard.vue +3 -3
  155. package/Input/InputPanel.vue +63 -3
  156. package/JsvLine/App.vue +53 -38
  157. package/LatexDemo/App.vue +3 -1
  158. package/LatexFormula/App.vue +196 -0
  159. package/LongImage/App.vue +1 -1
  160. package/LongImage/LongImageScroll.vue +100 -47
  161. package/LongImage/Scroll.vue +28 -9
  162. package/LongText/LongTextScroll.vue +1 -0
  163. package/Markdown/App.vue +36 -0
  164. package/Markdown/Bubble.vue +109 -0
  165. package/Markdown/LongChat.vue +206 -0
  166. package/Markdown/Markdown/Markdown.vue +156 -0
  167. package/Markdown/Markdown/index.ts +1 -0
  168. package/Markdown/Markdown/marked/LICENSE.md +45 -0
  169. package/Markdown/Markdown/marked/index.ts +2 -0
  170. package/Markdown/Markdown/marked/marked.d.ts +756 -0
  171. package/Markdown/Markdown/marked/marked.js +71 -0
  172. package/Markdown/Markdown/parser.ts +1365 -0
  173. package/Markdown/data.js +581 -0
  174. package/MetroWidgetDemos/AI_skills_update.md +2 -0
  175. package/MetroWidgetDemos/ListExpand/ChildItem.vue +130 -0
  176. package/MetroWidgetDemos/ListExpand/ExpandItem.vue +375 -0
  177. package/MetroWidgetDemos/ListExpand/ExpandItem1.vue +403 -0
  178. package/MetroWidgetDemos/ListExpand/assets/arrow-down.png +0 -0
  179. package/MetroWidgetDemos/ListExpand/assets/up-arrow.png +0 -0
  180. package/MetroWidgetDemos/ListExpand/components/WidgetListHandler.vue +150 -0
  181. package/MetroWidgetDemos/ListExpand/index.vue +88 -0
  182. package/MetroWidgetDemos/ListExpand/list.js +2421 -0
  183. package/MetroWidgetDemos/RefreshDemo/App.vue +14 -1
  184. package/MetroWidgetDemos/RenderAccelerate/App.vue +142 -0
  185. package/MetroWidgetDemos/RenderAccelerate/AppPage.vue +78 -0
  186. package/MetroWidgetDemos/RenderAccelerate/AppTab.vue +62 -0
  187. package/MetroWidgetDemos/RenderAccelerate/ContentItem.vue +409 -0
  188. package/MetroWidgetDemos/{TripleWidget → RenderAccelerate}/Item.vue +6 -3
  189. package/MetroWidgetDemos/RenderAccelerate/TabItem.vue +100 -0
  190. package/MetroWidgetDemos/RenderAccelerate/ViewSwiper.vue +215 -0
  191. package/MetroWidgetDemos/RenderAccelerate/WidgetItem.vue +107 -0
  192. package/MetroWidgetDemos/SkeletonDiagram/App.vue +35 -8
  193. package/MetroWidgetDemos/SkeletonDiagram/Item.vue +11 -2
  194. package/MetroWidgetDemos/SkeletonDiagram/assets/imageList.js +245 -0
  195. package/MetroWidgetDemos/SkeletonDiagram/data.js +3 -3
  196. package/MetroWidgetDemos/SpatialNav/App.vue +177 -0
  197. package/MetroWidgetDemos/SpatialNav/Buttons.vue +83 -0
  198. package/MetroWidgetDemos/SpatialNav/CustomFocus.vue +57 -0
  199. package/MetroWidgetDemos/SpatialNav/Item.vue +71 -0
  200. package/MetroWidgetDemos/SpatialNav/SimpleFloor.vue +86 -0
  201. package/MetroWidgetDemos/SpatialNav/StepMw.vue +113 -0
  202. package/MetroWidgetDemos/SpatialNav/TabContent/TabContent.vue +185 -0
  203. package/MetroWidgetDemos/SpatialNav/TripleSection/TripleSection.vue +69 -0
  204. package/MetroWidgetDemos/SpatialNav/TripleSection/WidgetItem.vue +100 -0
  205. package/MetroWidgetDemos/SpatialNav/TvSection/List.vue +75 -0
  206. package/MetroWidgetDemos/SpatialNav/TvSection/TvSection.vue +91 -0
  207. package/MetroWidgetDemos/basic2/App.vue +407 -0
  208. package/MetroWidgetDemos/basic2/Item.vue +68 -0
  209. package/MetroWidgetDemos/direction/App.vue +22 -0
  210. package/MetroWidgetDemos/gazeFocusDiff/App.vue +126 -0
  211. package/MetroWidgetDemos/gazeFocusDiff/Item.vue +87 -0
  212. package/MetroWidgetDemos/minimalUsage/App.vue +66 -0
  213. package/MetroWidgetDemos/minimalUsage/Item.vue +54 -0
  214. package/MetroWidgetDemos/ninePatchFocusPage/App.vue +22 -7
  215. package/MetroWidgetDemos/ninePatchFocusPage/Item.vue +7 -5
  216. package/MetroWidgetDemos/ninePatchFocusPage/focusConstants.js +2 -0
  217. package/MetroWidgetDemos/routeList.js +216 -8
  218. package/MetroWidgetDemos/slideSetting/App.vue +288 -99
  219. package/MetroWidgetDemos/zIndex/App.vue +117 -0
  220. package/MetroWidgetDemos/zIndex/Item.vue +61 -0
  221. package/NinePatchTester/App.vue +24 -31
  222. package/PosterPacker/App.vue +2 -2
  223. package/PreDecode/App.vue +140 -0
  224. package/ReactiveTest/App.vue +115 -0
  225. package/ReactiveTest/Item.vue +92 -0
  226. package/ReactiveTest/assets/imageList.js +245 -0
  227. package/ReactiveTest/component/TestSmartDiv.vue +50 -0
  228. package/ReactiveTest/component/TestSmartDivSrcList.vue +74 -0
  229. package/ReactiveTest/component/TestSmartImage.vue +46 -0
  230. package/ReactiveTest/component/TestSmartImageSrcList.vue +90 -0
  231. package/ReactiveTest/component/TestSmartImageStyle.vue +41 -0
  232. package/ReactiveTest/data.js +49 -0
  233. package/ScreenToBlob/App.vue +250 -0
  234. package/SecTorTest/App.vue +9 -3
  235. package/SpringFestival/SpringFestivalScene/FreeMoveBuilder.js +3 -3
  236. package/SyncDecode/App.vue +137 -0
  237. package/TextSizeLimit/App.vue +211 -0
  238. package/TransitPage/App.vue +2 -0
  239. package/ViewOpacity/App.vue +19 -0
  240. package/assets/logo.png +0 -0
  241. package/package.json +5 -5
  242. package/DashPath/DashPath.vue +0 -118
  243. package/DemoForOperator/Genie/geniePakcer/Genie.vue +0 -699
  244. package/DemoForOperator/ScalePoster/App.vue +0 -4
  245. package/DemoForOperator/ScalePoster/ScalePoster.vue +0 -0
  246. package/DivMetroPerformance/App.vue +0 -157
  247. package/DivMetroPerformance/Item.vue +0 -58
  248. package/DivMetroPerformance/assets/bg.jpg +0 -0
  249. package/DivMetroPerformance/assets/coupon_content.png +0 -0
  250. package/DivMetroPerformance/assets/coupon_left.png +0 -0
  251. package/DivMetroPerformance/assets/coupon_mid.png +0 -0
  252. package/DivMetroPerformance/assets/coupon_right.png +0 -0
  253. package/DivMetroPerformance/assets/focus_border.png +0 -0
  254. package/DivMetroPerformance/assets/holder_logo.png +0 -0
  255. package/DivMetroPerformance/assets/jrbm.png +0 -0
  256. package/DivMetroPerformance/assets/line_left.png +0 -0
  257. package/DivMetroPerformance/assets/line_mid.png +0 -0
  258. package/DivMetroPerformance/assets/line_right.png +0 -0
  259. package/DivMetroPerformance/assets/loading.png +0 -0
  260. package/DivMetroPerformance/assets/logo.png +0 -0
  261. package/DivMetroPerformance/assets/mcjx.png +0 -0
  262. package/DivMetroPerformance/assets/tao.png +0 -0
  263. package/DivMetroPerformance/assets/tmall.png +0 -0
  264. package/DivMetroPerformance/border.png +0 -0
  265. package/DivMetroPerformance/components/ContentItem.vue +0 -384
  266. package/DivMetroPerformance/components/MyTab.vue +0 -129
  267. package/DivMetroPerformance/data.js +0 -124
  268. package/DivMetroPerformance/utils/GridItem.vue +0 -28
  269. package/DivMetroPerformance/utils/GridPlate.vue +0 -85
  270. package/MediaDemo/App.vue +0 -127
  271. package/MediaDemo/assets/audio-poster.png +0 -0
  272. package/MediaDemo/components/Button.vue +0 -69
  273. package/MediaDemo/components/Controllor.vue +0 -286
  274. package/MediaDemo/components/StatusBar.vue +0 -100
  275. package/MediaDemo/components/frames/AudioFrame.vue +0 -39
  276. package/MediaDemo/components/frames/AudioPoster.vue +0 -48
  277. package/MediaDemo/components/frames/MediaFrame.vue +0 -153
  278. package/MediaDemo/components/frames/VideoFrame.vue +0 -39
  279. package/MetroWidgetDemos/TripleWidget/App.vue +0 -81
  280. package/MetroWidgetDemos/TripleWidget/SWidgetItem.vue +0 -93
  281. package/MetroWidgetDemos/TripleWidget/WidgetItem.vue +0 -111
  282. package/Parkour/App.vue +0 -13
  283. package/Parkour/Common/Context.js +0 -21
  284. package/Parkour/Common/MatchmanInfo.js +0 -62
  285. package/Parkour/Common/Random.js +0 -61
  286. package/Parkour/Common/Sound.js +0 -50
  287. package/Parkour/appConfig/HOW_TO_CONFIG.md +0 -20
  288. package/Parkour/appConfig/app.config.mjs +0 -5
  289. package/Parkour/appConfig/app_sign_private_key_sample.crt +0 -28
  290. package/Parkour/appConfig/app_sign_public_key_sample.pem +0 -9
  291. package/Parkour/appConfig/jsview.config.mjs +0 -39
  292. package/Parkour/assets/Bgimages/bg1.png +0 -0
  293. package/Parkour/assets/Bgimages/bg2.png +0 -0
  294. package/Parkour/assets/Bgimages/bg3.png +0 -0
  295. package/Parkour/assets/Bgimages/bg4.png +0 -0
  296. package/Parkour/assets/Bgimages/bg5.png +0 -0
  297. package/Parkour/assets/audio/jump.mp3 +0 -0
  298. package/Parkour/assets/audio/lose.mp3 +0 -0
  299. package/Parkour/assets/role_skin1/fail.json +0 -44
  300. package/Parkour/assets/role_skin1/fail.png +0 -0
  301. package/Parkour/assets/role_skin1/jump_down.json +0 -20
  302. package/Parkour/assets/role_skin1/jump_down.png +0 -0
  303. package/Parkour/assets/role_skin1/jump_up.json +0 -44
  304. package/Parkour/assets/role_skin1/jump_up.png +0 -0
  305. package/Parkour/assets/role_skin1/roll.json +0 -44
  306. package/Parkour/assets/role_skin1/roll.png +0 -0
  307. package/Parkour/assets/role_skin1/run.json +0 -52
  308. package/Parkour/assets/role_skin1/run.png +0 -0
  309. package/Parkour/components/Backdrop.vue +0 -61
  310. package/Parkour/components/GameSence.vue +0 -602
  311. package/Parkour/components/Matchman.vue +0 -85
  312. package/ThrowMoveDemo/AccelerateDemo.vue +0 -85
  313. package/ThrowMoveDemo/App.vue +0 -104
  314. package/ThrowMoveDemo/LRParabolicDemo.vue +0 -101
  315. package/ThrowMoveDemo/TargetDemo.vue +0 -87
  316. package/ThrowMoveDemo/UDParabolicDemo.vue +0 -92
  317. /package/{AnimPicture/assets → assets}/animated_webp.webp +0 -0
  318. /package/{AnimPicture/assets → assets}/ball_3.webp +0 -0
  319. /package/{AnimPicture/assets → assets}/girl_run.gif +0 -0
  320. /package/{AnimPicture/assets → assets}/quan.webp +0 -0
@@ -0,0 +1,200 @@
1
+ class SSEReader {
2
+ constructor() {
3
+ this.url = null;
4
+ this.headers = null;
5
+ this.onNewData = null;
6
+ this.onError = null;
7
+ this.onDone = null;
8
+ this._proccessedLength = 0;
9
+ this._xhr = null; // 保存 XMLHttpRequest 实例,用于取消请求
10
+ this._isAborted = false; // 标记请求是否被主动取消
11
+ /** onprogress 可能收到截断的 SSE 行,与下一段拼接后再解析 */
12
+ this._sseLineCarry = '';
13
+ }
14
+
15
+ send(post_or_get, body_json_object) {
16
+ // 如果已有正在进行的请求,先取消它
17
+ if (this._xhr) {
18
+ this.abort();
19
+ }
20
+
21
+ this._proccessedLength = 0;
22
+ this._sseLineCarry = '';
23
+ this._isAborted = false; // 重置取消标记
24
+ this._startTime = Date.now();
25
+ let open_url = this.url;
26
+ let xhr = new XMLHttpRequest();
27
+ this._xhr = xhr; // 保存 xhr 实例
28
+ let _this = this;
29
+ xhr.open(post_or_get, open_url);
30
+ xhr.setRequestHeader('Content-Type', 'application/json;charset=utf-8');
31
+ xhr.setRequestHeader('Accept', 'text/event-stream');
32
+
33
+ // 激活JsView的分段式获取功能
34
+ xhr.setRequestHeader('Jsv-Enable-Stream', '1');
35
+
36
+ // 激活JsView的onProgress时传输内容只有增量而非整量功能,避免内存峰值
37
+ xhr.setRequestHeader('Jsv-Increment-Progress', '1');
38
+
39
+ // 用目标对象的header进行覆盖
40
+ console.log('this.headers', JSON.stringify(this.headers));
41
+ if (this.headers) {
42
+ for (let key in this.headers) {
43
+ const value = this.headers[key];
44
+ console.log('key', key, 'value', value);
45
+ xhr.setRequestHeader(key, value);
46
+ }
47
+ }
48
+
49
+ xhr.onerror = (e) => {
50
+ // 如果请求已被主动取消,不触发错误回调
51
+ if (_this._isAborted || _this._xhr === null) {
52
+ return;
53
+ }
54
+ const duration = _this._startTime ? Date.now() - _this._startTime : 0;
55
+ const urlName = _this._extractPathFromUrl(open_url);
56
+ console.log(`[接口耗时] ${urlName} ${duration}ms (失败)`);
57
+ _this.onError?.(xhr.status, xhr.statusText, e);
58
+ _this._xhr = null;
59
+ };
60
+
61
+ xhr.onreadystatechange = function () {
62
+ if (xhr.readyState !== 4) {
63
+ return;
64
+ }
65
+ // 如果请求已被主动取消,不触发回调
66
+ if (_this._isAborted || _this._xhr === null) {
67
+ return;
68
+ }
69
+ const duration = _this._startTime ? Date.now() - _this._startTime : 0;
70
+ const urlName = _this._extractPathFromUrl(open_url);
71
+ if (xhr.status === 200) {
72
+ console.log(`[接口耗时] ${urlName} ${duration}ms`);
73
+ _this._flushSseCarry();
74
+ _this.onDone?.();
75
+ } else {
76
+ // status 为 0 通常是请求被取消,不触发错误回调
77
+ if (xhr.status === 0) {
78
+ console.log('[SSEReader] 请求被取消,不触发错误回调');
79
+ _this._xhr = null;
80
+ return;
81
+ }
82
+ console.log(`[接口耗时] ${urlName} ${duration}ms (失败)`);
83
+ _this.onError?.(xhr.status, xhr.statusText, null);
84
+ }
85
+ // 请求完成后清除 xhr 引用
86
+ _this._xhr = null;
87
+ };
88
+
89
+ xhr.onprogress = function (ev) {
90
+ // 如果请求已被主动取消,不处理数据
91
+ if (_this._isAborted || _this._xhr === null) {
92
+ return;
93
+ }
94
+ let inc_data;
95
+ if (window.JsvCoreApi?.Platform != 'pc-wasm') {
96
+ inc_data = ev.target.responseText;
97
+ console.log('[SSEReader] xhr.onprogress', ev.target.responseText);
98
+ _this._parseSSEWithCarry(inc_data);
99
+ } else {
100
+ inc_data = ev.target.responseText.substring(_this._proccessedLength);
101
+ _this._proccessedLength = ev.target.responseText.length;
102
+ _this._parseSSEWithCarry(inc_data);
103
+ }
104
+ };
105
+
106
+ if (body_json_object) {
107
+ xhr.send(JSON.stringify(body_json_object));
108
+ } else {
109
+ xhr.send();
110
+ }
111
+ }
112
+
113
+ _extractPathFromUrl(url) {
114
+ if (!url || typeof url !== 'string') return '未知';
115
+ try {
116
+ const parts = url.split('/');
117
+ return parts.length >= 4 ? parts.slice(3).join('/').split('?')[0] : url;
118
+ } catch {
119
+ return '未知';
120
+ }
121
+ }
122
+
123
+ /**
124
+ * 将上一段未以换行结束的片段与本次数据拼接,仅对完整行派发 data:
125
+ */
126
+ _parseSSEWithCarry(chunk) {
127
+ if (this._isAborted || this._xhr === null) {
128
+ return;
129
+ }
130
+ const text = this._sseLineCarry + chunk;
131
+ const lines = text.split('\n');
132
+ let carry = '';
133
+ if (text.length > 0 && !text.endsWith('\n')) {
134
+ carry = lines.pop() ?? '';
135
+ }
136
+ this._sseLineCarry = carry;
137
+ for (let line of lines) {
138
+ if (line.startsWith('data:')) {
139
+ this.onNewData?.(line.substring(5));
140
+ }
141
+ }
142
+ }
143
+
144
+ _flushSseCarry() {
145
+ const c = this._sseLineCarry;
146
+ if (!c) {
147
+ return;
148
+ }
149
+ if (c.startsWith('data:')) {
150
+ this.onNewData?.(c.substring(5));
151
+ }
152
+ this._sseLineCarry = '';
153
+ }
154
+
155
+ /**
156
+ * 取消当前请求
157
+ */
158
+ abort() {
159
+ if (this._xhr) {
160
+ this._isAborted = true; // 标记为主动取消
161
+ try {
162
+ this._xhr.abort();
163
+ console.log('[SSEReader] 请求已取消');
164
+ } catch (error) {
165
+ console.warn('[SSEReader] 取消请求失败:', error);
166
+ }
167
+ this._xhr = null;
168
+ }
169
+ this._sseLineCarry = '';
170
+ }
171
+ }
172
+
173
+ /**
174
+ * 使用方法:
175
+ *
176
+ const reader = new SSEReader();
177
+ reader.url = 'https://dify.ragehealth.cn/lcs-optimize-akb-test/ai_wenzheng';
178
+ reader.headers = {
179
+ 'Cache-Control': 'no-cache', // 可选
180
+ };
181
+ reader.onNewData = (data) => {
182
+ console.log(data);
183
+ };
184
+ reader.onError = (status, statusText, error) => {
185
+ console.error(status, statusText, error);
186
+ };
187
+ reader.onDone = () => {
188
+ console.log('done');
189
+ };
190
+ reader.send('POST', {
191
+ 'a': '123',
192
+ 'b': '456',
193
+ 'c': 1,
194
+ });
195
+
196
+ // 取消请求
197
+ reader.abort();
198
+
199
+ */
200
+ export default SSEReader;
@@ -242,7 +242,7 @@ const procKeyDown = (ev) => {
242
242
  actorControl.run((cmds) => [
243
243
  cmds
244
244
  .action(0, 0, interactNexus)
245
- .setSpdAndAccel(7.9, -24, undefined, 1, null, () => {}),
245
+ .setSpdAndAccel(7.88, -23, undefined, 1, null, () => {}),
246
246
  cmds
247
247
  .condition()
248
248
  .onNexusEvent(interactNexus, actEvents.SpeedRevertY)
@@ -256,7 +256,7 @@ const procKeyDown = (ev) => {
256
256
  actorControl.run((cmds) => [
257
257
  cmds
258
258
  .action(0, 0, interactNexus)
259
- .setSpdAndAccel(-7.9, -24, undefined, 1, null, () => {}),
259
+ .setSpdAndAccel(-7.88, -23, undefined, 1, null, () => {}),
260
260
  cmds
261
261
  .condition()
262
262
  .onNexusEvent(interactNexus, actEvents.SpeedRevertY)
@@ -6,7 +6,7 @@
6
6
  * @Description: file content
7
7
  -->
8
8
  <script setup>
9
- import { VERTICAL, SimpleWidget } from "jsview";
9
+ import { VERTICAL, MetroWidget } from "jsview";
10
10
  import KeyboardItem from "./KeyboardItem.vue";
11
11
 
12
12
  const props=defineProps({
@@ -53,7 +53,7 @@ const data=_initData()
53
53
  </script>
54
54
 
55
55
  <template>
56
- <simple-widget
56
+ <metro-widget
57
57
  ref="sw"
58
58
  :name="props.name"
59
59
  :data="data"
@@ -73,5 +73,5 @@ const data=_initData()
73
73
  :onClick="props.onClick"
74
74
  />
75
75
  </template>
76
- </simple-widget>
76
+ </metro-widget>
77
77
  </template>
@@ -8,7 +8,7 @@
8
8
  <script setup>
9
9
  import FullKeyboard from "./FullKeyboard.vue";
10
10
  import { EdgeDirection, JsvInput, useFocusHub } from "jsview";
11
- import { shallowRef } from "vue";
11
+ import { computed, shallowRef } from "vue";
12
12
 
13
13
  const blurColor = "#AAAAAA";
14
14
  const focusColor = "#FFFF00";
@@ -17,6 +17,8 @@ let input = shallowRef(null);
17
17
  let showCursor = shallowRef(false);
18
18
  const focusHub = useFocusHub();
19
19
  let cursorColor = shallowRef(blurColor);
20
+ let imeAction = shallowRef(null);
21
+ let imeActionColor = shallowRef("#ffffff");
20
22
  const props = defineProps({
21
23
  name: String,
22
24
  type: Number,
@@ -24,6 +26,44 @@ const props = defineProps({
24
26
  placeHolder: String,
25
27
  onEdge: Function,
26
28
  });
29
+ const _randomHexColor = () => {
30
+ const r = Math.floor(Math.random() * 256)
31
+ .toString(16)
32
+ .padStart(2, "0");
33
+ const g = Math.floor(Math.random() * 256)
34
+ .toString(16)
35
+ .padStart(2, "0");
36
+ const b = Math.floor(Math.random() * 256)
37
+ .toString(16)
38
+ .padStart(2, "0");
39
+ return `#${r}${g}${b}`;
40
+ };
41
+ const _imeActionLabel = (action) => {
42
+ switch (action) {
43
+ case 0:
44
+ return "UNSPECIFIED";
45
+ case 1:
46
+ return "NONE";
47
+ case 2:
48
+ return "GO";
49
+ case 3:
50
+ return "SEARCH";
51
+ case 4:
52
+ return "SEND";
53
+ case 5:
54
+ return "NEXT";
55
+ case 6:
56
+ return "DONE";
57
+ case 7:
58
+ return "PREVIOUS";
59
+ default:
60
+ return "UNKNOWN";
61
+ }
62
+ };
63
+ const imeActionInfo = computed(() => {
64
+ if (imeAction.value === null || imeAction.value === undefined) return "-";
65
+ return `${imeAction.value} (${_imeActionLabel(imeAction.value)})`;
66
+ });
27
67
  const _onFocus = () => {
28
68
  showCursor.value = true;
29
69
  cursorColor.value = blurColor;
@@ -58,7 +98,13 @@ const _onTextOverflow = () => {
58
98
  console.log(props.name + " text overflow.");
59
99
  };
60
100
  const _onBackKey = (isUp) => {
61
- return true; // 无论是key-down还是key-up都consume,防止软键盘有时候返回会吐出导致界面回退的问题
101
+ // 无论是key-down还是key-up都consume,防止软键盘有时候用返回键关闭时引起界面退出的问题
102
+ return true;
103
+ };
104
+ const _onImeAction = (action) => {
105
+ imeAction.value = action;
106
+ imeActionColor.value = _randomHexColor();
107
+ console.log(props.name + " ime action:", action);
62
108
  };
63
109
  const _inputOnEdge = (edgeInfo) => {
64
110
  if (edgeInfo.direction === EdgeDirection.bottom) {
@@ -110,9 +156,23 @@ const _inputOnEdge = (edgeInfo) => {
110
156
  :onTextOverflow="_onTextOverflow"
111
157
  :cursorColor="cursorColor"
112
158
  :onBackKey="_onBackKey"
159
+ :onImeAction="_onImeAction"
113
160
  />
114
161
 
115
- <div :style="{ top: 100 }">
162
+ <div
163
+ :style="{
164
+ left: 50,
165
+ top: 95,
166
+ width: 300,
167
+ height: 20,
168
+ color: imeActionColor,
169
+ fontSize: 16,
170
+ }"
171
+ >
172
+ IME action: {{ imeActionInfo }}
173
+ </div>
174
+
175
+ <div :style="{ top: 110 }">
116
176
  <full-keyboard
117
177
  :name="`${props.name}/keyboard`"
118
178
  :onClick="_keyboardOnClick"
package/JsvLine/App.vue CHANGED
@@ -16,60 +16,75 @@
16
16
  </template>
17
17
 
18
18
  <script setup>
19
+ import { shallowRef, onMounted, onBeforeUnmount } from "vue"
19
20
  import { JsvLine } from "jsview"
20
21
  import bg from "./bgimage.jpg"
21
22
 
22
- const startPos1={
23
- x:340,
24
- y:40
23
+ const startPos1 = {
24
+ x: 340,
25
+ y: 40
25
26
  }
26
- const endPos1={
27
- x:340,
28
- y:160
27
+ const endPos1 = {
28
+ x: 340,
29
+ y: 160
29
30
  }
30
31
 
31
- const startPos2={
32
- x:840,
33
- y:150
34
- }
35
- const endPos2={
36
- x:1040,
37
- y:50
38
- }
32
+ // 修改为响应式并定时切换
33
+ const states = [
34
+ { start: { x: 840, y: 150 }, end: { x: 1040, y: 50 } },
35
+ { start: { x: 840, y: 150 }, end: { x: 1140, y: 100 } }
36
+ ];
37
+ const startPos2 = shallowRef({ ...states[0].start });
38
+ const endPos2 = shallowRef({ ...states[0].end });
39
+
40
+ let posIndex = 0;
41
+ let timer = null;
42
+
43
+ onMounted(() => {
44
+ timer = setInterval(() => {
45
+ posIndex = (posIndex + 1) % states.length;
46
+ startPos2.value = { ...states[posIndex].start };
47
+ endPos2.value = { ...states[posIndex].end };
48
+ }, 1500);
49
+ });
50
+ onBeforeUnmount(() => {
51
+ clearInterval(timer);
52
+ });
39
53
 
40
- const startPos3={
41
- x:340,
42
- y:300
54
+ // 其它样例保持不变
55
+ const startPos3 = {
56
+ x: 340,
57
+ y: 300
43
58
  }
44
- const endPos3={
45
- x:560,
46
- y:400
59
+ const endPos3 = {
60
+ x: 560,
61
+ y: 400
47
62
  }
48
63
 
49
- const startPos4={
50
- x:760,
51
- y:400
64
+ const startPos4 = {
65
+ x: 760,
66
+ y: 400
52
67
  }
53
- const endPos4={
54
- x:980,
55
- y:300
68
+ const endPos4 = {
69
+ x: 980,
70
+ y: 300
56
71
  }
57
72
 
58
- const startPos5={
59
- x:240,
60
- y:550
73
+ const startPos5 = {
74
+ x: 240,
75
+ y: 550
61
76
  }
62
- const endPos5={
63
- x:500,
64
- y:520
77
+ const endPos5 = {
78
+ x: 500,
79
+ y: 520
65
80
  }
66
- const startPos6={
67
- x:840,
68
- y:520
81
+ const startPos6 = {
82
+ x: 840,
83
+ y: 520
69
84
  }
70
- const endPos6={
71
- x:1100,
72
- y:550
85
+ const endPos6 = {
86
+ x: 1100,
87
+ y: 550
73
88
  }
74
89
  </script>
75
90
 
package/LatexDemo/App.vue CHANGED
@@ -10,6 +10,8 @@ const baseStyle = {
10
10
 
11
11
  //TODO 此字符串直接写在双花括号内编译出错, 待调查
12
12
  const text = "测试\\textcolor{#FF0000}{红色并且\\textb{加粗}}文字";
13
+
14
+ const testText = `测试\\textcolor{#FF0000}{{红色}试花括号{ 文字 }}文字`
13
15
  </script>
14
16
 
15
17
  <template>
@@ -19,7 +21,7 @@ const text = "测试\\textcolor{#FF0000}{红色并且\\textb{加粗}}文字";
19
21
  :style="{ top: 50, ...baseStyle }"
20
22
  class="textStyle"
21
23
  >
22
- {{ "测试\\textcolor{#FF0000}{红色}文字" }}
24
+ {{ testText }}
23
25
  </jsv-text-box>
24
26
  <jsv-text-box
25
27
  :enableLatex="true"
@@ -78,8 +78,189 @@ const stringList = [
78
78
 
79
79
  这个角的正切值是 \\(0.75\\),余切值是 \\(1.33333333\\)。`,
80
80
  },
81
+ {
82
+ width: 1100,
83
+ detail: '说明:超长的公式文本不会描画',
84
+ str: `
85
+ 测试\\\\
86
+ 测试\\\\
87
+ 测试\\\\
88
+ 测试\\\\
89
+ 测试\\\\
90
+ 测试\\\\
91
+ 测试\\\\
92
+ 测试\\\\
93
+ 测试\\\\
94
+ 测试\\\\
95
+ 测试\\\\
96
+ 测试\\\\
97
+ 测试\\\\
98
+ 测试\\\\
99
+ 测试\\\\
100
+ 测试\\\\
101
+ 测试\\\\
102
+ 测试\\\\
103
+ 测试\\\\
104
+ 测试\\\\
105
+ 测试\\\\
106
+ 测试\\\\
107
+ 测试\\\\
108
+ 测试\\\\
109
+ 测试\\\\
110
+ 测试\\\\
111
+ 测试\\\\
112
+ 测试\\\\
113
+ 测试\\\\
114
+ 测试\\\\
115
+ 测试\\\\
116
+ 测试\\\\
117
+ 测试\\\\
118
+ 测试\\\\
119
+ 测试\\\\
120
+ 测试\\\\
121
+ 测试\\\\
122
+ 测试\\\\
123
+ 测试\\\\
124
+ 测试\\\\
125
+ 测试\\\\
126
+ 测试\\\\
127
+ 测试\\\\
128
+ 测试\\\\
129
+ 测试\\\\
130
+ 测试\\\\
131
+ 测试\\\\
132
+ 测试\\\\
133
+ 测试\\\\
134
+ 测试\\\\
135
+ 测试\\\\
136
+ 测试\\\\
137
+ 测试\\\\
138
+ 测试\\\\
139
+ 测试\\\\
140
+ 测试\\\\
141
+ 测试\\\\
142
+ 测试\\\\
143
+ 测试\\\\
144
+ 测试\\\\
145
+ 测试\\\\
146
+ 测试\\\\
147
+ 测试\\\\
148
+ 测试\\\\
149
+ 测试\\\\
150
+ 测试\\\\
151
+ 测试\\\\
152
+ 测试\\\\
153
+ 测试\\\\
154
+ 测试\\\\
155
+ 测试\\\\
156
+ 测试\\\\
157
+ 测试\\\\
158
+ 测试\\\\
159
+ 测试\\\\
160
+ 测试\\\\
161
+ 测试\\\\
162
+ 测试\\\\
163
+ 测试\\\\
164
+ 测试\\\\
165
+ 测试\\\\
166
+ 测试\\\\
167
+ 测试\\\\
168
+ 测试\\\\
169
+ 测试\\\\
170
+ 测试\\\\
171
+ 测试\\\\
172
+ 测试\\\\
173
+ 测试\\\\
174
+ 测试\\\\
175
+ 测试\\\\
176
+ 测试\\\\
177
+ 测试\\\\
178
+ 测试\\\\
179
+ 测试\\\\
180
+ 测试\\\\
181
+ 测试\\\\
182
+ 测试\\\\
183
+ 测试\\\\
184
+ 测试\\\\
185
+ 测试\\\\
186
+ 测试\\\\
187
+ 测试\\\\
188
+ 测试\\\\
189
+ 测试\\\\
190
+ 测试\\\\
191
+ 测试\\\\
192
+ 测试\\\\
193
+ 测试\\\\
194
+ 测试\\\\
195
+ 测试\\\\
196
+ 测试\\\\
197
+ 测试\\\\
198
+ 测试\\\\
199
+ 测试\\\\
200
+ 测试\\\\
201
+ 测试\\\\
202
+ 测试\\\\
203
+ 测试\\\\
204
+ 测试\\\\
205
+ 测试\\\\
206
+ 测试\\\\
207
+ 测试\\\\
208
+ 测试\\\\
209
+ 测试\\\\
210
+ 测试\\\\
211
+ 测试\\\\
212
+ 测试\\\\
213
+ 测试\\\\
214
+ 测试\\\\
215
+ 测试\\\\
216
+ 测试\\\\
217
+ 测试\\\\
218
+ 测试\\\\
219
+ 测试\\\\
220
+ 测试\\\\
221
+ 测试\\\\
222
+ 测试\\\\
223
+ 测试\\\\
224
+ 测试\\\\
225
+ 测试\\\\
226
+ 测试\\\\
227
+ 测试\\\\
228
+ 测试\\\\
229
+ 测试\\\\
230
+ 测试\\\\
231
+ 测试\\\\
232
+ 测试\\\\
233
+ 测试\\\\
234
+ 测试\\\\
235
+ 测试\\\\
236
+ 测试\\\\
237
+ 测试\\\\
238
+ 测试\\\\
239
+ 测试\\\\
240
+ 测试\\\\
241
+ 测试\\\\
242
+ 测试\\\\
243
+ 测试\\\\
244
+ 测试\\\\
245
+ 测试\\\\
246
+ 测试\\\\
247
+ 测试\\\\
248
+ 测试\\\\
249
+ 测试\\\\
250
+ 测试\\\\
251
+ 测试\\\\
252
+ 测试\\\\
253
+ 测试\\\\
254
+ 测试\\\\
255
+ 测试\\\\
256
+ 测试\\\\
257
+ 测试\\\\
258
+ 测试\\\\
259
+ 测试\\\\`,
260
+ },
81
261
  ];
82
262
  const dataIndex = ref(0);
263
+ const testDetail = ref("");
83
264
  const width = computed(() => {
84
265
  return stringList[dataIndex.value].width;
85
266
  });
@@ -90,6 +271,10 @@ const latexStr = computed(() => {
90
271
  return processLatexStr(s);
91
272
  });
92
273
 
274
+ const detail = computed(() => {
275
+ return stringList[dataIndex.value].detail || '';
276
+ });
277
+
93
278
  const onKeyDown = (ev) => {
94
279
  switch (ev.keyCode) {
95
280
  case 37:
@@ -117,6 +302,17 @@ const onKeyDown = (ev) => {
117
302
  backgroundColor: '#007788',
118
303
  }"
119
304
  ></jsv-focus-block>
305
+ <div
306
+ :style="{
307
+ width: 320,
308
+ left: 1280 - 320,
309
+ top: 30,
310
+ height: 200,
311
+ fontSize: 20,
312
+ }"
313
+ >
314
+ {{ detail }}
315
+ </div>
120
316
  <jsv-latex
121
317
  :key="dataIndex"
122
318
  :latexStr="latexStr"
package/LongImage/App.vue CHANGED
@@ -4,7 +4,7 @@
4
4
  * 带下拉条的长图片展示样例
5
5
  *
6
6
  * 【控件介绍】
7
- * SimpleWidget:见simpleMetrowidget
7
+ * MetroWidget:见MetroWidget.vue的头说明
8
8
  *
9
9
  * 【技巧说明】
10
10
  * Q: 如何让图片的高度自适应?