@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.
@@ -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;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Text Configure
3
+ * 文本组件配置
4
+ */
5
+ import type { Configure } from '@easy-editor/core';
6
+ export declare const configure: Configure;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Text Entry
3
+ * 文本组件入口
4
+ */
5
+ export { Text as component } from './component';
6
+ export { meta } from './meta';
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Text Meta
3
+ * 文本组件元数据
4
+ */
5
+ import type { ComponentMetadata } from '@easy-editor/core';
6
+ export declare const meta: ComponentMetadata;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Text Snippets
3
+ * 文本组件代码片段
4
+ */
5
+ import type { Snippet } from '@easy-editor/core';
6
+ export declare const snippets: Snippet[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@easy-editor/materials-dashboard-text",
3
- "version": "0.0.10",
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
- lib: {
37
- entry: 'src/index.tsx',
38
- formats: ['es'],
39
- fileName: 'index',
40
- },
37
+ target: 'esnext',
41
38
  rollupOptions: {
42
- // 外部依赖不打包
43
- external: ['react', 'react-dom', '@easy-editor/core', '@easy-editor/materials-shared'],
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
  })
@@ -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;
@@ -1,3 +0,0 @@
1
- import type { Configure } from '@easy-editor/core';
2
- declare const configure: Configure;
3
- export default configure;
package/dist/index.d.ts DELETED
@@ -1,6 +0,0 @@
1
- /**
2
- * Text Component for EasyEditor
3
- * @package @easy-editor/materials-dashboard-text
4
- */
5
- export { default as meta } from './meta';
6
- export { default as component } from './component';
package/dist/meta.d.ts DELETED
@@ -1,3 +0,0 @@
1
- import type { ComponentMetadata } from '@easy-editor/core';
2
- declare const meta: ComponentMetadata;
3
- export default meta;
@@ -1,3 +0,0 @@
1
- import type { Snippet } from '@easy-editor/core';
2
- declare const snippets: Snippet[];
3
- export default snippets;
File without changes