@atlaskit/editor-common 111.1.0 → 111.2.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 +21 -0
- package/dist/cjs/analytics/types/enums.js +1 -0
- package/dist/cjs/experiences/experience-utils.js +22 -1
- package/dist/cjs/experiences/index.js +6 -0
- package/dist/cjs/ui/OverflowShadow/index.js +12 -1
- package/dist/cjs/utils/processRawValue.js +5 -1
- package/dist/es2019/analytics/types/enums.js +1 -0
- package/dist/es2019/experiences/experience-utils.js +21 -0
- package/dist/es2019/experiences/index.js +1 -1
- package/dist/es2019/ui/OverflowShadow/index.js +12 -1
- package/dist/es2019/utils/processRawValue.js +5 -1
- package/dist/esm/analytics/types/enums.js +1 -0
- package/dist/esm/experiences/experience-utils.js +21 -0
- package/dist/esm/experiences/index.js +1 -1
- package/dist/esm/ui/OverflowShadow/index.js +12 -1
- package/dist/esm/utils/processRawValue.js +5 -1
- package/dist/types/analytics/types/enums.d.ts +1 -0
- package/dist/types/experiences/experience-utils.d.ts +8 -0
- package/dist/types/experiences/index.d.ts +1 -1
- package/dist/types/types/type-ahead.d.ts +1 -0
- package/dist/types/ui/OverflowShadow/index.d.ts +1 -0
- package/dist/types-ts4.5/analytics/types/enums.d.ts +1 -0
- package/dist/types-ts4.5/experiences/experience-utils.d.ts +8 -0
- package/dist/types-ts4.5/experiences/index.d.ts +1 -1
- package/dist/types-ts4.5/types/type-ahead.d.ts +1 -0
- package/dist/types-ts4.5/ui/OverflowShadow/index.d.ts +1 -0
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 111.2.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`656adaeec9d0b`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/656adaeec9d0b) -
|
|
8
|
+
[ux] EDITOR-1665 add experience tracking for create sync block
|
|
9
|
+
|
|
10
|
+
## 111.2.0
|
|
11
|
+
|
|
12
|
+
### Minor Changes
|
|
13
|
+
|
|
14
|
+
- [`ba0e1d49e14cb`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/ba0e1d49e14cb) -
|
|
15
|
+
ENGHEALTH-40073: Make tables and extensions focusable if they have overscroll so that they can be
|
|
16
|
+
interacted with in an accessible way.
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- [`38bc4d5d6185c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/38bc4d5d6185c) -
|
|
21
|
+
Fixes nested tables in SSR renderer
|
|
22
|
+
- Updated dependencies
|
|
23
|
+
|
|
3
24
|
## 111.1.0
|
|
4
25
|
|
|
5
26
|
### Minor Changes
|
|
@@ -531,6 +531,7 @@ var ACTION_SUBJECT_ID = exports.ACTION_SUBJECT_ID = /*#__PURE__*/function (ACTIO
|
|
|
531
531
|
ACTION_SUBJECT_ID["SYNCED_BLOCK_UPDATE"] = "syncedBlockUpdate";
|
|
532
532
|
ACTION_SUBJECT_ID["REFERENCE_SYNCED_BLOCK_UPDATE"] = "referenceSyncedBlockUpdate";
|
|
533
533
|
ACTION_SUBJECT_ID["SYNCED_BLOCK_CREATE"] = "syncedBlockCreate";
|
|
534
|
+
ACTION_SUBJECT_ID["REFERENCE_SYNCED_BLOCK_CREATE"] = "referenceSyncedBlockCreate";
|
|
534
535
|
ACTION_SUBJECT_ID["SYNCED_BLOCK_DELETE"] = "syncedBlockDelete";
|
|
535
536
|
ACTION_SUBJECT_ID["SYNCED_BLOCK_GET_SOURCE_INFO"] = "syncedBlockGetSourceInfo";
|
|
536
537
|
ACTION_SUBJECT_ID["SYNCED_BLOCK_FETCH"] = "syncedBlockFetch";
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.getPopupContainerFromEditorView = exports.containsPopupWithNestedElement = void 0;
|
|
6
|
+
exports.popupWithNestedElement = exports.getPopupContainerFromEditorView = exports.containsPopupWithNestedElement = void 0;
|
|
7
7
|
/**
|
|
8
8
|
* Checks if a given node contains a popup with a nested element identified by a specific test ID.
|
|
9
9
|
*
|
|
@@ -25,6 +25,27 @@ var containsPopupWithNestedElement = exports.containsPopupWithNestedElement = fu
|
|
|
25
25
|
return !!node.querySelector(":scope > [data-editor-popup=\"true\"] ".concat(nestedElementQuery));
|
|
26
26
|
};
|
|
27
27
|
|
|
28
|
+
/**
|
|
29
|
+
* Returns the popup with a nested element identified by a specific test ID if it exists.
|
|
30
|
+
*
|
|
31
|
+
* @param node - The node to check.
|
|
32
|
+
* @param nestedElementQuery - The query to look for the nested element.
|
|
33
|
+
* @returns Element if the node contains the popup, undefined otherwise.
|
|
34
|
+
*/
|
|
35
|
+
var popupWithNestedElement = exports.popupWithNestedElement = function popupWithNestedElement(node, nestedElementQuery) {
|
|
36
|
+
if (!(node instanceof HTMLElement)) {
|
|
37
|
+
return undefined;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// Check if node itself has the popup attribute and contains the element matching the nestedElementQuery
|
|
41
|
+
if (node.matches('[data-editor-popup="true"]')) {
|
|
42
|
+
return node.querySelector(nestedElementQuery);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// Check if any direct child with popup attribute contains the element matching the nestedElementQuery
|
|
46
|
+
return node.querySelector(":scope > [data-editor-popup=\"true\"] ".concat(nestedElementQuery));
|
|
47
|
+
};
|
|
48
|
+
|
|
28
49
|
/**
|
|
29
50
|
* Searches for the popup container element relative to the provided editor view element.
|
|
30
51
|
*
|
|
@@ -51,6 +51,12 @@ Object.defineProperty(exports, "getPopupContainerFromEditorView", {
|
|
|
51
51
|
return _experienceUtils.getPopupContainerFromEditorView;
|
|
52
52
|
}
|
|
53
53
|
});
|
|
54
|
+
Object.defineProperty(exports, "popupWithNestedElement", {
|
|
55
|
+
enumerable: true,
|
|
56
|
+
get: function get() {
|
|
57
|
+
return _experienceUtils.popupWithNestedElement;
|
|
58
|
+
}
|
|
59
|
+
});
|
|
54
60
|
var _Experience = require("./Experience");
|
|
55
61
|
var _consts = require("./consts");
|
|
56
62
|
var _ExperienceCheckComposite = require("./ExperienceCheckComposite");
|
|
@@ -14,6 +14,7 @@ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/ge
|
|
|
14
14
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
15
15
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
16
16
|
var _react = _interopRequireDefault(require("react"));
|
|
17
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
17
18
|
var _shadowObserver = require("./shadowObserver");
|
|
18
19
|
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)); }
|
|
19
20
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
@@ -163,13 +164,23 @@ function overflowShadow(Component, options) {
|
|
|
163
164
|
showLeftShadow = _this$state.showLeftShadow,
|
|
164
165
|
showRightShadow = _this$state.showRightShadow;
|
|
165
166
|
var classNames = [!((_this$props = this.props) !== null && _this$props !== void 0 && _this$props.disableTableOverflowShadow) && showRightShadow && shadowClassNames.RIGHT_SHADOW, !((_this$props2 = this.props) !== null && _this$props2 !== void 0 && _this$props2.disableTableOverflowShadow) && showLeftShadow && shadowClassNames.LEFT_SHADOW, options.useShadowObserver && _shadowObserver.shadowObserverClassNames.SHADOW_CONTAINER].filter(Boolean).join(' ');
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* The widths have already been calculated to determine
|
|
170
|
+
* showRightShadow and showLeftShadow. If either is true,
|
|
171
|
+
* then the content is scrollable and we need to set the
|
|
172
|
+
* tabIndex to 0 to allow the user to scroll the content
|
|
173
|
+
* for a11y purposes.
|
|
174
|
+
*/
|
|
175
|
+
var hasOverflowScroll = showRightShadow || showLeftShadow;
|
|
166
176
|
return (
|
|
167
177
|
/*#__PURE__*/
|
|
168
178
|
// Ignored via go/ees005
|
|
169
|
-
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
170
179
|
_react.default.createElement(Component, (0, _extends2.default)({
|
|
171
180
|
handleRef: this.handleContainer,
|
|
181
|
+
tabIndex: hasOverflowScroll && (0, _platformFeatureFlags.fg)('platform_editor_dec_a11y_fixes') ? 0 : undefined,
|
|
172
182
|
shadowClassNames: classNames
|
|
183
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
173
184
|
}, this.props))
|
|
174
185
|
);
|
|
175
186
|
}
|
|
@@ -11,6 +11,7 @@ var _model = require("@atlaskit/editor-prosemirror/model");
|
|
|
11
11
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
12
12
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
13
13
|
var _analytics = require("../analytics");
|
|
14
|
+
var _utilities = require("../nesting/utilities");
|
|
14
15
|
var _privacyFilter = require("./filter/privacy-filter");
|
|
15
16
|
var _trackUnsupportedContent = require("./track-unsupported-content");
|
|
16
17
|
var _validateUsingSpec = require("./validate-using-spec");
|
|
@@ -234,7 +235,10 @@ function processRawValue(schema, value, providerFactory, sanitizePrivateContent,
|
|
|
234
235
|
if ((0, _expValEquals.expValEquals)('platform_editor_ssr_renderer', 'isEnabled', true)) {
|
|
235
236
|
// Validate ADF first before converting nested-table extensions into nested tables
|
|
236
237
|
// This matches the renderer's behavior in render-document.ts
|
|
237
|
-
|
|
238
|
+
var allowNestedTables = (0, _utilities.isNestedTablesSupported)(schema);
|
|
239
|
+
entity = (0, _validateUsingSpec.validateADFEntity)(schema, transformedAdf || node, dispatchAnalyticsEvent, allowNestedTables ? {
|
|
240
|
+
allowNestedTables: allowNestedTables
|
|
241
|
+
} : undefined);
|
|
238
242
|
|
|
239
243
|
// Convert nested-table extensions into nested tables
|
|
240
244
|
var _transformNestedTable3 = transformNestedTablesWithAnalytics(entity, dispatchAnalyticsEvent);
|
|
@@ -525,6 +525,7 @@ export let ACTION_SUBJECT_ID = /*#__PURE__*/function (ACTION_SUBJECT_ID) {
|
|
|
525
525
|
ACTION_SUBJECT_ID["SYNCED_BLOCK_UPDATE"] = "syncedBlockUpdate";
|
|
526
526
|
ACTION_SUBJECT_ID["REFERENCE_SYNCED_BLOCK_UPDATE"] = "referenceSyncedBlockUpdate";
|
|
527
527
|
ACTION_SUBJECT_ID["SYNCED_BLOCK_CREATE"] = "syncedBlockCreate";
|
|
528
|
+
ACTION_SUBJECT_ID["REFERENCE_SYNCED_BLOCK_CREATE"] = "referenceSyncedBlockCreate";
|
|
528
529
|
ACTION_SUBJECT_ID["SYNCED_BLOCK_DELETE"] = "syncedBlockDelete";
|
|
529
530
|
ACTION_SUBJECT_ID["SYNCED_BLOCK_GET_SOURCE_INFO"] = "syncedBlockGetSourceInfo";
|
|
530
531
|
ACTION_SUBJECT_ID["SYNCED_BLOCK_FETCH"] = "syncedBlockFetch";
|
|
@@ -19,6 +19,27 @@ export const containsPopupWithNestedElement = (node, nestedElementQuery) => {
|
|
|
19
19
|
return !!node.querySelector(`:scope > [data-editor-popup="true"] ${nestedElementQuery}`);
|
|
20
20
|
};
|
|
21
21
|
|
|
22
|
+
/**
|
|
23
|
+
* Returns the popup with a nested element identified by a specific test ID if it exists.
|
|
24
|
+
*
|
|
25
|
+
* @param node - The node to check.
|
|
26
|
+
* @param nestedElementQuery - The query to look for the nested element.
|
|
27
|
+
* @returns Element if the node contains the popup, undefined otherwise.
|
|
28
|
+
*/
|
|
29
|
+
export const popupWithNestedElement = (node, nestedElementQuery) => {
|
|
30
|
+
if (!(node instanceof HTMLElement)) {
|
|
31
|
+
return undefined;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// Check if node itself has the popup attribute and contains the element matching the nestedElementQuery
|
|
35
|
+
if (node.matches('[data-editor-popup="true"]')) {
|
|
36
|
+
return node.querySelector(nestedElementQuery);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// Check if any direct child with popup attribute contains the element matching the nestedElementQuery
|
|
40
|
+
return node.querySelector(`:scope > [data-editor-popup="true"] ${nestedElementQuery}`);
|
|
41
|
+
};
|
|
42
|
+
|
|
22
43
|
/**
|
|
23
44
|
* Searches for the popup container element relative to the provided editor view element.
|
|
24
45
|
*
|
|
@@ -6,4 +6,4 @@ export { EXPERIENCE_ABORT_REASON, EXPERIENCE_FAILURE_REASON } from './consts';
|
|
|
6
6
|
export { ExperienceCheckComposite } from './ExperienceCheckComposite';
|
|
7
7
|
export { ExperienceCheckDomMutation } from './ExperienceCheckDomMutation';
|
|
8
8
|
export { ExperienceCheckTimeout } from './ExperienceCheckTimeout';
|
|
9
|
-
export { containsPopupWithNestedElement, getPopupContainerFromEditorView } from './experience-utils';
|
|
9
|
+
export { containsPopupWithNestedElement, popupWithNestedElement, getPopupContainerFromEditorView } from './experience-utils';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
3
|
import React from 'react';
|
|
4
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
5
|
import { ShadowObserver, shadowObserverClassNames } from './shadowObserver';
|
|
5
6
|
export const shadowClassNames = {
|
|
6
7
|
RIGHT_SHADOW: 'right-shadow',
|
|
@@ -135,13 +136,23 @@ export default function overflowShadow(Component, options) {
|
|
|
135
136
|
showRightShadow
|
|
136
137
|
} = this.state;
|
|
137
138
|
const classNames = [!((_this$props = this.props) !== null && _this$props !== void 0 && _this$props.disableTableOverflowShadow) && showRightShadow && shadowClassNames.RIGHT_SHADOW, !((_this$props2 = this.props) !== null && _this$props2 !== void 0 && _this$props2.disableTableOverflowShadow) && showLeftShadow && shadowClassNames.LEFT_SHADOW, options.useShadowObserver && shadowObserverClassNames.SHADOW_CONTAINER].filter(Boolean).join(' ');
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* The widths have already been calculated to determine
|
|
142
|
+
* showRightShadow and showLeftShadow. If either is true,
|
|
143
|
+
* then the content is scrollable and we need to set the
|
|
144
|
+
* tabIndex to 0 to allow the user to scroll the content
|
|
145
|
+
* for a11y purposes.
|
|
146
|
+
*/
|
|
147
|
+
const hasOverflowScroll = showRightShadow || showLeftShadow;
|
|
138
148
|
return (
|
|
139
149
|
/*#__PURE__*/
|
|
140
150
|
// Ignored via go/ees005
|
|
141
|
-
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
142
151
|
React.createElement(Component, _extends({
|
|
143
152
|
handleRef: this.handleContainer,
|
|
153
|
+
tabIndex: hasOverflowScroll && fg('platform_editor_dec_a11y_fixes') ? 0 : undefined,
|
|
144
154
|
shadowClassNames: classNames
|
|
155
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
145
156
|
}, this.props))
|
|
146
157
|
);
|
|
147
158
|
}
|
|
@@ -3,6 +3,7 @@ import { Fragment, Node } from '@atlaskit/editor-prosemirror/model';
|
|
|
3
3
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
4
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
5
5
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '../analytics';
|
|
6
|
+
import { isNestedTablesSupported } from '../nesting/utilities';
|
|
6
7
|
import { sanitizeNodeForPrivacy } from './filter/privacy-filter';
|
|
7
8
|
import { findAndTrackUnsupportedContentNodes } from './track-unsupported-content';
|
|
8
9
|
import { validateADFEntity } from './validate-using-spec';
|
|
@@ -233,7 +234,10 @@ export function processRawValue(schema, value, providerFactory, sanitizePrivateC
|
|
|
233
234
|
if (expValEquals('platform_editor_ssr_renderer', 'isEnabled', true)) {
|
|
234
235
|
// Validate ADF first before converting nested-table extensions into nested tables
|
|
235
236
|
// This matches the renderer's behavior in render-document.ts
|
|
236
|
-
|
|
237
|
+
const allowNestedTables = isNestedTablesSupported(schema);
|
|
238
|
+
entity = validateADFEntity(schema, transformedAdf || node, dispatchAnalyticsEvent, allowNestedTables ? {
|
|
239
|
+
allowNestedTables
|
|
240
|
+
} : undefined);
|
|
237
241
|
|
|
238
242
|
// Convert nested-table extensions into nested tables
|
|
239
243
|
({
|
|
@@ -525,6 +525,7 @@ export var ACTION_SUBJECT_ID = /*#__PURE__*/function (ACTION_SUBJECT_ID) {
|
|
|
525
525
|
ACTION_SUBJECT_ID["SYNCED_BLOCK_UPDATE"] = "syncedBlockUpdate";
|
|
526
526
|
ACTION_SUBJECT_ID["REFERENCE_SYNCED_BLOCK_UPDATE"] = "referenceSyncedBlockUpdate";
|
|
527
527
|
ACTION_SUBJECT_ID["SYNCED_BLOCK_CREATE"] = "syncedBlockCreate";
|
|
528
|
+
ACTION_SUBJECT_ID["REFERENCE_SYNCED_BLOCK_CREATE"] = "referenceSyncedBlockCreate";
|
|
528
529
|
ACTION_SUBJECT_ID["SYNCED_BLOCK_DELETE"] = "syncedBlockDelete";
|
|
529
530
|
ACTION_SUBJECT_ID["SYNCED_BLOCK_GET_SOURCE_INFO"] = "syncedBlockGetSourceInfo";
|
|
530
531
|
ACTION_SUBJECT_ID["SYNCED_BLOCK_FETCH"] = "syncedBlockFetch";
|
|
@@ -19,6 +19,27 @@ export var containsPopupWithNestedElement = function containsPopupWithNestedElem
|
|
|
19
19
|
return !!node.querySelector(":scope > [data-editor-popup=\"true\"] ".concat(nestedElementQuery));
|
|
20
20
|
};
|
|
21
21
|
|
|
22
|
+
/**
|
|
23
|
+
* Returns the popup with a nested element identified by a specific test ID if it exists.
|
|
24
|
+
*
|
|
25
|
+
* @param node - The node to check.
|
|
26
|
+
* @param nestedElementQuery - The query to look for the nested element.
|
|
27
|
+
* @returns Element if the node contains the popup, undefined otherwise.
|
|
28
|
+
*/
|
|
29
|
+
export var popupWithNestedElement = function popupWithNestedElement(node, nestedElementQuery) {
|
|
30
|
+
if (!(node instanceof HTMLElement)) {
|
|
31
|
+
return undefined;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// Check if node itself has the popup attribute and contains the element matching the nestedElementQuery
|
|
35
|
+
if (node.matches('[data-editor-popup="true"]')) {
|
|
36
|
+
return node.querySelector(nestedElementQuery);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// Check if any direct child with popup attribute contains the element matching the nestedElementQuery
|
|
40
|
+
return node.querySelector(":scope > [data-editor-popup=\"true\"] ".concat(nestedElementQuery));
|
|
41
|
+
};
|
|
42
|
+
|
|
22
43
|
/**
|
|
23
44
|
* Searches for the popup container element relative to the provided editor view element.
|
|
24
45
|
*
|
|
@@ -6,4 +6,4 @@ export { EXPERIENCE_ABORT_REASON, EXPERIENCE_FAILURE_REASON } from './consts';
|
|
|
6
6
|
export { ExperienceCheckComposite } from './ExperienceCheckComposite';
|
|
7
7
|
export { ExperienceCheckDomMutation } from './ExperienceCheckDomMutation';
|
|
8
8
|
export { ExperienceCheckTimeout } from './ExperienceCheckTimeout';
|
|
9
|
-
export { containsPopupWithNestedElement, getPopupContainerFromEditorView } from './experience-utils';
|
|
9
|
+
export { containsPopupWithNestedElement, popupWithNestedElement, getPopupContainerFromEditorView } from './experience-utils';
|
|
@@ -8,6 +8,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
8
8
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
9
9
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
10
10
|
import React from 'react';
|
|
11
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
11
12
|
import { ShadowObserver, shadowObserverClassNames } from './shadowObserver';
|
|
12
13
|
export var shadowClassNames = {
|
|
13
14
|
RIGHT_SHADOW: 'right-shadow',
|
|
@@ -155,13 +156,23 @@ export default function overflowShadow(Component, options) {
|
|
|
155
156
|
showLeftShadow = _this$state.showLeftShadow,
|
|
156
157
|
showRightShadow = _this$state.showRightShadow;
|
|
157
158
|
var classNames = [!((_this$props = this.props) !== null && _this$props !== void 0 && _this$props.disableTableOverflowShadow) && showRightShadow && shadowClassNames.RIGHT_SHADOW, !((_this$props2 = this.props) !== null && _this$props2 !== void 0 && _this$props2.disableTableOverflowShadow) && showLeftShadow && shadowClassNames.LEFT_SHADOW, options.useShadowObserver && shadowObserverClassNames.SHADOW_CONTAINER].filter(Boolean).join(' ');
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* The widths have already been calculated to determine
|
|
162
|
+
* showRightShadow and showLeftShadow. If either is true,
|
|
163
|
+
* then the content is scrollable and we need to set the
|
|
164
|
+
* tabIndex to 0 to allow the user to scroll the content
|
|
165
|
+
* for a11y purposes.
|
|
166
|
+
*/
|
|
167
|
+
var hasOverflowScroll = showRightShadow || showLeftShadow;
|
|
158
168
|
return (
|
|
159
169
|
/*#__PURE__*/
|
|
160
170
|
// Ignored via go/ees005
|
|
161
|
-
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
162
171
|
React.createElement(Component, _extends({
|
|
163
172
|
handleRef: this.handleContainer,
|
|
173
|
+
tabIndex: hasOverflowScroll && fg('platform_editor_dec_a11y_fixes') ? 0 : undefined,
|
|
164
174
|
shadowClassNames: classNames
|
|
175
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
165
176
|
}, this.props))
|
|
166
177
|
);
|
|
167
178
|
}
|
|
@@ -3,6 +3,7 @@ import { Fragment, Node } from '@atlaskit/editor-prosemirror/model';
|
|
|
3
3
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
4
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
5
5
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '../analytics';
|
|
6
|
+
import { isNestedTablesSupported } from '../nesting/utilities';
|
|
6
7
|
import { sanitizeNodeForPrivacy } from './filter/privacy-filter';
|
|
7
8
|
import { findAndTrackUnsupportedContentNodes } from './track-unsupported-content';
|
|
8
9
|
import { validateADFEntity } from './validate-using-spec';
|
|
@@ -226,7 +227,10 @@ export function processRawValue(schema, value, providerFactory, sanitizePrivateC
|
|
|
226
227
|
if (expValEquals('platform_editor_ssr_renderer', 'isEnabled', true)) {
|
|
227
228
|
// Validate ADF first before converting nested-table extensions into nested tables
|
|
228
229
|
// This matches the renderer's behavior in render-document.ts
|
|
229
|
-
|
|
230
|
+
var allowNestedTables = isNestedTablesSupported(schema);
|
|
231
|
+
entity = validateADFEntity(schema, transformedAdf || node, dispatchAnalyticsEvent, allowNestedTables ? {
|
|
232
|
+
allowNestedTables: allowNestedTables
|
|
233
|
+
} : undefined);
|
|
230
234
|
|
|
231
235
|
// Convert nested-table extensions into nested tables
|
|
232
236
|
var _transformNestedTable3 = transformNestedTablesWithAnalytics(entity, dispatchAnalyticsEvent);
|
|
@@ -517,6 +517,7 @@ export declare enum ACTION_SUBJECT_ID {
|
|
|
517
517
|
SYNCED_BLOCK_UPDATE = "syncedBlockUpdate",
|
|
518
518
|
REFERENCE_SYNCED_BLOCK_UPDATE = "referenceSyncedBlockUpdate",
|
|
519
519
|
SYNCED_BLOCK_CREATE = "syncedBlockCreate",
|
|
520
|
+
REFERENCE_SYNCED_BLOCK_CREATE = "referenceSyncedBlockCreate",
|
|
520
521
|
SYNCED_BLOCK_DELETE = "syncedBlockDelete",
|
|
521
522
|
SYNCED_BLOCK_GET_SOURCE_INFO = "syncedBlockGetSourceInfo",
|
|
522
523
|
SYNCED_BLOCK_FETCH = "syncedBlockFetch"
|
|
@@ -6,6 +6,14 @@
|
|
|
6
6
|
* @returns True if the node contains the popup, false otherwise.
|
|
7
7
|
*/
|
|
8
8
|
export declare const containsPopupWithNestedElement: (node: Node | null | undefined, nestedElementQuery: string) => boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Returns the popup with a nested element identified by a specific test ID if it exists.
|
|
11
|
+
*
|
|
12
|
+
* @param node - The node to check.
|
|
13
|
+
* @param nestedElementQuery - The query to look for the nested element.
|
|
14
|
+
* @returns Element if the node contains the popup, undefined otherwise.
|
|
15
|
+
*/
|
|
16
|
+
export declare const popupWithNestedElement: (node: Node | null | undefined, nestedElementQuery: string) => Element | null | undefined;
|
|
9
17
|
/**
|
|
10
18
|
* Searches for the popup container element relative to the provided editor view element.
|
|
11
19
|
*
|
|
@@ -5,4 +5,4 @@ export { ExperienceCheckDomMutation } from './ExperienceCheckDomMutation';
|
|
|
5
5
|
export { ExperienceCheckTimeout } from './ExperienceCheckTimeout';
|
|
6
6
|
export type { ExperienceCheck, ExperienceCheckCallback, ExperienceCheckResult, } from './ExperienceCheck';
|
|
7
7
|
export type { ExperienceCheckDomMutationConfig, ExperienceCheckDomMutationObserveConfig, ExperienceDomMutationCheckOptions, } from './ExperienceCheckDomMutation';
|
|
8
|
-
export { containsPopupWithNestedElement, getPopupContainerFromEditorView, } from './experience-utils';
|
|
8
|
+
export { containsPopupWithNestedElement, popupWithNestedElement, getPopupContainerFromEditorView, } from './experience-utils';
|
|
@@ -41,6 +41,7 @@ export type TypeAheadItem = {
|
|
|
41
41
|
keyshortcut?: string;
|
|
42
42
|
lozenge?: ReactNode;
|
|
43
43
|
render?: (props: TypeAheadItemRenderProps) => React.ReactElement<TypeAheadItemRenderProps> | null;
|
|
44
|
+
testId?: string;
|
|
44
45
|
title: string;
|
|
45
46
|
};
|
|
46
47
|
export type TypeAheadForceSelect = (props: TypeAheadForceSelectProps) => TypeAheadItem | undefined;
|
|
@@ -517,6 +517,7 @@ export declare enum ACTION_SUBJECT_ID {
|
|
|
517
517
|
SYNCED_BLOCK_UPDATE = "syncedBlockUpdate",
|
|
518
518
|
REFERENCE_SYNCED_BLOCK_UPDATE = "referenceSyncedBlockUpdate",
|
|
519
519
|
SYNCED_BLOCK_CREATE = "syncedBlockCreate",
|
|
520
|
+
REFERENCE_SYNCED_BLOCK_CREATE = "referenceSyncedBlockCreate",
|
|
520
521
|
SYNCED_BLOCK_DELETE = "syncedBlockDelete",
|
|
521
522
|
SYNCED_BLOCK_GET_SOURCE_INFO = "syncedBlockGetSourceInfo",
|
|
522
523
|
SYNCED_BLOCK_FETCH = "syncedBlockFetch"
|
|
@@ -6,6 +6,14 @@
|
|
|
6
6
|
* @returns True if the node contains the popup, false otherwise.
|
|
7
7
|
*/
|
|
8
8
|
export declare const containsPopupWithNestedElement: (node: Node | null | undefined, nestedElementQuery: string) => boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Returns the popup with a nested element identified by a specific test ID if it exists.
|
|
11
|
+
*
|
|
12
|
+
* @param node - The node to check.
|
|
13
|
+
* @param nestedElementQuery - The query to look for the nested element.
|
|
14
|
+
* @returns Element if the node contains the popup, undefined otherwise.
|
|
15
|
+
*/
|
|
16
|
+
export declare const popupWithNestedElement: (node: Node | null | undefined, nestedElementQuery: string) => Element | null | undefined;
|
|
9
17
|
/**
|
|
10
18
|
* Searches for the popup container element relative to the provided editor view element.
|
|
11
19
|
*
|
|
@@ -5,4 +5,4 @@ export { ExperienceCheckDomMutation } from './ExperienceCheckDomMutation';
|
|
|
5
5
|
export { ExperienceCheckTimeout } from './ExperienceCheckTimeout';
|
|
6
6
|
export type { ExperienceCheck, ExperienceCheckCallback, ExperienceCheckResult, } from './ExperienceCheck';
|
|
7
7
|
export type { ExperienceCheckDomMutationConfig, ExperienceCheckDomMutationObserveConfig, ExperienceDomMutationCheckOptions, } from './ExperienceCheckDomMutation';
|
|
8
|
-
export { containsPopupWithNestedElement, getPopupContainerFromEditorView, } from './experience-utils';
|
|
8
|
+
export { containsPopupWithNestedElement, popupWithNestedElement, getPopupContainerFromEditorView, } from './experience-utils';
|
|
@@ -41,6 +41,7 @@ export type TypeAheadItem = {
|
|
|
41
41
|
keyshortcut?: string;
|
|
42
42
|
lozenge?: ReactNode;
|
|
43
43
|
render?: (props: TypeAheadItemRenderProps) => React.ReactElement<TypeAheadItemRenderProps> | null;
|
|
44
|
+
testId?: string;
|
|
44
45
|
title: string;
|
|
45
46
|
};
|
|
46
47
|
export type TypeAheadForceSelect = (props: TypeAheadForceSelectProps) => TypeAheadItem | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "111.1
|
|
3
|
+
"version": "111.2.1",
|
|
4
4
|
"description": "A package that contains common classes and components for editor and renderer",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -75,13 +75,13 @@
|
|
|
75
75
|
"@atlaskit/react-ufo": "^4.16.0",
|
|
76
76
|
"@atlaskit/section-message": "^8.11.0",
|
|
77
77
|
"@atlaskit/smart-card": "^43.18.0",
|
|
78
|
-
"@atlaskit/smart-user-picker": "^8.
|
|
78
|
+
"@atlaskit/smart-user-picker": "^8.6.0",
|
|
79
79
|
"@atlaskit/spinner": "^19.0.0",
|
|
80
80
|
"@atlaskit/status": "^3.0.0",
|
|
81
81
|
"@atlaskit/task-decision": "^19.2.0",
|
|
82
82
|
"@atlaskit/textfield": "^8.2.0",
|
|
83
83
|
"@atlaskit/theme": "^21.0.0",
|
|
84
|
-
"@atlaskit/tmp-editor-statsig": "^16.
|
|
84
|
+
"@atlaskit/tmp-editor-statsig": "^16.4.0",
|
|
85
85
|
"@atlaskit/tokens": "^9.0.0",
|
|
86
86
|
"@atlaskit/tooltip": "^20.11.0",
|
|
87
87
|
"@atlaskit/width-detector": "^5.0.0",
|