From fe1d3fcaa686c6f68df5b16f0e0bd2018a03cf82 Mon Sep 17 00:00:00 2001 From: qiqi Date: Thu, 19 Nov 2026 15:01:23 +0800 Subject: [PATCH] =?UTF-8?q?feat(image-vectorize):=20=E9=A1=B6=E6=A0=8F?= =?UTF-8?q?=E3=80=8C=E5=8F=96=E6=B6=88=E3=80=8D=E6=94=B9=E3=80=8C=E5=85=B3?= =?UTF-8?q?=E9=97=AD=E3=80=8D=E5=B9=B6=E6=8C=89=E4=B8=BB=E8=89=B2=E8=B0=83?= =?UTF-8?q?=E5=8F=96=E8=89=B2=EF=BC=9B=E8=A1=A5=E5=90=8C=E6=AD=A5=E5=85=A8?= =?UTF-8?q?=E5=B1=8F=E5=88=B0=E6=BA=90=E7=A0=81=20v0.6.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - ui.js: 顶栏最右按钮 data-act=cancel 文本「取消」→「关闭」,加 class vz-btn-close(行为不变) - ui.css: 新增 .vz-btn-close 用编辑器主色调 #33566f(.vz-seg 选中态同款)填充 + #eaf6ff 文字,与左边三颗灰色产出按钮区分;hover/active 提亮 - ⚠ 重要修正:0.5.0 的全屏改动当时只改了产物 src/index.js,源码 plugin/ui.css 没同步(仍是 92vw 居中卡片)—— 若将来 build 会回退。本次把全屏(100vw×100vh、去圆角/阴影/边框)补进 plugin/ui.css 源码 + 重新 build 产物,源码与产物一致。 - version 0.5.0→0.6.0(package.json,build 注入 banner) - build image-vectorize 通过,validate 10/10 --- image-vectorize/package.json | 2 +- image-vectorize/plugin/ui.css | 30 +++++++++++++++++++----------- image-vectorize/plugin/ui.js | 2 +- image-vectorize/src/index.js | 16 ++++++++++++---- 4 files changed, 33 insertions(+), 17 deletions(-) diff --git a/image-vectorize/package.json b/image-vectorize/package.json index 498e7e0..b0aaa0e 100644 --- a/image-vectorize/package.json +++ b/image-vectorize/package.json @@ -1,7 +1,7 @@ { "name": "@iwb-plugin/image-vectorize", "private": true, - "version": "0.5.0", + "version": "0.6.0", "description": "位图转矢量:potrace(纯 JS)单色/灰度描摹,输出 SVG 与 PNG 节点;对文字、logo、线稿保形好,不需要 wasm", "ibwPlugin": { "id": "image-vectorize", diff --git a/image-vectorize/plugin/ui.css b/image-vectorize/plugin/ui.css index 679c578..d8153ca 100644 --- a/image-vectorize/plugin/ui.css +++ b/image-vectorize/plugin/ui.css @@ -16,15 +16,15 @@ .vz-modal { display: flex; flex-direction: column; - width: 92vw; - height: 88vh; - min-width: 760px; - min-height: 520px; - max-width: 1680px; + width: 100vw; + height: 100vh; + min-width: 0; + min-height: 0; + max-width: none; background: #1b1b22; - border: 1px solid #33333f; - border-radius: 12px; - box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55); + border: 0; + border-radius: 0; + box-shadow: none; overflow: hidden; } @@ -75,8 +75,16 @@ .vz-btn:hover { background: #34343f; border-color: #4a4a5c; } .vz-btn:active { background: #2f2f3a; } .vz-btn:disabled { opacity: 0.45; cursor: default; } -/* 顶栏四颗按钮统一走上面这套描边配色(曾经有一颗 .vz-btn-primary 绿色主按钮, - 2026-11-09 用户要求「颜色都用取消按钮的配色」,已去掉)。 */ +/* 顶栏「保存为节点 / 复制 SVG / 下载 SVG」三颗走上面这套灰色描边配色。 + 「关闭」单独用编辑器主色调(.vz-seg 选中态同款 #33566f)填充,与产出操作区分、防误点。 + 2026-11-19:原「取消」改名「关闭」并按主色调取色(行为不变,仍是 data-act="cancel" 退出编辑器)。 */ +.vz-btn-close { + background: #33566f; + border-color: #33566f; + color: #eaf6ff; +} +.vz-btn-close:hover { background: #3d6480; border-color: #4a7394; } +.vz-btn-close:active { background: #2c4a60; } /* ---------- 主体 ---------- */ .vz-body { @@ -512,7 +520,7 @@ /* 窄屏:面板转到底部 */ @media (max-width: 900px) { - .vz-modal { width: 96vw; height: 92vh; min-width: 0; } + .vz-modal { width: 100vw; height: 100vh; min-width: 0; } .vz-body { flex-direction: column; } .vz-panel { width: auto; max-height: 46%; border-left: 0; border-top: 1px solid #2e2e3a; } } diff --git a/image-vectorize/plugin/ui.js b/image-vectorize/plugin/ui.js index c9378f0..ed189a5 100644 --- a/image-vectorize/plugin/ui.js +++ b/image-vectorize/plugin/ui.js @@ -133,7 +133,7 @@ function viewHTML(name) { '' + '' + '' + - '' + + '' + '' + '
' + '
' + diff --git a/image-vectorize/src/index.js b/image-vectorize/src/index.js index 51d37ee..aeb3c91 100644 --- a/image-vectorize/src/index.js +++ b/image-vectorize/src/index.js @@ -9,7 +9,7 @@ var __IWB_VECTORIZE_MANIFEST__ = { id: 'image-vectorize', name: '位图转矢量', - version: '0.5.0', + version: '0.6.0', apiVersion: 1, capabilities: ['commands', 'nodeActions', 'canvas', 'canvasWrite'], settings: { @@ -2082,8 +2082,16 @@ var __IWB_VECTORIZE_MANIFEST__ = { .vz-btn:hover { background: #34343f; border-color: #4a4a5c; } .vz-btn:active { background: #2f2f3a; } .vz-btn:disabled { opacity: 0.45; cursor: default; } -/* 顶栏四颗按钮统一走上面这套描边配色(曾经有一颗 .vz-btn-primary 绿色主按钮, - 2026-11-09 用户要求「颜色都用取消按钮的配色」,已去掉)。 */ +/* 顶栏「保存为节点 / 复制 SVG / 下载 SVG」三颗走上面这套灰色描边配色。 + 「关闭」单独用编辑器主色调(.vz-seg 选中态同款 #33566f)填充,与产出操作区分、防误点。 + 2026-11-19:原「取消」改名「关闭」并按主色调取色(行为不变,仍是 data-act="cancel" 退出编辑器)。 */ +.vz-btn-close { + background: #33566f; + border-color: #33566f; + color: #eaf6ff; +} +.vz-btn-close:hover { background: #3d6480; border-color: #4a7394; } +.vz-btn-close:active { background: #2c4a60; } /* ---------- 主体 ---------- */ .vz-body { @@ -3016,7 +3024,7 @@ var __IWB_VECTORIZE_MANIFEST__ = { }).join("") + '
按孤岛拆分每个连通块一个图层,粘到 Figma 可单独选中;笔画不连的汉字会分成几块
– 元素– 层––
阈值自动按直方图取,手动可救极端图
反相黑底白字时打开
' + segHTML("invert", [["0", "正片"], ["1", "负片"]], params.invert ? 1 : 0) + '
填充 / 背景填充仅「纯单色」生效 · 背景作预览底
"; } function viewHTML(name) { - return '
'; + return '
'; } var ALPHA_TONE = { hard: 0.4, normal: 1, round: 1.2 }; var toneOf = (alphaMax) => alphaMax <= 0.6 ? "hard" : alphaMax >= 1.1 ? "round" : "normal";