@easy-editor/materials-dashboard-text 0.0.1
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 +7 -0
- package/LICENSE +9 -0
- package/README.md +127 -0
- package/dist/index.cjs +287 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.esm.js +279 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/index.js +292 -0
- package/dist/index.js.map +1 -0
- package/dist/index.min.js +2 -0
- package/dist/index.min.js.map +1 -0
- package/package.json +62 -0
- package/tsconfig.json +9 -0
package/CHANGELOG.md
ADDED
package/LICENSE
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright © 2025-PRESENT JinSo <https://github.com/JinSooo>
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
+
|
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
# @easy-editor/materials-dashboard-text
|
|
2
|
+
|
|
3
|
+
Text component for EasyEditor dashboard.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- ✅ Configurable text component with rich styling options
|
|
8
|
+
- ✅ Support for font size, color, weight, alignment, and line height
|
|
9
|
+
- ✅ Pure inline styles - no CSS dependencies
|
|
10
|
+
- ✅ Lightweight and optimized build output
|
|
11
|
+
- ✅ TypeScript support with full type definitions
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install @easy-editor/materials-dashboard-text
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
**Peer Dependencies**: 确保已安装以下依赖
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
npm install @easy-editor/core react react-dom
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Usage
|
|
26
|
+
|
|
27
|
+
### In EasyEditor
|
|
28
|
+
|
|
29
|
+
```typescript
|
|
30
|
+
import Text, { meta, snippets, configure } from '@easy-editor/materials-dashboard-text'
|
|
31
|
+
|
|
32
|
+
// Register in editor
|
|
33
|
+
editor.registerComponent({
|
|
34
|
+
component: Text,
|
|
35
|
+
...meta,
|
|
36
|
+
})
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### As React Component
|
|
40
|
+
|
|
41
|
+
```tsx
|
|
42
|
+
import Text from '@easy-editor/materials-dashboard-text'
|
|
43
|
+
|
|
44
|
+
function App() {
|
|
45
|
+
return (
|
|
46
|
+
<Text
|
|
47
|
+
text="Hello World"
|
|
48
|
+
fontSize={24}
|
|
49
|
+
color="#333"
|
|
50
|
+
fontWeight="bold"
|
|
51
|
+
textAlign="center"
|
|
52
|
+
/>
|
|
53
|
+
)
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Props
|
|
58
|
+
|
|
59
|
+
| Prop | Type | Default | Description |
|
|
60
|
+
|------|------|---------|-------------|
|
|
61
|
+
| `text` | `string` | `'Text'` | Text content |
|
|
62
|
+
| `fontSize` | `number \| string` | `14` | Font size (px or string with unit) |
|
|
63
|
+
| `color` | `string` | `'#000000'` | Text color (hex, rgb, rgba) |
|
|
64
|
+
| `fontWeight` | `string \| number` | `'normal'` | Font weight (normal, bold, 100-900) |
|
|
65
|
+
| `textAlign` | `'left' \| 'center' \| 'right' \| 'justify'` | `'left'` | Text alignment |
|
|
66
|
+
| `lineHeight` | `number \| string` | `1.5` | Line height |
|
|
67
|
+
| `className` | `string` | `''` | Additional CSS classes |
|
|
68
|
+
| `style` | `CSSProperties` | - | Additional inline styles |
|
|
69
|
+
| `ref` | `Ref<HTMLDivElement>` | - | React ref |
|
|
70
|
+
|
|
71
|
+
## Styling
|
|
72
|
+
|
|
73
|
+
The component uses pure inline styles for all styling, making it:
|
|
74
|
+
- ✅ Independent - no CSS file to import
|
|
75
|
+
- ✅ Predictable - styles always apply
|
|
76
|
+
- ✅ Lightweight - minimal bundle size
|
|
77
|
+
- ✅ Controllable - all styles via props
|
|
78
|
+
|
|
79
|
+
```tsx
|
|
80
|
+
<Text
|
|
81
|
+
text="Styled Text"
|
|
82
|
+
fontSize={20}
|
|
83
|
+
color="#007bff"
|
|
84
|
+
fontWeight="600"
|
|
85
|
+
textAlign="center"
|
|
86
|
+
lineHeight={1.8}
|
|
87
|
+
style={{ padding: '10px', backgroundColor: '#f0f0f0' }}
|
|
88
|
+
/>
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## Build Output
|
|
92
|
+
|
|
93
|
+
```
|
|
94
|
+
dist/
|
|
95
|
+
├── index.js # UMD format (for CDN)
|
|
96
|
+
├── index.esm.js # ESM format (for modern bundlers)
|
|
97
|
+
├── index.cjs # CommonJS format (for Node.js)
|
|
98
|
+
├── index.min.js # Minified UMD
|
|
99
|
+
├── index.d.ts # TypeScript definitions
|
|
100
|
+
└── *.map # Source maps
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
## Development
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
# Install dependencies
|
|
107
|
+
npm install
|
|
108
|
+
|
|
109
|
+
# Build
|
|
110
|
+
npm run build
|
|
111
|
+
|
|
112
|
+
# Lint
|
|
113
|
+
npm run lint
|
|
114
|
+
|
|
115
|
+
# Format
|
|
116
|
+
npm run format
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
## Configuration
|
|
120
|
+
|
|
121
|
+
The component uses a comprehensive configuration system based on EasyEditor's standards:
|
|
122
|
+
|
|
123
|
+
- **Basic Settings**: ID, title, position/size, text content
|
|
124
|
+
- **Font Styling**: Size, color, weight, line height, alignment
|
|
125
|
+
- **Advanced Settings**: Visibility conditions
|
|
126
|
+
|
|
127
|
+
See `src/configure.ts` for the complete configuration structure.
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
+
|
|
7
|
+
const Text = props => {
|
|
8
|
+
const {
|
|
9
|
+
ref,
|
|
10
|
+
text = 'Text',
|
|
11
|
+
fontSize = 14,
|
|
12
|
+
color = '#000000',
|
|
13
|
+
fontWeight = 'normal',
|
|
14
|
+
textAlign = 'left',
|
|
15
|
+
lineHeight = 1.5,
|
|
16
|
+
className = '',
|
|
17
|
+
style: externalStyle,
|
|
18
|
+
...rest
|
|
19
|
+
} = props;
|
|
20
|
+
const internalStyle = {
|
|
21
|
+
width: '100%',
|
|
22
|
+
height: '100%',
|
|
23
|
+
fontSize: typeof fontSize === 'number' ? `${fontSize}px` : fontSize,
|
|
24
|
+
color,
|
|
25
|
+
fontWeight,
|
|
26
|
+
textAlign,
|
|
27
|
+
lineHeight,
|
|
28
|
+
wordBreak: 'break-word',
|
|
29
|
+
whiteSpace: 'pre-wrap'
|
|
30
|
+
};
|
|
31
|
+
const mergedStyle = {
|
|
32
|
+
...internalStyle,
|
|
33
|
+
...externalStyle
|
|
34
|
+
};
|
|
35
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
36
|
+
className: className,
|
|
37
|
+
ref: ref,
|
|
38
|
+
style: mergedStyle,
|
|
39
|
+
...rest,
|
|
40
|
+
children: text
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
const MaterialGroup = {
|
|
45
|
+
BASIC: 'basic'};
|
|
46
|
+
|
|
47
|
+
const configure = {
|
|
48
|
+
props: [{
|
|
49
|
+
type: "group",
|
|
50
|
+
title: "功能",
|
|
51
|
+
setter: "TabSetter",
|
|
52
|
+
items: [{
|
|
53
|
+
type: "group",
|
|
54
|
+
key: "basic",
|
|
55
|
+
title: "基本",
|
|
56
|
+
items: [{
|
|
57
|
+
name: "id",
|
|
58
|
+
title: "ID",
|
|
59
|
+
setter: "NodeIdSetter"
|
|
60
|
+
}, {
|
|
61
|
+
name: "title",
|
|
62
|
+
title: "标题",
|
|
63
|
+
setter: "StringSetter",
|
|
64
|
+
extraProps: {
|
|
65
|
+
getValue(target) {
|
|
66
|
+
return target.getExtraPropValue("title");
|
|
67
|
+
},
|
|
68
|
+
setValue(target, value) {
|
|
69
|
+
target.setExtraPropValue("title", value);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}, {
|
|
73
|
+
type: "group",
|
|
74
|
+
title: "基础属性",
|
|
75
|
+
setter: {
|
|
76
|
+
componentName: "CollapseSetter",
|
|
77
|
+
props: {
|
|
78
|
+
icon: false
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
items: [{
|
|
82
|
+
name: "rect",
|
|
83
|
+
title: "位置尺寸",
|
|
84
|
+
setter: "RectSetter",
|
|
85
|
+
extraProps: {
|
|
86
|
+
getValue(target) {
|
|
87
|
+
return target.getExtraPropValue("$dashboard.rect");
|
|
88
|
+
},
|
|
89
|
+
setValue(target, value) {
|
|
90
|
+
target.setExtraPropValue("$dashboard.rect", value);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}]
|
|
94
|
+
}, {
|
|
95
|
+
name: "text",
|
|
96
|
+
title: "文本内容",
|
|
97
|
+
setter: "TextAreaSetter"
|
|
98
|
+
}, {
|
|
99
|
+
type: "group",
|
|
100
|
+
title: "字体样式",
|
|
101
|
+
setter: {
|
|
102
|
+
componentName: "CollapseSetter",
|
|
103
|
+
props: {
|
|
104
|
+
icon: false
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
items: [{
|
|
108
|
+
name: "fontSize",
|
|
109
|
+
title: "字体大小",
|
|
110
|
+
setter: "NumberSetter",
|
|
111
|
+
extraProps: {
|
|
112
|
+
defaultValue: 14
|
|
113
|
+
}
|
|
114
|
+
}, {
|
|
115
|
+
name: "color",
|
|
116
|
+
title: "文字颜色",
|
|
117
|
+
setter: "ColorSetter",
|
|
118
|
+
extraProps: {
|
|
119
|
+
defaultValue: "#000000"
|
|
120
|
+
}
|
|
121
|
+
}, {
|
|
122
|
+
name: "fontWeight",
|
|
123
|
+
title: "字体粗细",
|
|
124
|
+
setter: {
|
|
125
|
+
componentName: "SelectSetter",
|
|
126
|
+
props: {
|
|
127
|
+
options: [{
|
|
128
|
+
label: "正常",
|
|
129
|
+
value: "normal"
|
|
130
|
+
}, {
|
|
131
|
+
label: "粗体",
|
|
132
|
+
value: "bold"
|
|
133
|
+
}, {
|
|
134
|
+
label: "100",
|
|
135
|
+
value: "100"
|
|
136
|
+
}, {
|
|
137
|
+
label: "200",
|
|
138
|
+
value: "200"
|
|
139
|
+
}, {
|
|
140
|
+
label: "300",
|
|
141
|
+
value: "300"
|
|
142
|
+
}, {
|
|
143
|
+
label: "400",
|
|
144
|
+
value: "400"
|
|
145
|
+
}, {
|
|
146
|
+
label: "500",
|
|
147
|
+
value: "500"
|
|
148
|
+
}, {
|
|
149
|
+
label: "600",
|
|
150
|
+
value: "600"
|
|
151
|
+
}, {
|
|
152
|
+
label: "700",
|
|
153
|
+
value: "700"
|
|
154
|
+
}, {
|
|
155
|
+
label: "800",
|
|
156
|
+
value: "800"
|
|
157
|
+
}, {
|
|
158
|
+
label: "900",
|
|
159
|
+
value: "900"
|
|
160
|
+
}]
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
extraProps: {
|
|
164
|
+
defaultValue: "normal"
|
|
165
|
+
}
|
|
166
|
+
}, {
|
|
167
|
+
name: "lineHeight",
|
|
168
|
+
title: "行高",
|
|
169
|
+
setter: "NumberSetter",
|
|
170
|
+
extraProps: {
|
|
171
|
+
defaultValue: 1.5
|
|
172
|
+
}
|
|
173
|
+
}, {
|
|
174
|
+
name: "textAlign",
|
|
175
|
+
title: "文本对齐",
|
|
176
|
+
setter: {
|
|
177
|
+
componentName: "RadioGroupSetter",
|
|
178
|
+
props: {
|
|
179
|
+
options: [{
|
|
180
|
+
label: "左对齐",
|
|
181
|
+
value: "left"
|
|
182
|
+
}, {
|
|
183
|
+
label: "居中",
|
|
184
|
+
value: "center"
|
|
185
|
+
}, {
|
|
186
|
+
label: "右对齐",
|
|
187
|
+
value: "right"
|
|
188
|
+
}, {
|
|
189
|
+
label: "两端对齐",
|
|
190
|
+
value: "justify"
|
|
191
|
+
}]
|
|
192
|
+
}
|
|
193
|
+
},
|
|
194
|
+
extraProps: {
|
|
195
|
+
defaultValue: "left"
|
|
196
|
+
}
|
|
197
|
+
}]
|
|
198
|
+
}]
|
|
199
|
+
}, {
|
|
200
|
+
type: "group",
|
|
201
|
+
key: "advanced",
|
|
202
|
+
title: "高级",
|
|
203
|
+
items: [{
|
|
204
|
+
type: "group",
|
|
205
|
+
title: "高级设置",
|
|
206
|
+
setter: {
|
|
207
|
+
componentName: "CollapseSetter",
|
|
208
|
+
props: {
|
|
209
|
+
icon: false
|
|
210
|
+
}
|
|
211
|
+
},
|
|
212
|
+
items: [{
|
|
213
|
+
title: "显隐",
|
|
214
|
+
setter: "SwitchSetter",
|
|
215
|
+
extraProps: {
|
|
216
|
+
supportVariable: true,
|
|
217
|
+
getValue(target) {
|
|
218
|
+
return target.getExtraPropValue("condition");
|
|
219
|
+
},
|
|
220
|
+
setValue(target, value) {
|
|
221
|
+
target.setExtraPropValue("condition", value);
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
}]
|
|
225
|
+
}]
|
|
226
|
+
}]
|
|
227
|
+
}],
|
|
228
|
+
component: {},
|
|
229
|
+
supports: {},
|
|
230
|
+
advanced: {
|
|
231
|
+
view: Text
|
|
232
|
+
}
|
|
233
|
+
};
|
|
234
|
+
|
|
235
|
+
const snippets = [{
|
|
236
|
+
title: 'Text',
|
|
237
|
+
screenshot: 'https://img.alicdn.com/imgextra/i3/O1CN01n5wpxc1bi862KuXFz_!!6000000003498-55-tps-50-50.svg',
|
|
238
|
+
schema: {
|
|
239
|
+
componentName: 'Text',
|
|
240
|
+
props: {
|
|
241
|
+
text: 'Text Text Text',
|
|
242
|
+
fontSize: 14,
|
|
243
|
+
color: '#000000',
|
|
244
|
+
textAlign: 'left'
|
|
245
|
+
},
|
|
246
|
+
$dashboard: {
|
|
247
|
+
rect: {
|
|
248
|
+
width: 120,
|
|
249
|
+
height: 40
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
}, {
|
|
254
|
+
title: 'Heading',
|
|
255
|
+
screenshot: 'https://img.alicdn.com/imgextra/i3/O1CN01n5wpxc1bi862KuXFz_!!6000000003498-55-tps-50-50.svg',
|
|
256
|
+
schema: {
|
|
257
|
+
componentName: 'Text',
|
|
258
|
+
props: {
|
|
259
|
+
text: 'Heading',
|
|
260
|
+
fontSize: 24,
|
|
261
|
+
color: '#000000',
|
|
262
|
+
fontWeight: 'bold',
|
|
263
|
+
textAlign: 'center'
|
|
264
|
+
},
|
|
265
|
+
$dashboard: {
|
|
266
|
+
rect: {
|
|
267
|
+
width: 200,
|
|
268
|
+
height: 50
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
}];
|
|
273
|
+
|
|
274
|
+
const meta = {
|
|
275
|
+
componentName: 'Text',
|
|
276
|
+
title: 'Text',
|
|
277
|
+
group: MaterialGroup.BASIC,
|
|
278
|
+
snippets,
|
|
279
|
+
configure
|
|
280
|
+
};
|
|
281
|
+
|
|
282
|
+
exports.Text = Text;
|
|
283
|
+
exports.configure = configure;
|
|
284
|
+
exports.default = Text;
|
|
285
|
+
exports.meta = meta;
|
|
286
|
+
exports.snippets = snippets;
|
|
287
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../src/component.tsx","../../../shared/src/types.ts","../src/configure.ts","../src/snippets.ts","../src/meta.ts"],"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 = '#000000',\n fontWeight = 'normal',\n textAlign = 'left',\n lineHeight = 1.5,\n className = '',\n style: externalStyle,\n ...rest\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} {...rest}>\n {text}\n </div>\n )\n}\n\nexport default Text\n","/**\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","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: \"TextAreaSetter\",\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'\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: 'Text',\n props: {\n text: 'Text Text Text',\n fontSize: 14,\n color: '#000000',\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: 'Text',\n props: {\n text: 'Heading',\n fontSize: 24,\n color: '#000000',\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 configure from './configure'\nimport snippets from './snippets'\n\nconst meta: ComponentMetadata = {\n componentName: 'Text',\n title: 'Text',\n group: MaterialGroup.BASIC,\n snippets,\n configure,\n}\n\nexport default meta\n"],"names":["Text","props","ref","text","fontSize","color","fontWeight","textAlign","lineHeight","className","style","externalStyle","rest","internalStyle","width","height","wordBreak","whiteSpace","mergedStyle","_jsx","children","MaterialGroup","INNER","BASIC","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"],"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,aAAa;IACpB,GAAGC;AACL,GAAC,GAAGX,KAAK;AAET,EAAA,MAAMY,aAA4B,GAAG;AACnCC,IAAAA,KAAK,EAAE,MAAM;AACbC,IAAAA,MAAM,EAAE,MAAM;IACdX,QAAQ,EAAE,OAAOA,QAAQ,KAAK,QAAQ,GAAG,CAAA,EAAGA,QAAQ,CAAA,EAAA,CAAI,GAAGA,QAAQ;IACnEC,KAAK;IACLC,UAAU;IACVC,SAAS;IACTC,UAAU;AACVQ,IAAAA,SAAS,EAAE,YAAY;AACvBC,IAAAA,UAAU,EAAE;GACb;AAED,EAAA,MAAMC,WAAW,GAAG;AAAE,IAAA,GAAGL,aAAa;IAA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QAAQ;AACRxB,EAAAA;AACF;;;;;;;;"}
|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
const Text = props => {
|
|
4
|
+
const {
|
|
5
|
+
ref,
|
|
6
|
+
text = 'Text',
|
|
7
|
+
fontSize = 14,
|
|
8
|
+
color = '#000000',
|
|
9
|
+
fontWeight = 'normal',
|
|
10
|
+
textAlign = 'left',
|
|
11
|
+
lineHeight = 1.5,
|
|
12
|
+
className = '',
|
|
13
|
+
style: externalStyle,
|
|
14
|
+
...rest
|
|
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
|
+
...rest,
|
|
36
|
+
children: text
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const MaterialGroup = {
|
|
41
|
+
BASIC: 'basic'};
|
|
42
|
+
|
|
43
|
+
const configure = {
|
|
44
|
+
props: [{
|
|
45
|
+
type: "group",
|
|
46
|
+
title: "功能",
|
|
47
|
+
setter: "TabSetter",
|
|
48
|
+
items: [{
|
|
49
|
+
type: "group",
|
|
50
|
+
key: "basic",
|
|
51
|
+
title: "基本",
|
|
52
|
+
items: [{
|
|
53
|
+
name: "id",
|
|
54
|
+
title: "ID",
|
|
55
|
+
setter: "NodeIdSetter"
|
|
56
|
+
}, {
|
|
57
|
+
name: "title",
|
|
58
|
+
title: "标题",
|
|
59
|
+
setter: "StringSetter",
|
|
60
|
+
extraProps: {
|
|
61
|
+
getValue(target) {
|
|
62
|
+
return target.getExtraPropValue("title");
|
|
63
|
+
},
|
|
64
|
+
setValue(target, value) {
|
|
65
|
+
target.setExtraPropValue("title", value);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}, {
|
|
69
|
+
type: "group",
|
|
70
|
+
title: "基础属性",
|
|
71
|
+
setter: {
|
|
72
|
+
componentName: "CollapseSetter",
|
|
73
|
+
props: {
|
|
74
|
+
icon: false
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
items: [{
|
|
78
|
+
name: "rect",
|
|
79
|
+
title: "位置尺寸",
|
|
80
|
+
setter: "RectSetter",
|
|
81
|
+
extraProps: {
|
|
82
|
+
getValue(target) {
|
|
83
|
+
return target.getExtraPropValue("$dashboard.rect");
|
|
84
|
+
},
|
|
85
|
+
setValue(target, value) {
|
|
86
|
+
target.setExtraPropValue("$dashboard.rect", value);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}]
|
|
90
|
+
}, {
|
|
91
|
+
name: "text",
|
|
92
|
+
title: "文本内容",
|
|
93
|
+
setter: "TextAreaSetter"
|
|
94
|
+
}, {
|
|
95
|
+
type: "group",
|
|
96
|
+
title: "字体样式",
|
|
97
|
+
setter: {
|
|
98
|
+
componentName: "CollapseSetter",
|
|
99
|
+
props: {
|
|
100
|
+
icon: false
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
items: [{
|
|
104
|
+
name: "fontSize",
|
|
105
|
+
title: "字体大小",
|
|
106
|
+
setter: "NumberSetter",
|
|
107
|
+
extraProps: {
|
|
108
|
+
defaultValue: 14
|
|
109
|
+
}
|
|
110
|
+
}, {
|
|
111
|
+
name: "color",
|
|
112
|
+
title: "文字颜色",
|
|
113
|
+
setter: "ColorSetter",
|
|
114
|
+
extraProps: {
|
|
115
|
+
defaultValue: "#000000"
|
|
116
|
+
}
|
|
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
|
+
}, {
|
|
163
|
+
name: "lineHeight",
|
|
164
|
+
title: "行高",
|
|
165
|
+
setter: "NumberSetter",
|
|
166
|
+
extraProps: {
|
|
167
|
+
defaultValue: 1.5
|
|
168
|
+
}
|
|
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
|
+
}]
|
|
194
|
+
}]
|
|
195
|
+
}, {
|
|
196
|
+
type: "group",
|
|
197
|
+
key: "advanced",
|
|
198
|
+
title: "高级",
|
|
199
|
+
items: [{
|
|
200
|
+
type: "group",
|
|
201
|
+
title: "高级设置",
|
|
202
|
+
setter: {
|
|
203
|
+
componentName: "CollapseSetter",
|
|
204
|
+
props: {
|
|
205
|
+
icon: false
|
|
206
|
+
}
|
|
207
|
+
},
|
|
208
|
+
items: [{
|
|
209
|
+
title: "显隐",
|
|
210
|
+
setter: "SwitchSetter",
|
|
211
|
+
extraProps: {
|
|
212
|
+
supportVariable: true,
|
|
213
|
+
getValue(target) {
|
|
214
|
+
return target.getExtraPropValue("condition");
|
|
215
|
+
},
|
|
216
|
+
setValue(target, value) {
|
|
217
|
+
target.setExtraPropValue("condition", value);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
}]
|
|
221
|
+
}]
|
|
222
|
+
}]
|
|
223
|
+
}],
|
|
224
|
+
component: {},
|
|
225
|
+
supports: {},
|
|
226
|
+
advanced: {
|
|
227
|
+
view: Text
|
|
228
|
+
}
|
|
229
|
+
};
|
|
230
|
+
|
|
231
|
+
const snippets = [{
|
|
232
|
+
title: 'Text',
|
|
233
|
+
screenshot: 'https://img.alicdn.com/imgextra/i3/O1CN01n5wpxc1bi862KuXFz_!!6000000003498-55-tps-50-50.svg',
|
|
234
|
+
schema: {
|
|
235
|
+
componentName: 'Text',
|
|
236
|
+
props: {
|
|
237
|
+
text: 'Text Text Text',
|
|
238
|
+
fontSize: 14,
|
|
239
|
+
color: '#000000',
|
|
240
|
+
textAlign: 'left'
|
|
241
|
+
},
|
|
242
|
+
$dashboard: {
|
|
243
|
+
rect: {
|
|
244
|
+
width: 120,
|
|
245
|
+
height: 40
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
}, {
|
|
250
|
+
title: 'Heading',
|
|
251
|
+
screenshot: 'https://img.alicdn.com/imgextra/i3/O1CN01n5wpxc1bi862KuXFz_!!6000000003498-55-tps-50-50.svg',
|
|
252
|
+
schema: {
|
|
253
|
+
componentName: 'Text',
|
|
254
|
+
props: {
|
|
255
|
+
text: 'Heading',
|
|
256
|
+
fontSize: 24,
|
|
257
|
+
color: '#000000',
|
|
258
|
+
fontWeight: 'bold',
|
|
259
|
+
textAlign: 'center'
|
|
260
|
+
},
|
|
261
|
+
$dashboard: {
|
|
262
|
+
rect: {
|
|
263
|
+
width: 200,
|
|
264
|
+
height: 50
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
}];
|
|
269
|
+
|
|
270
|
+
const meta = {
|
|
271
|
+
componentName: 'Text',
|
|
272
|
+
title: 'Text',
|
|
273
|
+
group: MaterialGroup.BASIC,
|
|
274
|
+
snippets,
|
|
275
|
+
configure
|
|
276
|
+
};
|
|
277
|
+
|
|
278
|
+
export { Text, configure, Text as default, meta, snippets };
|
|
279
|
+
//# sourceMappingURL=index.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../src/component.tsx","../../../shared/src/types.ts","../src/configure.ts","../src/snippets.ts","../src/meta.ts"],"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 = '#000000',\n fontWeight = 'normal',\n textAlign = 'left',\n lineHeight = 1.5,\n className = '',\n style: externalStyle,\n ...rest\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} {...rest}>\n {text}\n </div>\n )\n}\n\nexport default Text\n","/**\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","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: \"TextAreaSetter\",\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'\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: 'Text',\n props: {\n text: 'Text Text Text',\n fontSize: 14,\n color: '#000000',\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: 'Text',\n props: {\n text: 'Heading',\n fontSize: 24,\n color: '#000000',\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 configure from './configure'\nimport snippets from './snippets'\n\nconst meta: ComponentMetadata = {\n componentName: 'Text',\n title: 'Text',\n group: MaterialGroup.BASIC,\n snippets,\n configure,\n}\n\nexport default meta\n"],"names":["Text","props","ref","text","fontSize","color","fontWeight","textAlign","lineHeight","className","style","externalStyle","rest","internalStyle","width","height","wordBreak","whiteSpace","mergedStyle","_jsx","children","MaterialGroup","INNER","BASIC","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"],"mappings":";;AAcA,MAAMA,IAAI,GAAIC,KAAgB,IAAK;EACjC,MAAM;IACJC,GAAG;AACHC,IAAAA,IAAI,GAAG,MAAM;AACbC,IAAAA,QA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AACF;AACF;AACF,CAAC,EACD;AACEW,EAAAA,KAAK,EAAE,SAAS;AAChBuB,EAAAA,UAAU,EAAE,6FAA6F;AACzGC,EAAAA,MAAM,EAAE;AACNZ,IAAAA,aAAa,EAAE,MAAM;AACrBrC,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;AACD4C,IAAAA,UAAU,EAAE;AACVC,MAAAA,IAAI,EAAE;AACJtC,QAAAA,KAAK,EAAE,GAAG;AACVC,QAAAA,MAAM,EAAE;AACV;AACF;AACF;AACF,CAAC;;ACpCH,MAAMsC,IAAuB,GAAG;AAC9Bf,EAAAA,aAAa,EAAE,MAAM;AACrBZ,EAAAA,KAAK,EAAE,MAAM;EACb4B,KAAK,EAAEjC,aAAa,CAACE,KAAK;EAC1ByB,QAAQ;AACRxB,EAAAA;AACF;;;;"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
/* @easy-editor/materials-dashboard-text v0.0.1 */
|
|
2
|
+
(function (global, factory) {
|
|
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.Text = {}, global.jsxRuntime));
|
|
6
|
+
})(this, (function (exports, jsxRuntime) { 'use strict';
|
|
7
|
+
|
|
8
|
+
const Text = props => {
|
|
9
|
+
const {
|
|
10
|
+
ref,
|
|
11
|
+
text = 'Text',
|
|
12
|
+
fontSize = 14,
|
|
13
|
+
color = '#000000',
|
|
14
|
+
fontWeight = 'normal',
|
|
15
|
+
textAlign = 'left',
|
|
16
|
+
lineHeight = 1.5,
|
|
17
|
+
className = '',
|
|
18
|
+
style: externalStyle,
|
|
19
|
+
...rest
|
|
20
|
+
} = props;
|
|
21
|
+
const internalStyle = {
|
|
22
|
+
width: '100%',
|
|
23
|
+
height: '100%',
|
|
24
|
+
fontSize: typeof fontSize === 'number' ? `${fontSize}px` : fontSize,
|
|
25
|
+
color,
|
|
26
|
+
fontWeight,
|
|
27
|
+
textAlign,
|
|
28
|
+
lineHeight,
|
|
29
|
+
wordBreak: 'break-word',
|
|
30
|
+
whiteSpace: 'pre-wrap'
|
|
31
|
+
};
|
|
32
|
+
const mergedStyle = {
|
|
33
|
+
...internalStyle,
|
|
34
|
+
...externalStyle
|
|
35
|
+
};
|
|
36
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
37
|
+
className: className,
|
|
38
|
+
ref: ref,
|
|
39
|
+
style: mergedStyle,
|
|
40
|
+
...rest,
|
|
41
|
+
children: text
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
const MaterialGroup = {
|
|
46
|
+
BASIC: 'basic'};
|
|
47
|
+
|
|
48
|
+
const configure = {
|
|
49
|
+
props: [{
|
|
50
|
+
type: "group",
|
|
51
|
+
title: "功能",
|
|
52
|
+
setter: "TabSetter",
|
|
53
|
+
items: [{
|
|
54
|
+
type: "group",
|
|
55
|
+
key: "basic",
|
|
56
|
+
title: "基本",
|
|
57
|
+
items: [{
|
|
58
|
+
name: "id",
|
|
59
|
+
title: "ID",
|
|
60
|
+
setter: "NodeIdSetter"
|
|
61
|
+
}, {
|
|
62
|
+
name: "title",
|
|
63
|
+
title: "标题",
|
|
64
|
+
setter: "StringSetter",
|
|
65
|
+
extraProps: {
|
|
66
|
+
getValue(target) {
|
|
67
|
+
return target.getExtraPropValue("title");
|
|
68
|
+
},
|
|
69
|
+
setValue(target, value) {
|
|
70
|
+
target.setExtraPropValue("title", value);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}, {
|
|
74
|
+
type: "group",
|
|
75
|
+
title: "基础属性",
|
|
76
|
+
setter: {
|
|
77
|
+
componentName: "CollapseSetter",
|
|
78
|
+
props: {
|
|
79
|
+
icon: false
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
items: [{
|
|
83
|
+
name: "rect",
|
|
84
|
+
title: "位置尺寸",
|
|
85
|
+
setter: "RectSetter",
|
|
86
|
+
extraProps: {
|
|
87
|
+
getValue(target) {
|
|
88
|
+
return target.getExtraPropValue("$dashboard.rect");
|
|
89
|
+
},
|
|
90
|
+
setValue(target, value) {
|
|
91
|
+
target.setExtraPropValue("$dashboard.rect", value);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}]
|
|
95
|
+
}, {
|
|
96
|
+
name: "text",
|
|
97
|
+
title: "文本内容",
|
|
98
|
+
setter: "TextAreaSetter"
|
|
99
|
+
}, {
|
|
100
|
+
type: "group",
|
|
101
|
+
title: "字体样式",
|
|
102
|
+
setter: {
|
|
103
|
+
componentName: "CollapseSetter",
|
|
104
|
+
props: {
|
|
105
|
+
icon: false
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
items: [{
|
|
109
|
+
name: "fontSize",
|
|
110
|
+
title: "字体大小",
|
|
111
|
+
setter: "NumberSetter",
|
|
112
|
+
extraProps: {
|
|
113
|
+
defaultValue: 14
|
|
114
|
+
}
|
|
115
|
+
}, {
|
|
116
|
+
name: "color",
|
|
117
|
+
title: "文字颜色",
|
|
118
|
+
setter: "ColorSetter",
|
|
119
|
+
extraProps: {
|
|
120
|
+
defaultValue: "#000000"
|
|
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
|
+
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
|
+
}, {
|
|
168
|
+
name: "lineHeight",
|
|
169
|
+
title: "行高",
|
|
170
|
+
setter: "NumberSetter",
|
|
171
|
+
extraProps: {
|
|
172
|
+
defaultValue: 1.5
|
|
173
|
+
}
|
|
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
|
+
}]
|
|
199
|
+
}]
|
|
200
|
+
}, {
|
|
201
|
+
type: "group",
|
|
202
|
+
key: "advanced",
|
|
203
|
+
title: "高级",
|
|
204
|
+
items: [{
|
|
205
|
+
type: "group",
|
|
206
|
+
title: "高级设置",
|
|
207
|
+
setter: {
|
|
208
|
+
componentName: "CollapseSetter",
|
|
209
|
+
props: {
|
|
210
|
+
icon: false
|
|
211
|
+
}
|
|
212
|
+
},
|
|
213
|
+
items: [{
|
|
214
|
+
title: "显隐",
|
|
215
|
+
setter: "SwitchSetter",
|
|
216
|
+
extraProps: {
|
|
217
|
+
supportVariable: true,
|
|
218
|
+
getValue(target) {
|
|
219
|
+
return target.getExtraPropValue("condition");
|
|
220
|
+
},
|
|
221
|
+
setValue(target, value) {
|
|
222
|
+
target.setExtraPropValue("condition", value);
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
}]
|
|
226
|
+
}]
|
|
227
|
+
}]
|
|
228
|
+
}],
|
|
229
|
+
component: {},
|
|
230
|
+
supports: {},
|
|
231
|
+
advanced: {
|
|
232
|
+
view: Text
|
|
233
|
+
}
|
|
234
|
+
};
|
|
235
|
+
|
|
236
|
+
const snippets = [{
|
|
237
|
+
title: 'Text',
|
|
238
|
+
screenshot: 'https://img.alicdn.com/imgextra/i3/O1CN01n5wpxc1bi862KuXFz_!!6000000003498-55-tps-50-50.svg',
|
|
239
|
+
schema: {
|
|
240
|
+
componentName: 'Text',
|
|
241
|
+
props: {
|
|
242
|
+
text: 'Text Text Text',
|
|
243
|
+
fontSize: 14,
|
|
244
|
+
color: '#000000',
|
|
245
|
+
textAlign: 'left'
|
|
246
|
+
},
|
|
247
|
+
$dashboard: {
|
|
248
|
+
rect: {
|
|
249
|
+
width: 120,
|
|
250
|
+
height: 40
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
}, {
|
|
255
|
+
title: 'Heading',
|
|
256
|
+
screenshot: 'https://img.alicdn.com/imgextra/i3/O1CN01n5wpxc1bi862KuXFz_!!6000000003498-55-tps-50-50.svg',
|
|
257
|
+
schema: {
|
|
258
|
+
componentName: 'Text',
|
|
259
|
+
props: {
|
|
260
|
+
text: 'Heading',
|
|
261
|
+
fontSize: 24,
|
|
262
|
+
color: '#000000',
|
|
263
|
+
fontWeight: 'bold',
|
|
264
|
+
textAlign: 'center'
|
|
265
|
+
},
|
|
266
|
+
$dashboard: {
|
|
267
|
+
rect: {
|
|
268
|
+
width: 200,
|
|
269
|
+
height: 50
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
}];
|
|
274
|
+
|
|
275
|
+
const meta = {
|
|
276
|
+
componentName: 'Text',
|
|
277
|
+
title: 'Text',
|
|
278
|
+
group: MaterialGroup.BASIC,
|
|
279
|
+
snippets,
|
|
280
|
+
configure
|
|
281
|
+
};
|
|
282
|
+
|
|
283
|
+
exports.Text = Text;
|
|
284
|
+
exports.configure = configure;
|
|
285
|
+
exports.default = Text;
|
|
286
|
+
exports.meta = meta;
|
|
287
|
+
exports.snippets = snippets;
|
|
288
|
+
|
|
289
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
290
|
+
|
|
291
|
+
}));
|
|
292
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/component.tsx","../../../shared/src/types.ts","../src/configure.ts","../src/snippets.ts","../src/meta.ts"],"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 = '#000000',\n fontWeight = 'normal',\n textAlign = 'left',\n lineHeight = 1.5,\n className = '',\n style: externalStyle,\n ...rest\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} {...rest}>\n {text}\n </div>\n )\n}\n\nexport default Text\n","/**\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","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: \"TextAreaSetter\",\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'\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: 'Text',\n props: {\n text: 'Text Text Text',\n fontSize: 14,\n color: '#000000',\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: 'Text',\n props: {\n text: 'Heading',\n fontSize: 24,\n color: '#000000',\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 configure from './configure'\nimport snippets from './snippets'\n\nconst meta: ComponentMetadata = {\n componentName: 'Text',\n title: 'Text',\n group: MaterialGroup.BASIC,\n snippets,\n configure,\n}\n\nexport default meta\n"],"names":["Text","props","ref","text","fontSize","color","fontWeight","textAlign","lineHeight","className","style","externalStyle","rest","internalStyle","width","height","wordBreak","whiteSpace","mergedStyle","_jsx","children","MaterialGroup","INNER","BASIC","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"],"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;E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MAAM;EACrBrC,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;EACD4C,IAAAA,UAAU,EAAE;EACVC,MAAAA,IAAI,EAAE;EACJtC,QAAAA,KAAK,EAAE,GAAG;EACVC,QAAAA,MAAM,EAAE;EACV;EACF;EACF;EACF,CAAC;;ACpCH,QAAMsC,IAAuB,GAAG;EAC9Bf,EAAAA,aAAa,EAAE,MAAM;EACrBZ,EAAAA,KAAK,EAAE,MAAM;IACb4B,KAAK,EAAEjC,aAAa,CAACE,KAAK;IAC1ByB,QAAQ;EACRxB,EAAAA;EACF;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
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).Text={},e.jsxRuntime)}(this,function(e,t){"use strict";const l=e=>{const{ref:l,text:a="Text",fontSize:r=14,color:o="#000000",fontWeight:i="normal",textAlign:n="left",lineHeight:s=1.5,className:p="",style:u,...c}=e,m={...{width:"100%",height:"100%",fontSize:"number"==typeof r?`${r}px`:r,color:o,fontWeight:i,textAlign:n,lineHeight:s,wordBreak:"break-word",whiteSpace:"pre-wrap"},...u};return t.jsx("div",{className:p,ref:l,style:m,...c,children:a})},a={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:"TextAreaSetter"},{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:l}},r=[{title:"Text",screenshot:"https://img.alicdn.com/imgextra/i3/O1CN01n5wpxc1bi862KuXFz_!!6000000003498-55-tps-50-50.svg",schema:{componentName:"Text",props:{text:"Text Text Text",fontSize:14,color:"#000000",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:"Text",props:{text:"Heading",fontSize:24,color:"#000000",fontWeight:"bold",textAlign:"center"},$dashboard:{rect:{width:200,height:50}}}}],o={componentName:"Text",title:"Text",group:"basic",snippets:r,configure:a};e.Text=l,e.configure=a,e.default=l,e.meta=o,e.snippets=r,Object.defineProperty(e,"__esModule",{value:!0})});
|
|
2
|
+
//# sourceMappingURL=index.min.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.min.js","sources":["../src/component.tsx","../src/configure.ts","../src/snippets.ts","../src/meta.ts","../../../shared/src/types.ts"],"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 = '#000000',\n fontWeight = 'normal',\n textAlign = 'left',\n lineHeight = 1.5,\n className = '',\n style: externalStyle,\n ...rest\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} {...rest}>\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: \"TextAreaSetter\",\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'\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: 'Text',\n props: {\n text: 'Text Text Text',\n fontSize: 14,\n color: '#000000',\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: 'Text',\n props: {\n text: 'Heading',\n fontSize: 24,\n color: '#000000',\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 configure from './configure'\nimport snippets from './snippets'\n\nconst meta: ComponentMetadata = {\n componentName: 'Text',\n title: 'Text',\n group: MaterialGroup.BASIC,\n snippets,\n configure,\n}\n\nexport default meta\n","/**\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"],"names":["Text","props","ref","text","fontSize","color","fontWeight","textAlign","lineHeight","className","style","externalStyle","rest","mergedStyle","width","height","wordBreak","whiteSpace","_jsx","children","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"],"mappings":"2SAcA,MAAMA,EAAQC,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,KACJC,GACDX,EAcEY,EAAc,IAZiB,CACnCC,MAAO,OACPC,OAAQ,OACRX,SAA8B,iBAAbA,EAAwB,GAAGA,MAAeA,EAC3DC,QACAC,aACAC,YACAC,aACAQ,UAAW,aACXC,WAAY,eAG6BN,GAE3C,OACEO,EAAAA,IAAA,MAAA,CAAKT,UAAWA,EAAWP,IAAKA,EAAKQ,MAAOG,KAAiBD,EAAIO,SAC9DhB,KCzCDiB,EAAuB,CAC3BnB,MAAO,CACL,CACEoB,KAAM,QACNC,MAAO,KACPC,OAAQ,YACRC,MAAO,CACL,CACEH,KAAM,QACNI,IAAK,QACLH,MAAO,KACPE,MAAO,CACL,CACEE,KAAM,KACNJ,MAAO,KACPC,OAAQ,gBAEV,CACEG,KAAM,QACNJ,MAAO,KACPC,OAAQ,eACRI,WAAY,CACVC,SAASC,GACAA,EAAOC,kBAAkB,SAElCC,QAAAA,CAASF,EAAQG,GACfH,EAAOI,kBAAkB,QAASD,EACpC,IAGJ,CACEX,KAAM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,MAAO,OAAQN,MAAO,cAI9BL,WAAY,CACVS,aAAc,aAO1B,CACEf,KAAM,QACNI,IAAK,WACLH,MAAO,KACPE,MAAO,CACL,CACEH,KAAM,QACNC,MAAO,OACPC,OAAQ,CACNW,cAAe,iBACfjC,MAAO,CACLkC,MAAM,IAGVX,MAAO,CACL,CACEF,MAAO,KACPC,OAAQ,eACRI,WAAY,CACVY,iBAAiB,EACjBX,SAASC,GACAA,EAAOC,kBAAkB,aAElCC,QAAAA,CAASF,EAAQG,GACfH,EAAOI,kBAAkB,YAAaD,EACxC,WAUlBQ,UAAW,CAAA,EACXC,SAAU,CAAA,EACVC,SAAU,CACRC,KAAM3C,ICpLJ4C,EAAsB,CAC1B,CACEtB,MAAO,OACPuB,WAAY,8FACZC,OAAQ,CACNZ,cAAe,OACfjC,MAAO,CACLE,KAAM,iBACNC,SAAU,GACVC,MAAO,UACPE,UAAW,QAEbwC,WAAY,CACVC,KAAM,CACJlC,MAAO,IACPC,OAAQ,OAKhB,CACEO,MAAO,UACPuB,WAAY,8FACZC,OAAQ,CACNZ,cAAe,OACfjC,MAAO,CACLE,KAAM,UACNC,SAAU,GACVC,MAAO,UACPC,WAAY,OACZC,UAAW,UAEbwC,WAAY,CACVC,KAAM,CACJlC,MAAO,IACPC,OAAQ,QChCZkC,EAA0B,CAC9Bf,cAAe,OACfZ,MAAO,OACP4B,MCAO,QDCPN,WACAxB"}
|
package/package.json
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@easy-editor/materials-dashboard-text",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "Text component for EasyEditor dashboard",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.esm.js",
|
|
12
|
+
"require": "./dist/index.cjs"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"publishConfig": {
|
|
16
|
+
"access": "public",
|
|
17
|
+
"jsdelivr": "dist/index.min.js",
|
|
18
|
+
"registry": "https://registry.npmjs.org/"
|
|
19
|
+
},
|
|
20
|
+
"homepage": "https://github.com/Easy-Editor/EasyMaterials",
|
|
21
|
+
"license": "MIT",
|
|
22
|
+
"author": "JinSo <kimjinso@qq.com>",
|
|
23
|
+
"keywords": [
|
|
24
|
+
"@easy-editor",
|
|
25
|
+
"easyeditor",
|
|
26
|
+
"low-code",
|
|
27
|
+
"dashboard",
|
|
28
|
+
"text",
|
|
29
|
+
"component",
|
|
30
|
+
"react"
|
|
31
|
+
],
|
|
32
|
+
"repository": {
|
|
33
|
+
"type": "git",
|
|
34
|
+
"url": "https://github.com/Easy-Editor/EasyMaterials",
|
|
35
|
+
"directory": "packages/dashboard/text"
|
|
36
|
+
},
|
|
37
|
+
"bugs": {
|
|
38
|
+
"url": "https://github.com/Easy-Editor/EasyMaterials/issues"
|
|
39
|
+
},
|
|
40
|
+
"peerDependencies": {
|
|
41
|
+
"@easy-editor/core": "*",
|
|
42
|
+
"react": "^18 || ^19",
|
|
43
|
+
"react-dom": "^18 || ^19",
|
|
44
|
+
"@types/react": "^18 || ^19",
|
|
45
|
+
"@types/react-dom": "^18 || ^19"
|
|
46
|
+
},
|
|
47
|
+
"dependencies": {
|
|
48
|
+
"@easy-editor/materials-shared": "0.0.0"
|
|
49
|
+
},
|
|
50
|
+
"scripts": {
|
|
51
|
+
"format": "biome format --write .",
|
|
52
|
+
"lint": "biome check .",
|
|
53
|
+
"build": "npm-run-all -nl build:*",
|
|
54
|
+
"build:clean": "rimraf dist/",
|
|
55
|
+
"build:js": "rollup -c",
|
|
56
|
+
"types": "npm-run-all -nl types:*",
|
|
57
|
+
"types:src": "tsc --project tsconfig.build.json",
|
|
58
|
+
"test-types": "tsc --project tsconfig.test.json"
|
|
59
|
+
},
|
|
60
|
+
"module": "dist/index.esm.js",
|
|
61
|
+
"unpkg": "dist/index.min.js"
|
|
62
|
+
}
|