Skip to content

Commit

Permalink
Merge pull request #13 from dsmith4-godaddy/nonprod
Browse files Browse the repository at this point in the history
happy new year, happy new versions
  • Loading branch information
dsmith4-godaddy authored Jan 2, 2024
2 parents 296a0ae + 0fd5790 commit 0163439
Show file tree
Hide file tree
Showing 264 changed files with 75,261 additions and 71,321 deletions.
42 changes: 42 additions & 0 deletions wp-content/plugins/gutenberg/build/blob/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ var __webpack_exports__ = {};
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ createBlobURL: function() { return /* binding */ createBlobURL; },
/* harmony export */ downloadBlob: function() { return /* binding */ downloadBlob; },
/* harmony export */ getBlobByURL: function() { return /* binding */ getBlobByURL; },
/* harmony export */ getBlobTypeByURL: function() { return /* binding */ getBlobTypeByURL; },
/* harmony export */ isBlobURL: function() { return /* binding */ isBlobURL; },
Expand Down Expand Up @@ -112,6 +113,47 @@ function isBlobURL(url) {
return url.indexOf('blob:') === 0;
}

/**
* Downloads a file, e.g., a text or readable stream, in the browser.
* Appropriate for downloading smaller file sizes, e.g., < 5 MB.
*
* Example usage:
*
* ```js
* const fileContent = JSON.stringify(
* {
* "title": "My Post",
* },
* null,
* 2
* );
* const filename = 'file.json';
*
* downloadBlob( filename, fileContent, 'application/json' );
* ```
*
* @param {string} filename File name.
* @param {BlobPart} content File content (BufferSource | Blob | string).
* @param {string} contentType (Optional) File mime type. Default is `''`.
*/
function downloadBlob(filename, content, contentType = '') {
if (!filename || !content) {
return;
}
const file = new window.Blob([content], {
type: contentType
});
const url = window.URL.createObjectURL(file);
const anchorElement = document.createElement('a');
anchorElement.href = url;
anchorElement.download = filename;
anchorElement.style.display = 'none';
document.body.appendChild(anchorElement);
anchorElement.click();
document.body.removeChild(anchorElement);
window.URL.revokeObjectURL(url);
}

(window.wp = window.wp || {}).blob = __webpack_exports__;
/******/ })()
;
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('wp-polyfill'), 'version' => '84bd953bdd6902859500');
<?php return array('dependencies' => array('wp-polyfill'), 'version' => '3729539b9aa02452b5c1');
2 changes: 1 addition & 1 deletion wp-content/plugins/gutenberg/build/blob/index.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion wp-content/plugins/gutenberg/build/blob/index.min.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Loading

0 comments on commit 0163439

Please sign in to comment.