@tumaet/apollon 5.0.1 → 5.1.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.
package/dist/index.d.ts CHANGED
@@ -4,6 +4,8 @@ import { EdgeProps } from '@xyflow/react';
4
4
  import { JSX } from 'react';
5
5
  import { Node as Node_2 } from '@xyflow/react';
6
6
  import { NodeProps } from '@xyflow/react';
7
+ import { PanelPosition } from '@xyflow/react';
8
+ import { Position } from '@xyflow/react';
7
9
  import { ReactNode } from 'react';
8
10
  import { Ref } from 'react';
9
11
  import { XYPosition } from '@xyflow/react';
@@ -42,8 +44,17 @@ declare type ActivitySwimlaneProps = DefaultNodeProps & {
42
44
  /** React wrapper around {@link ApollonEditor}. See `@tumaet/apollon` docs. */
43
45
  export declare function Apollon(props: ApollonProps): JSX.Element;
44
46
 
47
+ export declare namespace Apollon {
48
+ var Palette: typeof ApollonPalette;
49
+ var Zoom: typeof ApollonZoom;
50
+ var MiniMap: typeof ApollonMiniMap;
51
+ var SelectionToolbar: typeof ApollonSelectionToolbar;
52
+ var DefaultControls: typeof ApollonDefaultControls;
53
+ }
54
+
45
55
  declare namespace Apollon_2 {
46
56
  export {
57
+ ApollonLabels,
47
58
  UMLDiagramType,
48
59
  DiagramNodeType,
49
60
  DiagramEdgeType,
@@ -101,6 +112,10 @@ export declare type ApollonControlProps = OverlayControlOptions & {
101
112
  children: ReactNode;
102
113
  };
103
114
 
115
+ /** The editor's default chrome. Render it explicitly when adding host children
116
+ * that should keep palette + zoom + minimap visible. */
117
+ export declare function ApollonDefaultControls(): JSX.Element;
118
+
104
119
  export declare type ApollonEdge = {
105
120
  id: string;
106
121
  source: string;
@@ -122,6 +137,7 @@ export declare class ApollonEditor {
122
137
  private readonly assessmentSelectionStore;
123
138
  private readonly overlayStore;
124
139
  private readonly hostRegionEls;
140
+ private readonly controlGenerations;
125
141
  private subscribers;
126
142
  constructor(element: HTMLElement, options?: Apollon_2.ApollonOptions);
127
143
  private setReactFlowInstance;
@@ -174,11 +190,25 @@ export declare class ApollonEditor {
174
190
  * @param patch - Partial options/renderer merged over the existing control.
175
191
  */
176
192
  updateControl(id: string, patch: Partial<OverlayControlInput>): void;
193
+ /**
194
+ * Unregister a control by id (a no-op if absent). Hides a built-in imperatively
195
+ * — e.g. `editor.removeControl(ZOOM_ID)` — the parity for omitting it from a
196
+ * React composition. Equivalent to the disposer `addControl` returns.
197
+ * @param id - The control's id.
198
+ */
199
+ removeControl(id: string): void;
177
200
  /**
178
201
  * @param id - A control id.
179
202
  * @returns `true` if a control with this id is currently registered.
180
203
  */
181
204
  hasControl(id: string): boolean;
205
+ /**
206
+ * @param id - A control id.
207
+ * @returns The registered control options, or `undefined` if absent — e.g. to
208
+ * read a built-in's current `region` after `updateControl`. The renderer is
209
+ * intentionally omitted; replace a renderer explicitly with `updateControl`.
210
+ */
211
+ getControl(id: string): OverlayControlSnapshot | undefined;
182
212
  /**
183
213
  * A stable DOM node anchored in `region`, for hosts that render their own
184
214
  * React into it (via `createPortal`) to keep host context. Auto-measured, so
@@ -239,6 +269,13 @@ export declare class ApollonEditor {
239
269
  setMode(mode: Apollon_2.ApollonMode): void;
240
270
  /** Live-toggle whether the canvas captures page scroll. */
241
271
  setScrollLock(scrollLock: boolean): void;
272
+ /**
273
+ * Replace the editor's user-facing strings (i18n). Merged over the English
274
+ * defaults, so a partial map only changes the keys it provides. Reactive — the
275
+ * chrome re-renders, so a host can switch language without remounting.
276
+ * @param labels - A partial {@link ApollonLabels} in the host's language.
277
+ */
278
+ setLabels(labels: Partial<Apollon_2.ApollonLabels>): void;
242
279
  /**
243
280
  * Toggle preview-overlay mode. When `true`, subsequent `model = …`
244
281
  * assignments and other store mutators update the local Zustand caches
@@ -263,7 +300,7 @@ export declare class ApollonEditor {
263
300
  diagramType: "ClassDiagram" | "ObjectDiagram" | "ActivityDiagram" | "UseCaseDiagram" | "CommunicationDiagram" | "ComponentDiagram" | "DeploymentDiagram" | "PetriNet" | "ReachabilityGraph" | "SyntaxTree" | "Flowchart" | "BPMN" | "Sfc";
264
301
  };
265
302
  get model(): Apollon_2.UMLModel;
266
- set model(model: Apollon_2.UMLModel);
303
+ set model(incoming: Apollon_2.UMLModel);
267
304
  /**
268
305
  * Host-driven element highlighting. Paints a translucent overlay over each
269
306
  * given node / edge / class-member id in the supplied CSS color. Typical
@@ -289,6 +326,217 @@ export declare class ApollonEditor {
289
326
  static generateInitialAwarenessSyncMessage(): string;
290
327
  }
291
328
 
329
+ /**
330
+ * Flat, typed dictionary of the strings the editor renders itself. The library
331
+ * ships English defaults; a host overrides any subset via `labels` (a shallow,
332
+ * per-key merge). Strings that interpolate are functions so a translation keeps
333
+ * control of word order.
334
+ */
335
+ export declare interface ApollonLabels {
336
+ zoomToolbar: string;
337
+ zoomIn: string;
338
+ zoomOut: string;
339
+ fitView: string;
340
+ /** Tooltip on the % readout button. */
341
+ resetZoom: string;
342
+ /** Accessible name of the % readout (interpolates the live zoom level). */
343
+ zoomReadout: (percent: number) => string;
344
+ undo: string;
345
+ /** Tooltip incl. the keyboard shortcut. */
346
+ undoHint: string;
347
+ redo: string;
348
+ redoHint: string;
349
+ miniMap: string;
350
+ showMinimap: string;
351
+ /** Tooltip on the collapsed minimap toggle. */
352
+ showMinimapHint: string;
353
+ hideMinimap: string;
354
+ selectionActions: string;
355
+ elementPalette: string;
356
+ paletteModelView: string;
357
+ paletteSelectElementsView: string;
358
+ paletteHighlightHint: string;
359
+ edge: string;
360
+ label: string;
361
+ type: string;
362
+ connection: string;
363
+ stereotype: string;
364
+ object: string;
365
+ source: string;
366
+ target: string;
367
+ style: string;
368
+ selectPlaceholder: string;
369
+ addComment: string;
370
+ points: string;
371
+ negativePointsAllowed: string;
372
+ feedback: string;
373
+ deleteAssessment: string;
374
+ deleteAssessmentFor: (name: string) => string;
375
+ assessmentFor: (type: string) => string;
376
+ nextAssessment: string;
377
+ noComment: string;
378
+ notGraded: string;
379
+ node: string;
380
+ attribute: string;
381
+ method: string;
382
+ /** Visible title for a concrete node type identifier. */
383
+ nodeTypeLabel: (nodeType?: string) => string;
384
+ startEvent: string;
385
+ intermediateEvent: string;
386
+ gateway: string;
387
+ gatewayType: string;
388
+ startType: string;
389
+ endType: string;
390
+ intermediateType: string;
391
+ taskType: string;
392
+ marker: string;
393
+ pool: string;
394
+ task: string;
395
+ endEvent: string;
396
+ bpmnDefault: string;
397
+ bpmnTimer: string;
398
+ bpmnConditional: string;
399
+ bpmnSignal: string;
400
+ bpmnEscalation: string;
401
+ bpmnError: string;
402
+ bpmnCompensation: string;
403
+ bpmnTerminate: string;
404
+ bpmnMessageCatch: string;
405
+ bpmnMessageThrow: string;
406
+ bpmnTimerCatch: string;
407
+ bpmnEscalationThrow: string;
408
+ bpmnConditionalCatch: string;
409
+ bpmnLinkCatch: string;
410
+ bpmnLinkThrow: string;
411
+ bpmnCompensationThrow: string;
412
+ bpmnSignalCatch: string;
413
+ bpmnSignalThrow: string;
414
+ bpmnExclusive: string;
415
+ bpmnParallel: string;
416
+ bpmnInclusive: string;
417
+ bpmnEventBased: string;
418
+ bpmnComplex: string;
419
+ bpmnUser: string;
420
+ bpmnSend: string;
421
+ bpmnReceive: string;
422
+ bpmnManual: string;
423
+ bpmnBusinessRule: string;
424
+ bpmnScript: string;
425
+ bpmnMarkerNone: string;
426
+ bpmnParallelMultiInstance: string;
427
+ bpmnSequentialMultiInstance: string;
428
+ bpmnLoop: string;
429
+ marking: string;
430
+ tokens: string;
431
+ capacity: string;
432
+ weight: string;
433
+ setFiniteCapacity: string;
434
+ setInfiniteCapacity: string;
435
+ nonterminal: string;
436
+ terminal: string;
437
+ class: string;
438
+ classType: string;
439
+ abstractClass: string;
440
+ interface: string;
441
+ enumeration: string;
442
+ reorderAttribute: string;
443
+ newAttribute: string;
444
+ addAttribute: string;
445
+ deleteAttribute: string;
446
+ attributes: string;
447
+ reorderMethod: string;
448
+ newMethod: string;
449
+ addMethod: string;
450
+ deleteMethod: string;
451
+ methods: string;
452
+ markMethodAsAbstract: string;
453
+ unmarkMethodAsAbstract: string;
454
+ abstractMethod: string;
455
+ messages: string;
456
+ message: string;
457
+ addMessage: string;
458
+ deleteMessage: (label: string) => string;
459
+ switchDirection: (direction: string) => string;
460
+ switchDirectionFor: (label: string, direction: string) => string;
461
+ messagePlaceholder: (index: number) => string;
462
+ messageFallbackLabel: (index: number) => string;
463
+ messageExists: string;
464
+ duplicateMessage: string;
465
+ swimlane: string;
466
+ lanes: string;
467
+ reorderLane: string;
468
+ deleteLane: string;
469
+ addLane: string;
470
+ laneName: string;
471
+ defaultLaneName: (index: number) => string;
472
+ orientation: string;
473
+ orientationVertical: string;
474
+ orientationHorizontal: string;
475
+ resizeLane: string;
476
+ componentName: string;
477
+ subsystemName: string;
478
+ stereotypePlaceholder: string;
479
+ isInitialMarking: string;
480
+ actionTable: string;
481
+ actions: string;
482
+ id: string;
483
+ actionName: string;
484
+ condition: string;
485
+ deleteActionRow: string;
486
+ addActionRow: string;
487
+ showCrossbar: string;
488
+ negatedCondition: string;
489
+ edgeType: string;
490
+ swapSourceTarget: string;
491
+ multiplicityLabel: (name: string) => string;
492
+ roleLabel: (name: string) => string;
493
+ deleteEdge: string;
494
+ editEdge: string;
495
+ deploymentAssociation: string;
496
+ deploymentDependency: string;
497
+ providedInterface: string;
498
+ requiredInterface: string;
499
+ sequenceFlow: string;
500
+ messageFlow: string;
501
+ associationFlow: string;
502
+ dataAssociationFlow: string;
503
+ association: string;
504
+ include: string;
505
+ extend: string;
506
+ generalization: string;
507
+ biAssociation: string;
508
+ uniAssociation: string;
509
+ aggregation: string;
510
+ composition: string;
511
+ inheritance: string;
512
+ dependency: string;
513
+ realization: string;
514
+ lineColor: string;
515
+ textColor: string;
516
+ fillColor: string;
517
+ namePlaceholder: string;
518
+ editColors: string;
519
+ editColorsFor: (label: string) => string;
520
+ colorPicker: (label: string) => string;
521
+ pickColor: string;
522
+ customColor: string;
523
+ custom: string;
524
+ reset: string;
525
+ /** Interpolated a11y label + tooltip for the header stereotype toggle. */
526
+ stereotypeToggleLabel: (name: string) => string;
527
+ stereotypeToggleTooltip: (shown: boolean, name: string) => string;
528
+ attributeWord: string;
529
+ methodWord: string;
530
+ classWord: string;
531
+ objectWord: string;
532
+ communicationObjectWord: string;
533
+ componentWord: string;
534
+ subsystemWord: string;
535
+ nodeWord: string;
536
+ }
537
+
538
+ export declare function ApollonMiniMap({ pannable, zoomable, ...placement }?: MiniMapControlOptions): null;
539
+
292
540
  export declare enum ApollonMode {
293
541
  Modelling = "Modelling",
294
542
  Exporting = "Exporting",
@@ -327,6 +575,22 @@ export declare type ApollonOptions = {
327
575
  collaborationEnabled?: boolean;
328
576
  collaboration?: ApollonCollaborationOptions;
329
577
  scrollLock?: boolean;
578
+ /**
579
+ * The chrome to register (vanilla / imperative). Build descriptors with the
580
+ * built-in factories — `paletteControl()`, `zoomControl({ history })`,
581
+ * `miniMapControl()` — and/or your own. OMIT for the editor defaults (palette +
582
+ * zoom + minimap); pass `[]` for a bare canvas; pass a subset to show only
583
+ * those. In React, compose `<Apollon.Palette|Zoom|MiniMap>` / `<ApollonControl>`
584
+ * children instead — both compile to the same registry records.
585
+ */
586
+ controls?: OverlayControlInput[];
587
+ /**
588
+ * Override any of the editor's own user-facing strings (palette / zoom / minimap
589
+ * tooltips and aria-labels) for i18n. Ships English; a host passes a partial map
590
+ * in its own language and the rest fall back to English. Reactive via
591
+ * `<Apollon labels>` / `editor.setLabels`. See {@link ApollonLabels}.
592
+ */
593
+ labels?: Partial<ApollonLabels>;
330
594
  /**
331
595
  * Optional `--apollon-*` CSS custom properties applied to the editor's mount
332
596
  * element. Build one with `createApollonTheme(...)`. Fully optional — an
@@ -341,6 +605,15 @@ export declare type ApollonOptions = {
341
605
  dataTheme?: "light" | "dark";
342
606
  };
343
607
 
608
+ /**
609
+ * Compose the editor's built-in chrome as children of `<Apollon>`: presence
610
+ * renders it, omission hides it, and its typed props reconfigure it. Replacing a
611
+ * built-in is just rendering your own `<ApollonControl>` at the reserved id. All
612
+ * three register through the one overlay registry, identical to the vanilla
613
+ * `paletteControl()/zoomControl()/miniMapControl()` descriptors.
614
+ */
615
+ export declare function ApollonPalette(props?: PaletteControlOptions): null;
616
+
344
617
  /**
345
618
  * Props for the {@link Apollon} React component.
346
619
  *
@@ -383,6 +656,8 @@ export declare interface ApollonProps {
383
656
  view?: ApollonView;
384
657
  mode?: ApollonMode;
385
658
  scrollLock?: boolean;
659
+ /** Override the editor's own strings for i18n. See {@link ApollonEditor.setLabels}. */
660
+ labels?: Partial<ApollonLabels>;
386
661
  /** Local-only preview overlay. See {@link ApollonEditor.setPreviewMode}. */
387
662
  previewMode?: boolean;
388
663
  /**
@@ -414,6 +689,45 @@ export declare function ApollonProvider({ editor, children, }: {
414
689
  children: ReactNode;
415
690
  }): JSX.Element;
416
691
 
692
+ /**
693
+ * A selection-anchored control group: your controls float just above (or beside)
694
+ * the current selection, follow it as it moves, and stay a constant on-screen
695
+ * size at any zoom. Unlike `on-canvas` chrome (which lives in diagram space and
696
+ * scales), this is screen-space and only appears while something is selected.
697
+ *
698
+ * Compose it as a child of `<Apollon>`. It reserves no room (floats over the
699
+ * canvas) and needs no positioning props beyond the anchor side.
700
+ *
701
+ * ```tsx
702
+ * <Apollon>
703
+ * <Apollon.Palette />
704
+ * <Apollon.Zoom />
705
+ * <Apollon.MiniMap />
706
+ * <Apollon.SelectionToolbar position="top" ariaLabel="Selection actions">
707
+ * <button onClick={onDelete}>Delete</button>
708
+ * <button onClick={onDuplicate}>Duplicate</button>
709
+ * </Apollon.SelectionToolbar>
710
+ * </Apollon>
711
+ * ```
712
+ */
713
+ export declare function ApollonSelectionToolbar({ children, position, offset, id, ariaLabel, role, }: ApollonSelectionToolbarProps): ReactNode;
714
+
715
+ export declare type ApollonSelectionToolbarProps = {
716
+ /** Toolbar content — your own buttons/menu. Portaled in, so it keeps host
717
+ * context (theme, router) and reconciles normally. */
718
+ children: ReactNode;
719
+ /** Which side of the selection to anchor to. Default `"top"`. */
720
+ position?: "top" | "bottom" | "left" | "right";
721
+ /** Gap in px between the selection bounding box and the toolbar. Default 8. */
722
+ offset?: number;
723
+ /** Stable control id. Default `"apollon:selection-toolbar"`. */
724
+ id?: string;
725
+ /** Accessible name for the wrapper. */
726
+ ariaLabel?: string;
727
+ /** Wrapper landmark for the host controls. Use `"toolbar"` only when children implement toolbar keyboard behavior. */
728
+ role?: "toolbar" | "group";
729
+ };
730
+
417
731
  /**
418
732
  * The documented, stable subset of the `--apollon-*` editor theming tokens.
419
733
  *
@@ -427,14 +741,23 @@ export declare function ApollonProvider({ editor, children, }: {
427
741
  export declare interface ApollonTheme {
428
742
  /** Accent / brand color. Maps to `--apollon-primary`. */
429
743
  primary?: string;
430
- /** Foreground used on top of `background`. Maps to `--apollon-primary-contrast`. */
431
- primaryContrast?: string;
744
+ /**
745
+ * Ink drawn ON `primary` (accent buttons, the active tool). Defaults to white;
746
+ * set it when `primary` is light so on-accent text stays legible (white-on-light
747
+ * otherwise). Maps to `--apollon-primary-foreground`.
748
+ */
749
+ primaryForeground?: string;
750
+ /**
751
+ * Page foreground — the ink drawn on `background` (text, icons, chrome).
752
+ * This is NOT "a color that contrasts with `primary`"; it is the editor's
753
+ * base text color, and the whole chrome ramp derives from it plus
754
+ * `background`. Maps to `--apollon-foreground`.
755
+ */
756
+ foreground?: string;
432
757
  /** Muted/secondary accent. Maps to `--apollon-secondary`. */
433
758
  secondary?: string;
434
759
  /** Canvas / surface background. Maps to `--apollon-background`. */
435
760
  background?: string;
436
- /** Inverse of `background` (e.g. tooltips). Maps to `--apollon-background-inverse`. */
437
- backgroundInverse?: string;
438
761
  /** Slightly raised surface variant. Maps to `--apollon-background-variant`. */
439
762
  backgroundVariant?: string;
440
763
  /** Neutral gray surface. Maps to `--apollon-gray`. */
@@ -447,38 +770,18 @@ export declare interface ApollonTheme {
447
770
  guideVertical?: string;
448
771
  /** Horizontal alignment guide color. Maps to `--apollon-guide-horizontal`. */
449
772
  guideHorizontal?: string;
450
- /** Warning alert accent. Maps to `--apollon-alert-warning-yellow`. */
451
- warning?: string;
452
- /** Warning alert background. Maps to `--apollon-alert-warning-background`. */
453
- warningBackground?: string;
454
- /** Warning alert border. Maps to `--apollon-alert-warning-border`. */
455
- warningBorder?: string;
456
- /** Danger alert text color. Maps to `--apollon-alert-danger-color`. */
773
+ /** Error/danger text color (e.g. validation messages). Maps to `--apollon-danger`. */
457
774
  danger?: string;
458
- /** Danger alert background. Maps to `--apollon-alert-danger-background`. */
459
- dangerBackground?: string;
460
- /** Danger alert border. Maps to `--apollon-alert-danger-border`. */
461
- dangerBorder?: string;
462
775
  /** Raised card/popover/menu surface. Maps to `--apollon-surface`. */
463
776
  surface?: string;
464
777
  /** Sunken/recessed surface (e.g. wells, muted areas). Maps to `--apollon-surface-sunken`. */
465
778
  surfaceSunken?: string;
466
- /** Hover state of the raised surface. Maps to `--apollon-surface-hover`. */
467
- surfaceHover?: string;
468
779
  /** Default border / divider color. Maps to `--apollon-border`. */
469
780
  border?: string;
470
781
  /** Subtle border / divider color. Maps to `--apollon-border-subtle`. */
471
782
  borderSubtle?: string;
472
783
  /** Base corner radius for shared primitives (CSS length). Maps to `--apollon-radius`. */
473
784
  radius?: string;
474
- /** Toggle/switch outline. Maps to `--apollon-switch-box-border-color`. */
475
- switchBoxBorderColor?: string;
476
- /** List-group surface color. Maps to `--apollon-list-group-color`. */
477
- listGroupColor?: string;
478
- /** Outline-secondary button color. Maps to `--apollon-btn-outline-secondary-color`. */
479
- btnOutlineSecondaryColor?: string;
480
- /** Modal footer divider. Maps to `--apollon-modal-bottom-border`. */
481
- modalBottomBorder?: string;
482
785
  }
483
786
 
484
787
  export declare enum ApollonView {
@@ -487,6 +790,8 @@ export declare enum ApollonView {
487
790
  Highlight = "Highlight"
488
791
  }
489
792
 
793
+ export declare function ApollonZoom({ history, ...placement }?: ZoomControlOptions): null;
794
+
490
795
  export declare type Assessment = {
491
796
  modelElementId: string;
492
797
  elementType: string;
@@ -575,22 +880,46 @@ declare function BPMNTransaction({ id, width, height, data, parentId, }: NodePro
575
880
 
576
881
  declare type BPMNTransactionProps = DefaultNodeProps;
577
882
 
883
+ declare type BuiltInPlacement<Region extends OverlayControlOptions["region"]> = Partial<Omit<OverlayControlOptions, "id" | "region">> & {
884
+ region?: Region;
885
+ };
886
+
578
887
  declare function Class({ id, width, height, data, }: NodeProps<Node_2<ClassNodeProps>>): JSX.Element;
579
888
 
580
889
  declare type ClassNodeElement = {
581
890
  id: string;
891
+ /**
892
+ * Abstract modifier — renders the member's signature in italics (UML 2.5.1
893
+ * §9.4). Only ever set on *methods*: attributes are `StructuralFeature`s and
894
+ * cannot be abstract, so the attribute editor never surfaces the control.
895
+ */
896
+ isAbstract?: boolean;
582
897
  } & DefaultNodeProps;
583
898
 
584
899
  declare type ClassNodeProps = {
585
900
  methods: ClassNodeElement[];
586
901
  attributes: ClassNodeElement[];
587
- stereotype?: ClassType;
902
+ /** Metaclass keyword only (`«interface»` / `«enumeration»`). */
903
+ stereotype?: ClassStereotype;
904
+ /**
905
+ * Class-level abstract modifier — renders the class name in italics (UML
906
+ * 2.5.1 §9.2.4). Orthogonal to `stereotype`; there is no `«abstract»` keyword.
907
+ */
908
+ isAbstract?: boolean;
588
909
  } & DefaultNodeProps;
589
910
 
590
- declare enum ClassType {
591
- Abstract = "Abstract",
592
- Interface = "Interface",
593
- Enumeration = "Enumeration"
911
+ /**
912
+ * UML class-diagram metaclass keywords, rendered in guillemets above the class
913
+ * name (e.g. `«interface»`). These are keywords denoting a distinct metaclass —
914
+ * NOT modifiers. Abstractness is a separate boolean (`isAbstract`), shown by an
915
+ * italic name, per UML 2.5.1 §9.2.4; there is no `«abstract»` keyword.
916
+ *
917
+ * Values are the serialized, already-lowercase spelling from the UML keyword
918
+ * table (UML 2.5.1 Annex C, Table C.1), so the stored value equals what renders.
919
+ */
920
+ declare enum ClassStereotype {
921
+ Interface = "interface",
922
+ Enumeration = "enumeration"
594
923
  }
595
924
 
596
925
  export declare const collabColorFromName: (name: string) => string;
@@ -674,12 +1003,20 @@ declare type CustomEdgeProps = {
674
1003
  targetRole: string | null;
675
1004
  targetMultiplicity: string | null;
676
1005
  points: IPoint[];
1006
+ sourceAnchor?: FreeformEdgeAnchor;
1007
+ targetAnchor?: FreeformEdgeAnchor;
677
1008
  label?: string | null;
678
1009
  messages?: MessageData[];
679
1010
  strokeColor?: string;
680
1011
  textColor?: string;
681
1012
  };
682
1013
 
1014
+ /** The shipped English strings — the fallback for any key a host doesn't override. */
1015
+ export declare const DEFAULT_LABELS: ApollonLabels;
1016
+
1017
+ /** The editor's default chrome — palette, zoom/history cluster, minimap. */
1018
+ export declare function defaultControls(): OverlayControlInput[];
1019
+
683
1020
  declare type DefaultNodeProps = {
684
1021
  name: string;
685
1022
  fillColor?: string;
@@ -871,6 +1208,16 @@ declare function FlowchartTerminal({ id, width, height, data, parentId, }: NodeP
871
1208
  */
872
1209
  export declare const FONT_FAMILY = "Inter, system-ui, Avenir, Helvetica, Arial, sans-serif";
873
1210
 
1211
+ declare type FreeformEdgeAnchor = {
1212
+ side: Position;
1213
+ /**
1214
+ * Offset along the side, normalized to the current node side length. The
1215
+ * editor rounds the resolved point to whole flow pixels, so a drop can land
1216
+ * on any pixel while still scaling sensibly if the node is resized later.
1217
+ */
1218
+ ratio: number;
1219
+ };
1220
+
874
1221
  export declare const getAssessmentNameForArtemis: (elementId: string, model: UMLModel) => {
875
1222
  name: string;
876
1223
  type: string;
@@ -926,6 +1273,19 @@ declare interface MessageData {
926
1273
  direction: "target" | "source";
927
1274
  }
928
1275
 
1276
+ export declare const MINIMAP_ID = "apollon:minimap";
1277
+
1278
+ export declare function miniMapControl({ pannable, zoomable, region, ...placement }?: MiniMapControlOptions): OverlayControlInput;
1279
+
1280
+ export declare type MiniMapControlOptions = BuiltInPlacement<MiniMapRegion> & {
1281
+ /** Drag the minimap to pan the diagram. Default `true`. */
1282
+ pannable?: boolean;
1283
+ /** Scroll over the minimap to zoom the diagram. Default `true`. */
1284
+ zoomable?: boolean;
1285
+ };
1286
+
1287
+ declare type MiniMapRegion = Extract<PanelPosition, OverlayControlOptions["region"]>;
1288
+
929
1289
  declare function ObjectName({ id, width, height, data, }: NodeProps<Node_2<ObjectNodeProps>>): JSX.Element;
930
1290
 
931
1291
  declare type ObjectNodeProps = {
@@ -952,6 +1312,16 @@ export declare interface OverlayControlOptions {
952
1312
  inset?: InsetContribution;
953
1313
  /** Stacking within a region; lower renders toward the region's anchor edge. */
954
1314
  order?: number;
1315
+ /**
1316
+ * Band lane (bands only). Controls in the SAME lane sit along the band's axis
1317
+ * (side by side on `header`/`footer`, top-to-bottom on the rails) and reserve
1318
+ * the taller/wider of them. Controls in DIFFERENT lanes STACK across the band's
1319
+ * cross-axis and their reservations SUM — so two independently-registered bars
1320
+ * on one edge (e.g. an exam bar in lane 0 and a "problem statement changed"
1321
+ * banner in lane 1) both get room instead of overlapping. Lane 0 (default) sits
1322
+ * against the band's anchor edge; higher lanes stack toward the canvas. Ignored
1323
+ * for slots and `on-canvas`. */
1324
+ lane?: number;
955
1325
  /** When false the region frame stays pointer-transparent here too. Default true. */
956
1326
  interactive?: boolean;
957
1327
  /** Wraps the control in a `role="group"` with this aria-label. No focus
@@ -965,18 +1335,38 @@ export declare interface OverlayControlOptions {
965
1335
  style?: CSSProperties;
966
1336
  }
967
1337
 
1338
+ /** Immutable public view of a registered control. Renderer internals are omitted. */
1339
+ export declare type OverlayControlSnapshot = Readonly<OverlayControlOptions>;
1340
+
968
1341
  /**
969
- * Where a control is anchored. The six React Flow `<Panel>` corners are
970
- * screen-space and rendered through React Flow; `header`/`left-rail`/`right-rail`
971
- * are library-owned bands; `on-canvas` pans/zooms with the diagram.
1342
+ * Where a control is anchored. The six corners and the `header`/`footer`/rail
1343
+ * bands are screen-space cells of the overlay grid; `on-canvas` pans/zooms with
1344
+ * the diagram.
972
1345
  */
973
- export declare type OverlayRegion = "top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right" | "header" | "left-rail" | "right-rail" | "on-canvas";
1346
+ export declare type OverlayRegion = "top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right" | "header" | "footer" | "left-rail" | "right-rail" | "on-canvas";
974
1347
 
975
1348
  /** One of the four edges a control can sit against / reserve room on. */
976
1349
  export declare type OverlaySide = "top" | "right" | "bottom" | "left";
977
1350
 
978
1351
  declare function Package({ id, width, height, data, parentId, }: NodeProps<Node_2<DefaultNodeProps>>): JSX.Element | null;
979
1352
 
1353
+ /**
1354
+ * Framework-agnostic factories for the editor's built-in chrome. Each returns an
1355
+ * {@link OverlayControlInput} descriptor under a reserved id, so the built-ins are
1356
+ * the same registry records host controls use — registered via `editor.addControl`
1357
+ * (vanilla / imperative) or the `<Apollon.Palette|Zoom|MiniMap>` compound
1358
+ * components (React). Placement/appearance overrides ride the shared
1359
+ * {@link OverlayControlOptions} vocabulary; the reserved id and default `render`
1360
+ * are fixed here.
1361
+ */
1362
+ export declare const PALETTE_ID = "apollon:palette";
1363
+
1364
+ export declare function paletteControl(options?: PaletteControlOptions): OverlayControlInput;
1365
+
1366
+ export declare type PaletteControlOptions = BuiltInPlacement<PaletteRegion>;
1367
+
1368
+ declare type PaletteRegion = "left-rail" | "right-rail";
1369
+
980
1370
  declare function PetriNetPlace({ id, width, height, data, }: NodeProps<Node_2<PetriNetPlaceProps>>): JSX.Element | null;
981
1371
 
982
1372
  declare type PetriNetPlaceProps = {
@@ -1130,6 +1520,25 @@ declare function UseCaseActor({ id, width, height, data, parentId, }: NodeProps<
1130
1520
 
1131
1521
  declare function UseCaseSystem({ id, width, height, data, parentId, }: NodeProps<Node_2<DefaultNodeProps>>): JSX.Element | null;
1132
1522
 
1523
+ /**
1524
+ * Register an overlay control for the component's lifetime, re-applying when
1525
+ * `deps` change and disposing on unmount (react-map-gl's `useControl` shape). The
1526
+ * built-in `render` runs inside the editor's overlay layer, so it resolves React
1527
+ * Flow + store context regardless of where the component sits in the consumer's
1528
+ * tree.
1529
+ *
1530
+ * `deps` gate re-registration, so — exactly as with `useMemo`/`useEffect` — they
1531
+ * MUST list every value `make`'s returned `render` closes over, or the control
1532
+ * keeps rendering stale values. Unlike `<ApollonControl>` (which portals children
1533
+ * that reconcile on their own), here the closure IS the content, so the dep list
1534
+ * is the only update signal.
1535
+ */
1536
+ export declare function useControl(make: () => OverlayControlInput, deps: readonly unknown[]): void;
1537
+
1538
+ /** The editor's active label set (English defaults merged with host overrides).
1539
+ * Reactive — a host swapping `labels` re-renders chrome without a remount. */
1540
+ export declare const useLabels: () => ApollonLabels;
1541
+
1133
1542
  declare type V3Assessment = {
1134
1543
  modelElementId: string;
1135
1544
  elementType: string;
@@ -1260,4 +1669,13 @@ declare type V3UMLRelationship = V3UMLModelElement & {
1260
1669
  flowType?: string;
1261
1670
  };
1262
1671
 
1672
+ export declare const ZOOM_ID = "apollon:zoom";
1673
+
1674
+ export declare function zoomControl({ history, region, ...placement }?: ZoomControlOptions): OverlayControlInput;
1675
+
1676
+ export declare type ZoomControlOptions = BuiltInPlacement<OverlayControlOptions["region"]> & {
1677
+ /** Show the undo / redo island (when an undo manager exists). Default `true`. */
1678
+ history?: boolean;
1679
+ };
1680
+
1263
1681
  export { }