@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.
- package/CHANGELOG.md +18 -0
- package/package.json +14 -14
- package/.storybook/main.js +0 -3
- package/.storybook/preview.js +0 -52
- package/.storybook/server.mjs +0 -8
- package/demo/index-modeller.html +0 -112
- package/demo/index-viewer.html +0 -112
- package/demo/index.html +0 -112
- package/src/data-storage/data-storage.ts +0 -47
- package/src/graphql/data-subscription.ts +0 -30
- package/src/graphql/favorite-process.ts +0 -25
- package/src/graphql/index.ts +0 -3
- package/src/graphql/process-group.ts +0 -138
- package/src/graphql/process.ts +0 -141
- package/src/graphql/scenario.ts +0 -79
- package/src/index.ts +0 -8
- package/src/modeller/component-toolbar/component-detail.ts +0 -58
- package/src/modeller/component-toolbar/component-menu.ts +0 -193
- package/src/modeller/component-toolbar/component-toolbar.ts +0 -196
- package/src/modeller/component-toolbar/mode-icons.ts +0 -88
- package/src/modeller/edit-toolbar-style.ts +0 -229
- package/src/modeller/edit-toolbar.ts +0 -576
- package/src/modeller/property-sidebar/abstract-property.ts +0 -69
- package/src/modeller/property-sidebar/data-binding/data-binding-mapper.ts +0 -475
- package/src/modeller/property-sidebar/data-binding/data-binding.ts +0 -479
- package/src/modeller/property-sidebar/effects/effects-shared-style.ts +0 -62
- package/src/modeller/property-sidebar/effects/effects.ts +0 -52
- package/src/modeller/property-sidebar/effects/property-event-hover.ts +0 -201
- package/src/modeller/property-sidebar/effects/property-event-tap.ts +0 -212
- package/src/modeller/property-sidebar/effects/property-event.ts +0 -76
- package/src/modeller/property-sidebar/effects/property-shadow.ts +0 -114
- package/src/modeller/property-sidebar/effects/value-converter.ts +0 -23
- package/src/modeller/property-sidebar/inspector/inspector.ts +0 -408
- package/src/modeller/property-sidebar/property-shared-style.ts +0 -136
- package/src/modeller/property-sidebar/property-sidebar.ts +0 -342
- package/src/modeller/property-sidebar/shapes/box-padding-editor-styles.ts +0 -94
- package/src/modeller/property-sidebar/shapes/shapes.ts +0 -410
- package/src/modeller/property-sidebar/specifics/specific-properties-builder.ts +0 -147
- package/src/modeller/property-sidebar/specifics/specifics.ts +0 -81
- package/src/modeller/property-sidebar/styles/styles.ts +0 -577
- package/src/ox-editor-process-selector.ts +0 -91
- package/src/ox-process-list.ts +0 -401
- package/src/ox-process-modeller.ts +0 -432
- package/src/ox-process-template-list.ts +0 -272
- package/src/ox-process-template-viewer.ts +0 -198
- package/src/ox-process-viewer.ts +0 -575
- package/src/ox-property-editor-process-selector.ts +0 -23
- package/src/selector/ox-process-creation-card.ts +0 -95
- package/src/selector/ox-process-selector.ts +0 -324
- package/src/selector/process-creation-popup.ts +0 -151
- package/src/selector/process-thumbnail-card.ts +0 -175
- package/src/types.ts +0 -57
- package/stories/index.stories.ts +0 -54
- package/tsconfig.json +0 -24
- package/web-dev-server.config.mjs +0 -30
- package/web-test-runner.config.mjs +0 -29
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,24 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [8.0.0-beta.2](https://github.com/heartyoh/ioperato/compare/v8.0.0-beta.1...v8.0.0-beta.2) (2025-01-08)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### :bug: Bug Fix
|
|
10
|
+
|
|
11
|
+
* typo .npmignore ([d9c0c8c](https://github.com/heartyoh/ioperato/commit/d9c0c8c79abc688c3c2cfb6c37fcb689483a5977))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
## [8.0.0-beta.1](https://github.com/heartyoh/ioperato/compare/v8.0.0-beta.0...v8.0.0-beta.1) (2025-01-08)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### :bug: Bug Fix
|
|
19
|
+
|
|
20
|
+
* missing .npmignore ([be05985](https://github.com/heartyoh/ioperato/commit/be05985abfae4af53501f718dd52932099f7fbcb))
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
6
24
|
## [8.0.0-beta.0](https://github.com/heartyoh/ioperato/compare/v8.0.0-alpha.56...v8.0.0-beta.0) (2025-01-07)
|
|
7
25
|
|
|
8
26
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@operato/process",
|
|
3
|
-
"version": "8.0.0-beta.
|
|
3
|
+
"version": "8.0.0-beta.2",
|
|
4
4
|
"description": "Webcomponent for business process modeling following open-wc recommendations",
|
|
5
5
|
"author": "heartyoh",
|
|
6
6
|
"main": "dist/src/index.js",
|
|
@@ -74,18 +74,18 @@
|
|
|
74
74
|
},
|
|
75
75
|
"dependencies": {
|
|
76
76
|
"@open-wc/scoped-elements": "^2.1.3",
|
|
77
|
-
"@operato/app": "^8.0.0-beta.
|
|
78
|
-
"@operato/board": "^8.0.0-beta.
|
|
79
|
-
"@operato/data-grist": "^8.0.0-beta.
|
|
80
|
-
"@operato/font": "^8.0.0-beta.
|
|
81
|
-
"@operato/graphql": "^8.0.0-beta.
|
|
82
|
-
"@operato/i18n": "^8.0.0-beta.
|
|
83
|
-
"@operato/input": "^8.0.0-beta.
|
|
84
|
-
"@operato/markdown": "^8.0.0-beta.
|
|
85
|
-
"@operato/popup": "^8.0.0-beta.
|
|
86
|
-
"@operato/property-editor": "^8.0.0-beta.
|
|
87
|
-
"@operato/styles": "^8.0.0-beta.
|
|
88
|
-
"@operato/utils": "^8.0.0-beta.
|
|
77
|
+
"@operato/app": "^8.0.0-beta.2",
|
|
78
|
+
"@operato/board": "^8.0.0-beta.2",
|
|
79
|
+
"@operato/data-grist": "^8.0.0-beta.2",
|
|
80
|
+
"@operato/font": "^8.0.0-beta.2",
|
|
81
|
+
"@operato/graphql": "^8.0.0-beta.2",
|
|
82
|
+
"@operato/i18n": "^8.0.0-beta.2",
|
|
83
|
+
"@operato/input": "^8.0.0-beta.2",
|
|
84
|
+
"@operato/markdown": "^8.0.0-beta.2",
|
|
85
|
+
"@operato/popup": "^8.0.0-beta.2",
|
|
86
|
+
"@operato/property-editor": "^8.0.0-beta.2",
|
|
87
|
+
"@operato/styles": "^8.0.0-beta.2",
|
|
88
|
+
"@operato/utils": "^8.0.0-beta.2",
|
|
89
89
|
"@polymer/paper-dropdown-menu": "^3.2.0",
|
|
90
90
|
"@types/file-saver": "^2.0.4",
|
|
91
91
|
"@types/sortablejs": "^1.10.7",
|
|
@@ -134,5 +134,5 @@
|
|
|
134
134
|
"prettier --write"
|
|
135
135
|
]
|
|
136
136
|
},
|
|
137
|
-
"gitHead": "
|
|
137
|
+
"gitHead": "ee1b5124995accb99272d3b5854f3df1d8746dda"
|
|
138
138
|
}
|
package/.storybook/main.js
DELETED
package/.storybook/preview.js
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { i18next } from '@operato/i18n'
|
|
2
|
-
|
|
3
|
-
export const globalTypes = {
|
|
4
|
-
locale: {
|
|
5
|
-
name: 'Locale',
|
|
6
|
-
description: 'Internationalization locale',
|
|
7
|
-
toolbar: {
|
|
8
|
-
icon: 'globe',
|
|
9
|
-
items: [
|
|
10
|
-
{ value: 'en', right: '🇺🇸', title: 'English' },
|
|
11
|
-
{ value: 'ko', right: '🇰🇷', title: '한국어' },
|
|
12
|
-
{ value: 'zh', right: '🇨🇳', title: '中文' },
|
|
13
|
-
{ value: 'ja', right: '🇯🇵', title: '日本語' },
|
|
14
|
-
{ value: 'ms', right: '🇲🇾', title: 'Bahasa Melayu' }
|
|
15
|
-
],
|
|
16
|
-
showName: true
|
|
17
|
-
}
|
|
18
|
-
},
|
|
19
|
-
theme: {
|
|
20
|
-
name: 'Theme',
|
|
21
|
-
description: 'Global theme for components',
|
|
22
|
-
toolbar: {
|
|
23
|
-
icon: 'paintbrush',
|
|
24
|
-
items: [
|
|
25
|
-
{ value: 'light', title: 'Light' },
|
|
26
|
-
{ value: 'dark', title: 'Dark' }
|
|
27
|
-
],
|
|
28
|
-
showName: true
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export const decorators = [
|
|
34
|
-
(Story, context) => {
|
|
35
|
-
const { locale, theme } = context.globals
|
|
36
|
-
|
|
37
|
-
if (locale) {
|
|
38
|
-
i18next.changeLanguage(locale)
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
// Set the theme class for the document
|
|
42
|
-
if (theme === 'dark') {
|
|
43
|
-
document.documentElement.classList.add('dark')
|
|
44
|
-
document.documentElement.classList.remove('light')
|
|
45
|
-
} else {
|
|
46
|
-
document.documentElement.classList.add('light')
|
|
47
|
-
document.documentElement.classList.remove('dark')
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
return Story()
|
|
51
|
-
}
|
|
52
|
-
]
|
package/.storybook/server.mjs
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { storybookPlugin } from '@web/dev-server-storybook'
|
|
2
|
-
import baseConfig from '../web-dev-server.config.mjs'
|
|
3
|
-
|
|
4
|
-
export default /** @type {import('@web/dev-server').DevServerConfig} */ ({
|
|
5
|
-
...baseConfig,
|
|
6
|
-
open: '/',
|
|
7
|
-
plugins: [storybookPlugin({ type: 'web-components' }), ...baseConfig.plugins]
|
|
8
|
-
})
|
package/demo/index-modeller.html
DELETED
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
<!doctype html>
|
|
2
|
-
<html lang="en-GB">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8" />
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
|
|
6
|
-
<style>
|
|
7
|
-
body {
|
|
8
|
-
margin: 0;
|
|
9
|
-
padding: 0;
|
|
10
|
-
overflow: hidden;
|
|
11
|
-
|
|
12
|
-
/* This is a font-stack that tries to use the system-default sans-serifs first */
|
|
13
|
-
font-family: Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
|
|
14
|
-
line-height: 1.5;
|
|
15
|
-
-webkit-font-smoothing: antialiased;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
ox-process-modeller {
|
|
19
|
-
width: 100vw;
|
|
20
|
-
height: 100dvh;
|
|
21
|
-
}
|
|
22
|
-
</style>
|
|
23
|
-
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500" rel="stylesheet" />
|
|
24
|
-
<link
|
|
25
|
-
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,100..700,0..1"
|
|
26
|
-
rel="stylesheet"
|
|
27
|
-
/>
|
|
28
|
-
<link
|
|
29
|
-
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL@20..48,100..700,0..1"
|
|
30
|
-
rel="stylesheet"
|
|
31
|
-
/>
|
|
32
|
-
<link
|
|
33
|
-
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL@20..48,100..700,0..1"
|
|
34
|
-
rel="stylesheet"
|
|
35
|
-
/>
|
|
36
|
-
</head>
|
|
37
|
-
<body>
|
|
38
|
-
<div id="demo"></div>
|
|
39
|
-
<script type="module">
|
|
40
|
-
import { html, render } from 'lit'
|
|
41
|
-
import '../dist/src/ox-process-modeller.js'
|
|
42
|
-
import { ReferenceMap, create, error } from '@hatiolab/things-scene'
|
|
43
|
-
|
|
44
|
-
const colors = ['red', 'blue', 'orange', 'yellow', 'magenta', 'violet', 'navy', 'green', 'cyan', 'lime']
|
|
45
|
-
const processes = colors.map((color, idx) => {
|
|
46
|
-
var to = colors[(idx + 1) % colors.length]
|
|
47
|
-
return {
|
|
48
|
-
id: color,
|
|
49
|
-
model: {
|
|
50
|
-
width: 400,
|
|
51
|
-
height: 300,
|
|
52
|
-
fillStyle: color,
|
|
53
|
-
components: [
|
|
54
|
-
{
|
|
55
|
-
type: 'text',
|
|
56
|
-
left: 100,
|
|
57
|
-
top: 100,
|
|
58
|
-
width: 200,
|
|
59
|
-
height: 30,
|
|
60
|
-
text: `Click to move to ${to}`,
|
|
61
|
-
event: {
|
|
62
|
-
tap: {
|
|
63
|
-
action: 'goto',
|
|
64
|
-
target: to
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
]
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
})
|
|
72
|
-
|
|
73
|
-
var provider = new ReferenceMap(
|
|
74
|
-
async (processId, resolve, reject) => {
|
|
75
|
-
try {
|
|
76
|
-
const process = processes.find(process => {
|
|
77
|
-
return process.id === processId
|
|
78
|
-
})
|
|
79
|
-
if (!process) {
|
|
80
|
-
throw `no process named as ${processId}`
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
var scene
|
|
84
|
-
|
|
85
|
-
try {
|
|
86
|
-
scene = await provider.get(processId)
|
|
87
|
-
console.warn('Process fetched more than twice.', processId)
|
|
88
|
-
} catch (e) {
|
|
89
|
-
scene = create({
|
|
90
|
-
model: JSON.parse(JSON.stringify(process.model)),
|
|
91
|
-
mode: 0,
|
|
92
|
-
refProvider: provider
|
|
93
|
-
})
|
|
94
|
-
}
|
|
95
|
-
resolve(scene, process)
|
|
96
|
-
} catch (e) {
|
|
97
|
-
error(e)
|
|
98
|
-
reject(e)
|
|
99
|
-
}
|
|
100
|
-
},
|
|
101
|
-
async (id, ref) => {
|
|
102
|
-
ref.dispose()
|
|
103
|
-
}
|
|
104
|
-
)
|
|
105
|
-
|
|
106
|
-
render(
|
|
107
|
-
html` <ox-process-modeller .process=${processes[0]} .provider=${provider}> </ox-process-modeller> `,
|
|
108
|
-
document.querySelector('#demo')
|
|
109
|
-
)
|
|
110
|
-
</script>
|
|
111
|
-
</body>
|
|
112
|
-
</html>
|
package/demo/index-viewer.html
DELETED
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
<!doctype html>
|
|
2
|
-
<html lang="en-GB">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8" />
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
|
|
6
|
-
<style>
|
|
7
|
-
body {
|
|
8
|
-
margin: 0;
|
|
9
|
-
padding: 0;
|
|
10
|
-
overflow: hidden;
|
|
11
|
-
|
|
12
|
-
/* This is a font-stack that tries to use the system-default sans-serifs first */
|
|
13
|
-
font-family: Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
|
|
14
|
-
line-height: 1.5;
|
|
15
|
-
-webkit-font-smoothing: antialiased;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
ox-process-viewer {
|
|
19
|
-
width: 100vw;
|
|
20
|
-
height: 100dvh;
|
|
21
|
-
}
|
|
22
|
-
</style>
|
|
23
|
-
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500" rel="stylesheet" />
|
|
24
|
-
<link
|
|
25
|
-
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,100..700,0..1"
|
|
26
|
-
rel="stylesheet"
|
|
27
|
-
/>
|
|
28
|
-
<link
|
|
29
|
-
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL@20..48,100..700,0..1"
|
|
30
|
-
rel="stylesheet"
|
|
31
|
-
/>
|
|
32
|
-
<link
|
|
33
|
-
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL@20..48,100..700,0..1"
|
|
34
|
-
rel="stylesheet"
|
|
35
|
-
/>
|
|
36
|
-
</head>
|
|
37
|
-
<body>
|
|
38
|
-
<div id="demo"></div>
|
|
39
|
-
<script type="module">
|
|
40
|
-
import { html, render } from 'lit'
|
|
41
|
-
import '../dist/src/ox-process-viewer.js'
|
|
42
|
-
import { ReferenceMap, create, error } from '@hatiolab/things-scene'
|
|
43
|
-
|
|
44
|
-
const colors = ['red', 'blue', 'orange', 'yellow', 'magenta', 'violet', 'navy', 'green', 'cyan', 'lime']
|
|
45
|
-
const processes = colors.map((color, idx) => {
|
|
46
|
-
var to = colors[(idx + 1) % colors.length]
|
|
47
|
-
return {
|
|
48
|
-
id: color,
|
|
49
|
-
model: {
|
|
50
|
-
width: 400,
|
|
51
|
-
height: 300,
|
|
52
|
-
fillStyle: color,
|
|
53
|
-
components: [
|
|
54
|
-
{
|
|
55
|
-
type: 'text',
|
|
56
|
-
left: 100,
|
|
57
|
-
top: 100,
|
|
58
|
-
width: 200,
|
|
59
|
-
height: 30,
|
|
60
|
-
text: `Click to move to ${to}`,
|
|
61
|
-
event: {
|
|
62
|
-
tap: {
|
|
63
|
-
action: 'goto',
|
|
64
|
-
target: to
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
]
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
})
|
|
72
|
-
|
|
73
|
-
var provider = new ReferenceMap(
|
|
74
|
-
async (processId, resolve, reject) => {
|
|
75
|
-
try {
|
|
76
|
-
const process = processes.find(process => {
|
|
77
|
-
return process.id === processId
|
|
78
|
-
})
|
|
79
|
-
if (!process) {
|
|
80
|
-
throw `no process named as ${processId}`
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
var scene
|
|
84
|
-
|
|
85
|
-
try {
|
|
86
|
-
scene = await provider.get(processId)
|
|
87
|
-
console.warn('Process fetched more than twice.', processId)
|
|
88
|
-
} catch (e) {
|
|
89
|
-
scene = create({
|
|
90
|
-
model: JSON.parse(JSON.stringify(process.model)),
|
|
91
|
-
mode: 0,
|
|
92
|
-
refProvider: provider
|
|
93
|
-
})
|
|
94
|
-
}
|
|
95
|
-
resolve(scene, process)
|
|
96
|
-
} catch (e) {
|
|
97
|
-
error(e)
|
|
98
|
-
reject(e)
|
|
99
|
-
}
|
|
100
|
-
},
|
|
101
|
-
async (id, ref) => {
|
|
102
|
-
ref.dispose()
|
|
103
|
-
}
|
|
104
|
-
)
|
|
105
|
-
|
|
106
|
-
render(
|
|
107
|
-
html` <ox-process-viewer .process=${processes[0]} .provider=${provider}></ox-process-viewer> `,
|
|
108
|
-
document.querySelector('#demo')
|
|
109
|
-
)
|
|
110
|
-
</script>
|
|
111
|
-
</body>
|
|
112
|
-
</html>
|
package/demo/index.html
DELETED
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
<!doctype html>
|
|
2
|
-
<html lang="en-GB">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8" />
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
|
|
6
|
-
<style>
|
|
7
|
-
body {
|
|
8
|
-
margin: 0;
|
|
9
|
-
padding: 0;
|
|
10
|
-
overflow: hidden;
|
|
11
|
-
|
|
12
|
-
/* This is a font-stack that tries to use the system-default sans-serifs first */
|
|
13
|
-
font-family: Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
|
|
14
|
-
line-height: 1.5;
|
|
15
|
-
-webkit-font-smoothing: antialiased;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
ox-process-viewer {
|
|
19
|
-
width: 100vw;
|
|
20
|
-
height: 100dvh;
|
|
21
|
-
}
|
|
22
|
-
</style>
|
|
23
|
-
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500" rel="stylesheet" />
|
|
24
|
-
<link
|
|
25
|
-
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,100..700,0..1"
|
|
26
|
-
rel="stylesheet"
|
|
27
|
-
/>
|
|
28
|
-
<link
|
|
29
|
-
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL@20..48,100..700,0..1"
|
|
30
|
-
rel="stylesheet"
|
|
31
|
-
/>
|
|
32
|
-
<link
|
|
33
|
-
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL@20..48,100..700,0..1"
|
|
34
|
-
rel="stylesheet"
|
|
35
|
-
/>
|
|
36
|
-
</head>
|
|
37
|
-
<body>
|
|
38
|
-
<div id="demo"></div>
|
|
39
|
-
<script type="module">
|
|
40
|
-
import { html, render } from 'lit'
|
|
41
|
-
import '../dist/src/ox-process-viewer.js'
|
|
42
|
-
import { ReferenceMap, create, error } from '@hatiolab/things-scene'
|
|
43
|
-
|
|
44
|
-
const colors = ['red', 'blue', 'orange', 'yellow', 'magenta', 'violet', 'navy', 'green', 'cyan', 'lime']
|
|
45
|
-
const processes = colors.map((color, idx) => {
|
|
46
|
-
var to = colors[(idx + 1) % colors.length]
|
|
47
|
-
return {
|
|
48
|
-
id: color,
|
|
49
|
-
model: {
|
|
50
|
-
width: 400,
|
|
51
|
-
height: 300,
|
|
52
|
-
fillStyle: color,
|
|
53
|
-
components: [
|
|
54
|
-
{
|
|
55
|
-
type: 'text',
|
|
56
|
-
left: 100,
|
|
57
|
-
top: 100,
|
|
58
|
-
width: 200,
|
|
59
|
-
height: 30,
|
|
60
|
-
text: `Click to move to ${to}`,
|
|
61
|
-
event: {
|
|
62
|
-
tap: {
|
|
63
|
-
action: 'goto',
|
|
64
|
-
target: to
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
]
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
})
|
|
72
|
-
|
|
73
|
-
var provider = new ReferenceMap(
|
|
74
|
-
async (processId, resolve, reject) => {
|
|
75
|
-
try {
|
|
76
|
-
const process = processes.find(process => {
|
|
77
|
-
return process.id === processId
|
|
78
|
-
})
|
|
79
|
-
if (!process) {
|
|
80
|
-
throw `no process named as ${processId}`
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
var scene
|
|
84
|
-
|
|
85
|
-
try {
|
|
86
|
-
scene = await provider.get(processId)
|
|
87
|
-
console.warn('Process fetched more than twice.', processId)
|
|
88
|
-
} catch (e) {
|
|
89
|
-
scene = create({
|
|
90
|
-
model: JSON.parse(JSON.stringify(process.model)),
|
|
91
|
-
mode: 0,
|
|
92
|
-
refProvider: provider
|
|
93
|
-
})
|
|
94
|
-
}
|
|
95
|
-
resolve(scene, process)
|
|
96
|
-
} catch (e) {
|
|
97
|
-
error(e)
|
|
98
|
-
reject(e)
|
|
99
|
-
}
|
|
100
|
-
},
|
|
101
|
-
async (id, ref) => {
|
|
102
|
-
ref.dispose()
|
|
103
|
-
}
|
|
104
|
-
)
|
|
105
|
-
|
|
106
|
-
render(
|
|
107
|
-
html` <ox-process-viewer .process=${processes[0]} .provider=${provider}></ox-process-viewer> `,
|
|
108
|
-
document.querySelector('#demo')
|
|
109
|
-
)
|
|
110
|
-
</script>
|
|
111
|
-
</body>
|
|
112
|
-
</html>
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import Dexie from 'dexie'
|
|
2
|
-
|
|
3
|
-
import { Component, PersistentDataStorage } from '@hatiolab/things-scene'
|
|
4
|
-
|
|
5
|
-
class ProcessDatabase extends Dexie {
|
|
6
|
-
process_data!: Dexie.Table<IProcessData, number> // number = type of the primkey
|
|
7
|
-
//...other tables goes here...
|
|
8
|
-
|
|
9
|
-
constructor() {
|
|
10
|
-
super('operato-process-database')
|
|
11
|
-
this.version(1).stores({
|
|
12
|
-
process_data: '[process+refid]'
|
|
13
|
-
//...other tables goes here...
|
|
14
|
-
})
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
interface IProcessData {
|
|
19
|
-
id?: number
|
|
20
|
-
process: string
|
|
21
|
-
refid: string | number
|
|
22
|
-
data: any
|
|
23
|
-
timestamp: number
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
const db = new ProcessDatabase()
|
|
27
|
-
|
|
28
|
-
export class DataStorage implements PersistentDataStorage {
|
|
29
|
-
private id: string
|
|
30
|
-
|
|
31
|
-
constructor(id: string) {
|
|
32
|
-
this.id = id
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
public async load(key: Component): Promise<any> {
|
|
36
|
-
const saved = await db.process_data.where({ process: this.id, refid: key.state.refid }).first()
|
|
37
|
-
return saved?.data
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
public async save(key: Component, value: any): Promise<void> {
|
|
41
|
-
await db.process_data.put({ process: this.id, refid: key.state.refid, data: value, timestamp: Date.now() })
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
public async clear(key: Component): Promise<void> {
|
|
45
|
-
await db.process_data.where({ process: this.id, refid: key.state.refid }).delete()
|
|
46
|
-
}
|
|
47
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { Component, DataSubscriptionProvider } from '@hatiolab/things-scene'
|
|
2
|
-
|
|
3
|
-
import gql from 'graphql-tag'
|
|
4
|
-
import { subscribe } from '@operato/graphql'
|
|
5
|
-
|
|
6
|
-
export class DataSubscriptionProviderImpl implements DataSubscriptionProvider {
|
|
7
|
-
async subscribe(tag: string, component: Component) {
|
|
8
|
-
return await subscribe(
|
|
9
|
-
{
|
|
10
|
-
query: gql`
|
|
11
|
-
subscription {
|
|
12
|
-
data(tag: "${tag}") {
|
|
13
|
-
tag
|
|
14
|
-
data
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
`
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
next: async ({ data }: { data: any }) => {
|
|
21
|
-
if (data) {
|
|
22
|
-
component.data = data.data.data
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
)
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
dispose() {}
|
|
30
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { buildArgs, client } from '@operato/graphql'
|
|
2
|
-
|
|
3
|
-
import gql from 'graphql-tag'
|
|
4
|
-
|
|
5
|
-
export async function fetchFavoriteProcessList(listParam = {}) {
|
|
6
|
-
const response = await client.query({
|
|
7
|
-
query: gql`
|
|
8
|
-
{
|
|
9
|
-
favoriteProcesses(${buildArgs(listParam)}) {
|
|
10
|
-
items {
|
|
11
|
-
id
|
|
12
|
-
name
|
|
13
|
-
description
|
|
14
|
-
thumbnail
|
|
15
|
-
createdAt
|
|
16
|
-
updatedAt
|
|
17
|
-
}
|
|
18
|
-
total
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
`
|
|
22
|
-
})
|
|
23
|
-
|
|
24
|
-
return response.data
|
|
25
|
-
}
|
package/src/graphql/index.ts
DELETED