@noirmd/previewer 1.0.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.
@@ -0,0 +1,29 @@
1
+ import React from 'react';
2
+ import { ReactCodeMirrorProps } from '@uiw/react-codemirror';
3
+
4
+ type EditorMode = 'editor' | 'split' | 'preview';
5
+ interface NReditorProps extends ReactCodeMirrorProps {
6
+ value: string;
7
+ onChange: (value: string) => void;
8
+ className?: string;
9
+ /** Debounce delay in ms for preview rendering. Default: 300 */
10
+ debounceMs?: number;
11
+ /** Inject Tailwind v4 browser CDN for preview. Default: false */
12
+ tailwindCDN?: boolean;
13
+ }
14
+ /**
15
+ * NReditor — CodeMirror 6 editor with live markdown preview.
16
+ * Drop-in component that works inside any container.
17
+ *
18
+ * @example
19
+ * ```tsx
20
+ * import NReditor from '@noirmd/previewer/editor';
21
+ * import '@noirmd/previewer/markdown.css';
22
+ *
23
+ * <NReditor value={md} onChange={setMd} />
24
+ * <NReditor value={md} onChange={setMd} tailwindCDN />
25
+ * ```
26
+ */
27
+ declare const NReditor: React.FC<NReditorProps>;
28
+
29
+ export { type EditorMode, NReditor as default };
@@ -0,0 +1,29 @@
1
+ import React from 'react';
2
+ import { ReactCodeMirrorProps } from '@uiw/react-codemirror';
3
+
4
+ type EditorMode = 'editor' | 'split' | 'preview';
5
+ interface NReditorProps extends ReactCodeMirrorProps {
6
+ value: string;
7
+ onChange: (value: string) => void;
8
+ className?: string;
9
+ /** Debounce delay in ms for preview rendering. Default: 300 */
10
+ debounceMs?: number;
11
+ /** Inject Tailwind v4 browser CDN for preview. Default: false */
12
+ tailwindCDN?: boolean;
13
+ }
14
+ /**
15
+ * NReditor — CodeMirror 6 editor with live markdown preview.
16
+ * Drop-in component that works inside any container.
17
+ *
18
+ * @example
19
+ * ```tsx
20
+ * import NReditor from '@noirmd/previewer/editor';
21
+ * import '@noirmd/previewer/markdown.css';
22
+ *
23
+ * <NReditor value={md} onChange={setMd} />
24
+ * <NReditor value={md} onChange={setMd} tailwindCDN />
25
+ * ```
26
+ */
27
+ declare const NReditor: React.FC<NReditorProps>;
28
+
29
+ export { type EditorMode, NReditor as default };