@atlaskit/renderer 124.4.1 → 124.4.2
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/CHANGELOG.md +11 -0
- package/dist/cjs/ui/Renderer/analytics-utils.js +19 -1
- package/dist/cjs/ui/Renderer/index.js +5 -2
- package/dist/es2019/ui/Renderer/analytics-utils.js +13 -1
- package/dist/es2019/ui/Renderer/index.js +5 -2
- package/dist/esm/ui/Renderer/analytics-utils.js +18 -1
- package/dist/esm/ui/Renderer/index.js +5 -2
- package/dist/types/analytics/events.d.ts +5 -0
- package/dist/types/ui/Renderer/analytics-utils.d.ts +1 -1
- package/dist/types-ts4.5/analytics/events.d.ts +5 -0
- package/dist/types-ts4.5/ui/Renderer/analytics-utils.d.ts +1 -1
- package/package.json +2 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# @atlaskit/renderer
|
|
2
2
|
|
|
3
|
+
## 124.4.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`71cac2e4cf915`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/71cac2e4cf915) -
|
|
8
|
+
[FF-CLEANUP] platform_editor_add_border_for_nested_panel
|
|
9
|
+
- [`c0ef0bedb49c0`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c0ef0bedb49c0) -
|
|
10
|
+
EDITOR-1391 only send table width information events if there are tables, add enums and boolean
|
|
11
|
+
values for table width, editor width and scrollbar existence for ingestion in signalfx
|
|
12
|
+
- Updated dependencies
|
|
13
|
+
|
|
3
14
|
## 124.4.1
|
|
4
15
|
|
|
5
16
|
### Patch Changes
|
|
@@ -1,13 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
7
|
exports.getWidthInfoPayload = void 0;
|
|
8
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
7
9
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
10
|
+
var _analytics2 = require("@atlaskit/editor-common/utils/analytics");
|
|
8
11
|
var getWidthInfoPayload = exports.getWidthInfoPayload = function getWidthInfoPayload(renderer) {
|
|
9
12
|
var tablesInfo = [];
|
|
10
13
|
var tableWrappers = renderer.querySelectorAll('.pm-table-wrapper');
|
|
14
|
+
|
|
15
|
+
// only send the event if there are tables on the page
|
|
16
|
+
if (tableWrappers.length === 0) {
|
|
17
|
+
return undefined;
|
|
18
|
+
}
|
|
11
19
|
tableWrappers.forEach(function (tableWrapper) {
|
|
12
20
|
var table = tableWrapper.querySelector(':scope > table');
|
|
13
21
|
if (table) {
|
|
@@ -19,12 +27,22 @@ var getWidthInfoPayload = exports.getWidthInfoPayload = function getWidthInfoPay
|
|
|
19
27
|
});
|
|
20
28
|
}
|
|
21
29
|
});
|
|
30
|
+
var maxTableWidth = Math.max.apply(Math, (0, _toConsumableArray2.default)(tablesInfo.map(function (table) {
|
|
31
|
+
return table.tableWidth;
|
|
32
|
+
})));
|
|
33
|
+
var editorWidth = renderer.scrollWidth;
|
|
22
34
|
return {
|
|
23
35
|
action: _analytics.TABLE_ACTION.TABLE_WIDTH_INFO,
|
|
24
36
|
actionSubject: _analytics.ACTION_SUBJECT.TABLE,
|
|
25
37
|
attributes: {
|
|
26
|
-
editorWidth:
|
|
38
|
+
editorWidth: editorWidth,
|
|
39
|
+
editorWidthBreakpoint: (0, _analytics2.getBreakpointKey)(editorWidth),
|
|
27
40
|
tableWidthInfo: tablesInfo,
|
|
41
|
+
maxTableWidthBreakpoint: (0, _analytics2.getBreakpointKey)(maxTableWidth),
|
|
42
|
+
hasTableWiderThanEditor: maxTableWidth > editorWidth,
|
|
43
|
+
hasTableWithScrollbar: tablesInfo.some(function (table) {
|
|
44
|
+
return table.hasScrollbar;
|
|
45
|
+
}),
|
|
28
46
|
mode: _analytics.MODE.RENDERER
|
|
29
47
|
},
|
|
30
48
|
eventType: _analytics.EVENT_TYPE.OPERATIONAL
|
|
@@ -68,7 +68,7 @@ var DEGRADED_SEVERITY_THRESHOLD = exports.DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
|
68
68
|
// we want to calculate all the table widths (which causes reflows) after the renderer has finished loading to mitigate performance impact
|
|
69
69
|
var TABLE_WIDTH_INFO_TIMEOUT = 10000;
|
|
70
70
|
var packageName = "@atlaskit/renderer";
|
|
71
|
-
var packageVersion = "124.4.
|
|
71
|
+
var packageVersion = "124.4.1";
|
|
72
72
|
var setAsQueryContainerStyles = (0, _react2.css)({
|
|
73
73
|
containerName: 'ak-renderer-wrapper',
|
|
74
74
|
containerType: 'inline-size'
|
|
@@ -369,7 +369,10 @@ var RendererFunctionalComponent = exports.RendererFunctionalComponent = function
|
|
|
369
369
|
var _props$innerRef;
|
|
370
370
|
var renderer = (_props$innerRef = props.innerRef) === null || _props$innerRef === void 0 || (_props$innerRef = _props$innerRef.current) === null || _props$innerRef === void 0 ? void 0 : _props$innerRef.querySelector('.ak-renderer-document');
|
|
371
371
|
if (renderer) {
|
|
372
|
-
|
|
372
|
+
var payload = (0, _analyticsUtils.getWidthInfoPayload)(renderer);
|
|
373
|
+
if (payload) {
|
|
374
|
+
_fireAnalyticsEvent(payload);
|
|
375
|
+
}
|
|
373
376
|
}
|
|
374
377
|
};
|
|
375
378
|
if (window && typeof window.requestIdleCallback === 'function') {
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import { TABLE_ACTION, ACTION_SUBJECT, EVENT_TYPE, MODE } from '@atlaskit/editor-common/analytics';
|
|
2
|
+
import { getBreakpointKey } from '@atlaskit/editor-common/utils/analytics';
|
|
2
3
|
export const getWidthInfoPayload = renderer => {
|
|
3
4
|
const tablesInfo = [];
|
|
4
5
|
const tableWrappers = renderer.querySelectorAll('.pm-table-wrapper');
|
|
6
|
+
|
|
7
|
+
// only send the event if there are tables on the page
|
|
8
|
+
if (tableWrappers.length === 0) {
|
|
9
|
+
return undefined;
|
|
10
|
+
}
|
|
5
11
|
tableWrappers.forEach(tableWrapper => {
|
|
6
12
|
const table = tableWrapper.querySelector(':scope > table');
|
|
7
13
|
if (table) {
|
|
@@ -13,12 +19,18 @@ export const getWidthInfoPayload = renderer => {
|
|
|
13
19
|
});
|
|
14
20
|
}
|
|
15
21
|
});
|
|
22
|
+
const maxTableWidth = Math.max(...tablesInfo.map(table => table.tableWidth));
|
|
23
|
+
const editorWidth = renderer.scrollWidth;
|
|
16
24
|
return {
|
|
17
25
|
action: TABLE_ACTION.TABLE_WIDTH_INFO,
|
|
18
26
|
actionSubject: ACTION_SUBJECT.TABLE,
|
|
19
27
|
attributes: {
|
|
20
|
-
editorWidth
|
|
28
|
+
editorWidth,
|
|
29
|
+
editorWidthBreakpoint: getBreakpointKey(editorWidth),
|
|
21
30
|
tableWidthInfo: tablesInfo,
|
|
31
|
+
maxTableWidthBreakpoint: getBreakpointKey(maxTableWidth),
|
|
32
|
+
hasTableWiderThanEditor: maxTableWidth > editorWidth,
|
|
33
|
+
hasTableWithScrollbar: tablesInfo.some(table => table.hasScrollbar),
|
|
22
34
|
mode: MODE.RENDERER
|
|
23
35
|
},
|
|
24
36
|
eventType: EVENT_TYPE.OPERATIONAL
|
|
@@ -54,7 +54,7 @@ export const DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
|
54
54
|
// we want to calculate all the table widths (which causes reflows) after the renderer has finished loading to mitigate performance impact
|
|
55
55
|
const TABLE_WIDTH_INFO_TIMEOUT = 10000;
|
|
56
56
|
const packageName = "@atlaskit/renderer";
|
|
57
|
-
const packageVersion = "124.4.
|
|
57
|
+
const packageVersion = "124.4.1";
|
|
58
58
|
const setAsQueryContainerStyles = css({
|
|
59
59
|
containerName: 'ak-renderer-wrapper',
|
|
60
60
|
containerType: 'inline-size'
|
|
@@ -359,7 +359,10 @@ export const RendererFunctionalComponent = props => {
|
|
|
359
359
|
var _props$innerRef, _props$innerRef$curre;
|
|
360
360
|
const renderer = (_props$innerRef = props.innerRef) === null || _props$innerRef === void 0 ? void 0 : (_props$innerRef$curre = _props$innerRef.current) === null || _props$innerRef$curre === void 0 ? void 0 : _props$innerRef$curre.querySelector('.ak-renderer-document');
|
|
361
361
|
if (renderer) {
|
|
362
|
-
|
|
362
|
+
const payload = getWidthInfoPayload(renderer);
|
|
363
|
+
if (payload) {
|
|
364
|
+
fireAnalyticsEvent(payload);
|
|
365
|
+
}
|
|
363
366
|
}
|
|
364
367
|
};
|
|
365
368
|
if (window && typeof window.requestIdleCallback === 'function') {
|
|
@@ -1,7 +1,14 @@
|
|
|
1
|
+
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
1
2
|
import { TABLE_ACTION, ACTION_SUBJECT, EVENT_TYPE, MODE } from '@atlaskit/editor-common/analytics';
|
|
3
|
+
import { getBreakpointKey } from '@atlaskit/editor-common/utils/analytics';
|
|
2
4
|
export var getWidthInfoPayload = function getWidthInfoPayload(renderer) {
|
|
3
5
|
var tablesInfo = [];
|
|
4
6
|
var tableWrappers = renderer.querySelectorAll('.pm-table-wrapper');
|
|
7
|
+
|
|
8
|
+
// only send the event if there are tables on the page
|
|
9
|
+
if (tableWrappers.length === 0) {
|
|
10
|
+
return undefined;
|
|
11
|
+
}
|
|
5
12
|
tableWrappers.forEach(function (tableWrapper) {
|
|
6
13
|
var table = tableWrapper.querySelector(':scope > table');
|
|
7
14
|
if (table) {
|
|
@@ -13,12 +20,22 @@ export var getWidthInfoPayload = function getWidthInfoPayload(renderer) {
|
|
|
13
20
|
});
|
|
14
21
|
}
|
|
15
22
|
});
|
|
23
|
+
var maxTableWidth = Math.max.apply(Math, _toConsumableArray(tablesInfo.map(function (table) {
|
|
24
|
+
return table.tableWidth;
|
|
25
|
+
})));
|
|
26
|
+
var editorWidth = renderer.scrollWidth;
|
|
16
27
|
return {
|
|
17
28
|
action: TABLE_ACTION.TABLE_WIDTH_INFO,
|
|
18
29
|
actionSubject: ACTION_SUBJECT.TABLE,
|
|
19
30
|
attributes: {
|
|
20
|
-
editorWidth:
|
|
31
|
+
editorWidth: editorWidth,
|
|
32
|
+
editorWidthBreakpoint: getBreakpointKey(editorWidth),
|
|
21
33
|
tableWidthInfo: tablesInfo,
|
|
34
|
+
maxTableWidthBreakpoint: getBreakpointKey(maxTableWidth),
|
|
35
|
+
hasTableWiderThanEditor: maxTableWidth > editorWidth,
|
|
36
|
+
hasTableWithScrollbar: tablesInfo.some(function (table) {
|
|
37
|
+
return table.hasScrollbar;
|
|
38
|
+
}),
|
|
22
39
|
mode: MODE.RENDERER
|
|
23
40
|
},
|
|
24
41
|
eventType: EVENT_TYPE.OPERATIONAL
|
|
@@ -59,7 +59,7 @@ export var DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
|
59
59
|
// we want to calculate all the table widths (which causes reflows) after the renderer has finished loading to mitigate performance impact
|
|
60
60
|
var TABLE_WIDTH_INFO_TIMEOUT = 10000;
|
|
61
61
|
var packageName = "@atlaskit/renderer";
|
|
62
|
-
var packageVersion = "124.4.
|
|
62
|
+
var packageVersion = "124.4.1";
|
|
63
63
|
var setAsQueryContainerStyles = css({
|
|
64
64
|
containerName: 'ak-renderer-wrapper',
|
|
65
65
|
containerType: 'inline-size'
|
|
@@ -360,7 +360,10 @@ export var RendererFunctionalComponent = function RendererFunctionalComponent(pr
|
|
|
360
360
|
var _props$innerRef;
|
|
361
361
|
var renderer = (_props$innerRef = props.innerRef) === null || _props$innerRef === void 0 || (_props$innerRef = _props$innerRef.current) === null || _props$innerRef === void 0 ? void 0 : _props$innerRef.querySelector('.ak-renderer-document');
|
|
362
362
|
if (renderer) {
|
|
363
|
-
|
|
363
|
+
var payload = getWidthInfoPayload(renderer);
|
|
364
|
+
if (payload) {
|
|
365
|
+
_fireAnalyticsEvent(payload);
|
|
366
|
+
}
|
|
364
367
|
}
|
|
365
368
|
};
|
|
366
369
|
if (window && typeof window.requestIdleCallback === 'function') {
|
|
@@ -2,6 +2,7 @@ import type { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, Operational
|
|
|
2
2
|
import type { AEP } from './enums';
|
|
3
3
|
import type { SortOrder } from '@atlaskit/editor-common/types';
|
|
4
4
|
import type { SEVERITY, UNSUPPORTED_CONTENT_LEVEL_SEVERITY, UnsupportedContentPayload, UnsupportedContentTooltipPayload } from '@atlaskit/editor-common/utils';
|
|
5
|
+
import type { EditorBreakpointKey } from '@atlaskit/editor-common/utils/analytics';
|
|
5
6
|
export declare enum PLATFORM {
|
|
6
7
|
NATIVE = "mobileNative",
|
|
7
8
|
HYBRID = "mobileHybrid",
|
|
@@ -84,6 +85,10 @@ type TableSortColumnAEP = AEP<ACTION.SORT_COLUMN, ACTION_SUBJECT.TABLE, undefine
|
|
|
84
85
|
}, EVENT_TYPE.TRACK>;
|
|
85
86
|
type TableWidthInfoAEP = AEP<TABLE_ACTION.TABLE_WIDTH_INFO, ACTION_SUBJECT.TABLE, undefined, {
|
|
86
87
|
editorWidth: number;
|
|
88
|
+
editorWidthBreakpoint: EditorBreakpointKey;
|
|
89
|
+
hasTableWiderThanEditor: boolean;
|
|
90
|
+
hasTableWithScrollbar: boolean;
|
|
91
|
+
maxTableWidthBreakpoint: EditorBreakpointKey;
|
|
87
92
|
mode: MODE.RENDERER;
|
|
88
93
|
tableWidthInfo: Array<{
|
|
89
94
|
hasScrollbar: boolean;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { AnalyticsEventPayload } from '../../analytics/events';
|
|
2
|
-
export declare const getWidthInfoPayload: (renderer: HTMLElement) => AnalyticsEventPayload;
|
|
2
|
+
export declare const getWidthInfoPayload: (renderer: HTMLElement) => AnalyticsEventPayload | undefined;
|
|
@@ -2,6 +2,7 @@ import type { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, Operational
|
|
|
2
2
|
import type { AEP } from './enums';
|
|
3
3
|
import type { SortOrder } from '@atlaskit/editor-common/types';
|
|
4
4
|
import type { SEVERITY, UNSUPPORTED_CONTENT_LEVEL_SEVERITY, UnsupportedContentPayload, UnsupportedContentTooltipPayload } from '@atlaskit/editor-common/utils';
|
|
5
|
+
import type { EditorBreakpointKey } from '@atlaskit/editor-common/utils/analytics';
|
|
5
6
|
export declare enum PLATFORM {
|
|
6
7
|
NATIVE = "mobileNative",
|
|
7
8
|
HYBRID = "mobileHybrid",
|
|
@@ -84,6 +85,10 @@ type TableSortColumnAEP = AEP<ACTION.SORT_COLUMN, ACTION_SUBJECT.TABLE, undefine
|
|
|
84
85
|
}, EVENT_TYPE.TRACK>;
|
|
85
86
|
type TableWidthInfoAEP = AEP<TABLE_ACTION.TABLE_WIDTH_INFO, ACTION_SUBJECT.TABLE, undefined, {
|
|
86
87
|
editorWidth: number;
|
|
88
|
+
editorWidthBreakpoint: EditorBreakpointKey;
|
|
89
|
+
hasTableWiderThanEditor: boolean;
|
|
90
|
+
hasTableWithScrollbar: boolean;
|
|
91
|
+
maxTableWidthBreakpoint: EditorBreakpointKey;
|
|
87
92
|
mode: MODE.RENDERER;
|
|
88
93
|
tableWidthInfo: Array<{
|
|
89
94
|
hasScrollbar: boolean;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { AnalyticsEventPayload } from '../../analytics/events';
|
|
2
|
-
export declare const getWidthInfoPayload: (renderer: HTMLElement) => AnalyticsEventPayload;
|
|
2
|
+
export declare const getWidthInfoPayload: (renderer: HTMLElement) => AnalyticsEventPayload | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/renderer",
|
|
3
|
-
"version": "124.4.
|
|
3
|
+
"version": "124.4.2",
|
|
4
4
|
"description": "Renderer component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
"@atlaskit/mention": "^24.3.0",
|
|
93
93
|
"@atlaskit/modal-dialog": "^14.5.0",
|
|
94
94
|
"@atlaskit/navigation-next": "patch:@atlaskit/navigation-next@npm%3A9.0.17#~/.yarn/patches/@atlaskit-navigation-next-npm-9.0.17-958ca0ab9d.patch",
|
|
95
|
-
"@atlaskit/profilecard": "^24.
|
|
95
|
+
"@atlaskit/profilecard": "^24.19.0",
|
|
96
96
|
"@atlaskit/util-data-test": "^18.3.0",
|
|
97
97
|
"@atlassian/feature-flags-test-utils": "^0.3.0",
|
|
98
98
|
"@testing-library/react": "^13.4.0",
|
|
@@ -206,9 +206,6 @@
|
|
|
206
206
|
"platform_editor_renderer_rm_usespecbasedvalidator": {
|
|
207
207
|
"type": "boolean"
|
|
208
208
|
},
|
|
209
|
-
"platform_editor_add_border_for_nested_panel": {
|
|
210
|
-
"type": "boolean"
|
|
211
|
-
},
|
|
212
209
|
"platform_editor_bordered_panel_nested_in_table": {
|
|
213
210
|
"type": "boolean"
|
|
214
211
|
},
|