tiptap-markdown-react 1.3.3 → 1.4.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/{ReportContent-Bc5q1bYp.js → ReportContent-B0HdrWAi.js} +13 -13
- package/dist/{ReportContent-Bc5q1bYp.js.map → ReportContent-B0HdrWAi.js.map} +1 -1
- package/dist/{ReportContentWithCharts-BOskBjBI.js → ReportContentWithCharts-3cn7_5Tz.js} +2 -2
- package/dist/{ReportContentWithCharts-BOskBjBI.js.map → ReportContentWithCharts-3cn7_5Tz.js.map} +1 -1
- package/dist/demoContent.test.d.ts +1 -0
- package/dist/{extractToc-DiI2437D.js → extractToc-Bz924Nh4.js} +239 -4
- package/dist/{extractToc-DiI2437D.js.map → extractToc-Bz924Nh4.js.map} +1 -1
- package/dist/fontSizeHeading.test.d.ts +1 -0
- package/dist/highlightMarkdown.test.d.ts +1 -0
- package/dist/index.js +84 -63
- package/dist/index.js.map +1 -1
- package/dist/markOrder.test.d.ts +1 -0
- package/dist/reader.js +2 -2
- package/dist/server.js +33 -7
- package/dist/server.js.map +1 -1
- package/dist/style-inline.css +479 -445
- package/dist/style.css +479 -445
- package/dist/textStyleServer.test.d.ts +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { Markdown, MarkdownManager } from "@tiptap/markdown";
|
|
3
|
-
import { g as getLocaleBundle, S as SearchIcon, d as ChevronUpIcon, e as ChevronDownIcon, X as XIcon, h as ReplaceIcon, i as ReplaceAllIcon, j as renderOrUpdateChart, k as destroyChart, l as CheckIcon, T as TrashIcon, n as CopyIcon, o as ChevronsUpDownIcon, G as GripIcon, E as EraserIcon, D as DownloadIcon, u as useIsMobile, K as KeyboardIcon, p as EditorToc, I as ImagePreviewHost, q as sameTocItems$1, A as AlignRightIcon, t as AlignCenterIcon, v as AlignLeftIcon, w as CropIcon, x as CaptionsIcon, y as ExpandIcon, z as requestImagePreview, B as RotateCcwIcon, F as ExternalLinkIcon, H as TableDeleteIcon, J as ColumnBeforeIcon, L as ColumnAfterIcon, M as ColumnDeleteIcon, N as RowBeforeIcon, O as RowAfterIcon, P as RowDeleteIcon, U as UndoIcon, Q as RedoIcon, V as BoldIcon, W as ItalicIcon, Y as UnderlineIcon, Z as StrikethroughIcon, _ as CodeIcon, $ as LinkIcon, a0 as ImageIcon, a1 as DetailsIcon, a2 as AlignJustifyIcon, a3 as IndentIncreaseIcon, a4 as IndentDecreaseIcon, a5 as LineHeightIcon, a6 as ListUnorderedIcon, a7 as ListOrderedIcon, a8 as ListChecksIcon } from "./ReportContentWithCharts-
|
|
4
|
-
import { C, a9, aa, a, ab, ac, ad, ae, b, c, af, ag, ah, f, m, r, s } from "./ReportContentWithCharts-
|
|
3
|
+
import { g as getLocaleBundle, S as SearchIcon, d as ChevronUpIcon, e as ChevronDownIcon, X as XIcon, h as ReplaceIcon, i as ReplaceAllIcon, j as renderOrUpdateChart, k as destroyChart, l as CheckIcon, T as TrashIcon, n as CopyIcon, o as ChevronsUpDownIcon, G as GripIcon, E as EraserIcon, D as DownloadIcon, u as useIsMobile, K as KeyboardIcon, p as EditorToc, I as ImagePreviewHost, q as sameTocItems$1, A as AlignRightIcon, t as AlignCenterIcon, v as AlignLeftIcon, w as CropIcon, x as CaptionsIcon, y as ExpandIcon, z as requestImagePreview, B as RotateCcwIcon, F as ExternalLinkIcon, H as TableDeleteIcon, J as ColumnBeforeIcon, L as ColumnAfterIcon, M as ColumnDeleteIcon, N as RowBeforeIcon, O as RowAfterIcon, P as RowDeleteIcon, U as UndoIcon, Q as RedoIcon, V as BoldIcon, W as ItalicIcon, Y as UnderlineIcon, Z as StrikethroughIcon, _ as CodeIcon, $ as LinkIcon, a0 as ImageIcon, a1 as DetailsIcon, a2 as AlignJustifyIcon, a3 as IndentIncreaseIcon, a4 as IndentDecreaseIcon, a5 as LineHeightIcon, a6 as ListUnorderedIcon, a7 as ListOrderedIcon, a8 as ListChecksIcon } from "./ReportContentWithCharts-3cn7_5Tz.js";
|
|
4
|
+
import { C, a9, aa, a, ab, ac, ad, ae, b, c, af, ag, ah, f, m, r, s } from "./ReportContentWithCharts-3cn7_5Tz.js";
|
|
5
5
|
import { jsx, jsxs, Fragment as Fragment$2 } from "react/jsx-runtime";
|
|
6
6
|
import CodeBlockLowlight from "@tiptap/extension-code-block-lowlight";
|
|
7
7
|
import FindAndReplace, { FindAndReplacePluginKey, createSearchRegex } from "@tiptap/extension-find-and-replace";
|
|
@@ -14,10 +14,10 @@ import { NodeViewWrapper, ReactNodeViewRenderer, useEditorState, ReactRenderer,
|
|
|
14
14
|
import { Extension, Node as Node$1, mergeAttributes } from "@tiptap/core";
|
|
15
15
|
import { createPortal } from "react-dom";
|
|
16
16
|
import { useState, useEffect, useCallback, useRef, useMemo, useSyncExternalStore, useLayoutEffect, forwardRef, useId, useImperativeHandle, Fragment as Fragment$1, useContext, createContext } from "react";
|
|
17
|
-
import { q as normalizeImageAlign, l as normalizeImageCrop, m as cropImageBox, e as enrichMarkdownCitations, o as styles$e, i as imageMarkdownTokenizer, c as imageParseMarkdown, d as imageRenderMarkdown, f as imageNodeHtml, g as imageFigureParseRule, h as imageCropAttribute, j as imageCaptionAttribute, k as imageAlignAttribute, r as normalizeImageCaption } from "./ReportContent-
|
|
18
|
-
import { R, a as a2, b as b2, s as s2 } from "./ReportContent-
|
|
19
|
-
import { C as CitationRef, i as mergeCommentIntervals, h as mapCommentAnchors, p as prepareChartMarkdown, j as reportChart, f as CommentMark, b as baseExtensions, l as lowlight, m as makeTocGetId, k as parseCodeTokenAsChartOrCodeBlock, a as pureCodeBlock, c as pureImage, n as renderMathInto, o as readCurrentNumberingFormat, q as subscribeMathClick, t as applyNumberingFormat, N as NUMBERING_FORMAT_IDS, u as NUMBERING_FORMAT_LABELS, v as NUMBERING_FORMAT_PREVIEWS, d as pureChart } from "./extractToc-
|
|
20
|
-
import { P, g, e, s as s3 } from "./extractToc-
|
|
17
|
+
import { q as normalizeImageAlign, l as normalizeImageCrop, m as cropImageBox, e as enrichMarkdownCitations, o as styles$e, i as imageMarkdownTokenizer, c as imageParseMarkdown, d as imageRenderMarkdown, f as imageNodeHtml, g as imageFigureParseRule, h as imageCropAttribute, j as imageCaptionAttribute, k as imageAlignAttribute, r as normalizeImageCaption } from "./ReportContent-B0HdrWAi.js";
|
|
18
|
+
import { R, a as a2, b as b2, s as s2 } from "./ReportContent-B0HdrWAi.js";
|
|
19
|
+
import { C as CitationRef, i as mergeCommentIntervals, h as mapCommentAnchors, p as prepareChartMarkdown, j as reportChart, f as CommentMark, b as baseExtensions, l as lowlight, m as makeTocGetId, k as parseCodeTokenAsChartOrCodeBlock, a as pureCodeBlock, c as pureImage, n as renderMathInto, o as readCurrentNumberingFormat, q as subscribeMathClick, t as applyNumberingFormat, N as NUMBERING_FORMAT_IDS, u as NUMBERING_FORMAT_LABELS, v as NUMBERING_FORMAT_PREVIEWS, d as pureChart } from "./extractToc-Bz924Nh4.js";
|
|
20
|
+
import { P, g, e, s as s3 } from "./extractToc-Bz924Nh4.js";
|
|
21
21
|
import { Slice, Fragment } from "@tiptap/pm/model";
|
|
22
22
|
import { PluginKey, Plugin, Selection, TextSelection, NodeSelection } from "@tiptap/pm/state";
|
|
23
23
|
import { DecorationSet, Decoration } from "@tiptap/pm/view";
|
|
@@ -4292,57 +4292,61 @@ function splitTopLevelBlocks(markdown) {
|
|
|
4292
4292
|
function stripToPlainText(markdown) {
|
|
4293
4293
|
return markdown.replace(/!\[[^\]]*\]\([^)]+\)/g, "").replace(/\[([^\]]+)\]\([^)]+\)/g, "$1").replace(/^#{1,6}\s+/gm, "").replace(/^[ \t]*[-*+]\s+/gm, "").replace(/^[ \t]*\d+\.\s+/gm, "").replace(/[*_~`]+/g, "").replace(/<[^>]+>/g, "").replace(/\|/g, " ").replace(/\s+/g, " ").trim();
|
|
4294
4294
|
}
|
|
4295
|
-
const toolbar = "
|
|
4296
|
-
const inner = "
|
|
4297
|
-
const btn$2 = "
|
|
4298
|
-
const btnActive$1 = "
|
|
4299
|
-
const txtIcon = "
|
|
4300
|
-
const colorIcon = "
|
|
4301
|
-
const colorIconGlyph = "
|
|
4302
|
-
const colorIconBar = "
|
|
4303
|
-
const scriptTrigger = "
|
|
4304
|
-
const scriptTriggerGlyph = "
|
|
4305
|
-
const divider$2 = "
|
|
4306
|
-
const styleTrigger = "
|
|
4307
|
-
const styleTriggerLabel = "
|
|
4308
|
-
const
|
|
4309
|
-
const
|
|
4310
|
-
const
|
|
4311
|
-
const
|
|
4312
|
-
const
|
|
4313
|
-
const
|
|
4314
|
-
const
|
|
4315
|
-
const
|
|
4316
|
-
const
|
|
4317
|
-
const
|
|
4318
|
-
const
|
|
4319
|
-
const
|
|
4320
|
-
const
|
|
4321
|
-
const
|
|
4322
|
-
const
|
|
4323
|
-
const
|
|
4324
|
-
const
|
|
4325
|
-
const
|
|
4326
|
-
const
|
|
4327
|
-
const
|
|
4328
|
-
const
|
|
4329
|
-
const
|
|
4330
|
-
const
|
|
4331
|
-
const
|
|
4332
|
-
const
|
|
4333
|
-
const
|
|
4334
|
-
const
|
|
4335
|
-
const
|
|
4336
|
-
const
|
|
4337
|
-
const
|
|
4338
|
-
const
|
|
4339
|
-
const
|
|
4340
|
-
const
|
|
4341
|
-
const
|
|
4342
|
-
const
|
|
4343
|
-
const
|
|
4344
|
-
const
|
|
4345
|
-
const
|
|
4295
|
+
const toolbar = "_toolbar_1vr0x_2";
|
|
4296
|
+
const inner = "_inner_1vr0x_15";
|
|
4297
|
+
const btn$2 = "_btn_1vr0x_35";
|
|
4298
|
+
const btnActive$1 = "_btnActive_1vr0x_58";
|
|
4299
|
+
const txtIcon = "_txtIcon_1vr0x_74";
|
|
4300
|
+
const colorIcon = "_colorIcon_1vr0x_82";
|
|
4301
|
+
const colorIconGlyph = "_colorIconGlyph_1vr0x_90";
|
|
4302
|
+
const colorIconBar = "_colorIconBar_1vr0x_96";
|
|
4303
|
+
const scriptTrigger = "_scriptTrigger_1vr0x_103";
|
|
4304
|
+
const scriptTriggerGlyph = "_scriptTriggerGlyph_1vr0x_123";
|
|
4305
|
+
const divider$2 = "_divider_1vr0x_131";
|
|
4306
|
+
const styleTrigger = "_styleTrigger_1vr0x_140";
|
|
4307
|
+
const styleTriggerLabel = "_styleTriggerLabel_1vr0x_174";
|
|
4308
|
+
const styleTriggerStable = "_styleTriggerStable_1vr0x_184";
|
|
4309
|
+
const styleTriggerLabelStable = "_styleTriggerLabelStable_1vr0x_188";
|
|
4310
|
+
const styleTriggerSizer = "_styleTriggerSizer_1vr0x_193";
|
|
4311
|
+
const styleTriggerValue = "_styleTriggerValue_1vr0x_194";
|
|
4312
|
+
const styleTriggerCaret = "_styleTriggerCaret_1vr0x_209";
|
|
4313
|
+
const iconTrigger = "_iconTrigger_1vr0x_216";
|
|
4314
|
+
const styleItem = "_styleItem_1vr0x_224";
|
|
4315
|
+
const styleIcon = "_styleIcon_1vr0x_230";
|
|
4316
|
+
const scriptGlyph = "_scriptGlyph_1vr0x_240";
|
|
4317
|
+
const menu = "_menu_1vr0x_252";
|
|
4318
|
+
const menuItem = "_menuItem_1vr0x_263";
|
|
4319
|
+
const menuItemSelected = "_menuItemSelected_1vr0x_290";
|
|
4320
|
+
const listSplit = "_listSplit_1vr0x_305";
|
|
4321
|
+
const listSplitActive = "_listSplitActive_1vr0x_311";
|
|
4322
|
+
const numberingCaret = "_numberingCaret_1vr0x_323";
|
|
4323
|
+
const numberingCaretActive = "_numberingCaretActive_1vr0x_353";
|
|
4324
|
+
const numberingMenu = "_numberingMenu_1vr0x_357";
|
|
4325
|
+
const numberingGrid = "_numberingGrid_1vr0x_367";
|
|
4326
|
+
const numberingOption = "_numberingOption_1vr0x_373";
|
|
4327
|
+
const numberingOptionActive = "_numberingOptionActive_1vr0x_388";
|
|
4328
|
+
const numberingPreview = "_numberingPreview_1vr0x_393";
|
|
4329
|
+
const numberingPreviewRow = "_numberingPreviewRow_1vr0x_399";
|
|
4330
|
+
const numberingPreviewMarker = "_numberingPreviewMarker_1vr0x_414";
|
|
4331
|
+
const numberingPreviewLine = "_numberingPreviewLine_1vr0x_422";
|
|
4332
|
+
const tableInsertCaret = "_tableInsertCaret_1vr0x_428";
|
|
4333
|
+
const tableSizePicker = "_tableSizePicker_1vr0x_436";
|
|
4334
|
+
const tableSizeGrid = "_tableSizeGrid_1vr0x_446";
|
|
4335
|
+
const tableSizeCell = "_tableSizeCell_1vr0x_451";
|
|
4336
|
+
const tableSizeCellActive = "_tableSizeCellActive_1vr0x_461";
|
|
4337
|
+
const tableSizeLabel = "_tableSizeLabel_1vr0x_466";
|
|
4338
|
+
const popoverContent$1 = "_popoverContent_1vr0x_475";
|
|
4339
|
+
const mathLayer = "_mathLayer_1vr0x_479";
|
|
4340
|
+
const mathStack = "_mathStack_1vr0x_484";
|
|
4341
|
+
const mathStackBlock = "_mathStackBlock_1vr0x_491";
|
|
4342
|
+
const mathHint = "_mathHint_1vr0x_496";
|
|
4343
|
+
const mathHintBlock = "_mathHintBlock_1vr0x_508";
|
|
4344
|
+
const mathHintIcon = "_mathHintIcon_1vr0x_514";
|
|
4345
|
+
const mathField = "_mathField_1vr0x_545";
|
|
4346
|
+
const mathFieldBlock = "_mathFieldBlock_1vr0x_557";
|
|
4347
|
+
const mathInput = "_mathInput_1vr0x_564";
|
|
4348
|
+
const mathDone = "_mathDone_1vr0x_582";
|
|
4349
|
+
const mathDoneKbd = "_mathDoneKbd_1vr0x_607";
|
|
4346
4350
|
const styles$6 = {
|
|
4347
4351
|
toolbar,
|
|
4348
4352
|
inner,
|
|
@@ -4357,6 +4361,10 @@ const styles$6 = {
|
|
|
4357
4361
|
divider: divider$2,
|
|
4358
4362
|
styleTrigger,
|
|
4359
4363
|
styleTriggerLabel,
|
|
4364
|
+
styleTriggerStable,
|
|
4365
|
+
styleTriggerLabelStable,
|
|
4366
|
+
styleTriggerSizer,
|
|
4367
|
+
styleTriggerValue,
|
|
4360
4368
|
styleTriggerCaret,
|
|
4361
4369
|
iconTrigger,
|
|
4362
4370
|
styleItem,
|
|
@@ -6668,11 +6676,18 @@ function EditorToolbar({
|
|
|
6668
6676
|
"button",
|
|
6669
6677
|
{
|
|
6670
6678
|
type: "button",
|
|
6671
|
-
className: styles$6.styleTrigger
|
|
6672
|
-
title: t.
|
|
6679
|
+
className: `${styles$6.styleTrigger} ${styles$6.styleTriggerStable}`,
|
|
6680
|
+
title: state.headingLevel ? t.headingLabel(state.headingLevel) : t.normalText,
|
|
6681
|
+
"aria-label": t.style,
|
|
6673
6682
|
onMouseDown: (e2) => e2.preventDefault(),
|
|
6674
6683
|
children: [
|
|
6675
|
-
/* @__PURE__ */
|
|
6684
|
+
/* @__PURE__ */ jsxs("span", { className: `${styles$6.styleTriggerLabel} ${styles$6.styleTriggerLabelStable}`, children: [
|
|
6685
|
+
/* @__PURE__ */ jsxs("span", { className: styles$6.styleTriggerSizer, "aria-hidden": "true", children: [
|
|
6686
|
+
/* @__PURE__ */ jsx("span", { children: t.normalText }),
|
|
6687
|
+
HEADING_LEVELS.map((lv) => /* @__PURE__ */ jsx("span", { children: `H${lv}` }, lv))
|
|
6688
|
+
] }),
|
|
6689
|
+
/* @__PURE__ */ jsx("span", { className: styles$6.styleTriggerValue, children: state.headingLevel ? `H${state.headingLevel}` : t.normalText })
|
|
6690
|
+
] }),
|
|
6676
6691
|
/* @__PURE__ */ jsx(ChevronDownIcon, { size: 12, className: styles$6.styleTriggerCaret })
|
|
6677
6692
|
]
|
|
6678
6693
|
}
|
|
@@ -6711,13 +6726,19 @@ function EditorToolbar({
|
|
|
6711
6726
|
"button",
|
|
6712
6727
|
{
|
|
6713
6728
|
type: "button",
|
|
6714
|
-
className: styles$6.styleTrigger
|
|
6715
|
-
title: t.fontSize,
|
|
6729
|
+
className: `${styles$6.styleTrigger} ${styles$6.styleTriggerStable}`,
|
|
6730
|
+
title: state.fontSize || t.fontSize,
|
|
6716
6731
|
"aria-label": t.fontSize,
|
|
6717
6732
|
disabled: !canEditFontSize,
|
|
6718
6733
|
onMouseDown: (e2) => e2.preventDefault(),
|
|
6719
6734
|
children: [
|
|
6720
|
-
/* @__PURE__ */
|
|
6735
|
+
/* @__PURE__ */ jsxs("span", { className: `${styles$6.styleTriggerLabel} ${styles$6.styleTriggerLabelStable}`, children: [
|
|
6736
|
+
/* @__PURE__ */ jsxs("span", { className: styles$6.styleTriggerSizer, "aria-hidden": "true", children: [
|
|
6737
|
+
/* @__PURE__ */ jsx("span", { children: t.fontSize }),
|
|
6738
|
+
FONT_SIZES.map((size) => /* @__PURE__ */ jsx("span", { children: size }, size))
|
|
6739
|
+
] }),
|
|
6740
|
+
/* @__PURE__ */ jsx("span", { className: styles$6.styleTriggerValue, children: state.fontSize || t.fontSize })
|
|
6741
|
+
] }),
|
|
6721
6742
|
/* @__PURE__ */ jsx(ChevronDownIcon, { size: 12, className: styles$6.styleTriggerCaret })
|
|
6722
6743
|
]
|
|
6723
6744
|
}
|