This commit is contained in:
parent
671851235a
commit
4e3341985c
9 changed files with 25 additions and 23 deletions
|
@ -142,11 +142,11 @@
|
|||
}
|
||||
|
||||
&.dragover__top::after {
|
||||
top: -3px;
|
||||
top: -2.5px;
|
||||
}
|
||||
|
||||
&.dragover__bottom::after {
|
||||
bottom: -2px;
|
||||
bottom: -2.5px;
|
||||
}
|
||||
|
||||
&:hover [data-type="block-more"] {
|
||||
|
|
|
@ -78,6 +78,7 @@
|
|||
|
||||
.b3-button[data-type="addColumn"] {
|
||||
margin-left: 28px;
|
||||
|
||||
svg {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
|
@ -105,6 +106,6 @@
|
|||
}
|
||||
|
||||
.av__row.dragover__top::after {
|
||||
top: -2px
|
||||
top: -1.5px;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -56,7 +56,7 @@ export const keymap = {
|
|||
});
|
||||
item.updateProtyleToolbar([]).forEach(toolbarItem => {
|
||||
if (typeof toolbarItem === "string" || Constants.INLINE_TYPE.concat("|").includes(toolbarItem.name) || !toolbarItem.hotkey) {
|
||||
return
|
||||
return;
|
||||
}
|
||||
const dockKeymap = window.siyuan.config.keymap.plugin[item.name][toolbarItem.name];
|
||||
const keyValue = updateHotkeyTip(dockKeymap.custom);
|
||||
|
@ -71,7 +71,7 @@ export const keymap = {
|
|||
<span data-type="update" class="config-keymap__key">${keyValue}</span>
|
||||
<input data-key="plugin${Constants.ZWSP}${item.name}${Constants.ZWSP}${toolbarItem.name}" data-value="${dockKeymap.custom}" data-default="${dockKeymap.default}" class="b3-text-field fn__none" value="${keyValue}" spellcheck="false">
|
||||
</label>`;
|
||||
})
|
||||
});
|
||||
Object.keys(item.docks).forEach(key => {
|
||||
const dockConfig = item.docks[key].config;
|
||||
if (!dockConfig.hotkey) {
|
||||
|
|
|
@ -22,7 +22,7 @@ const renderDoc = (element: HTMLElement, currentPage: number, id: string) => {
|
|||
}
|
||||
const opElement = element.querySelector('.b3-select[data-type="opselect"]') as HTMLSelectElement;
|
||||
const listElement = element.querySelector(".b3-list--background");
|
||||
element.querySelector('.protyle-title__input').classList.add("fn__none");
|
||||
element.querySelector(".protyle-title__input").classList.add("fn__none");
|
||||
element.querySelector('.history__text[data-type="docPanel"]').classList.add("fn__none");
|
||||
element.querySelector('.history__text[data-type="mdPanel"]').classList.add("fn__none");
|
||||
fetchPost("/api/history/searchHistory", {
|
||||
|
@ -36,7 +36,7 @@ const renderDoc = (element: HTMLElement, currentPage: number, id: string) => {
|
|||
} else {
|
||||
nextElement.setAttribute("disabled", "disabled");
|
||||
}
|
||||
const pageNumElement = element.querySelector('[data-type="jumpRepoPage"]')
|
||||
const pageNumElement = element.querySelector('[data-type="jumpRepoPage"]');
|
||||
if (response.data.pageCount > 1) {
|
||||
pageNumElement.removeAttribute("disabled");
|
||||
} else {
|
||||
|
@ -134,8 +134,8 @@ export const openDocHistory = (options: {
|
|||
typewriterMode: false,
|
||||
});
|
||||
disabledProtyle(historyEditor.protyle);
|
||||
const pageNumElement = dialog.element.querySelector('[data-type="jumpRepoPage"]')
|
||||
const titleElement = dialog.element.querySelector(".protyle-title__input")
|
||||
const pageNumElement = dialog.element.querySelector('[data-type="jumpRepoPage"]');
|
||||
const titleElement = dialog.element.querySelector(".protyle-title__input");
|
||||
dialog.element.addEventListener("click", (event) => {
|
||||
let target = event.target as HTMLElement;
|
||||
while (target && !target.isEqualNode(dialog.element)) {
|
||||
|
@ -176,7 +176,7 @@ export const openDocHistory = (options: {
|
|||
});
|
||||
}
|
||||
titleElement.textContent = item.title;
|
||||
titleElement.classList.remove("fn__none")
|
||||
titleElement.classList.remove("fn__none");
|
||||
isLoading = false;
|
||||
});
|
||||
target.parentElement.querySelector(".b3-list-item--focus")?.classList.remove("b3-list-item--focus");
|
||||
|
|
|
@ -445,7 +445,7 @@ export const openHistory = (app: App) => {
|
|||
icon: "iconHistory",
|
||||
title: window.siyuan.languages.dataHistory,
|
||||
bindEvent(element) {
|
||||
element.firstElementChild.setAttribute("style", "background-color:var(--b3-theme-background);height:100%")
|
||||
element.firstElementChild.setAttribute("style", "background-color:var(--b3-theme-background);height:100%");
|
||||
bindEvent(app, element.firstElementChild);
|
||||
}
|
||||
});
|
||||
|
|
|
@ -79,7 +79,7 @@ export class Plugin {
|
|||
|
||||
this.updateProtyleToolbar([]).forEach(toolbarItem => {
|
||||
if (typeof toolbarItem === "string" || Constants.INLINE_TYPE.concat("|").includes(toolbarItem.name) || !toolbarItem.hotkey) {
|
||||
return
|
||||
return;
|
||||
}
|
||||
if (!window.siyuan.config.keymap.plugin) {
|
||||
window.siyuan.config.keymap.plugin = {};
|
||||
|
@ -96,9 +96,9 @@ export class Plugin {
|
|||
window.siyuan.config.keymap.plugin[options.name][toolbarItem.name] = {
|
||||
default: toolbarItem.hotkey,
|
||||
custom: toolbarItem.hotkey,
|
||||
}
|
||||
};
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
public onload() {
|
||||
|
|
|
@ -216,7 +216,7 @@ const genSelectItemHTML = (type: "selected" | "empty" | "unselect", id?: string,
|
|||
if (type === "empty") {
|
||||
if (id) {
|
||||
return `<button class="b3-menu__item" data-type="setRelationCell">
|
||||
<span class="b3-menu__label">${window.siyuan.languages.newRowInRelation.replace('${x}', text).replace('${y}', id)}</span>
|
||||
<span class="b3-menu__label">${window.siyuan.languages.newRowInRelation.replace("${x}", text).replace("${y}", id)}</span>
|
||||
</button>`;
|
||||
}
|
||||
return `<button class="b3-menu__item">
|
||||
|
@ -407,7 +407,7 @@ export const setRelationCell = (protyle: IProtyle, nodeElement: HTMLElement, tar
|
|||
}
|
||||
} else {
|
||||
const blockID = target.querySelector(".popover__block").getAttribute("data-id");
|
||||
const content = target.querySelector("b").textContent
|
||||
const content = target.querySelector("b").textContent;
|
||||
const rowId = Lute.NewNodeID();
|
||||
transaction(protyle, [{
|
||||
action: "insertAttrViewBlock",
|
||||
|
|
|
@ -69,15 +69,15 @@ export class Toolbar {
|
|||
/// #endif
|
||||
this.toolbarHeight = 29;
|
||||
protyle.app.plugins.forEach(item => {
|
||||
const pluginToolbar = item.updateProtyleToolbar(options.toolbar)
|
||||
const pluginToolbar = item.updateProtyleToolbar(options.toolbar);
|
||||
pluginToolbar.forEach(toolbarItem => {
|
||||
if (typeof toolbarItem === "string" || Constants.INLINE_TYPE.concat("|").includes(toolbarItem.name) || !toolbarItem.hotkey) {
|
||||
return
|
||||
return;
|
||||
}
|
||||
if (window.siyuan.config.keymap.plugin && window.siyuan.config.keymap.plugin[item.name] && window.siyuan.config.keymap.plugin[item.name][toolbarItem.name]) {
|
||||
toolbarItem.hotkey = window.siyuan.config.keymap.plugin[item.name][toolbarItem.name].custom;
|
||||
}
|
||||
})
|
||||
});
|
||||
options.toolbar = toolbarKeyToMenu(pluginToolbar);
|
||||
});
|
||||
options.toolbar.forEach((menuItem: IMenuItem) => {
|
||||
|
@ -90,15 +90,15 @@ export class Toolbar {
|
|||
this.element.innerHTML = "";
|
||||
protyle.options.toolbar = toolbarKeyToMenu(Constants.PROTYLE_TOOLBAR);
|
||||
protyle.app.plugins.forEach(item => {
|
||||
const pluginToolbar = item.updateProtyleToolbar(protyle.options.toolbar)
|
||||
const pluginToolbar = item.updateProtyleToolbar(protyle.options.toolbar);
|
||||
pluginToolbar.forEach(toolbarItem => {
|
||||
if (typeof toolbarItem === "string" || Constants.INLINE_TYPE.concat("|").includes(toolbarItem.name) || !toolbarItem.hotkey) {
|
||||
return
|
||||
return;
|
||||
}
|
||||
if (window.siyuan.config.keymap.plugin && window.siyuan.config.keymap.plugin[item.name] && window.siyuan.config.keymap.plugin[item.name][toolbarItem.name]) {
|
||||
toolbarItem.hotkey = window.siyuan.config.keymap.plugin[item.name][toolbarItem.name].custom;
|
||||
}
|
||||
})
|
||||
});
|
||||
protyle.options.toolbar = toolbarKeyToMenu(pluginToolbar);
|
||||
});
|
||||
protyle.options.toolbar.forEach((menuItem: IMenuItem) => {
|
||||
|
|
|
@ -1332,7 +1332,8 @@ export const dropEvent = (protyle: IProtyle, editorElement: HTMLElement) => {
|
|||
addDragover(targetElement);
|
||||
return;
|
||||
}
|
||||
if (targetElement.getAttribute("data-type") === "NodeListItem" || fileTreeIds.indexOf("-") > -1) {
|
||||
// 忘记为什么要限定文档树的拖拽了,先放开 https://github.com/siyuan-note/siyuan/pull/13284#issuecomment-2503853135
|
||||
if (targetElement.getAttribute("data-type") === "NodeListItem") {
|
||||
if (event.clientY > nodeRect.top + nodeRect.height / 2) {
|
||||
targetElement.classList.add("dragover__bottom");
|
||||
addDragover(targetElement);
|
||||
|
|
Loading…
Add table
Reference in a new issue