fix: restore icon viewer and zip preview icons (#1036)
This commit is contained in:
parent
359386daed
commit
599d761005
6 changed files with 46 additions and 17 deletions
|
|
@ -147,7 +147,7 @@ export const globPlugins = kind => ({
|
|||
});
|
||||
|
||||
build.onLoad({ filter, namespace: "import-plugins" }, async () => {
|
||||
const pluginDirs = ["plugins/_api", "plugins/_core", "plugins", "equicordplugins", "equicordplugins/_api", "userplugins"];
|
||||
const pluginDirs = ["plugins/_api", "plugins/_core", "plugins", "equicordplugins/_api", "equicordplugins/_core", "equicordplugins", "userplugins"];
|
||||
let code = "";
|
||||
let pluginsCode = "\n";
|
||||
let metaCode = "\n";
|
||||
|
|
|
|||
|
|
@ -31,11 +31,11 @@ import { getEntryPoint, isPluginFile, parseDevs, parseEquicordDevs, parseFile, P
|
|||
let dirs: string[];
|
||||
|
||||
if (equicordFlag) {
|
||||
dirs = ["src/equicordplugins"];
|
||||
dirs = ["src/equicordplugins/_core", "src/equicordplugins"];
|
||||
} else if (vencordFlag) {
|
||||
dirs = ["src/plugins", "src/plugins/_core"];
|
||||
} else {
|
||||
dirs = ["src/plugins", "src/plugins/_core", "src/equicordplugins"];
|
||||
dirs = ["src/plugins", "src/plugins/_core", "src/equicordplugins/_core", "src/equicordplugins"];
|
||||
}
|
||||
|
||||
const outputPath = args.find(a => !a.startsWith("--")) ?? null;
|
||||
|
|
|
|||
|
|
@ -730,6 +730,34 @@ export function ClockIcon(props: IconProps) {
|
|||
);
|
||||
}
|
||||
|
||||
export function ChevronSmallDownIcon(props: IconProps) {
|
||||
return (
|
||||
<Icon
|
||||
{...props}
|
||||
viewBox="0 0 24 24"
|
||||
>
|
||||
<path
|
||||
fill={props.fill || "currentColor"}
|
||||
d="M5.3 9.3a1 1 0 0 1 1.4 0l5.3 5.29 5.3-5.3a1 1 0 1 1 1.4 1.42l-6 6a1 1 0 0 1-1.4 0l-6-6a1 1 0 0 1 0-1.42Z"
|
||||
/>
|
||||
</Icon>
|
||||
);
|
||||
}
|
||||
|
||||
export function ChevronSmallUpIcon(props: IconProps) {
|
||||
return (
|
||||
<Icon
|
||||
{...props}
|
||||
viewBox="0 0 24 24"
|
||||
>
|
||||
<path
|
||||
fill={props.fill || "currentColor"}
|
||||
d="M5.3 14.7a1 1 0 0 0 1.4 0l5.3-5.29 5.3 5.3a1 1 0 1 0 1.4-1.42l-6-6a1 1 0 0 0-1.4 0l-6 6a1 1 0 0 0 0 1.42Z"
|
||||
/>
|
||||
</Icon>
|
||||
);
|
||||
}
|
||||
|
||||
export function DownArrow(props: IconProps) {
|
||||
return (
|
||||
<Icon
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ export default definePlugin({
|
|||
}
|
||||
}
|
||||
],
|
||||
set iconsModule(value: any) {
|
||||
iconsModule(value: IconsDef) {
|
||||
iconsModule = value;
|
||||
},
|
||||
});
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import { CodeBlock } from "@components/CodeBlock";
|
|||
import ErrorBoundary from "@components/ErrorBoundary";
|
||||
import { Flex } from "@components/Flex";
|
||||
import { Heading } from "@components/Heading";
|
||||
import { iconsModule } from "@equicordplugins/_core/concatenatedModules";
|
||||
import { ChevronSmallDownIcon, ChevronSmallUpIcon, FolderIcon } from "@components/Icons";
|
||||
import { classNameFactory } from "@utils/css";
|
||||
import { copyWithToast } from "@utils/discord";
|
||||
import { closeModal, ModalCloseButton, ModalContent, ModalFooter, ModalHeader, ModalRoot, ModalSize, openModal } from "@utils/modal";
|
||||
|
|
@ -31,6 +31,7 @@ import {
|
|||
} from "./utils";
|
||||
|
||||
export const cl = classNameFactory("vc-zip-preview-");
|
||||
const breadcrumbColorStyle = { color: "var(--text-muted)" };
|
||||
|
||||
interface VisibleEntries {
|
||||
directories: string[];
|
||||
|
|
@ -68,6 +69,7 @@ export function ZipPreviewInline(props: ZipPreviewAttachmentProps) {
|
|||
const [isExpanded, setIsExpanded] = useState(false);
|
||||
const [isContentMounted, setIsContentMounted] = useState(false);
|
||||
const [currentPath, setCurrentPath] = useState("");
|
||||
const ToggleIcon = isExpanded ? ChevronSmallUpIcon : ChevronSmallDownIcon;
|
||||
const animationFrameRef = useRef<number | null>(null);
|
||||
const animationTimeoutRef = useRef<number | null>(null);
|
||||
const loadRequestIdRef = useRef(0);
|
||||
|
|
@ -148,9 +150,7 @@ export function ZipPreviewInline(props: ZipPreviewAttachmentProps) {
|
|||
setExpanded(!isExpanded);
|
||||
}}
|
||||
>
|
||||
{isExpanded
|
||||
? <iconsModule.ChevronSmallUpIcon className={cl("toggle-icon")} />
|
||||
: <iconsModule.ChevronSmallDownIcon className={cl("toggle-icon")} />}
|
||||
<ToggleIcon className={cl("toggle-icon")} />
|
||||
</button>
|
||||
</div>
|
||||
);
|
||||
|
|
@ -193,8 +193,8 @@ function ZipPreviewBreadcrumb({ path, onNavigate }: { path: string; onNavigate:
|
|||
if (!path) {
|
||||
return (
|
||||
<div className={cl("breadcrumb")}>
|
||||
<iconsModule.FolderIcon className={cl("breadcrumb-icon")} />
|
||||
<span className={cl("breadcrumb-current")}>/</span>
|
||||
<FolderIcon className={cl("breadcrumb-icon")} style={breadcrumbColorStyle} />
|
||||
<span className={cl("breadcrumb-current")} style={breadcrumbColorStyle}>/</span>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
@ -203,7 +203,7 @@ function ZipPreviewBreadcrumb({ path, onNavigate }: { path: string; onNavigate:
|
|||
|
||||
return (
|
||||
<div className={cl("breadcrumb")}>
|
||||
<iconsModule.FolderIcon className={cl("breadcrumb-icon")} />
|
||||
<FolderIcon className={cl("breadcrumb-icon")} style={breadcrumbColorStyle} />
|
||||
<button
|
||||
className={cl("breadcrumb-segment")}
|
||||
type="button"
|
||||
|
|
@ -222,7 +222,7 @@ function ZipPreviewBreadcrumb({ path, onNavigate }: { path: string; onNavigate:
|
|||
return (
|
||||
<span key={segmentPath}>
|
||||
{isLast
|
||||
? <span className={cl("breadcrumb-current")}>{part}/</span>
|
||||
? <span className={cl("breadcrumb-current")} style={breadcrumbColorStyle}>{part}/</span>
|
||||
: (
|
||||
<button
|
||||
className={cl("breadcrumb-segment")}
|
||||
|
|
|
|||
|
|
@ -170,14 +170,15 @@
|
|||
align-items: center;
|
||||
gap: 4px;
|
||||
margin-bottom: 4px;
|
||||
color: var(--text-normal);
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
.vc-zip-preview-breadcrumb-icon {
|
||||
.vc-zip-preview-breadcrumb > .vc-zip-preview-breadcrumb-icon {
|
||||
flex-shrink: 0;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
color: var(--text-normal);
|
||||
color: var(--text-muted);
|
||||
fill: currentcolor;
|
||||
}
|
||||
|
||||
.vc-zip-preview-breadcrumb-segment {
|
||||
|
|
@ -201,8 +202,8 @@
|
|||
color: var(--text-link-low-saturation);
|
||||
}
|
||||
|
||||
.vc-zip-preview-breadcrumb-current {
|
||||
color: var(--text-normal);
|
||||
.vc-zip-preview-breadcrumb .vc-zip-preview-breadcrumb-current {
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
.vc-zip-preview-size {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue