@mjhls/mjh-framework 1.0.974-identify → 1.0.974-rec-article-test
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.
- package/dist/cjs/View.js +22 -22
- package/dist/esm/View.js +22 -22
- package/package.json +1 -1
package/dist/cjs/View.js
CHANGED
|
@@ -32,7 +32,7 @@ var disqusReact = require('disqus-react');
|
|
|
32
32
|
var Schema = require('./Schema.js');
|
|
33
33
|
var _commonjsHelpers = require('./_commonjsHelpers-06173234.js');
|
|
34
34
|
var PixelTracking = require('./PixelTracking.js');
|
|
35
|
-
|
|
35
|
+
require('./Segment.js');
|
|
36
36
|
var keys = require('./keys-e982b3fa.js');
|
|
37
37
|
var index_es = require('./index.es-f3e47207.js');
|
|
38
38
|
var index = require('./index-fc2f1ca2.js');
|
|
@@ -605,11 +605,10 @@ var Recommended = function Recommended(props) {
|
|
|
605
605
|
switch (_context3.prev = _context3.next) {
|
|
606
606
|
case 0:
|
|
607
607
|
storedUsers = false;
|
|
608
|
+
// Segment.identifyWithEmail('arthur@sato.org')
|
|
608
609
|
|
|
609
|
-
Segment.identifyWithEmail('arthur@sato.org');
|
|
610
610
|
anonymousId = analytics.user().anonymousId();
|
|
611
|
-
|
|
612
|
-
console.log('anonymousId', anonymousId);
|
|
611
|
+
// console.log('anonymousId', anonymousId)
|
|
613
612
|
|
|
614
613
|
// Segment.createGroup('9e4fb278-daa9-448a-bf46-d168085d9126', anonymousI'onclive_test3')
|
|
615
614
|
// Segment.identifyWithGroup('9e4fb278-daa9-448a-bf46-d168085d9126', anonId)
|
|
@@ -627,28 +626,29 @@ var Recommended = function Recommended(props) {
|
|
|
627
626
|
// if (e) console.log(`Error: ${e}`)
|
|
628
627
|
// }
|
|
629
628
|
// }
|
|
629
|
+
|
|
630
630
|
try {
|
|
631
631
|
trackedEmailRecs(anonymousId, '9e4fb278-daa9-448a-bf46-d168085d9126');
|
|
632
632
|
} catch (e) {
|
|
633
633
|
if (e) console.log('Error: ' + e);
|
|
634
634
|
}
|
|
635
635
|
// else {
|
|
636
|
-
_context3.next =
|
|
636
|
+
_context3.next = 5;
|
|
637
637
|
return fetch('/api/getSegmentProfile', {
|
|
638
638
|
method: 'POST',
|
|
639
639
|
body: stringify._JSON$stringify({ anonymousId: anonymousId })
|
|
640
640
|
});
|
|
641
641
|
|
|
642
|
-
case
|
|
642
|
+
case 5:
|
|
643
643
|
response = _context3.sent;
|
|
644
|
-
_context3.next =
|
|
644
|
+
_context3.next = 8;
|
|
645
645
|
return response.json();
|
|
646
646
|
|
|
647
|
-
case
|
|
647
|
+
case 8:
|
|
648
648
|
data = _context3.sent;
|
|
649
649
|
|
|
650
650
|
if (!(data && data.traits && data.traits.most_frequent_category)) {
|
|
651
|
-
_context3.next =
|
|
651
|
+
_context3.next = 42;
|
|
652
652
|
break;
|
|
653
653
|
}
|
|
654
654
|
|
|
@@ -673,25 +673,25 @@ var Recommended = function Recommended(props) {
|
|
|
673
673
|
|
|
674
674
|
// grab contentCategory ID
|
|
675
675
|
|
|
676
|
-
_context3.next =
|
|
676
|
+
_context3.next = 14;
|
|
677
677
|
return client.fetch("*[_type == 'contentCategory' && name == 'Articles'][0]{_id}");
|
|
678
678
|
|
|
679
|
-
case
|
|
679
|
+
case 14:
|
|
680
680
|
articlesCategory = _context3.sent;
|
|
681
|
-
_context3.next =
|
|
681
|
+
_context3.next = 17;
|
|
682
682
|
return client.fetch("*[_type == 'contentCategory' && name == 'Videos'][0]{_id}");
|
|
683
683
|
|
|
684
|
-
case
|
|
684
|
+
case 17:
|
|
685
685
|
videosCategory = _context3.sent;
|
|
686
|
-
_context3.next =
|
|
686
|
+
_context3.next = 20;
|
|
687
687
|
return client.fetch("*[_type == 'contentCategory' && name == 'Podcasts'][0]{_id}");
|
|
688
688
|
|
|
689
|
-
case
|
|
689
|
+
case 20:
|
|
690
690
|
podcastCategory = _context3.sent;
|
|
691
|
-
_context3.next =
|
|
691
|
+
_context3.next = 23;
|
|
692
692
|
return client.fetch('*[_type == \'taxonomy\' ' + addTaxonomyName(favoriteCategories) + ']');
|
|
693
693
|
|
|
694
|
-
case
|
|
694
|
+
case 23:
|
|
695
695
|
taxonomyCategories = _context3.sent;
|
|
696
696
|
taxonomies = '';
|
|
697
697
|
|
|
@@ -711,10 +711,10 @@ var Recommended = function Recommended(props) {
|
|
|
711
711
|
params = {
|
|
712
712
|
id: article._id
|
|
713
713
|
};
|
|
714
|
-
_context3.next =
|
|
714
|
+
_context3.next = 33;
|
|
715
715
|
return asyncToGenerator._Promise.all([client.fetch(articlesQuery, params), client.fetch(videosQuery, params), client.fetch(podcastQuery, params)]);
|
|
716
716
|
|
|
717
|
-
case
|
|
717
|
+
case 33:
|
|
718
718
|
_ref4 = _context3.sent;
|
|
719
719
|
_ref5 = slicedToArray._slicedToArray(_ref4, 3);
|
|
720
720
|
_articles = _ref5[0];
|
|
@@ -736,13 +736,13 @@ var Recommended = function Recommended(props) {
|
|
|
736
736
|
}
|
|
737
737
|
setArticles(_articles);
|
|
738
738
|
}
|
|
739
|
-
_context3.next =
|
|
739
|
+
_context3.next = 43;
|
|
740
740
|
break;
|
|
741
741
|
|
|
742
|
-
case
|
|
742
|
+
case 42:
|
|
743
743
|
setLoaded('failed');
|
|
744
744
|
|
|
745
|
-
case
|
|
745
|
+
case 43:
|
|
746
746
|
case 'end':
|
|
747
747
|
return _context3.stop();
|
|
748
748
|
}
|
package/dist/esm/View.js
CHANGED
|
@@ -30,7 +30,7 @@ import { DiscussionEmbed } from 'disqus-react';
|
|
|
30
30
|
import Schema from './Schema.js';
|
|
31
31
|
import { c as createCommonjsModule, a as commonjsGlobal } from './_commonjsHelpers-0c4b6f40.js';
|
|
32
32
|
import { PixelTrackingArticle } from './PixelTracking.js';
|
|
33
|
-
import
|
|
33
|
+
import './Segment.js';
|
|
34
34
|
import { _ as _Object$keys } from './keys-31dcdb31.js';
|
|
35
35
|
import { I as InfiniteScroll } from './index.es-a6137319.js';
|
|
36
36
|
import { l as lib_3 } from './index-f0fc23eb.js';
|
|
@@ -595,11 +595,10 @@ var Recommended = function Recommended(props) {
|
|
|
595
595
|
switch (_context3.prev = _context3.next) {
|
|
596
596
|
case 0:
|
|
597
597
|
storedUsers = false;
|
|
598
|
+
// Segment.identifyWithEmail('arthur@sato.org')
|
|
598
599
|
|
|
599
|
-
Segment.identifyWithEmail('arthur@sato.org');
|
|
600
600
|
anonymousId = analytics.user().anonymousId();
|
|
601
|
-
|
|
602
|
-
console.log('anonymousId', anonymousId);
|
|
601
|
+
// console.log('anonymousId', anonymousId)
|
|
603
602
|
|
|
604
603
|
// Segment.createGroup('9e4fb278-daa9-448a-bf46-d168085d9126', anonymousI'onclive_test3')
|
|
605
604
|
// Segment.identifyWithGroup('9e4fb278-daa9-448a-bf46-d168085d9126', anonId)
|
|
@@ -617,28 +616,29 @@ var Recommended = function Recommended(props) {
|
|
|
617
616
|
// if (e) console.log(`Error: ${e}`)
|
|
618
617
|
// }
|
|
619
618
|
// }
|
|
619
|
+
|
|
620
620
|
try {
|
|
621
621
|
trackedEmailRecs(anonymousId, '9e4fb278-daa9-448a-bf46-d168085d9126');
|
|
622
622
|
} catch (e) {
|
|
623
623
|
if (e) console.log('Error: ' + e);
|
|
624
624
|
}
|
|
625
625
|
// else {
|
|
626
|
-
_context3.next =
|
|
626
|
+
_context3.next = 5;
|
|
627
627
|
return fetch('/api/getSegmentProfile', {
|
|
628
628
|
method: 'POST',
|
|
629
629
|
body: _JSON$stringify({ anonymousId: anonymousId })
|
|
630
630
|
});
|
|
631
631
|
|
|
632
|
-
case
|
|
632
|
+
case 5:
|
|
633
633
|
response = _context3.sent;
|
|
634
|
-
_context3.next =
|
|
634
|
+
_context3.next = 8;
|
|
635
635
|
return response.json();
|
|
636
636
|
|
|
637
|
-
case
|
|
637
|
+
case 8:
|
|
638
638
|
data = _context3.sent;
|
|
639
639
|
|
|
640
640
|
if (!(data && data.traits && data.traits.most_frequent_category)) {
|
|
641
|
-
_context3.next =
|
|
641
|
+
_context3.next = 42;
|
|
642
642
|
break;
|
|
643
643
|
}
|
|
644
644
|
|
|
@@ -663,25 +663,25 @@ var Recommended = function Recommended(props) {
|
|
|
663
663
|
|
|
664
664
|
// grab contentCategory ID
|
|
665
665
|
|
|
666
|
-
_context3.next =
|
|
666
|
+
_context3.next = 14;
|
|
667
667
|
return client.fetch("*[_type == 'contentCategory' && name == 'Articles'][0]{_id}");
|
|
668
668
|
|
|
669
|
-
case
|
|
669
|
+
case 14:
|
|
670
670
|
articlesCategory = _context3.sent;
|
|
671
|
-
_context3.next =
|
|
671
|
+
_context3.next = 17;
|
|
672
672
|
return client.fetch("*[_type == 'contentCategory' && name == 'Videos'][0]{_id}");
|
|
673
673
|
|
|
674
|
-
case
|
|
674
|
+
case 17:
|
|
675
675
|
videosCategory = _context3.sent;
|
|
676
|
-
_context3.next =
|
|
676
|
+
_context3.next = 20;
|
|
677
677
|
return client.fetch("*[_type == 'contentCategory' && name == 'Podcasts'][0]{_id}");
|
|
678
678
|
|
|
679
|
-
case
|
|
679
|
+
case 20:
|
|
680
680
|
podcastCategory = _context3.sent;
|
|
681
|
-
_context3.next =
|
|
681
|
+
_context3.next = 23;
|
|
682
682
|
return client.fetch('*[_type == \'taxonomy\' ' + addTaxonomyName(favoriteCategories) + ']');
|
|
683
683
|
|
|
684
|
-
case
|
|
684
|
+
case 23:
|
|
685
685
|
taxonomyCategories = _context3.sent;
|
|
686
686
|
taxonomies = '';
|
|
687
687
|
|
|
@@ -701,10 +701,10 @@ var Recommended = function Recommended(props) {
|
|
|
701
701
|
params = {
|
|
702
702
|
id: article._id
|
|
703
703
|
};
|
|
704
|
-
_context3.next =
|
|
704
|
+
_context3.next = 33;
|
|
705
705
|
return _Promise.all([client.fetch(articlesQuery, params), client.fetch(videosQuery, params), client.fetch(podcastQuery, params)]);
|
|
706
706
|
|
|
707
|
-
case
|
|
707
|
+
case 33:
|
|
708
708
|
_ref4 = _context3.sent;
|
|
709
709
|
_ref5 = _slicedToArray(_ref4, 3);
|
|
710
710
|
_articles = _ref5[0];
|
|
@@ -726,13 +726,13 @@ var Recommended = function Recommended(props) {
|
|
|
726
726
|
}
|
|
727
727
|
setArticles(_articles);
|
|
728
728
|
}
|
|
729
|
-
_context3.next =
|
|
729
|
+
_context3.next = 43;
|
|
730
730
|
break;
|
|
731
731
|
|
|
732
|
-
case
|
|
732
|
+
case 42:
|
|
733
733
|
setLoaded('failed');
|
|
734
734
|
|
|
735
|
-
case
|
|
735
|
+
case 43:
|
|
736
736
|
case 'end':
|
|
737
737
|
return _context3.stop();
|
|
738
738
|
}
|