@bigbinary/neeto-molecules 1.0.22 → 1.0.24

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.
@@ -3,7 +3,6 @@
3
3
  var React = require('react');
4
4
  var ramda = require('ramda');
5
5
  var reactRouterDom = require('react-router-dom');
6
- var reactUtils = require('@bigbinary/neeto-commons-frontend/react-utils');
7
6
  var neetoIcons = require('@bigbinary/neeto-icons');
8
7
  var neetoui = require('@bigbinary/neetoui');
9
8
  var reactI18next = require('react-i18next');
@@ -32605,9 +32604,499 @@ var Portal = function Portal(_ref) {
32605
32604
  return /*#__PURE__*/reactDom.exports.createPortal(children, target.current);
32606
32605
  };
32607
32606
 
32607
+ function cov_1r2ywuxngm() {
32608
+ var path = "/home/runner/work/neeto-molecules/neeto-molecules/src/components/Sidebar/AppSwitcher/utils.js";
32609
+ var hash = "288fa234e84e26ed8fa5ff782656864c5f046c27";
32610
+ var global = new Function("return this")();
32611
+ var gcv = "__coverage__";
32612
+ var coverageData = {
32613
+ path: "/home/runner/work/neeto-molecules/neeto-molecules/src/components/Sidebar/AppSwitcher/utils.js",
32614
+ statementMap: {
32615
+ "0": {
32616
+ start: {
32617
+ line: 3,
32618
+ column: 33
32619
+ },
32620
+ end: {
32621
+ line: 29,
32622
+ column: 1
32623
+ }
32624
+ },
32625
+ "1": {
32626
+ start: {
32627
+ line: 4,
32628
+ column: 2
32629
+ },
32630
+ end: {
32631
+ line: 28,
32632
+ column: 39
32633
+ }
32634
+ },
32635
+ "2": {
32636
+ start: {
32637
+ line: 5,
32638
+ column: 21
32639
+ },
32640
+ end: {
32641
+ line: 20,
32642
+ column: 5
32643
+ }
32644
+ },
32645
+ "3": {
32646
+ start: {
32647
+ line: 7,
32648
+ column: 6
32649
+ },
32650
+ end: {
32651
+ line: 9,
32652
+ column: 7
32653
+ }
32654
+ },
32655
+ "4": {
32656
+ start: {
32657
+ line: 8,
32658
+ column: 8
32659
+ },
32660
+ end: {
32661
+ line: 8,
32662
+ column: 15
32663
+ }
32664
+ },
32665
+ "5": {
32666
+ start: {
32667
+ line: 11,
32668
+ column: 6
32669
+ },
32670
+ end: {
32671
+ line: 18,
32672
+ column: 7
32673
+ }
32674
+ },
32675
+ "6": {
32676
+ start: {
32677
+ line: 13,
32678
+ column: 8
32679
+ },
32680
+ end: {
32681
+ line: 15,
32682
+ column: 9
32683
+ }
32684
+ },
32685
+ "7": {
32686
+ start: {
32687
+ line: 14,
32688
+ column: 10
32689
+ },
32690
+ end: {
32691
+ line: 14,
32692
+ column: 25
32693
+ }
32694
+ },
32695
+ "8": {
32696
+ start: {
32697
+ line: 17,
32698
+ column: 8
32699
+ },
32700
+ end: {
32701
+ line: 17,
32702
+ column: 15
32703
+ }
32704
+ },
32705
+ "9": {
32706
+ start: {
32707
+ line: 19,
32708
+ column: 6
32709
+ },
32710
+ end: {
32711
+ line: 19,
32712
+ column: 21
32713
+ }
32714
+ },
32715
+ "10": {
32716
+ start: {
32717
+ line: 21,
32718
+ column: 4
32719
+ },
32720
+ end: {
32721
+ line: 21,
32722
+ column: 53
32723
+ }
32724
+ },
32725
+ "11": {
32726
+ start: {
32727
+ line: 22,
32728
+ column: 4
32729
+ },
32730
+ end: {
32731
+ line: 22,
32732
+ column: 54
32733
+ }
32734
+ },
32735
+ "12": {
32736
+ start: {
32737
+ line: 24,
32738
+ column: 4
32739
+ },
32740
+ end: {
32741
+ line: 27,
32742
+ column: 6
32743
+ }
32744
+ },
32745
+ "13": {
32746
+ start: {
32747
+ line: 25,
32748
+ column: 6
32749
+ },
32750
+ end: {
32751
+ line: 25,
32752
+ column: 58
32753
+ }
32754
+ },
32755
+ "14": {
32756
+ start: {
32757
+ line: 26,
32758
+ column: 6
32759
+ },
32760
+ end: {
32761
+ line: 26,
32762
+ column: 59
32763
+ }
32764
+ }
32765
+ },
32766
+ fnMap: {
32767
+ "0": {
32768
+ name: "(anonymous_0)",
32769
+ decl: {
32770
+ start: {
32771
+ line: 3,
32772
+ column: 33
32773
+ },
32774
+ end: {
32775
+ line: 3,
32776
+ column: 34
32777
+ }
32778
+ },
32779
+ loc: {
32780
+ start: {
32781
+ line: 3,
32782
+ column: 69
32783
+ },
32784
+ end: {
32785
+ line: 29,
32786
+ column: 1
32787
+ }
32788
+ },
32789
+ line: 3
32790
+ },
32791
+ "1": {
32792
+ name: "(anonymous_1)",
32793
+ decl: {
32794
+ start: {
32795
+ line: 4,
32796
+ column: 12
32797
+ },
32798
+ end: {
32799
+ line: 4,
32800
+ column: 13
32801
+ }
32802
+ },
32803
+ loc: {
32804
+ start: {
32805
+ line: 4,
32806
+ column: 18
32807
+ },
32808
+ end: {
32809
+ line: 28,
32810
+ column: 3
32811
+ }
32812
+ },
32813
+ line: 4
32814
+ },
32815
+ "2": {
32816
+ name: "(anonymous_2)",
32817
+ decl: {
32818
+ start: {
32819
+ line: 5,
32820
+ column: 21
32821
+ },
32822
+ end: {
32823
+ line: 5,
32824
+ column: 22
32825
+ }
32826
+ },
32827
+ loc: {
32828
+ start: {
32829
+ line: 5,
32830
+ column: 30
32831
+ },
32832
+ end: {
32833
+ line: 20,
32834
+ column: 5
32835
+ }
32836
+ },
32837
+ line: 5
32838
+ },
32839
+ "3": {
32840
+ name: "(anonymous_3)",
32841
+ decl: {
32842
+ start: {
32843
+ line: 24,
32844
+ column: 11
32845
+ },
32846
+ end: {
32847
+ line: 24,
32848
+ column: 12
32849
+ }
32850
+ },
32851
+ loc: {
32852
+ start: {
32853
+ line: 24,
32854
+ column: 17
32855
+ },
32856
+ end: {
32857
+ line: 27,
32858
+ column: 5
32859
+ }
32860
+ },
32861
+ line: 24
32862
+ }
32863
+ },
32864
+ branchMap: {
32865
+ "0": {
32866
+ loc: {
32867
+ start: {
32868
+ line: 7,
32869
+ column: 6
32870
+ },
32871
+ end: {
32872
+ line: 9,
32873
+ column: 7
32874
+ }
32875
+ },
32876
+ type: "if",
32877
+ locations: [{
32878
+ start: {
32879
+ line: 7,
32880
+ column: 6
32881
+ },
32882
+ end: {
32883
+ line: 9,
32884
+ column: 7
32885
+ }
32886
+ }, {
32887
+ start: {
32888
+ line: undefined,
32889
+ column: undefined
32890
+ },
32891
+ end: {
32892
+ line: undefined,
32893
+ column: undefined
32894
+ }
32895
+ }],
32896
+ line: 7
32897
+ },
32898
+ "1": {
32899
+ loc: {
32900
+ start: {
32901
+ line: 7,
32902
+ column: 10
32903
+ },
32904
+ end: {
32905
+ line: 7,
32906
+ column: 72
32907
+ }
32908
+ },
32909
+ type: "binary-expr",
32910
+ locations: [{
32911
+ start: {
32912
+ line: 7,
32913
+ column: 10
32914
+ },
32915
+ end: {
32916
+ line: 7,
32917
+ column: 28
32918
+ }
32919
+ }, {
32920
+ start: {
32921
+ line: 7,
32922
+ column: 32
32923
+ },
32924
+ end: {
32925
+ line: 7,
32926
+ column: 72
32927
+ }
32928
+ }],
32929
+ line: 7
32930
+ },
32931
+ "2": {
32932
+ loc: {
32933
+ start: {
32934
+ line: 11,
32935
+ column: 6
32936
+ },
32937
+ end: {
32938
+ line: 18,
32939
+ column: 7
32940
+ }
32941
+ },
32942
+ type: "if",
32943
+ locations: [{
32944
+ start: {
32945
+ line: 11,
32946
+ column: 6
32947
+ },
32948
+ end: {
32949
+ line: 18,
32950
+ column: 7
32951
+ }
32952
+ }, {
32953
+ start: {
32954
+ line: undefined,
32955
+ column: undefined
32956
+ },
32957
+ end: {
32958
+ line: undefined,
32959
+ column: undefined
32960
+ }
32961
+ }],
32962
+ line: 11
32963
+ },
32964
+ "3": {
32965
+ loc: {
32966
+ start: {
32967
+ line: 13,
32968
+ column: 8
32969
+ },
32970
+ end: {
32971
+ line: 15,
32972
+ column: 9
32973
+ }
32974
+ },
32975
+ type: "if",
32976
+ locations: [{
32977
+ start: {
32978
+ line: 13,
32979
+ column: 8
32980
+ },
32981
+ end: {
32982
+ line: 15,
32983
+ column: 9
32984
+ }
32985
+ }, {
32986
+ start: {
32987
+ line: undefined,
32988
+ column: undefined
32989
+ },
32990
+ end: {
32991
+ line: undefined,
32992
+ column: undefined
32993
+ }
32994
+ }],
32995
+ line: 13
32996
+ }
32997
+ },
32998
+ s: {
32999
+ "0": 0,
33000
+ "1": 0,
33001
+ "2": 0,
33002
+ "3": 0,
33003
+ "4": 0,
33004
+ "5": 0,
33005
+ "6": 0,
33006
+ "7": 0,
33007
+ "8": 0,
33008
+ "9": 0,
33009
+ "10": 0,
33010
+ "11": 0,
33011
+ "12": 0,
33012
+ "13": 0,
33013
+ "14": 0
33014
+ },
33015
+ f: {
33016
+ "0": 0,
33017
+ "1": 0,
33018
+ "2": 0,
33019
+ "3": 0
33020
+ },
33021
+ b: {
33022
+ "0": [0, 0],
33023
+ "1": [0, 0],
33024
+ "2": [0, 0],
33025
+ "3": [0, 0]
33026
+ },
33027
+ _coverageSchema: "1a1c01bbd47fc00a2c39e90264f33305004495a9",
33028
+ hash: "288fa234e84e26ed8fa5ff782656864c5f046c27"
33029
+ };
33030
+ var coverage = global[gcv] || (global[gcv] = {});
33031
+ if (!coverage[path] || coverage[path].hash !== hash) {
33032
+ coverage[path] = coverageData;
33033
+ }
33034
+ var actualCoverage = coverage[path];
33035
+ {
33036
+ // @ts-ignore
33037
+ cov_1r2ywuxngm = function () {
33038
+ return actualCoverage;
33039
+ };
33040
+ }
33041
+ return actualCoverage;
33042
+ }
33043
+ cov_1r2ywuxngm();
33044
+ cov_1r2ywuxngm().s[0]++;
33045
+ var useOnClickOutside = function useOnClickOutside(insideRef, outsideRef, handler) {
33046
+ cov_1r2ywuxngm().f[0]++;
33047
+ cov_1r2ywuxngm().s[1]++;
33048
+ React.useEffect(function () {
33049
+ cov_1r2ywuxngm().f[1]++;
33050
+ cov_1r2ywuxngm().s[2]++;
33051
+ var listener = function listener(event) {
33052
+ cov_1r2ywuxngm().f[2]++;
33053
+ cov_1r2ywuxngm().s[3]++;
33054
+ // Do nothing if clicking ref's element or descendent elements
33055
+ if ((cov_1r2ywuxngm().b[1][0]++, !insideRef.current) || (cov_1r2ywuxngm().b[1][1]++, insideRef.current.contains(event.target))) {
33056
+ cov_1r2ywuxngm().b[0][0]++;
33057
+ cov_1r2ywuxngm().s[4]++;
33058
+ return;
33059
+ } else {
33060
+ cov_1r2ywuxngm().b[0][1]++;
33061
+ }
33062
+ cov_1r2ywuxngm().s[5]++;
33063
+ if (outsideRef.current) {
33064
+ cov_1r2ywuxngm().b[2][0]++;
33065
+ cov_1r2ywuxngm().s[6]++;
33066
+ // If Outside ref exists, trigger the handler if it contains the event target.
33067
+ if (outsideRef.current.contains(event.target)) {
33068
+ cov_1r2ywuxngm().b[3][0]++;
33069
+ cov_1r2ywuxngm().s[7]++;
33070
+ handler(event);
33071
+ } else {
33072
+ cov_1r2ywuxngm().b[3][1]++;
33073
+ }
33074
+ cov_1r2ywuxngm().s[8]++;
33075
+ return;
33076
+ } else {
33077
+ cov_1r2ywuxngm().b[2][1]++;
33078
+ }
33079
+ cov_1r2ywuxngm().s[9]++;
33080
+ handler(event);
33081
+ };
33082
+ cov_1r2ywuxngm().s[10]++;
33083
+ document.addEventListener("mousedown", listener);
33084
+ cov_1r2ywuxngm().s[11]++;
33085
+ document.addEventListener("touchstart", listener);
33086
+ cov_1r2ywuxngm().s[12]++;
33087
+ return function () {
33088
+ cov_1r2ywuxngm().f[3]++;
33089
+ cov_1r2ywuxngm().s[13]++;
33090
+ document.removeEventListener("mousedown", listener);
33091
+ cov_1r2ywuxngm().s[14]++;
33092
+ document.removeEventListener("touchstart", listener);
33093
+ };
33094
+ }, [insideRef, outsideRef, handler]);
33095
+ };
33096
+
32608
33097
  function cov_2lck7amjw7() {
32609
33098
  var path = "/home/runner/work/neeto-molecules/neeto-molecules/src/components/Sidebar/AppSwitcher/index.jsx";
32610
- var hash = "9e7dfb5276cd6b4e1c47045af63d80b09e5c44ed";
33099
+ var hash = "f48177db9e544dcc6e11b963cf49f5c34e8e9e6d";
32611
33100
  var global = new Function("return this")();
32612
33101
  var gcv = "__coverage__";
32613
33102
  var coverageData = {
@@ -32650,7 +33139,7 @@ function cov_2lck7amjw7() {
32650
33139
  },
32651
33140
  end: {
32652
33141
  line: 16,
32653
- column: 42
33142
+ column: 55
32654
33143
  }
32655
33144
  },
32656
33145
  "4": {
@@ -32714,7 +33203,7 @@ function cov_2lck7amjw7() {
32714
33203
  },
32715
33204
  b: {},
32716
33205
  _coverageSchema: "1a1c01bbd47fc00a2c39e90264f33305004495a9",
32717
- hash: "9e7dfb5276cd6b4e1c47045af63d80b09e5c44ed"
33206
+ hash: "f48177db9e544dcc6e11b963cf49f5c34e8e9e6d"
32718
33207
  };
32719
33208
  var coverage = global[gcv] || (global[gcv] = {});
32720
33209
  if (!coverage[path] || coverage[path].hash !== hash) {
@@ -32738,7 +33227,7 @@ var AppSwitcher = function AppSwitcher(_ref) {
32738
33227
  var paneWrapper = (cov_2lck7amjw7().s[1]++, React.useRef(null));
32739
33228
  var backdropRef = (cov_2lck7amjw7().s[2]++, React.useRef(null));
32740
33229
  cov_2lck7amjw7().s[3]++;
32741
- reactUtils.useOnClickOutside(backdropRef, onClose);
33230
+ useOnClickOutside(paneWrapper, backdropRef, onClose);
32742
33231
  cov_2lck7amjw7().s[4]++;
32743
33232
  useHotkeys("esc", onClose);
32744
33233
  cov_2lck7amjw7().s[5]++;
@@ -35046,7 +35535,7 @@ var Footer = function Footer(_ref) {
35046
35535
 
35047
35536
  function cov_17k34ad0bz() {
35048
35537
  var path = "/home/runner/work/neeto-molecules/neeto-molecules/src/components/Sidebar/Header.jsx";
35049
- var hash = "a9924345c51fae250c82767af6b2cf501c3bc435";
35538
+ var hash = "fff7fb107aeb6ef1908194eb0afb1951e6504740";
35050
35539
  var global = new Function("return this")();
35051
35540
  var gcv = "__coverage__";
35052
35541
  var coverageData = {
@@ -35054,41 +35543,51 @@ function cov_17k34ad0bz() {
35054
35543
  statementMap: {
35055
35544
  "0": {
35056
35545
  start: {
35057
- line: 9,
35546
+ line: 10,
35058
35547
  column: 15
35059
35548
  },
35060
35549
  end: {
35061
- line: 26,
35550
+ line: 36,
35062
35551
  column: 1
35063
35552
  }
35064
35553
  },
35065
35554
  "1": {
35066
35555
  start: {
35067
- line: 10,
35556
+ line: 11,
35068
35557
  column: 19
35069
35558
  },
35070
35559
  end: {
35071
- line: 12,
35560
+ line: 13,
35072
35561
  column: 5
35073
35562
  }
35074
35563
  },
35075
35564
  "2": {
35076
35565
  start: {
35077
- line: 14,
35566
+ line: 15,
35078
35567
  column: 22
35079
35568
  },
35080
35569
  end: {
35081
- line: 14,
35570
+ line: 15,
35082
35571
  column: 44
35083
35572
  }
35084
35573
  },
35085
35574
  "3": {
35086
35575
  start: {
35087
- line: 16,
35576
+ line: 17,
35577
+ column: 18
35578
+ },
35579
+ end: {
35580
+ line: 22,
35581
+ column: 3
35582
+ }
35583
+ },
35584
+ "4": {
35585
+ start: {
35586
+ line: 24,
35088
35587
  column: 2
35089
35588
  },
35090
35589
  end: {
35091
- line: 25,
35590
+ line: 35,
35092
35591
  column: 4
35093
35592
  }
35094
35593
  }
@@ -35098,67 +35597,68 @@ function cov_17k34ad0bz() {
35098
35597
  name: "(anonymous_0)",
35099
35598
  decl: {
35100
35599
  start: {
35101
- line: 9,
35600
+ line: 10,
35102
35601
  column: 15
35103
35602
  },
35104
35603
  end: {
35105
- line: 9,
35604
+ line: 10,
35106
35605
  column: 16
35107
35606
  }
35108
35607
  },
35109
35608
  loc: {
35110
35609
  start: {
35111
- line: 9,
35610
+ line: 10,
35112
35611
  column: 21
35113
35612
  },
35114
35613
  end: {
35115
- line: 26,
35614
+ line: 36,
35116
35615
  column: 1
35117
35616
  }
35118
35617
  },
35119
- line: 9
35618
+ line: 10
35120
35619
  }
35121
35620
  },
35122
35621
  branchMap: {
35123
35622
  "0": {
35124
35623
  loc: {
35125
35624
  start: {
35126
- line: 22,
35127
- column: 9
35625
+ line: 31,
35626
+ column: 11
35128
35627
  },
35129
35628
  end: {
35130
- line: 22,
35131
- column: 50
35629
+ line: 31,
35630
+ column: 52
35132
35631
  }
35133
35632
  },
35134
35633
  type: "cond-expr",
35135
35634
  locations: [{
35136
35635
  start: {
35137
- line: 22,
35138
- column: 23
35636
+ line: 31,
35637
+ column: 25
35139
35638
  },
35140
35639
  end: {
35141
- line: 22,
35142
- column: 38
35640
+ line: 31,
35641
+ column: 40
35143
35642
  }
35144
35643
  }, {
35145
35644
  start: {
35146
- line: 22,
35147
- column: 41
35645
+ line: 31,
35646
+ column: 43
35148
35647
  },
35149
35648
  end: {
35150
- line: 22,
35151
- column: 50
35649
+ line: 31,
35650
+ column: 52
35152
35651
  }
35153
35652
  }],
35154
- line: 22
35653
+ line: 31
35155
35654
  }
35156
35655
  },
35157
35656
  s: {
35158
35657
  "0": 0,
35159
35658
  "1": 0,
35160
35659
  "2": 0,
35161
- "3": 0
35660
+ "3": 0,
35661
+ "4": 0
35162
35662
  },
35163
35663
  f: {
35164
35664
  "0": 0
@@ -35167,7 +35667,7 @@ function cov_17k34ad0bz() {
35167
35667
  "0": [0, 0]
35168
35668
  },
35169
35669
  _coverageSchema: "1a1c01bbd47fc00a2c39e90264f33305004495a9",
35170
- hash: "a9924345c51fae250c82767af6b2cf501c3bc435"
35670
+ hash: "fff7fb107aeb6ef1908194eb0afb1951e6504740"
35171
35671
  };
35172
35672
  var coverage = global[gcv] || (global[gcv] = {});
35173
35673
  if (!coverage[path] || coverage[path].hash !== hash) {
@@ -35188,13 +35688,18 @@ var Header = function Header() {
35188
35688
  cov_17k34ad0bz().f[0]++;
35189
35689
  var logoName = (cov_17k34ad0bz().s[1]++, "Neeto".concat(pure.capitalize(globalProps.appName.substr(5).toLowerCase())));
35190
35690
  var ProductLogo = (cov_17k34ad0bz().s[2]++, ProductLogos__namespace[logoName]);
35191
- cov_17k34ad0bz().s[3]++;
35691
+ var homeUrl = (cov_17k34ad0bz().s[3]++, new URL(pure.findBy({
35692
+ name: globalProps.appName.split("neeto")[1]
35693
+ }, globalProps.neetoApps).url));
35694
+ cov_17k34ad0bz().s[4]++;
35192
35695
  return /*#__PURE__*/React__default["default"].createElement("div", {
35193
35696
  className: "neeto-ui-flex neeto-ui-items-center neeto-molecules-sidebar__header",
35194
35697
  "data-cy": "sidebar-info"
35195
35698
  }, /*#__PURE__*/React__default["default"].createElement("div", {
35196
35699
  className: "neeto-molecules-sidebar__logo flex flex-shrink-0 items-center justify-center"
35197
- }, ProductLogo ? (cov_17k34ad0bz().b[0][0]++, /*#__PURE__*/React__default["default"].createElement(ProductLogo, null)) : (cov_17k34ad0bz().b[0][1]++, /*#__PURE__*/React__default["default"].createElement(ProductLogos.Neeto, null))));
35700
+ }, /*#__PURE__*/React__default["default"].createElement(reactRouterDom.Link, {
35701
+ to: homeUrl.pathname
35702
+ }, ProductLogo ? (cov_17k34ad0bz().b[0][0]++, /*#__PURE__*/React__default["default"].createElement(ProductLogo, null)) : (cov_17k34ad0bz().b[0][1]++, /*#__PURE__*/React__default["default"].createElement(ProductLogos.Neeto, null)))));
35198
35703
  };
35199
35704
 
35200
35705
  var _excluded = ["label", "to", "icon", "description"];