@kekonic/diagrams-geometry 1.0.0-rc.4

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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","names":["coreNormalizeShapeId"],"sources":["../src/types.ts","../src/math.ts","../src/shape-geometry.ts","../src/shapes/rectangle.ts","../src/shapes/diamond.ts","../src/shapes/hexagon.ts","../src/shapes/cylinder.ts","../src/shapes/queue.ts","../src/shapes/stream.ts","../src/shapes/ellipse.ts","../src/shapes/polygons.ts","../src/shapes/document.ts","../src/shapes/cloud.ts","../src/shapes/person.ts","../src/shapes/index.ts","../src/registry.ts","../src/measure.ts","../src/attach.ts"],"sourcesContent":["/**\n * Universal node / shape geometry types.\n *\n * Geometry is independent of semantic node kinds. Renderers and layout consume\n * these regions; semantics (service, database, …) map onto shapes via registry.\n */\n\nimport type { Point, Rect, Vec2 } from \"@kekonic/diagrams-core\";\n\nexport type { Point, Rect, Vec2 };\n\n/** Per-side insets in logical diagram units. */\nexport type Insets = {\n top: number;\n right: number;\n bottom: number;\n left: number;\n};\n\nexport type Size = { width: number; height: number };\n\n/** Cardinal / compass port sides. */\nexport type PortSide = \"north\" | \"east\" | \"south\" | \"west\";\n\n/** Optional corner ports. */\nexport type PortCorner = \"northwest\" | \"northeast\" | \"southeast\" | \"southwest\";\n\nexport type PortRef =\n | { kind: \"side\"; side: PortSide; index?: number; count?: number }\n | { kind: \"corner\"; corner: PortCorner }\n | { kind: \"center\" }\n | { kind: \"radial\"; angleDeg: number }\n | { kind: \"named\"; name: string };\n\nexport type PortStrategy =\n | \"bbox-mid\"\n | \"perimeter\"\n | \"distributed-sides\"\n | \"vertices\"\n | \"radial\"\n | \"semantic\";\n\n/** Stroke / fill hints that affect bounds and content insets. */\nexport type ShapeStyle = {\n strokeWidth?: number;\n cornerRadius?: number;\n /** Shadow blur radius (visual bounds only). */\n shadowBlur?: number;\n shadowOffsetX?: number;\n shadowOffsetY?: number;\n};\n\nexport type LayoutDensity = \"compact\" | \"standard\" | \"presentation\";\n\nexport type LayoutContext = {\n density?: LayoutDensity;\n /** Extra clear space beyond geometry defaults. */\n clearSpace?: Partial<Insets>;\n /** Edge-launch corridor beyond the perimeter (layout footprint). */\n edgeLaunch?: number;\n /** External label boxes already measured (world coords relative to node origin). */\n externalLabels?: Rect[];\n /** Badges / markers relative to node origin. */\n badges?: Rect[];\n};\n\n/**\n * Full anatomy of a placed node in logical units.\n * Coordinates are relative to the geometry bounds origin unless noted.\n */\nexport type NodeBoundsModel = {\n /** Visible outline of the primary shape (no shadows/labels/ports). */\n geometry: Rect;\n /** Interior region for text, icons, compartments. */\n content: Rect;\n /** Complete visible extent including stroke, shadow, labels, badges, ports. */\n visual: Rect;\n /** Pointer hit region (at least visual; may expand for small targets). */\n interaction: Rect;\n /** Area reserved by layout (visual + clear space + launch corridors). */\n footprint: Rect;\n /** Non-rendered exclusion zone around the node. */\n clearSpace: Insets;\n};\n\n/** Path data returned by geometries — SVG `d` plus optional polygons. */\nexport type PathData = {\n /** Primary closed outline as SVG path `d`. */\n d: string;\n /** Optional secondary strokes (cylinder rim, subprocess markers, …). */\n decorations?: Array<{ d: string; role: string }>;\n /** Polygon vertices when the shape is polygonal (for intersection). */\n polygon?: Point[];\n};\n\nexport type ContentPolicy = {\n /** Preferred content alignment. */\n align?: \"center\" | \"start\" | \"end\";\n /** Max preferred label lines before expand/truncate. */\n maxLabelLines?: number;\n /** Whether long labels should prefer external placement. */\n preferExternalLabel?: boolean;\n /** Icon placement when present. */\n iconPlacement?: \"leading\" | \"above\" | \"centered\" | \"none\";\n};\n\nexport type ClearSpacePreset = LayoutDensity;\n\nexport const CLEAR_SPACE_PRESETS: Record<ClearSpacePreset, number> = {\n compact: 10,\n standard: 20,\n presentation: 32,\n};\n\nexport const EDGE_LAUNCH_PRESETS: Record<ClearSpacePreset, number> = {\n compact: 10,\n standard: 16,\n presentation: 24,\n};\n\n/** Minimum interactive target in logical units (ports / markers). */\nexport const MIN_INTERACTION_TARGET = 22;\n\nexport const DEFAULT_STROKE_WIDTH = 1.6;\n\nexport function uniformInsets(n: number): Insets {\n return { top: n, right: n, bottom: n, left: n };\n}\n\nexport function insets(partial: Partial<Insets>, fallback = 0): Insets {\n return {\n top: partial.top ?? fallback,\n right: partial.right ?? fallback,\n bottom: partial.bottom ?? fallback,\n left: partial.left ?? fallback,\n };\n}\n\nexport function insetRect(r: Rect, pad: Insets | number): Rect {\n const p = typeof pad === \"number\" ? uniformInsets(pad) : pad;\n return {\n x: r.x + p.left,\n y: r.y + p.top,\n width: Math.max(0, r.width - p.left - p.right),\n height: Math.max(0, r.height - p.top - p.bottom),\n };\n}\n\nexport function expandRectInsets(r: Rect, pad: Insets | number): Rect {\n const p = typeof pad === \"number\" ? uniformInsets(pad) : pad;\n return {\n x: r.x - p.left,\n y: r.y - p.top,\n width: r.width + p.left + p.right,\n height: r.height + p.top + p.bottom,\n };\n}\n\nexport function unionRects(rects: Rect[]): Rect {\n if (rects.length === 0) return { x: 0, y: 0, width: 0, height: 0 };\n let minX = Infinity;\n let minY = Infinity;\n let maxX = -Infinity;\n let maxY = -Infinity;\n for (const r of rects) {\n minX = Math.min(minX, r.x);\n minY = Math.min(minY, r.y);\n maxX = Math.max(maxX, r.x + r.width);\n maxY = Math.max(maxY, r.y + r.height);\n }\n return { x: minX, y: minY, width: maxX - minX, height: maxY - minY };\n}\n\nexport function rectFromSize(size: Size, origin: Point = { x: 0, y: 0 }): Rect {\n return { x: origin.x, y: origin.y, width: size.width, height: size.height };\n}\n\nexport function normalizeVector(v: Vec2): Vec2 {\n const len = Math.hypot(v.x, v.y) || 1;\n return { x: v.x / len, y: v.y / len };\n}\n\nexport function sideNormal(side: PortSide): Vec2 {\n switch (side) {\n case \"north\":\n return { x: 0, y: -1 };\n case \"east\":\n return { x: 1, y: 0 };\n case \"south\":\n return { x: 0, y: 1 };\n case \"west\":\n return { x: -1, y: 0 };\n }\n}\n\nexport function sideMidpoint(bounds: Rect, side: PortSide): Point {\n const cx = bounds.x + bounds.width / 2;\n const cy = bounds.y + bounds.height / 2;\n switch (side) {\n case \"north\":\n return { x: cx, y: bounds.y };\n case \"east\":\n return { x: bounds.x + bounds.width, y: cy };\n case \"south\":\n return { x: cx, y: bounds.y + bounds.height };\n case \"west\":\n return { x: bounds.x, y: cy };\n }\n}\n","import type { Point, Rect, Vec2 } from \"./types.ts\";\nimport { normalizeVector } from \"./types.ts\";\n\n/** Ray from origin along direction; returns closest intersection with t >= 0. */\nexport function intersectRayPolygon(\n polygon: Point[],\n origin: Point,\n direction: Vec2,\n): Point | null {\n if (polygon.length < 3) return null;\n const dir = normalizeVector(direction);\n let bestT = Infinity;\n let best: Point | null = null;\n for (let i = 0; i < polygon.length; i++) {\n const a = polygon[i]!;\n const b = polygon[(i + 1) % polygon.length]!;\n const hit = raySegmentIntersection(origin, dir, a, b);\n if (hit && hit.t >= 0 && hit.t < bestT) {\n bestT = hit.t;\n best = hit.point;\n }\n }\n return best;\n}\n\nfunction raySegmentIntersection(\n origin: Point,\n dir: Vec2,\n a: Point,\n b: Point,\n): { t: number; point: Point } | null {\n const sx = b.x - a.x;\n const sy = b.y - a.y;\n const denom = dir.x * sy - dir.y * sx;\n if (Math.abs(denom) < 1e-9) return null;\n const qx = a.x - origin.x;\n const qy = a.y - origin.y;\n const t = (qx * sy - qy * sx) / denom;\n const u = (qx * dir.y - qy * dir.x) / denom;\n if (u < -1e-9 || u > 1 + 1e-9) return null;\n return { t, point: { x: origin.x + dir.x * t, y: origin.y + dir.y * t } };\n}\n\n/** Ellipse / circle ray intersection (axis-aligned). */\nexport function intersectRayEllipse(bounds: Rect, origin: Point, direction: Vec2): Point | null {\n const cx = bounds.x + bounds.width / 2;\n const cy = bounds.y + bounds.height / 2;\n const rx = bounds.width / 2;\n const ry = bounds.height / 2;\n if (rx <= 0 || ry <= 0) return null;\n const dir = normalizeVector(direction);\n // Transform to unit circle space.\n const ox = (origin.x - cx) / rx;\n const oy = (origin.y - cy) / ry;\n const dx = dir.x / rx;\n const dy = dir.y / ry;\n const a = dx * dx + dy * dy;\n const b = 2 * (ox * dx + oy * dy);\n const c = ox * ox + oy * oy - 1;\n const disc = b * b - 4 * a * c;\n if (disc < 0 || a === 0) return null;\n const sqrt = Math.sqrt(disc);\n const t1 = (-b - sqrt) / (2 * a);\n const t2 = (-b + sqrt) / (2 * a);\n const candidates = [t1, t2].filter((t) => t >= 0);\n if (!candidates.length) return null;\n const t = Math.min(...candidates);\n return { x: origin.x + dir.x * t, y: origin.y + dir.y * t };\n}\n\n/** Axis-aligned rect ray intersection. */\nexport function intersectRayRect(bounds: Rect, origin: Point, direction: Vec2): Point | null {\n return intersectRayPolygon(rectPolygon(bounds), origin, direction);\n}\n\nexport function rectPolygon(bounds: Rect): Point[] {\n return [\n { x: bounds.x, y: bounds.y },\n { x: bounds.x + bounds.width, y: bounds.y },\n { x: bounds.x + bounds.width, y: bounds.y + bounds.height },\n { x: bounds.x, y: bounds.y + bounds.height },\n ];\n}\n\nexport function pointInPolygon(point: Point, polygon: Point[]): boolean {\n let inside = false;\n for (let i = 0, j = polygon.length - 1; i < polygon.length; j = i++) {\n const pi = polygon[i]!;\n const pj = polygon[j]!;\n const intersect =\n pi.y > point.y !== pj.y > point.y &&\n point.x < ((pj.x - pi.x) * (point.y - pi.y)) / (pj.y - pi.y + 1e-12) + pi.x;\n if (intersect) inside = !inside;\n }\n return inside;\n}\n\nexport function pointInEllipse(point: Point, bounds: Rect): boolean {\n const cx = bounds.x + bounds.width / 2;\n const cy = bounds.y + bounds.height / 2;\n const rx = bounds.width / 2;\n const ry = bounds.height / 2;\n if (rx <= 0 || ry <= 0) return false;\n const dx = (point.x - cx) / rx;\n const dy = (point.y - cy) / ry;\n return dx * dx + dy * dy <= 1;\n}\n\nexport function polygonToPath(points: Point[], close = true): string {\n if (!points.length) return \"\";\n const [first, ...rest] = points;\n let d = `M ${first!.x} ${first!.y}`;\n for (const p of rest) d += ` L ${p.x} ${p.y}`;\n if (close) d += \" Z\";\n return d;\n}\n\n/**\n * Closed Catmull–Rom spline as cubic Béziers.\n * Yields smooth SVG path data (`C` commands) from a polygon of control points.\n */\nexport function closedCatmullRomToPath(points: Point[]): string {\n if (points.length < 3) return polygonToPath(points);\n const n = points.length;\n const first = points[0]!;\n let d = `M ${first.x} ${first.y}`;\n for (let i = 0; i < n; i++) {\n const p0 = points[(i - 1 + n) % n]!;\n const p1 = points[i]!;\n const p2 = points[(i + 1) % n]!;\n const p3 = points[(i + 2) % n]!;\n const c1x = p1.x + (p2.x - p0.x) / 6;\n const c1y = p1.y + (p2.y - p0.y) / 6;\n const c2x = p2.x - (p3.x - p1.x) / 6;\n const c2y = p2.y - (p3.y - p1.y) / 6;\n d += ` C ${c1x} ${c1y}, ${c2x} ${c2y}, ${p2.x} ${p2.y}`;\n }\n return `${d} Z`;\n}\n\n/** Inscribed content rect as a fraction of geometry bounds, centered. */\nexport function centeredContentRect(bounds: Rect, widthRatio: number, heightRatio: number): Rect {\n const w = bounds.width * widthRatio;\n const h = bounds.height * heightRatio;\n return {\n x: bounds.x + (bounds.width - w) / 2,\n y: bounds.y + (bounds.height - h) / 2,\n width: w,\n height: h,\n };\n}\n\n/** Stroke expands visual bounds by half stroke on each side. */\nexport function strokeOutset(strokeWidth: number): number {\n return Math.max(0, strokeWidth / 2);\n}\n","import type { Point, Rect, Vec2 } from \"@kekonic/diagrams-core\";\nimport type {\n ContentPolicy,\n Insets,\n LayoutContext,\n NodeBoundsModel,\n PathData,\n PortRef,\n PortSide,\n ShapeStyle,\n Size,\n} from \"./types.ts\";\nimport {\n CLEAR_SPACE_PRESETS,\n DEFAULT_STROKE_WIDTH,\n EDGE_LAUNCH_PRESETS,\n MIN_INTERACTION_TARGET,\n expandRectInsets,\n insets,\n sideMidpoint,\n sideNormal,\n unionRects,\n uniformInsets,\n} from \"./types.ts\";\nimport { strokeOutset } from \"./math.ts\";\n\n/**\n * Renderer-neutral shape geometry contract.\n *\n * Every foundational shape implements this so measure, layout, routing, and\n * renderers share one source of truth for paths, content, ports, and hits.\n */\nexport interface ShapeGeometry {\n readonly id: string;\n\n /** SVG path / polygon for the primary outline. */\n getPath(bounds: Rect, style?: ShapeStyle): PathData;\n\n /** Safe interior rectangle for text/icons/compartments. */\n getContentBounds(bounds: Rect, style?: ShapeStyle): Rect;\n\n /** Visible extent including stroke (and optional shadow). */\n getVisualBounds(bounds: Rect, style?: ShapeStyle): Rect;\n\n /** Layout reservation including clear space and edge-launch corridor. */\n getLayoutFootprint(bounds: Rect, context?: LayoutContext, style?: ShapeStyle): Rect;\n\n /** World position of a port on/around the shape. */\n getPortPosition(port: PortRef, bounds: Rect, style?: ShapeStyle): Point;\n\n /** Outward unit normal at a port (edge launch direction). */\n getPortNormal(port: PortRef, bounds: Rect, style?: ShapeStyle): Vec2;\n\n /** Intersection of a ray with the visible perimeter. */\n intersectRay(bounds: Rect, origin: Point, direction: Vec2, style?: ShapeStyle): Point | null;\n\n /** Point-in-shape test for hit testing (geometry fill, not interaction pad). */\n containsPoint(bounds: Rect, point: Point, style?: ShapeStyle): boolean;\n\n /** Optional preferred default / min sizes. */\n defaultSize?: Size;\n minSize?: Size;\n defaultPadding?: Insets;\n contentPolicy?: ContentPolicy;\n /** Extra clear-space units beyond density preset (pointed corners, etc.). */\n clearSpaceBoost?: number;\n}\n\nexport type ShapeGeometryBaseOptions = {\n id: string;\n defaultSize?: Size;\n minSize?: Size;\n defaultPadding?: Insets;\n contentPolicy?: ContentPolicy;\n /** Extra clear space beyond density preset (e.g. pointed corners). */\n clearSpaceBoost?: number;\n};\n\n/** Assemble the full node bounds model from a geometry + style + context. */\nexport function buildNodeBoundsModel(\n geometry: ShapeGeometry,\n bounds: Rect,\n style: ShapeStyle = {},\n context: LayoutContext = {},\n): NodeBoundsModel {\n const content = geometry.getContentBounds(bounds, style);\n const visual = geometry.getVisualBounds(bounds, style);\n const extras: Rect[] = [visual];\n if (context.externalLabels) extras.push(...context.externalLabels);\n if (context.badges) extras.push(...context.badges);\n const visualWithChrome = unionRects(extras);\n\n const density = context.density ?? \"standard\";\n const baseClear = CLEAR_SPACE_PRESETS[density];\n const boost = geometry.clearSpaceBoost ?? 0;\n const clearSpace = insets(context.clearSpace ?? {}, baseClear + boost);\n const launch = context.edgeLaunch ?? EDGE_LAUNCH_PRESETS[density];\n const footprintPad: Insets = {\n top: clearSpace.top + launch,\n right: clearSpace.right + launch,\n bottom: clearSpace.bottom + launch,\n left: clearSpace.left + launch,\n };\n const footprint = expandRectInsets(visualWithChrome, footprintPad);\n\n const interactionPad = Math.max(\n 0,\n (MIN_INTERACTION_TARGET - Math.min(bounds.width, bounds.height)) / 2,\n );\n const interaction =\n interactionPad > 0 ? expandRectInsets(visualWithChrome, interactionPad) : visualWithChrome;\n\n return {\n geometry: { ...bounds },\n content,\n visual: visualWithChrome,\n interaction,\n footprint,\n clearSpace,\n };\n}\n\n/** Shared helpers for concrete geometries. */\nexport function defaultVisualBounds(bounds: Rect, style: ShapeStyle = {}): Rect {\n const stroke = style.strokeWidth ?? DEFAULT_STROKE_WIDTH;\n const outset = strokeOutset(stroke);\n let visual = expandRectInsets(bounds, outset);\n if (style.shadowBlur || style.shadowOffsetX || style.shadowOffsetY) {\n const blur = style.shadowBlur ?? 0;\n const ox = style.shadowOffsetX ?? 0;\n const oy = style.shadowOffsetY ?? 0;\n visual = unionRects([\n visual,\n {\n x: bounds.x + Math.min(0, ox) - blur,\n y: bounds.y + Math.min(0, oy) - blur,\n width: bounds.width + Math.abs(ox) + blur * 2,\n height: bounds.height + Math.abs(oy) + blur * 2,\n },\n ]);\n }\n return visual;\n}\n\nexport function defaultLayoutFootprint(\n geometry: ShapeGeometry,\n bounds: Rect,\n context: LayoutContext = {},\n style: ShapeStyle = {},\n): Rect {\n return buildNodeBoundsModel(geometry, bounds, style, context).footprint;\n}\n\nexport function defaultSidePortPosition(port: PortRef, bounds: Rect): Point {\n if (port.kind === \"center\") {\n return { x: bounds.x + bounds.width / 2, y: bounds.y + bounds.height / 2 };\n }\n if (port.kind === \"corner\") {\n switch (port.corner) {\n case \"northwest\":\n return { x: bounds.x, y: bounds.y };\n case \"northeast\":\n return { x: bounds.x + bounds.width, y: bounds.y };\n case \"southeast\":\n return { x: bounds.x + bounds.width, y: bounds.y + bounds.height };\n case \"southwest\":\n return { x: bounds.x, y: bounds.y + bounds.height };\n }\n }\n if (port.kind === \"radial\") {\n const cx = bounds.x + bounds.width / 2;\n const cy = bounds.y + bounds.height / 2;\n const rad = (port.angleDeg * Math.PI) / 180;\n // Approximate on bbox ellipse.\n return {\n x: cx + Math.cos(rad) * (bounds.width / 2),\n y: cy + Math.sin(rad) * (bounds.height / 2),\n };\n }\n if (port.kind === \"named\") {\n return sideMidpoint(bounds, \"east\");\n }\n // side\n const side = port.side;\n const count = Math.max(1, port.count ?? 1);\n const index = Math.min(Math.max(0, port.index ?? 0), count - 1);\n if (count === 1) return sideMidpoint(bounds, side);\n return distributedSidePort(bounds, side, index, count);\n}\n\n/**\n * Place a side port on a non-rect silhouette.\n * Starts from the AABB mid/distributed point, then casts from the shape center\n * onto the outline so FIXED_POS pins and perimeter snap share one attach truth.\n */\nexport function projectSidePortOntoOutline(\n port: PortRef,\n bounds: Rect,\n hitFromCenter: (direction: Vec2) => Point | null,\n): Point {\n const bboxPt = defaultSidePortPosition(port, bounds);\n if (port.kind !== \"side\") return bboxPt;\n const cx = bounds.x + bounds.width / 2;\n const cy = bounds.y + bounds.height / 2;\n const direction = { x: bboxPt.x - cx, y: bboxPt.y - cy };\n if (Math.hypot(direction.x, direction.y) < 1e-9) return bboxPt;\n return hitFromCenter(direction) ?? bboxPt;\n}\n\n/** Convenience: project onto a polygon silhouette via center→AABB ray. */\nexport function projectSidePortOntoPolygon(\n port: PortRef,\n bounds: Rect,\n polygon: Point[],\n intersect: (polygon: Point[], origin: Point, direction: Vec2) => Point | null,\n): Point {\n return projectSidePortOntoOutline(port, bounds, (direction) =>\n intersect(\n polygon,\n { x: bounds.x + bounds.width / 2, y: bounds.y + bounds.height / 2 },\n direction,\n ),\n );\n}\n\nexport function distributedSidePort(\n bounds: Rect,\n side: PortSide,\n index: number,\n count: number,\n sideInset = 8,\n): Point {\n const usable =\n side === \"north\" || side === \"south\"\n ? Math.max(0, bounds.width - sideInset * 2)\n : Math.max(0, bounds.height - sideInset * 2);\n const step = count > 1 ? usable / (count - 1) : 0;\n const offset = sideInset + step * index;\n switch (side) {\n case \"north\":\n return { x: bounds.x + offset, y: bounds.y };\n case \"south\":\n return { x: bounds.x + offset, y: bounds.y + bounds.height };\n case \"east\":\n return { x: bounds.x + bounds.width, y: bounds.y + offset };\n case \"west\":\n return { x: bounds.x, y: bounds.y + offset };\n }\n}\n\nexport function defaultPortNormal(port: PortRef, _bounds: Rect): Vec2 {\n if (port.kind === \"side\") return sideNormal(port.side);\n if (port.kind === \"corner\") {\n switch (port.corner) {\n case \"northwest\":\n return normalizeVec({ x: -1, y: -1 });\n case \"northeast\":\n return normalizeVec({ x: 1, y: -1 });\n case \"southeast\":\n return normalizeVec({ x: 1, y: 1 });\n case \"southwest\":\n return normalizeVec({ x: -1, y: 1 });\n }\n }\n if (port.kind === \"radial\") {\n const rad = (port.angleDeg * Math.PI) / 180;\n return { x: Math.cos(rad), y: Math.sin(rad) };\n }\n if (port.kind === \"center\") {\n return { x: 1, y: 0 };\n }\n return { x: 1, y: 0 };\n}\n\nfunction normalizeVec(v: Vec2): Vec2 {\n const len = Math.hypot(v.x, v.y) || 1;\n return { x: v.x / len, y: v.y / len };\n}\n\nexport { uniformInsets };\n","import type { Point, Rect, ShapeStyle } from \"../types.ts\";\nimport { DEFAULT_STROKE_WIDTH, insetRect } from \"../types.ts\";\nimport {\n type ShapeGeometry,\n type ShapeGeometryBaseOptions,\n defaultLayoutFootprint,\n defaultPortNormal,\n defaultSidePortPosition,\n defaultVisualBounds,\n projectSidePortOntoPolygon,\n} from \"../shape-geometry.ts\";\nimport {\n intersectRayPolygon,\n intersectRayRect,\n pointInPolygon,\n polygonToPath,\n rectPolygon,\n} from \"../math.ts\";\n\nexport type RectangleOptions = ShapeGeometryBaseOptions & {\n /** Fixed corner radius; capped at half min dimension. */\n cornerRadius?: number;\n /** When true, radius = height/2 (capsule). */\n pill?: boolean;\n};\n\nfunction resolveRadius(\n bounds: Rect,\n style: ShapeStyle | undefined,\n opts: RectangleOptions,\n): number {\n if (opts.pill) return bounds.height / 2;\n const configured = style?.cornerRadius ?? opts.cornerRadius ?? 0;\n return Math.min(configured, bounds.width / 2, bounds.height / 2);\n}\n\n/** Sampled rounded-rect / capsule outline for ports, rays, and hit tests. */\nexport function roundedRectPolygon(bounds: Rect, r: number, arcSamples = 6): Point[] {\n if (r <= 0) return rectPolygon(bounds);\n const { x, y, width, height } = bounds;\n const radius = Math.min(r, width / 2, height / 2);\n const pts: Point[] = [];\n const arc = (cx: number, cy: number, start: number, end: number) => {\n for (let i = 0; i <= arcSamples; i++) {\n const t = start + ((end - start) * i) / arcSamples;\n pts.push({ x: cx + radius * Math.cos(t), y: cy + radius * Math.sin(t) });\n }\n };\n // Clockwise from top edge after NE corner origin… start NW corner arc.\n arc(x + radius, y + radius, -Math.PI, -Math.PI / 2); // NW\n arc(x + width - radius, y + radius, -Math.PI / 2, 0); // NE\n arc(x + width - radius, y + height - radius, 0, Math.PI / 2); // SE\n arc(x + radius, y + height - radius, Math.PI / 2, Math.PI); // SW\n return pts;\n}\n\nexport function createRectangleGeometry(\n opts: RectangleOptions = { id: \"rectangle\" },\n): ShapeGeometry {\n const id = opts.id;\n const geometry: ShapeGeometry = {\n id,\n defaultSize: opts.defaultSize ?? { width: 160, height: 72 },\n minSize: opts.minSize ?? { width: 48, height: 32 },\n defaultPadding: opts.defaultPadding ?? { top: 16, right: 18, bottom: 16, left: 18 },\n contentPolicy: opts.contentPolicy ?? {\n align: \"start\",\n maxLabelLines: 2,\n iconPlacement: \"leading\",\n },\n\n getPath(bounds, style = {}) {\n const r = resolveRadius(bounds, style, opts);\n const { x, y, width, height } = bounds;\n if (r <= 0) {\n const polygon = rectPolygon(bounds);\n return { d: polygonToPath(polygon), polygon };\n }\n const d = [\n `M ${x + r} ${y}`,\n `L ${x + width - r} ${y}`,\n `A ${r} ${r} 0 0 1 ${x + width} ${y + r}`,\n `L ${x + width} ${y + height - r}`,\n `A ${r} ${r} 0 0 1 ${x + width - r} ${y + height}`,\n `L ${x + r} ${y + height}`,\n `A ${r} ${r} 0 0 1 ${x} ${y + height - r}`,\n `L ${x} ${y + r}`,\n `A ${r} ${r} 0 0 1 ${x + r} ${y}`,\n `Z`,\n ].join(\" \");\n return { d, polygon: roundedRectPolygon(bounds, r) };\n },\n\n getContentBounds(bounds, style = {}) {\n const stroke = style.strokeWidth ?? DEFAULT_STROKE_WIDTH;\n const r = resolveRadius(bounds, style, opts);\n const pad = Math.max(stroke, r > 0 ? r * 0.35 : 0) + 2;\n return insetRect(bounds, pad);\n },\n\n getVisualBounds(bounds, style) {\n return defaultVisualBounds(bounds, style);\n },\n\n getLayoutFootprint(bounds, context, style) {\n return defaultLayoutFootprint(geometry, bounds, context, style);\n },\n\n getPortPosition(port, bounds, style = {}) {\n const r = resolveRadius(bounds, style, opts);\n if (r <= 0) return defaultSidePortPosition(port, bounds);\n // Project AABB slots onto the rounded/capsule outline (keeps pill E/W fans apart).\n return projectSidePortOntoPolygon(\n port,\n bounds,\n roundedRectPolygon(bounds, r),\n intersectRayPolygon,\n );\n },\n\n getPortNormal(port, bounds) {\n return defaultPortNormal(port, bounds);\n },\n\n intersectRay(bounds, origin, direction, style = {}) {\n const r = resolveRadius(bounds, style, opts);\n if (r <= 0) return intersectRayRect(bounds, origin, direction);\n return intersectRayPolygon(roundedRectPolygon(bounds, r), origin, direction);\n },\n\n containsPoint(bounds, point, style = {}) {\n const r = resolveRadius(bounds, style, opts);\n if (r <= 0) return pointInPolygon(point, rectPolygon(bounds));\n return pointInPolygon(point, roundedRectPolygon(bounds, r));\n },\n };\n return geometry;\n}\n\nexport const rectangleGeometry = createRectangleGeometry({ id: \"rectangle\" });\nexport const roundedRectangleGeometry = createRectangleGeometry({\n id: \"rounded\",\n // Match SVG card default when style is omitted (layout FIXED_POS / snap).\n cornerRadius: 12,\n contentPolicy: { align: \"start\", maxLabelLines: 2, iconPlacement: \"leading\" },\n});\nexport const pillGeometry = createRectangleGeometry({\n id: \"pill\",\n pill: true,\n defaultSize: { width: 120, height: 40 },\n contentPolicy: { align: \"center\", maxLabelLines: 1, iconPlacement: \"leading\" },\n});\n","import type { Point, Rect } from \"../types.ts\";\nimport { DEFAULT_STROKE_WIDTH, insetRect } from \"../types.ts\";\nimport {\n type ShapeGeometry,\n defaultLayoutFootprint,\n defaultPortNormal,\n defaultVisualBounds,\n projectSidePortOntoPolygon,\n} from \"../shape-geometry.ts\";\nimport {\n centeredContentRect,\n intersectRayPolygon,\n pointInPolygon,\n polygonToPath,\n} from \"../math.ts\";\n\n/** Diamond tips sit on bbox mid-sides so LR/TD ports land on vertices. */\nexport function diamondPolygon(bounds: Rect): Point[] {\n const cx = bounds.x + bounds.width / 2;\n const cy = bounds.y + bounds.height / 2;\n return [\n { x: cx, y: bounds.y },\n { x: bounds.x + bounds.width, y: cy },\n { x: cx, y: bounds.y + bounds.height },\n { x: bounds.x, y: cy },\n ];\n}\n\nexport function diamondPointsString(bounds: Rect): string {\n return diamondPolygon(bounds)\n .map((p) => `${p.x},${p.y}`)\n .join(\" \");\n}\n\nexport const diamondGeometry: ShapeGeometry = {\n id: \"diamond\",\n defaultSize: { width: 140, height: 100 },\n minSize: { width: 64, height: 64 },\n defaultPadding: { top: 12, right: 12, bottom: 12, left: 12 },\n contentPolicy: {\n align: \"center\",\n maxLabelLines: 2,\n preferExternalLabel: false,\n iconPlacement: \"none\",\n },\n clearSpaceBoost: 6,\n\n getPath(bounds) {\n const polygon = diamondPolygon(bounds);\n return { d: polygonToPath(polygon), polygon };\n },\n\n getContentBounds(bounds, style = {}) {\n const stroke = style.strokeWidth ?? DEFAULT_STROKE_WIDTH;\n // Spec: ~50% safe rectangle inside diamond.\n const content = centeredContentRect(bounds, 0.5, 0.5);\n return insetRect(content, stroke);\n },\n\n getVisualBounds(bounds, style) {\n return defaultVisualBounds(bounds, style);\n },\n\n getLayoutFootprint(bounds, context, style) {\n return defaultLayoutFootprint(diamondGeometry, bounds, context, style);\n },\n\n getPortPosition(port, bounds) {\n return projectSidePortOntoPolygon(port, bounds, diamondPolygon(bounds), intersectRayPolygon);\n },\n\n getPortNormal(port, bounds) {\n return defaultPortNormal(port, bounds);\n },\n\n intersectRay(bounds, origin, direction) {\n return intersectRayPolygon(diamondPolygon(bounds), origin, direction);\n },\n\n containsPoint(bounds, point) {\n return pointInPolygon(point, diamondPolygon(bounds));\n },\n};\n","import type { Point, Rect } from \"../types.ts\";\nimport { DEFAULT_STROKE_WIDTH } from \"../types.ts\";\nimport {\n type ShapeGeometry,\n defaultLayoutFootprint,\n defaultPortNormal,\n defaultVisualBounds,\n projectSidePortOntoPolygon,\n} from \"../shape-geometry.ts\";\nimport { intersectRayPolygon, pointInPolygon, polygonToPath } from \"../math.ts\";\n\n/** Flat-top hexagon inset: height-led so wide short nodes keep real chamfers. */\nexport function hexagonInset(width: number, height: number): number {\n return Math.min(width * 0.22, height * 0.42, width * 0.5 - 4);\n}\n\nexport function hexagonPolygon(bounds: Rect): Point[] {\n const { x, y, width, height } = bounds;\n const inset = hexagonInset(width, height);\n const midY = y + height / 2;\n return [\n { x: x + inset, y },\n { x: x + width - inset, y },\n { x: x + width, y: midY },\n { x: x + width - inset, y: y + height },\n { x: x + inset, y: y + height },\n { x, y: midY },\n ];\n}\n\nexport function hexagonPointsString(bounds: Rect): string {\n return hexagonPolygon(bounds)\n .map((p) => `${p.x},${p.y}`)\n .join(\" \");\n}\n\nfunction createHexGeometry(id: string): ShapeGeometry {\n const geometry: ShapeGeometry = {\n id,\n defaultSize: { width: 160, height: 72 },\n minSize: { width: 72, height: 40 },\n defaultPadding: { top: 14, right: 20, bottom: 14, left: 20 },\n contentPolicy: {\n align: \"center\",\n maxLabelLines: 2,\n iconPlacement: \"none\",\n },\n\n getPath(bounds) {\n const polygon = hexagonPolygon(bounds);\n return { d: polygonToPath(polygon), polygon };\n },\n\n getContentBounds(bounds, style = {}) {\n const stroke = style.strokeWidth ?? DEFAULT_STROKE_WIDTH;\n const inset = hexagonInset(bounds.width, bounds.height);\n // Exclude angled ends — keep central rectangle.\n return {\n x: bounds.x + inset,\n y: bounds.y + stroke + 4,\n width: Math.max(0, bounds.width - inset * 2),\n height: Math.max(0, bounds.height - (stroke + 4) * 2),\n };\n },\n\n getVisualBounds(bounds, style) {\n return defaultVisualBounds(bounds, style);\n },\n\n getLayoutFootprint(bounds, context, style) {\n return defaultLayoutFootprint(geometry, bounds, context, style);\n },\n\n getPortPosition(port, bounds) {\n return projectSidePortOntoPolygon(port, bounds, hexagonPolygon(bounds), intersectRayPolygon);\n },\n\n getPortNormal(port, bounds) {\n return defaultPortNormal(port, bounds);\n },\n\n intersectRay(bounds, origin, direction) {\n return intersectRayPolygon(hexagonPolygon(bounds), origin, direction);\n },\n\n containsPoint(bounds, point) {\n return pointInPolygon(point, hexagonPolygon(bounds));\n },\n };\n return geometry;\n}\n\nexport const hexagonGeometry = createHexGeometry(\"hexagon\");\n","import type { Point, Rect } from \"../types.ts\";\nimport { DEFAULT_STROKE_WIDTH } from \"../types.ts\";\nimport {\n type ShapeGeometry,\n defaultLayoutFootprint,\n defaultPortNormal,\n defaultVisualBounds,\n projectSidePortOntoPolygon,\n} from \"../shape-geometry.ts\";\nimport { intersectRayPolygon, pointInEllipse } from \"../math.ts\";\n\nexport function cylinderRadii(width: number, height: number): { rx: number; ry: number } {\n const rx = width / 2;\n // Cap ry so short nodes stay readable and tall DBs keep a crisp lid.\n const ry = Math.min(Math.max(width * 0.125, 7), height * 0.16, 13);\n return { rx, ry };\n}\n\n/**\n * Cylinder as one closed silhouette + front rim arc.\n * Prefer a single coordinated path set for intersection/hit testing.\n */\nexport function cylinderPaths(bounds: Rect): { body: string; rim: string } {\n const { x, y, width, height } = bounds;\n const { rx, ry } = cylinderRadii(width, height);\n const body = [\n `M ${x} ${y + ry}`,\n `a ${rx} ${ry} 0 0 1 ${width} 0`,\n `l 0 ${height - 2 * ry}`,\n `a ${rx} ${ry} 0 0 1 ${-width} 0`,\n `z`,\n ].join(\" \");\n const rim = `M ${x} ${y + ry} a ${rx} ${ry} 0 0 0 ${width} 0`;\n return { body, rim };\n}\n\n/**\n * Sampled silhouette matching `cylinderPaths` body (top arc → right side → bottom arc → left).\n * Used for perimeter attachment so tall cylinders hit vertical walls, not a bounding ellipse.\n */\nexport function cylinderSilhouettePolygon(bounds: Rect, samplesPerCap = 16): Point[] {\n const { x, y, width, height } = bounds;\n const { rx, ry } = cylinderRadii(width, height);\n const cx = x + rx;\n const pts: Point[] = [];\n for (let i = 0; i <= samplesPerCap; i++) {\n const t = Math.PI - (i / samplesPerCap) * Math.PI; // π → 0 via top\n pts.push({ x: cx + rx * Math.cos(t), y: y + ry - ry * Math.sin(t) });\n }\n for (let i = 0; i <= samplesPerCap; i++) {\n const t = (i / samplesPerCap) * Math.PI; // 0 → π via bottom\n pts.push({\n x: cx + rx * Math.cos(t),\n y: y + height - ry + ry * Math.sin(t),\n });\n }\n return pts;\n}\n\nexport const cylinderGeometry: ShapeGeometry = {\n id: \"cylinder\",\n defaultSize: { width: 140, height: 88 },\n minSize: { width: 64, height: 56 },\n defaultPadding: { top: 22, right: 16, bottom: 14, left: 16 },\n contentPolicy: {\n align: \"center\",\n maxLabelLines: 2,\n iconPlacement: \"none\",\n },\n\n getPath(bounds) {\n const { body, rim } = cylinderPaths(bounds);\n return {\n d: body,\n decorations: [{ d: rim, role: \"rim\" }],\n };\n },\n\n getContentBounds(bounds, style = {}) {\n const stroke = style.strokeWidth ?? DEFAULT_STROKE_WIDTH;\n const { ry } = cylinderRadii(bounds.width, bounds.height);\n // Content begins below ~20–25% / top ellipse.\n const topReserve = Math.max(ry * 2, bounds.height * 0.22);\n return {\n x: bounds.x + stroke + 8,\n y: bounds.y + topReserve,\n width: Math.max(0, bounds.width - (stroke + 8) * 2),\n height: Math.max(0, bounds.height - topReserve - stroke - 8),\n };\n },\n\n getVisualBounds(bounds, style) {\n return defaultVisualBounds(bounds, style);\n },\n\n getLayoutFootprint(bounds, context, style) {\n return defaultLayoutFootprint(cylinderGeometry, bounds, context, style);\n },\n\n getPortPosition(port, bounds) {\n return projectSidePortOntoPolygon(\n port,\n bounds,\n cylinderSilhouettePolygon(bounds),\n intersectRayPolygon,\n );\n },\n\n getPortNormal(port, bounds) {\n return defaultPortNormal(port, bounds);\n },\n\n intersectRay(bounds, origin, direction) {\n return intersectRayPolygon(cylinderSilhouettePolygon(bounds), origin, direction);\n },\n\n containsPoint(bounds, point) {\n const { ry } = cylinderRadii(bounds.width, bounds.height);\n const top: Rect = { x: bounds.x, y: bounds.y, width: bounds.width, height: ry * 2 };\n const bottom: Rect = {\n x: bounds.x,\n y: bounds.y + bounds.height - ry * 2,\n width: bounds.width,\n height: ry * 2,\n };\n const body: Rect = {\n x: bounds.x,\n y: bounds.y + ry,\n width: bounds.width,\n height: Math.max(0, bounds.height - ry * 2),\n };\n if (\n point.x >= body.x &&\n point.x <= body.x + body.width &&\n point.y >= body.y &&\n point.y <= body.y + body.height\n ) {\n return true;\n }\n return pointInEllipse(point, top) || pointInEllipse(point, bottom);\n },\n};\n","import type { Point, Rect } from \"../types.ts\";\nimport { DEFAULT_STROKE_WIDTH } from \"../types.ts\";\nimport {\n type ShapeGeometry,\n defaultLayoutFootprint,\n defaultPortNormal,\n defaultVisualBounds,\n projectSidePortOntoPolygon,\n} from \"../shape-geometry.ts\";\nimport { intersectRayPolygon, pointInEllipse } from \"../math.ts\";\n\n/**\n * Horizontal pipe (sideways cylinder) — the ubiquitous message-queue silhouette.\n * End-cap radius is height-led so short wide queues keep readable openings.\n */\nexport function queueRadii(width: number, height: number): { rx: number; ry: number } {\n const ry = height / 2;\n const rx = Math.min(Math.max(height * 0.125, 7), width * 0.16, 13);\n return { rx, ry };\n}\n\n/**\n * Pipe body + left-end rim (front opening), matching vertical cylinder conventions.\n */\nexport function queuePaths(bounds: Rect): { body: string; rim: string } {\n const { x, y, width, height } = bounds;\n const { rx, ry } = queueRadii(width, height);\n const body = [\n `M ${x + rx} ${y}`,\n `l ${width - 2 * rx} 0`,\n `a ${rx} ${ry} 0 0 1 0 ${height}`,\n `l ${-(width - 2 * rx)} 0`,\n `a ${rx} ${ry} 0 0 1 0 ${-height}`,\n `z`,\n ].join(\" \");\n // Front rim on the left opening (looks into the pipe).\n const rim = `M ${x + rx} ${y} a ${rx} ${ry} 0 0 0 0 ${height}`;\n return { body, rim };\n}\n\n/**\n * Sampled silhouette for ports / ray hits (left ellipse → top → right ellipse → bottom).\n */\nexport function queueSilhouettePolygon(bounds: Rect, samplesPerCap = 16): Point[] {\n const { x, y, width, height } = bounds;\n const { rx, ry } = queueRadii(width, height);\n const cy = y + ry;\n const pts: Point[] = [];\n // Left cap: bottom → top via the outer (west) arc.\n for (let i = 0; i <= samplesPerCap; i++) {\n const t = Math.PI / 2 + (i / samplesPerCap) * Math.PI; // π/2 → 3π/2\n pts.push({ x: x + rx + rx * Math.cos(t), y: cy + ry * Math.sin(t) });\n }\n // Right cap: top → bottom via the outer (east) arc.\n for (let i = 0; i <= samplesPerCap; i++) {\n const t = -Math.PI / 2 + (i / samplesPerCap) * Math.PI; // -π/2 → π/2\n pts.push({ x: x + width - rx + rx * Math.cos(t), y: cy + ry * Math.sin(t) });\n }\n return pts;\n}\n\nexport const queueGeometry: ShapeGeometry = {\n id: \"queue\",\n defaultSize: { width: 160, height: 64 },\n minSize: { width: 72, height: 40 },\n defaultPadding: { top: 12, right: 22, bottom: 12, left: 22 },\n contentPolicy: {\n align: \"center\",\n maxLabelLines: 2,\n iconPlacement: \"leading\",\n },\n\n getPath(bounds) {\n const { body, rim } = queuePaths(bounds);\n return {\n d: body,\n decorations: [{ d: rim, role: \"rim\" }],\n };\n },\n\n getContentBounds(bounds, style = {}) {\n const stroke = style.strokeWidth ?? DEFAULT_STROKE_WIDTH;\n const { rx } = queueRadii(bounds.width, bounds.height);\n // Keep content clear of the elliptical end caps.\n const sideReserve = Math.max(rx * 2, bounds.width * 0.12);\n return {\n x: bounds.x + sideReserve,\n y: bounds.y + stroke + 6,\n width: Math.max(0, bounds.width - sideReserve * 2),\n height: Math.max(0, bounds.height - (stroke + 6) * 2),\n };\n },\n\n getVisualBounds(bounds, style) {\n return defaultVisualBounds(bounds, style);\n },\n\n getLayoutFootprint(bounds, context, style) {\n return defaultLayoutFootprint(queueGeometry, bounds, context, style);\n },\n\n getPortPosition(port, bounds) {\n return projectSidePortOntoPolygon(\n port,\n bounds,\n queueSilhouettePolygon(bounds),\n intersectRayPolygon,\n );\n },\n\n getPortNormal(port, bounds) {\n return defaultPortNormal(port, bounds);\n },\n\n intersectRay(bounds, origin, direction) {\n return intersectRayPolygon(queueSilhouettePolygon(bounds), origin, direction);\n },\n\n containsPoint(bounds, point) {\n const { rx } = queueRadii(bounds.width, bounds.height);\n const left: Rect = {\n x: bounds.x,\n y: bounds.y,\n width: rx * 2,\n height: bounds.height,\n };\n const right: Rect = {\n x: bounds.x + bounds.width - rx * 2,\n y: bounds.y,\n width: rx * 2,\n height: bounds.height,\n };\n const body: Rect = {\n x: bounds.x + rx,\n y: bounds.y,\n width: Math.max(0, bounds.width - rx * 2),\n height: bounds.height,\n };\n if (\n point.x >= body.x &&\n point.x <= body.x + body.width &&\n point.y >= body.y &&\n point.y <= body.y + body.height\n ) {\n return true;\n }\n return pointInEllipse(point, left) || pointInEllipse(point, right);\n },\n};\n","import type { Rect } from \"../types.ts\";\nimport { DEFAULT_STROKE_WIDTH } from \"../types.ts\";\nimport {\n type ShapeGeometry,\n defaultLayoutFootprint,\n defaultPortNormal,\n defaultVisualBounds,\n projectSidePortOntoPolygon,\n} from \"../shape-geometry.ts\";\nimport { intersectRayPolygon, pointInPolygon } from \"../math.ts\";\n\n/** Corner radius for the stacked-log shell. */\nexport function streamCornerRadius(height: number, width: number): number {\n return Math.min(10, height * 0.18, width * 0.12);\n}\n\n/**\n * Partition y positions (absolute) for the stacked-log / Kafka-style silhouette.\n * Two interior rules divide the card into three record bands.\n */\nexport function streamPartitionYs(bounds: Rect): [number, number] {\n const { y, height } = bounds;\n return [y + height / 3, y + (2 * height) / 3];\n}\n\nexport function streamShellPath(bounds: Rect): string {\n const { x, y, width, height } = bounds;\n const r = streamCornerRadius(height, width);\n // Rounded rectangle as a closed path (works without relying on SVG rx).\n return [\n `M ${x + r} ${y}`,\n `L ${x + width - r} ${y}`,\n `A ${r} ${r} 0 0 1 ${x + width} ${y + r}`,\n `L ${x + width} ${y + height - r}`,\n `A ${r} ${r} 0 0 1 ${x + width - r} ${y + height}`,\n `L ${x + r} ${y + height}`,\n `A ${r} ${r} 0 0 1 ${x} ${y + height - r}`,\n `L ${x} ${y + r}`,\n `A ${r} ${r} 0 0 1 ${x + r} ${y}`,\n `Z`,\n ].join(\" \");\n}\n\n/**\n * Short left-rail ticks — suggest stacked partitions without slicing through label/icon.\n */\nexport function streamPartitionPaths(bounds: Rect): string[] {\n const { x, width, height } = bounds;\n const tickLen = Math.min(14, Math.max(8, width * 0.1));\n const insetX = Math.max(8, streamCornerRadius(height, width) * 0.75);\n return streamPartitionYs(bounds).map(\n (py) => `M ${x + insetX} ${py} L ${x + insetX + tickLen} ${py}`,\n );\n}\n\nexport function streamPolygon(bounds: Rect): Array<{ x: number; y: number }> {\n const { x, y, width, height } = bounds;\n return [\n { x, y },\n { x: x + width, y },\n { x: x + width, y: y + height },\n { x, y: y + height },\n ];\n}\n\n/**\n * Stacked-log card — ubiquitous for streams, topics, and append-only partitions.\n * Outer shell holds the label; interior rules suggest record bands.\n */\nexport const streamGeometry: ShapeGeometry = {\n id: \"stream\",\n defaultSize: { width: 160, height: 72 },\n minSize: { width: 72, height: 48 },\n defaultPadding: { top: 14, right: 16, bottom: 14, left: 16 },\n contentPolicy: {\n align: \"center\",\n maxLabelLines: 2,\n iconPlacement: \"leading\",\n },\n\n getPath(bounds) {\n return {\n d: streamShellPath(bounds),\n decorations: streamPartitionPaths(bounds).map((d) => ({ d, role: \"partition\" })),\n polygon: streamPolygon(bounds),\n };\n },\n\n getContentBounds(bounds, style = {}) {\n const stroke = style.strokeWidth ?? DEFAULT_STROKE_WIDTH;\n // Keep content clear of the left partition rail.\n const rail = Math.min(22, Math.max(16, bounds.width * 0.12));\n return {\n x: bounds.x + rail,\n y: bounds.y + stroke + 8,\n width: Math.max(0, bounds.width - rail - stroke - 10),\n height: Math.max(0, bounds.height - (stroke + 8) * 2),\n };\n },\n\n getVisualBounds(bounds, style) {\n return defaultVisualBounds(bounds, style);\n },\n\n getLayoutFootprint(bounds, context, style) {\n return defaultLayoutFootprint(streamGeometry, bounds, context, style);\n },\n\n getPortPosition(port, bounds) {\n return projectSidePortOntoPolygon(port, bounds, streamPolygon(bounds), intersectRayPolygon);\n },\n\n getPortNormal(port, bounds) {\n return defaultPortNormal(port, bounds);\n },\n\n intersectRay(bounds, origin, direction) {\n return intersectRayPolygon(streamPolygon(bounds), origin, direction);\n },\n\n containsPoint(bounds, point) {\n return pointInPolygon(point, streamPolygon(bounds));\n },\n};\n","import type { Rect } from \"../types.ts\";\nimport { DEFAULT_STROKE_WIDTH } from \"../types.ts\";\nimport {\n type ShapeGeometry,\n defaultLayoutFootprint,\n defaultPortNormal,\n defaultVisualBounds,\n projectSidePortOntoOutline,\n} from \"../shape-geometry.ts\";\nimport { centeredContentRect, intersectRayEllipse, pointInEllipse } from \"../math.ts\";\n\nfunction createEllipseGeometry(\n id: string,\n contentRatio: { w: number; h: number },\n opts: { preferExternalLabel?: boolean; defaultSize?: { width: number; height: number } } = {},\n): ShapeGeometry {\n const geometry: ShapeGeometry = {\n id,\n defaultSize: opts.defaultSize ?? { width: 120, height: 80 },\n minSize: { width: 32, height: 32 },\n defaultPadding: { top: 12, right: 16, bottom: 12, left: 16 },\n contentPolicy: {\n align: \"center\",\n maxLabelLines: id === \"circle\" ? 1 : 2,\n preferExternalLabel: opts.preferExternalLabel ?? id === \"circle\",\n iconPlacement: \"centered\",\n },\n\n getPath(bounds) {\n const cx = bounds.x + bounds.width / 2;\n const cy = bounds.y + bounds.height / 2;\n const rx = bounds.width / 2;\n const ry = bounds.height / 2;\n // Two-arc ellipse path.\n const d = [\n `M ${cx - rx} ${cy}`,\n `A ${rx} ${ry} 0 1 0 ${cx + rx} ${cy}`,\n `A ${rx} ${ry} 0 1 0 ${cx - rx} ${cy}`,\n `Z`,\n ].join(\" \");\n return { d };\n },\n\n getContentBounds(bounds, style = {}) {\n const stroke = style.strokeWidth ?? DEFAULT_STROKE_WIDTH;\n const content = centeredContentRect(bounds, contentRatio.w, contentRatio.h);\n return {\n x: content.x + stroke,\n y: content.y + stroke,\n width: Math.max(0, content.width - stroke * 2),\n height: Math.max(0, content.height - stroke * 2),\n };\n },\n\n getVisualBounds(bounds, style) {\n return defaultVisualBounds(bounds, style);\n },\n\n getLayoutFootprint(bounds, context, style) {\n return defaultLayoutFootprint(geometry, bounds, context, style);\n },\n\n getPortPosition(port, bounds) {\n if (port.kind === \"radial\") {\n const cx = bounds.x + bounds.width / 2;\n const cy = bounds.y + bounds.height / 2;\n const rad = (port.angleDeg * Math.PI) / 180;\n return {\n x: cx + Math.cos(rad) * (bounds.width / 2),\n y: cy + Math.sin(rad) * (bounds.height / 2),\n };\n }\n // Cardinal / fan ports: project AABB slots onto the ellipse (not outside fill).\n return projectSidePortOntoOutline(port, bounds, (direction) =>\n intersectRayEllipse(\n bounds,\n {\n x: bounds.x + bounds.width / 2,\n y: bounds.y + bounds.height / 2,\n },\n direction,\n ),\n );\n },\n\n getPortNormal(port, bounds) {\n if (port.kind === \"radial\") {\n const rad = (port.angleDeg * Math.PI) / 180;\n return { x: Math.cos(rad), y: Math.sin(rad) };\n }\n return defaultPortNormal(port, bounds);\n },\n\n intersectRay(bounds, origin, direction) {\n return intersectRayEllipse(bounds, origin, direction);\n },\n\n containsPoint(bounds, point) {\n return pointInEllipse(point, bounds);\n },\n };\n return geometry;\n}\n\nexport const ellipseGeometry = createEllipseGeometry(\"ellipse\", { w: 0.7, h: 0.7 });\nexport const circleGeometry = createEllipseGeometry(\n \"circle\",\n { w: 0.55, h: 0.55 },\n { preferExternalLabel: true, defaultSize: { width: 40, height: 40 } },\n);\n\n/** Ensure circle stays square when asked via helper. */\nexport function squareBoundsFrom(bounds: Rect): Rect {\n const s = Math.min(bounds.width, bounds.height);\n return {\n x: bounds.x + (bounds.width - s) / 2,\n y: bounds.y + (bounds.height - s) / 2,\n width: s,\n height: s,\n };\n}\n","import type { Point, Rect } from \"../types.ts\";\nimport { DEFAULT_STROKE_WIDTH } from \"../types.ts\";\nimport {\n type ShapeGeometry,\n defaultLayoutFootprint,\n defaultPortNormal,\n defaultVisualBounds,\n projectSidePortOntoPolygon,\n} from \"../shape-geometry.ts\";\nimport {\n centeredContentRect,\n intersectRayPolygon,\n pointInPolygon,\n polygonToPath,\n} from \"../math.ts\";\n\nexport type SkewDirection = \"left\" | \"right\";\n\nexport function parallelogramPolygon(\n bounds: Rect,\n skewRatio = 0.18,\n direction: SkewDirection = \"right\",\n): Point[] {\n const skew = Math.min(bounds.width * skewRatio, bounds.width * 0.35);\n const { x, y, width, height } = bounds;\n if (direction === \"right\") {\n return [\n { x: x + skew, y },\n { x: x + width, y },\n { x: x + width - skew, y: y + height },\n { x, y: y + height },\n ];\n }\n return [\n { x, y },\n { x: x + width - skew, y },\n { x: x + width, y: y + height },\n { x: x + skew, y: y + height },\n ];\n}\n\nexport function createParallelogramGeometry(\n id = \"parallelogram\",\n direction: SkewDirection = \"right\",\n): ShapeGeometry {\n const geometry: ShapeGeometry = {\n id,\n defaultSize: { width: 160, height: 64 },\n minSize: { width: 72, height: 36 },\n defaultPadding: { top: 12, right: 24, bottom: 12, left: 24 },\n contentPolicy: { align: \"center\", maxLabelLines: 2, iconPlacement: \"none\" },\n\n getPath(bounds) {\n const polygon = parallelogramPolygon(bounds, 0.18, direction);\n return { d: polygonToPath(polygon), polygon };\n },\n\n getContentBounds(bounds, style = {}) {\n const stroke = style.strokeWidth ?? DEFAULT_STROKE_WIDTH;\n const skew = Math.min(bounds.width * 0.18, bounds.width * 0.35);\n return {\n x: bounds.x + skew + stroke,\n y: bounds.y + stroke + 4,\n width: Math.max(0, bounds.width - skew * 2 - stroke * 2),\n height: Math.max(0, bounds.height - (stroke + 4) * 2),\n };\n },\n\n getVisualBounds(bounds, style) {\n return defaultVisualBounds(bounds, style);\n },\n\n getLayoutFootprint(bounds, context, style) {\n return defaultLayoutFootprint(geometry, bounds, context, style);\n },\n\n getPortPosition(port, bounds) {\n return projectSidePortOntoPolygon(\n port,\n bounds,\n parallelogramPolygon(bounds, 0.18, direction),\n intersectRayPolygon,\n );\n },\n\n getPortNormal(port, bounds) {\n return defaultPortNormal(port, bounds);\n },\n\n intersectRay(bounds, origin, directionVec) {\n return intersectRayPolygon(\n parallelogramPolygon(bounds, 0.18, direction),\n origin,\n directionVec,\n );\n },\n\n containsPoint(bounds, point) {\n return pointInPolygon(point, parallelogramPolygon(bounds, 0.18, direction));\n },\n };\n return geometry;\n}\n\nexport const parallelogramGeometry = createParallelogramGeometry();\n\nexport function trapezoidPolygon(bounds: Rect, narrowTop = true, insetRatio = 0.16): Point[] {\n const inset = Math.min(bounds.width * insetRatio, bounds.width * 0.3);\n const { x, y, width, height } = bounds;\n if (narrowTop) {\n return [\n { x: x + inset, y },\n { x: x + width - inset, y },\n { x: x + width, y: y + height },\n { x, y: y + height },\n ];\n }\n return [\n { x, y },\n { x: x + width, y },\n { x: x + width - inset, y: y + height },\n { x: x + inset, y: y + height },\n ];\n}\n\nexport function createTrapezoidGeometry(id = \"trapezoid\", narrowTop = false): ShapeGeometry {\n const geometry: ShapeGeometry = {\n id,\n defaultSize: { width: 160, height: 64 },\n minSize: { width: 72, height: 36 },\n defaultPadding: { top: 12, right: 16, bottom: 12, left: 16 },\n contentPolicy: { align: \"center\", maxLabelLines: 2, iconPlacement: \"none\" },\n\n getPath(bounds) {\n const polygon = trapezoidPolygon(bounds, narrowTop);\n return { d: polygonToPath(polygon), polygon };\n },\n\n getContentBounds(bounds, style = {}) {\n const stroke = style.strokeWidth ?? DEFAULT_STROKE_WIDTH;\n const inset = Math.min(bounds.width * 0.16, bounds.width * 0.3);\n return {\n x: bounds.x + inset + stroke,\n y: bounds.y + stroke + 4,\n width: Math.max(0, bounds.width - inset * 2 - stroke * 2),\n height: Math.max(0, bounds.height - (stroke + 4) * 2),\n };\n },\n\n getVisualBounds(bounds, style) {\n return defaultVisualBounds(bounds, style);\n },\n\n getLayoutFootprint(bounds, context, style) {\n return defaultLayoutFootprint(geometry, bounds, context, style);\n },\n\n getPortPosition(port, bounds) {\n return projectSidePortOntoPolygon(\n port,\n bounds,\n trapezoidPolygon(bounds, narrowTop),\n intersectRayPolygon,\n );\n },\n\n getPortNormal(port, bounds) {\n return defaultPortNormal(port, bounds);\n },\n\n intersectRay(bounds, origin, direction) {\n return intersectRayPolygon(trapezoidPolygon(bounds, narrowTop), origin, direction);\n },\n\n containsPoint(bounds, point) {\n return pointInPolygon(point, trapezoidPolygon(bounds, narrowTop));\n },\n };\n return geometry;\n}\n\n/** Manual operation: wider top. */\nexport const trapezoidGeometry = createTrapezoidGeometry(\"trapezoid\", false);\n\nexport function trianglePolygon(bounds: Rect): Point[] {\n const cx = bounds.x + bounds.width / 2;\n return [\n { x: cx, y: bounds.y },\n { x: bounds.x + bounds.width, y: bounds.y + bounds.height },\n { x: bounds.x, y: bounds.y + bounds.height },\n ];\n}\n\nexport const triangleGeometry: ShapeGeometry = {\n id: \"triangle\",\n defaultSize: { width: 72, height: 64 },\n minSize: { width: 32, height: 28 },\n defaultPadding: { top: 16, right: 12, bottom: 8, left: 12 },\n contentPolicy: {\n align: \"center\",\n maxLabelLines: 1,\n preferExternalLabel: true,\n iconPlacement: \"centered\",\n },\n clearSpaceBoost: 8,\n\n getPath(bounds) {\n const polygon = trianglePolygon(bounds);\n return { d: polygonToPath(polygon), polygon };\n },\n\n getContentBounds(bounds, style = {}) {\n const stroke = style.strokeWidth ?? DEFAULT_STROKE_WIDTH;\n return centeredContentRect(\n {\n x: bounds.x + stroke,\n y: bounds.y + bounds.height * 0.35,\n width: Math.max(0, bounds.width - stroke * 2),\n height: Math.max(0, bounds.height * 0.45 - stroke),\n },\n 1,\n 1,\n );\n },\n\n getVisualBounds(bounds, style) {\n return defaultVisualBounds(bounds, style);\n },\n\n getLayoutFootprint(bounds, context, style) {\n return defaultLayoutFootprint(triangleGeometry, bounds, context, style);\n },\n\n getPortPosition(port, bounds) {\n return projectSidePortOntoPolygon(port, bounds, trianglePolygon(bounds), intersectRayPolygon);\n },\n\n getPortNormal(port, bounds) {\n return defaultPortNormal(port, bounds);\n },\n\n intersectRay(bounds, origin, direction) {\n return intersectRayPolygon(trianglePolygon(bounds), origin, direction);\n },\n\n containsPoint(bounds, point) {\n return pointInPolygon(point, trianglePolygon(bounds));\n },\n};\n","import type { Rect } from \"../types.ts\";\nimport { DEFAULT_STROKE_WIDTH } from \"../types.ts\";\nimport {\n type ShapeGeometry,\n defaultLayoutFootprint,\n defaultPortNormal,\n defaultVisualBounds,\n projectSidePortOntoPolygon,\n} from \"../shape-geometry.ts\";\nimport { intersectRayPolygon, pointInPolygon, polygonToPath } from \"../math.ts\";\n\n/**\n * Document: rectangle with a deterministic wavy bottom.\n * Ray tests and south ports use the same sampled wave polygon as the path.\n */\nexport function documentPolygon(bounds: Rect, samples = 8): Array<{ x: number; y: number }> {\n const { x, y, width, height } = bounds;\n const waveAmp = Math.min(10, height * 0.12);\n const bodyH = height - waveAmp;\n const pts: Array<{ x: number; y: number }> = [\n { x, y },\n { x: x + width, y },\n { x: x + width, y: y + bodyH },\n ];\n for (let i = samples; i >= 0; i--) {\n const t = i / samples;\n const px = x + width * t;\n // Single smooth sine dip — deterministic, easy to intersect.\n const py = y + bodyH + Math.sin(t * Math.PI) * waveAmp;\n pts.push({ x: px, y: py });\n }\n return pts;\n}\n\nexport const documentGeometry: ShapeGeometry = {\n id: \"document\",\n defaultSize: { width: 140, height: 80 },\n minSize: { width: 64, height: 48 },\n defaultPadding: { top: 14, right: 16, bottom: 20, left: 16 },\n contentPolicy: { align: \"start\", maxLabelLines: 2, iconPlacement: \"leading\" },\n\n getPath(bounds) {\n const polygon = documentPolygon(bounds);\n return { d: polygonToPath(polygon), polygon };\n },\n\n getContentBounds(bounds, style = {}) {\n const stroke = style.strokeWidth ?? DEFAULT_STROKE_WIDTH;\n const waveAmp = Math.min(10, bounds.height * 0.12);\n return {\n x: bounds.x + stroke + 8,\n y: bounds.y + stroke + 8,\n width: Math.max(0, bounds.width - (stroke + 8) * 2),\n height: Math.max(0, bounds.height - waveAmp - stroke * 2 - 16),\n };\n },\n\n getVisualBounds(bounds, style) {\n return defaultVisualBounds(bounds, style);\n },\n\n getLayoutFootprint(bounds, context, style) {\n return defaultLayoutFootprint(documentGeometry, bounds, context, style);\n },\n\n getPortPosition(port, bounds) {\n return projectSidePortOntoPolygon(port, bounds, documentPolygon(bounds), intersectRayPolygon);\n },\n\n getPortNormal(port, bounds) {\n return defaultPortNormal(port, bounds);\n },\n\n intersectRay(bounds, origin, direction) {\n return intersectRayPolygon(documentPolygon(bounds), origin, direction);\n },\n\n containsPoint(bounds, point) {\n return pointInPolygon(point, documentPolygon(bounds));\n },\n};\n\n/** Folded-corner note — rectangle with a clipped top-right fold. */\nexport function foldedCornerPath(bounds: Rect, fold = 14): { body: string; foldLine: string } {\n const { x, y, width, height } = bounds;\n const f = Math.min(fold, width * 0.25, height * 0.25);\n const body = [\n `M ${x} ${y}`,\n `L ${x + width - f} ${y}`,\n `L ${x + width} ${y + f}`,\n `L ${x + width} ${y + height}`,\n `L ${x} ${y + height}`,\n `Z`,\n ].join(\" \");\n const foldLine = `M ${x + width - f} ${y} L ${x + width - f} ${y + f} L ${x + width} ${y + f}`;\n return { body, foldLine };\n}\n\nexport function foldedDocumentPolygon(bounds: Rect, fold = 14): Array<{ x: number; y: number }> {\n const { x, y, width, height } = bounds;\n const f = Math.min(fold, width * 0.25, height * 0.25);\n return [\n { x, y },\n { x: x + width - f, y },\n { x: x + width, y: y + f },\n { x: x + width, y: y + height },\n { x, y: y + height },\n ];\n}\n\nexport const foldedDocumentGeometry: ShapeGeometry = {\n id: \"folded-document\",\n defaultSize: { width: 140, height: 80 },\n minSize: { width: 64, height: 48 },\n defaultPadding: { top: 14, right: 18, bottom: 14, left: 14 },\n contentPolicy: { align: \"start\", maxLabelLines: 3, iconPlacement: \"none\" },\n\n getPath(bounds) {\n const { body, foldLine } = foldedCornerPath(bounds);\n return { d: body, decorations: [{ d: foldLine, role: \"fold\" }] };\n },\n\n getContentBounds(bounds, style = {}) {\n const stroke = style.strokeWidth ?? DEFAULT_STROKE_WIDTH;\n const fold = Math.min(14, bounds.width * 0.25);\n return {\n x: bounds.x + stroke + 8,\n y: bounds.y + stroke + 8,\n width: Math.max(0, bounds.width - fold - stroke * 2 - 12),\n height: Math.max(0, bounds.height - (stroke + 8) * 2),\n };\n },\n\n getVisualBounds(bounds, style) {\n return defaultVisualBounds(bounds, style);\n },\n\n getLayoutFootprint(bounds, context, style) {\n return defaultLayoutFootprint(foldedDocumentGeometry, bounds, context, style);\n },\n\n getPortPosition(port, bounds) {\n return projectSidePortOntoPolygon(\n port,\n bounds,\n foldedDocumentPolygon(bounds),\n intersectRayPolygon,\n );\n },\n\n getPortNormal(port, bounds) {\n return defaultPortNormal(port, bounds);\n },\n\n intersectRay(bounds, origin, direction) {\n return intersectRayPolygon(foldedDocumentPolygon(bounds), origin, direction);\n },\n\n containsPoint(bounds, point) {\n return pointInPolygon(point, foldedDocumentPolygon(bounds));\n },\n};\n","import type { Point, Rect } from \"../types.ts\";\nimport { DEFAULT_STROKE_WIDTH } from \"../types.ts\";\nimport {\n type ShapeGeometry,\n defaultLayoutFootprint,\n defaultPortNormal,\n defaultVisualBounds,\n projectSidePortOntoPolygon,\n} from \"../shape-geometry.ts\";\nimport { centeredContentRect, intersectRayPolygon, pointInPolygon } from \"../math.ts\";\n\n/**\n * Material Design cloud scaled into bounds.\n * Flat base, soft lobes — proven silhouette (24×24 viewBox, content y∈[4,20]).\n */\nconst VB = { x: 0, y: 4, w: 24, h: 16 };\n/** Intrinsic cloud aspect (viewBox content width / height). */\nconst CLOUD_ASPECT = VB.w / VB.h;\n\ntype Seg = { type: \"C\"; c1: Point; c2: Point; end: Point } | { type: \"L\"; end: Point };\n\n/**\n * Largest 3:2 rect centered in `bounds`. Non-uniform stretch turns lobes into a\n * sausage; letterbox so the silhouette stays cloud-shaped even if layout is tall.\n */\nfunction fitCloudBounds(bounds: Rect): Rect {\n const boxAspect = bounds.width / Math.max(bounds.height, 1e-6);\n if (boxAspect >= CLOUD_ASPECT) {\n const width = bounds.height * CLOUD_ASPECT;\n return {\n x: bounds.x + (bounds.width - width) / 2,\n y: bounds.y,\n width,\n height: bounds.height,\n };\n }\n const height = bounds.width / CLOUD_ASPECT;\n return {\n x: bounds.x,\n y: bounds.y + (bounds.height - height) / 2,\n width: bounds.width,\n height,\n };\n}\n\nfunction map(bounds: Rect, px: number, py: number): Point {\n return {\n x: bounds.x + ((px - VB.x) / VB.w) * bounds.width,\n y: bounds.y + ((py - VB.y) / VB.h) * bounds.height,\n };\n}\n\nfunction cloudSegments(bounds: Rect): { start: Point; segs: Seg[] } {\n const fitted = fitCloudBounds(bounds);\n const p = (x: number, y: number) => map(fitted, x, y);\n return {\n start: p(19.35, 10.04),\n segs: [\n { type: \"C\", c1: p(18.67, 6.59), c2: p(15.64, 4), end: p(12, 4) },\n { type: \"C\", c1: p(9.11, 4), c2: p(6.6, 5.64), end: p(5.35, 8.04) },\n { type: \"C\", c1: p(2.34, 8.36), c2: p(0, 10.91), end: p(0, 14) },\n { type: \"C\", c1: p(0, 17.31), c2: p(2.69, 20), end: p(6, 20) },\n { type: \"L\", end: p(19, 20) },\n { type: \"C\", c1: p(21.76, 20), c2: p(24, 17.76), end: p(24, 15) },\n { type: \"C\", c1: p(24, 12.36), c2: p(21.95, 10.22), end: p(19.35, 10.04) },\n ],\n };\n}\n\nfunction sampleCubic(p0: Point, p1: Point, p2: Point, p3: Point, steps: number): Point[] {\n const pts: Point[] = [];\n for (let i = 1; i <= steps; i++) {\n const t = i / steps;\n const u = 1 - t;\n pts.push({\n x: u * u * u * p0.x + 3 * u * u * t * p1.x + 3 * u * t * t * p2.x + t * t * t * p3.x,\n y: u * u * u * p0.y + 3 * u * u * t * p1.y + 3 * u * t * t * p2.y + t * t * t * p3.y,\n });\n }\n return pts;\n}\n\n/** Hit-test / port polygon matching the Material silhouette. */\nexport function cloudSamplePolygon(bounds: Rect, stepsPerCurve = 10): Point[] {\n const { start, segs } = cloudSegments(bounds);\n const pts: Point[] = [start];\n let cur = start;\n for (const seg of segs) {\n if (seg.type === \"L\") {\n pts.push(seg.end);\n cur = seg.end;\n } else {\n pts.push(...sampleCubic(cur, seg.c1, seg.c2, seg.end, stepsPerCurve));\n cur = seg.end;\n }\n }\n return pts;\n}\n\n/** Material cloud path scaled into the node box. */\nexport function cloudPath(bounds: Rect): string {\n const { start, segs } = cloudSegments(bounds);\n let d = `M ${start.x} ${start.y}`;\n for (const seg of segs) {\n if (seg.type === \"L\") {\n d += ` L ${seg.end.x} ${seg.end.y}`;\n } else {\n d += ` C ${seg.c1.x} ${seg.c1.y}, ${seg.c2.x} ${seg.c2.y}, ${seg.end.x} ${seg.end.y}`;\n }\n }\n return `${d} Z`;\n}\n\nexport const cloudGeometry: ShapeGeometry = {\n id: \"cloud\",\n defaultSize: { width: 160, height: 100 },\n minSize: { width: 80, height: 56 },\n defaultPadding: { top: 20, right: 24, bottom: 20, left: 24 },\n contentPolicy: {\n align: \"center\",\n maxLabelLines: 2,\n preferExternalLabel: false,\n iconPlacement: \"centered\",\n },\n\n getPath(bounds) {\n return { d: cloudPath(bounds), polygon: cloudSamplePolygon(bounds) };\n },\n\n getContentBounds(bounds, style = {}) {\n const stroke = style.strokeWidth ?? DEFAULT_STROKE_WIDTH;\n const fitted = fitCloudBounds(bounds);\n const content = centeredContentRect(fitted, 0.55, 0.42);\n content.y = fitted.y + fitted.height * 0.38;\n return {\n x: content.x + stroke,\n y: content.y + stroke,\n width: Math.max(0, content.width - stroke * 2),\n height: Math.max(0, content.height - stroke * 2),\n };\n },\n\n getVisualBounds(bounds, style) {\n return defaultVisualBounds(bounds, style);\n },\n\n getLayoutFootprint(bounds, context, style) {\n return defaultLayoutFootprint(cloudGeometry, bounds, context, style);\n },\n\n getPortPosition(port, bounds) {\n return projectSidePortOntoPolygon(\n port,\n bounds,\n cloudSamplePolygon(bounds),\n intersectRayPolygon,\n );\n },\n\n getPortNormal(port, bounds) {\n return defaultPortNormal(port, bounds);\n },\n\n intersectRay(bounds, origin, direction) {\n return intersectRayPolygon(cloudSamplePolygon(bounds), origin, direction);\n },\n\n containsPoint(bounds, point) {\n return pointInPolygon(point, cloudSamplePolygon(bounds));\n },\n};\n","import type { Point, Rect } from \"../types.ts\";\nimport { DEFAULT_STROKE_WIDTH } from \"../types.ts\";\nimport {\n type ShapeGeometry,\n defaultLayoutFootprint,\n defaultPortNormal,\n defaultSidePortPosition,\n defaultVisualBounds,\n projectSidePortOntoPolygon,\n} from \"../shape-geometry.ts\";\nimport { intersectRayPolygon, intersectRayRect, pointInPolygon, rectPolygon } from \"../math.ts\";\n\ntype PersonLayout = {\n cx: number;\n headR: number;\n headCy: number;\n bodyTop: number;\n bodyBottom: number;\n bodyHalfW: number;\n bodyRx: number;\n /** Interior of the torso where labels / icons sit. */\n content: Rect;\n};\n\n/** Head sits above the torso; torso uses the full node width and holds content. */\nconst HEAD_GAP = 0.18; // neck gap as fraction of headR\nconst BODY_PAD_X = 12;\nconst BODY_PAD_Y = 10;\n\nfunction personLayout(bounds: Rect, stroke = DEFAULT_STROKE_WIDTH): PersonLayout {\n const { x, y, width, height } = bounds;\n const inset = stroke + 1;\n // Body spans nearly the full AABB width so long labels widen the torso.\n const bodyHalfW = Math.max(18, width / 2 - inset);\n const headR = Math.max(10, Math.min(22, bodyHalfW * 0.38));\n const headCy = y + headR + Math.max(3, inset);\n const bodyTop = headCy + headR + Math.max(2, headR * HEAD_GAP);\n const bodyBottom = y + height - inset;\n const bodyH = Math.max(bodyBottom - bodyTop, headR * 2.2);\n const bodyRx = Math.min(bodyHalfW, bodyH * 0.42);\n const cx = x + width / 2;\n const content = {\n x: cx - bodyHalfW + BODY_PAD_X,\n y: bodyTop + BODY_PAD_Y,\n width: Math.max(0, bodyHalfW * 2 - BODY_PAD_X * 2),\n height: Math.max(0, bodyBottom - bodyTop - BODY_PAD_Y * 2),\n };\n return {\n cx,\n headR,\n headCy,\n bodyTop,\n bodyBottom,\n bodyHalfW,\n bodyRx,\n content,\n };\n}\n\n/** Port anchors: head (N), torso sides (E/W), feet (S). */\nexport function personPortAnchors(\n bounds: Rect,\n): Record<\"north\" | \"east\" | \"south\" | \"west\", Point> {\n const { cx, headR, headCy, bodyTop, bodyBottom, bodyHalfW, bodyRx } = personLayout(bounds);\n const ry = Math.min(bodyRx, (bodyBottom - bodyTop) / 2);\n const shoulderY = bodyTop + ry + Math.max(2, (bodyBottom - bodyTop - 2 * ry) * 0.12);\n return {\n north: { x: cx, y: headCy - headR },\n east: { x: cx + bodyHalfW, y: shoulderY },\n west: { x: cx - bodyHalfW, y: shoulderY },\n south: { x: cx, y: bodyBottom },\n };\n}\n\n/** Closed silhouette for rays / multi-port projection (head arc + rounded torso). */\nexport function personSilhouettePolygon(bounds: Rect, headSamples = 12): Point[] {\n const { cx, headR, headCy, bodyTop, bodyBottom, bodyHalfW, bodyRx } = personLayout(bounds);\n const pts: Point[] = [];\n for (let i = 0; i <= headSamples; i++) {\n const t = Math.PI - (i / headSamples) * Math.PI;\n pts.push({ x: cx + headR * Math.cos(t), y: headCy - headR * Math.sin(t) });\n }\n const right = cx + bodyHalfW;\n const left = cx - bodyHalfW;\n const ry = Math.min(bodyRx, (bodyBottom - bodyTop) / 2);\n pts.push({ x: right, y: bodyTop + ry });\n pts.push({ x: right, y: bodyBottom - ry });\n pts.push({ x: cx + bodyHalfW - ry * 0.15, y: bodyBottom });\n pts.push({ x: cx, y: bodyBottom });\n pts.push({ x: cx - bodyHalfW + ry * 0.15, y: bodyBottom });\n pts.push({ x: left, y: bodyBottom - ry });\n pts.push({ x: left, y: bodyTop + ry });\n return pts;\n}\n\n/**\n * Person / actor — C4-style head + rounded torso.\n * The torso is the content box: it grows with label/subtitle width.\n */\nexport function personPaths(bounds: Rect): { head: string; body: string } {\n const { cx, headR, headCy, bodyTop, bodyBottom, bodyHalfW, bodyRx } = personLayout(bounds);\n const head = `M ${cx} ${headCy} m ${-headR} 0 a ${headR} ${headR} 0 1 0 ${headR * 2} 0 a ${headR} ${headR} 0 1 0 ${-headR * 2} 0`;\n const left = cx - bodyHalfW;\n const right = cx + bodyHalfW;\n const ry = Math.min(bodyRx, (bodyBottom - bodyTop) / 2);\n const body = [\n `M ${left + ry} ${bodyTop}`,\n `H ${right - ry}`,\n `A ${ry} ${ry} 0 0 1 ${right} ${bodyTop + ry}`,\n `V ${bodyBottom - ry}`,\n `A ${ry} ${ry} 0 0 1 ${right - ry} ${bodyBottom}`,\n `H ${left + ry}`,\n `A ${ry} ${ry} 0 0 1 ${left} ${bodyBottom - ry}`,\n `V ${bodyTop + ry}`,\n `A ${ry} ${ry} 0 0 1 ${left + ry} ${bodyTop}`,\n `Z`,\n ].join(\" \");\n return { head, body };\n}\n\n/** Extra height above the torso content for head + neck (used by measure). */\nexport function personHeadStackHeight(bodyWidth: number): number {\n const bodyHalfW = Math.max(18, bodyWidth / 2 - 2);\n const headR = Math.max(10, Math.min(22, bodyHalfW * 0.38));\n return headR * 2 + Math.max(2, headR * HEAD_GAP) + 6;\n}\n\nexport const personGeometry: ShapeGeometry = {\n id: \"person\",\n defaultSize: { width: 120, height: 140 },\n minSize: { width: 72, height: 96 },\n defaultPadding: { top: 8, right: 12, bottom: 10, left: 12 },\n contentPolicy: {\n align: \"center\",\n maxLabelLines: 2,\n preferExternalLabel: false,\n iconPlacement: \"above\",\n },\n clearSpaceBoost: 4,\n\n getPath(bounds) {\n const { head, body } = personPaths(bounds);\n return {\n d: `${head} ${body}`,\n decorations: [\n { d: head, role: \"head\" },\n { d: body, role: \"body\" },\n ],\n };\n },\n\n getContentBounds(bounds, style = {}) {\n const stroke = style.strokeWidth ?? DEFAULT_STROKE_WIDTH;\n return personLayout(bounds, stroke).content;\n },\n\n getVisualBounds(bounds, style) {\n return defaultVisualBounds(bounds, style);\n },\n\n getLayoutFootprint(bounds, context, style) {\n return defaultLayoutFootprint(personGeometry, bounds, context, style);\n },\n\n getPortPosition(port, bounds) {\n if (port.kind === \"side\" && (port.count ?? 1) <= 1) {\n const anchors = personPortAnchors(bounds);\n const side = port.side;\n if (side === \"north\" || side === \"east\" || side === \"south\" || side === \"west\") {\n return anchors[side];\n }\n }\n return projectSidePortOntoPolygon(\n port,\n bounds,\n personSilhouettePolygon(bounds),\n intersectRayPolygon,\n );\n },\n\n getPortNormal(port, bounds) {\n return defaultPortNormal(port, bounds);\n },\n\n intersectRay(bounds, origin, direction) {\n return intersectRayPolygon(personSilhouettePolygon(bounds), origin, direction);\n },\n\n containsPoint(bounds, point) {\n return pointInPolygon(point, personSilhouettePolygon(bounds));\n },\n};\n\nexport const compartmentedRectangleGeometry: ShapeGeometry = {\n id: \"table\",\n defaultSize: { width: 240, height: 160 },\n minSize: { width: 140, height: 72 },\n defaultPadding: { top: 8, right: 12, bottom: 8, left: 12 },\n contentPolicy: { align: \"start\", maxLabelLines: 1, iconPlacement: \"none\" },\n\n getPath(bounds) {\n const { x, y, width, height } = bounds;\n return {\n d: `M ${x} ${y} H ${x + width} V ${y + height} H ${x} Z`,\n polygon: rectPolygon(bounds),\n };\n },\n\n getContentBounds(bounds, style = {}) {\n const stroke = style.strokeWidth ?? DEFAULT_STROKE_WIDTH;\n return {\n x: bounds.x + stroke + 8,\n y: bounds.y + stroke + 8,\n width: Math.max(0, bounds.width - (stroke + 8) * 2),\n height: Math.max(0, bounds.height - (stroke + 8) * 2),\n };\n },\n\n getVisualBounds(bounds, style) {\n return defaultVisualBounds(bounds, style);\n },\n\n getLayoutFootprint(bounds, context, style) {\n return defaultLayoutFootprint(compartmentedRectangleGeometry, bounds, context, style);\n },\n\n getPortPosition(port, bounds) {\n return defaultSidePortPosition(port, bounds);\n },\n\n getPortNormal(port, bounds) {\n return defaultPortNormal(port, bounds);\n },\n\n intersectRay(bounds, origin, direction) {\n return intersectRayRect(bounds, origin, direction);\n },\n\n containsPoint(bounds, point) {\n return pointInPolygon(point, rectPolygon(bounds));\n },\n};\n\nexport const boundaryGeometry: ShapeGeometry = {\n id: \"boundary\",\n defaultSize: { width: 320, height: 220 },\n minSize: { width: 120, height: 80 },\n defaultPadding: { top: 28, right: 20, bottom: 20, left: 20 },\n contentPolicy: { align: \"start\", maxLabelLines: 1, iconPlacement: \"none\" },\n\n getPath(bounds) {\n return compartmentedRectangleGeometry.getPath(bounds);\n },\n\n getContentBounds(bounds, style) {\n return compartmentedRectangleGeometry.getContentBounds(bounds, style);\n },\n\n getVisualBounds(bounds, style) {\n return compartmentedRectangleGeometry.getVisualBounds(bounds, style);\n },\n\n getLayoutFootprint(bounds, context, style) {\n return defaultLayoutFootprint(boundaryGeometry, bounds, context, style);\n },\n\n getPortPosition(port, bounds, style) {\n return compartmentedRectangleGeometry.getPortPosition(port, bounds, style);\n },\n\n getPortNormal(port, bounds, style) {\n return compartmentedRectangleGeometry.getPortNormal(port, bounds, style);\n },\n\n intersectRay(bounds, origin, direction, style) {\n return compartmentedRectangleGeometry.intersectRay(bounds, origin, direction, style);\n },\n\n containsPoint(bounds, point, style) {\n return compartmentedRectangleGeometry.containsPoint(bounds, point, style);\n },\n};\n","import { rectangleGeometry, roundedRectangleGeometry, pillGeometry } from \"./rectangle.ts\";\nimport { diamondGeometry, diamondPointsString, diamondPolygon } from \"./diamond.ts\";\nimport { hexagonGeometry, hexagonInset, hexagonPointsString, hexagonPolygon } from \"./hexagon.ts\";\nimport {\n cylinderGeometry,\n cylinderPaths,\n cylinderRadii,\n cylinderSilhouettePolygon,\n} from \"./cylinder.ts\";\nimport { queueGeometry, queuePaths, queueRadii, queueSilhouettePolygon } from \"./queue.ts\";\nimport {\n streamCornerRadius,\n streamGeometry,\n streamPartitionPaths,\n streamPartitionYs,\n streamShellPath,\n} from \"./stream.ts\";\nimport { circleGeometry, ellipseGeometry } from \"./ellipse.ts\";\nimport { parallelogramGeometry, trapezoidGeometry, triangleGeometry } from \"./polygons.ts\";\nimport { documentGeometry, foldedDocumentGeometry } from \"./document.ts\";\nimport { cloudGeometry } from \"./cloud.ts\";\nimport {\n boundaryGeometry,\n compartmentedRectangleGeometry,\n personGeometry,\n personHeadStackHeight,\n personPaths,\n personPortAnchors,\n personSilhouettePolygon,\n} from \"./person.ts\";\n\nexport {\n rectangleGeometry,\n roundedRectangleGeometry,\n pillGeometry,\n diamondGeometry,\n diamondPointsString,\n diamondPolygon,\n hexagonGeometry,\n hexagonInset,\n hexagonPointsString,\n hexagonPolygon,\n queueGeometry,\n queuePaths,\n queueRadii,\n queueSilhouettePolygon,\n streamCornerRadius,\n streamGeometry,\n streamPartitionPaths,\n streamPartitionYs,\n streamShellPath,\n cylinderGeometry,\n cylinderPaths,\n cylinderRadii,\n cylinderSilhouettePolygon,\n circleGeometry,\n ellipseGeometry,\n parallelogramGeometry,\n trapezoidGeometry,\n triangleGeometry,\n documentGeometry,\n foldedDocumentGeometry,\n cloudGeometry,\n personGeometry,\n personHeadStackHeight,\n personPaths,\n personPortAnchors,\n personSilhouettePolygon,\n compartmentedRectangleGeometry,\n boundaryGeometry,\n};\n\n/** All built-in geometries keyed by id. */\nexport const BUILTIN_GEOMETRIES = {\n rectangle: rectangleGeometry,\n rounded: roundedRectangleGeometry,\n pill: pillGeometry,\n diamond: diamondGeometry,\n hexagon: hexagonGeometry,\n queue: queueGeometry,\n stream: streamGeometry,\n cylinder: cylinderGeometry,\n circle: circleGeometry,\n ellipse: ellipseGeometry,\n parallelogram: parallelogramGeometry,\n trapezoid: trapezoidGeometry,\n triangle: triangleGeometry,\n document: documentGeometry,\n \"folded-document\": foldedDocumentGeometry,\n cloud: cloudGeometry,\n person: personGeometry,\n table: compartmentedRectangleGeometry,\n boundary: boundaryGeometry,\n} as const;\n\nexport type BuiltinGeometryId = keyof typeof BUILTIN_GEOMETRIES;\n","import {\n BUILTIN_KIND_CATALOG,\n normalizeShapeId as coreNormalizeShapeId,\n type NodeCapability,\n} from \"@kekonic/diagrams-core\";\nimport type { ContentPolicy, Insets, PortStrategy, Size } from \"./types.ts\";\nimport type { ShapeGeometry } from \"./shape-geometry.ts\";\nimport { BUILTIN_GEOMETRIES, type BuiltinGeometryId } from \"./shapes/index.ts\";\n\nexport type RenderDecoration = {\n id: string;\n /** Decoration roles from PathData (rim, fold, markers, …). */\n role: string;\n};\n\nexport type ShapeDefinition = {\n id: string;\n geometry: ShapeGeometry;\n defaultSize: Size;\n minSize: Size;\n defaultPadding: Insets;\n supportedPortStrategies: PortStrategy[];\n contentPolicy: ContentPolicy;\n renderDecorations?: RenderDecoration[];\n};\n\nexport type NodeTypeDefinition = {\n id: string;\n shapeId: string;\n defaultIcon?: string;\n defaultStyle?: Record<string, string>;\n contentTemplate?: string;\n defaultPorts?: Array<{ side: \"north\" | \"east\" | \"south\" | \"west\" }>;\n capabilities?: NodeCapability[];\n subtitle?: string;\n category?: string;\n};\n\nconst customShapes = new Map<string, ShapeDefinition>();\nconst customNodeTypes = new Map<string, NodeTypeDefinition>();\n\nfunction definitionFromGeometry(geometry: ShapeGeometry): ShapeDefinition {\n return {\n id: geometry.id,\n geometry,\n defaultSize: geometry.defaultSize ?? { width: 140, height: 72 },\n minSize: geometry.minSize ?? { width: 40, height: 32 },\n defaultPadding: geometry.defaultPadding ?? {\n top: 14,\n right: 16,\n bottom: 14,\n left: 16,\n },\n supportedPortStrategies: [\"bbox-mid\", \"distributed-sides\", \"perimeter\"],\n contentPolicy: geometry.contentPolicy ?? { align: \"center\", maxLabelLines: 2 },\n };\n}\n\n/** Register a custom shape without changing the renderer core. */\nexport function registerShape(definition: ShapeDefinition): void {\n customShapes.set(definition.id, definition);\n}\n\nexport function unregisterShape(id: string): void {\n customShapes.delete(id);\n}\n\nexport function getShapeDefinition(id: string): ShapeDefinition | undefined {\n const normalized = coreNormalizeShapeId(id);\n const custom = customShapes.get(normalized) ?? customShapes.get(id);\n if (custom) return custom;\n if (normalized in BUILTIN_GEOMETRIES) {\n return definitionFromGeometry(BUILTIN_GEOMETRIES[normalized as BuiltinGeometryId]);\n }\n return undefined;\n}\n\nexport function getShapeGeometry(id: string): ShapeGeometry | undefined {\n return getShapeDefinition(id)?.geometry;\n}\n\n/**\n * Resolve a shape id with fallback.\n * Unknown ids fall back to rounded rectangle (same as historic SVG default).\n */\nexport function resolveShapeGeometry(id: string | undefined | null): ShapeGeometry {\n if (id) {\n const found = getShapeGeometry(coreNormalizeShapeId(id));\n if (found) return found;\n }\n return BUILTIN_GEOMETRIES.rounded;\n}\n\nexport function listRegisteredShapeIds(): string[] {\n const builtins = Object.keys(BUILTIN_GEOMETRIES);\n const customs = [...customShapes.keys()];\n return [...new Set([...builtins, ...customs])];\n}\n\n/** Map authored shape synonyms onto registry ids (delegates to core). */\nexport function normalizeShapeId(shape: string | undefined | null): string {\n return coreNormalizeShapeId(shape);\n}\n\n/** Register or override a semantic node type → shape mapping. */\nexport function registerNodeType(definition: NodeTypeDefinition): void {\n customNodeTypes.set(definition.id, {\n ...definition,\n shapeId: coreNormalizeShapeId(definition.shapeId),\n });\n}\n\nexport function unregisterNodeType(id: string): void {\n customNodeTypes.delete(id);\n}\n\nfunction nodeTypeFromKindCatalog(id: string): NodeTypeDefinition | undefined {\n const defaults = BUILTIN_KIND_CATALOG[id];\n if (!defaults) return undefined;\n return {\n id,\n shapeId: defaults.shape,\n defaultIcon: defaults.icon,\n defaultStyle: defaults.cssVars,\n capabilities: defaults.capabilities,\n subtitle: defaults.subtitle,\n category: defaults.category,\n };\n}\n\nexport function getNodeTypeDefinition(id: string): NodeTypeDefinition | undefined {\n return customNodeTypes.get(id) ?? nodeTypeFromKindCatalog(id);\n}\n\n/**\n * Resolve the geometry for a semantic kind (with optional shape override).\n * Kind defaults come from the DSL catalog; shape overrides win.\n */\nexport function resolveNodeTypeGeometry(\n kind: string,\n shapeOverride?: string | null,\n): ShapeGeometry {\n if (shapeOverride) return resolveShapeGeometry(shapeOverride);\n const nodeType = getNodeTypeDefinition(kind);\n return resolveShapeGeometry(nodeType?.shapeId);\n}\n\nexport function listRegisteredNodeTypeIds(): string[] {\n const builtins = Object.keys(BUILTIN_KIND_CATALOG);\n const customs = [...customNodeTypes.keys()];\n return [...new Set([...builtins, ...customs])].sort();\n}\n","/**\n * Infer geometry size from desired content size using shape-specific safe regions.\n */\n\nimport type { Rect } from \"./types.ts\";\nimport type { ShapeGeometry } from \"./shape-geometry.ts\";\n\nexport type ContentSize = { width: number; height: number };\n\n/**\n * Given a measured content size, find geometry bounds large enough that\n * getContentBounds() can contain it. Uses iterative refinement because\n * content insets are not always linear (cylinder caps, hex chamfers, …).\n */\nexport function geometrySizeForContent(\n geometry: ShapeGeometry,\n content: ContentSize,\n seed?: ContentSize,\n): ContentSize {\n let width = Math.max(content.width, seed?.width ?? content.width, geometry.minSize?.width ?? 0);\n let height = Math.max(\n content.height,\n seed?.height ?? content.height,\n geometry.minSize?.height ?? 0,\n );\n\n for (let i = 0; i < 6; i++) {\n const bounds: Rect = { x: 0, y: 0, width, height };\n const box = geometry.getContentBounds(bounds);\n const needW = box.width > 0 ? content.width / box.width : 1;\n const needH = box.height > 0 ? content.height / box.height : 1;\n const nextW = Math.max(width * needW, geometry.minSize?.width ?? 0);\n const nextH = Math.max(height * needH, geometry.minSize?.height ?? 0);\n if (Math.abs(nextW - width) < 0.5 && Math.abs(nextH - height) < 0.5) {\n width = nextW;\n height = nextH;\n break;\n }\n width = nextW;\n height = nextH;\n }\n\n return { width, height };\n}\n\n/** Relative content box (origin at geometry top-left) for MeasuredNode.contentBox. */\nexport function relativeContentBox(geometry: ShapeGeometry, width: number, height: number): Rect {\n return geometry.getContentBounds({ x: 0, y: 0, width, height });\n}\n","/**\n * Shape-aware perimeter attachment — single source of truth for where edges meet nodes.\n * Layout/routing call this after ELK so visual ports and routed endpoints stay aligned.\n */\n\nimport type { Point, Rect, Vec2 } from \"./types.ts\";\nimport type { ShapeStyle } from \"./types.ts\";\nimport { normalizeShapeId, resolveShapeGeometry } from \"./registry.ts\";\n\nexport type PerimeterAttachInput = {\n shapeId: string | undefined;\n bounds: Rect;\n /** Ray origin (typically the adjacent bend / corridor point, outside the fill). */\n origin: Point;\n /** Direction toward this node (will be normalized). */\n direction: Vec2;\n style?: ShapeStyle;\n};\n\n/** Intersection of a ray with the shape perimeter; falls back via center ray, then center. */\nexport function attachPointOnPerimeter(input: PerimeterAttachInput): Point {\n const geometry = resolveShapeGeometry(normalizeShapeId(input.shapeId));\n const hit = geometry.intersectRay(input.bounds, input.origin, input.direction, input.style);\n if (hit) return hit;\n const cx = input.bounds.x + input.bounds.width / 2;\n const cy = input.bounds.y + input.bounds.height / 2;\n return (\n geometry.intersectRay(input.bounds, { x: cx, y: cy }, input.direction, input.style) ?? {\n x: cx,\n y: cy,\n }\n );\n}\n"],"mappings":";;AA4GA,MAAa,sBAAwD;CACnE,SAAS;CACT,UAAU;CACV,cAAc;AAChB;AAEA,MAAa,sBAAwD;CACnE,SAAS;CACT,UAAU;CACV,cAAc;AAChB;;AAGA,MAAa,yBAAyB;AAEtC,MAAa,uBAAuB;AAEpC,SAAgB,cAAc,GAAmB;CAC/C,OAAO;EAAE,KAAK;EAAG,OAAO;EAAG,QAAQ;EAAG,MAAM;CAAE;AAChD;AAEA,SAAgB,OAAO,SAA0B,WAAW,GAAW;CACrE,OAAO;EACL,KAAK,QAAQ,OAAO;EACpB,OAAO,QAAQ,SAAS;EACxB,QAAQ,QAAQ,UAAU;EAC1B,MAAM,QAAQ,QAAQ;CACxB;AACF;AAEA,SAAgB,UAAU,GAAS,K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;AAGA,SAAgB,mBAAmB,UAAyB,OAAe,QAAsB;CAC/F,OAAO,SAAS,iBAAiB;EAAE,GAAG;EAAG,GAAG;EAAG;EAAO;CAAO,CAAC;AAChE;;;;AC5BA,SAAgB,uBAAuB,OAAoC;CACzE,MAAM,WAAW,qBAAqB,iBAAiB,MAAM,OAAO,CAAC;CACrE,MAAM,MAAM,SAAS,aAAa,MAAM,QAAQ,MAAM,QAAQ,MAAM,WAAW,MAAM,KAAK;CAC1F,IAAI,KAAK,OAAO;CAChB,MAAM,KAAK,MAAM,OAAO,IAAI,MAAM,OAAO,QAAQ;CACjD,MAAM,KAAK,MAAM,OAAO,IAAI,MAAM,OAAO,SAAS;CAClD,OACE,SAAS,aAAa,MAAM,QAAQ;EAAE,GAAG;EAAI,GAAG;CAAG,GAAG,MAAM,WAAW,MAAM,KAAK,KAAK;EACrF,GAAG;EACH,GAAG;CACL;AAEJ"}
package/package.json ADDED
@@ -0,0 +1,43 @@
1
+ {
2
+ "name": "@kekonic/diagrams-geometry",
3
+ "version": "1.0.0-rc.4",
4
+ "description": "Shape geometry, node bounds, ports, and silhouette-aware attachment for KDiagram.",
5
+ "homepage": "https://github.com/kekonic/diagrams#readme",
6
+ "bugs": {
7
+ "url": "https://github.com/kekonic/diagrams/issues"
8
+ },
9
+ "license": "MIT",
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "git+https://github.com/kekonic/diagrams.git",
13
+ "directory": "packages/diagrams-geometry"
14
+ },
15
+ "files": [
16
+ "dist"
17
+ ],
18
+ "type": "module",
19
+ "exports": {
20
+ ".": {
21
+ "types": "./dist/index.d.mts",
22
+ "import": "./dist/index.mjs"
23
+ }
24
+ },
25
+ "publishConfig": {
26
+ "access": "public"
27
+ },
28
+ "dependencies": {
29
+ "@kekonic/diagrams-core": "1.0.0-rc.4"
30
+ },
31
+ "devDependencies": {
32
+ "@types/node": "^26",
33
+ "typescript": "^5",
34
+ "vitest": "^4"
35
+ },
36
+ "engines": {
37
+ "node": ">=22.18.0"
38
+ },
39
+ "scripts": {
40
+ "build": "vp pack",
41
+ "test": "vp test"
42
+ }
43
+ }