@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,128 @@
1
+ /* Auto generated by build script
2
+ *
3
+ * Rich text with HTML content rendering, multiple fonts, colors, heading levels (h1-h6), and inline images
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 BrickRichTextDef {
21
+ /*
22
+ Default property:
23
+ {
24
+ "content": "",
25
+ "renderImage": false,
26
+ "color": "#000",
27
+ "fontWeight": "normal",
28
+ "fontStyle": "normal",
29
+ "fontSizes": {
30
+ "base": 3,
31
+ "h1": 6.857142857142857,
32
+ "h2": 5.714285714285714,
33
+ "h3": 4.011428571428572,
34
+ "h4": 3.428571428571429,
35
+ "h5": 2.845714285714286,
36
+ "h6": 2.285714285714286
37
+ }
38
+ }
39
+ */
40
+ property?: BrickBasicProperty & {
41
+ /* The text content */
42
+ content?: string | DataLink
43
+ /* Render Image */
44
+ renderImage?: boolean | DataLink
45
+ /* The text color */
46
+ color?: string | DataLink
47
+ /* Specifies font weight. The values 'normal' and are supported for most fonts. Not all fonts have a variant for each of the numeric values, in that case the closest one is chosen. */
48
+ fontWeight?:
49
+ | 'normal'
50
+ | 'bold'
51
+ | '100'
52
+ | '200'
53
+ | '300'
54
+ | '400'
55
+ | '500'
56
+ | '600'
57
+ | '700'
58
+ | '800'
59
+ | '900'
60
+ | DataLink
61
+ /* The text font style */
62
+ fontStyle?: 'normal' | 'italic' | DataLink
63
+ /* The text font family */
64
+ fontFamily?: string | DataLink
65
+ /* The text font size definition (base and headers) */
66
+ fontSizes?:
67
+ | DataLink
68
+ | {
69
+ base?: number | DataLink // BRICKS Grid unit
70
+ h1?: number | DataLink // BRICKS Grid unit
71
+ h2?: number | DataLink // BRICKS Grid unit
72
+ h3?: number | DataLink // BRICKS Grid unit
73
+ h4?: number | DataLink // BRICKS Grid unit
74
+ h5?: number | DataLink // BRICKS Grid unit
75
+ h6?: number | DataLink // BRICKS Grid unit
76
+ }
77
+ }
78
+ events?: BrickBasicEvents & {
79
+ /* Event of the brick press */
80
+ onPress?: Array<EventAction>
81
+ /* Event of the brick press in */
82
+ onPressIn?: Array<EventAction>
83
+ /* Event of the brick press out */
84
+ onPressOut?: Array<EventAction>
85
+ /* Event of the brick long press */
86
+ onLongPress?: Array<EventAction>
87
+ /* Event of the brick focus (Use TV Device with controller) */
88
+ onFocus?: Array<EventAction>
89
+ /* Event of the brick blur (Use TV Device with controller) */
90
+ onBlur?: Array<EventAction>
91
+ }
92
+ outlets?: {
93
+ /* Brick is pressing */
94
+ brickPressing?: () => Data<boolean>
95
+ /* Brick is focusing (Use TV Device with controller) */
96
+ brickFocusing?: () => Data<boolean>
97
+ }
98
+ animation?: AnimationBasicEvents & {
99
+ onPress?: Animation
100
+ onPressIn?: Animation
101
+ onPressOut?: Animation
102
+ onLongPress?: Animation
103
+ onFocus?: Animation
104
+ onBlur?: Animation
105
+ }
106
+ }
107
+
108
+ /* Rich text with HTML content rendering, multiple fonts, colors, heading levels (h1-h6), and inline images */
109
+ export type BrickRichText = Brick &
110
+ BrickRichTextDef & {
111
+ templateKey: 'BRICK_RICH_TEXT'
112
+ switches?: Array<
113
+ SwitchDef &
114
+ BrickRichTextDef & {
115
+ conds?: Array<{
116
+ method: '==' | '!=' | '>' | '<' | '>=' | '<='
117
+ cond:
118
+ | SwitchCondInnerStateCurrentCanvas
119
+ | SwitchCondData
120
+ | {
121
+ __typename: 'SwitchCondInnerStateOutlet'
122
+ outlet: 'brickPressing' | 'brickFocusing'
123
+ value: any
124
+ }
125
+ }>
126
+ }
127
+ >
128
+ }
@@ -0,0 +1,220 @@
1
+ /* Auto generated by build script
2
+ *
3
+ * Render Rive (.riv) animations with state machine input control, text run updates, and artboard selection
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 BrickRiveActionPlay = ActionWithParams & {
22
+ __actionName: 'BRICK_RIVE_PLAY'
23
+ params?: Array<
24
+ | {
25
+ input: 'animationName'
26
+ value?: string | DataLink | EventProperty
27
+ mapping?: string
28
+ }
29
+ | {
30
+ input: 'loop'
31
+ value?: 'auto' | 'oneShot' | 'loop' | 'pingPong' | DataLink | EventProperty
32
+ mapping?: string
33
+ }
34
+ | {
35
+ input: 'direction'
36
+ value?: 'auto' | 'backwards' | 'forwards' | DataLink | EventProperty
37
+ mapping?: string
38
+ }
39
+ | {
40
+ input: 'isStateMachine'
41
+ value?: boolean | DataLink | EventProperty
42
+ mapping?: string
43
+ }
44
+ >
45
+ }
46
+
47
+ /* Pause animation */
48
+ export type BrickRiveActionPause = Action & {
49
+ __actionName: 'BRICK_RIVE_PAUSE'
50
+ }
51
+
52
+ /* Stop animation */
53
+ export type BrickRiveActionStop = Action & {
54
+ __actionName: 'BRICK_RIVE_STOP'
55
+ }
56
+
57
+ /* Reset animation */
58
+ export type BrickRiveActionReset = Action & {
59
+ __actionName: 'BRICK_RIVE_RESET'
60
+ }
61
+
62
+ /* Fire state */
63
+ export type BrickRiveActionFireState = ActionWithParams & {
64
+ __actionName: 'BRICK_RIVE_FIRE_STATE'
65
+ params?: Array<
66
+ | {
67
+ input: 'stateMachineName'
68
+ value?: string | DataLink | EventProperty
69
+ mapping?: string
70
+ }
71
+ | {
72
+ input: 'inputName'
73
+ value?: string | DataLink | EventProperty
74
+ mapping?: string
75
+ }
76
+ >
77
+ }
78
+
79
+ /* Set input state */
80
+ export type BrickRiveActionSetInputState = ActionWithParams & {
81
+ __actionName: 'BRICK_RIVE_SET_INPUT_STATE'
82
+ params?: Array<
83
+ | {
84
+ input: 'stateMachineName'
85
+ value?: string | DataLink | EventProperty
86
+ mapping?: string
87
+ }
88
+ | {
89
+ input: 'inputName'
90
+ value?: string | DataLink | EventProperty
91
+ mapping?: string
92
+ }
93
+ | {
94
+ input: 'value'
95
+ value?: any | EventProperty
96
+ mapping?: string
97
+ }
98
+ >
99
+ }
100
+
101
+ /* Set text run value. Text Run name need to defined as unique name in Rive file. (Ref: https://rive.app/community/doc/text/docn2E6y1lXo) */
102
+ export type BrickRiveActionSetTextRunValue = ActionWithParams & {
103
+ __actionName: 'BRICK_RIVE_SET_TEXT_RUN_VALUE'
104
+ params?: Array<
105
+ | {
106
+ input: 'textRunName'
107
+ value?: string | DataLink | EventProperty
108
+ mapping?: string
109
+ }
110
+ | {
111
+ input: 'value'
112
+ value?: any | EventProperty
113
+ mapping?: string
114
+ }
115
+ >
116
+ }
117
+
118
+ interface BrickRiveDef {
119
+ /*
120
+ Default property:
121
+ {
122
+ "autoplay": true,
123
+ "alignment": "center",
124
+ "fit": "contain"
125
+ }
126
+ */
127
+ property?: BrickBasicProperty & {
128
+ /* Rive file url */
129
+ url?: string | DataLink
130
+ /* The checksum of `url` */
131
+ md5?: string | DataLink
132
+ /* Autoplay the animation */
133
+ autoplay?: boolean | DataLink
134
+ /* Alignment of the animation */
135
+ alignment?:
136
+ | 'topLeft'
137
+ | 'topCenter'
138
+ | 'topRight'
139
+ | 'centerLeft'
140
+ | 'center'
141
+ | 'centerRight'
142
+ | 'bottomLeft'
143
+ | 'bottomCenter'
144
+ | 'bottomRight'
145
+ | DataLink
146
+ /* Fit mode of the animation */
147
+ fit?:
148
+ | 'cover'
149
+ | 'contain'
150
+ | 'fill'
151
+ | 'fitWidth'
152
+ | 'fitHeight'
153
+ | 'none'
154
+ | 'scaleDown'
155
+ | 'layout'
156
+ | DataLink
157
+ /* Artboard name */
158
+ artboardName?: string | DataLink
159
+ /* Animation name */
160
+ animationName?: string | DataLink
161
+ /* State machine name */
162
+ stateMachineName?: string | DataLink
163
+ }
164
+ events?: BrickBasicEvents & {
165
+ /* Event of animation play */
166
+ onPlay?: Array<EventAction<string & keyof TemplateEventPropsMap['Rive']['onPlay']>>
167
+ /* Event of animation pause */
168
+ onPause?: Array<EventAction<string & keyof TemplateEventPropsMap['Rive']['onPause']>>
169
+ /* Event of animation stop */
170
+ onStop?: Array<EventAction<string & keyof TemplateEventPropsMap['Rive']['onStop']>>
171
+ /* Event of animation loop end */
172
+ onLoopEnd?: Array<EventAction<string & keyof TemplateEventPropsMap['Rive']['onLoopEnd']>>
173
+ /* Event of state changed */
174
+ onStateChanged?: Array<
175
+ EventAction<string & keyof TemplateEventPropsMap['Rive']['onStateChanged']>
176
+ >
177
+ /* Event of error */
178
+ onError?: Array<EventAction<string & keyof TemplateEventPropsMap['Rive']['onError']>>
179
+ /* Event of Rive general event received */
180
+ onRiveGeneralEvent?: Array<
181
+ EventAction<string & keyof TemplateEventPropsMap['Rive']['onRiveGeneralEvent']>
182
+ >
183
+ /* Event of Rive open-url event received */
184
+ onRiveOpenUrlEvent?: Array<
185
+ EventAction<string & keyof TemplateEventPropsMap['Rive']['onRiveOpenUrlEvent']>
186
+ >
187
+ }
188
+ animation?: AnimationBasicEvents & {
189
+ onPlay?: Animation
190
+ onPause?: Animation
191
+ onStop?: Animation
192
+ onLoopEnd?: Animation
193
+ onStateChanged?: Animation
194
+ onError?: Animation
195
+ onRiveGeneralEvent?: Animation
196
+ onRiveOpenUrlEvent?: Animation
197
+ }
198
+ }
199
+
200
+ /* Render Rive (.riv) animations with state machine input control, text run updates, and artboard selection */
201
+ export type BrickRive = Brick &
202
+ BrickRiveDef & {
203
+ templateKey: 'BRICK_RIVE'
204
+ switches?: Array<
205
+ SwitchDef &
206
+ BrickRiveDef & {
207
+ conds?: Array<{
208
+ method: '==' | '!=' | '>' | '<' | '>=' | '<='
209
+ cond:
210
+ | SwitchCondInnerStateCurrentCanvas
211
+ | SwitchCondData
212
+ | {
213
+ __typename: 'SwitchCondInnerStateOutlet'
214
+ outlet: ''
215
+ value: any
216
+ }
217
+ }>
218
+ }
219
+ >
220
+ }
@@ -0,0 +1,201 @@
1
+ /* Auto generated by build script
2
+ *
3
+ * Auto-advancing slideshow of child bricks with transition effects
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
+ /* Jump to a specific index in the slideshow */
21
+ export type BrickSlideshowActionJumpToIndex = ActionWithParams & {
22
+ __actionName: 'BRICK_SLIDESHOW_JUMP_TO_INDEX'
23
+ params?: Array<
24
+ | {
25
+ input: 'index'
26
+ value?: number | DataLink | EventProperty
27
+ mapping?: string
28
+ }
29
+ | {
30
+ input: 'reset'
31
+ value?: boolean | DataLink | EventProperty
32
+ mapping?: string
33
+ }
34
+ | {
35
+ input: 'shuffle'
36
+ value?: boolean | DataLink | EventProperty
37
+ mapping?: string
38
+ }
39
+ >
40
+ }
41
+
42
+ /* Play the slideshow (resume if paused) */
43
+ export type BrickSlideshowActionPlay = Action & {
44
+ __actionName: 'BRICK_SLIDESHOW_PLAY'
45
+ }
46
+
47
+ /* Pause the slideshow */
48
+ export type BrickSlideshowActionPause = Action & {
49
+ __actionName: 'BRICK_SLIDESHOW_PAUSE'
50
+ }
51
+
52
+ /* Go to next slide */
53
+ export type BrickSlideshowActionNext = Action & {
54
+ __actionName: 'BRICK_SLIDESHOW_NEXT'
55
+ }
56
+
57
+ /* Go to previous slide */
58
+ export type BrickSlideshowActionPrev = Action & {
59
+ __actionName: 'BRICK_SLIDESHOW_PREV'
60
+ }
61
+
62
+ interface BrickSlideshowDef {
63
+ /*
64
+ Default property:
65
+ {
66
+ "countdown": 2000,
67
+ "loop": true,
68
+ "shuffle": false,
69
+ "photoResizeMode": "contain",
70
+ "photoLoadSystemIos": "auto",
71
+ "photoLoadSystemAndroid": "auto",
72
+ "videoResizeMode": "contain",
73
+ "videoAutoAspectRatio": false,
74
+ "videoVolume": 100,
75
+ "videoMuted": false,
76
+ "videoRenderMode": "auto",
77
+ "fadeDuration": 0,
78
+ "emptyViewText": "no available image item to show",
79
+ "emptyViewTextSize": 44,
80
+ "emptyViewTextColor": "#fff",
81
+ "enableBlurBackground": false,
82
+ "blurBackgroundRadius": 8
83
+ }
84
+ */
85
+ property?: BrickBasicProperty & {
86
+ /* The time interval of show for each photo */
87
+ countdown?: number | DataLink
88
+ /* The slideshow media path list (File, URL)
89
+ Each path object can override global photo/video settings.
90
+ Item-level properties take precedence over brick-level properties. */
91
+ paths?:
92
+ | Array<
93
+ | DataLink
94
+ | {
95
+ url?: string | DataLink
96
+ mediaType?: 'video' | 'video-streaming' | 'photo' | DataLink
97
+ photoResizeMode?: 'contain' | 'cover' | 'stretch' | 'center' | 'repeat' | DataLink
98
+ photoLoadSystemIos?: 'auto' | 'sdwebimage' | 'default' | DataLink
99
+ photoLoadSystemAndroid?: 'auto' | 'glide' | 'fresco' | DataLink
100
+ videoResizeMode?: 'contain' | 'cover' | 'stretch' | DataLink
101
+ videoAutoAspectRatio?: boolean | DataLink
102
+ videoAspectRatio?: string | DataLink
103
+ videoVolume?: number | DataLink
104
+ videoMuted?: boolean | DataLink
105
+ videoRenderMode?: 'auto' | 'texture' | 'surface' | DataLink
106
+ }
107
+ >
108
+ | DataLink
109
+ /* Multiple slideshow media path lists to combine (Array of path arrays).
110
+ All arrays are flattened and combined: [...paths, ...pathsList[0], ...pathsList[1], ...] */
111
+ pathsList?: Array<Array<any> | DataLink | DataLink> | DataLink
112
+ /* Loop the slideshow */
113
+ loop?: boolean | DataLink
114
+ /* Shuffle the slideshow */
115
+ shuffle?: boolean | DataLink
116
+ /* Slideshow Photo resize mode */
117
+ photoResizeMode?: 'contain' | 'cover' | 'stretch' | 'center' | 'repeat' | DataLink
118
+ /* [iOS] The use priority of image loading system (Auto: sdwebimage, fallback to default if failed) */
119
+ photoLoadSystemIos?: 'auto' | 'sdwebimage' | 'default' | DataLink
120
+ /* [Android] The use priority of image loading system (Auto: glide, fallback to fresco if failed) */
121
+ photoLoadSystemAndroid?: 'auto' | 'glide' | 'fresco' | DataLink
122
+ /* Slideshow Video resize mode */
123
+ videoResizeMode?: 'contain' | 'cover' | 'stretch' | DataLink
124
+ /* Video Auto Aspect Ratio for use Video Streaming */
125
+ videoAutoAspectRatio?: boolean | DataLink
126
+ /* Video Aspect Ratio for use Video Streaming */
127
+ videoAspectRatio?: string | DataLink
128
+ /* Video Volume */
129
+ videoVolume?: number | DataLink
130
+ /* Video Muted */
131
+ videoMuted?: boolean | DataLink
132
+ /* [Android only] Use what view type for render video (Auto / Texture or Surface). Notice: Although using surface has better performance, it also affects the Animation & Standby Transition used by itself */
133
+ videoRenderMode?: 'auto' | 'texture' | 'surface' | DataLink
134
+ /* The photo fade duration */
135
+ fadeDuration?: number | DataLink
136
+ /* Show text content if path list is empty */
137
+ emptyViewText?: string | DataLink
138
+ /* The font size of shown text content if path list is empty */
139
+ emptyViewTextSize?: number | DataLink
140
+ /* The color of shown text content if path list is empty */
141
+ emptyViewTextColor?: string | DataLink
142
+ /* Show emptyViewText when timeout and paths is empty */
143
+ emptyViewTimeout?: number | DataLink
144
+ /* The blur radius of the blur filter added to the image */
145
+ blurRadius?: number | DataLink
146
+ /* Add blurred image at background if photo is not full */
147
+ enableBlurBackground?: boolean | DataLink
148
+ /* The blur radius of the blur filter added to the image background */
149
+ blurBackgroundRadius?: number | DataLink
150
+ }
151
+ events?: BrickBasicEvents & {
152
+ /* Event of the next slideshow on change start */
153
+ changeStart?: Array<
154
+ EventAction<string & keyof TemplateEventPropsMap['Slideshow']['changeStart']>
155
+ >
156
+ /* Event of the next slideshow on change end */
157
+ changeEnd?: Array<EventAction<string & keyof TemplateEventPropsMap['Slideshow']['changeEnd']>>
158
+ /* Event on paths change */
159
+ contentChange?: Array<
160
+ EventAction<string & keyof TemplateEventPropsMap['Slideshow']['contentChange']>
161
+ >
162
+ /* Event on plays of paths are end */
163
+ roundEnd?: Array<EventAction<string & keyof TemplateEventPropsMap['Slideshow']['roundEnd']>>
164
+ /* Event of the slideshow on load */
165
+ mediaOnLoad?: Array<EventAction>
166
+ /* Event of the slideshow media loading error */
167
+ mediaOnError?: Array<
168
+ EventAction<string & keyof TemplateEventPropsMap['Slideshow']['mediaOnError']>
169
+ >
170
+ }
171
+ animation?: AnimationBasicEvents & {
172
+ changeStart?: Animation
173
+ changeEnd?: Animation
174
+ contentChange?: Animation
175
+ roundEnd?: Animation
176
+ mediaOnLoad?: Animation
177
+ mediaOnError?: Animation
178
+ }
179
+ }
180
+
181
+ /* Auto-advancing slideshow of child bricks with transition effects */
182
+ export type BrickSlideshow = Brick &
183
+ BrickSlideshowDef & {
184
+ templateKey: 'BRICK_SLIDESHOW'
185
+ switches?: Array<
186
+ SwitchDef &
187
+ BrickSlideshowDef & {
188
+ conds?: Array<{
189
+ method: '==' | '!=' | '>' | '<' | '>=' | '<='
190
+ cond:
191
+ | SwitchCondInnerStateCurrentCanvas
192
+ | SwitchCondData
193
+ | {
194
+ __typename: 'SwitchCondInnerStateOutlet'
195
+ outlet: ''
196
+ value: any
197
+ }
198
+ }>
199
+ }
200
+ >
201
+ }
@@ -0,0 +1,99 @@
1
+ /* Auto generated by build script
2
+ *
3
+ * SVG is an XML-based vector image format for 2D graphics
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 BrickSvgDef {
21
+ /*
22
+ Default property:
23
+ {
24
+ "source": "",
25
+ "uri": "",
26
+ "renderMode": "general"
27
+ }
28
+ */
29
+ property?: BrickBasicProperty & {
30
+ /* The SVG XML content */
31
+ source?: string | DataLink
32
+ /* The svg source location (URL or LocalPath) */
33
+ uri?: string | DataLink
34
+ /* The checksum of file */
35
+ md5?: string | DataLink
36
+ /* The rules of replacing origin colour */
37
+ colorMapping?:
38
+ | Array<
39
+ | DataLink
40
+ | {
41
+ findItem?: string | DataLink
42
+ replaceItem?: string | DataLink
43
+ }
44
+ >
45
+ | DataLink
46
+ /* The render mode */
47
+ renderMode?: 'general' | 'legacy' | DataLink
48
+ }
49
+ events?: BrickBasicEvents & {
50
+ /* Event of the brick press */
51
+ onPress?: Array<EventAction>
52
+ /* Event of the brick press in */
53
+ onPressIn?: Array<EventAction>
54
+ /* Event of the brick press out */
55
+ onPressOut?: Array<EventAction>
56
+ /* Event of the brick long press */
57
+ onLongPress?: Array<EventAction>
58
+ /* Event of the brick focus (Use TV Device with controller) */
59
+ onFocus?: Array<EventAction>
60
+ /* Event of the brick blur (Use TV Device with controller) */
61
+ onBlur?: Array<EventAction>
62
+ }
63
+ outlets?: {
64
+ /* Brick is pressing */
65
+ brickPressing?: () => Data<boolean>
66
+ /* Brick is focusing (Use TV Device with controller) */
67
+ brickFocusing?: () => Data<boolean>
68
+ }
69
+ animation?: AnimationBasicEvents & {
70
+ onPress?: Animation
71
+ onPressIn?: Animation
72
+ onPressOut?: Animation
73
+ onLongPress?: Animation
74
+ onFocus?: Animation
75
+ onBlur?: Animation
76
+ }
77
+ }
78
+
79
+ /* SVG is an XML-based vector image format for 2D graphics */
80
+ export type BrickSvg = Brick &
81
+ BrickSvgDef & {
82
+ templateKey: 'BRICK_SVG'
83
+ switches?: Array<
84
+ SwitchDef &
85
+ BrickSvgDef & {
86
+ conds?: Array<{
87
+ method: '==' | '!=' | '>' | '<' | '>=' | '<='
88
+ cond:
89
+ | SwitchCondInnerStateCurrentCanvas
90
+ | SwitchCondData
91
+ | {
92
+ __typename: 'SwitchCondInnerStateOutlet'
93
+ outlet: 'brickPressing' | 'brickFocusing'
94
+ value: any
95
+ }
96
+ }>
97
+ }
98
+ >
99
+ }