@operato/board 1.0.0-beta.8 → 1.0.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.
- package/CHANGELOG.md +388 -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/graphql/data-subscription.d.ts +1 -3
- 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/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.d.ts +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 +2 -0
- package/dist/src/modeller/property-sidebar/property-sidebar.js.map +1 -1
- package/dist/src/modeller/property-sidebar/specifics/specific-properties-builder.js +15 -11
- package/dist/src/modeller/property-sidebar/specifics/specific-properties-builder.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 +3 -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-viewer.d.ts +1 -0
- package/dist/src/ox-board-viewer.js +13 -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 +20 -19
- package/src/data-storage/data-storage.ts +47 -0
- package/src/index.ts +7 -6
- 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 +2 -0
- package/src/modeller/property-sidebar/specifics/specific-properties-builder.ts +17 -12
- 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 +4 -3
- package/src/ox-board-list.ts +1 -1
- package/src/ox-board-viewer.ts +13 -7
- package/src/player/ox-board-wrapper.ts +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@operato/board",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Webcomponent for board following open-wc recommendations",
|
|
5
5
|
"author": "heartyoh",
|
|
6
6
|
"license": "MIT",
|
|
@@ -49,31 +49,32 @@
|
|
|
49
49
|
"storybook:build": "tsc && npm run analyze -- --exclude dist && build-storybook"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@operato/app": "^1.0.
|
|
53
|
-
"@operato/data-grist": "^1.0.
|
|
54
|
-
"@operato/font": "^1.0.
|
|
55
|
-
"@operato/graphql": "^1.0.0
|
|
56
|
-
"@operato/i18n": "^1.0.0
|
|
57
|
-
"@operato/input": "^1.0.
|
|
58
|
-
"@operato/markdown": "^1.0.0
|
|
59
|
-
"@operato/popup": "^1.0.0
|
|
60
|
-
"@operato/property-editor": "^1.0.
|
|
61
|
-
"@operato/styles": "^1.0.0
|
|
62
|
-
"@operato/utils": "^1.0.
|
|
52
|
+
"@operato/app": "^1.0.1",
|
|
53
|
+
"@operato/data-grist": "^1.0.1",
|
|
54
|
+
"@operato/font": "^1.0.1",
|
|
55
|
+
"@operato/graphql": "^1.0.0",
|
|
56
|
+
"@operato/i18n": "^1.0.0",
|
|
57
|
+
"@operato/input": "^1.0.1",
|
|
58
|
+
"@operato/markdown": "^1.0.0",
|
|
59
|
+
"@operato/popup": "^1.0.0",
|
|
60
|
+
"@operato/property-editor": "^1.0.1",
|
|
61
|
+
"@operato/styles": "^1.0.0",
|
|
62
|
+
"@operato/utils": "^1.0.1",
|
|
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
|
-
"lit": "^2.2.
|
|
68
|
+
"lit": "^2.2.7",
|
|
68
69
|
"lodash-es": "^4.17.21",
|
|
69
70
|
"sortablejs": "^1.14.0"
|
|
70
71
|
},
|
|
71
72
|
"devDependencies": {
|
|
72
73
|
"@custom-elements-manifest/analyzer": "^0.4.17",
|
|
73
74
|
"@hatiolab/prettier-config": "^1.0.0",
|
|
74
|
-
"@hatiolab/things-scene": "^3.0.
|
|
75
|
-
"@material/mwc-fab": "^0.
|
|
76
|
-
"@material/mwc-icon": "^0.
|
|
75
|
+
"@hatiolab/things-scene": "^3.0.19",
|
|
76
|
+
"@material/mwc-fab": "^0.26.1",
|
|
77
|
+
"@material/mwc-icon": "^0.26.1",
|
|
77
78
|
"@open-wc/eslint-config": "^4.3.0",
|
|
78
79
|
"@open-wc/testing": "^3.0.4",
|
|
79
80
|
"@rollup/plugin-image": "^2.1.1",
|
|
@@ -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": "4518c7ee134a20627d81d0a41e071e4b50cf173d"
|
|
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'
|
|
@@ -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
|
|
|
@@ -29,6 +29,8 @@ class PropertySidebar extends LitElement {
|
|
|
29
29
|
flex-direction: column;
|
|
30
30
|
background-color: var(--property-sidebar-background-color);
|
|
31
31
|
user-select: none;
|
|
32
|
+
--input-padding: var(--padding-narrow);
|
|
33
|
+
--label-font: var(--property-sidebar-fieldset-label);
|
|
32
34
|
}
|
|
33
35
|
|
|
34
36
|
[tab] {
|
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
|
|
5
5
|
import '@operato/app/property-editor.js' /* for registering property editors */
|
|
6
6
|
|
|
7
|
-
import { LitElement, PropertyValues
|
|
7
|
+
import { html, LitElement, PropertyValues } from 'lit'
|
|
8
8
|
import { customElement, property } from 'lit/decorators.js'
|
|
9
9
|
|
|
10
|
-
import { OxPropertyEditor } from '@operato/property-editor'
|
|
11
10
|
import { Properties } from '@hatiolab/things-scene'
|
|
11
|
+
import { OxPropertyEditor, PropertySpec } from '@operato/property-editor'
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
모든 에디터들은 change 이벤트를 지원해야 한다. 또한, 모든 에디터들은 value속성에 값을 가져야 한다.
|
|
@@ -78,23 +78,28 @@ class SpecificPropertiesBuilder extends LitElement {
|
|
|
78
78
|
|
|
79
79
|
_onPropsChanged(props: any[]) {
|
|
80
80
|
this.textContent = ''
|
|
81
|
-
;(props || []).forEach(
|
|
82
|
-
|
|
81
|
+
;(props || []).forEach((spec: PropertySpec) => {
|
|
82
|
+
const { label, type, placeholder, name, observe, property, editor, quantifier } = spec
|
|
83
|
+
|
|
84
|
+
let elementType = OxPropertyEditor.getEditor(type)
|
|
83
85
|
if (!elementType) {
|
|
84
|
-
console.warn('Property Editor not defined',
|
|
86
|
+
console.warn('Property Editor not defined', type)
|
|
85
87
|
return
|
|
86
88
|
}
|
|
87
89
|
let element = document.createElement(elementType) as OxPropertyEditor
|
|
88
90
|
|
|
89
|
-
element.label =
|
|
90
|
-
element.type =
|
|
91
|
-
element.placeholder =
|
|
92
|
-
element.
|
|
91
|
+
element.label = label
|
|
92
|
+
element.type = type
|
|
93
|
+
element.placeholder = placeholder
|
|
94
|
+
element.name = name
|
|
95
|
+
element.setAttribute('name', name)
|
|
93
96
|
|
|
94
|
-
if (
|
|
95
|
-
element.observe =
|
|
97
|
+
if (observe) {
|
|
98
|
+
element.observe = observe
|
|
96
99
|
}
|
|
97
|
-
element.property =
|
|
100
|
+
element.property = property
|
|
101
|
+
element.editor = editor
|
|
102
|
+
element.quantifier = quantifier
|
|
98
103
|
element.setAttribute('property-editor', 'true')
|
|
99
104
|
|
|
100
105
|
this.appendChild(element)
|
|
@@ -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
|
}
|
package/src/ox-board-list.ts
CHANGED
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 = []
|
|
@@ -473,6 +475,10 @@ export class BoardViewer extends LitElement {
|
|
|
473
475
|
}
|
|
474
476
|
}
|
|
475
477
|
|
|
478
|
+
getSceneData() {
|
|
479
|
+
return this._scene?.data
|
|
480
|
+
}
|
|
481
|
+
|
|
476
482
|
async getSceneImageData(base64 = false) {
|
|
477
483
|
if (!this._scene) {
|
|
478
484
|
return
|
|
@@ -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
|
}
|