@markdy/renderer-dom 1.4.13 → 1.4.15
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 +9 -176
- 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;
|
|
@@ -3993,10 +3954,6 @@ function ensureSceneStyles(doc) {
|
|
|
3993
3954
|
min-width: 25px !important;
|
|
3994
3955
|
justify-content: center !important;
|
|
3995
3956
|
}
|
|
3996
|
-
.markdy-controls-secondary,
|
|
3997
|
-
.markdy-control-divider-secondary {
|
|
3998
|
-
display: none !important;
|
|
3999
|
-
}
|
|
4000
3957
|
.markdy-speed-group {
|
|
4001
3958
|
display: none !important;
|
|
4002
3959
|
}
|
|
@@ -4008,19 +3965,13 @@ function ensureSceneStyles(doc) {
|
|
|
4008
3965
|
}
|
|
4009
3966
|
.markdy-badge {
|
|
4010
3967
|
font-size: 9px !important;
|
|
4011
|
-
opacity: 0.
|
|
4012
|
-
}
|
|
4013
|
-
.markdy-badge-prefix {
|
|
4014
|
-
display: none !important;
|
|
4015
|
-
}
|
|
4016
|
-
}
|
|
4017
|
-
@media (max-width: 440px) {
|
|
4018
|
-
.markdy-badge {
|
|
4019
|
-
display: none !important;
|
|
3968
|
+
opacity: 0.7;
|
|
4020
3969
|
}
|
|
4021
3970
|
}
|
|
4022
3971
|
@media (max-width: 360px) {
|
|
4023
|
-
.markdy-control-reset
|
|
3972
|
+
.markdy-control-reset-view,
|
|
3973
|
+
.markdy-control-share,
|
|
3974
|
+
.markdy-control-code {
|
|
4024
3975
|
display: none !important;
|
|
4025
3976
|
}
|
|
4026
3977
|
}
|
|
@@ -4028,9 +3979,6 @@ function ensureSceneStyles(doc) {
|
|
|
4028
3979
|
.markdy-btn-label {
|
|
4029
3980
|
display: none !important;
|
|
4030
3981
|
}
|
|
4031
|
-
.markdy-player-beat-chip {
|
|
4032
|
-
display: none !important;
|
|
4033
|
-
}
|
|
4034
3982
|
.markdy-controls button {
|
|
4035
3983
|
padding: 0 !important;
|
|
4036
3984
|
width: 25px !important;
|
|
@@ -4038,27 +3986,21 @@ function ensureSceneStyles(doc) {
|
|
|
4038
3986
|
min-width: 25px !important;
|
|
4039
3987
|
justify-content: center !important;
|
|
4040
3988
|
}
|
|
4041
|
-
.markdy-controls-secondary,
|
|
4042
|
-
.markdy-control-divider-secondary {
|
|
4043
|
-
display: none !important;
|
|
4044
|
-
}
|
|
4045
3989
|
.markdy-speed-group {
|
|
4046
3990
|
display: none !important;
|
|
4047
3991
|
}
|
|
4048
3992
|
.markdy-controls {
|
|
4049
3993
|
gap: 4px !important;
|
|
4050
3994
|
}
|
|
4051
|
-
.markdy-badge-prefix {
|
|
4052
|
-
display: none !important;
|
|
4053
|
-
}
|
|
4054
|
-
}
|
|
4055
|
-
@container markdy-root (max-width: 440px) {
|
|
4056
3995
|
.markdy-badge {
|
|
4057
|
-
|
|
3996
|
+
font-size: 9px !important;
|
|
3997
|
+
opacity: 0.7;
|
|
4058
3998
|
}
|
|
4059
3999
|
}
|
|
4060
4000
|
@container markdy-root (max-width: 360px) {
|
|
4061
|
-
.markdy-control-reset
|
|
4001
|
+
.markdy-control-reset-view,
|
|
4002
|
+
.markdy-control-share,
|
|
4003
|
+
.markdy-control-code {
|
|
4062
4004
|
display: none !important;
|
|
4063
4005
|
}
|
|
4064
4006
|
}
|
|
@@ -4093,15 +4035,6 @@ function ensureSceneStyles(doc) {
|
|
|
4093
4035
|
color: #ffffff !important;
|
|
4094
4036
|
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12) !important;
|
|
4095
4037
|
}
|
|
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
4038
|
.markdy-btn-flashed {
|
|
4106
4039
|
background: rgba(37, 99, 235, 0.15) !important;
|
|
4107
4040
|
color: #2563eb !important;
|
|
@@ -4401,19 +4334,6 @@ function ensureSceneStyles(doc) {
|
|
|
4401
4334
|
:root[data-theme="dark"] .markdy-player-scrubber-track,
|
|
4402
4335
|
.theme-dark .markdy-player-scrubber-track,
|
|
4403
4336
|
.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
4337
|
}
|
|
4418
4338
|
[data-markdy-theme="midnight"] .markdy-controls button:not([aria-pressed="true"]),
|
|
4419
4339
|
[data-markdy-theme="blueprint"] .markdy-controls button:not([aria-pressed="true"]),
|
|
@@ -6640,10 +6560,6 @@ function createDiagram(opts) {
|
|
|
6640
6560
|
} = player.interaction;
|
|
6641
6561
|
const {
|
|
6642
6562
|
enabled: showControls,
|
|
6643
|
-
play: playButton,
|
|
6644
|
-
restart: restartButton,
|
|
6645
|
-
prevBeat: prevBeatButton,
|
|
6646
|
-
nextBeat: nextBeatButton,
|
|
6647
6563
|
seek: seekBar,
|
|
6648
6564
|
speed: speedControls,
|
|
6649
6565
|
speeds: speedOptions,
|
|
@@ -6701,11 +6617,8 @@ function createDiagram(opts) {
|
|
|
6701
6617
|
let controlsScrubberFill = null;
|
|
6702
6618
|
let controlsScrubberThumb = null;
|
|
6703
6619
|
let controlsScrubberTooltip = null;
|
|
6704
|
-
let controlsBeatChip = null;
|
|
6705
|
-
let controlsPlayButton = null;
|
|
6706
6620
|
let controlsRateButtons = [];
|
|
6707
6621
|
let controlsSeekBar = null;
|
|
6708
|
-
let controlsTimeEl = null;
|
|
6709
6622
|
let controlsFitButton = null;
|
|
6710
6623
|
let closeCodePanel = null;
|
|
6711
6624
|
let progressEl = null;
|
|
@@ -6740,20 +6653,6 @@ function createDiagram(opts) {
|
|
|
6740
6653
|
controlsSeekBar.value = String(sceneMs / 1e3);
|
|
6741
6654
|
controlsSeekBar.style.setProperty("--seek-pct", `${clamped * 100}%`);
|
|
6742
6655
|
}
|
|
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
6656
|
if (!progressEl) return;
|
|
6758
6657
|
if (progressMode === "bar") {
|
|
6759
6658
|
progressEl.style.background = customColor ?? plan.theme.accent ?? "#2563eb";
|
|
@@ -7399,13 +7298,6 @@ function createDiagram(opts) {
|
|
|
7399
7298
|
if (controlsScrubberThumb) {
|
|
7400
7299
|
controlsScrubberThumb.style.left = `${clamped * 100}%`;
|
|
7401
7300
|
}
|
|
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
7301
|
for (const button of controlsRateButtons) {
|
|
7410
7302
|
const rate = Number(button.dataset.rate ?? "1");
|
|
7411
7303
|
const active = Math.abs(rate - playbackRate) < 1e-3;
|
|
@@ -7415,20 +7307,6 @@ function createDiagram(opts) {
|
|
|
7415
7307
|
controlsSeekBar.value = String(sceneMs / 1e3);
|
|
7416
7308
|
controlsSeekBar.style.setProperty("--seek-pct", `${clamped * 100}%`);
|
|
7417
7309
|
}
|
|
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
7310
|
if (controlsFitButton) {
|
|
7433
7311
|
controlsFitButton.setAttribute("aria-pressed", fitViewActive ? "true" : "false");
|
|
7434
7312
|
}
|
|
@@ -7759,33 +7637,6 @@ function createDiagram(opts) {
|
|
|
7759
7637
|
}
|
|
7760
7638
|
return button;
|
|
7761
7639
|
}
|
|
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
7640
|
function mountScrubber(footerEl) {
|
|
7790
7641
|
if (!seekBar) return;
|
|
7791
7642
|
controlsScrubber = document.createElement("div");
|
|
@@ -8370,24 +8221,6 @@ function createDiagram(opts) {
|
|
|
8370
8221
|
if (seekBar) {
|
|
8371
8222
|
mountScrubber(toolbar);
|
|
8372
8223
|
}
|
|
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
8224
|
const toolsGroup = document.createElement("div");
|
|
8392
8225
|
toolsGroup.className = "markdy-controls-group markdy-controls-tools";
|
|
8393
8226
|
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.15",
|
|
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.15"
|
|
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.15"
|
|
57
57
|
},
|
|
58
58
|
"scripts": {
|
|
59
59
|
"build": "tsup",
|