dialkit 1.4.0 → 1.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/icons.d.ts +2 -1
- package/dist/icons.js +5 -0
- package/dist/icons.js.map +1 -1
- package/dist/index.cjs +179 -72
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +179 -72
- package/dist/index.js.map +1 -1
- package/dist/solid/index.js +341 -267
- package/dist/solid/index.js.map +1 -1
- package/dist/styles.css +111 -29
- package/dist/svelte/components/Slider.svelte +2 -0
- 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 +111 -29
- package/dist/vue/index.js +127 -30
- package/dist/vue/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1038,6 +1038,10 @@ var ICON_PAUSE = [
|
|
|
1038
1038
|
"M16.75 3C15.2312 3 14 4.23122 14 5.75V18.25C14 19.7688 15.2312 21 16.75 21H17.25C18.7688 21 20 19.7688 20 18.25V5.75C20 4.23122 18.7688 3 17.25 3H16.75Z"
|
|
1039
1039
|
];
|
|
1040
1040
|
var ICON_PLAY = "M9.24394 2.36758C7.41419 1.18362 5 2.49701 5 4.67639V19.3238C5 21.5032 7.41419 22.8166 9.24394 21.6326L20.5624 14.3089C22.2371 13.2253 22.2372 10.775 20.5624 9.69129L9.24394 2.36758Z";
|
|
1041
|
+
var ICON_REPLAY = [
|
|
1042
|
+
"M12 2.5C17.2466 2.50016 21.5 6.7534 21.5 12C21.5 17.2466 17.2466 21.4998 12 21.5C7.52191 21.5 3.76987 18.4025 2.76465 14.2344C2.63517 13.6975 2.96508 13.1578 3.50195 13.0283C4.03883 12.8988 4.57851 13.2288 4.70801 13.7656C5.5016 17.0563 8.46701 19.5 12 19.5C16.142 19.4998 19.5 16.142 19.5 12C19.5 7.85796 16.142 4.50016 12 4.5C9.32981 4.5 6.98389 5.89541 5.6543 8H7.5C8.05228 8 8.5 8.44772 8.5 9C8.5 9.55228 8.05228 10 7.5 10H3.5C2.94772 10 2.5 9.55228 2.5 9V5C2.5 4.44772 2.94772 4 3.5 4C4.05228 4 4.5 4.44772 4.5 5V6.16797C6.2376 3.93677 8.95063 2.5 12 2.5Z",
|
|
1043
|
+
"M10 9.94043C10 9.33379 10.6826 8.97849 11.1797 9.32617L14.1221 11.3857C14.5486 11.6843 14.5486 12.3157 14.1221 12.6143L11.1797 14.6738C10.6826 15.0215 10 14.6662 10 14.0596V9.94043Z"
|
|
1044
|
+
];
|
|
1041
1045
|
var ICON_TIMELINE = [
|
|
1042
1046
|
"M18.868 10C20.8517 10.0003 22.2886 11.8914 21.7577 13.8027L20.369 18.8027C20.0083 20.1012 18.826 20.9999 17.4784 21H6.51941C5.17179 21 3.98948 20.1012 3.62878 18.8027L2.24011 13.8027C1.7092 11.8913 3.14603 10.0003 5.12976 10H18.868Z",
|
|
1043
1047
|
"M18.9989 6.5C19.5511 6.50007 19.9989 6.94776 19.9989 7.5C19.9989 8.05224 19.5511 8.49993 18.9989 8.5H4.9989C4.44661 8.5 3.9989 8.05228 3.9989 7.5C3.9989 6.94772 4.44661 6.5 4.9989 6.5H18.9989Z",
|
|
@@ -1834,6 +1838,7 @@ function Slider({
|
|
|
1834
1838
|
onChange: handleInputChange,
|
|
1835
1839
|
onKeyDown: handleInputKeyDown,
|
|
1836
1840
|
onBlur: handleInputBlur,
|
|
1841
|
+
onPointerDown: (e) => e.stopPropagation(),
|
|
1837
1842
|
onClick: (e) => e.stopPropagation(),
|
|
1838
1843
|
onMouseDown: (e) => e.stopPropagation()
|
|
1839
1844
|
}
|
|
@@ -1845,6 +1850,7 @@ function Slider({
|
|
|
1845
1850
|
onMouseEnter: () => setIsValueHovered(true),
|
|
1846
1851
|
onMouseLeave: () => setIsValueHovered(false),
|
|
1847
1852
|
onClick: handleValueClick,
|
|
1853
|
+
onPointerDown: (e) => isValueEditable && e.stopPropagation(),
|
|
1848
1854
|
onMouseDown: (e) => isValueEditable && e.stopPropagation(),
|
|
1849
1855
|
style: { cursor: isValueEditable ? "text" : "default" },
|
|
1850
1856
|
children: displayValue
|
|
@@ -4235,8 +4241,11 @@ var SECOND_TICK_STEPS = [
|
|
|
4235
4241
|
];
|
|
4236
4242
|
var MIN_TIMELINE_MAX_ZOOM = 8;
|
|
4237
4243
|
var PLAYHEAD_FLAG_WIDTH = 52;
|
|
4244
|
+
var PLAYHEAD_FLAG_EDGE_OVERHANG = 1;
|
|
4238
4245
|
var POPOVER_WIDTH = 280;
|
|
4239
4246
|
var ZOOM_DRAG_DISTANCE = 180;
|
|
4247
|
+
var DEFAULT_DOCK_MAX_HEIGHT = 400;
|
|
4248
|
+
var MIN_DOCK_MAX_HEIGHT = 120;
|
|
4240
4249
|
var subscribeGlobalTimelines = (callback) => TimelineStore.subscribeGlobal(callback);
|
|
4241
4250
|
var getTimelines = () => TimelineStore.getTimelines();
|
|
4242
4251
|
var subscribeTimelineVisibility = (callback) => TimelineUiStore.subscribe(callback);
|
|
@@ -4269,7 +4278,10 @@ function DialTimelineDock({
|
|
|
4269
4278
|
defaultOpen
|
|
4270
4279
|
}) {
|
|
4271
4280
|
const [mounted, setMounted] = useState11(false);
|
|
4281
|
+
const [dockMaxHeight, setDockMaxHeight] = useState11(DEFAULT_DOCK_MAX_HEIGHT);
|
|
4272
4282
|
const visibilityControllerId = useRef14(/* @__PURE__ */ Symbol("dialkit-timeline-visibility"));
|
|
4283
|
+
const dockRef = useRef14(null);
|
|
4284
|
+
const resizeCleanupRef = useRef14(null);
|
|
4273
4285
|
useEffect11(() => TimelineUiStore.registerController(visibilityControllerId.current, {
|
|
4274
4286
|
visible,
|
|
4275
4287
|
defaultVisible,
|
|
@@ -4285,6 +4297,31 @@ function DialTimelineDock({
|
|
|
4285
4297
|
useEffect11(() => {
|
|
4286
4298
|
setMounted(true);
|
|
4287
4299
|
}, []);
|
|
4300
|
+
useEffect11(() => () => resizeCleanupRef.current?.(), []);
|
|
4301
|
+
const handleResizePointerDown = useCallback14((e) => {
|
|
4302
|
+
const dock = dockRef.current;
|
|
4303
|
+
if (!dock) return;
|
|
4304
|
+
e.preventDefault();
|
|
4305
|
+
e.stopPropagation();
|
|
4306
|
+
resizeCleanupRef.current?.();
|
|
4307
|
+
const pointerY = e.clientY;
|
|
4308
|
+
const startHeight = dock.getBoundingClientRect().height;
|
|
4309
|
+
const handlePointerMove = (event) => {
|
|
4310
|
+
event.preventDefault();
|
|
4311
|
+
const viewportMax = Math.max(MIN_DOCK_MAX_HEIGHT, window.innerHeight - 24);
|
|
4312
|
+
setDockMaxHeight(clamp(startHeight + pointerY - event.clientY, MIN_DOCK_MAX_HEIGHT, viewportMax));
|
|
4313
|
+
};
|
|
4314
|
+
const finishResize = () => {
|
|
4315
|
+
window.removeEventListener("pointermove", handlePointerMove);
|
|
4316
|
+
window.removeEventListener("pointerup", finishResize);
|
|
4317
|
+
window.removeEventListener("pointercancel", finishResize);
|
|
4318
|
+
resizeCleanupRef.current = null;
|
|
4319
|
+
};
|
|
4320
|
+
window.addEventListener("pointermove", handlePointerMove, { passive: false });
|
|
4321
|
+
window.addEventListener("pointerup", finishResize);
|
|
4322
|
+
window.addEventListener("pointercancel", finishResize);
|
|
4323
|
+
resizeCleanupRef.current = finishResize;
|
|
4324
|
+
}, []);
|
|
4288
4325
|
const timelines = useSyncExternalStore7(subscribeGlobalTimelines, getTimelines, getTimelines);
|
|
4289
4326
|
const dockVisible = useSyncExternalStore7(
|
|
4290
4327
|
subscribeTimelineVisibility,
|
|
@@ -4295,16 +4332,37 @@ function DialTimelineDock({
|
|
|
4295
4332
|
return null;
|
|
4296
4333
|
}
|
|
4297
4334
|
return createPortal4(
|
|
4298
|
-
/* @__PURE__ */
|
|
4299
|
-
|
|
4300
|
-
|
|
4301
|
-
|
|
4302
|
-
|
|
4303
|
-
|
|
4304
|
-
|
|
4305
|
-
|
|
4306
|
-
|
|
4307
|
-
|
|
4335
|
+
/* @__PURE__ */ jsxs14("div", { className: "dialkit-root dialkit-timeline", "data-theme": theme, hidden: !dockVisible, children: [
|
|
4336
|
+
/* @__PURE__ */ jsx18(
|
|
4337
|
+
"div",
|
|
4338
|
+
{
|
|
4339
|
+
className: "dialkit-timeline-resize-handle",
|
|
4340
|
+
onPointerDown: handleResizePointerDown,
|
|
4341
|
+
role: "separator",
|
|
4342
|
+
"aria-label": "Resize timeline height",
|
|
4343
|
+
"aria-orientation": "horizontal",
|
|
4344
|
+
title: "Drag to resize timeline"
|
|
4345
|
+
}
|
|
4346
|
+
),
|
|
4347
|
+
/* @__PURE__ */ jsx18(
|
|
4348
|
+
"div",
|
|
4349
|
+
{
|
|
4350
|
+
ref: dockRef,
|
|
4351
|
+
className: "dialkit-timeline-dock",
|
|
4352
|
+
style: { maxHeight: `min(${dockMaxHeight}px, calc(100vh - 24px))` },
|
|
4353
|
+
children: timelines.map((timeline) => /* @__PURE__ */ jsx18(
|
|
4354
|
+
TimelineSection,
|
|
4355
|
+
{
|
|
4356
|
+
meta: timeline,
|
|
4357
|
+
defaultOpen,
|
|
4358
|
+
theme,
|
|
4359
|
+
dockVisible
|
|
4360
|
+
},
|
|
4361
|
+
timeline.id
|
|
4362
|
+
))
|
|
4363
|
+
}
|
|
4364
|
+
)
|
|
4365
|
+
] }),
|
|
4308
4366
|
document.body
|
|
4309
4367
|
);
|
|
4310
4368
|
}
|
|
@@ -4356,6 +4414,20 @@ function PlayPauseButton({ id }) {
|
|
|
4356
4414
|
}
|
|
4357
4415
|
);
|
|
4358
4416
|
}
|
|
4417
|
+
function ReplayButton({ onReplay }) {
|
|
4418
|
+
return /* @__PURE__ */ jsx18(
|
|
4419
|
+
motion7.button,
|
|
4420
|
+
{
|
|
4421
|
+
className: "dialkit-toolbar-add",
|
|
4422
|
+
onClick: onReplay,
|
|
4423
|
+
title: "Replay",
|
|
4424
|
+
"aria-label": "Replay",
|
|
4425
|
+
whileTap: { scale: 0.9 },
|
|
4426
|
+
transition: { type: "spring", visualDuration: 0.15, bounce: 0.3 },
|
|
4427
|
+
children: /* @__PURE__ */ jsx18("svg", { viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: ICON_REPLAY.map((d, i) => /* @__PURE__ */ jsx18("path", { d, fill: "currentColor" }, i)) })
|
|
4428
|
+
}
|
|
4429
|
+
);
|
|
4430
|
+
}
|
|
4359
4431
|
function TimelinePlayheadFlag({
|
|
4360
4432
|
id,
|
|
4361
4433
|
duration,
|
|
@@ -4364,8 +4436,6 @@ function TimelinePlayheadFlag({
|
|
|
4364
4436
|
viewEnd,
|
|
4365
4437
|
laneWidth,
|
|
4366
4438
|
rulerRef,
|
|
4367
|
-
headerClearStart,
|
|
4368
|
-
headerClearEnd,
|
|
4369
4439
|
onResetView
|
|
4370
4440
|
}) {
|
|
4371
4441
|
const subscribe = useTransportSubscribe(id);
|
|
@@ -4425,16 +4495,22 @@ function TimelinePlayheadFlag({
|
|
|
4425
4495
|
0,
|
|
4426
4496
|
laneWidth
|
|
4427
4497
|
);
|
|
4428
|
-
const
|
|
4429
|
-
|
|
4430
|
-
|
|
4498
|
+
const flagCenter = clamp(
|
|
4499
|
+
x,
|
|
4500
|
+
PLAYHEAD_FLAG_WIDTH / 2 - PLAYHEAD_FLAG_EDGE_OVERHANG,
|
|
4501
|
+
laneWidth - PLAYHEAD_FLAG_WIDTH / 2 + PLAYHEAD_FLAG_EDGE_OVERHANG
|
|
4502
|
+
);
|
|
4503
|
+
const flagOffset = flagCenter - x;
|
|
4504
|
+
const edge = flagOffset > 0.5 ? "start" : flagOffset < -0.5 ? "end" : "center";
|
|
4431
4505
|
return /* @__PURE__ */ jsxs14(
|
|
4432
4506
|
"div",
|
|
4433
4507
|
{
|
|
4434
4508
|
className: "dialkit-timeline-playhead-control",
|
|
4435
|
-
"data-edge":
|
|
4436
|
-
|
|
4437
|
-
|
|
4509
|
+
"data-edge": edge,
|
|
4510
|
+
style: {
|
|
4511
|
+
left: `calc(var(--dial-timeline-label-w) + ${x}px)`,
|
|
4512
|
+
"--dial-timeline-playhead-flag-offset": `${flagOffset}px`
|
|
4513
|
+
},
|
|
4438
4514
|
onPointerDown: handlePointerDown,
|
|
4439
4515
|
role: "slider",
|
|
4440
4516
|
"aria-label": "Timeline current time",
|
|
@@ -4443,8 +4519,8 @@ function TimelinePlayheadFlag({
|
|
|
4443
4519
|
"aria-valuenow": time,
|
|
4444
4520
|
title: "Drag to scrub the timeline",
|
|
4445
4521
|
children: [
|
|
4446
|
-
/* @__PURE__ */ jsx18("div", { className: "dialkit-timeline-playhead-
|
|
4447
|
-
/* @__PURE__ */ jsx18("div", { className: "dialkit-timeline-playhead-
|
|
4522
|
+
/* @__PURE__ */ jsx18("div", { className: "dialkit-timeline-playhead-stem" }),
|
|
4523
|
+
/* @__PURE__ */ jsx18("div", { className: "dialkit-timeline-playhead-anchor", children: /* @__PURE__ */ jsx18("div", { className: "dialkit-timeline-playhead-flag", children: time.toFixed(2) }) })
|
|
4448
4524
|
]
|
|
4449
4525
|
}
|
|
4450
4526
|
);
|
|
@@ -4542,30 +4618,18 @@ var TimelineSection = memo(function TimelineSection2({
|
|
|
4542
4618
|
const presets = DialStore.getPresets(meta.id);
|
|
4543
4619
|
const activePresetId = DialStore.getActivePresetId(meta.id);
|
|
4544
4620
|
const laneAreaRef = useRef14(null);
|
|
4545
|
-
const
|
|
4546
|
-
const actionsRef = useRef14(null);
|
|
4621
|
+
const horizontalScrollRef = useRef14(null);
|
|
4547
4622
|
const [laneWidth, setLaneWidth] = useState11(0);
|
|
4548
|
-
const [flagClearRange, setFlagClearRange] = useState11({ start: 0, end: 0 });
|
|
4549
4623
|
useLayoutEffect2(() => {
|
|
4550
4624
|
if (!open) return;
|
|
4551
4625
|
const ruler = laneAreaRef.current;
|
|
4552
|
-
|
|
4553
|
-
const actions = actionsRef.current;
|
|
4554
|
-
if (!ruler || !title || !actions) return;
|
|
4626
|
+
if (!ruler) return;
|
|
4555
4627
|
const measure = () => {
|
|
4556
|
-
|
|
4557
|
-
const titleRect = title.getBoundingClientRect();
|
|
4558
|
-
const actionsRect = actions.getBoundingClientRect();
|
|
4559
|
-
setLaneWidth(rulerRect.width);
|
|
4560
|
-
const start = Math.round(titleRect.right + 10 - rulerRect.left);
|
|
4561
|
-
const end = Math.round(actionsRect.left - 10 - rulerRect.left);
|
|
4562
|
-
setFlagClearRange((current) => current.start === start && current.end === end ? current : { start, end });
|
|
4628
|
+
setLaneWidth(ruler.getBoundingClientRect().width);
|
|
4563
4629
|
};
|
|
4564
4630
|
measure();
|
|
4565
4631
|
const observer = new ResizeObserver(measure);
|
|
4566
4632
|
observer.observe(ruler);
|
|
4567
|
-
observer.observe(title);
|
|
4568
|
-
observer.observe(actions);
|
|
4569
4633
|
return () => observer.disconnect();
|
|
4570
4634
|
}, [open]);
|
|
4571
4635
|
const visibleDuration = meta.duration > 0 ? meta.duration / zoom : meta.duration;
|
|
@@ -4580,6 +4644,14 @@ var TimelineSection = memo(function TimelineSection2({
|
|
|
4580
4644
|
useEffect11(() => {
|
|
4581
4645
|
setViewStart((current) => clampViewStart(current, meta.duration, meta.duration / zoom));
|
|
4582
4646
|
}, [meta.duration, zoom]);
|
|
4647
|
+
useLayoutEffect2(() => {
|
|
4648
|
+
const scroller = horizontalScrollRef.current;
|
|
4649
|
+
if (!scroller || pxPerSecond <= 0) return;
|
|
4650
|
+
const nextScrollLeft = safeViewStart * pxPerSecond;
|
|
4651
|
+
if (Math.abs(scroller.scrollLeft - nextScrollLeft) > 0.5) {
|
|
4652
|
+
scroller.scrollLeft = nextScrollLeft;
|
|
4653
|
+
}
|
|
4654
|
+
}, [open, pxPerSecond, safeViewStart]);
|
|
4583
4655
|
useEffect11(() => {
|
|
4584
4656
|
if (!dockVisible) setPopover(null);
|
|
4585
4657
|
}, [dockVisible]);
|
|
@@ -4592,6 +4664,26 @@ var TimelineSection = memo(function TimelineSection2({
|
|
|
4592
4664
|
setZoom(1);
|
|
4593
4665
|
setViewStart(0);
|
|
4594
4666
|
}, []);
|
|
4667
|
+
const handleReplay = useCallback14(() => {
|
|
4668
|
+
setViewStart(0);
|
|
4669
|
+
TimelineStore.replay(meta.id);
|
|
4670
|
+
}, [meta.id]);
|
|
4671
|
+
const handleHorizontalScroll = useCallback14((e) => {
|
|
4672
|
+
if (pxPerSecond <= 0) return;
|
|
4673
|
+
setViewStart(clampViewStart(
|
|
4674
|
+
e.currentTarget.scrollLeft / pxPerSecond,
|
|
4675
|
+
meta.duration,
|
|
4676
|
+
visibleDuration
|
|
4677
|
+
));
|
|
4678
|
+
}, [meta.duration, pxPerSecond, visibleDuration]);
|
|
4679
|
+
const handleTimelineWheel = useCallback14((e) => {
|
|
4680
|
+
const scroller = horizontalScrollRef.current;
|
|
4681
|
+
if (!scroller || zoom <= 1) return;
|
|
4682
|
+
const horizontalDelta = Math.abs(e.deltaX) > Math.abs(e.deltaY) ? e.deltaX : e.shiftKey ? e.deltaY : 0;
|
|
4683
|
+
if (horizontalDelta === 0) return;
|
|
4684
|
+
e.preventDefault();
|
|
4685
|
+
scroller.scrollLeft += horizontalDelta;
|
|
4686
|
+
}, [zoom]);
|
|
4595
4687
|
const zoomDragRef = useRef14(null);
|
|
4596
4688
|
const rulerScrubRef = useRef14(null);
|
|
4597
4689
|
const seekRulerFromClientX = useCallback14((clientX) => {
|
|
@@ -4914,7 +5006,7 @@ var TimelineSection = memo(function TimelineSection2({
|
|
|
4914
5006
|
}
|
|
4915
5007
|
return /* @__PURE__ */ jsxs14("div", { className: "dialkit-timeline-section", children: [
|
|
4916
5008
|
/* @__PURE__ */ jsxs14("div", { className: "dialkit-timeline-header", "data-open": open || void 0, children: [
|
|
4917
|
-
/* @__PURE__ */ jsx18("div", { className: "dialkit-timeline-identity", children: /* @__PURE__ */ jsx18("span", {
|
|
5009
|
+
/* @__PURE__ */ jsx18("div", { className: "dialkit-timeline-identity", children: /* @__PURE__ */ jsx18("span", { className: "dialkit-timeline-title", children: meta.name }) }),
|
|
4918
5010
|
!open && /* @__PURE__ */ jsx18(
|
|
4919
5011
|
TimelineOverview,
|
|
4920
5012
|
{
|
|
@@ -4925,8 +5017,9 @@ var TimelineSection = memo(function TimelineSection2({
|
|
|
4925
5017
|
onNavigate: centerViewAt
|
|
4926
5018
|
}
|
|
4927
5019
|
),
|
|
4928
|
-
/* @__PURE__ */ jsxs14("div", {
|
|
5020
|
+
/* @__PURE__ */ jsxs14("div", { className: "dialkit-timeline-actions", children: [
|
|
4929
5021
|
/* @__PURE__ */ jsx18(PlayPauseButton, { id: meta.id }),
|
|
5022
|
+
/* @__PURE__ */ jsx18(ReplayButton, { onReplay: handleReplay }),
|
|
4930
5023
|
/* @__PURE__ */ jsx18(
|
|
4931
5024
|
motion7.button,
|
|
4932
5025
|
{
|
|
@@ -5009,54 +5102,68 @@ var TimelineSection = memo(function TimelineSection2({
|
|
|
5009
5102
|
)
|
|
5010
5103
|
] })
|
|
5011
5104
|
] }),
|
|
5012
|
-
open && /* @__PURE__ */
|
|
5105
|
+
open && /* @__PURE__ */ jsxs14(
|
|
5013
5106
|
"div",
|
|
5014
5107
|
{
|
|
5015
5108
|
className: "dialkit-timeline-body",
|
|
5109
|
+
onWheel: handleTimelineWheel,
|
|
5016
5110
|
onPointerDown: handleTrackPointerDown,
|
|
5017
5111
|
onPointerMove: handleTrackPointerMove,
|
|
5018
5112
|
onPointerUp: finishTrackScrub,
|
|
5019
5113
|
onPointerCancel: finishTrackScrub,
|
|
5020
5114
|
onLostPointerCapture: finishTrackScrub,
|
|
5021
|
-
children:
|
|
5022
|
-
/* @__PURE__ */ jsxs14("div", { className: "dialkit-timeline-
|
|
5115
|
+
children: [
|
|
5116
|
+
/* @__PURE__ */ jsxs14("div", { className: "dialkit-timeline-grid", children: [
|
|
5117
|
+
/* @__PURE__ */ jsxs14("div", { className: "dialkit-timeline-row dialkit-timeline-ruler-row", children: [
|
|
5118
|
+
/* @__PURE__ */ jsx18("div", { className: "dialkit-timeline-label" }),
|
|
5119
|
+
/* @__PURE__ */ jsxs14(
|
|
5120
|
+
"div",
|
|
5121
|
+
{
|
|
5122
|
+
ref: laneAreaRef,
|
|
5123
|
+
className: "dialkit-timeline-ruler",
|
|
5124
|
+
onPointerDown: handleRulerPointerDown,
|
|
5125
|
+
onPointerMove: handleRulerPointerMove,
|
|
5126
|
+
onPointerUp: handleRulerPointerUp,
|
|
5127
|
+
onPointerCancel: handleRulerPointerCancel,
|
|
5128
|
+
onLostPointerCapture: handleRulerPointerCancel,
|
|
5129
|
+
title: "Drag to seek \xB7 Option-drag to zoom \xB7 Shift-drag to reset zoom",
|
|
5130
|
+
children: [
|
|
5131
|
+
fineTicks.map((t) => /* @__PURE__ */ jsx18("div", { className: "dialkit-timeline-tick dialkit-timeline-tick-fine", style: { left: (t - safeViewStart) * pxPerSecond } }, `fine:${t}`)),
|
|
5132
|
+
mediumTicks.map((t) => /* @__PURE__ */ jsx18("div", { className: "dialkit-timeline-tick dialkit-timeline-tick-medium", style: { left: (t - safeViewStart) * pxPerSecond } }, `medium:${t}`)),
|
|
5133
|
+
majorTicks.map((t) => /* @__PURE__ */ jsx18("div", { className: "dialkit-timeline-tick", style: { left: (t - safeViewStart) * pxPerSecond }, children: /* @__PURE__ */ jsx18("span", { className: "dialkit-timeline-tick-label", children: formatRulerSeconds(t, majorStep) }) }, t))
|
|
5134
|
+
]
|
|
5135
|
+
}
|
|
5136
|
+
)
|
|
5137
|
+
] }),
|
|
5138
|
+
rows,
|
|
5139
|
+
pxPerSecond > 0 && /* @__PURE__ */ jsx18(
|
|
5140
|
+
TimelinePlayheadFlag,
|
|
5141
|
+
{
|
|
5142
|
+
id: meta.id,
|
|
5143
|
+
duration: meta.duration,
|
|
5144
|
+
pxPerSecond,
|
|
5145
|
+
viewStart: safeViewStart,
|
|
5146
|
+
viewEnd,
|
|
5147
|
+
laneWidth,
|
|
5148
|
+
rulerRef: laneAreaRef,
|
|
5149
|
+
onResetView: resetView
|
|
5150
|
+
}
|
|
5151
|
+
)
|
|
5152
|
+
] }),
|
|
5153
|
+
zoom > 1 && /* @__PURE__ */ jsxs14("div", { className: "dialkit-timeline-scroll-row", children: [
|
|
5023
5154
|
/* @__PURE__ */ jsx18("div", { className: "dialkit-timeline-label" }),
|
|
5024
|
-
/* @__PURE__ */
|
|
5155
|
+
/* @__PURE__ */ jsx18(
|
|
5025
5156
|
"div",
|
|
5026
5157
|
{
|
|
5027
|
-
ref:
|
|
5028
|
-
className: "dialkit-timeline-
|
|
5029
|
-
|
|
5030
|
-
|
|
5031
|
-
|
|
5032
|
-
onPointerCancel: handleRulerPointerCancel,
|
|
5033
|
-
onLostPointerCapture: handleRulerPointerCancel,
|
|
5034
|
-
title: "Drag to seek \xB7 Option-drag to zoom \xB7 Shift-drag to reset zoom",
|
|
5035
|
-
children: [
|
|
5036
|
-
fineTicks.map((t) => /* @__PURE__ */ jsx18("div", { className: "dialkit-timeline-tick dialkit-timeline-tick-fine", style: { left: (t - safeViewStart) * pxPerSecond } }, `fine:${t}`)),
|
|
5037
|
-
mediumTicks.map((t) => /* @__PURE__ */ jsx18("div", { className: "dialkit-timeline-tick dialkit-timeline-tick-medium", style: { left: (t - safeViewStart) * pxPerSecond } }, `medium:${t}`)),
|
|
5038
|
-
majorTicks.map((t) => /* @__PURE__ */ jsx18("div", { className: "dialkit-timeline-tick", style: { left: (t - safeViewStart) * pxPerSecond }, children: /* @__PURE__ */ jsx18("span", { className: "dialkit-timeline-tick-label", children: formatRulerSeconds(t, majorStep) }) }, t))
|
|
5039
|
-
]
|
|
5158
|
+
ref: horizontalScrollRef,
|
|
5159
|
+
className: "dialkit-timeline-horizontal-scroll",
|
|
5160
|
+
onScroll: handleHorizontalScroll,
|
|
5161
|
+
"aria-label": "Timeline horizontal scroll",
|
|
5162
|
+
children: /* @__PURE__ */ jsx18("div", { style: { width: laneWidth * zoom } })
|
|
5040
5163
|
}
|
|
5041
5164
|
)
|
|
5042
|
-
] })
|
|
5043
|
-
|
|
5044
|
-
pxPerSecond > 0 && /* @__PURE__ */ jsx18(
|
|
5045
|
-
TimelinePlayheadFlag,
|
|
5046
|
-
{
|
|
5047
|
-
id: meta.id,
|
|
5048
|
-
duration: meta.duration,
|
|
5049
|
-
pxPerSecond,
|
|
5050
|
-
viewStart: safeViewStart,
|
|
5051
|
-
viewEnd,
|
|
5052
|
-
laneWidth,
|
|
5053
|
-
rulerRef: laneAreaRef,
|
|
5054
|
-
headerClearStart: flagClearRange.start,
|
|
5055
|
-
headerClearEnd: flagClearRange.end,
|
|
5056
|
-
onResetView: resetView
|
|
5057
|
-
}
|
|
5058
|
-
)
|
|
5059
|
-
] })
|
|
5165
|
+
] })
|
|
5166
|
+
]
|
|
5060
5167
|
}
|
|
5061
5168
|
),
|
|
5062
5169
|
popover && /* @__PURE__ */ jsx18(
|