Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
f2d461c
feat(entities-plugins): add datakit branch node schema and UI scaffol…
Justineo Sep 29, 2025
4202488
feat(entities-plugins): hook datakit branch form into store serializa…
Justineo Sep 29, 2025
ff06d26
feat(entities-plugins): persist datakit branch groups and UI data
Justineo Sep 30, 2025
aa0011b
feat(entities-plugins): render datakit branch groups in flow canvas
Justineo Sep 30, 2025
d7a4033
feat(entities-plugins): expose datakit branch handles and store actions
Justineo Sep 30, 2025
3273bc2
refactor(entities-plugins): extract datakit branch group manager
Justineo Sep 30, 2025
38fcade
feat(entities-plugins): polish datakit branch group node visuals
Justineo Oct 1, 2025
667b572
feat(entities-plugins): integrate datakit branch groups into flow run…
Justineo Oct 2, 2025
e3ab652
feat(entities-plugins): add datakit branch member validation and conf…
Justineo Oct 2, 2025
bfeb13c
refactor(entities-plugins): consolidate datakit branch helpers
Justineo Oct 3, 2025
5b9d42c
refactor(entities-plugins): prune datakit branch scaffolding
Justineo Oct 4, 2025
6072c35
feat(entities-plugins): enhance datakit branch target multiselect
Justineo Oct 4, 2025
1094126
feat(entities-plugins): add datakit node visuals and badge styling
Justineo Oct 4, 2025
433a819
fix(entities-plugins): extend datakit compat schema for branch nodes
Justineo Oct 5, 2025
f364a27
refactor(entities-plugins): extract datakit branch node form composable
Justineo Oct 6, 2025
1e9608c
fix(entities-plugins): default datakit branch form selections
Justineo Oct 6, 2025
e24287c
refactor(entities-plugins): document and refine datakit branch flow
Justineo Oct 6, 2025
8c8aca9
feat(entities-plugins): add datakit branch conflict guards
Justineo Oct 6, 2025
59a35f1
refactor(entities-plugins): streamline datakit branch store wiring
Justineo Oct 6, 2025
3cec98a
refactor(entities-plugins): clean datakit branch layout interactions
Justineo Oct 7, 2025
136a5c2
refactor(entities-plugins): streamline datakit node dragging
Justineo Oct 8, 2025
caaa0a9
feat(entities-plugins): add datakit branch layout runtime
Justineo Oct 8, 2025
f84749f
fix(entities-plugins): make datakit branch handles read-only
Justineo Oct 9, 2025
807d81a
fix(entities-plugins): fix node z-index calculation
Justineo Oct 9, 2025
b7ed4f1
refactor(entities-plugins): enhance node and group handle styling and…
Justineo Oct 9, 2025
42f0cdc
refactor(entities-plugins): update branch layout constants and improv…
Justineo Oct 9, 2025
b1d2bea
refactor(entities-plugins): reorganize graph-related functions and im…
Justineo Oct 10, 2025
5db29cd
fix(entities-plugins): ensure group layout changes are committed when…
Justineo Oct 10, 2025
58165c4
fix(entities-plugins): deselect selected node when clicking group nodes
Justineo Oct 10, 2025
914b3c6
refactor(entities-plugins): simplify code and optimize EnhancedInput …
Justineo Oct 11, 2025
92584e6
feat(entities-plugins): add isNodeType function and update generateNo…
Justineo Oct 11, 2025
e764b08
refactor(entities-plugins): remove unused isConfigType import from he…
Justineo Oct 13, 2025
41167d4
refactor(entities-plugins): rename PendingGroupLayout to GroupLayout …
Justineo Oct 13, 2025
ffed45b
docs(entities-plugins): add more comments for datakit useBranchLayout
Justineo Oct 13, 2025
e462241
refactor(entities-plugins): improve code readability
Justineo Oct 13, 2025
70f1d34
refactor(entities-plugins): update dimensions type to use Dimensions …
Justineo Oct 16, 2025
de65d27
refactor(entities-plugins): add visuals for implicit nodes, improve n…
Justineo Oct 16, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { KeySpec } from './flow-editor/utils'

import { KUI_SPACE_40 } from '@kong/design-tokens'
import { KUI_SPACE_40, KUI_SPACE_90 } from '@kong/design-tokens'

export const DK_HEADER_HEIGHT = 44
export const DK_SIDE_PANEL_WIDTH = 220
Expand Down Expand Up @@ -63,3 +63,11 @@ export const HOTKEYS = {
paste: ['Mod', 'V'],
duplicate: ['Mod', 'D'],
} as const satisfies Record<string, KeySpec>

export const DK_FLOW_Z_LAYER_STEP = 1
export const DK_FLOW_GROUP_Z_OFFSET = 0
export const DK_FLOW_EDGE_Z_OFFSET = 1
export const DK_FLOW_BRANCH_EDGE_Z_OFFSET = 2
export const DK_FLOW_NODE_Z_OFFSET = 3

export const DK_BRANCH_GROUP_PADDING = parseInt(KUI_SPACE_90, 10)
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,16 @@
</Controls>

<!-- To not use the default node style -->
<template #node-flow="node">
<template #node-flow="{ data }">
<FlowNode
:data="node.data"
:error="invalidConfigNodeIds.has(node.data.id)"
:data
:error="invalidConfigNodeIds.has(data.id)"
:readonly="mode !== 'edit'"
/>
</template>
<template #node-group="{ data }">
<GroupNode :data />
</template>
</VueFlow>

<div
Expand All @@ -76,6 +79,7 @@ import { KTooltip } from '@kong/kongponents'
import { Background } from '@vue-flow/background'
import { ControlButton, Controls } from '@vue-flow/controls'
import { VueFlow } from '@vue-flow/core'
import type { NodeMouseEvent } from '@vue-flow/core'
import { useElementBounding, useEventListener, useTimeoutFn } from '@vueuse/core'
import { computed, nextTick, ref, useTemplateRef } from 'vue'

Expand All @@ -84,6 +88,7 @@ import { DK_DATA_TRANSFER_MIME_TYPE } from '../constants'
import { useHotkeys } from './composables/useHotkeys'
import { MAX_ZOOM_LEVEL, MIN_ZOOM_LEVEL } from './constants'
import FlowNode from './node/FlowNode.vue'
import GroupNode from './node/GroupNode.vue'
import { provideFlowStore } from './store/flow'

import '@vue-flow/controls/dist/style.css'
Expand Down Expand Up @@ -141,8 +146,16 @@ const { project, vueFlowRef, zoomIn, zoomOut, viewport, maxZoom, minZoom } = vue

const disableDrop = ref(false)

function onNodeClick() {
if (mode !== 'edit') return
function onNodeClick(event: NodeMouseEvent) {
if (mode !== 'edit') {
return
}

if (event?.node?.type === 'group') {
selectNode(undefined)
return
}

propertiesPanelOpen.value = true
}

Expand Down Expand Up @@ -289,11 +302,11 @@ defineExpose({ autoLayout, fitView })

&:not(.readonly) {
:deep(.vue-flow__node) {
&:hover:not(:has(.value-indicator:hover)) .flow-node {
&:hover:not(:has(.value-indicator:hover)) .dk-flow-node {
border-color: $kui-color-border-primary-weak;
}

&.selected .flow-node {
&.selected .dk-flow-node {
border-color: $kui-color-border-primary;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import { provideEditorStore } from '../composables'
import FlowPanels from './FlowPanels.vue'
import EditorModal from './modal/EditorModal.vue'

import type { ConfigNode, DatakitConfig, DatakitPluginData, DatakitUIData, UINode } from '../types'
import type { ConfigNode, DatakitConfig, DatakitPluginData, DatakitUIData } from '../types'

const { t } = createI18n<typeof english>('en-us', english)

Expand All @@ -49,10 +49,13 @@ const emit = defineEmits<{
error: [msg: string]
}>()

function onChange(configNodes: ConfigNode[], uiNodes: UINode[], resources: DatakitConfig['resources']) {
function onChange(configNodes: ConfigNode[], uiData: DatakitUIData, resources: DatakitConfig['resources']) {
const nextConfig = { ...formData.config, nodes: configNodes }
if (resources !== undefined) nextConfig.resources = resources
const nextUIData = { ...formData.__ui_data, nodes: uiNodes }
const nextUIData: DatakitUIData = {
...formData.__ui_data,
...uiData,
}
formData.config = nextConfig
formData.__ui_data = nextUIData
emit('change', nextConfig, nextUIData)
Expand Down
Loading
Loading