@things-factory/board-ui 4.0.13 → 4.0.14

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 (37) hide show
  1. package/client/index.js +0 -2
  2. package/client/pages/board-modeller-page.js +6 -75
  3. package/client/pages/board-player-page.js +1 -1
  4. package/client/pages/board-viewer-page.js +1 -1
  5. package/package.json +9 -9
  6. package/assets/images/icon-properties-ipattern.png +0 -0
  7. package/client/board-modeller/board-modeller.js +0 -229
  8. package/client/board-modeller/component-toolbar/component-menu.js +0 -153
  9. package/client/board-modeller/component-toolbar/component-toolbar.js +0 -193
  10. package/client/board-modeller/edit-toolbar-style.js +0 -228
  11. package/client/board-modeller/edit-toolbar.js +0 -637
  12. package/client/board-modeller/property-sidebar/abstract-property.js +0 -73
  13. package/client/board-modeller/property-sidebar/data-binding/data-binding-mapper.js +0 -366
  14. package/client/board-modeller/property-sidebar/data-binding/data-binding.js +0 -476
  15. package/client/board-modeller/property-sidebar/effects/effects-shared-style.js +0 -58
  16. package/client/board-modeller/property-sidebar/effects/effects.js +0 -64
  17. package/client/board-modeller/property-sidebar/effects/property-animation.js +0 -141
  18. package/client/board-modeller/property-sidebar/effects/property-animations.js +0 -92
  19. package/client/board-modeller/property-sidebar/effects/property-event-hover.js +0 -144
  20. package/client/board-modeller/property-sidebar/effects/property-event-tap.js +0 -146
  21. package/client/board-modeller/property-sidebar/effects/property-event.js +0 -72
  22. package/client/board-modeller/property-sidebar/effects/property-shadow.js +0 -122
  23. package/client/board-modeller/property-sidebar/effects/value-converter.js +0 -26
  24. package/client/board-modeller/property-sidebar/inspector/inspector.js +0 -338
  25. package/client/board-modeller/property-sidebar/property-shared-style.js +0 -132
  26. package/client/board-modeller/property-sidebar/property-sidebar.js +0 -324
  27. package/client/board-modeller/property-sidebar/shapes/box-padding-editor-styles.js +0 -94
  28. package/client/board-modeller/property-sidebar/shapes/shapes.js +0 -421
  29. package/client/board-modeller/property-sidebar/specifics/specific-properties-builder.js +0 -149
  30. package/client/board-modeller/property-sidebar/specifics/specifics.js +0 -248
  31. package/client/board-modeller/property-sidebar/styles/styles.js +0 -591
  32. package/client/board-modeller/scene-viewer/confidential-overlay.js +0 -18
  33. package/client/board-modeller/scene-viewer/things-scene-handler.js +0 -50
  34. package/client/board-modeller/scene-viewer/things-scene-layer.js +0 -52
  35. package/client/board-modeller/scene-viewer/things-scene-player.js +0 -115
  36. package/client/board-modeller/scene-viewer/things-scene-property.js +0 -25
  37. package/client/board-modeller/scene-viewer/things-scene-viewer.js +0 -312
@@ -1,324 +0,0 @@
1
- /**
2
- * @license Copyright © HatioLab Inc. All rights reserved.
3
- */
4
-
5
- import { LitElement, html, css } from 'lit-element'
6
-
7
- import '@material/mwc-icon'
8
-
9
- import { deepClone } from '@things-factory/utils'
10
- import { ScrollbarStyles } from '@things-factory/styles'
11
-
12
- import './shapes/shapes'
13
- import './styles/styles'
14
- import './effects/effects'
15
- import './specifics/specifics'
16
- import './data-binding/data-binding'
17
- import './inspector/inspector'
18
-
19
- class PropertySidebar extends LitElement {
20
- constructor() {
21
- super()
22
-
23
- this.scene = null
24
- this.bounds = {}
25
- this.model = {}
26
- this.selected = []
27
- this.specificProps = []
28
- this.tabIndex = 'shape'
29
- this.collapsed = false
30
- this.fonts = []
31
- this.propertyEditor = []
32
- }
33
-
34
- static get properties() {
35
- return {
36
- scene: Object,
37
- bounds: Object,
38
- model: Object,
39
- selected: Array,
40
- specificProps: Array,
41
- tabIndex: String,
42
- collapsed: Boolean,
43
- fonts: Array,
44
- propertyEditor: Array
45
- }
46
- }
47
-
48
- static get styles() {
49
- return [
50
- ScrollbarStyles,
51
- css`
52
- :host {
53
- border-left: 1px solid var(--paper-blue-grey-100);
54
- width: 270px;
55
- display: flex;
56
- flex-direction: column;
57
- background-color: var(--property-sidebar-background-color);
58
- user-select: none;
59
- }
60
-
61
- [tab] {
62
- display: flex;
63
- background-color: rgba(0, 0, 0, 0.08);
64
- opacity: 0.85;
65
- }
66
-
67
- [tab] mwc-icon {
68
- flex: 1;
69
-
70
- display: flex;
71
- align-items: center;
72
- justify-content: center;
73
-
74
- color: var(--property-sidebar-tab-icon-color);
75
- height: 40px;
76
- }
77
-
78
- [tab] [selected] {
79
- background-color: var(--property-sidebar-background-color);
80
- border-left: 1px solid rgba(255, 255, 255, 0.5);
81
- border-right: 1px solid rgba(0, 0, 0, 0.15);
82
- opacity: 1;
83
- }
84
-
85
- [content] {
86
- flex: 1;
87
-
88
- overflow: hidden;
89
- overflow-y: auto;
90
- }
91
-
92
- [content] > :not([active]) {
93
- display: none;
94
- }
95
- `
96
- ]
97
- }
98
-
99
- propertyTarget = null
100
-
101
- firstUpdated() {
102
- this.shadowRoot.addEventListener('property-change', this._onPropertyChanged.bind(this))
103
- this.shadowRoot.addEventListener('bounds-change', this._onBoundsChanged.bind(this))
104
- }
105
-
106
- updated(change) {
107
- change.has('scene') && this._onSceneChanged(this.scene)
108
- change.has('selected') && this._onSelectedChanged(this.selected)
109
- change.has('collapsed') && this._onCollapsed(this.collapsed)
110
- }
111
-
112
- render() {
113
- var tabIndex = this.tabIndex ? this.tabIndex : 'shape'
114
-
115
- return html`
116
- <div
117
- tab
118
- @click=${e => {
119
- this.tabIndex = e.target.getAttribute('name')
120
- }}
121
- >
122
- <mwc-icon name="shape" ?selected=${tabIndex == 'shape'}>format_shapes</mwc-icon>
123
- <mwc-icon name="style" ?selected=${tabIndex == 'style'}>palette</mwc-icon>
124
- <mwc-icon name="effect" ?selected=${tabIndex == 'effect'}>movie_filter</mwc-icon>
125
- <mwc-icon name="specific" ?selected=${tabIndex == 'specific'}>tune</mwc-icon>
126
- <mwc-icon name="data-binding" ?selected=${tabIndex == 'data-binding'}>share</mwc-icon>
127
- <mwc-icon name="inspector" ?selected=${tabIndex == 'inspector'}>visibility</mwc-icon>
128
- </div>
129
-
130
- <div content>
131
- ${html`
132
- ${{
133
- shape: html`
134
- <property-shape
135
- .value=${this.model}
136
- .bounds=${this.bounds}
137
- .selected=${this.selected}
138
- ?active=${tabIndex == 'shape'}
139
- >
140
- </property-shape>
141
- `,
142
- style: html`
143
- <property-style
144
- .value=${this.model}
145
- .selected=${this.selected}
146
- .fonts=${this.fonts}
147
- ?active=${tabIndex == 'style'}
148
- >
149
- </property-style>
150
- `,
151
- effect: html`
152
- <property-effect .value=${this.model} .scene=${this.scene} ?active=${tabIndex == 'effect'}>
153
- </property-effect>
154
- `,
155
- specific: html`
156
- <property-specific
157
- .value=${this.model}
158
- .scene=${this.scene}
159
- .selected=${this.selected}
160
- .props=${this.specificProps}
161
- .propertyEditor=${this.propertyEditor}
162
- ?active=${tabIndex == 'specific'}
163
- >
164
- </property-specific>
165
- `,
166
- 'data-binding': html`
167
- <property-data-binding .scene=${this.scene} .value=${this.model} ?active=${tabIndex == 'data-binding'}>
168
- </property-data-binding>
169
- `,
170
- inspector: html`
171
- <scene-inspector .scene=${this.scene} ?active=${tabIndex == 'inspector'}></scene-inspector>
172
- `
173
- }[this.tabIndex]}
174
- `}
175
- </div>
176
- `
177
- }
178
-
179
- _onPropertyChanged(e) {
180
- var detail = e.detail
181
-
182
- if (this.propertyTarget) {
183
- /* 단일 컴포넌트의 경우에 적용 */
184
- this.scene && this.scene.undoableChange(() => this.propertyTarget.set(detail))
185
- } else {
186
- /* 여러 컴포넌트의 경우에 적용 */
187
- this.scene && this.scene.undoableChange(() => this.selected.forEach(component => component.set(detail)))
188
- }
189
- }
190
-
191
- _onBoundsChanged(e) {
192
- var detail = e.detail
193
-
194
- if (this.propertyTarget) {
195
- /* 단일 컴포넌트의 경우에 적용 */
196
- this.scene.undoableChange(() => {
197
- this.propertyTarget.bounds = {
198
- ...this.propertyTarget.bounds,
199
- ...detail
200
- }
201
- })
202
- } else {
203
- /* 여러 컴포넌트의 경우에 적용 */
204
- this.scene.undoableChange(() => {
205
- this.selected.forEach(component => {
206
- component.bounds = {
207
- ...component.bounds,
208
- ...detail
209
- }
210
- })
211
- })
212
- }
213
- }
214
-
215
- _onChangedByScene(after, before) {
216
- if (this.propertyTarget)
217
- this.model = {
218
- ...this.propertyTarget.model
219
- }
220
- }
221
-
222
- _setPropertyTargetAsDefault() {
223
- if (!this.scene) {
224
- this._setPropertyTarget(null)
225
- this.specificProps = []
226
- this.model = {}
227
- this.bounds = {}
228
- } else {
229
- this.scene.select('model-layer')
230
- }
231
- }
232
-
233
- _onCollapsed(collapsed) {
234
- !collapsed && (this.style.display = '')
235
-
236
- this.animate(
237
- collapsed
238
- ? [
239
- { transform: 'translateX(0)', opacity: 1, easing: 'ease-in' },
240
- { transform: 'translateX(100%)', opacity: 1 }
241
- ]
242
- : [
243
- { transform: 'translateX(100%)', opacity: 1 },
244
- { transform: 'translateX(0)', opacity: 1, easing: 'ease-out' }
245
- ],
246
- {
247
- duration: 500
248
- }
249
- ).onfinish = () => {
250
- collapsed && (this.style.display = 'none')
251
- dispatchEvent(new Event('resize'))
252
- }
253
- }
254
-
255
- async _onSceneChanged() {
256
- await this.renderComplete
257
-
258
- if (this.scene) this.selected = this.scene.select('model-layer')
259
- }
260
-
261
- async _onSelectedChanged(after, before) {
262
- await this.renderComplete
263
-
264
- if (after.length == 1) {
265
- this._setPropertyTarget(after[0])
266
- // 컴포넌트 특성 속성(specific properties)을 먼저 바꾸고, 모델을 바꾸어준다.
267
- // 컴포넌트 속성에 따라 UI 컴포넌트가 준비되고, 이후에 모델값을 보여주도록 하기 위해서이다.
268
- this.specificProps = deepClone(this.propertyTarget.nature.properties)
269
- this.model = {
270
- ...this.propertyTarget.model
271
- }
272
- this._setBounds(this.propertyTarget.bounds)
273
- } else if (after.length == 0) {
274
- // 선택이 안된 경우
275
-
276
- this._setPropertyTargetAsDefault()
277
- } else {
278
- // 다중 선택된 경우
279
-
280
- var type = after[0].model.type
281
- for (let i = 1; i < after.length; i++) {
282
- if (after[i].model.type != type) {
283
- type = undefined
284
- break
285
- }
286
- }
287
-
288
- this._setPropertyTarget(null)
289
-
290
- if (type) this.specificProps = deepClone(after[0].nature.properties)
291
- else this.specificProps = null
292
-
293
- this.model = {
294
- type: type,
295
- alpha: 1
296
- }
297
- this.bounds = {}
298
- }
299
- }
300
-
301
- _setPropertyTarget(newTarget) {
302
- var oldTarget = this.propertyTarget
303
-
304
- if (oldTarget) {
305
- oldTarget.off('change', this._onChangedByScene, this)
306
- }
307
- if (newTarget) {
308
- newTarget.on('change', this._onChangedByScene, this)
309
- }
310
-
311
- this.propertyTarget = newTarget
312
- }
313
-
314
- _setBounds(bounds) {
315
- this.bounds = {
316
- left: bounds.left,
317
- top: bounds.top,
318
- width: Math.round(bounds.width),
319
- height: Math.round(bounds.height)
320
- }
321
- }
322
- }
323
-
324
- customElements.define('property-sidebar', PropertySidebar)
@@ -1,94 +0,0 @@
1
- import { css } from 'lit-element'
2
-
3
- export const BoxPaddingEditorStyles = css`
4
- .box-padding {
5
- width: 100%;
6
- }
7
-
8
- .box-padding td {
9
- background: url(/assets/images/icon-properties-padding.png) 50% 0 no-repeat;
10
- }
11
-
12
- .box-padding tr:nth-child(1),
13
- .box-padding tr:nth-child(3) {
14
- height: 20px;
15
- }
16
-
17
- .box-padding tr td:nth-child(1),
18
- .box-padding tr td:nth-child(3) {
19
- width: 18px;
20
- }
21
-
22
- .box-padding .slide1 {
23
- background-position: 0 0;
24
- }
25
-
26
- .box-padding .slide2 {
27
- background-position: 50% -40px;
28
- background-color: rgba(69, 46, 41, 0.2);
29
- }
30
-
31
- .box-padding .slide3 {
32
- background-position: 100% -440px;
33
- }
34
-
35
- .box-padding .slide4 {
36
- background-position: 0 -360px;
37
- background-color: rgba(69, 46, 41, 0.2);
38
- }
39
-
40
- .box-padding .slide5 {
41
- background: none;
42
- text-align: center;
43
- }
44
-
45
- .box-padding .slide6 {
46
- background-position: 100% -160px;
47
- background-color: rgba(69, 46, 41, 0.2);
48
- }
49
-
50
- .box-padding .slide7 {
51
- background-position: 0 100%;
52
- }
53
-
54
- .box-padding .slide8 {
55
- background-position: 50% -320px;
56
- background-color: rgba(69, 46, 41, 0.2);
57
- }
58
-
59
- .box-padding .slide9 {
60
- background-position: 0 0px;
61
- }
62
-
63
- .box-padding input {
64
- background-color: transparent;
65
- width: 35px;
66
- margin: 0px;
67
- padding: 0px;
68
- clear: both;
69
- float: initial;
70
- border: 1px solid #fff;
71
- border-width: 0 0 1px 0;
72
- text-align: right;
73
- font-size: 14px;
74
- }
75
-
76
- .slide5 input:nth-child(1),
77
- .slide5 input:nth-child(4) {
78
- display: block;
79
- margin: auto;
80
- }
81
-
82
- .slide5 input:nth-child(2) {
83
- float: left;
84
- }
85
-
86
- .slide5 input:nth-child(3) {
87
- float: right;
88
- margin-top: -25px;
89
- }
90
-
91
- .slide5 input:nth-child(4) {
92
- margin-top: -5px;
93
- }
94
- `