chore: lint files
Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
@@ -2,58 +2,60 @@ import type { Ref } from 'vue'
|
||||
import type { FlowHooks } from '~/types'
|
||||
|
||||
// flow event hooks
|
||||
export const createHooks = (): FlowHooks => ({
|
||||
edgesChange: createExtendedEventHook(),
|
||||
nodesChange: createExtendedEventHook(),
|
||||
nodeDoubleClick: createExtendedEventHook(),
|
||||
nodeClick: createExtendedEventHook(),
|
||||
nodeMouseEnter: createExtendedEventHook(),
|
||||
nodeMouseMove: createExtendedEventHook(),
|
||||
nodeMouseLeave: createExtendedEventHook(),
|
||||
nodeContextMenu: createExtendedEventHook(),
|
||||
nodeDragStart: createExtendedEventHook(),
|
||||
nodeDrag: createExtendedEventHook(),
|
||||
nodeDragStop: createExtendedEventHook(),
|
||||
nodesInitialized: createExtendedEventHook(),
|
||||
miniMapNodeClick: createExtendedEventHook(),
|
||||
miniMapNodeDoubleClick: createExtendedEventHook(),
|
||||
miniMapNodeMouseEnter: createExtendedEventHook(),
|
||||
miniMapNodeMouseMove: createExtendedEventHook(),
|
||||
miniMapNodeMouseLeave: createExtendedEventHook(),
|
||||
connect: createExtendedEventHook(),
|
||||
connectStart: createExtendedEventHook(),
|
||||
connectEnd: createExtendedEventHook(),
|
||||
paneReady: createExtendedEventHook(),
|
||||
move: createExtendedEventHook(),
|
||||
moveStart: createExtendedEventHook(),
|
||||
moveEnd: createExtendedEventHook(),
|
||||
selectionDragStart: createExtendedEventHook(),
|
||||
selectionDrag: createExtendedEventHook(),
|
||||
selectionDragStop: createExtendedEventHook(),
|
||||
selectionContextMenu: createExtendedEventHook(),
|
||||
selectionStart: createExtendedEventHook(),
|
||||
selectionEnd: createExtendedEventHook(),
|
||||
viewportChangeStart: createExtendedEventHook(),
|
||||
viewportChange: createExtendedEventHook(),
|
||||
viewportChangeEnd: createExtendedEventHook(),
|
||||
paneScroll: createExtendedEventHook(),
|
||||
paneClick: createExtendedEventHook(),
|
||||
paneContextMenu: createExtendedEventHook(),
|
||||
paneMouseEnter: createExtendedEventHook(),
|
||||
paneMouseMove: createExtendedEventHook(),
|
||||
paneMouseLeave: createExtendedEventHook(),
|
||||
edgeContextMenu: createExtendedEventHook(),
|
||||
edgeMouseEnter: createExtendedEventHook(),
|
||||
edgeMouseMove: createExtendedEventHook(),
|
||||
edgeMouseLeave: createExtendedEventHook(),
|
||||
edgeDoubleClick: createExtendedEventHook(),
|
||||
edgeClick: createExtendedEventHook(),
|
||||
edgeUpdateStart: createExtendedEventHook(),
|
||||
edgeUpdate: createExtendedEventHook(),
|
||||
edgeUpdateEnd: createExtendedEventHook(),
|
||||
updateNodeInternals: createExtendedEventHook(),
|
||||
error: createExtendedEventHook((err) => warn(err.message)),
|
||||
})
|
||||
export function createHooks(): FlowHooks {
|
||||
return {
|
||||
edgesChange: createExtendedEventHook(),
|
||||
nodesChange: createExtendedEventHook(),
|
||||
nodeDoubleClick: createExtendedEventHook(),
|
||||
nodeClick: createExtendedEventHook(),
|
||||
nodeMouseEnter: createExtendedEventHook(),
|
||||
nodeMouseMove: createExtendedEventHook(),
|
||||
nodeMouseLeave: createExtendedEventHook(),
|
||||
nodeContextMenu: createExtendedEventHook(),
|
||||
nodeDragStart: createExtendedEventHook(),
|
||||
nodeDrag: createExtendedEventHook(),
|
||||
nodeDragStop: createExtendedEventHook(),
|
||||
nodesInitialized: createExtendedEventHook(),
|
||||
miniMapNodeClick: createExtendedEventHook(),
|
||||
miniMapNodeDoubleClick: createExtendedEventHook(),
|
||||
miniMapNodeMouseEnter: createExtendedEventHook(),
|
||||
miniMapNodeMouseMove: createExtendedEventHook(),
|
||||
miniMapNodeMouseLeave: createExtendedEventHook(),
|
||||
connect: createExtendedEventHook(),
|
||||
connectStart: createExtendedEventHook(),
|
||||
connectEnd: createExtendedEventHook(),
|
||||
paneReady: createExtendedEventHook(),
|
||||
move: createExtendedEventHook(),
|
||||
moveStart: createExtendedEventHook(),
|
||||
moveEnd: createExtendedEventHook(),
|
||||
selectionDragStart: createExtendedEventHook(),
|
||||
selectionDrag: createExtendedEventHook(),
|
||||
selectionDragStop: createExtendedEventHook(),
|
||||
selectionContextMenu: createExtendedEventHook(),
|
||||
selectionStart: createExtendedEventHook(),
|
||||
selectionEnd: createExtendedEventHook(),
|
||||
viewportChangeStart: createExtendedEventHook(),
|
||||
viewportChange: createExtendedEventHook(),
|
||||
viewportChangeEnd: createExtendedEventHook(),
|
||||
paneScroll: createExtendedEventHook(),
|
||||
paneClick: createExtendedEventHook(),
|
||||
paneContextMenu: createExtendedEventHook(),
|
||||
paneMouseEnter: createExtendedEventHook(),
|
||||
paneMouseMove: createExtendedEventHook(),
|
||||
paneMouseLeave: createExtendedEventHook(),
|
||||
edgeContextMenu: createExtendedEventHook(),
|
||||
edgeMouseEnter: createExtendedEventHook(),
|
||||
edgeMouseMove: createExtendedEventHook(),
|
||||
edgeMouseLeave: createExtendedEventHook(),
|
||||
edgeDoubleClick: createExtendedEventHook(),
|
||||
edgeClick: createExtendedEventHook(),
|
||||
edgeUpdateStart: createExtendedEventHook(),
|
||||
edgeUpdate: createExtendedEventHook(),
|
||||
edgeUpdateEnd: createExtendedEventHook(),
|
||||
updateNodeInternals: createExtendedEventHook(),
|
||||
error: createExtendedEventHook((err) => warn(err.message)),
|
||||
}
|
||||
}
|
||||
|
||||
export function useHooks(emit: (...args: any[]) => void, hooks: Ref<FlowHooks>) {
|
||||
onBeforeMount(() => {
|
||||
|
||||
@@ -25,114 +25,116 @@ export const defaultEdgeTypes: DefaultEdgeTypes = {
|
||||
simplebezier: SimpleBezierEdge,
|
||||
}
|
||||
|
||||
const defaultState = (): State => ({
|
||||
vueFlowRef: null,
|
||||
viewportRef: null,
|
||||
nodes: [],
|
||||
edges: [],
|
||||
nodeTypes: {},
|
||||
edgeTypes: {},
|
||||
function defaultState(): State {
|
||||
return {
|
||||
vueFlowRef: null,
|
||||
viewportRef: null,
|
||||
nodes: [],
|
||||
edges: [],
|
||||
nodeTypes: {},
|
||||
edgeTypes: {},
|
||||
|
||||
initialized: false,
|
||||
initialized: false,
|
||||
|
||||
dimensions: {
|
||||
width: 0,
|
||||
height: 0,
|
||||
},
|
||||
viewport: { x: 0, y: 0, zoom: 1 },
|
||||
dimensions: {
|
||||
width: 0,
|
||||
height: 0,
|
||||
},
|
||||
viewport: { x: 0, y: 0, zoom: 1 },
|
||||
|
||||
d3Zoom: null,
|
||||
d3Selection: null,
|
||||
d3ZoomHandler: null,
|
||||
minZoom: 0.5,
|
||||
maxZoom: 2,
|
||||
d3Zoom: null,
|
||||
d3Selection: null,
|
||||
d3ZoomHandler: null,
|
||||
minZoom: 0.5,
|
||||
maxZoom: 2,
|
||||
|
||||
translateExtent: [
|
||||
[Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY],
|
||||
[Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY],
|
||||
],
|
||||
nodeExtent: [
|
||||
[Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY],
|
||||
[Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY],
|
||||
],
|
||||
translateExtent: [
|
||||
[Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY],
|
||||
[Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY],
|
||||
],
|
||||
nodeExtent: [
|
||||
[Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY],
|
||||
[Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY],
|
||||
],
|
||||
|
||||
selectionMode: SelectionMode.Full,
|
||||
paneDragging: false,
|
||||
preventScrolling: true,
|
||||
zoomOnScroll: true,
|
||||
zoomOnPinch: true,
|
||||
zoomOnDoubleClick: true,
|
||||
panOnScroll: false,
|
||||
panOnScrollSpeed: 0.5,
|
||||
panOnScrollMode: PanOnScrollMode.Free,
|
||||
panOnDrag: true,
|
||||
edgeUpdaterRadius: 10,
|
||||
onlyRenderVisibleElements: false,
|
||||
defaultViewport: { x: 0, y: 0, zoom: 1 },
|
||||
selectionMode: SelectionMode.Full,
|
||||
paneDragging: false,
|
||||
preventScrolling: true,
|
||||
zoomOnScroll: true,
|
||||
zoomOnPinch: true,
|
||||
zoomOnDoubleClick: true,
|
||||
panOnScroll: false,
|
||||
panOnScrollSpeed: 0.5,
|
||||
panOnScrollMode: PanOnScrollMode.Free,
|
||||
panOnDrag: true,
|
||||
edgeUpdaterRadius: 10,
|
||||
onlyRenderVisibleElements: false,
|
||||
defaultViewport: { x: 0, y: 0, zoom: 1 },
|
||||
|
||||
nodesSelectionActive: false,
|
||||
userSelectionActive: false,
|
||||
nodesSelectionActive: false,
|
||||
userSelectionActive: false,
|
||||
|
||||
userSelectionRect: null,
|
||||
userSelectionRect: null,
|
||||
|
||||
defaultMarkerColor: '#b1b1b7',
|
||||
connectionLineStyle: {},
|
||||
connectionLineType: null,
|
||||
connectionLineOptions: {
|
||||
type: ConnectionLineType.Bezier,
|
||||
style: {},
|
||||
},
|
||||
connectionMode: ConnectionMode.Loose,
|
||||
connectionStartHandle: null,
|
||||
connectionClickStartHandle: null,
|
||||
connectionPosition: { x: NaN, y: NaN },
|
||||
connectionRadius: 20,
|
||||
connectOnClick: true,
|
||||
connectionStatus: null,
|
||||
isValidConnection: null,
|
||||
defaultMarkerColor: '#b1b1b7',
|
||||
connectionLineStyle: {},
|
||||
connectionLineType: null,
|
||||
connectionLineOptions: {
|
||||
type: ConnectionLineType.Bezier,
|
||||
style: {},
|
||||
},
|
||||
connectionMode: ConnectionMode.Loose,
|
||||
connectionStartHandle: null,
|
||||
connectionClickStartHandle: null,
|
||||
connectionPosition: { x: NaN, y: NaN },
|
||||
connectionRadius: 20,
|
||||
connectOnClick: true,
|
||||
connectionStatus: null,
|
||||
isValidConnection: null,
|
||||
|
||||
snapGrid: [15, 15],
|
||||
snapToGrid: false,
|
||||
snapGrid: [15, 15],
|
||||
snapToGrid: false,
|
||||
|
||||
edgesUpdatable: false,
|
||||
edgesFocusable: true,
|
||||
nodesFocusable: true,
|
||||
nodesConnectable: true,
|
||||
nodesDraggable: true,
|
||||
elementsSelectable: true,
|
||||
selectNodesOnDrag: true,
|
||||
multiSelectionActive: false,
|
||||
selectionKeyCode: 'Shift',
|
||||
multiSelectionKeyCode: 'Meta',
|
||||
zoomActivationKeyCode: 'Meta',
|
||||
deleteKeyCode: 'Backspace',
|
||||
panActivationKeyCode: 'Space',
|
||||
edgesUpdatable: false,
|
||||
edgesFocusable: true,
|
||||
nodesFocusable: true,
|
||||
nodesConnectable: true,
|
||||
nodesDraggable: true,
|
||||
elementsSelectable: true,
|
||||
selectNodesOnDrag: true,
|
||||
multiSelectionActive: false,
|
||||
selectionKeyCode: 'Shift',
|
||||
multiSelectionKeyCode: 'Meta',
|
||||
zoomActivationKeyCode: 'Meta',
|
||||
deleteKeyCode: 'Backspace',
|
||||
panActivationKeyCode: 'Space',
|
||||
|
||||
hooks: createHooks(),
|
||||
hooks: createHooks(),
|
||||
|
||||
applyDefault: true,
|
||||
autoConnect: false,
|
||||
applyDefault: true,
|
||||
autoConnect: false,
|
||||
|
||||
fitViewOnInit: false,
|
||||
noDragClassName: 'nodrag',
|
||||
noWheelClassName: 'nowheel',
|
||||
noPanClassName: 'nopan',
|
||||
defaultEdgeOptions: undefined,
|
||||
elevateEdgesOnSelect: false,
|
||||
elevateNodesOnSelect: true,
|
||||
fitViewOnInit: false,
|
||||
noDragClassName: 'nodrag',
|
||||
noWheelClassName: 'nowheel',
|
||||
noPanClassName: 'nopan',
|
||||
defaultEdgeOptions: undefined,
|
||||
elevateEdgesOnSelect: false,
|
||||
elevateNodesOnSelect: true,
|
||||
|
||||
autoPanOnNodeDrag: true,
|
||||
autoPanOnConnect: true,
|
||||
autoPanOnNodeDrag: true,
|
||||
autoPanOnConnect: true,
|
||||
|
||||
disableKeyboardA11y: false,
|
||||
ariaLiveMessage: '',
|
||||
disableKeyboardA11y: false,
|
||||
ariaLiveMessage: '',
|
||||
|
||||
__experimentalFeatures: {
|
||||
nestedFlow: false,
|
||||
},
|
||||
__experimentalFeatures: {
|
||||
nestedFlow: false,
|
||||
},
|
||||
|
||||
vueFlowVersion: typeof __VUE_FLOW_VERSION__ !== 'undefined' ? __VUE_FLOW_VERSION__ : '-',
|
||||
})
|
||||
vueFlowVersion: typeof __VUE_FLOW_VERSION__ !== 'undefined' ? __VUE_FLOW_VERSION__ : '-',
|
||||
}
|
||||
}
|
||||
|
||||
export function useState(opts?: FlowOptions): State {
|
||||
const state = defaultState()
|
||||
|
||||
Reference in New Issue
Block a user