Skip to content

Commit

Permalink
Merge remote-tracking branch 'forke-siyuan/dev' into v0.31
Browse files Browse the repository at this point in the history
  • Loading branch information
Soltus committed Apr 24, 2024
2 parents 5a4fdc8 + 3dcb3be commit 0a7fdee
Show file tree
Hide file tree
Showing 38 changed files with 282 additions and 228 deletions.
5 changes: 4 additions & 1 deletion app/appearance/langs/en_US.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"containerBlockTip1": "Enabling container blocks will result in duplicate search results",
"containerBlockTip2": "Enabling document blocks currently only supports searching for document titles",
"copyAsPNG": "Copy as PNG",
"unbindBlock": "Unbind block",
"showTitle": "Show database title",
Expand Down Expand Up @@ -1479,6 +1481,7 @@
"242": "The binding block already exists in the current database",
"243": "Only list the first [%d] tags (including subtags), if you need to adjust, please modify [Settings - Doc Tree - Maximum number to list]",
"244": "It did not exit normally after the last use. It is recommended to execute [Doc Tree - Rebuild Index]",
"245": "It did not exit normally after the last use. It is recommended to execute [Doc Tree - Rebuild Index]. To exit normally, you need to use [Exit Application] in the right panel"
"245": "It did not exit normally after the last use. It is recommended to execute [Doc Tree - Rebuild Index]. To exit normally, you need to use [Exit Application] in the right panel",
"246": "The document title cannot contain / and has been replaced with _"
}
}
5 changes: 4 additions & 1 deletion app/appearance/langs/es_ES.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"containerBlockTip1": "Habilitar bloques de contenedores generará resultados de búsqueda duplicados",
"containerBlockTip2": "Habilitar bloques de documentos actualmente solo admite la búsqueda de títulos de documentos",
"copyAsPNG": "Copiar como PNG",
"unbindBlock": "Desvincular bloque",
"showTitle": "Mostrar título de la base de datos",
Expand Down Expand Up @@ -1479,6 +1481,7 @@
"242": "El bloque de enlace ya existe en la base de datos actual",
"243": "Enumere solo las primeras [%d] etiquetas (incluidas las subetiquetas), modifique [Configuración - Árbol de documentos - Número máximo a listar]",
"244": "No salió normalmente después del último uso. Se recomienda ejecutar [Árbol de documentos - Reconstruir índice]",
"245": "No salió normalmente después del último uso. Se recomienda ejecutar [Árbol de documentos - Reconstruir índice]. Para salir normalmente, necesita usar [Salir de la aplicación] en el panel derecho"
"245": "No salió normalmente después del último uso. Se recomienda ejecutar [Árbol de documentos - Reconstruir índice]. Para salir normalmente, necesita usar [Salir de la aplicación] en el panel derecho",
"246": "El título del documento no puede contener / y ha sido reemplazado por _"
}
}
5 changes: 4 additions & 1 deletion app/appearance/langs/fr_FR.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"containerBlockTip1": "L'activation des blocs de conteneurs entraînera des résultats de recherche en double",
"containerBlockTip2": "L'activation des blocs de documents ne prend actuellement en charge que la recherche de titres de documents",
"copyAsPNG": "Copier en tant PNG",
"unbindBlock": "Dissocier le bloc",
"showTitle": "Afficher le titre de la base de données",
Expand Down Expand Up @@ -1479,6 +1481,7 @@
"242": "Le bloc de liaison existe déjà dans la base de données actuelle",
"243": "Répertorier uniquement les [%d] premières balises (y compris les sous-balises). veuillez modifier [Paramètres - Arbre des documents - Nombre maximum de documents à lister].",
"244": "Il ne s'est pas terminé normalement après la dernière utilisation. Il est recommandé d'exécuter [Doc Tree - Rebuild Index]",
"245": "Il ne s'est pas terminé normalement après la dernière utilisation. Il est recommandé d'exécuter [Doc Tree - Rebuild Index]. Pour quitter normalement, vous devez utiliser [Quitter l'application] dans le panneau de droite"
"245": "Il ne s'est pas terminé normalement après la dernière utilisation. Il est recommandé d'exécuter [Doc Tree - Rebuild Index]. Pour quitter normalement, vous devez utiliser [Quitter l'application] dans le panneau de droite",
"246": "Le titre du document ne peut pas contenir / et a été remplacé par _"
}
}
5 changes: 4 additions & 1 deletion app/appearance/langs/zh_CHT.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"containerBlockTip1": "啟用容器區塊後會導致搜尋結果重複",
"containerBlockTip2": "啟用文件區塊目前僅支援搜尋文件名稱",
"copyAsPNG": "複製為 PNG",
"unbindBlock": "取消綁定區塊",
"showTitle": "顯示資料庫標題",
Expand Down Expand Up @@ -1479,6 +1481,7 @@
"242": "目前資料庫中已經存在該綁定區塊",
"243": "僅列出前 [%d] 個標籤(含子標籤),如需調整請修改 [設置 - 文檔樹 - 最大列出數量]",
"244": "上次使用後未正常退出,建議執行一次 [文檔樹 - 重建索引]",
"245": "上次使用後未正常退出,建議執行一次 [文件樹 - 重建索引],正常退出需使用右側欄面板中的 [退出應用]"
"245": "上次使用後未正常退出,建議執行一次 [文件樹 - 重建索引],正常退出需使用右側欄面板中的 [退出應用]",
"246": "文件標題不能包含 /,已經使用 _ 替換"
}
}
5 changes: 4 additions & 1 deletion app/appearance/langs/zh_CN.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"containerBlockTip1": "启用容器块后会导致搜索结果重复",
"containerBlockTip2": "启用文档块目前仅支持搜索文档名",
"copyAsPNG": "复制为 PNG",
"unbindBlock": "取消绑定块",
"showTitle": "显示数据库标题",
Expand Down Expand Up @@ -1481,6 +1483,7 @@
"242": "当前数据库中已经存在该绑定块",
"243": "仅列出前 [%d] 个标签(含子标签),如需调整请修改 [设置 - 文档树 - 最大列出数量]",
"244": "上次使用后未正常退出,建议执行一次 [文档树 - 重建索引]",
"245": "上次使用后未正常退出,建议执行一次 [文档树 - 重建索引],正常退出需使用右侧栏面板中的 [退出应用]"
"245": "上次使用后未正常退出,建议执行一次 [文档树 - 重建索引],正常退出需使用右侧栏面板中的 [退出应用]",
"246": "文档标题不能包含 /,已经使用 _ 替换"
}
}
7 changes: 5 additions & 2 deletions app/src/assets/scss/business/_av.scss
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,12 @@
font-size: 87.5%;

.item__graphic {
height: 1.625em;
height: calc(1.625em - 10px);
width: calc(1.625em - 10px);
padding: 5px 5px 5px 8px;
padding: 10px 5px 10px 8px;
line-height: calc(1.625em - 10px);
font-size: inherit;
text-align: center;
}

.item__text {
Expand Down
97 changes: 51 additions & 46 deletions app/src/config/query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,141 +25,146 @@ export const query = {
<input class="b3-switch" id="table" type="checkbox"${window.siyuan.config.search.table ? " checked" : ""}/>
</label>
<label class="fn__flex">
<svg class="svg"><use xlink:href="#iconQuote"></use></svg>
<svg class="svg"><use xlink:href="#iconParagraph"></use></svg>
<span class="fn__space"></span>
<div class="fn__flex-1">
${window.siyuan.languages.quote}
${window.siyuan.languages.paragraph}
</div>
<span class="fn__space"></span>
<input class="b3-switch" id="blockquote" type="checkbox"${window.siyuan.config.search.blockquote ? " checked" : ""}/>
<input class="b3-switch" id="paragraph" type="checkbox"${window.siyuan.config.search.paragraph ? " checked" : ""}/>
</label>
<label class="fn__flex">
<svg class="svg"><use xlink:href="#iconSuper"></use></svg>
<svg class="svg"><use xlink:href="#iconHeadings"></use></svg>
<span class="fn__space"></span>
<div class="fn__flex-1">
${window.siyuan.languages.superBlock}
${window.siyuan.languages.headings}
</div>
<span class="fn__space"></span>
<input class="b3-switch" id="superBlock" type="checkbox"${window.siyuan.config.search.superBlock ? " checked" : ""}/>
<input class="b3-switch" id="heading" type="checkbox"${window.siyuan.config.search.heading ? " checked" : ""}/>
</label>
<label class="fn__flex">
<svg class="svg"><use xlink:href="#iconParagraph"></use></svg>
<svg class="svg"><use xlink:href="#iconCode"></use></svg>
<span class="fn__space"></span>
<div class="fn__flex-1">
${window.siyuan.languages.paragraph}
${window.siyuan.languages.code}
</div>
<span class="fn__space"></span>
<input class="b3-switch" id="paragraph" type="checkbox"${window.siyuan.config.search.paragraph ? " checked" : ""}/>
<input class="b3-switch" id="codeBlock" type="checkbox"${window.siyuan.config.search.codeBlock ? " checked" : ""}/>
</label>
<label class="fn__flex">
<svg class="svg"><use xlink:href="#iconFile"></use></svg>
<svg class="svg"><use xlink:href="#iconHTML5"></use></svg>
<span class="fn__space"></span>
<div class="fn__flex-1">
${window.siyuan.languages.doc}
HTML
</div>
<span class="fn__space"></span>
<input class="b3-switch" id="document" type="checkbox"${window.siyuan.config.search.document ? " checked" : ""}/>
<input class="b3-switch" id="htmlBlock" type="checkbox"${window.siyuan.config.search.htmlBlock ? " checked" : ""}/>
</label>
<label class="fn__flex">
<svg class="svg"><use xlink:href="#iconHeadings"></use></svg>
<svg class="svg"><use xlink:href="#iconDatabase"></use></svg>
<span class="fn__space"></span>
<div class="fn__flex-1">
${window.siyuan.languages.headings}
${window.siyuan.languages.database}
</div>
<span class="fn__space"></span>
<input class="b3-switch" id="heading" type="checkbox"${window.siyuan.config.search.heading ? " checked" : ""}/>
</label>
<input class="b3-switch" id="databaseBlock" type="checkbox"${window.siyuan.config.search.databaseBlock ? " checked" : ""}/>
</label>
<label class="fn__flex">
<svg class="svg"><use xlink:href="#iconList"></use></svg>
<svg class="svg"><use xlink:href="#iconSQL"></use></svg>
<span class="fn__space"></span>
<div class="fn__flex-1">
${window.siyuan.languages.list1}
${window.siyuan.languages.embedBlock}
</div>
<span class="fn__space"></span>
<input class="b3-switch" id="list" type="checkbox"${window.siyuan.config.search.list ? " checked" : ""}/>
<input class="b3-switch" id="embedBlock" type="checkbox"${window.siyuan.config.search.embedBlock ? " checked" : ""}/>
</label>
<label class="fn__flex">
<svg class="svg"><use xlink:href="#iconListItem"></use></svg>
<svg class="svg"><use xlink:href="#iconVideo"></use></svg>
<span class="fn__space"></span>
<div class="fn__flex-1">
${window.siyuan.languages.listItem}
${window.siyuan.languages.video}
</div>
<span class="fn__space"></span>
<input class="b3-switch" id="listItem" type="checkbox"${window.siyuan.config.search.listItem ? " checked" : ""}/>
<input class="b3-switch" id="videoBlock" type="checkbox"${window.siyuan.config.search.videoBlock ? " checked" : ""}/>
</label>
<label class="fn__flex">
<svg class="svg"><use xlink:href="#iconCode"></use></svg>
<svg class="svg"><use xlink:href="#iconRecord"></use></svg>
<span class="fn__space"></span>
<div class="fn__flex-1">
${window.siyuan.languages.code}
${window.siyuan.languages.audio}
</div>
<span class="fn__space"></span>
<input class="b3-switch" id="codeBlock" type="checkbox"${window.siyuan.config.search.codeBlock ? " checked" : ""}/>
<input class="b3-switch" id="audioBlock" type="checkbox"${window.siyuan.config.search.audioBlock ? " checked" : ""}/>
</label>
<label class="fn__flex">
<svg class="svg"><use xlink:href="#iconHTML5"></use></svg>
<svg class="svg"><use xlink:href="#iconLanguage"></use></svg>
<span class="fn__space"></span>
<div class="fn__flex-1">
HTML
IFrame
</div>
<span class="fn__space"></span>
<input class="b3-switch" id="htmlBlock" type="checkbox"${window.siyuan.config.search.htmlBlock ? " checked" : ""}/>
<input class="b3-switch" id="iframeBlock" type="checkbox"${window.siyuan.config.search.iframeBlock ? " checked" : ""}/>
</label>
<label class="fn__flex">
<svg class="svg"><use xlink:href="#iconSQL"></use></svg>
<svg class="svg"><use xlink:href="#iconBoth"></use></svg>
<span class="fn__space"></span>
<div class="fn__flex-1">
${window.siyuan.languages.embedBlock}
${window.siyuan.languages.widget}
</div>
<span class="fn__space"></span>
<input class="b3-switch" id="embedBlock" type="checkbox"${window.siyuan.config.search.embedBlock ? " checked" : ""}/>
<input class="b3-switch" id="widgetBlock" type="checkbox"${window.siyuan.config.search.widgetBlock ? " checked" : ""}/>
</label>
<label class="fn__flex">
<svg class="svg"><use xlink:href="#iconDatabase"></use></svg>
<svg class="svg"><use xlink:href="#iconQuote"></use></svg>
<span class="fn__space"></span>
<div class="fn__flex-1">
${window.siyuan.languages.database}
${window.siyuan.languages.quote} <sup>[1]</sup>
</div>
<span class="fn__space"></span>
<input class="b3-switch" id="databaseBlock" type="checkbox"${window.siyuan.config.search.databaseBlock ? " checked" : ""}/>
<input class="b3-switch" id="blockquote" type="checkbox"${window.siyuan.config.search.blockquote ? " checked" : ""}/>
</label>
<label class="fn__flex">
<svg class="svg"><use xlink:href="#iconVideo"></use></svg>
<svg class="svg"><use xlink:href="#iconSuper"></use></svg>
<span class="fn__space"></span>
<div class="fn__flex-1">
${window.siyuan.languages.video}
${window.siyuan.languages.superBlock} <sup>[1]</sup>
</div>
<span class="fn__space"></span>
<input class="b3-switch" id="videoBlock" type="checkbox"${window.siyuan.config.search.videoBlock ? " checked" : ""}/>
<input class="b3-switch" id="superBlock" type="checkbox"${window.siyuan.config.search.superBlock ? " checked" : ""}/>
</label>
<label class="fn__flex">
<svg class="svg"><use xlink:href="#iconRecord"></use></svg>
<svg class="svg"><use xlink:href="#iconList"></use></svg>
<span class="fn__space"></span>
<div class="fn__flex-1">
${window.siyuan.languages.audio}
${window.siyuan.languages.list1} <sup>[1]</sup>
</div>
<span class="fn__space"></span>
<input class="b3-switch" id="audioBlock" type="checkbox"${window.siyuan.config.search.audioBlock ? " checked" : ""}/>
<input class="b3-switch" id="list" type="checkbox"${window.siyuan.config.search.list ? " checked" : ""}/>
</label>
<label class="fn__flex">
<svg class="svg"><use xlink:href="#iconLanguage"></use></svg>
<svg class="svg"><use xlink:href="#iconListItem"></use></svg>
<span class="fn__space"></span>
<div class="fn__flex-1">
IFrame
${window.siyuan.languages.listItem} <sup>[1]</sup>
</div>
<span class="fn__space"></span>
<input class="b3-switch" id="iframeBlock" type="checkbox"${window.siyuan.config.search.iframeBlock ? " checked" : ""}/>
<input class="b3-switch" id="listItem" type="checkbox"${window.siyuan.config.search.listItem ? " checked" : ""}/>
</label>
<label class="fn__flex">
<svg class="svg"><use xlink:href="#iconBoth"></use></svg>
<svg class="svg"><use xlink:href="#iconFile"></use></svg>
<span class="fn__space"></span>
<div class="fn__flex-1">
${window.siyuan.languages.widget}
${window.siyuan.languages.doc} <sup>[1] [2]</sup>
</div>
<span class="fn__space"></span>
<input class="b3-switch" id="widgetBlock" type="checkbox"${window.siyuan.config.search.widgetBlock ? " checked" : ""}/>
<input class="b3-switch" id="document" type="checkbox"${window.siyuan.config.search.document ? " checked" : ""}/>
</label>
</div>
<span class="fn__space"></span>
<div class="fn__flex-1">
<div class="b3-label__text">[1] ${window.siyuan.languages.containerBlockTip1}</div>
<div class="b3-label__text">[2] ${window.siyuan.languages.containerBlockTip2}</div>
</div>
</div>
<div class="b3-label">
${window.siyuan.languages.searchBlockAttr}
Expand Down
4 changes: 3 additions & 1 deletion app/src/dialog/processSystem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,7 @@ export const transactionError = () => {
});
};

let statusMobileTimeout:number;
export const progressStatus = (data: IWebSocketData) => {
// window.sout.tracker("invoked"); // 这里调用频繁
const statusElement = document.querySelector("#status") as HTMLElement;
Expand All @@ -306,9 +307,10 @@ export const progressStatus = (data: IWebSocketData) => {
if (!document.querySelector("#keyboardToolbar").classList.contains("fn__none")) {
return;
}
clearTimeout(statusMobileTimeout);
statusElement.innerHTML = data.msg;
statusElement.style.bottom = "0";
setTimeout(() => {
statusMobileTimeout = window.setTimeout(() => {
statusElement.style.bottom = "";
}, 5000);
return;
Expand Down
2 changes: 1 addition & 1 deletion app/src/menus/protyle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1303,7 +1303,7 @@ export const linkMenu = (protyle: IProtyle, linkElement: HTMLElement, focusText
});
const popoverElement = hasTopClosestByClassName(protyle.element, "block__popover", true);
window.siyuan.menus.menu.element.setAttribute("data-from", popoverElement ? popoverElement.dataset.level + "popover" : "app");
if (focusText || protyle.lute.IsValidLinkDest(linkAddress)) {
if (focusText || protyle.lute.GetLinkDest(linkAddress)) {
inputElements[1].select();
} else {
inputElements[0].select();
Expand Down
12 changes: 12 additions & 0 deletions app/src/protyle/render/av/blockAttr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {hasClosestBlock, hasClosestByClassName} from "../../util/hasClosest";
import {unicode2Emoji} from "../../../emoji";
import {transaction} from "../../wysiwyg/transaction";
import {openMenuPanel} from "./openMenuPanel";
import {uploadFiles} from "../../upload";

const genAVRollupHTML = (value: IAVCellValue) => {
window.sout.tracker("invoked");
Expand Down Expand Up @@ -278,6 +279,12 @@ class="fn__flex-1 fn__flex${["url", "text", "number", "email", "phone", "block"]
window.siyuan.dragElement = undefined;
}
});
element.addEventListener("paste", (event) => {
const files = event.clipboardData.files;
if (document.querySelector(".av__panel .b3-form__upload") && files && files.length > 0) {
uploadFiles(protyle, files);
}
})
element.addEventListener("click", (event) => {
let target = event.target as HTMLElement;
const blockElement = hasClosestBlock(target);
Expand All @@ -297,6 +304,11 @@ class="fn__flex-1 fn__flex${["url", "text", "number", "email", "phone", "block"]
event.preventDefault();
break;
} else if (type === "mAsset") {
element.querySelectorAll('.custom-attr__avvalue[data-type="mAsset"]').forEach(item => {
item.removeAttribute("data-active");
})
target.setAttribute("data-active", "true");
target.focus();
popTextCell(protyle, [target], "mAsset");
event.stopPropagation();
event.preventDefault();
Expand Down
Loading

0 comments on commit 0a7fdee

Please sign in to comment.