@atlaskit/editor-core 234.3.1 → 235.0.0

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 (28) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/cjs/ui/quick-insert/getExtensionQuickInsertComponents.js +7 -4
  3. package/dist/cjs/version-wrapper.js +1 -1
  4. package/dist/es2019/ui/quick-insert/getExtensionQuickInsertComponents.js +6 -2
  5. package/dist/es2019/version-wrapper.js +1 -1
  6. package/dist/esm/ui/quick-insert/getExtensionQuickInsertComponents.js +8 -5
  7. package/dist/esm/version-wrapper.js +1 -1
  8. package/package.json +43 -43
  9. package/dist/cjs/utils/performance/outlier.js +0 -16
  10. package/dist/cjs/utils/performance/percentile.js +0 -22
  11. package/dist/cjs/utils/performance/plugin-performance-observer.js +0 -131
  12. package/dist/cjs/utils/performance/plugin-performance-report.js +0 -190
  13. package/dist/cjs/utils/performance/simple-measure-to-entries.js +0 -101
  14. package/dist/es2019/utils/performance/outlier.js +0 -10
  15. package/dist/es2019/utils/performance/percentile.js +0 -14
  16. package/dist/es2019/utils/performance/plugin-performance-observer.js +0 -88
  17. package/dist/es2019/utils/performance/plugin-performance-report.js +0 -133
  18. package/dist/es2019/utils/performance/simple-measure-to-entries.js +0 -83
  19. package/dist/esm/utils/performance/outlier.js +0 -10
  20. package/dist/esm/utils/performance/percentile.js +0 -16
  21. package/dist/esm/utils/performance/plugin-performance-observer.js +0 -124
  22. package/dist/esm/utils/performance/plugin-performance-report.js +0 -183
  23. package/dist/esm/utils/performance/simple-measure-to-entries.js +0 -94
  24. package/dist/types/utils/performance/outlier.d.ts +0 -1
  25. package/dist/types/utils/performance/percentile.d.ts +0 -1
  26. package/dist/types/utils/performance/plugin-performance-observer.d.ts +0 -23
  27. package/dist/types/utils/performance/plugin-performance-report.d.ts +0 -47
  28. package/dist/types/utils/performance/simple-measure-to-entries.d.ts +0 -28
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # @atlaskit/editor-core
2
2
 
3
+ ## 235.0.0
4
+
5
+ ### Patch Changes
6
+
7
+ - [`7609e9d6f1431`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/7609e9d6f1431) -
8
+ Use Block templates item priorities as menu ranks under platform_editor_slash_command
9
+ - Updated dependencies
10
+
11
+ ## 234.3.2
12
+
13
+ ### Patch Changes
14
+
15
+ - [`be603fee7766f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/be603fee7766f) -
16
+ Remove unused internal performance analytics code (plugin performance report/observer and the
17
+ renderedSampled payload type)
18
+ - Updated dependencies
19
+
3
20
  ## 234.3.1
4
21
 
5
22
  ### Patch Changes
@@ -15,8 +15,6 @@ var _keys = require("@atlaskit/editor-common/quick-insert/keys");
15
15
  var _rank = require("@atlaskit/editor-common/quick-insert/rank");
16
16
  var _ExtensionQuickInsertMenuItem = require("./ExtensionQuickInsertMenuItem");
17
17
  var _QuickInsertSkillMenuItem = require("./QuickInsertSkillMenuItem");
18
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
19
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
20
18
  var structureExtensionItemKeyRanks = (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({
21
19
  'toc:toc': 600
22
20
  }, _keys.TABS_MENU_ITEM.key, 1900), 'cards:quick-insert', 2000), 'carousel:quick-insert', 2100), 'spotlight:quick-insert', 2200), 'create-from-template:create-from-template', 2700), 'anchor:anchor', 2900), 'smart-button:quick-insert', 3000);
@@ -78,6 +76,9 @@ var createExtensionItemRanker = function createExtensionItemRanker(items) {
78
76
  if (knownRank !== undefined) {
79
77
  return knownRank;
80
78
  }
79
+ if (sectionKey === _keys.BLOCK_TEMPLATES_SECTION.key && item.priority !== undefined) {
80
+ return item.priority;
81
+ }
81
82
  var sectionRank = (_ranksBySection$get = ranksBySection.get(sectionKey)) === null || _ranksBySection$get === void 0 ? void 0 : _ranksBySection$get.get(item);
82
83
  return sectionRank !== null && sectionRank !== void 0 ? sectionRank : _rank.EXTENSION_ITEM_RANK + ((_item$priority = item.priority) !== null && _item$priority !== void 0 ? _item$priority : index);
83
84
  };
@@ -102,14 +103,16 @@ var getExtensionQuickInsertComponents = exports.getExtensionQuickInsertComponent
102
103
  key: item.key,
103
104
  parents: parents.map(function (parent) {
104
105
  var _CREATE_SECTION_RANK$;
105
- return _objectSpread(_objectSpread({}, parent), {}, {
106
+ return {
107
+ key: parent.key,
108
+ type: parent.type,
106
109
  rank: getExtensionItemRank({
107
110
  index: index,
108
111
  knownRank: (_CREATE_SECTION_RANK$ = _rank.CREATE_SECTION_RANK[item.key]) !== null && _CREATE_SECTION_RANK$ !== void 0 ? _CREATE_SECTION_RANK$ : structureRank,
109
112
  item: item,
110
113
  sectionKey: parent.key
111
114
  })
112
- });
115
+ };
113
116
  }),
114
117
  match: (0, _createQuickInsertMatcher.createQuickInsertMatcher)(function () {
115
118
  return {
@@ -6,4 +6,4 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.version = exports.name = void 0;
7
7
  var name = exports.name = "@atlaskit/editor-core";
8
8
  // eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports
9
- var version = exports.version = "234.3.0";
9
+ var version = exports.version = "234.3.2";
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { createQuickInsertMatcher } from '@atlaskit/editor-common/quick-insert/create-quick-insert-matcher';
3
3
  import { getQuickInsertMenuItemParents } from '@atlaskit/editor-common/quick-insert/get-menu-item-parents';
4
- import { DATA_AND_CHARTS_SECTION, EMBED_SECTION, MEDIA_SECTION, OTHER_SECTION, STRUCTURE_SECTION, TABS_MENU_ITEM } from '@atlaskit/editor-common/quick-insert/keys';
4
+ import { BLOCK_TEMPLATES_SECTION, DATA_AND_CHARTS_SECTION, EMBED_SECTION, MEDIA_SECTION, OTHER_SECTION, STRUCTURE_SECTION, TABS_MENU_ITEM } from '@atlaskit/editor-common/quick-insert/keys';
5
5
  import { CREATE_SECTION_RANK, EXTENSION_ITEM_RANK, MEDIA_SECTION_RANK } from '@atlaskit/editor-common/quick-insert/rank';
6
6
  import { ExtensionQuickInsertMenuItem } from './ExtensionQuickInsertMenuItem';
7
7
  import { QuickInsertSkillMenuItem } from './QuickInsertSkillMenuItem';
@@ -45,6 +45,9 @@ const createExtensionItemRanker = items => {
45
45
  if (knownRank !== undefined) {
46
46
  return knownRank;
47
47
  }
48
+ if (sectionKey === BLOCK_TEMPLATES_SECTION.key && item.priority !== undefined) {
49
+ return item.priority;
50
+ }
48
51
  const sectionRank = (_ranksBySection$get = ranksBySection.get(sectionKey)) === null || _ranksBySection$get === void 0 ? void 0 : _ranksBySection$get.get(item);
49
52
  return sectionRank !== null && sectionRank !== void 0 ? sectionRank : EXTENSION_ITEM_RANK + ((_item$priority = item.priority) !== null && _item$priority !== void 0 ? _item$priority : index);
50
53
  };
@@ -71,7 +74,8 @@ export const getExtensionQuickInsertComponents = ({
71
74
  parents: parents.map(parent => {
72
75
  var _CREATE_SECTION_RANK$;
73
76
  return {
74
- ...parent,
77
+ key: parent.key,
78
+ type: parent.type,
75
79
  rank: getExtensionItemRank({
76
80
  index,
77
81
  knownRank: (_CREATE_SECTION_RANK$ = CREATE_SECTION_RANK[item.key]) !== null && _CREATE_SECTION_RANK$ !== void 0 ? _CREATE_SECTION_RANK$ : structureRank,
@@ -1,3 +1,3 @@
1
1
  export const name = "@atlaskit/editor-core";
2
2
  // eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports
3
- export const version = "234.3.0";
3
+ export const version = "234.3.2";
@@ -1,12 +1,10 @@
1
1
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
2
  import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
3
3
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
4
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
5
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
6
4
  import React from 'react';
7
5
  import { createQuickInsertMatcher } from '@atlaskit/editor-common/quick-insert/create-quick-insert-matcher';
8
6
  import { getQuickInsertMenuItemParents } from '@atlaskit/editor-common/quick-insert/get-menu-item-parents';
9
- import { DATA_AND_CHARTS_SECTION, EMBED_SECTION, MEDIA_SECTION, OTHER_SECTION, STRUCTURE_SECTION, TABS_MENU_ITEM } from '@atlaskit/editor-common/quick-insert/keys';
7
+ import { BLOCK_TEMPLATES_SECTION, DATA_AND_CHARTS_SECTION, EMBED_SECTION, MEDIA_SECTION, OTHER_SECTION, STRUCTURE_SECTION, TABS_MENU_ITEM } from '@atlaskit/editor-common/quick-insert/keys';
10
8
  import { CREATE_SECTION_RANK, EXTENSION_ITEM_RANK, MEDIA_SECTION_RANK } from '@atlaskit/editor-common/quick-insert/rank';
11
9
  import { ExtensionQuickInsertMenuItem } from './ExtensionQuickInsertMenuItem';
12
10
  import { QuickInsertSkillMenuItem } from './QuickInsertSkillMenuItem';
@@ -71,6 +69,9 @@ var createExtensionItemRanker = function createExtensionItemRanker(items) {
71
69
  if (knownRank !== undefined) {
72
70
  return knownRank;
73
71
  }
72
+ if (sectionKey === BLOCK_TEMPLATES_SECTION.key && item.priority !== undefined) {
73
+ return item.priority;
74
+ }
74
75
  var sectionRank = (_ranksBySection$get = ranksBySection.get(sectionKey)) === null || _ranksBySection$get === void 0 ? void 0 : _ranksBySection$get.get(item);
75
76
  return sectionRank !== null && sectionRank !== void 0 ? sectionRank : EXTENSION_ITEM_RANK + ((_item$priority = item.priority) !== null && _item$priority !== void 0 ? _item$priority : index);
76
77
  };
@@ -95,14 +96,16 @@ export var getExtensionQuickInsertComponents = function getExtensionQuickInsertC
95
96
  key: item.key,
96
97
  parents: parents.map(function (parent) {
97
98
  var _CREATE_SECTION_RANK$;
98
- return _objectSpread(_objectSpread({}, parent), {}, {
99
+ return {
100
+ key: parent.key,
101
+ type: parent.type,
99
102
  rank: getExtensionItemRank({
100
103
  index: index,
101
104
  knownRank: (_CREATE_SECTION_RANK$ = CREATE_SECTION_RANK[item.key]) !== null && _CREATE_SECTION_RANK$ !== void 0 ? _CREATE_SECTION_RANK$ : structureRank,
102
105
  item: item,
103
106
  sectionKey: parent.key
104
107
  })
105
- });
108
+ };
106
109
  }),
107
110
  match: createQuickInsertMatcher(function () {
108
111
  return {
@@ -1,3 +1,3 @@
1
1
  export var name = "@atlaskit/editor-core";
2
2
  // eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports
3
- export var version = "234.3.0";
3
+ export var version = "234.3.2";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "234.3.1",
3
+ "version": "235.0.0",
4
4
  "description": "A package contains Atlassian editor core functionality",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -41,7 +41,7 @@
41
41
  },
42
42
  "dependencies": {
43
43
  "@atlaskit/activity-provider": "^3.1.0",
44
- "@atlaskit/adf-schema": "^57.6.0",
44
+ "@atlaskit/adf-schema": "^57.7.0",
45
45
  "@atlaskit/afm-i18n-platform-editor-editor-core": "2.270.0",
46
46
  "@atlaskit/analytics-namespaced-context": "^8.2.0",
47
47
  "@atlaskit/analytics-next": "^12.5.0",
@@ -50,15 +50,15 @@
50
50
  "@atlaskit/button": "^25.4.0",
51
51
  "@atlaskit/css": "^1.1.0",
52
52
  "@atlaskit/editor-json-transformer": "^10.0.0",
53
- "@atlaskit/editor-plugin-block-menu": "^23.0.0",
54
- "@atlaskit/editor-plugin-connectivity": "^24.0.0",
55
- "@atlaskit/editor-plugin-quick-insert": "^24.0.0",
56
- "@atlaskit/editor-plugin-selection-extension": "^27.0.0",
57
- "@atlaskit/editor-plugin-user-preferences": "^22.0.0",
58
- "@atlaskit/editor-plugins": "^16.1.0",
53
+ "@atlaskit/editor-plugin-block-menu": "^24.0.0",
54
+ "@atlaskit/editor-plugin-connectivity": "^25.0.0",
55
+ "@atlaskit/editor-plugin-quick-insert": "^25.0.0",
56
+ "@atlaskit/editor-plugin-selection-extension": "^28.0.0",
57
+ "@atlaskit/editor-plugin-user-preferences": "^23.0.0",
58
+ "@atlaskit/editor-plugins": "^16.2.0",
59
59
  "@atlaskit/editor-prosemirror": "^9.0.0",
60
60
  "@atlaskit/editor-shared-styles": "^4.3.0",
61
- "@atlaskit/editor-ssr-renderer": "^19.0.0",
61
+ "@atlaskit/editor-ssr-renderer": "^20.0.0",
62
62
  "@atlaskit/editor-toolbar": "^2.8.0",
63
63
  "@atlaskit/editor-toolbar-model": "^1.2.0",
64
64
  "@atlaskit/emoji": "^72.5.0",
@@ -75,7 +75,7 @@
75
75
  "@atlaskit/popup": "^9.0.0",
76
76
  "@atlaskit/primitives": "^22.5.0",
77
77
  "@atlaskit/react-compiler-gating": "^0.2.0",
78
- "@atlaskit/react-ufo": "^8.0.0",
78
+ "@atlaskit/react-ufo": "^8.1.0",
79
79
  "@atlaskit/task-decision": "^21.12.0",
80
80
  "@atlaskit/tmp-editor-statsig": "^224.0.0",
81
81
  "@atlaskit/tokens": "^20.3.0",
@@ -96,7 +96,7 @@
96
96
  "uuid": "^11.1.1"
97
97
  },
98
98
  "peerDependencies": {
99
- "@atlaskit/editor-common": "^128.3.0",
99
+ "@atlaskit/editor-common": "^129.0.0",
100
100
  "@atlaskit/link-provider": "^6.0.0",
101
101
  "@atlaskit/media-core": "^39.0.0",
102
102
  "react": "^18.2.0 || ^19.2.0",
@@ -112,37 +112,37 @@
112
112
  "@atlaskit/analytics-gas-types": "^6.2.0",
113
113
  "@atlaskit/analytics-listeners": "^11.4.0",
114
114
  "@atlaskit/code": "^20.0.0",
115
- "@atlaskit/collab-provider": "^33.0.0",
115
+ "@atlaskit/collab-provider": "^34.0.0",
116
116
  "@atlaskit/docs": "^12.3.0",
117
117
  "@atlaskit/drawer": "^14.3.0",
118
- "@atlaskit/editor-plugin-alignment": "^25.0.0",
119
- "@atlaskit/editor-plugin-annotation": "^24.0.0",
120
- "@atlaskit/editor-plugin-base": "^25.1.0",
121
- "@atlaskit/editor-plugin-card": "^30.0.0",
122
- "@atlaskit/editor-plugin-code-block-advanced": "^24.0.0",
123
- "@atlaskit/editor-plugin-collab-edit": "^25.0.0",
124
- "@atlaskit/editor-plugin-content-insertion": "^24.0.0",
125
- "@atlaskit/editor-plugin-editor-viewmode": "^26.0.0",
126
- "@atlaskit/editor-plugin-extension": "^27.0.0",
127
- "@atlaskit/editor-plugin-grid": "^24.0.0",
128
- "@atlaskit/editor-plugin-guideline": "^24.0.0",
129
- "@atlaskit/editor-plugin-highlight": "^24.0.0",
130
- "@atlaskit/editor-plugin-insert-block": "^25.0.0",
131
- "@atlaskit/editor-plugin-layout": "^25.1.0",
132
- "@atlaskit/editor-plugin-limited-mode": "^21.0.0",
133
- "@atlaskit/editor-plugin-list": "^26.0.0",
134
- "@atlaskit/editor-plugin-media": "^26.0.0",
135
- "@atlaskit/editor-plugin-paste": "^25.0.0",
136
- "@atlaskit/editor-plugin-selection-marker": "^24.0.0",
137
- "@atlaskit/editor-plugin-show-diff": "^22.0.0",
138
- "@atlaskit/editor-plugin-synced-block": "^22.0.0",
139
- "@atlaskit/editor-plugin-table": "^36.0.0",
140
- "@atlaskit/editor-plugin-tasks-and-decisions": "^27.0.0",
141
- "@atlaskit/editor-plugin-text-color": "^24.0.0",
142
- "@atlaskit/editor-plugin-toolbar-lists-indentation": "^25.0.0",
143
- "@atlaskit/editor-plugin-track-changes": "^23.0.0",
144
- "@atlaskit/editor-synced-block-provider": "^20.0.0",
145
- "@atlaskit/editor-synced-block-renderer": "^22.0.0",
118
+ "@atlaskit/editor-plugin-alignment": "^26.0.0",
119
+ "@atlaskit/editor-plugin-annotation": "^25.0.0",
120
+ "@atlaskit/editor-plugin-base": "^26.0.0",
121
+ "@atlaskit/editor-plugin-card": "^31.0.0",
122
+ "@atlaskit/editor-plugin-code-block-advanced": "^25.0.0",
123
+ "@atlaskit/editor-plugin-collab-edit": "^26.0.0",
124
+ "@atlaskit/editor-plugin-content-insertion": "^25.0.0",
125
+ "@atlaskit/editor-plugin-editor-viewmode": "^27.0.0",
126
+ "@atlaskit/editor-plugin-extension": "^28.0.0",
127
+ "@atlaskit/editor-plugin-grid": "^25.0.0",
128
+ "@atlaskit/editor-plugin-guideline": "^25.0.0",
129
+ "@atlaskit/editor-plugin-highlight": "^25.0.0",
130
+ "@atlaskit/editor-plugin-insert-block": "^26.0.0",
131
+ "@atlaskit/editor-plugin-layout": "^26.0.0",
132
+ "@atlaskit/editor-plugin-limited-mode": "^22.0.0",
133
+ "@atlaskit/editor-plugin-list": "^27.0.0",
134
+ "@atlaskit/editor-plugin-media": "^27.0.0",
135
+ "@atlaskit/editor-plugin-paste": "^26.0.0",
136
+ "@atlaskit/editor-plugin-selection-marker": "^25.0.0",
137
+ "@atlaskit/editor-plugin-show-diff": "^23.0.0",
138
+ "@atlaskit/editor-plugin-synced-block": "^23.0.0",
139
+ "@atlaskit/editor-plugin-table": "^37.0.0",
140
+ "@atlaskit/editor-plugin-tasks-and-decisions": "^28.0.0",
141
+ "@atlaskit/editor-plugin-text-color": "^25.0.0",
142
+ "@atlaskit/editor-plugin-toolbar-lists-indentation": "^26.0.0",
143
+ "@atlaskit/editor-plugin-track-changes": "^24.0.0",
144
+ "@atlaskit/editor-synced-block-provider": "^21.0.0",
145
+ "@atlaskit/editor-synced-block-renderer": "^23.0.0",
146
146
  "@atlaskit/editor-test-helpers": "workspace:^",
147
147
  "@atlaskit/form": "^18.1.0",
148
148
  "@atlaskit/link-provider": "^6.0.0",
@@ -159,7 +159,7 @@
159
159
  "@atlaskit/portal": "^7.0.0",
160
160
  "@atlaskit/profilecard": "^27.1.0",
161
161
  "@atlaskit/radio": "^10.2.0",
162
- "@atlaskit/renderer": "^147.1.0",
162
+ "@atlaskit/renderer": "^148.0.0",
163
163
  "@atlaskit/section-message": "^10.2.0",
164
164
  "@atlaskit/spinner": "^20.4.0",
165
165
  "@atlaskit/synchrony-test-helpers": "workspace:^",
@@ -170,11 +170,11 @@
170
170
  "@atlassian/a11y-jest-testing": "^0.17.0",
171
171
  "@atlassian/a11y-playwright-testing": "^0.13.0",
172
172
  "@atlassian/adf-schema-json": "^1.35.0",
173
- "@atlassian/editor-rovo-bridge": "^23.0.0",
173
+ "@atlassian/editor-rovo-bridge": "^24.0.0",
174
174
  "@atlassian/experiment-test-utils": "^0.2.0",
175
175
  "@atlassian/feature-flags-test-utils": "^1.3.0",
176
176
  "@atlassian/search-client": "^3.7.0",
177
- "@atlassian/search-provider": "^25.0.0",
177
+ "@atlassian/search-provider": "^26.0.0",
178
178
  "@atlassian/structured-docs-types": "workspace:^",
179
179
  "@atlassian/testing-library": "^0.11.0",
180
180
  "@atlassian/user-profile-card": "^1.43.0",
@@ -1,16 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.outlier = void 0;
7
- var _percentile = require("./percentile");
8
- var outlier = exports.outlier = function outlier(input, factor) {
9
- var q1 = (0, _percentile.percentile)(input, 0.25);
10
- var q3 = (0, _percentile.percentile)(input, 0.75);
11
- if (typeof q1 === 'undefined' || typeof q3 === 'undefined') {
12
- return;
13
- }
14
- var iqr = q3 - q1;
15
- return q3 + iqr * factor;
16
- };
@@ -1,22 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.percentile = void 0;
7
- var percentile = exports.percentile = function percentile(input, fraction) {
8
- var sorted = input.sort(function (a, b) {
9
- return a - b;
10
- });
11
- var position = sorted.length * fraction;
12
- var base = Math.floor(position);
13
- var rest = position - base;
14
- if (rest > 0) {
15
- return sorted[base];
16
- }
17
- var item = sorted[base - 1];
18
- var next = sorted[base];
19
- if (typeof item !== 'undefined' && typeof next !== 'undefined') {
20
- return (item + next) / 2;
21
- }
22
- };
@@ -1,131 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.PluginPerformanceObserver = void 0;
8
- var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
9
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
10
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
11
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
12
- var _pluginPerformanceReport = require("./plugin-performance-report");
13
- var _simpleMeasureToEntries = require("./simple-measure-to-entries");
14
- var _trackTransactions = require("./track-transactions");
15
- var PluginPerformanceObserver = exports.PluginPerformanceObserver = /*#__PURE__*/function () {
16
- function PluginPerformanceObserver(callback) {
17
- var _this = this;
18
- (0, _classCallCheck2.default)(this, PluginPerformanceObserver);
19
- (0, _defineProperty2.default)(this, "getNodeCounts", function () {
20
- return [{
21
- nodeCount: {},
22
- extensionNodeCount: {}
23
- }, 0];
24
- });
25
- (0, _defineProperty2.default)(this, "getPlugins", function () {
26
- return [];
27
- });
28
- (0, _defineProperty2.default)(this, "getOptions", function () {
29
- return {};
30
- });
31
- (0, _defineProperty2.default)(this, "reportCount", 0);
32
- (0, _defineProperty2.default)(this, "simpleObserver", new _simpleMeasureToEntries.SimpleMeasurementLogger());
33
- (0, _defineProperty2.default)(this, "onObserveration", function (entries) {
34
- var reports = entries.getEntriesByName(_trackTransactions.EVENT_NAME_DISPATCH_TRANSACTION).map(function (entry) {
35
- var _PluginPerformanceRep;
36
- return (_PluginPerformanceRep = _pluginPerformanceReport.PluginPerformanceReport.fromEntry(entry).withCount(++_this.reportCount).withEntryList(entries)).withNodes.apply(_PluginPerformanceRep, (0, _toConsumableArray2.default)(_this.getNodeCounts())).withPlugins(_this.getPlugins()).withOptions(_this.getOptions()).toJSON();
37
- });
38
- reports.filter(function (report) {
39
- return report.trigger !== 'none';
40
- }).forEach(function (report) {
41
- return _this.callback(report);
42
- });
43
- });
44
- this.callback = callback;
45
- this.observer = window.PerformanceObserver ? new PerformanceObserver(this.onObserveration) : {
46
- observe: function observe() {},
47
- disconnect: function disconnect() {},
48
- takeRecords: function takeRecords() {
49
- return [];
50
- }
51
- };
52
- }
53
- return (0, _createClass2.default)(PluginPerformanceObserver, [{
54
- key: "isSimpleTracking",
55
- get: function get() {
56
- var _this$getOptions = this.getOptions(),
57
- _this$getOptions$useP = _this$getOptions.usePerformanceMarks,
58
- usePerformanceMarks = _this$getOptions$useP === void 0 ? _trackTransactions.DEFAULT_USE_PERFORMANCE_MARK : _this$getOptions$useP;
59
- return !usePerformanceMarks;
60
- }
61
- }, {
62
- key: "withNodeCounts",
63
- value: function withNodeCounts(getNodeCounts) {
64
- this.getNodeCounts = function () {
65
- var start = performance.now();
66
- var result = getNodeCounts();
67
- return [result, performance.now() - start];
68
- };
69
- return this;
70
- }
71
- }, {
72
- key: "withPlugins",
73
- value: function withPlugins(getPlugins) {
74
- this.getPlugins = getPlugins;
75
- return this;
76
- }
77
- }, {
78
- key: "withOptions",
79
- value: function withOptions(getOptions) {
80
- this.getOptions = getOptions;
81
- return this;
82
- }
83
- }, {
84
- key: "withTransactionTracker",
85
- value: function withTransactionTracker(getTransactionTracker) {
86
- this.getTransactionTracker = getTransactionTracker;
87
- return this;
88
- }
89
- }, {
90
- key: "observe",
91
- value: function observe() {
92
- var _this2 = this;
93
- if (this.isSimpleTracking) {
94
- this.simpleObserver.setPluginNames(this.getPlugins());
95
- this.simpleObserver.setOnObservation(function (entries) {
96
- _this2.onObserveration(entries, _this2.observer);
97
- });
98
-
99
- // can trigger a callback when stopMeasure() measures something.
100
- // use that to trigger this.onObservation()
101
- this.getTransactionTracker && this.getTransactionTracker().addMeasureListener(this.simpleObserver.observed);
102
- } else {
103
- try {
104
- this.observer.observe({
105
- buffered: false,
106
- type: 'measure'
107
- });
108
- } catch (err) {
109
- // Older API implementations do not support the simpler type init
110
- this.observer.observe({
111
- entryTypes: ['measure']
112
- });
113
- }
114
- }
115
- }
116
- }, {
117
- key: "disconnect",
118
- value: function disconnect() {
119
- if (this.isSimpleTracking) {
120
- this.getTransactionTracker && this.getTransactionTracker().removeMeasureListener(this.simpleObserver.observed);
121
- } else {
122
- this.observer.disconnect();
123
- }
124
- }
125
- }, {
126
- key: "takeRecords",
127
- value: function takeRecords() {
128
- return this.observer.takeRecords();
129
- }
130
- }]);
131
- }();