From 735af4784f1d66de4beffb55d0630380f3ed6f23 Mon Sep 17 00:00:00 2001 From: jsampson Date: Thu, 22 Dec 2022 10:24:54 -0700 Subject: [PATCH] fix drupal asset fallback injections, update zod to pick up fix --- lib/components/NeonFooter/NeonFooter.js | 15 +- lib/components/NeonHeader/NeonHeader.js | 60 ++++++-- lib/components/NeonPage/NeonPage.js | 34 +++-- lib/images/svg/header-search.svg | 5 + lib/remoteAssets/drupal-header.html.d.ts | 2 +- lib/remoteAssets/drupal-header.html.js | 2 +- lib/remoteAssets/drupal-theme.css | 88 +++++++---- package-lock.json | 8 +- package.json | 2 +- .../components/NeonFooter/NeonFooter.jsx | 13 +- .../__snapshots__/NeonFooter.jsx.snap | 2 + .../components/NeonHeader/NeonHeader.jsx | 53 +++++-- .../__snapshots__/NeonHeader.jsx.snap | 14 +- .../components/NeonPage/NeonPage.jsx | 24 +-- .../__tests__/__snapshots__/NeonPage.jsx.snap | 142 +++++++++--------- .../images/svg/header-search.svg | 5 + .../remoteAssets/drupal-header.html.js | 2 +- .../remoteAssets/drupal-theme.css | 88 +++++++---- ....ABBY.DP1.00001.001.2018-12.30min.basic.js | 2 +- 19 files changed, 368 insertions(+), 193 deletions(-) create mode 100644 lib/images/svg/header-search.svg create mode 100644 src/lib_components/images/svg/header-search.svg diff --git a/lib/components/NeonFooter/NeonFooter.js b/lib/components/NeonFooter/NeonFooter.js index 718164a3..ff803cfc 100644 --- a/lib/components/NeonFooter/NeonFooter.js +++ b/lib/components/NeonFooter/NeonFooter.js @@ -8,10 +8,12 @@ exports.default = void 0; var _react = _interopRequireDefault(require("react")); var _propTypes = _interopRequireDefault(require("prop-types")); var _htmlReactParser = _interopRequireDefault(require("html-react-parser")); +var _styles = require("@material-ui/core/styles"); var _Skeleton = _interopRequireDefault(require("@material-ui/lab/Skeleton")); var _remoteAssetsMap = _interopRequireDefault(require("../../remoteAssetsMap/remoteAssetsMap")); var _drupalFooter = _interopRequireDefault(require("../../remoteAssets/drupal-footer.html")); var _NeonContext = _interopRequireWildcard(require("../NeonContext/NeonContext")); +var _Theme = _interopRequireDefault(require("../Theme/Theme")); function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -22,8 +24,18 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) { ; } } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } var DRUPAL_FOOTER_HTML = _remoteAssetsMap.default.DRUPAL_FOOTER_HTML.KEY; +var useStyles = (0, _styles.makeStyles)(function (theme) { + return { + footerContainer: { + '& .footer-bottom__wrapper': { + background: '#4B372E' + } + } + }; +}); var NeonFooter = function NeonFooter(props) { var drupalCssLoaded = props.drupalCssLoaded; + var classes = useStyles(_Theme.default); var _NeonContext$useNeonC = _NeonContext.default.useNeonContextState(), _NeonContext$useNeonC2 = _slicedToArray(_NeonContext$useNeonC, 1), _NeonContext$useNeonC3 = _NeonContext$useNeonC2[0], @@ -60,7 +72,8 @@ var NeonFooter = function NeonFooter(props) { case 'drupal-fallback': default: return /*#__PURE__*/_react.default.createElement("footer", { - id: "footer" + id: "footer", + className: classes.footerContainer }, (0, _htmlReactParser.default)(_drupalFooter.default)); } }; diff --git a/lib/components/NeonHeader/NeonHeader.js b/lib/components/NeonHeader/NeonHeader.js index ff776d9e..aba416de 100644 --- a/lib/components/NeonHeader/NeonHeader.js +++ b/lib/components/NeonHeader/NeonHeader.js @@ -18,11 +18,15 @@ var _NeonAuth = _interopRequireWildcard(require("../NeonAuth/NeonAuth")); var _NeonEnvironment = _interopRequireDefault(require("../NeonEnvironment/NeonEnvironment")); var _NeonContext = _interopRequireWildcard(require("../NeonContext/NeonContext")); var _ApplicationMenu = _interopRequireDefault(require("./ApplicationMenu")); +var _headerSearch = _interopRequireDefault(require("../../images/svg/header-search.svg")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } +function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; } function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } +function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } +function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } @@ -85,6 +89,11 @@ var useStyles = (0, _styles.makeStyles)(function (theme) { } }) }, + headerContainerFallback: { + '& li.siteSearch > a': { + background: "url('".concat(_headerSearch.default, "') center center no-repeat !important") + } + }, // Injecting these styles as a means of fixing up the search display // Ideally, this CSS comes from Drupal and is removed from here... headerContainer: (_headerContainer = { @@ -339,20 +348,44 @@ var NeonHeader = /*#__PURE__*/(0, _react.forwardRef)(function (props, headerRef) setHeaderJsStatus(_NeonContext.FETCH_STATUS.SUCCESS); }; script.onerror = function () { - setHeaderJsStatus(_NeonContext.FETCH_STATUS.ERROR); - // eslint-disable-next-line no-unused-expressions, import/extensions - Promise.resolve().then(function () { - return _interopRequireWildcard(require('../../remoteAssets/drupal-header.js')); - }); + _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() { + return _regeneratorRuntime().wrap(function _callee$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + _context.next = 2; + return Promise.resolve().then(function () { + return _interopRequireWildcard(require('../../remoteAssets/drupal-header.js')); + }); + case 2: + setHeaderJsStatus(_NeonContext.FETCH_STATUS.SUCCESS); + case 3: + case "end": + return _context.stop(); + } + } + }, _callee); + }))(); }; document.body.appendChild(script); - // TODO: verify header.js loaded and if not load the fallback }, [headerJsStatus, drupalCssLoaded, headerRenderDelayed, setHeaderJsStatus, renderMode]); // Delay the rendering of the drupal header one render cycle to allow the CSS to propogate into // the environment. This prevents a "flash" of the unstyled menu in the drupal header on page load + var appliedHtmlCheck = headerHTML; + switch (renderMode) { + case 'drupal': + appliedHtmlCheck = headerHTML; + break; + case 'drupal-fallback': + appliedHtmlCheck = _drupalHeader.default; + break; + case 'loading': + default: + break; + } (0, _react.useLayoutEffect)(function () { - if (neonContextIsActive && headerHTML && drupalCssLoaded && !headerRenderDelayed) { + if (neonContextIsActive && appliedHtmlCheck && drupalCssLoaded && !headerRenderDelayed) { var timeout = window.setTimeout(function () { return setHeaderRenderDelayed(true); }, 0); @@ -361,7 +394,7 @@ var NeonHeader = /*#__PURE__*/(0, _react.forwardRef)(function (props, headerRef) }; } return function () {}; - }, [neonContextIsActive, headerHTML, drupalCssLoaded, headerRenderDelayed]); + }, [neonContextIsActive, appliedHtmlCheck, drupalCssLoaded, headerRenderDelayed]); // Render Loading if (renderMode === 'loading') { @@ -371,7 +404,7 @@ var NeonHeader = /*#__PURE__*/(0, _react.forwardRef)(function (props, headerRef) className: classes.skeletonHeader }, /*#__PURE__*/_react.default.createElement(_Skeleton.default, { variant: "rect", - height: "".concat(belowLg ? 60 : 125, "px"), + height: "".concat(belowLg ? 60 : 120, "px"), width: "100%" })); } @@ -408,11 +441,18 @@ var NeonHeader = /*#__PURE__*/(0, _react.forwardRef)(function (props, headerRef) })); } }; + var appliedClassName = classes.headerContainer; + if (unstickyDrupalHeader) { + appliedClassName = "".concat(classes.unstickyHeader, " ").concat(classes.headerContainer); + } + if (renderMode === 'drupal-fallback') { + appliedClassName = "".concat(appliedClassName, " ").concat(classes.headerContainerFallback); + } var html = renderMode === 'drupal' ? headerHTML : _drupalHeader.default; return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("header", { ref: headerRef, id: "header", - className: unstickyDrupalHeader ? "".concat(classes.unstickyHeader, " ").concat(classes.headerContainer) : classes.headerContainer + className: appliedClassName }, (0, _htmlReactParser.default)(html, injectAuth)), /*#__PURE__*/_react.default.createElement(_ApplicationMenu.default, null)); }); NeonHeader.propTypes = { diff --git a/lib/components/NeonPage/NeonPage.js b/lib/components/NeonPage/NeonPage.js index 0ef27f74..f130fda2 100644 --- a/lib/components/NeonPage/NeonPage.js +++ b/lib/components/NeonPage/NeonPage.js @@ -45,8 +45,11 @@ require("./styles.css"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } +function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; } function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } +function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } +function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } @@ -510,15 +513,28 @@ var NeonPage = function NeonPage(props) { setDrupalCssStatus(_NeonContext.FETCH_STATUS.SUCCESS); }; link.onerror = function () { - // eslint-disable-next-line no-unused-expressions - Promise.resolve().then(function () { - return _interopRequireWildcard(require('../../remoteAssets/drupal-theme.css')); - }); - // Assume this local import worked and still report the load as successful - // We do this because props on header and footer express whether the CSS is loaded and we want - // to simplify that as a boolean. The header and footer don't care where the CSS came from - // so long as it's there. - setDrupalCssStatus(_NeonContext.FETCH_STATUS.SUCCESS); + _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() { + return _regeneratorRuntime().wrap(function _callee$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + _context.next = 2; + return Promise.resolve().then(function () { + return _interopRequireWildcard(require('../../remoteAssets/drupal-theme.css')); + }); + case 2: + // Assume this local import worked and still report the load as successful + // We do this because props on header and footer express whether the CSS is + // loaded and we want to simplify that as a boolean. The header and footer + // don't care where the CSS came from so long as it's there. + setDrupalCssStatus(_NeonContext.FETCH_STATUS.SUCCESS); + case 3: + case "end": + return _context.stop(); + } + } + }, _callee); + }))(); }; document.body.appendChild(link); }, [useSomeDrupalAssets, drupalCssStatus, setDrupalCssStatus]); diff --git a/lib/images/svg/header-search.svg b/lib/images/svg/header-search.svg new file mode 100644 index 00000000..ef25e4f8 --- /dev/null +++ b/lib/images/svg/header-search.svg @@ -0,0 +1,5 @@ + + + diff --git a/lib/remoteAssets/drupal-header.html.d.ts b/lib/remoteAssets/drupal-header.html.d.ts index 5e110d37..892fc8f7 100644 --- a/lib/remoteAssets/drupal-header.html.d.ts +++ b/lib/remoteAssets/drupal-header.html.d.ts @@ -1,2 +1,2 @@ -declare const _default: "\n
\n
\n \n \n \n
\n \n\n
\n
\n
\n
\n \n \n \n\n\n \n\n
\n
\n \n
\n
\n

Search

\n \n\n
\n \n \n
\n
\n \n\n \n
\n
\n\n\n
\n\n
\n\n
\n\n
\n \n\n
\n
\n
\n
\n
\n\n\n"; +declare const _default: "\n
\n
\n \n \n \n
\n \n\n
\n
\n
\n
\n \n \n \n\n\n \n\n
\n
\n \n
\n
\n

Search

\n \n\n
\n \n \n
\n
\n \n\n \n
\n
\n\n\n
\n\n
\n\n
\n\n
\n \n\n
\n
\n
\n
\n
\n\n\n"; export default _default; diff --git a/lib/remoteAssets/drupal-header.html.js b/lib/remoteAssets/drupal-header.html.js index e698e544..c3ab7ba9 100644 --- a/lib/remoteAssets/drupal-header.html.js +++ b/lib/remoteAssets/drupal-header.html.js @@ -5,5 +5,5 @@ Object.defineProperty(exports, "__esModule", { }); exports.default = void 0; var html; -var _default = html = "\n
\n
\n \n \n \n
\n \n\n
\n
\n
\n
\n \n \n \n\n\n \n\n
\n
\n \n
\n
\n

Search

\n \n\n
\n \n \n
\n
\n \n\n \n
\n
\n\n\n
\n\n
\n\n
\n\n
\n \n\n
\n
\n
\n
\n
\n\n\n"; +var _default = html = "\n
\n
\n \n \n \n
\n \n\n
\n
\n
\n
\n \n \n \n\n\n \n\n
\n
\n \n
\n
\n

Search

\n \n\n
\n \n \n
\n
\n \n\n \n
\n
\n\n\n
\n\n
\n\n
\n\n
\n \n\n
\n
\n
\n
\n
\n\n\n"; exports.default = _default; \ No newline at end of file diff --git a/lib/remoteAssets/drupal-theme.css b/lib/remoteAssets/drupal-theme.css index 721edeb4..c3169ecf 100644 --- a/lib/remoteAssets/drupal-theme.css +++ b/lib/remoteAssets/drupal-theme.css @@ -788,11 +788,13 @@ #header input[type="password"]:not(.MuiInputBase-input), #header input[type="date"]:not(.MuiInputBase-input), #header input[type="email"]:not(.MuiInputBase-input), - #header input[type="number"]:not(.MuiInputBase-input), #footer input[type="text"]:not(.MuiInputBase-input), + #header input[type="number"]:not(.MuiInputBase-input), + #header input[type="time"]:not(.MuiInputBase-input), #footer input[type="text"]:not(.MuiInputBase-input), #footer input[type="password"]:not(.MuiInputBase-input), #footer input[type="date"]:not(.MuiInputBase-input), #footer input[type="email"]:not(.MuiInputBase-input), - #footer input[type="number"]:not(.MuiInputBase-input) { + #footer input[type="number"]:not(.MuiInputBase-input), + #footer input[type="time"]:not(.MuiInputBase-input) { height: 3rem; background: #fff; border: 1px solid #D7D9D9; @@ -808,21 +810,25 @@ #header input[type="password"]:not(.MuiInputBase-input), #header input[type="date"]:not(.MuiInputBase-input), #header input[type="email"]:not(.MuiInputBase-input), - #header input[type="number"]:not(.MuiInputBase-input), #footer input[type="text"]:not(.MuiInputBase-input), + #header input[type="number"]:not(.MuiInputBase-input), + #header input[type="time"]:not(.MuiInputBase-input), #footer input[type="text"]:not(.MuiInputBase-input), #footer input[type="password"]:not(.MuiInputBase-input), #footer input[type="date"]:not(.MuiInputBase-input), #footer input[type="email"]:not(.MuiInputBase-input), - #footer input[type="number"]:not(.MuiInputBase-input) { + #footer input[type="number"]:not(.MuiInputBase-input), + #footer input[type="time"]:not(.MuiInputBase-input) { font-size: 1rem; } } #header input[type="text"]:not(.MuiInputBase-input):hover, #header input[type="password"]:not(.MuiInputBase-input):hover, #header input[type="date"]:not(.MuiInputBase-input):hover, #header input[type="email"]:not(.MuiInputBase-input):hover, - #header input[type="number"]:not(.MuiInputBase-input):hover, #footer input[type="text"]:not(.MuiInputBase-input):hover, + #header input[type="number"]:not(.MuiInputBase-input):hover, + #header input[type="time"]:not(.MuiInputBase-input):hover, #footer input[type="text"]:not(.MuiInputBase-input):hover, #footer input[type="password"]:not(.MuiInputBase-input):hover, #footer input[type="date"]:not(.MuiInputBase-input):hover, #footer input[type="email"]:not(.MuiInputBase-input):hover, - #footer input[type="number"]:not(.MuiInputBase-input):hover { + #footer input[type="number"]:not(.MuiInputBase-input):hover, + #footer input[type="time"]:not(.MuiInputBase-input):hover { box-shadow: none; transition: all 0.25s; border: 1px solid #0073CF !important; } @@ -834,7 +840,9 @@ #header input[type="email"]:not(.MuiInputBase-input):active, #header input[type="email"]:not(.MuiInputBase-input):focus, #header input[type="number"]:not(.MuiInputBase-input):active, - #header input[type="number"]:not(.MuiInputBase-input):focus, #footer input[type="text"]:not(.MuiInputBase-input):active, #footer input[type="text"]:not(.MuiInputBase-input):focus, + #header input[type="number"]:not(.MuiInputBase-input):focus, + #header input[type="time"]:not(.MuiInputBase-input):active, + #header input[type="time"]:not(.MuiInputBase-input):focus, #footer input[type="text"]:not(.MuiInputBase-input):active, #footer input[type="text"]:not(.MuiInputBase-input):focus, #footer input[type="password"]:not(.MuiInputBase-input):active, #footer input[type="password"]:not(.MuiInputBase-input):focus, #footer input[type="date"]:not(.MuiInputBase-input):active, @@ -842,7 +850,9 @@ #footer input[type="email"]:not(.MuiInputBase-input):active, #footer input[type="email"]:not(.MuiInputBase-input):focus, #footer input[type="number"]:not(.MuiInputBase-input):active, - #footer input[type="number"]:not(.MuiInputBase-input):focus { + #footer input[type="number"]:not(.MuiInputBase-input):focus, + #footer input[type="time"]:not(.MuiInputBase-input):active, + #footer input[type="time"]:not(.MuiInputBase-input):focus { transition: all 0.25s; border: 1px solid #0073CF !important; box-shadow: 0px 0px 0px 4px #C4C4C4; @@ -851,16 +861,21 @@ #header input[type="password"]:not(.MuiInputBase-input):disabled, #header input[type="date"]:not(.MuiInputBase-input):disabled, #header input[type="email"]:not(.MuiInputBase-input):disabled, - #header input[type="number"]:not(.MuiInputBase-input):disabled, #footer input[type="text"]:not(.MuiInputBase-input):disabled, + #header input[type="number"]:not(.MuiInputBase-input):disabled, + #header input[type="time"]:not(.MuiInputBase-input):disabled, #footer input[type="text"]:not(.MuiInputBase-input):disabled, #footer input[type="password"]:not(.MuiInputBase-input):disabled, #footer input[type="date"]:not(.MuiInputBase-input):disabled, #footer input[type="email"]:not(.MuiInputBase-input):disabled, - #footer input[type="number"]:not(.MuiInputBase-input):disabled { + #footer input[type="number"]:not(.MuiInputBase-input):disabled, + #footer input[type="time"]:not(.MuiInputBase-input):disabled { color: #A2A4A3; background: #F5F6F7; border: 1px solid #D7D9D9; box-sizing: border-box; box-shadow: inset 0px 1px 0px #7C7F80; } + #header .time-start, #footer .time-start { + display: -ms-flexbox; + display: flex; } #header textarea, #footer textarea { background: #fff; border: 1px solid #D7D9D9; @@ -1376,24 +1391,23 @@ #header form:not(.layout-paragraphs-component-form) input[type="radio"]:not(.rlglc-input) + label:hover:before, #footer form:not(.layout-paragraphs-component-form) input[type="radio"]:not(.rlglc-input) + label:hover:before { border: 1px solid #0073CF !important; } #header .form-no-label .visually-hidden, #footer .form-no-label .visually-hidden { - clip: initial; overflow: initial; text-indent: -10000px; height: auto; width: auto; } - #header input[type="checkbox"]:not(.nav-trigger):not(.rlglc-input):not(:checked), #header input[type="checkbox"]:not(.nav-trigger):not(.rlglc-input):checked, #footer input[type="checkbox"]:not(.nav-trigger):not(.rlglc-input):not(:checked), #footer input[type="checkbox"]:not(.nav-trigger):not(.rlglc-input):checked { + #header input[type="checkbox"]:not(.nav-trigger):not(.rlglc-input):not(.allday):not(:checked), #header input[type="checkbox"]:not(.nav-trigger):not(.rlglc-input):not(.allday):checked, #footer input[type="checkbox"]:not(.nav-trigger):not(.rlglc-input):not(.allday):not(:checked), #footer input[type="checkbox"]:not(.nav-trigger):not(.rlglc-input):not(.allday):checked { position: absolute; left: -9999px; } - #header input[type="checkbox"]:not(.nav-trigger):not(.rlglc-input):not(:checked) + label, - #header input[type="checkbox"]:not(.nav-trigger):not(.rlglc-input):checked + label, #footer input[type="checkbox"]:not(.nav-trigger):not(.rlglc-input):not(:checked) + label, - #footer input[type="checkbox"]:not(.nav-trigger):not(.rlglc-input):checked + label { + #header input[type="checkbox"]:not(.nav-trigger):not(.rlglc-input):not(.allday):not(:checked) + label, + #header input[type="checkbox"]:not(.nav-trigger):not(.rlglc-input):not(.allday):checked + label, #footer input[type="checkbox"]:not(.nav-trigger):not(.rlglc-input):not(.allday):not(:checked) + label, + #footer input[type="checkbox"]:not(.nav-trigger):not(.rlglc-input):not(.allday):checked + label { position: relative; padding-left: 1.95em; cursor: pointer; z-index: 1; } - #header input[type="checkbox"]:not(.nav-trigger):not(.rlglc-input):not(:checked) + label:before, - #header input[type="checkbox"]:not(.nav-trigger):not(.rlglc-input):checked + label:before, #footer input[type="checkbox"]:not(.nav-trigger):not(.rlglc-input):not(:checked) + label:before, - #footer input[type="checkbox"]:not(.nav-trigger):not(.rlglc-input):checked + label:before { + #header input[type="checkbox"]:not(.nav-trigger):not(.rlglc-input):not(.allday):not(:checked) + label:before, + #header input[type="checkbox"]:not(.nav-trigger):not(.rlglc-input):not(.allday):checked + label:before, #footer input[type="checkbox"]:not(.nav-trigger):not(.rlglc-input):not(.allday):not(:checked) + label:before, + #footer input[type="checkbox"]:not(.nav-trigger):not(.rlglc-input):not(.allday):checked + label:before { content: ''; position: absolute; left: 0; @@ -1403,9 +1417,9 @@ border: 1px solid #D7D9D9; background: #fff; border-radius: 2px; } - #header input[type="checkbox"]:not(.nav-trigger):not(.rlglc-input):not(:checked) + label:after, - #header input[type="checkbox"]:not(.nav-trigger):not(.rlglc-input):checked + label:after, #footer input[type="checkbox"]:not(.nav-trigger):not(.rlglc-input):not(:checked) + label:after, - #footer input[type="checkbox"]:not(.nav-trigger):not(.rlglc-input):checked + label:after { + #header input[type="checkbox"]:not(.nav-trigger):not(.rlglc-input):not(.allday):not(:checked) + label:after, + #header input[type="checkbox"]:not(.nav-trigger):not(.rlglc-input):not(.allday):checked + label:after, #footer input[type="checkbox"]:not(.nav-trigger):not(.rlglc-input):not(.allday):not(:checked) + label:after, + #footer input[type="checkbox"]:not(.nav-trigger):not(.rlglc-input):not(.allday):checked + label:after { content: ''; background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2211%22%20height%3D%228%22%20viewBox%3D%220%200%2011%208%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M1%204l3%203%206-6%22%20stroke%3D%22%23000%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E"); background-position: center center; @@ -1416,24 +1430,24 @@ width: 11px; display: block; position: absolute; } - #header input[type="checkbox"]:not(.nav-trigger):not(.rlglc-input):not(:checked) + label:after, #footer input[type="checkbox"]:not(.nav-trigger):not(.rlglc-input):not(:checked) + label:after { + #header input[type="checkbox"]:not(.nav-trigger):not(.rlglc-input):not(.allday):not(:checked) + label:after, #footer input[type="checkbox"]:not(.nav-trigger):not(.rlglc-input):not(.allday):not(:checked) + label:after { opacity: 0; transform: scale(0); } - #header input[type="checkbox"]:not(.nav-trigger):not(.rlglc-input):checked + label:after, #footer input[type="checkbox"]:not(.nav-trigger):not(.rlglc-input):checked + label:after { + #header input[type="checkbox"]:not(.nav-trigger):not(.rlglc-input):not(.allday):checked + label:after, #footer input[type="checkbox"]:not(.nav-trigger):not(.rlglc-input):not(.allday):checked + label:after { opacity: 1; transform: scale(1); } - #header input[type="checkbox"]:not(.nav-trigger):not(.rlglc-input):disabled:not(:checked) + label:before, - #header input[type="checkbox"]:not(.nav-trigger):not(.rlglc-input):disabled:checked + label:before, #footer input[type="checkbox"]:not(.nav-trigger):not(.rlglc-input):disabled:not(:checked) + label:before, - #footer input[type="checkbox"]:not(.nav-trigger):not(.rlglc-input):disabled:checked + label:before { + #header input[type="checkbox"]:not(.nav-trigger):not(.rlglc-input):not(.allday):disabled:not(:checked) + label:before, + #header input[type="checkbox"]:not(.nav-trigger):not(.rlglc-input):not(.allday):disabled:checked + label:before, #footer input[type="checkbox"]:not(.nav-trigger):not(.rlglc-input):not(.allday):disabled:not(:checked) + label:before, + #footer input[type="checkbox"]:not(.nav-trigger):not(.rlglc-input):not(.allday):disabled:checked + label:before { box-shadow: none; border-color: #D7D9D9; background-color: #fff; } - #header input[type="checkbox"]:not(.nav-trigger):not(.rlglc-input):checked:focus + label:before, - #header input[type="checkbox"]:not(.nav-trigger):not(.rlglc-input):not(:checked):focus + label:before, #footer input[type="checkbox"]:not(.nav-trigger):not(.rlglc-input):checked:focus + label:before, - #footer input[type="checkbox"]:not(.nav-trigger):not(.rlglc-input):not(:checked):focus + label:before { + #header input[type="checkbox"]:not(.nav-trigger):not(.rlglc-input):not(.allday):checked:focus + label:before, + #header input[type="checkbox"]:not(.nav-trigger):not(.rlglc-input):not(.allday):not(:checked):focus + label:before, #footer input[type="checkbox"]:not(.nav-trigger):not(.rlglc-input):not(.allday):checked:focus + label:before, + #footer input[type="checkbox"]:not(.nav-trigger):not(.rlglc-input):not(.allday):not(:checked):focus + label:before { box-shadow: 0px 0px 0px 4px #C4C4C4; border: 1px solid #0073CF; } - #header input[type="checkbox"]:not(.nav-trigger):not(.rlglc-input) + label:hover:before, #footer input[type="checkbox"]:not(.nav-trigger):not(.rlglc-input) + label:hover:before { + #header input[type="checkbox"]:not(.nav-trigger):not(.rlglc-input):not(.allday) + label:hover:before, #footer input[type="checkbox"]:not(.nav-trigger):not(.rlglc-input):not(.allday) + label:hover:before { border: 1px solid #0073CF !important; } #header .webform-element-description, #footer .webform-element-description { font-size: 0.875rem; @@ -1443,6 +1457,20 @@ font-size: 0.9375rem; } } #header #linkit-editor-dialog-form, #footer #linkit-editor-dialog-form { min-height: 400px; } + #header .smartdate--time-inline, #footer .smartdate--time-inline { + display: -ms-flexbox; + display: flex; + grid-column-gap: 0.5em; + -ms-flex-direction: row; + flex-direction: row; + -ms-flex-wrap: nowrap; + flex-wrap: nowrap; + -ms-flex-line-pack: center; + align-content: center; + -ms-flex-align: baseline; + align-items: baseline; + -ms-flex-pack: start; + justify-content: flex-start; } #header .table-wrapper, #footer .table-wrapper { display: -ms-grid; display: grid; diff --git a/package-lock.json b/package-lock.json index f2f07f1b..26e9d2ab 100644 --- a/package-lock.json +++ b/package-lock.json @@ -64,7 +64,7 @@ "tinycolor2": "^1.4.2", "ua-parser-js": "^1.0.32", "universal-cookie": "^4.0.4", - "zod": "^3.20.0" + "zod": "^3.20.2" }, "devDependencies": { "@babel/cli": "^7.19.3", @@ -23874,9 +23874,9 @@ } }, "node_modules/zod": { - "version": "3.20.0", - "resolved": "https://registry.npmjs.org/zod/-/zod-3.20.0.tgz", - "integrity": "sha512-ZWxs7oM5ixoo1BMoxTNeDMYSih/F/FUnExsnRtHT04rG6q0Bd74TKS45RGXw07TOalOZyyzdKaYH38k8yTEv9A==", + "version": "3.20.2", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.20.2.tgz", + "integrity": "sha512-1MzNQdAvO+54H+EaK5YpyEy0T+Ejo/7YLHS93G3RnYWh5gaotGHwGeN/ZO687qEDU2y4CdStQYXVHIgrUl5UVQ==", "funding": { "url": "https://github.com/sponsors/colinhacks" } diff --git a/package.json b/package.json index b2d0280c..c996f795 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,7 @@ "tinycolor2": "^1.4.2", "ua-parser-js": "^1.0.32", "universal-cookie": "^4.0.4", - "zod": "^3.20.0" + "zod": "^3.20.2" }, "peerDependencies": { "worker-loader": "^3.0.8" diff --git a/src/lib_components/components/NeonFooter/NeonFooter.jsx b/src/lib_components/components/NeonFooter/NeonFooter.jsx index 56b127c8..b36a9764 100644 --- a/src/lib_components/components/NeonFooter/NeonFooter.jsx +++ b/src/lib_components/components/NeonFooter/NeonFooter.jsx @@ -2,16 +2,27 @@ import React from 'react'; import PropTypes from 'prop-types'; import HTMLReactParser from 'html-react-parser'; +import { makeStyles } from '@material-ui/core/styles'; import Skeleton from '@material-ui/lab/Skeleton'; import REMOTE_ASSETS from '../../remoteAssetsMap/remoteAssetsMap'; import DRUPAL_FOOTER_HTML_FALLBACK from '../../remoteAssets/drupal-footer.html'; import NeonContext, { FETCH_STATUS } from '../NeonContext/NeonContext'; +import Theme from '../Theme/Theme'; const DRUPAL_FOOTER_HTML = REMOTE_ASSETS.DRUPAL_FOOTER_HTML.KEY; +const useStyles = makeStyles((theme) => ({ + footerContainer: { + '& .footer-bottom__wrapper': { + background: '#4B372E', + }, + }, +})); + const NeonFooter = (props) => { const { drupalCssLoaded } = props; + const classes = useStyles(Theme); const [{ isActive: neonContextIsActive, fetches: { [DRUPAL_FOOTER_HTML]: footerFetch }, @@ -51,7 +62,7 @@ const NeonFooter = (props) => { case 'drupal-fallback': default: return ( -