@next-core/build-next-bricks 1.23.5 → 1.23.6
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/package.json +2 -2
- package/src/makeBrickManifest.js +31 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@next-core/build-next-bricks",
|
|
3
|
-
"version": "1.23.
|
|
3
|
+
"version": "1.23.6",
|
|
4
4
|
"description": "Build next bricks",
|
|
5
5
|
"homepage": "https://github.com/easyops-cn/next-core/tree/v3/packages/build-next-bricks",
|
|
6
6
|
"license": "GPL-3.0",
|
|
@@ -57,5 +57,5 @@
|
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"@next-core/brick-manifest": "^0.7.1"
|
|
59
59
|
},
|
|
60
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "4d25218a4a78ac613872e14feeb01304f9653916"
|
|
61
61
|
}
|
package/src/makeBrickManifest.js
CHANGED
|
@@ -105,6 +105,20 @@ export default function makeBrickManifest(name, alias, nodePath, source) {
|
|
|
105
105
|
}
|
|
106
106
|
break;
|
|
107
107
|
}
|
|
108
|
+
// 主动声明原生事件,例如 eo-button 构件的 click 事件
|
|
109
|
+
case "event": {
|
|
110
|
+
const match = tag.description.match(/^([-\w]+)\s+-\s+(.*)$/);
|
|
111
|
+
if (!match) {
|
|
112
|
+
throw new Error(
|
|
113
|
+
`Doc comment for event is invalid: '${tag.description}'`
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
manifest.events.push({
|
|
117
|
+
name: match[1],
|
|
118
|
+
description: match[2],
|
|
119
|
+
});
|
|
120
|
+
break;
|
|
121
|
+
}
|
|
108
122
|
case "insider": {
|
|
109
123
|
manifest.insider = true;
|
|
110
124
|
}
|
|
@@ -118,6 +132,23 @@ export default function makeBrickManifest(name, alias, nodePath, source) {
|
|
|
118
132
|
source
|
|
119
133
|
);
|
|
120
134
|
|
|
135
|
+
// 如果有默认插槽,代表有默认属性 textContent
|
|
136
|
+
const hasDefaultSlot = manifest.slots.some((slot) => !slot.name);
|
|
137
|
+
if (hasDefaultSlot) {
|
|
138
|
+
manifest.properties.push({
|
|
139
|
+
name: "textContent",
|
|
140
|
+
type: "string",
|
|
141
|
+
description: "文本内容",
|
|
142
|
+
});
|
|
143
|
+
manifest.types.properties.push({
|
|
144
|
+
name: "textContent",
|
|
145
|
+
annotation: {
|
|
146
|
+
type: "keyword",
|
|
147
|
+
value: "string",
|
|
148
|
+
},
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
|
|
121
152
|
return manifest;
|
|
122
153
|
}
|
|
123
154
|
|