This commit is contained in:
yanmao 2022-01-15 10:27:56 +08:00
parent 4dfe1bd224
commit f1cccb7539
16 changed files with 137 additions and 117 deletions

View File

@ -348,11 +348,6 @@ export const toolbarOptions: ToolbarOptions = {
name: 'file-uploader',
icon: 'attachment',
},
{
type: 'button',
name: 'table',
icon: 'table',
},
{
type: 'button',
name: 'math',
@ -370,7 +365,7 @@ export const toolbarOptions: ToolbarOptions = {
},
{
type: 'button',
name: 'unordered-list',
name: 'unorderedlist',
icon: 'unordered-list',
},
{

View File

@ -103,7 +103,7 @@ export default () => {
? false
: {
url: `${wsUrl}${
member ? '?uid=' + member.id : ''
member?.id ? '?uid=' + member.id : ''
}`,
docId: 'demo',
onReady: (member) => {

View File

@ -868,12 +868,23 @@ class Mark implements MarkModelInterface {
}
//插件一样,不合并,直接移除
else if (plugin && plugin === curPlugin) {
nodeApi.unwrap(parent);
const childs = nodeApi.unwrap(parent);
const targetMark = childs.find(
(child) =>
!child.isCursor() && nodeApi.isMark(child),
);
if (targetMark) {
parent = targetMark;
} else if (childs.length > 0) {
parent = childs[0].parent();
}
result = false;
break;
}
}
parent = parent.parent();
const newParent = parent.parent();
if (newParent && nodeApi.isMark(parent)) parent = newParent;
else break;
}
if (result) return false;

View File

@ -99,7 +99,7 @@ export default defineComponent({
</script>
<style css>
.editor-toolbar .toolbar-button {
display: inline-block;
display: inline-flex;
align-items: center;
justify-content: center;
width: auto;
@ -114,7 +114,6 @@ export default defineComponent({
cursor: pointer;
color: #595959;
outline: none;
line-height: 32px;
}
.editor-toolbar.editor-toolbar-popup .toolbar-button {

View File

@ -95,7 +95,7 @@ export default defineComponent({
};
const hideDropdown = (event?: MouseEvent) => {
if (event?.target && $(event.target).closest('.toolbar-dropdown-list'))
if (event?.target && $(event.target).closest('.toolbar-dropdown-list').length > 0)
return;
document.removeEventListener('click', hideDropdown);
visible.value = false
@ -157,6 +157,7 @@ export default defineComponent({
margin-right: 0;
min-width: 26px;
border-radius: 3px 0 0 3px;
display: block;
}
.editor-toolbar.editor-toolbar-popup .colorpicker-button-group .colorpicker-button-text {
@ -174,6 +175,7 @@ export default defineComponent({
text-align: center;
padding: 0 0;
border-radius: 0 3px 3px 0;
display: block;
}
.editor-toolbar.editor-toolbar-popup .colorpicker-button-group .colorpicker-button-dropdown {

View File

@ -149,6 +149,7 @@ export default defineComponent({
.toolbar-dropdown .toolbar-dropdown-trigger {
align-items: center;
display: flex;
}
.toolbar-dropdown .toolbar-dropdown-trigger .toolbar-dropdown-button-text {

View File

@ -1,5 +1,5 @@
.editor-toolbar .toolbar-button {
display: inline-block;
display: inline-flex;
align-items: center;
justify-content: center;
width: auto;
@ -14,7 +14,6 @@
cursor: pointer;
color: #595959;
outline: none;
line-height: 32px;
}
.editor-toolbar.editor-toolbar-popup .toolbar-button {

View File

@ -10,6 +10,7 @@
margin-right: 0;
min-width: 26px;
border-radius: 3px 0 0 3px;
display: block;
}
.editor-toolbar.editor-toolbar-popup .colorpicker-button-group .colorpicker-button-text {
@ -27,6 +28,7 @@
text-align: center;
padding: 0 0;
border-radius: 0 3px 3px 0;
display: block;
}
.editor-toolbar.editor-toolbar-popup .colorpicker-button-group .colorpicker-button-dropdown {

View File

@ -92,7 +92,10 @@ const ColorButton: React.FC<ColorButtonProps> = ({
};
const hideDropdown = (event?: MouseEvent) => {
if (event?.target && $(event.target).closest('.toolbar-dropdown-list'))
if (
event?.target &&
$(event.target).closest('.toolbar-dropdown-list').length > 0
)
return;
document.removeEventListener('click', hideDropdown);
setPickerVisible(false);

View File

@ -139,110 +139,112 @@ export const getToolbarDefaultConfig = (
/>
),
icon: (
<svg
width="24px"
height="24px"
viewBox="0 0 24 24"
version="1.1"
xmlns="http://www.w3.org/2000/svg"
>
<g
stroke="none"
strokeWidth="1"
fill="none"
fillRule="evenodd"
<span>
<svg
width="24px"
height="24px"
viewBox="0 0 24 24"
version="1.1"
xmlns="http://www.w3.org/2000/svg"
>
<g transform="translate(-16.000000, -93.000000)">
<g>
<g transform="translate(16.000000, 53.000000)">
<g transform="translate(0.000000, 40.000000)">
<g>
<rect
stroke="#E8E8E8"
strokeWidth="0.666666667"
fill="#FFFFFF"
x="0.333333333"
y="0.333333333"
width="23.3333333"
height="23.3333333"
rx="1.33333333"
></rect>
<g transform="translate(5.250000, 6.750000)">
<path
d="M0.75,0 L3.75,0 L3.75,10.5 L0.75,10.5 C0.335786438,10.5 5.07265313e-17,10.1642136 0,9.75 L0,0.75 C-5.07265313e-17,0.335786438 0.335786438,7.6089797e-17 0.75,0 Z"
id="Rectangle"
fill="#F0F0F0"
></path>
<path
d="M0.25,2.75 L13.25,2.75 L13.25,0.75 C13.25,0.473857625 13.0261424,0.25 12.75,0.25 L0.75,0.25 C0.473857625,0.25 0.25,0.473857625 0.25,0.75 L0.25,2.75 Z"
id="Rectangle"
stroke="#595959"
strokeWidth="0.5"
fillOpacity="0.15"
fill="#25B864"
></path>
<g
stroke="none"
strokeWidth="1"
fill="none"
fillRule="evenodd"
>
<g transform="translate(-16.000000, -93.000000)">
<g>
<g transform="translate(16.000000, 53.000000)">
<g transform="translate(0.000000, 40.000000)">
<g>
<rect
id="Rectangle"
fill="#E8E8E8"
x="0"
y="5.25"
width="13.5"
height="1"
stroke="#E8E8E8"
strokeWidth="0.666666667"
fill="#FFFFFF"
x="0.333333333"
y="0.333333333"
width="23.3333333"
height="23.3333333"
rx="1.33333333"
></rect>
<rect
id="Rectangle-Copy"
fill="#E8E8E8"
x="0"
y="7.5"
width="13.5"
height="1"
></rect>
<rect
id="Rectangle"
fill="#E8E8E8"
x="6.75"
y="0"
width="1"
height="10.5"
></rect>
<rect
id="Rectangle-Copy-5"
fill="#E8E8E8"
x="9.75"
y="0"
width="1"
height="10.5"
></rect>
<rect
id="Rectangle"
stroke="#737373"
strokeWidth="0.75"
x="0.375"
y="0.375"
width="12.75"
height="9.75"
rx="0.75"
></rect>
<path
d="M3.5,10.25 L3.5,0.25 L0.75,0.25 C0.473857625,0.25 0.25,0.473857625 0.25,0.75 L0.25,9.75 C0.25,10.0261424 0.473857625,10.25 0.75,10.25 L3.5,10.25 Z"
id="Rectangle"
stroke="#737373"
strokeWidth="0.5"
></path>
<path
d="M0.25,2.75 L13.25,2.75 L13.25,0.75 C13.25,0.473857625 13.0261424,0.25 12.75,0.25 L0.75,0.25 C0.473857625,0.25 0.25,0.473857625 0.25,0.75 L0.25,2.75 Z"
id="Rectangle"
stroke="#737373"
strokeWidth="0.5"
></path>
<g transform="translate(5.250000, 6.750000)">
<path
d="M0.75,0 L3.75,0 L3.75,10.5 L0.75,10.5 C0.335786438,10.5 5.07265313e-17,10.1642136 0,9.75 L0,0.75 C-5.07265313e-17,0.335786438 0.335786438,7.6089797e-17 0.75,0 Z"
id="Rectangle"
fill="#F0F0F0"
></path>
<path
d="M0.25,2.75 L13.25,2.75 L13.25,0.75 C13.25,0.473857625 13.0261424,0.25 12.75,0.25 L0.75,0.25 C0.473857625,0.25 0.25,0.473857625 0.25,0.75 L0.25,2.75 Z"
id="Rectangle"
stroke="#595959"
strokeWidth="0.5"
fillOpacity="0.15"
fill="#25B864"
></path>
<rect
id="Rectangle"
fill="#E8E8E8"
x="0"
y="5.25"
width="13.5"
height="1"
></rect>
<rect
id="Rectangle-Copy"
fill="#E8E8E8"
x="0"
y="7.5"
width="13.5"
height="1"
></rect>
<rect
id="Rectangle"
fill="#E8E8E8"
x="6.75"
y="0"
width="1"
height="10.5"
></rect>
<rect
id="Rectangle-Copy-5"
fill="#E8E8E8"
x="9.75"
y="0"
width="1"
height="10.5"
></rect>
<rect
id="Rectangle"
stroke="#737373"
strokeWidth="0.75"
x="0.375"
y="0.375"
width="12.75"
height="9.75"
rx="0.75"
></rect>
<path
d="M3.5,10.25 L3.5,0.25 L0.75,0.25 C0.473857625,0.25 0.25,0.473857625 0.25,0.75 L0.25,9.75 C0.25,10.0261424 0.473857625,10.25 0.75,10.25 L3.5,10.25 Z"
id="Rectangle"
stroke="#737373"
strokeWidth="0.5"
></path>
<path
d="M0.25,2.75 L13.25,2.75 L13.25,0.75 C13.25,0.473857625 13.0261424,0.25 12.75,0.25 L0.75,0.25 C0.473857625,0.25 0.25,0.473857625 0.25,0.75 L0.25,2.75 Z"
id="Rectangle"
stroke="#737373"
strokeWidth="0.5"
></path>
</g>
</g>
</g>
</g>
</g>
</g>
</g>
</g>
</svg>
</svg>
</span>
),
title: language['table']['title'],
search: 'biaoge,table',

View File

@ -4,6 +4,7 @@
.toolbar-dropdown .toolbar-dropdown-trigger {
align-items: center;
display: flex;
}
.toolbar-dropdown .toolbar-dropdown-trigger .toolbar-dropdown-button-text {

View File

@ -7,7 +7,7 @@ export default class<T extends BackcolorOptions> extends MarkPlugin<T> {
static get pluginName() {
return 'backcolor';
}
readonly mergeLeval = 4;
readonly mergeLeval = 2;
tagName = 'span';
style = {

View File

@ -16,7 +16,7 @@ export default class<T extends FontsizeOptions> extends MarkPlugin<T> {
return 'fontsize';
}
readonly mergeLeval = 2;
readonly mergeLeval = 4;
tagName = 'span';

View File

@ -72,6 +72,7 @@ div[data-card-key="table"].card-selected .data-table, div[data-card-key="table"]
.table-wrapper.active {
margin-top: -42px;
width: 100%;
z-index: 1;
}
.table-wrapper.scrollbar-show {

View File

@ -15,7 +15,6 @@
display: inline-block;
line-height: 1;
position: relative;
vertical-align: middle;
}
.data-checkbox-checked:after {

View File

@ -8,11 +8,16 @@
}
.am-engine .data-list-task [data-card-key="checkbox"],.am-engine-view .data-list-task [data-card-key="checkbox"] {
position: relative;
margin-left: -22px;
height: 100%;
height: 16px;
display: inline-block;
width: 22px;
top: -2px;
vertical-align: top;
vertical-align: middle;
height: 100%;
}
.am-engine .data-list-task [data-card-key="checkbox"] [data-card-element="center"],.am-engine .data-list-task [data-card-key="checkbox"] [data-card-element="body"],.am-engine-view .data-list-task [data-card-key="checkbox"] [data-card-element="center"]{
height: 16px;
width: 16px;
vertical-align: unset;
}