${!this.showHeader && this.title && this.allowCollapse ? b `
${this.title}
` : !this.showHeader && this.title ? b `
${this.title}
` : ''}
${this.showHeader ? b `
` : ''}
${this.showConfig ? b `
` : ''}
${this.backgroundGraphs.length > 0 ? b `
${!this.legendCollapsed ? b `
${this.backgroundGraphs.map((bgGraph, graphIndex) => b `
${bgGraph.label || `Entity ${graphIndex + 1}`}
`)}
` : ''}
` : ''}
${this.collapsed ? b `
Click to expand
` : ''}
${this.showScrollNavLeft ? b `
◀
` : ''}
${this.showScrollNavRight ? b `
▶
` : ''}
Double-click to add • Drag to move • Right-click/hold to delete • ${this.keyframes.length} keyframes
`;
}
};
KeyframeTimeline.styles = i$3 `
:host {
display: block;
width: 100%;
--timeline-height: 400px;
--timeline-height-collapsed: 100px;
--timeline-bg: var(--card-background-color, #1c1c1c);
--timeline-track: var(--secondary-background-color, #2c2c2c);
--timeline-ruler: var(--divider-color, rgba(255, 255, 255, 0.12));
--keyframe-color: var(--accent-color, var(--primary-color, #03a9f4));
--keyframe-selected-color: var(--success-color, #4caf50);
--keyframe-dragging-color: var(--warning-color, #ff9800);
--canvas-text-primary: var(--primary-text-color, rgba(255, 255, 255, 0.9));
--canvas-text-secondary: var(--secondary-text-color, rgba(255, 255, 255, 0.7));
--canvas-grid-line: rgba(68, 68, 68, 0.3);
--canvas-grid-line-major: rgba(68, 68, 68, 0.5);
--canvas-label-bg: var(--card-background-color, rgba(0, 0, 0, 0.7));
--indicator-color: var(--accent-color, #ff9800);
}
.timeline-container {
background: var(--background);
border-radius: 4px;
padding: 0;
user-select: none;
}
.timeline-title {
font-size: 16px;
font-weight: 600;
color: var(--primary-text-color, #e1e1e1);
cursor: pointer;
user-select: none;
margin-bottom: 12px;
}
.timeline-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 12px;
color: var(--primary-text-color, #e1e1e1);
}
.timeline-header span {
cursor: pointer;
user-select: none;
}
.timeline-controls {
display: flex;
gap: 8px;
}
button {
background: var(--primary-color, #03a9f4);
color: var(--primary-text-color, white);
border: none;
padding: 6px 12px;
border-radius: 4px;
cursor: pointer;
font-size: 14px;
}
button:hover {
opacity: 0.9;
}
button:disabled {
opacity: 0.5;
cursor: not-allowed;
}
button.secondary {
background: var(--secondary-background-color, #2c2c2c);
border: 1px solid var(--divider-color, rgba(255, 255, 255, 0.12));
}
.config-panel {
background: var(--secondary-background-color, #2c2c2c);
border-radius: 4px;
padding: 12px;
margin-bottom: 12px;
}
.config-row {
display: flex;
align-items: center;
gap: 8px;
margin-bottom: 8px;
}
.config-row label {
min-width: 80px;
font-size: 14px;
}
input[type="number"], input[type="text"] {
background: var(--timeline-track);
color: var(--primary-text-color, #e1e1e1);
border: 1px solid var(--divider-color, rgba(255, 255, 255, 0.12));
border-radius: 4px;
padding: 4px 8px;
font-size: 14px;
}
.slot-list {
display: flex;
flex-direction: column;
gap: 6px;
margin-top: 8px;
}
.slot-item {
display: flex;
align-items: center;
gap: 8px;
padding: 4px;
background: var(--timeline-track);
border-radius: 4px;
}
.slot-color {
width: 20px;
height: 20px;
border-radius: 3px;
cursor: pointer;
border: 1px solid var(--divider-color, rgba(255, 255, 255, 0.12));
}
.timeline-canvas-wrapper {
width: 100%;
overflow-x: auto;
overflow-y: hidden;
background: var(--timeline-track);
border-radius: 4px;
transition: height 0.3s ease;
cursor: pointer;
scrollbar-width: thin;
scrollbar-color: var(--scrollbar-thumb-color, rgba(128, 128, 128, 0.4)) transparent;
}
.timeline-canvas-wrapper::-webkit-scrollbar {
height: 8px;
}
.timeline-canvas-wrapper::-webkit-scrollbar-track {
background: transparent;
}
.timeline-canvas-wrapper::-webkit-scrollbar-thumb {
background: var(--scrollbar-thumb-color, rgba(128, 128, 128, 0.4));
border-radius: 4px;
}
.timeline-canvas-wrapper::-webkit-scrollbar-thumb:hover {
background: var(--scrollbar-thumb-color-hover, rgba(128, 128, 128, 0.6));
}
.timeline-canvas-wrapper.expanded {
cursor: default;
}
.timeline-canvas-wrapper:not(.expanded) {
overflow-x: hidden;
}
.timeline-canvas {
min-width: max(100%, 800px);
height: var(--timeline-height);
background: var(--timeline-track);
cursor: crosshair;
position: relative;
touch-action: none;
transition: height 0.3s ease;
}
.timeline-canvas.collapsed {
min-width: 100%;
height: var(--timeline-height-collapsed);
cursor: pointer;
}
.timeline-canvas.dragging {
cursor: grabbing;
}
canvas {
display: block;
width: 100%;
height: 100%;
}
@media (max-width: 800px) {
.timeline-canvas:not(.collapsed) {
min-width: 800px;
}
}
.expand-hint {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
background: var(--card-background-color, rgba(0, 0, 0, 0.7));
color: var(--primary-text-color, white);
padding: 8px 16px;
border-radius: 4px;
font-size: 12px;
pointer-events: none;
opacity: 0;
transition: opacity 0.2s ease;
border: 1px solid var(--divider-color, rgba(255, 255, 255, 0.2));
}
.timeline-canvas-wrapper:hover .expand-hint {
opacity: 1;
}
.timeline-canvas-wrapper.expanded .expand-hint {
display: none;
}
.scroll-nav {
position: absolute;
top: 10px;
transform: none;
background: var(--card-background-color, rgba(0, 0, 0, 0.6));
color: var(--primary-text-color, white);
border: 1px solid var(--divider-color, rgba(255, 255, 255, 0.2));
border-radius: 4px;
width: 32px;
height: 32px;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
z-index: 10;
transition: background 0.2s ease;
user-select: none;
pointer-events: auto; /* Ensure button is clickable but doesn't block canvas unnecessarily */
}
.scroll-nav:hover {
background: var(--secondary-background-color, rgba(0, 0, 0, 0.8));
}
.scroll-nav.left {
left: -10px;
}
.scroll-nav.right {
right: -10px;
}
.graph-legend {
position: absolute;
top: 10px;
left: 70px;
z-index: 12;
min-width: 160px;
max-width: 240px;
background: rgba(0, 0, 0, 0.5);
border: 1px solid var(--divider-color, rgba(255, 255, 255, 0.2));
border-radius: 6px;
color: var(--canvas-text-primary);
font-size: 12px;
}
.graph-legend-header {
display: flex;
align-items: center;
gap: 6px;
padding: 6px 8px;
cursor: pointer;
user-select: none;
font-weight: 600;
}
.graph-legend-toggle {
display: inline-block;
font-size: 11px;
transform: rotate(90deg);
transition: transform 0.2s ease;
}
.graph-legend.collapsed .graph-legend-toggle {
transform: rotate(0deg);
}
.graph-legend-items {
padding: 0 8px 8px 8px;
display: flex;
flex-direction: column;
gap: 6px;
max-height: 180px;
overflow-y: auto;
}
.graph-legend-item {
display: flex;
align-items: center;
gap: 8px;
min-width: 0;
}
.graph-legend-swatch {
width: 10px;
height: 10px;
border-radius: 2px;
border: 1px solid var(--divider-color, rgba(255, 255, 255, 0.3));
flex: 0 0 auto;
}
.graph-legend-label {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
color: var(--canvas-text-secondary);
}
.cursor-tooltip {
position: absolute;
z-index: 20;
pointer-events: none;
background-color: rgba(var(--rgb-card-background-color, 224, 224, 224), 0.9);
background-image: none;
border: 1px solid var(--primary-color);
border-radius: 4px;
padding: 8px;
font-size: 13px;
line-height: 18px;
white-space: nowrap;
}
.cursor-tooltip-line {
color: var(--keyframe-color);
font-weight: 600;
opacity: 1;
}
.info {
margin-top: 12px;
font-size: 12px;
color: var(--secondary-text-color, #9e9e9e);
}
`;
__decorate([
n({ type: Number })
], KeyframeTimeline.prototype, "duration", void 0);
__decorate([
n({ type: Number })
], KeyframeTimeline.prototype, "slots", void 0);
__decorate([
n({ type: Array })
], KeyframeTimeline.prototype, "keyframes", void 0);
__decorate([
n({ type: Number })
], KeyframeTimeline.prototype, "previousDayEndValue", void 0);
__decorate([
n({ type: Number })
], KeyframeTimeline.prototype, "minValue", void 0);
__decorate([
n({ type: Number })
], KeyframeTimeline.prototype, "maxValue", void 0);
__decorate([
n({ type: Number })
], KeyframeTimeline.prototype, "snapValue", void 0);
__decorate([
n({ type: String })
], KeyframeTimeline.prototype, "xAxisLabel", void 0);
__decorate([
n({ type: String })
], KeyframeTimeline.prototype, "yAxisLabel", void 0);
__decorate([
n({ type: String })
], KeyframeTimeline.prototype, "title", void 0);
__decorate([
n({ type: Boolean })
], KeyframeTimeline.prototype, "showHeader", void 0);
__decorate([
n({ type: Boolean })
], KeyframeTimeline.prototype, "allowCollapse", void 0);
__decorate([
n({ type: Boolean })
], KeyframeTimeline.prototype, "readonly", void 0);
__decorate([
n({ type: Number })
], KeyframeTimeline.prototype, "indicatorTime", void 0);
__decorate([
n({ type: Boolean })
], KeyframeTimeline.prototype, "showCurrentTime", void 0);
__decorate([
n({ type: Array })
], KeyframeTimeline.prototype, "backgroundGraphs", void 0);
__decorate([
n({ type: Array })
], KeyframeTimeline.prototype, "advanceHistory", void 0);
__decorate([
n({ type: String, attribute: false })
], KeyframeTimeline.prototype, "tooltipMode", void 0);
__decorate([
r()
], KeyframeTimeline.prototype, "canvasWidth", void 0);
__decorate([
r()
], KeyframeTimeline.prototype, "canvasHeight", void 0);
__decorate([
r()
], KeyframeTimeline.prototype, "showConfig", void 0);
__decorate([
r()
], KeyframeTimeline.prototype, "draggingIndex", void 0);
__decorate([
r()
], KeyframeTimeline.prototype, "draggingSegment", void 0);
__decorate([
r()
], KeyframeTimeline.prototype, "selectedKeyframeIndex", void 0);
__decorate([
r()
], KeyframeTimeline.prototype, "collapsed", void 0);
__decorate([
r()
], KeyframeTimeline.prototype, "showScrollNavLeft", void 0);
__decorate([
r()
], KeyframeTimeline.prototype, "showScrollNavRight", void 0);
__decorate([
r()
], KeyframeTimeline.prototype, "undoStack", void 0);
__decorate([
r()
], KeyframeTimeline.prototype, "legendCollapsed", void 0);
KeyframeTimeline = __decorate([
t('keyframe-timeline')
], KeyframeTimeline);
export { KeyframeTimeline };
//# sourceMappingURL=keyframe-timeline.js.map