@easy-editor/materials-dashboard-text 0.0.10 → 0.0.11
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/.vite/plugins/vite-plugin-external-deps.ts +224 -0
- package/CHANGELOG.md +6 -0
- package/dist/component.esm.js +123 -29
- package/dist/component.esm.js.map +1 -1
- package/dist/component.js +123 -28
- package/dist/component.js.map +1 -1
- package/dist/component.min.js +1 -1
- package/dist/component.min.js.map +1 -1
- package/dist/index.cjs +364 -76
- package/dist/index.cjs.map +1 -1
- package/dist/index.esm.js +364 -76
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +365 -77
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist/meta.esm.js +249 -92
- package/dist/meta.esm.js.map +1 -1
- package/dist/meta.js +253 -96
- package/dist/meta.js.map +1 -1
- package/dist/meta.min.js +1 -1
- package/dist/meta.min.js.map +1 -1
- package/dist/src/component.d.ts +48 -0
- package/dist/src/configure.d.ts +6 -0
- package/dist/src/index.d.ts +6 -0
- package/dist/src/meta.d.ts +6 -0
- package/dist/src/snippets.d.ts +6 -0
- package/package.json +3 -2
- package/vite.config.ts +16 -26
- package/dist/component.d.ts +0 -14
- package/dist/configure.d.ts +0 -3
- package/dist/index.d.ts +0 -6
- package/dist/meta.d.ts +0 -3
- package/dist/snippets.d.ts +0 -3
- /package/dist/{constants.d.ts → src/constants.d.ts} +0 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Text Component
|
|
3
|
+
* 文本组件 - 支持普通文本、链接、标题、发光效果
|
|
4
|
+
*/
|
|
5
|
+
import type { CSSProperties, Ref } from 'react';
|
|
6
|
+
export type TextAlign = 'left' | 'center' | 'right';
|
|
7
|
+
export type VerticalAlign = 'top' | 'middle' | 'bottom';
|
|
8
|
+
export interface TextProps {
|
|
9
|
+
ref?: Ref<HTMLDivElement>;
|
|
10
|
+
/** 文本内容 */
|
|
11
|
+
content?: string;
|
|
12
|
+
/** 字体大小 */
|
|
13
|
+
fontSize?: number;
|
|
14
|
+
/** 字体粗细 */
|
|
15
|
+
fontWeight?: number | 'normal' | 'bold';
|
|
16
|
+
/** 字体家族 */
|
|
17
|
+
fontFamily?: string;
|
|
18
|
+
/** 颜色 */
|
|
19
|
+
color?: string;
|
|
20
|
+
/** 水平对齐 */
|
|
21
|
+
textAlign?: TextAlign;
|
|
22
|
+
/** 垂直对齐 */
|
|
23
|
+
verticalAlign?: VerticalAlign;
|
|
24
|
+
/** 行高 */
|
|
25
|
+
lineHeight?: number;
|
|
26
|
+
/** 字间距 */
|
|
27
|
+
letterSpacing?: number;
|
|
28
|
+
/** 是否为链接 */
|
|
29
|
+
isLink?: boolean;
|
|
30
|
+
/** 链接地址 */
|
|
31
|
+
href?: string;
|
|
32
|
+
/** 链接打开方式 */
|
|
33
|
+
target?: '_self' | '_blank';
|
|
34
|
+
/** 下划线 */
|
|
35
|
+
underline?: boolean;
|
|
36
|
+
/** 发光效果 */
|
|
37
|
+
glowEnable?: boolean;
|
|
38
|
+
/** 发光颜色 */
|
|
39
|
+
glowColor?: string;
|
|
40
|
+
/** 发光强度 */
|
|
41
|
+
glowIntensity?: number;
|
|
42
|
+
/** 显隐控制 */
|
|
43
|
+
condition?: boolean;
|
|
44
|
+
/** 外部样式 */
|
|
45
|
+
style?: CSSProperties;
|
|
46
|
+
}
|
|
47
|
+
export declare const Text: React.FC<TextProps>;
|
|
48
|
+
export default Text;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@easy-editor/materials-dashboard-text",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.11",
|
|
4
4
|
"description": "Text component for EasyEditor dashboard",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"repository": {
|
|
33
33
|
"type": "git",
|
|
34
34
|
"url": "https://github.com/Easy-Editor/EasyMaterials",
|
|
35
|
-
"directory": "packages/dashboard/text"
|
|
35
|
+
"directory": "packages/dashboard/basic/text"
|
|
36
36
|
},
|
|
37
37
|
"bugs": {
|
|
38
38
|
"url": "https://github.com/Easy-Editor/EasyMaterials/issues"
|
|
@@ -48,6 +48,7 @@
|
|
|
48
48
|
"@easy-editor/materials-shared": "0.0.0"
|
|
49
49
|
},
|
|
50
50
|
"scripts": {
|
|
51
|
+
"dev": "vite",
|
|
51
52
|
"format": "biome format --write .",
|
|
52
53
|
"lint": "biome check .",
|
|
53
54
|
"build": "npm-run-all -nl build:*",
|
package/vite.config.ts
CHANGED
|
@@ -6,59 +6,49 @@
|
|
|
6
6
|
import { defineConfig } from 'vite'
|
|
7
7
|
import react from '@vitejs/plugin-react'
|
|
8
8
|
import { materialDevPlugin } from './.vite/plugins/vite-plugin-material-dev'
|
|
9
|
+
import { externalDeps } from './.vite/plugins/vite-plugin-external-deps'
|
|
9
10
|
|
|
10
11
|
export default defineConfig({
|
|
11
12
|
plugins: [
|
|
12
13
|
react(),
|
|
14
|
+
// 外部化 React/ReactDOM,使用父应用提供的实例
|
|
15
|
+
externalDeps({
|
|
16
|
+
externals: ['react', 'react-dom', 'react/jsx-runtime', '@easy-editor/core'],
|
|
17
|
+
globals: {
|
|
18
|
+
react: 'React',
|
|
19
|
+
'react-dom': 'ReactDOM',
|
|
20
|
+
'react/jsx-runtime': 'jsxRuntime',
|
|
21
|
+
'@easy-editor/core': 'EasyEditorCore',
|
|
22
|
+
},
|
|
23
|
+
}),
|
|
13
24
|
materialDevPlugin({
|
|
14
25
|
entry: '/src/index.tsx',
|
|
15
26
|
}),
|
|
16
27
|
],
|
|
17
|
-
|
|
18
28
|
server: {
|
|
19
29
|
port: 5001,
|
|
20
30
|
host: 'localhost',
|
|
21
31
|
cors: true,
|
|
22
|
-
// HMR 配置
|
|
23
32
|
hmr: {
|
|
24
33
|
port: 5001,
|
|
25
34
|
},
|
|
26
35
|
},
|
|
27
|
-
|
|
28
|
-
// 优化依赖处理
|
|
29
|
-
optimizeDeps: {
|
|
30
|
-
// 排除这些依赖,让它们从平台端加载
|
|
31
|
-
exclude: ['@easy-editor/core', '@easy-editor/materials-shared'],
|
|
32
|
-
},
|
|
33
|
-
|
|
34
|
-
// 构建配置(用于生产环境,开发时不影响)
|
|
35
36
|
build: {
|
|
36
|
-
|
|
37
|
-
entry: 'src/index.tsx',
|
|
38
|
-
formats: ['es'],
|
|
39
|
-
fileName: 'index',
|
|
40
|
-
},
|
|
37
|
+
target: 'esnext',
|
|
41
38
|
rollupOptions: {
|
|
42
|
-
//
|
|
43
|
-
external: ['react', 'react-dom', '
|
|
39
|
+
// 确保生产构建也外部化这些依赖
|
|
40
|
+
external: ['react', 'react-dom', 'react/jsx-runtime', '@easy-editor/core'],
|
|
44
41
|
output: {
|
|
45
42
|
globals: {
|
|
46
43
|
react: 'React',
|
|
47
44
|
'react-dom': 'ReactDOM',
|
|
45
|
+
'react/jsx-runtime': 'jsxRuntime',
|
|
46
|
+
'@easy-editor/core': 'EasyEditorCore',
|
|
48
47
|
},
|
|
49
48
|
},
|
|
50
49
|
},
|
|
51
50
|
},
|
|
52
|
-
|
|
53
|
-
// 解析配置
|
|
54
51
|
resolve: {
|
|
55
|
-
// 确保使用相同的 React 实例
|
|
56
52
|
dedupe: ['react', 'react-dom'],
|
|
57
53
|
},
|
|
58
|
-
|
|
59
|
-
// esbuild 配置
|
|
60
|
-
esbuild: {
|
|
61
|
-
// 保留 JSX 注释,便于调试
|
|
62
|
-
jsx: 'automatic',
|
|
63
|
-
},
|
|
64
54
|
})
|
package/dist/component.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { CSSProperties, Ref } from 'react';
|
|
2
|
-
interface TextProps {
|
|
3
|
-
ref?: Ref<HTMLDivElement>;
|
|
4
|
-
text?: string;
|
|
5
|
-
fontSize?: number | string;
|
|
6
|
-
color?: string;
|
|
7
|
-
fontWeight?: string | number;
|
|
8
|
-
textAlign?: 'left' | 'center' | 'right' | 'justify';
|
|
9
|
-
lineHeight?: number | string;
|
|
10
|
-
className?: string;
|
|
11
|
-
style?: CSSProperties;
|
|
12
|
-
}
|
|
13
|
-
declare const Text: (props: TextProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
-
export default Text;
|
package/dist/configure.d.ts
DELETED
package/dist/index.d.ts
DELETED
package/dist/meta.d.ts
DELETED
package/dist/snippets.d.ts
DELETED
|
File without changes
|