summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--components/Sidebar/Backlinks.tsx2
-rw-r--r--components/Sidebar/Link.tsx17
-rw-r--r--components/Sidebar/Note.tsx2
-rw-r--r--components/Sidebar/OrgImage.tsx4
-rw-r--r--components/Sidebar/Section.tsx16
-rw-r--r--components/Sidebar/Title.tsx1
-rw-r--r--components/Sidebar/Toolbar.tsx12
-rw-r--r--util/processOrg.tsx4
-rw-r--r--util/uniorg.tsx1
9 files changed, 18 insertions, 41 deletions
diff --git a/components/Sidebar/Backlinks.tsx b/components/Sidebar/Backlinks.tsx
index 0bbf415..5a8f6fc 100644
--- a/components/Sidebar/Backlinks.tsx
+++ b/components/Sidebar/Backlinks.tsx
@@ -2,7 +2,6 @@ import { LinksByNodeId, NodeByCite, NodeById } from '../../pages/index'
import { GraphData, NodeObject, LinkObject } from 'force-graph'
-import { normalizeLinkEnds } from '../../pages/index'
import { VStack, Box, Button, Heading, StackDivider } from '@chakra-ui/react'
import React from 'react'
import { ProcessedOrg } from '../../util/processOrg'
@@ -24,6 +23,7 @@ export interface BacklinksProps {
import { PreviewLink } from './Link'
import { OrgRoamNode } from '../../api'
import { Section } from './Section'
+import { normalizeLinkEnds } from '../../util/normalizeLinkEnds'
export const Backlinks = (props: BacklinksProps) => {
const {
diff --git a/components/Sidebar/Link.tsx b/components/Sidebar/Link.tsx
index 2f1ad64..73830ce 100644
--- a/components/Sidebar/Link.tsx
+++ b/components/Sidebar/Link.tsx
@@ -14,17 +14,17 @@ import {
Text,
useTheme,
} from '@chakra-ui/react'
-import React, { ReactElement, useContext, useEffect, useMemo, useState } from 'react'
+import React, { useContext, useEffect, useMemo, useState } from 'react'
import { ProcessedOrg } from '../../util/processOrg'
-import unified from 'unified'
+// import unified from 'unified'
//import createStream from 'unified-stream'
-import uniorgParse from 'uniorg-parse'
-import uniorg2rehype from 'uniorg-rehype'
+// import uniorgParse from 'uniorg-parse'
+// import uniorg2rehype from 'uniorg-rehype'
//import highlight from 'rehype-highlight'
-import katex from 'rehype-katex'
+// import katex from 'rehype-katex'
import 'katex/dist/katex.css'
-import rehype2react from 'rehype-react'
+// import rehype2react from 'rehype-react'
import { ThemeContext } from '../../util/themecontext'
import { LinksByNodeId, NodeByCite, NodeById } from '../../pages'
@@ -63,13 +63,10 @@ export interface NormalLinkProps {
children: string
}
-import { hexToRGBA, getThemeColor } from '../../pages/index'
import { defaultNoteStyle, viewerNoteStyle, outlineNoteStyle } from './noteStyle'
-import { OrgImage } from './OrgImage'
import { Scrollbars } from 'react-custom-scrollbars-2'
import { ExternalLinkIcon } from '@chakra-ui/icons'
-import { Section } from './Section'
-import { OrgRoamLink } from '../../api'
+import { getThemeColor } from '../../util/getThemeColor'
export const NodeLink = (props: NodeLinkProps) => {
const {
diff --git a/components/Sidebar/Note.tsx b/components/Sidebar/Note.tsx
index 638b43a..3d55816 100644
--- a/components/Sidebar/Note.tsx
+++ b/components/Sidebar/Note.tsx
@@ -1,7 +1,7 @@
import React from 'react'
import { NodeObject } from 'force-graph'
-import { NodeById, NodeByCite, LinksByNodeId, normalizeLinkEnds } from '../../pages'
+import { NodeById, NodeByCite, LinksByNodeId } from '../../pages'
import { Box, Flex } from '@chakra-ui/react'
import { UniOrg } from '../../util/uniorg'
import { Backlinks } from '../../components/Sidebar/Backlinks'
diff --git a/components/Sidebar/OrgImage.tsx b/components/Sidebar/OrgImage.tsx
index 0922834..f371f49 100644
--- a/components/Sidebar/OrgImage.tsx
+++ b/components/Sidebar/OrgImage.tsx
@@ -1,5 +1,5 @@
/* eslint-disable @next/next/no-img-element */
-import React, { useEffect, useState } from 'react'
+import React, { useState } from 'react'
import Image from 'next/image'
import path from 'path'
import { Container } from '@chakra-ui/react'
@@ -13,7 +13,7 @@ export interface OrgImageProps {
export const OrgImage = (props: OrgImageProps) => {
const { src, file } = props
- const [image, setImage] = useState<any>(null)
+ // const [image, setImage] = useState<any>(null)
/* )
* .then((res) => res.blob())
diff --git a/components/Sidebar/Section.tsx b/components/Sidebar/Section.tsx
index adaf00e..7e99f4f 100644
--- a/components/Sidebar/Section.tsx
+++ b/components/Sidebar/Section.tsx
@@ -1,17 +1,7 @@
-import { Box, Collapse, Flex, IconButton } from '@chakra-ui/react'
-import React, {
- JSXElementConstructor,
- ReactChild,
- ReactElement,
- ReactNode,
- useContext,
- useEffect,
- useState,
-} from 'react'
-import { BiCaretDownCircle, BiChevronDownCircle, BiCircle } from 'react-icons/bi'
-import { ComponentLike, ComponentPropsWithoutNode } from 'rehype-react'
+import { Box, Flex, IconButton } from '@chakra-ui/react'
+import React, { ReactChild, useContext, useEffect, useState } from 'react'
import { VscCircleFilled, VscCircleOutline } from 'react-icons/vsc'
-import { ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon } from '@chakra-ui/icons'
+import { ChevronDownIcon, ChevronUpIcon } from '@chakra-ui/icons'
import { NoteContext } from '../../util/NoteContext'
export interface SectionProps {
diff --git a/components/Sidebar/Title.tsx b/components/Sidebar/Title.tsx
index 2c8d8b7..791cbb8 100644
--- a/components/Sidebar/Title.tsx
+++ b/components/Sidebar/Title.tsx
@@ -1,6 +1,5 @@
import { Flex, Heading } from '@chakra-ui/react'
import React from 'react'
-import { BiFile } from 'react-icons/bi'
import { OrgRoamNode } from '../../api'
export interface TitleProps {
diff --git a/components/Sidebar/Toolbar.tsx b/components/Sidebar/Toolbar.tsx
index 71f3807..f606837 100644
--- a/components/Sidebar/Toolbar.tsx
+++ b/components/Sidebar/Toolbar.tsx
@@ -1,17 +1,9 @@
import React from 'react'
-import { Text, Flex, IconButton, ButtonGroup, Tooltip } from '@chakra-ui/react'
-import {
- BiAlignJustify,
- BiAlignLeft,
- BiAlignMiddle,
- BiAlignRight,
- BiFont,
- BiRightIndent,
-} from 'react-icons/bi'
+import { Flex, IconButton, ButtonGroup, Tooltip } from '@chakra-ui/react'
+import { BiAlignJustify, BiAlignLeft, BiAlignMiddle, BiAlignRight } from 'react-icons/bi'
import { MdOutlineExpand, MdOutlineCompress } from 'react-icons/md'
import { ChevronLeftIcon, ChevronRightIcon } from '@chakra-ui/icons'
import { IoIosListBox, IoMdListBox } from 'react-icons/io'
-import { NodeObject } from 'force-graph'
export interface ToolbarProps {
setJustification: any
diff --git a/util/processOrg.tsx b/util/processOrg.tsx
index ea868ee..2abc256 100644
--- a/util/processOrg.tsx
+++ b/util/processOrg.tsx
@@ -26,7 +26,7 @@ import remarkSectionize from 'remark-sectionize'
import remarkRehype from 'remark-rehype'
import { PreviewLink } from '../components/Sidebar/Link'
-import { LinksByNodeId, NodeByCite, NodeById, normalizeLinkEnds } from '../pages'
+import { LinksByNodeId, NodeByCite, NodeById } from '../pages'
import React, { createContext, ReactNode, useMemo } from 'react'
import { OrgImage } from '../components/Sidebar/OrgImage'
import { Section } from '../components/Sidebar/Section'
@@ -36,6 +36,7 @@ import { OrgRoamLink, OrgRoamNode } from '../api'
// @ts-expect-error non-ESM unified means no types
import { toString } from 'hast-util-to-string'
import { Box, chakra } from '@chakra-ui/react'
+import { normalizeLinkEnds } from './normalizeLinkEnds'
export interface ProcessedOrgProps {
nodeById: NodeById
@@ -126,7 +127,6 @@ export const ProcessedOrg = (props: ProcessedOrgProps) => {
const isMarkdown = previewNode?.file?.slice(-3) === '.md'
const baseProcessor = isMarkdown ? mdProcessor : orgProcessor
- console.log(macros)
const processor = useMemo(
() =>
baseProcessor
diff --git a/util/uniorg.tsx b/util/uniorg.tsx
index 4172d7a..8e285e6 100644
--- a/util/uniorg.tsx
+++ b/util/uniorg.tsx
@@ -1,5 +1,4 @@
import React, { useEffect, useMemo, useState } from 'react'
-import { OrgRoamLink, OrgRoamNode } from '../api'
import { LinksByNodeId, NodeByCite, NodeById } from '../pages/index'
import { ProcessedOrg } from './processOrg'