Skip to content

Commit

Permalink
Updated for v3.3.1 release
Browse files Browse the repository at this point in the history
  • Loading branch information
gitbrent committed Aug 23, 2020
1 parent a522953 commit 46ba98d
Show file tree
Hide file tree
Showing 16 changed files with 74 additions and 38 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Notes]

## [3.3.1] - 2020-08-23
### Changed
- Fixed: Broken pptx has generated if used custom slide layout in v3.3.0 [\#826](https://github.com/gitbrent/PptxGenJS/issues/826) ([yhatt](https://github.com/yhatt))
- Fixed: lineSpacing option set to decimal triggers repair alert [\#827](https://github.com/gitbrent/PptxGenJS/issues/827) ([ReimaFrgos](https://github.com/ReimaFrgos))
- Updated `demos.js` to replace all fill:string with fill:ShapeFillProps ([gitbrent](https://github.com/gitbrent))



Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,14 @@ Use the online demo to create a simple presentation to see how easy it is to use
Bundle: Modern Browsers and IE11

```html
<script src="https://cdn.jsdelivr.net/gh/gitbrent/[email protected].0/dist/pptxgen.bundle.js"></script>
<script src="https://cdn.jsdelivr.net/gh/gitbrent/[email protected].1/dist/pptxgen.bundle.js"></script>
```

Min files: Modern Browsers

```html
<script src="https://cdn.jsdelivr.net/gh/gitbrent/[email protected].0/libs/jszip.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/gitbrent/[email protected].0/dist/pptxgen.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/gitbrent/[email protected].1/libs/jszip.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/gitbrent/[email protected].1/dist/pptxgen.min.js"></script>
```

## Download
Expand Down
2 changes: 1 addition & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ React Test

1. Ensure newest `dist/pptxgen.es.js` and `types/index.d.ts` under local node_modules
2. Update `demos/react-demo/package.json` version
3. Open `demos/react-demo/src/latest/Test.tsx`
3. Open `demos/react-demo/src/tstest/Test.tsx`
4. Check existing code
5. Test defs by using auto-complete, "pptxgen.ChartType." etc.

Expand Down
8 changes: 4 additions & 4 deletions demos/browser/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="author" content="https://github.com/gitbrent">
<meta name="website" content="https://github.com/gitbrent/PptxGenJS/">
<meta name="version" content="3.3.1-beta">
<meta name="version" content="3.3.1">
<meta name="updated" content="2020-08-23">
<link rel="icon" href="images/favicon-32x32.png" sizes="32x32" type="image/png">
<link rel="icon" href="images/favicon-16x16.png" sizes="16x16" type="image/png">
Expand Down Expand Up @@ -146,9 +146,9 @@
<script src="https://cdn.jsdelivr.net/gh/gitbrent/pptxgenjs@latest/examples/images/base64Images.js" async></script>

<!-- RELEASE (CDN)
<script src="https://cdn.jsdelivr.net/gh/gitbrent/pptxgenjs@latest/dist/pptxgen.bundle.js"></script>
<script src="https://cdn.jsdelivr.net/gh/gitbrent/pptxgenjs@latest/demos/common/demos.js"></script>
-->
<script src="https://cdn.jsdelivr.net/gh/gitbrent/pptxgenjs@latest/dist/pptxgen.bundle.js"></script>
<script src="https://cdn.jsdelivr.net/gh/gitbrent/pptxgenjs@latest/demos/common/demos.js"></script>
<!--
TODO: [only used during `-beta` dev cycles; update to below on release]
<script src="https://cdn.jsdelivr.net/gh/gitbrent/pptxgenjs@master/dist/pptxgen.bundle.js"></script>
Expand All @@ -162,9 +162,9 @@
<!-- LOCAL TESTING:
<script src="../../libs/jszip.min.js"></script>
<script src="../../dist/pptxgen.min.js"></script>
-->
<script src="../../dist/pptxgen.bundle.js"></script>
<script src="../common/demos.js"></script>
-->

<script>
// ==================================================================================================================
Expand Down
4 changes: 2 additions & 2 deletions demos/common/demos.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
* AUTH: Brent Ely (https://github.com/gitbrent/)
* DESC: Common test/demo slides for all library features
* DEPS: Used by various demos (./demos/browser, ./demos/node, etc.)
* VER.: 3.4.0
* BLD.: 20200817
* VER.: 3.3.1
* BLD.: 20200823
*/

var isIE11 = typeof window !== 'undefined' && !!window['MSInputMethodContext'] && !!document['documentMode'];
Expand Down
4 changes: 2 additions & 2 deletions demos/node/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pptxgenjs-demos-node",
"version": "3.3.0",
"version": "3.3.1",
"author": {
"name": "Brent Ely",
"url": "https://github.com/gitbrent/"
Expand All @@ -15,6 +15,6 @@
},
"license": "MIT",
"dependencies": {
"pptxgenjs": "^3.3.0"
"pptxgenjs": "^3.3.1"
}
}
4 changes: 2 additions & 2 deletions demos/react-demo/package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "pptxgenjs-react-demo",
"version": "3.3.0",
"version": "3.3.1",
"private": true,
"dependencies": {
"pptxgenjs": "^3.3.0",
"pptxgenjs": "^3.3.1",
"react": "^16.10.1",
"react-dom": "^16.10.1",
"react-scripts": "3.1.2"
Expand Down
4 changes: 2 additions & 2 deletions demos/react-demo/src/tstest/Test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export function testMainMethods() {
// PPTX Method 1:
//pptx.layout = "LAYOUT_WIDE";
//pptx.defineLayout({ name:'A3', width:16.5, height:11.7 });
pptx.defineLayout({ name: 'TST', width: 13, height: 7 });
pptx.defineLayout({ name: 'TST', width: 13.4, height: 7.5 });
pptx.layout = 'TST';

// PPTX Method 2:
Expand Down Expand Up @@ -380,7 +380,7 @@ function testMethod_Shape(pptx: pptxgen) {
line: { color: "000000", width: 3 },
});
slide.addText("RIGHT-TRIANGLE", {
shape: pptx.ShapeType.triangle,
shape: pptx.ShapeType.rtTriangle,
align: "center",
x: 7.0,
y: 4.3,
Expand Down
4 changes: 2 additions & 2 deletions dist/pptxgen.bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/pptxgen.bundle.js.map

Large diffs are not rendered by default.

31 changes: 24 additions & 7 deletions dist/pptxgen.cjs.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* PptxGenJS 3.3.0 @ 2020-08-17T04:25:01.746Z */
/* PptxGenJS 3.3.1 @ 2020-08-23T19:00:27.029Z */
'use strict';

var JSZip = require('jszip');
Expand Down Expand Up @@ -2080,7 +2080,7 @@ function genXmlParagraphProperties(textObj, isDefault) {
}
}
if (textObj.options.lineSpacing)
strXmlLnSpc = "<a:lnSpc><a:spcPts val=\"" + textObj.options.lineSpacing + "00\"/></a:lnSpc>";
strXmlLnSpc = "<a:lnSpc><a:spcPts val=\"" + textObj.options.lineSpacing * 100 + "\"/></a:lnSpc>";
// OPTION: indent
if (textObj.options.indentLevel && !isNaN(Number(textObj.options.indentLevel)) && textObj.options.indentLevel > 0) {
paragraphPropXml += " lvl=\"" + textObj.options.indentLevel + "\"";
Expand Down Expand Up @@ -6039,7 +6039,7 @@ function createSvgPngPreview(rel) {
|*| OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|*| SOFTWARE.
\*/
var VERSION = '3.3.0';
var VERSION = '3.3.1';
var PptxGenJS = /** @class */ (function () {
function PptxGenJS() {
var _this = this;
Expand Down Expand Up @@ -6566,6 +6566,19 @@ var PptxGenJS = /** @class */ (function () {
PptxGenJS.prototype.addSlide = function (options) {
// TODO: DEPRECATED: arg0 string "masterSlideName" dep as of 3.2.0
var masterSlideName = typeof options === 'string' ? options : options && options.masterName ? options.masterName : '';
var slideLayout = {
_name: this.LAYOUTS[DEF_PRES_LAYOUT].name,
_presLayout: this.presLayout,
_rels: [],
_relsChart: [],
_relsMedia: [],
_slideNum: this.slides.length + 1,
};
if (masterSlideName) {
var tmpLayout = this.slideLayouts.filter(function (layout) { return layout._name === masterSlideName; })[0];
if (tmpLayout)
slideLayout = tmpLayout;
}
var newSlide = new Slide({
addSlide: this.addNewSlide,
getSlide: this.getSlide,
Expand All @@ -6574,9 +6587,7 @@ var PptxGenJS = /** @class */ (function () {
slideId: this.slides.length + 256,
slideRId: this.slides.length + 2,
slideNumber: this.slides.length + 1,
slideLayout: masterSlideName
? this.slideLayouts.filter(function (layout) { return layout._name === masterSlideName; })[0] || this.LAYOUTS[DEF_PRES_LAYOUT]
: this.LAYOUTS[DEF_PRES_LAYOUT],
slideLayout: slideLayout
});
// A: Add slide to pres
this._slides.push(newSlide);
Expand Down Expand Up @@ -6624,7 +6635,13 @@ var PptxGenJS = /** @class */ (function () {
console.warn('defineLayout `height` should be a number (inches)');
else if (typeof layout.width !== 'number')
console.warn('defineLayout `width` should be a number (inches)');
this.LAYOUTS[layout.name] = { name: layout.name, _sizeW: Math.round(Number(layout.width) * EMU), _sizeH: Math.round(Number(layout.height) * EMU) };
this.LAYOUTS[layout.name] = {
name: layout.name,
_sizeW: Math.round(Number(layout.width) * EMU),
_sizeH: Math.round(Number(layout.height) * EMU),
width: Math.round(Number(layout.width) * EMU),
height: Math.round(Number(layout.height) * EMU),
};
};
/**
* Create a new slide master [layout] for the Presentation
Expand Down
31 changes: 24 additions & 7 deletions dist/pptxgen.es.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* PptxGenJS 3.3.0 @ 2020-08-17T04:25:01.751Z */
/* PptxGenJS 3.3.1 @ 2020-08-23T19:00:27.034Z */
import * as JSZip from 'jszip';

/**
Expand Down Expand Up @@ -2078,7 +2078,7 @@ function genXmlParagraphProperties(textObj, isDefault) {
}
}
if (textObj.options.lineSpacing)
strXmlLnSpc = "<a:lnSpc><a:spcPts val=\"" + textObj.options.lineSpacing + "00\"/></a:lnSpc>";
strXmlLnSpc = "<a:lnSpc><a:spcPts val=\"" + textObj.options.lineSpacing * 100 + "\"/></a:lnSpc>";
// OPTION: indent
if (textObj.options.indentLevel && !isNaN(Number(textObj.options.indentLevel)) && textObj.options.indentLevel > 0) {
paragraphPropXml += " lvl=\"" + textObj.options.indentLevel + "\"";
Expand Down Expand Up @@ -6037,7 +6037,7 @@ function createSvgPngPreview(rel) {
|*| OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|*| SOFTWARE.
\*/
var VERSION = '3.3.0';
var VERSION = '3.3.1';
var PptxGenJS = /** @class */ (function () {
function PptxGenJS() {
var _this = this;
Expand Down Expand Up @@ -6564,6 +6564,19 @@ var PptxGenJS = /** @class */ (function () {
PptxGenJS.prototype.addSlide = function (options) {
// TODO: DEPRECATED: arg0 string "masterSlideName" dep as of 3.2.0
var masterSlideName = typeof options === 'string' ? options : options && options.masterName ? options.masterName : '';
var slideLayout = {
_name: this.LAYOUTS[DEF_PRES_LAYOUT].name,
_presLayout: this.presLayout,
_rels: [],
_relsChart: [],
_relsMedia: [],
_slideNum: this.slides.length + 1,
};
if (masterSlideName) {
var tmpLayout = this.slideLayouts.filter(function (layout) { return layout._name === masterSlideName; })[0];
if (tmpLayout)
slideLayout = tmpLayout;
}
var newSlide = new Slide({
addSlide: this.addNewSlide,
getSlide: this.getSlide,
Expand All @@ -6572,9 +6585,7 @@ var PptxGenJS = /** @class */ (function () {
slideId: this.slides.length + 256,
slideRId: this.slides.length + 2,
slideNumber: this.slides.length + 1,
slideLayout: masterSlideName
? this.slideLayouts.filter(function (layout) { return layout._name === masterSlideName; })[0] || this.LAYOUTS[DEF_PRES_LAYOUT]
: this.LAYOUTS[DEF_PRES_LAYOUT],
slideLayout: slideLayout
});
// A: Add slide to pres
this._slides.push(newSlide);
Expand Down Expand Up @@ -6622,7 +6633,13 @@ var PptxGenJS = /** @class */ (function () {
console.warn('defineLayout `height` should be a number (inches)');
else if (typeof layout.width !== 'number')
console.warn('defineLayout `width` should be a number (inches)');
this.LAYOUTS[layout.name] = { name: layout.name, _sizeW: Math.round(Number(layout.width) * EMU), _sizeH: Math.round(Number(layout.height) * EMU) };
this.LAYOUTS[layout.name] = {
name: layout.name,
_sizeW: Math.round(Number(layout.width) * EMU),
_sizeH: Math.round(Number(layout.height) * EMU),
width: Math.round(Number(layout.width) * EMU),
height: Math.round(Number(layout.height) * EMU),
};
};
/**
* Create a new slide master [layout] for the Presentation
Expand Down
4 changes: 2 additions & 2 deletions dist/pptxgen.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/pptxgen.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pptxgenjs",
"version": "3.3.1-beta",
"version": "3.3.1",
"author": {
"name": "Brent Ely",
"url": "https://github.com/gitbrent/"
Expand Down
2 changes: 1 addition & 1 deletion src/pptxgen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ import * as genMedia from './gen-media'
import * as genTable from './gen-tables'
import * as genXml from './gen-xml'

const VERSION = '3.3.1-beta-20200823:1122'
const VERSION = '3.3.1'

export default class PptxGenJS implements IPresentationProps {
// Property getters/setters
Expand Down

0 comments on commit 46ba98d

Please sign in to comment.