update out tsc
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,5 +1,4 @@
|
||||
node_modules/
|
||||
out-tsc/
|
||||
debug.log
|
||||
npm-debug.log
|
||||
src/**/*.js
|
||||
|
||||
52
dist/out-tsc/code-editor/code-editor.component.d.ts
vendored
Normal file
52
dist/out-tsc/code-editor/code-editor.component.d.ts
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
import { ElementRef, OnInit, OnDestroy } from '@angular/core';
|
||||
import { ControlValueAccessor } from '@angular/forms';
|
||||
import 'codemirror-minified/mode/meta';
|
||||
import 'codemirror-minified/addon/lint/lint';
|
||||
import 'codemirror-minified/addon/hint/show-hint';
|
||||
import 'codemirror-minified/addon/edit/matchbrackets';
|
||||
import 'codemirror-minified/addon/edit/closebrackets';
|
||||
import 'codemirror-minified/addon/display/placeholder';
|
||||
import 'codemirror-minified/addon/scroll/annotatescrollbar';
|
||||
import 'codemirror-minified/addon/scroll/simplescrollbars';
|
||||
import 'codemirror-minified/addon/lint/javascript-lint';
|
||||
import 'codemirror-minified/addon/lint/coffeescript-lint';
|
||||
import 'codemirror-minified/addon/lint/json-lint';
|
||||
import 'codemirror-minified/addon/lint/yaml-lint';
|
||||
import 'codemirror-minified/mode/groovy/groovy';
|
||||
import 'codemirror-minified/mode/javascript/javascript';
|
||||
import 'codemirror-minified/mode/python/python';
|
||||
import 'codemirror-minified/mode/ruby/ruby';
|
||||
import 'codemirror-minified/mode/clike/clike';
|
||||
import 'codemirror-minified/mode/yaml/yaml';
|
||||
import 'codemirror-minified/mode/coffeescript/coffeescript';
|
||||
export declare class CodeEditorComponent implements OnInit, OnDestroy, ControlValueAccessor {
|
||||
private element;
|
||||
private doc;
|
||||
private _dsl;
|
||||
private _lint;
|
||||
private _language;
|
||||
private errorRuler;
|
||||
private warningRuler;
|
||||
private _onChangeHandler;
|
||||
private _onTouchHandler;
|
||||
private lineNumbers;
|
||||
private lineWrapping;
|
||||
private scrollbarStyle;
|
||||
private placeholder;
|
||||
private overviewRuler;
|
||||
private dslChange;
|
||||
private focus;
|
||||
private blur;
|
||||
private editor;
|
||||
private _dslChangedHandler;
|
||||
constructor(element: ElementRef);
|
||||
dsl: string;
|
||||
language: string;
|
||||
ngOnInit(): void;
|
||||
private loadEditorMode;
|
||||
ngOnDestroy(): void;
|
||||
writeValue(obj: any): void;
|
||||
registerOnChange(fn: (_: any) => void): void;
|
||||
registerOnTouched(fn: () => void): void;
|
||||
private getLintOptions;
|
||||
}
|
||||
27
dist/out-tsc/directives/resizer.d.ts
vendored
Normal file
27
dist/out-tsc/directives/resizer.d.ts
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
import { EventEmitter, ElementRef, OnInit, OnDestroy } from '@angular/core';
|
||||
export declare class ResizerDirective implements OnInit, OnDestroy {
|
||||
private element;
|
||||
private document;
|
||||
private dragInProgress;
|
||||
private vertical;
|
||||
private first;
|
||||
private second;
|
||||
private _size;
|
||||
private _splitSize;
|
||||
private _subscriptions;
|
||||
maxSplitSize: number;
|
||||
sizeChange: EventEmitter<number>;
|
||||
private mouseMoveHandler;
|
||||
splitSize: number;
|
||||
resizerWidth: number;
|
||||
resizerHeight: number;
|
||||
resizerLeft: string;
|
||||
resizerTop: string;
|
||||
resizerRight: string;
|
||||
resizerBottom: string;
|
||||
constructor(element: ElementRef, document: any);
|
||||
startDrag(): void;
|
||||
private mousemove;
|
||||
ngOnInit(): void;
|
||||
ngOnDestroy(): void;
|
||||
}
|
||||
30
dist/out-tsc/dsl-editor/dsl-editor.component.d.ts
vendored
Normal file
30
dist/out-tsc/dsl-editor/dsl-editor.component.d.ts
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
import { ElementRef, OnInit, OnDestroy } from '@angular/core';
|
||||
import * as CodeMirror from 'codemirror-minified';
|
||||
import 'codemirror-minified/addon/lint/lint';
|
||||
import 'codemirror-minified/addon/hint/show-hint';
|
||||
import 'codemirror-minified/addon/display/placeholder';
|
||||
import 'codemirror-minified/addon/scroll/annotatescrollbar';
|
||||
import 'codemirror-minified/addon/scroll/simplescrollbars';
|
||||
export declare class DslEditorComponent implements OnInit, OnDestroy {
|
||||
private element;
|
||||
private doc;
|
||||
private _dsl;
|
||||
private _lint;
|
||||
private _hint;
|
||||
private lineNumbers;
|
||||
private lineWrapping;
|
||||
private scrollbarStyle;
|
||||
private placeholder;
|
||||
private debounce;
|
||||
private dslChange;
|
||||
private focus;
|
||||
private blur;
|
||||
private editor;
|
||||
private _dslChangedHandler;
|
||||
constructor(element: ElementRef);
|
||||
dsl: string;
|
||||
lintOptions: boolean | CodeMirror.LintOptions;
|
||||
hintOptions: any;
|
||||
ngOnInit(): void;
|
||||
ngOnDestroy(): void;
|
||||
}
|
||||
5
dist/out-tsc/editor/editor-utils.d.ts
vendored
Normal file
5
dist/out-tsc/editor/editor-utils.d.ts
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
import { dia } from 'jointjs';
|
||||
export declare class Utils {
|
||||
static fanRoute(graph: dia.Graph, cell: dia.Cell): void;
|
||||
static isCustomPaperEvent(args: any): boolean;
|
||||
}
|
||||
180
dist/out-tsc/editor/editor.component.d.ts
vendored
Normal file
180
dist/out-tsc/editor/editor.component.d.ts
vendored
Normal file
@@ -0,0 +1,180 @@
|
||||
import { ElementRef, EventEmitter, OnInit, OnDestroy } from '@angular/core';
|
||||
import { dia } from 'jointjs';
|
||||
import { Flo } from '../shared/flo-common';
|
||||
export interface VisibilityState {
|
||||
visibility: string;
|
||||
children: Array<VisibilityState>;
|
||||
}
|
||||
export declare class EditorComponent implements OnInit, OnDestroy {
|
||||
private element;
|
||||
/**
|
||||
* Joint JS Graph object representing the Graph model
|
||||
*/
|
||||
private graph;
|
||||
/**
|
||||
* Joint JS Paper object representing the canvas control containing the graph view
|
||||
*/
|
||||
private paper;
|
||||
/**
|
||||
* Currently selected element
|
||||
*/
|
||||
private _selection;
|
||||
/**
|
||||
* Current DnD descriptor for frag in progress
|
||||
*/
|
||||
private highlighted;
|
||||
/**
|
||||
* Flag specifying whether the Flo-Editor is in read-only mode.
|
||||
*/
|
||||
private _readOnlyCanvas;
|
||||
/**
|
||||
* Grid size
|
||||
*/
|
||||
private _gridSize;
|
||||
private _hiddenPalette;
|
||||
private editorContext;
|
||||
private textToGraphEventEmitter;
|
||||
private graphToTextEventEmitter;
|
||||
private _graphToTextSyncEnabled;
|
||||
private validationEventEmitter;
|
||||
private _disposables;
|
||||
private _dslText;
|
||||
private textToGraphConversionCompleted;
|
||||
private graphToTextConversionCompleted;
|
||||
private paletteReady;
|
||||
/**
|
||||
* Metamodel. Retrieves metadata about elements that can be shown in Flo
|
||||
*/
|
||||
metamodel: Flo.Metamodel;
|
||||
/**
|
||||
* Renders elements.
|
||||
*/
|
||||
renderer: Flo.Renderer;
|
||||
/**
|
||||
* Editor. Provides domain specific editing capabilities on top of standard Flo features
|
||||
*/
|
||||
editor: Flo.Editor;
|
||||
/**
|
||||
* Size (Width) of the palette
|
||||
*/
|
||||
paletteSize: number;
|
||||
/**
|
||||
* Min zoom percent value
|
||||
*/
|
||||
minZoom: number;
|
||||
/**
|
||||
* Max zoom percent value
|
||||
*/
|
||||
maxZoom: number;
|
||||
/**
|
||||
* Zoom percent increment/decrement step
|
||||
*/
|
||||
zoomStep: number;
|
||||
paperPadding: number;
|
||||
floApi: EventEmitter<Flo.EditorContext>;
|
||||
validationMarkers: EventEmitter<Map<string | number, Flo.Marker[]>>;
|
||||
contentValidated: EventEmitter<boolean>;
|
||||
private dslChange;
|
||||
private _resizeHandler;
|
||||
constructor(element: ElementRef);
|
||||
ngOnInit(): void;
|
||||
ngOnDestroy(): void;
|
||||
noPalette: boolean;
|
||||
graphToTextSync: boolean;
|
||||
private performGraphToTextSyncing;
|
||||
createHandle(element: dia.CellView, kind: string, action: () => void, location: dia.Point): dia.Element;
|
||||
removeEmbeddedChildrenOfType(element: dia.Cell, types: Array<string>): void;
|
||||
selection: dia.CellView;
|
||||
readOnlyCanvas: boolean;
|
||||
/**
|
||||
* Displays graphical feedback for the drag and drop in progress based on current drag and drop descriptor object
|
||||
*
|
||||
* @param dragDescriptor DnD info object. Has on info on graph node being dragged (drag source) and what it is
|
||||
* being dragged over at the moment (drop target)
|
||||
*/
|
||||
showDragFeedback(dragDescriptor: Flo.DnDDescriptor): void;
|
||||
/**
|
||||
* Hides graphical feedback for the drag and drop in progress based on current drag and drop descriptor object
|
||||
*
|
||||
* @param dragDescriptor DnD info object. Has on info on graph node being dragged (drag source) and what it is
|
||||
* being dragged over at the moment (drop target)
|
||||
*/
|
||||
hideDragFeedback(dragDescriptor: Flo.DnDDescriptor): void;
|
||||
/**
|
||||
* Sets the new DnD info object - the descriptor for DnD
|
||||
*
|
||||
* @param dragDescriptor DnD info object. Has on info on graph node being dragged (drag source) and what it is
|
||||
* being dragged over at the moment (drop target)
|
||||
*/
|
||||
setDragDescriptor(dragDescriptor?: Flo.DnDDescriptor): void;
|
||||
/**
|
||||
* Handles DnD events when a node is being dragged over canvas
|
||||
*
|
||||
* @param draggedView The Joint JS view object being dragged
|
||||
* @param targetUnderMouse The Joint JS view under mouse cursor
|
||||
* @param x X coordinate of the mouse on the canvas
|
||||
* @param y Y coordinate of the mosue on the canvas
|
||||
* @param context DnD context (palette or canvas)
|
||||
*/
|
||||
handleNodeDragging(draggedView: dia.CellView, targetUnderMouse: dia.CellView, x: number, y: number, sourceComponent: string): void;
|
||||
/**
|
||||
* Handles DnD drop event when a node is being dragged and dropped on the main canvas
|
||||
*/
|
||||
handleNodeDropping(): void;
|
||||
/**
|
||||
* Hides DOM Node (used to determine drop target DOM element)
|
||||
* @param domNode DOM node to hide
|
||||
* @returns
|
||||
*/
|
||||
private _hideNode;
|
||||
/**
|
||||
* Restored DOM node original visibility (used to determine drop target DOM element)
|
||||
* @param domNode DOM node to restore visibility of
|
||||
* @param oldVisibility original visibility parameter
|
||||
*/
|
||||
_restoreNodeVisibility(domNode: HTMLElement, oldVisibility: VisibilityState): void;
|
||||
/**
|
||||
* Unfortunately we can't just use event.target because often draggable shape on the canvas overlaps the target.
|
||||
* We can easily find the element(s) at location, but only nodes :-( Unclear how to find links at location
|
||||
* (bounding box of a link for testing is bad).
|
||||
* The result of that is that links can only be the drop target when dragging from the palette currently.
|
||||
* When DnDing shapes on the canvas drop target cannot be a link.
|
||||
*
|
||||
* Excluded views enables you to choose to filter some possible answers (useful in the case where elements are stacked
|
||||
* - e.g. Drag-n-Drop)
|
||||
*/
|
||||
getTargetViewFromEvent(event: MouseEvent, x: number, y: number, excludeViews?: Array<dia.CellView>): dia.CellView;
|
||||
handleDnDFromPalette(dndEvent: Flo.DnDEvent): void;
|
||||
handleDragFromPalette(dnDEvent: Flo.DnDEvent): void;
|
||||
createNode(metadata: Flo.ElementMetadata, props: Map<string, any>, position: dia.Point): dia.Element;
|
||||
createLink(source: Flo.LinkEnd, target: Flo.LinkEnd, metadata: Flo.ElementMetadata, props: Map<string, any>): dia.Link;
|
||||
handleDropFromPalette(event: Flo.DnDEvent): void;
|
||||
private fitToContent;
|
||||
autosizePaper(): void;
|
||||
fitToPage(): void;
|
||||
zoomPercent: number;
|
||||
gridSize: number;
|
||||
validateContent(): Promise<any>;
|
||||
markElement(cell: dia.Cell, markers: Array<Flo.Marker>): void;
|
||||
doLayout(): Promise<void>;
|
||||
dsl: string;
|
||||
/**
|
||||
* Ask the server to parse the supplied text into a JSON graph of nodes and links,
|
||||
* then update the view based on that new information.
|
||||
*/
|
||||
updateGraphRepresentation(): Promise<any>;
|
||||
updateTextRepresentation(): Promise<any>;
|
||||
initMetamodel(): void;
|
||||
initGraph(): void;
|
||||
handleNodeCreation(node: dia.Element): void;
|
||||
/**
|
||||
* Forwards a link event occurrence to any handlers in the editor service, if they are defined. Event examples
|
||||
* are 'change:source', 'change:target'.
|
||||
*/
|
||||
handleLinkEvent(event: string, link: dia.Link): void;
|
||||
handleLinkCreation(link: dia.Link): void;
|
||||
initGraphListeners(): void;
|
||||
initPaperListeners(): void;
|
||||
initPaper(): void;
|
||||
updatePaletteReadyState(ready: boolean): void;
|
||||
}
|
||||
11
dist/out-tsc/index.d.ts
vendored
Normal file
11
dist/out-tsc/index.d.ts
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
export { FloModule } from './module';
|
||||
export { Palette } from './palette/palette.component';
|
||||
export { EditorComponent } from './editor/editor.component';
|
||||
export { DslEditorComponent } from './dsl-editor/dsl-editor.component';
|
||||
export { CodeEditorComponent } from './code-editor/code-editor.component';
|
||||
export { PropertiesGroupComponent } from './properties/properties.group.component';
|
||||
export { DynamicFormPropertyComponent } from './properties/df.property.component';
|
||||
export { ResizerDirective } from './directives/resizer';
|
||||
export * from './shared/flo-common';
|
||||
export * from './shared/flo-properties';
|
||||
export * from './shared/shapes';
|
||||
2
dist/out-tsc/module.d.ts
vendored
Normal file
2
dist/out-tsc/module.d.ts
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
export declare class FloModule {
|
||||
}
|
||||
51
dist/out-tsc/palette/palette.component.d.ts
vendored
Normal file
51
dist/out-tsc/palette/palette.component.d.ts
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
import { ElementRef, EventEmitter, OnInit, OnDestroy, OnChanges, SimpleChanges } from '@angular/core';
|
||||
import { dia } from 'jointjs';
|
||||
import { Flo } from '../shared/flo-common';
|
||||
export declare class Palette implements OnInit, OnDestroy, OnChanges {
|
||||
private element;
|
||||
private document;
|
||||
private _metamodelListener;
|
||||
/**
|
||||
* The names of any groups in the palette that have been deliberately closed (the arrow clicked on)
|
||||
*/
|
||||
private closedGroups;
|
||||
/**
|
||||
* Model of the clicked element
|
||||
*/
|
||||
private clickedElement;
|
||||
private viewBeingDragged;
|
||||
private initialized;
|
||||
private _paletteSize;
|
||||
private _filterText;
|
||||
private paletteGraph;
|
||||
private palette;
|
||||
private floaterpaper;
|
||||
private filterTextModel;
|
||||
metamodel: Flo.Metamodel;
|
||||
renderer: Flo.Renderer;
|
||||
paletteEntryPadding: dia.Size;
|
||||
onPaletteEntryDrop: EventEmitter<Flo.DnDEvent>;
|
||||
paletteReady: EventEmitter<boolean>;
|
||||
paletteFocus: EventEmitter<void>;
|
||||
private mouseMoveHanlder;
|
||||
private mouseUpHanlder;
|
||||
paletteSize: number;
|
||||
constructor(element: ElementRef, document: any);
|
||||
onFocus(): void;
|
||||
ngOnInit(): void;
|
||||
ngOnDestroy(): void;
|
||||
ngOnChanges(changes: SimpleChanges): void;
|
||||
private createPaletteGroup;
|
||||
private createPaletteEntry;
|
||||
private buildPalette;
|
||||
rebuildPalette(): void;
|
||||
filterText: string;
|
||||
private getPaletteView;
|
||||
private handleMouseUp;
|
||||
private trigger;
|
||||
private handleDrag;
|
||||
private rotateOpen;
|
||||
private doRotateOpen;
|
||||
private doRotateClose;
|
||||
private rotateClosed;
|
||||
}
|
||||
10
dist/out-tsc/properties/df.property.component.d.ts
vendored
Normal file
10
dist/out-tsc/properties/df.property.component.d.ts
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import { FormGroup, AbstractControl } from '@angular/forms';
|
||||
import { Properties } from '../shared/flo-properties';
|
||||
export declare class DynamicFormPropertyComponent {
|
||||
model: Properties.ControlModel<any>;
|
||||
form: FormGroup;
|
||||
constructor();
|
||||
readonly types: typeof Properties.InputType;
|
||||
readonly control: AbstractControl;
|
||||
readonly errorData: Properties.ErrorData[];
|
||||
}
|
||||
9
dist/out-tsc/properties/properties.group.component.d.ts
vendored
Normal file
9
dist/out-tsc/properties/properties.group.component.d.ts
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
import { OnInit } from '@angular/core';
|
||||
import { FormGroup } from '@angular/forms';
|
||||
import { Properties } from '../shared/flo-properties';
|
||||
export declare class PropertiesGroupComponent implements OnInit {
|
||||
propertiesGroupModel: Properties.PropertiesGroupModel;
|
||||
form: FormGroup;
|
||||
ngOnInit(): void;
|
||||
createGroupControls(): void;
|
||||
}
|
||||
179
dist/out-tsc/shared/flo-common.d.ts
vendored
Normal file
179
dist/out-tsc/shared/flo-common.d.ts
vendored
Normal file
@@ -0,0 +1,179 @@
|
||||
import { dia, g } from 'jointjs';
|
||||
import { Observable } from 'rxjs';
|
||||
export declare namespace Flo {
|
||||
const joint: any;
|
||||
enum DnDEventType {
|
||||
DRAG = 0,
|
||||
DROP = 1
|
||||
}
|
||||
interface DnDEvent {
|
||||
type: DnDEventType;
|
||||
view: dia.CellView;
|
||||
event: MouseEvent;
|
||||
}
|
||||
interface PropertyMetadata {
|
||||
readonly id: string;
|
||||
readonly name: string;
|
||||
readonly description?: string;
|
||||
readonly defaultValue?: any;
|
||||
readonly type?: string;
|
||||
readonly [propName: string]: any;
|
||||
}
|
||||
interface ExtraMetadata {
|
||||
readonly titleProperty?: string;
|
||||
readonly noEditableProps?: boolean;
|
||||
readonly noPaletteEntry?: boolean;
|
||||
readonly unselectable?: boolean;
|
||||
readonly [propName: string]: any;
|
||||
readonly allowAdditionalProperties?: boolean;
|
||||
}
|
||||
interface ElementMetadata {
|
||||
readonly name: string;
|
||||
readonly group: string;
|
||||
readonly metadata?: ExtraMetadata;
|
||||
readonly [propName: string]: any;
|
||||
description?(): Promise<string>;
|
||||
get(property: String): Promise<PropertyMetadata>;
|
||||
properties(): Promise<Map<string, PropertyMetadata>>;
|
||||
}
|
||||
interface ViewerDescriptor {
|
||||
readonly graph?: dia.Graph;
|
||||
readonly paper?: dia.Paper;
|
||||
}
|
||||
interface MetamodelListener {
|
||||
metadataError(data: any): void;
|
||||
metadataAboutToChange(): void;
|
||||
metadataChanged(): void;
|
||||
}
|
||||
interface Metamodel {
|
||||
textToGraph(flo: EditorContext, dsl: string): Promise<any>;
|
||||
graphToText(flo: EditorContext): Promise<string>;
|
||||
load(): Promise<Map<string, Map<string, ElementMetadata>>>;
|
||||
groups(): Array<string>;
|
||||
refresh?(): Promise<Map<string, Map<string, ElementMetadata>>>;
|
||||
subscribe?(listener: MetamodelListener): void;
|
||||
unsubscribe?(listener: MetamodelListener): void;
|
||||
isValidPropertyValue?(element: dia.Element, property: string, value: any): boolean;
|
||||
}
|
||||
interface CreationParams {
|
||||
metadata?: ElementMetadata;
|
||||
props?: Map<string, any>;
|
||||
}
|
||||
interface ElementCreationParams extends CreationParams {
|
||||
position?: dia.Point;
|
||||
}
|
||||
interface LinkCreationParams extends CreationParams {
|
||||
source: string;
|
||||
target: string;
|
||||
}
|
||||
interface EmbeddedChildCreationParams extends CreationParams {
|
||||
parent: dia.Cell;
|
||||
position?: dia.Point;
|
||||
}
|
||||
interface DecorationCreationParams extends EmbeddedChildCreationParams {
|
||||
kind: string;
|
||||
messages: Array<string>;
|
||||
}
|
||||
interface HandleCreationParams extends EmbeddedChildCreationParams {
|
||||
kind: string;
|
||||
}
|
||||
interface Renderer {
|
||||
createNode?(metadata: ElementMetadata, props?: Map<string, any>): dia.Element;
|
||||
createLink?(source: LinkEnd, target: LinkEnd, metadata?: ElementMetadata, props?: Map<string, any>): dia.Link;
|
||||
createHandle?(kind: string, parent: dia.Cell): dia.Element;
|
||||
createDecoration?(kind: string, parent: dia.Cell): dia.Element;
|
||||
initializeNewNode?(node: dia.Element, viewerDescriptor: ViewerDescriptor): void;
|
||||
initializeNewLink?(link: dia.Link, viewerDescriptor: ViewerDescriptor): void;
|
||||
initializeNewHandle?(handle: dia.Element, viewerDescriptor: ViewerDescriptor): void;
|
||||
initializeNewDecoration?(decoration: dia.Element, viewerDescriptor: ViewerDescriptor): void;
|
||||
getNodeView?(): dia.ElementView;
|
||||
getLinkView?(): dia.LinkView;
|
||||
layout?(paper: dia.Paper): Promise<any>;
|
||||
handleLinkEvent?(context: EditorContext, event: string, link: dia.Link): void;
|
||||
isSemanticProperty?(propertyPath: string, element: dia.Cell): boolean;
|
||||
refreshVisuals?(cell: dia.Cell, propertyPath: string, paper: dia.Paper): void;
|
||||
getLinkAnchorPoint?(linkView: dia.LinkView, view: dia.ElementView, port: SVGElement, reference: dia.Point): dia.Point;
|
||||
}
|
||||
interface EditorContext {
|
||||
readonly textToGraphConversionObservable: Observable<void>;
|
||||
readonly graphToTextConversionObservable: Observable<void>;
|
||||
readonly paletteReady: Observable<boolean>;
|
||||
zoomPercent: number;
|
||||
gridSize: number;
|
||||
readOnlyCanvas: boolean;
|
||||
selection: dia.CellView;
|
||||
graphToTextSync: boolean;
|
||||
noPalette: boolean;
|
||||
setDsl(dsl: string): void;
|
||||
updateGraph(): Promise<any>;
|
||||
updateText(): Promise<any>;
|
||||
performLayout(): Promise<void>;
|
||||
clearGraph(): Promise<void>;
|
||||
getGraph(): dia.Graph;
|
||||
getPaper(): dia.Paper;
|
||||
getMinZoom(): number;
|
||||
getMaxZoom(): number;
|
||||
getZoomStep(): number;
|
||||
fitToPage(): void;
|
||||
createNode(metadata: ElementMetadata, props?: Map<string, any>, position?: dia.Point): dia.Element;
|
||||
createLink(source: LinkEnd, target: LinkEnd, metadata?: ElementMetadata, props?: Map<string, any>): dia.Link;
|
||||
deleteSelectedNode(): void;
|
||||
[propName: string]: any;
|
||||
}
|
||||
interface LinkEndDescriptor {
|
||||
view: dia.CellView;
|
||||
cssClassSelector?: string;
|
||||
}
|
||||
interface DnDDescriptor {
|
||||
sourceComponent?: string;
|
||||
range?: number;
|
||||
source?: LinkEndDescriptor;
|
||||
target?: LinkEndDescriptor;
|
||||
}
|
||||
interface LinkEnd {
|
||||
id: string | number;
|
||||
selector?: string;
|
||||
port?: string;
|
||||
}
|
||||
enum Severity {
|
||||
Error = 0,
|
||||
Warning = 1
|
||||
}
|
||||
interface Marker {
|
||||
severity: Severity;
|
||||
message: string;
|
||||
range?: Range;
|
||||
}
|
||||
interface Position {
|
||||
ch: number;
|
||||
line: number;
|
||||
}
|
||||
interface Range {
|
||||
start: Position;
|
||||
end: Position;
|
||||
}
|
||||
interface Editor {
|
||||
interactive?: ((cellView: dia.CellView, event: string) => boolean) | boolean | dia.CellView.InteractivityOptions;
|
||||
allowLinkVertexEdit?: boolean;
|
||||
highlighting?: any;
|
||||
createHandles?(context: EditorContext, createHandle: (owner: dia.CellView, kind: string, action: () => void, location: dia.Point) => void, owner: dia.CellView): void;
|
||||
validatePort?(context: EditorContext, view: dia.CellView, magnet: SVGElement): boolean;
|
||||
validateLink?(context: EditorContext, cellViewS: dia.CellView, portS: SVGElement, cellViewT: dia.CellView, portT: SVGElement, isSource: boolean, linkView: dia.LinkView): boolean;
|
||||
calculateDragDescriptor?(context: EditorContext, draggedView: dia.CellView, targetUnderMouse: dia.CellView, coordinate: g.Point, sourceComponent: string): DnDDescriptor;
|
||||
handleNodeDropping?(context: EditorContext, dragDescriptor: DnDDescriptor): void;
|
||||
showDragFeedback?(context: EditorContext, dragDescriptor: DnDDescriptor): void;
|
||||
hideDragFeedback?(context: EditorContext, dragDescriptor: DnDDescriptor): void;
|
||||
validate?(graph: dia.Graph, dsl: string, flo: EditorContext): Promise<Map<string | number, Array<Marker>>>;
|
||||
preDelete?(context: EditorContext, deletedElement: dia.Cell): void;
|
||||
setDefaultContent?(editorContext: EditorContext, data: Map<string, Map<string, ElementMetadata>>): void;
|
||||
}
|
||||
function findMagnetByClass(view: dia.CellView, className: string): SVGElement | undefined;
|
||||
function findMagnetByPort(view: dia.CellView, port: string): SVGElement | undefined;
|
||||
/**
|
||||
* Return the metadata for a particular palette entry in a particular group.
|
||||
* @param name - name of the palette entry
|
||||
* @param group - group in which the palette entry should exist (e.g. sinks)
|
||||
* @return
|
||||
*/
|
||||
function getMetadata(metamodel: Map<string, Map<string, ElementMetadata>>, name: string, group: string): ElementMetadata | undefined;
|
||||
}
|
||||
125
dist/out-tsc/shared/flo-properties.d.ts
vendored
Normal file
125
dist/out-tsc/shared/flo-properties.d.ts
vendored
Normal file
@@ -0,0 +1,125 @@
|
||||
import { dia } from 'jointjs';
|
||||
import { ValidatorFn, AsyncValidatorFn } from '@angular/forms';
|
||||
import { Flo } from './flo-common';
|
||||
import { Subject, Observable } from 'rxjs';
|
||||
export declare namespace Properties {
|
||||
enum InputType {
|
||||
TEXT = 0,
|
||||
NUMBER = 1,
|
||||
SELECT = 2,
|
||||
CHECKBOX = 3,
|
||||
PASSWORD = 4,
|
||||
EMAIL = 5,
|
||||
URL = 6,
|
||||
CODE = 7
|
||||
}
|
||||
interface Property {
|
||||
readonly id: string;
|
||||
readonly name: string;
|
||||
readonly type?: string;
|
||||
readonly description?: string;
|
||||
readonly defaultValue?: any;
|
||||
value?: any;
|
||||
readonly valueOptions?: any[];
|
||||
readonly [propName: string]: any;
|
||||
}
|
||||
interface SelectOption {
|
||||
name: string;
|
||||
value: any;
|
||||
}
|
||||
interface ErrorData {
|
||||
id: string;
|
||||
message: string;
|
||||
}
|
||||
interface Validation {
|
||||
validator?: ValidatorFn | ValidatorFn[] | null;
|
||||
asyncValidator?: AsyncValidatorFn | AsyncValidatorFn[] | null;
|
||||
errorData?: Array<ErrorData>;
|
||||
}
|
||||
interface ControlModel<T> {
|
||||
readonly type: InputType;
|
||||
readonly id: string;
|
||||
value: T;
|
||||
readonly defaultValue: T;
|
||||
readonly name?: string;
|
||||
readonly description?: string;
|
||||
readonly property: Property;
|
||||
readonly validation?: Validation;
|
||||
}
|
||||
interface CodeControlModel<T> extends ControlModel<T> {
|
||||
readonly language: string;
|
||||
}
|
||||
class GenericControlModel<T> implements ControlModel<T> {
|
||||
private _property;
|
||||
type: InputType;
|
||||
validation?: Validation;
|
||||
constructor(_property: Property, type: InputType, validation?: Validation);
|
||||
readonly id: string;
|
||||
readonly name: string;
|
||||
readonly description: string;
|
||||
readonly defaultValue: any;
|
||||
value: T;
|
||||
readonly property: Property;
|
||||
protected setValue(value: T): void;
|
||||
protected getValue(): T;
|
||||
}
|
||||
class CheckBoxControlModel extends GenericControlModel<boolean> {
|
||||
constructor(_property: Property, validation?: Validation);
|
||||
protected getValue(): any;
|
||||
}
|
||||
abstract class AbstractCodeControlModel extends GenericControlModel<string> implements CodeControlModel<string> {
|
||||
private encode?;
|
||||
private decode?;
|
||||
abstract language: string;
|
||||
constructor(_property: Property, encode?: (s: string) => string, decode?: (s: string) => string, validation?: Validation);
|
||||
value: string;
|
||||
}
|
||||
class GenericCodeControlModel extends AbstractCodeControlModel {
|
||||
language: string;
|
||||
constructor(_property: Property, language: string, encode?: (s: string) => string, decode?: (s: string) => string, validation?: Validation);
|
||||
}
|
||||
class CodeControlModelWithDynamicLanguageProperty extends AbstractCodeControlModel {
|
||||
private _languagePropertyName;
|
||||
private _groupModel;
|
||||
private _langControlModel;
|
||||
constructor(_property: Properties.Property, _languagePropertyName: string, _groupModel: Properties.PropertiesGroupModel, encode?: (s: string) => string, decode?: (s: string) => string, validation?: Validation);
|
||||
readonly language: string;
|
||||
readonly languageControlModel: Properties.ControlModel<any>;
|
||||
}
|
||||
class GenericListControlModel extends GenericControlModel<string> {
|
||||
constructor(property: Property, validation?: Validation);
|
||||
value: string;
|
||||
}
|
||||
class SelectControlModel extends GenericControlModel<any> {
|
||||
options: Array<SelectOption>;
|
||||
constructor(_property: Property, type: InputType, options: Array<SelectOption>);
|
||||
}
|
||||
interface PropertiesSource {
|
||||
getProperties(): Promise<Property[]>;
|
||||
applyChanges(properties: Property[]): void;
|
||||
}
|
||||
class DefaultCellPropertiesSource implements PropertiesSource {
|
||||
protected cell: dia.Cell;
|
||||
constructor(cell: dia.Cell);
|
||||
getProperties(): Promise<Array<Property>>;
|
||||
protected createProperty(metadata: Flo.PropertyMetadata): Property;
|
||||
applyChanges(properties: Property[]): void;
|
||||
}
|
||||
class PropertiesGroupModel {
|
||||
protected propertiesSource: PropertiesSource;
|
||||
protected controlModels: Array<ControlModel<any>>;
|
||||
protected loading: boolean;
|
||||
protected _loadedSubject: Subject<boolean>;
|
||||
constructor(propertiesSource: PropertiesSource);
|
||||
load(): void;
|
||||
readonly isLoading: boolean;
|
||||
readonly loadedSubject: Subject<boolean>;
|
||||
getControlsModels(): ControlModel<any>[];
|
||||
protected createControlModel(property: Property): ControlModel<any>;
|
||||
applyChanges(): void;
|
||||
}
|
||||
namespace Validators {
|
||||
function uniqueResource(service: (value: any) => Observable<any>, debounce: number): AsyncValidatorFn;
|
||||
function noneOf(excluded: Array<any>): ValidatorFn;
|
||||
}
|
||||
}
|
||||
48
dist/out-tsc/shared/shapes.d.ts
vendored
Normal file
48
dist/out-tsc/shared/shapes.d.ts
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
import { dia } from 'jointjs';
|
||||
import { Flo } from './flo-common';
|
||||
export declare namespace Constants {
|
||||
const REMOVE_HANDLE_TYPE = "remove";
|
||||
const PROPERTIES_HANDLE_TYPE = "properties";
|
||||
const ERROR_DECORATION_KIND = "error";
|
||||
const PALETTE_CONTEXT = "palette";
|
||||
const CANVAS_CONTEXT = "canvas";
|
||||
const FEEDBACK_CONTEXT = "feedback";
|
||||
}
|
||||
export declare namespace Shapes {
|
||||
interface CreationParams extends Flo.CreationParams {
|
||||
renderer?: Flo.Renderer;
|
||||
paper?: dia.Paper;
|
||||
graph?: dia.Graph;
|
||||
}
|
||||
interface ElementCreationParams extends CreationParams {
|
||||
position?: dia.Point;
|
||||
}
|
||||
interface LinkCreationParams extends CreationParams {
|
||||
source: Flo.LinkEnd;
|
||||
target: Flo.LinkEnd;
|
||||
}
|
||||
interface EmbeddedChildCreationParams extends CreationParams {
|
||||
parent: dia.Cell;
|
||||
position?: dia.Point;
|
||||
}
|
||||
interface DecorationCreationParams extends EmbeddedChildCreationParams {
|
||||
kind: string;
|
||||
messages: Array<string>;
|
||||
}
|
||||
interface HandleCreationParams extends EmbeddedChildCreationParams {
|
||||
kind: string;
|
||||
}
|
||||
interface FilterOptions {
|
||||
amount: number;
|
||||
[propName: string]: any;
|
||||
}
|
||||
class Factory {
|
||||
/**
|
||||
* Create a JointJS node that embeds extra metadata (properties).
|
||||
*/
|
||||
static createNode(params: ElementCreationParams): dia.Element;
|
||||
static createLink(params: LinkCreationParams): dia.Link;
|
||||
static createDecoration(params: DecorationCreationParams): dia.Element;
|
||||
static createHandle(params: HandleCreationParams): dia.Element;
|
||||
}
|
||||
}
|
||||
4
dist/out-tsc/spring-flo.d.ts
vendored
Normal file
4
dist/out-tsc/spring-flo.d.ts
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
/**
|
||||
* Generated bundle index. Do not edit.
|
||||
*/
|
||||
export * from './index';
|
||||
1
dist/out-tsc/spring-flo.metadata.json
vendored
Normal file
1
dist/out-tsc/spring-flo.metadata.json
vendored
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user