@leavepulse/ui 0.22.4 → 0.22.5
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/dist/chunks/{LpInfraNode-C_4cyGl9.js → LpInfraNode-qIL3l7IO.js} +25 -15
- package/dist/chunks/{LpTopologyCanvas-74i_pq4e.js → LpTopologyCanvas-BsJWyacK.js} +1 -1
- package/dist/components/LpInfraNode.vue.d.ts +7 -0
- package/dist/components/LpInfraNode.vue.js +1 -1
- package/dist/components/LpTopologyCanvas.vue.js +1 -1
- package/dist/index.js +2 -2
- package/package.json +1 -1
- package/src/components/LpInfraNode.vue +43 -14
- package/src/tokens/tokens.css +11 -0
|
@@ -21,29 +21,39 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
21
21
|
__name: "LpInfraNode",
|
|
22
22
|
props: {
|
|
23
23
|
data: {},
|
|
24
|
-
selected: { type: Boolean }
|
|
24
|
+
selected: { type: Boolean },
|
|
25
|
+
roles: {}
|
|
25
26
|
},
|
|
26
27
|
setup(__props) {
|
|
27
28
|
const props = __props;
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
const DEFAULT_ROLES = {
|
|
30
|
+
compute: { color: "var(--color-node-compute)", icon: "▣" },
|
|
31
|
+
host: { color: "var(--color-node-compute)", icon: "▣" },
|
|
32
|
+
worker: { color: "var(--color-node-compute)", icon: "◱" },
|
|
33
|
+
hypervisor: { color: "var(--color-node-compute)", icon: "▦" },
|
|
34
|
+
game: { color: "var(--color-node-compute)", icon: "◈" },
|
|
35
|
+
storage: { color: "var(--color-node-transit)", icon: "▤" },
|
|
36
|
+
database: { color: "var(--color-node-transit)", icon: "▤" },
|
|
37
|
+
router: { color: "var(--color-node-transit)", icon: "⇄" },
|
|
38
|
+
proxy: { color: "var(--color-node-transit)", icon: "⇅" },
|
|
39
|
+
edge: { color: "var(--color-node-edge)", icon: "☁" },
|
|
40
|
+
public: { color: "var(--color-node-edge)", icon: "◉" }
|
|
33
41
|
};
|
|
34
|
-
const
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
+
const UNKNOWN_ROLE = { color: "var(--color-node-unknown)", icon: "●" };
|
|
43
|
+
const role = computed(
|
|
44
|
+
() => ({ ...DEFAULT_ROLES, ...props.roles ?? {} })[props.data.role] ?? UNKNOWN_ROLE
|
|
45
|
+
);
|
|
46
|
+
const accent = computed(() => role.value.color);
|
|
47
|
+
const icon = computed(() => role.value.icon);
|
|
48
|
+
const accentLine = computed(
|
|
49
|
+
() => `color-mix(in srgb, ${accent.value} 35%, var(--color-line))`
|
|
50
|
+
);
|
|
42
51
|
return (_ctx, _cache) => {
|
|
43
52
|
return openBlock(), createElementBlock("div", {
|
|
44
|
-
class: normalizeClass(["w-[168px] overflow-hidden rounded-card border bg-surface-raised shadow-panel transition-[border-color,box-shadow]", __props.selected ? "border-[var(--accent)]" : "border-line"]),
|
|
53
|
+
class: normalizeClass(["w-[168px] overflow-hidden rounded-card border bg-surface-raised shadow-panel transition-[border-color,box-shadow]", __props.selected ? "border-[var(--accent)]" : "border-[var(--accent-line)]"]),
|
|
45
54
|
style: normalizeStyle({
|
|
46
55
|
"--accent": accent.value,
|
|
56
|
+
"--accent-line": accentLine.value,
|
|
47
57
|
opacity: __props.data.dimmed ? 0.3 : __props.data.online === false ? 0.5 : 1,
|
|
48
58
|
...__props.selected ? { boxShadow: "0 0 0 2px color-mix(in srgb, var(--accent) 40%, transparent), var(--shadow-panel)" } : {}
|
|
49
59
|
})
|
|
@@ -3,7 +3,7 @@ import { Background } from "@vue-flow/background";
|
|
|
3
3
|
import { Controls } from "@vue-flow/controls";
|
|
4
4
|
import { MarkerType, useVueFlow, VueFlow, SelectionMode, Panel } from "@vue-flow/core";
|
|
5
5
|
import { MiniMap } from "@vue-flow/minimap";
|
|
6
|
-
import { _ as _sfc_main$3 } from "./LpInfraNode-
|
|
6
|
+
import { _ as _sfc_main$3 } from "./LpInfraNode-qIL3l7IO.js";
|
|
7
7
|
import { _ as _sfc_main$1 } from "./LpLaneNode-HtnQf2FF.js";
|
|
8
8
|
import { _ as _sfc_main$2 } from "./LpServiceNode-Dc-Ut5RS.js";
|
|
9
9
|
const _hoisted_1 = { class: "flex flex-col gap-1.5 rounded-card border border-line bg-surface-overlay/90 px-3 py-2 text-[11px] backdrop-blur" };
|
|
@@ -22,7 +22,14 @@ export interface InfraNodeData {
|
|
|
22
22
|
type __VLS_Props = {
|
|
23
23
|
data: InfraNodeData;
|
|
24
24
|
selected?: boolean;
|
|
25
|
+
/** Extra/overriding role styles, merged over the defaults below. */
|
|
26
|
+
roles?: Record<string, InfraRoleStyle>;
|
|
25
27
|
};
|
|
28
|
+
export interface InfraRoleStyle {
|
|
29
|
+
/** CSS colour — normally a var() reference, e.g. var(--color-node-edge). */
|
|
30
|
+
color: string;
|
|
31
|
+
icon: string;
|
|
32
|
+
}
|
|
26
33
|
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
27
34
|
declare const _default: typeof __VLS_export;
|
|
28
35
|
export default _default;
|
package/dist/index.js
CHANGED
|
@@ -26,7 +26,7 @@ import { _ as _23 } from "./chunks/LpFileTree-DWx77B1F.js";
|
|
|
26
26
|
import { ancestorIds, checkStateOf, checkedCount, computeStats, fileIcon, formatModified, formatSize, sortNodes, subtreeIds, subtreeSize } from "./components/fileTree.js";
|
|
27
27
|
import { _ as _24 } from "./chunks/LpFormField-Bn-ZwC6z.js";
|
|
28
28
|
import { _ as _25 } from "./chunks/LpIcon-CCnX5_2j.js";
|
|
29
|
-
import { _ as _26 } from "./chunks/LpInfraNode-
|
|
29
|
+
import { _ as _26 } from "./chunks/LpInfraNode-qIL3l7IO.js";
|
|
30
30
|
import { _ as _27 } from "./chunks/LpInput-BauZRyzm.js";
|
|
31
31
|
import { _ as _28 } from "./chunks/LpLightbox-Ci35Y_xP.js";
|
|
32
32
|
import { fileNameOf } from "./components/lightbox.js";
|
|
@@ -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-
|
|
67
|
+
import { _ as _60 } from "./chunks/LpTopologyCanvas-BsJWyacK.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
|
@@ -33,30 +33,59 @@ export interface InfraNodeData {
|
|
|
33
33
|
dimmed?: boolean
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
const props = defineProps<{
|
|
36
|
+
const props = defineProps<{
|
|
37
|
+
data: InfraNodeData
|
|
38
|
+
selected?: boolean
|
|
39
|
+
/** Extra/overriding role styles, merged over the defaults below. */
|
|
40
|
+
roles?: Record<string, InfraRoleStyle>
|
|
41
|
+
}>()
|
|
37
42
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
+
/*
|
|
44
|
+
* Role → look. Colours are token references, never literals, so a theme (or a
|
|
45
|
+
* consumer) restyles the graph without forking this component; the glyph keeps
|
|
46
|
+
* the encoding readable without colour. `roles` overrides or extends the table
|
|
47
|
+
* for a fleet whose vocabulary differs — anything unmapped stays neutral rather
|
|
48
|
+
* than silently borrowing another role's meaning.
|
|
49
|
+
*/
|
|
50
|
+
export interface InfraRoleStyle {
|
|
51
|
+
/** CSS colour — normally a var() reference, e.g. var(--color-node-edge). */
|
|
52
|
+
color: string
|
|
53
|
+
icon: string
|
|
43
54
|
}
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
55
|
+
const DEFAULT_ROLES: Record<string, InfraRoleStyle> = {
|
|
56
|
+
compute: { color: "var(--color-node-compute)", icon: "▣" },
|
|
57
|
+
host: { color: "var(--color-node-compute)", icon: "▣" },
|
|
58
|
+
worker: { color: "var(--color-node-compute)", icon: "◱" },
|
|
59
|
+
hypervisor: { color: "var(--color-node-compute)", icon: "▦" },
|
|
60
|
+
game: { color: "var(--color-node-compute)", icon: "◈" },
|
|
61
|
+
storage: { color: "var(--color-node-transit)", icon: "▤" },
|
|
62
|
+
database: { color: "var(--color-node-transit)", icon: "▤" },
|
|
63
|
+
router: { color: "var(--color-node-transit)", icon: "⇄" },
|
|
64
|
+
proxy: { color: "var(--color-node-transit)", icon: "⇅" },
|
|
65
|
+
edge: { color: "var(--color-node-edge)", icon: "☁" },
|
|
66
|
+
public: { color: "var(--color-node-edge)", icon: "◉" },
|
|
50
67
|
}
|
|
51
|
-
const
|
|
68
|
+
const UNKNOWN_ROLE: InfraRoleStyle = { color: "var(--color-node-unknown)", icon: "●" }
|
|
69
|
+
|
|
70
|
+
const role = computed<InfraRoleStyle>(
|
|
71
|
+
() => ({ ...DEFAULT_ROLES, ...(props.roles ?? {}) })[props.data.role] ?? UNKNOWN_ROLE,
|
|
72
|
+
)
|
|
73
|
+
const accent = computed(() => role.value.color)
|
|
74
|
+
const icon = computed(() => role.value.icon)
|
|
75
|
+
// A tinted edge rather than a grey one: with only the top stripe carrying the
|
|
76
|
+
// role, a canvas of cards read as one undifferentiated grid.
|
|
77
|
+
const accentLine = computed(
|
|
78
|
+
() => `color-mix(in srgb, ${accent.value} 35%, var(--color-line))`,
|
|
79
|
+
)
|
|
52
80
|
</script>
|
|
53
81
|
|
|
54
82
|
<template>
|
|
55
83
|
<div
|
|
56
84
|
class="w-[168px] overflow-hidden rounded-card border bg-surface-raised shadow-panel transition-[border-color,box-shadow]"
|
|
57
|
-
:class="selected ? 'border-[var(--accent)]' : 'border-line'"
|
|
85
|
+
:class="selected ? 'border-[var(--accent)]' : 'border-[var(--accent-line)]'"
|
|
58
86
|
:style="{
|
|
59
87
|
'--accent': accent,
|
|
88
|
+
'--accent-line': accentLine,
|
|
60
89
|
opacity: data.dimmed ? 0.3 : data.online === false ? 0.5 : 1,
|
|
61
90
|
...(selected
|
|
62
91
|
? { boxShadow: '0 0 0 2px color-mix(in srgb, var(--accent) 40%, transparent), var(--shadow-panel)' }
|
package/src/tokens/tokens.css
CHANGED
|
@@ -46,6 +46,17 @@
|
|
|
46
46
|
--color-line-strong: rgba(255, 255, 255, 0.18);
|
|
47
47
|
--color-ring: rgba(0, 188, 255, 0.45);
|
|
48
48
|
|
|
49
|
+
/* ── color: infra roles ──────────────────────────
|
|
50
|
+
What a machine on a topology DOES, in three families: it runs work, it
|
|
51
|
+
carries traffic, or it is the way in from outside. Derived from the palette
|
|
52
|
+
above so a theme gets them for free, and named so a consumer whose fleet
|
|
53
|
+
doesn't split this way can repoint them without forking the component.
|
|
54
|
+
Anything unmapped falls back to --color-node-unknown. */
|
|
55
|
+
--color-node-compute: var(--color-action);
|
|
56
|
+
--color-node-transit: var(--color-accent);
|
|
57
|
+
--color-node-edge: var(--color-brand);
|
|
58
|
+
--color-node-unknown: var(--color-line-strong);
|
|
59
|
+
|
|
49
60
|
/* ── shape ───────────────────────────────────── */
|
|
50
61
|
--radius-control: 8px;
|
|
51
62
|
--radius-card: 14px;
|