@fugood/bricks-project 2.22.0-beta.27 → 2.22.0-beta.28

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 (78) hide show
  1. package/package.json +2 -2
  2. package/types/animation.ts +1 -0
  3. package/types/brick-base.ts +77 -0
  4. package/types/bricks/3DViewer.ts +200 -0
  5. package/types/bricks/Camera.ts +195 -0
  6. package/types/bricks/Chart.ts +362 -0
  7. package/types/bricks/GenerativeMedia.ts +237 -0
  8. package/types/bricks/Icon.ts +90 -0
  9. package/types/bricks/Image.ts +101 -0
  10. package/types/bricks/Items.ts +461 -0
  11. package/types/bricks/Lottie.ts +156 -0
  12. package/types/bricks/Qrcode.ts +109 -0
  13. package/types/bricks/Rect.ts +107 -0
  14. package/types/bricks/RichText.ts +120 -0
  15. package/types/bricks/Rive.ts +209 -0
  16. package/types/bricks/Slideshow.ts +155 -0
  17. package/types/bricks/Svg.ts +91 -0
  18. package/types/bricks/Text.ts +140 -0
  19. package/types/bricks/TextInput.ts +231 -0
  20. package/types/bricks/Video.ts +167 -0
  21. package/types/bricks/VideoStreaming.ts +104 -0
  22. package/types/bricks/WebRTCStream.ts +60 -0
  23. package/types/bricks/WebView.ts +157 -0
  24. package/types/bricks/index.ts +20 -0
  25. package/types/generators/AlarmClock.ts +102 -0
  26. package/types/generators/Assistant.ts +546 -0
  27. package/types/generators/BleCentral.ts +225 -0
  28. package/types/generators/BlePeripheral.ts +202 -0
  29. package/types/generators/CanvasMap.ts +57 -0
  30. package/types/generators/CastlesPay.ts +77 -0
  31. package/types/generators/DataBank.ts +123 -0
  32. package/types/generators/File.ts +351 -0
  33. package/types/generators/GraphQL.ts +124 -0
  34. package/types/generators/HTTP.ts +117 -0
  35. package/types/generators/HTTPServer.ts +156 -0
  36. package/types/generators/Information.ts +97 -0
  37. package/types/generators/Intent.ts +107 -0
  38. package/types/generators/Iterator.ts +95 -0
  39. package/types/generators/Keyboard.ts +85 -0
  40. package/types/generators/LlmAnthropicCompat.ts +188 -0
  41. package/types/generators/LlmGgml.ts +719 -0
  42. package/types/generators/LlmOnnx.ts +184 -0
  43. package/types/generators/LlmOpenAiCompat.ts +206 -0
  44. package/types/generators/LlmQualcommAiEngine.ts +213 -0
  45. package/types/generators/MCP.ts +294 -0
  46. package/types/generators/MCPServer.ts +245 -0
  47. package/types/generators/MQTTBroker.ts +121 -0
  48. package/types/generators/MediaFlow.ts +142 -0
  49. package/types/generators/MqttClient.ts +129 -0
  50. package/types/generators/Question.ts +395 -0
  51. package/types/generators/RealtimeTranscription.ts +172 -0
  52. package/types/generators/RerankerGgml.ts +153 -0
  53. package/types/generators/SerialPort.ts +141 -0
  54. package/types/generators/SoundPlayer.ts +86 -0
  55. package/types/generators/SoundRecorder.ts +113 -0
  56. package/types/generators/SpeechToTextGgml.ts +462 -0
  57. package/types/generators/SpeechToTextOnnx.ts +227 -0
  58. package/types/generators/SpeechToTextPlatform.ts +75 -0
  59. package/types/generators/Sqlite.ts +118 -0
  60. package/types/generators/Step.ts +101 -0
  61. package/types/generators/TCP.ts +120 -0
  62. package/types/generators/TCPServer.ts +137 -0
  63. package/types/generators/TapToPayOnIPhone.ts +175 -0
  64. package/types/generators/TextToSpeechGgml.ts +182 -0
  65. package/types/generators/TextToSpeechOnnx.ts +169 -0
  66. package/types/generators/TextToSpeechOpenAiLike.ts +113 -0
  67. package/types/generators/ThermalPrinter.ts +185 -0
  68. package/types/generators/Tick.ts +75 -0
  69. package/types/generators/UDP.ts +109 -0
  70. package/types/generators/VadGgml.ts +211 -0
  71. package/types/generators/VectorStore.ts +223 -0
  72. package/types/generators/Watchdog.ts +96 -0
  73. package/types/generators/WebCrawler.ts +97 -0
  74. package/types/generators/WebRTC.ts +165 -0
  75. package/types/generators/WebSocket.ts +142 -0
  76. package/types/generators/index.ts +51 -0
  77. package/types/bricks.ts +0 -3269
  78. package/types/generators.ts +0 -8632
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fugood/bricks-project",
3
- "version": "2.22.0-beta.27",
3
+ "version": "2.22.0-beta.28",
4
4
  "main": "index.ts",
5
5
  "scripts": {
6
6
  "build": "node scripts/build.js"
@@ -14,5 +14,5 @@
14
14
  "lodash": "^4.17.4",
15
15
  "uuid": "^8.3.1"
16
16
  },
17
- "gitHead": "6a1bca38b9962ca9d6ec45842b4c9a6426369d78"
17
+ "gitHead": "4a841001b6190c63368e33084a82ab4cfd1945f2"
18
18
  }
@@ -30,6 +30,7 @@ export type Easing =
30
30
  | 'easeInBounce'
31
31
  | 'easeOutBounce'
32
32
  | 'easeInOutBounce'
33
+ | string // Support format like 'cubic-bezier(x1, y1, x2, y2)'
33
34
 
34
35
  export interface AnimationTimingConfig {
35
36
  __type: 'AnimationTimingConfig'
@@ -0,0 +1,77 @@
1
+ import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from './switch'
2
+ import type { Data, DataLink } from './data'
3
+ import type { Animation, AnimationBasicEvents } from './animation'
4
+ import type {
5
+ Brick,
6
+ EventAction,
7
+ EventActionForItem,
8
+ ActionWithDataParams,
9
+ ActionWithParams,
10
+ Action,
11
+ EventProperty,
12
+ } from './common'
13
+
14
+ export interface BrickBasicProperty {
15
+ /* The brick opacity (0 ~ 1) */
16
+ opacity?: number | DataLink
17
+ /* The brick background color */
18
+ backgroundColor?: string | DataLink
19
+ /* The brick border style */
20
+ borderStyle?: 'solid' | 'dotted' | 'dashed' | DataLink
21
+ /* The brick border width (top) */
22
+ borderTopSize?: number | DataLink
23
+ /* The brick border color (top) */
24
+ borderTopColor?: string | DataLink
25
+ /* The brick border radius (top left) */
26
+ borderTopLeftRadius?: number | DataLink
27
+ /* The brick border radius (top right) */
28
+ borderTopRightRadius?: number | DataLink
29
+ /* The brick border width (bottom) */
30
+ borderBottomSize?: number | DataLink
31
+ /* The brick border color (bottom) */
32
+ borderBottomColor?: string | DataLink
33
+ /* The brick border radius (bottom left) */
34
+ borderBottomLeftRadius?: number | DataLink
35
+ /* The brick border radius (bottom right) */
36
+ borderBottomRightRadius?: number | DataLink
37
+ /* The brick border width (left) */
38
+ borderLeftSize?: number | DataLink
39
+ /* The brick border color (bottom) */
40
+ borderLeftColor?: string | DataLink
41
+ /* The brick border width (right) */
42
+ borderRightSize?: number | DataLink
43
+ /* The brick border color (right) */
44
+ borderRightColor?: string | DataLink
45
+ /* The brick rotate (deg) */
46
+ rotate?: number | DataLink
47
+ /* The brick rotateX (deg) */
48
+ rotateX?: number | DataLink
49
+ /* The brick rotateY (deg) */
50
+ rotateY?: number | DataLink
51
+ /* The brick shadow color */
52
+ shadowColor?: string | DataLink
53
+ /* The brick shadow opacity (0 ~ 1) */
54
+ shadowOpacity?: number | DataLink
55
+ /* The brick shadow radius */
56
+ shadowRadius?: number | DataLink
57
+ /* The brick shadow offset width */
58
+ shadowOffsetWidth?: number | DataLink
59
+ /* The brick shadow offset height */
60
+ shadowOffsetHeight?: number | DataLink
61
+ /* Brick pressable.
62
+ Disabled: Disabled even if event or animation is set.
63
+ Bypass: Disable and bypass the touch event on the brick. */
64
+ pressable?: 'enabled' | 'disabled' | 'bypass' | DataLink
65
+ }
66
+
67
+ export interface BrickBasicEvents {
68
+ showStart?: Array<EventAction>
69
+ switchUpdate?: Array<EventAction>
70
+ standby?: Array<EventAction>
71
+ }
72
+
73
+ export interface BrickBasicEventsForItem {
74
+ showStart?: Array<EventActionForItem>
75
+ switchUpdate?: Array<EventActionForItem>
76
+ standby?: Array<EventActionForItem>
77
+ }
@@ -0,0 +1,200 @@
1
+ import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
2
+ import type { Data, DataLink } from '../data'
3
+ import type { Animation, AnimationBasicEvents } from '../animation'
4
+ import type {
5
+ Brick,
6
+ EventAction,
7
+ EventActionForItem,
8
+ ActionWithDataParams,
9
+ ActionWithParams,
10
+ Action,
11
+ EventProperty,
12
+ } from '../common'
13
+ import type { BrickBasicProperty, BrickBasicEvents, BrickBasicEventsForItem } from '../brick-base'
14
+
15
+ /* Play object animation */
16
+ export type Brick3DViewerActionAnimationPlay = ActionWithParams & {
17
+ __actionName: 'BRICK_3D_VIEWER_ANIMATION_PLAY'
18
+ params?: Array<{
19
+ input: 'objectIndex'
20
+ value?: number | DataLink | EventProperty
21
+ mapping?: string
22
+ }>
23
+ }
24
+
25
+ /* Pause object animation */
26
+ export type Brick3DViewerActionAnimationPause = ActionWithParams & {
27
+ __actionName: 'BRICK_3D_VIEWER_ANIMATION_PAUSE'
28
+ params?: Array<{
29
+ input: 'objectIndex'
30
+ value?: number | DataLink | EventProperty
31
+ mapping?: string
32
+ }>
33
+ }
34
+
35
+ /* Goto object animation progress */
36
+ export type Brick3DViewerActionAnimationGoto = ActionWithParams & {
37
+ __actionName: 'BRICK_3D_VIEWER_ANIMATION_GOTO'
38
+ params?: Array<
39
+ | {
40
+ input: 'objectIndex'
41
+ value?: number | DataLink | EventProperty
42
+ mapping?: string
43
+ }
44
+ | {
45
+ input: 'animationProgress'
46
+ value?: number | DataLink | EventProperty
47
+ mapping?: string
48
+ }
49
+ >
50
+ }
51
+
52
+ interface Brick3DViewerDef {
53
+ /*
54
+ Default property:
55
+ {
56
+ "showLoadingBox": true,
57
+ "enableOrbitControls": true
58
+ }
59
+ */
60
+ property?: BrickBasicProperty & {
61
+ /* 3D model list */
62
+ objects?:
63
+ | Array<
64
+ | DataLink
65
+ | {
66
+ url?: string | DataLink
67
+ md5?: string | DataLink
68
+ type?: 'USDZ' | 'glTF' | DataLink
69
+ rotation?: number | DataLink | Array<number | DataLink> | DataLink | DataLink
70
+ scale?: number | DataLink | Array<number | DataLink> | DataLink | DataLink
71
+ x?: number | DataLink
72
+ y?: number | DataLink
73
+ z?: number | DataLink
74
+ moveable?: boolean | DataLink
75
+ rotateable?: boolean | DataLink
76
+ selectable?: boolean | DataLink
77
+ enableCollision?: boolean | DataLink
78
+ animationLoopMode?: 'once' | 'repeat' | 'pingpong' | DataLink
79
+ animationProgress?: number | DataLink
80
+ animationPaused?: boolean | DataLink
81
+ boundingBox?:
82
+ | DataLink
83
+ | {
84
+ min?:
85
+ | DataLink
86
+ | {
87
+ x?: number | DataLink
88
+ y?: number | DataLink
89
+ z?: number | DataLink
90
+ }
91
+ max?:
92
+ | DataLink
93
+ | {
94
+ x?: number | DataLink
95
+ y?: number | DataLink
96
+ z?: number | DataLink
97
+ }
98
+ }
99
+ }
100
+ >
101
+ | DataLink
102
+ /* Show loading placeholder box */
103
+ showLoadingBox?: boolean | DataLink
104
+ /* Display shadows */
105
+ shadows?: boolean | DataLink
106
+ /* Default camera position */
107
+ camera?:
108
+ | DataLink
109
+ | {
110
+ fov?: number | DataLink
111
+ aspect?: number | DataLink
112
+ near?: number | DataLink
113
+ far?: number | DataLink
114
+ position?:
115
+ | DataLink
116
+ | {
117
+ x?: number | DataLink
118
+ y?: number | DataLink
119
+ z?: number | DataLink
120
+ }
121
+ quaternion?:
122
+ | DataLink
123
+ | {
124
+ x?: number | DataLink
125
+ y?: number | DataLink
126
+ z?: number | DataLink
127
+ w?: number | DataLink
128
+ }
129
+ }
130
+ /* Enable orbit controls */
131
+ enableOrbitControls?: boolean | DataLink
132
+ /* Camera control options */
133
+ orbitControls?:
134
+ | DataLink
135
+ | {
136
+ autoRotate?: boolean | DataLink
137
+ enableZoom?: boolean | DataLink
138
+ enablePan?: boolean | DataLink
139
+ enableRotate?: boolean | DataLink
140
+ enableDamping?: boolean | DataLink
141
+ dampingFactor?: number | DataLink
142
+ rotateSpeed?: number | DataLink
143
+ zoomSpeed?: number | DataLink
144
+ panSpeed?: number | DataLink
145
+ minDistance?: number | DataLink
146
+ maxDistance?: number | DataLink
147
+ minPolarAngle?: number | DataLink
148
+ maxPolarAngle?: number | DataLink
149
+ minAzimuthAngle?: number | DataLink
150
+ maxAzimuthAngle?: number | DataLink
151
+ }
152
+ /* Move controls options */
153
+ moveControls?:
154
+ | DataLink
155
+ | {
156
+ responsiveness?: number | DataLink
157
+ rotationRingColor?: string | DataLink
158
+ rotationRingSize?: number | DataLink
159
+ showBoundingBox?: boolean | DataLink
160
+ }
161
+ }
162
+ events?: BrickBasicEvents & {
163
+ /* Event of error occurred */
164
+ onError?: Array<EventAction>
165
+ /* Event of object changed position or rotation */
166
+ onChange?: Array<EventAction>
167
+ /* Event of object selected */
168
+ onSelectChange?: Array<EventAction>
169
+ /* Event of object collision occurred */
170
+ onCollision?: Array<EventAction>
171
+ }
172
+ animation?: AnimationBasicEvents & {
173
+ onError?: Animation
174
+ onChange?: Animation
175
+ onSelectChange?: Animation
176
+ onCollision?: Animation
177
+ }
178
+ }
179
+
180
+ /* 3D viewer brick */
181
+ export type Brick3DViewer = Brick &
182
+ Brick3DViewerDef & {
183
+ templateKey: 'BRICK_3D_VIEWER'
184
+ switches: Array<
185
+ SwitchDef &
186
+ Brick3DViewerDef & {
187
+ conds?: Array<{
188
+ method: '==' | '!=' | '>' | '<' | '>=' | '<='
189
+ cond:
190
+ | SwitchCondInnerStateCurrentCanvas
191
+ | SwitchCondData
192
+ | {
193
+ __typename: 'SwitchCondInnerStateOutlet'
194
+ outlet: ''
195
+ value: any
196
+ }
197
+ }>
198
+ }
199
+ >
200
+ }
@@ -0,0 +1,195 @@
1
+ import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
2
+ import type { Data, DataLink } from '../data'
3
+ import type { Animation, AnimationBasicEvents } from '../animation'
4
+ import type {
5
+ Brick,
6
+ EventAction,
7
+ EventActionForItem,
8
+ ActionWithDataParams,
9
+ ActionWithParams,
10
+ Action,
11
+ EventProperty,
12
+ } from '../common'
13
+ import type { BrickBasicProperty, BrickBasicEvents, BrickBasicEventsForItem } from '../brick-base'
14
+
15
+ /* Take picture on the Camera */
16
+ export type BrickCameraActionTakePicture = ActionWithParams & {
17
+ __actionName: 'BRICK_CAMERA_TAKE_PICTURE'
18
+ params?: Array<
19
+ | {
20
+ input: 'width'
21
+ value?: number | DataLink | EventProperty
22
+ mapping?: string
23
+ }
24
+ | {
25
+ input: 'quality'
26
+ value?: string | DataLink | EventProperty
27
+ mapping?: string
28
+ }
29
+ | {
30
+ input: 'base64'
31
+ value?: boolean | DataLink | EventProperty
32
+ mapping?: string
33
+ }
34
+ | {
35
+ input: 'mirrorImage'
36
+ value?: boolean | DataLink | EventProperty
37
+ mapping?: string
38
+ }
39
+ >
40
+ }
41
+
42
+ /* Record video on the Camera */
43
+ export type BrickCameraActionRecord = ActionWithParams & {
44
+ __actionName: 'BRICK_CAMERA_RECORD'
45
+ params?: Array<
46
+ | {
47
+ input: 'quality'
48
+ value?: '4:3' | '288p' | '480p' | '720p' | '1080p' | '2160p' | DataLink | EventProperty
49
+ mapping?: string
50
+ }
51
+ | {
52
+ input: 'mirrorVideo'
53
+ value?: boolean | DataLink | EventProperty
54
+ mapping?: string
55
+ }
56
+ | {
57
+ input: 'videoBitrate'
58
+ value?: string | DataLink | EventProperty
59
+ mapping?: string
60
+ }
61
+ | {
62
+ input: 'maxDuration'
63
+ value?: number | DataLink | EventProperty
64
+ mapping?: string
65
+ }
66
+ | {
67
+ input: 'maxFileSize'
68
+ value?: string | DataLink | EventProperty
69
+ mapping?: string
70
+ }
71
+ >
72
+ }
73
+
74
+ /* Record video on the Camera */
75
+ export type BrickCameraActionStopRecord = Action & {
76
+ __actionName: 'BRICK_CAMERA_STOP_RECORD'
77
+ }
78
+
79
+ interface BrickCameraDef {
80
+ /*
81
+ Default property:
82
+ {
83
+ "autoFocusEnabled": false,
84
+ "focusDepth": 0.5,
85
+ "type": "back",
86
+ "flashMode": "off",
87
+ "captureAudio": false,
88
+ "whiteBalance": "auto",
89
+ "faceDetectionEnabled": false,
90
+ "faceDetectionEventMode": "when-detected"
91
+ }
92
+ */
93
+ property?: BrickBasicProperty & {
94
+ /* Camera auto focus */
95
+ autoFocusEnabled?: boolean | DataLink
96
+ /* The auto focus feature of the camera to attempt to focus on the part of the image at this coordinate. */
97
+ focusDepth?: number | DataLink
98
+ /* Camera type (Ignore it if you are using external camera) */
99
+ type?: 'back' | 'front' | DataLink
100
+ /* Camera zoom */
101
+ zoom?: number | DataLink
102
+ /* Camera flash mode */
103
+ flashMode?: 'off' | 'on' | 'torch' | 'auto' | DataLink
104
+ /* Camera ratio (Unsupported ratio will be ignored) */
105
+ ratio?: string | DataLink
106
+ /* Capture audio when start recording */
107
+ captureAudio?: boolean | DataLink
108
+ /* Allows you to control the color temperature in your photos by cooling down or warming up the colors. */
109
+ whiteBalance?:
110
+ | 'auto'
111
+ | 'sunny'
112
+ | 'cloudy'
113
+ | 'shadow'
114
+ | 'incandescent'
115
+ | 'fluorescent'
116
+ | DataLink
117
+ /* Enable face detection */
118
+ faceDetectionEnabled?: boolean | DataLink
119
+ /* Face detection event mode */
120
+ faceDetectionEventMode?: 'when-detected' | 'interval' | DataLink
121
+ /* Quality of take picture */
122
+ pictureQuality?: number | DataLink
123
+ /* Take picture format as base64 */
124
+ pictureBase64?: boolean | DataLink
125
+ /* Mirror image of take picture */
126
+ pictureIsMirrorImage?: boolean | DataLink
127
+ /* Quality of record video */
128
+ recordQuality?: '4:3' | '288p' | '480p' | '720p' | '1080p' | '2160p' | DataLink
129
+ /* Bitrate of record video (bit/s) */
130
+ recordVideoBitrate?: number | DataLink
131
+ /* Mirror video of record video */
132
+ recordMirrorVideo?: boolean | DataLink
133
+ /* Max duration of record video (s) */
134
+ recordMaxDuration?: number | DataLink
135
+ /* Max file size of record video (bytes) */
136
+ recordMaxFileSize?: number | DataLink
137
+ }
138
+ events?: BrickBasicEvents & {
139
+ /* Event of the Camera state change */
140
+ stateChange?: Array<EventAction>
141
+ /* Event of the Camera record start */
142
+ recordStart?: Array<EventAction>
143
+ /* Event of the Camera record end */
144
+ recordEnd?: Array<EventAction>
145
+ /* Event of the Camera barcode read */
146
+ barcodeRead?: Array<EventAction>
147
+ /* Event of the Camera picture taken */
148
+ pictureTaken?: Array<EventAction>
149
+ /* Event of the Camera record finished */
150
+ recordFinish?: Array<EventAction>
151
+ /* Event of the Camera mount error */
152
+ mountError?: Array<EventAction>
153
+ }
154
+ outlets?: {
155
+ /* Picture taken result */
156
+ pictureTaken?: () => Data
157
+ /* Record video result */
158
+ recordVideo?: () => Data
159
+ /* Barcode read result */
160
+ barcodeRead?: () => Data
161
+ /* Faces detected result */
162
+ faceDetected?: () => Data
163
+ }
164
+ animation?: AnimationBasicEvents & {
165
+ stateChange?: Animation
166
+ recordStart?: Animation
167
+ recordEnd?: Animation
168
+ barcodeRead?: Animation
169
+ pictureTaken?: Animation
170
+ recordFinish?: Animation
171
+ mountError?: Animation
172
+ }
173
+ }
174
+
175
+ /* Camera view brick ([Tutorial](https://intercom.help/bricks-dag-inc/articles/5378589-camera)) */
176
+ export type BrickCamera = Brick &
177
+ BrickCameraDef & {
178
+ templateKey: 'BRICK_CAMERA'
179
+ switches: Array<
180
+ SwitchDef &
181
+ BrickCameraDef & {
182
+ conds?: Array<{
183
+ method: '==' | '!=' | '>' | '<' | '>=' | '<='
184
+ cond:
185
+ | SwitchCondInnerStateCurrentCanvas
186
+ | SwitchCondData
187
+ | {
188
+ __typename: 'SwitchCondInnerStateOutlet'
189
+ outlet: 'pictureTaken' | 'recordVideo' | 'barcodeRead' | 'faceDetected'
190
+ value: any
191
+ }
192
+ }>
193
+ }
194
+ >
195
+ }