@markdy/renderer-dom 1.5.0 → 1.5.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.
Files changed (3) hide show
  1. package/README.md +10 -1
  2. package/dist/index.js +19 -24
  3. package/package.json +3 -3
package/README.md CHANGED
@@ -4,6 +4,7 @@
4
4
  <a href="https://markdy.com/playground/"><img src="https://img.shields.io/badge/⚡_Live_Studio-markdy.com%2Fplayground-3b82f6?style=for-the-badge" alt="Live Studio" /></a>
5
5
  <a href="https://markdy.com/docs/"><img src="https://img.shields.io/badge/📖_Docs-Documentation-10b981?style=for-the-badge" alt="Documentation" /></a>
6
6
  <a href="https://markdy.com/examples/"><img src="https://img.shields.io/badge/🌟_Blueprints-30+_Examples-f59e0b?style=for-the-badge" alt="Examples" /></a>
7
+ <a href="https://github.com/sponsors/HoangYell"><img src="https://img.shields.io/badge/📐_Pro_Blueprints-Architecture_Kits-f59e0b?style=for-the-badge" alt="Pro Architecture Blueprints" /></a>
7
8
  <a href="https://github.com/sponsors/HoangYell"><img src="https://img.shields.io/badge/💖_Sponsor-Support_Markdy-ea4aaa?style=for-the-badge" alt="Sponsor Markdy" /></a>
8
9
  </p>
9
10
 
@@ -11,7 +12,7 @@ Web Animations API renderer for [MarkdyScript](https://markdy.com/docs/) scenes.
11
12
 
12
13
  > 🚀 **Try it live**: Test MarkdyScript in the browser at **[markdy.com/playground](https://markdy.com/playground/)**
13
14
  > 📚 **Documentation**: Complete syntax guide and examples at **[markdy.com/docs](https://markdy.com/docs/)**
14
- > 💼 **Enterprise & Commercial**: Free under MIT. To support development or request custom architecture blueprints, explore **[GitHub Sponsors](https://github.com/sponsors/HoangYell)**.
15
+ > 💼 **Enterprise & Commercial**: Free under MIT. Access production architectural templates, custom diagram kits, and direct support via **[GitHub Sponsors & Pro Blueprints](https://github.com/sponsors/HoangYell)**.
15
16
 
16
17
  ## Features
17
18
 
@@ -168,6 +169,14 @@ The harness runs on **`http://127.0.0.1:4325`** (port 4325 is decoupled from Ast
168
169
  - 🌟 **[Canonical Blueprints](https://markdy.com/examples/)** — production-grade distributed system and cloud architectures
169
170
  - 📦 **[GitHub Repository](https://github.com/HoangYell/markdy-com)** — source code, benchmarks, and issue tracker
170
171
 
172
+ ## 📐 Production Architecture Blueprints & Pro Support
173
+
174
+ Ship production diagrams faster with proven starting points and expert help:
175
+
176
+ - 🌟 **Canonical Blueprints Showcase**: Browse 30+ production-grade architectures for fintech, SaaS, AI, and cloud-native stacks at [markdy.com/examples](https://markdy.com/examples/) - copy any blueprint and adapt it to your stack in minutes.
177
+ - 📦 **Pro Architecture Kits on GitHub Sponsors**: Unlock private production templates, enterprise layout kits, and prioritized support at [github.com/sponsors/HoangYell](https://github.com/sponsors/HoangYell) - built for teams shipping docs at scale.
178
+ - ⚡ **Interactive Studio**: Prototype and share live diagrams instantly in your browser at [markdy.com/playground](https://markdy.com/playground/) - no install, no setup, just paste MarkdyScript and present.
179
+
171
180
  ## License
172
181
 
173
182
  [MIT](https://github.com/HoangYell/markdy-com/blob/main/LICENSE)
package/dist/index.js CHANGED
@@ -7335,9 +7335,8 @@ function createDiagram(opts) {
7335
7335
  cameraLayer.style.setProperty("transform", "none", "important");
7336
7336
  }
7337
7337
  const hasAuthorInteraction = Boolean(plan.meta.player?.interaction?.pan) || Boolean(plan.meta.player?.interaction?.zoom) || Boolean(plan.meta.player?.interaction?.enabled);
7338
- const hasInteractControl = showControls && (interactButton ?? fitViewButton) !== false && (Boolean(interactButton) || Boolean(fitViewButton));
7339
7338
  const explicitInteract = defaultInteract ?? explicitInteractOption;
7340
- let interactActive = explicitInteract !== void 0 ? Boolean(explicitInteract) : hasInteractControl ? false : hasAuthorInteraction || Boolean(explicitInteractiveViewport);
7339
+ let interactActive = explicitInteract !== void 0 ? Boolean(explicitInteract) : hasAuthorInteraction || Boolean(explicitInteractiveViewport);
7341
7340
  const ICONS2 = {
7342
7341
  play: '<svg class="markdy-icon" width="12" height="12" viewBox="0 0 24 24" fill="currentColor"><path d="M8 5v14l11-7z"/></svg>',
7343
7342
  pause: '<svg class="markdy-icon" width="12" height="12" viewBox="0 0 24 24" fill="currentColor"><path d="M6 19h4V5H6v14zm8-14v14h4V5h-4z"/></svg>',
@@ -7350,7 +7349,7 @@ function createDiagram(opts) {
7350
7349
  fullscreen: '<svg class="markdy-icon" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><path d="M15 3h6v6M9 21H3v-6M21 3l-7 7M3 21l7-7"/></svg>',
7351
7350
  fullscreenExit: '<svg class="markdy-icon" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 14h6v6M20 10h-6V4M14 10l7-7M3 21l7-7"/></svg>',
7352
7351
  svg: '<svg class="markdy-icon" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" y1="15" x2="12" y2="3"/></svg>',
7353
- gif: '<svg class="markdy-icon" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><rect x="2" y="2" width="20" height="20" rx="3"/><circle cx="7" cy="7" r="1.5" fill="currentColor"/><circle cx="17" cy="7" r="1.5" fill="currentColor"/><circle cx="7" cy="17" r="1.5" fill="currentColor"/><circle cx="17" cy="17" r="1.5" fill="currentColor"/><path d="M10 10l5 2-5 2z" fill="currentColor"/></svg>',
7352
+ gif: '<svg class="markdy-icon" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" y1="15" x2="12" y2="3"/></svg>',
7354
7353
  share: '<svg class="markdy-icon" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg>',
7355
7354
  code: '<svg class="markdy-icon" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><polyline points="16 18 22 12 16 6"/><polyline points="8 6 2 12 8 18"/></svg>',
7356
7355
  theme: '<svg class="markdy-icon" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="9"/><path d="M12 3v18"/><path d="M12 3a9 9 0 0 1 0 18z" fill="currentColor"/></svg>',
@@ -8364,30 +8363,19 @@ function createDiagram(opts) {
8364
8363
  });
8365
8364
  toolbar.appendChild(button);
8366
8365
  }
8367
- function mountInteractControl(toolbar) {
8368
- const showButton = (interactButton ?? fitViewButton) !== false && (Boolean(interactButton) || Boolean(fitViewButton));
8369
- if (!showButton) return;
8370
- controlsInteractButton = makeControlButton("Interact", "Toggle interactive mode (pinch, zoom, and drag)", ICONS2.interact);
8371
- controlsInteractButton.className = "markdy-control-interact markdy-control-fit";
8372
- controlsInteractButton.setAttribute("aria-pressed", (defaultFit === false ? fitViewActive : interactActive) ? "true" : "false");
8373
- controlsInteractButton.addEventListener("click", () => {
8374
- if (defaultFit === false) {
8375
- toggleFitView();
8376
- } else {
8377
- toggleInteract();
8378
- }
8379
- });
8380
- controlsFitButton = controlsInteractButton;
8381
- toolbar.appendChild(controlsInteractButton);
8366
+ function mountInteractControl(_toolbar) {
8382
8367
  }
8383
8368
  function mountFitControl(toolbar) {
8384
8369
  mountInteractControl(toolbar);
8385
8370
  }
8371
+ let controlsResetViewButton = null;
8386
8372
  function mountResetViewControl(toolbar) {
8387
- if (!resetViewButton) return;
8373
+ if (!resetViewButton && !fullscreenButton) return;
8388
8374
  const button = makeControlButton("Reset", "Reset diagram view", ICONS2.resetView);
8389
8375
  button.className = "markdy-control-reset-view";
8376
+ button.style.display = "none";
8390
8377
  button.addEventListener("click", resetViewportTransform);
8378
+ controlsResetViewButton = button;
8391
8379
  toolbar.appendChild(button);
8392
8380
  }
8393
8381
  let removeFullscreenListeners = null;
@@ -8431,6 +8419,10 @@ function createDiagram(opts) {
8431
8419
  }
8432
8420
  }
8433
8421
  }
8422
+ toggleInteract(true);
8423
+ if (controlsResetViewButton) {
8424
+ controlsResetViewButton.style.display = "inline-flex";
8425
+ }
8434
8426
  } else {
8435
8427
  host.classList.remove("markdy-fullscreen-host");
8436
8428
  host.classList.remove("markdy--pseudo-fullscreen");
@@ -8444,6 +8436,10 @@ function createDiagram(opts) {
8444
8436
  originalBodyOverflow = null;
8445
8437
  }
8446
8438
  }
8439
+ toggleInteract(false);
8440
+ if (controlsResetViewButton) {
8441
+ controlsResetViewButton.style.display = "none";
8442
+ }
8447
8443
  }
8448
8444
  requestAnimationFrame(() => {
8449
8445
  scaleScene();
@@ -8629,13 +8625,12 @@ function createDiagram(opts) {
8629
8625
  mountSpeedControls(speedGroup);
8630
8626
  toolsGroup.appendChild(speedGroup);
8631
8627
  }
8632
- if (interactButton || fitViewButton || resetViewButton || fullscreenButton) {
8628
+ if (resetViewButton || fullscreenButton) {
8633
8629
  if (toolsGroup.children.length > 0) {
8634
8630
  const divider = document.createElement("div");
8635
8631
  divider.className = "markdy-control-divider";
8636
8632
  toolsGroup.appendChild(divider);
8637
8633
  }
8638
- mountInteractControl(toolsGroup);
8639
8634
  mountResetViewControl(toolsGroup);
8640
8635
  mountFullscreenControl(toolsGroup);
8641
8636
  }
@@ -8660,14 +8655,14 @@ function createDiagram(opts) {
8660
8655
  }
8661
8656
  viewport.style.cursor = interactActive ? "grab" : clickToPlay ? "pointer" : "default";
8662
8657
  viewport.style.touchAction = interactActive ? "none" : scrollableViewport ? "pan-x pan-y" : "auto";
8663
- if (allowZoom) viewport.addEventListener("wheel", handleViewportWheel, { passive: false });
8664
- if (allowPan) {
8658
+ if (allowZoom || fullscreenButton) viewport.addEventListener("wheel", handleViewportWheel, { passive: false });
8659
+ if (allowPan || fullscreenButton) {
8665
8660
  viewport.addEventListener("pointerdown", handleViewportPointerDown);
8666
8661
  viewport.addEventListener("pointermove", handleViewportPointerMove);
8667
8662
  viewport.addEventListener("pointerup", handleViewportPointerEnd);
8668
8663
  viewport.addEventListener("pointercancel", handleViewportPointerEnd);
8669
8664
  }
8670
- if (doubleClickToReset) viewport.addEventListener("dblclick", handleViewportDoubleClick);
8665
+ if (doubleClickToReset || fullscreenButton) viewport.addEventListener("dblclick", handleViewportDoubleClick);
8671
8666
  if (showControls) mountControls();
8672
8667
  if (clickToPlay) {
8673
8668
  viewport.addEventListener("click", () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@markdy/renderer-dom",
3
- "version": "1.5.0",
3
+ "version": "1.5.2",
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.5.0"
49
+ "@markdy/core": "1.5.2"
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.5.0"
56
+ "@markdy/stdlib-systems": "1.5.2"
57
57
  },
58
58
  "scripts": {
59
59
  "build": "tsup",