@fugood/bricks-project 2.21.0 → 2.21.2

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/types/system.ts CHANGED
@@ -1,4 +1,11 @@
1
- import type { Action, ActionWithDataParams, ActionWithParams, Brick, Generator } from './common'
1
+ import type {
2
+ Action,
3
+ ActionWithDataParams,
4
+ ActionWithParams,
5
+ Brick,
6
+ Generator,
7
+ EventProperty,
8
+ } from './common'
2
9
  import type { Animation } from './animation'
3
10
  import type { Canvas } from './canvas'
4
11
  import type { Data, DataLink } from './data'
@@ -9,27 +16,27 @@ export type SystemActionPropertyBankExpression = ActionWithParams & {
9
16
  params?: Array<
10
17
  | {
11
18
  input: 'expression'
12
- value?: string | DataLink
19
+ value?: string | DataLink | EventProperty
13
20
  mapping?: string
14
21
  }
15
22
  | {
16
23
  input: 'variables'
17
- value?: {} | DataLink
24
+ value?: {} | DataLink | EventProperty
18
25
  mapping?: string
19
26
  }
20
27
  | {
21
28
  input: 'result'
22
- value?: string | DataLink | (() => Data)
29
+ value?: string | DataLink | (() => Data) | EventProperty
23
30
  mapping?: string
24
31
  }
25
32
  | {
26
33
  input: 'resultAssignPath'
27
- value?: string | DataLink
34
+ value?: string | DataLink | EventProperty
28
35
  mapping?: string
29
36
  }
30
37
  | {
31
38
  input: 'errorResult'
32
- value?: string | DataLink | (() => Data)
39
+ value?: string | DataLink | (() => Data) | EventProperty
33
40
  mapping?: string
34
41
  }
35
42
  >
@@ -51,27 +58,27 @@ export type SystemActionDynamicBrick = ActionWithParams & {
51
58
  params?: Array<
52
59
  | {
53
60
  input: 'addList'
54
- value?: string | DataLink
61
+ value?: string | DataLink | EventProperty
55
62
  mapping?: string
56
63
  }
57
64
  | {
58
65
  input: 'preferAfterItemId'
59
- value?: string | DataLink
66
+ value?: string | DataLink | EventProperty
60
67
  mapping?: string
61
68
  }
62
69
  | {
63
70
  input: 'reset'
64
- value?: boolean | DataLink
71
+ value?: boolean | DataLink | EventProperty
65
72
  mapping?: string
66
73
  }
67
74
  | {
68
75
  input: 'removeItemId'
69
- value?: string | DataLink
76
+ value?: string | DataLink | EventProperty
70
77
  mapping?: string
71
78
  }
72
79
  | {
73
80
  input: 'removeItems'
74
- value?: string | DataLink
81
+ value?: string | DataLink | EventProperty
75
82
  mapping?: string
76
83
  }
77
84
  >
@@ -88,22 +95,22 @@ export type SystemActionDynamicAnimation = ActionWithParams & {
88
95
  params?: Array<
89
96
  | {
90
97
  input: 'brickId'
91
- value?: string | DataLink | (() => Brick)
98
+ value?: string | DataLink | (() => Brick) | EventProperty
92
99
  mapping?: string
93
100
  }
94
101
  | {
95
102
  input: 'animationId'
96
- value?: string | DataLink | (() => Animation)
103
+ value?: string | DataLink | (() => Animation) | EventProperty
97
104
  mapping?: string
98
105
  }
99
106
  | {
100
107
  input: 'runType'
101
- value?: 'once' | 'loop' | DataLink
108
+ value?: 'once' | 'loop' | DataLink | EventProperty
102
109
  mapping?: string
103
110
  }
104
111
  | {
105
112
  input: 'resetInitialValue'
106
- value?: boolean | DataLink
113
+ value?: boolean | DataLink | EventProperty
107
114
  mapping?: string
108
115
  }
109
116
  >
@@ -114,7 +121,7 @@ export type SystemActionDynamicAnimationReset = ActionWithParams & {
114
121
  __actionName: 'DYNAMIC_ANIMATION_RESET'
115
122
  params?: Array<{
116
123
  input: 'dynamicAnimationBrickId'
117
- value?: string | DataLink | (() => Brick)
124
+ value?: string | DataLink | (() => Brick) | EventProperty
118
125
  mapping?: string
119
126
  }>
120
127
  }
@@ -124,7 +131,7 @@ export type SystemActionDynamicAnimationStop = ActionWithParams & {
124
131
  __actionName: 'DYNAMIC_ANIMATION_STOP'
125
132
  params?: Array<{
126
133
  input: 'dynamicAnimationBrickId'
127
- value?: string | DataLink | (() => Brick)
134
+ value?: string | DataLink | (() => Brick) | EventProperty
128
135
  mapping?: string
129
136
  }>
130
137
  }
@@ -135,22 +142,22 @@ export type SystemActionChangeCanvas = ActionWithParams & {
135
142
  params?: Array<
136
143
  | {
137
144
  input: 'canvasId'
138
- value?: string | DataLink | (() => Canvas)
145
+ value?: string | DataLink | (() => Canvas) | EventProperty
139
146
  mapping?: string
140
147
  }
141
148
  | {
142
149
  input: 'canvasTitleLike'
143
- value?: string | DataLink
150
+ value?: string | DataLink | EventProperty
144
151
  mapping?: string
145
152
  }
146
153
  | {
147
154
  input: 'canvasKeyMapList'
148
- value?: {} | DataLink
155
+ value?: {} | DataLink | EventProperty
149
156
  mapping?: string
150
157
  }
151
158
  | {
152
159
  input: 'canvasKey'
153
- value?: string | DataLink
160
+ value?: string | DataLink | EventProperty
154
161
  mapping?: string
155
162
  }
156
163
  >
@@ -168,16 +175,17 @@ export type SystemActionMessage = ActionWithParams & {
168
175
  | 'SYSTEM_MESSAGE_TYPE_WARNING'
169
176
  | 'SYSTEM_MESSAGE_TYPE_ERROR'
170
177
  | DataLink
178
+ | EventProperty
171
179
  mapping?: string
172
180
  }
173
181
  | {
174
182
  input: 'title'
175
- value?: string | DataLink
183
+ value?: string | DataLink | EventProperty
176
184
  mapping?: string
177
185
  }
178
186
  | {
179
187
  input: 'message'
180
- value?: string | DataLink
188
+ value?: string | DataLink | EventProperty
181
189
  mapping?: string
182
190
  }
183
191
  >
@@ -189,42 +197,42 @@ export type SystemActionAlert = ActionWithParams & {
189
197
  params?: Array<
190
198
  | {
191
199
  input: 'id'
192
- value?: string | DataLink
200
+ value?: string | DataLink | EventProperty
193
201
  mapping?: string
194
202
  }
195
203
  | {
196
204
  input: 'type'
197
- value?: 'info' | 'success' | 'warning' | 'error' | DataLink
205
+ value?: 'info' | 'success' | 'warning' | 'error' | DataLink | EventProperty
198
206
  mapping?: string
199
207
  }
200
208
  | {
201
209
  input: 'title'
202
- value?: string | DataLink
210
+ value?: string | DataLink | EventProperty
203
211
  mapping?: string
204
212
  }
205
213
  | {
206
214
  input: 'message'
207
- value?: string | DataLink
215
+ value?: string | DataLink | EventProperty
208
216
  mapping?: string
209
217
  }
210
218
  | {
211
219
  input: 'selections'
212
- value?: {} | DataLink
220
+ value?: {} | DataLink | EventProperty
213
221
  mapping?: string
214
222
  }
215
223
  | {
216
224
  input: 'selectionResult'
217
- value?: string | DataLink | (() => Data)
225
+ value?: string | DataLink | (() => Data) | EventProperty
218
226
  mapping?: string
219
227
  }
220
228
  | {
221
229
  input: 'timeout'
222
- value?: number | DataLink
230
+ value?: number | DataLink | EventProperty
223
231
  mapping?: string
224
232
  }
225
233
  | {
226
234
  input: 'hideSelections'
227
- value?: boolean | DataLink
235
+ value?: boolean | DataLink | EventProperty
228
236
  mapping?: string
229
237
  }
230
238
  >
@@ -236,12 +244,12 @@ export type SystemActionPopupReset = ActionWithParams & {
236
244
  params?: Array<
237
245
  | {
238
246
  input: 'popupClearType'
239
- value?: 'all' | 'alert' | 'generator' | DataLink
247
+ value?: 'all' | 'alert' | 'generator' | DataLink | EventProperty
240
248
  mapping?: string
241
249
  }
242
250
  | {
243
251
  input: 'popupId'
244
- value?: string | DataLink
252
+ value?: string | DataLink | EventProperty
245
253
  mapping?: string
246
254
  }
247
255
  >
@@ -253,37 +261,128 @@ export type SystemActionTakeScreenshot = ActionWithParams & {
253
261
  params?: Array<
254
262
  | {
255
263
  input: 'currentSubspace'
256
- value?: boolean | DataLink
264
+ value?: boolean | DataLink | EventProperty
257
265
  mapping?: string
258
266
  }
259
267
  | {
260
268
  input: 'brickId'
261
- value?: string | DataLink | (() => Brick)
269
+ value?: string | DataLink | (() => Brick) | EventProperty
262
270
  mapping?: string
263
271
  }
264
272
  | {
265
273
  input: 'format'
266
- value?: 'jpg' | 'png' | DataLink
274
+ value?: 'jpg' | 'png' | DataLink | EventProperty
267
275
  mapping?: string
268
276
  }
269
277
  | {
270
278
  input: 'quality'
271
- value?: number | DataLink
279
+ value?: number | DataLink | EventProperty
272
280
  mapping?: string
273
281
  }
274
282
  | {
275
283
  input: 'width'
276
- value?: number | DataLink
284
+ value?: number | DataLink | EventProperty
277
285
  mapping?: string
278
286
  }
279
287
  | {
280
288
  input: 'height'
281
- value?: number | DataLink
289
+ value?: number | DataLink | EventProperty
282
290
  mapping?: string
283
291
  }
284
292
  | {
285
293
  input: 'saveProperty'
286
- value?: string | DataLink | (() => Data)
294
+ value?: string | DataLink | (() => Data) | EventProperty
295
+ mapping?: string
296
+ }
297
+ >
298
+ }
299
+
300
+ /* Store a value in application-specific storage */
301
+ export type SystemActionStorageSet = ActionWithParams & {
302
+ __actionName: 'STORAGE_SET'
303
+ params?: Array<
304
+ | {
305
+ input: 'storageType'
306
+ value?: 'persist' | 'in-memory' | DataLink | EventProperty
307
+ mapping?: string
308
+ }
309
+ | {
310
+ input: 'storageScope'
311
+ value?: 'global' | 'subspace' | DataLink | EventProperty
312
+ mapping?: string
313
+ }
314
+ | {
315
+ input: 'storageKey'
316
+ value?: string | DataLink | EventProperty
317
+ mapping?: string
318
+ }
319
+ | {
320
+ input: 'storageValue'
321
+ value?: any | EventProperty
322
+ mapping?: string
323
+ }
324
+ >
325
+ }
326
+
327
+ /* Retrieve a value from application-specific storage */
328
+ export type SystemActionStorageRetrieve = ActionWithParams & {
329
+ __actionName: 'STORAGE_RETRIEVE'
330
+ params?: Array<
331
+ | {
332
+ input: 'storageType'
333
+ value?: 'persist' | 'in-memory' | DataLink | EventProperty
334
+ mapping?: string
335
+ }
336
+ | {
337
+ input: 'storageScope'
338
+ value?: 'global' | 'subspace' | DataLink | EventProperty
339
+ mapping?: string
340
+ }
341
+ | {
342
+ input: 'storageKey'
343
+ value?: string | DataLink | EventProperty
344
+ mapping?: string
345
+ }
346
+ | {
347
+ input: 'result'
348
+ value?: string | DataLink | (() => Data) | EventProperty
349
+ mapping?: string
350
+ }
351
+ | {
352
+ input: 'defaultValue'
353
+ value?: string | DataLink | EventProperty
354
+ mapping?: string
355
+ }
356
+ | {
357
+ input: 'skipIfNotFound'
358
+ value?: boolean | DataLink | EventProperty
359
+ mapping?: string
360
+ }
361
+ >
362
+ }
363
+
364
+ /* Delete a value from application-specific storage or clear all values */
365
+ export type SystemActionStorageDelete = ActionWithParams & {
366
+ __actionName: 'STORAGE_DELETE'
367
+ params?: Array<
368
+ | {
369
+ input: 'storageType'
370
+ value?: 'persist' | 'in-memory' | DataLink | EventProperty
371
+ mapping?: string
372
+ }
373
+ | {
374
+ input: 'storageScope'
375
+ value?: 'global' | 'subspace' | DataLink | EventProperty
376
+ mapping?: string
377
+ }
378
+ | {
379
+ input: 'storageKey'
380
+ value?: string | DataLink | EventProperty
381
+ mapping?: string
382
+ }
383
+ | {
384
+ input: 'all'
385
+ value?: boolean | DataLink | EventProperty
287
386
  mapping?: string
288
387
  }
289
388
  >
@@ -295,42 +394,42 @@ export type SystemActionChannelSubscribe = ActionWithParams & {
295
394
  params?: Array<
296
395
  | {
297
396
  input: 'key'
298
- value?: string | DataLink
397
+ value?: string | DataLink | EventProperty
299
398
  mapping?: string
300
399
  }
301
400
  | {
302
401
  input: 'type'
303
- value?: 'on' | 'once' | DataLink
402
+ value?: 'on' | 'once' | DataLink | EventProperty
304
403
  mapping?: string
305
404
  }
306
405
  | {
307
406
  input: 'livetime'
308
- value?: number | DataLink
407
+ value?: number | DataLink | EventProperty
309
408
  mapping?: string
310
409
  }
311
410
  | {
312
411
  input: 'dataResult'
313
- value?: string | DataLink | (() => Data)
412
+ value?: string | DataLink | (() => Data) | EventProperty
314
413
  mapping?: string
315
414
  }
316
415
  | {
317
416
  input: 'dataAssignList'
318
- value?: {} | DataLink
417
+ value?: {} | DataLink | EventProperty
319
418
  mapping?: string
320
419
  }
321
420
  | {
322
421
  input: 'progressResult'
323
- value?: string | DataLink | (() => Data)
422
+ value?: string | DataLink | (() => Data) | EventProperty
324
423
  mapping?: string
325
424
  }
326
425
  | {
327
426
  input: 'progressAssignList'
328
- value?: {} | DataLink
427
+ value?: {} | DataLink | EventProperty
329
428
  mapping?: string
330
429
  }
331
430
  | {
332
431
  input: 'errorResult'
333
- value?: string | DataLink | (() => Data)
432
+ value?: string | DataLink | (() => Data) | EventProperty
334
433
  mapping?: string
335
434
  }
336
435
  >
@@ -341,7 +440,7 @@ export type SystemActionChannelUnsubscribe = ActionWithParams & {
341
440
  __actionName: 'CHANNEL_UNSUBSCRIBE'
342
441
  params?: Array<{
343
442
  input: 'keyMatch'
344
- value?: string | DataLink
443
+ value?: string | DataLink | EventProperty
345
444
  mapping?: string
346
445
  }>
347
446
  }
@@ -352,17 +451,17 @@ export type SystemActionChannelPublish = ActionWithParams & {
352
451
  params?: Array<
353
452
  | {
354
453
  input: 'keyMatch'
355
- value?: string | DataLink
454
+ value?: string | DataLink | EventProperty
356
455
  mapping?: string
357
456
  }
358
457
  | {
359
458
  input: 'payloadType'
360
- value?: 'result' | 'progress' | 'error' | DataLink
459
+ value?: 'result' | 'progress' | 'error' | DataLink | EventProperty
361
460
  mapping?: string
362
461
  }
363
462
  | {
364
463
  input: 'payload'
365
- value?: string | DataLink
464
+ value?: string | DataLink | EventProperty
366
465
  mapping?: string
367
466
  }
368
467
  >
@@ -374,32 +473,32 @@ export type SystemActionUseShareApplication = ActionWithParams & {
374
473
  params?: Array<
375
474
  | {
376
475
  input: 'applicationId'
377
- value?: string | DataLink
476
+ value?: string | DataLink | EventProperty
378
477
  mapping?: string
379
478
  }
380
479
  | {
381
480
  input: 'releaseVersion'
382
- value?: string | DataLink
481
+ value?: string | DataLink | EventProperty
383
482
  mapping?: string
384
483
  }
385
484
  | {
386
485
  input: 'useType'
387
- value?: 'run' | 'use-after-bind' | 'cancel-use' | DataLink
486
+ value?: 'run' | 'use-after-bind' | 'cancel-use' | DataLink | EventProperty
388
487
  mapping?: string
389
488
  }
390
489
  | {
391
490
  input: 'viewportPresetNameLike'
392
- value?: string | DataLink
491
+ value?: string | DataLink | EventProperty
393
492
  mapping?: string
394
493
  }
395
494
  | {
396
495
  input: 'viewportPresetDeviceTarget'
397
- value?: string | DataLink
496
+ value?: string | DataLink | EventProperty
398
497
  mapping?: string
399
498
  }
400
499
  | {
401
500
  input: 'enableLocalSync'
402
- value?: boolean | DataLink
501
+ value?: boolean | DataLink | EventProperty
403
502
  mapping?: string
404
503
  }
405
504
  >
@@ -421,17 +520,17 @@ export type SystemActionOpenUrl = ActionWithParams & {
421
520
  params?: Array<
422
521
  | {
423
522
  input: 'url'
424
- value?: string | DataLink
523
+ value?: string | DataLink | EventProperty
425
524
  mapping?: string
426
525
  }
427
526
  | {
428
527
  input: 'behavior'
429
- value?: 'in-app' | 'new-window' | DataLink
528
+ value?: 'in-app' | 'new-window' | DataLink | EventProperty
430
529
  mapping?: string
431
530
  }
432
531
  | {
433
532
  input: 'inAppTintColor'
434
- value?: string | DataLink
533
+ value?: string | DataLink | EventProperty
435
534
  mapping?: string
436
535
  }
437
536
  >
@@ -443,37 +542,37 @@ export type SystemActionOpenFile = ActionWithParams & {
443
542
  params?: Array<
444
543
  | {
445
544
  input: 'pickType'
446
- value?: 'file' | 'multiple' | 'directory' | DataLink
545
+ value?: 'file' | 'multiple' | 'directory' | DataLink | EventProperty
447
546
  mapping?: string
448
547
  }
449
548
  | {
450
549
  input: 'fileType'
451
- value?: any
550
+ value?: any | EventProperty
452
551
  mapping?: string
453
552
  }
454
553
  | {
455
554
  input: 'copyTo'
456
- value?: 'cache' | 'document' | DataLink
555
+ value?: 'cache' | 'document' | DataLink | EventProperty
457
556
  mapping?: string
458
557
  }
459
558
  | {
460
559
  input: 'mode'
461
- value?: 'import' | 'open' | DataLink
560
+ value?: 'import' | 'open' | DataLink | EventProperty
462
561
  mapping?: string
463
562
  }
464
563
  | {
465
564
  input: 'saveProperty'
466
- value?: string | DataLink | (() => Data)
565
+ value?: string | DataLink | (() => Data) | EventProperty
467
566
  mapping?: string
468
567
  }
469
568
  | {
470
569
  input: 'saveDetailProperty'
471
- value?: string | DataLink | (() => Data)
570
+ value?: string | DataLink | (() => Data) | EventProperty
472
571
  mapping?: string
473
572
  }
474
573
  | {
475
574
  input: 'errorSaveProperty'
476
- value?: string | DataLink | (() => Data)
575
+ value?: string | DataLink | (() => Data) | EventProperty
477
576
  mapping?: string
478
577
  }
479
578
  >
@@ -485,12 +584,12 @@ export type SystemActionThrowException = ActionWithParams & {
485
584
  params?: Array<
486
585
  | {
487
586
  input: 'behavior'
488
- value?: 'application' | 'application-render' | 'native' | DataLink
587
+ value?: 'application' | 'application-render' | 'native' | DataLink | EventProperty
489
588
  mapping?: string
490
589
  }
491
590
  | {
492
591
  input: 'exceptionMessage'
493
- value?: string | DataLink
592
+ value?: string | DataLink | EventProperty
494
593
  mapping?: string
495
594
  }
496
595
  >