Skip to content

Commit

Permalink
0.0.5 改进筛选关联定义块的显示规则
Browse files Browse the repository at this point in the history
  • Loading branch information
Misuzu2027 committed Aug 27, 2024
1 parent 1dd8608 commit e4e66d6
Show file tree
Hide file tree
Showing 28 changed files with 1,029 additions and 232 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
支持筛选的反链面板。

* 后续计划:
1. 标签页反链
2. 优化样式、排版、交互。

1. 优化样式、排版、交互。

# 注意
如果反链面板响应太慢,建议使用思源v3.1.4版本及以后,安装新版思源后需要重建索引。
7 changes: 4 additions & 3 deletions README_zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
支持筛选的反链面板。

* 后续计划:
1. 标签页反链
2. 优化样式、排版、交互。

1. 优化样式、排版、交互。

# 注意
如果反链面板响应太慢,建议使用思源v3.1.4版本及以后,安装新版思源后需要重建索引。
4 changes: 2 additions & 2 deletions plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"name": "syplugin-backlink-panel",
"author": "Misuzu2027",
"url": "https://github.com/Misuzu2027/syplugin-backlink-panel",
"version": "0.0.4",
"minAppVersion": "3.0.1",
"version": "0.0.5",
"minAppVersion": "3.1.4",
"backends": [
"all"
],
Expand Down
2 changes: 1 addition & 1 deletion scripts/make_dev_link.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import readline from 'node:readline';

//Please write the "workspace/data/plugins" directory here
//请在这里填写你的 "workspace/data/plugins" 目录
let targetDir = 'E:/AppData/SiYuanData/testSpace/data/plugins';
let targetDir = '';
//Like this
// let targetDir = `H:\\SiYuanDevSpace\\data\\plugins`;
//********************************************************************************************
Expand Down
2 changes: 1 addition & 1 deletion scripts/make_install.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const log = (info) => console.log(`\x1B[36m%s\x1B[0m`, info);
const error = (info) => console.log(`\x1B[31m%s\x1B[0m`, info);

let POST_HEADER = {
// "Authorization": `Token ${token}`,
"Authorization": ``,
"Content-Type": "application/json",
}

Expand Down
44 changes: 42 additions & 2 deletions src/components/dock/backlink-filter-panel-dock.svelte
Original file line number Diff line number Diff line change
@@ -1,19 +1,26 @@
<script lang="ts">
import { EnvConfig } from "@/config/EnvConfig";
import { onMount } from "svelte";
import { onDestroy, onMount } from "svelte";
import BacklinkFilterPanelPageSvelte from "@/components/panel/backlink-filter-panel-page.svelte";
import { isValidStr } from "@/utils/string-util";
let isMobile = false;
let dockActive: boolean;
let lastRootId: string;
let rootId: string;
let focusBlockId;
let focusBlockId: string;
let mobileSidebarObserver: MutationObserver;
// let rootElement: HTMLElement;
onMount(async () => {
init();
initObserver();
});
onDestroy(() => {
destroyObserver();
});
export function resize(clientWidth?: number) {
Expand Down Expand Up @@ -41,6 +48,39 @@
}
}
}
function initObserver() {
if (!isMobile) {
return;
}
const sidebarElement = document.getElementById("sidebar");
if (!sidebarElement) {
return;
}
mobileSidebarObserver = new MutationObserver((mutations) => {
mutations.forEach((mutation) => {
if (mutation.attributeName === "style") {
const newTransform = (mutation.target as HTMLElement).style
.transform;
if (isValidStr(newTransform)) {
dockActive = true;
rootId = lastRootId;
} else {
dockActive = false;
}
}
});
});
mobileSidebarObserver.observe(sidebarElement, { attributes: true });
}
function destroyObserver() {
if (mobileSidebarObserver) {
mobileSidebarObserver.disconnect();
}
}
</script>

{#if isMobile}
Expand Down
Loading

0 comments on commit e4e66d6

Please sign in to comment.