fix(plugin): 图片处理动作只在 ref 节点出现(不再挂 gen/out/layer)
- image-annotate 1.0.2 / white-bg-800 1.0.1 / xianyi-cutout 1.0.2 - 产图节点一个可能有多张结果或多个图层,getNodeImage 只能取 result[0],漂浮菜单里放「编辑图片」会被误读成「编辑结果图」;先「复制/插入为参考图节点」 - 命令面板通道不受影响(仍可显式调用)
This commit is contained in:
1 parent
9e09a48285
commit
75876f92be
10 files changed
+17
-14
No files matched your search
@@ -16,7 +16,8 @@
|
||||
> 这类问题**只有带 CSP 的真站能测出来**(无 CSP 的 mock 页永远绿)。真实站点用例见 `image-annotate/tools/e2e-site.mjs`。
|
||||
|
||||
## 入口
|
||||
- **节点漂浮菜单**「标注 / 修图」(`ref` / `out` / `gen` / `layer` 节点)
|
||||
- **节点漂浮菜单**「标注 / 修图」(**仅 `ref` 图片输入节点**)
|
||||
- `out` / `gen` / `layer` 是产图节点:一个节点可能有多张结果或多个图层,`getNodeImage` 只能取 `result[0]`,在漂浮菜单放「编辑图片」会被误读成「编辑结果图」。要处理产出的图,先「复制 / 插入为参考图节点」。
|
||||
- 右键菜单「插件命令 → 标注 / 修图:选中节点」
|
||||
|
||||
导出后由编辑器自己 `close()`:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@iwb-plugin/image-annotate",
|
||||
"private": true,
|
||||
"version": "1.0.1",
|
||||
"version": "1.0.2",
|
||||
"description": "IWB 插件:图片标注 / 修图(编辑器移植自 iwb-plaus 扩展,纯 Canvas 2D)",
|
||||
"ibwPlugin": {
|
||||
"id": "image-annotate",
|
||||
|
||||
@@ -94,10 +94,12 @@ export function createGlue(ctx, css) {
|
||||
})
|
||||
}
|
||||
|
||||
// 图片承载类型:ref / out(参考实现同款)+ gen / layer(宿主 isImageProducer 认定的产图类型)。
|
||||
// 只在图片输入节点(ref)暴露:out/gen/layer 是产图节点,一个节点可能有多张结果或多个图层,
|
||||
// getNodeImage 只能取 result[0],在漂浮菜单里放"编辑图片"会被误读成"编辑结果图"。
|
||||
// 产图节点要处理图片,先「复制 / 插入为参考图节点」。
|
||||
function appliesTo(node) {
|
||||
if (!node) return false
|
||||
return node.type === 'ref' || node.type === 'out' || node.type === 'gen' || node.type === 'layer'
|
||||
return node.type === 'ref'
|
||||
}
|
||||
|
||||
ctx.nodeActions.register({
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
var __IWB_ANNOTATE_MANIFEST__ = {
|
||||
id: 'image-annotate',
|
||||
name: '标注 / 修图',
|
||||
version: '1.0.1',
|
||||
version: '1.0.2',
|
||||
apiVersion: 1,
|
||||
capabilities: ['commands', 'nodeActions', 'canvas', 'canvasWrite'],
|
||||
}
|
||||
@@ -4575,7 +4575,7 @@ var __IWB_ANNOTATE_MANIFEST__ = {
|
||||
}
|
||||
function appliesTo(node) {
|
||||
if (!node) return false;
|
||||
return node.type === "ref" || node.type === "out" || node.type === "gen" || node.type === "layer";
|
||||
return node.type === "ref";
|
||||
}
|
||||
ctx.nodeActions.register({
|
||||
id: "annotate-node",
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
- 上游的批量处理 / 下载 / 剪贴板等能力不在本插件范围。
|
||||
|
||||
## 入口
|
||||
- **节点漂浮菜单**「白底图」(`ref` / `out` / `gen` 节点)
|
||||
- **节点漂浮菜单**「白底图」(**仅 `ref` 图片输入节点**;产图节点先「复制 / 插入为参考图节点」)
|
||||
- 右键菜单「插件命令 → 白底图:选中节点」
|
||||
|
||||
## 设置
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@iwb-plugin/white-bg-800",
|
||||
"private": true,
|
||||
"version": "1.0.0",
|
||||
"version": "1.0.1",
|
||||
"description": "白底图:把节点图等比缩放居中合成到正方形画布(白底/透明底),输出 <name>_<size>x<size>.png",
|
||||
"ibwPlugin": { "id": "white-bg-800", "entry": "src/index.js", "apiVersion": 1 }
|
||||
}
|
||||
@@ -34,7 +34,7 @@
|
||||
global.IWBPluginHost.register({
|
||||
id: 'white-bg-800',
|
||||
name: '白底图',
|
||||
version: '1.0.0',
|
||||
version: '1.0.1',
|
||||
apiVersion: 1,
|
||||
capabilities: ['commands', 'canvas', 'canvasWrite', 'nodeActions'],
|
||||
settings: {
|
||||
@@ -114,7 +114,7 @@
|
||||
id: 'white-bg-node',
|
||||
title: '白底图',
|
||||
icon: 'fit',
|
||||
appliesTo: function (node) { return Boolean(node) && (node.type === 'ref' || node.type === 'out' || node.type === 'gen') },
|
||||
appliesTo: function (node) { return Boolean(node) && node.type === 'ref' },
|
||||
run: function (node) { return runOne(node.id, node.name) },
|
||||
})
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ Content-Type: application/octet-stream # 原始图片字节;无 token、无 JS
|
||||
比原扩展多做的:**补齐了超时**(`AbortController` + 可配 `timeoutMs`,原版没有任何超时)。
|
||||
|
||||
## 入口
|
||||
- **节点漂浮菜单**「抠图」(选中 ref / out 节点时出现)
|
||||
- **节点漂浮菜单**「抠图」(**仅 ref 图片输入节点**时出现;产图节点先「复制 / 插入为参考图节点」)
|
||||
- 右键菜单「插件命令 → 抠图:选中节点」
|
||||
|
||||
## 设置
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@iwb-plugin/xianyi-cutout",
|
||||
"private": true,
|
||||
"version": "1.0.1",
|
||||
"version": "1.0.2",
|
||||
"description": "鲜艺抠图:调用本机 30092 的 /rmbg 把节点图抠成透明底",
|
||||
"ibwPlugin": { "id": "xianyi-cutout", "entry": "src/index.js", "apiVersion": 1 }
|
||||
}
|
||||
@@ -37,7 +37,7 @@
|
||||
global.IWBPluginHost.register({
|
||||
id: 'xianyi-cutout',
|
||||
name: '鲜艺抠图',
|
||||
version: '1.0.1',
|
||||
version: '1.0.2',
|
||||
apiVersion: 1,
|
||||
capabilities: ['commands', 'canvas', 'canvasWrite', 'nodeActions'],
|
||||
settings: {
|
||||
@@ -98,7 +98,7 @@
|
||||
id: 'cutout-node',
|
||||
title: '抠图',
|
||||
icon: 'ref',
|
||||
appliesTo: function (node) { return Boolean(node) && (node.type === 'ref' || node.type === 'out') },
|
||||
appliesTo: function (node) { return Boolean(node) && node.type === 'ref' },
|
||||
run: function (node) { return cutoutOne(node.id) },
|
||||
})
|
||||
|
||||
|
||||
Reference in new issue
Block a user