@fugood/bricks-project 2.22.3 → 2.22.5
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 +7 -0
- package/package.json +1 -1
- package/types/bricks/GenerativeMedia.ts +4 -2
- package/types/bricks/Slideshow.ts +37 -2
- package/types/data-calc.ts +1 -0
- package/types/generators/Iterator.ts +9 -2
- package/types/generators/SqLite.ts +30 -1
- package/types/generators/Tick.ts +3 -1
- package/utils/event-props.ts +29 -2
|
@@ -525,6 +525,13 @@ export const templateActionNameMap = {
|
|
|
525
525
|
params: 'GENERATOR_SQLITE_PARAMS',
|
|
526
526
|
paramsString: 'GENERATOR_SQLITE_PARAMS_STRING',
|
|
527
527
|
},
|
|
528
|
+
GENERATOR_SQLITE_TRANSACTION: {
|
|
529
|
+
statements: 'GENERATOR_SQLITE_STATEMENTS',
|
|
530
|
+
},
|
|
531
|
+
GENERATOR_SQLITE_BATCH_EXECUTE: {
|
|
532
|
+
sql: 'GENERATOR_SQLITE_SQL',
|
|
533
|
+
batchParams: 'GENERATOR_SQLITE_BATCH_PARAMS',
|
|
534
|
+
},
|
|
528
535
|
},
|
|
529
536
|
|
|
530
537
|
GENERATOR_MCP: {
|
package/package.json
CHANGED
|
@@ -44,8 +44,8 @@ Default property:
|
|
|
44
44
|
resizeMode?: 'contain' | 'cover' | 'stretch' | 'center' | 'repeat' | DataLink
|
|
45
45
|
/* The API key for the generative media service */
|
|
46
46
|
apiKey?: string | DataLink
|
|
47
|
-
/* The AI provider to use for generation (openai, freepik, or
|
|
48
|
-
provider?: 'openai' | 'freepik-classic' | 'deepai' | DataLink
|
|
47
|
+
/* The AI provider to use for generation (openai, freepik-classic, deepai, or gemini) */
|
|
48
|
+
provider?: 'openai' | 'freepik-classic' | 'deepai' | 'gemini' | DataLink
|
|
49
49
|
/* OpenAI image size (256x256, 512x512, 1024x1024, etc) */
|
|
50
50
|
openaiSize?: '1024x1024' | '1024x1792' | '1792x1024' | DataLink
|
|
51
51
|
/* OpenAI image style (vivid or natural) */
|
|
@@ -158,6 +158,8 @@ Default property:
|
|
|
158
158
|
deepaiWidth?: number | DataLink
|
|
159
159
|
/* DeepAI output image height */
|
|
160
160
|
deepaiHeight?: number | DataLink
|
|
161
|
+
/* Gemini aspect ratio (1:1, 16:9, 9:16, 3:2, 2:3) */
|
|
162
|
+
geminiAspectRatio?: '1:1' | '16:9' | '9:16' | '3:2' | '2:3' | DataLink
|
|
161
163
|
}
|
|
162
164
|
events?: BrickBasicEvents & {
|
|
163
165
|
/* Event of the brick press */
|
|
@@ -34,6 +34,26 @@ export type BrickSlideshowActionJumpToIndex = ActionWithParams & {
|
|
|
34
34
|
>
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
+
/* Play the slideshow (resume if paused) */
|
|
38
|
+
export type BrickSlideshowActionPlay = Action & {
|
|
39
|
+
__actionName: 'BRICK_SLIDESHOW_PLAY'
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/* Pause the slideshow */
|
|
43
|
+
export type BrickSlideshowActionPause = Action & {
|
|
44
|
+
__actionName: 'BRICK_SLIDESHOW_PAUSE'
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/* Go to next slide */
|
|
48
|
+
export type BrickSlideshowActionNext = Action & {
|
|
49
|
+
__actionName: 'BRICK_SLIDESHOW_NEXT'
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/* Go to previous slide */
|
|
53
|
+
export type BrickSlideshowActionPrev = Action & {
|
|
54
|
+
__actionName: 'BRICK_SLIDESHOW_PREV'
|
|
55
|
+
}
|
|
56
|
+
|
|
37
57
|
interface BrickSlideshowDef {
|
|
38
58
|
/*
|
|
39
59
|
Default property:
|
|
@@ -41,17 +61,28 @@ Default property:
|
|
|
41
61
|
"countdown": 2000,
|
|
42
62
|
"loop": true,
|
|
43
63
|
"shuffle": false,
|
|
64
|
+
"photoResizeMode": "contain",
|
|
65
|
+
"photoLoadSystemIos": "auto",
|
|
66
|
+
"photoLoadSystemAndroid": "auto",
|
|
67
|
+
"videoResizeMode": "contain",
|
|
68
|
+
"videoAutoAspectRatio": false,
|
|
44
69
|
"videoVolume": 100,
|
|
70
|
+
"videoMuted": false,
|
|
71
|
+
"videoRenderMode": "auto",
|
|
72
|
+
"fadeDuration": 0,
|
|
45
73
|
"emptyViewText": "no available image item to show",
|
|
46
74
|
"emptyViewTextSize": 44,
|
|
47
75
|
"emptyViewTextColor": "#fff",
|
|
76
|
+
"enableBlurBackground": false,
|
|
48
77
|
"blurBackgroundRadius": 8
|
|
49
78
|
}
|
|
50
79
|
*/
|
|
51
80
|
property?: BrickBasicProperty & {
|
|
52
81
|
/* The time interval of show for each photo */
|
|
53
82
|
countdown?: number | DataLink
|
|
54
|
-
/* The slideshow media path list (File, URL)
|
|
83
|
+
/* The slideshow media path list (File, URL)
|
|
84
|
+
Each path object can override global photo/video settings.
|
|
85
|
+
Item-level properties take precedence over brick-level properties. */
|
|
55
86
|
paths?:
|
|
56
87
|
| Array<
|
|
57
88
|
| DataLink
|
|
@@ -70,7 +101,8 @@ Default property:
|
|
|
70
101
|
}
|
|
71
102
|
>
|
|
72
103
|
| DataLink
|
|
73
|
-
/* Multiple slideshow media path lists to combine (Array of path arrays)
|
|
104
|
+
/* Multiple slideshow media path lists to combine (Array of path arrays).
|
|
105
|
+
All arrays are flattened and combined: [...paths, ...pathsList[0], ...pathsList[1], ...] */
|
|
74
106
|
pathsList?: Array<Array<any> | DataLink | DataLink> | DataLink
|
|
75
107
|
/* Loop the slideshow */
|
|
76
108
|
loop?: boolean | DataLink
|
|
@@ -122,6 +154,8 @@ Default property:
|
|
|
122
154
|
roundEnd?: Array<EventAction>
|
|
123
155
|
/* Event of the slideshow on load */
|
|
124
156
|
mediaOnLoad?: Array<EventAction>
|
|
157
|
+
/* Event of the slideshow media loading error */
|
|
158
|
+
mediaOnError?: Array<EventAction>
|
|
125
159
|
}
|
|
126
160
|
animation?: AnimationBasicEvents & {
|
|
127
161
|
changeStart?: Animation
|
|
@@ -129,6 +163,7 @@ Default property:
|
|
|
129
163
|
contentChange?: Animation
|
|
130
164
|
roundEnd?: Animation
|
|
131
165
|
mediaOnLoad?: Animation
|
|
166
|
+
mediaOnError?: Animation
|
|
132
167
|
}
|
|
133
168
|
}
|
|
134
169
|
|
package/types/data-calc.ts
CHANGED
|
@@ -5058,6 +5058,7 @@ export type DataCommandSandboxGetReturnValue = DataCommand & {
|
|
|
5058
5058
|
- coseVerify (cose.sign.verifySync from https://github.com/erdtman/COSE-JS)
|
|
5059
5059
|
- fflate (Not support async, callback and stream)
|
|
5060
5060
|
- iconv (Use iconv-lite)
|
|
5061
|
+
- OpenCC (Use opencc-js)
|
|
5061
5062
|
|
|
5062
5063
|
Android: Running on the sandbox of Hermes engine
|
|
5063
5064
|
|
|
@@ -19,6 +19,11 @@ export type GeneratorIteratorActionPrevious = Action & {
|
|
|
19
19
|
__actionName: 'GENERATOR_ITERATOR_PREVIOUS'
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
+
/* Jump to the first iteration element */
|
|
23
|
+
export type GeneratorIteratorActionFirst = Action & {
|
|
24
|
+
__actionName: 'GENERATOR_ITERATOR_FIRST'
|
|
25
|
+
}
|
|
26
|
+
|
|
22
27
|
/* Jump to the last iteration element (ignoring the loop setting) */
|
|
23
28
|
export type GeneratorIteratorActionLast = Action & {
|
|
24
29
|
__actionName: 'GENERATOR_ITERATOR_LAST'
|
|
@@ -39,13 +44,13 @@ Default property:
|
|
|
39
44
|
}
|
|
40
45
|
*/
|
|
41
46
|
property?: {
|
|
42
|
-
/* Data source for iteration. If it's an Array, it will iterate through elements. If it's an Object, it will use Object.
|
|
47
|
+
/* Data source for iteration. If it's an Array, it will iterate through elements. If it's an Object, it will use Object.entries() to get key-value pairs. If it's a String, it will iterate through characters. If it's a Number, it represents count from 1 to N. */
|
|
43
48
|
data?: any
|
|
44
49
|
/* Starting element position */
|
|
45
50
|
start?: number | DataLink
|
|
46
51
|
/* Step size for each iteration */
|
|
47
52
|
step?: number | DataLink
|
|
48
|
-
/* Maximum number of iterations (can be set to -1 for unlimited) */
|
|
53
|
+
/* Maximum number of iterations (can be set to -1 for unlimited). When reached, further iteration actions will be silently ignored. */
|
|
49
54
|
maxQuantity?: number | DataLink
|
|
50
55
|
/* Whether to loop the iteration */
|
|
51
56
|
loop?: boolean | DataLink
|
|
@@ -57,6 +62,8 @@ Default property:
|
|
|
57
62
|
first?: Array<EventAction>
|
|
58
63
|
/* Event triggered on the last iteration of a round */
|
|
59
64
|
end?: Array<EventAction>
|
|
65
|
+
/* Event triggered when data type is invalid or unexpected */
|
|
66
|
+
error?: Array<EventAction>
|
|
60
67
|
}
|
|
61
68
|
outlets?: {
|
|
62
69
|
/* Elements that have been iterated (including current one) */
|
|
@@ -53,6 +53,33 @@ export type GeneratorSqliteActionQuery = ActionWithParams & {
|
|
|
53
53
|
>
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
+
/* Execute multiple SQL statements in transaction */
|
|
57
|
+
export type GeneratorSqliteActionTransaction = ActionWithParams & {
|
|
58
|
+
__actionName: 'GENERATOR_SQLITE_TRANSACTION'
|
|
59
|
+
params?: Array<{
|
|
60
|
+
input: 'statements'
|
|
61
|
+
value?: Array<any> | DataLink | EventProperty
|
|
62
|
+
mapping?: string
|
|
63
|
+
}>
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/* Execute same SQL statement with multiple parameter sets */
|
|
67
|
+
export type GeneratorSqliteActionBatchExecute = ActionWithParams & {
|
|
68
|
+
__actionName: 'GENERATOR_SQLITE_BATCH_EXECUTE'
|
|
69
|
+
params?: Array<
|
|
70
|
+
| {
|
|
71
|
+
input: 'sql'
|
|
72
|
+
value?: string | DataLink | EventProperty
|
|
73
|
+
mapping?: string
|
|
74
|
+
}
|
|
75
|
+
| {
|
|
76
|
+
input: 'batchParams'
|
|
77
|
+
value?: Array<any> | DataLink | EventProperty
|
|
78
|
+
mapping?: string
|
|
79
|
+
}
|
|
80
|
+
>
|
|
81
|
+
}
|
|
82
|
+
|
|
56
83
|
interface GeneratorSqliteDef {
|
|
57
84
|
/*
|
|
58
85
|
Default property:
|
|
@@ -92,6 +119,8 @@ Default property:
|
|
|
92
119
|
error?: () => Data
|
|
93
120
|
/* Last query result */
|
|
94
121
|
lastResult?: () => Data
|
|
122
|
+
/* Last execute result with metadata */
|
|
123
|
+
lastExecuteResult?: () => Data
|
|
95
124
|
}
|
|
96
125
|
}
|
|
97
126
|
|
|
@@ -109,7 +138,7 @@ export type GeneratorSqlite = Generator &
|
|
|
109
138
|
| SwitchCondData
|
|
110
139
|
| {
|
|
111
140
|
__typename: 'SwitchCondInnerStateOutlet'
|
|
112
|
-
outlet: 'isReady' | 'dbPath' | 'error' | 'lastResult'
|
|
141
|
+
outlet: 'isReady' | 'dbPath' | 'error' | 'lastResult' | 'lastExecuteResult'
|
|
113
142
|
value: any
|
|
114
143
|
}
|
|
115
144
|
}>
|
package/types/generators/Tick.ts
CHANGED
|
@@ -49,6 +49,8 @@ Default property:
|
|
|
49
49
|
outlets?: {
|
|
50
50
|
/* Countdown step value */
|
|
51
51
|
countdown?: () => Data
|
|
52
|
+
/* Is tick running? */
|
|
53
|
+
running?: () => Data
|
|
52
54
|
}
|
|
53
55
|
}
|
|
54
56
|
|
|
@@ -66,7 +68,7 @@ export type GeneratorTick = Generator &
|
|
|
66
68
|
| SwitchCondData
|
|
67
69
|
| {
|
|
68
70
|
__typename: 'SwitchCondInnerStateOutlet'
|
|
69
|
-
outlet: 'countdown'
|
|
71
|
+
outlet: 'countdown' | 'running'
|
|
70
72
|
value: any
|
|
71
73
|
}
|
|
72
74
|
}>
|
package/utils/event-props.ts
CHANGED
|
@@ -55,6 +55,11 @@ export const templateEventPropsMap = {
|
|
|
55
55
|
'BRICK_SLIDESHOW_PAYLOAD_VALUE', // type: number
|
|
56
56
|
'BRICK_SLIDESHOW_ORIGINAL_INDEX', // type: number
|
|
57
57
|
],
|
|
58
|
+
mediaOnError: [
|
|
59
|
+
'BRICK_SLIDESHOW_ERROR_MESSAGE', // type: string
|
|
60
|
+
'BRICK_SLIDESHOW_ERROR_URL', // type: string
|
|
61
|
+
'BRICK_SLIDESHOW_ERROR_INDEX', // type: number
|
|
62
|
+
],
|
|
58
63
|
},
|
|
59
64
|
BRICK_CHART: {
|
|
60
65
|
onPress: [
|
|
@@ -408,7 +413,21 @@ export const templateEventPropsMap = {
|
|
|
408
413
|
iterate: [
|
|
409
414
|
'GENERATOR_ITERATOR_ITERATE_VALUE', // type: any
|
|
410
415
|
'GENERATOR_ITERATOR_ITERATE_KEY', // type: any
|
|
411
|
-
'GENERATOR_ITERATOR_ITERATE_INDEX', // type:
|
|
416
|
+
'GENERATOR_ITERATOR_ITERATE_INDEX', // type: number
|
|
417
|
+
],
|
|
418
|
+
first: [
|
|
419
|
+
'GENERATOR_ITERATOR_ITERATE_VALUE', // type: any
|
|
420
|
+
'GENERATOR_ITERATOR_ITERATE_KEY', // type: any
|
|
421
|
+
'GENERATOR_ITERATOR_ITERATE_INDEX', // type: number
|
|
422
|
+
],
|
|
423
|
+
end: [
|
|
424
|
+
'GENERATOR_ITERATOR_ITERATE_VALUE', // type: any
|
|
425
|
+
'GENERATOR_ITERATOR_ITERATE_KEY', // type: any
|
|
426
|
+
'GENERATOR_ITERATOR_ITERATE_INDEX', // type: number
|
|
427
|
+
],
|
|
428
|
+
error: [
|
|
429
|
+
'GENERATOR_ITERATOR_ERROR_MESSAGE', // type: string
|
|
430
|
+
'GENERATOR_ITERATOR_ERROR_DATA', // type: any
|
|
412
431
|
],
|
|
413
432
|
},
|
|
414
433
|
GENERATOR_WATCHDOG: {
|
|
@@ -847,7 +866,15 @@ export const templateEventPropsMap = {
|
|
|
847
866
|
'GENERATOR_GGML_TTS_ERROR', // type: string
|
|
848
867
|
],
|
|
849
868
|
},
|
|
850
|
-
GENERATOR_RERANKER: {
|
|
869
|
+
GENERATOR_RERANKER: {
|
|
870
|
+
onContextStateChange: [
|
|
871
|
+
'GENERATOR_RERANKER_CONTEXT_STATE', // type: string
|
|
872
|
+
'GENERATOR_RERANKER_CONTEXT_DETAILS', // type: object
|
|
873
|
+
],
|
|
874
|
+
onError: [
|
|
875
|
+
'GENERATOR_RERANKER_ERROR', // type: string
|
|
876
|
+
],
|
|
877
|
+
},
|
|
851
878
|
GENERATOR_QNN_LLM: {
|
|
852
879
|
onContextStateChange: [
|
|
853
880
|
'GENERATOR_QNN_LLM_CONTEXT_STATE', // type: string
|