@soroush.tech/markdown 1.2.3-rc.1 → 1.2.3-rc.2
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/{LiveEdit-CaMZLJCs.mjs → LiveEdit-BVkUqJd5.mjs} +1 -1
- package/dist/{LiveEdit-CbRkmd43.cjs → LiveEdit-Chb8D-NA.cjs} +1 -1
- package/dist/LiveEdit.cjs +1 -1
- package/dist/LiveEdit.mjs +1 -1
- package/dist/{Preview-BFyaPHjw.mjs → Preview-B95_mk1s.mjs} +14 -7
- package/dist/{Preview-CnMWUtU2.cjs → Preview-BSieDKBE.cjs} +15 -7
- package/dist/Preview.cjs +1 -1
- package/dist/Preview.mjs +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.mjs +2 -2
- package/package.json +3 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MarkdownContext } from "./MarkdownContext.mjs";
|
|
2
|
-
import { t as Preview } from "./Preview-
|
|
2
|
+
import { t as Preview } from "./Preview-B95_mk1s.mjs";
|
|
3
3
|
import { useContext, useRef, useState } from "react";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
import { styled } from "@soroush.tech/design-system";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_Preview = require("./Preview-
|
|
1
|
+
const require_Preview = require("./Preview-BSieDKBE.cjs");
|
|
2
2
|
const require_MarkdownContext = require("./MarkdownContext.cjs");
|
|
3
3
|
let react = require("react");
|
|
4
4
|
let react_jsx_runtime = require("react/jsx-runtime");
|
package/dist/LiveEdit.cjs
CHANGED
package/dist/LiveEdit.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as LiveEdit } from "./LiveEdit-
|
|
1
|
+
import { t as LiveEdit } from "./LiveEdit-BVkUqJd5.mjs";
|
|
2
2
|
export { LiveEdit };
|
|
@@ -8,6 +8,7 @@ import { View } from "@soroush.tech/design-system/View";
|
|
|
8
8
|
import ReactMarkdown from "react-markdown";
|
|
9
9
|
import remarkGfm from "remark-gfm";
|
|
10
10
|
import rehypeHighlight from "rehype-highlight";
|
|
11
|
+
import rehypeSlug from "rehype-slug";
|
|
11
12
|
import { Quote } from "@soroush.tech/design-system/Quote";
|
|
12
13
|
import { Checkbox } from "@soroush.tech/design-system/Checkbox";
|
|
13
14
|
import { Image } from "@soroush.tech/design-system/Image";
|
|
@@ -24,7 +25,7 @@ function isMermaidBlock(children) {
|
|
|
24
25
|
//#endregion
|
|
25
26
|
//#region src/Preview/Preview.tsx
|
|
26
27
|
const remarkPlugins = [remarkGfm];
|
|
27
|
-
const rehypePlugins = [[rehypeHighlight, { ignoreMissing: true }]];
|
|
28
|
+
const rehypePlugins = [rehypeSlug, [rehypeHighlight, { ignoreMissing: true }]];
|
|
28
29
|
const PreviewRoot = styled(View, {
|
|
29
30
|
name: "MarkdownPreview",
|
|
30
31
|
label: "MarkdownPreview"
|
|
@@ -42,7 +43,8 @@ function slotted(render) {
|
|
|
42
43
|
return Slotted;
|
|
43
44
|
}
|
|
44
45
|
const components = {
|
|
45
|
-
h1: slotted(({ h1 }, { children }) => /* @__PURE__ */ jsx(Typography, {
|
|
46
|
+
h1: slotted(({ h1 }, { id, children }) => /* @__PURE__ */ jsx(Typography, {
|
|
47
|
+
id,
|
|
46
48
|
mt: 2,
|
|
47
49
|
variant: "h1",
|
|
48
50
|
color: "primary",
|
|
@@ -50,7 +52,8 @@ const components = {
|
|
|
50
52
|
...h1,
|
|
51
53
|
children
|
|
52
54
|
})),
|
|
53
|
-
h2: slotted(({ h2 }, { children }) => /* @__PURE__ */ jsx(Typography, {
|
|
55
|
+
h2: slotted(({ h2 }, { id, children }) => /* @__PURE__ */ jsx(Typography, {
|
|
56
|
+
id,
|
|
54
57
|
mt: 2,
|
|
55
58
|
variant: "h2",
|
|
56
59
|
color: "primary",
|
|
@@ -58,7 +61,8 @@ const components = {
|
|
|
58
61
|
...h2,
|
|
59
62
|
children
|
|
60
63
|
})),
|
|
61
|
-
h3: slotted(({ h3 }, { children }) => /* @__PURE__ */ jsx(Typography, {
|
|
64
|
+
h3: slotted(({ h3 }, { id, children }) => /* @__PURE__ */ jsx(Typography, {
|
|
65
|
+
id,
|
|
62
66
|
mt: 2,
|
|
63
67
|
variant: "h3",
|
|
64
68
|
color: "primary",
|
|
@@ -66,21 +70,24 @@ const components = {
|
|
|
66
70
|
...h3,
|
|
67
71
|
children
|
|
68
72
|
})),
|
|
69
|
-
h4: slotted(({ h4 }, { children }) => /* @__PURE__ */ jsx(Typography, {
|
|
73
|
+
h4: slotted(({ h4 }, { id, children }) => /* @__PURE__ */ jsx(Typography, {
|
|
74
|
+
id,
|
|
70
75
|
mt: 2,
|
|
71
76
|
variant: "h4",
|
|
72
77
|
gutterBottom: true,
|
|
73
78
|
...h4,
|
|
74
79
|
children
|
|
75
80
|
})),
|
|
76
|
-
h5: slotted(({ h5 }, { children }) => /* @__PURE__ */ jsx(Typography, {
|
|
81
|
+
h5: slotted(({ h5 }, { id, children }) => /* @__PURE__ */ jsx(Typography, {
|
|
82
|
+
id,
|
|
77
83
|
mt: 2,
|
|
78
84
|
variant: "h5",
|
|
79
85
|
gutterBottom: true,
|
|
80
86
|
...h5,
|
|
81
87
|
children
|
|
82
88
|
})),
|
|
83
|
-
h6: slotted(({ h6 }, { children }) => /* @__PURE__ */ jsx(Typography, {
|
|
89
|
+
h6: slotted(({ h6 }, { id, children }) => /* @__PURE__ */ jsx(Typography, {
|
|
90
|
+
id,
|
|
84
91
|
mt: 2,
|
|
85
92
|
variant: "h6",
|
|
86
93
|
gutterBottom: true,
|
|
@@ -33,6 +33,8 @@ let remark_gfm = require("remark-gfm");
|
|
|
33
33
|
remark_gfm = __toESM(remark_gfm, 1);
|
|
34
34
|
let rehype_highlight = require("rehype-highlight");
|
|
35
35
|
rehype_highlight = __toESM(rehype_highlight, 1);
|
|
36
|
+
let rehype_slug = require("rehype-slug");
|
|
37
|
+
rehype_slug = __toESM(rehype_slug, 1);
|
|
36
38
|
let _soroush_tech_design_system_Quote = require("@soroush.tech/design-system/Quote");
|
|
37
39
|
let _soroush_tech_design_system_Checkbox = require("@soroush.tech/design-system/Checkbox");
|
|
38
40
|
let _soroush_tech_design_system_Image = require("@soroush.tech/design-system/Image");
|
|
@@ -49,7 +51,7 @@ function isMermaidBlock(children) {
|
|
|
49
51
|
//#endregion
|
|
50
52
|
//#region src/Preview/Preview.tsx
|
|
51
53
|
const remarkPlugins = [remark_gfm.default];
|
|
52
|
-
const rehypePlugins = [[rehype_highlight.default, { ignoreMissing: true }]];
|
|
54
|
+
const rehypePlugins = [rehype_slug.default, [rehype_highlight.default, { ignoreMissing: true }]];
|
|
53
55
|
const PreviewRoot = (0, _soroush_tech_design_system.styled)(_soroush_tech_design_system_View.View, {
|
|
54
56
|
name: "MarkdownPreview",
|
|
55
57
|
label: "MarkdownPreview"
|
|
@@ -67,7 +69,8 @@ function slotted(render) {
|
|
|
67
69
|
return Slotted;
|
|
68
70
|
}
|
|
69
71
|
const components = {
|
|
70
|
-
h1: slotted(({ h1 }, { children }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_soroush_tech_design_system_Typography.Typography, {
|
|
72
|
+
h1: slotted(({ h1 }, { id, children }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_soroush_tech_design_system_Typography.Typography, {
|
|
73
|
+
id,
|
|
71
74
|
mt: 2,
|
|
72
75
|
variant: "h1",
|
|
73
76
|
color: "primary",
|
|
@@ -75,7 +78,8 @@ const components = {
|
|
|
75
78
|
...h1,
|
|
76
79
|
children
|
|
77
80
|
})),
|
|
78
|
-
h2: slotted(({ h2 }, { children }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_soroush_tech_design_system_Typography.Typography, {
|
|
81
|
+
h2: slotted(({ h2 }, { id, children }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_soroush_tech_design_system_Typography.Typography, {
|
|
82
|
+
id,
|
|
79
83
|
mt: 2,
|
|
80
84
|
variant: "h2",
|
|
81
85
|
color: "primary",
|
|
@@ -83,7 +87,8 @@ const components = {
|
|
|
83
87
|
...h2,
|
|
84
88
|
children
|
|
85
89
|
})),
|
|
86
|
-
h3: slotted(({ h3 }, { children }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_soroush_tech_design_system_Typography.Typography, {
|
|
90
|
+
h3: slotted(({ h3 }, { id, children }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_soroush_tech_design_system_Typography.Typography, {
|
|
91
|
+
id,
|
|
87
92
|
mt: 2,
|
|
88
93
|
variant: "h3",
|
|
89
94
|
color: "primary",
|
|
@@ -91,21 +96,24 @@ const components = {
|
|
|
91
96
|
...h3,
|
|
92
97
|
children
|
|
93
98
|
})),
|
|
94
|
-
h4: slotted(({ h4 }, { children }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_soroush_tech_design_system_Typography.Typography, {
|
|
99
|
+
h4: slotted(({ h4 }, { id, children }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_soroush_tech_design_system_Typography.Typography, {
|
|
100
|
+
id,
|
|
95
101
|
mt: 2,
|
|
96
102
|
variant: "h4",
|
|
97
103
|
gutterBottom: true,
|
|
98
104
|
...h4,
|
|
99
105
|
children
|
|
100
106
|
})),
|
|
101
|
-
h5: slotted(({ h5 }, { children }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_soroush_tech_design_system_Typography.Typography, {
|
|
107
|
+
h5: slotted(({ h5 }, { id, children }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_soroush_tech_design_system_Typography.Typography, {
|
|
108
|
+
id,
|
|
102
109
|
mt: 2,
|
|
103
110
|
variant: "h5",
|
|
104
111
|
gutterBottom: true,
|
|
105
112
|
...h5,
|
|
106
113
|
children
|
|
107
114
|
})),
|
|
108
|
-
h6: slotted(({ h6 }, { children }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_soroush_tech_design_system_Typography.Typography, {
|
|
115
|
+
h6: slotted(({ h6 }, { id, children }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_soroush_tech_design_system_Typography.Typography, {
|
|
116
|
+
id,
|
|
109
117
|
mt: 2,
|
|
110
118
|
variant: "h6",
|
|
111
119
|
gutterBottom: true,
|
package/dist/Preview.cjs
CHANGED
package/dist/Preview.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as Preview } from "./Preview-
|
|
1
|
+
import { t as Preview } from "./Preview-B95_mk1s.mjs";
|
|
2
2
|
export { Preview };
|
package/dist/index.cjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_Preview = require("./Preview-
|
|
2
|
+
const require_Preview = require("./Preview-BSieDKBE.cjs");
|
|
3
3
|
const require_MarkdownContext = require("./MarkdownContext.cjs");
|
|
4
4
|
const require_Control = require("./Control.cjs");
|
|
5
5
|
const require_Toolbar = require("./Toolbar-BlMahuVU.cjs");
|
|
6
6
|
const require_Editor = require("./Editor.cjs");
|
|
7
7
|
const require_CodeBlock = require("./CodeBlock-Cymx1ZAY.cjs");
|
|
8
8
|
const require_Mermaid = require("./Mermaid-CkUan4z-.cjs");
|
|
9
|
-
const require_LiveEdit = require("./LiveEdit-
|
|
9
|
+
const require_LiveEdit = require("./LiveEdit-Chb8D-NA.cjs");
|
|
10
10
|
exports.CodeBlock = require_CodeBlock.CodeBlock;
|
|
11
11
|
exports.Control = require_Control.Control;
|
|
12
12
|
exports.Editor = require_Editor.Editor;
|
package/dist/index.mjs
CHANGED
|
@@ -4,6 +4,6 @@ import { n as TablePicker, t as Toolbar } from "./Toolbar-zDEkBuqy.mjs";
|
|
|
4
4
|
import { Editor } from "./Editor.mjs";
|
|
5
5
|
import { n as syntaxLight, r as CodeBlock, t as syntaxDark } from "./CodeBlock-CVlrvVPP.mjs";
|
|
6
6
|
import { t as Mermaid } from "./Mermaid-B7vDwGQG.mjs";
|
|
7
|
-
import { t as Preview } from "./Preview-
|
|
8
|
-
import { t as LiveEdit } from "./LiveEdit-
|
|
7
|
+
import { t as Preview } from "./Preview-B95_mk1s.mjs";
|
|
8
|
+
import { t as LiveEdit } from "./LiveEdit-BVkUqJd5.mjs";
|
|
9
9
|
export { CodeBlock, Control, Editor, LiveEdit, MarkdownContext, Mermaid, Preview, TablePicker, Toolbar, syntaxDark, syntaxLight, useMarkdownContext };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@soroush.tech/markdown",
|
|
3
|
-
"version": "1.2.3-rc.
|
|
3
|
+
"version": "1.2.3-rc.2",
|
|
4
4
|
"description": "Headless, composable markdown editor + renderer for @soroush.tech/design-system - Control, Toolbar, Editor, and Preview built on react-markdown, remark-gfm, and rehype-highlight.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"markdown",
|
|
@@ -60,6 +60,7 @@
|
|
|
60
60
|
"rehype-highlight": "^7.0.2",
|
|
61
61
|
"rehype-parse": "^9.0.1",
|
|
62
62
|
"rehype-remark": "^10.0.1",
|
|
63
|
+
"rehype-slug": "^6.0.0",
|
|
63
64
|
"remark-gfm": "^4.0.1",
|
|
64
65
|
"remark-stringify": "^11.0.0",
|
|
65
66
|
"unified": "^11.0.5"
|
|
@@ -85,7 +86,7 @@
|
|
|
85
86
|
"tsdown": "^0.22.14",
|
|
86
87
|
"typescript": "~7.0.2",
|
|
87
88
|
"vitest": "^4.1.10",
|
|
88
|
-
"@soroush.tech/design-system": "2.0.0-rc.
|
|
89
|
+
"@soroush.tech/design-system": "2.0.0-rc.2",
|
|
89
90
|
"@soroush.tech/eslint-config": "0.0.0",
|
|
90
91
|
"@soroush.tech/hooks": "0.1.0"
|
|
91
92
|
},
|