From 9e2ee936233abba78338758534c03f21e6c2dd13 Mon Sep 17 00:00:00 2001 From: juanmitriatti Date: Mon, 9 Jan 2023 20:05:12 -0300 Subject: [PATCH 1/2] WS2-1237: Sending showBorders prop to React Card componenets. --- js/component-card-arrangement.js | 1 + js/component-card.js | 1 + src/Utils/ReactComponentHelperFunctions.php | 5 +++++ 3 files changed, 7 insertions(+) diff --git a/js/component-card-arrangement.js b/js/component-card-arrangement.js index 94a92c1..72d125a 100644 --- a/js/component-card-arrangement.js +++ b/js/component-card-arrangement.js @@ -31,6 +31,7 @@ linkLabel: card.linkLabel, linkUrl: card.linkUrl, tags: card.tags, + showBorders: card.showBorders, }, }); }); diff --git a/js/component-card.js b/js/component-card.js index 1241783..baf0115 100644 --- a/js/component-card.js +++ b/js/component-card.js @@ -30,6 +30,7 @@ linkLabel: card.linkLabel, linkUrl: card.linkUrl, tags: card.tags, + showBorders: card.showBorders, }, }); diff --git a/src/Utils/ReactComponentHelperFunctions.php b/src/Utils/ReactComponentHelperFunctions.php index b01a55a..cf59958 100644 --- a/src/Utils/ReactComponentHelperFunctions.php +++ b/src/Utils/ReactComponentHelperFunctions.php @@ -137,6 +137,11 @@ public function getCardContent($paragraph) { $card->clickHref = $link->toString(); } + $card->showBorders = false; + if ($paragraph->field_show_borders && $paragraph->field_show_borders->value) { + $card->showBorders = true; + } + $settings = []; $settings['components']['card'][$id] = $card; From 6f32d5b4bb010421123500f9546f7e16113bf5cd Mon Sep 17 00:00:00 2001 From: mlsamuelson Date: Tue, 31 Jan 2023 09:32:20 -0700 Subject: [PATCH 2/2] WS2-1237 switch to new packages --- .gitignore | 19 + asu_react_core.libraries.yml | 8 +- .../dist/asuCarousel.umd.js | 2 - .../component-carousel/dist/vendor.umd.js | 2 - .../components-core/dist/libCore.umd.js | 226 - .../dist/asuCarousel.umd.js | 1 + .../component-carousel/dist/vendor.umd.js | 2 + .../@asu/components-core/dist/libCore.umd.js | 226 + package.json | 4 +- yarn.lock | 5266 +++++++++-------- 10 files changed, 2973 insertions(+), 2783 deletions(-) delete mode 100644 node_modules/@asu-design-system/component-carousel/dist/asuCarousel.umd.js delete mode 100644 node_modules/@asu-design-system/component-carousel/dist/vendor.umd.js delete mode 100644 node_modules/@asu-design-system/components-core/dist/libCore.umd.js create mode 100644 node_modules/@asu/component-carousel/dist/asuCarousel.umd.js create mode 100644 node_modules/@asu/component-carousel/dist/vendor.umd.js create mode 100644 node_modules/@asu/components-core/dist/libCore.umd.js diff --git a/.gitignore b/.gitignore index fb7f221..aea5d32 100644 --- a/.gitignore +++ b/.gitignore @@ -18,5 +18,24 @@ node_modules/@asu-design-system/components-core/* node_modules/@asu-design-system/components-core/dist/* !node_modules/@asu-design-system/components-core/dist/libCore.min.js !node_modules/@asu-design-system/components-core/dist/libCore.umd.js + +!node_modules/@asu +node_modules/@asu/* +!node_modules/@asu/component-carousel +node_modules/@asu/component-carousel/* +!node_modules/@asu/component-carousel/dist +node_modules/@asu/component-carousel/dist/* +!node_modules/@asu/component-carousel/dist/carousel.production.js +!node_modules/@asu/component-carousel/dist/core.production.js +!node_modules/@asu/component-carousel/dist/vendor.production.js +!node_modules/@asu/component-carousel/dist/asuCarousel.umd.js +!node_modules/@asu/component-carousel/dist/vendor.umd.js +!node_modules/@asu/components-core +node_modules/@asu/components-core/* +!node_modules/@asu/components-core/dist +node_modules/@asu/components-core/dist/* +!node_modules/@asu/components-core/dist/libCore.min.js +!node_modules/@asu/components-core/dist/libCore.umd.js + .idea/ .DS_Store diff --git a/asu_react_core.libraries.yml b/asu_react_core.libraries.yml index b018a0d..844962c 100644 --- a/asu_react_core.libraries.yml +++ b/asu_react_core.libraries.yml @@ -6,14 +6,14 @@ react-core: - core/drupalSettings - asu_react_integration/reactjs js: - node_modules/@asu-design-system/components-core/dist/libCore.umd.js: {} + node_modules/@asu/components-core/dist/libCore.umd.js: {} react-carousel: version: 0.0.1 dependencies: - asu_react_core/react-core js: - node_modules/@asu-design-system/component-carousel/dist/vendor.umd.js: { } - node_modules/@asu-design-system/component-carousel/dist/asuCarousel.umd.js: {} + node_modules/@asu/component-carousel/dist/vendor.umd.js: { } + node_modules/@asu/component-carousel/dist/asuCarousel.umd.js: {} testimonial-carousel: version: 0.0.1 dependencies: @@ -61,4 +61,4 @@ testimonial-on-image-background: dependencies: - asu_react_core/react-core js: - js/testimonial-on-image-background.js: { } \ No newline at end of file + js/testimonial-on-image-background.js: { } diff --git a/node_modules/@asu-design-system/component-carousel/dist/asuCarousel.umd.js b/node_modules/@asu-design-system/component-carousel/dist/asuCarousel.umd.js deleted file mode 100644 index 73a0b98..0000000 --- a/node_modules/@asu-design-system/component-carousel/dist/asuCarousel.umd.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! For license information please see asuCarousel.umd.js.LICENSE.txt */ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("AsuWebCarousel",[],t):"object"==typeof exports?exports.AsuWebCarousel=t():e.AsuWebCarousel=t()}(self,(function(){return(()=>{"use strict";var e,t={235:(e,t,n)=>{n.r(t),n.d(t,{CardCarousel:()=>le,ImageCarousel:()=>se,ImageGalleryCarousel:()=>pe,TestimonialCarousel:()=>he,initCardCarousel:()=>be,initImageCarousel:()=>we,initImageGalleryCarousel:()=>ke,initTestimonialCarousel:()=>ye});var r,a,i,o,l,c,s,u,d,f,m,g=n(735),p=n(788),h=n(930),v=n(736),b=n(726),y=n(577),w=n(169),k=n(655),x=n(945),E=n.n(x),S=["label","cardTitle","ariaLabel","block","color","disabled","element","href","icon","innerRef","onClick","size","classes","target"],C=["label","cardTitle","ariaLabel","color","disabled","element","innerRef","href","onClick"];function _(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return O(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return O(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){l=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(l)throw i}}}}function O(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1?n-1:0),a=1;a/gm),q=o(/^data-[\-\w.\u00B7-\uFFFF]/),B=o(/^aria-[\-\w]+$/),U=o(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),H=o(/^(?:\w+script|data):/i),$=o(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),W="function"==typeof Symbol&&"symbol"==(0,k.Z)(Symbol.iterator)?function(e){return(0,k.Z)(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":(0,k.Z)(e)};function Z(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t0&&void 0!==arguments[0]?arguments[0]:V(),n=function(t){return e(t)};if(n.version="2.3.4",n.removed=[],!t||!t.document||9!==t.document.nodeType)return n.isSupported=!1,n;var r=t.document,a=t.document,o=t.DocumentFragment,l=t.HTMLTemplateElement,c=t.Node,s=t.Element,u=t.NodeFilter,d=t.NamedNodeMap,k=void 0===d?t.NamedNodeMap||t.MozNamedAttrMap:d,E=t.HTMLFormElement,Y=t.DOMParser,K=t.trustedTypes,X=s.prototype,Q=_(X,"cloneNode"),J=_(X,"nextSibling"),ee=_(X,"childNodes"),te=_(X,"parentNode");if("function"==typeof l){var ne=a.createElement("template");ne.content&&ne.content.ownerDocument&&(a=ne.content.ownerDocument)}var re=G(K,r),ae=re&&ze?re.createHTML(""):"",ie=a,oe=ie.implementation,le=ie.createNodeIterator,ce=ie.createDocumentFragment,se=ie.getElementsByTagName,ue=r.importNode,de={};try{de=C(a).documentMode?a.documentMode:{}}catch(e){}var fe={};n.isSupported="function"==typeof te&&oe&&void 0!==oe.createHTMLDocument&&9!==de;var me=D,ge=F,pe=q,he=B,ve=H,be=$,ye=U,we=null,ke=S({},[].concat(Z(O),Z(N),Z(T),Z(I),Z(P))),xe=null,Ee=S({},[].concat(Z(R),Z(j),Z(z),Z(M))),Se=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Ce=null,_e=null,Oe=!0,Ne=!0,Te=!1,Ae=!1,Ie=!1,Le=!1,Pe=!1,Re=!1,je=!1,ze=!1,Me=!0,De=!0,Fe=!1,qe={},Be=null,Ue=S({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),He=null,$e=S({},["audio","video","img","source","image","track"]),We=null,Ze=S({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ve="http://www.w3.org/1998/Math/MathML",Ge="http://www.w3.org/2000/svg",Ye="http://www.w3.org/1999/xhtml",Ke=Ye,Xe=!1,Qe=void 0,Je=["application/xhtml+xml","text/html"],et="text/html",tt=void 0,nt=null,rt=a.createElement("form"),at=function(e){return e instanceof RegExp||e instanceof Function},it=function(e){nt&&nt===e||(e&&"object"===(void 0===e?"undefined":W(e))||(e={}),e=C(e),we="ALLOWED_TAGS"in e?S({},e.ALLOWED_TAGS):ke,xe="ALLOWED_ATTR"in e?S({},e.ALLOWED_ATTR):Ee,We="ADD_URI_SAFE_ATTR"in e?S(C(Ze),e.ADD_URI_SAFE_ATTR):Ze,He="ADD_DATA_URI_TAGS"in e?S(C($e),e.ADD_DATA_URI_TAGS):$e,Be="FORBID_CONTENTS"in e?S({},e.FORBID_CONTENTS):Ue,Ce="FORBID_TAGS"in e?S({},e.FORBID_TAGS):{},_e="FORBID_ATTR"in e?S({},e.FORBID_ATTR):{},qe="USE_PROFILES"in e&&e.USE_PROFILES,Oe=!1!==e.ALLOW_ARIA_ATTR,Ne=!1!==e.ALLOW_DATA_ATTR,Te=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Ae=e.SAFE_FOR_TEMPLATES||!1,Ie=e.WHOLE_DOCUMENT||!1,Re=e.RETURN_DOM||!1,je=e.RETURN_DOM_FRAGMENT||!1,ze=e.RETURN_TRUSTED_TYPE||!1,Pe=e.FORCE_BODY||!1,Me=!1!==e.SANITIZE_DOM,De=!1!==e.KEEP_CONTENT,Fe=e.IN_PLACE||!1,ye=e.ALLOWED_URI_REGEXP||ye,Ke=e.NAMESPACE||Ye,e.CUSTOM_ELEMENT_HANDLING&&at(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Se.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&at(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Se.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(Se.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Qe=Qe=-1===Je.indexOf(e.PARSER_MEDIA_TYPE)?et:e.PARSER_MEDIA_TYPE,tt="application/xhtml+xml"===Qe?function(e){return e}:p,Ae&&(Ne=!1),je&&(Re=!0),qe&&(we=S({},[].concat(Z(P))),xe=[],!0===qe.html&&(S(we,O),S(xe,R)),!0===qe.svg&&(S(we,N),S(xe,j),S(xe,M)),!0===qe.svgFilters&&(S(we,T),S(xe,j),S(xe,M)),!0===qe.mathMl&&(S(we,I),S(xe,z),S(xe,M))),e.ADD_TAGS&&(we===ke&&(we=C(we)),S(we,e.ADD_TAGS)),e.ADD_ATTR&&(xe===Ee&&(xe=C(xe)),S(xe,e.ADD_ATTR)),e.ADD_URI_SAFE_ATTR&&S(We,e.ADD_URI_SAFE_ATTR),e.FORBID_CONTENTS&&(Be===Ue&&(Be=C(Be)),S(Be,e.FORBID_CONTENTS)),De&&(we["#text"]=!0),Ie&&S(we,["html","head","body"]),we.table&&(S(we,["tbody"]),delete Ce.tbody),i&&i(e),nt=e)},ot=S({},["mi","mo","mn","ms","mtext"]),lt=S({},["foreignobject","desc","title","annotation-xml"]),ct=S({},N);S(ct,T),S(ct,A);var st=S({},I);S(st,L);var ut=function(e){var t=te(e);t&&t.tagName||(t={namespaceURI:Ye,tagName:"template"});var n=p(e.tagName),r=p(t.tagName);if(e.namespaceURI===Ge)return t.namespaceURI===Ye?"svg"===n:t.namespaceURI===Ve?"svg"===n&&("annotation-xml"===r||ot[r]):Boolean(ct[n]);if(e.namespaceURI===Ve)return t.namespaceURI===Ye?"math"===n:t.namespaceURI===Ge?"math"===n&<[r]:Boolean(st[n]);if(e.namespaceURI===Ye){if(t.namespaceURI===Ge&&!lt[r])return!1;if(t.namespaceURI===Ve&&!ot[r])return!1;var a=S({},["title","style","font","a","script"]);return!st[n]&&(a[n]||!ct[n])}return!1},dt=function(e){g(n.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){try{e.outerHTML=ae}catch(t){e.remove()}}},ft=function(e,t){try{g(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){g(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!xe[e])if(Re||je)try{dt(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},mt=function(e){var t=void 0,n=void 0;if(Pe)e=""+e;else{var r=h(e,/^[\r\n\t ]+/);n=r&&r[0]}"application/xhtml+xml"===Qe&&(e=''+e+"");var i=re?re.createHTML(e):e;if(Ke===Ye)try{t=(new Y).parseFromString(i,Qe)}catch(e){}if(!t||!t.documentElement){t=oe.createDocument(Ke,"template",null);try{t.documentElement.innerHTML=Xe?"":i}catch(e){}}var o=t.body||t.documentElement;return e&&n&&o.insertBefore(a.createTextNode(n),o.childNodes[0]||null),Ke===Ye?se.call(t,Ie?"html":"body")[0]:Ie?t.documentElement:o},gt=function(e){return le.call(e.ownerDocument||e,e,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT,null,!1)},pt=function(e){return e instanceof E&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof k)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore)},ht=function(e){return"object"===(void 0===c?"undefined":W(c))?e instanceof c:e&&"object"===(void 0===e?"undefined":W(e))&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},vt=function(e,t,r){fe[e]&&f(fe[e],(function(e){e.call(n,t,r,nt)}))},bt=function(e){var t=void 0;if(vt("beforeSanitizeElements",e,null),pt(e))return dt(e),!0;if(h(e.nodeName,/[\u0080-\uFFFF]/))return dt(e),!0;var r=tt(e.nodeName);if(vt("uponSanitizeElement",e,{tagName:r,allowedTags:we}),!ht(e.firstElementChild)&&(!ht(e.content)||!ht(e.content.firstElementChild))&&w(/<[/\w]/g,e.innerHTML)&&w(/<[/\w]/g,e.textContent))return dt(e),!0;if("select"===r&&w(/