This commit is contained in:
Vanessa 2022-10-15 16:05:26 +08:00
parent b4e27951dc
commit 6711f51247
10 changed files with 19 additions and 7 deletions

View file

@ -1,5 +1,8 @@
document.body.insertAdjacentHTML('afterBegin', `<svg style="position: absolute; width: 0; height: 0; overflow: hidden;" xmlns="http://www.w3.org/2000/svg">
<defs>
<symbol id="iconRef" viewBox="0 0 32 32">
<path d="M2.545 28.491q-1.055 0-1.8-0.745t-0.745-1.8 0.745-1.8 1.8-0.745q0.182 0 0.364 0.018t0.473 0.091l7.273-7.273q-0.073-0.291-0.091-0.473t-0.018-0.364q0-1.055 0.745-1.8t1.8-0.745 1.8 0.745 0.745 1.8q0 0.073-0.109 0.836l4 4q0.291-0.073 0.473-0.091t0.364-0.018 0.364 0.018 0.473 0.091l5.818-5.818q-0.073-0.291-0.091-0.473t-0.018-0.364q0-1.055 0.745-1.8t1.8-0.745 1.8 0.745 0.745 1.8-0.745 1.8-1.8 0.745q-0.182 0-0.364-0.018t-0.473-0.091l-5.818 5.818q0.073 0.291 0.091 0.473t0.018 0.364q0 1.055-0.745 1.8t-1.8 0.745-1.8-0.745-0.745-1.8q0-0.182 0.018-0.364t0.091-0.473l-4-4q-0.291 0.073-0.473 0.091t-0.364 0.018q-0.073 0-0.836-0.109l-7.273 7.273q0.073 0.291 0.091 0.473t0.018 0.364q0 1.055-0.745 1.8t-1.8 0.745zM4.364 12.418l-0.727-1.6-1.6-0.727 1.6-0.727 0.727-1.6 0.727 1.6 1.6 0.727-1.6 0.727zM20.363 10.564l-1.127-2.4-2.4-1.127 2.4-1.127 1.127-2.4 1.127 2.4 2.4 1.127-2.4 1.127z"></path>
</symbol>
<symbol id="iconDark" viewBox="0 0 32 32">
<path d="M16 31.5q-6.458 0-10.979-4.521t-4.521-10.979 4.521-10.979 10.979-4.521q0.344 0 0.732 0.022t0.99 0.065q-1.55 1.378-2.411 3.401t-0.861 4.263q0 3.875 2.713 6.588t6.587 2.712q2.239 0 4.262-0.797t3.401-2.217q0.043 0.517 0.065 0.84t0.022 0.624q0 6.458-4.521 10.979t-10.979 4.521zM16 28.917q4.693 0 8.181-2.906t4.349-6.824q-1.076 0.474-2.303 0.71t-2.476 0.237q-4.951 0-8.417-3.466t-3.466-8.417q0-1.033 0.215-2.217t0.775-2.691q-4.219 1.163-6.997 4.715t-2.777 7.944q0 5.382 3.767 9.149t9.149 3.767z"></path>
</symbol>

View file

@ -2,5 +2,5 @@
"name": "ant",
"author": "Vanessa",
"url": "https://github.com/Vanessa219",
"version": "1.3.0"
"version": "1.4.0"
}

View file

@ -28,6 +28,12 @@
<body>
<h2>SiYuan</h2>
<div class="fn__clear">
<div>
<svg>
<use xlink:href="#iconRef"></use>
</svg>
iconRef
</div>
<div>
<svg>
<use xlink:href="#iconFilter"></use>

View file

@ -1,5 +1,8 @@
document.body.insertAdjacentHTML('afterbegin', `<svg style="position: absolute; width: 0; height: 0; overflow: hidden;" xmlns="http://www.w3.org/2000/svg">
<defs>
<symbol id="iconRef" viewBox="0 0 32 32">
<path d="M2.545 28.491q-1.055 0-1.8-0.745t-0.745-1.8 0.745-1.8 1.8-0.745q0.182 0 0.364 0.018t0.473 0.091l7.273-7.273q-0.073-0.291-0.091-0.473t-0.018-0.364q0-1.055 0.745-1.8t1.8-0.745 1.8 0.745 0.745 1.8q0 0.073-0.109 0.836l4 4q0.291-0.073 0.473-0.091t0.364-0.018 0.364 0.018 0.473 0.091l5.818-5.818q-0.073-0.291-0.091-0.473t-0.018-0.364q0-1.055 0.745-1.8t1.8-0.745 1.8 0.745 0.745 1.8-0.745 1.8-1.8 0.745q-0.182 0-0.364-0.018t-0.473-0.091l-5.818 5.818q0.073 0.291 0.091 0.473t0.018 0.364q0 1.055-0.745 1.8t-1.8 0.745-1.8-0.745-0.745-1.8q0-0.182 0.018-0.364t0.091-0.473l-4-4q-0.291 0.073-0.473 0.091t-0.364 0.018q-0.073 0-0.836-0.109l-7.273 7.273q0.073 0.291 0.091 0.473t0.018 0.364q0 1.055-0.745 1.8t-1.8 0.745zM4.364 12.418l-0.727-1.6-1.6-0.727 1.6-0.727 0.727-1.6 0.727 1.6 1.6 0.727-1.6 0.727zM20.363 10.564l-1.127-2.4-2.4-1.127 2.4-1.127 1.127-2.4 1.127 2.4 2.4 1.127-2.4 1.127z"></path>
</symbol>
<symbol id="iconDark" viewBox="0 0 32 32">
<path d="M16 31.5q-6.458 0-10.979-4.521t-4.521-10.979 4.521-10.979 10.979-4.521q0.344 0 0.732 0.022t0.99 0.065q-1.55 1.378-2.411 3.401t-0.861 4.263q0 3.875 2.713 6.588t6.587 2.712q2.239 0 4.262-0.797t3.401-2.217q0.043 0.517 0.065 0.84t0.022 0.624q0 6.458-4.521 10.979t-10.979 4.521zM16 28.917q4.693 0 8.181-2.906t4.349-6.824q-1.076 0.474-2.303 0.71t-2.476 0.237q-4.951 0-8.417-3.466t-3.466-8.417q0-1.033 0.215-2.217t0.775-2.691q-4.219 1.163-6.997 4.715t-2.777 7.944q0 5.382 3.767 9.149t9.149 3.767z"></path>
</symbol>

View file

@ -2,5 +2,5 @@
"name": "material",
"author": "Vanessa",
"url": "https://github.com/Vanessa219",
"version": "1.3.0"
"version": "1.4.0"
}

View file

@ -419,7 +419,7 @@ export class Asset extends Model {
<span class="b3-menu__label">${window.siyuan.languages.showHideBg}</span>
</button>
<button class="b3-menu__item pdf__util__hide" data-type="copy">
<svg class="b3-menu__icon"><use xlink:href="#iconGraph"></use></svg>
<svg class="b3-menu__icon"><use xlink:href="#iconRef"></use></svg>
<span class="b3-menu__label">${window.siyuan.languages.copyAnnotation}</span>
</button>
<button class="b3-menu__item pdf__util__hide" data-type="remove">

View file

@ -558,7 +558,7 @@ export const openAttr = (nodeElement: Element, protyle: IProtyle, focusName = "b
export const copySubMenu = (id: string, accelerator = true, focusElement?: Element) => {
return [
{
icon: "iconGraph",
icon: "iconRef",
accelerator: accelerator ? window.siyuan.config.keymap.editor.general.copyBlockRef.custom : undefined,
label: window.siyuan.languages.copyBlockRef,
click: () => {

View file

@ -808,7 +808,7 @@ export const linkMenu = (protyle: IProtyle, linkElement: HTMLElement, focusText
if (linkAddress?.startsWith("siyuan://blocks/")) {
window.siyuan.menus.menu.append(new MenuItem({
label: `${window.siyuan.languages.turnInto} <b>${window.siyuan.languages.blockRef}</b>`,
icon: "iconGraph",
icon: "iconRef",
click() {
linkElement.setAttribute("data-subtype", "s");
const types = linkElement.getAttribute("data-type").split(" ");

View file

@ -30,7 +30,7 @@ export const hintSlash = (key: string, protyle: IProtyle) => {
}, {
filter: ["引用块", "yinyong", "yy", "block reference"],
value: "((",
html: `<div class="b3-list-item__first"><svg class="b3-list-item__graphic"><use xlink:href="#iconGraph"></use></svg><span class="b3-list-item__text">${window.siyuan.languages.blockRef}</span><span class="b3-list-item__meta">((</span></div>`,
html: `<div class="b3-list-item__first"><svg class="b3-list-item__graphic"><use xlink:href="#iconRef"></use></svg><span class="b3-list-item__text">${window.siyuan.languages.blockRef}</span><span class="b3-list-item__meta">((</span></div>`,
}, {
filter: ["嵌入块", "qianrukuai", "qrk", "embed block"],
value: "{{",

View file

@ -148,7 +148,7 @@ export class Options {
name: "block-ref",
hotkey: window.siyuan.config.keymap.editor.insert.blockRef.custom,
lang: "blockRef",
icon: "iconGraph",
icon: "iconRef",
tipPosition: "ne",
}, {
name: "a",