officialblock 1.0.1 → 1.0.3

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 (40) hide show
  1. package/README.md +25 -1
  2. package/dist/official-block.cjs.js +195 -1
  3. package/dist/official-block.es.js +27230 -72
  4. package/dist/official-block.umd.js +195 -1
  5. package/dist/style.css +1 -1
  6. package/package.json +13 -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 -46
  11. package/src/components/ArticleList/setting.vue +709 -0
  12. package/src/components/Button/index.vue +183 -0
  13. package/src/components/Media/index.vue +327 -0
  14. package/src/components/Operate/index.vue +74 -0
  15. package/src/components/RichTextEditor/RichTextEditor.vue +277 -0
  16. package/src/components/RichTextEditor/index.ts +7 -0
  17. package/src/components/ThemePreview/ThemePreview.vue +462 -0
  18. package/src/components/ThemePreview/index.ts +4 -0
  19. package/src/components/index.ts +3 -0
  20. package/src/composables/useTheme.ts +205 -0
  21. package/src/index.ts +15 -4
  22. package/src/main.ts +16 -1
  23. package/src/router/index.ts +96 -0
  24. package/src/style.css +2 -4
  25. package/src/styles/editor.scss +649 -0
  26. package/src/styles/test.scss +20 -0
  27. package/src/styles/variables.scss +669 -0
  28. package/src/utils/common.ts +13 -0
  29. package/src/utils/theme.ts +335 -0
  30. package/src/views/Layout.vue +250 -0
  31. package/src/views/NotFound.vue +114 -0
  32. package/src/views/components/ArticleListDemo.vue +166 -0
  33. package/src/views/components/DragLimitDemo.vue +573 -0
  34. package/src/views/components/DragSortDemo.vue +610 -0
  35. package/src/views/components/HeroSlideDemo.vue +353 -0
  36. package/src/views/components/RichTextEditorDemo.vue +53 -0
  37. package/src/views/components/ThemeDemo.vue +477 -0
  38. package/src/views/guide/Installation.vue +234 -0
  39. package/src/views/guide/Introduction.vue +174 -0
  40. 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
- } from './components'
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,96 @@
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
+ path: 'drag-sort',
65
+ name: 'DragSortDemo',
66
+ component: () => import('../views/components/DragSortDemo.vue'),
67
+ meta: { title: '拖拽排序演示' }
68
+ },
69
+ {
70
+ path: 'drag-limit',
71
+ name: 'DragLimitDemo',
72
+ component: () => import('../views/components/DragLimitDemo.vue'),
73
+ meta: { title: '拖拽限制演示' }
74
+ }
75
+ ]
76
+ },
77
+ {
78
+ path: '/:pathMatch(.*)*',
79
+ name: 'NotFound',
80
+ component: () => import('../views/NotFound.vue')
81
+ }
82
+ ]
83
+
84
+ const router = createRouter({
85
+ history: createWebHistory(),
86
+ routes,
87
+ scrollBehavior(to, from, savedPosition) {
88
+ if (savedPosition) {
89
+ return savedPosition
90
+ } else {
91
+ return { top: 0 }
92
+ }
93
+ }
94
+ })
95
+
96
+ export default router
package/src/style.css CHANGED
@@ -59,10 +59,8 @@ button:focus-visible {
59
59
  }
60
60
 
61
61
  #app {
62
- max-width: 1280px;
63
- margin: 0 auto;
64
- padding: 2rem;
65
- text-align: center;
62
+ width: 100%;
63
+ /* margin: 0 auto; */
66
64
  }
67
65
 
68
66
  @media (prefers-color-scheme: light) {