officialblock 1.0.1 → 1.0.2
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/README.md +25 -1
- package/dist/official-block.cjs.js +186 -1
- package/dist/official-block.es.js +22619 -73
- package/dist/official-block.umd.js +186 -1
- package/dist/style.css +1 -1
- package/package.json +12 -2
- package/src/App.vue +32 -82
- package/src/components/ArticleList/article.vue +73 -0
- package/src/components/ArticleList/contact.vue +95 -0
- package/src/components/ArticleList/index.vue +215 -48
- package/src/components/ArticleList/setting.vue +407 -0
- package/src/components/Button/index.vue +183 -0
- package/src/components/Media/index.vue +327 -0
- package/src/components/Operate/index.vue +74 -0
- package/src/components/RichTextEditor/RichTextEditor.vue +277 -0
- package/src/components/RichTextEditor/index.ts +7 -0
- package/src/components/ThemePreview/ThemePreview.vue +462 -0
- package/src/components/ThemePreview/index.ts +4 -0
- package/src/components/index.ts +3 -0
- package/src/composables/useTheme.ts +205 -0
- package/src/index.ts +15 -4
- package/src/main.ts +16 -1
- package/src/router/index.ts +84 -0
- package/src/style.css +0 -1
- package/src/styles/editor.scss +649 -0
- package/src/styles/test.scss +20 -0
- package/src/styles/variables.scss +639 -0
- package/src/utils/common.ts +13 -0
- package/src/utils/theme.ts +335 -0
- package/src/views/Layout.vue +247 -0
- package/src/views/NotFound.vue +114 -0
- package/src/views/components/ArticleListDemo.vue +167 -0
- package/src/views/components/HeroSlideDemo.vue +353 -0
- package/src/views/components/RichTextEditorDemo.vue +53 -0
- package/src/views/components/ThemeDemo.vue +477 -0
- package/src/views/guide/Installation.vue +234 -0
- package/src/views/guide/Introduction.vue +174 -0
- package/src/views/guide/QuickStart.vue +265 -0
package/src/index.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import type { App, Plugin } from 'vue'
|
|
2
|
-
import { ArticleList, HeroSlide } from './components'
|
|
2
|
+
import { ArticleList, HeroSlide, RichTextEditor, ThemePreview } from './components'
|
|
3
3
|
|
|
4
4
|
// 全部引入插件
|
|
5
5
|
const OfficialBlock = {
|
|
6
6
|
install: (app: App) => {
|
|
7
7
|
app.component('ArticleList', ArticleList)
|
|
8
8
|
app.component('HeroSlide', HeroSlide)
|
|
9
|
+
app.component('RichTextEditor', RichTextEditor)
|
|
10
|
+
app.component('ThemePreview', ThemePreview)
|
|
9
11
|
},
|
|
10
12
|
} satisfies Plugin
|
|
11
13
|
|
|
@@ -13,11 +15,15 @@ const OfficialBlock = {
|
|
|
13
15
|
export default OfficialBlock
|
|
14
16
|
|
|
15
17
|
// 按需引入 - 导出组件
|
|
16
|
-
export { ArticleList, HeroSlide }
|
|
18
|
+
export { ArticleList, HeroSlide, RichTextEditor, ThemePreview }
|
|
17
19
|
|
|
18
20
|
// 按需引入 - 导出单个组件的插件
|
|
19
21
|
export { ArticleListPlugin, HeroSlidePlugin } from './components'
|
|
20
22
|
|
|
23
|
+
// 导出主题相关功能
|
|
24
|
+
export { useTheme } from './composables/useTheme'
|
|
25
|
+
export { ThemeUtils, ResponsiveUtils, AnimationUtils, StorageUtils } from './utils/theme'
|
|
26
|
+
|
|
21
27
|
// 导出类型定义
|
|
22
28
|
export type {
|
|
23
29
|
ComponentProps,
|
|
@@ -25,5 +31,10 @@ export type {
|
|
|
25
31
|
ComponentSlots,
|
|
26
32
|
HeroSlideProps,
|
|
27
33
|
HeroSlideEmits,
|
|
28
|
-
SlideItem
|
|
29
|
-
|
|
34
|
+
SlideItem,
|
|
35
|
+
IDomEditor,
|
|
36
|
+
IEditorConfig,
|
|
37
|
+
IToolbarConfig
|
|
38
|
+
} from './components'
|
|
39
|
+
|
|
40
|
+
export type { ThemeConfig } from './composables/useTheme'
|
package/src/main.ts
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
import { createApp } from 'vue'
|
|
2
2
|
import './style.css'
|
|
3
|
+
import './styles/variables.scss'
|
|
4
|
+
import 'virtual:uno.css'
|
|
3
5
|
import App from './App.vue'
|
|
6
|
+
import router from './router'
|
|
7
|
+
import ArcoVue from '@arco-design/web-vue'
|
|
8
|
+
import ArcoVueIcon from '@arco-design/web-vue/es/icon';
|
|
9
|
+
import '@arco-design/web-vue/dist/arco.css'
|
|
4
10
|
|
|
5
|
-
createApp(App)
|
|
11
|
+
const app = createApp(App)
|
|
12
|
+
app.use(router)
|
|
13
|
+
app.use(ArcoVue)
|
|
14
|
+
app.use(ArcoVueIcon)
|
|
15
|
+
app.mount('#app')
|
|
16
|
+
|
|
17
|
+
// 初始化主题系统
|
|
18
|
+
import { useTheme } from './composables/useTheme'
|
|
19
|
+
const { initTheme } = useTheme()
|
|
20
|
+
initTheme()
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { createRouter, createWebHistory } from 'vue-router'
|
|
2
|
+
import type { RouteRecordRaw } from 'vue-router'
|
|
3
|
+
|
|
4
|
+
const routes: RouteRecordRaw[] = [
|
|
5
|
+
{
|
|
6
|
+
path: '/',
|
|
7
|
+
redirect: '/guide/introduction'
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
path: '/guide',
|
|
11
|
+
name: 'Guide',
|
|
12
|
+
component: () => import('../views/Layout.vue'),
|
|
13
|
+
children: [
|
|
14
|
+
{
|
|
15
|
+
path: 'introduction',
|
|
16
|
+
name: 'Introduction',
|
|
17
|
+
component: () => import('../views/guide/Introduction.vue'),
|
|
18
|
+
meta: { title: '介绍' }
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
path: 'installation',
|
|
22
|
+
name: 'Installation',
|
|
23
|
+
component: () => import('../views/guide/Installation.vue'),
|
|
24
|
+
meta: { title: '安装' }
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
path: 'quickstart',
|
|
28
|
+
name: 'QuickStart',
|
|
29
|
+
component: () => import('../views/guide/QuickStart.vue'),
|
|
30
|
+
meta: { title: '快速开始' }
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
path: '/components',
|
|
36
|
+
name: 'Components',
|
|
37
|
+
component: () => import('../views/Layout.vue'),
|
|
38
|
+
children: [
|
|
39
|
+
{
|
|
40
|
+
path: 'article-list',
|
|
41
|
+
name: 'ArticleListDemo',
|
|
42
|
+
component: () => import('../views/components/ArticleListDemo.vue'),
|
|
43
|
+
meta: { title: 'ArticleList 文章列表' }
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
path: 'hero-slide',
|
|
47
|
+
name: 'HeroSlideDemo',
|
|
48
|
+
component: () => import('../views/components/HeroSlideDemo.vue'),
|
|
49
|
+
meta: { title: 'HeroSlide 轮播图' }
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
path: 'rich-text-editor',
|
|
53
|
+
name: 'RichTextEditorDemo',
|
|
54
|
+
component: () => import('../views/components/RichTextEditorDemo.vue'),
|
|
55
|
+
meta: { title: 'RichTextEditor 富文本编辑器' }
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
path: 'theme',
|
|
59
|
+
name: 'ThemeDemo',
|
|
60
|
+
component: () => import('../views/components/ThemeDemo.vue'),
|
|
61
|
+
meta: { title: 'Theme 主题系统' }
|
|
62
|
+
}
|
|
63
|
+
]
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
path: '/:pathMatch(.*)*',
|
|
67
|
+
name: 'NotFound',
|
|
68
|
+
component: () => import('../views/NotFound.vue')
|
|
69
|
+
}
|
|
70
|
+
]
|
|
71
|
+
|
|
72
|
+
const router = createRouter({
|
|
73
|
+
history: createWebHistory(),
|
|
74
|
+
routes,
|
|
75
|
+
scrollBehavior(to, from, savedPosition) {
|
|
76
|
+
if (savedPosition) {
|
|
77
|
+
return savedPosition
|
|
78
|
+
} else {
|
|
79
|
+
return { top: 0 }
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
})
|
|
83
|
+
|
|
84
|
+
export default router
|