Skip to content

Commit

Permalink
chore
Browse files Browse the repository at this point in the history
  • Loading branch information
k70suK3-k06a7ash1 committed Feb 24, 2025
1 parent 0771799 commit 9c33e6d
Show file tree
Hide file tree
Showing 37 changed files with 109 additions and 109 deletions.
2 changes: 1 addition & 1 deletion src/components/atoms/icon/AddSectionIcon/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { DispatchWithoutAction, FC } from "react";
import { PlusSquare } from "lucide-react";
import { Button } from "~/components/ui/button.tsx";
import { Button } from "@/components/ui/button.tsx";

type Props = {
handleAddSection: DispatchWithoutAction;
Expand Down
2 changes: 1 addition & 1 deletion src/components/atoms/icon/ApplyTemplateIcon/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { DispatchWithoutAction } from "react";
import { FileUp } from "lucide-react";
import { Spacer } from "../../Spacer";
import { IncludeIconButton } from "~/styles/IncludeIconButton";
import { IncludeIconButton } from "@/styles/IncludeIconButton";
type Props = {
handleApply: DispatchWithoutAction;
};
Expand Down
2 changes: 1 addition & 1 deletion src/components/atoms/icon/BottomAddSectionIcon/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { PlusCircle } from "lucide-react";
import { Spacer } from "../../Spacer";
import { TabItem } from "../../../../styles/tabItem";
import { useAddSection } from "~/hooks/useAddSection";
import { useAddSection } from "@/hooks/useAddSection";

export const BottomAddSection = () => {
const { handleAddSection } = useAddSection();
Expand Down
2 changes: 1 addition & 1 deletion src/components/atoms/icon/CancelIcon/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { DispatchWithoutAction, FC } from "react";
import { RotateCw } from "lucide-react";
import { Button } from "~/components/ui/button";
import { Button } from "@/components/ui/button";

type Props = {
handleCancel: DispatchWithoutAction;
Expand Down
2 changes: 1 addition & 1 deletion src/components/atoms/icon/ClearIcon/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Eraser } from "lucide-react";
import { Spacer } from "../../Spacer";
import { TabItem } from "../../../../styles/tabItem";
import { useMarkdownContext } from "~/context/MarkdownContext";
import { useMarkdownContext } from "@/context/MarkdownContext";

export const ClearIcon = () => {
const { setMarkdown } = useMarkdownContext();
Expand Down
10 changes: 5 additions & 5 deletions src/components/atoms/icon/TemplateIcon/index.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { FileText } from "lucide-react";
import { Spacer } from "../../Spacer";
import { TabItem } from "../../../../styles/tabItem";
import type { LanguageKey, SeparateLevelType } from "~/types";
import type { LanguageKey, SeparateLevelType } from "@/types";
import { useModal } from "react-hooks-use-modal";
import { SetTemplateModal } from "~/components/features/setTemplateModal";
import { languageAndReadmeMap } from "~/constants/languageAndReadmeMap";
import { useSplitByTag } from "~/hooks/useSplitByTag";
import { useMarkdownContext } from "~/context/MarkdownContext";
import { SetTemplateModal } from "@/components/features/setTemplateModal";
import { languageAndReadmeMap } from "@/constants/languageAndReadmeMap";
import { useSplitByTag } from "@/hooks/useSplitByTag";
import { useMarkdownContext } from "@/context/MarkdownContext";

export const TemplateSection = () => {
const { splitByTag } = useSplitByTag();
Expand Down
2 changes: 1 addition & 1 deletion src/components/features/card/mode/display/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { DispatchWithoutAction } from "react";
import ReactMarkdown from "react-markdown";
import { EditCardIcon } from "~/components/atoms/icon/EditCardIcon";
import { EditCardIcon } from "@/components/atoms/icon/EditCardIcon";
import remarkGfm from "remark-gfm";

type DisplayCardProps = {
Expand Down
6 changes: 3 additions & 3 deletions src/components/features/card/mode/edit/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { type Dispatch, type DispatchWithoutAction, useState } from "react";
import type { ContentType } from "~/types";
import { SaveCardIcon } from "~/components/atoms/icon/SaveCardIcon";
import { useIsIncludeTag } from "~/hooks/useIsIncludeTag";
import type { ContentType } from "@/types";
import { SaveCardIcon } from "@/components/atoms/icon/SaveCardIcon";
import { useIsIncludeTag } from "@/hooks/useIsIncludeTag";

type EditCardProps = {
content: ContentType;
Expand Down
2 changes: 1 addition & 1 deletion src/components/features/language/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { ChangeEvent, Dispatch } from "react";
import type { LanguageKey } from "~/types/figurative/LanguageType";
import type { LanguageKey } from "@/types/figurative/LanguageType";

type LanguageSelectedProps = {
defaultKey: LanguageKey;
Expand Down
2 changes: 1 addition & 1 deletion src/components/features/previewSection/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { ContentType } from "~/types";
import type { ContentType } from "@/types";
import ReactMarkdown from "react-markdown";

import remarkGfm from "remark-gfm";
Expand Down
2 changes: 1 addition & 1 deletion src/components/features/selectSeparateLevel/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ArrowLeft, ArrowRight } from "lucide-react";
import { H1Icon, H2Icon, H3Icon } from "./level";
import { useSeparateLevel } from "~/hooks/useSeparateLevel";
import { useSeparateLevel } from "@/hooks/useSeparateLevel";
export const SelectSeparateLevel = () => {
const { separateLevel, onClickByLevel, onClickDecrement, onClickIncrement } =
useSeparateLevel();
Expand Down
8 changes: 4 additions & 4 deletions src/components/features/setTemplateModal/index.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { type Dispatch, type DispatchWithoutAction, useState } from "react";
import {} from "react";
import { ApplyTemplateIcon } from "~/components/atoms/icon/ApplyTemplateIcon";
import { CancelIcon } from "~/components/atoms/icon/CancelIcon";
import { Spacer } from "~/components/atoms/Spacer";
import type { LanguageKey } from "~/types/figurative/LanguageType";
import { ApplyTemplateIcon } from "@/components/atoms/icon/ApplyTemplateIcon";
import { CancelIcon } from "@/components/atoms/icon/CancelIcon";
import { Spacer } from "@/components/atoms/Spacer";
import type { LanguageKey } from "@/types/figurative/LanguageType";
import { LanguageSelected } from "../language";

type Props = {
Expand Down
2 changes: 1 addition & 1 deletion src/features/drag-and-drop/lib/getElementIndex.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { ContentType } from "~/types/index.ts";
import type { ContentType } from "@/types/index.ts";

export const getElementIndex = (
contentsList: ContentType[],
Expand Down
2 changes: 1 addition & 1 deletion src/features/drag-and-drop/lib/handleDrag.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { MutableRefObject } from "react";
import type { PositionType } from "~/types/index.ts";
import type { PositionType } from "@/types/index.ts";

export const handleDragStart = (
event: React.DragEvent,
Expand Down
24 changes: 12 additions & 12 deletions src/features/drag-and-drop/lib/reSortArrayElements.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import { ContentType } from "~/types";
import { ContentType } from "@/types";

export const reSortArrayElements = (
array: ContentType[],
hoveredIndex: number,
draggingIndex: number
array: ContentType[],
hoveredIndex: number,
draggingIndex: number,
) => {
const stringArray = array.map(({ content }) => content);
const element = stringArray.splice(draggingIndex, 1)[0];
stringArray.splice(hoveredIndex, 0, element);
const stringArray = array.map(({ content }) => content);
const element = stringArray.splice(draggingIndex, 1)[0];
stringArray.splice(hoveredIndex, 0, element);

const reNumberingList: ContentType[] = stringArray.map((content, index) => ({
id: index,
content,
}));
return reNumberingList;
const reNumberingList: ContentType[] = stringArray.map((content, index) => ({
id: index,
content,
}));
return reNumberingList;
};
8 changes: 4 additions & 4 deletions src/features/drag-and-drop/model/useDragAndDrop.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { type DragEvent, useRef } from "react";
import { getElementIndex } from "~/features/drag-and-drop/lib/getElementIndex";
import { getElementIndex } from "@/features/drag-and-drop/lib/getElementIndex";
import type { PositionType } from "src/types";
import {
handleDragStart,
handleDragOver,
} from "~/features/drag-and-drop/lib/handleDrag";
import { reSortArrayElements } from "~/features/drag-and-drop/lib/reSortArrayElements";
import { useMarkdownContext } from "~/context/MarkdownContext";
} from "@/features/drag-and-drop/lib/handleDrag";
import { reSortArrayElements } from "@/features/drag-and-drop/lib/reSortArrayElements";
import { useMarkdownContext } from "@/context/MarkdownContext";

export const useDragAndDrop = () => {
const { markdown, setMarkdown: set } = useMarkdownContext();
Expand Down
10 changes: 5 additions & 5 deletions src/features/drag-and-drop/ui/index.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { CardSection } from "~/features/markdown-editor/ui";
import { CardSection } from "@/features/markdown-editor/ui";

import { useUpdateContent } from "~/features/markdown-editor/model/useUpdateContents";
import { useDeleteContent } from "~/features/markdown-editor/model/useDeleteContent";
import { useDragAndDrop } from "~/features/drag-and-drop/model/useDragAndDrop";
import { useMarkdownContext } from "~/context/MarkdownContext";
import { useUpdateContent } from "@/features/markdown-editor/model/useUpdateContents";
import { useDeleteContent } from "@/features/markdown-editor/model/useDeleteContent";
import { useDragAndDrop } from "@/features/drag-and-drop/model/useDragAndDrop";
import { useMarkdownContext } from "@/context/MarkdownContext";

export const useDragComponents = () => {
const { markdown } = useMarkdownContext();
Expand Down
4 changes: 2 additions & 2 deletions src/features/drag-and-drop/ui/useRenderDownloadButton.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { FileExport } from "~/components/atoms/icon/FileExportIcon/index";
import { useMarkdownContext } from "~/context/MarkdownContext";
import { FileExport } from "@/components/atoms/icon/FileExportIcon/index";
import { useMarkdownContext } from "@/context/MarkdownContext";

export const useRenderDownloadButton = () => {
const { markdown: contents } = useMarkdownContext();
Expand Down
6 changes: 3 additions & 3 deletions src/features/markdown-editor/model/useDeleteContent.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useSplitByTag } from "~/hooks/useSplitByTag";
import type { ContentType, SeparateLevelType } from "~/types";
import { useMarkdownContext } from "~/context/MarkdownContext";
import { useSplitByTag } from "@/hooks/useSplitByTag";
import type { ContentType, SeparateLevelType } from "@/types";
import { useMarkdownContext } from "@/context/MarkdownContext";

export const useDeleteContent = () => {
const { splitByTag } = useSplitByTag();
Expand Down
4 changes: 2 additions & 2 deletions src/features/markdown-editor/model/useUpdateContents.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useMarkdownContext } from "~/context/MarkdownContext";
import type { ContentType } from "~/types";
import { useMarkdownContext } from "@/context/MarkdownContext";
import type { ContentType } from "@/types";

export const useUpdateContent = () => {
const { markdown, setMarkdown: set } = useMarkdownContext();
Expand Down
14 changes: 7 additions & 7 deletions src/features/markdown-editor/ui/index.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { type Dispatch, useReducer, type DragEvent } from "react";

import { Card } from "~/components/atoms/card";
import { DraggableIcon } from "~/components/atoms/icon/DraggableIcon";
import { Spacer } from "~/components/atoms/Spacer";
import { DeleteIcon } from "~/components/atoms/icon/DeleteIcon";
import { EditMode } from "~/components/features/card/mode/edit";
import { DisplayMode } from "~/components/features/card/mode/display";
import type { ContentType } from "~/types";
import { Card } from "@/components/atoms/card";
import { DraggableIcon } from "@/components/atoms/icon/DraggableIcon";
import { Spacer } from "@/components/atoms/Spacer";
import { DeleteIcon } from "@/components/atoms/icon/DeleteIcon";
import { EditMode } from "@/components/features/card/mode/edit";
import { DisplayMode } from "@/components/features/card/mode/display";
import type { ContentType } from "@/types";
type Props = {
content: ContentType;
updateContents: Dispatch<ContentType>;
Expand Down
6 changes: 3 additions & 3 deletions src/hooks/useAddSection.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useViewControl } from "~/hooks/useViewControl";
import { useSplitByTag } from "~/hooks/useSplitByTag";
import { useMarkdownContext } from "~/context/MarkdownContext";
import { useViewControl } from "@/hooks/useViewControl";
import { useSplitByTag } from "@/hooks/useSplitByTag";
import { useMarkdownContext } from "@/context/MarkdownContext";

export const useAddSection = () => {
const { splitByTag } = useSplitByTag();
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useDeleteContents.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { useDeleteContent } from "~/features/markdown-editor/model/useDeleteContent";
export { useDeleteContent } from "@/features/markdown-editor/model/useDeleteContent";
12 changes: 6 additions & 6 deletions src/hooks/useIsIncludeTag.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { useSwitchPatternBySeparateLevel } from "~/hooks/useSwitchPatternBySeparateLevel";
import { useSwitchPatternBySeparateLevel } from "@/hooks/useSwitchPatternBySeparateLevel";
export const useIsIncludeTag = () => {
const { switchPatternBySeparateLevel } = useSwitchPatternBySeparateLevel();
const { switchPatternBySeparateLevel } = useSwitchPatternBySeparateLevel();

const isIncludeTag = (content: string) => {
return Boolean(switchPatternBySeparateLevel(content));
};
return { isIncludeTag };
const isIncludeTag = (content: string) => {
return Boolean(switchPatternBySeparateLevel(content));
};
return { isIncludeTag };
};
2 changes: 1 addition & 1 deletion src/hooks/useMakeContents.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useSplitByTag } from "./useSplitByTag";
import type { SeparateLevelType } from "~/types";
import type { SeparateLevelType } from "@/types";
export const useMakeContents = () => {
const { splitByTag } = useSplitByTag();

Expand Down
4 changes: 2 additions & 2 deletions src/hooks/useOnFileInputChange.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useMakeContents } from "~/hooks/useMakeContents";
import { useMarkdownContext } from "~/context/MarkdownContext";
import { useMakeContents } from "@/hooks/useMakeContents";
import { useMarkdownContext } from "@/context/MarkdownContext";

export const useOnFileInputChange = () => {
const { makeContents } = useMakeContents();
Expand Down
4 changes: 2 additions & 2 deletions src/hooks/useSeparateLevel.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { SeparateLevelType } from "~/types";
import { useMarkdownContext } from "~/context/MarkdownContext";
import type { SeparateLevelType } from "@/types";
import { useMarkdownContext } from "@/context/MarkdownContext";

export const useSeparateLevel = () => {
const { separateLevel, setSeparateLevel: set } = useMarkdownContext();
Expand Down
26 changes: 13 additions & 13 deletions src/hooks/useSplitByTag.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import { useSwitchPatternBySeparateLevel } from "~/hooks/useSwitchPatternBySeparateLevel";
import { useSwitchPatternBySeparateLevel } from "@/hooks/useSwitchPatternBySeparateLevel";
export const useSplitByTag = () => {
const { switchPatternBySeparateLevel } = useSwitchPatternBySeparateLevel();
const splitByTag = (content: string) => {
const splitCotent = content.split("\n");
const { switchPatternBySeparateLevel } = useSwitchPatternBySeparateLevel();
const splitByTag = (content: string) => {
const splitCotent = content.split("\n");

const result: string[][] = [];
for (let row of splitCotent) {
switchPatternBySeparateLevel(row)
? result?.push([row])
: result[result.length - 1]?.push(row);
}
return result?.map((element) => element.join("\n"));
};
return { splitByTag };
const result: string[][] = [];
for (let row of splitCotent) {
switchPatternBySeparateLevel(row)
? result?.push([row])
: result[result.length - 1]?.push(row);
}
return result?.map((element) => element.join("\n"));
};
return { splitByTag };
};
4 changes: 2 additions & 2 deletions src/hooks/useSwitchPatternBySeparateLevel.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { patternH1, patternH2, patternH3 } from "~/libs/common/patterns";
import { useMarkdownContext } from "~/context/MarkdownContext";
import { patternH1, patternH2, patternH3 } from "@/libs/common/patterns";
import { useMarkdownContext } from "@/context/MarkdownContext";

export const useSwitchPatternBySeparateLevel = () => {
const { separateLevel } = useMarkdownContext();
Expand Down
16 changes: 8 additions & 8 deletions src/hooks/useViewControl.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { useRef } from "react";
import { scrollIntoViewCurrentRef } from "~/libs/common/scrollIntoViewCurrentRef";
import { scrollIntoViewCurrentRef } from "@/libs/common/scrollIntoViewCurrentRef";

export const useViewControl = () => {
const bottomRef = useRef<HTMLDivElement>(null);
const topRef = useRef<HTMLDivElement>(null);
const bottomRef = useRef<HTMLDivElement>(null);
const topRef = useRef<HTMLDivElement>(null);

const scrollToTop = () => scrollIntoViewCurrentRef(topRef);
const scrollToBottom = () => scrollIntoViewCurrentRef(bottomRef);
const scrollToTop = () => scrollIntoViewCurrentRef(topRef);
const scrollToBottom = () => scrollIntoViewCurrentRef(bottomRef);

const TopAnchor = (): JSX.Element => <div ref={topRef} />;
const BottomAnchor = (): JSX.Element => <div ref={bottomRef} />;
return { TopAnchor, BottomAnchor, scrollToTop, scrollToBottom };
const TopAnchor = (): JSX.Element => <div ref={topRef} />;
const BottomAnchor = (): JSX.Element => <div ref={bottomRef} />;
return { TopAnchor, BottomAnchor, scrollToTop, scrollToBottom };
};
14 changes: 7 additions & 7 deletions src/layouts/Frame/TabBar/index.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { FileImport } from "~/components/atoms/icon/FileImportIcon/index.tsx";
import { AddSection } from "~/components/atoms/icon/AddSectionIcon/index.tsx";
import { TemplateSection } from "~/components/atoms/icon/TemplateIcon/index.tsx";
import { ClearIcon } from "~/components/atoms/icon/ClearIcon/index.tsx";
import { useAddSection } from "~/hooks/useAddSection.ts";
import { useRenderDownloadButton } from "~/features/drag-and-drop/ui/useRenderDownloadButton.tsx";
import { useOnFileInputChange } from "~/hooks/useOnFileInputChange.ts";
import { FileImport } from "@/components/atoms/icon/FileImportIcon/index.tsx";
import { AddSection } from "@/components/atoms/icon/AddSectionIcon/index.tsx";
import { TemplateSection } from "@/components/atoms/icon/TemplateIcon/index.tsx";
import { ClearIcon } from "@/components/atoms/icon/ClearIcon/index.tsx";
import { useAddSection } from "@/hooks/useAddSection.ts";
import { useRenderDownloadButton } from "@/features/drag-and-drop/ui/useRenderDownloadButton.tsx";
import { useOnFileInputChange } from "@/hooks/useOnFileInputChange.ts";

export const TabBar = (): JSX.Element => {
const { handleAddSection } = useAddSection();
Expand Down
2 changes: 1 addition & 1 deletion src/layouts/SubContent/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Composition } from "~/types";
import { Composition } from "@/types";
export const SubContent = ({ children }: Composition): JSX.Element => (
<div className="px-6">{children}</div>
);
2 changes: 1 addition & 1 deletion src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react";
import ReactDOM from "react-dom/client";
import { App } from "./App";
import { MarkdownProvider } from "~/context/MarkdownContext";
import { MarkdownProvider } from "@/context/MarkdownContext";

ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render(
<React.StrictMode>
Expand Down
2 changes: 1 addition & 1 deletion src/styles/IncludeIconButton/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Composition } from "~/types";
import { Composition } from "@/types";
export const IncludeIconButton = ({ children }: Composition): JSX.Element => (
<div className="border-3 border-[#424040] border-solid rounded-md py-1 px-2 hover:invert">
{children}
Expand Down
2 changes: 1 addition & 1 deletion src/styles/tabItem/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Composition } from "~/types";
import type { Composition } from "@/types";
export const TabItem = ({ children }: Composition): JSX.Element => (
<div className="border-3 border-[#424040] border-dotted rounded-md py-1 px-2">
{children}
Expand Down
2 changes: 1 addition & 1 deletion src/types/figurative/LanguageType.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { languageAndReadmeMap } from "~/constants/languageAndReadmeMap";
import { languageAndReadmeMap } from "@/constants/languageAndReadmeMap";
type LanguageKeyType = typeof languageAndReadmeMap;
export type LanguageKey = keyof LanguageKeyType;
Loading

0 comments on commit 9c33e6d

Please sign in to comment.