mdast2docx 0.0.0 → 0.1.1

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.
Files changed (47) hide show
  1. package/dist/chunk-3ZZBJC3M.mjs +1 -0
  2. package/dist/chunk-7LR5HC5O.mjs +4 -0
  3. package/dist/chunk-7W4N3GRD.mjs +75 -0
  4. package/dist/chunk-AHXJDPOO.mjs +2 -0
  5. package/dist/chunk-D4MVNKG6.mjs +1 -0
  6. package/dist/chunk-IBVI6OKS.mjs +1 -0
  7. package/dist/chunk-Q6Q2NBIZ.mjs +1 -0
  8. package/dist/chunk-XIRSNIMN.mjs +1 -0
  9. package/dist/chunk-Z5DPYROV.mjs +31 -0
  10. package/dist/chunk-ZKNVKZAF.mjs +1 -0
  11. package/dist/index.d.ts +1 -1
  12. package/dist/index.js +2 -2
  13. package/dist/index.mjs +1 -1
  14. package/dist/multipart-parser-WKN2UV32.mjs +2 -0
  15. package/dist/plugins/image.d.ts +20 -12
  16. package/dist/plugins/image.js +1 -1
  17. package/dist/plugins/image.mjs +1 -1
  18. package/dist/plugins/index.js +75 -1
  19. package/dist/plugins/index.mjs +1 -1
  20. package/dist/plugins/list.d.ts +1 -1
  21. package/dist/plugins/list.js +1 -1
  22. package/dist/plugins/list.mjs +1 -1
  23. package/dist/plugins/math.d.ts +6 -0
  24. package/dist/plugins/math.js +75 -1
  25. package/dist/plugins/math.mjs +1 -1
  26. package/dist/plugins/node-image.d.ts +27 -0
  27. package/dist/plugins/node-image.js +35 -0
  28. package/dist/plugins/node-image.mjs +1 -0
  29. package/dist/plugins/node.d.ts +1 -0
  30. package/dist/plugins/node.js +35 -0
  31. package/dist/plugins/node.mjs +1 -0
  32. package/dist/plugins/table.d.ts +1 -1
  33. package/dist/plugins/table.js +1 -1
  34. package/dist/plugins/table.mjs +1 -1
  35. package/dist/section.d.ts +3 -3
  36. package/dist/section.js +2 -2
  37. package/dist/section.mjs +1 -1
  38. package/dist/utils.d.ts +4 -4
  39. package/dist/utils.js +1 -1
  40. package/dist/utils.mjs +1 -1
  41. package/package.json +7 -3
  42. package/dist/chunk-KPLOM3EF.mjs +0 -2
  43. package/dist/chunk-RFHTB4AU.mjs +0 -1
  44. package/dist/chunk-TASCVLMX.mjs +0 -1
  45. package/dist/chunk-UXY5TDOP.mjs +0 -1
  46. package/dist/chunk-XY2A2A66.mjs +0 -1
  47. package/dist/chunk-YKZOUIFR.mjs +0 -1
@@ -1 +1 @@
1
- import{a as e,b as f}from"../chunk-UXY5TDOP.mjs";import{a as o,b as r}from"../chunk-XY2A2A66.mjs";import{a as m,b as p}from"../chunk-TASCVLMX.mjs";import"../chunk-YKZOUIFR.mjs";import{a as t}from"../chunk-RFHTB4AU.mjs";export{m as createLevels,e as defaultTableOptions,o as getImageMimeType,r as imagePlugin,p as listPlugin,t as mathPlugin,f as tablePlugin};
1
+ import{a as f,b as m}from"../chunk-Q6Q2NBIZ.mjs";import{a as o,b as r,c as e}from"../chunk-XIRSNIMN.mjs";import{a as p,b as t}from"../chunk-D4MVNKG6.mjs";import"../chunk-IBVI6OKS.mjs";import{a as x,b as a}from"../chunk-7W4N3GRD.mjs";import"../chunk-ZKNVKZAF.mjs";import"../chunk-3ZZBJC3M.mjs";export{o as SUPPORTED_IMAGE_TYPES,p as createLevels,f as defaultTableOptions,r as getImageMimeType,e as imagePlugin,t as listPlugin,a as mathPlugin,x as parseLatex,m as tablePlugin};
@@ -1,4 +1,4 @@
1
- import { ILevelsOptions, LevelFormat } from "@mayank1513/docx";
1
+ import { ILevelsOptions, LevelFormat } from "docx";
2
2
  import { IPlugin, Optional } from "../utils";
3
3
  /**
4
4
  * Default options for the list plugin.
@@ -1 +1 @@
1
- "use strict";var f=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var O=Object.getOwnPropertyNames;var b=Object.prototype.hasOwnProperty;var D=(o,t)=>{for(var i in t)f(o,i,{get:t[i],enumerable:!0})},R=(o,t,i,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of O(t))!b.call(o,n)&&n!==i&&f(o,n,{get:()=>t[n],enumerable:!(r=m(t,n))||r.enumerable});return o};var h=o=>R(f({},"__esModule",{value:!0}),o);var k={};D(k,{createLevels:()=>I,listPlugin:()=>v});module.exports=h(k);var e=require("@mayank1513/docx");var x=()=>Math.random().toString(16).slice(2);var C=[e.LevelFormat.DECIMAL,e.LevelFormat.DECIMAL,e.LevelFormat.DECIMAL,e.LevelFormat.DECIMAL,e.LevelFormat.UPPER_LETTER,e.LevelFormat.LOWER_LETTER,e.LevelFormat.LOWER_ROMAN,e.LevelFormat.UPPER_ROMAN],I=(o,t=.4,i=.25)=>o.map((r,n)=>({level:n,format:r,text:(r===e.LevelFormat.DECIMAL?Array(n+1).fill(`%${n+1}`).join("."):`%${n+1}`)+".",alignment:e.AlignmentType.START,style:{paragraph:{indent:{left:(0,e.convertInchesToTwip)(t+n*i)}}}})),M=I(C),L=["\u25CF","\u25CB","\u25A0","\u25C6","\u25B6","\u25C9","\u2B24","\u2666","\u25E6","\u25AA"],E={levels:M,bullets:L,defaultBullets:!1},v=o=>{let t=x(),i=`numbering-${t}`,r=`bullet-${t}`,{levels:n,bulletLevels:c,bullets:y,defaultBullets:T}={...E,...o};return{block:async(u,s,l,d)=>{var p,P;if(s.type!=="list")return[];let a=((P=(p=l.bullet)==null?void 0:p.level)!=null?P:-1)+1;return l.numbering=T?void 0:{level:a,reference:s.ordered?i:r},l.bullet={level:a},s.type="",await d(s,l)},root:u=>{var s,l;u.numbering={config:[...(l=(s=u.numbering)==null?void 0:s.config)!=null?l:[],{reference:i,levels:n},{reference:r,levels:c!=null?c:n.map((d,a)=>{var p;return{...d,text:(p=y[a])!=null?p:"\u2022",format:e.LevelFormat.BULLET}})}]}}}};0&&(module.exports={createLevels,listPlugin});
1
+ "use strict";var f=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var O=Object.getOwnPropertyNames;var D=Object.prototype.hasOwnProperty;var b=(o,t)=>{for(var i in t)f(o,i,{get:t[i],enumerable:!0})},h=(o,t,i,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of O(t))!D.call(o,n)&&n!==i&&f(o,n,{get:()=>t[n],enumerable:!(r=m(t,n))||r.enumerable});return o};var C=o=>h(f({},"__esModule",{value:!0}),o);var k={};b(k,{createLevels:()=>I,listPlugin:()=>v});module.exports=C(k);var e=require("docx");var x=()=>Math.random().toString(16).slice(2);var R=[e.LevelFormat.DECIMAL,e.LevelFormat.DECIMAL,e.LevelFormat.DECIMAL,e.LevelFormat.DECIMAL,e.LevelFormat.UPPER_LETTER,e.LevelFormat.LOWER_LETTER,e.LevelFormat.LOWER_ROMAN,e.LevelFormat.UPPER_ROMAN],I=(o,t=.4,i=.25)=>o.map((r,n)=>({level:n,format:r,text:(r===e.LevelFormat.DECIMAL?Array(n+1).fill(`%${n+1}`).join("."):`%${n+1}`)+".",alignment:e.AlignmentType.START,style:{paragraph:{indent:{left:(0,e.convertInchesToTwip)(t+n*i)}}}})),M=I(R),L=["\u25CF","\u25CB","\u25A0","\u25C6","\u25B6","\u25C9","\u2B24","\u2666","\u25E6","\u25AA"],E={levels:M,bullets:L,defaultBullets:!1},v=o=>{let t=x(),i=`numbering-${t}`,r=`bullet-${t}`,{levels:n,bulletLevels:c,bullets:y,defaultBullets:T}={...E,...o};return{block:async(u,s,l,d)=>{var p,P;if(s.type!=="list")return[];let a=((P=(p=l.bullet)==null?void 0:p.level)!=null?P:-1)+1;return l.numbering=T?void 0:{level:a,reference:s.ordered?i:r},l.bullet={level:a},s.type="",await d(s,l)},root:u=>{var s,l;u.numbering={config:[...(l=(s=u.numbering)==null?void 0:s.config)!=null?l:[],{reference:i,levels:n},{reference:r,levels:c!=null?c:n.map((d,a)=>{var p;return{...d,text:(p=y[a])!=null?p:"\u2022",format:e.LevelFormat.BULLET}})}]}}}};0&&(module.exports={createLevels,listPlugin});
@@ -1 +1 @@
1
- import{a,b}from"../chunk-TASCVLMX.mjs";import"../chunk-YKZOUIFR.mjs";export{a as createLevels,b as listPlugin};
1
+ import{a,b}from"../chunk-D4MVNKG6.mjs";import"../chunk-IBVI6OKS.mjs";import"../chunk-3ZZBJC3M.mjs";export{a as createLevels,b as listPlugin};
@@ -1,4 +1,10 @@
1
1
  import { IPlugin } from "../utils";
2
+ import * as DOCX from "docx";
3
+ /** Parse latex and convert to DOCX MathRun nodes */
4
+ export declare const parseLatex: (docx: typeof DOCX, value: string) => DOCX.MathRun[][];
5
+ /**
6
+ * Math Plugin
7
+ */
2
8
  export declare const mathPlugin: () => IPlugin<{
3
9
  type: "" | "math" | "inlineMath";
4
10
  value?: string;