@a200888213/gbdocx 0.6.2 → 0.6.3
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/LICENSE +21 -21
- package/README.md +215 -215
- package/index.html +31 -30
- package/package.json +49 -48
- package/serve.mjs +27 -23
- package/src/app/word/file.js +191 -191
- package/src/app/word/menus.js +201 -201
- package/src/app/word/view.js +159 -159
- package/src/app/word-app.js +487 -487
- package/src/kernel/docx/catalog.js +41 -41
- package/src/kernel/docx/menus.js +348 -348
- package/src/kernel/docx/wordShortcuts.js +37 -37
- package/src/kernel/editor/engine/editor.js +213 -213
- package/src/kernel/editor/engine/search.js +113 -113
- package/src/kernel/editor/pasteClean.js +293 -293
- package/src/kernel/notify.js +54 -54
- package/src/kernel/util/clipboard.js +89 -89
- package/src/kernel/util/safeValue.js +25 -25
- package/src/surface/editor-surface.js +5 -2
- package/src/ui/context-menu.js +4 -2
- package/src/ui/dialogs.js +249 -249
- package/src/ui/icons.js +245 -137
- package/src/ui/popup.js +79 -79
- package/styles/app.css +970 -970
- package/styles/word-panel.css +410 -410
package/src/kernel/notify.js
CHANGED
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
// [文件] gbdocx·notify —— 轻量 toast 通知(success / error / warning / info;forModule 兼容旧调用形态)
|
|
2
|
-
|
|
3
|
-
const HOST_ID = 'gbdocx-notify-host';
|
|
4
|
-
|
|
5
|
-
/** 确保通知容器存在(固定右上角,逐条自上而下堆叠) */
|
|
6
|
-
function host() {
|
|
7
|
-
let el = document.getElementById(HOST_ID);
|
|
8
|
-
if (!el) {
|
|
9
|
-
el = document.createElement('div');
|
|
10
|
-
el.id = HOST_ID;
|
|
11
|
-
el.className = 'gbdocx-notify-host';
|
|
12
|
-
// 样式作用域:通知宿主挂 body,但仍须落在 .word-scope 子树里
|
|
13
|
-
const scope = document.createElement('div');
|
|
14
|
-
scope.className = 'word-scope';
|
|
15
|
-
scope.appendChild(el);
|
|
16
|
-
document.body.appendChild(scope);
|
|
17
|
-
}
|
|
18
|
-
return el;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
const ICONS = { success: '✓', error: '✕', warning: '!', info: 'i' };
|
|
22
|
-
|
|
23
|
-
function show(type, message, duration = 2600) {
|
|
24
|
-
const root = host();
|
|
25
|
-
const item = document.createElement('div');
|
|
26
|
-
item.className = `gbdocx-notify gbdocx-notify--${type}`;
|
|
27
|
-
const badge = document.createElement('span');
|
|
28
|
-
badge.className = 'gbdocx-notify__badge';
|
|
29
|
-
badge.textContent = ICONS[type] || 'i';
|
|
30
|
-
const text = document.createElement('span');
|
|
31
|
-
text.className = 'gbdocx-notify__text';
|
|
32
|
-
text.textContent = String(message ?? '');
|
|
33
|
-
item.append(badge, text);
|
|
34
|
-
root.appendChild(item);
|
|
35
|
-
requestAnimationFrame(() => item.classList.add('gbd-is-in'));
|
|
36
|
-
const close = () => {
|
|
37
|
-
item.classList.remove('gbd-is-in');
|
|
38
|
-
setTimeout(() => item.remove(), 200);
|
|
39
|
-
};
|
|
40
|
-
item.addEventListener('click', close);
|
|
41
|
-
if (duration > 0) setTimeout(close, duration);
|
|
42
|
-
return close;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export const notify = {
|
|
46
|
-
success: (message, duration) => show('success', message, duration),
|
|
47
|
-
error: (message, duration) => show('error', message, duration ?? 3600),
|
|
48
|
-
warning: (message, duration) => show('warning', message, duration ?? 3200),
|
|
49
|
-
info: (message, duration) => show('info', message, duration),
|
|
50
|
-
/** [兼容] 旧调用形态 notify.forModule('x'):模块只影响配色,这里忽略模块名 */
|
|
51
|
-
forModule: () => notify,
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
export default notify;
|
|
1
|
+
// [文件] gbdocx·notify —— 轻量 toast 通知(success / error / warning / info;forModule 兼容旧调用形态)
|
|
2
|
+
|
|
3
|
+
const HOST_ID = 'gbdocx-notify-host';
|
|
4
|
+
|
|
5
|
+
/** 确保通知容器存在(固定右上角,逐条自上而下堆叠) */
|
|
6
|
+
function host() {
|
|
7
|
+
let el = document.getElementById(HOST_ID);
|
|
8
|
+
if (!el) {
|
|
9
|
+
el = document.createElement('div');
|
|
10
|
+
el.id = HOST_ID;
|
|
11
|
+
el.className = 'gbdocx-notify-host';
|
|
12
|
+
// 样式作用域:通知宿主挂 body,但仍须落在 .word-scope 子树里
|
|
13
|
+
const scope = document.createElement('div');
|
|
14
|
+
scope.className = 'word-scope';
|
|
15
|
+
scope.appendChild(el);
|
|
16
|
+
document.body.appendChild(scope);
|
|
17
|
+
}
|
|
18
|
+
return el;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const ICONS = { success: '✓', error: '✕', warning: '!', info: 'i' };
|
|
22
|
+
|
|
23
|
+
function show(type, message, duration = 2600) {
|
|
24
|
+
const root = host();
|
|
25
|
+
const item = document.createElement('div');
|
|
26
|
+
item.className = `gbdocx-notify gbdocx-notify--${type}`;
|
|
27
|
+
const badge = document.createElement('span');
|
|
28
|
+
badge.className = 'gbdocx-notify__badge';
|
|
29
|
+
badge.textContent = ICONS[type] || 'i';
|
|
30
|
+
const text = document.createElement('span');
|
|
31
|
+
text.className = 'gbdocx-notify__text';
|
|
32
|
+
text.textContent = String(message ?? '');
|
|
33
|
+
item.append(badge, text);
|
|
34
|
+
root.appendChild(item);
|
|
35
|
+
requestAnimationFrame(() => item.classList.add('gbd-is-in'));
|
|
36
|
+
const close = () => {
|
|
37
|
+
item.classList.remove('gbd-is-in');
|
|
38
|
+
setTimeout(() => item.remove(), 200);
|
|
39
|
+
};
|
|
40
|
+
item.addEventListener('click', close);
|
|
41
|
+
if (duration > 0) setTimeout(close, duration);
|
|
42
|
+
return close;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export const notify = {
|
|
46
|
+
success: (message, duration) => show('success', message, duration),
|
|
47
|
+
error: (message, duration) => show('error', message, duration ?? 3600),
|
|
48
|
+
warning: (message, duration) => show('warning', message, duration ?? 3200),
|
|
49
|
+
info: (message, duration) => show('info', message, duration),
|
|
50
|
+
/** [兼容] 旧调用形态 notify.forModule('x'):模块只影响配色,这里忽略模块名 */
|
|
51
|
+
forModule: () => notify,
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export default notify;
|
|
@@ -1,89 +1,89 @@
|
|
|
1
|
-
// [通用:工具] copyText / pasteText / copyRich / readRich —— 剪贴板读写唯一通道(写入含非安全上下文降级,读取不可用时明确报错;copyRich 写 text/plain+text/html 双格式)【强制通道】
|
|
2
|
-
// [文件] web·clipboard·剪贴板读写统一入口
|
|
3
|
-
import { notify as globalNotify } from '../notify.js';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* @param {string} text 待复制内容,空值直接失败返回
|
|
7
|
-
* @param {string} tip 成功提示文案
|
|
8
|
-
* @param {object} notifier 通知实例(调用方模块作用域实例,缺省用全局 notify)
|
|
9
|
-
*/
|
|
10
|
-
export async function copyText(text, tip = '已复制', notifier = globalNotify) {
|
|
11
|
-
if (!text) {
|
|
12
|
-
notifier.error('没有可复制的内容');
|
|
13
|
-
return false;
|
|
14
|
-
}
|
|
15
|
-
try {
|
|
16
|
-
await writeClipboard(text);
|
|
17
|
-
notifier.success(tip);
|
|
18
|
-
return true;
|
|
19
|
-
} catch (e) {
|
|
20
|
-
notifier.error(`复制失败:${e?.message || e}`);
|
|
21
|
-
return false;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/** 读剪贴板(粘贴):仅安全上下文可用,不可用时抛错由调用方提示 */
|
|
26
|
-
export async function pasteText() {
|
|
27
|
-
if (!navigator.clipboard?.readText) throw new Error('当前访问方式不支持读取剪贴板,请手动粘贴');
|
|
28
|
-
return navigator.clipboard.readText();
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* 写富文本剪贴板(text/plain + text/html 双格式):表格等结构化内容复制用。
|
|
33
|
-
* ClipboardItem 不可用(非安全上下文/旧浏览器/权限拒绝)时降级为纯文本写入。
|
|
34
|
-
*/
|
|
35
|
-
export async function copyRich(text, html, tip = '已复制', notifier = globalNotify) {
|
|
36
|
-
if (!text && !html) {
|
|
37
|
-
notifier.error('没有可复制的内容');
|
|
38
|
-
return false;
|
|
39
|
-
}
|
|
40
|
-
try {
|
|
41
|
-
await navigator.clipboard.write([
|
|
42
|
-
new ClipboardItem({
|
|
43
|
-
'text/plain': new Blob([text || ''], { type: 'text/plain' }),
|
|
44
|
-
'text/html': new Blob([html || text || ''], { type: 'text/html' }),
|
|
45
|
-
}),
|
|
46
|
-
]);
|
|
47
|
-
notifier.success(tip);
|
|
48
|
-
return true;
|
|
49
|
-
} catch {
|
|
50
|
-
try {
|
|
51
|
-
await writeClipboard(text || '');
|
|
52
|
-
notifier.success(tip);
|
|
53
|
-
return true;
|
|
54
|
-
} catch (e) {
|
|
55
|
-
notifier.error(`复制失败:${e?.message || e}`);
|
|
56
|
-
return false;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
/** 读剪贴板双格式(粘贴):返回 { text, html }(可能其一为空);剪贴板读取不可用时抛错 */
|
|
62
|
-
export async function readRich() {
|
|
63
|
-
if (!navigator.clipboard?.read) throw new Error('当前访问方式不支持读取剪贴板,请手动粘贴');
|
|
64
|
-
const items = await navigator.clipboard.read();
|
|
65
|
-
let text = '';
|
|
66
|
-
let html = '';
|
|
67
|
-
for (const item of items) {
|
|
68
|
-
if (!html && item.types.includes('text/html')) html = await (await item.getType('text/html')).text();
|
|
69
|
-
if (!text && item.types.includes('text/plain')) text = await (await item.getType('text/plain')).text();
|
|
70
|
-
}
|
|
71
|
-
if (!text && !html) throw new Error('剪贴板没有可粘贴的内容');
|
|
72
|
-
return { text, html };
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
// [坑] navigator.clipboard 只在安全上下文(HTTPS / localhost / 127.0.0.1)存在:经局域网 IP 访问、
|
|
76
|
-
// 或部分桌面壳 webview 下整个对象是 undefined,直调 writeText 即 TypeError。
|
|
77
|
-
// 降级走 execCommand('copy'),须在用户手势的同步调用栈内完成 select+copy(本函数 await 前不跨宏任务)。
|
|
78
|
-
async function writeClipboard(text) {
|
|
79
|
-
if (navigator.clipboard?.writeText) return navigator.clipboard.writeText(text);
|
|
80
|
-
const area = document.createElement('textarea');
|
|
81
|
-
area.value = text;
|
|
82
|
-
area.readOnly = true;
|
|
83
|
-
area.style.cssText = 'position:fixed;top:0;left:0;opacity:0';
|
|
84
|
-
document.body.appendChild(area);
|
|
85
|
-
area.select();
|
|
86
|
-
const copied = document.execCommand('copy');
|
|
87
|
-
area.remove();
|
|
88
|
-
if (!copied) throw new Error('当前浏览器不支持自动复制,请手动选取复制');
|
|
89
|
-
}
|
|
1
|
+
// [通用:工具] copyText / pasteText / copyRich / readRich —— 剪贴板读写唯一通道(写入含非安全上下文降级,读取不可用时明确报错;copyRich 写 text/plain+text/html 双格式)【强制通道】
|
|
2
|
+
// [文件] web·clipboard·剪贴板读写统一入口
|
|
3
|
+
import { notify as globalNotify } from '../notify.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @param {string} text 待复制内容,空值直接失败返回
|
|
7
|
+
* @param {string} tip 成功提示文案
|
|
8
|
+
* @param {object} notifier 通知实例(调用方模块作用域实例,缺省用全局 notify)
|
|
9
|
+
*/
|
|
10
|
+
export async function copyText(text, tip = '已复制', notifier = globalNotify) {
|
|
11
|
+
if (!text) {
|
|
12
|
+
notifier.error('没有可复制的内容');
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
try {
|
|
16
|
+
await writeClipboard(text);
|
|
17
|
+
notifier.success(tip);
|
|
18
|
+
return true;
|
|
19
|
+
} catch (e) {
|
|
20
|
+
notifier.error(`复制失败:${e?.message || e}`);
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/** 读剪贴板(粘贴):仅安全上下文可用,不可用时抛错由调用方提示 */
|
|
26
|
+
export async function pasteText() {
|
|
27
|
+
if (!navigator.clipboard?.readText) throw new Error('当前访问方式不支持读取剪贴板,请手动粘贴');
|
|
28
|
+
return navigator.clipboard.readText();
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* 写富文本剪贴板(text/plain + text/html 双格式):表格等结构化内容复制用。
|
|
33
|
+
* ClipboardItem 不可用(非安全上下文/旧浏览器/权限拒绝)时降级为纯文本写入。
|
|
34
|
+
*/
|
|
35
|
+
export async function copyRich(text, html, tip = '已复制', notifier = globalNotify) {
|
|
36
|
+
if (!text && !html) {
|
|
37
|
+
notifier.error('没有可复制的内容');
|
|
38
|
+
return false;
|
|
39
|
+
}
|
|
40
|
+
try {
|
|
41
|
+
await navigator.clipboard.write([
|
|
42
|
+
new ClipboardItem({
|
|
43
|
+
'text/plain': new Blob([text || ''], { type: 'text/plain' }),
|
|
44
|
+
'text/html': new Blob([html || text || ''], { type: 'text/html' }),
|
|
45
|
+
}),
|
|
46
|
+
]);
|
|
47
|
+
notifier.success(tip);
|
|
48
|
+
return true;
|
|
49
|
+
} catch {
|
|
50
|
+
try {
|
|
51
|
+
await writeClipboard(text || '');
|
|
52
|
+
notifier.success(tip);
|
|
53
|
+
return true;
|
|
54
|
+
} catch (e) {
|
|
55
|
+
notifier.error(`复制失败:${e?.message || e}`);
|
|
56
|
+
return false;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/** 读剪贴板双格式(粘贴):返回 { text, html }(可能其一为空);剪贴板读取不可用时抛错 */
|
|
62
|
+
export async function readRich() {
|
|
63
|
+
if (!navigator.clipboard?.read) throw new Error('当前访问方式不支持读取剪贴板,请手动粘贴');
|
|
64
|
+
const items = await navigator.clipboard.read();
|
|
65
|
+
let text = '';
|
|
66
|
+
let html = '';
|
|
67
|
+
for (const item of items) {
|
|
68
|
+
if (!html && item.types.includes('text/html')) html = await (await item.getType('text/html')).text();
|
|
69
|
+
if (!text && item.types.includes('text/plain')) text = await (await item.getType('text/plain')).text();
|
|
70
|
+
}
|
|
71
|
+
if (!text && !html) throw new Error('剪贴板没有可粘贴的内容');
|
|
72
|
+
return { text, html };
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// [坑] navigator.clipboard 只在安全上下文(HTTPS / localhost / 127.0.0.1)存在:经局域网 IP 访问、
|
|
76
|
+
// 或部分桌面壳 webview 下整个对象是 undefined,直调 writeText 即 TypeError。
|
|
77
|
+
// 降级走 execCommand('copy'),须在用户手势的同步调用栈内完成 select+copy(本函数 await 前不跨宏任务)。
|
|
78
|
+
async function writeClipboard(text) {
|
|
79
|
+
if (navigator.clipboard?.writeText) return navigator.clipboard.writeText(text);
|
|
80
|
+
const area = document.createElement('textarea');
|
|
81
|
+
area.value = text;
|
|
82
|
+
area.readOnly = true;
|
|
83
|
+
area.style.cssText = 'position:fixed;top:0;left:0;opacity:0';
|
|
84
|
+
document.body.appendChild(area);
|
|
85
|
+
area.select();
|
|
86
|
+
const copied = document.execCommand('copy');
|
|
87
|
+
area.remove();
|
|
88
|
+
if (!copied) throw new Error('当前浏览器不支持自动复制,请手动选取复制');
|
|
89
|
+
}
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
// [文件] web·safe value 工具(链接协议策略 / 图片协议白名单 / 字体名净化)
|
|
2
|
-
// [通用:安全] isSafeHref / SAFE_IMG / sanitizeFontName —— 正文取值白名单唯一源(编辑内核与 docx 编解码共用,禁各自再写一份)
|
|
3
|
-
//
|
|
4
|
-
// [口径] 判定机制在 guabiutils(剥控制符 + 协议白名单),本文件只声明**文档这一侧**的策略:
|
|
5
|
-
// 「允许哪些协议」是产品决策,改这里;「怎么判定」改 guabiutils,不要在这里重写。
|
|
6
|
-
|
|
7
|
-
import { DEFAULT_HREF_PROTOCOLS, isSafeHref as isSafeHrefWith } from 'guabiutils';
|
|
8
|
-
|
|
9
|
-
export { sanitizeFontName } from 'guabiutils';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* 文档侧链接协议白名单:默认(http / https / mailto / tel)+ ftp。
|
|
13
|
-
* [口径] 存量 docx 里有 ftp 链接,收紧会让它们退化成不可点文本,所以文档侧显式多放行 ftp;
|
|
14
|
-
* 默认那一段直接引用 guabiutils,基线变了这里跟着变。
|
|
15
|
-
*/
|
|
16
|
-
export const DOC_HREF_PROTOCOLS = [...DEFAULT_HREF_PROTOCOLS, 'ftp'];
|
|
17
|
-
|
|
18
|
-
/** 图片协议白名单:链接白名单去掉对图片无意义的 mailto/tel/# —— 粘贴清洗与装载共用这一条 */
|
|
19
|
-
export const SAFE_IMG = /^(?:https?:|data:image\/|blob:|\/)/i;
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* 链接地址能否进 href:命中白名单的绝对地址;不含协议冒号的相对形式(应用内路径)放行
|
|
23
|
-
* @param {string} href
|
|
24
|
-
*/
|
|
25
|
-
export const isSafeHref = (href) => isSafeHrefWith(href, { protocols: DOC_HREF_PROTOCOLS });
|
|
1
|
+
// [文件] web·safe value 工具(链接协议策略 / 图片协议白名单 / 字体名净化)
|
|
2
|
+
// [通用:安全] isSafeHref / SAFE_IMG / sanitizeFontName —— 正文取值白名单唯一源(编辑内核与 docx 编解码共用,禁各自再写一份)
|
|
3
|
+
//
|
|
4
|
+
// [口径] 判定机制在 guabiutils(剥控制符 + 协议白名单),本文件只声明**文档这一侧**的策略:
|
|
5
|
+
// 「允许哪些协议」是产品决策,改这里;「怎么判定」改 guabiutils,不要在这里重写。
|
|
6
|
+
|
|
7
|
+
import { DEFAULT_HREF_PROTOCOLS, isSafeHref as isSafeHrefWith } from 'guabiutils';
|
|
8
|
+
|
|
9
|
+
export { sanitizeFontName } from 'guabiutils';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* 文档侧链接协议白名单:默认(http / https / mailto / tel)+ ftp。
|
|
13
|
+
* [口径] 存量 docx 里有 ftp 链接,收紧会让它们退化成不可点文本,所以文档侧显式多放行 ftp;
|
|
14
|
+
* 默认那一段直接引用 guabiutils,基线变了这里跟着变。
|
|
15
|
+
*/
|
|
16
|
+
export const DOC_HREF_PROTOCOLS = [...DEFAULT_HREF_PROTOCOLS, 'ftp'];
|
|
17
|
+
|
|
18
|
+
/** 图片协议白名单:链接白名单去掉对图片无意义的 mailto/tel/# —— 粘贴清洗与装载共用这一条 */
|
|
19
|
+
export const SAFE_IMG = /^(?:https?:|data:image\/|blob:|\/)/i;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* 链接地址能否进 href:命中白名单的绝对地址;不含协议冒号的相对形式(应用内路径)放行
|
|
23
|
+
* @param {string} href
|
|
24
|
+
*/
|
|
25
|
+
export const isSafeHref = (href) => isSafeHrefWith(href, { protocols: DOC_HREF_PROTOCOLS });
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
|
|
4
4
|
import { EditorCore } from '../kernel/editor/engine/editor.js';
|
|
5
5
|
import { isRuntimeBlock } from '../kernel/editor/engine/dom.js';
|
|
6
|
+
import { GripVertical, ZoomIn } from 'gbicons/nodes';
|
|
7
|
+
import { iconNodeSvg } from 'gbicons/nodes';
|
|
6
8
|
import { overlayOrigin, PROBE_WIDTH } from '../kernel/editor/overlayGeometry.js';
|
|
7
9
|
|
|
8
10
|
/** 内容上报防抖(ms):按键只置脏,序列化交给拖尾防抖;失焦与卸载立即落地 */
|
|
@@ -20,8 +22,9 @@ const TABLE_MOVE_GAP = 6;
|
|
|
20
22
|
const TABLE_MOVE_THRESHOLD = 4;
|
|
21
23
|
/** 分页运行期栏容器类名(与 pagination.js 同契约):落点要穿透到栏内正文块 */
|
|
22
24
|
const COL_CLASS = 'wd-col';
|
|
23
|
-
|
|
24
|
-
const
|
|
25
|
+
/* 图标字形取自 lucide(ZoomIn / GripVertical),共享序列化器出串 */
|
|
26
|
+
const ZOOM_ICON = iconNodeSvg(ZoomIn, { size: 14, sw: 2 });
|
|
27
|
+
const MOVE_ICON = iconNodeSvg(GripVertical, { size: 14 });
|
|
25
28
|
|
|
26
29
|
export class EditorSurface {
|
|
27
30
|
/**
|
package/src/ui/context-menu.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
// [文件] gbdocx·ContextMenu —— 右键/下拉菜单渲染(条目口径:label/icon/disabled/checked/colorDot/shortcut/divided/children/input/onClick)
|
|
2
|
+
import { Check, ChevronRight } from 'gbicons/nodes';
|
|
3
|
+
import { iconNodeSvg } from 'gbicons/nodes';
|
|
2
4
|
import { openPopup } from './popup.js';
|
|
3
5
|
import { icon } from './icons.js';
|
|
4
6
|
|
|
5
|
-
const CHECK =
|
|
6
|
-
const SUB =
|
|
7
|
+
const CHECK = iconNodeSvg(Check, { size: 14, sw: 2.4 });
|
|
8
|
+
const SUB = iconNodeSvg(ChevronRight, { size: 12, sw: 2.2 });
|
|
7
9
|
|
|
8
10
|
/**
|
|
9
11
|
* 打开菜单
|