@operato/board 1.1.25 → 1.1.26
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 +9 -0
- package/dist/src/modeller/component-toolbar/component-toolbar.d.ts +2 -0
- package/dist/src/modeller/component-toolbar/component-toolbar.js +29 -9
- package/dist/src/modeller/component-toolbar/component-toolbar.js.map +1 -1
- package/dist/src/ox-board-modeller.d.ts +5 -2
- package/dist/src/ox-board-modeller.js +76 -67
- package/dist/src/ox-board-modeller.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +7 -7
- package/src/modeller/component-toolbar/component-toolbar.ts +34 -14
- package/src/ox-board-modeller.ts +80 -71
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@operato/board",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.26",
|
|
4
4
|
"description": "Webcomponent for board following open-wc recommendations",
|
|
5
5
|
"author": "heartyoh",
|
|
6
6
|
"main": "dist/src/index.js",
|
|
@@ -71,15 +71,15 @@
|
|
|
71
71
|
},
|
|
72
72
|
"dependencies": {
|
|
73
73
|
"@open-wc/scoped-elements": "^2.0.0-next.6",
|
|
74
|
-
"@operato/app": "^1.1.
|
|
75
|
-
"@operato/data-grist": "^1.1.
|
|
76
|
-
"@operato/font": "^1.1.
|
|
74
|
+
"@operato/app": "^1.1.26",
|
|
75
|
+
"@operato/data-grist": "^1.1.26",
|
|
76
|
+
"@operato/font": "^1.1.26",
|
|
77
77
|
"@operato/graphql": "^1.1.13",
|
|
78
78
|
"@operato/i18n": "^1.1.13",
|
|
79
|
-
"@operato/input": "^1.1.
|
|
79
|
+
"@operato/input": "^1.1.26",
|
|
80
80
|
"@operato/markdown": "^1.1.13",
|
|
81
81
|
"@operato/popup": "^1.1.23",
|
|
82
|
-
"@operato/property-editor": "^1.1.
|
|
82
|
+
"@operato/property-editor": "^1.1.26",
|
|
83
83
|
"@operato/styles": "^1.1.13",
|
|
84
84
|
"@operato/utils": "^1.1.15",
|
|
85
85
|
"@polymer/paper-dropdown-menu": "^3.2.0",
|
|
@@ -130,5 +130,5 @@
|
|
|
130
130
|
"prettier --write"
|
|
131
131
|
]
|
|
132
132
|
},
|
|
133
|
-
"gitHead": "
|
|
133
|
+
"gitHead": "c8418180a3140d45347bd5a57985e1933753f0c5"
|
|
134
134
|
}
|
|
@@ -24,7 +24,17 @@ export class ComponentToolbar extends ScopedElementsMixin(LitElement) {
|
|
|
24
24
|
background-color: var(--component-toolbar-background-color);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
|
|
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 {
|
|
28
38
|
display: flex;
|
|
29
39
|
flex-direction: row;
|
|
30
40
|
|
|
@@ -63,6 +73,7 @@ export class ComponentToolbar extends ScopedElementsMixin(LitElement) {
|
|
|
63
73
|
|
|
64
74
|
@query('#shift') shift!: HTMLImageElement
|
|
65
75
|
@query('component-menu') private menu!: HTMLElement
|
|
76
|
+
@query('div[components]') private componentsContainer!: HTMLElement
|
|
66
77
|
@queryAll('[data-group]') private groups!: NodeListOf<HTMLElement>
|
|
67
78
|
|
|
68
79
|
private icons: { [name: string]: string } = {}
|
|
@@ -107,19 +118,21 @@ export class ComponentToolbar extends ScopedElementsMixin(LitElement) {
|
|
|
107
118
|
const modeIcon = this.icons[this.mode === SCENE_MODE.SHIFT ? 'mode-shift' : 'mode-edit']
|
|
108
119
|
|
|
109
120
|
return html`
|
|
110
|
-
<
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
121
|
+
<div components @mousewheel=${(e: MouseEvent) => this.onWheelEvent(e)}>
|
|
122
|
+
<img id="shift" .src=${modeIcon} @click=${(e: MouseEvent) => this._onClickShift(e)} />
|
|
123
|
+
|
|
124
|
+
${componentList
|
|
125
|
+
.filter(group => group.templates?.length > 0)
|
|
126
|
+
.map(
|
|
127
|
+
group => html`
|
|
128
|
+
<img
|
|
129
|
+
data-group=${group.name}
|
|
130
|
+
@click=${(e: MouseEvent) => this._onClickGroup(e)}
|
|
131
|
+
.src=${this.icons[group.name]}
|
|
132
|
+
/>
|
|
133
|
+
`
|
|
134
|
+
)}
|
|
135
|
+
</div>
|
|
123
136
|
|
|
124
137
|
<component-menu
|
|
125
138
|
tabindex="-1"
|
|
@@ -135,6 +148,13 @@ export class ComponentToolbar extends ScopedElementsMixin(LitElement) {
|
|
|
135
148
|
`
|
|
136
149
|
}
|
|
137
150
|
|
|
151
|
+
onWheelEvent(e: Event) {
|
|
152
|
+
var delta = Math.max(-1, Math.min(1, (e as WheelEvent).deltaY || -(e as WheelEvent).detail))
|
|
153
|
+
this.componentsContainer.scrollTop += delta * 10
|
|
154
|
+
|
|
155
|
+
e.preventDefault()
|
|
156
|
+
}
|
|
157
|
+
|
|
138
158
|
_setMode(mode: SCENE_MODE) {
|
|
139
159
|
this.mode = mode
|
|
140
160
|
|
package/src/ox-board-modeller.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import '@material/mwc-fab'
|
|
2
|
-
import './modeller/scene-viewer/ox-scene-viewer'
|
|
3
2
|
import '@hatiolab/things-scene'
|
|
3
|
+
import './modeller/scene-viewer/ox-scene-handler.js'
|
|
4
|
+
import './modeller/scene-viewer/ox-scene-layer.js'
|
|
5
|
+
import './modeller/scene-viewer/ox-scene-property.js'
|
|
6
|
+
import './modeller/scene-viewer/ox-scene-viewer.js'
|
|
4
7
|
import './ox-board-viewer'
|
|
5
8
|
|
|
6
9
|
import { saveAs } from 'file-saver'
|
|
@@ -39,34 +42,38 @@ export class BoardModeller extends ScopedElementsMixin(LitElement) {
|
|
|
39
42
|
static styles = [
|
|
40
43
|
css`
|
|
41
44
|
:host {
|
|
42
|
-
display:
|
|
43
|
-
|
|
44
|
-
grid-template-rows: auto 1fr;
|
|
45
|
-
grid-template-columns: auto 1fr auto;
|
|
46
|
-
grid-template-areas: 'toolbar toolbar toolbar' 'palletbar scene propertybar';
|
|
47
|
-
grid-gap: 0;
|
|
45
|
+
display: flex;
|
|
46
|
+
flex-direction: column;
|
|
48
47
|
|
|
49
48
|
height: 100%;
|
|
50
49
|
overflow: hidden;
|
|
51
50
|
}
|
|
52
51
|
|
|
53
52
|
edit-toolbar {
|
|
54
|
-
|
|
53
|
+
flex: 45px;
|
|
54
|
+
max-height: 45px;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
div[content] {
|
|
58
|
+
flex: 1;
|
|
59
|
+
max-height: calc(100% - 45px);
|
|
60
|
+
|
|
61
|
+
display: flex;
|
|
62
|
+
flex-direction: row;
|
|
55
63
|
}
|
|
56
64
|
|
|
57
65
|
component-toolbar {
|
|
58
|
-
|
|
66
|
+
max-height: 100%;
|
|
59
67
|
}
|
|
60
68
|
|
|
61
69
|
property-sidebar {
|
|
62
|
-
grid-area: propertybar;
|
|
63
70
|
overflow: hidden;
|
|
64
71
|
}
|
|
65
72
|
|
|
66
73
|
#scene-wrap {
|
|
67
|
-
grid-area: scene;
|
|
68
74
|
position: relative;
|
|
69
75
|
|
|
76
|
+
flex: 1;
|
|
70
77
|
display: flex;
|
|
71
78
|
flex-direction: row;
|
|
72
79
|
}
|
|
@@ -176,7 +183,7 @@ export class BoardModeller extends ScopedElementsMixin(LitElement) {
|
|
|
176
183
|
ids = this.scene.ids.map(({ key }) => key)
|
|
177
184
|
}
|
|
178
185
|
|
|
179
|
-
ids = ids.filter(
|
|
186
|
+
ids = ids.filter(Boolean).sort()
|
|
180
187
|
callback(ids)
|
|
181
188
|
})
|
|
182
189
|
|
|
@@ -215,72 +222,74 @@ export class BoardModeller extends ScopedElementsMixin(LitElement) {
|
|
|
215
222
|
${this.renderBrandingZone()}
|
|
216
223
|
</edit-toolbar>
|
|
217
224
|
|
|
218
|
-
<
|
|
219
|
-
|
|
220
|
-
.mode=${this.mode}
|
|
221
|
-
@mode-changed=${(e: CustomEvent) => {
|
|
222
|
-
this.mode = e.detail.value
|
|
223
|
-
}}
|
|
224
|
-
.componentGroupList=${this.componentGroupList}
|
|
225
|
-
.group=${this.group}
|
|
226
|
-
>
|
|
227
|
-
</component-toolbar>
|
|
228
|
-
|
|
229
|
-
<div id="scene-wrap">
|
|
230
|
-
<ox-scene-viewer
|
|
231
|
-
id="scene"
|
|
225
|
+
<div content>
|
|
226
|
+
<component-toolbar
|
|
232
227
|
.scene=${this.scene}
|
|
233
|
-
@scene-changed=${(e: CustomEvent) => {
|
|
234
|
-
this.scene = e.detail.value
|
|
235
|
-
}}
|
|
236
|
-
.model=${this.model}
|
|
237
|
-
.selected=${this.selected}
|
|
238
|
-
@selected-changed=${(e: CustomEvent) => {
|
|
239
|
-
this.selected = e.detail.value
|
|
240
|
-
}}
|
|
241
228
|
.mode=${this.mode}
|
|
242
229
|
@mode-changed=${(e: CustomEvent) => {
|
|
243
230
|
this.mode = e.detail.value
|
|
244
231
|
}}
|
|
245
|
-
|
|
246
|
-
.
|
|
247
|
-
@contextmenu=${() => this.onContextMenu()}
|
|
248
|
-
.provider=${this.provider}
|
|
249
|
-
name="modeller"
|
|
232
|
+
.componentGroupList=${this.componentGroupList}
|
|
233
|
+
.group=${this.group}
|
|
250
234
|
>
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
<ox-scene-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
235
|
+
</component-toolbar>
|
|
236
|
+
|
|
237
|
+
<div id="scene-wrap">
|
|
238
|
+
<ox-scene-viewer
|
|
239
|
+
id="scene"
|
|
240
|
+
.scene=${this.scene}
|
|
241
|
+
@scene-changed=${(e: CustomEvent) => {
|
|
242
|
+
this.scene = e.detail.value
|
|
243
|
+
}}
|
|
244
|
+
.model=${this.model}
|
|
245
|
+
.selected=${this.selected}
|
|
246
|
+
@selected-changed=${(e: CustomEvent) => {
|
|
247
|
+
this.selected = e.detail.value
|
|
248
|
+
}}
|
|
249
|
+
.mode=${this.mode}
|
|
250
|
+
@mode-changed=${(e: CustomEvent) => {
|
|
251
|
+
this.mode = e.detail.value
|
|
252
|
+
}}
|
|
253
|
+
fit="ratio"
|
|
254
|
+
.baseUrl=${this.baseUrl}
|
|
255
|
+
@contextmenu=${() => this.onContextMenu()}
|
|
256
|
+
.provider=${this.provider}
|
|
257
|
+
name="modeller"
|
|
258
|
+
>
|
|
259
|
+
<ox-scene-layer type="selection-layer"></ox-scene-layer>
|
|
260
|
+
<ox-scene-layer type="modeling-layer"></ox-scene-layer>
|
|
261
|
+
<ox-scene-layer type="add-layer"> </ox-scene-layer>
|
|
262
|
+
<ox-scene-layer type="guide-layer">
|
|
263
|
+
<ox-scene-property name="ruler" value="disabled"></ox-scene-property>
|
|
264
|
+
</ox-scene-layer>
|
|
265
|
+
<ox-scene-layer type="shift-layer">
|
|
266
|
+
<ox-scene-property name="text" value="${this.overlay}"></ox-scene-property>
|
|
267
|
+
<ox-scene-property name="alpha" value="0.3"></ox-scene-property>
|
|
268
|
+
<ox-scene-property name="fontFamily" value="arial"></ox-scene-property>
|
|
269
|
+
<ox-scene-property name="fontSize" value="30" type="number"></ox-scene-property>
|
|
270
|
+
<ox-scene-property name="fontColor" value="navy"></ox-scene-property>
|
|
271
|
+
<ox-scene-property name="textBaseline" value="top"></ox-scene-property>
|
|
272
|
+
<ox-scene-property name="textAlign" value="left"></ox-scene-property>
|
|
273
|
+
<ox-scene-property name="paddingTop" value="50" type="number"></ox-scene-property>
|
|
274
|
+
<ox-scene-property name="paddingLeft" value="50" type="number"></ox-scene-property>
|
|
275
|
+
</ox-scene-layer>
|
|
276
|
+
<ox-scene-layer type="decotag-layer"></ox-scene-layer>
|
|
277
|
+
<ox-scene-handler type="text-editor"></ox-scene-handler>
|
|
278
|
+
<ox-scene-handler type="move-handler"></ox-scene-handler>
|
|
279
|
+
</ox-scene-viewer>
|
|
280
|
+
|
|
281
|
+
<mwc-fab icon="save" @click=${() => this.onTapSave()} title="save"> </mwc-fab>
|
|
282
|
+
</div>
|
|
283
|
+
|
|
284
|
+
<property-sidebar
|
|
285
|
+
.scene=${this.scene}
|
|
286
|
+
.selected=${this.selected}
|
|
287
|
+
.collapsed=${this.hideProperty}
|
|
288
|
+
.fonts=${this.fonts}
|
|
289
|
+
.propertyEditor=${this.propertyEditor}
|
|
290
|
+
>
|
|
291
|
+
</property-sidebar>
|
|
274
292
|
</div>
|
|
275
|
-
|
|
276
|
-
<property-sidebar
|
|
277
|
-
.scene=${this.scene}
|
|
278
|
-
.selected=${this.selected}
|
|
279
|
-
.collapsed=${this.hideProperty}
|
|
280
|
-
.fonts=${this.fonts}
|
|
281
|
-
.propertyEditor=${this.propertyEditor}
|
|
282
|
-
>
|
|
283
|
-
</property-sidebar>
|
|
284
293
|
`
|
|
285
294
|
}
|
|
286
295
|
|