@jx3box/jx3box-ui 2.0.5 → 2.0.7

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 (241) hide show
  1. package/.storybook/preview.js +22 -13
  2. package/.storybook/storybookMocks.js +214 -0
  3. package/README.md +39 -43
  4. package/assets/css/bread/admin.less +20 -2
  5. package/assets/css/bread/breadcrumb.less +5 -2
  6. package/assets/css/comment/quick-reply.less +1 -1
  7. package/assets/css/common/left-sidebar.less +1 -1
  8. package/assets/css/interact/like2.less +5 -2
  9. package/assets/css/interact/qrcode.less +69 -0
  10. package/assets/css/single/author.less +15 -10
  11. package/assets/css/single/cms-single.less +1 -0
  12. package/assets/css/single/thx.less +34 -11
  13. package/assets/css/wiki/wiki-comments.less +176 -0
  14. package/assets/css/wiki/wiki-panel.less +177 -0
  15. package/assets/css/wiki/wiki-revisions.less +62 -0
  16. package/assets/data/nav.json +344 -10
  17. package/assets/img/comment/comment.svg +1 -1
  18. package/assets/img/comment/heart_1.svg +1 -1
  19. package/assets/img/comment/hide.svg +1 -1
  20. package/assets/img/leftsidebar/medal.svg +1 -1
  21. package/assets/img/leftsidebar/post.svg +27 -46
  22. package/i18n/messages/en-US.js +357 -22
  23. package/i18n/messages/vi.js +350 -22
  24. package/i18n/messages/zh-CN.js +469 -20
  25. package/i18n/messages/zh-TW.js +350 -22
  26. package/index.js +19 -7
  27. package/package.json +8 -5
  28. package/service/cms.js +22 -0
  29. package/service/commit-history.js +18 -0
  30. package/service/community.js +60 -0
  31. package/service/fav.js +5 -6
  32. package/src/App.vue +210 -80
  33. package/src/Breadcrumb.vue +24 -11
  34. package/src/CommonFooter.vue +2 -2
  35. package/src/Footer.vue +13 -5
  36. package/src/LeftSideToggle.vue +10 -3
  37. package/src/LeftSidebar.vue +19 -5
  38. package/src/Main.vue +9 -2
  39. package/src/RightSidebar.vue +12 -3
  40. package/src/SuspendCommon.vue +52 -38
  41. package/src/author/AuthorFans.vue +7 -5
  42. package/src/author/AuthorFollow.vue +14 -7
  43. package/src/author/AuthorGift.vue +25 -17
  44. package/src/author/AuthorInfo.vue +46 -19
  45. package/src/author/AuthorLink.vue +3 -1
  46. package/src/author/AuthorMedals.vue +5 -2
  47. package/src/author/AuthorPosts.vue +31 -13
  48. package/src/author/AuthorRss.vue +7 -3
  49. package/src/author/AuthorTeams.vue +3 -1
  50. package/src/author/UserPop.vue +29 -17
  51. package/src/bread/Admin.vue +55 -32
  52. package/src/bread/AdminDirectMessage.vue +15 -8
  53. package/src/bread/AdminDrop.vue +124 -45
  54. package/src/bread/CommunityAdmin.vue +527 -0
  55. package/src/bread/DesignTask.vue +30 -26
  56. package/src/bread/ListAdmin.vue +199 -0
  57. package/src/bread/MigrateCommunity.vue +192 -0
  58. package/src/bread/MoveToCommunityDialog.vue +234 -0
  59. package/src/comment/Avatar.vue +18 -24
  60. package/src/comment/CommentContent.vue +57 -37
  61. package/src/comment/CommentContentSimple.vue +61 -63
  62. package/src/comment/CommentInputForm.vue +45 -34
  63. package/src/comment/CommentWithReply.vue +9 -6
  64. package/src/comment/QuickReply.vue +5 -1
  65. package/src/comment/ReplyForReply.vue +6 -4
  66. package/src/comment/ReplyList.vue +28 -18
  67. package/src/comment/Upload.vue +24 -6
  68. package/src/filters/clientBy.vue +10 -8
  69. package/src/filters/markBy.vue +35 -31
  70. package/src/filters/menuBy.vue +20 -22
  71. package/src/filters/orderBy.vue +17 -11
  72. package/src/filters/tagBy.vue +4 -2
  73. package/src/filters/topicBy.vue +12 -10
  74. package/src/filters/versionBy.vue +5 -3
  75. package/src/filters/zlpBy.vue +29 -25
  76. package/src/footer/copyright.vue +5 -5
  77. package/src/footer/links.vue +2 -2
  78. package/src/footer/official.vue +1 -1
  79. package/src/footer/resource.vue +6 -6
  80. package/src/header/alternate.vue +35 -18
  81. package/src/header/asset.vue +9 -19
  82. package/src/header/box.vue +20 -8
  83. package/src/header/box2.vue +16 -9
  84. package/src/header/client.vue +7 -7
  85. package/src/header/lang.vue +41 -6
  86. package/src/header/logo.vue +2 -3
  87. package/src/header/manage.vue +2 -2
  88. package/src/header/message.vue +3 -3
  89. package/src/header/nav.vue +26 -23
  90. package/src/header/publish.vue +2 -2
  91. package/src/header/search.vue +2 -2
  92. package/src/header/shop.vue +2 -2
  93. package/src/header/user.vue +4 -4
  94. package/src/header/userInfo.vue +22 -24
  95. package/src/header/vip.vue +2 -2
  96. package/src/interact/BoxcoinAdmin.vue +30 -16
  97. package/src/interact/BoxcoinRecords.vue +28 -11
  98. package/src/interact/BoxcoinUser.vue +33 -17
  99. package/src/interact/Fav.vue +5 -1
  100. package/src/interact/Homework.vue +317 -0
  101. package/src/interact/Like.vue +4 -2
  102. package/src/interact/QRcode.vue +104 -0
  103. package/src/interact/Rss.vue +10 -4
  104. package/src/interact/Share.vue +18 -19
  105. package/src/interact/WatchLater.vue +5 -1
  106. package/src/main.js +1 -0
  107. package/src/single/Author.vue +5 -1
  108. package/src/single/CmsSingle.vue +29 -15
  109. package/src/single/Collection.vue +36 -26
  110. package/src/single/Comment.vue +19 -13
  111. package/src/single/Creators.vue +5 -3
  112. package/src/single/PostCollection.vue +158 -0
  113. package/src/single/PostDirectory.vue +0 -126
  114. package/src/single/PostGuide.vue +93 -0
  115. package/src/single/PostHeader.vue +39 -17
  116. package/src/single/PostTopic.vue +3 -3
  117. package/src/single/PostVersion.vue +219 -0
  118. package/src/single/RightAffix.vue +160 -0
  119. package/src/single/SimpleThx.vue +4 -2
  120. package/src/single/Thx.vue +14 -2
  121. package/src/single/VersionDialog.vue +238 -0
  122. package/src/stories/components/StoryPropsTable.vue +137 -0
  123. package/src/stories/filters/FilterGallery.stories.js +110 -0
  124. package/src/stories/filters/clientBy.stories.js +24 -0
  125. package/src/stories/filters/markBy.stories.js +6 -0
  126. package/src/stories/filters/menuBy.stories.js +6 -0
  127. package/src/stories/filters/orderBy.stories.js +6 -0
  128. package/src/stories/filters/tagBy.stories.js +6 -0
  129. package/src/stories/filters/topicBy.stories.js +6 -0
  130. package/src/stories/filters/versionBy.stories.js +6 -0
  131. package/src/stories/filters/zlpBy.stories.js +6 -0
  132. package/src/stories/interact/QRcode.stories.js +59 -0
  133. package/src/stories/layout/BaseShell.stories.js +38 -0
  134. package/src/stories/layout/Breadcrumb.stories.js +40 -0
  135. package/src/stories/layout/CommonFooter.stories.js +1 -1
  136. package/src/stories/layout/CommonHeader.stories.js +1 -1
  137. package/src/stories/layout/LeftSideToggle.stories.js +78 -0
  138. package/src/stories/layout/LeftSidebar.stories.js +40 -0
  139. package/src/stories/layout/Main.stories.js +41 -0
  140. package/src/stories/layout/RightSidebar.stories.js +36 -0
  141. package/src/stories/layout/StorybookShell.vue +271 -0
  142. package/src/stories/layout/SuspendCommon.stories.js +67 -0
  143. package/src/stories/layout/SuspendCommonStage.vue +143 -0
  144. package/src/stories/mockData.js +369 -0
  145. package/src/stories/other/UserPop.stories.js +51 -0
  146. package/src/stories/single/Author.stories.js +19 -0
  147. package/src/stories/single/AuthorStoryStage.vue +103 -0
  148. package/src/stories/single/CmsSingle.stories.js +19 -0
  149. package/src/stories/single/CmsSingleStoryStage.vue +118 -0
  150. package/src/stories/single/Collection.stories.js +34 -0
  151. package/src/stories/single/Comment.stories.js +36 -0
  152. package/src/stories/single/Creators.stories.js +34 -0
  153. package/src/stories/single/PostCollection.stories.js +34 -0
  154. package/src/stories/single/PostDirectory.stories.js +31 -0
  155. package/src/stories/single/PostGuide.stories.js +47 -0
  156. package/src/stories/single/PostHeader.stories.js +39 -0
  157. package/src/stories/single/PostVersion.stories.js +41 -0
  158. package/src/stories/single/RightAffix.stories.js +84 -0
  159. package/src/stories/single/SimpleThx.stories.js +39 -0
  160. package/src/stories/single/SingleGallery.stories.js +207 -0
  161. package/src/stories/single/Thx.stories.js +38 -0
  162. package/src/stories/wiki/GamePrice.stories.js +64 -0
  163. package/src/stories/wiki/WikiComments.stories.js +58 -0
  164. package/src/stories/wiki/WikiPanel.stories.js +69 -0
  165. package/src/stories/wiki/WikiRevisions.stories.js +47 -0
  166. package/src/wiki/GamePrice.vue +107 -0
  167. package/src/wiki/WikiComment.vue +153 -0
  168. package/src/wiki/WikiComments.vue +206 -0
  169. package/src/wiki/WikiPanel.vue +121 -0
  170. package/src/wiki/WikiRevisions.vue +125 -0
  171. package/vue.config.js +2 -12
  172. package/assets/css/common/bottom.less +0 -25
  173. package/assets/css/editor/article.less +0 -36
  174. package/assets/css/editor/combo.less +0 -362
  175. package/assets/css/editor/resource.less +0 -399
  176. package/assets/css/editor/tinymce.less +0 -100
  177. package/assets/css/editor/upload.less +0 -136
  178. package/assets/css/module/author.less +0 -231
  179. package/assets/css/module/buff.less +0 -88
  180. package/assets/css/module/directory.less +0 -165
  181. package/assets/css/module/icon.less +0 -25
  182. package/assets/css/module/item.less +0 -279
  183. package/assets/css/module/item_simple.less +0 -58
  184. package/assets/css/module/jx3_element.less +0 -5
  185. package/assets/css/module/macro.less +0 -89
  186. package/assets/css/module/npc.less +0 -265
  187. package/assets/css/module/resource.less +0 -93
  188. package/assets/css/module/skill.less +0 -74
  189. package/assets/css/module/talent.less +0 -495
  190. package/assets/js/a.js +0 -46
  191. package/assets/js/code.js +0 -13
  192. package/assets/js/combo.js +0 -40
  193. package/assets/js/directory.js +0 -114
  194. package/assets/js/filter2.js +0 -186
  195. package/assets/js/fold.js +0 -11
  196. package/assets/js/gallery.js +0 -14
  197. package/assets/js/hljs_languages.js +0 -177
  198. package/assets/js/iframe.js +0 -38
  199. package/assets/js/img.js +0 -23
  200. package/assets/js/item/attribute_percent.js +0 -88
  201. package/assets/js/item/bind.js +0 -18
  202. package/assets/js/item/border.js +0 -19
  203. package/assets/js/item/border_quest.js +0 -12
  204. package/assets/js/item/color.js +0 -25
  205. package/assets/js/item/hljs_languages.js +0 -177
  206. package/assets/js/item/icon_url.js +0 -15
  207. package/assets/js/item/second_format.js +0 -19
  208. package/assets/js/jx3_element.js +0 -73
  209. package/assets/js/katex.js +0 -181
  210. package/assets/js/macro.js +0 -16
  211. package/assets/js/nextpage.js +0 -4
  212. package/assets/js/pswp.js +0 -67
  213. package/assets/js/pswp_template.js +0 -66
  214. package/assets/js/pz_iframe.js +0 -30
  215. package/assets/js/qixue.js +0 -28
  216. package/assets/js/renderImgPreview.js +0 -18
  217. package/assets/js/script.js +0 -6
  218. package/assets/js/stat.js +0 -107
  219. package/assets/js/talent2.js +0 -21
  220. package/assets/js/tex-mml-chtml.js +0 -36310
  221. package/assets/js/voice.js +0 -238
  222. package/assets/js/xss.js +0 -130
  223. package/src/editor/Article.vue +0 -230
  224. package/src/editor/BoxResource.vue +0 -441
  225. package/src/editor/Resource.vue +0 -623
  226. package/src/editor/Tinymce.vue +0 -204
  227. package/src/editor/Upload.vue +0 -277
  228. package/src/editor/UploadAlum.vue +0 -176
  229. package/src/editor/UploadBanner.vue +0 -156
  230. package/src/editor/components/Author.vue +0 -322
  231. package/src/editor/components/Avatar.vue +0 -95
  232. package/src/editor/components/Buff.vue +0 -80
  233. package/src/editor/components/Combo.vue +0 -259
  234. package/src/editor/components/Equip.vue +0 -299
  235. package/src/editor/components/GameText.vue +0 -242
  236. package/src/editor/components/Item.vue +0 -325
  237. package/src/editor/components/ItemSimple.vue +0 -134
  238. package/src/editor/components/Medal.vue +0 -43
  239. package/src/editor/components/Npc.vue +0 -215
  240. package/src/editor/components/PostAuthor.vue +0 -102
  241. package/src/editor/components/Skill.vue +0 -71
@@ -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
+ };
@@ -0,0 +1,143 @@
1
+ <template>
2
+ <div class="suspend-stage">
3
+ <div class="suspend-stage__device">
4
+ <div class="suspend-stage__screen">
5
+ <div class="suspend-stage__status"></div>
6
+ <div class="suspend-stage__hero">
7
+ <div class="suspend-stage__eyebrow">Mobile Preview</div>
8
+ <h2 class="suspend-stage__title">SuspendCommon</h2>
9
+ <p class="suspend-stage__text">这里模拟移动端内容页底部场景,便于观察底部浮窗的真实布局效果。</p>
10
+ </div>
11
+ <div class="suspend-stage__card">
12
+ <div class="suspend-stage__card-title">当前页面</div>
13
+ <div class="suspend-stage__card-text">轻剑驭风版本攻略示例,向下滚动后底部浮窗依然固定显示。</div>
14
+ </div>
15
+ <slot></slot>
16
+ </div>
17
+ </div>
18
+ </div>
19
+ </template>
20
+
21
+ <script>
22
+ export default {
23
+ name: "SuspendCommonStage",
24
+ mounted() {
25
+ document.body.classList.add("storybook-suspend-stage");
26
+ },
27
+ beforeUnmount() {
28
+ document.body.classList.remove("storybook-suspend-stage");
29
+ },
30
+ };
31
+ </script>
32
+
33
+ <style lang="less">
34
+ .suspend-stage {
35
+ min-height: 100vh;
36
+ display: flex;
37
+ align-items: center;
38
+ justify-content: center;
39
+ padding: 32px 16px;
40
+ background:
41
+ radial-gradient(circle at top, rgba(250, 204, 21, 0.16), transparent 28rem),
42
+ linear-gradient(180deg, #e9eef5 0%, #d8e0ea 100%);
43
+ }
44
+
45
+ .suspend-stage__device {
46
+ position: relative;
47
+ width: 390px;
48
+ height: 844px;
49
+ border-radius: 36px;
50
+ padding: 10px;
51
+ background: #0f172a;
52
+ box-shadow: 0 28px 80px rgba(15, 23, 42, 0.3);
53
+ }
54
+
55
+ .suspend-stage__screen {
56
+ position: relative;
57
+ height: 100%;
58
+ overflow: hidden;
59
+ border-radius: 28px;
60
+ background:
61
+ linear-gradient(180deg, rgba(15, 23, 42, 0.08), rgba(15, 23, 42, 0) 18rem),
62
+ linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
63
+ }
64
+
65
+ .suspend-stage__status {
66
+ width: 140px;
67
+ height: 28px;
68
+ margin: 10px auto 0;
69
+ border-radius: 999px;
70
+ background: rgba(15, 23, 42, 0.92);
71
+ }
72
+
73
+ .suspend-stage__hero {
74
+ padding: 28px 24px 18px;
75
+ }
76
+
77
+ .suspend-stage__eyebrow {
78
+ font-size: 12px;
79
+ font-weight: 700;
80
+ letter-spacing: 0.08em;
81
+ text-transform: uppercase;
82
+ color: #b45309;
83
+ }
84
+
85
+ .suspend-stage__title {
86
+ margin: 10px 0 0;
87
+ font-size: 32px;
88
+ line-height: 1.15;
89
+ font-weight: 700;
90
+ color: #0f172a;
91
+ }
92
+
93
+ .suspend-stage__text {
94
+ margin-top: 12px;
95
+ font-size: 14px;
96
+ line-height: 1.8;
97
+ color: #475569;
98
+ }
99
+
100
+ .suspend-stage__card {
101
+ margin: 0 24px;
102
+ padding: 18px;
103
+ border-radius: 24px;
104
+ background: rgba(255, 255, 255, 0.82);
105
+ box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
106
+ }
107
+
108
+ .suspend-stage__card-title {
109
+ font-size: 15px;
110
+ font-weight: 700;
111
+ color: #0f172a;
112
+ }
113
+
114
+ .suspend-stage__card-text {
115
+ margin-top: 8px;
116
+ font-size: 13px;
117
+ line-height: 1.7;
118
+ color: #64748b;
119
+ }
120
+
121
+ .suspend-stage .p-suspend {
122
+ left: 50%;
123
+ width: 390px;
124
+ transform: translateX(-50%);
125
+ border-radius: 28px 28px 0 0;
126
+ }
127
+
128
+ body.storybook-suspend-stage {
129
+ overflow: hidden;
130
+ }
131
+
132
+ body.storybook-suspend-stage .p-drawer-suspend {
133
+ background: rgba(15, 23, 42, 0.32);
134
+ }
135
+
136
+ body.storybook-suspend-stage .p-drawer-suspend .u-drawer {
137
+ left: 50%;
138
+ right: auto;
139
+ width: 390px !important;
140
+ transform: translateX(-50%);
141
+ border-radius: 28px 28px 0 0;
142
+ }
143
+ </style>