@operato/process 8.0.0-beta.0 → 8.0.0-beta.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.
Files changed (56) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/package.json +14 -14
  3. package/.storybook/main.js +0 -3
  4. package/.storybook/preview.js +0 -52
  5. package/.storybook/server.mjs +0 -8
  6. package/demo/index-modeller.html +0 -112
  7. package/demo/index-viewer.html +0 -112
  8. package/demo/index.html +0 -112
  9. package/src/data-storage/data-storage.ts +0 -47
  10. package/src/graphql/data-subscription.ts +0 -30
  11. package/src/graphql/favorite-process.ts +0 -25
  12. package/src/graphql/index.ts +0 -3
  13. package/src/graphql/process-group.ts +0 -138
  14. package/src/graphql/process.ts +0 -141
  15. package/src/graphql/scenario.ts +0 -79
  16. package/src/index.ts +0 -8
  17. package/src/modeller/component-toolbar/component-detail.ts +0 -58
  18. package/src/modeller/component-toolbar/component-menu.ts +0 -193
  19. package/src/modeller/component-toolbar/component-toolbar.ts +0 -196
  20. package/src/modeller/component-toolbar/mode-icons.ts +0 -88
  21. package/src/modeller/edit-toolbar-style.ts +0 -229
  22. package/src/modeller/edit-toolbar.ts +0 -576
  23. package/src/modeller/property-sidebar/abstract-property.ts +0 -69
  24. package/src/modeller/property-sidebar/data-binding/data-binding-mapper.ts +0 -475
  25. package/src/modeller/property-sidebar/data-binding/data-binding.ts +0 -479
  26. package/src/modeller/property-sidebar/effects/effects-shared-style.ts +0 -62
  27. package/src/modeller/property-sidebar/effects/effects.ts +0 -52
  28. package/src/modeller/property-sidebar/effects/property-event-hover.ts +0 -201
  29. package/src/modeller/property-sidebar/effects/property-event-tap.ts +0 -212
  30. package/src/modeller/property-sidebar/effects/property-event.ts +0 -76
  31. package/src/modeller/property-sidebar/effects/property-shadow.ts +0 -114
  32. package/src/modeller/property-sidebar/effects/value-converter.ts +0 -23
  33. package/src/modeller/property-sidebar/inspector/inspector.ts +0 -408
  34. package/src/modeller/property-sidebar/property-shared-style.ts +0 -136
  35. package/src/modeller/property-sidebar/property-sidebar.ts +0 -342
  36. package/src/modeller/property-sidebar/shapes/box-padding-editor-styles.ts +0 -94
  37. package/src/modeller/property-sidebar/shapes/shapes.ts +0 -410
  38. package/src/modeller/property-sidebar/specifics/specific-properties-builder.ts +0 -147
  39. package/src/modeller/property-sidebar/specifics/specifics.ts +0 -81
  40. package/src/modeller/property-sidebar/styles/styles.ts +0 -577
  41. package/src/ox-editor-process-selector.ts +0 -91
  42. package/src/ox-process-list.ts +0 -401
  43. package/src/ox-process-modeller.ts +0 -432
  44. package/src/ox-process-template-list.ts +0 -272
  45. package/src/ox-process-template-viewer.ts +0 -198
  46. package/src/ox-process-viewer.ts +0 -575
  47. package/src/ox-property-editor-process-selector.ts +0 -23
  48. package/src/selector/ox-process-creation-card.ts +0 -95
  49. package/src/selector/ox-process-selector.ts +0 -324
  50. package/src/selector/process-creation-popup.ts +0 -151
  51. package/src/selector/process-thumbnail-card.ts +0 -175
  52. package/src/types.ts +0 -57
  53. package/stories/index.stories.ts +0 -54
  54. package/tsconfig.json +0 -24
  55. package/web-dev-server.config.mjs +0 -30
  56. package/web-test-runner.config.mjs +0 -29
@@ -1,475 +0,0 @@
1
- /**
2
- * @license Copyright © HatioLab Inc. All rights reserved.
3
- */
4
-
5
- import '@operato/input/ox-buttons-radio.js'
6
- import '@operato/input/ox-input-code.js'
7
- import '@operato/i18n/ox-i18n.js'
8
- import '@operato/help/ox-help-icon.js'
9
- import '@operato/input/ox-input-value-map.js'
10
- import '@operato/input/ox-input-value-ranges.js'
11
-
12
- import { css, html, LitElement, PropertyValues } from 'lit'
13
- import { property, query, state } from 'lit/decorators.js'
14
-
15
- import { Properties, Scene } from '@hatiolab/things-scene'
16
-
17
- export type Rule =
18
- | {
19
- map?: Properties
20
- range?: Properties[]
21
- eval?: string
22
- }
23
- | any
24
-
25
- export type Mapping = {
26
- source?: string
27
- rule: 'map' | 'range' | 'eval' | 'value'
28
- accessor?: string
29
- target?: string
30
- property?: string
31
- param?: Rule
32
- ndnsp?: boolean
33
- partial?: boolean
34
- }
35
-
36
- /**
37
- element for mapping data value editing
38
-
39
- Example:
40
-
41
- <data-binding-mapper mapping=${mapping}>
42
- </data-binding-mapper>
43
- */
44
-
45
- export class DataBindingMapper extends LitElement {
46
- static styles = [
47
- css`
48
- :host {
49
- background-color: var(--md-sys-color-surface);
50
- color: var(--md-sys-color-on-surface);
51
- overflow: hidden;
52
- padding: 7px 0 0 0;
53
- border: 1px solid rgba(0, 0, 0, 0.2);
54
- border-width: 0 1px 1px 1px;
55
- padding: 4px;
56
- line-height: 2;
57
-
58
- display: grid;
59
- grid-template-columns: repeat(10, 1fr);
60
- grid-gap: 4px;
61
- grid-auto-rows: minmax(24px, auto);
62
-
63
- align-items: center;
64
- }
65
-
66
- :host > * {
67
- align-self: stretch;
68
- }
69
-
70
- label {
71
- grid-column: span 3;
72
- text-align: right;
73
- text-transform: capitalize;
74
- }
75
-
76
- input,
77
- select,
78
- ox-buttons-radio,
79
- [mapping-rule] {
80
- grid-column: span 7;
81
- }
82
- input,
83
- select {
84
- border: var(--property-sidebar-fieldset-border);
85
- }
86
-
87
- ox-buttons-radio {
88
- display: flex;
89
- padding: 0 4px;
90
- }
91
-
92
- ox-buttons-radio > * {
93
- text-align: center;
94
- flex: 1;
95
- margin: 2px;
96
- border-bottom: 2px solid #fff;
97
- }
98
-
99
- ox-buttons-radio div[active] {
100
- border-color: #f2471c;
101
- }
102
-
103
- select {
104
- height: 22px;
105
- }
106
-
107
- [mapping-rule] {
108
- display: flex;
109
- }
110
-
111
- [mapping-rule] * {
112
- flex: auto;
113
- margin: 0;
114
- text-align: left;
115
- align-self: center;
116
- }
117
-
118
- [rule-editors] {
119
- grid-column: span 10;
120
-
121
- display: 'flex';
122
- align-content: auto;
123
- }
124
-
125
- [rule-editors] :not([active]) {
126
- display: none;
127
- }
128
-
129
- ox-input-code {
130
- height: 300px;
131
- overflow: auto;
132
- }
133
-
134
- /* checkbox-row */
135
- .checkbox-row {
136
- grid-column: span 10;
137
-
138
- display: grid;
139
- grid-template-columns: repeat(10, 1fr);
140
- grid-gap: 5px;
141
- grid-auto-rows: minmax(24px, auto);
142
- align-items: center;
143
- }
144
-
145
- .checkbox-row > input {
146
- grid-column: 4 / 5;
147
- }
148
-
149
- .checkbox-row > label {
150
- grid-column: span 6;
151
- text-align: left;
152
- }
153
- `
154
- ]
155
-
156
- @property({ type: Object }) mapping: Mapping = {
157
- rule: 'value'
158
- }
159
- @property({ type: Object }) rule: Rule = {}
160
- @property({ type: Array }) properties: Properties[] = []
161
- @property({ type: Object }) scene?: Scene
162
-
163
- @state() _valueTypes: any = {
164
- play: 'boolean',
165
- hidden: 'boolean',
166
- started: 'boolean',
167
-
168
- rotation: 'number',
169
- value: 'number',
170
-
171
- fillStyle: 'color',
172
- strokeStyle: 'color',
173
- fontColor: 'color',
174
-
175
- data: 'object',
176
- source: 'attachment',
177
- location: 'object',
178
- dimension: 'object',
179
-
180
- text: 'string',
181
- ref: 'string'
182
- }
183
- @state() _componentIds: { value: string; description: string }[] = []
184
-
185
- @query('#eval-editor') editor!: HTMLInputElement
186
- @query('#source-input') source!: HTMLInputElement
187
- @query('#target-input') target!: HTMLInputElement
188
-
189
- firstUpdated() {
190
- this.renderRoot.addEventListener('change', e => this._onChange(e))
191
- }
192
-
193
- updated(changes: PropertyValues<this>) {
194
- changes.has('mapping') && this._onChangedMapping()
195
- }
196
-
197
- findComponentIds() {
198
- this._componentIds =
199
- (this.scene &&
200
- this.scene.ids.map(i => {
201
- const id = i.key
202
- return { value: `#${id}`, description: this.scene!.findById(id)?.get('type') }
203
- })) ||
204
- []
205
- }
206
-
207
- render() {
208
- const mapping = this.mapping || {
209
- rule: 'value'
210
- }
211
-
212
- return html`
213
- <label for="source-input"> <ox-i18n msgid="label.source">source</ox-i18n> </label>
214
- <input
215
- id="source-input"
216
- type="text"
217
- value-key="source"
218
- list="source-list"
219
- .value=${mapping.source || ''}
220
- @focusin=${() => this.findComponentIds()}
221
- />
222
-
223
- <label for="accessor-input">
224
- <ox-i18n msgid="label.accessor">accessor</ox-i18n><ox-help-icon topic="board-modeller/accessor"></ox-help-icon>
225
- </label>
226
- <input
227
- id="accessor-input"
228
- value-key="accessor"
229
- type="text"
230
- data-mapping-accessor
231
- .value=${mapping.accessor || ''}
232
- />
233
-
234
- <label for="target-input"> <ox-i18n msgid="label.target">target</ox-i18n> </label>
235
- <input
236
- id="target-input"
237
- type="text"
238
- value-key="target"
239
- list="target-list"
240
- .value=${mapping.target || ''}
241
- @focusin=${() => this.findComponentIds()}
242
- />
243
-
244
- <datalist id="source-list">
245
- <option value="">(self)</option>
246
- ${this._componentIds.length
247
- ? html`
248
- ${this._componentIds.map(
249
- ({ value, description }) => html` <option value=${value}>${description}</option> `
250
- )}
251
- `
252
- : html``}
253
- </datalist>
254
-
255
- <datalist id="target-list">
256
- <option value="(self)"></option>
257
- <option value="(children)"></option>
258
- <option value="(key)"></option>
259
- <option value="[propkey]"></option>
260
- ${this._componentIds.length
261
- ? html`
262
- ${this._componentIds.map(
263
- ({ value, description }) => html` <option value=${value}>${description}</option> `
264
- )}
265
- `
266
- : html``}
267
- </datalist>
268
-
269
- <label for="property-input">
270
- <ox-i18n msgid="label.property">property</ox-i18n
271
- ><ox-help-icon topic="board-modeller/data-binding-property"></ox-help-icon>
272
- </label>
273
- <select id="property-input" value-key="property" .value=${mapping.property || ''}>
274
- ${this.properties.map(
275
- item => html` <option .value=${item.name} ?selected=${item.name == mapping.property}>${item.label}</option> `
276
- )}
277
- </select>
278
-
279
- <label> <ox-i18n msgid="label.rule-type">rule type</ox-i18n> </label>
280
- <ox-buttons-radio .value=${mapping.rule} @change=${(e: Event) => this._onChangeRule(e)}>
281
- <div data-value="value"><ox-i18n msgid="label.value"></ox-i18n></div>
282
- <div data-value="map"><ox-i18n msgid="label.map"></ox-i18n></div>
283
- <div data-value="range"><ox-i18n msgid="label.range"></ox-i18n></div>
284
- <div data-value="eval"><ox-i18n msgid="label.eval"></ox-i18n></div>
285
- </ox-buttons-radio>
286
-
287
- <div rule-editors ?hidden=${mapping.rule == 'value'}>
288
- <ox-input-value-map
289
- value-key="map"
290
- .value=${this.rule.map || {}}
291
- .valuetype=${this._valuetype(mapping.property!)}
292
- ?active=${mapping.rule == 'map'}
293
- >
294
- </ox-input-value-map>
295
-
296
- <ox-input-value-ranges
297
- value-key="range"
298
- .value=${this.rule.range || []}
299
- .valuetype=${this._valuetype(mapping.property!)}
300
- ?active=${mapping.rule == 'range'}
301
- >
302
- </ox-input-value-ranges>
303
-
304
- <ox-input-code
305
- value-key="eval"
306
- id="eval-editor"
307
- .value=${this.rule.eval || ''}
308
- ?active=${mapping.rule == 'eval'}
309
- language="javascript"
310
- >
311
- </ox-input-code>
312
- </div>
313
-
314
- <div class="checkbox-row">
315
- <input id="checkbox-partial" type="checkbox" value-key="partial" .checked=${mapping.partial === true} />
316
- <label for="checkbox-partial"> <ox-i18n msgid="label.partial-spreading">Partial Spreading</ox-i18n> </label>
317
- </div>
318
-
319
- <div class="checkbox-row">
320
- <input id="checkbox-ndnsp" type="checkbox" value-key="ndnsp" .checked=${mapping.ndnsp === true} />
321
- <label for="checkbox-ndnsp"> <ox-i18n msgid="label.ndnsp">No Data No Spreading</ox-i18n> </label>
322
- </div>
323
- `
324
- }
325
-
326
- _valuetype(property: string) {
327
- return this._valueTypes[property] || 'string'
328
- }
329
-
330
- private _keep_saved_rule_params: boolean = false
331
-
332
- async _onChangedMapping() {
333
- if (this._keep_saved_rule_params) {
334
- this._keep_saved_rule_params = false
335
- } else {
336
- await this.updateComplete
337
-
338
- var rule: Rule = {}
339
-
340
- if (this.mapping) {
341
- switch (this.mapping.rule) {
342
- case 'map':
343
- rule.map = this.mapping.param || {}
344
- break
345
- case 'range':
346
- rule.range = this.mapping.param || []
347
- break
348
- case 'eval':
349
- rule.eval = this.mapping.param || ''
350
- break
351
- default:
352
- this.mapping.rule = 'value'
353
- break
354
- }
355
- }
356
-
357
- this.rule = rule
358
- this.requestUpdate()
359
- }
360
- }
361
-
362
- _onChangeRule(e: Event) {
363
- var element = e.target as HTMLInputElement
364
- var value = element.value
365
-
366
- let param
367
-
368
- switch (value) {
369
- case 'map':
370
- param = this.rule.map
371
- break
372
- case 'range':
373
- param = this.rule.range
374
- break
375
- case 'eval':
376
- param = this.rule.eval || ''
377
-
378
- // rule.eval에 값이 없을 때, ace-editor 내용이 초기화되지 않는 문제때문에 처리함.
379
- if (!param) {
380
- this.editor.value = 'return'
381
- }
382
- break
383
- default:
384
- }
385
-
386
- this.mapping = {
387
- ...this.mapping,
388
- rule: value as 'value' | 'map' | 'range' | 'eval',
389
- param
390
- }
391
-
392
- this._keep_saved_rule_params = true
393
- this.dispatchEvent(new CustomEvent('value-change', { bubbles: true, composed: true }))
394
- }
395
-
396
- _onChange(e: Event) {
397
- var element = e.target as HTMLInputElement
398
- var key = element.getAttribute('value-key')
399
-
400
- if (!key) return
401
-
402
- var value: string | boolean = element.value
403
-
404
- if (key === 'source') {
405
- if (value.length > 0) {
406
- value = value.trim()
407
-
408
- this.source.value = value
409
- }
410
-
411
- this.mapping = {
412
- ...this.mapping,
413
- source: value
414
- }
415
- } else if (key === 'target') {
416
- if (value.length > 0 && !/^[.#(\[]/.test(value)) {
417
- value = '#' + value.trim()
418
-
419
- this.target.value = value
420
- }
421
-
422
- this.mapping = {
423
- ...this.mapping,
424
- target: value
425
- }
426
- } else if (key === 'accessor') {
427
- this.mapping = {
428
- ...this.mapping,
429
- accessor: (value || '').trim()
430
- }
431
- } else if (key === 'property') {
432
- this.mapping = {
433
- ...this.mapping,
434
- property: (value || '').trim()
435
- }
436
- } else if (key === 'map' || key === 'range' || key === 'eval') {
437
- this.rule[key] = value
438
- this.mapping = {
439
- ...this.mapping,
440
- param: value
441
- }
442
- } else if (key === 'ndnsp' /* no data no spreading */) {
443
- value = element.checked
444
-
445
- this.mapping = {
446
- ...this.mapping,
447
- ndnsp: value
448
- }
449
- } else if (key === 'partial' /* partial spreading */) {
450
- value = element.checked
451
-
452
- this.mapping = {
453
- ...this.mapping,
454
- partial: value
455
- }
456
- }
457
-
458
- if (!this.mapping.rule) {
459
- this.mapping.rule = 'value'
460
- }
461
-
462
- this._keep_saved_rule_params = true
463
- this.dispatchEvent(
464
- new CustomEvent('value-change', {
465
- bubbles: true,
466
- composed: true,
467
- detail: {
468
- changed: {
469
- [key]: value
470
- }
471
- }
472
- })
473
- )
474
- }
475
- }