@markdy/renderer-dom 1.4.12 → 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.
Files changed (2) hide show
  1. package/dist/index.js +31 -153
  2. 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;
@@ -4010,12 +3971,22 @@ function ensureSceneStyles(doc) {
4010
3971
  font-size: 9px !important;
4011
3972
  opacity: 0.55;
4012
3973
  }
3974
+ .markdy-badge-prefix {
3975
+ display: none !important;
3976
+ }
4013
3977
  }
4014
- @container markdy-root (max-width: 520px) {
4015
- .markdy-btn-label {
3978
+ @media (max-width: 440px) {
3979
+ .markdy-badge {
4016
3980
  display: none !important;
4017
3981
  }
4018
- .markdy-player-beat-chip {
3982
+ }
3983
+ @media (max-width: 360px) {
3984
+ .markdy-control-reset {
3985
+ display: none !important;
3986
+ }
3987
+ }
3988
+ @container markdy-root (max-width: 520px) {
3989
+ .markdy-btn-label {
4019
3990
  display: none !important;
4020
3991
  }
4021
3992
  .markdy-controls button {
@@ -4035,6 +4006,19 @@ function ensureSceneStyles(doc) {
4035
4006
  .markdy-controls {
4036
4007
  gap: 4px !important;
4037
4008
  }
4009
+ .markdy-badge-prefix {
4010
+ display: none !important;
4011
+ }
4012
+ }
4013
+ @container markdy-root (max-width: 440px) {
4014
+ .markdy-badge {
4015
+ display: none !important;
4016
+ }
4017
+ }
4018
+ @container markdy-root (max-width: 360px) {
4019
+ .markdy-control-reset {
4020
+ display: none !important;
4021
+ }
4038
4022
  }
4039
4023
  .markdy-speed-group {
4040
4024
  display: inline-flex;
@@ -4067,15 +4051,6 @@ function ensureSceneStyles(doc) {
4067
4051
  color: #ffffff !important;
4068
4052
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12) !important;
4069
4053
  }
4070
- .markdy-control-time {
4071
- font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
4072
- font-size: 10px;
4073
- font-weight: 600;
4074
- color: var(--md-control-text, #94a3b8);
4075
- white-space: nowrap;
4076
- flex-shrink: 0;
4077
- letter-spacing: -0.02em;
4078
- }
4079
4054
  .markdy-btn-flashed {
4080
4055
  background: rgba(37, 99, 235, 0.15) !important;
4081
4056
  color: #2563eb !important;
@@ -4375,19 +4350,6 @@ function ensureSceneStyles(doc) {
4375
4350
  :root[data-theme="dark"] .markdy-player-scrubber-track,
4376
4351
  .theme-dark .markdy-player-scrubber-track,
4377
4352
  .dark .markdy-player-scrubber-track {
4378
- background: rgba(255, 255, 255, 0.14);
4379
- }
4380
- [data-markdy-theme="midnight"] .markdy-player-beat-chip,
4381
- [data-markdy-theme="blueprint"] .markdy-player-beat-chip,
4382
- [data-markdy-theme="terminal"] .markdy-player-beat-chip,
4383
- [data-markdy-theme="graphite"] .markdy-player-beat-chip,
4384
- [data-markdy-theme="nebula"] .markdy-player-beat-chip,
4385
- :root[data-theme="dark"] .markdy-player-beat-chip,
4386
- .theme-dark .markdy-player-beat-chip,
4387
- .dark .markdy-player-beat-chip {
4388
- background: rgba(255, 255, 255, 0.08);
4389
- border-color: rgba(255, 255, 255, 0.12);
4390
- color: #cbd5e1;
4391
4353
  }
4392
4354
  [data-markdy-theme="midnight"] .markdy-controls button:not([aria-pressed="true"]),
4393
4355
  [data-markdy-theme="blueprint"] .markdy-controls button:not([aria-pressed="true"]),
@@ -6614,10 +6576,6 @@ function createDiagram(opts) {
6614
6576
  } = player.interaction;
6615
6577
  const {
6616
6578
  enabled: showControls,
6617
- play: playButton,
6618
- restart: restartButton,
6619
- prevBeat: prevBeatButton,
6620
- nextBeat: nextBeatButton,
6621
6579
  seek: seekBar,
6622
6580
  speed: speedControls,
6623
6581
  speeds: speedOptions,
@@ -6675,11 +6633,8 @@ function createDiagram(opts) {
6675
6633
  let controlsScrubberFill = null;
6676
6634
  let controlsScrubberThumb = null;
6677
6635
  let controlsScrubberTooltip = null;
6678
- let controlsBeatChip = null;
6679
- let controlsPlayButton = null;
6680
6636
  let controlsRateButtons = [];
6681
6637
  let controlsSeekBar = null;
6682
- let controlsTimeEl = null;
6683
6638
  let controlsFitButton = null;
6684
6639
  let closeCodePanel = null;
6685
6640
  let progressEl = null;
@@ -6714,20 +6669,6 @@ function createDiagram(opts) {
6714
6669
  controlsSeekBar.value = String(sceneMs / 1e3);
6715
6670
  controlsSeekBar.style.setProperty("--seek-pct", `${clamped * 100}%`);
6716
6671
  }
6717
- if (controlsTimeEl) {
6718
- const cur = (sceneMs / 1e3).toFixed(1);
6719
- const tot = durationSeconds.toFixed(1);
6720
- controlsTimeEl.textContent = `${cur}s / ${tot}s`;
6721
- }
6722
- if (controlsBeatChip && plan.beats.length > 1) {
6723
- const currentSec = sceneMs / 1e3;
6724
- const currentBeat = plan.beats.find((b) => currentSec >= b.start && currentSec < b.end) || plan.beats[plan.beats.length - 1];
6725
- if (currentBeat) {
6726
- const beatIdx = plan.beats.indexOf(currentBeat) + 1;
6727
- controlsBeatChip.textContent = currentBeat.label ? `${beatIdx}. ${currentBeat.label}` : `Beat ${beatIdx}`;
6728
- controlsBeatChip.title = `Current beat: ${currentBeat.label || currentBeat.name}`;
6729
- }
6730
- }
6731
6672
  if (!progressEl) return;
6732
6673
  if (progressMode === "bar") {
6733
6674
  progressEl.style.background = customColor ?? plan.theme.accent ?? "#2563eb";
@@ -6792,8 +6733,11 @@ function createDiagram(opts) {
6792
6733
  badge.href = `${MARKDY_PLAYGROUND_URL}#code=${encodeCodeForPlaygroundHash(code)}`;
6793
6734
  badge.target = "_blank";
6794
6735
  badge.rel = "noopener noreferrer";
6795
- badge.title = "Open and edit in Markdy Playground";
6796
- badge.textContent = "Powered by Markdy";
6736
+ const badgePrefix = document.createElement("span");
6737
+ badgePrefix.className = "markdy-badge-prefix";
6738
+ badgePrefix.textContent = "Powered by ";
6739
+ badge.appendChild(badgePrefix);
6740
+ badge.appendChild(document.createTextNode("Markdy"));
6797
6741
  ensureFooter().appendChild(badge);
6798
6742
  const badgeLink = badge;
6799
6743
  void compressMarkdyToUrlHash(code).then((hash) => {
@@ -7370,13 +7314,6 @@ function createDiagram(opts) {
7370
7314
  if (controlsScrubberThumb) {
7371
7315
  controlsScrubberThumb.style.left = `${clamped * 100}%`;
7372
7316
  }
7373
- if (controlsPlayButton) {
7374
- const playing = isPlaying;
7375
- controlsPlayButton.innerHTML = `${playing ? ICONS2.pause : ICONS2.play}<span class="markdy-btn-label">${playing ? "Pause" : "Play"}</span>`;
7376
- const playLabel = playing ? "Pause diagram" : "Play diagram";
7377
- controlsPlayButton.setAttribute("aria-label", playLabel);
7378
- controlsPlayButton.title = playLabel;
7379
- }
7380
7317
  for (const button of controlsRateButtons) {
7381
7318
  const rate = Number(button.dataset.rate ?? "1");
7382
7319
  const active = Math.abs(rate - playbackRate) < 1e-3;
@@ -7386,20 +7323,6 @@ function createDiagram(opts) {
7386
7323
  controlsSeekBar.value = String(sceneMs / 1e3);
7387
7324
  controlsSeekBar.style.setProperty("--seek-pct", `${clamped * 100}%`);
7388
7325
  }
7389
- if (controlsTimeEl) {
7390
- const cur = (sceneMs / 1e3).toFixed(1);
7391
- const tot = durationSeconds.toFixed(1);
7392
- controlsTimeEl.textContent = `${cur}s / ${tot}s`;
7393
- }
7394
- if (controlsBeatChip && plan.beats.length > 1) {
7395
- const currentSec = sceneMs / 1e3;
7396
- const currentBeat = plan.beats.find((b) => currentSec >= b.start && currentSec < b.end) || plan.beats[plan.beats.length - 1];
7397
- if (currentBeat) {
7398
- const beatIdx = plan.beats.indexOf(currentBeat) + 1;
7399
- controlsBeatChip.textContent = currentBeat.label ? `${beatIdx}. ${currentBeat.label}` : `Beat ${beatIdx}`;
7400
- controlsBeatChip.title = `Current beat: ${currentBeat.label || currentBeat.name}`;
7401
- }
7402
- }
7403
7326
  if (controlsFitButton) {
7404
7327
  controlsFitButton.setAttribute("aria-pressed", fitViewActive ? "true" : "false");
7405
7328
  }
@@ -7730,33 +7653,6 @@ function createDiagram(opts) {
7730
7653
  }
7731
7654
  return button;
7732
7655
  }
7733
- function mountPlayControl(toolbar) {
7734
- if (!playButton) return;
7735
- controlsPlayButton = makeControlButton("Play", "Play diagram", ICONS2.play);
7736
- controlsPlayButton.className = "markdy-control-play";
7737
- controlsPlayButton.addEventListener("click", togglePlayback);
7738
- toolbar.appendChild(controlsPlayButton);
7739
- }
7740
- function mountBeatNavControls(toolbar, position) {
7741
- const wanted = position === "prev" ? prevBeatButton : nextBeatButton;
7742
- if (!wanted || plan.beats.length < 2) return;
7743
- const label = position === "prev" ? "Prev" : "Next";
7744
- const icon = position === "prev" ? ICONS2.prevBeat : ICONS2.nextBeat;
7745
- const button = makeControlButton(label, `${label === "Prev" ? "Previous" : "Next"} beat`, icon);
7746
- button.className = `markdy-control-${position}-beat`;
7747
- button.addEventListener("click", () => position === "prev" ? diagram.prevBeat() : diagram.nextBeat());
7748
- toolbar.appendChild(button);
7749
- }
7750
- function mountRestartControl(toolbar) {
7751
- if (!restartButton) return;
7752
- const button = makeControlButton("Restart", "Restart diagram", ICONS2.restart);
7753
- button.className = "markdy-control-restart";
7754
- button.addEventListener("click", () => {
7755
- diagram.seek(0);
7756
- diagram.play();
7757
- });
7758
- toolbar.appendChild(button);
7759
- }
7760
7656
  function mountScrubber(footerEl) {
7761
7657
  if (!seekBar) return;
7762
7658
  controlsScrubber = document.createElement("div");
@@ -8341,24 +8237,6 @@ function createDiagram(opts) {
8341
8237
  if (seekBar) {
8342
8238
  mountScrubber(toolbar);
8343
8239
  }
8344
- const playbackGroup = document.createElement("div");
8345
- playbackGroup.className = "markdy-controls-group markdy-controls-playback";
8346
- mountPlayControl(playbackGroup);
8347
- mountBeatNavControls(playbackGroup, "prev");
8348
- mountBeatNavControls(playbackGroup, "next");
8349
- mountRestartControl(playbackGroup);
8350
- controlsTimeEl = document.createElement("span");
8351
- controlsTimeEl.className = "markdy-control-time";
8352
- controlsTimeEl.textContent = `${(sceneMs / 1e3).toFixed(1)}s / ${durationSeconds.toFixed(1)}s`;
8353
- playbackGroup.appendChild(controlsTimeEl);
8354
- if (plan.beats.length > 1) {
8355
- controlsBeatChip = document.createElement("span");
8356
- controlsBeatChip.className = "markdy-player-beat-chip";
8357
- const firstBeat = plan.beats[0];
8358
- controlsBeatChip.textContent = firstBeat.label ? `1. ${firstBeat.label}` : "Beat 1";
8359
- playbackGroup.appendChild(controlsBeatChip);
8360
- }
8361
- if (playbackGroup.children.length > 0) toolbar.appendChild(playbackGroup);
8362
8240
  const toolsGroup = document.createElement("div");
8363
8241
  toolsGroup.className = "markdy-controls-group markdy-controls-tools";
8364
8242
  if (speedControls) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@markdy/renderer-dom",
3
- "version": "1.4.12",
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.12"
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.12"
56
+ "@markdy/stdlib-systems": "1.4.14"
57
57
  },
58
58
  "scripts": {
59
59
  "build": "tsup",