@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.
Files changed (129) hide show
  1. package/compile/action-name-map.ts +988 -0
  2. package/compile/index.ts +1245 -0
  3. package/compile/util.ts +358 -0
  4. package/index.ts +6 -0
  5. package/package.json +28 -0
  6. package/skills/bricks-design/LICENSE.txt +180 -0
  7. package/skills/bricks-design/SKILL.md +66 -0
  8. package/skills/bricks-project/SKILL.md +32 -0
  9. package/skills/bricks-project/rules/animation.md +159 -0
  10. package/skills/bricks-project/rules/architecture-patterns.md +69 -0
  11. package/skills/bricks-project/rules/automations.md +221 -0
  12. package/skills/bricks-project/rules/buttress.md +156 -0
  13. package/skills/bricks-project/rules/data-calculation.md +208 -0
  14. package/skills/bricks-project/rules/local-sync.md +129 -0
  15. package/skills/bricks-project/rules/media-flow.md +158 -0
  16. package/skills/bricks-project/rules/remote-data-bank.md +196 -0
  17. package/skills/bricks-project/rules/standby-transition.md +124 -0
  18. package/skills/rive-marketplace/SKILL.md +99 -0
  19. package/tools/deploy.ts +151 -0
  20. package/tools/icons/.gitattributes +1 -0
  21. package/tools/icons/fa6pro-glyphmap.json +4686 -0
  22. package/tools/icons/fa6pro-meta.json +3671 -0
  23. package/tools/mcp-server.ts +28 -0
  24. package/tools/mcp-tools/compile.ts +91 -0
  25. package/tools/mcp-tools/huggingface.ts +762 -0
  26. package/tools/mcp-tools/icons.ts +70 -0
  27. package/tools/mcp-tools/lottie.ts +102 -0
  28. package/tools/mcp-tools/media.ts +110 -0
  29. package/tools/postinstall.ts +229 -0
  30. package/tools/preview-main.mjs +293 -0
  31. package/tools/preview.ts +143 -0
  32. package/tools/pull.ts +116 -0
  33. package/tsconfig.json +16 -0
  34. package/types/animation.ts +100 -0
  35. package/types/automation.ts +235 -0
  36. package/types/brick-base.ts +80 -0
  37. package/types/bricks/Camera.ts +246 -0
  38. package/types/bricks/Chart.ts +372 -0
  39. package/types/bricks/GenerativeMedia.ts +276 -0
  40. package/types/bricks/Icon.ts +98 -0
  41. package/types/bricks/Image.ts +114 -0
  42. package/types/bricks/Items.ts +476 -0
  43. package/types/bricks/Lottie.ts +168 -0
  44. package/types/bricks/Maps.ts +262 -0
  45. package/types/bricks/QrCode.ts +117 -0
  46. package/types/bricks/Rect.ts +150 -0
  47. package/types/bricks/RichText.ts +128 -0
  48. package/types/bricks/Rive.ts +220 -0
  49. package/types/bricks/Slideshow.ts +201 -0
  50. package/types/bricks/Svg.ts +99 -0
  51. package/types/bricks/Text.ts +148 -0
  52. package/types/bricks/TextInput.ts +242 -0
  53. package/types/bricks/Video.ts +175 -0
  54. package/types/bricks/VideoStreaming.ts +112 -0
  55. package/types/bricks/WebRtcStream.ts +65 -0
  56. package/types/bricks/WebView.ts +168 -0
  57. package/types/bricks/index.ts +21 -0
  58. package/types/canvas.ts +82 -0
  59. package/types/common.ts +144 -0
  60. package/types/data-calc-command.ts +7005 -0
  61. package/types/data-calc-script.ts +21 -0
  62. package/types/data-calc.ts +11 -0
  63. package/types/data.ts +95 -0
  64. package/types/generators/AlarmClock.ts +110 -0
  65. package/types/generators/Assistant.ts +621 -0
  66. package/types/generators/BleCentral.ts +247 -0
  67. package/types/generators/BlePeripheral.ts +208 -0
  68. package/types/generators/CanvasMap.ts +74 -0
  69. package/types/generators/CastlesPay.ts +87 -0
  70. package/types/generators/DataBank.ts +160 -0
  71. package/types/generators/File.ts +432 -0
  72. package/types/generators/GraphQl.ts +132 -0
  73. package/types/generators/Http.ts +222 -0
  74. package/types/generators/HttpServer.ts +176 -0
  75. package/types/generators/Information.ts +103 -0
  76. package/types/generators/Intent.ts +168 -0
  77. package/types/generators/Iterator.ts +108 -0
  78. package/types/generators/Keyboard.ts +105 -0
  79. package/types/generators/LlmAnthropicCompat.ts +212 -0
  80. package/types/generators/LlmAppleBuiltin.ts +159 -0
  81. package/types/generators/LlmGgml.ts +861 -0
  82. package/types/generators/LlmMediaTekNeuroPilot.ts +235 -0
  83. package/types/generators/LlmMlx.ts +227 -0
  84. package/types/generators/LlmOnnx.ts +213 -0
  85. package/types/generators/LlmOpenAiCompat.ts +244 -0
  86. package/types/generators/LlmQualcommAiEngine.ts +247 -0
  87. package/types/generators/Mcp.ts +637 -0
  88. package/types/generators/McpServer.ts +289 -0
  89. package/types/generators/MediaFlow.ts +170 -0
  90. package/types/generators/MqttBroker.ts +141 -0
  91. package/types/generators/MqttClient.ts +141 -0
  92. package/types/generators/Question.ts +408 -0
  93. package/types/generators/RealtimeTranscription.ts +279 -0
  94. package/types/generators/RerankerGgml.ts +191 -0
  95. package/types/generators/SerialPort.ts +151 -0
  96. package/types/generators/SoundPlayer.ts +94 -0
  97. package/types/generators/SoundRecorder.ts +130 -0
  98. package/types/generators/SpeechToTextGgml.ts +415 -0
  99. package/types/generators/SpeechToTextOnnx.ts +236 -0
  100. package/types/generators/SpeechToTextPlatform.ts +85 -0
  101. package/types/generators/SqLite.ts +159 -0
  102. package/types/generators/Step.ts +107 -0
  103. package/types/generators/SttAppleBuiltin.ts +130 -0
  104. package/types/generators/Tcp.ts +126 -0
  105. package/types/generators/TcpServer.ts +147 -0
  106. package/types/generators/TextToSpeechAppleBuiltin.ts +127 -0
  107. package/types/generators/TextToSpeechGgml.ts +221 -0
  108. package/types/generators/TextToSpeechOnnx.ts +178 -0
  109. package/types/generators/TextToSpeechOpenAiLike.ts +121 -0
  110. package/types/generators/ThermalPrinter.ts +191 -0
  111. package/types/generators/Tick.ts +83 -0
  112. package/types/generators/Udp.ts +120 -0
  113. package/types/generators/VadGgml.ts +250 -0
  114. package/types/generators/VadOnnx.ts +231 -0
  115. package/types/generators/VadTraditional.ts +138 -0
  116. package/types/generators/VectorStore.ts +257 -0
  117. package/types/generators/Watchdog.ts +107 -0
  118. package/types/generators/WebCrawler.ts +103 -0
  119. package/types/generators/WebRtc.ts +181 -0
  120. package/types/generators/WebSocket.ts +148 -0
  121. package/types/generators/index.ts +57 -0
  122. package/types/index.ts +13 -0
  123. package/types/subspace.ts +59 -0
  124. package/types/switch.ts +51 -0
  125. package/types/system.ts +707 -0
  126. package/utils/calc.ts +126 -0
  127. package/utils/data.ts +497 -0
  128. package/utils/event-props.ts +836 -0
  129. package/utils/id.ts +80 -0
@@ -0,0 +1,168 @@
1
+ /* Auto generated by build script
2
+ *
3
+ * Lottie animation player supporting .json and .dotlottie formats. Supports speed, loop, frame range control, color/text filters, and hardware rendering
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
+ /* Play animation */
21
+ export type BrickLottieActionPlay = ActionWithParams & {
22
+ __actionName: 'BRICK_LOTTIE_PLAY'
23
+ params?: Array<
24
+ | {
25
+ input: 'startFrame'
26
+ value?: number | DataLink | EventProperty
27
+ mapping?: string
28
+ }
29
+ | {
30
+ input: 'endFrame'
31
+ value?: number | DataLink | EventProperty
32
+ mapping?: string
33
+ }
34
+ >
35
+ }
36
+
37
+ /* Pause animation */
38
+ export type BrickLottieActionPause = Action & {
39
+ __actionName: 'BRICK_LOTTIE_PAUSE'
40
+ }
41
+
42
+ /* Resume animation */
43
+ export type BrickLottieActionResume = Action & {
44
+ __actionName: 'BRICK_LOTTIE_RESUME'
45
+ }
46
+
47
+ /* Stop animation */
48
+ export type BrickLottieActionStop = Action & {
49
+ __actionName: 'BRICK_LOTTIE_STOP'
50
+ }
51
+
52
+ /* Reset animation */
53
+ export type BrickLottieActionReset = Action & {
54
+ __actionName: 'BRICK_LOTTIE_RESET'
55
+ }
56
+
57
+ interface BrickLottieDef {
58
+ /*
59
+ Default property:
60
+ {
61
+ "loop": true,
62
+ "autoPlay": true,
63
+ "resizeMode": "contain",
64
+ "renderMode": "auto"
65
+ }
66
+ */
67
+ property?: BrickBasicProperty & {
68
+ /* The animation json config content from uri */
69
+ uri?: string | DataLink
70
+ /* The checksum of `uri` */
71
+ md5?: string | DataLink
72
+ /* The animation json config content(The `uri` will be ignored if `source` is defined) */
73
+ source?: {} | DataLink
74
+ /* The speed the animation will progress. This only affects the imperative API. Sending a negative value will reverse the animation. */
75
+ speed?: number | DataLink
76
+ /* A boolean flag indicating whether or not the animation should loop. */
77
+ loop?: boolean | DataLink
78
+ /* A boolean flag indicating whether or not the animation should start automatically when mounted. This only affects the imperative API. */
79
+ autoPlay?: boolean | DataLink
80
+ /* The animation resize mode */
81
+ resizeMode?: 'cover' | 'contain' | 'center' | DataLink
82
+ /* A flag to set whether or not to render with hardware or software acceleration (Not supported for iOS) */
83
+ renderMode?: 'auto' | 'hardware' | 'software' | DataLink
84
+ /* Replace color (as hex string) by keypath */
85
+ colorFilters?:
86
+ | Array<
87
+ | DataLink
88
+ | {
89
+ keypath?: string | DataLink
90
+ color?: string | DataLink
91
+ }
92
+ >
93
+ | DataLink
94
+ /* Replace color (as hex string) by find text. Use text filters will disable glyphs text render / force software render mode, This means that a specific font needs to be loaded. */
95
+ textFilters?:
96
+ | Array<
97
+ | DataLink
98
+ | {
99
+ find?: string | DataLink
100
+ replace?: string | DataLink
101
+ }
102
+ >
103
+ | DataLink
104
+ }
105
+ events?: BrickBasicEvents & {
106
+ /* Event of the brick press */
107
+ onPress?: Array<EventAction>
108
+ /* Event of the brick press in */
109
+ onPressIn?: Array<EventAction>
110
+ /* Event of the brick press out */
111
+ onPressOut?: Array<EventAction>
112
+ /* Event of the brick long press */
113
+ onLongPress?: Array<EventAction>
114
+ /* Event of the brick focus (Use TV Device with controller) */
115
+ onFocus?: Array<EventAction>
116
+ /* Event of the brick blur (Use TV Device with controller) */
117
+ onBlur?: Array<EventAction>
118
+ /* Event of the animation finished */
119
+ onAnimationFinish?: Array<
120
+ EventAction<string & keyof TemplateEventPropsMap['Lottie']['onAnimationFinish']>
121
+ >
122
+ /* Event of the uri on load failed */
123
+ onAnimationFailure?: Array<
124
+ EventAction<string & keyof TemplateEventPropsMap['Lottie']['onAnimationFailure']>
125
+ >
126
+ /* Event of the animation on loop */
127
+ onAnimationLoop?: Array<EventAction>
128
+ }
129
+ outlets?: {
130
+ /* Brick is pressing */
131
+ brickPressing?: () => Data<boolean>
132
+ /* Brick is focusing (Use TV Device with controller) */
133
+ brickFocusing?: () => Data<boolean>
134
+ }
135
+ animation?: AnimationBasicEvents & {
136
+ onPress?: Animation
137
+ onPressIn?: Animation
138
+ onPressOut?: Animation
139
+ onLongPress?: Animation
140
+ onFocus?: Animation
141
+ onBlur?: Animation
142
+ onAnimationFinish?: Animation
143
+ onAnimationFailure?: Animation
144
+ onAnimationLoop?: Animation
145
+ }
146
+ }
147
+
148
+ /* Lottie animation player supporting .json and .dotlottie formats. Supports speed, loop, frame range control, color/text filters, and hardware rendering */
149
+ export type BrickLottie = Brick &
150
+ BrickLottieDef & {
151
+ templateKey: 'BRICK_LOTTIE'
152
+ switches?: Array<
153
+ SwitchDef &
154
+ BrickLottieDef & {
155
+ conds?: Array<{
156
+ method: '==' | '!=' | '>' | '<' | '>=' | '<='
157
+ cond:
158
+ | SwitchCondInnerStateCurrentCanvas
159
+ | SwitchCondData
160
+ | {
161
+ __typename: 'SwitchCondInnerStateOutlet'
162
+ outlet: 'brickPressing' | 'brickFocusing'
163
+ value: any
164
+ }
165
+ }>
166
+ }
167
+ >
168
+ }
@@ -0,0 +1,262 @@
1
+ /* Auto generated by build script
2
+ *
3
+ * Interactive map with markers, paths, and location tracking. Supports Google Maps (iOS/Android/Desktop/Web) and Apple Maps (iOS/tvOS)
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
+ /* Zoom in the map */
21
+ export type BrickMapsActionZoomIn = Action & {
22
+ __actionName: 'BRICK_MAPS_ZOOM_IN'
23
+ }
24
+
25
+ /* Zoom out the map */
26
+ export type BrickMapsActionZoomOut = Action & {
27
+ __actionName: 'BRICK_MAPS_ZOOM_OUT'
28
+ }
29
+
30
+ /* Pan the map in a direction */
31
+ export type BrickMapsActionPan = ActionWithParams & {
32
+ __actionName: 'BRICK_MAPS_PAN'
33
+ params?: Array<{
34
+ input: 'panDirection'
35
+ value?: 'up' | 'down' | 'left' | 'right' | DataLink | EventProperty
36
+ mapping?: string
37
+ }>
38
+ }
39
+
40
+ /* Navigate to a specific location */
41
+ export type BrickMapsActionNavigateTo = ActionWithParams & {
42
+ __actionName: 'BRICK_MAPS_NAVIGATE_TO'
43
+ params?: Array<
44
+ | {
45
+ input: 'targetLatitude'
46
+ value?: number | DataLink | EventProperty
47
+ mapping?: string
48
+ }
49
+ | {
50
+ input: 'targetLongitude'
51
+ value?: number | DataLink | EventProperty
52
+ mapping?: string
53
+ }
54
+ | {
55
+ input: 'targetZoom'
56
+ value?: number | DataLink | EventProperty
57
+ mapping?: string
58
+ }
59
+ >
60
+ }
61
+
62
+ /* Focus on a marker by ID */
63
+ export type BrickMapsActionFocusMarker = ActionWithParams & {
64
+ __actionName: 'BRICK_MAPS_FOCUS_MARKER'
65
+ params?: Array<{
66
+ input: 'markerId'
67
+ value?: string | DataLink | EventProperty
68
+ mapping?: string
69
+ }>
70
+ }
71
+
72
+ /* Reset map to initial position */
73
+ export type BrickMapsActionReset = Action & {
74
+ __actionName: 'BRICK_MAPS_RESET'
75
+ }
76
+
77
+ /* Fit map to show all markers */
78
+ export type BrickMapsActionFitToMarkers = ActionWithParams & {
79
+ __actionName: 'BRICK_MAPS_FIT_TO_MARKERS'
80
+ params?: Array<
81
+ | {
82
+ input: 'edgePadding'
83
+ value?: number | DataLink | EventProperty
84
+ mapping?: string
85
+ }
86
+ | {
87
+ input: 'animated'
88
+ value?: boolean | DataLink | EventProperty
89
+ mapping?: string
90
+ }
91
+ >
92
+ }
93
+
94
+ interface BrickMapsDef {
95
+ /*
96
+ Default property:
97
+ {
98
+ "provider": "google",
99
+ "apiKey": "",
100
+ "initialLatitude": 25.033,
101
+ "initialLongitude": 121.5654,
102
+ "initialZoom": 10,
103
+ "mapType": "standard",
104
+ "mapTheme": "standard",
105
+ "showUserLocation": false,
106
+ "showCompass": true,
107
+ "showZoomControls": true,
108
+ "scrollEnabled": true,
109
+ "zoomEnabled": true,
110
+ "rotateEnabled": true,
111
+ "markers": [],
112
+ "customMapStyle": [],
113
+ "showTraffic": false,
114
+ "showBuildings": false,
115
+ "showIndoors": true,
116
+ "minZoomLevel": 1,
117
+ "maxZoomLevel": 20,
118
+ "followUserLocation": false,
119
+ "showPath": false,
120
+ "pathStrokeColor": "#4285F4",
121
+ "pathStrokeWidth": 3
122
+ }
123
+ */
124
+ property?: BrickBasicProperty & {
125
+ /* Map provider (iOS/tvOS only - Android and Web always use Google Maps) */
126
+ provider?: 'google' | 'apple' | DataLink
127
+ /* Google Maps API Key (Web only) */
128
+ apiKey?: string | DataLink
129
+ /* Initial latitude */
130
+ initialLatitude?: number | DataLink
131
+ /* Initial longitude */
132
+ initialLongitude?: number | DataLink
133
+ /* Initial zoom level (1-20) */
134
+ initialZoom?: number | DataLink
135
+ /* Map type */
136
+ mapType?: 'standard' | 'satellite' | 'hybrid' | 'terrain' | DataLink
137
+ /* Map theme preset */
138
+ mapTheme?: 'standard' | 'dark' | 'night' | 'retro' | 'silver' | 'aubergine' | DataLink
139
+ /* Show user location button */
140
+ showUserLocation?: boolean | DataLink
141
+ /* Show compass */
142
+ showCompass?: boolean | DataLink
143
+ /* Show zoom controls */
144
+ showZoomControls?: boolean | DataLink
145
+ /* Enable scrolling */
146
+ scrollEnabled?: boolean | DataLink
147
+ /* Enable zooming */
148
+ zoomEnabled?: boolean | DataLink
149
+ /* Enable rotating */
150
+ rotateEnabled?: boolean | DataLink
151
+ /* Map markers data */
152
+ markers?:
153
+ | Array<
154
+ | DataLink
155
+ | {
156
+ id?: string | DataLink
157
+ latitude?: number | DataLink
158
+ longitude?: number | DataLink
159
+ title?: string | DataLink
160
+ description?: string | DataLink
161
+ color?: string | DataLink
162
+ icon?: string | DataLink
163
+ }
164
+ >
165
+ | DataLink
166
+ /* Custom map style (array of Google Maps style objects) */
167
+ customMapStyle?:
168
+ | Array<
169
+ | DataLink
170
+ | {
171
+ featureType?: string | DataLink
172
+ elementType?: string | DataLink
173
+ stylers?: Array<{} | DataLink> | DataLink
174
+ }
175
+ >
176
+ | DataLink
177
+ /* Show traffic layer */
178
+ showTraffic?: boolean | DataLink
179
+ /* Show buildings in 3D */
180
+ showBuildings?: boolean | DataLink
181
+ /* Show indoor maps */
182
+ showIndoors?: boolean | DataLink
183
+ /* Minimum zoom level */
184
+ minZoomLevel?: number | DataLink
185
+ /* Maximum zoom level */
186
+ maxZoomLevel?: number | DataLink
187
+ /* Follow user location */
188
+ followUserLocation?: boolean | DataLink
189
+ /* Show path between markers */
190
+ showPath?: boolean | DataLink
191
+ /* Path stroke color */
192
+ pathStrokeColor?: string | DataLink
193
+ /* Path stroke width */
194
+ pathStrokeWidth?: number | DataLink
195
+ }
196
+ events?: BrickBasicEvents & {
197
+ /* Event of the brick press */
198
+ onPress?: Array<EventAction>
199
+ /* Event of the brick press in */
200
+ onPressIn?: Array<EventAction>
201
+ /* Event of the brick press out */
202
+ onPressOut?: Array<EventAction>
203
+ /* Event of the brick long press */
204
+ onLongPress?: Array<EventAction>
205
+ /* Event of the brick focus (Use TV Device with controller) */
206
+ onFocus?: Array<EventAction>
207
+ /* Event of the brick blur (Use TV Device with controller) */
208
+ onBlur?: Array<EventAction>
209
+ /* Event when a marker is pressed */
210
+ onMarkerPress?: Array<
211
+ EventAction<string & keyof TemplateEventPropsMap['Maps']['onMarkerPress']>
212
+ >
213
+ /* Event when the map is pressed */
214
+ onMapPress?: Array<EventAction<string & keyof TemplateEventPropsMap['Maps']['onMapPress']>>
215
+ /* Event when the map region changes */
216
+ onRegionChange?: Array<
217
+ EventAction<string & keyof TemplateEventPropsMap['Maps']['onRegionChange']>
218
+ >
219
+ /* Event when the map is ready */
220
+ onReady?: Array<EventAction>
221
+ }
222
+ outlets?: {
223
+ /* Brick is pressing */
224
+ brickPressing?: () => Data<boolean>
225
+ /* Brick is focusing (Use TV Device with controller) */
226
+ brickFocusing?: () => Data<boolean>
227
+ }
228
+ animation?: AnimationBasicEvents & {
229
+ onPress?: Animation
230
+ onPressIn?: Animation
231
+ onPressOut?: Animation
232
+ onLongPress?: Animation
233
+ onFocus?: Animation
234
+ onBlur?: Animation
235
+ onMarkerPress?: Animation
236
+ onMapPress?: Animation
237
+ onRegionChange?: Animation
238
+ onReady?: Animation
239
+ }
240
+ }
241
+
242
+ /* Interactive map with markers, paths, and location tracking. Supports Google Maps (iOS/Android/Desktop/Web) and Apple Maps (iOS/tvOS) */
243
+ export type BrickMaps = Brick &
244
+ BrickMapsDef & {
245
+ templateKey: 'BRICK_MAPS'
246
+ switches?: Array<
247
+ SwitchDef &
248
+ BrickMapsDef & {
249
+ conds?: Array<{
250
+ method: '==' | '!=' | '>' | '<' | '>=' | '<='
251
+ cond:
252
+ | SwitchCondInnerStateCurrentCanvas
253
+ | SwitchCondData
254
+ | {
255
+ __typename: 'SwitchCondInnerStateOutlet'
256
+ outlet: 'brickPressing' | 'brickFocusing'
257
+ value: any
258
+ }
259
+ }>
260
+ }
261
+ >
262
+ }
@@ -0,0 +1,117 @@
1
+ /* Auto generated by build script
2
+ *
3
+ * Generate and display QR codes from text or URL values
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 BrickQrcodeDef {
21
+ /*
22
+ Default property:
23
+ {
24
+ "value": "",
25
+ "positiveColor": "#1e252a",
26
+ "negativeColor": "transparent",
27
+ "padding": 0,
28
+ "linearGradientEnabled": false,
29
+ "linearGradientStart": "black",
30
+ "linearGradientEnd": "black",
31
+ "linearGradientDirection": [
32
+ "0%",
33
+ "0%",
34
+ "100%",
35
+ "100%"
36
+ ],
37
+ "logoSize": 20,
38
+ "logoBackgroundColor": "transparent"
39
+ }
40
+ */
41
+ property?: BrickBasicProperty & {
42
+ /* The QRCode content */
43
+ value?: string | DataLink
44
+ /* The foreground color of QRCode */
45
+ positiveColor?: string | DataLink
46
+ /* The background color of QRCode */
47
+ negativeColor?: string | DataLink
48
+ /* Quiet zone around the qr */
49
+ padding?: number | DataLink
50
+ /* Enables or disables linear gradient */
51
+ linearGradientEnabled?: boolean | DataLink
52
+ /* Linear gradient start color */
53
+ linearGradientStart?: string | DataLink
54
+ /* Linear gradient end color */
55
+ linearGradientEnd?: string | DataLink
56
+ /* Linear gradient direction ('0%', '0%', '100%', '100%') */
57
+ linearGradientDirection?: Array<string | DataLink> | DataLink
58
+ /* Logo image source */
59
+ logoPath?: string | DataLink
60
+ /* The checksum of logo file */
61
+ md5?: string | DataLink
62
+ /* Logo image size (% of QRCode) */
63
+ logoSize?: number | DataLink
64
+ /* The logo gets a filled quadratic background with this color. */
65
+ logoBackgroundColor?: string | DataLink
66
+ }
67
+ events?: BrickBasicEvents & {
68
+ /* Event of the brick press */
69
+ onPress?: Array<EventAction>
70
+ /* Event of the brick press in */
71
+ onPressIn?: Array<EventAction>
72
+ /* Event of the brick press out */
73
+ onPressOut?: Array<EventAction>
74
+ /* Event of the brick long press */
75
+ onLongPress?: Array<EventAction>
76
+ /* Event of the brick focus (Use TV Device with controller) */
77
+ onFocus?: Array<EventAction>
78
+ /* Event of the brick blur (Use TV Device with controller) */
79
+ onBlur?: Array<EventAction>
80
+ }
81
+ outlets?: {
82
+ /* Brick is pressing */
83
+ brickPressing?: () => Data<boolean>
84
+ /* Brick is focusing (Use TV Device with controller) */
85
+ brickFocusing?: () => Data<boolean>
86
+ }
87
+ animation?: AnimationBasicEvents & {
88
+ onPress?: Animation
89
+ onPressIn?: Animation
90
+ onPressOut?: Animation
91
+ onLongPress?: Animation
92
+ onFocus?: Animation
93
+ onBlur?: Animation
94
+ }
95
+ }
96
+
97
+ /* Generate and display QR codes from text or URL values */
98
+ export type BrickQrcode = Brick &
99
+ BrickQrcodeDef & {
100
+ templateKey: 'BRICK_QRCODE'
101
+ switches?: Array<
102
+ SwitchDef &
103
+ BrickQrcodeDef & {
104
+ conds?: Array<{
105
+ method: '==' | '!=' | '>' | '<' | '>=' | '<='
106
+ cond:
107
+ | SwitchCondInnerStateCurrentCanvas
108
+ | SwitchCondData
109
+ | {
110
+ __typename: 'SwitchCondInnerStateOutlet'
111
+ outlet: 'brickPressing' | 'brickFocusing'
112
+ value: any
113
+ }
114
+ }>
115
+ }
116
+ >
117
+ }
@@ -0,0 +1,150 @@
1
+ /* Auto generated by build script
2
+ *
3
+ * Rectangle shape with customizable fill, border, radius, shadow, and blur
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 BrickRectDef {
21
+ /*
22
+ Default property:
23
+ {
24
+ "linearGradientEnabled": false,
25
+ "linearGradientColors": [
26
+ "#000000",
27
+ "#FFFFFF"
28
+ ],
29
+ "linearGradientStart": {
30
+ "x": 0,
31
+ "y": 0
32
+ },
33
+ "linearGradientEnd": {
34
+ "x": 1,
35
+ "y": 1
36
+ },
37
+ "linearGradientLocations": [
38
+ 0,
39
+ 1
40
+ ],
41
+ "blurEnabled": false,
42
+ "blurVariant": "blur",
43
+ "blurType": "light",
44
+ "blurAmount": 10,
45
+ "blurDirection": "blurredTopClearBottom",
46
+ "blurStartOffset": 0,
47
+ "blurGlassType": "regular",
48
+ "blurGlassOpacity": 0.5,
49
+ "blurGlassInteractive": false
50
+ }
51
+ */
52
+ property?: BrickBasicProperty & {
53
+ /* Enables or disables linear gradient */
54
+ linearGradientEnabled?: boolean | DataLink
55
+ /* An array of at least two color values that represent gradient colors */
56
+ linearGradientColors?: Array<string | DataLink> | DataLink
57
+ /* An optional object of the following type: { x: number, y: number } */
58
+ linearGradientStart?:
59
+ | DataLink
60
+ | {
61
+ x?: number | DataLink
62
+ y?: number | DataLink
63
+ }
64
+ /* Same as start, but for the end of the gradient */
65
+ linearGradientEnd?:
66
+ | DataLink
67
+ | {
68
+ x?: number | DataLink
69
+ y?: number | DataLink
70
+ }
71
+ /* An optional array of numbers defining the location of each gradient color stop */
72
+ linearGradientLocations?: Array<number | DataLink> | DataLink
73
+ /* Enable blur effect.
74
+ Not supported on Desktop (Electron) and Web.
75
+ Avoid using opacity prop with blur — use alpha backgroundColor (e.g. rgba) instead. */
76
+ blurEnabled?: boolean | DataLink
77
+ /* Blur variant */
78
+ blurVariant?: 'blur' | 'progressiveBlur' | 'liquidGlass' | DataLink
79
+ /* Blur type (blur variant) */
80
+ blurType?: 'xlight' | 'light' | 'dark' | 'regular' | 'prominent' | DataLink
81
+ /* Blur amount (0 ~ 100, blur variant) */
82
+ blurAmount?: number | DataLink
83
+ /* Progressive blur direction (progressiveBlur variant) */
84
+ blurDirection?:
85
+ | 'blurredTopClearBottom'
86
+ | 'blurredBottomClearTop'
87
+ | 'blurredCenterClearTopAndBottom'
88
+ | DataLink
89
+ /* Progressive blur start offset (0 ~ 1, progressiveBlur variant) */
90
+ blurStartOffset?: number | DataLink
91
+ /* Glass type (liquidGlass variant, iOS 26+) */
92
+ blurGlassType?: 'clear' | 'regular' | DataLink
93
+ /* Glass tint color (liquidGlass variant) */
94
+ blurGlassTintColor?: string | DataLink
95
+ /* Glass opacity (0 ~ 1, liquidGlass variant) */
96
+ blurGlassOpacity?: number | DataLink
97
+ /* Enable glass interaction (liquidGlass variant) */
98
+ blurGlassInteractive?: boolean | DataLink
99
+ }
100
+ events?: BrickBasicEvents & {
101
+ /* Event of the brick press */
102
+ onPress?: Array<EventAction>
103
+ /* Event of the brick press in */
104
+ onPressIn?: Array<EventAction>
105
+ /* Event of the brick press out */
106
+ onPressOut?: Array<EventAction>
107
+ /* Event of the brick long press */
108
+ onLongPress?: Array<EventAction>
109
+ /* Event of the brick focus (Use TV Device with controller) */
110
+ onFocus?: Array<EventAction>
111
+ /* Event of the brick blur (Use TV Device with controller) */
112
+ onBlur?: Array<EventAction>
113
+ }
114
+ outlets?: {
115
+ /* Brick is pressing */
116
+ brickPressing?: () => Data<boolean>
117
+ /* Brick is focusing (Use TV Device with controller) */
118
+ brickFocusing?: () => Data<boolean>
119
+ }
120
+ animation?: AnimationBasicEvents & {
121
+ onPress?: Animation
122
+ onPressIn?: Animation
123
+ onPressOut?: Animation
124
+ onLongPress?: Animation
125
+ onFocus?: Animation
126
+ onBlur?: Animation
127
+ }
128
+ }
129
+
130
+ /* Rectangle shape with customizable fill, border, radius, shadow, and blur */
131
+ export type BrickRect = Brick &
132
+ BrickRectDef & {
133
+ templateKey: 'BRICK_RECT'
134
+ switches?: Array<
135
+ SwitchDef &
136
+ BrickRectDef & {
137
+ conds?: Array<{
138
+ method: '==' | '!=' | '>' | '<' | '>=' | '<='
139
+ cond:
140
+ | SwitchCondInnerStateCurrentCanvas
141
+ | SwitchCondData
142
+ | {
143
+ __typename: 'SwitchCondInnerStateOutlet'
144
+ outlet: 'brickPressing' | 'brickFocusing'
145
+ value: any
146
+ }
147
+ }>
148
+ }
149
+ >
150
+ }