@diagrammo/dgmo 0.24.0 → 0.25.0
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/LICENSE +1 -1
- package/dist/advanced.cjs +14 -18
- package/dist/advanced.js +14 -18
- package/dist/auto.cjs +15 -19
- package/dist/auto.js +99 -99
- package/dist/auto.mjs +15 -19
- package/dist/cli.cjs +132 -132
- package/dist/index.cjs +14 -18
- package/dist/index.js +14 -18
- package/dist/internal.cjs +14 -18
- package/dist/internal.js +14 -18
- package/package.json +1 -1
- package/src/diagnostics.ts +0 -19
- package/src/map/geo.ts +0 -5
- package/src/sequence/parser.ts +0 -4
- package/src/utils/brand.ts +0 -17
- package/src/utils/legend-d3.ts +18 -8
- package/src/utils/parsing.ts +0 -16
- package/src/utils/reserved-key-registry.ts +0 -12
package/dist/auto.mjs
CHANGED
|
@@ -741,7 +741,7 @@ function withTagAliases(base, aliases) {
|
|
|
741
741
|
function isReservedKey(registry, key) {
|
|
742
742
|
return registry.keys.has(key) || registry.tagAliases.has(key);
|
|
743
743
|
}
|
|
744
|
-
var SEQUENCE_REGISTRY, INFRA_REGISTRY, MAP_REGISTRY, ORG_REGISTRY, C4_REGISTRY, ER_REGISTRY,
|
|
744
|
+
var SEQUENCE_REGISTRY, INFRA_REGISTRY, MAP_REGISTRY, ORG_REGISTRY, C4_REGISTRY, ER_REGISTRY, KANBAN_REGISTRY, SITEMAP_REGISTRY, GANTT_REGISTRY, PERT_REGISTRY, BOXES_AND_LINES_REGISTRY, TIMELINE_REGISTRY, MINDMAP_REGISTRY, TECH_RADAR_REGISTRY, CYCLE_REGISTRY, JOURNEY_MAP_REGISTRY, PYRAMID_REGISTRY, RING_REGISTRY, RACI_REGISTRY;
|
|
745
745
|
var init_reserved_key_registry = __esm({
|
|
746
746
|
"src/utils/reserved-key-registry.ts"() {
|
|
747
747
|
"use strict";
|
|
@@ -785,10 +785,6 @@ var init_reserved_key_registry = __esm({
|
|
|
785
785
|
"description",
|
|
786
786
|
"domain"
|
|
787
787
|
]);
|
|
788
|
-
CLASS_REGISTRY = staticRegistry([
|
|
789
|
-
"color",
|
|
790
|
-
"description"
|
|
791
|
-
]);
|
|
792
788
|
KANBAN_REGISTRY = staticRegistry([
|
|
793
789
|
"color",
|
|
794
790
|
"description",
|
|
@@ -864,7 +860,6 @@ var init_reserved_key_registry = __esm({
|
|
|
864
860
|
"color",
|
|
865
861
|
"description"
|
|
866
862
|
]);
|
|
867
|
-
WIREFRAME_REGISTRY = staticRegistry([]);
|
|
868
863
|
}
|
|
869
864
|
});
|
|
870
865
|
|
|
@@ -4133,6 +4128,9 @@ var init_legend_layout = __esm({
|
|
|
4133
4128
|
});
|
|
4134
4129
|
|
|
4135
4130
|
// src/utils/legend-d3.ts
|
|
4131
|
+
function centerText(sel) {
|
|
4132
|
+
return sel.attr("dy", LEGEND_TEXT_DY);
|
|
4133
|
+
}
|
|
4136
4134
|
function renderLegendD3(container, config, state, palette, isDark, callbacks, containerWidth) {
|
|
4137
4135
|
const width = containerWidth ?? parseFloat(container.attr("width") || "800");
|
|
4138
4136
|
let currentState = { ...state };
|
|
@@ -4215,21 +4213,21 @@ function renderCapsule(parent, capsule, palette, groupBg, pillBorder, _isDark, c
|
|
|
4215
4213
|
const pill = capsule.pill;
|
|
4216
4214
|
g.append("rect").attr("x", pill.x).attr("y", pill.y).attr("width", pill.width).attr("height", pill.height).attr("rx", pill.height / 2).attr("fill", palette.bg);
|
|
4217
4215
|
g.append("rect").attr("x", pill.x).attr("y", pill.y).attr("width", pill.width).attr("height", pill.height).attr("rx", pill.height / 2).attr("fill", "none").attr("stroke", pillBorder).attr("stroke-width", 0.75);
|
|
4218
|
-
g.append("text").attr("x", pill.x + pill.width / 2).attr("y", LEGEND_HEIGHT / 2).attr("text-anchor", "middle").
|
|
4216
|
+
g.append("text").attr("x", pill.x + pill.width / 2).attr("y", LEGEND_HEIGHT / 2).attr("text-anchor", "middle").call(centerText).attr("font-size", LEGEND_PILL_FONT_SIZE).attr("font-weight", 500).attr("fill", palette.text).attr("pointer-events", "none").attr("font-family", FONT_FAMILY).text(capsule.groupName);
|
|
4219
4217
|
if (capsule.gradient) {
|
|
4220
4218
|
const gr = capsule.gradient;
|
|
4221
4219
|
const gradId = `dgmo-legend-ramp-${capsule.groupName.toLowerCase().replace(/[^a-z0-9]+/g, "-")}`;
|
|
4222
4220
|
const def = g.append("defs").append("linearGradient").attr("id", gradId);
|
|
4223
4221
|
def.append("stop").attr("offset", "0%").attr("stop-color", mix(gr.hue, gr.base, 15));
|
|
4224
4222
|
def.append("stop").attr("offset", "100%").attr("stop-color", gr.hue);
|
|
4225
|
-
g.append("text").attr("x", gr.minX).attr("y", gr.textY).
|
|
4223
|
+
g.append("text").attr("x", gr.minX).attr("y", gr.textY).call(centerText).attr("font-size", LEGEND_ENTRY_FONT_SIZE).attr("fill", palette.textMuted).attr("pointer-events", "none").attr("font-family", FONT_FAMILY).text(gr.minText);
|
|
4226
4224
|
g.append("rect").attr("class", "dgmo-legend-gradient-ramp").attr("data-ramp-min", gr.min).attr("data-ramp-max", gr.max).attr("x", gr.rampX).attr("y", gr.rampY).attr("width", gr.rampW).attr("height", gr.rampH).attr("rx", 2).attr("fill", `url(#${gradId})`);
|
|
4227
|
-
g.append("text").attr("x", gr.maxX).attr("y", gr.textY).
|
|
4225
|
+
g.append("text").attr("x", gr.maxX).attr("y", gr.textY).call(centerText).attr("font-size", LEGEND_ENTRY_FONT_SIZE).attr("fill", palette.textMuted).attr("pointer-events", "none").attr("font-family", FONT_FAMILY).text(gr.maxText);
|
|
4228
4226
|
}
|
|
4229
4227
|
for (const entry of capsule.entries) {
|
|
4230
4228
|
const entryG = g.append("g").attr("data-legend-entry", entry.value.toLowerCase()).attr("data-series-name", entry.value).style("cursor", "pointer");
|
|
4231
4229
|
entryG.append("circle").attr("cx", entry.dotCx).attr("cy", entry.dotCy).attr("r", LEGEND_DOT_R).attr("fill", entry.color);
|
|
4232
|
-
entryG.append("text").attr("x", entry.textX).attr("y", entry.textY).
|
|
4230
|
+
entryG.append("text").attr("x", entry.textX).attr("y", entry.textY).call(centerText).attr("font-size", LEGEND_ENTRY_FONT_SIZE).attr("fill", palette.textMuted).attr("font-family", FONT_FAMILY).text(entry.displayValue ?? entry.value);
|
|
4233
4231
|
if (callbacks?.onEntryHover) {
|
|
4234
4232
|
const groupName = capsule.groupName;
|
|
4235
4233
|
const entryValue = entry.value;
|
|
@@ -4249,7 +4247,7 @@ function renderCapsule(parent, capsule, palette, groupBg, pillBorder, _isDark, c
|
|
|
4249
4247
|
function renderPill(parent, pill, palette, groupBg, callbacks) {
|
|
4250
4248
|
const g = parent.append("g").attr("transform", `translate(${pill.x},${pill.y})`).attr("data-legend-group", pill.groupName.toLowerCase()).style("cursor", "pointer");
|
|
4251
4249
|
g.append("rect").attr("width", pill.width).attr("height", pill.height).attr("rx", pill.height / 2).attr("fill", groupBg);
|
|
4252
|
-
g.append("text").attr("x", pill.width / 2).attr("y", pill.height / 2).attr("text-anchor", "middle").
|
|
4250
|
+
g.append("text").attr("x", pill.width / 2).attr("y", pill.height / 2).attr("text-anchor", "middle").call(centerText).attr("font-size", LEGEND_PILL_FONT_SIZE).attr("font-weight", 500).attr("fill", palette.textMuted).attr("pointer-events", "none").attr("font-family", FONT_FAMILY).text(pill.groupName);
|
|
4253
4251
|
if (callbacks?.onGroupToggle) {
|
|
4254
4252
|
const cb = callbacks.onGroupToggle;
|
|
4255
4253
|
const name = pill.groupName;
|
|
@@ -4272,7 +4270,7 @@ function renderControl(parent, ctrl, palette, _groupBg, pillBorder, _isDark, con
|
|
|
4272
4270
|
textX = 8 + 14 + LEGEND_ENTRY_DOT_GAP + measureLegendText(ctrl.label, LEGEND_PILL_FONT_SIZE) / 2;
|
|
4273
4271
|
}
|
|
4274
4272
|
if (ctrl.label) {
|
|
4275
|
-
g.append("text").attr("x", textX).attr("y", ctrl.height / 2).attr("text-anchor", "middle").
|
|
4273
|
+
g.append("text").attr("x", textX).attr("y", ctrl.height / 2).attr("text-anchor", "middle").call(centerText).attr("font-size", LEGEND_PILL_FONT_SIZE).attr("font-weight", 500).attr("fill", palette.textMuted).attr("pointer-events", "none").attr("font-family", FONT_FAMILY).text(ctrl.label);
|
|
4276
4274
|
}
|
|
4277
4275
|
if (ctrl.children) {
|
|
4278
4276
|
let cx = ctrl.width + 4;
|
|
@@ -4282,7 +4280,7 @@ function renderControl(parent, ctrl, palette, _groupBg, pillBorder, _isDark, con
|
|
|
4282
4280
|
"fill",
|
|
4283
4281
|
child.isActive ? palette.primary ?? palette.text : "none"
|
|
4284
4282
|
).attr("stroke", pillBorder).attr("stroke-width", 0.75);
|
|
4285
|
-
childG.append("text").attr("x", child.width / 2).attr("y", ctrl.height / 2).attr("text-anchor", "middle").
|
|
4283
|
+
childG.append("text").attr("x", child.width / 2).attr("y", ctrl.height / 2).attr("text-anchor", "middle").call(centerText).attr("font-size", LEGEND_ENTRY_FONT_SIZE).attr("fill", child.isActive ? palette.bg : palette.textMuted).attr("font-family", FONT_FAMILY).text(child.label);
|
|
4286
4284
|
const configCtrl2 = configControls?.find((c) => c.id === ctrl.id);
|
|
4287
4285
|
const configChild = configCtrl2?.children?.find((c) => c.id === child.id);
|
|
4288
4286
|
if (configChild?.onClick) {
|
|
@@ -4336,7 +4334,7 @@ function renderControlsGroup(parent, layout, palette, groupBg, pillBorder, callb
|
|
|
4336
4334
|
} else {
|
|
4337
4335
|
entryG.append("circle").attr("cx", tl.dotCx).attr("cy", tl.dotCy).attr("r", LEGEND_TOGGLE_DOT_R).attr("fill", "none").attr("stroke", palette.textMuted).attr("stroke-width", 1);
|
|
4338
4336
|
}
|
|
4339
|
-
entryG.append("text").attr("x", tl.textX).attr("y", tl.textY).
|
|
4337
|
+
entryG.append("text").attr("x", tl.textX).attr("y", tl.textY).call(centerText).attr("font-size", LEGEND_ENTRY_FONT_SIZE).attr("fill", palette.textMuted).attr("opacity", tl.active ? 1 : LEGEND_TOGGLE_OFF_OPACITY).attr("font-family", FONT_FAMILY).text(tl.label);
|
|
4340
4338
|
if (callbacks?.onControlsToggle && toggle) {
|
|
4341
4339
|
const cb = callbacks.onControlsToggle;
|
|
4342
4340
|
const id = tl.id;
|
|
@@ -4349,6 +4347,7 @@ function renderControlsGroup(parent, layout, palette, groupBg, pillBorder, callb
|
|
|
4349
4347
|
}
|
|
4350
4348
|
}
|
|
4351
4349
|
}
|
|
4350
|
+
var LEGEND_TEXT_DY;
|
|
4352
4351
|
var init_legend_d3 = __esm({
|
|
4353
4352
|
"src/utils/legend-d3.ts"() {
|
|
4354
4353
|
"use strict";
|
|
@@ -4356,6 +4355,7 @@ var init_legend_d3 = __esm({
|
|
|
4356
4355
|
init_legend_layout();
|
|
4357
4356
|
init_color_utils();
|
|
4358
4357
|
init_fonts();
|
|
4358
|
+
LEGEND_TEXT_DY = "0.32em";
|
|
4359
4359
|
}
|
|
4360
4360
|
});
|
|
4361
4361
|
|
|
@@ -4606,7 +4606,6 @@ var init_arrows = __esm({
|
|
|
4606
4606
|
var parser_exports = {};
|
|
4607
4607
|
__export(parser_exports, {
|
|
4608
4608
|
isSequenceBlock: () => isSequenceBlock,
|
|
4609
|
-
isSequenceMessage: () => isSequenceMessage,
|
|
4610
4609
|
isSequenceNote: () => isSequenceNote,
|
|
4611
4610
|
isSequenceSection: () => isSequenceSection,
|
|
4612
4611
|
looksLikeSequence: () => looksLikeSequence,
|
|
@@ -4622,9 +4621,6 @@ function isHardRemovedToken(remainder) {
|
|
|
4622
4621
|
}
|
|
4623
4622
|
return { removed: false };
|
|
4624
4623
|
}
|
|
4625
|
-
function isSequenceMessage(el) {
|
|
4626
|
-
return el.kind === "message";
|
|
4627
|
-
}
|
|
4628
4624
|
function isSequenceBlock(el) {
|
|
4629
4625
|
return el.kind === "block";
|
|
4630
4626
|
}
|
|
@@ -59303,7 +59299,7 @@ pre.dgmo, code.language-dgmo, pre > code.language-dgmo,
|
|
|
59303
59299
|
|
|
59304
59300
|
// src/auto/index.ts
|
|
59305
59301
|
init_safe_href();
|
|
59306
|
-
var VERSION = "0.
|
|
59302
|
+
var VERSION = "0.25.0";
|
|
59307
59303
|
var DEFAULTS = {
|
|
59308
59304
|
theme: "auto",
|
|
59309
59305
|
palette: "nord",
|