dialkit 1.4.0 → 1.4.1
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/dist/icons.d.ts +2 -1
- package/dist/icons.js +5 -0
- package/dist/icons.js.map +1 -1
- package/dist/index.cjs +177 -72
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +177 -72
- package/dist/index.js.map +1 -1
- package/dist/solid/index.js +339 -267
- package/dist/solid/index.js.map +1 -1
- package/dist/styles.css +110 -26
- package/dist/svelte/components/Timeline/DialTimeline.svelte +50 -1
- package/dist/svelte/components/Timeline/DialTimeline.svelte.d.ts.map +1 -1
- package/dist/svelte/components/Timeline/TimelineSection.svelte +74 -27
- package/dist/svelte/components/Timeline/TimelineSection.svelte.d.ts.map +1 -1
- package/dist/svelte/theme-css.d.ts +1 -1
- package/dist/svelte/theme-css.d.ts.map +1 -1
- package/dist/svelte/theme-css.js +110 -26
- package/dist/vue/index.js +123 -30
- package/dist/vue/index.js.map +1 -1
- package/package.json +1 -1
package/dist/styles.css
CHANGED
|
@@ -1453,29 +1453,52 @@
|
|
|
1453
1453
|
}
|
|
1454
1454
|
|
|
1455
1455
|
.dialkit-timeline-dock {
|
|
1456
|
+
position: relative;
|
|
1457
|
+
box-sizing: border-box;
|
|
1456
1458
|
background: var(--dial-glass-bg);
|
|
1457
1459
|
border: 1px solid var(--dial-border);
|
|
1458
1460
|
border-radius: 14px;
|
|
1459
1461
|
backdrop-filter: blur(var(--dial-backdrop-blur));
|
|
1460
1462
|
-webkit-backdrop-filter: blur(var(--dial-backdrop-blur));
|
|
1461
|
-
padding:
|
|
1463
|
+
padding: 0 12px 10px;
|
|
1462
1464
|
display: flex;
|
|
1463
1465
|
flex-direction: column;
|
|
1464
1466
|
gap: 10px;
|
|
1465
|
-
|
|
1467
|
+
overflow-x: hidden;
|
|
1466
1468
|
overflow-y: auto;
|
|
1467
1469
|
overscroll-behavior: contain;
|
|
1468
|
-
scrollbar-width:
|
|
1469
|
-
-
|
|
1470
|
+
scrollbar-width: thin;
|
|
1471
|
+
scrollbar-color: var(--dial-text-tertiary) transparent;
|
|
1472
|
+
}
|
|
1473
|
+
|
|
1474
|
+
.dialkit-timeline-resize-handle {
|
|
1475
|
+
position: absolute;
|
|
1476
|
+
top: -4px;
|
|
1477
|
+
left: 0;
|
|
1478
|
+
right: 0;
|
|
1479
|
+
z-index: 9;
|
|
1480
|
+
height: 10px;
|
|
1481
|
+
cursor: ns-resize;
|
|
1482
|
+
touch-action: none;
|
|
1470
1483
|
}
|
|
1471
1484
|
|
|
1472
1485
|
.dialkit-timeline-dock::-webkit-scrollbar {
|
|
1473
|
-
|
|
1486
|
+
width: 8px;
|
|
1487
|
+
}
|
|
1488
|
+
|
|
1489
|
+
.dialkit-timeline-dock::-webkit-scrollbar-track {
|
|
1490
|
+
background: transparent;
|
|
1491
|
+
}
|
|
1492
|
+
|
|
1493
|
+
.dialkit-timeline-dock::-webkit-scrollbar-thumb {
|
|
1494
|
+
border-radius: 999px;
|
|
1495
|
+
background: var(--dial-text-tertiary);
|
|
1474
1496
|
}
|
|
1475
1497
|
|
|
1476
1498
|
.dialkit-timeline-section {
|
|
1477
1499
|
--dial-timeline-label-w: 96px;
|
|
1478
1500
|
--dial-timeline-actions-w: 284px;
|
|
1501
|
+
--dial-timeline-header-h: calc(var(--dial-row-height) + 4px);
|
|
1479
1502
|
}
|
|
1480
1503
|
|
|
1481
1504
|
.dialkit-timeline-section + .dialkit-timeline-section {
|
|
@@ -1489,10 +1512,12 @@
|
|
|
1489
1512
|
align-items: center;
|
|
1490
1513
|
gap: 12px;
|
|
1491
1514
|
position: sticky;
|
|
1492
|
-
top:
|
|
1493
|
-
z-index:
|
|
1494
|
-
|
|
1495
|
-
|
|
1515
|
+
top: 0;
|
|
1516
|
+
z-index: 7;
|
|
1517
|
+
box-sizing: border-box;
|
|
1518
|
+
height: var(--dial-timeline-header-h);
|
|
1519
|
+
padding: 4px 0 0;
|
|
1520
|
+
margin: 0;
|
|
1496
1521
|
background: var(--dial-glass-bg);
|
|
1497
1522
|
backdrop-filter: blur(var(--dial-backdrop-blur));
|
|
1498
1523
|
-webkit-backdrop-filter: blur(var(--dial-backdrop-blur));
|
|
@@ -1657,10 +1682,51 @@
|
|
|
1657
1682
|
}
|
|
1658
1683
|
|
|
1659
1684
|
.dialkit-timeline-body {
|
|
1660
|
-
margin-top:
|
|
1685
|
+
margin-top: 0;
|
|
1661
1686
|
overflow: visible;
|
|
1662
1687
|
}
|
|
1663
1688
|
|
|
1689
|
+
.dialkit-timeline-scroll-row {
|
|
1690
|
+
position: sticky;
|
|
1691
|
+
bottom: -10px;
|
|
1692
|
+
z-index: 6;
|
|
1693
|
+
display: grid;
|
|
1694
|
+
grid-template-columns: var(--dial-timeline-label-w) minmax(0, 1fr);
|
|
1695
|
+
margin-top: 6px;
|
|
1696
|
+
margin-bottom: -10px;
|
|
1697
|
+
padding: 4px 0 10px;
|
|
1698
|
+
background: var(--dial-glass-bg);
|
|
1699
|
+
backdrop-filter: blur(var(--dial-backdrop-blur));
|
|
1700
|
+
-webkit-backdrop-filter: blur(var(--dial-backdrop-blur));
|
|
1701
|
+
}
|
|
1702
|
+
|
|
1703
|
+
.dialkit-timeline-horizontal-scroll {
|
|
1704
|
+
min-width: 0;
|
|
1705
|
+
height: 10px;
|
|
1706
|
+
overflow-x: auto;
|
|
1707
|
+
overflow-y: hidden;
|
|
1708
|
+
scrollbar-width: thin;
|
|
1709
|
+
scrollbar-color: var(--dial-text-tertiary) transparent;
|
|
1710
|
+
overscroll-behavior-x: contain;
|
|
1711
|
+
}
|
|
1712
|
+
|
|
1713
|
+
.dialkit-timeline-horizontal-scroll > div {
|
|
1714
|
+
height: 1px;
|
|
1715
|
+
}
|
|
1716
|
+
|
|
1717
|
+
.dialkit-timeline-horizontal-scroll::-webkit-scrollbar {
|
|
1718
|
+
height: 8px;
|
|
1719
|
+
}
|
|
1720
|
+
|
|
1721
|
+
.dialkit-timeline-horizontal-scroll::-webkit-scrollbar-track {
|
|
1722
|
+
background: transparent;
|
|
1723
|
+
}
|
|
1724
|
+
|
|
1725
|
+
.dialkit-timeline-horizontal-scroll::-webkit-scrollbar-thumb {
|
|
1726
|
+
border-radius: 999px;
|
|
1727
|
+
background: var(--dial-text-tertiary);
|
|
1728
|
+
}
|
|
1729
|
+
|
|
1664
1730
|
.dialkit-timeline-grid {
|
|
1665
1731
|
position: relative;
|
|
1666
1732
|
display: flex;
|
|
@@ -1704,7 +1770,13 @@
|
|
|
1704
1770
|
}
|
|
1705
1771
|
|
|
1706
1772
|
.dialkit-timeline-ruler-row {
|
|
1773
|
+
position: sticky;
|
|
1774
|
+
top: var(--dial-timeline-header-h);
|
|
1775
|
+
z-index: 6;
|
|
1707
1776
|
height: 28px;
|
|
1777
|
+
background: var(--dial-glass-bg);
|
|
1778
|
+
backdrop-filter: blur(var(--dial-backdrop-blur));
|
|
1779
|
+
-webkit-backdrop-filter: blur(var(--dial-backdrop-blur));
|
|
1708
1780
|
}
|
|
1709
1781
|
|
|
1710
1782
|
.dialkit-timeline-tick {
|
|
@@ -1947,15 +2019,36 @@
|
|
|
1947
2019
|
bottom: 0;
|
|
1948
2020
|
width: 12px;
|
|
1949
2021
|
margin-left: -6px;
|
|
1950
|
-
z-index: 5;
|
|
1951
2022
|
cursor: ew-resize;
|
|
1952
2023
|
touch-action: none;
|
|
1953
2024
|
}
|
|
1954
2025
|
|
|
2026
|
+
.dialkit-timeline-playhead-anchor {
|
|
2027
|
+
position: sticky;
|
|
2028
|
+
top: calc(var(--dial-timeline-header-h) + 14px);
|
|
2029
|
+
z-index: 8;
|
|
2030
|
+
width: 0;
|
|
2031
|
+
height: 0;
|
|
2032
|
+
margin-left: 6px;
|
|
2033
|
+
}
|
|
2034
|
+
|
|
2035
|
+
.dialkit-timeline-playhead-anchor::before {
|
|
2036
|
+
content: '';
|
|
2037
|
+
position: absolute;
|
|
2038
|
+
top: 0;
|
|
2039
|
+
left: -0.75px;
|
|
2040
|
+
width: 1.5px;
|
|
2041
|
+
height: 14px;
|
|
2042
|
+
border-radius: 1px;
|
|
2043
|
+
background: var(--dial-text-root);
|
|
2044
|
+
pointer-events: none;
|
|
2045
|
+
}
|
|
2046
|
+
|
|
1955
2047
|
.dialkit-timeline-playhead-flag {
|
|
1956
2048
|
position: absolute;
|
|
1957
|
-
top:
|
|
1958
|
-
left:
|
|
2049
|
+
top: 0;
|
|
2050
|
+
left: calc(var(--dial-timeline-playhead-flag-offset, 0px) - 26px);
|
|
2051
|
+
z-index: 1;
|
|
1959
2052
|
width: 52px;
|
|
1960
2053
|
height: 18px;
|
|
1961
2054
|
padding: 0 7px;
|
|
@@ -1972,29 +2065,21 @@
|
|
|
1972
2065
|
line-height: 16px;
|
|
1973
2066
|
text-align: center;
|
|
1974
2067
|
white-space: nowrap;
|
|
1975
|
-
transform:
|
|
2068
|
+
transform: translateY(-50%);
|
|
1976
2069
|
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.28);
|
|
1977
2070
|
transition: top 0.12s ease;
|
|
1978
2071
|
}
|
|
1979
2072
|
|
|
1980
|
-
.dialkit-timeline-playhead-control[data-placement="raised"] .dialkit-timeline-playhead-flag {
|
|
1981
|
-
top: -24px;
|
|
1982
|
-
}
|
|
1983
|
-
|
|
1984
2073
|
.dialkit-timeline-playhead-stem {
|
|
1985
2074
|
position: absolute;
|
|
1986
|
-
top:
|
|
2075
|
+
top: 28px;
|
|
1987
2076
|
bottom: 0;
|
|
1988
2077
|
left: 5.25px;
|
|
2078
|
+
z-index: 5;
|
|
1989
2079
|
width: 1.5px;
|
|
1990
2080
|
border-radius: 1px;
|
|
1991
2081
|
background: var(--dial-text-root);
|
|
1992
2082
|
pointer-events: none;
|
|
1993
|
-
transition: top 0.12s ease;
|
|
1994
|
-
}
|
|
1995
|
-
|
|
1996
|
-
.dialkit-timeline-playhead-control[data-placement="raised"] .dialkit-timeline-playhead-stem {
|
|
1997
|
-
top: -15px;
|
|
1998
2083
|
}
|
|
1999
2084
|
|
|
2000
2085
|
/* ── Timeline clip popover ── */
|
|
@@ -2073,13 +2158,12 @@
|
|
|
2073
2158
|
|
|
2074
2159
|
@media (max-width: 720px) {
|
|
2075
2160
|
.dialkit-timeline-dock {
|
|
2076
|
-
padding: 10px;
|
|
2161
|
+
padding: 0 10px 10px;
|
|
2077
2162
|
}
|
|
2078
2163
|
|
|
2079
2164
|
.dialkit-timeline-header {
|
|
2080
2165
|
grid-template-columns: auto minmax(40px, 1fr) auto;
|
|
2081
2166
|
gap: 8px;
|
|
2082
|
-
top: -10px;
|
|
2083
2167
|
}
|
|
2084
2168
|
|
|
2085
2169
|
.dialkit-timeline-section {
|
|
@@ -9,6 +9,9 @@
|
|
|
9
9
|
import type { DialTheme } from '../DialRoot.svelte';
|
|
10
10
|
import TimelineSection from './TimelineSection.svelte';
|
|
11
11
|
|
|
12
|
+
const DEFAULT_DOCK_MAX_HEIGHT = 400;
|
|
13
|
+
const MIN_DOCK_MAX_HEIGHT = 120;
|
|
14
|
+
|
|
12
15
|
let {
|
|
13
16
|
theme = 'system',
|
|
14
17
|
defaultVisible = true,
|
|
@@ -29,6 +32,9 @@
|
|
|
29
32
|
let mounted = $state(false);
|
|
30
33
|
let timelines = $state<TimelineMeta[]>([]);
|
|
31
34
|
let dockVisible = $state(TimelineUiStore.getVisible());
|
|
35
|
+
let dockMaxHeight = $state(DEFAULT_DOCK_MAX_HEIGHT);
|
|
36
|
+
let dockElement = $state<HTMLDivElement>();
|
|
37
|
+
let resizeCleanup: (() => void) | null = null;
|
|
32
38
|
|
|
33
39
|
$effect(() => {
|
|
34
40
|
if (typeof window === 'undefined') return;
|
|
@@ -61,12 +67,55 @@
|
|
|
61
67
|
onVisibilityChange,
|
|
62
68
|
});
|
|
63
69
|
});
|
|
70
|
+
|
|
71
|
+
$effect(() => () => resizeCleanup?.());
|
|
72
|
+
|
|
73
|
+
function handleResizePointerDown(event: PointerEvent) {
|
|
74
|
+
if (!dockElement) return;
|
|
75
|
+
event.preventDefault();
|
|
76
|
+
event.stopPropagation();
|
|
77
|
+
resizeCleanup?.();
|
|
78
|
+
|
|
79
|
+
const pointerY = event.clientY;
|
|
80
|
+
const startHeight = dockElement.getBoundingClientRect().height;
|
|
81
|
+
const move = (next: PointerEvent) => {
|
|
82
|
+
next.preventDefault();
|
|
83
|
+
const viewportMax = Math.max(MIN_DOCK_MAX_HEIGHT, window.innerHeight - 24);
|
|
84
|
+
dockMaxHeight = Math.min(
|
|
85
|
+
viewportMax,
|
|
86
|
+
Math.max(MIN_DOCK_MAX_HEIGHT, startHeight + pointerY - next.clientY)
|
|
87
|
+
);
|
|
88
|
+
};
|
|
89
|
+
const finish = () => {
|
|
90
|
+
window.removeEventListener('pointermove', move);
|
|
91
|
+
window.removeEventListener('pointerup', finish);
|
|
92
|
+
window.removeEventListener('pointercancel', finish);
|
|
93
|
+
resizeCleanup = null;
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
window.addEventListener('pointermove', move, { passive: false });
|
|
97
|
+
window.addEventListener('pointerup', finish);
|
|
98
|
+
window.addEventListener('pointercancel', finish);
|
|
99
|
+
resizeCleanup = finish;
|
|
100
|
+
}
|
|
64
101
|
</script>
|
|
65
102
|
|
|
66
103
|
{#if productionEnabled && mounted && timelines.length > 0}
|
|
67
104
|
<Portal target="body">
|
|
68
105
|
<div class="dialkit-root dialkit-timeline" data-theme={theme} hidden={!dockVisible}>
|
|
69
|
-
<div
|
|
106
|
+
<div
|
|
107
|
+
class="dialkit-timeline-resize-handle"
|
|
108
|
+
onpointerdown={handleResizePointerDown}
|
|
109
|
+
role="separator"
|
|
110
|
+
aria-label="Resize timeline height"
|
|
111
|
+
aria-orientation="horizontal"
|
|
112
|
+
title="Drag to resize timeline"
|
|
113
|
+
></div>
|
|
114
|
+
<div
|
|
115
|
+
bind:this={dockElement}
|
|
116
|
+
class="dialkit-timeline-dock"
|
|
117
|
+
style:max-height={`min(${dockMaxHeight}px, calc(100vh - 24px))`}
|
|
118
|
+
>
|
|
70
119
|
{#each timelines as timeline (timeline.id)}
|
|
71
120
|
<TimelineSection meta={timeline} {defaultOpen} {theme} {dockVisible} />
|
|
72
121
|
{/each}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DialTimeline.svelte.d.ts","sourceRoot":"","sources":["../../../../src/svelte/components/Timeline/DialTimeline.svelte.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAGnD,KAAK,gBAAgB,GAAG;IACrB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,kBAAkB,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAChD,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B,CAAC;
|
|
1
|
+
{"version":3,"file":"DialTimeline.svelte.d.ts","sourceRoot":"","sources":["../../../../src/svelte/components/Timeline/DialTimeline.svelte.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAGnD,KAAK,gBAAgB,GAAG;IACrB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,kBAAkB,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAChD,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B,CAAC;AA2GJ,QAAA,MAAM,YAAY,sDAAwC,CAAC;AAC3D,KAAK,YAAY,GAAG,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC;AACpD,eAAe,YAAY,CAAC"}
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
ICON_CLIPBOARD,
|
|
25
25
|
ICON_PAUSE,
|
|
26
26
|
ICON_PLAY,
|
|
27
|
+
ICON_REPLAY,
|
|
27
28
|
} from '../../../icons';
|
|
28
29
|
import { findControl } from '../../../shortcut-utils';
|
|
29
30
|
import PresetManager from '../PresetManager.svelte';
|
|
@@ -43,6 +44,7 @@
|
|
|
43
44
|
];
|
|
44
45
|
const MIN_TIMELINE_MAX_ZOOM = 8;
|
|
45
46
|
const PLAYHEAD_FLAG_WIDTH = 52;
|
|
47
|
+
const PLAYHEAD_FLAG_EDGE_OVERHANG = 1;
|
|
46
48
|
const ZOOM_DRAG_DISTANCE = 180;
|
|
47
49
|
|
|
48
50
|
type ZoomDragState = {
|
|
@@ -105,10 +107,8 @@
|
|
|
105
107
|
let values = $state<Record<string, DialValue>>(DialStore.getValues(untrack(() => meta.id)));
|
|
106
108
|
let transport = $state<TimelineTransport>(TimelineStore.getTransport(untrack(() => meta.id)));
|
|
107
109
|
let laneArea = $state<HTMLDivElement>();
|
|
108
|
-
let
|
|
109
|
-
let actionsElement = $state<HTMLDivElement>();
|
|
110
|
+
let horizontalScrollElement = $state<HTMLDivElement>();
|
|
110
111
|
let laneWidth = $state(0);
|
|
111
|
-
let flagClearRange = $state({ start: 0, end: 0 });
|
|
112
112
|
|
|
113
113
|
let zoomDrag: ZoomDragState | null = null;
|
|
114
114
|
let rulerScrub: ScrubState | null = null;
|
|
@@ -138,12 +138,15 @@
|
|
|
138
138
|
const playheadVisible = $derived(
|
|
139
139
|
transport.time >= safeViewStart && transport.time <= viewEnd && laneWidth > 0
|
|
140
140
|
);
|
|
141
|
-
const
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
141
|
+
const playheadFlagCenter = $derived(clamp(
|
|
142
|
+
playheadX,
|
|
143
|
+
PLAYHEAD_FLAG_WIDTH / 2 - PLAYHEAD_FLAG_EDGE_OVERHANG,
|
|
144
|
+
laneWidth - PLAYHEAD_FLAG_WIDTH / 2 + PLAYHEAD_FLAG_EDGE_OVERHANG
|
|
145
|
+
));
|
|
146
|
+
const playheadFlagOffset = $derived(playheadFlagCenter - playheadX);
|
|
147
|
+
const playheadEdge = $derived(
|
|
148
|
+
playheadFlagOffset > 0.5 ? 'start' : playheadFlagOffset < -0.5 ? 'end' : 'center'
|
|
149
|
+
);
|
|
147
150
|
const overviewViewportWidth = $derived(
|
|
148
151
|
meta.duration > 0 ? ((viewEnd - safeViewStart) / meta.duration) * 100 : 100
|
|
149
152
|
);
|
|
@@ -243,23 +246,13 @@
|
|
|
243
246
|
});
|
|
244
247
|
|
|
245
248
|
$effect(() => {
|
|
246
|
-
if (!open || !laneArea
|
|
249
|
+
if (!open || !laneArea) return;
|
|
247
250
|
const measure = () => {
|
|
248
|
-
if (
|
|
249
|
-
const rulerRect = laneArea.getBoundingClientRect();
|
|
250
|
-
const titleRect = titleElement.getBoundingClientRect();
|
|
251
|
-
const actionsRect = actionsElement.getBoundingClientRect();
|
|
252
|
-
laneWidth = rulerRect.width;
|
|
253
|
-
flagClearRange = {
|
|
254
|
-
start: Math.round(titleRect.right + 10 - rulerRect.left),
|
|
255
|
-
end: Math.round(actionsRect.left - 10 - rulerRect.left),
|
|
256
|
-
};
|
|
251
|
+
if (laneArea) laneWidth = laneArea.getBoundingClientRect().width;
|
|
257
252
|
};
|
|
258
253
|
measure();
|
|
259
254
|
const observer = new ResizeObserver(measure);
|
|
260
255
|
observer.observe(laneArea);
|
|
261
|
-
observer.observe(titleElement);
|
|
262
|
-
observer.observe(actionsElement);
|
|
263
256
|
return () => observer.disconnect();
|
|
264
257
|
});
|
|
265
258
|
|
|
@@ -270,6 +263,14 @@
|
|
|
270
263
|
if (nextStart !== viewStart) viewStart = nextStart;
|
|
271
264
|
});
|
|
272
265
|
|
|
266
|
+
$effect(() => {
|
|
267
|
+
if (!open || !horizontalScrollElement || pxPerSecond <= 0) return;
|
|
268
|
+
const next = safeViewStart * pxPerSecond;
|
|
269
|
+
if (Math.abs(horizontalScrollElement.scrollLeft - next) > 0.5) {
|
|
270
|
+
horizontalScrollElement.scrollLeft = next;
|
|
271
|
+
}
|
|
272
|
+
});
|
|
273
|
+
|
|
273
274
|
$effect(() => {
|
|
274
275
|
if (!dockVisible) popover = null;
|
|
275
276
|
});
|
|
@@ -285,6 +286,32 @@
|
|
|
285
286
|
viewStart = 0;
|
|
286
287
|
}
|
|
287
288
|
|
|
289
|
+
function handleReplay() {
|
|
290
|
+
viewStart = 0;
|
|
291
|
+
TimelineStore.replay(meta.id);
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
function handleHorizontalScroll(event: Event) {
|
|
295
|
+
if (pxPerSecond <= 0) return;
|
|
296
|
+
viewStart = clampViewStart(
|
|
297
|
+
(event.currentTarget as HTMLDivElement).scrollLeft / pxPerSecond,
|
|
298
|
+
meta.duration,
|
|
299
|
+
visibleDuration
|
|
300
|
+
);
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
function handleTimelineWheel(event: WheelEvent) {
|
|
304
|
+
if (!horizontalScrollElement || zoom <= 1) return;
|
|
305
|
+
const delta = Math.abs(event.deltaX) > Math.abs(event.deltaY)
|
|
306
|
+
? event.deltaX
|
|
307
|
+
: event.shiftKey
|
|
308
|
+
? event.deltaY
|
|
309
|
+
: 0;
|
|
310
|
+
if (delta === 0) return;
|
|
311
|
+
event.preventDefault();
|
|
312
|
+
horizontalScrollElement.scrollLeft += delta;
|
|
313
|
+
}
|
|
314
|
+
|
|
288
315
|
function seek(scrub: ScrubState | null, clientX: number) {
|
|
289
316
|
if (!scrub || scrub.rect.width <= 0) return;
|
|
290
317
|
TimelineStore.seek(meta.id, clamp(
|
|
@@ -506,7 +533,7 @@
|
|
|
506
533
|
<div class="dialkit-timeline-section">
|
|
507
534
|
<div class="dialkit-timeline-header" data-open={open || undefined}>
|
|
508
535
|
<div class="dialkit-timeline-identity">
|
|
509
|
-
<span
|
|
536
|
+
<span class="dialkit-timeline-title">{meta.name}</span>
|
|
510
537
|
</div>
|
|
511
538
|
|
|
512
539
|
{#if !open}
|
|
@@ -536,7 +563,7 @@
|
|
|
536
563
|
</div>
|
|
537
564
|
{/if}
|
|
538
565
|
|
|
539
|
-
<div
|
|
566
|
+
<div class="dialkit-timeline-actions">
|
|
540
567
|
<button
|
|
541
568
|
class="dialkit-toolbar-add"
|
|
542
569
|
onclick={() => transport.playing ? TimelineStore.pause(meta.id) : TimelineStore.play(meta.id)}
|
|
@@ -555,6 +582,11 @@
|
|
|
555
582
|
{/if}
|
|
556
583
|
</span>
|
|
557
584
|
</button>
|
|
585
|
+
<button class="dialkit-toolbar-add" onclick={handleReplay} title="Replay" aria-label="Replay">
|
|
586
|
+
<svg viewBox="0 0 24 24" fill="none" aria-hidden="true" style="width:16px;height:16px;color:var(--dial-text-label);">
|
|
587
|
+
{#each ICON_REPLAY as path}<path d={path} fill="currentColor" />{/each}
|
|
588
|
+
</svg>
|
|
589
|
+
</button>
|
|
558
590
|
<button class="dialkit-toolbar-add" onclick={handleAddPreset} title="Add timeline version" aria-label="Add timeline version">
|
|
559
591
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
|
560
592
|
{#each ICON_ADD_PRESET as path}<path d={path} />{/each}
|
|
@@ -598,6 +630,7 @@
|
|
|
598
630
|
{#if open}
|
|
599
631
|
<div
|
|
600
632
|
class="dialkit-timeline-body"
|
|
633
|
+
onwheel={handleTimelineWheel}
|
|
601
634
|
onpointerdown={handleTrackPointerDown}
|
|
602
635
|
onpointermove={(event) => trackScrub && seek(trackScrub, event.clientX)}
|
|
603
636
|
onpointerup={finishTrack}
|
|
@@ -726,9 +759,8 @@
|
|
|
726
759
|
{#if pxPerSecond > 0 && playheadVisible}
|
|
727
760
|
<div
|
|
728
761
|
class="dialkit-timeline-playhead-control"
|
|
729
|
-
data-edge=
|
|
730
|
-
|
|
731
|
-
style:left={`calc(var(--dial-timeline-label-w) + ${playheadX}px)`}
|
|
762
|
+
data-edge={playheadEdge}
|
|
763
|
+
style={`left:calc(var(--dial-timeline-label-w) + ${playheadX}px);--dial-timeline-playhead-flag-offset:${playheadFlagOffset}px;`}
|
|
732
764
|
onpointerdown={handlePlayheadPointerDown}
|
|
733
765
|
onpointermove={(event) => playheadScrub && seek(playheadScrub, event.clientX)}
|
|
734
766
|
onpointerup={finishPlayhead}
|
|
@@ -742,11 +774,26 @@
|
|
|
742
774
|
aria-valuenow={transport.time}
|
|
743
775
|
title="Drag to scrub the timeline"
|
|
744
776
|
>
|
|
745
|
-
<div class="dialkit-timeline-playhead-flag">{transport.time.toFixed(2)}</div>
|
|
746
777
|
<div class="dialkit-timeline-playhead-stem"></div>
|
|
778
|
+
<div class="dialkit-timeline-playhead-anchor">
|
|
779
|
+
<div class="dialkit-timeline-playhead-flag">{transport.time.toFixed(2)}</div>
|
|
780
|
+
</div>
|
|
747
781
|
</div>
|
|
748
782
|
{/if}
|
|
749
783
|
</div>
|
|
784
|
+
{#if zoom > 1}
|
|
785
|
+
<div class="dialkit-timeline-scroll-row">
|
|
786
|
+
<div class="dialkit-timeline-label"></div>
|
|
787
|
+
<div
|
|
788
|
+
bind:this={horizontalScrollElement}
|
|
789
|
+
class="dialkit-timeline-horizontal-scroll"
|
|
790
|
+
onscroll={handleHorizontalScroll}
|
|
791
|
+
aria-label="Timeline horizontal scroll"
|
|
792
|
+
>
|
|
793
|
+
<div style:width={`${laneWidth * zoom}px`}></div>
|
|
794
|
+
</div>
|
|
795
|
+
</div>
|
|
796
|
+
{/if}
|
|
750
797
|
</div>
|
|
751
798
|
{/if}
|
|
752
799
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TimelineSection.svelte.d.ts","sourceRoot":"","sources":["../../../../src/svelte/components/Timeline/TimelineSection.svelte.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAGR,YAAY,EAGb,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"TimelineSection.svelte.d.ts","sourceRoot":"","sources":["../../../../src/svelte/components/Timeline/TimelineSection.svelte.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAGR,YAAY,EAGb,MAAM,kBAAkB,CAAC;AAY5B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAgDnD,KAAK,gBAAgB,GAAG;IACrB,IAAI,EAAE,YAAY,CAAC;IACnB,WAAW,EAAE,OAAO,CAAC;IACrB,KAAK,EAAE,SAAS,CAAC;IACjB,WAAW,EAAE,OAAO,CAAC;CACtB,CAAC;AA4mBJ,QAAA,MAAM,eAAe,sDAAwC,CAAC;AAC9D,KAAK,eAAe,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC;AAC1D,eAAe,eAAe,CAAC"}
|