@paircode/tool-art 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client.js +9 -12
- package/index.js +8 -8
- package/package.json +1 -1
package/client.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// tool-art — client
|
|
1
|
+
// tool-art — client 半:注册「画板」主内容区视图并注入 bundle
|
|
2
2
|
//
|
|
3
3
|
// ★ 2026-09-17 合并:本插件原本拆成 tool-art(工具面)+ ui-art(UI 面)两个独立
|
|
4
4
|
// 发布包,同属一个创作域却分两处维护(版本/文档/发布各一份,且用户看不出「AI 用的
|
|
@@ -10,8 +10,12 @@
|
|
|
10
10
|
// 区域发现对「同包同时含 dsh.ui + dsh.ui.build」的包生效,与工具面共存无冲突)。
|
|
11
11
|
// external 共享核心(Vue/api 等)从 window.__PAIRCODE_CORE 取。
|
|
12
12
|
//
|
|
13
|
-
//
|
|
14
|
-
//
|
|
13
|
+
// ★ 2026-09-18:不再注册进「插件面板」(ui.registerPanel)—— 那是壳级逃生口的
|
|
14
|
+
// 管理/总览区(docs/plugin-development.md §12 分工表),六域是「编辑器式工作台」,
|
|
15
|
+
// 主内容区视图(ui.registerView)才是它的位置。此前两处同时注册:插件面板里多一个
|
|
16
|
+
// 重复入口,且两处各 mount 一份 Vue 实例(状态不同步)。现只保留 view。
|
|
17
|
+
//
|
|
18
|
+
// 与其余五域同构:只注册主内容区视图(不动壳、纯加法,卸载插件即消失)。
|
|
15
19
|
(ui) => {
|
|
16
20
|
const GLOBAL = 'ArtPanel'
|
|
17
21
|
const JS = 'plugins-assets/tool-art/assets/art-panel.js'
|
|
@@ -26,20 +30,13 @@
|
|
|
26
30
|
document.head.appendChild(link)
|
|
27
31
|
}
|
|
28
32
|
|
|
29
|
-
//
|
|
33
|
+
// 注册视图(bundle 就绪时立即注册;否则先注入 script,onload 后注册)
|
|
30
34
|
const register = () => {
|
|
31
35
|
const bundle = window[GLOBAL]
|
|
32
36
|
if (!bundle || typeof bundle.mount !== 'function') return false
|
|
33
|
-
ui.
|
|
34
|
-
id: 'art-panel',
|
|
35
|
-
title: '画板',
|
|
36
|
-
icon: 'grid',
|
|
37
|
-
render: (el) => bundle.mount(el),
|
|
38
|
-
})
|
|
39
|
-
// ★ 中间区域视图(2026-09 ui.registerView):与「对话 / 编辑器 / 市场 / 工具集」
|
|
37
|
+
// ★ 主内容区视图(2026-09 ui.registerView):与「对话 / 编辑器 / 市场 / 工具集」
|
|
40
38
|
// 同级的主内容区 tab。open:true → 默认以「后台 tab」形式出现,不抢占对话主视图
|
|
41
39
|
// (mainTab 仍是 conversation),点 tab 才激活;可与对话并排(「并排对话」按钮)。
|
|
42
|
-
// 与上面的插件面板共用同一 bundle(render 每次调用各建独立 Vue 实例)。
|
|
43
40
|
ui.registerView({
|
|
44
41
|
id: 'art-view',
|
|
45
42
|
title: '画板',
|
package/index.js
CHANGED
|
@@ -2009,7 +2009,7 @@ var TOOL_DEFS = [
|
|
|
2009
2009
|
parameters: {
|
|
2010
2010
|
type: 'object',
|
|
2011
2011
|
properties: {
|
|
2012
|
-
path: { type: 'string', description: '工程文件路径(默认 art.project.json
|
|
2012
|
+
path: { type: 'string', description: '工程文件路径(默认 <主项目根>/art.project.json;相对主项目根解析,跨项目传绝对路径)' },
|
|
2013
2013
|
mode: { type: 'string', description: 'create(新建)| show(默认,查看摘要)| update(改画布属性)' },
|
|
2014
2014
|
title: { type: 'string', description: '可选:画板标题' },
|
|
2015
2015
|
width: { type: 'integer', description: '可选:画布宽(像素,1..8192,默认 800)' },
|
|
@@ -2029,7 +2029,7 @@ var TOOL_DEFS = [
|
|
|
2029
2029
|
parameters: {
|
|
2030
2030
|
type: 'object',
|
|
2031
2031
|
properties: {
|
|
2032
|
-
path: { type: 'string', description: '可选:工程路径(默认 art.project.json
|
|
2032
|
+
path: { type: 'string', description: '可选:工程路径(默认 <主项目根>/art.project.json;相对主项目根解析)' },
|
|
2033
2033
|
ops: { type: 'array', description: '编辑命令数组(按顺序应用)' },
|
|
2034
2034
|
op: { type: 'string', description: '可选:单条 op 名(与同层参数合成为一条命令)' },
|
|
2035
2035
|
ids: { type: 'array', description: '可选:目标图元 id 数组' },
|
|
@@ -2048,8 +2048,8 @@ var TOOL_DEFS = [
|
|
|
2048
2048
|
parameters: {
|
|
2049
2049
|
type: 'object',
|
|
2050
2050
|
properties: {
|
|
2051
|
-
path: { type: 'string', description: '要导入的 SVG
|
|
2052
|
-
out: { type: 'string', description: '可选:输出的工程路径(默认 art.project.json
|
|
2051
|
+
path: { type: 'string', description: '要导入的 SVG 文件路径(相对主项目根解析,跨项目传绝对路径)' },
|
|
2052
|
+
out: { type: 'string', description: '可选:输出的工程路径(默认 <主项目根>/art.project.json;相对主项目根解析)' },
|
|
2053
2053
|
title: { type: 'string', description: '可选:画板标题(默认取 SVG 的 <title>)' },
|
|
2054
2054
|
overwrite: { type: 'boolean', description: '可选:目标工程已存在时是否覆盖(默认 false)' },
|
|
2055
2055
|
},
|
|
@@ -2064,9 +2064,9 @@ var TOOL_DEFS = [
|
|
|
2064
2064
|
parameters: {
|
|
2065
2065
|
type: 'object',
|
|
2066
2066
|
properties: {
|
|
2067
|
-
path: { type: 'string', description: '可选:工程路径(默认 art.project.json
|
|
2067
|
+
path: { type: 'string', description: '可选:工程路径(默认 <主项目根>/art.project.json;相对主项目根解析)' },
|
|
2068
2068
|
format: { type: 'string', description: '产物格式:svg(默认,矢量文本产物);png 会返回替代路径说明(沙箱无渲染器)' },
|
|
2069
|
-
out: { type: 'string', description: '可选:输出路径(默认 art.svg
|
|
2069
|
+
out: { type: 'string', description: '可选:输出路径(默认 <主项目根>/art.svg;相对主项目根解析)' },
|
|
2070
2070
|
},
|
|
2071
2071
|
},
|
|
2072
2072
|
},
|
|
@@ -2078,8 +2078,8 @@ var TOOL_DEFS = [
|
|
|
2078
2078
|
parameters: {
|
|
2079
2079
|
type: 'object',
|
|
2080
2080
|
properties: {
|
|
2081
|
-
path: { type: 'string', description: '可选:工程路径(默认 art.project.json
|
|
2082
|
-
report: { type: 'string', description: '可选:旁挂校验报告路径(默认 art.verify.json)' },
|
|
2081
|
+
path: { type: 'string', description: '可选:工程路径(默认 <主项目根>/art.project.json;相对主项目根解析)' },
|
|
2082
|
+
report: { type: 'string', description: '可选:旁挂校验报告路径(默认 <主项目根>/art.verify.json)' },
|
|
2083
2083
|
minContrast: { type: 'number', description: '可选:文本对比度统一阈值(默认按 WCAG:4.5,大字 3.0)' },
|
|
2084
2084
|
},
|
|
2085
2085
|
},
|