@pipelex/mthds-ui 0.59.0 → 0.60.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/dist/{chunk-S4UMMHLE.js → chunk-43NAVRQK.js} +17 -2
- package/dist/chunk-43NAVRQK.js.map +1 -0
- package/dist/{chunk-6KWNAU4F.js → chunk-BQZ3BPJM.js} +13 -1
- package/dist/chunk-BQZ3BPJM.js.map +1 -0
- package/dist/{chunk-XMTXWXFO.js → chunk-KKT6OVO6.js} +3 -3
- package/dist/{chunk-5N3MP5TD.js → chunk-PWKNMKFA.js} +106 -35
- package/dist/chunk-PWKNMKFA.js.map +1 -0
- package/dist/{chunk-ZRSFFUHA.js → chunk-S36KN6CG.js} +3 -3
- package/dist/chunk-UVEGKTBU.js +600 -0
- package/dist/chunk-UVEGKTBU.js.map +1 -0
- package/dist/{chunk-7QUQJW6Q.js → chunk-YQJNKQWO.js} +91 -285
- package/dist/chunk-YQJNKQWO.js.map +1 -0
- package/dist/form/react/index.d.ts +1 -1
- package/dist/form/react/index.js +2 -2
- package/dist/graph/index.d.ts +48 -21
- package/dist/graph/index.js +61 -21
- package/dist/graph/react/detail/DetailPanel.css +49 -0
- package/dist/graph/react/graph-core.css +20 -0
- package/dist/graph/react/index.d.ts +2 -2
- package/dist/graph/react/index.js +92 -29
- package/dist/graph/react/index.js.map +1 -1
- package/dist/graph/react/styles/simple/SimpleDetailPanel.css +20 -0
- package/dist/graph/react/styles/simple/SimpleStyle.css +13 -0
- package/dist/index.d.ts +3 -2
- package/dist/index.js +61 -21
- package/dist/methodWords-DIEg1PVT.d.ts +180 -0
- package/dist/{registryJoin-CMfBspIs.d.ts → registryJoin-Cj1mIkqe.d.ts} +18 -10
- package/dist/standalone/graph-standalone.html +232 -130
- package/dist/standalone/graph-viewer.css +102 -0
- package/dist/standalone/graph-viewer.js +130 -130
- package/dist/static-graph/index.d.ts +1 -1
- package/dist/static-graph/index.js +57 -14
- package/dist/static-graph/index.js.map +1 -1
- package/dist/timeline/index.d.ts +42 -7
- package/dist/timeline/index.js +8 -3
- package/dist/timeline/react/RunTimeline.css +18 -0
- package/dist/timeline/react/index.d.ts +3 -2
- package/dist/timeline/react/index.js +20 -11
- package/dist/timeline/react/index.js.map +1 -1
- package/dist/timeline/react/styles/simple/SimpleProgress.css +25 -0
- package/dist/{types-CnDJyLYo.d.ts → types-BygAt1Si.d.ts} +51 -1
- package/package.json +2 -2
- package/dist/chunk-5N3MP5TD.js.map +0 -1
- package/dist/chunk-6KWNAU4F.js.map +0 -1
- package/dist/chunk-7QUQJW6Q.js.map +0 -1
- package/dist/chunk-P6IGZVWE.js +0 -155
- package/dist/chunk-P6IGZVWE.js.map +0 -1
- package/dist/chunk-S4UMMHLE.js.map +0 -1
- /package/dist/{chunk-XMTXWXFO.js.map → chunk-KKT6OVO6.js.map} +0 -0
- /package/dist/{chunk-ZRSFFUHA.js.map → chunk-S36KN6CG.js.map} +0 -0
package/dist/chunk-P6IGZVWE.js
DELETED
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
// src/graph/styles/humanize.ts
|
|
2
|
-
var VOWELED_ACRONYMS = /* @__PURE__ */ new Set([
|
|
3
|
-
"ai",
|
|
4
|
-
"api",
|
|
5
|
-
"faq",
|
|
6
|
-
"iban",
|
|
7
|
-
"id",
|
|
8
|
-
"io",
|
|
9
|
-
"ip",
|
|
10
|
-
"json",
|
|
11
|
-
"kpi",
|
|
12
|
-
"ocr",
|
|
13
|
-
"roi",
|
|
14
|
-
"seo",
|
|
15
|
-
"ui",
|
|
16
|
-
"uri",
|
|
17
|
-
"url",
|
|
18
|
-
"uuid",
|
|
19
|
-
"ux"
|
|
20
|
-
]);
|
|
21
|
-
var VOWELS = /[aeiouy]/;
|
|
22
|
-
var VOWELLESS_WORDS = /* @__PURE__ */ new Set([
|
|
23
|
-
"cfg",
|
|
24
|
-
"cm",
|
|
25
|
-
"cnt",
|
|
26
|
-
"ctx",
|
|
27
|
-
"dr",
|
|
28
|
-
"dst",
|
|
29
|
-
"fn",
|
|
30
|
-
"ft",
|
|
31
|
-
"hmm",
|
|
32
|
-
"hr",
|
|
33
|
-
"kg",
|
|
34
|
-
"km",
|
|
35
|
-
"lb",
|
|
36
|
-
"mg",
|
|
37
|
-
"ml",
|
|
38
|
-
"mm",
|
|
39
|
-
"mr",
|
|
40
|
-
"mrs",
|
|
41
|
-
"ms",
|
|
42
|
-
"msg",
|
|
43
|
-
"nd",
|
|
44
|
-
"nth",
|
|
45
|
-
"pkg",
|
|
46
|
-
"pt",
|
|
47
|
-
"rd",
|
|
48
|
-
"src",
|
|
49
|
-
"st",
|
|
50
|
-
"th",
|
|
51
|
-
"tmp",
|
|
52
|
-
"vs"
|
|
53
|
-
]);
|
|
54
|
-
var SINGULAR_S_ACRONYMS = /* @__PURE__ */ new Set([
|
|
55
|
-
"cms",
|
|
56
|
-
"css",
|
|
57
|
-
"dns",
|
|
58
|
-
"gps",
|
|
59
|
-
"rss",
|
|
60
|
-
"sms"
|
|
61
|
-
]);
|
|
62
|
-
var NATIVE_PLAIN_NAMES = {
|
|
63
|
-
Html: "HTML",
|
|
64
|
-
JSON: "JSON",
|
|
65
|
-
TextAndImages: "Text and images",
|
|
66
|
-
YesNo: "Yes or no",
|
|
67
|
-
SearchResult: "Search result",
|
|
68
|
-
Composite: "Combined results",
|
|
69
|
-
Dynamic: "Data"
|
|
70
|
-
};
|
|
71
|
-
var GENERIC_NATIVES = /* @__PURE__ */ new Set(["Anything", "Dynamic", "Composite"]);
|
|
72
|
-
function isAcronymWord(lower) {
|
|
73
|
-
if (lower.length < 2 || !/^[a-z]+$/.test(lower)) return false;
|
|
74
|
-
if (VOWELLESS_WORDS.has(lower)) return false;
|
|
75
|
-
if (lower.endsWith("s") && VOWELLESS_WORDS.has(lower.slice(0, -1))) return false;
|
|
76
|
-
return !VOWELS.test(lower) || VOWELED_ACRONYMS.has(lower);
|
|
77
|
-
}
|
|
78
|
-
function spellWord(lower, wasAllCaps) {
|
|
79
|
-
if (/^\d+$/.test(lower)) return lower;
|
|
80
|
-
if (wasAllCaps && lower.length >= 2) return lower.toUpperCase();
|
|
81
|
-
if (lower.endsWith("s") && !SINGULAR_S_ACRONYMS.has(lower) && isAcronymWord(lower.slice(0, -1))) {
|
|
82
|
-
return lower.slice(0, -1).toUpperCase() + "s";
|
|
83
|
-
}
|
|
84
|
-
if (isAcronymWord(lower)) return lower.toUpperCase();
|
|
85
|
-
return lower;
|
|
86
|
-
}
|
|
87
|
-
function splitIdentifier(identifier) {
|
|
88
|
-
const parts = identifier.replace(/([a-z\d])([A-Z])/g, "$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2").replace(/([A-Za-z])(\d)/g, "$1 $2").split(/[\s_\-.]+/).filter((p) => p.length > 0);
|
|
89
|
-
return parts.map((p) => ({
|
|
90
|
-
word: p.toLowerCase(),
|
|
91
|
-
wasAllCaps: p.length >= 2 && p === p.toUpperCase() && /[A-Z]/.test(p)
|
|
92
|
-
}));
|
|
93
|
-
}
|
|
94
|
-
function capitalizeFirst(text) {
|
|
95
|
-
return text.length === 0 ? text : text.charAt(0).toUpperCase() + text.slice(1);
|
|
96
|
-
}
|
|
97
|
-
function stripDomain(ref) {
|
|
98
|
-
const dot = ref.lastIndexOf(".");
|
|
99
|
-
return dot === -1 ? ref : ref.slice(dot + 1);
|
|
100
|
-
}
|
|
101
|
-
function humanizeIdentifier(identifier) {
|
|
102
|
-
const words = splitIdentifier(stripDomain(identifier.trim()));
|
|
103
|
-
if (words.length === 0) return "";
|
|
104
|
-
return capitalizeFirst(words.map((w) => spellWord(w.word, w.wasAllCaps)).join(" "));
|
|
105
|
-
}
|
|
106
|
-
function conceptPlainName(conceptRef) {
|
|
107
|
-
var _a;
|
|
108
|
-
const code = stripDomain(conceptRef.trim());
|
|
109
|
-
return (_a = NATIVE_PLAIN_NAMES[code]) != null ? _a : humanizeIdentifier(code);
|
|
110
|
-
}
|
|
111
|
-
function isGenericConcept(conceptRef) {
|
|
112
|
-
return GENERIC_NATIVES.has(stripDomain(conceptRef.trim()));
|
|
113
|
-
}
|
|
114
|
-
function sentenceCase(text) {
|
|
115
|
-
const collapsed = text.replace(/\s+/g, " ").trim();
|
|
116
|
-
const trimmed = collapsed.endsWith(".") && !collapsed.endsWith("..") ? collapsed.slice(0, -1) : collapsed;
|
|
117
|
-
return capitalizeFirst(trimmed);
|
|
118
|
-
}
|
|
119
|
-
function pipeTitle(description, pipeCode) {
|
|
120
|
-
const described = sentenceCase(description != null ? description : "");
|
|
121
|
-
if (described) return { title: described, fromDescription: true };
|
|
122
|
-
return { title: humanizeIdentifier(pipeCode), fromDescription: false };
|
|
123
|
-
}
|
|
124
|
-
function humanizeInSentence(identifier) {
|
|
125
|
-
var _a;
|
|
126
|
-
const words = humanizeIdentifier(identifier);
|
|
127
|
-
const first = (_a = words.split(" ")[0]) != null ? _a : "";
|
|
128
|
-
return first.length >= 2 && first === first.toUpperCase() ? words : words.charAt(0).toLowerCase() + words.slice(1);
|
|
129
|
-
}
|
|
130
|
-
var OUTCOME_WORDS = {
|
|
131
|
-
true: "Yes",
|
|
132
|
-
false: "No",
|
|
133
|
-
default: "Otherwise"
|
|
134
|
-
};
|
|
135
|
-
function outcomeLabel(outcome) {
|
|
136
|
-
const outcomes = outcome.split("|").map((o) => o.trim()).filter((o) => o.length > 0);
|
|
137
|
-
const labels = outcomes.map((o, index) => {
|
|
138
|
-
var _a;
|
|
139
|
-
const label = (_a = OUTCOME_WORDS[o.toLowerCase()]) != null ? _a : humanizeIdentifier(o);
|
|
140
|
-
return index === 0 ? label : label.charAt(0).toLowerCase() + label.slice(1);
|
|
141
|
-
});
|
|
142
|
-
return labels.join(" or ");
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
export {
|
|
146
|
-
stripDomain,
|
|
147
|
-
humanizeIdentifier,
|
|
148
|
-
conceptPlainName,
|
|
149
|
-
isGenericConcept,
|
|
150
|
-
sentenceCase,
|
|
151
|
-
pipeTitle,
|
|
152
|
-
humanizeInSentence,
|
|
153
|
-
outcomeLabel
|
|
154
|
-
};
|
|
155
|
-
//# sourceMappingURL=chunk-P6IGZVWE.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/graph/styles/humanize.ts"],"sourcesContent":["// Plain words from identifiers: the simple style's fallback when a method\n// declares nothing better. Pure, deterministic and tested — never a stand-in\n// for an authored description, and never a guess at meaning: an identifier is\n// split, cased and spelled, nothing more.\n\n/**\n * Words spelled as acronyms although they hold a vowel. A word with no vowel at\n * all (`cv`, `pdf`, `rfp`, `html`) is spelled as an acronym without being\n * listed, unless it is one of the `VOWELLESS_WORDS`.\n */\nconst VOWELED_ACRONYMS: ReadonlySet<string> = new Set([\n \"ai\",\n \"api\",\n \"faq\",\n \"iban\",\n \"id\",\n \"io\",\n \"ip\",\n \"json\",\n \"kpi\",\n \"ocr\",\n \"roi\",\n \"seo\",\n \"ui\",\n \"uri\",\n \"url\",\n \"uuid\",\n \"ux\",\n]);\n\nconst VOWELS = /[aeiouy]/;\n\n/**\n * Words with no vowel that are written in lowercase rather than spelled out:\n * abbreviations, units and ordinal suffixes found in identifiers (`weight_kg`\n * is \"Weight kg\", `nth_item` is \"Nth item\"). A plural is covered by its\n * singular (`hrs` by `hr`).\n */\nconst VOWELLESS_WORDS: ReadonlySet<string> = new Set([\n \"cfg\",\n \"cm\",\n \"cnt\",\n \"ctx\",\n \"dr\",\n \"dst\",\n \"fn\",\n \"ft\",\n \"hmm\",\n \"hr\",\n \"kg\",\n \"km\",\n \"lb\",\n \"mg\",\n \"ml\",\n \"mm\",\n \"mr\",\n \"mrs\",\n \"ms\",\n \"msg\",\n \"nd\",\n \"nth\",\n \"pkg\",\n \"pt\",\n \"rd\",\n \"src\",\n \"st\",\n \"th\",\n \"tmp\",\n \"vs\",\n]);\n\n/** Vowelless acronyms that end in `s` without being plurals (`css` is not two `cs`). */\nconst SINGULAR_S_ACRONYMS: ReadonlySet<string> = new Set([\n \"cms\",\n \"css\",\n \"dns\",\n \"gps\",\n \"rss\",\n \"sms\",\n]);\n\n/**\n * The plain names of the natives whose code does not read as words once split\n * (`YesNo` is not \"Yes no\"). Every other native reads well humanized.\n */\nconst NATIVE_PLAIN_NAMES: Readonly<Record<string, string>> = {\n Html: \"HTML\",\n JSON: \"JSON\",\n TextAndImages: \"Text and images\",\n YesNo: \"Yes or no\",\n SearchResult: \"Search result\",\n Composite: \"Combined results\",\n Dynamic: \"Data\",\n};\n\n/**\n * Natives that say what kind of value something is without saying what it is:\n * a final output of one of these is named by its variable, not its concept.\n */\nconst GENERIC_NATIVES: ReadonlySet<string> = new Set([\"Anything\", \"Dynamic\", \"Composite\"]);\n\nfunction isAcronymWord(lower: string): boolean {\n if (lower.length < 2 || !/^[a-z]+$/.test(lower)) return false;\n if (VOWELLESS_WORDS.has(lower)) return false;\n if (lower.endsWith(\"s\") && VOWELLESS_WORDS.has(lower.slice(0, -1))) return false;\n return !VOWELS.test(lower) || VOWELED_ACRONYMS.has(lower);\n}\n\n/** Spell one lowercase word: an acronym in capitals (a plural keeps its `s`), anything else as is. */\nfunction spellWord(lower: string, wasAllCaps: boolean): string {\n if (/^\\d+$/.test(lower)) return lower;\n if (wasAllCaps && lower.length >= 2) return lower.toUpperCase();\n // A plural acronym keeps its lowercase `s`: `cvs` is \"CVs\", not \"CVS\".\n if (lower.endsWith(\"s\") && !SINGULAR_S_ACRONYMS.has(lower) && isAcronymWord(lower.slice(0, -1))) {\n return lower.slice(0, -1).toUpperCase() + \"s\";\n }\n if (isAcronymWord(lower)) return lower.toUpperCase();\n return lower;\n}\n\n/**\n * Split an identifier into its words: on `_`, `-`, `.` and spaces, and at the\n * case boundaries of camel and Pascal case, keeping a run of capitals together\n * (`PDFDocument` is `PDF` and `Document`).\n */\nfunction splitIdentifier(identifier: string): { word: string; wasAllCaps: boolean }[] {\n const parts = identifier\n .replace(/([a-z\\d])([A-Z])/g, \"$1 $2\")\n .replace(/([A-Z]+)([A-Z][a-z])/g, \"$1 $2\")\n .replace(/([A-Za-z])(\\d)/g, \"$1 $2\")\n .split(/[\\s_\\-.]+/)\n .filter((p) => p.length > 0);\n return parts.map((p) => ({\n word: p.toLowerCase(),\n wasAllCaps: p.length >= 2 && p === p.toUpperCase() && /[A-Z]/.test(p),\n }));\n}\n\n/** Capitalize the first letter, leaving the rest as written. */\nfunction capitalizeFirst(text: string): string {\n return text.length === 0 ? text : text.charAt(0).toUpperCase() + text.slice(1);\n}\n\n/** The last segment of a dotted ref: the code without its domain (`recruitment.CandidateProfile` → `CandidateProfile`). */\nexport function stripDomain(ref: string): string {\n const dot = ref.lastIndexOf(\".\");\n return dot === -1 ? ref : ref.slice(dot + 1);\n}\n\n/**\n * An identifier as words in sentence case: `job_offer` → \"Job offer\",\n * `CandidateProfile` → \"Candidate profile\", `pr_url` → \"PR URL\",\n * `cvs` → \"CVs\". A dotted ref is humanized by its last segment.\n */\nexport function humanizeIdentifier(identifier: string): string {\n const words = splitIdentifier(stripDomain(identifier.trim()));\n if (words.length === 0) return \"\";\n return capitalizeFirst(words.map((w) => spellWord(w.word, w.wasAllCaps)).join(\" \"));\n}\n\n/** A concept's plain name, from its code or ref: a native's own plain name, or the humanized code. */\nexport function conceptPlainName(conceptRef: string): string {\n const code = stripDomain(conceptRef.trim());\n return NATIVE_PLAIN_NAMES[code] ?? humanizeIdentifier(code);\n}\n\n/** Whether a concept is a native that names no particular kind of content (`Anything`, `Dynamic`, `Composite`). */\nexport function isGenericConcept(conceptRef: string): boolean {\n return GENERIC_NATIVES.has(stripDomain(conceptRef.trim()));\n}\n\n/**\n * Authored text as a title: whitespace collapsed (descriptions are often\n * written across lines), the first letter capitalized, and a single closing\n * period dropped, since a label in a box reads as a heading. Nothing else is\n * touched: the words are the author's.\n */\nexport function sentenceCase(text: string): string {\n const collapsed = text.replace(/\\s+/g, \" \").trim();\n const trimmed =\n collapsed.endsWith(\".\") && !collapsed.endsWith(\"..\") ? collapsed.slice(0, -1) : collapsed;\n return capitalizeFirst(trimmed);\n}\n\n/**\n * A pipe's title in plain words: its authored description as a title\n * (`sentenceCase`), or its humanized code when it has none. The simple graph\n * style titles its steps this way, and the simple timeline style its lines, so\n * a step reads the same in both. `fromDescription` says which it was.\n */\nexport function pipeTitle(\n description: string | null | undefined,\n pipeCode: string,\n): { title: string; fromDescription: boolean } {\n const described = sentenceCase(description ?? \"\");\n if (described) return { title: described, fromDescription: true };\n return { title: humanizeIdentifier(pipeCode), fromDescription: false };\n}\n\n/**\n * An identifier as words inside a sentence: `humanizeIdentifier`'s words with\n * their first letter in lower case, unless the first word is an acronym\n * (`filing` → \"filing\", `cv_file` → \"CV file\").\n */\nexport function humanizeInSentence(identifier: string): string {\n const words = humanizeIdentifier(identifier);\n const first = words.split(\" \")[0] ?? \"\";\n return first.length >= 2 && first === first.toUpperCase()\n ? words\n : words.charAt(0).toLowerCase() + words.slice(1);\n}\n\n/** The outcome names that read better as other words: a yes-or-no test's, and the default. */\nconst OUTCOME_WORDS: Readonly<Record<string, string>> = {\n true: \"Yes\",\n false: \"No\",\n default: \"Otherwise\",\n};\n\n/**\n * A condition's outcome as an arrow label: `english` → \"English\",\n * `high_priority` → \"High priority\", a yes-or-no test's `true` and `false` →\n * \"Yes\" and \"No\", and the `default` outcome → \"Otherwise\". A branch taken on\n * several outcomes, written `no_fit | default` as the static builder labels it,\n * reads \"No fit or otherwise\".\n */\nexport function outcomeLabel(outcome: string): string {\n const outcomes = outcome\n .split(\"|\")\n .map((o) => o.trim())\n .filter((o) => o.length > 0);\n const labels = outcomes.map((o, index) => {\n const label = OUTCOME_WORDS[o.toLowerCase()] ?? humanizeIdentifier(o);\n return index === 0 ? label : label.charAt(0).toLowerCase() + label.slice(1);\n });\n return labels.join(\" or \");\n}\n"],"mappings":";AAUA,IAAM,mBAAwC,oBAAI,IAAI;AAAA,EACpD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,E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K,MAAM;AAC3B;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/graph/graphConfig.ts"],"sourcesContent":["import type { GraphConfig, GraphStyleId, GraphTheme, ToolbarPosition } from \"./types\";\nimport {\n EDGE_TYPE,\n FOLD_MODE,\n GRAPH_STYLE,\n GRAPH_THEME,\n GRAPH_THEME_MODE,\n TOOLBAR_POSITION,\n} from \"./types\";\n\n/**\n * Semantic design tokens consumed by every component CSS file.\n *\n * Component CSS **must never** hardcode raw hex/rgba values. Reference these\n * tokens via `var(--token-name)`. A new theme is just a new set of values.\n * A new component picks up theming for free as long as it only uses tokens.\n *\n * Categories:\n * surface-* → backgrounds (page, panels, pills, glass overlays)\n * border-* → borders, dividers\n * text-* → foreground text\n * shadow-* → drop shadows\n * focus-ring → focus outline\n * color-* → domain-semantic colors (pipe accents, edges, status); kept\n * separate because they're meaningful in both themes (a pipe is\n * still red), only the *value* shifts for contrast.\n */\nconst FONT_TOKENS: Record<string, string> = {\n \"--font-sans\": '\"Inter\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", sans-serif',\n \"--font-mono\": '\"JetBrains Mono\", \"Monaco\", \"Menlo\", monospace',\n};\n\nexport const DARK_PALETTE_COLORS: Record<string, string> = {\n ...FONT_TOKENS,\n\n // Surfaces\n \"--surface-page\": \"#0a0a0a\",\n \"--surface-panel\": \"#111118\",\n \"--surface-overlay\": \"rgba(17, 17, 24, 0.8)\",\n \"--surface-overlay-hover\": \"rgba(30, 30, 40, 0.9)\",\n \"--surface-overlay-disabled\": \"rgba(17, 17, 24, 0.6)\",\n \"--surface-elevated\": \"rgba(255, 255, 255, 0.06)\",\n \"--surface-elevated-hover\": \"rgba(255, 255, 255, 0.1)\",\n \"--surface-sunken\": \"rgba(255, 255, 255, 0.03)\",\n \"--surface-pill\": \"rgba(255, 255, 255, 0.06)\",\n \"--surface-pill-border\": \"rgba(255, 255, 255, 0.08)\",\n\n // Borders\n \"--border-subtle\": \"rgba(255, 255, 255, 0.06)\",\n \"--border-default\": \"rgba(255, 255, 255, 0.1)\",\n \"--border-strong\": \"rgba(255, 255, 255, 0.18)\",\n \"--border-dashed\": \"rgba(255, 255, 255, 0.15)\",\n\n // Text\n \"--text-primary\": \"#f8fafc\",\n \"--text-default\": \"#e2e8f0\",\n \"--text-secondary\": \"#cbd5e1\",\n \"--text-muted\": \"#94a3b8\",\n \"--text-dim\": \"#64748b\",\n \"--text-on-accent\": \"#0e0e0e\",\n\n // Effects\n \"--shadow-sm\": \"0 2px 8px rgba(0, 0, 0, 0.4)\",\n \"--shadow-md\": \"0 4px 16px rgba(0, 0, 0, 0.6)\",\n \"--shadow-lg\": \"0 8px 24px rgba(0, 0, 0, 0.5)\",\n \"--focus-ring\": \"rgba(59, 130, 246, 0.6)\",\n\n // Domain-semantic colors (graph nodes/edges)\n \"--color-pipe\": \"#ff6b6b\",\n \"--color-pipe-bg\": \"rgba(224,108,117,0.18)\",\n \"--color-pipe-text\": \"#ffffff\",\n \"--color-stuff\": \"#4ECDC4\",\n \"--color-stuff-bg\": \"rgba(78,205,196,0.12)\",\n \"--color-stuff-border\": \"#9ddcfd\",\n \"--color-stuff-text\": \"#98FB98\",\n \"--color-stuff-text-dim\": \"#9ddcfd\",\n \"--color-edge\": \"#FFFACD\",\n \"--color-batch-item\": \"#bd93f9\",\n \"--color-batch-aggregate\": \"#50fa7b\",\n \"--color-parallel-combine\": \"#d6a4ff\",\n \"--color-success\": \"#50FA7B\",\n \"--color-success-bg\": \"rgba(80,250,123,0.15)\",\n \"--color-error\": \"#FF5555\",\n \"--color-error-bg\": \"rgba(255,85,85,0.15)\",\n \"--color-error-border\": \"rgba(255,85,85,0.2)\",\n \"--color-accent\": \"#8BE9FD\",\n \"--color-accent-strong\": \"#3b82f6\",\n \"--color-warning\": \"#FFB86C\",\n\n // Controller-group palette (tinted borders/backgrounds per controller type)\n \"--ctrl-sequence-border\": \"rgba(148, 163, 184, 0.25)\",\n \"--ctrl-sequence-bg\": \"rgba(148, 163, 184, 0.03)\",\n \"--ctrl-sequence-text\": \"#94a3b8\",\n \"--ctrl-parallel-border\": \"rgba(139, 233, 253, 0.35)\",\n \"--ctrl-parallel-bg\": \"rgba(139, 233, 253, 0.03)\",\n \"--ctrl-parallel-text\": \"#8be9fd\",\n \"--ctrl-condition-border\": \"rgba(251, 191, 36, 0.35)\",\n \"--ctrl-condition-bg\": \"rgba(251, 191, 36, 0.03)\",\n \"--ctrl-condition-text\": \"#fbbf24\",\n \"--ctrl-batch-border\": \"rgba(167, 139, 250, 0.35)\",\n \"--ctrl-batch-bg\": \"rgba(167, 139, 250, 0.03)\",\n \"--ctrl-batch-text\": \"#a78bfa\",\n \"--ctrl-folded-bg\": \"rgba(148, 163, 184, 0.25)\",\n \"--ctrl-folded-border\": \"rgba(148, 163, 184, 0.4)\",\n\n // Legacy aliases — kept so existing inline styles in graph builders keep\n // working until they're migrated. New code should use the semantic tokens.\n \"--color-bg\": \"#0a0a0a\",\n \"--color-bg-dots\": \"rgba(255, 255, 255, 0.35)\",\n \"--color-text-muted\": \"#94a3b8\",\n \"--color-controller-text\": \"#94a3b8\",\n};\n\nexport const LIGHT_PALETTE_COLORS: Record<string, string> = {\n ...FONT_TOKENS,\n\n // Surfaces — chart stays a soft off-white, panels slightly cooler\n \"--surface-page\": \"#f8fafc\",\n \"--surface-panel\": \"#ffffff\",\n \"--surface-overlay\": \"rgba(255, 255, 255, 0.92)\",\n \"--surface-overlay-hover\": \"rgba(241, 245, 249, 0.96)\",\n \"--surface-overlay-disabled\": \"rgba(255, 255, 255, 0.7)\",\n \"--surface-elevated\": \"rgba(15, 23, 42, 0.05)\",\n \"--surface-elevated-hover\": \"rgba(15, 23, 42, 0.09)\",\n \"--surface-sunken\": \"rgba(15, 23, 42, 0.03)\",\n \"--surface-pill\": \"rgba(15, 23, 42, 0.05)\",\n \"--surface-pill-border\": \"rgba(15, 23, 42, 0.1)\",\n\n // Borders\n \"--border-subtle\": \"rgba(15, 23, 42, 0.08)\",\n \"--border-default\": \"rgba(15, 23, 42, 0.12)\",\n \"--border-strong\": \"rgba(15, 23, 42, 0.22)\",\n \"--border-dashed\": \"rgba(15, 23, 42, 0.18)\",\n\n // Text\n \"--text-primary\": \"#020617\",\n \"--text-default\": \"#0f172a\",\n \"--text-secondary\": \"#1e293b\",\n \"--text-muted\": \"#475569\",\n \"--text-dim\": \"#64748b\",\n \"--text-on-accent\": \"#ffffff\",\n\n // Effects\n \"--shadow-sm\": \"0 2px 8px rgba(15, 23, 42, 0.08)\",\n \"--shadow-md\": \"0 4px 16px rgba(15, 23, 42, 0.14)\",\n \"--shadow-lg\": \"0 8px 24px rgba(15, 23, 42, 0.15)\",\n \"--focus-ring\": \"rgba(2, 132, 199, 0.5)\",\n\n // Domain-semantic colors — darker for contrast on light backgrounds\n \"--color-pipe\": \"#dc2626\",\n \"--color-pipe-bg\": \"rgba(220, 38, 38, 0.1)\",\n \"--color-pipe-text\": \"#ffffff\",\n \"--color-stuff\": \"#0891b2\",\n \"--color-stuff-bg\": \"rgba(8, 145, 178, 0.08)\",\n \"--color-stuff-border\": \"#0e7490\",\n \"--color-stuff-text\": \"#0f172a\",\n \"--color-stuff-text-dim\": \"#475569\",\n \"--color-edge\": \"#64748b\",\n \"--color-batch-item\": \"#7c3aed\",\n \"--color-batch-aggregate\": \"#15803d\",\n \"--color-parallel-combine\": \"#6d28d9\",\n \"--color-success\": \"#15803d\",\n \"--color-success-bg\": \"rgba(21, 128, 61, 0.12)\",\n \"--color-error\": \"#dc2626\",\n \"--color-error-bg\": \"rgba(220, 38, 38, 0.1)\",\n \"--color-error-border\": \"rgba(220, 38, 38, 0.25)\",\n \"--color-accent\": \"#0284c7\",\n \"--color-accent-strong\": \"#0284c7\",\n \"--color-warning\": \"#d97706\",\n\n // Controller-group palette\n \"--ctrl-sequence-border\": \"rgba(71, 85, 105, 0.3)\",\n \"--ctrl-sequence-bg\": \"rgba(71, 85, 105, 0.04)\",\n \"--ctrl-sequence-text\": \"#475569\",\n \"--ctrl-parallel-border\": \"rgba(8, 145, 178, 0.4)\",\n \"--ctrl-parallel-bg\": \"rgba(8, 145, 178, 0.05)\",\n \"--ctrl-parallel-text\": \"#0e7490\",\n \"--ctrl-condition-border\": \"rgba(217, 119, 6, 0.4)\",\n \"--ctrl-condition-bg\": \"rgba(217, 119, 6, 0.05)\",\n \"--ctrl-condition-text\": \"#b45309\",\n \"--ctrl-batch-border\": \"rgba(124, 58, 237, 0.4)\",\n \"--ctrl-batch-bg\": \"rgba(124, 58, 237, 0.05)\",\n \"--ctrl-batch-text\": \"#6d28d9\",\n \"--ctrl-folded-bg\": \"rgba(71, 85, 105, 0.18)\",\n \"--ctrl-folded-border\": \"rgba(71, 85, 105, 0.35)\",\n\n // Legacy aliases\n \"--color-bg\": \"#f8fafc\",\n \"--color-bg-dots\": \"rgba(15, 23, 42, 0.18)\",\n \"--color-text-muted\": \"#475569\",\n \"--color-controller-text\": \"#475569\",\n};\n\nexport function getPaletteForTheme(theme: GraphTheme): Record<string, string> {\n return theme === GRAPH_THEME.LIGHT ? LIGHT_PALETTE_COLORS : DARK_PALETTE_COLORS;\n}\n\n// `toolbarPosition` and `graphStyle` are narrowed to required: the default\n// always sets them, so `resolveToolbarPosition` and `resolveGraphStyle` can\n// terminate their fallback chains here without a redundant literal floor.\nexport const DEFAULT_GRAPH_CONFIG: GraphConfig & {\n toolbarPosition: ToolbarPosition;\n graphStyle: GraphStyleId;\n} = {\n direction: \"LR\",\n showControllers: false,\n foldMode: FOLD_MODE.EXPANDED,\n // `system` follows the host environment (OS/browser, or editor theme) out of\n // the box — the least-surprising default for an embedded component. Hosts\n // that want a fixed appearance pass `theme: \"dark\"` / `\"light\"` explicitly.\n theme: GRAPH_THEME_MODE.SYSTEM,\n // Backward-compatible default: the toolbar stays pinned top-right unless the\n // host overrides it via `config.toolbarPosition` or the `toolbarPosition` prop.\n toolbarPosition: TOOLBAR_POSITION.TOP_RIGHT,\n // Today's drawing stays the default, so no existing host sees a change.\n graphStyle: GRAPH_STYLE.DETAILED,\n nodesep: 50,\n ranksep: 100,\n edgeType: EDGE_TYPE.DEFAULT,\n initialZoom: null,\n panToTop: true,\n // `paletteColors` intentionally omitted from the default. The viewer derives\n // the palette from the active `theme`. Consumers only set `paletteColors` to\n // override specific tokens (sparse merge on top of the theme palette).\n};\n\nexport function getPaletteColors(): Record<string, string> {\n return DARK_PALETTE_COLORS;\n}\n"],"mappings":";;;;;;;;;;;;;;AA2BA,IAAM,cAAsC;AAAA,EAC1C,eAAe;AAAA,EACf,eAAe;AACjB;AAEO,IAAM,sBAA8C,iCACtD,cADsD;AAAA;AAAA,EAIzD,kBAAkB;AAAA,EAClB,mBAAmB;AAAA,EACnB,qBAAqB;AAAA,EACrB,2BAA2B;AAAA,EAC3B,8BAA8B;AAAA,EAC9B,sBAAsB;AAAA,EACtB,4BAA4B;AAAA,EAC5B,oBAAoB;AAAA,EACpB,kBAAkB;AAAA,EAClB,yBAAyB;AAAA;AAAA,EAGzB,mBAAmB;AAAA,EACnB,oBAAoB;AAAA,EACpB,mBAAmB;AAAA,EACnB,mBAAmB;AAAA;AAAA,EAGnB,kBAAkB;AAAA,EAClB,kBAAkB;AAAA,EAClB,oBAAoB;AAAA,EACpB,gBAAgB;AAAA,EAChB,cAAc;AAAA,EACd,oBAAoB;AAAA;AAAA,EAGpB,eAAe;AAAA,EACf,eAAe;AAAA,EACf,eAAe;AAAA,EACf,gBAAgB;AAAA;AAAA,EAGhB,gBAAgB;AAAA,EAChB,mBAAmB;AAAA,EACnB,qBAAqB;AAAA,EACrB,iBAAiB;AAAA,EACjB,oBAAoB;AAAA,EACpB,wBAAwB;AAAA,EACxB,sBAAsB;AAAA,EACtB,0BAA0B;AAAA,EAC1B,gBAAgB;AAAA,EAChB,sBAAsB;AAAA,EACtB,2BAA2B;AAAA,EAC3B,4BAA4B;AAAA,EAC5B,mBAAmB;AAAA,EACnB,sBAAsB;AAAA,EACtB,iBAAiB;AAAA,EACjB,oBAAoB;AAA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