@mjhls/mjh-framework 1.0.508 → 1.0.510

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.
Files changed (49) hide show
  1. package/README.md +1 -1
  2. package/dist/cjs/ArticleQueue.js +512 -9
  3. package/dist/cjs/InscreenSensor-3aec8492.js +361 -0
  4. package/dist/cjs/View.js +64 -62
  5. package/dist/cjs/getQuery.js +3 -3
  6. package/dist/cjs/getRelatedArticle.js +16 -12
  7. package/dist/cjs/index.js +3 -3
  8. package/dist/esm/AD.js +1 -1
  9. package/dist/esm/AD300x250.js +2 -2
  10. package/dist/esm/AD300x250x600.js +2 -2
  11. package/dist/esm/AD728x90.js +2 -2
  12. package/dist/esm/ADFloatingFooter.js +2 -2
  13. package/dist/esm/ADGutter.js +2 -2
  14. package/dist/esm/ADSponsoredResources.js +2 -2
  15. package/dist/esm/ADWebcast.js +2 -2
  16. package/dist/esm/ADWelcome.js +2 -2
  17. package/dist/esm/AdSlot.js +2 -2
  18. package/dist/esm/ArticleQueue.js +507 -4
  19. package/dist/esm/CMEDeck.js +2 -2
  20. package/dist/esm/Column2.js +3 -3
  21. package/dist/esm/Column3.js +4 -4
  22. package/dist/esm/DeckContent.js +3 -3
  23. package/dist/esm/DeckQueue.js +4 -4
  24. package/dist/esm/{Dfp-58cfc45a.js → Dfp-81a052c2.js} +2 -2
  25. package/dist/esm/ExternalResources.js +2 -2
  26. package/dist/esm/GridContent.js +6 -6
  27. package/dist/esm/InscreenSensor-280b2b10.js +352 -0
  28. package/dist/esm/IssueLanding.js +4 -4
  29. package/dist/esm/LeftNav.js +2 -2
  30. package/dist/esm/MasterDeck.js +4 -4
  31. package/dist/esm/PartnerDetailListing.js +4 -4
  32. package/dist/esm/QueueDeckExpanded.js +4 -4
  33. package/dist/esm/SideFooter.js +3 -3
  34. package/dist/esm/TemplateNormal.js +4 -4
  35. package/dist/esm/VideoSeriesListing.js +2 -2
  36. package/dist/esm/View.js +64 -62
  37. package/dist/esm/{_arrayMap-a8dd2b2c.js → _arrayMap-64cbe0e4.js} +2 -2
  38. package/dist/esm/{debounce-8cd9e09c.js → debounce-048d9cb6.js} +1 -1
  39. package/dist/esm/{get-ae817b75.js → get-0eb56363.js} +2 -2
  40. package/dist/esm/getQuery.js +3 -3
  41. package/dist/esm/getRelatedArticle.js +14 -10
  42. package/dist/esm/getSerializers.js +2 -2
  43. package/dist/esm/index.js +8 -8
  44. package/dist/esm/{isSymbol-c1b9be80.js → isSymbol-b7b7434f.js} +1 -1
  45. package/package.json +1 -1
  46. package/dist/cjs/InscreenSensor-f9989c04.js +0 -863
  47. package/dist/esm/InscreenSensor-67905ed5.js +0 -857
  48. /package/dist/esm/{ADInfeed-15266562.js → ADInfeed-cb0d3a09.js} +0 -0
  49. /package/dist/esm/{ADlgInfeed-64346b44.js → ADlgInfeed-353fb56a.js} +0 -0
@@ -1,863 +0,0 @@
1
- 'use strict';
2
-
3
- function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
4
-
5
- var _commonjsHelpers = require('./_commonjsHelpers-06173234.js');
6
- var inherits = require('./inherits-14962339.js');
7
- var React = require('react');
8
- var React__default = _interopDefault(React);
9
- var isSymbol = require('./isSymbol-488934a7.js');
10
- var debounce = require('./debounce-32e57002.js');
11
- var _arrayMap = require('./_arrayMap-3b4a0f75.js');
12
-
13
- /**
14
- * The base implementation of `_.findIndex` and `_.findLastIndex` without
15
- * support for iteratee shorthands.
16
- *
17
- * @private
18
- * @param {Array} array The array to inspect.
19
- * @param {Function} predicate The function invoked per iteration.
20
- * @param {number} fromIndex The index to search from.
21
- * @param {boolean} [fromRight] Specify iterating from right to left.
22
- * @returns {number} Returns the index of the matched value, else `-1`.
23
- */
24
- function baseFindIndex(array, predicate, fromIndex, fromRight) {
25
- var length = array.length,
26
- index = fromIndex + (fromRight ? 1 : -1);
27
-
28
- while ((fromRight ? index-- : ++index < length)) {
29
- if (predicate(array[index], index, array)) {
30
- return index;
31
- }
32
- }
33
- return -1;
34
- }
35
-
36
- var _baseFindIndex = baseFindIndex;
37
-
38
- /**
39
- * The base implementation of `_.isNaN` without support for number objects.
40
- *
41
- * @private
42
- * @param {*} value The value to check.
43
- * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
44
- */
45
- function baseIsNaN(value) {
46
- return value !== value;
47
- }
48
-
49
- var _baseIsNaN = baseIsNaN;
50
-
51
- /**
52
- * A specialized version of `_.indexOf` which performs strict equality
53
- * comparisons of values, i.e. `===`.
54
- *
55
- * @private
56
- * @param {Array} array The array to inspect.
57
- * @param {*} value The value to search for.
58
- * @param {number} fromIndex The index to search from.
59
- * @returns {number} Returns the index of the matched value, else `-1`.
60
- */
61
- function strictIndexOf(array, value, fromIndex) {
62
- var index = fromIndex - 1,
63
- length = array.length;
64
-
65
- while (++index < length) {
66
- if (array[index] === value) {
67
- return index;
68
- }
69
- }
70
- return -1;
71
- }
72
-
73
- var _strictIndexOf = strictIndexOf;
74
-
75
- /**
76
- * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
77
- *
78
- * @private
79
- * @param {Array} array The array to inspect.
80
- * @param {*} value The value to search for.
81
- * @param {number} fromIndex The index to search from.
82
- * @returns {number} Returns the index of the matched value, else `-1`.
83
- */
84
- function baseIndexOf(array, value, fromIndex) {
85
- return value === value
86
- ? _strictIndexOf(array, value, fromIndex)
87
- : _baseFindIndex(array, _baseIsNaN, fromIndex);
88
- }
89
-
90
- var _baseIndexOf = baseIndexOf;
91
-
92
- /** Used as references for various `Number` constants. */
93
- var MAX_SAFE_INTEGER = 9007199254740991;
94
-
95
- /**
96
- * Checks if `value` is a valid array-like length.
97
- *
98
- * **Note:** This method is loosely based on
99
- * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
100
- *
101
- * @static
102
- * @memberOf _
103
- * @since 4.0.0
104
- * @category Lang
105
- * @param {*} value The value to check.
106
- * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
107
- * @example
108
- *
109
- * _.isLength(3);
110
- * // => true
111
- *
112
- * _.isLength(Number.MIN_VALUE);
113
- * // => false
114
- *
115
- * _.isLength(Infinity);
116
- * // => false
117
- *
118
- * _.isLength('3');
119
- * // => false
120
- */
121
- function isLength(value) {
122
- return typeof value == 'number' &&
123
- value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
124
- }
125
-
126
- var isLength_1 = isLength;
127
-
128
- /**
129
- * Checks if `value` is array-like. A value is considered array-like if it's
130
- * not a function and has a `value.length` that's an integer greater than or
131
- * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
132
- *
133
- * @static
134
- * @memberOf _
135
- * @since 4.0.0
136
- * @category Lang
137
- * @param {*} value The value to check.
138
- * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
139
- * @example
140
- *
141
- * _.isArrayLike([1, 2, 3]);
142
- * // => true
143
- *
144
- * _.isArrayLike(document.body.children);
145
- * // => true
146
- *
147
- * _.isArrayLike('abc');
148
- * // => true
149
- *
150
- * _.isArrayLike(_.noop);
151
- * // => false
152
- */
153
- function isArrayLike(value) {
154
- return value != null && isLength_1(value.length) && !_arrayMap.isFunction_1(value);
155
- }
156
-
157
- var isArrayLike_1 = isArrayLike;
158
-
159
- /** `Object#toString` result references. */
160
- var stringTag = '[object String]';
161
-
162
- /**
163
- * Checks if `value` is classified as a `String` primitive or object.
164
- *
165
- * @static
166
- * @since 0.1.0
167
- * @memberOf _
168
- * @category Lang
169
- * @param {*} value The value to check.
170
- * @returns {boolean} Returns `true` if `value` is a string, else `false`.
171
- * @example
172
- *
173
- * _.isString('abc');
174
- * // => true
175
- *
176
- * _.isString(1);
177
- * // => false
178
- */
179
- function isString(value) {
180
- return typeof value == 'string' ||
181
- (!_arrayMap.isArray_1(value) && isSymbol.isObjectLike_1(value) && isSymbol._baseGetTag(value) == stringTag);
182
- }
183
-
184
- var isString_1 = isString;
185
-
186
- /** Used as references for various `Number` constants. */
187
- var INFINITY = 1 / 0,
188
- MAX_INTEGER = 1.7976931348623157e+308;
189
-
190
- /**
191
- * Converts `value` to a finite number.
192
- *
193
- * @static
194
- * @memberOf _
195
- * @since 4.12.0
196
- * @category Lang
197
- * @param {*} value The value to convert.
198
- * @returns {number} Returns the converted number.
199
- * @example
200
- *
201
- * _.toFinite(3.2);
202
- * // => 3.2
203
- *
204
- * _.toFinite(Number.MIN_VALUE);
205
- * // => 5e-324
206
- *
207
- * _.toFinite(Infinity);
208
- * // => 1.7976931348623157e+308
209
- *
210
- * _.toFinite('3.2');
211
- * // => 3.2
212
- */
213
- function toFinite(value) {
214
- if (!value) {
215
- return value === 0 ? value : 0;
216
- }
217
- value = debounce.toNumber_1(value);
218
- if (value === INFINITY || value === -INFINITY) {
219
- var sign = (value < 0 ? -1 : 1);
220
- return sign * MAX_INTEGER;
221
- }
222
- return value === value ? value : 0;
223
- }
224
-
225
- var toFinite_1 = toFinite;
226
-
227
- /**
228
- * Converts `value` to an integer.
229
- *
230
- * **Note:** This method is loosely based on
231
- * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
232
- *
233
- * @static
234
- * @memberOf _
235
- * @since 4.0.0
236
- * @category Lang
237
- * @param {*} value The value to convert.
238
- * @returns {number} Returns the converted integer.
239
- * @example
240
- *
241
- * _.toInteger(3.2);
242
- * // => 3
243
- *
244
- * _.toInteger(Number.MIN_VALUE);
245
- * // => 0
246
- *
247
- * _.toInteger(Infinity);
248
- * // => 1.7976931348623157e+308
249
- *
250
- * _.toInteger('3.2');
251
- * // => 3
252
- */
253
- function toInteger(value) {
254
- var result = toFinite_1(value),
255
- remainder = result % 1;
256
-
257
- return result === result ? (remainder ? result - remainder : result) : 0;
258
- }
259
-
260
- var toInteger_1 = toInteger;
261
-
262
- /**
263
- * The base implementation of `_.values` and `_.valuesIn` which creates an
264
- * array of `object` property values corresponding to the property names
265
- * of `props`.
266
- *
267
- * @private
268
- * @param {Object} object The object to query.
269
- * @param {Array} props The property names to get values for.
270
- * @returns {Object} Returns the array of property values.
271
- */
272
- function baseValues(object, props) {
273
- return _arrayMap._arrayMap(props, function(key) {
274
- return object[key];
275
- });
276
- }
277
-
278
- var _baseValues = baseValues;
279
-
280
- /**
281
- * The base implementation of `_.times` without support for iteratee shorthands
282
- * or max array length checks.
283
- *
284
- * @private
285
- * @param {number} n The number of times to invoke `iteratee`.
286
- * @param {Function} iteratee The function invoked per iteration.
287
- * @returns {Array} Returns the array of results.
288
- */
289
- function baseTimes(n, iteratee) {
290
- var index = -1,
291
- result = Array(n);
292
-
293
- while (++index < n) {
294
- result[index] = iteratee(index);
295
- }
296
- return result;
297
- }
298
-
299
- var _baseTimes = baseTimes;
300
-
301
- /** `Object#toString` result references. */
302
- var argsTag = '[object Arguments]';
303
-
304
- /**
305
- * The base implementation of `_.isArguments`.
306
- *
307
- * @private
308
- * @param {*} value The value to check.
309
- * @returns {boolean} Returns `true` if `value` is an `arguments` object,
310
- */
311
- function baseIsArguments(value) {
312
- return isSymbol.isObjectLike_1(value) && isSymbol._baseGetTag(value) == argsTag;
313
- }
314
-
315
- var _baseIsArguments = baseIsArguments;
316
-
317
- /** Used for built-in method references. */
318
- var objectProto = Object.prototype;
319
-
320
- /** Used to check objects for own properties. */
321
- var hasOwnProperty = objectProto.hasOwnProperty;
322
-
323
- /** Built-in value references. */
324
- var propertyIsEnumerable = objectProto.propertyIsEnumerable;
325
-
326
- /**
327
- * Checks if `value` is likely an `arguments` object.
328
- *
329
- * @static
330
- * @memberOf _
331
- * @since 0.1.0
332
- * @category Lang
333
- * @param {*} value The value to check.
334
- * @returns {boolean} Returns `true` if `value` is an `arguments` object,
335
- * else `false`.
336
- * @example
337
- *
338
- * _.isArguments(function() { return arguments; }());
339
- * // => true
340
- *
341
- * _.isArguments([1, 2, 3]);
342
- * // => false
343
- */
344
- var isArguments = _baseIsArguments(function() { return arguments; }()) ? _baseIsArguments : function(value) {
345
- return isSymbol.isObjectLike_1(value) && hasOwnProperty.call(value, 'callee') &&
346
- !propertyIsEnumerable.call(value, 'callee');
347
- };
348
-
349
- var isArguments_1 = isArguments;
350
-
351
- /**
352
- * This method returns `false`.
353
- *
354
- * @static
355
- * @memberOf _
356
- * @since 4.13.0
357
- * @category Util
358
- * @returns {boolean} Returns `false`.
359
- * @example
360
- *
361
- * _.times(2, _.stubFalse);
362
- * // => [false, false]
363
- */
364
- function stubFalse() {
365
- return false;
366
- }
367
-
368
- var stubFalse_1 = stubFalse;
369
-
370
- var isBuffer_1 = _commonjsHelpers.createCommonjsModule(function (module, exports) {
371
- /** Detect free variable `exports`. */
372
- var freeExports = exports && !exports.nodeType && exports;
373
-
374
- /** Detect free variable `module`. */
375
- var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
376
-
377
- /** Detect the popular CommonJS extension `module.exports`. */
378
- var moduleExports = freeModule && freeModule.exports === freeExports;
379
-
380
- /** Built-in value references. */
381
- var Buffer = moduleExports ? isSymbol._root.Buffer : undefined;
382
-
383
- /* Built-in method references for those with the same name as other `lodash` methods. */
384
- var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;
385
-
386
- /**
387
- * Checks if `value` is a buffer.
388
- *
389
- * @static
390
- * @memberOf _
391
- * @since 4.3.0
392
- * @category Lang
393
- * @param {*} value The value to check.
394
- * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
395
- * @example
396
- *
397
- * _.isBuffer(new Buffer(2));
398
- * // => true
399
- *
400
- * _.isBuffer(new Uint8Array(2));
401
- * // => false
402
- */
403
- var isBuffer = nativeIsBuffer || stubFalse_1;
404
-
405
- module.exports = isBuffer;
406
- });
407
-
408
- /** Used as references for various `Number` constants. */
409
- var MAX_SAFE_INTEGER$1 = 9007199254740991;
410
-
411
- /** Used to detect unsigned integer values. */
412
- var reIsUint = /^(?:0|[1-9]\d*)$/;
413
-
414
- /**
415
- * Checks if `value` is a valid array-like index.
416
- *
417
- * @private
418
- * @param {*} value The value to check.
419
- * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
420
- * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
421
- */
422
- function isIndex(value, length) {
423
- var type = typeof value;
424
- length = length == null ? MAX_SAFE_INTEGER$1 : length;
425
-
426
- return !!length &&
427
- (type == 'number' ||
428
- (type != 'symbol' && reIsUint.test(value))) &&
429
- (value > -1 && value % 1 == 0 && value < length);
430
- }
431
-
432
- var _isIndex = isIndex;
433
-
434
- /** `Object#toString` result references. */
435
- var argsTag$1 = '[object Arguments]',
436
- arrayTag = '[object Array]',
437
- boolTag = '[object Boolean]',
438
- dateTag = '[object Date]',
439
- errorTag = '[object Error]',
440
- funcTag = '[object Function]',
441
- mapTag = '[object Map]',
442
- numberTag = '[object Number]',
443
- objectTag = '[object Object]',
444
- regexpTag = '[object RegExp]',
445
- setTag = '[object Set]',
446
- stringTag$1 = '[object String]',
447
- weakMapTag = '[object WeakMap]';
448
-
449
- var arrayBufferTag = '[object ArrayBuffer]',
450
- dataViewTag = '[object DataView]',
451
- float32Tag = '[object Float32Array]',
452
- float64Tag = '[object Float64Array]',
453
- int8Tag = '[object Int8Array]',
454
- int16Tag = '[object Int16Array]',
455
- int32Tag = '[object Int32Array]',
456
- uint8Tag = '[object Uint8Array]',
457
- uint8ClampedTag = '[object Uint8ClampedArray]',
458
- uint16Tag = '[object Uint16Array]',
459
- uint32Tag = '[object Uint32Array]';
460
-
461
- /** Used to identify `toStringTag` values of typed arrays. */
462
- var typedArrayTags = {};
463
- typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
464
- typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
465
- typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
466
- typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
467
- typedArrayTags[uint32Tag] = true;
468
- typedArrayTags[argsTag$1] = typedArrayTags[arrayTag] =
469
- typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
470
- typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
471
- typedArrayTags[errorTag] = typedArrayTags[funcTag] =
472
- typedArrayTags[mapTag] = typedArrayTags[numberTag] =
473
- typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
474
- typedArrayTags[setTag] = typedArrayTags[stringTag$1] =
475
- typedArrayTags[weakMapTag] = false;
476
-
477
- /**
478
- * The base implementation of `_.isTypedArray` without Node.js optimizations.
479
- *
480
- * @private
481
- * @param {*} value The value to check.
482
- * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
483
- */
484
- function baseIsTypedArray(value) {
485
- return isSymbol.isObjectLike_1(value) &&
486
- isLength_1(value.length) && !!typedArrayTags[isSymbol._baseGetTag(value)];
487
- }
488
-
489
- var _baseIsTypedArray = baseIsTypedArray;
490
-
491
- /**
492
- * The base implementation of `_.unary` without support for storing metadata.
493
- *
494
- * @private
495
- * @param {Function} func The function to cap arguments for.
496
- * @returns {Function} Returns the new capped function.
497
- */
498
- function baseUnary(func) {
499
- return function(value) {
500
- return func(value);
501
- };
502
- }
503
-
504
- var _baseUnary = baseUnary;
505
-
506
- var _nodeUtil = _commonjsHelpers.createCommonjsModule(function (module, exports) {
507
- /** Detect free variable `exports`. */
508
- var freeExports = exports && !exports.nodeType && exports;
509
-
510
- /** Detect free variable `module`. */
511
- var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
512
-
513
- /** Detect the popular CommonJS extension `module.exports`. */
514
- var moduleExports = freeModule && freeModule.exports === freeExports;
515
-
516
- /** Detect free variable `process` from Node.js. */
517
- var freeProcess = moduleExports && isSymbol._freeGlobal.process;
518
-
519
- /** Used to access faster Node.js helpers. */
520
- var nodeUtil = (function() {
521
- try {
522
- // Use `util.types` for Node.js 10+.
523
- var types = freeModule && freeModule.require && freeModule.require('util').types;
524
-
525
- if (types) {
526
- return types;
527
- }
528
-
529
- // Legacy `process.binding('util')` for Node.js < 10.
530
- return freeProcess && freeProcess.binding && freeProcess.binding('util');
531
- } catch (e) {}
532
- }());
533
-
534
- module.exports = nodeUtil;
535
- });
536
-
537
- /* Node.js helper references. */
538
- var nodeIsTypedArray = _nodeUtil && _nodeUtil.isTypedArray;
539
-
540
- /**
541
- * Checks if `value` is classified as a typed array.
542
- *
543
- * @static
544
- * @memberOf _
545
- * @since 3.0.0
546
- * @category Lang
547
- * @param {*} value The value to check.
548
- * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
549
- * @example
550
- *
551
- * _.isTypedArray(new Uint8Array);
552
- * // => true
553
- *
554
- * _.isTypedArray([]);
555
- * // => false
556
- */
557
- var isTypedArray = nodeIsTypedArray ? _baseUnary(nodeIsTypedArray) : _baseIsTypedArray;
558
-
559
- var isTypedArray_1 = isTypedArray;
560
-
561
- /** Used for built-in method references. */
562
- var objectProto$1 = Object.prototype;
563
-
564
- /** Used to check objects for own properties. */
565
- var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
566
-
567
- /**
568
- * Creates an array of the enumerable property names of the array-like `value`.
569
- *
570
- * @private
571
- * @param {*} value The value to query.
572
- * @param {boolean} inherited Specify returning inherited property names.
573
- * @returns {Array} Returns the array of property names.
574
- */
575
- function arrayLikeKeys(value, inherited) {
576
- var isArr = _arrayMap.isArray_1(value),
577
- isArg = !isArr && isArguments_1(value),
578
- isBuff = !isArr && !isArg && isBuffer_1(value),
579
- isType = !isArr && !isArg && !isBuff && isTypedArray_1(value),
580
- skipIndexes = isArr || isArg || isBuff || isType,
581
- result = skipIndexes ? _baseTimes(value.length, String) : [],
582
- length = result.length;
583
-
584
- for (var key in value) {
585
- if ((inherited || hasOwnProperty$1.call(value, key)) &&
586
- !(skipIndexes && (
587
- // Safari 9 has enumerable `arguments.length` in strict mode.
588
- key == 'length' ||
589
- // Node.js 0.10 has enumerable non-index properties on buffers.
590
- (isBuff && (key == 'offset' || key == 'parent')) ||
591
- // PhantomJS 2 has enumerable non-index properties on typed arrays.
592
- (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
593
- // Skip index properties.
594
- _isIndex(key, length)
595
- ))) {
596
- result.push(key);
597
- }
598
- }
599
- return result;
600
- }
601
-
602
- var _arrayLikeKeys = arrayLikeKeys;
603
-
604
- /** Used for built-in method references. */
605
- var objectProto$2 = Object.prototype;
606
-
607
- /**
608
- * Checks if `value` is likely a prototype object.
609
- *
610
- * @private
611
- * @param {*} value The value to check.
612
- * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
613
- */
614
- function isPrototype(value) {
615
- var Ctor = value && value.constructor,
616
- proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto$2;
617
-
618
- return value === proto;
619
- }
620
-
621
- var _isPrototype = isPrototype;
622
-
623
- /**
624
- * Creates a unary function that invokes `func` with its argument transformed.
625
- *
626
- * @private
627
- * @param {Function} func The function to wrap.
628
- * @param {Function} transform The argument transform.
629
- * @returns {Function} Returns the new function.
630
- */
631
- function overArg(func, transform) {
632
- return function(arg) {
633
- return func(transform(arg));
634
- };
635
- }
636
-
637
- var _overArg = overArg;
638
-
639
- /* Built-in method references for those with the same name as other `lodash` methods. */
640
- var nativeKeys = _overArg(Object.keys, Object);
641
-
642
- var _nativeKeys = nativeKeys;
643
-
644
- /** Used for built-in method references. */
645
- var objectProto$3 = Object.prototype;
646
-
647
- /** Used to check objects for own properties. */
648
- var hasOwnProperty$2 = objectProto$3.hasOwnProperty;
649
-
650
- /**
651
- * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
652
- *
653
- * @private
654
- * @param {Object} object The object to query.
655
- * @returns {Array} Returns the array of property names.
656
- */
657
- function baseKeys(object) {
658
- if (!_isPrototype(object)) {
659
- return _nativeKeys(object);
660
- }
661
- var result = [];
662
- for (var key in Object(object)) {
663
- if (hasOwnProperty$2.call(object, key) && key != 'constructor') {
664
- result.push(key);
665
- }
666
- }
667
- return result;
668
- }
669
-
670
- var _baseKeys = baseKeys;
671
-
672
- /**
673
- * Creates an array of the own enumerable property names of `object`.
674
- *
675
- * **Note:** Non-object values are coerced to objects. See the
676
- * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
677
- * for more details.
678
- *
679
- * @static
680
- * @since 0.1.0
681
- * @memberOf _
682
- * @category Object
683
- * @param {Object} object The object to query.
684
- * @returns {Array} Returns the array of property names.
685
- * @example
686
- *
687
- * function Foo() {
688
- * this.a = 1;
689
- * this.b = 2;
690
- * }
691
- *
692
- * Foo.prototype.c = 3;
693
- *
694
- * _.keys(new Foo);
695
- * // => ['a', 'b'] (iteration order is not guaranteed)
696
- *
697
- * _.keys('hi');
698
- * // => ['0', '1']
699
- */
700
- function keys(object) {
701
- return isArrayLike_1(object) ? _arrayLikeKeys(object) : _baseKeys(object);
702
- }
703
-
704
- var keys_1 = keys;
705
-
706
- /**
707
- * Creates an array of the own enumerable string keyed property values of `object`.
708
- *
709
- * **Note:** Non-object values are coerced to objects.
710
- *
711
- * @static
712
- * @since 0.1.0
713
- * @memberOf _
714
- * @category Object
715
- * @param {Object} object The object to query.
716
- * @returns {Array} Returns the array of property values.
717
- * @example
718
- *
719
- * function Foo() {
720
- * this.a = 1;
721
- * this.b = 2;
722
- * }
723
- *
724
- * Foo.prototype.c = 3;
725
- *
726
- * _.values(new Foo);
727
- * // => [1, 2] (iteration order is not guaranteed)
728
- *
729
- * _.values('hi');
730
- * // => ['h', 'i']
731
- */
732
- function values(object) {
733
- return object == null ? [] : _baseValues(object, keys_1(object));
734
- }
735
-
736
- var values_1 = values;
737
-
738
- /* Built-in method references for those with the same name as other `lodash` methods. */
739
- var nativeMax = Math.max;
740
-
741
- /**
742
- * Checks if `value` is in `collection`. If `collection` is a string, it's
743
- * checked for a substring of `value`, otherwise
744
- * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
745
- * is used for equality comparisons. If `fromIndex` is negative, it's used as
746
- * the offset from the end of `collection`.
747
- *
748
- * @static
749
- * @memberOf _
750
- * @since 0.1.0
751
- * @category Collection
752
- * @param {Array|Object|string} collection The collection to inspect.
753
- * @param {*} value The value to search for.
754
- * @param {number} [fromIndex=0] The index to search from.
755
- * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
756
- * @returns {boolean} Returns `true` if `value` is found, else `false`.
757
- * @example
758
- *
759
- * _.includes([1, 2, 3], 1);
760
- * // => true
761
- *
762
- * _.includes([1, 2, 3], 1, 2);
763
- * // => false
764
- *
765
- * _.includes({ 'a': 1, 'b': 2 }, 1);
766
- * // => true
767
- *
768
- * _.includes('abcd', 'bc');
769
- * // => true
770
- */
771
- function includes(collection, value, fromIndex, guard) {
772
- collection = isArrayLike_1(collection) ? collection : values_1(collection);
773
- fromIndex = (fromIndex && !guard) ? toInteger_1(fromIndex) : 0;
774
-
775
- var length = collection.length;
776
- if (fromIndex < 0) {
777
- fromIndex = nativeMax(length + fromIndex, 0);
778
- }
779
- return isString_1(collection)
780
- ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)
781
- : (!!length && _baseIndexOf(collection, value, fromIndex) > -1);
782
- }
783
-
784
- var includes_1 = includes;
785
-
786
- var InscreenSensor = function (_React$Component) {
787
- inherits._inherits(InscreenSensor, _React$Component);
788
-
789
- function InscreenSensor(props) {
790
- inherits._classCallCheck(this, InscreenSensor);
791
-
792
- var _this = inherits._possibleConstructorReturn(this, (InscreenSensor.__proto__ || inherits._Object$getPrototypeOf(InscreenSensor)).call(this, props));
793
-
794
- _this.scrollHandler = function () {
795
- var visible = _this.checkInside();
796
- if (visible !== _this.visible) {
797
- _this.visible = visible;
798
- _this.props.onChange(visible);
799
- }
800
- };
801
-
802
- _this.checkInside = function () {
803
- var rect = _this.wraperRef.current.getBoundingClientRect();
804
- var _this$props$offSetTop = _this.props.offSetTop,
805
- offSetTop = _this$props$offSetTop === undefined ? 0 : _this$props$offSetTop;
806
- var top = rect.top,
807
- bottom = rect.bottom;
808
-
809
- var viewHeight = window.innerHeight;
810
- var wrpElem = document.getElementsByClassName('inscreen-wrapper');
811
-
812
- if (top > 0 && top <= offSetTop) {
813
- if (wrpElem.length > 1 && top <= viewHeight && bottom > viewHeight) {
814
- return 'top';
815
- } else if (wrpElem.length > 1 && bottom < viewHeight) {
816
- return 'small-top';
817
- }
818
- } else if (wrpElem.length > 1 && top < offSetTop && bottom + offSetTop >= viewHeight) {
819
- return 'bottom';
820
- }
821
- };
822
-
823
- _this.wraperRef = React__default.createRef();
824
- _this.visible = false;
825
- return _this;
826
- }
827
-
828
- inherits._createClass(InscreenSensor, [{
829
- key: 'componentDidMount',
830
- value: function componentDidMount() {
831
- this.visible = this.checkInside();
832
- this.props.onChange(this.visible);
833
- window.addEventListener('scroll', this.scrollHandler);
834
- }
835
- }, {
836
- key: 'componentWillUnmount',
837
- value: function componentWillUnmount() {
838
- window.removeEventListener('scroll', this.scrollHandler);
839
- }
840
- }, {
841
- key: 'render',
842
- value: function render() {
843
- var _props = this.props,
844
- _props$className = _props.className,
845
- className = _props$className === undefined ? '' : _props$className,
846
- _props$style = _props.style,
847
- style = _props$style === undefined ? {} : _props$style,
848
- _props$id = _props.id,
849
- id = _props$id === undefined ? '' : _props$id;
850
-
851
- return React__default.createElement(
852
- 'div',
853
- { ref: this.wraperRef, className: className, style: style, id: id },
854
- this.props.children
855
- );
856
- }
857
- }]);
858
-
859
- return InscreenSensor;
860
- }(React__default.Component);
861
-
862
- exports.InscreenSensor = InscreenSensor;
863
- exports.includes_1 = includes_1;