pptxtojson 1.2.2 → 1.3.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.
- package/README.md +10 -11
- package/dist/index.d.ts +33 -3
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/border.js +2 -2
- package/src/fill.js +14 -1
- package/src/pptxtojson.js +65 -23
- package/src/table.js +35 -7
- package/dist/wx.png +0 -0
package/README.md
CHANGED
|
@@ -131,6 +131,12 @@ document.querySelector('input').addEventListener('change', evt => {
|
|
|
131
131
|
- 垂直坐标 `top`
|
|
132
132
|
- 宽度 `width`
|
|
133
133
|
- 高度 `height`
|
|
134
|
+
- 边框颜色 `borderColor`
|
|
135
|
+
- 边框宽度 `borderWidth`
|
|
136
|
+
- 边框类型(实线、点线、虚线) `borderType`
|
|
137
|
+
- 非实线边框样式 `borderStrokeDasharray`
|
|
138
|
+
- 裁剪形状 `geom`
|
|
139
|
+
- 裁剪范围 `rect`
|
|
134
140
|
- 图片地址(base64) `src`
|
|
135
141
|
- 旋转角度 `rotate`
|
|
136
142
|
|
|
@@ -161,10 +167,10 @@ document.querySelector('input').addEventListener('change', evt => {
|
|
|
161
167
|
- 垂直坐标 `top`
|
|
162
168
|
- 宽度 `width`
|
|
163
169
|
- 高度 `height`
|
|
164
|
-
-
|
|
165
|
-
- 边框宽度 `borderWidth`
|
|
166
|
-
- 边框类型(实线、点线、虚线) `borderType`
|
|
170
|
+
- 边框(4边) `borders`
|
|
167
171
|
- 表格数据 `data`
|
|
172
|
+
- 行高 `rowHeights`
|
|
173
|
+
- 列宽 `colWidths`
|
|
168
174
|
|
|
169
175
|
##### 图表
|
|
170
176
|
- 类型 `type='chart'`
|
|
@@ -231,11 +237,4 @@ document.querySelector('input').addEventListener('change', evt => {
|
|
|
231
237
|
> 与它们不同的是:PPTX2HTML 和 PPTXjs 是将PPT文件转换为能够运行的 HTML 页面,而 pptxtojson 做的是将PPT文件转换为干净的 JSON 数据,且在原有基础上进行了大量优化(包括代码质量和提取信息准确度)。
|
|
232
238
|
|
|
233
239
|
# 📄 开源协议
|
|
234
|
-
MIT License | Copyright © 2020-PRESENT [pipipi-pikachu](https://github.com/pipipi-pikachu)
|
|
235
|
-
|
|
236
|
-
# ☕ 打赏
|
|
237
|
-
如果该项目帮到了您,还请您不吝打赏!
|
|
238
|
-
|
|
239
|
-
<p align="left">
|
|
240
|
-
<img src='/dist/wx.png' />
|
|
241
|
-
</p>
|
|
240
|
+
MIT License | Copyright © 2020-PRESENT [pipipi-pikachu](https://github.com/pipipi-pikachu)
|
package/dist/index.d.ts
CHANGED
|
@@ -32,6 +32,12 @@ export interface GradientFill {
|
|
|
32
32
|
|
|
33
33
|
export type Fill = ColorFill | ImageFill | GradientFill
|
|
34
34
|
|
|
35
|
+
export interface Border {
|
|
36
|
+
borderColor: string
|
|
37
|
+
borderWidth: number
|
|
38
|
+
borderType:'solid' | 'dashed' | 'dotted'
|
|
39
|
+
}
|
|
40
|
+
|
|
35
41
|
export interface Shape {
|
|
36
42
|
type: 'shape'
|
|
37
43
|
left: number
|
|
@@ -88,6 +94,17 @@ export interface Image {
|
|
|
88
94
|
isFlipH: boolean
|
|
89
95
|
isFlipV: boolean
|
|
90
96
|
order: number
|
|
97
|
+
rect?: {
|
|
98
|
+
t?: number
|
|
99
|
+
b?: number
|
|
100
|
+
l?: number
|
|
101
|
+
r?: number
|
|
102
|
+
}
|
|
103
|
+
geom: string
|
|
104
|
+
borderColor: string
|
|
105
|
+
borderWidth: number
|
|
106
|
+
borderType: 'solid' | 'dashed' | 'dotted'
|
|
107
|
+
borderStrokeDasharray: string
|
|
91
108
|
}
|
|
92
109
|
|
|
93
110
|
export interface TableCell {
|
|
@@ -99,6 +116,12 @@ export interface TableCell {
|
|
|
99
116
|
fillColor?: string
|
|
100
117
|
fontColor?: string
|
|
101
118
|
fontBold?: boolean
|
|
119
|
+
borders: {
|
|
120
|
+
top?: Border
|
|
121
|
+
bottom?: Border
|
|
122
|
+
left?: Border
|
|
123
|
+
right?: Border
|
|
124
|
+
}
|
|
102
125
|
}
|
|
103
126
|
export interface Table {
|
|
104
127
|
type: 'table'
|
|
@@ -107,10 +130,15 @@ export interface Table {
|
|
|
107
130
|
width: number
|
|
108
131
|
height: number
|
|
109
132
|
data: TableCell[][]
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
133
|
+
borders: {
|
|
134
|
+
top?: Border
|
|
135
|
+
bottom?: Border
|
|
136
|
+
left?: Border
|
|
137
|
+
right?: Border
|
|
138
|
+
}
|
|
113
139
|
order: number
|
|
140
|
+
rowHeights: number[]
|
|
141
|
+
colWidths: number[]
|
|
114
142
|
}
|
|
115
143
|
|
|
116
144
|
export type ChartType = 'lineChart' |
|
|
@@ -224,6 +252,8 @@ export interface Group {
|
|
|
224
252
|
rotate: number
|
|
225
253
|
elements: BaseElement[]
|
|
226
254
|
order: number
|
|
255
|
+
isFlipH: boolean
|
|
256
|
+
isFlipV: boolean
|
|
227
257
|
}
|
|
228
258
|
export type Element = BaseElement | Group
|
|
229
259
|
|