- {readingTimeEstimation && (
+ {!enablePreviewZenMode && readingTimeEstimation && (
{readingTimeEstimation.text}
diff --git a/src/webview/components/Preview.tsx b/src/webview/components/Preview.tsx
index eafa79a8..0a20db3b 100644
--- a/src/webview/components/Preview.tsx
+++ b/src/webview/components/Preview.tsx
@@ -14,6 +14,7 @@ import { Topbar } from './Topbar';
export default function Preview() {
const {
+ enablePreviewZenMode,
hiddenPreviewElement,
isPresentationMode,
isLoadingPreview,
@@ -80,9 +81,11 @@ export default function Preview() {
{/** Context menu */}
{/** Floating Actions */}
-
+ {!enablePreviewZenMode &&
}
{/** Markdown Editor */}
- {highlightElementBeingEdited &&
}
+ {!enablePreviewZenMode && highlightElementBeingEdited && (
+
+ )}
);
}
diff --git a/src/webview/containers/preview.ts b/src/webview/containers/preview.ts
index 25b0fa87..d162ae82 100644
--- a/src/webview/containers/preview.ts
+++ b/src/webview/containers/preview.ts
@@ -163,6 +163,9 @@ const PreviewContainer = createContainer(() => {
const isVSCode = useMemo(() => {
return !!config.isVSCode;
}, [config]);
+ const enablePreviewZenMode = useMemo(() => {
+ return !!config.enablePreviewZenMode;
+ }, [config]);
const contextMenuId = useMemo(() => {
return 'crossnote-context-menu';
}, []);
@@ -862,120 +865,128 @@ const PreviewContainer = createContainer(() => {
}
}, [postMessage]);
- const bindHighlightEvent = useCallback((previewElement: HTMLDivElement) => {
- setHighlightElement(null);
- const sourceLineElements =
- previewElement.querySelectorAll('[data-source-line]');
-
- const highlightElementsThatAddedEventSet = new Set