编排补齐utools窗口交互和内容输入的功能

This commit is contained in:
fofolee
2025-01-09 17:55:50 +08:00
parent 036b6fa934
commit 682f6d0bcd
7 changed files with 338 additions and 102 deletions

View File

@@ -33,7 +33,7 @@ export const simulateCommands = {
],
},
{
value: "quickcomposer.simulate.sendText",
value: "utools.hideMainWindowTypeString",
label: "发送文本",
config: [
{
@@ -41,18 +41,73 @@ export const simulateCommands = {
label: "要发送的文本内容",
type: "varInput",
icon: "send",
width: 9,
width: 12,
},
],
subCommands: [
{
value: "utools.hideMainWindowTypeString",
label: "模拟输入",
icon: "keyboard",
},
{
label: "发送方式",
type: "select",
defaultValue: false,
icon: "keyboard",
options: [
{ label: "模拟输入", value: false },
{ label: "模拟粘贴", value: true },
value: "utools.hideMainWindowPasteText",
label: "模拟粘贴",
icon: "content_paste",
},
],
},
{
value: "utools.hideMainWindowPasteFile",
label: "模拟粘贴文件/图片",
icon: "file_copy",
subCommands: [
{
value: "utools.hideMainWindowPasteFile",
label: "粘贴文件",
icon: "file_copy",
config: [
{
key: "file",
label: "文件路径",
type: "varInput",
icon: "description",
width: 12,
options: {
dialog: {
type: "open",
options: {
title: "选择文件",
properties: [
"openFile",
"multiSelections",
"showHiddenFiles",
],
},
},
},
},
],
},
{
value: "utools.hideMainWindowPasteImage",
label: "粘贴图片",
icon: "image",
config: [
{
key: "image",
label: "图片路径/base64",
type: "varInput",
icon: "image",
width: 12,
options: {
dialog: {
title: "选择图片",
properties: ["openFile", "showHiddenFiles"],
},
},
},
],
width: 3,
},
],
},

View File

@@ -1,3 +1,5 @@
import { newVarInputVal } from "js/composer/varInputValManager";
export const utoolsCommands = {
label: "uTools功能",
icon: "insights",
@@ -83,5 +85,95 @@ export const utoolsCommands = {
},
],
},
{
value: "utools.findInPage",
label: "插件内查找",
desc: "插件内查找",
icon: "search",
subCommands: [
{
value: "utools.findInPage",
label: "查找文本",
desc: "查找文本",
icon: "search",
config: [
{
key: "text",
label: "文本",
type: "varInput",
icon: "search",
width: 12,
},
{
key: "options",
label: "选项",
type: "dictEditor",
icon: "settings",
options: {
fixedKeys: [
{
value: "forward",
label: "向前查找",
},
{
value: "findNext",
label: "查找下一个",
},
{
value: "matchCase",
label: "区分大小写",
},
{
value: "wordStart",
label: "单词开头",
},
{
value: "medialCapitalAsWordStart",
label: "中缀大写作为单词开头",
},
],
},
defaultValue: {
forward: newVarInputVal("var", "true"),
findNext: newVarInputVal("var", "false"),
matchCase: newVarInputVal("var", "false"),
wordStart: newVarInputVal("var", "false"),
medialCapitalAsWordStart: newVarInputVal("var", "false"),
},
width: 12,
},
],
},
{
value: "utools.stopFindInPage",
label: "停止查找",
desc: "停止查找",
icon: "stop",
config: [
{
key: "action",
label: "动作",
type: "buttonGroup",
icon: "settings",
width: 12,
options: [
{ label: "清除选择", value: "clearSelection" },
{ label: "保持选择", value: "keepSelection" },
{ label: "激活选择", value: "activateSelection" },
],
defaultValue: "clearSelection",
},
],
},
],
},
{
value: "utools.getWindowType",
label: "获取当前窗口类型",
desc: "获取当前窗口类型",
icon: "window",
outputVariable: "windowType",
saveOutput: true,
},
],
};