@anas_hameed/edly-saas-widget 0.2.56 → 0.2.62

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.
@@ -83,28 +83,17 @@ $font-size: 1em;
83
83
  width: 24px;
84
84
  height: 24px;
85
85
  display: inline-flex;
86
- i, span {
86
+ span {
87
87
  display: none;
88
88
  }
89
- &:after {
90
- content: "";
91
- position: absolute;
92
- top: 0;
93
- left: 0;
94
- width: 24px;
95
- height: 24px;
96
- display: block !important;
89
+ i.fab, i.fa-brands {
90
+ font-family: "Font Awesome 6 Brands" !important;
97
91
  }
98
- &.facebook {
99
- &:after {
100
- background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><path stroke='none' d='M0 0h24v24H0z' fill='none'/><path d='M7 10v4h3v7h4v-7h3l1 -4h-4v-2a1 1 0 0 1 1 -1h3v-4h-3a5 5 0 0 0 -5 5v2h-3'/></svg>") no-repeat bottom;
101
- }
92
+ i.fa {
93
+ font-family: "Font Awesome 6 Free" !important;
102
94
  }
103
- &.twitter {
104
- &:after {
105
- background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><path stroke='none' d='M0 0h24v24H0z' fill='none'/><path d='M4 4l11.733 16h4.267l-11.733 -16z'/><path d='M4 20l6.768 -6.768m2.46 -2.46l6.772 -6.772'/></svg>") no-repeat bottom;
106
-
107
- }
95
+ &:hover {
96
+ text-decoration: none;
108
97
  }
109
98
  }
110
99
  }
@@ -526,3 +526,110 @@ li.menu-item-object-menu_openedx {
526
526
  }
527
527
  }
528
528
  }
529
+
530
+ #menu-primary-menu {
531
+ > li {
532
+ &.menu_openedx {
533
+ order: 2;
534
+ margin: 0;
535
+ }
536
+ &.signin_openedx {
537
+ @media (min-width: $mobile-breakpoint) {
538
+ order: 2;
539
+ padding-right: 10px !important;
540
+ }
541
+
542
+ a {
543
+ color: #fff;
544
+ background: $primary-color;
545
+ padding: 8px 16px;
546
+ border-radius: 6px;
547
+
548
+ &:hover::before {
549
+ display: none;
550
+ }
551
+ }
552
+ }
553
+
554
+ &.wpml-ls-item {
555
+ @media (min-width: $mobile-breakpoint) {
556
+ width: 100px;
557
+ margin-left: auto;
558
+ order: 1;
559
+ position: relative;
560
+ right: -30px;
561
+ }
562
+
563
+ > a {
564
+ @media (min-width: $mobile-breakpoint) {
565
+ display: flex;
566
+ align-items: center;
567
+ justify-content: center;
568
+ }
569
+
570
+ pointer-events: none;
571
+
572
+ &::before,
573
+ &::after {
574
+ display: none;
575
+ }
576
+
577
+ img {
578
+ width: 25px;
579
+ height: 25px;
580
+ border-radius: 50%;
581
+ object-fit: cover;
582
+ object-position: center;
583
+ }
584
+ }
585
+
586
+ ul.sub-menu {
587
+ @media (min-width: $mobile-breakpoint) {
588
+ min-width: 80px;
589
+ max-width: 80px;
590
+ }
591
+
592
+ li {
593
+ a {
594
+ @media (min-width: $mobile-breakpoint) {
595
+ min-width: auto;
596
+ text-align: center;
597
+ }
598
+
599
+ @media (min-width: $mobile-breakpoint) {
600
+ padding-left: 0 !important;
601
+
602
+ &:hover {
603
+ background: transparent;
604
+ }
605
+ }
606
+
607
+ img {
608
+ width: 25px;
609
+ height: 25px;
610
+ border-radius: 50%;
611
+ object-fit: cover;
612
+ object-position: center;
613
+ }
614
+ }
615
+ }
616
+ }
617
+ }
618
+ }
619
+ @media (min-width: $mobile-breakpoint) {
620
+ &:not(:has(.wpml-ls-item)) {
621
+ .menu_openedx,
622
+ .signin_openedx {
623
+ margin-left: auto;
624
+ }
625
+ }
626
+ }
627
+
628
+ ul.sub-menu {
629
+ li.user_info_openedx {
630
+ @media (max-width: $mobile-breakpoint) {
631
+ display: none;
632
+ }
633
+ }
634
+ }
635
+ }
package/dist/index.js CHANGED
@@ -3,12 +3,6 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- Object.defineProperty(exports, "DiscussionSidebarWidget", {
7
- enumerable: true,
8
- get: function () {
9
- return _DiscussionSidebarWidget.DiscussionSidebarWidget;
10
- }
11
- });
12
6
  Object.defineProperty(exports, "EdlyLogistrationInfo", {
13
7
  enumerable: true,
14
8
  get: function () {
@@ -74,7 +68,6 @@ var _FooterWidget = _interopRequireDefault(require("./FooterWidget"));
74
68
  var _EmailCheckWidget = require("./EmailCheckWidget");
75
69
  var _EdlyLogistrationInfo = require("./EdlyLogistrationInfo");
76
70
  var _MultiSiteBannerWidget = require("./MultiSiteBannerWidget");
77
- var _DiscussionSidebarWidget = require("./DiscussionSidebarWidget");
78
71
  var _BannerContent = _interopRequireDefault(require("./MultiSiteBannerWidget/BannerContent"));
79
72
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
80
73
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_HeaderWidget","_interopRequireDefault","require","_FooterWidget","_EmailCheckWidget","_EdlyLogistrationInfo","_MultiSiteBannerWidget","_DiscussionSidebarWidget","_BannerContent","e","__esModule","default"],"sources":["../src/index.js"],"sourcesContent":["import HeaderWidget from './HeaderWidget';\nimport FooterWidget from './FooterWidget';\n\nexport { HeaderWidget, FooterWidget };\nexport {\n EmailCheckWidget,\n reducer as emailCheckReducer,\n saga as emailCheckSaga,\n storeName as emailCheckStoreName,\n emailCheckComplete,\n} from './EmailCheckWidget';\nexport { EdlyLogistrationInfo } from './EdlyLogistrationInfo';\nexport { MultiSiteBannerWidget } from './MultiSiteBannerWidget';\nexport { DiscussionSidebarWidget } from './DiscussionSidebarWidget';\nexport { default as MultiSiteBannerContent } from './MultiSiteBannerWidget/BannerContent';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,aAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,aAAA,GAAAF,sBAAA,CAAAC,OAAA;AAGA,IAAAE,iBAAA,GAAAF,OAAA;AAOA,IAAAG,qBAAA,GAAAH,OAAA;AACA,IAAAI,sBAAA,GAAAJ,OAAA;AACA,IAAAK,wBAAA,GAAAL,OAAA;AACA,IAAAM,cAAA,GAAAP,sBAAA,CAAAC,OAAA;AAA0F,SAAAD,uBAAAQ,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["_HeaderWidget","_interopRequireDefault","require","_FooterWidget","_EmailCheckWidget","_EdlyLogistrationInfo","_MultiSiteBannerWidget","_BannerContent","e","__esModule","default"],"sources":["../src/index.js"],"sourcesContent":["import HeaderWidget from './HeaderWidget';\nimport FooterWidget from './FooterWidget';\n\nexport { HeaderWidget, FooterWidget };\nexport {\n EmailCheckWidget,\n reducer as emailCheckReducer,\n saga as emailCheckSaga,\n storeName as emailCheckStoreName,\n emailCheckComplete,\n} from './EmailCheckWidget';\nexport { EdlyLogistrationInfo } from './EdlyLogistrationInfo';\nexport { MultiSiteBannerWidget } from './MultiSiteBannerWidget';\nexport { default as MultiSiteBannerContent } from './MultiSiteBannerWidget/BannerContent';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,aAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,aAAA,GAAAF,sBAAA,CAAAC,OAAA;AAGA,IAAAE,iBAAA,GAAAF,OAAA;AAOA,IAAAG,qBAAA,GAAAH,OAAA;AACA,IAAAI,sBAAA,GAAAJ,OAAA;AACA,IAAAK,cAAA,GAAAN,sBAAA,CAAAC,OAAA;AAA0F,SAAAD,uBAAAO,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anas_hameed/edly-saas-widget",
3
- "version": "0.2.56",
3
+ "version": "0.2.62",
4
4
  "description": "Frontend application template",
5
5
  "main": "dist/index.js",
6
6
  "repository": {
@@ -1,63 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.DiscussionSidebarWidget = void 0;
7
- var _react = require("react");
8
- const COURSE_PAGE_PATTERN = /\/learning\/(course|preview\/course)\/[^/]+\/[^/]+/;
9
- const DISCUSSIONS_IFRAME_SELECTOR = 'iframe[src*="inContextSidebar"]';
10
- const OUTLINE_TOGGLE_SELECTOR = '.outline-sidebar-toggle-btn';
11
- const DiscussionSidebarWidget = () => {
12
- (0, _react.useEffect)(() => {
13
- if (!COURSE_PAGE_PATTERN.test(window.location.pathname)) {
14
- return undefined;
15
- }
16
- let rafId;
17
- let lastHandledPath = null;
18
- const switchToOutline = () => {
19
- const currentPath = window.location.pathname;
20
- if (currentPath === lastHandledPath) {
21
- return;
22
- }
23
- cancelAnimationFrame(rafId);
24
- rafId = requestAnimationFrame(() => {
25
- const outlineToggle = document.querySelector(OUTLINE_TOGGLE_SELECTOR);
26
- if (outlineToggle) {
27
- outlineToggle.click();
28
- } else {
29
- // Mobile or outline unavailable — just close discussions
30
- window.postMessage({
31
- type: 'learning.events.sidebar.close'
32
- }, window.location.origin);
33
- }
34
- lastHandledPath = currentPath;
35
- });
36
- };
37
- if (document.querySelector(DISCUSSIONS_IFRAME_SELECTOR)) {
38
- switchToOutline();
39
- }
40
-
41
- // Stay alive across client-side navigations (next/prev unit).
42
- // SidebarContextProvider resets currentSidebar to discussions on each
43
- // unitId change — observer catches the iframe reappearing and switches
44
- // back to outline. lastHandledPath prevents interfering when the user
45
- // manually opens discussions on the same page.
46
- const observer = new MutationObserver(() => {
47
- if (document.querySelector(DISCUSSIONS_IFRAME_SELECTOR)) {
48
- switchToOutline();
49
- }
50
- });
51
- observer.observe(document.body, {
52
- childList: true,
53
- subtree: true
54
- });
55
- return () => {
56
- observer.disconnect();
57
- cancelAnimationFrame(rafId);
58
- };
59
- }, []);
60
- return null;
61
- };
62
- exports.DiscussionSidebarWidget = DiscussionSidebarWidget;
63
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","names":["_react","require","COURSE_PAGE_PATTERN","DISCUSSIONS_IFRAME_SELECTOR","OUTLINE_TOGGLE_SELECTOR","DiscussionSidebarWidget","useEffect","test","window","location","pathname","undefined","rafId","lastHandledPath","switchToOutline","currentPath","cancelAnimationFrame","requestAnimationFrame","outlineToggle","document","querySelector","click","postMessage","type","origin","observer","MutationObserver","observe","body","childList","subtree","disconnect","exports"],"sources":["../../src/DiscussionSidebarWidget/index.jsx"],"sourcesContent":["import { useEffect } from 'react';\n\nconst COURSE_PAGE_PATTERN = /\\/learning\\/(course|preview\\/course)\\/[^/]+\\/[^/]+/;\nconst DISCUSSIONS_IFRAME_SELECTOR = 'iframe[src*=\"inContextSidebar\"]';\nconst OUTLINE_TOGGLE_SELECTOR = '.outline-sidebar-toggle-btn';\n\nconst DiscussionSidebarWidget = () => {\n useEffect(() => {\n if (!COURSE_PAGE_PATTERN.test(window.location.pathname)) { return undefined; }\n\n let rafId;\n let lastHandledPath = null;\n\n const switchToOutline = () => {\n const currentPath = window.location.pathname;\n if (currentPath === lastHandledPath) { return; }\n\n cancelAnimationFrame(rafId);\n rafId = requestAnimationFrame(() => {\n const outlineToggle = document.querySelector(OUTLINE_TOGGLE_SELECTOR);\n if (outlineToggle) {\n outlineToggle.click();\n } else {\n // Mobile or outline unavailable — just close discussions\n window.postMessage({ type: 'learning.events.sidebar.close' }, window.location.origin);\n }\n lastHandledPath = currentPath;\n });\n };\n\n if (document.querySelector(DISCUSSIONS_IFRAME_SELECTOR)) {\n switchToOutline();\n }\n\n // Stay alive across client-side navigations (next/prev unit).\n // SidebarContextProvider resets currentSidebar to discussions on each\n // unitId change — observer catches the iframe reappearing and switches\n // back to outline. lastHandledPath prevents interfering when the user\n // manually opens discussions on the same page.\n const observer = new MutationObserver(() => {\n if (document.querySelector(DISCUSSIONS_IFRAME_SELECTOR)) {\n switchToOutline();\n }\n });\n\n observer.observe(document.body, { childList: true, subtree: true });\n\n return () => {\n observer.disconnect();\n cancelAnimationFrame(rafId);\n };\n }, []);\n\n return null;\n};\n\nexport { DiscussionSidebarWidget };\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEA,MAAMC,mBAAmB,GAAG,oDAAoD;AAChF,MAAMC,2BAA2B,GAAG,iCAAiC;AACrE,MAAMC,uBAAuB,GAAG,6BAA6B;AAE7D,MAAMC,uBAAuB,GAAGA,CAAA,KAAM;EACpC,IAAAC,gBAAS,EAAC,MAAM;IACd,IAAI,CAACJ,mBAAmB,CAACK,IAAI,CAACC,MAAM,CAACC,QAAQ,CAACC,QAAQ,CAAC,EAAE;MAAE,OAAOC,SAAS;IAAE;IAE7E,IAAIC,KAAK;IACT,IAAIC,eAAe,GAAG,IAAI;IAE1B,MAAMC,eAAe,GAAGA,CAAA,KAAM;MAC5B,MAAMC,WAAW,GAAGP,MAAM,CAACC,QAAQ,CAACC,QAAQ;MAC5C,IAAIK,WAAW,KAAKF,eAAe,EAAE;QAAE;MAAQ;MAE/CG,oBAAoB,CAACJ,KAAK,CAAC;MAC3BA,KAAK,GAAGK,qBAAqB,CAAC,MAAM;QAClC,MAAMC,aAAa,GAAGC,QAAQ,CAACC,aAAa,CAAChB,uBAAuB,CAAC;QACrE,IAAIc,aAAa,EAAE;UACjBA,aAAa,CAACG,KAAK,CAAC,CAAC;QACvB,CAAC,MAAM;UACL;UACAb,MAAM,CAACc,WAAW,CAAC;YAAEC,IAAI,EAAE;UAAgC,CAAC,EAAEf,MAAM,CAACC,QAAQ,CAACe,MAAM,CAAC;QACvF;QACAX,eAAe,GAAGE,WAAW;MAC/B,CAAC,CAAC;IACJ,CAAC;IAED,IAAII,QAAQ,CAACC,aAAa,CAACjB,2BAA2B,CAAC,EAAE;MACvDW,eAAe,CAAC,CAAC;IACnB;;IAEA;IACA;IACA;IACA;IACA;IACA,MAAMW,QAAQ,GAAG,IAAIC,gBAAgB,CAAC,MAAM;MAC1C,IAAIP,QAAQ,CAACC,aAAa,CAACjB,2BAA2B,CAAC,EAAE;QACvDW,eAAe,CAAC,CAAC;MACnB;IACF,CAAC,CAAC;IAEFW,QAAQ,CAACE,OAAO,CAACR,QAAQ,CAACS,IAAI,EAAE;MAAEC,SAAS,EAAE,IAAI;MAAEC,OAAO,EAAE;IAAK,CAAC,CAAC;IAEnE,OAAO,MAAM;MACXL,QAAQ,CAACM,UAAU,CAAC,CAAC;MACrBf,oBAAoB,CAACJ,KAAK,CAAC;IAC7B,CAAC;EACH,CAAC,EAAE,EAAE,CAAC;EAEN,OAAO,IAAI;AACb,CAAC;AAACoB,OAAA,CAAA3B,uBAAA,GAAAA,uBAAA","ignoreList":[]}