@jsreport/jsreport-pptx
Advanced tools
Comparing version 4.1.0 to 4.2.0
@@ -240,3 +240,3 @@ const path = require('path') | ||
const newChartPath = path.join( | ||
const newChartPath = path.posix.join( | ||
path.posix.relative( | ||
@@ -243,0 +243,0 @@ path.posix.dirname(slidePath), |
@@ -17,3 +17,15 @@ const { nodeListToArray } = require('../utils') | ||
const cleanup = () => { | ||
if (slides.length === 0) { | ||
return | ||
} | ||
// removing the container to the original slide | ||
if (doc.documentElement.localName === 'container') { | ||
doc.replaceChild(slides[0], doc.documentElement) | ||
} | ||
} | ||
if (slides.length <= 1) { | ||
cleanup() | ||
continue | ||
@@ -106,5 +118,4 @@ } | ||
// removing the container to the original slide | ||
doc.replaceChild(slides[0], doc.documentElement) | ||
cleanup() | ||
} | ||
} |
@@ -25,3 +25,3 @@ | ||
if (concatenating) { | ||
if (elements[i].parentNode.previousSibling.localName === 'r') { | ||
if (elements[i].parentNode.previousSibling?.localName === 'r') { | ||
validSiblings = elements[i].parentNode.previousSibling === elements[i - 1].parentNode | ||
@@ -28,0 +28,0 @@ } else { |
@@ -35,2 +35,4 @@ const regexp = /{{pptxSlides [^{}]{0,500}}}/ | ||
} | ||
} else if (el.textContent.includes('{{#pptxSlides')) { | ||
throw new Error('pptxSlides helper must be called as a simple helper call "{{pptxSlides ...}}", block helper call "{{#pptxSlides ...}}" is not supported') | ||
} | ||
@@ -37,0 +39,0 @@ } |
@@ -61,3 +61,3 @@ const { DOMParser, XMLSerializer } = require('@xmldom/xmldom') | ||
const { content: newContent } = await reporter.render({ | ||
const res = await reporter.render({ | ||
template: { | ||
@@ -71,2 +71,4 @@ content: contentToRender, | ||
const newContent = await res.output.getBuffer() | ||
// we remove NUL, VERTICAL TAB unicode characters, which are characters that are illegal in XML. | ||
@@ -73,0 +75,0 @@ // NOTE: we should likely find a way to remove illegal characters more generally, using some kind of unicode ranges |
{ | ||
"name": "@jsreport/jsreport-pptx", | ||
"version": "4.1.0", | ||
"version": "4.2.0", | ||
"description": "jsreport recipe rendering pptx files", | ||
@@ -36,5 +36,5 @@ "keywords": [ | ||
"dependencies": { | ||
"@jsreport/office": "4.0.0", | ||
"@jsreport/office": "4.1.0", | ||
"@xmldom/xmldom": "0.8.6", | ||
"axios": "1.6.2", | ||
"axios": "1.6.7", | ||
"html-entities": "2.4.0", | ||
@@ -46,4 +46,4 @@ "image-size": "0.7.4", | ||
"devDependencies": { | ||
"@jsreport/jsreport-assets": "4.0.2", | ||
"@jsreport/jsreport-core": "4.1.0", | ||
"@jsreport/jsreport-assets": "4.1.0", | ||
"@jsreport/jsreport-core": "4.2.0", | ||
"@jsreport/jsreport-handlebars": "4.0.1", | ||
@@ -50,0 +50,0 @@ "@jsreport/studio-dev": "4.0.0", |
@@ -10,2 +10,9 @@ # @jsreport/jsreport-pptx | ||
### 4.2.0 | ||
- fix concat tags logic | ||
- fix can not render report using pptxSlides with one item array | ||
- throw better error when pptxSlides is used as a block helper call | ||
- internal changes to support new `response.output` api | ||
### 4.1.0 | ||
@@ -12,0 +19,0 @@ |
138206
2908
57
+ Added@isaacs/cliui@8.0.2(transitive)
+ Added@jsreport/office@4.1.0(transitive)
+ Added@pkgjs/parseargs@0.11.0(transitive)
+ Addedabort-controller@3.0.0(transitive)
+ Addedansi-regex@5.0.16.1.0(transitive)
+ Addedansi-styles@4.3.06.2.1(transitive)
+ Addedarchiver@7.0.1(transitive)
+ Addedarchiver-utils@5.0.2(transitive)
+ Addedaxios@1.6.7(transitive)
+ Addedb4a@1.6.7(transitive)
+ Addedbare-events@2.5.4(transitive)
+ Addedbuffer@6.0.3(transitive)
+ Addedbuffer-crc32@1.0.0(transitive)
+ Addedcolor-convert@2.0.1(transitive)
+ Addedcolor-name@1.1.4(transitive)
+ Addedcompress-commons@6.0.2(transitive)
+ Addedcrc32-stream@6.0.0(transitive)
+ Addedcross-spawn@7.0.6(transitive)
+ Addedeastasianwidth@0.2.0(transitive)
+ Addedemoji-regex@8.0.09.2.2(transitive)
+ Addedevent-target-shim@5.0.1(transitive)
+ Addedevents@3.3.0(transitive)
+ Addedfast-fifo@1.3.2(transitive)
+ Addedforeground-child@3.3.0(transitive)
+ Addedglob@10.4.5(transitive)
+ Addedis-fullwidth-code-point@3.0.0(transitive)
+ Addedis-stream@2.0.1(transitive)
+ Addedisexe@2.0.0(transitive)
+ Addedjackspeak@3.4.3(transitive)
+ Addedlodash@4.17.21(transitive)
+ Addedlru-cache@10.4.3(transitive)
+ Addedminimatch@9.0.5(transitive)
+ Addedminipass@7.1.2(transitive)
+ Addedpackage-json-from-dist@1.0.1(transitive)
+ Addedpath-key@3.1.1(transitive)
+ Addedpath-scurry@1.11.1(transitive)
+ Addedprocess@0.11.10(transitive)
+ Addedqueue-tick@1.0.1(transitive)
+ Addedreadable-stream@4.7.0(transitive)
+ Addedsafe-buffer@5.2.1(transitive)
+ Addedshebang-command@2.0.0(transitive)
+ Addedshebang-regex@3.0.0(transitive)
+ Addedsignal-exit@4.1.0(transitive)
+ Addedstreamx@2.21.1(transitive)
+ Addedstring-width@4.2.35.1.2(transitive)
+ Addedstring_decoder@1.3.0(transitive)
+ Addedstrip-ansi@6.0.17.1.0(transitive)
+ Addedtar-stream@3.1.7(transitive)
+ Addedtext-decoder@1.2.3(transitive)
+ Addedwhich@2.0.2(transitive)
+ Addedwrap-ansi@7.0.08.1.0(transitive)
+ Addedzip-stream@6.0.1(transitive)
- Removed@jsreport/office@4.0.0(transitive)
- Removedarchiver@5.3.0(transitive)
- Removedarchiver-utils@2.1.03.0.4(transitive)
- Removedaxios@1.6.2(transitive)
- Removedbl@4.1.0(transitive)
- Removedbrace-expansion@1.1.11(transitive)
- Removedbuffer@5.7.1(transitive)
- Removedcompress-commons@4.1.2(transitive)
- Removedconcat-map@0.0.1(transitive)
- Removedcrc32-stream@4.0.3(transitive)
- Removedfs-constants@1.0.0(transitive)
- Removedfs.realpath@1.0.0(transitive)
- Removedglob@7.2.3(transitive)
- Removedinflight@1.0.6(transitive)
- Removedlodash.defaults@4.2.0(transitive)
- Removedlodash.difference@4.5.0(transitive)
- Removedlodash.flatten@4.4.0(transitive)
- Removedlodash.isplainobject@4.0.6(transitive)
- Removedlodash.union@4.6.0(transitive)
- Removedminimatch@3.1.2(transitive)
- Removedpath-is-absolute@1.0.1(transitive)
- Removedreadable-stream@3.6.2(transitive)
- Removedtar-stream@2.2.0(transitive)
- Removedzip-stream@4.1.1(transitive)
Updated@jsreport/office@4.1.0
Updatedaxios@1.6.7