mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-22 17:40:13 +01:00
🚨
This commit is contained in:
parent
6684c77120
commit
2008dcaff2
7 changed files with 18 additions and 24 deletions
|
|
@ -204,5 +204,5 @@ export const getLangByType = (type: string) => {
|
||||||
lang = window.siyuan.languages.blockEmbed;
|
lang = window.siyuan.languages.blockEmbed;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return lang
|
return lang;
|
||||||
}
|
};
|
||||||
|
|
|
||||||
|
|
@ -21,12 +21,6 @@ import {hintRef} from "../../hint/extend";
|
||||||
import {focusByRange} from "../../util/selection";
|
import {focusByRange} from "../../util/selection";
|
||||||
import {showMessage} from "../../../dialog/message";
|
import {showMessage} from "../../../dialog/message";
|
||||||
import {previewImage} from "../../preview/image";
|
import {previewImage} from "../../preview/image";
|
||||||
import {pathPosix} from "../../../util/pathName";
|
|
||||||
import {Constants} from "../../../constants";
|
|
||||||
/// #if !MOBILE
|
|
||||||
import {openAsset, openBy} from "../../../editor/util";
|
|
||||||
/// #endif
|
|
||||||
import {getSearch} from "../../../util/functions";
|
|
||||||
import {unicode2Emoji} from "../../../emoji";
|
import {unicode2Emoji} from "../../../emoji";
|
||||||
import {selectRow} from "./row";
|
import {selectRow} from "./row";
|
||||||
import * as dayjs from "dayjs";
|
import * as dayjs from "dayjs";
|
||||||
|
|
|
||||||
|
|
@ -215,8 +215,8 @@ class="fn__flex-1 fn__flex${["url", "text", "number", "email", "phone", "block"]
|
||||||
const targetElement = element.querySelector(".dragover__bottom, .dragover__top") as HTMLElement;
|
const targetElement = element.querySelector(".dragover__bottom, .dragover__top") as HTMLElement;
|
||||||
if (targetElement && dragBlockElement) {
|
if (targetElement && dragBlockElement) {
|
||||||
const isBottom = targetElement.classList.contains("dragover__bottom");
|
const isBottom = targetElement.classList.contains("dragover__bottom");
|
||||||
const previousID = isBottom ? targetElement.dataset.colId : targetElement.previousElementSibling?.getAttribute("data-col-id")
|
const previousID = isBottom ? targetElement.dataset.colId : targetElement.previousElementSibling?.getAttribute("data-col-id");
|
||||||
const undoPreviousID = window.siyuan.dragElement.previousElementSibling?.getAttribute("data-col-id")
|
const undoPreviousID = window.siyuan.dragElement.previousElementSibling?.getAttribute("data-col-id");
|
||||||
if (previousID !== undoPreviousID && previousID !== window.siyuan.dragElement.dataset.colId) {
|
if (previousID !== undoPreviousID && previousID !== window.siyuan.dragElement.dataset.colId) {
|
||||||
transaction(protyle, [{
|
transaction(protyle, [{
|
||||||
action: "sortAttrViewCol",
|
action: "sortAttrViewCol",
|
||||||
|
|
|
||||||
|
|
@ -793,7 +793,7 @@ export const showColMenu = (protyle: IProtyle, blockElement: Element, cellElemen
|
||||||
click() {
|
click() {
|
||||||
const addMenu = addCol(protyle, blockElement, cellElement.previousElementSibling?.getAttribute("data-col-id") || "");
|
const addMenu = addCol(protyle, blockElement, cellElement.previousElementSibling?.getAttribute("data-col-id") || "");
|
||||||
if (!blockElement.contains(cellElement)) {
|
if (!blockElement.contains(cellElement)) {
|
||||||
cellElement = blockElement.querySelector(`.av__row--header .av__cell--header[data-col-id="${colId}"]`)
|
cellElement = blockElement.querySelector(`.av__row--header .av__cell--header[data-col-id="${colId}"]`);
|
||||||
}
|
}
|
||||||
const addRect = cellElement.getBoundingClientRect();
|
const addRect = cellElement.getBoundingClientRect();
|
||||||
addMenu.open({
|
addMenu.open({
|
||||||
|
|
@ -809,7 +809,7 @@ export const showColMenu = (protyle: IProtyle, blockElement: Element, cellElemen
|
||||||
click() {
|
click() {
|
||||||
const addMenu = addCol(protyle, blockElement, colId);
|
const addMenu = addCol(protyle, blockElement, colId);
|
||||||
if (!blockElement.contains(cellElement)) {
|
if (!blockElement.contains(cellElement)) {
|
||||||
cellElement = blockElement.querySelector(`.av__row--header .av__cell--header[data-col-id="${colId}"]`)
|
cellElement = blockElement.querySelector(`.av__row--header .av__cell--header[data-col-id="${colId}"]`);
|
||||||
}
|
}
|
||||||
const addRect = cellElement.getBoundingClientRect();
|
const addRect = cellElement.getBoundingClientRect();
|
||||||
addMenu.open({
|
addMenu.open({
|
||||||
|
|
|
||||||
|
|
@ -390,7 +390,7 @@ export const openMenuPanel = (options: {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (targetElement.getAttribute("data-type") === "editCol") {
|
if (targetElement.getAttribute("data-type") === "editCol") {
|
||||||
const previousID = (targetElement.classList.contains("dragover__top") ? targetElement.previousElementSibling?.getAttribute("data-id") : targetElement.getAttribute("data-id")) || ""
|
const previousID = (targetElement.classList.contains("dragover__top") ? targetElement.previousElementSibling?.getAttribute("data-id") : targetElement.getAttribute("data-id")) || "";
|
||||||
const undoPreviousID = sourceElement.previousElementSibling?.getAttribute("data-id") || "";
|
const undoPreviousID = sourceElement.previousElementSibling?.getAttribute("data-id") || "";
|
||||||
if (previousID !== undoPreviousID && previousID !== sourceId) {
|
if (previousID !== undoPreviousID && previousID !== sourceId) {
|
||||||
transaction(options.protyle, [{
|
transaction(options.protyle, [{
|
||||||
|
|
|
||||||
|
|
@ -34,13 +34,13 @@ const updateCol = (options: {
|
||||||
}
|
}
|
||||||
colData.rollup = {
|
colData.rollup = {
|
||||||
relationKeyID: itemElement.dataset.colId
|
relationKeyID: itemElement.dataset.colId
|
||||||
}
|
};
|
||||||
const goSearchRollupTargetElement = options.target.nextElementSibling as HTMLElement
|
const goSearchRollupTargetElement = options.target.nextElementSibling as HTMLElement;
|
||||||
goSearchRollupTargetElement.querySelector(".b3-menu__accelerator").textContent = "";
|
goSearchRollupTargetElement.querySelector(".b3-menu__accelerator").textContent = "";
|
||||||
goSearchRollupTargetElement.setAttribute("data-av-id", itemElement.dataset.targetAvId);
|
goSearchRollupTargetElement.setAttribute("data-av-id", itemElement.dataset.targetAvId);
|
||||||
const goSearchRollupCalcElement = goSearchRollupTargetElement.nextElementSibling as HTMLElement;
|
const goSearchRollupCalcElement = goSearchRollupTargetElement.nextElementSibling as HTMLElement;
|
||||||
goSearchRollupCalcElement.removeAttribute("data-col-type")
|
goSearchRollupCalcElement.removeAttribute("data-col-type");
|
||||||
goSearchRollupCalcElement.removeAttribute("data-calc")
|
goSearchRollupCalcElement.removeAttribute("data-calc");
|
||||||
goSearchRollupCalcElement.querySelector(".b3-menu__accelerator").textContent = window.siyuan.languages.original;
|
goSearchRollupCalcElement.querySelector(".b3-menu__accelerator").textContent = window.siyuan.languages.original;
|
||||||
} else {
|
} else {
|
||||||
if (itemElement.dataset.colId === colData.rollup?.keyID) {
|
if (itemElement.dataset.colId === colData.rollup?.keyID) {
|
||||||
|
|
@ -49,7 +49,7 @@ const updateCol = (options: {
|
||||||
colData.rollup.keyID = itemElement.dataset.colId;
|
colData.rollup.keyID = itemElement.dataset.colId;
|
||||||
delete colData.rollup.calc;
|
delete colData.rollup.calc;
|
||||||
const goSearchRollupCalcElement = options.target.nextElementSibling as HTMLElement;
|
const goSearchRollupCalcElement = options.target.nextElementSibling as HTMLElement;
|
||||||
goSearchRollupCalcElement.removeAttribute("data-calc")
|
goSearchRollupCalcElement.removeAttribute("data-calc");
|
||||||
goSearchRollupCalcElement.setAttribute("data-col-type", itemElement.dataset.colType);
|
goSearchRollupCalcElement.setAttribute("data-col-type", itemElement.dataset.colType);
|
||||||
goSearchRollupCalcElement.querySelector(".b3-menu__accelerator").textContent = window.siyuan.languages.original;
|
goSearchRollupCalcElement.querySelector(".b3-menu__accelerator").textContent = window.siyuan.languages.original;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -738,8 +738,8 @@ export class WYSIWYG {
|
||||||
let startFirstElement: Element;
|
let startFirstElement: Element;
|
||||||
let endLastElement: Element;
|
let endLastElement: Element;
|
||||||
this.element.querySelectorAll("iframe").forEach(item => {
|
this.element.querySelectorAll("iframe").forEach(item => {
|
||||||
item.style.pointerEvents = "none"
|
item.style.pointerEvents = "none";
|
||||||
})
|
});
|
||||||
documentSelf.onmousemove = (moveEvent: MouseEvent) => {
|
documentSelf.onmousemove = (moveEvent: MouseEvent) => {
|
||||||
const moveTarget = moveEvent.target as HTMLElement;
|
const moveTarget = moveEvent.target as HTMLElement;
|
||||||
// table cell select
|
// table cell select
|
||||||
|
|
@ -907,10 +907,10 @@ export class WYSIWYG {
|
||||||
let currentElement: Element | boolean = firstBlockElement;
|
let currentElement: Element | boolean = firstBlockElement;
|
||||||
|
|
||||||
if (currentElement) {
|
if (currentElement) {
|
||||||
// 从下网上选遇到嵌入块时,选中整个嵌入块
|
// 从下往上划选遇到嵌入块时,选中整个嵌入块
|
||||||
const embedElement = hasClosestByAttribute(currentElement, "data-type", "NodeBlockQueryEmbed")
|
const embedElement = hasClosestByAttribute(currentElement, "data-type", "NodeBlockQueryEmbed");
|
||||||
if (embedElement) {
|
if (embedElement) {
|
||||||
currentElement = embedElement
|
currentElement = embedElement;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -985,7 +985,7 @@ export class WYSIWYG {
|
||||||
endLastElement = undefined;
|
endLastElement = undefined;
|
||||||
this.element.querySelectorAll("iframe").forEach(item => {
|
this.element.querySelectorAll("iframe").forEach(item => {
|
||||||
item.style.pointerEvents = "";
|
item.style.pointerEvents = "";
|
||||||
})
|
});
|
||||||
protyle.selectElement.classList.add("fn__none");
|
protyle.selectElement.classList.add("fn__none");
|
||||||
protyle.selectElement.removeAttribute("style");
|
protyle.selectElement.removeAttribute("style");
|
||||||
if (!protyle.disabled && tableBlockElement) {
|
if (!protyle.disabled && tableBlockElement) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue