From 4694edf6263371a5745b678b7b02bcbdd242436f Mon Sep 17 00:00:00 2001 From: "Ricardo M." Date: Wed, 8 Jan 2025 11:08:52 +0100 Subject: [PATCH] chore: Add experimental features to VS Code Kaoto --- CHANGELOG.md | 1 + package.json | 15 +++++++++++++++ src/webview/VSCodeKaotoEditorChannelApi.ts | 8 +++++++- 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5b9748d..7fc7099 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ - Fix Kaoto Datamapper editor on Windows (issue when attaching an xsd) - Upgrade to Kaoto 2.4.0-RC1 +- Add the possibility to enable experimental features (drag & drop) # 2.3.0 diff --git a/package.json b/package.json index 1615e4e..3ddb9c7 100644 --- a/package.json +++ b/package.json @@ -152,6 +152,21 @@ "id" ], "scope": "window" + }, + "kaoto.nodeToolbarTrigger": { + "type": "string", + "default": "onHover", + "markdownDescription": "Choose when to open the Node toolbar. Can be either `onHover` or `onSelection`. If `onHover` is selected, the toolbar will be automatically open upon hoevring a node, otherwise, it will be open when selecting a node", + "enum": [ + "onHover", + "onSelection" + ] + }, + "kaoto.enableDragAndDrop": { + "type": "boolean", + "default": false, + "markdownDescription": "Control whether to enable drag and drop feature", + "tags": ["experimental"] } } }, diff --git a/src/webview/VSCodeKaotoEditorChannelApi.ts b/src/webview/VSCodeKaotoEditorChannelApi.ts index d685113..ce5510a 100644 --- a/src/webview/VSCodeKaotoEditorChannelApi.ts +++ b/src/webview/VSCodeKaotoEditorChannelApi.ts @@ -1,5 +1,5 @@ import { KaotoEditorChannelApi } from '@kaoto/kaoto'; -import { ISettingsModel, NodeLabelType, SettingsModel } from '@kaoto/kaoto/models'; +import { ISettingsModel, NodeLabelType, NodeToolbarTrigger, SettingsModel } from '@kaoto/kaoto/models'; import { BackendProxy } from '@kie-tools-core/backend/dist/api'; import { I18n } from '@kie-tools-core/i18n/dist/core'; import { NotificationsChannelApi } from "@kie-tools-core/notifications/dist/api"; @@ -39,10 +39,16 @@ export class VSCodeKaotoEditorChannelApi extends DefaultVsCodeKieEditorChannelAp async getVSCodeKaotoSettings(): Promise { const catalogUrl = await vscode.workspace.getConfiguration('kaoto').get>('catalog.url'); const nodeLabel = await vscode.workspace.getConfiguration('kaoto').get>('nodeLabel'); + const nodeToolbarTrigger = await vscode.workspace.getConfiguration('kaoto').get>('nodeToolbarTrigger'); + const enableDragAndDrop = await vscode.workspace.getConfiguration('kaoto').get>('enableDragAndDrop'); const settingsModel: Partial = { catalogUrl: catalogUrl ?? '', nodeLabel: nodeLabel ?? NodeLabelType.Description, + nodeToolbarTrigger: nodeToolbarTrigger ?? NodeToolbarTrigger.onHover, + experimentalFeatures: { + enableDragAndDrop: enableDragAndDrop ?? false, + }, }; return new SettingsModel(settingsModel);