@microsoft/applicationinsights-react-js 3.1.5 → 3.2.1-nightly.202110-03
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/browser/applicationinsights-react-js.js +43 -47
- package/browser/applicationinsights-react-js.js.map +1 -1
- package/browser/applicationinsights-react-js.min.js +2 -2
- package/browser/applicationinsights-react-js.min.js.map +1 -1
- package/dist/applicationinsights-react-js.api.json +1194 -0
- package/dist/applicationinsights-react-js.api.md +91 -0
- package/dist/applicationinsights-react-js.d.ts +109 -0
- package/dist/applicationinsights-react-js.js +43 -47
- package/dist/applicationinsights-react-js.js.map +1 -1
- package/dist/applicationinsights-react-js.min.js +2 -2
- package/dist/applicationinsights-react-js.min.js.map +1 -1
- package/dist/applicationinsights-react-js.rollup.d.ts +114 -0
- package/dist-esm/AppInsightsContext.js +1 -1
- package/dist-esm/AppInsightsErrorBoundary.js +1 -1
- package/dist-esm/Interfaces/IReactExtensionConfig.js +2 -1
- package/dist-esm/Interfaces/IReactExtensionConfig.js.map +1 -1
- package/dist-esm/ReactPlugin.js +1 -1
- package/dist-esm/applicationinsights-react-js.js +1 -1
- package/dist-esm/useTrackEvent.js +1 -1
- package/dist-esm/useTrackMetric.js +1 -1
- package/dist-esm/withAITracking.js +1 -1
- package/package.json +73 -67
- package/src/AppInsightsContext.tsx +3 -2
- package/src/useTrackEvent.ts +5 -3
- package/tsconfig.json +1 -1
- package/types/AppInsightsContext.d.ts +3 -2
- package/types/AppInsightsErrorBoundary.d.ts +1 -1
- package/types/tsdoc-metadata.json +11 -0
- package/types/useTrackEvent.d.ts +7 -2
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Application Insights JavaScript SDK - React Plugin, 3.1.
|
|
2
|
+
* Application Insights JavaScript SDK - React Plugin, 3.2.1-nightly.202110-03
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
(function (global, factory) {
|
|
6
6
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react')) :
|
|
7
7
|
typeof define === 'function' && define.amd ? define(['exports', 'react'], factory) :
|
|
8
8
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.Microsoft = global.Microsoft || {}, global.Microsoft.ApplicationInsights = global.Microsoft.ApplicationInsights || {}), global.React));
|
|
9
|
-
}(this, (function (exports, React) { 'use strict';
|
|
9
|
+
})(this, (function (exports, React) { 'use strict';
|
|
10
10
|
|
|
11
11
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
12
12
|
|
|
@@ -19,14 +19,12 @@
|
|
|
19
19
|
var d = (function(obj, prop) { /* ai_es3_polyfil getOwnPropertyDescriptor */var func = Object["getOwnPropertyDescriptor"]; if (func) { return func(obj, prop); } return undefined; })(e, k);
|
|
20
20
|
(function(obj, prop, descriptor) { /* ai_es3_polyfil defineProperty */ var func = Object["defineProperty"]; if (func) { try { return func(obj, prop, descriptor); } catch(e) { /* IE8 defines defineProperty, but will throw */ } } if (descriptor && typeof descriptor.value !== undefined) { obj[prop] = descriptor.value; } return obj; })(n, k, d.get ? d : {
|
|
21
21
|
enumerable: true,
|
|
22
|
-
get: function () {
|
|
23
|
-
return e[k];
|
|
24
|
-
}
|
|
22
|
+
get: function () { return e[k]; }
|
|
25
23
|
});
|
|
26
24
|
}
|
|
27
25
|
});
|
|
28
26
|
}
|
|
29
|
-
n[
|
|
27
|
+
n["default"] = e;
|
|
30
28
|
return n;
|
|
31
29
|
}
|
|
32
30
|
|
|
@@ -441,14 +439,13 @@
|
|
|
441
439
|
InvalidInstrumentationKey: 100,
|
|
442
440
|
CannotParseAiBlobValue: 101,
|
|
443
441
|
InvalidContentBlob: 102,
|
|
444
|
-
TrackPageActionEventFailed: 103
|
|
442
|
+
TrackPageActionEventFailed: 103,
|
|
443
|
+
FailedAddingCustomDefinedRequestContext: 104
|
|
445
444
|
};
|
|
446
445
|
|
|
447
446
|
var strOnPrefix = "on";
|
|
448
447
|
var strAttachEvent = "attachEvent";
|
|
449
448
|
var strAddEventHelper = "addEventListener";
|
|
450
|
-
var strDetachEvent = "detachEvent";
|
|
451
|
-
var strRemoveEventListener = "removeEventListener";
|
|
452
449
|
var _objDefineProperty = ObjDefineProperty;
|
|
453
450
|
function objToString(obj) {
|
|
454
451
|
return ObjProto.toString.call(obj);
|
|
@@ -493,21 +490,6 @@
|
|
|
493
490
|
}
|
|
494
491
|
return result;
|
|
495
492
|
}
|
|
496
|
-
function detachEvent(obj, eventNameWithoutOn, handlerRef, useCapture) {
|
|
497
|
-
if (useCapture === void 0) { useCapture = false; }
|
|
498
|
-
if (!isNullOrUndefined(obj)) {
|
|
499
|
-
try {
|
|
500
|
-
if (!isNullOrUndefined(obj[strRemoveEventListener])) {
|
|
501
|
-
obj[strRemoveEventListener](eventNameWithoutOn, handlerRef, useCapture);
|
|
502
|
-
}
|
|
503
|
-
else if (!isNullOrUndefined(obj[strDetachEvent])) {
|
|
504
|
-
obj[strDetachEvent](strOnPrefix + eventNameWithoutOn, handlerRef);
|
|
505
|
-
}
|
|
506
|
-
}
|
|
507
|
-
catch (e) {
|
|
508
|
-
}
|
|
509
|
-
}
|
|
510
|
-
}
|
|
511
493
|
function objForEachKey(target, callbackfn) {
|
|
512
494
|
if (target) {
|
|
513
495
|
for (var prop in target) {
|
|
@@ -582,33 +564,45 @@
|
|
|
582
564
|
}
|
|
583
565
|
function arrForEach(arr, callbackfn, thisArg) {
|
|
584
566
|
var len = arr.length;
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
if (
|
|
588
|
-
|
|
567
|
+
try {
|
|
568
|
+
for (var idx = 0; idx < len; idx++) {
|
|
569
|
+
if (idx in arr) {
|
|
570
|
+
if (callbackfn.call(thisArg || arr, arr[idx], idx, arr) === -1) {
|
|
571
|
+
break;
|
|
572
|
+
}
|
|
589
573
|
}
|
|
590
574
|
}
|
|
591
575
|
}
|
|
576
|
+
catch (e) {
|
|
577
|
+
}
|
|
592
578
|
}
|
|
593
579
|
function arrIndexOf(arr, searchElement, fromIndex) {
|
|
594
580
|
var len = arr.length;
|
|
595
581
|
var from = fromIndex || 0;
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
582
|
+
try {
|
|
583
|
+
for (var lp = Math.max(from >= 0 ? from : len - Math.abs(from), 0); lp < len; lp++) {
|
|
584
|
+
if (lp in arr && arr[lp] === searchElement) {
|
|
585
|
+
return lp;
|
|
586
|
+
}
|
|
599
587
|
}
|
|
600
588
|
}
|
|
589
|
+
catch (e) {
|
|
590
|
+
}
|
|
601
591
|
return -1;
|
|
602
592
|
}
|
|
603
593
|
function arrMap(arr, callbackfn, thisArg) {
|
|
604
594
|
var len = arr.length;
|
|
605
595
|
var _this = thisArg || arr;
|
|
606
596
|
var results = new Array(len);
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
597
|
+
try {
|
|
598
|
+
for (var lp = 0; lp < len; lp++) {
|
|
599
|
+
if (lp in arr) {
|
|
600
|
+
results[lp] = callbackfn.call(_this, arr[lp], arr);
|
|
601
|
+
}
|
|
610
602
|
}
|
|
611
603
|
}
|
|
604
|
+
catch (e) {
|
|
605
|
+
}
|
|
612
606
|
return results;
|
|
613
607
|
}
|
|
614
608
|
function arrReduce(arr, callbackfn, initialValue) {
|
|
@@ -1099,7 +1093,7 @@
|
|
|
1099
1093
|
catch (error) {
|
|
1100
1094
|
var hasRun = _nextProxy && _nextProxy._hasRun;
|
|
1101
1095
|
if (!_nextProxy || !hasRun) {
|
|
1102
|
-
itemCtx.diagLog().throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.PluginException, "Plugin [" + plugin.identifier + "] failed during processTelemetry - " + error);
|
|
1096
|
+
itemCtx.diagLog().throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.PluginException, "Plugin [" + plugin.identifier + "] failed during processTelemetry - " + dumpObj(error));
|
|
1103
1097
|
}
|
|
1104
1098
|
if (_nextProxy && !hasRun) {
|
|
1105
1099
|
_nextProxy.processTelemetry(env, itemCtx);
|
|
@@ -1393,6 +1387,7 @@
|
|
|
1393
1387
|
_enabled = value !== false;
|
|
1394
1388
|
},
|
|
1395
1389
|
set: function (name, value, maxAgeSec, domain, path) {
|
|
1390
|
+
var result = false;
|
|
1396
1391
|
if (_isMgrEnabled(cookieMgr)) {
|
|
1397
1392
|
var values = {};
|
|
1398
1393
|
var theValue = strTrim(value || strEmpty);
|
|
@@ -1430,7 +1425,9 @@
|
|
|
1430
1425
|
setValue(values, "path", path || _path, null, isUndefined);
|
|
1431
1426
|
var setCookieFn = cookieMgrConfig.setCookie || _setCookieValue;
|
|
1432
1427
|
setCookieFn(name, _formatCookieValue(theValue, values));
|
|
1428
|
+
result = true;
|
|
1433
1429
|
}
|
|
1430
|
+
return result;
|
|
1434
1431
|
},
|
|
1435
1432
|
get: function (name) {
|
|
1436
1433
|
var value = strEmpty;
|
|
@@ -1440,11 +1437,15 @@
|
|
|
1440
1437
|
return value;
|
|
1441
1438
|
},
|
|
1442
1439
|
del: function (name, path) {
|
|
1440
|
+
var result = false;
|
|
1443
1441
|
if (_isMgrEnabled(cookieMgr)) {
|
|
1444
|
-
cookieMgr.purge(name, path);
|
|
1442
|
+
result = cookieMgr.purge(name, path);
|
|
1445
1443
|
}
|
|
1444
|
+
return result;
|
|
1446
1445
|
},
|
|
1447
1446
|
purge: function (name, path) {
|
|
1447
|
+
var _a;
|
|
1448
|
+
var result = false;
|
|
1448
1449
|
if (areCookiesSupported(logger)) {
|
|
1449
1450
|
var values = (_a = {},
|
|
1450
1451
|
_a["path"] = path ? path : "/",
|
|
@@ -1455,8 +1456,9 @@
|
|
|
1455
1456
|
}
|
|
1456
1457
|
var delCookie = cookieMgrConfig.delCookie || _setCookieValue;
|
|
1457
1458
|
delCookie(name, _formatCookieValue(strEmpty, values));
|
|
1459
|
+
result = true;
|
|
1458
1460
|
}
|
|
1459
|
-
|
|
1461
|
+
return result;
|
|
1460
1462
|
}
|
|
1461
1463
|
};
|
|
1462
1464
|
cookieMgr[strConfigCookieMgr] = cookieMgr;
|
|
@@ -1625,7 +1627,7 @@
|
|
|
1625
1627
|
}
|
|
1626
1628
|
var doc = getDocument();
|
|
1627
1629
|
if (doc) {
|
|
1628
|
-
result =
|
|
1630
|
+
result = attachEvent(doc, eventName, callback) || result;
|
|
1629
1631
|
}
|
|
1630
1632
|
return result;
|
|
1631
1633
|
}
|
|
@@ -1717,12 +1719,6 @@
|
|
|
1717
1719
|
generateW3CId: generateW3CId
|
|
1718
1720
|
};
|
|
1719
1721
|
var GuidRegex = /[xy]/g;
|
|
1720
|
-
var EventHelper = {
|
|
1721
|
-
Attach: attachEvent,
|
|
1722
|
-
AttachEvent: attachEvent,
|
|
1723
|
-
Detach: detachEvent,
|
|
1724
|
-
DetachEvent: detachEvent
|
|
1725
|
-
};
|
|
1726
1722
|
function _legacyCookieMgr(config, logger) {
|
|
1727
1723
|
var cookieMgr = _gblCookieMgr(config, logger);
|
|
1728
1724
|
var legacyCanUseCookies = CoreUtils._canUseCookies;
|
|
@@ -1944,12 +1940,12 @@
|
|
|
1944
1940
|
AppInsightsErrorBoundary.prototype.render = function () {
|
|
1945
1941
|
if (this.state.hasError) {
|
|
1946
1942
|
var onError = this.props.onError;
|
|
1947
|
-
return React__default[
|
|
1943
|
+
return React__default["default"].createElement(onError);
|
|
1948
1944
|
}
|
|
1949
1945
|
return this.props.children;
|
|
1950
1946
|
};
|
|
1951
1947
|
return AppInsightsErrorBoundary;
|
|
1952
|
-
}(React__default[
|
|
1948
|
+
}(React__default["default"].Component));
|
|
1953
1949
|
var AppInsightsErrorBoundary$1 = AppInsightsErrorBoundary;
|
|
1954
1950
|
|
|
1955
1951
|
var AppInsightsContext = React.createContext(undefined);
|
|
@@ -2048,5 +2044,5 @@
|
|
|
2048
2044
|
|
|
2049
2045
|
(function(obj, prop, descriptor) { /* ai_es3_polyfil defineProperty */ var func = Object["defineProperty"]; if (func) { try { return func(obj, prop, descriptor); } catch(e) { /* IE8 defines defineProperty, but will throw */ } } if (descriptor && typeof descriptor.value !== undefined) { obj[prop] = descriptor.value; } return obj; })(exports, '__esModule', { value: true });
|
|
2050
2046
|
|
|
2051
|
-
}))
|
|
2047
|
+
}));
|
|
2052
2048
|
//# sourceMappingURL=applicationinsights-react-js.js.map
|