@atlaskit/renderer 123.4.0 → 123.4.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.
- package/CHANGELOG.md +9 -0
- package/dist/cjs/analytics/enums.js +1 -0
- package/dist/cjs/ui/Renderer/analytics-utils.js +32 -0
- package/dist/cjs/ui/Renderer/index.js +35 -0
- package/dist/es2019/analytics/enums.js +1 -0
- package/dist/es2019/ui/Renderer/analytics-utils.js +26 -0
- package/dist/es2019/ui/Renderer/index.js +35 -0
- package/dist/esm/analytics/enums.js +1 -0
- package/dist/esm/ui/Renderer/analytics-utils.js +26 -0
- package/dist/esm/ui/Renderer/index.js +35 -0
- package/dist/types/analytics/enums.d.ts +2 -1
- package/dist/types/analytics/events.d.ts +11 -2
- package/dist/types/ui/Renderer/analytics-utils.d.ts +2 -0
- package/dist/types-ts4.5/analytics/enums.d.ts +2 -1
- package/dist/types-ts4.5/analytics/events.d.ts +11 -2
- package/dist/types-ts4.5/ui/Renderer/analytics-utils.d.ts +2 -0
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @atlaskit/renderer
|
|
2
2
|
|
|
3
|
+
## 123.4.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`a77acd87fef67`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a77acd87fef67) -
|
|
8
|
+
EDITOR-1391 add new analytics event which logs editor width and all table widths on the page once
|
|
9
|
+
after page is loaded in both editor and renderer. remove previous implementation in width plugin.
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
3
12
|
## 123.4.0
|
|
4
13
|
|
|
5
14
|
### Minor Changes
|
|
@@ -34,6 +34,7 @@ var ACTION = exports.ACTION = /*#__PURE__*/function (ACTION) {
|
|
|
34
34
|
ACTION["UNSUPPORTED_CONTENT_LEVELS_TRACKING_SUCCEEDED"] = "unsupportedContentLevelsTrackingSucceeded";
|
|
35
35
|
ACTION["UNSUPPORTED_CONTENT_LEVELS_TRACKING_ERRORED"] = "unsupportedContentLevelsTrackingErrored";
|
|
36
36
|
ACTION["MEDIA_LINK_TRANSFORMED"] = "mediaLinkTransformed";
|
|
37
|
+
ACTION["TABLE_WIDTH_INFO"] = "tableWidthInfo";
|
|
37
38
|
return ACTION;
|
|
38
39
|
}({});
|
|
39
40
|
var ACTION_SUBJECT = exports.ACTION_SUBJECT = /*#__PURE__*/function (ACTION_SUBJECT) {
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getWidthInfoPayload = void 0;
|
|
7
|
+
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
8
|
+
var getWidthInfoPayload = exports.getWidthInfoPayload = function getWidthInfoPayload(renderer) {
|
|
9
|
+
var tablesInfo = [];
|
|
10
|
+
var tableWrappers = renderer.querySelectorAll('.pm-table-wrapper');
|
|
11
|
+
tableWrappers.forEach(function (tableWrapper) {
|
|
12
|
+
var table = tableWrapper.querySelector(':scope > table');
|
|
13
|
+
if (table) {
|
|
14
|
+
var isNestedTable = Boolean(table.closest('td, th'));
|
|
15
|
+
tablesInfo.push({
|
|
16
|
+
tableWidth: table.scrollWidth,
|
|
17
|
+
hasScrollbar: tableWrapper.clientWidth < table.scrollWidth,
|
|
18
|
+
isNestedTable: isNestedTable
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
return {
|
|
23
|
+
action: _analytics.TABLE_ACTION.TABLE_WIDTH_INFO,
|
|
24
|
+
actionSubject: _analytics.ACTION_SUBJECT.TABLE,
|
|
25
|
+
attributes: {
|
|
26
|
+
editorWidth: renderer.scrollWidth,
|
|
27
|
+
tableWidthInfo: tablesInfo,
|
|
28
|
+
mode: _analytics.MODE.RENDERER
|
|
29
|
+
},
|
|
30
|
+
eventType: _analytics.EVENT_TYPE.OPERATIONAL
|
|
31
|
+
};
|
|
32
|
+
};
|
|
@@ -52,6 +52,8 @@ var _rendererHelper = require("./rendererHelper");
|
|
|
52
52
|
var _useMemoFromPropsDerivative = require("./useMemoFromPropsDerivative");
|
|
53
53
|
var _PortalContext = require("./PortalContext");
|
|
54
54
|
var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
|
|
55
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
56
|
+
var _analyticsUtils = require("./analytics-utils");
|
|
55
57
|
var _excluded = ["portal"];
|
|
56
58
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
57
59
|
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; }
|
|
@@ -62,6 +64,9 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
62
64
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
63
65
|
var NORMAL_SEVERITY_THRESHOLD = exports.NORMAL_SEVERITY_THRESHOLD = 2000;
|
|
64
66
|
var DEGRADED_SEVERITY_THRESHOLD = exports.DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
67
|
+
|
|
68
|
+
// we want to calculate all the table widths (which causes reflows) after the renderer has finished loading to mitigate performance impact
|
|
69
|
+
var TABLE_WIDTH_INFO_TIMEOUT = 10000;
|
|
65
70
|
var packageName = "@atlaskit/renderer";
|
|
66
71
|
var packageVersion = "0.0.0-development";
|
|
67
72
|
var setAsQueryContainerStyles = (0, _react2.css)({
|
|
@@ -322,6 +327,9 @@ var RendererFunctionalComponent = exports.RendererFunctionalComponent = function
|
|
|
322
327
|
analyticsEventSeverityTracking = props.analyticsEventSeverityTracking;
|
|
323
328
|
(0, _react.useEffect)(function () {
|
|
324
329
|
var rafID;
|
|
330
|
+
var widthAnalyticsSetTimeoutID;
|
|
331
|
+
var widthAnalyticsRicID;
|
|
332
|
+
var widthAnalyticsRafID;
|
|
325
333
|
var handleAnalytics = function handleAnalytics() {
|
|
326
334
|
_fireAnalyticsEvent({
|
|
327
335
|
action: _analytics.ACTION.STARTED,
|
|
@@ -361,12 +369,39 @@ var RendererFunctionalComponent = exports.RendererFunctionalComponent = function
|
|
|
361
369
|
});
|
|
362
370
|
anchorLinkAnalytics();
|
|
363
371
|
});
|
|
372
|
+
if ((0, _expValEquals.expValEquals)('platform_editor_editor_width_analytics', 'isEnabled', true)) {
|
|
373
|
+
// send statistics about the widths of the tables on the page for alerting
|
|
374
|
+
widthAnalyticsSetTimeoutID = setTimeout(function () {
|
|
375
|
+
var requestIdleCallbackFn = function requestIdleCallbackFn() {
|
|
376
|
+
var _props$innerRef;
|
|
377
|
+
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');
|
|
378
|
+
if (renderer) {
|
|
379
|
+
_fireAnalyticsEvent((0, _analyticsUtils.getWidthInfoPayload)(renderer));
|
|
380
|
+
}
|
|
381
|
+
};
|
|
382
|
+
if (window && typeof window.requestIdleCallback === 'function') {
|
|
383
|
+
widthAnalyticsRicID = window.requestIdleCallback(requestIdleCallbackFn);
|
|
384
|
+
} else if (window && typeof window.requestAnimationFrame === 'function') {
|
|
385
|
+
// requestIdleCallback is not supported in safari, fallback to requestAnimationFrame
|
|
386
|
+
widthAnalyticsRafID = window.requestAnimationFrame(requestIdleCallbackFn);
|
|
387
|
+
}
|
|
388
|
+
}, TABLE_WIDTH_INFO_TIMEOUT);
|
|
389
|
+
}
|
|
364
390
|
};
|
|
365
391
|
handleAnalytics();
|
|
366
392
|
return function () {
|
|
367
393
|
if (rafID) {
|
|
368
394
|
window.cancelAnimationFrame(rafID);
|
|
369
395
|
}
|
|
396
|
+
if (widthAnalyticsSetTimeoutID) {
|
|
397
|
+
window.clearTimeout(widthAnalyticsSetTimeoutID);
|
|
398
|
+
}
|
|
399
|
+
if (widthAnalyticsRafID) {
|
|
400
|
+
window.cancelAnimationFrame(widthAnalyticsRafID);
|
|
401
|
+
}
|
|
402
|
+
if (widthAnalyticsRicID) {
|
|
403
|
+
window.cancelIdleCallback(widthAnalyticsRicID);
|
|
404
|
+
}
|
|
370
405
|
|
|
371
406
|
// if this is the ProviderFactory which was created in constructor
|
|
372
407
|
// it's safe to destroy it on Renderer unmount
|
|
@@ -28,6 +28,7 @@ export let ACTION = /*#__PURE__*/function (ACTION) {
|
|
|
28
28
|
ACTION["UNSUPPORTED_CONTENT_LEVELS_TRACKING_SUCCEEDED"] = "unsupportedContentLevelsTrackingSucceeded";
|
|
29
29
|
ACTION["UNSUPPORTED_CONTENT_LEVELS_TRACKING_ERRORED"] = "unsupportedContentLevelsTrackingErrored";
|
|
30
30
|
ACTION["MEDIA_LINK_TRANSFORMED"] = "mediaLinkTransformed";
|
|
31
|
+
ACTION["TABLE_WIDTH_INFO"] = "tableWidthInfo";
|
|
31
32
|
return ACTION;
|
|
32
33
|
}({});
|
|
33
34
|
export let ACTION_SUBJECT = /*#__PURE__*/function (ACTION_SUBJECT) {
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { TABLE_ACTION, ACTION_SUBJECT, EVENT_TYPE, MODE } from '@atlaskit/editor-common/analytics';
|
|
2
|
+
export const getWidthInfoPayload = renderer => {
|
|
3
|
+
const tablesInfo = [];
|
|
4
|
+
const tableWrappers = renderer.querySelectorAll('.pm-table-wrapper');
|
|
5
|
+
tableWrappers.forEach(tableWrapper => {
|
|
6
|
+
const table = tableWrapper.querySelector(':scope > table');
|
|
7
|
+
if (table) {
|
|
8
|
+
const isNestedTable = Boolean(table.closest('td, th'));
|
|
9
|
+
tablesInfo.push({
|
|
10
|
+
tableWidth: table.scrollWidth,
|
|
11
|
+
hasScrollbar: tableWrapper.clientWidth < table.scrollWidth,
|
|
12
|
+
isNestedTable
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
return {
|
|
17
|
+
action: TABLE_ACTION.TABLE_WIDTH_INFO,
|
|
18
|
+
actionSubject: ACTION_SUBJECT.TABLE,
|
|
19
|
+
attributes: {
|
|
20
|
+
editorWidth: renderer.scrollWidth,
|
|
21
|
+
tableWidthInfo: tablesInfo,
|
|
22
|
+
mode: MODE.RENDERER
|
|
23
|
+
},
|
|
24
|
+
eventType: EVENT_TYPE.OPERATIONAL
|
|
25
|
+
};
|
|
26
|
+
};
|
|
@@ -46,8 +46,13 @@ import { removeEmptySpaceAroundContent } from './rendererHelper';
|
|
|
46
46
|
import { useMemoFromPropsDerivative } from './useMemoFromPropsDerivative';
|
|
47
47
|
import { PortalContext } from './PortalContext';
|
|
48
48
|
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
49
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
50
|
+
import { getWidthInfoPayload } from './analytics-utils';
|
|
49
51
|
export const NORMAL_SEVERITY_THRESHOLD = 2000;
|
|
50
52
|
export const DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
53
|
+
|
|
54
|
+
// we want to calculate all the table widths (which causes reflows) after the renderer has finished loading to mitigate performance impact
|
|
55
|
+
const TABLE_WIDTH_INFO_TIMEOUT = 10000;
|
|
51
56
|
const packageName = "@atlaskit/renderer";
|
|
52
57
|
const packageVersion = "0.0.0-development";
|
|
53
58
|
const setAsQueryContainerStyles = css({
|
|
@@ -312,6 +317,9 @@ export const RendererFunctionalComponent = props => {
|
|
|
312
317
|
} = props;
|
|
313
318
|
useEffect(() => {
|
|
314
319
|
let rafID;
|
|
320
|
+
let widthAnalyticsSetTimeoutID;
|
|
321
|
+
let widthAnalyticsRicID;
|
|
322
|
+
let widthAnalyticsRafID;
|
|
315
323
|
const handleAnalytics = () => {
|
|
316
324
|
fireAnalyticsEvent({
|
|
317
325
|
action: ACTION.STARTED,
|
|
@@ -351,12 +359,39 @@ export const RendererFunctionalComponent = props => {
|
|
|
351
359
|
});
|
|
352
360
|
anchorLinkAnalytics();
|
|
353
361
|
});
|
|
362
|
+
if (expValEquals('platform_editor_editor_width_analytics', 'isEnabled', true)) {
|
|
363
|
+
// send statistics about the widths of the tables on the page for alerting
|
|
364
|
+
widthAnalyticsSetTimeoutID = setTimeout(() => {
|
|
365
|
+
const requestIdleCallbackFn = () => {
|
|
366
|
+
var _props$innerRef, _props$innerRef$curre;
|
|
367
|
+
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');
|
|
368
|
+
if (renderer) {
|
|
369
|
+
fireAnalyticsEvent(getWidthInfoPayload(renderer));
|
|
370
|
+
}
|
|
371
|
+
};
|
|
372
|
+
if (window && typeof window.requestIdleCallback === 'function') {
|
|
373
|
+
widthAnalyticsRicID = window.requestIdleCallback(requestIdleCallbackFn);
|
|
374
|
+
} else if (window && typeof window.requestAnimationFrame === 'function') {
|
|
375
|
+
// requestIdleCallback is not supported in safari, fallback to requestAnimationFrame
|
|
376
|
+
widthAnalyticsRafID = window.requestAnimationFrame(requestIdleCallbackFn);
|
|
377
|
+
}
|
|
378
|
+
}, TABLE_WIDTH_INFO_TIMEOUT);
|
|
379
|
+
}
|
|
354
380
|
};
|
|
355
381
|
handleAnalytics();
|
|
356
382
|
return () => {
|
|
357
383
|
if (rafID) {
|
|
358
384
|
window.cancelAnimationFrame(rafID);
|
|
359
385
|
}
|
|
386
|
+
if (widthAnalyticsSetTimeoutID) {
|
|
387
|
+
window.clearTimeout(widthAnalyticsSetTimeoutID);
|
|
388
|
+
}
|
|
389
|
+
if (widthAnalyticsRafID) {
|
|
390
|
+
window.cancelAnimationFrame(widthAnalyticsRafID);
|
|
391
|
+
}
|
|
392
|
+
if (widthAnalyticsRicID) {
|
|
393
|
+
window.cancelIdleCallback(widthAnalyticsRicID);
|
|
394
|
+
}
|
|
360
395
|
|
|
361
396
|
// if this is the ProviderFactory which was created in constructor
|
|
362
397
|
// it's safe to destroy it on Renderer unmount
|
|
@@ -28,6 +28,7 @@ export var ACTION = /*#__PURE__*/function (ACTION) {
|
|
|
28
28
|
ACTION["UNSUPPORTED_CONTENT_LEVELS_TRACKING_SUCCEEDED"] = "unsupportedContentLevelsTrackingSucceeded";
|
|
29
29
|
ACTION["UNSUPPORTED_CONTENT_LEVELS_TRACKING_ERRORED"] = "unsupportedContentLevelsTrackingErrored";
|
|
30
30
|
ACTION["MEDIA_LINK_TRANSFORMED"] = "mediaLinkTransformed";
|
|
31
|
+
ACTION["TABLE_WIDTH_INFO"] = "tableWidthInfo";
|
|
31
32
|
return ACTION;
|
|
32
33
|
}({});
|
|
33
34
|
export var ACTION_SUBJECT = /*#__PURE__*/function (ACTION_SUBJECT) {
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { TABLE_ACTION, ACTION_SUBJECT, EVENT_TYPE, MODE } from '@atlaskit/editor-common/analytics';
|
|
2
|
+
export var getWidthInfoPayload = function getWidthInfoPayload(renderer) {
|
|
3
|
+
var tablesInfo = [];
|
|
4
|
+
var tableWrappers = renderer.querySelectorAll('.pm-table-wrapper');
|
|
5
|
+
tableWrappers.forEach(function (tableWrapper) {
|
|
6
|
+
var table = tableWrapper.querySelector(':scope > table');
|
|
7
|
+
if (table) {
|
|
8
|
+
var isNestedTable = Boolean(table.closest('td, th'));
|
|
9
|
+
tablesInfo.push({
|
|
10
|
+
tableWidth: table.scrollWidth,
|
|
11
|
+
hasScrollbar: tableWrapper.clientWidth < table.scrollWidth,
|
|
12
|
+
isNestedTable: isNestedTable
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
return {
|
|
17
|
+
action: TABLE_ACTION.TABLE_WIDTH_INFO,
|
|
18
|
+
actionSubject: ACTION_SUBJECT.TABLE,
|
|
19
|
+
attributes: {
|
|
20
|
+
editorWidth: renderer.scrollWidth,
|
|
21
|
+
tableWidthInfo: tablesInfo,
|
|
22
|
+
mode: MODE.RENDERER
|
|
23
|
+
},
|
|
24
|
+
eventType: EVENT_TYPE.OPERATIONAL
|
|
25
|
+
};
|
|
26
|
+
};
|
|
@@ -51,8 +51,13 @@ import { removeEmptySpaceAroundContent } from './rendererHelper';
|
|
|
51
51
|
import { useMemoFromPropsDerivative } from './useMemoFromPropsDerivative';
|
|
52
52
|
import { PortalContext } from './PortalContext';
|
|
53
53
|
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
54
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
55
|
+
import { getWidthInfoPayload } from './analytics-utils';
|
|
54
56
|
export var NORMAL_SEVERITY_THRESHOLD = 2000;
|
|
55
57
|
export var DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
58
|
+
|
|
59
|
+
// we want to calculate all the table widths (which causes reflows) after the renderer has finished loading to mitigate performance impact
|
|
60
|
+
var TABLE_WIDTH_INFO_TIMEOUT = 10000;
|
|
56
61
|
var packageName = "@atlaskit/renderer";
|
|
57
62
|
var packageVersion = "0.0.0-development";
|
|
58
63
|
var setAsQueryContainerStyles = css({
|
|
@@ -313,6 +318,9 @@ export var RendererFunctionalComponent = function RendererFunctionalComponent(pr
|
|
|
313
318
|
analyticsEventSeverityTracking = props.analyticsEventSeverityTracking;
|
|
314
319
|
useEffect(function () {
|
|
315
320
|
var rafID;
|
|
321
|
+
var widthAnalyticsSetTimeoutID;
|
|
322
|
+
var widthAnalyticsRicID;
|
|
323
|
+
var widthAnalyticsRafID;
|
|
316
324
|
var handleAnalytics = function handleAnalytics() {
|
|
317
325
|
_fireAnalyticsEvent({
|
|
318
326
|
action: ACTION.STARTED,
|
|
@@ -352,12 +360,39 @@ export var RendererFunctionalComponent = function RendererFunctionalComponent(pr
|
|
|
352
360
|
});
|
|
353
361
|
anchorLinkAnalytics();
|
|
354
362
|
});
|
|
363
|
+
if (expValEquals('platform_editor_editor_width_analytics', 'isEnabled', true)) {
|
|
364
|
+
// send statistics about the widths of the tables on the page for alerting
|
|
365
|
+
widthAnalyticsSetTimeoutID = setTimeout(function () {
|
|
366
|
+
var requestIdleCallbackFn = function requestIdleCallbackFn() {
|
|
367
|
+
var _props$innerRef;
|
|
368
|
+
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');
|
|
369
|
+
if (renderer) {
|
|
370
|
+
_fireAnalyticsEvent(getWidthInfoPayload(renderer));
|
|
371
|
+
}
|
|
372
|
+
};
|
|
373
|
+
if (window && typeof window.requestIdleCallback === 'function') {
|
|
374
|
+
widthAnalyticsRicID = window.requestIdleCallback(requestIdleCallbackFn);
|
|
375
|
+
} else if (window && typeof window.requestAnimationFrame === 'function') {
|
|
376
|
+
// requestIdleCallback is not supported in safari, fallback to requestAnimationFrame
|
|
377
|
+
widthAnalyticsRafID = window.requestAnimationFrame(requestIdleCallbackFn);
|
|
378
|
+
}
|
|
379
|
+
}, TABLE_WIDTH_INFO_TIMEOUT);
|
|
380
|
+
}
|
|
355
381
|
};
|
|
356
382
|
handleAnalytics();
|
|
357
383
|
return function () {
|
|
358
384
|
if (rafID) {
|
|
359
385
|
window.cancelAnimationFrame(rafID);
|
|
360
386
|
}
|
|
387
|
+
if (widthAnalyticsSetTimeoutID) {
|
|
388
|
+
window.clearTimeout(widthAnalyticsSetTimeoutID);
|
|
389
|
+
}
|
|
390
|
+
if (widthAnalyticsRafID) {
|
|
391
|
+
window.cancelAnimationFrame(widthAnalyticsRafID);
|
|
392
|
+
}
|
|
393
|
+
if (widthAnalyticsRicID) {
|
|
394
|
+
window.cancelIdleCallback(widthAnalyticsRicID);
|
|
395
|
+
}
|
|
361
396
|
|
|
362
397
|
// if this is the ProviderFactory which was created in constructor
|
|
363
398
|
// it's safe to destroy it on Renderer unmount
|
|
@@ -26,7 +26,8 @@ export declare enum ACTION {
|
|
|
26
26
|
CREATE_NOT_ALLOWED = "createNotAllowed",
|
|
27
27
|
UNSUPPORTED_CONTENT_LEVELS_TRACKING_SUCCEEDED = "unsupportedContentLevelsTrackingSucceeded",
|
|
28
28
|
UNSUPPORTED_CONTENT_LEVELS_TRACKING_ERRORED = "unsupportedContentLevelsTrackingErrored",
|
|
29
|
-
MEDIA_LINK_TRANSFORMED = "mediaLinkTransformed"
|
|
29
|
+
MEDIA_LINK_TRANSFORMED = "mediaLinkTransformed",
|
|
30
|
+
TABLE_WIDTH_INFO = "tableWidthInfo"
|
|
30
31
|
}
|
|
31
32
|
export declare enum ACTION_SUBJECT {
|
|
32
33
|
RENDERER = "renderer",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, OperationalAEP } from '@atlaskit/editor-common/analytics';
|
|
1
|
+
import type { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, OperationalAEP, TABLE_ACTION } from '@atlaskit/editor-common/analytics';
|
|
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';
|
|
@@ -77,6 +77,15 @@ type TableSortColumnAEP = AEP<ACTION.SORT_COLUMN, ACTION_SUBJECT.TABLE, undefine
|
|
|
77
77
|
platform: PLATFORM.WEB;
|
|
78
78
|
sortOrder: SortOrder;
|
|
79
79
|
}, EVENT_TYPE.TRACK>;
|
|
80
|
+
type TableWidthInfoAEP = AEP<TABLE_ACTION.TABLE_WIDTH_INFO, ACTION_SUBJECT.TABLE, undefined, {
|
|
81
|
+
editorWidth: number;
|
|
82
|
+
mode: MODE.RENDERER;
|
|
83
|
+
tableWidthInfo: Array<{
|
|
84
|
+
hasScrollbar: boolean;
|
|
85
|
+
isNestedTable: boolean;
|
|
86
|
+
tableWidth: number;
|
|
87
|
+
}>;
|
|
88
|
+
}, EVENT_TYPE.OPERATIONAL>;
|
|
80
89
|
type VisitLinkAEP = AEP<ACTION.VISITED, ACTION_SUBJECT.LINK, undefined, {
|
|
81
90
|
mode: MODE.RENDERER;
|
|
82
91
|
platform: PLATFORM.WEB;
|
|
@@ -109,6 +118,6 @@ declare enum RESOLVE_METHOD {
|
|
|
109
118
|
type AnnotationAEP = AEP<AnnotationActionType, ACTION_SUBJECT.ANNOTATION, ACTION_SUBJECT_ID.INLINE_COMMENT, AnnotationAEPAttributes, undefined>;
|
|
110
119
|
type MediaLnkTransformedAEP = AEP<ACTION.MEDIA_LINK_TRANSFORMED, ACTION_SUBJECT.RENDERER, undefined, undefined, EVENT_TYPE.OPERATIONAL>;
|
|
111
120
|
type NestedTableTransformedAEP = OperationalAEP<ACTION.NESTED_TABLE_TRANSFORMED, ACTION_SUBJECT.RENDERER, undefined, undefined>;
|
|
112
|
-
export type AnalyticsEventPayload<T = void> = RendererStartAEP | RendererRenderedAEP | ComponentCrashErrorAEP | RendererUnsupportedContentLevelsTrackingSucceeded | RendererUnsupportedContentLevelsTrackingErrored | RendererSelectAllCaughtAEP | RendererSelectAllEscapedAEP | CodeBlockCopyAEP | CodeBlockWrapAEP | HeadingAnchorLinkButtonAEP | AnchorLinkAEP | TableSortColumnNotAllowedAEP | TableSortColumnAEP | VisitLinkAEP | VisitMediaLinkAEP | ExpandAEP | UnsupportedContentPayload | UnsupportedContentTooltipPayload | AnnotationAEP | AnnotationDeleteAEP | MediaLnkTransformedAEP | InvalidProsemirrorDocumentErrorAEP | NestedTableTransformedAEP;
|
|
121
|
+
export type AnalyticsEventPayload<T = void> = RendererStartAEP | RendererRenderedAEP | ComponentCrashErrorAEP | RendererUnsupportedContentLevelsTrackingSucceeded | RendererUnsupportedContentLevelsTrackingErrored | RendererSelectAllCaughtAEP | RendererSelectAllEscapedAEP | CodeBlockCopyAEP | CodeBlockWrapAEP | HeadingAnchorLinkButtonAEP | AnchorLinkAEP | TableSortColumnNotAllowedAEP | TableSortColumnAEP | TableWidthInfoAEP | VisitLinkAEP | VisitMediaLinkAEP | ExpandAEP | UnsupportedContentPayload | UnsupportedContentTooltipPayload | AnnotationAEP | AnnotationDeleteAEP | MediaLnkTransformedAEP | InvalidProsemirrorDocumentErrorAEP | NestedTableTransformedAEP;
|
|
113
122
|
export type FireAnalyticsCallback = <T = void>(payload: AnalyticsEventPayload<T>) => void | undefined;
|
|
114
123
|
export {};
|
|
@@ -26,7 +26,8 @@ export declare enum ACTION {
|
|
|
26
26
|
CREATE_NOT_ALLOWED = "createNotAllowed",
|
|
27
27
|
UNSUPPORTED_CONTENT_LEVELS_TRACKING_SUCCEEDED = "unsupportedContentLevelsTrackingSucceeded",
|
|
28
28
|
UNSUPPORTED_CONTENT_LEVELS_TRACKING_ERRORED = "unsupportedContentLevelsTrackingErrored",
|
|
29
|
-
MEDIA_LINK_TRANSFORMED = "mediaLinkTransformed"
|
|
29
|
+
MEDIA_LINK_TRANSFORMED = "mediaLinkTransformed",
|
|
30
|
+
TABLE_WIDTH_INFO = "tableWidthInfo"
|
|
30
31
|
}
|
|
31
32
|
export declare enum ACTION_SUBJECT {
|
|
32
33
|
RENDERER = "renderer",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, OperationalAEP } from '@atlaskit/editor-common/analytics';
|
|
1
|
+
import type { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, OperationalAEP, TABLE_ACTION } from '@atlaskit/editor-common/analytics';
|
|
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';
|
|
@@ -77,6 +77,15 @@ type TableSortColumnAEP = AEP<ACTION.SORT_COLUMN, ACTION_SUBJECT.TABLE, undefine
|
|
|
77
77
|
platform: PLATFORM.WEB;
|
|
78
78
|
sortOrder: SortOrder;
|
|
79
79
|
}, EVENT_TYPE.TRACK>;
|
|
80
|
+
type TableWidthInfoAEP = AEP<TABLE_ACTION.TABLE_WIDTH_INFO, ACTION_SUBJECT.TABLE, undefined, {
|
|
81
|
+
editorWidth: number;
|
|
82
|
+
mode: MODE.RENDERER;
|
|
83
|
+
tableWidthInfo: Array<{
|
|
84
|
+
hasScrollbar: boolean;
|
|
85
|
+
isNestedTable: boolean;
|
|
86
|
+
tableWidth: number;
|
|
87
|
+
}>;
|
|
88
|
+
}, EVENT_TYPE.OPERATIONAL>;
|
|
80
89
|
type VisitLinkAEP = AEP<ACTION.VISITED, ACTION_SUBJECT.LINK, undefined, {
|
|
81
90
|
mode: MODE.RENDERER;
|
|
82
91
|
platform: PLATFORM.WEB;
|
|
@@ -109,6 +118,6 @@ declare enum RESOLVE_METHOD {
|
|
|
109
118
|
type AnnotationAEP = AEP<AnnotationActionType, ACTION_SUBJECT.ANNOTATION, ACTION_SUBJECT_ID.INLINE_COMMENT, AnnotationAEPAttributes, undefined>;
|
|
110
119
|
type MediaLnkTransformedAEP = AEP<ACTION.MEDIA_LINK_TRANSFORMED, ACTION_SUBJECT.RENDERER, undefined, undefined, EVENT_TYPE.OPERATIONAL>;
|
|
111
120
|
type NestedTableTransformedAEP = OperationalAEP<ACTION.NESTED_TABLE_TRANSFORMED, ACTION_SUBJECT.RENDERER, undefined, undefined>;
|
|
112
|
-
export type AnalyticsEventPayload<T = void> = RendererStartAEP | RendererRenderedAEP | ComponentCrashErrorAEP | RendererUnsupportedContentLevelsTrackingSucceeded | RendererUnsupportedContentLevelsTrackingErrored | RendererSelectAllCaughtAEP | RendererSelectAllEscapedAEP | CodeBlockCopyAEP | CodeBlockWrapAEP | HeadingAnchorLinkButtonAEP | AnchorLinkAEP | TableSortColumnNotAllowedAEP | TableSortColumnAEP | VisitLinkAEP | VisitMediaLinkAEP | ExpandAEP | UnsupportedContentPayload | UnsupportedContentTooltipPayload | AnnotationAEP | AnnotationDeleteAEP | MediaLnkTransformedAEP | InvalidProsemirrorDocumentErrorAEP | NestedTableTransformedAEP;
|
|
121
|
+
export type AnalyticsEventPayload<T = void> = RendererStartAEP | RendererRenderedAEP | ComponentCrashErrorAEP | RendererUnsupportedContentLevelsTrackingSucceeded | RendererUnsupportedContentLevelsTrackingErrored | RendererSelectAllCaughtAEP | RendererSelectAllEscapedAEP | CodeBlockCopyAEP | CodeBlockWrapAEP | HeadingAnchorLinkButtonAEP | AnchorLinkAEP | TableSortColumnNotAllowedAEP | TableSortColumnAEP | TableWidthInfoAEP | VisitLinkAEP | VisitMediaLinkAEP | ExpandAEP | UnsupportedContentPayload | UnsupportedContentTooltipPayload | AnnotationAEP | AnnotationDeleteAEP | MediaLnkTransformedAEP | InvalidProsemirrorDocumentErrorAEP | NestedTableTransformedAEP;
|
|
113
122
|
export type FireAnalyticsCallback = <T = void>(payload: AnalyticsEventPayload<T>) => void | undefined;
|
|
114
123
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/renderer",
|
|
3
|
-
"version": "123.4.
|
|
3
|
+
"version": "123.4.1",
|
|
4
4
|
"description": "Renderer component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -51,12 +51,12 @@
|
|
|
51
51
|
"@atlaskit/media-viewer": "^52.4.0",
|
|
52
52
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
53
53
|
"@atlaskit/platform-feature-flags-react": "^0.3.0",
|
|
54
|
-
"@atlaskit/react-ufo": "^4.
|
|
55
|
-
"@atlaskit/smart-card": "^42.
|
|
54
|
+
"@atlaskit/react-ufo": "^4.9.0",
|
|
55
|
+
"@atlaskit/smart-card": "^42.1.0",
|
|
56
56
|
"@atlaskit/status": "^3.0.0",
|
|
57
57
|
"@atlaskit/task-decision": "^19.2.0",
|
|
58
58
|
"@atlaskit/theme": "^21.0.0",
|
|
59
|
-
"@atlaskit/tmp-editor-statsig": "^12.
|
|
59
|
+
"@atlaskit/tmp-editor-statsig": "^12.28.0",
|
|
60
60
|
"@atlaskit/tokens": "^6.3.0",
|
|
61
61
|
"@atlaskit/tooltip": "^20.4.0",
|
|
62
62
|
"@atlaskit/visually-hidden": "^3.0.0",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"uuid": "^3.1.0"
|
|
71
71
|
},
|
|
72
72
|
"peerDependencies": {
|
|
73
|
-
"@atlaskit/editor-common": "^109.
|
|
73
|
+
"@atlaskit/editor-common": "^109.12.0",
|
|
74
74
|
"@atlaskit/link-provider": "^4.0.0",
|
|
75
75
|
"@atlaskit/media-core": "^37.0.0",
|
|
76
76
|
"react": "^18.2.0",
|