tiptap-markdown-react 1.1.0 → 1.2.1
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/README.md +8 -5
- package/dist/ReportContentWithCharts-BMpzNVsX.js +1353 -0
- package/dist/ReportContentWithCharts-BMpzNVsX.js.map +1 -0
- package/dist/components/ContentOutline.d.ts +10 -0
- package/dist/components/ContentOutline.dom.test.d.ts +1 -0
- package/dist/components/MarkdownPreview.d.ts +7 -2
- package/dist/components/MarkdownPreview.toc.dom.test.d.ts +1 -0
- package/dist/components/MarkdownWysiwygEditor.d.ts +1 -1
- package/dist/components/ReaderReportContent.d.ts +16 -0
- package/dist/components/ReportContentInteractive.d.ts +6 -1
- package/dist/components/ReportContentWithCharts.d.ts +6 -1
- package/dist/index.js +216 -897
- package/dist/index.js.map +1 -1
- package/dist/reader.d.ts +1 -1
- package/dist/reader.js +5 -5
- package/dist/style-inline.css +161 -127
- package/dist/style.css +161 -127
- package/dist/toc/readTocItems.d.ts +4 -0
- package/package.json +1 -1
- package/dist/ReportContentWithCharts-CDwS4OH9.js +0 -496
- package/dist/ReportContentWithCharts-CDwS4OH9.js.map +0 -1
package/README.md
CHANGED
|
@@ -286,7 +286,7 @@ Override any of these CSS variables on an ancestor (e.g. `:root` or the editor c
|
|
|
286
286
|
| `locale` | `'en' \| 'zh'` | Built-in UI language (default `en`). Pass the same value to the toolbar and any other sibling you render. The outline uses the editor's locale. |
|
|
287
287
|
| `placeholder` | `string` | Placeholder for the empty document. |
|
|
288
288
|
| `onEditorReady` | `(editor: Editor \| null) => void` | Get the Tiptap instance (for the toolbar). |
|
|
289
|
-
| `toc` | `boolean` | Built-in outline on the left edge (default `
|
|
289
|
+
| `toc` | `boolean` | Built-in outline on the left edge (default `false`). When on, collapsed ticks expand on hover and click scrolls to the heading. Hidden below 768px and when there are no headings. |
|
|
290
290
|
| `onTocChange` | `(items: TocItem[]) => void` | Optional. Fires when the heading list changes. The editor draws the outline itself. |
|
|
291
291
|
| `markdownPaste` | `boolean` | Auto-detect markdown in plain-text paste and convert it (Shift+paste keeps plain text). Default `true`. Init-only. |
|
|
292
292
|
| `markdownFileDrop` | `boolean` | Drop or paste `.md` / `.markdown` files into the editor to insert their parsed content. Default `true`. Init-only. |
|
|
@@ -538,8 +538,9 @@ The commands are exported for headless or self-drawn UIs: `applyLink`, `removeLi
|
|
|
538
538
|
| Prop | Type | Description |
|
|
539
539
|
| --- | --- | --- |
|
|
540
540
|
| `markdown` | `string` | Markdown to render read-only. |
|
|
541
|
-
| `locale` | `'en' \| 'zh'` | Built-in copy for the read-only code block and
|
|
541
|
+
| `locale` | `'en' \| 'zh'` | Built-in copy for the read-only code block, charts, and outline (default `en`). |
|
|
542
542
|
| `className` | `string` | Class on the container. |
|
|
543
|
+
| `toc` | `boolean` | Built-in left outline (default `false`). Hidden under 768px or when there are no headings. |
|
|
543
544
|
|
|
544
545
|
### `tiptap-markdown-react/server` (RSC-safe)
|
|
545
546
|
|
|
@@ -547,7 +548,7 @@ The commands are exported for headless or self-drawn UIs: `applyLink`, `removeLi
|
|
|
547
548
|
| --- | --- |
|
|
548
549
|
| `renderReportHtml(markdown, options?)` | `{ html, toc, ok }` — markdown → HTML。`includeToc` 默认 true;卡片预览传 false。`stabilize` 给流式半成品补未闭合围栏。解析失败 `ok: false`,不把已有 HTML 吞成空串。 |
|
|
549
550
|
| `stabilizeMarkdown(markdown)` | 给未闭合 ` ``` ` / `~~~` 补闭合。 |
|
|
550
|
-
| `ReportContent` |
|
|
551
|
+
| `ReportContent` | Static HTML shell with editor content styles. No outline. The `./reader` export of the same name draws the left outline. |
|
|
551
552
|
| `extractToc`, `makeTocGetId` | TOC helpers. |
|
|
552
553
|
| `baseExtensions`, `pureCodeBlock`, `pureImage`, `lowlight` | Schema-level extensions. |
|
|
553
554
|
|
|
@@ -555,8 +556,10 @@ The commands are exported for headless or self-drawn UIs: `applyLink`, `removeLi
|
|
|
555
556
|
|
|
556
557
|
| Export | Description |
|
|
557
558
|
| --- | --- |
|
|
558
|
-
| `
|
|
559
|
-
| `
|
|
559
|
+
| `ReportContent` | Static HTML. Pass `toc` for the same left outline as the editor (default off). |
|
|
560
|
+
| `ReportContentInteractive` | `ReportContent` + citation click delegation. Outline stays off unless `toc` is set. |
|
|
561
|
+
| `ReportContentWithCharts` | `ReportContent` + chart hydration. Outline stays off unless `toc` is set. |
|
|
562
|
+
| `CitationInteractive` | Compose your own wrapper around server `ReportContent` when you do not want the outline. |
|
|
560
563
|
| `SourceRef`, citation DOM/types | Footnote helpers. |
|
|
561
564
|
| `extractFootnoteSources(markdown)` | `{ markdown, sources }` — 把 GFM 脚注定义行(`[^n]: …`)抽成 `SourceRef[]` 并从正文剥离;标记那一半交给 enrich / apply。 |
|
|
562
565
|
| `scrollToTocHeading` | Scroll the reading container to a heading. |
|