@dynatrace/react-native-plugin 2.331.1 → 2.333.1

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 (34) hide show
  1. package/README.md +96 -6
  2. package/android/build.gradle +1 -1
  3. package/android/src/main/java/com/dynatrace/android/agent/DynatraceRNBridgeImpl.kt +7 -1
  4. package/android/src/main/java/com/dynatrace/android/agent/DynatraceUtils.kt +1 -0
  5. package/android/src/new/java/com/dynatrace/android/agent/DynatraceRNBridge.kt +1 -0
  6. package/android/src/old/java/com/dynatrace/android/agent/DynatraceRNBridge.kt +2 -1
  7. package/files/plugin.gradle +1 -1
  8. package/instrumentation/DynatraceInstrumentation.js +1 -1
  9. package/instrumentation/jsx/CreateElement.js +106 -6
  10. package/instrumentation/jsx/JsxDevRuntime.js +2 -6
  11. package/instrumentation/jsx/JsxRuntime.js +2 -6
  12. package/instrumentation/libs/withOnPressMonitoring.js +49 -3
  13. package/ios/DynatraceRNBridge.mm +8 -1
  14. package/lib/core/Application.js +2 -0
  15. package/lib/core/Dynatrace.js +2 -1
  16. package/lib/core/UserPrivacyOptions.js +8 -1
  17. package/lib/core/configuration/ConfigurationHandler.js +21 -0
  18. package/lib/features/ui-interaction/Config.js +36 -0
  19. package/lib/features/ui-interaction/IUserInteractionEvent.js +16 -0
  20. package/lib/features/ui-interaction/Plugin.js +945 -0
  21. package/lib/features/ui-interaction/RootDetection.js +51 -0
  22. package/lib/features/ui-interaction/RootWrapper.js +236 -0
  23. package/lib/features/ui-interaction/Run.js +34 -0
  24. package/lib/features/ui-interaction/Runtime.js +1494 -0
  25. package/lib/features/ui-interaction/Types.js +75 -0
  26. package/lib/next/Dynatrace.js +1 -1
  27. package/lib/next/configuration/INativeRuntimeConfiguration.js +1 -0
  28. package/lib/next/configuration/RuntimeConfigurationObserver.js +47 -12
  29. package/lib/next/events/EventPipeline.js +9 -0
  30. package/package.json +19 -10
  31. package/react-native-dynatrace.podspec +1 -1
  32. package/scripts/Config.js +1 -0
  33. package/src/lib/core/interface/NativeDynatraceBridge.ts +1 -0
  34. package/types.d.ts +22 -9
@@ -2,9 +2,10 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.UserPrivacyOptions = void 0;
4
4
  class UserPrivacyOptions {
5
- constructor(dataCollectionLevel, crashReportingOptedIn) {
5
+ constructor(dataCollectionLevel, crashReportingOptedIn, screenRecordOptedIn = false) {
6
6
  this._dataCollectionLevel = dataCollectionLevel;
7
7
  this._crashReportingOptedIn = crashReportingOptedIn;
8
+ this._screenRecordOptedIn = screenRecordOptedIn;
8
9
  }
9
10
  get dataCollectionLevel() {
10
11
  return this._dataCollectionLevel;
@@ -18,5 +19,11 @@ class UserPrivacyOptions {
18
19
  set dataCollectionLevel(dataCollectionLevel) {
19
20
  this._dataCollectionLevel = dataCollectionLevel;
20
21
  }
22
+ get screenRecordOptedIn() {
23
+ return this._screenRecordOptedIn;
24
+ }
25
+ set screenRecordOptedIn(screenRecordOptedIn) {
26
+ this._screenRecordOptedIn = screenRecordOptedIn;
27
+ }
21
28
  }
22
29
  exports.UserPrivacyOptions = UserPrivacyOptions;
@@ -4,10 +4,14 @@ exports.ConfigurationHandler = void 0;
4
4
  const RuntimeConfigurationObserver_1 = require("../../next/configuration/RuntimeConfigurationObserver");
5
5
  const LogLevel_1 = require("../logging/LogLevel");
6
6
  let _configuration;
7
+ let _uiiEnabledLastKnownGood = undefined;
7
8
  exports.ConfigurationHandler = {
8
9
  setConfiguration(configuration) {
9
10
  _configuration = configuration;
10
11
  },
12
+ setUserInteractionEnabledLastKnownGood(value) {
13
+ _uiiEnabledLastKnownGood = value;
14
+ },
11
15
  isConfigurationAvailable: () => _configuration !== undefined,
12
16
  isErrorHandlerEnabled: () => _configuration.errorHandler,
13
17
  isReportFatalErrorAsCrash: () => _configuration.reportFatalErrorAsCrash,
@@ -16,6 +20,23 @@ exports.ConfigurationHandler = {
16
20
  isLifecycleUpdateEnabled: () => _configuration.lifecycleUpdate,
17
21
  isActionNamePrivacyEnabled: () => _configuration.actionNamePrivacy,
18
22
  isGrailEnabled: () => RuntimeConfigurationObserver_1.RuntimeConfigurationObserver.getCurrentRuntimeConfiguration()['3rd_gen_enabled'],
23
+ isUserInteractionEnabled: () => {
24
+ const isRuntimeConfigInitiated = RuntimeConfigurationObserver_1.RuntimeConfigurationObserver.isInitiated();
25
+ if (isRuntimeConfigInitiated) {
26
+ const realTimeconfiguration = RuntimeConfigurationObserver_1.RuntimeConfigurationObserver.getCurrentRuntimeConfiguration();
27
+ const remoteUIConfiguration = realTimeconfiguration
28
+ ? realTimeconfiguration.touch_interaction_enabled
29
+ : undefined;
30
+ if (typeof remoteUIConfiguration === 'boolean') {
31
+ _uiiEnabledLastKnownGood = remoteUIConfiguration;
32
+ return remoteUIConfiguration;
33
+ }
34
+ }
35
+ if (typeof _uiiEnabledLastKnownGood === 'boolean') {
36
+ return _uiiEnabledLastKnownGood;
37
+ }
38
+ return false;
39
+ },
19
40
  isRuntimeConfigurationInitiated: () => RuntimeConfigurationObserver_1.RuntimeConfigurationObserver.isInitiated(),
20
41
  getBundleName: () => _configuration.bundleName,
21
42
  getBundleVersion: () => _configuration.bundleVersion,
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DT_UII_ROOT_CONFIG = exports.getDTConfig = exports.DEFAULT_DT_CONFIG = void 0;
4
+ const Types_1 = require("./Types");
5
+ exports.DEFAULT_DT_CONFIG = {
6
+ log: true,
7
+ artifactsDir: Types_1.Literals.DefaultArtifactsDir,
8
+ runtimeImport: Types_1.Literals.DefaultRuntimeImport,
9
+ componentNames: {
10
+ segment: Types_1.Literals.DefaultSegmentName,
11
+ tabButton: Types_1.Literals.DefaultTabButtonName,
12
+ root: Types_1.Literals.DefaultRootName,
13
+ },
14
+ ui: {
15
+ skipTags: ['NavigationContainer'],
16
+ },
17
+ };
18
+ const getDTConfig = () => exports.DEFAULT_DT_CONFIG;
19
+ exports.getDTConfig = getDTConfig;
20
+ exports.DT_UII_ROOT_CONFIG = {
21
+ path: {
22
+ withRole: true,
23
+ withIndex: true,
24
+ indexMode: 'global',
25
+ indexStyle: 'bracket',
26
+ withSid: false,
27
+ separator: '/',
28
+ },
29
+ mask: {
30
+ replaceWith: '***',
31
+ testID: (id) => /email|phone/i.test(id),
32
+ text: (s) => s.length > 20,
33
+ },
34
+ click: { capturePosition: 'page' },
35
+ touch: { enabled: true, mode: 'grouped' },
36
+ };
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UserInteractionEventKey = void 0;
4
+ var UserInteractionEventKey;
5
+ (function (UserInteractionEventKey) {
6
+ UserInteractionEventKey["EventHasUserInteraction"] = "characteristics.has_user_interaction";
7
+ UserInteractionEventKey["UiElementDetectedName"] = "ui_element.detected_name";
8
+ UserInteractionEventKey["UiElementComponents"] = "ui_element.components";
9
+ UserInteractionEventKey["UiElementId"] = "ui_element.id";
10
+ UserInteractionEventKey["UiElementNameOrigin"] = "ui_element.name_origin";
11
+ UserInteractionEventKey["InteractionType"] = "interaction.type";
12
+ UserInteractionEventKey["UiElementResponderDetectedName"] = "ui_element.responder.detected_name";
13
+ UserInteractionEventKey["UiElementResponderComponents"] = "ui_element.responder.components";
14
+ UserInteractionEventKey["UiElementResponderOriginName"] = "ui_element.responder.name_origin";
15
+ UserInteractionEventKey["UiElementResponderId"] = "ui_element.responder.id";
16
+ })(UserInteractionEventKey = exports.UserInteractionEventKey || (exports.UserInteractionEventKey = {}));