@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.
@@ -0,0 +1,218 @@
1
+ /**
2
+ * Vite Plugin for Material Development
3
+ * 物料开发 Vite 插件 - 提供物料调试所需的 API 和 WebSocket 通知
4
+ */
5
+
6
+ import type { Plugin, ViteDevServer } from 'vite'
7
+ import type { IncomingMessage, ServerResponse } from 'node:http'
8
+ import { WebSocketServer, WebSocket } from 'ws'
9
+
10
+ interface MaterialDevPluginOptions {
11
+ /** 物料入口文件路径 */
12
+ entry?: string
13
+ /** WebSocket 端口(默认与 HTTP 端口相同) */
14
+ wsPort?: number
15
+ }
16
+
17
+ /**
18
+ * 物料开发插件
19
+ * 提供:
20
+ * - /api/health - 健康检查
21
+ * - /api/material - 物料信息
22
+ * - WebSocket 通知 - 文件变更时通知连接的客户端
23
+ */
24
+ export function materialDevPlugin(options: MaterialDevPluginOptions = {}): Plugin {
25
+ const { entry = '/src/index.tsx' } = options
26
+
27
+ let server: ViteDevServer
28
+ let wss: WebSocketServer | null = null
29
+ const clients = new Set<WebSocket>()
30
+
31
+ // 广播消息给所有连接的客户端
32
+ function broadcast(message: object) {
33
+ const data = JSON.stringify(message)
34
+ for (const client of clients) {
35
+ if (client.readyState === WebSocket.OPEN) {
36
+ client.send(data)
37
+ }
38
+ }
39
+ }
40
+
41
+ return {
42
+ name: 'vite-plugin-material-dev',
43
+
44
+ configureServer(_server) {
45
+ server = _server
46
+
47
+ // 创建 WebSocket 服务器,复用 Vite 的 HTTP 服务器
48
+ wss = new WebSocketServer({ noServer: true })
49
+
50
+ // 处理 WebSocket 升级请求
51
+ server.httpServer?.on('upgrade', (request, socket, head) => {
52
+ // 只处理 /ws 路径的 WebSocket 请求,避免与 Vite HMR 冲突
53
+ if (request.url === '/ws' || request.url === '/__material_ws__') {
54
+ wss?.handleUpgrade(request, socket, head, ws => {
55
+ wss?.emit('connection', ws, request)
56
+ })
57
+ }
58
+ })
59
+
60
+ wss.on('connection', ws => {
61
+ console.log('[MaterialDevPlugin] Client connected')
62
+ clients.add(ws)
63
+
64
+ // 发送连接成功消息
65
+ ws.send(
66
+ JSON.stringify({
67
+ type: 'connected',
68
+ message: 'Material dev server connected',
69
+ timestamp: Date.now(),
70
+ }),
71
+ )
72
+
73
+ ws.on('close', () => {
74
+ console.log('[MaterialDevPlugin] Client disconnected')
75
+ clients.delete(ws)
76
+ })
77
+
78
+ ws.on('error', error => {
79
+ console.error('[MaterialDevPlugin] WebSocket error:', error)
80
+ clients.delete(ws)
81
+ })
82
+ })
83
+
84
+ // 处理 CORS 预检请求(需要在其他中间件之前)
85
+ server.middlewares.use((req: IncomingMessage, res: ServerResponse, next: () => void) => {
86
+ if (req.method === 'OPTIONS') {
87
+ res.setHeader('Access-Control-Allow-Origin', '*')
88
+ res.setHeader('Access-Control-Allow-Methods', 'GET, POST, OPTIONS')
89
+ res.setHeader('Access-Control-Allow-Headers', 'Content-Type')
90
+ res.statusCode = 204
91
+ res.end()
92
+ return
93
+ }
94
+ next()
95
+ })
96
+
97
+ // 健康检查 API
98
+ server.middlewares.use('/api/health', (_req: IncomingMessage, res: ServerResponse) => {
99
+ res.setHeader('Content-Type', 'application/json')
100
+ res.setHeader('Access-Control-Allow-Origin', '*')
101
+ res.end(
102
+ JSON.stringify({
103
+ status: 'ok',
104
+ timestamp: Date.now(),
105
+ server: 'vite',
106
+ wsPath: '/ws',
107
+ }),
108
+ )
109
+ })
110
+
111
+ // 物料信息 API
112
+ server.middlewares.use('/api/material', async (_req: IncomingMessage, res: ServerResponse) => {
113
+ res.setHeader('Content-Type', 'application/json')
114
+ res.setHeader('Access-Control-Allow-Origin', '*')
115
+
116
+ try {
117
+ // 使用 Vite 的 SSR 模块加载能力加载物料模块
118
+ const module = await server.ssrLoadModule(entry)
119
+
120
+ const meta = module.meta || module.default?.meta
121
+ const component = module.component || module.default
122
+
123
+ if (!meta) {
124
+ res.statusCode = 400
125
+ res.end(
126
+ JSON.stringify({
127
+ error: 'Material meta not found. Make sure to export "meta" from the entry file.',
128
+ }),
129
+ )
130
+ return
131
+ }
132
+
133
+ // 返回物料信息
134
+ const materialInfo = {
135
+ // 基本信息
136
+ name: meta.componentName,
137
+ title: meta.title,
138
+ version: meta.npm?.version || '0.0.0-dev',
139
+ group: meta.group,
140
+ category: meta.category,
141
+
142
+ // 入口信息
143
+ entry,
144
+
145
+ // 模块状态
146
+ hasComponent: !!component,
147
+ hasMeta: !!meta,
148
+ hasConfigure: !!meta.configure,
149
+ hasSnippets: Array.isArray(meta.snippets) && meta.snippets.length > 0,
150
+
151
+ // WebSocket 路径
152
+ wsPath: '/ws',
153
+ }
154
+
155
+ res.end(JSON.stringify(materialInfo))
156
+ } catch (error) {
157
+ console.error('[MaterialDevPlugin] Failed to load material:', error)
158
+ res.statusCode = 500
159
+ res.end(
160
+ JSON.stringify({
161
+ error: error instanceof Error ? error.message : String(error),
162
+ }),
163
+ )
164
+ }
165
+ })
166
+
167
+ // 在服务器启动时打印信息
168
+ server.httpServer?.once('listening', () => {
169
+ const address = server.httpServer?.address()
170
+ const port = typeof address === 'object' && address ? address.port : 5001
171
+ const host = server.config.server.host || 'localhost'
172
+
173
+ setTimeout(() => {
174
+ console.log('')
175
+ console.log('\x1b[36m%s\x1b[0m', ' Material Dev Server Ready')
176
+ console.log('')
177
+ console.log(` Health Check: http://${host}:${port}/api/health`)
178
+ console.log(` Material Info: http://${host}:${port}/api/material`)
179
+ console.log(` Module Entry: http://${host}:${port}${entry}`)
180
+ console.log(` WebSocket: ws://${host}:${port}/ws`)
181
+ console.log('')
182
+ console.log('\x1b[33m%s\x1b[0m', ' Connect this URL in EasyEditor to start debugging')
183
+ console.log('')
184
+ }, 100)
185
+ })
186
+ },
187
+
188
+ // 监听 Vite 的 HMR 事件,转发给我们的 WebSocket 客户端
189
+ handleHotUpdate({ file, modules }) {
190
+ console.log(`[MaterialDevPlugin] File changed: ${file}`)
191
+
192
+ // 通知所有连接的客户端
193
+ broadcast({
194
+ type: 'update',
195
+ file,
196
+ timestamp: Date.now(),
197
+ modules: modules.map(m => m.id),
198
+ })
199
+
200
+ // 返回 undefined 让 Vite 继续处理 HMR
201
+ return
202
+ },
203
+
204
+ // 插件关闭时清理
205
+ closeBundle() {
206
+ if (wss) {
207
+ for (const client of clients) {
208
+ client.close()
209
+ }
210
+ clients.clear()
211
+ wss.close()
212
+ wss = null
213
+ }
214
+ },
215
+ }
216
+ }
217
+
218
+ export default materialDevPlugin
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @easy-editor/materials-dashboard-text
2
2
 
3
+ ## 0.0.10
4
+
5
+ ### Patch Changes
6
+
7
+ - fix: configure error
8
+
9
+ ## 0.0.9
10
+
11
+ ### Patch Changes
12
+
13
+ - build: add esm build
14
+
3
15
  ## 0.0.8
4
16
 
5
17
  ### Patch Changes
@@ -0,0 +1,40 @@
1
+ /* @easy-editor/materials-dashboard-text v0.0.9 (component, esm) */
2
+ import { jsx } from 'react/jsx-runtime';
3
+
4
+ const Text = props => {
5
+ const {
6
+ ref,
7
+ text = 'Text',
8
+ fontSize = 14,
9
+ color = '#ffffff',
10
+ fontWeight = 'normal',
11
+ textAlign = 'left',
12
+ lineHeight = 1.5,
13
+ className = '',
14
+ style: externalStyle
15
+ } = props;
16
+ const internalStyle = {
17
+ width: '100%',
18
+ height: '100%',
19
+ fontSize: typeof fontSize === 'number' ? `${fontSize}px` : fontSize,
20
+ color,
21
+ fontWeight,
22
+ textAlign,
23
+ lineHeight,
24
+ wordBreak: 'break-word',
25
+ whiteSpace: 'pre-wrap'
26
+ };
27
+ const mergedStyle = {
28
+ ...internalStyle,
29
+ ...externalStyle
30
+ };
31
+ return /*#__PURE__*/jsx("div", {
32
+ className: className,
33
+ ref: ref,
34
+ style: mergedStyle,
35
+ children: text
36
+ });
37
+ };
38
+
39
+ export { Text as default };
40
+ //# sourceMappingURL=component.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"component.esm.js","sources":["../src/component.tsx"],"sourcesContent":["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":["Text","props","ref","text","fontSize","color","fontWeight","textAlign","lineHeight","className","style","externalStyle","internalStyle","width","height","wordBreak","whiteSpace","mergedStyle","_jsx","children"],"mappings":";;;AAcA,MAAMA,IAAI,GAAIC,KAAgB,IAAK;EACjC,MAAM;IACJC,GAAG;AACHC,IAAAA,IAAI,GAAG,MAAM;AACbC,IAAAA,QAAQ,GAAG,EAAE;AACbC,IAAAA,KAAK,GAAG,SAAS;AACjBC,IAAAA,UAAU,GAAG,QAAQ;AACrBC,IAAAA,SAAS,GAAG,MAAM;AAClBC,IAAAA,UAAU,GAAG,GAAG;AAChBC,IAAAA,SAAS,GAAG,EAAE;AACdC,IAAAA,KAAK,EAAEC;AACT,GAAC,GAAGV,KAAK;AAET,EAAA,MAAMW,aAA4B,GAAG;AACnCC,IAAAA,KAAK,EAAE,MAAM;AACbC,IAAAA,MAAM,EAAE,MAAM;IACdV,QAAQ,EAAE,OAAOA,QAAQ,KAAK,QAAQ,GAAG,CAAA,EAAGA,QAAQ,CAAA,EAAA,CAAI,GAAGA,QAAQ;IACnEC,KAAK;IACLC,UAAU;IACVC,SAAS;IACTC,UAAU;AACVO,IAAAA,SAAS,EAAE,YAAY;AACvBC,IAAAA,UAAU,EAAE;GACb;AAED,EAAA,MAAMC,WAAW,GAAG;AAAE,IAAA,GAAGL,aAAa;IAAE,GAAGD;GAAe;AAE1D,EAAA,oBACEO,GAAA,CAAA,KAAA,EAAA;AAAKT,IAAAA,SAAS,EAAEA,SAAU;AAACP,IAAAA,GAAG,EAAEA,GAAI;AAACQ,IAAAA,KAAK,EAAEO,WAAY;AAAAE,IAAAA,QAAA,EACrDhB;AAAI,GACF,CAAC;AAEV;;;;"}
package/dist/component.js CHANGED
@@ -1,9 +1,9 @@
1
- /* @easy-editor/materials-dashboard-text v0.0.7 (component) */
1
+ /* @easy-editor/materials-dashboard-text v0.0.9 (component) */
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.EasyEditorMaterialsTextComponent = {}));
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.EasyEditorMaterialsTextComponent = {}, global.jsxRuntime));
6
+ })(this, (function (exports, jsxRuntime) { 'use strict';
7
7
 
8
8
  const Text = props => {
9
9
  const {
@@ -32,11 +32,12 @@
32
32
  ...internalStyle,
33
33
  ...externalStyle
34
34
  };
35
- return /*#__PURE__*/React.createElement("div", {
35
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
36
36
  className: className,
37
37
  ref: ref,
38
- style: mergedStyle
39
- }, text);
38
+ style: mergedStyle,
39
+ children: text
40
+ });
40
41
  };
41
42
 
42
43
  exports.default = Text;
@@ -1 +1 @@
1
- {"version":3,"file":"component.js","sources":["../src/component.tsx"],"sourcesContent":["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":["Text","props","ref","text","fontSize","color","fontWeight","textAlign","lineHeight","className","style","externalStyle","internalStyle","width","height","wordBreak","whiteSpace","mergedStyle","React","createElement"],"mappings":";;;;;;;AAcA,QAAMA,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;;;;;;;;;;"}
1
+ {"version":3,"file":"component.js","sources":["../src/component.tsx"],"sourcesContent":["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":["Text","props","ref","text","fontSize","color","fontWeight","textAlign","lineHeight","className","style","externalStyle","internalStyle","width","height","wordBreak","whiteSpace","mergedStyle","_jsx","children"],"mappings":";;;;;;;AAcA,QAAMA,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;EAE1D,EAAA,oBACEO,cAAA,CAAA,KAAA,EAAA;EAAKT,IAAAA,SAAS,EAAEA,SAAU;EAACP,IAAAA,GAAG,EAAEA,GAAI;EAACQ,IAAAA,KAAK,EAAEO,WAAY;EAAAE,IAAAA,QAAA,EACrDhB;EAAI,GACF,CAAC;EAEV;;;;;;;;;;"}
@@ -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).EasyEditorMaterialsTextComponent={})}(this,function(e){"use strict";e.default=e=>{const{ref:t,text:o="Text",fontSize:f=14,color:i="#ffffff",fontWeight:n="normal",textAlign:l="left",lineHeight:r=1.5,className:a="",style:s}=e,d={...{width:"100%",height:"100%",fontSize:"number"==typeof f?`${f}px`:f,color:i,fontWeight:n,textAlign:l,lineHeight:r,wordBreak:"break-word",whiteSpace:"pre-wrap"},...s};return React.createElement("div",{className:a,ref:t,style:d},o)},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).EasyEditorMaterialsTextComponent={},e.jsxRuntime)}(this,function(e,t){"use strict";e.default=e=>{const{ref:i,text:n="Text",fontSize:o=14,color:f="#ffffff",fontWeight:r="normal",textAlign:l="left",lineHeight:s=1.5,className:a="",style:d}=e,u={...{width:"100%",height:"100%",fontSize:"number"==typeof o?`${o}px`:o,color:f,fontWeight:r,textAlign:l,lineHeight:s,wordBreak:"break-word",whiteSpace:"pre-wrap"},...d};return t.jsx("div",{className:a,ref:i,style:u,children:n})},Object.defineProperty(e,"__esModule",{value:!0})});
2
2
  //# sourceMappingURL=component.min.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"component.min.js","sources":["../src/component.tsx"],"sourcesContent":["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":["props","ref","text","fontSize","color","fontWeight","textAlign","lineHeight","className","style","externalStyle","mergedStyle","width","height","wordBreak","whiteSpace","React","createElement"],"mappings":"iRAccA,IACZ,MAAMC,IACJA,EAAGC,KACHA,EAAO,OAAMC,SACbA,EAAW,GAAEC,MACbA,EAAQ,UAASC,WACjBA,EAAa,SAAQC,UACrBA,EAAY,OAAMC,WAClBA,EAAa,IAAGC,UAChBA,EAAY,GACZC,MAAOC,GACLV,EAcEW,EAAc,IAZiB,CACnCC,MAAO,OACPC,OAAQ,OACRV,SAA8B,iBAAbA,EAAwB,GAAGA,MAAeA,EAC3DC,QACAC,aACAC,YACAC,aACAO,UAAW,aACXC,WAAY,eAG6BL,GAE3C,OACEM,MAAAC,cAAA,MAAA,CAAKT,UAAWA,EAAWP,IAAKA,EAAKQ,MAAOE,GACzCT"}
1
+ {"version":3,"file":"component.min.js","sources":["../src/component.tsx"],"sourcesContent":["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":["props","ref","text","fontSize","color","fontWeight","textAlign","lineHeight","className","style","externalStyle","mergedStyle","width","height","wordBreak","whiteSpace","_jsx","children"],"mappings":"iVAccA,IACZ,MAAMC,IACJA,EAAGC,KACHA,EAAO,OAAMC,SACbA,EAAW,GAAEC,MACbA,EAAQ,UAASC,WACjBA,EAAa,SAAQC,UACrBA,EAAY,OAAMC,WAClBA,EAAa,IAAGC,UAChBA,EAAY,GACZC,MAAOC,GACLV,EAcEW,EAAc,IAZiB,CACnCC,MAAO,OACPC,OAAQ,OACRV,SAA8B,iBAAbA,EAAwB,GAAGA,MAAeA,EAC3DC,QACAC,aACAC,YACAC,aACAO,UAAW,aACXC,WAAY,eAG6BL,GAE3C,OACEM,EAAAA,IAAA,MAAA,CAAKR,UAAWA,EAAWP,IAAKA,EAAKQ,MAAOE,EAAYM,SACrDf"}
package/dist/index.cjs CHANGED
@@ -1,5 +1,7 @@
1
1
  'use strict';
2
2
 
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+
3
5
  const MaterialGroup = {
4
6
  BASIC: 'basic'};
5
7
 
@@ -33,11 +35,12 @@ const Text = props => {
33
35
  ...internalStyle,
34
36
  ...externalStyle
35
37
  };
36
- return /*#__PURE__*/React.createElement("div", {
38
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
37
39
  className: className,
38
40
  ref: ref,
39
- style: mergedStyle
40
- }, text);
41
+ style: mergedStyle,
42
+ children: text
43
+ });
41
44
  };
42
45
 
43
46
  const configure = {
@@ -114,51 +117,6 @@ const configure = {
114
117
  extraProps: {
115
118
  defaultValue: '#000000'
116
119
  }
117
- }, {
118
- name: 'fontWeight',
119
- title: '字体粗细',
120
- setter: {
121
- componentName: 'SelectSetter',
122
- props: {
123
- options: [{
124
- label: '正常',
125
- value: 'normal'
126
- }, {
127
- label: '粗体',
128
- value: 'bold'
129
- }, {
130
- label: '100',
131
- value: '100'
132
- }, {
133
- label: '200',
134
- value: '200'
135
- }, {
136
- label: '300',
137
- value: '300'
138
- }, {
139
- label: '400',
140
- value: '400'
141
- }, {
142
- label: '500',
143
- value: '500'
144
- }, {
145
- label: '600',
146
- value: '600'
147
- }, {
148
- label: '700',
149
- value: '700'
150
- }, {
151
- label: '800',
152
- value: '800'
153
- }, {
154
- label: '900',
155
- value: '900'
156
- }]
157
- }
158
- },
159
- extraProps: {
160
- defaultValue: 'normal'
161
- }
162
120
  }, {
163
121
  name: 'lineHeight',
164
122
  title: '行高',
@@ -166,30 +124,6 @@ const configure = {
166
124
  extraProps: {
167
125
  defaultValue: 1.5
168
126
  }
169
- }, {
170
- name: 'textAlign',
171
- title: '文本对齐',
172
- setter: {
173
- componentName: 'RadioGroupSetter',
174
- props: {
175
- options: [{
176
- label: '左对齐',
177
- value: 'left'
178
- }, {
179
- label: '居中',
180
- value: 'center'
181
- }, {
182
- label: '右对齐',
183
- value: 'right'
184
- }, {
185
- label: '两端对齐',
186
- value: 'justify'
187
- }]
188
- }
189
- },
190
- extraProps: {
191
- defaultValue: 'left'
192
- }
193
127
  }]
194
128
  }]
195
129
  }, {
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","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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,MAAAA,SAAS,EAAE;KACZ;AACDwC,IAAAA,UAAU,EAAE;AACVC,MAAAA,IAAI,EAAE;AACJnC,QAAAA,KAAK,EAAE,GAAG;AACVC,QAAAA,MAAM,EAAE;AACV;AACF;AACF;AACF,CAAC,EACD;AACEQ,EAAAA,KAAK,EAAE,SAAS;AAChBuB,EAAAA,UAAU,EAAE,6FAA6F;AACzGC,EAAAA,MAAM,EAAE;AACNZ,IAAAA,aAAa,EAAEpC,cAAc;AAC7BG,IAAAA,KAAK,EAAE;AACLE,MAAAA,IAAI,EAAE,SAAS;AACfC,MAAAA,QAAQ,EAAE,EAAE;AACZC,MAAAA,KAAK,EAAE,SAAS;AAChBC,MAAAA,UAAU,EAAE,MAAM;AAClBC,MAAAA,SAAS,EAAE;KACZ;AACDwC,IAAAA,UAAU,EAAE;AACVC,MAAAA,IAAI,EAAE;AACJnC,QAAAA,KAAK,EAAE,GAAG;AACVC,QAAAA,MAAM,EAAE;AACV;AACF;AACF;AACF,CAAC,CACF;;ACrCD,MAAMmC,IAAuB,GAAG;AAC9Bf,EAAAA,aAAa,EAAEpC,cAAc;AAC7BwB,EAAAA,KAAK,EAAE,MAAM;EACb4B,KAAK,EAAEvD,aAAa,CAACE,KAAK;AAC1BsD,EAAAA,OAAO,EAAE,SAAS;AAClBC,EAAAA,GAAG,EAAE;AACHC,IAAAA,OAAO,EAAEtD,YAAY;AACrBuD,IAAAA,OAAO,EAAE,QAAQ;AACjBC,IAAAA,UAAU,EAAEzD,cAAc;AAC1BoC,IAAAA,aAAa,EAAEpC;GAChB;EACD8C,QAAQ;AACRxB,EAAAA;AACF;;;;;"}
1
+ {"version":3,"file":"index.cjs","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":";;;;AAIO,MAAMA,aAAa,GAAG;AAE3BC,EAEAC,KAAK,EAAE,OAOT,CAAU;;ACHH,MAAMC,cAAc,GAAG,yBAAyB;AAKhD,MAAMC,YAAY,GAAG,uCAAu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,CACF;;ACrCD,MAAMiC,IAAuB,GAAG;AAC9Bb,EAAAA,aAAa,EAAEpC,cAAc;AAC7BwB,EAAAA,KAAK,EAAE,MAAM;EACb0B,KAAK,EAAErD,aAAa,CAACE,KAAK;AAC1BoD,EAAAA,OAAO,EAAE,SAAS;AAClBC,EAAAA,GAAG,EAAE;AACHC,IAAAA,OAAO,EAAEpD,YAAY;AACrBqD,IAAAA,OAAO,EAAE,QAAQ;AACjBC,IAAAA,UAAU,EAAEvD,cAAc;AAC1BoC,IAAAA,aAAa,EAAEpC;GAChB;EACD4C,QAAQ;AACRtB,EAAAA;AACF;;;;;"}
package/dist/index.esm.js CHANGED
@@ -1,3 +1,5 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+
1
3
  const MaterialGroup = {
2
4
  BASIC: 'basic'};
3
5
 
@@ -31,11 +33,12 @@ const Text = props => {
31
33
  ...internalStyle,
32
34
  ...externalStyle
33
35
  };
34
- return /*#__PURE__*/React.createElement("div", {
36
+ return /*#__PURE__*/jsx("div", {
35
37
  className: className,
36
38
  ref: ref,
37
- style: mergedStyle
38
- }, text);
39
+ style: mergedStyle,
40
+ children: text
41
+ });
39
42
  };
40
43
 
41
44
  const configure = {
@@ -112,51 +115,6 @@ const configure = {
112
115
  extraProps: {
113
116
  defaultValue: '#000000'
114
117
  }
115
- }, {
116
- name: 'fontWeight',
117
- title: '字体粗细',
118
- setter: {
119
- componentName: 'SelectSetter',
120
- props: {
121
- options: [{
122
- label: '正常',
123
- value: 'normal'
124
- }, {
125
- label: '粗体',
126
- value: 'bold'
127
- }, {
128
- label: '100',
129
- value: '100'
130
- }, {
131
- label: '200',
132
- value: '200'
133
- }, {
134
- label: '300',
135
- value: '300'
136
- }, {
137
- label: '400',
138
- value: '400'
139
- }, {
140
- label: '500',
141
- value: '500'
142
- }, {
143
- label: '600',
144
- value: '600'
145
- }, {
146
- label: '700',
147
- value: '700'
148
- }, {
149
- label: '800',
150
- value: '800'
151
- }, {
152
- label: '900',
153
- value: '900'
154
- }]
155
- }
156
- },
157
- extraProps: {
158
- defaultValue: 'normal'
159
- }
160
118
  }, {
161
119
  name: 'lineHeight',
162
120
  title: '行高',
@@ -164,30 +122,6 @@ const configure = {
164
122
  extraProps: {
165
123
  defaultValue: 1.5
166
124
  }
167
- }, {
168
- name: 'textAlign',
169
- title: '文本对齐',
170
- setter: {
171
- componentName: 'RadioGroupSetter',
172
- props: {
173
- options: [{
174
- label: '左对齐',
175
- value: 'left'
176
- }, {
177
- label: '居中',
178
- value: 'center'
179
- }, {
180
- label: '右对齐',
181
- value: 'right'
182
- }, {
183
- label: '两端对齐',
184
- value: 'justify'
185
- }]
186
- }
187
- },
188
- extraProps: {
189
- defaultValue: 'left'
190
- }
191
125
  }]
192
126
  }]
193
127
  }, {