@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,98 @@
1
+ /* Auto generated by build script
2
+ *
3
+ * Display Font Awesome 6 Pro icons. Supports Solid, Regular, Light, Duotone, Thin, Brands, and Sharp styles
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 BrickIconDef {
21
+ /*
22
+ Default property:
23
+ {}
24
+ */
25
+ property?: BrickBasicProperty & {
26
+ /* Select icon */
27
+ icon?:
28
+ | DataLink
29
+ | {
30
+ type?:
31
+ | 'solid'
32
+ | 'regular'
33
+ | 'light'
34
+ | 'duotone'
35
+ | 'thin'
36
+ | 'brands'
37
+ | 'sharpSolid'
38
+ | 'sharpLight'
39
+ | 'sharpRegular'
40
+ | DataLink
41
+ name?: string | DataLink
42
+ }
43
+ /* Icon main color */
44
+ color?: string | DataLink
45
+ /* Icon secondary color (For Duotone type) */
46
+ secondaryColor?: string | DataLink
47
+ }
48
+ events?: BrickBasicEvents & {
49
+ /* Event of the brick press */
50
+ onPress?: Array<EventAction>
51
+ /* Event of the brick press in */
52
+ onPressIn?: Array<EventAction>
53
+ /* Event of the brick press out */
54
+ onPressOut?: Array<EventAction>
55
+ /* Event of the brick long press */
56
+ onLongPress?: Array<EventAction>
57
+ /* Event of the brick focus (Use TV Device with controller) */
58
+ onFocus?: Array<EventAction>
59
+ /* Event of the brick blur (Use TV Device with controller) */
60
+ onBlur?: Array<EventAction>
61
+ }
62
+ outlets?: {
63
+ /* Brick is pressing */
64
+ brickPressing?: () => Data<boolean>
65
+ /* Brick is focusing (Use TV Device with controller) */
66
+ brickFocusing?: () => Data<boolean>
67
+ }
68
+ animation?: AnimationBasicEvents & {
69
+ onPress?: Animation
70
+ onPressIn?: Animation
71
+ onPressOut?: Animation
72
+ onLongPress?: Animation
73
+ onFocus?: Animation
74
+ onBlur?: Animation
75
+ }
76
+ }
77
+
78
+ /* Display Font Awesome 6 Pro icons. Supports Solid, Regular, Light, Duotone, Thin, Brands, and Sharp styles */
79
+ export type BrickIcon = Brick &
80
+ BrickIconDef & {
81
+ templateKey: 'BRICK_ICON'
82
+ switches?: Array<
83
+ SwitchDef &
84
+ BrickIconDef & {
85
+ conds?: Array<{
86
+ method: '==' | '!=' | '>' | '<' | '>=' | '<='
87
+ cond:
88
+ | SwitchCondInnerStateCurrentCanvas
89
+ | SwitchCondData
90
+ | {
91
+ __typename: 'SwitchCondInnerStateOutlet'
92
+ outlet: 'brickPressing' | 'brickFocusing'
93
+ value: any
94
+ }
95
+ }>
96
+ }
97
+ >
98
+ }
@@ -0,0 +1,114 @@
1
+ /* Auto generated by build script
2
+ *
3
+ * Display images from URL or local assets with resize modes and caching
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 BrickImageDef {
21
+ /*
22
+ Default property:
23
+ {
24
+ "path": "",
25
+ "templateType": "${}",
26
+ "fadeDuration": 0,
27
+ "blurBackgroundRadius": 8,
28
+ "loadSystemIos": "auto",
29
+ "loadSystemAndroid": "auto"
30
+ }
31
+ */
32
+ property?: BrickBasicProperty & {
33
+ /* The image resize mode */
34
+ resizeMode?: 'contain' | 'cover' | 'stretch' | 'center' | 'repeat' | DataLink
35
+ /* The image file path (File, URL) */
36
+ path?: string | DataLink
37
+ /* Data to be used in the path template (e.g. `https://example.com/${id}.png`). Supports nested data, such as `${user.avatar}`. */
38
+ templateData?: {} | DataLink
39
+ /* The path template type */
40
+ templateType?: '${}' | '{{}}' | DataLink
41
+ /* The checksum of file */
42
+ md5?: string | DataLink
43
+ /* The image fade duration */
44
+ fadeDuration?: number | DataLink
45
+ /* The image avatar mode */
46
+ avatar?: boolean | DataLink
47
+ /* The image fixed width with `avatar` */
48
+ width?: number | DataLink
49
+ /* Add blurred image at background if photo is not full */
50
+ enableBlurBackground?: boolean | DataLink
51
+ /* The blur radius of the blur filter added to the image background */
52
+ blurBackgroundRadius?: number | DataLink
53
+ /* [iOS] The use priority of image loading system (Auto: sdwebimage, fallback to default if failed) */
54
+ loadSystemIos?: 'auto' | 'sdwebimage' | 'default' | DataLink
55
+ /* [Android] The use priority of image loading system (Auto: glide, fallback to fresco if failed) */
56
+ loadSystemAndroid?: 'auto' | 'glide' | 'fresco' | DataLink
57
+ }
58
+ events?: BrickBasicEvents & {
59
+ /* Event of the brick press */
60
+ onPress?: Array<EventAction>
61
+ /* Event of the brick press in */
62
+ onPressIn?: Array<EventAction>
63
+ /* Event of the brick press out */
64
+ onPressOut?: Array<EventAction>
65
+ /* Event of the brick long press */
66
+ onLongPress?: Array<EventAction>
67
+ /* Event of the brick focus (Use TV Device with controller) */
68
+ onFocus?: Array<EventAction>
69
+ /* Event of the brick blur (Use TV Device with controller) */
70
+ onBlur?: Array<EventAction>
71
+ /* Event of the image on load */
72
+ onLoad?: Array<EventAction>
73
+ /* Event of the image on error */
74
+ onError?: Array<EventAction<string & keyof TemplateEventPropsMap['Image']['onError']>>
75
+ }
76
+ outlets?: {
77
+ /* Brick is pressing */
78
+ brickPressing?: () => Data<boolean>
79
+ /* Brick is focusing (Use TV Device with controller) */
80
+ brickFocusing?: () => Data<boolean>
81
+ }
82
+ animation?: AnimationBasicEvents & {
83
+ onPress?: Animation
84
+ onPressIn?: Animation
85
+ onPressOut?: Animation
86
+ onLongPress?: Animation
87
+ onFocus?: Animation
88
+ onBlur?: Animation
89
+ onLoad?: Animation
90
+ onError?: Animation
91
+ }
92
+ }
93
+
94
+ /* Display images from URL or local assets with resize modes and caching */
95
+ export type BrickImage = Brick &
96
+ BrickImageDef & {
97
+ templateKey: 'BRICK_IMAGE'
98
+ switches?: Array<
99
+ SwitchDef &
100
+ BrickImageDef & {
101
+ conds?: Array<{
102
+ method: '==' | '!=' | '>' | '<' | '>=' | '<='
103
+ cond:
104
+ | SwitchCondInnerStateCurrentCanvas
105
+ | SwitchCondData
106
+ | {
107
+ __typename: 'SwitchCondInnerStateOutlet'
108
+ outlet: 'brickPressing' | 'brickFocusing'
109
+ value: any
110
+ }
111
+ }>
112
+ }
113
+ >
114
+ }
@@ -0,0 +1,476 @@
1
+ /* Auto generated by build script
2
+ *
3
+ * Data-driven list/grid. Maps items array to brick templates via propertyMapping, with pagination and detail mode support
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
+ /* prev page */
21
+ export type BrickItemsActionPrevPage = Action & {
22
+ __actionName: 'BRICK_ITEMS_PREV_PAGE'
23
+ }
24
+
25
+ /* next page */
26
+ export type BrickItemsActionNextPage = Action & {
27
+ __actionName: 'BRICK_ITEMS_NEXT_PAGE'
28
+ }
29
+
30
+ /* jump page */
31
+ export type BrickItemsActionJumpPage = ActionWithParams & {
32
+ __actionName: 'BRICK_ITEMS_JUMP_PAGE'
33
+ params?: Array<{
34
+ input: 'pageIndex'
35
+ value?: number | DataLink | EventProperty
36
+ mapping?: string
37
+ }>
38
+ }
39
+
40
+ /* open detail */
41
+ export type BrickItemsActionOpenDetail = ActionWithParams & {
42
+ __actionName: 'BRICK_ITEMS_OPEN_DETAIL'
43
+ params?: Array<{
44
+ input: 'detailIndex'
45
+ value?: number | DataLink | EventProperty
46
+ mapping?: string
47
+ }>
48
+ }
49
+
50
+ /* back list */
51
+ export type BrickItemsActionBackList = Action & {
52
+ __actionName: 'BRICK_ITEMS_BACK_LIST'
53
+ }
54
+
55
+ /* Trigger dynamic animation of item by data id or index */
56
+ export type BrickItemsActionDynamicAnimation = ActionWithParams & {
57
+ __actionName: 'BRICK_ITEMS_DYNAMIC_ANIMATION'
58
+ params?: Array<
59
+ | {
60
+ input: 'mode'
61
+ value?: 'list' | 'detail' | DataLink | EventProperty
62
+ mapping?: string
63
+ }
64
+ | {
65
+ input: 'brickId'
66
+ value?: string | DataLink | EventProperty
67
+ mapping?: string
68
+ }
69
+ | {
70
+ input: 'dataId'
71
+ value?: string | DataLink | EventProperty
72
+ mapping?: string
73
+ }
74
+ | {
75
+ input: 'index'
76
+ value?: number | DataLink | EventProperty
77
+ mapping?: string
78
+ }
79
+ | {
80
+ input: 'animationId'
81
+ value?: string | DataLink | (() => Animation) | EventProperty
82
+ mapping?: string
83
+ }
84
+ | {
85
+ input: 'animationType'
86
+ value?: 'once' | 'loop' | DataLink | EventProperty
87
+ mapping?: string
88
+ }
89
+ | {
90
+ input: 'animationResetInitialValue'
91
+ value?: boolean | DataLink | EventProperty
92
+ mapping?: string
93
+ }
94
+ >
95
+ }
96
+
97
+ /* Reset dynamic action of item by data id or index */
98
+ export type BrickItemsActionDynamicAnimationReset = ActionWithParams & {
99
+ __actionName: 'BRICK_ITEMS_DYNAMIC_ANIMATION_RESET'
100
+ params?: Array<
101
+ | {
102
+ input: 'mode'
103
+ value?: 'list' | 'detail' | DataLink | EventProperty
104
+ mapping?: string
105
+ }
106
+ | {
107
+ input: 'brickId'
108
+ value?: string | DataLink | EventProperty
109
+ mapping?: string
110
+ }
111
+ | {
112
+ input: 'dataId'
113
+ value?: string | DataLink | EventProperty
114
+ mapping?: string
115
+ }
116
+ | {
117
+ input: 'index'
118
+ value?: number | DataLink | EventProperty
119
+ mapping?: string
120
+ }
121
+ >
122
+ }
123
+
124
+ /* Stop dynamic action of item by data id or index */
125
+ export type BrickItemsActionDynamicAnimationStop = ActionWithParams & {
126
+ __actionName: 'BRICK_ITEMS_DYNAMIC_ANIMATION_STOP'
127
+ params?: Array<
128
+ | {
129
+ input: 'mode'
130
+ value?: 'list' | 'detail' | DataLink | EventProperty
131
+ mapping?: string
132
+ }
133
+ | {
134
+ input: 'brickId'
135
+ value?: string | DataLink | EventProperty
136
+ mapping?: string
137
+ }
138
+ | {
139
+ input: 'dataId'
140
+ value?: string | DataLink | EventProperty
141
+ mapping?: string
142
+ }
143
+ | {
144
+ input: 'index'
145
+ value?: number | DataLink | EventProperty
146
+ mapping?: string
147
+ }
148
+ >
149
+ }
150
+
151
+ interface BrickItemsDef {
152
+ /*
153
+ Default property:
154
+ {
155
+ "mode": "list",
156
+ "items": [],
157
+ "transformScriptEnabled": false,
158
+ "transformScriptCode": "\/\* Global variable: inputs = { items, variables } \*\/\nreturn inputs.items",
159
+ "transformScriptVariables": {},
160
+ "postTransformScriptEnabled": false,
161
+ "postTransformScriptCode": "\/\*\n * Global variable: inputs = {\n * itemsLength, // items data length\n * collections, // [{ index, item, renderList }] (all items data)\n * collectionsCurrentPage, // [{ index, item, renderList }] (current page items data)\n * renderList, // Flattened bricks of current page { frame: { x, y, width, height ... }, ... }\n * variables\n * }\n \*\/\nreturn inputs.renderList",
162
+ "postTransformScriptVariables": {},
163
+ "pageIndex": 0,
164
+ "selectedItemIndex": 0,
165
+ "allowPageOutOfBound": true,
166
+ "standbySequenceInterval": 500,
167
+ "standbySequenceRandom": 0,
168
+ "brickEditWidth": 10,
169
+ "brickEditHeight": 10,
170
+ "detailBrickEditWidth": 50,
171
+ "detailBrickEditHeight": 50,
172
+ "orderMode": "horizontal",
173
+ "resizeMode": "auto",
174
+ "justifyContent": "start",
175
+ "alignContent": "stretch",
176
+ "detailResizeMode": "auto",
177
+ "detailJustifyContent": "start",
178
+ "detailAlignContent": "stretch"
179
+ }
180
+ */
181
+ property?: BrickBasicProperty & {
182
+ /* Set current display to `list` or `detail` mode */
183
+ mode?: 'list' | 'detail' | DataLink
184
+ /* Items to generate bricks for rendering */
185
+ items?: Array<any> | DataLink
186
+ /* Enable Transform Script */
187
+ transformScriptEnabled?: boolean | DataLink
188
+ /* Code of Transform Script */
189
+ transformScriptCode?: string | DataLink
190
+ /* Variables used in Transform Script (object) */
191
+ transformScriptVariables?: {} | DataLink
192
+ /* Enable Post Transform Script */
193
+ postTransformScriptEnabled?: boolean | DataLink
194
+ /* Code of Post Transform Script */
195
+ postTransformScriptCode?: string | DataLink
196
+ /* Variables used in Post Transform Script (object) */
197
+ postTransformScriptVariables?: {} | DataLink
198
+ /* Path to get item property for generate brick id instead of use index */
199
+ dataKeyPath?: string | DataLink
200
+ /* Items per page (Default: Items size) */
201
+ itemsPerPage?: number | DataLink
202
+ /* Current page index for `list` mode */
203
+ pageIndex?: number | DataLink
204
+ /* Current selected item index for `detail` mode */
205
+ selectedItemIndex?: number | DataLink
206
+ /* Allow page out of bound */
207
+ allowPageOutOfBound?: boolean | DataLink
208
+ /* Sequentially run Standby Transition for each item */
209
+ standbySequenceEnabled?: boolean | DataLink
210
+ /* Delay time (ms) between each item */
211
+ standbySequenceInterval?: number | DataLink
212
+ /* Random delay time (ms) increase or decrease between each item (e.g. if 100ms then delay time will be -100ms ~ 100ms) */
213
+ standbySequenceRandom?: number | DataLink
214
+ /* Define frame width of Brick List editor */
215
+ brickEditWidth?: number | DataLink
216
+ /* Define frame height of Brick List editor */
217
+ brickEditHeight?: number | DataLink
218
+ /* Define frame width of Brick List editor for detail mode */
219
+ detailBrickEditWidth?: number | DataLink
220
+ /* Define frame height of Brick List editor */
221
+ detailBrickEditHeight?: number | DataLink
222
+ /* order of horizontal first or vertical first */
223
+ orderMode?: 'horizontal' | 'vertical' | DataLink
224
+ /* Max horizontal item quantity */
225
+ horizontalMaxQuantity?: number | DataLink
226
+ /* Max vertical item quantity */
227
+ verticalMaxQuantity?: number | DataLink
228
+ /* Resize mode */
229
+ resizeMode?: 'auto' | 'fix' | DataLink
230
+ /* Justify Content */
231
+ justifyContent?: 'start' | 'end' | 'center' | 'space-between' | 'space-around' | DataLink
232
+ /* Align Content */
233
+ alignContent?:
234
+ | 'stretch'
235
+ | 'start'
236
+ | 'end'
237
+ | 'center'
238
+ | 'space-between'
239
+ | 'space-around'
240
+ | DataLink
241
+ /* Resize mode for detail mode */
242
+ detailResizeMode?: 'auto' | 'fix' | DataLink
243
+ /* Align Content for detail mode */
244
+ detailJustifyContent?: 'start' | 'end' | 'center' | DataLink
245
+ /* Align Content for detail mode */
246
+ detailAlignContent?: 'stretch' | 'start' | 'end' | 'center' | DataLink
247
+ }
248
+ /* Brick Definitions for render bricks for each item of `items` on `list` mode */
249
+ brickList?:
250
+ | Array<
251
+ | DataLink
252
+ | {
253
+ title?: string | DataLink
254
+ description?: string | DataLink
255
+ hidden?: boolean | DataLink
256
+ brickId?: string | DataLink
257
+ brickIdPrefix?: string | DataLink
258
+ templateKey?: string | DataLink
259
+ property?: {} | DataLink
260
+ animation?: {} | DataLink
261
+ eventMap?: {} | DataLink
262
+ outlet?: {} | DataLink
263
+ stateGroup?: any
264
+ propertyMapping?: {} | DataLink
265
+ frame?:
266
+ | DataLink
267
+ | {
268
+ x?: number | DataLink
269
+ y?: number | DataLink
270
+ width?: number | DataLink
271
+ height?: number | DataLink
272
+ standbyMode?: 'custom' | 'top' | 'bottom' | 'left' | 'right' | DataLink
273
+ standbyFrame?: DataLink | {}
274
+ standbyOpacity?: number | DataLink
275
+ standbyDelay?: number | DataLink
276
+ standbyDelayRandom?: number | DataLink
277
+ standbyEasing?:
278
+ | DataLink
279
+ | {
280
+ default?:
281
+ | DataLink
282
+ | {
283
+ method?: string | DataLink
284
+ duration?: number | DataLink
285
+ }
286
+ x?:
287
+ | DataLink
288
+ | {
289
+ method?: string | DataLink
290
+ duration?: number | DataLink
291
+ }
292
+ y?:
293
+ | DataLink
294
+ | {
295
+ method?: string | DataLink
296
+ duration?: number | DataLink
297
+ }
298
+ width?:
299
+ | DataLink
300
+ | {
301
+ method?: string | DataLink
302
+ duration?: number | DataLink
303
+ }
304
+ height?:
305
+ | DataLink
306
+ | {
307
+ method?: string | DataLink
308
+ duration?: number | DataLink
309
+ }
310
+ opacity?:
311
+ | DataLink
312
+ | {
313
+ method?: string | DataLink
314
+ duration?: number | DataLink
315
+ }
316
+ }
317
+ showingDelay?: number | DataLink
318
+ renderOutOfViewport?: boolean | DataLink
319
+ }
320
+ show?: string | DataLink
321
+ pressToOpenDetail?: boolean | DataLink
322
+ }
323
+ >
324
+ | DataLink
325
+ /* Brick Definitions for render bricks for each item of `items` on `detail` mode */
326
+ brickDetails?:
327
+ | Array<
328
+ | DataLink
329
+ | {
330
+ title?: string | DataLink
331
+ description?: string | DataLink
332
+ hidden?: boolean | DataLink
333
+ brickId?: string | DataLink
334
+ brickIdPrefix?: string | DataLink
335
+ templateKey?: string | DataLink
336
+ property?: {} | DataLink
337
+ animation?: {} | DataLink
338
+ eventMap?: {} | DataLink
339
+ outlet?: {} | DataLink
340
+ stateGroup?: any
341
+ propertyMapping?: {} | DataLink
342
+ frame?:
343
+ | DataLink
344
+ | {
345
+ x?: number | DataLink
346
+ y?: number | DataLink
347
+ width?: number | DataLink
348
+ height?: number | DataLink
349
+ standbyMode?: 'custom' | 'top' | 'bottom' | 'left' | 'right' | DataLink
350
+ standbyFrame?: DataLink | {}
351
+ standbyOpacity?: number | DataLink
352
+ standbyDelay?: number | DataLink
353
+ standbyDelayRandom?: number | DataLink
354
+ standbyEasing?:
355
+ | DataLink
356
+ | {
357
+ default?:
358
+ | DataLink
359
+ | {
360
+ method?: string | DataLink
361
+ duration?: number | DataLink
362
+ }
363
+ x?:
364
+ | DataLink
365
+ | {
366
+ method?: string | DataLink
367
+ duration?: number | DataLink
368
+ }
369
+ y?:
370
+ | DataLink
371
+ | {
372
+ method?: string | DataLink
373
+ duration?: number | DataLink
374
+ }
375
+ width?:
376
+ | DataLink
377
+ | {
378
+ method?: string | DataLink
379
+ duration?: number | DataLink
380
+ }
381
+ height?:
382
+ | DataLink
383
+ | {
384
+ method?: string | DataLink
385
+ duration?: number | DataLink
386
+ }
387
+ opacity?:
388
+ | DataLink
389
+ | {
390
+ method?: string | DataLink
391
+ duration?: number | DataLink
392
+ }
393
+ }
394
+ showingDelay?: number | DataLink
395
+ renderOutOfViewport?: boolean | DataLink
396
+ }
397
+ show?: string | DataLink
398
+ pressToBackList?: boolean | DataLink
399
+ }
400
+ >
401
+ | DataLink
402
+ events?: BrickBasicEventsForItem & {
403
+ /* Event on page render finished */
404
+ onPageRender?: Array<
405
+ EventActionForItem<string & keyof TemplateEventPropsMap['Items']['onPageRender']>
406
+ >
407
+ /* Event on page change. */
408
+ onPageChange?: Array<
409
+ EventActionForItem<string & keyof TemplateEventPropsMap['Items']['onPageChange']>
410
+ >
411
+ /* Event on page index out of bound. */
412
+ onPageOutOfBound?: Array<
413
+ EventActionForItem<string & keyof TemplateEventPropsMap['Items']['onPageOutOfBound']>
414
+ >
415
+ /* Event on into `detail` mode */
416
+ onIntoDetailMode?: Array<
417
+ EventActionForItem<string & keyof TemplateEventPropsMap['Items']['onIntoDetailMode']>
418
+ >
419
+ /* Event on into `list` mode. */
420
+ onIntoListMode?: Array<
421
+ EventActionForItem<string & keyof TemplateEventPropsMap['Items']['onIntoListMode']>
422
+ >
423
+ /* Event on render error */
424
+ onError?: Array<EventActionForItem<string & keyof TemplateEventPropsMap['Items']['onError']>>
425
+ }
426
+ outlets?: {
427
+ /* Catched error message */
428
+ error?: () => Data<string>
429
+ /* Current render mode */
430
+ mode?: () => Data<string>
431
+ /* Current page index */
432
+ pageIndex?: () => Data<number>
433
+ /* Current page size */
434
+ pageSize?: () => Data<number>
435
+ /* Selected item index of detail mode */
436
+ selectedItemIndex?: () => Data<number>
437
+ /* Page is out of bound */
438
+ pageIsOutOfBound?: () => Data<boolean>
439
+ }
440
+ animation?: AnimationBasicEvents & {
441
+ onPageRender?: Animation
442
+ onPageChange?: Animation
443
+ onPageOutOfBound?: Animation
444
+ onIntoDetailMode?: Animation
445
+ onIntoListMode?: Animation
446
+ onError?: Animation
447
+ }
448
+ }
449
+
450
+ /* Data-driven list/grid. Maps items array to brick templates via propertyMapping, with pagination and detail mode support */
451
+ export type BrickItems = Brick &
452
+ BrickItemsDef & {
453
+ templateKey: 'BRICK_ITEMS'
454
+ switches?: Array<
455
+ SwitchDef &
456
+ BrickItemsDef & {
457
+ conds?: Array<{
458
+ method: '==' | '!=' | '>' | '<' | '>=' | '<='
459
+ cond:
460
+ | SwitchCondInnerStateCurrentCanvas
461
+ | SwitchCondData
462
+ | {
463
+ __typename: 'SwitchCondInnerStateOutlet'
464
+ outlet:
465
+ | 'error'
466
+ | 'mode'
467
+ | 'pageIndex'
468
+ | 'pageSize'
469
+ | 'selectedItemIndex'
470
+ | 'pageIsOutOfBound'
471
+ value: any
472
+ }
473
+ }>
474
+ }
475
+ >
476
+ }