/** * Which relationship kinds an editor may offer for an edge that already exists. * * `connectableKinds` answers this for an edge being drawn, and the guarantee it * carries is that a palette built from it cannot produce an edge `check` would * refuse with `YM404`. Re-typing an edge is the same question asked of the same * table, and until now nothing asked it: the properties form offered the whole * vocabulary, so `applicationComponent --composition--> businessActor` was one * click away and the refusal only arrived at commit. * * An extension kind has no row of its own in the ArchiMate table, so it is * judged by the core kind it descends from — `VisualKindOption.coreLabel`, * which the session server resolves through the profile's declared lineage * exactly as a canvas edge gets its own `coreKindLabel`. That field exists * because of this: without it the browser could read a palette but not judge * it, and every extension kind would have to be offered unchecked, which is a * `YM404` one click away in a menu whose whole point is that it cannot produce * one. * * The kind the edge already has is always offered, even when the table would * refuse it. A model authored outside this editor is not the editor's to * silently rewrite, and a select whose current value is missing from its own * options renders blank. * * Pure, and outside any component, for the reason `view-tree-model.ts` is: * this repo renders React through `renderToStaticMarkup` and has no DOM test * environment, so logic inside a component is logic no test can reach. */ import type { CanvasGraph } from "../graph-projection.js"; import type { VisualKindOption } from "../adapters/visual/protocol-contract.js"; import { type RelationshipConvention } from "../relationship-convention.js"; export interface RelationshipKindOffer { /** What may be chosen, in vocabulary order. */ readonly options: readonly VisualKindOption[]; /** * Whether the ArchiMate table narrowed the list. False when either endpoint * sits outside the core vocabulary, which is the one case where the whole * vocabulary is offered because nothing here can judge it. */ readonly narrowed: boolean; /** * The kind practice expects between these endpoints, where practice expects * anything (#571, ADR 0162). A `