@fugood/bricks-project 2.24.0-beta.35 → 2.24.0-beta.37
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/index.ts +14 -6
- package/package.json +2 -2
- package/types/bricks/Camera.ts +10 -5
- package/types/bricks/Chart.ts +5 -2
- package/types/bricks/GenerativeMedia.ts +20 -7
- package/types/bricks/Icon.ts +3 -2
- package/types/bricks/Image.ts +2 -1
- package/types/bricks/Items.ts +19 -8
- package/types/bricks/Lottie.ts +9 -4
- package/types/bricks/Maps.ts +10 -5
- package/types/bricks/QrCode.ts +1 -0
- package/types/bricks/Rect.ts +1 -0
- package/types/bricks/RichText.ts +3 -2
- package/types/bricks/Rive.ts +17 -10
- package/types/bricks/Slideshow.ts +12 -5
- package/types/bricks/Svg.ts +1 -0
- package/types/bricks/Text.ts +1 -0
- package/types/bricks/TextInput.ts +8 -5
- package/types/bricks/Video.ts +3 -2
- package/types/bricks/VideoStreaming.ts +1 -0
- package/types/bricks/WebRtcStream.ts +1 -0
- package/types/bricks/WebView.ts +6 -5
- package/types/common.ts +10 -8
- package/types/generators/AlarmClock.ts +7 -4
- package/types/generators/Assistant.ts +9 -6
- package/types/generators/BleCentral.ts +14 -5
- package/types/generators/BlePeripheral.ts +1 -0
- package/types/generators/CanvasMap.ts +2 -1
- package/types/generators/CastlesPay.ts +7 -2
- package/types/generators/DataBank.ts +8 -3
- package/types/generators/File.ts +41 -14
- package/types/generators/GraphQl.ts +6 -3
- package/types/generators/Http.ts +3 -2
- package/types/generators/HttpServer.ts +11 -6
- package/types/generators/Information.ts +2 -1
- package/types/generators/Intent.ts +3 -2
- package/types/generators/Iterator.ts +5 -4
- package/types/generators/Keyboard.ts +4 -3
- package/types/generators/LlmAnthropicCompat.ts +11 -4
- package/types/generators/LlmAppleBuiltin.ts +8 -3
- package/types/generators/LlmGgml.ts +12 -5
- package/types/generators/LlmMediaTekNeuroPilot.ts +11 -4
- package/types/generators/LlmMlx.ts +11 -4
- package/types/generators/LlmOnnx.ts +11 -4
- package/types/generators/LlmOpenAiCompat.ts +11 -4
- package/types/generators/LlmQualcommAiEngine.ts +9 -4
- package/types/generators/Mcp.ts +40 -17
- package/types/generators/McpServer.ts +17 -8
- package/types/generators/MediaFlow.ts +8 -3
- package/types/generators/MqttBroker.ts +16 -7
- package/types/generators/MqttClient.ts +5 -4
- package/types/generators/Question.ts +2 -1
- package/types/generators/RealtimeTranscription.ts +22 -7
- package/types/generators/RerankerGgml.ts +5 -2
- package/types/generators/SerialPort.ts +7 -2
- package/types/generators/SoundPlayer.ts +4 -1
- package/types/generators/SoundRecorder.ts +3 -2
- package/types/generators/SpeechToTextGgml.ts +8 -3
- package/types/generators/SpeechToTextOnnx.ts +5 -2
- package/types/generators/SpeechToTextPlatform.ts +7 -2
- package/types/generators/SqLite.ts +5 -2
- package/types/generators/Step.ts +2 -1
- package/types/generators/SttAppleBuiltin.ts +5 -2
- package/types/generators/Tcp.ts +5 -4
- package/types/generators/TcpServer.ts +10 -7
- package/types/generators/TextToSpeechAppleBuiltin.ts +5 -2
- package/types/generators/TextToSpeechGgml.ts +5 -2
- package/types/generators/TextToSpeechOnnx.ts +5 -2
- package/types/generators/TextToSpeechOpenAiLike.ts +5 -2
- package/types/generators/ThermalPrinter.ts +2 -1
- package/types/generators/Tick.ts +3 -2
- package/types/generators/Udp.ts +3 -2
- package/types/generators/VadGgml.ts +8 -3
- package/types/generators/VadOnnx.ts +6 -3
- package/types/generators/VadTraditional.ts +8 -3
- package/types/generators/VectorStore.ts +4 -3
- package/types/generators/Watchdog.ts +3 -2
- package/types/generators/WebCrawler.ts +3 -2
- package/types/generators/WebRtc.ts +8 -3
- package/types/generators/WebSocket.ts +2 -1
- package/utils/event-props.ts +833 -1059
package/compile/index.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
/* eslint-disable no-underscore-dangle -- Uses __typename, __actionName, etc. for type system */
|
|
2
|
+
import camelCase from 'lodash/camelCase'
|
|
3
|
+
import upperFirst from 'lodash/upperFirst'
|
|
2
4
|
import snakeCase from 'lodash/snakeCase'
|
|
3
5
|
import omit from 'lodash/omit'
|
|
4
6
|
import { parse as parseAST } from 'acorn'
|
|
@@ -110,14 +112,20 @@ const compileScriptCalculationCode = (code = '') => {
|
|
|
110
112
|
}
|
|
111
113
|
}
|
|
112
114
|
|
|
115
|
+
const getTemplateName = (key: string) =>
|
|
116
|
+
upperFirst(camelCase(key.replace(/^(BRICK|GENERATOR)_/, '')))
|
|
117
|
+
|
|
113
118
|
const compileEventActionValue = (templateKey, eventKey, value, errorReference) => {
|
|
114
|
-
const tmplEventProperties = templateEventPropsMap[templateKey]
|
|
119
|
+
const tmplEventProperties = templateEventPropsMap[getTemplateName(templateKey)]
|
|
115
120
|
const props = tmplEventProperties?.[eventKey]
|
|
116
121
|
if (!props) return compileProperty(value, errorReference)
|
|
117
|
-
if (
|
|
118
|
-
|
|
122
|
+
if (typeof value === 'string' && value in props) {
|
|
123
|
+
const expectedType = props[value]
|
|
124
|
+
if (expectedType) return value
|
|
125
|
+
}
|
|
126
|
+
if (typeof value === 'string' && /^(BRICK|GENERATOR)_/.test(value)) {
|
|
119
127
|
console.warn(
|
|
120
|
-
`[Warning]
|
|
128
|
+
`[Warning] Event property "${value}" is not compatible with event "${eventKey}" of ${templateKey} ${errorReference}`,
|
|
121
129
|
)
|
|
122
130
|
}
|
|
123
131
|
return compileProperty(value, errorReference)
|
|
@@ -188,7 +196,7 @@ const compileEvents = (
|
|
|
188
196
|
if (!handlerKey) throw new Error(`Invalid handler: ${handler} ${errorReference}`)
|
|
189
197
|
|
|
190
198
|
const parameterList: Array<object> = []
|
|
191
|
-
if (Object.
|
|
199
|
+
if (Object.prototype.hasOwnProperty.call(action, 'params')) {
|
|
192
200
|
const actionDef = action as ActionWithParams
|
|
193
201
|
;(actionDef.params || []).forEach(({ input, value, mapping }) => {
|
|
194
202
|
const param = {
|
|
@@ -201,7 +209,7 @@ const compileEvents = (
|
|
|
201
209
|
if (mapping) param[camelCase ? 'resultDataMapping' : 'result_data_mapping'] = true
|
|
202
210
|
parameterList.push(param)
|
|
203
211
|
})
|
|
204
|
-
} else if (Object.
|
|
212
|
+
} else if (Object.prototype.hasOwnProperty.call(action, 'dataParams')) {
|
|
205
213
|
const actionDef = action as ActionWithDataParams
|
|
206
214
|
;(actionDef.dataParams || []).forEach(({ input, value, mapping }) => {
|
|
207
215
|
if (!input) return
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fugood/bricks-project",
|
|
3
|
-
"version": "2.24.0-beta.
|
|
3
|
+
"version": "2.24.0-beta.37",
|
|
4
4
|
"main": "index.ts",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"typecheck": "tsc --noEmit",
|
|
@@ -24,5 +24,5 @@
|
|
|
24
24
|
"peerDependencies": {
|
|
25
25
|
"oxfmt": "^0.36.0"
|
|
26
26
|
},
|
|
27
|
-
"gitHead": "
|
|
27
|
+
"gitHead": "5b91fb31b3ef42efe74e15f8c2e04973905b6cba"
|
|
28
28
|
}
|
package/types/bricks/Camera.ts
CHANGED
|
@@ -15,6 +15,7 @@ import type {
|
|
|
15
15
|
EventProperty,
|
|
16
16
|
} from '../common'
|
|
17
17
|
import type { BrickBasicProperty, BrickBasicEvents, BrickBasicEventsForItem } from '../brick-base'
|
|
18
|
+
import type { TemplateEventPropsMap } from '../../utils/event-props'
|
|
18
19
|
|
|
19
20
|
/* Take picture on the Camera */
|
|
20
21
|
export type BrickCameraActionTakePicture = ActionWithParams & {
|
|
@@ -154,19 +155,23 @@ Default property:
|
|
|
154
155
|
}
|
|
155
156
|
events?: BrickBasicEvents & {
|
|
156
157
|
/* Event of the Camera state change */
|
|
157
|
-
stateChange?: Array<EventAction
|
|
158
|
+
stateChange?: Array<EventAction<string & keyof TemplateEventPropsMap['Camera']['stateChange']>>
|
|
158
159
|
/* Event of the Camera record start */
|
|
159
160
|
recordStart?: Array<EventAction>
|
|
160
161
|
/* Event of the Camera record end */
|
|
161
162
|
recordEnd?: Array<EventAction>
|
|
162
163
|
/* Event of the Camera barcode read */
|
|
163
|
-
barcodeRead?: Array<EventAction
|
|
164
|
+
barcodeRead?: Array<EventAction<string & keyof TemplateEventPropsMap['Camera']['barcodeRead']>>
|
|
164
165
|
/* Event of the Camera picture taken */
|
|
165
|
-
pictureTaken?: Array<
|
|
166
|
+
pictureTaken?: Array<
|
|
167
|
+
EventAction<string & keyof TemplateEventPropsMap['Camera']['pictureTaken']>
|
|
168
|
+
>
|
|
166
169
|
/* Event of the Camera record finished */
|
|
167
|
-
recordFinish?: Array<
|
|
170
|
+
recordFinish?: Array<
|
|
171
|
+
EventAction<string & keyof TemplateEventPropsMap['Camera']['recordFinish']>
|
|
172
|
+
>
|
|
168
173
|
/* Event of the Camera mount error */
|
|
169
|
-
mountError?: Array<EventAction
|
|
174
|
+
mountError?: Array<EventAction<string & keyof TemplateEventPropsMap['Camera']['mountError']>>
|
|
170
175
|
}
|
|
171
176
|
outlets?: {
|
|
172
177
|
/* Camera device and format information */
|
package/types/bricks/Chart.ts
CHANGED
|
@@ -15,6 +15,7 @@ import type {
|
|
|
15
15
|
EventProperty,
|
|
16
16
|
} from '../common'
|
|
17
17
|
import type { BrickBasicProperty, BrickBasicEvents, BrickBasicEventsForItem } from '../brick-base'
|
|
18
|
+
import type { TemplateEventPropsMap } from '../../utils/event-props'
|
|
18
19
|
|
|
19
20
|
/* Data highlight */
|
|
20
21
|
export type BrickChartActionDataHighlight = ActionWithParams & {
|
|
@@ -335,9 +336,11 @@ Default property:
|
|
|
335
336
|
/* Event of chart render */
|
|
336
337
|
onRender?: Array<EventAction>
|
|
337
338
|
/* Event of data point on press */
|
|
338
|
-
onPress?: Array<EventAction
|
|
339
|
+
onPress?: Array<EventAction<string & keyof TemplateEventPropsMap['Chart']['onPress']>>
|
|
339
340
|
/* Event of legend select changed */
|
|
340
|
-
onLegendSelectChanged?: Array<
|
|
341
|
+
onLegendSelectChanged?: Array<
|
|
342
|
+
EventAction<string & keyof TemplateEventPropsMap['Chart']['onLegendSelectChanged']>
|
|
343
|
+
>
|
|
341
344
|
}
|
|
342
345
|
animation?: AnimationBasicEvents & {
|
|
343
346
|
onRender?: Animation
|
|
@@ -15,6 +15,7 @@ import type {
|
|
|
15
15
|
EventProperty,
|
|
16
16
|
} from '../common'
|
|
17
17
|
import type { BrickBasicProperty, BrickBasicEvents, BrickBasicEventsForItem } from '../brick-base'
|
|
18
|
+
import type { TemplateEventPropsMap } from '../../utils/event-props'
|
|
18
19
|
|
|
19
20
|
interface GenerativeMediaDef {
|
|
20
21
|
/*
|
|
@@ -194,21 +195,33 @@ Default property:
|
|
|
194
195
|
/* Event of the brick blur (Use TV Device with controller) */
|
|
195
196
|
generativeMediaOnBlur?: Array<EventAction>
|
|
196
197
|
/* Event when media generation succeeds */
|
|
197
|
-
onSuccess?: Array<
|
|
198
|
+
onSuccess?: Array<
|
|
199
|
+
EventAction<string & keyof TemplateEventPropsMap['GenerativeMedia']['onSuccess']>
|
|
200
|
+
>
|
|
198
201
|
/* Event when media generation fails */
|
|
199
|
-
onError?: Array<EventAction
|
|
202
|
+
onError?: Array<EventAction<string & keyof TemplateEventPropsMap['GenerativeMedia']['onError']>>
|
|
200
203
|
/* Event when media prompt request starts */
|
|
201
|
-
promptStart?: Array<
|
|
204
|
+
promptStart?: Array<
|
|
205
|
+
EventAction<string & keyof TemplateEventPropsMap['GenerativeMedia']['promptStart']>
|
|
206
|
+
>
|
|
202
207
|
/* Event when media prompt request succeeds */
|
|
203
|
-
promptSuccess?: Array<
|
|
208
|
+
promptSuccess?: Array<
|
|
209
|
+
EventAction<string & keyof TemplateEventPropsMap['GenerativeMedia']['promptSuccess']>
|
|
210
|
+
>
|
|
204
211
|
/* Event when media prompt request fails */
|
|
205
|
-
promptError?: Array<
|
|
212
|
+
promptError?: Array<
|
|
213
|
+
EventAction<string & keyof TemplateEventPropsMap['GenerativeMedia']['promptError']>
|
|
214
|
+
>
|
|
206
215
|
/* Event when media loading starts */
|
|
207
216
|
loadStart?: Array<EventAction>
|
|
208
217
|
/* Event when media loading succeeds */
|
|
209
|
-
loadSuccess?: Array<
|
|
218
|
+
loadSuccess?: Array<
|
|
219
|
+
EventAction<string & keyof TemplateEventPropsMap['GenerativeMedia']['loadSuccess']>
|
|
220
|
+
>
|
|
210
221
|
/* Event when media loading fails */
|
|
211
|
-
loadError?: Array<
|
|
222
|
+
loadError?: Array<
|
|
223
|
+
EventAction<string & keyof TemplateEventPropsMap['GenerativeMedia']['loadError']>
|
|
224
|
+
>
|
|
212
225
|
}
|
|
213
226
|
outlets?: {
|
|
214
227
|
/* Brick is pressing */
|
package/types/bricks/Icon.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* Auto generated by build script
|
|
2
2
|
*
|
|
3
|
-
* Display
|
|
3
|
+
* Display Font Awesome 6 Pro icons. Supports Solid, Regular, Light, Duotone, Thin, Brands, and Sharp styles
|
|
4
4
|
*/
|
|
5
5
|
import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
|
|
6
6
|
import type { Data, DataLink } from '../data'
|
|
@@ -15,6 +15,7 @@ import type {
|
|
|
15
15
|
EventProperty,
|
|
16
16
|
} from '../common'
|
|
17
17
|
import type { BrickBasicProperty, BrickBasicEvents, BrickBasicEventsForItem } from '../brick-base'
|
|
18
|
+
import type { TemplateEventPropsMap } from '../../utils/event-props'
|
|
18
19
|
|
|
19
20
|
interface BrickIconDef {
|
|
20
21
|
/*
|
|
@@ -74,7 +75,7 @@ Default property:
|
|
|
74
75
|
}
|
|
75
76
|
}
|
|
76
77
|
|
|
77
|
-
/* Display
|
|
78
|
+
/* Display Font Awesome 6 Pro icons. Supports Solid, Regular, Light, Duotone, Thin, Brands, and Sharp styles */
|
|
78
79
|
export type BrickIcon = Brick &
|
|
79
80
|
BrickIconDef & {
|
|
80
81
|
templateKey: 'BRICK_ICON'
|
package/types/bricks/Image.ts
CHANGED
|
@@ -15,6 +15,7 @@ import type {
|
|
|
15
15
|
EventProperty,
|
|
16
16
|
} from '../common'
|
|
17
17
|
import type { BrickBasicProperty, BrickBasicEvents, BrickBasicEventsForItem } from '../brick-base'
|
|
18
|
+
import type { TemplateEventPropsMap } from '../../utils/event-props'
|
|
18
19
|
|
|
19
20
|
interface BrickImageDef {
|
|
20
21
|
/*
|
|
@@ -70,7 +71,7 @@ Default property:
|
|
|
70
71
|
/* Event of the image on load */
|
|
71
72
|
onLoad?: Array<EventAction>
|
|
72
73
|
/* Event of the image on error */
|
|
73
|
-
onError?: Array<EventAction
|
|
74
|
+
onError?: Array<EventAction<string & keyof TemplateEventPropsMap['Image']['onError']>>
|
|
74
75
|
}
|
|
75
76
|
outlets?: {
|
|
76
77
|
/* Brick is pressing */
|
package/types/bricks/Items.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* Auto generated by build script
|
|
2
2
|
*
|
|
3
|
-
*
|
|
3
|
+
* Data-driven list/grid. Maps items array to brick templates via propertyMapping, with pagination and detail mode support
|
|
4
4
|
*/
|
|
5
5
|
import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
|
|
6
6
|
import type { Data, DataLink } from '../data'
|
|
@@ -15,6 +15,7 @@ import type {
|
|
|
15
15
|
EventProperty,
|
|
16
16
|
} from '../common'
|
|
17
17
|
import type { BrickBasicProperty, BrickBasicEvents, BrickBasicEventsForItem } from '../brick-base'
|
|
18
|
+
import type { TemplateEventPropsMap } from '../../utils/event-props'
|
|
18
19
|
|
|
19
20
|
/* prev page */
|
|
20
21
|
export type BrickItemsActionPrevPage = Action & {
|
|
@@ -400,17 +401,27 @@ Default property:
|
|
|
400
401
|
| DataLink
|
|
401
402
|
events?: BrickBasicEventsForItem & {
|
|
402
403
|
/* Event on page render finished */
|
|
403
|
-
onPageRender?: Array<
|
|
404
|
+
onPageRender?: Array<
|
|
405
|
+
EventActionForItem<string & keyof TemplateEventPropsMap['Items']['onPageRender']>
|
|
406
|
+
>
|
|
404
407
|
/* Event on page change. */
|
|
405
|
-
onPageChange?: Array<
|
|
408
|
+
onPageChange?: Array<
|
|
409
|
+
EventActionForItem<string & keyof TemplateEventPropsMap['Items']['onPageChange']>
|
|
410
|
+
>
|
|
406
411
|
/* Event on page index out of bound. */
|
|
407
|
-
onPageOutOfBound?: Array<
|
|
412
|
+
onPageOutOfBound?: Array<
|
|
413
|
+
EventActionForItem<string & keyof TemplateEventPropsMap['Items']['onPageOutOfBound']>
|
|
414
|
+
>
|
|
408
415
|
/* Event on into `detail` mode */
|
|
409
|
-
onIntoDetailMode?: Array<
|
|
416
|
+
onIntoDetailMode?: Array<
|
|
417
|
+
EventActionForItem<string & keyof TemplateEventPropsMap['Items']['onIntoDetailMode']>
|
|
418
|
+
>
|
|
410
419
|
/* Event on into `list` mode. */
|
|
411
|
-
onIntoListMode?: Array<
|
|
420
|
+
onIntoListMode?: Array<
|
|
421
|
+
EventActionForItem<string & keyof TemplateEventPropsMap['Items']['onIntoListMode']>
|
|
422
|
+
>
|
|
412
423
|
/* Event on render error */
|
|
413
|
-
onError?: Array<EventActionForItem
|
|
424
|
+
onError?: Array<EventActionForItem<string & keyof TemplateEventPropsMap['Items']['onError']>>
|
|
414
425
|
}
|
|
415
426
|
outlets?: {
|
|
416
427
|
/* Catched error message */
|
|
@@ -436,7 +447,7 @@ Default property:
|
|
|
436
447
|
}
|
|
437
448
|
}
|
|
438
449
|
|
|
439
|
-
/*
|
|
450
|
+
/* Data-driven list/grid. Maps items array to brick templates via propertyMapping, with pagination and detail mode support */
|
|
440
451
|
export type BrickItems = Brick &
|
|
441
452
|
BrickItemsDef & {
|
|
442
453
|
templateKey: 'BRICK_ITEMS'
|
package/types/bricks/Lottie.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* Auto generated by build script
|
|
2
2
|
*
|
|
3
|
-
* Lottie
|
|
3
|
+
* Lottie animation player supporting .json and .dotlottie formats. Supports speed, loop, frame range control, color/text filters, and hardware rendering
|
|
4
4
|
*/
|
|
5
5
|
import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
|
|
6
6
|
import type { Data, DataLink } from '../data'
|
|
@@ -15,6 +15,7 @@ import type {
|
|
|
15
15
|
EventProperty,
|
|
16
16
|
} from '../common'
|
|
17
17
|
import type { BrickBasicProperty, BrickBasicEvents, BrickBasicEventsForItem } from '../brick-base'
|
|
18
|
+
import type { TemplateEventPropsMap } from '../../utils/event-props'
|
|
18
19
|
|
|
19
20
|
/* Play animation */
|
|
20
21
|
export type BrickLottieActionPlay = ActionWithParams & {
|
|
@@ -115,9 +116,13 @@ Default property:
|
|
|
115
116
|
/* Event of the brick blur (Use TV Device with controller) */
|
|
116
117
|
onBlur?: Array<EventAction>
|
|
117
118
|
/* Event of the animation finished */
|
|
118
|
-
onAnimationFinish?: Array<
|
|
119
|
+
onAnimationFinish?: Array<
|
|
120
|
+
EventAction<string & keyof TemplateEventPropsMap['Lottie']['onAnimationFinish']>
|
|
121
|
+
>
|
|
119
122
|
/* Event of the uri on load failed */
|
|
120
|
-
onAnimationFailure?: Array<
|
|
123
|
+
onAnimationFailure?: Array<
|
|
124
|
+
EventAction<string & keyof TemplateEventPropsMap['Lottie']['onAnimationFailure']>
|
|
125
|
+
>
|
|
121
126
|
/* Event of the animation on loop */
|
|
122
127
|
onAnimationLoop?: Array<EventAction>
|
|
123
128
|
}
|
|
@@ -140,7 +145,7 @@ Default property:
|
|
|
140
145
|
}
|
|
141
146
|
}
|
|
142
147
|
|
|
143
|
-
/* Lottie
|
|
148
|
+
/* Lottie animation player supporting .json and .dotlottie formats. Supports speed, loop, frame range control, color/text filters, and hardware rendering */
|
|
144
149
|
export type BrickLottie = Brick &
|
|
145
150
|
BrickLottieDef & {
|
|
146
151
|
templateKey: 'BRICK_LOTTIE'
|
package/types/bricks/Maps.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* Auto generated by build script
|
|
2
2
|
*
|
|
3
|
-
* Interactive map
|
|
3
|
+
* Interactive map with markers, paths, and location tracking. Supports Google Maps (iOS/Android/Desktop/Web) and Apple Maps (iOS/tvOS)
|
|
4
4
|
*/
|
|
5
5
|
import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
|
|
6
6
|
import type { Data, DataLink } from '../data'
|
|
@@ -15,6 +15,7 @@ import type {
|
|
|
15
15
|
EventProperty,
|
|
16
16
|
} from '../common'
|
|
17
17
|
import type { BrickBasicProperty, BrickBasicEvents, BrickBasicEventsForItem } from '../brick-base'
|
|
18
|
+
import type { TemplateEventPropsMap } from '../../utils/event-props'
|
|
18
19
|
|
|
19
20
|
/* Zoom in the map */
|
|
20
21
|
export type BrickMapsActionZoomIn = Action & {
|
|
@@ -206,11 +207,15 @@ Default property:
|
|
|
206
207
|
/* Event of the brick blur (Use TV Device with controller) */
|
|
207
208
|
onBlur?: Array<EventAction>
|
|
208
209
|
/* Event when a marker is pressed */
|
|
209
|
-
onMarkerPress?: Array<
|
|
210
|
+
onMarkerPress?: Array<
|
|
211
|
+
EventAction<string & keyof TemplateEventPropsMap['Maps']['onMarkerPress']>
|
|
212
|
+
>
|
|
210
213
|
/* Event when the map is pressed */
|
|
211
|
-
onMapPress?: Array<EventAction
|
|
214
|
+
onMapPress?: Array<EventAction<string & keyof TemplateEventPropsMap['Maps']['onMapPress']>>
|
|
212
215
|
/* Event when the map region changes */
|
|
213
|
-
onRegionChange?: Array<
|
|
216
|
+
onRegionChange?: Array<
|
|
217
|
+
EventAction<string & keyof TemplateEventPropsMap['Maps']['onRegionChange']>
|
|
218
|
+
>
|
|
214
219
|
/* Event when the map is ready */
|
|
215
220
|
onReady?: Array<EventAction>
|
|
216
221
|
}
|
|
@@ -234,7 +239,7 @@ Default property:
|
|
|
234
239
|
}
|
|
235
240
|
}
|
|
236
241
|
|
|
237
|
-
/* Interactive map
|
|
242
|
+
/* Interactive map with markers, paths, and location tracking. Supports Google Maps (iOS/Android/Desktop/Web) and Apple Maps (iOS/tvOS) */
|
|
238
243
|
export type BrickMaps = Brick &
|
|
239
244
|
BrickMapsDef & {
|
|
240
245
|
templateKey: 'BRICK_MAPS'
|
package/types/bricks/QrCode.ts
CHANGED
|
@@ -15,6 +15,7 @@ import type {
|
|
|
15
15
|
EventProperty,
|
|
16
16
|
} from '../common'
|
|
17
17
|
import type { BrickBasicProperty, BrickBasicEvents, BrickBasicEventsForItem } from '../brick-base'
|
|
18
|
+
import type { TemplateEventPropsMap } from '../../utils/event-props'
|
|
18
19
|
|
|
19
20
|
interface BrickQrcodeDef {
|
|
20
21
|
/*
|
package/types/bricks/Rect.ts
CHANGED
|
@@ -15,6 +15,7 @@ import type {
|
|
|
15
15
|
EventProperty,
|
|
16
16
|
} from '../common'
|
|
17
17
|
import type { BrickBasicProperty, BrickBasicEvents, BrickBasicEventsForItem } from '../brick-base'
|
|
18
|
+
import type { TemplateEventPropsMap } from '../../utils/event-props'
|
|
18
19
|
|
|
19
20
|
interface BrickRectDef {
|
|
20
21
|
/*
|
package/types/bricks/RichText.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* Auto generated by build script
|
|
2
2
|
*
|
|
3
|
-
* Rich text
|
|
3
|
+
* Rich text with HTML content rendering, multiple fonts, colors, heading levels (h1-h6), and inline images
|
|
4
4
|
*/
|
|
5
5
|
import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
|
|
6
6
|
import type { Data, DataLink } from '../data'
|
|
@@ -15,6 +15,7 @@ import type {
|
|
|
15
15
|
EventProperty,
|
|
16
16
|
} from '../common'
|
|
17
17
|
import type { BrickBasicProperty, BrickBasicEvents, BrickBasicEventsForItem } from '../brick-base'
|
|
18
|
+
import type { TemplateEventPropsMap } from '../../utils/event-props'
|
|
18
19
|
|
|
19
20
|
interface BrickRichTextDef {
|
|
20
21
|
/*
|
|
@@ -104,7 +105,7 @@ Default property:
|
|
|
104
105
|
}
|
|
105
106
|
}
|
|
106
107
|
|
|
107
|
-
/* Rich text
|
|
108
|
+
/* Rich text with HTML content rendering, multiple fonts, colors, heading levels (h1-h6), and inline images */
|
|
108
109
|
export type BrickRichText = Brick &
|
|
109
110
|
BrickRichTextDef & {
|
|
110
111
|
templateKey: 'BRICK_RICH_TEXT'
|
package/types/bricks/Rive.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* Auto generated by build script
|
|
2
2
|
*
|
|
3
|
-
* Rive
|
|
3
|
+
* Render Rive (.riv) animations with state machine input control, text run updates, and artboard selection
|
|
4
4
|
*/
|
|
5
5
|
import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
|
|
6
6
|
import type { Data, DataLink } from '../data'
|
|
@@ -15,6 +15,7 @@ import type {
|
|
|
15
15
|
EventProperty,
|
|
16
16
|
} from '../common'
|
|
17
17
|
import type { BrickBasicProperty, BrickBasicEvents, BrickBasicEventsForItem } from '../brick-base'
|
|
18
|
+
import type { TemplateEventPropsMap } from '../../utils/event-props'
|
|
18
19
|
|
|
19
20
|
/* Play animation */
|
|
20
21
|
export type BrickRiveActionPlay = ActionWithParams & {
|
|
@@ -162,21 +163,27 @@ Default property:
|
|
|
162
163
|
}
|
|
163
164
|
events?: BrickBasicEvents & {
|
|
164
165
|
/* Event of animation play */
|
|
165
|
-
onPlay?: Array<EventAction
|
|
166
|
+
onPlay?: Array<EventAction<string & keyof TemplateEventPropsMap['Rive']['onPlay']>>
|
|
166
167
|
/* Event of animation pause */
|
|
167
|
-
onPause?: Array<EventAction
|
|
168
|
+
onPause?: Array<EventAction<string & keyof TemplateEventPropsMap['Rive']['onPause']>>
|
|
168
169
|
/* Event of animation stop */
|
|
169
|
-
onStop?: Array<EventAction
|
|
170
|
+
onStop?: Array<EventAction<string & keyof TemplateEventPropsMap['Rive']['onStop']>>
|
|
170
171
|
/* Event of animation loop end */
|
|
171
|
-
onLoopEnd?: Array<EventAction
|
|
172
|
+
onLoopEnd?: Array<EventAction<string & keyof TemplateEventPropsMap['Rive']['onLoopEnd']>>
|
|
172
173
|
/* Event of state changed */
|
|
173
|
-
onStateChanged?: Array<
|
|
174
|
+
onStateChanged?: Array<
|
|
175
|
+
EventAction<string & keyof TemplateEventPropsMap['Rive']['onStateChanged']>
|
|
176
|
+
>
|
|
174
177
|
/* Event of error */
|
|
175
|
-
onError?: Array<EventAction
|
|
178
|
+
onError?: Array<EventAction<string & keyof TemplateEventPropsMap['Rive']['onError']>>
|
|
176
179
|
/* Event of Rive general event received */
|
|
177
|
-
onRiveGeneralEvent?: Array<
|
|
180
|
+
onRiveGeneralEvent?: Array<
|
|
181
|
+
EventAction<string & keyof TemplateEventPropsMap['Rive']['onRiveGeneralEvent']>
|
|
182
|
+
>
|
|
178
183
|
/* Event of Rive open-url event received */
|
|
179
|
-
onRiveOpenUrlEvent?: Array<
|
|
184
|
+
onRiveOpenUrlEvent?: Array<
|
|
185
|
+
EventAction<string & keyof TemplateEventPropsMap['Rive']['onRiveOpenUrlEvent']>
|
|
186
|
+
>
|
|
180
187
|
}
|
|
181
188
|
animation?: AnimationBasicEvents & {
|
|
182
189
|
onPlay?: Animation
|
|
@@ -190,7 +197,7 @@ Default property:
|
|
|
190
197
|
}
|
|
191
198
|
}
|
|
192
199
|
|
|
193
|
-
/* Rive
|
|
200
|
+
/* Render Rive (.riv) animations with state machine input control, text run updates, and artboard selection */
|
|
194
201
|
export type BrickRive = Brick &
|
|
195
202
|
BrickRiveDef & {
|
|
196
203
|
templateKey: 'BRICK_RIVE'
|
|
@@ -15,6 +15,7 @@ import type {
|
|
|
15
15
|
EventProperty,
|
|
16
16
|
} from '../common'
|
|
17
17
|
import type { BrickBasicProperty, BrickBasicEvents, BrickBasicEventsForItem } from '../brick-base'
|
|
18
|
+
import type { TemplateEventPropsMap } from '../../utils/event-props'
|
|
18
19
|
|
|
19
20
|
/* Jump to a specific index in the slideshow */
|
|
20
21
|
export type BrickSlideshowActionJumpToIndex = ActionWithParams & {
|
|
@@ -149,17 +150,23 @@ Default property:
|
|
|
149
150
|
}
|
|
150
151
|
events?: BrickBasicEvents & {
|
|
151
152
|
/* Event of the next slideshow on change start */
|
|
152
|
-
changeStart?: Array<
|
|
153
|
+
changeStart?: Array<
|
|
154
|
+
EventAction<string & keyof TemplateEventPropsMap['Slideshow']['changeStart']>
|
|
155
|
+
>
|
|
153
156
|
/* Event of the next slideshow on change end */
|
|
154
|
-
changeEnd?: Array<EventAction
|
|
157
|
+
changeEnd?: Array<EventAction<string & keyof TemplateEventPropsMap['Slideshow']['changeEnd']>>
|
|
155
158
|
/* Event on paths change */
|
|
156
|
-
contentChange?: Array<
|
|
159
|
+
contentChange?: Array<
|
|
160
|
+
EventAction<string & keyof TemplateEventPropsMap['Slideshow']['contentChange']>
|
|
161
|
+
>
|
|
157
162
|
/* Event on plays of paths are end */
|
|
158
|
-
roundEnd?: Array<EventAction
|
|
163
|
+
roundEnd?: Array<EventAction<string & keyof TemplateEventPropsMap['Slideshow']['roundEnd']>>
|
|
159
164
|
/* Event of the slideshow on load */
|
|
160
165
|
mediaOnLoad?: Array<EventAction>
|
|
161
166
|
/* Event of the slideshow media loading error */
|
|
162
|
-
mediaOnError?: Array<
|
|
167
|
+
mediaOnError?: Array<
|
|
168
|
+
EventAction<string & keyof TemplateEventPropsMap['Slideshow']['mediaOnError']>
|
|
169
|
+
>
|
|
163
170
|
}
|
|
164
171
|
animation?: AnimationBasicEvents & {
|
|
165
172
|
changeStart?: Animation
|
package/types/bricks/Svg.ts
CHANGED
|
@@ -15,6 +15,7 @@ import type {
|
|
|
15
15
|
EventProperty,
|
|
16
16
|
} from '../common'
|
|
17
17
|
import type { BrickBasicProperty, BrickBasicEvents, BrickBasicEventsForItem } from '../brick-base'
|
|
18
|
+
import type { TemplateEventPropsMap } from '../../utils/event-props'
|
|
18
19
|
|
|
19
20
|
interface BrickSvgDef {
|
|
20
21
|
/*
|
package/types/bricks/Text.ts
CHANGED
|
@@ -15,6 +15,7 @@ import type {
|
|
|
15
15
|
EventProperty,
|
|
16
16
|
} from '../common'
|
|
17
17
|
import type { BrickBasicProperty, BrickBasicEvents, BrickBasicEventsForItem } from '../brick-base'
|
|
18
|
+
import type { TemplateEventPropsMap } from '../../utils/event-props'
|
|
18
19
|
|
|
19
20
|
interface BrickTextDef {
|
|
20
21
|
/*
|
|
@@ -15,6 +15,7 @@ import type {
|
|
|
15
15
|
EventProperty,
|
|
16
16
|
} from '../common'
|
|
17
17
|
import type { BrickBasicProperty, BrickBasicEvents, BrickBasicEventsForItem } from '../brick-base'
|
|
18
|
+
import type { TemplateEventPropsMap } from '../../utils/event-props'
|
|
18
19
|
|
|
19
20
|
/* Focus TextInput */
|
|
20
21
|
export type BrickTextInputActionFocus = Action & {
|
|
@@ -175,15 +176,17 @@ Default property:
|
|
|
175
176
|
/* Event of the TextInput is empty */
|
|
176
177
|
onEmpty?: Array<EventAction>
|
|
177
178
|
/* Event of the TextInput value change */
|
|
178
|
-
onChange?: Array<EventAction
|
|
179
|
+
onChange?: Array<EventAction<string & keyof TemplateEventPropsMap['TextInput']['onChange']>>
|
|
179
180
|
/* Event of the TextInput submit */
|
|
180
|
-
onSubmit?: Array<EventAction
|
|
181
|
+
onSubmit?: Array<EventAction<string & keyof TemplateEventPropsMap['TextInput']['onSubmit']>>
|
|
181
182
|
/* Event of the TextInput match regex (check every value change) */
|
|
182
|
-
onMatch?: Array<EventAction
|
|
183
|
+
onMatch?: Array<EventAction<string & keyof TemplateEventPropsMap['TextInput']['onMatch']>>
|
|
183
184
|
/* Event of the TextInput not match regex (check every value change) */
|
|
184
|
-
onNotMatch?: Array<EventAction
|
|
185
|
+
onNotMatch?: Array<EventAction<string & keyof TemplateEventPropsMap['TextInput']['onNotMatch']>>
|
|
185
186
|
/* Event of the TextInput not match regex (check every submit) */
|
|
186
|
-
onResultNotMatch?: Array<
|
|
187
|
+
onResultNotMatch?: Array<
|
|
188
|
+
EventAction<string & keyof TemplateEventPropsMap['TextInput']['onResultNotMatch']>
|
|
189
|
+
>
|
|
187
190
|
/* Event of the TextInput reach max length or match regex */
|
|
188
191
|
onFullFill?: Array<EventAction>
|
|
189
192
|
}
|
package/types/bricks/Video.ts
CHANGED
|
@@ -15,6 +15,7 @@ import type {
|
|
|
15
15
|
EventProperty,
|
|
16
16
|
} from '../common'
|
|
17
17
|
import type { BrickBasicProperty, BrickBasicEvents, BrickBasicEventsForItem } from '../brick-base'
|
|
18
|
+
import type { TemplateEventPropsMap } from '../../utils/event-props'
|
|
18
19
|
|
|
19
20
|
/* Play the video */
|
|
20
21
|
export type BrickVideoActionPlay = Action & {
|
|
@@ -120,7 +121,7 @@ Default property:
|
|
|
120
121
|
/* Event of the brick blur (Use TV Device with controller) */
|
|
121
122
|
onBlur?: Array<EventAction>
|
|
122
123
|
/* Event of the next video on change start */
|
|
123
|
-
nextVideo?: Array<EventAction
|
|
124
|
+
nextVideo?: Array<EventAction<string & keyof TemplateEventPropsMap['Video']['nextVideo']>>
|
|
124
125
|
/* Event on plays of path are totally end */
|
|
125
126
|
roundEnd?: Array<EventAction>
|
|
126
127
|
/* Event on video load */
|
|
@@ -128,7 +129,7 @@ Default property:
|
|
|
128
129
|
/* Event of the video playing error */
|
|
129
130
|
onError?: Array<EventAction>
|
|
130
131
|
/* Event of the video progress interval */
|
|
131
|
-
onProgress?: Array<EventAction
|
|
132
|
+
onProgress?: Array<EventAction<string & keyof TemplateEventPropsMap['Video']['onProgress']>>
|
|
132
133
|
}
|
|
133
134
|
outlets?: {
|
|
134
135
|
/* Brick is pressing */
|
|
@@ -15,6 +15,7 @@ import type {
|
|
|
15
15
|
EventProperty,
|
|
16
16
|
} from '../common'
|
|
17
17
|
import type { BrickBasicProperty, BrickBasicEvents, BrickBasicEventsForItem } from '../brick-base'
|
|
18
|
+
import type { TemplateEventPropsMap } from '../../utils/event-props'
|
|
18
19
|
|
|
19
20
|
interface BrickVideoStreamingDef {
|
|
20
21
|
/*
|
|
@@ -15,6 +15,7 @@ import type {
|
|
|
15
15
|
EventProperty,
|
|
16
16
|
} from '../common'
|
|
17
17
|
import type { BrickBasicProperty, BrickBasicEvents, BrickBasicEventsForItem } from '../brick-base'
|
|
18
|
+
import type { TemplateEventPropsMap } from '../../utils/event-props'
|
|
18
19
|
|
|
19
20
|
interface BrickWebRTCStreamDef {
|
|
20
21
|
/*
|
package/types/bricks/WebView.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* Auto generated by build script
|
|
2
2
|
*
|
|
3
|
-
*
|
|
3
|
+
* Embedded web browser with JS injection, DOM query selectors, content cropping, navigation control, and permission management
|
|
4
4
|
*/
|
|
5
5
|
import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
|
|
6
6
|
import type { Data, DataLink } from '../data'
|
|
@@ -15,6 +15,7 @@ import type {
|
|
|
15
15
|
EventProperty,
|
|
16
16
|
} from '../common'
|
|
17
17
|
import type { BrickBasicProperty, BrickBasicEvents, BrickBasicEventsForItem } from '../brick-base'
|
|
18
|
+
import type { TemplateEventPropsMap } from '../../utils/event-props'
|
|
18
19
|
|
|
19
20
|
/* Run Javascript on the WebView */
|
|
20
21
|
export type BrickWebViewActionInjectJavascript = ActionWithParams & {
|
|
@@ -125,11 +126,11 @@ Default property:
|
|
|
125
126
|
}
|
|
126
127
|
events?: BrickBasicEvents & {
|
|
127
128
|
/* Event of the WebView on load */
|
|
128
|
-
onLoad?: Array<EventAction
|
|
129
|
+
onLoad?: Array<EventAction<string & keyof TemplateEventPropsMap['Webview']['onLoad']>>
|
|
129
130
|
/* Event when the WebView load fails */
|
|
130
|
-
onError?: Array<EventAction
|
|
131
|
+
onError?: Array<EventAction<string & keyof TemplateEventPropsMap['Webview']['onError']>>
|
|
131
132
|
/* Event of the webview on message by `window.ReactNativeWebView.postMessage` on you're injected javascript code */
|
|
132
|
-
onMessage?: Array<EventAction
|
|
133
|
+
onMessage?: Array<EventAction<string & keyof TemplateEventPropsMap['Webview']['onMessage']>>
|
|
133
134
|
}
|
|
134
135
|
outlets?: {
|
|
135
136
|
/* The result of the query selector action */
|
|
@@ -144,7 +145,7 @@ Default property:
|
|
|
144
145
|
}
|
|
145
146
|
}
|
|
146
147
|
|
|
147
|
-
/*
|
|
148
|
+
/* Embedded web browser with JS injection, DOM query selectors, content cropping, navigation control, and permission management */
|
|
148
149
|
export type BrickWebView = Brick &
|
|
149
150
|
BrickWebViewDef & {
|
|
150
151
|
templateKey: 'BRICK_WEBVIEW'
|