@weasel-js/diagram 1.13.0 → 1.14.0

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.
Files changed (35) hide show
  1. package/README.md +122 -17
  2. package/dist/{chunk-Y72FK3Y7.js → chunk-5VNPLOIX.js} +94 -6
  3. package/dist/chunk-5VNPLOIX.js.map +1 -0
  4. package/dist/{chunk-ESFIS7BB.js → chunk-62SMY45E.js} +918 -574
  5. package/dist/chunk-62SMY45E.js.map +1 -0
  6. package/dist/{chunk-FAQXYGMX.js → chunk-TBG6DFB2.js} +3 -3
  7. package/dist/{chunk-FAQXYGMX.js.map → chunk-TBG6DFB2.js.map} +1 -1
  8. package/dist/{chunk-L4H444QI.js → chunk-VB6HUKNG.js} +659 -185
  9. package/dist/chunk-VB6HUKNG.js.map +1 -0
  10. package/dist/{chunk-QU4QZUC6.js → chunk-ZWXM5F4I.js} +141 -39
  11. package/dist/chunk-ZWXM5F4I.js.map +1 -0
  12. package/dist/{dataTypes-DW-MljuN.d.ts → dataTypes-BIkhAOc4.d.ts} +13 -2
  13. package/dist/effect-audio.d.ts +2 -1
  14. package/dist/effect-audio.js +6 -5
  15. package/dist/effect-audio.js.map +1 -1
  16. package/dist/effect.d.ts +46 -16
  17. package/dist/effect.js +257 -102
  18. package/dist/effect.js.map +1 -1
  19. package/dist/icons.table.js +262 -0
  20. package/dist/icons.table.js.map +1 -1
  21. package/dist/icons.table.json +262 -0
  22. package/dist/index.d.ts +491 -167
  23. package/dist/index.js +586 -36
  24. package/dist/index.js.map +1 -1
  25. package/dist/labelTrait-BBjRgxbz.d.ts +44 -0
  26. package/dist/layout.d.ts +4 -3
  27. package/dist/{layout.entry-CQoPNfzA.d.ts → layout.entry-Ca6pVvqo.d.ts} +23 -2
  28. package/dist/layout.js +2 -2
  29. package/dist/{stageTypes-DvnR8cKQ.d.ts → stageTypes-UiO25hcn.d.ts} +7 -0
  30. package/dist/{types-vbW21fHm.d.ts → types-B0n2CNTW.d.ts} +108 -81
  31. package/package.json +11 -9
  32. package/dist/chunk-ESFIS7BB.js.map +0 -1
  33. package/dist/chunk-L4H444QI.js.map +0 -1
  34. package/dist/chunk-QU4QZUC6.js.map +0 -1
  35. package/dist/chunk-Y72FK3Y7.js.map +0 -1
package/dist/index.d.ts CHANGED
@@ -1,16 +1,19 @@
1
- import { g as Port, h as DiagramNodeLike, i as DiagramNodeReader, O as Outline, a as Row, M as MeasureRowText, C as ContainerRole, j as DiagramContainer, k as ContainerHeader, c as DiagramLabel, l as LabelSpot, E as EdgeHop, R as RowTextStyle, m as Bounds$2, e as LayoutOptions, n as LayoutResult, G as Graph, d as LayoutFn, o as GraphSource, p as LayoutPlanner, q as LayoutDirection, L as LayoutPorts, r as LayoutPlan, s as GraphNodeLike, S as StyleField, F as FontField } from './types-vbW21fHm.js';
2
- export { t as BodyFloor, B as BodySpec, u as BuildGraphOptions, v as DEFAULT_GROUP_INSET, w as DEFAULT_HOP_SIZE, x as DEFAULT_NODE_GAP, y as DEFAULT_RANK_GAP, z as DIAGRAM_TRAIT_KEY, D as DiagramGroup, f as DiagramNode, A as DiagramNodeEntry, H as EdgeLabelRoom, I as GraphEdge, J as GraphGroup, K as GraphNode, N as GroupInset, Q as HOPS_DOC_KEY, T as HopsDocValue, U as LABEL_PLACEMENT, V as LayoutAxes, P as PortAnchor, W as PortSite, b as PortSpec, X as RowBox, Y as RowPort, Z as RowPortBox, _ as Slot, $ as anchorOffset, a0 as axesFor, a1 as bodyBox, a2 as bodyOutline, a3 as bodyTrait, a4 as boxForContent, a5 as buildGraph, a6 as canvasMeasure, a7 as contentBox, a8 as createDiagramNodes, a9 as dataKeyReader, aa as diagramContainerOf, ab as diagramLabelOf, ac as diagramNodeOf, ad as expandGroupEdges, ae as graphOrder, af as headerBox, ag as insetOf, ah as isPinned, ai as layoutBody, aj as layoutRowPorts, ak as measureBody, al as outlinePath, am as packAcross, an as packClusters, ao as pinnedSet, ap as planOf, aq as plannerPlan, ar as rankGaps, as as seededOrder, at as settle, au as sizeToBody, av as titleIdOf, aw as translated, ax as untilSettled } from './types-vbW21fHm.js';
3
- import { P as PortsOptions, A as AvoidInput, a as AvoidRouter, b as AvoidOptions, c as AvoidRoutes, d as PlaceLabelsOptions, F as ForceOptions } from './layout.entry-CQoPNfzA.js';
4
- export { e as AVOID_DEFAULTS, f as AvoidEdge, g as AvoidEnd, h as AvoidLabel, i as AvoidObstacle, j as AvoidPort, k as AvoidUpdateOptions, B as BodyNodeSpec, l as BuildBodyOptions, C as COMPASS, D as DEFAULT_PORTS, m as ForceBody, n as ForceRelaxation, o as Forest, L as LabelPlacements, p as LayeredPlan, q as PORT_LABEL_GAP, r as PerimeterPortLabelBox, s as PlaceLabel, t as PlaceLabelsInput, u as PlaceRoute, v as PortLabelPlacement, R as RowNodeData, w as backEdges, x as buildBody, y as chain, z as createAvoidRouter, E as edgeHops, G as footprintNode, H as force, I as forceRelaxation, J as forestOf, K as labelCenter, M as layered, N as layeredPlan, O as marginOf, Q as outlinePolyline, S as placeLabels, T as portLabelBox, U as portLabelsOf, V as portOf, W as portSitesOf, X as portsOf, Y as portsOnOutline, Z as ranksByLength, _ as ranksOf, $ as rayHit, a0 as routeHolds, a1 as tree } from './layout.entry-CQoPNfzA.js';
5
- import { Vec2, ActionDeps, Action, InvocationCtx, TargetPredicate, GestureBinding, Contribution, DerivedDep, Path, SceneRegistry, paintsLayer, PoseDescriptor, ChromeState, CommandFill, CommandStroke, CursorSpec, Affordance, Stroke, Tool, Op, AddNodeSpec, RectPose, NodeId, Scene, LayoutStrategy, ContainerBounds, RenderLayer, TransformFollower, PlacedPage, Bounds as Bounds$3, GatedLayer, NodeShapeEntry, Paint, View, SelectionApi } from '@weasel-js/core';
1
+ import { f as Port, g as DiagramNodeLike, h as DiagramNodeReader, C as ContainerRole, i as DiagramContainer, O as Outline, a as Row, B as BodySpec, M as MeasureRowText, j as ContainerHeader, E as EdgeHop, R as RowTextStyle, k as Bounds$2, d as LayoutOptions, l as LayoutResult, G as Graph, c as LayoutFn, m as GraphSource, n as LayoutPlanner, o as LayoutDirection, L as LayoutPorts, p as LayoutPlan, q as GraphNodeLike, S as StyleField, F as FontField } from './types-B0n2CNTW.js';
2
+ export { r as BodyDivider, s as BodyFloor, t as BodyLayout, u as BuildGraphOptions, v as BuiltinOutline, w as DEFAULT_GROUP_INSET, x as DEFAULT_HOP_SIZE, y as DEFAULT_NODE_GAP, z as DEFAULT_RANK_GAP, A as DIAGRAM_TRAIT_KEY, H as DIVIDER_HEIGHT, D as DiagramGroup, e as DiagramNode, I as DiagramNodeEntry, J as EdgeLabelRoom, K as GraphEdge, N as GraphGroup, Q as GraphNode, T as GroupInset, U as HOPS_DOC_KEY, V as HopsDocValue, W as LayoutAxes, X as OutlineDef, P as PortAnchor, Y as PortSite, b as PortSpec, Z as RowBox, _ as RowPort, $ as RowPortBox, a0 as Slot, a1 as anchorOffset, a2 as axesFor, a3 as bodyBox, a4 as bodyOutline, a5 as bodyTrait, a6 as boxForContent, a7 as buildGraph, a8 as canvasMeasure, a9 as contentBox, aa as createDiagramNodes, ab as dataKeyReader, ac as diagramContainerOf, ad as diagramNodeOf, ae as expandGroupEdges, af as graphOrder, ag as headerBox, ah as insetOf, ai as isPinned, aj as layoutBody, ak as layoutRowPorts, al as measureBody, am as outlineDetail, an as outlinePath, ao as packAcross, ap as packClusters, aq as pinnedSet, ar as planOf, as as plannerPlan, at as rankGaps, au as registerOutline, av as seededOrder, aw as settle, ax as sizeToBody, ay as titleIdOf, az as translated, aA as untilSettled } from './types-B0n2CNTW.js';
3
+ import { P as PortsOptions, A as AvoidInput, a as AvoidRouter, b as AvoidOptions, c as AvoidRoutes, d as PlaceLabelsOptions, F as ForceOptions } from './layout.entry-Ca6pVvqo.js';
4
+ export { e as AVOID_DEFAULTS, f as AvoidEdge, g as AvoidEnd, h as AvoidLabel, i as AvoidObstacle, j as AvoidPort, k as AvoidUpdateOptions, B as BodyNodeSpec, l as BuildBodyOptions, C as COMPASS, D as DEFAULT_PORTS, m as ForceBody, n as ForceRelaxation, o as Forest, L as LabelPlacements, p as LayeredPlan, q as PORT_LABEL_GAP, r as PerimeterPortLabelBox, s as PlaceLabel, t as PlaceLabelsInput, u as PlaceRoute, v as PortLabelPlacement, R as RowNodeData, w as backEdges, x as buildBody, y as chain, z as createAvoidRouter, E as edgeHops, G as footprintNode, H as force, I as forceRelaxation, J as forestOf, K as labelCenter, M as layered, N as layeredPlan, O as marginOf, Q as outlineFromD, S as outlinePolyline, T as placeLabels, U as portLabelBox, V as portLabelsOf, W as portOf, X as portSitesOf, Y as portsOf, Z as portsOnOutline, _ as radial, $ as ranksByLength, a0 as ranksOf, a1 as rayHit, a2 as routeHolds, a3 as subtreeBlocks, a4 as tree } from './layout.entry-Ca6pVvqo.js';
5
+ import { Vec2, ActionDeps, Action, InvocationCtx, TargetPredicate, GestureBinding, Contribution, DerivedDep, Path, SceneRegistry, paintsLayer, PoseDescriptor, ChromeState, CommandFill, CommandStroke, CursorSpec, Affordance, DropVerdict, Stroke, RectPose, DepName, CarryCallbacks, Carry, Tool, AddNodeSpec, NodeId, Scene, Op, MarkerRef, LayoutStrategy, ContainerBounds, RenderLayer, TransformFollower, PoseComposition, PlacedPage, Bounds as Bounds$3, GatedLayer, NodeShapeEntry, Paint, View, SelectionApi } from '@weasel-js/core';
6
+ export { DropRefusal, DropVerdict } from '@weasel-js/core';
6
7
  import { Vec2 as Vec2$1, Path as Path$2 } from '@weasel-js/core/math';
7
- import { c as DataEdge, N as NodeStyle, a as DiagramData, b as DiagramSceneOptions, f as DiagramSpec, g as EdgeEnd, h as DiagramSceneData, i as DiagramEdge, O as OffPageSplit, D as DiagramTheme, E as EdgeStyle, j as DataContainer, d as DataNode } from './dataTypes-DW-MljuN.js';
8
- export { A as ANCHOR_DERIVE_POSE, k as DEFAULT_LANE_SIZE, l as DEFAULT_NODE_STYLE, m as DEFAULT_POOL_ACROSS, n as DIAGRAM_ANCHOR, o as DIAGRAM_GROUP, p as DIAGRAM_ROLES, q as DIAGRAM_THEME_KEY, r as DataGroup, s as DataLane, t as DataMark, u as DiagramAnchor, v as DiagramDerivePose, w as DiagramFont, x as DiagramMark, y as DiagramRole, e as DiagramRouter, z as DiagramTextStyle, B as EDGE_STROKE_WIDTH, G as GROUP_DERIVE_POSE, C as GroupPoseOptions, L as LANE_STROKE_WIDTH, F as NODE_STROKE_WIDTH, H as OffPageTag, I as anchorDerivePose, J as boxAround, K as diagramAnchorOf, M as diagramEdgeOf, P as diagramGroupOf, Q as diagramMarkOf, R as groupDerivePose, S as layoutOwnsPort, T as layoutOwnsRoute, U as layoutWritesRoute, V as markShape, W as offPageTagId, X as offPageTagOf, Y as registerMarkShape, Z as rowTextStyle } from './dataTypes-DW-MljuN.js';
8
+ import * as react from 'react';
9
+ import { PointerEvent as PointerEvent$1, ReactElement, ReactNode } from 'react';
10
+ import { c as DataEdge, N as NodeStyle, a as DiagramData, b as DiagramSceneOptions, f as DiagramSpec, g as EdgeEnd, h as DiagramSceneData, i as DiagramEdge, O as OffPageSplit, D as DiagramTheme, E as EdgeStyle, j as DataContainer, d as DataNode } from './dataTypes-BIkhAOc4.js';
11
+ export { A as ANCHOR_DERIVE_POSE, k as DEFAULT_LANE_SIZE, l as DEFAULT_NODE_STYLE, m as DEFAULT_POOL_ACROSS, n as DIAGRAM_ANCHOR, o as DIAGRAM_GROUP, p as DIAGRAM_ROLES, q as DIAGRAM_THEME_KEY, r as DataGroup, s as DataLane, t as DataMark, u as DiagramAnchor, v as DiagramDerivePose, w as DiagramFont, x as DiagramMark, y as DiagramRole, e as DiagramRouter, z as DiagramTextStyle, B as EDGE_STROKE_WIDTH, G as GROUP_DERIVE_POSE, C as GroupPoseOptions, L as LANE_STROKE_WIDTH, F as NODE_STROKE_WIDTH, H as OffPageTag, I as anchorDerivePose, J as boxAround, K as diagramAnchorOf, M as diagramEdgeOf, P as diagramGroupOf, Q as diagramMarkOf, R as groupDerivePose, S as layoutOwnsPort, T as layoutOwnsRoute, U as layoutWritesRoute, V as markShape, W as offPageTagId, X as offPageTagOf, Y as registerMarkShape, Z as rowTextStyle } from './dataTypes-BIkhAOc4.js';
9
12
  import { IconRef } from '@weasel-js/icons';
13
+ import { D as DiagramLabel, L as LabelSpot } from './labelTrait-BBjRgxbz.js';
14
+ export { a as LABEL_PLACEMENT, d as diagramLabelOf } from './labelTrait-BBjRgxbz.js';
10
15
  import { Path as Path$1, Placement } from '@weasel-js/geom';
11
16
  import { EasingFn } from '@weasel-js/animator';
12
- import * as react from 'react';
13
- import { ReactNode } from 'react';
14
17
  import '@weasel-js/simulation';
15
18
 
16
19
  /** The scene node id `diagramScene` gives an edge: its `id` when set, else one
@@ -105,6 +108,10 @@ interface ReorderOptions {
105
108
  * overrides stay after a commit until the scene next changes.
106
109
  */
107
110
  show?: 'bar' | 'slide';
111
+ /** Where a drag of `item` stays a reorder, in world units. A move outside it hands the drag off (`'pass'` from
112
+ * `OngoingHandle.onMove`) to whatever else would have taken the press, a move for one, and drops this
113
+ * drag's preview. `null`, or the default, keeps every move a reorder. */
114
+ region?: (deps: ActionDeps, item: ReorderItem) => Box$3 | null;
108
115
  /** Whether a drop may land. The bar draws refused, or nothing slides, where not. Default: every drop. */
109
116
  canDrop?: (move: ReorderMove) => boolean;
110
117
  /** Called once, on release over a gap that is not the item's own and that `canDrop` allows. */
@@ -307,8 +314,16 @@ declare function offersPorts(p: {
307
314
  }, view?: Parameters<typeof paintsLayer>[0]): boolean;
308
315
  /** Where the affordance gets its participants. A thunk rather than a scene so
309
316
  * the geometry is testable without one, and so a consumer whose participants
310
- * come from somewhere else needs no adapter. */
311
- type ParticipantSource<TPose> = () => Iterable<ParticipantPose<TPose>>;
317
+ * come from somewhere else needs no adapter.
318
+ *
319
+ * With `generation`, the ports are read once per generation, so a frame paints
320
+ * them without reading any, and a press is tested against an index of them
321
+ * rather than every one: it must answer differently whenever the thunk can yield
322
+ * something different (`sceneParticipants` answers the scene's version and
323
+ * its overrides' generation). */
324
+ type ParticipantSource<TPose> = (() => Iterable<ParticipantPose<TPose>>) & {
325
+ generation?: () => readonly unknown[];
326
+ };
312
327
  /** What a press on a port hands the action that picks up the drag. Arrives as
313
328
  * `InvocationCtx.drag.affordance.payload`. */
314
329
  interface PortScratch {
@@ -360,6 +375,14 @@ declare function portScratchOf(hit: {
360
375
  */
361
376
  declare function createPortAffordance<TPose>(participants: ParticipantSource<TPose>, opts?: PortAffordanceOptions<TPose>): Affordance;
362
377
 
378
+ /**
379
+ * What a connect may run from and land on: a port, or a participant's body.
380
+ *
381
+ * A body end is Visio's dynamic glue. It names the shape and not a port, and
382
+ * the edge resolves to whichever port faces the other end each time it is
383
+ * routed (`resolveEnd`), so it follows the shape around as things move.
384
+ */
385
+
363
386
  /** An end on a participant's body rather than on one of its ports. `point` is
364
387
  * where the pointer was, in world coordinates. */
365
388
  interface BodyEnd {
@@ -418,9 +441,12 @@ interface MovingEnd {
418
441
  edge: string;
419
442
  end: 'from' | 'to';
420
443
  }
421
- /** Whether an edge may run from `from` to `to`. `moving` is the end being
422
- * dragged when the edge already exists, and absent for a new connect. */
423
- type CanConnect = (from: ConnectEnd, to: ConnectEnd, moving?: MovingEnd) => boolean;
444
+ /** Whether an edge may run from `from` to `to`: `true`, `false` for a silent
445
+ * no, where the end never snaps, or a refusal, which the end snaps to and is
446
+ * drawn refused with the reason beside the pointer, and where a release
447
+ * lands nothing. `moving` is the end being dragged when the edge already
448
+ * exists, and absent for a new connect. */
449
+ type CanConnect = (from: ConnectEnd, to: ConnectEnd, moving?: MovingEnd) => DropVerdict;
424
450
  /** The edge a finished connect describes. Each end is a resolved port, or a
425
451
  * body whose port the edge picks each time it is routed. */
426
452
  interface PendingEdge {
@@ -519,6 +545,68 @@ declare function commitEdgeToScene(edge: PendingEdge, ctx: InvocationCtx, opts?:
519
545
  */
520
546
  declare function createConnectAction<TPose>(opts: ConnectActionOptions<TPose>): Action;
521
547
 
548
+ /**
549
+ * Where an item carried in from outside the canvas would land: the shape or
550
+ * container under the pointer, the container that would hold it, and its
551
+ * place among that container's members.
552
+ */
553
+
554
+ /** Where a carried item is over. */
555
+ interface ItemDropTarget {
556
+ /** The shape or the container it would be dropped on, or `null` for the bare canvas. */
557
+ target: string | null;
558
+ /** The container or lane that would hold it: the target when that is one,
559
+ * else the one around the pointer. `null` at the top level. */
560
+ container: string | null;
561
+ /** Its place among `container`'s members, as they stand along the
562
+ * container's `reorder` axis, else in reading order: top to bottom, then
563
+ * left to right. `null` with no container. */
564
+ index: number | null;
565
+ /** The pointer, in world units. */
566
+ at: Vec2;
567
+ }
568
+
569
+ /**
570
+ * An item carried in from a list outside the canvas — a palette the host
571
+ * renders — and dropped onto a shape, a container, or the bare canvas. The
572
+ * host makes an element a source with {@link dragItemProps}; the canvas hears
573
+ * the carry, draws where it would land, and reports the drop. Nothing is
574
+ * written: the host adds what the item stands for to its data.
575
+ */
576
+
577
+ /** The carry type an item travels as. */
578
+ declare const DIAGRAM_ITEM_CARRY = "weasel-diagram/item";
579
+ /** The action a carried item's drop runs. */
580
+ declare const ITEM_DROP_ACTION_ID = "diagram.dropItem";
581
+ /** An item dropped on the diagram: the host's own value, and where it landed. */
582
+ interface ItemDrop extends ItemDropTarget {
583
+ item: unknown;
584
+ }
585
+ /** Whether `item` may land where `target` says. */
586
+ type CanDropItem = (item: unknown, target: ItemDropTarget) => DropVerdict;
587
+ /** Carry `item` from the press `down` over the page; a diagram the pointer is
588
+ * released over reports it to `onDropItem`. */
589
+ declare function startItemDrag(down: PointerEvent | PointerEvent$1, item: unknown, cb?: CarryCallbacks): Carry;
590
+ /** Props that make an element a source of `item`: a press with the main
591
+ * button carries it. Give the element `touch-action: none` for touch. */
592
+ declare function dragItemProps(item: unknown, cb?: CarryCallbacks): {
593
+ onPointerDown: (e: PointerEvent$1) => void;
594
+ };
595
+ /** Options for {@link createItemDropAction}. */
596
+ interface ItemDropOptions {
597
+ participants: ParticipantSource<RectPose>;
598
+ /** Default: every drop lands. */
599
+ canDrop?: CanDropItem;
600
+ /** Deps `report` reads beyond the scene, such as `insert` and `snap` to add the item itself. */
601
+ requires?: readonly DepName[];
602
+ /** Hears a drop that lands, with the canvas's deps as the carry came over it: `scene` and whatever `requires` names. */
603
+ report: (drop: ItemDrop, deps: ActionDeps) => void;
604
+ }
605
+ /** The ongoing action a carried item runs from coming over the canvas to its release. */
606
+ declare function createItemDropAction(opts: ItemDropOptions): Action;
607
+ /** The item drop as a contribution, to pass as `ambient`. */
608
+ declare function itemDropContribution(opts: ItemDropOptions): Contribution;
609
+
522
610
  /** The connector tool's id. */
523
611
  declare const CONNECTOR_TOOL_ID = "diagram.connector";
524
612
  /** The action the connector tool binds a drag to. */
@@ -530,59 +618,6 @@ declare function connectorTool<TPose>(opts: ConnectActionOptions<TPose>): Tool;
530
618
  * when the bag holding them does. */
531
619
  declare function useConnectorTool<TPose>(opts: ConnectActionOptions<TPose>): Tool;
532
620
 
533
- /**
534
- * Stencils: the shapes a palette offers, as data, and what one becomes when it
535
- * is drawn — a `buildBody` body whose rows are ordinary text nodes.
536
- */
537
-
538
- /** One shape a palette offers. `size` is what a click places; `rows` default
539
- * to one empty label, so the body has a text node to type into. `icon` is its
540
- * tool's glyph in a palette. */
541
- interface DiagramStencil {
542
- id: string;
543
- label: string;
544
- outline: Outline;
545
- size: {
546
- width: number;
547
- height: number;
548
- };
549
- rows?: readonly Row[];
550
- icon?: IconRef;
551
- }
552
- /** The basic flowchart symbols. */
553
- declare const FLOWCHART_STENCILS: readonly DiagramStencil[];
554
- /** The insert kind a stencil's tool passes to the `insert` dep. */
555
- declare const stencilKind: (id: string) => string;
556
- /** The stencil id an insert kind names, or `null` for a kind that is no stencil's. */
557
- declare function stencilIdOf(kind: string): string | null;
558
- type Bounds$1 = {
559
- x: number;
560
- y: number;
561
- width: number;
562
- height: number;
563
- };
564
- /**
565
- * The ops that insert `stencil` at `bounds`: its container first, then one
566
- * text node per text row. Applied as one batch, they are one undo entry.
567
- * `style` colors the body and its text; default `diagramScene`'s node style.
568
- * `font` is the face its text rows fall back on; default 12px sans-serif.
569
- * `parent` is the container the body goes in; default the top level.
570
- */
571
- declare function stencilBuild<TLayer extends string>(stencil: DiagramStencil, bounds: Bounds$1, opts: {
572
- layer: TLayer;
573
- newId: () => string;
574
- measure?: MeasureRowText;
575
- style?: NodeStyle;
576
- font?: {
577
- fontFamily: string;
578
- fontSize: number;
579
- };
580
- parent?: string | null;
581
- }): {
582
- id: string;
583
- ops: Op[];
584
- };
585
-
586
621
  /**
587
622
  * The node specs of a region — a container, a pool, or a lane — and its title,
588
623
  * which a stencil drawn on the canvas and a `DiagramData` container both build
@@ -617,6 +652,8 @@ interface RegionOptions<TLayer extends string> {
617
652
  style?: NodeStyle;
618
653
  /** Marks a region whose box is fitted to its members each time it is built from data. */
619
654
  fitted?: boolean;
655
+ /** A container's reorder axis. */
656
+ reorder?: 'x' | 'y';
620
657
  /** The title's family. Default sans-serif. */
621
658
  fontFamily?: string;
622
659
  }
@@ -625,6 +662,11 @@ declare function regionSpecs<TLayer extends string>(role: ContainerRole, axis: '
625
662
  /** The lane specs a new pool at `at` starts with. */
626
663
  declare function firstLanes<TLayer extends string>(poolId: string, axis: 'x' | 'y', at: RectPose, opts: ContainerBuildOptions<TLayer>): RegionSpec<TLayer>[];
627
664
 
665
+ /** A titled box, and pools of rows and of columns. */
666
+ declare const CONTAINER_STENCILS: readonly ContainerStencil[];
667
+ /** The containers as a stencil group. */
668
+ declare const CONTAINERS_GROUP: StencilGroup;
669
+
628
670
  /**
629
671
  * The container stencils a palette offers, what one becomes when it is drawn,
630
672
  * and the edits on one: adding a lane to a pool, and releasing a container's
@@ -644,37 +686,172 @@ interface ContainerStencil {
644
686
  /** The glyph a palette draws on its button. */
645
687
  icon?: IconRef;
646
688
  }
647
- /** A titled box, and pools of rows and of columns. */
648
- declare const CONTAINER_STENCILS: readonly ContainerStencil[];
649
- type Bounds = {
689
+
690
+ type Bounds$1 = {
650
691
  x: number;
651
692
  y: number;
652
693
  width: number;
653
694
  height: number;
654
695
  };
655
- type AnyScene$3 = Scene<unknown, string, unknown>;
696
+ type AnyScene$4 = Scene<unknown, string, unknown>;
656
697
  /** The ops that insert `stencil` at `bounds`: the region and its title, and a
657
698
  * pool's first lanes. Applied as one batch, they are one undo entry. */
658
- declare function containerBuild<TLayer extends string>(stencil: ContainerStencil, bounds: Bounds, opts: ContainerBuildOptions<TLayer>): {
699
+ declare function containerBuild<TLayer extends string>(stencil: ContainerStencil, bounds: Bounds$1, opts: ContainerBuildOptions<TLayer>): {
659
700
  id: string;
660
701
  ops: Op[];
661
702
  };
662
703
  /** The axis a pool stacks its lanes along, read off its header. */
663
704
  declare const poolAxisOf: (pool: DiagramContainer) => "x" | "y";
664
705
  /** The lanes of `poolId`, in the order they stack. */
665
- declare function lanesOf(scene: AnyScene$3, poolId: string): NodeId[];
706
+ declare function lanesOf(scene: AnyScene$4, poolId: string): NodeId[];
666
707
  /**
667
708
  * Add a lane to `poolId` before the lane at `index`, or at the end of the
668
709
  * stack, as one history entry. The pool grows to hold it. Returns the new
669
710
  * lane's id, or null when `poolId` is not a pool.
670
711
  */
671
- declare function addLane(scene: AnyScene$3, poolId: string, index?: number, style?: NodeStyle): string | null;
712
+ declare function addLane(scene: AnyScene$4, poolId: string, index?: number, style?: NodeStyle): string | null;
672
713
  /**
673
714
  * Remove container `id` and keep its members, which take its place in its
674
715
  * parent, as one history entry. A pool's members are its lanes' members, and
675
716
  * a lane's go past its pool. Connectors on what is removed go with it.
676
717
  */
677
- declare function releaseMembers(scene: AnyScene$3, id: string): void;
718
+ declare function releaseMembers(scene: AnyScene$4, id: string): void;
719
+
720
+ /**
721
+ * The commands that set the selected connectors' router: Around shapes,
722
+ * Orthogonal, Straight, and Curved. Leaving `avoid` drops the stored route;
723
+ * joining it leaves the route to the edit pass `useAvoidRouting` installs,
724
+ * which routes the connectors in the same history entry.
725
+ */
726
+
727
+ /** The router commands' ids, by router key. */
728
+ declare const SET_ROUTER_ACTION_IDS: {
729
+ readonly avoid: "diagram.router.avoid";
730
+ readonly orthogonal: "diagram.router.orthogonal";
731
+ readonly straight: "diagram.router.straight";
732
+ readonly bezier: "diagram.router.bezier";
733
+ };
734
+ /** Each shipped router's name in a menu. */
735
+ declare const ROUTER_LABELS: Readonly<Record<keyof typeof SET_ROUTER_ACTION_IDS, string>>;
736
+ /** One connector's router changed. */
737
+ interface RouterEdit {
738
+ edgeId: string;
739
+ router: string;
740
+ }
741
+ /** Options for {@link createSetRouterAction}. */
742
+ interface SetRouterOptions<TPose> {
743
+ participants: ParticipantSource<TPose>;
744
+ /** The selected ids; the connectors among them are set. */
745
+ selected: () => readonly string[];
746
+ /** Defaults to {@link commitRouterToScene} against `deps.scene`. */
747
+ commit?: (edit: RouterEdit, ctx: InvocationCtx) => void;
748
+ }
749
+ /** `data` with its edge trait on `router`, its stored route dropped. */
750
+ declare function withRouter(data: unknown, trait: DiagramEdge, router: string): Record<string, unknown>;
751
+ /** The default commit: the connector's `data.diagram.router`, written to the scene. */
752
+ declare function commitRouterToScene(edit: RouterEdit, ctx: InvocationCtx): void;
753
+ /** The command that puts the selected connectors on `router`, in one history
754
+ * entry. Active while every selected connector is on it already. */
755
+ declare function createSetRouterAction<TPose>(router: keyof typeof SET_ROUTER_ACTION_IDS, opts: SetRouterOptions<TPose>): Action;
756
+ /** One command per shipped router, in menu order. */
757
+ declare function routerActions<TPose>(opts: SetRouterOptions<TPose>): Action[];
758
+
759
+ /** A shipped connector router, by key. */
760
+ type RouterName = keyof typeof SET_ROUTER_ACTION_IDS;
761
+ /** A named list of stencils: the flowchart symbols, the containers. */
762
+ interface StencilGroup {
763
+ id: string;
764
+ label: string;
765
+ stencils: readonly (DiagramStencil | ContainerStencil)[];
766
+ }
767
+ /** What a new connector is drawn with. An unset field falls to the theme. */
768
+ interface DiagramTypeEdge {
769
+ router?: RouterName;
770
+ markerStart?: MarkerRef | null;
771
+ markerEnd?: MarkerRef | null;
772
+ }
773
+ /** A kind of diagram: the stencil groups a new one opens with, how its connectors start out, and the
774
+ * layout Auto layout runs. */
775
+ interface DiagramType {
776
+ id: string;
777
+ label: string;
778
+ icon?: IconRef;
779
+ /** Group ids, in Shapes-panel order, that a new chart of this type opens with. */
780
+ groups: readonly string[];
781
+ edge?: DiagramTypeEdge;
782
+ /** A key of `LAYOUTS`. Unset: no auto layout. */
783
+ layout?: string;
784
+ }
785
+ /** What {@link DIAGRAM_TYPE_DOC_KEY} holds: the diagram's type, and the groups its Shapes panel shows. */
786
+ interface DiagramTypeDoc {
787
+ type: string;
788
+ groups: readonly string[];
789
+ }
790
+ /** The document value a diagram's type and shown stencil groups are saved under. */
791
+ declare const DIAGRAM_TYPE_DOC_KEY = "diagram:type";
792
+
793
+ /** The basic flowchart symbols. */
794
+ declare const FLOWCHART_STENCILS: readonly DiagramStencil[];
795
+ /** The flowchart symbols as a stencil group. */
796
+ declare const FLOWCHART_GROUP: StencilGroup;
797
+
798
+ /**
799
+ * Stencils: the shapes a palette offers, as data, and what one becomes when it
800
+ * is drawn — a `buildBody` body whose rows are ordinary text nodes.
801
+ */
802
+
803
+ /** One shape a palette offers. `size` is what a click places; `rows` default
804
+ * to one empty label, so the body has a text node to type into. `icon` is its
805
+ * tool's glyph in a palette. */
806
+ interface DiagramStencil {
807
+ id: string;
808
+ label: string;
809
+ outline: Outline;
810
+ size: {
811
+ width: number;
812
+ height: number;
813
+ };
814
+ rows?: readonly Row[];
815
+ icon?: IconRef;
816
+ /** Laid over the style the body is drawn in: a BPMN end event's heavier ring. */
817
+ style?: Partial<NodeStyle>;
818
+ /** How its body stacks its rows, as `BodySpec`'s fields of the same names. */
819
+ padding?: number;
820
+ gap?: number;
821
+ verticalAlign?: BodySpec['verticalAlign'];
822
+ }
823
+
824
+ /** The insert kind a stencil's tool passes to the `insert` dep. */
825
+ declare const stencilKind: (id: string) => string;
826
+ /** The stencil id an insert kind names, or `null` for a kind that is no stencil's. */
827
+ declare function stencilIdOf(kind: string): string | null;
828
+ type Bounds = {
829
+ x: number;
830
+ y: number;
831
+ width: number;
832
+ height: number;
833
+ };
834
+ /**
835
+ * The ops that insert `stencil` at `bounds`: its container first, then one
836
+ * text node per text row. Applied as one batch, they are one undo entry.
837
+ * `style` colors the body and its text; default `diagramScene`'s node style.
838
+ * `font` is the face its text rows fall back on; default 12px sans-serif.
839
+ * `parent` is the container the body goes in; default the top level.
840
+ */
841
+ declare function stencilBuild<TLayer extends string>(stencil: DiagramStencil, bounds: Bounds, opts: {
842
+ layer: TLayer;
843
+ newId: () => string;
844
+ measure?: MeasureRowText;
845
+ style?: NodeStyle;
846
+ font?: {
847
+ fontFamily: string;
848
+ fontSize: number;
849
+ };
850
+ parent?: string | null;
851
+ }): {
852
+ id: string;
853
+ ops: Op[];
854
+ };
678
855
 
679
856
  /** The tool that draws `stencil`, a shape's or a container's: its id is the stencil's insert kind. */
680
857
  declare function stencilTool(stencil: Pick<DiagramStencil, 'id' | 'label' | 'icon'>): Tool;
@@ -710,6 +887,20 @@ interface StencilInsertOptions {
710
887
  */
711
888
  declare function useStencilInsert(stencils: readonly DiagramStencil[], opts?: StencilInsertOptions): void;
712
889
 
890
+ /** Props for {@link StencilGhost}. */
891
+ interface StencilGhostProps {
892
+ stencil: DiagramStencil | ContainerStencil;
893
+ /** What it is drawn in: the style its body is inserted with. A stencil's own `style` is laid over it. */
894
+ style: NodeStyle;
895
+ /** Screen pixels per world unit, so it is drawn at the size it lands at under the view's zoom. Default 1. */
896
+ scale?: number;
897
+ }
898
+ /**
899
+ * `stencil`'s outline as an SVG, the size a click would place it at, in `style`: what a drag from a palette shows
900
+ * on its way to the canvas. A container draws its frame. Holds no text.
901
+ */
902
+ declare function StencilGhost({ stencil, style, scale }: StencilGhostProps): ReactElement;
903
+
713
904
  type Box$2 = {
714
905
  x: number;
715
906
  y: number;
@@ -802,17 +993,21 @@ type SceneLike = {
802
993
  id: string;
803
994
  kind: 'mark' | 'group';
804
995
  data: unknown;
996
+ parent?: string | null;
805
997
  } | undefined;
806
998
  };
999
+ /** Whether the nodes `ids` may move into the container or lane `container`. */
1000
+ type CanReparent = (ids: readonly string[], container: string) => DropVerdict;
807
1001
  /**
808
1002
  * The `canDropInto` dep for a diagram scene. A container or a lane takes
809
1003
  * shapes and other containers, a pool takes only lanes, and a lane goes
810
1004
  * nowhere but a pool. A stencil body, an edge, or a label takes nothing, and
811
1005
  * edges and labels are never dropped in: they stay where they are, drawn from
812
1006
  * what they are attached to. Any other container — a plain group — takes
813
- * anything but a lane.
1007
+ * anything but a lane. `canReparent` is asked about a move the rules allow
1008
+ * into a container the nodes are not already in, and has the last word.
814
1009
  */
815
- declare function diagramCanDropInto(scene: SceneLike): (parent: string, ids: readonly string[]) => boolean;
1010
+ declare function diagramCanDropInto(scene: SceneLike, canReparent?: CanReparent): (parent: string, ids: readonly string[]) => DropVerdict;
816
1011
  /** What {@link diagramDropParentAt} walks. */
817
1012
  interface DropParentScene {
818
1013
  readonly roots: readonly string[];
@@ -823,6 +1018,10 @@ interface DropParentScene {
823
1018
  data: unknown;
824
1019
  pose: unknown;
825
1020
  } | undefined;
1021
+ /** How a child's stored pose joins its parent's. Absent, poses are world poses. */
1022
+ readonly composition?: {
1023
+ compose(parent: never, child: never): unknown;
1024
+ };
826
1025
  }
827
1026
  /**
828
1027
  * The innermost container or lane whose body holds `point`, that would admit
@@ -834,13 +1033,6 @@ declare function diagramDropParentAt(scene: DropParentScene, point: {
834
1033
  y: number;
835
1034
  }, role: ContainerRole | null): string | null;
836
1035
 
837
- /**
838
- * The lane affordances on every pool: the boundary after each lane, which a
839
- * drag moves to resize that lane, and the add-lane button past the end of the
840
- * stack. Built the way the edge-end handles are: regions with a `null`
841
- * `targetId`, composed into a layer whose id is the kind a press reports.
842
- */
843
-
844
1036
  /** The layer id the lane affordances are composed into. */
845
1037
  declare const LANE_LAYER_ID = "diagram-lanes";
846
1038
  /** The affordance kind a press on a lane affordance reports. */
@@ -856,19 +1048,22 @@ interface LaneScratch {
856
1048
  declare function laneScratchOf(hit: {
857
1049
  payload?: unknown;
858
1050
  } | null | undefined): LaneScratch | null;
859
- type AnyScene$2 = Scene<unknown, string, unknown>;
860
- /** A pool as the affordances see it: its box, the axis it stacks along, and its lanes in order. */
1051
+ type AnyScene$3 = Scene<unknown, string, unknown>;
1052
+ /** A pool as the affordances see it: its box, the axis it stacks along, and its lanes in order.
1053
+ * `pose` is as stored, `at` where it draws. */
861
1054
  interface PoolLanes {
862
1055
  id: string;
863
1056
  axis: 'x' | 'y';
864
1057
  pose: RectPose;
1058
+ at: RectPose;
865
1059
  lanes: {
866
1060
  id: string;
867
1061
  pose: RectPose;
1062
+ at: RectPose;
868
1063
  }[];
869
1064
  }
870
1065
  /** Every pool in `scene` that is drawn and not locked. */
871
- declare function poolsOf(scene: AnyScene$2): PoolLanes[];
1066
+ declare function poolsOf(scene: AnyScene$3): PoolLanes[];
872
1067
  /** Options for {@link laneLayer}. */
873
1068
  interface LaneLayerOptions {
874
1069
  /** Screen-pixel reach of a boundary either side of it. Default 4. */
@@ -879,9 +1074,9 @@ interface LaneLayerOptions {
879
1074
  stroke?: CommandStroke;
880
1075
  }
881
1076
  /** The affordance: a boundary region after each lane of each pool, and an add-lane button per pool. */
882
- declare function createLaneAffordance(scene: AnyScene$2, opts?: LaneLayerOptions): Affordance;
1077
+ declare function createLaneAffordance(scene: AnyScene$3, opts?: LaneLayerOptions): Affordance;
883
1078
  /** The composed layer, for `CanvasExtensionApi.registerLayer`. */
884
- declare function laneLayer(scene: AnyScene$2, opts?: LaneLayerOptions): RenderLayer<unknown>;
1079
+ declare function laneLayer(scene: AnyScene$3, opts?: LaneLayerOptions): RenderLayer<unknown>;
885
1080
 
886
1081
  /**
887
1082
  * The container actions: dragging the boundary after a lane resizes it, the
@@ -896,7 +1091,7 @@ declare const LANE_RESIZE_ACTION_ID = "diagram.resizeLane";
896
1091
  declare const ADD_LANE_ACTION_ID = "diagram.addLane";
897
1092
  /** The command that removes the selected containers and keeps their members. */
898
1093
  declare const RELEASE_MEMBERS_ACTION_ID = "diagram.releaseMembers";
899
- type AnyScene$1 = Scene<unknown, string, unknown>;
1094
+ type AnyScene$2 = Scene<unknown, string, unknown>;
900
1095
  /** A lane resized: its new size along its pool's stack. */
901
1096
  interface LaneResize {
902
1097
  poolId: string;
@@ -908,10 +1103,10 @@ interface LaneResize {
908
1103
  declare function commitLaneResizeToScene(resize: LaneResize, ctx: InvocationCtx): void;
909
1104
  /** Where everything stands with the lane at `index` of `pool` resized to `size`: the
910
1105
  * lane, its title, the pool and its title, and every later lane with what it holds. */
911
- declare function laneResizeFrame(scene: AnyScene$1, pool: PoolLanes, index: number, size: number): Map<string, RectPose>;
1106
+ declare function laneResizeFrame(scene: AnyScene$2, pool: PoolLanes, index: number, size: number): Map<string, RectPose>;
912
1107
  /** Options for the container actions. */
913
1108
  interface LaneActionOptions extends LaneLayerOptions {
914
- scene: AnyScene$1;
1109
+ scene: AnyScene$2;
915
1110
  /** The selected ids, which Release members reads. */
916
1111
  selected?: () => readonly string[];
917
1112
  /** Defaults to {@link commitLaneResizeToScene}. */
@@ -1305,45 +1500,6 @@ declare function createRemoveWaypointAction<TPose>(opts: RouteEditOptions<TPose>
1305
1500
  * in one history entry when they commit to the scene. */
1306
1501
  declare function createResetRouteAction<TPose>(opts: RouteEditOptions<TPose>): Action;
1307
1502
 
1308
- /**
1309
- * The commands that set the selected connectors' router: Around shapes,
1310
- * Orthogonal, Straight, and Curved. Leaving `avoid` drops the stored route;
1311
- * joining it leaves the route to the edit pass `useAvoidRouting` installs,
1312
- * which routes the connectors in the same history entry.
1313
- */
1314
-
1315
- /** The router commands' ids, by router key. */
1316
- declare const SET_ROUTER_ACTION_IDS: {
1317
- readonly avoid: "diagram.router.avoid";
1318
- readonly orthogonal: "diagram.router.orthogonal";
1319
- readonly straight: "diagram.router.straight";
1320
- readonly bezier: "diagram.router.bezier";
1321
- };
1322
- /** Each shipped router's name in a menu. */
1323
- declare const ROUTER_LABELS: Readonly<Record<keyof typeof SET_ROUTER_ACTION_IDS, string>>;
1324
- /** One connector's router changed. */
1325
- interface RouterEdit {
1326
- edgeId: string;
1327
- router: string;
1328
- }
1329
- /** Options for {@link createSetRouterAction}. */
1330
- interface SetRouterOptions<TPose> {
1331
- participants: ParticipantSource<TPose>;
1332
- /** The selected ids; the connectors among them are set. */
1333
- selected: () => readonly string[];
1334
- /** Defaults to {@link commitRouterToScene} against `deps.scene`. */
1335
- commit?: (edit: RouterEdit, ctx: InvocationCtx) => void;
1336
- }
1337
- /** `data` with its edge trait on `router`, its stored route dropped. */
1338
- declare function withRouter(data: unknown, trait: DiagramEdge, router: string): Record<string, unknown>;
1339
- /** The default commit: the connector's `data.diagram.router`, written to the scene. */
1340
- declare function commitRouterToScene(edit: RouterEdit, ctx: InvocationCtx): void;
1341
- /** The command that puts the selected connectors on `router`, in one history
1342
- * entry. Active while every selected connector is on it already. */
1343
- declare function createSetRouterAction<TPose>(router: keyof typeof SET_ROUTER_ACTION_IDS, opts: SetRouterOptions<TPose>): Action;
1344
- /** One command per shipped router, in menu order. */
1345
- declare function routerActions<TPose>(opts: SetRouterOptions<TPose>): Action[];
1346
-
1347
1503
  /**
1348
1504
  * Waypoints ride along with a move: when a whole-node transform carries both
1349
1505
  * ends of an edge by the same offset, the edge's waypoints go with them.
@@ -1435,12 +1591,24 @@ declare const DIAGRAM_PASS_ORDER: {
1435
1591
  */
1436
1592
  declare function useAvoidRouting<TPose>(scene: Scene<unknown, string, TPose>, opts?: AvoidRoutingOptions<TPose>): void;
1437
1593
 
1594
+ /**
1595
+ * Routes for a data-backed diagram: the specs `diagramScene` builds, with
1596
+ * every edge routed around the shapes. The routes derive from the data, so
1597
+ * they live in the specs and are never reported back to the host.
1598
+ */
1599
+
1600
+ /** How {@link createSpecRouter} routes: the router's own options, and the composition the specs' poses are stored
1601
+ * under, which must be the one `diagramScene` was given. Default {@link RIGID_POSE_COMPOSITION}, as there. */
1602
+ interface SpecRouterOptions extends AvoidOptions {
1603
+ composition?: PoseComposition<RectPose>;
1604
+ }
1438
1605
  /**
1439
1606
  * A function from specs to the same specs with each edge on `avoid` and
1440
1607
  * holding its route. It holds one router across calls, so each call reroutes
1441
- * only the edges the change since the last one disturbed.
1608
+ * only the edges the change since the last one disturbed. Shapes and ports are
1609
+ * read where they draw, each pose folded through the containers above it.
1442
1610
  */
1443
- declare function createSpecRouter(options?: AvoidOptions): (specs: readonly DiagramSpec[]) => DiagramSpec[];
1611
+ declare function createSpecRouter(options?: SpecRouterOptions): (specs: readonly DiagramSpec[]) => DiagramSpec[];
1444
1612
 
1445
1613
  /**
1446
1614
  * A connector's route drawn with its hops: each one a half circle in place of
@@ -1568,26 +1736,28 @@ declare function diagramEdgeEnds<TPose>(opts: ReconnectOptions<TPose> & Omit<Edg
1568
1736
  };
1569
1737
 
1570
1738
  /**
1571
- * Reordering a group marked `reorder`: a member dragged along that axis among
1739
+ * Reordering a group or container marked `reorder`: a member dragged along that axis among
1572
1740
  * its siblings, which slide into the places they would take, or the selected
1573
- * one stepped with Alt and an arrow key. Nothing is written: the host hears
1741
+ * one stepped with Alt and an arrow key. A container's member dragged out of its box goes to the move instead. Nothing is written: the host hears
1574
1742
  * the new order, writes it to its data, and layout keeps it.
1575
1743
  */
1576
1744
 
1577
1745
  /** Alt and an arrow key: the selected member one place along. */
1578
1746
  declare const STEP_REORDER_ACTION_ID = "diagram.stepReorder";
1579
- /** A reorderable group's members in their new order. */
1747
+ /** A reorderable group's or container's members in their new order. */
1580
1748
  interface ReorderChange {
1581
- group: string;
1749
+ /** The group's or the container's id. */
1750
+ parent: string;
1582
1751
  order: readonly string[];
1583
1752
  }
1584
- /** The members of the reorderable group a press at `at` carries one of, each
1585
- * with everything drawn with it, or `null` off any such group. */
1753
+ /** The members of the reorderable group or container a press at `at` carries
1754
+ * one of, each with everything drawn with it, or `null` off any. */
1586
1755
  declare function groupReorderSlots(deps: ActionDeps, at: Vec2): ReorderSlots | null;
1587
1756
  /** Steps the selected node's member one place toward the start (`-1`) or the end (`1`). */
1588
1757
  declare function createStepReorderAction(report: (change: ReorderChange) => void): Action;
1589
1758
  /** Everything `DiagramView` installs for `onReorder`: the reorder drag,
1590
- * sliding, pressed on a node's body, and the step action. */
1759
+ * sliding, pressed on a node's body, and the step action. A container's member
1760
+ * dragged out of the container's box is handed to the move. */
1591
1761
  declare function groupReorderContribution(report: (change: ReorderChange) => void): Contribution;
1592
1762
 
1593
1763
  /** How a self-edge with no ports named leaves its node and comes back. */
@@ -1692,8 +1862,9 @@ interface DraggableLabel {
1692
1862
  }
1693
1863
  /** Every editable label in `scene` whose edge derives a path, in render order. */
1694
1864
  declare function draggableLabels(scene: Scene<unknown, string, unknown>): Iterable<DraggableLabel>;
1865
+ type AnyScene$1 = Scene<unknown, string, unknown>;
1695
1866
  /** The topmost draggable label whose box holds `at`, as its press scratch. */
1696
- declare function labelUnder(scene: Scene<unknown, string, unknown>, at: Vec2$1): LabelScratch | null;
1867
+ declare function labelUnder(scene: AnyScene$1, at: Vec2$1): LabelScratch | null;
1697
1868
  /** The composed layer, for `CanvasExtensionApi.registerLayer`. Register it
1698
1869
  * before the port layer: the last registered is hit first, and a port or a
1699
1870
  * route handle must win over a label beside it. */
@@ -2278,13 +2449,14 @@ interface ApplyLayoutOptions<TPose> {
2278
2449
  * pose can be a path or anything else a consumer wired, and only its own
2279
2450
  * descriptor knows how to move one.
2280
2451
  *
2281
- * A participant that is a container takes its whole subtree along. `setPose`
2282
- * does not cascade — poses are absolute.
2452
+ * A participant that is a container takes what its frame holds along.
2283
2453
  */
2284
2454
  declare function applyLayout<TPose>(scene: Scene<unknown, string, TPose>, result: LayoutResult, opts?: ApplyLayoutOptions<TPose>): number;
2285
2455
  /**
2286
2456
  * The poses a layout result implies, without writing any of them: each moved
2287
- * node translated to its new top-left, and its subtree translated with it.
2457
+ * node translated so its box starts where the layout put it, in world, and
2458
+ * stored in its container's frame. What a moved container's frame holds rides
2459
+ * it; a node under an envelope moved with it is written too.
2288
2460
  *
2289
2461
  * The translation is measured from the node's document pose, which a live run
2290
2462
  * in flight never changes, so a frame's answer does not depend on the frame
@@ -2310,6 +2482,17 @@ interface LayoutActionOptions<TPose> {
2310
2482
  read?: DiagramNodeReader;
2311
2483
  geometry?: PoseDescriptor<TPose>;
2312
2484
  }
2485
+ /** Options for {@link layoutDiagram}. */
2486
+ interface LayoutDiagramOptions<TPose> {
2487
+ layout?: LayoutOptions;
2488
+ read?: DiagramNodeReader;
2489
+ geometry?: PoseDescriptor<TPose>;
2490
+ /** The undo entry's name. Default `'Layout'`. */
2491
+ label?: string;
2492
+ }
2493
+ /** Builds the graph `source` reads, runs `algorithm` on it — a key of {@link LAYOUTS} or a layout of
2494
+ * the caller's own — and writes the moves and routes as one undo entry. Returns how many nodes moved. */
2495
+ declare function layoutDiagram<TPose>(scene: Scene<unknown, string, TPose>, source: GraphSource<TPose>, algorithm: string | LayoutFn, opts?: LayoutDiagramOptions<TPose>): number;
2313
2496
  /**
2314
2497
  * `diagram.layout` — rebuild the graph, run a layout, write the result.
2315
2498
  */
@@ -2340,7 +2523,10 @@ interface ParticipantScene<TPose> {
2340
2523
  read(id: string): {
2341
2524
  pose?: TPose;
2342
2525
  } | undefined;
2526
+ getGeneration?(): number;
2343
2527
  };
2528
+ /** With `overrides.getGeneration`, what lets the port layer index the ports. */
2529
+ getVersion?(): number;
2344
2530
  get(id: string): unknown;
2345
2531
  childrenOf(id: string): readonly string[];
2346
2532
  }
@@ -2351,15 +2537,17 @@ interface ParticipantScene<TPose> {
2351
2537
  * marks keep ports off such a node; the graph reads past them, so a hidden
2352
2538
  * node is still laid out.
2353
2539
  *
2354
- * `effectivePose`, not `node.pose`: an override is what a gesture is currently
2540
+ * Its effective pose, in world: an override is what a gesture is currently
2355
2541
  * showing, and a port that answers from the document pose while its node is
2356
- * mid-drag sits somewhere the user can see the node is not.
2542
+ * mid-drag, or from its pose in its container's frame, sits somewhere the
2543
+ * user can see the node is not.
2357
2544
  *
2358
- * One source answers both the ports and the graph.
2545
+ * One source answers both the ports and the graph. A scene with versions
2546
+ * gives it a `generation`, so the port layer hit-tests through an index.
2359
2547
  */
2360
- declare function sceneParticipants<TPose>(scene: ParticipantScene<TPose>): () => Iterable<ParticipantPose<TPose> & {
2548
+ declare function sceneParticipants<TPose>(scene: ParticipantScene<TPose>): ParticipantSource<TPose> & (() => Iterable<ParticipantPose<TPose> & {
2361
2549
  node: GraphNodeLike;
2362
- }>;
2550
+ }>);
2363
2551
  /**
2364
2552
  * The composed layer, ready for `CanvasExtensionApi.registerLayer` — the only
2365
2553
  * attach route that is hit-tested. Handing this to `SceneCanvas`'s `layers`
@@ -2428,11 +2616,6 @@ interface DiagramOverlay {
2428
2616
  content: ReactNode;
2429
2617
  }
2430
2618
 
2431
- /**
2432
- * The regions half of `DiagramView`'s sync: where each container, pool, and
2433
- * lane stands, and the region edits a change to that is reported as.
2434
- */
2435
-
2436
2619
  type Box = {
2437
2620
  x: number;
2438
2621
  y: number;
@@ -2559,12 +2742,18 @@ interface DiagramViewProps {
2559
2742
  * then needs a size of its own; a resize of the parent is a size change. */
2560
2743
  width?: number;
2561
2744
  height?: number;
2562
- /** A participant id, or null for none. */
2563
- selected?: string | null;
2564
- /** Reports what each click leaves picked, `null` for none — a re-click on the
2745
+ /** `'multiple'` lets Shift-click add a node, group or edge to what is
2746
+ * picked, or take it out. Default `'single'`: every click picks one. */
2747
+ selectionMode?: 'single' | 'multiple';
2748
+ /** A participant id, a set of them, or null for none. One id under
2749
+ * `'multiple'` agrees with a pick of several whose latest it is, so handing
2750
+ * back what `onSelect` reports as `id` leaves the rest picked. */
2751
+ selected?: string | null | readonly string[];
2752
+ /** Reports what each click leaves picked: its latest pick, `null` for none,
2753
+ * and every id picked, in the order they were — a re-click on the
2565
2754
  * picked node reports it again. The canvas keeps the pick even if
2566
2755
  * `selected` does not follow it; only a change to `selected` is pushed in. */
2567
- onSelect?: (id: string | null) => void;
2756
+ onSelect?: (id: string | null, ids: readonly string[]) => void;
2568
2757
  /** Reports the node, group or edge the pointer comes to be over, and `null`
2569
2758
  * once it is over none or leaves the canvas. An edge answers only while
2570
2759
  * edges are picked (`pickEdges`). */
@@ -2610,7 +2799,9 @@ interface DiagramViewProps {
2610
2799
  /** Set to let a member of a group marked `reorder` be dragged along that
2611
2800
  * axis among its siblings, or the selected one stepped with Alt and an
2612
2801
  * arrow key. Reports the members' new order and moves nothing: write it to
2613
- * the group's `members`, which layered layout keeps. */
2802
+ * the group's `members`, which layered layout keeps. A container's member
2803
+ * dragged out of the container's box becomes a move, as `onMove` reports
2804
+ * one, and lands wherever it is dropped. */
2614
2805
  onReorder?: (change: ReorderChange) => void;
2615
2806
  /** Set to report a double-click on an edge, for its label to be edited. */
2616
2807
  onEditLabel?: (edge: string) => void;
@@ -2642,8 +2833,27 @@ interface DiagramViewProps {
2642
2833
  * is set. */
2643
2834
  enableKeybindings?: boolean;
2644
2835
  /** Which ports may be joined. Default: a port may not join itself, and two
2645
- * typed ports must share a type. */
2836
+ * typed ports must share a type. A refusal (`{ refuse }`) draws the port
2837
+ * refused with its reason beside the pointer; a connect or reconnect
2838
+ * released there reports nothing. */
2646
2839
  canConnect?: CanConnect;
2840
+ /** Whether a drag may move nodes into a container or lane they are not in,
2841
+ * asked only of a move the diagram's own rules allow (a pool takes lanes, a
2842
+ * container takes shapes and containers). `false` passes the container
2843
+ * over, as if the drop were not on it; a refusal draws it refused with
2844
+ * its reason beside the pointer, and a release there moves nothing. */
2845
+ canReparent?: CanReparent;
2846
+ /** Set to take items carried in from outside the canvas, from an element
2847
+ * made a source with `dragItemProps(item)`. While one is over the canvas,
2848
+ * the shape or container it would land on is outlined, and in a container
2849
+ * marked `reorder`, a bar marks its place. Reports the item, what it was
2850
+ * dropped on, the container that would hold it, and its index among that
2851
+ * container's members; adds nothing. */
2852
+ onDropItem?: (drop: ItemDrop) => void;
2853
+ /** Whether a carried item may land where it is over. A refusal draws the
2854
+ * target refused with its reason beside the pointer, and a release there
2855
+ * reports nothing. Default: everywhere. */
2856
+ canDropItem?: CanDropItem;
2647
2857
  /** How ports look and answer the pointer, and the router a connect's
2648
2858
  * preview draws with. */
2649
2859
  portOptions?: Pick<DiagramContributionOptions<RectPose>, 'fill' | 'stroke' | 'shape' | 'sizePx' | 'hitRadiusPx' | 'cursor' | 'shows' | 'showsPort' | 'snapRadius' | 'router'>;
@@ -2663,6 +2873,14 @@ interface DiagramViewProps {
2663
2873
  /** Space kept clear around the diagram by the fit, in CSS pixels.
2664
2874
  * Default 16. */
2665
2875
  fitPadding?: number;
2876
+ /** Keep the view on the diagram: panning and zooming stop where the view would show more than
2877
+ * the diagram and `fitPadding` world units around it, and a view showing more than all of it
2878
+ * centers it. Unset, the plane pans without end. */
2879
+ bounded?: boolean;
2880
+ /** When new specs refit a view still on its last fit: only once they run past what it shows
2881
+ * (`'overflow'`, the default), or on every change (`'always'`), so the diagram stays fitted
2882
+ * as it grows and shrinks. A view panned or zoomed off its fit is never refitted. */
2883
+ refit?: 'overflow' | 'always';
2666
2884
  /** What the canvas paints behind the diagram. Unset, it is transparent. */
2667
2885
  background?: Paint;
2668
2886
  /** Sheets painted under the diagram, one filled rect per page; `diagramPages(data)`
@@ -2727,9 +2945,12 @@ declare const DiagramView: react.ForwardRefExoticComponent<DiagramViewProps & re
2727
2945
 
2728
2946
  /** Keeps a canvas selection and a controlled `selected` prop in step: a prop
2729
2947
  * change is pushed in, and every click reports what the selection holds after
2730
- * it — a re-click on the picked node included. Wire the returned handler to
2731
- * `<SceneCanvas onClick>`. */
2732
- declare function useMirroredSelection(selection: Pick<SelectionApi, 'get' | 'set'>, selected: string | null | undefined, onSelect: ((id: string | null) => void) | undefined): () => void;
2948
+ * it — a re-click on the picked node included — as its latest pick and as
2949
+ * every id it holds, in the order they were picked. `selected` is one id, a set
2950
+ * of them, or null for none; one id agrees with a selection whose latest pick
2951
+ * it is, so reporting a pick back does not drop the rest of a set. Wire the
2952
+ * returned handler to `<SceneCanvas onClick>`. */
2953
+ declare function useMirroredSelection(selection: Pick<SelectionApi, 'get' | 'set'>, selected: string | null | readonly string[] | undefined, onSelect: ((id: string | null, ids: readonly string[]) => void) | undefined): () => void;
2733
2954
 
2734
2955
  /** The themes that ship, by id, in the order a picker lists them. `paper` is ink on white;
2735
2956
  * `night` is the effect looks' own dark colors. */
@@ -2816,9 +3037,9 @@ declare const rendererMeasure: MeasureRowText;
2816
3037
 
2817
3038
  /**
2818
3039
  * Laying a built body out again once its text changes size. A body whose
2819
- * rows are all text records how it stacks them (`DiagramNode.body`), and each
2820
- * text row records its place (`bodyRow`), so the rows can be read back from
2821
- * the scene and handed to the same layout `buildBody` used.
3040
+ * rows are all text or dividers records how it stacks them (`DiagramNode.body`),
3041
+ * and each text row records its place (`bodyRow`), so the rows can be read
3042
+ * back from the scene and handed to the same layout `buildBody` used.
2822
3043
  */
2823
3044
 
2824
3045
  /** A scene as {@link relayoutBodies} reads and writes it. */
@@ -2829,6 +3050,7 @@ interface RelayoutScene {
2829
3050
  } | undefined;
2830
3051
  childrenOf(id: never): readonly string[];
2831
3052
  setPose(id: never, pose: never): void;
3053
+ update(id: never, patch: never): void;
2832
3054
  }
2833
3055
  /**
2834
3056
  * Lays each body among `ids` out again from its text rows as they are now:
@@ -2943,4 +3165,106 @@ declare function parseDiagramTheme(json: string): {
2943
3165
  errors: string[];
2944
3166
  };
2945
3167
 
2946
- export { ADD_LANE_ACTION_ID, type ApplyDiagramThemeOptions, type ApplyLayoutOptions, AvoidInput, AvoidOptions, AvoidRouter, AvoidRoutes, type AvoidRouting, type AvoidRoutingOptions, type AvoidSceneOptions, type BodyEnd, type BodyHit, Bounds$2 as Bounds, CONNECTOR_ACTION_ID, CONNECTOR_TOOL_ID, CONNECT_ACTION_ID, CONTAINER_HEADER, CONTAINER_LAYOUTS, CONTAINER_STENCILS, type CanConnect, type ConnectActionOptions, type ConnectEnd, type ConnectView, type ContainerBuildOptions, type ContainerEdit, ContainerHeader, type ContainerLayoutOptions, ContainerRole, type ContainerStencil, DEFAULT_EDGE_STROKE, DEFAULT_EDGE_STYLE, DEFAULT_GROUP_STYLE, DIAGRAM_CONTAINER_LAYOUT, DIAGRAM_EDGE, DIAGRAM_LABEL, DIAGRAM_LANE_COLUMNS_LAYOUT, DIAGRAM_LANE_ROWS_LAYOUT, DIAGRAM_OFF_PAGE_TAG, DIAGRAM_PASS_ORDER, DIAGRAM_POOL_COLUMNS_LAYOUT, DIAGRAM_POOL_ROWS_LAYOUT, DIAGRAM_THEMES, DIAGRAM_THEME_EXTENSION, DataContainer, DataEdge, DataNode, type DeleteReport, DiagramContainer, type DiagramContributionOptions, DiagramData, DiagramEdge, DiagramLabel, type DiagramLayout, DiagramNodeLike, DiagramNodeReader, type DiagramOverlay, DiagramSceneData, DiagramSceneOptions, type DiagramShapeOptions, DiagramSpec, type DiagramStencil, type DiagramStyleEditOptions, type DiagramStyleState, DiagramTheme, DiagramView, type DiagramViewApi, type DiagramViewProps, type DraggableLabel, type DropParentScene, EASED_LAYOUTS, EDGE_DERIVE_PATH, EDGE_END_AFFORDANCE_KIND, EDGE_END_LAYER_ID, EDIT_CONTAINER_TITLE_ACTION_ID, EDIT_EDGE_LABEL_ACTION_ID, type EasedProducerOptions, EdgeEnd, type EdgeEndAffordanceOptions, type EdgeEndScratch, EdgeHop, type EdgeLabelOptions, type EdgeRoute, type EdgeRouteOptions, type EdgeRouteState, EdgeStyle, type EditEdgeLabelOptions, type EndChange, FLOWCHART_STENCILS, FOLLOW_OFF_PAGE_ACTION_ID, type FollowOffPageOptions, FontField, ForceOptions, type ForceProducerOptions, GRAB_EDGE_END_ACTION_ID, GRAB_LABEL_ACTION_ID, GRAB_PORT_ACTION_ID, GRAB_WAYPOINT_ACTION_ID, Graph, GraphNodeLike, GraphSource, type Hops, type HopsOptions, LABEL_DERIVE_POSE, LABEL_DRAG_AFFORDANCE_KIND, LABEL_DRAG_LAYER_ID, LANE_AFFORDANCE_KIND, LANE_HEADER_SIZE, LANE_LAYER_ID, LANE_RESIZE_ACTION_ID, LAYOUTS, LAYOUT_ACTION_ID, type LabelDragOptions, type LabelEdit, type LabelMove, type LabelPlacement, type LabelPlacementOptions, type LabelPoseOptions, type LabelScratch, LabelSpot, type LaneActionOptions, type LaneLayerOptions, type LaneResize, type LaneScratch, type LaneStackOptions, type LayeredRoute, type LayeredRouteInput, type LayoutActionOptions, LayoutDirection, LayoutFn, LayoutOptions, LayoutPlan, LayoutPlanner, LayoutPorts, LayoutResult, type LayoutRoutes, type LiveLayout, type LiveLayoutCtx, type LiveLayoutFrame, type LiveLayoutProducer, MIN_LANE_SIZE, MOVE_LABEL_ACTION_ID, MeasureRowText, type MovingEnd, type NodeMove, type NodeResize, NodeStyle, OFF_PAGE_STUB, OFF_PAGE_TAG_DERIVE_POSE, OFF_PAGE_TAG_PADDING, type OffPageEdgeInput, type OffPageMarkerOptions, OffPageSplit, type OffPageSplitInput, type OffPageTagLook, type OffPageTarget, Outline, POOL_HEADER_SIZE, PORT_AFFORDANCE_KIND, PORT_LAYER_ID, type ParticipantPose, type ParticipantScene, type ParticipantSource, type PendingEdge, PlaceLabelsOptions, type PoolLanes, Port, type PortAffordanceOptions, type PortScratch, PortsOptions, RECONNECT_ACTION_ID, RELEASE_MEMBERS_ACTION_ID, REMOVE_WAYPOINT_ACTION_ID, REORDER_ACTION_ID, RESET_LABEL_ACTION_ID, RESET_ROUTE_ACTION_ID, ROUTERS, ROUTER_LABELS, ROUTE_EDIT_ACTION_ID, type ReconnectChange, type ReconnectOptions, type RegionOptions, type RegionSpec, type RelayoutScene, type ReorderChange, type ReorderGap, type ReorderItem, type ReorderMove, type ReorderOptions, type ReorderSlots, type ResolvedRoute, type RouteChange, type RouteEdge, type RouteEdit, type RouteEditOptions, type RouteHandle, type RouteRequest, type RoutedScene, type Router, type RouterEdit, Row, RowTextStyle, SELECT_LABEL_EDGE_ACTION_ID, SET_HOPS_ACTION_ID, SET_ROUTER_ACTION_IDS, STEP_REORDER_ACTION_ID, type SelfLoop, type SetHopsOptions, type SetRouterOptions, type StencilInsertOptions, StyleField, type StyledRegion, type ThemePath, type ThemedNode, type ThemedScene, type UseLiveLayoutOptions, WAYPOINT_AFFORDANCE_KIND, WAYPOINT_HIT_PX, WAYPOINT_LAYER_ID, type WaypointAffordanceOptions, type WaypointScratch, addLane, addThemeRole, applyDiagramTheme, applyLayout, avoid, avoidSceneInput, bezier, bodyAt, commitEdgeToScene, commitLabelToScene, commitLaneResizeToScene, commitReconnectToScene, commitRouteToScene, commitRouterToScene, connectBinding, connectorTool, containerBuild, containerShape, createAddLaneAction, createConnectAction, createDiagramContribution, createEdgeEndAffordance, createFollowOffPageAction, createLabelDragAction, createLaneAffordance, createLaneResizeAction, createLayoutAction, createPortAffordance, createReconnectAction, createReleaseMembersAction, createRemoveWaypointAction, createReorderAction, createResetLabelAction, createResetRouteAction, createRouteEditAction, createSetHopsAction, createSetRouterAction, createSpecHops, createSpecLabelPlacer, createSpecRouter, createStepReorderAction, createWaypointAffordance, dataEdgeStyle, dataNodeStyle, dataOffPage, dataRegionStyle, defaultCanConnect, diagramCanDropInto, diagramContainerLayout, diagramContainers, diagramDropParentAt, diagramEdgeEnds, diagramLabelDrag, diagramLayoutOf, diagramOffPage, diagramPages, diagramPorts, diagramResizable, diagramScene, diagramShape, diagramStyleOf, diagramThemeFrom, diagramThemeFromTokens, diagramThemeOf, diagramWaypoints, documentBoundsOf, dragSegment, dragVertex, draggableLabels, dropEmptyEdgeLabel, easedProducer, edgeDerivePath, edgeEndLayer, edgeEndScratchOf, edgeIdOf, edgeLabelSpec, edgeRouter, editContainerTitleAction, editContainerTitleBinding, editEdgeLabelAction, editEdgeLabelBinding, editableTheme, firstLanes, followOffPageBinding, forceProducer, forkTheme, grabPortAction, grabPortBindings, groupReorderContribution, groupReorderSlots, headerIdOf, hopFollower, insertWaypoint, installAvoidRouting, installHops, installLabelPlacement, installOffPageMarkers, isBodyEnd, isBodyOrRegion, isDiagramBody, isShippedTheme, labelDerivePose, labelDragLayer, labelScratchOf, labelSize, labelUnder, laneHeader, laneLayer, laneResizeFrame, laneScratchOf, laneStackLayout, lanesOf, layeredRoutes, layoutPoses, movedLabelData, nextOffPageRef, offPageFarText, offPageOps, offPageSplits, offPageTagData, offPageTagDerivePose, offPageTagLook, offPageTagSize, offPageTagSpec, offPageTagSpecs, offPageTagText, offPageTargetOf, orthogonal, parseDiagramTheme, pinSegment, poolAxisOf, poolHeader, poolsOf, portLayer, portScratchOf, reconnectBinding, regionHeaderAt, regionSpecs, registerDiagramShape, relayoutBodies, releaseMembers, removeSegment, removeThemeRole, removeWaypoint, renameThemeRole, rendererMeasure, reorderBinding, reorderContribution, resolveEnd, roleEdgeStyle, roleStyle, routeDataOps, routeHandles, routeStateOf, routeWrites, routedData, routerActions, routesOf, sceneParticipants, segmentAxis, selfLoop, sequenceSlots, setDiagramColor, setDiagramFontSize, setDiagramStyle, setThemeValue, simplifyStops, stackedLanes, stencilBuild, stencilIdOf, stencilKind, stencilTool, straight, subpathOf, themeDocValue, themeEdgeStroke, themeFont, themeLabelFont, themeLabelStyle, themeRoles, themeToJson, themeValue, themeWrites, titlePose, unpinSegment, useAvoidRouting, useConnectorTool, useHops, useLabelPlacement, useLiveLayout, useMirroredSelection, useOffPageMarkers, useStencilInsert, useStencilTool, waypointFollower, waypointLayer, waypointScratchOf, withDiagramRegistry, withHops, withRouter };
3168
+ /** The stencil groups this package ships, by id, in menu order. */
3169
+ declare const STENCIL_GROUPS: Readonly<Record<string, StencilGroup>>;
3170
+ /** The flowchart: its symbols and containers, connectors as the theme draws them, no auto layout. */
3171
+ declare const FLOWCHART_TYPE: DiagramType;
3172
+ /** A network: devices joined by plain straight links. */
3173
+ declare const NETWORK_TYPE: DiagramType;
3174
+ /** A BPMN process: sequence flows routed square, ending in an arrow. */
3175
+ declare const BPMN_TYPE: DiagramType;
3176
+ /** An org chart: cards joined by unmarked orthogonal connectors, laid out top-down as a tree. */
3177
+ declare const ORG_CHART_TYPE: DiagramType;
3178
+ /** A mind map: topics joined by unmarked curves, the central topic in the middle of a radial layout. */
3179
+ declare const MIND_MAP_TYPE: DiagramType;
3180
+ /** A UML class diagram: classes and their kin, connectors routed orthogonally to an open arrowhead. */
3181
+ declare const UML_CLASS_TYPE: DiagramType;
3182
+ /** An entity-relationship diagram: connectors routed orthogonally, one at the start and many at the end. */
3183
+ declare const ERD_TYPE: DiagramType;
3184
+ /** The diagram types this package ships, by id, in menu order. */
3185
+ declare const DIAGRAM_TYPES: Readonly<Record<string, DiagramType>>;
3186
+ /** Whether `stencil` is a container's rather than a shape's. */
3187
+ declare const isContainerStencil: (stencil: DiagramStencil | ContainerStencil) => stencil is ContainerStencil;
3188
+ /** Every stencil of the groups `ids` names, in their order. An id `catalog` lacks adds nothing. */
3189
+ declare function groupStencils(ids: readonly string[], catalog?: Readonly<Record<string, StencilGroup>>): (DiagramStencil | ContainerStencil)[];
3190
+ /** The ids of `group`'s stencils. */
3191
+ declare const groupStencilIds: (group: StencilGroup) => string[];
3192
+
3193
+ /** A scene as the type reader and writers use it. */
3194
+ interface DiagramTypeScene {
3195
+ doc: {
3196
+ get(key: string): unknown;
3197
+ set(key: string, value: unknown): void;
3198
+ };
3199
+ batch<T>(label: string, fn: () => T): T;
3200
+ }
3201
+ type Types = Readonly<Record<string, DiagramType>>;
3202
+ /** Options for the diagram type writers. */
3203
+ interface DiagramTypeWriteOptions {
3204
+ /** The catalog type ids resolve in. Default {@link DIAGRAM_TYPES}. */
3205
+ types?: Types;
3206
+ label?: string;
3207
+ }
3208
+ /** A new document's value for type `id`: it, and its groups. Flowchart for an id `types` lacks. */
3209
+ declare function diagramTypeDocValue(id: string, types?: Types): DiagramTypeDoc;
3210
+ /** The type and shown groups a scene holds. A scene holding none, or naming a type `types` lacks,
3211
+ * reads as flowchart with its groups. */
3212
+ declare function diagramTypeDocOf(scene: Pick<DiagramTypeScene, 'doc'>, types?: Types): DiagramTypeDoc;
3213
+ /** The type a scene holds, as {@link diagramTypeDocOf} reads it. */
3214
+ declare function diagramTypeOf(scene: Pick<DiagramTypeScene, 'doc'>, types?: Types): DiagramType;
3215
+ /** Makes the scene type `id`, its shown groups replaced by the type's. */
3216
+ declare function setDiagramType(scene: DiagramTypeScene, id: string, opts?: DiagramTypeWriteOptions): void;
3217
+ /** Shows stencil group `id` after the ones shown. Nothing when it is shown already. */
3218
+ declare function addStencilGroup(scene: DiagramTypeScene, id: string, opts?: DiagramTypeWriteOptions): void;
3219
+ /** Stops showing stencil group `id`. Nothing when it is not shown. */
3220
+ declare function removeStencilGroup(scene: DiagramTypeScene, id: string, opts?: DiagramTypeWriteOptions): void;
3221
+
3222
+ /** The stroke a new connector in a diagram of `type` starts with: the theme's, with each end marker
3223
+ * the type sets put over it. A marker set to `null` draws no marker on that end. */
3224
+ declare function diagramTypeEdgeStroke(theme: DiagramTheme, type: DiagramType): Stroke;
3225
+
3226
+ /** Network devices, each labeled under its drawing. A database and a cloud wear the general figures, with their labels inside. */
3227
+ declare const NETWORK_STENCILS: readonly DiagramStencil[];
3228
+ /** The network devices as a stencil group. */
3229
+ declare const NETWORK_GROUP: StencilGroup;
3230
+
3231
+ /** BPMN's events, activities, gateways, and data. Pools come from the containers group. */
3232
+ declare const BPMN_STENCILS: readonly DiagramStencil[];
3233
+ /** The BPMN symbols as a stencil group. */
3234
+ declare const BPMN_GROUP: StencilGroup;
3235
+
3236
+ /** People and the departments they sit in. */
3237
+ declare const ORG_STENCILS: readonly DiagramStencil[];
3238
+ /** The org chart cards as a stencil group. */
3239
+ declare const ORG_GROUP: StencilGroup;
3240
+
3241
+ /** A mind map's topics, heaviest first, and a note to float beside them. */
3242
+ declare const MIND_MAP_STENCILS: readonly DiagramStencil[];
3243
+ /** The mind map topics as a stencil group. */
3244
+ declare const MIND_MAP_GROUP: StencilGroup;
3245
+
3246
+ /**
3247
+ * A resized body's rows go with it: a whole-node transform that changes a
3248
+ * built body's size stacks its rows again inside the new box, the way
3249
+ * `layoutBody` would, from the row heights its trait records.
3250
+ */
3251
+
3252
+ /**
3253
+ * The transform follower that lays a resized body's rows out again, for the
3254
+ * `transformFollowers` dep (`useTransformFollower`). A body saved before its
3255
+ * row heights were recorded is left as it is. `geometry` reads a pose's
3256
+ * bounds; default `AUTO_POSE_DESCRIPTOR`.
3257
+ */
3258
+ declare function bodyFollower<TPose>(scene: Scene<unknown, string, TPose>, geometry?: PoseDescriptor<TPose>): TransformFollower;
3259
+
3260
+ /** UML's class-diagram and use-case symbols. */
3261
+ declare const UML_STENCILS: readonly DiagramStencil[];
3262
+ /** The UML symbols as a stencil group. */
3263
+ declare const UML_GROUP: StencilGroup;
3264
+
3265
+ /** An entity-relationship diagram's symbols: a crow's-foot entity table beside Chen's shapes. */
3266
+ declare const ERD_STENCILS: readonly DiagramStencil[];
3267
+ /** The ERD symbols as a stencil group. */
3268
+ declare const ERD_GROUP: StencilGroup;
3269
+
3270
+ export { ADD_LANE_ACTION_ID, type ApplyDiagramThemeOptions, type ApplyLayoutOptions, AvoidInput, AvoidOptions, AvoidRouter, AvoidRoutes, type AvoidRouting, type AvoidRoutingOptions, type AvoidSceneOptions, BPMN_GROUP, BPMN_STENCILS, BPMN_TYPE, type BodyEnd, type BodyHit, BodySpec, Bounds$2 as Bounds, CONNECTOR_ACTION_ID, CONNECTOR_TOOL_ID, CONNECT_ACTION_ID, CONTAINERS_GROUP, CONTAINER_HEADER, CONTAINER_LAYOUTS, CONTAINER_STENCILS, type CanConnect, type CanDropItem, type CanReparent, type ConnectActionOptions, type ConnectEnd, type ConnectView, type ContainerBuildOptions, type ContainerEdit, ContainerHeader, type ContainerLayoutOptions, ContainerRole, type ContainerStencil, DEFAULT_EDGE_STROKE, DEFAULT_EDGE_STYLE, DEFAULT_GROUP_STYLE, DIAGRAM_CONTAINER_LAYOUT, DIAGRAM_EDGE, DIAGRAM_ITEM_CARRY, DIAGRAM_LABEL, DIAGRAM_LANE_COLUMNS_LAYOUT, DIAGRAM_LANE_ROWS_LAYOUT, DIAGRAM_OFF_PAGE_TAG, DIAGRAM_PASS_ORDER, DIAGRAM_POOL_COLUMNS_LAYOUT, DIAGRAM_POOL_ROWS_LAYOUT, DIAGRAM_THEMES, DIAGRAM_THEME_EXTENSION, DIAGRAM_TYPES, DIAGRAM_TYPE_DOC_KEY, DataContainer, DataEdge, DataNode, type DeleteReport, DiagramContainer, type DiagramContributionOptions, DiagramData, DiagramEdge, DiagramLabel, type DiagramLayout, DiagramNodeLike, DiagramNodeReader, type DiagramOverlay, DiagramSceneData, DiagramSceneOptions, type DiagramShapeOptions, DiagramSpec, type DiagramStencil, type DiagramStyleEditOptions, type DiagramStyleState, DiagramTheme, type DiagramType, type DiagramTypeDoc, type DiagramTypeEdge, type DiagramTypeScene, type DiagramTypeWriteOptions, DiagramView, type DiagramViewApi, type DiagramViewProps, type DraggableLabel, type DropParentScene, EASED_LAYOUTS, EDGE_DERIVE_PATH, EDGE_END_AFFORDANCE_KIND, EDGE_END_LAYER_ID, EDIT_CONTAINER_TITLE_ACTION_ID, EDIT_EDGE_LABEL_ACTION_ID, ERD_GROUP, ERD_STENCILS, ERD_TYPE, type EasedProducerOptions, EdgeEnd, type EdgeEndAffordanceOptions, type EdgeEndScratch, EdgeHop, type EdgeLabelOptions, type EdgeRoute, type EdgeRouteOptions, type EdgeRouteState, EdgeStyle, type EditEdgeLabelOptions, type EndChange, FLOWCHART_GROUP, FLOWCHART_STENCILS, FLOWCHART_TYPE, FOLLOW_OFF_PAGE_ACTION_ID, type FollowOffPageOptions, FontField, ForceOptions, type ForceProducerOptions, GRAB_EDGE_END_ACTION_ID, GRAB_LABEL_ACTION_ID, GRAB_PORT_ACTION_ID, GRAB_WAYPOINT_ACTION_ID, Graph, GraphNodeLike, GraphSource, type Hops, type HopsOptions, ITEM_DROP_ACTION_ID, type ItemDrop, type ItemDropOptions, type ItemDropTarget, LABEL_DERIVE_POSE, LABEL_DRAG_AFFORDANCE_KIND, LABEL_DRAG_LAYER_ID, LANE_AFFORDANCE_KIND, LANE_HEADER_SIZE, LANE_LAYER_ID, LANE_RESIZE_ACTION_ID, LAYOUTS, LAYOUT_ACTION_ID, type LabelDragOptions, type LabelEdit, type LabelMove, type LabelPlacement, type LabelPlacementOptions, type LabelPoseOptions, type LabelScratch, LabelSpot, type LaneActionOptions, type LaneLayerOptions, type LaneResize, type LaneScratch, type LaneStackOptions, type LayeredRoute, type LayeredRouteInput, type LayoutActionOptions, type LayoutDiagramOptions, LayoutDirection, LayoutFn, LayoutOptions, LayoutPlan, LayoutPlanner, LayoutPorts, LayoutResult, type LayoutRoutes, type LiveLayout, type LiveLayoutCtx, type LiveLayoutFrame, type LiveLayoutProducer, MIND_MAP_GROUP, MIND_MAP_STENCILS, MIND_MAP_TYPE, MIN_LANE_SIZE, MOVE_LABEL_ACTION_ID, MeasureRowText, type MovingEnd, NETWORK_GROUP, NETWORK_STENCILS, NETWORK_TYPE, type NodeMove, type NodeResize, NodeStyle, OFF_PAGE_STUB, OFF_PAGE_TAG_DERIVE_POSE, OFF_PAGE_TAG_PADDING, ORG_CHART_TYPE, ORG_GROUP, ORG_STENCILS, type OffPageEdgeInput, type OffPageMarkerOptions, OffPageSplit, type OffPageSplitInput, type OffPageTagLook, type OffPageTarget, Outline, POOL_HEADER_SIZE, PORT_AFFORDANCE_KIND, PORT_LAYER_ID, type ParticipantPose, type ParticipantScene, type ParticipantSource, type PendingEdge, PlaceLabelsOptions, type PoolLanes, Port, type PortAffordanceOptions, type PortScratch, PortsOptions, RECONNECT_ACTION_ID, RELEASE_MEMBERS_ACTION_ID, REMOVE_WAYPOINT_ACTION_ID, REORDER_ACTION_ID, RESET_LABEL_ACTION_ID, RESET_ROUTE_ACTION_ID, ROUTERS, ROUTER_LABELS, ROUTE_EDIT_ACTION_ID, type ReconnectChange, type ReconnectOptions, type RegionOptions, type RegionSpec, type RelayoutScene, type ReorderChange, type ReorderGap, type ReorderItem, type ReorderMove, type ReorderOptions, type ReorderSlots, type ResolvedRoute, type RouteChange, type RouteEdge, type RouteEdit, type RouteEditOptions, type RouteHandle, type RouteRequest, type RoutedScene, type Router, type RouterEdit, type RouterName, Row, RowTextStyle, SELECT_LABEL_EDGE_ACTION_ID, SET_HOPS_ACTION_ID, SET_ROUTER_ACTION_IDS, STENCIL_GROUPS, STEP_REORDER_ACTION_ID, type SelfLoop, type SetHopsOptions, type SetRouterOptions, type SpecRouterOptions, StencilGhost, type StencilGhostProps, type StencilGroup, type StencilInsertOptions, StyleField, type StyledRegion, type ThemePath, type ThemedNode, type ThemedScene, UML_CLASS_TYPE, UML_GROUP, UML_STENCILS, type UseLiveLayoutOptions, WAYPOINT_AFFORDANCE_KIND, WAYPOINT_HIT_PX, WAYPOINT_LAYER_ID, type WaypointAffordanceOptions, type WaypointScratch, addLane, addStencilGroup, addThemeRole, applyDiagramTheme, applyLayout, avoid, avoidSceneInput, bezier, bodyAt, bodyFollower, commitEdgeToScene, commitLabelToScene, commitLaneResizeToScene, commitReconnectToScene, commitRouteToScene, commitRouterToScene, connectBinding, connectorTool, containerBuild, containerShape, createAddLaneAction, createConnectAction, createDiagramContribution, createEdgeEndAffordance, createFollowOffPageAction, createItemDropAction, createLabelDragAction, createLaneAffordance, createLaneResizeAction, createLayoutAction, createPortAffordance, createReconnectAction, createReleaseMembersAction, createRemoveWaypointAction, createReorderAction, createResetLabelAction, createResetRouteAction, createRouteEditAction, createSetHopsAction, createSetRouterAction, createSpecHops, createSpecLabelPlacer, createSpecRouter, createStepReorderAction, createWaypointAffordance, dataEdgeStyle, dataNodeStyle, dataOffPage, dataRegionStyle, defaultCanConnect, diagramCanDropInto, diagramContainerLayout, diagramContainers, diagramDropParentAt, diagramEdgeEnds, diagramLabelDrag, diagramLayoutOf, diagramOffPage, diagramPages, diagramPorts, diagramResizable, diagramScene, diagramShape, diagramStyleOf, diagramThemeFrom, diagramThemeFromTokens, diagramThemeOf, diagramTypeDocOf, diagramTypeDocValue, diagramTypeEdgeStroke, diagramTypeOf, diagramWaypoints, documentBoundsOf, dragItemProps, dragSegment, dragVertex, draggableLabels, dropEmptyEdgeLabel, easedProducer, edgeDerivePath, edgeEndLayer, edgeEndScratchOf, edgeIdOf, edgeLabelSpec, edgeRouter, editContainerTitleAction, editContainerTitleBinding, editEdgeLabelAction, editEdgeLabelBinding, editableTheme, firstLanes, followOffPageBinding, forceProducer, forkTheme, grabPortAction, grabPortBindings, groupReorderContribution, groupReorderSlots, groupStencilIds, groupStencils, headerIdOf, hopFollower, insertWaypoint, installAvoidRouting, installHops, installLabelPlacement, installOffPageMarkers, isBodyEnd, isBodyOrRegion, isContainerStencil, isDiagramBody, isShippedTheme, itemDropContribution, labelDerivePose, labelDragLayer, labelScratchOf, labelSize, labelUnder, laneHeader, laneLayer, laneResizeFrame, laneScratchOf, laneStackLayout, lanesOf, layeredRoutes, layoutDiagram, layoutPoses, movedLabelData, nextOffPageRef, offPageFarText, offPageOps, offPageSplits, offPageTagData, offPageTagDerivePose, offPageTagLook, offPageTagSize, offPageTagSpec, offPageTagSpecs, offPageTagText, offPageTargetOf, orthogonal, parseDiagramTheme, pinSegment, poolAxisOf, poolHeader, poolsOf, portLayer, portScratchOf, reconnectBinding, regionHeaderAt, regionSpecs, registerDiagramShape, relayoutBodies, releaseMembers, removeSegment, removeStencilGroup, removeThemeRole, removeWaypoint, renameThemeRole, rendererMeasure, reorderBinding, reorderContribution, resolveEnd, roleEdgeStyle, roleStyle, routeDataOps, routeHandles, routeStateOf, routeWrites, routedData, routerActions, routesOf, sceneParticipants, segmentAxis, selfLoop, sequenceSlots, setDiagramColor, setDiagramFontSize, setDiagramStyle, setDiagramType, setThemeValue, simplifyStops, stackedLanes, startItemDrag, stencilBuild, stencilIdOf, stencilKind, stencilTool, straight, subpathOf, themeDocValue, themeEdgeStroke, themeFont, themeLabelFont, themeLabelStyle, themeRoles, themeToJson, themeValue, themeWrites, titlePose, unpinSegment, useAvoidRouting, useConnectorTool, useHops, useLabelPlacement, useLiveLayout, useMirroredSelection, useOffPageMarkers, useStencilInsert, useStencilTool, waypointFollower, waypointLayer, waypointScratchOf, withDiagramRegistry, withHops, withRouter };