Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
center-book
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
center-book
Commits
2f38b3c8
提交
2f38b3c8
authored
7月 22, 2026
作者:
王鹏飞
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor(admin): host inline editor dialogs
上级
a24389d3
显示空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
32 行增加
和
73 行删除
+32
-73
FeatureDialog.jsx
...ommon/wangeditor-customer/features/link/FeatureDialog.jsx
+8
-0
feature.js
...n/src/common/wangeditor-customer/features/link/feature.js
+5
-1
node.js
...dmin/src/common/wangeditor-customer/features/link/node.js
+3
-2
FeatureDialog.jsx
...on/wangeditor-customer/features/tooltip/FeatureDialog.jsx
+8
-0
feature.js
...rc/common/wangeditor-customer/features/tooltip/feature.js
+5
-1
node.js
...n/src/common/wangeditor-customer/features/tooltip/node.js
+3
-2
WangEditorCustomer.jsx
...c/common/wangeditor-customer/shell/WangEditorCustomer.jsx
+0
-67
没有找到文件。
apps/admin/src/common/wangeditor-customer/features/link/FeatureDialog.jsx
0 → 100644
浏览文件 @
2f38b3c8
import
{
Modal
}
from
'antd'
import
LinkDialog
from
'./LinkDialog'
export
default
function
LinkFeatureDialog
({
open
,
onClose
,
payload
,
runtime
})
{
return
<
Modal
open=
{
open
}
footer=
{
null
}
centered
destroyOnHidden
title=
"链接"
classNames=
{
{
header
:
'editor-header-customer'
,
body
:
'editor-body-customer'
,
wrapper
:
'editor-wrapper-customer'
}
}
maskClosable=
{
false
}
onCancel=
{
onClose
}
>
<
LinkDialog
editor=
{
runtime
.
editor
}
chapterId=
{
runtime
.
chapterId
}
bookId=
{
runtime
.
bookId
}
gData=
{
runtime
.
gData
}
linkInfo=
{
payload
}
selectionSize=
{
payload
.
selectionSize
||
18
}
setLinkInfo=
{
()
=>
{}
}
setLinkVisible=
{
visible
=>
!
visible
&&
onClose
()
}
/>
</
Modal
>
}
apps/admin/src/common/wangeditor-customer/features/link/feature.js
浏览文件 @
2f38b3c8
import
{
defineEditorFeature
}
from
'../../core/define-editor-feature'
import
menu
from
'./menu'
import
nodeModule
from
'./node'
import
{
openEditorDialog
}
from
'../../core/editor-dialog'
import
{
getSelectionFontSize
}
from
'../../core/selection'
import
LinkFeatureDialog
from
'./FeatureDialog'
export
default
defineEditorFeature
({
id
:
'link'
,
menus
:
[{
order
:
120
,
config
:
menu
}],
nodeModules
:
[{
order
:
110
,
types
:
[
'chapterLink'
],
module
:
nodeModule
}],
events
:
[{
name
:
'CustomerLinkClick'
,
handler
:
({
runtime
})
=>
{
runtime
.
captureSelectionFontSize
();
runtime
.
openLink
()
}
}],
dialogs
:
[{
id
:
'link.insert'
,
component
:
LinkFeatureDialog
},
{
id
:
'link.edit'
,
component
:
LinkFeatureDialog
}],
events
:
[{
name
:
'CustomerLinkClick'
,
handler
:
({
editor
})
=>
openEditorDialog
(
editor
,
'link.insert'
,
{
selectionSize
:
getSelectionFontSize
(
editor
)
})
}],
})
apps/admin/src/common/wangeditor-customer/features/link/node.js
浏览文件 @
2f38b3c8
...
...
@@ -3,6 +3,7 @@ import icon_tooltip_editor from "@/assets/images/editor/icon_tooltip_editor.png"
import
{
h
}
from
"snabbdom"
;
import
iconLink
from
"@/assets/images/editor/icon_link_editor.png"
;
import
"../../utils/iconfont"
;
import
{
openEditorDialog
}
from
'../../core/editor-dialog'
const
withChapterLinkNode
=
(
editor
)
=>
{
const
{
isInline
,
isVoid
,
normalizeNode
}
=
editor
;
...
...
@@ -90,7 +91,7 @@ const renderChapterLink = (elem, children, editor) => {
ev
.
stopPropagation
();
ev
.
preventDefault
();
editor
.
emit
(
"wangeditor-customer:legacy-dialog"
,
{
key
:
"linkNum"
,
payload
:
{
openEditorDialog
(
editor
,
'link.edit'
,
{
title
,
linktype
,
random
:
random
,
...
...
@@ -99,7 +100,7 @@ const renderChapterLink = (elem, children, editor) => {
chapters
,
theme
,
fontsize
,
}
});
}
)
}
/* 其他... */
,
},
},
...
...
apps/admin/src/common/wangeditor-customer/features/tooltip/FeatureDialog.jsx
0 → 100644
浏览文件 @
2f38b3c8
import
{
Modal
}
from
'antd'
import
TooltipDialog
from
'./TooltipDialog'
export
default
function
TooltipFeatureDialog
({
open
,
onClose
,
payload
,
runtime
})
{
return
<
Modal
open=
{
open
}
footer=
{
null
}
centered
destroyOnHidden
title=
"气泡"
classNames=
{
{
header
:
'editor-header-customer'
,
body
:
'editor-body-customer'
,
wrapper
:
'editor-wrapper-customer'
}
}
maskClosable=
{
false
}
onCancel=
{
onClose
}
>
<
TooltipDialog
editor=
{
runtime
.
editor
}
chapterId=
{
runtime
.
chapterId
}
bookId=
{
runtime
.
bookId
}
tooltipInfo=
{
payload
}
selectionSize=
{
payload
.
selectionSize
||
18
}
setTooltipInfo=
{
()
=>
{}
}
setTooltipVisible=
{
visible
=>
!
visible
&&
onClose
()
}
/>
</
Modal
>
}
apps/admin/src/common/wangeditor-customer/features/tooltip/feature.js
浏览文件 @
2f38b3c8
import
{
defineEditorFeature
}
from
'../../core/define-editor-feature'
import
menu
from
'./menu'
import
nodeModule
from
'./node'
import
{
openEditorDialog
}
from
'../../core/editor-dialog'
import
{
getSelectionFontSize
}
from
'../../core/selection'
import
TooltipFeatureDialog
from
'./FeatureDialog'
export
default
defineEditorFeature
({
id
:
'tooltip'
,
menus
:
[{
order
:
70
,
config
:
menu
}],
nodeModules
:
[{
order
:
100
,
types
:
[
'chapterTooltip'
],
module
:
nodeModule
}],
events
:
[{
name
:
'TooltipMenuClick'
,
handler
:
({
runtime
})
=>
{
runtime
.
captureSelectionFontSize
();
runtime
.
openTooltip
()
}
}],
dialogs
:
[{
id
:
'tooltip.insert'
,
component
:
TooltipFeatureDialog
},
{
id
:
'tooltip.edit'
,
component
:
TooltipFeatureDialog
}],
events
:
[{
name
:
'TooltipMenuClick'
,
handler
:
({
editor
})
=>
openEditorDialog
(
editor
,
'tooltip.insert'
,
{
selectionSize
:
getSelectionFontSize
(
editor
)
})
}],
})
apps/admin/src/common/wangeditor-customer/features/tooltip/node.js
浏览文件 @
2f38b3c8
...
...
@@ -3,6 +3,7 @@ import icon_tooltip_editor from "@/assets/images/editor/icon_tooltip_editor.png"
import
{
h
}
from
"snabbdom"
;
import
"../../utils/iconfont"
;
import
{
escapeHtml
}
from
"../../utils/html"
;
import
{
openEditorDialog
}
from
'../../core/editor-dialog'
const
withChapterTooltipNode
=
(
editor
)
=>
{
const
{
isInline
,
isVoid
,
normalizeNode
}
=
editor
;
...
...
@@ -118,7 +119,7 @@ const renderChapterTooltip = (elem, children, editor) => {
ev
.
stopPropagation
();
ev
.
preventDefault
();
editor
.
emit
(
"wangeditor-customer:legacy-dialog"
,
{
key
:
"tooltipNum"
,
payload
:
{
openEditorDialog
(
editor
,
'tooltip.edit'
,
{
title
,
tooltipType
,
random
:
random
,
...
...
@@ -127,7 +128,7 @@ const renderChapterTooltip = (elem, children, editor) => {
content
,
i
:
Math
.
random
(),
fontsize
,
}
});
}
)
}
/* 其他... */
,
},
},
...
...
apps/admin/src/common/wangeditor-customer/shell/WangEditorCustomer.jsx
浏览文件 @
2f38b3c8
...
...
@@ -24,8 +24,6 @@ dayjs.extend(relativeTime);
import
PracticeModal
from
"../features/practice/PracticeInsertDialog"
;
import
TooltipModal
from
"../features/tooltip/TooltipDialog"
;
import
LinkModal
from
"../features/link/LinkDialog"
;
import
ExpandModal
from
"../features/expand-read/ExpandReadDialog"
;
import
PracticeSettingModal
from
"../features/practice/PracticeSettingsDialog"
;
...
...
@@ -71,10 +69,6 @@ const WangEditorCustomer = (props, ref) => {
const
[
practiceOpenVisible
,
setPracticeOpenVisible
]
=
useState
(
false
);
// 练习
const
[
practiceVisible
,
setPracticeVisible
]
=
useState
(
false
);
// 练习答题设置
const
[
tooltipVisible
,
setTooltipVisible
]
=
useState
(
false
);
// 气泡框
const
[
tooltipInfo
,
setTooltipInfo
]
=
useState
({});
// 气泡框
const
[
linkVisible
,
setLinkVisible
]
=
useState
(
false
);
// 气泡框
const
[
linkInfo
,
setLinkInfo
]
=
useState
({});
// 气泡框
const
[
expandVisible
,
setExpandVisible
]
=
useState
(
false
);
// 扩展阅读
const
[
expandInfo
,
setExpandInfo
]
=
useState
({});
// 扩展阅读内容
...
...
@@ -88,12 +82,6 @@ const WangEditorCustomer = (props, ref) => {
const
{
practiceNum
,
title
,
theme
}
=
payload
;
dispatch
(
setPracticeRandom
({
practiceNum
,
practiceTitle
:
title
,
practiceTheme
:
theme
}));
setPracticeVisible
(
true
);
}
else
if
(
key
===
"tooltipNum"
)
{
setTooltipInfo
(
payload
);
setTooltipVisible
(
true
);
}
else
if
(
key
===
"linkNum"
)
{
setLinkInfo
(
payload
);
setLinkVisible
(
true
);
}
else
if
(
key
===
"chapterExpand"
)
{
setExpandInfo
(
payload
);
setExpandVisible
(
true
);
...
...
@@ -222,7 +210,6 @@ const WangEditorCustomer = (props, ref) => {
],
};
const
tooltipRef
=
useRef
();
const
practiceRef
=
useRef
();
const
practiceSettingRef
=
useRef
();
const
previewRef
=
useRef
();
...
...
@@ -311,8 +298,6 @@ const WangEditorCustomer = (props, ref) => {
const
featureRuntime
=
{
openPractice
:
()
=>
setPracticeOpenVisible
(
true
),
openTooltip
:
()
=>
setTooltipVisible
(
true
),
openLink
:
()
=>
setLinkVisible
(
true
),
openExpandRead
:
()
=>
setExpandVisible
(
true
),
captureSelectionFontSize
:
()
=>
{
if
(
editor
?.
selection
)
listenNodeStyle
(
editor
.
selection
.
anchor
.
path
)
...
...
@@ -425,58 +410,6 @@ const WangEditorCustomer = (props, ref) => {
/>
</
Modal
>
<
Modal
open=
{
tooltipVisible
}
footer=
{
null
}
centered
destroyOnHidden
title=
"气泡"
classNames=
{
{
header
:
"editor-header-customer"
,
body
:
"editor-body-customer"
,
wrapper
:
"editor-wrapper-customer"
,
}
}
maskClosable=
{
false
}
onCancel=
{
()
=>
setTooltipVisible
(
false
)
}
>
<
TooltipModal
ref=
{
tooltipRef
}
editor=
{
editor
}
chapterId=
{
chapterId
}
bookId=
{
bookId
}
tooltipInfo=
{
tooltipInfo
}
setTooltipInfo=
{
setTooltipInfo
}
setTooltipVisible=
{
setTooltipVisible
}
selectionSize=
{
selectionSize
}
/>
</
Modal
>
<
Modal
open=
{
linkVisible
}
footer=
{
null
}
centered
destroyOnHidden
title=
"链接"
classNames=
{
{
header
:
"editor-header-customer"
,
body
:
"editor-body-customer"
,
wrapper
:
"editor-wrapper-customer"
,
}
}
maskClosable=
{
false
}
onCancel=
{
()
=>
setLinkVisible
(
false
)
}
>
<
LinkModal
ref=
{
tooltipRef
}
editor=
{
editor
}
chapterId=
{
chapterId
}
bookId=
{
bookId
}
gData=
{
gData
}
linkInfo=
{
linkInfo
}
setLinkInfo=
{
setLinkInfo
}
setLinkVisible=
{
setLinkVisible
}
selectionSize=
{
selectionSize
}
/>
</
Modal
>
{
/* 扩展 */
}
<
Modal
open=
{
expandVisible
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论