@operato/board 1.0.0-beta.4 → 1.0.0-beta.40
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 +504 -0
- package/demo/index-modeller.html +1 -1
- package/demo/index-player.html +1 -1
- package/demo/index-viewer.html +1 -1
- package/demo/index.html +1 -1
- package/dist/src/data-storage/data-storage.d.ts +8 -0
- package/dist/src/data-storage/data-storage.js +28 -0
- package/dist/src/data-storage/data-storage.js.map +1 -0
- package/dist/src/index.d.ts +7 -6
- package/dist/src/index.js +7 -6
- package/dist/src/index.js.map +1 -1
- package/dist/src/modeller/component-toolbar/component-menu.js +2 -2
- package/dist/src/modeller/component-toolbar/component-menu.js.map +1 -1
- package/dist/src/modeller/component-toolbar/component-toolbar.js +1 -1
- package/dist/src/modeller/component-toolbar/component-toolbar.js.map +1 -1
- package/dist/src/modeller/edit-toolbar.d.ts +1 -1
- package/dist/src/modeller/edit-toolbar.js +3 -3
- package/dist/src/modeller/edit-toolbar.js.map +1 -1
- package/dist/src/modeller/property-sidebar/data-binding/data-binding-mapper.d.ts +1 -0
- package/dist/src/modeller/property-sidebar/data-binding/data-binding-mapper.js +40 -7
- package/dist/src/modeller/property-sidebar/data-binding/data-binding-mapper.js.map +1 -1
- package/dist/src/modeller/property-sidebar/data-binding/data-binding.js +7 -0
- package/dist/src/modeller/property-sidebar/data-binding/data-binding.js.map +1 -1
- package/dist/src/modeller/property-sidebar/effects/effects-shared-style.js +4 -0
- package/dist/src/modeller/property-sidebar/effects/effects-shared-style.js.map +1 -1
- package/dist/src/modeller/property-sidebar/inspector/inspector.js +6 -4
- package/dist/src/modeller/property-sidebar/inspector/inspector.js.map +1 -1
- package/dist/src/modeller/property-sidebar/property-shared-style.js +4 -0
- package/dist/src/modeller/property-sidebar/property-shared-style.js.map +1 -1
- package/dist/src/modeller/property-sidebar/property-sidebar.js +1 -0
- package/dist/src/modeller/property-sidebar/property-sidebar.js.map +1 -1
- package/dist/src/modeller/property-sidebar/styles/styles.d.ts +1 -0
- package/dist/src/modeller/property-sidebar/styles/styles.js +4 -3
- package/dist/src/modeller/property-sidebar/styles/styles.js.map +1 -1
- package/dist/src/modeller/scene-viewer/ox-scene-player.js +2 -2
- package/dist/src/modeller/scene-viewer/ox-scene-player.js.map +1 -1
- package/dist/src/modeller/scene-viewer/ox-scene-viewer.d.ts +1 -1
- package/dist/src/modeller/scene-viewer/ox-scene-viewer.js +6 -3
- package/dist/src/modeller/scene-viewer/ox-scene-viewer.js.map +1 -1
- package/dist/src/ox-board-list.js +1 -1
- package/dist/src/ox-board-list.js.map +1 -1
- package/dist/src/ox-board-modeller.js +1 -0
- package/dist/src/ox-board-modeller.js.map +1 -1
- package/dist/src/ox-board-viewer.js +9 -7
- package/dist/src/ox-board-viewer.js.map +1 -1
- package/dist/src/player/ox-board-wrapper.js +2 -2
- package/dist/src/player/ox-board-wrapper.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +17 -16
- package/src/data-storage/data-storage.ts +47 -0
- package/src/index.ts +7 -6
- package/src/modeller/component-toolbar/component-menu.ts +3 -4
- package/src/modeller/component-toolbar/component-toolbar.ts +1 -1
- package/src/modeller/edit-toolbar.ts +3 -3
- package/src/modeller/property-sidebar/data-binding/data-binding-mapper.ts +44 -10
- package/src/modeller/property-sidebar/data-binding/data-binding.ts +10 -2
- package/src/modeller/property-sidebar/effects/effects-shared-style.ts +4 -0
- package/src/modeller/property-sidebar/inspector/inspector.ts +7 -4
- package/src/modeller/property-sidebar/property-shared-style.ts +4 -0
- package/src/modeller/property-sidebar/property-sidebar.ts +1 -0
- package/src/modeller/property-sidebar/styles/styles.ts +5 -4
- package/src/modeller/scene-viewer/ox-scene-player.ts +2 -2
- package/src/modeller/scene-viewer/ox-scene-viewer.ts +6 -3
- package/src/ox-board-list.ts +1 -1
- package/src/ox-board-modeller.ts +1 -0
- package/src/ox-board-viewer.ts +9 -7
- package/src/player/ox-board-wrapper.ts +2 -2
- package/yarn-error.log +18355 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@operato/board",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.40",
|
|
4
4
|
"description": "Webcomponent for board following open-wc recommendations",
|
|
5
5
|
"author": "heartyoh",
|
|
6
6
|
"license": "MIT",
|
|
@@ -49,20 +49,21 @@
|
|
|
49
49
|
"storybook:build": "tsc && npm run analyze -- --exclude dist && build-storybook"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@operato/app": "^1.0.0-beta.
|
|
53
|
-
"@operato/data-grist": "^1.0.0-beta.
|
|
54
|
-
"@operato/font": "^1.0.0-beta.
|
|
55
|
-
"@operato/graphql": "^1.0.0-beta.
|
|
56
|
-
"@operato/i18n": "^1.0.0-beta.
|
|
57
|
-
"@operato/input": "^1.0.0-beta.
|
|
58
|
-
"@operato/markdown": "^1.0.0-beta.
|
|
59
|
-
"@operato/popup": "^1.0.0-beta.
|
|
60
|
-
"@operato/property-editor": "^1.0.0-beta.
|
|
61
|
-
"@operato/styles": "^1.0.0-beta.
|
|
62
|
-
"@operato/utils": "^1.0.0-beta.
|
|
52
|
+
"@operato/app": "^1.0.0-beta.40",
|
|
53
|
+
"@operato/data-grist": "^1.0.0-beta.40",
|
|
54
|
+
"@operato/font": "^1.0.0-beta.40",
|
|
55
|
+
"@operato/graphql": "^1.0.0-beta.40",
|
|
56
|
+
"@operato/i18n": "^1.0.0-beta.40",
|
|
57
|
+
"@operato/input": "^1.0.0-beta.40",
|
|
58
|
+
"@operato/markdown": "^1.0.0-beta.40",
|
|
59
|
+
"@operato/popup": "^1.0.0-beta.40",
|
|
60
|
+
"@operato/property-editor": "^1.0.0-beta.40",
|
|
61
|
+
"@operato/styles": "^1.0.0-beta.40",
|
|
62
|
+
"@operato/utils": "^1.0.0-beta.40",
|
|
63
63
|
"@polymer/paper-dropdown-menu": "^3.2.0",
|
|
64
64
|
"@types/file-saver": "^2.0.4",
|
|
65
65
|
"@types/sortablejs": "^1.10.7",
|
|
66
|
+
"dexie": "^3.2.2",
|
|
66
67
|
"file-saver": "^2.0.5",
|
|
67
68
|
"lit": "^2.2.1",
|
|
68
69
|
"lodash-es": "^4.17.21",
|
|
@@ -71,7 +72,7 @@
|
|
|
71
72
|
"devDependencies": {
|
|
72
73
|
"@custom-elements-manifest/analyzer": "^0.4.17",
|
|
73
74
|
"@hatiolab/prettier-config": "^1.0.0",
|
|
74
|
-
"@hatiolab/things-scene": "^
|
|
75
|
+
"@hatiolab/things-scene": "^3.0.16",
|
|
75
76
|
"@material/mwc-fab": "^0.25.3",
|
|
76
77
|
"@material/mwc-icon": "^0.25.3",
|
|
77
78
|
"@open-wc/eslint-config": "^4.3.0",
|
|
@@ -83,12 +84,12 @@
|
|
|
83
84
|
"@typescript-eslint/eslint-plugin": "^4.33.0",
|
|
84
85
|
"@typescript-eslint/parser": "^4.33.0",
|
|
85
86
|
"@web/dev-server": "^0.1.29",
|
|
86
|
-
"@web/dev-server-storybook": "
|
|
87
|
+
"@web/dev-server-storybook": "^0.5.0",
|
|
87
88
|
"@web/test-runner": "next",
|
|
88
89
|
"concurrently": "^5.3.0",
|
|
89
90
|
"eslint": "^7.32.0",
|
|
90
91
|
"eslint-config-prettier": "^8.3.0",
|
|
91
|
-
"husky": "^
|
|
92
|
+
"husky": "^7.0.2",
|
|
92
93
|
"lint-staged": "^10.5.4",
|
|
93
94
|
"prettier": "^2.4.1",
|
|
94
95
|
"tslib": "^2.3.1",
|
|
@@ -107,5 +108,5 @@
|
|
|
107
108
|
"prettier --write"
|
|
108
109
|
]
|
|
109
110
|
},
|
|
110
|
-
"gitHead": "
|
|
111
|
+
"gitHead": "6f51f0b86e909ea850e6f185f737930daaec509e"
|
|
111
112
|
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import Dexie from 'dexie'
|
|
2
|
+
|
|
3
|
+
import { Component, PersistentDataStorage } from '@hatiolab/things-scene'
|
|
4
|
+
|
|
5
|
+
class BoardDatabase extends Dexie {
|
|
6
|
+
board_data!: Dexie.Table<IBoardData, number> // number = type of the primkey
|
|
7
|
+
//...other tables goes here...
|
|
8
|
+
|
|
9
|
+
constructor() {
|
|
10
|
+
super('operato-board-database')
|
|
11
|
+
this.version(1).stores({
|
|
12
|
+
board_data: '[board+refid]'
|
|
13
|
+
//...other tables goes here...
|
|
14
|
+
})
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
interface IBoardData {
|
|
19
|
+
id?: number
|
|
20
|
+
board: string
|
|
21
|
+
refid: string | number
|
|
22
|
+
data: any
|
|
23
|
+
timestamp: number
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const db = new BoardDatabase()
|
|
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.board_data.where({ board: 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.board_data.put({ board: this.id, refid: key.state.refid, data: value, timestamp: Date.now() })
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
public async clear(key: Component): Promise<void> {
|
|
45
|
+
await db.board_data.where({ board: this.id, refid: key.state.refid }).delete()
|
|
46
|
+
}
|
|
47
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
export * from './types'
|
|
1
|
+
export * from './types.js'
|
|
2
2
|
|
|
3
|
-
export { registerDefaultGroups } from './component/register-default-groups'
|
|
3
|
+
export { registerDefaultGroups } from './component/register-default-groups.js'
|
|
4
|
+
export { DataStorage } from './data-storage/data-storage.js'
|
|
4
5
|
|
|
5
|
-
export * from './ox-board-viewer'
|
|
6
|
-
export * from './ox-board-player'
|
|
7
|
-
export * from './ox-board-modeller'
|
|
8
|
-
export * from './ox-board-list'
|
|
6
|
+
export * from './ox-board-viewer.js'
|
|
7
|
+
export * from './ox-board-player.js'
|
|
8
|
+
export * from './ox-board-modeller.js'
|
|
9
|
+
export * from './ox-board-list.js'
|
|
@@ -4,14 +4,13 @@
|
|
|
4
4
|
|
|
5
5
|
import './component-detail'
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { LitElement, PropertyValues, css, html } from 'lit'
|
|
8
|
+
import { Pallet, PalletItem } from '../../types'
|
|
8
9
|
import { customElement, property, query, state } from 'lit/decorators.js'
|
|
9
10
|
|
|
10
11
|
import { Scene } from '@hatiolab/things-scene'
|
|
11
12
|
import { ScrollbarStyles } from '@operato/styles'
|
|
12
13
|
|
|
13
|
-
import { Pallet, PalletItem } from '../../types'
|
|
14
|
-
|
|
15
14
|
const noImage = new URL('../../../../icons/components/no-image.png', import.meta.url).href
|
|
16
15
|
|
|
17
16
|
@customElement('component-menu')
|
|
@@ -177,7 +176,7 @@ class ComponentMenu extends LitElement {
|
|
|
177
176
|
|
|
178
177
|
if (this.scene) {
|
|
179
178
|
this.template = this.templates.find(template => template.type == type)
|
|
180
|
-
this.template && this.scene.
|
|
179
|
+
this.template && this.scene.startAddMode(JSON.parse(JSON.stringify(this.template.model)))
|
|
181
180
|
}
|
|
182
181
|
|
|
183
182
|
this.group = null
|
|
@@ -98,7 +98,7 @@ class ComponentToolbar extends LitElement {
|
|
|
98
98
|
|
|
99
99
|
render() {
|
|
100
100
|
const componentList = this.componentGroupList || []
|
|
101
|
-
const modeIcon = this.icons[this.mode === SCENE_MODE.
|
|
101
|
+
const modeIcon = this.icons[this.mode === SCENE_MODE.SHIFT ? 'mode-shift' : 'mode-edit']
|
|
102
102
|
|
|
103
103
|
return html`
|
|
104
104
|
<img id="shift" .src=${modeIcon} @click=${(e: MouseEvent) => this._onClickShift(e)} />
|
|
@@ -6,7 +6,7 @@ import { html, LitElement, PropertyValues } from 'lit'
|
|
|
6
6
|
import { customElement, property, query, queryAll } from 'lit/decorators.js'
|
|
7
7
|
|
|
8
8
|
import { Component, Scene } from '@hatiolab/things-scene'
|
|
9
|
-
import { isMacOS } from '@operato/utils'
|
|
9
|
+
import { copyToClipboard, isMacOS } from '@operato/utils'
|
|
10
10
|
|
|
11
11
|
import { style } from './edit-toolbar-style'
|
|
12
12
|
|
|
@@ -461,12 +461,12 @@ export class EditToolbar extends LitElement {
|
|
|
461
461
|
this.scene?.cut()
|
|
462
462
|
}
|
|
463
463
|
|
|
464
|
-
onTapCopy() {
|
|
464
|
+
async onTapCopy() {
|
|
465
465
|
var copied = this.scene?.copy()
|
|
466
466
|
|
|
467
467
|
if (!copied) return
|
|
468
468
|
|
|
469
|
-
|
|
469
|
+
await copyToClipboard(copied)
|
|
470
470
|
this.cliped = copied
|
|
471
471
|
}
|
|
472
472
|
|
|
@@ -8,10 +8,9 @@ import '@operato/input/ox-buttons-radio.js'
|
|
|
8
8
|
import '@operato/input/ox-input-code.js'
|
|
9
9
|
import '@operato/i18n/ox-i18n.js'
|
|
10
10
|
|
|
11
|
-
import {
|
|
12
|
-
import { customElement, property, query, state } from 'lit/decorators.js'
|
|
13
|
-
|
|
11
|
+
import { LitElement, PropertyValues, css, html } from 'lit'
|
|
14
12
|
import { Properties, Scene } from '@hatiolab/things-scene'
|
|
13
|
+
import { customElement, property, query, state } from 'lit/decorators.js'
|
|
15
14
|
|
|
16
15
|
export type Rule =
|
|
17
16
|
| {
|
|
@@ -27,6 +26,7 @@ export type Mapping = {
|
|
|
27
26
|
target?: string
|
|
28
27
|
property?: string
|
|
29
28
|
param?: Rule
|
|
29
|
+
ndnsp?: boolean
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
/**
|
|
@@ -126,6 +126,26 @@ export default class DataBindingMapper extends LitElement {
|
|
|
126
126
|
height: 300px;
|
|
127
127
|
overflow: auto;
|
|
128
128
|
}
|
|
129
|
+
|
|
130
|
+
/* checkbox-row */
|
|
131
|
+
.checkbox-row {
|
|
132
|
+
grid-column: span 10;
|
|
133
|
+
|
|
134
|
+
display: grid;
|
|
135
|
+
grid-template-columns: repeat(10, 1fr);
|
|
136
|
+
grid-gap: 5px;
|
|
137
|
+
grid-auto-rows: minmax(24px, auto);
|
|
138
|
+
align-items: center;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.checkbox-row > input {
|
|
142
|
+
grid-column: 4 / 5;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.checkbox-row > label {
|
|
146
|
+
grid-column: span 6;
|
|
147
|
+
text-align: left;
|
|
148
|
+
}
|
|
129
149
|
`
|
|
130
150
|
]
|
|
131
151
|
|
|
@@ -228,7 +248,7 @@ export default class DataBindingMapper extends LitElement {
|
|
|
228
248
|
<div data-value="eval"><ox-i18n msgid="label.eval"></ox-i18n></div>
|
|
229
249
|
</ox-buttons-radio>
|
|
230
250
|
|
|
231
|
-
<div rule-editors
|
|
251
|
+
<div rule-editors ?hidden=${mapping.rule == 'value'}>
|
|
232
252
|
<ox-input-value-map
|
|
233
253
|
value-key="map"
|
|
234
254
|
.value=${this.rule.map || {}}
|
|
@@ -253,6 +273,11 @@ export default class DataBindingMapper extends LitElement {
|
|
|
253
273
|
>
|
|
254
274
|
</ox-input-code>
|
|
255
275
|
</div>
|
|
276
|
+
|
|
277
|
+
<div class="checkbox-row">
|
|
278
|
+
<input id="checkbox-ndnsp" type="checkbox" value-key="ndnsp" .checked=${mapping.ndnsp === true} />
|
|
279
|
+
<label for="checkbox-ndnsp"> <ox-i18n msgid="label.ndnsp">No Data No Spreading</ox-i18n> </label>
|
|
280
|
+
</div>
|
|
256
281
|
`
|
|
257
282
|
}
|
|
258
283
|
|
|
@@ -332,9 +357,9 @@ export default class DataBindingMapper extends LitElement {
|
|
|
332
357
|
|
|
333
358
|
if (!key) return
|
|
334
359
|
|
|
335
|
-
var value = element.value
|
|
360
|
+
var value: string | boolean = element.value
|
|
336
361
|
|
|
337
|
-
if (key
|
|
362
|
+
if (key === 'target') {
|
|
338
363
|
if (value.length > 0 && !/^[.#(\[]/.test(value)) {
|
|
339
364
|
value = '#' + value.trim()
|
|
340
365
|
|
|
@@ -345,25 +370,34 @@ export default class DataBindingMapper extends LitElement {
|
|
|
345
370
|
...this.mapping,
|
|
346
371
|
target: value
|
|
347
372
|
}
|
|
348
|
-
} else if (key
|
|
373
|
+
} else if (key === 'accessor') {
|
|
349
374
|
this.mapping = {
|
|
350
375
|
...this.mapping,
|
|
351
376
|
accessor: (value || '').trim()
|
|
352
377
|
}
|
|
353
|
-
} else if (key
|
|
378
|
+
} else if (key === 'property') {
|
|
354
379
|
this.mapping = {
|
|
355
380
|
...this.mapping,
|
|
356
381
|
property: (value || '').trim()
|
|
357
382
|
}
|
|
358
|
-
} else if (key
|
|
383
|
+
} else if (key === 'map' || key === 'range' || key === 'eval') {
|
|
359
384
|
this.rule[key] = value
|
|
360
385
|
this.mapping = {
|
|
361
386
|
...this.mapping,
|
|
362
387
|
param: value
|
|
363
388
|
}
|
|
389
|
+
} else if (key === 'ndnsp' /* no data no spreading */) {
|
|
390
|
+
value = element.checked
|
|
391
|
+
|
|
392
|
+
this.mapping = {
|
|
393
|
+
...this.mapping,
|
|
394
|
+
ndnsp: value
|
|
395
|
+
}
|
|
364
396
|
}
|
|
365
397
|
|
|
366
|
-
if (!this.mapping.rule)
|
|
398
|
+
if (!this.mapping.rule) {
|
|
399
|
+
this.mapping.rule = 'value'
|
|
400
|
+
}
|
|
367
401
|
|
|
368
402
|
this._keep_saved_rule_params = true
|
|
369
403
|
this.dispatchEvent(
|
|
@@ -9,10 +9,11 @@ import '@operato/input/ox-buttons-radio.js'
|
|
|
9
9
|
import '@operato/input/ox-input-data.js'
|
|
10
10
|
import '@operato/i18n/ox-i18n.js'
|
|
11
11
|
|
|
12
|
-
import {
|
|
13
|
-
import { PropertyValues, css, html } from 'lit'
|
|
12
|
+
import { css, html, PropertyValues } from 'lit'
|
|
14
13
|
import { customElement, property, query, state } from 'lit/decorators.js'
|
|
15
14
|
|
|
15
|
+
import { Properties, Scene } from '@hatiolab/things-scene'
|
|
16
|
+
|
|
16
17
|
import { AbstractProperty } from '../abstract-property'
|
|
17
18
|
import { PropertySharedStyle } from '../property-shared-style'
|
|
18
19
|
|
|
@@ -229,6 +230,13 @@ class PropertyDataBinding extends AbstractProperty {
|
|
|
229
230
|
<ox-i18n msgid="label.intent-sensitive">Intent Sensitive</ox-i18n>
|
|
230
231
|
</label>
|
|
231
232
|
</div>
|
|
233
|
+
|
|
234
|
+
<div class="checkbox-row">
|
|
235
|
+
<input id="checkbox-persistent" type="checkbox" value-key="persistent" .checked=${value.persistent} />
|
|
236
|
+
<label for="checkbox-persistent">
|
|
237
|
+
<ox-i18n msgid="label.persistent-data">Persistent Data</ox-i18n>
|
|
238
|
+
</label>
|
|
239
|
+
</div>
|
|
232
240
|
</div>
|
|
233
241
|
</fieldset>
|
|
234
242
|
|
|
@@ -295,8 +295,11 @@ export default class SceneInspector extends LitElement {
|
|
|
295
295
|
return html``
|
|
296
296
|
}
|
|
297
297
|
|
|
298
|
-
|
|
299
|
-
|
|
298
|
+
const children = (component.isContainer() && (component as Container).components) || []
|
|
299
|
+
const extended = this.isExtended(component) ? children : []
|
|
300
|
+
const { type, id, tag, class: clazz } = component.state
|
|
301
|
+
|
|
302
|
+
const name = (id ? `#${id}` : '') + (tag ? `@${tag}` : '') + (clazz ? `.(${clazz})` : '')
|
|
300
303
|
|
|
301
304
|
return html`
|
|
302
305
|
<div
|
|
@@ -315,8 +318,8 @@ export default class SceneInspector extends LitElement {
|
|
|
315
318
|
|
|
316
319
|
<span class=${this.getNodeHandleClass(component)}> </span>
|
|
317
320
|
|
|
318
|
-
<span class="type">${depth == 0 ? 'ROOT' :
|
|
319
|
-
? html` <span class="name"
|
|
321
|
+
<span class="type">${depth == 0 ? 'ROOT' : type}</span> ${name
|
|
322
|
+
? html` <span class="name">${name}</span> `
|
|
320
323
|
: html``}
|
|
321
324
|
</span>
|
|
322
325
|
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import '@polymer/paper-dropdown-menu/paper-dropdown-menu'
|
|
6
6
|
import '@operato/help/ox-title-with-help.js'
|
|
7
7
|
import '@operato/input/ox-input-color.js'
|
|
8
|
+
import '@operato/input/ox-input-range.js'
|
|
8
9
|
import '@operato/app/input/ox-input-fill-style.js'
|
|
9
10
|
import '@operato/font/ox-font-selector.js'
|
|
10
11
|
import '@operato/i18n/ox-i18n.js'
|
|
@@ -21,7 +22,7 @@ class PropertyStyles extends AbstractProperty {
|
|
|
21
22
|
static styles = [
|
|
22
23
|
PropertySharedStyle,
|
|
23
24
|
css`
|
|
24
|
-
|
|
25
|
+
ox-input-range {
|
|
25
26
|
width: 100%;
|
|
26
27
|
}
|
|
27
28
|
|
|
@@ -334,7 +335,7 @@ class PropertyStyles extends AbstractProperty {
|
|
|
334
335
|
|
|
335
336
|
render() {
|
|
336
337
|
var {
|
|
337
|
-
alpha,
|
|
338
|
+
alpha = 1,
|
|
338
339
|
fontFamily,
|
|
339
340
|
fontSize,
|
|
340
341
|
lineHeight,
|
|
@@ -351,14 +352,14 @@ class PropertyStyles extends AbstractProperty {
|
|
|
351
352
|
beginSize,
|
|
352
353
|
end,
|
|
353
354
|
endSize
|
|
354
|
-
} = this.value
|
|
355
|
+
} = this.value || {}
|
|
355
356
|
|
|
356
357
|
return html`
|
|
357
358
|
<fieldset>
|
|
358
359
|
<legend>
|
|
359
360
|
<ox-title-with-help topic="board-modeller/styles/opacity" msgid="label.opacity">opacity</ox-title-with-help>
|
|
360
361
|
</legend>
|
|
361
|
-
<
|
|
362
|
+
<ox-input-range min="0" max="1" step="0.1" value-key="alpha" .value=${alpha} editable> </ox-input-range>
|
|
362
363
|
</fieldset>
|
|
363
364
|
|
|
364
365
|
<fieldset>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { css, html, LitElement, PropertyValues } from 'lit'
|
|
2
2
|
import { customElement, property } from 'lit/decorators.js'
|
|
3
3
|
|
|
4
4
|
import { Scene } from '@hatiolab/things-scene'
|
|
@@ -70,7 +70,7 @@ class OxScenePlayer extends LitElement {
|
|
|
70
70
|
_releaseRef() {
|
|
71
71
|
if (this.scene) {
|
|
72
72
|
this.scene.target = null
|
|
73
|
-
this.scene.release()
|
|
73
|
+
this.scene.release && this.scene.release()
|
|
74
74
|
delete this.scene
|
|
75
75
|
}
|
|
76
76
|
}
|
|
@@ -2,10 +2,11 @@ import './confidential-overlay'
|
|
|
2
2
|
import './ox-scene-layer'
|
|
3
3
|
import './ox-scene-handler'
|
|
4
4
|
|
|
5
|
-
import {
|
|
6
|
-
import { LitElement, PropertyValues, css, html } from 'lit'
|
|
5
|
+
import { css, html, LitElement, PropertyValues } from 'lit'
|
|
7
6
|
import { customElement, property } from 'lit/decorators.js'
|
|
8
7
|
|
|
8
|
+
import { Component, create as createScene, FITMODE, Model, Properties, Scene, SCENE_MODE } from '@hatiolab/things-scene'
|
|
9
|
+
|
|
9
10
|
import OxSceneLayer from './ox-scene-layer'
|
|
10
11
|
|
|
11
12
|
@customElement('ox-scene-viewer')
|
|
@@ -114,7 +115,7 @@ export default class OxSceneViewer extends LitElement {
|
|
|
114
115
|
this.scene.off('mode', this._onSceneModeChanged, this)
|
|
115
116
|
|
|
116
117
|
if (this.provider) {
|
|
117
|
-
this.scene.release()
|
|
118
|
+
this.scene.release && this.scene.release()
|
|
118
119
|
} else {
|
|
119
120
|
this.scene.dispose()
|
|
120
121
|
}
|
|
@@ -233,6 +234,8 @@ export default class OxSceneViewer extends LitElement {
|
|
|
233
234
|
|
|
234
235
|
if (after === 2) {
|
|
235
236
|
this.style.cursor = 'all-scroll'
|
|
237
|
+
} else if (after === 3) {
|
|
238
|
+
this.style.cursor = 'crosshair'
|
|
236
239
|
} else {
|
|
237
240
|
this.style.cursor = 'default'
|
|
238
241
|
}
|
package/src/ox-board-list.ts
CHANGED
package/src/ox-board-modeller.ts
CHANGED
|
@@ -241,6 +241,7 @@ export class BoardModeller extends LitElement {
|
|
|
241
241
|
>
|
|
242
242
|
<ox-scene-layer type="selection-layer"></ox-scene-layer>
|
|
243
243
|
<ox-scene-layer type="modeling-layer"></ox-scene-layer>
|
|
244
|
+
<ox-scene-layer type="add-layer"> </ox-scene-layer>
|
|
244
245
|
<ox-scene-layer type="guide-layer">
|
|
245
246
|
<ox-scene-property name="ruler" value="disabled"></ox-scene-property>
|
|
246
247
|
</ox-scene-layer>
|
package/src/ox-board-viewer.ts
CHANGED
|
@@ -7,8 +7,9 @@ import { customElement, property, query, state } from 'lit/decorators.js'
|
|
|
7
7
|
import { Component, create, ReferenceProvider, SCENE_MODE } from '@hatiolab/things-scene'
|
|
8
8
|
import { isIOS, togglefullscreen } from '@operato/utils'
|
|
9
9
|
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
10
|
+
import { DataStorage } from './data-storage/data-storage.js'
|
|
11
|
+
import { DataSubscriptionProviderImpl } from './graphql/data-subscription.js'
|
|
12
|
+
import { runScenario, startScenario } from './graphql/scenario.js'
|
|
12
13
|
|
|
13
14
|
@customElement('ox-board-viewer')
|
|
14
15
|
export class BoardViewer extends LitElement {
|
|
@@ -229,6 +230,7 @@ export class BoardViewer extends LitElement {
|
|
|
229
230
|
},
|
|
230
231
|
mode: SCENE_MODE.VIEW,
|
|
231
232
|
refProvider: this.provider!,
|
|
233
|
+
dataStorage: this.board.id !== 'preview' ? new DataStorage(this.board.id) : undefined,
|
|
232
234
|
dataSubscriptionProvider: new DataSubscriptionProviderImpl()
|
|
233
235
|
})
|
|
234
236
|
|
|
@@ -246,16 +248,16 @@ export class BoardViewer extends LitElement {
|
|
|
246
248
|
this.unbindSceneEvents(this._scene)
|
|
247
249
|
|
|
248
250
|
this._scene.target = null
|
|
249
|
-
this._scene.release()
|
|
251
|
+
this._scene.release && this._scene.release()
|
|
250
252
|
|
|
251
253
|
this._scene = null
|
|
252
254
|
}
|
|
253
255
|
|
|
254
256
|
// delete queued scenes
|
|
255
|
-
this._forward.forEach(scene => scene.release())
|
|
257
|
+
this._forward.forEach(scene => scene.release && scene.release())
|
|
256
258
|
this._forward = []
|
|
257
259
|
|
|
258
|
-
this._backward.forEach(scene => scene.release())
|
|
260
|
+
this._backward.forEach(scene => scene.release && scene.release())
|
|
259
261
|
this._backward = []
|
|
260
262
|
}
|
|
261
263
|
|
|
@@ -289,7 +291,7 @@ export class BoardViewer extends LitElement {
|
|
|
289
291
|
var scene = await this.provider!.get(boardId, true)
|
|
290
292
|
|
|
291
293
|
if (scene === this._scene) {
|
|
292
|
-
scene.release()
|
|
294
|
+
scene.release && scene.release()
|
|
293
295
|
return
|
|
294
296
|
}
|
|
295
297
|
|
|
@@ -303,7 +305,7 @@ export class BoardViewer extends LitElement {
|
|
|
303
305
|
|
|
304
306
|
this._scene = scene
|
|
305
307
|
|
|
306
|
-
this._forward.forEach(scene => scene.release())
|
|
308
|
+
this._forward.forEach(scene => scene.release && scene.release())
|
|
307
309
|
|
|
308
310
|
/* forward를 비운다. */
|
|
309
311
|
this._forward = []
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { css, html, LitElement, PropertyValues } from 'lit'
|
|
2
2
|
import { customElement, property, query, state } from 'lit/decorators.js'
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -63,7 +63,7 @@ class BoardWrapper extends LitElement {
|
|
|
63
63
|
_releaseRef() {
|
|
64
64
|
if (this._scene) {
|
|
65
65
|
this._scene.target = null
|
|
66
|
-
this._scene.release()
|
|
66
|
+
this._scene.release && this._scene.release()
|
|
67
67
|
delete this._scene
|
|
68
68
|
}
|
|
69
69
|
}
|