@jx3box/jx3box-ui 0.0.1
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/.env +6 -0
- package/README.md +4 -0
- package/assets/css/bread/admin.less +131 -0
- package/assets/css/bread/breadcrumb.less +163 -0
- package/assets/css/bread/crumb.less +17 -0
- package/assets/css/comment/quick-reply.less +56 -0
- package/assets/css/common/bottom.less +21 -0
- package/assets/css/common/footer.less +78 -0
- package/assets/css/common/left-sidebar.less +137 -0
- package/assets/css/common/main.less +75 -0
- package/assets/css/common/right-sidebar.less +193 -0
- package/assets/css/common/suspend-common.less +343 -0
- package/assets/css/editor/article.less +36 -0
- package/assets/css/editor/combo.less +311 -0
- package/assets/css/editor/resource.less +335 -0
- package/assets/css/editor/tinymce.less +80 -0
- package/assets/css/editor/upload.less +111 -0
- package/assets/css/filters/client-by.less +33 -0
- package/assets/css/header/box.less +181 -0
- package/assets/css/interact/like2.less +20 -0
- package/assets/css/interact/share2.less +101 -0
- package/assets/css/mixin.less +64 -0
- package/assets/css/module/author.less +190 -0
- package/assets/css/module/buff.less +78 -0
- package/assets/css/module/directory.less +143 -0
- package/assets/css/module/icon.less +21 -0
- package/assets/css/module/item.less +229 -0
- package/assets/css/module/item_simple.less +51 -0
- package/assets/css/module/jx3_element.less +4 -0
- package/assets/css/module/macro.less +72 -0
- package/assets/css/module/npc.less +220 -0
- package/assets/css/module/resource.less +80 -0
- package/assets/css/module/skill.less +65 -0
- package/assets/css/module/talent.less +424 -0
- package/assets/css/single/author.less +101 -0
- package/assets/css/single/cms-single.less +55 -0
- package/assets/css/single/thx.less +230 -0
- package/assets/css/tinymce/_.less +28 -0
- package/assets/css/tinymce/a.less +29 -0
- package/assets/css/tinymce/code.less +159 -0
- package/assets/css/tinymce/combo.less +86 -0
- package/assets/css/tinymce/fold.less +70 -0
- package/assets/css/tinymce/h.less +58 -0
- package/assets/css/tinymce/hr.less +9 -0
- package/assets/css/tinymce/img.less +16 -0
- package/assets/css/tinymce/imgpreview.less +14 -0
- package/assets/css/tinymce/latex.less +43 -0
- package/assets/css/tinymce/list.less +65 -0
- package/assets/css/tinymce/macro.less +40 -0
- package/assets/css/tinymce/nextpage.less +65 -0
- package/assets/css/tinymce/p.less +8 -0
- package/assets/css/tinymce/plugin.less +3 -0
- package/assets/css/tinymce/pz.less +39 -0
- package/assets/css/tinymce/qixue.less +39 -0
- package/assets/css/tinymce/quote.less +12 -0
- package/assets/css/tinymce/table.less +59 -0
- package/assets/css/tinymce/video.less +61 -0
- package/assets/css/var.less +1 -0
- package/assets/data/box.json +184 -0
- package/assets/data/box2.json +606 -0
- package/assets/data/detach_type.json +29 -0
- package/assets/data/game_font.json +242 -0
- package/assets/data/nav.json +12 -0
- package/assets/data/panel.json +27 -0
- package/assets/data/reply_template.json +6 -0
- package/assets/data/weapon_type.json +20 -0
- package/assets/data/zlp.json +5 -0
- package/assets/img/author/bilibili.png +0 -0
- package/assets/img/author/bilibili.svg +1 -0
- package/assets/img/author/chat.png +0 -0
- package/assets/img/author/douyu.png +0 -0
- package/assets/img/author/douyu.svg +1 -0
- package/assets/img/author/github.svg +1 -0
- package/assets/img/author/huya.png +0 -0
- package/assets/img/author/huya.svg +1 -0
- package/assets/img/author/msg.svg +55 -0
- package/assets/img/author/tuilan.png +0 -0
- package/assets/img/author/weibo.svg +70 -0
- package/assets/img/bread/menu.svg +1 -0
- package/assets/img/comment/comment.svg +1 -0
- package/assets/img/comment/heart_1.svg +1 -0
- package/assets/img/comment/heart_2.svg +1 -0
- package/assets/img/comment/hide.svg +1 -0
- package/assets/img/common/add.svg +1 -0
- package/assets/img/common/android.svg +1 -0
- package/assets/img/common/bell.svg +1 -0
- package/assets/img/common/bilibili-black.svg +1 -0
- package/assets/img/common/bilibili.svg +1 -0
- package/assets/img/common/check.svg +1 -0
- package/assets/img/common/coin.svg +1 -0
- package/assets/img/common/coupon.svg +56 -0
- package/assets/img/common/douyin.svg +1 -0
- package/assets/img/common/edit.svg +1 -0
- package/assets/img/common/followus.svg +18 -0
- package/assets/img/common/gift.svg +1 -0
- package/assets/img/common/harmony.svg +1 -0
- package/assets/img/common/ios.svg +1 -0
- package/assets/img/common/jx3-origin.svg +15 -0
- package/assets/img/common/jx3-www.svg +9 -0
- package/assets/img/common/lang.svg +6 -0
- package/assets/img/common/logo.svg +5 -0
- package/assets/img/common/manage.svg +1 -0
- package/assets/img/common/miniprogram.jpg +0 -0
- package/assets/img/common/miniprogram.svg +1 -0
- package/assets/img/common/mp.jpg +0 -0
- package/assets/img/common/msg.svg +1 -0
- package/assets/img/common/news.svg +20 -0
- package/assets/img/common/qqbot.svg +7 -0
- package/assets/img/common/qrcode.svg +1 -0
- package/assets/img/common/search-key-slash.svg +5 -0
- package/assets/img/common/send.svg +56 -0
- package/assets/img/common/setting.svg +1 -0
- package/assets/img/common/vip.svg +1 -0
- package/assets/img/common/wechat.svg +48 -0
- package/assets/img/common/weibo.svg +70 -0
- package/assets/img/editor/buff.svg +1 -0
- package/assets/img/editor/file.svg +51 -0
- package/assets/img/editor/icons.svg +15 -0
- package/assets/img/editor/item.svg +46 -0
- package/assets/img/editor/jx3.svg +11 -0
- package/assets/img/editor/jx3box.svg +5 -0
- package/assets/img/editor/skill.svg +53 -0
- package/assets/img/editor/view.svg +1 -0
- package/assets/img/footer/android.svg +1 -0
- package/assets/img/footer/china.svg +1 -0
- package/assets/img/footer/harmony.svg +1 -0
- package/assets/img/footer/ios.svg +1 -0
- package/assets/img/footer/logo.svg +5 -0
- package/assets/img/footer/miniprogram.svg +1 -0
- package/assets/img/footer/qqbot.svg +7 -0
- package/assets/img/header/add.svg +1 -0
- package/assets/img/header/bell.svg +1 -0
- package/assets/img/header/check.svg +1 -0
- package/assets/img/header/coin.svg +1 -0
- package/assets/img/header/edit.svg +1 -0
- package/assets/img/header/gift.svg +1 -0
- package/assets/img/header/logo.svg +5 -0
- package/assets/img/header/manage.svg +1 -0
- package/assets/img/header/msg.svg +1 -0
- package/assets/img/header/search-key-slash.svg +5 -0
- package/assets/img/header/send.svg +56 -0
- package/assets/img/header/setting.svg +1 -0
- package/assets/img/header/translator.svg +1 -0
- package/assets/img/header/vip.svg +1 -0
- package/assets/img/leftsidebar/arrow.svg +64 -0
- package/assets/img/leftsidebar/close.svg +49 -0
- package/assets/img/leftsidebar/fans.svg +1 -0
- package/assets/img/leftsidebar/medal.svg +1 -0
- package/assets/img/leftsidebar/more.svg +50 -0
- package/assets/img/leftsidebar/open.svg +51 -0
- package/assets/img/leftsidebar/post.svg +46 -0
- package/assets/img/leftsidebar/team.svg +1 -0
- package/assets/img/leftsidebar/united.svg +1 -0
- package/assets/img/list/post.svg +1 -0
- package/assets/img/mobile/miniprogram.jpg +0 -0
- package/assets/img/mobile/mp.jpg +0 -0
- package/assets/img/npc/attack.svg +69 -0
- package/assets/img/npc/buff.svg +20 -0
- package/assets/img/npc/energy.svg +1 -0
- package/assets/img/npc/miss.svg +1 -0
- package/assets/img/npc/npc.svg +1 -0
- package/assets/img/npc/radar.svg +45 -0
- package/assets/img/npc/shield.svg +1 -0
- package/assets/img/npc/sight.svg +1 -0
- package/assets/img/npc/skull.svg +15 -0
- package/assets/img/npc/target.svg +55 -0
- package/assets/img/price/jin.png +0 -0
- package/assets/img/price/tong.png +0 -0
- package/assets/img/price/yin.png +0 -0
- package/assets/img/price/zhuan.png +0 -0
- package/assets/img/rightsidebar/ac.svg +1 -0
- package/assets/img/rightsidebar/github.svg +1 -0
- package/assets/img/rightsidebar/repo.svg +1 -0
- package/assets/img/rightsidebar/topic_bg.svg +1 -0
- package/assets/img/rightsidebar/topic_bg_bps.svg +113 -0
- package/assets/img/single/author.svg +1 -0
- package/assets/img/single/directory-header.svg +1 -0
- package/assets/img/single/lock.svg +1 -0
- package/assets/img/single/modate.svg +24 -0
- package/assets/img/single/podate.svg +23 -0
- package/assets/img/single/ticket.svg +1 -0
- package/assets/img/suspend/ArrowsLeftRight.svg +1 -0
- package/assets/img/suspend/circle.svg +7 -0
- package/assets/img/suspend/collect.svg +1 -0
- package/assets/img/suspend/collect_slash.svg +1 -0
- package/assets/img/suspend/collect_slash_touchbar.svg +1 -0
- package/assets/img/suspend/collect_slash_touchbar_100.svg +1 -0
- package/assets/img/suspend/collect_touchbar.svg +1 -0
- package/assets/img/suspend/collect_touchbar_100.svg +1 -0
- package/assets/img/suspend/lafter_touchbar.svg +1 -0
- package/assets/img/suspend/later-on.svg +1 -0
- package/assets/img/suspend/line.svg +3 -0
- package/assets/img/suspend/more.svg +1 -0
- package/assets/img/suspend/pin_slash_24.svg +1 -0
- package/assets/img/suspend/pin_slash_touchbar.svg +1 -0
- package/assets/img/suspend/pin_slash_touchbar_24.svg +1 -0
- package/assets/img/suspend/pin_slash_touchbar_40.svg +1 -0
- package/assets/img/suspend/pin_touchbar.svg +1 -0
- package/assets/img/suspend/pin_touchbar_100.svg +1 -0
- package/assets/img/suspend/pin_touchbar_24.svg +1 -0
- package/assets/img/suspend/report_100.svg +1 -0
- package/assets/img/suspend/rss_touchbar.svg +1 -0
- package/assets/img/suspend/rss_touchbar_100.svg +1 -0
- package/assets/img/suspend/search.svg +3 -0
- package/assets/img/suspend/search_touchbar.svg +1 -0
- package/assets/img/widget/admin_gift.svg +10 -0
- package/assets/img/widget/gift.svg +1 -0
- package/assets/img/widget/heart.svg +17 -0
- package/assets/img/widget/heart1.svg +1 -0
- package/assets/img/widget/heart2.svg +11 -0
- package/assets/img/widget/heart3.svg +37 -0
- package/assets/img/widget/like.svg +1 -0
- package/assets/img/widget/like2.svg +1 -0
- package/assets/img/widget/like3.svg +14 -0
- package/assets/img/widget/like4.png +0 -0
- package/assets/img/widget/like4ing.gif +0 -0
- package/assets/img/widget/qq.svg +1 -0
- package/assets/img/widget/qr-code.svg +1 -0
- package/assets/img/widget/qzone.svg +1 -0
- package/assets/img/widget/records.svg +1 -0
- package/assets/img/widget/share-link.png +0 -0
- package/assets/img/widget/share.svg +13 -0
- package/assets/img/widget/share2.svg +19 -0
- package/assets/img/widget/star.svg +9 -0
- package/assets/img/widget/tieba.svg +1 -0
- package/assets/img/widget/unstar.svg +21 -0
- package/assets/img/widget/web_heart_animation.png +0 -0
- package/assets/img/widget/weibo.svg +1 -0
- package/assets/img/widget/weixin.svg +1 -0
- package/assets/js/a.js +46 -0
- package/assets/js/app.js +7 -0
- package/assets/js/code.js +13 -0
- package/assets/js/combo.js +40 -0
- package/assets/js/directory.js +114 -0
- package/assets/js/filter2.js +186 -0
- package/assets/js/fold.js +11 -0
- package/assets/js/gallery.js +14 -0
- package/assets/js/hljs_languages.js +177 -0
- package/assets/js/iframe.js +38 -0
- package/assets/js/img.js +23 -0
- package/assets/js/item/attribute_percent.js +88 -0
- package/assets/js/item/bind.js +18 -0
- package/assets/js/item/border.js +19 -0
- package/assets/js/item/border_quest.js +12 -0
- package/assets/js/item/color.js +25 -0
- package/assets/js/item/hljs_languages.js +177 -0
- package/assets/js/item/icon_url.js +15 -0
- package/assets/js/item/second_format.js +19 -0
- package/assets/js/jx3_element.js +73 -0
- package/assets/js/katex.js +181 -0
- package/assets/js/macro.js +16 -0
- package/assets/js/nextpage.js +4 -0
- package/assets/js/pswp.js +67 -0
- package/assets/js/pswp_template.js +66 -0
- package/assets/js/pz_iframe.js +30 -0
- package/assets/js/qixue.js +28 -0
- package/assets/js/renderImgPreview.js +18 -0
- package/assets/js/script.js +6 -0
- package/assets/js/stat.js +107 -0
- package/assets/js/talent2.js +21 -0
- package/assets/js/tex-mml-chtml.js +36310 -0
- package/assets/js/voice.js +238 -0
- package/assets/js/xss.js +130 -0
- package/babel.config.js +3 -0
- package/docs/README.md +78 -0
- package/i18n/index.js +134 -0
- package/i18n/messages/en-US.js +124 -0
- package/i18n/messages/vi.js +124 -0
- package/i18n/messages/zh-CN.js +124 -0
- package/i18n/messages/zh-TW.js +124 -0
- package/i18n/mixin.js +23 -0
- package/index.js +73 -0
- package/package.json +97 -0
- package/postcss.config.js +3 -0
- package/service/admin.js +20 -0
- package/service/author.js +94 -0
- package/service/breadcrumb.js +13 -0
- package/service/cms.js +137 -0
- package/service/comment.js +187 -0
- package/service/database.js +115 -0
- package/service/design.js +13 -0
- package/service/enum/CollectionPublic.js +13 -0
- package/service/enum/EquipPosition.js +48 -0
- package/service/enum/EquipType.js +33 -0
- package/service/fav.js +27 -0
- package/service/follow.js +55 -0
- package/service/github.js +15 -0
- package/service/header.js +42 -0
- package/service/item.js +22 -0
- package/service/resource.js +31 -0
- package/service/suspend.js +81 -0
- package/service/thx.js +60 -0
- package/src/App.vue +212 -0
- package/src/Bottom.vue +23 -0
- package/src/Box.vue +149 -0
- package/src/Breadcrumb.vue +141 -0
- package/src/CommonFooter.vue +69 -0
- package/src/CommonHeader.vue +270 -0
- package/src/Footer.vue +45 -0
- package/src/LeftSideToggle.vue +64 -0
- package/src/LeftSidebar.vue +123 -0
- package/src/Main.vue +48 -0
- package/src/RightSidebar.vue +61 -0
- package/src/SuspendCommon.vue +705 -0
- package/src/author/AuthorFans.vue +170 -0
- package/src/author/AuthorFollow.vue +205 -0
- package/src/author/AuthorGift.vue +286 -0
- package/src/author/AuthorHonor.vue +128 -0
- package/src/author/AuthorInfo.vue +245 -0
- package/src/author/AuthorLink.vue +113 -0
- package/src/author/AuthorMedals.vue +87 -0
- package/src/author/AuthorMsg.vue +25 -0
- package/src/author/AuthorPosts.vue +114 -0
- package/src/author/AuthorRss.vue +160 -0
- package/src/author/AuthorTeams.vue +106 -0
- package/src/author/Avatar.vue +168 -0
- package/src/author/UserPop.vue +198 -0
- package/src/bread/Admin.vue +400 -0
- package/src/bread/AdminButton.vue +31 -0
- package/src/bread/AdminDirectMessage.vue +73 -0
- package/src/bread/AdminDrop.vue +155 -0
- package/src/bread/Crumb.vue +27 -0
- package/src/bread/DesignTask.vue +194 -0
- package/src/comment/Avatar.vue +124 -0
- package/src/comment/CommentContent.vue +486 -0
- package/src/comment/CommentContentSimple.vue +240 -0
- package/src/comment/CommentInputForm.vue +182 -0
- package/src/comment/CommentWithReply.vue +261 -0
- package/src/comment/QuickReply.vue +64 -0
- package/src/comment/ReplyForReply.vue +127 -0
- package/src/comment/ReplyItem.vue +92 -0
- package/src/comment/ReplyList.vue +126 -0
- package/src/comment/Upload.vue +108 -0
- package/src/editor/Article.vue +230 -0
- package/src/editor/BoxResource.vue +441 -0
- package/src/editor/Resource.vue +623 -0
- package/src/editor/Tinymce.vue +204 -0
- package/src/editor/Upload.vue +277 -0
- package/src/editor/UploadAlum.vue +176 -0
- package/src/editor/UploadBanner.vue +156 -0
- package/src/editor/components/Author.vue +322 -0
- package/src/editor/components/Avatar.vue +95 -0
- package/src/editor/components/Buff.vue +80 -0
- package/src/editor/components/Combo.vue +259 -0
- package/src/editor/components/Equip.vue +299 -0
- package/src/editor/components/GameText.vue +242 -0
- package/src/editor/components/Item.vue +325 -0
- package/src/editor/components/ItemSimple.vue +134 -0
- package/src/editor/components/Medal.vue +43 -0
- package/src/editor/components/Npc.vue +215 -0
- package/src/editor/components/PostAuthor.vue +102 -0
- package/src/editor/components/Skill.vue +71 -0
- package/src/filters/clientBy.vue +96 -0
- package/src/filters/markBy.vue +177 -0
- package/src/filters/menuBy.vue +63 -0
- package/src/filters/orderBy.vue +170 -0
- package/src/filters/tagBy.vue +171 -0
- package/src/filters/topicBy.vue +151 -0
- package/src/filters/versionBy.vue +49 -0
- package/src/filters/zlpBy.vue +70 -0
- package/src/footer/copyright.vue +59 -0
- package/src/footer/links.vue +79 -0
- package/src/footer/official.vue +142 -0
- package/src/footer/resource.vue +146 -0
- package/src/header/alternate.vue +299 -0
- package/src/header/asset.vue +180 -0
- package/src/header/box.vue +161 -0
- package/src/header/box2.vue +479 -0
- package/src/header/bus.js +9 -0
- package/src/header/client.vue +183 -0
- package/src/header/lang.vue +136 -0
- package/src/header/logo.vue +95 -0
- package/src/header/manage.vue +200 -0
- package/src/header/message.vue +93 -0
- package/src/header/nav.vue +356 -0
- package/src/header/publish.vue +38 -0
- package/src/header/search.vue +120 -0
- package/src/header/search_map.json +3 -0
- package/src/header/shop.vue +121 -0
- package/src/header/user.vue +250 -0
- package/src/header/userInfo.vue +621 -0
- package/src/header/utils.js +126 -0
- package/src/header/vip.vue +120 -0
- package/src/interact/BoxcoinAdmin.vue +185 -0
- package/src/interact/BoxcoinRecords.vue +153 -0
- package/src/interact/BoxcoinUser.vue +194 -0
- package/src/interact/Contributors.vue +111 -0
- package/src/interact/Fav.vue +95 -0
- package/src/interact/Like.vue +61 -0
- package/src/interact/Rss.vue +163 -0
- package/src/interact/Share.vue +166 -0
- package/src/interact/WatchLater.vue +108 -0
- package/src/main.js +72 -0
- package/src/single/Author.vue +72 -0
- package/src/single/Collection.vue +176 -0
- package/src/single/Comment.vue +454 -0
- package/src/single/Creators.vue +214 -0
- package/src/single/PostDirectory.vue +147 -0
- package/src/single/PostHeader.vue +397 -0
- package/src/single/PostTopic.vue +127 -0
- package/src/single/SimpleThx.vue +217 -0
- package/src/single/Thx.vue +260 -0
- package/src/single/cms-single.vue +235 -0
- package/tailwind.config.js +13 -0
- package/utils/bus.js +5 -0
- package/utils/emotion.js +21 -0
- package/utils/index.js +36 -0
- package/vue.config.js +158 -0
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="m-single-box">
|
|
3
|
+
<!-- 头部 -->
|
|
4
|
+
<PostHeader :post="post" :stat="stat" :anonymous="anonymous">
|
|
5
|
+
<slot name="single-header"></slot>
|
|
6
|
+
</PostHeader>
|
|
7
|
+
|
|
8
|
+
<!-- 文章前 -->
|
|
9
|
+
<div class="m-single-prepend">
|
|
10
|
+
<!-- 联合创作者 -->
|
|
11
|
+
<Creators class="m-single-creators" :postId="id" :postType="post_type" @load-authors="loadAuthors" />
|
|
12
|
+
<!-- 文集小册 -->
|
|
13
|
+
<Collection
|
|
14
|
+
class="m-single-collection"
|
|
15
|
+
:id="collection_id"
|
|
16
|
+
:defaultVisible="collection_collapse"
|
|
17
|
+
@collectionUpdate="updateCollection"
|
|
18
|
+
/>
|
|
19
|
+
<slot name="single-prepend"></slot>
|
|
20
|
+
</div>
|
|
21
|
+
|
|
22
|
+
<!-- 文章内容 -->
|
|
23
|
+
<div class="m-single-post" v-if="visible">
|
|
24
|
+
<el-divider content-position="left">JX3BOX</el-divider>
|
|
25
|
+
<div class="m-single-content">
|
|
26
|
+
<slot></slot>
|
|
27
|
+
<!-- <ArticleMarkdown v-if="isMarkdown" :content="post_content" @directoryRendered="updateDirectory" /> -->
|
|
28
|
+
<Article :content="post_content" @directoryRendered="updateDirectory" />
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
|
+
<div class="m-single-null" v-else>
|
|
32
|
+
<el-alert :title="null_tip" type="warning" show-icon></el-alert>
|
|
33
|
+
</div>
|
|
34
|
+
|
|
35
|
+
<!-- 文章后 -->
|
|
36
|
+
<div class="m-single-append">
|
|
37
|
+
<slot name="single-append"></slot>
|
|
38
|
+
|
|
39
|
+
<!-- 打赏 -->
|
|
40
|
+
<Thx
|
|
41
|
+
class="m-single-thx"
|
|
42
|
+
:postId="id"
|
|
43
|
+
:postType="post_type"
|
|
44
|
+
:postTitle="post_title"
|
|
45
|
+
:userId="author_id"
|
|
46
|
+
:adminBoxcoinEnable="true"
|
|
47
|
+
:userBoxcoinEnable="true"
|
|
48
|
+
:authors="authors"
|
|
49
|
+
:client="post_client"
|
|
50
|
+
showRss
|
|
51
|
+
/>
|
|
52
|
+
|
|
53
|
+
<!-- 评论 -->
|
|
54
|
+
<div ref="commentView" class="m-single-comment">
|
|
55
|
+
<el-divider content-position="left">评论</el-divider>
|
|
56
|
+
<Comment :id="id" category="post" v-if="id && allow_comment" />
|
|
57
|
+
<el-alert title="作者没有开启评论功能" type="warning" show-icon v-else></el-alert>
|
|
58
|
+
</div>
|
|
59
|
+
</div>
|
|
60
|
+
|
|
61
|
+
<!-- 底部 -->
|
|
62
|
+
<footer class="m-single-footer">
|
|
63
|
+
<slot name="single-footer"></slot>
|
|
64
|
+
</footer>
|
|
65
|
+
|
|
66
|
+
<!-- <right-affix
|
|
67
|
+
:postId="id"
|
|
68
|
+
:postType="post_type"
|
|
69
|
+
:postTitle="post_title"
|
|
70
|
+
:showComment="id && allow_comment"
|
|
71
|
+
@toComment="toComment($event)"
|
|
72
|
+
></right-affix> -->
|
|
73
|
+
</div>
|
|
74
|
+
</template>
|
|
75
|
+
|
|
76
|
+
<script>
|
|
77
|
+
import PostHeader from "./PostHeader.vue";
|
|
78
|
+
import Creators from "./Creators.vue";
|
|
79
|
+
import Collection from "./Collection.vue";
|
|
80
|
+
import Thx from "./Thx.vue";
|
|
81
|
+
// import RightAffix from "./right-affix.vue";
|
|
82
|
+
import Article from "../editor/Article.vue";
|
|
83
|
+
// import ArticleMarkdown from "@jx3box/jx3box-editor/src/ArticleMarkdown.vue";
|
|
84
|
+
import Comment from "./Comment.vue";
|
|
85
|
+
import JX3BOX from "@jx3box/jx3box-common/data/jx3box.json";
|
|
86
|
+
import { getAppType } from "@jx3box/jx3box-common/js/utils";
|
|
87
|
+
|
|
88
|
+
const { __visibleMap } = JX3BOX;
|
|
89
|
+
|
|
90
|
+
export default {
|
|
91
|
+
name: "cms-single",
|
|
92
|
+
components: {
|
|
93
|
+
PostHeader,
|
|
94
|
+
Creators,
|
|
95
|
+
Collection,
|
|
96
|
+
Thx,
|
|
97
|
+
Article,
|
|
98
|
+
// ArticleMarkdown,
|
|
99
|
+
Comment,
|
|
100
|
+
// RightAffix,
|
|
101
|
+
},
|
|
102
|
+
props: ["post", "stat"],
|
|
103
|
+
data: function () {
|
|
104
|
+
return {
|
|
105
|
+
collection_data: "",
|
|
106
|
+
directory: false,
|
|
107
|
+
|
|
108
|
+
// 创作者
|
|
109
|
+
other_authors: [],
|
|
110
|
+
super_author: "",
|
|
111
|
+
};
|
|
112
|
+
},
|
|
113
|
+
computed: {
|
|
114
|
+
id: function () {
|
|
115
|
+
return ~~this.post?.ID || 0;
|
|
116
|
+
},
|
|
117
|
+
app_type: function () {
|
|
118
|
+
return getAppType();
|
|
119
|
+
},
|
|
120
|
+
post_type: function () {
|
|
121
|
+
return this.post?.post_type;
|
|
122
|
+
},
|
|
123
|
+
post_title: function () {
|
|
124
|
+
return this.post?.post_title;
|
|
125
|
+
},
|
|
126
|
+
author_id: function () {
|
|
127
|
+
return this.post?.post_author;
|
|
128
|
+
},
|
|
129
|
+
collection_id: function () {
|
|
130
|
+
return this.post?.post_collection;
|
|
131
|
+
},
|
|
132
|
+
collection_collapse: function () {
|
|
133
|
+
return this.post?.collection_collapse;
|
|
134
|
+
},
|
|
135
|
+
visible: function () {
|
|
136
|
+
return !!this.post?._check;
|
|
137
|
+
},
|
|
138
|
+
null_tip: function () {
|
|
139
|
+
let str = "作者设置了【";
|
|
140
|
+
str += __visibleMap[this.post?.visible];
|
|
141
|
+
str += "】";
|
|
142
|
+
return str;
|
|
143
|
+
},
|
|
144
|
+
post_content: function () {
|
|
145
|
+
return this.post?.post_content || "";
|
|
146
|
+
},
|
|
147
|
+
post_mode: function () {
|
|
148
|
+
return this.post?.post_mode || "tinymce";
|
|
149
|
+
},
|
|
150
|
+
isMarkdown: function () {
|
|
151
|
+
return this.post_mode == "markdown";
|
|
152
|
+
},
|
|
153
|
+
allow_comment: function () {
|
|
154
|
+
return !this.post?.comment;
|
|
155
|
+
},
|
|
156
|
+
extend_data: function () {
|
|
157
|
+
return {
|
|
158
|
+
collection_data: this.collection_data,
|
|
159
|
+
directory: this.directory,
|
|
160
|
+
};
|
|
161
|
+
},
|
|
162
|
+
authors: function () {
|
|
163
|
+
if (this.other_authors && this.other_authors.length) {
|
|
164
|
+
return [this.super_author, ...this.other_authors];
|
|
165
|
+
}
|
|
166
|
+
return [];
|
|
167
|
+
},
|
|
168
|
+
post_client: function () {
|
|
169
|
+
return this.post?.client || "all";
|
|
170
|
+
},
|
|
171
|
+
community_id: function () {
|
|
172
|
+
return this.post?.community_id || 0;
|
|
173
|
+
},
|
|
174
|
+
anonymous: function () {
|
|
175
|
+
return this.post?.anonymous ==1;
|
|
176
|
+
}
|
|
177
|
+
},
|
|
178
|
+
methods: {
|
|
179
|
+
updateCollection: function (val) {
|
|
180
|
+
this.collection_data = val;
|
|
181
|
+
},
|
|
182
|
+
updateDirectory: function (val) {
|
|
183
|
+
this.directory = val;
|
|
184
|
+
},
|
|
185
|
+
loadAuthors({ super_author, other_authors }) {
|
|
186
|
+
this.super_author = super_author;
|
|
187
|
+
this.other_authors = other_authors;
|
|
188
|
+
},
|
|
189
|
+
toComment() {
|
|
190
|
+
this.$refs.commentView.scrollIntoView({
|
|
191
|
+
block: "start",
|
|
192
|
+
behavior: "auto",
|
|
193
|
+
});
|
|
194
|
+
},
|
|
195
|
+
},
|
|
196
|
+
watch: {
|
|
197
|
+
extend_data: {
|
|
198
|
+
deep: true,
|
|
199
|
+
immediate: true,
|
|
200
|
+
handler: function (val) {
|
|
201
|
+
this.$emit("extendUpdate", val);
|
|
202
|
+
},
|
|
203
|
+
},
|
|
204
|
+
post_type: {
|
|
205
|
+
deep: true,
|
|
206
|
+
immediate: true,
|
|
207
|
+
handler: function (val) {
|
|
208
|
+
if (location.host.includes("localhost")) {
|
|
209
|
+
return;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
if (val && val !== this.app_type) {
|
|
213
|
+
location.href = `/${val}/${this.id}`;
|
|
214
|
+
}
|
|
215
|
+
},
|
|
216
|
+
},
|
|
217
|
+
community_id: {
|
|
218
|
+
immediate: true,
|
|
219
|
+
handler(val) {
|
|
220
|
+
if (val && val != 0) {
|
|
221
|
+
// 防止死循环
|
|
222
|
+
if (location.href.includes(`/community/${val}`)) {
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
location.href = `/community/${val}`;
|
|
226
|
+
}
|
|
227
|
+
},
|
|
228
|
+
},
|
|
229
|
+
},
|
|
230
|
+
};
|
|
231
|
+
</script>
|
|
232
|
+
|
|
233
|
+
<style lang="less">
|
|
234
|
+
@import "../../assets/css/single/cms-single.less";
|
|
235
|
+
</style>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** @type {import('tailwindcss').Config} */
|
|
2
|
+
module.exports = {
|
|
3
|
+
content: ["./public/**/*.html", "./src/**/*.{vue,js,ts,jsx,tsx}", "./demo/**/*.{vue,js,ts,jsx,tsx}"],
|
|
4
|
+
theme: {
|
|
5
|
+
extend: {},
|
|
6
|
+
},
|
|
7
|
+
plugins: [],
|
|
8
|
+
// 本项目已引入 normalize.css/组件库样式;关闭 preflight 避免 Tailwind 重置影响现有样式
|
|
9
|
+
corePlugins: {
|
|
10
|
+
preflight: false,
|
|
11
|
+
},
|
|
12
|
+
};
|
|
13
|
+
|
package/utils/bus.js
ADDED
package/utils/emotion.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import JX3_EMOTION from "@jx3box/jx3box-emotion";
|
|
2
|
+
function escapeHtml(str) {
|
|
3
|
+
return str.replace(/[<>"']/g, function (match) {
|
|
4
|
+
switch (match) {
|
|
5
|
+
case "<":
|
|
6
|
+
return "<";
|
|
7
|
+
case ">":
|
|
8
|
+
return ">";
|
|
9
|
+
case '"':
|
|
10
|
+
return """;
|
|
11
|
+
case "'":
|
|
12
|
+
return "'";
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
async function formatContent(val) {
|
|
17
|
+
const ins = new JX3_EMOTION(escapeHtml(val));
|
|
18
|
+
return await ins._renderHTML();
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export { formatContent };
|
package/utils/index.js
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { ElNotification } from "element-plus";
|
|
2
|
+
// 复制
|
|
3
|
+
export function copyText(text) {
|
|
4
|
+
if (window.navigator.clipboard) {
|
|
5
|
+
window.navigator.clipboard.writeText(text).then(
|
|
6
|
+
function () {
|
|
7
|
+
ElNotification.success({
|
|
8
|
+
title: "复制成功",
|
|
9
|
+
});
|
|
10
|
+
console.log("Async: Copying to clipboard was successful!");
|
|
11
|
+
},
|
|
12
|
+
function (err) {
|
|
13
|
+
console.error("Async: Could not copy text: ", err);
|
|
14
|
+
}
|
|
15
|
+
);
|
|
16
|
+
} else {
|
|
17
|
+
const textArea = document.createElement("textarea");
|
|
18
|
+
textArea.value = text;
|
|
19
|
+
document.body.appendChild(textArea);
|
|
20
|
+
textArea.focus();
|
|
21
|
+
textArea.select();
|
|
22
|
+
try {
|
|
23
|
+
const successful = document.execCommand("copy");
|
|
24
|
+
const msg = successful ? "successful" : "unsuccessful";
|
|
25
|
+
console.log("Fallback: Copying text command was " + msg);
|
|
26
|
+
} catch (err) {
|
|
27
|
+
console.error("Fallback: Oops, unable to copy", err);
|
|
28
|
+
}
|
|
29
|
+
document.body.removeChild(textArea);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// 去除最后的/
|
|
34
|
+
export function trimSlash(str) {
|
|
35
|
+
return str.replace(/\/$/, "");
|
|
36
|
+
}
|
package/vue.config.js
ADDED
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
const path = require("path");
|
|
2
|
+
const commonDomains = require("@jx3box/jx3box-common/data/jx3box.json");
|
|
3
|
+
|
|
4
|
+
module.exports = {
|
|
5
|
+
|
|
6
|
+
//❤️ define path for static files ~
|
|
7
|
+
publicPath: process.env.NODE_ENV === "development" ? "/" : process.env.STATIC_PATH,
|
|
8
|
+
|
|
9
|
+
//🌈多页面配置,详见 https://cli.vuejs.org/zh/config/#pages
|
|
10
|
+
pages: {
|
|
11
|
+
index: {
|
|
12
|
+
entry: "src/main.js",
|
|
13
|
+
template: "public/index.html",
|
|
14
|
+
filename: "index.html",
|
|
15
|
+
title: "JX3BOX",
|
|
16
|
+
},
|
|
17
|
+
article: {
|
|
18
|
+
title: "Article",
|
|
19
|
+
entry: "demo/A.js",
|
|
20
|
+
template: "public/article.html",
|
|
21
|
+
filename: "article/index.html",
|
|
22
|
+
},
|
|
23
|
+
tinymce: {
|
|
24
|
+
title: "Tinymce",
|
|
25
|
+
entry: "demo/T.js",
|
|
26
|
+
template: "public/tinymce.html",
|
|
27
|
+
filename: "tinymce/index.html",
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
//⚛️ Proxy ~
|
|
33
|
+
devServer: {
|
|
34
|
+
host: "localhost",
|
|
35
|
+
// 与 @jx3box/jx3box-common/js/api.js 对齐:
|
|
36
|
+
// 本地开发开启 `VUE_APP_PROXY_ENABLE=1` 后,会把请求 baseURL 切到 `${VUE_APP_PROXY_PREFIX}/${serviceKey}`
|
|
37
|
+
proxy: buildEnvProxy(),
|
|
38
|
+
allowedHosts: "all",
|
|
39
|
+
port: process.env.DEV_PORT || 12028,
|
|
40
|
+
},
|
|
41
|
+
|
|
42
|
+
// 依赖包(element-plus/theme-chalk 等)会输出大量 Sass deprecation 警告
|
|
43
|
+
// 这些不是运行错误,开启 quietDeps 让它们不刷屏(只保留项目自身的警告)
|
|
44
|
+
css: {
|
|
45
|
+
loaderOptions: {
|
|
46
|
+
sass: {
|
|
47
|
+
sassOptions: {
|
|
48
|
+
quietDeps: true,
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
scss: {
|
|
52
|
+
sassOptions: {
|
|
53
|
+
quietDeps: true,
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
|
|
59
|
+
// 过滤依赖包里的已知兼容性 warning(不影响运行,但会刷屏)
|
|
60
|
+
configureWebpack: {
|
|
61
|
+
stats: {
|
|
62
|
+
warningsFilter: [/node_modules[\\\\/]+@jx3box[\\\\/]+jx3box-common[\\\\/]+/],
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
|
|
66
|
+
//❤️ Webpack configuration
|
|
67
|
+
chainWebpack: (config) => {
|
|
68
|
+
|
|
69
|
+
//💝 in-line small imgs ~
|
|
70
|
+
config.module.rule("images").set("parser", {
|
|
71
|
+
dataUrlCondition: {
|
|
72
|
+
maxSize: 4 * 1024, // 4KiB
|
|
73
|
+
},
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
//💝 in-line svg imgs ~
|
|
77
|
+
config.module.rule("vue").use("vue-svg-inline-loader").loader("vue-svg-inline-loader");
|
|
78
|
+
|
|
79
|
+
//💖 import common less var * mixin ~
|
|
80
|
+
const types = ["vue-modules", "vue", "normal-modules", "normal"];
|
|
81
|
+
types.forEach((type) => addStyleResource(config.module.rule("less").oneOf(type)));
|
|
82
|
+
|
|
83
|
+
config.externals = {
|
|
84
|
+
tinyMCE: "tinyMCE",
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
// 注入全局样式资源(变量、mixin 等)
|
|
90
|
+
// 本地css/var.less、mixin.less会覆盖node_modules里的同名文件,方便定制化
|
|
91
|
+
// 注意此类文件都是变量和mixin函数,不要写全局样式,否则可能会被重复注入多次
|
|
92
|
+
function addStyleResource(rule) {
|
|
93
|
+
var preload_styles = [];
|
|
94
|
+
preload_styles.push(
|
|
95
|
+
path.resolve(__dirname, "./node_modules/@jx3box/jx3box-common/css/var.less"),
|
|
96
|
+
path.resolve(__dirname, "./node_modules/@jx3box/jx3box-common/css/mixin.less"),
|
|
97
|
+
path.resolve(__dirname, "./assets/css/var.less"),
|
|
98
|
+
path.resolve(__dirname, "./assets/css/mixin.less"),
|
|
99
|
+
path.resolve(__dirname, "./node_modules/csslab/base.less"),
|
|
100
|
+
);
|
|
101
|
+
rule.use("style-resource").loader("style-resources-loader").options({
|
|
102
|
+
patterns: preload_styles,
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
function normalizeTarget(value) {
|
|
108
|
+
if (!value) return "";
|
|
109
|
+
const trimmed = String(value).trim();
|
|
110
|
+
if (!trimmed) return "";
|
|
111
|
+
if (/^https?:\/\//i.test(trimmed)) return trimmed;
|
|
112
|
+
return `https://${trimmed.replace(/^\/+/, "")}`;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
function escapeRegExp(str) {
|
|
116
|
+
return String(str).replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
function buildEnvProxy() {
|
|
120
|
+
const nodeEnv = String(process.env.NODE_ENV || "").toLowerCase();
|
|
121
|
+
if (nodeEnv && nodeEnv !== "development") return {};
|
|
122
|
+
|
|
123
|
+
// Vue CLI 加载 .env 的时机/覆盖关系可能导致这里读不到或读到意外值:
|
|
124
|
+
// - 明确设置为 false 才禁用
|
|
125
|
+
// - 未设置/无法读取时,仍然生成代理(仅在 devServer 生效)
|
|
126
|
+
const rawEnabled = String(process.env.VUE_APP_PROXY_ENABLE || "").toLowerCase();
|
|
127
|
+
const disabled = ["0", "false", "no", "off"].includes(rawEnabled);
|
|
128
|
+
if (disabled) return {};
|
|
129
|
+
|
|
130
|
+
const prefix = process.env.VUE_APP_PROXY_PREFIX || "/__proxy";
|
|
131
|
+
const mk = (serviceKey, target) => {
|
|
132
|
+
const normalized = normalizeTarget(target);
|
|
133
|
+
if (!normalized) return {};
|
|
134
|
+
const context = `${prefix}/${serviceKey}`;
|
|
135
|
+
const contextRe = new RegExp(`^${escapeRegExp(context)}`);
|
|
136
|
+
return {
|
|
137
|
+
[context]: {
|
|
138
|
+
target: normalized,
|
|
139
|
+
changeOrigin: true,
|
|
140
|
+
secure: false,
|
|
141
|
+
cookieDomainRewrite: "",
|
|
142
|
+
pathRewrite: (p) => p.replace(contextRe, ""),
|
|
143
|
+
},
|
|
144
|
+
};
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
const serviceTargets = {
|
|
148
|
+
cms: process.env.VUE_APP_CMS_API || commonDomains.__cms,
|
|
149
|
+
next: process.env.VUE_APP_NEXT_API || commonDomains.__next,
|
|
150
|
+
team: process.env.VUE_APP_TEAM_API || commonDomains.__team,
|
|
151
|
+
pay: process.env.VUE_APP_PAY_API || commonDomains.__pay,
|
|
152
|
+
lua: process.env.VUE_APP_LUA_API || commonDomains.__lua,
|
|
153
|
+
node: process.env.VUE_APP_NODE_API || commonDomains.__node,
|
|
154
|
+
helper: process.env.VUE_APP_HELPER_API || commonDomains.__helperUrl,
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
return Object.keys(serviceTargets).reduce((acc, key) => Object.assign(acc, mk(key, serviceTargets[key])), {});
|
|
158
|
+
}
|