@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,39 @@
|
|
|
1
|
+
import CommonHeader from '../../CommonHeader.vue';
|
|
2
|
+
|
|
3
|
+
const meta = {
|
|
4
|
+
title: 'Layout/CommonHeader',
|
|
5
|
+
component: CommonHeader,
|
|
6
|
+
parameters: {
|
|
7
|
+
layout: 'fullscreen',
|
|
8
|
+
},
|
|
9
|
+
argTypes: {
|
|
10
|
+
overlayEnable: { control: 'boolean' },
|
|
11
|
+
},
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export default meta;
|
|
15
|
+
|
|
16
|
+
export const Default = {
|
|
17
|
+
args: {
|
|
18
|
+
overlayEnable: false,
|
|
19
|
+
},
|
|
20
|
+
render: (args) => ({
|
|
21
|
+
components: { CommonHeader },
|
|
22
|
+
setup() {
|
|
23
|
+
return { args };
|
|
24
|
+
},
|
|
25
|
+
template: `
|
|
26
|
+
<div style="min-height: 100vh;">
|
|
27
|
+
<CommonHeader v-bind="args" />
|
|
28
|
+
<div style="height: 1600px;"></div>
|
|
29
|
+
</div>
|
|
30
|
+
`,
|
|
31
|
+
}),
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export const Overlay = {
|
|
35
|
+
args: {
|
|
36
|
+
overlayEnable: true,
|
|
37
|
+
},
|
|
38
|
+
render: Default.render,
|
|
39
|
+
};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import LeftSideToggle from '../../LeftSideToggle.vue';
|
|
2
|
+
import StoryPropsTable from '../components/StoryPropsTable.vue';
|
|
3
|
+
import Bus from '../../../utils/bus';
|
|
4
|
+
|
|
5
|
+
const meta = {
|
|
6
|
+
title: 'Layout/LeftSideToggle',
|
|
7
|
+
component: LeftSideToggle,
|
|
8
|
+
parameters: {
|
|
9
|
+
layout: 'fullscreen',
|
|
10
|
+
},
|
|
11
|
+
argTypes: {
|
|
12
|
+
mobileOnly: { control: 'boolean' },
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export default meta;
|
|
17
|
+
|
|
18
|
+
export const Default = {
|
|
19
|
+
args: {
|
|
20
|
+
mobileOnly: false,
|
|
21
|
+
},
|
|
22
|
+
render: (args) => ({
|
|
23
|
+
components: { LeftSideToggle, StoryPropsTable },
|
|
24
|
+
setup() {
|
|
25
|
+
return { args };
|
|
26
|
+
},
|
|
27
|
+
data() {
|
|
28
|
+
return {
|
|
29
|
+
leftOpen: true,
|
|
30
|
+
propsInfo: [
|
|
31
|
+
{ name: 'mobileOnly', type: 'Boolean', default: 'false', description: '是否只在移动端显示折叠按钮。' },
|
|
32
|
+
],
|
|
33
|
+
};
|
|
34
|
+
},
|
|
35
|
+
mounted() {
|
|
36
|
+
this.__storyToggleHandler = (status) => {
|
|
37
|
+
this.leftOpen = status;
|
|
38
|
+
};
|
|
39
|
+
Bus.on('toggleLeftSide', this.__storyToggleHandler);
|
|
40
|
+
Bus.emit('toggleLeftSide', true);
|
|
41
|
+
},
|
|
42
|
+
beforeUnmount() {
|
|
43
|
+
if (this.__storyToggleHandler) {
|
|
44
|
+
Bus.off('toggleLeftSide', this.__storyToggleHandler);
|
|
45
|
+
this.__storyToggleHandler = null;
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
methods: {
|
|
49
|
+
reopen() {
|
|
50
|
+
Bus.emit('toggleLeftSide', true);
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
template: `
|
|
54
|
+
<div style="display:grid;gap:24px;">
|
|
55
|
+
<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);">
|
|
56
|
+
<div style="display:flex;align-items:center;justify-content:space-between;gap:20px;flex-wrap:wrap;">
|
|
57
|
+
<div>
|
|
58
|
+
<div style="font-size:12px;font-weight:700;letter-spacing:0.08em;text-transform:uppercase;color:#0ea5e9;">layout</div>
|
|
59
|
+
<h2 style="margin:10px 0 0;font-size:28px;color:#0f172a;">LeftSideToggle</h2>
|
|
60
|
+
<p style="margin-top:12px;color:#475569;line-height:1.8;">点击图标会通过事件总线切换左栏开关,适合与 LeftSidebar、Main 配合使用。</p>
|
|
61
|
+
</div>
|
|
62
|
+
<div style="display:flex;align-items:center;gap:16px;">
|
|
63
|
+
<div style="padding:8px 14px;border-radius:999px;background:#e2e8f0;color:#0f172a;font-weight:700;">
|
|
64
|
+
当前状态:{{ leftOpen ? '展开' : '收起' }}
|
|
65
|
+
</div>
|
|
66
|
+
<button type="button" class="el-button el-button--primary is-plain" @click="reopen">重置为展开</button>
|
|
67
|
+
</div>
|
|
68
|
+
</div>
|
|
69
|
+
<div style="margin-top:24px;display:flex;align-items:center;gap:16px;padding:20px;border-radius:16px;background:linear-gradient(135deg,#f8fafc 0%,#e0f2fe 100%);">
|
|
70
|
+
<LeftSideToggle v-bind="args" />
|
|
71
|
+
<div style="color:#334155;line-height:1.7;">左栏折叠按钮预览区域</div>
|
|
72
|
+
</div>
|
|
73
|
+
</section>
|
|
74
|
+
<StoryPropsTable title="LeftSideToggle" description="左侧边栏开关按钮,通过事件总线广播状态。" :items="propsInfo" />
|
|
75
|
+
</div>
|
|
76
|
+
`,
|
|
77
|
+
}),
|
|
78
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import LeftSidebar from '../../LeftSidebar.vue';
|
|
2
|
+
|
|
3
|
+
const meta = {
|
|
4
|
+
title: 'Layout/LeftSidebar',
|
|
5
|
+
component: LeftSidebar,
|
|
6
|
+
parameters: {
|
|
7
|
+
layout: 'fullscreen',
|
|
8
|
+
},
|
|
9
|
+
argTypes: {
|
|
10
|
+
open: { control: 'boolean' },
|
|
11
|
+
withoutBread: { control: 'boolean' },
|
|
12
|
+
uid: { control: 'number' },
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export default meta;
|
|
17
|
+
|
|
18
|
+
export const Default = {
|
|
19
|
+
args: {
|
|
20
|
+
open: true,
|
|
21
|
+
withoutBread: false,
|
|
22
|
+
uid: null,
|
|
23
|
+
},
|
|
24
|
+
render: (args) => ({
|
|
25
|
+
components: { LeftSidebar },
|
|
26
|
+
setup() {
|
|
27
|
+
return { args };
|
|
28
|
+
},
|
|
29
|
+
template: `
|
|
30
|
+
<LeftSidebar v-bind="args">
|
|
31
|
+
<div style="border-radius: 18px; background: rgba(255,255,255,0.88); padding: 20px; box-shadow: 0 24px 60px rgba(15,23,42,0.08);">
|
|
32
|
+
<div style="font-weight: 700; color: #0f172a;">LeftSidebar</div>
|
|
33
|
+
<p style="margin-top: 8px; color: #475569; line-height: 1.7;">
|
|
34
|
+
左栏通常用于承载作者、分类导航、作品集或筛选补充信息。
|
|
35
|
+
</p>
|
|
36
|
+
</div>
|
|
37
|
+
</LeftSidebar>
|
|
38
|
+
`,
|
|
39
|
+
}),
|
|
40
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import Main from '../../Main.vue';
|
|
2
|
+
|
|
3
|
+
const meta = {
|
|
4
|
+
title: 'Layout/Main',
|
|
5
|
+
component: Main,
|
|
6
|
+
parameters: {
|
|
7
|
+
layout: 'fullscreen',
|
|
8
|
+
},
|
|
9
|
+
argTypes: {
|
|
10
|
+
withoutLeft: { control: 'boolean' },
|
|
11
|
+
withoutRight: { control: 'boolean' },
|
|
12
|
+
withoutBread: { control: 'boolean' },
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export default meta;
|
|
17
|
+
|
|
18
|
+
export const Default = {
|
|
19
|
+
args: {
|
|
20
|
+
withoutLeft: false,
|
|
21
|
+
withoutRight: false,
|
|
22
|
+
withoutBread: false,
|
|
23
|
+
},
|
|
24
|
+
render: (args) => ({
|
|
25
|
+
components: { Main },
|
|
26
|
+
setup() {
|
|
27
|
+
return { args };
|
|
28
|
+
},
|
|
29
|
+
template: `
|
|
30
|
+
<Main v-bind="args">
|
|
31
|
+
<div style="border-radius: 18px; background: rgba(255,255,255,0.92); box-shadow: 0 24px 60px rgba(15,23,42,0.08); padding: 32px; min-height: 360px;">
|
|
32
|
+
<div style="font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #0ea5e9;">Main</div>
|
|
33
|
+
<h2 style="margin: 12px 0 0; font-size: 32px; line-height: 1.2; font-weight: 700; color: #0f172a;">主内容布局容器</h2>
|
|
34
|
+
<p style="margin-top: 16px; max-width: 42rem; color: #334155; line-height: 1.9;">
|
|
35
|
+
这里模拟单页正文区域,你可以把详情组件、筛选模块或任何内容组件直接挂进来查看与左右栏组合后的效果。
|
|
36
|
+
</p>
|
|
37
|
+
</div>
|
|
38
|
+
</Main>
|
|
39
|
+
`,
|
|
40
|
+
}),
|
|
41
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import RightSidebar from '../../RightSidebar.vue';
|
|
2
|
+
|
|
3
|
+
const meta = {
|
|
4
|
+
title: 'Layout/RightSidebar',
|
|
5
|
+
component: RightSidebar,
|
|
6
|
+
parameters: {
|
|
7
|
+
layout: 'fullscreen',
|
|
8
|
+
},
|
|
9
|
+
argTypes: {
|
|
10
|
+
showToggle: { control: 'boolean' },
|
|
11
|
+
},
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export default meta;
|
|
15
|
+
|
|
16
|
+
export const Default = {
|
|
17
|
+
args: {
|
|
18
|
+
showToggle: true,
|
|
19
|
+
},
|
|
20
|
+
render: (args) => ({
|
|
21
|
+
components: { RightSidebar },
|
|
22
|
+
setup() {
|
|
23
|
+
return { args };
|
|
24
|
+
},
|
|
25
|
+
template: `
|
|
26
|
+
<RightSidebar v-bind="args">
|
|
27
|
+
<div style="border-radius: 18px; background: rgba(255,255,255,0.88); padding: 20px; box-shadow: 0 24px 60px rgba(15,23,42,0.08);">
|
|
28
|
+
<div style="font-weight: 700; color: #0f172a;">RightSidebar</div>
|
|
29
|
+
<p style="margin-top: 8px; color: #475569; line-height: 1.7;">
|
|
30
|
+
右栏一般承载目录、推荐内容、主题信息或辅助说明模块。
|
|
31
|
+
</p>
|
|
32
|
+
</div>
|
|
33
|
+
</RightSidebar>
|
|
34
|
+
`,
|
|
35
|
+
}),
|
|
36
|
+
};
|
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="sb-shell">
|
|
3
|
+
<div class="sb-shell-page" :class="{ 'has-suspend': showSuspend }">
|
|
4
|
+
<template v-if="placement === 'header'">
|
|
5
|
+
<slot></slot>
|
|
6
|
+
</template>
|
|
7
|
+
<CommonHeader v-else-if="showHeader" v-bind="resolvedHeaderProps"></CommonHeader>
|
|
8
|
+
|
|
9
|
+
<template v-if="placement === 'breadcrumb'">
|
|
10
|
+
<slot></slot>
|
|
11
|
+
</template>
|
|
12
|
+
<Breadcrumb v-else-if="showBreadcrumb" v-bind="resolvedBreadcrumbProps">
|
|
13
|
+
<template #logo>
|
|
14
|
+
<img svg-inline src="../../../assets/img/editor/jx3.svg" />
|
|
15
|
+
</template>
|
|
16
|
+
<template #op-prepend>
|
|
17
|
+
<slot v-if="placement === 'leftToggle'"></slot>
|
|
18
|
+
<LeftSideToggle v-else-if="showLeftToggle" :mobileOnly="true" />
|
|
19
|
+
</template>
|
|
20
|
+
</Breadcrumb>
|
|
21
|
+
|
|
22
|
+
<LeftSidebar v-if="showLeftSidebar" v-bind="resolvedLeftSidebarProps">
|
|
23
|
+
<slot v-if="placement === 'left'"></slot>
|
|
24
|
+
<div v-else class="sb-shell-card">
|
|
25
|
+
<div class="sb-shell-card__title">LeftSidebar</div>
|
|
26
|
+
<div class="sb-shell-card__desc">这里用于承载作者信息、导航或栏目侧边内容。</div>
|
|
27
|
+
</div>
|
|
28
|
+
</LeftSidebar>
|
|
29
|
+
|
|
30
|
+
<Main v-if="showMain" v-bind="resolvedMainProps">
|
|
31
|
+
<div class="sb-shell-main">
|
|
32
|
+
<slot v-if="placement === 'main'"></slot>
|
|
33
|
+
<div v-else class="sb-shell-article">
|
|
34
|
+
<div class="sb-shell-article__eyebrow">Storybook Base</div>
|
|
35
|
+
<h2 class="sb-shell-article__title">全局模块基座</h2>
|
|
36
|
+
<p class="sb-shell-article__text">
|
|
37
|
+
这个区域模拟 `App.vue` 中的主内容区,后续内容型组件可以默认挂在这里预览。
|
|
38
|
+
</p>
|
|
39
|
+
</div>
|
|
40
|
+
</div>
|
|
41
|
+
|
|
42
|
+
<RightSidebar v-if="showRightSidebar" v-bind="resolvedRightSidebarProps">
|
|
43
|
+
<slot v-if="placement === 'right' && $slots.right" name="right"></slot>
|
|
44
|
+
<slot v-else-if="placement === 'right'"></slot>
|
|
45
|
+
<div v-else class="sb-shell-card">
|
|
46
|
+
<div class="sb-shell-card__title">RightSidebar</div>
|
|
47
|
+
<div class="sb-shell-card__desc">这里用于目录、推荐信息或详情页补充模块。</div>
|
|
48
|
+
</div>
|
|
49
|
+
</RightSidebar>
|
|
50
|
+
</Main>
|
|
51
|
+
|
|
52
|
+
<div v-if="showSuspend && placement === 'suspend'">
|
|
53
|
+
<slot></slot>
|
|
54
|
+
</div>
|
|
55
|
+
|
|
56
|
+
<template v-if="placement === 'footer'">
|
|
57
|
+
<slot></slot>
|
|
58
|
+
</template>
|
|
59
|
+
<CommonFooter v-else-if="showFooter"></CommonFooter>
|
|
60
|
+
</div>
|
|
61
|
+
</div>
|
|
62
|
+
</template>
|
|
63
|
+
|
|
64
|
+
<script>
|
|
65
|
+
import CommonHeader from "../../CommonHeader.vue";
|
|
66
|
+
import Breadcrumb from "../../Breadcrumb.vue";
|
|
67
|
+
import Main from "../../Main.vue";
|
|
68
|
+
import LeftSidebar from "../../LeftSidebar.vue";
|
|
69
|
+
import LeftSideToggle from "../../LeftSideToggle.vue";
|
|
70
|
+
import RightSidebar from "../../RightSidebar.vue";
|
|
71
|
+
import CommonFooter from "../../CommonFooter.vue";
|
|
72
|
+
|
|
73
|
+
export default {
|
|
74
|
+
name: "StorybookShell",
|
|
75
|
+
components: {
|
|
76
|
+
CommonHeader,
|
|
77
|
+
Breadcrumb,
|
|
78
|
+
Main,
|
|
79
|
+
LeftSidebar,
|
|
80
|
+
LeftSideToggle,
|
|
81
|
+
RightSidebar,
|
|
82
|
+
CommonFooter,
|
|
83
|
+
},
|
|
84
|
+
props: {
|
|
85
|
+
placement: {
|
|
86
|
+
type: String,
|
|
87
|
+
default: "main",
|
|
88
|
+
},
|
|
89
|
+
showHeader: {
|
|
90
|
+
type: Boolean,
|
|
91
|
+
default: true,
|
|
92
|
+
},
|
|
93
|
+
showBreadcrumb: {
|
|
94
|
+
type: Boolean,
|
|
95
|
+
default: true,
|
|
96
|
+
},
|
|
97
|
+
showMain: {
|
|
98
|
+
type: Boolean,
|
|
99
|
+
default: true,
|
|
100
|
+
},
|
|
101
|
+
showLeftSidebar: {
|
|
102
|
+
type: Boolean,
|
|
103
|
+
default: true,
|
|
104
|
+
},
|
|
105
|
+
showLeftToggle: {
|
|
106
|
+
type: Boolean,
|
|
107
|
+
default: true,
|
|
108
|
+
},
|
|
109
|
+
showRightSidebar: {
|
|
110
|
+
type: Boolean,
|
|
111
|
+
default: true,
|
|
112
|
+
},
|
|
113
|
+
showFooter: {
|
|
114
|
+
type: Boolean,
|
|
115
|
+
default: true,
|
|
116
|
+
},
|
|
117
|
+
showSuspend: {
|
|
118
|
+
type: Boolean,
|
|
119
|
+
default: false,
|
|
120
|
+
},
|
|
121
|
+
headerProps: {
|
|
122
|
+
type: Object,
|
|
123
|
+
default: function () {
|
|
124
|
+
return {};
|
|
125
|
+
},
|
|
126
|
+
},
|
|
127
|
+
breadcrumbProps: {
|
|
128
|
+
type: Object,
|
|
129
|
+
default: function () {
|
|
130
|
+
return {};
|
|
131
|
+
},
|
|
132
|
+
},
|
|
133
|
+
mainProps: {
|
|
134
|
+
type: Object,
|
|
135
|
+
default: function () {
|
|
136
|
+
return {};
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
leftSidebarProps: {
|
|
140
|
+
type: Object,
|
|
141
|
+
default: function () {
|
|
142
|
+
return {};
|
|
143
|
+
},
|
|
144
|
+
},
|
|
145
|
+
rightSidebarProps: {
|
|
146
|
+
type: Object,
|
|
147
|
+
default: function () {
|
|
148
|
+
return {};
|
|
149
|
+
},
|
|
150
|
+
},
|
|
151
|
+
},
|
|
152
|
+
computed: {
|
|
153
|
+
resolvedHeaderProps: function () {
|
|
154
|
+
return {
|
|
155
|
+
overlayEnable: false,
|
|
156
|
+
...this.headerProps,
|
|
157
|
+
};
|
|
158
|
+
},
|
|
159
|
+
resolvedBreadcrumbProps: function () {
|
|
160
|
+
return {
|
|
161
|
+
name: "频道名称",
|
|
162
|
+
slug: "story",
|
|
163
|
+
root: "/story",
|
|
164
|
+
publishEnable: true,
|
|
165
|
+
feedbackEnable: true,
|
|
166
|
+
adminEnable: false,
|
|
167
|
+
crumbEnable: false,
|
|
168
|
+
withoutLeft: !this.showLeftSidebar,
|
|
169
|
+
...this.breadcrumbProps,
|
|
170
|
+
};
|
|
171
|
+
},
|
|
172
|
+
resolvedMainProps: function () {
|
|
173
|
+
return {
|
|
174
|
+
withoutLeft: !this.showLeftSidebar,
|
|
175
|
+
withoutRight: !this.showRightSidebar,
|
|
176
|
+
...this.mainProps,
|
|
177
|
+
};
|
|
178
|
+
},
|
|
179
|
+
resolvedLeftSidebarProps: function () {
|
|
180
|
+
return {
|
|
181
|
+
open: true,
|
|
182
|
+
...this.leftSidebarProps,
|
|
183
|
+
};
|
|
184
|
+
},
|
|
185
|
+
resolvedRightSidebarProps: function () {
|
|
186
|
+
return {
|
|
187
|
+
showToggle: true,
|
|
188
|
+
...this.rightSidebarProps,
|
|
189
|
+
};
|
|
190
|
+
},
|
|
191
|
+
},
|
|
192
|
+
};
|
|
193
|
+
</script>
|
|
194
|
+
|
|
195
|
+
<style lang="less">
|
|
196
|
+
.sb-shell {
|
|
197
|
+
min-height: 100vh;
|
|
198
|
+
background:
|
|
199
|
+
radial-gradient(circle at top right, rgba(0, 157, 255, 0.1), transparent 24rem),
|
|
200
|
+
linear-gradient(180deg, #f5f7fb 0%, #eef2f7 100%);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
.sb-shell-page {
|
|
204
|
+
min-height: 100vh;
|
|
205
|
+
padding-top: 60px;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.sb-shell-page.has-suspend {
|
|
209
|
+
padding-bottom: 96px;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
.sb-shell-main {
|
|
213
|
+
padding: 24px;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.sb-shell-card,
|
|
217
|
+
.sb-shell-article {
|
|
218
|
+
border: 1px solid rgba(15, 23, 42, 0.08);
|
|
219
|
+
border-radius: 18px;
|
|
220
|
+
background: rgba(255, 255, 255, 0.92);
|
|
221
|
+
box-shadow: 0 24px 60px rgba(15, 23, 42, 0.08);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
.sb-shell-card {
|
|
225
|
+
padding: 20px;
|
|
226
|
+
margin-bottom: 16px;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
.sb-shell-card__title {
|
|
230
|
+
font-size: 15px;
|
|
231
|
+
font-weight: 700;
|
|
232
|
+
color: #0f172a;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
.sb-shell-card__desc {
|
|
236
|
+
margin-top: 8px;
|
|
237
|
+
line-height: 1.7;
|
|
238
|
+
color: #475569;
|
|
239
|
+
font-size: 13px;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
.sb-shell-article {
|
|
243
|
+
min-height: 360px;
|
|
244
|
+
padding: 32px;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
.sb-shell-article__eyebrow {
|
|
248
|
+
font-size: 12px;
|
|
249
|
+
font-weight: 700;
|
|
250
|
+
letter-spacing: 0.08em;
|
|
251
|
+
text-transform: uppercase;
|
|
252
|
+
color: #0ea5e9;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
.sb-shell-article__title {
|
|
256
|
+
margin: 12px 0 0;
|
|
257
|
+
font-size: 32px;
|
|
258
|
+
line-height: 1.2;
|
|
259
|
+
font-weight: 700;
|
|
260
|
+
color: #0f172a;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
.sb-shell-article__text {
|
|
264
|
+
max-width: 42rem;
|
|
265
|
+
margin-top: 16px;
|
|
266
|
+
font-size: 15px;
|
|
267
|
+
line-height: 1.9;
|
|
268
|
+
color: #334155;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
</style>
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import SuspendCommon from '../../SuspendCommon.vue';
|
|
2
|
+
import SuspendCommonStage from './SuspendCommonStage.vue';
|
|
3
|
+
|
|
4
|
+
const meta = {
|
|
5
|
+
title: 'Layout/SuspendCommon',
|
|
6
|
+
component: SuspendCommon,
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: 'fullscreen',
|
|
9
|
+
},
|
|
10
|
+
argTypes: {
|
|
11
|
+
btnOptions: { control: 'object' },
|
|
12
|
+
drawerOptions: { control: 'object' },
|
|
13
|
+
fixPageOptions: { control: 'object' },
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export default meta;
|
|
18
|
+
|
|
19
|
+
export const Default = {
|
|
20
|
+
args: {
|
|
21
|
+
btnOptions: {
|
|
22
|
+
showHome: true,
|
|
23
|
+
showIcon: false,
|
|
24
|
+
showPin: false,
|
|
25
|
+
showMore: true,
|
|
26
|
+
},
|
|
27
|
+
drawerOptions: {
|
|
28
|
+
author: {
|
|
29
|
+
name: '作者名字',
|
|
30
|
+
avatar: 'https://cdn.jx3box.com/upload/avatar/2022/3/2/8_9860765.png',
|
|
31
|
+
author_id: 8,
|
|
32
|
+
},
|
|
33
|
+
subscribeType: '',
|
|
34
|
+
postType: '',
|
|
35
|
+
id: '',
|
|
36
|
+
title: 'Storybook 悬浮窗',
|
|
37
|
+
hideType: ['collect', 'rss', 'laterOn', 'report'],
|
|
38
|
+
},
|
|
39
|
+
fixPageOptions: {
|
|
40
|
+
key: 'storybook-fixed',
|
|
41
|
+
title: 'Storybook 悬浮窗',
|
|
42
|
+
url: 'https://storybook.local/suspend',
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
render: (args) => ({
|
|
46
|
+
components: { SuspendCommon, SuspendCommonStage },
|
|
47
|
+
setup() {
|
|
48
|
+
return { args };
|
|
49
|
+
},
|
|
50
|
+
methods: {
|
|
51
|
+
handleSearch(keyword) {
|
|
52
|
+
console.log('storybook suspend search', keyword);
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
template: `
|
|
56
|
+
<SuspendCommonStage>
|
|
57
|
+
<SuspendCommon v-bind="args" @search="handleSearch">
|
|
58
|
+
<div style="display: flex; gap: 12px; align-items: center;">
|
|
59
|
+
<span style="font-weight: 700;">切换</span>
|
|
60
|
+
<span>收藏</span>
|
|
61
|
+
<span>分享</span>
|
|
62
|
+
</div>
|
|
63
|
+
</SuspendCommon>
|
|
64
|
+
</SuspendCommonStage>
|
|
65
|
+
`,
|
|
66
|
+
}),
|
|
67
|
+
};
|