mdast2docx 0.0.0-beta.0 → 0.0.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/utils.mjs CHANGED
@@ -1 +1 @@
1
- import{c as a,d as b,l as c,m as d,n as e}from"./chunk-O6BHSWEF.mjs";export{b as convertInchesToTwip,a as convertMillimetersToTwip,e as defaultProps,c as getDefinitions,d as getImageMimeType};
1
+ import{a,b,c,d,e,f}from"./chunk-YKZOUIFR.mjs";export{e as convertInchesToTwip,f as convertMillimetersToTwip,d as defaultProps,a as getDefinitions,b as getTextContent,c as uuid};
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "mdast2docx",
3
3
  "author": "Mayank Kumar Chaudhari <https://mayank-chaudhari.vercel.app>",
4
4
  "private": false,
5
- "version": "0.0.0-beta.0",
5
+ "version": "0.0.0",
6
6
  "description": "Convert Markdown Abstract Syntax Tree (MDAST) to DOCX seamlessly. Supports footnotes, images, links, and customizable document properties.",
7
7
  "license": "MPL-2.0",
8
8
  "main": "./dist/index.js",
@@ -25,22 +25,14 @@
25
25
  "test": "vitest run --coverage"
26
26
  },
27
27
  "devDependencies": {
28
- "@mayank1513/docx": "^9.2.0",
29
28
  "@repo/eslint-config": "workspace:*",
30
29
  "@repo/typescript-config": "workspace:*",
31
30
  "@testing-library/react": "^16.2.0",
32
31
  "@types/mdast": "^4.0.4",
33
32
  "@types/node": "^22.13.10",
34
- "@types/react": "^19.0.10",
35
- "@types/react-dom": "^19.0.4",
36
- "@vitejs/plugin-react": "^4.3.4",
37
33
  "@vitest/coverage-v8": "^3.0.8",
38
34
  "esbuild-plugin-rdi": "^0.0.0",
39
- "esbuild-plugin-react18": "0.2.6",
40
- "esbuild-plugin-react18-css": "^0.0.4",
41
35
  "jsdom": "^26.0.0",
42
- "react": "^19.0.0",
43
- "react-dom": "^19.0.0",
44
36
  "remark-gfm": "^4.0.1",
45
37
  "remark-parse": "^11.0.0",
46
38
  "tsup": "^8.4.0",
@@ -50,17 +42,7 @@
50
42
  "vitest": "^3.0.8"
51
43
  },
52
44
  "dependencies": {
53
- "r18gs": "^3.0.1"
54
- },
55
- "peerDependencies": {
56
- "@types/react": ">=16.8",
57
- "next": ">=10",
58
- "react": ">=16.8"
59
- },
60
- "peerDependenciesMeta": {
61
- "next": {
62
- "optional": true
63
- }
45
+ "@mayank1513/docx": "^9.2.0"
64
46
  },
65
47
  "funding": [
66
48
  {
@@ -1,2 +0,0 @@
1
- import{a as w,b as p,e as f,f as k,g as I,h as y,j as g,n as R}from"./chunk-O6BHSWEF.mjs";var b=(h,m,u)=>{let d=async(t,i)=>{var r,o,s;let n=new Set(i),c={bold:i.has("strong"),italics:i.has("emphasis"),strike:i.has("delete")},a=(o=t.url)!=null?o:h[(r=t.identifier)==null?void 0:r.toUpperCase()],e=(s=t.alt)!=null?s:a==null?void 0:a.split("/").pop();switch(t.type){case"text":return[new p({text:t.value,...c})];case"break":return[new p({break:1})];case"inlineCode":return[new p({text:t.value,...c,style:"code"})];case"emphasis":case"strong":case"delete":return n.add(t.type),l(t,n);case"link":case"linkReference":return n.add("link"),[a.startsWith("#")?new k({anchor:a,children:await l(t,n)}):new I({link:a,children:await l(t,n)})];case"image":case"imageReference":return[new f({...await u(a),altText:{description:e,name:e,title:e}})];case"footnoteReference":return[new g(m[t.identifier].id)];default:return[new p("")]}},l=async(t,i=new Set)=>{var n;return(await Promise.all((n=t.children)==null?void 0:n.map(c=>d(c,i)))).flat()};return l},S=async(h,m,u,d)=>{let{imageResolver:l,useTitle:t,...i}={...R,...d},n=b(m,u,l),c=async(e,r)=>{let o=[...r],s={};switch(r.includes("list")&&(s.bullet={level:r.filter(P=>P==="list").length-1}),r.includes("blockquote")&&(s.style="Quote"),e.type){case"paragraph":return[new y({...s,children:await n(e)})];case"heading":return[new y({heading:t?e.depth===1?"Title":`Heading${e.depth-1}`:`Heading${e.depth}`,children:await n(e)})];case"code":return[new y({alignment:"start",style:"blockCode",children:e.value.split(`
2
- `).map(P=>new p({text:P,break:1,style:"code"}))})];case"list":case"blockquote":case"listItem":return o.push(e.type),a(e,o);case"thematicBreak":return[new y({border:{top:{style:w.SINGLE,size:6}}})];case"table":case"tableRow":case"tableCell":case"yaml":case"html":default:return console.warn(`Unsupported node type: ${e.type}`,e),[]}},a=async(e,r)=>{var o;return(await Promise.all((o=e.children)==null?void 0:o.map(s=>c(s,r)))).flat()};return{...i,children:await a(h,[])}};export{S as a};