@leavepulse/ui 0.22.7 → 0.22.8

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.
@@ -23,6 +23,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
23
23
  selectable: { type: Boolean, default: false },
24
24
  legend: { type: Boolean, default: true },
25
25
  legendPosition: { default: "bottom-left" },
26
+ legendLabels: {},
26
27
  lanes: { default: () => [] },
27
28
  minimap: { type: Boolean, default: true },
28
29
  controls: { type: Boolean, default: true }
@@ -158,12 +159,17 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
158
159
  if (props.legendPosition === "bottom-right") return "!bottom-40";
159
160
  return "";
160
161
  });
161
- const legendItems = [
162
- { label: "Network", color: CATEGORY_COLOR.network, width: 2, dash: "0" },
163
- { label: "Depends-on", color: CATEGORY_COLOR.structural, width: 1.5, dash: "1 5" },
164
- { label: "Pending", color: "var(--color-brand)", width: 2, dash: "6 5" },
165
- { label: "Drift", color: "var(--color-danger)", width: 2, dash: "6 5" }
166
- ];
162
+ const legendItems = computed(() => [
163
+ { label: props.legendLabels?.network ?? "Network", color: CATEGORY_COLOR.network, width: 2, dash: "0" },
164
+ {
165
+ label: props.legendLabels?.structural ?? "Depends-on",
166
+ color: CATEGORY_COLOR.structural,
167
+ width: 1.5,
168
+ dash: "1 5"
169
+ },
170
+ { label: props.legendLabels?.pending ?? "Pending", color: "var(--color-brand)", width: 2, dash: "6 5" },
171
+ { label: props.legendLabels?.drift ?? "Drift", color: "var(--color-danger)", width: 2, dash: "6 5" }
172
+ ]);
167
173
  onEdgeContextMenu(({ edge, event }) => {
168
174
  const e = event;
169
175
  e.preventDefault?.();
@@ -213,8 +219,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
213
219
  }, {
214
220
  default: withCtx(() => [
215
221
  createElementVNode("div", _hoisted_1, [
216
- (openBlock(), createElementBlock(Fragment, null, renderList(legendItems, (l) => {
217
- return createElementVNode("div", {
222
+ (openBlock(true), createElementBlock(Fragment, null, renderList(legendItems.value, (l) => {
223
+ return openBlock(), createElementBlock("div", {
218
224
  key: l.label,
219
225
  class: "flex items-center gap-2 text-muted"
220
226
  }, [
@@ -232,7 +238,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
232
238
  ])),
233
239
  createTextVNode(" " + toDisplayString(l.label), 1)
234
240
  ]);
235
- }), 64))
241
+ }), 128))
236
242
  ])
237
243
  ]),
238
244
  _: 1
@@ -90,6 +90,8 @@ type __VLS_Props = {
90
90
  * minimap owns the bottom-right.
91
91
  */
92
92
  legendPosition?: "top-left" | "top-right" | "bottom-left" | "bottom-right";
93
+ /** Rename legend rows to match what this graph's edges actually mean. */
94
+ legendLabels?: Partial<Record<"network" | "structural" | "pending" | "drift", string>>;
93
95
  /**
94
96
  * Background swimlanes drawn beneath the nodes (one per project / overlay).
95
97
  * Non-interactive; pan/zoom with the graph. Empty = no lanes.
@@ -1,4 +1,4 @@
1
- import { _ as _sfc_main } from "../chunks/LpTopologyCanvas-DNmL56pJ.js";
1
+ import { _ as _sfc_main } from "../chunks/LpTopologyCanvas-B4tPWXFW.js";
2
2
  export {
3
3
  _sfc_main as default
4
4
  };
package/dist/index.js CHANGED
@@ -64,7 +64,7 @@ import { D, _ as _56, N, T, b, c, d, e, f, g, i, l, h, j, n, r, t, k, m, u, v }
64
64
  import { _ as _57 } from "./chunks/LpTilt-DuyKbpkA.js";
65
65
  import { _ as _58 } from "./chunks/LpToaster-gDB1EaU3.js";
66
66
  import { _ as _59 } from "./chunks/LpTooltip-D1hbjQWG.js";
67
- import { _ as _60 } from "./chunks/LpTopologyCanvas-DNmL56pJ.js";
67
+ import { _ as _60 } from "./chunks/LpTopologyCanvas-B4tPWXFW.js";
68
68
  import { _ as _61 } from "./chunks/LpUptimeBar-CB366k0O.js";
69
69
  import { deserializeLayout, serializeLayout } from "./layout/tree.js";
70
70
  import { addLeaf, addTab, countBlocks, countLeaves, makeLayout, moveLeaf, removeBlock, removeLeaf, reorderTab, resizeAt, setActiveTab } from "./layout/tree.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leavepulse/ui",
3
- "version": "0.22.7",
3
+ "version": "0.22.8",
4
4
  "type": "module",
5
5
  "description": "LeavePulse token-driven Vue component kit.",
6
6
  "repository": {
@@ -125,6 +125,10 @@ const props = withDefaults(
125
125
  * minimap owns the bottom-right.
126
126
  */
127
127
  legendPosition?: "top-left" | "top-right" | "bottom-left" | "bottom-right"
128
+ /** Rename legend rows to match what this graph's edges actually mean. */
129
+ legendLabels?: Partial<
130
+ Record<"network" | "structural" | "pending" | "drift", string>
131
+ >
128
132
  /**
129
133
  * Background swimlanes drawn beneath the nodes (one per project / overlay).
130
134
  * Non-interactive; pan/zoom with the graph. Empty = no lanes.
@@ -327,12 +331,20 @@ const legendOffset = computed(() => {
327
331
  })
328
332
 
329
333
  // Legend rows mirror the edge encoding exactly (same colours/dashes).
330
- const legendItems = [
331
- { label: "Network", color: CATEGORY_COLOR.network, width: 2, dash: "0" },
332
- { label: "Depends-on", color: CATEGORY_COLOR.structural, width: 1.5, dash: "1 5" },
333
- { label: "Pending", color: "var(--color-brand)", width: 2, dash: "6 5" },
334
- { label: "Drift", color: "var(--color-danger)", width: 2, dash: "6 5" },
335
- ] as const
334
+ // What each encoding MEANS depends on what the host is drawing: the same solid
335
+ // line is a transport on a machine graph and a call on a service graph, so
336
+ // "Network" would be wrong half the time. `legendLabels` renames any row.
337
+ const legendItems = computed(() => [
338
+ { label: props.legendLabels?.network ?? "Network", color: CATEGORY_COLOR.network, width: 2, dash: "0" },
339
+ {
340
+ label: props.legendLabels?.structural ?? "Depends-on",
341
+ color: CATEGORY_COLOR.structural,
342
+ width: 1.5,
343
+ dash: "1 5",
344
+ },
345
+ { label: props.legendLabels?.pending ?? "Pending", color: "var(--color-brand)", width: 2, dash: "6 5" },
346
+ { label: props.legendLabels?.drift ?? "Drift", color: "var(--color-danger)", width: 2, dash: "6 5" },
347
+ ])
336
348
 
337
349
  onEdgeContextMenu(({ edge, event }) => {
338
350
  // Right-click an edge → host renders edge actions (change transport, remove…).