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