@shadow-garden/bapbong-docx 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.
- package/LICENSE +21 -0
- package/README.md +36 -0
- package/dist/index.cjs +1837 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1802 -0
- package/dist/lib/docx.d.ts +63 -0
- package/dist/lib/docx.d.ts.map +1 -0
- package/dist/lib/export.d.ts +15 -0
- package/dist/lib/export.d.ts.map +1 -0
- package/dist/lib/numbering.d.ts +13 -0
- package/dist/lib/numbering.d.ts.map +1 -0
- package/dist/lib/ooxml.d.ts +43 -0
- package/dist/lib/ooxml.d.ts.map +1 -0
- package/dist/lib/rels.d.ts +8 -0
- package/dist/lib/rels.d.ts.map +1 -0
- package/dist/lib/styles.d.ts +18 -0
- package/dist/lib/styles.d.ts.map +1 -0
- package/dist/lib/theme.d.ts +5 -0
- package/dist/lib/theme.d.ts.map +1 -0
- package/package.json +66 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import JSZip from 'jszip';
|
|
2
|
+
import { Node as PMNode, Schema } from 'prosemirror-model';
|
|
3
|
+
export type DocxInput = ArrayBuffer | Uint8Array | Blob;
|
|
4
|
+
/**
|
|
5
|
+
* Result of importing a .docx: the ProseMirror document plus the raw
|
|
6
|
+
* `word/document.xml` we parsed it from. The raw string is kept so a later
|
|
7
|
+
* export step can round-trip parts of the document we don't model yet.
|
|
8
|
+
*/
|
|
9
|
+
/** Page geometry in CSS px (structurally a bapbong-contracts PageConfig). */
|
|
10
|
+
export interface PageConfig {
|
|
11
|
+
width: number;
|
|
12
|
+
height: number;
|
|
13
|
+
margin: {
|
|
14
|
+
top: number;
|
|
15
|
+
right: number;
|
|
16
|
+
bottom: number;
|
|
17
|
+
left: number;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
/** A document comment (structurally a bapbong-contracts CommentData). */
|
|
21
|
+
export interface CommentData {
|
|
22
|
+
id: number;
|
|
23
|
+
author: string;
|
|
24
|
+
date: string;
|
|
25
|
+
text: string;
|
|
26
|
+
}
|
|
27
|
+
export interface DocxImport {
|
|
28
|
+
doc: PMNode;
|
|
29
|
+
rawDocumentXml: string;
|
|
30
|
+
/** Header stories keyed by w:type ("default" | "first" | "even"). */
|
|
31
|
+
headers: Record<string, PMNode>;
|
|
32
|
+
/** Footer stories keyed by w:type. */
|
|
33
|
+
footers: Record<string, PMNode>;
|
|
34
|
+
/** Footnote body stories keyed by display number (w:footnoteReference). Laid
|
|
35
|
+
* out at the bottom of the page their reference falls on. Endnotes are NOT
|
|
36
|
+
* here — they're appended to `doc`. */
|
|
37
|
+
footnotes: Record<number, PMNode>;
|
|
38
|
+
/** w:titlePg — page 1 uses the "first" header/footer (headers/footers['first']). */
|
|
39
|
+
titlePg: boolean;
|
|
40
|
+
/** w:evenAndOddHeaders — even pages use the "even" header/footer. */
|
|
41
|
+
evenAndOdd: boolean;
|
|
42
|
+
/** Comments referenced by the body (w:commentRange), in appearance order. */
|
|
43
|
+
comments: CommentData[];
|
|
44
|
+
/** Page size + margins from w:sectPr (A4 @96dpi when unspecified). */
|
|
45
|
+
page: PageConfig;
|
|
46
|
+
/** The loaded source package — pass to `exportDocx(doc, { carry })` so the
|
|
47
|
+
* parts bapbong doesn't model yet (styles, numbering, headers/footers, …)
|
|
48
|
+
* survive the round-trip instead of being dropped. */
|
|
49
|
+
raw: JSZip;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Parse the bytes of a .docx file into a bapbong ProseMirror document.
|
|
53
|
+
*
|
|
54
|
+
* Scope so far: paragraphs, tables (col/row spans), text runs with the
|
|
55
|
+
* run-property cascade resolved to bold/italic/underline/strike/color/size/font
|
|
56
|
+
* marks, flat list paragraphs with multilevel numbering, hyperlinks (link mark),
|
|
57
|
+
* and inline images (data-URL). Headers/footers, theme colors, and export are
|
|
58
|
+
* later milestones; unmodeled XML is preserved on `rawDocumentXml`.
|
|
59
|
+
*/
|
|
60
|
+
export declare function importDocx(input: DocxInput, opts?: {
|
|
61
|
+
schema?: Schema;
|
|
62
|
+
}): Promise<DocxImport>;
|
|
63
|
+
//# sourceMappingURL=docx.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"docx.d.ts","sourceRoot":"","sources":["../../src/lib/docx.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,IAAI,MAAM,EAAQ,MAAM,EAAE,MAAM,mBAAmB,CAAC;AA4BjE,MAAM,MAAM,SAAS,GAAG,WAAW,GAAG,UAAU,GAAG,IAAI,CAAC;AAExD;;;;GAIG;AACH,6EAA6E;AAC7E,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;CACtE;AAED,yEAAyE;AACzE,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAqBD,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,cAAc,EAAE,MAAM,CAAC;IACvB,qEAAqE;IACrE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,sCAAsC;IACtC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC;;4CAEwC;IACxC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAClC,oFAAoF;IACpF,OAAO,EAAE,OAAO,CAAC;IACjB,qEAAqE;IACrE,UAAU,EAAE,OAAO,CAAC;IACpB,6EAA6E;IAC7E,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,sEAAsE;IACtE,IAAI,EAAE,UAAU,CAAC;IACjB;;2DAEuD;IACvD,GAAG,EAAE,KAAK,CAAC;CACZ;AA2xCD;;;;;;;;GAQG;AACH,wBAAsB,UAAU,CAC9B,KAAK,EAAE,SAAS,EAChB,IAAI,CAAC,EAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,GACzB,OAAO,CAAC,UAAU,CAAC,CAkGrB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import JSZip from 'jszip';
|
|
2
|
+
import type { Node as PMNode } from 'prosemirror-model';
|
|
3
|
+
/**
|
|
4
|
+
* Serialise a bapbong document back to `.docx` bytes.
|
|
5
|
+
*
|
|
6
|
+
* With `opts.carry` (the source package from `importDocx().raw`) the original
|
|
7
|
+
* parts bapbong doesn't model yet — styles, numbering, headers/footers,
|
|
8
|
+
* footnotes, settings, theme, media — are preserved; only document.xml and the
|
|
9
|
+
* comment parts are regenerated. Without it, a minimal package is built from
|
|
10
|
+
* scratch (E1–E3 content only).
|
|
11
|
+
*/
|
|
12
|
+
export declare function exportDocx(doc: PMNode, opts?: {
|
|
13
|
+
carry?: JSZip;
|
|
14
|
+
}): Promise<Uint8Array>;
|
|
15
|
+
//# sourceMappingURL=export.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"export.d.ts","sourceRoot":"","sources":["../../src/lib/export.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAQ,IAAI,IAAI,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAsf9D;;;;;;;;GAQG;AACH,wBAAsB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE;IAAE,KAAK,CAAC,EAAE,KAAK,CAAA;CAAE,GAAG,OAAO,CAAC,UAAU,CAAC,CAkE3F"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { NumberingDefs } from '@shadow-garden/bapbong-model';
|
|
2
|
+
import { OoxmlNode } from './ooxml.js';
|
|
3
|
+
/** Parsed view of `word/numbering.xml`. Markers are NOT computed at import —
|
|
4
|
+
* the defs ride the document (doc attr) and the layout engine recounts them
|
|
5
|
+
* every pass, so edits renumber live. */
|
|
6
|
+
export interface NumberingResolver {
|
|
7
|
+
/** Plain-data definitions for the doc node's `numbering` attr. */
|
|
8
|
+
defs: NumberingDefs | null;
|
|
9
|
+
/** The lvl's paragraph properties (indent layer in the pPr cascade). */
|
|
10
|
+
levelPPr(numId: string, level: number): OoxmlNode | undefined;
|
|
11
|
+
}
|
|
12
|
+
export declare function buildNumbering(numberingRoot: OoxmlNode | undefined): NumberingResolver;
|
|
13
|
+
//# sourceMappingURL=numbering.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"numbering.d.ts","sourceRoot":"","sources":["../../src/lib/numbering.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAA2B,SAAS,EAAE,MAAM,YAAY,CAAC;AAEhE;;0CAE0C;AAC1C,MAAM,WAAW,iBAAiB;IAChC,kEAAkE;IAClE,IAAI,EAAE,aAAa,GAAG,IAAI,CAAC;IAC3B,wEAAwE;IACxE,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAAC;CAC/D;AAED,wBAAgB,cAAc,CAAC,aAAa,EAAE,SAAS,GAAG,SAAS,GAAG,iBAAiB,CAkDtF"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A normalized OOXML element. We parse with `preserveOrder: true` (so the
|
|
3
|
+
* document's block order — paragraphs vs tables — is faithful) and flatten the
|
|
4
|
+
* verbose fast-xml-parser shape into this simple tree: ordered `children`,
|
|
5
|
+
* attribute map (without the `@_` prefix), and concatenated `text`.
|
|
6
|
+
*/
|
|
7
|
+
export interface OoxmlNode {
|
|
8
|
+
name: string;
|
|
9
|
+
attrs: Record<string, string>;
|
|
10
|
+
children: OoxmlNode[];
|
|
11
|
+
text: string;
|
|
12
|
+
}
|
|
13
|
+
/** Parse an OOXML part into a synthetic `#root` node holding the top-level elements. */
|
|
14
|
+
export declare function parseXml(xml: string): OoxmlNode;
|
|
15
|
+
/** First child element with the given tag name. */
|
|
16
|
+
export declare function child(node: OoxmlNode | undefined, name: string): OoxmlNode | undefined;
|
|
17
|
+
/** All child elements with the given tag name (in document order). */
|
|
18
|
+
export declare function children(node: OoxmlNode | undefined, name: string): OoxmlNode[];
|
|
19
|
+
/** An attribute value (name without the `@_`/`w:` mangling, e.g. "w:val"). */
|
|
20
|
+
export declare function attrOf(node: OoxmlNode | undefined, name: string): string | undefined;
|
|
21
|
+
/** Depth-first search for the first descendant with the given tag name. */
|
|
22
|
+
export declare function findDescendant(node: OoxmlNode | undefined, name: string): OoxmlNode | undefined;
|
|
23
|
+
/** Normalized run (character) properties, independent of the OOXML shape. */
|
|
24
|
+
export interface RunProps {
|
|
25
|
+
bold?: boolean;
|
|
26
|
+
italic?: boolean;
|
|
27
|
+
underline?: boolean;
|
|
28
|
+
strike?: boolean;
|
|
29
|
+
color?: string;
|
|
30
|
+
sizePt?: number;
|
|
31
|
+
fontFamily?: string;
|
|
32
|
+
highlight?: string;
|
|
33
|
+
vertAlign?: 'super' | 'sub';
|
|
34
|
+
}
|
|
35
|
+
/** Normalize an OOXML hex color ("FF0000" or "#ff0000") to "#FF0000". */
|
|
36
|
+
export declare function normalizeHex(v: string | undefined): string | undefined;
|
|
37
|
+
/** Resolve a `w:themeColor` (+ optional tint/shade) to "#RRGGBB". */
|
|
38
|
+
export type ThemeColorResolver = (themeColor: string, tint?: string, shade?: string) => string | undefined;
|
|
39
|
+
/** Parse a `w:rPr` element into normalized run properties (only present keys). */
|
|
40
|
+
export declare function parseRunProps(rPr: OoxmlNode | undefined, resolveTheme?: ThemeColorResolver): RunProps;
|
|
41
|
+
/** Merge run properties; defined keys in `over` win over `base`. */
|
|
42
|
+
export declare function mergeRunProps(base: RunProps, over: RunProps): RunProps;
|
|
43
|
+
//# sourceMappingURL=ooxml.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ooxml.d.ts","sourceRoot":"","sources":["../../src/lib/ooxml.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9B,QAAQ,EAAE,SAAS,EAAE,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;CACd;AAuCD,wFAAwF;AACxF,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAS/C;AAED,mDAAmD;AACnD,wBAAgB,KAAK,CAAC,IAAI,EAAE,SAAS,GAAG,SAAS,EAAE,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAEtF;AAED,sEAAsE;AACtE,wBAAgB,QAAQ,CAAC,IAAI,EAAE,SAAS,GAAG,SAAS,EAAE,IAAI,EAAE,MAAM,GAAG,SAAS,EAAE,CAE/E;AAED,8EAA8E;AAC9E,wBAAgB,MAAM,CAAC,IAAI,EAAE,SAAS,GAAG,SAAS,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAEpF;AAED,2EAA2E;AAC3E,wBAAgB,cAAc,CAAC,IAAI,EAAE,SAAS,GAAG,SAAS,EAAE,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAQ/F;AAmBD,6EAA6E;AAC7E,MAAM,WAAW,QAAQ;IACvB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,GAAG,KAAK,CAAC;CAC7B;AAWD,yEAAyE;AACzE,wBAAgB,YAAY,CAAC,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAGtE;AAED,qEAAqE;AACrE,MAAM,MAAM,kBAAkB,GAAG,CAC/B,UAAU,EAAE,MAAM,EAClB,IAAI,CAAC,EAAE,MAAM,EACb,KAAK,CAAC,EAAE,MAAM,KACX,MAAM,GAAG,SAAS,CAAC;AAExB,kFAAkF;AAClF,wBAAgB,aAAa,CAC3B,GAAG,EAAE,SAAS,GAAG,SAAS,EAC1B,YAAY,CAAC,EAAE,kBAAkB,GAChC,QAAQ,CAqDV;AAED,oEAAoE;AACpE,wBAAgB,aAAa,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,GAAG,QAAQ,CAEtE"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { OoxmlNode } from './ooxml.js';
|
|
2
|
+
export interface Relationship {
|
|
3
|
+
target: string;
|
|
4
|
+
external: boolean;
|
|
5
|
+
}
|
|
6
|
+
/** Parse a `_rels/*.rels` part into a map of relationship id → target. */
|
|
7
|
+
export declare function buildRels(root: OoxmlNode | undefined): Map<string, Relationship>;
|
|
8
|
+
//# sourceMappingURL=rels.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rels.d.ts","sourceRoot":"","sources":["../../src/lib/rels.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2B,SAAS,EAAE,MAAM,YAAY,CAAC;AAEhE,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,0EAA0E;AAC1E,wBAAgB,SAAS,CAAC,IAAI,EAAE,SAAS,GAAG,SAAS,GAAG,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,CAUhF"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { OoxmlNode, RunProps, ThemeColorResolver } from './ooxml.js';
|
|
2
|
+
/** Resolved view of `word/styles.xml`: document defaults plus named styles,
|
|
3
|
+
* with `w:basedOn` inheritance flattened on demand. */
|
|
4
|
+
export interface StyleRegistry {
|
|
5
|
+
/** docDefaults → rPrDefault, the lowest layer of the run cascade. */
|
|
6
|
+
docDefaults: RunProps;
|
|
7
|
+
/** docDefaults → pPrDefault, the lowest layer of the paragraph cascade. */
|
|
8
|
+
docDefaultsPPr: OoxmlNode | undefined;
|
|
9
|
+
/** Effective run properties contributed by a styleId (incl. basedOn chain). */
|
|
10
|
+
resolveStyle(styleId: string | undefined): RunProps;
|
|
11
|
+
/** The styleId's w:pPr nodes, base-most first (basedOn ancestors → style).
|
|
12
|
+
* Callers append the inline pPr and resolve "later wins" per property. */
|
|
13
|
+
resolveStylePPr(styleId: string | undefined): OoxmlNode[];
|
|
14
|
+
/** The most-derived w:tblBorders a table style (chain) contributes, if any. */
|
|
15
|
+
resolveTableBorders(styleId: string | undefined): OoxmlNode | undefined;
|
|
16
|
+
}
|
|
17
|
+
export declare function buildStyleRegistry(stylesRoot: OoxmlNode | undefined, resolveTheme?: ThemeColorResolver): StyleRegistry;
|
|
18
|
+
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/lib/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,SAAS,EAET,QAAQ,EACR,kBAAkB,EACnB,MAAM,YAAY,CAAC;AAUpB;wDACwD;AACxD,MAAM,WAAW,aAAa;IAC5B,qEAAqE;IACrE,WAAW,EAAE,QAAQ,CAAC;IACtB,2EAA2E;IAC3E,cAAc,EAAE,SAAS,GAAG,SAAS,CAAC;IACtC,+EAA+E;IAC/E,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,QAAQ,CAAC;IACpD;+EAC2E;IAC3E,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,EAAE,CAAC;IAC1D,+EAA+E;IAC/E,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,CAAC;CACzE;AAID,wBAAgB,kBAAkB,CAChC,UAAU,EAAE,SAAS,GAAG,SAAS,EACjC,YAAY,CAAC,EAAE,kBAAkB,GAChC,aAAa,CAoDf"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { OoxmlNode } from './ooxml.js';
|
|
2
|
+
/** Resolve an OOXML `w:themeColor` (+ optional tint/shade hex) to "#RRGGBB". */
|
|
3
|
+
export type ThemeResolver = (themeColor: string, tint?: string, shade?: string) => string | undefined;
|
|
4
|
+
export declare function buildThemeResolver(themeRoot: OoxmlNode | undefined): ThemeResolver;
|
|
5
|
+
//# sourceMappingURL=theme.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/lib/theme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiC,SAAS,EAAE,MAAM,YAAY,CAAC;AAEtE,gFAAgF;AAChF,MAAM,MAAM,aAAa,GAAG,CAC1B,UAAU,EAAE,MAAM,EAClB,IAAI,CAAC,EAAE,MAAM,EACb,KAAK,CAAC,EAAE,MAAM,KACX,MAAM,GAAG,SAAS,CAAC;AAmDxB,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,SAAS,GAAG,SAAS,GAAG,aAAa,CAgBlF"}
|
package/package.json
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@shadow-garden/bapbong-docx",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "bapbong — DOCX (OOXML) import / export",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/shadowgarden-app/bapbong.git",
|
|
9
|
+
"directory": "packages/docx"
|
|
10
|
+
},
|
|
11
|
+
"type": "module",
|
|
12
|
+
"main": "./dist/index.cjs",
|
|
13
|
+
"module": "./dist/index.js",
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"exports": {
|
|
16
|
+
"./package.json": "./package.json",
|
|
17
|
+
".": {
|
|
18
|
+
"@shadow-garden/source": "./src/index.ts",
|
|
19
|
+
"types": "./dist/index.d.ts",
|
|
20
|
+
"import": "./dist/index.js",
|
|
21
|
+
"require": "./dist/index.cjs",
|
|
22
|
+
"default": "./dist/index.js"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"files": [
|
|
26
|
+
"dist",
|
|
27
|
+
"!**/*.tsbuildinfo"
|
|
28
|
+
],
|
|
29
|
+
"publishConfig": {
|
|
30
|
+
"access": "public"
|
|
31
|
+
},
|
|
32
|
+
"nx": {
|
|
33
|
+
"tags": [
|
|
34
|
+
"scope:io"
|
|
35
|
+
],
|
|
36
|
+
"targets": {
|
|
37
|
+
"build": {
|
|
38
|
+
"executor": "@nx/esbuild:esbuild",
|
|
39
|
+
"outputs": [
|
|
40
|
+
"{options.outputPath}"
|
|
41
|
+
],
|
|
42
|
+
"options": {
|
|
43
|
+
"outputPath": "packages/docx/dist",
|
|
44
|
+
"main": "packages/docx/src/index.ts",
|
|
45
|
+
"tsConfig": "packages/docx/tsconfig.lib.json",
|
|
46
|
+
"format": [
|
|
47
|
+
"esm",
|
|
48
|
+
"cjs"
|
|
49
|
+
],
|
|
50
|
+
"declarationRootDir": "packages/docx/src",
|
|
51
|
+
"generatePackageJson": false,
|
|
52
|
+
"external": [
|
|
53
|
+
"@shadow-garden/bapbong-model"
|
|
54
|
+
]
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
"dependencies": {
|
|
60
|
+
"fast-xml-parser": "^5.8.0",
|
|
61
|
+
"jszip": "^3.10.1",
|
|
62
|
+
"prosemirror-model": "^1.25.7",
|
|
63
|
+
"@shadow-garden/bapbong-model": "^0.1.0",
|
|
64
|
+
"@shadow-garden/bapbong-contracts": "^0.1.0"
|
|
65
|
+
}
|
|
66
|
+
}
|