@easy-editor/materials-dashboard-text 0.0.15 → 0.0.16
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/CHANGELOG.md +6 -0
- package/dist/component.min.js +1 -2
- package/dist/index.min.js +1 -2
- package/dist/meta.min.js +1 -2
- package/easypack.config.ts +10 -0
- package/package.json +6 -10
- package/src/assets/plain.png +0 -0
- package/src/component.module.css +58 -0
- package/src/component.tsx +261 -0
- package/src/configure.ts +384 -0
- package/{dist/src/constants.d.ts → src/constants.ts} +17 -16
- package/src/index.tsx +7 -0
- package/src/meta.ts +26 -0
- package/src/snippets.ts +151 -0
- package/src/type.d.ts +8 -0
- package/tsconfig.json +20 -9
- package/.vite/plugins/vite-plugin-external-deps.ts +0 -224
- package/.vite/plugins/vite-plugin-material-dev.ts +0 -218
- package/dist/component.esm.js +0 -134
- package/dist/component.esm.js.map +0 -1
- package/dist/component.js +0 -143
- package/dist/component.js.map +0 -1
- package/dist/component.min.js.map +0 -1
- package/dist/index.cjs +0 -513
- package/dist/index.cjs.map +0 -1
- package/dist/index.esm.js +0 -510
- package/dist/index.esm.js.map +0 -1
- package/dist/index.js +0 -518
- package/dist/index.js.map +0 -1
- package/dist/index.min.js.map +0 -1
- package/dist/meta.esm.js +0 -380
- package/dist/meta.esm.js.map +0 -1
- package/dist/meta.js +0 -388
- package/dist/meta.js.map +0 -1
- package/dist/meta.min.js.map +0 -1
- package/dist/src/component.d.ts +0 -48
- package/dist/src/configure.d.ts +0 -6
- package/dist/src/index.d.ts +0 -6
- package/dist/src/meta.d.ts +0 -6
- package/dist/src/snippets.d.ts +0 -6
- package/vite.config.ts +0 -54
package/dist/meta.js
DELETED
|
@@ -1,388 +0,0 @@
|
|
|
1
|
-
/* @easy-editor/materials-dashboard-text v0.0.15 (meta) */
|
|
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';
|
|
7
|
-
|
|
8
|
-
const configure = {
|
|
9
|
-
props: [{
|
|
10
|
-
type: 'group',
|
|
11
|
-
title: '属性',
|
|
12
|
-
setter: 'TabSetter',
|
|
13
|
-
items: [{
|
|
14
|
-
type: 'group',
|
|
15
|
-
key: 'config',
|
|
16
|
-
title: '配置',
|
|
17
|
-
items: [
|
|
18
|
-
{
|
|
19
|
-
name: 'nodeInfo',
|
|
20
|
-
title: '节点信息',
|
|
21
|
-
setter: 'NodeInfoSetter',
|
|
22
|
-
extraProps: {
|
|
23
|
-
label: false
|
|
24
|
-
}
|
|
25
|
-
}, {
|
|
26
|
-
name: 'title',
|
|
27
|
-
title: '标题',
|
|
28
|
-
setter: 'StringSetter',
|
|
29
|
-
extraProps: {
|
|
30
|
-
getValue(target) {
|
|
31
|
-
return target.getExtraPropValue('title');
|
|
32
|
-
},
|
|
33
|
-
setValue(target, value) {
|
|
34
|
-
target.setExtraPropValue('title', value);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}, {
|
|
38
|
-
type: 'group',
|
|
39
|
-
title: '基础属性',
|
|
40
|
-
setter: {
|
|
41
|
-
componentName: 'CollapseSetter',
|
|
42
|
-
props: {
|
|
43
|
-
icon: false
|
|
44
|
-
}
|
|
45
|
-
},
|
|
46
|
-
items: [{
|
|
47
|
-
name: 'rect',
|
|
48
|
-
title: '位置尺寸',
|
|
49
|
-
setter: 'RectSetter',
|
|
50
|
-
extraProps: {
|
|
51
|
-
getValue(target) {
|
|
52
|
-
return target.getExtraPropValue('$dashboard.rect');
|
|
53
|
-
},
|
|
54
|
-
setValue(target, value) {
|
|
55
|
-
target.setExtraPropValue('$dashboard.rect', value);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}]
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
type: 'group',
|
|
62
|
-
title: '内容',
|
|
63
|
-
setter: {
|
|
64
|
-
componentName: 'CollapseSetter',
|
|
65
|
-
props: {
|
|
66
|
-
icon: false
|
|
67
|
-
}
|
|
68
|
-
},
|
|
69
|
-
items: [{
|
|
70
|
-
name: 'content',
|
|
71
|
-
title: '文本内容',
|
|
72
|
-
setter: 'TextAreaSetter',
|
|
73
|
-
extraProps: {
|
|
74
|
-
defaultValue: '文本内容'
|
|
75
|
-
}
|
|
76
|
-
}, {
|
|
77
|
-
name: 'isLink',
|
|
78
|
-
title: '作为链接',
|
|
79
|
-
setter: 'SwitchSetter',
|
|
80
|
-
extraProps: {
|
|
81
|
-
defaultValue: false
|
|
82
|
-
}
|
|
83
|
-
}, {
|
|
84
|
-
name: 'href',
|
|
85
|
-
title: '链接地址',
|
|
86
|
-
setter: 'StringSetter'
|
|
87
|
-
}, {
|
|
88
|
-
name: 'target',
|
|
89
|
-
title: '打开方式',
|
|
90
|
-
setter: {
|
|
91
|
-
componentName: 'SelectSetter',
|
|
92
|
-
props: {
|
|
93
|
-
options: [{
|
|
94
|
-
label: '新窗口',
|
|
95
|
-
value: '_blank'
|
|
96
|
-
}, {
|
|
97
|
-
label: '当前窗口',
|
|
98
|
-
value: '_self'
|
|
99
|
-
}]
|
|
100
|
-
}
|
|
101
|
-
},
|
|
102
|
-
extraProps: {
|
|
103
|
-
defaultValue: '_blank'
|
|
104
|
-
}
|
|
105
|
-
}]
|
|
106
|
-
}, {
|
|
107
|
-
type: 'group',
|
|
108
|
-
title: '字体',
|
|
109
|
-
setter: {
|
|
110
|
-
componentName: 'CollapseSetter',
|
|
111
|
-
props: {
|
|
112
|
-
icon: false
|
|
113
|
-
}
|
|
114
|
-
},
|
|
115
|
-
items: [{
|
|
116
|
-
name: 'fontSize',
|
|
117
|
-
title: '字体大小',
|
|
118
|
-
setter: 'NumberSetter',
|
|
119
|
-
extraProps: {
|
|
120
|
-
defaultValue: 16
|
|
121
|
-
}
|
|
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
|
-
}
|
|
136
|
-
},
|
|
137
|
-
extraProps: {
|
|
138
|
-
defaultValue: 'normal'
|
|
139
|
-
}
|
|
140
|
-
}, {
|
|
141
|
-
name: 'color',
|
|
142
|
-
title: '颜色',
|
|
143
|
-
setter: 'ColorSetter',
|
|
144
|
-
extraProps: {
|
|
145
|
-
defaultValue: '#ffffff'
|
|
146
|
-
}
|
|
147
|
-
}, {
|
|
148
|
-
name: 'lineHeight',
|
|
149
|
-
title: '行高',
|
|
150
|
-
setter: 'NumberSetter',
|
|
151
|
-
extraProps: {
|
|
152
|
-
defaultValue: 1.5
|
|
153
|
-
}
|
|
154
|
-
}]
|
|
155
|
-
}, {
|
|
156
|
-
type: 'group',
|
|
157
|
-
title: '对齐',
|
|
158
|
-
setter: {
|
|
159
|
-
componentName: 'CollapseSetter',
|
|
160
|
-
props: {
|
|
161
|
-
icon: false
|
|
162
|
-
}
|
|
163
|
-
},
|
|
164
|
-
items: [{
|
|
165
|
-
name: 'textAlign',
|
|
166
|
-
title: '水平对齐',
|
|
167
|
-
setter: {
|
|
168
|
-
componentName: 'SegmentedSetter',
|
|
169
|
-
props: {
|
|
170
|
-
options: [{
|
|
171
|
-
label: '左',
|
|
172
|
-
value: 'left'
|
|
173
|
-
}, {
|
|
174
|
-
label: '中',
|
|
175
|
-
value: 'center'
|
|
176
|
-
}, {
|
|
177
|
-
label: '右',
|
|
178
|
-
value: 'right'
|
|
179
|
-
}]
|
|
180
|
-
}
|
|
181
|
-
},
|
|
182
|
-
extraProps: {
|
|
183
|
-
defaultValue: 'left'
|
|
184
|
-
}
|
|
185
|
-
}, {
|
|
186
|
-
name: 'verticalAlign',
|
|
187
|
-
title: '垂直对齐',
|
|
188
|
-
setter: {
|
|
189
|
-
componentName: 'SegmentedSetter',
|
|
190
|
-
props: {
|
|
191
|
-
options: [{
|
|
192
|
-
label: '上',
|
|
193
|
-
value: 'top'
|
|
194
|
-
}, {
|
|
195
|
-
label: '中',
|
|
196
|
-
value: 'middle'
|
|
197
|
-
}, {
|
|
198
|
-
label: '下',
|
|
199
|
-
value: 'bottom'
|
|
200
|
-
}]
|
|
201
|
-
}
|
|
202
|
-
},
|
|
203
|
-
extraProps: {
|
|
204
|
-
defaultValue: 'middle'
|
|
205
|
-
}
|
|
206
|
-
}]
|
|
207
|
-
}, {
|
|
208
|
-
type: 'group',
|
|
209
|
-
title: '效果',
|
|
210
|
-
setter: {
|
|
211
|
-
componentName: 'CollapseSetter',
|
|
212
|
-
props: {
|
|
213
|
-
icon: false
|
|
214
|
-
}
|
|
215
|
-
},
|
|
216
|
-
items: [{
|
|
217
|
-
name: 'underline',
|
|
218
|
-
title: '下划线',
|
|
219
|
-
setter: 'SwitchSetter',
|
|
220
|
-
extraProps: {
|
|
221
|
-
defaultValue: false
|
|
222
|
-
}
|
|
223
|
-
}, {
|
|
224
|
-
name: 'glowEnable',
|
|
225
|
-
title: '发光效果',
|
|
226
|
-
setter: 'SwitchSetter',
|
|
227
|
-
extraProps: {
|
|
228
|
-
defaultValue: false
|
|
229
|
-
}
|
|
230
|
-
}, {
|
|
231
|
-
name: 'glowColor',
|
|
232
|
-
title: '发光颜色',
|
|
233
|
-
setter: 'ColorSetter',
|
|
234
|
-
extraProps: {
|
|
235
|
-
defaultValue: '#00d4ff'
|
|
236
|
-
}
|
|
237
|
-
}]
|
|
238
|
-
}]
|
|
239
|
-
}, {
|
|
240
|
-
type: 'group',
|
|
241
|
-
key: 'data',
|
|
242
|
-
title: '数据',
|
|
243
|
-
items: [{
|
|
244
|
-
name: 'dataBinding',
|
|
245
|
-
title: '数据绑定',
|
|
246
|
-
setter: 'DataBindingSetter'
|
|
247
|
-
}]
|
|
248
|
-
}, {
|
|
249
|
-
type: 'group',
|
|
250
|
-
key: 'advanced',
|
|
251
|
-
title: '高级',
|
|
252
|
-
items: [{
|
|
253
|
-
name: 'nodeInfo',
|
|
254
|
-
title: '节点信息',
|
|
255
|
-
setter: 'NodeInfoSetter',
|
|
256
|
-
extraProps: {
|
|
257
|
-
label: false
|
|
258
|
-
}
|
|
259
|
-
}, {
|
|
260
|
-
name: 'condition',
|
|
261
|
-
title: '显隐控制',
|
|
262
|
-
setter: 'SwitchSetter',
|
|
263
|
-
extraProps: {
|
|
264
|
-
defaultValue: true,
|
|
265
|
-
supportVariable: true
|
|
266
|
-
}
|
|
267
|
-
}]
|
|
268
|
-
}]
|
|
269
|
-
}],
|
|
270
|
-
component: {},
|
|
271
|
-
supports: {},
|
|
272
|
-
advanced: {}
|
|
273
|
-
};
|
|
274
|
-
|
|
275
|
-
const COMPONENT_NAME = 'EasyEditorMaterialsText';
|
|
276
|
-
const PACKAGE_NAME = '@easy-editor/materials-dashboard-text';
|
|
277
|
-
|
|
278
|
-
const snippets = [{
|
|
279
|
-
title: '普通文本',
|
|
280
|
-
screenshot: '',
|
|
281
|
-
schema: {
|
|
282
|
-
componentName: COMPONENT_NAME,
|
|
283
|
-
title: '普通文本',
|
|
284
|
-
props: {
|
|
285
|
-
content: '这是一段普通文本',
|
|
286
|
-
fontSize: 16,
|
|
287
|
-
color: '#ffffff'
|
|
288
|
-
},
|
|
289
|
-
$dashboard: {
|
|
290
|
-
rect: {
|
|
291
|
-
width: 120,
|
|
292
|
-
height: 40
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
}, {
|
|
297
|
-
title: '标题文本',
|
|
298
|
-
screenshot: '',
|
|
299
|
-
schema: {
|
|
300
|
-
componentName: COMPONENT_NAME,
|
|
301
|
-
title: '标题文本',
|
|
302
|
-
props: {
|
|
303
|
-
content: '标题文本',
|
|
304
|
-
fontSize: 32,
|
|
305
|
-
fontWeight: 'bold',
|
|
306
|
-
color: '#ffffff',
|
|
307
|
-
textAlign: 'center'
|
|
308
|
-
},
|
|
309
|
-
$dashboard: {
|
|
310
|
-
rect: {
|
|
311
|
-
width: 200,
|
|
312
|
-
height: 60
|
|
313
|
-
}
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
|
-
}, {
|
|
317
|
-
title: '发光标题',
|
|
318
|
-
screenshot: '',
|
|
319
|
-
schema: {
|
|
320
|
-
componentName: COMPONENT_NAME,
|
|
321
|
-
title: '发光标题',
|
|
322
|
-
props: {
|
|
323
|
-
content: '发光标题',
|
|
324
|
-
fontSize: 36,
|
|
325
|
-
fontWeight: 'bold',
|
|
326
|
-
color: '#00d4ff',
|
|
327
|
-
textAlign: 'center',
|
|
328
|
-
glowEnable: true,
|
|
329
|
-
glowColor: '#00d4ff',
|
|
330
|
-
glowIntensity: 1.5
|
|
331
|
-
},
|
|
332
|
-
$dashboard: {
|
|
333
|
-
rect: {
|
|
334
|
-
width: 240,
|
|
335
|
-
height: 80
|
|
336
|
-
}
|
|
337
|
-
}
|
|
338
|
-
}
|
|
339
|
-
}, {
|
|
340
|
-
title: '链接文本',
|
|
341
|
-
screenshot: '',
|
|
342
|
-
schema: {
|
|
343
|
-
componentName: COMPONENT_NAME,
|
|
344
|
-
title: '链接文本',
|
|
345
|
-
props: {
|
|
346
|
-
content: '点击跳转',
|
|
347
|
-
fontSize: 16,
|
|
348
|
-
color: '#00d4ff',
|
|
349
|
-
isLink: true,
|
|
350
|
-
href: 'https://easy-editor-docs.vercel.app/',
|
|
351
|
-
target: '_blank',
|
|
352
|
-
underline: true
|
|
353
|
-
},
|
|
354
|
-
$dashboard: {
|
|
355
|
-
rect: {
|
|
356
|
-
width: 120,
|
|
357
|
-
height: 40
|
|
358
|
-
}
|
|
359
|
-
}
|
|
360
|
-
}
|
|
361
|
-
}];
|
|
362
|
-
|
|
363
|
-
const MaterialGroup = {
|
|
364
|
-
BASIC: 'basic'};
|
|
365
|
-
|
|
366
|
-
var version = "0.0.15";
|
|
367
|
-
var pkg = {
|
|
368
|
-
version: version};
|
|
369
|
-
|
|
370
|
-
const meta = {
|
|
371
|
-
componentName: COMPONENT_NAME,
|
|
372
|
-
title: '文本',
|
|
373
|
-
group: MaterialGroup.BASIC,
|
|
374
|
-
devMode: 'proCode',
|
|
375
|
-
npm: {
|
|
376
|
-
package: PACKAGE_NAME,
|
|
377
|
-
version: pkg.version,
|
|
378
|
-
globalName: COMPONENT_NAME,
|
|
379
|
-
componentName: COMPONENT_NAME
|
|
380
|
-
},
|
|
381
|
-
configure,
|
|
382
|
-
snippets
|
|
383
|
-
};
|
|
384
|
-
|
|
385
|
-
exports.meta = meta;
|
|
386
|
-
|
|
387
|
-
}));
|
|
388
|
-
//# sourceMappingURL=meta.js.map
|
package/dist/meta.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"meta.js","sources":["../src/configure.ts","../src/constants.ts","../src/snippets.ts","../../../../shared/src/index.ts","../src/meta.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 items: [\n // 基础配置\n {\n name: 'nodeInfo',\n title: '节点信息',\n setter: 'NodeInfoSetter',\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: 'nodeInfo',\n title: '节点信息',\n setter: 'NodeInfoSetter',\n extraProps: {\n // @ts-expect-error label is not a valid extra prop\n label: false,\n },\n },\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 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 title: '普通文本',\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 title: '标题文本',\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 title: '发光标题',\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 title: '链接文本',\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","/**\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 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 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"],"names":["configure","props","type","title","setter","items","key","name","extraProps","label","getValue","target","getExtraPropValue","setValue","value","setExtraPropValue","componentName","icon","defaultValue","options","supportVariable","component","supports","advanced","COMPONENT_NAME","PACKAGE_NAME","snippets","screenshot","schema","content","fontSize","color","$dashboard","rect","width","height","fontWeight","textAlign","glowEnable","glowColor","glowIntensity","isLink","href","underline","MaterialGroup","INNER","BASIC","meta","group","devMode","npm","package","version","pkg","globalName"],"mappings":";;;;;;;EAOO,MAAMA,SAAoB,GAAG;EAClCC,EAAAA,KAAK,EAAE,CACL;EACEC,IAAAA,IAAI,EAAE,OAAO;EACbC,IAAAA,KAAK,EAAE,IAAI;EACXC,IAAAA,MAAM,EAAE,WAAW;EACnBC,IAAAA,KAAK,EAAE,CACL;EACEH,MAAAA,IAAI,EAAE,OAAO;EACbI,MAAAA,GAAG,EAAE,QAAQ;EACbH,MAAAA,KAAK,EAAE,IAAI;EACXE,MAAAA,KAAK,EAAE;EAEL,MAAA;EACEE,QAAAA,IAAI,EAAE,UAAU;EAChBJ,QAAAA,KAAK,EAAE,MAAM;EACbC,QAAAA,MAAM,EAAE,gBAAgB;EACxBI,QAAAA,UAAU,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ACT0B,EAAAA;EACF;;;;;;;;"}
|
package/dist/meta.min.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":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 items: [\n // 基础配置\n {\n name: 'nodeInfo',\n title: '节点信息',\n setter: 'NodeInfoSetter',\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: 'nodeInfo',\n title: '节点信息',\n setter: 'NodeInfoSetter',\n extraProps: {\n // @ts-expect-error label is not a valid extra prop\n label: false,\n },\n },\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 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 title: '普通文本',\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 title: '标题文本',\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 title: '发光标题',\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 title: '链接文本',\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","group","devMode","npm","package","version","globalName","configure","props","type","setter","items","key","name","extraProps","label","getValue","target","getExtraPropValue","setValue","value","setExtraPropValue","icon","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,MCLO,QDMPC,QAAS,UACTC,IAAK,CACHC,QDDwB,wCCExBC,iBACAC,WAAYT,EACZE,cAAeF,GAEjBU,UFhBkC,CAClCC,MAAO,CACL,CACEC,KAAM,QACNT,MAAO,KACPU,OAAQ,YACRC,MAAO,CACL,CACEF,KAAM,QACNG,IAAK,SACLZ,MAAO,KACPW,MAAO,CAEL,CACEE,KAAM,WACNb,MAAO,OACPU,OAAQ,iBACRI,WAAY,CAEVC,OAAO,IAGX,CACEF,KAAM,QACNb,MAAO,KACPU,OAAQ,eACRI,WAAY,CACVE,SAASC,GACAA,EAAOC,kBAAkB,SAElCC,QAAAA,CAASF,EAAQG,GACfH,EAAOI,kBAAkB,QAASD,EACpC,IAGJ,CACEX,KAAM,QACNT,MAAO,OACPU,OAAQ,CACNX,cAAe,iBACfS,MAAO,CACLc,MAAM,IAGVX,MAAO,CACL,CACEE,KAAM,OACNb,MAAO,OACPU,OAAQ,aACRI,WAAY,CACVE,SAASC,GACAA,EAAOC,kBAAkB,mBAElCC,QAAAA,CAASF,EAAQG,GACfH,EAAOI,kBAAkB,kBAAmBD,EAC9C,MAMR,CACEX,KAAM,QACNT,MAAO,KACPU,OAAQ,CACNX,cAAe,iBACfS,MAAO,CACLc,MAAM,IAGVX,MAAO,CACL,CACEE,KAAM,UACNb,MAAO,OACPU,OAAQ,iBACRI,WAAY,CACVS,aAAc,SAGlB,CACEV,KAAM,SACNb,MAAO,OACPU,OAAQ,eACRI,WAAY,CACVS,cAAc,IA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AQ,OAKhB,CACEtC,MAAO,OACP8B,WAAY,GACZC,OAAQ,CACNhC,cAAeF,EACfG,MAAO,OACPQ,MAAO,CACLwB,QAAS,OACTC,SAAU,GACVC,MAAO,UACPU,QAAQ,EACRC,KAAM,uCACN5B,OAAQ,SACR6B,WAAW,GAEbX,WAAY,CACVC,KAAM,CACJC,MAAO,IACPC,OAAQ"}
|
package/dist/src/component.d.ts
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Text Component
|
|
3
|
-
* 文本组件 - 支持普通文本、链接、标题、发光效果
|
|
4
|
-
*/
|
|
5
|
-
import type { CSSProperties, Ref } from 'react';
|
|
6
|
-
export type TextAlign = 'left' | 'center' | 'right';
|
|
7
|
-
export type VerticalAlign = 'top' | 'middle' | 'bottom';
|
|
8
|
-
export interface TextProps {
|
|
9
|
-
ref?: Ref<HTMLDivElement>;
|
|
10
|
-
/** 文本内容 */
|
|
11
|
-
content?: string;
|
|
12
|
-
/** 字体大小 */
|
|
13
|
-
fontSize?: number;
|
|
14
|
-
/** 字体粗细 */
|
|
15
|
-
fontWeight?: number | 'normal' | 'bold';
|
|
16
|
-
/** 字体家族 */
|
|
17
|
-
fontFamily?: string;
|
|
18
|
-
/** 颜色 */
|
|
19
|
-
color?: string;
|
|
20
|
-
/** 水平对齐 */
|
|
21
|
-
textAlign?: TextAlign;
|
|
22
|
-
/** 垂直对齐 */
|
|
23
|
-
verticalAlign?: VerticalAlign;
|
|
24
|
-
/** 行高 */
|
|
25
|
-
lineHeight?: number;
|
|
26
|
-
/** 字间距 */
|
|
27
|
-
letterSpacing?: number;
|
|
28
|
-
/** 是否为链接 */
|
|
29
|
-
isLink?: boolean;
|
|
30
|
-
/** 链接地址 */
|
|
31
|
-
href?: string;
|
|
32
|
-
/** 链接打开方式 */
|
|
33
|
-
target?: '_self' | '_blank';
|
|
34
|
-
/** 下划线 */
|
|
35
|
-
underline?: boolean;
|
|
36
|
-
/** 发光效果 */
|
|
37
|
-
glowEnable?: boolean;
|
|
38
|
-
/** 发光颜色 */
|
|
39
|
-
glowColor?: string;
|
|
40
|
-
/** 发光强度 */
|
|
41
|
-
glowIntensity?: number;
|
|
42
|
-
/** 显隐控制 */
|
|
43
|
-
condition?: boolean;
|
|
44
|
-
/** 外部样式 */
|
|
45
|
-
style?: CSSProperties;
|
|
46
|
-
}
|
|
47
|
-
export declare const Text: React.FC<TextProps>;
|
|
48
|
-
export default Text;
|
package/dist/src/configure.d.ts
DELETED
package/dist/src/index.d.ts
DELETED
package/dist/src/meta.d.ts
DELETED
package/dist/src/snippets.d.ts
DELETED
package/vite.config.ts
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
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
|
-
})
|