From f2b4e3143fecf22231bc6a3a771a1cfd893e13d6 Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Mon, 3 Apr 2023 14:37:44 +1200 Subject: [PATCH] MNT Update dev JS --- client/dist/js/bundle.js | 2 +- package.json | 4 ++-- yarn.lock | 16 ++++++++-------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/client/dist/js/bundle.js b/client/dist/js/bundle.js index bacc0d9..708e022 100644 --- a/client/dist/js/bundle.js +++ b/client/dist/js/bundle.js @@ -1 +1 @@ -!function(){"use strict";var e={274:function(e,t,n){var r,a=(r=n(521))&&r.__esModule?r:{default:r};window.document.addEventListener("DOMContentLoaded",(()=>{(0,a.default)()}))},521:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=o(n(648)),a=o(n(66));function o(e){return e&&e.__esModule?e:{default:e}}t.default=()=>{r.default.component.registerMany({ShareDraftContent:a.default})}},66:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=u(t);if(n&&n.has(e))return n.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var l=a?Object.getOwnPropertyDescriptor(e,o):null;l&&(l.get||l.set)?Object.defineProperty(r,o,l):r[o]=e[o]}r.default=e,n&&n.set(e,r);return r}(n(363)),a=d(n(86)),o=d(n(820)),l=d(n(754)),i=d(n(875)),s=n(648);function d(e){return e&&e.__esModule?e:{default:e}}function u(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(u=function(e){return e?n:t})(e)}class f extends r.Component{constructor(e){super(e),this.state={error:null,isLoaded:!1,previewUrl:l.default._t("ShareDraftContent.LOADING","Loading...")},this.handleToggle=this.handleToggle.bind(this)}handleInputChange(){}handleToggle(){const{isLoaded:e}=this.state;e?this.selectLink():this.generateShareDraftLink()}generateShareDraftLink(){const{links:{generateLink:e}}=this.props;return(0,i.default)(e,{credentials:"same-origin"}).then((e=>e.text())).then((e=>{this.setState({isLoaded:!0,previewUrl:e}),this.selectLink()}),(()=>{this.setState({error:!0})}))}selectLink(){this.linkRef&&this.linkRef.select()}renderError(){const{error:e}=this.state;return e?r.default.createElement("div",{className:"alert alert-danger"},l.default._t("ShareDraftContent.FETCH_ERROR","There was a problem generating the shareable link!")):null}renderHelp(){const{links:{learnMore:e}}=this.props;return r.default.createElement("p",null,l.default._t("ShareDraftContent.DESCRIPTION","Anyone with this link can view the draft version of this page.")," ",e&&r.default.createElement("a",{href:e,className:"share-draft-content__learn-more",target:"_blank",rel:"noopener noreferrer"},l.default._t("ShareDraftContent.LEARN_MORE","Learn more")))}renderLink(){const{previewUrl:e}=this.state;return r.default.createElement("div",{className:"share-draft-content__link-container"},r.default.createElement("input",{type:"text",className:"share-draft-content__link form-control no-change-track",title:l.default._t("ShareDraftContent.LINK_HELP","Link to share draft content"),value:e,onChange:this.handleInputChange,ref:e=>{this.linkRef=e},readOnly:!0}))}render(){const{id:e,PopoverField:t,className:n,button:a,popover:l}=this.props,i={id:e,buttonClassName:a.className,title:a.title,data:{popoverTitle:l.title,buttonTooltip:a.tooltip,placement:"top"},toggleCallback:this.handleToggle},s=(0,o.default)("share-draft-content__container",n);return r.default.createElement("div",{className:s},r.default.createElement(t,i,this.renderError(),this.renderHelp(),this.renderLink()))}}t.Component=f,f.propTypes={id:a.default.string.isRequired,className:a.default.string,button:a.default.shape({className:a.default.string,title:a.default.string,tooltip:a.default.string}),popover:a.default.shape({title:a.default.string}),links:a.default.shape({generateLink:a.default.string.isRequired,learnMore:a.default.string}),PopoverField:a.default.oneOfType([a.default.node,a.default.func]).isRequired},f.defaultProps={id:"share-draft-content",button:{className:"font-icon-share",title:l.default._t("ShareDraftContent.SHARE","Share"),tooltip:l.default._t("ShareDraftContent.SHARE_DRAFT_CONTENT","Share draft content")},popover:{title:l.default._t("ShareDraftContent.SHARE_DRAFT_CONTENT","Share draft content")},links:{learnMore:""},popoverIcon:"font-icon-share"};var c=(0,s.inject)(["PopoverField"])(f);t.default=c},578:function(e,t,n){var r=i(n(311)),a=i(n(363)),o=n(745),l=n(648);function i(e){return e&&e.__esModule?e:{default:e}}r.default.entwine("ss",(e=>{e(".js-injector-boot .share-draft-content__placeholder").entwine({ReactRoot:null,onmatch(){const e=this.closest(".cms-content").attr("id"),t=e?{context:e}:{},n=(0,l.loadComponent)("ShareDraftContent",t),r=this.closest(".cms-preview").length>0?"preview":"edit";let i=this.getReactRoot();i||(i=(0,o.createRoot)(this[0]),this.setReactRoot(i)),i.render(a.default.createElement(n,{id:`share-draft-content-${r}`,links:{generateLink:this.data("url"),learnMore:this.data("helpurl")}}))},onunmatch(){const e=this.getReactRoot();e&&(e.unmount(),this.setReactRoot(null))}})}))},745:function(e,t,n){var r=n(394);t.createRoot=r.createRoot,t.hydrateRoot=r.hydrateRoot},648:function(e){e.exports=Injector},875:function(e){e.exports=IsomorphicFetch},86:function(e){e.exports=PropTypes},363:function(e){e.exports=React},394:function(e){e.exports=ReactDom},820:function(e){e.exports=classnames},754:function(e){e.exports=i18n},311:function(e){e.exports=jQuery}},t={};function n(r){var a=t[r];if(void 0!==a)return a.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}n(578),n(274)}(); \ No newline at end of file +!function(){"use strict";var e={274:function(e,t,n){var r,a=(r=n(521))&&r.__esModule?r:{default:r};window.document.addEventListener("DOMContentLoaded",(()=>{(0,a.default)()}))},521:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=o(n(648)),a=o(n(66));function o(e){return e&&e.__esModule?e:{default:e}}t.default=()=>{r.default.component.registerMany({ShareDraftContent:a.default})}},66:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=u(t);if(n&&n.has(e))return n.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var l=a?Object.getOwnPropertyDescriptor(e,o):null;l&&(l.get||l.set)?Object.defineProperty(r,o,l):r[o]=e[o]}r.default=e,n&&n.set(e,r);return r}(n(363)),a=d(n(86)),o=d(n(820)),l=d(n(754)),i=d(n(875)),s=n(648);function d(e){return e&&e.__esModule?e:{default:e}}function u(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(u=function(e){return e?n:t})(e)}class f extends r.Component{constructor(e){super(e),this.state={error:null,isLoaded:!1,previewUrl:l.default._t("ShareDraftContent.LOADING","Loading...")},this.handleToggle=this.handleToggle.bind(this)}handleInputChange(){}handleToggle(){const{isLoaded:e}=this.state;e?this.selectLink():this.generateShareDraftLink()}generateShareDraftLink(){const{links:{generateLink:e}}=this.props;return(0,i.default)(e,{credentials:"same-origin"}).then((e=>e.text())).then((e=>{this.setState({isLoaded:!0,previewUrl:e}),this.selectLink()}),(()=>{this.setState({error:!0})}))}selectLink(){this.linkRef&&this.linkRef.select()}renderError(){const{error:e}=this.state;return e?r.default.createElement("div",{className:"alert alert-danger"},l.default._t("ShareDraftContent.FETCH_ERROR","There was a problem generating the shareable link!")):null}renderHelp(){const{links:{learnMore:e}}=this.props;return r.default.createElement("p",null,l.default._t("ShareDraftContent.DESCRIPTION","Anyone with this link can view the draft version of this page.")," ",e&&r.default.createElement("a",{href:e,className:"share-draft-content__learn-more",target:"_blank",rel:"noopener noreferrer"},l.default._t("ShareDraftContent.LEARN_MORE","Learn more")))}renderLink(){const{previewUrl:e}=this.state;return r.default.createElement("div",{className:"share-draft-content__link-container"},r.default.createElement("input",{type:"text",className:"share-draft-content__link form-control no-change-track",title:l.default._t("ShareDraftContent.LINK_HELP","Link to share draft content"),value:e,onChange:this.handleInputChange,ref:e=>{this.linkRef=e},readOnly:!0}))}render(){const{id:e,PopoverField:t,className:n,button:a,popover:l}=this.props,i={id:e,buttonClassName:a.className,title:a.title,data:{popoverTitle:l.title,buttonTooltip:a.tooltip,placement:"top"},toggleCallback:this.handleToggle},s=(0,o.default)("share-draft-content__container",n);return r.default.createElement("div",{className:s},r.default.createElement(t,i,this.renderError(),this.renderHelp(),this.renderLink()))}}t.Component=f,f.propTypes={id:a.default.string.isRequired,className:a.default.string,button:a.default.shape({className:a.default.string,title:a.default.string,tooltip:a.default.string}),popover:a.default.shape({title:a.default.string}),links:a.default.shape({generateLink:a.default.string.isRequired,learnMore:a.default.string}),PopoverField:a.default.oneOfType([a.default.node,a.default.func]).isRequired},f.defaultProps={id:"share-draft-content",button:{className:"font-icon-share",title:l.default._t("ShareDraftContent.SHARE","Share"),tooltip:l.default._t("ShareDraftContent.SHARE_DRAFT_CONTENT","Share draft content")},popover:{title:l.default._t("ShareDraftContent.SHARE_DRAFT_CONTENT","Share draft content")},links:{learnMore:""},popoverIcon:"font-icon-share"};var c=(0,s.inject)(["PopoverField"])(f);t.default=c},578:function(e,t,n){var r=i(n(311)),a=i(n(363)),o=n(691),l=n(648);function i(e){return e&&e.__esModule?e:{default:e}}r.default.entwine("ss",(e=>{e(".js-injector-boot .share-draft-content__placeholder").entwine({ReactRoot:null,onmatch(){const e=this.closest(".cms-content").attr("id"),t=e?{context:e}:{},n=(0,l.loadComponent)("ShareDraftContent",t),r=this.closest(".cms-preview").length>0?"preview":"edit";let i=this.getReactRoot();i||(i=(0,o.createRoot)(this[0]),this.setReactRoot(i)),i.render(a.default.createElement(n,{id:`share-draft-content-${r}`,links:{generateLink:this.data("url"),learnMore:this.data("helpurl")}}))},onunmatch(){const e=this.getReactRoot();e&&(e.unmount(),this.setReactRoot(null))}})}))},648:function(e){e.exports=Injector},875:function(e){e.exports=IsomorphicFetch},86:function(e){e.exports=PropTypes},363:function(e){e.exports=React},691:function(e){e.exports=ReactDomClient},820:function(e){e.exports=classnames},754:function(e){e.exports=i18n},311:function(e){e.exports=jQuery}},t={};function n(r){var a=t[r];if(void 0!==a)return a.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}n(578),n(274)}(); \ No newline at end of file diff --git a/package.json b/package.json index b6d3f7f..1cf44be 100644 --- a/package.json +++ b/package.json @@ -33,8 +33,8 @@ "react-dom": "18.2.0" }, "devDependencies": { - "@silverstripe/eslint-config": "^1.0.0-alpha6", - "@silverstripe/webpack-config": "^2.0.0-alpha5", + "@silverstripe/eslint-config": "^1.0.0", + "@silverstripe/webpack-config": "^2.0.0", "webpack": "^5.74.0", "webpack-cli": "^5.0.0" }, diff --git a/yarn.lock b/yarn.lock index 8708b0d..89a7a33 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1282,10 +1282,10 @@ resolved "https://registry.yarnpkg.com/@sect/modernizr-loader/-/modernizr-loader-1.0.3.tgz#7fd8cec372426c53f113f3cfd9344cb29e959825" integrity sha512-47zKwv4/1I0CYptZz8s4aSYSe0awmuyqa+HFKxN89/75h2q8hr6V752TZ9VjhGDhQ4gU0EU7Plew7b+7bf2crg== -"@silverstripe/eslint-config@^1.0.0-alpha6": - version "1.0.0-alpha6" - resolved "https://registry.yarnpkg.com/@silverstripe/eslint-config/-/eslint-config-1.0.0-alpha6.tgz#1f243b003fddf3503a4abea37f35a8a5968cc96e" - integrity sha512-+P7UzhMRSmc7UlRYCiSXwjauLFYU11oBPwHl/bpacJ7xUcFY3Jt3CgcDt6d+XLvAJO8zMRsG9RcOm5MnxsyCsg== +"@silverstripe/eslint-config@^1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@silverstripe/eslint-config/-/eslint-config-1.0.0.tgz#dcf3f9cf2158bb587d8048a7c2860c0513221d40" + integrity sha512-pcHzB+6KWd8BPStBhHM8achdNY/Yj1p3WSTEs/CSw61VRcfBfg5GZECtvEerTSX/0ZeawAM1ABvstIAYihcfAg== dependencies: eslint "^8.26.0" eslint-config-airbnb "^19.0.4" @@ -1295,10 +1295,10 @@ eslint-plugin-react "^7.31.10" eslint-webpack-plugin "^3.2.0" -"@silverstripe/webpack-config@^2.0.0-alpha5": - version "2.0.0-alpha7" - resolved "https://registry.yarnpkg.com/@silverstripe/webpack-config/-/webpack-config-2.0.0-alpha7.tgz#c825f30fa0991222ac3e89a114bdc4cca2b2c254" - integrity sha512-XkqdnED1E072QXxFSovP8KrJuVtZGIeW9fLMdLI8tJwzf6651ziwYFWYwep72C0Eb+jpUabxNQl7eqlAHO52xA== +"@silverstripe/webpack-config@^2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@silverstripe/webpack-config/-/webpack-config-2.0.0.tgz#278a72a1adbc6fa2362497d60424c78fba58e8e1" + integrity sha512-m1qGRxlsdhWL567cWe7IZNBUCzeyg3T1Y9yY9Y6XClwAqlg1oIO9uLfvfauA4dbtECrzU5n1AkaaU6kMRtN6Aw== dependencies: "@babel/core" "^7.19.6" "@babel/preset-env" "^7.19.4"