@mjhls/mjh-framework 1.0.426 → 1.0.428

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/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
 
2
- # mjh-framework v. 1.0.426
2
+ # mjh-framework v. 1.0.428
3
3
 
4
4
  > Foundation Framework
5
5
 
package/dist/cjs/index.js CHANGED
@@ -14779,16 +14779,7 @@ Publication.getInitialProps = async (ctx) => {
14779
14779
  const {
14780
14780
  query: { year },
14781
14781
  } = ctx
14782
- const pub = await client.fetch(
14783
- `*[_type == 'publication'
14784
- && identifier.current == $publication][0] {
14785
- ...,
14786
- 'issues': *[_type == 'publication'
14787
- && is_visible
14788
- && references(^._id)] | order(year desc, month desc)
14789
- }`,
14790
- query
14791
- )
14782
+ const pub = await client.fetch(getQuery('publication'), query)
14792
14783
  const builder = imageUrlBuilder(client)
14793
14784
  const urlFor = (source) => {
14794
14785
  return builder.image(source)
@@ -14889,7 +14880,12 @@ var PublicationLanding = function PublicationLanding(props) {
14889
14880
  null,
14890
14881
  issue.name
14891
14882
  ),
14892
- React__default.createElement(
14883
+ publication.displayLabel && React__default.createElement(
14884
+ 'p',
14885
+ { className: 'badge badge-primary' },
14886
+ publication.displayLabel
14887
+ ),
14888
+ issue.volume && issue.number && React__default.createElement(
14893
14889
  'p',
14894
14890
  null,
14895
14891
  'Volume: ',
@@ -16733,21 +16729,19 @@ var InscreenSensor = function (_React$Component) {
16733
16729
  var _this$props$offSetTop = _this.props.offSetTop,
16734
16730
  offSetTop = _this$props$offSetTop === undefined ? 0 : _this$props$offSetTop;
16735
16731
  var top = rect.top,
16736
- height = rect.height;
16732
+ bottom = rect.bottom;
16737
16733
 
16738
- var bottom = top + height;
16739
16734
  var viewHeight = window.innerHeight;
16735
+ var wrpElem = document.getElementsByClassName('inscreen-wrapper');
16740
16736
 
16741
- if (bottom < offSetTop) {
16742
- return false;
16743
- } else if (top > offSetTop && bottom <= viewHeight) {
16744
- return true;
16745
- } else if (top < offSetTop && top <= viewHeight && bottom > viewHeight) {
16746
- return 'top';
16747
- } else if (top < offSetTop && bottom + offSetTop >= viewHeight) {
16737
+ if (top > 0 && top <= offSetTop) {
16738
+ if (wrpElem.length > 1 && top <= viewHeight && bottom > viewHeight) {
16739
+ return 'top';
16740
+ } else if (wrpElem.length > 1 && bottom < viewHeight) {
16741
+ return 'small-top';
16742
+ }
16743
+ } else if (wrpElem.length > 1 && top < offSetTop && bottom + offSetTop >= viewHeight) {
16748
16744
  return 'bottom';
16749
- } else {
16750
- return false;
16751
16745
  }
16752
16746
  };
16753
16747
 
@@ -16775,11 +16769,13 @@ var InscreenSensor = function (_React$Component) {
16775
16769
  _props$className = _props.className,
16776
16770
  className = _props$className === undefined ? '' : _props$className,
16777
16771
  _props$style = _props.style,
16778
- style = _props$style === undefined ? {} : _props$style;
16772
+ style = _props$style === undefined ? {} : _props$style,
16773
+ _props$id = _props.id,
16774
+ id = _props$id === undefined ? '' : _props$id;
16779
16775
 
16780
16776
  return React__default.createElement(
16781
16777
  'div',
16782
- { ref: this.wraperRef, className: className, style: style },
16778
+ { ref: this.wraperRef, className: className, style: style, id: id },
16783
16779
  this.props.children
16784
16780
  );
16785
16781
  }
@@ -16878,7 +16874,9 @@ var Article = function Article(props) {
16878
16874
  changeUrl = props.changeUrl,
16879
16875
  shareOptions = props.shareOptions,
16880
16876
  cpModificationRequired = props.cpModificationRequired,
16881
- authorPrefix = props.authorPrefix;
16877
+ authorPrefix = props.authorPrefix,
16878
+ queueData = props.queueData,
16879
+ lastUrl = props.lastUrl;
16882
16880
 
16883
16881
  var _useState = React.useState(null),
16884
16882
  _useState2 = slicedToArray._slicedToArray(_useState, 2),
@@ -17162,29 +17160,30 @@ var Article = function Article(props) {
17162
17160
  shareImage: shareImage,
17163
17161
  shareVia: props.Settings.title
17164
17162
  };
17165
-
17166
17163
  return React__default.createElement(
17167
17164
  React__default.Fragment,
17168
17165
  null,
17169
17166
  React__default.createElement(
17170
17167
  InscreenSensor,
17171
17168
  {
17172
- offSetTop: 45,
17169
+ offSetTop: 120,
17170
+ className: 'inscreen-wrapper',
17171
+ id: 'article-' + title,
17173
17172
  onChange: function onChange(visible) {
17174
- if (visible !== false) {
17173
+ if (visible === 'top' || visible === 'bottom' || visible === 'small-top') {
17175
17174
  changeUrl(url, visible, meta);
17176
17175
  }
17177
17176
  } },
17178
17177
  React__default.createElement(
17179
17178
  'div',
17180
17179
  null,
17181
- React__default.createElement(
17180
+ queueData && queueData.length === 1 && React__default.createElement(
17182
17181
  Head,
17183
17182
  null,
17184
17183
  React__default.createElement(
17185
17184
  'title',
17186
17185
  { key: 'title' },
17187
- shareTitle + ' | ' + props.cache.siteSettingCache.name
17186
+ '' + shareTitle
17188
17187
  ),
17189
17188
  React__default.createElement('meta', { name: 'description', key: 'description', content: shareSummary }),
17190
17189
  passwordLock && React__default.createElement('meta', { name: 'robots', content: 'noindex, nofollow' }),
@@ -17470,14 +17469,11 @@ var ArticleQueue = function ArticleQueue(props) {
17470
17469
 
17471
17470
  var scrollDirectionDetect = function scrollDirectionDetect(e) {
17472
17471
  var window = e.currentTarget;
17472
+
17473
17473
  if (preVscroll > window.scrollY) {
17474
- if (!isScrollDown) {
17475
- isScrollDown = true;
17476
- }
17474
+ isScrollDown = false;
17477
17475
  } else if (preVscroll < window.scrollY) {
17478
- if (isScrollDown) {
17479
- isScrollDown = false;
17480
- }
17476
+ isScrollDown = true;
17481
17477
  }
17482
17478
  preVscroll = window.scrollY;
17483
17479
  };
@@ -17518,21 +17514,32 @@ var ArticleQueue = function ArticleQueue(props) {
17518
17514
  };
17519
17515
 
17520
17516
  var changeUrl = function changeUrl(path, visibility, meta) {
17517
+ var currentPath = window && window.location && window.location.pathname ? window.location.pathname.replace('/view/', '') : '';
17521
17518
  var newPath = '/view/' + path;
17522
- if (!isScrollDown) {
17523
- if (visibility === 'top') {
17524
- // router.push('/view/[url]', newPath, { shallow: true })
17525
- window.history.pushState({ page: path }, path, newPath);
17526
- if (props.pageview) {
17527
- props.pageview(newPath);
17519
+ if (currentPath !== path) {
17520
+ if (isScrollDown) {
17521
+ if (visibility === 'top') {
17522
+ // router.push('/view/[url]', newPath, { shallow: true })
17523
+ window.history.pushState({ page: path }, meta.shareTitle, newPath);
17524
+ if (props.pageview) {
17525
+ props.pageview(newPath);
17526
+ }
17527
+ refreshAD(path);
17528
+ changeMeta(meta);
17529
+ }
17530
+ } else {
17531
+ if (visibility === 'bottom') {
17532
+ // router.push('/view/[url]', newPath, { shallow: true })
17533
+ window.history.pushState({ page: path }, meta.shareTitle, newPath);
17534
+ if (props.pageview) {
17535
+ props.pageview(newPath);
17536
+ }
17537
+ refreshAD(path);
17538
+ changeMeta(meta);
17528
17539
  }
17529
- refreshAD(path);
17530
- changeMeta(meta);
17531
17540
  }
17532
- } else {
17533
- if (visibility === 'bottom') {
17534
- // router.push('/view/[url]', newPath, { shallow: true })
17535
- window.history.pushState({ page: path }, path, newPath);
17541
+ if (visibility === 'small-top') {
17542
+ window.history.pushState({ page: path }, meta.shareTitle, newPath);
17536
17543
  if (props.pageview) {
17537
17544
  props.pageview(newPath);
17538
17545
  }
@@ -17552,7 +17559,15 @@ var ArticleQueue = function ArticleQueue(props) {
17552
17559
  if (!checkSponseredArticle(article) && Ads.getNativeContextualAD) {
17553
17560
  article.contextualAD = Ads.getNativeContextualAD(getTargeting(article, 'native-ad'));
17554
17561
  }
17555
- return React__default.createElement(Article, _extends$2._extends({ key: index }, props, { changeUrl: changeUrl, authorPrfix: authorPrefix, article: article, cpModificationRequired: cpModificationRequired }));
17562
+ return React__default.createElement(Article, _extends$2._extends({
17563
+ key: index
17564
+ }, props, {
17565
+ changeUrl: changeUrl,
17566
+ authorPrfix: authorPrefix,
17567
+ article: article,
17568
+ cpModificationRequired: cpModificationRequired,
17569
+ queueData: queueData
17570
+ }));
17556
17571
  })
17557
17572
  );
17558
17573
  };
@@ -22093,42 +22108,17 @@ var Article$1 = function Article(props) {
22093
22108
  React__default.createElement(
22094
22109
  InscreenSensor,
22095
22110
  {
22096
- offSetTop: 45,
22111
+ offSetTop: 120,
22112
+ className: 'inscreen-wrapper',
22113
+ id: 'article-' + title,
22097
22114
  onChange: function onChange(visible) {
22098
- if (visible !== false) {
22115
+ if (visible === 'top' || visible === 'bottom' || visible === 'small-top') {
22099
22116
  changeUrl(url, visible, meta);
22100
22117
  }
22101
22118
  } },
22102
22119
  React__default.createElement(
22103
22120
  'div',
22104
22121
  null,
22105
- React__default.createElement(
22106
- Head,
22107
- null,
22108
- React__default.createElement(
22109
- 'title',
22110
- { key: 'title' },
22111
- shareTitle + ' | ' + props.cache.siteSettingCache.name
22112
- ),
22113
- React__default.createElement('meta', { name: 'description', key: 'description', content: shareSummary }),
22114
- passwordLock && React__default.createElement('meta', { name: 'robots', content: 'noindex, nofollow' }),
22115
- React__default.createElement('meta', { property: 'og:url', content: shareUrl, key: 'og:url' }),
22116
- React__default.createElement('meta', { property: 'og:title', content: shareTitle, key: 'og:title' }),
22117
- React__default.createElement('meta', { property: 'og:image', content: shareImage, key: 'og:image' }),
22118
- React__default.createElement('meta', { property: 'og:site_name', content: props.Settings.title, key: 'og:site_name' }),
22119
- React__default.createElement('meta', { property: 'og:description', content: shareSummary, key: 'og:description' }),
22120
- React__default.createElement('meta', { name: 'twitter:card', content: 'summary', key: 'twitter:card' }),
22121
- React__default.createElement('meta', { name: 'twitter:title', content: shareTitle, key: 'twitter:title' }),
22122
- React__default.createElement('meta', { name: 'twitter:image', content: shareImage, key: 'twitter:image' }),
22123
- React__default.createElement('meta', { name: 'twitter:site', content: '@' + props.Settings.title, key: 'twitter:site' }),
22124
- React__default.createElement('meta', { name: 'twitter:description', content: shareSummary, key: 'twitter:description' }),
22125
- React__default.createElement(
22126
- 'noscript',
22127
- null,
22128
- props.article.seriesDetail && props.article.seriesDetail.prevUrl && React__default.createElement('link', { rel: 'prev', href: props.article.seriesDetail.prevUrl }),
22129
- props.article.seriesDetail && props.article.seriesDetail.nextUrl && React__default.createElement('link', { rel: 'next', href: props.article.seriesDetail.nextUrl })
22130
- )
22131
- ),
22132
22122
  React__default.createElement(
22133
22123
  'div',
22134
22124
  { className: 'video-detail', style: { marginBottom: isCutomPage(props.article) ? '150px' : 0 } },
@@ -22168,7 +22158,16 @@ var Article$1 = function Article(props) {
22168
22158
  null,
22169
22159
  source && React__default.createElement(
22170
22160
  'p',
22171
- { style: { display: 'inline-block', padding: '0 .25rem', color: 'var(--franchise-primary, #484848)', borderRadius: '2px', fontWeight: 'bold', border: '2px solid var(--franchise-primary, #484848)' }, className: 'source-label' },
22161
+ {
22162
+ style: {
22163
+ display: 'inline-block',
22164
+ padding: '0 .25rem',
22165
+ color: 'var(--franchise-primary, #484848)',
22166
+ borderRadius: '2px',
22167
+ fontWeight: 'bold',
22168
+ border: '2px solid var(--franchise-primary, #484848)'
22169
+ },
22170
+ className: 'source-label' },
22172
22171
  source
22173
22172
  )
22174
22173
  ),
@@ -22228,7 +22227,6 @@ var Article$1 = function Article(props) {
22228
22227
  React__default.createElement(
22229
22228
  'p',
22230
22229
  null,
22231
- React__default.createElement('div', null),
22232
22230
  React__default.createElement(
22233
22231
  'em',
22234
22232
  null,
@@ -22461,7 +22459,6 @@ var ArticleQueue$1 = function ArticleQueue(props) {
22461
22459
  setQueueData = _useState2[1];
22462
22460
 
22463
22461
  var refreshAD = function refreshAD(path) {
22464
-
22465
22462
  if (!main.main_36) {
22466
22463
  var activeArticle = queueData.find(function (item) {
22467
22464
  return item.url.current === path;
@@ -22505,14 +22502,11 @@ var ArticleQueue$1 = function ArticleQueue(props) {
22505
22502
 
22506
22503
  var scrollDirectionDetect = function scrollDirectionDetect(e) {
22507
22504
  var window = e.currentTarget;
22505
+
22508
22506
  if (preVscroll > window.scrollY) {
22509
- if (!isScrollDown) {
22510
- isScrollDown = true;
22511
- }
22507
+ isScrollDown = false;
22512
22508
  } else if (preVscroll < window.scrollY) {
22513
- if (isScrollDown) {
22514
- isScrollDown = false;
22515
- }
22509
+ isScrollDown = true;
22516
22510
  }
22517
22511
  preVscroll = window.scrollY;
22518
22512
  };
@@ -22553,21 +22547,32 @@ var ArticleQueue$1 = function ArticleQueue(props) {
22553
22547
  };
22554
22548
 
22555
22549
  var changeUrl = function changeUrl(path, visibility, meta) {
22550
+ var currentPath = window && window.location && window.location.pathname ? window.location.pathname.replace('/view/', '') : '';
22556
22551
  var newPath = '/view/' + path;
22557
- if (!isScrollDown) {
22558
- if (visibility === 'top') {
22559
- // router.push('/view/[url]', newPath, { shallow: true })
22560
- window.history.pushState({ page: path }, path, newPath);
22561
- if (props.pageview) {
22562
- props.pageview(newPath);
22552
+ if (currentPath !== path) {
22553
+ if (isScrollDown) {
22554
+ if (visibility === 'top') {
22555
+ // router.push('/view/[url]', newPath, { shallow: true })
22556
+ window.history.pushState({ page: path }, meta.shareTitle, newPath);
22557
+ if (props.pageview) {
22558
+ props.pageview(newPath);
22559
+ }
22560
+ refreshAD(path);
22561
+ changeMeta(meta);
22562
+ }
22563
+ } else {
22564
+ if (visibility === 'bottom') {
22565
+ // router.push('/view/[url]', newPath, { shallow: true })
22566
+ window.history.pushState({ page: path }, meta.shareTitle, newPath);
22567
+ if (props.pageview) {
22568
+ props.pageview(newPath);
22569
+ }
22570
+ refreshAD(path);
22571
+ changeMeta(meta);
22563
22572
  }
22564
- refreshAD(path);
22565
- changeMeta(meta);
22566
22573
  }
22567
- } else {
22568
- if (visibility === 'bottom') {
22569
- // router.push('/view/[url]', newPath, { shallow: true })
22570
- window.history.pushState({ page: path }, path, newPath);
22574
+ if (visibility === 'small-top') {
22575
+ window.history.pushState({ page: path }, meta.shareTitle, newPath);
22571
22576
  if (props.pageview) {
22572
22577
  props.pageview(newPath);
22573
22578
  }
@@ -22713,7 +22718,13 @@ var View = function View(props) {
22713
22718
  React__default.createElement('meta', { name: 'twitter:title', content: shareOptions.shareTitle, key: 'twitter:title' }),
22714
22719
  React__default.createElement('meta', { name: 'twitter:image', content: shareOptions.shareImage, key: 'twitter:image' }),
22715
22720
  React__default.createElement('meta', { name: 'twitter:site', content: '@' + props.Settings.title, key: 'twitter:site' }),
22716
- React__default.createElement('meta', { name: 'twitter:description', content: shareOptions.shareSummary, key: 'twitter:description' })
22721
+ React__default.createElement('meta', { name: 'twitter:description', content: shareOptions.shareSummary, key: 'twitter:description' }),
22722
+ React__default.createElement(
22723
+ 'noscript',
22724
+ null,
22725
+ props.article.seriesDetail && props.article.seriesDetail.prevUrl && React__default.createElement('link', { rel: 'prev', href: props.article.seriesDetail.prevUrl }),
22726
+ props.article.seriesDetail && props.article.seriesDetail.nextUrl && React__default.createElement('link', { rel: 'next', href: props.article.seriesDetail.nextUrl })
22727
+ )
22717
22728
  ),
22718
22729
  !needInfiniteScroll ? React__default.createElement(Article$1, _extends$2._extends({ infiniteScroll: false }, props)) : React__default.createElement(Articles, _extends$2._extends({ infiniteScroll: true }, props))
22719
22730
  );
package/dist/esm/index.js CHANGED
@@ -14776,16 +14776,7 @@ Publication.getInitialProps = async (ctx) => {
14776
14776
  const {
14777
14777
  query: { year },
14778
14778
  } = ctx
14779
- const pub = await client.fetch(
14780
- `*[_type == 'publication'
14781
- && identifier.current == $publication][0] {
14782
- ...,
14783
- 'issues': *[_type == 'publication'
14784
- && is_visible
14785
- && references(^._id)] | order(year desc, month desc)
14786
- }`,
14787
- query
14788
- )
14779
+ const pub = await client.fetch(getQuery('publication'), query)
14789
14780
  const builder = imageUrlBuilder(client)
14790
14781
  const urlFor = (source) => {
14791
14782
  return builder.image(source)
@@ -14886,7 +14877,12 @@ var PublicationLanding = function PublicationLanding(props) {
14886
14877
  null,
14887
14878
  issue.name
14888
14879
  ),
14889
- React__default.createElement(
14880
+ publication.displayLabel && React__default.createElement(
14881
+ 'p',
14882
+ { className: 'badge badge-primary' },
14883
+ publication.displayLabel
14884
+ ),
14885
+ issue.volume && issue.number && React__default.createElement(
14890
14886
  'p',
14891
14887
  null,
14892
14888
  'Volume: ',
@@ -16730,21 +16726,19 @@ var InscreenSensor = function (_React$Component) {
16730
16726
  var _this$props$offSetTop = _this.props.offSetTop,
16731
16727
  offSetTop = _this$props$offSetTop === undefined ? 0 : _this$props$offSetTop;
16732
16728
  var top = rect.top,
16733
- height = rect.height;
16729
+ bottom = rect.bottom;
16734
16730
 
16735
- var bottom = top + height;
16736
16731
  var viewHeight = window.innerHeight;
16732
+ var wrpElem = document.getElementsByClassName('inscreen-wrapper');
16737
16733
 
16738
- if (bottom < offSetTop) {
16739
- return false;
16740
- } else if (top > offSetTop && bottom <= viewHeight) {
16741
- return true;
16742
- } else if (top < offSetTop && top <= viewHeight && bottom > viewHeight) {
16743
- return 'top';
16744
- } else if (top < offSetTop && bottom + offSetTop >= viewHeight) {
16734
+ if (top > 0 && top <= offSetTop) {
16735
+ if (wrpElem.length > 1 && top <= viewHeight && bottom > viewHeight) {
16736
+ return 'top';
16737
+ } else if (wrpElem.length > 1 && bottom < viewHeight) {
16738
+ return 'small-top';
16739
+ }
16740
+ } else if (wrpElem.length > 1 && top < offSetTop && bottom + offSetTop >= viewHeight) {
16745
16741
  return 'bottom';
16746
- } else {
16747
- return false;
16748
16742
  }
16749
16743
  };
16750
16744
 
@@ -16772,11 +16766,13 @@ var InscreenSensor = function (_React$Component) {
16772
16766
  _props$className = _props.className,
16773
16767
  className = _props$className === undefined ? '' : _props$className,
16774
16768
  _props$style = _props.style,
16775
- style = _props$style === undefined ? {} : _props$style;
16769
+ style = _props$style === undefined ? {} : _props$style,
16770
+ _props$id = _props.id,
16771
+ id = _props$id === undefined ? '' : _props$id;
16776
16772
 
16777
16773
  return React__default.createElement(
16778
16774
  'div',
16779
- { ref: this.wraperRef, className: className, style: style },
16775
+ { ref: this.wraperRef, className: className, style: style, id: id },
16780
16776
  this.props.children
16781
16777
  );
16782
16778
  }
@@ -16875,7 +16871,9 @@ var Article = function Article(props) {
16875
16871
  changeUrl = props.changeUrl,
16876
16872
  shareOptions = props.shareOptions,
16877
16873
  cpModificationRequired = props.cpModificationRequired,
16878
- authorPrefix = props.authorPrefix;
16874
+ authorPrefix = props.authorPrefix,
16875
+ queueData = props.queueData,
16876
+ lastUrl = props.lastUrl;
16879
16877
 
16880
16878
  var _useState = useState(null),
16881
16879
  _useState2 = _slicedToArray(_useState, 2),
@@ -17159,29 +17157,30 @@ var Article = function Article(props) {
17159
17157
  shareImage: shareImage,
17160
17158
  shareVia: props.Settings.title
17161
17159
  };
17162
-
17163
17160
  return React__default.createElement(
17164
17161
  React__default.Fragment,
17165
17162
  null,
17166
17163
  React__default.createElement(
17167
17164
  InscreenSensor,
17168
17165
  {
17169
- offSetTop: 45,
17166
+ offSetTop: 120,
17167
+ className: 'inscreen-wrapper',
17168
+ id: 'article-' + title,
17170
17169
  onChange: function onChange(visible) {
17171
- if (visible !== false) {
17170
+ if (visible === 'top' || visible === 'bottom' || visible === 'small-top') {
17172
17171
  changeUrl(url, visible, meta);
17173
17172
  }
17174
17173
  } },
17175
17174
  React__default.createElement(
17176
17175
  'div',
17177
17176
  null,
17178
- React__default.createElement(
17177
+ queueData && queueData.length === 1 && React__default.createElement(
17179
17178
  Head,
17180
17179
  null,
17181
17180
  React__default.createElement(
17182
17181
  'title',
17183
17182
  { key: 'title' },
17184
- shareTitle + ' | ' + props.cache.siteSettingCache.name
17183
+ '' + shareTitle
17185
17184
  ),
17186
17185
  React__default.createElement('meta', { name: 'description', key: 'description', content: shareSummary }),
17187
17186
  passwordLock && React__default.createElement('meta', { name: 'robots', content: 'noindex, nofollow' }),
@@ -17467,14 +17466,11 @@ var ArticleQueue = function ArticleQueue(props) {
17467
17466
 
17468
17467
  var scrollDirectionDetect = function scrollDirectionDetect(e) {
17469
17468
  var window = e.currentTarget;
17469
+
17470
17470
  if (preVscroll > window.scrollY) {
17471
- if (!isScrollDown) {
17472
- isScrollDown = true;
17473
- }
17471
+ isScrollDown = false;
17474
17472
  } else if (preVscroll < window.scrollY) {
17475
- if (isScrollDown) {
17476
- isScrollDown = false;
17477
- }
17473
+ isScrollDown = true;
17478
17474
  }
17479
17475
  preVscroll = window.scrollY;
17480
17476
  };
@@ -17515,21 +17511,32 @@ var ArticleQueue = function ArticleQueue(props) {
17515
17511
  };
17516
17512
 
17517
17513
  var changeUrl = function changeUrl(path, visibility, meta) {
17514
+ var currentPath = window && window.location && window.location.pathname ? window.location.pathname.replace('/view/', '') : '';
17518
17515
  var newPath = '/view/' + path;
17519
- if (!isScrollDown) {
17520
- if (visibility === 'top') {
17521
- // router.push('/view/[url]', newPath, { shallow: true })
17522
- window.history.pushState({ page: path }, path, newPath);
17523
- if (props.pageview) {
17524
- props.pageview(newPath);
17516
+ if (currentPath !== path) {
17517
+ if (isScrollDown) {
17518
+ if (visibility === 'top') {
17519
+ // router.push('/view/[url]', newPath, { shallow: true })
17520
+ window.history.pushState({ page: path }, meta.shareTitle, newPath);
17521
+ if (props.pageview) {
17522
+ props.pageview(newPath);
17523
+ }
17524
+ refreshAD(path);
17525
+ changeMeta(meta);
17526
+ }
17527
+ } else {
17528
+ if (visibility === 'bottom') {
17529
+ // router.push('/view/[url]', newPath, { shallow: true })
17530
+ window.history.pushState({ page: path }, meta.shareTitle, newPath);
17531
+ if (props.pageview) {
17532
+ props.pageview(newPath);
17533
+ }
17534
+ refreshAD(path);
17535
+ changeMeta(meta);
17525
17536
  }
17526
- refreshAD(path);
17527
- changeMeta(meta);
17528
17537
  }
17529
- } else {
17530
- if (visibility === 'bottom') {
17531
- // router.push('/view/[url]', newPath, { shallow: true })
17532
- window.history.pushState({ page: path }, path, newPath);
17538
+ if (visibility === 'small-top') {
17539
+ window.history.pushState({ page: path }, meta.shareTitle, newPath);
17533
17540
  if (props.pageview) {
17534
17541
  props.pageview(newPath);
17535
17542
  }
@@ -17549,7 +17556,15 @@ var ArticleQueue = function ArticleQueue(props) {
17549
17556
  if (!checkSponseredArticle(article) && Ads.getNativeContextualAD) {
17550
17557
  article.contextualAD = Ads.getNativeContextualAD(getTargeting(article, 'native-ad'));
17551
17558
  }
17552
- return React__default.createElement(Article, _extends$2({ key: index }, props, { changeUrl: changeUrl, authorPrfix: authorPrefix, article: article, cpModificationRequired: cpModificationRequired }));
17559
+ return React__default.createElement(Article, _extends$2({
17560
+ key: index
17561
+ }, props, {
17562
+ changeUrl: changeUrl,
17563
+ authorPrfix: authorPrefix,
17564
+ article: article,
17565
+ cpModificationRequired: cpModificationRequired,
17566
+ queueData: queueData
17567
+ }));
17553
17568
  })
17554
17569
  );
17555
17570
  };
@@ -22090,42 +22105,17 @@ var Article$1 = function Article(props) {
22090
22105
  React__default.createElement(
22091
22106
  InscreenSensor,
22092
22107
  {
22093
- offSetTop: 45,
22108
+ offSetTop: 120,
22109
+ className: 'inscreen-wrapper',
22110
+ id: 'article-' + title,
22094
22111
  onChange: function onChange(visible) {
22095
- if (visible !== false) {
22112
+ if (visible === 'top' || visible === 'bottom' || visible === 'small-top') {
22096
22113
  changeUrl(url, visible, meta);
22097
22114
  }
22098
22115
  } },
22099
22116
  React__default.createElement(
22100
22117
  'div',
22101
22118
  null,
22102
- React__default.createElement(
22103
- Head,
22104
- null,
22105
- React__default.createElement(
22106
- 'title',
22107
- { key: 'title' },
22108
- shareTitle + ' | ' + props.cache.siteSettingCache.name
22109
- ),
22110
- React__default.createElement('meta', { name: 'description', key: 'description', content: shareSummary }),
22111
- passwordLock && React__default.createElement('meta', { name: 'robots', content: 'noindex, nofollow' }),
22112
- React__default.createElement('meta', { property: 'og:url', content: shareUrl, key: 'og:url' }),
22113
- React__default.createElement('meta', { property: 'og:title', content: shareTitle, key: 'og:title' }),
22114
- React__default.createElement('meta', { property: 'og:image', content: shareImage, key: 'og:image' }),
22115
- React__default.createElement('meta', { property: 'og:site_name', content: props.Settings.title, key: 'og:site_name' }),
22116
- React__default.createElement('meta', { property: 'og:description', content: shareSummary, key: 'og:description' }),
22117
- React__default.createElement('meta', { name: 'twitter:card', content: 'summary', key: 'twitter:card' }),
22118
- React__default.createElement('meta', { name: 'twitter:title', content: shareTitle, key: 'twitter:title' }),
22119
- React__default.createElement('meta', { name: 'twitter:image', content: shareImage, key: 'twitter:image' }),
22120
- React__default.createElement('meta', { name: 'twitter:site', content: '@' + props.Settings.title, key: 'twitter:site' }),
22121
- React__default.createElement('meta', { name: 'twitter:description', content: shareSummary, key: 'twitter:description' }),
22122
- React__default.createElement(
22123
- 'noscript',
22124
- null,
22125
- props.article.seriesDetail && props.article.seriesDetail.prevUrl && React__default.createElement('link', { rel: 'prev', href: props.article.seriesDetail.prevUrl }),
22126
- props.article.seriesDetail && props.article.seriesDetail.nextUrl && React__default.createElement('link', { rel: 'next', href: props.article.seriesDetail.nextUrl })
22127
- )
22128
- ),
22129
22119
  React__default.createElement(
22130
22120
  'div',
22131
22121
  { className: 'video-detail', style: { marginBottom: isCutomPage(props.article) ? '150px' : 0 } },
@@ -22165,7 +22155,16 @@ var Article$1 = function Article(props) {
22165
22155
  null,
22166
22156
  source && React__default.createElement(
22167
22157
  'p',
22168
- { style: { display: 'inline-block', padding: '0 .25rem', color: 'var(--franchise-primary, #484848)', borderRadius: '2px', fontWeight: 'bold', border: '2px solid var(--franchise-primary, #484848)' }, className: 'source-label' },
22158
+ {
22159
+ style: {
22160
+ display: 'inline-block',
22161
+ padding: '0 .25rem',
22162
+ color: 'var(--franchise-primary, #484848)',
22163
+ borderRadius: '2px',
22164
+ fontWeight: 'bold',
22165
+ border: '2px solid var(--franchise-primary, #484848)'
22166
+ },
22167
+ className: 'source-label' },
22169
22168
  source
22170
22169
  )
22171
22170
  ),
@@ -22225,7 +22224,6 @@ var Article$1 = function Article(props) {
22225
22224
  React__default.createElement(
22226
22225
  'p',
22227
22226
  null,
22228
- React__default.createElement('div', null),
22229
22227
  React__default.createElement(
22230
22228
  'em',
22231
22229
  null,
@@ -22458,7 +22456,6 @@ var ArticleQueue$1 = function ArticleQueue(props) {
22458
22456
  setQueueData = _useState2[1];
22459
22457
 
22460
22458
  var refreshAD = function refreshAD(path) {
22461
-
22462
22459
  if (!main_36) {
22463
22460
  var activeArticle = queueData.find(function (item) {
22464
22461
  return item.url.current === path;
@@ -22502,14 +22499,11 @@ var ArticleQueue$1 = function ArticleQueue(props) {
22502
22499
 
22503
22500
  var scrollDirectionDetect = function scrollDirectionDetect(e) {
22504
22501
  var window = e.currentTarget;
22502
+
22505
22503
  if (preVscroll > window.scrollY) {
22506
- if (!isScrollDown) {
22507
- isScrollDown = true;
22508
- }
22504
+ isScrollDown = false;
22509
22505
  } else if (preVscroll < window.scrollY) {
22510
- if (isScrollDown) {
22511
- isScrollDown = false;
22512
- }
22506
+ isScrollDown = true;
22513
22507
  }
22514
22508
  preVscroll = window.scrollY;
22515
22509
  };
@@ -22550,21 +22544,32 @@ var ArticleQueue$1 = function ArticleQueue(props) {
22550
22544
  };
22551
22545
 
22552
22546
  var changeUrl = function changeUrl(path, visibility, meta) {
22547
+ var currentPath = window && window.location && window.location.pathname ? window.location.pathname.replace('/view/', '') : '';
22553
22548
  var newPath = '/view/' + path;
22554
- if (!isScrollDown) {
22555
- if (visibility === 'top') {
22556
- // router.push('/view/[url]', newPath, { shallow: true })
22557
- window.history.pushState({ page: path }, path, newPath);
22558
- if (props.pageview) {
22559
- props.pageview(newPath);
22549
+ if (currentPath !== path) {
22550
+ if (isScrollDown) {
22551
+ if (visibility === 'top') {
22552
+ // router.push('/view/[url]', newPath, { shallow: true })
22553
+ window.history.pushState({ page: path }, meta.shareTitle, newPath);
22554
+ if (props.pageview) {
22555
+ props.pageview(newPath);
22556
+ }
22557
+ refreshAD(path);
22558
+ changeMeta(meta);
22559
+ }
22560
+ } else {
22561
+ if (visibility === 'bottom') {
22562
+ // router.push('/view/[url]', newPath, { shallow: true })
22563
+ window.history.pushState({ page: path }, meta.shareTitle, newPath);
22564
+ if (props.pageview) {
22565
+ props.pageview(newPath);
22566
+ }
22567
+ refreshAD(path);
22568
+ changeMeta(meta);
22560
22569
  }
22561
- refreshAD(path);
22562
- changeMeta(meta);
22563
22570
  }
22564
- } else {
22565
- if (visibility === 'bottom') {
22566
- // router.push('/view/[url]', newPath, { shallow: true })
22567
- window.history.pushState({ page: path }, path, newPath);
22571
+ if (visibility === 'small-top') {
22572
+ window.history.pushState({ page: path }, meta.shareTitle, newPath);
22568
22573
  if (props.pageview) {
22569
22574
  props.pageview(newPath);
22570
22575
  }
@@ -22710,7 +22715,13 @@ var View = function View(props) {
22710
22715
  React__default.createElement('meta', { name: 'twitter:title', content: shareOptions.shareTitle, key: 'twitter:title' }),
22711
22716
  React__default.createElement('meta', { name: 'twitter:image', content: shareOptions.shareImage, key: 'twitter:image' }),
22712
22717
  React__default.createElement('meta', { name: 'twitter:site', content: '@' + props.Settings.title, key: 'twitter:site' }),
22713
- React__default.createElement('meta', { name: 'twitter:description', content: shareOptions.shareSummary, key: 'twitter:description' })
22718
+ React__default.createElement('meta', { name: 'twitter:description', content: shareOptions.shareSummary, key: 'twitter:description' }),
22719
+ React__default.createElement(
22720
+ 'noscript',
22721
+ null,
22722
+ props.article.seriesDetail && props.article.seriesDetail.prevUrl && React__default.createElement('link', { rel: 'prev', href: props.article.seriesDetail.prevUrl }),
22723
+ props.article.seriesDetail && props.article.seriesDetail.nextUrl && React__default.createElement('link', { rel: 'next', href: props.article.seriesDetail.nextUrl })
22724
+ )
22714
22725
  ),
22715
22726
  !needInfiniteScroll ? React__default.createElement(Article$1, _extends$2({ infiniteScroll: false }, props)) : React__default.createElement(Articles, _extends$2({ infiniteScroll: true }, props))
22716
22727
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mjhls/mjh-framework",
3
- "version": "1.0.426",
3
+ "version": "1.0.428",
4
4
  "description": "Foundation Framework",
5
5
  "author": "mjh-framework",
6
6
  "license": "MIT",