From e47c29d2fd4eae06c511c914e2a5fcb057b44d7b Mon Sep 17 00:00:00 2001
From: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 19 Aug 2024 21:14:29 +0000
Subject: [PATCH] chore(deps): bump rehype-katex from 7.0.0 to 7.0.1 (#1356)
---
quartz/components/Explorer.tsx | 16 ++++++++++------
1 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/quartz/components/Explorer.tsx b/quartz/components/Explorer.tsx
index cffc079..ec7c48e 100644
--- a/quartz/components/Explorer.tsx
+++ b/quartz/components/Explorer.tsx
@@ -44,12 +44,9 @@
// memoized
let fileTree: FileNode
let jsonTree: string
+ let lastBuildId: string = ""
function constructFileTree(allFiles: QuartzPluginData[]) {
- if (fileTree) {
- return
- }
-
// Construct tree from allFiles
fileTree = new FileNode("")
allFiles.forEach((file) => fileTree.add(file))
@@ -76,12 +73,17 @@
}
const Explorer: QuartzComponent = ({
+ ctx,
cfg,
allFiles,
displayClass,
fileData,
}: QuartzComponentProps) => {
- constructFileTree(allFiles)
+ if (ctx.buildId !== lastBuildId) {
+ lastBuildId = ctx.buildId
+ constructFileTree(allFiles)
+ }
+
return (
<div class={classNames(displayClass, "explorer")}>
<button
@@ -91,8 +93,10 @@
data-collapsed={opts.folderDefaultState}
data-savestate={opts.useSavedState}
data-tree={jsonTree}
+ aria-controls="explorer-content"
+ aria-expanded={opts.folderDefaultState === "open"}
>
- <h1>{opts.title ?? i18n(cfg.locale).components.explorer.title}</h1>
+ <h2>{opts.title ?? i18n(cfg.locale).components.explorer.title}</h2>
<svg
xmlns="http://www.w3.org/2000/svg"
width="14"
--
Gitblit v1.10.0