Vanessa 2023-11-07 09:02:01 +08:00
parent 6616236634
commit 1b5fba3d73
4 changed files with 15 additions and 19 deletions

View file

@ -4,7 +4,7 @@
&__pulse {
width: 70%;
height: 26px;
height: 23px;
position: relative;
overflow: hidden;
background: var(--b3-border-color);
@ -61,10 +61,14 @@
&__gutters {
@extend .protyle-gutters;
position: absolute;
top: 5px;
left: -26px;
top: 0;
left: -44px;
opacity: 0;
padding-right: 4px;
display: flex;
svg {
height: 25px;
}
}
&__mask {

View file

@ -21,10 +21,6 @@ export const initBlockPopover = (app: App) => {
hasClosestByAttribute(event.target, "data-type", "inline-memo");
if (aElement) {
let tip = aElement.getAttribute("aria-label") || aElement.getAttribute("data-inline-memo-content");
// 折叠块标文案替换
if (hasClosestByAttribute(event.target, "data-type", "fold", true)) {
tip = window.siyuan.languages.fold;
}
if (aElement.classList.contains("av__celltext")) {
if (aElement.scrollWidth > aElement.parentElement.clientWidth - 11) {
if (aElement.querySelector(".av__cellicon")) {

View file

@ -46,13 +46,6 @@ export class Gutter {
constructor(protyle: IProtyle) {
this.element = document.createElement("div");
this.element.className = "protyle-gutters";
if (/Mac/.test(navigator.platform) || navigator.platform === "iPhone") {
this.element.setAttribute("aria-label", window.siyuan.languages.gutterTip);
} else {
this.element.setAttribute("aria-label", window.siyuan.languages.gutterTip.replace("⌥⌘A", "Ctrl+Alt+A").replace(/⌘/g, "Ctrl+").replace(/⌥/g, "Alt+").replace(/⇧/g, "Shift+").replace(/⌃/g, "Ctrl+"));
}
this.element.setAttribute("data-type", "a");
this.element.setAttribute("data-position", "right");
this.element.addEventListener("dragstart", (event: DragEvent & { target: HTMLElement }) => {
hideTooltip();
const buttonElement = event.target.parentElement;
@ -1843,7 +1836,8 @@ export class Gutter {
html = "";
}
index += 1;
const buttonHTML = `<button data-type="${type}" data-subtype="${nodeElement.getAttribute("data-subtype")}" data-node-id="${nodeElement.getAttribute("data-node-id")}">
const buttonHTML = `<button class="ariaLabel" data-position="right" aria-label="${window.siyuan.languages.gutterTip}"
data-type="${type}" data-subtype="${nodeElement.getAttribute("data-subtype")}" data-node-id="${nodeElement.getAttribute("data-node-id")}">
<svg><use xlink:href="#${getIconByType(type, nodeElement.getAttribute("data-subtype"))}"></use></svg>
<span ${protyle.disabled ? "" : 'draggable="true"'}></span>
</button>`;
@ -1853,7 +1847,8 @@ export class Gutter {
let foldHTML = "";
if (type === "NodeListItem" && nodeElement.childElementCount > 3 || type === "NodeHeading") {
const fold = nodeElement.getAttribute("fold");
foldHTML = `<button data-type="fold"><svg style="width:10px${fold && fold === "1" ? "" : ";transform:rotate(90deg)"}"><use xlink:href="#iconPlay"></use></svg></button>`;
foldHTML = `<button class="ariaLabel" data-position="right" aria-label="${window.siyuan.languages.fold}"
data-type="fold"><svg style="width:10px${fold && fold === "1" ? "" : ";transform:rotate(90deg)"}"><use xlink:href="#iconPlay"></use></svg></button>`;
}
if (type === "NodeListItem" || type === "NodeList") {
listItem = nodeElement;

View file

@ -79,8 +79,9 @@ style="width: ${column.width || "200px"}">${getCalcValue(column) || '<svg><use x
// body
data.rows.forEach((row: IAVRow) => {
tableHTML += `<div class="av__row" data-id="${row.id}">
<div class="av__gutters ariaLabel" draggable="true" data-position="right" aria-label="${window.siyuan.languages.rowTip}">
<button><svg><use xlink:href="#iconDrag"></use></svg></button>
<div class="av__gutters">
<button class="ariaLabel" data-position="right" aria-label="${window.siyuan.languages.d}"><svg><use xlink:href="#iconAdd"></use></svg></button>
<button class="ariaLabel" draggable="true" data-position="right" aria-label="${window.siyuan.languages.rowTip}"><svg><use xlink:href="#iconDrag"></use></svg></button>
</div>
<div class="av__firstcol"><svg><use xlink:href="#iconUncheck"></use></svg></div>`;
row.cells.forEach((cell, index) => {