@shijiu/jsview-vue-samples 2.3.151-test.0 → 3.0.0-test.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.
- package/ABImageAlt/App.vue +114 -0
- package/ABImageAlt/Item.vue +133 -0
- package/{MetroWidgetDemos/SkeletonDiagram/assets/imageList.json → ABImageAlt/assets/imageList.js} +9 -1
- package/ABImageAlt/data.js +17 -0
- package/AI_Check_Rules.txt +5 -0
- package/AnimPicture/App.vue +20 -10
- package/ApicSwitch/App.vue +90 -0
- package/ApicSwitch/TabItem.vue +65 -0
- package/ApicSwitch/WebpShow.vue +24 -0
- package/ApicSwitch/data.js +50 -0
- package/Basic/AI_skills_update.md +1 -0
- package/Basic/components/div/ColorFormatTest.vue +93 -0
- package/Basic/components/div/DivRadius.vue +97 -15
- package/Basic/components/div/DivTag3Group.vue +30 -0
- package/Basic/components/img/ImageType.vue +65 -0
- package/Basic/components/panel/Panel2.vue +13 -1
- package/Basic/components/text/TextAlign.vue +7 -1
- package/BlobLoadTest/App.vue +201 -0
- package/BreakLinesApi/App.vue +82 -0
- package/CanvasDrawChart/App.vue +11 -0
- package/CanvasDrawChart/Graph1.vue +104 -0
- package/CanvasDrawChart/Graph2.vue +115 -0
- package/CssPreprocessor/Scss/PanelData.js +1 -1
- package/CssPreprocessor/Scss/components/scss-group4/ScssMaps.vue +4 -3
- package/CssPreprocessor/Scss/components/scss-group5/ScssImporting.vue +2 -2
- package/DemoForOperator/Bounce/FreeMoveBuilder.js +1 -1
- package/DemoForOperator/Firework1/App.vue +12 -1
- package/DemoForOperator/Firework1/Fireworks.vue +18 -0
- package/DemoForOperator/FlipPage/FlipPage/FlipPage.vue +1 -0
- package/DemoForOperator/Focus/Alpha/Item.vue +1 -0
- package/DemoForOperator/Focus/Light/Item.vue +1 -0
- package/DemoForOperator/Focus/Normal/Item.vue +1 -0
- package/DemoForOperator/FrameShadow/FrameShadow.vue +1 -1
- package/DemoForOperator/Genie/App.vue +20 -6
- package/DemoForOperator/Genie/App2.vue +61 -0
- package/DemoForOperator/Genie/geniePakcer/GenieImage.vue +298 -0
- package/DemoForOperator/Genie/geniePakcer/GenieSlot.vue +292 -0
- package/DemoForOperator/Genie/geniePakcer/GenieTools.ts +463 -0
- package/DemoForOperator/Jigsaw/JigsawFull.vue +12 -7
- package/DemoForOperator/Jigsaw/JigsawSingle.vue +13 -7
- package/DemoForOperator/LongChatBox/App.vue +13 -13
- package/DemoForOperator/LongChatBox/Bubble.vue +78 -66
- package/DemoForOperator/LongChatBox/LongChat.vue +68 -36
- package/DemoForOperator/LongChatBox/testData.js +7 -44
- package/DemoForOperator/Sound/Bounce/FreeMoveBuilder.js +1 -1
- package/DemoForOperator/routeList.js +8 -2
- package/DemoHomepage/App.vue +74 -1
- package/DemoHomepage/components/BodyFrame.vue +1 -0
- package/DemoHomepage/components/TabFrame.vue +1 -1
- package/DemoHomepage/router.js +723 -160
- package/DemoHomepage/views/Homepage.vue +60 -2
- package/DemoHomepage/watchTest.vue +50 -0
- package/FilterDemo/AnimatePic.vue +63 -17
- package/FilterDemo/App.vue +3 -3
- package/FlexCellDemo/AI_skills_update.md +4 -0
- package/FlexCellDemo/TestFrame1.vue +12 -2
- package/FlexCellDemo/TestFrame2.vue +10 -1
- package/FlexCellDemo/TestFrame3.vue +114 -59
- package/FpsLimit/App.vue +102 -0
- package/FreeMoveChildAttract/App.vue +18 -8
- package/FreeMoveLink/App.vue +49 -20
- package/Hover/App.vue +144 -0
- package/HttpRequestSSE/SSEReader.js +200 -0
- package/ImpactStop/App.vue +2 -2
- package/Input/FullKeyboard.vue +3 -3
- package/Input/InputPanel.vue +63 -3
- package/JsvLine/App.vue +53 -38
- package/LatexDemo/App.vue +3 -1
- package/LatexFormula/App.vue +196 -0
- package/LongImage/App.vue +1 -1
- package/LongImage/LongImageScroll.vue +100 -47
- package/LongImage/Scroll.vue +28 -9
- package/LongText/LongTextScroll.vue +1 -0
- package/Markdown/App.vue +36 -0
- package/Markdown/Bubble.vue +109 -0
- package/Markdown/LongChat.vue +206 -0
- package/Markdown/Markdown/Markdown.vue +156 -0
- package/Markdown/Markdown/index.ts +1 -0
- package/Markdown/Markdown/marked/LICENSE.md +45 -0
- package/Markdown/Markdown/marked/index.ts +2 -0
- package/Markdown/Markdown/marked/marked.d.ts +756 -0
- package/Markdown/Markdown/marked/marked.js +71 -0
- package/Markdown/Markdown/parser.ts +1365 -0
- package/Markdown/data.js +581 -0
- package/MetroWidgetDemos/AI_skills_update.md +2 -0
- package/MetroWidgetDemos/ListExpand/ChildItem.vue +130 -0
- package/MetroWidgetDemos/ListExpand/ExpandItem.vue +375 -0
- package/MetroWidgetDemos/ListExpand/ExpandItem1.vue +403 -0
- package/MetroWidgetDemos/ListExpand/assets/arrow-down.png +0 -0
- package/MetroWidgetDemos/ListExpand/assets/up-arrow.png +0 -0
- package/MetroWidgetDemos/ListExpand/components/WidgetListHandler.vue +150 -0
- package/MetroWidgetDemos/ListExpand/index.vue +88 -0
- package/MetroWidgetDemos/ListExpand/list.js +2421 -0
- package/MetroWidgetDemos/RefreshDemo/App.vue +14 -1
- package/MetroWidgetDemos/RenderAccelerate/App.vue +142 -0
- package/MetroWidgetDemos/RenderAccelerate/AppPage.vue +78 -0
- package/MetroWidgetDemos/RenderAccelerate/AppTab.vue +62 -0
- package/MetroWidgetDemos/RenderAccelerate/ContentItem.vue +409 -0
- package/MetroWidgetDemos/RenderAccelerate/Item.vue +67 -0
- package/MetroWidgetDemos/RenderAccelerate/TabItem.vue +100 -0
- package/MetroWidgetDemos/RenderAccelerate/ViewSwiper.vue +215 -0
- package/MetroWidgetDemos/RenderAccelerate/WidgetItem.vue +107 -0
- package/MetroWidgetDemos/SkeletonDiagram/App.vue +35 -8
- package/MetroWidgetDemos/SkeletonDiagram/Item.vue +11 -2
- package/MetroWidgetDemos/SkeletonDiagram/assets/imageList.js +245 -0
- package/MetroWidgetDemos/SkeletonDiagram/data.js +3 -3
- package/MetroWidgetDemos/SpatialNav/App.vue +177 -0
- package/MetroWidgetDemos/SpatialNav/Buttons.vue +83 -0
- package/MetroWidgetDemos/SpatialNav/CustomFocus.vue +57 -0
- package/MetroWidgetDemos/{TripleWidget → SpatialNav}/Item.vue +1 -8
- package/MetroWidgetDemos/{TripleWidget/WidgetItem.vue → SpatialNav/SimpleFloor.vue} +14 -45
- package/MetroWidgetDemos/SpatialNav/StepMw.vue +113 -0
- package/MetroWidgetDemos/SpatialNav/TabContent/TabContent.vue +185 -0
- package/MetroWidgetDemos/SpatialNav/TripleSection/TripleSection.vue +69 -0
- package/MetroWidgetDemos/SpatialNav/TripleSection/WidgetItem.vue +100 -0
- package/MetroWidgetDemos/SpatialNav/TvSection/List.vue +75 -0
- package/MetroWidgetDemos/SpatialNav/TvSection/TvSection.vue +91 -0
- package/MetroWidgetDemos/basic2/App.vue +407 -0
- package/MetroWidgetDemos/basic2/Item.vue +68 -0
- package/MetroWidgetDemos/direction/App.vue +22 -0
- package/MetroWidgetDemos/gazeFocusDiff/App.vue +126 -0
- package/MetroWidgetDemos/gazeFocusDiff/Item.vue +87 -0
- package/MetroWidgetDemos/minimalUsage/App.vue +66 -0
- package/MetroWidgetDemos/minimalUsage/Item.vue +54 -0
- package/MetroWidgetDemos/ninePatchFocusPage/App.vue +22 -7
- package/MetroWidgetDemos/ninePatchFocusPage/Item.vue +7 -5
- package/MetroWidgetDemos/ninePatchFocusPage/focusConstants.js +2 -0
- package/MetroWidgetDemos/routeList.js +203 -12
- package/MetroWidgetDemos/slideSetting/App.vue +288 -99
- package/MetroWidgetDemos/zIndex/App.vue +117 -0
- package/MetroWidgetDemos/zIndex/Item.vue +61 -0
- package/NinePatchTester/App.vue +24 -31
- package/PreDecode/App.vue +140 -0
- package/ReactiveTest/App.vue +115 -0
- package/ReactiveTest/Item.vue +92 -0
- package/ReactiveTest/assets/imageList.js +245 -0
- package/ReactiveTest/component/TestSmartDiv.vue +50 -0
- package/ReactiveTest/component/TestSmartDivSrcList.vue +74 -0
- package/ReactiveTest/component/TestSmartImage.vue +46 -0
- package/ReactiveTest/component/TestSmartImageSrcList.vue +90 -0
- package/ReactiveTest/component/TestSmartImageStyle.vue +41 -0
- package/ReactiveTest/data.js +49 -0
- package/ScreenToBlob/App.vue +250 -0
- package/SecTorTest/App.vue +9 -3
- package/SpringFestival/SpringFestivalScene/FreeMoveBuilder.js +3 -3
- package/SyncDecode/App.vue +137 -0
- package/TextSizeLimit/App.vue +211 -0
- package/TransitPage/App.vue +2 -0
- package/assets/logo.png +0 -0
- package/package.json +5 -5
- package/DemoForOperator/Genie/geniePakcer/Genie.vue +0 -741
- package/DemoForOperator/LongChatBox/TextManager.ts +0 -147
- package/DemoForOperator/LongChatBox/VirtualList.vue +0 -298
- package/DemoForOperator/LongChatBox/utile.js +0 -331
- package/DivMetroPerformance/App.vue +0 -157
- package/DivMetroPerformance/Item.vue +0 -58
- package/DivMetroPerformance/assets/bg.jpg +0 -0
- package/DivMetroPerformance/assets/coupon_content.png +0 -0
- package/DivMetroPerformance/assets/coupon_left.png +0 -0
- package/DivMetroPerformance/assets/coupon_mid.png +0 -0
- package/DivMetroPerformance/assets/coupon_right.png +0 -0
- package/DivMetroPerformance/assets/focus_border.png +0 -0
- package/DivMetroPerformance/assets/holder_logo.png +0 -0
- package/DivMetroPerformance/assets/jrbm.png +0 -0
- package/DivMetroPerformance/assets/line_left.png +0 -0
- package/DivMetroPerformance/assets/line_mid.png +0 -0
- package/DivMetroPerformance/assets/line_right.png +0 -0
- package/DivMetroPerformance/assets/loading.png +0 -0
- package/DivMetroPerformance/assets/logo.png +0 -0
- package/DivMetroPerformance/assets/mcjx.png +0 -0
- package/DivMetroPerformance/assets/tao.png +0 -0
- package/DivMetroPerformance/assets/tmall.png +0 -0
- package/DivMetroPerformance/border.png +0 -0
- package/DivMetroPerformance/components/ContentItem.vue +0 -384
- package/DivMetroPerformance/components/MyTab.vue +0 -129
- package/DivMetroPerformance/data.js +0 -124
- package/DivMetroPerformance/utils/GridItem.vue +0 -28
- package/DivMetroPerformance/utils/GridPlate.vue +0 -85
- package/MediaDemo/App.vue +0 -127
- package/MediaDemo/assets/audio-poster.png +0 -0
- package/MediaDemo/components/Button.vue +0 -69
- package/MediaDemo/components/Controllor.vue +0 -286
- package/MediaDemo/components/StatusBar.vue +0 -100
- package/MediaDemo/components/frames/AudioFrame.vue +0 -39
- package/MediaDemo/components/frames/AudioPoster.vue +0 -48
- package/MediaDemo/components/frames/MediaFrame.vue +0 -153
- package/MediaDemo/components/frames/VideoFrame.vue +0 -39
- package/MetroWidgetDemos/TripleWidget/App.vue +0 -87
- package/MetroWidgetDemos/TripleWidget/SWidgetItem.vue +0 -99
- package/Parkour/App.vue +0 -13
- package/Parkour/Common/Context.js +0 -21
- package/Parkour/Common/MatchmanInfo.js +0 -62
- package/Parkour/Common/Random.js +0 -61
- package/Parkour/Common/Sound.js +0 -50
- package/Parkour/appConfig/HOW_TO_CONFIG.md +0 -20
- package/Parkour/appConfig/app.config.mjs +0 -5
- package/Parkour/appConfig/app_sign_private_key_sample.crt +0 -28
- package/Parkour/appConfig/app_sign_public_key_sample.pem +0 -9
- package/Parkour/appConfig/jsview.config.mjs +0 -39
- package/Parkour/assets/Bgimages/bg1.png +0 -0
- package/Parkour/assets/Bgimages/bg2.png +0 -0
- package/Parkour/assets/Bgimages/bg3.png +0 -0
- package/Parkour/assets/Bgimages/bg4.png +0 -0
- package/Parkour/assets/Bgimages/bg5.png +0 -0
- package/Parkour/assets/audio/jump.mp3 +0 -0
- package/Parkour/assets/audio/lose.mp3 +0 -0
- package/Parkour/assets/role_skin1/fail.json +0 -44
- package/Parkour/assets/role_skin1/fail.png +0 -0
- package/Parkour/assets/role_skin1/jump_down.json +0 -20
- package/Parkour/assets/role_skin1/jump_down.png +0 -0
- package/Parkour/assets/role_skin1/jump_up.json +0 -44
- package/Parkour/assets/role_skin1/jump_up.png +0 -0
- package/Parkour/assets/role_skin1/roll.json +0 -44
- package/Parkour/assets/role_skin1/roll.png +0 -0
- package/Parkour/assets/role_skin1/run.json +0 -52
- package/Parkour/assets/role_skin1/run.png +0 -0
- package/Parkour/components/Backdrop.vue +0 -61
- package/Parkour/components/GameSence.vue +0 -602
- package/Parkour/components/Matchman.vue +0 -85
- package/ThrowMoveDemo/AccelerateDemo.vue +0 -85
- package/ThrowMoveDemo/App.vue +0 -104
- package/ThrowMoveDemo/LRParabolicDemo.vue +0 -101
- package/ThrowMoveDemo/TargetDemo.vue +0 -87
- package/ThrowMoveDemo/UDParabolicDemo.vue +0 -92
- /package/{AnimPicture/assets → assets}/animated_webp.webp +0 -0
- /package/{AnimPicture/assets → assets}/ball_3.webp +0 -0
- /package/{AnimPicture/assets → assets}/girl_run.gif +0 -0
- /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
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|