From 04a8817d80f3dba08672c74b38689ee610de913e Mon Sep 17 00:00:00 2001 From: Jussiles Date: Tue, 28 Mar 2023 09:08:58 +0300 Subject: [PATCH 1/3] UHF-8101: UHF-8101: remove custom hook that fixes normalize style issues. --- .../linkedevents/containers/SearchContainer.tsx | 3 --- .../removeHdsNormalizeStyleElementFromDom.tsx | 14 -------------- 2 files changed, 17 deletions(-) delete mode 100644 src/js/react/common/hooks/removeHdsNormalizeStyleElementFromDom.tsx diff --git a/src/js/react/apps/linkedevents/containers/SearchContainer.tsx b/src/js/react/apps/linkedevents/containers/SearchContainer.tsx index 23bb39b3a..8275f9305 100644 --- a/src/js/react/apps/linkedevents/containers/SearchContainer.tsx +++ b/src/js/react/apps/linkedevents/containers/SearchContainer.tsx @@ -4,7 +4,6 @@ import ResultsContainer from './ResultsContainer'; import FormContainer from './FormContainer'; import type Event from '../types/Event'; import { initialUrlAtom, urlAtom, initialParamsAtom, paramsAtom } from '../store'; -import removeHdsNormalizeStyleElementFromDom from '@/react/common/hooks/removeHdsNormalizeStyleElementFromDom'; type ResponseType = { data: Event[]; @@ -34,8 +33,6 @@ const SearchContainer = () => { setParams(new URLSearchParams(initialParams.toString())); } - removeHdsNormalizeStyleElementFromDom(); - const getEvents = async (reqUrl: string): Promise => { const response = await fetch(reqUrl); diff --git a/src/js/react/common/hooks/removeHdsNormalizeStyleElementFromDom.tsx b/src/js/react/common/hooks/removeHdsNormalizeStyleElementFromDom.tsx deleted file mode 100644 index b1d7b76cf..000000000 --- a/src/js/react/common/hooks/removeHdsNormalizeStyleElementFromDom.tsx +++ /dev/null @@ -1,14 +0,0 @@ -import { useLayoutEffect } from 'react'; - -const removeHdsNormalizeStyleElementFromDom = () => { - useLayoutEffect(() => { - const styleElements = document.querySelectorAll('style'); - Object.keys(styleElements).forEach((key: any) => { - if (styleElements[key].innerHTML.startsWith('/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */')) { - styleElements[key].remove(); - } - }); - }); -}; - -export default removeHdsNormalizeStyleElementFromDom; From ca65a3054abc862464ef5f74be78cd1dc6fe84a3 Mon Sep 17 00:00:00 2001 From: Jussiles Date: Tue, 28 Mar 2023 09:09:29 +0300 Subject: [PATCH 2/3] UHF-8101: UHF-8101: add dist --- dist/js/linkedevents.min.js | 2 +- dist/js/school-search.min.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/js/linkedevents.min.js b/dist/js/linkedevents.min.js index 63a28e01a..1ea99161a 100644 --- a/dist/js/linkedevents.min.js +++ b/dist/js/linkedevents.min.js @@ -1 +1 @@ -!function(){var e={296:function(e){function t(e,t,n){var r,o,a,i,l;function s(){var u=Date.now()-i;u=0?r=setTimeout(s,t-u):(r=null,n||(l=e.apply(a,o),a=o=null))}null==t&&(t=100);var u=function(){a=this,o=arguments,i=Date.now();var u=n&&!r;return r||(r=setTimeout(s,t)),u&&(l=e.apply(a,o),a=o=null),l};return u.clear=function(){r&&(clearTimeout(r),r=null)},u.flush=function(){r&&(l=e.apply(a,o),a=o=null,clearTimeout(r),r=null)},u}t.debounce=t,e.exports=t},9960:function(e,t){"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.Doctype=t.CDATA=t.Tag=t.Style=t.Script=t.Comment=t.Directive=t.Text=t.Root=t.isTag=t.ElementType=void 0,function(e){e.Root="root",e.Text="text",e.Directive="directive",e.Comment="comment",e.Script="script",e.Style="style",e.Tag="tag",e.CDATA="cdata",e.Doctype="doctype"}(n=t.ElementType||(t.ElementType={})),t.isTag=function(e){return e.type===n.Tag||e.type===n.Script||e.type===n.Style},t.Root=n.Root,t.Text=n.Text,t.Directive=n.Directive,t.Comment=n.Comment,t.Script=n.Script,t.Style=n.Style,t.Tag=n.Tag,t.CDATA=n.CDATA,t.Doctype=n.Doctype},7915:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.DomHandler=void 0;var a=n(9960),i=n(7790);o(n(7790),t);var l=/\s+/g,s={normalizeWhitespace:!1,withStartIndices:!1,withEndIndices:!1,xmlMode:!1},u=function(){function e(e,t,n){this.dom=[],this.root=new i.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null,"function"==typeof t&&(n=t,t=s),"object"==typeof e&&(t=e,e=void 0),this.callback=null!=e?e:null,this.options=null!=t?t:s,this.elementCB=null!=n?n:null}return e.prototype.onparserinit=function(e){this.parser=e},e.prototype.onreset=function(){this.dom=[],this.root=new i.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null},e.prototype.onend=function(){this.done||(this.done=!0,this.parser=null,this.handleCallback(null))},e.prototype.onerror=function(e){this.handleCallback(e)},e.prototype.onclosetag=function(){this.lastNode=null;var e=this.tagStack.pop();this.options.withEndIndices&&(e.endIndex=this.parser.endIndex),this.elementCB&&this.elementCB(e)},e.prototype.onopentag=function(e,t){var n=this.options.xmlMode?a.ElementType.Tag:void 0,r=new i.Element(e,t,void 0,n);this.addNode(r),this.tagStack.push(r)},e.prototype.ontext=function(e){var t=this.options.normalizeWhitespace,n=this.lastNode;if(n&&n.type===a.ElementType.Text)t?n.data=(n.data+e).replace(l," "):n.data+=e,this.options.withEndIndices&&(n.endIndex=this.parser.endIndex);else{t&&(e=e.replace(l," "));var r=new i.Text(e);this.addNode(r),this.lastNode=r}},e.prototype.oncomment=function(e){if(this.lastNode&&this.lastNode.type===a.ElementType.Comment)this.lastNode.data+=e;else{var t=new i.Comment(e);this.addNode(t),this.lastNode=t}},e.prototype.oncommentend=function(){this.lastNode=null},e.prototype.oncdatastart=function(){var e=new i.Text(""),t=new i.NodeWithChildren(a.ElementType.CDATA,[e]);this.addNode(t),e.parent=t,this.lastNode=e},e.prototype.oncdataend=function(){this.lastNode=null},e.prototype.onprocessinginstruction=function(e,t){var n=new i.ProcessingInstruction(e,t);this.addNode(n)},e.prototype.handleCallback=function(e){if("function"==typeof this.callback)this.callback(e,this.dom);else if(e)throw e},e.prototype.addNode=function(e){var t=this.tagStack[this.tagStack.length-1],n=t.children[t.children.length-1];this.options.withStartIndices&&(e.startIndex=this.parser.startIndex),this.options.withEndIndices&&(e.endIndex=this.parser.endIndex),t.children.push(e),n&&(e.prev=n,n.next=e),e.parent=t,this.lastNode=null},e}();t.DomHandler=u,t.default=u},7790:function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),a=this&&this.__assign||function(){return a=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0?this.children[this.children.length-1]:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"childNodes",{get:function(){return this.children},set:function(e){this.children=e},enumerable:!1,configurable:!0}),t}(s);t.NodeWithChildren=h;var p=function(e){function t(t){return e.call(this,i.ElementType.Root,t)||this}return o(t,e),t}(h);t.Document=p;var m=function(e){function t(t,n,r,o){void 0===r&&(r=[]),void 0===o&&(o="script"===t?i.ElementType.Script:"style"===t?i.ElementType.Style:i.ElementType.Tag);var a=e.call(this,o,r)||this;return a.name=t,a.attribs=n,a}return o(t,e),Object.defineProperty(t.prototype,"tagName",{get:function(){return this.name},set:function(e){this.name=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"attributes",{get:function(){var e=this;return Object.keys(this.attribs).map((function(t){var n,r;return{name:t,value:e.attribs[t],namespace:null===(n=e["x-attribsNamespace"])||void 0===n?void 0:n[t],prefix:null===(r=e["x-attribsPrefix"])||void 0===r?void 0:r[t]}}))},enumerable:!1,configurable:!0}),t}(h);function g(e){return(0,i.isTag)(e)}function v(e){return e.type===i.ElementType.CDATA}function b(e){return e.type===i.ElementType.Text}function _(e){return e.type===i.ElementType.Comment}function y(e){return e.type===i.ElementType.Directive}function w(e){return e.type===i.ElementType.Root}function x(e,t){var n;if(void 0===t&&(t=!1),b(e))n=new c(e.data);else if(_(e))n=new d(e.data);else if(g(e)){var r=t?k(e.children):[],o=new m(e.name,a({},e.attribs),r);r.forEach((function(e){return e.parent=o})),null!=e.namespace&&(o.namespace=e.namespace),e["x-attribsNamespace"]&&(o["x-attribsNamespace"]=a({},e["x-attribsNamespace"])),e["x-attribsPrefix"]&&(o["x-attribsPrefix"]=a({},e["x-attribsPrefix"])),n=o}else if(v(e)){r=t?k(e.children):[];var l=new h(i.ElementType.CDATA,r);r.forEach((function(e){return e.parent=l})),n=l}else if(w(e)){r=t?k(e.children):[];var s=new p(r);r.forEach((function(e){return e.parent=s})),e["x-mode"]&&(s["x-mode"]=e["x-mode"]),n=s}else{if(!y(e))throw new Error("Not implemented yet: ".concat(e.type));var u=new f(e.name,e.data);null!=e["x-name"]&&(u["x-name"]=e["x-name"],u["x-publicId"]=e["x-publicId"],u["x-systemId"]=e["x-systemId"]),n=u}return n.startIndex=e.startIndex,n.endIndex=e.endIndex,null!=e.sourceCodeLocation&&(n.sourceCodeLocation=e.sourceCodeLocation),n}function k(e){for(var t=e.map((function(e){return x(e,!0)})),n=1;n/i,i=//i,l=function(){throw new Error("This browser does not support `document.implementation.createHTMLDocument`")},s=function(){throw new Error("This browser does not support `DOMParser.prototype.parseFromString`")},u="object"==typeof window&&window.DOMParser;if("function"==typeof u){var c=new u;l=s=function(e,t){return t&&(e="<"+t+">"+e+""),c.parseFromString(e,"text/html")}}if("object"==typeof document&&document.implementation){var d=document.implementation.createHTMLDocument();l=function(e,t){return t?(d.documentElement.querySelector(t).innerHTML=e,d):(d.documentElement.innerHTML=e,d)}}var f,h="object"==typeof document?document.createElement("template"):{};h.content&&(f=function(e){return h.innerHTML=e,h.content.childNodes}),e.exports=function(e){var u,c,d,h,p=e.match(o);switch(p&&p[1]&&(u=p[1].toLowerCase()),u){case t:return c=s(e),a.test(e)||(d=c.querySelector(n))&&d.parentNode.removeChild(d),i.test(e)||(d=c.querySelector(r))&&d.parentNode.removeChild(d),c.querySelectorAll(t);case n:case r:return h=(c=l(e)).querySelectorAll(u),i.test(e)&&a.test(e)?h[0].parentNode.childNodes:h;default:return f?f(e):(d=l(e,r).querySelector(r)).childNodes}}},4152:function(e,t,n){var r=n(8276),o=n(1507).formatDOM,a=/<(![a-zA-Z\s]+)>/;e.exports=function(e){if("string"!=typeof e)throw new TypeError("First argument must be a string");if(""===e)return[];var t,n=e.match(a);return n&&n[1]&&(t=n[1]),o(r(e),null,t)}},1507:function(e,t,n){for(var r,o=n(7915),a=n(885).CASE_SENSITIVE_TAG_NAMES,i=o.Comment,l=o.Element,s=o.ProcessingInstruction,u=o.Text,c={},d=0,f=a.length;d1&&(c=p(c,{key:c.key||y})),v.push(c);else if("text"!==a.type){switch(d=a.attribs,s(a)?i(d.style,d):d&&(d=o(d)),f=null,a.type){case"script":case"style":a.children[0]&&(d.dangerouslySetInnerHTML={__html:a.children[0].data});break;case"tag":"textarea"===a.name&&a.children[0]?d.defaultValue=a.children[0].data:a.children&&a.children.length&&(f=e(a.children,n));break;default:continue}w>1&&(d.key=y),v.push(m(a.name,d,f))}else{if((u=!a.data.trim().length)&&a.parent&&!l(a.parent))continue;if(_&&u)continue;v.push(a.data)}return 1===v.length?v[0]:v}},4606:function(e,t,n){var r=n(7294),o=n(1476).default;var a={reactCompat:!0};var i=r.version.split(".")[0]>=16,l=new Set(["tr","tbody","thead","tfoot","colgroup","table","head","html","frameset"]);e.exports={PRESERVE_CUSTOM_ATTRIBUTES:i,invertObject:function(e,t){if(!e||"object"!=typeof e)throw new TypeError("First argument must be an object");var n,r,o="function"==typeof t,a={},i={};for(n in e)r=e[n],o&&(a=t(n,r))&&2===a.length?i[a[0]]=a[1]:"string"==typeof r&&(i[r]=n);return i},isCustomComponent:function(e,t){if(-1===e.indexOf("-"))return t&&"string"==typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}},setStyleProp:function(e,t){if(null!=e)try{t.style=o(e,a)}catch(e){t.style={}}},canTextBeChildOfNode:function(e){return!l.has(e.name)},elementsWithNoTextChildren:l}},8139:function(e){var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,r=/^\s*/,o=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,a=/^:\s*/,i=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,s=/^\s+|\s+$/g,u="";function c(e){return e?e.replace(s,u):u}e.exports=function(e,s){if("string"!=typeof e)throw new TypeError("First argument must be a string");if(!e)return[];s=s||{};var d=1,f=1;function h(e){var t=e.match(n);t&&(d+=t.length);var r=e.lastIndexOf("\n");f=~r?e.length-r:f+e.length}function p(){var e={line:d,column:f};return function(t){return t.position=new m(e),_(),t}}function m(e){this.start=e,this.end={line:d,column:f},this.source=s.source}m.prototype.content=e;var g=[];function v(t){var n=new Error(s.source+":"+d+":"+f+": "+t);if(n.reason=t,n.filename=s.source,n.line=d,n.column=f,n.source=e,!s.silent)throw n;g.push(n)}function b(t){var n=t.exec(e);if(n){var r=n[0];return h(r),e=e.slice(r.length),n}}function _(){b(r)}function y(e){var t;for(e=e||[];t=w();)!1!==t&&e.push(t);return e}function w(){var t=p();if("/"==e.charAt(0)&&"*"==e.charAt(1)){for(var n=2;u!=e.charAt(n)&&("*"!=e.charAt(n)||"/"!=e.charAt(n+1));)++n;if(n+=2,u===e.charAt(n-1))return v("End of comment missing");var r=e.slice(2,n-2);return f+=2,h(r),e=e.slice(n),f+=2,t({type:"comment",comment:r})}}function x(){var e=p(),n=b(o);if(n){if(w(),!b(a))return v("property missing ':'");var r=b(i),s=e({type:"declaration",property:c(n[0].replace(t,u)),value:r?c(r[0].replace(t,u)):u});return b(l),s}}return _(),function(){var e,t=[];for(y(t);e=x();)!1!==e&&(t.push(e),y(t));return t}()}},2307:function(e,t,n){e=n.nmd(e);var r="__lodash_hash_undefined__",o=9007199254740991,a="[object Arguments]",i="[object Array]",l="[object Boolean]",s="[object Date]",u="[object Error]",c="[object Function]",d="[object Map]",f="[object Number]",h="[object Object]",p="[object Promise]",m="[object RegExp]",g="[object Set]",v="[object String]",b="[object Symbol]",_="[object WeakMap]",y="[object ArrayBuffer]",w="[object DataView]",x=/^\[object .+?Constructor\]$/,k=/^(?:0|[1-9]\d*)$/,S={};S["[object Float32Array]"]=S["[object Float64Array]"]=S["[object Int8Array]"]=S["[object Int16Array]"]=S["[object Int32Array]"]=S["[object Uint8Array]"]=S["[object Uint8ClampedArray]"]=S["[object Uint16Array]"]=S["[object Uint32Array]"]=!0,S[a]=S[i]=S[y]=S[l]=S[w]=S[s]=S[u]=S[c]=S[d]=S[f]=S[h]=S[m]=S[g]=S[v]=S[_]=!1;var E="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,C="object"==typeof self&&self&&self.Object===Object&&self,T=E||C||Function("return this")(),O=t&&!t.nodeType&&t,I=O&&e&&!e.nodeType&&e,M=I&&I.exports===O,D=M&&E.process,N=function(){try{return D&&D.binding&&D.binding("util")}catch(e){}}(),z=N&&N.isTypedArray;function j(e,t){for(var n=-1,r=null==e?0:e.length;++nl))return!1;var u=a.get(e);if(u&&a.get(t))return u==t;var c=-1,d=!0,f=2&n?new ye:void 0;for(a.set(e,t),a.set(t,e);++c-1},be.prototype.set=function(e,t){var n=this.__data__,r=ke(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},_e.prototype.clear=function(){this.size=0,this.__data__={hash:new ve,map:new(ae||be),string:new ve}},_e.prototype.delete=function(e){var t=De(this,e).delete(e);return this.size-=t?1:0,t},_e.prototype.get=function(e){return De(this,e).get(e)},_e.prototype.has=function(e){return De(this,e).has(e)},_e.prototype.set=function(e,t){var n=De(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},ye.prototype.add=ye.prototype.push=function(e){return this.__data__.set(e,r),this},ye.prototype.has=function(e){return this.__data__.has(e)},we.prototype.clear=function(){this.__data__=new be,this.size=0},we.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},we.prototype.get=function(e){return this.__data__.get(e)},we.prototype.has=function(e){return this.__data__.has(e)},we.prototype.set=function(e,t){var n=this.__data__;if(n instanceof be){var r=n.__data__;if(!ae||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new _e(r)}return n.set(e,t),this.size=n.size,this};var ze=te?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var n=-1,r=null==e?0:e.length,o=0,a=[];++n-1&&e%1==0&&e-1&&e%1==0&&e<=o}function Ue(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function We(e){return null!=e&&"object"==typeof e}var $e=z?function(e){return function(t){return e(t)}}(z):function(e){return We(e)&&Ve(e.length)&&!!S[Se(e)]};function qe(e){return null!=(t=e)&&Ve(t.length)&&!Be(t)?xe(e):Oe(e);var t}e.exports=function(e,t){return Ce(e,t)}},8423:function(e,t,n){var r="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,o="object"==typeof self&&self&&self.Object===Object&&self,a=r||o||Function("return this")(),i=Object.prototype,l=i.hasOwnProperty,s=i.toString,u=a.Symbol,c=u?u.toStringTag:void 0;function d(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":c&&c in Object(e)?function(e){var t=l.call(e,c),n=e[c];try{e[c]=void 0;var r=!0}catch(e){}var o=s.call(e);r&&(t?e[c]=n:delete e[c]);return o}(e):function(e){return s.call(e)}(e)}e.exports=function(e){if(!function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}(e))return!1;var t=d(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},4461:function(e,t,n){var r="[object Symbol]",o="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,a="object"==typeof self&&self&&self.Object===Object&&self,i=o||a||Function("return this")(),l=Object.prototype,s=0,u=l.toString,c=i.Symbol,d=c?c.prototype:void 0,f=d?d.toString:void 0;function h(e){if("string"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&u.call(e)==r}(e))return f?f.call(e):"";var t=e+"";return"0"==t&&1/e==-Infinity?"-0":t}e.exports=function(e){var t,n=++s;return(null==(t=e)?"":h(t))+n}},7418:function(e){"use strict";var t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;function o(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,a){for(var i,l,s=o(e),u=1;u