@dou-ui/flow 0.0.0-stage → 0.1.0-alpha.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/LICENSE +21 -0
- package/README.md +10 -2
- package/dist/collaboration/index.js +360 -0
- package/dist/collaboration/index.js.map +1 -0
- package/dist/collaboration/peers.js +76 -0
- package/dist/collaboration/peers.js.map +1 -0
- package/dist/components/default-node.js +6 -0
- package/dist/components/default-node.js.map +1 -0
- package/dist/components/default-node.vue_vue_type_script_setup_true_lang.js +87 -0
- package/dist/components/default-node.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/default-node2.js +116 -0
- package/dist/components/default-node2.js.map +1 -0
- package/dist/components/flow-controls.js +6 -0
- package/dist/components/flow-controls.js.map +1 -0
- package/dist/components/flow-controls.vue_vue_type_script_setup_true_lang.js +148 -0
- package/dist/components/flow-controls.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/flow-menu.js +6 -0
- package/dist/components/flow-menu.js.map +1 -0
- package/dist/components/flow-menu.vue_vue_type_script_setup_true_lang.js +52 -0
- package/dist/components/flow-menu.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/flow-minimap.js +6 -0
- package/dist/components/flow-minimap.js.map +1 -0
- package/dist/components/flow-minimap.vue_vue_type_script_setup_true_lang.js +238 -0
- package/dist/components/flow-minimap.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/flow-port.js +6 -0
- package/dist/components/flow-port.js.map +1 -0
- package/dist/components/flow-port.vue_vue_type_script_setup_true_lang.js +57 -0
- package/dist/components/flow-port.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/flow-quick-add.js +6 -0
- package/dist/components/flow-quick-add.js.map +1 -0
- package/dist/components/flow-quick-add.vue_vue_type_script_setup_true_lang.js +126 -0
- package/dist/components/flow-quick-add.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/flow-toolbar.js +6 -0
- package/dist/components/flow-toolbar.js.map +1 -0
- package/dist/components/flow-toolbar.vue_vue_type_script_setup_true_lang.js +161 -0
- package/dist/components/flow-toolbar.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/group-node.js +6 -0
- package/dist/components/group-node.js.map +1 -0
- package/dist/components/group-node.vue_vue_type_script_setup_true_lang.js +84 -0
- package/dist/components/group-node.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/group-node2.js +42 -0
- package/dist/components/group-node2.js.map +1 -0
- package/dist/components/node-view.js +6 -0
- package/dist/components/node-view.js.map +1 -0
- package/dist/components/node-view.vue_vue_type_script_setup_true_lang.js +179 -0
- package/dist/components/node-view.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/context.js +13 -0
- package/dist/context.js.map +1 -0
- package/dist/core/clipboard.js +37 -0
- package/dist/core/clipboard.js.map +1 -0
- package/dist/core/connect.js +74 -0
- package/dist/core/connect.js.map +1 -0
- package/dist/core/edge-types.js +240 -0
- package/dist/core/edge-types.js.map +1 -0
- package/dist/core/extension.js +63 -0
- package/dist/core/extension.js.map +1 -0
- package/dist/core/geometry.js +232 -0
- package/dist/core/geometry.js.map +1 -0
- package/dist/core/groups.js +76 -0
- package/dist/core/groups.js.map +1 -0
- package/dist/core/history.js +79 -0
- package/dist/core/history.js.map +1 -0
- package/dist/core/model.js +21 -0
- package/dist/core/model.js.map +1 -0
- package/dist/core/node-types.js +32 -0
- package/dist/core/node-types.js.map +1 -0
- package/dist/core/order.js +42 -0
- package/dist/core/order.js.map +1 -0
- package/dist/core/transaction.js +288 -0
- package/dist/core/transaction.js.map +1 -0
- package/dist/document.js +220 -0
- package/dist/document.js.map +1 -0
- package/dist/export/color.js +38 -0
- package/dist/export/color.js.map +1 -0
- package/dist/export/context.js +223 -0
- package/dist/export/context.js.map +1 -0
- package/dist/export/draw.js +249 -0
- package/dist/export/draw.js.map +1 -0
- package/dist/flow-editor.js +6 -0
- package/dist/flow-editor.js.map +1 -0
- package/dist/flow-editor.vue_vue_type_script_setup_true_lang.js +3721 -0
- package/dist/flow-editor.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/index.js +31 -0
- package/dist/index.js.map +1 -0
- package/dist/kit.js +234 -0
- package/dist/kit.js.map +1 -0
- package/dist/layers.js +150 -0
- package/dist/layers.js.map +1 -0
- package/dist/locale.js +426 -0
- package/dist/locale.js.map +1 -0
- package/dist/style.css +1 -0
- package/dist/style.d.ts +1 -0
- package/dist/style.js +8 -0
- package/dist/types/collaboration/index.d.ts +42 -0
- package/dist/types/collaboration/peers.d.ts +27 -0
- package/dist/types/components/default-node.d.ts +18 -0
- package/dist/types/components/default-node.vue.d.ts +6 -0
- package/dist/types/components/flow-controls.vue.d.ts +8 -0
- package/dist/types/components/flow-menu.vue.d.ts +29 -0
- package/dist/types/components/flow-minimap.vue.d.ts +8 -0
- package/dist/types/components/flow-port.vue.d.ts +9 -0
- package/dist/types/components/flow-quick-add.vue.d.ts +31 -0
- package/dist/types/components/flow-toolbar.vue.d.ts +25 -0
- package/dist/types/components/group-node.d.ts +13 -0
- package/dist/types/components/group-node.vue.d.ts +6 -0
- package/dist/types/components/node-view.vue.d.ts +28 -0
- package/dist/types/context.d.ts +362 -0
- package/dist/types/core/clipboard.d.ts +9 -0
- package/dist/types/core/connect.d.ts +63 -0
- package/dist/types/core/edge-types.d.ts +50 -0
- package/dist/types/core/extension.d.ts +141 -0
- package/dist/types/core/geometry.d.ts +63 -0
- package/dist/types/core/groups.d.ts +23 -0
- package/dist/types/core/history.d.ts +24 -0
- package/dist/types/core/menu.d.ts +40 -0
- package/dist/types/core/model.d.ts +87 -0
- package/dist/types/core/node-types.d.ts +103 -0
- package/dist/types/core/order.d.ts +7 -0
- package/dist/types/core/transaction.d.ts +97 -0
- package/dist/types/document.d.ts +57 -0
- package/dist/types/export/color.d.ts +7 -0
- package/dist/types/export/context.d.ts +90 -0
- package/dist/types/export/draw.d.ts +72 -0
- package/dist/types/flow-editor.vue.d.ts +63 -0
- package/dist/types/index.d.ts +202 -0
- package/dist/types/kit.d.ts +22 -0
- package/dist/types/layers.d.ts +24 -0
- package/dist/types/locale.d.ts +172 -0
- package/dist/types/whiteboard/board-draft.vue.d.ts +3 -0
- package/dist/types/whiteboard/board-node.vue.d.ts +19 -0
- package/dist/types/whiteboard/connector.d.ts +12 -0
- package/dist/types/whiteboard/draw.d.ts +5 -0
- package/dist/types/whiteboard/image.d.ts +27 -0
- package/dist/types/whiteboard/index.d.ts +6 -0
- package/dist/types/whiteboard/ink.d.ts +30 -0
- package/dist/types/whiteboard/kit.d.ts +36 -0
- package/dist/types/whiteboard/model.d.ts +79 -0
- package/dist/types/whiteboard/pen.d.ts +7 -0
- package/dist/types/whiteboard/state.d.ts +37 -0
- package/dist/types/whiteboard/transform.d.ts +67 -0
- package/dist/types/whiteboard/whiteboard-toolbar.vue.d.ts +3 -0
- package/dist/whiteboard/board-draft.js +6 -0
- package/dist/whiteboard/board-draft.js.map +1 -0
- package/dist/whiteboard/board-draft.vue_vue_type_script_setup_true_lang.js +58 -0
- package/dist/whiteboard/board-draft.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/whiteboard/board-node.js +6 -0
- package/dist/whiteboard/board-node.js.map +1 -0
- package/dist/whiteboard/board-node.vue_vue_type_script_setup_true_lang.js +332 -0
- package/dist/whiteboard/board-node.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/whiteboard/connector.js +180 -0
- package/dist/whiteboard/connector.js.map +1 -0
- package/dist/whiteboard/draw.js +68 -0
- package/dist/whiteboard/draw.js.map +1 -0
- package/dist/whiteboard/image.js +104 -0
- package/dist/whiteboard/image.js.map +1 -0
- package/dist/whiteboard/index.js +5 -0
- package/dist/whiteboard/ink.js +168 -0
- package/dist/whiteboard/ink.js.map +1 -0
- package/dist/whiteboard/kit.js +406 -0
- package/dist/whiteboard/kit.js.map +1 -0
- package/dist/whiteboard/model.js +52 -0
- package/dist/whiteboard/model.js.map +1 -0
- package/dist/whiteboard/pen.js +88 -0
- package/dist/whiteboard/pen.js.map +1 -0
- package/dist/whiteboard/state.js +26 -0
- package/dist/whiteboard/state.js.map +1 -0
- package/dist/whiteboard/transform.js +256 -0
- package/dist/whiteboard/transform.js.map +1 -0
- package/dist/whiteboard/whiteboard-toolbar.js +6 -0
- package/dist/whiteboard/whiteboard-toolbar.js.map +1 -0
- package/dist/whiteboard/whiteboard-toolbar.vue_vue_type_script_setup_true_lang.js +171 -0
- package/dist/whiteboard/whiteboard-toolbar.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/package.json +74 -4
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { type Component } from 'vue';
|
|
2
|
+
import type { PortAnchor } from '../context';
|
|
3
|
+
import type { Rect } from '../core/model';
|
|
4
|
+
import type { FlowMessages } from '../locale';
|
|
5
|
+
export interface FlowDrawTextOptions {
|
|
6
|
+
/** In px; the editor's font size by default. */
|
|
7
|
+
size?: number;
|
|
8
|
+
/** A CSS font weight, e.g. `500`. */
|
|
9
|
+
weight?: string | number;
|
|
10
|
+
/** Line height in px; 1.5 times the size by default. */
|
|
11
|
+
lineHeight?: number;
|
|
12
|
+
color?: string;
|
|
13
|
+
align?: 'start' | 'center' | 'end';
|
|
14
|
+
/** Where the lines sit in the box when they take less than its height. */
|
|
15
|
+
valign?: 'top' | 'middle';
|
|
16
|
+
/** Keeps it to one line, cut with an ellipsis. */
|
|
17
|
+
nowrap?: boolean;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* What a node type's `draw` gets to draw a node as SVG, for `exportSVG` and
|
|
21
|
+
* `exportPNG`. Coordinates are the node's own: `0, 0` is its top left.
|
|
22
|
+
*/
|
|
23
|
+
export interface FlowDrawContext {
|
|
24
|
+
/** The node's size. */
|
|
25
|
+
width: number;
|
|
26
|
+
height: number;
|
|
27
|
+
/** Its ports where they are on screen, relative to its top left. */
|
|
28
|
+
ports: ReadonlyMap<string, PortAnchor>;
|
|
29
|
+
/**
|
|
30
|
+
* A port as the editor draws it, where it is on screen: its ring or shape
|
|
31
|
+
* in its type's color, filled once connected. Empty for a port not shown.
|
|
32
|
+
*/
|
|
33
|
+
port: (id: string) => string;
|
|
34
|
+
/** The editor's current strings. */
|
|
35
|
+
messages: FlowMessages;
|
|
36
|
+
/**
|
|
37
|
+
* The computed style of an element made with these classes, outermost
|
|
38
|
+
* first, inside the editor so its theme and variables apply. Pass colors
|
|
39
|
+
* read from it through `color`.
|
|
40
|
+
*/
|
|
41
|
+
style: (...classes: string[]) => CSSStyleDeclaration;
|
|
42
|
+
/**
|
|
43
|
+
* A CSS color, also one with variables such as `var(--dou-color-text)`,
|
|
44
|
+
* as `rgb(…)`, `rgba(…)` or `#rrggbb`, which every SVG reader understands.
|
|
45
|
+
*/
|
|
46
|
+
color: (value: string) => string;
|
|
47
|
+
/** Text in a box, wrapped as on screen and cut where the box ends. */
|
|
48
|
+
text: (value: string, box: Rect, options?: FlowDrawTextOptions) => string;
|
|
49
|
+
/** An icon component, e.g. from `@dou-ui/icons`, as SVG. */
|
|
50
|
+
icon: (icon: Component, box: Rect, color: string) => string;
|
|
51
|
+
/** An image; in a PNG it is embedded when its address can be read. */
|
|
52
|
+
image: (src: string, box: Rect, options?: {
|
|
53
|
+
radius?: number;
|
|
54
|
+
}) => string;
|
|
55
|
+
/** Escapes text for SVG markup. */
|
|
56
|
+
escape: (text: string) => string;
|
|
57
|
+
}
|
|
58
|
+
export declare const escapeXml: (text: string) => string;
|
|
59
|
+
export declare const round: (value: number) => number;
|
|
60
|
+
/**
|
|
61
|
+
* Lines of text that fit `max`: breaks between words and between wide
|
|
62
|
+
* characters, inside a word only when it alone is too long, and at new lines.
|
|
63
|
+
*/
|
|
64
|
+
export declare function wrapText(text: string, max: number, measure: (text: string) => number): string[];
|
|
65
|
+
/** Cuts text to fit `max`, with an ellipsis. */
|
|
66
|
+
export declare function cutText(text: string, max: number, measure: (text: string) => number,
|
|
67
|
+
/** Ends it with an ellipsis even when it fits: more text follows. */
|
|
68
|
+
more?: boolean): string;
|
|
69
|
+
export interface DrawTools {
|
|
70
|
+
/** Makes the context for one node. */
|
|
71
|
+
forNode: (size: {
|
|
72
|
+
width: number;
|
|
73
|
+
height: number;
|
|
74
|
+
}, ports: ReadonlyMap<string, PortAnchor>, port: (id: string) => string) => FlowDrawContext;
|
|
75
|
+
style: FlowDrawContext['style'];
|
|
76
|
+
color: FlowDrawContext['color'];
|
|
77
|
+
text: FlowDrawContext['text'];
|
|
78
|
+
measure: (text: string, size: number, weight?: string | number) => number;
|
|
79
|
+
fontFamily: string;
|
|
80
|
+
fontSize: number;
|
|
81
|
+
/** Image addresses the drawing used. */
|
|
82
|
+
images: Set<string>;
|
|
83
|
+
dispose: () => void;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* The tools a drawing needs, reading the page inside `root`: styles from
|
|
87
|
+
* elements made in a hidden box there, text measured with the editor's font.
|
|
88
|
+
* `imageHref` turns an image address into the one written out.
|
|
89
|
+
*/
|
|
90
|
+
export declare function drawTools(root: HTMLElement, messages: FlowMessages, imageHref?: (src: string) => string | null): DrawTools;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { CSSProperties } from 'vue';
|
|
2
|
+
import type { PortAnchor } from '../context';
|
|
3
|
+
import type { EdgeRoute } from '../core/edge-types';
|
|
4
|
+
import type { FlowEdge, FlowNode, Rect } from '../core/model';
|
|
5
|
+
import { type NodeTypeSpec } from '../core/node-types';
|
|
6
|
+
import { type DrawTools, type FlowDrawContext } from './context';
|
|
7
|
+
export interface FlowExportOptions {
|
|
8
|
+
/**
|
|
9
|
+
* `all` (the default): every node and edge. `view`: what is in view now,
|
|
10
|
+
* at the canvas's size, cut at its edges. `selection`: the selected nodes,
|
|
11
|
+
* what is inside selected groups, and the edges between them; it throws
|
|
12
|
+
* when nothing is selected.
|
|
13
|
+
*/
|
|
14
|
+
range?: 'all' | 'view' | 'selection';
|
|
15
|
+
/** Room around the drawing, in px. Defaults to `24`; not used by `view`. */
|
|
16
|
+
padding?: number;
|
|
17
|
+
/** Fills the canvas color behind it. Defaults to `true`; `false` leaves it see-through. */
|
|
18
|
+
background?: boolean;
|
|
19
|
+
}
|
|
20
|
+
export interface FlowImageOptions extends FlowExportOptions {
|
|
21
|
+
/** Pixels per CSS pixel. Defaults to `2`, sharp on most screens and in print. */
|
|
22
|
+
pixelRatio?: number;
|
|
23
|
+
}
|
|
24
|
+
export interface DrawNode {
|
|
25
|
+
node: FlowNode;
|
|
26
|
+
spec: NodeTypeSpec;
|
|
27
|
+
rect: Rect;
|
|
28
|
+
ports: ReadonlyMap<string, PortAnchor>;
|
|
29
|
+
container: boolean;
|
|
30
|
+
label: string;
|
|
31
|
+
/** Draws one of its ports, as `FlowDrawContext.port`. */
|
|
32
|
+
port: (id: string) => string;
|
|
33
|
+
}
|
|
34
|
+
export interface DrawEdge {
|
|
35
|
+
edge: FlowEdge;
|
|
36
|
+
type: string;
|
|
37
|
+
route: EdgeRoute;
|
|
38
|
+
style?: CSSProperties;
|
|
39
|
+
stale: boolean;
|
|
40
|
+
}
|
|
41
|
+
export interface DrawInput {
|
|
42
|
+
/** Containers outer first, then the other nodes lowest first. */
|
|
43
|
+
nodes: DrawNode[];
|
|
44
|
+
edges: DrawEdge[];
|
|
45
|
+
padding: number;
|
|
46
|
+
background: boolean;
|
|
47
|
+
/** The area to draw, in place of what the drawing covers plus `padding`. */
|
|
48
|
+
frame?: Rect;
|
|
49
|
+
/** Extensions' layers over the nodes, as `FlowExtension.drawLayer`. */
|
|
50
|
+
layers?: ((draw: FlowDrawContext) => string)[];
|
|
51
|
+
}
|
|
52
|
+
/** The points a path passes through or bends towards; the curve stays inside them. */
|
|
53
|
+
export declare function pathPoints(path: string): {
|
|
54
|
+
x: number;
|
|
55
|
+
y: number;
|
|
56
|
+
}[];
|
|
57
|
+
/** A card like the editor's frame: border, background and radius. */
|
|
58
|
+
export declare function drawCard(draw: FlowDrawContext, classes?: string[]): string;
|
|
59
|
+
/** What a node type without `draw` is drawn as: its card, its name and its ports. */
|
|
60
|
+
export declare function drawFallback(draw: FlowDrawContext, label: string, framed: boolean): string;
|
|
61
|
+
/**
|
|
62
|
+
* The flow as an SVG document: containers, edges, edge labels, then the
|
|
63
|
+
* other nodes, as the editor stacks them.
|
|
64
|
+
*/
|
|
65
|
+
export declare function drawFlow(input: DrawInput, tools: DrawTools, root: HTMLElement): {
|
|
66
|
+
svg: string;
|
|
67
|
+
width: number;
|
|
68
|
+
height: number;
|
|
69
|
+
};
|
|
70
|
+
/** Reads an image into a data URL, or `null` when it can't be read from this page. */
|
|
71
|
+
export declare function readImage(src: string): Promise<string | null>;
|
|
72
|
+
export type { FlowDrawContext };
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { type FlowEditorExpose, type FlowEditorProps, type FlowEditorSlots } from './context';
|
|
2
|
+
import { type FlowDocument, type FlowEdge, type FlowEndpoint, type FlowNode, type FlowSelection, type FlowViewport, type Point } from './core/model';
|
|
3
|
+
import { FlowTransaction } from './core/transaction';
|
|
4
|
+
type __VLS_Props = FlowEditorProps;
|
|
5
|
+
type __VLS_Slots = FlowEditorSlots;
|
|
6
|
+
type __VLS_ModelProps = {
|
|
7
|
+
modelValue?: FlowDocument;
|
|
8
|
+
'selection'?: FlowSelection;
|
|
9
|
+
'viewport'?: FlowViewport;
|
|
10
|
+
};
|
|
11
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
12
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, FlowEditorExpose, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
13
|
+
transaction: (tr: FlowTransaction) => any;
|
|
14
|
+
transactionCancel: (tr: FlowTransaction) => any;
|
|
15
|
+
nodeClick: (node: FlowNode<import("./index.js").FlowData>, event: MouseEvent) => any;
|
|
16
|
+
nodeDblclick: (node: FlowNode<import("./index.js").FlowData>, event: MouseEvent) => any;
|
|
17
|
+
nodeContextmenu: (node: FlowNode<import("./index.js").FlowData>, event: MouseEvent) => any;
|
|
18
|
+
edgeClick: (edge: FlowEdge<import("./index.js").FlowData>, event: MouseEvent) => any;
|
|
19
|
+
edgeContextmenu: (edge: FlowEdge<import("./index.js").FlowData>, event: MouseEvent) => any;
|
|
20
|
+
canvasClick: (point: Point, event: MouseEvent) => any;
|
|
21
|
+
canvasContextmenu: (point: Point, event: MouseEvent) => any;
|
|
22
|
+
connect: (edge: FlowEdge<import("./index.js").FlowData>) => any;
|
|
23
|
+
connectToCanvas: (from: Required<FlowEndpoint>, point: Point, event: MouseEvent) => any;
|
|
24
|
+
"update:modelValue": (value: FlowDocument) => any;
|
|
25
|
+
"update:selection": (value: FlowSelection) => any;
|
|
26
|
+
"update:viewport": (value: FlowViewport) => any;
|
|
27
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
28
|
+
onTransaction?: ((tr: FlowTransaction) => any) | undefined;
|
|
29
|
+
onTransactionCancel?: ((tr: FlowTransaction) => any) | undefined;
|
|
30
|
+
onNodeClick?: ((node: FlowNode<import("./index.js").FlowData>, event: MouseEvent) => any) | undefined;
|
|
31
|
+
onNodeDblclick?: ((node: FlowNode<import("./index.js").FlowData>, event: MouseEvent) => any) | undefined;
|
|
32
|
+
onNodeContextmenu?: ((node: FlowNode<import("./index.js").FlowData>, event: MouseEvent) => any) | undefined;
|
|
33
|
+
onEdgeClick?: ((edge: FlowEdge<import("./index.js").FlowData>, event: MouseEvent) => any) | undefined;
|
|
34
|
+
onEdgeContextmenu?: ((edge: FlowEdge<import("./index.js").FlowData>, event: MouseEvent) => any) | undefined;
|
|
35
|
+
onCanvasClick?: ((point: Point, event: MouseEvent) => any) | undefined;
|
|
36
|
+
onCanvasContextmenu?: ((point: Point, event: MouseEvent) => any) | undefined;
|
|
37
|
+
onConnect?: ((edge: FlowEdge<import("./index.js").FlowData>) => any) | undefined;
|
|
38
|
+
onConnectToCanvas?: ((from: Required<FlowEndpoint>, point: Point, event: MouseEvent) => any) | undefined;
|
|
39
|
+
"onUpdate:modelValue"?: ((value: FlowDocument) => any) | undefined;
|
|
40
|
+
"onUpdate:selection"?: ((value: FlowSelection) => any) | undefined;
|
|
41
|
+
"onUpdate:viewport"?: ((value: FlowViewport) => any) | undefined;
|
|
42
|
+
}>, {
|
|
43
|
+
direction: "horizontal" | "vertical";
|
|
44
|
+
grid: number;
|
|
45
|
+
edgeType: string;
|
|
46
|
+
readonly: boolean;
|
|
47
|
+
simpleZoom: number;
|
|
48
|
+
guides: boolean;
|
|
49
|
+
minZoom: number;
|
|
50
|
+
maxZoom: number;
|
|
51
|
+
fitView: boolean;
|
|
52
|
+
fitMinZoom: number;
|
|
53
|
+
searchable: boolean;
|
|
54
|
+
panOnScroll: boolean;
|
|
55
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
56
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
57
|
+
declare const _default: typeof __VLS_export;
|
|
58
|
+
export default _default;
|
|
59
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
60
|
+
new (): {
|
|
61
|
+
$slots: S;
|
|
62
|
+
};
|
|
63
|
+
};
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
export declare const DouFlowEditor: import("dou-ui").WithInstall<{
|
|
2
|
+
new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("./context").FlowEditorProps & {
|
|
3
|
+
modelValue?: import("./index.js").FlowDocument;
|
|
4
|
+
selection?: import("./index.js").FlowSelection;
|
|
5
|
+
viewport?: import("./index.js").FlowViewport;
|
|
6
|
+
}> & Readonly<{
|
|
7
|
+
onTransaction?: ((tr: import("./index.js").FlowTransaction) => any) | undefined;
|
|
8
|
+
onTransactionCancel?: ((tr: import("./index.js").FlowTransaction) => any) | undefined;
|
|
9
|
+
onNodeClick?: ((node: import("./index.js").FlowNode<import("./index.js").FlowData>, event: MouseEvent) => any) | undefined;
|
|
10
|
+
onNodeDblclick?: ((node: import("./index.js").FlowNode<import("./index.js").FlowData>, event: MouseEvent) => any) | undefined;
|
|
11
|
+
onNodeContextmenu?: ((node: import("./index.js").FlowNode<import("./index.js").FlowData>, event: MouseEvent) => any) | undefined;
|
|
12
|
+
onEdgeClick?: ((edge: import("./index.js").FlowEdge<import("./index.js").FlowData>, event: MouseEvent) => any) | undefined;
|
|
13
|
+
onEdgeContextmenu?: ((edge: import("./index.js").FlowEdge<import("./index.js").FlowData>, event: MouseEvent) => any) | undefined;
|
|
14
|
+
onCanvasClick?: ((point: import("./index.js").Point, event: MouseEvent) => any) | undefined;
|
|
15
|
+
onCanvasContextmenu?: ((point: import("./index.js").Point, event: MouseEvent) => any) | undefined;
|
|
16
|
+
onConnect?: ((edge: import("./index.js").FlowEdge<import("./index.js").FlowData>) => any) | undefined;
|
|
17
|
+
onConnectToCanvas?: ((from: Required<import("./index.js").FlowEndpoint>, point: import("./index.js").Point, event: MouseEvent) => any) | undefined;
|
|
18
|
+
"onUpdate:modelValue"?: ((value: import("./index.js").FlowDocument) => any) | undefined;
|
|
19
|
+
"onUpdate:selection"?: ((value: import("./index.js").FlowSelection) => any) | undefined;
|
|
20
|
+
"onUpdate:viewport"?: ((value: import("./index.js").FlowViewport) => any) | undefined;
|
|
21
|
+
}>, import("./context").FlowEditorExpose, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
22
|
+
transaction: (tr: import("./index.js").FlowTransaction) => any;
|
|
23
|
+
transactionCancel: (tr: import("./index.js").FlowTransaction) => any;
|
|
24
|
+
nodeClick: (node: import("./index.js").FlowNode<import("./index.js").FlowData>, event: MouseEvent) => any;
|
|
25
|
+
nodeDblclick: (node: import("./index.js").FlowNode<import("./index.js").FlowData>, event: MouseEvent) => any;
|
|
26
|
+
nodeContextmenu: (node: import("./index.js").FlowNode<import("./index.js").FlowData>, event: MouseEvent) => any;
|
|
27
|
+
edgeClick: (edge: import("./index.js").FlowEdge<import("./index.js").FlowData>, event: MouseEvent) => any;
|
|
28
|
+
edgeContextmenu: (edge: import("./index.js").FlowEdge<import("./index.js").FlowData>, event: MouseEvent) => any;
|
|
29
|
+
canvasClick: (point: import("./index.js").Point, event: MouseEvent) => any;
|
|
30
|
+
canvasContextmenu: (point: import("./index.js").Point, event: MouseEvent) => any;
|
|
31
|
+
connect: (edge: import("./index.js").FlowEdge<import("./index.js").FlowData>) => any;
|
|
32
|
+
connectToCanvas: (from: Required<import("./index.js").FlowEndpoint>, point: import("./index.js").Point, event: MouseEvent) => any;
|
|
33
|
+
"update:modelValue": (value: import("./index.js").FlowDocument) => any;
|
|
34
|
+
"update:selection": (value: import("./index.js").FlowSelection) => any;
|
|
35
|
+
"update:viewport": (value: import("./index.js").FlowViewport) => any;
|
|
36
|
+
}, import("vue").PublicProps, {
|
|
37
|
+
direction: "horizontal" | "vertical";
|
|
38
|
+
grid: number;
|
|
39
|
+
edgeType: string;
|
|
40
|
+
readonly: boolean;
|
|
41
|
+
simpleZoom: number;
|
|
42
|
+
guides: boolean;
|
|
43
|
+
minZoom: number;
|
|
44
|
+
maxZoom: number;
|
|
45
|
+
fitView: boolean;
|
|
46
|
+
fitMinZoom: number;
|
|
47
|
+
searchable: boolean;
|
|
48
|
+
panOnScroll: boolean;
|
|
49
|
+
}, false, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
|
|
50
|
+
P: {};
|
|
51
|
+
B: {};
|
|
52
|
+
D: {};
|
|
53
|
+
C: {};
|
|
54
|
+
M: {};
|
|
55
|
+
Defaults: {};
|
|
56
|
+
}, Readonly<import("./context").FlowEditorProps & {
|
|
57
|
+
modelValue?: import("./index.js").FlowDocument;
|
|
58
|
+
selection?: import("./index.js").FlowSelection;
|
|
59
|
+
viewport?: import("./index.js").FlowViewport;
|
|
60
|
+
}> & Readonly<{
|
|
61
|
+
onTransaction?: ((tr: import("./index.js").FlowTransaction) => any) | undefined;
|
|
62
|
+
onTransactionCancel?: ((tr: import("./index.js").FlowTransaction) => any) | undefined;
|
|
63
|
+
onNodeClick?: ((node: import("./index.js").FlowNode<import("./index.js").FlowData>, event: MouseEvent) => any) | undefined;
|
|
64
|
+
onNodeDblclick?: ((node: import("./index.js").FlowNode<import("./index.js").FlowData>, event: MouseEvent) => any) | undefined;
|
|
65
|
+
onNodeContextmenu?: ((node: import("./index.js").FlowNode<import("./index.js").FlowData>, event: MouseEvent) => any) | undefined;
|
|
66
|
+
onEdgeClick?: ((edge: import("./index.js").FlowEdge<import("./index.js").FlowData>, event: MouseEvent) => any) | undefined;
|
|
67
|
+
onEdgeContextmenu?: ((edge: import("./index.js").FlowEdge<import("./index.js").FlowData>, event: MouseEvent) => any) | undefined;
|
|
68
|
+
onCanvasClick?: ((point: import("./index.js").Point, event: MouseEvent) => any) | undefined;
|
|
69
|
+
onCanvasContextmenu?: ((point: import("./index.js").Point, event: MouseEvent) => any) | undefined;
|
|
70
|
+
onConnect?: ((edge: import("./index.js").FlowEdge<import("./index.js").FlowData>) => any) | undefined;
|
|
71
|
+
onConnectToCanvas?: ((from: Required<import("./index.js").FlowEndpoint>, point: import("./index.js").Point, event: MouseEvent) => any) | undefined;
|
|
72
|
+
"onUpdate:modelValue"?: ((value: import("./index.js").FlowDocument) => any) | undefined;
|
|
73
|
+
"onUpdate:selection"?: ((value: import("./index.js").FlowSelection) => any) | undefined;
|
|
74
|
+
"onUpdate:viewport"?: ((value: import("./index.js").FlowViewport) => any) | undefined;
|
|
75
|
+
}>, import("./context").FlowEditorExpose, {}, {}, {}, {
|
|
76
|
+
direction: "horizontal" | "vertical";
|
|
77
|
+
grid: number;
|
|
78
|
+
edgeType: string;
|
|
79
|
+
readonly: boolean;
|
|
80
|
+
simpleZoom: number;
|
|
81
|
+
guides: boolean;
|
|
82
|
+
minZoom: number;
|
|
83
|
+
maxZoom: number;
|
|
84
|
+
fitView: boolean;
|
|
85
|
+
fitMinZoom: number;
|
|
86
|
+
searchable: boolean;
|
|
87
|
+
panOnScroll: boolean;
|
|
88
|
+
}>;
|
|
89
|
+
__isFragment?: never;
|
|
90
|
+
__isTeleport?: never;
|
|
91
|
+
__isSuspense?: never;
|
|
92
|
+
} & import("vue").ComponentOptionsBase<Readonly<import("./context").FlowEditorProps & {
|
|
93
|
+
modelValue?: import("./index.js").FlowDocument;
|
|
94
|
+
selection?: import("./index.js").FlowSelection;
|
|
95
|
+
viewport?: import("./index.js").FlowViewport;
|
|
96
|
+
}> & Readonly<{
|
|
97
|
+
onTransaction?: ((tr: import("./index.js").FlowTransaction) => any) | undefined;
|
|
98
|
+
onTransactionCancel?: ((tr: import("./index.js").FlowTransaction) => any) | undefined;
|
|
99
|
+
onNodeClick?: ((node: import("./index.js").FlowNode<import("./index.js").FlowData>, event: MouseEvent) => any) | undefined;
|
|
100
|
+
onNodeDblclick?: ((node: import("./index.js").FlowNode<import("./index.js").FlowData>, event: MouseEvent) => any) | undefined;
|
|
101
|
+
onNodeContextmenu?: ((node: import("./index.js").FlowNode<import("./index.js").FlowData>, event: MouseEvent) => any) | undefined;
|
|
102
|
+
onEdgeClick?: ((edge: import("./index.js").FlowEdge<import("./index.js").FlowData>, event: MouseEvent) => any) | undefined;
|
|
103
|
+
onEdgeContextmenu?: ((edge: import("./index.js").FlowEdge<import("./index.js").FlowData>, event: MouseEvent) => any) | undefined;
|
|
104
|
+
onCanvasClick?: ((point: import("./index.js").Point, event: MouseEvent) => any) | undefined;
|
|
105
|
+
onCanvasContextmenu?: ((point: import("./index.js").Point, event: MouseEvent) => any) | undefined;
|
|
106
|
+
onConnect?: ((edge: import("./index.js").FlowEdge<import("./index.js").FlowData>) => any) | undefined;
|
|
107
|
+
onConnectToCanvas?: ((from: Required<import("./index.js").FlowEndpoint>, point: import("./index.js").Point, event: MouseEvent) => any) | undefined;
|
|
108
|
+
"onUpdate:modelValue"?: ((value: import("./index.js").FlowDocument) => any) | undefined;
|
|
109
|
+
"onUpdate:selection"?: ((value: import("./index.js").FlowSelection) => any) | undefined;
|
|
110
|
+
"onUpdate:viewport"?: ((value: import("./index.js").FlowViewport) => any) | undefined;
|
|
111
|
+
}>, import("./context").FlowEditorExpose, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
112
|
+
transaction: (tr: import("./index.js").FlowTransaction) => any;
|
|
113
|
+
transactionCancel: (tr: import("./index.js").FlowTransaction) => any;
|
|
114
|
+
nodeClick: (node: import("./index.js").FlowNode<import("./index.js").FlowData>, event: MouseEvent) => any;
|
|
115
|
+
nodeDblclick: (node: import("./index.js").FlowNode<import("./index.js").FlowData>, event: MouseEvent) => any;
|
|
116
|
+
nodeContextmenu: (node: import("./index.js").FlowNode<import("./index.js").FlowData>, event: MouseEvent) => any;
|
|
117
|
+
edgeClick: (edge: import("./index.js").FlowEdge<import("./index.js").FlowData>, event: MouseEvent) => any;
|
|
118
|
+
edgeContextmenu: (edge: import("./index.js").FlowEdge<import("./index.js").FlowData>, event: MouseEvent) => any;
|
|
119
|
+
canvasClick: (point: import("./index.js").Point, event: MouseEvent) => any;
|
|
120
|
+
canvasContextmenu: (point: import("./index.js").Point, event: MouseEvent) => any;
|
|
121
|
+
connect: (edge: import("./index.js").FlowEdge<import("./index.js").FlowData>) => any;
|
|
122
|
+
connectToCanvas: (from: Required<import("./index.js").FlowEndpoint>, point: import("./index.js").Point, event: MouseEvent) => any;
|
|
123
|
+
"update:modelValue": (value: import("./index.js").FlowDocument) => any;
|
|
124
|
+
"update:selection": (value: import("./index.js").FlowSelection) => any;
|
|
125
|
+
"update:viewport": (value: import("./index.js").FlowViewport) => any;
|
|
126
|
+
}, string, {
|
|
127
|
+
direction: "horizontal" | "vertical";
|
|
128
|
+
grid: number;
|
|
129
|
+
edgeType: string;
|
|
130
|
+
readonly: boolean;
|
|
131
|
+
simpleZoom: number;
|
|
132
|
+
guides: boolean;
|
|
133
|
+
minZoom: number;
|
|
134
|
+
maxZoom: number;
|
|
135
|
+
fitView: boolean;
|
|
136
|
+
fitMinZoom: number;
|
|
137
|
+
searchable: boolean;
|
|
138
|
+
panOnScroll: boolean;
|
|
139
|
+
}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
|
|
140
|
+
$slots: import("./context").FlowEditorSlots;
|
|
141
|
+
}), import("vue").HTMLAttributes>;
|
|
142
|
+
export declare const DouFlowControls: import("dou-ui").WithInstall<import("vue").DefineComponent<import("./context").FlowControlsProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("./context").FlowControlsProps> & Readonly<{}>, {
|
|
143
|
+
tidy: boolean;
|
|
144
|
+
history: boolean;
|
|
145
|
+
placement: import("./context").FlowPanelPlacement;
|
|
146
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, import("vue").HTMLAttributes>;
|
|
147
|
+
export declare const DouFlowMinimap: import("dou-ui").WithInstall<import("vue").DefineComponent<import("./context").FlowMinimapProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("./context").FlowMinimapProps> & Readonly<{}>, {
|
|
148
|
+
width: number;
|
|
149
|
+
height: number;
|
|
150
|
+
placement: import("./context").FlowPanelPlacement;
|
|
151
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, import("vue").HTMLAttributes>;
|
|
152
|
+
export declare const DouFlowPort: import("dou-ui").WithInstall<import("vue").DefineComponent<{
|
|
153
|
+
id: string;
|
|
154
|
+
auto?: boolean;
|
|
155
|
+
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
|
|
156
|
+
id: string;
|
|
157
|
+
auto?: boolean;
|
|
158
|
+
}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, import("vue").HTMLAttributes>;
|
|
159
|
+
export default DouFlowEditor;
|
|
160
|
+
export { useFlowEditor } from './context';
|
|
161
|
+
export type { FlowControlsProps, FlowEditorContext, FlowEditorEmits, FlowEditorExpose, FlowEditorProps, FlowInsertOptions, FlowMinimapProps, FlowNodePreview, FlowEditorSlots, FlowPanelPlacement, FlowSearchQuery, NodeMetrics, PortAnchor, PortState, } from './context';
|
|
162
|
+
export { flowLocales, useFlowMessages } from './locale';
|
|
163
|
+
export type { FlowMessages, FlowMessagesOverride } from './locale';
|
|
164
|
+
export { defaultNode } from './components/default-node';
|
|
165
|
+
export type { DefaultNodeData } from './components/default-node';
|
|
166
|
+
export { groupNode } from './components/group-node';
|
|
167
|
+
export type { GroupNodeData } from './components/group-node';
|
|
168
|
+
export { containerAt, FlowTree } from './core/groups';
|
|
169
|
+
export { defineNodeType, labelOf, portSide, portsOf, resizeOf } from './core/node-types';
|
|
170
|
+
export type { NodePaletteSpec, NodeResize, NodeTypeSpec, NodeViewProps } from './core/node-types';
|
|
171
|
+
export type { FlowMenuTarget, FlowToolbarItem } from './core/menu';
|
|
172
|
+
export { createId, emptyDocument, emptySelection } from './core/model';
|
|
173
|
+
export type { FlowData, FlowDocument, FlowEdge, FlowEndpoint, FlowNode, FlowPortSpec, FlowSelection, FlowViewport, Point, PortSide, Rect, } from './core/model';
|
|
174
|
+
export { checkDocument, migrateDocument } from './document';
|
|
175
|
+
export type { CheckDocumentOptions, DocumentProblem } from './document';
|
|
176
|
+
export { applyFlowSteps, compactFlowSteps, FlowTransaction } from './core/transaction';
|
|
177
|
+
export type { FlowStep, FlowTransactionMeta } from './core/transaction';
|
|
178
|
+
export { FlowHistory } from './core/history';
|
|
179
|
+
export { defineFlowExtension } from './core/extension';
|
|
180
|
+
export type { FlowExtension, FlowExtensionContext, FlowHistoryHandler, FlowKeyHandler, FlowPress, FlowPressHandler, } from './core/extension';
|
|
181
|
+
export { flowKit } from './kit';
|
|
182
|
+
export type { FlowKitOptions } from './kit';
|
|
183
|
+
export { moveLayer } from './layers';
|
|
184
|
+
export { drawCard } from './export/draw';
|
|
185
|
+
export type { FlowExportOptions, FlowImageOptions } from './export/draw';
|
|
186
|
+
export type { FlowDrawContext, FlowDrawTextOptions } from './export/context';
|
|
187
|
+
export type { LayerMove } from './layers';
|
|
188
|
+
export { flowOrder } from './core/order';
|
|
189
|
+
export { canJoin, displacedEdges, joinRefusal, primaryType, reaches, typesMatch, } from './core/connect';
|
|
190
|
+
export type { ConnectOptions, FlowConnection, JoinRefusal, PortShape, PortTypes, PortTypeSpec, } from './core/connect';
|
|
191
|
+
export { boundsOf, intersects, rectFrom, snapBox, snapTo } from './core/geometry';
|
|
192
|
+
export { bezierEdge, bezierPath, defineEdgeType, stepEdge, straightEdge } from './core/edge-types';
|
|
193
|
+
export type { EdgeAnchor, EdgeRoute, EdgeTypeSpec } from './core/edge-types';
|
|
194
|
+
export type { Guide, SnapResult } from './core/geometry';
|
|
195
|
+
declare module 'vue' {
|
|
196
|
+
interface GlobalComponents {
|
|
197
|
+
DouFlowEditor: typeof DouFlowEditor;
|
|
198
|
+
DouFlowControls: typeof DouFlowControls;
|
|
199
|
+
DouFlowMinimap: typeof DouFlowMinimap;
|
|
200
|
+
DouFlowPort: typeof DouFlowPort;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type FlowExtension } from './core/extension';
|
|
2
|
+
export interface FlowKitOptions {
|
|
3
|
+
/** The built-in context menu items: copy, paste, delete and so on. */
|
|
4
|
+
menu?: boolean;
|
|
5
|
+
/** The toolbar over the selected nodes: duplicate, delete and more. */
|
|
6
|
+
toolbar?: boolean;
|
|
7
|
+
/** The `group` node type, with its menu items and `mod+g` / `mod+shift+g`. */
|
|
8
|
+
group?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Moving nodes up and down the stack: menu items and `mod+]` / `mod+[`,
|
|
11
|
+
* with Shift for the very top or bottom.
|
|
12
|
+
*/
|
|
13
|
+
layers?: boolean;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* The editor's built-in parts as extensions: the default node type, the
|
|
17
|
+
* `bezier`, `step` and `straight` edge types, group nodes, stacking order,
|
|
18
|
+
* the context menu and the toolbar over selected nodes. Pass it along with
|
|
19
|
+
* your own extensions, e.g. `[flowKit(), aiNodes]`; without `extensions`
|
|
20
|
+
* the editor uses it alone.
|
|
21
|
+
*/
|
|
22
|
+
export declare function flowKit(options?: FlowKitOptions): FlowExtension[];
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { FlowEditorContext } from './context';
|
|
2
|
+
export type LayerMove = 'front' | 'forward' | 'backward' | 'back';
|
|
3
|
+
/**
|
|
4
|
+
* The selected nodes moved in the stack: to the top or bottom of everything,
|
|
5
|
+
* or one step past the nearest node each overlaps, so the step can be seen.
|
|
6
|
+
* Returns the `z` of every node whose place changed, numbering the stack
|
|
7
|
+
* from 0 at the bottom; nothing when nothing would change.
|
|
8
|
+
*/
|
|
9
|
+
export declare function layerChanges(ctx: FlowEditorContext, move: LayerMove): Map<string, number>;
|
|
10
|
+
/**
|
|
11
|
+
* Moves the selected nodes in the stack, as one undo step, and says so to
|
|
12
|
+
* screen readers. Returns `false` when nothing moved, e.g. when they already
|
|
13
|
+
* are at the top; that is said too, unless `announce` is `false`.
|
|
14
|
+
*/
|
|
15
|
+
export declare function moveLayer(ctx: FlowEditorContext, move: LayerMove, options?: {
|
|
16
|
+
announce?: boolean;
|
|
17
|
+
}): boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Stacking order: what is added lands on top, also once nodes have been
|
|
20
|
+
* moved in the stack.
|
|
21
|
+
*/
|
|
22
|
+
export declare const stacking: import(".").FlowExtension;
|
|
23
|
+
/** Moving nodes up and down the stack from the node menu and with Ctrl / ⌘ + [ and ]. */
|
|
24
|
+
export declare const layers: import(".").FlowExtension;
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import type { WhiteboardArrow, WhiteboardDash, WhiteboardRoute } from './whiteboard/model';
|
|
2
|
+
import { type MaybeRefOrGetter } from 'vue';
|
|
3
|
+
export interface FlowMessages {
|
|
4
|
+
/** The canvas's accessible description. */
|
|
5
|
+
canvas: string;
|
|
6
|
+
/** What a node is called to screen readers. */
|
|
7
|
+
node: string;
|
|
8
|
+
/** Describes a node's ports; `{inputs}`, `{outputs}` and `{connected}` are counts. */
|
|
9
|
+
ports: string;
|
|
10
|
+
input: string;
|
|
11
|
+
output: string;
|
|
12
|
+
zoomIn: string;
|
|
13
|
+
zoomOut: string;
|
|
14
|
+
/** `{value}` is the zoom in percent. */
|
|
15
|
+
zoomLevel: string;
|
|
16
|
+
/** The tip on the zoom level, which resets it. */
|
|
17
|
+
zoomReset: string;
|
|
18
|
+
fit: string;
|
|
19
|
+
tidy: string;
|
|
20
|
+
minimap: string;
|
|
21
|
+
undo: string;
|
|
22
|
+
redo: string;
|
|
23
|
+
controls: string;
|
|
24
|
+
/** The context menu and the floating toolbar. */
|
|
25
|
+
menu: string;
|
|
26
|
+
toolbar: string;
|
|
27
|
+
copy: string;
|
|
28
|
+
cut: string;
|
|
29
|
+
paste: string;
|
|
30
|
+
duplicate: string;
|
|
31
|
+
delete: string;
|
|
32
|
+
selectAll: string;
|
|
33
|
+
more: string;
|
|
34
|
+
/** Editing an edge's text. */
|
|
35
|
+
editLabel: string;
|
|
36
|
+
label: string;
|
|
37
|
+
/** The list offered when an edge is dropped on the canvas. */
|
|
38
|
+
search: string;
|
|
39
|
+
noTypes: string;
|
|
40
|
+
/** Announcements; `{count}` is a number. */
|
|
41
|
+
deleted: string;
|
|
42
|
+
tidied: string;
|
|
43
|
+
undone: string;
|
|
44
|
+
/** Said when an extension cancels a change without saying why. */
|
|
45
|
+
changeCancelled: string;
|
|
46
|
+
redone: string;
|
|
47
|
+
connected: string;
|
|
48
|
+
/** An edge selected from the keyboard; `{from}` and `{to}` are node names. */
|
|
49
|
+
edge: string;
|
|
50
|
+
/** Follows `edge` when it has a label. */
|
|
51
|
+
edgeLabel: string;
|
|
52
|
+
noEdges: string;
|
|
53
|
+
labelSaved: string;
|
|
54
|
+
/** Groups. */
|
|
55
|
+
group: string;
|
|
56
|
+
groupName: string;
|
|
57
|
+
makeGroup: string;
|
|
58
|
+
ungroup: string;
|
|
59
|
+
/** Takes a node out of the group it is in. */
|
|
60
|
+
leaveGroup: string;
|
|
61
|
+
/**
|
|
62
|
+
* Moving nodes up and down the stack. `top` and `bottom` say nothing moved
|
|
63
|
+
* because the nodes already are there; `noneAbove` and `noneBelow`, that
|
|
64
|
+
* no other node overlaps them that way.
|
|
65
|
+
*/
|
|
66
|
+
layers: {
|
|
67
|
+
front: string;
|
|
68
|
+
forward: string;
|
|
69
|
+
backward: string;
|
|
70
|
+
back: string;
|
|
71
|
+
top: string;
|
|
72
|
+
bottom: string;
|
|
73
|
+
noneAbove: string;
|
|
74
|
+
noneBelow: string;
|
|
75
|
+
};
|
|
76
|
+
expand: string;
|
|
77
|
+
collapse: string;
|
|
78
|
+
/** Between parts of a node's description. */
|
|
79
|
+
separator: string;
|
|
80
|
+
/** `{group}` is the group's name. */
|
|
81
|
+
inGroup: string;
|
|
82
|
+
/** `{count}` nodes inside a group. */
|
|
83
|
+
groupSize: string;
|
|
84
|
+
/** Announced; `{group}` is the group's name. */
|
|
85
|
+
joinedGroup: string;
|
|
86
|
+
leftGroup: string;
|
|
87
|
+
ungrouped: string;
|
|
88
|
+
expanded: string;
|
|
89
|
+
collapsed: string;
|
|
90
|
+
/** After resizing from the keyboard; `{node}`, `{width}` and `{height}`. */
|
|
91
|
+
resized: string;
|
|
92
|
+
/** Why the selection can't be grouped. */
|
|
93
|
+
groupMixed: string;
|
|
94
|
+
/** `{node}` is the new node's name. */
|
|
95
|
+
added: string;
|
|
96
|
+
/** While connecting from the keyboard; `{node}` and `{port}` are names. */
|
|
97
|
+
connectTo: string;
|
|
98
|
+
noTarget: string;
|
|
99
|
+
/** `{count}` edges no longer fit their ports. */
|
|
100
|
+
stale: string;
|
|
101
|
+
/** Why an edge was refused, announced when it is dropped. */
|
|
102
|
+
refused: {
|
|
103
|
+
direction: string;
|
|
104
|
+
self: string;
|
|
105
|
+
type: string;
|
|
106
|
+
duplicate: string;
|
|
107
|
+
cycle: string;
|
|
108
|
+
custom: string;
|
|
109
|
+
};
|
|
110
|
+
status: {
|
|
111
|
+
wait: string;
|
|
112
|
+
process: string;
|
|
113
|
+
finish: string;
|
|
114
|
+
error: string;
|
|
115
|
+
};
|
|
116
|
+
/** The whiteboard's toolbar and nodes. */
|
|
117
|
+
board: {
|
|
118
|
+
tools: string;
|
|
119
|
+
select: string;
|
|
120
|
+
hand: string;
|
|
121
|
+
rect: string;
|
|
122
|
+
ellipse: string;
|
|
123
|
+
diamond: string;
|
|
124
|
+
sticky: string;
|
|
125
|
+
text: string;
|
|
126
|
+
/** The field for a node's text. */
|
|
127
|
+
editText: string;
|
|
128
|
+
/** Announced when a tool is picked; `{tool}` is its name. */
|
|
129
|
+
picked: string;
|
|
130
|
+
/** A node's name when it has text; `{kind}` is what it is, as `rect` or `sticky`. */
|
|
131
|
+
named: string;
|
|
132
|
+
pen: string;
|
|
133
|
+
eraser: string;
|
|
134
|
+
/** The toolbar button that inserts an image. */
|
|
135
|
+
image: string;
|
|
136
|
+
/** A pen stroke. */
|
|
137
|
+
ink: string;
|
|
138
|
+
/** `{name}` is the file's name. */
|
|
139
|
+
imageFailed: string;
|
|
140
|
+
/** `{count}` strokes were erased. */
|
|
141
|
+
erased: string;
|
|
142
|
+
rotate: string;
|
|
143
|
+
unrotate: string;
|
|
144
|
+
/** `{degrees}` is the node's new turn. */
|
|
145
|
+
turned: string;
|
|
146
|
+
/** The connector buttons' names; `{value}` is the current choice. */
|
|
147
|
+
routeOf: string;
|
|
148
|
+
dashOf: string;
|
|
149
|
+
arrowOf: string;
|
|
150
|
+
routes: Record<WhiteboardRoute, string>;
|
|
151
|
+
dashes: Record<WhiteboardDash, string>;
|
|
152
|
+
arrows: Record<WhiteboardArrow, string>;
|
|
153
|
+
/** The connector buttons' `{value}` when the selected connectors differ. */
|
|
154
|
+
mixed: string;
|
|
155
|
+
/** Announced after a choice; `{value}` is the new one. */
|
|
156
|
+
routeSet: string;
|
|
157
|
+
dashSet: string;
|
|
158
|
+
arrowSet: string;
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
export declare const flowLocales: Record<string, FlowMessages>;
|
|
162
|
+
/** Texts to change; nested groups are merged, so only the ones given are replaced. */
|
|
163
|
+
export type FlowMessagesOverride = {
|
|
164
|
+
[K in keyof FlowMessages]?: FlowMessages[K] extends string ? string : Partial<FlowMessages[K]>;
|
|
165
|
+
};
|
|
166
|
+
/**
|
|
167
|
+
* The flow editor's texts, picked by the name of DouUI's current locale.
|
|
168
|
+
* Pass `messages` to override any of them.
|
|
169
|
+
*/
|
|
170
|
+
export declare function useFlowMessages(override?: MaybeRefOrGetter<FlowMessagesOverride | undefined>): import("vue").ComputedRef<FlowMessages>;
|
|
171
|
+
/** Fills `{name}` placeholders. */
|
|
172
|
+
export declare const format: (text: string, params: Record<string, string | number>) => string;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
declare const _default: typeof __VLS_export;
|
|
3
|
+
export default _default;
|