@operato/process 1.1.37 → 1.1.39

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": "@operato/process",
3
- "version": "1.1.37",
3
+ "version": "1.1.39",
4
4
  "description": "Webcomponent for business process modeling following open-wc recommendations",
5
5
  "author": "heartyoh",
6
6
  "main": "dist/src/index.js",
@@ -68,7 +68,7 @@
68
68
  "dependencies": {
69
69
  "@open-wc/scoped-elements": "^2.1.3",
70
70
  "@operato/app": "^1.1.37",
71
- "@operato/board": "^1.1.37",
71
+ "@operato/board": "^1.1.39",
72
72
  "@operato/data-grist": "^1.1.37",
73
73
  "@operato/font": "^1.1.37",
74
74
  "@operato/graphql": "^1.1.13",
@@ -91,7 +91,7 @@
91
91
  "devDependencies": {
92
92
  "@custom-elements-manifest/analyzer": "^0.4.17",
93
93
  "@hatiolab/prettier-config": "^1.0.0",
94
- "@hatiolab/things-scene": "^3.1.0",
94
+ "@hatiolab/things-scene": "^3.2.0",
95
95
  "@material/mwc-fab": "^0.27.0",
96
96
  "@material/mwc-icon": "^0.27.0",
97
97
  "@open-wc/eslint-config": "^4.3.0",
@@ -127,5 +127,5 @@
127
127
  "prettier --write"
128
128
  ]
129
129
  },
130
- "gitHead": "6f015266daddd7faec2219a0b7fbbdc935899378"
130
+ "gitHead": "f482cfb98b0bb24ff637196cedc2a632ecffacb2"
131
131
  }
@@ -92,17 +92,20 @@ export class OxProcessViewer extends LitElement {
92
92
  @property({ type: Object }) process: any = {}
93
93
  @property({ type: Object }) provider: ReferenceProvider | null = null
94
94
  @property({ type: Object }) data: any
95
+ @property({ type: Object }) values: any
95
96
 
96
97
  @property({ type: Boolean, reflect: true, attribute: 'hide-fullscreen' }) hideFullscreen = false
97
98
  @property({ type: Boolean, reflect: true, attribute: 'hide-navigation' }) hideNavigation = false
98
99
 
99
100
  @state() _scene: any = null
100
- @state() _forward: Array<any> = []
101
- @state() _backward: Array<any> = []
101
+ @state() _forward: { id: string; scene: any }[] = []
102
+ @state() _backward: { id: string; scene: any }[] = []
102
103
 
103
104
  @state() _oldtarget?: HTMLElement
104
105
  @state() _fade_animations?: Array<Animation>
105
106
 
107
+ public currentProcessId?: string = this.process?.id
108
+
106
109
  @query('#target') _target!: HTMLElement
107
110
  @query('#prev') _prev!: HTMLElement
108
111
  @query('#next') _next!: HTMLElement
@@ -201,13 +204,17 @@ export class OxProcessViewer extends LitElement {
201
204
  if (changes.has('data') && this._scene && this.data) {
202
205
  this._scene.data = this.data
203
206
  }
207
+
208
+ if (changes.has('values') && this._scene && this.values) {
209
+ this._scene.values = this.values
210
+ }
204
211
  }
205
212
 
206
213
  async initSceneAsync() {
207
214
  if (!this.process || !this.process.id) return
208
215
 
209
216
  this._scene = await this.provider!.get(this.process.id, true)
210
- this.setupScene(this._scene)
217
+ this.setupScene({ id: this.process.id, scene: this._scene })
211
218
  }
212
219
 
213
220
  initScene() {
@@ -229,7 +236,7 @@ export class OxProcessViewer extends LitElement {
229
236
 
230
237
  this.provider!.add(this.process.id, this._scene)
231
238
 
232
- this.setupScene(this._scene)
239
+ this.setupScene({ id: this.process.id, scene: this._scene })
233
240
  }
234
241
 
235
242
  closeScene() {
@@ -243,10 +250,10 @@ export class OxProcessViewer extends LitElement {
243
250
  }
244
251
 
245
252
  // delete queued scenes
246
- this._forward.forEach(scene => scene.release && scene.release())
253
+ this._forward.forEach(({ scene }) => scene.release && scene.release())
247
254
  this._forward = []
248
255
 
249
- this._backward.forEach(scene => scene.release && scene.release())
256
+ this._backward.forEach(({ scene }) => scene.release && scene.release())
250
257
  this._backward = []
251
258
  }
252
259
 
@@ -255,7 +262,7 @@ export class OxProcessViewer extends LitElement {
255
262
  this.transientShowButtons()
256
263
  }
257
264
 
258
- setupScene(scene: any) {
265
+ setupScene({ id, scene }: { id: string; scene: any }) {
259
266
  this._scene = scene
260
267
 
261
268
  const backgroundColor = this._scene?.root.state.fillStyle
@@ -274,6 +281,7 @@ export class OxProcessViewer extends LitElement {
274
281
  if (this.data) {
275
282
  this._scene.data = this.data
276
283
  }
284
+ this.currentProcessId = id
277
285
 
278
286
  this.bindSceneEvents()
279
287
 
@@ -296,17 +304,17 @@ export class OxProcessViewer extends LitElement {
296
304
  this.unbindSceneEvents(this._scene)
297
305
  /* 원래의 target에 되돌린다. */
298
306
  this._scene.target = this._oldtarget
299
- this._backward.push(this._scene)
307
+ this._backward.push({ id: this.currentProcessId!, scene: this._scene })
300
308
  }
301
309
 
302
310
  this._scene = scene
303
311
 
304
- this._forward.forEach(scene => scene.release && scene.release())
312
+ this._forward.forEach(({ scene }) => scene.release && scene.release())
305
313
 
306
314
  /* forward를 비운다. */
307
315
  this._forward = []
308
316
 
309
- this.setupScene(scene)
317
+ this.setupScene({ id: processId, scene })
310
318
 
311
319
  if (bindingData) {
312
320
  scene.data = bindingData
@@ -383,7 +391,7 @@ export class OxProcessViewer extends LitElement {
383
391
  /* event handlers */
384
392
 
385
393
  onTapNext() {
386
- var scene = this._forward.pop()
394
+ var { id, scene } = this._forward.pop() || {}
387
395
  if (!scene) return
388
396
 
389
397
  if (this._scene) {
@@ -391,14 +399,14 @@ export class OxProcessViewer extends LitElement {
391
399
  /* 원래의 target에 되돌린다. */
392
400
  this._scene.target = this._oldtarget
393
401
  this.unbindSceneEvents(this._scene)
394
- this._backward.push(this._scene)
402
+ this._backward.push({ id: id!, scene: this._scene })
395
403
  }
396
404
 
397
- this.setupScene(scene)
405
+ this.setupScene({ id: id!, scene })
398
406
  }
399
407
 
400
408
  onTapPrev() {
401
- var scene = this._backward.pop()
409
+ var { id, scene } = this._backward.pop() || {}
402
410
  if (!scene) return
403
411
 
404
412
  if (this._scene) {
@@ -406,10 +414,10 @@ export class OxProcessViewer extends LitElement {
406
414
  /* 원래의 target에 되돌린다. */
407
415
  this._scene.target = this._oldtarget
408
416
  this.unbindSceneEvents(this._scene)
409
- this._forward.push(this._scene)
417
+ this._forward.push({ id: id!, scene: this._scene })
410
418
  }
411
419
 
412
- this.setupScene(scene)
420
+ this.setupScene({ id: id!, scene })
413
421
  }
414
422
 
415
423
  onTapFullscreen() {
@@ -483,6 +491,10 @@ export class OxProcessViewer extends LitElement {
483
491
  return this._scene?.data
484
492
  }
485
493
 
494
+ getSceneValues() {
495
+ return this._scene?.values
496
+ }
497
+
486
498
  async getSceneImageData(base64 = false) {
487
499
  if (!this._scene) {
488
500
  return