@jx3box/jx3box-ui 2.0.4 → 2.0.6
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/.storybook/main.js +208 -0
- package/.storybook/preview.js +93 -0
- package/.storybook/storybookMocks.js +191 -0
- package/README.md +29 -82
- package/assets/css/bread/admin.less +20 -2
- package/assets/css/bread/breadcrumb.less +5 -2
- package/assets/css/comment/quick-reply.less +1 -1
- package/assets/css/common/left-sidebar.less +1 -1
- package/assets/css/interact/like2.less +5 -2
- package/assets/css/single/author.less +15 -10
- package/assets/css/single/cms-single.less +1 -0
- package/assets/css/single/thx.less +34 -11
- package/assets/data/nav.json +344 -10
- package/assets/img/comment/comment.svg +1 -1
- package/assets/img/comment/heart_1.svg +1 -1
- package/assets/img/comment/hide.svg +1 -1
- package/assets/img/leftsidebar/medal.svg +1 -1
- package/assets/img/leftsidebar/post.svg +27 -46
- package/i18n/messages/en-US.js +357 -22
- package/i18n/messages/vi.js +350 -22
- package/i18n/messages/zh-CN.js +469 -20
- package/i18n/messages/zh-TW.js +350 -22
- package/index.js +19 -7
- package/package.json +15 -5
- package/service/cms.js +22 -0
- package/service/commit-history.js +18 -0
- package/service/community.js +60 -0
- package/service/fav.js +5 -6
- package/src/App.vue +154 -80
- package/src/Breadcrumb.vue +24 -11
- package/src/CommonFooter.vue +4 -4
- package/src/Footer.vue +13 -5
- package/src/LeftSideToggle.vue +10 -3
- package/src/LeftSidebar.vue +19 -5
- package/src/Main.vue +9 -2
- package/src/RightSidebar.vue +12 -3
- package/src/SuspendCommon.vue +52 -38
- package/src/author/AuthorFans.vue +7 -5
- package/src/author/AuthorFollow.vue +14 -7
- package/src/author/AuthorGift.vue +25 -17
- package/src/author/AuthorInfo.vue +46 -19
- package/src/author/AuthorLink.vue +3 -1
- package/src/author/AuthorMedals.vue +5 -2
- package/src/author/AuthorPosts.vue +31 -13
- package/src/author/AuthorRss.vue +7 -3
- package/src/author/AuthorTeams.vue +3 -1
- package/src/author/UserPop.vue +29 -17
- package/src/bread/Admin.vue +55 -32
- package/src/bread/AdminDirectMessage.vue +15 -8
- package/src/bread/AdminDrop.vue +124 -45
- package/src/bread/CommunityAdmin.vue +527 -0
- package/src/bread/DesignTask.vue +30 -26
- package/src/bread/ListAdmin.vue +199 -0
- package/src/bread/MigrateCommunity.vue +192 -0
- package/src/bread/MoveToCommunityDialog.vue +234 -0
- package/src/comment/Avatar.vue +18 -24
- package/src/comment/CommentContent.vue +57 -37
- package/src/comment/CommentContentSimple.vue +61 -63
- package/src/comment/CommentInputForm.vue +45 -34
- package/src/comment/CommentWithReply.vue +9 -6
- package/src/comment/QuickReply.vue +5 -1
- package/src/comment/ReplyForReply.vue +6 -4
- package/src/comment/ReplyList.vue +28 -18
- package/src/comment/Upload.vue +24 -6
- package/src/filters/clientBy.vue +10 -8
- package/src/filters/markBy.vue +35 -31
- package/src/filters/menuBy.vue +20 -22
- package/src/filters/orderBy.vue +17 -11
- package/src/filters/tagBy.vue +4 -2
- package/src/filters/topicBy.vue +12 -10
- package/src/filters/versionBy.vue +5 -3
- package/src/filters/zlpBy.vue +29 -25
- package/src/footer/copyright.vue +5 -5
- package/src/footer/links.vue +2 -2
- package/src/footer/official.vue +1 -1
- package/src/footer/resource.vue +41 -8
- package/src/header/alternate.vue +35 -18
- package/src/header/asset.vue +9 -19
- package/src/header/box.vue +20 -8
- package/src/header/box2.vue +25 -13
- package/src/header/client.vue +7 -7
- package/src/header/lang.vue +41 -6
- package/src/header/logo.vue +2 -3
- package/src/header/manage.vue +2 -2
- package/src/header/message.vue +3 -3
- package/src/header/nav.vue +26 -23
- package/src/header/publish.vue +2 -2
- package/src/header/search.vue +2 -2
- package/src/header/shop.vue +2 -2
- package/src/header/user.vue +4 -4
- package/src/header/userInfo.vue +22 -24
- package/src/header/vip.vue +2 -2
- package/src/interact/BoxcoinAdmin.vue +30 -16
- package/src/interact/BoxcoinRecords.vue +28 -11
- package/src/interact/BoxcoinUser.vue +33 -17
- package/src/interact/Fav.vue +5 -1
- package/src/interact/Homework.vue +318 -0
- package/src/interact/Like.vue +4 -2
- package/src/interact/Rss.vue +10 -4
- package/src/interact/Share.vue +18 -19
- package/src/interact/WatchLater.vue +5 -1
- package/src/main.js +1 -0
- package/src/single/Author.vue +5 -1
- package/src/single/CmsSingle.vue +29 -15
- package/src/single/Collection.vue +36 -26
- package/src/single/Comment.vue +19 -13
- package/src/single/Creators.vue +5 -3
- package/src/single/PostCollection.vue +158 -0
- package/src/single/PostDirectory.vue +0 -126
- package/src/single/PostGuide.vue +93 -0
- package/src/single/PostHeader.vue +39 -17
- package/src/single/PostTopic.vue +3 -3
- package/src/single/PostVersion.vue +219 -0
- package/src/single/RightAffix.vue +160 -0
- package/src/single/SimpleThx.vue +4 -2
- package/src/single/Thx.vue +14 -2
- package/src/single/VersionDialog.vue +238 -0
- package/src/stories/components/StoryPropsTable.vue +137 -0
- package/src/stories/filters/FilterGallery.stories.js +110 -0
- package/src/stories/filters/clientBy.stories.js +24 -0
- package/src/stories/filters/markBy.stories.js +6 -0
- package/src/stories/filters/menuBy.stories.js +6 -0
- package/src/stories/filters/orderBy.stories.js +6 -0
- package/src/stories/filters/tagBy.stories.js +6 -0
- package/src/stories/filters/topicBy.stories.js +6 -0
- package/src/stories/filters/versionBy.stories.js +6 -0
- package/src/stories/filters/zlpBy.stories.js +6 -0
- package/src/stories/layout/BaseShell.stories.js +38 -0
- package/src/stories/layout/Breadcrumb.stories.js +40 -0
- package/src/stories/layout/CommonFooter.stories.js +22 -0
- package/src/stories/layout/CommonHeader.stories.js +39 -0
- package/src/stories/layout/LeftSideToggle.stories.js +78 -0
- package/src/stories/layout/LeftSidebar.stories.js +40 -0
- package/src/stories/layout/Main.stories.js +41 -0
- package/src/stories/layout/RightSidebar.stories.js +36 -0
- package/src/stories/layout/StorybookShell.vue +271 -0
- package/src/stories/layout/SuspendCommon.stories.js +67 -0
- package/src/stories/layout/SuspendCommonStage.vue +143 -0
- package/src/stories/mockData.js +275 -0
- package/src/stories/other/UserPop.stories.js +51 -0
- package/src/stories/single/Author.stories.js +19 -0
- package/src/stories/single/AuthorStoryStage.vue +103 -0
- package/src/stories/single/CmsSingle.stories.js +19 -0
- package/src/stories/single/CmsSingleStoryStage.vue +118 -0
- package/src/stories/single/Collection.stories.js +34 -0
- package/src/stories/single/Comment.stories.js +36 -0
- package/src/stories/single/Creators.stories.js +34 -0
- package/src/stories/single/PostCollection.stories.js +34 -0
- package/src/stories/single/PostDirectory.stories.js +31 -0
- package/src/stories/single/PostGuide.stories.js +47 -0
- package/src/stories/single/PostHeader.stories.js +39 -0
- package/src/stories/single/PostVersion.stories.js +41 -0
- package/src/stories/single/RightAffix.stories.js +84 -0
- package/src/stories/single/SimpleThx.stories.js +39 -0
- package/src/stories/single/SingleGallery.stories.js +207 -0
- package/src/stories/single/Thx.stories.js +38 -0
- package/vue.config.js +2 -12
- package/assets/css/common/bottom.less +0 -25
- package/assets/css/editor/article.less +0 -36
- package/assets/css/editor/combo.less +0 -362
- package/assets/css/editor/resource.less +0 -399
- package/assets/css/editor/tinymce.less +0 -100
- package/assets/css/editor/upload.less +0 -136
- package/assets/css/module/author.less +0 -231
- package/assets/css/module/buff.less +0 -88
- package/assets/css/module/directory.less +0 -165
- package/assets/css/module/icon.less +0 -25
- package/assets/css/module/item.less +0 -279
- package/assets/css/module/item_simple.less +0 -58
- package/assets/css/module/jx3_element.less +0 -5
- package/assets/css/module/macro.less +0 -89
- package/assets/css/module/npc.less +0 -265
- package/assets/css/module/resource.less +0 -93
- package/assets/css/module/skill.less +0 -74
- package/assets/css/module/talent.less +0 -495
- package/assets/js/a.js +0 -46
- package/assets/js/code.js +0 -13
- package/assets/js/combo.js +0 -40
- package/assets/js/directory.js +0 -114
- package/assets/js/filter2.js +0 -186
- package/assets/js/fold.js +0 -11
- package/assets/js/gallery.js +0 -14
- package/assets/js/hljs_languages.js +0 -177
- package/assets/js/iframe.js +0 -38
- package/assets/js/img.js +0 -23
- package/assets/js/item/attribute_percent.js +0 -88
- package/assets/js/item/bind.js +0 -18
- package/assets/js/item/border.js +0 -19
- package/assets/js/item/border_quest.js +0 -12
- package/assets/js/item/color.js +0 -25
- package/assets/js/item/hljs_languages.js +0 -177
- package/assets/js/item/icon_url.js +0 -15
- package/assets/js/item/second_format.js +0 -19
- package/assets/js/jx3_element.js +0 -73
- package/assets/js/katex.js +0 -181
- package/assets/js/macro.js +0 -16
- package/assets/js/nextpage.js +0 -4
- package/assets/js/pswp.js +0 -67
- package/assets/js/pswp_template.js +0 -66
- package/assets/js/pz_iframe.js +0 -30
- package/assets/js/qixue.js +0 -28
- package/assets/js/renderImgPreview.js +0 -18
- package/assets/js/script.js +0 -6
- package/assets/js/stat.js +0 -107
- package/assets/js/talent2.js +0 -21
- package/assets/js/tex-mml-chtml.js +0 -36310
- package/assets/js/voice.js +0 -238
- package/assets/js/xss.js +0 -130
- package/src/editor/Article.vue +0 -230
- package/src/editor/BoxResource.vue +0 -441
- package/src/editor/Resource.vue +0 -623
- package/src/editor/Tinymce.vue +0 -204
- package/src/editor/Upload.vue +0 -277
- package/src/editor/UploadAlum.vue +0 -176
- package/src/editor/UploadBanner.vue +0 -156
- package/src/editor/components/Author.vue +0 -322
- package/src/editor/components/Avatar.vue +0 -95
- package/src/editor/components/Buff.vue +0 -80
- package/src/editor/components/Combo.vue +0 -259
- package/src/editor/components/Equip.vue +0 -299
- package/src/editor/components/GameText.vue +0 -242
- package/src/editor/components/Item.vue +0 -325
- package/src/editor/components/ItemSimple.vue +0 -134
- package/src/editor/components/Medal.vue +0 -43
- package/src/editor/components/Npc.vue +0 -215
- package/src/editor/components/PostAuthor.vue +0 -102
- package/src/editor/components/Skill.vue +0 -71
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="story-cmssingle-stage">
|
|
3
|
+
<section class="story-cmssingle-stage__panel">
|
|
4
|
+
<div class="story-cmssingle-stage__preview">
|
|
5
|
+
<CmsSingle :post="mockPost" :stat="mockStat" :show-thx="false" />
|
|
6
|
+
</div>
|
|
7
|
+
</section>
|
|
8
|
+
<section class="story-cmssingle-stage__props">
|
|
9
|
+
<StoryPropsTable title="CmsSingle" description="单页详情整合容器。" :items="propsInfo" />
|
|
10
|
+
</section>
|
|
11
|
+
</div>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script>
|
|
15
|
+
import CmsSingle from "../../single/CmsSingle.vue";
|
|
16
|
+
import StoryPropsTable from "../components/StoryPropsTable.vue";
|
|
17
|
+
import { mockPost, mockStat } from "../mockData";
|
|
18
|
+
|
|
19
|
+
export default {
|
|
20
|
+
name: "CmsSingleStoryStage",
|
|
21
|
+
components: {
|
|
22
|
+
CmsSingle,
|
|
23
|
+
StoryPropsTable,
|
|
24
|
+
},
|
|
25
|
+
data: function () {
|
|
26
|
+
return {
|
|
27
|
+
mockPost,
|
|
28
|
+
mockStat,
|
|
29
|
+
propsInfo: [
|
|
30
|
+
{ name: "post", type: "Object", default: "{}", required: true, description: "完整文章数据对象。" },
|
|
31
|
+
{ name: "stat", type: "Object", default: "{}", description: "统计信息对象。" },
|
|
32
|
+
{ name: "showThx", type: "Boolean", default: "true", description: "是否展示打赏互动区。" },
|
|
33
|
+
],
|
|
34
|
+
};
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
</script>
|
|
38
|
+
|
|
39
|
+
<style lang="less">
|
|
40
|
+
.story-cmssingle-stage {
|
|
41
|
+
display: grid;
|
|
42
|
+
gap: 24px;
|
|
43
|
+
justify-items: center;
|
|
44
|
+
padding: 12px 0 0;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.story-cmssingle-stage__panel,
|
|
48
|
+
.story-cmssingle-stage__props {
|
|
49
|
+
width: min(100%, 1120px);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.story-cmssingle-stage__preview,
|
|
53
|
+
.story-cmssingle-stage__props .story-props-table {
|
|
54
|
+
border-radius: 20px;
|
|
55
|
+
background: rgba(255, 255, 255, 0.92);
|
|
56
|
+
box-shadow: 0 24px 60px rgba(15, 23, 42, 0.08);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.story-cmssingle-stage__preview {
|
|
60
|
+
padding: 24px 32px 32px;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.story-cmssingle-stage__preview .m-single-box {
|
|
64
|
+
max-width: 100%;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.story-cmssingle-stage__preview .m-single-info svg,
|
|
68
|
+
.story-cmssingle-stage__preview .m-single-info img,
|
|
69
|
+
.story-cmssingle-stage__preview .w-creators img,
|
|
70
|
+
.story-cmssingle-stage__preview .w-collection svg,
|
|
71
|
+
.story-cmssingle-stage__preview .w-thx-panel svg,
|
|
72
|
+
.story-cmssingle-stage__preview .w-thx-panel img,
|
|
73
|
+
.story-cmssingle-stage__preview .w-boxcoin-records svg,
|
|
74
|
+
.story-cmssingle-stage__preview .w-boxcoin-records img,
|
|
75
|
+
.story-cmssingle-stage__preview .m-comment-box svg,
|
|
76
|
+
.story-cmssingle-stage__preview .m-comment-box img {
|
|
77
|
+
max-width: none;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.story-cmssingle-stage__preview .m-single-info .u-author svg,
|
|
81
|
+
.story-cmssingle-stage__preview .m-single-info .u-icon-podate svg,
|
|
82
|
+
.story-cmssingle-stage__preview .m-single-info .u-icon-modate svg {
|
|
83
|
+
width: 16px;
|
|
84
|
+
height: 16px;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.story-cmssingle-stage__preview .w-creators .u-avatar,
|
|
88
|
+
.story-cmssingle-stage__preview .w-boxcoin-records .u-user-avatar,
|
|
89
|
+
.story-cmssingle-stage__preview .m-comment-box .u-avatar img {
|
|
90
|
+
width: 48px;
|
|
91
|
+
height: 48px;
|
|
92
|
+
object-fit: cover;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.story-cmssingle-stage__preview .w-collection .el-icon,
|
|
96
|
+
.story-cmssingle-stage__preview .w-thx-panel .u-icon,
|
|
97
|
+
.story-cmssingle-stage__preview .w-thx-panel .el-icon,
|
|
98
|
+
.story-cmssingle-stage__preview .w-boxcoin-records .el-icon,
|
|
99
|
+
.story-cmssingle-stage__preview .m-comment-box .el-icon {
|
|
100
|
+
width: 16px;
|
|
101
|
+
height: 16px;
|
|
102
|
+
font-size: 16px;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.story-cmssingle-stage__preview .w-thx-panel .u-icon {
|
|
106
|
+
width: 26px;
|
|
107
|
+
height: 26px;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.story-cmssingle-stage__props {
|
|
111
|
+
display: flex;
|
|
112
|
+
justify-content: center;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.story-cmssingle-stage__props .story-props-table {
|
|
116
|
+
width: min(100%, 820px);
|
|
117
|
+
}
|
|
118
|
+
</style>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import Collection from '../../single/Collection.vue';
|
|
2
|
+
import StoryPropsTable from '../components/StoryPropsTable.vue';
|
|
3
|
+
|
|
4
|
+
const meta = {
|
|
5
|
+
title: 'Single/Collection',
|
|
6
|
+
component: Collection,
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: 'fullscreen',
|
|
9
|
+
},
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export default meta;
|
|
13
|
+
|
|
14
|
+
export const Default = {
|
|
15
|
+
render: () => ({
|
|
16
|
+
components: { Collection, StoryPropsTable },
|
|
17
|
+
setup() {
|
|
18
|
+
return {
|
|
19
|
+
propsInfo: [
|
|
20
|
+
{ name: 'id', type: 'Number | String', default: '0', required: true, description: '小册 ID。' },
|
|
21
|
+
{ name: 'defaultVisible', type: 'Boolean', default: 'false', description: '默认是否展开。' },
|
|
22
|
+
],
|
|
23
|
+
};
|
|
24
|
+
},
|
|
25
|
+
template: `
|
|
26
|
+
<div style="display:grid;gap:24px;">
|
|
27
|
+
<section style="border-radius:20px;background:rgba(255,255,255,0.92);padding:24px;box-shadow:0 24px 60px rgba(15,23,42,0.08);">
|
|
28
|
+
<Collection :id="1" :default-visible="true" />
|
|
29
|
+
</section>
|
|
30
|
+
<StoryPropsTable title="Collection" description="文章所属小册展示。" :items="propsInfo" />
|
|
31
|
+
</div>
|
|
32
|
+
`,
|
|
33
|
+
}),
|
|
34
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import Comment from '../../single/Comment.vue';
|
|
2
|
+
import StoryPropsTable from '../components/StoryPropsTable.vue';
|
|
3
|
+
|
|
4
|
+
const meta = {
|
|
5
|
+
title: 'Single/Comment',
|
|
6
|
+
component: Comment,
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: 'fullscreen',
|
|
9
|
+
},
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export default meta;
|
|
13
|
+
|
|
14
|
+
export const Default = {
|
|
15
|
+
render: () => ({
|
|
16
|
+
components: { Comment, StoryPropsTable },
|
|
17
|
+
setup() {
|
|
18
|
+
return {
|
|
19
|
+
propsInfo: [
|
|
20
|
+
{ name: 'id', type: 'Number | String', default: '0', required: true, description: '评论目标 ID。' },
|
|
21
|
+
{ name: 'category', type: 'String', default: '""', required: true, description: '评论分类,例如 post。' },
|
|
22
|
+
{ name: 'normal', type: 'Boolean', default: 'true', description: '普通评论模式。' },
|
|
23
|
+
{ name: 'order', type: 'String', default: '""', description: '初始排序模式。' },
|
|
24
|
+
],
|
|
25
|
+
};
|
|
26
|
+
},
|
|
27
|
+
template: `
|
|
28
|
+
<div style="display:grid;gap:24px;">
|
|
29
|
+
<section style="border-radius:20px;background:rgba(255,255,255,0.92);padding:24px;box-shadow:0 24px 60px rgba(15,23,42,0.08);">
|
|
30
|
+
<Comment category="post" :id="80449" />
|
|
31
|
+
</section>
|
|
32
|
+
<StoryPropsTable title="Comment" description="评论列表与输入组件。" :items="propsInfo" />
|
|
33
|
+
</div>
|
|
34
|
+
`,
|
|
35
|
+
}),
|
|
36
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import Creators from '../../single/Creators.vue';
|
|
2
|
+
import StoryPropsTable from '../components/StoryPropsTable.vue';
|
|
3
|
+
|
|
4
|
+
const meta = {
|
|
5
|
+
title: 'Single/Creators',
|
|
6
|
+
component: Creators,
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: 'fullscreen',
|
|
9
|
+
},
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export default meta;
|
|
13
|
+
|
|
14
|
+
export const Default = {
|
|
15
|
+
render: () => ({
|
|
16
|
+
components: { Creators, StoryPropsTable },
|
|
17
|
+
setup() {
|
|
18
|
+
return {
|
|
19
|
+
propsInfo: [
|
|
20
|
+
{ name: 'postId', type: 'Number | String', default: '0', required: true, description: '当前文章 ID。' },
|
|
21
|
+
{ name: 'postType', type: 'String', default: '""', required: true, description: '文章类型,用于生成编辑链接。' },
|
|
22
|
+
],
|
|
23
|
+
};
|
|
24
|
+
},
|
|
25
|
+
template: `
|
|
26
|
+
<div style="display:grid;gap:24px;">
|
|
27
|
+
<section style="border-radius:20px;background:rgba(255,255,255,0.92);padding:24px;box-shadow:0 24px 60px rgba(15,23,42,0.08);">
|
|
28
|
+
<Creators :post-id="80449" post-type="bbs" />
|
|
29
|
+
</section>
|
|
30
|
+
<StoryPropsTable title="Creators" description="联合创作者展示组件。" :items="propsInfo" />
|
|
31
|
+
</div>
|
|
32
|
+
`,
|
|
33
|
+
}),
|
|
34
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import PostCollection from '../../single/PostCollection.vue';
|
|
2
|
+
import StoryPropsTable from '../components/StoryPropsTable.vue';
|
|
3
|
+
|
|
4
|
+
const meta = {
|
|
5
|
+
title: 'Single/PostCollection',
|
|
6
|
+
component: PostCollection,
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: 'fullscreen',
|
|
9
|
+
},
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export default meta;
|
|
13
|
+
|
|
14
|
+
export const Default = {
|
|
15
|
+
render: () => ({
|
|
16
|
+
components: { PostCollection, StoryPropsTable },
|
|
17
|
+
setup() {
|
|
18
|
+
return {
|
|
19
|
+
propsInfo: [
|
|
20
|
+
{ name: 'id', type: 'Number | String', default: '0', description: '关联小册 ID,组件会自动请求列表。' },
|
|
21
|
+
{ name: 'store', type: 'Object', default: 'null', description: '可直接传入包含 posts 的对象,跳过请求。' },
|
|
22
|
+
],
|
|
23
|
+
};
|
|
24
|
+
},
|
|
25
|
+
template: `
|
|
26
|
+
<div style="display:grid;gap:24px;">
|
|
27
|
+
<section style="border-radius:20px;background:rgba(255,255,255,0.92);padding:24px;box-shadow:0 24px 60px rgba(15,23,42,0.08);">
|
|
28
|
+
<PostCollection :id="1" />
|
|
29
|
+
</section>
|
|
30
|
+
<StoryPropsTable title="PostCollection" description="文章关联内容列表,通常用于右侧辅助阅读区域。" :items="propsInfo" />
|
|
31
|
+
</div>
|
|
32
|
+
`,
|
|
33
|
+
}),
|
|
34
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import PostDirectory from '../../single/PostDirectory.vue';
|
|
2
|
+
import StoryPropsTable from '../components/StoryPropsTable.vue';
|
|
3
|
+
|
|
4
|
+
const meta = {
|
|
5
|
+
title: 'Single/PostDirectory',
|
|
6
|
+
component: PostDirectory,
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: 'fullscreen',
|
|
9
|
+
},
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export default meta;
|
|
13
|
+
|
|
14
|
+
export const Default = {
|
|
15
|
+
render: () => ({
|
|
16
|
+
components: { PostDirectory, StoryPropsTable },
|
|
17
|
+
template: `
|
|
18
|
+
<div style="display:grid;gap:24px;">
|
|
19
|
+
<section style="border-radius:20px;background:rgba(255,255,255,0.92);padding:20px;box-shadow:0 24px 60px rgba(15,23,42,0.08);">
|
|
20
|
+
<PostDirectory />
|
|
21
|
+
<div class="c-article-directory" style="margin-top:12px;">
|
|
22
|
+
<h2>版本概览</h2>
|
|
23
|
+
<h3 class="lv2">核心思路</h3>
|
|
24
|
+
<h3 class="lv2">配装建议</h3>
|
|
25
|
+
</div>
|
|
26
|
+
</section>
|
|
27
|
+
<StoryPropsTable title="PostDirectory" description="当前组件本身无 props,主要配合正文目录渲染结果使用。" :items="[]" />
|
|
28
|
+
</div>
|
|
29
|
+
`,
|
|
30
|
+
}),
|
|
31
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import PostGuide from '../../single/PostGuide.vue';
|
|
2
|
+
import StoryPropsTable from '../components/StoryPropsTable.vue';
|
|
3
|
+
|
|
4
|
+
const mockGuidePost = {
|
|
5
|
+
prev_post: {
|
|
6
|
+
ID: 80440,
|
|
7
|
+
post_type: 'bbs',
|
|
8
|
+
post_title: '上一期:配装思路回顾',
|
|
9
|
+
},
|
|
10
|
+
next_post: {
|
|
11
|
+
ID: 80460,
|
|
12
|
+
post_type: 'bbs',
|
|
13
|
+
post_title: '下一期:实战循环拆解',
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const meta = {
|
|
18
|
+
title: 'Single/PostGuide',
|
|
19
|
+
component: PostGuide,
|
|
20
|
+
parameters: {
|
|
21
|
+
layout: 'fullscreen',
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export default meta;
|
|
26
|
+
|
|
27
|
+
export const Default = {
|
|
28
|
+
render: () => ({
|
|
29
|
+
components: { PostGuide, StoryPropsTable },
|
|
30
|
+
setup() {
|
|
31
|
+
return {
|
|
32
|
+
mockGuidePost,
|
|
33
|
+
propsInfo: [
|
|
34
|
+
{ name: 'post', type: 'Object', default: '{}', description: '包含 prev_post / next_post 的文章导航数据。' },
|
|
35
|
+
],
|
|
36
|
+
};
|
|
37
|
+
},
|
|
38
|
+
template: `
|
|
39
|
+
<div style="display:grid;gap:24px;">
|
|
40
|
+
<section style="border-radius:20px;background:rgba(255,255,255,0.92);padding:24px;box-shadow:0 24px 60px rgba(15,23,42,0.08);">
|
|
41
|
+
<PostGuide :post="mockGuidePost" />
|
|
42
|
+
</section>
|
|
43
|
+
<StoryPropsTable title="PostGuide" description="文章底部上一篇 / 下一篇导航。" :items="propsInfo" />
|
|
44
|
+
</div>
|
|
45
|
+
`,
|
|
46
|
+
}),
|
|
47
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import PostHeader from '../../single/PostHeader.vue';
|
|
2
|
+
import StoryPropsTable from '../components/StoryPropsTable.vue';
|
|
3
|
+
import { mockPost, mockStat } from '../mockData';
|
|
4
|
+
|
|
5
|
+
const meta = {
|
|
6
|
+
title: 'Single/PostHeader',
|
|
7
|
+
component: PostHeader,
|
|
8
|
+
parameters: {
|
|
9
|
+
layout: 'fullscreen',
|
|
10
|
+
},
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export default meta;
|
|
14
|
+
|
|
15
|
+
export const Default = {
|
|
16
|
+
render: () => ({
|
|
17
|
+
components: { PostHeader, StoryPropsTable },
|
|
18
|
+
setup() {
|
|
19
|
+
return {
|
|
20
|
+
mockPost,
|
|
21
|
+
mockStat,
|
|
22
|
+
propsInfo: [
|
|
23
|
+
{ name: 'post', type: 'Object', default: '{}', required: true, description: '文章标题、作者、客户端、时间等来源。' },
|
|
24
|
+
{ name: 'stat', type: 'Object', default: '{}', description: '统计信息,常用为 views。' },
|
|
25
|
+
{ name: 'titleExtra', type: 'String', default: '""', description: '是否展示额外标签区域。' },
|
|
26
|
+
{ name: 'anonymous', type: 'Boolean', default: 'false', description: '匿名展示作者。' },
|
|
27
|
+
],
|
|
28
|
+
};
|
|
29
|
+
},
|
|
30
|
+
template: `
|
|
31
|
+
<div style="display:grid;gap:24px;">
|
|
32
|
+
<section style="border-radius:20px;background:rgba(255,255,255,0.92);padding:24px;box-shadow:0 24px 60px rgba(15,23,42,0.08);">
|
|
33
|
+
<PostHeader :post="mockPost" :stat="mockStat" title-extra="1" />
|
|
34
|
+
</section>
|
|
35
|
+
<StoryPropsTable title="PostHeader" description="单页顶部信息栏。" :items="propsInfo" />
|
|
36
|
+
</div>
|
|
37
|
+
`,
|
|
38
|
+
}),
|
|
39
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import PostVersion from '../../single/PostVersion.vue';
|
|
2
|
+
import StoryPropsTable from '../components/StoryPropsTable.vue';
|
|
3
|
+
import { mockPost } from '../mockData';
|
|
4
|
+
|
|
5
|
+
const meta = {
|
|
6
|
+
title: 'Single/PostVersion',
|
|
7
|
+
component: PostVersion,
|
|
8
|
+
parameters: {
|
|
9
|
+
layout: 'fullscreen',
|
|
10
|
+
},
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export default meta;
|
|
14
|
+
|
|
15
|
+
export const Default = {
|
|
16
|
+
render: () => ({
|
|
17
|
+
components: { PostVersion, StoryPropsTable },
|
|
18
|
+
setup() {
|
|
19
|
+
return {
|
|
20
|
+
storyPost: {
|
|
21
|
+
...mockPost,
|
|
22
|
+
link_content_meta_id: 501,
|
|
23
|
+
},
|
|
24
|
+
propsInfo: [
|
|
25
|
+
{ name: 'post', type: 'Object', default: '{}', required: true, description: '包含标题、正文和 `link_content_meta_id` 的文章对象。' },
|
|
26
|
+
],
|
|
27
|
+
};
|
|
28
|
+
},
|
|
29
|
+
template: `
|
|
30
|
+
<div style="display:grid;gap:24px;">
|
|
31
|
+
<section style="border-radius:20px;background:rgba(255,255,255,0.92);padding:24px;box-shadow:0 24px 60px rgba(15,23,42,0.08);">
|
|
32
|
+
<div style="margin-bottom:16px;color:#475569;line-height:1.8;">
|
|
33
|
+
该 story 已接入 mock 历史版本数据。点击“对比”可直接打开版本差异弹窗。
|
|
34
|
+
</div>
|
|
35
|
+
<PostVersion :post="storyPost" />
|
|
36
|
+
</section>
|
|
37
|
+
<StoryPropsTable title="PostVersion" description="文章历史版本列表与对比弹窗。" :items="propsInfo" />
|
|
38
|
+
</div>
|
|
39
|
+
`,
|
|
40
|
+
}),
|
|
41
|
+
};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { onMounted, onBeforeUnmount, ref } from 'vue';
|
|
2
|
+
import RightAffix from '../../single/RightAffix.vue';
|
|
3
|
+
import StoryPropsTable from '../components/StoryPropsTable.vue';
|
|
4
|
+
import Bus from '../../../utils/bus';
|
|
5
|
+
|
|
6
|
+
const meta = {
|
|
7
|
+
title: 'Single/RightAffix',
|
|
8
|
+
component: RightAffix,
|
|
9
|
+
parameters: {
|
|
10
|
+
layout: 'fullscreen',
|
|
11
|
+
},
|
|
12
|
+
argTypes: {
|
|
13
|
+
postId: { control: 'number' },
|
|
14
|
+
postType: { control: 'text' },
|
|
15
|
+
postTitle: { control: 'text' },
|
|
16
|
+
showComment: { control: 'boolean' },
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export default meta;
|
|
21
|
+
|
|
22
|
+
export const Default = {
|
|
23
|
+
args: {
|
|
24
|
+
postId: 80449,
|
|
25
|
+
postType: 'bbs',
|
|
26
|
+
postTitle: '轻剑驭风版本攻略示例',
|
|
27
|
+
showComment: true,
|
|
28
|
+
},
|
|
29
|
+
render: (args) => ({
|
|
30
|
+
components: { RightAffix, StoryPropsTable },
|
|
31
|
+
setup() {
|
|
32
|
+
const commentCount = ref(0);
|
|
33
|
+
|
|
34
|
+
const onToComment = () => {
|
|
35
|
+
commentCount.value += 1;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
const openAffix = () => Bus.emit('toggleRightSide', true);
|
|
39
|
+
const closeAffix = () => Bus.emit('toggleRightSide', false);
|
|
40
|
+
|
|
41
|
+
onMounted(() => {
|
|
42
|
+
// 触发一次滚动事件,方便在 Storybook 中更容易观察“回到顶部”按钮
|
|
43
|
+
window.scrollTo({ top: 1200 });
|
|
44
|
+
window.dispatchEvent(new Event('scroll'));
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
onBeforeUnmount(() => {
|
|
48
|
+
window.scrollTo({ top: 0 });
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
return {
|
|
52
|
+
args,
|
|
53
|
+
commentCount,
|
|
54
|
+
onToComment,
|
|
55
|
+
openAffix,
|
|
56
|
+
closeAffix,
|
|
57
|
+
propsInfo: [
|
|
58
|
+
{ name: 'postId', type: 'String | Number', default: '""', description: '当前文章 ID,用于收藏查询。' },
|
|
59
|
+
{ name: 'postType', type: 'String', default: '""', description: '文章类型,例如 bbs / pvx。' },
|
|
60
|
+
{ name: 'postTitle', type: 'String', default: '""', description: '文章标题,用于收藏请求。' },
|
|
61
|
+
{ name: 'showComment', type: 'Boolean | Number', default: 'false', description: '是否展示评论入口按钮。' },
|
|
62
|
+
],
|
|
63
|
+
};
|
|
64
|
+
},
|
|
65
|
+
template: `
|
|
66
|
+
<div style="display:grid;gap:24px;">
|
|
67
|
+
<section style="position:relative;min-height:180vh;border-radius:20px;background:linear-gradient(180deg,#f8fafc 0%,#eef2ff 100%);padding:24px;box-shadow:0 24px 60px rgba(15,23,42,0.08);">
|
|
68
|
+
<div style="max-width:760px;color:#334155;line-height:1.8;">
|
|
69
|
+
<h3 style="margin:0 0 12px;font-size:22px;color:#0f172a;">RightAffix 交互舞台</h3>
|
|
70
|
+
<p style="margin:0 0 10px;">该组件固定在右侧,包含收藏、评论入口和回到顶部。你可以通过下方按钮模拟右栏展开/收起。</p>
|
|
71
|
+
<p style="margin:0;">评论按钮点击次数:<strong>{{ commentCount }}</strong></p>
|
|
72
|
+
<div style="display:flex;gap:12px;margin-top:16px;">
|
|
73
|
+
<button type="button" class="el-button el-button--primary el-button--small" @click="openAffix">展开</button>
|
|
74
|
+
<button type="button" class="el-button el-button--small is-plain" @click="closeAffix">收起</button>
|
|
75
|
+
</div>
|
|
76
|
+
</div>
|
|
77
|
+
|
|
78
|
+
<RightAffix v-bind="args" @toComment="onToComment" />
|
|
79
|
+
</section>
|
|
80
|
+
<StoryPropsTable title="RightAffix" description="单页右侧悬浮交互区,依赖收藏组件与滚动状态。" :items="propsInfo" />
|
|
81
|
+
</div>
|
|
82
|
+
`,
|
|
83
|
+
}),
|
|
84
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import SimpleThx from '../../single/SimpleThx.vue';
|
|
2
|
+
import StoryPropsTable from '../components/StoryPropsTable.vue';
|
|
3
|
+
|
|
4
|
+
const meta = {
|
|
5
|
+
title: 'Single/SimpleThx',
|
|
6
|
+
component: SimpleThx,
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: 'fullscreen',
|
|
9
|
+
},
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export default meta;
|
|
13
|
+
|
|
14
|
+
export const Default = {
|
|
15
|
+
render: () => ({
|
|
16
|
+
components: { SimpleThx, StoryPropsTable },
|
|
17
|
+
setup() {
|
|
18
|
+
return {
|
|
19
|
+
presetConfig: { admin_max: 1000, admin_min: 10, admin_points: [10, 50, 100], admin_left: 4800, admin_total: 10000, user_points: [10, 20, 50], user_left: 820, boxcoin_enable: 1 },
|
|
20
|
+
propsInfo: [
|
|
21
|
+
{ name: 'postId', type: 'Number | String', default: '0', required: true, description: '文章 ID。' },
|
|
22
|
+
{ name: 'postType', type: 'String', default: '""', required: true, description: '文章类型。' },
|
|
23
|
+
{ name: 'postTitle', type: 'String', default: '""', description: '文章标题。' },
|
|
24
|
+
{ name: 'userId', type: 'Number | String', default: '0', description: '作者 UID。' },
|
|
25
|
+
{ name: 'adminBoxcoinEnable / userBoxcoinEnable', type: 'Boolean', default: 'false', description: '控制打赏区显示。' },
|
|
26
|
+
{ name: 'presetConfig', type: 'Object', default: '{}', description: 'Storybook 下可直接注入打赏配置,避免空态。' },
|
|
27
|
+
],
|
|
28
|
+
};
|
|
29
|
+
},
|
|
30
|
+
template: `
|
|
31
|
+
<div style="display:grid;gap:24px;">
|
|
32
|
+
<section style="border-radius:20px;background:rgba(255,255,255,0.92);padding:24px;box-shadow:0 24px 60px rgba(15,23,42,0.08);">
|
|
33
|
+
<SimpleThx post-type="bbs" post-title="轻剑驭风版本攻略示例" :post-id="80449" :user-id="8" :admin-boxcoin-enable="true" :user-boxcoin-enable="true" :allow-gift="true" :preset-config="presetConfig" />
|
|
34
|
+
</section>
|
|
35
|
+
<StoryPropsTable title="SimpleThx" description="简化互动条组件。" :items="propsInfo" />
|
|
36
|
+
</div>
|
|
37
|
+
`,
|
|
38
|
+
}),
|
|
39
|
+
};
|