@operato/board 8.0.0-beta.0 → 8.0.0-beta.2
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 +18 -0
- package/package.json +14 -14
- package/.storybook/main.js +0 -3
- package/.storybook/server.mjs +0 -8
- package/db.sqlite +0 -0
- package/demo/index-modeller.html +0 -112
- package/demo/index-player.html +0 -112
- package/demo/index-viewer.html +0 -112
- package/demo/index.html +0 -112
- package/logs/.08636eb59927f12972f6774f5947c8507b3564c2-audit.json +0 -15
- package/logs/.5e5d741d8b7784a2fbad65eedc0fd46946aaf6f2-audit.json +0 -15
- package/logs/application-2023-03-12-02.log +0 -14
- package/logs/connections-2023-03-12-02.log +0 -70
- package/src/component/3d.ts +0 -29
- package/src/component/chart-and-gauge.ts +0 -28
- package/src/component/container.ts +0 -63
- package/src/component/data-source.ts +0 -30
- package/src/component/etc.ts +0 -88
- package/src/component/form.ts +0 -42
- package/src/component/index.ts +0 -12
- package/src/component/iot.ts +0 -52
- package/src/component/line.ts +0 -156
- package/src/component/register-default-groups.ts +0 -28
- package/src/component/shape.ts +0 -156
- package/src/component/table.ts +0 -28
- package/src/component/text-and-media.ts +0 -125
- package/src/component/warehouse.ts +0 -26
- package/src/data-storage/data-storage.ts +0 -76
- package/src/graphql/board.ts +0 -144
- package/src/graphql/data-subscription.ts +0 -30
- package/src/graphql/favorite-board.ts +0 -25
- package/src/graphql/group.ts +0 -138
- package/src/graphql/index.ts +0 -4
- package/src/graphql/play-group.ts +0 -225
- package/src/graphql/scenario.ts +0 -79
- package/src/index.ts +0 -10
- package/src/modeller/component-toolbar/component-detail.ts +0 -52
- package/src/modeller/component-toolbar/component-menu.ts +0 -196
- package/src/modeller/component-toolbar/component-toolbar.ts +0 -196
- package/src/modeller/component-toolbar/mode-icons.ts +0 -88
- package/src/modeller/edit-toolbar-style.ts +0 -232
- package/src/modeller/edit-toolbar.ts +0 -587
- package/src/modeller/property-sidebar/abstract-property.ts +0 -69
- package/src/modeller/property-sidebar/data-binding/data-binding-mapper.ts +0 -475
- package/src/modeller/property-sidebar/data-binding/data-binding-value-map.ts +0 -19
- package/src/modeller/property-sidebar/data-binding/data-binding-value-range.ts +0 -19
- package/src/modeller/property-sidebar/data-binding/data-binding.ts +0 -480
- package/src/modeller/property-sidebar/effects/effects-shared-style.ts +0 -62
- package/src/modeller/property-sidebar/effects/effects.ts +0 -69
- package/src/modeller/property-sidebar/effects/property-animation.ts +0 -146
- package/src/modeller/property-sidebar/effects/property-animations.ts +0 -93
- package/src/modeller/property-sidebar/effects/property-event-hover.ts +0 -200
- package/src/modeller/property-sidebar/effects/property-event-tap.ts +0 -251
- package/src/modeller/property-sidebar/effects/property-event.ts +0 -73
- package/src/modeller/property-sidebar/effects/property-shadow.ts +0 -114
- package/src/modeller/property-sidebar/effects/value-converter.ts +0 -23
- package/src/modeller/property-sidebar/inspector/inspector.ts +0 -404
- package/src/modeller/property-sidebar/property-shared-style.ts +0 -136
- package/src/modeller/property-sidebar/property-sidebar.ts +0 -326
- package/src/modeller/property-sidebar/shapes/box-padding-editor-styles.ts +0 -94
- package/src/modeller/property-sidebar/shapes/shapes.ts +0 -432
- package/src/modeller/property-sidebar/specifics/specific-properties-builder.ts +0 -152
- package/src/modeller/property-sidebar/specifics/specifics.ts +0 -81
- package/src/modeller/property-sidebar/styles/styles.ts +0 -577
- package/src/modeller/scene-viewer/confidential-overlay.ts +0 -18
- package/src/modeller/scene-viewer/ox-scene-handler.ts +0 -40
- package/src/modeller/scene-viewer/ox-scene-layer.ts +0 -42
- package/src/modeller/scene-viewer/ox-scene-property.ts +0 -10
- package/src/modeller/scene-viewer/ox-scene-viewer.ts +0 -263
- package/src/ox-board-component-info.ts +0 -236
- package/src/ox-board-list.ts +0 -401
- package/src/ox-board-modeller.ts +0 -408
- package/src/ox-board-player-style.ts +0 -200
- package/src/ox-board-player.ts +0 -333
- package/src/ox-board-template-list.ts +0 -267
- package/src/ox-board-template-viewer.ts +0 -198
- package/src/ox-board-viewer.ts +0 -727
- package/src/ox-editor-board-selector.ts +0 -91
- package/src/ox-property-editor-board-selector.ts +0 -23
- package/src/player/ox-board-player-carousel.ts +0 -197
- package/src/player/ox-board-player-grid.ts +0 -78
- package/src/player/ox-board-wrapper.ts +0 -152
- package/src/selector/board-creation-popup.ts +0 -151
- package/src/selector/board-thumbnail-card.ts +0 -175
- package/src/selector/ox-board-creation-card.ts +0 -98
- package/src/selector/ox-board-selector.ts +0 -382
- package/src/types.ts +0 -63
- package/stories/property-data-binding.stories.ts +0 -34
- package/tsconfig.json +0 -24
- package/web-dev-server.config.mjs +0 -30
- package/web-test-runner.config.mjs +0 -29
package/src/ox-board-modeller.ts
DELETED
@@ -1,408 +0,0 @@
|
|
1
|
-
import '@material/web/icon/icon.js'
|
2
|
-
import '@material/web/fab/fab.js'
|
3
|
-
import '@hatiolab/things-scene'
|
4
|
-
import './modeller/scene-viewer/ox-scene-handler.js'
|
5
|
-
import './modeller/scene-viewer/ox-scene-layer.js'
|
6
|
-
import './modeller/scene-viewer/ox-scene-property.js'
|
7
|
-
import './modeller/scene-viewer/ox-scene-viewer.js'
|
8
|
-
import './ox-board-viewer'
|
9
|
-
|
10
|
-
import { saveAs } from 'file-saver'
|
11
|
-
import { css, html, LitElement, PropertyValues } from 'lit'
|
12
|
-
import { customElement, property, query } from 'lit/decorators.js'
|
13
|
-
|
14
|
-
import { MODE_EDIT, Scene, SCENE_MODE } from '@hatiolab/things-scene'
|
15
|
-
import { ScopedElementsMixin } from '@open-wc/scoped-elements'
|
16
|
-
import { OxPopup } from '@operato/popup'
|
17
|
-
import { isMacOS, togglefullscreen } from '@operato/utils'
|
18
|
-
|
19
|
-
import { ComponentToolbar } from './modeller/component-toolbar/component-toolbar'
|
20
|
-
import { EditToolbar } from './modeller/edit-toolbar'
|
21
|
-
import { PropertySidebar } from './modeller/property-sidebar/property-sidebar'
|
22
|
-
import { ComponentGroup, ComponentTemplate } from './types'
|
23
|
-
import OxSceneViewer from './modeller/scene-viewer/ox-scene-viewer.js'
|
24
|
-
|
25
|
-
const MACOS = isMacOS()
|
26
|
-
|
27
|
-
const ICON_PROPERTIES = new URL('../../icons/icon-properties.png', import.meta.url).href
|
28
|
-
const ICON_PROPERTIES_LINE_TYPE = new URL('../../icons/icon-properties-line-type.png', import.meta.url).href
|
29
|
-
const ICON_PROPERTIES_ARROW_TYPE = new URL('../../icons/icon-properties-arrow-type.png', import.meta.url).href
|
30
|
-
const ICON_PROPERTIES_LABEL = new URL('../../icons/icon-properties-label.png', import.meta.url).href
|
31
|
-
const ICON_PROPERTIES_PADDING = new URL('../../icons/icon-properties-padding.png', import.meta.url).href
|
32
|
-
|
33
|
-
const ICON_HTOOLBAR = new URL('../../icons/icon-htoolbar.png', import.meta.url).href
|
34
|
-
const ICON_FULLSCREEN = new URL('../../icons/icon-fullscreen.png', import.meta.url).href
|
35
|
-
const ICON_COLLAPSE = new URL('../../icons/icon-collapse.png', import.meta.url).href
|
36
|
-
const ICON_COLLAPSE_ACTIVE = new URL('../../icons/icon-collapse-active.png', import.meta.url).href
|
37
|
-
|
38
|
-
const ICON_SHELL_INSPECTOR = new URL('../../icons/icon-shell-inspector.png', import.meta.url).href
|
39
|
-
|
40
|
-
var Registry: ComponentGroup[] = []
|
41
|
-
|
42
|
-
@customElement('ox-board-modeller')
|
43
|
-
export class BoardModeller extends ScopedElementsMixin(LitElement) {
|
44
|
-
static styles = [
|
45
|
-
css`
|
46
|
-
:host {
|
47
|
-
display: flex;
|
48
|
-
flex-direction: column;
|
49
|
-
|
50
|
-
height: 100%;
|
51
|
-
overflow: hidden;
|
52
|
-
}
|
53
|
-
|
54
|
-
edit-toolbar {
|
55
|
-
flex: 45px;
|
56
|
-
max-height: 45px;
|
57
|
-
}
|
58
|
-
|
59
|
-
div[content] {
|
60
|
-
flex: 1;
|
61
|
-
max-height: calc(100% - 45px);
|
62
|
-
|
63
|
-
display: flex;
|
64
|
-
flex-direction: row;
|
65
|
-
}
|
66
|
-
|
67
|
-
component-toolbar {
|
68
|
-
max-height: 100%;
|
69
|
-
}
|
70
|
-
|
71
|
-
property-sidebar {
|
72
|
-
overflow: hidden;
|
73
|
-
}
|
74
|
-
|
75
|
-
#scene-wrap {
|
76
|
-
position: relative;
|
77
|
-
|
78
|
-
flex: 1;
|
79
|
-
display: flex;
|
80
|
-
flex-direction: row;
|
81
|
-
}
|
82
|
-
|
83
|
-
ox-scene-viewer {
|
84
|
-
flex: 1;
|
85
|
-
width: 100%;
|
86
|
-
height: 100%;
|
87
|
-
}
|
88
|
-
|
89
|
-
md-fab {
|
90
|
-
position: absolute;
|
91
|
-
right: 15px;
|
92
|
-
bottom: 15px;
|
93
|
-
}
|
94
|
-
|
95
|
-
ox-popup {
|
96
|
-
width: 90%;
|
97
|
-
height: 90%;
|
98
|
-
left: 50%;
|
99
|
-
top: 50%;
|
100
|
-
transform: translateX(-50%) translateY(-50%);
|
101
|
-
background: var(--md-sys-color-on-secondary-container, black);
|
102
|
-
|
103
|
-
display: flex;
|
104
|
-
justify-content: center;
|
105
|
-
flex-direction: column;
|
106
|
-
}
|
107
|
-
|
108
|
-
ox-board-viewer {
|
109
|
-
width: 98%;
|
110
|
-
height: 98%;
|
111
|
-
margin: auto;
|
112
|
-
padding: 0;
|
113
|
-
}
|
114
|
-
`
|
115
|
-
]
|
116
|
-
|
117
|
-
static registerGroup(group: ComponentGroup) {
|
118
|
-
var found = Registry.find(inRegisterGroup => inRegisterGroup.name == group.name)
|
119
|
-
|
120
|
-
if (found) {
|
121
|
-
found = {
|
122
|
-
...found,
|
123
|
-
...group
|
124
|
-
}
|
125
|
-
} else {
|
126
|
-
Registry.push(group)
|
127
|
-
}
|
128
|
-
}
|
129
|
-
|
130
|
-
static registerTemplate(templates: ComponentTemplate[]): void {
|
131
|
-
templates &&
|
132
|
-
templates.forEach(template => {
|
133
|
-
var groups: string[] = typeof template.group == 'string' ? [template.group] : template.group
|
134
|
-
|
135
|
-
Registry.filter(group => groups.includes(group.name)).forEach(group => {
|
136
|
-
if (!group.templates.find(inGroupTemplate => inGroupTemplate.type == template.type)) {
|
137
|
-
group.templates.push(template)
|
138
|
-
}
|
139
|
-
})
|
140
|
-
})
|
141
|
-
}
|
142
|
-
|
143
|
-
static get groups(): ComponentGroup[] {
|
144
|
-
return Registry
|
145
|
-
}
|
146
|
-
|
147
|
-
static getGroup(name: string) {
|
148
|
-
return Registry.find(group => group.name === name)
|
149
|
-
}
|
150
|
-
|
151
|
-
@property({ type: String }) boardName: string = ''
|
152
|
-
@property({ type: Object }) model: any = null
|
153
|
-
@property({ type: String }) baseUrl: string = ''
|
154
|
-
@property({ type: Array }) selected: any[] = []
|
155
|
-
@property({ type: Number }) mode: SCENE_MODE = SCENE_MODE.EDIT
|
156
|
-
@property({ type: Object }) provider: any = null
|
157
|
-
@property({ type: Boolean }) hideProperty: boolean = false
|
158
|
-
@property({ type: String }) overlay: string = ''
|
159
|
-
@property({ type: Object }) scene?: Scene
|
160
|
-
@property({ type: Array }) componentGroupList: any[] = []
|
161
|
-
@property({ type: Array }) fonts: any[] = []
|
162
|
-
@property({ type: Array }) propertyEditor: any[] = []
|
163
|
-
|
164
|
-
@query('edit-toolbar') private editToolbar!: EditToolbar
|
165
|
-
@query('ox-scene-viewer') private viewer!: OxSceneViewer
|
166
|
-
|
167
|
-
private group: string = ''
|
168
|
-
private shortcutHandler?: (e: KeyboardEvent) => void
|
169
|
-
|
170
|
-
constructor() {
|
171
|
-
super()
|
172
|
-
|
173
|
-
document.addEventListener('get-all-scene-component-ids', (e: Event) => {
|
174
|
-
var { component, callback } = (e as CustomEvent).detail
|
175
|
-
|
176
|
-
if (!this.scene) return
|
177
|
-
|
178
|
-
var ids
|
179
|
-
if (component) {
|
180
|
-
ids = this.scene.findAll(component).map(c => c.model.id)
|
181
|
-
} else {
|
182
|
-
// @ts-ignore
|
183
|
-
ids = this.scene.ids.map(({ key }) => key)
|
184
|
-
}
|
185
|
-
|
186
|
-
ids = ids.filter(Boolean).sort()
|
187
|
-
callback(ids)
|
188
|
-
})
|
189
|
-
|
190
|
-
this.style.setProperty('--url-icon-properties', `url(${ICON_PROPERTIES})`)
|
191
|
-
this.style.setProperty('--url-icon-properties-label', `url(${ICON_PROPERTIES_LABEL})`)
|
192
|
-
this.style.setProperty('--url-icon-properties-padding', `url(${ICON_PROPERTIES_PADDING})`)
|
193
|
-
this.style.setProperty('--url-icon-properties-line-type', `url(${ICON_PROPERTIES_LINE_TYPE})`)
|
194
|
-
this.style.setProperty('--url-icon-properties-arrow-type', `url(${ICON_PROPERTIES_ARROW_TYPE})`)
|
195
|
-
|
196
|
-
this.style.setProperty('--url-icon-htoolbar', `url(${ICON_HTOOLBAR})`)
|
197
|
-
this.style.setProperty('--url-icon-fullscreen', `url(${ICON_FULLSCREEN})`)
|
198
|
-
this.style.setProperty('--url-icon-collapse', `url(${ICON_COLLAPSE})`)
|
199
|
-
this.style.setProperty('--url-icon-collapse-active', `url(${ICON_COLLAPSE_ACTIVE})`)
|
200
|
-
|
201
|
-
this.style.setProperty('--url-icon-shell-inspector', `url(${ICON_SHELL_INSPECTOR})`)
|
202
|
-
}
|
203
|
-
|
204
|
-
static get scopedElements() {
|
205
|
-
return {
|
206
|
-
'edit-toolbar': EditToolbar,
|
207
|
-
'property-sidebar': PropertySidebar,
|
208
|
-
'component-toolbar': ComponentToolbar
|
209
|
-
}
|
210
|
-
}
|
211
|
-
|
212
|
-
render() {
|
213
|
-
return html`
|
214
|
-
<edit-toolbar
|
215
|
-
.scene=${this.scene}
|
216
|
-
.selected=${this.selected}
|
217
|
-
@hide-property-changed=${(e: CustomEvent) => (this.hideProperty = e.detail.value)}
|
218
|
-
@open-preview=${() => this.preview()}
|
219
|
-
@download-model=${() => this.downloadModel()}
|
220
|
-
@modeller-fullscreen=${() => togglefullscreen(this)}
|
221
|
-
>
|
222
|
-
${this.renderBrandingZone()}
|
223
|
-
</edit-toolbar>
|
224
|
-
|
225
|
-
<div content>
|
226
|
-
<component-toolbar
|
227
|
-
.scene=${this.scene}
|
228
|
-
.mode=${this.mode}
|
229
|
-
@mode-changed=${(e: CustomEvent) => {
|
230
|
-
this.mode = e.detail.value
|
231
|
-
}}
|
232
|
-
.componentGroupList=${this.componentGroupList}
|
233
|
-
.group=${this.group}
|
234
|
-
>
|
235
|
-
</component-toolbar>
|
236
|
-
|
237
|
-
<div id="scene-wrap">
|
238
|
-
<ox-scene-viewer
|
239
|
-
id="scene"
|
240
|
-
.scene=${this.scene}
|
241
|
-
@scene-changed=${(e: CustomEvent) => {
|
242
|
-
this.scene = e.detail.value
|
243
|
-
}}
|
244
|
-
.model=${this.model}
|
245
|
-
.selected=${this.selected}
|
246
|
-
@selected-changed=${(e: CustomEvent) => {
|
247
|
-
this.selected = e.detail.value
|
248
|
-
}}
|
249
|
-
.mode=${this.mode}
|
250
|
-
@mode-changed=${(e: CustomEvent) => {
|
251
|
-
this.mode = e.detail.value
|
252
|
-
}}
|
253
|
-
fit="ratio"
|
254
|
-
.baseUrl=${this.baseUrl}
|
255
|
-
@contextmenu=${() => this.onContextMenu()}
|
256
|
-
.provider=${this.provider}
|
257
|
-
name="modeller"
|
258
|
-
>
|
259
|
-
<ox-scene-layer type="selection-layer"></ox-scene-layer>
|
260
|
-
<ox-scene-layer type="modeling-layer"></ox-scene-layer>
|
261
|
-
<ox-scene-layer type="add-layer"> </ox-scene-layer>
|
262
|
-
<ox-scene-layer type="guide-layer">
|
263
|
-
<ox-scene-property name="ruler" value="disabled"></ox-scene-property>
|
264
|
-
</ox-scene-layer>
|
265
|
-
<ox-scene-layer type="shift-layer">
|
266
|
-
<ox-scene-property name="text" value="${this.overlay}"></ox-scene-property>
|
267
|
-
<ox-scene-property name="alpha" value="0.3"></ox-scene-property>
|
268
|
-
<ox-scene-property name="fontFamily" value="arial"></ox-scene-property>
|
269
|
-
<ox-scene-property name="fontSize" value="30" type="number"></ox-scene-property>
|
270
|
-
<ox-scene-property name="fontColor" value="navy"></ox-scene-property>
|
271
|
-
<ox-scene-property name="textBaseline" value="top"></ox-scene-property>
|
272
|
-
<ox-scene-property name="textAlign" value="left"></ox-scene-property>
|
273
|
-
<ox-scene-property name="paddingTop" value="50" type="number"></ox-scene-property>
|
274
|
-
<ox-scene-property name="paddingLeft" value="50" type="number"></ox-scene-property>
|
275
|
-
</ox-scene-layer>
|
276
|
-
<ox-scene-layer type="decotag-layer"></ox-scene-layer>
|
277
|
-
<ox-scene-handler type="text-editor"></ox-scene-handler>
|
278
|
-
<ox-scene-handler type="move-handler"></ox-scene-handler>
|
279
|
-
<ox-scene-handler type="paste-handler"></ox-scene-handler>
|
280
|
-
</ox-scene-viewer>
|
281
|
-
|
282
|
-
<md-fab @click=${() => this.onTapSave()} title="save">
|
283
|
-
<md-icon slot="icon">save</md-icon>
|
284
|
-
</md-fab>
|
285
|
-
</div>
|
286
|
-
|
287
|
-
<property-sidebar
|
288
|
-
.scene=${this.scene}
|
289
|
-
.selected=${this.selected}
|
290
|
-
.collapsed=${this.hideProperty}
|
291
|
-
.fonts=${this.fonts}
|
292
|
-
.propertyEditor=${this.propertyEditor}
|
293
|
-
>
|
294
|
-
</property-sidebar>
|
295
|
-
</div>
|
296
|
-
`
|
297
|
-
}
|
298
|
-
|
299
|
-
connectedCallback(): void {
|
300
|
-
super.connectedCallback()
|
301
|
-
this.bindShortcutEvent()
|
302
|
-
}
|
303
|
-
|
304
|
-
disconnectedCallback(): void {
|
305
|
-
super.disconnectedCallback()
|
306
|
-
this.unbindShortcutEvent()
|
307
|
-
}
|
308
|
-
|
309
|
-
updated(changes: PropertyValues<this>) {
|
310
|
-
if (changes.has('scene') && this.scene) {
|
311
|
-
this.scene.mode = MODE_EDIT
|
312
|
-
}
|
313
|
-
}
|
314
|
-
|
315
|
-
close() {
|
316
|
-
this.model = null
|
317
|
-
this.requestUpdate()
|
318
|
-
}
|
319
|
-
|
320
|
-
onShortcut(e: KeyboardEvent) {
|
321
|
-
if (MACOS) var ctrlKey = e.metaKey
|
322
|
-
else var ctrlKey = e.ctrlKey
|
323
|
-
|
324
|
-
switch (e.code) {
|
325
|
-
case 'KeyS':
|
326
|
-
if (ctrlKey) {
|
327
|
-
this.onTapSave()
|
328
|
-
e.preventDefault()
|
329
|
-
}
|
330
|
-
break
|
331
|
-
}
|
332
|
-
}
|
333
|
-
|
334
|
-
preview() {
|
335
|
-
const board = {
|
336
|
-
id: 'preview',
|
337
|
-
model: this.scene?.model ? JSON.parse(JSON.stringify(this.scene.model)) : null
|
338
|
-
}
|
339
|
-
|
340
|
-
OxPopup.open({
|
341
|
-
template: html` <ox-board-viewer style="flex: 1;" .provider=${this.provider} .board=${board}></ox-board-viewer> `,
|
342
|
-
style: 'width: 80vw; height: 80vh;',
|
343
|
-
backdrop: true
|
344
|
-
})
|
345
|
-
|
346
|
-
requestAnimationFrame(() => {
|
347
|
-
dispatchEvent(new Event('resize'))
|
348
|
-
})
|
349
|
-
}
|
350
|
-
|
351
|
-
downloadModel() {
|
352
|
-
if (!this.scene) return
|
353
|
-
|
354
|
-
var model = JSON.stringify(this.model, null, 2)
|
355
|
-
var filename = (this.boardName || 'NONAME') + '-' + Date.now() + '.json'
|
356
|
-
saveAs(new Blob([model], { type: 'application/octet-stream' }), filename)
|
357
|
-
}
|
358
|
-
|
359
|
-
renderBrandingZone() {
|
360
|
-
return html``
|
361
|
-
}
|
362
|
-
|
363
|
-
onTapSave() {
|
364
|
-
this.dispatchEvent(new CustomEvent('save-model', { bubbles: true, composed: true, detail: { model: this.model } }))
|
365
|
-
}
|
366
|
-
|
367
|
-
bindShortcutEvent() {
|
368
|
-
// TODO: Global Hotkey에 대한 정의를 edit-toolbar에서 가져올 수 있도록 수정해야 함.
|
369
|
-
const GLOBAL_HOTKEYS = ['Digit1', 'Digit2', 'F11', 'KeyD', 'KeyP', 'KeyS']
|
370
|
-
|
371
|
-
this.shortcutHandler = (e: KeyboardEvent) => {
|
372
|
-
const target = e.composedPath()[0] as HTMLElement
|
373
|
-
var tagName = target.tagName
|
374
|
-
var isInput = target.isContentEditable || tagName == 'INPUT' || tagName == 'SELECT' || tagName == 'TEXTAREA'
|
375
|
-
var isGlobalHotkey = GLOBAL_HOTKEYS.includes(e.code)
|
376
|
-
|
377
|
-
if (!isGlobalHotkey && isInput) return
|
378
|
-
if (!this.editToolbar.onShortcut(e)) this.onShortcut(e)
|
379
|
-
}
|
380
|
-
|
381
|
-
document.addEventListener('keydown', this.shortcutHandler)
|
382
|
-
}
|
383
|
-
|
384
|
-
unbindShortcutEvent() {
|
385
|
-
if (this.shortcutHandler) {
|
386
|
-
document.removeEventListener('keydown', this.shortcutHandler)
|
387
|
-
delete this.shortcutHandler
|
388
|
-
}
|
389
|
-
}
|
390
|
-
|
391
|
-
undoable(): boolean {
|
392
|
-
return !!this.scene?.undoable()
|
393
|
-
}
|
394
|
-
|
395
|
-
redoable(): boolean {
|
396
|
-
return !!this.scene?.redoable()
|
397
|
-
}
|
398
|
-
|
399
|
-
preserve(): void {
|
400
|
-
this.scene?.preserve()
|
401
|
-
}
|
402
|
-
|
403
|
-
hasUnpreservedChanges(): boolean {
|
404
|
-
return !!this.scene?.hasUnpreservedChanges()
|
405
|
-
}
|
406
|
-
|
407
|
-
onContextMenu() {}
|
408
|
-
}
|
@@ -1,200 +0,0 @@
|
|
1
|
-
import { css } from 'lit'
|
2
|
-
|
3
|
-
export const style = css`
|
4
|
-
:host {
|
5
|
-
display: flex;
|
6
|
-
position: relative;
|
7
|
-
flex-direction: column;
|
8
|
-
width: 100%;
|
9
|
-
height: 100%;
|
10
|
-
overflow: hidden;
|
11
|
-
justify-content: center;
|
12
|
-
align-items: center;
|
13
|
-
}
|
14
|
-
|
15
|
-
::slotted(*) {
|
16
|
-
border: none;
|
17
|
-
}
|
18
|
-
|
19
|
-
::slotted > * {
|
20
|
-
flex: 1;
|
21
|
-
}
|
22
|
-
|
23
|
-
board-wrapper {
|
24
|
-
width: 100%;
|
25
|
-
height: 100%;
|
26
|
-
position: relative;
|
27
|
-
}
|
28
|
-
|
29
|
-
board-wrapper[front] {
|
30
|
-
background: black;
|
31
|
-
}
|
32
|
-
|
33
|
-
board-wrapper[back] {
|
34
|
-
background: black;
|
35
|
-
}
|
36
|
-
|
37
|
-
#control {
|
38
|
-
position: absolute;
|
39
|
-
bottom: 1vh;
|
40
|
-
width: 100vw;
|
41
|
-
max-width: 435px;
|
42
|
-
display: grid;
|
43
|
-
grid-template-columns: 42px 42px 1fr;
|
44
|
-
color: white;
|
45
|
-
justify-content: center;
|
46
|
-
align-items: center;
|
47
|
-
grid-auto-flow: dense;
|
48
|
-
padding: 5px;
|
49
|
-
box-sizing: border-box;
|
50
|
-
grid-template-rows: 12px 60px 12px;
|
51
|
-
}
|
52
|
-
|
53
|
-
#control[hidden] {
|
54
|
-
display: none;
|
55
|
-
}
|
56
|
-
|
57
|
-
#control > div > * {
|
58
|
-
cursor: pointer;
|
59
|
-
user-select: none;
|
60
|
-
}
|
61
|
-
|
62
|
-
#joystick {
|
63
|
-
position: relative;
|
64
|
-
box-sizing: border-box;
|
65
|
-
border: 2px solid tomato;
|
66
|
-
background-color: #c34827;
|
67
|
-
box-shadow: 0 0 5px #000;
|
68
|
-
width: 100%;
|
69
|
-
height: 100%;
|
70
|
-
grid-column: 1 / span 2;
|
71
|
-
border-radius: 50%;
|
72
|
-
z-index: 2;
|
73
|
-
grid-row: 1 / span 3;
|
74
|
-
}
|
75
|
-
|
76
|
-
#joystick md-icon {
|
77
|
-
position: absolute;
|
78
|
-
display: block;
|
79
|
-
width: 20px;
|
80
|
-
height: 20px;
|
81
|
-
font-size: 25px;
|
82
|
-
line-height: 0.7;
|
83
|
-
}
|
84
|
-
|
85
|
-
md-icon#up {
|
86
|
-
left: 29px;
|
87
|
-
}
|
88
|
-
|
89
|
-
md-icon#left {
|
90
|
-
top: 32px;
|
91
|
-
left: -2px;
|
92
|
-
}
|
93
|
-
|
94
|
-
md-icon#play,
|
95
|
-
md-icon#pause {
|
96
|
-
left: 20px;
|
97
|
-
top: 20px;
|
98
|
-
width: 40px;
|
99
|
-
height: 40px;
|
100
|
-
border: 1px solid rgba(0, 0, 0, 0.15);
|
101
|
-
border-radius: 50%;
|
102
|
-
background-color: rgba(0, 0, 0, 0.15);
|
103
|
-
font-size: 45px;
|
104
|
-
line-height: 0.9;
|
105
|
-
}
|
106
|
-
|
107
|
-
md-icon#right {
|
108
|
-
top: 31px;
|
109
|
-
left: 60px;
|
110
|
-
}
|
111
|
-
|
112
|
-
md-icon#down {
|
113
|
-
left: 29px;
|
114
|
-
top: 63px;
|
115
|
-
}
|
116
|
-
|
117
|
-
md-icon#pause {
|
118
|
-
text-indent: -2px;
|
119
|
-
}
|
120
|
-
|
121
|
-
#setting-container {
|
122
|
-
grid-column: 2 / span 2;
|
123
|
-
grid-row: 2;
|
124
|
-
gap: 0 10px;
|
125
|
-
border-radius: 12px;
|
126
|
-
background: rgba(0, 0, 0, 0.7);
|
127
|
-
height: 100%;
|
128
|
-
box-shadow: rgb(0, 0, 0) 0px 0px 5px;
|
129
|
-
display: grid;
|
130
|
-
grid-template-columns: 1fr 60px;
|
131
|
-
align-items: center;
|
132
|
-
padding-left: 60px;
|
133
|
-
padding-right: 5px;
|
134
|
-
}
|
135
|
-
|
136
|
-
#setting {
|
137
|
-
display: grid;
|
138
|
-
grid-template-columns: 1fr 1fr;
|
139
|
-
grid-gap: 0 10px;
|
140
|
-
}
|
141
|
-
|
142
|
-
#setting md-icon {
|
143
|
-
font-size: 22px;
|
144
|
-
color: rgba(255, 174, 53, 0.8);
|
145
|
-
}
|
146
|
-
|
147
|
-
#setting input {
|
148
|
-
width: 50px;
|
149
|
-
margin-right: 5px;
|
150
|
-
font-size: 14px;
|
151
|
-
background-color: transparent;
|
152
|
-
border: none;
|
153
|
-
border-bottom: 1px solid #fff;
|
154
|
-
color: #fff;
|
155
|
-
text-align: right;
|
156
|
-
}
|
157
|
-
|
158
|
-
#setting select {
|
159
|
-
border: none;
|
160
|
-
font-size: 14px;
|
161
|
-
}
|
162
|
-
|
163
|
-
#setting input:focus {
|
164
|
-
outline: none;
|
165
|
-
}
|
166
|
-
|
167
|
-
#schedule-container {
|
168
|
-
display: flex;
|
169
|
-
align-items: center;
|
170
|
-
justify-content: space-between;
|
171
|
-
}
|
172
|
-
|
173
|
-
#grid-setting-container {
|
174
|
-
display: flex;
|
175
|
-
align-items: center;
|
176
|
-
justify-content: space-between;
|
177
|
-
}
|
178
|
-
|
179
|
-
#etc {
|
180
|
-
display: grid;
|
181
|
-
grid-template-columns: 1fr 1fr;
|
182
|
-
align-items: center;
|
183
|
-
justify-items: center;
|
184
|
-
}
|
185
|
-
|
186
|
-
#etc md-icon {
|
187
|
-
font-size: 30px;
|
188
|
-
}
|
189
|
-
|
190
|
-
#control [hidden] {
|
191
|
-
display: none;
|
192
|
-
}
|
193
|
-
|
194
|
-
@media screen and (max-width: 460px) {
|
195
|
-
#setting {
|
196
|
-
grid-template-columns: 1fr;
|
197
|
-
grid-template-rows: 1fr 1fr;
|
198
|
-
}
|
199
|
-
}
|
200
|
-
`
|