@jsplumb/community
Advanced tools
Comparing version 4.0.0-RC2 to 4.0.0-RC20
import { Endpoint } from "./endpoint/endpoint-impl"; | ||
import { Dictionary, ExtendedOffset, jsPlumbInstance, Offset } from "./core"; | ||
import { Connection } from "./connector/connection-impl"; | ||
import { ComputedAnchorPosition, Face, Orientation } from "./factory/anchor-factory"; | ||
import { Face, Orientation } from "./factory/anchor-factory"; | ||
import { ContinuousAnchor, ContinuousAnchorOptions } from "./anchor/continuous-anchor"; | ||
export declare type AnchorPlacement = [number, number, number, number]; | ||
export declare type ContinuousAnchorPlacement = [number, number, number, number, Connection, Connection]; | ||
export declare type AnchorFace = "top" | "right" | "bottom" | "left"; | ||
export declare class ContinuousAnchorFactory { | ||
private continuousAnchorLocations; | ||
clear(endpointId: string): void; | ||
set(endpointId: string, pos: ComputedAnchorPosition): void; | ||
set(endpointId: string, pos: AnchorPlacement): void; | ||
get(instance: jsPlumbInstance, params?: ContinuousAnchorOptions): ContinuousAnchor; | ||
@@ -34,3 +37,3 @@ } | ||
connectionDetached(connection: Connection): void; | ||
add(endpoint: Endpoint, elementId: string): void; | ||
addEndpoint(endpoint: Endpoint, elementId: string): void; | ||
changeId(oldId: string, newId: string): void; | ||
@@ -37,0 +40,0 @@ deleteEndpoint(endpoint: Endpoint): void; |
import { jsPlumbInstance, Offset, PointArray } from "../core"; | ||
import { EventGenerator } from "../event-generator"; | ||
import { Endpoint } from "../endpoint/endpoint-impl"; | ||
import { AnchorComputeParams, AnchorId, AnchorOptions, AnchorOrientationHint, ComputedAnchorPosition, Orientation } from "../factory/anchor-factory"; | ||
import { AnchorComputeParams, AnchorId, AnchorOptions, AnchorOrientationHint, Orientation } from "../factory/anchor-factory"; | ||
import { AnchorPlacement } from "../anchor-manager"; | ||
export declare class Anchor extends EventGenerator { | ||
@@ -20,3 +21,3 @@ instance: jsPlumbInstance; | ||
timestamp: string; | ||
lastReturnValue: ComputedAnchorPosition; | ||
lastReturnValue: AnchorPlacement; | ||
positionFinder: (dropPosition: Offset, elPosition: Offset, elSize: PointArray, constructorParams: any) => any; | ||
@@ -27,5 +28,5 @@ clone: () => Anchor; | ||
getOrientation(endpoint?: Endpoint): Orientation; | ||
getCurrentLocation(params: AnchorComputeParams): ComputedAnchorPosition; | ||
getCurrentLocation(params: AnchorComputeParams): AnchorPlacement; | ||
setPosition(x: number, y: number, ox: AnchorOrientationHint, oy: AnchorOrientationHint, overrideLock?: boolean): void; | ||
compute(params: AnchorComputeParams): ComputedAnchorPosition; | ||
compute(params: AnchorComputeParams): AnchorPlacement; | ||
equals(anchor: Anchor): boolean; | ||
@@ -32,0 +33,0 @@ getCssClass(): string; |
@@ -5,2 +5,3 @@ import { AnchorId, Face, Orientation, AnchorOptions, AnchorComputeParams } from "../factory/anchor-factory"; | ||
import { Endpoint } from "../endpoint/endpoint-impl"; | ||
import { AnchorPlacement } from "../anchor-manager"; | ||
export interface ContinuousAnchorOptions extends AnchorOptions { | ||
@@ -13,2 +14,3 @@ faces?: Array<Face>; | ||
instance: jsPlumbInstance; | ||
static continuousAnchorType: AnchorId; | ||
type: AnchorId; | ||
@@ -37,6 +39,6 @@ isDynamic: boolean; | ||
unlockCurrentAxis(): void; | ||
compute(params: AnchorComputeParams): [number, number, number, number]; | ||
getCurrentLocation(params: AnchorComputeParams): [number, number, number, number]; | ||
compute(params: AnchorComputeParams): AnchorPlacement; | ||
getCurrentLocation(params: AnchorComputeParams): AnchorPlacement; | ||
getOrientation(endpoint?: Endpoint): Orientation; | ||
getCssClass(): string; | ||
} |
import { Anchor } from "./anchor"; | ||
import { AnchorComputeParams, AnchorOptions, ComputedAnchorPosition, Orientation } from "../factory/anchor-factory"; | ||
import { AnchorComputeParams, AnchorOptions, Orientation } from "../factory/anchor-factory"; | ||
import { jsPlumbInstance, PointArray } from "../core"; | ||
import { Endpoint } from "../endpoint/endpoint-impl"; | ||
import { AnchorPlacement } from "../anchor-manager"; | ||
export interface DynamicAnchorOptions extends AnchorOptions { | ||
@@ -18,4 +19,4 @@ selector?: (xy: PointArray, wh: PointArray, txy: PointArray, twh: PointArray, anchors: Array<Anchor>) => Anchor; | ||
getAnchors(): Array<Anchor>; | ||
compute(params: AnchorComputeParams): ComputedAnchorPosition; | ||
getCurrentLocation(params: AnchorComputeParams): ComputedAnchorPosition; | ||
compute(params: AnchorComputeParams): AnchorPlacement; | ||
getCurrentLocation(params: AnchorComputeParams): AnchorPlacement; | ||
getOrientation(_endpoint?: Endpoint): Orientation; | ||
@@ -22,0 +23,0 @@ over(anchor: Anchor, endpoint: Endpoint): void; |
/** | ||
* jsBezier | ||
* | ||
* Copyright (c) 2010 - 2017 jsPlumb (hello@jsplumbtoolkit.com) | ||
* Copyright (c) 2010 - 2020 jsPlumb (hello@jsplumbtoolkit.com) | ||
* | ||
@@ -6,0 +6,0 @@ * licensed under the MIT license. |
@@ -26,3 +26,2 @@ import { PaintStyle } from "../styles"; | ||
params?: any; | ||
lastPaintedAt?: string; | ||
directed?: boolean; | ||
@@ -43,5 +42,3 @@ cost?: number; | ||
endpointHoverStyles?: [PaintStyle, PaintStyle]; | ||
enabled?: boolean; | ||
currentAnchorClass?: string; | ||
uuid?: string; | ||
floatingEndpoint?: Endpoint; | ||
@@ -62,3 +59,3 @@ events?: any; | ||
}; | ||
export interface ComponentOptions { | ||
export interface ComponentOptions extends Record<string, any> { | ||
_jsPlumb?: jsPlumbInstance; | ||
@@ -92,2 +89,3 @@ parameters?: any; | ||
paintStyleInUse: PaintStyle; | ||
lastPaintedAt: string; | ||
data: any; | ||
@@ -94,0 +92,0 @@ _defaultType: any; |
@@ -9,2 +9,3 @@ import { Component, ComponentOptions } from "./component"; | ||
} | ||
export declare type ClassAction = "add" | "remove"; | ||
export declare abstract class OverlayCapableComponent extends Component { | ||
@@ -15,2 +16,8 @@ instance: jsPlumbInstance; | ||
overlayPositions: Dictionary<PointArray>; | ||
overlayPlacements: Dictionary<{ | ||
minX: number; | ||
maxX: number; | ||
minY: number; | ||
maxY: number; | ||
}>; | ||
constructor(instance: jsPlumbInstance, params: OverlayComponentOptions); | ||
@@ -17,0 +24,0 @@ addOverlay(overlay: OverlaySpec, doNotRepaint?: boolean): Overlay; |
import { AbstractConnector, ConnectorComputeParams, PaintGeometry } from "./abstract-connector"; | ||
import { jsPlumbInstance } from "../core"; | ||
import { ComputedAnchorPosition } from "../factory/anchor-factory"; | ||
import { Connection } from "./connection-impl"; | ||
import { AnchorPlacement } from "../anchor-manager"; | ||
export interface AbstractBezierOptions { | ||
@@ -23,5 +23,13 @@ showLoopback?: boolean; | ||
isLoopbackCurrently: boolean; | ||
geometry: { | ||
controlPoints: [any, any]; | ||
source: AnchorPlacement; | ||
target: AnchorPlacement; | ||
}; | ||
getDefaultStubs(): [number, number]; | ||
constructor(instance: jsPlumbInstance, connection: Connection, params: any); | ||
_compute(paintInfo: PaintGeometry, p: ConnectorComputeParams): void; | ||
abstract _computeBezier(paintInfo: PaintGeometry, p: ConnectorComputeParams, sp: ComputedAnchorPosition, tp: ComputedAnchorPosition, _w: number, _h: number): void; | ||
exportGeometry(): any; | ||
importGeometry(geometry: any): boolean; | ||
abstract _computeBezier(paintInfo: PaintGeometry, p: ConnectorComputeParams, sp: AnchorPlacement, tp: AnchorPlacement, _w: number, _h: number): void; | ||
} |
import { jsPlumbInstance, PointArray, PointXY, TypeDescriptor } from "../core"; | ||
import { Segment, SegmentBounds } from "./abstract-segment"; | ||
import { Endpoint } from "../endpoint/endpoint-impl"; | ||
import { ComputedAnchorPosition, Orientation } from "../factory/anchor-factory"; | ||
import { Orientation } from "../factory/anchor-factory"; | ||
import { ComponentOptions } from "../component/component"; | ||
import { Connection } from "./connection-impl"; | ||
/** | ||
* Created by simon on 14/05/2019. | ||
*/ | ||
export interface ConnectorOptions { | ||
import { AnchorPlacement } from "../anchor-manager"; | ||
export interface ConnectorOptions extends Record<string, any> { | ||
} | ||
@@ -38,4 +36,4 @@ export declare type UserDefinedConnectorId = string; | ||
export declare type ConnectorComputeParams = { | ||
sourcePos: ComputedAnchorPosition; | ||
targetPos: ComputedAnchorPosition; | ||
sourcePos: AnchorPlacement; | ||
targetPos: AnchorPlacement; | ||
sourceOrientation: Orientation; | ||
@@ -86,2 +84,6 @@ targetOrientation: Orientation; | ||
} | ||
export interface Geometry { | ||
source: any; | ||
target: any; | ||
} | ||
export declare abstract class AbstractConnector implements Connector { | ||
@@ -91,3 +93,4 @@ instance: jsPlumbInstance; | ||
abstract type: string; | ||
stub: number; | ||
edited: boolean; | ||
stub: number | [number, number]; | ||
sourceStub: number; | ||
@@ -100,7 +103,7 @@ targetStub: number; | ||
targetGap: number; | ||
segments: Array<Segment>; | ||
private segments; | ||
totalLength: number; | ||
segmentProportions: Array<[number, number]>; | ||
segmentProportionalLengths: Array<number>; | ||
private paintInfo; | ||
protected paintInfo: PaintGeometry; | ||
strokeWidth: number; | ||
@@ -114,5 +117,17 @@ x: number; | ||
cssClass: string; | ||
abstract getDefaultStubs(): [number, number]; | ||
protected geometry: Geometry; | ||
constructor(instance: jsPlumbInstance, connection: Connection, params: ConnectorOptions); | ||
getTypeDescriptor(): string; | ||
getIdPrefix(): string; | ||
protected setGeometry(g: any, internal: boolean): void; | ||
/** | ||
* Subclasses can override this. By default we just pass back the geometry we are using internally. | ||
*/ | ||
exportGeometry(): any; | ||
/** | ||
* Subclasses can override this. By default we just set the given geometry as our internal representation. | ||
*/ | ||
importGeometry(g: any): boolean; | ||
resetGeometry(): void; | ||
abstract _compute(geometry: PaintGeometry, params: ConnectorComputeParams): void; | ||
@@ -164,3 +179,4 @@ resetBounds(): void; | ||
applyType(t: TypeDescriptor): void; | ||
setAnchorOrientation(idx: number, orientation: number[]): void; | ||
} | ||
export {}; |
@@ -62,3 +62,3 @@ import { BoundingBox, PointArray, PointXY } from "../core"; | ||
* path inscribed by the segment. This implementation returns | ||
* Infinity for distance and null values for everything else; | ||
* Infinity for distance and null values for everything else | ||
* subclasses are expected to override. | ||
@@ -65,0 +65,0 @@ */ |
@@ -5,2 +5,3 @@ import { AbstractSegment } from "./abstract-segment"; | ||
private instance; | ||
static segmentType: string; | ||
type: string; | ||
@@ -7,0 +8,0 @@ cx: number; |
import { AbstractBezierConnector, AbstractBezierOptions } from "./abstract-bezier-connector"; | ||
import { PaintGeometry, ConnectorComputeParams } from "./abstract-connector"; | ||
import { jsPlumbInstance } from "../core"; | ||
import { ComputedAnchorPosition } from "../factory/anchor-factory"; | ||
import { Connection } from "./connection-impl"; | ||
import { AnchorPlacement } from "../anchor-manager"; | ||
export declare class Bezier extends AbstractBezierConnector { | ||
@@ -13,4 +13,4 @@ connection: Connection; | ||
getCurviness(): number; | ||
private _findControlPoint; | ||
_computeBezier(paintInfo: PaintGeometry, p: ConnectorComputeParams, sp: ComputedAnchorPosition, tp: ComputedAnchorPosition, _w: number, _h: number): void; | ||
protected _findControlPoint(point: any, sourceAnchorPosition: any, targetAnchorPosition: any, soo: any, too: any): any[]; | ||
_computeBezier(paintInfo: PaintGeometry, p: ConnectorComputeParams, sp: AnchorPlacement, tp: AnchorPlacement, _w: number, _h: number): void; | ||
} |
@@ -17,2 +17,3 @@ import { AbstractSegment, PointNearPath, SegmentBounds } from "./abstract-segment"; | ||
constructor(instance: jsPlumbInstance, params: any); | ||
static segmentType: string; | ||
type: string; | ||
@@ -19,0 +20,0 @@ private static _translateLocation; |
@@ -24,2 +24,3 @@ import { AbstractConnector, ConnectorOptions, ConnectorComputeParams, PaintGeometry } from "./abstract-connector"; | ||
isLoopbackCurrently: boolean; | ||
getDefaultStubs(): [number, number]; | ||
constructor(instance: jsPlumbInstance, connection: Connection, params: FlowchartConnectorOptions); | ||
@@ -26,0 +27,0 @@ private addASegment; |
import { AbstractBezierConnector, AbstractBezierOptions } from "./abstract-bezier-connector"; | ||
import { jsPlumbInstance } from "../core"; | ||
import { ConnectorComputeParams, PaintGeometry } from "./abstract-connector"; | ||
import { ComputedAnchorPosition } from "../factory/anchor-factory"; | ||
import { Connection } from "./connection-impl"; | ||
import { AnchorPlacement } from "../anchor-manager"; | ||
export interface StateMachineOptions extends AbstractBezierOptions { | ||
@@ -14,3 +14,3 @@ } | ||
constructor(instance: jsPlumbInstance, connection: Connection, params: StateMachineOptions); | ||
_computeBezier(paintInfo: PaintGeometry, params: ConnectorComputeParams, sp: ComputedAnchorPosition, tp: ComputedAnchorPosition, w: number, h: number): void; | ||
_computeBezier(paintInfo: PaintGeometry, params: ConnectorComputeParams, sp: AnchorPlacement, tp: AnchorPlacement, w: number, h: number): void; | ||
} |
import { AbstractConnector, ConnectorComputeParams, PaintGeometry } from "./abstract-connector"; | ||
export declare class StraightConnector extends AbstractConnector { | ||
type: string; | ||
_compute(paintInfo: PaintGeometry, _: ConnectorComputeParams): void; | ||
getDefaultStubs(): [number, number]; | ||
_compute(paintInfo: PaintGeometry, p: ConnectorComputeParams): void; | ||
} |
@@ -20,2 +20,3 @@ import { AbstractSegment, PointNearPath, SegmentBounds } from "./abstract-segment"; | ||
private _recalc; | ||
static segmentType: string; | ||
type: string; | ||
@@ -22,0 +23,0 @@ getLength(): number; |
@@ -14,2 +14,3 @@ export declare function cls(...className: Array<string>): string; | ||
export declare const GROUP_KEY = "_jsPlumbGroup"; | ||
export declare const PARENT_GROUP_KEY = "_jsPlumbParentGroup"; | ||
export declare const IS_GROUP_KEY = "_isJsPlumbGroup"; | ||
@@ -34,4 +35,8 @@ export declare const ATTRIBUTE_MANAGED = "jtk-managed"; | ||
export declare const EVENT_DBL_CLICK = "dblclick"; | ||
export declare const EVENT_CONNECTION_MOUSEOVER = "connectionMouseOver"; | ||
export declare const EVENT_CONNECTION_MOUSEOUT = "connectionMouseOut"; | ||
export declare const EVENT_ENDPOINT_CLICK = "endpointClick"; | ||
export declare const EVENT_ENDPOINT_DBL_CLICK = "endpointDblClick"; | ||
export declare const EVENT_ENDPOINT_MOUSEOVER = "endpointMouseOver"; | ||
export declare const EVENT_ENDPOINT_MOUSEOUT = "endpointMouseOut"; | ||
export declare const EVENT_ELEMENT_CLICK = "elementClick"; | ||
@@ -54,4 +59,4 @@ export declare const EVENT_ELEMENT_DBL_CLICK = "elementDblClick"; | ||
export declare const EVENT_CONNECTION_DRAG = "connectionDrag"; | ||
export declare const EVENT_CHILD_ADDED = "group:addMember"; | ||
export declare const EVENT_CHILD_REMOVED = "group:removeMember"; | ||
export declare const EVENT_GROUP_MEMBER_ADDED = "group:addMember"; | ||
export declare const EVENT_GROUP_MEMBER_REMOVED = "group:removeMember"; | ||
export declare const EVENT_GROUP_ADDED = "group:add"; | ||
@@ -62,2 +67,4 @@ export declare const EVENT_GROUP_REMOVED = "group:remove"; | ||
export declare const EVENT_GROUP_DRAG_STOP = "groupDragStop"; | ||
export declare const EVENT_NESTED_GROUP_REMOVED = "nestedGroupRemoved"; | ||
export declare const EVENT_NESTED_GROUP_ADDED = "nestedGroupAdded"; | ||
export declare const EVENT_MAX_CONNECTIONS = "maxConnections"; | ||
@@ -64,0 +71,0 @@ export declare const CLASS_CONNECTOR = "jtk-connector"; |
@@ -17,2 +17,4 @@ import { jsPlumbDefaults, jsPlumbHelperFunctions } from "./defaults"; | ||
import { jsPlumbGeometryHelpers } from "./geom"; | ||
import { jsPlumbDOMElement } from "./dom"; | ||
import { Router } from "./router/router"; | ||
export declare type UUID = string; | ||
@@ -38,3 +40,15 @@ export declare type ElementId = string; | ||
endpointHoverStyle?: PaintStyle; | ||
ports?: [string, string]; | ||
} | ||
export interface ConnectionEstablishedParams { | ||
connection: Connection; | ||
source: jsPlumbDOMElement; | ||
sourceEndpoint: Endpoint; | ||
sourceId: string; | ||
target: jsPlumbDOMElement; | ||
targetEndpoint: Endpoint; | ||
targetId: string; | ||
} | ||
export interface ConnectionDetachedParams extends ConnectionEstablishedParams { | ||
} | ||
export interface TypeDescriptor { | ||
@@ -55,3 +69,24 @@ cssClass?: string; | ||
connector?: ConnectorSpec; | ||
mergeStrategy?: string; | ||
} | ||
export interface BehaviouralTypeDescriptor extends TypeDescriptor { | ||
filter?: string | Function; | ||
filterExclude?: boolean; | ||
extract?: Dictionary<string>; | ||
uniqueEndpoint?: boolean; | ||
onMaxConnections?: Function; | ||
connectionType?: string; | ||
portId?: string; | ||
} | ||
export interface SourceOrTargetDefinition { | ||
enabled?: boolean; | ||
def: BehaviouralTypeDescriptor; | ||
endpoint?: Endpoint; | ||
maxConnections?: number; | ||
uniqueEndpoint?: boolean; | ||
} | ||
export interface SourceDefinition extends SourceOrTargetDefinition { | ||
} | ||
export interface TargetDefinition extends SourceOrTargetDefinition { | ||
} | ||
export interface DeleteOptions { | ||
@@ -91,2 +126,3 @@ connection?: Connection; | ||
h: number; | ||
center?: PointXY; | ||
}; | ||
@@ -234,2 +270,3 @@ export declare type RectangleXY = BoundingBox; | ||
endpointsByUUID: Dictionary<Endpoint>; | ||
_allowNestedGroups: boolean; | ||
private _curIdStamp; | ||
@@ -239,2 +276,3 @@ private _offsetTimestamps; | ||
private _sizes; | ||
router: Router; | ||
anchorManager: AnchorManager; | ||
@@ -287,3 +325,3 @@ groupManager: GroupManager; | ||
checkCondition(conditionName: string, args?: any): boolean; | ||
getInternalId(element: any): string; | ||
getInternalId(element: jsPlumbDOMElement): string; | ||
getId(element: string | any, uuid?: string): string; | ||
@@ -394,3 +432,3 @@ /** | ||
connect(params: ConnectParams, referenceParams?: ConnectParams): Connection; | ||
_prepareConnectionParams(params: ConnectParams, referenceParams?: ConnectParams): any; | ||
private _prepareConnectionParams; | ||
_newConnection(params: any): Connection; | ||
@@ -404,4 +442,4 @@ _finaliseConnection(jpc: Connection, params?: any, originalEvent?: Event, doInformAnchorManager?: boolean): void; | ||
setSourceEnabled(el: ElementSpec, state: boolean, connectionType?: string): any; | ||
findFirstSourceDefinition(el: any, connectionType?: string): any; | ||
findFirstTargetDefinition(el: any, connectionType?: string): any; | ||
findFirstSourceDefinition(el: any, connectionType?: string): SourceDefinition; | ||
findFirstTargetDefinition(el: any, connectionType?: string): TargetDefinition; | ||
private findFirstDefinition; | ||
@@ -422,3 +460,3 @@ isSource(el: any, connectionType?: string): any; | ||
private _writeScopeAttribute; | ||
makeSource(el: ElementSpec, params?: any, referenceParams?: any): jsPlumbInstance; | ||
makeSource(el: ElementSpec, params?: BehaviouralTypeDescriptor, referenceParams?: any): jsPlumbInstance; | ||
private _getScope; | ||
@@ -432,3 +470,3 @@ getSourceScope(el: any | string): string; | ||
setScope(el: any | string, scope: string): void; | ||
makeTarget(el: ElementSpec, params: any, referenceParams?: any): jsPlumbInstance; | ||
makeTarget(el: ElementSpec, params: BehaviouralTypeDescriptor, referenceParams?: any): jsPlumbInstance; | ||
show(el: string | any, changeEndpoints?: boolean): jsPlumbInstance; | ||
@@ -452,3 +490,3 @@ hide(el: string | any, changeEndpoints?: boolean): jsPlumbInstance; | ||
unproxyConnection(connection: Connection, index: number, proxyElId: string): void; | ||
sourceChanged(originalId: string, newId: string, connection: any, newElement: any): void; | ||
sourceOrTargetChanged(originalId: string, newId: string, connection: any, newElement: any, index: number): void; | ||
getGroup(id: string): UIGroup; | ||
@@ -455,0 +493,0 @@ getGroupFor(el: any | string): UIGroup; |
@@ -31,2 +31,3 @@ import { EndpointSpec } from "./endpoint/endpoint"; | ||
hoverClass?: string; | ||
allowNestedGroups?: boolean; | ||
} | ||
@@ -33,0 +34,0 @@ export interface jsPlumbHelperFunctions { |
import { jsPlumbDefaults, jsPlumbHelperFunctions } from "../defaults"; | ||
import { Dictionary, jsPlumbInstance, Offset, PointArray, Size } from "../core"; | ||
import { Dictionary, jsPlumbInstance, Offset, PointArray, Size, SourceDefinition, TargetDefinition } from "../core"; | ||
import { DragManager } from "./drag-manager"; | ||
import { UIGroup } from "../group/group"; | ||
import { EventManager } from "./event-manager"; | ||
import { AbstractConnector, Endpoint, Overlay } from ".."; | ||
import { AbstractConnector, Collicat, CollicatOptions, Drag, ElementAttributes, Endpoint, Overlay } from ".."; | ||
import { jsPlumbList, jsPlumbListManager, jsPlumbListOptions } from "./lists"; | ||
export interface DragEventCallbackOptions { | ||
drag: { | ||
size: [number, number]; | ||
getDragElement: () => HTMLElement; | ||
_size: [number, number]; | ||
getDragElement: () => jsPlumbDOMElement; | ||
}; | ||
e: MouseEvent; | ||
el: HTMLElement; | ||
el: jsPlumbDOMElement; | ||
pos: [number, number]; | ||
@@ -34,3 +34,5 @@ } | ||
export interface jsPlumbDOMElement extends HTMLElement { | ||
_jsplumbid?: string; | ||
_jsPlumbGroup: UIGroup; | ||
_jsPlumbParentGroup: UIGroup; | ||
_isJsPlumbGroup: boolean; | ||
@@ -42,6 +44,7 @@ _jsPlumbOrphanedEndpoints: Array<Endpoint>; | ||
jtk: jsPlumbDOMInformation; | ||
_jsPlumbTargetDefinitions: Array<any>; | ||
_jsPlumbSourceDefinitions: Array<any>; | ||
_jsPlumbTargetDefinitions: Array<TargetDefinition>; | ||
_jsPlumbSourceDefinitions: Array<SourceDefinition>; | ||
_jsPlumbList: any; | ||
_jsPlumbScrollHandler?: Function; | ||
_katavorioDrag?: Drag; | ||
} | ||
@@ -68,3 +71,2 @@ export declare type PosseSpec = string | { | ||
_elementClick: Function; | ||
_elementDblClick: Function; | ||
_elementMouseenter: Function; | ||
@@ -149,2 +151,12 @@ _elementMouseexit: Function; | ||
removeList(el: jsPlumbDOMElement): void; | ||
/** | ||
* Helper method for other libs/code to get a DragManager. | ||
* @param options | ||
*/ | ||
createDragManager(options: CollicatOptions): Collicat; | ||
svg: { | ||
node: (name: string, attributes?: ElementAttributes) => jsPlumbDOMElement; | ||
attr: (node: SVGElement, attributes: ElementAttributes) => void; | ||
pos: (d: [number, number]) => string; | ||
}; | ||
} |
@@ -7,2 +7,3 @@ /** | ||
import { EventManager } from "./event-manager"; | ||
import { DragEventCallbackOptions, jsPlumbDOMElement } from "./browser-jsplumb-instance"; | ||
export interface DragSelector { | ||
@@ -14,3 +15,3 @@ filter?: string; | ||
declare abstract class Base { | ||
protected el: HTMLElement; | ||
protected el: jsPlumbDOMElement; | ||
protected k: Collicat; | ||
@@ -21,3 +22,3 @@ abstract _class: string; | ||
scopes: Array<string>; | ||
constructor(el: HTMLElement, k: Collicat); | ||
constructor(el: jsPlumbDOMElement, k: Collicat); | ||
setEnabled(e: boolean): void; | ||
@@ -31,3 +32,23 @@ isEnabled(): boolean; | ||
export declare type GhostProxyGenerator = (el: HTMLElement) => HTMLElement; | ||
export interface DragParams { | ||
export interface DragHandlerOptions { | ||
selector?: string; | ||
start?: (p: DragEventCallbackOptions) => any; | ||
stop?: (p: DragEventCallbackOptions) => any; | ||
drag?: (p: DragEventCallbackOptions) => any; | ||
beforeStart?: (beforeStartParams: any) => void; | ||
dragInit?: (el: jsPlumbDOMElement) => any; | ||
dragAbort?: (el: jsPlumbDOMElement) => any; | ||
ghostProxy?: GhostProxyGenerator | boolean; | ||
makeGhostProxy?: GhostProxyGenerator; | ||
useGhostProxy?: (container: any, dragEl: any) => boolean; | ||
ghostProxyParent?: HTMLElement; | ||
constrain?: ConstrainFunction | boolean; | ||
revert?: RevertFunction; | ||
filter?: string; | ||
filterExclude?: boolean; | ||
snapThreshold?: number; | ||
grid?: PointArray; | ||
allowNegative?: boolean; | ||
} | ||
export interface DragParams extends DragHandlerOptions { | ||
rightButtonCanDrag?: boolean; | ||
@@ -38,11 +59,3 @@ consumeStartEvent?: boolean; | ||
multipleDrop?: boolean; | ||
ghostProxy?: GhostProxyGenerator | boolean; | ||
makeGhostProxy?: GhostProxyGenerator; | ||
selector?: string; | ||
snapThreshold?: number; | ||
grid?: PointArray; | ||
allowNegative?: boolean; | ||
constrain?: ConstrainFunction | boolean; | ||
containment?: boolean; | ||
revert?: RevertFunction; | ||
canDrag?: Function; | ||
@@ -53,8 +66,4 @@ consumeFilteredEvents?: boolean; | ||
ignoreZoom?: boolean; | ||
ghostProxyParent?: HTMLElement; | ||
filter?: string; | ||
filterExclude?: boolean; | ||
scope?: string; | ||
} | ||
export interface DragSelector { | ||
} | ||
export declare class Drag extends Base { | ||
@@ -83,3 +92,3 @@ _class: string; | ||
_useGhostProxy: Function; | ||
_activeSelectorParams: any; | ||
_activeSelectorParams: DragParams; | ||
_availableSelectors: Array<DragParams>; | ||
@@ -108,3 +117,3 @@ _ghostProxyFunction: GhostProxyGenerator; | ||
listeners: Dictionary<Array<Function>>; | ||
constructor(el: HTMLElement, params: DragParams, k: Collicat); | ||
constructor(el: jsPlumbDOMElement, params: DragParams, k: Collicat); | ||
on(evt: string, fn: Function): void; | ||
@@ -115,3 +124,3 @@ off(evt: string, fn: Function): void; | ||
private _moveListener; | ||
mark(payload: any, andNotify?: boolean): void; | ||
mark(payload: any): void; | ||
unmark(e: MouseEvent): void; | ||
@@ -148,3 +157,3 @@ moveBy(dx: number, dy: number, e?: MouseEvent): void; | ||
clearAllFilters(): void; | ||
addSelector(params: any): void; | ||
addSelector(params: DragHandlerOptions, atStart?: boolean): void; | ||
destroy(): void; | ||
@@ -161,3 +170,11 @@ } | ||
} | ||
export declare class Collicat { | ||
export interface jsPlumbDragManager { | ||
getZoom(): number; | ||
setZoom(z: number): void; | ||
getInputFilterSelector(): string; | ||
setInputFilterSelector(selector: string): void; | ||
draggable(el: jsPlumbDOMElement, params: DragParams): Drag; | ||
destroyDraggable(el: jsPlumbDOMElement): void; | ||
} | ||
export declare class Collicat implements jsPlumbDragManager { | ||
eventManager: EventManager; | ||
@@ -172,3 +189,3 @@ private zoom; | ||
setZoom(z: number): void; | ||
_prepareParams(p: DragParams): DragParams; | ||
private _prepareParams; | ||
/** | ||
@@ -184,8 +201,8 @@ * Gets the selector identifying which input elements to filter from drag events. | ||
* @param {String} selector Input filter selector to set. | ||
* @return {Katavorio} Current instance; method may be chained. | ||
* @return {Collicat} Current instance; method may be chained. | ||
*/ | ||
setInputFilterSelector(selector: string): this; | ||
draggable(el: any, params: DragParams): Drag; | ||
destroyDraggable(el: any): void; | ||
draggable(el: jsPlumbDOMElement, params: DragParams): Drag; | ||
destroyDraggable(el: jsPlumbDOMElement): void; | ||
} | ||
export {}; |
@@ -1,4 +0,4 @@ | ||
import { BrowserJsPlumbInstance } from "./browser-jsplumb-instance"; | ||
import { Dictionary } from "../core"; | ||
import { Drag } from "./collicat"; | ||
import { BrowserJsPlumbInstance, jsPlumbDOMElement } from "./browser-jsplumb-instance"; | ||
import { Dictionary, PointArray } from "../core"; | ||
import { Drag, DragHandlerOptions, GhostProxyGenerator } from "./collicat"; | ||
export declare const CLASS_DRAG_SELECTED = "jtk-drag-selected"; | ||
@@ -16,9 +16,11 @@ export declare const CLASS_DRAG_ACTIVE = "jtk-drag-active"; | ||
export declare const EVT_REVERT = "revert"; | ||
export declare const EVT_ZOOM = "zoom"; | ||
export declare const EVT_CONNECTION_DRAG = "connectionDrag"; | ||
export interface DragHandler { | ||
selector: string; | ||
onStart: (params: any) => boolean; | ||
onDrag: (params: any) => void; | ||
onStop: (params: any) => void; | ||
onDragInit: (el: HTMLElement) => HTMLElement; | ||
onStart: (params: DragStartEventParams) => boolean; | ||
onDrag: (params: DragEventParams) => void; | ||
onStop: (params: DragStopEventParams) => void; | ||
onDragInit: (el: jsPlumbDOMElement) => jsPlumbDOMElement; | ||
onDragAbort: (el: jsPlumbDOMElement) => void; | ||
reset: () => void; | ||
@@ -29,5 +31,18 @@ init: (drag: Drag) => void; | ||
export interface GhostProxyingDragHandler extends DragHandler { | ||
makeGhostProxy: (el: any) => any; | ||
useGhostProxy: (container: any, dragEl: any) => boolean; | ||
useGhostProxy: (container: any, dragEl: jsPlumbDOMElement) => boolean; | ||
makeGhostProxy?: GhostProxyGenerator; | ||
} | ||
export interface DragStartEventParams { | ||
e: MouseEvent; | ||
el: jsPlumbDOMElement; | ||
finalPos?: PointArray; | ||
drag: Drag; | ||
} | ||
export interface DragEventParams extends DragStartEventParams { | ||
pos: PointArray; | ||
} | ||
export interface DragStopEventParams extends DragEventParams { | ||
finalPos: PointArray; | ||
selection: Array<any>; | ||
} | ||
export declare class DragManager { | ||
@@ -44,3 +59,3 @@ protected instance: BrowserJsPlumbInstance; | ||
constructor(instance: BrowserJsPlumbInstance); | ||
addHandler(handler: DragHandler, dragOptions?: any): void; | ||
addHandler(handler: DragHandler, dragOptions?: DragHandlerOptions): void; | ||
addFilter(filter: Function | string, exclude?: boolean): void; | ||
@@ -47,0 +62,0 @@ removeFilter(filter: Function | string): void; |
@@ -1,5 +0,5 @@ | ||
import { DragHandler } from "./drag-manager"; | ||
import { BrowserJsPlumbInstance, PosseSpec } from "./browser-jsplumb-instance"; | ||
import { DragEventParams, DragHandler, DragStopEventParams } from "./drag-manager"; | ||
import { BrowserJsPlumbInstance, jsPlumbDOMElement, PosseSpec } from "./browser-jsplumb-instance"; | ||
import { UIGroup } from "../group/group"; | ||
import { BoundingBox, Dictionary, Offset } from "../core"; | ||
import { BoundingBox, Dictionary, Offset, PointArray } from "../core"; | ||
import { Drag } from "./collicat"; | ||
@@ -31,2 +31,3 @@ declare type IntersectingGroup = { | ||
_intersectingGroups: Array<IntersectingGroup>; | ||
_currentDragParentGroup: UIGroup; | ||
_posseByElementIdMap: Dictionary<Posse>; | ||
@@ -42,8 +43,15 @@ _posseMap: Dictionary<Posse>; | ||
constructor(instance: BrowserJsPlumbInstance); | ||
onDragInit(el: HTMLElement): HTMLElement; | ||
onStop(params: any): void; | ||
onDragInit(el: jsPlumbDOMElement): jsPlumbDOMElement; | ||
onDragAbort(el: jsPlumbDOMElement): void; | ||
onStop(params: DragStopEventParams): void; | ||
private _cleanup; | ||
reset(): void; | ||
init(drag: Drag): void; | ||
onDrag(params: any): void; | ||
onStart(params: any): boolean; | ||
onDrag(params: DragEventParams): void; | ||
onStart(params: { | ||
e: MouseEvent; | ||
el: jsPlumbDOMElement; | ||
finalPos: PointArray; | ||
drag: Drag; | ||
}): boolean; | ||
addToDragSelection(el: string | HTMLElement): void; | ||
@@ -50,0 +58,0 @@ clearDragSelection(): void; |
@@ -1,8 +0,20 @@ | ||
import { DragHandler } from "./drag-manager"; | ||
import { DragEventParams, DragHandler, DragStartEventParams, DragStopEventParams } from "./drag-manager"; | ||
import { BrowserJsPlumbInstance, jsPlumbDOMElement } from "./browser-jsplumb-instance"; | ||
import { Connection } from "../connector/connection-impl"; | ||
import { Endpoint } from "../endpoint/endpoint-impl"; | ||
import { Dictionary } from "../core"; | ||
import { BoundingBox, Dictionary } from "../core"; | ||
import { EndpointRepresentation } from "../endpoint/endpoints"; | ||
import { Drag } from "./collicat"; | ||
export interface ConnectionMovedParams { | ||
connection: Connection; | ||
index: number; | ||
originalSourceId: string; | ||
newSourceId: string; | ||
originalTargetId: string; | ||
newTargetId: string; | ||
originalSourceEndpoint: Endpoint; | ||
newSourceEndpoint: Endpoint; | ||
originalTargetEndpoint: Endpoint; | ||
newTargetEndpoint: Endpoint; | ||
} | ||
export declare class EndpointDragHandler implements DragHandler { | ||
@@ -23,3 +35,7 @@ protected instance: BrowserJsPlumbInstance; | ||
inPlaceCopy: any; | ||
endpointDropTargets: Array<any>; | ||
endpointDropTargets: Array<{ | ||
el: jsPlumbDOMElement; | ||
endpoint: Endpoint; | ||
r: BoundingBox; | ||
}>; | ||
currentDropTarget: any; | ||
@@ -42,2 +58,3 @@ payload: any; | ||
onDragInit(el: jsPlumbDOMElement): jsPlumbDOMElement; | ||
onDragAbort(el: jsPlumbDOMElement): void; | ||
/** | ||
@@ -54,8 +71,8 @@ * Makes the element that is the placeholder for dragging. this element gets `managed` by the instance, and `unmanaged` when dragging | ||
init(drag: Drag): void; | ||
onStart(p: any): boolean; | ||
onStart(p: DragStartEventParams): boolean; | ||
onBeforeStart(beforeStartParams: any): void; | ||
onDrag(params: any): boolean; | ||
onDrag(params: DragEventParams): boolean; | ||
private _maybeCleanup; | ||
private _reattachOrDiscard; | ||
onStop(p: any): void; | ||
onStop(p: DragStopEventParams): void; | ||
/** | ||
@@ -62,0 +79,0 @@ * Lookup a source definition on the given element. |
@@ -1,5 +0,6 @@ | ||
import { AnchorComputeParams, AnchorOptions, ComputedAnchorPosition, Orientation } from "../factory/anchor-factory"; | ||
import { AnchorComputeParams, AnchorOptions, Orientation } from "../factory/anchor-factory"; | ||
import { Anchor } from "../anchor/anchor"; | ||
import { jsPlumbInstance, Size } from "../core"; | ||
import { Endpoint } from "../endpoint/endpoint-impl"; | ||
import { AnchorPlacement } from "../anchor-manager"; | ||
export interface FloatingAnchorOptions extends AnchorOptions { | ||
@@ -16,5 +17,5 @@ reference: Anchor; | ||
yDir: number; | ||
_lastResult: ComputedAnchorPosition; | ||
_lastResult: AnchorPlacement; | ||
constructor(instance: jsPlumbInstance, params: FloatingAnchorOptions); | ||
compute(params: AnchorComputeParams): ComputedAnchorPosition; | ||
compute(params: AnchorComputeParams): AnchorPlacement; | ||
getOrientation(_endpoint: Endpoint): Orientation; | ||
@@ -33,3 +34,3 @@ /** | ||
out(): void; | ||
getCurrentLocation(params: AnchorComputeParams): ComputedAnchorPosition; | ||
getCurrentLocation(params: AnchorComputeParams): AnchorPlacement; | ||
} |
import { ElementDragHandler } from "./element-drag-handler"; | ||
import { GhostProxyingDragHandler } from "./drag-manager"; | ||
import { BrowserJsPlumbInstance } from "./browser-jsplumb-instance"; | ||
import { DragEventParams, GhostProxyingDragHandler, DragStopEventParams } from "./drag-manager"; | ||
import { BrowserJsPlumbInstance, jsPlumbDOMElement } from "./browser-jsplumb-instance"; | ||
import { Drag } from "./collicat"; | ||
@@ -8,3 +8,3 @@ export declare class GroupDragHandler extends ElementDragHandler implements GhostProxyingDragHandler { | ||
selector: string; | ||
doRevalidate: (el: any) => void; | ||
doRevalidate: (el: jsPlumbDOMElement) => void; | ||
constructor(instance: BrowserJsPlumbInstance); | ||
@@ -14,9 +14,9 @@ reset(): void; | ||
init(drag: Drag): void; | ||
useGhostProxy(container: any, dragEl: any): boolean; | ||
makeGhostProxy(el: any): any; | ||
onDrag(params: any): void; | ||
onDragInit(el: HTMLElement): HTMLElement; | ||
onStop(params: any): void; | ||
useGhostProxy(container: any, dragEl: jsPlumbDOMElement): boolean; | ||
makeGhostProxy(el: jsPlumbDOMElement): jsPlumbDOMElement; | ||
onDrag(params: DragEventParams): void; | ||
onDragAbort(el: jsPlumbDOMElement): void; | ||
onStop(params: DragStopEventParams): void; | ||
private _isInsideParent; | ||
private _pruneOrOrphan; | ||
} |
import { EndpointRepresentation } from "./endpoints"; | ||
import { ComputedAnchorPosition, Orientation } from "../factory/anchor-factory"; | ||
import { Orientation } from "../factory/anchor-factory"; | ||
import { Endpoint } from "./endpoint-impl"; | ||
import { AnchorPlacement } from "../anchor-manager"; | ||
export declare type ComputedBlankEndpoint = [number, number, number, number]; | ||
export declare class BlankEndpoint<E> extends EndpointRepresentation<ComputedBlankEndpoint> { | ||
constructor(endpoint: Endpoint, params?: any); | ||
_compute(anchorPoint: ComputedAnchorPosition, orientation: Orientation, endpointStyle: any): ComputedBlankEndpoint; | ||
_compute(anchorPoint: AnchorPlacement, orientation: Orientation, endpointStyle: any): ComputedBlankEndpoint; | ||
getType(): string; | ||
} |
import { EndpointRepresentation } from "./endpoints"; | ||
import { ComputedAnchorPosition, Orientation } from "../factory/anchor-factory"; | ||
import { Orientation } from "../factory/anchor-factory"; | ||
import { Endpoint } from "./endpoint-impl"; | ||
import { AnchorPlacement } from "../anchor-manager"; | ||
export declare type ComputedDotEndpoint = [number, number, number, number, number]; | ||
@@ -10,4 +11,5 @@ export declare class DotEndpoint<E> extends EndpointRepresentation<ComputedDotEndpoint> { | ||
constructor(endpoint: Endpoint, params?: any); | ||
_compute(anchorPoint: ComputedAnchorPosition, orientation: Orientation, endpointStyle: any): ComputedDotEndpoint; | ||
_compute(anchorPoint: AnchorPlacement, orientation: Orientation, endpointStyle: any): ComputedDotEndpoint; | ||
static dotEndpointType: string; | ||
getType(): string; | ||
} |
import { EndpointOptions, EndpointSpec } from "../endpoint/endpoint"; | ||
import { jsPlumbInstance, OffsetAndSize, Size } from "../core"; | ||
import { ComputedAnchorPosition } from "../factory/anchor-factory"; | ||
import { Anchor } from "../anchor/anchor"; | ||
@@ -10,3 +9,3 @@ import { OverlayCapableComponent } from "../component/overlay-capable-component"; | ||
import { EndpointRepresentation } from "./endpoints"; | ||
import { OverlaySpec } from ".."; | ||
import { AnchorPlacement, OverlaySpec } from ".."; | ||
export declare class Endpoint extends OverlayCapableComponent { | ||
@@ -29,2 +28,3 @@ instance: jsPlumbInstance; | ||
timestamp: string; | ||
portId: string; | ||
maxConnections: number; | ||
@@ -36,5 +36,7 @@ connectorClass: string; | ||
finalEndpoint: Endpoint; | ||
enabled: boolean; | ||
isSource: boolean; | ||
isTarget: boolean; | ||
isTemporarySource: boolean; | ||
connectionCost: number; | ||
connectionsDirected: boolean; | ||
@@ -51,2 +53,3 @@ connectionsDetachable: boolean; | ||
deleteOnEmpty: boolean; | ||
private uuid; | ||
defaultLabelLocation: [number, number]; | ||
@@ -71,4 +74,2 @@ getDefaultOverlayKey(): string; | ||
applyType(t: any, doNotRepaint: boolean, typeMap: any): void; | ||
isEnabled(): boolean; | ||
setEnabled(e: boolean): void; | ||
destroy(force?: boolean): void; | ||
@@ -78,6 +79,2 @@ isFull(): boolean; | ||
isConnectedTo(endpoint: Endpoint): boolean; | ||
getConnectionCost(): number; | ||
setConnectionCost(c: number): void; | ||
areConnectionsDirected(): boolean; | ||
setConnectionsDirected(b: boolean): void; | ||
setElementId(_elId: string): void; | ||
@@ -88,3 +85,3 @@ setReferenceElement(_el: any): void; | ||
getUuid(): string; | ||
computeAnchor(params: any): ComputedAnchorPosition; | ||
computeAnchor(params: any): AnchorPlacement; | ||
setElement(el: any): Endpoint; | ||
@@ -99,3 +96,3 @@ connectorSelector(): Connection; | ||
connectorPaintStyle?: PaintStyle; | ||
anchorLoc?: ComputedAnchorPosition; | ||
anchorLoc?: AnchorPlacement; | ||
}): void; | ||
@@ -102,0 +99,0 @@ prepareEndpoint<C>(ep: EndpointSpec | EndpointRepresentation<C>, typeId?: string): EndpointRepresentation<C>; |
@@ -41,2 +41,3 @@ import { AnchorSpec } from "../factory/anchor-factory"; | ||
connectorTooltip?: string; | ||
portId?: string; | ||
uuid?: string; | ||
@@ -43,0 +44,0 @@ source?: string | any; |
import { jsPlumbInstance } from "../core"; | ||
import { ComputedAnchorPosition, Orientation } from "../factory/anchor-factory"; | ||
import { Orientation } from "../factory/anchor-factory"; | ||
import { SegmentBounds } from "../connector/abstract-segment"; | ||
import { Endpoint } from "./endpoint-impl"; | ||
import { AnchorPlacement } from "../anchor-manager"; | ||
/** | ||
@@ -21,3 +22,3 @@ * Superclass for all types of Endpoint. This class is renderer | ||
abstract getType(): string; | ||
abstract _compute(anchorPoint: ComputedAnchorPosition, orientation: Orientation, endpointStyle: any): C; | ||
abstract _compute(anchorPoint: AnchorPlacement, orientation: Orientation, endpointStyle: any): C; | ||
constructor(endpoint: Endpoint); | ||
@@ -27,4 +28,4 @@ addClass(c: string): void; | ||
clone(): EndpointRepresentation<C>; | ||
compute(anchorPoint: ComputedAnchorPosition, orientation: Orientation, endpointStyle: any): void; | ||
compute(anchorPoint: AnchorPlacement, orientation: Orientation, endpointStyle: any): void; | ||
setVisible(v: boolean): void; | ||
} |
import { EndpointRepresentation } from "./endpoints"; | ||
import { ComputedAnchorPosition, Orientation } from "../factory/anchor-factory"; | ||
import { Orientation } from "../factory/anchor-factory"; | ||
import { Endpoint } from "./endpoint-impl"; | ||
import { AnchorPlacement } from "../anchor-manager"; | ||
export declare type ComputedRectangleEndpoint = [number, number, number, number]; | ||
@@ -9,4 +10,4 @@ export declare class RectangleEndpoint<E> extends EndpointRepresentation<ComputedRectangleEndpoint> { | ||
constructor(endpoint: Endpoint, params?: any); | ||
_compute(anchorPoint: ComputedAnchorPosition, orientation: Orientation, endpointStyle: any): ComputedRectangleEndpoint; | ||
_compute(anchorPoint: AnchorPlacement, orientation: Orientation, endpointStyle: any): ComputedRectangleEndpoint; | ||
getType(): string; | ||
} |
@@ -9,3 +9,3 @@ export declare abstract class EventGenerator { | ||
constructor(); | ||
fire(event: string, value?: any, originalEvent?: Event): EventGenerator; | ||
fire(event: string, value?: any, originalEvent?: Event): any; | ||
private _drain; | ||
@@ -20,1 +20,4 @@ unbind(eventOrListener?: string | Function, listener?: Function): EventGenerator; | ||
} | ||
export declare class OptimisticEventGenerator extends EventGenerator { | ||
shouldFireEvent(event: string, value: any, originalEvent?: Event): boolean; | ||
} |
@@ -5,2 +5,3 @@ import { Connection } from "../connector/connection-impl"; | ||
import { Anchor } from "../anchor/anchor"; | ||
import { AnchorPlacement } from "../anchor-manager"; | ||
export declare type AnchorOrientationHint = -1 | 0 | 1; | ||
@@ -24,3 +25,2 @@ export declare type Orientation = [AnchorOrientationHint, AnchorOrientationHint]; | ||
}; | ||
export declare type ComputedAnchorPosition = [number, number, number, number]; | ||
export interface AnchorOptions { | ||
@@ -30,3 +30,3 @@ cssClass?: string; | ||
export declare type AnchorId = "Assign" | "AutoDefault" | "Bottom" | "BottomCenter" | "BottomLeft" | "BottomRight" | "Center" | "Continuous" | "ContinuousBottom" | "ContinuousLeft" | "ContinuousRight" | "ContinuousTop" | "ContinuousLeftRight" | "ContinuousTopBottom" | "Left" | "LeftMiddle" | "Perimeter" | "Right" | "RightMiddle" | "Top" | "TopCenter" | "TopLeft" | "TopRight"; | ||
export declare type AnchorSpec = AnchorId | [AnchorId, AnchorOptions]; | ||
export declare type AnchorSpec = AnchorId | [AnchorId, AnchorOptions] | AnchorPlacement; | ||
export declare const Anchors: { | ||
@@ -33,0 +33,0 @@ get: (instance: jsPlumbInstance, name: string, args: any) => Anchor; |
import { Dictionary, jsPlumbInstance, Offset } from "../core"; | ||
import { UIGroup } from "./group"; | ||
import { jsPlumbDOMElement } from ".."; | ||
export declare class GroupManager { | ||
@@ -10,9 +11,14 @@ instance: jsPlumbInstance; | ||
private _cleanupDetachedConnection; | ||
addGroup(params: any): UIGroup; | ||
addGroup(params: { | ||
id: string; | ||
el: jsPlumbDOMElement; | ||
collapsed?: boolean; | ||
}): UIGroup; | ||
getGroup(groupId: string | UIGroup): UIGroup; | ||
getGroupFor(el: any | string): UIGroup; | ||
getGroups(): Array<UIGroup>; | ||
removeGroup(group: string | UIGroup, deleteMembers?: boolean, manipulateDOM?: boolean, doNotFireEvent?: boolean): Dictionary<Offset>; | ||
removeAllGroups(deleteMembers?: boolean, manipulateDOM?: boolean, doNotFireEvent?: boolean): void; | ||
forEach(f: (g: UIGroup) => any): void; | ||
orphan(_el: any): [string, Offset]; | ||
orphan(_el: jsPlumbDOMElement): [string, Offset]; | ||
private _setGroupVisible; | ||
@@ -22,5 +28,18 @@ _updateConnectionsForGroup(group: UIGroup): void; | ||
private _expandConnection; | ||
private isDescendant; | ||
private isElementDescendant; | ||
collapseGroup(group: string | UIGroup): void; | ||
/** | ||
* Cascade a collapse from the given `collapsedGroup` into the given `targetGroup`. | ||
* @param collapsedGroup | ||
* @param targetGroup | ||
* @param collapsedIds Set of connection ids for already collapsed connections, which we can ignore. | ||
*/ | ||
cascadeCollapse(collapsedGroup: UIGroup, targetGroup: UIGroup, collapsedIds: Set<string>): void; | ||
expandGroup(group: string | UIGroup, doNotFireEvent?: boolean): void; | ||
/** | ||
* Cascade an expand from the given `collapsedGroup` into the given `targetGroup`. | ||
* @param expandedGroup | ||
* @param targetGroup | ||
*/ | ||
cascadeExpand(expandedGroup: UIGroup, targetGroup: UIGroup): void; | ||
toggleGroup(group: string | UIGroup): void; | ||
@@ -30,3 +49,7 @@ repaintGroup(group: string | UIGroup): void; | ||
removeFromGroup(group: string | UIGroup, el: any, doNotFireEvent?: boolean): void; | ||
getAncestors(group: UIGroup): Array<UIGroup>; | ||
isAncestor(group: UIGroup, possibleAncestor: UIGroup): boolean; | ||
getDescendants(group: UIGroup): Array<UIGroup>; | ||
isDescendant(possibleDescendant: UIGroup, ancestor: UIGroup): boolean; | ||
reset(): void; | ||
} |
@@ -17,6 +17,12 @@ import { Dictionary, jsPlumbInstance, Offset } from "../core"; | ||
} | ||
export declare class UIGroup { | ||
export declare class UINode { | ||
instance: jsPlumbInstance; | ||
el: any; | ||
group: UIGroup; | ||
constructor(instance: jsPlumbInstance, el: any); | ||
} | ||
export declare class UIGroup extends UINode { | ||
instance: jsPlumbInstance; | ||
children: Array<any>; | ||
el: any; | ||
childGroups: Array<UIGroup>; | ||
collapsed: boolean; | ||
@@ -52,2 +58,6 @@ droppable: boolean; | ||
orphanAll(): Dictionary<Offset>; | ||
addGroup(group: UIGroup): boolean; | ||
removeGroup(group: UIGroup): void; | ||
getGroups(): Array<UIGroup>; | ||
get collapseParent(): UIGroup; | ||
} |
import { BrowserJsPlumbDefaults, BrowserJsPlumbInstance } from "./dom/browser-jsplumb-instance"; | ||
import { Constructable } from "./core"; | ||
import { jsPlumbHelperFunctions } from "./defaults"; | ||
import { Collicat, CollicatOptions } from "./dom"; | ||
import { AbstractConnector } from "./connector/abstract-connector"; | ||
export * from "./constants"; | ||
@@ -57,3 +58,5 @@ export * from "./core"; | ||
uuid(): string; | ||
createDragManager(options: CollicatOptions): Collicat; | ||
Connectors: { | ||
register: (name: string, conn: Constructable<AbstractConnector>) => void; | ||
}; | ||
} |
@@ -12,2 +12,3 @@ import { ArrowOverlayOptions, Overlay } from "./overlay"; | ||
paintStyle: PaintStyle; | ||
static arrowType: string; | ||
type: string; | ||
@@ -19,1 +20,2 @@ cachedDimensions: PointArray; | ||
} | ||
export declare function isArrowOverlay(o: Overlay): o is ArrowOverlay; |
@@ -9,4 +9,6 @@ import { CustomOverlayOptions, Overlay } from "./overlay"; | ||
constructor(instance: jsPlumbInstance, component: Component, p: CustomOverlayOptions); | ||
static customType: string; | ||
type: string; | ||
updateFrom(d: any): void; | ||
} | ||
export declare function isCustomOverlay(o: Overlay): o is CustomOverlay; |
@@ -9,2 +9,3 @@ import { LabelOverlayOptions, Overlay } from "./overlay"; | ||
labelText: string; | ||
static labelType: string; | ||
type: string; | ||
@@ -18,1 +19,2 @@ cachedDimensions: PointArray; | ||
} | ||
export declare function isLabelOverlay(o: Overlay): o is LabelOverlay; |
@@ -5,3 +5,3 @@ import { Dictionary, jsPlumbInstance } from "../core"; | ||
import { EventGenerator } from "../event-generator"; | ||
export interface OverlayOptions { | ||
export interface OverlayOptions extends Record<string, any> { | ||
id?: string; | ||
@@ -46,12 +46,2 @@ cssClass?: string; | ||
destroy(force?: boolean): void; | ||
/** | ||
* Add a class to the overlay. | ||
* @param clazz | ||
*/ | ||
addClass(clazz: string): void; | ||
/** | ||
* Remove a class from the overlay. | ||
* @param clazz | ||
*/ | ||
removeClass(clazz: string): void; | ||
abstract updateFrom(d: any): void; | ||
@@ -58,0 +48,0 @@ private _postComponentEvent; |
import { Dictionary, jsPlumbInstance } from "../core"; | ||
import { Component } from "../component/component"; | ||
import { jsPlumbDOMElement } from ".."; | ||
export declare const STROKE_DASHARRAY = "stroke-dasharray"; | ||
@@ -14,5 +15,5 @@ export declare const DASHSTYLE = "dashstyle"; | ||
export declare function _attr(node: SVGElement, attributes: ElementAttributes): void; | ||
export declare function _node(instance: jsPlumbInstance, name: string, attributes?: ElementAttributes): SVGElement; | ||
export declare function _node(instance: jsPlumbInstance, name: string, attributes?: ElementAttributes): jsPlumbDOMElement; | ||
export declare function _pos(d: [number, number]): string; | ||
export declare function _applyStyles(parent: any, node: SVGElement, style: any, dimensions: any, uiComponent: Component): void; | ||
export declare function _appendAtIndex(svg: SVGElement, path: SVGElement, idx: number): void; | ||
export declare function _appendAtIndex(svg: SVGElement, path: jsPlumbDOMElement, idx: number): void; |
@@ -8,4 +8,4 @@ import { SortFunction } from "./core"; | ||
export declare function isObject(o: any): boolean; | ||
export declare function isDate(o: any): boolean; | ||
export declare function isFunction(o: any): boolean; | ||
export declare function isDate(o: any): o is Date; | ||
export declare function isFunction(o: any): o is Function; | ||
export declare function isNamedFunction(o: any): boolean; | ||
@@ -12,0 +12,0 @@ export declare function isEmpty(o: any): boolean; |
{ | ||
"name": "@jsplumb/community", | ||
"version": "4.0.0-RC2", | ||
"version": "4.0.0-RC20", | ||
"description": "Visual connectivity for webapps", | ||
@@ -19,3 +19,3 @@ "main": "dist/js/jsplumb.js", | ||
"init": "node ./install.js", | ||
"build": "tsc", | ||
"build": "set -e;tsc", | ||
"babel": "./node_modules/.bin/babel ./ts --out-dir _build --extensions \".ts,.tsx\" --source-maps", | ||
@@ -22,0 +22,0 @@ "package": "set -e;npm run build;rm -rf dist;mkdir dist;npm run build;npm run rollup;npm run copy-defs", |
@@ -41,3 +41,5 @@ # jsPlumb | ||
- The `droppable` method was removed. It was not used internally by any of the other code in either the Community or Toolkit editions, and had no accompanying tests. A question was raised [on Github](https://github.com/jsplumb/jsplumb/issues/942) about it and the OP ended up saying they'd just used native droppable stuff to achieve what they needed. If you feel `droppable` should be reinstated, we can chat about it [in this issue](https://github.com/jsplumb/jsplumb/issues/943). | ||
#### Configuration | ||
@@ -59,2 +61,4 @@ | ||
- The `radius` option is not supported on `PaintStyle` any longer. More generally, type specific values are not supported - `radius` only pertains to `Dot` endpoints, for instance. `width` and `height` from the Rectangle endpoint are also instance of this. Put type specific values on the endpoint spec itself, eg `endpoint:['Dot', { radius:10 }]`. | ||
#### CSS classes | ||
@@ -72,9 +76,14 @@ | ||
- The `manageElement` and `unmanageElement` events are no longer fired by the `JsPlumbInstance` class. These were undocumented anyway, but we're calling it out | ||
in case you have code that used them. | ||
- The `manageElement` and `unmanageElement` events are no longer fired by the `JsPlumbInstance` class. These were undocumented anyway, but we're calling it out in case you have code that used them. | ||
- Added `drag:start`, `drag:move` and `drag:stop` events. These replace the `start`, `drag` and `stop` event handlers that used to | ||
be supported on individual `draggable(..)` method calls. | ||
- Added `drag:start`, `drag:move` and `drag:stop` events. These replace the `start`, `drag` and `stop` event handlers that used to be supported on individual `draggable(..)` method calls. | ||
- Binding to `mouseover` and `mouseout` on Endpoints and Connections is not supported. You now should bind to these events on a jsplumb instance instead: | ||
- endpointMouseOver | ||
- endpointMouseOut | ||
- connectionMouseOver | ||
- connectionMouseOut | ||
#### Behaviour | ||
@@ -81,0 +90,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
789776
86
19562
175