@shijiu/jsview-vue-samples 2.3.151-test.0 → 2.3.728-alpha.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 (244) 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/DemoForOperator/Blur/Blur.vue +1 -1
  24. package/DemoForOperator/Blur/BlurInOut/BlurInOut.vue +49 -23
  25. package/DemoForOperator/Blur/BlurInOut/StaticBgSlide.vue +1 -1
  26. package/DemoForOperator/Blur/BlurPopup/BlurPopup.vue +156 -20
  27. package/DemoForOperator/BookFlip/App.vue +1 -1
  28. package/DemoForOperator/Bounce/FreeMoveBuilder.js +1 -1
  29. package/DemoForOperator/Firework1/App.vue +12 -1
  30. package/DemoForOperator/Firework1/Fireworks.vue +18 -0
  31. package/DemoForOperator/FlipPage/FlipPage/FlipPage.vue +1 -0
  32. package/DemoForOperator/Focus/Alpha/Item.vue +1 -0
  33. package/DemoForOperator/Focus/Light/Item.vue +1 -0
  34. package/DemoForOperator/Focus/Normal/Item.vue +1 -0
  35. package/DemoForOperator/Genie/App.vue +20 -6
  36. package/DemoForOperator/Genie/App2.vue +61 -0
  37. package/DemoForOperator/Genie/geniePakcer/GenieImage.vue +298 -0
  38. package/DemoForOperator/Genie/geniePakcer/GenieSlot.vue +292 -0
  39. package/DemoForOperator/Genie/geniePakcer/GenieTools.ts +463 -0
  40. package/DemoForOperator/Jigsaw/JigsawFull.vue +12 -7
  41. package/DemoForOperator/Jigsaw/JigsawSingle.vue +13 -7
  42. package/DemoForOperator/LongChatBox/App.vue +13 -13
  43. package/DemoForOperator/LongChatBox/Bubble.vue +78 -66
  44. package/DemoForOperator/LongChatBox/LongChat.vue +67 -36
  45. package/DemoForOperator/LongChatBox/testData.js +7 -44
  46. package/DemoForOperator/Sound/Bounce/FreeMoveBuilder.js +1 -1
  47. package/DemoForOperator/routeList.js +8 -2
  48. package/DemoHomepage/App.vue +74 -1
  49. package/DemoHomepage/components/BodyFrame.vue +5 -0
  50. package/DemoHomepage/components/TabFrame.vue +1 -1
  51. package/DemoHomepage/router.js +749 -165
  52. package/DemoHomepage/views/Homepage.vue +60 -2
  53. package/DemoHomepage/watchTest.vue +50 -0
  54. package/DomRenderer/App.vue +133 -0
  55. package/FilterDemo/AnimatePic.vue +63 -17
  56. package/FilterDemo/App.vue +3 -3
  57. package/FlexCellDemo/AI_skills_update.md +4 -0
  58. package/FlexCellDemo/TestFrame1.vue +12 -2
  59. package/FlexCellDemo/TestFrame2.vue +10 -1
  60. package/FlexCellDemo/TestFrame3.vue +114 -59
  61. package/FpsLimit/App.vue +102 -0
  62. package/FreeMove/App.vue +24 -279
  63. package/FreeMove/TestScene1.vue +260 -0
  64. package/FreeMove/TestScene3.vue +431 -0
  65. package/FreeMoveChildAttract/App.vue +18 -8
  66. package/FreeMoveLink/App.vue +51 -22
  67. package/Hover/App.vue +144 -0
  68. package/HttpRequestSSE/SSEReader.js +200 -0
  69. package/ImpactStop/App.vue +2 -2
  70. package/Input/FullKeyboard.vue +3 -3
  71. package/Input/InputPanel.vue +63 -3
  72. package/JsvLine/App.vue +53 -38
  73. package/LatexDemo/App.vue +3 -1
  74. package/LatexFormula/App.vue +196 -0
  75. package/LongImage/App.vue +1 -1
  76. package/LongImage/LongImageScroll.vue +111 -46
  77. package/LongImage/Scroll.vue +28 -9
  78. package/LongText/LongTextScroll.vue +14 -1
  79. package/Markdown/App.vue +36 -0
  80. package/Markdown/Bubble.vue +109 -0
  81. package/Markdown/LongChat.vue +216 -0
  82. package/Markdown/data.js +633 -0
  83. package/MetroWidgetDemos/AI_skills_update.md +2 -0
  84. package/MetroWidgetDemos/EpgFlowListType/App.vue +206 -0
  85. package/MetroWidgetDemos/EpgFlowListType/components/ContentCard.vue +105 -0
  86. package/MetroWidgetDemos/EpgFlowListType/components/FloorSection.vue +131 -0
  87. package/MetroWidgetDemos/EpgFlowListType/components/LeftTabItem.vue +41 -0
  88. package/MetroWidgetDemos/EpgFlowListType/data.js +78 -0
  89. package/MetroWidgetDemos/ListExpand/ChildItem.vue +130 -0
  90. package/MetroWidgetDemos/ListExpand/ExpandItem.vue +375 -0
  91. package/MetroWidgetDemos/ListExpand/ExpandItem1.vue +403 -0
  92. package/MetroWidgetDemos/ListExpand/assets/arrow-down.png +0 -0
  93. package/MetroWidgetDemos/ListExpand/assets/up-arrow.png +0 -0
  94. package/MetroWidgetDemos/ListExpand/components/WidgetListHandler.vue +150 -0
  95. package/MetroWidgetDemos/ListExpand/index.vue +88 -0
  96. package/MetroWidgetDemos/ListExpand/list.js +2421 -0
  97. package/MetroWidgetDemos/RefreshDemo/App.vue +14 -1
  98. package/MetroWidgetDemos/RenderAccelerate/App.vue +142 -0
  99. package/MetroWidgetDemos/RenderAccelerate/AppPage.vue +78 -0
  100. package/MetroWidgetDemos/RenderAccelerate/AppTab.vue +62 -0
  101. package/MetroWidgetDemos/RenderAccelerate/ContentItem.vue +409 -0
  102. package/MetroWidgetDemos/RenderAccelerate/Item.vue +67 -0
  103. package/MetroWidgetDemos/RenderAccelerate/TabItem.vue +100 -0
  104. package/MetroWidgetDemos/RenderAccelerate/ViewSwiper.vue +215 -0
  105. package/MetroWidgetDemos/RenderAccelerate/WidgetItem.vue +107 -0
  106. package/MetroWidgetDemos/SkeletonDiagram/App.vue +35 -8
  107. package/MetroWidgetDemos/SkeletonDiagram/Item.vue +11 -2
  108. package/MetroWidgetDemos/SkeletonDiagram/assets/imageList.js +245 -0
  109. package/MetroWidgetDemos/SkeletonDiagram/data.js +3 -3
  110. package/MetroWidgetDemos/SpatialNav/App.vue +177 -0
  111. package/MetroWidgetDemos/SpatialNav/Buttons.vue +83 -0
  112. package/MetroWidgetDemos/SpatialNav/CustomFocus.vue +57 -0
  113. package/MetroWidgetDemos/{TripleWidget → SpatialNav}/Item.vue +1 -8
  114. package/MetroWidgetDemos/{TripleWidget/WidgetItem.vue → SpatialNav/SimpleFloor.vue} +14 -45
  115. package/MetroWidgetDemos/SpatialNav/StepMw.vue +113 -0
  116. package/MetroWidgetDemos/SpatialNav/TabContent/TabContent.vue +185 -0
  117. package/MetroWidgetDemos/SpatialNav/TripleSection/TripleSection.vue +69 -0
  118. package/MetroWidgetDemos/SpatialNav/TripleSection/WidgetItem.vue +100 -0
  119. package/MetroWidgetDemos/SpatialNav/TvSection/List.vue +75 -0
  120. package/MetroWidgetDemos/SpatialNav/TvSection/TvSection.vue +91 -0
  121. package/MetroWidgetDemos/basic2/App.vue +407 -0
  122. package/MetroWidgetDemos/basic2/Item.vue +68 -0
  123. package/MetroWidgetDemos/direction/App.vue +22 -0
  124. package/MetroWidgetDemos/gazeFocusDiff/App.vue +126 -0
  125. package/MetroWidgetDemos/gazeFocusDiff/Item.vue +87 -0
  126. package/MetroWidgetDemos/minimalUsage/App.vue +66 -0
  127. package/MetroWidgetDemos/minimalUsage/Item.vue +54 -0
  128. package/MetroWidgetDemos/ninePatchFocusPage/App.vue +23 -7
  129. package/MetroWidgetDemos/ninePatchFocusPage/Item.vue +7 -5
  130. package/MetroWidgetDemos/ninePatchFocusPage/focusConstants.js +2 -0
  131. package/MetroWidgetDemos/routeList.js +216 -12
  132. package/MetroWidgetDemos/slideSetting/App.vue +288 -99
  133. package/MetroWidgetDemos/zIndex/App.vue +117 -0
  134. package/MetroWidgetDemos/zIndex/Item.vue +61 -0
  135. package/NinePatchTester/App.vue +24 -31
  136. package/PreDecode/App.vue +140 -0
  137. package/ReactiveTest/App.vue +115 -0
  138. package/ReactiveTest/Item.vue +92 -0
  139. package/ReactiveTest/assets/imageList.js +245 -0
  140. package/ReactiveTest/component/TestSmartDiv.vue +50 -0
  141. package/ReactiveTest/component/TestSmartDivSrcList.vue +74 -0
  142. package/ReactiveTest/component/TestSmartImage.vue +46 -0
  143. package/ReactiveTest/component/TestSmartImageSrcList.vue +90 -0
  144. package/ReactiveTest/component/TestSmartImageStyle.vue +41 -0
  145. package/ReactiveTest/data.js +49 -0
  146. package/ScreenToBlob/App.vue +250 -0
  147. package/ScrollBoxTest/App.vue +52 -28
  148. package/ScrollBoxTest/ClipBar.vue +64 -2
  149. package/ScrollBoxTest/NinePatchBar.vue +64 -2
  150. package/ScrollBoxTest/SizeDivBar.vue +64 -2
  151. package/SecTorTest/App.vue +9 -3
  152. package/SpringFestival/SpringFestivalScene/FreeMoveBuilder.js +3 -3
  153. package/SyncDecode/App.vue +137 -0
  154. package/TextSizeLimit/App.vue +211 -0
  155. package/TextureAnimation/App3.vue +11 -1
  156. package/TouchWidget/App.vue +90 -5
  157. package/TouchWidget/WidgetItem.vue +1 -0
  158. package/TransitPage/App.vue +2 -0
  159. package/assets/logo.png +0 -0
  160. package/package.json +1 -1
  161. package/DemoForOperator/BookFlip/BookFlip/FlipPage.vue +0 -179
  162. package/DemoForOperator/BookFlip/BookFlip/FlippingBook.vue +0 -310
  163. package/DemoForOperator/BookFlip/BookFlip/flip.glsl +0 -135
  164. package/DemoForOperator/Genie/geniePakcer/Genie.vue +0 -741
  165. package/DemoForOperator/LongChatBox/TextManager.ts +0 -147
  166. package/DemoForOperator/LongChatBox/VirtualList.vue +0 -298
  167. package/DemoForOperator/LongChatBox/utile.js +0 -331
  168. package/DivMetroPerformance/App.vue +0 -157
  169. package/DivMetroPerformance/Item.vue +0 -58
  170. package/DivMetroPerformance/assets/bg.jpg +0 -0
  171. package/DivMetroPerformance/assets/coupon_content.png +0 -0
  172. package/DivMetroPerformance/assets/coupon_left.png +0 -0
  173. package/DivMetroPerformance/assets/coupon_mid.png +0 -0
  174. package/DivMetroPerformance/assets/coupon_right.png +0 -0
  175. package/DivMetroPerformance/assets/focus_border.png +0 -0
  176. package/DivMetroPerformance/assets/holder_logo.png +0 -0
  177. package/DivMetroPerformance/assets/jrbm.png +0 -0
  178. package/DivMetroPerformance/assets/line_left.png +0 -0
  179. package/DivMetroPerformance/assets/line_mid.png +0 -0
  180. package/DivMetroPerformance/assets/line_right.png +0 -0
  181. package/DivMetroPerformance/assets/loading.png +0 -0
  182. package/DivMetroPerformance/assets/logo.png +0 -0
  183. package/DivMetroPerformance/assets/mcjx.png +0 -0
  184. package/DivMetroPerformance/assets/tao.png +0 -0
  185. package/DivMetroPerformance/assets/tmall.png +0 -0
  186. package/DivMetroPerformance/border.png +0 -0
  187. package/DivMetroPerformance/components/ContentItem.vue +0 -384
  188. package/DivMetroPerformance/components/MyTab.vue +0 -129
  189. package/DivMetroPerformance/data.js +0 -124
  190. package/DivMetroPerformance/utils/GridItem.vue +0 -28
  191. package/DivMetroPerformance/utils/GridPlate.vue +0 -85
  192. package/MediaDemo/App.vue +0 -127
  193. package/MediaDemo/assets/audio-poster.png +0 -0
  194. package/MediaDemo/components/Button.vue +0 -69
  195. package/MediaDemo/components/Controllor.vue +0 -286
  196. package/MediaDemo/components/StatusBar.vue +0 -100
  197. package/MediaDemo/components/frames/AudioFrame.vue +0 -39
  198. package/MediaDemo/components/frames/AudioPoster.vue +0 -48
  199. package/MediaDemo/components/frames/MediaFrame.vue +0 -153
  200. package/MediaDemo/components/frames/VideoFrame.vue +0 -39
  201. package/MetroWidgetDemos/TripleWidget/App.vue +0 -87
  202. package/MetroWidgetDemos/TripleWidget/SWidgetItem.vue +0 -99
  203. package/Parkour/App.vue +0 -13
  204. package/Parkour/Common/Context.js +0 -21
  205. package/Parkour/Common/MatchmanInfo.js +0 -62
  206. package/Parkour/Common/Random.js +0 -61
  207. package/Parkour/Common/Sound.js +0 -50
  208. package/Parkour/appConfig/HOW_TO_CONFIG.md +0 -20
  209. package/Parkour/appConfig/app.config.mjs +0 -5
  210. package/Parkour/appConfig/app_sign_private_key_sample.crt +0 -28
  211. package/Parkour/appConfig/app_sign_public_key_sample.pem +0 -9
  212. package/Parkour/appConfig/jsview.config.mjs +0 -39
  213. package/Parkour/assets/Bgimages/bg1.png +0 -0
  214. package/Parkour/assets/Bgimages/bg2.png +0 -0
  215. package/Parkour/assets/Bgimages/bg3.png +0 -0
  216. package/Parkour/assets/Bgimages/bg4.png +0 -0
  217. package/Parkour/assets/Bgimages/bg5.png +0 -0
  218. package/Parkour/assets/audio/jump.mp3 +0 -0
  219. package/Parkour/assets/audio/lose.mp3 +0 -0
  220. package/Parkour/assets/role_skin1/fail.json +0 -44
  221. package/Parkour/assets/role_skin1/fail.png +0 -0
  222. package/Parkour/assets/role_skin1/jump_down.json +0 -20
  223. package/Parkour/assets/role_skin1/jump_down.png +0 -0
  224. package/Parkour/assets/role_skin1/jump_up.json +0 -44
  225. package/Parkour/assets/role_skin1/jump_up.png +0 -0
  226. package/Parkour/assets/role_skin1/roll.json +0 -44
  227. package/Parkour/assets/role_skin1/roll.png +0 -0
  228. package/Parkour/assets/role_skin1/run.json +0 -52
  229. package/Parkour/assets/role_skin1/run.png +0 -0
  230. package/Parkour/components/Backdrop.vue +0 -61
  231. package/Parkour/components/GameSence.vue +0 -602
  232. package/Parkour/components/Matchman.vue +0 -85
  233. package/TextureAnimation/utils/FrameCanvasStore.ts +0 -68
  234. package/TextureAnimation/utils/RotateFrame.vue +0 -146
  235. package/TextureAnimation/utils/circleHaloMask.png +0 -0
  236. package/ThrowMoveDemo/AccelerateDemo.vue +0 -85
  237. package/ThrowMoveDemo/App.vue +0 -104
  238. package/ThrowMoveDemo/LRParabolicDemo.vue +0 -101
  239. package/ThrowMoveDemo/TargetDemo.vue +0 -87
  240. package/ThrowMoveDemo/UDParabolicDemo.vue +0 -92
  241. /package/{AnimPicture/assets → assets}/animated_webp.webp +0 -0
  242. /package/{AnimPicture/assets → assets}/ball_3.webp +0 -0
  243. /package/{AnimPicture/assets → assets}/girl_run.gif +0 -0
  244. /package/{AnimPicture/assets → assets}/quan.webp +0 -0
@@ -1,331 +0,0 @@
1
- //测试文本
2
- let string = "# 袁隆平\n\n- **姓名**:袁隆平\n- **出生日期**:1930年9月7日\n- **籍贯**:江西省九江市德安县\n- **职业**:农业科学家、杂交水稻育种专家\n- **主要成就**:成功研究出杂交水稻技术,被誉为“杂交水稻之父”\n- **荣誉**:获得共和国勋章等多项国内外荣誉\n\n袁隆平是中国著名的农业科学家,他致力于杂交水稻的研究,为解决世界粮食问题作出了巨大贡献。\n为您推荐这些好看的影视\n 测试 一级标题\n# 一级标题\n 测试---二级标题\n## 二级标题 \n测试---三级标题\n### 三级标题 \n测试---四级标题\n#### 四级标题 \n测试---五级标题\n##### 五级标题 \n测试---六级级标题\n###### 六级标题 \n 测试---水平线\n--- \n测试---无序列表\n- 无序列表项 1 \n- 无序列表项 2\n- 无序列表项 3\n- 无序列表项 4\n测试---有序列表\n1. 有序列表项 1\n2. 有序列表项 2\n3. 有序列表项 3\n测试---引用\n> 这是个引用\n测试---长段落\n`新华社`北京4月1日电 4月1日,国家主席习近平同印度总统穆尔穆互致贺电,庆祝两国建交75周年\n习近平指出,中国和印度同为文明古国、发展中大国、“全球南方”重要成员,都处在各自现代化建设的关键时期。中印关系发展历程表明,做相互成就的伙伴、实现“龙象共舞”是双方的正确选择,完全符合两国和两国人民根本利益。双方应坚持从战略高度和长远角度看待和处理中印关系,共谋相邻大国和平共处、互信互利、共同发展的相处之道,共同推进世界多极化和国际关系民主化。\n"
3
-
4
-
5
- function extractBracketsText(markdown) {
6
- // 正则表达式:匹配 [文本](链接) 格式,捕获中括号内的文本
7
- const regex = /$(.*?)$$(.*?)$/g;
8
-
9
- const results = [];
10
- let match;
11
-
12
- // 循环提取所有匹配项的中括号内容
13
- while ((match = regex.exec(markdown)) !== null) {
14
- results.push(match); // 第一个捕获组(中括号内的文本)
15
- }
16
-
17
- return results; // 返回所有匹配的中括号文本数组
18
- }
19
- //api
20
- //text
21
- //img
22
- //公式
23
- export function TypeTransitionApi(string){
24
- // img 图片
25
- //gptText 文本
26
- // div结构 水平线
27
- if(/^-{3,}/gm.test(string)){
28
- return 'horizontalLine'
29
- }
30
- return 'text' //默认
31
-
32
-
33
- }
34
- // md格式 替换 latex 正则
35
- export function TextTransitionApi(string){
36
- let tranSting = string
37
- // 行内代码 、 代码块
38
- // 水平线
39
- tranSting = tranSting.replace(/^-{3,}$/gm, ''); //去掉标识
40
- //加粗
41
- tranSting = tranSting.replace(/(\*\*|__)(.*?)\1/g, '\\textb{$2}')
42
- //斜体
43
- tranSting = tranSting.replace(/(\*|_)(.*?)\1/g, '\\texti{$2}')
44
- // 删除线
45
- tranSting = tranSting.replace(/~~(.*?)~~/g, '\\textdecoration{line-through}{$1}')
46
- //链接这是个[链接](https://example.com)\n
47
- tranSting = tranSting.replace((/$([^$]+)\]$([^)]+)$/g,'\\textdecoration{underline}{\\textcolor{#FF0000}{$1}}'))
48
- // tranSting = tranSting.replace(/$(.*?)$$(.*?)$/g, '\\textdecoration{underline}{\\textcolor{#FF0000}{$1}}')
49
- // `` 行内代码块
50
- tranSting = tranSting.replace(/`(.*?)`/g, '\\textcolor{#FF0000}{$1}')
51
-
52
-
53
- // 行内代码
54
- // .replace(/`(.*?)`/g, '<code>$1</code>')🚨
55
-
56
- // 图片
57
- // .replace(/!$(.*?)$$(.*?)$/g, '<img src="$2" alt="$1">')🚨
58
-
59
- //////////////////////
60
- //匹配头部 处理
61
-
62
- // 标题:
63
- if(/^######\s+(.+)/.test(string)){
64
- tranSting = tranSting.replace(/^######\s+(.+)/g, '$1');
65
- }else if(/^#####\s+(.+)/.test(string)){
66
- tranSting = tranSting.replace(/^#####\s+(.+)/g, '$1');
67
- }else if(/^####\s+(.+)/.test(string)){
68
- tranSting = tranSting.replace(/^####\s+(.+)/g, '$1');
69
- }else if(/^###\s+(.+)/.test(string)){
70
- tranSting = tranSting.replace(/^###\s+(.+)/g, '$1');
71
- }else if(/^##\s+(.+)/.test(string)){
72
- tranSting = tranSting.replace(/^##\s+(.+)/g, '$1');
73
- }else if(/^#\s+(.+)/.test(string)){
74
- tranSting = tranSting.replace(/^#\s+(.+)/g, '$1');
75
- }
76
- else if (/^\s*[-*+]\s/.test(tranSting)) {
77
- //无序列表 /●
78
- // 无序列表
79
- tranSting = tranSting.replace(/^\s*[-*+]\s+(.*)/, '● $1');
80
- }else if (/^\s*\d+\.\s/.test(tranSting)) {
81
- // 有序列表
82
- tranSting = tranSting.replace(/^\s*(\d+)\.\s+(.*)/, '$1. $2');
83
- }else if (tranSting.startsWith('> ')) {
84
- // 引用块 ---- 引用 -- 两个空格
85
- tranSting = tranSting.replace(/^> (.*)/, '▍ $1');
86
- }else{
87
- //段落 四个空格 //首行缩进
88
- tranSting = ' ' + tranSting
89
-
90
- }
91
-
92
- return tranSting
93
-
94
-
95
-
96
- }
97
- // md格式 转 样式
98
- export function StyleTransitionApi(string){
99
- //特殊的标签进行处理
100
- const em = 28
101
- const color = '#ffffff'
102
- //标题 -- 加粗 、字号、行高
103
- if(/^######\s+(.+)/.test(string)){
104
- //h6
105
- return{
106
- fontSize: Math.floor(0.8 * em),
107
- fontWeight:"bold",
108
- height:Math.floor(1.7*0.8 * em),
109
- lineHeight:Math.floor(1.7*0.8 * em),
110
- color:color,
111
- }
112
- }
113
- if(/^#####\s+(.+)/.test(string)){
114
- //h5
115
- return{
116
- fontSize: Math.floor(1 * em),
117
- fontWeight:"bold",
118
- height:Math.floor(1.6*1 * em),
119
- lineHeight:Math.floor(1.6*1 * em),
120
- color:color,
121
- }
122
- }
123
- if(/^####\s+(.+)/.test(string)){
124
- //h4
125
- return{
126
- fontSize: Math.floor(1.2 * em),
127
- fontWeight:"bold",
128
- height:Math.floor(1.5*1.2 * em),
129
- lineHeight:Math.floor(1.5*1.2 * em),
130
- color:color,
131
- }
132
- }
133
- if(/^###\s+(.+)/.test(string)){
134
- //h3
135
- return{
136
- fontSize: Math.floor(1.4 * em),
137
- fontWeight:"bold",
138
- height:Math.floor(1.4*1.4 * em),
139
- lineHeight:Math.floor(1.4*1.4 * em),
140
- color:color,
141
- }
142
- }
143
- if(/^##\s+(.+)/.test(string)){
144
- //h2
145
- return{
146
- fontSize: Math.floor(1.7 * em),
147
- fontWeight:"bold",
148
- height:Math.floor(1.3*1.7 * em),
149
- lineHeight:Math.floor(1.3*1.7 * em),
150
- color:color,
151
- }
152
- }
153
- if(/^#\s+(.+)/.test(string)){
154
- //h1
155
- return{
156
- fontSize: Math.floor(2 * em),
157
- fontWeight:"bold",
158
- height:Math.floor(1.2*2 * em),
159
- lineHeight:Math.floor(1.2*2 * em),
160
- color:color,
161
- }
162
- }
163
- // 引用块 ---- 引用 -- 加背景颜色
164
- if (string.startsWith('> ')) {
165
- return{
166
- fontSize: em,
167
- color:'#cccccc',
168
- lineHeight:Math.floor(1.6* em),
169
- //缩进四个字符
170
- }
171
- }
172
- //水平线 --- <hr>
173
- if(/^-{3,}$/gm.test(string)){
174
- //父 margin 15 0 32
175
- return {
176
- top:18,
177
- height:4,
178
- borderRadius:2,
179
- backgroundColor:color,
180
- }
181
- }
182
-
183
- //默认格式
184
- return{
185
- fontSize: em,
186
- color:color,
187
- lineHeight:Math.floor(1.6* em),
188
- }
189
-
190
-
191
-
192
- }
193
-
194
- export function StyleTransitionApi2(string){
195
- //特殊的标签进行处理
196
- const em = 28
197
- const color = '#ffffff'
198
- //标题 -- 加粗 、字号、行高
199
- if(/^######\s?(.?)/.test(string)){
200
- //h6
201
- return{
202
- fontSize: Math.floor(0.8 * em),
203
- fontWeight:"bold",
204
- height:Math.floor(1.7*0.8 * em),
205
- lineHeight:Math.floor(1.7*0.8 * em),
206
- color:color,
207
- }
208
- }
209
- if(/^#####\s?(.?)/.test(string)){
210
- //h5
211
- return{
212
- fontSize: Math.floor(1 * em),
213
- fontWeight:"bold",
214
- height:Math.floor(1.6*1 * em),
215
- lineHeight:Math.floor(1.6*1 * em),
216
- color:color,
217
- }
218
- }
219
- if(/^####\s?(.?)/.test(string)){
220
- //h4
221
- return{
222
- fontSize: Math.floor(1.2 * em),
223
- fontWeight:"bold",
224
- height:Math.floor(1.5*1.2 * em),
225
- lineHeight:Math.floor(1.5*1.2 * em),
226
- color:color,
227
- }
228
- }
229
- if(/^###\s?(.?)/.test(string)){
230
- //h3
231
- return{
232
- fontSize: Math.floor(1.4 * em),
233
- fontWeight:"bold",
234
- height:Math.floor(1.4*1.4 * em),
235
- lineHeight:Math.floor(1.4*1.4 * em),
236
- color:color,
237
- }
238
- }
239
- if(/^##\s?(.?)/.test(string)){
240
- //h2
241
- return{
242
- fontSize: Math.floor(1.7 * em),
243
- fontWeight:"bold",
244
- height:Math.floor(1.3*1.7 * em),
245
- lineHeight:Math.floor(1.3*1.7 * em),
246
- color:color,
247
- }
248
- }
249
- if(/^#\s?(.?)/.test(string)){
250
- //h1
251
- return{
252
- fontSize: Math.floor(2 * em),
253
- fontWeight:"bold",
254
- height:Math.floor(1.2*2 * em),
255
- lineHeight:Math.floor(1.2*2 * em),
256
- color:color,
257
- }
258
- }
259
- // 引用块 ---- 引用 -- 加背景颜色
260
- if (string.startsWith('> ')) {
261
- return{
262
- fontSize: em,
263
- color:'#cccccc',
264
- lineHeight:Math.floor(1.6* em),
265
- //缩进四个字符
266
- }
267
- }
268
- //水平线 --- <hr>
269
- if(/^-{3,}$/gm.test(string)){
270
- //父 margin 15 0 32
271
- return {
272
- top:18,
273
- height:4,
274
- borderRadius:2,
275
- backgroundColor:color,
276
- }
277
- }
278
-
279
- //默认格式
280
- return{
281
- fontSize: em,
282
- color:color,
283
- lineHeight:Math.floor(1.6* em),
284
- }
285
-
286
-
287
-
288
- }
289
-
290
-
291
- //api:未能开发:图片、表格 、代码块 、公式
292
- export function splitWithNewlines(str) {
293
- // 匹配所有换行符类型(\r\n, \n, \r)并保留
294
- return str.split(/(\r\n|\n|\r)/)
295
- .reduce((acc, part, i, arr) => {
296
- // 将换行符与前一个元素合并
297
- if (i % 2 === 0) {
298
- const newline = arr[i + 1] || '';
299
- acc.push(part + newline);
300
- }
301
- return acc;
302
- }, []);
303
- }
304
-
305
- //长文本 分块函数
306
- export function splitStringByLength(str) {
307
- const result = [];
308
- const chunkSize = 112;
309
- const minLastChunk = 10;
310
-
311
- // 遍历字符串按 150 长度分块
312
- for (let i = 0; i < str.length; i += chunkSize) {
313
- const chunk = str.slice(i, i + chunkSize);
314
- result.push(chunk);
315
- }
316
-
317
- // 处理最后一块的逻辑
318
- if (result.length > 1) {
319
- const lastChunk = result[result.length - 1];
320
- if (lastChunk.length < minLastChunk) {
321
- result.pop(); // 移除最后一块
322
- result[result.length - 1] += lastChunk; // 合并到前一块
323
- }
324
- }
325
-
326
- return result;
327
- }
328
-
329
-
330
-
331
-
@@ -1,157 +0,0 @@
1
- <script>
2
- import { Options, Vue } from "vue-class-component";
3
- import { data1, data2, data3 } from "./data";
4
- import GridPlate from "./utils/GridPlate.vue";
5
- import Item from "./components/ContentItem.vue";
6
- import MyTab from "./components/MyTab.vue";
7
- import { useFocusHub } from "jsview";
8
-
9
- @Options({
10
- components: {
11
- GridPlate,
12
- Item,
13
- MyTab,
14
- },
15
- })
16
- class App extends Vue {
17
- constructor(props) {
18
- super(props);
19
- this.focusNode = null;
20
- this.contentData = data1;
21
- this.myId = 0;
22
- this.focusStyle = {};
23
- this.requestDataTime = 0;
24
-
25
- window.sStyleChangeCount = 0;
26
- window.sStyleChangeCost = 0;
27
- window.sStyleTextChangeCost = 0;
28
-
29
- window.sStylePropCount = 0;
30
- window.sStylePropCost = 0;
31
-
32
- console.log("App created");
33
- }
34
-
35
- setup() {
36
- return {
37
- focusHub: useFocusHub()
38
- }
39
- }
40
-
41
- onKeyDown(ev) {
42
- // 8:Backspace, 27:Escape, 10000:盒子返回键
43
- if (ev.keyCode == 8 || ev.keyCode == 27 || ev.keyCode == 10000) {
44
- this.$router?.go(-1); // 有router时,是从DemoHomepage进入,回退
45
- return true;
46
- }
47
- return false;
48
- }
49
-
50
- getMeasures() {
51
- return {
52
- width: 227,
53
- height: 351,
54
- focusable: true,
55
- };
56
- }
57
- onFocus() {
58
- console.log("App onFocus", this.$refs.rootNode);
59
- }
60
- onItemFocus(id) {
61
- if (this.requestDataTime != 0) {
62
- clearTimeout(this.requestDataTime);
63
- this.requestDataTime = 0;
64
- }
65
- // this.requestDataTime = setTimeout(()=>{
66
- if (!window.JsvDebugTimeToken) {
67
- window.JsvDebugTimeToken = {
68
- start: 0,
69
- };
70
- }
71
- window.JsvDebugTimeToken.start = Date.now();
72
- console.log(
73
- "JsvTestTime onItemFocus start time=" + window.JsvDebugTimeToken.start
74
- );
75
-
76
- window.sStyleChangeCount = 0;
77
- window.sStyleChangeCost = 0;
78
- window.sStyleTextChangeCost = 0;
79
- window.sStylePropCount = 0;
80
- window.sStylePropCost = 0;
81
-
82
- switch (id) {
83
- case 0:
84
- this.contentData = data1;
85
- break;
86
- case 1:
87
- this.contentData = data2;
88
- break;
89
- case 2:
90
- this.contentData = data3;
91
- break;
92
- }
93
- this.myId = id;
94
- // }, 0);
95
- }
96
-
97
- beforeUnmount() {
98
- if (this.requestDataTime != 0) {
99
- clearTimeout(this.requestDataTime);
100
- this.requestDataTime = 0;
101
- }
102
- }
103
-
104
- mounted() {
105
- this.focusHub.setFocus("tab");
106
- window.jJsvRuntimeBridge?.notifyPageLoaded();
107
- }
108
- }
109
-
110
- export default App;
111
- </script>
112
-
113
- <template>
114
- <jsv-focus-block
115
- ref="rootNode"
116
- autoFocus
117
- :onKeyDown="onKeyDown"
118
- :onFocus="onFocus"
119
- >
120
- <div class="rootSize">
121
- <div :style="{ left: 50, top: 50 }">
122
- <my-tab name="tab" :onItemFocus="onItemFocus" />
123
- </div>
124
-
125
- <div class="widgetPos">
126
- <grid-plate
127
- name="simpleWidget"
128
- :key="myId"
129
- :data="contentData"
130
- :width="1253"
131
- :height="600"
132
- :measures="getMeasures"
133
- >
134
- <template #renderItem="{ data }">
135
- <Item :data="data" />
136
- </template>
137
- </grid-plate>
138
- </div>
139
- </div>
140
- </jsv-focus-block>
141
- </template>
142
-
143
- <style scoped>
144
- .rootSize {
145
- top: 0;
146
- }
147
-
148
- .widgetPos {
149
- top: 120;
150
- left: 50;
151
- }
152
-
153
- .focusPos {
154
- top: 10;
155
- left: 10;
156
- }
157
- </style>
@@ -1,58 +0,0 @@
1
- <script>
2
- export default {
3
- props: {
4
- data: Object,
5
- query: Object,
6
- onEdge: Function,
7
- onAction: Object,
8
- },
9
- methods: {
10
- onFocus() {
11
- this.focus = true;
12
- },
13
- onBlur() {
14
- this.focus = false;
15
- },
16
- onClick() {
17
- console.log("item click");
18
- },
19
- getStyle() {
20
- const width = this.focus
21
- ? (this.data.blocks.w - 10) * (1 / 0.8)
22
- : this.data.blocks.w - 10;
23
- const height = this.focus
24
- ? (this.data.blocks.h - 10) * (1 / 0.8)
25
- : this.data.blocks.h - 10;
26
- const posx = this.focus ? (this.data.blocks.w - 10 - width) / 2 : 0;
27
- const posy = this.focus ? (this.data.blocks.h - 10 - height) / 2 : 0;
28
- return {
29
- left: posx,
30
- top: posy,
31
- width: width,
32
- height: height,
33
- color: "#FFFFFF",
34
- backgroundColor: this.focus ? "#FF0000" : this.data.color,
35
- };
36
- },
37
- },
38
- data() {
39
- return {
40
- focus: false,
41
- anim: null,
42
- };
43
- },
44
- created() {
45
- this.onAction.register("onFocus", this.onFocus);
46
- this.onAction.register("onBlur", this.onBlur);
47
- this.onAction.register("onClick", this.onClick);
48
- },
49
- };
50
- </script>
51
-
52
- <template>
53
- <div :style="{ ...getStyle() }">
54
- {{ data.content }}
55
- </div>
56
- </template>
57
-
58
- <style scoped></style>
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file