sequential-workflow-designer 0.33.0 → 0.34.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/css/designer-light.css +1 -1
- package/package.json +1 -1
- package/sass/designer-theme.scss +1 -1
- package/dist/index.umd.js +0 -5468
- package/lib/cjs/index.cjs +0 -5286
- package/lib/esm/index.js +0 -5226
- package/lib/index.d.ts +0 -1451
package/lib/index.d.ts
DELETED
|
@@ -1,1451 +0,0 @@
|
|
|
1
|
-
import { Definition, Step, Sequence, ComponentType, DefinitionWalker, StepWithParentSequence, BranchedStep, StepOrName } from 'sequential-workflow-model';
|
|
2
|
-
export * from 'sequential-workflow-model';
|
|
3
|
-
|
|
4
|
-
declare class Icons {
|
|
5
|
-
static folderIn: string;
|
|
6
|
-
static folderOut: string;
|
|
7
|
-
static center: string;
|
|
8
|
-
static zoomIn: string;
|
|
9
|
-
static zoomOut: string;
|
|
10
|
-
static undo: string;
|
|
11
|
-
static redo: string;
|
|
12
|
-
static move: string;
|
|
13
|
-
static delete: string;
|
|
14
|
-
static folderUp: string;
|
|
15
|
-
static close: string;
|
|
16
|
-
static options: string;
|
|
17
|
-
static expand: string;
|
|
18
|
-
static alert: string;
|
|
19
|
-
static play: string;
|
|
20
|
-
static stop: string;
|
|
21
|
-
static folder: string;
|
|
22
|
-
static appendPath(parent: SVGElement, pathClassName: string, d: string, size: number): SVGGElement;
|
|
23
|
-
static createSvg(className: string, d: string): SVGElement;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
declare class ObjectCloner {
|
|
27
|
-
static deepClone<T>(instance: T): T;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
interface Attributes {
|
|
31
|
-
[name: string]: string | number;
|
|
32
|
-
}
|
|
33
|
-
declare class Dom {
|
|
34
|
-
static svg<K extends keyof SVGElementTagNameMap>(name: K, attributes?: Attributes): SVGElementTagNameMap[K];
|
|
35
|
-
static translate(element: SVGElement, x: number, y: number): void;
|
|
36
|
-
static attrs(element: Element, attributes: Attributes): void;
|
|
37
|
-
static element<T extends keyof HTMLElementTagNameMap>(name: T, attributes?: Attributes): HTMLElementTagNameMap[T];
|
|
38
|
-
static toggleClass(element: Element, isEnabled: boolean, className: string): void;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
declare class Vector {
|
|
42
|
-
readonly x: number;
|
|
43
|
-
readonly y: number;
|
|
44
|
-
constructor(x: number, y: number);
|
|
45
|
-
add(v: Vector): Vector;
|
|
46
|
-
subtract(v: Vector): Vector;
|
|
47
|
-
multiplyByScalar(s: number): Vector;
|
|
48
|
-
divideByScalar(s: number): Vector;
|
|
49
|
-
round(): Vector;
|
|
50
|
-
distance(): number;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
declare function getAbsolutePosition(element: Element): Vector;
|
|
54
|
-
|
|
55
|
-
declare class Uid {
|
|
56
|
-
static next(): string;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
declare class SimpleEvent<T> {
|
|
60
|
-
private readonly listeners;
|
|
61
|
-
subscribe(listener: SimpleEventListener<T>): void;
|
|
62
|
-
unsubscribe(listener: SimpleEventListener<T>): void;
|
|
63
|
-
readonly forward: (value: T) => void;
|
|
64
|
-
count(): number;
|
|
65
|
-
first(): Promise<T>;
|
|
66
|
-
}
|
|
67
|
-
type SimpleEventListener<T> = (value: T) => void;
|
|
68
|
-
|
|
69
|
-
declare function race<A, B, C, D>(timeout: number, a: SimpleEvent<A>, b: SimpleEvent<B>, c?: SimpleEvent<C>, d?: SimpleEvent<D>): SimpleEvent<[A?, B?, C?, D?]>;
|
|
70
|
-
|
|
71
|
-
interface Behavior {
|
|
72
|
-
onStart(position: Vector): void;
|
|
73
|
-
onMove(delta: Vector): Behavior | void;
|
|
74
|
-
onEnd(interrupt: boolean, element: Element | null, previousEndToken: BehaviorEndToken | null): BehaviorEndToken | void;
|
|
75
|
-
}
|
|
76
|
-
interface BehaviorEndToken {
|
|
77
|
-
type: string;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
declare class BehaviorController {
|
|
81
|
-
private readonly dom;
|
|
82
|
-
private readonly shadowRoot;
|
|
83
|
-
static create(shadowRoot: ShadowRoot | undefined): BehaviorController;
|
|
84
|
-
private previousEndToken;
|
|
85
|
-
private state;
|
|
86
|
-
private constructor();
|
|
87
|
-
start(startPosition: Vector, behavior: Behavior): void;
|
|
88
|
-
private bind;
|
|
89
|
-
private unbind;
|
|
90
|
-
private readonly onMouseMove;
|
|
91
|
-
private readonly onTouchMove;
|
|
92
|
-
private readonly onMouseUp;
|
|
93
|
-
private readonly onTouchEnd;
|
|
94
|
-
private readonly onTouchStart;
|
|
95
|
-
private move;
|
|
96
|
-
private stop;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
interface DefinitionChangedEvent {
|
|
100
|
-
changeType: DefinitionChangeType;
|
|
101
|
-
stepId: string | null;
|
|
102
|
-
}
|
|
103
|
-
declare class DesignerState {
|
|
104
|
-
definition: Definition;
|
|
105
|
-
isReadonly: boolean;
|
|
106
|
-
isToolboxCollapsed: boolean;
|
|
107
|
-
isEditorCollapsed: boolean;
|
|
108
|
-
readonly onViewportChanged: SimpleEvent<Viewport>;
|
|
109
|
-
readonly onSelectedStepIdChanged: SimpleEvent<string | null>;
|
|
110
|
-
readonly onStepUnselectionBlocked: SimpleEvent<string | null>;
|
|
111
|
-
readonly onFolderPathChanged: SimpleEvent<string[]>;
|
|
112
|
-
readonly onIsReadonlyChanged: SimpleEvent<boolean>;
|
|
113
|
-
readonly onIsDraggingChanged: SimpleEvent<boolean>;
|
|
114
|
-
readonly onIsDragDisabledChanged: SimpleEvent<boolean>;
|
|
115
|
-
readonly onDefinitionChanged: SimpleEvent<DefinitionChangedEvent>;
|
|
116
|
-
readonly onIsToolboxCollapsedChanged: SimpleEvent<boolean>;
|
|
117
|
-
readonly onIsEditorCollapsedChanged: SimpleEvent<boolean>;
|
|
118
|
-
viewport: Viewport;
|
|
119
|
-
selectedStepId: string | null;
|
|
120
|
-
folderPath: string[];
|
|
121
|
-
isDragging: boolean;
|
|
122
|
-
isDragDisabled: boolean;
|
|
123
|
-
constructor(definition: Definition, isReadonly: boolean, isToolboxCollapsed: boolean, isEditorCollapsed: boolean);
|
|
124
|
-
setSelectedStepId(stepId: string | null): void;
|
|
125
|
-
pushStepIdToFolderPath(stepId: string): void;
|
|
126
|
-
setFolderPath(path: string[]): void;
|
|
127
|
-
tryGetLastStepIdFromFolderPath(): string | null;
|
|
128
|
-
setDefinition(definition: Definition): void;
|
|
129
|
-
notifyDefinitionChanged(changeType: DefinitionChangeType, stepId: string | null): void;
|
|
130
|
-
notifyStepUnselectionBlocked(stepId: string | null): void;
|
|
131
|
-
setViewport(viewport: Viewport): void;
|
|
132
|
-
setIsReadonly(isReadonly: boolean): void;
|
|
133
|
-
setIsDragging(isDragging: boolean): void;
|
|
134
|
-
setIsDragDisabled(isDragDisabled: boolean): void;
|
|
135
|
-
setIsToolboxCollapsed(isCollapsed: boolean): void;
|
|
136
|
-
setIsEditorCollapsed(isCollapsed: boolean): void;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
declare class DefinitionValidator {
|
|
140
|
-
private readonly configuration;
|
|
141
|
-
private readonly state;
|
|
142
|
-
constructor(configuration: ValidatorConfiguration | undefined, state: DesignerState);
|
|
143
|
-
validateStep(step: Step, parentSequence: Sequence): boolean;
|
|
144
|
-
validateRoot(): boolean;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
declare class IconProvider {
|
|
148
|
-
private readonly configuration;
|
|
149
|
-
constructor(configuration: StepsConfiguration);
|
|
150
|
-
getIconUrl(step: StepDefinition): string | null;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
type Services = Required<DesignerExtension>;
|
|
154
|
-
declare class ServicesResolver {
|
|
155
|
-
static resolve(extensions: DesignerExtension[] | undefined, configuration: DesignerConfiguration): Services;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
declare class StepExtensionResolver {
|
|
159
|
-
private readonly dict;
|
|
160
|
-
static create(services: Services): StepExtensionResolver;
|
|
161
|
-
private constructor();
|
|
162
|
-
resolve(componentType: ComponentType): StepExtension<Step>;
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
interface Component {
|
|
166
|
-
view: ComponentView;
|
|
167
|
-
findById(stepId: string): StepComponent | null;
|
|
168
|
-
resolveClick(click: ClickDetails): ClickCommand | null;
|
|
169
|
-
resolvePlaceholders(skipComponent: StepComponent | undefined, result: FoundPlaceholders): void;
|
|
170
|
-
updateBadges(result: BadgesResult): void;
|
|
171
|
-
}
|
|
172
|
-
interface FoundPlaceholders {
|
|
173
|
-
placeholders: Placeholder[];
|
|
174
|
-
components: StepComponent[];
|
|
175
|
-
}
|
|
176
|
-
interface ComponentView {
|
|
177
|
-
g: SVGGElement;
|
|
178
|
-
width: number;
|
|
179
|
-
height: number;
|
|
180
|
-
joinX: number;
|
|
181
|
-
}
|
|
182
|
-
interface StepComponentView extends ComponentView {
|
|
183
|
-
components: Component[] | null;
|
|
184
|
-
placeholders: Placeholder[] | null;
|
|
185
|
-
hasOutput: boolean;
|
|
186
|
-
haveCollapsedChildren?: boolean;
|
|
187
|
-
/**
|
|
188
|
-
* @param click Details about the click.
|
|
189
|
-
* @returns `true` if selected a step, a click command if clicked a specific action, `null` if not clicked at this view.
|
|
190
|
-
*/
|
|
191
|
-
resolveClick(click: ClickDetails): true | ClickCommand | null;
|
|
192
|
-
setIsDragging(isDragging: boolean): void;
|
|
193
|
-
setIsSelected(isSelected: boolean): void;
|
|
194
|
-
setIsDisabled(isDisabled: boolean): void;
|
|
195
|
-
getClientPosition(): Vector;
|
|
196
|
-
}
|
|
197
|
-
interface SequenceComponent extends Component {
|
|
198
|
-
hasOutput: boolean;
|
|
199
|
-
}
|
|
200
|
-
interface ClickDetails {
|
|
201
|
-
element: Element;
|
|
202
|
-
position: Vector;
|
|
203
|
-
scale: number;
|
|
204
|
-
}
|
|
205
|
-
type ClickCommand = SelectStepClickCommand | RerenderStepClickCommand | OpenFolderClickCommand | TriggerCustomActionClickCommand;
|
|
206
|
-
interface BaseClickCommand {
|
|
207
|
-
type: ClickCommandType;
|
|
208
|
-
}
|
|
209
|
-
interface SelectStepClickCommand extends BaseClickCommand {
|
|
210
|
-
type: ClickCommandType.selectStep;
|
|
211
|
-
component: StepComponent;
|
|
212
|
-
}
|
|
213
|
-
interface RerenderStepClickCommand extends BaseClickCommand {
|
|
214
|
-
type: ClickCommandType.rerenderStep;
|
|
215
|
-
step: Step;
|
|
216
|
-
beforeCallback?: () => void;
|
|
217
|
-
}
|
|
218
|
-
interface OpenFolderClickCommand extends BaseClickCommand {
|
|
219
|
-
type: ClickCommandType.openFolder;
|
|
220
|
-
step: Step;
|
|
221
|
-
}
|
|
222
|
-
interface TriggerCustomActionClickCommand extends BaseClickCommand {
|
|
223
|
-
type: ClickCommandType.triggerCustomAction;
|
|
224
|
-
step: Step | null;
|
|
225
|
-
sequence: Sequence;
|
|
226
|
-
action: CustomAction;
|
|
227
|
-
}
|
|
228
|
-
declare enum ClickCommandType {
|
|
229
|
-
selectStep = 1,
|
|
230
|
-
rerenderStep = 2,
|
|
231
|
-
openFolder = 3,
|
|
232
|
-
triggerCustomAction = 4
|
|
233
|
-
}
|
|
234
|
-
interface BadgeView {
|
|
235
|
-
g: SVGGElement;
|
|
236
|
-
width: number;
|
|
237
|
-
height: number;
|
|
238
|
-
}
|
|
239
|
-
interface Badge {
|
|
240
|
-
view: BadgeView | null;
|
|
241
|
-
update(result: unknown): unknown;
|
|
242
|
-
resolveClick(click: ClickDetails): ClickCommand | null;
|
|
243
|
-
}
|
|
244
|
-
type BadgesResult = unknown[];
|
|
245
|
-
interface Placeholder {
|
|
246
|
-
view: PlaceholderView;
|
|
247
|
-
parentSequence: Sequence;
|
|
248
|
-
index: number;
|
|
249
|
-
getClientRect(): DOMRect;
|
|
250
|
-
setIsHover(isHover: boolean): void;
|
|
251
|
-
setIsVisible(isVisible: boolean): void;
|
|
252
|
-
resolveClick(click: ClickDetails): ClickCommand | null;
|
|
253
|
-
}
|
|
254
|
-
declare enum PlaceholderDirection {
|
|
255
|
-
in = 1,
|
|
256
|
-
out = 2
|
|
257
|
-
}
|
|
258
|
-
interface PlaceholderView {
|
|
259
|
-
g: SVGGElement;
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
declare class StepComponent implements Component {
|
|
263
|
-
readonly view: StepComponentView;
|
|
264
|
-
readonly step: Step;
|
|
265
|
-
readonly parentSequence: Sequence;
|
|
266
|
-
readonly hasOutput: boolean;
|
|
267
|
-
private readonly badges;
|
|
268
|
-
static create(view: StepComponentView, stepContext: StepContext, componentContext: ComponentContext): StepComponent;
|
|
269
|
-
private constructor();
|
|
270
|
-
findById(stepId: string): StepComponent | null;
|
|
271
|
-
resolveClick(click: ClickDetails): ClickCommand | null;
|
|
272
|
-
resolvePlaceholders(skipComponent: StepComponent | undefined, result: FoundPlaceholders): void;
|
|
273
|
-
setIsDragging(isDragging: boolean): void;
|
|
274
|
-
setIsSelected(isSelected: boolean): void;
|
|
275
|
-
setIsDisabled(isDisabled: boolean): void;
|
|
276
|
-
updateBadges(result: BadgesResult): void;
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
declare class StepComponentFactory {
|
|
280
|
-
private readonly stepExtensionResolver;
|
|
281
|
-
constructor(stepExtensionResolver: StepExtensionResolver);
|
|
282
|
-
create(parentElement: SVGElement, stepContext: StepContext, componentContext: ComponentContext): StepComponent;
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
declare class PlaceholderController {
|
|
286
|
-
private readonly configuration;
|
|
287
|
-
static create(state: DesignerState, configuration: PlaceholderConfiguration | undefined): PlaceholderController;
|
|
288
|
-
readonly canCreate: (sequence: Sequence, index: number) => boolean;
|
|
289
|
-
readonly canShow: (sequence: Sequence, index: number, draggingStepComponentType: string, draggingStepType: string) => boolean;
|
|
290
|
-
private constructor();
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
declare class ComponentContext {
|
|
294
|
-
readonly shadowRoot: ShadowRoot | undefined;
|
|
295
|
-
readonly validator: DefinitionValidator;
|
|
296
|
-
readonly iconProvider: IconProvider;
|
|
297
|
-
readonly placeholderController: PlaceholderController;
|
|
298
|
-
readonly stepComponentFactory: StepComponentFactory;
|
|
299
|
-
readonly definitionWalker: DefinitionWalker;
|
|
300
|
-
readonly services: Services;
|
|
301
|
-
readonly preferenceStorage: PreferenceStorage;
|
|
302
|
-
readonly i18n: I18n;
|
|
303
|
-
static create(configuration: DesignerConfiguration, state: DesignerState, stepExtensionResolver: StepExtensionResolver, placeholderController: PlaceholderController, definitionWalker: DefinitionWalker, preferenceStorage: PreferenceStorage, i18n: I18n, services: Services): ComponentContext;
|
|
304
|
-
private constructor();
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
declare class CustomActionController {
|
|
308
|
-
private readonly configuration;
|
|
309
|
-
private readonly state;
|
|
310
|
-
private readonly stateModifier;
|
|
311
|
-
constructor(configuration: DesignerConfiguration, state: DesignerState, stateModifier: StateModifier);
|
|
312
|
-
trigger(action: CustomAction, step: Step | null, sequence: Sequence): void;
|
|
313
|
-
private createCustomActionHandlerContext;
|
|
314
|
-
private notifyStepChanged;
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
declare class HistoryController {
|
|
318
|
-
private readonly stack;
|
|
319
|
-
private readonly state;
|
|
320
|
-
private readonly stateModifier;
|
|
321
|
-
private readonly stackSize;
|
|
322
|
-
static create(initialStack: UndoStack | undefined, state: DesignerState, stateModifier: StateModifier, configuration: DesignerConfiguration): HistoryController;
|
|
323
|
-
constructor(stack: UndoStack, state: DesignerState, stateModifier: StateModifier, stackSize: number);
|
|
324
|
-
canUndo(): boolean;
|
|
325
|
-
undo(): void;
|
|
326
|
-
canRedo(): boolean;
|
|
327
|
-
redo(): void;
|
|
328
|
-
dump(): UndoStack;
|
|
329
|
-
replaceDefinition(definition: Definition): void;
|
|
330
|
-
private rememberCurrent;
|
|
331
|
-
private remember;
|
|
332
|
-
private commit;
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
declare class LayoutController {
|
|
336
|
-
private readonly placeholder;
|
|
337
|
-
constructor(placeholder: HTMLElement);
|
|
338
|
-
isMobile(): boolean;
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
interface WorkspaceController {
|
|
342
|
-
resolvePlaceholders(skipComponent: StepComponent | undefined): FoundPlaceholders;
|
|
343
|
-
getComponentByStepId(stepId: string): StepComponent;
|
|
344
|
-
getCanvasPosition(): Vector;
|
|
345
|
-
getCanvasSize(): Vector;
|
|
346
|
-
getRootComponentSize(): Vector;
|
|
347
|
-
updateBadges(): void;
|
|
348
|
-
updateRootComponent(): void;
|
|
349
|
-
updateCanvasSize(): void;
|
|
350
|
-
}
|
|
351
|
-
declare class WorkspaceControllerWrapper implements WorkspaceController {
|
|
352
|
-
private controller?;
|
|
353
|
-
set(controller: WorkspaceController): void;
|
|
354
|
-
private get;
|
|
355
|
-
resolvePlaceholders(skipComponent: StepComponent | undefined): FoundPlaceholders;
|
|
356
|
-
getComponentByStepId(stepId: string): StepComponent;
|
|
357
|
-
getCanvasPosition(): Vector;
|
|
358
|
-
getCanvasSize(): Vector;
|
|
359
|
-
getRootComponentSize(): Vector;
|
|
360
|
-
updateBadges(): void;
|
|
361
|
-
updateRootComponent(): void;
|
|
362
|
-
updateCanvasSize(): void;
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
declare class DesignerContext {
|
|
366
|
-
readonly theme: string;
|
|
367
|
-
readonly state: DesignerState;
|
|
368
|
-
readonly configuration: DesignerConfiguration;
|
|
369
|
-
readonly services: Services;
|
|
370
|
-
readonly componentContext: ComponentContext;
|
|
371
|
-
readonly definitionWalker: DefinitionWalker;
|
|
372
|
-
readonly i18n: I18n;
|
|
373
|
-
readonly uidGenerator: UidGenerator;
|
|
374
|
-
readonly stateModifier: StateModifier;
|
|
375
|
-
readonly layoutController: LayoutController;
|
|
376
|
-
readonly workspaceController: WorkspaceControllerWrapper;
|
|
377
|
-
readonly placeholderController: PlaceholderController;
|
|
378
|
-
readonly behaviorController: BehaviorController;
|
|
379
|
-
readonly customActionController: CustomActionController;
|
|
380
|
-
readonly historyController: HistoryController | undefined;
|
|
381
|
-
static create(placeholder: HTMLElement, startDefinition: Definition, configuration: DesignerConfiguration, services: Services): DesignerContext;
|
|
382
|
-
constructor(theme: string, state: DesignerState, configuration: DesignerConfiguration, services: Services, componentContext: ComponentContext, definitionWalker: DefinitionWalker, i18n: I18n, uidGenerator: UidGenerator, stateModifier: StateModifier, layoutController: LayoutController, workspaceController: WorkspaceControllerWrapper, placeholderController: PlaceholderController, behaviorController: BehaviorController, customActionController: CustomActionController, historyController: HistoryController | undefined);
|
|
383
|
-
setWorkspaceController(controller: WorkspaceController): void;
|
|
384
|
-
}
|
|
385
|
-
|
|
386
|
-
type EditorRendererHandler = (step: Step | null) => void;
|
|
387
|
-
declare class EditorRenderer {
|
|
388
|
-
private readonly state;
|
|
389
|
-
private readonly selectedStepIdProvider;
|
|
390
|
-
private readonly definitionWalker;
|
|
391
|
-
private readonly handler;
|
|
392
|
-
private readonly raceEvent;
|
|
393
|
-
static create(state: DesignerState, selectedStepIdProvider: SelectedStepIdProvider, definitionWalker: DefinitionWalker, handler: EditorRendererHandler): EditorRenderer;
|
|
394
|
-
private currentStepId;
|
|
395
|
-
private constructor();
|
|
396
|
-
destroy(): void;
|
|
397
|
-
private render;
|
|
398
|
-
private renderIfStepChanged;
|
|
399
|
-
private readonly raceEventHandler;
|
|
400
|
-
}
|
|
401
|
-
|
|
402
|
-
interface StateModifierDependency {
|
|
403
|
-
update(): void;
|
|
404
|
-
}
|
|
405
|
-
|
|
406
|
-
interface SelectedStepIdProvider {
|
|
407
|
-
onSelectedStepIdChanged: SimpleEvent<string | null>;
|
|
408
|
-
selectedStepId: string | null;
|
|
409
|
-
}
|
|
410
|
-
declare class EditorApi {
|
|
411
|
-
private readonly state;
|
|
412
|
-
private readonly definitionWalker;
|
|
413
|
-
private readonly stateModifier;
|
|
414
|
-
constructor(state: DesignerState, definitionWalker: DefinitionWalker, stateModifier: StateModifier);
|
|
415
|
-
isCollapsed(): boolean;
|
|
416
|
-
isReadonly(): boolean;
|
|
417
|
-
toggleIsCollapsed(): void;
|
|
418
|
-
subscribeIsCollapsed(listener: SimpleEventListener<boolean>): void;
|
|
419
|
-
getDefinition(): Definition;
|
|
420
|
-
addDefinitionModifierDependency(dependency: StateModifierDependency): void;
|
|
421
|
-
runRenderer(rendererHandler: EditorRendererHandler, customSelectedStepIdProvider: SelectedStepIdProvider | null): EditorRenderer;
|
|
422
|
-
createStepEditorContext(stepId: string): StepEditorContext;
|
|
423
|
-
createRootEditorContext(): RootEditorContext;
|
|
424
|
-
}
|
|
425
|
-
|
|
426
|
-
declare class PathBarApi {
|
|
427
|
-
private readonly state;
|
|
428
|
-
private readonly definitionWalker;
|
|
429
|
-
constructor(state: DesignerState, definitionWalker: DefinitionWalker);
|
|
430
|
-
readonly onStateChanged: SimpleEvent<[(string[] | undefined)?, (DefinitionChangedEvent | undefined)?, unknown?, unknown?]>;
|
|
431
|
-
setFolderPath(path: string[]): void;
|
|
432
|
-
getFolderPath(): string[];
|
|
433
|
-
getFolderPathStepNames(): string[];
|
|
434
|
-
}
|
|
435
|
-
|
|
436
|
-
declare class ToolboxDataProvider {
|
|
437
|
-
private readonly i18n;
|
|
438
|
-
private readonly iconProvider;
|
|
439
|
-
private readonly configuration;
|
|
440
|
-
constructor(i18n: I18n, iconProvider: IconProvider, configuration: ToolboxConfiguration | false);
|
|
441
|
-
getAllGroups(): ToolboxGroupData[];
|
|
442
|
-
private readonly createItemData;
|
|
443
|
-
applyFilter(allGroups: ToolboxGroupData[], filter: string | undefined): ToolboxGroupData[];
|
|
444
|
-
}
|
|
445
|
-
interface ToolboxGroupData {
|
|
446
|
-
name: string;
|
|
447
|
-
items: ToolboxItemData[];
|
|
448
|
-
}
|
|
449
|
-
interface ToolboxItemData {
|
|
450
|
-
iconUrl: string | null;
|
|
451
|
-
label: string;
|
|
452
|
-
lowerCaseLabel: string;
|
|
453
|
-
description: string;
|
|
454
|
-
step: StepDefinition;
|
|
455
|
-
}
|
|
456
|
-
|
|
457
|
-
declare class ToolboxApi {
|
|
458
|
-
private readonly state;
|
|
459
|
-
private readonly designerContext;
|
|
460
|
-
private readonly behaviorController;
|
|
461
|
-
private readonly toolboxDataProvider;
|
|
462
|
-
private readonly uidGenerator;
|
|
463
|
-
constructor(state: DesignerState, designerContext: DesignerContext, behaviorController: BehaviorController, toolboxDataProvider: ToolboxDataProvider, uidGenerator: UidGenerator);
|
|
464
|
-
isCollapsed(): boolean;
|
|
465
|
-
toggleIsCollapsed(): void;
|
|
466
|
-
subscribeIsCollapsed(listener: SimpleEventListener<boolean>): void;
|
|
467
|
-
getAllGroups(): ToolboxGroupData[];
|
|
468
|
-
applyFilter(allGroups: ToolboxGroupData[], filter: string | undefined): ToolboxGroupData[];
|
|
469
|
-
/**
|
|
470
|
-
* @param position Mouse or touch position.
|
|
471
|
-
* @param step Step definition.
|
|
472
|
-
* @returns If started dragging returns true, otherwise returns false.
|
|
473
|
-
*/
|
|
474
|
-
tryDrag(position: Vector, step: StepDefinition): boolean;
|
|
475
|
-
private activateStep;
|
|
476
|
-
}
|
|
477
|
-
|
|
478
|
-
declare class ViewportApi {
|
|
479
|
-
private readonly state;
|
|
480
|
-
private readonly workspaceController;
|
|
481
|
-
private readonly viewportController;
|
|
482
|
-
private readonly animator;
|
|
483
|
-
constructor(state: DesignerState, workspaceController: WorkspaceControllerWrapper, viewportController: ViewportController);
|
|
484
|
-
limitScale(scale: number): number;
|
|
485
|
-
resetViewport(): void;
|
|
486
|
-
zoom(direction: boolean): void;
|
|
487
|
-
moveViewportToStep(stepId: string): void;
|
|
488
|
-
handleWheelEvent(e: WheelEvent): void;
|
|
489
|
-
}
|
|
490
|
-
|
|
491
|
-
declare class WorkspaceApi {
|
|
492
|
-
private readonly state;
|
|
493
|
-
private readonly definitionWalker;
|
|
494
|
-
private readonly workspaceController;
|
|
495
|
-
constructor(state: DesignerState, definitionWalker: DefinitionWalker, workspaceController: WorkspaceControllerWrapper);
|
|
496
|
-
getViewport(): Viewport;
|
|
497
|
-
setViewport(viewport: Viewport): void;
|
|
498
|
-
getCanvasPosition(): Vector;
|
|
499
|
-
getCanvasSize(): Vector;
|
|
500
|
-
getRootComponentSize(): Vector;
|
|
501
|
-
updateRootComponent(): void;
|
|
502
|
-
updateBadges(): void;
|
|
503
|
-
updateCanvasSize(): void;
|
|
504
|
-
getRootSequence(): WorkspaceRootSequence;
|
|
505
|
-
}
|
|
506
|
-
interface WorkspaceRootSequence {
|
|
507
|
-
sequence: Sequence;
|
|
508
|
-
parentStep: StepWithParentSequence | null;
|
|
509
|
-
}
|
|
510
|
-
|
|
511
|
-
declare class DesignerApi {
|
|
512
|
-
readonly shadowRoot: ShadowRoot | undefined;
|
|
513
|
-
readonly controlBar: ControlBarApi;
|
|
514
|
-
readonly toolbox: ToolboxApi;
|
|
515
|
-
readonly editor: EditorApi;
|
|
516
|
-
readonly workspace: WorkspaceApi;
|
|
517
|
-
readonly viewport: ViewportApi;
|
|
518
|
-
readonly pathBar: PathBarApi;
|
|
519
|
-
readonly definitionWalker: DefinitionWalker;
|
|
520
|
-
readonly i18n: I18n;
|
|
521
|
-
static create(context: DesignerContext): DesignerApi;
|
|
522
|
-
private constructor();
|
|
523
|
-
}
|
|
524
|
-
|
|
525
|
-
declare const TYPE = "selectStep";
|
|
526
|
-
declare class SelectStepBehaviorEndToken implements BehaviorEndToken {
|
|
527
|
-
readonly stepId: string;
|
|
528
|
-
readonly time: number;
|
|
529
|
-
static is(token: BehaviorEndToken | null): token is SelectStepBehaviorEndToken;
|
|
530
|
-
readonly type = "selectStep";
|
|
531
|
-
constructor(stepId: string, time: number);
|
|
532
|
-
}
|
|
533
|
-
|
|
534
|
-
declare class Badges {
|
|
535
|
-
private readonly badges;
|
|
536
|
-
private readonly decorator;
|
|
537
|
-
static createForStep(stepContext: StepContext, view: StepComponentView, componentContext: ComponentContext): Badges;
|
|
538
|
-
static createForRoot(parentElement: SVGGElement, position: Vector, componentContext: ComponentContext): Badges;
|
|
539
|
-
private constructor();
|
|
540
|
-
update(result: BadgesResult): void;
|
|
541
|
-
resolveClick(click: ClickDetails): ClickCommand | null;
|
|
542
|
-
}
|
|
543
|
-
|
|
544
|
-
interface ValidationErrorBadgeViewConfiguration {
|
|
545
|
-
size: number;
|
|
546
|
-
iconSize: number;
|
|
547
|
-
}
|
|
548
|
-
|
|
549
|
-
interface ValidationErrorBadgeExtensionConfiguration {
|
|
550
|
-
view: ValidationErrorBadgeViewConfiguration;
|
|
551
|
-
}
|
|
552
|
-
|
|
553
|
-
declare class ValidationErrorBadgeExtension implements BadgeExtension {
|
|
554
|
-
private readonly configuration;
|
|
555
|
-
static create(configuration?: ValidationErrorBadgeExtensionConfiguration): ValidationErrorBadgeExtension;
|
|
556
|
-
readonly id = "validationError";
|
|
557
|
-
private constructor();
|
|
558
|
-
createForStep(parentElement: SVGElement, view: StepComponentView, stepContext: StepContext<Step>, componentContext: ComponentContext): Badge;
|
|
559
|
-
createForRoot(parentElement: SVGElement, componentContext: ComponentContext): Badge;
|
|
560
|
-
readonly createStartValue: () => boolean;
|
|
561
|
-
}
|
|
562
|
-
|
|
563
|
-
declare class ComponentDom {
|
|
564
|
-
static stepG(componentClassName: string, type: string, id: string): SVGGElement;
|
|
565
|
-
}
|
|
566
|
-
|
|
567
|
-
declare class InputView {
|
|
568
|
-
readonly g: SVGElement;
|
|
569
|
-
static createRectInput(parent: SVGElement, x: number, y: number, size: number, radius: number, iconSize: number, iconUrl: string | null): InputView;
|
|
570
|
-
static createRoundInput(parent: SVGElement, x: number, y: number, size: number): InputView;
|
|
571
|
-
private constructor();
|
|
572
|
-
setIsHidden(isHidden: boolean): void;
|
|
573
|
-
}
|
|
574
|
-
|
|
575
|
-
declare class JoinView {
|
|
576
|
-
static createStraightJoin(parent: SVGElement, start: Vector, height: number): void;
|
|
577
|
-
static createJoins(parent: SVGElement, start: Vector, targets: Vector[]): void;
|
|
578
|
-
}
|
|
579
|
-
|
|
580
|
-
interface LabelViewConfiguration {
|
|
581
|
-
minWidth: number;
|
|
582
|
-
height: number;
|
|
583
|
-
paddingX: number;
|
|
584
|
-
radius: number;
|
|
585
|
-
}
|
|
586
|
-
|
|
587
|
-
declare class LabelView {
|
|
588
|
-
readonly g: SVGGElement;
|
|
589
|
-
readonly width: number;
|
|
590
|
-
readonly height: number;
|
|
591
|
-
static create(parent: SVGElement, y: number, cfg: LabelViewConfiguration, text: string, theme: 'primary' | 'secondary'): LabelView;
|
|
592
|
-
constructor(g: SVGGElement, width: number, height: number);
|
|
593
|
-
}
|
|
594
|
-
|
|
595
|
-
declare class OutputView {
|
|
596
|
-
private readonly root;
|
|
597
|
-
static create(parent: SVGElement, x: number, y: number, size: number): OutputView;
|
|
598
|
-
constructor(root: SVGElement);
|
|
599
|
-
setIsHidden(isHidden: boolean): void;
|
|
600
|
-
}
|
|
601
|
-
|
|
602
|
-
declare class DefaultSequenceComponentView implements ComponentView {
|
|
603
|
-
readonly g: SVGGElement;
|
|
604
|
-
readonly width: number;
|
|
605
|
-
readonly height: number;
|
|
606
|
-
readonly joinX: number;
|
|
607
|
-
readonly placeholders: Placeholder[];
|
|
608
|
-
readonly components: StepComponent[];
|
|
609
|
-
static create(parent: SVGElement, sequenceContext: SequenceContext, componentContext: ComponentContext): DefaultSequenceComponentView;
|
|
610
|
-
private constructor();
|
|
611
|
-
hasOutput(): boolean;
|
|
612
|
-
}
|
|
613
|
-
|
|
614
|
-
declare class DefaultSequenceComponent implements SequenceComponent {
|
|
615
|
-
readonly view: DefaultSequenceComponentView;
|
|
616
|
-
readonly hasOutput: boolean;
|
|
617
|
-
static create(parentElement: SVGElement, sequenceContext: SequenceContext, context: ComponentContext): DefaultSequenceComponent;
|
|
618
|
-
private constructor();
|
|
619
|
-
resolveClick(click: ClickDetails): ClickCommand | null;
|
|
620
|
-
findById(stepId: string): StepComponent | null;
|
|
621
|
-
resolvePlaceholders(skipComponent: StepComponent | undefined, result: FoundPlaceholders): void;
|
|
622
|
-
updateBadges(result: BadgesResult): void;
|
|
623
|
-
}
|
|
624
|
-
|
|
625
|
-
interface StartStopRootComponentViewConfiguration {
|
|
626
|
-
size: number;
|
|
627
|
-
defaultIconSize: number;
|
|
628
|
-
folderIconSize: number;
|
|
629
|
-
folderIconD: string;
|
|
630
|
-
start: {
|
|
631
|
-
iconD: string;
|
|
632
|
-
} | null;
|
|
633
|
-
stopIconD: string;
|
|
634
|
-
}
|
|
635
|
-
|
|
636
|
-
interface StartStopRootComponentExtensionConfiguration {
|
|
637
|
-
view?: Partial<StartStopRootComponentViewConfiguration>;
|
|
638
|
-
}
|
|
639
|
-
|
|
640
|
-
declare class StartStopRootComponentExtension implements RootComponentExtension {
|
|
641
|
-
private readonly configuration;
|
|
642
|
-
static create(configuration?: StartStopRootComponentExtensionConfiguration): StartStopRootComponentExtension;
|
|
643
|
-
private constructor();
|
|
644
|
-
create(parentElement: SVGElement, sequence: Sequence, parentPlaceIndicator: SequencePlaceIndicator | null, context: ComponentContext): Component;
|
|
645
|
-
}
|
|
646
|
-
|
|
647
|
-
interface ContainerStepComponentViewConfiguration {
|
|
648
|
-
paddingTop: number;
|
|
649
|
-
paddingX: number;
|
|
650
|
-
inputSize: number;
|
|
651
|
-
inputRadius: number;
|
|
652
|
-
inputIconSize: number;
|
|
653
|
-
autoHideInputOnDrag: boolean;
|
|
654
|
-
label: LabelViewConfiguration;
|
|
655
|
-
}
|
|
656
|
-
|
|
657
|
-
interface ContainerStepExtensionConfiguration {
|
|
658
|
-
view: ContainerStepComponentViewConfiguration;
|
|
659
|
-
}
|
|
660
|
-
|
|
661
|
-
declare const createContainerStepComponentViewFactory: (cfg: ContainerStepComponentViewConfiguration) => StepComponentViewFactory;
|
|
662
|
-
|
|
663
|
-
interface LineGridConfiguration {
|
|
664
|
-
gridSizeX: number;
|
|
665
|
-
gridSizeY: number;
|
|
666
|
-
}
|
|
667
|
-
|
|
668
|
-
interface LaunchPadStepComponentViewConfiguration {
|
|
669
|
-
isRegionEnabled: boolean;
|
|
670
|
-
paddingY: number;
|
|
671
|
-
connectionHeight: number;
|
|
672
|
-
emptyPaddingX: number;
|
|
673
|
-
emptyPaddingY: number;
|
|
674
|
-
emptyInputSize: number;
|
|
675
|
-
emptyOutputSize: number;
|
|
676
|
-
emptyIconSize: number;
|
|
677
|
-
}
|
|
678
|
-
|
|
679
|
-
declare const createLaunchPadStepComponentViewFactory: (isInterruptedIfEmpty: boolean, cfg: LaunchPadStepComponentViewConfiguration) => StepComponentViewFactory;
|
|
680
|
-
|
|
681
|
-
interface LaunchPadStepExtensionConfiguration {
|
|
682
|
-
view?: LaunchPadStepComponentViewConfiguration;
|
|
683
|
-
}
|
|
684
|
-
|
|
685
|
-
interface SwitchStepComponentViewConfiguration {
|
|
686
|
-
minBranchWidth: number;
|
|
687
|
-
paddingX: number;
|
|
688
|
-
/**
|
|
689
|
-
* The distance between the top of the container and the center point of the input.
|
|
690
|
-
*/
|
|
691
|
-
paddingTop1: number;
|
|
692
|
-
/**
|
|
693
|
-
* The distance between the center point of the input and the name label.
|
|
694
|
-
*/
|
|
695
|
-
paddingTop2: number;
|
|
696
|
-
connectionHeight: number;
|
|
697
|
-
/**
|
|
698
|
-
* The distance between the end of the label and the bottom of the container when there are no branches.
|
|
699
|
-
*/
|
|
700
|
-
noBranchPaddingBottom: number;
|
|
701
|
-
inputSize: number;
|
|
702
|
-
inputIconSize: number;
|
|
703
|
-
autoHideInputOnDrag: boolean;
|
|
704
|
-
inputRadius: number;
|
|
705
|
-
nameLabel: LabelViewConfiguration;
|
|
706
|
-
branchNameLabel: LabelViewConfiguration;
|
|
707
|
-
}
|
|
708
|
-
|
|
709
|
-
type BranchNamesResolver = (step: BranchedStep) => string[];
|
|
710
|
-
interface SwitchStepExtensionConfiguration {
|
|
711
|
-
view?: SwitchStepComponentViewConfiguration;
|
|
712
|
-
/**
|
|
713
|
-
* A function that takes a `BranchedStep` and returns an array of branch names.
|
|
714
|
-
* If not provided, the default is: `Object.keys(step.branches)`.
|
|
715
|
-
* You can use this to provide custom ordering or filtering of branch names.
|
|
716
|
-
*/
|
|
717
|
-
branchNamesResolver?: BranchNamesResolver;
|
|
718
|
-
}
|
|
719
|
-
|
|
720
|
-
declare const createSwitchStepComponentViewFactory: (cfg: SwitchStepComponentViewConfiguration, branchNameResolver: BranchNamesResolver | undefined) => StepComponentViewFactory;
|
|
721
|
-
|
|
722
|
-
interface TaskStepComponentViewConfiguration {
|
|
723
|
-
paddingLeft: number;
|
|
724
|
-
paddingRight: number;
|
|
725
|
-
paddingY: number;
|
|
726
|
-
textMarginLeft: number;
|
|
727
|
-
minTextWidth: number;
|
|
728
|
-
iconSize: number;
|
|
729
|
-
radius: number;
|
|
730
|
-
inputSize: number;
|
|
731
|
-
outputSize: number;
|
|
732
|
-
}
|
|
733
|
-
|
|
734
|
-
declare const createTaskStepComponentViewFactory: (isInterrupted: boolean, cfg: TaskStepComponentViewConfiguration) => StepComponentViewFactory;
|
|
735
|
-
|
|
736
|
-
interface TaskStepExtensionConfiguration {
|
|
737
|
-
view: TaskStepComponentViewConfiguration;
|
|
738
|
-
}
|
|
739
|
-
|
|
740
|
-
declare class CenteredViewportCalculator {
|
|
741
|
-
static center(padding: number, canvasSize: Vector, rootComponentSize: Vector): Viewport;
|
|
742
|
-
static getFocusedOnComponent(canvasSize: Vector, viewport: Viewport, componentPosition: Vector, componentSize: Vector): Viewport;
|
|
743
|
-
}
|
|
744
|
-
|
|
745
|
-
declare class ClassicWheelController implements WheelController {
|
|
746
|
-
private readonly api;
|
|
747
|
-
static create(api: ViewportApi): ClassicWheelController;
|
|
748
|
-
private constructor();
|
|
749
|
-
onWheel(e: WheelEvent): void;
|
|
750
|
-
}
|
|
751
|
-
|
|
752
|
-
declare class ClassicWheelControllerExtension implements WheelControllerExtension {
|
|
753
|
-
readonly create: typeof ClassicWheelController.create;
|
|
754
|
-
}
|
|
755
|
-
|
|
756
|
-
interface DefaultViewportControllerConfiguration {
|
|
757
|
-
scales: number[];
|
|
758
|
-
smoothDeltaYLimit: number;
|
|
759
|
-
padding: number;
|
|
760
|
-
}
|
|
761
|
-
|
|
762
|
-
declare class DefaultViewportController implements ViewportController {
|
|
763
|
-
readonly smoothDeltaYLimit: number;
|
|
764
|
-
private readonly nqn;
|
|
765
|
-
private readonly api;
|
|
766
|
-
private readonly padding;
|
|
767
|
-
static create(api: WorkspaceApi, configuration?: DefaultViewportControllerConfiguration): DefaultViewportController;
|
|
768
|
-
private constructor();
|
|
769
|
-
getDefault(): Viewport;
|
|
770
|
-
getZoomed(direction: boolean): Viewport | null;
|
|
771
|
-
getFocusedOnComponent(componentPosition: Vector, componentSize: Vector): Viewport;
|
|
772
|
-
getNextScale(scale: number, direction: boolean): NextScale;
|
|
773
|
-
limitScale(scale: number): number;
|
|
774
|
-
}
|
|
775
|
-
|
|
776
|
-
type DefaultViewportControllerExtensionConfiguration = DefaultViewportControllerConfiguration;
|
|
777
|
-
declare class DefaultViewportControllerExtension implements ViewportControllerExtension {
|
|
778
|
-
private readonly configuration;
|
|
779
|
-
static create(configuration?: DefaultViewportControllerExtensionConfiguration): DefaultViewportControllerExtension;
|
|
780
|
-
private constructor();
|
|
781
|
-
create(api: WorkspaceApi): DefaultViewportController;
|
|
782
|
-
}
|
|
783
|
-
|
|
784
|
-
declare class RectPlaceholderView implements PlaceholderView {
|
|
785
|
-
readonly rect: SVGElement;
|
|
786
|
-
readonly g: SVGGElement;
|
|
787
|
-
static create(parent: SVGElement, width: number, height: number, radius: number, iconD: string | undefined, iconSize: number): RectPlaceholderView;
|
|
788
|
-
private constructor();
|
|
789
|
-
setIsHover(isHover: boolean): void;
|
|
790
|
-
setIsVisible(isVisible: boolean): void;
|
|
791
|
-
}
|
|
792
|
-
|
|
793
|
-
declare class RectPlaceholder implements Placeholder {
|
|
794
|
-
readonly view: RectPlaceholderView;
|
|
795
|
-
readonly parentSequence: Sequence;
|
|
796
|
-
readonly index: number;
|
|
797
|
-
static create(parent: SVGElement, size: Vector, parentSequence: Sequence, index: number, radius: number, iconD: string | undefined, iconSize: number): RectPlaceholder;
|
|
798
|
-
constructor(view: RectPlaceholderView, parentSequence: Sequence, index: number);
|
|
799
|
-
getClientRect(): DOMRect;
|
|
800
|
-
setIsHover(isHover: boolean): void;
|
|
801
|
-
setIsVisible(isVisible: boolean): void;
|
|
802
|
-
resolveClick(): null;
|
|
803
|
-
}
|
|
804
|
-
|
|
805
|
-
interface RectPlaceholderConfiguration {
|
|
806
|
-
gapWidth: number;
|
|
807
|
-
gapHeight: number;
|
|
808
|
-
radius: number;
|
|
809
|
-
iconD?: string;
|
|
810
|
-
iconSize: number;
|
|
811
|
-
}
|
|
812
|
-
|
|
813
|
-
declare class DefaultRegionView implements RegionView {
|
|
814
|
-
private readonly lines;
|
|
815
|
-
private readonly width;
|
|
816
|
-
private readonly height;
|
|
817
|
-
static create(parent: SVGElement, widths: number[], height: number): DefaultRegionView;
|
|
818
|
-
constructor(lines: SVGLineElement[], width: number, height: number);
|
|
819
|
-
getClientPosition(): Vector;
|
|
820
|
-
resolveClick(click: ClickDetails): true | null;
|
|
821
|
-
setIsSelected(isSelected: boolean): void;
|
|
822
|
-
}
|
|
823
|
-
|
|
824
|
-
declare class DefaultRegionComponentViewExtension implements RegionComponentViewExtension {
|
|
825
|
-
create(parentElement: SVGElement, componentClassName: string, stepContext: StepContext, _: StepComponentViewContext, contentFactory: RegionComponentViewContentFactory): StepComponentView;
|
|
826
|
-
}
|
|
827
|
-
|
|
828
|
-
interface DesignerExtension {
|
|
829
|
-
steps?: StepExtension[];
|
|
830
|
-
stepComponentViewWrapper?: StepComponentViewWrapperExtension;
|
|
831
|
-
stepBadgesDecorator?: StepBadgesDecoratorExtension;
|
|
832
|
-
clickBehaviorWrapperExtension?: ClickBehaviorWrapperExtension;
|
|
833
|
-
badges?: BadgeExtension[];
|
|
834
|
-
uiComponents?: UiComponentExtension[];
|
|
835
|
-
draggedComponent?: DraggedComponentExtension;
|
|
836
|
-
wheelController?: WheelControllerExtension;
|
|
837
|
-
viewportController?: ViewportControllerExtension;
|
|
838
|
-
placeholder?: PlaceholderExtension;
|
|
839
|
-
regionComponentView?: RegionComponentViewExtension;
|
|
840
|
-
grid?: GridExtension;
|
|
841
|
-
rootComponent?: RootComponentExtension;
|
|
842
|
-
sequenceComponent?: SequenceComponentExtension;
|
|
843
|
-
contextMenu?: ContextMenuExtension;
|
|
844
|
-
daemons?: DaemonExtension[];
|
|
845
|
-
}
|
|
846
|
-
interface StepExtension<S extends Step = Step> {
|
|
847
|
-
componentType: ComponentType;
|
|
848
|
-
createComponentView(parentElement: SVGElement, stepContext: StepContext<S>, viewContext: StepComponentViewContext): StepComponentView;
|
|
849
|
-
}
|
|
850
|
-
type StepComponentViewFactory = StepExtension['createComponentView'];
|
|
851
|
-
interface StepComponentViewContext {
|
|
852
|
-
i18n: I18n;
|
|
853
|
-
getStepName(): string;
|
|
854
|
-
getStepIconUrl(): string | null;
|
|
855
|
-
createStepComponent(parentElement: SVGElement, parentSequence: Sequence, step: Step, position: number): StepComponent;
|
|
856
|
-
createSequenceComponent(parentElement: SVGElement, sequence: Sequence): SequenceComponent;
|
|
857
|
-
getPlaceholderGapSize(orientation: PlaceholderGapOrientation): Vector;
|
|
858
|
-
createPlaceholderForGap(parentElement: SVGElement, sequence: Sequence, index: number, orientation: PlaceholderGapOrientation): Placeholder;
|
|
859
|
-
createPlaceholderForArea(parentElement: SVGElement, size: Vector, direction: PlaceholderDirection, sequence: Sequence, index: number): Placeholder;
|
|
860
|
-
createRegionComponentView(parentElement: SVGElement, componentClassName: string, contentFactory: RegionComponentViewContentFactory): StepComponentView;
|
|
861
|
-
getPreference(key: string): string | null;
|
|
862
|
-
setPreference(key: string, value: string): void;
|
|
863
|
-
}
|
|
864
|
-
interface StepContext<S extends Step = Step> {
|
|
865
|
-
parentSequence: Sequence;
|
|
866
|
-
step: S;
|
|
867
|
-
depth: number;
|
|
868
|
-
position: number;
|
|
869
|
-
isInputConnected: boolean;
|
|
870
|
-
isOutputConnected: boolean;
|
|
871
|
-
isPreview: boolean;
|
|
872
|
-
}
|
|
873
|
-
interface SequenceContext {
|
|
874
|
-
sequence: Sequence;
|
|
875
|
-
depth: number;
|
|
876
|
-
isInputConnected: boolean;
|
|
877
|
-
isOutputConnected: boolean;
|
|
878
|
-
isPreview: boolean;
|
|
879
|
-
}
|
|
880
|
-
interface StepComponentViewWrapperExtension {
|
|
881
|
-
wrap(view: StepComponentView, stepContext: StepContext): StepComponentView;
|
|
882
|
-
}
|
|
883
|
-
interface StepBadgesDecoratorExtension {
|
|
884
|
-
create(g: SVGGElement, view: StepComponentView, badges: (Badge | null)[]): BadgesDecorator;
|
|
885
|
-
}
|
|
886
|
-
interface BadgesDecorator {
|
|
887
|
-
update(): void;
|
|
888
|
-
}
|
|
889
|
-
interface ClickBehaviorWrapperExtension {
|
|
890
|
-
create(customActionController: CustomActionController): ClickBehaviorWrapper;
|
|
891
|
-
}
|
|
892
|
-
interface ClickBehaviorWrapper {
|
|
893
|
-
wrap(behavior: Behavior, commandOrNull: ClickCommand | null): Behavior;
|
|
894
|
-
}
|
|
895
|
-
interface BadgeExtension {
|
|
896
|
-
id: string;
|
|
897
|
-
createForStep(parentElement: SVGElement, view: StepComponentView, stepContext: StepContext, componentContext: ComponentContext): Badge;
|
|
898
|
-
createForRoot?: (parentElement: SVGElement, componentContext: ComponentContext) => Badge;
|
|
899
|
-
createStartValue(): unknown;
|
|
900
|
-
}
|
|
901
|
-
interface WheelControllerExtension {
|
|
902
|
-
create(viewportApi: ViewportApi, workspaceApi: WorkspaceApi): WheelController;
|
|
903
|
-
}
|
|
904
|
-
interface WheelController {
|
|
905
|
-
onWheel(e: WheelEvent): void;
|
|
906
|
-
}
|
|
907
|
-
interface UiComponentExtension {
|
|
908
|
-
create(root: HTMLElement, api: DesignerApi): UiComponent;
|
|
909
|
-
}
|
|
910
|
-
interface UiComponent {
|
|
911
|
-
updateLayout(): void;
|
|
912
|
-
destroy(): void;
|
|
913
|
-
}
|
|
914
|
-
interface DraggedComponentExtension {
|
|
915
|
-
create(parentElement: HTMLElement, step: Step, isAttached: boolean, componentContext: ComponentContext): DraggedComponent;
|
|
916
|
-
}
|
|
917
|
-
interface DraggedComponent {
|
|
918
|
-
width: number;
|
|
919
|
-
height: number;
|
|
920
|
-
destroy(): void;
|
|
921
|
-
}
|
|
922
|
-
interface GridExtension {
|
|
923
|
-
create(): Grid;
|
|
924
|
-
}
|
|
925
|
-
interface Grid {
|
|
926
|
-
size: Vector;
|
|
927
|
-
element: SVGElement;
|
|
928
|
-
setScale(scale: number, scaledSize: Vector): void;
|
|
929
|
-
}
|
|
930
|
-
interface RootComponentExtension {
|
|
931
|
-
create(parentElement: SVGElement, sequence: Sequence, parentPlaceIndicator: SequencePlaceIndicator | null, context: ComponentContext): Component;
|
|
932
|
-
}
|
|
933
|
-
interface SequencePlaceIndicator {
|
|
934
|
-
sequence: Sequence;
|
|
935
|
-
index: number;
|
|
936
|
-
}
|
|
937
|
-
interface SequenceComponentExtension {
|
|
938
|
-
create(parentElement: SVGElement, sequenceContext: SequenceContext, componentContext: ComponentContext): SequenceComponent;
|
|
939
|
-
}
|
|
940
|
-
interface ContextMenuExtension {
|
|
941
|
-
createItemsProvider?: (customActionController: CustomActionController) => ContextMenuItemsProvider;
|
|
942
|
-
}
|
|
943
|
-
interface ContextMenuItemsProvider {
|
|
944
|
-
getItems(step: Step | null, parentSequence: Sequence, definition: Definition): ContextMenuItem[];
|
|
945
|
-
}
|
|
946
|
-
interface ContextMenuItem {
|
|
947
|
-
readonly label: string;
|
|
948
|
-
readonly order: number;
|
|
949
|
-
readonly callback?: () => void;
|
|
950
|
-
}
|
|
951
|
-
declare enum PlaceholderGapOrientation {
|
|
952
|
-
along = 0,
|
|
953
|
-
perpendicular = 1
|
|
954
|
-
}
|
|
955
|
-
interface PlaceholderExtension {
|
|
956
|
-
getGapSize(orientation: PlaceholderGapOrientation): Vector;
|
|
957
|
-
createForGap(parentElement: SVGElement, sequence: Sequence, index: number, orientation: PlaceholderGapOrientation): Placeholder;
|
|
958
|
-
createForArea(parentElement: SVGElement, size: Vector, direction: PlaceholderDirection | null, sequence: Sequence, index: number): Placeholder;
|
|
959
|
-
}
|
|
960
|
-
interface ViewportControllerExtension {
|
|
961
|
-
create(api: WorkspaceApi): ViewportController;
|
|
962
|
-
}
|
|
963
|
-
interface ViewportController {
|
|
964
|
-
smoothDeltaYLimit: number;
|
|
965
|
-
getDefault(): Viewport;
|
|
966
|
-
getZoomed(direction: boolean): Viewport | null;
|
|
967
|
-
getFocusedOnComponent(componentPosition: Vector, componentSize: Vector): Viewport;
|
|
968
|
-
getNextScale(scale: number, direction: boolean): NextScale;
|
|
969
|
-
limitScale(scale: number): number;
|
|
970
|
-
}
|
|
971
|
-
interface NextScale {
|
|
972
|
-
current: number;
|
|
973
|
-
next: number;
|
|
974
|
-
}
|
|
975
|
-
interface Viewport {
|
|
976
|
-
readonly position: Vector;
|
|
977
|
-
readonly scale: number;
|
|
978
|
-
}
|
|
979
|
-
interface DaemonExtension {
|
|
980
|
-
create(api: DesignerApi): Daemon;
|
|
981
|
-
}
|
|
982
|
-
interface Daemon {
|
|
983
|
-
destroy(): void;
|
|
984
|
-
}
|
|
985
|
-
interface RegionView {
|
|
986
|
-
getClientPosition(): Vector;
|
|
987
|
-
/**
|
|
988
|
-
* @returns `true` if the click is inside the region, `null` if it's outside. The view may return a command to be executed.
|
|
989
|
-
*/
|
|
990
|
-
resolveClick(click: ClickDetails): true | ClickCommand | null;
|
|
991
|
-
setIsSelected(isSelected: boolean): void;
|
|
992
|
-
}
|
|
993
|
-
type RegionViewFactory = (parent: SVGElement, widths: number[], height: number) => RegionView;
|
|
994
|
-
type RegionComponentViewContentFactory = (g: SVGGElement, regionViewFactory: RegionViewFactory) => StepComponentView;
|
|
995
|
-
interface RegionComponentViewExtension {
|
|
996
|
-
create(parentElement: SVGElement, componentClassName: string, stepContext: StepContext, viewContext: StepComponentViewContext, contentFactory: RegionComponentViewContentFactory): StepComponentView;
|
|
997
|
-
}
|
|
998
|
-
|
|
999
|
-
interface DesignerConfiguration<TDefinition extends Definition = Definition> {
|
|
1000
|
-
/**
|
|
1001
|
-
* @description The theme of the designer.
|
|
1002
|
-
* @default `light`
|
|
1003
|
-
*/
|
|
1004
|
-
theme?: string;
|
|
1005
|
-
/**
|
|
1006
|
-
* @description The readonly mode of the designer.
|
|
1007
|
-
*/
|
|
1008
|
-
isReadonly?: boolean;
|
|
1009
|
-
/**
|
|
1010
|
-
* @description The depth of the undo stack. If not set, undo/redo feature will be disabled.
|
|
1011
|
-
*/
|
|
1012
|
-
undoStackSize?: number;
|
|
1013
|
-
/**
|
|
1014
|
-
* @description The initial undo stack. If not set, the undo stack will be empty.
|
|
1015
|
-
*/
|
|
1016
|
-
undoStack?: UndoStack;
|
|
1017
|
-
/**
|
|
1018
|
-
* @description The common configuration of the steps.
|
|
1019
|
-
*/
|
|
1020
|
-
steps: StepsConfiguration;
|
|
1021
|
-
/**
|
|
1022
|
-
* @description The configuration of the placeholders.
|
|
1023
|
-
*/
|
|
1024
|
-
placeholder?: PlaceholderConfiguration;
|
|
1025
|
-
/**
|
|
1026
|
-
* @description The configuration of the toolbox. If not set, the toolbox will be hidden.
|
|
1027
|
-
*/
|
|
1028
|
-
toolbox: false | ToolboxConfiguration;
|
|
1029
|
-
/**
|
|
1030
|
-
* @description The configuration of the smart editor. If not set, the smart editor will be hidden.
|
|
1031
|
-
*/
|
|
1032
|
-
editors: false | EditorsConfiguration<TDefinition>;
|
|
1033
|
-
/**
|
|
1034
|
-
* @description If true, the control bar will be displayed. In the next version, this property will be required.
|
|
1035
|
-
*/
|
|
1036
|
-
controlBar: boolean;
|
|
1037
|
-
/**
|
|
1038
|
-
* @description If false, the context menu will be disabled. By default, the context menu is enabled.
|
|
1039
|
-
*/
|
|
1040
|
-
contextMenu?: boolean;
|
|
1041
|
-
/**
|
|
1042
|
-
* @description The configuration of validators.
|
|
1043
|
-
*/
|
|
1044
|
-
validator?: ValidatorConfiguration;
|
|
1045
|
-
/**
|
|
1046
|
-
* @description The configuration of the keyboard shortcuts. By default, the keyboard shortcuts are enabled (`true`). If `false`, the keyboard shortcuts are disabled.
|
|
1047
|
-
*/
|
|
1048
|
-
keyboard?: boolean | KeyboardConfiguration;
|
|
1049
|
-
/**
|
|
1050
|
-
* @description The handler that handles custom actions.
|
|
1051
|
-
*/
|
|
1052
|
-
customActionHandler?: CustomActionHandler;
|
|
1053
|
-
/**
|
|
1054
|
-
* @description The extensions of the designer.
|
|
1055
|
-
*/
|
|
1056
|
-
extensions?: DesignerExtension[];
|
|
1057
|
-
/**
|
|
1058
|
-
* @description Custom definition walker.
|
|
1059
|
-
*/
|
|
1060
|
-
definitionWalker?: DefinitionWalker;
|
|
1061
|
-
/**
|
|
1062
|
-
* @description Custom preference storage. By default, all preferences are stored in the memory.
|
|
1063
|
-
*/
|
|
1064
|
-
preferenceStorage?: PreferenceStorage;
|
|
1065
|
-
/**
|
|
1066
|
-
* @description Custom generator of unique identifiers.
|
|
1067
|
-
*/
|
|
1068
|
-
uidGenerator?: UidGenerator;
|
|
1069
|
-
/**
|
|
1070
|
-
* @description Custom translation function.
|
|
1071
|
-
*/
|
|
1072
|
-
i18n?: I18n;
|
|
1073
|
-
/**
|
|
1074
|
-
* @description Pass the shadow root of the shadow root to the designer if the designer is placed inside the shadow DOM.
|
|
1075
|
-
*/
|
|
1076
|
-
shadowRoot?: ShadowRoot;
|
|
1077
|
-
}
|
|
1078
|
-
type UidGenerator = () => string;
|
|
1079
|
-
type I18n = (key: string, defaultValue: string) => string;
|
|
1080
|
-
type CustomActionHandler = (action: CustomAction, step: Step | null, sequence: Sequence, context: CustomActionHandlerContext) => void;
|
|
1081
|
-
interface CustomAction {
|
|
1082
|
-
type: string;
|
|
1083
|
-
}
|
|
1084
|
-
interface CustomActionHandlerContext {
|
|
1085
|
-
/**
|
|
1086
|
-
* @description Notifies the designer that the name of the step has changed.
|
|
1087
|
-
* @param stepId The id of the step whose name has changed.
|
|
1088
|
-
*/
|
|
1089
|
-
notifyStepNameChanged(stepId: string): void;
|
|
1090
|
-
/**
|
|
1091
|
-
* @description Notifies the designer that the properties of the step have changed.
|
|
1092
|
-
* @param stepId The id of the step whose properties have changed.
|
|
1093
|
-
*/
|
|
1094
|
-
notifyStepPropertiesChanged(stepId: string): void;
|
|
1095
|
-
/**
|
|
1096
|
-
* @description Notifies the designer that the step has been inserted.
|
|
1097
|
-
* @param stepId The id of the inserted step.
|
|
1098
|
-
*/
|
|
1099
|
-
notifyStepInserted(stepId: string): void;
|
|
1100
|
-
/**
|
|
1101
|
-
* @description Notifies the designer that the step has been moved.
|
|
1102
|
-
* @param stepId The id of the moved step.
|
|
1103
|
-
*/
|
|
1104
|
-
notifyStepMoved(stepId: string): void;
|
|
1105
|
-
/**
|
|
1106
|
-
* @description Notifies the designer that the step has been deleted.
|
|
1107
|
-
* @param stepId The id of the deleted step.
|
|
1108
|
-
*/
|
|
1109
|
-
notifyStepDeleted(stepId: string): void;
|
|
1110
|
-
}
|
|
1111
|
-
interface ToolboxConfiguration {
|
|
1112
|
-
labelProvider?: StepLabelProvider;
|
|
1113
|
-
descriptionProvider?: StepDescriptionProvider;
|
|
1114
|
-
isCollapsed?: boolean;
|
|
1115
|
-
groups: ToolboxGroupConfiguration[];
|
|
1116
|
-
}
|
|
1117
|
-
type StepDefinition = Omit<Step, 'id'>;
|
|
1118
|
-
type StepLabelProvider = (step: StepDefinition) => string;
|
|
1119
|
-
type StepDescriptionProvider = (step: StepDefinition) => string;
|
|
1120
|
-
interface ToolboxGroupConfiguration {
|
|
1121
|
-
name: string;
|
|
1122
|
-
steps: StepDefinition[];
|
|
1123
|
-
}
|
|
1124
|
-
interface PreferenceStorage {
|
|
1125
|
-
setItem(key: string, value: string): void;
|
|
1126
|
-
getItem(key: string): string | null;
|
|
1127
|
-
}
|
|
1128
|
-
interface StepsConfiguration {
|
|
1129
|
-
isSelectable?: (step: Step, parentSequence: Sequence) => boolean;
|
|
1130
|
-
isDraggable?: (step: Step, parentSequence: Sequence) => boolean;
|
|
1131
|
-
isDeletable?: (step: Step, parentSequence: Sequence) => boolean;
|
|
1132
|
-
isDuplicable?: (step: Step, parentSequence: Sequence) => boolean;
|
|
1133
|
-
canUnselectStep?: (step: Step, parentSequence: Sequence) => boolean;
|
|
1134
|
-
canInsertStep?: (step: Step, targetSequence: Sequence, targetIndex: number) => boolean;
|
|
1135
|
-
canMoveStep?: (sourceSequence: Sequence, step: Step, targetSequence: Sequence, targetIndex: number) => boolean;
|
|
1136
|
-
canDeleteStep?: (step: Step, parentSequence: Sequence) => boolean;
|
|
1137
|
-
/**
|
|
1138
|
-
* @description The designer automatically selects the step after it is dropped. If true, the step will not be selected.
|
|
1139
|
-
*/
|
|
1140
|
-
isAutoSelectDisabled?: boolean;
|
|
1141
|
-
iconUrlProvider?: StepIconUrlProvider;
|
|
1142
|
-
}
|
|
1143
|
-
type StepIconUrlProvider = (componentType: ComponentType, type: string) => string | null;
|
|
1144
|
-
interface PlaceholderConfiguration {
|
|
1145
|
-
canCreate?: (sequence: Sequence, index: number, definition: Definition) => boolean;
|
|
1146
|
-
canShow?: (sequence: Sequence, index: number, draggingStepComponentType: ComponentType, draggingStepType: string, definition: Definition) => boolean;
|
|
1147
|
-
}
|
|
1148
|
-
interface ValidatorConfiguration {
|
|
1149
|
-
step?: StepValidator;
|
|
1150
|
-
root?: RootValidator;
|
|
1151
|
-
}
|
|
1152
|
-
type StepValidator = (step: Step, parentSequence: Sequence, definition: Definition) => boolean;
|
|
1153
|
-
type RootValidator = (definition: Definition) => boolean;
|
|
1154
|
-
interface KeyboardConfiguration {
|
|
1155
|
-
canHandleKey?: (action: KeyboardAction, event: KeyboardEvent) => boolean;
|
|
1156
|
-
}
|
|
1157
|
-
declare enum KeyboardAction {
|
|
1158
|
-
delete = "delete"
|
|
1159
|
-
}
|
|
1160
|
-
interface EditorsConfiguration<TDefinition extends Definition = Definition> {
|
|
1161
|
-
isCollapsed?: boolean;
|
|
1162
|
-
stepEditorProvider: StepEditorProvider<TDefinition>;
|
|
1163
|
-
rootEditorProvider: RootEditorProvider<TDefinition>;
|
|
1164
|
-
}
|
|
1165
|
-
interface StepEditorContext {
|
|
1166
|
-
notifyNameChanged(): void;
|
|
1167
|
-
notifyPropertiesChanged(): void;
|
|
1168
|
-
notifyChildrenChanged(): void;
|
|
1169
|
-
}
|
|
1170
|
-
type StepEditorProvider<TDefinition extends Definition = Definition> = (step: Step, context: StepEditorContext, definition: TDefinition, isReadonly: boolean) => HTMLElement;
|
|
1171
|
-
interface RootEditorContext {
|
|
1172
|
-
notifyPropertiesChanged(): void;
|
|
1173
|
-
}
|
|
1174
|
-
type RootEditorProvider<TDefinition extends Definition = Definition> = (definition: TDefinition, context: RootEditorContext, isReadonly: boolean) => HTMLElement;
|
|
1175
|
-
interface UndoStack {
|
|
1176
|
-
index: number;
|
|
1177
|
-
items: UndoStackItem[];
|
|
1178
|
-
}
|
|
1179
|
-
interface UndoStackItem {
|
|
1180
|
-
definition: Definition;
|
|
1181
|
-
changeType: DefinitionChangeType;
|
|
1182
|
-
stepId: string | null;
|
|
1183
|
-
}
|
|
1184
|
-
declare enum DefinitionChangeType {
|
|
1185
|
-
stepNameChanged = 1,
|
|
1186
|
-
stepPropertyChanged = 2,
|
|
1187
|
-
stepChildrenChanged = 3,
|
|
1188
|
-
stepDeleted = 4,
|
|
1189
|
-
stepMoved = 5,
|
|
1190
|
-
stepInserted = 6,
|
|
1191
|
-
rootPropertyChanged = 7,
|
|
1192
|
-
rootReplaced = 8
|
|
1193
|
-
}
|
|
1194
|
-
|
|
1195
|
-
declare class StateModifier {
|
|
1196
|
-
private readonly definitionWalker;
|
|
1197
|
-
private readonly uidGenerator;
|
|
1198
|
-
private readonly state;
|
|
1199
|
-
private readonly configuration;
|
|
1200
|
-
private readonly dependencies;
|
|
1201
|
-
static create(definitionWalker: DefinitionWalker, uidGenerator: UidGenerator, state: DesignerState, configuration: StepsConfiguration): StateModifier;
|
|
1202
|
-
constructor(definitionWalker: DefinitionWalker, uidGenerator: UidGenerator, state: DesignerState, configuration: StepsConfiguration, dependencies: StateModifierDependency[]);
|
|
1203
|
-
addDependency(dependency: StateModifierDependency): void;
|
|
1204
|
-
isSelectable(step: Step, parentSequence: Sequence): boolean;
|
|
1205
|
-
isSelectableById(stepId: string): boolean;
|
|
1206
|
-
private canUnselectSelectedStep;
|
|
1207
|
-
/**
|
|
1208
|
-
* @description Check the `isSelectable` callback before calling this method.
|
|
1209
|
-
*/
|
|
1210
|
-
trySelectStepById(stepIdOrNull: string | null): boolean;
|
|
1211
|
-
tryResetSelectedStep(): void;
|
|
1212
|
-
isDeletable(step: Step, parentSequence: Sequence): boolean;
|
|
1213
|
-
isDeletableById(stepId: string): boolean;
|
|
1214
|
-
/**
|
|
1215
|
-
* @description Check the `isDeletable` callback before calling this method.
|
|
1216
|
-
*/
|
|
1217
|
-
tryDeleteById(stepId: string): boolean;
|
|
1218
|
-
tryInsert(step: Step, targetSequence: Sequence, targetIndex: number): boolean;
|
|
1219
|
-
isDraggable(step: Step, parentSequence: Sequence): boolean;
|
|
1220
|
-
tryMove(sourceSequence: Sequence, step: Step, targetSequence: Sequence, targetIndex: number): boolean;
|
|
1221
|
-
isDuplicable(step: Step, parentSequence: Sequence): boolean;
|
|
1222
|
-
/**
|
|
1223
|
-
* @description Check the `isDuplicable` callback before calling this method.
|
|
1224
|
-
*/
|
|
1225
|
-
tryDuplicate(step: Step, parentSequence: Sequence): boolean;
|
|
1226
|
-
replaceDefinition(definition: Definition): void;
|
|
1227
|
-
updateDependencies(): void;
|
|
1228
|
-
}
|
|
1229
|
-
|
|
1230
|
-
declare class ControlBarApi {
|
|
1231
|
-
private readonly state;
|
|
1232
|
-
private readonly historyController;
|
|
1233
|
-
private readonly stateModifier;
|
|
1234
|
-
static create(state: DesignerState, historyController: HistoryController | undefined, stateModifier: StateModifier): ControlBarApi;
|
|
1235
|
-
private constructor();
|
|
1236
|
-
readonly onStateChanged: SimpleEvent<unknown>;
|
|
1237
|
-
isDragDisabled(): boolean;
|
|
1238
|
-
setIsDragDisabled(isDragDisabled: boolean): void;
|
|
1239
|
-
toggleIsDragDisabled(): void;
|
|
1240
|
-
isUndoRedoSupported(): boolean;
|
|
1241
|
-
tryUndo(): boolean;
|
|
1242
|
-
canUndo(): boolean;
|
|
1243
|
-
tryRedo(): boolean;
|
|
1244
|
-
canRedo(): boolean;
|
|
1245
|
-
tryDelete(): boolean;
|
|
1246
|
-
canDelete(): boolean;
|
|
1247
|
-
}
|
|
1248
|
-
|
|
1249
|
-
declare class DefaultViewportControllerDesignerExtension implements DesignerExtension {
|
|
1250
|
-
readonly viewportController: ViewportControllerExtension;
|
|
1251
|
-
static create(configuration: DefaultViewportControllerExtensionConfiguration): DesignerExtension;
|
|
1252
|
-
private constructor();
|
|
1253
|
-
}
|
|
1254
|
-
|
|
1255
|
-
declare class LineGrid implements Grid {
|
|
1256
|
-
readonly size: Vector;
|
|
1257
|
-
readonly element: SVGPathElement;
|
|
1258
|
-
static create(size: Vector): LineGrid;
|
|
1259
|
-
private constructor();
|
|
1260
|
-
setScale(_: number, scaledSize: Vector): void;
|
|
1261
|
-
}
|
|
1262
|
-
|
|
1263
|
-
declare class LineGridExtension implements GridExtension {
|
|
1264
|
-
private readonly configuration;
|
|
1265
|
-
static create(configuration?: LineGridConfiguration): LineGridExtension;
|
|
1266
|
-
private constructor();
|
|
1267
|
-
create(): LineGrid;
|
|
1268
|
-
}
|
|
1269
|
-
|
|
1270
|
-
declare class LineGridDesignerExtension implements DesignerExtension {
|
|
1271
|
-
readonly grid: LineGridExtension;
|
|
1272
|
-
static create(configuration?: LineGridConfiguration): DesignerExtension;
|
|
1273
|
-
private constructor();
|
|
1274
|
-
}
|
|
1275
|
-
|
|
1276
|
-
declare class RectPlaceholderDesignerExtension implements DesignerExtension {
|
|
1277
|
-
readonly placeholder: PlaceholderExtension;
|
|
1278
|
-
static create(configuration?: RectPlaceholderConfiguration): RectPlaceholderDesignerExtension;
|
|
1279
|
-
private constructor();
|
|
1280
|
-
}
|
|
1281
|
-
|
|
1282
|
-
declare class StartStopRootComponentDesignerExtension implements DesignerExtension {
|
|
1283
|
-
readonly rootComponent: RootComponentExtension;
|
|
1284
|
-
static create(configuration: StartStopRootComponentExtensionConfiguration): DesignerExtension;
|
|
1285
|
-
private constructor();
|
|
1286
|
-
}
|
|
1287
|
-
|
|
1288
|
-
interface StepsDesignerExtensionConfiguration {
|
|
1289
|
-
container?: ContainerStepExtensionConfiguration;
|
|
1290
|
-
switch?: SwitchStepExtensionConfiguration;
|
|
1291
|
-
task?: TaskStepExtensionConfiguration;
|
|
1292
|
-
launchPad?: LaunchPadStepExtensionConfiguration;
|
|
1293
|
-
}
|
|
1294
|
-
declare class StepsDesignerExtension implements DesignerExtension {
|
|
1295
|
-
readonly steps: StepExtension<Step>[];
|
|
1296
|
-
static create(configuration: StepsDesignerExtensionConfiguration): StepsDesignerExtension;
|
|
1297
|
-
protected constructor(steps: StepExtension<Step>[]);
|
|
1298
|
-
}
|
|
1299
|
-
|
|
1300
|
-
declare class Editor {
|
|
1301
|
-
private readonly view;
|
|
1302
|
-
private readonly renderer;
|
|
1303
|
-
static create(parent: HTMLElement, api: EditorApi, stepEditorClassName: string, stepEditorProvider: StepEditorProvider, rootEditorClassName: string, rootEditorProvider: RootEditorProvider, customSelectedStepIdProvider: SelectedStepIdProvider | null): Editor;
|
|
1304
|
-
private constructor();
|
|
1305
|
-
destroy(): void;
|
|
1306
|
-
}
|
|
1307
|
-
|
|
1308
|
-
declare class Designer<TDefinition extends Definition = Definition> {
|
|
1309
|
-
private readonly view;
|
|
1310
|
-
private readonly state;
|
|
1311
|
-
private readonly stateModifier;
|
|
1312
|
-
private readonly walker;
|
|
1313
|
-
private readonly historyController;
|
|
1314
|
-
private readonly api;
|
|
1315
|
-
/**
|
|
1316
|
-
* Creates a designer.
|
|
1317
|
-
* @param placeholder Placeholder where the designer will be attached.
|
|
1318
|
-
* @param startDefinition Start definition of a flow.
|
|
1319
|
-
* @param configuration Designer's configuration.
|
|
1320
|
-
* @returns An instance of the designer.
|
|
1321
|
-
*/
|
|
1322
|
-
static create<TDef extends Definition>(placeholder: HTMLElement, startDefinition: TDef, configuration: DesignerConfiguration<TDef>): Designer<TDef>;
|
|
1323
|
-
private constructor();
|
|
1324
|
-
/**
|
|
1325
|
-
* @description Fires when the designer is initialized and ready to use.
|
|
1326
|
-
*/
|
|
1327
|
-
readonly onReady: SimpleEvent<void>;
|
|
1328
|
-
/**
|
|
1329
|
-
* @description Fires when the definition has changed.
|
|
1330
|
-
*/
|
|
1331
|
-
readonly onDefinitionChanged: SimpleEvent<TDefinition>;
|
|
1332
|
-
/**
|
|
1333
|
-
* @description Fires when the viewport has changed.
|
|
1334
|
-
*/
|
|
1335
|
-
readonly onViewportChanged: SimpleEvent<Viewport>;
|
|
1336
|
-
/**
|
|
1337
|
-
* @description Fires when the selected step has changed.
|
|
1338
|
-
*/
|
|
1339
|
-
readonly onSelectedStepIdChanged: SimpleEvent<string | null>;
|
|
1340
|
-
/**
|
|
1341
|
-
* @description Fires when the designer could not unselect the currently selected step due to restrictions.
|
|
1342
|
-
*/
|
|
1343
|
-
readonly onStepUnselectionBlocked: SimpleEvent<string | null>;
|
|
1344
|
-
/**
|
|
1345
|
-
* @description Fires when the toolbox is collapsed or expanded.
|
|
1346
|
-
*/
|
|
1347
|
-
readonly onIsToolboxCollapsedChanged: SimpleEvent<boolean>;
|
|
1348
|
-
/**
|
|
1349
|
-
* @description Fires when the editor is collapsed or expanded.
|
|
1350
|
-
*/
|
|
1351
|
-
readonly onIsEditorCollapsedChanged: SimpleEvent<boolean>;
|
|
1352
|
-
/**
|
|
1353
|
-
* @returns the current definition of the workflow.
|
|
1354
|
-
*/
|
|
1355
|
-
getDefinition(): TDefinition;
|
|
1356
|
-
/**
|
|
1357
|
-
* @returns the validation result of the current definition.
|
|
1358
|
-
*/
|
|
1359
|
-
isValid(): boolean;
|
|
1360
|
-
/**
|
|
1361
|
-
* @returns the readonly flag.
|
|
1362
|
-
*/
|
|
1363
|
-
isReadonly(): boolean;
|
|
1364
|
-
/**
|
|
1365
|
-
* @description Changes the readonly flag.
|
|
1366
|
-
*/
|
|
1367
|
-
setIsReadonly(isReadonly: boolean): void;
|
|
1368
|
-
/**
|
|
1369
|
-
* @returns current selected step id or `null` if nothing is selected.
|
|
1370
|
-
*/
|
|
1371
|
-
getSelectedStepId(): string | null;
|
|
1372
|
-
/**
|
|
1373
|
-
* @description Selects a step by the id.
|
|
1374
|
-
*/
|
|
1375
|
-
selectStepById(stepId: string): void;
|
|
1376
|
-
/**
|
|
1377
|
-
* @description Unselects the selected step.
|
|
1378
|
-
*/
|
|
1379
|
-
clearSelectedStep(): void;
|
|
1380
|
-
/**
|
|
1381
|
-
* @returns the current viewport.
|
|
1382
|
-
*/
|
|
1383
|
-
getViewport(): Viewport;
|
|
1384
|
-
/**
|
|
1385
|
-
* @description Sets the viewport.
|
|
1386
|
-
* @param viewport Viewport.
|
|
1387
|
-
*/
|
|
1388
|
-
setViewport(viewport: Viewport): void;
|
|
1389
|
-
/**
|
|
1390
|
-
* @description Resets the viewport.
|
|
1391
|
-
*/
|
|
1392
|
-
resetViewport(): void;
|
|
1393
|
-
/**
|
|
1394
|
-
* @description Moves the viewport to the step with the animation.
|
|
1395
|
-
*/
|
|
1396
|
-
moveViewportToStep(stepId: string): void;
|
|
1397
|
-
/**
|
|
1398
|
-
* @description Rerender the root component and all its children.
|
|
1399
|
-
*/
|
|
1400
|
-
updateRootComponent(): void;
|
|
1401
|
-
/**
|
|
1402
|
-
* @description Updates the layout of the designer.
|
|
1403
|
-
*/
|
|
1404
|
-
updateLayout(): void;
|
|
1405
|
-
/**
|
|
1406
|
-
* @description Updates all badges.
|
|
1407
|
-
*/
|
|
1408
|
-
updateBadges(): void;
|
|
1409
|
-
/**
|
|
1410
|
-
* @returns a flag that indicates whether the toolbox is collapsed.
|
|
1411
|
-
*/
|
|
1412
|
-
isToolboxCollapsed(): boolean;
|
|
1413
|
-
/**
|
|
1414
|
-
* @description Sets a flag that indicates whether the toolbox is collapsed.
|
|
1415
|
-
*/
|
|
1416
|
-
setIsToolboxCollapsed(isCollapsed: boolean): void;
|
|
1417
|
-
/**
|
|
1418
|
-
* @returns a flag that indicates whether the editor is collapsed.
|
|
1419
|
-
*/
|
|
1420
|
-
isEditorCollapsed(): boolean;
|
|
1421
|
-
/**
|
|
1422
|
-
* @description Sets a flag that indicates whether the editor is collapsed.
|
|
1423
|
-
*/
|
|
1424
|
-
setIsEditorCollapsed(isCollapsed: boolean): void;
|
|
1425
|
-
/**
|
|
1426
|
-
* @description Dump the undo stack.
|
|
1427
|
-
*/
|
|
1428
|
-
dumpUndoStack(): UndoStack;
|
|
1429
|
-
/**
|
|
1430
|
-
* Replaces the current definition with a new one and adds the previous definition to the undo stack.
|
|
1431
|
-
* @param definition A new definition.
|
|
1432
|
-
*/
|
|
1433
|
-
replaceDefinition(definition: TDefinition): Promise<void>;
|
|
1434
|
-
/**
|
|
1435
|
-
* @param needle A step, a sequence or a step id.
|
|
1436
|
-
* @returns parent steps and branch names.
|
|
1437
|
-
*/
|
|
1438
|
-
getStepParents(needle: Sequence | Step | string): StepOrName[];
|
|
1439
|
-
/**
|
|
1440
|
-
* @returns the definition walker.
|
|
1441
|
-
*/
|
|
1442
|
-
getWalker(): DefinitionWalker;
|
|
1443
|
-
/**
|
|
1444
|
-
* @description Destroys the designer and deletes all nodes from the placeholder.
|
|
1445
|
-
*/
|
|
1446
|
-
destroy(): void;
|
|
1447
|
-
private getHistoryController;
|
|
1448
|
-
}
|
|
1449
|
-
|
|
1450
|
-
export { Badges, CenteredViewportCalculator, ClassicWheelControllerExtension, ClickCommandType, ComponentContext, ComponentDom, ControlBarApi, CustomActionController, DefaultRegionComponentViewExtension, DefaultRegionView, DefaultSequenceComponent, DefaultSequenceComponentView, DefaultViewportController, DefaultViewportControllerDesignerExtension, DefaultViewportControllerExtension, DefinitionChangeType, Designer, DesignerApi, DesignerContext, DesignerState, Dom, Editor, EditorApi, Icons, InputView, JoinView, KeyboardAction, LabelView, LineGridDesignerExtension, ObjectCloner, OutputView, PathBarApi, PlaceholderController, PlaceholderDirection, PlaceholderGapOrientation, RectPlaceholder, RectPlaceholderDesignerExtension, RectPlaceholderView, SelectStepBehaviorEndToken, ServicesResolver, SimpleEvent, StartStopRootComponentDesignerExtension, StartStopRootComponentExtension, StepComponent, StepExtensionResolver, StepsDesignerExtension, TYPE, ToolboxApi, Uid, ValidationErrorBadgeExtension, Vector, ViewportApi, WorkspaceApi, createContainerStepComponentViewFactory, createLaunchPadStepComponentViewFactory, createSwitchStepComponentViewFactory, createTaskStepComponentViewFactory, getAbsolutePosition, race };
|
|
1451
|
-
export type { Attributes, Badge, BadgeExtension, BadgeView, BadgesDecorator, BadgesResult, BaseClickCommand, Behavior, BehaviorEndToken, BranchNamesResolver, ClickBehaviorWrapper, ClickBehaviorWrapperExtension, ClickCommand, ClickDetails, Component, ComponentView, ContainerStepComponentViewConfiguration, ContainerStepExtensionConfiguration, ContextMenuExtension, ContextMenuItem, ContextMenuItemsProvider, CustomAction, CustomActionHandler, CustomActionHandlerContext, Daemon, DaemonExtension, DefaultViewportControllerConfiguration, DefaultViewportControllerExtensionConfiguration, DefinitionChangedEvent, DesignerConfiguration, DesignerExtension, DraggedComponent, DraggedComponentExtension, EditorsConfiguration, FoundPlaceholders, Grid, GridExtension, I18n, KeyboardConfiguration, LaunchPadStepComponentViewConfiguration, LaunchPadStepExtensionConfiguration, LineGridConfiguration, NextScale, OpenFolderClickCommand, Placeholder, PlaceholderConfiguration, PlaceholderExtension, PlaceholderView, PreferenceStorage, RectPlaceholderConfiguration, RegionComponentViewContentFactory, RegionComponentViewExtension, RegionView, RegionViewFactory, RerenderStepClickCommand, RootComponentExtension, RootEditorContext, RootEditorProvider, RootValidator, SelectStepClickCommand, SelectedStepIdProvider, SequenceComponent, SequenceComponentExtension, SequenceContext, SequencePlaceIndicator, Services, SimpleEventListener, StartStopRootComponentExtensionConfiguration, StartStopRootComponentViewConfiguration, StateModifierDependency, StepBadgesDecoratorExtension, StepComponentView, StepComponentViewContext, StepComponentViewFactory, StepComponentViewWrapperExtension, StepContext, StepDefinition, StepDescriptionProvider, StepEditorContext, StepEditorProvider, StepExtension, StepIconUrlProvider, StepLabelProvider, StepValidator, StepsConfiguration, StepsDesignerExtensionConfiguration, SwitchStepComponentViewConfiguration, SwitchStepExtensionConfiguration, TaskStepComponentViewConfiguration, TaskStepExtensionConfiguration, ToolboxConfiguration, ToolboxGroupConfiguration, TriggerCustomActionClickCommand, UiComponent, UiComponentExtension, UidGenerator, UndoStack, UndoStackItem, ValidationErrorBadgeExtensionConfiguration, ValidationErrorBadgeViewConfiguration, ValidatorConfiguration, Viewport, ViewportController, ViewportControllerExtension, WheelController, WheelControllerExtension, WorkspaceRootSequence };
|