@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,476 +0,0 @@
1
- /**
2
- * @license Copyright © HatioLab Inc. All rights reserved.
3
- */
4
-
5
- import '@things-factory/i18n-base'
6
- import { css, html } from 'lit-element'
7
- import { AbstractProperty } from '../abstract-property'
8
- import { PropertySharedStyle } from '../property-shared-style'
9
- import './data-binding-mapper'
10
- import '@material/mwc-icon'
11
- import '@things-factory/help'
12
-
13
- var clipboard = '{}'
14
-
15
- const PROPS = [
16
- '',
17
- 'text',
18
- ['fillStyle', 'fill style'],
19
- ['strokeStyle', 'stroke style'],
20
- ['fontColor', 'font color'],
21
- 'value',
22
- 'data',
23
- 'source',
24
- 'hidden',
25
- 'started',
26
- 'play',
27
- ['ref', 'reference'],
28
- 'options',
29
- 'rotate',
30
- 'scale',
31
- 'translate',
32
- 'dimension',
33
- 'location',
34
- 'accessor'
35
- ].map(prop => {
36
- return typeof prop == 'string' ? { name: prop, label: prop } : { name: prop[0], label: prop[1] }
37
- })
38
-
39
- class PropertyDataBinding extends AbstractProperty {
40
- static get is() {
41
- return 'property-data-binding'
42
- }
43
-
44
- static get properties() {
45
- return {
46
- scene: Object,
47
- value: Object,
48
- mappingIndex: Number,
49
- _afterRender: Function,
50
- _dataExpanded: Boolean
51
- }
52
- }
53
-
54
- static get styles() {
55
- return [
56
- PropertySharedStyle,
57
- css`
58
- #tab-header {
59
- display: flex;
60
- align-items: center;
61
- justify-content: space-between;
62
- }
63
-
64
- #tab-header > mwc-icon {
65
- padding: 0;
66
- margin: 0;
67
- width: 25px;
68
- height: 25px;
69
- font-size: x-large;
70
- border-bottom: 1px solid rgba(0, 0, 0, 0.2);
71
- }
72
-
73
- fieldset[collapsable] legend {
74
- box-sizing: border-box;
75
- width: 100%;
76
- }
77
-
78
- fieldset[collapsable] legend mwc-icon {
79
- float: right;
80
- font-size: medium;
81
- margin: 0;
82
- }
83
-
84
- fieldset[collapsable][collapsed] > :not(legend) {
85
- display: none;
86
- }
87
-
88
- paper-tabs {
89
- flex: 1;
90
- height: 25px;
91
- border: 1px solid rgba(0, 0, 0, 0.2);
92
- border-width: 1px 1px 0 1px;
93
- }
94
-
95
- paper-tab {
96
- background-color: rgba(0, 0, 0, 0.2);
97
- border: 1px solid rgba(0, 0, 0, 0.07);
98
- border-width: 0 1px 0 0;
99
- padding: 0 5px;
100
- color: #fff;
101
- font-size: 13px;
102
- max-width: 25px;
103
- min-width: 25px;
104
- }
105
-
106
- paper-tab[disabled] {
107
- background-color: rgba(0, 0, 0, 0.1);
108
- }
109
-
110
- paper-tab:last-child {
111
- border-width: 0;
112
- }
113
-
114
- paper-tab.iron-selected {
115
- background-color: rgba(255, 255, 255, 0.5);
116
- color: #585858;
117
- }
118
-
119
- [has-set]::before {
120
- content: '';
121
- position: relative;
122
- left: 3px;
123
- width: 5px;
124
- height: 5px;
125
- display: inline-block;
126
- border-radius: 50%;
127
- background-color: #4caf50;
128
- }
129
-
130
- div[binding] {
131
- display: flex;
132
- flex-direction: row-reverse;
133
- background-color: rgba(255, 255, 255, 0.5);
134
- overflow: hidden;
135
- border-style: solid;
136
- border-color: rgba(0, 0, 0, 0.2);
137
- border-image: initial;
138
- border-width: 0px 1px;
139
- padding: 7px 5px 2px 5px;
140
- }
141
- mwc-icon {
142
- margin-left: 5px;
143
- color: var(--secondary-color);
144
- opacity: 0.8;
145
- cursor: pointer;
146
- --mdc-icon-size: 18px;
147
- }
148
- mwc-icon:hover {
149
- color: var(--primary-color);
150
- opacity: 1;
151
- }
152
-
153
- data-binding-mapper {
154
- --things-select: {
155
- min-width: 50%;
156
- margin-bottom: 10px;
157
- padding: 3px 20px 2px 5px;
158
- -webkit-border-radius: 4px;
159
- -moz-border-radius: 4px;
160
- border-radius: 4px;
161
- border: 1px solid rgba(0, 0, 0, 0.15);
162
- font-size: 15px;
163
- font-weight: 300;
164
- -webkit-appearance: none;
165
- }
166
- }
167
- `
168
- ]
169
- }
170
-
171
- constructor() {
172
- super()
173
- this.scene = null
174
- this.value = {
175
- mappings: []
176
- }
177
- this.mapping = {}
178
- this.mappingIndex = 0
179
- }
180
-
181
- get mappings() {
182
- return this.value.mappings || []
183
- }
184
-
185
- firstUpdated() {
186
- this.renderRoot.addEventListener('change', this._onValueChange.bind(this))
187
-
188
- this.tabContainer.addEventListener('scroll', e => {
189
- this._onTabScroll(e)
190
- })
191
- }
192
-
193
- updated(change) {
194
- if (change.has('value')) {
195
- this._onValueChanged(this.value)
196
- }
197
- }
198
-
199
- render() {
200
- return html`
201
- <fieldset>
202
- <legend>
203
- <title-with-help topic="board-modeller/data-binding" msgid="label.identifier">identifier</title-with-help>
204
- </legend>
205
- <div class="property-grid">
206
- <label> <i18n-msg msgid="label.id">ID</i18n-msg> </label>
207
- <input value-key="id" .value=${this.value.id || ''} />
208
-
209
- <label> <i18n-msg msgid="label.class">Class</i18n-msg> </label>
210
- <input value-key="class" .value=${this.value.class || ''} />
211
-
212
- <label> <i18n-msg msgid="label.template-prefix">Template Prefix</i18n-msg> </label>
213
- <input value-key="templatePrefix" .value=${this.value.templatePrefix || ''} />
214
-
215
- <div class="checkbox-row">
216
- <input id="checkbox-ndns" type="checkbox" value-key="ndns" .checked=${this.value.ndns} />
217
- <label for="checkbox-ndns"> <i18n-msg msgid="label.ndns">No Data No Show</i18n-msg> </label>
218
- </div>
219
-
220
- <div class="checkbox-row">
221
- <input id="checkbox-sensitive" type="checkbox" value-key="sensitive" .checked=${this.value.sensitive} />
222
- <label for="checkbox-sensitive">
223
- <i18n-msg msgid="label.intent-sensitive">Intent Sensitive</i18n-msg>
224
- </label>
225
- </div>
226
- </div>
227
- </fieldset>
228
-
229
- <fieldset collapsable ?collapsed=${!this._dataExpanded}>
230
- <legend>
231
- <i18n-msg msgid="label.initial-data">initial value</i18n-msg>
232
- <mwc-icon
233
- @click=${e => {
234
- this._dataExpanded = !this._dataExpanded
235
- }}
236
- >${this._dataExpanded ? 'expand_less' : 'expand_more'}</mwc-icon
237
- >
238
- </legend>
239
- <things-editor-data value-key="data" .value=${this.value.data}> </things-editor-data>
240
- </fieldset>
241
-
242
- <fieldset>
243
- <legend><i18n-msg msgid="label.data-spread">Data Spread</i18n-msg></legend>
244
- <div id="tab-header">
245
- <mwc-icon
246
- id="tab-nav-left-button"
247
- @click=${e => {
248
- this._onTabScrollNavLeft(e)
249
- }}
250
- disabled
251
- >chevron_left</mwc-icon
252
- >
253
- <paper-tabs
254
- id="tabs"
255
- @iron-select=${e => this._setMappingIndex(e.target.selected)}
256
- .selected=${this.mappingIndex}
257
- noink
258
- no-bar
259
- scrollable
260
- hide-scroll-buttons
261
- fit-container
262
- >
263
- ${this.mappings.map((m, i) => html` <paper-tab data-mapping="${i + 1}">${i + 1}</paper-tab> `)}
264
- <paper-tab data-mapping="${this.mappings.length + 1}">${this.mappings.length + 1}</paper-tab>
265
- </paper-tabs>
266
- <mwc-icon
267
- id="tab-nav-right-button"
268
- @click=${e => {
269
- this._onTabScrollNavRight(e)
270
- }}
271
- disabled
272
- >chevron_right</mwc-icon
273
- >
274
- </div>
275
-
276
- <div binding>
277
- <mwc-icon style="font-size:19px" @click=${e => this._clearDataBindingMapper()} title="delete"
278
- >delete_forever</mwc-icon
279
- >
280
- <mwc-icon @click=${e => this._pasteDataBindingMapper()} title="past">content_paste</mwc-icon>
281
- <mwc-icon style="font-size:17px" @click=${e => this._copyDataBindingMapper()} title="copy"
282
- >content_copy</mwc-icon
283
- >
284
- </div>
285
-
286
- <data-binding-mapper
287
- @value-change=${e => this._onMappingChanged(e)}
288
- .scene=${this.scene}
289
- .mapping=${(this.value.mappings && this.value.mappings[this.mappingIndex]) || {}}
290
- .properties=${PROPS}
291
- >
292
- </data-binding-mapper>
293
- </fieldset>
294
- `
295
- }
296
-
297
- /**
298
- * mappings 편집의 변화에 반응하여 mapping 탭의 active 여부를 갱신한다.
299
- */
300
- _resetMappingTabs() {
301
- var last = -1
302
- var mappings = this.value.mappings || []
303
-
304
- Array.from(this.renderRoot.querySelectorAll('paper-tab[data-mapping]')).map((tab, i) => {
305
- if (mappings[i]) {
306
- tab.active = true
307
- tab.setAttribute('has-set', true)
308
-
309
- last = i
310
- } else {
311
- tab.active = false
312
- tab.removeAttribute('has-set')
313
- }
314
- })
315
-
316
- this._onTabScroll()
317
- }
318
-
319
- _setMappingIndex(idx) {
320
- this.mappingIndex = isNaN(Number(idx)) ? 0 : Number(idx)
321
-
322
- this._resetMappingTabs()
323
- }
324
-
325
- _clearDataBindingMapper() {
326
- var mappings = [...(this.value.mappings || [])]
327
- mappings.splice(this.mappingIndex, 1)
328
- this._onAfterValueChange(
329
- 'mappings',
330
- mappings.filter(m => !!m)
331
- )
332
- }
333
-
334
- _copyDataBindingMapper() {
335
- clipboard = JSON.stringify(this.mappings[this.mappingIndex])
336
- }
337
-
338
- async _pasteDataBindingMapper() {
339
- var index = this.mappingIndex
340
- var mappings = [...(this.value.mappings || [])]
341
- mappings[this.mappingIndex] = JSON.parse(clipboard)
342
-
343
- this._onAfterValueChange('mappings', mappings)
344
-
345
- setTimeout(() => {
346
- this._setMappingIndex(index)
347
- }, 100)
348
- }
349
-
350
- async _onValueChanged(value) {
351
- await this.renderComplete
352
-
353
- if (this._afterRender) {
354
- this._afterRender()
355
- } else {
356
- this._setMappingIndex(0)
357
- }
358
-
359
- this._afterRender = null
360
- }
361
-
362
- _onValueChange(e) {
363
- var element = e.target
364
- var key = element.getAttribute('value-key')
365
-
366
- var value = this._getValueFromEventTarget(element)
367
-
368
- if (!key) {
369
- return
370
- }
371
-
372
- this.value = {
373
- ...this.value,
374
- [key]: value
375
- }
376
-
377
- this._onAfterValueChange(key, value)
378
- }
379
-
380
- get tabContainer() {
381
- return this.renderRoot.querySelector('#tabs').shadowRoot.querySelector('#tabsContainer')
382
- }
383
-
384
- async _onMappingChanged(e) {
385
- var mapping = e.target.mapping
386
-
387
- /* data spread target의 변경이 있는 경우, target 컴포넌트들의 태그를 블링크 시킨다 */
388
- if (mapping && mapping.target) {
389
- this.scene &&
390
- this.scene.findAll(mapping.target, this.scene.selected && this.scene.selected[0]).forEach((c, i) => {
391
- if (i == 0) c.trigger('tagreset')
392
- c.trigger('tag', {})
393
- })
394
- }
395
-
396
- /* mapping의 모든 속성이 편집되면, 모델에 반영한다. */
397
- var mappings = [...(this.value.mappings || [])]
398
-
399
- if (mapping.target && mapping.property && mapping.rule) {
400
- mappings[this.mappingIndex] = mapping
401
-
402
- var mappingIdx = this.mappingIndex
403
- this._afterRender = () => {
404
- this._setMappingIndex(mappingIdx)
405
- this.tabContainer.scrollLeft = this.tabContainer.scrollWidth
406
- }
407
-
408
- this.dispatchEvent(
409
- new CustomEvent('property-change', {
410
- bubbles: true,
411
- composed: true,
412
- detail: {
413
- mappings: mappings.filter(m => !!m)
414
- }
415
- })
416
- )
417
-
418
- await this.requestUpdate()
419
- } else if (!mapping.target && !mapping.property) {
420
- // accessor를 입력중인 경우 tabIndex Change 방지
421
- if (e.detail && e.detail.changed && !e.detail.changed.accessor) {
422
- mappings[this.mappingIndex] = null
423
- var nextMappingIdx = Math.max(this.mappingIndex - 1, 0)
424
- this._afterRender = () => {
425
- this._setMappingIndex(nextMappingIdx)
426
- }
427
- this.dispatchEvent(
428
- new CustomEvent('property-change', {
429
- bubbles: true,
430
- composed: true,
431
- detail: {
432
- mappings: mappings.filter(m => !!m)
433
- }
434
- })
435
- )
436
- }
437
- }
438
- }
439
-
440
- _onTabScroll(e) {
441
- var tabNavLeftButton = this.renderRoot.querySelector('#tab-nav-left-button')
442
- var tabNavRightButton = this.renderRoot.querySelector('#tab-nav-right-button')
443
-
444
- if (this.tabContainer.clientWidth == this.tabContainer.scrollWidth) {
445
- tabNavLeftButton.disabled = true
446
- tabNavRightButton.disabled = true
447
- }
448
- // left-end
449
- else if (this.tabContainer.scrollLeft == 0) {
450
- tabNavLeftButton.disabled = true
451
- tabNavRightButton.disabled = false
452
- }
453
- // right-end
454
- else if (this.tabContainer.scrollLeft + this.tabContainer.clientWidth >= this.tabContainer.scrollWidth) {
455
- tabNavLeftButton.disabled = false
456
- tabNavRightButton.disabled = true
457
- } else {
458
- tabNavLeftButton.disabled = false
459
- tabNavRightButton.disabled = false
460
- }
461
- }
462
-
463
- _onTabScrollNavLeft(e) {
464
- this.tabContainer.style.scrollBehavior = 'smooth'
465
- this.tabContainer.scrollLeft -= this.tabContainer.clientWidth
466
- this.tabContainer.style.scrollBehavior = 'auto'
467
- }
468
-
469
- _onTabScrollNavRight(e) {
470
- this.tabContainer.style.scrollBehavior = 'smooth'
471
- this.tabContainer.scrollLeft += this.tabContainer.clientWidth
472
- this.tabContainer.style.scrollBehavior = 'auto'
473
- }
474
- }
475
-
476
- customElements.define('property-data-binding', PropertyDataBinding)
@@ -1,58 +0,0 @@
1
- /**
2
- * @license Copyright © HatioLab Inc. All rights reserved.
3
- */
4
-
5
- import { css } from 'lit-element'
6
-
7
- export const EffectsSharedStyle = css`
8
- :host {
9
- display: grid;
10
- grid-template-columns: repeat(10, 1fr);
11
- grid-gap: 5px;
12
- grid-auto-rows: minmax(24px, auto);
13
-
14
- align-items: center;
15
- }
16
-
17
- * {
18
- align-self: stretch;
19
- }
20
-
21
- label {
22
- grid-column: span 3;
23
- text-align: right;
24
- text-transform: capitalize;
25
-
26
- align-self: center;
27
- }
28
-
29
- input,
30
- select,
31
- things-editor-angle-input,
32
- things-editor-color,
33
- [custom-editor] {
34
- grid-column: span 7;
35
- }
36
-
37
- input,
38
- select,
39
- things-editor-angle-input input,
40
- things-editor-color input,
41
- [custom-editor] input {
42
- border: var(--property-sidebar-fieldset-border);
43
- }
44
-
45
- input[type='checkbox'] {
46
- grid-column: 4 / 5;
47
- align-self: center;
48
- }
49
-
50
- label.checkbox-label {
51
- grid-column: span 6;
52
- text-align: left;
53
- }
54
-
55
- [fullwidth] {
56
- grid-column: 1 / -1;
57
- }
58
- `
@@ -1,64 +0,0 @@
1
- /**
2
- * @license Copyright © HatioLab Inc. All rights reserved.
3
- */
4
-
5
- import '@things-factory/i18n-base'
6
- import { html } from 'lit-element'
7
- import { AbstractProperty } from '../abstract-property'
8
- import { PropertySharedStyle } from '../property-shared-style'
9
- import './property-animations'
10
- import './property-event'
11
- import './property-shadow'
12
-
13
- class PropertyEffects extends AbstractProperty {
14
- static get properties() {
15
- return {
16
- value: Object,
17
- scene: Object
18
- }
19
- }
20
-
21
- static get styles() {
22
- return [PropertySharedStyle]
23
- }
24
-
25
- constructor() {
26
- super()
27
-
28
- this.value = {}
29
- }
30
-
31
- firstUpdated() {
32
- this.renderRoot.addEventListener('change', this._onValueChange.bind(this))
33
- }
34
-
35
- render() {
36
- return html`
37
- <fieldset>
38
- <legend>
39
- <title-with-help topic="board-modeller/effects/shadow" msgid="label.shadow">shadow</title-with-help>
40
- </legend>
41
-
42
- <property-shadow value-key="shadow" .value=${this.value.shadow || {}}> </property-shadow>
43
- </fieldset>
44
-
45
- <fieldset>
46
- <legend>
47
- <title-with-help topic="board-modeller/effects/retention" msgid="label.retention">retention</title-with-help>
48
- </legend>
49
-
50
- <div class="property-grid">
51
- <label> <i18n-msg msgid="label.retention">retention</i18n-msg> </label>
52
- <input type="number" value-key="retention" .value=${this.value.retention} placeholder="ms" />
53
- </div>
54
- </fieldset>
55
-
56
- <property-animations value-key="animation" .scene=${this.scene} .value=${this.value.animation || {}}>
57
- </property-animations>
58
-
59
- <property-event value-key="event" .scene=${this.scene} .value=${this.value.event || {}}> </property-event>
60
- `
61
- }
62
- }
63
-
64
- customElements.define('property-effect', PropertyEffects)