ppt2json 0.3.1 → 0.3.3
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 +5 -6
- package/dist/index.d.mts +2 -4
- package/dist/index.d.ts +2 -4
- package/dist/index.js +6 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +7 -6
package/dist/index.mjs
CHANGED
|
@@ -3094,7 +3094,7 @@ function getSpanStyleInfo(node, pNode, textBodyNode, pFontStyle, slideLayoutSpNo
|
|
|
3094
3094
|
|
|
3095
3095
|
// parser/shape.ts
|
|
3096
3096
|
function shapeArc(cX, cY, rX, rY, stAng, endAng, isClose) {
|
|
3097
|
-
let dData;
|
|
3097
|
+
let dData = "";
|
|
3098
3098
|
let angle = stAng;
|
|
3099
3099
|
if (endAng >= stAng) {
|
|
3100
3100
|
while (angle <= endAng) {
|
|
@@ -9228,7 +9228,9 @@ function parseGradientPosition(value) {
|
|
|
9228
9228
|
}
|
|
9229
9229
|
function mapGradient(value) {
|
|
9230
9230
|
if (!value || typeof value !== "object") return void 0;
|
|
9231
|
-
const colors = Array.isArray(value.colors) ? value.colors.filter(
|
|
9231
|
+
const colors = Array.isArray(value.colors) ? value.colors.filter(
|
|
9232
|
+
(stop) => typeof stop === "object" && stop !== null
|
|
9233
|
+
).map((stop) => ({
|
|
9232
9234
|
pos: parseGradientPosition(stop.pos),
|
|
9233
9235
|
color: mapFillColor(stop.color) ?? "#FFFFFF"
|
|
9234
9236
|
})) : [];
|
|
@@ -9501,7 +9503,7 @@ function mapElement(raw) {
|
|
|
9501
9503
|
fill,
|
|
9502
9504
|
...special ? { special: true } : {},
|
|
9503
9505
|
text: hasText ? {
|
|
9504
|
-
content: normalizedShapeText,
|
|
9506
|
+
content: normalizedShapeText ?? "",
|
|
9505
9507
|
align: normalizeVAlign(raw.vAlign) ?? "middle",
|
|
9506
9508
|
defaultColor: normalizeColor(raw.defaultColor) ?? normalizeColor(raw.color) ?? "#333",
|
|
9507
9509
|
defaultFontName: raw.fontName ?? "",
|
|
@@ -9742,7 +9744,7 @@ var DEFAULT_THEME = {
|
|
|
9742
9744
|
async function parsePptxToJson(file) {
|
|
9743
9745
|
const fileBuffer = await file.arrayBuffer();
|
|
9744
9746
|
return {
|
|
9745
|
-
|
|
9747
|
+
presentation: await buildDeckFromPptx(fileBuffer),
|
|
9746
9748
|
warnings: []
|
|
9747
9749
|
};
|
|
9748
9750
|
}
|