@bendyline/squisq-editor-react 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +269 -0
- package/dist/index.js +3825 -0
- package/dist/index.js.map +1 -0
- package/package.json +72 -0
- package/src/EditorContext.tsx +251 -0
- package/src/EditorShell.tsx +139 -0
- package/src/PreviewPanel.tsx +562 -0
- package/src/RawEditor.tsx +151 -0
- package/src/StatusBar.tsx +48 -0
- package/src/TemplateAnnotation.ts +71 -0
- package/src/Toolbar.tsx +465 -0
- package/src/ViewSwitcher.tsx +46 -0
- package/src/WysiwygEditor.tsx +134 -0
- package/src/index.ts +58 -0
- package/src/styles/editor.css +594 -0
- package/src/tiptapBridge.ts +425 -0
package/package.json
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@bendyline/squisq-editor-react",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "React editor shell with raw/WYSIWYG/preview modes for Squisq documents",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "Bendyline",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/nicknisi/squisq.git",
|
|
10
|
+
"directory": "packages/editor-react"
|
|
11
|
+
},
|
|
12
|
+
"homepage": "https://github.com/nicknisi/squisq",
|
|
13
|
+
"keywords": [
|
|
14
|
+
"editor",
|
|
15
|
+
"react",
|
|
16
|
+
"markdown",
|
|
17
|
+
"wysiwyg",
|
|
18
|
+
"monaco",
|
|
19
|
+
"tiptap"
|
|
20
|
+
],
|
|
21
|
+
"publishConfig": {
|
|
22
|
+
"access": "public"
|
|
23
|
+
},
|
|
24
|
+
"type": "module",
|
|
25
|
+
"main": "./dist/index.js",
|
|
26
|
+
"module": "./dist/index.js",
|
|
27
|
+
"types": "./dist/index.d.ts",
|
|
28
|
+
"files": [
|
|
29
|
+
"dist",
|
|
30
|
+
"src"
|
|
31
|
+
],
|
|
32
|
+
"exports": {
|
|
33
|
+
".": {
|
|
34
|
+
"import": "./dist/index.js",
|
|
35
|
+
"types": "./dist/index.d.ts"
|
|
36
|
+
},
|
|
37
|
+
"./styles": "./src/styles/editor.css"
|
|
38
|
+
},
|
|
39
|
+
"scripts": {
|
|
40
|
+
"build": "tsup",
|
|
41
|
+
"typecheck": "tsc --noEmit",
|
|
42
|
+
"prepublishOnly": "npm run build"
|
|
43
|
+
},
|
|
44
|
+
"peerDependencies": {
|
|
45
|
+
"react": "^18.0.0 || ^19.0.0",
|
|
46
|
+
"react-dom": "^18.0.0 || ^19.0.0"
|
|
47
|
+
},
|
|
48
|
+
"dependencies": {
|
|
49
|
+
"@bendyline/squisq": "^0.1.0",
|
|
50
|
+
"@bendyline/squisq-react": "^0.1.0",
|
|
51
|
+
"@monaco-editor/react": "^4.6.0",
|
|
52
|
+
"@tiptap/extension-placeholder": "^2.11.0",
|
|
53
|
+
"@tiptap/extension-table": "^2.11.0",
|
|
54
|
+
"@tiptap/extension-table-cell": "^2.11.0",
|
|
55
|
+
"@tiptap/extension-table-header": "^2.11.0",
|
|
56
|
+
"@tiptap/extension-table-row": "^2.11.0",
|
|
57
|
+
"@tiptap/extension-task-item": "^2.11.0",
|
|
58
|
+
"@tiptap/extension-task-list": "^2.11.0",
|
|
59
|
+
"@tiptap/pm": "^2.11.0",
|
|
60
|
+
"@tiptap/react": "^2.11.0",
|
|
61
|
+
"@tiptap/starter-kit": "^2.11.0",
|
|
62
|
+
"monaco-editor": "^0.55.1"
|
|
63
|
+
},
|
|
64
|
+
"devDependencies": {
|
|
65
|
+
"@types/react": "^18.0.0",
|
|
66
|
+
"@types/react-dom": "^18.0.0",
|
|
67
|
+
"react": "^18.0.0",
|
|
68
|
+
"react-dom": "^18.0.0",
|
|
69
|
+
"tsup": "^8.0.0",
|
|
70
|
+
"typescript": "^5.3.0"
|
|
71
|
+
}
|
|
72
|
+
}
|
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* EditorContext
|
|
3
|
+
*
|
|
4
|
+
* Shared React context that synchronizes state across all three editor views
|
|
5
|
+
* (Raw/Monaco, WYSIWYG/Tiptap, Preview/DocPlayer). When any view modifies the
|
|
6
|
+
* markdown source, the context re-parses and regenerates the MarkdownDocument
|
|
7
|
+
* and Doc so all views stay in sync.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import {
|
|
11
|
+
createContext,
|
|
12
|
+
useContext,
|
|
13
|
+
useState,
|
|
14
|
+
useCallback,
|
|
15
|
+
useMemo,
|
|
16
|
+
useRef,
|
|
17
|
+
useEffect,
|
|
18
|
+
type ReactNode,
|
|
19
|
+
} from 'react';
|
|
20
|
+
import type { Doc } from '@bendyline/squisq/schemas';
|
|
21
|
+
import type { MarkdownDocument } from '@bendyline/squisq/markdown';
|
|
22
|
+
import { parseMarkdown, stringifyMarkdown } from '@bendyline/squisq/markdown';
|
|
23
|
+
import { markdownToDoc } from '@bendyline/squisq/doc';
|
|
24
|
+
import type { Editor as TiptapEditor } from '@tiptap/core';
|
|
25
|
+
import type { editor as MonacoEditorNs } from 'monaco-editor';
|
|
26
|
+
|
|
27
|
+
/** Monaco standalone code editor instance type */
|
|
28
|
+
type MonacoEditor = MonacoEditorNs.IStandaloneCodeEditor;
|
|
29
|
+
|
|
30
|
+
// ─── Types ───────────────────────────────────────────────
|
|
31
|
+
|
|
32
|
+
export type EditorView = 'raw' | 'wysiwyg' | 'preview';
|
|
33
|
+
export type EditorTheme = 'light' | 'dark';
|
|
34
|
+
|
|
35
|
+
export interface EditorState {
|
|
36
|
+
/** Raw markdown source string */
|
|
37
|
+
markdownSource: string;
|
|
38
|
+
/** Parsed markdown document (JSON DOM) */
|
|
39
|
+
markdownDoc: MarkdownDocument | null;
|
|
40
|
+
/** Generated Doc (block hierarchy) */
|
|
41
|
+
doc: Doc | null;
|
|
42
|
+
/** Currently active editor view */
|
|
43
|
+
activeView: EditorView;
|
|
44
|
+
/** Parse error, if any */
|
|
45
|
+
parseError: string | null;
|
|
46
|
+
/** Whether a parse is pending */
|
|
47
|
+
isParsing: boolean;
|
|
48
|
+
/** Current color theme */
|
|
49
|
+
theme: EditorTheme;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export interface EditorActions {
|
|
53
|
+
/** Set markdown source and trigger re-parse */
|
|
54
|
+
setMarkdownSource: (source: string) => void;
|
|
55
|
+
/** Set markdown from a MarkdownDocument (e.g. from WYSIWYG) */
|
|
56
|
+
setMarkdownDoc: (doc: MarkdownDocument) => void;
|
|
57
|
+
/** Switch the active view */
|
|
58
|
+
setActiveView: (view: EditorView) => void;
|
|
59
|
+
/** Register / unregister the Tiptap editor instance (called by WysiwygEditor) */
|
|
60
|
+
setTiptapEditor: (editor: TiptapEditor | null) => void;
|
|
61
|
+
/** Register / unregister the Monaco editor instance (called by RawEditor) */
|
|
62
|
+
setMonacoEditor: (editor: MonacoEditor | null) => void;
|
|
63
|
+
/** Set the color theme */
|
|
64
|
+
setTheme: (theme: EditorTheme) => void;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export interface EditorContextValue extends EditorState, EditorActions {
|
|
68
|
+
/** The live Tiptap editor instance (null when WYSIWYG is not mounted) */
|
|
69
|
+
tiptapEditor: TiptapEditor | null;
|
|
70
|
+
/** The live Monaco editor instance (null when Raw is not mounted) */
|
|
71
|
+
monacoEditor: MonacoEditor | null;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// ─── Context ─────────────────────────────────────────────
|
|
75
|
+
|
|
76
|
+
const EditorContext = createContext<EditorContextValue | null>(null);
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Hook to access the editor context. Must be used within an EditorProvider.
|
|
80
|
+
*/
|
|
81
|
+
// eslint-disable-next-line react-refresh/only-export-components
|
|
82
|
+
export function useEditorContext(): EditorContextValue {
|
|
83
|
+
const ctx = useContext(EditorContext);
|
|
84
|
+
if (!ctx) {
|
|
85
|
+
throw new Error('useEditorContext must be used within an <EditorProvider>');
|
|
86
|
+
}
|
|
87
|
+
return ctx;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// ─── Provider ────────────────────────────────────────────
|
|
91
|
+
|
|
92
|
+
export interface EditorProviderProps {
|
|
93
|
+
/** Initial markdown content */
|
|
94
|
+
initialMarkdown?: string;
|
|
95
|
+
/** Initial active view */
|
|
96
|
+
initialView?: EditorView;
|
|
97
|
+
/** Article ID used when generating the Doc */
|
|
98
|
+
articleId?: string;
|
|
99
|
+
/** Color theme */
|
|
100
|
+
theme?: EditorTheme;
|
|
101
|
+
children: ReactNode;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Provides shared editor state to all child components.
|
|
106
|
+
* Automatically parses markdown and generates a Doc whenever the source changes.
|
|
107
|
+
*/
|
|
108
|
+
export function EditorProvider({
|
|
109
|
+
initialMarkdown = '',
|
|
110
|
+
initialView = 'raw',
|
|
111
|
+
articleId = 'untitled',
|
|
112
|
+
theme: initialTheme = 'light',
|
|
113
|
+
children,
|
|
114
|
+
}: EditorProviderProps) {
|
|
115
|
+
const [markdownSource, setMarkdownSourceRaw] = useState(initialMarkdown);
|
|
116
|
+
const [markdownDoc, setMarkdownDocState] = useState<MarkdownDocument | null>(null);
|
|
117
|
+
const [doc, setDoc] = useState<Doc | null>(null);
|
|
118
|
+
const [activeView, setActiveView] = useState<EditorView>(initialView);
|
|
119
|
+
const [parseError, setParseError] = useState<string | null>(null);
|
|
120
|
+
const [isParsing, setIsParsing] = useState(false);
|
|
121
|
+
const [theme, setTheme] = useState<EditorTheme>(initialTheme);
|
|
122
|
+
const [tiptapEditor, setTiptapEditor] = useState<TiptapEditor | null>(null);
|
|
123
|
+
const [monacoEditor, setMonacoEditor] = useState<MonacoEditor | null>(null);
|
|
124
|
+
|
|
125
|
+
const articleIdRef = useRef(articleId);
|
|
126
|
+
articleIdRef.current = articleId;
|
|
127
|
+
|
|
128
|
+
// Sync theme when prop changes
|
|
129
|
+
useEffect(() => {
|
|
130
|
+
setTheme(initialTheme);
|
|
131
|
+
}, [initialTheme]);
|
|
132
|
+
|
|
133
|
+
// Debounced parse on markdown source change
|
|
134
|
+
const parseTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);
|
|
135
|
+
|
|
136
|
+
const doParse = useCallback((source: string) => {
|
|
137
|
+
setIsParsing(true);
|
|
138
|
+
try {
|
|
139
|
+
const parsed = parseMarkdown(source);
|
|
140
|
+
setMarkdownDocState(parsed);
|
|
141
|
+
setParseError(null);
|
|
142
|
+
|
|
143
|
+
// Generate Doc from parsed markdown
|
|
144
|
+
try {
|
|
145
|
+
const generatedDoc = markdownToDoc(parsed, {
|
|
146
|
+
articleId: articleIdRef.current,
|
|
147
|
+
});
|
|
148
|
+
setDoc(generatedDoc);
|
|
149
|
+
} catch (docErr: unknown) {
|
|
150
|
+
// Doc generation can fail but markdown parse succeeded
|
|
151
|
+
setDoc(null);
|
|
152
|
+
console.warn('Doc generation failed:', docErr instanceof Error ? docErr.message : docErr);
|
|
153
|
+
}
|
|
154
|
+
} catch (err: unknown) {
|
|
155
|
+
setParseError(err instanceof Error ? err.message : 'Parse error');
|
|
156
|
+
setMarkdownDocState(null);
|
|
157
|
+
setDoc(null);
|
|
158
|
+
} finally {
|
|
159
|
+
setIsParsing(false);
|
|
160
|
+
}
|
|
161
|
+
}, []);
|
|
162
|
+
|
|
163
|
+
// Parse on source changes with debounce
|
|
164
|
+
useEffect(() => {
|
|
165
|
+
if (parseTimeoutRef.current) {
|
|
166
|
+
clearTimeout(parseTimeoutRef.current);
|
|
167
|
+
}
|
|
168
|
+
parseTimeoutRef.current = setTimeout(() => {
|
|
169
|
+
doParse(markdownSource);
|
|
170
|
+
}, 150);
|
|
171
|
+
return () => {
|
|
172
|
+
if (parseTimeoutRef.current) {
|
|
173
|
+
clearTimeout(parseTimeoutRef.current);
|
|
174
|
+
}
|
|
175
|
+
};
|
|
176
|
+
}, [markdownSource, doParse]);
|
|
177
|
+
|
|
178
|
+
// Initial parse
|
|
179
|
+
useEffect(() => {
|
|
180
|
+
if (initialMarkdown) {
|
|
181
|
+
doParse(initialMarkdown);
|
|
182
|
+
}
|
|
183
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
184
|
+
}, []);
|
|
185
|
+
|
|
186
|
+
const setMarkdownSource = useCallback((source: string) => {
|
|
187
|
+
setMarkdownSourceRaw(source);
|
|
188
|
+
}, []);
|
|
189
|
+
|
|
190
|
+
const setMarkdownDoc = useCallback((newDoc: MarkdownDocument) => {
|
|
191
|
+
setMarkdownDocState(newDoc);
|
|
192
|
+
// Stringify to update the raw source
|
|
193
|
+
try {
|
|
194
|
+
const newSource = stringifyMarkdown(newDoc);
|
|
195
|
+
setMarkdownSourceRaw(newSource);
|
|
196
|
+
setParseError(null);
|
|
197
|
+
|
|
198
|
+
// Generate Doc
|
|
199
|
+
try {
|
|
200
|
+
const generatedDoc = markdownToDoc(newDoc, {
|
|
201
|
+
articleId: articleIdRef.current,
|
|
202
|
+
});
|
|
203
|
+
setDoc(generatedDoc);
|
|
204
|
+
} catch (docErr: unknown) {
|
|
205
|
+
setDoc(null);
|
|
206
|
+
console.warn('Doc generation failed:', docErr instanceof Error ? docErr.message : docErr);
|
|
207
|
+
}
|
|
208
|
+
} catch (err: unknown) {
|
|
209
|
+
setParseError(err instanceof Error ? err.message : 'Stringify error');
|
|
210
|
+
}
|
|
211
|
+
}, []);
|
|
212
|
+
|
|
213
|
+
const value = useMemo<EditorContextValue>(
|
|
214
|
+
() => ({
|
|
215
|
+
markdownSource,
|
|
216
|
+
markdownDoc,
|
|
217
|
+
doc,
|
|
218
|
+
activeView,
|
|
219
|
+
parseError,
|
|
220
|
+
isParsing,
|
|
221
|
+
theme,
|
|
222
|
+
tiptapEditor,
|
|
223
|
+
monacoEditor,
|
|
224
|
+
setMarkdownSource,
|
|
225
|
+
setMarkdownDoc,
|
|
226
|
+
setActiveView,
|
|
227
|
+
setTiptapEditor,
|
|
228
|
+
setMonacoEditor,
|
|
229
|
+
setTheme,
|
|
230
|
+
}),
|
|
231
|
+
[
|
|
232
|
+
markdownSource,
|
|
233
|
+
markdownDoc,
|
|
234
|
+
doc,
|
|
235
|
+
activeView,
|
|
236
|
+
parseError,
|
|
237
|
+
isParsing,
|
|
238
|
+
theme,
|
|
239
|
+
tiptapEditor,
|
|
240
|
+
monacoEditor,
|
|
241
|
+
setMarkdownSource,
|
|
242
|
+
setMarkdownDoc,
|
|
243
|
+
setActiveView,
|
|
244
|
+
setTiptapEditor,
|
|
245
|
+
setMonacoEditor,
|
|
246
|
+
setTheme,
|
|
247
|
+
],
|
|
248
|
+
);
|
|
249
|
+
|
|
250
|
+
return <EditorContext.Provider value={value}>{children}</EditorContext.Provider>;
|
|
251
|
+
}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* EditorShell
|
|
3
|
+
*
|
|
4
|
+
* Top-level shell component that composes the Toolbar, ViewSwitcher, editor
|
|
5
|
+
* views, and StatusBar into a complete editing experience. Wraps everything
|
|
6
|
+
* in an EditorProvider for shared state.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { useEffect } from 'react';
|
|
10
|
+
import { EditorProvider, useEditorContext, type EditorView } from './EditorContext';
|
|
11
|
+
import { Toolbar } from './Toolbar';
|
|
12
|
+
import { StatusBar } from './StatusBar';
|
|
13
|
+
import { RawEditor } from './RawEditor';
|
|
14
|
+
import { WysiwygEditor } from './WysiwygEditor';
|
|
15
|
+
import { PreviewPanel } from './PreviewPanel';
|
|
16
|
+
|
|
17
|
+
export type { EditorTheme } from './EditorContext';
|
|
18
|
+
|
|
19
|
+
export interface EditorShellProps {
|
|
20
|
+
/** Initial markdown content */
|
|
21
|
+
initialMarkdown?: string;
|
|
22
|
+
/** Initial active view */
|
|
23
|
+
/** Initial active view (default: 'wysiwyg') */
|
|
24
|
+
initialView?: EditorView;
|
|
25
|
+
/** Article ID for Doc generation */
|
|
26
|
+
articleId?: string;
|
|
27
|
+
/** Base path for media URLs in preview */
|
|
28
|
+
basePath?: string;
|
|
29
|
+
/** Called when markdown source changes */
|
|
30
|
+
onChange?: (source: string) => void;
|
|
31
|
+
/** Color theme: 'light' or 'dark' (default: 'light') */
|
|
32
|
+
theme?: 'light' | 'dark';
|
|
33
|
+
/** Additional class name */
|
|
34
|
+
className?: string;
|
|
35
|
+
/** CSS height for the shell container (default: '100vh') */
|
|
36
|
+
height?: string;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Complete markdown editor shell with toolbar, view switcher, and three
|
|
41
|
+
* editing modes: Raw (Monaco), WYSIWYG (Tiptap), and Preview.
|
|
42
|
+
*/
|
|
43
|
+
export function EditorShell({
|
|
44
|
+
initialMarkdown = '',
|
|
45
|
+
initialView = 'wysiwyg',
|
|
46
|
+
articleId = 'untitled',
|
|
47
|
+
basePath = '/',
|
|
48
|
+
onChange,
|
|
49
|
+
theme = 'light',
|
|
50
|
+
className,
|
|
51
|
+
height = '100vh',
|
|
52
|
+
}: EditorShellProps) {
|
|
53
|
+
return (
|
|
54
|
+
<EditorProvider
|
|
55
|
+
initialMarkdown={initialMarkdown}
|
|
56
|
+
initialView={initialView}
|
|
57
|
+
articleId={articleId}
|
|
58
|
+
theme={theme}
|
|
59
|
+
>
|
|
60
|
+
<EditorShellInner
|
|
61
|
+
basePath={basePath}
|
|
62
|
+
onChange={onChange}
|
|
63
|
+
className={className}
|
|
64
|
+
height={height}
|
|
65
|
+
/>
|
|
66
|
+
</EditorProvider>
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
interface EditorShellInnerProps {
|
|
71
|
+
basePath: string;
|
|
72
|
+
onChange?: (source: string) => void;
|
|
73
|
+
className?: string;
|
|
74
|
+
height: string;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function EditorShellInner({ basePath, onChange, className, height }: EditorShellInnerProps) {
|
|
78
|
+
const { activeView, markdownSource, theme } = useEditorContext();
|
|
79
|
+
|
|
80
|
+
// Notify parent of changes
|
|
81
|
+
useEffect(() => {
|
|
82
|
+
onChange?.(markdownSource);
|
|
83
|
+
}, [markdownSource, onChange]);
|
|
84
|
+
|
|
85
|
+
// Keyboard shortcuts for view switching
|
|
86
|
+
useEffect(() => {
|
|
87
|
+
const handler = (e: KeyboardEvent) => {
|
|
88
|
+
if (e.ctrlKey || e.metaKey) {
|
|
89
|
+
switch (e.key) {
|
|
90
|
+
case '1':
|
|
91
|
+
e.preventDefault();
|
|
92
|
+
document.querySelector<HTMLButtonElement>('[data-view="wysiwyg"]')?.click();
|
|
93
|
+
break;
|
|
94
|
+
case '2':
|
|
95
|
+
e.preventDefault();
|
|
96
|
+
document.querySelector<HTMLButtonElement>('[data-view="raw"]')?.click();
|
|
97
|
+
break;
|
|
98
|
+
case '3':
|
|
99
|
+
e.preventDefault();
|
|
100
|
+
document.querySelector<HTMLButtonElement>('[data-view="preview"]')?.click();
|
|
101
|
+
break;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
window.addEventListener('keydown', handler);
|
|
106
|
+
return () => window.removeEventListener('keydown', handler);
|
|
107
|
+
}, []);
|
|
108
|
+
|
|
109
|
+
return (
|
|
110
|
+
<div
|
|
111
|
+
className={`squisq-editor-shell ${className || ''}`}
|
|
112
|
+
data-theme={theme}
|
|
113
|
+
style={{
|
|
114
|
+
display: 'flex',
|
|
115
|
+
flexDirection: 'column',
|
|
116
|
+
height,
|
|
117
|
+
overflow: 'hidden',
|
|
118
|
+
}}
|
|
119
|
+
>
|
|
120
|
+
{/* Header: Toolbar (includes view tabs) */}
|
|
121
|
+
<div className="squisq-editor-header">
|
|
122
|
+
<Toolbar />
|
|
123
|
+
</div>
|
|
124
|
+
|
|
125
|
+
{/* Main content area */}
|
|
126
|
+
<div
|
|
127
|
+
className="squisq-editor-content"
|
|
128
|
+
style={{ flex: 1, overflow: 'hidden', position: 'relative' }}
|
|
129
|
+
>
|
|
130
|
+
{activeView === 'raw' && <RawEditor theme={theme === 'dark' ? 'vs-dark' : 'vs'} />}
|
|
131
|
+
{activeView === 'wysiwyg' && <WysiwygEditor />}
|
|
132
|
+
{activeView === 'preview' && <PreviewPanel basePath={basePath} />}
|
|
133
|
+
</div>
|
|
134
|
+
|
|
135
|
+
{/* Status bar */}
|
|
136
|
+
<StatusBar />
|
|
137
|
+
</div>
|
|
138
|
+
);
|
|
139
|
+
}
|