@codearcade/markdown 1.2.0 → 1.3.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.
@@ -7,12 +7,14 @@ type MarkdownComponentProps = {
7
7
  theme?: Theme;
8
8
  markdownText: string;
9
9
  defaultMarkdownThemeDark?: PrismTheme;
10
+ compact?: boolean;
10
11
  } | {
11
12
  engine: "hljs";
12
13
  defaultMarkdownThemeLight?: HljsTheme;
13
14
  markdownText: string;
14
15
  theme?: Theme;
15
16
  defaultMarkdownThemeDark?: HljsTheme;
17
+ compact?: boolean;
16
18
  };
17
19
  declare const MarkdownComponent: React.FC<MarkdownComponentProps>;
18
20
  export { MarkdownComponent };
package/dist/index.css CHANGED
@@ -179,3 +179,42 @@
179
179
  color: var(--color-foreground, #fff);
180
180
  background-color: #3f3f46;
181
181
  }
182
+
183
+ .compactMode_A8U9fw {
184
+ padding: 0;
185
+ font-size: 13px;
186
+ line-height: 1.5;
187
+ }
188
+
189
+ .compactMode_A8U9fw > * + * {
190
+ margin-top: .25rem;
191
+ }
192
+
193
+ .compactMode_A8U9fw p {
194
+ margin-bottom: 0;
195
+ }
196
+
197
+ .compactMode_A8U9fw h1, .compactMode_A8U9fw h2, .compactMode_A8U9fw h3 {
198
+ margin-top: .5rem;
199
+ margin-bottom: .25rem;
200
+ font-size: 1.1rem;
201
+ line-height: 1.4;
202
+ }
203
+
204
+ .compactMode_A8U9fw h1:first-child, .compactMode_A8U9fw h2:first-child, .compactMode_A8U9fw h3:first-child, .compactMode_A8U9fw p:first-child {
205
+ margin-top: 0;
206
+ }
207
+
208
+ .compactMode_A8U9fw pre {
209
+ margin-top: .5rem;
210
+ margin-bottom: .5rem;
211
+ }
212
+
213
+ .compactMode_A8U9fw ul, .compactMode_A8U9fw ol {
214
+ margin-bottom: .25rem;
215
+ padding-left: 1.25rem;
216
+ }
217
+
218
+ .compactMode_A8U9fw li {
219
+ margin-bottom: 0;
220
+ }
package/dist/index.js CHANGED
@@ -17,7 +17,8 @@ import remarkGfm from "remark-gfm";
17
17
  var markdown_module_default = {
18
18
  markdownBody: "markdownBody_A8U9fw",
19
19
  markdownAction: "markdownAction_A8U9fw",
20
- dark: "dark_A8U9fw"
20
+ dark: "dark_A8U9fw",
21
+ compactMode: "compactMode_A8U9fw"
21
22
  };
22
23
 
23
24
  // src/components/icons.tsx
@@ -96,7 +97,12 @@ var CopyToClipboard = ({ text }) => {
96
97
  }, undefined, true, undefined, this);
97
98
  };
98
99
  var MarkdownComponent = (props) => {
99
- const { markdownText, theme = "light", engine = "prism" } = props;
100
+ const {
101
+ markdownText,
102
+ theme = "light",
103
+ engine = "prism",
104
+ compact = false
105
+ } = props;
100
106
  const [markdownTheme, setMarkdownTheme] = useState();
101
107
  const [Highlighter, setHighlighter] = useState();
102
108
  useEffect(() => {
@@ -135,7 +141,7 @@ var MarkdownComponent = (props) => {
135
141
  };
136
142
  }, [engine, theme]);
137
143
  return /* @__PURE__ */ jsx2("section", {
138
- className: `${markdown_module_default.markdownBody} ${theme}`,
144
+ className: `${markdown_module_default.markdownBody} ${theme} ${compact ? markdown_module_default.compactMode : ""}`,
139
145
  children: /* @__PURE__ */ jsx2(ReactMarkdown, {
140
146
  remarkPlugins: [remarkGfm],
141
147
  components: {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@codearcade/markdown",
3
3
  "type": "module",
4
- "version": "1.2.0",
4
+ "version": "1.3.0",
5
5
  "module": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
7
7
  "license": "MIT",