@openreplay/tracker 17.2.9 → 17.2.10

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/dist/cjs/entry.js CHANGED
@@ -4009,7 +4009,7 @@ class App {
4009
4009
  this.stopCallbacks = [];
4010
4010
  this.commitCallbacks = [];
4011
4011
  this.activityState = ActivityState.NotActive;
4012
- this.version = '17.2.9'; // TODO: version compatability check inside each plugin.
4012
+ this.version = '17.2.10'; // TODO: version compatability check inside each plugin.
4013
4013
  this.socketMode = false;
4014
4014
  this.compressionThreshold = 24 * 1000;
4015
4015
  this.bc = null;
@@ -6039,9 +6039,11 @@ function Input (app, opts) {
6039
6039
  }
6040
6040
  const inputValues = new Map();
6041
6041
  const checkboxValues = new Map();
6042
+ const selectValues = new Map();
6042
6043
  app.attachStopCallback(() => {
6043
6044
  inputValues.clear();
6044
6045
  checkboxValues.clear();
6046
+ selectValues.clear();
6045
6047
  tagSelectorMap.clear();
6046
6048
  });
6047
6049
  function trackInputValue(id, node) {
@@ -6058,6 +6060,13 @@ function Input (app, opts) {
6058
6060
  checkboxValues.set(id, value);
6059
6061
  app.send(SetInputChecked(id, value));
6060
6062
  }
6063
+ function trackSelectValue(id, node) {
6064
+ if (selectValues.get(id) === node.value) {
6065
+ return;
6066
+ }
6067
+ selectValues.set(id, node.value);
6068
+ sendInputValue(id, node);
6069
+ }
6061
6070
  // The only way (to our knowledge) to track all kinds of input changes, including those made by JS
6062
6071
  app.ticker.attach(() => {
6063
6072
  inputValues.forEach((value, id) => {
@@ -6072,6 +6081,12 @@ function Input (app, opts) {
6072
6081
  return checkboxValues.delete(id);
6073
6082
  trackCheckboxValue(id, node.checked);
6074
6083
  });
6084
+ selectValues.forEach((_, id) => {
6085
+ const node = app.nodes.getNode(id);
6086
+ if (!node)
6087
+ return selectValues.delete(id);
6088
+ trackSelectValue(id, node);
6089
+ });
6075
6090
  }, 3);
6076
6091
  function sendInputChange(id, node, hesitationTime, inputTime) {
6077
6092
  const { value, mask } = getInputValue(id, node);
@@ -6088,8 +6103,8 @@ function Input (app, opts) {
6088
6103
  }
6089
6104
  // TODO: support multiple select (?): use selectedOptions;
6090
6105
  if (hasTag(node, 'select')) {
6091
- sendInputValue(id, node);
6092
- app.nodes.attachNodeListener(node, 'change', () => sendInputValue(id, node));
6106
+ trackSelectValue(id, node);
6107
+ app.nodes.attachNodeListener(node, 'change', () => trackSelectValue(id, node));
6093
6108
  }
6094
6109
  if (isTextFieldElement(node)) {
6095
6110
  trackInputValue(id, node);
@@ -8942,7 +8957,7 @@ class ConstantProperties {
8942
8957
  user_id: this.user_id,
8943
8958
  distinct_id: this.deviceId,
8944
8959
  sdk_edition: 'web',
8945
- sdk_version: '17.2.9',
8960
+ sdk_version: '17.2.10',
8946
8961
  timezone: getUTCOffsetString(),
8947
8962
  search_engine: this.searchEngine,
8948
8963
  };
@@ -9644,7 +9659,7 @@ class API {
9644
9659
  this.signalStartIssue = (reason, missingApi) => {
9645
9660
  const doNotTrack = this.checkDoNotTrack();
9646
9661
  console.log("Tracker couldn't start due to:", JSON.stringify({
9647
- trackerVersion: '17.2.9',
9662
+ trackerVersion: '17.2.10',
9648
9663
  projectKey: this.options.projectKey,
9649
9664
  doNotTrack,
9650
9665
  reason: missingApi.length ? `missing api: ${missingApi.join(',')}` : reason,