@operato/board 1.0.0-alpha.9 → 1.0.0-beta.0
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 +376 -0
- package/dist/src/graphql/data-subscription.d.ts +7 -0
- package/dist/src/graphql/data-subscription.js +24 -0
- package/dist/src/graphql/data-subscription.js.map +1 -0
- package/dist/src/modeller/property-sidebar/abstract-property.js +0 -3
- package/dist/src/modeller/property-sidebar/abstract-property.js.map +1 -1
- package/dist/src/modeller/property-sidebar/data-binding/data-binding-mapper.d.ts +2 -2
- package/dist/src/modeller/property-sidebar/data-binding/data-binding-mapper.js +7 -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 +5 -2
- package/dist/src/modeller/property-sidebar/data-binding/data-binding.js.map +1 -1
- package/dist/src/modeller/property-sidebar/effects/property-shadow.d.ts +1 -1
- package/dist/src/modeller/property-sidebar/effects/property-shadow.js +1 -1
- package/dist/src/modeller/property-sidebar/effects/property-shadow.js.map +1 -1
- package/dist/src/modeller/property-sidebar/effects/value-converter.js +0 -2
- package/dist/src/modeller/property-sidebar/effects/value-converter.js.map +1 -1
- package/dist/src/modeller/property-sidebar/inspector/inspector.d.ts +1 -1
- package/dist/src/modeller/property-sidebar/specifics/specific-properties-builder.d.ts +1 -1
- package/dist/src/modeller/property-sidebar/specifics/specific-properties-builder.js +2 -2
- 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 -1
- package/dist/src/modeller/property-sidebar/styles/styles.js +3 -3
- package/dist/src/modeller/property-sidebar/styles/styles.js.map +1 -1
- package/dist/src/ox-board-modeller.d.ts +2 -2
- package/dist/src/ox-board-modeller.js +5 -5
- package/dist/src/ox-board-modeller.js.map +1 -1
- package/dist/src/ox-board-viewer.d.ts +3 -1
- package/dist/src/ox-board-viewer.js +16 -3
- package/dist/src/ox-board-viewer.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +15 -15
- package/src/graphql/data-subscription.ts +30 -0
- package/src/modeller/property-sidebar/abstract-property.ts +0 -4
- package/src/modeller/property-sidebar/data-binding/data-binding-mapper.ts +8 -9
- package/src/modeller/property-sidebar/data-binding/data-binding.ts +7 -5
- package/src/modeller/property-sidebar/effects/property-shadow.ts +1 -1
- package/src/modeller/property-sidebar/effects/value-converter.ts +0 -3
- package/src/modeller/property-sidebar/specifics/specific-properties-builder.ts +3 -3
- package/src/modeller/property-sidebar/styles/styles.ts +3 -3
- package/src/ox-board-modeller.ts +6 -7
- package/src/ox-board-viewer.ts +21 -7
- package/yarn-error.log +0 -16185
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@operato/board",
|
|
3
|
-
"version": "1.0.0-
|
|
3
|
+
"version": "1.0.0-beta.0",
|
|
4
4
|
"description": "Webcomponent for board following open-wc recommendations",
|
|
5
5
|
"author": "heartyoh",
|
|
6
6
|
"license": "MIT",
|
|
@@ -49,29 +49,29 @@
|
|
|
49
49
|
"storybook:build": "tsc && npm run analyze -- --exclude dist && build-storybook"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@operato/app": "^1.0.0-
|
|
53
|
-
"@operato/data-grist": "^1.0.0-
|
|
54
|
-
"@operato/
|
|
55
|
-
"@operato/
|
|
56
|
-
"@operato/
|
|
57
|
-
"@operato/
|
|
58
|
-
"@operato/
|
|
59
|
-
"@operato/
|
|
60
|
-
"@operato/
|
|
61
|
-
"@operato/
|
|
52
|
+
"@operato/app": "^1.0.0-beta.0",
|
|
53
|
+
"@operato/data-grist": "^1.0.0-beta.0",
|
|
54
|
+
"@operato/font": "^1.0.0-beta.0",
|
|
55
|
+
"@operato/graphql": "^1.0.0-beta.0",
|
|
56
|
+
"@operato/i18n": "^1.0.0-beta.0",
|
|
57
|
+
"@operato/input": "^1.0.0-beta.0",
|
|
58
|
+
"@operato/markdown": "^1.0.0-beta.0",
|
|
59
|
+
"@operato/popup": "^1.0.0-beta.0",
|
|
60
|
+
"@operato/property-editor": "^1.0.0-beta.0",
|
|
61
|
+
"@operato/styles": "^1.0.0-beta.0",
|
|
62
|
+
"@operato/utils": "^1.0.0-beta.0",
|
|
62
63
|
"@polymer/paper-dropdown-menu": "^3.2.0",
|
|
63
|
-
"@things-factory/modeller-ui": "^5.0.0-alpha.5",
|
|
64
64
|
"@types/file-saver": "^2.0.4",
|
|
65
65
|
"@types/sortablejs": "^1.10.7",
|
|
66
66
|
"file-saver": "^2.0.5",
|
|
67
|
-
"lit": "^2.2.
|
|
67
|
+
"lit": "^2.2.1",
|
|
68
68
|
"lodash-es": "^4.17.21",
|
|
69
69
|
"sortablejs": "^1.14.0"
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
|
72
72
|
"@custom-elements-manifest/analyzer": "^0.4.17",
|
|
73
73
|
"@hatiolab/prettier-config": "^1.0.0",
|
|
74
|
-
"@hatiolab/things-scene": "^2.
|
|
74
|
+
"@hatiolab/things-scene": "^2.8.1",
|
|
75
75
|
"@material/mwc-fab": "^0.25.3",
|
|
76
76
|
"@material/mwc-icon": "^0.25.3",
|
|
77
77
|
"@open-wc/eslint-config": "^4.3.0",
|
|
@@ -107,5 +107,5 @@
|
|
|
107
107
|
"prettier --write"
|
|
108
108
|
]
|
|
109
109
|
},
|
|
110
|
-
"gitHead": "
|
|
110
|
+
"gitHead": "06b7a224872643b4dfdd95efc83770ce96057bdf"
|
|
111
111
|
}
|
|
@@ -0,0 +1,30 @@
|
|
|
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
|
+
}
|
|
@@ -26,10 +26,6 @@ export class AbstractProperty extends LitElement {
|
|
|
26
26
|
var value
|
|
27
27
|
|
|
28
28
|
switch (element.tagName) {
|
|
29
|
-
case 'THINGS-EDITOR-ANGLE-INPUT':
|
|
30
|
-
value = Number((element as any).radian) || 0
|
|
31
|
-
break
|
|
32
|
-
|
|
33
29
|
case 'INPUT':
|
|
34
30
|
switch ((element as any).type) {
|
|
35
31
|
case 'checkbox':
|
|
@@ -2,16 +2,15 @@
|
|
|
2
2
|
* @license Copyright © HatioLab Inc. All rights reserved.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import '@
|
|
6
|
-
import '@
|
|
5
|
+
import '@operato/input/ox-input-value-map.js'
|
|
6
|
+
import '@operato/input/ox-input-value-ranges.js'
|
|
7
7
|
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
|
| {
|
|
@@ -220,21 +219,21 @@ export default class DataBindingMapper extends LitElement {
|
|
|
220
219
|
</ox-buttons-radio>
|
|
221
220
|
|
|
222
221
|
<div rule-editors class="content" ?hidden=${mapping.rule == 'value'}>
|
|
223
|
-
<
|
|
222
|
+
<ox-input-value-map
|
|
224
223
|
value-key="map"
|
|
225
224
|
.value=${this.rule.map || {}}
|
|
226
225
|
.valuetype=${this._valuetype(mapping.property!)}
|
|
227
226
|
?active=${mapping.rule == 'map'}
|
|
228
227
|
>
|
|
229
|
-
</
|
|
228
|
+
</ox-input-value-map>
|
|
230
229
|
|
|
231
|
-
<
|
|
230
|
+
<ox-input-value-ranges
|
|
232
231
|
value-key="range"
|
|
233
232
|
.value=${this.rule.range || []}
|
|
234
233
|
.valuetype=${this._valuetype(mapping.property!)}
|
|
235
234
|
?active=${mapping.rule == 'range'}
|
|
236
235
|
>
|
|
237
|
-
</
|
|
236
|
+
</ox-input-value-ranges>
|
|
238
237
|
|
|
239
238
|
<ox-input-code
|
|
240
239
|
value-key="eval"
|
|
@@ -9,10 +9,9 @@ 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 { css, html, PropertyValues } from 'lit'
|
|
13
|
-
import { customElement, property, query, state } from 'lit/decorators.js'
|
|
14
|
-
|
|
15
12
|
import { Properties, Scene } from '@hatiolab/things-scene'
|
|
13
|
+
import { PropertyValues, css, html } from 'lit'
|
|
14
|
+
import { customElement, property, query, state } from 'lit/decorators.js'
|
|
16
15
|
|
|
17
16
|
import { AbstractProperty } from '../abstract-property'
|
|
18
17
|
import { PropertySharedStyle } from '../property-shared-style'
|
|
@@ -213,6 +212,9 @@ class PropertyDataBinding extends AbstractProperty {
|
|
|
213
212
|
<label> <ox-i18n msgid="label.class">Class</ox-i18n> </label>
|
|
214
213
|
<input value-key="class" .value=${value.class || ''} />
|
|
215
214
|
|
|
215
|
+
<label> <ox-i18n msgid="label.tag">Tag</ox-i18n> </label>
|
|
216
|
+
<input value-key="tag" .value=${value.tag || ''} />
|
|
217
|
+
|
|
216
218
|
<label> <ox-i18n msgid="label.template-prefix">Template Prefix</ox-i18n> </label>
|
|
217
219
|
<input value-key="templatePrefix" .value=${value.templatePrefix || ''} />
|
|
218
220
|
|
|
@@ -370,8 +372,8 @@ class PropertyDataBinding extends AbstractProperty {
|
|
|
370
372
|
if (mapping && mapping.target) {
|
|
371
373
|
this.scene &&
|
|
372
374
|
this.scene.findAll(mapping.target, this.scene.selected && this.scene.selected[0]).forEach((c, i) => {
|
|
373
|
-
if (i == 0) c.trigger('
|
|
374
|
-
c.trigger('
|
|
375
|
+
if (i == 0) c.trigger('decotagreset')
|
|
376
|
+
c.trigger('decotag', {})
|
|
375
377
|
})
|
|
376
378
|
}
|
|
377
379
|
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
* @license Copyright © HatioLab Inc. All rights reserved.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import '@
|
|
5
|
+
import '@operato/app/property-editor.js' /* for registering property editors */
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { LitElement, PropertyValues, html } from 'lit'
|
|
8
8
|
import { customElement, property } from 'lit/decorators.js'
|
|
9
9
|
|
|
10
|
-
import { Properties } from '@hatiolab/things-scene'
|
|
11
10
|
import { OxPropertyEditor } from '@operato/property-editor'
|
|
11
|
+
import { Properties } from '@hatiolab/things-scene'
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
모든 에디터들은 change 이벤트를 지원해야 한다. 또한, 모든 에디터들은 value속성에 값을 가져야 한다.
|
|
@@ -6,7 +6,7 @@ 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
8
|
import '@operato/app/input/ox-input-fill-style.js'
|
|
9
|
-
import '@
|
|
9
|
+
import '@operato/font/ox-font-selector.js'
|
|
10
10
|
import '@operato/i18n/ox-i18n.js'
|
|
11
11
|
|
|
12
12
|
import { css, html } from 'lit'
|
|
@@ -373,12 +373,12 @@ class PropertyStyles extends AbstractProperty {
|
|
|
373
373
|
<ox-i18n msgid="label.font-family">Font Family</ox-i18n>
|
|
374
374
|
</label>
|
|
375
375
|
|
|
376
|
-
<
|
|
376
|
+
<ox-font-selector
|
|
377
377
|
value-key="fontFamily"
|
|
378
378
|
.value=${fontFamily}
|
|
379
379
|
class="property-full-input"
|
|
380
380
|
custom-editor
|
|
381
|
-
></
|
|
381
|
+
></ox-font-selector>
|
|
382
382
|
|
|
383
383
|
<label class="property-half-label icon-only-label font-size"></label>
|
|
384
384
|
<input type="number" value-key="fontSize" .value=${fontSize} class="property-half-input" />
|
package/src/ox-board-modeller.ts
CHANGED
|
@@ -6,16 +6,15 @@ import './modeller/edit-toolbar'
|
|
|
6
6
|
import '@hatiolab/things-scene'
|
|
7
7
|
import './ox-board-viewer'
|
|
8
8
|
|
|
9
|
-
import {
|
|
10
|
-
import { css, html
|
|
9
|
+
import { ComponentGroup, ComponentTemplate } from './types'
|
|
10
|
+
import { LitElement, css, html } from 'lit'
|
|
11
|
+
import { SCENE_MODE, Scene } from '@hatiolab/things-scene'
|
|
11
12
|
import { customElement, property, query } from 'lit/decorators.js'
|
|
12
|
-
|
|
13
|
-
import { Scene, SCENE_MODE } from '@hatiolab/things-scene'
|
|
14
|
-
import { OxPopup } from '@operato/popup'
|
|
15
13
|
import { isMacOS, togglefullscreen } from '@operato/utils'
|
|
16
14
|
|
|
17
15
|
import { EditToolbar } from './modeller/edit-toolbar'
|
|
18
|
-
import {
|
|
16
|
+
import { OxPopup } from '@operato/popup'
|
|
17
|
+
import { saveAs } from 'file-saver'
|
|
19
18
|
|
|
20
19
|
const MACOS = isMacOS()
|
|
21
20
|
|
|
@@ -256,7 +255,7 @@ export class BoardModeller extends LitElement {
|
|
|
256
255
|
<ox-scene-property name="paddingTop" value="50" type="number"></ox-scene-property>
|
|
257
256
|
<ox-scene-property name="paddingLeft" value="50" type="number"></ox-scene-property>
|
|
258
257
|
</ox-scene-layer>
|
|
259
|
-
<ox-scene-layer type="
|
|
258
|
+
<ox-scene-layer type="decotag-layer"></ox-scene-layer>
|
|
260
259
|
<ox-scene-handler type="text-editor"></ox-scene-handler>
|
|
261
260
|
<ox-scene-handler type="move-handler"></ox-scene-handler>
|
|
262
261
|
</ox-scene-viewer>
|
package/src/ox-board-viewer.ts
CHANGED
|
@@ -2,10 +2,12 @@ import '@material/mwc-fab'
|
|
|
2
2
|
import '@material/mwc-icon'
|
|
3
3
|
|
|
4
4
|
import { LitElement, PropertyValues, css, html } from 'lit'
|
|
5
|
-
import { SCENE_MODE, create } from '@hatiolab/things-scene'
|
|
5
|
+
import { ReferenceProvider, SCENE_MODE, create } from '@hatiolab/things-scene'
|
|
6
6
|
import { customElement, property, query, state } from 'lit/decorators.js'
|
|
7
7
|
import { isIOS, togglefullscreen } from '@operato/utils'
|
|
8
8
|
|
|
9
|
+
import { DataSubscriptionProviderImpl } from './graphql/data-subscription'
|
|
10
|
+
|
|
9
11
|
@customElement('ox-board-viewer')
|
|
10
12
|
export class BoardViewer extends LitElement {
|
|
11
13
|
static styles = css`
|
|
@@ -96,7 +98,7 @@ export class BoardViewer extends LitElement {
|
|
|
96
98
|
|
|
97
99
|
@property({ type: String }) baseUrl: string = ''
|
|
98
100
|
@property({ type: Object }) board: any = {}
|
|
99
|
-
@property({ type: Object }) provider:
|
|
101
|
+
@property({ type: Object }) provider: ReferenceProvider | null = null
|
|
100
102
|
@property({ type: Object }) data: any
|
|
101
103
|
|
|
102
104
|
@property({ type: Boolean, reflect: true, attribute: 'hide-fullscreen' }) hideFullscreen = false
|
|
@@ -196,7 +198,11 @@ export class BoardViewer extends LitElement {
|
|
|
196
198
|
this.closeScene()
|
|
197
199
|
|
|
198
200
|
if (this.board && this.board.id) {
|
|
199
|
-
this.
|
|
201
|
+
if (this.board.model) {
|
|
202
|
+
this.initScene()
|
|
203
|
+
} else {
|
|
204
|
+
this.initSceneAsync()
|
|
205
|
+
}
|
|
200
206
|
}
|
|
201
207
|
}
|
|
202
208
|
|
|
@@ -205,6 +211,13 @@ export class BoardViewer extends LitElement {
|
|
|
205
211
|
}
|
|
206
212
|
}
|
|
207
213
|
|
|
214
|
+
async initSceneAsync() {
|
|
215
|
+
if (!this.board || !this.board.id) return
|
|
216
|
+
|
|
217
|
+
this._scene = await this.provider!.get(this.board.id, true)
|
|
218
|
+
this.setupScene(this._scene)
|
|
219
|
+
}
|
|
220
|
+
|
|
208
221
|
initScene() {
|
|
209
222
|
if (!this.board || !this.board.id) return
|
|
210
223
|
|
|
@@ -213,14 +226,15 @@ export class BoardViewer extends LitElement {
|
|
|
213
226
|
...this.board.model
|
|
214
227
|
},
|
|
215
228
|
mode: SCENE_MODE.VIEW,
|
|
216
|
-
refProvider: this.provider
|
|
229
|
+
refProvider: this.provider!,
|
|
230
|
+
dataSubscriptionProvider: new DataSubscriptionProviderImpl()
|
|
217
231
|
})
|
|
218
232
|
|
|
219
233
|
if (this.baseUrl) {
|
|
220
234
|
this._scene.baseUrl = this.baseUrl
|
|
221
235
|
}
|
|
222
236
|
|
|
223
|
-
this.provider
|
|
237
|
+
this.provider!.add(this.board.id, this._scene)
|
|
224
238
|
|
|
225
239
|
this.setupScene(this._scene)
|
|
226
240
|
}
|
|
@@ -254,7 +268,7 @@ export class BoardViewer extends LitElement {
|
|
|
254
268
|
/* scene의 기존 target을 보관한다. */
|
|
255
269
|
this._oldtarget = this._scene.target
|
|
256
270
|
|
|
257
|
-
this._scene.fit(this.
|
|
271
|
+
this._scene.fit(this._scene.fitMode)
|
|
258
272
|
this._scene.target = this._target
|
|
259
273
|
|
|
260
274
|
if (this.data) {
|
|
@@ -270,7 +284,7 @@ export class BoardViewer extends LitElement {
|
|
|
270
284
|
if (!boardId) return
|
|
271
285
|
|
|
272
286
|
try {
|
|
273
|
-
var scene = await this.provider
|
|
287
|
+
var scene = await this.provider!.get(boardId, true)
|
|
274
288
|
|
|
275
289
|
if (scene === this._scene) {
|
|
276
290
|
scene.release()
|