@fugood/bricks-project 2.23.0-beta.45 → 2.23.0-beta.48

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.
@@ -310,6 +310,24 @@ export const templateActionNameMap = {
310
310
  },
311
311
  },
312
312
 
313
+ BRICK_MAPS: {
314
+ BRICK_MAPS_PAN: {
315
+ panDirection: 'BRICK_MAPS_PAN_DIRECTION',
316
+ },
317
+ BRICK_MAPS_NAVIGATE_TO: {
318
+ targetLatitude: 'BRICK_MAPS_TARGET_LATITUDE',
319
+ targetLongitude: 'BRICK_MAPS_TARGET_LONGITUDE',
320
+ targetZoom: 'BRICK_MAPS_TARGET_ZOOM',
321
+ },
322
+ BRICK_MAPS_FOCUS_MARKER: {
323
+ markerId: 'BRICK_MAPS_MARKER_ID',
324
+ },
325
+ BRICK_MAPS_FIT_TO_MARKERS: {
326
+ edgePadding: 'BRICK_MAPS_EDGE_PADDING',
327
+ animated: 'BRICK_MAPS_ANIMATED',
328
+ },
329
+ },
330
+
313
331
  GENERATOR_FILE: {
314
332
  GENERATOR_FILE_READ_CONTENT: {
315
333
  encoding: 'ENCODING',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fugood/bricks-project",
3
- "version": "2.23.0-beta.45",
3
+ "version": "2.23.0-beta.48",
4
4
  "main": "index.ts",
5
5
  "scripts": {
6
6
  "build": "bun scripts/build.js"
@@ -14,5 +14,5 @@
14
14
  "lodash": "^4.17.4",
15
15
  "uuid": "^8.3.1"
16
16
  },
17
- "gitHead": "fa67a0c333ca6e372e7b7b01035d8e871b216b9f"
17
+ "gitHead": "5c53356168c2861496d5a329ae1cb175c40ba5ed"
18
18
  }
@@ -0,0 +1,254 @@
1
+ /* Auto generated by build script */
2
+ import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
3
+ import type { Data, DataLink } from '../data'
4
+ import type { Animation, AnimationBasicEvents } from '../animation'
5
+ import type {
6
+ Brick,
7
+ EventAction,
8
+ EventActionForItem,
9
+ ActionWithDataParams,
10
+ ActionWithParams,
11
+ Action,
12
+ EventProperty,
13
+ } from '../common'
14
+ import type { BrickBasicProperty, BrickBasicEvents, BrickBasicEventsForItem } from '../brick-base'
15
+
16
+ /* Zoom in the map */
17
+ export type BrickMapsActionZoomIn = Action & {
18
+ __actionName: 'BRICK_MAPS_ZOOM_IN'
19
+ }
20
+
21
+ /* Zoom out the map */
22
+ export type BrickMapsActionZoomOut = Action & {
23
+ __actionName: 'BRICK_MAPS_ZOOM_OUT'
24
+ }
25
+
26
+ /* Pan the map in a direction */
27
+ export type BrickMapsActionPan = ActionWithParams & {
28
+ __actionName: 'BRICK_MAPS_PAN'
29
+ params?: Array<{
30
+ input: 'panDirection'
31
+ value?: 'up' | 'down' | 'left' | 'right' | DataLink | EventProperty
32
+ mapping?: string
33
+ }>
34
+ }
35
+
36
+ /* Navigate to a specific location */
37
+ export type BrickMapsActionNavigateTo = ActionWithParams & {
38
+ __actionName: 'BRICK_MAPS_NAVIGATE_TO'
39
+ params?: Array<
40
+ | {
41
+ input: 'targetLatitude'
42
+ value?: number | DataLink | EventProperty
43
+ mapping?: string
44
+ }
45
+ | {
46
+ input: 'targetLongitude'
47
+ value?: number | DataLink | EventProperty
48
+ mapping?: string
49
+ }
50
+ | {
51
+ input: 'targetZoom'
52
+ value?: number | DataLink | EventProperty
53
+ mapping?: string
54
+ }
55
+ >
56
+ }
57
+
58
+ /* Focus on a marker by ID */
59
+ export type BrickMapsActionFocusMarker = ActionWithParams & {
60
+ __actionName: 'BRICK_MAPS_FOCUS_MARKER'
61
+ params?: Array<{
62
+ input: 'markerId'
63
+ value?: string | DataLink | EventProperty
64
+ mapping?: string
65
+ }>
66
+ }
67
+
68
+ /* Reset map to initial position */
69
+ export type BrickMapsActionReset = Action & {
70
+ __actionName: 'BRICK_MAPS_RESET'
71
+ }
72
+
73
+ /* Fit map to show all markers */
74
+ export type BrickMapsActionFitToMarkers = ActionWithParams & {
75
+ __actionName: 'BRICK_MAPS_FIT_TO_MARKERS'
76
+ params?: Array<
77
+ | {
78
+ input: 'edgePadding'
79
+ value?: number | DataLink | EventProperty
80
+ mapping?: string
81
+ }
82
+ | {
83
+ input: 'animated'
84
+ value?: boolean | DataLink | EventProperty
85
+ mapping?: string
86
+ }
87
+ >
88
+ }
89
+
90
+ interface BrickMapsDef {
91
+ /*
92
+ Default property:
93
+ {
94
+ "provider": "apple",
95
+ "apiKey": "",
96
+ "initialLatitude": 25.033,
97
+ "initialLongitude": 121.5654,
98
+ "initialZoom": 10,
99
+ "mapType": "standard",
100
+ "mapTheme": "standard",
101
+ "showUserLocation": false,
102
+ "showCompass": true,
103
+ "showZoomControls": true,
104
+ "scrollEnabled": true,
105
+ "zoomEnabled": true,
106
+ "rotateEnabled": true,
107
+ "markers": [],
108
+ "customMapStyle": [],
109
+ "showTraffic": false,
110
+ "showBuildings": false,
111
+ "showIndoors": true,
112
+ "minZoomLevel": 1,
113
+ "maxZoomLevel": 20,
114
+ "followUserLocation": false,
115
+ "showPath": false,
116
+ "pathStrokeColor": "#4285F4",
117
+ "pathStrokeWidth": 3
118
+ }
119
+ */
120
+ property?: BrickBasicProperty & {
121
+ /* Map provider (iOS/tvOS only - Android and Web always use Google Maps) */
122
+ provider?: 'google' | 'apple' | DataLink
123
+ /* Google Maps API Key (Web only) */
124
+ apiKey?: string | DataLink
125
+ /* Initial latitude */
126
+ initialLatitude?: number | DataLink
127
+ /* Initial longitude */
128
+ initialLongitude?: number | DataLink
129
+ /* Initial zoom level (1-20) */
130
+ initialZoom?: number | DataLink
131
+ /* Map type */
132
+ mapType?: 'standard' | 'satellite' | 'hybrid' | 'terrain' | DataLink
133
+ /* Map theme preset */
134
+ mapTheme?: 'standard' | 'dark' | 'night' | 'retro' | 'silver' | 'aubergine' | DataLink
135
+ /* Show user location button */
136
+ showUserLocation?: boolean | DataLink
137
+ /* Show compass */
138
+ showCompass?: boolean | DataLink
139
+ /* Show zoom controls */
140
+ showZoomControls?: boolean | DataLink
141
+ /* Enable scrolling */
142
+ scrollEnabled?: boolean | DataLink
143
+ /* Enable zooming */
144
+ zoomEnabled?: boolean | DataLink
145
+ /* Enable rotating */
146
+ rotateEnabled?: boolean | DataLink
147
+ /* Map markers data */
148
+ markers?:
149
+ | Array<
150
+ | DataLink
151
+ | {
152
+ id?: string | DataLink
153
+ latitude?: number | DataLink
154
+ longitude?: number | DataLink
155
+ title?: string | DataLink
156
+ description?: string | DataLink
157
+ color?: string | DataLink
158
+ icon?: string | DataLink
159
+ }
160
+ >
161
+ | DataLink
162
+ /* Custom map style (array of Google Maps style objects) */
163
+ customMapStyle?:
164
+ | Array<
165
+ | DataLink
166
+ | {
167
+ featureType?: string | DataLink
168
+ elementType?: string | DataLink
169
+ stylers?: Array<{} | DataLink> | DataLink
170
+ }
171
+ >
172
+ | DataLink
173
+ /* Show traffic layer */
174
+ showTraffic?: boolean | DataLink
175
+ /* Show buildings in 3D */
176
+ showBuildings?: boolean | DataLink
177
+ /* Show indoor maps */
178
+ showIndoors?: boolean | DataLink
179
+ /* Minimum zoom level */
180
+ minZoomLevel?: number | DataLink
181
+ /* Maximum zoom level */
182
+ maxZoomLevel?: number | DataLink
183
+ /* Follow user location */
184
+ followUserLocation?: boolean | DataLink
185
+ /* Show path between markers */
186
+ showPath?: boolean | DataLink
187
+ /* Path stroke color */
188
+ pathStrokeColor?: string | DataLink
189
+ /* Path stroke width */
190
+ pathStrokeWidth?: number | DataLink
191
+ }
192
+ events?: BrickBasicEvents & {
193
+ /* Event of the brick press */
194
+ onPress?: Array<EventAction>
195
+ /* Event of the brick press in */
196
+ onPressIn?: Array<EventAction>
197
+ /* Event of the brick press out */
198
+ onPressOut?: Array<EventAction>
199
+ /* Event of the brick long press */
200
+ onLongPress?: Array<EventAction>
201
+ /* Event of the brick focus (Use TV Device with controller) */
202
+ onFocus?: Array<EventAction>
203
+ /* Event of the brick blur (Use TV Device with controller) */
204
+ onBlur?: Array<EventAction>
205
+ /* Event when a marker is pressed */
206
+ onMarkerPress?: Array<EventAction>
207
+ /* Event when the map is pressed */
208
+ onMapPress?: Array<EventAction>
209
+ /* Event when the map region changes */
210
+ onRegionChange?: Array<EventAction>
211
+ /* Event when the map is ready */
212
+ onReady?: Array<EventAction>
213
+ }
214
+ outlets?: {
215
+ /* Brick is pressing */
216
+ brickPressing?: () => Data
217
+ /* Brick is focusing (Use TV Device with controller) */
218
+ brickFocusing?: () => Data
219
+ }
220
+ animation?: AnimationBasicEvents & {
221
+ onPress?: Animation
222
+ onPressIn?: Animation
223
+ onPressOut?: Animation
224
+ onLongPress?: Animation
225
+ onFocus?: Animation
226
+ onBlur?: Animation
227
+ onMarkerPress?: Animation
228
+ onMapPress?: Animation
229
+ onRegionChange?: Animation
230
+ onReady?: Animation
231
+ }
232
+ }
233
+
234
+ /* Maps brick ([Tutorial](https://intercom.help/bricks-dag-inc/articles/maps)) */
235
+ export type BrickMaps = Brick &
236
+ BrickMapsDef & {
237
+ templateKey: 'BRICK_MAPS'
238
+ switches: Array<
239
+ SwitchDef &
240
+ BrickMapsDef & {
241
+ conds?: Array<{
242
+ method: '==' | '!=' | '>' | '<' | '>=' | '<='
243
+ cond:
244
+ | SwitchCondInnerStateCurrentCanvas
245
+ | SwitchCondData
246
+ | {
247
+ __typename: 'SwitchCondInnerStateOutlet'
248
+ outlet: 'brickPressing' | 'brickFocusing'
249
+ value: any
250
+ }
251
+ }>
252
+ }
253
+ >
254
+ }
@@ -18,3 +18,4 @@ export * from './WebView'
18
18
  export * from './Camera'
19
19
  export * from './WebRtcStream'
20
20
  export * from './GenerativeMedia'
21
+ export * from './Maps'
@@ -57,7 +57,7 @@ export type GeneratorMCPActionReadResource = ActionWithParams & {
57
57
  }
58
58
  | {
59
59
  input: 'variables'
60
- value?: {} | DataLink | EventProperty
60
+ value?: { [key: string]: any } | DataLink | EventProperty
61
61
  mapping?: string
62
62
  }
63
63
  >
@@ -89,7 +89,7 @@ export type GeneratorMCPActionCallTool = ActionWithParams & {
89
89
  }
90
90
  | {
91
91
  input: 'variables'
92
- value?: {} | DataLink | EventProperty
92
+ value?: { [key: string]: any } | DataLink | EventProperty
93
93
  mapping?: string
94
94
  }
95
95
  >
@@ -121,7 +121,7 @@ export type GeneratorMCPActionGetPrompt = ActionWithParams & {
121
121
  }
122
122
  | {
123
123
  input: 'variables'
124
- value?: {} | DataLink | EventProperty
124
+ value?: { [key: string]: any } | DataLink | EventProperty
125
125
  mapping?: string
126
126
  }
127
127
  >
package/types/system.ts CHANGED
@@ -11,7 +11,7 @@ import type { Animation } from './animation'
11
11
  import type { Canvas } from './canvas'
12
12
  import type { Data, DataLink } from './data'
13
13
 
14
- /* Change Data value with script expression */
14
+ /* Change Data value with script expression. One expression of return value */
15
15
  export type SystemActionPropertyBankExpression = ActionWithParams & {
16
16
  __actionName: 'PROPERTY_BANK_EXPRESSION'
17
17
  params?: Array<
@@ -22,7 +22,13 @@ export type SystemActionPropertyBankExpression = ActionWithParams & {
22
22
  }
23
23
  | {
24
24
  input: 'variables'
25
- value?: {} | DataLink | EventProperty
25
+ value?:
26
+ | Array<{
27
+ id?: string
28
+ key?: string
29
+ }>
30
+ | DataLink
31
+ | EventProperty
26
32
  mapping?: string
27
33
  }
28
34
  | {
@@ -153,7 +159,13 @@ export type SystemActionChangeCanvas = ActionWithParams & {
153
159
  }
154
160
  | {
155
161
  input: 'canvasKeyMapList'
156
- value?: {} | DataLink | EventProperty
162
+ value?:
163
+ | Array<{
164
+ key?: string
165
+ value?: string
166
+ }>
167
+ | DataLink
168
+ | EventProperty
157
169
  mapping?: string
158
170
  }
159
171
  | {
@@ -218,7 +230,15 @@ export type SystemActionAlert = ActionWithParams & {
218
230
  }
219
231
  | {
220
232
  input: 'selections'
221
- value?: {} | DataLink | EventProperty
233
+ value?:
234
+ | Array<{
235
+ label?: string
236
+ color?: string
237
+ value?: string
238
+ disableResult?: boolean
239
+ }>
240
+ | DataLink
241
+ | EventProperty
222
242
  mapping?: string
223
243
  }
224
244
  | {
@@ -415,7 +435,15 @@ export type SystemActionChannelSubscribe = ActionWithParams & {
415
435
  }
416
436
  | {
417
437
  input: 'dataAssignList'
418
- value?: {} | DataLink | EventProperty
438
+ value?:
439
+ | Array<{
440
+ path?: string
441
+ type?: any
442
+ id?: string
443
+ required?: boolean
444
+ }>
445
+ | DataLink
446
+ | EventProperty
419
447
  mapping?: string
420
448
  }
421
449
  | {
@@ -425,7 +453,15 @@ export type SystemActionChannelSubscribe = ActionWithParams & {
425
453
  }
426
454
  | {
427
455
  input: 'progressAssignList'
428
- value?: {} | DataLink | EventProperty
456
+ value?:
457
+ | Array<{
458
+ path?: string
459
+ type?: any
460
+ id?: string
461
+ required?: boolean
462
+ }>
463
+ | DataLink
464
+ | EventProperty
429
465
  mapping?: string
430
466
  }
431
467
  | {
@@ -210,6 +210,25 @@ export const templateEventPropsMap = {
210
210
  'BRICK_GENERATIVE_MEDIA_ERROR', // type: string
211
211
  ],
212
212
  },
213
+ BRICK_MAPS: {
214
+ onMarkerPress: [
215
+ 'BRICK_MAPS_MARKER_ID', // type: string
216
+ 'BRICK_MAPS_MARKER_TITLE', // type: string
217
+ 'BRICK_MAPS_MARKER_DESCRIPTION', // type: string
218
+ 'BRICK_MAPS_MARKER_LATITUDE', // type: number
219
+ 'BRICK_MAPS_MARKER_LONGITUDE', // type: number
220
+ ],
221
+ onMapPress: [
222
+ 'BRICK_MAPS_PRESS_LATITUDE', // type: number
223
+ 'BRICK_MAPS_PRESS_LONGITUDE', // type: number
224
+ ],
225
+ onRegionChange: [
226
+ 'BRICK_MAPS_REGION_LATITUDE', // type: number
227
+ 'BRICK_MAPS_REGION_LONGITUDE', // type: number
228
+ 'BRICK_MAPS_REGION_LATITUDE_DELTA', // type: number
229
+ 'BRICK_MAPS_REGION_LONGITUDE_DELTA', // type: number
230
+ ],
231
+ },
213
232
  GENERATOR_TICK: {
214
233
  ticking: [
215
234
  'GENERATOR_TICK_COUNTDOWN', // type: number