@smartos-lib/components 1.7.0-beta.0
Sign up to get free protection for your applications and to get access to all the features.
- package/.eslintrc +12 -0
- package/.eslintrc-auto-import.json +332 -0
- package/Components.code-workspace +143 -0
- package/LICENSE +21 -0
- package/dist/smart-docx-editor/index.d.ts +2 -0
- package/dist/smart-docx-editor/index.js +68 -0
- package/dist/smart-file-preview/index.d.ts +18 -0
- package/dist/smart-file-preview/index.js +37 -0
- package/dist/smart-upload/index.d.ts +2 -0
- package/dist/smart-upload/index.js +800 -0
- package/index.html +16 -0
- package/package.json +23 -0
- package/public/favicon.svg +6 -0
- package/scripts/components.vite.config.ts +96 -0
- package/scripts/shared.ts +9 -0
- package/src/App.vue +28 -0
- package/src/components/Logo/index.vue +15 -0
- package/src/components-private/.gitkeep +0 -0
- package/src/composables/useElementStyle.ts +23 -0
- package/src/composables/useNaiveStyle.ts +43 -0
- package/src/composables/useNaiveTheme.ts +71 -0
- package/src/composables/useSmart.ts +36 -0
- package/src/layouts/default.vue +3 -0
- package/src/main.ts +33 -0
- package/src/modules/pinia/index.ts +8 -0
- package/src/modules/progress/index.ts +12 -0
- package/src/modules/router/install.ts +9 -0
- package/src/modules/router/routes.ts +40 -0
- package/src/pages/[...all].vue +21 -0
- package/src/pages/frame/component/[name].vue +14 -0
- package/src/pages/frame/index.vue +81 -0
- package/src/pages/index/composables/useTabsManage.ts +46 -0
- package/src/pages/index/index.vue +111 -0
- package/src/pages/index/type.ts +13 -0
- package/src/pages/index/utils/index.ts +41 -0
- package/src/settings.ts +9 -0
- package/src/shared/components.ts +52 -0
- package/src/shared/env.ts +11 -0
- package/src/shared/unocss.theme.ts +1600 -0
- package/src/stores/theme.ts +29 -0
- package/src/styles/element.scss +3 -0
- package/src/styles/styles.scss +21 -0
- package/src/types.ts +20 -0
- package/src/utils/callCustomElementExposed.ts +6 -0
- package/src/utils/deepCloneESModule.ts +10 -0
- package/src/utils/defineCustomElements.ts +18 -0
- package/src/utils/formatComponentsGlob.ts +16 -0
- package/src/utils/getFileMD5.ts +31 -0
- package/src/utils/getFileNameAndExt.ts +11 -0
- package/src/utils/isFileEqual.ts +13 -0
- package/src/utils/jsonToFormData.ts +8 -0
- package/src/web-components/smart-docx-drive-page/App.vue +37 -0
- package/src/web-components/smart-docx-drive-page/apis/doc.ts +85 -0
- package/src/web-components/smart-docx-drive-page/apis/file.ts +278 -0
- package/src/web-components/smart-docx-drive-page/apis/folder.ts +72 -0
- package/src/web-components/smart-docx-drive-page/children/Home.vue +8 -0
- package/src/web-components/smart-docx-drive-page/children/Me.vue +47 -0
- package/src/web-components/smart-docx-drive-page/components/CustomImage.vue +26 -0
- package/src/web-components/smart-docx-drive-page/components/CustomPopover.vue +62 -0
- package/src/web-components/smart-docx-drive-page/components/DocxDir.vue +99 -0
- package/src/web-components/smart-docx-drive-page/components/DocxDoc.vue +132 -0
- package/src/web-components/smart-docx-drive-page/components/DocxDownloadPopoverItem.vue +41 -0
- package/src/web-components/smart-docx-drive-page/components/DocxFileList.vue +156 -0
- package/src/web-components/smart-docx-drive-page/components/DocxPreview.vue +33 -0
- package/src/web-components/smart-docx-drive-page/components/DocxUpload.vue +164 -0
- package/src/web-components/smart-docx-drive-page/components/FileIcon.vue +62 -0
- package/src/web-components/smart-docx-drive-page/components-private/Header.vue +65 -0
- package/src/web-components/smart-docx-drive-page/components-private/Logo.vue +15 -0
- package/src/web-components/smart-docx-drive-page/components-private/Menu.vue +34 -0
- package/src/web-components/smart-docx-drive-page/components-private/Navbar.vue +36 -0
- package/src/web-components/smart-docx-drive-page/composables/useFullscreenElDialog.ts +41 -0
- package/src/web-components/smart-docx-drive-page/composables/usePrompt.ts +73 -0
- package/src/web-components/smart-docx-drive-page/data.ts +10 -0
- package/src/web-components/smart-docx-drive-page/external-style/custom-popover.sass +8 -0
- package/src/web-components/smart-docx-drive-page/external-style/index.sass +1 -0
- package/src/web-components/smart-docx-drive-page/index.ts +20 -0
- package/src/web-components/smart-docx-drive-page/index.vue +39 -0
- package/src/web-components/smart-docx-drive-page/info.ts +2 -0
- package/src/web-components/smart-docx-drive-page/stores/menu.ts +60 -0
- package/src/web-components/smart-docx-drive-page/types.ts +51 -0
- package/src/web-components/smart-docx-drive-page/utils/file-actions.ts +63 -0
- package/src/web-components/smart-docx-drive-page/utils/file.ts +31 -0
- package/src/web-components/smart-docx-editor/App.vue +32 -0
- package/src/web-components/smart-docx-editor/MarkdownShortcuts/components/Markdown.vue +202 -0
- package/src/web-components/smart-docx-editor/MarkdownShortcuts/components/Menu.vue +100 -0
- package/src/web-components/smart-docx-editor/MarkdownShortcuts/components/types.ts +6 -0
- package/src/web-components/smart-docx-editor/MarkdownShortcuts/components-react/Markdown.tsx +71 -0
- package/src/web-components/smart-docx-editor/MarkdownShortcuts/components-react/MarkdownElement.tsx +81 -0
- package/src/web-components/smart-docx-editor/MarkdownShortcuts/components-react/elements/Blockquote/index.sass +6 -0
- package/src/web-components/smart-docx-editor/MarkdownShortcuts/components-react/elements/Blockquote/index.tsx +12 -0
- package/src/web-components/smart-docx-editor/MarkdownShortcuts/components-react/elements/Heading/index.sass +14 -0
- package/src/web-components/smart-docx-editor/MarkdownShortcuts/components-react/elements/Heading/index.tsx +17 -0
- package/src/web-components/smart-docx-editor/MarkdownShortcuts/components-react/elements/List/index.scss +16 -0
- package/src/web-components/smart-docx-editor/MarkdownShortcuts/components-react/elements/List/index.tsx +39 -0
- package/src/web-components/smart-docx-editor/MarkdownShortcuts/components-react/types/custom-types.d.ts +69 -0
- package/src/web-components/smart-docx-editor/MarkdownShortcuts/composables/useTextSelection.ts +50 -0
- package/src/web-components/smart-docx-editor/MarkdownShortcuts/index.sass +19 -0
- package/src/web-components/smart-docx-editor/MarkdownShortcuts/index.vue +21 -0
- package/src/web-components/smart-docx-editor/MarkdownShortcuts/shared/const.ts +23 -0
- package/src/web-components/smart-docx-editor/MarkdownShortcuts/utils/slateHelpers.ts +23 -0
- package/src/web-components/smart-docx-editor/data.ts +38 -0
- package/src/web-components/smart-docx-editor/demo.vue +11 -0
- package/src/web-components/smart-docx-editor/index.md +3 -0
- package/src/web-components/smart-docx-editor/index.ts +5 -0
- package/src/web-components/smart-docx-editor/index.vue +12 -0
- package/src/web-components/smart-docx-editor/info.ts +2 -0
- package/src/web-components/smart-file-preview/category/Code.vue +171 -0
- package/src/web-components/smart-file-preview/category/Image.vue +49 -0
- package/src/web-components/smart-file-preview/category/Pdf.vue +14 -0
- package/src/web-components/smart-file-preview/category/Video.vue +27 -0
- package/src/web-components/smart-file-preview/demo.vue +34 -0
- package/src/web-components/smart-file-preview/index.md +5 -0
- package/src/web-components/smart-file-preview/index.ts +29 -0
- package/src/web-components/smart-file-preview/index.vue +56 -0
- package/src/web-components/smart-file-preview/info.ts +2 -0
- package/src/web-components/smart-file-preview/shared/const.ts +4 -0
- package/src/web-components/smart-file-preview/types.ts +38 -0
- package/src/web-components/smart-upload/index.ts +5 -0
- package/src/web-components/smart-upload/index.vue +101 -0
- package/src/web-components/smart-upload/info.ts +2 -0
- package/src/web-components/smart-upload/types.ts +28 -0
- package/tsconfig.json +15 -0
- package/types/auto-imports.d.ts +975 -0
- package/types/components.d.ts +14 -0
- package/types/env.d.ts +8 -0
- package/types/shims.d.ts +6 -0
- package/unocss.config.ts +23 -0
- package/vite.config.ts +60 -0
@@ -0,0 +1,14 @@
|
|
1
|
+
/* eslint-disable */
|
2
|
+
/* prettier-ignore */
|
3
|
+
// @ts-nocheck
|
4
|
+
// Generated by unplugin-vue-components
|
5
|
+
// Read more: https://github.com/vuejs/core/pull/3399
|
6
|
+
export {}
|
7
|
+
|
8
|
+
declare module 'vue' {
|
9
|
+
export interface GlobalComponents {
|
10
|
+
Logo: typeof import('./../src/components/Logo/index.vue')['default']
|
11
|
+
RouterLink: typeof import('vue-router')['RouterLink']
|
12
|
+
RouterView: typeof import('vue-router')['RouterView']
|
13
|
+
}
|
14
|
+
}
|
package/types/env.d.ts
ADDED
package/types/shims.d.ts
ADDED
package/unocss.config.ts
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
import { dirname, resolve } from 'node:path';
|
2
|
+
import { fileURLToPath } from 'node:url';
|
3
|
+
import { defineConfig } from 'unocss';
|
4
|
+
import { outputFileSync } from 'fs-extra';
|
5
|
+
import { dataToEsm } from '@rollup/pluginutils';
|
6
|
+
import config from '../.vitepress/unocss.config';
|
7
|
+
|
8
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
9
|
+
|
10
|
+
export default defineConfig({
|
11
|
+
...config,
|
12
|
+
extendTheme: (theme) => {
|
13
|
+
// 始终生成一个 UnoCSS 主题样式配置文件, 方便在 JS 中引用
|
14
|
+
outputFileSync(
|
15
|
+
resolve(__dirname, './src/shared/unocss.theme.ts'),
|
16
|
+
`/* eslint-disable */\n\n${dataToEsm(theme, {
|
17
|
+
preferConst: true,
|
18
|
+
indent: ' ',
|
19
|
+
objectShorthand: true,
|
20
|
+
})}`,
|
21
|
+
);
|
22
|
+
},
|
23
|
+
});
|
package/vite.config.ts
ADDED
@@ -0,0 +1,60 @@
|
|
1
|
+
import { dirname, resolve } from 'node:path';
|
2
|
+
import { fileURLToPath } from 'node:url';
|
3
|
+
import { defineConfig } from 'vite';
|
4
|
+
import Unocss from 'unocss/vite';
|
5
|
+
import Pages from 'vite-plugin-pages';
|
6
|
+
import Layouts from 'vite-plugin-vue-layouts';
|
7
|
+
import Inspect from 'vite-plugin-inspect';
|
8
|
+
import { deepMerge } from 'mixte';
|
9
|
+
import { alias } from '../../meta/alias';
|
10
|
+
import { SERVER_PROXY, SERVER_URL } from '../apis/test-utils/env';
|
11
|
+
import ComponentsViteConfig from './scripts/components.vite.config';
|
12
|
+
|
13
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
14
|
+
|
15
|
+
export default defineConfig(({ mode }) => {
|
16
|
+
/** 是否是开发模式 */
|
17
|
+
const isDev = mode === 'development';
|
18
|
+
|
19
|
+
return deepMerge(
|
20
|
+
ComponentsViteConfig({
|
21
|
+
// 当前 Editor 项目专用 vite 插件
|
22
|
+
plugins: [
|
23
|
+
// 以文件系统为基础的路由
|
24
|
+
Pages({
|
25
|
+
dirs: resolve(__dirname, './src/pages'),
|
26
|
+
extensions: ['vue'],
|
27
|
+
exclude: ['**/components', '**/composables'],
|
28
|
+
resolver: 'vue',
|
29
|
+
}),
|
30
|
+
// 页面布局系统
|
31
|
+
Layouts(),
|
32
|
+
// 原子化 CSS 引擎
|
33
|
+
Unocss(),
|
34
|
+
// 插件调试
|
35
|
+
Inspect(),
|
36
|
+
],
|
37
|
+
}),
|
38
|
+
// 当前 Editor 项目专用配置
|
39
|
+
{
|
40
|
+
// 路径别名
|
41
|
+
resolve: {
|
42
|
+
alias,
|
43
|
+
},
|
44
|
+
// 开发服务器选项
|
45
|
+
server: {
|
46
|
+
port: 666,
|
47
|
+
proxy: {
|
48
|
+
[SERVER_PROXY]: SERVER_URL,
|
49
|
+
},
|
50
|
+
},
|
51
|
+
// 预览选项
|
52
|
+
preview: {
|
53
|
+
port: 888,
|
54
|
+
proxy: {
|
55
|
+
[SERVER_PROXY]: SERVER_URL,
|
56
|
+
},
|
57
|
+
},
|
58
|
+
},
|
59
|
+
);
|
60
|
+
});
|