@markdy/renderer-dom 1.4.13 → 1.4.14
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/index.js +0 -151
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -3816,23 +3816,6 @@ function ensureSceneStyles(doc) {
|
|
|
3816
3816
|
z-index: 60;
|
|
3817
3817
|
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
|
|
3818
3818
|
}
|
|
3819
|
-
.markdy-player-beat-chip {
|
|
3820
|
-
display: inline-flex;
|
|
3821
|
-
align-items: center;
|
|
3822
|
-
padding: 2px 7px;
|
|
3823
|
-
font-size: 10px;
|
|
3824
|
-
font-weight: 600;
|
|
3825
|
-
color: var(--md-control-text, #475569);
|
|
3826
|
-
background: var(--md-segmented-bg, rgba(148, 163, 184, 0.12));
|
|
3827
|
-
border: 1px solid var(--md-control-border, rgba(148, 163, 184, 0.18));
|
|
3828
|
-
border-radius: 9999px;
|
|
3829
|
-
white-space: nowrap;
|
|
3830
|
-
max-width: 140px;
|
|
3831
|
-
overflow: hidden;
|
|
3832
|
-
text-overflow: ellipsis;
|
|
3833
|
-
letter-spacing: -0.01em;
|
|
3834
|
-
flex-shrink: 1;
|
|
3835
|
-
}
|
|
3836
3819
|
.markdy-controls {
|
|
3837
3820
|
display: flex;
|
|
3838
3821
|
align-items: center;
|
|
@@ -3857,12 +3840,6 @@ function ensureSceneStyles(doc) {
|
|
|
3857
3840
|
z-index: 5;
|
|
3858
3841
|
pointer-events: auto;
|
|
3859
3842
|
}
|
|
3860
|
-
.markdy-controls-playback {
|
|
3861
|
-
display: inline-flex;
|
|
3862
|
-
align-items: center;
|
|
3863
|
-
gap: 5px;
|
|
3864
|
-
flex-shrink: 0;
|
|
3865
|
-
}
|
|
3866
3843
|
.markdy-controls-tools {
|
|
3867
3844
|
display: inline-flex;
|
|
3868
3845
|
align-items: center;
|
|
@@ -3946,19 +3923,6 @@ function ensureSceneStyles(doc) {
|
|
|
3946
3923
|
flex-shrink: 0;
|
|
3947
3924
|
vertical-align: middle;
|
|
3948
3925
|
}
|
|
3949
|
-
.markdy-control-play {
|
|
3950
|
-
background: #2563eb !important;
|
|
3951
|
-
color: #ffffff !important;
|
|
3952
|
-
border-color: #2563eb !important;
|
|
3953
|
-
padding: 0 9px !important;
|
|
3954
|
-
font-weight: 600 !important;
|
|
3955
|
-
box-shadow: 0 1px 2px rgba(37, 99, 235, 0.25) !important;
|
|
3956
|
-
}
|
|
3957
|
-
.markdy-control-play:hover {
|
|
3958
|
-
filter: brightness(1.06);
|
|
3959
|
-
transform: translateY(-0.5px);
|
|
3960
|
-
box-shadow: 0 2px 6px rgba(37, 99, 235, 0.35) !important;
|
|
3961
|
-
}
|
|
3962
3926
|
.markdy-badge {
|
|
3963
3927
|
display: inline-flex;
|
|
3964
3928
|
align-items: center;
|
|
@@ -3983,9 +3947,6 @@ function ensureSceneStyles(doc) {
|
|
|
3983
3947
|
.markdy-btn-label {
|
|
3984
3948
|
display: none !important;
|
|
3985
3949
|
}
|
|
3986
|
-
.markdy-player-beat-chip {
|
|
3987
|
-
display: none !important;
|
|
3988
|
-
}
|
|
3989
3950
|
.markdy-controls button {
|
|
3990
3951
|
padding: 0 !important;
|
|
3991
3952
|
width: 25px !important;
|
|
@@ -4028,9 +3989,6 @@ function ensureSceneStyles(doc) {
|
|
|
4028
3989
|
.markdy-btn-label {
|
|
4029
3990
|
display: none !important;
|
|
4030
3991
|
}
|
|
4031
|
-
.markdy-player-beat-chip {
|
|
4032
|
-
display: none !important;
|
|
4033
|
-
}
|
|
4034
3992
|
.markdy-controls button {
|
|
4035
3993
|
padding: 0 !important;
|
|
4036
3994
|
width: 25px !important;
|
|
@@ -4093,15 +4051,6 @@ function ensureSceneStyles(doc) {
|
|
|
4093
4051
|
color: #ffffff !important;
|
|
4094
4052
|
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12) !important;
|
|
4095
4053
|
}
|
|
4096
|
-
.markdy-control-time {
|
|
4097
|
-
font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
|
|
4098
|
-
font-size: 10px;
|
|
4099
|
-
font-weight: 600;
|
|
4100
|
-
color: var(--md-control-text, #94a3b8);
|
|
4101
|
-
white-space: nowrap;
|
|
4102
|
-
flex-shrink: 0;
|
|
4103
|
-
letter-spacing: -0.02em;
|
|
4104
|
-
}
|
|
4105
4054
|
.markdy-btn-flashed {
|
|
4106
4055
|
background: rgba(37, 99, 235, 0.15) !important;
|
|
4107
4056
|
color: #2563eb !important;
|
|
@@ -4401,19 +4350,6 @@ function ensureSceneStyles(doc) {
|
|
|
4401
4350
|
:root[data-theme="dark"] .markdy-player-scrubber-track,
|
|
4402
4351
|
.theme-dark .markdy-player-scrubber-track,
|
|
4403
4352
|
.dark .markdy-player-scrubber-track {
|
|
4404
|
-
background: rgba(255, 255, 255, 0.14);
|
|
4405
|
-
}
|
|
4406
|
-
[data-markdy-theme="midnight"] .markdy-player-beat-chip,
|
|
4407
|
-
[data-markdy-theme="blueprint"] .markdy-player-beat-chip,
|
|
4408
|
-
[data-markdy-theme="terminal"] .markdy-player-beat-chip,
|
|
4409
|
-
[data-markdy-theme="graphite"] .markdy-player-beat-chip,
|
|
4410
|
-
[data-markdy-theme="nebula"] .markdy-player-beat-chip,
|
|
4411
|
-
:root[data-theme="dark"] .markdy-player-beat-chip,
|
|
4412
|
-
.theme-dark .markdy-player-beat-chip,
|
|
4413
|
-
.dark .markdy-player-beat-chip {
|
|
4414
|
-
background: rgba(255, 255, 255, 0.08);
|
|
4415
|
-
border-color: rgba(255, 255, 255, 0.12);
|
|
4416
|
-
color: #cbd5e1;
|
|
4417
4353
|
}
|
|
4418
4354
|
[data-markdy-theme="midnight"] .markdy-controls button:not([aria-pressed="true"]),
|
|
4419
4355
|
[data-markdy-theme="blueprint"] .markdy-controls button:not([aria-pressed="true"]),
|
|
@@ -6640,10 +6576,6 @@ function createDiagram(opts) {
|
|
|
6640
6576
|
} = player.interaction;
|
|
6641
6577
|
const {
|
|
6642
6578
|
enabled: showControls,
|
|
6643
|
-
play: playButton,
|
|
6644
|
-
restart: restartButton,
|
|
6645
|
-
prevBeat: prevBeatButton,
|
|
6646
|
-
nextBeat: nextBeatButton,
|
|
6647
6579
|
seek: seekBar,
|
|
6648
6580
|
speed: speedControls,
|
|
6649
6581
|
speeds: speedOptions,
|
|
@@ -6701,11 +6633,8 @@ function createDiagram(opts) {
|
|
|
6701
6633
|
let controlsScrubberFill = null;
|
|
6702
6634
|
let controlsScrubberThumb = null;
|
|
6703
6635
|
let controlsScrubberTooltip = null;
|
|
6704
|
-
let controlsBeatChip = null;
|
|
6705
|
-
let controlsPlayButton = null;
|
|
6706
6636
|
let controlsRateButtons = [];
|
|
6707
6637
|
let controlsSeekBar = null;
|
|
6708
|
-
let controlsTimeEl = null;
|
|
6709
6638
|
let controlsFitButton = null;
|
|
6710
6639
|
let closeCodePanel = null;
|
|
6711
6640
|
let progressEl = null;
|
|
@@ -6740,20 +6669,6 @@ function createDiagram(opts) {
|
|
|
6740
6669
|
controlsSeekBar.value = String(sceneMs / 1e3);
|
|
6741
6670
|
controlsSeekBar.style.setProperty("--seek-pct", `${clamped * 100}%`);
|
|
6742
6671
|
}
|
|
6743
|
-
if (controlsTimeEl) {
|
|
6744
|
-
const cur = (sceneMs / 1e3).toFixed(1);
|
|
6745
|
-
const tot = durationSeconds.toFixed(1);
|
|
6746
|
-
controlsTimeEl.textContent = `${cur}s / ${tot}s`;
|
|
6747
|
-
}
|
|
6748
|
-
if (controlsBeatChip && plan.beats.length > 1) {
|
|
6749
|
-
const currentSec = sceneMs / 1e3;
|
|
6750
|
-
const currentBeat = plan.beats.find((b) => currentSec >= b.start && currentSec < b.end) || plan.beats[plan.beats.length - 1];
|
|
6751
|
-
if (currentBeat) {
|
|
6752
|
-
const beatIdx = plan.beats.indexOf(currentBeat) + 1;
|
|
6753
|
-
controlsBeatChip.textContent = currentBeat.label ? `${beatIdx}. ${currentBeat.label}` : `Beat ${beatIdx}`;
|
|
6754
|
-
controlsBeatChip.title = `Current beat: ${currentBeat.label || currentBeat.name}`;
|
|
6755
|
-
}
|
|
6756
|
-
}
|
|
6757
6672
|
if (!progressEl) return;
|
|
6758
6673
|
if (progressMode === "bar") {
|
|
6759
6674
|
progressEl.style.background = customColor ?? plan.theme.accent ?? "#2563eb";
|
|
@@ -7399,13 +7314,6 @@ function createDiagram(opts) {
|
|
|
7399
7314
|
if (controlsScrubberThumb) {
|
|
7400
7315
|
controlsScrubberThumb.style.left = `${clamped * 100}%`;
|
|
7401
7316
|
}
|
|
7402
|
-
if (controlsPlayButton) {
|
|
7403
|
-
const playing = isPlaying;
|
|
7404
|
-
controlsPlayButton.innerHTML = `${playing ? ICONS2.pause : ICONS2.play}<span class="markdy-btn-label">${playing ? "Pause" : "Play"}</span>`;
|
|
7405
|
-
const playLabel = playing ? "Pause diagram" : "Play diagram";
|
|
7406
|
-
controlsPlayButton.setAttribute("aria-label", playLabel);
|
|
7407
|
-
controlsPlayButton.title = playLabel;
|
|
7408
|
-
}
|
|
7409
7317
|
for (const button of controlsRateButtons) {
|
|
7410
7318
|
const rate = Number(button.dataset.rate ?? "1");
|
|
7411
7319
|
const active = Math.abs(rate - playbackRate) < 1e-3;
|
|
@@ -7415,20 +7323,6 @@ function createDiagram(opts) {
|
|
|
7415
7323
|
controlsSeekBar.value = String(sceneMs / 1e3);
|
|
7416
7324
|
controlsSeekBar.style.setProperty("--seek-pct", `${clamped * 100}%`);
|
|
7417
7325
|
}
|
|
7418
|
-
if (controlsTimeEl) {
|
|
7419
|
-
const cur = (sceneMs / 1e3).toFixed(1);
|
|
7420
|
-
const tot = durationSeconds.toFixed(1);
|
|
7421
|
-
controlsTimeEl.textContent = `${cur}s / ${tot}s`;
|
|
7422
|
-
}
|
|
7423
|
-
if (controlsBeatChip && plan.beats.length > 1) {
|
|
7424
|
-
const currentSec = sceneMs / 1e3;
|
|
7425
|
-
const currentBeat = plan.beats.find((b) => currentSec >= b.start && currentSec < b.end) || plan.beats[plan.beats.length - 1];
|
|
7426
|
-
if (currentBeat) {
|
|
7427
|
-
const beatIdx = plan.beats.indexOf(currentBeat) + 1;
|
|
7428
|
-
controlsBeatChip.textContent = currentBeat.label ? `${beatIdx}. ${currentBeat.label}` : `Beat ${beatIdx}`;
|
|
7429
|
-
controlsBeatChip.title = `Current beat: ${currentBeat.label || currentBeat.name}`;
|
|
7430
|
-
}
|
|
7431
|
-
}
|
|
7432
7326
|
if (controlsFitButton) {
|
|
7433
7327
|
controlsFitButton.setAttribute("aria-pressed", fitViewActive ? "true" : "false");
|
|
7434
7328
|
}
|
|
@@ -7759,33 +7653,6 @@ function createDiagram(opts) {
|
|
|
7759
7653
|
}
|
|
7760
7654
|
return button;
|
|
7761
7655
|
}
|
|
7762
|
-
function mountPlayControl(toolbar) {
|
|
7763
|
-
if (!playButton) return;
|
|
7764
|
-
controlsPlayButton = makeControlButton("Play", "Play diagram", ICONS2.play);
|
|
7765
|
-
controlsPlayButton.className = "markdy-control-play";
|
|
7766
|
-
controlsPlayButton.addEventListener("click", togglePlayback);
|
|
7767
|
-
toolbar.appendChild(controlsPlayButton);
|
|
7768
|
-
}
|
|
7769
|
-
function mountBeatNavControls(toolbar, position) {
|
|
7770
|
-
const wanted = position === "prev" ? prevBeatButton : nextBeatButton;
|
|
7771
|
-
if (!wanted || plan.beats.length < 2) return;
|
|
7772
|
-
const label = position === "prev" ? "Prev" : "Next";
|
|
7773
|
-
const icon = position === "prev" ? ICONS2.prevBeat : ICONS2.nextBeat;
|
|
7774
|
-
const button = makeControlButton(label, `${label === "Prev" ? "Previous" : "Next"} beat`, icon);
|
|
7775
|
-
button.className = `markdy-control-${position}-beat`;
|
|
7776
|
-
button.addEventListener("click", () => position === "prev" ? diagram.prevBeat() : diagram.nextBeat());
|
|
7777
|
-
toolbar.appendChild(button);
|
|
7778
|
-
}
|
|
7779
|
-
function mountRestartControl(toolbar) {
|
|
7780
|
-
if (!restartButton) return;
|
|
7781
|
-
const button = makeControlButton("Restart", "Restart diagram", ICONS2.restart);
|
|
7782
|
-
button.className = "markdy-control-restart";
|
|
7783
|
-
button.addEventListener("click", () => {
|
|
7784
|
-
diagram.seek(0);
|
|
7785
|
-
diagram.play();
|
|
7786
|
-
});
|
|
7787
|
-
toolbar.appendChild(button);
|
|
7788
|
-
}
|
|
7789
7656
|
function mountScrubber(footerEl) {
|
|
7790
7657
|
if (!seekBar) return;
|
|
7791
7658
|
controlsScrubber = document.createElement("div");
|
|
@@ -8370,24 +8237,6 @@ function createDiagram(opts) {
|
|
|
8370
8237
|
if (seekBar) {
|
|
8371
8238
|
mountScrubber(toolbar);
|
|
8372
8239
|
}
|
|
8373
|
-
const playbackGroup = document.createElement("div");
|
|
8374
|
-
playbackGroup.className = "markdy-controls-group markdy-controls-playback";
|
|
8375
|
-
mountPlayControl(playbackGroup);
|
|
8376
|
-
mountBeatNavControls(playbackGroup, "prev");
|
|
8377
|
-
mountBeatNavControls(playbackGroup, "next");
|
|
8378
|
-
mountRestartControl(playbackGroup);
|
|
8379
|
-
controlsTimeEl = document.createElement("span");
|
|
8380
|
-
controlsTimeEl.className = "markdy-control-time";
|
|
8381
|
-
controlsTimeEl.textContent = `${(sceneMs / 1e3).toFixed(1)}s / ${durationSeconds.toFixed(1)}s`;
|
|
8382
|
-
playbackGroup.appendChild(controlsTimeEl);
|
|
8383
|
-
if (plan.beats.length > 1) {
|
|
8384
|
-
controlsBeatChip = document.createElement("span");
|
|
8385
|
-
controlsBeatChip.className = "markdy-player-beat-chip";
|
|
8386
|
-
const firstBeat = plan.beats[0];
|
|
8387
|
-
controlsBeatChip.textContent = firstBeat.label ? `1. ${firstBeat.label}` : "Beat 1";
|
|
8388
|
-
playbackGroup.appendChild(controlsBeatChip);
|
|
8389
|
-
}
|
|
8390
|
-
if (playbackGroup.children.length > 0) toolbar.appendChild(playbackGroup);
|
|
8391
8240
|
const toolsGroup = document.createElement("div");
|
|
8392
8241
|
toolsGroup.className = "markdy-controls-group markdy-controls-tools";
|
|
8393
8242
|
if (speedControls) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@markdy/renderer-dom",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.14",
|
|
4
4
|
"description": "Browser renderer for diagram-native animated MarkdyScript architecture diagrams, built on the Web Animations API.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -46,14 +46,14 @@
|
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"html2canvas": "^1.4.1",
|
|
49
|
-
"@markdy/core": "1.4.
|
|
49
|
+
"@markdy/core": "1.4.14"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"jsdom": "^29.1.1",
|
|
53
53
|
"tsup": "^8.5.1",
|
|
54
54
|
"typescript": "^5.9.3",
|
|
55
55
|
"vitest": "^4.1.7",
|
|
56
|
-
"@markdy/stdlib-systems": "1.4.
|
|
56
|
+
"@markdy/stdlib-systems": "1.4.14"
|
|
57
57
|
},
|
|
58
58
|
"scripts": {
|
|
59
59
|
"build": "tsup",
|