@fugood/bricks-project 2.22.0-beta.2 → 2.22.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.
- package/compile/action-name-map.ts +146 -1
- package/compile/index.ts +1 -0
- package/package.json +3 -2
- package/tools/mcp-server.ts +86 -0
- package/tools/postinstall.ts +63 -5
- package/tools/preview-main.mjs +13 -7
- package/tools/preview.ts +31 -25
- package/types/bricks.ts +105 -2
- package/types/canvas.ts +1 -1
- package/types/common.ts +2 -2
- package/types/data.ts +6 -0
- package/types/generators.ts +1931 -231
- package/types/system.ts +42 -0
- package/utils/data.ts +18 -0
- package/utils/event-props.ts +185 -0
package/types/bricks.ts
CHANGED
|
@@ -865,6 +865,43 @@ export type BrickIcon = Brick &
|
|
|
865
865
|
>
|
|
866
866
|
}
|
|
867
867
|
|
|
868
|
+
/* Play the video */
|
|
869
|
+
export type BrickVideoActionPlay = Action & {
|
|
870
|
+
__actionName: 'BRICK_VIDEO_PLAY'
|
|
871
|
+
}
|
|
872
|
+
|
|
873
|
+
/* Seek the video */
|
|
874
|
+
export type BrickVideoActionSeek = ActionWithParams & {
|
|
875
|
+
__actionName: 'BRICK_VIDEO_SEEK'
|
|
876
|
+
params?: Array<
|
|
877
|
+
| {
|
|
878
|
+
input: 'seekTime'
|
|
879
|
+
value?: number | DataLink | EventProperty
|
|
880
|
+
mapping?: string
|
|
881
|
+
}
|
|
882
|
+
| {
|
|
883
|
+
input: 'play'
|
|
884
|
+
value?: boolean | DataLink | EventProperty
|
|
885
|
+
mapping?: string
|
|
886
|
+
}
|
|
887
|
+
>
|
|
888
|
+
}
|
|
889
|
+
|
|
890
|
+
/* Pause the video */
|
|
891
|
+
export type BrickVideoActionPause = Action & {
|
|
892
|
+
__actionName: 'BRICK_VIDEO_PAUSE'
|
|
893
|
+
}
|
|
894
|
+
|
|
895
|
+
/* Replay the video */
|
|
896
|
+
export type BrickVideoActionReplay = Action & {
|
|
897
|
+
__actionName: 'BRICK_VIDEO_REPLAY'
|
|
898
|
+
}
|
|
899
|
+
|
|
900
|
+
/* Stop the video */
|
|
901
|
+
export type BrickVideoActionStop = Action & {
|
|
902
|
+
__actionName: 'BRICK_VIDEO_STOP'
|
|
903
|
+
}
|
|
904
|
+
|
|
868
905
|
interface BrickVideoDef {
|
|
869
906
|
/*
|
|
870
907
|
Default property:
|
|
@@ -1227,6 +1264,8 @@ Default property:
|
|
|
1227
1264
|
}
|
|
1228
1265
|
>
|
|
1229
1266
|
| DataLink
|
|
1267
|
+
/* Multiple slideshow media path lists to combine (Array of path arrays) */
|
|
1268
|
+
pathsList?: Array<Array<any> | DataLink | DataLink> | DataLink
|
|
1230
1269
|
/* Loop the slideshow */
|
|
1231
1270
|
loop?: boolean | DataLink
|
|
1232
1271
|
/* Shuffle the slideshow */
|
|
@@ -1868,7 +1907,7 @@ Default property:
|
|
|
1868
1907
|
verticalMaxQuantity?: number | DataLink
|
|
1869
1908
|
/* Resize mode */
|
|
1870
1909
|
resizeMode?: 'auto' | 'fix' | DataLink
|
|
1871
|
-
/*
|
|
1910
|
+
/* Justify Content */
|
|
1872
1911
|
justifyContent?: 'start' | 'end' | 'center' | 'space-between' | 'space-around' | DataLink
|
|
1873
1912
|
/* Align Content */
|
|
1874
1913
|
alignContent?:
|
|
@@ -2106,6 +2145,43 @@ export type BrickItems = Brick &
|
|
|
2106
2145
|
>
|
|
2107
2146
|
}
|
|
2108
2147
|
|
|
2148
|
+
/* Play animation */
|
|
2149
|
+
export type BrickLottieActionPlay = ActionWithParams & {
|
|
2150
|
+
__actionName: 'BRICK_LOTTIE_PLAY'
|
|
2151
|
+
params?: Array<
|
|
2152
|
+
| {
|
|
2153
|
+
input: 'startFrame'
|
|
2154
|
+
value?: number | DataLink | EventProperty
|
|
2155
|
+
mapping?: string
|
|
2156
|
+
}
|
|
2157
|
+
| {
|
|
2158
|
+
input: 'endFrame'
|
|
2159
|
+
value?: number | DataLink | EventProperty
|
|
2160
|
+
mapping?: string
|
|
2161
|
+
}
|
|
2162
|
+
>
|
|
2163
|
+
}
|
|
2164
|
+
|
|
2165
|
+
/* Pause animation */
|
|
2166
|
+
export type BrickLottieActionPause = Action & {
|
|
2167
|
+
__actionName: 'BRICK_LOTTIE_PAUSE'
|
|
2168
|
+
}
|
|
2169
|
+
|
|
2170
|
+
/* Resume animation */
|
|
2171
|
+
export type BrickLottieActionResume = Action & {
|
|
2172
|
+
__actionName: 'BRICK_LOTTIE_RESUME'
|
|
2173
|
+
}
|
|
2174
|
+
|
|
2175
|
+
/* Stop animation */
|
|
2176
|
+
export type BrickLottieActionStop = Action & {
|
|
2177
|
+
__actionName: 'BRICK_LOTTIE_STOP'
|
|
2178
|
+
}
|
|
2179
|
+
|
|
2180
|
+
/* Reset animation */
|
|
2181
|
+
export type BrickLottieActionReset = Action & {
|
|
2182
|
+
__actionName: 'BRICK_LOTTIE_RESET'
|
|
2183
|
+
}
|
|
2184
|
+
|
|
2109
2185
|
interface BrickLottieDef {
|
|
2110
2186
|
/*
|
|
2111
2187
|
Default property:
|
|
@@ -2418,6 +2494,23 @@ export type BrickWebViewActionInjectJavascript = ActionWithParams & {
|
|
|
2418
2494
|
}>
|
|
2419
2495
|
}
|
|
2420
2496
|
|
|
2497
|
+
/* Query selector on the WebView */
|
|
2498
|
+
export type BrickWebViewActionQuerySelector = ActionWithParams & {
|
|
2499
|
+
__actionName: 'BRICK_WEBVIEW_QUERY_SELECTOR'
|
|
2500
|
+
params?: Array<
|
|
2501
|
+
| {
|
|
2502
|
+
input: 'querySelector'
|
|
2503
|
+
value?: string | DataLink | EventProperty
|
|
2504
|
+
mapping?: string
|
|
2505
|
+
}
|
|
2506
|
+
| {
|
|
2507
|
+
input: 'expression'
|
|
2508
|
+
value?: string | DataLink | EventProperty
|
|
2509
|
+
mapping?: string
|
|
2510
|
+
}
|
|
2511
|
+
>
|
|
2512
|
+
}
|
|
2513
|
+
|
|
2421
2514
|
/* Do go forward on the WebView */
|
|
2422
2515
|
export type BrickWebViewActionGoForward = Action & {
|
|
2423
2516
|
__actionName: 'BRICK_WEBVIEW_GO_FORWARD'
|
|
@@ -2500,6 +2593,12 @@ Default property:
|
|
|
2500
2593
|
/* Event of the webview on message by `window.ReactNativeWebView.postMessage` on you're injected javascript code */
|
|
2501
2594
|
onMessage?: Array<EventAction>
|
|
2502
2595
|
}
|
|
2596
|
+
outlets?: {
|
|
2597
|
+
/* The result of the query selector action */
|
|
2598
|
+
queryResult?: () => Data
|
|
2599
|
+
/* The error of the query selector action */
|
|
2600
|
+
queryError?: () => Data
|
|
2601
|
+
}
|
|
2503
2602
|
animation?: AnimationBasicEvents & {
|
|
2504
2603
|
onLoad?: Animation
|
|
2505
2604
|
onError?: Animation
|
|
@@ -2521,7 +2620,7 @@ export type BrickWebView = Brick &
|
|
|
2521
2620
|
| SwitchCondData
|
|
2522
2621
|
| {
|
|
2523
2622
|
__typename: 'SwitchCondInnerStateOutlet'
|
|
2524
|
-
outlet: ''
|
|
2623
|
+
outlet: 'queryResult' | 'queryError'
|
|
2525
2624
|
value: any
|
|
2526
2625
|
}
|
|
2527
2626
|
}>
|
|
@@ -2965,6 +3064,10 @@ Default property:
|
|
|
2965
3064
|
type?: 'image' | 'video' | DataLink
|
|
2966
3065
|
/* Default image to display when no generated image is available */
|
|
2967
3066
|
defaultImage?: string | DataLink
|
|
3067
|
+
/* The hash of the default image */
|
|
3068
|
+
defaultImageHash?: string | DataLink
|
|
3069
|
+
/* The type of the default image hash */
|
|
3070
|
+
defaultImageHashType?: 'md5' | 'sha1' | 'sha256' | DataLink
|
|
2968
3071
|
/* The Lottie animation to show while generating */
|
|
2969
3072
|
loadingAnimation?: string | DataLink
|
|
2970
3073
|
/* The Lottie animation to show when an error occurs */
|
package/types/canvas.ts
CHANGED
|
@@ -14,7 +14,7 @@ interface CanvasDef {
|
|
|
14
14
|
showingTimeout?: number | DataLink
|
|
15
15
|
/* Canvas ID for change next canvas on showing timeout */
|
|
16
16
|
nextCanvasId?: string | DataLink | (() => Canvas)
|
|
17
|
-
/*
|
|
17
|
+
/* Background color of Canvas */
|
|
18
18
|
backgroundColor?: string | DataLink
|
|
19
19
|
/* Dismiss keyboard on press */
|
|
20
20
|
dismissKeyboardOnPress?: boolean | DataLink
|
package/types/common.ts
CHANGED
|
@@ -39,7 +39,7 @@ export type SubpsaceAction = string
|
|
|
39
39
|
export type Action = {
|
|
40
40
|
__actionName: string
|
|
41
41
|
parent: 'Brick' | 'Generator' | 'Subspace' | 'System'
|
|
42
|
-
name
|
|
42
|
+
name?: string
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
// Find correct key in bricks-project/utils/event-props for EventAction
|
|
@@ -65,7 +65,7 @@ export type ItemBrickID = string
|
|
|
65
65
|
|
|
66
66
|
export type EventAction = {
|
|
67
67
|
handler: 'system' | (() => Brick | Generator) | SubspaceID | ItemBrickID
|
|
68
|
-
action:
|
|
68
|
+
action: ActionWithParams | ActionWithDataParams
|
|
69
69
|
waitAsync?: boolean
|
|
70
70
|
}
|
|
71
71
|
|
package/types/data.ts
CHANGED
|
@@ -56,6 +56,11 @@ export type Data<T = any> = DataDef & {
|
|
|
56
56
|
| 'rich-text-content'
|
|
57
57
|
| 'sandbox-script'
|
|
58
58
|
| 'llm-prompt'
|
|
59
|
+
| 'llm-messages'
|
|
60
|
+
| 'llm-tools'
|
|
61
|
+
| 'mcp-server-resources'
|
|
62
|
+
| 'mcp-server-tools'
|
|
63
|
+
| 'mcp-server-prompts'
|
|
59
64
|
}
|
|
60
65
|
value: T
|
|
61
66
|
}
|
|
@@ -67,6 +72,7 @@ export type DataAssetKind = {
|
|
|
67
72
|
| 'media-resource-audio'
|
|
68
73
|
| 'media-resource-file'
|
|
69
74
|
| 'lottie-file-uri'
|
|
75
|
+
| 'rive-file-uri'
|
|
70
76
|
| 'ggml-model-asset'
|
|
71
77
|
| 'gguf-model-asset'
|
|
72
78
|
| 'binary-asset'
|