@fugood/bricks-project 2.25.0-beta.18 → 2.25.0-beta.20

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.
@@ -4,7 +4,7 @@
4
4
  */
5
5
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
6
6
  import type { Data, DataLink } from '../data'
7
- import type { Animation, AnimationBasicEvents } from '../animation'
7
+ import type { Animation, AnimationBasicEvents, AnimationOrGetter } from '../animation'
8
8
  import type {
9
9
  Brick,
10
10
  EventAction,
@@ -114,14 +114,14 @@ Default property:
114
114
  brickFocusing?: () => Data<boolean>
115
115
  }
116
116
  animation?: AnimationBasicEvents & {
117
- onPress?: Animation
118
- onPressIn?: Animation
119
- onPressOut?: Animation
120
- onLongPress?: Animation
121
- onFocus?: Animation
122
- onBlur?: Animation
123
- beforeValueChange?: Animation
124
- valueChange?: Animation
117
+ onPress?: AnimationOrGetter
118
+ onPressIn?: AnimationOrGetter
119
+ onPressOut?: AnimationOrGetter
120
+ onLongPress?: AnimationOrGetter
121
+ onFocus?: AnimationOrGetter
122
+ onBlur?: AnimationOrGetter
123
+ beforeValueChange?: AnimationOrGetter
124
+ valueChange?: AnimationOrGetter
125
125
  }
126
126
  }
127
127
 
@@ -4,7 +4,7 @@
4
4
  */
5
5
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
6
6
  import type { Data, DataLink } from '../data'
7
- import type { Animation, AnimationBasicEvents } from '../animation'
7
+ import type { Animation, AnimationBasicEvents, AnimationOrGetter } from '../animation'
8
8
  import type {
9
9
  Brick,
10
10
  EventAction,
@@ -207,15 +207,15 @@ Default property:
207
207
  selectionText?: () => Data<string>
208
208
  }
209
209
  animation?: AnimationBasicEvents & {
210
- onFocus?: Animation
211
- onBlur?: Animation
212
- onEmpty?: Animation
213
- onChange?: Animation
214
- onSubmit?: Animation
215
- onMatch?: Animation
216
- onNotMatch?: Animation
217
- onResultNotMatch?: Animation
218
- onFullFill?: Animation
210
+ onFocus?: AnimationOrGetter
211
+ onBlur?: AnimationOrGetter
212
+ onEmpty?: AnimationOrGetter
213
+ onChange?: AnimationOrGetter
214
+ onSubmit?: AnimationOrGetter
215
+ onMatch?: AnimationOrGetter
216
+ onNotMatch?: AnimationOrGetter
217
+ onResultNotMatch?: AnimationOrGetter
218
+ onFullFill?: AnimationOrGetter
219
219
  }
220
220
  }
221
221
 
@@ -4,7 +4,7 @@
4
4
  */
5
5
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
6
6
  import type { Data, DataLink } from '../data'
7
- import type { Animation, AnimationBasicEvents } from '../animation'
7
+ import type { Animation, AnimationBasicEvents, AnimationOrGetter } from '../animation'
8
8
  import type {
9
9
  Brick,
10
10
  EventAction,
@@ -138,17 +138,17 @@ Default property:
138
138
  brickFocusing?: () => Data<boolean>
139
139
  }
140
140
  animation?: AnimationBasicEvents & {
141
- onPress?: Animation
142
- onPressIn?: Animation
143
- onPressOut?: Animation
144
- onLongPress?: Animation
145
- onFocus?: Animation
146
- onBlur?: Animation
147
- nextVideo?: Animation
148
- roundEnd?: Animation
149
- onLoad?: Animation
150
- onError?: Animation
151
- onProgress?: Animation
141
+ onPress?: AnimationOrGetter
142
+ onPressIn?: AnimationOrGetter
143
+ onPressOut?: AnimationOrGetter
144
+ onLongPress?: AnimationOrGetter
145
+ onFocus?: AnimationOrGetter
146
+ onBlur?: AnimationOrGetter
147
+ nextVideo?: AnimationOrGetter
148
+ roundEnd?: AnimationOrGetter
149
+ onLoad?: AnimationOrGetter
150
+ onError?: AnimationOrGetter
151
+ onProgress?: AnimationOrGetter
152
152
  }
153
153
  }
154
154
 
@@ -4,7 +4,7 @@
4
4
  */
5
5
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
6
6
  import type { Data, DataLink } from '../data'
7
- import type { Animation, AnimationBasicEvents } from '../animation'
7
+ import type { Animation, AnimationBasicEvents, AnimationOrGetter } from '../animation'
8
8
  import type {
9
9
  Brick,
10
10
  EventAction,
@@ -77,15 +77,15 @@ Default property:
77
77
  brickFocusing?: () => Data<boolean>
78
78
  }
79
79
  animation?: AnimationBasicEvents & {
80
- onPress?: Animation
81
- onPressIn?: Animation
82
- onPressOut?: Animation
83
- onLongPress?: Animation
84
- onFocus?: Animation
85
- onBlur?: Animation
86
- onEnd?: Animation
87
- onLoad?: Animation
88
- onError?: Animation
80
+ onPress?: AnimationOrGetter
81
+ onPressIn?: AnimationOrGetter
82
+ onPressOut?: AnimationOrGetter
83
+ onLongPress?: AnimationOrGetter
84
+ onFocus?: AnimationOrGetter
85
+ onBlur?: AnimationOrGetter
86
+ onEnd?: AnimationOrGetter
87
+ onLoad?: AnimationOrGetter
88
+ onError?: AnimationOrGetter
89
89
  }
90
90
  }
91
91
 
@@ -4,7 +4,7 @@
4
4
  */
5
5
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
6
6
  import type { Data, DataLink } from '../data'
7
- import type { Animation, AnimationBasicEvents } from '../animation'
7
+ import type { Animation, AnimationBasicEvents, AnimationOrGetter } from '../animation'
8
8
  import type {
9
9
  Brick,
10
10
  EventAction,
@@ -4,7 +4,7 @@
4
4
  */
5
5
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
6
6
  import type { Data, DataLink } from '../data'
7
- import type { Animation, AnimationBasicEvents } from '../animation'
7
+ import type { Animation, AnimationBasicEvents, AnimationOrGetter } from '../animation'
8
8
  import type {
9
9
  Brick,
10
10
  EventAction,
@@ -139,9 +139,9 @@ Default property:
139
139
  queryError?: () => Data<string>
140
140
  }
141
141
  animation?: AnimationBasicEvents & {
142
- onLoad?: Animation
143
- onError?: Animation
144
- onMessage?: Animation
142
+ onLoad?: AnimationOrGetter
143
+ onError?: AnimationOrGetter
144
+ onMessage?: AnimationOrGetter
145
145
  }
146
146
  }
147
147
 
@@ -20,3 +20,4 @@ export * from './WebRtcStream'
20
20
  export * from './GenerativeMedia'
21
21
  export * from './Maps'
22
22
  export * from './Sketch'
23
+ export * from './Scene3D'
package/types/data.ts CHANGED
@@ -81,6 +81,8 @@ export type DataAssetKind = {
81
81
  | 'ggml-model-asset'
82
82
  | 'gguf-model-asset'
83
83
  | 'binary-asset'
84
+ | 'mlx-model-asset'
85
+ | 'scene3d-objects'
84
86
  preload?: {
85
87
  type: 'url'
86
88
  hashType: 'md5' | 'sha256' | 'sha1'
@@ -146,6 +146,23 @@ export const templateEventPropsMap = {
146
146
  onToolChange: { BRICK_SKETCH_TOOL: 'string' },
147
147
  onExportImage: { BRICK_SKETCH_IMAGE_URI: 'string' },
148
148
  },
149
+ Scene3D: {
150
+ onLoad: { BRICK_SCENE_3D_OBJECT_ID: 'string', BRICK_SCENE_3D_DURATION_MS: 'number' },
151
+ onLoadError: { BRICK_SCENE_3D_OBJECT_ID: 'string', BRICK_SCENE_3D_ERROR: 'string' },
152
+ onObjectClick: {
153
+ BRICK_SCENE_3D_OBJECT_ID: 'string',
154
+ BRICK_SCENE_3D_HIT_POINT: '{ x?: number y?: number z?: number }',
155
+ BRICK_SCENE_3D_HIT_DISTANCE: 'number',
156
+ },
157
+ onObjectHover: { BRICK_SCENE_3D_OBJECT_ID: 'string', BRICK_SCENE_3D_HOVER_ENTERED: 'boolean' },
158
+ onAnimationEnd: { BRICK_SCENE_3D_OBJECT_ID: 'string', BRICK_SCENE_3D_ANIMATION_NAME: 'string' },
159
+ onFrame: {
160
+ BRICK_SCENE_3D_FRAME_TIME: 'number',
161
+ BRICK_SCENE_3D_FRAME_DT: 'number',
162
+ BRICK_SCENE_3D_FPS: 'number',
163
+ },
164
+ onScriptError: { BRICK_SCENE_3D_ERROR: 'string', BRICK_SCENE_3D_PHASE: 'string' },
165
+ },
149
166
  Tick: {
150
167
  ticking: { GENERATOR_TICK_COUNTDOWN: 'number', GENERATOR_TICK_VALUE: 'any' },
151
168
  completed: { GENERATOR_TICK_COUNTDOWN: 'number', GENERATOR_TICK_VALUE: 'any' },