@things-factory/board-ui 4.0.13 → 4.0.18

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,366 +0,0 @@
1
- /**
2
- * @license Copyright © HatioLab Inc. All rights reserved.
3
- */
4
-
5
- import { LitElement, html, css } from 'lit-element'
6
-
7
- import '@things-factory/i18n-base'
8
- import '@things-factory/modeller-ui/client/editors/things-editor-code'
9
- import '@things-factory/modeller-ui/client/editors/things-editor-value-map'
10
- import '@things-factory/modeller-ui/client/editors/things-editor-value-range'
11
- import '@things-factory/modeller-ui/client/editors/things-editor-buttons-radio'
12
-
13
- /**
14
- element for mapping data value editing
15
-
16
- Example:
17
-
18
- <data-binding-mapper mapping=${mapping}>
19
- </data-binding-mapper>
20
- */
21
- export default class DataBindingMapper extends LitElement {
22
- static get is() {
23
- return 'data-binding-mapper'
24
- }
25
-
26
- static get properties() {
27
- return {
28
- mapping: Object,
29
- rule: Object,
30
- properties: Array,
31
- scene: Object,
32
- _valueTypes: Object,
33
- _componentIds: Array
34
- }
35
- }
36
-
37
- static get styles() {
38
- return [
39
- css`
40
- :host {
41
- background-color: rgba(255, 255, 255, 0.5);
42
- overflow: hidden;
43
- padding: 7px 0 0 0;
44
- border: 1px solid rgba(0, 0, 0, 0.2);
45
- border-width: 0 1px 1px 1px;
46
- padding: 4px;
47
- line-height: 2;
48
-
49
- display: grid;
50
- grid-template-columns: repeat(10, 1fr);
51
- grid-gap: 4px;
52
- grid-auto-rows: minmax(24px, auto);
53
-
54
- align-items: center;
55
- }
56
-
57
- :host > * {
58
- align-self: stretch;
59
- }
60
-
61
- label {
62
- grid-column: span 3;
63
- text-align: right;
64
- text-transform: capitalize;
65
- }
66
-
67
- input,
68
- select,
69
- things-editor-buttons-radio,
70
- [mapping-rule] {
71
- grid-column: span 7;
72
- }
73
- input,
74
- select {
75
- border: var(--property-sidebar-fieldset-border);
76
- }
77
-
78
- things-editor-buttons-radio {
79
- display: flex;
80
- padding: 0 4px;
81
- }
82
-
83
- things-editor-buttons-radio > * {
84
- text-align: center;
85
- flex: 1;
86
- margin: 2px;
87
- border-bottom: 2px solid #fff;
88
- }
89
-
90
- things-editor-buttons-radio div[active] {
91
- border-color: #f2471c;
92
- }
93
-
94
- select {
95
- height: 22px;
96
- }
97
-
98
- [mapping-rule] {
99
- display: flex;
100
- }
101
-
102
- [mapping-rule] * {
103
- flex: auto;
104
- margin: 0;
105
- text-align: left;
106
- align-self: center;
107
- }
108
-
109
- [rule-editors] {
110
- grid-column: span 10;
111
-
112
- display: 'flex';
113
- align-content: auto;
114
- }
115
-
116
- [rule-editors] :not([active]) {
117
- display: none;
118
- }
119
-
120
- things-editor-code {
121
- height: 300px;
122
- overflow: auto;
123
- }
124
- `
125
- ]
126
- }
127
-
128
- constructor() {
129
- super()
130
- this.mapping = {
131
- rule: 'value'
132
- }
133
- this.rule = {}
134
- this.properties = []
135
-
136
- this._valueTypes = {
137
- play: 'boolean',
138
- hidden: 'boolean',
139
- started: 'boolean',
140
-
141
- rotation: 'number',
142
- value: 'number',
143
-
144
- fillStyle: 'color',
145
- strokeStyle: 'color',
146
- fontColor: 'color',
147
-
148
- data: 'object',
149
- source: 'object',
150
- location: 'object',
151
- dimension: 'object',
152
-
153
- text: 'string',
154
- ref: 'string'
155
- }
156
-
157
- this._componentIds = []
158
- }
159
-
160
- firstUpdated() {
161
- this.renderRoot.addEventListener('change', e => this._onChange(e))
162
- }
163
-
164
- updated(change) {
165
- change.has('mapping') && this._onChangedMapping(this.mapping)
166
- }
167
-
168
- render() {
169
- return html`
170
- <label for="accessor-input"> <i18n-msg msgid="label.accessor">accessor</i18n-msg> </label>
171
- <input
172
- id="accessor-input"
173
- value-key="accessor"
174
- type="text"
175
- data-mapping-accessor
176
- .value=${this.mapping.accessor || ''}
177
- />
178
-
179
- <label for="target-input"> <i18n-msg msgid="label.target">target</i18n-msg> </label>
180
- <input
181
- id="target-input"
182
- type="text"
183
- value-key="target"
184
- list="target-list"
185
- .value=${this.mapping.target || ''}
186
- @focusin=${e => {
187
- if (!this.scene) this._componentIds = []
188
- this._componentIds = this.scene.ids.map(info => info.key).filter(id => !!id)
189
- }}
190
- />
191
- <datalist id="target-list">
192
- <option value="(self)"></option>
193
- <option value="(key)"></option>
194
- ${this._componentIds.length
195
- ? html` ${this._componentIds.map(id => html` <option value=${id}></option> `)} `
196
- : html``}
197
- </datalist>
198
-
199
- <label for="property-input"> <i18n-msg msgid="label.property">property</i18n-msg> </label>
200
- <select id="property-input" value-key="property" .value=${this.mapping.property}>
201
- ${this.properties.map(
202
- item =>
203
- html` <option .value=${item.name} ?selected=${item.name == this.mapping.property}>${item.label}</option> `
204
- )}
205
- </select>
206
-
207
- <label> <i18n-msg msgid="label.rule-type">rule type</i18n-msg> </label>
208
- <things-editor-buttons-radio .value=${this.mapping.rule} @change=${e => this._onChangeRule(e)}>
209
- <div data-value="value"><i18n-msg msgid="label.value"></i18n-msg></div>
210
- <div data-value="map"><i18n-msg msgid="label.map"></i18n-msg></div>
211
- <div data-value="range"><i18n-msg msgid="label.range"></i18n-msg></div>
212
- <div data-value="eval"><i18n-msg msgid="label.eval"></i18n-msg></div>
213
- </things-editor-buttons-radio>
214
-
215
- <div rule-editors class="content" ?hidden=${this.mapping.rule == 'value'}>
216
- <things-editor-value-map
217
- value-key="map"
218
- .value=${this.rule.map || {}}
219
- .valuetype=${this._valuetype(this.mapping.property)}
220
- ?active=${this.mapping.rule == 'map'}
221
- >
222
- </things-editor-value-map>
223
-
224
- <things-editor-value-range
225
- value-key="range"
226
- .value=${this.rule.range || []}
227
- .valuetype=${this._valuetype(this.mapping.property)}
228
- ?active=${this.mapping.rule == 'range'}
229
- >
230
- </things-editor-value-range>
231
-
232
- <things-editor-code
233
- value-key="eval"
234
- id="eval-editor"
235
- .value=${this.rule.eval || ''}
236
- ?active=${this.mapping.rule == 'eval'}
237
- >
238
- </things-editor-code>
239
- </div>
240
- `
241
- }
242
-
243
- _valuetype(property) {
244
- return this._valueTypes[property] || 'string'
245
- }
246
-
247
- async _onChangedMapping(change) {
248
- if (this._keep_saved_rule_params) {
249
- this._keep_saved_rule_params = false
250
- } else {
251
- await this.renderComplete
252
-
253
- var rule = {}
254
-
255
- if (this.mapping) {
256
- switch (this.mapping.rule) {
257
- case 'map':
258
- rule.map = this.mapping.param || {}
259
- break
260
- case 'range':
261
- rule.range = this.mapping.param || []
262
- break
263
- case 'eval':
264
- rule.eval = this.mapping.param || ''
265
- break
266
- default:
267
- this.mapping.rule = 'value'
268
- break
269
- }
270
- }
271
-
272
- this.rule = rule
273
- this.requestUpdate()
274
- }
275
- }
276
-
277
- _onChangeRule(e) {
278
- var element = e.target
279
- var value = element.value
280
-
281
- let param
282
-
283
- switch (value) {
284
- case 'map':
285
- param = this.rule.map
286
- break
287
- case 'range':
288
- param = this.rule.range
289
- break
290
- case 'eval':
291
- param = this.rule.eval || ''
292
-
293
- let editor = this.renderRoot.querySelector('#eval-editor')
294
- // rule.eval에 값이 없을 때, ace-editor 내용이 초기화되지 않는 문제때문에 처리함.
295
- if (!param) {
296
- editor.value = 'return'
297
- }
298
- break
299
- default:
300
- }
301
-
302
- this.mapping = {
303
- ...this.mapping,
304
- rule: value,
305
- param
306
- }
307
-
308
- this._keep_saved_rule_params = true
309
- this.dispatchEvent(new CustomEvent('value-change', { bubbles: true, composed: true }))
310
- }
311
-
312
- _onChange(e) {
313
- var element = e.target
314
- var key = element.getAttribute('value-key')
315
-
316
- if (!key) return
317
-
318
- var value = element.value
319
-
320
- if (key == 'target') {
321
- if (value.length > 0 && !/^[.#(\[]/.test(value)) {
322
- value = '#' + value.trim()
323
-
324
- this.renderRoot.querySelector('#target-input').value = value
325
- }
326
-
327
- this.mapping = {
328
- ...this.mapping,
329
- target: value
330
- }
331
- } else if (key == 'accessor') {
332
- this.mapping = {
333
- ...this.mapping,
334
- accessor: (value || '').trim()
335
- }
336
- } else if (key == 'property') {
337
- this.mapping = {
338
- ...this.mapping,
339
- property: (value || '').trim()
340
- }
341
- } else if (key == 'map' || key == 'range' || key == 'eval') {
342
- this.rule[key] = value
343
- this.mapping = {
344
- ...this.mapping,
345
- param: value
346
- }
347
- }
348
-
349
- if (!this.mapping.rule) this.mapping.rule = 'value'
350
-
351
- this._keep_saved_rule_params = true
352
- this.dispatchEvent(
353
- new CustomEvent('value-change', {
354
- bubbles: true,
355
- composed: true,
356
- detail: {
357
- changed: {
358
- [key]: value
359
- }
360
- }
361
- })
362
- )
363
- }
364
- }
365
-
366
- customElements.define(DataBindingMapper.is, DataBindingMapper)