@diagrammo/dgmo 0.15.0 → 0.15.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 +14 -1
- package/dist/advanced.cjs +53069 -0
- package/dist/advanced.d.cts +4691 -0
- package/dist/advanced.d.ts +4691 -0
- package/dist/advanced.js +52823 -0
- package/dist/auto.cjs +1495 -1288
- package/dist/auto.js +132 -109
- package/dist/auto.mjs +1491 -1284
- package/dist/cli.cjs +173 -150
- package/dist/index.cjs +1486 -1276
- package/dist/index.d.cts +45 -1
- package/dist/index.d.ts +45 -1
- package/dist/index.js +1481 -1272
- package/dist/internal.cjs +1497 -1289
- package/dist/internal.d.cts +80 -79
- package/dist/internal.d.ts +80 -79
- package/dist/internal.js +1492 -1285
- package/dist/pert.cjs +325 -0
- package/dist/pert.d.cts +542 -0
- package/dist/pert.d.ts +542 -0
- package/dist/pert.js +294 -0
- package/package.json +28 -3
- package/src/advanced.ts +731 -0
- package/src/auto/index.ts +14 -13
- package/src/boxes-and-lines/layout.ts +481 -445
- package/src/c4/parser.ts +7 -7
- package/src/chart-types.ts +0 -5
- package/src/class/parser.ts +1 -9
- package/src/cli.ts +9 -7
- package/src/completion-types.ts +28 -0
- package/src/completion.ts +15 -18
- package/src/cycle/layout.ts +2 -2
- package/src/d3.ts +1455 -1122
- package/src/echarts.ts +11 -11
- package/src/er/parser.ts +1 -9
- package/src/er/renderer.ts +1 -1
- package/src/gantt/calculator.ts +1 -11
- package/src/gantt/parser.ts +16 -16
- package/src/gantt/renderer.ts +2 -2
- package/src/graph/flowchart-parser.ts +1 -1
- package/src/graph/flowchart-renderer.ts +1 -1
- package/src/graph/state-renderer.ts +1 -1
- package/src/index.ts +17 -1
- package/src/infra/parser.ts +19 -19
- package/src/infra/renderer.ts +2 -2
- package/src/internal.ts +9 -721
- package/src/kanban/parser.ts +2 -2
- package/src/mindmap/layout.ts +1 -1
- package/src/mindmap/parser.ts +1 -1
- package/src/org/parser.ts +1 -1
- package/src/org/renderer.ts +1 -1
- package/src/pert/layout.ts +1 -1
- package/src/pert/monte-carlo.ts +2 -2
- package/src/pert/parser.ts +3 -3
- package/src/raci/parser.ts +4 -4
- package/src/raci/renderer.ts +1 -1
- package/src/sequence/renderer.ts +1 -4
- package/src/sitemap/parser.ts +1 -1
- package/src/tech-radar/interactive.ts +1 -1
- package/src/tech-radar/renderer.ts +1 -1
- package/src/utils/tag-groups.ts +11 -12
- package/src/wireframe/layout.ts +11 -7
- package/src/wireframe/parser.ts +2 -2
- package/src/wireframe/renderer.ts +5 -2
package/src/auto/index.ts
CHANGED
|
@@ -532,14 +532,14 @@ interface ProcessOutcome {
|
|
|
532
532
|
|
|
533
533
|
async function processElement(el: Element): Promise<ProcessOutcome> {
|
|
534
534
|
if (!(el instanceof HTMLElement)) return {};
|
|
535
|
-
if (el.dataset
|
|
535
|
+
if (el.dataset['dgmoProcessed'] === 'true') return {};
|
|
536
536
|
|
|
537
537
|
// Mark the source synchronously so a concurrent run() (e.g. a SPA
|
|
538
538
|
// hydration race firing right after auto-bootstrap) can't double-process
|
|
539
539
|
// the same element while we await render(). The wrapper inherits the
|
|
540
540
|
// flag below; on error paths we DO clear it (see error handlers) so the
|
|
541
541
|
// user can retry with `dgmo.run()` after fixing the source.
|
|
542
|
-
el.dataset
|
|
542
|
+
el.dataset['dgmoProcessed'] = 'true';
|
|
543
543
|
|
|
544
544
|
const source = el.textContent || '';
|
|
545
545
|
const sourceBytes = new TextEncoder().encode(source).byteLength;
|
|
@@ -564,7 +564,7 @@ async function processElement(el: Element): Promise<ProcessOutcome> {
|
|
|
564
564
|
resolvedTheme === 'transparent' ? 'transparent' : resolvedTheme;
|
|
565
565
|
const ariaLabel = deriveAriaLabel(source);
|
|
566
566
|
|
|
567
|
-
const perElementShowSource = el.dataset
|
|
567
|
+
const perElementShowSource = el.dataset['showSource'];
|
|
568
568
|
let showSource = cfg.showSource;
|
|
569
569
|
// Strict allowlist: only the exact strings 'true' / 'false' override the
|
|
570
570
|
// global. Anything else (e.g. 'yes', '1') is ignored with a warning.
|
|
@@ -640,7 +640,7 @@ async function processElement(el: Element): Promise<ProcessOutcome> {
|
|
|
640
640
|
? 'dgmo-theme-transparent'
|
|
641
641
|
: 'dgmo-theme-light';
|
|
642
642
|
wrapper.className = `dgmo-rendered ${themeClass}`;
|
|
643
|
-
wrapper.dataset
|
|
643
|
+
wrapper.dataset['dgmoProcessed'] = 'true';
|
|
644
644
|
|
|
645
645
|
// Insert SVG via a detached holder + post-insertion sanitization. The
|
|
646
646
|
// spec said "never assign user-supplied content to innerHTML"; we treat
|
|
@@ -759,15 +759,16 @@ export function initialize(opts: AutoConfig = {}): void {
|
|
|
759
759
|
}
|
|
760
760
|
}
|
|
761
761
|
const next = { ...activeConfig };
|
|
762
|
-
if (isValidTheme(opts
|
|
763
|
-
next.theme = opts
|
|
762
|
+
if (isValidTheme(opts['theme'])) {
|
|
763
|
+
next.theme = opts['theme'];
|
|
764
764
|
}
|
|
765
|
-
if (typeof opts
|
|
766
|
-
next.palette = opts
|
|
765
|
+
if (typeof opts['palette'] === 'string' && paletteExists(opts['palette'])) {
|
|
766
|
+
next.palette = opts['palette'];
|
|
767
767
|
}
|
|
768
|
-
if (typeof opts
|
|
769
|
-
|
|
770
|
-
|
|
768
|
+
if (typeof opts['showSource'] === 'boolean')
|
|
769
|
+
next.showSource = opts['showSource'];
|
|
770
|
+
if (typeof opts['showEditorLink'] === 'boolean')
|
|
771
|
+
next.showEditorLink = opts['showEditorLink'];
|
|
771
772
|
activeConfig = next;
|
|
772
773
|
}
|
|
773
774
|
|
|
@@ -826,7 +827,7 @@ function rerenderAllForTheme(): void {
|
|
|
826
827
|
placeholder.className = 'dgmo';
|
|
827
828
|
placeholder.textContent = t.source;
|
|
828
829
|
if (t.perElementShowSource !== null) {
|
|
829
|
-
placeholder.dataset
|
|
830
|
+
placeholder.dataset['showSource'] = String(t.perElementShowSource);
|
|
830
831
|
}
|
|
831
832
|
t.wrapper.replaceWith(placeholder);
|
|
832
833
|
wrappers.delete(t);
|
|
@@ -867,7 +868,7 @@ function unhideAllSources(): void {
|
|
|
867
868
|
});
|
|
868
869
|
// Also drop the anti-flash flag so subsequent loads re-inject if needed.
|
|
869
870
|
if (document.documentElement && document.documentElement.dataset) {
|
|
870
|
-
document.documentElement.dataset
|
|
871
|
+
document.documentElement.dataset['dgmoAutoFailed'] = '1';
|
|
871
872
|
}
|
|
872
873
|
}
|
|
873
874
|
|