mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-19 02:21:38 +08:00
🚨
This commit is contained in:
parent
b3c39f450b
commit
c978a42d3f
@ -470,6 +470,6 @@ export class Outline extends Model {
|
|||||||
currentElement.classList.add("b3-list-item--focus");
|
currentElement.classList.add("b3-list-item--focus");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.element.removeAttribute("data-loading")
|
this.element.removeAttribute("data-loading");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,7 @@ import {zoomOut} from "../../menus/protyle";
|
|||||||
import {getEditorRange} from "../util/selection";
|
import {getEditorRange} from "../util/selection";
|
||||||
/// #if !MOBILE
|
/// #if !MOBILE
|
||||||
import {openFileById} from "../../editor/util";
|
import {openFileById} from "../../editor/util";
|
||||||
import {saveLayout, setPanelFocus} from "../../layout/util";
|
import {saveLayout} from "../../layout/util";
|
||||||
/// #endif
|
/// #endif
|
||||||
/// #if !BROWSER
|
/// #if !BROWSER
|
||||||
import {ipcRenderer} from "electron";
|
import {ipcRenderer} from "electron";
|
||||||
@ -565,7 +565,7 @@ ${padHTML}
|
|||||||
let range: Range;
|
let range: Range;
|
||||||
let blockElement: Element;
|
let blockElement: Element;
|
||||||
if (nodeElement) {
|
if (nodeElement) {
|
||||||
blockElement = nodeElement
|
blockElement = nodeElement;
|
||||||
} else if (getSelection().rangeCount > 0) {
|
} else if (getSelection().rangeCount > 0) {
|
||||||
range = getSelection().getRangeAt(0);
|
range = getSelection().getRangeAt(0);
|
||||||
if (!protyle.wysiwyg.element.isEqualNode(range.startContainer) && !protyle.wysiwyg.element.contains(range.startContainer)) {
|
if (!protyle.wysiwyg.element.isEqualNode(range.startContainer) && !protyle.wysiwyg.element.contains(range.startContainer)) {
|
||||||
|
@ -14,8 +14,7 @@ import {Constants} from "../../constants";
|
|||||||
import {matchHotKey} from "../util/hotKey";
|
import {matchHotKey} from "../util/hotKey";
|
||||||
import {isMac, readText, writeText} from "../util/compatibility";
|
import {isMac, readText, writeText} from "../util/compatibility";
|
||||||
import * as dayjs from "dayjs";
|
import * as dayjs from "dayjs";
|
||||||
import {setPanelFocus} from "../../layout/util";
|
import {openFileById} from "../../editor/util";
|
||||||
import {openFileById, updatePanelByEditor} from "../../editor/util";
|
|
||||||
import {setTitle} from "../../dialog/processSystem";
|
import {setTitle} from "../../dialog/processSystem";
|
||||||
import {getNoContainerElement} from "../wysiwyg/getBlock";
|
import {getNoContainerElement} from "../wysiwyg/getBlock";
|
||||||
import {commonHotkey} from "../wysiwyg/commonHotkey";
|
import {commonHotkey} from "../wysiwyg/commonHotkey";
|
||||||
|
@ -10,9 +10,8 @@ import {getSearch, isMobile} from "../../util/functions";
|
|||||||
import {shell} from "electron";
|
import {shell} from "electron";
|
||||||
/// #endif
|
/// #endif
|
||||||
/// #if !MOBILE
|
/// #if !MOBILE
|
||||||
import {openAsset, openBy, updateOutline} from "../../editor/util";
|
import {openAsset, openBy} from "../../editor/util";
|
||||||
import {getAllModels} from "../../layout/getAll";
|
import {getAllModels} from "../../layout/getAll";
|
||||||
import {setPanelFocus} from "../../layout/util";
|
|
||||||
/// #endif
|
/// #endif
|
||||||
import {fetchPost} from "../../util/fetch";
|
import {fetchPost} from "../../util/fetch";
|
||||||
import {processRender} from "../util/processCode";
|
import {processRender} from "../util/processCode";
|
||||||
|
@ -304,9 +304,9 @@ export const avContextmenu = (protyle: IProtyle, rowElement: HTMLElement, positi
|
|||||||
rowElement.querySelector(".av__firstcol use").setAttribute("xlink:href", "#iconCheck");
|
rowElement.querySelector(".av__firstcol use").setAttribute("xlink:href", "#iconCheck");
|
||||||
const rowElements = blockElement.querySelectorAll(".av__row--select:not(.av__row--header)");
|
const rowElements = blockElement.querySelectorAll(".av__row--select:not(.av__row--header)");
|
||||||
updateHeader(rowElement);
|
updateHeader(rowElement);
|
||||||
const keyCellElement = rowElements[0].querySelector('.av__cell[data-block-id]') as HTMLElement
|
const keyCellElement = rowElements[0].querySelector(".av__cell[data-block-id]") as HTMLElement;
|
||||||
if (rowElements.length === 1 && keyCellElement.getAttribute("data-detached") !== "true") {
|
if (rowElements.length === 1 && keyCellElement.getAttribute("data-detached") !== "true") {
|
||||||
const blockId = rowElements[0].getAttribute("data-id")
|
const blockId = rowElements[0].getAttribute("data-id");
|
||||||
openEditorTab(protyle.app, blockId);
|
openEditorTab(protyle.app, blockId);
|
||||||
menu.addItem({
|
menu.addItem({
|
||||||
label: window.siyuan.languages.copy,
|
label: window.siyuan.languages.copy,
|
||||||
@ -318,7 +318,7 @@ export const avContextmenu = (protyle: IProtyle, rowElement: HTMLElement, positi
|
|||||||
label: window.siyuan.languages.unbindBlock,
|
label: window.siyuan.languages.unbindBlock,
|
||||||
icon: "iconLinkOff",
|
icon: "iconLinkOff",
|
||||||
click() {
|
click() {
|
||||||
updateCellsValue(protyle, blockElement, keyCellElement.querySelector(".av__celltext").textContent, [keyCellElement])
|
updateCellsValue(protyle, blockElement, keyCellElement.querySelector(".av__celltext").textContent, [keyCellElement]);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -726,7 +726,7 @@ const renderRollup = (cellValue: IAVCellValue) => {
|
|||||||
} else if (cellValue.type === "date") {
|
} else if (cellValue.type === "date") {
|
||||||
const dataValue = cellValue ? cellValue.date : null;
|
const dataValue = cellValue ? cellValue.date : null;
|
||||||
if (dataValue.formattedContent) {
|
if (dataValue.formattedContent) {
|
||||||
text = dataValue.formattedContent
|
text = dataValue.formattedContent;
|
||||||
} else {
|
} else {
|
||||||
if (dataValue && dataValue.isNotEmpty) {
|
if (dataValue && dataValue.isNotEmpty) {
|
||||||
text = dayjs(dataValue.content).format(dataValue.isNotTime ? "YYYY-MM-DD" : "YYYY-MM-DD HH:mm");
|
text = dayjs(dataValue.content).format(dataValue.isNotTime ? "YYYY-MM-DD" : "YYYY-MM-DD HH:mm");
|
||||||
|
@ -220,7 +220,7 @@ export const getEditHTML = (options: {
|
|||||||
<button class="b3-menu__item" data-type="removeCol">
|
<button class="b3-menu__item" data-type="removeCol">
|
||||||
<svg class="b3-menu__icon" style=""><use xlink:href="#iconTrashcan"></use></svg>
|
<svg class="b3-menu__icon" style=""><use xlink:href="#iconTrashcan"></use></svg>
|
||||||
<span class="b3-menu__label">${window.siyuan.languages.delete}</span>
|
<span class="b3-menu__label">${window.siyuan.languages.delete}</span>
|
||||||
</button>`
|
</button>`;
|
||||||
}
|
}
|
||||||
return `<div class="b3-menu__items">
|
return `<div class="b3-menu__items">
|
||||||
${html}
|
${html}
|
||||||
@ -352,7 +352,7 @@ export const bindEditEvent = (options: {
|
|||||||
data: !wrapElement.checked,
|
data: !wrapElement.checked,
|
||||||
blockID: options.blockID
|
blockID: options.blockID
|
||||||
}]);
|
}]);
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
const addOptionElement = options.menuElement.querySelector('[data-type="addOption"]') as HTMLInputElement;
|
const addOptionElement = options.menuElement.querySelector('[data-type="addOption"]') as HTMLInputElement;
|
||||||
if (addOptionElement) {
|
if (addOptionElement) {
|
||||||
@ -863,7 +863,7 @@ export const showColMenu = (protyle: IProtyle, blockElement: Element, cellElemen
|
|||||||
colId,
|
colId,
|
||||||
data: response.data
|
data: response.data
|
||||||
});
|
});
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -73,7 +73,7 @@ export const bindDateEvent = (options: {
|
|||||||
inputElements.forEach(item => {
|
inputElements.forEach(item => {
|
||||||
item.addEventListener("keydown", (event) => {
|
item.addEventListener("keydown", (event) => {
|
||||||
if (event.isComposing) {
|
if (event.isComposing) {
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
if (event.key === "Enter") {
|
if (event.key === "Enter") {
|
||||||
updateCellsValue(options.protyle, options.blockElement as HTMLElement, {
|
updateCellsValue(options.protyle, options.blockElement as HTMLElement, {
|
||||||
@ -87,7 +87,7 @@ export const bindDateEvent = (options: {
|
|||||||
document.querySelector(".av__panel")?.remove();
|
document.querySelector(".av__panel")?.remove();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
})
|
});
|
||||||
inputElements[0].addEventListener("change", () => {
|
inputElements[0].addEventListener("change", () => {
|
||||||
inputElements[0].dataset.value = inputElements[0].value.length > 10 ? inputElements[0].value : inputElements[0].value + " 00:00";
|
inputElements[0].dataset.value = inputElements[0].value.length > 10 ? inputElements[0].value : inputElements[0].value + " 00:00";
|
||||||
});
|
});
|
||||||
|
@ -28,7 +28,7 @@ export const avKeydown = (event: KeyboardEvent, nodeElement: HTMLElement, protyl
|
|||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
const avPanelElement = document.querySelector(".av__panel")
|
const avPanelElement = document.querySelector(".av__panel");
|
||||||
if (avPanelElement &&
|
if (avPanelElement &&
|
||||||
(event.key === "Escape" || event.key.startsWith("ArrowLeft") || event.key === "Enter" || matchHotKey("⇥", event) || matchHotKey("⇧⇥", event))) {
|
(event.key === "Escape" || event.key.startsWith("ArrowLeft") || event.key === "Enter" || matchHotKey("⇥", event) || matchHotKey("⇧⇥", event))) {
|
||||||
avPanelElement.remove();
|
avPanelElement.remove();
|
||||||
|
@ -150,7 +150,7 @@ export const bindViewEvent = (options: {
|
|||||||
}]);
|
}]);
|
||||||
options.blockElement.querySelector(".av__title").classList.remove("av__title--hide");
|
options.blockElement.querySelector(".av__title").classList.remove("av__title--hide");
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getViewHTML = (data: IAVTable) => {
|
export const getViewHTML = (data: IAVTable) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user