@atlaskit/renderer 132.7.0 → 133.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.
- package/CHANGELOG.md +34 -0
- package/dist/cjs/react/nodes/layoutColumn-compiled.js +3 -1
- package/dist/cjs/react/nodes/layoutColumn-emotion.js +3 -1
- package/dist/cjs/react/utils/use-select-all-trap.js +4 -4
- package/dist/cjs/steps/index.js +4 -4
- package/dist/cjs/ui/Renderer/ErrorBoundary.js +4 -4
- package/dist/cjs/ui/annotations/element/mark.js +5 -3
- package/dist/es2019/react/nodes/layoutColumn-compiled.js +3 -1
- package/dist/es2019/react/nodes/layoutColumn-emotion.js +3 -1
- package/dist/es2019/react/utils/use-select-all-trap.js +5 -4
- package/dist/es2019/steps/index.js +5 -4
- package/dist/es2019/ui/Renderer/ErrorBoundary.js +5 -4
- package/dist/es2019/ui/annotations/element/mark.js +5 -3
- package/dist/esm/react/nodes/layoutColumn-compiled.js +3 -1
- package/dist/esm/react/nodes/layoutColumn-emotion.js +3 -1
- package/dist/esm/react/utils/use-select-all-trap.js +5 -4
- package/dist/esm/steps/index.js +5 -4
- package/dist/esm/ui/Renderer/ErrorBoundary.js +5 -4
- package/dist/esm/ui/annotations/element/mark.js +5 -3
- package/package.json +56 -56
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,39 @@
|
|
|
1
1
|
# @atlaskit/renderer
|
|
2
2
|
|
|
3
|
+
## 133.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- [`f2dc9097319f0`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f2dc9097319f0) - ###
|
|
8
|
+
Dropped support for _legacy_ Typescript 4 types. **Typescript 5 is now the new minimum**.
|
|
9
|
+
|
|
10
|
+
Removes the `typesVersions` property and `dist/types-ts4.5` directory from the dist.
|
|
11
|
+
|
|
12
|
+
Types are now exclusively via the `"types": "dist/types/index.d.ts"` property.
|
|
13
|
+
|
|
14
|
+
```diff
|
|
15
|
+
- "typesVersions": {
|
|
16
|
+
- ">=4.5 <4.9": {
|
|
17
|
+
- "*": [
|
|
18
|
+
- "dist/types-ts4.5/*",
|
|
19
|
+
- "dist/types-ts4.5/index.d.ts"
|
|
20
|
+
- ]
|
|
21
|
+
- }
|
|
22
|
+
- },
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### Minor Changes
|
|
26
|
+
|
|
27
|
+
- [`458ee17c2c8ee`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/458ee17c2c8ee) -
|
|
28
|
+
Register layout column vertical alignment rendering experiment and gate renderer layout column
|
|
29
|
+
vertical alignment styles behind it
|
|
30
|
+
|
|
31
|
+
### Patch Changes
|
|
32
|
+
|
|
33
|
+
- [`eb0de97776ce5`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/eb0de97776ce5) -
|
|
34
|
+
cleanup to prefer static regex as part of ees019
|
|
35
|
+
- Updated dependencies
|
|
36
|
+
|
|
3
37
|
## 132.7.0
|
|
4
38
|
|
|
5
39
|
### Minor Changes
|
|
@@ -28,6 +28,8 @@ var multipleWrappedImagesStyle = null;
|
|
|
28
28
|
var clearNextSiblingBlockMarkMarginTopStyle = null;
|
|
29
29
|
var LayoutSectionCompiled = exports.LayoutSectionCompiled = function LayoutSectionCompiled(props) {
|
|
30
30
|
var isLayoutColumnMenuEnabled = (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_layout_column_menu', 'isEnabled', true);
|
|
31
|
+
// Pure rollout gate: no A/B exposure analysis is planned for this rendering switch.
|
|
32
|
+
var isLayoutColumnValignRenderingEnabled = (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_layout_column_valign_rendering', 'isEnabled', true);
|
|
31
33
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
32
34
|
"data-layout-column": true,
|
|
33
35
|
"data-column-width": props.width,
|
|
@@ -37,7 +39,7 @@ var LayoutSectionCompiled = exports.LayoutSectionCompiled = function LayoutSecti
|
|
|
37
39
|
style: {
|
|
38
40
|
flexBasis: "".concat(props.width, "%")
|
|
39
41
|
},
|
|
40
|
-
className: (0, _runtime.ax)([isLayoutColumnMenuEnabled && props.valign === 'middle' && "_1e0c1txw _2lx21bp4 _1bah1h6o", isLayoutColumnMenuEnabled && props.valign === 'bottom' && "_1e0c1txw _2lx21bp4 _1bahesu3", (0, _platformFeatureFlags.fg)('platform_editor_fix_media_in_renderer') && "_1tihidpf _12kpidpf"])
|
|
42
|
+
className: (0, _runtime.ax)([(isLayoutColumnValignRenderingEnabled || isLayoutColumnMenuEnabled) && props.valign === 'middle' && "_1e0c1txw _2lx21bp4 _1bah1h6o", (isLayoutColumnValignRenderingEnabled || isLayoutColumnMenuEnabled) && props.valign === 'bottom' && "_1e0c1txw _2lx21bp4 _1bahesu3", (0, _platformFeatureFlags.fg)('platform_editor_fix_media_in_renderer') && "_1tihidpf _12kpidpf"])
|
|
41
43
|
}, /*#__PURE__*/_react.default.createElement(_ui.WidthProvider, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
42
44
|
className: (0, _runtime.ax)(["_1skbgrf3", "_19segrf3 _1ki1grf3 _bmdegrf3 _166hgrf3 _7g1ogrf3 _sk2jgrf3 _hgeogrf3"])
|
|
43
45
|
}), props.children));
|
|
@@ -58,6 +58,8 @@ var clearNextSiblingBlockMarkMarginTopStyle = (0, _react2.css)((0, _defineProper
|
|
|
58
58
|
}));
|
|
59
59
|
var LayoutSectionEmotion = exports.LayoutSectionEmotion = function LayoutSectionEmotion(props) {
|
|
60
60
|
var isLayoutColumnMenuEnabled = (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_layout_column_menu', 'isEnabled', true);
|
|
61
|
+
// Pure rollout gate: no A/B exposure analysis is planned for this rendering switch.
|
|
62
|
+
var isLayoutColumnValignRenderingEnabled = (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_layout_column_valign_rendering', 'isEnabled', true);
|
|
61
63
|
return (0, _react2.jsx)("div", {
|
|
62
64
|
"data-layout-column": true,
|
|
63
65
|
"data-column-width": props.width,
|
|
@@ -69,7 +71,7 @@ var LayoutSectionEmotion = exports.LayoutSectionEmotion = function LayoutSection
|
|
|
69
71
|
},
|
|
70
72
|
css: [
|
|
71
73
|
// Keep separate: Compiled crashes on ternary/object lookup here.
|
|
72
|
-
isLayoutColumnMenuEnabled && props.valign === 'middle' && verticalAlignMiddleStyles, isLayoutColumnMenuEnabled && props.valign === 'bottom' && verticalAlignBottomStyles, (0, _platformFeatureFlags.fg)('platform_editor_fix_media_in_renderer') && multipleWrappedImagesStyle]
|
|
74
|
+
(isLayoutColumnValignRenderingEnabled || isLayoutColumnMenuEnabled) && props.valign === 'middle' && verticalAlignMiddleStyles, (isLayoutColumnValignRenderingEnabled || isLayoutColumnMenuEnabled) && props.valign === 'bottom' && verticalAlignBottomStyles, (0, _platformFeatureFlags.fg)('platform_editor_fix_media_in_renderer') && multipleWrappedImagesStyle]
|
|
73
75
|
}, (0, _react2.jsx)(_ui.WidthProvider, null, (0, _react2.jsx)("div", {
|
|
74
76
|
css: [clearNextSiblingMarginTopStyle, clearNextSiblingBlockMarkMarginTopStyle]
|
|
75
77
|
}), props.children));
|
|
@@ -9,16 +9,16 @@ var _analytics = require("@atlaskit/editor-common/analytics");
|
|
|
9
9
|
var _react = _interopRequireDefault(require("react"));
|
|
10
10
|
var _analyticsContext = _interopRequireDefault(require("../../analytics/analyticsContext"));
|
|
11
11
|
var _elementSelection = require("./element-selection");
|
|
12
|
+
// Ignored via go/ees005
|
|
13
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
14
|
+
var MAC_PLATFORM_REGEX = /Mac/;
|
|
12
15
|
var useSelectAllTrap = exports.useSelectAllTrap = function useSelectAllTrap() {
|
|
13
16
|
var _React$useContext = _react.default.useContext(_analyticsContext.default),
|
|
14
17
|
fireAnalyticsEvent = _React$useContext.fireAnalyticsEvent;
|
|
15
18
|
var ref = _react.default.useRef(null);
|
|
16
19
|
var clicked = _react.default.useRef(false);
|
|
17
20
|
var caught = _react.default.useRef();
|
|
18
|
-
|
|
19
|
-
// Ignored via go/ees005
|
|
20
|
-
// eslint-disable-next-line require-unicode-regexp
|
|
21
|
-
var mac = typeof navigator !== 'undefined' ? /Mac/.test(navigator.platform) : false;
|
|
21
|
+
var mac = typeof navigator !== 'undefined' ? MAC_PLATFORM_REGEX.test(navigator.platform) : false;
|
|
22
22
|
var onKeyDown = _react.default.useCallback(function (e) {
|
|
23
23
|
var _e$target, _e$target$matches;
|
|
24
24
|
var el = ref.current;
|
package/dist/cjs/steps/index.js
CHANGED
|
@@ -13,6 +13,9 @@ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
|
13
13
|
var _transform = require("@atlaskit/editor-prosemirror/transform");
|
|
14
14
|
/* eslint-disable jsdoc/require-jsdoc -- internal step helpers */
|
|
15
15
|
|
|
16
|
+
// Ignored via go/ees005
|
|
17
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
18
|
+
var MEDIA_OR_MEDIA_SINGLE_REGEX = /media|mediaSingle/;
|
|
16
19
|
function getStartPos(element) {
|
|
17
20
|
return parseInt(element.dataset.rendererStartPos || '-1', 10);
|
|
18
21
|
}
|
|
@@ -231,10 +234,7 @@ function getPosFromRange(range) {
|
|
|
231
234
|
var possibleMediaOrMediaSingleElement = findParent(startContainer);
|
|
232
235
|
|
|
233
236
|
// Video hover targets return media single, not media, thus, the extra check in condition.
|
|
234
|
-
var isMediaOrMediaSingle = possibleMediaOrMediaSingleElement &&
|
|
235
|
-
// Ignored via go/ees005
|
|
236
|
-
// eslint-disable-next-line require-unicode-regexp
|
|
237
|
-
/media|mediaSingle/.test(getNodeType(possibleMediaOrMediaSingleElement) || '');
|
|
237
|
+
var isMediaOrMediaSingle = possibleMediaOrMediaSingleElement && MEDIA_OR_MEDIA_SINGLE_REGEX.test(getNodeType(possibleMediaOrMediaSingleElement) || '');
|
|
238
238
|
if (isMediaOrMediaSingle) {
|
|
239
239
|
var pos;
|
|
240
240
|
var mediaSingleElement = getNodeType(possibleMediaOrMediaSingleElement) === 'mediaSingle' ? possibleMediaOrMediaSingleElement : findMediaParent(possibleMediaOrMediaSingleElement);
|
|
@@ -21,6 +21,9 @@ var _uuid = _interopRequireDefault(require("uuid"));
|
|
|
21
21
|
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
|
|
22
22
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } // eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
23
23
|
// Ignored via go/ees005
|
|
24
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
25
|
+
var FAILED_TO_EXECUTE_REGEX = /Failed to execute.*on 'Node'.*/;
|
|
26
|
+
// Ignored via go/ees005
|
|
24
27
|
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
25
28
|
var ErrorBoundary = exports.ErrorBoundary = /*#__PURE__*/function (_React$Component) {
|
|
26
29
|
function ErrorBoundary() {
|
|
@@ -78,10 +81,7 @@ var ErrorBoundary = exports.ErrorBoundary = /*#__PURE__*/function (_React$Compon
|
|
|
78
81
|
(0, _monitoring.logException)(error, {
|
|
79
82
|
location: 'renderer'
|
|
80
83
|
});
|
|
81
|
-
|
|
82
|
-
// eslint-disable-next-line require-unicode-regexp
|
|
83
|
-
var pattern = /Failed to execute.*on 'Node'.*/;
|
|
84
|
-
var matchesPattern = pattern.test(error.message);
|
|
84
|
+
var matchesPattern = FAILED_TO_EXECUTE_REGEX.test(error.message);
|
|
85
85
|
if (matchesPattern) {
|
|
86
86
|
this.fireAnalyticsEvent({
|
|
87
87
|
action: _analytics.ACTION.CAUGHT_DOM_ERROR,
|
|
@@ -88,10 +88,12 @@ var markStylesWithCommentsPanel = (0, _react2.css)((0, _defineProperty2.default)
|
|
|
88
88
|
boxShadow: "var(--ds-shadow-overlay, 0px 8px 12px #1E1F2126, 0px 0px 1px #1E1F214f)"
|
|
89
89
|
}
|
|
90
90
|
}));
|
|
91
|
+
|
|
92
|
+
// Ignored via go/ees005
|
|
93
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
94
|
+
var MOBILE_USER_AGENT_REGEX = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i;
|
|
91
95
|
var isMobile = function isMobile() {
|
|
92
|
-
|
|
93
|
-
// eslint-disable-next-line require-unicode-regexp
|
|
94
|
-
return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
|
|
96
|
+
return MOBILE_USER_AGENT_REGEX.test(navigator.userAgent);
|
|
95
97
|
};
|
|
96
98
|
var accessibilityStylesNew = (0, _react2.css)({
|
|
97
99
|
'&::before, &::after': {
|
|
@@ -22,6 +22,8 @@ const multipleWrappedImagesStyle = null;
|
|
|
22
22
|
const clearNextSiblingBlockMarkMarginTopStyle = null;
|
|
23
23
|
export const LayoutSectionCompiled = props => {
|
|
24
24
|
const isLayoutColumnMenuEnabled = expValEqualsNoExposure('platform_editor_layout_column_menu', 'isEnabled', true);
|
|
25
|
+
// Pure rollout gate: no A/B exposure analysis is planned for this rendering switch.
|
|
26
|
+
const isLayoutColumnValignRenderingEnabled = expValEqualsNoExposure('platform_editor_layout_column_valign_rendering', 'isEnabled', true);
|
|
25
27
|
return /*#__PURE__*/React.createElement("div", {
|
|
26
28
|
"data-layout-column": true,
|
|
27
29
|
"data-column-width": props.width,
|
|
@@ -31,7 +33,7 @@ export const LayoutSectionCompiled = props => {
|
|
|
31
33
|
style: {
|
|
32
34
|
flexBasis: `${props.width}%`
|
|
33
35
|
},
|
|
34
|
-
className: ax([isLayoutColumnMenuEnabled && props.valign === 'middle' && "_1e0c1txw _2lx21bp4 _1bah1h6o", isLayoutColumnMenuEnabled && props.valign === 'bottom' && "_1e0c1txw _2lx21bp4 _1bahesu3", fg('platform_editor_fix_media_in_renderer') && "_1tihidpf _12kpidpf"])
|
|
36
|
+
className: ax([(isLayoutColumnValignRenderingEnabled || isLayoutColumnMenuEnabled) && props.valign === 'middle' && "_1e0c1txw _2lx21bp4 _1bah1h6o", (isLayoutColumnValignRenderingEnabled || isLayoutColumnMenuEnabled) && props.valign === 'bottom' && "_1e0c1txw _2lx21bp4 _1bahesu3", fg('platform_editor_fix_media_in_renderer') && "_1tihidpf _12kpidpf"])
|
|
35
37
|
}, /*#__PURE__*/React.createElement(WidthProvider, null, /*#__PURE__*/React.createElement("div", {
|
|
36
38
|
className: ax(["_1skbgrf3", "_19segrf3 _1ki1grf3 _bmdegrf3 _166hgrf3 _7g1ogrf3 _sk2jgrf3 _hgeogrf3"])
|
|
37
39
|
}), props.children));
|
|
@@ -60,6 +60,8 @@ const clearNextSiblingBlockMarkMarginTopStyle = css({
|
|
|
60
60
|
});
|
|
61
61
|
export const LayoutSectionEmotion = props => {
|
|
62
62
|
const isLayoutColumnMenuEnabled = expValEqualsNoExposure('platform_editor_layout_column_menu', 'isEnabled', true);
|
|
63
|
+
// Pure rollout gate: no A/B exposure analysis is planned for this rendering switch.
|
|
64
|
+
const isLayoutColumnValignRenderingEnabled = expValEqualsNoExposure('platform_editor_layout_column_valign_rendering', 'isEnabled', true);
|
|
63
65
|
return jsx("div", {
|
|
64
66
|
"data-layout-column": true,
|
|
65
67
|
"data-column-width": props.width,
|
|
@@ -71,7 +73,7 @@ export const LayoutSectionEmotion = props => {
|
|
|
71
73
|
},
|
|
72
74
|
css: [
|
|
73
75
|
// Keep separate: Compiled crashes on ternary/object lookup here.
|
|
74
|
-
isLayoutColumnMenuEnabled && props.valign === 'middle' && verticalAlignMiddleStyles, isLayoutColumnMenuEnabled && props.valign === 'bottom' && verticalAlignBottomStyles, fg('platform_editor_fix_media_in_renderer') && multipleWrappedImagesStyle]
|
|
76
|
+
(isLayoutColumnValignRenderingEnabled || isLayoutColumnMenuEnabled) && props.valign === 'middle' && verticalAlignMiddleStyles, (isLayoutColumnValignRenderingEnabled || isLayoutColumnMenuEnabled) && props.valign === 'bottom' && verticalAlignBottomStyles, fg('platform_editor_fix_media_in_renderer') && multipleWrappedImagesStyle]
|
|
75
77
|
}, jsx(WidthProvider, null, jsx("div", {
|
|
76
78
|
css: [clearNextSiblingMarginTopStyle, clearNextSiblingBlockMarkMarginTopStyle]
|
|
77
79
|
}), props.children));
|
|
@@ -2,6 +2,10 @@ import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '@atlaskit/editor-common/anal
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import AnalyticsContext from '../../analytics/analyticsContext';
|
|
4
4
|
import { ElementSelection } from './element-selection';
|
|
5
|
+
|
|
6
|
+
// Ignored via go/ees005
|
|
7
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
8
|
+
const MAC_PLATFORM_REGEX = /Mac/;
|
|
5
9
|
export const useSelectAllTrap = () => {
|
|
6
10
|
const {
|
|
7
11
|
fireAnalyticsEvent
|
|
@@ -9,10 +13,7 @@ export const useSelectAllTrap = () => {
|
|
|
9
13
|
const ref = React.useRef(null);
|
|
10
14
|
const clicked = React.useRef(false);
|
|
11
15
|
const caught = React.useRef();
|
|
12
|
-
|
|
13
|
-
// Ignored via go/ees005
|
|
14
|
-
// eslint-disable-next-line require-unicode-regexp
|
|
15
|
-
const mac = typeof navigator !== 'undefined' ? /Mac/.test(navigator.platform) : false;
|
|
16
|
+
const mac = typeof navigator !== 'undefined' ? MAC_PLATFORM_REGEX.test(navigator.platform) : false;
|
|
16
17
|
const onKeyDown = React.useCallback(e => {
|
|
17
18
|
var _e$target, _e$target$matches;
|
|
18
19
|
const el = ref.current;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
/* eslint-disable jsdoc/require-jsdoc -- internal step helpers */
|
|
2
2
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
3
|
import { AddMarkStep } from '@atlaskit/editor-prosemirror/transform';
|
|
4
|
+
|
|
5
|
+
// Ignored via go/ees005
|
|
6
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
7
|
+
const MEDIA_OR_MEDIA_SINGLE_REGEX = /media|mediaSingle/;
|
|
4
8
|
export function getStartPos(element) {
|
|
5
9
|
return parseInt(element.dataset.rendererStartPos || '-1', 10);
|
|
6
10
|
}
|
|
@@ -224,10 +228,7 @@ export function getPosFromRange(range) {
|
|
|
224
228
|
const possibleMediaOrMediaSingleElement = findParent(startContainer);
|
|
225
229
|
|
|
226
230
|
// Video hover targets return media single, not media, thus, the extra check in condition.
|
|
227
|
-
const isMediaOrMediaSingle = possibleMediaOrMediaSingleElement &&
|
|
228
|
-
// Ignored via go/ees005
|
|
229
|
-
// eslint-disable-next-line require-unicode-regexp
|
|
230
|
-
/media|mediaSingle/.test(getNodeType(possibleMediaOrMediaSingleElement) || '');
|
|
231
|
+
const isMediaOrMediaSingle = possibleMediaOrMediaSingleElement && MEDIA_OR_MEDIA_SINGLE_REGEX.test(getNodeType(possibleMediaOrMediaSingleElement) || '');
|
|
231
232
|
if (isMediaOrMediaSingle) {
|
|
232
233
|
let pos;
|
|
233
234
|
const mediaSingleElement = getNodeType(possibleMediaOrMediaSingleElement) === 'mediaSingle' ? possibleMediaOrMediaSingleElement : findMediaParent(possibleMediaOrMediaSingleElement);
|
|
@@ -7,6 +7,10 @@ import { PLATFORM } from '../../analytics/events';
|
|
|
7
7
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
8
8
|
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
9
9
|
import uuid from 'uuid';
|
|
10
|
+
|
|
11
|
+
// Ignored via go/ees005
|
|
12
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
13
|
+
const FAILED_TO_EXECUTE_REGEX = /Failed to execute.*on 'Node'.*/;
|
|
10
14
|
// Ignored via go/ees005
|
|
11
15
|
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
12
16
|
export class ErrorBoundary extends React.Component {
|
|
@@ -51,10 +55,7 @@ export class ErrorBoundary extends React.Component {
|
|
|
51
55
|
logException(error, {
|
|
52
56
|
location: 'renderer'
|
|
53
57
|
});
|
|
54
|
-
|
|
55
|
-
// eslint-disable-next-line require-unicode-regexp
|
|
56
|
-
const pattern = /Failed to execute.*on 'Node'.*/;
|
|
57
|
-
const matchesPattern = pattern.test(error.message);
|
|
58
|
+
const matchesPattern = FAILED_TO_EXECUTE_REGEX.test(error.message);
|
|
58
59
|
if (matchesPattern) {
|
|
59
60
|
this.fireAnalyticsEvent({
|
|
60
61
|
action: ACTION.CAUGHT_DOM_ERROR,
|
|
@@ -94,10 +94,12 @@ const markStylesWithCommentsPanel = css({
|
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
96
|
});
|
|
97
|
+
|
|
98
|
+
// Ignored via go/ees005
|
|
99
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
100
|
+
const MOBILE_USER_AGENT_REGEX = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i;
|
|
97
101
|
const isMobile = () => {
|
|
98
|
-
|
|
99
|
-
// eslint-disable-next-line require-unicode-regexp
|
|
100
|
-
return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
|
|
102
|
+
return MOBILE_USER_AGENT_REGEX.test(navigator.userAgent);
|
|
101
103
|
};
|
|
102
104
|
const accessibilityStylesNew = css({
|
|
103
105
|
'&::before, &::after': {
|
|
@@ -22,6 +22,8 @@ var multipleWrappedImagesStyle = null;
|
|
|
22
22
|
var clearNextSiblingBlockMarkMarginTopStyle = null;
|
|
23
23
|
export var LayoutSectionCompiled = function LayoutSectionCompiled(props) {
|
|
24
24
|
var isLayoutColumnMenuEnabled = expValEqualsNoExposure('platform_editor_layout_column_menu', 'isEnabled', true);
|
|
25
|
+
// Pure rollout gate: no A/B exposure analysis is planned for this rendering switch.
|
|
26
|
+
var isLayoutColumnValignRenderingEnabled = expValEqualsNoExposure('platform_editor_layout_column_valign_rendering', 'isEnabled', true);
|
|
25
27
|
return /*#__PURE__*/React.createElement("div", {
|
|
26
28
|
"data-layout-column": true,
|
|
27
29
|
"data-column-width": props.width,
|
|
@@ -31,7 +33,7 @@ export var LayoutSectionCompiled = function LayoutSectionCompiled(props) {
|
|
|
31
33
|
style: {
|
|
32
34
|
flexBasis: "".concat(props.width, "%")
|
|
33
35
|
},
|
|
34
|
-
className: ax([isLayoutColumnMenuEnabled && props.valign === 'middle' && "_1e0c1txw _2lx21bp4 _1bah1h6o", isLayoutColumnMenuEnabled && props.valign === 'bottom' && "_1e0c1txw _2lx21bp4 _1bahesu3", fg('platform_editor_fix_media_in_renderer') && "_1tihidpf _12kpidpf"])
|
|
36
|
+
className: ax([(isLayoutColumnValignRenderingEnabled || isLayoutColumnMenuEnabled) && props.valign === 'middle' && "_1e0c1txw _2lx21bp4 _1bah1h6o", (isLayoutColumnValignRenderingEnabled || isLayoutColumnMenuEnabled) && props.valign === 'bottom' && "_1e0c1txw _2lx21bp4 _1bahesu3", fg('platform_editor_fix_media_in_renderer') && "_1tihidpf _12kpidpf"])
|
|
35
37
|
}, /*#__PURE__*/React.createElement(WidthProvider, null, /*#__PURE__*/React.createElement("div", {
|
|
36
38
|
className: ax(["_1skbgrf3", "_19segrf3 _1ki1grf3 _bmdegrf3 _166hgrf3 _7g1ogrf3 _sk2jgrf3 _hgeogrf3"])
|
|
37
39
|
}), props.children));
|
|
@@ -51,6 +51,8 @@ var clearNextSiblingBlockMarkMarginTopStyle = css(_defineProperty({}, "+ .fabric
|
|
|
51
51
|
}));
|
|
52
52
|
export var LayoutSectionEmotion = function LayoutSectionEmotion(props) {
|
|
53
53
|
var isLayoutColumnMenuEnabled = expValEqualsNoExposure('platform_editor_layout_column_menu', 'isEnabled', true);
|
|
54
|
+
// Pure rollout gate: no A/B exposure analysis is planned for this rendering switch.
|
|
55
|
+
var isLayoutColumnValignRenderingEnabled = expValEqualsNoExposure('platform_editor_layout_column_valign_rendering', 'isEnabled', true);
|
|
54
56
|
return jsx("div", {
|
|
55
57
|
"data-layout-column": true,
|
|
56
58
|
"data-column-width": props.width,
|
|
@@ -62,7 +64,7 @@ export var LayoutSectionEmotion = function LayoutSectionEmotion(props) {
|
|
|
62
64
|
},
|
|
63
65
|
css: [
|
|
64
66
|
// Keep separate: Compiled crashes on ternary/object lookup here.
|
|
65
|
-
isLayoutColumnMenuEnabled && props.valign === 'middle' && verticalAlignMiddleStyles, isLayoutColumnMenuEnabled && props.valign === 'bottom' && verticalAlignBottomStyles, fg('platform_editor_fix_media_in_renderer') && multipleWrappedImagesStyle]
|
|
67
|
+
(isLayoutColumnValignRenderingEnabled || isLayoutColumnMenuEnabled) && props.valign === 'middle' && verticalAlignMiddleStyles, (isLayoutColumnValignRenderingEnabled || isLayoutColumnMenuEnabled) && props.valign === 'bottom' && verticalAlignBottomStyles, fg('platform_editor_fix_media_in_renderer') && multipleWrappedImagesStyle]
|
|
66
68
|
}, jsx(WidthProvider, null, jsx("div", {
|
|
67
69
|
css: [clearNextSiblingMarginTopStyle, clearNextSiblingBlockMarkMarginTopStyle]
|
|
68
70
|
}), props.children));
|
|
@@ -2,16 +2,17 @@ import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '@atlaskit/editor-common/anal
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import AnalyticsContext from '../../analytics/analyticsContext';
|
|
4
4
|
import { ElementSelection } from './element-selection';
|
|
5
|
+
|
|
6
|
+
// Ignored via go/ees005
|
|
7
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
8
|
+
var MAC_PLATFORM_REGEX = /Mac/;
|
|
5
9
|
export var useSelectAllTrap = function useSelectAllTrap() {
|
|
6
10
|
var _React$useContext = React.useContext(AnalyticsContext),
|
|
7
11
|
fireAnalyticsEvent = _React$useContext.fireAnalyticsEvent;
|
|
8
12
|
var ref = React.useRef(null);
|
|
9
13
|
var clicked = React.useRef(false);
|
|
10
14
|
var caught = React.useRef();
|
|
11
|
-
|
|
12
|
-
// Ignored via go/ees005
|
|
13
|
-
// eslint-disable-next-line require-unicode-regexp
|
|
14
|
-
var mac = typeof navigator !== 'undefined' ? /Mac/.test(navigator.platform) : false;
|
|
15
|
+
var mac = typeof navigator !== 'undefined' ? MAC_PLATFORM_REGEX.test(navigator.platform) : false;
|
|
15
16
|
var onKeyDown = React.useCallback(function (e) {
|
|
16
17
|
var _e$target, _e$target$matches;
|
|
17
18
|
var el = ref.current;
|
package/dist/esm/steps/index.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
/* eslint-disable jsdoc/require-jsdoc -- internal step helpers */
|
|
2
2
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
3
|
import { AddMarkStep } from '@atlaskit/editor-prosemirror/transform';
|
|
4
|
+
|
|
5
|
+
// Ignored via go/ees005
|
|
6
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
7
|
+
var MEDIA_OR_MEDIA_SINGLE_REGEX = /media|mediaSingle/;
|
|
4
8
|
export function getStartPos(element) {
|
|
5
9
|
return parseInt(element.dataset.rendererStartPos || '-1', 10);
|
|
6
10
|
}
|
|
@@ -219,10 +223,7 @@ export function getPosFromRange(range) {
|
|
|
219
223
|
var possibleMediaOrMediaSingleElement = findParent(startContainer);
|
|
220
224
|
|
|
221
225
|
// Video hover targets return media single, not media, thus, the extra check in condition.
|
|
222
|
-
var isMediaOrMediaSingle = possibleMediaOrMediaSingleElement &&
|
|
223
|
-
// Ignored via go/ees005
|
|
224
|
-
// eslint-disable-next-line require-unicode-regexp
|
|
225
|
-
/media|mediaSingle/.test(getNodeType(possibleMediaOrMediaSingleElement) || '');
|
|
226
|
+
var isMediaOrMediaSingle = possibleMediaOrMediaSingleElement && MEDIA_OR_MEDIA_SINGLE_REGEX.test(getNodeType(possibleMediaOrMediaSingleElement) || '');
|
|
226
227
|
if (isMediaOrMediaSingle) {
|
|
227
228
|
var pos;
|
|
228
229
|
var mediaSingleElement = getNodeType(possibleMediaOrMediaSingleElement) === 'mediaSingle' ? possibleMediaOrMediaSingleElement : findMediaParent(possibleMediaOrMediaSingleElement);
|
|
@@ -14,6 +14,10 @@ import { PLATFORM } from '../../analytics/events';
|
|
|
14
14
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
15
15
|
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
16
16
|
import uuid from 'uuid';
|
|
17
|
+
|
|
18
|
+
// Ignored via go/ees005
|
|
19
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
20
|
+
var FAILED_TO_EXECUTE_REGEX = /Failed to execute.*on 'Node'.*/;
|
|
17
21
|
// Ignored via go/ees005
|
|
18
22
|
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
19
23
|
export var ErrorBoundary = /*#__PURE__*/function (_React$Component) {
|
|
@@ -72,10 +76,7 @@ export var ErrorBoundary = /*#__PURE__*/function (_React$Component) {
|
|
|
72
76
|
logException(error, {
|
|
73
77
|
location: 'renderer'
|
|
74
78
|
});
|
|
75
|
-
|
|
76
|
-
// eslint-disable-next-line require-unicode-regexp
|
|
77
|
-
var pattern = /Failed to execute.*on 'Node'.*/;
|
|
78
|
-
var matchesPattern = pattern.test(error.message);
|
|
79
|
+
var matchesPattern = FAILED_TO_EXECUTE_REGEX.test(error.message);
|
|
79
80
|
if (matchesPattern) {
|
|
80
81
|
this.fireAnalyticsEvent({
|
|
81
82
|
action: ACTION.CAUGHT_DOM_ERROR,
|
|
@@ -84,10 +84,12 @@ var markStylesWithCommentsPanel = css(_defineProperty({}, "&[data-mark-annotatio
|
|
|
84
84
|
boxShadow: "var(--ds-shadow-overlay, 0px 8px 12px #1E1F2126, 0px 0px 1px #1E1F214f)"
|
|
85
85
|
}
|
|
86
86
|
}));
|
|
87
|
+
|
|
88
|
+
// Ignored via go/ees005
|
|
89
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
90
|
+
var MOBILE_USER_AGENT_REGEX = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i;
|
|
87
91
|
var isMobile = function isMobile() {
|
|
88
|
-
|
|
89
|
-
// eslint-disable-next-line require-unicode-regexp
|
|
90
|
-
return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
|
|
92
|
+
return MOBILE_USER_AGENT_REGEX.test(navigator.userAgent);
|
|
91
93
|
};
|
|
92
94
|
var accessibilityStylesNew = css({
|
|
93
95
|
'&::before, &::after': {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/renderer",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "133.0.0",
|
|
4
4
|
"description": "Renderer component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -30,46 +30,46 @@
|
|
|
30
30
|
}
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@atlaskit/adf-schema": "^
|
|
34
|
-
"@atlaskit/adf-utils": "^
|
|
33
|
+
"@atlaskit/adf-schema": "^55.0.0",
|
|
34
|
+
"@atlaskit/adf-utils": "^20.0.0",
|
|
35
35
|
"@atlaskit/afm-i18n-platform-editor-renderer": "2.10.0",
|
|
36
|
-
"@atlaskit/analytics-listeners": "^
|
|
37
|
-
"@atlaskit/analytics-namespaced-context": "^
|
|
38
|
-
"@atlaskit/analytics-next": "^
|
|
39
|
-
"@atlaskit/browser-apis": "^0.0
|
|
40
|
-
"@atlaskit/button": "^
|
|
41
|
-
"@atlaskit/code": "^
|
|
42
|
-
"@atlaskit/editor-json-transformer": "^
|
|
43
|
-
"@atlaskit/editor-palette": "^
|
|
44
|
-
"@atlaskit/editor-prosemirror": "^
|
|
45
|
-
"@atlaskit/editor-shared-styles": "^
|
|
46
|
-
"@atlaskit/editor-smart-link-draggable": "^0.
|
|
47
|
-
"@atlaskit/emoji": "^
|
|
48
|
-
"@atlaskit/feature-gate-js-client": "^
|
|
49
|
-
"@atlaskit/icon": "^
|
|
50
|
-
"@atlaskit/link": "^
|
|
51
|
-
"@atlaskit/link-datasource": "^
|
|
52
|
-
"@atlaskit/link-extractors": "^
|
|
53
|
-
"@atlaskit/linking-common": "^
|
|
54
|
-
"@atlaskit/media-card": "^
|
|
55
|
-
"@atlaskit/media-client": "^
|
|
56
|
-
"@atlaskit/media-client-react": "^
|
|
57
|
-
"@atlaskit/media-common": "^
|
|
58
|
-
"@atlaskit/media-filmstrip": "^
|
|
59
|
-
"@atlaskit/media-ui": "^
|
|
60
|
-
"@atlaskit/media-viewer": "^
|
|
61
|
-
"@atlaskit/platform-feature-flags": "^
|
|
62
|
-
"@atlaskit/platform-feature-flags-react": "^0.
|
|
63
|
-
"@atlaskit/pragmatic-drag-and-drop": "^
|
|
64
|
-
"@atlaskit/react-ufo": "^
|
|
65
|
-
"@atlaskit/smart-card": "^
|
|
66
|
-
"@atlaskit/status": "^
|
|
67
|
-
"@atlaskit/task-decision": "^
|
|
68
|
-
"@atlaskit/theme": "^
|
|
69
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
70
|
-
"@atlaskit/tokens": "^
|
|
71
|
-
"@atlaskit/tooltip": "^
|
|
72
|
-
"@atlaskit/visually-hidden": "^
|
|
36
|
+
"@atlaskit/analytics-listeners": "^11.0.0",
|
|
37
|
+
"@atlaskit/analytics-namespaced-context": "^8.0.0",
|
|
38
|
+
"@atlaskit/analytics-next": "^12.0.0",
|
|
39
|
+
"@atlaskit/browser-apis": "^1.0.0",
|
|
40
|
+
"@atlaskit/button": "^24.0.0",
|
|
41
|
+
"@atlaskit/code": "^18.0.0",
|
|
42
|
+
"@atlaskit/editor-json-transformer": "^9.0.0",
|
|
43
|
+
"@atlaskit/editor-palette": "^3.0.0",
|
|
44
|
+
"@atlaskit/editor-prosemirror": "^8.0.0",
|
|
45
|
+
"@atlaskit/editor-shared-styles": "^4.0.0",
|
|
46
|
+
"@atlaskit/editor-smart-link-draggable": "^1.0.0",
|
|
47
|
+
"@atlaskit/emoji": "^71.0.0",
|
|
48
|
+
"@atlaskit/feature-gate-js-client": "^6.0.0",
|
|
49
|
+
"@atlaskit/icon": "^36.0.0",
|
|
50
|
+
"@atlaskit/link": "^4.0.0",
|
|
51
|
+
"@atlaskit/link-datasource": "^6.0.0",
|
|
52
|
+
"@atlaskit/link-extractors": "^3.0.0",
|
|
53
|
+
"@atlaskit/linking-common": "^10.0.0",
|
|
54
|
+
"@atlaskit/media-card": "^81.0.0",
|
|
55
|
+
"@atlaskit/media-client": "^37.0.0",
|
|
56
|
+
"@atlaskit/media-client-react": "^6.0.0",
|
|
57
|
+
"@atlaskit/media-common": "^14.0.0",
|
|
58
|
+
"@atlaskit/media-filmstrip": "^52.0.0",
|
|
59
|
+
"@atlaskit/media-ui": "^30.0.0",
|
|
60
|
+
"@atlaskit/media-viewer": "^54.0.0",
|
|
61
|
+
"@atlaskit/platform-feature-flags": "^2.0.0",
|
|
62
|
+
"@atlaskit/platform-feature-flags-react": "^1.0.0",
|
|
63
|
+
"@atlaskit/pragmatic-drag-and-drop": "^2.0.0",
|
|
64
|
+
"@atlaskit/react-ufo": "^7.0.0",
|
|
65
|
+
"@atlaskit/smart-card": "^45.0.0",
|
|
66
|
+
"@atlaskit/status": "^5.0.0",
|
|
67
|
+
"@atlaskit/task-decision": "^21.0.0",
|
|
68
|
+
"@atlaskit/theme": "^26.0.0",
|
|
69
|
+
"@atlaskit/tmp-editor-statsig": "^104.0.0",
|
|
70
|
+
"@atlaskit/tokens": "^14.0.0",
|
|
71
|
+
"@atlaskit/tooltip": "^23.0.0",
|
|
72
|
+
"@atlaskit/visually-hidden": "^4.0.0",
|
|
73
73
|
"@babel/runtime": "^7.0.0",
|
|
74
74
|
"@compiled/react": "^0.20.0",
|
|
75
75
|
"@emotion/react": "^11.7.1",
|
|
@@ -80,9 +80,9 @@
|
|
|
80
80
|
"uuid": "^3.1.0"
|
|
81
81
|
},
|
|
82
82
|
"peerDependencies": {
|
|
83
|
-
"@atlaskit/editor-common": "^
|
|
84
|
-
"@atlaskit/link-provider": "^
|
|
85
|
-
"@atlaskit/media-core": "^
|
|
83
|
+
"@atlaskit/editor-common": "^116.0.0",
|
|
84
|
+
"@atlaskit/link-provider": "^5.0.0",
|
|
85
|
+
"@atlaskit/media-core": "^38.0.0",
|
|
86
86
|
"react": "^18.2.0",
|
|
87
87
|
"react-dom": "^18.2.0",
|
|
88
88
|
"react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
|
|
@@ -90,20 +90,20 @@
|
|
|
90
90
|
"devDependencies": {
|
|
91
91
|
"@af/integration-testing": "workspace:^",
|
|
92
92
|
"@af/visual-regression": "workspace:^",
|
|
93
|
-
"@atlaskit/analytics-gas-types": "^
|
|
94
|
-
"@atlaskit/checkbox": "^
|
|
95
|
-
"@atlaskit/editor-card-provider": "^
|
|
96
|
-
"@atlaskit/link-provider": "^
|
|
97
|
-
"@atlaskit/link-test-helpers": "^
|
|
98
|
-
"@atlaskit/media-core": "^
|
|
93
|
+
"@atlaskit/analytics-gas-types": "^6.0.0",
|
|
94
|
+
"@atlaskit/checkbox": "^18.0.0",
|
|
95
|
+
"@atlaskit/editor-card-provider": "^7.0.0",
|
|
96
|
+
"@atlaskit/link-provider": "^5.0.0",
|
|
97
|
+
"@atlaskit/link-test-helpers": "^11.0.0",
|
|
98
|
+
"@atlaskit/media-core": "^38.0.0",
|
|
99
99
|
"@atlaskit/media-integration-test-helpers": "workspace:^",
|
|
100
|
-
"@atlaskit/media-test-helpers": "^
|
|
101
|
-
"@atlaskit/mention": "^
|
|
102
|
-
"@atlaskit/modal-dialog": "^
|
|
103
|
-
"@atlaskit/navigation-system": "^
|
|
104
|
-
"@atlaskit/profilecard": "^
|
|
105
|
-
"@atlaskit/side-nav-items": "^
|
|
106
|
-
"@atlaskit/util-data-test": "^
|
|
100
|
+
"@atlaskit/media-test-helpers": "^42.0.0",
|
|
101
|
+
"@atlaskit/mention": "^27.0.0",
|
|
102
|
+
"@atlaskit/modal-dialog": "^16.0.0",
|
|
103
|
+
"@atlaskit/navigation-system": "^10.0.0",
|
|
104
|
+
"@atlaskit/profilecard": "^26.0.0",
|
|
105
|
+
"@atlaskit/side-nav-items": "^2.0.0",
|
|
106
|
+
"@atlaskit/util-data-test": "^19.0.0",
|
|
107
107
|
"@atlassian/a11y-jest-testing": "^0.12.0",
|
|
108
108
|
"@atlassian/a11y-playwright-testing": "^0.10.0",
|
|
109
109
|
"@atlassian/feature-flags-test-utils": "^1.1.0",
|