@fugood/bricks-project 2.23.0-beta.4 → 2.23.0-beta.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fugood/bricks-project",
3
- "version": "2.23.0-beta.4",
3
+ "version": "2.23.0-beta.6",
4
4
  "main": "index.ts",
5
5
  "scripts": {
6
6
  "build": "node scripts/build.js"
@@ -14,5 +14,5 @@
14
14
  "lodash": "^4.17.4",
15
15
  "uuid": "^8.3.1"
16
16
  },
17
- "gitHead": "60e1e023f5bcd5bacfcad631994462a8dcab9d47"
17
+ "gitHead": "98664299bda5a920ff1096e2e62c68fd7c85a573"
18
18
  }
@@ -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
 
@@ -31,10 +31,21 @@ Default property:
31
31
  >
32
32
  | DataLink
33
33
  }
34
- outlets?: {}
34
+ events?: {
35
+ /* Event triggered when a rule matches and canvas navigation occurs */
36
+ onNavigate?: Array<EventAction>
37
+ }
38
+ outlets?: {
39
+ /* Last matched trigger rule that caused canvas navigation */
40
+ lastMatchedRule?: () => Data
41
+ /* Index of the last matched rule in triggerList */
42
+ lastMatchedIndex?: () => Data
43
+ /* Total count of canvas navigations triggered by this generator */
44
+ navigationCount?: () => Data
45
+ }
35
46
  }
36
47
 
37
- /* Trigger change canvas by setup rules */
48
+ /* Trigger canvas navigation by setup rules */
38
49
  export type GeneratorCanvasMap = Generator &
39
50
  GeneratorCanvasMapDef & {
40
51
  templateKey: 'GENERATOR_CANVAS_MAP'
@@ -48,7 +59,7 @@ export type GeneratorCanvasMap = Generator &
48
59
  | SwitchCondData
49
60
  | {
50
61
  __typename: 'SwitchCondInnerStateOutlet'
51
- outlet: ''
62
+ outlet: 'lastMatchedRule' | 'lastMatchedIndex' | 'navigationCount'
52
63
  value: any
53
64
  }
54
65
  }>
@@ -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: [
@@ -371,7 +376,16 @@ export const templateEventPropsMap = {
371
376
  'GENERATOR_WEB_SOCKET_MESSAGE', // type: any
372
377
  ],
373
378
  },
374
-
379
+ GENERATOR_CANVAS_MAP: {
380
+ onNavigate: [
381
+ 'GENERATOR_CANVAS_MAP_MATCHED_RULE', // type: object
382
+ 'GENERATOR_CANVAS_MAP_MATCHED_INDEX', // type: number
383
+ 'GENERATOR_CANVAS_MAP_TARGET_CANVAS_ID', // type: string
384
+ 'GENERATOR_CANVAS_MAP_TARGET_CANVAS_TITLE_LIKE', // type: string
385
+ 'GENERATOR_CANVAS_MAP_PROPERTY_VALUE', // type: any
386
+ 'GENERATOR_CANVAS_MAP_PREVIOUS_VALUE', // type: any
387
+ ],
388
+ },
375
389
  GENERATOR_STEP: {
376
390
  onStep: [
377
391
  'GENERATOR_STEP_PAYLOAD', // type: string