@markdy/renderer-dom 1.4.25 → 1.5.1
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/README.md +10 -1
- package/dist/index.js +78 -38
- package/package.json +5 -5
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.
|
|
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
|
@@ -3817,10 +3817,10 @@ function ensureSceneStyles(doc) {
|
|
|
3817
3817
|
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
|
|
3818
3818
|
}
|
|
3819
3819
|
.markdy-controls {
|
|
3820
|
-
display: flex;
|
|
3820
|
+
display: inline-flex;
|
|
3821
3821
|
align-items: center;
|
|
3822
|
-
justify-content:
|
|
3823
|
-
flex:
|
|
3822
|
+
justify-content: flex-start;
|
|
3823
|
+
flex: 0 1 auto;
|
|
3824
3824
|
width: auto;
|
|
3825
3825
|
min-width: 0;
|
|
3826
3826
|
gap: 6px;
|
|
@@ -3845,7 +3845,7 @@ function ensureSceneStyles(doc) {
|
|
|
3845
3845
|
align-items: center;
|
|
3846
3846
|
gap: 4px;
|
|
3847
3847
|
flex-shrink: 0;
|
|
3848
|
-
margin-left:
|
|
3848
|
+
margin-left: 0;
|
|
3849
3849
|
}
|
|
3850
3850
|
.markdy-control-divider {
|
|
3851
3851
|
width: 1px;
|
|
@@ -3928,22 +3928,35 @@ function ensureSceneStyles(doc) {
|
|
|
3928
3928
|
.markdy-badge {
|
|
3929
3929
|
display: inline-flex;
|
|
3930
3930
|
align-items: center;
|
|
3931
|
+
gap: 4px;
|
|
3931
3932
|
text-align: right;
|
|
3932
3933
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
|
3933
|
-
font-size:
|
|
3934
|
-
|
|
3935
|
-
color: #
|
|
3934
|
+
font-size: 11px;
|
|
3935
|
+
line-height: 1;
|
|
3936
|
+
color: #64748b;
|
|
3936
3937
|
text-decoration: none;
|
|
3937
|
-
padding:
|
|
3938
|
-
|
|
3938
|
+
padding: 3px 6px;
|
|
3939
|
+
border-radius: 5px;
|
|
3940
|
+
opacity: 0.75;
|
|
3939
3941
|
margin-left: auto;
|
|
3940
3942
|
flex-shrink: 0;
|
|
3941
|
-
transition: opacity 0.15s ease, color 0.15s ease;
|
|
3943
|
+
transition: opacity 0.15s ease, color 0.15s ease, background-color 0.15s ease;
|
|
3942
3944
|
white-space: nowrap;
|
|
3943
3945
|
}
|
|
3944
3946
|
.markdy-badge:hover {
|
|
3945
3947
|
opacity: 1;
|
|
3946
|
-
color: #
|
|
3948
|
+
color: #1e293b;
|
|
3949
|
+
background-color: rgba(148, 163, 184, 0.12);
|
|
3950
|
+
}
|
|
3951
|
+
.markdy-badge-prefix {
|
|
3952
|
+
font-weight: 400;
|
|
3953
|
+
letter-spacing: 0.02em;
|
|
3954
|
+
opacity: 0.85;
|
|
3955
|
+
}
|
|
3956
|
+
.markdy-badge-brand {
|
|
3957
|
+
font-weight: 600;
|
|
3958
|
+
letter-spacing: 0.03em;
|
|
3959
|
+
color: #334155;
|
|
3947
3960
|
}
|
|
3948
3961
|
@media (max-width: 640px) {
|
|
3949
3962
|
.markdy-btn-label {
|
|
@@ -4375,9 +4388,36 @@ function ensureSceneStyles(doc) {
|
|
|
4375
4388
|
.markdy-footer a {
|
|
4376
4389
|
transition: opacity 0.15s ease, color 0.15s ease;
|
|
4377
4390
|
}
|
|
4378
|
-
.markdy-
|
|
4379
|
-
|
|
4380
|
-
|
|
4391
|
+
[data-markdy-theme="midnight"] .markdy-badge,
|
|
4392
|
+
[data-markdy-theme="blueprint"] .markdy-badge,
|
|
4393
|
+
[data-markdy-theme="terminal"] .markdy-badge,
|
|
4394
|
+
[data-markdy-theme="graphite"] .markdy-badge,
|
|
4395
|
+
[data-markdy-theme="nebula"] .markdy-badge,
|
|
4396
|
+
:root[data-theme="dark"] .markdy-badge,
|
|
4397
|
+
.theme-dark .markdy-badge,
|
|
4398
|
+
.dark .markdy-badge {
|
|
4399
|
+
color: #94a3b8;
|
|
4400
|
+
}
|
|
4401
|
+
[data-markdy-theme="midnight"] .markdy-badge:hover,
|
|
4402
|
+
[data-markdy-theme="blueprint"] .markdy-badge:hover,
|
|
4403
|
+
[data-markdy-theme="terminal"] .markdy-badge:hover,
|
|
4404
|
+
[data-markdy-theme="graphite"] .markdy-badge:hover,
|
|
4405
|
+
[data-markdy-theme="nebula"] .markdy-badge:hover,
|
|
4406
|
+
:root[data-theme="dark"] .markdy-badge:hover,
|
|
4407
|
+
.theme-dark .markdy-badge:hover,
|
|
4408
|
+
.dark .markdy-badge:hover {
|
|
4409
|
+
color: #f1f5f9 !important;
|
|
4410
|
+
background-color: rgba(255, 255, 255, 0.08);
|
|
4411
|
+
}
|
|
4412
|
+
[data-markdy-theme="midnight"] .markdy-badge-brand,
|
|
4413
|
+
[data-markdy-theme="blueprint"] .markdy-badge-brand,
|
|
4414
|
+
[data-markdy-theme="terminal"] .markdy-badge-brand,
|
|
4415
|
+
[data-markdy-theme="graphite"] .markdy-badge-brand,
|
|
4416
|
+
[data-markdy-theme="nebula"] .markdy-badge-brand,
|
|
4417
|
+
:root[data-theme="dark"] .markdy-badge-brand,
|
|
4418
|
+
.theme-dark .markdy-badge-brand,
|
|
4419
|
+
.dark .markdy-badge-brand {
|
|
4420
|
+
color: #f8fafc;
|
|
4381
4421
|
}
|
|
4382
4422
|
/* Fullscreen & Fallback Pseudo-Fullscreen Views */
|
|
4383
4423
|
.markdy-fullscreen-host,
|
|
@@ -6825,9 +6865,14 @@ function createDiagram(opts) {
|
|
|
6825
6865
|
badge.rel = "noopener noreferrer";
|
|
6826
6866
|
const badgePrefix = document.createElement("span");
|
|
6827
6867
|
badgePrefix.className = "markdy-badge-prefix";
|
|
6828
|
-
badgePrefix.textContent = "Powered by
|
|
6868
|
+
badgePrefix.textContent = "Powered by";
|
|
6829
6869
|
badge.appendChild(badgePrefix);
|
|
6830
|
-
|
|
6870
|
+
const space = document.createTextNode(" ");
|
|
6871
|
+
badge.appendChild(space);
|
|
6872
|
+
const badgeBrand = document.createElement("span");
|
|
6873
|
+
badgeBrand.className = "markdy-badge-brand";
|
|
6874
|
+
badgeBrand.textContent = "Markdy";
|
|
6875
|
+
badge.appendChild(badgeBrand);
|
|
6831
6876
|
ensureFooter().appendChild(badge);
|
|
6832
6877
|
const badgeLink = badge;
|
|
6833
6878
|
void compressMarkdyToUrlHash(code).then((hash) => {
|
|
@@ -7290,9 +7335,8 @@ function createDiagram(opts) {
|
|
|
7290
7335
|
cameraLayer.style.setProperty("transform", "none", "important");
|
|
7291
7336
|
}
|
|
7292
7337
|
const hasAuthorInteraction = Boolean(plan.meta.player?.interaction?.pan) || Boolean(plan.meta.player?.interaction?.zoom) || Boolean(plan.meta.player?.interaction?.enabled);
|
|
7293
|
-
const hasInteractControl = showControls && (interactButton ?? fitViewButton) !== false && (Boolean(interactButton) || Boolean(fitViewButton));
|
|
7294
7338
|
const explicitInteract = defaultInteract ?? explicitInteractOption;
|
|
7295
|
-
let interactActive = explicitInteract !== void 0 ? Boolean(explicitInteract) :
|
|
7339
|
+
let interactActive = explicitInteract !== void 0 ? Boolean(explicitInteract) : hasAuthorInteraction || Boolean(explicitInteractiveViewport);
|
|
7296
7340
|
const ICONS2 = {
|
|
7297
7341
|
play: '<svg class="markdy-icon" width="12" height="12" viewBox="0 0 24 24" fill="currentColor"><path d="M8 5v14l11-7z"/></svg>',
|
|
7298
7342
|
pause: '<svg class="markdy-icon" width="12" height="12" viewBox="0 0 24 24" fill="currentColor"><path d="M6 19h4V5H6v14zm8-14v14h4V5h-4z"/></svg>',
|
|
@@ -7305,7 +7349,7 @@ function createDiagram(opts) {
|
|
|
7305
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>',
|
|
7306
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>',
|
|
7307
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>',
|
|
7308
|
-
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"><
|
|
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>',
|
|
7309
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>',
|
|
7310
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>',
|
|
7311
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>',
|
|
@@ -8319,30 +8363,19 @@ function createDiagram(opts) {
|
|
|
8319
8363
|
});
|
|
8320
8364
|
toolbar.appendChild(button);
|
|
8321
8365
|
}
|
|
8322
|
-
function mountInteractControl(
|
|
8323
|
-
const showButton = (interactButton ?? fitViewButton) !== false && (Boolean(interactButton) || Boolean(fitViewButton));
|
|
8324
|
-
if (!showButton) return;
|
|
8325
|
-
controlsInteractButton = makeControlButton("Interact", "Toggle interactive mode (pinch, zoom, and drag)", ICONS2.interact);
|
|
8326
|
-
controlsInteractButton.className = "markdy-control-interact markdy-control-fit";
|
|
8327
|
-
controlsInteractButton.setAttribute("aria-pressed", (defaultFit === false ? fitViewActive : interactActive) ? "true" : "false");
|
|
8328
|
-
controlsInteractButton.addEventListener("click", () => {
|
|
8329
|
-
if (defaultFit === false) {
|
|
8330
|
-
toggleFitView();
|
|
8331
|
-
} else {
|
|
8332
|
-
toggleInteract();
|
|
8333
|
-
}
|
|
8334
|
-
});
|
|
8335
|
-
controlsFitButton = controlsInteractButton;
|
|
8336
|
-
toolbar.appendChild(controlsInteractButton);
|
|
8366
|
+
function mountInteractControl(_toolbar) {
|
|
8337
8367
|
}
|
|
8338
8368
|
function mountFitControl(toolbar) {
|
|
8339
8369
|
mountInteractControl(toolbar);
|
|
8340
8370
|
}
|
|
8371
|
+
let controlsResetViewButton = null;
|
|
8341
8372
|
function mountResetViewControl(toolbar) {
|
|
8342
8373
|
if (!resetViewButton) return;
|
|
8343
8374
|
const button = makeControlButton("Reset", "Reset diagram view", ICONS2.resetView);
|
|
8344
8375
|
button.className = "markdy-control-reset-view";
|
|
8376
|
+
button.style.display = "none";
|
|
8345
8377
|
button.addEventListener("click", resetViewportTransform);
|
|
8378
|
+
controlsResetViewButton = button;
|
|
8346
8379
|
toolbar.appendChild(button);
|
|
8347
8380
|
}
|
|
8348
8381
|
let removeFullscreenListeners = null;
|
|
@@ -8386,6 +8419,10 @@ function createDiagram(opts) {
|
|
|
8386
8419
|
}
|
|
8387
8420
|
}
|
|
8388
8421
|
}
|
|
8422
|
+
toggleInteract(true);
|
|
8423
|
+
if (controlsResetViewButton) {
|
|
8424
|
+
controlsResetViewButton.style.display = "inline-flex";
|
|
8425
|
+
}
|
|
8389
8426
|
} else {
|
|
8390
8427
|
host.classList.remove("markdy-fullscreen-host");
|
|
8391
8428
|
host.classList.remove("markdy--pseudo-fullscreen");
|
|
@@ -8399,6 +8436,10 @@ function createDiagram(opts) {
|
|
|
8399
8436
|
originalBodyOverflow = null;
|
|
8400
8437
|
}
|
|
8401
8438
|
}
|
|
8439
|
+
toggleInteract(false);
|
|
8440
|
+
if (controlsResetViewButton) {
|
|
8441
|
+
controlsResetViewButton.style.display = "none";
|
|
8442
|
+
}
|
|
8402
8443
|
}
|
|
8403
8444
|
requestAnimationFrame(() => {
|
|
8404
8445
|
scaleScene();
|
|
@@ -8544,10 +8585,10 @@ function createDiagram(opts) {
|
|
|
8544
8585
|
toolbar.setAttribute("aria-label", "Diagram controls");
|
|
8545
8586
|
Object.assign(toolbar.style, {
|
|
8546
8587
|
position: "relative",
|
|
8547
|
-
display: "flex",
|
|
8588
|
+
display: "inline-flex",
|
|
8548
8589
|
alignItems: "center",
|
|
8549
8590
|
justifyContent: "flex-start",
|
|
8550
|
-
width: "
|
|
8591
|
+
width: "auto",
|
|
8551
8592
|
maxWidth: "100%",
|
|
8552
8593
|
border: "0",
|
|
8553
8594
|
borderRadius: "0",
|
|
@@ -8584,13 +8625,12 @@ function createDiagram(opts) {
|
|
|
8584
8625
|
mountSpeedControls(speedGroup);
|
|
8585
8626
|
toolsGroup.appendChild(speedGroup);
|
|
8586
8627
|
}
|
|
8587
|
-
if (
|
|
8628
|
+
if (resetViewButton || fullscreenButton) {
|
|
8588
8629
|
if (toolsGroup.children.length > 0) {
|
|
8589
8630
|
const divider = document.createElement("div");
|
|
8590
8631
|
divider.className = "markdy-control-divider";
|
|
8591
8632
|
toolsGroup.appendChild(divider);
|
|
8592
8633
|
}
|
|
8593
|
-
mountInteractControl(toolsGroup);
|
|
8594
8634
|
mountResetViewControl(toolsGroup);
|
|
8595
8635
|
mountFullscreenControl(toolsGroup);
|
|
8596
8636
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@markdy/renderer-dom",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.1",
|
|
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",
|
|
@@ -45,15 +45,15 @@
|
|
|
45
45
|
"registry": "https://registry.npmjs.org"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"
|
|
49
|
-
"
|
|
48
|
+
"html2canvas": "^1.4.1",
|
|
49
|
+
"@markdy/core": "1.5.1"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@markdy/stdlib-systems": "^1.4.21",
|
|
53
52
|
"jsdom": "^29.1.1",
|
|
54
53
|
"tsup": "^8.5.1",
|
|
55
54
|
"typescript": "^5.9.3",
|
|
56
|
-
"vitest": "^4.1.7"
|
|
55
|
+
"vitest": "^4.1.7",
|
|
56
|
+
"@markdy/stdlib-systems": "1.5.1"
|
|
57
57
|
},
|
|
58
58
|
"scripts": {
|
|
59
59
|
"build": "tsup",
|