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",
|
||||
|
||||
Reference in new issue
Block a user