@fugood/bricks-project 2.22.1 → 2.23.0-beta.1
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 +0 -13
- package/package.json +3 -2
- package/types/bricks/Chart.ts +3 -0
- package/types/bricks/GenerativeMedia.ts +3 -1
- package/types/bricks/WebView.ts +2 -2
- package/types/system.ts +1 -1
- package/utils/event-props.ts +0 -17
- package/types/bricks/3DViewer.ts +0 -200
|
@@ -304,19 +304,6 @@ export const templateActionNameMap = {
|
|
|
304
304
|
},
|
|
305
305
|
},
|
|
306
306
|
|
|
307
|
-
BRICK_3D_VIEWER: {
|
|
308
|
-
BRICK_3D_VIEWER_ANIMATION_PLAY: {
|
|
309
|
-
objectIndex: 'BRICK_3D_VIEWER_OBJECT_INDEX',
|
|
310
|
-
},
|
|
311
|
-
BRICK_3D_VIEWER_ANIMATION_PAUSE: {
|
|
312
|
-
objectIndex: 'BRICK_3D_VIEWER_OBJECT_INDEX',
|
|
313
|
-
},
|
|
314
|
-
BRICK_3D_VIEWER_ANIMATION_GOTO: {
|
|
315
|
-
objectIndex: 'BRICK_3D_VIEWER_OBJECT_INDEX',
|
|
316
|
-
animationProgress: 'BRICK_3D_VIEWER_ANIMATION_PROGRESS',
|
|
317
|
-
},
|
|
318
|
-
},
|
|
319
|
-
|
|
320
307
|
GENERATOR_FILE: {
|
|
321
308
|
GENERATOR_FILE_READ_CONTENT: {
|
|
322
309
|
encoding: 'ENCODING',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fugood/bricks-project",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.23.0-beta.1",
|
|
4
4
|
"main": "index.ts",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "node scripts/build.js"
|
|
@@ -13,5 +13,6 @@
|
|
|
13
13
|
"escodegen": "^2.1.0",
|
|
14
14
|
"lodash": "^4.17.4",
|
|
15
15
|
"uuid": "^8.3.1"
|
|
16
|
-
}
|
|
16
|
+
},
|
|
17
|
+
"gitHead": "8d613e8b77ae47fde21212b9e9f77a3cc4e7278d"
|
|
17
18
|
}
|
package/types/bricks/Chart.ts
CHANGED
|
@@ -255,6 +255,7 @@ interface BrickChartDef {
|
|
|
255
255
|
/*
|
|
256
256
|
Default property:
|
|
257
257
|
{
|
|
258
|
+
"renderMode": "svg",
|
|
258
259
|
"legendShow": true,
|
|
259
260
|
"xAxisShow": true,
|
|
260
261
|
"xAxisType": "category",
|
|
@@ -265,6 +266,8 @@ Default property:
|
|
|
265
266
|
}
|
|
266
267
|
*/
|
|
267
268
|
property?: BrickBasicProperty & {
|
|
269
|
+
/* The render mode */
|
|
270
|
+
renderMode?: 'svg' | 'skia' | DataLink
|
|
268
271
|
/* Theme. You can use https://echarts.apache.org/en/theme-builder.html to generate theme */
|
|
269
272
|
themeEntry?: {} | DataLink
|
|
270
273
|
/* Theme of URL (.json) */
|
|
@@ -198,6 +198,8 @@ Default property:
|
|
|
198
198
|
url?: () => Data
|
|
199
199
|
/* Generated media error */
|
|
200
200
|
error?: () => Data
|
|
201
|
+
/* Loading state */
|
|
202
|
+
loading?: () => Data
|
|
201
203
|
}
|
|
202
204
|
animation?: AnimationBasicEvents & {
|
|
203
205
|
generativeMediaOnPress?: Animation
|
|
@@ -231,7 +233,7 @@ export type GenerativeMedia = Brick &
|
|
|
231
233
|
| SwitchCondData
|
|
232
234
|
| {
|
|
233
235
|
__typename: 'SwitchCondInnerStateOutlet'
|
|
234
|
-
outlet: 'brickPressing' | 'brickFocusing' | 'url' | 'error'
|
|
236
|
+
outlet: 'brickPressing' | 'brickFocusing' | 'url' | 'error' | 'loading'
|
|
235
237
|
value: any
|
|
236
238
|
}
|
|
237
239
|
}>
|
package/types/bricks/WebView.ts
CHANGED
|
@@ -75,7 +75,7 @@ Default property:
|
|
|
75
75
|
/* The WebView content URL */
|
|
76
76
|
url?: string | DataLink
|
|
77
77
|
/* The request headers to load content */
|
|
78
|
-
headers?:
|
|
78
|
+
headers?: Record<string, string | DataLink> | DataLink
|
|
79
79
|
/* The request UserAgent */
|
|
80
80
|
userAgent?: string | DataLink
|
|
81
81
|
/* The webview content HTML (Use `url` first) */
|
|
@@ -100,7 +100,7 @@ Default property:
|
|
|
100
100
|
cacheEnabled?: boolean | DataLink
|
|
101
101
|
/* Enable Geolocation */
|
|
102
102
|
geolocationEnabled?: boolean | DataLink
|
|
103
|
-
/* Enable Third Party
|
|
103
|
+
/* Enable Third Party Cookies */
|
|
104
104
|
thirdPartyCookiesEnabled?: boolean | DataLink
|
|
105
105
|
/* Enable JavaScript */
|
|
106
106
|
javaScriptEnabled?: boolean | DataLink
|
package/types/system.ts
CHANGED
|
@@ -594,7 +594,7 @@ export type SystemActionThrowException = ActionWithParams & {
|
|
|
594
594
|
params?: Array<
|
|
595
595
|
| {
|
|
596
596
|
input: 'behavior'
|
|
597
|
-
value?: 'application' | '
|
|
597
|
+
value?: 'application' | 'native' | DataLink | EventProperty
|
|
598
598
|
mapping?: string
|
|
599
599
|
}
|
|
600
600
|
| {
|
package/utils/event-props.ts
CHANGED
|
@@ -180,23 +180,6 @@ export const templateEventPropsMap = {
|
|
|
180
180
|
],
|
|
181
181
|
},
|
|
182
182
|
|
|
183
|
-
BRICK_3D_VIEWER: {
|
|
184
|
-
onError: [
|
|
185
|
-
'BRICK_3D_VIEWER_ERROR_MESSAGE', // type: string
|
|
186
|
-
],
|
|
187
|
-
onChange: [
|
|
188
|
-
'BRICK_3D_VIEWER_OBJECT_INDEX', // type: number
|
|
189
|
-
'BRICK_3D_VIEWER_OBJECT_POSITION', // type: object
|
|
190
|
-
'BRICK_3D_VIEWER_OBJECT_ROTATION', // type: object
|
|
191
|
-
],
|
|
192
|
-
onSelectChange: [
|
|
193
|
-
'BRICK_3D_VIEWER_OBJECT_INDEX', // type: number
|
|
194
|
-
],
|
|
195
|
-
onCollision: [
|
|
196
|
-
'BRICK_3D_VIEWER_OBJECT_INDEX', // type: number
|
|
197
|
-
'BRICK_3D_VIEWER_COLLISION_TYPE', // type: string
|
|
198
|
-
],
|
|
199
|
-
},
|
|
200
183
|
BRICK_GENERATIVE_MEDIA: {
|
|
201
184
|
onSuccess: [
|
|
202
185
|
'BRICK_GENERATIVE_MEDIA_URL', // type: string
|
package/types/bricks/3DViewer.ts
DELETED
|
@@ -1,200 +0,0 @@
|
|
|
1
|
-
import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
|
|
2
|
-
import type { Data, DataLink } from '../data'
|
|
3
|
-
import type { Animation, AnimationBasicEvents } from '../animation'
|
|
4
|
-
import type {
|
|
5
|
-
Brick,
|
|
6
|
-
EventAction,
|
|
7
|
-
EventActionForItem,
|
|
8
|
-
ActionWithDataParams,
|
|
9
|
-
ActionWithParams,
|
|
10
|
-
Action,
|
|
11
|
-
EventProperty,
|
|
12
|
-
} from '../common'
|
|
13
|
-
import type { BrickBasicProperty, BrickBasicEvents, BrickBasicEventsForItem } from '../brick-base'
|
|
14
|
-
|
|
15
|
-
/* Play object animation */
|
|
16
|
-
export type Brick3DViewerActionAnimationPlay = ActionWithParams & {
|
|
17
|
-
__actionName: 'BRICK_3D_VIEWER_ANIMATION_PLAY'
|
|
18
|
-
params?: Array<{
|
|
19
|
-
input: 'objectIndex'
|
|
20
|
-
value?: number | DataLink | EventProperty
|
|
21
|
-
mapping?: string
|
|
22
|
-
}>
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/* Pause object animation */
|
|
26
|
-
export type Brick3DViewerActionAnimationPause = ActionWithParams & {
|
|
27
|
-
__actionName: 'BRICK_3D_VIEWER_ANIMATION_PAUSE'
|
|
28
|
-
params?: Array<{
|
|
29
|
-
input: 'objectIndex'
|
|
30
|
-
value?: number | DataLink | EventProperty
|
|
31
|
-
mapping?: string
|
|
32
|
-
}>
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
/* Goto object animation progress */
|
|
36
|
-
export type Brick3DViewerActionAnimationGoto = ActionWithParams & {
|
|
37
|
-
__actionName: 'BRICK_3D_VIEWER_ANIMATION_GOTO'
|
|
38
|
-
params?: Array<
|
|
39
|
-
| {
|
|
40
|
-
input: 'objectIndex'
|
|
41
|
-
value?: number | DataLink | EventProperty
|
|
42
|
-
mapping?: string
|
|
43
|
-
}
|
|
44
|
-
| {
|
|
45
|
-
input: 'animationProgress'
|
|
46
|
-
value?: number | DataLink | EventProperty
|
|
47
|
-
mapping?: string
|
|
48
|
-
}
|
|
49
|
-
>
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
interface Brick3DViewerDef {
|
|
53
|
-
/*
|
|
54
|
-
Default property:
|
|
55
|
-
{
|
|
56
|
-
"showLoadingBox": true,
|
|
57
|
-
"enableOrbitControls": true
|
|
58
|
-
}
|
|
59
|
-
*/
|
|
60
|
-
property?: BrickBasicProperty & {
|
|
61
|
-
/* 3D model list */
|
|
62
|
-
objects?:
|
|
63
|
-
| Array<
|
|
64
|
-
| DataLink
|
|
65
|
-
| {
|
|
66
|
-
url?: string | DataLink
|
|
67
|
-
md5?: string | DataLink
|
|
68
|
-
type?: 'USDZ' | 'glTF' | DataLink
|
|
69
|
-
rotation?: number | DataLink | Array<number | DataLink> | DataLink | DataLink
|
|
70
|
-
scale?: number | DataLink | Array<number | DataLink> | DataLink | DataLink
|
|
71
|
-
x?: number | DataLink
|
|
72
|
-
y?: number | DataLink
|
|
73
|
-
z?: number | DataLink
|
|
74
|
-
moveable?: boolean | DataLink
|
|
75
|
-
rotateable?: boolean | DataLink
|
|
76
|
-
selectable?: boolean | DataLink
|
|
77
|
-
enableCollision?: boolean | DataLink
|
|
78
|
-
animationLoopMode?: 'once' | 'repeat' | 'pingpong' | DataLink
|
|
79
|
-
animationProgress?: number | DataLink
|
|
80
|
-
animationPaused?: boolean | DataLink
|
|
81
|
-
boundingBox?:
|
|
82
|
-
| DataLink
|
|
83
|
-
| {
|
|
84
|
-
min?:
|
|
85
|
-
| DataLink
|
|
86
|
-
| {
|
|
87
|
-
x?: number | DataLink
|
|
88
|
-
y?: number | DataLink
|
|
89
|
-
z?: number | DataLink
|
|
90
|
-
}
|
|
91
|
-
max?:
|
|
92
|
-
| DataLink
|
|
93
|
-
| {
|
|
94
|
-
x?: number | DataLink
|
|
95
|
-
y?: number | DataLink
|
|
96
|
-
z?: number | DataLink
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
>
|
|
101
|
-
| DataLink
|
|
102
|
-
/* Show loading placeholder box */
|
|
103
|
-
showLoadingBox?: boolean | DataLink
|
|
104
|
-
/* Display shadows */
|
|
105
|
-
shadows?: boolean | DataLink
|
|
106
|
-
/* Default camera position */
|
|
107
|
-
camera?:
|
|
108
|
-
| DataLink
|
|
109
|
-
| {
|
|
110
|
-
fov?: number | DataLink
|
|
111
|
-
aspect?: number | DataLink
|
|
112
|
-
near?: number | DataLink
|
|
113
|
-
far?: number | DataLink
|
|
114
|
-
position?:
|
|
115
|
-
| DataLink
|
|
116
|
-
| {
|
|
117
|
-
x?: number | DataLink
|
|
118
|
-
y?: number | DataLink
|
|
119
|
-
z?: number | DataLink
|
|
120
|
-
}
|
|
121
|
-
quaternion?:
|
|
122
|
-
| DataLink
|
|
123
|
-
| {
|
|
124
|
-
x?: number | DataLink
|
|
125
|
-
y?: number | DataLink
|
|
126
|
-
z?: number | DataLink
|
|
127
|
-
w?: number | DataLink
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
/* Enable orbit controls */
|
|
131
|
-
enableOrbitControls?: boolean | DataLink
|
|
132
|
-
/* Camera control options */
|
|
133
|
-
orbitControls?:
|
|
134
|
-
| DataLink
|
|
135
|
-
| {
|
|
136
|
-
autoRotate?: boolean | DataLink
|
|
137
|
-
enableZoom?: boolean | DataLink
|
|
138
|
-
enablePan?: boolean | DataLink
|
|
139
|
-
enableRotate?: boolean | DataLink
|
|
140
|
-
enableDamping?: boolean | DataLink
|
|
141
|
-
dampingFactor?: number | DataLink
|
|
142
|
-
rotateSpeed?: number | DataLink
|
|
143
|
-
zoomSpeed?: number | DataLink
|
|
144
|
-
panSpeed?: number | DataLink
|
|
145
|
-
minDistance?: number | DataLink
|
|
146
|
-
maxDistance?: number | DataLink
|
|
147
|
-
minPolarAngle?: number | DataLink
|
|
148
|
-
maxPolarAngle?: number | DataLink
|
|
149
|
-
minAzimuthAngle?: number | DataLink
|
|
150
|
-
maxAzimuthAngle?: number | DataLink
|
|
151
|
-
}
|
|
152
|
-
/* Move controls options */
|
|
153
|
-
moveControls?:
|
|
154
|
-
| DataLink
|
|
155
|
-
| {
|
|
156
|
-
responsiveness?: number | DataLink
|
|
157
|
-
rotationRingColor?: string | DataLink
|
|
158
|
-
rotationRingSize?: number | DataLink
|
|
159
|
-
showBoundingBox?: boolean | DataLink
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
events?: BrickBasicEvents & {
|
|
163
|
-
/* Event of error occurred */
|
|
164
|
-
onError?: Array<EventAction>
|
|
165
|
-
/* Event of object changed position or rotation */
|
|
166
|
-
onChange?: Array<EventAction>
|
|
167
|
-
/* Event of object selected */
|
|
168
|
-
onSelectChange?: Array<EventAction>
|
|
169
|
-
/* Event of object collision occurred */
|
|
170
|
-
onCollision?: Array<EventAction>
|
|
171
|
-
}
|
|
172
|
-
animation?: AnimationBasicEvents & {
|
|
173
|
-
onError?: Animation
|
|
174
|
-
onChange?: Animation
|
|
175
|
-
onSelectChange?: Animation
|
|
176
|
-
onCollision?: Animation
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
/* 3D viewer brick */
|
|
181
|
-
export type Brick3DViewer = Brick &
|
|
182
|
-
Brick3DViewerDef & {
|
|
183
|
-
templateKey: 'BRICK_3D_VIEWER'
|
|
184
|
-
switches: Array<
|
|
185
|
-
SwitchDef &
|
|
186
|
-
Brick3DViewerDef & {
|
|
187
|
-
conds?: Array<{
|
|
188
|
-
method: '==' | '!=' | '>' | '<' | '>=' | '<='
|
|
189
|
-
cond:
|
|
190
|
-
| SwitchCondInnerStateCurrentCanvas
|
|
191
|
-
| SwitchCondData
|
|
192
|
-
| {
|
|
193
|
-
__typename: 'SwitchCondInnerStateOutlet'
|
|
194
|
-
outlet: ''
|
|
195
|
-
value: any
|
|
196
|
-
}
|
|
197
|
-
}>
|
|
198
|
-
}
|
|
199
|
-
>
|
|
200
|
-
}
|