@nice2dev/ui-diagrams 1.0.2
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 +64 -0
- package/README.md +49 -0
- package/dist/__tests__/DiagramModel.test.d.ts +2 -0
- package/dist/__tests__/DiagramModel.test.d.ts.map +1 -0
- package/dist/__tests__/animationEngine.test.d.ts +2 -0
- package/dist/__tests__/animationEngine.test.d.ts.map +1 -0
- package/dist/__tests__/businessVisualizers.test.d.ts +2 -0
- package/dist/__tests__/businessVisualizers.test.d.ts.map +1 -0
- package/dist/__tests__/dataBinding.test.d.ts +2 -0
- package/dist/__tests__/dataBinding.test.d.ts.map +1 -0
- package/dist/__tests__/diagramTemplateGallery.test.d.ts +2 -0
- package/dist/__tests__/diagramTemplateGallery.test.d.ts.map +1 -0
- package/dist/__tests__/exportEngine.test.d.ts +2 -0
- package/dist/__tests__/exportEngine.test.d.ts.map +1 -0
- package/dist/__tests__/i18n-locales.test.d.ts +2 -0
- package/dist/__tests__/i18n-locales.test.d.ts.map +1 -0
- package/dist/__tests__/layoutEngine.test.d.ts +2 -0
- package/dist/__tests__/layoutEngine.test.d.ts.map +1 -0
- package/dist/__tests__/serialization.test.d.ts +2 -0
- package/dist/__tests__/serialization.test.d.ts.map +1 -0
- package/dist/__tests__/setup.d.ts +2 -0
- package/dist/__tests__/setup.d.ts.map +1 -0
- package/dist/__tests__/snapGrid.test.d.ts +2 -0
- package/dist/__tests__/snapGrid.test.d.ts.map +1 -0
- package/dist/__tests__/sprint24-diagrams.test.d.ts +2 -0
- package/dist/__tests__/sprint24-diagrams.test.d.ts.map +1 -0
- package/dist/components/AnimationTimeline.d.ts +21 -0
- package/dist/components/AnimationTimeline.d.ts.map +1 -0
- package/dist/components/DiagramCanvas.d.ts +54 -0
- package/dist/components/DiagramCanvas.d.ts.map +1 -0
- package/dist/components/DiagramCellRenderer.d.ts +36 -0
- package/dist/components/DiagramCellRenderer.d.ts.map +1 -0
- package/dist/components/DiagramMinimap.d.ts +17 -0
- package/dist/components/DiagramMinimap.d.ts.map +1 -0
- package/dist/components/DiagramPropertyPanel.d.ts +13 -0
- package/dist/components/DiagramPropertyPanel.d.ts.map +1 -0
- package/dist/components/DiagramToolbar.d.ts +65 -0
- package/dist/components/DiagramToolbar.d.ts.map +1 -0
- package/dist/components/NiceDatabaseSchemaViewer.d.ts +77 -0
- package/dist/components/NiceDatabaseSchemaViewer.d.ts.map +1 -0
- package/dist/components/NiceDecisionTreeEditor.d.ts +126 -0
- package/dist/components/NiceDecisionTreeEditor.d.ts.map +1 -0
- package/dist/components/NiceDependencyGraph.d.ts +104 -0
- package/dist/components/NiceDependencyGraph.d.ts.map +1 -0
- package/dist/components/NiceDiagramEditor.d.ts +24 -0
- package/dist/components/NiceDiagramEditor.d.ts.map +1 -0
- package/dist/components/NiceDiagramViewer.d.ts +19 -0
- package/dist/components/NiceDiagramViewer.d.ts.map +1 -0
- package/dist/components/NiceNetworkTopology.d.ts +125 -0
- package/dist/components/NiceNetworkTopology.d.ts.map +1 -0
- package/dist/components/NiceOrgChartVisualizer.d.ts +91 -0
- package/dist/components/NiceOrgChartVisualizer.d.ts.map +1 -0
- package/dist/components/NiceProcessMiningDiagram.d.ts +84 -0
- package/dist/components/NiceProcessMiningDiagram.d.ts.map +1 -0
- package/dist/components/NiceWorkflowVisualizer.d.ts +70 -0
- package/dist/components/NiceWorkflowVisualizer.d.ts.map +1 -0
- package/dist/components/collaborativeDiagram.d.ts +253 -0
- package/dist/components/collaborativeDiagram.d.ts.map +1 -0
- package/dist/components/diagramAdapters.d.ts +80 -0
- package/dist/components/diagramAdapters.d.ts.map +1 -0
- package/dist/components/diagramTemplates.d.ts +62 -0
- package/dist/components/diagramTemplates.d.ts.map +1 -0
- package/dist/components/shapeRegistry.d.ts +134 -0
- package/dist/components/shapeRegistry.d.ts.map +1 -0
- package/dist/components/snapGuides.d.ts +167 -0
- package/dist/components/snapGuides.d.ts.map +1 -0
- package/dist/components/workflowIntegrations.d.ts +280 -0
- package/dist/components/workflowIntegrations.d.ts.map +1 -0
- package/dist/core/DiagramModel.d.ts +56 -0
- package/dist/core/DiagramModel.d.ts.map +1 -0
- package/dist/core/animationEngine.d.ts +40 -0
- package/dist/core/animationEngine.d.ts.map +1 -0
- package/dist/core/conditionalStyling.d.ts +151 -0
- package/dist/core/conditionalStyling.d.ts.map +1 -0
- package/dist/core/dataBinding.d.ts +21 -0
- package/dist/core/dataBinding.d.ts.map +1 -0
- package/dist/core/diagramComments.d.ts +208 -0
- package/dist/core/diagramComments.d.ts.map +1 -0
- package/dist/core/diagramParticleEngine.d.ts +96 -0
- package/dist/core/diagramParticleEngine.d.ts.map +1 -0
- package/dist/core/diagramSearch.d.ts +169 -0
- package/dist/core/diagramSearch.d.ts.map +1 -0
- package/dist/core/diagramStylePresets.d.ts +56 -0
- package/dist/core/diagramStylePresets.d.ts.map +1 -0
- package/dist/core/diagramTemplateGallery.d.ts +27 -0
- package/dist/core/diagramTemplateGallery.d.ts.map +1 -0
- package/dist/core/diagramVersioning.d.ts +124 -0
- package/dist/core/diagramVersioning.d.ts.map +1 -0
- package/dist/core/exportEngine.d.ts +11 -0
- package/dist/core/exportEngine.d.ts.map +1 -0
- package/dist/core/i18n.d.ts +19 -0
- package/dist/core/i18n.d.ts.map +1 -0
- package/dist/core/layoutEngine.d.ts +10 -0
- package/dist/core/layoutEngine.d.ts.map +1 -0
- package/dist/core/serialization.d.ts +16 -0
- package/dist/core/serialization.d.ts.map +1 -0
- package/dist/core/snapGrid.d.ts +51 -0
- package/dist/core/snapGrid.d.ts.map +1 -0
- package/dist/hooks/useDiagramEditor.d.ts +64 -0
- package/dist/hooks/useDiagramEditor.d.ts.map +1 -0
- package/dist/index.cjs +3484 -0
- package/dist/index.d.ts +35 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.mjs +58661 -0
- package/dist/style.css +1 -0
- package/dist/types/diagramTypes.d.ts +410 -0
- package/dist/types/diagramTypes.d.ts.map +1 -0
- package/package.json +59 -0
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { DiagramNode, DiagramEdge, NodeStyle, EdgeStyle, NodeShape } from '../types/diagramTypes';
|
|
2
|
+
|
|
3
|
+
/** Condition operator for style rules. */
|
|
4
|
+
export type StyleConditionOperator = "equals" | "not_equals" | "greater_than" | "greater_than_or_equals" | "less_than" | "less_than_or_equals" | "contains" | "not_contains" | "starts_with" | "ends_with" | "regex" | "is_null" | "is_not_null" | "is_empty" | "is_not_empty" | "in" | "not_in" | "between";
|
|
5
|
+
/** A single condition. */
|
|
6
|
+
export interface StyleCondition {
|
|
7
|
+
/** Property path to check (dot notation supported, e.g., "data.status"). */
|
|
8
|
+
property: string;
|
|
9
|
+
/** Operator to apply. */
|
|
10
|
+
operator: StyleConditionOperator;
|
|
11
|
+
/** Value to compare against. */
|
|
12
|
+
value?: unknown;
|
|
13
|
+
/** Second value for "between" operator. */
|
|
14
|
+
valueTo?: unknown;
|
|
15
|
+
/** Case-insensitive string comparison. */
|
|
16
|
+
caseInsensitive?: boolean;
|
|
17
|
+
}
|
|
18
|
+
/** Logical group of conditions. */
|
|
19
|
+
export interface ConditionGroup {
|
|
20
|
+
/** How conditions are combined. */
|
|
21
|
+
logic: "and" | "or";
|
|
22
|
+
/** Conditions in this group. */
|
|
23
|
+
conditions: (StyleCondition | ConditionGroup)[];
|
|
24
|
+
}
|
|
25
|
+
/** Style action type. */
|
|
26
|
+
export type StyleActionType = "set_fill" | "set_stroke" | "set_stroke_width" | "set_text_color" | "set_opacity" | "set_icon" | "set_label" | "set_label_prefix" | "set_label_suffix" | "set_class" | "add_class" | "remove_class" | "set_scale" | "set_shadow" | "set_border_radius" | "set_dash_array" | "set_animation" | "set_glow" | "set_badge" | "set_tooltip";
|
|
27
|
+
/** A style action to apply. */
|
|
28
|
+
export interface StyleAction {
|
|
29
|
+
/** Action type. */
|
|
30
|
+
type: StyleActionType;
|
|
31
|
+
/** Value for the action. */
|
|
32
|
+
value: unknown;
|
|
33
|
+
/** Target: node or edge. */
|
|
34
|
+
target?: "node" | "edge";
|
|
35
|
+
}
|
|
36
|
+
/** A conditional styling rule. */
|
|
37
|
+
export interface ConditionalStyleRule {
|
|
38
|
+
/** Unique rule ID. */
|
|
39
|
+
id: string;
|
|
40
|
+
/** Human-readable name. */
|
|
41
|
+
name: string;
|
|
42
|
+
/** Description of what this rule does. */
|
|
43
|
+
description?: string;
|
|
44
|
+
/** Whether the rule is active. */
|
|
45
|
+
enabled: boolean;
|
|
46
|
+
/** Priority (higher = applied later, wins conflicts). */
|
|
47
|
+
priority: number;
|
|
48
|
+
/** Target element type. */
|
|
49
|
+
target: "node" | "edge" | "both";
|
|
50
|
+
/** Optional filter by node shape (for nodes) or line type (for edges). */
|
|
51
|
+
elementShapes?: NodeShape[];
|
|
52
|
+
/** Condition(s) to match. */
|
|
53
|
+
condition: StyleCondition | ConditionGroup;
|
|
54
|
+
/** Actions to apply when condition matches. */
|
|
55
|
+
actions: StyleAction[];
|
|
56
|
+
/** Whether to stop processing further rules if this rule matches. */
|
|
57
|
+
stopProcessing?: boolean;
|
|
58
|
+
/** Tags for organization. */
|
|
59
|
+
tags?: string[];
|
|
60
|
+
}
|
|
61
|
+
/** A rule set / style profile. */
|
|
62
|
+
export interface ConditionalStyleProfile {
|
|
63
|
+
/** Profile ID. */
|
|
64
|
+
id: string;
|
|
65
|
+
/** Profile name. */
|
|
66
|
+
name: string;
|
|
67
|
+
/** Description. */
|
|
68
|
+
description?: string;
|
|
69
|
+
/** Rules in this profile. */
|
|
70
|
+
rules: ConditionalStyleRule[];
|
|
71
|
+
/** Whether the profile is active. */
|
|
72
|
+
enabled: boolean;
|
|
73
|
+
}
|
|
74
|
+
/** Result of applying styles to an element. */
|
|
75
|
+
export interface AppliedStyles {
|
|
76
|
+
/** Original element ID. */
|
|
77
|
+
elementId: string;
|
|
78
|
+
/** Rules that matched. */
|
|
79
|
+
matchedRules: string[];
|
|
80
|
+
/** Computed style overrides. */
|
|
81
|
+
styleOverrides: Partial<NodeStyle> | Partial<EdgeStyle>;
|
|
82
|
+
/** Additional classes to apply. */
|
|
83
|
+
addedClasses: string[];
|
|
84
|
+
/** Badge to display. */
|
|
85
|
+
badge?: {
|
|
86
|
+
text: string;
|
|
87
|
+
color: string;
|
|
88
|
+
};
|
|
89
|
+
/** Tooltip text. */
|
|
90
|
+
tooltip?: string;
|
|
91
|
+
/** Animation name. */
|
|
92
|
+
animation?: string;
|
|
93
|
+
}
|
|
94
|
+
export declare class ConditionalStylingEngine {
|
|
95
|
+
private profiles;
|
|
96
|
+
private activeProfileId;
|
|
97
|
+
private listeners;
|
|
98
|
+
private cache;
|
|
99
|
+
constructor();
|
|
100
|
+
/** Add a rule to a profile. */
|
|
101
|
+
addRule(rule: ConditionalStyleRule, profileId?: string): void;
|
|
102
|
+
/** Remove a rule. */
|
|
103
|
+
removeRule(ruleId: string, profileId?: string): void;
|
|
104
|
+
/** Update a rule. */
|
|
105
|
+
updateRule(ruleId: string, updates: Partial<ConditionalStyleRule>, profileId?: string): void;
|
|
106
|
+
/** Toggle rule enabled state. */
|
|
107
|
+
toggleRule(ruleId: string, enabled: boolean, profileId?: string): void;
|
|
108
|
+
/** Add a profile. */
|
|
109
|
+
addProfile(profile: ConditionalStyleProfile): void;
|
|
110
|
+
/** Remove a profile. */
|
|
111
|
+
removeProfile(profileId: string): void;
|
|
112
|
+
/** Set active profile. */
|
|
113
|
+
setActiveProfile(profileId: string): void;
|
|
114
|
+
/** Get all profiles. */
|
|
115
|
+
getProfiles(): ConditionalStyleProfile[];
|
|
116
|
+
/** Get active profile. */
|
|
117
|
+
getActiveProfile(): ConditionalStyleProfile | null;
|
|
118
|
+
/** Apply styles to a node. */
|
|
119
|
+
applyToNode(node: DiagramNode): AppliedStyles;
|
|
120
|
+
/** Apply styles to an edge. */
|
|
121
|
+
applyToEdge(edge: DiagramEdge): AppliedStyles;
|
|
122
|
+
/** Apply styles to all elements. */
|
|
123
|
+
applyToAll(nodes: DiagramNode[], edges: DiagramEdge[]): Map<string, AppliedStyles>;
|
|
124
|
+
/** Process rules and compute styles. */
|
|
125
|
+
private processRules;
|
|
126
|
+
/** Evaluate a condition against an element. */
|
|
127
|
+
private evaluateCondition;
|
|
128
|
+
/** Get property value from element (supports dot notation). */
|
|
129
|
+
private getPropertyValue;
|
|
130
|
+
/** Compare values based on operator. */
|
|
131
|
+
private compareValues;
|
|
132
|
+
/** Apply style actions to the result. */
|
|
133
|
+
private applyActions;
|
|
134
|
+
private emptyStyles;
|
|
135
|
+
private invalidateCache;
|
|
136
|
+
/** Subscribe to changes. */
|
|
137
|
+
subscribe(listener: () => void): () => void;
|
|
138
|
+
private notify;
|
|
139
|
+
/** Export configuration. */
|
|
140
|
+
exportConfig(): string;
|
|
141
|
+
/** Import configuration. */
|
|
142
|
+
importConfig(json: string): void;
|
|
143
|
+
}
|
|
144
|
+
/** Preset rules for common scenarios. */
|
|
145
|
+
export declare const PRESET_RULES: ConditionalStyleRule[];
|
|
146
|
+
/** Create a rule from preset. */
|
|
147
|
+
export declare function createRuleFromPreset(presetId: string): ConditionalStyleRule | null;
|
|
148
|
+
/** Create a new conditional styling engine with presets. */
|
|
149
|
+
export declare function createConditionalStylingEngine(loadPresets?: boolean): ConditionalStylingEngine;
|
|
150
|
+
export default ConditionalStylingEngine;
|
|
151
|
+
//# sourceMappingURL=conditionalStyling.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conditionalStyling.d.ts","sourceRoot":"","sources":["../../src/core/conditionalStyling.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAMvG,0CAA0C;AAC1C,MAAM,MAAM,sBAAsB,GAC5B,QAAQ,GACR,YAAY,GACZ,cAAc,GACd,wBAAwB,GACxB,WAAW,GACX,qBAAqB,GACrB,UAAU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kBzB,+DAA+D;IAC/D,OAAO,CAAC,gBAAgB;IAYxB,wCAAwC;IACxC,OAAO,CAAC,aAAa;IAiErB,yCAAyC;IACzC,OAAO,CAAC,YAAY;IAuDpB,OAAO,CAAC,WAAW;IASnB,OAAO,CAAC,eAAe;IAIvB,4BAA4B;IAC5B,SAAS,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI;IAK3C,OAAO,CAAC,MAAM;IAId,4BAA4B;IAC5B,YAAY,IAAI,MAAM;IAOtB,4BAA4B;IAC5B,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;CAUnC;AAMD,yCAAyC;AACzC,eAAO,MAAM,YAAY,EAAE,oBAAoB,EA2F9C,CAAC;AAEF,iCAAiC;AACjC,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,oBAAoB,GAAG,IAAI,CAQlF;AAED,4DAA4D;AAC5D,wBAAgB,8BAA8B,CAAC,WAAW,UAAQ,GAAG,wBAAwB,CAQ5F;AAED,eAAe,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { DiagramNode, DiagramEdge, DiagramDataBinding, NodeShape } from '../types/diagramTypes';
|
|
2
|
+
|
|
3
|
+
export interface DataRecord {
|
|
4
|
+
[key: string]: unknown;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Generate nodes and edges from flat data records + binding config.
|
|
8
|
+
*/
|
|
9
|
+
export declare function generateDiagramFromData(records: DataRecord[], binding: DiagramDataBinding, defaultShape?: NodeShape): {
|
|
10
|
+
nodes: DiagramNode[];
|
|
11
|
+
edges: DiagramEdge[];
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Fetch data from a URL and generate diagram.
|
|
15
|
+
* Handles JSON REST responses.
|
|
16
|
+
*/
|
|
17
|
+
export declare function fetchAndGenerateDiagram(binding: DiagramDataBinding, defaultShape?: NodeShape, abortSignal?: AbortSignal): Promise<{
|
|
18
|
+
nodes: DiagramNode[];
|
|
19
|
+
edges: DiagramEdge[];
|
|
20
|
+
}>;
|
|
21
|
+
//# sourceMappingURL=dataBinding.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dataBinding.d.ts","sourceRoot":"","sources":["../../src/core/dataBinding.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EACV,WAAW,EACX,WAAW,EACX,kBAAkB,EAClB,SAAS,EACV,MAAM,uBAAuB,CAAC;AAE/B,MAAM,WAAW,UAAU;IACzB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,UAAU,EAAE,EACrB,OAAO,EAAE,kBAAkB,EAC3B,YAAY,GAAE,SAAyB,GACtC;IAAE,KAAK,EAAE,WAAW,EAAE,CAAC;IAAC,KAAK,EAAE,WAAW,EAAE,CAAA;CAAE,CA8FhD;AAED;;;GAGG;AACH,wBAAsB,uBAAuB,CAC3C,OAAO,EAAE,kBAAkB,EAC3B,YAAY,CAAC,EAAE,SAAS,EACxB,WAAW,CAAC,EAAE,WAAW,GACxB,OAAO,CAAC;IAAE,KAAK,EAAE,WAAW,EAAE,CAAC;IAAC,KAAK,EAAE,WAAW,EAAE,CAAA;CAAE,CAAC,CAQzD"}
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Diagram Comments & Annotations — Collaborative feedback on diagrams.
|
|
3
|
+
*
|
|
4
|
+
* Features:
|
|
5
|
+
* - Sticky notes on canvas
|
|
6
|
+
* - @mentions support
|
|
7
|
+
* - Resolve/unresolve states
|
|
8
|
+
* - Thread replies
|
|
9
|
+
* - Anchor to nodes/edges or free-floating
|
|
10
|
+
*/
|
|
11
|
+
/** Comment status. */
|
|
12
|
+
export type CommentStatus = "open" | "resolved" | "wontfix";
|
|
13
|
+
/** Comment anchor type. */
|
|
14
|
+
export type CommentAnchorType = "node" | "edge" | "group" | "position" | "viewport";
|
|
15
|
+
/** Anchor for the comment. */
|
|
16
|
+
export interface CommentAnchor {
|
|
17
|
+
/** Type of anchor. */
|
|
18
|
+
type: CommentAnchorType;
|
|
19
|
+
/** Target element ID (for node/edge/group). */
|
|
20
|
+
elementId?: string;
|
|
21
|
+
/** Position on canvas (for position type). */
|
|
22
|
+
position?: {
|
|
23
|
+
x: number;
|
|
24
|
+
y: number;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
/** A mention in a comment. */
|
|
28
|
+
export interface CommentMention {
|
|
29
|
+
/** User ID being mentioned. */
|
|
30
|
+
userId: string;
|
|
31
|
+
/** Display name. */
|
|
32
|
+
userName: string;
|
|
33
|
+
/** Start index in text. */
|
|
34
|
+
startIndex: number;
|
|
35
|
+
/** End index in text. */
|
|
36
|
+
endIndex: number;
|
|
37
|
+
}
|
|
38
|
+
/** A single reply in a comment thread. */
|
|
39
|
+
export interface CommentReply {
|
|
40
|
+
/** Unique reply ID. */
|
|
41
|
+
id: string;
|
|
42
|
+
/** Author user ID. */
|
|
43
|
+
authorId: string;
|
|
44
|
+
/** Author display name. */
|
|
45
|
+
authorName: string;
|
|
46
|
+
/** Author avatar URL. */
|
|
47
|
+
authorAvatar?: string;
|
|
48
|
+
/** Reply text. */
|
|
49
|
+
text: string;
|
|
50
|
+
/** Mentions in this reply. */
|
|
51
|
+
mentions: CommentMention[];
|
|
52
|
+
/** When the reply was created. */
|
|
53
|
+
createdAt: string;
|
|
54
|
+
/** When the reply was last edited. */
|
|
55
|
+
editedAt?: string;
|
|
56
|
+
/** Whether the reply is deleted (soft delete). */
|
|
57
|
+
deleted?: boolean;
|
|
58
|
+
}
|
|
59
|
+
/** A comment on a diagram. */
|
|
60
|
+
export interface DiagramComment {
|
|
61
|
+
/** Unique comment ID. */
|
|
62
|
+
id: string;
|
|
63
|
+
/** Anchor for this comment. */
|
|
64
|
+
anchor: CommentAnchor;
|
|
65
|
+
/** Comment status. */
|
|
66
|
+
status: CommentStatus;
|
|
67
|
+
/** Author user ID. */
|
|
68
|
+
authorId: string;
|
|
69
|
+
/** Author display name. */
|
|
70
|
+
authorName: string;
|
|
71
|
+
/** Author avatar URL. */
|
|
72
|
+
authorAvatar?: string;
|
|
73
|
+
/** Main comment text. */
|
|
74
|
+
text: string;
|
|
75
|
+
/** Mentions in main comment. */
|
|
76
|
+
mentions: CommentMention[];
|
|
77
|
+
/** Thread replies. */
|
|
78
|
+
replies: CommentReply[];
|
|
79
|
+
/** When the comment was created. */
|
|
80
|
+
createdAt: string;
|
|
81
|
+
/** When the comment was last edited. */
|
|
82
|
+
editedAt?: string;
|
|
83
|
+
/** Who resolved the comment (if resolved). */
|
|
84
|
+
resolvedBy?: string;
|
|
85
|
+
/** When resolved. */
|
|
86
|
+
resolvedAt?: string;
|
|
87
|
+
/** Visual style (color, size). */
|
|
88
|
+
style?: CommentStyle;
|
|
89
|
+
/** Tags/labels. */
|
|
90
|
+
tags?: string[];
|
|
91
|
+
/** Priority level. */
|
|
92
|
+
priority?: "low" | "medium" | "high" | "critical";
|
|
93
|
+
}
|
|
94
|
+
/** Visual style for a comment. */
|
|
95
|
+
export interface CommentStyle {
|
|
96
|
+
/** Background color. */
|
|
97
|
+
backgroundColor?: string;
|
|
98
|
+
/** Border color. */
|
|
99
|
+
borderColor?: string;
|
|
100
|
+
/** Text color. */
|
|
101
|
+
textColor?: string;
|
|
102
|
+
/** Size: small, medium, large. */
|
|
103
|
+
size?: "small" | "medium" | "large";
|
|
104
|
+
/** Icon name. */
|
|
105
|
+
icon?: string;
|
|
106
|
+
}
|
|
107
|
+
/** Configuration for comment manager. */
|
|
108
|
+
export interface CommentManagerConfig {
|
|
109
|
+
/** Current user ID. */
|
|
110
|
+
userId: string;
|
|
111
|
+
/** Current user display name. */
|
|
112
|
+
userName: string;
|
|
113
|
+
/** Current user avatar URL. */
|
|
114
|
+
userAvatar?: string;
|
|
115
|
+
/** Available users for mentions. */
|
|
116
|
+
availableUsers?: Array<{
|
|
117
|
+
id: string;
|
|
118
|
+
name: string;
|
|
119
|
+
avatar?: string;
|
|
120
|
+
}>;
|
|
121
|
+
/** Default style for new comments. */
|
|
122
|
+
defaultStyle?: CommentStyle;
|
|
123
|
+
/** Whether to allow anonymous comments. */
|
|
124
|
+
allowAnonymous?: boolean;
|
|
125
|
+
}
|
|
126
|
+
/** Filter options for comments. */
|
|
127
|
+
export interface CommentFilter {
|
|
128
|
+
/** Filter by status. */
|
|
129
|
+
status?: CommentStatus[];
|
|
130
|
+
/** Filter by author. */
|
|
131
|
+
authorId?: string;
|
|
132
|
+
/** Filter by priority. */
|
|
133
|
+
priority?: ("low" | "medium" | "high" | "critical")[];
|
|
134
|
+
/** Filter by tags. */
|
|
135
|
+
tags?: string[];
|
|
136
|
+
/** Filter by anchor type. */
|
|
137
|
+
anchorType?: CommentAnchorType[];
|
|
138
|
+
/** Filter by element ID. */
|
|
139
|
+
elementId?: string;
|
|
140
|
+
/** Search text in comments. */
|
|
141
|
+
searchText?: string;
|
|
142
|
+
/** Only comments mentioning a specific user. */
|
|
143
|
+
mentionedUserId?: string;
|
|
144
|
+
}
|
|
145
|
+
export declare class DiagramCommentManager {
|
|
146
|
+
private comments;
|
|
147
|
+
private config;
|
|
148
|
+
private listeners;
|
|
149
|
+
private mentionListeners;
|
|
150
|
+
constructor(config: CommentManagerConfig);
|
|
151
|
+
/** Add a new comment. */
|
|
152
|
+
addComment(anchor: CommentAnchor, text: string, options?: Partial<Pick<DiagramComment, "style" | "tags" | "priority">>): DiagramComment;
|
|
153
|
+
/** Update an existing comment. */
|
|
154
|
+
updateComment(commentId: string, updates: Partial<Pick<DiagramComment, "text" | "style" | "tags" | "priority" | "anchor">>): DiagramComment | null;
|
|
155
|
+
/** Delete a comment. */
|
|
156
|
+
deleteComment(commentId: string): boolean;
|
|
157
|
+
/** Resolve a comment. */
|
|
158
|
+
resolveComment(commentId: string, status?: CommentStatus): DiagramComment | null;
|
|
159
|
+
/** Reopen a resolved comment. */
|
|
160
|
+
reopenComment(commentId: string): DiagramComment | null;
|
|
161
|
+
/** Add a reply to a comment. */
|
|
162
|
+
addReply(commentId: string, text: string): CommentReply | null;
|
|
163
|
+
/** Edit a reply. */
|
|
164
|
+
editReply(commentId: string, replyId: string, text: string): CommentReply | null;
|
|
165
|
+
/** Delete a reply (soft delete). */
|
|
166
|
+
deleteReply(commentId: string, replyId: string): boolean;
|
|
167
|
+
/** Get a comment by ID. */
|
|
168
|
+
getComment(commentId: string): DiagramComment | undefined;
|
|
169
|
+
/** Get all comments. */
|
|
170
|
+
getAllComments(): DiagramComment[];
|
|
171
|
+
/** Get comments for a specific element. */
|
|
172
|
+
getCommentsForElement(elementId: string): DiagramComment[];
|
|
173
|
+
/** Get open comments. */
|
|
174
|
+
getOpenComments(): DiagramComment[];
|
|
175
|
+
/** Get comments mentioning a user. */
|
|
176
|
+
getCommentsMentioningUser(userId: string): DiagramComment[];
|
|
177
|
+
/** Filter comments. */
|
|
178
|
+
filterComments(filter: CommentFilter): DiagramComment[];
|
|
179
|
+
/** Parse @mentions from text. */
|
|
180
|
+
private parseMentions;
|
|
181
|
+
/** Subscribe to comment changes. */
|
|
182
|
+
subscribe(listener: () => void): () => void;
|
|
183
|
+
/** Subscribe to mention notifications. */
|
|
184
|
+
onMention(listener: (comment: DiagramComment, userId: string) => void): () => void;
|
|
185
|
+
private notify;
|
|
186
|
+
private notifyMention;
|
|
187
|
+
/** Export comments as JSON. */
|
|
188
|
+
exportComments(): string;
|
|
189
|
+
/** Import comments from JSON. */
|
|
190
|
+
importComments(json: string): void;
|
|
191
|
+
/** Get counts by status. */
|
|
192
|
+
getCounts(): {
|
|
193
|
+
open: number;
|
|
194
|
+
resolved: number;
|
|
195
|
+
wontfix: number;
|
|
196
|
+
total: number;
|
|
197
|
+
};
|
|
198
|
+
/** Update configuration (e.g., when user changes). */
|
|
199
|
+
updateConfig(updates: Partial<CommentManagerConfig>): void;
|
|
200
|
+
}
|
|
201
|
+
/** Default comment styles by priority. */
|
|
202
|
+
export declare const COMMENT_PRIORITY_STYLES: Record<string, CommentStyle>;
|
|
203
|
+
/** Format comment date for display. */
|
|
204
|
+
export declare function formatCommentDate(isoDate: string): string;
|
|
205
|
+
/** Render text with mentions highlighted. */
|
|
206
|
+
export declare function renderTextWithMentions(text: string, mentions: CommentMention[]): string;
|
|
207
|
+
export default DiagramCommentManager;
|
|
208
|
+
//# sourceMappingURL=diagramComments.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diagramComments.d.ts","sourceRoot":"","sources":["../../src/core/diagramComments.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAMH,sBAAsB;AACtB,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,UAAU,GAAG,SAAS,CAAC;AAE5D,2BAA2B;AAC3B,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,UAAU,GAAG,UAAU,CAAC;AAEpF,8BAA8B;AAC9B,MAAM,WAAW,aAAa;IAC1B,sBAAsB;IACtB,IAAI,EAAE,iBAAiB,CAAC;IACxB,+CAA+C;IAC/C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8CAA8C;IAC9C,QAAQ,CAAC,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACvC;AAED,8BAA8B;AAC9B,MAAM,WAAW,cAAc;IAC3B,+BAA+B;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,oBAAoB;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,2BAA2B;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,yBAAyB;IACzB,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED,0CAA0C;AAC1C,MAAM,WAAW,YAAY;IACzB,uBAAuB;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,sBAAsB;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,2BAA2B;IAC3B,U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AM,CAcvF;AAED,eAAe,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { LiquidFlowConfig, Point } from '../types/diagramTypes';
|
|
2
|
+
|
|
3
|
+
export interface Particle {
|
|
4
|
+
x: number;
|
|
5
|
+
y: number;
|
|
6
|
+
vx: number;
|
|
7
|
+
vy: number;
|
|
8
|
+
life: number;
|
|
9
|
+
maxLife: number;
|
|
10
|
+
size: number;
|
|
11
|
+
color: string;
|
|
12
|
+
opacity: number;
|
|
13
|
+
}
|
|
14
|
+
export interface LiquidFlowState {
|
|
15
|
+
/** Edge ID */
|
|
16
|
+
edgeId: string;
|
|
17
|
+
/** SVG gradient offset (0–1 animated position) */
|
|
18
|
+
gradientOffset: number;
|
|
19
|
+
/** Fill progress (0–1, how much of the pipe is filled) */
|
|
20
|
+
fillProgress: number;
|
|
21
|
+
/** Bubble particles along the edge */
|
|
22
|
+
particles: LiquidParticle[];
|
|
23
|
+
/** Whether the flow is currently active */
|
|
24
|
+
active: boolean;
|
|
25
|
+
}
|
|
26
|
+
export interface LiquidParticle {
|
|
27
|
+
/** Position along path (0–1) */
|
|
28
|
+
t: number;
|
|
29
|
+
/** Lateral offset from path center */
|
|
30
|
+
offset: number;
|
|
31
|
+
/** Particle radius */
|
|
32
|
+
size: number;
|
|
33
|
+
/** Opacity */
|
|
34
|
+
opacity: number;
|
|
35
|
+
}
|
|
36
|
+
export interface GlowState {
|
|
37
|
+
elementId: string;
|
|
38
|
+
color: string;
|
|
39
|
+
intensity: number;
|
|
40
|
+
/** Animated pulse value (modulates intensity) */
|
|
41
|
+
pulse: number;
|
|
42
|
+
}
|
|
43
|
+
export declare class DiagramParticleEngine {
|
|
44
|
+
private liquidFlows;
|
|
45
|
+
private glowStates;
|
|
46
|
+
private particles;
|
|
47
|
+
private emitters;
|
|
48
|
+
private rafId;
|
|
49
|
+
private running;
|
|
50
|
+
private lastTime;
|
|
51
|
+
private onFrame;
|
|
52
|
+
constructor(onFrame: (state: ParticleEngineState) => void);
|
|
53
|
+
startLiquidFlow(edgeId: string, config: LiquidFlowConfig): void;
|
|
54
|
+
stopLiquidFlow(edgeId: string): void;
|
|
55
|
+
setGlow(elementId: string, color: string, intensity: number): void;
|
|
56
|
+
removeGlow(elementId: string): void;
|
|
57
|
+
addEmitter(emitter: ParticleEmitter): string;
|
|
58
|
+
removeEmitter(id: string): void;
|
|
59
|
+
start(): void;
|
|
60
|
+
stop(): void;
|
|
61
|
+
destroy(): void;
|
|
62
|
+
isRunning(): boolean;
|
|
63
|
+
getState(): ParticleEngineState;
|
|
64
|
+
private tick;
|
|
65
|
+
}
|
|
66
|
+
export interface ParticleEmitter {
|
|
67
|
+
id: string;
|
|
68
|
+
position: Point;
|
|
69
|
+
/** Particles emitted per second */
|
|
70
|
+
rate: number;
|
|
71
|
+
/** Initial speed */
|
|
72
|
+
speed: number;
|
|
73
|
+
/** Spread radius for spawn position */
|
|
74
|
+
spread: number;
|
|
75
|
+
/** Color of particles */
|
|
76
|
+
color: string;
|
|
77
|
+
/** Particle lifetime in seconds */
|
|
78
|
+
particleLife: number;
|
|
79
|
+
/** Base particle size */
|
|
80
|
+
particleSize: number;
|
|
81
|
+
/** Internal accumulator — do not set */
|
|
82
|
+
accumulator?: number;
|
|
83
|
+
}
|
|
84
|
+
export interface ParticleEngineState {
|
|
85
|
+
liquidFlows: Map<string, LiquidFlowState>;
|
|
86
|
+
glowStates: Map<string, GlowState>;
|
|
87
|
+
particles: Particle[];
|
|
88
|
+
}
|
|
89
|
+
export declare function getPointOnPath(pathData: string, t: number, svgElement?: SVGSVGElement): Point;
|
|
90
|
+
/**
|
|
91
|
+
* Compute the SVG filter string for a glow effect.
|
|
92
|
+
* Returns a filter ID and SVG filter element markup.
|
|
93
|
+
*/
|
|
94
|
+
export declare function createGlowFilterId(elementId: string): string;
|
|
95
|
+
export declare function computeGlowRadius(intensity: number, pulse: number): number;
|
|
96
|
+
//# sourceMappingURL=diagramParticleEngine.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diagramParticleEngine.d.ts","sourceRoot":"","sources":["../../src/core/diagramParticleEngine.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAIrE,MAAM,WAAW,QAAQ;IACvB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB;AAID,MAAM,WAAW,eAAe;IAC9B,cAAc;IACd,MAAM,EAAE,MAAM,CAAC;IACf,kDAAkD;IAClD,cAAc,EAAE,MAAM,CAAC;IACvB,0DAA0D;IAC1D,YAAY,EAAE,MAAM,CAAC;IACrB,sCAAsC;IACtC,SAAS,EAAE,cAAc,EAAE,CAAC;IAC5B,2CAA2C;IAC3C,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,cAAc;IAC7B,gCAAgC;IAChC,CAAC,EAAE,MAAM,CAAC;IACV,sCAAsC;IACtC,MAAM,EAAE,MAAM,CAAC;IACf,sBAAsB;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,cAAc;IACd,OAAO,EAAE,MAAM,CAAC;CACjB;AAID,MAAM,WAAW,SAAS;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,iDAAiD;IACjD,KAAK,EAAE,MAAM,CAAC;CACf;AAID,qBAAa,qBAAqB;IAChC,OAAO,CAAC,WAAW,CAAsC;IACzD,OAAO,CAAC,UAAU,CAAgC;IAClD,OAAO,CAAC,SAAS,CAAkB;IAC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AC;IAC1C,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IACnC,SAAS,EAAE,QAAQ,EAAE,CAAC;CACvB;AAID,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,aAAa,GAAG,KAAK,CAY7F;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAE5D;AAED,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAI1E"}
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import { DiagramNode, DiagramEdge, DiagramGroup, NodeShape } from '../types/diagramTypes';
|
|
2
|
+
|
|
3
|
+
/** Search scope. */
|
|
4
|
+
export type SearchScope = "all" | "nodes" | "edges" | "groups" | "labels" | "data";
|
|
5
|
+
/** Match type. */
|
|
6
|
+
export type MatchType = "contains" | "exact" | "starts_with" | "ends_with" | "regex";
|
|
7
|
+
/** Search options. */
|
|
8
|
+
export interface DiagramSearchOptions {
|
|
9
|
+
/** What to search. */
|
|
10
|
+
scope?: SearchScope;
|
|
11
|
+
/** How to match. */
|
|
12
|
+
matchType?: MatchType;
|
|
13
|
+
/** Case-sensitive search. */
|
|
14
|
+
caseSensitive?: boolean;
|
|
15
|
+
/** Also search in data properties. */
|
|
16
|
+
searchData?: boolean;
|
|
17
|
+
/** Properties to search in data (empty = all). */
|
|
18
|
+
dataProperties?: string[];
|
|
19
|
+
/** Max results to return. */
|
|
20
|
+
maxResults?: number;
|
|
21
|
+
/** Highlight matches. */
|
|
22
|
+
highlight?: boolean;
|
|
23
|
+
/** Filter by node shapes. */
|
|
24
|
+
nodeShapes?: NodeShape[];
|
|
25
|
+
/** Filter by group. */
|
|
26
|
+
groupIds?: string[];
|
|
27
|
+
}
|
|
28
|
+
/** Filter definition. */
|
|
29
|
+
export interface DiagramFilter {
|
|
30
|
+
/** Filter ID. */
|
|
31
|
+
id: string;
|
|
32
|
+
/** Property path to filter on. */
|
|
33
|
+
property: string;
|
|
34
|
+
/** Operator. */
|
|
35
|
+
operator: "equals" | "not_equals" | "contains" | "greater_than" | "less_than" | "in" | "not_in" | "is_null" | "is_not_null";
|
|
36
|
+
/** Value to compare. */
|
|
37
|
+
value?: unknown;
|
|
38
|
+
}
|
|
39
|
+
/** Search result. */
|
|
40
|
+
export interface SearchResult {
|
|
41
|
+
/** Element ID. */
|
|
42
|
+
id: string;
|
|
43
|
+
/** Element type. */
|
|
44
|
+
type: "node" | "edge" | "group";
|
|
45
|
+
/** Label or name. */
|
|
46
|
+
label: string;
|
|
47
|
+
/** The actual element. */
|
|
48
|
+
element: DiagramNode | DiagramEdge | DiagramGroup;
|
|
49
|
+
/** Match text (what matched). */
|
|
50
|
+
matchText: string;
|
|
51
|
+
/** Match location (property that matched). */
|
|
52
|
+
matchProperty: string;
|
|
53
|
+
/** Match positions for highlighting. */
|
|
54
|
+
matchPositions?: Array<{
|
|
55
|
+
start: number;
|
|
56
|
+
end: number;
|
|
57
|
+
}>;
|
|
58
|
+
/** Relevance score (higher = more relevant). */
|
|
59
|
+
score: number;
|
|
60
|
+
}
|
|
61
|
+
/** Filter preset. */
|
|
62
|
+
export interface FilterPreset {
|
|
63
|
+
/** Preset ID. */
|
|
64
|
+
id: string;
|
|
65
|
+
/** Preset name. */
|
|
66
|
+
name: string;
|
|
67
|
+
/** Description. */
|
|
68
|
+
description?: string;
|
|
69
|
+
/** Filters in this preset. */
|
|
70
|
+
filters: DiagramFilter[];
|
|
71
|
+
/** Search query if any. */
|
|
72
|
+
searchQuery?: string;
|
|
73
|
+
/** Search options. */
|
|
74
|
+
searchOptions?: DiagramSearchOptions;
|
|
75
|
+
}
|
|
76
|
+
/** Search state. */
|
|
77
|
+
export interface SearchState {
|
|
78
|
+
/** Current query. */
|
|
79
|
+
query: string;
|
|
80
|
+
/** Search results. */
|
|
81
|
+
results: SearchResult[];
|
|
82
|
+
/** Currently selected result index. */
|
|
83
|
+
selectedIndex: number;
|
|
84
|
+
/** Active filters. */
|
|
85
|
+
filters: DiagramFilter[];
|
|
86
|
+
/** Whether search is active. */
|
|
87
|
+
isActive: boolean;
|
|
88
|
+
/** Total count of matching elements. */
|
|
89
|
+
totalCount: number;
|
|
90
|
+
}
|
|
91
|
+
export declare class DiagramSearchFilterEngine {
|
|
92
|
+
private nodes;
|
|
93
|
+
private edges;
|
|
94
|
+
private groups;
|
|
95
|
+
private presets;
|
|
96
|
+
private state;
|
|
97
|
+
private listeners;
|
|
98
|
+
constructor();
|
|
99
|
+
/** Update diagram data. */
|
|
100
|
+
updateData(nodes: DiagramNode[], edges: DiagramEdge[], groups: DiagramGroup[]): void;
|
|
101
|
+
/** Search for elements. */
|
|
102
|
+
search(query: string, options?: DiagramSearchOptions): SearchResult[];
|
|
103
|
+
/** Match an element against search query. */
|
|
104
|
+
private matchElement;
|
|
105
|
+
/** Match text against query. */
|
|
106
|
+
private matchText;
|
|
107
|
+
/** Search in data object. */
|
|
108
|
+
private searchInData;
|
|
109
|
+
/** Apply filters to elements. */
|
|
110
|
+
filter(filters: DiagramFilter[]): {
|
|
111
|
+
nodes: DiagramNode[];
|
|
112
|
+
edges: DiagramEdge[];
|
|
113
|
+
groups: DiagramGroup[];
|
|
114
|
+
};
|
|
115
|
+
/** Check if element matches all filters. */
|
|
116
|
+
private matchFilters;
|
|
117
|
+
/** Check if element matches a single filter. */
|
|
118
|
+
private matchFilter;
|
|
119
|
+
/** Get property value from element with dot notation support. */
|
|
120
|
+
private getPropertyValue;
|
|
121
|
+
/** Navigate to next result. */
|
|
122
|
+
nextResult(): SearchResult | null;
|
|
123
|
+
/** Navigate to previous result. */
|
|
124
|
+
previousResult(): SearchResult | null;
|
|
125
|
+
/** Select a specific result. */
|
|
126
|
+
selectResult(index: number): SearchResult | null;
|
|
127
|
+
/** Get current state. */
|
|
128
|
+
getState(): SearchState;
|
|
129
|
+
/** Get current selected result. */
|
|
130
|
+
getSelectedResult(): SearchResult | null;
|
|
131
|
+
/** Clear search. */
|
|
132
|
+
clearSearch(): void;
|
|
133
|
+
/** Clear filters. */
|
|
134
|
+
clearFilters(): void;
|
|
135
|
+
/** Clear all. */
|
|
136
|
+
clearAll(): void;
|
|
137
|
+
/** Save as filter preset. */
|
|
138
|
+
savePreset(name: string, description?: string): FilterPreset;
|
|
139
|
+
/** Load filter preset. */
|
|
140
|
+
loadPreset(presetId: string): void;
|
|
141
|
+
/** Delete filter preset. */
|
|
142
|
+
deletePreset(presetId: string): boolean;
|
|
143
|
+
/** Get all presets. */
|
|
144
|
+
getPresets(): FilterPreset[];
|
|
145
|
+
/** Subscribe to state changes. */
|
|
146
|
+
subscribe(listener: (state: SearchState) => void): () => void;
|
|
147
|
+
private notify;
|
|
148
|
+
/** Get unique values for a property (for filter UI). */
|
|
149
|
+
getUniqueValues(property: string, elementType?: "node" | "edge" | "group"): unknown[];
|
|
150
|
+
/** Get all node shapes. */
|
|
151
|
+
getNodeShapes(): NodeShape[];
|
|
152
|
+
/** Get all edge line types. */
|
|
153
|
+
getEdgeLineTypes(): string[];
|
|
154
|
+
/** Get all groups. */
|
|
155
|
+
getGroups(): DiagramGroup[];
|
|
156
|
+
/** Export presets. */
|
|
157
|
+
exportPresets(): string;
|
|
158
|
+
/** Import presets. */
|
|
159
|
+
importPresets(json: string): void;
|
|
160
|
+
}
|
|
161
|
+
/** Highlight text with match positions. */
|
|
162
|
+
export declare function highlightMatches(text: string, positions: Array<{
|
|
163
|
+
start: number;
|
|
164
|
+
end: number;
|
|
165
|
+
}>, highlightClass?: string): string;
|
|
166
|
+
/** Create quick filter for common scenarios. */
|
|
167
|
+
export declare function createQuickFilter(scenario: "by-type" | "by-layer" | "by-status" | "custom", value?: unknown): DiagramFilter;
|
|
168
|
+
export default DiagramSearchFilterEngine;
|
|
169
|
+
//# sourceMappingURL=diagramSearch.d.ts.map
|