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