Skip to content

Commit 356b738

Browse files
authored
Merge pull request #3 from md2docx/upgrade
Upgrade
2 parents b8bf366 + 97bb9d1 commit 356b738

File tree

11 files changed

+113
-45
lines changed

11 files changed

+113
-45
lines changed

.changeset/sweet-oranges-wish.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@m2d/html": patch
3+
---
4+
5+
Upgrade core package to v1

examples/nextjs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"start": "next start"
1313
},
1414
"dependencies": {
15-
"@m2d/core": "^0.0.5",
15+
"@m2d/core": "^1.0.1",
1616
"@m2d/emoji": "^0.1.1",
1717
"@m2d/html": "workspace:*",
1818
"@repo/shared": "workspace:*",

examples/vite/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"lint:fix": "eslint src/ --fix"
1313
},
1414
"dependencies": {
15-
"@m2d/core": "^0.0.5",
15+
"@m2d/core": "^1.0.1",
1616
"@m2d/emoji": "^0.1.1",
1717
"@m2d/html": "workspace:*",
1818
"@repo/shared": "workspace:*",

lib/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
"vitest": "^3.1.3"
5353
},
5454
"dependencies": {
55-
"@m2d/core": "^0.0.5"
55+
"@m2d/core": "^1.0.1"
5656
},
5757
"peerDependencies": {
5858
"docx": "^9.3.0"

lib/src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,6 @@ const processInlineDOMNode = (el: Node, isPre = false): PhrasingContent => {
289289
case "svg":
290290
return {
291291
type: "svg",
292-
id: `s${crypto.randomUUID()}`,
293292
value: el.outerHTML,
294293
data,
295294
};
@@ -456,6 +455,7 @@ const processDOMNode = (el: HTMLElement | SVGElement): BlockContent => {
456455
return { type: "paragraph", children: [processInlineDOMNode(el)], data };
457456
};
458457

458+
/** process inline AST nodes */
459459
const processInlineNode = (node: HtmlNode) => {
460460
const value = node.value?.trim() ?? "";
461461
const tag = value.split(" ")[0].slice(1);
@@ -523,6 +523,7 @@ const preprocess = (pNode: Parent, isRoot = true) => {
523523
*
524524
* @returns Configured HTML plugin for MDAST parsing.
525525
*/
526+
// @ts-expect-error -- we are not using the definitions
526527
export const htmlPlugin: () => IPlugin = () => {
527528
return {
528529
preprocess,

packages/shared/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"vitest": "^3.1.3"
4141
},
4242
"dependencies": {
43-
"@m2d/core": "^0.0.5",
43+
"@m2d/core": "^1.0.1",
4444
"@m2d/emoji": "^0.1.1",
4545
"@m2d/html": "workspace:*",
4646
"@mayank1513/fork-me": "^2.1.3",
@@ -54,6 +54,7 @@
5454
"react18-loaders": "^1.1.4",
5555
"remark-gfm": "^4.0.1",
5656
"remark-parse": "^11.0.0",
57+
"typingfx": "^1.1.1",
5758
"unified": "^11.0.5",
5859
"unist-util-remove-position": "^5.0.0"
5960
}

packages/shared/src/client/demo/demo.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ export function Demo() {
3131
mdast,
3232
{},
3333
{
34+
// @ts-expect-error -- migration WIP
3435
plugins: [htmlPlugin(), tablePlugin(), imagePlugin()],
3536
},
3637
).then(blob => {

packages/shared/src/global.scss

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
@import "@mayank1513/fork-me/index.css";
2+
@import "typingfx/dist/index.css";
23

34
* {
45
box-sizing: border-box;
@@ -8,9 +9,9 @@
89
:root {
910
--max-width: 1100px;
1011
--border-radius: 12px;
11-
--font-mono: ui-monospace, Menlo, Monaco, "Cascadia Mono", "Segoe UI Mono", "Roboto Mono",
12-
"Oxygen Mono", "Ubuntu Monospace", "Source Code Pro", "Fira Mono", "Droid Sans Mono",
13-
"Courier New", monospace;
12+
--font-mono:
13+
ui-monospace, Menlo, Monaco, "Cascadia Mono", "Segoe UI Mono", "Roboto Mono", "Oxygen Mono",
14+
"Ubuntu Monospace", "Source Code Pro", "Fira Mono", "Droid Sans Mono", "Courier New", monospace;
1415
--tile-border: conic-gradient(#f008, #f004, #f003, #f002, #f001, #f001, #f001);
1516

1617
--callout-rgb: 238, 240, 241;

packages/shared/src/server/landing-page/landing-page.tsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { Cards } from "../cards";
44
import { Logo } from "../logo";
55
import featured from "@repo/scripts/featured.json";
66
import rebrandingConfig from "@repo/scripts/rebrand.config.json";
7+
import { TypeOut } from "typingfx";
78

89
interface LandingPageProps {
910
title: string;
@@ -41,9 +42,14 @@ export function LandingPage({ title, children }: LandingPageProps) {
4142
<main className={styles.main}>
4243
<h1 className={styles.title}>{title}</h1>
4344
<div className={[styles.center, styles.hero].join(" ")}>
44-
<h2>Craft your next amazing library using</h2>
45-
<Logo href={`https://github.com/${owner}/${repo}`} />
46-
<strong>Harness the full potential of React 18 Server Components!</strong>
45+
<TypeOut
46+
componentAnimation={{ wrapper: "div", props: { style: { margin: "auto" } } }}
47+
force>
48+
<h2>Craft your next amazing library using</h2>
49+
<Logo href={`https://github.com/${owner}/${repo}`} />
50+
<br />
51+
<strong>Harness the full potential of React 18 Server Components!{3000}</strong>
52+
</TypeOut>
4753
</div>
4854
{children}
4955
<div className={styles.featured}>

packages/shared/src/server/logo/logo.tsx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { FC, HTMLProps } from "react";
22
import styles from "./logo.module.scss";
33
import rebrandingConfig from "@repo/scripts/rebrand.config.json";
44

5-
const { repo } = rebrandingConfig;
5+
const { packageName } = rebrandingConfig;
66

77
export interface LogoProps {
88
href?: string;
@@ -16,14 +16,19 @@ export interface LogoProps {
1616
export function Logo({ href, linkComponent }: LogoProps) {
1717
if (href?.startsWith("http"))
1818
return (
19-
<a href={href} target="_blank" rel="noopener noreferrer" className={styles.logo}>
20-
<span>{repo}</span>
19+
<a
20+
href={href}
21+
target="_blank"
22+
rel="noopener noreferrer"
23+
className={styles.logo}
24+
data-tfx="component">
25+
<span>{packageName}</span>
2126
</a>
2227
);
2328
const Link = (linkComponent || "a") as FC<{ to?: string } & HTMLProps<HTMLAnchorElement>>;
2429
return (
2530
<Link href={href ?? "/"} to={href ?? "/"} rel="noopener noreferrer" className={styles.logo}>
26-
<span>{repo}</span>
31+
<span>{packageName}</span>
2732
</Link>
2833
);
2934
}

0 commit comments

Comments
 (0)