officialblock 1.0.0 → 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.
Files changed (42) hide show
  1. package/README.md +140 -5
  2. package/dist/official-block.cjs.js +186 -1
  3. package/dist/official-block.es.js +22627 -70
  4. package/dist/official-block.umd.js +186 -1
  5. package/dist/style.css +1 -1
  6. package/package.json +12 -2
  7. package/src/App.vue +32 -82
  8. package/src/components/ArticleList/article.vue +73 -0
  9. package/src/components/ArticleList/contact.vue +95 -0
  10. package/src/components/ArticleList/index.vue +220 -48
  11. package/src/components/ArticleList/setting.vue +407 -0
  12. package/src/components/Button/index.vue +183 -0
  13. package/src/components/HeroSlide/index.ts +1 -0
  14. package/src/components/HeroSlide/index.vue +21 -3
  15. package/src/components/HeroSlide/type.ts +19 -0
  16. package/src/components/Media/index.vue +327 -0
  17. package/src/components/Operate/index.vue +74 -0
  18. package/src/components/RichTextEditor/RichTextEditor.vue +277 -0
  19. package/src/components/RichTextEditor/index.ts +7 -0
  20. package/src/components/ThemePreview/ThemePreview.vue +462 -0
  21. package/src/components/ThemePreview/index.ts +4 -0
  22. package/src/components/index.ts +14 -0
  23. package/src/composables/useTheme.ts +205 -0
  24. package/src/index.ts +26 -8
  25. package/src/main.ts +16 -1
  26. package/src/router/index.ts +84 -0
  27. package/src/style.css +0 -1
  28. package/src/styles/editor.scss +649 -0
  29. package/src/styles/test.scss +20 -0
  30. package/src/styles/variables.scss +639 -0
  31. package/src/types.ts +8 -0
  32. package/src/utils/common.ts +13 -0
  33. package/src/utils/theme.ts +335 -0
  34. package/src/views/Layout.vue +247 -0
  35. package/src/views/NotFound.vue +114 -0
  36. package/src/views/components/ArticleListDemo.vue +167 -0
  37. package/src/views/components/HeroSlideDemo.vue +353 -0
  38. package/src/views/components/RichTextEditorDemo.vue +53 -0
  39. package/src/views/components/ThemeDemo.vue +477 -0
  40. package/src/views/guide/Installation.vue +234 -0
  41. package/src/views/guide/Introduction.vue +174 -0
  42. package/src/views/guide/QuickStart.vue +265 -0
package/src/index.ts CHANGED
@@ -1,22 +1,40 @@
1
1
  import type { App, Plugin } from 'vue'
2
- import ArticleList from './components/ArticleList'
3
- import HeroSlide from './components/HeroSlide'
2
+ import { ArticleList, HeroSlide, RichTextEditor, ThemePreview } from './components'
4
3
 
5
4
  // 全部引入插件
6
- export default {
5
+ const OfficialBlock = {
7
6
  install: (app: App) => {
8
7
  app.component('ArticleList', ArticleList)
9
8
  app.component('HeroSlide', HeroSlide)
9
+ app.component('RichTextEditor', RichTextEditor)
10
+ app.component('ThemePreview', ThemePreview)
10
11
  },
11
12
  } satisfies Plugin
12
13
 
14
+ // 默认导出插件
15
+ export default OfficialBlock
16
+
13
17
  // 按需引入 - 导出组件
14
- export { ArticleList }
15
- export { HeroSlide }
18
+ export { ArticleList, HeroSlide, RichTextEditor, ThemePreview }
16
19
 
17
20
  // 按需引入 - 导出单个组件的插件
18
- export { default as ArticleListPlugin } from './components/ArticleList'
19
- export { default as HeroSlidePlugin } from './components/HeroSlide'
21
+ export { ArticleListPlugin, HeroSlidePlugin } from './components'
22
+
23
+ // 导出主题相关功能
24
+ export { useTheme } from './composables/useTheme'
25
+ export { ThemeUtils, ResponsiveUtils, AnimationUtils, StorageUtils } from './utils/theme'
20
26
 
21
27
  // 导出类型定义
22
- export type { ComponentProps, ComponentEmits, ComponentSlots } from './components/ArticleList/type'
28
+ export type {
29
+ ComponentProps,
30
+ ComponentEmits,
31
+ ComponentSlots,
32
+ HeroSlideProps,
33
+ HeroSlideEmits,
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).mount('#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
package/src/style.css CHANGED
@@ -62,7 +62,6 @@ button:focus-visible {
62
62
  max-width: 1280px;
63
63
  margin: 0 auto;
64
64
  padding: 2rem;
65
- text-align: center;
66
65
  }
67
66
 
68
67
  @media (prefers-color-scheme: light) {