@fugood/bricks-ctor 2.24.0-beta.40
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/compile/action-name-map.ts +988 -0
- package/compile/index.ts +1245 -0
- package/compile/util.ts +358 -0
- package/index.ts +6 -0
- package/package.json +28 -0
- package/skills/bricks-design/LICENSE.txt +180 -0
- package/skills/bricks-design/SKILL.md +66 -0
- package/skills/bricks-project/SKILL.md +32 -0
- package/skills/bricks-project/rules/animation.md +159 -0
- package/skills/bricks-project/rules/architecture-patterns.md +69 -0
- package/skills/bricks-project/rules/automations.md +221 -0
- package/skills/bricks-project/rules/buttress.md +156 -0
- package/skills/bricks-project/rules/data-calculation.md +208 -0
- package/skills/bricks-project/rules/local-sync.md +129 -0
- package/skills/bricks-project/rules/media-flow.md +158 -0
- package/skills/bricks-project/rules/remote-data-bank.md +196 -0
- package/skills/bricks-project/rules/standby-transition.md +124 -0
- package/skills/rive-marketplace/SKILL.md +99 -0
- package/tools/deploy.ts +151 -0
- package/tools/icons/.gitattributes +1 -0
- package/tools/icons/fa6pro-glyphmap.json +4686 -0
- package/tools/icons/fa6pro-meta.json +3671 -0
- package/tools/mcp-server.ts +28 -0
- package/tools/mcp-tools/compile.ts +91 -0
- package/tools/mcp-tools/huggingface.ts +762 -0
- package/tools/mcp-tools/icons.ts +70 -0
- package/tools/mcp-tools/lottie.ts +102 -0
- package/tools/mcp-tools/media.ts +110 -0
- package/tools/postinstall.ts +229 -0
- package/tools/preview-main.mjs +293 -0
- package/tools/preview.ts +143 -0
- package/tools/pull.ts +116 -0
- package/tsconfig.json +16 -0
- package/types/animation.ts +100 -0
- package/types/automation.ts +235 -0
- package/types/brick-base.ts +80 -0
- package/types/bricks/Camera.ts +246 -0
- package/types/bricks/Chart.ts +372 -0
- package/types/bricks/GenerativeMedia.ts +276 -0
- package/types/bricks/Icon.ts +98 -0
- package/types/bricks/Image.ts +114 -0
- package/types/bricks/Items.ts +476 -0
- package/types/bricks/Lottie.ts +168 -0
- package/types/bricks/Maps.ts +262 -0
- package/types/bricks/QrCode.ts +117 -0
- package/types/bricks/Rect.ts +150 -0
- package/types/bricks/RichText.ts +128 -0
- package/types/bricks/Rive.ts +220 -0
- package/types/bricks/Slideshow.ts +201 -0
- package/types/bricks/Svg.ts +99 -0
- package/types/bricks/Text.ts +148 -0
- package/types/bricks/TextInput.ts +242 -0
- package/types/bricks/Video.ts +175 -0
- package/types/bricks/VideoStreaming.ts +112 -0
- package/types/bricks/WebRtcStream.ts +65 -0
- package/types/bricks/WebView.ts +168 -0
- package/types/bricks/index.ts +21 -0
- package/types/canvas.ts +82 -0
- package/types/common.ts +144 -0
- package/types/data-calc-command.ts +7005 -0
- package/types/data-calc-script.ts +21 -0
- package/types/data-calc.ts +11 -0
- package/types/data.ts +95 -0
- package/types/generators/AlarmClock.ts +110 -0
- package/types/generators/Assistant.ts +621 -0
- package/types/generators/BleCentral.ts +247 -0
- package/types/generators/BlePeripheral.ts +208 -0
- package/types/generators/CanvasMap.ts +74 -0
- package/types/generators/CastlesPay.ts +87 -0
- package/types/generators/DataBank.ts +160 -0
- package/types/generators/File.ts +432 -0
- package/types/generators/GraphQl.ts +132 -0
- package/types/generators/Http.ts +222 -0
- package/types/generators/HttpServer.ts +176 -0
- package/types/generators/Information.ts +103 -0
- package/types/generators/Intent.ts +168 -0
- package/types/generators/Iterator.ts +108 -0
- package/types/generators/Keyboard.ts +105 -0
- package/types/generators/LlmAnthropicCompat.ts +212 -0
- package/types/generators/LlmAppleBuiltin.ts +159 -0
- package/types/generators/LlmGgml.ts +861 -0
- package/types/generators/LlmMediaTekNeuroPilot.ts +235 -0
- package/types/generators/LlmMlx.ts +227 -0
- package/types/generators/LlmOnnx.ts +213 -0
- package/types/generators/LlmOpenAiCompat.ts +244 -0
- package/types/generators/LlmQualcommAiEngine.ts +247 -0
- package/types/generators/Mcp.ts +637 -0
- package/types/generators/McpServer.ts +289 -0
- package/types/generators/MediaFlow.ts +170 -0
- package/types/generators/MqttBroker.ts +141 -0
- package/types/generators/MqttClient.ts +141 -0
- package/types/generators/Question.ts +408 -0
- package/types/generators/RealtimeTranscription.ts +279 -0
- package/types/generators/RerankerGgml.ts +191 -0
- package/types/generators/SerialPort.ts +151 -0
- package/types/generators/SoundPlayer.ts +94 -0
- package/types/generators/SoundRecorder.ts +130 -0
- package/types/generators/SpeechToTextGgml.ts +415 -0
- package/types/generators/SpeechToTextOnnx.ts +236 -0
- package/types/generators/SpeechToTextPlatform.ts +85 -0
- package/types/generators/SqLite.ts +159 -0
- package/types/generators/Step.ts +107 -0
- package/types/generators/SttAppleBuiltin.ts +130 -0
- package/types/generators/Tcp.ts +126 -0
- package/types/generators/TcpServer.ts +147 -0
- package/types/generators/TextToSpeechAppleBuiltin.ts +127 -0
- package/types/generators/TextToSpeechGgml.ts +221 -0
- package/types/generators/TextToSpeechOnnx.ts +178 -0
- package/types/generators/TextToSpeechOpenAiLike.ts +121 -0
- package/types/generators/ThermalPrinter.ts +191 -0
- package/types/generators/Tick.ts +83 -0
- package/types/generators/Udp.ts +120 -0
- package/types/generators/VadGgml.ts +250 -0
- package/types/generators/VadOnnx.ts +231 -0
- package/types/generators/VadTraditional.ts +138 -0
- package/types/generators/VectorStore.ts +257 -0
- package/types/generators/Watchdog.ts +107 -0
- package/types/generators/WebCrawler.ts +103 -0
- package/types/generators/WebRtc.ts +181 -0
- package/types/generators/WebSocket.ts +148 -0
- package/types/generators/index.ts +57 -0
- package/types/index.ts +13 -0
- package/types/subspace.ts +59 -0
- package/types/switch.ts +51 -0
- package/types/system.ts +707 -0
- package/utils/calc.ts +126 -0
- package/utils/data.ts +497 -0
- package/utils/event-props.ts +836 -0
- package/utils/id.ts +80 -0
|
@@ -0,0 +1,372 @@
|
|
|
1
|
+
/* Auto generated by build script
|
|
2
|
+
*
|
|
3
|
+
* Chart brick, based on [Apache ECharts](https://echarts.apache.org/en/index.html).
|
|
4
|
+
*/
|
|
5
|
+
import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
|
|
6
|
+
import type { Data, DataLink } from '../data'
|
|
7
|
+
import type { Animation, AnimationBasicEvents } from '../animation'
|
|
8
|
+
import type {
|
|
9
|
+
Brick,
|
|
10
|
+
EventAction,
|
|
11
|
+
EventActionForItem,
|
|
12
|
+
ActionWithDataParams,
|
|
13
|
+
ActionWithParams,
|
|
14
|
+
Action,
|
|
15
|
+
EventProperty,
|
|
16
|
+
} from '../common'
|
|
17
|
+
import type { BrickBasicProperty, BrickBasicEvents, BrickBasicEventsForItem } from '../brick-base'
|
|
18
|
+
import type { TemplateEventPropsMap } from '../../utils/event-props'
|
|
19
|
+
|
|
20
|
+
/* Data highlight */
|
|
21
|
+
export type BrickChartActionDataHighlight = ActionWithParams & {
|
|
22
|
+
__actionName: 'BRICK_CHART_DATA_HIGHLIGHT'
|
|
23
|
+
params?: Array<
|
|
24
|
+
| {
|
|
25
|
+
input: 'seriesName'
|
|
26
|
+
value?: string | DataLink | EventProperty
|
|
27
|
+
mapping?: string
|
|
28
|
+
}
|
|
29
|
+
| {
|
|
30
|
+
input: 'seriesId'
|
|
31
|
+
value?: string | DataLink | EventProperty
|
|
32
|
+
mapping?: string
|
|
33
|
+
}
|
|
34
|
+
| {
|
|
35
|
+
input: 'seriesIndex'
|
|
36
|
+
value?: number | DataLink | EventProperty
|
|
37
|
+
mapping?: string
|
|
38
|
+
}
|
|
39
|
+
| {
|
|
40
|
+
input: 'dataIndex'
|
|
41
|
+
value?: number | DataLink | EventProperty
|
|
42
|
+
mapping?: string
|
|
43
|
+
}
|
|
44
|
+
| {
|
|
45
|
+
input: 'name'
|
|
46
|
+
value?: string | DataLink | EventProperty
|
|
47
|
+
mapping?: string
|
|
48
|
+
}
|
|
49
|
+
>
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/* Data downplay */
|
|
53
|
+
export type BrickChartActionDataDownplay = ActionWithParams & {
|
|
54
|
+
__actionName: 'BRICK_CHART_DATA_DOWNPLAY'
|
|
55
|
+
params?: Array<
|
|
56
|
+
| {
|
|
57
|
+
input: 'seriesName'
|
|
58
|
+
value?: string | DataLink | EventProperty
|
|
59
|
+
mapping?: string
|
|
60
|
+
}
|
|
61
|
+
| {
|
|
62
|
+
input: 'seriesId'
|
|
63
|
+
value?: string | DataLink | EventProperty
|
|
64
|
+
mapping?: string
|
|
65
|
+
}
|
|
66
|
+
| {
|
|
67
|
+
input: 'seriesIndex'
|
|
68
|
+
value?: number | DataLink | EventProperty
|
|
69
|
+
mapping?: string
|
|
70
|
+
}
|
|
71
|
+
| {
|
|
72
|
+
input: 'dataIndex'
|
|
73
|
+
value?: number | DataLink | EventProperty
|
|
74
|
+
mapping?: string
|
|
75
|
+
}
|
|
76
|
+
| {
|
|
77
|
+
input: 'name'
|
|
78
|
+
value?: string | DataLink | EventProperty
|
|
79
|
+
mapping?: string
|
|
80
|
+
}
|
|
81
|
+
>
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/* Data select */
|
|
85
|
+
export type BrickChartActionDataSelect = ActionWithParams & {
|
|
86
|
+
__actionName: 'BRICK_CHART_DATA_SELECT'
|
|
87
|
+
params?: Array<
|
|
88
|
+
| {
|
|
89
|
+
input: 'seriesName'
|
|
90
|
+
value?: string | DataLink | EventProperty
|
|
91
|
+
mapping?: string
|
|
92
|
+
}
|
|
93
|
+
| {
|
|
94
|
+
input: 'seriesId'
|
|
95
|
+
value?: string | DataLink | EventProperty
|
|
96
|
+
mapping?: string
|
|
97
|
+
}
|
|
98
|
+
| {
|
|
99
|
+
input: 'seriesIndex'
|
|
100
|
+
value?: number | DataLink | EventProperty
|
|
101
|
+
mapping?: string
|
|
102
|
+
}
|
|
103
|
+
| {
|
|
104
|
+
input: 'dataIndex'
|
|
105
|
+
value?: number | DataLink | EventProperty
|
|
106
|
+
mapping?: string
|
|
107
|
+
}
|
|
108
|
+
| {
|
|
109
|
+
input: 'name'
|
|
110
|
+
value?: string | DataLink | EventProperty
|
|
111
|
+
mapping?: string
|
|
112
|
+
}
|
|
113
|
+
>
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/* Data unselect */
|
|
117
|
+
export type BrickChartActionDataUnselect = ActionWithParams & {
|
|
118
|
+
__actionName: 'BRICK_CHART_DATA_UNSELECT'
|
|
119
|
+
params?: Array<
|
|
120
|
+
| {
|
|
121
|
+
input: 'seriesName'
|
|
122
|
+
value?: string | DataLink | EventProperty
|
|
123
|
+
mapping?: string
|
|
124
|
+
}
|
|
125
|
+
| {
|
|
126
|
+
input: 'seriesId'
|
|
127
|
+
value?: string | DataLink | EventProperty
|
|
128
|
+
mapping?: string
|
|
129
|
+
}
|
|
130
|
+
| {
|
|
131
|
+
input: 'seriesIndex'
|
|
132
|
+
value?: number | DataLink | EventProperty
|
|
133
|
+
mapping?: string
|
|
134
|
+
}
|
|
135
|
+
| {
|
|
136
|
+
input: 'dataIndex'
|
|
137
|
+
value?: number | DataLink | EventProperty
|
|
138
|
+
mapping?: string
|
|
139
|
+
}
|
|
140
|
+
| {
|
|
141
|
+
input: 'name'
|
|
142
|
+
value?: string | DataLink | EventProperty
|
|
143
|
+
mapping?: string
|
|
144
|
+
}
|
|
145
|
+
>
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/* Data toggle select */
|
|
149
|
+
export type BrickChartActionDataToggleSelect = ActionWithParams & {
|
|
150
|
+
__actionName: 'BRICK_CHART_DATA_TOGGLE_SELECT'
|
|
151
|
+
params?: Array<
|
|
152
|
+
| {
|
|
153
|
+
input: 'seriesName'
|
|
154
|
+
value?: string | DataLink | EventProperty
|
|
155
|
+
mapping?: string
|
|
156
|
+
}
|
|
157
|
+
| {
|
|
158
|
+
input: 'seriesId'
|
|
159
|
+
value?: string | DataLink | EventProperty
|
|
160
|
+
mapping?: string
|
|
161
|
+
}
|
|
162
|
+
| {
|
|
163
|
+
input: 'seriesIndex'
|
|
164
|
+
value?: number | DataLink | EventProperty
|
|
165
|
+
mapping?: string
|
|
166
|
+
}
|
|
167
|
+
| {
|
|
168
|
+
input: 'dataIndex'
|
|
169
|
+
value?: number | DataLink | EventProperty
|
|
170
|
+
mapping?: string
|
|
171
|
+
}
|
|
172
|
+
| {
|
|
173
|
+
input: 'name'
|
|
174
|
+
value?: string | DataLink | EventProperty
|
|
175
|
+
mapping?: string
|
|
176
|
+
}
|
|
177
|
+
>
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/* Legend select */
|
|
181
|
+
export type BrickChartActionLegendSelect = ActionWithParams & {
|
|
182
|
+
__actionName: 'BRICK_CHART_LEGEND_SELECT'
|
|
183
|
+
params?: Array<{
|
|
184
|
+
input: 'name'
|
|
185
|
+
value?: string | DataLink | EventProperty
|
|
186
|
+
mapping?: string
|
|
187
|
+
}>
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/* Legend unselect */
|
|
191
|
+
export type BrickChartActionLegendUnselect = ActionWithParams & {
|
|
192
|
+
__actionName: 'BRICK_CHART_LEGEND_UNSELECT'
|
|
193
|
+
params?: Array<{
|
|
194
|
+
input: 'name'
|
|
195
|
+
value?: string | DataLink | EventProperty
|
|
196
|
+
mapping?: string
|
|
197
|
+
}>
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/* Legend toggle select */
|
|
201
|
+
export type BrickChartActionLegendToggleSelect = Action & {
|
|
202
|
+
__actionName: 'BRICK_CHART_LEGEND_TOGGLE_SELECT'
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
/* Legend all select */
|
|
206
|
+
export type BrickChartActionLegendAllSelect = Action & {
|
|
207
|
+
__actionName: 'BRICK_CHART_LEGEND_ALL_SELECT'
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
/* Legend inverse select */
|
|
211
|
+
export type BrickChartActionLegendInverseSelect = Action & {
|
|
212
|
+
__actionName: 'BRICK_CHART_LEGEND_INVERSE_SELECT'
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/* Tooltip show */
|
|
216
|
+
export type BrickChartActionTooltipShow = ActionWithParams & {
|
|
217
|
+
__actionName: 'BRICK_CHART_TOOLTIP_SHOW'
|
|
218
|
+
params?: Array<
|
|
219
|
+
| {
|
|
220
|
+
input: 'seriesIndex'
|
|
221
|
+
value?: number | DataLink | EventProperty
|
|
222
|
+
mapping?: string
|
|
223
|
+
}
|
|
224
|
+
| {
|
|
225
|
+
input: 'dataIndex'
|
|
226
|
+
value?: number | DataLink | EventProperty
|
|
227
|
+
mapping?: string
|
|
228
|
+
}
|
|
229
|
+
| {
|
|
230
|
+
input: 'name'
|
|
231
|
+
value?: string | DataLink | EventProperty
|
|
232
|
+
mapping?: string
|
|
233
|
+
}
|
|
234
|
+
>
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
/* Tooltip hide */
|
|
238
|
+
export type BrickChartActionTooltipHide = ActionWithParams & {
|
|
239
|
+
__actionName: 'BRICK_CHART_TOOLTIP_HIDE'
|
|
240
|
+
params?: Array<
|
|
241
|
+
| {
|
|
242
|
+
input: 'seriesIndex'
|
|
243
|
+
value?: number | DataLink | EventProperty
|
|
244
|
+
mapping?: string
|
|
245
|
+
}
|
|
246
|
+
| {
|
|
247
|
+
input: 'dataIndex'
|
|
248
|
+
value?: number | DataLink | EventProperty
|
|
249
|
+
mapping?: string
|
|
250
|
+
}
|
|
251
|
+
| {
|
|
252
|
+
input: 'name'
|
|
253
|
+
value?: string | DataLink | EventProperty
|
|
254
|
+
mapping?: string
|
|
255
|
+
}
|
|
256
|
+
>
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
interface BrickChartDef {
|
|
260
|
+
/*
|
|
261
|
+
Default property:
|
|
262
|
+
{
|
|
263
|
+
"renderMode": "svg",
|
|
264
|
+
"legendShow": true,
|
|
265
|
+
"xAxisShow": true,
|
|
266
|
+
"xAxisType": "category",
|
|
267
|
+
"yAxisShow": true,
|
|
268
|
+
"yAxisType": "value",
|
|
269
|
+
"tooltipShow": true,
|
|
270
|
+
"tooltipTrigger": "item"
|
|
271
|
+
}
|
|
272
|
+
*/
|
|
273
|
+
property?: BrickBasicProperty & {
|
|
274
|
+
/* The render mode */
|
|
275
|
+
renderMode?: 'svg' | 'skia' | DataLink
|
|
276
|
+
/* Theme. You can use https://echarts.apache.org/en/theme-builder.html to generate theme */
|
|
277
|
+
themeEntry?: {} | DataLink
|
|
278
|
+
/* Theme of URL (.json) */
|
|
279
|
+
themeUrl?: string | DataLink
|
|
280
|
+
/* Theme of MD5 */
|
|
281
|
+
themeMd5?: string | DataLink
|
|
282
|
+
/* Title text */
|
|
283
|
+
titleText?: string | DataLink
|
|
284
|
+
/* Subtitle text */
|
|
285
|
+
titleSubtext?: string | DataLink
|
|
286
|
+
/* Full configuration of title, see https://echarts.apache.org/en/option.html#title */
|
|
287
|
+
titleOptions?: {} | DataLink
|
|
288
|
+
/* Show legend */
|
|
289
|
+
legendShow?: boolean | DataLink
|
|
290
|
+
/* Legend data */
|
|
291
|
+
legendData?: Array<string | DataLink> | DataLink
|
|
292
|
+
/* Full configuration of legend, see https://echarts.apache.org/en/option.html#legend */
|
|
293
|
+
legendOptions?: {} | DataLink
|
|
294
|
+
/* Show grid */
|
|
295
|
+
gridShow?: boolean | DataLink
|
|
296
|
+
/* Full configuration of grid, see https://echarts.apache.org/en/option.html#grid */
|
|
297
|
+
gridOptions?: {} | DataLink
|
|
298
|
+
/* Dataset (see https://echarts.apache.org/en/option.html#dataset) */
|
|
299
|
+
dataset?: Array<any> | DataLink
|
|
300
|
+
/* Show x axis */
|
|
301
|
+
xAxisShow?: boolean | DataLink
|
|
302
|
+
/* Type of x axis */
|
|
303
|
+
xAxisType?: 'category' | 'value' | 'time' | 'log' | DataLink
|
|
304
|
+
/* Name of x axis */
|
|
305
|
+
xAxisName?: string | DataLink
|
|
306
|
+
/* Data of x axis */
|
|
307
|
+
xAxisData?: Array<string | DataLink> | DataLink
|
|
308
|
+
/* Full configuration of x axis, see https://echarts.apache.org/en/option.html#xAxis */
|
|
309
|
+
xAxisOptions?: {} | DataLink
|
|
310
|
+
/* Show y axis */
|
|
311
|
+
yAxisShow?: boolean | DataLink
|
|
312
|
+
/* Type of x axis */
|
|
313
|
+
yAxisType?: 'value' | 'category' | 'time' | 'log' | DataLink
|
|
314
|
+
/* Name of x axis */
|
|
315
|
+
yAxisName?: string | DataLink
|
|
316
|
+
/* Data of y axis */
|
|
317
|
+
yAxisData?: Array<string | DataLink> | DataLink
|
|
318
|
+
/* Full configuration of y axis, see https://echarts.apache.org/en/option.html#yAxis */
|
|
319
|
+
yAxisOptions?: {} | DataLink
|
|
320
|
+
/* Show axis pointer */
|
|
321
|
+
axisPointerShow?: boolean | DataLink
|
|
322
|
+
/* Full configuration of axis pointer, see https://echarts.apache.org/en/option.html#axisPointer */
|
|
323
|
+
axisPointerOptions?: {} | DataLink
|
|
324
|
+
/* data series (see https://echarts.apache.org/en/option.html#series-line) */
|
|
325
|
+
series?: Array<any> | DataLink
|
|
326
|
+
/* Show tooltip */
|
|
327
|
+
tooltipShow?: boolean | DataLink
|
|
328
|
+
/* Trigger type of tooltip */
|
|
329
|
+
tooltipTrigger?: 'item' | 'axis' | 'none' | DataLink
|
|
330
|
+
/* data series (see https://echarts.apache.org/en/option.html#tooltip) */
|
|
331
|
+
tooltipOptions?: {} | DataLink
|
|
332
|
+
/* Full configuration of options, see https://echarts.apache.org/en/option.html */
|
|
333
|
+
options?: {} | DataLink
|
|
334
|
+
}
|
|
335
|
+
events?: BrickBasicEvents & {
|
|
336
|
+
/* Event of chart render */
|
|
337
|
+
onRender?: Array<EventAction>
|
|
338
|
+
/* Event of data point on press */
|
|
339
|
+
onPress?: Array<EventAction<string & keyof TemplateEventPropsMap['Chart']['onPress']>>
|
|
340
|
+
/* Event of legend select changed */
|
|
341
|
+
onLegendSelectChanged?: Array<
|
|
342
|
+
EventAction<string & keyof TemplateEventPropsMap['Chart']['onLegendSelectChanged']>
|
|
343
|
+
>
|
|
344
|
+
}
|
|
345
|
+
animation?: AnimationBasicEvents & {
|
|
346
|
+
onRender?: Animation
|
|
347
|
+
onPress?: Animation
|
|
348
|
+
onLegendSelectChanged?: Animation
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
/* Chart brick, based on [Apache ECharts](https://echarts.apache.org/en/index.html). */
|
|
353
|
+
export type BrickChart = Brick &
|
|
354
|
+
BrickChartDef & {
|
|
355
|
+
templateKey: 'BRICK_CHART'
|
|
356
|
+
switches?: Array<
|
|
357
|
+
SwitchDef &
|
|
358
|
+
BrickChartDef & {
|
|
359
|
+
conds?: Array<{
|
|
360
|
+
method: '==' | '!=' | '>' | '<' | '>=' | '<='
|
|
361
|
+
cond:
|
|
362
|
+
| SwitchCondInnerStateCurrentCanvas
|
|
363
|
+
| SwitchCondData
|
|
364
|
+
| {
|
|
365
|
+
__typename: 'SwitchCondInnerStateOutlet'
|
|
366
|
+
outlet: ''
|
|
367
|
+
value: any
|
|
368
|
+
}
|
|
369
|
+
}>
|
|
370
|
+
}
|
|
371
|
+
>
|
|
372
|
+
}
|
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
/* Auto generated by build script
|
|
2
|
+
*
|
|
3
|
+
* Generative Media brick - Generate images and videos using AI
|
|
4
|
+
*/
|
|
5
|
+
import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
|
|
6
|
+
import type { Data, DataLink } from '../data'
|
|
7
|
+
import type { Animation, AnimationBasicEvents } from '../animation'
|
|
8
|
+
import type {
|
|
9
|
+
Brick,
|
|
10
|
+
EventAction,
|
|
11
|
+
EventActionForItem,
|
|
12
|
+
ActionWithDataParams,
|
|
13
|
+
ActionWithParams,
|
|
14
|
+
Action,
|
|
15
|
+
EventProperty,
|
|
16
|
+
} from '../common'
|
|
17
|
+
import type { BrickBasicProperty, BrickBasicEvents, BrickBasicEventsForItem } from '../brick-base'
|
|
18
|
+
import type { TemplateEventPropsMap } from '../../utils/event-props'
|
|
19
|
+
|
|
20
|
+
interface GenerativeMediaDef {
|
|
21
|
+
/*
|
|
22
|
+
Default property:
|
|
23
|
+
{
|
|
24
|
+
"enableCache": true,
|
|
25
|
+
"type": "image",
|
|
26
|
+
"resizeMode": "cover",
|
|
27
|
+
"provider": "openai",
|
|
28
|
+
"freepikClassicImageSize": "square_1_1",
|
|
29
|
+
"geminiVeoModel": "veo-3.1-generate-preview",
|
|
30
|
+
"geminiVeoResolution": "720p",
|
|
31
|
+
"geminiVeoDuration": 8
|
|
32
|
+
}
|
|
33
|
+
*/
|
|
34
|
+
property?: BrickBasicProperty & {
|
|
35
|
+
/* The text prompt to generate media from */
|
|
36
|
+
prompt?: string | DataLink
|
|
37
|
+
/* Enable cache */
|
|
38
|
+
enableCache?: boolean | DataLink
|
|
39
|
+
/* The type of media to generate (image or video) */
|
|
40
|
+
type?: 'image' | 'video' | DataLink
|
|
41
|
+
/* Default image to display when no generated image is available */
|
|
42
|
+
defaultImage?: string | DataLink
|
|
43
|
+
/* The hash of the default image */
|
|
44
|
+
defaultImageHash?: string | DataLink
|
|
45
|
+
/* The type of the default image hash */
|
|
46
|
+
defaultImageHashType?: 'md5' | 'sha1' | 'sha256' | DataLink
|
|
47
|
+
/* The Lottie animation to show while generating */
|
|
48
|
+
loadingAnimation?: string | DataLink
|
|
49
|
+
/* The Lottie animation to show when an error occurs */
|
|
50
|
+
errorAnimation?: string | DataLink
|
|
51
|
+
/* The resize mode for the generated media */
|
|
52
|
+
resizeMode?: 'contain' | 'cover' | 'stretch' | 'center' | 'repeat' | DataLink
|
|
53
|
+
/* The API key for the generative media service */
|
|
54
|
+
apiKey?: string | DataLink
|
|
55
|
+
/* The AI provider to use for generation (openai, freepik-classic, deepai, or gemini) */
|
|
56
|
+
provider?: 'openai' | 'freepik-classic' | 'deepai' | 'gemini' | DataLink
|
|
57
|
+
/* OpenAI image size (256x256, 512x512, 1024x1024, etc) */
|
|
58
|
+
openaiSize?: '1024x1024' | '1024x1792' | '1792x1024' | DataLink
|
|
59
|
+
/* OpenAI image style (vivid or natural) */
|
|
60
|
+
openaiStyle?: 'vivid' | 'natural' | DataLink
|
|
61
|
+
/* OpenAI image quality (standard or hd) */
|
|
62
|
+
openaiQuality?: 'standard' | 'hd' | DataLink
|
|
63
|
+
/* Freepik image size */
|
|
64
|
+
freepikClassicImageSize?:
|
|
65
|
+
| 'square_1_1'
|
|
66
|
+
| 'classic_4_3'
|
|
67
|
+
| 'traditional_3_4'
|
|
68
|
+
| 'widescreen_16_9'
|
|
69
|
+
| 'social_story_9_16'
|
|
70
|
+
| 'smartphone_horizontal_20_9'
|
|
71
|
+
| 'smartphone_vertical_9_20'
|
|
72
|
+
| 'standard_3_2'
|
|
73
|
+
| 'portrait_2_3'
|
|
74
|
+
| 'horizontal_2_1'
|
|
75
|
+
| 'vertical_1_2'
|
|
76
|
+
| 'social_5_4'
|
|
77
|
+
| 'social_post_4_5'
|
|
78
|
+
| DataLink
|
|
79
|
+
/* Freepik image style */
|
|
80
|
+
freepikClassicStyle?:
|
|
81
|
+
| 'photo'
|
|
82
|
+
| 'digital-art'
|
|
83
|
+
| '3d'
|
|
84
|
+
| 'painting'
|
|
85
|
+
| 'low-poly'
|
|
86
|
+
| 'pixel-art'
|
|
87
|
+
| 'anime'
|
|
88
|
+
| 'cyberpunk'
|
|
89
|
+
| 'comic'
|
|
90
|
+
| 'vintage'
|
|
91
|
+
| 'cartoon'
|
|
92
|
+
| 'vector'
|
|
93
|
+
| 'studio-shot'
|
|
94
|
+
| 'dark'
|
|
95
|
+
| 'sketch'
|
|
96
|
+
| 'mockup'
|
|
97
|
+
| '2000s-pone'
|
|
98
|
+
| '70s-vibe'
|
|
99
|
+
| 'watercolor'
|
|
100
|
+
| 'art-nouveau'
|
|
101
|
+
| 'origami'
|
|
102
|
+
| 'surreal'
|
|
103
|
+
| 'fantasy'
|
|
104
|
+
| 'traditional-japan'
|
|
105
|
+
| DataLink
|
|
106
|
+
/* Freepik color scheme */
|
|
107
|
+
freepikClassicStyleColor?:
|
|
108
|
+
| 'b&w'
|
|
109
|
+
| 'pastel'
|
|
110
|
+
| 'sepia'
|
|
111
|
+
| 'dramatic'
|
|
112
|
+
| 'vibrant'
|
|
113
|
+
| 'orange&teal'
|
|
114
|
+
| 'film-filter'
|
|
115
|
+
| 'split'
|
|
116
|
+
| 'electric'
|
|
117
|
+
| 'pastel-pink'
|
|
118
|
+
| 'gold-glow'
|
|
119
|
+
| 'autumn'
|
|
120
|
+
| 'muted-green'
|
|
121
|
+
| 'deep-teal'
|
|
122
|
+
| 'duotone'
|
|
123
|
+
| 'terracotta&teal'
|
|
124
|
+
| 'red&blue'
|
|
125
|
+
| 'cold-neon'
|
|
126
|
+
| 'burgundy&blue'
|
|
127
|
+
| DataLink
|
|
128
|
+
/* Freepik lighting style */
|
|
129
|
+
freepikClassicStyleLighting?:
|
|
130
|
+
| 'studio'
|
|
131
|
+
| 'warm'
|
|
132
|
+
| 'cinematic'
|
|
133
|
+
| 'volumetric'
|
|
134
|
+
| 'golden-hour'
|
|
135
|
+
| 'long-exposure'
|
|
136
|
+
| 'cold'
|
|
137
|
+
| 'iridescent'
|
|
138
|
+
| 'dramatic'
|
|
139
|
+
| 'hardlight'
|
|
140
|
+
| 'redscale'
|
|
141
|
+
| 'indoor-light'
|
|
142
|
+
| DataLink
|
|
143
|
+
/* Freepik framing style */
|
|
144
|
+
freepikClassicStyleFraming?:
|
|
145
|
+
| 'portrait'
|
|
146
|
+
| 'macro'
|
|
147
|
+
| 'panoramic'
|
|
148
|
+
| 'aerial-view'
|
|
149
|
+
| 'close-up'
|
|
150
|
+
| 'cinematic'
|
|
151
|
+
| 'high-angle'
|
|
152
|
+
| 'low-angle'
|
|
153
|
+
| 'symmetry'
|
|
154
|
+
| 'fish-eye'
|
|
155
|
+
| 'first-person'
|
|
156
|
+
| DataLink
|
|
157
|
+
/* Freepik guidance scale (level of fidelity to prompt) */
|
|
158
|
+
freepikClassicGuidanceScale?: number | DataLink
|
|
159
|
+
/* Freepik negative prompt (attributes to avoid) */
|
|
160
|
+
freepikClassicNegativePrompt?: string | DataLink
|
|
161
|
+
/* DeepAI negative prompt (attributes to avoid) */
|
|
162
|
+
deepaiNegativePrompt?: string | DataLink
|
|
163
|
+
/* DeepAI image generator version */
|
|
164
|
+
deepaiImageGeneratorVersion?: 'standard' | 'hd' | DataLink
|
|
165
|
+
/* DeepAI output image width */
|
|
166
|
+
deepaiWidth?: number | DataLink
|
|
167
|
+
/* DeepAI output image height */
|
|
168
|
+
deepaiHeight?: number | DataLink
|
|
169
|
+
/* Gemini aspect ratio (1:1, 16:9, 9:16, 3:2, 2:3) */
|
|
170
|
+
geminiAspectRatio?: '1:1' | '16:9' | '9:16' | '3:2' | '2:3' | DataLink
|
|
171
|
+
/* Gemini model to use for image generation */
|
|
172
|
+
geminiModel?: 'gemini-2.5-flash-image' | 'gemini-3-pro-image-preview' | DataLink
|
|
173
|
+
/* Gemini Veo model to use for video generation */
|
|
174
|
+
geminiVeoModel?: 'veo-3.1-generate-preview' | 'veo-3.1-fast-generate-preview' | DataLink
|
|
175
|
+
/* Gemini Veo video resolution (720p or 1080p) */
|
|
176
|
+
geminiVeoResolution?: '720p' | '1080p' | DataLink
|
|
177
|
+
/* Gemini Veo video duration in seconds (4, 6, 8) */
|
|
178
|
+
geminiVeoDuration?: 4 | 6 | 8 | DataLink
|
|
179
|
+
/* Gemini Veo negative prompt (attributes to avoid) */
|
|
180
|
+
geminiVeoNegativePrompt?: string | DataLink
|
|
181
|
+
/* Gemini Veo person generation control */
|
|
182
|
+
geminiVeoPersonGeneration?: 'allow_all' | 'allow_adult' | DataLink
|
|
183
|
+
}
|
|
184
|
+
events?: BrickBasicEvents & {
|
|
185
|
+
/* Event of the brick press */
|
|
186
|
+
generativeMediaOnPress?: Array<EventAction>
|
|
187
|
+
/* Event of the brick press in */
|
|
188
|
+
generativeMediaOnPressIn?: Array<EventAction>
|
|
189
|
+
/* Event of the brick press out */
|
|
190
|
+
generativeMediaOnPressOut?: Array<EventAction>
|
|
191
|
+
/* Event of the brick long press */
|
|
192
|
+
generativeMediaOnLongPress?: Array<EventAction>
|
|
193
|
+
/* Event of the brick focus (Use TV Device with controller) */
|
|
194
|
+
generativeMediaOnFocus?: Array<EventAction>
|
|
195
|
+
/* Event of the brick blur (Use TV Device with controller) */
|
|
196
|
+
generativeMediaOnBlur?: Array<EventAction>
|
|
197
|
+
/* Event when media generation succeeds */
|
|
198
|
+
onSuccess?: Array<
|
|
199
|
+
EventAction<string & keyof TemplateEventPropsMap['GenerativeMedia']['onSuccess']>
|
|
200
|
+
>
|
|
201
|
+
/* Event when media generation fails */
|
|
202
|
+
onError?: Array<EventAction<string & keyof TemplateEventPropsMap['GenerativeMedia']['onError']>>
|
|
203
|
+
/* Event when media prompt request starts */
|
|
204
|
+
promptStart?: Array<
|
|
205
|
+
EventAction<string & keyof TemplateEventPropsMap['GenerativeMedia']['promptStart']>
|
|
206
|
+
>
|
|
207
|
+
/* Event when media prompt request succeeds */
|
|
208
|
+
promptSuccess?: Array<
|
|
209
|
+
EventAction<string & keyof TemplateEventPropsMap['GenerativeMedia']['promptSuccess']>
|
|
210
|
+
>
|
|
211
|
+
/* Event when media prompt request fails */
|
|
212
|
+
promptError?: Array<
|
|
213
|
+
EventAction<string & keyof TemplateEventPropsMap['GenerativeMedia']['promptError']>
|
|
214
|
+
>
|
|
215
|
+
/* Event when media loading starts */
|
|
216
|
+
loadStart?: Array<EventAction>
|
|
217
|
+
/* Event when media loading succeeds */
|
|
218
|
+
loadSuccess?: Array<
|
|
219
|
+
EventAction<string & keyof TemplateEventPropsMap['GenerativeMedia']['loadSuccess']>
|
|
220
|
+
>
|
|
221
|
+
/* Event when media loading fails */
|
|
222
|
+
loadError?: Array<
|
|
223
|
+
EventAction<string & keyof TemplateEventPropsMap['GenerativeMedia']['loadError']>
|
|
224
|
+
>
|
|
225
|
+
}
|
|
226
|
+
outlets?: {
|
|
227
|
+
/* Brick is pressing */
|
|
228
|
+
brickPressing?: () => Data<boolean>
|
|
229
|
+
/* Brick is focusing (Use TV Device with controller) */
|
|
230
|
+
brickFocusing?: () => Data<boolean>
|
|
231
|
+
/* Generated media URL */
|
|
232
|
+
url?: () => Data<string>
|
|
233
|
+
/* Generated media error */
|
|
234
|
+
error?: () => Data<string>
|
|
235
|
+
/* Loading state */
|
|
236
|
+
loading?: () => Data<boolean>
|
|
237
|
+
}
|
|
238
|
+
animation?: AnimationBasicEvents & {
|
|
239
|
+
generativeMediaOnPress?: Animation
|
|
240
|
+
generativeMediaOnPressIn?: Animation
|
|
241
|
+
generativeMediaOnPressOut?: Animation
|
|
242
|
+
generativeMediaOnLongPress?: Animation
|
|
243
|
+
generativeMediaOnFocus?: Animation
|
|
244
|
+
generativeMediaOnBlur?: Animation
|
|
245
|
+
onSuccess?: Animation
|
|
246
|
+
onError?: Animation
|
|
247
|
+
promptStart?: Animation
|
|
248
|
+
promptSuccess?: Animation
|
|
249
|
+
promptError?: Animation
|
|
250
|
+
loadStart?: Animation
|
|
251
|
+
loadSuccess?: Animation
|
|
252
|
+
loadError?: Animation
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
/* Generative Media brick - Generate images and videos using AI */
|
|
257
|
+
export type GenerativeMedia = Brick &
|
|
258
|
+
GenerativeMediaDef & {
|
|
259
|
+
templateKey: 'BRICK_GENERATIVE_MEDIA'
|
|
260
|
+
switches?: Array<
|
|
261
|
+
SwitchDef &
|
|
262
|
+
GenerativeMediaDef & {
|
|
263
|
+
conds?: Array<{
|
|
264
|
+
method: '==' | '!=' | '>' | '<' | '>=' | '<='
|
|
265
|
+
cond:
|
|
266
|
+
| SwitchCondInnerStateCurrentCanvas
|
|
267
|
+
| SwitchCondData
|
|
268
|
+
| {
|
|
269
|
+
__typename: 'SwitchCondInnerStateOutlet'
|
|
270
|
+
outlet: 'brickPressing' | 'brickFocusing' | 'url' | 'error' | 'loading'
|
|
271
|
+
value: any
|
|
272
|
+
}
|
|
273
|
+
}>
|
|
274
|
+
}
|
|
275
|
+
>
|
|
276
|
+
}
|