Skip to content

Commit

Permalink
version 3.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
gitbrent committed Jan 8, 2020
1 parent 7ed24e1 commit 2fbbb51
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 30 deletions.
23 changes: 15 additions & 8 deletions demos/react-demo/src/pptxgen.es.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* PptxGenJS 3.0.0 @ 2020-01-03T05:24:04.651Z */
/* PptxGenJS 3.0.1 @ 2020-01-08T05:21:47.379Z */
import * as JSZip from 'jszip';

/**
Expand Down Expand Up @@ -6703,7 +6703,7 @@ function encodeSlideMediaRels(layout) {
});
res.on('error', function (ex) {
rel.data = IMG_BROKEN;
reject('ERROR: Unable to load image: "' + rel.path + '"\n' + ex.toString());
reject("ERROR! Unable to load image: " + rel.path);
});
});
}
Expand All @@ -6724,15 +6724,15 @@ function encodeSlideMediaRels(layout) {
resolve('done');
})
.catch(function (ex) {
reject(ex.toString());
reject(ex);
});
}
};
reader.readAsDataURL(xhr_1.response);
};
xhr_1.onerror = function (ex) {
rel.data = IMG_BROKEN;
reject('ERROR: Unable to load image: "' + rel.path + '"\n' + ex.toString());
reject("ERROR! Unable to load image: " + rel.path);
};
// B: Execute request
xhr_1.open('GET', rel.path);
Expand Down Expand Up @@ -6794,7 +6794,7 @@ function createSvgPngPreview(rel) {
};
image.onerror = function (ex) {
rel.data = IMG_BROKEN;
reject(ex.toString());
reject("ERROR! Unable to load image: " + rel.path);
};
// C: Load image
image.src = typeof rel.data === 'string' ? rel.data : IMG_BROKEN;
Expand Down Expand Up @@ -6832,7 +6832,7 @@ function createSvgPngPreview(rel) {
|*| OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|*| SOFTWARE.
\*/
var VERSION = '3.0.0';
var VERSION = '3.0.1';
var PptxGenJS = /** @class */ (function () {
function PptxGenJS() {
var _this = this;
Expand Down Expand Up @@ -6959,7 +6959,14 @@ var PptxGenJS = /** @class */ (function () {
});
arrMediaPromises = arrMediaPromises.concat(encodeSlideMediaRels(_this.masterSlide));
// STEP 2: Wait for Promises (if any) then generate the PPTX file
Promise.all(arrMediaPromises).then(function () {
Promise.all(arrMediaPromises)
.catch(function (err) {
console.error("ERROR! pptxgenjs export media:");
console.error(err);
return null;
// FIXME: TODO: 20200107: if one image fails to load (eg 404), then *NONE* of the images load b/c of the `.all`...
})
.then(function () {
// A: Add empty placeholder objects to slides that don't already have them
_this.slides.forEach(function (slide) {
if (slide.slideLayout)
Expand Down Expand Up @@ -7031,7 +7038,7 @@ var PptxGenJS = /** @class */ (function () {
}
})
.catch(function (err) {
reject(err);
throw new Error(err);
});
});
});
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.

23 changes: 15 additions & 8 deletions dist/pptxgen.cjs.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* PptxGenJS 3.0.0 @ 2020-01-03T05:24:04.569Z */
/* PptxGenJS 3.0.1 @ 2020-01-08T05:21:47.374Z */
'use strict';

var JSZip = require('jszip');
Expand Down Expand Up @@ -6705,7 +6705,7 @@ function encodeSlideMediaRels(layout) {
});
res.on('error', function (ex) {
rel.data = IMG_BROKEN;
reject('ERROR: Unable to load image: "' + rel.path + '"\n' + ex.toString());
reject("ERROR! Unable to load image: " + rel.path);
});
});
}
Expand All @@ -6726,15 +6726,15 @@ function encodeSlideMediaRels(layout) {
resolve('done');
})
.catch(function (ex) {
reject(ex.toString());
reject(ex);
});
}
};
reader.readAsDataURL(xhr_1.response);
};
xhr_1.onerror = function (ex) {
rel.data = IMG_BROKEN;
reject('ERROR: Unable to load image: "' + rel.path + '"\n' + ex.toString());
reject("ERROR! Unable to load image: " + rel.path);
};
// B: Execute request
xhr_1.open('GET', rel.path);
Expand Down Expand Up @@ -6796,7 +6796,7 @@ function createSvgPngPreview(rel) {
};
image.onerror = function (ex) {
rel.data = IMG_BROKEN;
reject(ex.toString());
reject("ERROR! Unable to load image: " + rel.path);
};
// C: Load image
image.src = typeof rel.data === 'string' ? rel.data : IMG_BROKEN;
Expand Down Expand Up @@ -6834,7 +6834,7 @@ function createSvgPngPreview(rel) {
|*| OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|*| SOFTWARE.
\*/
var VERSION = '3.0.0';
var VERSION = '3.0.1';
var PptxGenJS = /** @class */ (function () {
function PptxGenJS() {
var _this = this;
Expand Down Expand Up @@ -6961,7 +6961,14 @@ var PptxGenJS = /** @class */ (function () {
});
arrMediaPromises = arrMediaPromises.concat(encodeSlideMediaRels(_this.masterSlide));
// STEP 2: Wait for Promises (if any) then generate the PPTX file
Promise.all(arrMediaPromises).then(function () {
Promise.all(arrMediaPromises)
.catch(function (err) {
console.error("ERROR! pptxgenjs export media:");
console.error(err);
return null;
// FIXME: TODO: 20200107: if one image fails to load (eg 404), then *NONE* of the images load b/c of the `.all`...
})
.then(function () {
// A: Add empty placeholder objects to slides that don't already have them
_this.slides.forEach(function (slide) {
if (slide.slideLayout)
Expand Down Expand Up @@ -7033,7 +7040,7 @@ var PptxGenJS = /** @class */ (function () {
}
})
.catch(function (err) {
reject(err);
throw new Error(err);
});
});
});
Expand Down
23 changes: 15 additions & 8 deletions dist/pptxgen.es.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* PptxGenJS 3.0.0 @ 2020-01-03T05:24:04.651Z */
/* PptxGenJS 3.0.1 @ 2020-01-08T05:21:47.379Z */
import * as JSZip from 'jszip';

/**
Expand Down Expand Up @@ -6703,7 +6703,7 @@ function encodeSlideMediaRels(layout) {
});
res.on('error', function (ex) {
rel.data = IMG_BROKEN;
reject('ERROR: Unable to load image: "' + rel.path + '"\n' + ex.toString());
reject("ERROR! Unable to load image: " + rel.path);
});
});
}
Expand All @@ -6724,15 +6724,15 @@ function encodeSlideMediaRels(layout) {
resolve('done');
})
.catch(function (ex) {
reject(ex.toString());
reject(ex);
});
}
};
reader.readAsDataURL(xhr_1.response);
};
xhr_1.onerror = function (ex) {
rel.data = IMG_BROKEN;
reject('ERROR: Unable to load image: "' + rel.path + '"\n' + ex.toString());
reject("ERROR! Unable to load image: " + rel.path);
};
// B: Execute request
xhr_1.open('GET', rel.path);
Expand Down Expand Up @@ -6794,7 +6794,7 @@ function createSvgPngPreview(rel) {
};
image.onerror = function (ex) {
rel.data = IMG_BROKEN;
reject(ex.toString());
reject("ERROR! Unable to load image: " + rel.path);
};
// C: Load image
image.src = typeof rel.data === 'string' ? rel.data : IMG_BROKEN;
Expand Down Expand Up @@ -6832,7 +6832,7 @@ function createSvgPngPreview(rel) {
|*| OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|*| SOFTWARE.
\*/
var VERSION = '3.0.0';
var VERSION = '3.0.1';
var PptxGenJS = /** @class */ (function () {
function PptxGenJS() {
var _this = this;
Expand Down Expand Up @@ -6959,7 +6959,14 @@ var PptxGenJS = /** @class */ (function () {
});
arrMediaPromises = arrMediaPromises.concat(encodeSlideMediaRels(_this.masterSlide));
// STEP 2: Wait for Promises (if any) then generate the PPTX file
Promise.all(arrMediaPromises).then(function () {
Promise.all(arrMediaPromises)
.catch(function (err) {
console.error("ERROR! pptxgenjs export media:");
console.error(err);
return null;
// FIXME: TODO: 20200107: if one image fails to load (eg 404), then *NONE* of the images load b/c of the `.all`...
})
.then(function () {
// A: Add empty placeholder objects to slides that don't already have them
_this.slides.forEach(function (slide) {
if (slide.slideLayout)
Expand Down Expand Up @@ -7031,7 +7038,7 @@ var PptxGenJS = /** @class */ (function () {
}
})
.catch(function (err) {
reject(err);
throw new Error(err);
});
});
});
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.

0 comments on commit 2fbbb51

Please sign in to comment.