@tumaet/apollon 4.7.0 → 4.9.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/README.md +45 -20
- package/dist/assets/style.css +1 -1
- package/dist/export.d.ts +73 -0
- package/dist/export.js +219 -0
- package/dist/exportStyles-Co-WBqTa.js +5 -0
- package/dist/external/LICENSE-InterFont +92 -0
- package/dist/external/exportFonts-DxO9jrR1.js +19 -0
- package/dist/external/exportStyles-Co-WBqTa.js +5 -0
- package/dist/external/index.js +22191 -0
- package/dist/fontStack-DOtVH2j8.js +5 -0
- package/dist/index.d.ts +150 -3
- package/dist/index.js +19993 -19219
- package/dist/internals.d.ts +65 -1
- package/dist/internals.js +14 -12
- package/dist/react/apollon-editor.d.ts +56 -3
- package/dist/react/components/AlignmentGuides.d.ts +1 -1
- package/dist/react/components/CustomControls.d.ts +7 -0
- package/dist/react/components/DraggableGhost.d.ts +5 -0
- package/dist/react/components/popovers/PopoverManager.d.ts +1 -1
- package/dist/react/components/popovers/activityDiagram/ActivitySwimlaneEditPopover.d.ts +2 -0
- package/dist/react/components/popovers/activityDiagram/index.d.ts +1 -0
- package/dist/react/components/react/ApollonControl.d.ts +18 -0
- package/dist/react/components/svgs/nodes/InterfaceLabel.d.ts +26 -0
- package/dist/react/components/svgs/nodes/activityDiagram/ActivitySwimlaneSVG.d.ts +9 -0
- package/dist/react/components/svgs/nodes/activityDiagram/index.d.ts +1 -0
- package/dist/react/components/svgs/nodes/componentDiagram/ComponentInterfaceNodeSVG.d.ts +2 -0
- package/dist/react/components/svgs/nodes/deploymentDiagram/DeploymentInterfaceSVG.d.ts +2 -0
- package/dist/react/constants.d.ts +28 -0
- package/dist/react/edges/labelTypes/EdgeIncludeExtendLabel.d.ts +1 -4
- package/dist/react/edges/labelTypes/EdgeMiddleLabels.d.ts +7 -4
- package/dist/react/edges/labelTypes/EdgeMultipleLabels.d.ts +2 -3
- package/dist/react/edges/labelTypes/messageLayout.d.ts +51 -0
- package/dist/react/export/exportErrors.d.ts +10 -0
- package/dist/react/export/index.d.ts +13 -0
- package/dist/react/export/normalizeExportSvg.d.ts +16 -0
- package/dist/react/export/preProcessSvgForPdf.d.ts +20 -0
- package/dist/react/export/svgToPdf.d.ts +17 -0
- package/dist/react/export/svgToPng.d.ts +38 -0
- package/dist/react/exportStyles-yVX7Dykt.js +6 -0
- package/dist/react/hooks/index.d.ts +0 -1
- package/dist/react/hooks/useRemoteDraggingNodes.d.ts +20 -0
- package/dist/react/hooks/useStepPathEdge.d.ts +11 -0
- package/dist/react/index.d.ts +1 -0
- package/dist/react/nodes/activityDiagram/ActivitySwimlane.d.ts +3 -0
- package/dist/react/nodes/activityDiagram/index.d.ts +1 -0
- package/dist/react/nodes/types.d.ts +2 -1
- package/dist/react/overlay/OverlayLayer.d.ts +8 -0
- package/dist/react/overlay/RegionMount.d.ts +10 -0
- package/dist/react/overlay/overlayStore.d.ts +20 -0
- package/dist/react/overlay/types.d.ts +48 -0
- package/dist/react/react.d.ts +1 -0
- package/dist/react/react.js +13625 -18669
- package/dist/react/store/context.d.ts +3 -0
- package/dist/react/store/diagramStore.d.ts +17 -1
- package/dist/react/sync/perfCounters.d.ts +6 -0
- package/dist/react/sync/ydoc.d.ts +2 -0
- package/dist/react/sync/yjsSync.d.ts +3 -2
- package/dist/react/types/nodes/NodeProps.d.ts +24 -0
- package/dist/react/typings.d.ts +17 -0
- package/dist/react/utils/collaboration.d.ts +10 -1
- package/dist/react/utils/exportUtils.d.ts +0 -130
- package/dist/react/utils/geometry/edgeLabelLayout.d.ts +123 -0
- package/dist/react/utils/geometry/interfaceLabelLayout.d.ts +44 -0
- package/dist/react/utils/index.d.ts +1 -0
- package/dist/react/utils/paletteLayout.d.ts +70 -0
- package/dist/react/utils/swimlaneUtils.d.ts +58 -0
- package/dist/yjsSync-BCNFF_EI.js +45418 -0
- package/package.json +33 -8
- package/schema/uml-model-4.schema.json +1 -0
- package/dist/exportStyles-Xk-Vm7Ul.js +0 -5
- package/dist/react/exportStyles-DZCHk5mK.js +0 -6
- package/dist/react/hooks/useMessagePositioning.d.ts +0 -30
- package/dist/yjsSync-aPxjWNdZ.js +0 -50939
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
1
2
|
import { Edge } from '@xyflow/react';
|
|
2
3
|
import { EdgeProps } from '@xyflow/react';
|
|
3
4
|
import { JSX } from 'react';
|
|
4
5
|
import { Node as Node_2 } from '@xyflow/react';
|
|
5
6
|
import { NodeProps } from '@xyflow/react';
|
|
7
|
+
import { ReactNode } from 'react';
|
|
6
8
|
import { XYPosition } from '@xyflow/react';
|
|
7
9
|
|
|
8
10
|
declare function Activity({ id, width, height, data, parentId, }: NodeProps<Node_2<DefaultNodeProps>>): JSX.Element | null;
|
|
@@ -21,6 +23,21 @@ declare function ActivityMergeNode({ id, width, height, data, parentId, }: NodeP
|
|
|
21
23
|
|
|
22
24
|
declare function ActivityObjectNode({ id, width, height, data, parentId, }: NodeProps<Node_2<DefaultNodeProps>>): JSX.Element | null;
|
|
23
25
|
|
|
26
|
+
declare function ActivitySwimlane({ id, width, height, data, parentId, }: NodeProps<Node_2<ActivitySwimlaneProps>>): JSX.Element | null;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Activity-partition (swimlane) container. Lanes are equal divisions along the
|
|
30
|
+
* primary axis (columns when vertical, rows when horizontal). Elements dropped
|
|
31
|
+
* into the swimlane become its children and move with it; which lane an element
|
|
32
|
+
* belongs to is expressed by where the modeller places it, matching the UML
|
|
33
|
+
* activity-partition notation where partition membership is positional rather
|
|
34
|
+
* than stored per element.
|
|
35
|
+
*/
|
|
36
|
+
declare type ActivitySwimlaneProps = DefaultNodeProps & {
|
|
37
|
+
orientation: "vertical" | "horizontal";
|
|
38
|
+
lanes: SwimlaneLane[];
|
|
39
|
+
};
|
|
40
|
+
|
|
24
41
|
declare namespace Apollon {
|
|
25
42
|
export {
|
|
26
43
|
UMLDiagramType,
|
|
@@ -33,6 +50,7 @@ declare namespace Apollon {
|
|
|
33
50
|
CollaborationUser,
|
|
34
51
|
CollaborationCursor,
|
|
35
52
|
CollaborationViewport,
|
|
53
|
+
DraggingNode,
|
|
36
54
|
CollaborationState,
|
|
37
55
|
CollaboratorInfo,
|
|
38
56
|
ApollonCollaborationOptions,
|
|
@@ -81,8 +99,8 @@ export declare class ApollonEditor {
|
|
|
81
99
|
private readonly metadataStore;
|
|
82
100
|
private readonly popoverStore;
|
|
83
101
|
private readonly assessmentSelectionStore;
|
|
84
|
-
private readonly
|
|
85
|
-
private readonly
|
|
102
|
+
private readonly overlayStore;
|
|
103
|
+
private readonly hostRegionEls;
|
|
86
104
|
private subscribers;
|
|
87
105
|
constructor(element: HTMLElement, options?: Apollon.ApollonOptions);
|
|
88
106
|
private setReactFlowInstance;
|
|
@@ -101,10 +119,62 @@ export declare class ApollonEditor {
|
|
|
101
119
|
x: number;
|
|
102
120
|
y: number;
|
|
103
121
|
}): XYPosition | null;
|
|
122
|
+
/**
|
|
123
|
+
* Zoom/pan so the whole diagram fits, capped at `maxZoom: 1.0`. Retries up to
|
|
124
|
+
* 10 animation frames until every node is measured.
|
|
125
|
+
* @param options.padding - Scalar fraction (default `0.15`), or per-side px
|
|
126
|
+
* that adds to a 16px gutter. A per-side object forces the inset-aware path.
|
|
127
|
+
* @param options.duration - Animation duration in ms (default `200`).
|
|
128
|
+
* @param options.respectInsets - Pad the fit by reserved overlay insets
|
|
129
|
+
* (header, rails, …). Default `true`.
|
|
130
|
+
*/
|
|
104
131
|
fitView(options?: {
|
|
105
|
-
padding?: number
|
|
132
|
+
padding?: number | Partial<Record<OverlaySide, number>>;
|
|
106
133
|
duration?: number;
|
|
134
|
+
/** Pad the fit by the reserved overlay insets (header, rails, …). */
|
|
135
|
+
respectInsets?: boolean;
|
|
107
136
|
}): void;
|
|
137
|
+
/**
|
|
138
|
+
* Register a floating control, returning a disposer. Re-using an id replaces
|
|
139
|
+
* (idempotent / StrictMode-safe). Pick a façade: a React host →
|
|
140
|
+
* `<ApollonControl>`; a non-React host (or one that needs its own React
|
|
141
|
+
* root/context) → `getRegionElement` + `createPortal`; a one-off imperative
|
|
142
|
+
* widget → `addControl`.
|
|
143
|
+
* @param control - id, target region, a `render` thunk, and optional layout
|
|
144
|
+
* options ({@link OverlayControlInput}).
|
|
145
|
+
* @returns A disposer that unregisters this control; safe to call twice.
|
|
146
|
+
* @throws If `id` is empty or `region` is not a known region — mistakes fail
|
|
147
|
+
* loudly at the edge, not silently in the renderer.
|
|
148
|
+
*/
|
|
149
|
+
addControl(control: OverlayControlInput): () => void;
|
|
150
|
+
/**
|
|
151
|
+
* Patch a registered control's options/renderer (a no-op if absent).
|
|
152
|
+
* @param id - The control's immutable id (an `id` in `patch` is ignored).
|
|
153
|
+
* @param patch - Partial options/renderer merged over the existing control.
|
|
154
|
+
*/
|
|
155
|
+
updateControl(id: string, patch: Partial<OverlayControlInput>): void;
|
|
156
|
+
/**
|
|
157
|
+
* @param id - A control id.
|
|
158
|
+
* @returns `true` if a control with this id is currently registered.
|
|
159
|
+
*/
|
|
160
|
+
hasControl(id: string): boolean;
|
|
161
|
+
/**
|
|
162
|
+
* A stable DOM node anchored in `region`, for hosts that render their own
|
|
163
|
+
* React into it (via `createPortal`) to keep host context. Auto-measured, so
|
|
164
|
+
* the diagram makes room for whatever the host mounts. Lifetime = the editor;
|
|
165
|
+
* `releaseRegionElement` unregisters it. Reserved id: `apollon:host:<region>`.
|
|
166
|
+
* @param region - The region to anchor the node in.
|
|
167
|
+
* @returns The same node for the lifetime of one acquire; `releaseRegionElement`
|
|
168
|
+
* drops it and the next call returns a fresh node.
|
|
169
|
+
* @throws If `region` is not a known region.
|
|
170
|
+
*/
|
|
171
|
+
getRegionElement(region: OverlayRegion): HTMLElement;
|
|
172
|
+
/**
|
|
173
|
+
* Release a region acquired via {@link getRegionElement} (unregister + drop
|
|
174
|
+
* the cached node); a later `getRegionElement(region)` creates a fresh node.
|
|
175
|
+
* @param region - The region whose host node to release.
|
|
176
|
+
*/
|
|
177
|
+
releaseRegionElement(region: OverlayRegion): void;
|
|
108
178
|
set diagramType(type: UMLDiagramType);
|
|
109
179
|
destroy(): void;
|
|
110
180
|
/** Renders a model to SVG via a hidden, off-screen mount. */
|
|
@@ -388,6 +458,7 @@ export declare type CollaborationState = {
|
|
|
388
458
|
viewport?: CollaborationViewport | null;
|
|
389
459
|
followingClientId?: number | null;
|
|
390
460
|
selectedElementId?: string | null;
|
|
461
|
+
draggingNodes?: DraggingNode[] | null;
|
|
391
462
|
};
|
|
392
463
|
|
|
393
464
|
export declare type CollaborationUser = {
|
|
@@ -527,6 +598,7 @@ declare const diagramNodeTypes: {
|
|
|
527
598
|
activityMergeNode: typeof ActivityMergeNode;
|
|
528
599
|
activityForkNode: typeof ActivityForkNode;
|
|
529
600
|
activityForkNodeHorizontal: typeof ActivityForkNodeHorizontal;
|
|
601
|
+
activitySwimlane: typeof ActivitySwimlane;
|
|
530
602
|
useCase: typeof UseCase;
|
|
531
603
|
useCaseActor: typeof UseCaseActor;
|
|
532
604
|
useCaseSystem: typeof UseCaseSystem;
|
|
@@ -567,6 +639,23 @@ declare const diagramNodeTypes: {
|
|
|
567
639
|
sfcJump: typeof SfcJump;
|
|
568
640
|
};
|
|
569
641
|
|
|
642
|
+
/**
|
|
643
|
+
* One node a peer is actively dragging or resizing. Broadcast over the
|
|
644
|
+
* ephemeral awareness channel — never written to the Yjs document — so peers
|
|
645
|
+
* can render the in-progress gesture live without growing the CRDT or entering
|
|
646
|
+
* anyone's undo history. The settled position/size is committed once on
|
|
647
|
+
* drop/release through the document like any other edit.
|
|
648
|
+
*/
|
|
649
|
+
export declare type DraggingNode = {
|
|
650
|
+
id: string;
|
|
651
|
+
position: {
|
|
652
|
+
x: number;
|
|
653
|
+
y: number;
|
|
654
|
+
};
|
|
655
|
+
width?: number | null;
|
|
656
|
+
height?: number | null;
|
|
657
|
+
};
|
|
658
|
+
|
|
570
659
|
export declare type ExportOptions = {
|
|
571
660
|
margin?: number | {
|
|
572
661
|
top?: number;
|
|
@@ -634,6 +723,14 @@ export declare const getNodeAssessmentDataByNodeElementId: (nodeElementId: strin
|
|
|
634
723
|
*/
|
|
635
724
|
export declare function importDiagram(data: any | V3UMLModel): UMLModel;
|
|
636
725
|
|
|
726
|
+
/**
|
|
727
|
+
* How much room a control reserves so the diagram "makes way" (fed into
|
|
728
|
+
* `fitView` padding, MapLibre-style). `"auto"` measures the control via the
|
|
729
|
+
* shared ResizeObserver on the region's dominant axis; an object mixes explicit
|
|
730
|
+
* px with per-side `"auto"` (e.g. `{ top: "auto" }`).
|
|
731
|
+
*/
|
|
732
|
+
export declare type InsetContribution = "auto" | Partial<Record<OverlaySide, number | "auto">>;
|
|
733
|
+
|
|
637
734
|
export declare type InteractiveElements = {
|
|
638
735
|
elements: {
|
|
639
736
|
[id: string]: boolean;
|
|
@@ -684,6 +781,43 @@ export declare interface OrthogonalEdgeData {
|
|
|
684
781
|
points: IPoint_2[];
|
|
685
782
|
}
|
|
686
783
|
|
|
784
|
+
/** The public registration payload (options + renderer). */
|
|
785
|
+
export declare type OverlayControlInput = OverlayControlOptions & {
|
|
786
|
+
render: () => ReactNode;
|
|
787
|
+
};
|
|
788
|
+
|
|
789
|
+
export declare interface OverlayControlOptions {
|
|
790
|
+
/** Stable id. Re-adding the same id REPLACES (idempotent, StrictMode-safe). */
|
|
791
|
+
id: string;
|
|
792
|
+
/** Which band/corner the control is anchored in. */
|
|
793
|
+
region: OverlayRegion;
|
|
794
|
+
/** Reserve viewport room. Default: reserves nothing (the control floats). */
|
|
795
|
+
inset?: InsetContribution;
|
|
796
|
+
/** Stacking within a region; lower renders toward the region's anchor edge. */
|
|
797
|
+
order?: number;
|
|
798
|
+
/** When false the region frame stays pointer-transparent here too. Default true. */
|
|
799
|
+
interactive?: boolean;
|
|
800
|
+
/** Wraps the control in a `role="group"` with this aria-label. No focus
|
|
801
|
+
* management is imposed. */
|
|
802
|
+
groupLabel?: string;
|
|
803
|
+
/** Hide without unregistering (reserves no inset while hidden). Default true. */
|
|
804
|
+
visible?: boolean;
|
|
805
|
+
/** Extra class on the control's wrapper element. */
|
|
806
|
+
className?: string;
|
|
807
|
+
/** Inline styles merged onto the control's wrapper element. */
|
|
808
|
+
style?: CSSProperties;
|
|
809
|
+
}
|
|
810
|
+
|
|
811
|
+
/**
|
|
812
|
+
* Where a control is anchored. The six React Flow `<Panel>` corners are
|
|
813
|
+
* screen-space and rendered through React Flow; `header`/`left-rail`/`right-rail`
|
|
814
|
+
* are library-owned bands; `on-canvas` pans/zooms with the diagram.
|
|
815
|
+
*/
|
|
816
|
+
export declare type OverlayRegion = "top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right" | "header" | "left-rail" | "right-rail" | "on-canvas";
|
|
817
|
+
|
|
818
|
+
/** One of the four edges a control can sit against / reserve room on. */
|
|
819
|
+
export declare type OverlaySide = "top" | "right" | "bottom" | "left";
|
|
820
|
+
|
|
687
821
|
declare function Package({ id, width, height, data, parentId, }: NodeProps<Node_2<DefaultNodeProps>>): JSX.Element | null;
|
|
688
822
|
|
|
689
823
|
declare function PetriNetPlace({ id, width, height, data, }: NodeProps<Node_2<PetriNetPlaceProps>>): JSX.Element | null;
|
|
@@ -757,6 +891,19 @@ export declare type SVG = {
|
|
|
757
891
|
|
|
758
892
|
export declare type SvgExportMode = "web" | "compat";
|
|
759
893
|
|
|
894
|
+
/** A single partition (lane) inside an activity swimlane. */
|
|
895
|
+
declare type SwimlaneLane = {
|
|
896
|
+
id: string;
|
|
897
|
+
name: string;
|
|
898
|
+
/**
|
|
899
|
+
* Lane's extent along the swimlane's primary axis, in absolute flow px. The
|
|
900
|
+
* last lane is elastic (fills the remainder), so resizing the swimlane only
|
|
901
|
+
* changes the last lane. Optional: lanes without it divide the space equally,
|
|
902
|
+
* so existing saved swimlanes render as equal lanes until a separator moves.
|
|
903
|
+
*/
|
|
904
|
+
size?: number;
|
|
905
|
+
};
|
|
906
|
+
|
|
760
907
|
declare function SyntaxTreeNonterminal({ id, width, height, data, parentId, }: NodeProps<Node_2<DefaultNodeProps>>): JSX.Element | null;
|
|
761
908
|
|
|
762
909
|
declare function SyntaxTreeTerminal({ id, width, height, data, parentId, }: NodeProps<Node_2<DefaultNodeProps>>): JSX.Element | null;
|