@epec-fcfm-uchile/frontend-component-header 1.0.7 → 1.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -24,12 +24,12 @@ var LearningHeader = function LearningHeader(_ref) {
24
24
  alt: getConfig().SITE_NAME
25
25
  });
26
26
  return /*#__PURE__*/React.createElement("header", {
27
- className: "learning-header"
27
+ className: "learning-header align-items-center"
28
28
  }, /*#__PURE__*/React.createElement("a", {
29
29
  className: "sr-only sr-only-focusable",
30
30
  href: "#main-content"
31
31
  }, intl.formatMessage(messages.skipNavLink)), /*#__PURE__*/React.createElement("div", {
32
- className: "container-xl py-2 d-flex align-items-center"
32
+ className: "d-flex align-items-center px-3 sub-learning-header"
33
33
  }, headerLogo, /*#__PURE__*/React.createElement("div", {
34
34
  className: "flex-grow-1 course-title-lockup d-flex",
35
35
  style: {
@@ -1 +1 @@
1
- {"version":3,"file":"LearningHeader.js","names":["React","useContext","PropTypes","getConfig","useIntl","AppContext","AnonymousUserMenu","AuthenticatedUserDropdown","LogoSlot","CourseInfoSlot","courseInfoDataShape","messages","LearningHelpSlot","LearningHeader","_ref","courseOrg","courseNumber","courseTitle","showUserDropdown","intl","_useContext","authenticatedUser","headerLogo","createElement","href","concat","LMS_BASE_URL","src","LOGO_URL","alt","SITE_NAME","className","formatMessage","skipNavLink","style","lineHeight","Fragment","username","email","propTypes","bool","defaultProps"],"sources":["../../src/learning-header/LearningHeader.jsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport PropTypes from 'prop-types';\nimport { getConfig } from '@edx/frontend-platform';\nimport { useIntl } from '@edx/frontend-platform/i18n';\nimport { AppContext } from '@edx/frontend-platform/react';\n\nimport AnonymousUserMenu from './AnonymousUserMenu';\nimport AuthenticatedUserDropdown from './AuthenticatedUserDropdown';\nimport LogoSlot from '../plugin-slots/LogoSlot';\nimport CourseInfoSlot from '../plugin-slots/CourseInfoSlot';\nimport { courseInfoDataShape } from './LearningHeaderCourseInfo';\nimport messages from './messages';\nimport LearningHelpSlot from '../plugin-slots/LearningHelpSlot';\n\nconst LearningHeader = ({\n courseOrg,\n courseNumber,\n courseTitle,\n showUserDropdown,\n}) => {\n const intl = useIntl();\n const { authenticatedUser } = useContext(AppContext);\n\n const headerLogo = (\n <LogoSlot\n href={`${getConfig().LMS_BASE_URL}/dashboard`}\n src={getConfig().LOGO_URL}\n alt={getConfig().SITE_NAME}\n />\n );\n\n return (\n <header className=\"learning-header\">\n <a className=\"sr-only sr-only-focusable\" href=\"#main-content\">{intl.formatMessage(messages.skipNavLink)}</a>\n <div className=\"container-xl py-2 d-flex align-items-center\">\n {headerLogo}\n <div className=\"flex-grow-1 course-title-lockup d-flex\" style={{ lineHeight: 1 }}>\n <CourseInfoSlot courseOrg={courseOrg} courseNumber={courseNumber} courseTitle={courseTitle} />\n </div>\n {showUserDropdown && authenticatedUser && (\n <>\n <LearningHelpSlot />\n <AuthenticatedUserDropdown\n username={authenticatedUser.username} email={authenticatedUser.email}\n />\n </>\n )}\n {showUserDropdown && !authenticatedUser && (\n <AnonymousUserMenu />\n )}\n </div>\n </header>\n );\n};\n\nLearningHeader.propTypes = {\n courseOrg: courseInfoDataShape.courseOrg,\n courseNumber: courseInfoDataShape.courseNumber,\n courseTitle: courseInfoDataShape.courseTitle,\n showUserDropdown: PropTypes.bool,\n};\n\nLearningHeader.defaultProps = {\n courseOrg: null,\n courseNumber: null,\n courseTitle: null,\n showUserDropdown: true,\n};\n\nexport default LearningHeader;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,UAAU,QAAQ,OAAO;AACzC,OAAOC,SAAS,MAAM,YAAY;AAClC,SAASC,SAAS,QAAQ,wBAAwB;AAClD,SAASC,OAAO,QAAQ,6BAA6B;AACrD,SAASC,UAAU,QAAQ,8BAA8B;AAEzD,OAAOC,iBAAiB,MAAM,qBAAqB;AACnD,OAAOC,yBAAyB,MAAM,6BAA6B;AACnE,OAAOC,QAAQ,MAAM,0BAA0B;AAC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AY,EAAEA,YAAa;IAACC,WAAW,EAAEA;EAAY,CAAE,CAC1F,CAAC,EACLC,gBAAgB,IAAIG,iBAAiB,iBACtCrB,KAAA,CAAAuB,aAAA,CAAAvB,KAAA,CAAAoC,QAAA,qBACEpC,KAAA,CAAAuB,aAAA,CAACX,gBAAgB,MAAE,CAAC,eACpBZ,KAAA,CAAAuB,aAAA,CAAChB,yBAAyB;IACxB8B,QAAQ,EAAEhB,iBAAiB,CAACgB,QAAS;IAACC,KAAK,EAAEjB,iBAAiB,CAACiB;EAAM,CACtE,CACD,CACD,EACApB,gBAAgB,IAAI,CAACG,iBAAiB,iBACvCrB,KAAA,CAAAuB,aAAA,CAACjB,iBAAiB,MAAE,CAEjB,CACC,CAAC;AAEb,CAAC;AAEDO,cAAc,CAAC0B,SAAS,GAAG;EACzBxB,SAAS,EAAEL,mBAAmB,CAACK,SAAS;EACxCC,YAAY,EAAEN,mBAAmB,CAACM,YAAY;EAC9CC,WAAW,EAAEP,mBAAmB,CAACO,WAAW;EAC5CC,gBAAgB,EAAEhB,SAAS,CAACsC;AAC9B,CAAC;AAED3B,cAAc,CAAC4B,YAAY,GAAG;EAC5B1B,SAAS,EAAE,IAAI;EACfC,YAAY,EAAE,IAAI;EAClBC,WAAW,EAAE,IAAI;EACjBC,gBAAgB,EAAE;AACpB,CAAC;AAED,eAAeL,cAAc","ignoreList":[]}
1
+ {"version":3,"file":"LearningHeader.js","names":["React","useContext","PropTypes","getConfig","useIntl","AppContext","AnonymousUserMenu","AuthenticatedUserDropdown","LogoSlot","CourseInfoSlot","courseInfoDataShape","messages","LearningHelpSlot","LearningHeader","_ref","courseOrg","courseNumber","courseTitle","showUserDropdown","intl","_useContext","authenticatedUser","headerLogo","createElement","href","concat","LMS_BASE_URL","src","LOGO_URL","alt","SITE_NAME","className","formatMessage","skipNavLink","style","lineHeight","Fragment","username","email","propTypes","bool","defaultProps"],"sources":["../../src/learning-header/LearningHeader.jsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport PropTypes from 'prop-types';\nimport { getConfig } from '@edx/frontend-platform';\nimport { useIntl } from '@edx/frontend-platform/i18n';\nimport { AppContext } from '@edx/frontend-platform/react';\n\nimport AnonymousUserMenu from './AnonymousUserMenu';\nimport AuthenticatedUserDropdown from './AuthenticatedUserDropdown';\nimport LogoSlot from '../plugin-slots/LogoSlot';\nimport CourseInfoSlot from '../plugin-slots/CourseInfoSlot';\nimport { courseInfoDataShape } from './LearningHeaderCourseInfo';\nimport messages from './messages';\nimport LearningHelpSlot from '../plugin-slots/LearningHelpSlot';\n\nconst LearningHeader = ({\n courseOrg,\n courseNumber,\n courseTitle,\n showUserDropdown,\n}) => {\n const intl = useIntl();\n const { authenticatedUser } = useContext(AppContext);\n\n const headerLogo = (\n <LogoSlot\n href={`${getConfig().LMS_BASE_URL}/dashboard`}\n src={getConfig().LOGO_URL}\n alt={getConfig().SITE_NAME}\n />\n );\n\n return (\n <header className=\"learning-header align-items-center\">\n <a className=\"sr-only sr-only-focusable\" href=\"#main-content\">{intl.formatMessage(messages.skipNavLink)}</a>\n <div className=\"d-flex align-items-center px-3 sub-learning-header\">\n {headerLogo}\n <div className=\"flex-grow-1 course-title-lockup d-flex\" style={{ lineHeight: 1 }}>\n <CourseInfoSlot courseOrg={courseOrg} courseNumber={courseNumber} courseTitle={courseTitle} />\n </div>\n {showUserDropdown && authenticatedUser && (\n <>\n <LearningHelpSlot />\n <AuthenticatedUserDropdown\n username={authenticatedUser.username} email={authenticatedUser.email}\n />\n </>\n )}\n {showUserDropdown && !authenticatedUser && (\n <AnonymousUserMenu />\n )}\n </div>\n </header>\n );\n};\n\nLearningHeader.propTypes = {\n courseOrg: courseInfoDataShape.courseOrg,\n courseNumber: courseInfoDataShape.courseNumber,\n courseTitle: courseInfoDataShape.courseTitle,\n showUserDropdown: PropTypes.bool,\n};\n\nLearningHeader.defaultProps = {\n courseOrg: null,\n courseNumber: null,\n courseTitle: null,\n showUserDropdown: true,\n};\n\nexport default LearningHeader;\n"],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Aa,CAACrB,QAAQ,CAACsB,WAAW,CAAK,CAAC,eAC5GjC,KAAA,CAAAuB,aAAA;IAAKQ,SAAS,EAAC;EAAoD,GAChET,UAAU,eACXtB,KAAA,CAAAuB,aAAA;IAAKQ,SAAS,EAAC,wCAAwC;IAACG,KAAK,EAAE;MAAEC,UAAU,EAAE;IAAE;EAAE,gBAC/EnC,KAAA,CAAAuB,aAAA,CAACd,cAAc;IAACM,SAAS,EAAEA,SAAU;IAACC,YAAY,EAAEA,YAAa;IAACC,WAAW,EAAEA;EAAY,CAAE,CAC1F,CAAC,EACLC,gBAAgB,IAAIG,iBAAiB,iBACtCrB,KAAA,CAAAuB,aAAA,CAAAvB,KAAA,CAAAoC,QAAA,qBACEpC,KAAA,CAAAuB,aAAA,CAACX,gBAAgB,MAAE,CAAC,eACpBZ,KAAA,CAAAuB,aAAA,CAAChB,yBAAyB;IACxB8B,QAAQ,EAAEhB,iBAAiB,CAACgB,QAAS;IAACC,KAAK,EAAEjB,iBAAiB,CAACiB;EAAM,CACtE,CACD,CACD,EACApB,gBAAgB,IAAI,CAACG,iBAAiB,iBACvCrB,KAAA,CAAAuB,aAAA,CAACjB,iBAAiB,MAAE,CAEjB,CACC,CAAC;AAEb,CAAC;AAEDO,cAAc,CAAC0B,SAAS,GAAG;EACzBxB,SAAS,EAAEL,mBAAmB,CAACK,SAAS;EACxCC,YAAY,EAAEN,mBAAmB,CAACM,YAAY;EAC9CC,WAAW,EAAEP,mBAAmB,CAACO,WAAW;EAC5CC,gBAAgB,EAAEhB,SAAS,CAACsC;AAC9B,CAAC;AAED3B,cAAc,CAAC4B,YAAY,GAAG;EAC5B1B,SAAS,EAAE,IAAI;EACfC,YAAY,EAAE,IAAI;EAClBC,WAAW,EAAE,IAAI;EACjBC,gBAAgB,EAAE;AACpB,CAAC;AAED,eAAeL,cAAc","ignoreList":[]}
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import { Dropdown } from '@openedx/paragon';
4
+ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
4
5
  var LearningHeaderUserMenuItems = function LearningHeaderUserMenuItems(_ref) {
5
6
  var items = _ref.items;
6
7
  return items.map(function (item) {
@@ -1 +1 @@
1
- {"version":3,"file":"LearningHeaderUserMenuItems.js","names":["React","PropTypes","Dropdown","LearningHeaderUserMenuItems","_ref","items","map","item","createElement","Item","href","FontAwesomeIcon","icon","size","message","learningHeaderUserMenuDataShape","arrayOf","shape","string","propTypes"],"sources":["../../src/learning-header/LearningHeaderUserMenuItems.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\n\nimport { Dropdown } from '@openedx/paragon';\n\nconst LearningHeaderUserMenuItems = ({ items }) => items.map((item) => (\n <Dropdown.Item href={item.href}>\n <FontAwesomeIcon icon={item.icon} size=\"lg\" /> {item.message}\n </Dropdown.Item>\n));\n\nexport const learningHeaderUserMenuDataShape = {\n items: PropTypes.arrayOf(PropTypes.shape({\n message: PropTypes.string,\n href: PropTypes.string,\n })),\n};\n\nLearningHeaderUserMenuItems.propTypes = learningHeaderUserMenuDataShape;\n\nexport default LearningHeaderUserMenuItems;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAElC,SAASC,QAAQ,QAAQ,kBAAkB;AAE3C,IAAMC,2BAA2B,GAAG,SAA9BA,2BAA2BA,CAAAC,IAAA;EAAA,IAAMC,KAAK,GAAAD,IAAA,CAALC,KAAK;EAAA,OAAOA,KAAK,CAACC,GAAG,CAAC,UAACC,IAAI;IAAA,oBAChEP,KAAA,CAAAQ,aAAA,CAACN,QAAQ,CAACO,IAAI;MAACC,IAAI,EAAEH,IAAI,CAACG;IAAK,gBAC7BV,KAAA,CAAAQ,aAAA,CAACG,eAAe;MAACC,IAAI,EAAEL,IAAI,CAACK,IAAK;MAACC,IAAI,EAAC;IAAI,CAAE,CAAC,KAAC,EAACN,IAAI,CAACO,OACxC,CAAC;EAAA,CACjB,CAAC;AAAA;AAEF,OAAO,IAAMC,+BAA+B,GAAG;EAC7CV,KAAK,EAAEJ,SAAS,CAACe,OAAO,CAACf,SAAS,CAACgB,KAAK,CAAC;IACvCH,OAAO,EAAEb,SAAS,CAACiB,MAAM;IACzBR,IAAI,EAAET,SAAS,CAACiB;EAClB,CAAC,CAAC;AACJ,CAAC;AAEDf,2BAA2B,CAACgB,SAAS,GAAGJ,+BAA+B;AAEvE,eAAeZ,2BAA2B","ignoreList":[]}
1
+ {"version":3,"file":"LearningHeaderUserMenuItems.js","names":["React","PropTypes","Dropdown","FontAwesomeIcon","LearningHeaderUserMenuItems","_ref","items","map","item","createElement","Item","href","icon","size","message","learningHeaderUserMenuDataShape","arrayOf","shape","string","propTypes"],"sources":["../../src/learning-header/LearningHeaderUserMenuItems.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\n\nimport { Dropdown } from '@openedx/paragon';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\n\nconst LearningHeaderUserMenuItems = ({ items }) => items.map((item) => (\n <Dropdown.Item href={item.href}>\n <FontAwesomeIcon icon={item.icon} size=\"lg\" /> {item.message}\n </Dropdown.Item>\n));\n\nexport const learningHeaderUserMenuDataShape = {\n items: PropTypes.arrayOf(PropTypes.shape({\n message: PropTypes.string,\n href: PropTypes.string,\n })),\n};\n\nLearningHeaderUserMenuItems.propTypes = learningHeaderUserMenuDataShape;\n\nexport default LearningHeaderUserMenuItems;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAElC,SAASC,QAAQ,QAAQ,kBAAkB;AAC3C,SAASC,eAAe,QAAQ,gCAAgC;AAEhE,IAAMC,2BAA2B,GAAG,SAA9BA,2BAA2BA,CAAAC,IAAA;EAAA,IAAMC,KAAK,GAAAD,IAAA,CAALC,KAAK;EAAA,OAAOA,KAAK,CAACC,GAAG,CAAC,UAACC,IAAI;IAAA,oBAChER,KAAA,CAAAS,aAAA,CAACP,QAAQ,CAACQ,IAAI;MAACC,IAAI,EAAEH,IAAI,CAACG;IAAK,gBAC7BX,KAAA,CAAAS,aAAA,CAACN,eAAe;MAACS,IAAI,EAAEJ,IAAI,CAACI,IAAK;MAACC,IAAI,EAAC;IAAI,CAAE,CAAC,KAAC,EAACL,IAAI,CAACM,OACxC,CAAC;EAAA,CACjB,CAAC;AAAA;AAEF,OAAO,IAAMC,+BAA+B,GAAG;EAC7CT,KAAK,EAAEL,SAAS,CAACe,OAAO,CAACf,SAAS,CAACgB,KAAK,CAAC;IACvCH,OAAO,EAAEb,SAAS,CAACiB,MAAM;IACzBP,IAAI,EAAEV,SAAS,CAACiB;EAClB,CAAC,CAAC;AACJ,CAAC;AAEDd,2BAA2B,CAACe,SAAS,GAAGJ,+BAA+B;AAEvE,eAAeX,2BAA2B","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epec-fcfm-uchile/frontend-component-header",
3
- "version": "1.0.7",
3
+ "version": "1.0.9",
4
4
  "description": "The standard header for Open edX",
5
5
  "main": "dist/index.js",
6
6
  "publishConfig": {