@fmsim/board 2.0.0-beta.10 → 2.0.0-beta.102
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 +7903 -3748
- package/demo/index-modeller.html +1 -1
- package/demo/index-player.html +2 -2
- package/demo/index-viewer.html +2 -2
- package/demo/index.html +2 -2
- package/dist/src/component/etc.js +36 -0
- package/dist/src/component/etc.js.map +1 -1
- package/dist/src/component/index.d.ts +1 -0
- package/dist/src/component/index.js +1 -0
- package/dist/src/component/index.js.map +1 -1
- package/dist/src/component/restful-property-editor-backdrop-faces.d.ts +50 -0
- package/dist/src/component/restful-property-editor-backdrop-faces.js +524 -0
- package/dist/src/component/restful-property-editor-backdrop-faces.js.map +1 -0
- package/dist/src/data-storage/board-model-cache.d.ts +13 -0
- package/dist/src/data-storage/board-model-cache.js +66 -0
- package/dist/src/data-storage/board-model-cache.js.map +1 -0
- package/dist/src/index.d.ts +3 -0
- package/dist/src/index.js +2 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/layers/mcs-mouse-event-handler.js +8 -0
- package/dist/src/layers/mcs-mouse-event-handler.js.map +1 -1
- package/dist/src/layers/movement-layer.d.ts +4 -4
- package/dist/src/layers/movement-layer.js +16 -8
- package/dist/src/layers/movement-layer.js.map +1 -1
- package/dist/src/modeller/bulk-create-dialog.d.ts +51 -0
- package/dist/src/modeller/bulk-create-dialog.js +531 -0
- package/dist/src/modeller/bulk-create-dialog.js.map +1 -0
- package/dist/src/modeller/bulk-create.d.ts +101 -0
- package/dist/src/modeller/bulk-create.js +199 -0
- package/dist/src/modeller/bulk-create.js.map +1 -0
- package/dist/src/modeller/component-toolbar/component-menu.d.ts +1 -1
- package/dist/src/modeller/component-toolbar/component-toolbar.d.ts +1 -1
- package/dist/src/modeller/edit-toolbar.d.ts +13 -0
- package/dist/src/modeller/edit-toolbar.js +168 -7
- package/dist/src/modeller/edit-toolbar.js.map +1 -1
- package/dist/src/modeller/property-sidebar/abstract-property.js +10 -2
- package/dist/src/modeller/property-sidebar/abstract-property.js.map +1 -1
- package/dist/src/modeller/property-sidebar/data-binding/data-binding.d.ts +1 -1
- package/dist/src/modeller/property-sidebar/effects/effects.d.ts +10 -1
- package/dist/src/modeller/property-sidebar/effects/effects.js +66 -1
- package/dist/src/modeller/property-sidebar/effects/effects.js.map +1 -1
- package/dist/src/modeller/property-sidebar/effects/event-handler-adapter.d.ts +44 -0
- package/dist/src/modeller/property-sidebar/effects/event-handler-adapter.js +70 -0
- package/dist/src/modeller/property-sidebar/effects/event-handler-adapter.js.map +1 -0
- package/dist/src/modeller/property-sidebar/effects/property-event.d.ts +13 -3
- package/dist/src/modeller/property-sidebar/effects/property-event.js +20 -11
- package/dist/src/modeller/property-sidebar/effects/property-event.js.map +1 -1
- package/dist/src/modeller/property-sidebar/inspector/inspector-controller.d.ts +62 -0
- package/dist/src/modeller/property-sidebar/inspector/inspector-controller.js +276 -0
- package/dist/src/modeller/property-sidebar/inspector/inspector-controller.js.map +1 -0
- package/dist/src/modeller/property-sidebar/inspector/inspector-group-view.d.ts +15 -0
- package/dist/src/modeller/property-sidebar/inspector/inspector-group-view.js +56 -0
- package/dist/src/modeller/property-sidebar/inspector/inspector-group-view.js.map +1 -0
- package/dist/src/modeller/property-sidebar/inspector/inspector-highlight.d.ts +7 -0
- package/dist/src/modeller/property-sidebar/inspector/inspector-highlight.js +25 -0
- package/dist/src/modeller/property-sidebar/inspector/inspector-highlight.js.map +1 -0
- package/dist/src/modeller/property-sidebar/inspector/inspector-model.d.ts +44 -0
- package/dist/src/modeller/property-sidebar/inspector/inspector-model.js +72 -0
- package/dist/src/modeller/property-sidebar/inspector/inspector-model.js.map +1 -0
- package/dist/src/modeller/property-sidebar/inspector/inspector-tree-view.d.ts +18 -0
- package/dist/src/modeller/property-sidebar/inspector/inspector-tree-view.js +61 -0
- package/dist/src/modeller/property-sidebar/inspector/inspector-tree-view.js.map +1 -0
- package/dist/src/modeller/property-sidebar/inspector/inspector.d.ts +17 -12
- package/dist/src/modeller/property-sidebar/inspector/inspector.js +281 -151
- package/dist/src/modeller/property-sidebar/inspector/inspector.js.map +1 -1
- package/dist/src/modeller/property-sidebar/property-sidebar.d.ts +1 -1
- package/dist/src/modeller/property-sidebar/shapes/ox-input-entity-id.d.ts +75 -0
- package/dist/src/modeller/property-sidebar/shapes/ox-input-entity-id.js +346 -0
- package/dist/src/modeller/property-sidebar/shapes/ox-input-entity-id.js.map +1 -0
- package/dist/src/modeller/property-sidebar/shapes/shapes.d.ts +22 -1
- package/dist/src/modeller/property-sidebar/shapes/shapes.js +94 -2
- package/dist/src/modeller/property-sidebar/shapes/shapes.js.map +1 -1
- package/dist/src/modeller/property-sidebar/specifics/specifics.d.ts +25 -1
- package/dist/src/modeller/property-sidebar/specifics/specifics.js +112 -2
- package/dist/src/modeller/property-sidebar/specifics/specifics.js.map +1 -1
- package/dist/src/modeller/property-sidebar/styles/styles.d.ts +1 -1
- package/dist/src/modeller/scene-viewer/ox-scene-layer.d.ts +4 -3
- package/dist/src/modeller/scene-viewer/ox-scene-layer.js +2 -1
- package/dist/src/modeller/scene-viewer/ox-scene-layer.js.map +1 -1
- package/dist/src/modeller/scene-viewer/ox-scene-viewer.d.ts +2 -1
- package/dist/src/modeller/scene-viewer/ox-scene-viewer.js +5 -1
- package/dist/src/modeller/scene-viewer/ox-scene-viewer.js.map +1 -1
- package/dist/src/ox-board-component-info.d.ts +1 -0
- package/dist/src/ox-board-component-info.js +42 -2
- package/dist/src/ox-board-component-info.js.map +1 -1
- package/dist/src/ox-board-modeller.d.ts +6 -3
- package/dist/src/ox-board-modeller.js +21 -1
- package/dist/src/ox-board-modeller.js.map +1 -1
- package/dist/src/ox-board-viewer.d.ts +125 -13
- package/dist/src/ox-board-viewer.js +793 -97
- package/dist/src/ox-board-viewer.js.map +1 -1
- package/dist/src/ox-editor-board-selector.d.ts +3 -0
- package/dist/src/ox-editor-board-selector.js +38 -9
- package/dist/src/ox-editor-board-selector.js.map +1 -1
- package/dist/src/ox-playback-controls.d.ts +157 -0
- package/dist/src/ox-playback-controls.js +1089 -0
- package/dist/src/ox-playback-controls.js.map +1 -0
- package/dist/src/playback/carrier-tracking-store.d.ts +51 -0
- package/dist/src/playback/carrier-tracking-store.js +115 -0
- package/dist/src/playback/carrier-tracking-store.js.map +1 -0
- package/dist/src/playback/playback-engine.d.ts +106 -0
- package/dist/src/playback/playback-engine.js +395 -0
- package/dist/src/playback/playback-engine.js.map +1 -0
- package/dist/src/scene-monitor-renderer.d.ts +10 -0
- package/dist/src/scene-monitor-renderer.js +226 -0
- package/dist/src/scene-monitor-renderer.js.map +1 -0
- package/dist/src/selector/ox-board-selector.js +12 -1
- package/dist/src/selector/ox-board-selector.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/icons/components/text.png +0 -0
- package/icons/fab/mode-2d.svg +25 -0
- package/icons/fab/mode-3d.svg +25 -0
- package/icons/fab/playback-play.svg +49 -0
- package/icons/fab/playback-stop.svg +50 -0
- package/package.json +8 -4
|
@@ -0,0 +1,1089 @@
|
|
|
1
|
+
var PlaybackControls_1;
|
|
2
|
+
import { __decorate } from "tslib";
|
|
3
|
+
import '@material/web/icon/icon.js';
|
|
4
|
+
import '@material/web/iconbutton/icon-button.js';
|
|
5
|
+
import { css, html, LitElement } from 'lit';
|
|
6
|
+
import { customElement, property, state } from 'lit/decorators.js';
|
|
7
|
+
/**
|
|
8
|
+
* Window-length presets shown in the range dropdown. Values are durations
|
|
9
|
+
* in milliseconds; `'Range'` is the sentinel for "user picks both bounds
|
|
10
|
+
* directly". The fixed presets cap at 2H — same as the explicit Range
|
|
11
|
+
* mode max gap — so any preset switch produces a window already inside
|
|
12
|
+
* the allowed envelope.
|
|
13
|
+
*/
|
|
14
|
+
const RANGE_DURATIONS = {
|
|
15
|
+
'10m': 10 * 60 * 1000,
|
|
16
|
+
'30m': 30 * 60 * 1000,
|
|
17
|
+
'1H': 60 * 60 * 1000,
|
|
18
|
+
'2H': 2 * 60 * 60 * 1000
|
|
19
|
+
};
|
|
20
|
+
const ONE_HOUR = RANGE_DURATIONS['1H'];
|
|
21
|
+
const MAX_GAP_MS = RANGE_DURATIONS['2H']; // 2H upper bound on (to − from)
|
|
22
|
+
const MIN_GAP_MS = RANGE_DURATIONS['10m']; // 10m lower bound (prevents reversal / zero-window)
|
|
23
|
+
/**
|
|
24
|
+
* 플레이백 컨트롤 오버레이 바 (2행 구조)
|
|
25
|
+
*
|
|
26
|
+
* 1행 (config): Range 선택 (10m / 30m / 1H / 2H / Range) + ←/→ shift
|
|
27
|
+
* + FROM/TO datetime 입력 (date 캘린더 + time 키인) + Apply 버튼
|
|
28
|
+
* + 배속 (×1 ×2 ×4)
|
|
29
|
+
*
|
|
30
|
+
* - Fixed presets: TO 가 anchor (←/→ 로 shift), FROM = TO − range.
|
|
31
|
+
* 입력 disabled. 초기 TO = 현재시간.
|
|
32
|
+
* - Range mode: 양쪽 직접 입력. 2H cap, 10m min, future clamp,
|
|
33
|
+
* 마지막 편집한 쪽이 anchor.
|
|
34
|
+
* - 상단 변경은 PENDING tier 만 갱신 — Apply 누르기 전에는 하단
|
|
35
|
+
* 슬라이더/엔진에 영향 없음.
|
|
36
|
+
*
|
|
37
|
+
* 2행 (control): play / pause / 시크바 (적용된 range 만큼 span) /
|
|
38
|
+
* 현재 재생 시각 / 닫기.
|
|
39
|
+
*
|
|
40
|
+
* @fires playback-start - 플레이백 시작 요청 { fromTime, toTime, speed }
|
|
41
|
+
* toTime 은 window END — 엔진이 chunked fetch 의 상한으로 사용.
|
|
42
|
+
* @fires playback-pause - 일시정지 요청
|
|
43
|
+
* @fires playback-resume - 재개 요청
|
|
44
|
+
* @fires playback-stop - 중지 요청
|
|
45
|
+
* @fires playback-seek - 드래그 릴리즈 시 시크 요청 { toTime }
|
|
46
|
+
* @fires playback-seek-start - 드래그 첫 input 시 즉시 발행 (엔진 타이머·애니메이션 정지 신호, detail 없음)
|
|
47
|
+
* @fires playback-seek-preview - 드래그 중 throttle (leading+trailing, 200ms) 된 스크러빙 요청 { toTime }
|
|
48
|
+
* @fires playback-speed - 배속 변경 요청 { speed }
|
|
49
|
+
*/
|
|
50
|
+
let PlaybackControls = PlaybackControls_1 = class PlaybackControls extends LitElement {
|
|
51
|
+
constructor() {
|
|
52
|
+
super(...arguments);
|
|
53
|
+
this.playbackState = 'idle';
|
|
54
|
+
this.speed = 1;
|
|
55
|
+
this.currentTime = '';
|
|
56
|
+
this.bufferedRanges = [];
|
|
57
|
+
/** 외부에서 전달받은 초기 시간 범위 (from만 사용, to는 from+1h로 자동 계산) */
|
|
58
|
+
this.timeRange = {
|
|
59
|
+
from: new Date(Date.now() - ONE_HOUR),
|
|
60
|
+
to: new Date()
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* Two-tier state model:
|
|
64
|
+
*
|
|
65
|
+
* PENDING (`_pendingRange`, `_pendingFrom`, `_pendingTo`)
|
|
66
|
+
* The upper bar's draft. User edits these via the range dropdown,
|
|
67
|
+
* ←/→ shift, or direct date/time inputs (Range mode only). The
|
|
68
|
+
* lower seekbar is NOT driven by these — they only become live
|
|
69
|
+
* when the user clicks "적용".
|
|
70
|
+
*
|
|
71
|
+
* APPLIED (`_appliedFrom`, `_appliedTo`)
|
|
72
|
+
* The window the seekbar visualizes and the engine fetches data
|
|
73
|
+
* for. Updated only by `_onApply()`, which mirrors pending values
|
|
74
|
+
* here and dispatches a `playback-start` to refresh the engine
|
|
75
|
+
* with the new window (when playing/paused).
|
|
76
|
+
*
|
|
77
|
+
* Splitting these prevents mid-edit churn: typing into the time input
|
|
78
|
+
* doesn't refetch on every keystroke, and the slider doesn't jiggle
|
|
79
|
+
* while the user picks a date.
|
|
80
|
+
*/
|
|
81
|
+
this._pendingRange = '1H';
|
|
82
|
+
this._pendingFrom = new Date(Date.now() - ONE_HOUR);
|
|
83
|
+
this._pendingTo = new Date();
|
|
84
|
+
/**
|
|
85
|
+
* Which side did the user touch most recently in Range mode? Anchors
|
|
86
|
+
* the auto-adjust when the resulting gap violates min/max — the
|
|
87
|
+
* unedited side is what gets pushed to a legal value, so the user's
|
|
88
|
+
* latest intent is preserved.
|
|
89
|
+
*/
|
|
90
|
+
this._lastEdited = 'to';
|
|
91
|
+
this._appliedFrom = new Date(Date.now() - ONE_HOUR);
|
|
92
|
+
this._appliedTo = new Date();
|
|
93
|
+
this._seeking = false;
|
|
94
|
+
this._seekPreviewTime = null;
|
|
95
|
+
this._speeds = [1, 2, 4];
|
|
96
|
+
/** 드래그 중 가장 최근 seekbar 위치 시각 */
|
|
97
|
+
this._latestPreviewTime = null;
|
|
98
|
+
/** 가장 최근에 실제 emit 한 preview 시각 (dedupe 용) */
|
|
99
|
+
this._lastEmittedPreviewTime = null;
|
|
100
|
+
}
|
|
101
|
+
connectedCallback() {
|
|
102
|
+
super.connectedCallback();
|
|
103
|
+
// Initialize both pending and applied from the incoming timeRange.
|
|
104
|
+
// Default range = 1H (matches the previous fixed-window behavior),
|
|
105
|
+
// so the seekbar covers a 1H window from the start.
|
|
106
|
+
const initFrom = new Date(this.timeRange.from);
|
|
107
|
+
const initTo = new Date(this.timeRange.to);
|
|
108
|
+
this._appliedFrom = initFrom;
|
|
109
|
+
this._appliedTo = initTo;
|
|
110
|
+
this._pendingFrom = new Date(initFrom);
|
|
111
|
+
this._pendingTo = new Date(initTo);
|
|
112
|
+
this._pendingRange = this._inferRangeKey(initTo.getTime() - initFrom.getTime());
|
|
113
|
+
this._seekValue = 0;
|
|
114
|
+
this._currentPlayTime = null;
|
|
115
|
+
}
|
|
116
|
+
disconnectedCallback() {
|
|
117
|
+
super.disconnectedCallback();
|
|
118
|
+
this._cancelPreviewThrottle();
|
|
119
|
+
}
|
|
120
|
+
updated(changes) {
|
|
121
|
+
if (changes.has('timeRange') && this.timeRange) {
|
|
122
|
+
// Resync both tiers from the externally-supplied window.
|
|
123
|
+
this._appliedFrom = new Date(this.timeRange.from);
|
|
124
|
+
this._appliedTo = new Date(this.timeRange.to);
|
|
125
|
+
this._pendingFrom = new Date(this._appliedFrom);
|
|
126
|
+
this._pendingTo = new Date(this._appliedTo);
|
|
127
|
+
this._pendingRange = this._inferRangeKey(this._appliedTo.getTime() - this._appliedFrom.getTime());
|
|
128
|
+
}
|
|
129
|
+
// 엔진 프레임(currentTime 프로프 변경)이 유일한 시간 소스.
|
|
130
|
+
// drag 중에는 _seeking 가 true 이므로 엔진 업데이트 무시 (스크러빙 중 UI 튐 방지).
|
|
131
|
+
if (changes.has('currentTime') && this.currentTime && !this._seeking) {
|
|
132
|
+
this._syncFromEngine();
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Map a millisecond gap to the matching preset key, or `'Range'` if
|
|
137
|
+
* the gap doesn't match any preset (custom window already in effect).
|
|
138
|
+
*/
|
|
139
|
+
_inferRangeKey(gapMs) {
|
|
140
|
+
for (const k of ['10m', '30m', '1H', '2H']) {
|
|
141
|
+
if (RANGE_DURATIONS[k] === gapMs)
|
|
142
|
+
return k;
|
|
143
|
+
}
|
|
144
|
+
return 'Range';
|
|
145
|
+
}
|
|
146
|
+
render() {
|
|
147
|
+
const isPlaying = this.playbackState === 'playing';
|
|
148
|
+
const isPaused = this.playbackState === 'paused';
|
|
149
|
+
const isActive = isPlaying || isPaused;
|
|
150
|
+
const isRangeMode = this._pendingRange === 'Range';
|
|
151
|
+
const isDirty = this._pendingFrom.getTime() !== this._appliedFrom.getTime() ||
|
|
152
|
+
this._pendingTo.getTime() !== this._appliedTo.getTime();
|
|
153
|
+
return html `
|
|
154
|
+
<div class="control-bar">
|
|
155
|
+
<!-- 1행 (config): Range 선택 + ←/→ shift + datetime 입력 + Apply -->
|
|
156
|
+
<div class="row-time">
|
|
157
|
+
<select class="range-select" .value=${this._pendingRange} @change=${this._onRangeChange}>
|
|
158
|
+
${['10m', '30m', '1H', '2H', 'Range'].map(k => html `<option value=${k} ?selected=${this._pendingRange === k}>${k}</option>`)}
|
|
159
|
+
</select>
|
|
160
|
+
|
|
161
|
+
<button
|
|
162
|
+
class="shift-btn"
|
|
163
|
+
@click=${this._shiftPending(-1)}
|
|
164
|
+
?disabled=${isRangeMode}
|
|
165
|
+
title="이전 ${this._pendingRange}"
|
|
166
|
+
>
|
|
167
|
+
<md-icon>chevron_left</md-icon>
|
|
168
|
+
</button>
|
|
169
|
+
<button
|
|
170
|
+
class="shift-btn"
|
|
171
|
+
@click=${this._shiftPending(1)}
|
|
172
|
+
?disabled=${isRangeMode}
|
|
173
|
+
title="다음 ${this._pendingRange}"
|
|
174
|
+
>
|
|
175
|
+
<md-icon>chevron_right</md-icon>
|
|
176
|
+
</button>
|
|
177
|
+
|
|
178
|
+
<!-- FROM composite datetime -->
|
|
179
|
+
<div class="composite-datetime ${!isRangeMode ? 'disabled' : ''}">
|
|
180
|
+
<input
|
|
181
|
+
type="date"
|
|
182
|
+
class="inner-date"
|
|
183
|
+
.value=${this._toDateString(this._pendingFrom)}
|
|
184
|
+
?disabled=${!isRangeMode}
|
|
185
|
+
@change=${(e) => this._onCompositeChange('from', 'date', e)}
|
|
186
|
+
/>
|
|
187
|
+
|
|
188
|
+
<input
|
|
189
|
+
type="text"
|
|
190
|
+
class="inner-time"
|
|
191
|
+
maxlength="2"
|
|
192
|
+
.value=${this._pad(this._pendingFrom.getHours())}
|
|
193
|
+
?disabled=${!isRangeMode}
|
|
194
|
+
@keydown=${(e) => this._onTimeKeydown('from', 'h', e)}
|
|
195
|
+
@input=${(e) => this._onTimeInput('h', e)}
|
|
196
|
+
@change=${(e) => this._onCompositeChange('from', 'h', e)}
|
|
197
|
+
/>:
|
|
198
|
+
<input
|
|
199
|
+
type="text"
|
|
200
|
+
class="inner-time"
|
|
201
|
+
maxlength="2"
|
|
202
|
+
.value=${this._pad(this._pendingFrom.getMinutes())}
|
|
203
|
+
?disabled=${!isRangeMode}
|
|
204
|
+
@keydown=${(e) => this._onTimeKeydown('from', 'm', e)}
|
|
205
|
+
@input=${(e) => this._onTimeInput('m', e)}
|
|
206
|
+
@change=${(e) => this._onCompositeChange('from', 'm', e)}
|
|
207
|
+
/>:
|
|
208
|
+
<input
|
|
209
|
+
type="text"
|
|
210
|
+
class="inner-time"
|
|
211
|
+
maxlength="2"
|
|
212
|
+
.value=${this._pad(this._pendingFrom.getSeconds())}
|
|
213
|
+
?disabled=${!isRangeMode}
|
|
214
|
+
@keydown=${(e) => this._onTimeKeydown('from', 's', e)}
|
|
215
|
+
@input=${(e) => this._onTimeInput('s', e)}
|
|
216
|
+
@change=${(e) => this._onCompositeChange('from', 's', e)}
|
|
217
|
+
/>
|
|
218
|
+
</div>
|
|
219
|
+
|
|
220
|
+
<span class="time-label">~</span>
|
|
221
|
+
|
|
222
|
+
<!-- TO composite datetime -->
|
|
223
|
+
<div class="composite-datetime ${!isRangeMode ? 'disabled' : ''}">
|
|
224
|
+
<input
|
|
225
|
+
type="date"
|
|
226
|
+
class="inner-date"
|
|
227
|
+
.value=${this._toDateString(this._pendingTo)}
|
|
228
|
+
?disabled=${!isRangeMode}
|
|
229
|
+
@change=${(e) => this._onCompositeChange('to', 'date', e)}
|
|
230
|
+
/>
|
|
231
|
+
|
|
232
|
+
<input
|
|
233
|
+
type="text"
|
|
234
|
+
class="inner-time"
|
|
235
|
+
maxlength="2"
|
|
236
|
+
.value=${this._pad(this._pendingTo.getHours())}
|
|
237
|
+
?disabled=${!isRangeMode}
|
|
238
|
+
@keydown=${(e) => this._onTimeKeydown('to', 'h', e)}
|
|
239
|
+
@input=${(e) => this._onTimeInput('h', e)}
|
|
240
|
+
@change=${(e) => this._onCompositeChange('to', 'h', e)}
|
|
241
|
+
/>:
|
|
242
|
+
<input
|
|
243
|
+
type="text"
|
|
244
|
+
class="inner-time"
|
|
245
|
+
maxlength="2"
|
|
246
|
+
.value=${this._pad(this._pendingTo.getMinutes())}
|
|
247
|
+
?disabled=${!isRangeMode}
|
|
248
|
+
@keydown=${(e) => this._onTimeKeydown('to', 'm', e)}
|
|
249
|
+
@input=${(e) => this._onTimeInput('m', e)}
|
|
250
|
+
@change=${(e) => this._onCompositeChange('to', 'm', e)}
|
|
251
|
+
/>:
|
|
252
|
+
<input
|
|
253
|
+
type="text"
|
|
254
|
+
class="inner-time"
|
|
255
|
+
maxlength="2"
|
|
256
|
+
.value=${this._pad(this._pendingTo.getSeconds())}
|
|
257
|
+
?disabled=${!isRangeMode}
|
|
258
|
+
@keydown=${(e) => this._onTimeKeydown('to', 's', e)}
|
|
259
|
+
@input=${(e) => this._onTimeInput('s', e)}
|
|
260
|
+
@change=${(e) => this._onCompositeChange('to', 's', e)}
|
|
261
|
+
/>
|
|
262
|
+
</div>
|
|
263
|
+
|
|
264
|
+
<button class="apply-btn ${isDirty ? 'dirty' : ''}" ?disabled=${!isDirty} @click=${this._onApply}>
|
|
265
|
+
적용
|
|
266
|
+
</button>
|
|
267
|
+
|
|
268
|
+
<span class="spacer"></span>
|
|
269
|
+
</div>
|
|
270
|
+
|
|
271
|
+
<!-- 2행: 재생 제어 + 시크바 + 배속 + 닫기 -->
|
|
272
|
+
<div class="row-seek">
|
|
273
|
+
<md-icon-button class="primary" @click=${isActive ? this._onTogglePlayPause : this._onStart}>
|
|
274
|
+
<md-icon>${isPlaying ? 'pause' : 'play_arrow'}</md-icon>
|
|
275
|
+
</md-icon-button>
|
|
276
|
+
|
|
277
|
+
<div class="timeline">
|
|
278
|
+
<div class="seek-track">
|
|
279
|
+
<div class="seek-rail"></div>
|
|
280
|
+
${this._renderBufferBars()}
|
|
281
|
+
<input
|
|
282
|
+
type="range"
|
|
283
|
+
class="seek-bar"
|
|
284
|
+
min="0"
|
|
285
|
+
max="1000"
|
|
286
|
+
.value=${String(this._seekValue)}
|
|
287
|
+
@input=${this._onSeekInput}
|
|
288
|
+
@change=${this._onSeekChange}
|
|
289
|
+
/>
|
|
290
|
+
</div>
|
|
291
|
+
<div class="seek-labels">
|
|
292
|
+
<span>${this._formatTime(this._appliedFrom)}</span>
|
|
293
|
+
<span>${this._formatTime(this._appliedTo)}</span>
|
|
294
|
+
</div>
|
|
295
|
+
</div>
|
|
296
|
+
|
|
297
|
+
<span class="current-time">
|
|
298
|
+
${this._seeking && this._seekPreviewTime
|
|
299
|
+
? this._formatTime(this._seekPreviewTime)
|
|
300
|
+
: this._currentPlayTime ? this._formatTime(this._currentPlayTime) : '--:--:--'}
|
|
301
|
+
</span>
|
|
302
|
+
|
|
303
|
+
<div class="speed-group">
|
|
304
|
+
${this._speeds.map(s => html `
|
|
305
|
+
<button class="speed-btn ${this.speed === s ? 'active' : ''}" @click=${() => this._onSpeedChange(s)}>
|
|
306
|
+
×${s}
|
|
307
|
+
</button>
|
|
308
|
+
`)}
|
|
309
|
+
</div>
|
|
310
|
+
|
|
311
|
+
<md-icon-button @click=${this._onStop}>
|
|
312
|
+
<md-icon>close</md-icon>
|
|
313
|
+
</md-icon-button>
|
|
314
|
+
</div>
|
|
315
|
+
</div>
|
|
316
|
+
`;
|
|
317
|
+
}
|
|
318
|
+
_formatTime(date) {
|
|
319
|
+
return date.toLocaleTimeString('ko-KR', { hour: '2-digit', minute: '2-digit', second: '2-digit', hour12: false });
|
|
320
|
+
}
|
|
321
|
+
_toDateString(date) {
|
|
322
|
+
const pad = (n) => String(n).padStart(2, '0');
|
|
323
|
+
return `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())}`;
|
|
324
|
+
}
|
|
325
|
+
/** "HH:MM:SS" — what `<input type="time" step="1">` reads/writes. */
|
|
326
|
+
_toTimeString(date) {
|
|
327
|
+
const pad = (n) => String(n).padStart(2, '0');
|
|
328
|
+
return `${pad(date.getHours())}:${pad(date.getMinutes())}:${pad(date.getSeconds())}`;
|
|
329
|
+
}
|
|
330
|
+
/**
|
|
331
|
+
* "YYYY-MM-DDTHH:MM:SS" — what `<input type="datetime-local" step="1">`
|
|
332
|
+
* reads/writes. Local time (no Z suffix), matches the input element's
|
|
333
|
+
* own convention.
|
|
334
|
+
*/
|
|
335
|
+
_toDatetimeLocalString(date) {
|
|
336
|
+
return `${this._toDateString(date)}T${this._toTimeString(date)}`;
|
|
337
|
+
}
|
|
338
|
+
/**
|
|
339
|
+
* 엔진 프레임(currentTime 프로프) 을 유일한 시간 소스로 사용하여
|
|
340
|
+
* _currentPlayTime 및 _seekValue 동기화.
|
|
341
|
+
*/
|
|
342
|
+
_syncFromEngine() {
|
|
343
|
+
if (!this.currentTime || this._seeking)
|
|
344
|
+
return;
|
|
345
|
+
const currentMs = new Date(this.currentTime).getTime();
|
|
346
|
+
if (!Number.isFinite(currentMs))
|
|
347
|
+
return;
|
|
348
|
+
this._currentPlayTime = new Date(currentMs);
|
|
349
|
+
const from = this._appliedFrom.getTime();
|
|
350
|
+
const to = this._appliedTo.getTime();
|
|
351
|
+
const range = to - from;
|
|
352
|
+
if (range <= 0)
|
|
353
|
+
return;
|
|
354
|
+
this._seekValue = Math.max(0, Math.min(1000, Math.round(((currentMs - from) / range) * 1000)));
|
|
355
|
+
}
|
|
356
|
+
// ── Pending-tier handlers (upper config bar) ──────────────────────
|
|
357
|
+
_onRangeChange(e) {
|
|
358
|
+
const newKey = e.target.value;
|
|
359
|
+
this._pendingRange = newKey;
|
|
360
|
+
if (newKey === 'Range') {
|
|
361
|
+
// Switching to Range: keep current pending bounds, just unlock the
|
|
362
|
+
// inputs. Auto-adjust will kick in when the user edits one side.
|
|
363
|
+
return;
|
|
364
|
+
}
|
|
365
|
+
// Fixed preset: end stays where it is (clamped to now), start = end − range.
|
|
366
|
+
const dur = RANGE_DURATIONS[newKey];
|
|
367
|
+
const now = Date.now();
|
|
368
|
+
const newTo = Math.min(this._pendingTo.getTime(), now);
|
|
369
|
+
this._pendingTo = new Date(newTo);
|
|
370
|
+
this._pendingFrom = new Date(newTo - dur);
|
|
371
|
+
this._lastEdited = 'to';
|
|
372
|
+
}
|
|
373
|
+
_shiftPending(direction) {
|
|
374
|
+
return () => {
|
|
375
|
+
// Only meaningful in Fixed mode — Range mode disables the buttons.
|
|
376
|
+
if (this._pendingRange === 'Range')
|
|
377
|
+
return;
|
|
378
|
+
const dur = RANGE_DURATIONS[this._pendingRange];
|
|
379
|
+
const now = Date.now();
|
|
380
|
+
let newToMs = this._pendingTo.getTime() + direction * dur;
|
|
381
|
+
newToMs = Math.min(newToMs, now); // future clamp on forward shift
|
|
382
|
+
this._pendingTo = new Date(newToMs);
|
|
383
|
+
this._pendingFrom = new Date(newToMs - dur);
|
|
384
|
+
this._lastEdited = 'to';
|
|
385
|
+
};
|
|
386
|
+
}
|
|
387
|
+
_pad(n) {
|
|
388
|
+
return String(n).padStart(2, '0');
|
|
389
|
+
}
|
|
390
|
+
_onTimeKeydown(side, part, e) {
|
|
391
|
+
const el = e.target;
|
|
392
|
+
if (e.key === 'ArrowUp' || e.key === 'ArrowDown') {
|
|
393
|
+
e.preventDefault();
|
|
394
|
+
const current = side === 'from' ? this._pendingFrom : this._pendingTo;
|
|
395
|
+
const next = new Date(current);
|
|
396
|
+
let num = parseInt(el.value, 10);
|
|
397
|
+
if (isNaN(num))
|
|
398
|
+
num = 0;
|
|
399
|
+
const step = e.key === 'ArrowUp' ? 1 : -1;
|
|
400
|
+
num += step;
|
|
401
|
+
const max = part === 'h' ? 23 : 59;
|
|
402
|
+
if (num < 0)
|
|
403
|
+
num = max;
|
|
404
|
+
if (num > max)
|
|
405
|
+
num = 0;
|
|
406
|
+
if (part === 'h')
|
|
407
|
+
next.setHours(num);
|
|
408
|
+
if (part === 'm')
|
|
409
|
+
next.setMinutes(num);
|
|
410
|
+
if (part === 's')
|
|
411
|
+
next.setSeconds(num);
|
|
412
|
+
this._writePendingSide(side, next);
|
|
413
|
+
return;
|
|
414
|
+
}
|
|
415
|
+
if (!/^[0-9]$/.test(e.key) &&
|
|
416
|
+
!['Backspace', 'Tab', 'ArrowLeft', 'ArrowRight', 'Delete', 'Enter'].includes(e.key) &&
|
|
417
|
+
!e.ctrlKey && !e.metaKey) {
|
|
418
|
+
e.preventDefault();
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
_onTimeInput(part, e) {
|
|
422
|
+
const el = e.target;
|
|
423
|
+
let val = el.value.replace(/[^0-9]/g, '');
|
|
424
|
+
if (val.length > 0) {
|
|
425
|
+
let num = parseInt(val, 10);
|
|
426
|
+
const max = part === 'h' ? 23 : 59;
|
|
427
|
+
if (num > max) {
|
|
428
|
+
val = String(max);
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
el.value = val;
|
|
432
|
+
}
|
|
433
|
+
_onCompositeChange(side, part, e) {
|
|
434
|
+
const el = e.target;
|
|
435
|
+
const current = side === 'from' ? this._pendingFrom : this._pendingTo;
|
|
436
|
+
const next = new Date(current);
|
|
437
|
+
if (part === 'date') {
|
|
438
|
+
const value = el.value;
|
|
439
|
+
if (!value)
|
|
440
|
+
return;
|
|
441
|
+
const [y, m, d] = value.split('-').map(Number);
|
|
442
|
+
next.setFullYear(y, m - 1, d);
|
|
443
|
+
}
|
|
444
|
+
else {
|
|
445
|
+
let num = parseInt(el.value, 10);
|
|
446
|
+
if (isNaN(num))
|
|
447
|
+
num = 0;
|
|
448
|
+
if (part === 'h')
|
|
449
|
+
next.setHours(Math.max(0, Math.min(23, num)));
|
|
450
|
+
if (part === 'm')
|
|
451
|
+
next.setMinutes(Math.max(0, Math.min(59, num)));
|
|
452
|
+
if (part === 's')
|
|
453
|
+
next.setSeconds(Math.max(0, Math.min(59, num)));
|
|
454
|
+
// 패딩 강제 적용하여 UI 보정
|
|
455
|
+
el.value = this._pad(num);
|
|
456
|
+
}
|
|
457
|
+
if (Number.isNaN(next.getTime()))
|
|
458
|
+
return;
|
|
459
|
+
this._writePendingSide(side, next);
|
|
460
|
+
}
|
|
461
|
+
/**
|
|
462
|
+
* Commit a side's new value, then enforce the gap envelope.
|
|
463
|
+
*
|
|
464
|
+
* Rules (per spec):
|
|
465
|
+
* - `to` clamped to now (no future).
|
|
466
|
+
* - `to − from ≥ 10m` (no zero/negative window).
|
|
467
|
+
* - `to − from ≤ 2h`.
|
|
468
|
+
* - The side just edited (`side`) is the anchor; the OTHER side
|
|
469
|
+
* gets pushed to satisfy the envelope.
|
|
470
|
+
* - If anchoring `from` would push `to` past now, fall back to
|
|
471
|
+
* anchoring `to = now` and shrink `from`.
|
|
472
|
+
*/
|
|
473
|
+
_writePendingSide(side, next) {
|
|
474
|
+
this._lastEdited = side;
|
|
475
|
+
const now = Date.now();
|
|
476
|
+
if (side === 'to') {
|
|
477
|
+
const toMs = Math.min(next.getTime(), now);
|
|
478
|
+
this._pendingTo = new Date(toMs);
|
|
479
|
+
const fromMs = this._pendingFrom.getTime();
|
|
480
|
+
const gap = toMs - fromMs;
|
|
481
|
+
if (gap < MIN_GAP_MS)
|
|
482
|
+
this._pendingFrom = new Date(toMs - MIN_GAP_MS);
|
|
483
|
+
else if (gap > MAX_GAP_MS)
|
|
484
|
+
this._pendingFrom = new Date(toMs - MAX_GAP_MS);
|
|
485
|
+
}
|
|
486
|
+
else {
|
|
487
|
+
const fromMs = next.getTime();
|
|
488
|
+
this._pendingFrom = new Date(fromMs);
|
|
489
|
+
const toMs = this._pendingTo.getTime();
|
|
490
|
+
const gap = toMs - fromMs;
|
|
491
|
+
if (gap < MIN_GAP_MS) {
|
|
492
|
+
let adj = fromMs + MIN_GAP_MS;
|
|
493
|
+
if (adj > now) {
|
|
494
|
+
// Pushing `to` would land in the future — re-anchor on `to=now`
|
|
495
|
+
// and shrink `from` instead.
|
|
496
|
+
adj = now;
|
|
497
|
+
this._pendingFrom = new Date(adj - MIN_GAP_MS);
|
|
498
|
+
}
|
|
499
|
+
this._pendingTo = new Date(adj);
|
|
500
|
+
}
|
|
501
|
+
else if (gap > MAX_GAP_MS) {
|
|
502
|
+
let adj = fromMs + MAX_GAP_MS;
|
|
503
|
+
if (adj > now) {
|
|
504
|
+
adj = now;
|
|
505
|
+
this._pendingFrom = new Date(adj - MAX_GAP_MS);
|
|
506
|
+
}
|
|
507
|
+
this._pendingTo = new Date(adj);
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
/**
|
|
512
|
+
* "적용" — copy pending → applied, reset seek to window start, and
|
|
513
|
+
* (re)start the engine so it refetches data for the new window.
|
|
514
|
+
*
|
|
515
|
+
* Behavior by prior state:
|
|
516
|
+
* - playing: dispatch `playback-start` → engine restarts in new window.
|
|
517
|
+
* - paused : same — engine refetches; we leave the user in 'playing'
|
|
518
|
+
* state because the alternative (carry "paused" through a window
|
|
519
|
+
* change) ends up showing stale buffered data while the new fetch
|
|
520
|
+
* completes, which reads as a stuck UI.
|
|
521
|
+
* - idle : window updated silently; no engine activity until user
|
|
522
|
+
* presses play.
|
|
523
|
+
*/
|
|
524
|
+
_onApply() {
|
|
525
|
+
this._appliedFrom = new Date(this._pendingFrom);
|
|
526
|
+
this._appliedTo = new Date(this._pendingTo);
|
|
527
|
+
this._seekValue = 0;
|
|
528
|
+
this._currentPlayTime = new Date(this._appliedFrom);
|
|
529
|
+
this._seekPreviewTime = null;
|
|
530
|
+
if (this.playbackState === 'playing' || this.playbackState === 'paused') {
|
|
531
|
+
this._onStart();
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
_onStart() {
|
|
535
|
+
// 현재 seekbar 위치에서 재생 시작 (_seekValue 가 유일한 슬라이더 위치 소스)
|
|
536
|
+
const ratio = this._seekValue / 1000;
|
|
537
|
+
const from = this._appliedFrom.getTime();
|
|
538
|
+
const to = this._appliedTo.getTime();
|
|
539
|
+
const fromTime = new Date(from + (to - from) * ratio);
|
|
540
|
+
const toTime = new Date(to);
|
|
541
|
+
this._currentPlayTime = fromTime;
|
|
542
|
+
this.playbackState = 'playing';
|
|
543
|
+
// toTime is the window END (= _appliedTo), NOT a hardcoded
|
|
544
|
+
// fromTime + 1h. The engine uses it as the chunked-fetch upper
|
|
545
|
+
// bound — without it, variable ranges (10m / 30m / Range mode)
|
|
546
|
+
// would silently overshoot the user-selected window.
|
|
547
|
+
this.dispatchEvent(new CustomEvent('playback-start', {
|
|
548
|
+
detail: { fromTime, toTime, speed: this.speed },
|
|
549
|
+
bubbles: true,
|
|
550
|
+
composed: true
|
|
551
|
+
}));
|
|
552
|
+
}
|
|
553
|
+
_onTogglePlayPause() {
|
|
554
|
+
if (this.playbackState === 'playing') {
|
|
555
|
+
this.playbackState = 'paused';
|
|
556
|
+
this.dispatchEvent(new CustomEvent('playback-pause', { bubbles: true, composed: true }));
|
|
557
|
+
}
|
|
558
|
+
else {
|
|
559
|
+
this.playbackState = 'playing';
|
|
560
|
+
this.dispatchEvent(new CustomEvent('playback-resume', { bubbles: true, composed: true }));
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
_onStop() {
|
|
564
|
+
this._cancelPreviewThrottle();
|
|
565
|
+
this._currentPlayTime = null;
|
|
566
|
+
this._seekValue = 0;
|
|
567
|
+
this.playbackState = 'idle';
|
|
568
|
+
this.dispatchEvent(new CustomEvent('playback-stop', { bubbles: true, composed: true }));
|
|
569
|
+
}
|
|
570
|
+
_onSeekInput(e) {
|
|
571
|
+
// 드래그 시작(첫 input) 탐지
|
|
572
|
+
const justStartedDrag = !this._seeking;
|
|
573
|
+
this._seeking = true;
|
|
574
|
+
this._seekValue = Number(e.target.value);
|
|
575
|
+
// 드래그 중 preview 시간 계산 + UI 표시
|
|
576
|
+
const ratio = this._seekValue / 1000;
|
|
577
|
+
const from = this._appliedFrom.getTime();
|
|
578
|
+
const to = this._appliedTo.getTime();
|
|
579
|
+
const previewTime = new Date(from + (to - from) * ratio);
|
|
580
|
+
this._seekPreviewTime = previewTime;
|
|
581
|
+
this._latestPreviewTime = previewTime;
|
|
582
|
+
if (justStartedDrag) {
|
|
583
|
+
// 즉시 이벤트 — 재생 타이머 정지
|
|
584
|
+
this.dispatchEvent(new CustomEvent('playback-seek-start', {
|
|
585
|
+
bubbles: true,
|
|
586
|
+
composed: true
|
|
587
|
+
}));
|
|
588
|
+
}
|
|
589
|
+
// throttle: leading-edge 에서 즉시 emit, 이후 200ms 내 input 은 latest 만 갱신.
|
|
590
|
+
// throttle 만료 시점에 latest 가 마지막 emit 과 다르면 trailing emit.
|
|
591
|
+
if (this._previewThrottle === undefined) {
|
|
592
|
+
// leading emit
|
|
593
|
+
this._emitPreview();
|
|
594
|
+
// trailing 예약
|
|
595
|
+
this._previewThrottle = window.setTimeout(() => {
|
|
596
|
+
var _a;
|
|
597
|
+
this._previewThrottle = undefined;
|
|
598
|
+
// 드래그가 끝났거나 (_seeking=false) 새 throttle 이 이미 있으면 스킵
|
|
599
|
+
if (!this._seeking)
|
|
600
|
+
return;
|
|
601
|
+
// latest 가 마지막 emit 과 같으면 중복 skip
|
|
602
|
+
const latest = this._latestPreviewTime;
|
|
603
|
+
if (latest && latest.getTime() !== ((_a = this._lastEmittedPreviewTime) === null || _a === void 0 ? void 0 : _a.getTime())) {
|
|
604
|
+
this._emitPreview();
|
|
605
|
+
}
|
|
606
|
+
}, PlaybackControls_1.PREVIEW_THROTTLE_MS);
|
|
607
|
+
}
|
|
608
|
+
// else: 이미 throttle 진행 중 → _latestPreviewTime 만 업데이트됨 (위에서 처리됨)
|
|
609
|
+
}
|
|
610
|
+
/** latest 위치 시각으로 playback-seek-preview 를 발행 (dedupe). */
|
|
611
|
+
_emitPreview() {
|
|
612
|
+
var _a;
|
|
613
|
+
const time = this._latestPreviewTime;
|
|
614
|
+
if (!time)
|
|
615
|
+
return;
|
|
616
|
+
if (((_a = this._lastEmittedPreviewTime) === null || _a === void 0 ? void 0 : _a.getTime()) === time.getTime())
|
|
617
|
+
return;
|
|
618
|
+
this._lastEmittedPreviewTime = time;
|
|
619
|
+
this.dispatchEvent(new CustomEvent('playback-seek-preview', {
|
|
620
|
+
detail: { toTime: time },
|
|
621
|
+
bubbles: true,
|
|
622
|
+
composed: true
|
|
623
|
+
}));
|
|
624
|
+
}
|
|
625
|
+
_onSeekChange(e) {
|
|
626
|
+
this._seeking = false;
|
|
627
|
+
this._cancelPreviewThrottle();
|
|
628
|
+
const ratio = Number(e.target.value) / 1000;
|
|
629
|
+
const from = this._appliedFrom.getTime();
|
|
630
|
+
const to = this._appliedTo.getTime();
|
|
631
|
+
const targetTime = new Date(from + (to - from) * ratio);
|
|
632
|
+
this._seekPreviewTime = null;
|
|
633
|
+
this._currentPlayTime = targetTime;
|
|
634
|
+
this.dispatchEvent(new CustomEvent('playback-seek', {
|
|
635
|
+
detail: { toTime: targetTime },
|
|
636
|
+
bubbles: true,
|
|
637
|
+
composed: true
|
|
638
|
+
}));
|
|
639
|
+
}
|
|
640
|
+
_cancelPreviewThrottle() {
|
|
641
|
+
if (this._previewThrottle != null) {
|
|
642
|
+
clearTimeout(this._previewThrottle);
|
|
643
|
+
this._previewThrottle = undefined;
|
|
644
|
+
}
|
|
645
|
+
this._latestPreviewTime = null;
|
|
646
|
+
this._lastEmittedPreviewTime = null;
|
|
647
|
+
}
|
|
648
|
+
_renderBufferBars() {
|
|
649
|
+
var _a;
|
|
650
|
+
if (!((_a = this.bufferedRanges) === null || _a === void 0 ? void 0 : _a.length))
|
|
651
|
+
return '';
|
|
652
|
+
const from = this._appliedFrom.getTime();
|
|
653
|
+
const to = this._appliedTo.getTime();
|
|
654
|
+
const range = to - from;
|
|
655
|
+
if (range <= 0)
|
|
656
|
+
return '';
|
|
657
|
+
return this.bufferedRanges.map(r => {
|
|
658
|
+
const left = Math.max(0, (r.from - from) / range) * 100;
|
|
659
|
+
const right = Math.min(1, (r.to - from) / range) * 100;
|
|
660
|
+
const width = right - left;
|
|
661
|
+
return html `<div class="buffer-bar" style="left:${left}%;width:${width}%"></div>`;
|
|
662
|
+
});
|
|
663
|
+
}
|
|
664
|
+
_onSpeedChange(speed) {
|
|
665
|
+
this.speed = speed;
|
|
666
|
+
this.dispatchEvent(new CustomEvent('playback-speed', {
|
|
667
|
+
detail: { speed },
|
|
668
|
+
bubbles: true,
|
|
669
|
+
composed: true
|
|
670
|
+
}));
|
|
671
|
+
}
|
|
672
|
+
};
|
|
673
|
+
PlaybackControls.styles = css `
|
|
674
|
+
:host {
|
|
675
|
+
display: flex;
|
|
676
|
+
justify-content: center;
|
|
677
|
+
position: absolute;
|
|
678
|
+
bottom: 0;
|
|
679
|
+
left: 0;
|
|
680
|
+
right: 0;
|
|
681
|
+
z-index: 1001;
|
|
682
|
+
pointer-events: none;
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
.control-bar {
|
|
686
|
+
display: flex;
|
|
687
|
+
flex-direction: column;
|
|
688
|
+
gap: 6px;
|
|
689
|
+
padding: 10px 16px;
|
|
690
|
+
margin: 12px;
|
|
691
|
+
max-width: 560px;
|
|
692
|
+
width: 100%;
|
|
693
|
+
background: rgba(0, 0, 0, 0.75);
|
|
694
|
+
backdrop-filter: blur(8px);
|
|
695
|
+
border-radius: 12px;
|
|
696
|
+
color: #fff;
|
|
697
|
+
pointer-events: auto;
|
|
698
|
+
font-size: 13px;
|
|
699
|
+
box-sizing: border-box;
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
/* 1행: 시점 설정 + 배속 */
|
|
703
|
+
.row-time {
|
|
704
|
+
display: flex;
|
|
705
|
+
align-items: center;
|
|
706
|
+
gap: 6px;
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
md-icon-button {
|
|
710
|
+
--md-icon-button-icon-color: #fff;
|
|
711
|
+
--md-icon-button-hover-icon-color: #fff;
|
|
712
|
+
--md-icon-button-pressed-icon-color: #fff;
|
|
713
|
+
--md-icon-button-focus-icon-color: #fff;
|
|
714
|
+
--md-icon-button-state-layer-color: rgba(255, 255, 255, 0.2);
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
md-icon-button:hover {
|
|
718
|
+
background: rgba(255, 255, 255, 0.15);
|
|
719
|
+
border-radius: 50%;
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
/*
|
|
723
|
+
* shift 버튼 (←/→) — Material Web 의 md-icon-button 은 shadow DOM
|
|
724
|
+
* 내 ripple/focus-ring/touch-target 영역이 visible 32px 컨테이너
|
|
725
|
+
* 너머로 hit area 를 확장해서 인접 버튼끼리 호버 영역이 겹친다.
|
|
726
|
+
* (사용자 보고: > 의 hover 가 < 의 오른쪽 영역까지 침범) plain
|
|
727
|
+
* <button> 으로 교체해 hit area 를 정확히 32×32px 로 한정.
|
|
728
|
+
*/
|
|
729
|
+
.shift-btn {
|
|
730
|
+
width: 22px;
|
|
731
|
+
height: 28px;
|
|
732
|
+
padding: 0;
|
|
733
|
+
border: none;
|
|
734
|
+
background: transparent;
|
|
735
|
+
cursor: pointer;
|
|
736
|
+
display: inline-flex;
|
|
737
|
+
align-items: center;
|
|
738
|
+
justify-content: center;
|
|
739
|
+
color: #fff;
|
|
740
|
+
flex-shrink: 0;
|
|
741
|
+
}
|
|
742
|
+
|
|
743
|
+
/*
|
|
744
|
+
* shift 버튼 묶음 — 두 chevron 이 시각적으로 한 쌍으로 보이도록
|
|
745
|
+
* 사이 여백을 완전히 제거 (row-time 의 6px gap 전체를 negative
|
|
746
|
+
* margin 으로 상쇄). 양쪽 인접 요소와의 간격은 row gap 으로 유지.
|
|
747
|
+
*/
|
|
748
|
+
.shift-btn + .shift-btn {
|
|
749
|
+
margin-left: -6px;
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
.shift-btn md-icon {
|
|
753
|
+
font-size: 16px;
|
|
754
|
+
width: 16px;
|
|
755
|
+
height: 16px;
|
|
756
|
+
}
|
|
757
|
+
|
|
758
|
+
.shift-btn:hover:not(:disabled) {
|
|
759
|
+
color: #ffb766;
|
|
760
|
+
}
|
|
761
|
+
|
|
762
|
+
.shift-btn:disabled {
|
|
763
|
+
opacity: 0.4;
|
|
764
|
+
cursor: not-allowed;
|
|
765
|
+
}
|
|
766
|
+
|
|
767
|
+
.date-input {
|
|
768
|
+
background: rgba(255, 255, 255, 0.15);
|
|
769
|
+
border: 1px solid rgba(255, 255, 255, 0.3);
|
|
770
|
+
border-radius: 6px;
|
|
771
|
+
color: #fff;
|
|
772
|
+
font-size: 13px;
|
|
773
|
+
padding: 4px 8px;
|
|
774
|
+
outline: none;
|
|
775
|
+
color-scheme: dark;
|
|
776
|
+
width: 130px;
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
.date-input:focus {
|
|
780
|
+
border-color: rgba(255, 255, 255, 0.6);
|
|
781
|
+
}
|
|
782
|
+
|
|
783
|
+
.hour-select,
|
|
784
|
+
.range-select {
|
|
785
|
+
background: rgba(255, 255, 255, 0.15);
|
|
786
|
+
border: 1px solid rgba(255, 255, 255, 0.3);
|
|
787
|
+
border-radius: 6px;
|
|
788
|
+
color: #fff;
|
|
789
|
+
font-size: 13px;
|
|
790
|
+
padding: 4px 6px;
|
|
791
|
+
outline: none;
|
|
792
|
+
color-scheme: dark;
|
|
793
|
+
cursor: pointer;
|
|
794
|
+
}
|
|
795
|
+
|
|
796
|
+
/*
|
|
797
|
+
* Windows + Chrome: select 의 color/background 가 native popup option 에
|
|
798
|
+
* 일관되게 적용 안 됨 (option 텍스트는 white 상속, popup 배경은 OS 기본 흰색
|
|
799
|
+
* → invisible). option 요소에 명시적으로 dark 컬러 박아 모든 OS 에서 가독.
|
|
800
|
+
*/
|
|
801
|
+
.hour-select option,
|
|
802
|
+
.range-select option {
|
|
803
|
+
background-color: #1a1d22;
|
|
804
|
+
color: #fff;
|
|
805
|
+
}
|
|
806
|
+
|
|
807
|
+
.hour-select:focus,
|
|
808
|
+
.range-select:focus {
|
|
809
|
+
border-color: rgba(255, 255, 255, 0.6);
|
|
810
|
+
}
|
|
811
|
+
|
|
812
|
+
.range-select {
|
|
813
|
+
min-width: 64px;
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
.composite-datetime {
|
|
817
|
+
display: inline-flex;
|
|
818
|
+
align-items: center;
|
|
819
|
+
background: rgba(255, 255, 255, 0.15);
|
|
820
|
+
border: 1px solid rgba(255, 255, 255, 0.3);
|
|
821
|
+
border-radius: 6px;
|
|
822
|
+
color: #fff;
|
|
823
|
+
font-size: 12px;
|
|
824
|
+
padding: 4px 6px;
|
|
825
|
+
box-sizing: border-box;
|
|
826
|
+
transition: border-color 0.2s, opacity 0.2s;
|
|
827
|
+
}
|
|
828
|
+
|
|
829
|
+
.composite-datetime:focus-within {
|
|
830
|
+
border-color: rgba(255, 255, 255, 0.6);
|
|
831
|
+
}
|
|
832
|
+
|
|
833
|
+
.composite-datetime.disabled {
|
|
834
|
+
opacity: 0.5;
|
|
835
|
+
pointer-events: none;
|
|
836
|
+
}
|
|
837
|
+
|
|
838
|
+
.inner-date {
|
|
839
|
+
background: transparent;
|
|
840
|
+
border: none;
|
|
841
|
+
color: inherit;
|
|
842
|
+
font-family: inherit;
|
|
843
|
+
font-size: inherit;
|
|
844
|
+
outline: none;
|
|
845
|
+
color-scheme: dark;
|
|
846
|
+
padding: 0;
|
|
847
|
+
cursor: text;
|
|
848
|
+
}
|
|
849
|
+
|
|
850
|
+
.inner-date::-webkit-calendar-picker-indicator,
|
|
851
|
+
.inner-date::-webkit-inner-spin-button,
|
|
852
|
+
.inner-date::-webkit-clear-button {
|
|
853
|
+
display: none;
|
|
854
|
+
-webkit-appearance: none;
|
|
855
|
+
}
|
|
856
|
+
|
|
857
|
+
.inner-time {
|
|
858
|
+
background: transparent;
|
|
859
|
+
border: none;
|
|
860
|
+
color: inherit;
|
|
861
|
+
font-family: inherit;
|
|
862
|
+
font-size: inherit;
|
|
863
|
+
outline: none;
|
|
864
|
+
width: 16px;
|
|
865
|
+
text-align: center;
|
|
866
|
+
padding: 0;
|
|
867
|
+
}
|
|
868
|
+
|
|
869
|
+
.inner-time::placeholder {
|
|
870
|
+
color: rgba(255, 255, 255, 0.3);
|
|
871
|
+
}
|
|
872
|
+
|
|
873
|
+
.date-input:disabled {
|
|
874
|
+
opacity: 0.5;
|
|
875
|
+
cursor: not-allowed;
|
|
876
|
+
}
|
|
877
|
+
|
|
878
|
+
.apply-btn {
|
|
879
|
+
padding: 4px 12px;
|
|
880
|
+
border: 1px solid rgba(255, 255, 255, 0.3);
|
|
881
|
+
border-radius: 4px;
|
|
882
|
+
background: transparent;
|
|
883
|
+
color: #fff;
|
|
884
|
+
font-size: 12px;
|
|
885
|
+
cursor: pointer;
|
|
886
|
+
white-space: nowrap;
|
|
887
|
+
}
|
|
888
|
+
|
|
889
|
+
.apply-btn.dirty {
|
|
890
|
+
background: rgba(255, 165, 0, 0.4);
|
|
891
|
+
border-color: rgba(255, 165, 0, 0.8);
|
|
892
|
+
}
|
|
893
|
+
|
|
894
|
+
.apply-btn:hover:not(:disabled) {
|
|
895
|
+
background: rgba(255, 255, 255, 0.2);
|
|
896
|
+
}
|
|
897
|
+
|
|
898
|
+
.apply-btn:disabled {
|
|
899
|
+
opacity: 0.4;
|
|
900
|
+
cursor: not-allowed;
|
|
901
|
+
}
|
|
902
|
+
|
|
903
|
+
.time-label {
|
|
904
|
+
font-size: 12px;
|
|
905
|
+
opacity: 0.7;
|
|
906
|
+
white-space: nowrap;
|
|
907
|
+
}
|
|
908
|
+
|
|
909
|
+
.spacer {
|
|
910
|
+
flex: 1;
|
|
911
|
+
}
|
|
912
|
+
|
|
913
|
+
.speed-group {
|
|
914
|
+
display: flex;
|
|
915
|
+
gap: 2px;
|
|
916
|
+
}
|
|
917
|
+
|
|
918
|
+
.speed-btn {
|
|
919
|
+
padding: 4px 8px;
|
|
920
|
+
border: 1px solid rgba(255, 255, 255, 0.3);
|
|
921
|
+
border-radius: 4px;
|
|
922
|
+
background: transparent;
|
|
923
|
+
color: #fff;
|
|
924
|
+
font-size: 12px;
|
|
925
|
+
cursor: pointer;
|
|
926
|
+
white-space: nowrap;
|
|
927
|
+
}
|
|
928
|
+
|
|
929
|
+
.speed-btn:hover {
|
|
930
|
+
background: rgba(255, 255, 255, 0.15);
|
|
931
|
+
}
|
|
932
|
+
|
|
933
|
+
.speed-btn.active {
|
|
934
|
+
background: rgba(255, 255, 255, 0.3);
|
|
935
|
+
border-color: #fff;
|
|
936
|
+
}
|
|
937
|
+
|
|
938
|
+
/* 2행: 재생 제어 + 시크바 */
|
|
939
|
+
.row-seek {
|
|
940
|
+
display: flex;
|
|
941
|
+
align-items: center;
|
|
942
|
+
gap: 8px;
|
|
943
|
+
}
|
|
944
|
+
|
|
945
|
+
.row-seek md-icon-button {
|
|
946
|
+
--md-icon-button-icon-size: 20px;
|
|
947
|
+
--md-icon-button-container-width: 36px;
|
|
948
|
+
--md-icon-button-container-height: 36px;
|
|
949
|
+
}
|
|
950
|
+
|
|
951
|
+
.row-seek md-icon-button.primary {
|
|
952
|
+
--md-icon-button-icon-size: 24px;
|
|
953
|
+
--md-icon-button-container-width: 40px;
|
|
954
|
+
--md-icon-button-container-height: 40px;
|
|
955
|
+
}
|
|
956
|
+
|
|
957
|
+
.row-seek md-icon {
|
|
958
|
+
font-variation-settings: 'FILL' 1;
|
|
959
|
+
}
|
|
960
|
+
|
|
961
|
+
.timeline {
|
|
962
|
+
flex: 1;
|
|
963
|
+
display: flex;
|
|
964
|
+
flex-direction: column;
|
|
965
|
+
gap: 2px;
|
|
966
|
+
min-width: 0;
|
|
967
|
+
}
|
|
968
|
+
|
|
969
|
+
.seek-track {
|
|
970
|
+
position: relative;
|
|
971
|
+
width: 100%;
|
|
972
|
+
height: 12px;
|
|
973
|
+
}
|
|
974
|
+
|
|
975
|
+
.seek-rail {
|
|
976
|
+
position: absolute;
|
|
977
|
+
top: 4px;
|
|
978
|
+
left: 0;
|
|
979
|
+
right: 0;
|
|
980
|
+
height: 4px;
|
|
981
|
+
background: rgba(255, 255, 255, 0.15);
|
|
982
|
+
border-radius: 2px;
|
|
983
|
+
}
|
|
984
|
+
|
|
985
|
+
.buffer-bar {
|
|
986
|
+
position: absolute;
|
|
987
|
+
top: 4px;
|
|
988
|
+
height: 4px;
|
|
989
|
+
background: rgba(255, 255, 255, 0.4);
|
|
990
|
+
border-radius: 2px;
|
|
991
|
+
pointer-events: none;
|
|
992
|
+
z-index: 1;
|
|
993
|
+
}
|
|
994
|
+
|
|
995
|
+
.seek-bar {
|
|
996
|
+
position: absolute;
|
|
997
|
+
top: 0;
|
|
998
|
+
left: 0;
|
|
999
|
+
width: 100%;
|
|
1000
|
+
height: 12px;
|
|
1001
|
+
-webkit-appearance: none;
|
|
1002
|
+
appearance: none;
|
|
1003
|
+
background: transparent;
|
|
1004
|
+
outline: none;
|
|
1005
|
+
cursor: pointer;
|
|
1006
|
+
z-index: 2;
|
|
1007
|
+
margin: 0;
|
|
1008
|
+
}
|
|
1009
|
+
|
|
1010
|
+
.seek-bar::-webkit-slider-runnable-track {
|
|
1011
|
+
height: 12px;
|
|
1012
|
+
background: transparent;
|
|
1013
|
+
}
|
|
1014
|
+
|
|
1015
|
+
.seek-bar::-webkit-slider-thumb {
|
|
1016
|
+
-webkit-appearance: none;
|
|
1017
|
+
width: 12px;
|
|
1018
|
+
height: 12px;
|
|
1019
|
+
border-radius: 50%;
|
|
1020
|
+
background: #fff;
|
|
1021
|
+
cursor: pointer;
|
|
1022
|
+
}
|
|
1023
|
+
|
|
1024
|
+
.seek-labels {
|
|
1025
|
+
display: flex;
|
|
1026
|
+
justify-content: space-between;
|
|
1027
|
+
font-size: 11px;
|
|
1028
|
+
opacity: 0.8;
|
|
1029
|
+
}
|
|
1030
|
+
|
|
1031
|
+
.current-time {
|
|
1032
|
+
font-size: 12px;
|
|
1033
|
+
opacity: 0.9;
|
|
1034
|
+
white-space: nowrap;
|
|
1035
|
+
min-width: 60px;
|
|
1036
|
+
text-align: center;
|
|
1037
|
+
}
|
|
1038
|
+
`;
|
|
1039
|
+
PlaybackControls.PREVIEW_THROTTLE_MS = 200;
|
|
1040
|
+
__decorate([
|
|
1041
|
+
property({ type: String })
|
|
1042
|
+
], PlaybackControls.prototype, "playbackState", void 0);
|
|
1043
|
+
__decorate([
|
|
1044
|
+
property({ type: Number })
|
|
1045
|
+
], PlaybackControls.prototype, "speed", void 0);
|
|
1046
|
+
__decorate([
|
|
1047
|
+
property({ type: String })
|
|
1048
|
+
], PlaybackControls.prototype, "currentTime", void 0);
|
|
1049
|
+
__decorate([
|
|
1050
|
+
property({ type: Array })
|
|
1051
|
+
], PlaybackControls.prototype, "bufferedRanges", void 0);
|
|
1052
|
+
__decorate([
|
|
1053
|
+
property({ type: Object })
|
|
1054
|
+
], PlaybackControls.prototype, "timeRange", void 0);
|
|
1055
|
+
__decorate([
|
|
1056
|
+
state()
|
|
1057
|
+
], PlaybackControls.prototype, "_pendingRange", void 0);
|
|
1058
|
+
__decorate([
|
|
1059
|
+
state()
|
|
1060
|
+
], PlaybackControls.prototype, "_pendingFrom", void 0);
|
|
1061
|
+
__decorate([
|
|
1062
|
+
state()
|
|
1063
|
+
], PlaybackControls.prototype, "_pendingTo", void 0);
|
|
1064
|
+
__decorate([
|
|
1065
|
+
state()
|
|
1066
|
+
], PlaybackControls.prototype, "_lastEdited", void 0);
|
|
1067
|
+
__decorate([
|
|
1068
|
+
state()
|
|
1069
|
+
], PlaybackControls.prototype, "_appliedFrom", void 0);
|
|
1070
|
+
__decorate([
|
|
1071
|
+
state()
|
|
1072
|
+
], PlaybackControls.prototype, "_appliedTo", void 0);
|
|
1073
|
+
__decorate([
|
|
1074
|
+
state()
|
|
1075
|
+
], PlaybackControls.prototype, "_seekValue", void 0);
|
|
1076
|
+
__decorate([
|
|
1077
|
+
state()
|
|
1078
|
+
], PlaybackControls.prototype, "_currentPlayTime", void 0);
|
|
1079
|
+
__decorate([
|
|
1080
|
+
state()
|
|
1081
|
+
], PlaybackControls.prototype, "_seeking", void 0);
|
|
1082
|
+
__decorate([
|
|
1083
|
+
state()
|
|
1084
|
+
], PlaybackControls.prototype, "_seekPreviewTime", void 0);
|
|
1085
|
+
PlaybackControls = PlaybackControls_1 = __decorate([
|
|
1086
|
+
customElement('ox-playback-controls')
|
|
1087
|
+
], PlaybackControls);
|
|
1088
|
+
export { PlaybackControls };
|
|
1089
|
+
//# sourceMappingURL=ox-playback-controls.js.map
|