feat: add eslint import order rule and formaize import orders

This commit is contained in:
Xu Quan 2025-06-23 16:13:43 +08:00
parent cd04b27878
commit 9f712acda2
56 changed files with 2765 additions and 228 deletions

View file

@ -1,23 +1,49 @@
{ {
"root": true, "root": true,
"parser": "@typescript-eslint/parser", "parser": "@typescript-eslint/parser",
"env": { "node": true }, "env": { "node": true },
"plugins": [ "plugins": ["@typescript-eslint", "import"],
"@typescript-eslint" "extends": [
], "eslint:recommended",
"extends": [ "plugin:@typescript-eslint/eslint-recommended",
"eslint:recommended", "plugin:@typescript-eslint/recommended"
"plugin:@typescript-eslint/eslint-recommended", ],
"plugin:@typescript-eslint/recommended" "parserOptions": {
], "sourceType": "module"
"parserOptions": { },
"sourceType": "module" "rules": {
}, "no-unused-vars": "off",
"rules": { "@typescript-eslint/no-unused-vars": ["error", { "args": "none" }],
"no-unused-vars": "off", "@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/no-unused-vars": ["error", { "args": "none" }], "no-prototype-builtins": "off",
"@typescript-eslint/ban-ts-comment": "off", "@typescript-eslint/no-empty-function": "off",
"no-prototype-builtins": "off", "import/order": [
"@typescript-eslint/no-empty-function": "off" "warn",
} {
} "groups": [
"builtin",
"external",
"internal",
"parent",
"sibling",
"index",
"object",
"type"
],
"pathGroups": [
{
"pattern": "src/**",
"group": "internal",
"position": "after"
}
],
"pathGroupsExcludedImportTypes": ["builtin"],
"newlines-between": "always",
"alphabetize": {
"order": "asc",
"caseInsensitive": true
}
}
]
}
}

2469
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -6,7 +6,11 @@
"scripts": { "scripts": {
"dev": "node esbuild.config.mjs", "dev": "node esbuild.config.mjs",
"build": "tsc -noEmit -skipLibCheck && node esbuild.config.mjs production", "build": "tsc -noEmit -skipLibCheck && node esbuild.config.mjs production",
"version": "node version-bump.mjs && git add manifest.json versions.json" "version": "node version-bump.mjs && git add manifest.json versions.json",
"postinstall": "husky install"
},
"lint-staged": {
"*.{js,jsx,ts,tsx}": "eslint --fix"
}, },
"keywords": [], "keywords": [],
"author": "", "author": "",
@ -19,6 +23,9 @@
"@typescript-eslint/parser": "5.29.0", "@typescript-eslint/parser": "5.29.0",
"builtin-modules": "3.3.0", "builtin-modules": "3.3.0",
"esbuild": "0.17.3", "esbuild": "0.17.3",
"eslint-plugin-import": "^2.32.0",
"husky": "^9.1.7",
"lint-staged": "^16.1.2",
"obsidian": "latest", "obsidian": "latest",
"tslib": "2.4.0", "tslib": "2.4.0",
"typescript": "4.7.4" "typescript": "4.7.4"

View file

@ -1,8 +1,8 @@
import { Root, createRoot } from "react-dom/client";
import { ItemView, WorkspaceLeaf } from "obsidian"; import { ItemView, WorkspaceLeaf } from "obsidian";
import { Root, createRoot } from "react-dom/client";
import FolderFileSplitterPlugin from "./main";
import Explorer from "./components/Explorer"; import Explorer from "./components/Explorer";
import FolderFileSplitterPlugin from "./main";
export class ExplorerView extends ItemView { export class ExplorerView extends ItemView {
root: Root; root: Root;

View file

@ -1,6 +1,6 @@
import dayjs from "dayjs";
import { App, DropdownComponent, PluginSettingTab, Setting } from "obsidian"; import { App, DropdownComponent, PluginSettingTab, Setting } from "obsidian";
import FolderFileSplitterPlugin from "./main";
import { FolderFileSplitterPluginSettings } from "./settings";
import { import {
EN_SETTINGS, EN_SETTINGS,
EN_SETTINGS_HEADER, EN_SETTINGS_HEADER,
@ -9,7 +9,8 @@ import {
ZH_SETTINGS, ZH_SETTINGS,
ZH_SETTINGS_HEADER, ZH_SETTINGS_HEADER,
} from "./locales/settings"; } from "./locales/settings";
import dayjs from "dayjs"; import FolderFileSplitterPlugin from "./main";
import { FolderFileSplitterPluginSettings } from "./settings";
export class SettingTab extends PluginSettingTab { export class SettingTab extends PluginSettingTab {
plugin: FolderFileSplitterPlugin; plugin: FolderFileSplitterPlugin;

View file

@ -1,18 +1,18 @@
import FolderIcon from "./FolderIcon";
import EmptyFolderIcon from "./EmptyFolderIcon";
import StarIcon from "./RootFolderIcon";
import AddFolderIcon from "./AddFolderIcon";
import AddFileIcon from "./AddFileIcon"; import AddFileIcon from "./AddFileIcon";
import AscendingSortIcon from "./AscendingSortIcon"; import AddFolderIcon from "./AddFolderIcon";
import DescendingSortIcon from "./DescendingSortIcon";
import ExpandIcon from "./ExpandIcon";
import CollapseIcon from "./CollapseIcon";
import LoadingIcon from "./LoadingIcon";
import GripIcon from "./GripIcon";
import ArrowUpDownIcon from "./ArrowUpDownIcon"; import ArrowUpDownIcon from "./ArrowUpDownIcon";
import PinIcon from "./PinIcon"; import AscendingSortIcon from "./AscendingSortIcon";
import ChevronDown from "./ChevronDown"; import ChevronDown from "./ChevronDown";
import ChevronRight from "./ChevronRight"; import ChevronRight from "./ChevronRight";
import CollapseIcon from "./CollapseIcon";
import DescendingSortIcon from "./DescendingSortIcon";
import EmptyFolderIcon from "./EmptyFolderIcon";
import ExpandIcon from "./ExpandIcon";
import FolderIcon from "./FolderIcon";
import GripIcon from "./GripIcon";
import LoadingIcon from "./LoadingIcon";
import PinIcon from "./PinIcon";
import StarIcon from "./RootFolderIcon";
import TagIcon from "./TagIcon"; import TagIcon from "./TagIcon";
export { export {

View file

@ -1,5 +1,5 @@
import { ReactNode } from "react";
import classNames from "classnames"; import classNames from "classnames";
import { ReactNode } from "react";
import { ChevronRight } from "src/assets/icons"; import { ChevronRight } from "src/assets/icons";

View file

@ -1,6 +1,6 @@
import { useExplorer } from "src/hooks/useExplorer";
import { useLayoutMode } from "src/hooks/useSettingsHandler"; import { useLayoutMode } from "src/hooks/useSettingsHandler";
import { LAYOUT_MODE } from "src/settings"; import { LAYOUT_MODE } from "src/settings";
import { useExplorer } from "src/hooks/useExplorer";
import { HorizontalSplitLayout, VerticalSplitLayout } from "../layout"; import { HorizontalSplitLayout, VerticalSplitLayout } from "../layout";

View file

@ -1,4 +1,3 @@
import { useState } from "react";
import { import {
DndContext, DndContext,
DragEndEvent, DragEndEvent,
@ -9,14 +8,15 @@ import {
useSensor, useSensor,
useSensors, useSensors,
} from "@dnd-kit/core"; } from "@dnd-kit/core";
import { TAbstractFile, TFile, TFolder } from "obsidian";
import { snapCenterToCursor } from "@dnd-kit/modifiers"; import { snapCenterToCursor } from "@dnd-kit/modifiers";
import { TAbstractFile, TFile, TFolder } from "obsidian";
import { useState } from "react";
import { useShallow } from "zustand/react/shallow"; import { useShallow } from "zustand/react/shallow";
import { ExplorerStore } from "src/store";
import { useOpenDestinationFolder } from "src/hooks/useSettingsHandler";
import { isFile, isFolder } from "src/utils";
import { useExplorer } from "src/hooks/useExplorer"; import { useExplorer } from "src/hooks/useExplorer";
import { useOpenDestinationFolder } from "src/hooks/useSettingsHandler";
import { ExplorerStore } from "src/store";
import { isFile, isFolder } from "src/utils";
import ExplorerContent from "./Content"; import ExplorerContent from "./Content";

View file

@ -1,12 +1,12 @@
import { useEffect, useMemo, useState } from "react"; import { useEffect, useMemo, useState } from "react";
import { useShallow } from "zustand/react/shallow"; import { useShallow } from "zustand/react/shallow";
import { ExplorerContext } from "src/hooks/useExplorer";
import FolderFileSplitterPlugin from "src/main"; import FolderFileSplitterPlugin from "src/main";
import { createExplorerStore, ExplorerStore } from "src/store"; import { createExplorerStore, ExplorerStore } from "src/store";
import { ExplorerContext } from "src/hooks/useExplorer";
import Loading from "../Loading"; import Loading from "../Loading";
import DragAndDropExplorer from "./DragAndDrop"; import DragAndDropExplorer from "./DragAndDrop";
type Props = { type Props = {

View file

@ -1,19 +1,21 @@
import { Menu, TFile } from "obsidian";
import { useShallow } from "zustand/react/shallow";
import { useEffect, useRef, useState } from "react";
import classNames from "classnames"; import classNames from "classnames";
import { Menu, TFile } from "obsidian";
import { useEffect, useRef, useState } from "react";
import { useShallow } from "zustand/react/shallow";
import { ExplorerStore } from "src/store";
import useRenderEditableName from "src/hooks/useRenderEditableName";
import { useExplorer } from "src/hooks/useExplorer"; import { useExplorer } from "src/hooks/useExplorer";
import { FILE_OPERATION_COPY } from "src/locales"; import useRenderEditableName from "src/hooks/useRenderEditableName";
import { import {
useBoldFileTitle, useBoldFileTitle,
useFileItemSpacing, useFileItemSpacing,
useShowFileDetail, useShowFileDetail,
useShowFileItemDivider, useShowFileItemDivider,
} from "src/hooks/useSettingsHandler"; } from "src/hooks/useSettingsHandler";
import { FILE_OPERATION_COPY } from "src/locales";
import { ExplorerStore } from "src/store";
import { FolderListModal } from "../FolderListModal"; import { FolderListModal } from "../FolderListModal";
import FileDetail from "./Detail"; import FileDetail from "./Detail";
export type FileProps = { export type FileProps = {

View file

@ -1,9 +1,9 @@
import dayjs from "dayjs";
import { MarkdownRenderer, TFile } from "obsidian"; import { MarkdownRenderer, TFile } from "obsidian";
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import { useShallow } from "zustand/react/shallow"; import { useShallow } from "zustand/react/shallow";
import dayjs from "dayjs";
import { ExplorerStore } from "src/store"; import { VaultChangeEvent, VaultChangeEventName } from "src/assets/constants";
import { useExplorer } from "src/hooks/useExplorer"; import { useExplorer } from "src/hooks/useExplorer";
import { import {
useFileCreationDateFormat, useFileCreationDateFormat,
@ -11,7 +11,8 @@ import {
useShowFileCreationDate, useShowFileCreationDate,
useStripMarkdownSyntaxInPreview, useStripMarkdownSyntaxInPreview,
} from "src/hooks/useSettingsHandler"; } from "src/hooks/useSettingsHandler";
import { VaultChangeEvent, VaultChangeEventName } from "src/assets/constants"; import { ExplorerStore } from "src/store";
type Props = { type Props = {
file: TFile; file: TFile;

View file

@ -1,11 +1,11 @@
import { useEffect } from "react";
import { useDraggable } from "@dnd-kit/core"; import { useDraggable } from "@dnd-kit/core";
import { useShallow } from "zustand/react/shallow";
import dayjs from "dayjs"; import dayjs from "dayjs";
import { useEffect } from "react";
import { useShallow } from "zustand/react/shallow";
import { ExplorerStore } from "src/store";
import { FFS_DRAG_FILE } from "src/assets/constants"; import { FFS_DRAG_FILE } from "src/assets/constants";
import { useExplorer } from "src/hooks/useExplorer"; import { useExplorer } from "src/hooks/useExplorer";
import { ExplorerStore } from "src/store";
import FileContent, { FileProps } from "./Content"; import FileContent, { FileProps } from "./Content";

View file

@ -1,10 +1,11 @@
import classNames from "classnames";
import { useShallow } from "zustand/react/shallow"; import { useShallow } from "zustand/react/shallow";
import { AddFileIcon } from "src/assets/icons"; import { AddFileIcon } from "src/assets/icons";
import { ExplorerStore } from "src/store";
import { useExplorer } from "src/hooks/useExplorer"; import { useExplorer } from "src/hooks/useExplorer";
import classNames from "classnames";
import { useShowFolderView } from "src/hooks/useSettingsHandler"; import { useShowFolderView } from "src/hooks/useSettingsHandler";
import { ExplorerStore } from "src/store";
const CreateFile = () => { const CreateFile = () => {
const { useExplorerStore, plugin } = useExplorer(); const { useExplorerStore, plugin } = useExplorer();

View file

@ -1,12 +1,12 @@
import { useShallow } from "zustand/react/shallow"; import { useShallow } from "zustand/react/shallow";
import { ExplorerStore } from "src/store";
import { FILE_SORT_RULES_COPY } from "src/locales";
import { useExplorer } from "src/hooks/useExplorer"; import { useExplorer } from "src/hooks/useExplorer";
import { FILE_SORT_RULES_COPY } from "src/locales";
import { ExplorerStore } from "src/store";
import { FILE_MANUAL_SORT_RULE, FileSortRule } from "src/store/file";
import { ManualSortFilesModal } from "../ManualSortFilesModal"; import { ManualSortFilesModal } from "../ManualSortFilesModal";
import SortAction from "../SortAction"; import SortAction from "../SortAction";
import { FILE_MANUAL_SORT_RULE, FileSortRule } from "src/store/file";
type FileSortRuleItem = { type FileSortRuleItem = {
text: string; text: string;

View file

@ -1,10 +1,10 @@
import { TFile } from "obsidian";
import { ReactNode, useEffect } from "react"; import { ReactNode, useEffect } from "react";
import { useShallow } from "zustand/react/shallow"; import { useShallow } from "zustand/react/shallow";
import { TFile } from "obsidian";
import { ExplorerStore } from "src/store";
import { PinIcon } from "src/assets/icons"; import { PinIcon } from "src/assets/icons";
import { useExplorer } from "src/hooks/useExplorer"; import { useExplorer } from "src/hooks/useExplorer";
import { ExplorerStore } from "src/store";
import { uniq } from "src/utils"; import { uniq } from "src/utils";
type Props = { type Props = {

View file

@ -1,13 +1,16 @@
import { useShallow } from "zustand/react/shallow";
import { TFile } from "obsidian"; import { TFile } from "obsidian";
import { useShallow } from "zustand/react/shallow";
import { ExplorerStore } from "src/store"; import { EmptyFolderIcon } from "src/assets/icons";
import { useChangeFile } from "src/hooks/useVaultChangeHandler";
import { useExplorer } from "src/hooks/useExplorer"; import { useExplorer } from "src/hooks/useExplorer";
import { useChangeFile } from "src/hooks/useVaultChangeHandler";
import { ExplorerStore } from "src/store";
import File from "../File"; import File from "../File";
import PinnedFiles from "./PinnedFiles"; import PinnedFiles from "./PinnedFiles";
import { EmptyFolderIcon } from "src/assets/icons";
type Props = { type Props = {
onOpenFoldersPane?: () => void; onOpenFoldersPane?: () => void;

View file

@ -1,16 +1,21 @@
import { Menu, TFolder } from "obsidian";
import { useShallow } from "zustand/react/shallow";
import { useEffect, useRef, useState } from "react";
import { ExplorerStore } from "src/store";
import { FolderListModal } from "../FolderListModal";
import { useShowFolderIcon } from "src/hooks/useSettingsHandler";
import FilesCount from "./FilesCount";
import useRenderEditableName from "src/hooks/useRenderEditableName";
import { FOLDER_OPERATION_COPY } from "src/locales";
import { useExplorer } from "src/hooks/useExplorer";
import classNames from "classnames"; import classNames from "classnames";
import { Menu, TFolder } from "obsidian";
import { useEffect, useRef, useState } from "react";
import { useShallow } from "zustand/react/shallow";
import { FolderIcon, StarIcon } from "src/assets/icons"; import { FolderIcon, StarIcon } from "src/assets/icons";
import { useExplorer } from "src/hooks/useExplorer";
import useRenderEditableName from "src/hooks/useRenderEditableName";
import { useShowFolderIcon } from "src/hooks/useSettingsHandler";
import { FOLDER_OPERATION_COPY } from "src/locales";
import { ExplorerStore } from "src/store";
import { FolderListModal } from "../FolderListModal";
import FilesCount from "./FilesCount";
export type FolderProps = { export type FolderProps = {
folder: TFolder; folder: TFolder;

View file

@ -1,8 +1,10 @@
import { TFolder } from "obsidian"; import { TFolder } from "obsidian";
import { useShallow } from "zustand/react/shallow"; import { useShallow } from "zustand/react/shallow";
import { ExplorerStore } from "src/store";
import { useExplorer } from "src/hooks/useExplorer"; import { useExplorer } from "src/hooks/useExplorer";
import { ExplorerStore } from "src/store";
import ExpandIcon from "../ExpandIcon"; import ExpandIcon from "../ExpandIcon";
type Props = { type Props = {

View file

@ -1,15 +1,15 @@
import { TFolder } from "obsidian"; import { TFolder } from "obsidian";
import { useEffect, useState } from "react";
import { useShallow } from "zustand/react/shallow"; import { useShallow } from "zustand/react/shallow";
import { ExplorerStore } from "src/store"; import { VaultChangeEvent, VaultChangeEventName } from "src/assets/constants";
import { useExplorer } from "src/hooks/useExplorer";
import { import {
useIncludeSubfolderFiles, useIncludeSubfolderFiles,
useShowFilesCount, useShowFilesCount,
} from "src/hooks/useSettingsHandler"; } from "src/hooks/useSettingsHandler";
import { VaultChangeEvent, VaultChangeEventName } from "src/assets/constants"; import { ExplorerStore } from "src/store";
import { isFile } from "src/utils"; import { isFile } from "src/utils";
import { useEffect, useState } from "react";
import { useExplorer } from "src/hooks/useExplorer";
type Props = { type Props = {
folder: TFolder; folder: TFolder;

View file

@ -1,15 +1,17 @@
import { useShallow } from "zustand/react/shallow";
import { useEffect } from "react";
import { useDraggable, useDroppable } from "@dnd-kit/core"; import { useDraggable, useDroppable } from "@dnd-kit/core";
import { ExplorerStore } from "src/store";
import { FFS_DRAG_FILE, FFS_DRAG_FOLDER } from "src/assets/constants";
import FolderContent, { FolderProps } from "./Content";
import { useExplorer } from "src/hooks/useExplorer";
import FolderExpandIcon from "./ExpandIcon";
import classNames from "classnames"; import classNames from "classnames";
import { useEffect } from "react";
import { useShallow } from "zustand/react/shallow";
import { FFS_DRAG_FILE, FFS_DRAG_FOLDER } from "src/assets/constants";
import { useExplorer } from "src/hooks/useExplorer";
import { ExplorerStore } from "src/store";
import { pluralize } from "src/utils"; import { pluralize } from "src/utils";
import FolderContent, { FolderProps } from "./Content";
import FolderExpandIcon from "./ExpandIcon";
type Props = FolderProps & { type Props = FolderProps & {
onOpenFilesPane: () => void; onOpenFilesPane: () => void;
disableDrag?: boolean; disableDrag?: boolean;

View file

@ -1,11 +1,11 @@
import classNames from "classnames";
import { TFolder } from "obsidian"; import { TFolder } from "obsidian";
import { useShallow } from "zustand/react/shallow"; import { useShallow } from "zustand/react/shallow";
import classNames from "classnames";
import { AddFolderIcon } from "src/assets/icons"; import { AddFolderIcon } from "src/assets/icons";
import { ExplorerStore } from "src/store";
import { useExplorer } from "src/hooks/useExplorer"; import { useExplorer } from "src/hooks/useExplorer";
import { useShowFolderView } from "src/hooks/useSettingsHandler"; import { useShowFolderView } from "src/hooks/useSettingsHandler";
import { ExplorerStore } from "src/store";
import { uniq } from "src/utils"; import { uniq } from "src/utils";
const CreateFolder = () => { const CreateFolder = () => {

View file

@ -1,12 +1,14 @@
import { useShallow } from "zustand/react/shallow"; import { useShallow } from "zustand/react/shallow";
import { ExplorerStore } from "src/store";
import SortAction from "../SortAction";
import { ManualSortFoldersModal } from "../ManualSortFoldersModal";
import { FOLDER_SORT_RULES_COPY } from "src/locales";
import { useExplorer } from "src/hooks/useExplorer"; import { useExplorer } from "src/hooks/useExplorer";
import { FOLDER_SORT_RULES_COPY } from "src/locales";
import { ExplorerStore } from "src/store";
import { FOLDER_MANUAL_SORT_RULE, FolderSortRule } from "src/store/folder"; import { FOLDER_MANUAL_SORT_RULE, FolderSortRule } from "src/store/folder";
import { ManualSortFoldersModal } from "../ManualSortFoldersModal";
import SortAction from "../SortAction";
type FolderSortRuleItem = { type FolderSortRuleItem = {
text: string; text: string;
rule: FolderSortRule; rule: FolderSortRule;

View file

@ -1,4 +1,5 @@
import classNames from "classnames"; import classNames from "classnames";
import { FolderIcon, TagIcon } from "src/assets/icons"; import { FolderIcon, TagIcon } from "src/assets/icons";
import { useExplorer } from "src/hooks/useExplorer"; import { useExplorer } from "src/hooks/useExplorer";
import { import {

View file

@ -2,13 +2,13 @@ import { useEffect, useState } from "react";
import { useShallow } from "zustand/react/shallow"; import { useShallow } from "zustand/react/shallow";
import { ExpandIcon, CollapseIcon } from "src/assets/icons"; import { ExpandIcon, CollapseIcon } from "src/assets/icons";
import { ExplorerStore } from "src/store";
import { useExplorer } from "src/hooks/useExplorer"; import { useExplorer } from "src/hooks/useExplorer";
import { import {
useShowFolderView, useShowFolderView,
useShowTagView, useShowTagView,
} from "src/hooks/useSettingsHandler"; } from "src/hooks/useSettingsHandler";
import { TIPS_COPY } from "src/locales"; import { TIPS_COPY } from "src/locales";
import { ExplorerStore } from "src/store";
const ToggleFolders = () => { const ToggleFolders = () => {
const { useExplorerStore, plugin } = useExplorer(); const { useExplorerStore, plugin } = useExplorer();

View file

@ -1,16 +1,16 @@
import { useShallow } from "zustand/react/shallow";
import { TFolder } from "obsidian"; import { TFolder } from "obsidian";
import { ReactNode, useEffect } from "react"; import { ReactNode, useEffect } from "react";
import { useShallow } from "zustand/react/shallow";
import { ExplorerStore } from "src/store";
import PinIcon from "src/assets/icons/PinIcon"; import PinIcon from "src/assets/icons/PinIcon";
import { useExplorer } from "src/hooks/useExplorer"; import { useExplorer } from "src/hooks/useExplorer";
import { import {
useShowFolderView, useShowFolderView,
useShowTagView, useShowTagView,
} from "src/hooks/useSettingsHandler"; } from "src/hooks/useSettingsHandler";
import { uniq } from "src/utils"; import { ExplorerStore } from "src/store";
import { TagNode } from "src/store/tag"; import { TagNode } from "src/store/tag";
import { uniq } from "src/utils";
export type RenderOptions = { export type RenderOptions = {
hideExpandIcon?: boolean; hideExpandIcon?: boolean;

View file

@ -1,8 +1,9 @@
import { useShallow } from "zustand/react/shallow";
import { TFolder } from "obsidian";
import classNames from "classnames"; import classNames from "classnames";
import { TFolder } from "obsidian";
import { ReactNode } from "react";
import { useShallow } from "zustand/react/shallow";
import { ExplorerStore } from "src/store"; import { useExplorer } from "src/hooks/useExplorer";
import { import {
useHideRootFolder, useHideRootFolder,
useShowFolderView, useShowFolderView,
@ -10,13 +11,14 @@ import {
useShowTagView, useShowTagView,
} from "src/hooks/useSettingsHandler"; } from "src/hooks/useSettingsHandler";
import { useChangeFolder } from "src/hooks/useVaultChangeHandler"; import { useChangeFolder } from "src/hooks/useVaultChangeHandler";
import { useExplorer } from "src/hooks/useExplorer"; import { ExplorerStore } from "src/store";
import { TagNode } from "src/store/tag";
import Folder from "../Folder"; import Folder from "../Folder";
import PinnedFoldersAndTags, { RenderOptions } from "./PinnedFoldersAndTags";
import { ReactNode } from "react";
import Tag from "../Tag"; import Tag from "../Tag";
import { TagNode } from "src/store/tag";
import PinnedFoldersAndTags, { RenderOptions } from "./PinnedFoldersAndTags";
type Props = { type Props = {
onOpenFilesPane?: () => void; onOpenFilesPane?: () => void;

View file

@ -1,6 +1,6 @@
import { TFile } from "obsidian";
import { useSortable } from "@dnd-kit/sortable"; import { useSortable } from "@dnd-kit/sortable";
import { CSS } from "@dnd-kit/utilities"; import { CSS } from "@dnd-kit/utilities";
import { TFile } from "obsidian";
import { FFS_SORT_FOLDER } from "src/assets/constants"; import { FFS_SORT_FOLDER } from "src/assets/constants";
import { GripIcon } from "src/assets/icons"; import { GripIcon } from "src/assets/icons";

View file

@ -1,12 +1,3 @@
import { TFile, TFolder } from "obsidian";
import { useShallow } from "zustand/react/shallow";
import { StoreApi, UseBoundStore } from "zustand";
import { useState } from "react";
import {
SortableContext,
sortableKeyboardCoordinates,
verticalListSortingStrategy,
} from "@dnd-kit/sortable";
import { import {
closestCenter, closestCenter,
DndContext, DndContext,
@ -18,9 +9,19 @@ import {
useSensor, useSensor,
useSensors, useSensors,
} from "@dnd-kit/core"; } from "@dnd-kit/core";
import {
SortableContext,
sortableKeyboardCoordinates,
verticalListSortingStrategy,
} from "@dnd-kit/sortable";
import { TFile, TFolder } from "obsidian";
import { useState } from "react";
import { StoreApi, UseBoundStore } from "zustand";
import { useShallow } from "zustand/react/shallow";
import { ExplorerStore } from "src/store";
import FolderFileSplitterPlugin from "src/main"; import FolderFileSplitterPlugin from "src/main";
import { ExplorerStore } from "src/store";
import FileToSort from "./FileToSort"; import FileToSort from "./FileToSort";
type Props = { type Props = {

View file

@ -2,9 +2,10 @@ import { Modal, TFolder } from "obsidian";
import { createRoot, Root } from "react-dom/client"; import { createRoot, Root } from "react-dom/client";
import { StoreApi, UseBoundStore } from "zustand"; import { StoreApi, UseBoundStore } from "zustand";
import { TIPS_COPY } from "src/locales";
import FolderFileSplitterPlugin from "src/main"; import FolderFileSplitterPlugin from "src/main";
import { ExplorerStore } from "src/store"; import { ExplorerStore } from "src/store";
import { TIPS_COPY } from "src/locales";
import ManualSortFiles from "./ManualSortFiles"; import ManualSortFiles from "./ManualSortFiles";

View file

@ -1,12 +1,12 @@
import { TFolder } from "obsidian";
import { useShallow } from "zustand/react/shallow";
import { StoreApi, UseBoundStore } from "zustand";
import { useSortable } from "@dnd-kit/sortable"; import { useSortable } from "@dnd-kit/sortable";
import { CSS } from "@dnd-kit/utilities"; import { CSS } from "@dnd-kit/utilities";
import { TFolder } from "obsidian";
import { StoreApi, UseBoundStore } from "zustand";
import { useShallow } from "zustand/react/shallow";
import { ExplorerStore } from "src/store";
import { FFS_SORT_FOLDER } from "src/assets/constants"; import { FFS_SORT_FOLDER } from "src/assets/constants";
import { GripIcon } from "src/assets/icons"; import { GripIcon } from "src/assets/icons";
import { ExplorerStore } from "src/store";
type Props = { type Props = {
folder: TFolder; folder: TFolder;

View file

@ -1,12 +1,3 @@
import { TFolder } from "obsidian";
import { useShallow } from "zustand/react/shallow";
import { StoreApi, UseBoundStore } from "zustand";
import { Fragment, useEffect, useState } from "react";
import {
SortableContext,
sortableKeyboardCoordinates,
verticalListSortingStrategy,
} from "@dnd-kit/sortable";
import { import {
closestCenter, closestCenter,
DndContext, DndContext,
@ -18,9 +9,19 @@ import {
useSensor, useSensor,
useSensors, useSensors,
} from "@dnd-kit/core"; } from "@dnd-kit/core";
import {
SortableContext,
sortableKeyboardCoordinates,
verticalListSortingStrategy,
} from "@dnd-kit/sortable";
import { TFolder } from "obsidian";
import { Fragment, useEffect, useState } from "react";
import { StoreApi, UseBoundStore } from "zustand";
import { useShallow } from "zustand/react/shallow";
import { ExplorerStore } from "src/store";
import FolderFileSplitterPlugin from "src/main"; import FolderFileSplitterPlugin from "src/main";
import { ExplorerStore } from "src/store";
import FolderToSort from "./FolderToSort"; import FolderToSort from "./FolderToSort";
type Props = { type Props = {

View file

@ -2,9 +2,10 @@ import { Modal, TFolder } from "obsidian";
import { createRoot, Root } from "react-dom/client"; import { createRoot, Root } from "react-dom/client";
import { StoreApi, UseBoundStore } from "zustand"; import { StoreApi, UseBoundStore } from "zustand";
import { TIPS_COPY } from "src/locales";
import FolderFileSplitterPlugin from "src/main"; import FolderFileSplitterPlugin from "src/main";
import { ExplorerStore } from "src/store"; import { ExplorerStore } from "src/store";
import { TIPS_COPY } from "src/locales";
import ManualSortFolders from "./ManualSortFolders"; import ManualSortFolders from "./ManualSortFolders";

View file

@ -1,14 +1,17 @@
import { useShowTagIcon } from "src/hooks/useSettingsHandler";
import { useExplorer } from "src/hooks/useExplorer";
import classNames from "classnames"; import classNames from "classnames";
import { TagIcon } from "src/assets/icons";
import { TagNode } from "src/store/tag";
import FilesCount from "./FilesCount";
import { useShallow } from "zustand/react/shallow";
import useRenderEditableName from "src/hooks/useRenderEditableName";
import { useEffect, useRef, useState } from "react";
import { Menu } from "obsidian"; import { Menu } from "obsidian";
import { useEffect, useRef, useState } from "react";
import { useShallow } from "zustand/react/shallow";
import { TagIcon } from "src/assets/icons";
import { useExplorer } from "src/hooks/useExplorer";
import useRenderEditableName from "src/hooks/useRenderEditableName";
import { useShowTagIcon } from "src/hooks/useSettingsHandler";
import { TAG_OPERATION_COPY } from "src/locales"; import { TAG_OPERATION_COPY } from "src/locales";
import { TagNode } from "src/store/tag";
import FilesCount from "./FilesCount";
type Props = { type Props = {
tag: TagNode; tag: TagNode;

View file

@ -1,10 +1,13 @@
import { useShallow } from "zustand/react/shallow"; import { useShallow } from "zustand/react/shallow";
import { ExplorerStore } from "src/store";
import { useExplorer } from "src/hooks/useExplorer"; import { useExplorer } from "src/hooks/useExplorer";
import ExpandIcon from "../ExpandIcon"; import { ExplorerStore } from "src/store";
import { TagNode } from "src/store/tag"; import { TagNode } from "src/store/tag";
import ExpandIcon from "../ExpandIcon";
type Props = { type Props = {
tag: TagNode; tag: TagNode;
}; };

View file

@ -1,15 +1,16 @@
import { useEffect, useState } from "react";
import { useShallow } from "zustand/react/shallow"; import { useShallow } from "zustand/react/shallow";
import { ExplorerStore } from "src/store"; import { VaultChangeEvent, VaultChangeEventName } from "src/assets/constants";
import { useExplorer } from "src/hooks/useExplorer";
import { import {
useIncludeSubTagFiles, useIncludeSubTagFiles,
useShowFilesCount, useShowFilesCount,
} from "src/hooks/useSettingsHandler"; } from "src/hooks/useSettingsHandler";
import { VaultChangeEvent, VaultChangeEventName } from "src/assets/constants"; import { ExplorerStore } from "src/store";
import { isFile } from "src/utils";
import { useEffect, useState } from "react";
import { useExplorer } from "src/hooks/useExplorer";
import { TagNode } from "src/store/tag"; import { TagNode } from "src/store/tag";
import { isFile } from "src/utils";
type Props = { type Props = {
tag: TagNode; tag: TagNode;

View file

@ -1,13 +1,14 @@
import classNames from "classnames"; import classNames from "classnames";
import { useShallow } from "zustand/react/shallow"; import { useShallow } from "zustand/react/shallow";
import { TagNode } from "src/store/tag";
import { useExplorer } from "src/hooks/useExplorer"; import { useExplorer } from "src/hooks/useExplorer";
import { ExplorerStore } from "src/store"; import { ExplorerStore } from "src/store";
import TagExpandIcon from "./ExpandIcon"; import { TagNode } from "src/store/tag";
import TagContent from "./Content";
import { pluralize } from "src/utils"; import { pluralize } from "src/utils";
import TagContent from "./Content";
import TagExpandIcon from "./ExpandIcon";
type Props = { type Props = {
tag: TagNode; tag: TagNode;
disableHoverIndent?: boolean; disableHoverIndent?: boolean;

View file

@ -1,15 +1,18 @@
import CreateFolder from "../FolderAndTagActions/CreateFolder";
import SortFolders from "../FolderAndTagActions/SortFoldersAndTags";
import ToggleFolders from "../FolderAndTagActions/ToggleFoldersAndTags";
import CreateFile from "../FileActions/CreateFile";
import SortFiles from "../FileActions/SortFiles";
import classNames from "classnames"; import classNames from "classnames";
import { useExplorer } from "src/hooks/useExplorer"; import { useExplorer } from "src/hooks/useExplorer";
import { import {
useAutoHideActionBar, useAutoHideActionBar,
useHighlightActionBar, useHighlightActionBar,
} from "src/hooks/useSettingsHandler"; } from "src/hooks/useSettingsHandler";
import CreateFile from "../FileActions/CreateFile";
import SortFiles from "../FileActions/SortFiles";
import CreateFolder from "../FolderAndTagActions/CreateFolder";
import SortFolders from "../FolderAndTagActions/SortFoldersAndTags";
import ToggleFolders from "../FolderAndTagActions/ToggleFoldersAndTags";
export const FolderAndTagActionSection = () => ( export const FolderAndTagActionSection = () => (
<div className="ffs__actions-section nav-buttons-container"> <div className="ffs__actions-section nav-buttons-container">
<CreateFolder /> <CreateFolder />

View file

@ -2,19 +2,19 @@ import { useEffect, useState, useRef } from "react";
import { FFS_FOLDER_PANE_WIDTH_KEY } from "src/assets/constants"; import { FFS_FOLDER_PANE_WIDTH_KEY } from "src/assets/constants";
import useChangeActiveLeaf from "src/hooks/useChangeActiveLeaf"; import useChangeActiveLeaf from "src/hooks/useChangeActiveLeaf";
import { toValidNumber } from "src/utils";
import FileTree from "../FileTree"; import FileTree from "../FileTree";
import ToggleFolderAndTagMode from "../FolderAndTagActions/ToggleFolderAndTagView"; import ToggleFolderAndTagMode from "../FolderAndTagActions/ToggleFolderAndTagView";
import FolderAndTagTree from "../FolderAndTagTree";
import { import {
ActionsContainer, ActionsContainer,
FileActionSection, FileActionSection,
FolderAndTagActionSection, FolderAndTagActionSection,
} from "./Actions"; } from "./Actions";
import FolderAndTagTree from "../FolderAndTagTree";
import { HorizontalDraggableDivider } from "./DraggableDivider"; import { HorizontalDraggableDivider } from "./DraggableDivider";
import ViewModeDisplay from "./ViewModeDisplay"; import ViewModeDisplay from "./ViewModeDisplay";
import { toValidNumber } from "src/utils";
const HorizontalSplitLayout = () => { const HorizontalSplitLayout = () => {
const [folderPaneWidth, setFolderPaneWidth] = useState< const [folderPaneWidth, setFolderPaneWidth] = useState<

View file

@ -1,7 +1,9 @@
import { ActionsContainer, FileActionSection } from "./Actions";
import FileTree from "../FileTree";
import { useExplorer } from "src/hooks/useExplorer"; import { useExplorer } from "src/hooks/useExplorer";
import { VERTICAL_SPLIT_LAYOUT_OPERATION_COPY } from "src/locales"; import { VERTICAL_SPLIT_LAYOUT_OPERATION_COPY } from "src/locales";
import FileTree from "../FileTree";
import { ActionsContainer, FileActionSection } from "./Actions";
import { ClosePaneButton, OpenPaneButton } from "./TogglePaneButton"; import { ClosePaneButton, OpenPaneButton } from "./TogglePaneButton";
type Props = { type Props = {

View file

@ -1,12 +1,14 @@
import { ActionsContainer, FolderAndTagActionSection } from "./Actions";
import FolderAndTagTree from "../FolderAndTagTree";
import { useExplorer } from "src/hooks/useExplorer"; import { useExplorer } from "src/hooks/useExplorer";
import { import {
useShowFolderView, useShowFolderView,
useShowTagView, useShowTagView,
} from "src/hooks/useSettingsHandler"; } from "src/hooks/useSettingsHandler";
import ToggleFolderAndTagMode from "../FolderAndTagActions/ToggleFolderAndTagView";
import { VERTICAL_SPLIT_LAYOUT_OPERATION_COPY } from "src/locales"; import { VERTICAL_SPLIT_LAYOUT_OPERATION_COPY } from "src/locales";
import ToggleFolderAndTagMode from "../FolderAndTagActions/ToggleFolderAndTagView";
import FolderAndTagTree from "../FolderAndTagTree";
import { ActionsContainer, FolderAndTagActionSection } from "./Actions";
import { ClosePaneButton, OpenPaneButton } from "./TogglePaneButton"; import { ClosePaneButton, OpenPaneButton } from "./TogglePaneButton";
type Props = { type Props = {

View file

@ -1,9 +1,10 @@
import { useEffect, useState, useRef } from "react"; import { useEffect, useState, useRef } from "react";
import { FFS_FOLDER_PANE_HEIGHT_KEY } from "src/assets/constants"; import { FFS_FOLDER_PANE_HEIGHT_KEY } from "src/assets/constants";
import { VerticalDraggableDivider } from "./DraggableDivider";
import useChangeActiveLeaf from "src/hooks/useChangeActiveLeaf"; import useChangeActiveLeaf from "src/hooks/useChangeActiveLeaf";
import { toValidNumber } from "src/utils"; import { toValidNumber } from "src/utils";
import { VerticalDraggableDivider } from "./DraggableDivider";
import VerticalSplitFilesPane from "./VerticalSplitFilesPane"; import VerticalSplitFilesPane from "./VerticalSplitFilesPane";
import VerticalSplitFoldersAndTagsPane from "./VerticalSplitFoldersAndTagsPane"; import VerticalSplitFoldersAndTagsPane from "./VerticalSplitFoldersAndTagsPane";

View file

@ -1,9 +1,10 @@
import { ReactNode } from "react"; import { ReactNode } from "react";
import { useShallow } from "zustand/react/shallow";
import { FolderIcon, TagIcon } from "src/assets/icons"; import { FolderIcon, TagIcon } from "src/assets/icons";
import { useExplorer } from "src/hooks/useExplorer"; import { useExplorer } from "src/hooks/useExplorer";
import { ExplorerStore } from "src/store"; import { ExplorerStore } from "src/store";
import { ViewMode } from "src/store/common"; import { ViewMode } from "src/store/common";
import { useShallow } from "zustand/react/shallow";
const ViewModeDisplay = () => { const ViewModeDisplay = () => {
const { useExplorerStore, plugin } = useExplorer(); const { useExplorerStore, plugin } = useExplorer();

View file

@ -1,9 +1,11 @@
import { useEffect } from "react"; import { useEffect } from "react";
import { useShallow } from "zustand/react/shallow"; import { useShallow } from "zustand/react/shallow";
import { ActiveLeafChangeEventName } from "src/assets/constants";
import { ExplorerStore } from "src/store"; import { ExplorerStore } from "src/store";
import { ActiveLeafChangeEventName } from "src/assets/constants";
import { useExplorer } from "./useExplorer"; import { useExplorer } from "./useExplorer";
const useChangeActiveLeaf = () => { const useChangeActiveLeaf = () => {

View file

@ -1,24 +1,24 @@
import { useShowFolderIcon } from "./useShowFolderIcon"; import { useAutoHideActionBar } from "./useAutoHideActionBar";
import { useBoldFileTitle } from "./useBoldFileTitle";
import { useFileCreationDateFormat } from "./useFileCreationDateFormat";
import { useFileItemSpacing } from "./useFileItemSpacing";
import { useHideRootFolder } from "./useHideRootFolder";
import { useHighlightActionBar } from "./useHighlightActionBar";
import { useIncludeSubfolderFiles } from "./useIncludeSubfolderFiles"; import { useIncludeSubfolderFiles } from "./useIncludeSubfolderFiles";
import { useShowFileDetail } from "./useShowFileDetail"; import { useIncludeSubTagFiles } from "./useIncludeSubTagFiles";
import { useShowHierarchyLines } from "./useShowHierarchyLines";
import { useLayoutMode } from "./useLayoutMode"; import { useLayoutMode } from "./useLayoutMode";
import { useOpenDestinationFolder } from "./useOpenDestinationFolder"; import { useOpenDestinationFolder } from "./useOpenDestinationFolder";
import { useHideRootFolder } from "./useHideRootFolder";
import { useFileItemSpacing } from "./useFileItemSpacing";
import { useShowFileItemDivider } from "./useShowFileItemDivider";
import { useHighlightActionBar } from "./useHighlightActionBar";
import { useAutoHideActionBar } from "./useAutoHideActionBar";
import { useShowFileCreationDate } from "./useShowFileCreationDate";
import { useFileCreationDateFormat } from "./useFileCreationDateFormat";
import { useStripMarkdownSyntaxInPreview } from "./useStripMarkdownSyntax";
import { useBoldFileTitle } from "./useBoldFileTitle";
import { useRemoveFirstHeadingInPreview } from "./useRemoveFirstHeadingInPreview"; import { useRemoveFirstHeadingInPreview } from "./useRemoveFirstHeadingInPreview";
import { useShowFolderView } from "./useShowFolderView"; import { useShowFileCreationDate } from "./useShowFileCreationDate";
import { useShowTagView } from "./useShowTagView"; import { useShowFileDetail } from "./useShowFileDetail";
import { useIncludeSubTagFiles } from "./useIncludeSubTagFiles"; import { useShowFileItemDivider } from "./useShowFileItemDivider";
import { useShowTagIcon } from "./useShowTagIcon";
import { useShowFilesCount } from "./useShowFilesCount"; import { useShowFilesCount } from "./useShowFilesCount";
import { useShowFolderIcon } from "./useShowFolderIcon";
import { useShowFolderView } from "./useShowFolderView";
import { useShowHierarchyLines } from "./useShowHierarchyLines";
import { useShowTagIcon } from "./useShowTagIcon";
import { useShowTagView } from "./useShowTagView";
import { useStripMarkdownSyntaxInPreview } from "./useStripMarkdownSyntax";
export { export {
useShowFolderIcon, useShowFolderIcon,

View file

@ -1,8 +1,9 @@
import { useState } from "react"; import { useState } from "react";
import { useWatchSettingsChange } from "./useWatchSettingsChange";
import { FileItemSpacing } from "src/settings"; import { FileItemSpacing } from "src/settings";
import { useWatchSettingsChange } from "./useWatchSettingsChange";
export const useFileItemSpacing = ( export const useFileItemSpacing = (
defaultSpacing: FileItemSpacing defaultSpacing: FileItemSpacing
): { fileItemSpacing: FileItemSpacing } => { ): { fileItemSpacing: FileItemSpacing } => {

View file

@ -1,8 +1,9 @@
import { useState } from "react"; import { useState } from "react";
import { useWatchSettingsChange } from "./useWatchSettingsChange";
import { LayoutMode } from "src/settings"; import { LayoutMode } from "src/settings";
import { useWatchSettingsChange } from "./useWatchSettingsChange";
export const useLayoutMode = ( export const useLayoutMode = (
defaultLayout: LayoutMode defaultLayout: LayoutMode
): { layoutMode: LayoutMode } => { ): { layoutMode: LayoutMode } => {

View file

@ -1,4 +1,4 @@
import useChangeFolder from "./useChangeFolder";
import useChangeFile from "./useChangeFile"; import useChangeFile from "./useChangeFile";
import useChangeFolder from "./useChangeFolder";
export { useChangeFolder, useChangeFile }; export { useChangeFolder, useChangeFile };

View file

@ -1,17 +1,17 @@
import { TFile } from "obsidian";
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import { useShallow } from "zustand/react/shallow"; import { useShallow } from "zustand/react/shallow";
import { TFile } from "obsidian";
import { ExplorerStore } from "src/store";
import { VaultChangeEvent, VaultChangeEventName } from "src/assets/constants"; import { VaultChangeEvent, VaultChangeEventName } from "src/assets/constants";
import { ExplorerStore } from "src/store";
import { FILE_MANUAL_SORT_RULE } from "src/store/file";
import { isFile } from "src/utils"; import { isFile } from "src/utils";
import { useExplorer } from "../useExplorer"; import { useExplorer } from "../useExplorer";
import { import {
useIncludeSubfolderFiles, useIncludeSubfolderFiles,
useIncludeSubTagFiles, useIncludeSubTagFiles,
} from "../useSettingsHandler"; } from "../useSettingsHandler";
import { FILE_MANUAL_SORT_RULE } from "src/store/file";
const useChangeFile = () => { const useChangeFile = () => {
const { useExplorerStore, plugin } = useExplorer(); const { useExplorerStore, plugin } = useExplorer();

View file

@ -1,12 +1,15 @@
import { TFolder } from "obsidian";
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import { useShallow } from "zustand/react/shallow"; import { useShallow } from "zustand/react/shallow";
import { TFolder } from "obsidian";
import { ExplorerStore } from "src/store";
import { VaultChangeEvent, VaultChangeEventName } from "src/assets/constants"; import { VaultChangeEvent, VaultChangeEventName } from "src/assets/constants";
import { isFolder } from "src/utils"; import { ExplorerStore } from "src/store";
import { useExplorer } from "../useExplorer";
import { FOLDER_MANUAL_SORT_RULE } from "src/store/folder"; import { FOLDER_MANUAL_SORT_RULE } from "src/store/folder";
import { isFolder } from "src/utils";
import { useExplorer } from "../useExplorer";
const useChangeFolder = () => { const useChangeFolder = () => {
const { useExplorerStore } = useExplorer(); const { useExplorerStore } = useExplorer();

View file

@ -1,15 +1,15 @@
import { Plugin, TAbstractFile, WorkspaceLeaf } from "obsidian"; import { Plugin, TAbstractFile, WorkspaceLeaf } from "obsidian";
import { ExplorerView } from "./ExplorerView";
import { SettingTab } from "./SettingTab";
import { DEFAULT_SETTINGS, FolderFileSplitterPluginSettings } from "./settings";
import { import {
ActiveLeafChangeEventName, ActiveLeafChangeEventName,
SettingsChangeEventName, SettingsChangeEventName,
VaultChangeEventName, VaultChangeEventName,
VaultChangeType, VaultChangeType,
} from "./assets/constants"; } from "./assets/constants";
import { ExplorerView } from "./ExplorerView";
import { Lang } from "./locales"; import { Lang } from "./locales";
import { DEFAULT_SETTINGS, FolderFileSplitterPluginSettings } from "./settings";
import { SettingTab } from "./SettingTab";
export default class FolderFileSplitterPlugin extends Plugin { export default class FolderFileSplitterPlugin extends Plugin {
settings: FolderFileSplitterPluginSettings; settings: FolderFileSplitterPluginSettings;

View file

@ -1,9 +1,10 @@
import { StateCreator } from "zustand"; import { StateCreator } from "zustand";
import FolderFileSplitterPlugin from "../main";
import { ExplorerStore } from "src/store";
import { ValueOf } from "src/settings";
import { FFS_VIEW_MODE_KEY } from "src/assets/constants"; import { FFS_VIEW_MODE_KEY } from "src/assets/constants";
import { ValueOf } from "src/settings";
import { ExplorerStore } from "src/store";
import FolderFileSplitterPlugin from "../main";
export const VIEW_MODE = { export const VIEW_MODE = {
ALL: "all", ALL: "all",

View file

@ -1,15 +1,16 @@
import { StateCreator } from "zustand";
import { TFile, TFolder } from "obsidian"; import { TFile, TFolder } from "obsidian";
import { StateCreator } from "zustand";
import { ExplorerStore } from "src/store";
import FolderFileSplitterPlugin from "../main";
import { isFile } from "../utils";
import { import {
FFS_FILE_MANUAL_SORT_ORDER_KEY, FFS_FILE_MANUAL_SORT_ORDER_KEY,
FFS_FILE_SORT_RULE_KEY, FFS_FILE_SORT_RULE_KEY,
FFS_FOCUSED_FILE_PATH_KEY, FFS_FOCUSED_FILE_PATH_KEY,
FFS_PINNED_FILE_PATHS_KEY, FFS_PINNED_FILE_PATHS_KEY,
} from "../assets/constants"; } from "../assets/constants";
import { ExplorerStore } from "src/store"; import FolderFileSplitterPlugin from "../main";
import { isFile } from "../utils";
export type FileSortRule = export type FileSortRule =
| "FileNameAscending" | "FileNameAscending"

View file

@ -1,8 +1,8 @@
import { StateCreator } from "zustand";
import { Notice, TFile, TFolder } from "obsidian"; import { Notice, TFile, TFolder } from "obsidian";
import { StateCreator } from "zustand";
import { ExplorerStore } from "src/store";
import FolderFileSplitterPlugin from "../main";
import { isFile, isFolder, uniq } from "../utils";
import { import {
FFS_EXPANDED_FOLDER_PATHS_KEY, FFS_EXPANDED_FOLDER_PATHS_KEY,
FFS_FOCUSED_FOLDER_PATH_KEY, FFS_FOCUSED_FOLDER_PATH_KEY,
@ -10,12 +10,14 @@ import {
FFS_FOLDER_SORT_RULE_KEY, FFS_FOLDER_SORT_RULE_KEY,
FFS_PINNED_FOLDER_PATHS_KEY, FFS_PINNED_FOLDER_PATHS_KEY,
} from "../assets/constants"; } from "../assets/constants";
import { NOTIFICATION_MESSAGE_COPY } from "../locales/message";
import FolderFileSplitterPlugin from "../main";
import { import {
FOLDER_NOTE_LOCATION, FOLDER_NOTE_LOCATION,
FOLDER_NOTE_MISSING_BEHAVIOR, FOLDER_NOTE_MISSING_BEHAVIOR,
} from "../settings"; } from "../settings";
import { NOTIFICATION_MESSAGE_COPY } from "../locales/message"; import { isFile, isFolder, uniq } from "../utils";
import { ExplorerStore } from "src/store";
export type FolderSortRule = export type FolderSortRule =
| "FolderNameAscending" | "FolderNameAscending"

View file

@ -3,8 +3,8 @@ import { create } from "zustand";
import FolderFileSplitterPlugin from "../main"; import FolderFileSplitterPlugin from "../main";
import { CommonExplorerStore, createCommonExplorerStore } from "./common"; import { CommonExplorerStore, createCommonExplorerStore } from "./common";
import { createFolderExplorerStore, FolderExplorerStore } from "./folder";
import { createFileExplorerStore, FileExplorerStore } from "./file"; import { createFileExplorerStore, FileExplorerStore } from "./file";
import { createFolderExplorerStore, FolderExplorerStore } from "./folder";
import { createTagExplorerStore, TagExplorerStore } from "./tag"; import { createTagExplorerStore, TagExplorerStore } from "./tag";
type FolderPath = string; type FolderPath = string;

View file

@ -1,15 +1,16 @@
import { StateCreator } from "zustand";
import { getAllTags, TFile } from "obsidian"; import { getAllTags, TFile } from "obsidian";
import { StateCreator } from "zustand";
import FolderFileSplitterPlugin from "../main";
import { ExplorerStore } from "src/store";
import { import {
FFS_EXPANDED_TAG_PATHS_KEY, FFS_EXPANDED_TAG_PATHS_KEY,
FFS_FOCUSED_TAG_PATH_KEY, FFS_FOCUSED_TAG_PATH_KEY,
FFS_PINNED_TAG_PATHS_KEY, FFS_PINNED_TAG_PATHS_KEY,
} from "src/assets/constants"; } from "src/assets/constants";
import { ExplorerStore } from "src/store";
import { uniq } from "src/utils"; import { uniq } from "src/utils";
import FolderFileSplitterPlugin from "../main";
type FolderPath = string; type FolderPath = string;
type ChildrenPaths = string[]; type ChildrenPaths = string[];
export type ManualSortOrder = Record<FolderPath, ChildrenPaths>; export type ManualSortOrder = Record<FolderPath, ChildrenPaths>;