@fmsim/board 0.0.62 → 0.0.64
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/custom-elements.json +2281 -1834
- package/dist/src/layers/mcs-mouse-event-layer.d.ts +30 -0
- package/dist/src/layers/mcs-mouse-event-layer.js +114 -0
- package/dist/src/layers/mcs-mouse-event-layer.js.map +1 -0
- package/dist/src/layers/tooltip-decorator.d.ts +2 -0
- package/dist/src/layers/tooltip-decorator.js +41 -0
- package/dist/src/layers/tooltip-decorator.js.map +1 -0
- package/dist/src/ox-board-component-info.d.ts +21 -0
- package/dist/src/ox-board-component-info.js +218 -0
- package/dist/src/ox-board-component-info.js.map +1 -0
- package/dist/src/ox-board-modeller.js +0 -1
- package/dist/src/ox-board-modeller.js.map +1 -1
- package/dist/src/ox-board-viewer.d.ts +5 -1
- package/dist/src/ox-board-viewer.js +49 -3
- package/dist/src/ox-board-viewer.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/dist/src/graphql/board.d.ts +0 -6
- package/dist/src/graphql/board.js +0 -139
- package/dist/src/graphql/board.js.map +0 -1
- package/dist/src/graphql/data-subscription.d.ts +0 -5
- package/dist/src/graphql/data-subscription.js +0 -24
- package/dist/src/graphql/data-subscription.js.map +0 -1
- package/dist/src/graphql/favorite-board.d.ts +0 -1
- package/dist/src/graphql/favorite-board.js +0 -23
- package/dist/src/graphql/favorite-board.js.map +0 -1
- package/dist/src/graphql/group.d.ts +0 -7
- package/dist/src/graphql/group.js +0 -125
- package/dist/src/graphql/group.js.map +0 -1
- package/dist/src/graphql/index.d.ts +0 -4
- package/dist/src/graphql/index.js +0 -5
- package/dist/src/graphql/index.js.map +0 -1
- package/dist/src/graphql/play-group.d.ts +0 -8
- package/dist/src/graphql/play-group.js +0 -173
- package/dist/src/graphql/play-group.js.map +0 -1
- package/dist/src/graphql/scenario.d.ts +0 -6
- package/dist/src/graphql/scenario.js +0 -69
- package/dist/src/graphql/scenario.js.map +0 -1
- package/dist/src/layers/bouncing-arrow-decorator.d.ts +0 -1
- package/dist/src/layers/bouncing-arrow-decorator.js +0 -40
- package/dist/src/layers/bouncing-arrow-decorator.js.map +0 -1
- package/dist/src/layers/event-handlers.d.ts +0 -1
- package/dist/src/layers/event-handlers.js +0 -70
- package/dist/src/layers/event-handlers.js.map +0 -1
- package/dist/src/layers/mcs-event-handlers.d.ts +0 -1
- package/dist/src/layers/mcs-event-handlers.js +0 -73
- package/dist/src/layers/mcs-event-handlers.js.map +0 -1
- package/dist/src/layers/ox-mini-map.d.ts +0 -1
- package/dist/src/layers/ox-mini-map.js +0 -189
- package/dist/src/layers/ox-mini-map.js.map +0 -1
- package/dist/src/layers/scroll-layer.d.ts +0 -24
- package/dist/src/layers/scroll-layer.js +0 -125
- package/dist/src/layers/scroll-layer.js.map +0 -1
- package/dist/src/layers/shift-handler.d.ts +0 -1
- package/dist/src/layers/shift-handler.js +0 -38
- package/dist/src/layers/shift-handler.js.map +0 -1
- package/dist/src/layers/zoom-handler.d.ts +0 -1
- package/dist/src/layers/zoom-handler.js +0 -36
- package/dist/src/layers/zoom-handler.js.map +0 -1
- package/dist/src/ox-board-viewer-backup.d.ts +0 -64
- package/dist/src/ox-board-viewer-backup.js +0 -529
- package/dist/src/ox-board-viewer-backup.js.map +0 -1
- package/dist/src/ox-board-viewer-other.d.ts +0 -19
- package/dist/src/ox-board-viewer-other.js +0 -82
- package/dist/src/ox-board-viewer-other.js.map +0 -1
|
@@ -1,529 +0,0 @@
|
|
|
1
|
-
import { __decorate } from "tslib";
|
|
2
|
-
import '@material/mwc-fab';
|
|
3
|
-
import '@material/mwc-icon';
|
|
4
|
-
import { css, html, LitElement } from 'lit';
|
|
5
|
-
import { customElement, property, query, state } from 'lit/decorators.js';
|
|
6
|
-
import { create, SCENE_MODE } from '@hatiolab/things-scene';
|
|
7
|
-
import { isIOS, togglefullscreen } from '@operato/utils';
|
|
8
|
-
import { ScrollbarStyles } from '@operato/styles';
|
|
9
|
-
import { DataStorage } from './data-storage/data-storage.js';
|
|
10
|
-
import { DataSubscriptionProviderImpl } from '@fmsim/api/data-subscription.js';
|
|
11
|
-
import { runScenario, startScenario } from '@fmsim/api/scenario.js';
|
|
12
|
-
export let BoardViewer = class BoardViewer extends LitElement {
|
|
13
|
-
constructor() {
|
|
14
|
-
var _a;
|
|
15
|
-
super(...arguments);
|
|
16
|
-
this.baseUrl = '';
|
|
17
|
-
this.board = {};
|
|
18
|
-
this.provider = null;
|
|
19
|
-
this.hideFullscreen = false;
|
|
20
|
-
this.hideNavigation = false;
|
|
21
|
-
this._scene = null;
|
|
22
|
-
this._forward = [];
|
|
23
|
-
this._backward = [];
|
|
24
|
-
this.currentBoardId = (_a = this.board) === null || _a === void 0 ? void 0 : _a.id;
|
|
25
|
-
}
|
|
26
|
-
render() {
|
|
27
|
-
var fullscreen = !isIOS() && !this.hideFullscreen
|
|
28
|
-
? html `
|
|
29
|
-
<mwc-fab
|
|
30
|
-
id="fullscreen"
|
|
31
|
-
.icon=${document.fullscreenElement ? 'fullscreen_exit' : 'fullscreen'}
|
|
32
|
-
@click=${(e) => this.onTapFullscreen()}
|
|
33
|
-
@mouseover=${(e) => this.transientShowButtons(true)}
|
|
34
|
-
@mouseout=${(e) => this.transientShowButtons()}
|
|
35
|
-
title="fullscreen"
|
|
36
|
-
></mwc-fab>
|
|
37
|
-
`
|
|
38
|
-
: html ``;
|
|
39
|
-
var prev = !this.hideNavigation
|
|
40
|
-
? html `
|
|
41
|
-
<mwc-icon
|
|
42
|
-
id="prev"
|
|
43
|
-
@click=${(e) => this.onTapPrev()}
|
|
44
|
-
@mouseover=${(e) => this.transientShowButtons(true)}
|
|
45
|
-
@mouseout=${(e) => this.transientShowButtons()}
|
|
46
|
-
hidden
|
|
47
|
-
>keyboard_arrow_left</mwc-icon
|
|
48
|
-
>
|
|
49
|
-
`
|
|
50
|
-
: html ``;
|
|
51
|
-
var next = !this.hideNavigation
|
|
52
|
-
? html `
|
|
53
|
-
<mwc-icon
|
|
54
|
-
id="next"
|
|
55
|
-
@click=${(e) => this.onTapNext()}
|
|
56
|
-
@mouseover=${(e) => this.transientShowButtons(true)}
|
|
57
|
-
@mouseout=${(e) => this.transientShowButtons()}
|
|
58
|
-
hidden
|
|
59
|
-
>keyboard_arrow_right</mwc-icon
|
|
60
|
-
>
|
|
61
|
-
`
|
|
62
|
-
: html ``;
|
|
63
|
-
return html `
|
|
64
|
-
${prev}
|
|
65
|
-
|
|
66
|
-
<div
|
|
67
|
-
id="target"
|
|
68
|
-
@touchstart=${(e) => this.transientShowButtons()}
|
|
69
|
-
@mousemove=${(e) => this.transientShowButtons()}
|
|
70
|
-
></div>
|
|
71
|
-
|
|
72
|
-
${next} ${fullscreen}
|
|
73
|
-
`;
|
|
74
|
-
}
|
|
75
|
-
connectedCallback() {
|
|
76
|
-
super.connectedCallback();
|
|
77
|
-
window.addEventListener('resize', () => {
|
|
78
|
-
this._scene && this._scene.fit();
|
|
79
|
-
});
|
|
80
|
-
this.renderRoot.addEventListener('close-scene', e => {
|
|
81
|
-
e.preventDefault();
|
|
82
|
-
this.onTapPrev();
|
|
83
|
-
}, false);
|
|
84
|
-
}
|
|
85
|
-
disconnectedCallback() {
|
|
86
|
-
super.disconnectedCallback();
|
|
87
|
-
this.closeScene();
|
|
88
|
-
}
|
|
89
|
-
updated(changes) {
|
|
90
|
-
if (changes.has('board')) {
|
|
91
|
-
this.closeScene();
|
|
92
|
-
if (this.board && this.board.id) {
|
|
93
|
-
if (this.board.model) {
|
|
94
|
-
this.initScene();
|
|
95
|
-
}
|
|
96
|
-
else {
|
|
97
|
-
this.initSceneAsync();
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
if (changes.has('data') && this._scene && this.data) {
|
|
102
|
-
this._scene.data = this.data;
|
|
103
|
-
}
|
|
104
|
-
if (changes.has('values') && this._scene && this.values) {
|
|
105
|
-
this._scene.values = this.values;
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
async initSceneAsync() {
|
|
109
|
-
if (!this.board || !this.board.id)
|
|
110
|
-
return;
|
|
111
|
-
this._scene = await this.provider.create(this.board.id);
|
|
112
|
-
this.setupScene({ id: this.board.id, scene: this._scene });
|
|
113
|
-
}
|
|
114
|
-
initScene() {
|
|
115
|
-
if (!this.board || !this.board.id)
|
|
116
|
-
return;
|
|
117
|
-
this._scene = create({
|
|
118
|
-
model: {
|
|
119
|
-
...this.board.model
|
|
120
|
-
},
|
|
121
|
-
mode: SCENE_MODE.VIEW,
|
|
122
|
-
refProvider: this.provider,
|
|
123
|
-
dataStorage: this.board.id !== 'preview' ? new DataStorage(this.board.id) : undefined,
|
|
124
|
-
dataSubscriptionProvider: new DataSubscriptionProviderImpl()
|
|
125
|
-
});
|
|
126
|
-
if (this.baseUrl) {
|
|
127
|
-
this._scene.baseUrl = this.baseUrl;
|
|
128
|
-
}
|
|
129
|
-
// this.provider!.add(this.board.id, this._scene)
|
|
130
|
-
this.setupScene({ id: this.board.id, scene: this._scene });
|
|
131
|
-
}
|
|
132
|
-
closeScene() {
|
|
133
|
-
if (this._scene) {
|
|
134
|
-
this.unbindSceneEvents(this._scene);
|
|
135
|
-
this._scene.target = null;
|
|
136
|
-
this._scene.release && this._scene.release();
|
|
137
|
-
this._scene = null;
|
|
138
|
-
}
|
|
139
|
-
// delete queued scenes
|
|
140
|
-
this._forward.forEach(({ scene }) => scene.release && scene.release());
|
|
141
|
-
this._forward = [];
|
|
142
|
-
this._backward.forEach(({ scene }) => scene.release && scene.release());
|
|
143
|
-
this._backward = [];
|
|
144
|
-
}
|
|
145
|
-
releaseScene() {
|
|
146
|
-
this.closeScene();
|
|
147
|
-
this.transientShowButtons();
|
|
148
|
-
}
|
|
149
|
-
setupScene({ id, scene }) {
|
|
150
|
-
var _a;
|
|
151
|
-
this._scene = scene;
|
|
152
|
-
const backgroundColor = (_a = this._scene) === null || _a === void 0 ? void 0 : _a.root.state.fillStyle;
|
|
153
|
-
if (typeof backgroundColor === 'string') {
|
|
154
|
-
this.style.backgroundColor = backgroundColor;
|
|
155
|
-
}
|
|
156
|
-
else {
|
|
157
|
-
this.style.backgroundColor = 'initial';
|
|
158
|
-
}
|
|
159
|
-
/* scene의 기존 target을 보관한다. */
|
|
160
|
-
this._oldtarget = this._scene.target;
|
|
161
|
-
this._scene.fit(this._scene.fitMode);
|
|
162
|
-
this._scene.target = this._target;
|
|
163
|
-
if (this.data) {
|
|
164
|
-
this._scene.data = this.data;
|
|
165
|
-
}
|
|
166
|
-
if (this.values) {
|
|
167
|
-
this._scene.values = this.values;
|
|
168
|
-
}
|
|
169
|
-
this.currentBoardId = id;
|
|
170
|
-
this.bindSceneEvents();
|
|
171
|
-
this.transientShowButtons();
|
|
172
|
-
}
|
|
173
|
-
async showScene(boardId, bindingData) {
|
|
174
|
-
if (!boardId)
|
|
175
|
-
return;
|
|
176
|
-
try {
|
|
177
|
-
var scene = await this.provider.get(boardId, true);
|
|
178
|
-
if (scene === this._scene) {
|
|
179
|
-
scene.release && scene.release();
|
|
180
|
-
return;
|
|
181
|
-
}
|
|
182
|
-
if (this._scene) {
|
|
183
|
-
/* old scene을 _backward에 보관한다. */
|
|
184
|
-
this.unbindSceneEvents(this._scene);
|
|
185
|
-
/* 원래의 target에 되돌린다. */
|
|
186
|
-
this._scene.target = this._oldtarget;
|
|
187
|
-
this._backward.push({ id: this.currentBoardId, scene: this._scene });
|
|
188
|
-
}
|
|
189
|
-
this._scene = scene;
|
|
190
|
-
this._forward.forEach(({ scene }) => scene.release && scene.release());
|
|
191
|
-
/* forward를 비운다. */
|
|
192
|
-
this._forward = [];
|
|
193
|
-
this.setupScene({ id: boardId, scene });
|
|
194
|
-
if (bindingData) {
|
|
195
|
-
scene.data = bindingData;
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
catch (e) {
|
|
199
|
-
console.error(e);
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
bindSceneEvents() {
|
|
203
|
-
this._scene.on('run', this.onRunBoard, this);
|
|
204
|
-
this._scene.on('goto', this.onLinkGoto, this);
|
|
205
|
-
this._scene.on('link-open', this.onLinkOpen, this);
|
|
206
|
-
this._scene.on('link-move', this.onLinkMove, this);
|
|
207
|
-
this._scene.on('route-page', this.onRoutePage, this);
|
|
208
|
-
this._scene.on('start-scenario', this.onStartScenario, this);
|
|
209
|
-
this._scene.on('run-scenario', this.onRunScenario, this);
|
|
210
|
-
}
|
|
211
|
-
unbindSceneEvents(scene) {
|
|
212
|
-
scene.off('run', this.onRunBoard, this);
|
|
213
|
-
scene.off('goto', this.onLinkGoto, this);
|
|
214
|
-
scene.off('link-open', this.onLinkOpen, this);
|
|
215
|
-
scene.off('link-move', this.onLinkMove, this);
|
|
216
|
-
scene.off('route-page', this.onRoutePage, this);
|
|
217
|
-
scene.off('start-scenario', this.onStartScenario, this);
|
|
218
|
-
scene.off('run-scenario', this.onRunScenario, this);
|
|
219
|
-
}
|
|
220
|
-
transientShowButtons(stop) {
|
|
221
|
-
var buttons = [];
|
|
222
|
-
!this.hideNavigation && buttons.push(this._next, this._prev);
|
|
223
|
-
!this.hideFullscreen && buttons.push(this._fullscreen);
|
|
224
|
-
if (buttons.length == 0) {
|
|
225
|
-
return;
|
|
226
|
-
}
|
|
227
|
-
if (!this._fade_animations) {
|
|
228
|
-
this._fade_animations = buttons
|
|
229
|
-
.filter(button => button)
|
|
230
|
-
.map(button => {
|
|
231
|
-
let animation = button.animate([
|
|
232
|
-
{
|
|
233
|
-
opacity: 1,
|
|
234
|
-
easing: 'ease-in'
|
|
235
|
-
},
|
|
236
|
-
{ opacity: 0 }
|
|
237
|
-
], { delay: 1000, duration: 2000 });
|
|
238
|
-
animation.onfinish = () => {
|
|
239
|
-
button.setAttribute('hidden', '');
|
|
240
|
-
};
|
|
241
|
-
return animation;
|
|
242
|
-
});
|
|
243
|
-
}
|
|
244
|
-
this._forward.length <= 0 ? this._next.setAttribute('hidden', '') : this._next.removeAttribute('hidden');
|
|
245
|
-
this._backward.length <= 0 ? this._prev.setAttribute('hidden', '') : this._prev.removeAttribute('hidden');
|
|
246
|
-
this._fullscreen && this._fullscreen.removeAttribute('hidden');
|
|
247
|
-
this._fade_animations.forEach(animation => {
|
|
248
|
-
animation.cancel();
|
|
249
|
-
if (stop)
|
|
250
|
-
return;
|
|
251
|
-
animation.play();
|
|
252
|
-
});
|
|
253
|
-
}
|
|
254
|
-
/* event handlers */
|
|
255
|
-
onTapNext() {
|
|
256
|
-
var { id, scene } = this._forward.pop() || {};
|
|
257
|
-
if (!scene)
|
|
258
|
-
return;
|
|
259
|
-
if (this._scene) {
|
|
260
|
-
this._scene.target = null;
|
|
261
|
-
/* 원래의 target에 되돌린다. */
|
|
262
|
-
this._scene.target = this._oldtarget;
|
|
263
|
-
this.unbindSceneEvents(this._scene);
|
|
264
|
-
this._backward.push({ id: id, scene: this._scene });
|
|
265
|
-
}
|
|
266
|
-
this.setupScene({ id: id, scene });
|
|
267
|
-
}
|
|
268
|
-
onTapPrev() {
|
|
269
|
-
var { id, scene } = this._backward.pop() || {};
|
|
270
|
-
if (!scene)
|
|
271
|
-
return;
|
|
272
|
-
if (this._scene) {
|
|
273
|
-
this._scene.target = null;
|
|
274
|
-
/* 원래의 target에 되돌린다. */
|
|
275
|
-
this._scene.target = this._oldtarget;
|
|
276
|
-
this.unbindSceneEvents(this._scene);
|
|
277
|
-
this._forward.push({ id: id, scene: this._scene });
|
|
278
|
-
}
|
|
279
|
-
this.setupScene({ id: id, scene });
|
|
280
|
-
}
|
|
281
|
-
onTapFullscreen() {
|
|
282
|
-
togglefullscreen(this, () => this.requestUpdate(), () => this.requestUpdate());
|
|
283
|
-
}
|
|
284
|
-
onRunBoard() {
|
|
285
|
-
this.dispatchEvent(new CustomEvent('run-board', { bubbles: true, composed: true, detail: this.board.id }));
|
|
286
|
-
}
|
|
287
|
-
onLinkGoto(targetBoardId, options, fromComponent) {
|
|
288
|
-
var _a;
|
|
289
|
-
const { input, output } = options || { input: '(self)' };
|
|
290
|
-
const data = input && ((_a = fromComponent.root.findFirst(input, fromComponent)) === null || _a === void 0 ? void 0 : _a.data);
|
|
291
|
-
this.showScene(targetBoardId, data);
|
|
292
|
-
}
|
|
293
|
-
onLinkOpen(url, value, fromComponent) {
|
|
294
|
-
if (!url)
|
|
295
|
-
return;
|
|
296
|
-
try {
|
|
297
|
-
window.open(url);
|
|
298
|
-
}
|
|
299
|
-
catch (ex) {
|
|
300
|
-
document.dispatchEvent(new CustomEvent('notify', {
|
|
301
|
-
detail: {
|
|
302
|
-
level: 'error',
|
|
303
|
-
message: ex,
|
|
304
|
-
ex
|
|
305
|
-
}
|
|
306
|
-
}));
|
|
307
|
-
}
|
|
308
|
-
}
|
|
309
|
-
onLinkMove(url, value, fromComponent) {
|
|
310
|
-
if (!url)
|
|
311
|
-
return;
|
|
312
|
-
location.href = url;
|
|
313
|
-
}
|
|
314
|
-
onRoutePage(page) {
|
|
315
|
-
if (!page) {
|
|
316
|
-
return;
|
|
317
|
-
}
|
|
318
|
-
history.pushState({}, '', page);
|
|
319
|
-
window.dispatchEvent(new Event('popstate'));
|
|
320
|
-
}
|
|
321
|
-
async onStartScenario(scenario, value, component) {
|
|
322
|
-
try {
|
|
323
|
-
await startScenario(scenario, scenario, value);
|
|
324
|
-
}
|
|
325
|
-
catch (e) {
|
|
326
|
-
console.error(e);
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
|
-
async onRunScenario(scenario, value, component) {
|
|
330
|
-
try {
|
|
331
|
-
component.data = await runScenario(scenario, value);
|
|
332
|
-
}
|
|
333
|
-
catch (e) {
|
|
334
|
-
console.error(e);
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
|
-
getSceneData() {
|
|
338
|
-
var _a;
|
|
339
|
-
return (_a = this._scene) === null || _a === void 0 ? void 0 : _a.data;
|
|
340
|
-
}
|
|
341
|
-
getSceneValues() {
|
|
342
|
-
var _a;
|
|
343
|
-
return (_a = this._scene) === null || _a === void 0 ? void 0 : _a.values;
|
|
344
|
-
}
|
|
345
|
-
async getSceneImageData(base64 = false) {
|
|
346
|
-
if (!this._scene) {
|
|
347
|
-
return;
|
|
348
|
-
}
|
|
349
|
-
var { width, height } = this._scene.model;
|
|
350
|
-
var pixelRatio = window.devicePixelRatio;
|
|
351
|
-
// 1. Scene의 바운드에 근거하여, 오프스크린 캔바스를 만든다.
|
|
352
|
-
var canvas = document.createElement('canvas');
|
|
353
|
-
canvas.width = Number(width);
|
|
354
|
-
canvas.height = Number(height);
|
|
355
|
-
var root = this._scene.root;
|
|
356
|
-
// 2. 모델레이어의 원래 위치와 스케일을 저장한다.
|
|
357
|
-
var translate = root.get('translate');
|
|
358
|
-
var scale = root.get('scale');
|
|
359
|
-
// 3. 위치와 스케일 기본 설정.
|
|
360
|
-
root.set('translate', { x: 0, y: 0 });
|
|
361
|
-
root.set('scale', { x: 1 / pixelRatio, y: 1 / pixelRatio });
|
|
362
|
-
// 4. 오프스크린 캔바스의 Context2D를 구한뒤, 모델레이어를 그 위에 그린다.
|
|
363
|
-
var context = canvas.getContext('2d');
|
|
364
|
-
root.draw(context);
|
|
365
|
-
root.set('translate', translate);
|
|
366
|
-
root.set('scale', scale);
|
|
367
|
-
var data = base64 ? canvas.toDataURL() : context.getImageData(0, 0, width, height).data;
|
|
368
|
-
return {
|
|
369
|
-
width,
|
|
370
|
-
height,
|
|
371
|
-
data
|
|
372
|
-
};
|
|
373
|
-
}
|
|
374
|
-
async printTrick(image) {
|
|
375
|
-
var _a;
|
|
376
|
-
var viewTarget = null;
|
|
377
|
-
var printTarget = null;
|
|
378
|
-
if (!image) {
|
|
379
|
-
image = (_a = (await this.getSceneImageData(true))) === null || _a === void 0 ? void 0 : _a.data;
|
|
380
|
-
}
|
|
381
|
-
printTarget = document.createElement('img');
|
|
382
|
-
printTarget.id = 'target';
|
|
383
|
-
printTarget.src = image;
|
|
384
|
-
printTarget.style.width = '100%';
|
|
385
|
-
printTarget.style.height = '100%';
|
|
386
|
-
const x = (mql) => {
|
|
387
|
-
if (mql.matches) {
|
|
388
|
-
if (!viewTarget) {
|
|
389
|
-
viewTarget = this.renderRoot.getElementById('target');
|
|
390
|
-
this.renderRoot.replaceChild(printTarget, viewTarget);
|
|
391
|
-
}
|
|
392
|
-
}
|
|
393
|
-
else {
|
|
394
|
-
this.renderRoot.replaceChild(viewTarget, printTarget);
|
|
395
|
-
printTarget.remove();
|
|
396
|
-
mediaQueryList.removeEventListener('change', x);
|
|
397
|
-
}
|
|
398
|
-
};
|
|
399
|
-
if (window.matchMedia) {
|
|
400
|
-
var mediaQueryList = window.matchMedia('print');
|
|
401
|
-
mediaQueryList.addEventListener('change', x);
|
|
402
|
-
}
|
|
403
|
-
}
|
|
404
|
-
};
|
|
405
|
-
BoardViewer.styles = [
|
|
406
|
-
ScrollbarStyles,
|
|
407
|
-
css `
|
|
408
|
-
:host {
|
|
409
|
-
display: flex;
|
|
410
|
-
flex-direction: column;
|
|
411
|
-
|
|
412
|
-
position: relative;
|
|
413
|
-
|
|
414
|
-
width: 100%; /* 전체화면보기를 위해서 필요함. */
|
|
415
|
-
overflow: hidden;
|
|
416
|
-
}
|
|
417
|
-
|
|
418
|
-
#target {
|
|
419
|
-
flex: 1;
|
|
420
|
-
|
|
421
|
-
width: 100%; /* 전체화면보기를 위해서 필요함. */
|
|
422
|
-
height: 100%;
|
|
423
|
-
|
|
424
|
-
outline: 0;
|
|
425
|
-
}
|
|
426
|
-
|
|
427
|
-
/* navigation buttons */
|
|
428
|
-
mwc-icon {
|
|
429
|
-
z-index: 10;
|
|
430
|
-
position: absolute;
|
|
431
|
-
top: 45%;
|
|
432
|
-
min-width: 50px;
|
|
433
|
-
width: 50px;
|
|
434
|
-
height: 50px;
|
|
435
|
-
margin: 0;
|
|
436
|
-
padding: 0;
|
|
437
|
-
color: #fff;
|
|
438
|
-
user-select: none;
|
|
439
|
-
|
|
440
|
-
--mdc-icon-size: 3em;
|
|
441
|
-
}
|
|
442
|
-
|
|
443
|
-
mwc-icon[hidden] {
|
|
444
|
-
display: none;
|
|
445
|
-
}
|
|
446
|
-
|
|
447
|
-
mwc-icon:hover {
|
|
448
|
-
background-color: rgba(0, 0, 0, 0.2);
|
|
449
|
-
border-radius: 50%;
|
|
450
|
-
}
|
|
451
|
-
|
|
452
|
-
#prev {
|
|
453
|
-
left: 5px;
|
|
454
|
-
}
|
|
455
|
-
|
|
456
|
-
#next {
|
|
457
|
-
right: 5px;
|
|
458
|
-
}
|
|
459
|
-
|
|
460
|
-
#fullscreen {
|
|
461
|
-
position: absolute;
|
|
462
|
-
bottom: 15px;
|
|
463
|
-
right: 16px;
|
|
464
|
-
}
|
|
465
|
-
|
|
466
|
-
[hidden] {
|
|
467
|
-
display: none;
|
|
468
|
-
}
|
|
469
|
-
|
|
470
|
-
@media print {
|
|
471
|
-
mwc-fab,
|
|
472
|
-
mwc-icon {
|
|
473
|
-
display: none;
|
|
474
|
-
}
|
|
475
|
-
}
|
|
476
|
-
`
|
|
477
|
-
];
|
|
478
|
-
__decorate([
|
|
479
|
-
property({ type: String })
|
|
480
|
-
], BoardViewer.prototype, "baseUrl", void 0);
|
|
481
|
-
__decorate([
|
|
482
|
-
property({ type: Object })
|
|
483
|
-
], BoardViewer.prototype, "board", void 0);
|
|
484
|
-
__decorate([
|
|
485
|
-
property({ type: Object })
|
|
486
|
-
], BoardViewer.prototype, "provider", void 0);
|
|
487
|
-
__decorate([
|
|
488
|
-
property({ type: Object })
|
|
489
|
-
], BoardViewer.prototype, "data", void 0);
|
|
490
|
-
__decorate([
|
|
491
|
-
property({ type: Object })
|
|
492
|
-
], BoardViewer.prototype, "values", void 0);
|
|
493
|
-
__decorate([
|
|
494
|
-
property({ type: Boolean, reflect: true, attribute: 'hide-fullscreen' })
|
|
495
|
-
], BoardViewer.prototype, "hideFullscreen", void 0);
|
|
496
|
-
__decorate([
|
|
497
|
-
property({ type: Boolean, reflect: true, attribute: 'hide-navigation' })
|
|
498
|
-
], BoardViewer.prototype, "hideNavigation", void 0);
|
|
499
|
-
__decorate([
|
|
500
|
-
state()
|
|
501
|
-
], BoardViewer.prototype, "_scene", void 0);
|
|
502
|
-
__decorate([
|
|
503
|
-
state()
|
|
504
|
-
], BoardViewer.prototype, "_forward", void 0);
|
|
505
|
-
__decorate([
|
|
506
|
-
state()
|
|
507
|
-
], BoardViewer.prototype, "_backward", void 0);
|
|
508
|
-
__decorate([
|
|
509
|
-
state()
|
|
510
|
-
], BoardViewer.prototype, "_oldtarget", void 0);
|
|
511
|
-
__decorate([
|
|
512
|
-
state()
|
|
513
|
-
], BoardViewer.prototype, "_fade_animations", void 0);
|
|
514
|
-
__decorate([
|
|
515
|
-
query('#target')
|
|
516
|
-
], BoardViewer.prototype, "_target", void 0);
|
|
517
|
-
__decorate([
|
|
518
|
-
query('#prev')
|
|
519
|
-
], BoardViewer.prototype, "_prev", void 0);
|
|
520
|
-
__decorate([
|
|
521
|
-
query('#next')
|
|
522
|
-
], BoardViewer.prototype, "_next", void 0);
|
|
523
|
-
__decorate([
|
|
524
|
-
query('#fullscreen')
|
|
525
|
-
], BoardViewer.prototype, "_fullscreen", void 0);
|
|
526
|
-
BoardViewer = __decorate([
|
|
527
|
-
customElement('ox-board-viewer')
|
|
528
|
-
], BoardViewer);
|
|
529
|
-
//# sourceMappingURL=ox-board-viewer-backup.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ox-board-viewer-backup.js","sourceRoot":"","sources":["../../src/ox-board-viewer-backup.ts"],"names":[],"mappings":";AAAA,OAAO,mBAAmB,CAAA;AAC1B,OAAO,oBAAoB,CAAA;AAE3B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAkB,MAAM,KAAK,CAAA;AAC3D,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAEzE,OAAO,EAAa,MAAM,EAAqB,UAAU,EAAE,MAAM,wBAAwB,CAAA;AACzF,OAAO,EAAE,KA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@material/mwc-fab'\nimport '@material/mwc-icon'\n\nimport { css, html, LitElement, PropertyValues } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\n\nimport { Component, create, ReferenceProvider, SCENE_MODE } from '@hatiolab/things-scene'\nimport { isIOS, togglefullscreen } from '@operato/utils'\nimport { ScrollbarStyles } from '@operato/styles'\n\nimport { DataStorage } from './data-storage/data-storage.js'\nimport { DataSubscriptionProviderImpl } from '@fmsim/api/data-subscription.js'\nimport { runScenario, startScenario } from '@fmsim/api/scenario.js'\n\n@customElement('ox-board-viewer')\nexport class BoardViewer extends LitElement {\n static styles = [\n ScrollbarStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n\n position: relative;\n\n width: 100%; /* 전체화면보기를 위해서 필요함. */\n overflow: hidden;\n }\n\n #target {\n flex: 1;\n\n width: 100%; /* 전체화면보기를 위해서 필요함. */\n height: 100%;\n\n outline: 0;\n }\n\n /* navigation buttons */\n mwc-icon {\n z-index: 10;\n position: absolute;\n top: 45%;\n min-width: 50px;\n width: 50px;\n height: 50px;\n margin: 0;\n padding: 0;\n color: #fff;\n user-select: none;\n\n --mdc-icon-size: 3em;\n }\n\n mwc-icon[hidden] {\n display: none;\n }\n\n mwc-icon:hover {\n background-color: rgba(0, 0, 0, 0.2);\n border-radius: 50%;\n }\n\n #prev {\n left: 5px;\n }\n\n #next {\n right: 5px;\n }\n\n #fullscreen {\n position: absolute;\n bottom: 15px;\n right: 16px;\n }\n\n [hidden] {\n display: none;\n }\n\n @media print {\n mwc-fab,\n mwc-icon {\n display: none;\n }\n }\n `\n ]\n\n @property({ type: String }) baseUrl: string = ''\n @property({ type: Object }) board: any = {}\n @property({ type: Object }) provider: ReferenceProvider | null = null\n @property({ type: Object }) data: any\n @property({ type: Object }) values: any\n\n @property({ type: Boolean, reflect: true, attribute: 'hide-fullscreen' }) hideFullscreen = false\n @property({ type: Boolean, reflect: true, attribute: 'hide-navigation' }) hideNavigation = false\n\n @state() _scene: any = null\n @state() _forward: { id: string; scene: any }[] = []\n @state() _backward: { id: string; scene: any }[] = []\n\n @state() _oldtarget?: HTMLElement\n @state() _fade_animations?: Array<Animation>\n\n public currentBoardId?: string = this.board?.id\n\n @query('#target') _target!: HTMLElement\n @query('#prev') _prev!: HTMLElement\n @query('#next') _next!: HTMLElement\n @query('#fullscreen') _fullscreen!: HTMLElement\n\n render() {\n var fullscreen =\n !isIOS() && !this.hideFullscreen\n ? html`\n <mwc-fab\n id=\"fullscreen\"\n .icon=${document.fullscreenElement ? 'fullscreen_exit' : 'fullscreen'}\n @click=${(e: Event) => this.onTapFullscreen()}\n @mouseover=${(e: Event) => this.transientShowButtons(true)}\n @mouseout=${(e: Event) => this.transientShowButtons()}\n title=\"fullscreen\"\n ></mwc-fab>\n `\n : html``\n\n var prev = !this.hideNavigation\n ? html`\n <mwc-icon\n id=\"prev\"\n @click=${(e: Event) => this.onTapPrev()}\n @mouseover=${(e: Event) => this.transientShowButtons(true)}\n @mouseout=${(e: Event) => this.transientShowButtons()}\n hidden\n >keyboard_arrow_left</mwc-icon\n >\n `\n : html``\n\n var next = !this.hideNavigation\n ? html`\n <mwc-icon\n id=\"next\"\n @click=${(e: Event) => this.onTapNext()}\n @mouseover=${(e: Event) => this.transientShowButtons(true)}\n @mouseout=${(e: Event) => this.transientShowButtons()}\n hidden\n >keyboard_arrow_right</mwc-icon\n >\n `\n : html``\n\n return html`\n ${prev}\n\n <div\n id=\"target\"\n @touchstart=${(e: Event) => this.transientShowButtons()}\n @mousemove=${(e: Event) => this.transientShowButtons()}\n ></div>\n\n ${next} ${fullscreen}\n `\n }\n\n connectedCallback() {\n super.connectedCallback()\n\n window.addEventListener('resize', () => {\n this._scene && this._scene.fit()\n })\n\n this.renderRoot.addEventListener(\n 'close-scene',\n e => {\n e.preventDefault()\n this.onTapPrev()\n },\n false\n )\n }\n\n disconnectedCallback() {\n super.disconnectedCallback()\n\n this.closeScene()\n }\n\n updated(changes: PropertyValues<this>) {\n if (changes.has('board')) {\n this.closeScene()\n\n if (this.board && this.board.id) {\n if (this.board.model) {\n this.initScene()\n } else {\n this.initSceneAsync()\n }\n }\n }\n\n if (changes.has('data') && this._scene && this.data) {\n this._scene.data = this.data\n }\n\n if (changes.has('values') && this._scene && this.values) {\n this._scene.values = this.values\n }\n }\n\n async initSceneAsync() {\n if (!this.board || !this.board.id) return\n\n this._scene = await this.provider!.create(this.board.id)\n this.setupScene({ id: this.board.id, scene: this._scene })\n }\n\n initScene() {\n if (!this.board || !this.board.id) return\n\n this._scene = create({\n model: {\n ...this.board.model\n },\n mode: SCENE_MODE.VIEW,\n refProvider: this.provider!,\n dataStorage: this.board.id !== 'preview' ? new DataStorage(this.board.id) : undefined,\n dataSubscriptionProvider: new DataSubscriptionProviderImpl()\n })\n\n if (this.baseUrl) {\n this._scene.baseUrl = this.baseUrl\n }\n\n // this.provider!.add(this.board.id, this._scene)\n\n this.setupScene({ id: this.board.id, scene: this._scene })\n }\n\n closeScene() {\n if (this._scene) {\n this.unbindSceneEvents(this._scene)\n\n this._scene.target = null\n this._scene.release && this._scene.release()\n\n this._scene = null\n }\n\n // delete queued scenes\n this._forward.forEach(({ scene }) => scene.release && scene.release())\n this._forward = []\n\n this._backward.forEach(({ scene }) => scene.release && scene.release())\n this._backward = []\n }\n\n releaseScene() {\n this.closeScene()\n this.transientShowButtons()\n }\n\n setupScene({ id, scene }: { id: string; scene: any }) {\n this._scene = scene\n\n const backgroundColor = this._scene?.root.state.fillStyle\n if (typeof backgroundColor === 'string') {\n this.style.backgroundColor = backgroundColor\n } else {\n this.style.backgroundColor = 'initial'\n }\n\n /* scene의 기존 target을 보관한다. */\n this._oldtarget = this._scene.target\n\n this._scene.fit(this._scene.fitMode)\n this._scene.target = this._target\n\n if (this.data) {\n this._scene.data = this.data\n }\n if (this.values) {\n this._scene.values = this.values\n }\n this.currentBoardId = id\n\n this.bindSceneEvents()\n\n this.transientShowButtons()\n }\n\n async showScene(boardId: string, bindingData?: any) {\n if (!boardId) return\n\n try {\n var scene = await this.provider!.get(boardId, true)\n\n if (scene === this._scene) {\n scene.release && scene.release()\n return\n }\n\n if (this._scene) {\n /* old scene을 _backward에 보관한다. */\n this.unbindSceneEvents(this._scene)\n /* 원래의 target에 되돌린다. */\n this._scene.target = this._oldtarget\n this._backward.push({ id: this.currentBoardId!, scene: this._scene })\n }\n\n this._scene = scene\n\n this._forward.forEach(({ scene }) => scene.release && scene.release())\n\n /* forward를 비운다. */\n this._forward = []\n\n this.setupScene({ id: boardId, scene })\n\n if (bindingData) {\n scene.data = bindingData\n }\n } catch (e) {\n console.error(e)\n }\n }\n\n bindSceneEvents() {\n this._scene.on('run', this.onRunBoard, this)\n this._scene.on('goto', this.onLinkGoto, this)\n this._scene.on('link-open', this.onLinkOpen, this)\n this._scene.on('link-move', this.onLinkMove, this)\n this._scene.on('route-page', this.onRoutePage, this)\n this._scene.on('start-scenario', this.onStartScenario, this)\n this._scene.on('run-scenario', this.onRunScenario, this)\n }\n\n unbindSceneEvents(scene: any) {\n scene.off('run', this.onRunBoard, this)\n scene.off('goto', this.onLinkGoto, this)\n scene.off('link-open', this.onLinkOpen, this)\n scene.off('link-move', this.onLinkMove, this)\n scene.off('route-page', this.onRoutePage, this)\n scene.off('start-scenario', this.onStartScenario, this)\n scene.off('run-scenario', this.onRunScenario, this)\n }\n\n transientShowButtons(stop?: boolean) {\n var buttons = []\n !this.hideNavigation && buttons.push(this._next, this._prev)\n !this.hideFullscreen && buttons.push(this._fullscreen)\n\n if (buttons.length == 0) {\n return\n }\n\n if (!this._fade_animations) {\n this._fade_animations = buttons\n .filter(button => button)\n .map(button => {\n let animation = button.animate(\n [\n {\n opacity: 1,\n easing: 'ease-in'\n },\n { opacity: 0 }\n ],\n { delay: 1000, duration: 2000 }\n )\n\n animation.onfinish = () => {\n button.setAttribute('hidden', '')\n }\n\n return animation\n })\n }\n\n this._forward.length <= 0 ? this._next.setAttribute('hidden', '') : this._next.removeAttribute('hidden')\n this._backward.length <= 0 ? this._prev.setAttribute('hidden', '') : this._prev.removeAttribute('hidden')\n this._fullscreen && this._fullscreen.removeAttribute('hidden')\n\n this._fade_animations.forEach(animation => {\n animation.cancel()\n if (stop) return\n\n animation.play()\n })\n }\n\n /* event handlers */\n\n onTapNext() {\n var { id, scene } = this._forward.pop() || {}\n if (!scene) return\n\n if (this._scene) {\n this._scene.target = null\n /* 원래의 target에 되돌린다. */\n this._scene.target = this._oldtarget\n this.unbindSceneEvents(this._scene)\n this._backward.push({ id: id!, scene: this._scene })\n }\n\n this.setupScene({ id: id!, scene })\n }\n\n onTapPrev() {\n var { id, scene } = this._backward.pop() || {}\n if (!scene) return\n\n if (this._scene) {\n this._scene.target = null\n /* 원래의 target에 되돌린다. */\n this._scene.target = this._oldtarget\n this.unbindSceneEvents(this._scene)\n this._forward.push({ id: id!, scene: this._scene })\n }\n\n this.setupScene({ id: id!, scene })\n }\n\n onTapFullscreen() {\n togglefullscreen(\n this,\n () => this.requestUpdate(),\n () => this.requestUpdate()\n )\n }\n\n onRunBoard() {\n this.dispatchEvent(new CustomEvent('run-board', { bubbles: true, composed: true, detail: this.board.id }))\n }\n\n onLinkGoto(targetBoardId: string, options: any, fromComponent: any) {\n const { input, output } = options || { input: '(self)' }\n const data = input && fromComponent.root.findFirst(input, fromComponent)?.data\n this.showScene(targetBoardId, data)\n }\n\n onLinkOpen(url: string, value: any, fromComponent: Component) {\n if (!url) return\n\n try {\n window.open(url)\n } catch (ex) {\n document.dispatchEvent(\n new CustomEvent('notify', {\n detail: {\n level: 'error',\n message: ex,\n ex\n }\n })\n )\n }\n }\n\n onLinkMove(url: string, value: any, fromComponent: Component) {\n if (!url) return\n\n location.href = url\n }\n\n onRoutePage(page: string) {\n if (!page) {\n return\n }\n\n history.pushState({}, '', page)\n window.dispatchEvent(new Event('popstate'))\n }\n\n async onStartScenario(scenario: string, value: string | number | object, component: Component) {\n try {\n await startScenario(scenario, scenario, value)\n } catch (e) {\n console.error(e)\n }\n }\n\n async onRunScenario(scenario: string, value: string | number | object, component: Component) {\n try {\n component.data = await runScenario(scenario, value)\n } catch (e) {\n console.error(e)\n }\n }\n\n getSceneData() {\n return this._scene?.data\n }\n\n getSceneValues() {\n return this._scene?.values\n }\n\n async getSceneImageData(base64 = false) {\n if (!this._scene) {\n return\n }\n\n var { width, height } = this._scene.model\n var pixelRatio = window.devicePixelRatio\n\n // 1. Scene의 바운드에 근거하여, 오프스크린 캔바스를 만든다.\n var canvas = document.createElement('canvas')\n canvas.width = Number(width)\n canvas.height = Number(height)\n\n var root = this._scene.root\n // 2. 모델레이어의 원래 위치와 스케일을 저장한다.\n var translate = root.get('translate')\n var scale = root.get('scale')\n\n // 3. 위치와 스케일 기본 설정.\n root.set('translate', { x: 0, y: 0 })\n root.set('scale', { x: 1 / pixelRatio, y: 1 / pixelRatio })\n\n // 4. 오프스크린 캔바스의 Context2D를 구한뒤, 모델레이어를 그 위에 그린다.\n var context = canvas.getContext('2d')\n\n root.draw(context)\n\n root.set('translate', translate)\n root.set('scale', scale)\n\n var data = base64 ? canvas.toDataURL() : context!.getImageData(0, 0, width, height).data\n\n return {\n width,\n height,\n data\n }\n }\n\n async printTrick(image: string) {\n var viewTarget: HTMLElement | null = null\n var printTarget: HTMLImageElement | null = null\n\n if (!image) {\n image = (await this.getSceneImageData(true))?.data as string\n }\n\n printTarget = document.createElement('img')\n printTarget.id = 'target'\n printTarget.src = image\n printTarget.style.width = '100%'\n printTarget.style.height = '100%'\n\n const x = (mql: MediaQueryListEvent) => {\n if (mql.matches) {\n if (!viewTarget) {\n viewTarget = (this.renderRoot as ShadowRoot)!.getElementById('target')\n this.renderRoot.replaceChild(printTarget!, viewTarget!)\n }\n } else {\n this.renderRoot.replaceChild(viewTarget!, printTarget!)\n printTarget!.remove()\n mediaQueryList.removeEventListener('change', x)\n }\n }\n\n if (window.matchMedia) {\n var mediaQueryList = window.matchMedia('print')\n mediaQueryList.addEventListener('change', x)\n }\n }\n}\n"]}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import '@material/mwc-fab';
|
|
2
|
-
import '@hatiolab/things-scene';
|
|
3
|
-
import './layers/zoom-handler.js';
|
|
4
|
-
import './layers/shift-handler.js';
|
|
5
|
-
import './modeller/scene-viewer/ox-scene-handler.js';
|
|
6
|
-
import './modeller/scene-viewer/ox-scene-layer.js';
|
|
7
|
-
import './modeller/scene-viewer/ox-scene-viewer.js';
|
|
8
|
-
import { LitElement } from 'lit';
|
|
9
|
-
import { ReferenceProvider, Scene, SCENE_MODE } from '@hatiolab/things-scene';
|
|
10
|
-
export declare class BoardViewer extends LitElement {
|
|
11
|
-
static styles: import("lit").CSSResult[];
|
|
12
|
-
board: any;
|
|
13
|
-
baseUrl: string;
|
|
14
|
-
mode: SCENE_MODE;
|
|
15
|
-
provider: ReferenceProvider | null;
|
|
16
|
-
scene?: Scene;
|
|
17
|
-
render(): import("lit-html").TemplateResult<1>;
|
|
18
|
-
closeScene(): void;
|
|
19
|
-
}
|