@easy-editor/materials-dashboard-text 0.0.9 → 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.
@@ -1 +1 @@
1
- {"version":3,"file":"meta.min.js","sources":["../../../shared/src/types.ts","../src/constants.ts","../src/meta.ts","../src/snippets.ts","../src/configure.ts","../src/component.tsx"],"sourcesContent":["/**\n * Material Groups\n * 物料分组常量\n */\nexport const MaterialGroup = {\n /** 内置 */\n INNER: 'inner',\n /** 基础 */\n BASIC: 'basic',\n /** 图表 */\n CHART: 'chart',\n /** 数据展示 */\n DATA: 'data',\n /** 交互 */\n INTERACTION: 'interaction',\n} as const\n\n/**\n * Material Group Type\n */\nexport type MaterialGroupType = (typeof MaterialGroup)[keyof typeof MaterialGroup]\n","/**\n * 物料常量配置\n * 统一管理全局变量名等配置,确保 meta.ts 和 rollup.config.js 使用相同的值\n */\n\n/**\n * UMD 全局变量基础名称\n * 用于构建:\n * - 元数据:${GLOBAL_NAME}Meta (例如: EasyEditorMaterialsTextMeta)\n * - 组件:${GLOBAL_NAME}Component (例如: EasyEditorMaterialsTextComponent)\n * - 完整构建:${GLOBAL_NAME} (例如: EasyEditorMaterialsText)\n */\nexport const COMPONENT_NAME = 'EasyEditorMaterialsText'\n\n/**\n * 包名\n */\nexport const PACKAGE_NAME = '@easy-editor/materials-dashboard-text'\n","import type { ComponentMetadata } from '@easy-editor/core'\nimport { MaterialGroup } from '@easy-editor/materials-shared'\nimport { COMPONENT_NAME, PACKAGE_NAME } from './constants'\nimport configure from './configure'\nimport snippets from './snippets'\n\nconst meta: ComponentMetadata = {\n componentName: COMPONENT_NAME,\n title: 'Text',\n group: MaterialGroup.BASIC,\n devMode: 'proCode',\n npm: {\n package: PACKAGE_NAME,\n version: 'latest',\n globalName: COMPONENT_NAME,\n componentName: COMPONENT_NAME,\n },\n snippets,\n configure,\n}\n\nexport default meta\n","import type { Snippet } from '@easy-editor/core'\nimport { COMPONENT_NAME } from './constants'\n\nconst snippets: Snippet[] = [\n {\n title: 'Text',\n screenshot: 'https://img.alicdn.com/imgextra/i3/O1CN01n5wpxc1bi862KuXFz_!!6000000003498-55-tps-50-50.svg',\n schema: {\n componentName: COMPONENT_NAME,\n props: {\n text: 'Text Text Text',\n fontSize: 14,\n color: '#ffffff',\n textAlign: 'left',\n },\n $dashboard: {\n rect: {\n width: 120,\n height: 40,\n },\n },\n },\n },\n {\n title: 'Heading',\n screenshot: 'https://img.alicdn.com/imgextra/i3/O1CN01n5wpxc1bi862KuXFz_!!6000000003498-55-tps-50-50.svg',\n schema: {\n componentName: COMPONENT_NAME,\n props: {\n text: 'Heading',\n fontSize: 24,\n color: '#ffffff',\n fontWeight: 'bold',\n textAlign: 'center',\n },\n $dashboard: {\n rect: {\n width: 200,\n height: 50,\n },\n },\n },\n },\n]\n\nexport default snippets\n","import type { Configure } from '@easy-editor/core'\nimport Text from './component'\n\nconst configure: Configure = {\n props: [\n {\n type: 'group',\n title: '功能',\n setter: 'TabSetter',\n items: [\n {\n type: 'group',\n key: 'basic',\n title: '基本',\n items: [\n {\n name: 'id',\n title: 'ID',\n setter: 'NodeIdSetter',\n },\n {\n name: 'title',\n title: '标题',\n setter: 'StringSetter',\n extraProps: {\n getValue(target) {\n return target.getExtraPropValue('title')\n },\n setValue(target, value) {\n target.setExtraPropValue('title', value)\n },\n },\n },\n {\n type: 'group',\n title: '基础属性',\n setter: {\n componentName: 'CollapseSetter',\n props: {\n icon: false,\n },\n },\n items: [\n {\n name: 'rect',\n title: '位置尺寸',\n setter: 'RectSetter',\n extraProps: {\n getValue(target) {\n return target.getExtraPropValue('$dashboard.rect')\n },\n setValue(target, value) {\n target.setExtraPropValue('$dashboard.rect', value)\n },\n },\n },\n ],\n },\n {\n name: 'text',\n title: '文本内容',\n setter: 'StringSetter',\n },\n {\n type: 'group',\n title: '字体样式',\n setter: {\n componentName: 'CollapseSetter',\n props: {\n icon: false,\n },\n },\n items: [\n {\n name: 'fontSize',\n title: '字体大小',\n setter: 'NumberSetter',\n extraProps: {\n defaultValue: 14,\n },\n },\n {\n name: 'color',\n title: '文字颜色',\n setter: 'ColorSetter',\n extraProps: {\n defaultValue: '#000000',\n },\n },\n {\n name: 'fontWeight',\n title: '字体粗细',\n setter: {\n componentName: 'SelectSetter',\n props: {\n options: [\n { label: '正常', value: 'normal' },\n { label: '粗体', value: 'bold' },\n { label: '100', value: '100' },\n { label: '200', value: '200' },\n { label: '300', value: '300' },\n { label: '400', value: '400' },\n { label: '500', value: '500' },\n { label: '600', value: '600' },\n { label: '700', value: '700' },\n { label: '800', value: '800' },\n { label: '900', value: '900' },\n ],\n },\n },\n extraProps: {\n defaultValue: 'normal',\n },\n },\n {\n name: 'lineHeight',\n title: '行高',\n setter: 'NumberSetter',\n extraProps: {\n defaultValue: 1.5,\n },\n },\n {\n name: 'textAlign',\n title: '文本对齐',\n setter: {\n componentName: 'RadioGroupSetter',\n props: {\n options: [\n { label: '左对齐', value: 'left' },\n { label: '居中', value: 'center' },\n { label: '右对齐', value: 'right' },\n { label: '两端对齐', value: 'justify' },\n ],\n },\n },\n extraProps: {\n defaultValue: 'left',\n },\n },\n ],\n },\n ],\n },\n {\n type: 'group',\n key: 'advanced',\n title: '高级',\n items: [\n {\n type: 'group',\n title: '高级设置',\n setter: {\n componentName: 'CollapseSetter',\n props: {\n icon: false,\n },\n },\n items: [\n {\n title: '显隐',\n setter: 'SwitchSetter',\n extraProps: {\n supportVariable: true,\n getValue(target) {\n return target.getExtraPropValue('condition')\n },\n setValue(target, value: boolean) {\n target.setExtraPropValue('condition', value)\n },\n },\n },\n ],\n },\n ],\n },\n ],\n },\n ],\n component: {},\n supports: {},\n advanced: {\n view: Text,\n },\n}\n\nexport default configure\n","import type { CSSProperties, Ref } from 'react'\n\ninterface TextProps {\n ref?: Ref<HTMLDivElement>\n text?: string\n fontSize?: number | string\n color?: string\n fontWeight?: string | number\n textAlign?: 'left' | 'center' | 'right' | 'justify'\n lineHeight?: number | string\n className?: string\n style?: CSSProperties\n}\n\nconst Text = (props: TextProps) => {\n const {\n ref,\n text = 'Text',\n fontSize = 14,\n color = '#ffffff',\n fontWeight = 'normal',\n textAlign = 'left',\n lineHeight = 1.5,\n className = '',\n style: externalStyle,\n } = props\n\n const internalStyle: CSSProperties = {\n width: '100%',\n height: '100%',\n fontSize: typeof fontSize === 'number' ? `${fontSize}px` : fontSize,\n color,\n fontWeight,\n textAlign,\n lineHeight,\n wordBreak: 'break-word',\n whiteSpace: 'pre-wrap',\n }\n\n const mergedStyle = { ...internalStyle, ...externalStyle }\n\n return (\n <div className={className} ref={ref} style={mergedStyle}>\n {text}\n </div>\n )\n}\n\nexport default Text\n"],"names":["COMPONENT_NAME","meta","componentName","title","group","devMode","npm","package","version","globalName","snippets","screenshot","schema","props","text","fontSize","color","textAlign","$dashboard","rect","width","height","fontWeight","configure","type","setter","items","key","name","extraProps","getValue","target","getExtraPropValue","setValue","value","setExtraPropValue","icon","defaultValue","options","label","supportVariable","component","supports","advanced","view","ref","lineHeight","className","style","externalStyle","mergedStyle","wordBreak","whiteSpace","_jsx","children"],"mappings":"kUAIO,MCQMA,EAAiB,0BCNxBC,EAA0B,CAC9BC,cAAeF,EACfG,MAAO,OACPC,MFDO,QEEPC,QAAS,UACTC,IAAK,CACHC,QDKwB,wCCJxBC,QAAS,SACTC,WAAYT,EACZE,cAAeF,GAEjBU,SCd0B,CAC1B,CACEP,MAAO,OACPQ,WAAY,8FACZC,OAAQ,CACNV,cAAeF,EACfa,MAAO,CACLC,KAAM,iBACNC,SAAU,GACVC,MAAO,UACPC,UAAW,QAEbC,WAAY,CACVC,KAAM,CACJC,MAAO,IACPC,OAAQ,OAKhB,CACElB,MAAO,UACPQ,WAAY,8FACZC,OAAQ,CACNV,cAAeF,EACfa,MAAO,CACLC,KAAM,UACNC,SAAU,GACVC,MAAO,UACPM,WAAY,OACZL,UAAW,UAEbC,WAAY,CACVC,KAAM,CACJC,MAAO,IACPC,OAAQ,QDpBhBE,UEf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":3,"file":"meta.min.js","sources":["../src/configure.ts","../src/constants.ts","../src/meta.ts","../../../../shared/src/index.ts","../src/snippets.ts"],"sourcesContent":["/**\n * Text Configure\n * 文本组件配置\n */\n\nimport type { Configure } from '@easy-editor/core'\n\nexport const configure: Configure = {\n props: [\n {\n type: 'group',\n title: '属性',\n setter: 'TabSetter',\n items: [\n {\n type: 'group',\n key: 'config',\n title: '配置',\n setter: {\n componentName: 'CollapseSetter',\n props: {\n icon: false,\n },\n },\n items: [\n // 基础配置\n {\n name: 'id',\n title: 'ID',\n setter: 'NodeIdSetter',\n extraProps: {\n // @ts-expect-error label is not a valid extra prop\n label: false,\n },\n },\n {\n name: 'title',\n title: '标题',\n setter: 'StringSetter',\n extraProps: {\n getValue(target) {\n return target.getExtraPropValue('title')\n },\n setValue(target, value) {\n target.setExtraPropValue('title', value)\n },\n },\n },\n {\n type: 'group',\n title: '基础属性',\n setter: {\n componentName: 'CollapseSetter',\n props: {\n icon: false,\n },\n },\n items: [\n {\n name: 'rect',\n title: '位置尺寸',\n setter: 'RectSetter',\n extraProps: {\n getValue(target) {\n return target.getExtraPropValue('$dashboard.rect')\n },\n setValue(target, value) {\n target.setExtraPropValue('$dashboard.rect', value)\n },\n },\n },\n ],\n },\n // 组件配置\n {\n type: 'group',\n title: '内容',\n setter: {\n componentName: 'CollapseSetter',\n props: {\n icon: false,\n },\n },\n items: [\n {\n name: 'content',\n title: '文本内容',\n setter: 'TextAreaSetter',\n extraProps: {\n defaultValue: '文本内容',\n },\n },\n {\n name: 'isLink',\n title: '作为链接',\n setter: 'SwitchSetter',\n extraProps: {\n defaultValue: false,\n },\n },\n {\n name: 'href',\n title: '链接地址',\n setter: 'StringSetter',\n },\n {\n name: 'target',\n title: '打开方式',\n setter: {\n componentName: 'SelectSetter',\n props: {\n options: [\n { label: '新窗口', value: '_blank' },\n { label: '当前窗口', value: '_self' },\n ],\n },\n },\n extraProps: {\n defaultValue: '_blank',\n },\n },\n ],\n },\n {\n type: 'group',\n title: '字体',\n setter: {\n componentName: 'CollapseSetter',\n props: {\n icon: false,\n },\n },\n items: [\n {\n name: 'fontSize',\n title: '字体大小',\n setter: 'NumberSetter',\n extraProps: {\n defaultValue: 16,\n },\n },\n {\n name: 'fontWeight',\n title: '字体粗细',\n setter: {\n componentName: 'SelectSetter',\n props: {\n options: [\n { label: '正常', value: 'normal' },\n { label: '粗体', value: 'bold' },\n ],\n },\n },\n extraProps: {\n defaultValue: 'normal',\n },\n },\n {\n name: 'color',\n title: '颜色',\n setter: 'ColorSetter',\n extraProps: {\n defaultValue: '#ffffff',\n },\n },\n {\n name: 'lineHeight',\n title: '行高',\n setter: 'NumberSetter',\n extraProps: {\n defaultValue: 1.5,\n },\n },\n ],\n },\n {\n type: 'group',\n title: '对齐',\n setter: {\n componentName: 'CollapseSetter',\n props: {\n icon: false,\n },\n },\n items: [\n {\n name: 'textAlign',\n title: '水平对齐',\n setter: {\n componentName: 'SegmentedSetter',\n props: {\n options: [\n { label: '左', value: 'left' },\n { label: '中', value: 'center' },\n { label: '右', value: 'right' },\n ],\n },\n },\n extraProps: {\n defaultValue: 'left',\n },\n },\n {\n name: 'verticalAlign',\n title: '垂直对齐',\n setter: {\n componentName: 'SegmentedSetter',\n props: {\n options: [\n { label: '上', value: 'top' },\n { label: '中', value: 'middle' },\n { label: '下', value: 'bottom' },\n ],\n },\n },\n extraProps: {\n defaultValue: 'middle',\n },\n },\n ],\n },\n {\n type: 'group',\n title: '效果',\n setter: {\n componentName: 'CollapseSetter',\n props: {\n icon: false,\n },\n },\n items: [\n {\n name: 'underline',\n title: '下划线',\n setter: 'SwitchSetter',\n extraProps: {\n defaultValue: false,\n },\n },\n {\n name: 'glowEnable',\n title: '发光效果',\n setter: 'SwitchSetter',\n extraProps: {\n defaultValue: false,\n },\n },\n {\n name: 'glowColor',\n title: '发光颜色',\n setter: 'ColorSetter',\n extraProps: {\n defaultValue: '#00d4ff',\n },\n },\n ],\n },\n ],\n },\n {\n type: 'group',\n key: 'data',\n title: '数据',\n items: [\n {\n name: 'dataBinding',\n title: '数据绑定',\n setter: 'DataBindingSetter',\n },\n ],\n },\n {\n type: 'group',\n key: 'advanced',\n title: '高级',\n items: [\n {\n name: 'condition',\n title: '显隐控制',\n setter: 'SwitchSetter',\n extraProps: {\n defaultValue: true,\n supportVariable: true,\n },\n },\n ],\n },\n ],\n },\n ],\n component: {},\n supports: {},\n advanced: {},\n}\n","/**\n * 物料常量配置\n * 统一管理全局变量名等配置,确保 meta.ts 和 rollup.config.js 使用相同的值\n */\n\n/**\n * UMD 全局变量基础名称\n * 用于构建:\n * - 元数据:${GLOBAL_NAME}Meta (例如: EasyEditorMaterialsTextMeta)\n * - 组件:${GLOBAL_NAME}Component (例如: EasyEditorMaterialsTextComponent)\n * - 完整构建:${GLOBAL_NAME} (例如: EasyEditorMaterialsText)\n */\nexport const COMPONENT_NAME = 'EasyEditorMaterialsText'\n\n/**\n * 包名\n */\nexport const PACKAGE_NAME = '@easy-editor/materials-dashboard-text'\n","/**\n * Text Meta\n * 文本组件元数据\n */\n\nimport type { ComponentMetadata } from '@easy-editor/core'\nimport { configure } from './configure'\nimport { snippets } from './snippets'\nimport { COMPONENT_NAME, PACKAGE_NAME } from './constants'\nimport { MaterialGroup } from '@easy-editor/materials-shared'\nimport pkg from '../package.json'\n\nexport const meta: ComponentMetadata = {\n componentName: COMPONENT_NAME,\n title: '文本',\n category: 'dashboard',\n group: MaterialGroup.BASIC,\n devMode: 'proCode',\n npm: {\n package: PACKAGE_NAME,\n version: pkg.version,\n globalName: COMPONENT_NAME,\n componentName: COMPONENT_NAME,\n },\n configure,\n snippets,\n}\n","/**\n * Shared types, components and utilities for EasyEditor materials\n * @package @easy-editor/materials-shared\n */\n\n// 物料分组常量\nexport const MaterialGroup = {\n /** 内置 */\n INNER: 'inner',\n /** 基础 */\n BASIC: 'basic',\n /** 图表 */\n CHART: 'chart',\n /** 数据展示 */\n DISPLAY: 'display',\n /** 媒体 */\n MEDIA: 'media',\n /** 交互 */\n INTERACTION: 'interaction',\n /** 地图 */\n MAP: 'map',\n} as const\n\nexport type MaterialGroup = (typeof MaterialGroup)[keyof typeof MaterialGroup]\n\n// 工具函数\nexport { cn } from './lib/utils'\n\nexport * from './types'\n","/**\n * Text Snippets\n * 文本组件代码片段\n */\n\nimport type { Snippet } from '@easy-editor/core'\nimport { COMPONENT_NAME } from './constants'\n\nexport const snippets: Snippet[] = [\n {\n title: '普通文本',\n screenshot: '',\n schema: {\n componentName: COMPONENT_NAME,\n props: {\n content: '这是一段普通文本',\n fontSize: 16,\n color: '#ffffff',\n },\n $dashboard: {\n rect: {\n width: 120,\n height: 40,\n },\n },\n },\n },\n {\n title: '标题文本',\n screenshot: '',\n schema: {\n componentName: COMPONENT_NAME,\n props: {\n content: '标题文本',\n fontSize: 32,\n fontWeight: 'bold',\n color: '#ffffff',\n textAlign: 'center',\n },\n $dashboard: {\n rect: {\n width: 200,\n height: 60,\n },\n },\n },\n },\n {\n title: '发光标题',\n screenshot: '',\n schema: {\n componentName: COMPONENT_NAME,\n props: {\n content: '发光标题',\n fontSize: 36,\n fontWeight: 'bold',\n color: '#00d4ff',\n textAlign: 'center',\n glowEnable: true,\n glowColor: '#00d4ff',\n glowIntensity: 1.5,\n },\n $dashboard: {\n rect: {\n width: 240,\n height: 80,\n },\n },\n },\n },\n {\n title: '链接文本',\n screenshot: '',\n schema: {\n componentName: COMPONENT_NAME,\n props: {\n content: '点击跳转',\n fontSize: 16,\n color: '#00d4ff',\n isLink: true,\n href: 'https://easy-editor-docs.vercel.app/',\n target: '_blank',\n underline: true,\n },\n $dashboard: {\n rect: {\n width: 120,\n height: 40,\n },\n },\n },\n },\n]\n"],"names":["COMPONENT_NAME","meta","componentName","title","category","group","devMode","npm","package","version","globalName","configure","props","type","setter","items","key","icon","name","extraProps","label","getValue","target","getExtraPropValue","setValue","value","setExtraPropValue","defaultValue","options","supportVariable","component","supports","advanced","snippets","screenshot","schema","content","fontSize","color","$dashboard","rect","width","height","fontWeight","textAlign","glowEnable","glowColor","glowIntensity","isLink","href","underline"],"mappings":"kQAOO,MCKMA,EAAiB,0BCAvB,MAAMC,EAA0B,CACrCC,cAAeF,EACfG,MAAO,KACPC,SAAU,YACVC,MCNO,QDOPC,QAAS,UACTC,IAAK,CACHC,QDFwB,wCCGxBC,iBACAC,WAAYV,EACZE,cAAeF,GAEjBW,UFjBkC,CAClCC,MAAO,CACL,CACEC,KAAM,QACNV,MAAO,KACPW,OAAQ,YACRC,MAAO,CACL,CACEF,KAAM,QACNG,IAAK,SACLb,MAAO,KACPW,OAAQ,CACNZ,cAAe,iBACfU,MAAO,CACLK,MAAM,IAGVF,MAAO,CAEL,CACEG,KAAM,KACNf,MAAO,KACPW,OAAQ,eACRK,WAAY,CAEVC,OAAO,IAGX,CACEF,KAAM,QACNf,MAAO,KACPW,OAAQ,eACRK,WAAY,CACVE,SAASC,GACAA,EAAOC,kBAAkB,SAElCC,QAAAA,CAASF,EAAQG,GACfH,EAAOI,kBAAkB,QAASD,EACpC,IAGJ,CACEZ,KAAM,QACNV,MAAO,OACPW,OAAQ,CACNZ,cAAe,iBACfU,MAAO,CACLK,MAAM,IAGVF,MAAO,CACL,CACEG,KAAM,OACNf,MAAO,OACPW,OAAQ,aACRK,WAAY,CACVE,SAASC,GACAA,EAAOC,kBAAkB,mBAElCC,QAAAA,CAASF,EAAQG,GACfH,EAAOI,kBAAkB,kBAAmBD,EAC9C,MAMR,CACEZ,KAAM,QACNV,MAAO,KACPW,OAAQ,CACNZ,cAAe,iBACfU,MAAO,CACLK,MAAM,IAGVF,MAAO,CACL,CACEG,KAAM,UACNf,MAAO,OACPW,OAAQ,iBACRK,WAAY,CACVQ,aAAc,SAGlB,CACET,KAAM,SACNf,MAAO,OACPW,OAAQ,eACRK,WAAY,CACVQ,cAAc,IAGlB,CACET,KAAM,OACNf,MAAO,OACPW,OAAQ,gBAEV,CACEI,KAAM,SACNf,MAAO,OACPW,OAAQ,CACNZ,cAAe,eACfU,MAAO,CACLgB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AQ"}
@@ -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.9",
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 ADDED
@@ -0,0 +1,54 @@
1
+ /**
2
+ * Vite Configuration for Material Development
3
+ * 物料开发 Vite 配置
4
+ */
5
+
6
+ import { defineConfig } from 'vite'
7
+ import react from '@vitejs/plugin-react'
8
+ import { materialDevPlugin } from './.vite/plugins/vite-plugin-material-dev'
9
+ import { externalDeps } from './.vite/plugins/vite-plugin-external-deps'
10
+
11
+ export default defineConfig({
12
+ plugins: [
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
+ }),
24
+ materialDevPlugin({
25
+ entry: '/src/index.tsx',
26
+ }),
27
+ ],
28
+ server: {
29
+ port: 5001,
30
+ host: 'localhost',
31
+ cors: true,
32
+ hmr: {
33
+ port: 5001,
34
+ },
35
+ },
36
+ build: {
37
+ target: 'esnext',
38
+ rollupOptions: {
39
+ // 确保生产构建也外部化这些依赖
40
+ external: ['react', 'react-dom', 'react/jsx-runtime', '@easy-editor/core'],
41
+ output: {
42
+ globals: {
43
+ react: 'React',
44
+ 'react-dom': 'ReactDOM',
45
+ 'react/jsx-runtime': 'jsxRuntime',
46
+ '@easy-editor/core': 'EasyEditorCore',
47
+ },
48
+ },
49
+ },
50
+ },
51
+ resolve: {
52
+ dedupe: ['react', 'react-dom'],
53
+ },
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