@fugood/bricks-project 2.21.0-beta.25 → 2.21.0-beta.26

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.
@@ -60,6 +60,22 @@ export const templateActionNameMap = {
60
60
  height: 'TAKE_SCREENSHOT_HEIGHT',
61
61
  saveProperty: 'TAKE_SCREENSHOT_SAVE_PROPERTY',
62
62
  },
63
+ CHANNEL_SUBSCRIBE: {
64
+ key: 'CHANNEL_SUBSCRIBE_KEY',
65
+ type: 'CHANNEL_SUBSCRIBE_TYPE',
66
+ livetime: 'CHANNEL_SUBSCRIBE_LIVETIME',
67
+ dataResult: 'CHANNEL_SUBSCRIBE_DATA_RESULT',
68
+ progressResult: 'CHANNEL_SUBSCRIBE_PROGRESS_RESULT',
69
+ errorResult: 'CHANNEL_SUBSCRIBE_ERROR_RESULT',
70
+ },
71
+ CHANNEL_UNSUBSCRIBE: {
72
+ keyMatch: 'CHANNEL_UNSUBSCRIBE_KEY_MATCH',
73
+ },
74
+ CHANNEL_PUBLISH: {
75
+ keyMatch: 'CHANNEL_PUBLISH_KEY_MATCH',
76
+ payloadType: 'CHANNEL_PUBLISH_PAYLOAD_TYPE',
77
+ payload: 'CHANNEL_PUBLISH_PAYLOAD',
78
+ },
63
79
  USE_SHARE_APPLICATION: {
64
80
  applicationId: 'APPLICATION_ID',
65
81
  releaseVersion: 'RELEASE_VERSION',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fugood/bricks-project",
3
- "version": "2.21.0-beta.25",
3
+ "version": "2.21.0-beta.26",
4
4
  "main": "index.ts",
5
5
  "scripts": {
6
6
  "build": "node scripts/build.js"
@@ -13,5 +13,5 @@
13
13
  "lodash": "^4.17.4",
14
14
  "uuid": "^8.3.1"
15
15
  },
16
- "gitHead": "ab6c290fc51b20eb046cb31b9f37ac98de2de3b7"
16
+ "gitHead": "7983dcaadfdfdc326a1376a65be42368f08abf96"
17
17
  }
package/types/bricks.ts CHANGED
@@ -772,7 +772,8 @@ interface BrickSvgDef {
772
772
  Default property:
773
773
  {
774
774
  "source": "",
775
- "uri": ""
775
+ "uri": "",
776
+ "renderMode": "general"
776
777
  }
777
778
  */
778
779
  property?: BrickBasicProperty & {
@@ -792,6 +793,8 @@ Default property:
792
793
  }
793
794
  >
794
795
  | DataLink
796
+ /* The render mode */
797
+ renderMode?: 'general' | 'legacy' | DataLink
795
798
  }
796
799
  events?: BrickBasicEvents & {
797
800
  /* Event of the brick press */
@@ -41,9 +41,35 @@ Default property:
41
41
  }
42
42
  events?: {
43
43
  /* Event for each tick start */
44
- ticking?: Array<EventAction>
44
+ ticking?: Array<
45
+ EventAction & {
46
+ eventPropertyMapping?: {
47
+ countdown: {
48
+ type: 'number'
49
+ path: string
50
+ }
51
+ value: {
52
+ type: 'any'
53
+ path: string
54
+ }
55
+ }
56
+ }
57
+ >
45
58
  /* Event for tick completed */
46
- completed?: Array<EventAction>
59
+ completed?: Array<
60
+ EventAction & {
61
+ eventPropertyMapping?: {
62
+ countdown: {
63
+ type: 'number'
64
+ path: string
65
+ }
66
+ value: {
67
+ type: 'any'
68
+ path: string
69
+ }
70
+ }
71
+ }
72
+ >
47
73
  }
48
74
  outlets?: {
49
75
  /* Result of each countdown change */
package/types/system.ts CHANGED
@@ -279,6 +279,75 @@ export type SystemActionTakeScreenshot = ActionWithParams & {
279
279
  >
280
280
  }
281
281
 
282
+ /* Subscribe to a channel for data update */
283
+ export type SystemActionChannelSubscribe = ActionWithParams & {
284
+ __actionName: 'CHANNEL_SUBSCRIBE'
285
+ params?: Array<
286
+ | {
287
+ input: 'key'
288
+ value?: string | DataLink
289
+ mapping?: string
290
+ }
291
+ | {
292
+ input: 'type'
293
+ value?: 'on' | 'once' | DataLink
294
+ mapping?: string
295
+ }
296
+ | {
297
+ input: 'livetime'
298
+ value?: number | DataLink
299
+ mapping?: string
300
+ }
301
+ | {
302
+ input: 'dataResult'
303
+ value?: string | DataLink | (() => Data)
304
+ mapping?: string
305
+ }
306
+ | {
307
+ input: 'progressResult'
308
+ value?: string | DataLink | (() => Data)
309
+ mapping?: string
310
+ }
311
+ | {
312
+ input: 'errorResult'
313
+ value?: string | DataLink | (() => Data)
314
+ mapping?: string
315
+ }
316
+ >
317
+ }
318
+
319
+ /* Unsubscribe from a channel */
320
+ export type SystemActionChannelUnsubscribe = ActionWithParams & {
321
+ __actionName: 'CHANNEL_UNSUBSCRIBE'
322
+ params?: Array<{
323
+ input: 'keyMatch'
324
+ value?: string | DataLink
325
+ mapping?: string
326
+ }>
327
+ }
328
+
329
+ /* Publish data to a channel */
330
+ export type SystemActionChannelPublish = ActionWithParams & {
331
+ __actionName: 'CHANNEL_PUBLISH'
332
+ params?: Array<
333
+ | {
334
+ input: 'keyMatch'
335
+ value?: string | DataLink
336
+ mapping?: string
337
+ }
338
+ | {
339
+ input: 'payloadType'
340
+ value?: 'result' | 'progress' | 'error' | DataLink
341
+ mapping?: string
342
+ }
343
+ | {
344
+ input: 'payload'
345
+ value?: string | DataLink
346
+ mapping?: string
347
+ }
348
+ >
349
+ }
350
+
282
351
  /* [Internal] Use a shared application */
283
352
  export type SystemActionUseShareApplication = ActionWithParams & {
284
353
  __actionName: 'USE_SHARE_APPLICATION'