orcasvn-react-diagrams 0.2.2 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +69 -0
- package/README.md +15 -3
- package/dist/cjs/examples.js +2616 -291
- package/dist/cjs/index.js +1186 -153
- package/dist/cjs/types/api/createDiagramEditor.d.ts +19 -1
- package/dist/cjs/types/api/index.d.ts +1 -1
- package/dist/cjs/types/api/types.d.ts +41 -0
- package/dist/cjs/types/displaybox/DisplayBoxControls.d.ts +5 -1
- package/dist/cjs/types/displaybox/demos/AsymmetricPortMultiAnchorDemoTab.d.ts +3 -0
- package/dist/cjs/types/displaybox/demos/LayoutLabelReservedSpaceDemoTab.d.ts +3 -0
- package/dist/cjs/types/displaybox/demos/VertexControlLinkSessionDemoTab.d.ts +3 -0
- package/dist/cjs/types/displaybox/demos/asymmetricPortMultiAnchorDemo.d.ts +31 -0
- package/dist/cjs/types/displaybox/demos/labelStyleDemo.d.ts +2 -0
- package/dist/cjs/types/displaybox/demos/layoutLabelReservedSpaceDemo.d.ts +11 -0
- package/dist/cjs/types/displaybox/demos/portPositionLimitsDemo.d.ts +2 -0
- package/dist/cjs/types/displaybox/demos/vertexControlLinkSessionDemo.d.ts +12 -0
- package/dist/cjs/types/displaybox/useDemoControls.d.ts +4 -0
- package/dist/cjs/types/engine/AutoLayoutService.d.ts +2 -0
- package/dist/cjs/types/engine/DiagramEngine.d.ts +11 -0
- package/dist/cjs/types/engine/LinkRoutingService.d.ts +9 -1
- package/dist/cjs/types/models/PortModel.d.ts +5 -0
- package/dist/cjs/types/renderer/RenderTypes.d.ts +3 -1
- package/dist/cjs/types/renderer/konva/KonvaInteraction.d.ts +14 -0
- package/dist/cjs/types/renderer/konva/KonvaNodeFactory.d.ts +12 -0
- package/dist/cjs/types/renderer/konva/KonvaRenderer.d.ts +2 -1
- package/dist/cjs/types/shapes/BuiltInShapes.d.ts +3 -1
- package/dist/cjs/types/strategies/ObstacleRouter.d.ts +2 -0
- package/dist/cjs/types/utils/__tests__/portGeometry.test.d.ts +1 -0
- package/dist/cjs/types/utils/portGeometry.d.ts +44 -0
- package/dist/esm/examples.js +2617 -292
- package/dist/esm/examples.js.map +1 -1
- package/dist/esm/index.js +1186 -153
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/api/createDiagramEditor.d.ts +19 -1
- package/dist/esm/types/api/index.d.ts +1 -1
- package/dist/esm/types/api/types.d.ts +41 -0
- package/dist/esm/types/displaybox/DisplayBoxControls.d.ts +5 -1
- package/dist/esm/types/displaybox/demos/AsymmetricPortMultiAnchorDemoTab.d.ts +3 -0
- package/dist/esm/types/displaybox/demos/LayoutLabelReservedSpaceDemoTab.d.ts +3 -0
- package/dist/esm/types/displaybox/demos/VertexControlLinkSessionDemoTab.d.ts +3 -0
- package/dist/esm/types/displaybox/demos/asymmetricPortMultiAnchorDemo.d.ts +31 -0
- package/dist/esm/types/displaybox/demos/labelStyleDemo.d.ts +2 -0
- package/dist/esm/types/displaybox/demos/layoutLabelReservedSpaceDemo.d.ts +11 -0
- package/dist/esm/types/displaybox/demos/portPositionLimitsDemo.d.ts +2 -0
- package/dist/esm/types/displaybox/demos/vertexControlLinkSessionDemo.d.ts +12 -0
- package/dist/esm/types/displaybox/useDemoControls.d.ts +4 -0
- package/dist/esm/types/engine/AutoLayoutService.d.ts +2 -0
- package/dist/esm/types/engine/DiagramEngine.d.ts +11 -0
- package/dist/esm/types/engine/LinkRoutingService.d.ts +9 -1
- package/dist/esm/types/models/PortModel.d.ts +5 -0
- package/dist/esm/types/renderer/RenderTypes.d.ts +3 -1
- package/dist/esm/types/renderer/konva/KonvaInteraction.d.ts +14 -0
- package/dist/esm/types/renderer/konva/KonvaNodeFactory.d.ts +12 -0
- package/dist/esm/types/renderer/konva/KonvaRenderer.d.ts +2 -1
- package/dist/esm/types/shapes/BuiltInShapes.d.ts +3 -1
- package/dist/esm/types/strategies/ObstacleRouter.d.ts +2 -0
- package/dist/esm/types/utils/__tests__/portGeometry.test.d.ts +1 -0
- package/dist/esm/types/utils/portGeometry.d.ts +44 -0
- package/dist/examples.d.ts +59 -0
- package/dist/index.d.ts +67 -1
- package/package.json +2 -1
- package/src/displaybox/demos/AsymmetricPortMultiAnchorDemoTab.tsx +269 -0
- package/src/displaybox/demos/AutoLayoutDemoTab.tsx +113 -11
- package/src/displaybox/demos/DeletionEventsDemoTab.tsx +6 -1
- package/src/displaybox/demos/EngineEventsDemoTab.tsx +5 -0
- package/src/displaybox/demos/EventHandlersDemoTab.tsx +5 -0
- package/src/displaybox/demos/ExternalDragDropDemoTab.tsx +5 -0
- package/src/displaybox/demos/LayoutLabelReservedSpaceDemoTab.tsx +291 -0
- package/src/displaybox/demos/LinkCancelDemoTab.tsx +5 -0
- package/src/displaybox/demos/ObstacleRoutingDemoTab.tsx +11 -10
- package/src/displaybox/demos/ShapeHoverControlsDemoTab.tsx +6 -1
- package/src/displaybox/demos/SimpleDemo.tsx +5 -0
- package/src/displaybox/demos/SvgPathDemoTab.tsx +5 -0
- package/src/displaybox/demos/TextLayoutDemoTab.tsx +6 -1
- package/src/displaybox/demos/VertexControlLinkSessionDemoTab.tsx +302 -0
- package/src/displaybox/demos/asymmetricPortMultiAnchorDemo.ts +357 -0
- package/src/displaybox/demos/autoLayoutDemo.ts +23 -5
- package/src/displaybox/demos/index.tsx +110 -80
- package/src/displaybox/demos/labelStyleDemo.ts +101 -0
- package/src/displaybox/demos/layoutLabelReservedSpaceDemo.ts +121 -0
- package/src/displaybox/demos/obstacleRoutingDemo.ts +212 -176
- package/src/displaybox/demos/portPositionLimitsDemo.ts +211 -0
- package/src/displaybox/demos/vertexControlLinkSessionDemo.ts +145 -0
|
@@ -74,18 +74,36 @@ const createAutoLayoutState = (): DiagramState => ({
|
|
|
74
74
|
ports: [],
|
|
75
75
|
links: [],
|
|
76
76
|
texts: [
|
|
77
|
-
{
|
|
77
|
+
{
|
|
78
|
+
id: 'label-layout-row',
|
|
79
|
+
content: 'Row parent label lane',
|
|
80
|
+
position: { x: 8, y: 6 },
|
|
81
|
+
ownerId: 'layout-row',
|
|
82
|
+
layout: { boundsMode: 'owner-width', wrap: 'word', overflow: 'clip', padding: 0 },
|
|
83
|
+
},
|
|
78
84
|
{ id: 'label-row-a', content: 'row-a', position: { x: 6, y: -14 }, ownerId: 'row-a' },
|
|
79
85
|
{ id: 'label-row-b', content: 'row-b', position: { x: 6, y: -14 }, ownerId: 'row-b' },
|
|
80
86
|
{ id: 'label-row-c', content: 'row-c', position: { x: 6, y: -14 }, ownerId: 'row-c' },
|
|
81
87
|
{ id: 'label-row-nested-owner', content: 'owns children', position: { x: 6, y: -16 }, ownerId: 'row-nested-owner' },
|
|
82
88
|
|
|
83
|
-
{
|
|
89
|
+
{
|
|
90
|
+
id: 'label-layout-column',
|
|
91
|
+
content: 'Column parent label lane',
|
|
92
|
+
position: { x: 8, y: 6 },
|
|
93
|
+
ownerId: 'layout-column',
|
|
94
|
+
layout: { boundsMode: 'owner-width', wrap: 'word', overflow: 'clip', padding: 0 },
|
|
95
|
+
},
|
|
84
96
|
{ id: 'label-col-a', content: 'col-a', position: { x: 6, y: -14 }, ownerId: 'col-a' },
|
|
85
97
|
{ id: 'label-col-b', content: 'col-b', position: { x: 6, y: -14 }, ownerId: 'col-b' },
|
|
86
98
|
{ id: 'label-col-c', content: 'col-c', position: { x: 6, y: -14 }, ownerId: 'col-c' },
|
|
87
99
|
|
|
88
|
-
{
|
|
100
|
+
{
|
|
101
|
+
id: 'label-layout-nested',
|
|
102
|
+
content: 'Row + nested column lane',
|
|
103
|
+
position: { x: 6, y: 6 },
|
|
104
|
+
ownerId: 'layout-nested',
|
|
105
|
+
layout: { boundsMode: 'owner-width', wrap: 'word', overflow: 'clip', padding: 0 },
|
|
106
|
+
},
|
|
89
107
|
{ id: 'label-nested-stack', content: 'nested stack', position: { x: 6, y: -16 }, ownerId: 'nested-stack' },
|
|
90
108
|
{ id: 'label-stack-a', content: 'stack-a', position: { x: 6, y: -14 }, ownerId: 'stack-a' },
|
|
91
109
|
{ id: 'label-stack-b', content: 'stack-b', position: { x: 6, y: -14 }, ownerId: 'stack-b' },
|
|
@@ -100,8 +118,8 @@ const createAutoLayoutState = (): DiagramState => ({
|
|
|
100
118
|
|
|
101
119
|
export const autoLayoutDemoConfig: DemoConfig = ({
|
|
102
120
|
id: 'auto-layout',
|
|
103
|
-
title: 'Element Auto-Layout',
|
|
104
|
-
description: '
|
|
121
|
+
title: 'Element Auto-Layout + Label Lane',
|
|
122
|
+
description: 'Consolidated auto-layout verification with baseline/nested containers, fit options, and label reserved-space modes.',
|
|
105
123
|
createState: createAutoLayoutState,
|
|
106
124
|
elementShapes: baseElementShapes,
|
|
107
125
|
portShapes: basePortShapes,
|
|
@@ -8,36 +8,42 @@ import { textDemoConfig } from './textDemo';
|
|
|
8
8
|
import { selectionDemoConfig } from './selectionDemo';
|
|
9
9
|
import { eventHandlersDemoConfig } from './eventHandlersDemo';
|
|
10
10
|
import { engineEventsDemoConfig } from './engineEventsDemo';
|
|
11
|
-
import { linkCancelDemoConfig } from './linkCancelDemo';
|
|
12
|
-
import { autoLayoutDemoConfig } from './autoLayoutDemo';
|
|
11
|
+
import { linkCancelDemoConfig } from './linkCancelDemo';
|
|
12
|
+
import { autoLayoutDemoConfig } from './autoLayoutDemo';
|
|
13
13
|
import { externalDragDropDemoConfig } from './externalDragDropDemo';
|
|
14
|
-
import { shapeGalleryDemoConfig } from './shapeGalleryDemo';
|
|
15
|
-
import { svgPathDemoConfig } from './svgPathDemo';
|
|
16
|
-
import { roundedRectRadiusDemoConfig } from './roundedRectRadiusDemo';
|
|
17
|
-
import { rotatedCreationDemoConfig } from './rotatedCreationDemo';
|
|
18
|
-
import { multiLevelTreeDemoConfig } from './multiLevelTreeDemo';
|
|
14
|
+
import { shapeGalleryDemoConfig } from './shapeGalleryDemo';
|
|
15
|
+
import { svgPathDemoConfig } from './svgPathDemo';
|
|
16
|
+
import { roundedRectRadiusDemoConfig } from './roundedRectRadiusDemo';
|
|
17
|
+
import { rotatedCreationDemoConfig } from './rotatedCreationDemo';
|
|
18
|
+
import { multiLevelTreeDemoConfig } from './multiLevelTreeDemo';
|
|
19
19
|
import { multipleElementsDemoConfig } from './multipleElementsDemo';
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
20
|
+
import { asymmetricPortMultiAnchorDemoConfig } from './asymmetricPortMultiAnchorDemo';
|
|
21
|
+
import { portConstraintsDemoConfig } from './portConstraintsDemo';
|
|
22
|
+
import { portPositionLimitsDemoConfig } from './portPositionLimitsDemo';
|
|
23
|
+
import { portBorderDemoConfig } from './portBorderDemo';
|
|
24
|
+
import { childConstraintsDemoConfig } from './childConstraintsDemo';
|
|
25
|
+
import { labelStyleDemoConfig } from './labelStyleDemo';
|
|
23
26
|
import { gridOverlayDemoConfig } from './gridOverlayDemo';
|
|
24
27
|
import { routingDemoConfig } from './routingDemo';
|
|
25
|
-
import { obstacleRoutingDemoConfig } from './obstacleRoutingDemo';
|
|
26
|
-
import { linkBendHandlesDemoConfig } from './linkBendHandlesDemo';
|
|
27
|
-
import { deletionEventsDemoConfig } from './deletionEventsDemo';
|
|
28
|
+
import { obstacleRoutingDemoConfig } from './obstacleRoutingDemo';
|
|
29
|
+
import { linkBendHandlesDemoConfig } from './linkBendHandlesDemo';
|
|
30
|
+
import { deletionEventsDemoConfig } from './deletionEventsDemo';
|
|
28
31
|
import { shapeBorderMovementDemoConfig } from './shapeBorderMovementDemo';
|
|
29
32
|
import { shapeHoverControlsDemoConfig } from './shapeHoverControlsDemo';
|
|
30
|
-
import
|
|
31
|
-
import
|
|
33
|
+
import { vertexControlLinkSessionDemoConfig } from './vertexControlLinkSessionDemo';
|
|
34
|
+
import EventHandlersDemo from './EventHandlersDemoTab';
|
|
35
|
+
import EngineEventsDemo from './EngineEventsDemoTab';
|
|
32
36
|
import LinkCancelDemo from './LinkCancelDemoTab';
|
|
33
37
|
import AutoLayoutDemo from './AutoLayoutDemoTab';
|
|
34
|
-
import ExternalDragDropDemo from './ExternalDragDropDemoTab';
|
|
35
|
-
import SvgPathDemo from './SvgPathDemoTab';
|
|
36
|
-
import TextLayoutDemo from './TextLayoutDemoTab';
|
|
37
|
-
import SimpleDemo from './SimpleDemo';
|
|
38
|
-
import ObstacleRoutingDemo from './ObstacleRoutingDemoTab';
|
|
39
|
-
import DeletionEventsDemo from './DeletionEventsDemoTab';
|
|
38
|
+
import ExternalDragDropDemo from './ExternalDragDropDemoTab';
|
|
39
|
+
import SvgPathDemo from './SvgPathDemoTab';
|
|
40
|
+
import TextLayoutDemo from './TextLayoutDemoTab';
|
|
41
|
+
import SimpleDemo from './SimpleDemo';
|
|
42
|
+
import ObstacleRoutingDemo from './ObstacleRoutingDemoTab';
|
|
43
|
+
import DeletionEventsDemo from './DeletionEventsDemoTab';
|
|
40
44
|
import ShapeHoverControlsDemo from './ShapeHoverControlsDemoTab';
|
|
45
|
+
import AsymmetricPortMultiAnchorDemo from './AsymmetricPortMultiAnchorDemoTab';
|
|
46
|
+
import VertexControlLinkSessionDemo from './VertexControlLinkSessionDemoTab';
|
|
41
47
|
|
|
42
48
|
export {
|
|
43
49
|
baseElementShapes,
|
|
@@ -76,12 +82,12 @@ export const demoTabs: DemoDefinition[] = [
|
|
|
76
82
|
description: customDemoConfig.description,
|
|
77
83
|
Component: wrapSimpleDemo(customDemoConfig),
|
|
78
84
|
},
|
|
79
|
-
{
|
|
80
|
-
id: textDemoConfig.id,
|
|
81
|
-
title: textDemoConfig.title,
|
|
82
|
-
description: textDemoConfig.description,
|
|
83
|
-
Component: TextLayoutDemo,
|
|
84
|
-
},
|
|
85
|
+
{
|
|
86
|
+
id: textDemoConfig.id,
|
|
87
|
+
title: textDemoConfig.title,
|
|
88
|
+
description: textDemoConfig.description,
|
|
89
|
+
Component: TextLayoutDemo,
|
|
90
|
+
},
|
|
85
91
|
{
|
|
86
92
|
id: selectionDemoConfig.id,
|
|
87
93
|
title: selectionDemoConfig.title,
|
|
@@ -94,24 +100,24 @@ export const demoTabs: DemoDefinition[] = [
|
|
|
94
100
|
description: eventHandlersDemoConfig.description,
|
|
95
101
|
Component: EventHandlersDemo,
|
|
96
102
|
},
|
|
97
|
-
{
|
|
98
|
-
id: engineEventsDemoConfig.id,
|
|
99
|
-
title: engineEventsDemoConfig.title,
|
|
100
|
-
description: engineEventsDemoConfig.description,
|
|
101
|
-
Component: EngineEventsDemo,
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
id: deletionEventsDemoConfig.id,
|
|
105
|
-
title: deletionEventsDemoConfig.title,
|
|
106
|
-
description: deletionEventsDemoConfig.description,
|
|
107
|
-
Component: DeletionEventsDemo,
|
|
108
|
-
},
|
|
109
103
|
{
|
|
110
|
-
id:
|
|
111
|
-
title:
|
|
112
|
-
description:
|
|
113
|
-
Component:
|
|
104
|
+
id: engineEventsDemoConfig.id,
|
|
105
|
+
title: engineEventsDemoConfig.title,
|
|
106
|
+
description: engineEventsDemoConfig.description,
|
|
107
|
+
Component: EngineEventsDemo,
|
|
114
108
|
},
|
|
109
|
+
{
|
|
110
|
+
id: deletionEventsDemoConfig.id,
|
|
111
|
+
title: deletionEventsDemoConfig.title,
|
|
112
|
+
description: deletionEventsDemoConfig.description,
|
|
113
|
+
Component: DeletionEventsDemo,
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
id: autoLayoutDemoConfig.id,
|
|
117
|
+
title: autoLayoutDemoConfig.title,
|
|
118
|
+
description: autoLayoutDemoConfig.description,
|
|
119
|
+
Component: AutoLayoutDemo,
|
|
120
|
+
},
|
|
115
121
|
{
|
|
116
122
|
id: linkCancelDemoConfig.id,
|
|
117
123
|
title: linkCancelDemoConfig.title,
|
|
@@ -124,30 +130,36 @@ export const demoTabs: DemoDefinition[] = [
|
|
|
124
130
|
description: externalDragDropDemoConfig.description,
|
|
125
131
|
Component: ExternalDragDropDemo,
|
|
126
132
|
},
|
|
127
|
-
{
|
|
128
|
-
id: shapeGalleryDemoConfig.id,
|
|
129
|
-
title: shapeGalleryDemoConfig.title,
|
|
130
|
-
description: shapeGalleryDemoConfig.description,
|
|
131
|
-
Component: wrapSimpleDemo(shapeGalleryDemoConfig),
|
|
132
|
-
},
|
|
133
|
-
{
|
|
134
|
-
id: roundedRectRadiusDemoConfig.id,
|
|
135
|
-
title: roundedRectRadiusDemoConfig.title,
|
|
136
|
-
description: roundedRectRadiusDemoConfig.description,
|
|
137
|
-
Component: wrapSimpleDemo(roundedRectRadiusDemoConfig),
|
|
138
|
-
},
|
|
139
|
-
{
|
|
140
|
-
id: rotatedCreationDemoConfig.id,
|
|
141
|
-
title: rotatedCreationDemoConfig.title,
|
|
142
|
-
description: rotatedCreationDemoConfig.description,
|
|
143
|
-
Component: wrapSimpleDemo(rotatedCreationDemoConfig),
|
|
144
|
-
},
|
|
145
|
-
{
|
|
146
|
-
id: svgPathDemoConfig.id,
|
|
147
|
-
title: svgPathDemoConfig.title,
|
|
133
|
+
{
|
|
134
|
+
id: shapeGalleryDemoConfig.id,
|
|
135
|
+
title: shapeGalleryDemoConfig.title,
|
|
136
|
+
description: shapeGalleryDemoConfig.description,
|
|
137
|
+
Component: wrapSimpleDemo(shapeGalleryDemoConfig),
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
id: roundedRectRadiusDemoConfig.id,
|
|
141
|
+
title: roundedRectRadiusDemoConfig.title,
|
|
142
|
+
description: roundedRectRadiusDemoConfig.description,
|
|
143
|
+
Component: wrapSimpleDemo(roundedRectRadiusDemoConfig),
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
id: rotatedCreationDemoConfig.id,
|
|
147
|
+
title: rotatedCreationDemoConfig.title,
|
|
148
|
+
description: rotatedCreationDemoConfig.description,
|
|
149
|
+
Component: wrapSimpleDemo(rotatedCreationDemoConfig),
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
id: svgPathDemoConfig.id,
|
|
153
|
+
title: svgPathDemoConfig.title,
|
|
148
154
|
description: svgPathDemoConfig.description,
|
|
149
155
|
Component: SvgPathDemo,
|
|
150
156
|
},
|
|
157
|
+
{
|
|
158
|
+
id: asymmetricPortMultiAnchorDemoConfig.id,
|
|
159
|
+
title: asymmetricPortMultiAnchorDemoConfig.title,
|
|
160
|
+
description: asymmetricPortMultiAnchorDemoConfig.description,
|
|
161
|
+
Component: AsymmetricPortMultiAnchorDemo,
|
|
162
|
+
},
|
|
151
163
|
{
|
|
152
164
|
id: multiLevelTreeDemoConfig.id,
|
|
153
165
|
title: multiLevelTreeDemoConfig.title,
|
|
@@ -160,24 +172,36 @@ export const demoTabs: DemoDefinition[] = [
|
|
|
160
172
|
description: multipleElementsDemoConfig.description,
|
|
161
173
|
Component: wrapSimpleDemo(multipleElementsDemoConfig),
|
|
162
174
|
},
|
|
163
|
-
{
|
|
164
|
-
id: portConstraintsDemoConfig.id,
|
|
165
|
-
title: portConstraintsDemoConfig.title,
|
|
166
|
-
description: portConstraintsDemoConfig.description,
|
|
167
|
-
Component: wrapSimpleDemo(portConstraintsDemoConfig),
|
|
168
|
-
},
|
|
169
175
|
{
|
|
170
|
-
id:
|
|
171
|
-
title:
|
|
172
|
-
description:
|
|
173
|
-
Component: wrapSimpleDemo(
|
|
176
|
+
id: portConstraintsDemoConfig.id,
|
|
177
|
+
title: portConstraintsDemoConfig.title,
|
|
178
|
+
description: portConstraintsDemoConfig.description,
|
|
179
|
+
Component: wrapSimpleDemo(portConstraintsDemoConfig),
|
|
174
180
|
},
|
|
175
181
|
{
|
|
176
|
-
id:
|
|
177
|
-
title:
|
|
178
|
-
description:
|
|
179
|
-
Component: wrapSimpleDemo(
|
|
182
|
+
id: portPositionLimitsDemoConfig.id,
|
|
183
|
+
title: portPositionLimitsDemoConfig.title,
|
|
184
|
+
description: portPositionLimitsDemoConfig.description,
|
|
185
|
+
Component: wrapSimpleDemo(portPositionLimitsDemoConfig),
|
|
180
186
|
},
|
|
187
|
+
{
|
|
188
|
+
id: labelStyleDemoConfig.id,
|
|
189
|
+
title: labelStyleDemoConfig.title,
|
|
190
|
+
description: labelStyleDemoConfig.description,
|
|
191
|
+
Component: wrapSimpleDemo(labelStyleDemoConfig),
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
id: portBorderDemoConfig.id,
|
|
195
|
+
title: portBorderDemoConfig.title,
|
|
196
|
+
description: portBorderDemoConfig.description,
|
|
197
|
+
Component: wrapSimpleDemo(portBorderDemoConfig),
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
id: shapeBorderMovementDemoConfig.id,
|
|
201
|
+
title: shapeBorderMovementDemoConfig.title,
|
|
202
|
+
description: shapeBorderMovementDemoConfig.description,
|
|
203
|
+
Component: wrapSimpleDemo(shapeBorderMovementDemoConfig),
|
|
204
|
+
},
|
|
181
205
|
{
|
|
182
206
|
id: shapeHoverControlsDemoConfig.id,
|
|
183
207
|
title: shapeHoverControlsDemoConfig.title,
|
|
@@ -185,8 +209,14 @@ export const demoTabs: DemoDefinition[] = [
|
|
|
185
209
|
Component: ShapeHoverControlsDemo,
|
|
186
210
|
},
|
|
187
211
|
{
|
|
188
|
-
id:
|
|
189
|
-
title:
|
|
212
|
+
id: vertexControlLinkSessionDemoConfig.id,
|
|
213
|
+
title: vertexControlLinkSessionDemoConfig.title,
|
|
214
|
+
description: vertexControlLinkSessionDemoConfig.description,
|
|
215
|
+
Component: VertexControlLinkSessionDemo,
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
id: childConstraintsDemoConfig.id,
|
|
219
|
+
title: childConstraintsDemoConfig.title,
|
|
190
220
|
description: childConstraintsDemoConfig.description,
|
|
191
221
|
Component: wrapSimpleDemo(childConstraintsDemoConfig),
|
|
192
222
|
},
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import type { DiagramState } from '../../api';
|
|
2
|
+
import type { DemoConfig } from '../types';
|
|
3
|
+
import { baseElementShapes, basePortShapes } from './shared';
|
|
4
|
+
|
|
5
|
+
const createLabelStyleState = (): DiagramState => ({
|
|
6
|
+
elements: [
|
|
7
|
+
{
|
|
8
|
+
id: 'label-center-host',
|
|
9
|
+
position: { x: 80, y: 160 },
|
|
10
|
+
size: { width: 260, height: 120 },
|
|
11
|
+
shapeId: 'panel',
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
id: 'label-background-host',
|
|
15
|
+
position: { x: 390, y: 160 },
|
|
16
|
+
size: { width: 260, height: 120 },
|
|
17
|
+
shapeId: 'panel',
|
|
18
|
+
style: {
|
|
19
|
+
cornerRadius: 16,
|
|
20
|
+
stroke: '#1f4d99',
|
|
21
|
+
strokeWidth: 2,
|
|
22
|
+
fill: '#edf4ff',
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
id: 'label-baseline-host',
|
|
27
|
+
position: { x: 700, y: 160 },
|
|
28
|
+
size: { width: 260, height: 120 },
|
|
29
|
+
shapeId: 'panel',
|
|
30
|
+
},
|
|
31
|
+
],
|
|
32
|
+
ports: [],
|
|
33
|
+
links: [],
|
|
34
|
+
texts: [
|
|
35
|
+
{
|
|
36
|
+
id: 'label-style-intro',
|
|
37
|
+
content: 'Compare center alignment, background fill, and baseline label styling. Resize hosts to verify visual stability.',
|
|
38
|
+
position: { x: 80, y: 80 },
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
id: 'label-center-text',
|
|
42
|
+
content: 'Center aligned owner-width label',
|
|
43
|
+
ownerId: 'label-center-host',
|
|
44
|
+
position: { x: 0, y: 44 },
|
|
45
|
+
layout: { boundsMode: 'owner-width', wrap: 'none', overflow: 'ellipsis-end', padding: 8 },
|
|
46
|
+
style: { align: 'center', fill: '#16324f', fontSize: 15 },
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
id: 'label-background-text',
|
|
50
|
+
content: 'Top Header Label',
|
|
51
|
+
ownerId: 'label-background-host',
|
|
52
|
+
position: { x: 0, y: 0 },
|
|
53
|
+
layout: { boundsMode: 'owner-width', wrap: 'none', overflow: 'ellipsis-end', padding: 0 },
|
|
54
|
+
style: {
|
|
55
|
+
align: 'center',
|
|
56
|
+
backgroundFill: '#cfe2ff',
|
|
57
|
+
backgroundStroke: '#1f4d99',
|
|
58
|
+
backgroundStrokeWidth: 1,
|
|
59
|
+
fill: '#16324f',
|
|
60
|
+
fontSize: 15,
|
|
61
|
+
padding: 8,
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
id: 'label-baseline-text',
|
|
66
|
+
content: 'Baseline label (no style keys)',
|
|
67
|
+
ownerId: 'label-baseline-host',
|
|
68
|
+
position: { x: 12, y: 44 },
|
|
69
|
+
layout: { boundsMode: 'owner-width', wrap: 'none', overflow: 'ellipsis-end', padding: 8 },
|
|
70
|
+
},
|
|
71
|
+
],
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
export const labelStyleDemoConfig: DemoConfig = {
|
|
75
|
+
id: 'label-style',
|
|
76
|
+
title: 'Label Style',
|
|
77
|
+
description: 'Center text alignment and backgroundFill styling for labels.',
|
|
78
|
+
createState: createLabelStyleState,
|
|
79
|
+
elementShapes: baseElementShapes,
|
|
80
|
+
portShapes: basePortShapes,
|
|
81
|
+
defaultElementShapeId: 'default',
|
|
82
|
+
defaultPortShapeId: 'port-circle',
|
|
83
|
+
actions: [
|
|
84
|
+
{
|
|
85
|
+
id: 'resize-label-hosts',
|
|
86
|
+
label: 'Resize hosts (style verification)',
|
|
87
|
+
run: (editor, state) => {
|
|
88
|
+
const expanded = (state.elements.find((item) => item.id === 'label-center-host')?.size.width ?? 0) > 260;
|
|
89
|
+
if (expanded) {
|
|
90
|
+
editor.resizeElement('label-center-host', 260, 120);
|
|
91
|
+
editor.resizeElement('label-background-host', 260, 120);
|
|
92
|
+
editor.resizeElement('label-baseline-host', 260, 120);
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
editor.resizeElement('label-center-host', 320, 140);
|
|
96
|
+
editor.resizeElement('label-background-host', 320, 140);
|
|
97
|
+
editor.resizeElement('label-baseline-host', 320, 140);
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
],
|
|
101
|
+
};
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import type { DiagramState } from '../../api';
|
|
2
|
+
import type { DemoConfig } from '../types';
|
|
3
|
+
import { baseElementShapes, basePortShapes } from './shared';
|
|
4
|
+
|
|
5
|
+
export const layoutReservedDemoIds = {
|
|
6
|
+
parent: 'layout-lane-parent',
|
|
7
|
+
childA: 'layout-lane-child-a',
|
|
8
|
+
childB: 'layout-lane-child-b',
|
|
9
|
+
nestedParent: 'layout-lane-nested-parent',
|
|
10
|
+
nestedChildA: 'layout-lane-nested-child-a',
|
|
11
|
+
nestedChildB: 'layout-lane-nested-child-b',
|
|
12
|
+
parentLabel: 'layout-lane-parent-label',
|
|
13
|
+
} as const;
|
|
14
|
+
|
|
15
|
+
const createLayoutReservedState = (): DiagramState => ({
|
|
16
|
+
elements: [
|
|
17
|
+
{
|
|
18
|
+
id: layoutReservedDemoIds.parent,
|
|
19
|
+
position: { x: 70, y: 90 },
|
|
20
|
+
size: { width: 520, height: 260 },
|
|
21
|
+
shapeId: 'panel',
|
|
22
|
+
layout: {
|
|
23
|
+
mode: 'horizontal',
|
|
24
|
+
padding: 12,
|
|
25
|
+
gap: 10,
|
|
26
|
+
align: 'start',
|
|
27
|
+
childFitMainAxis: 'none',
|
|
28
|
+
childFitCrossAxis: 'none',
|
|
29
|
+
labelReservedSpace: { mode: 'none' },
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
id: layoutReservedDemoIds.childA,
|
|
34
|
+
parentId: layoutReservedDemoIds.parent,
|
|
35
|
+
position: { x: 0, y: 0 },
|
|
36
|
+
size: { width: 110, height: 70 },
|
|
37
|
+
shapeId: 'default',
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
id: layoutReservedDemoIds.childB,
|
|
41
|
+
parentId: layoutReservedDemoIds.parent,
|
|
42
|
+
position: { x: 0, y: 0 },
|
|
43
|
+
size: { width: 130, height: 60 },
|
|
44
|
+
shapeId: 'default',
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
id: layoutReservedDemoIds.nestedParent,
|
|
48
|
+
parentId: layoutReservedDemoIds.parent,
|
|
49
|
+
position: { x: 0, y: 0 },
|
|
50
|
+
size: { width: 190, height: 140 },
|
|
51
|
+
shapeId: 'default',
|
|
52
|
+
layout: {
|
|
53
|
+
mode: 'vertical',
|
|
54
|
+
padding: 8,
|
|
55
|
+
gap: 8,
|
|
56
|
+
align: 'start',
|
|
57
|
+
labelReservedSpace: { mode: 'fixed', size: 20 },
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
id: layoutReservedDemoIds.nestedChildA,
|
|
62
|
+
parentId: layoutReservedDemoIds.nestedParent,
|
|
63
|
+
position: { x: 0, y: 0 },
|
|
64
|
+
size: { width: 120, height: 26 },
|
|
65
|
+
shapeId: 'default',
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
id: layoutReservedDemoIds.nestedChildB,
|
|
69
|
+
parentId: layoutReservedDemoIds.nestedParent,
|
|
70
|
+
position: { x: 0, y: 0 },
|
|
71
|
+
size: { width: 150, height: 30 },
|
|
72
|
+
shapeId: 'default',
|
|
73
|
+
},
|
|
74
|
+
],
|
|
75
|
+
ports: [],
|
|
76
|
+
links: [],
|
|
77
|
+
texts: [
|
|
78
|
+
{
|
|
79
|
+
id: layoutReservedDemoIds.parentLabel,
|
|
80
|
+
ownerId: layoutReservedDemoIds.parent,
|
|
81
|
+
content: 'Parent label lane demo',
|
|
82
|
+
position: { x: 10, y: 6 },
|
|
83
|
+
style: { fontSize: 13, fontFamily: 'sans-serif' },
|
|
84
|
+
layout: { boundsMode: 'owner-width', wrap: 'word', overflow: 'clip', padding: 0 },
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
id: 'layout-lane-child-a-label',
|
|
88
|
+
ownerId: layoutReservedDemoIds.childA,
|
|
89
|
+
content: 'child-a',
|
|
90
|
+
position: { x: 8, y: -14 },
|
|
91
|
+
style: { fontSize: 12, fontFamily: 'sans-serif' },
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
id: 'layout-lane-child-b-label',
|
|
95
|
+
ownerId: layoutReservedDemoIds.childB,
|
|
96
|
+
content: 'child-b',
|
|
97
|
+
position: { x: 8, y: -14 },
|
|
98
|
+
style: { fontSize: 12, fontFamily: 'sans-serif' },
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
id: 'layout-lane-nested-parent-label',
|
|
102
|
+
ownerId: layoutReservedDemoIds.nestedParent,
|
|
103
|
+
content: 'nested layout parent',
|
|
104
|
+
position: { x: 8, y: -14 },
|
|
105
|
+
style: { fontSize: 12, fontFamily: 'sans-serif' },
|
|
106
|
+
},
|
|
107
|
+
],
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
export const layoutLabelReservedSpaceDemoConfig: DemoConfig = {
|
|
111
|
+
id: 'layout-label-reserved-space',
|
|
112
|
+
title: 'Layout Label Reserved Space',
|
|
113
|
+
description:
|
|
114
|
+
'Reserve top label lane for child layouts (none/fixed/flexible) and verify distribute/stretch plus nested layout behavior within adjusted child bounds.',
|
|
115
|
+
createState: createLayoutReservedState,
|
|
116
|
+
elementShapes: baseElementShapes,
|
|
117
|
+
portShapes: basePortShapes,
|
|
118
|
+
defaultElementShapeId: 'default',
|
|
119
|
+
defaultPortShapeId: 'port-circle',
|
|
120
|
+
actions: [],
|
|
121
|
+
};
|