@bpmnkit/core 1.13.0 → 1.15.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/AGENTS.md +5 -4
- package/README.md +1 -0
- package/agent-cards/bpmn.md +86 -80
- package/builder-reference.md +26 -8
- package/dist/bpmn/auto-layout.js +61 -2
- package/dist/bpmn/bpmn-builder.d.ts +60 -12
- package/dist/bpmn/bpmn-builder.js +428 -30
- package/dist/bpmn/compact.d.ts +2 -0
- package/dist/bpmn/compact.js +10 -3
- package/dist/bpmn/make-room.d.ts +26 -0
- package/dist/bpmn/make-room.js +151 -0
- package/dist/bpmn/optimize/flow.js +8 -0
- package/dist/bpmn/place-new-shapes.d.ts +6 -1
- package/dist/bpmn/place-new-shapes.js +53 -2
- package/dist/bpmn/process-text.d.ts +7 -1
- package/dist/bpmn/process-text.js +60 -5
- package/dist/bpmn/svg-render.d.ts +155 -0
- package/dist/bpmn/svg-render.js +782 -0
- package/dist/bpmn/svg.d.ts +5 -131
- package/dist/bpmn/svg.js +8 -766
- package/dist/form/user-task-forms.d.ts +45 -0
- package/dist/form/user-task-forms.js +129 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +2 -0
- package/dist/layout/collaboration/message-labels.d.ts +25 -0
- package/dist/layout/collaboration/message-labels.js +108 -0
- package/dist/layout/collaboration/ordering.d.ts +5 -1
- package/dist/layout/collaboration/ordering.js +24 -9
- package/dist/layout/semantic/graph.js +3 -0
- package/dist/layout/semantic/place.js +49 -0
- package/llms.txt +1 -1
- package/package.json +5 -1
package/dist/bpmn/svg.d.ts
CHANGED
|
@@ -1,96 +1,8 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import { type
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
shapeFill: string;
|
|
7
|
-
shapeStroke: string;
|
|
8
|
-
flowStroke: string;
|
|
9
|
-
text: string;
|
|
10
|
-
poolHeader: string;
|
|
11
|
-
textHalo: string;
|
|
12
|
-
}
|
|
13
|
-
type Theme = SvgThemeColors;
|
|
14
|
-
/** Theme colours plus the resolved font settings every text helper needs. */
|
|
15
|
-
export interface SvgCtx extends Theme {
|
|
16
|
-
fontFamily: string;
|
|
17
|
-
fontSize: number;
|
|
18
|
-
lineH: number;
|
|
19
|
-
}
|
|
20
|
-
export interface SvgExportOptions {
|
|
21
|
-
/** Visual theme: a preset name or a full custom palette. Default: "light". */
|
|
22
|
-
theme?: "light" | "dark" | SvgThemeColors;
|
|
23
|
-
/** Padding around the diagram content in pixels. Default: 20. */
|
|
24
|
-
padding?: number;
|
|
25
|
-
/** Multiplies `width`/`height` only; the viewBox is unchanged. Default: 1. */
|
|
26
|
-
scale?: number;
|
|
27
|
-
/**
|
|
28
|
-
* Fit-inside box `[width, height]` (e.g. a chat thumbnail). Applied after
|
|
29
|
-
* `scale`; never upscales. Only `width`/`height` change.
|
|
30
|
-
*/
|
|
31
|
-
maxSize?: [number, number];
|
|
32
|
-
/**
|
|
33
|
-
* `"di"` honours `bioc:`/`color:` fill and stroke from the diagram interchange.
|
|
34
|
-
* Default: `"ignore"`.
|
|
35
|
-
*/
|
|
36
|
-
colors?: "ignore" | "di";
|
|
37
|
-
/**
|
|
38
|
-
* Which plane to draw. `{ id }` matches a `BPMNDiagram` or plane id,
|
|
39
|
-
* `{ process }` the element a plane points at (e.g. a collapsed sub-process).
|
|
40
|
-
* Default: the first diagram. Throws when nothing matches.
|
|
41
|
-
*/
|
|
42
|
-
plane?: {
|
|
43
|
-
id: string;
|
|
44
|
-
} | {
|
|
45
|
-
process: string;
|
|
46
|
-
};
|
|
47
|
-
/** Lay out the model first when the chosen plane has no shapes. Default: false. */
|
|
48
|
-
autoLayout?: boolean;
|
|
49
|
-
/** Label font. Defaults: `system-ui,-apple-system,sans-serif`, 11px, 14px line height. */
|
|
50
|
-
font?: {
|
|
51
|
-
family?: string;
|
|
52
|
-
size?: number;
|
|
53
|
-
lineHeight?: number;
|
|
54
|
-
};
|
|
55
|
-
/** Add `data-element-id="…"` to each element's `<g>`/`<path>`. Default: false. */
|
|
56
|
-
elementIds?: boolean;
|
|
57
|
-
/** `false` omits the background `<rect>` (transparent). Default: true. */
|
|
58
|
-
background?: boolean;
|
|
59
|
-
}
|
|
60
|
-
export type SvgElementKind = BpmnFlowElement["type"] | "sequenceFlow" | "messageFlow" | "association" | "participant" | "lane" | "textAnnotation" | "group";
|
|
61
|
-
export type SvgGeometry = {
|
|
62
|
-
kind: "shape";
|
|
63
|
-
bounds: BpmnBounds;
|
|
64
|
-
} | {
|
|
65
|
-
kind: "edge";
|
|
66
|
-
waypoints: Array<[number, number]>;
|
|
67
|
-
};
|
|
68
|
-
/** An element that was actually drawn. */
|
|
69
|
-
export interface SvgRenderedElement {
|
|
70
|
-
id: string;
|
|
71
|
-
kind: SvgElementKind;
|
|
72
|
-
geometry: SvgGeometry;
|
|
73
|
-
}
|
|
74
|
-
export type SvgWarning = {
|
|
75
|
-
type: "autoLayoutApplied";
|
|
76
|
-
} | {
|
|
77
|
-
type: "elementWithoutDi";
|
|
78
|
-
id: string;
|
|
79
|
-
};
|
|
80
|
-
export interface SvgExportResult {
|
|
81
|
-
svg: string;
|
|
82
|
-
viewBox: {
|
|
83
|
-
x: number;
|
|
84
|
-
y: number;
|
|
85
|
-
w: number;
|
|
86
|
-
h: number;
|
|
87
|
-
};
|
|
88
|
-
/** CSS px after `scale` and `maxSize`. */
|
|
89
|
-
width: number;
|
|
90
|
-
height: number;
|
|
91
|
-
elements: SvgRenderedElement[];
|
|
92
|
-
warnings: SvgWarning[];
|
|
93
|
-
}
|
|
1
|
+
import type { BpmnDefinitions } from "./bpmn-model.js";
|
|
2
|
+
import { type SvgExportOptions, type SvgExportResult } from "./svg-render.js";
|
|
3
|
+
export * from "./svg-render.js";
|
|
4
|
+
/** Like {@link exportSvg}, plus the drawn size, viewBox, element geometry and warnings. */
|
|
5
|
+
export declare function exportSvgDetailed(defs: BpmnDefinitions, options?: SvgExportOptions): SvgExportResult;
|
|
94
6
|
/**
|
|
95
7
|
* Generates a self-contained SVG string from a `BpmnDefinitions` object.
|
|
96
8
|
*
|
|
@@ -118,42 +30,4 @@ export interface SvgExportResult {
|
|
|
118
30
|
* ```
|
|
119
31
|
*/
|
|
120
32
|
export declare function exportSvg(defs: BpmnDefinitions, options?: SvgExportOptions): string;
|
|
121
|
-
/** Like {@link exportSvg}, plus the drawn size, viewBox, element geometry and warnings. */
|
|
122
|
-
export declare function exportSvgDetailed(input: BpmnDefinitions, options?: SvgExportOptions): SvgExportResult;
|
|
123
|
-
/** @internal Theme colours and font settings from the shared export options. */
|
|
124
|
-
export declare function resolveCtx(options: Pick<SvgExportOptions, "theme" | "font"> | undefined): SvgCtx;
|
|
125
|
-
/** @internal `width`/`height` after `scale` and `maxSize` (the viewBox never changes). */
|
|
126
|
-
export declare function fitSize(vw: number, vh: number, options: Pick<SvgExportOptions, "scale" | "maxSize"> | undefined): {
|
|
127
|
-
width: number;
|
|
128
|
-
height: number;
|
|
129
|
-
};
|
|
130
|
-
/** Estimated glyph width for a label font — scaled from the 11px default. */
|
|
131
|
-
/** @internal */
|
|
132
|
-
export declare function charPx(font: LabelFontCss | undefined, t: SvgCtx): number;
|
|
133
|
-
/** @internal */
|
|
134
|
-
export declare function wrapText(text: string, maxPx: number, charW?: number): string[];
|
|
135
|
-
/** @internal */
|
|
136
|
-
export declare function esc(s: string): string;
|
|
137
|
-
/** @internal */
|
|
138
|
-
export declare function fontStyle(font: LabelFontCss | undefined, t: SvgCtx): string;
|
|
139
|
-
/**
|
|
140
|
-
* Generates SVG text element(s) for a label centred at (cx, cy).
|
|
141
|
-
* topAlign=true makes multi-line text flow downward from cy rather than
|
|
142
|
-
* being centred around it — prevents long labels from overlapping the shape above.
|
|
143
|
-
*/
|
|
144
|
-
/** @internal */
|
|
145
|
-
export declare function labelSvg(text: string, cx: number, cy: number, maxWidth: number, t: SvgCtx, topAlign?: boolean, font?: LabelFontCss): string;
|
|
146
|
-
/** @internal */
|
|
147
|
-
export declare function shapeStyle(t: SvgCtx, sw?: number, dash?: string): string;
|
|
148
|
-
/** @internal */
|
|
149
|
-
export declare function iconStyle(t: SvgCtx): string;
|
|
150
|
-
/**
|
|
151
|
-
* Wraps raw icon SVG (which uses class="bi", "bis", "gm", "gms")
|
|
152
|
-
* in a `<g>` that provides those class definitions as inline style overrides.
|
|
153
|
-
* CSS classes cannot be used in standalone SVGs, so we map them to inline styles
|
|
154
|
-
* via a local `<style>` element scoped to the enclosing `<g>`.
|
|
155
|
-
*/
|
|
156
|
-
/** @internal */
|
|
157
|
-
export declare function iconGroup(content: string, x: number, y: number, t: SvgCtx): string;
|
|
158
|
-
export {};
|
|
159
33
|
//# sourceMappingURL=svg.d.ts.map
|