From 4901472aa88e817d3eb304b7b5e677bba79cd5cd Mon Sep 17 00:00:00 2001
From: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date: Tue, 25 Feb 2025 21:52:52 +0000
Subject: [PATCH] chore(deps): bump the production-dependencies group with 8 updates (#1788)
---
quartz/components/Explorer.tsx | 110 +++++++++++++++++++++++++++++++++---------------------
1 files changed, 67 insertions(+), 43 deletions(-)
diff --git a/quartz/components/Explorer.tsx b/quartz/components/Explorer.tsx
index df876ab..ac276a8 100644
--- a/quartz/components/Explorer.tsx
+++ b/quartz/components/Explorer.tsx
@@ -1,5 +1,5 @@
import { QuartzComponent, QuartzComponentConstructor, QuartzComponentProps } from "./types"
-import explorerStyle from "./styles/explorer.scss"
+import style from "./styles/explorer.scss"
// @ts-ignore
import script from "./scripts/explorer.inline"
@@ -7,7 +7,6 @@
import { QuartzPluginData } from "../plugins/vfile"
import { classNames } from "../util/lang"
import { i18n } from "../i18n"
-import { VNode } from "preact"
// Options interface defined in `ExplorerNode` to avoid circular dependency
const defaultOptions = {
@@ -45,7 +44,6 @@
// memoized
let fileTree: FileNode
let jsonTree: string
- let component: VNode
let lastBuildId: string = ""
function constructFileTree(allFiles: QuartzPluginData[]) {
@@ -84,49 +82,75 @@
if (ctx.buildId !== lastBuildId) {
lastBuildId = ctx.buildId
constructFileTree(allFiles)
- const tree = ExplorerNode({ node: fileTree, opts, fileData })
- component = (
- <div class={classNames(displayClass, "explorer")}>
- <button
- type="button"
- id="explorer"
- data-behavior={opts.folderClickBehavior}
- data-collapsed={opts.folderDefaultState}
- data-savestate={opts.useSavedState}
- data-tree={jsonTree}
- aria-controls="explorer-content"
- aria-expanded={opts.folderDefaultState === "open"}
- >
- <h2>{opts.title ?? i18n(cfg.locale).components.explorer.title}</h2>
- <svg
- xmlns="http://www.w3.org/2000/svg"
- width="14"
- height="14"
- viewBox="5 8 14 8"
- fill="none"
- stroke="currentColor"
- stroke-width="2"
- stroke-linecap="round"
- stroke-linejoin="round"
- class="fold"
- >
- <polyline points="6 9 12 15 18 9"></polyline>
- </svg>
- </button>
- <div id="explorer-content">
- <ul class="overflow" id="explorer-ul">
- {tree}
- <li id="explorer-end" />
- </ul>
- </div>
- </div>
- )
}
-
- return component
+ return (
+ <div class={classNames(displayClass, "explorer")}>
+ <button
+ type="button"
+ id="mobile-explorer"
+ class="collapsed hide-until-loaded"
+ data-behavior={opts.folderClickBehavior}
+ data-collapsed={opts.folderDefaultState}
+ data-savestate={opts.useSavedState}
+ data-tree={jsonTree}
+ data-mobile={true}
+ aria-controls="explorer-content"
+ aria-expanded={false}
+ >
+ <svg
+ xmlns="http://www.w3.org/2000/svg"
+ width="24"
+ height="24"
+ viewBox="0 0 24 24"
+ stroke-width="2"
+ stroke-linecap="round"
+ stroke-linejoin="round"
+ class="lucide lucide-menu"
+ >
+ <line x1="4" x2="20" y1="12" y2="12" />
+ <line x1="4" x2="20" y1="6" y2="6" />
+ <line x1="4" x2="20" y1="18" y2="18" />
+ </svg>
+ </button>
+ <button
+ type="button"
+ id="desktop-explorer"
+ class="title-button"
+ data-behavior={opts.folderClickBehavior}
+ data-collapsed={opts.folderDefaultState}
+ data-savestate={opts.useSavedState}
+ data-tree={jsonTree}
+ data-mobile={false}
+ aria-controls="explorer-content"
+ aria-expanded={true}
+ >
+ <h2>{opts.title ?? i18n(cfg.locale).components.explorer.title}</h2>
+ <svg
+ xmlns="http://www.w3.org/2000/svg"
+ width="14"
+ height="14"
+ viewBox="5 8 14 8"
+ fill="none"
+ stroke="currentColor"
+ stroke-width="2"
+ stroke-linecap="round"
+ stroke-linejoin="round"
+ class="fold"
+ >
+ <polyline points="6 9 12 15 18 9"></polyline>
+ </svg>
+ </button>
+ <div id="explorer-content">
+ <ul class="overflow" id="explorer-ul">
+ <ExplorerNode node={fileTree} opts={opts} fileData={fileData} />
+ <li id="explorer-end" />
+ </ul>
+ </div>
+ </div>
+ )
}
- Explorer.css = explorerStyle
+ Explorer.css = style
Explorer.afterDOMLoaded = script
return Explorer
}) satisfies QuartzComponentConstructor
--
Gitblit v1.10.0