@easy-editor/materials-dashboard-text 0.0.8 → 0.0.10

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/dist/meta.js CHANGED
@@ -1,9 +1,9 @@
1
- /* @easy-editor/materials-dashboard-text v0.0.7 (meta) */
1
+ /* @easy-editor/materials-dashboard-text v0.0.9 (meta) */
2
2
  (function (global, factory) {
3
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
4
- typeof define === 'function' && define.amd ? define(['exports'], factory) :
5
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.EasyEditorMaterialsTextMeta = {}));
6
- })(this, (function (exports) { 'use strict';
3
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react/jsx-runtime')) :
4
+ typeof define === 'function' && define.amd ? define(['exports', 'react/jsx-runtime'], factory) :
5
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.EasyEditorMaterialsTextMeta = {}, global.jsxRuntime));
6
+ })(this, (function (exports, jsxRuntime) { 'use strict';
7
7
 
8
8
  const MaterialGroup = {
9
9
  BASIC: 'basic'};
@@ -38,11 +38,12 @@
38
38
  ...internalStyle,
39
39
  ...externalStyle
40
40
  };
41
- return /*#__PURE__*/React.createElement("div", {
41
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
42
42
  className: className,
43
43
  ref: ref,
44
- style: mergedStyle
45
- }, text);
44
+ style: mergedStyle,
45
+ children: text
46
+ });
46
47
  };
47
48
 
48
49
  const configure = {
@@ -119,51 +120,6 @@
119
120
  extraProps: {
120
121
  defaultValue: '#000000'
121
122
  }
122
- }, {
123
- name: 'fontWeight',
124
- title: '字体粗细',
125
- setter: {
126
- componentName: 'SelectSetter',
127
- props: {
128
- options: [{
129
- label: '正常',
130
- value: 'normal'
131
- }, {
132
- label: '粗体',
133
- value: 'bold'
134
- }, {
135
- label: '100',
136
- value: '100'
137
- }, {
138
- label: '200',
139
- value: '200'
140
- }, {
141
- label: '300',
142
- value: '300'
143
- }, {
144
- label: '400',
145
- value: '400'
146
- }, {
147
- label: '500',
148
- value: '500'
149
- }, {
150
- label: '600',
151
- value: '600'
152
- }, {
153
- label: '700',
154
- value: '700'
155
- }, {
156
- label: '800',
157
- value: '800'
158
- }, {
159
- label: '900',
160
- value: '900'
161
- }]
162
- }
163
- },
164
- extraProps: {
165
- defaultValue: 'normal'
166
- }
167
123
  }, {
168
124
  name: 'lineHeight',
169
125
  title: '行高',
@@ -171,30 +127,6 @@
171
127
  extraProps: {
172
128
  defaultValue: 1.5
173
129
  }
174
- }, {
175
- name: 'textAlign',
176
- title: '文本对齐',
177
- setter: {
178
- componentName: 'RadioGroupSetter',
179
- props: {
180
- options: [{
181
- label: '左对齐',
182
- value: 'left'
183
- }, {
184
- label: '居中',
185
- value: 'center'
186
- }, {
187
- label: '右对齐',
188
- value: 'right'
189
- }, {
190
- label: '两端对齐',
191
- value: 'justify'
192
- }]
193
- }
194
- },
195
- extraProps: {
196
- defaultValue: 'left'
197
- }
198
130
  }]
199
131
  }]
200
132
  }, {
package/dist/meta.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"meta.js","sources":["../../../shared/src/types.ts","../src/constants.ts","../src/component.tsx","../src/configure.ts","../src/snippets.ts","../src/meta.ts"],"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 { 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","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 { 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 { 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"],"names":["MaterialGroup","INNER","BASIC","COMPONENT_NAME","PACKAGE_NAME","Text","props","ref","text","fontSize","color","fontWeight","textAlign","lineHeight","className","style","externalStyle","internalStyle","width","height","wordBreak","whiteSpace","mergedStyle","React","createElement","configure","type","title","setter","items","key","name","extraProps","getValue","target","getExtraPropValue","setValue","value","setExtraPropValue","componentName","icon","defaultValue","options","label","supportVariable","component","supports","advanced","view","snippets","screenshot","schema","$dashboard","rect","meta","group","devMode","npm","package","version","globalName"],"mappings":";;;;;;;EAIO,MAAMA,aAAa,GAAG;EAE3BC,EAEAC,KAAK,EAAE,OAOT,CAAU;;ECHH,MAAMC,cAAc,GAAG,yBAAyB;EAKhD,MAAMC,YAAY,GAAG,uCAAuC;;ECHnE,MAAMC,IAAI,GAAIC,KAAgB,IAAK;IACjC,MAAM;MACJC,GAAG;EACHC,IAAAA,IAAI,GAAG,MAAM;EACbC,IAAAA,QAAQ,GAAG,EAAE;EACbC,IAAAA,KAAK,GAAG,SAAS;EACjBC,IAAAA,UAAU,GAAG,QAAQ;EACrBC,IAAAA,SAAS,GAAG,MAAM;EAClBC,IAAAA,UAAU,GAAG,GAAG;EAChBC,IAAAA,SAAS,GAAG,EAAE;EACdC,IAAAA,KAAK,EAAEC;EACT,GAAC,GAAGV,KAAK;EAET,EAAA,MAAMW,aAA4B,GAAG;EACnCC,IAAAA,KAAK,EAAE,MAAM;EACbC,IAAAA,MAAM,EAAE,MAAM;MACdV,QAAQ,EAAE,OAAOA,QAAQ,KAAK,QAAQ,GAAG,CAAA,EAAGA,QAAQ,CAAA,EAAA,CAAI,GAAGA,QAAQ;MACnEC,KAAK;MACLC,UAAU;MACVC,SAAS;MACTC,UAAU;EACVO,IAAAA,SAAS,EAAE,YAAY;EACvBC,IAAAA,UAAU,EAAE;KACb;EAED,EAAA,MAAMC,WAAW,GAAG;EAAE,IAAA,GAAGL,aAAa;MAAE,GAAGD;KAAe;IAE1D,oBACEO,KAAA,CAAAC,aAAA,CAAA,KAAA,EAAA;EAAKV,IAAAA,SAAS,EAAEA,SAAU;EAACP,IAAAA,GAAG,EAAEA,GAAI;EAACQ,IAAAA,KAAK,EAAEO;EAAY,GAAA,EACrDd,IACE,CAAC;EAEV,CAAC;;EC3CD,MAAMiB,SAAoB,GAAG;EAC3BnB,EAAAA,KAAK,EAAE,CACL;EACEoB,IAAAA,IAAI,EAAE,OAAO;EACbC,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ACtBC,MAAAA,QAAQ,EAAE,EAAE;EACZC,MAAAA,KAAK,EAAE,SAAS;EAChBE,MAAAA,SAAS,EAAE;OACZ;EACDwC,IAAAA,UAAU,EAAE;EACVC,MAAAA,IAAI,EAAE;EACJnC,QAAAA,KAAK,EAAE,GAAG;EACVC,QAAAA,MAAM,EAAE;EACV;EACF;EACF;EACF,CAAC,EACD;EACEQ,EAAAA,KAAK,EAAE,SAAS;EAChBuB,EAAAA,UAAU,EAAE,6FAA6F;EACzGC,EAAAA,MAAM,EAAE;EACNZ,IAAAA,aAAa,EAAEpC,cAAc;EAC7BG,IAAAA,KAAK,EAAE;EACLE,MAAAA,IAAI,EAAE,SAAS;EACfC,MAAAA,QAAQ,EAAE,EAAE;EACZC,MAAAA,KAAK,EAAE,SAAS;EAChBC,MAAAA,UAAU,EAAE,MAAM;EAClBC,MAAAA,SAAS,EAAE;OACZ;EACDwC,IAAAA,UAAU,EAAE;EACVC,MAAAA,IAAI,EAAE;EACJnC,QAAAA,KAAK,EAAE,GAAG;EACVC,QAAAA,MAAM,EAAE;EACV;EACF;EACF;EACF,CAAC,CACF;;ACrCD,QAAMmC,IAAuB,GAAG;EAC9Bf,EAAAA,aAAa,EAAEpC,cAAc;EAC7BwB,EAAAA,KAAK,EAAE,MAAM;IACb4B,KAAK,EAAEvD,aAAa,CAACE,KAAK;EAC1BsD,EAAAA,OAAO,EAAE,SAAS;EAClBC,EAAAA,GAAG,EAAE;EACHC,IAAAA,OAAO,EAAEtD,YAAY;EACrBuD,IAAAA,OAAO,EAAE,QAAQ;EACjBC,IAAAA,UAAU,EAAEzD,cAAc;EAC1BoC,IAAAA,aAAa,EAAEpC;KAChB;IACD8C,QAAQ;EACRxB,EAAAA;EACF;;;;;;;;;;"}
1
+ {"version":3,"file":"meta.js","sources":["../../../shared/src/types.ts","../src/constants.ts","../src/component.tsx","../src/configure.ts","../src/snippets.ts","../src/meta.ts"],"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 { 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","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: 'lineHeight',\n title: '行高',\n setter: 'NumberSetter',\n extraProps: {\n defaultValue: 1.5,\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 { 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 { 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"],"names":["MaterialGroup","INNER","BASIC","COMPONENT_NAME","PACKAGE_NAME","Text","props","ref","text","fontSize","color","fontWeight","textAlign","lineHeight","className","style","externalStyle","internalStyle","width","height","wordBreak","whiteSpace","mergedStyle","_jsx","children","configure","type","title","setter","items","key","name","extraProps","getValue","target","getExtraPropValue","setValue","value","setExtraPropValue","componentName","icon","defaultValue","supportVariable","component","supports","advanced","view","snippets","screenshot","schema","$dashboard","rect","meta","group","devMode","npm","package","version","globalName"],"mappings":";;;;;;;EAIO,MAAMA,aAAa,GAAG;EAE3BC,EAEAC,KAAK,EAAE,O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E;EACJjC,QAAAA,KAAK,EAAE,GAAG;EACVC,QAAAA,MAAM,EAAE;EACV;EACF;EACF;EACF,CAAC,CACF;;ACrCD,QAAMiC,IAAuB,GAAG;EAC9Bb,EAAAA,aAAa,EAAEpC,cAAc;EAC7BwB,EAAAA,KAAK,EAAE,MAAM;IACb0B,KAAK,EAAErD,aAAa,CAACE,KAAK;EAC1BoD,EAAAA,OAAO,EAAE,SAAS;EAClBC,EAAAA,GAAG,EAAE;EACHC,IAAAA,OAAO,EAAEpD,YAAY;EACrBqD,IAAAA,OAAO,EAAE,QAAQ;EACjBC,IAAAA,UAAU,EAAEvD,cAAc;EAC1BoC,IAAAA,aAAa,EAAEpC;KAChB;IACD4C,QAAQ;EACRtB,EAAAA;EACF;;;;;;;;;;"}
package/dist/meta.min.js CHANGED
@@ -1,2 +1,2 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).EasyEditorMaterialsTextMeta={})}(this,function(e){"use strict";const t="EasyEditorMaterialsText",a={componentName:t,title:"Text",group:"basic",devMode:"proCode",npm:{package:"@easy-editor/materials-dashboard-text",version:"latest",globalName:t,componentName:t},snippets:[{title:"Text",screenshot:"https://img.alicdn.com/imgextra/i3/O1CN01n5wpxc1bi862KuXFz_!!6000000003498-55-tps-50-50.svg",schema:{componentName:t,props:{text:"Text Text Text",fontSize:14,color:"#ffffff",textAlign:"left"},$dashboard:{rect:{width:120,height:40}}}},{title:"Heading",screenshot:"https://img.alicdn.com/imgextra/i3/O1CN01n5wpxc1bi862KuXFz_!!6000000003498-55-tps-50-50.svg",schema:{componentName:t,props:{text:"Heading",fontSize:24,color:"#ffffff",fontWeight:"bold",textAlign:"center"},$dashboard:{rect:{width:200,height:50}}}}],configure:{props:[{type:"group",title:"功能",setter:"TabSetter",items:[{type:"group",key:"basic",title:"基本",items:[{name:"id",title:"ID",setter:"NodeIdSetter"},{name:"title",title:"标题",setter:"StringSetter",extraProps:{getValue:e=>e.getExtraPropValue("title"),setValue(e,t){e.setExtraPropValue("title",t)}}},{type:"group",title:"基础属性",setter:{componentName:"CollapseSetter",props:{icon:!1}},items:[{name:"rect",title:"位置尺寸",setter:"RectSetter",extraProps:{getValue:e=>e.getExtraPropValue("$dashboard.rect"),setValue(e,t){e.setExtraPropValue("$dashboard.rect",t)}}}]},{name:"text",title:"文本内容",setter:"StringSetter"},{type:"group",title:"字体样式",setter:{componentName:"CollapseSetter",props:{icon:!1}},items:[{name:"fontSize",title:"字体大小",setter:"NumberSetter",extraProps:{defaultValue:14}},{name:"color",title:"文字颜色",setter:"ColorSetter",extraProps:{defaultValue:"#000000"}},{name:"fontWeight",title:"字体粗细",setter:{componentName:"SelectSetter",props:{options:[{label:"正常",value:"normal"},{label:"粗体",value:"bold"},{label:"100",value:"100"},{label:"200",value:"200"},{label:"300",value:"300"},{label:"400",value:"400"},{label:"500",value:"500"},{label:"600",value:"600"},{label:"700",value:"700"},{label:"800",value:"800"},{label:"900",value:"900"}]}},extraProps:{defaultValue:"normal"}},{name:"lineHeight",title:"行高",setter:"NumberSetter",extraProps:{defaultValue:1.5}},{name:"textAlign",title:"文本对齐",setter:{componentName:"RadioGroupSetter",props:{options:[{label:"左对齐",value:"left"},{label:"居中",value:"center"},{label:"右对齐",value:"right"},{label:"两端对齐",value:"justify"}]}},extraProps:{defaultValue:"left"}}]}]},{type:"group",key:"advanced",title:"高级",items:[{type:"group",title:"高级设置",setter:{componentName:"CollapseSetter",props:{icon:!1}},items:[{title:"显隐",setter:"SwitchSetter",extraProps:{supportVariable:!0,getValue:e=>e.getExtraPropValue("condition"),setValue(e,t){e.setExtraPropValue("condition",t)}}}]}]}]}],component:{},supports:{},advanced:{view:e=>{const{ref:t,text:a="Text",fontSize:l=14,color:o="#ffffff",fontWeight:r="normal",textAlign:i="left",lineHeight:s=1.5,className:n="",style:p}=e,u={...{width:"100%",height:"100%",fontSize:"number"==typeof l?`${l}px`:l,color:o,fontWeight:r,textAlign:i,lineHeight:s,wordBreak:"break-word",whiteSpace:"pre-wrap"},...p};return React.createElement("div",{className:n,ref:t,style:u},a)}}}};e.default=a,Object.defineProperty(e,"__esModule",{value:!0})});
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react/jsx-runtime")):"function"==typeof define&&define.amd?define(["exports","react/jsx-runtime"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).EasyEditorMaterialsTextMeta={},e.jsxRuntime)}(this,function(e,t){"use strict";const r="EasyEditorMaterialsText",o={componentName:r,title:"Text",group:"basic",devMode:"proCode",npm:{package:"@easy-editor/materials-dashboard-text",version:"latest",globalName:r,componentName:r},snippets:[{title:"Text",screenshot:"https://img.alicdn.com/imgextra/i3/O1CN01n5wpxc1bi862KuXFz_!!6000000003498-55-tps-50-50.svg",schema:{componentName:r,props:{text:"Text Text Text",fontSize:14,color:"#ffffff",textAlign:"left"},$dashboard:{rect:{width:120,height:40}}}},{title:"Heading",screenshot:"https://img.alicdn.com/imgextra/i3/O1CN01n5wpxc1bi862KuXFz_!!6000000003498-55-tps-50-50.svg",schema:{componentName:r,props:{text:"Heading",fontSize:24,color:"#ffffff",fontWeight:"bold",textAlign:"center"},$dashboard:{rect:{width:200,height:50}}}}],configure:{props:[{type:"group",title:"功能",setter:"TabSetter",items:[{type:"group",key:"basic",title:"基本",items:[{name:"id",title:"ID",setter:"NodeIdSetter"},{name:"title",title:"标题",setter:"StringSetter",extraProps:{getValue:e=>e.getExtraPropValue("title"),setValue(e,t){e.setExtraPropValue("title",t)}}},{type:"group",title:"基础属性",setter:{componentName:"CollapseSetter",props:{icon:!1}},items:[{name:"rect",title:"位置尺寸",setter:"RectSetter",extraProps:{getValue:e=>e.getExtraPropValue("$dashboard.rect"),setValue(e,t){e.setExtraPropValue("$dashboard.rect",t)}}}]},{name:"text",title:"文本内容",setter:"StringSetter"},{type:"group",title:"字体样式",setter:{componentName:"CollapseSetter",props:{icon:!1}},items:[{name:"fontSize",title:"字体大小",setter:"NumberSetter",extraProps:{defaultValue:14}},{name:"color",title:"文字颜色",setter:"ColorSetter",extraProps:{defaultValue:"#000000"}},{name:"lineHeight",title:"行高",setter:"NumberSetter",extraProps:{defaultValue:1.5}}]}]},{type:"group",key:"advanced",title:"高级",items:[{type:"group",title:"高级设置",setter:{componentName:"CollapseSetter",props:{icon:!1}},items:[{title:"显隐",setter:"SwitchSetter",extraProps:{supportVariable:!0,getValue:e=>e.getExtraPropValue("condition"),setValue(e,t){e.setExtraPropValue("condition",t)}}}]}]}]}],component:{},supports:{},advanced:{view:e=>{const{ref:r,text:o="Text",fontSize:i=14,color:a="#ffffff",fontWeight:s="normal",textAlign:n="left",lineHeight:l=1.5,className:p="",style:c}=e,d={...{width:"100%",height:"100%",fontSize:"number"==typeof i?`${i}px`:i,color:a,fontWeight:s,textAlign:n,lineHeight:l,wordBreak:"break-word",whiteSpace:"pre-wrap"},...c};return t.jsx("div",{className:p,ref:r,style:d,children:o})}}}};e.default=o,Object.defineProperty(e,"__esModule",{value:!0})});
2
2
  //# sourceMappingURL=meta.min.js.map
@@ -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","React","createElement"],"mappings":"kQAIO,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,UEf2B,CAC3BV,MAAO,CACL,CACEW,KAAM,QACNrB,MAAO,KACPsB,OAAQ,YACRC,MAAO,CACL,CACEF,KAAM,QACNG,IAAK,QACLxB,MAAO,KACPuB,MAAO,CACL,CACEE,KAAM,KACNzB,MAAO,KACPsB,OAAQ,gBAEV,CACEG,KAAM,QACNzB,MAAO,KACPsB,OAAQ,eACRI,WAAY,CACVC,SAASC,GACAA,EAAOC,kBAAkB,SAElCC,QAAAA,CAASF,EAAQG,GACfH,EAAOI,kBAAkB,QAASD,EACpC,IAGJ,CACEV,KAAM,QACNrB,MAAO,OACPsB,OAAQ,CACNvB,cAAe,iBACfW,MAAO,CACLuB,MAAM,IAGVV,MAAO,CACL,CACEE,KAAM,OACNzB,MAAO,OACPsB,OAAQ,aACRI,WAAY,CACVC,SAASC,GACAA,EAAOC,kBAAkB,mBAElCC,QAAAA,CAASF,EAAQG,GACfH,EAAOI,kBAAkB,kBAAmBD,EAC9C,MAKR,CACEN,KAAM,OACNzB,MAAO,OACPsB,OAAQ,gBAEV,CACED,KAAM,QACNrB,M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BAAkB,aAElCC,QAAAA,CAASF,EAAQG,GACfH,EAAOI,kBAAkB,YAAaD,EACxC,WAUlBO,UAAW,CAAA,EACXC,SAAU,CAAA,EACVC,SAAU,CACRC,KCxKU/B,IACZ,MAAMgC,IACJA,EAAG/B,KACHA,EAAO,OAAMC,SACbA,EAAW,GAAEC,MACbA,EAAQ,UAASM,WACjBA,EAAa,SAAQL,UACrBA,EAAY,OAAM6B,WAClBA,EAAa,IAAGC,UAChBA,EAAY,GACZC,MAAOC,GACLpC,EAcEqC,EAAc,IAZiB,CACnC9B,MAAO,OACPC,OAAQ,OACRN,SAA8B,iBAAbA,EAAwB,GAAGA,MAAeA,EAC3DC,QACAM,aACAL,YACA6B,aACAK,UAAW,aACXC,WAAY,eAG6BH,GAE3C,OACEI,MAAAC,cAAA,MAAA,CAAKP,UAAWA,EAAWF,IAAKA,EAAKG,MAAOE,GACzCpC"}
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: 'lineHeight',\n title: '行高',\n setter: 'NumberSetter',\n extraProps: {\n defaultValue: 1.5,\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","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,UEf2B,CAC3BV,MAAO,CACL,CACEW,KAAM,QACNrB,MAAO,KACPsB,OAAQ,YACRC,MAAO,CACL,CACEF,KA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IACZ,MAAM8B,IACJA,EAAG7B,KACHA,EAAO,OAAMC,SACbA,EAAW,GAAEC,MACbA,EAAQ,UAASM,WACjBA,EAAa,SAAQL,UACrBA,EAAY,OAAM2B,WAClBA,EAAa,IAAGC,UAChBA,EAAY,GACZC,MAAOC,GACLlC,EAcEmC,EAAc,IAZiB,CACnC5B,MAAO,OACPC,OAAQ,OACRN,SAA8B,iBAAbA,EAAwB,GAAGA,MAAeA,EAC3DC,QACAM,aACAL,YACA2B,aACAK,UAAW,aACXC,WAAY,eAG6BH,GAE3C,OACEI,EAAAA,IAAA,MAAA,CAAKN,UAAWA,EAAWF,IAAKA,EAAKG,MAAOE,EAAYI,SACrDtC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@easy-editor/materials-dashboard-text",
3
- "version": "0.0.8",
3
+ "version": "0.0.10",
4
4
  "description": "Text component for EasyEditor dashboard",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
package/vite.config.ts ADDED
@@ -0,0 +1,64 @@
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
+
10
+ export default defineConfig({
11
+ plugins: [
12
+ react(),
13
+ materialDevPlugin({
14
+ entry: '/src/index.tsx',
15
+ }),
16
+ ],
17
+
18
+ server: {
19
+ port: 5001,
20
+ host: 'localhost',
21
+ cors: true,
22
+ // HMR 配置
23
+ hmr: {
24
+ port: 5001,
25
+ },
26
+ },
27
+
28
+ // 优化依赖处理
29
+ optimizeDeps: {
30
+ // 排除这些依赖,让它们从平台端加载
31
+ exclude: ['@easy-editor/core', '@easy-editor/materials-shared'],
32
+ },
33
+
34
+ // 构建配置(用于生产环境,开发时不影响)
35
+ build: {
36
+ lib: {
37
+ entry: 'src/index.tsx',
38
+ formats: ['es'],
39
+ fileName: 'index',
40
+ },
41
+ rollupOptions: {
42
+ // 外部依赖不打包
43
+ external: ['react', 'react-dom', '@easy-editor/core', '@easy-editor/materials-shared'],
44
+ output: {
45
+ globals: {
46
+ react: 'React',
47
+ 'react-dom': 'ReactDOM',
48
+ },
49
+ },
50
+ },
51
+ },
52
+
53
+ // 解析配置
54
+ resolve: {
55
+ // 确保使用相同的 React 实例
56
+ dedupe: ['react', 'react-dom'],
57
+ },
58
+
59
+ // esbuild 配置
60
+ esbuild: {
61
+ // 保留 JSX 注释,便于调试
62
+ jsx: 'automatic',
63
+ },
64
+ })