From 662d7eae7758e6898ab28dc4df1aedacfef0df2f Mon Sep 17 00:00:00 2001 From: qiqi Date: Wed, 4 Nov 2026 17:00:49 +0800 Subject: [PATCH] =?UTF-8?q?feat(image-annotate):=20=E9=80=89=E5=8C=BA?= =?UTF-8?q?=E7=BC=96=E8=BE=91=20+=20=E4=BE=BF=E5=88=A9=E7=89=88=20UI=20+?= =?UTF-8?q?=20=E5=8D=95=E5=BC=A0=E8=BE=93=E5=87=BA=E9=A2=84=E8=AE=BE?= =?UTF-8?q?=EF=BC=881.1.0=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- image-annotate/README.md | 35 +- image-annotate/docs/PS_LITE_ROADMAP.md | 371 +++++ image-annotate/package.json | 2 +- image-annotate/plugin/editor.css | 138 ++ image-annotate/plugin/editor/commands.js | 73 + image-annotate/plugin/editor/dom.js | 74 +- image-annotate/plugin/editor/events.js | 208 ++- image-annotate/plugin/editor/export.js | 213 +++ image-annotate/plugin/editor/floating.js | 111 ++ image-annotate/plugin/editor/history.js | 340 +++-- image-annotate/plugin/editor/index.js | 131 +- image-annotate/plugin/editor/layers.js | 14 +- image-annotate/plugin/editor/placement.js | 48 +- image-annotate/plugin/editor/selection.js | 421 ++++++ image-annotate/plugin/editor/state.js | 19 +- image-annotate/plugin/editor/tools.js | 29 +- image-annotate/plugin/editor/viewport.js | 23 +- image-annotate/plugin/glue.js | 1 + image-annotate/plugin/manifest.banner.js | 8 + image-annotate/src/index.js | 1586 +++++++++++++++++++-- image-annotate/tools/e2e-site.mjs | 41 +- image-annotate/tools/harness.mjs | 252 ++++ 22 files changed, 3795 insertions(+), 343 deletions(-) create mode 100644 image-annotate/docs/PS_LITE_ROADMAP.md create mode 100644 image-annotate/plugin/editor/commands.js create mode 100644 image-annotate/plugin/editor/export.js create mode 100644 image-annotate/plugin/editor/floating.js create mode 100644 image-annotate/plugin/editor/selection.js create mode 100644 image-annotate/tools/harness.mjs diff --git a/image-annotate/README.md b/image-annotate/README.md index f621ec0..24a2cf5 100644 --- a/image-annotate/README.md +++ b/image-annotate/README.md @@ -1,11 +1,15 @@ # 标注 / 修图(插件) -在宿主里选中一个带图的节点,打开**全屏标注编辑器**(画笔 / 矩形 / 箭头 / 文字 / 橡皮 / 吸管 / 抓手 / 裁剪, -图层、撤销重做、缩放平移),导出后**覆盖原节点**或**新建一个节点**。 +在宿主里选中一个带图的节点,打开**全屏单张图片编辑器**:画笔 / 矩形 / 箭头 / 文字 / 橡皮 / 吸管 / 抓手 / 裁剪, +外加 **v1.1 的框选与套索选区**(复制/剪切到新层、清除、填充、反选、羽化、选区旁浮动操作条)、 +图层、撤销重做、缩放平移;一次只处理一张、一次只输出一个结果(覆盖原节点 / 新建节点 / 下载)。 -编辑器**移植自** `iwb-plaus` 仓库的 `iwb-cutout-extension`(纯 Canvas 2D、零第三方库): +编辑器**最初移植自** `iwb-plaus` 仓库的 `iwb-cutout-extension`(纯 Canvas 2D、零第三方库): - 源:`/Users/qiqi/open/github/iwb-plaus/iwb-cutout-extension/src/editor/`(11 个模块)+ `src/shared/{image-math,layer-logic}.js` -- 差异:只有「宿主胶水」(`plugin/glue.js`、`plugin/entry.js`)是新写的;编辑器模块与样式**逐字移植**,便于日后回灌上游 —— **例外见下两节**(`loadImage` 的 CSP 适配、v1.0.5 的图层顺序修复)。 +- 差异:只有「宿主胶水」(`plugin/glue.js`、`plugin/entry.js`)是新写的;编辑器模块与样式最初逐字移植 —— **例外见下几节**(`loadImage` 的 CSP 适配、v1.0.5 的图层顺序修复、v1.1 的独立演进)。 +- ⚠️ **v1.1 起正式分叉、独立演进**:新增命令层 / 选区 / 输出管道 / 便利版 UI 与三张独立交互层, + 并重写了历史快照模型(支持图层增删的可撤销恢复)。**不要再整目录回灌上游**,会冲掉 1.0.5 与 1.1.0 的全部修复。 + 目标与分期见 `docs/PS_LITE_ROADMAP.md`。 - 原扩展的 CSS 由 `manifest.json` 的 `content_scripts.css` 注入;插件没有 manifest,改为构建时以字符串内联、运行时注入 `