@operato/board 8.0.0-beta.0 → 8.0.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.
Files changed (82) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/package.json +14 -14
  3. package/.storybook/main.js +0 -3
  4. package/.storybook/server.mjs +0 -8
  5. package/src/component/3d.ts +0 -29
  6. package/src/component/chart-and-gauge.ts +0 -28
  7. package/src/component/container.ts +0 -63
  8. package/src/component/data-source.ts +0 -30
  9. package/src/component/etc.ts +0 -88
  10. package/src/component/form.ts +0 -42
  11. package/src/component/index.ts +0 -12
  12. package/src/component/iot.ts +0 -52
  13. package/src/component/line.ts +0 -156
  14. package/src/component/register-default-groups.ts +0 -28
  15. package/src/component/shape.ts +0 -156
  16. package/src/component/table.ts +0 -28
  17. package/src/component/text-and-media.ts +0 -125
  18. package/src/component/warehouse.ts +0 -26
  19. package/src/data-storage/data-storage.ts +0 -76
  20. package/src/graphql/board.ts +0 -144
  21. package/src/graphql/data-subscription.ts +0 -30
  22. package/src/graphql/favorite-board.ts +0 -25
  23. package/src/graphql/group.ts +0 -138
  24. package/src/graphql/index.ts +0 -4
  25. package/src/graphql/play-group.ts +0 -225
  26. package/src/graphql/scenario.ts +0 -79
  27. package/src/index.ts +0 -10
  28. package/src/modeller/component-toolbar/component-detail.ts +0 -52
  29. package/src/modeller/component-toolbar/component-menu.ts +0 -196
  30. package/src/modeller/component-toolbar/component-toolbar.ts +0 -196
  31. package/src/modeller/component-toolbar/mode-icons.ts +0 -88
  32. package/src/modeller/edit-toolbar-style.ts +0 -232
  33. package/src/modeller/edit-toolbar.ts +0 -587
  34. package/src/modeller/property-sidebar/abstract-property.ts +0 -69
  35. package/src/modeller/property-sidebar/data-binding/data-binding-mapper.ts +0 -475
  36. package/src/modeller/property-sidebar/data-binding/data-binding-value-map.ts +0 -19
  37. package/src/modeller/property-sidebar/data-binding/data-binding-value-range.ts +0 -19
  38. package/src/modeller/property-sidebar/data-binding/data-binding.ts +0 -480
  39. package/src/modeller/property-sidebar/effects/effects-shared-style.ts +0 -62
  40. package/src/modeller/property-sidebar/effects/effects.ts +0 -69
  41. package/src/modeller/property-sidebar/effects/property-animation.ts +0 -146
  42. package/src/modeller/property-sidebar/effects/property-animations.ts +0 -93
  43. package/src/modeller/property-sidebar/effects/property-event-hover.ts +0 -200
  44. package/src/modeller/property-sidebar/effects/property-event-tap.ts +0 -251
  45. package/src/modeller/property-sidebar/effects/property-event.ts +0 -73
  46. package/src/modeller/property-sidebar/effects/property-shadow.ts +0 -114
  47. package/src/modeller/property-sidebar/effects/value-converter.ts +0 -23
  48. package/src/modeller/property-sidebar/inspector/inspector.ts +0 -404
  49. package/src/modeller/property-sidebar/property-shared-style.ts +0 -136
  50. package/src/modeller/property-sidebar/property-sidebar.ts +0 -326
  51. package/src/modeller/property-sidebar/shapes/box-padding-editor-styles.ts +0 -94
  52. package/src/modeller/property-sidebar/shapes/shapes.ts +0 -432
  53. package/src/modeller/property-sidebar/specifics/specific-properties-builder.ts +0 -152
  54. package/src/modeller/property-sidebar/specifics/specifics.ts +0 -81
  55. package/src/modeller/property-sidebar/styles/styles.ts +0 -577
  56. package/src/modeller/scene-viewer/confidential-overlay.ts +0 -18
  57. package/src/modeller/scene-viewer/ox-scene-handler.ts +0 -40
  58. package/src/modeller/scene-viewer/ox-scene-layer.ts +0 -42
  59. package/src/modeller/scene-viewer/ox-scene-property.ts +0 -10
  60. package/src/modeller/scene-viewer/ox-scene-viewer.ts +0 -263
  61. package/src/ox-board-component-info.ts +0 -236
  62. package/src/ox-board-list.ts +0 -401
  63. package/src/ox-board-modeller.ts +0 -408
  64. package/src/ox-board-player-style.ts +0 -200
  65. package/src/ox-board-player.ts +0 -333
  66. package/src/ox-board-template-list.ts +0 -267
  67. package/src/ox-board-template-viewer.ts +0 -198
  68. package/src/ox-board-viewer.ts +0 -727
  69. package/src/ox-editor-board-selector.ts +0 -91
  70. package/src/ox-property-editor-board-selector.ts +0 -23
  71. package/src/player/ox-board-player-carousel.ts +0 -197
  72. package/src/player/ox-board-player-grid.ts +0 -78
  73. package/src/player/ox-board-wrapper.ts +0 -152
  74. package/src/selector/board-creation-popup.ts +0 -151
  75. package/src/selector/board-thumbnail-card.ts +0 -175
  76. package/src/selector/ox-board-creation-card.ts +0 -98
  77. package/src/selector/ox-board-selector.ts +0 -382
  78. package/src/types.ts +0 -63
  79. package/stories/property-data-binding.stories.ts +0 -34
  80. package/tsconfig.json +0 -24
  81. package/web-dev-server.config.mjs +0 -30
  82. package/web-test-runner.config.mjs +0 -29
@@ -1,196 +0,0 @@
1
- /**
2
- * @license Copyright © HatioLab Inc. All rights reserved.
3
- */
4
-
5
- import { css, html, LitElement, PropertyValues } from 'lit'
6
- import { property, query, queryAll } from 'lit/decorators.js'
7
-
8
- import { Scene, SCENE_MODE } from '@hatiolab/things-scene'
9
- import { ScopedElementsMixin } from '@open-wc/scoped-elements'
10
-
11
- import { ComponentGroup } from '../../types'
12
- import { ComponentMenu } from './component-menu.js'
13
- import { ICON_EDIT_MODE, ICON_SHIFT_MODE } from './mode-icons'
14
-
15
- export class ComponentToolbar extends ScopedElementsMixin(LitElement) {
16
- static styles = [
17
- css`
18
- :host {
19
- left: 0;
20
- display: block;
21
- position: relative;
22
-
23
- width: var(--component-toolbar-icon-size);
24
- background-color: var(--component-toolbar-background-color);
25
- }
26
-
27
- [components] {
28
- display: block;
29
- padding: 0;
30
- margin: 0;
31
-
32
- width: 100%;
33
- height: 100%;
34
- overflow: hidden;
35
- }
36
-
37
- [components] > img {
38
- display: flex;
39
- flex-direction: row;
40
-
41
- width: var(--component-toolbar-icon-size);
42
- height: var(--component-toolbar-icon-size);
43
- min-width: 50%;
44
-
45
- border-bottom: var(--component-toolbar-border);
46
- margin: 0;
47
- padding: 6px;
48
- box-sizing: border-box;
49
- }
50
-
51
- #shift[active] {
52
- background-color: #beb9b3;
53
- }
54
-
55
- component-menu {
56
- position: absolute;
57
- top: 0;
58
- left: var(--component-toolbar-icon-size);
59
- height: 100%;
60
- outline: none;
61
- }
62
-
63
- component-menu[hidden] {
64
- display: none;
65
- }
66
- `
67
- ]
68
-
69
- @property({ type: Array }) componentGroupList: ComponentGroup[] = []
70
- @property({ type: String }) group?: string | null
71
- @property({ type: Object }) scene!: Scene
72
- @property({ type: Number }) mode: SCENE_MODE = SCENE_MODE.EDIT
73
-
74
- @query('#shift') shift!: HTMLImageElement
75
- @query('component-menu') private menu!: HTMLElement
76
- @query('div[components]') private componentsContainer!: HTMLElement
77
- @queryAll('[data-group]') private groups!: NodeListOf<HTMLElement>
78
-
79
- private icons: { [name: string]: string } = {}
80
-
81
- updated(changes: PropertyValues<this>) {
82
- if (changes.has('componentGroupList')) {
83
- const color = getComputedStyle(this, null).getPropertyValue('--md-sys-color-primary')
84
-
85
- this.icons = (this.componentGroupList || [])
86
- .filter(group => group.templates?.length > 0)
87
- .reduce(
88
- (sum, group: ComponentGroup) => {
89
- sum[group.name] =
90
- 'data:image/svg+xml;charset=UTF-8;base64,' + btoa(group.icon.replace(/{{strokeColor}}/g, color))
91
- return sum
92
- },
93
- {} as { [name: string]: string }
94
- )
95
-
96
- this.icons['mode-edit'] =
97
- 'data:image/svg+xml;charset=UTF-8;base64,' + btoa(ICON_EDIT_MODE.replace(/{{strokeColor}}/g, color))
98
- this.icons['mode-shift'] =
99
- 'data:image/svg+xml;charset=UTF-8;base64,' + btoa(ICON_SHIFT_MODE.replace(/{{strokeColor}}/g, color))
100
- }
101
-
102
- if (changes.has('group')) {
103
- this.groups.forEach(group => {
104
- group.getAttribute('data-group') === this.group
105
- ? group.setAttribute('active', '')
106
- : group.removeAttribute('active')
107
- })
108
-
109
- this.group ? this.menu.removeAttribute('hidden') : this.menu.setAttribute('hidden', '')
110
- }
111
- }
112
-
113
- static get scopedElements() {
114
- return {
115
- 'component-menu': ComponentMenu
116
- }
117
- }
118
-
119
- render() {
120
- const componentList = this.componentGroupList || []
121
- const modeIcon = this.icons[this.mode === SCENE_MODE.SHIFT ? 'mode-shift' : 'mode-edit']
122
-
123
- return html`
124
- <div components @mousewheel=${(e: MouseEvent) => this.onWheelEvent(e)}>
125
- <img id="shift" .src=${modeIcon} @click=${(e: MouseEvent) => this._onClickShift(e)} />
126
-
127
- ${componentList
128
- .filter(group => group.templates?.length > 0)
129
- .map(
130
- group => html`
131
- <img
132
- data-group=${group.name}
133
- @click=${(e: MouseEvent) => this._onClickGroup(e)}
134
- .src=${this.icons[group.name]}
135
- />
136
- `
137
- )}
138
- </div>
139
-
140
- <component-menu
141
- tabindex="-1"
142
- @focusout=${() => {
143
- this.group = null
144
- }}
145
- .scene=${this.scene}
146
- .group=${this.group}
147
- .groups=${componentList}
148
- hidden
149
- >
150
- </component-menu>
151
- `
152
- }
153
-
154
- onWheelEvent(e: Event) {
155
- var delta = Math.max(-1, Math.min(1, (e as WheelEvent).deltaY || -(e as WheelEvent).detail))
156
- this.componentsContainer.scrollTop += delta * 10
157
-
158
- e.preventDefault()
159
- }
160
-
161
- _setMode(mode: SCENE_MODE) {
162
- this.mode = mode
163
-
164
- this.dispatchEvent(
165
- new CustomEvent('mode-changed', {
166
- bubbles: true,
167
- composed: true,
168
- detail: { value: mode }
169
- })
170
- )
171
- }
172
-
173
- _onClickShift(e: MouseEvent) {
174
- const shift = this.shift
175
-
176
- if (shift.hasAttribute('active')) {
177
- shift.removeAttribute('active')
178
- this._setMode(SCENE_MODE.EDIT)
179
- } else {
180
- shift.setAttribute('active', '')
181
- this._setMode(SCENE_MODE.SHIFT)
182
- }
183
- }
184
-
185
- async _onClickGroup(e: MouseEvent) {
186
- var button = e.target as HTMLElement
187
-
188
- this.group = button!.closest('[data-group]')?.getAttribute('data-group')
189
-
190
- if (!this.group) return
191
-
192
- await this.updateComplete
193
-
194
- this.menu?.focus()
195
- }
196
- }
@@ -1,88 +0,0 @@
1
- export const ICON_EDIT_MODE = `
2
- <svg
3
- version="1.1"
4
- id="Layer_1"
5
- xmlns="http://www.w3.org/2000/svg"
6
- xmlns:xlink="http://www.w3.org/1999/xlink"
7
- x="0px"
8
- y="0px"
9
- viewBox="0 0 30 30"
10
- style="enable-background:new 0 0 30 30;"
11
- xml:space="preserve"
12
- >
13
- <style type="text/css">
14
- .st0 {
15
- fill: {{strokeColor}};
16
- }
17
- .st1 {
18
- fill: none;
19
- stroke: {{strokeColor}};
20
- stroke-width: 0.75;
21
- stroke-linejoin: round;
22
- stroke-miterlimit: 10;
23
- }
24
- </style>
25
- <g>
26
- <polygon class="st0" points="2.7,3.9 2.7,22.8 7.8,17.2 16.1,16.9 " />
27
- <path
28
- class="st1"
29
- d="M27.7,20.1L26.1,19c-0.1,0-0.2,0-0.2,0c0,0.1,0,0.2,0,0.2l1.2,0.9h-4.9v-5l0.9,1.2c0,0,0.1,0.1,0.1,0.1
30
- c0,0,0.1,0,0.1,0c0.1,0,0.1-0.1,0-0.2l-1.1-1.6c-0.1-0.1-0.2-0.1-0.2,0L20.8,16c0,0.1,0,0.2,0,0.2s0.2,0,0.2,0l0.9-1.2v5h-5
31
- l1.2-0.9c0.1,0,0.1-0.1,0-0.2c0-0.1-0.1-0.1-0.2,0l-1.6,1.1c0,0-0.1,0.1-0.1,0.1c0,0,0,0.1,0.1,0.1l1.6,1.1c0,0,0.1,0,0.1,0
32
- c0,0,0.1,0,0.1-0.1c0-0.1,0-0.2,0-0.2l-1.2-0.9h5v5L21,24.2c0-0.1-0.1-0.1-0.2,0c-0.1,0-0.1,0.1,0,0.2l1.1,1.6c0,0,0.1,0.1,0.1,0.1
33
- s0.1,0,0.1-0.1l1.1-1.6c0-0.1,0-0.2,0-0.2c-0.1,0-0.2,0-0.2,0l-0.9,1.2v-5h4.9l-1.2,0.9c-0.1,0-0.1,0.1,0,0.2c0,0,0.1,0.1,0.1,0.1
34
- c0,0,0.1,0,0.1,0l1.6-1.1c0,0,0.1-0.1,0.1-0.1C27.7,20.2,27.7,20.1,27.7,20.1z"
35
- />
36
- </g>
37
- </svg>
38
- `
39
-
40
- export const ICON_SHIFT_MODE = `
41
- <svg
42
- version="1.1"
43
- id="Layer_1"
44
- xmlns="http://www.w3.org/2000/svg"
45
- xmlns:xlink="http://www.w3.org/1999/xlink"
46
- x="0px"
47
- y="0px"
48
- viewBox="0 0 30 30"
49
- style="enable-background:new 0 0 30 30;"
50
- xml:space="preserve"
51
- >
52
- <style type="text/css">
53
- .st0 {
54
- fill: {{strokeColor}};
55
- stroke: {{strokeColor}};
56
- fill-rule: evenodd;
57
- clip-rule: evenodd;
58
- }
59
- .st1 {
60
- fill: {{strokeColor}};
61
- stroke: {{strokeColor}};
62
- stroke-width: 0.75;
63
- stroke-linejoin: round;
64
- stroke-miterlimit: 10;
65
- }
66
- </style>
67
- <g>
68
- <path
69
- class="st0"
70
- d="M7.8,23.2c1.6,0,3.8,0,5.7,0c0.8,0,1.3-0.3,1.6-1.2c0.4-2.9,1.5-4.9,2.4-6.9s1.4-2.5,1.6-3.4
71
- c0.1-0.5,0.2-1.6-0.4-1.9c-0.6-0.3-1.2,0.1-1.9,1.3c-0.8,1.6-1,2-1.4,2c-0.3,0-0.1-4,0-5.4c0.1-1.3-0.6-1.8-1.3-1.8
72
- c-0.8-0.1-1.5,0.4-1.5,1.5c0,1.5-0.2,5.2-0.7,5.2c-0.4,0-0.3-4.3-0.6-6.7c-0.1-1-0.6-1.8-1.5-1.8C9.1,4.2,8.4,4.7,8.3,5.8
73
- c-0.1,1.3,1,6.7,0.5,6.7c-0.4,0-1.4-3.3-2.3-5.1C6,6.5,5.6,6,4.6,6.4C3.9,6.7,3.5,7.6,3.8,8.5c0.5,1.2,2.7,6.8,2.2,6.8
74
- c-0.4,0-1.4-1.4-2.7-2.1c-1.1-0.6-1.8-0.4-2.1-0.1c-0.4,0.3-0.7,1,0.9,2.8c0.6,0.6,3.1,2.3,3.7,3.2c0.7,1.3,0.6,1,0.8,2.8
75
- C6.7,22.7,7,23.2,7.8,23.2z"
76
- />
77
- <path
78
- class="st1"
79
- d="M28.7,20.1L27.1,19c-0.1,0-0.2,0-0.2,0c0,0.1,0,0.2,0,0.2l1.2,0.9h-4.9v-5l0.9,1.2c0,0,0.1,0.1,0.1,0.1
80
- c0,0,0.1,0,0.1,0c0.1,0,0.1-0.1,0-0.2l-1.1-1.6c-0.1-0.1-0.2-0.1-0.2,0L21.8,16c0,0.1,0,0.2,0,0.2s0.2,0,0.2,0l0.9-1.2v5h-5
81
- l1.2-0.9c0.1,0,0.1-0.1,0-0.2c0-0.1-0.1-0.1-0.2,0l-1.6,1.1c0,0-0.1,0.1-0.1,0.1c0,0,0,0.1,0.1,0.1l1.6,1.1c0,0,0.1,0,0.1,0
82
- c0,0,0.1,0,0.1-0.1c0-0.1,0-0.2,0-0.2l-1.2-0.9h5v5L22,24.2c0-0.1-0.1-0.1-0.2,0c-0.1,0-0.1,0.1,0,0.2l1.1,1.6c0,0,0.1,0.1,0.1,0.1
83
- s0.1,0,0.1-0.1l1.1-1.6c0-0.1,0-0.2,0-0.2c-0.1,0-0.2,0-0.2,0l-0.9,1.2v-5h4.9l-1.2,0.9c-0.1,0-0.1,0.1,0,0.2c0,0,0.1,0.1,0.1,0.1
84
- c0,0,0.1,0,0.1,0l1.6-1.1c0,0,0.1-0.1,0.1-0.1C28.7,20.2,28.7,20.1,28.7,20.1z"
85
- />
86
- </g>
87
- </svg>
88
- `
@@ -1,232 +0,0 @@
1
- /**
2
- * @license Copyright © HatioLab Inc. All rights reserved.
3
- */
4
-
5
- import { css } from 'lit'
6
-
7
- export const style = css`
8
- :host {
9
- background-color: var(--edit-toolbar-background-color, var(--md-sys-color-secondary, #394e64));
10
-
11
- overflow-x: hidden;
12
- }
13
-
14
- [tools] {
15
- display: flex;
16
- align-items: center;
17
- overflow: none;
18
- padding: 0px 10px;
19
- }
20
-
21
- [tools] > * {
22
- padding: 0px;
23
- }
24
-
25
- [tools] > span[button] {
26
- min-width: 30px;
27
- }
28
-
29
- [tools] > span[padding] {
30
- flex: 1;
31
- }
32
-
33
- [tools] > .vline {
34
- display: block;
35
- flex: none;
36
- border-left: 1px solid rgba(255, 255, 255, 0.2);
37
- border-right: 1px solid rgba(0, 0, 0, 0.15);
38
- width: 0px;
39
- height: 18px;
40
- margin: 0 3px;
41
- }
42
-
43
- span[button] {
44
- min-height: 35px;
45
-
46
- background: var(--url-icon-htoolbar) no-repeat;
47
- background-position-x: 50%;
48
- opacity: 0.8;
49
- }
50
- span[button]:hover {
51
- opacity: 1;
52
- background-color: rgba(0, 0, 0, 0.1);
53
- cursor: pointer;
54
- }
55
-
56
- #fullscreen,
57
- #toggle-property {
58
- flex: none;
59
- }
60
-
61
- #align-left {
62
- background-position-y: 8px;
63
- }
64
-
65
- #align-center {
66
- background-position-y: -42px;
67
- }
68
-
69
- #align-right {
70
- background-position-y: -92px;
71
- }
72
-
73
- #align-top {
74
- background-position-y: -142px;
75
- }
76
-
77
- #align-middle {
78
- background-position-y: -192px;
79
- }
80
-
81
- #align-bottom {
82
- background-position-y: -242px;
83
- }
84
-
85
- #undo {
86
- background-position-y: -592px;
87
- }
88
-
89
- #redo {
90
- background-position-y: -642px;
91
- }
92
-
93
- #front {
94
- background-position-y: -292px;
95
- }
96
-
97
- #back {
98
- background-position-y: -342px;
99
- }
100
-
101
- #forward {
102
- background-position-y: -392px;
103
- }
104
-
105
- #backward {
106
- background-position-y: -442px;
107
- }
108
-
109
- #symmetry-x {
110
- background-position-y: -492px;
111
- }
112
-
113
- #symmetry-y {
114
- background-position-y: -542px;
115
- }
116
-
117
- #group {
118
- background-position-y: -492px;
119
- }
120
-
121
- #ungroup {
122
- background-position-y: -542px;
123
- }
124
-
125
- #fullscreen {
126
- background-position-y: -692px;
127
- }
128
-
129
- #toggle-property {
130
- background-position-y: -692px;
131
- float: right;
132
- }
133
-
134
- #zoomin {
135
- background-position-y: -742px;
136
- }
137
-
138
- #zoomout {
139
- background-position-y: -792px;
140
- }
141
-
142
- #fit-scene {
143
- background-position-y: -1492px;
144
- }
145
-
146
- #cut {
147
- background-position-y: -842px;
148
- }
149
-
150
- #copy {
151
- background-position-y: -892px;
152
- }
153
-
154
- #paste {
155
- background-position-y: -942px;
156
- }
157
-
158
- #delete {
159
- background-position-y: -992px;
160
- }
161
-
162
- #font-increase {
163
- background-position-y: -1042px;
164
- }
165
-
166
- #font-decrease {
167
- background-position-y: -1092px;
168
- }
169
-
170
- #style-copy {
171
- background-position-y: -1142px;
172
- }
173
-
174
- #databind-copy {
175
- background-position-y: -1692px;
176
- }
177
-
178
- #context-menu {
179
- background-position-y: -692px;
180
- }
181
-
182
- #symmetry-x {
183
- background-position-y: -1192px;
184
- }
185
-
186
- #symmetry-y {
187
- background-position-y: -1242px;
188
- }
189
-
190
- #rotate-cw {
191
- background-position-y: -1292px;
192
- }
193
-
194
- #rotate-ccw {
195
- background-position-y: -1342px;
196
- }
197
-
198
- #distribute-horizontal {
199
- background-position-y: -1542px;
200
- }
201
-
202
- #distribute-vertical {
203
- background-position-y: -1593px;
204
- }
205
-
206
- #toggle-property {
207
- background-position-y: -1392px;
208
- }
209
-
210
- #preview {
211
- background-position-y: -1640px;
212
- }
213
-
214
- /* bigger buttons */
215
- #fullscreen {
216
- background: var(--url-icon-fullscreen) 50% 10px no-repeat;
217
- width: var(--edit-toolbar-bigger-icon-size);
218
- height: var(--edit-toolbar-bigger-icon-size);
219
- border-left: var(--edit-toolbar-bigger-icon-line);
220
- }
221
-
222
- #toggle-property {
223
- background: var(--url-icon-collapse) 80% 10px no-repeat;
224
- width: var(--edit-toolbar-bigger-icon-size);
225
- height: var(--edit-toolbar-bigger-icon-size);
226
- border-left: var(--edit-toolbar-bigger-icon-line);
227
- }
228
-
229
- #toggle-property[active] {
230
- background: var(--url-icon-collapse-active) 80% 10px no-repeat;
231
- }
232
- `