@tumaet/apollon 5.0.1 → 5.1.1

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