From 546a88ec37073840e98ed689f7139d04985e861c Mon Sep 17 00:00:00 2001 From: "Thomas F. K. Jorna" Date: Mon, 11 Oct 2021 01:13:10 +0200 Subject: feat(preview): ui redo --- util/processOrg.tsx | 7 +++++-- util/uniorg.tsx | 11 ++++++++++- 2 files changed, 15 insertions(+), 3 deletions(-) (limited to 'util') diff --git a/util/processOrg.tsx b/util/processOrg.tsx index 1bab2cd..05142dd 100644 --- a/util/processOrg.tsx +++ b/util/processOrg.tsx @@ -7,7 +7,7 @@ import extractKeywords from 'uniorg-extract-keywords' import attachments from 'uniorg-attach' // rehypeHighlight does not have any types // @ts-expect-error -import highlight from 'rehype-highlight' +// import highlight from 'rehype-highlight' import katex from 'rehype-katex' import 'katex/dist/katex.css' import rehype2react from 'rehype-react' @@ -24,6 +24,7 @@ export interface ProcessedOrgProps { previewText: any nodeByCite: NodeByCite setSidebarHighlightedNode: any + openContextMenu: any } export const ProcessedOrg = (props: ProcessedOrgProps) => { @@ -34,6 +35,7 @@ export const ProcessedOrg = (props: ProcessedOrgProps) => { previewText, nodeByCite, previewNode, + openContextMenu, } = props const processor = unified() @@ -42,7 +44,7 @@ export const ProcessedOrg = (props: ProcessedOrgProps) => { .use(attachments) .use(uniorgSlug) .use(uniorg2rehype) - .use(highlight) + // .use(highlight) .use(katex) .use(rehype2react, { createElement: React.createElement, @@ -56,6 +58,7 @@ export const ProcessedOrg = (props: ProcessedOrgProps) => { href={`${href as string}`} nodeById={nodeById} setPreviewNode={setPreviewNode} + openContextMenu={openContextMenu} > {children} diff --git a/util/uniorg.tsx b/util/uniorg.tsx index 217bad1..8802dd1 100644 --- a/util/uniorg.tsx +++ b/util/uniorg.tsx @@ -9,10 +9,18 @@ export interface UniOrgProps { setPreviewNode: any nodeByCite: NodeByCite setSidebarHighlightedNode: any + openContextMenu: any } export const UniOrg = (props: UniOrgProps) => { - const { setSidebarHighlightedNode, nodeById, nodeByCite, previewNode, setPreviewNode } = props + const { + openContextMenu, + setSidebarHighlightedNode, + nodeById, + nodeByCite, + previewNode, + setPreviewNode, + } = props const [previewText, setPreviewText] = useState('') @@ -44,6 +52,7 @@ export const UniOrg = (props: UniOrgProps) => { previewText, nodeByCite, setSidebarHighlightedNode, + openContextMenu, }} /> )} -- cgit v1.2.3