hwpkit-dev 0.0.3 → 0.0.5
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/ .npmignore +1 -0
- package/README.md +8 -8
- package/dist/index.d.mts +6 -3
- package/dist/index.d.ts +6 -3
- package/dist/index.js +573 -230
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +573 -230
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/decoders/hwp/HwpScanner.ts +174 -57
- package/src/decoders/hwpx/HwpxDecoder.ts +23 -12
- package/src/encoders/docx/DocxEncoder.ts +49 -4
- package/src/encoders/hwp/HwpEncoder.ts +309 -163
- package/src/encoders/hwpx/HwpxEncoder.ts +249 -103
- package/src/model/doc-props.ts +5 -5
- package/src/model/doc-tree.ts +2 -2
- package/test-styling.ts +0 -210
package/ .npmignore
CHANGED
package/README.md
CHANGED
|
@@ -23,14 +23,14 @@
|
|
|
23
23
|
|
|
24
24
|
## 변환 지원 현황
|
|
25
25
|
|
|
26
|
-
| 입력 \ 출력 | HWPX |
|
|
27
|
-
|
|
28
|
-
| **HWPX** |
|
|
29
|
-
| **HWP** |
|
|
30
|
-
| **DOCX** |
|
|
31
|
-
| **Markdown** |
|
|
32
|
-
|
|
33
|
-
> 한글
|
|
26
|
+
| 입력 \ 출력 | HWPX | HWP | DOCX |
|
|
27
|
+
|------------|:----:|:----:|:------:|
|
|
28
|
+
| **HWPX** | O | X | O |
|
|
29
|
+
| **HWP** | O | X | O |
|
|
30
|
+
| **DOCX** | O | X | O |
|
|
31
|
+
| **Markdown** |O | X | △ |
|
|
32
|
+
|
|
33
|
+
> 한글 2022기준 hwpx는 정상적으로 열림
|
|
34
34
|
---
|
|
35
35
|
|
|
36
36
|
## 설치
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
type Align = 'left' | 'center' | 'right' | 'justify';
|
|
1
|
+
type Align = 'left' | 'center' | 'right' | 'justify' | 'distribute' | 'distribute_space';
|
|
2
2
|
type ImgWrap = 'inline' | 'square' | 'tight' | 'through' | 'none' | 'behind' | 'front' | 'topAndBottom';
|
|
3
3
|
type ImgHorzAlign = 'left' | 'center' | 'right';
|
|
4
4
|
type ImgVertAlign = 'top' | 'center' | 'bottom';
|
|
@@ -38,6 +38,7 @@ interface ParaProps {
|
|
|
38
38
|
align?: Align;
|
|
39
39
|
heading?: Heading;
|
|
40
40
|
styleId?: string;
|
|
41
|
+
hwpStyleId?: number;
|
|
41
42
|
indentPt?: number;
|
|
42
43
|
indentRightPt?: number;
|
|
43
44
|
firstLineIndentPt?: number;
|
|
@@ -49,6 +50,8 @@ interface ParaProps {
|
|
|
49
50
|
listLv?: number;
|
|
50
51
|
listOrd?: boolean;
|
|
51
52
|
listMark?: string;
|
|
53
|
+
verAlign?: 'baseline' | 'top' | 'center' | 'bottom';
|
|
54
|
+
lineWrap?: 'break' | 'squeeze' | 'keep';
|
|
52
55
|
}
|
|
53
56
|
interface Stroke {
|
|
54
57
|
kind: StrokeKind;
|
|
@@ -131,7 +134,7 @@ interface PbNode {
|
|
|
131
134
|
}
|
|
132
135
|
interface PageNumNode {
|
|
133
136
|
tag: 'pagenum';
|
|
134
|
-
format?: 'decimal' | 'roman' | 'romanCaps';
|
|
137
|
+
format?: 'decimal' | 'roman' | 'romanCaps' | 'total';
|
|
135
138
|
}
|
|
136
139
|
interface ImgNode {
|
|
137
140
|
tag: 'img';
|
|
@@ -155,7 +158,7 @@ interface LinkNode {
|
|
|
155
158
|
interface ParaNode {
|
|
156
159
|
tag: 'para';
|
|
157
160
|
props: ParaProps;
|
|
158
|
-
kids: (SpanNode | ImgNode | LinkNode | GridNode)[];
|
|
161
|
+
kids: (SpanNode | ImgNode | LinkNode | GridNode | PageNumNode)[];
|
|
159
162
|
}
|
|
160
163
|
interface CellNode {
|
|
161
164
|
tag: 'cell';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
type Align = 'left' | 'center' | 'right' | 'justify';
|
|
1
|
+
type Align = 'left' | 'center' | 'right' | 'justify' | 'distribute' | 'distribute_space';
|
|
2
2
|
type ImgWrap = 'inline' | 'square' | 'tight' | 'through' | 'none' | 'behind' | 'front' | 'topAndBottom';
|
|
3
3
|
type ImgHorzAlign = 'left' | 'center' | 'right';
|
|
4
4
|
type ImgVertAlign = 'top' | 'center' | 'bottom';
|
|
@@ -38,6 +38,7 @@ interface ParaProps {
|
|
|
38
38
|
align?: Align;
|
|
39
39
|
heading?: Heading;
|
|
40
40
|
styleId?: string;
|
|
41
|
+
hwpStyleId?: number;
|
|
41
42
|
indentPt?: number;
|
|
42
43
|
indentRightPt?: number;
|
|
43
44
|
firstLineIndentPt?: number;
|
|
@@ -49,6 +50,8 @@ interface ParaProps {
|
|
|
49
50
|
listLv?: number;
|
|
50
51
|
listOrd?: boolean;
|
|
51
52
|
listMark?: string;
|
|
53
|
+
verAlign?: 'baseline' | 'top' | 'center' | 'bottom';
|
|
54
|
+
lineWrap?: 'break' | 'squeeze' | 'keep';
|
|
52
55
|
}
|
|
53
56
|
interface Stroke {
|
|
54
57
|
kind: StrokeKind;
|
|
@@ -131,7 +134,7 @@ interface PbNode {
|
|
|
131
134
|
}
|
|
132
135
|
interface PageNumNode {
|
|
133
136
|
tag: 'pagenum';
|
|
134
|
-
format?: 'decimal' | 'roman' | 'romanCaps';
|
|
137
|
+
format?: 'decimal' | 'roman' | 'romanCaps' | 'total';
|
|
135
138
|
}
|
|
136
139
|
interface ImgNode {
|
|
137
140
|
tag: 'img';
|
|
@@ -155,7 +158,7 @@ interface LinkNode {
|
|
|
155
158
|
interface ParaNode {
|
|
156
159
|
tag: 'para';
|
|
157
160
|
props: ParaProps;
|
|
158
|
-
kids: (SpanNode | ImgNode | LinkNode | GridNode)[];
|
|
161
|
+
kids: (SpanNode | ImgNode | LinkNode | GridNode | PageNumNode)[];
|
|
159
162
|
}
|
|
160
163
|
interface CellNode {
|
|
161
164
|
tag: 'cell';
|