@mjhls/mjh-framework 1.0.525 → 1.0.527

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.525
2
+ # mjh-framework v. 1.0.527
3
3
 
4
4
  > Foundation Framework
5
5
 
package/dist/cjs/View.js CHANGED
@@ -18,7 +18,7 @@ var React = require('react');
18
18
  var index = require('./index-44481153.js');
19
19
  require('prop-types');
20
20
  var moment = require('./moment-ca3bd9fb.js');
21
- require('next/router');
21
+ var Router = require('next/router');
22
22
  require('./isSymbol-488934a7.js');
23
23
  require('./debounce-32e57002.js');
24
24
  var index_es = require('./index.es-f3e47207.js');
@@ -1174,20 +1174,42 @@ var Articles = function Articles(props) {
1174
1174
  var _this = undefined;
1175
1175
 
1176
1176
  var View = function View(props) {
1177
+ var router = Router.useRouter();
1177
1178
  var shareOptions = props.shareOptions,
1178
1179
  article = props.article,
1179
1180
  _props$sponsoredFlag = props.sponsoredFlag,
1180
1181
  sponsoredFlag = _props$sponsoredFlag === undefined ? false : _props$sponsoredFlag,
1181
1182
  _props$sponsoredTaxon = props.sponsoredTaxonomies,
1182
- Ads = props.Ads;
1183
+ Ads = props.Ads,
1184
+ setCustomDimensions = props.setCustomDimensions,
1185
+ statusCode = props.statusCode,
1186
+ prevUrl = props.prevUrl,
1187
+ pageview = props.pageview;
1183
1188
  var _props$article = props.article,
1184
1189
  _props$article$passwo = _props$article.passwordLock,
1185
1190
  passwordLock = _props$article$passwo === undefined ? false : _props$article$passwo,
1186
1191
  description = _props$article.description,
1187
1192
  title = _props$article.title;
1188
1193
 
1189
- //disable infinite scroll
1194
+ // Logging GA pageview for the initial article with custom dimensions
1195
+
1196
+ React.useEffect(function () {
1197
+ if (pageview && setCustomDimensions) {
1198
+ var timer = void 0;
1199
+ var waitAndExicute = function waitAndExicute() {
1200
+ if (typeof window.GA_INITIALIZED !== 'undefined') {
1201
+ setCustomDimensions(article, statusCode, prevUrl);
1202
+ pageview(router.asPath);
1203
+ } else timer = setTimeout(waitAndExicute, 1000);
1204
+ };
1205
+ waitAndExicute();
1206
+ return function () {
1207
+ clearTimeout(timer);
1208
+ };
1209
+ }
1210
+ }, []);
1190
1211
 
1212
+ //disable infinite scroll
1191
1213
  var checkVideoSeries = function checkVideoSeries(article) {
1192
1214
  if (!article || !article.body) {
1193
1215
  return false;
@@ -7067,6 +7067,10 @@ var YouTubeGallery = function YouTubeGallery(_ref) {
7067
7067
  getSerializers = _ref.getSerializers,
7068
7068
  accountIDs = _ref.accountIDs;
7069
7069
 
7070
+ if (!nodes || !nodes.videos) {
7071
+ return null;
7072
+ }
7073
+
7070
7074
  var builder = index.imageUrlBuilder(client);
7071
7075
  function urlFor(source) {
7072
7076
  return builder.image(source);
package/dist/esm/View.js CHANGED
@@ -16,7 +16,7 @@ import React, { useState, useEffect } from 'react';
16
16
  import { l as lib_3 } from './index-1819118a.js';
17
17
  import 'prop-types';
18
18
  import { m as moment } from './moment-b6f49411.js';
19
- import 'next/router';
19
+ import { useRouter } from 'next/router';
20
20
  import './isSymbol-b7b7434f.js';
21
21
  import './debounce-048d9cb6.js';
22
22
  import { I as InfiniteScroll } from './index.es-c6222053.js';
@@ -1163,20 +1163,42 @@ var Articles = function Articles(props) {
1163
1163
  var _this = undefined;
1164
1164
 
1165
1165
  var View = function View(props) {
1166
+ var router = useRouter();
1166
1167
  var shareOptions = props.shareOptions,
1167
1168
  article = props.article,
1168
1169
  _props$sponsoredFlag = props.sponsoredFlag,
1169
1170
  sponsoredFlag = _props$sponsoredFlag === undefined ? false : _props$sponsoredFlag,
1170
1171
  _props$sponsoredTaxon = props.sponsoredTaxonomies,
1171
- Ads = props.Ads;
1172
+ Ads = props.Ads,
1173
+ setCustomDimensions = props.setCustomDimensions,
1174
+ statusCode = props.statusCode,
1175
+ prevUrl = props.prevUrl,
1176
+ pageview = props.pageview;
1172
1177
  var _props$article = props.article,
1173
1178
  _props$article$passwo = _props$article.passwordLock,
1174
1179
  passwordLock = _props$article$passwo === undefined ? false : _props$article$passwo,
1175
1180
  description = _props$article.description,
1176
1181
  title = _props$article.title;
1177
1182
 
1178
- //disable infinite scroll
1183
+ // Logging GA pageview for the initial article with custom dimensions
1184
+
1185
+ useEffect(function () {
1186
+ if (pageview && setCustomDimensions) {
1187
+ var timer = void 0;
1188
+ var waitAndExicute = function waitAndExicute() {
1189
+ if (typeof window.GA_INITIALIZED !== 'undefined') {
1190
+ setCustomDimensions(article, statusCode, prevUrl);
1191
+ pageview(router.asPath);
1192
+ } else timer = setTimeout(waitAndExicute, 1000);
1193
+ };
1194
+ waitAndExicute();
1195
+ return function () {
1196
+ clearTimeout(timer);
1197
+ };
1198
+ }
1199
+ }, []);
1179
1200
 
1201
+ //disable infinite scroll
1180
1202
  var checkVideoSeries = function checkVideoSeries(article) {
1181
1203
  if (!article || !article.body) {
1182
1204
  return false;
@@ -7056,6 +7056,10 @@ var YouTubeGallery = function YouTubeGallery(_ref) {
7056
7056
  getSerializers = _ref.getSerializers,
7057
7057
  accountIDs = _ref.accountIDs;
7058
7058
 
7059
+ if (!nodes || !nodes.videos) {
7060
+ return null;
7061
+ }
7062
+
7059
7063
  var builder = imageUrlBuilder(client);
7060
7064
  function urlFor(source) {
7061
7065
  return builder.image(source);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mjhls/mjh-framework",
3
- "version": "1.0.525",
3
+ "version": "1.0.527",
4
4
  "description": "Foundation Framework",
5
5
  "author": "mjh-framework",
6
6
  "license": "MIT",