@arms/rum-core 0.0.36 → 0.0.37

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.
@@ -20,6 +20,12 @@ var Context = /*#__PURE__*/function () {
20
20
  return this.views;
21
21
  };
22
22
  _proto.addView = function addView(view) {
23
+ var index = this.views.findIndex(function (v) {
24
+ return v.id === view.id;
25
+ });
26
+ if (index >= 0) {
27
+ this.views.splice(index, 1);
28
+ }
23
29
  this.views.push(view);
24
30
  };
25
31
  _proto.removeView = function removeView(viewId) {
@@ -158,5 +158,13 @@ export interface IConfiguration {
158
158
  properties?: {
159
159
  [key: string]: number | string;
160
160
  };
161
+ /**
162
+ * 检测元素是否溢出的弹性长度
163
+ */
164
+ overflowPx?: number;
165
+ /**
166
+ * 检测正则匹配内容
167
+ */
168
+ regexp?: string;
161
169
  [key: string]: unknown;
162
170
  }
@@ -117,7 +117,8 @@ export declare enum AppType {
117
117
  browser = "browser",
118
118
  miniapp = "miniapp",
119
119
  minigame = "minigame",
120
- uniapp = "uniapp"
120
+ uniapp = "uniapp",
121
+ reactnative = "reactnative"
121
122
  }
122
123
  export interface RumEventBundle {
123
124
  app: {
@@ -170,6 +171,7 @@ export interface RumEventBundle {
170
171
  net?: {
171
172
  model?: string;
172
173
  name?: string;
174
+ ip?: string;
173
175
  };
174
176
  events: Array<RumEvent>;
175
177
  properties?: BaseObject;
@@ -22,5 +22,6 @@ export var AppType = /*#__PURE__*/function (AppType) {
22
22
  AppType["miniapp"] = "miniapp";
23
23
  AppType["minigame"] = "minigame";
24
24
  AppType["uniapp"] = "uniapp";
25
+ AppType["reactnative"] = "reactnative";
25
26
  return AppType;
26
27
  }({});
package/es/utils/base.js CHANGED
@@ -56,7 +56,7 @@ export function generateGUID() {
56
56
  }, '').replace(/^(.{8})(.{4})(.{4})(.{4})(.{12})$/, '\$1-\$2-\$3-\$4-\$5');
57
57
  }
58
58
  } catch (e) {
59
- //
59
+ guid = '';
60
60
  }
61
61
  if (!guid) {
62
62
  guid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
@@ -24,6 +24,12 @@ var Context = /*#__PURE__*/function () {
24
24
  return this.views;
25
25
  };
26
26
  _proto.addView = function addView(view) {
27
+ var index = this.views.findIndex(function (v) {
28
+ return v.id === view.id;
29
+ });
30
+ if (index >= 0) {
31
+ this.views.splice(index, 1);
32
+ }
27
33
  this.views.push(view);
28
34
  };
29
35
  _proto.removeView = function removeView(viewId) {
@@ -158,5 +158,13 @@ export interface IConfiguration {
158
158
  properties?: {
159
159
  [key: string]: number | string;
160
160
  };
161
+ /**
162
+ * 检测元素是否溢出的弹性长度
163
+ */
164
+ overflowPx?: number;
165
+ /**
166
+ * 检测正则匹配内容
167
+ */
168
+ regexp?: string;
161
169
  [key: string]: unknown;
162
170
  }
@@ -117,7 +117,8 @@ export declare enum AppType {
117
117
  browser = "browser",
118
118
  miniapp = "miniapp",
119
119
  minigame = "minigame",
120
- uniapp = "uniapp"
120
+ uniapp = "uniapp",
121
+ reactnative = "reactnative"
121
122
  }
122
123
  export interface RumEventBundle {
123
124
  app: {
@@ -170,6 +171,7 @@ export interface RumEventBundle {
170
171
  net?: {
171
172
  model?: string;
172
173
  name?: string;
174
+ ip?: string;
173
175
  };
174
176
  events: Array<RumEvent>;
175
177
  properties?: BaseObject;
@@ -26,5 +26,6 @@ var AppType = exports.AppType = /*#__PURE__*/function (AppType) {
26
26
  AppType["miniapp"] = "miniapp";
27
27
  AppType["minigame"] = "minigame";
28
28
  AppType["uniapp"] = "uniapp";
29
+ AppType["reactnative"] = "reactnative";
29
30
  return AppType;
30
31
  }({});
package/lib/utils/base.js CHANGED
@@ -69,7 +69,7 @@ function generateGUID() {
69
69
  }, '').replace(/^(.{8})(.{4})(.{4})(.{4})(.{12})$/, '\$1-\$2-\$3-\$4-\$5');
70
70
  }
71
71
  } catch (e) {
72
- //
72
+ guid = '';
73
73
  }
74
74
  if (!guid) {
75
75
  guid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arms/rum-core",
3
- "version": "0.0.36",
3
+ "version": "0.0.37",
4
4
  "description": "arms rum javascript sdk core",
5
5
  "author": "guangli.fj <guangli.fj@alibaba-inc.com>",
6
6
  "license": "ISC",