@things-factory/modeller-ui 5.0.0-alpha.5 → 5.0.0-alpha.6

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 (29) hide show
  1. package/client/bootstrap.js +22 -26
  2. package/client/editors/things-editor-layout/things-card-layout.js +1 -1
  3. package/client/editors/things-editor-property.js +1 -546
  4. package/package.json +15 -14
  5. package/client/editors/paper-color-picker/paper-color-circle.js +0 -466
  6. package/client/editors/paper-color-picker/paper-color-input.js +0 -266
  7. package/client/editors/paper-color-picker/paper-color-picker.js +0 -584
  8. package/client/editors/things-editor-3dish.js +0 -164
  9. package/client/editors/things-editor-angle-input.js +0 -69
  10. package/client/editors/things-editor-attachment-selector.js +0 -110
  11. package/client/editors/things-editor-buttons-radio.js +0 -93
  12. package/client/editors/things-editor-code.js +0 -152
  13. package/client/editors/things-editor-color-stops.js +0 -499
  14. package/client/editors/things-editor-color-style.js +0 -345
  15. package/client/editors/things-editor-color.js +0 -313
  16. package/client/editors/things-editor-data.js +0 -152
  17. package/client/editors/things-editor-gradient.js +0 -335
  18. package/client/editors/things-editor-graphql.js +0 -173
  19. package/client/editors/things-editor-id.js +0 -85
  20. package/client/editors/things-editor-multiple-color.js +0 -132
  21. package/client/editors/things-editor-options.js +0 -156
  22. package/client/editors/things-editor-pattern.js +0 -161
  23. package/client/editors/things-editor-property-styles.js +0 -71
  24. package/client/editors/things-editor-range-input.js +0 -166
  25. package/client/editors/things-editor-script.js +0 -213
  26. package/client/editors/things-editor-stack.js +0 -107
  27. package/client/editors/things-editor-table.js +0 -376
  28. package/client/editors/things-editor-value-map.js +0 -290
  29. package/client/editors/things-editor-value-range.js +0 -292
@@ -1,166 +0,0 @@
1
- /**
2
- * @license Copyright © HatioLab Inc. All rights reserved.
3
- */
4
-
5
- import { LitElement, html, css } from 'lit'
6
-
7
- class ThingsEditorRangeInput extends LitElement {
8
- static get is() {
9
- return 'things-editor-range-input'
10
- }
11
-
12
- static get properties() {
13
- return {
14
- value: Number,
15
- step: Number,
16
- min: Number,
17
- max: Number
18
- }
19
- }
20
-
21
- static get styles() {
22
- return [
23
- css`
24
- :host {
25
- font-size: 16px;
26
- display: flex;
27
- align-items: center;
28
- padding: 1px 0;
29
-
30
- width: 100%;
31
- user-select: text;
32
- }
33
-
34
- input[type='number'] {
35
- width: 48px;
36
- overflow: hidden;
37
- }
38
-
39
- input[type='number'] {
40
- color: black;
41
- border: none;
42
- font-weight: 300;
43
- background: white;
44
- padding: 1px 2px;
45
- }
46
-
47
- input[type='range'] {
48
- -webkit-appearance: none;
49
- border: none;
50
- outline: none;
51
- width: 100%;
52
- flex: 1;
53
- height: 16px;
54
- background-color: transparent;
55
- }
56
- input[type='range']::-webkit-slider-runnable-track {
57
- width: 100%;
58
- height: 1px;
59
- background: black;
60
- border: none;
61
- border-radius: 5px;
62
- }
63
- input[type='range']::-webkit-slider-thumb {
64
- -webkit-appearance: none;
65
- border: none;
66
- height: 10px;
67
- width: 10px;
68
- border-radius: 50%;
69
- background: black;
70
- margin-top: -5px;
71
- }
72
- input[type='range']:focus {
73
- outline: none;
74
- }
75
- input[type='range']:focus::-webkit-slider-runnable-track {
76
- background: black;
77
- }
78
-
79
- input[type='range']::-moz-range-track {
80
- width: 100%;
81
- height: 1px;
82
- background: black;
83
- border: none;
84
- border-radius: 5px;
85
- }
86
- input[type='range']::-moz-range-thumb {
87
- border: none;
88
- height: 10px;
89
- width: 10px;
90
- border-radius: 50%;
91
- background: black;
92
- }
93
-
94
- input[type='range']:-moz-focusring {
95
- outline: 1px solid black;
96
- outline-offset: -1px;
97
- }
98
-
99
- input[type='range']::-ms-track {
100
- width: 100%;
101
- height: 1px;
102
- background: black;
103
- border-radius: 10px;
104
- color: transparent;
105
- border: none;
106
- outline: none;
107
- }
108
- input[type='range']::-ms-thumb {
109
- height: 10px;
110
- width: 10px;
111
- border-radius: 50%;
112
- background: black;
113
- border: none;
114
- outline: none;
115
- margin-top: 2px;
116
- }
117
-
118
- input:focus {
119
- outline: none;
120
- opacity: 1;
121
- }
122
- `
123
- ]
124
- }
125
-
126
- constructor() {
127
- super()
128
-
129
- this.step = 1
130
- this.min = -100
131
- this.max = 100
132
- this.value = 0
133
- }
134
-
135
- render() {
136
- return html`
137
- <input
138
- type="range"
139
- .value=${this.value}
140
- .step=${this.step}
141
- .min=${this.min}
142
- .max=${this.max}
143
- @input=${e => {
144
- e.stopPropagation()
145
- this.value = e.target.value
146
- this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }))
147
- }}
148
- />
149
-
150
- <input
151
- type="number"
152
- .value=${this.value}
153
- .step=${this.step}
154
- .min=${this.min}
155
- .max=${this.max}
156
- @change=${e => {
157
- e.stopPropagation()
158
- this.value = e.target.value
159
- this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }))
160
- }}
161
- />
162
- `
163
- }
164
- }
165
-
166
- customElements.define(ThingsEditorRangeInput.is, ThingsEditorRangeInput)
@@ -1,213 +0,0 @@
1
- /**
2
- * @license Copyright © HatioLab Inc. All rights reserved.
3
- */
4
-
5
- // TODO LitElement 로 변경 후 검증하지 않음.
6
- import { LitElement, html, css } from 'lit'
7
-
8
- import ace from 'brace'
9
- import 'brace/mode/javascript'
10
- import 'brace/theme/monokai'
11
-
12
- import 'ace-builds/src-min-noconflict/ace'
13
- import 'ace-builds/src-min-noconflict/mode-javascript'
14
- import 'ace-builds/src-min-noconflict/theme-monokai'
15
-
16
- /**
17
- ace-editor의 polymer element이다.
18
-
19
- Example:
20
-
21
- <things-editor-script id="editor"
22
- value=${text}
23
- theme="ace/theme/monokai"
24
- mode="ace/mode/javascript">
25
- </things-editor-script>
26
- */
27
-
28
- export default class ThingsEditorScript extends LitElement {
29
- static get is() {
30
- return 'things-editor-script'
31
- }
32
-
33
- static get properties() {
34
- return {
35
- /**
36
- * `value`는 에디터에서 작성중인 contents이다.
37
- */
38
- value: String,
39
- theme: String,
40
- mode: String,
41
- fontsize: Number,
42
- softtabs: String,
43
- tabsize: Number,
44
- readonly: Boolean,
45
- wrapmode: Boolean,
46
- editor: Object,
47
- gutter: Boolean
48
- }
49
- }
50
-
51
- static get styles() {
52
- return [
53
- css`
54
- :host {
55
- display: block;
56
- position: relative;
57
-
58
- width: 100%;
59
- height: 100%;
60
- }
61
-
62
- #container {
63
- width: 100%;
64
- height: 100%;
65
- }
66
- `
67
- ]
68
- }
69
- constructor() {
70
- super()
71
-
72
- this.value = ''
73
- this.tabsize = 2
74
- this.gutter = false
75
- }
76
-
77
- connectedCallback() {
78
- super.connectedCallback()
79
-
80
- this._attached = true
81
-
82
- var self = this
83
-
84
- if (!this.editor) {
85
- this.editor = ace.edit(this.$.container, {
86
- initialContent: this.value
87
- })
88
-
89
- if (!this.gutter) this.editor.renderer.setShowGutter(this.gutter)
90
-
91
- // inject base editor styles
92
- this._injectTheme('#ace_editor\\.css')
93
- this._injectTheme('#ace-tm')
94
-
95
- this.editor.getSession().on('change', function (event) {
96
- self._changedOnThis = true
97
- self.set('value', self.editor.getValue())
98
- self._changedOnThis = false
99
- })
100
- }
101
-
102
- // prevent to warning logs ..
103
- this.editor.$blockScrolling = Infinity
104
-
105
- // handle theme changes
106
- this.editor.renderer.addEventListener('themeLoaded', this._onThemeLoaded.bind(this))
107
-
108
- // initial attributes
109
- this._configEditor()
110
- }
111
-
112
- disconnectedCallback() {
113
- super.disconnectedCallback()
114
-
115
- this._attached = false
116
- }
117
-
118
- updated(change) {
119
- change.has('value') && this._valueChanged(this.value)
120
- change.keys().filter(key => key != 'value').length > 1 && this._configEditor()
121
- }
122
-
123
- render() {
124
- return html` <div id="container"></div> `
125
- }
126
-
127
- _configEditor() {
128
- if (!this.editor || !this._attached) return
129
-
130
- var { theme, mode, fontsize, softtabs, tabsize, readonly, wrapmode } = this
131
-
132
- this.editor.setTheme(theme)
133
- this.editor.setFontSize(fontsize)
134
- this.editor.setReadOnly(readonly)
135
-
136
- this.editor.commands.addCommand({
137
- name: 'fullscreen',
138
- exec(editor) {
139
- function _fullscreen_callback(e) {
140
- editor.resize()
141
-
142
- if (
143
- !document.fullscreen &&
144
- !document.mozFullScreen &&
145
- !document.webkitIsFullScreen &&
146
- !document.msFullscreenElement
147
- ) {
148
- ;['fullscreenchange', 'webkitfullscreenchange', 'MSFullscreenChange'].forEach(event =>
149
- document.removeEventListener(event, _fullscreen_callback)
150
- )
151
- }
152
- }
153
-
154
- ;['fullscreenchange', 'webkitfullscreenchange', 'MSFullscreenChange'].forEach(event =>
155
- document.addEventListener(event, _fullscreen_callback)
156
- )
157
-
158
- var container = editor.container
159
-
160
- if (container.requestFullScreen) container.requestFullScreen()
161
- else if (container.webkitRequestFullScreen) container.webkitRequestFullScreen()
162
- else if (container.mozRequestFullScreen) container.mozRequestFullScreen()
163
- else if (container.msRequestFullscreen) container.msRequestFullscreen()
164
-
165
- editor.resize()
166
- },
167
- bindKey: { mac: 'cmd-enter|f11', win: 'ctrl-enter|f11' }
168
- })
169
-
170
- var session = this.editor.getSession()
171
-
172
- session.setOption('useWorker', false)
173
- session.setMode(mode)
174
- session.setUseSoftTabs(softtabs)
175
- tabsize && session.setTabSize(tabsize)
176
- session.setUseWrapMode(wrapmode)
177
- }
178
-
179
- _valueChanged(value) {
180
- if (this._changedOnThis) {
181
- this.fire('change', value)
182
- return
183
- }
184
-
185
- if (this.editor) this.editor.setValue(value == undefined ? '' : String(value))
186
- }
187
-
188
- _onThemeLoaded(e) {
189
- var themeId = '#' + e.theme.cssClass
190
- this._injectTheme(themeId)
191
-
192
- // Workaround Chrome stable bug, force repaint
193
- this.style.display = 'none'
194
- this.offsetHeight
195
- this.style.display = ''
196
- }
197
-
198
- // inject the style tag of a theme to the element
199
- _injectTheme(themeId) {
200
- var n = document.querySelector(themeId)
201
- this.appendChild(this._cloneStyle(n))
202
- }
203
-
204
- //helper function to clone a style
205
- _cloneStyle(style) {
206
- var s = document.createElement('style')
207
- s.id = style.id
208
- s.textContent = style.textContent
209
- return s
210
- }
211
- }
212
-
213
- customElements.define(ThingsEditorScript.is, ThingsEditorScript)
@@ -1,107 +0,0 @@
1
- /**
2
- * @license Copyright © HatioLab Inc. All rights reserved.
3
- */
4
-
5
- // TODO LitElement 로 변경 후 검증하지 않음.
6
- import { html, css } from 'lit'
7
-
8
- export default class ThingsEditorStack extends LitElement {
9
- static get is() {
10
- return 'things-editor-stack'
11
- }
12
-
13
- static get properties() {
14
- return {
15
- /**
16
- * `stack`은 stack에 의해 만들어진 층의 배열을 유지한다.
17
- */
18
- stack: Array,
19
- /**
20
- * `activeIndex`은 현재 active된 층의 인덱스를 유지한다.
21
- */
22
- activeIndex: Number
23
- }
24
- }
25
-
26
- static get styles() {
27
- return [
28
- css`
29
- :host {
30
- display: block;
31
- }
32
-
33
- #add-floor {
34
- width: 100%;
35
- height: 20px;
36
- background-color: blue;
37
- color: white;
38
- }
39
-
40
- div {
41
- background-color: blue;
42
- width: calc(100% - 40px);
43
- width: -webkit-calc(100% - 40px);
44
- min-height: 20px;
45
- }
46
-
47
- div.active {
48
- background-color: red;
49
- }
50
-
51
- div button {
52
- position: absolute;
53
- right: 10px;
54
- width: 30px;
55
- min-height: 20px;
56
- }
57
- `
58
- ]
59
- }
60
-
61
- constructor() {
62
- super()
63
-
64
- this.stack = []
65
- this.activeIndex = 0
66
- }
67
-
68
- render() {
69
- return html`
70
- <button id="add-floor" @click=${e => this._onClickAddFloor(e)}>+</button>
71
-
72
- ${this.stack
73
- .reverse()
74
- .map(
75
- (item, index) => html`
76
- <div class="${index == this.activeIndex ? 'active' : ''}" @click=${e => this._onClickToActive(e)}>
77
- ${item.name} <button @click=${e => this._onClickRemoveFloor(e)}>-</button>
78
- </div>
79
- `
80
- )}
81
- `
82
- }
83
-
84
- _onClickAddFloor(e) {
85
- this.stack.push({ name: '' })
86
- }
87
-
88
- _onClickToActive(e) {
89
- if (e.target.tagName != 'DIV') return
90
-
91
- var model = e.model
92
-
93
- this.activeIndex = this.stack.indexOf(model.item)
94
- }
95
-
96
- _onClickRemoveFloor(e) {
97
- var model = e.model
98
- var idx = this.stack.indexOf(model.item)
99
-
100
- this.active.splice(idx, 1)
101
-
102
- if (this.activeIndex >= this.stack.length && this.activeIndex > 0) this.activeIndex--
103
- else this.activeIndex = 0
104
- }
105
- }
106
-
107
- customElements.define(ThingsEditorStack.is, ThingsEditorStack)