@fugood/bricks-ctor 2.25.0-beta.60 → 2.25.0-beta.61

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 (190) hide show
  1. package/package.json +4 -28
  2. package/tools/deploy.ts +19 -176
  3. package/tools/mcp-server.ts +16 -33
  4. package/tools/postinstall.ts +21 -292
  5. package/tools/pull.ts +15 -195
  6. package/tools/push-config.ts +18 -113
  7. package/tools/simulator.ts +19 -148
  8. package/compile/__tests__/config-diff.test.js +0 -100
  9. package/compile/__tests__/index.test.js +0 -461
  10. package/compile/__tests__/util.test.js +0 -450
  11. package/compile/action-name-map.ts +0 -1079
  12. package/compile/config-diff.ts +0 -155
  13. package/compile/index.ts +0 -1594
  14. package/compile/util.ts +0 -482
  15. package/index.ts +0 -6
  16. package/skills/bricks-ctor/SKILL.md +0 -38
  17. package/skills/bricks-ctor/references/animation.md +0 -160
  18. package/skills/bricks-ctor/references/architecture-patterns.md +0 -88
  19. package/skills/bricks-ctor/references/automations.md +0 -232
  20. package/skills/bricks-ctor/references/buttress.md +0 -245
  21. package/skills/bricks-ctor/references/data-calculation.md +0 -252
  22. package/skills/bricks-ctor/references/local-sync.md +0 -129
  23. package/skills/bricks-ctor/references/media-flow.md +0 -165
  24. package/skills/bricks-ctor/references/remote-data-bank.md +0 -196
  25. package/skills/bricks-ctor/references/simulator.md +0 -132
  26. package/skills/bricks-ctor/references/source-editing-tools.md +0 -81
  27. package/skills/bricks-ctor/references/standby-transition.md +0 -124
  28. package/skills/bricks-ctor/references/verification-toolchain.md +0 -200
  29. package/skills/bricks-design/SKILL.md +0 -171
  30. package/skills/bricks-design/references/architecture-truths.md +0 -132
  31. package/skills/bricks-design/references/avoiding-complexity.md +0 -91
  32. package/skills/bricks-design/references/design-critique.md +0 -195
  33. package/skills/bricks-design/references/design-languages.md +0 -265
  34. package/skills/bricks-design/references/performance.md +0 -116
  35. package/skills/bricks-design/references/presentation-and-slideshow.md +0 -137
  36. package/skills/bricks-design/references/translating-inputs.md +0 -152
  37. package/skills/bricks-design/references/variations-and-tweaks.md +0 -124
  38. package/skills/bricks-design/references/when-the-brief-is-branded.md +0 -284
  39. package/skills/bricks-design/references/when-the-brief-is-vague.md +0 -85
  40. package/skills/bricks-design/references/workflow.md +0 -134
  41. package/skills/bricks-ux/SKILL.md +0 -114
  42. package/skills/bricks-ux/references/accessibility.md +0 -162
  43. package/skills/bricks-ux/references/flow-states.md +0 -175
  44. package/skills/bricks-ux/references/interaction-archetypes.md +0 -189
  45. package/skills/bricks-ux/references/monitoring-screens.md +0 -153
  46. package/skills/bricks-ux/references/pressable-composition.md +0 -126
  47. package/skills/bricks-ux/references/user-journey.md +0 -168
  48. package/skills/bricks-ux/references/ux-critique.md +0 -256
  49. package/skills/rive-marketplace/SKILL.md +0 -99
  50. package/tools/__tests__/_cli-error.test.ts +0 -35
  51. package/tools/__tests__/_mcp-config.test.ts +0 -67
  52. package/tools/__tests__/pull.test.ts +0 -108
  53. package/tools/_cli-error.ts +0 -17
  54. package/tools/_edits-log.ts +0 -41
  55. package/tools/_git-author.ts +0 -37
  56. package/tools/_last-pushed-commit.ts +0 -28
  57. package/tools/_mcp-config.ts +0 -42
  58. package/tools/_shell.ts +0 -180
  59. package/tools/icons/.gitattributes +0 -1
  60. package/tools/icons/fa6pro-glyphmap.json +0 -4686
  61. package/tools/icons/fa6pro-meta.json +0 -1
  62. package/tools/mcp-env.ts +0 -13
  63. package/tools/mcp-tools/__tests__/data-calc-editing.test.js +0 -516
  64. package/tools/mcp-tools/__tests__/entry-editing.test.js +0 -866
  65. package/tools/mcp-tools/__tests__/huggingface.test.ts +0 -49
  66. package/tools/mcp-tools/__tests__/icons.test.ts +0 -21
  67. package/tools/mcp-tools/__tests__/mcp-env.test.js +0 -19
  68. package/tools/mcp-tools/_editing-helpers.ts +0 -98
  69. package/tools/mcp-tools/_verify.ts +0 -50
  70. package/tools/mcp-tools/compile.ts +0 -104
  71. package/tools/mcp-tools/data-calc-editing.ts +0 -1311
  72. package/tools/mcp-tools/entry-editing.ts +0 -2297
  73. package/tools/mcp-tools/huggingface.ts +0 -772
  74. package/tools/mcp-tools/icons.ts +0 -97
  75. package/tools/mcp-tools/lottie.ts +0 -102
  76. package/tools/mcp-tools/media.ts +0 -113
  77. package/tools/simulator-main.mjs +0 -488
  78. package/tools/simulator-preload.cjs +0 -16
  79. package/types/animation.d.ts +0 -116
  80. package/types/automation.d.ts +0 -231
  81. package/types/brick-base.d.ts +0 -80
  82. package/types/bricks/Camera.d.ts +0 -246
  83. package/types/bricks/Chart.d.ts +0 -372
  84. package/types/bricks/GenerativeMedia.d.ts +0 -290
  85. package/types/bricks/Icon.d.ts +0 -98
  86. package/types/bricks/Image.d.ts +0 -126
  87. package/types/bricks/Items.d.ts +0 -480
  88. package/types/bricks/Lottie.d.ts +0 -168
  89. package/types/bricks/Maps.d.ts +0 -262
  90. package/types/bricks/QrCode.d.ts +0 -117
  91. package/types/bricks/Rect.d.ts +0 -150
  92. package/types/bricks/RichText.d.ts +0 -131
  93. package/types/bricks/Rive.d.ts +0 -220
  94. package/types/bricks/Scene3D.d.ts +0 -676
  95. package/types/bricks/Sketch.d.ts +0 -256
  96. package/types/bricks/Slideshow.d.ts +0 -201
  97. package/types/bricks/Svg.d.ts +0 -99
  98. package/types/bricks/Text.d.ts +0 -148
  99. package/types/bricks/TextInput.d.ts +0 -242
  100. package/types/bricks/Video.d.ts +0 -242
  101. package/types/bricks/VideoStreaming.d.ts +0 -112
  102. package/types/bricks/WebRtcStream.d.ts +0 -65
  103. package/types/bricks/WebView.d.ts +0 -168
  104. package/types/bricks/index.d.ts +0 -23
  105. package/types/canvas.d.ts +0 -82
  106. package/types/common.d.ts +0 -141
  107. package/types/data-calc-command/base.d.ts +0 -57
  108. package/types/data-calc-command/collection.d.ts +0 -418
  109. package/types/data-calc-command/color.d.ts +0 -432
  110. package/types/data-calc-command/constant.d.ts +0 -50
  111. package/types/data-calc-command/datetime.d.ts +0 -147
  112. package/types/data-calc-command/file.d.ts +0 -129
  113. package/types/data-calc-command/index.d.ts +0 -13
  114. package/types/data-calc-command/iteratee.d.ts +0 -23
  115. package/types/data-calc-command/logictype.d.ts +0 -190
  116. package/types/data-calc-command/math.d.ts +0 -275
  117. package/types/data-calc-command/object.d.ts +0 -119
  118. package/types/data-calc-command/sandbox.d.ts +0 -66
  119. package/types/data-calc-command/string.d.ts +0 -407
  120. package/types/data-calc-script.d.ts +0 -21
  121. package/types/data-calc.d.ts +0 -12
  122. package/types/data.d.ts +0 -97
  123. package/types/generators/AlarmClock.d.ts +0 -110
  124. package/types/generators/Assistant.d.ts +0 -640
  125. package/types/generators/BleCentral.d.ts +0 -247
  126. package/types/generators/BlePeripheral.d.ts +0 -208
  127. package/types/generators/CanvasMap.d.ts +0 -74
  128. package/types/generators/CastlesPay.d.ts +0 -87
  129. package/types/generators/DataBank.d.ts +0 -160
  130. package/types/generators/File.d.ts +0 -432
  131. package/types/generators/GraphQl.d.ts +0 -132
  132. package/types/generators/Http.d.ts +0 -222
  133. package/types/generators/HttpServer.d.ts +0 -230
  134. package/types/generators/Information.d.ts +0 -103
  135. package/types/generators/Intent.d.ts +0 -168
  136. package/types/generators/Iterator.d.ts +0 -108
  137. package/types/generators/Keyboard.d.ts +0 -105
  138. package/types/generators/LlmAnthropicCompat.d.ts +0 -212
  139. package/types/generators/LlmAppleBuiltin.d.ts +0 -159
  140. package/types/generators/LlmGgml.d.ts +0 -903
  141. package/types/generators/LlmMediaTekNeuroPilot.d.ts +0 -235
  142. package/types/generators/LlmMlx.d.ts +0 -228
  143. package/types/generators/LlmOnnx.d.ts +0 -213
  144. package/types/generators/LlmOpenAiCompat.d.ts +0 -312
  145. package/types/generators/LlmQualcommAiEngine.d.ts +0 -247
  146. package/types/generators/Mcp.d.ts +0 -637
  147. package/types/generators/McpServer.d.ts +0 -289
  148. package/types/generators/MediaFlow.d.ts +0 -170
  149. package/types/generators/MqttBroker.d.ts +0 -141
  150. package/types/generators/MqttClient.d.ts +0 -141
  151. package/types/generators/Question.d.ts +0 -408
  152. package/types/generators/RealtimeTranscription.d.ts +0 -287
  153. package/types/generators/RerankerGgml.d.ts +0 -195
  154. package/types/generators/SerialPort.d.ts +0 -151
  155. package/types/generators/SoundPlayer.d.ts +0 -94
  156. package/types/generators/SoundRecorder.d.ts +0 -139
  157. package/types/generators/SpeechToTextGgml.d.ts +0 -424
  158. package/types/generators/SpeechToTextOnnx.d.ts +0 -236
  159. package/types/generators/SpeechToTextPlatform.d.ts +0 -85
  160. package/types/generators/SqLite.d.ts +0 -159
  161. package/types/generators/Step.d.ts +0 -107
  162. package/types/generators/SttAppleBuiltin.d.ts +0 -153
  163. package/types/generators/Tcp.d.ts +0 -126
  164. package/types/generators/TcpServer.d.ts +0 -147
  165. package/types/generators/TextToSpeechAppleBuiltin.d.ts +0 -127
  166. package/types/generators/TextToSpeechGgml.d.ts +0 -221
  167. package/types/generators/TextToSpeechOnnx.d.ts +0 -178
  168. package/types/generators/TextToSpeechOpenAiLike.d.ts +0 -121
  169. package/types/generators/ThermalPrinter.d.ts +0 -193
  170. package/types/generators/Tick.d.ts +0 -83
  171. package/types/generators/Udp.d.ts +0 -120
  172. package/types/generators/VadGgml.d.ts +0 -260
  173. package/types/generators/VadOnnx.d.ts +0 -231
  174. package/types/generators/VadTraditional.d.ts +0 -138
  175. package/types/generators/VectorStore.d.ts +0 -257
  176. package/types/generators/Watchdog.d.ts +0 -107
  177. package/types/generators/WebCrawler.d.ts +0 -103
  178. package/types/generators/WebRtc.d.ts +0 -181
  179. package/types/generators/WebSocket.d.ts +0 -148
  180. package/types/generators/index.d.ts +0 -57
  181. package/types/index.d.ts +0 -13
  182. package/types/subspace.d.ts +0 -60
  183. package/types/switch.d.ts +0 -51
  184. package/types/system.d.ts +0 -707
  185. package/utils/__tests__/calc.test.js +0 -25
  186. package/utils/__tests__/id.test.js +0 -154
  187. package/utils/calc.ts +0 -130
  188. package/utils/data.ts +0 -495
  189. package/utils/event-props.ts +0 -912
  190. package/utils/id.ts +0 -133
@@ -1,98 +0,0 @@
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, AnimationOrGetter } 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?: AnimationOrGetter
70
- onPressIn?: AnimationOrGetter
71
- onPressOut?: AnimationOrGetter
72
- onLongPress?: AnimationOrGetter
73
- onFocus?: AnimationOrGetter
74
- onBlur?: AnimationOrGetter
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
- }
@@ -1,126 +0,0 @@
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, AnimationOrGetter } 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
- "imageFilterEnabled": false,
29
- "imageFilterBlur": 0,
30
- "imageFilterBlurMode": "clamp",
31
- "imageFilterColorMatrix": [],
32
- "loadSystemIos": "auto",
33
- "loadSystemAndroid": "auto"
34
- }
35
- */
36
- property?: BrickBasicProperty & {
37
- /* The image resize mode */
38
- resizeMode?: 'contain' | 'cover' | 'stretch' | 'center' | 'repeat' | DataLink
39
- /* The image file path (File, URL) */
40
- path?: string | DataLink
41
- /* Data to be used in the path template (e.g. `https://example.com/${id}.png`). Supports nested data, such as `${user.avatar}`. */
42
- templateData?: {} | DataLink
43
- /* The path template type */
44
- templateType?: '${}' | '{{}}' | DataLink
45
- /* The checksum of file */
46
- md5?: string | DataLink
47
- /* The image fade duration */
48
- fadeDuration?: number | DataLink
49
- /* The image avatar mode */
50
- avatar?: boolean | DataLink
51
- /* The image fixed width with `avatar` */
52
- width?: number | DataLink
53
- /* Add blurred image at background if photo is not full */
54
- enableBlurBackground?: boolean | DataLink
55
- /* The blur radius of the blur filter added to the image background */
56
- blurBackgroundRadius?: number | DataLink
57
- /* Enable Skia image filters. When disabled, Image uses the normal platform image renderer. */
58
- imageFilterEnabled?: boolean | DataLink
59
- /* Blur amount for the Skia image filter. */
60
- imageFilterBlur?: number | DataLink
61
- /* Tile mode for the Skia blur image filter. */
62
- imageFilterBlurMode?: 'clamp' | 'decal' | 'repeat' | 'mirror' | DataLink
63
- /* Optional 4x5 color matrix for the Skia image filter. Provide 20 numbers. */
64
- imageFilterColorMatrix?: Array<number | DataLink> | DataLink
65
- /* [iOS] The use priority of image loading system (Auto: sdwebimage, fallback to default if failed) */
66
- loadSystemIos?: 'auto' | 'sdwebimage' | 'default' | DataLink
67
- /* [Android] The use priority of image loading system (Auto: glide, fallback to fresco if failed) */
68
- loadSystemAndroid?: 'auto' | 'glide' | 'fresco' | DataLink
69
- }
70
- events?: BrickBasicEvents & {
71
- /* Event of the brick press */
72
- onPress?: Array<EventAction>
73
- /* Event of the brick press in */
74
- onPressIn?: Array<EventAction>
75
- /* Event of the brick press out */
76
- onPressOut?: Array<EventAction>
77
- /* Event of the brick long press */
78
- onLongPress?: Array<EventAction>
79
- /* Event of the brick focus (Use TV Device with controller) */
80
- onFocus?: Array<EventAction>
81
- /* Event of the brick blur (Use TV Device with controller) */
82
- onBlur?: Array<EventAction>
83
- /* Event of the image on load */
84
- onLoad?: Array<EventAction>
85
- /* Event of the image on error */
86
- onError?: Array<EventAction<string & keyof TemplateEventPropsMap['Image']['onError']>>
87
- }
88
- outlets?: {
89
- /* Brick is pressing */
90
- brickPressing?: () => Data<boolean>
91
- /* Brick is focusing (Use TV Device with controller) */
92
- brickFocusing?: () => Data<boolean>
93
- }
94
- animation?: AnimationBasicEvents & {
95
- onPress?: AnimationOrGetter
96
- onPressIn?: AnimationOrGetter
97
- onPressOut?: AnimationOrGetter
98
- onLongPress?: AnimationOrGetter
99
- onFocus?: AnimationOrGetter
100
- onBlur?: AnimationOrGetter
101
- onLoad?: AnimationOrGetter
102
- onError?: AnimationOrGetter
103
- }
104
- }
105
-
106
- /* Display images from URL or local assets with resize modes and caching */
107
- export type BrickImage = Brick &
108
- BrickImageDef & {
109
- templateKey: 'BRICK_IMAGE'
110
- switches?: Array<
111
- SwitchDef &
112
- BrickImageDef & {
113
- conds?: Array<{
114
- method: '==' | '!=' | '>' | '<' | '>=' | '<='
115
- cond:
116
- | SwitchCondInnerStateCurrentCanvas
117
- | SwitchCondData
118
- | {
119
- __typename: 'SwitchCondInnerStateOutlet'
120
- outlet: 'brickPressing' | 'brickFocusing'
121
- value: any
122
- }
123
- }>
124
- }
125
- >
126
- }
@@ -1,480 +0,0 @@
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, AnimationOrGetter } 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
- type?: string | DataLink
273
- standbyMode?: 'custom' | 'top' | 'bottom' | 'left' | 'right' | DataLink
274
- standbyFrame?: DataLink | {}
275
- standbyOpacity?: number | DataLink
276
- standbyDelay?: number | DataLink
277
- standbyDelayRandom?: number | DataLink
278
- standbyEasing?:
279
- | DataLink
280
- | {
281
- default?:
282
- | DataLink
283
- | {
284
- method?: string | DataLink
285
- duration?: number | DataLink
286
- }
287
- x?:
288
- | DataLink
289
- | {
290
- method?: string | DataLink
291
- duration?: number | DataLink
292
- }
293
- y?:
294
- | DataLink
295
- | {
296
- method?: string | DataLink
297
- duration?: number | DataLink
298
- }
299
- width?:
300
- | DataLink
301
- | {
302
- method?: string | DataLink
303
- duration?: number | DataLink
304
- }
305
- height?:
306
- | DataLink
307
- | {
308
- method?: string | DataLink
309
- duration?: number | DataLink
310
- }
311
- opacity?:
312
- | DataLink
313
- | {
314
- method?: string | DataLink
315
- duration?: number | DataLink
316
- }
317
- }
318
- showingDelay?: number | DataLink
319
- renderOutOfViewport?: boolean | DataLink
320
- }
321
- show?: string | DataLink
322
- pressToOpenDetail?: boolean | DataLink
323
- pressToBackList?: boolean | DataLink
324
- }
325
- >
326
- | DataLink
327
- /* Brick Definitions for render bricks for each item of `items` on `detail` mode */
328
- brickDetails?:
329
- | Array<
330
- | DataLink
331
- | {
332
- title?: string | DataLink
333
- description?: string | DataLink
334
- hidden?: boolean | DataLink
335
- brickId?: string | DataLink
336
- brickIdPrefix?: string | DataLink
337
- templateKey?: string | DataLink
338
- property?: {} | DataLink
339
- animation?: {} | DataLink
340
- eventMap?: {} | DataLink
341
- outlet?: {} | DataLink
342
- stateGroup?: any
343
- propertyMapping?: {} | DataLink
344
- frame?:
345
- | DataLink
346
- | {
347
- x?: number | DataLink
348
- y?: number | DataLink
349
- width?: number | DataLink
350
- height?: number | DataLink
351
- type?: string | DataLink
352
- standbyMode?: 'custom' | 'top' | 'bottom' | 'left' | 'right' | DataLink
353
- standbyFrame?: DataLink | {}
354
- standbyOpacity?: number | DataLink
355
- standbyDelay?: number | DataLink
356
- standbyDelayRandom?: number | DataLink
357
- standbyEasing?:
358
- | DataLink
359
- | {
360
- default?:
361
- | DataLink
362
- | {
363
- method?: string | DataLink
364
- duration?: number | DataLink
365
- }
366
- x?:
367
- | DataLink
368
- | {
369
- method?: string | DataLink
370
- duration?: number | DataLink
371
- }
372
- y?:
373
- | DataLink
374
- | {
375
- method?: string | DataLink
376
- duration?: number | DataLink
377
- }
378
- width?:
379
- | DataLink
380
- | {
381
- method?: string | DataLink
382
- duration?: number | DataLink
383
- }
384
- height?:
385
- | DataLink
386
- | {
387
- method?: string | DataLink
388
- duration?: number | DataLink
389
- }
390
- opacity?:
391
- | DataLink
392
- | {
393
- method?: string | DataLink
394
- duration?: number | DataLink
395
- }
396
- }
397
- showingDelay?: number | DataLink
398
- renderOutOfViewport?: boolean | DataLink
399
- }
400
- show?: string | DataLink
401
- pressToOpenDetail?: boolean | DataLink
402
- pressToBackList?: boolean | DataLink
403
- }
404
- >
405
- | DataLink
406
- events?: BrickBasicEventsForItem & {
407
- /* Event on page render finished */
408
- onPageRender?: Array<
409
- EventActionForItem<string & keyof TemplateEventPropsMap['Items']['onPageRender']>
410
- >
411
- /* Event on page change. */
412
- onPageChange?: Array<
413
- EventActionForItem<string & keyof TemplateEventPropsMap['Items']['onPageChange']>
414
- >
415
- /* Event on page index out of bound. */
416
- onPageOutOfBound?: Array<
417
- EventActionForItem<string & keyof TemplateEventPropsMap['Items']['onPageOutOfBound']>
418
- >
419
- /* Event on into `detail` mode */
420
- onIntoDetailMode?: Array<
421
- EventActionForItem<string & keyof TemplateEventPropsMap['Items']['onIntoDetailMode']>
422
- >
423
- /* Event on into `list` mode. */
424
- onIntoListMode?: Array<
425
- EventActionForItem<string & keyof TemplateEventPropsMap['Items']['onIntoListMode']>
426
- >
427
- /* Event on render error */
428
- onError?: Array<EventActionForItem<string & keyof TemplateEventPropsMap['Items']['onError']>>
429
- }
430
- outlets?: {
431
- /* Catched error message */
432
- error?: () => Data<string>
433
- /* Current render mode */
434
- mode?: () => Data<string>
435
- /* Current page index */
436
- pageIndex?: () => Data<number>
437
- /* Current page size */
438
- pageSize?: () => Data<number>
439
- /* Selected item index of detail mode */
440
- selectedItemIndex?: () => Data<number>
441
- /* Page is out of bound */
442
- pageIsOutOfBound?: () => Data<boolean>
443
- }
444
- animation?: AnimationBasicEvents & {
445
- onPageRender?: AnimationOrGetter
446
- onPageChange?: AnimationOrGetter
447
- onPageOutOfBound?: AnimationOrGetter
448
- onIntoDetailMode?: AnimationOrGetter
449
- onIntoListMode?: AnimationOrGetter
450
- onError?: AnimationOrGetter
451
- }
452
- }
453
-
454
- /* Data-driven list/grid. Maps items array to brick templates via propertyMapping, with pagination and detail mode support */
455
- export type BrickItems = Brick &
456
- BrickItemsDef & {
457
- templateKey: 'BRICK_ITEMS'
458
- switches?: Array<
459
- SwitchDef &
460
- BrickItemsDef & {
461
- conds?: Array<{
462
- method: '==' | '!=' | '>' | '<' | '>=' | '<='
463
- cond:
464
- | SwitchCondInnerStateCurrentCanvas
465
- | SwitchCondData
466
- | {
467
- __typename: 'SwitchCondInnerStateOutlet'
468
- outlet:
469
- | 'error'
470
- | 'mode'
471
- | 'pageIndex'
472
- | 'pageSize'
473
- | 'selectedItemIndex'
474
- | 'pageIsOutOfBound'
475
- value: any
476
- }
477
- }>
478
- }
479
- >
480
- }