mdast2docx 0.0.0 → 0.1.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.
@@ -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-UXY5TDOP.mjs";import{a as o,b as r,c as e}from"../chunk-XIRSNIMN.mjs";import{a as p,b as t}from"../chunk-TASCVLMX.mjs";import"../chunk-YKZOUIFR.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 +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("@mayank1513/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-TASCVLMX.mjs";import"../chunk-YKZOUIFR.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 "@mayank1513/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;