@atlaskit/editor-common 75.5.0 → 75.5.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 +13 -0
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/styles/shared/shadow.js +2 -1
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/ui/Popup/index.js +5 -1
- package/dist/cjs/utils/index.js +17 -2
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/styles/shared/shadow.js +5 -2
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/ui/Popup/index.js +5 -1
- package/dist/es2019/utils/index.js +19 -1
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/styles/shared/shadow.js +2 -1
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/ui/Popup/index.js +5 -1
- package/dist/esm/utils/index.js +16 -1
- package/dist/types/ui/Popup/index.d.ts +3 -2
- package/dist/types/ui-menu/ToolbarButton/index.d.ts +1 -1
- package/dist/types/utils/index.d.ts +1 -0
- package/dist/types-ts4.5/ui/Popup/index.d.ts +3 -2
- package/dist/types-ts4.5/ui-menu/ToolbarButton/index.d.ts +1 -1
- package/dist/types-ts4.5/utils/index.d.ts +1 -0
- package/package.json +5 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 75.5.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`d5088ec1cdf`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d5088ec1cdf) - [ED-16733] Prepare Media plugin for extraction
|
|
8
|
+
- [`05b9c2db1dc`](https://bitbucket.org/atlassian/atlassian-frontend/commits/05b9c2db1dc) - [ux] Increase visibility of table scroll shadows
|
|
9
|
+
|
|
10
|
+
## 75.5.1
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- [`966f90e1edf`](https://bitbucket.org/atlassian/atlassian-frontend/commits/966f90e1edf) - [ux] [ECA11Y-44] Adjust 'Popup' component so that it doesn't always have to have 'aria-label' attribute displayed
|
|
15
|
+
|
|
3
16
|
## 75.5.0
|
|
4
17
|
|
|
5
18
|
### Minor Changes
|
|
@@ -16,7 +16,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
16
16
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
17
17
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
18
18
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
19
|
-
var packageVersion = "75.5.
|
|
19
|
+
var packageVersion = "75.5.2";
|
|
20
20
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
21
21
|
// Remove URL as it has UGC
|
|
22
22
|
// TODO: Sanitise the URL instead of just removing it
|
|
@@ -8,6 +8,7 @@ exports.shadowSharedStyle = void 0;
|
|
|
8
8
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
9
9
|
var _react = require("@emotion/react");
|
|
10
10
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
11
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
11
12
|
var _colors = require("@atlaskit/theme/colors");
|
|
12
13
|
var _OverflowShadow = require("../../ui/OverflowShadow");
|
|
13
14
|
var _shadowObserver = require("../../ui/OverflowShadow/shadowObserver");
|
|
@@ -29,5 +30,5 @@ var shadowWidth = 8;
|
|
|
29
30
|
* background-attachment: local, local, scroll, scroll;
|
|
30
31
|
*/
|
|
31
32
|
|
|
32
|
-
var shadowSharedStyle = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n &\n .", "::before,\n .", "::after,\n .", "::before,\n .", "::after {\n display: none;\n position: absolute;\n pointer-events: none;\n z-index: ", ";\n width: ", "px;\n content: '';\n /* Scrollbar is outside the content in IE, inset in other browsers. */\n height: calc(100%);\n }\n\n & .", ", .", " {\n position: relative;\n }\n\n & .", "::before {\n background: linear-gradient(\n to left,\n transparent 0,\n ", "
|
|
33
|
+
var shadowSharedStyle = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n &\n .", "::before,\n .", "::after,\n .", "::before,\n .", "::after {\n display: none;\n position: absolute;\n pointer-events: none;\n z-index: ", ";\n width: ", "px;\n content: '';\n /* Scrollbar is outside the content in IE, inset in other browsers. */\n height: calc(100%);\n }\n\n & .", ", .", " {\n position: relative;\n }\n\n & .", "::before {\n background: linear-gradient(\n to left,\n transparent 0,\n ", "\n ", "%\n ),\n linear-gradient(\n to right,\n ", " 0px,\n transparent 1px\n );\n top: 0px;\n left: 0;\n display: block;\n }\n\n & .", "::after {\n background: linear-gradient(\n to right,\n transparent 0,\n ", "\n ", "%\n ),\n linear-gradient(\n to left,\n ", " 0px,\n transparent 1px\n );\n left: calc(100% - ", "px);\n top: 0px;\n display: block;\n }\n\n & .", " {\n height: 100%;\n width: 0px;\n min-width: 0px;\n }\n\n & .", " {\n height: 100%;\n width: 0px;\n min-width: 0px;\n }\n"])), _OverflowShadow.shadowClassNames.RIGHT_SHADOW, _OverflowShadow.shadowClassNames.RIGHT_SHADOW, _OverflowShadow.shadowClassNames.LEFT_SHADOW, _OverflowShadow.shadowClassNames.LEFT_SHADOW, _editorSharedStyles.akEditorShadowZIndex, shadowWidth, _OverflowShadow.shadowClassNames.RIGHT_SHADOW, _OverflowShadow.shadowClassNames.LEFT_SHADOW, _OverflowShadow.shadowClassNames.LEFT_SHADOW, "var(--ds-shadow-overflow-spread, ".concat(_colors.N40A, ")"), (0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.increase-shadow-visibility_lh89r') ? 140 : 100, "var(--ds-shadow-overflow-perimeter, transparent)", _OverflowShadow.shadowClassNames.RIGHT_SHADOW, "var(--ds-shadow-overflow-spread, ".concat(_colors.N40A, ")"), (0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.increase-shadow-visibility_lh89r') ? 140 : 100, "var(--ds-shadow-overflow-perimeter, transparent)", shadowWidth, _shadowObserver.shadowObserverClassNames.SENTINEL_LEFT, _shadowObserver.shadowObserverClassNames.SENTINEL_RIGHT);
|
|
33
34
|
exports.shadowSharedStyle = shadowSharedStyle;
|
|
@@ -24,7 +24,7 @@ var _templateObject, _templateObject2, _templateObject3;
|
|
|
24
24
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
25
25
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } /** @jsx jsx */
|
|
26
26
|
var packageName = "@atlaskit/editor-common";
|
|
27
|
-
var packageVersion = "75.5.
|
|
27
|
+
var packageVersion = "75.5.2";
|
|
28
28
|
var halfFocusRing = 1;
|
|
29
29
|
var dropOffset = '0, 8';
|
|
30
30
|
var DropList = /*#__PURE__*/function (_Component) {
|
|
@@ -272,13 +272,17 @@ var Popup = /*#__PURE__*/function (_React$Component) {
|
|
|
272
272
|
if (shouldRenderPopup && !shouldRenderPopup(position || {})) {
|
|
273
273
|
return null;
|
|
274
274
|
}
|
|
275
|
+
|
|
276
|
+
//In some cases we don't want to use default "Popup" text as an aria-label. It might be tedious for screen reader users.
|
|
277
|
+
var ariaLabel = this.props.ariaLabel === null ? undefined : this.props.ariaLabel || 'Popup';
|
|
275
278
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
276
279
|
ref: this.handleRef,
|
|
277
280
|
style: _objectSpread(_objectSpread({
|
|
278
281
|
position: 'absolute',
|
|
279
282
|
zIndex: this.props.zIndex || _editorSharedStyles.akEditorFloatingPanelZIndex
|
|
280
283
|
}, position), this.props.style),
|
|
281
|
-
"aria-label":
|
|
284
|
+
"aria-label": ariaLabel,
|
|
285
|
+
"data-testid": "popup-wrapper"
|
|
282
286
|
// Indicates component is an editor pop. Required for focus handling in Message.tsx
|
|
283
287
|
,
|
|
284
288
|
"data-editor-popup": true
|
package/dist/cjs/utils/index.js
CHANGED
|
@@ -590,6 +590,7 @@ Object.defineProperty(exports, "isFromCurrentDomain", {
|
|
|
590
590
|
return _hyperlink.isFromCurrentDomain;
|
|
591
591
|
}
|
|
592
592
|
});
|
|
593
|
+
exports.isInEmptyLine = isInEmptyLine;
|
|
593
594
|
Object.defineProperty(exports, "isInLayoutColumn", {
|
|
594
595
|
enumerable: true,
|
|
595
596
|
get: function get() {
|
|
@@ -1022,12 +1023,13 @@ Object.defineProperty(exports, "wrapSelectionIn", {
|
|
|
1022
1023
|
}
|
|
1023
1024
|
});
|
|
1024
1025
|
var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
1026
|
+
var _document = require("./document");
|
|
1027
|
+
var _editorCoreUtils = require("./editor-core-utils");
|
|
1025
1028
|
var _annotation = require("./annotation");
|
|
1026
1029
|
var _macro = require("./macro");
|
|
1027
1030
|
var _browser = _interopRequireDefault(require("./browser"));
|
|
1028
1031
|
var _errorReporter = _interopRequireDefault(require("./error-reporter"));
|
|
1029
1032
|
var _date = require("./date");
|
|
1030
|
-
var _editorCoreUtils = require("./editor-core-utils");
|
|
1031
1033
|
var _imageLoader = require("./imageLoader");
|
|
1032
1034
|
var _breakout = require("./breakout");
|
|
1033
1035
|
var _nodes = require("./nodes");
|
|
@@ -1062,7 +1064,6 @@ var _referentiality = require("./referentiality");
|
|
|
1062
1064
|
var _list = require("./list");
|
|
1063
1065
|
var _hyperlink = require("./hyperlink");
|
|
1064
1066
|
var _grid = require("./grid");
|
|
1065
|
-
var _document = require("./document");
|
|
1066
1067
|
var _richMediaUtils = require("./rich-media-utils");
|
|
1067
1068
|
var _privacyFilter = require("./filter/privacy-filter");
|
|
1068
1069
|
var _datasource = require("./datasource");
|
|
@@ -1227,4 +1228,18 @@ function isNodeEmpty(node) {
|
|
|
1227
1228
|
return !nonBlock.length && !block.filter(function (childNode) {
|
|
1228
1229
|
return !!childNode.childCount && !(childNode.childCount === 1 && (0, _editorCoreUtils.isEmptyParagraph)(childNode.firstChild)) || childNode.isAtom;
|
|
1229
1230
|
}).length;
|
|
1231
|
+
}
|
|
1232
|
+
function isInEmptyLine(state) {
|
|
1233
|
+
var selection = state.selection;
|
|
1234
|
+
var _ref = selection,
|
|
1235
|
+
$cursor = _ref.$cursor,
|
|
1236
|
+
$anchor = _ref.$anchor;
|
|
1237
|
+
if (!$cursor) {
|
|
1238
|
+
return false;
|
|
1239
|
+
}
|
|
1240
|
+
var node = $cursor.node();
|
|
1241
|
+
if (!node) {
|
|
1242
|
+
return false;
|
|
1243
|
+
}
|
|
1244
|
+
return (0, _editorCoreUtils.isEmptyParagraph)(node) && (0, _document.hasDocAsParent)($anchor);
|
|
1230
1245
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
2
2
|
const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
3
|
-
const packageVersion = "75.5.
|
|
3
|
+
const packageVersion = "75.5.2";
|
|
4
4
|
const sanitiseSentryEvents = (data, _hint) => {
|
|
5
5
|
// Remove URL as it has UGC
|
|
6
6
|
// TODO: Sanitise the URL instead of just removing it
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { css } from '@emotion/react';
|
|
4
4
|
import { akEditorShadowZIndex } from '@atlaskit/editor-shared-styles';
|
|
5
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
5
6
|
import { N40A } from '@atlaskit/theme/colors';
|
|
6
7
|
import { shadowClassNames } from '../../ui/OverflowShadow';
|
|
7
8
|
import { shadowObserverClassNames } from '../../ui/OverflowShadow/shadowObserver';
|
|
@@ -45,7 +46,8 @@ const shadowSharedStyle = css`
|
|
|
45
46
|
background: linear-gradient(
|
|
46
47
|
to left,
|
|
47
48
|
transparent 0,
|
|
48
|
-
${`var(--ds-shadow-overflow-spread, ${N40A})`}
|
|
49
|
+
${`var(--ds-shadow-overflow-spread, ${N40A})`}
|
|
50
|
+
${getBooleanFF('platform.editor.table.increase-shadow-visibility_lh89r') ? 140 : 100}%
|
|
49
51
|
),
|
|
50
52
|
linear-gradient(
|
|
51
53
|
to right,
|
|
@@ -61,7 +63,8 @@ const shadowSharedStyle = css`
|
|
|
61
63
|
background: linear-gradient(
|
|
62
64
|
to right,
|
|
63
65
|
transparent 0,
|
|
64
|
-
${`var(--ds-shadow-overflow-spread, ${N40A})`}
|
|
66
|
+
${`var(--ds-shadow-overflow-spread, ${N40A})`}
|
|
67
|
+
${getBooleanFF('platform.editor.table.increase-shadow-visibility_lh89r') ? 140 : 100}%
|
|
65
68
|
),
|
|
66
69
|
linear-gradient(
|
|
67
70
|
to left,
|
|
@@ -9,7 +9,7 @@ import { themed } from '@atlaskit/theme/components';
|
|
|
9
9
|
import { borderRadius } from '@atlaskit/theme/constants';
|
|
10
10
|
import Layer from '../Layer';
|
|
11
11
|
const packageName = "@atlaskit/editor-common";
|
|
12
|
-
const packageVersion = "75.5.
|
|
12
|
+
const packageVersion = "75.5.2";
|
|
13
13
|
const halfFocusRing = 1;
|
|
14
14
|
const dropOffset = '0, 8';
|
|
15
15
|
class DropList extends Component {
|
|
@@ -226,6 +226,9 @@ export default class Popup extends React.Component {
|
|
|
226
226
|
if (shouldRenderPopup && !shouldRenderPopup(position || {})) {
|
|
227
227
|
return null;
|
|
228
228
|
}
|
|
229
|
+
|
|
230
|
+
//In some cases we don't want to use default "Popup" text as an aria-label. It might be tedious for screen reader users.
|
|
231
|
+
const ariaLabel = this.props.ariaLabel === null ? undefined : this.props.ariaLabel || 'Popup';
|
|
229
232
|
return /*#__PURE__*/React.createElement("div", {
|
|
230
233
|
ref: this.handleRef,
|
|
231
234
|
style: {
|
|
@@ -234,7 +237,8 @@ export default class Popup extends React.Component {
|
|
|
234
237
|
...position,
|
|
235
238
|
...this.props.style
|
|
236
239
|
},
|
|
237
|
-
"aria-label":
|
|
240
|
+
"aria-label": ariaLabel,
|
|
241
|
+
"data-testid": "popup-wrapper"
|
|
238
242
|
// Indicates component is an editor pop. Required for focus handling in Message.tsx
|
|
239
243
|
,
|
|
240
244
|
"data-editor-popup": true
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { hasParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
2
|
+
import { hasDocAsParent } from './document';
|
|
3
|
+
import { isEmptyParagraph } from './editor-core-utils';
|
|
2
4
|
export { canApplyAnnotationOnRange, getAnnotationIdsFromRange } from './annotation';
|
|
3
5
|
export { getExtensionLozengeData } from './macro';
|
|
4
6
|
export { default as browser } from './browser';
|
|
5
7
|
export { default as ErrorReporter } from './error-reporter';
|
|
6
8
|
export { isPastDate, timestampToIsoFormat, timestampToString, timestampToTaskContext, timestampToUTCDate, todayTimestampInUTC } from './date';
|
|
7
9
|
export { isElementInTableCell, isTextSelection, isLastItemMediaGroup, setNodeSelection, setTextSelection, nonNullable, stepAddsOneOf, stepHasSlice, extractSliceFromStep, isValidPosition, isEmptyParagraph, isInLayoutColumn, removeBlockMarks, filterChildrenBetween } from './editor-core-utils';
|
|
8
|
-
import { isEmptyParagraph } from './editor-core-utils';
|
|
9
10
|
export { withImageLoader } from './imageLoader';
|
|
10
11
|
export { absoluteBreakoutWidth, calcBreakoutWidth, calcWideWidth, breakoutConsts, calculateBreakoutStyles, calcBreakoutWidthPx, getNextBreakoutMode, getTitle } from './breakout';
|
|
11
12
|
export { findChangedNodesFromTransaction, validNode, validateNodes, isType, isParagraph, isText, isLinkMark, SelectedState, isNodeSelectedOrInRange, isSupportedInParent, isMediaNode, isNodeBeforeMediaNode } from './nodes';
|
|
@@ -193,6 +194,23 @@ export function isNodeEmpty(node) {
|
|
|
193
194
|
});
|
|
194
195
|
return !nonBlock.length && !block.filter(childNode => !!childNode.childCount && !(childNode.childCount === 1 && isEmptyParagraph(childNode.firstChild)) || childNode.isAtom).length;
|
|
195
196
|
}
|
|
197
|
+
export function isInEmptyLine(state) {
|
|
198
|
+
const {
|
|
199
|
+
selection
|
|
200
|
+
} = state;
|
|
201
|
+
const {
|
|
202
|
+
$cursor,
|
|
203
|
+
$anchor
|
|
204
|
+
} = selection;
|
|
205
|
+
if (!$cursor) {
|
|
206
|
+
return false;
|
|
207
|
+
}
|
|
208
|
+
const node = $cursor.node();
|
|
209
|
+
if (!node) {
|
|
210
|
+
return false;
|
|
211
|
+
}
|
|
212
|
+
return isEmptyParagraph(node) && hasDocAsParent($anchor);
|
|
213
|
+
}
|
|
196
214
|
export { dedupe } from './dedupe';
|
|
197
215
|
export { createWrapSelectionTransaction } from './create-wrap-selection-transaction';
|
|
198
216
|
export { wrapSelectionIn } from './wrap-selection-in';
|
|
@@ -6,7 +6,7 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
6
6
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
7
7
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
8
8
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
9
|
-
var packageVersion = "75.5.
|
|
9
|
+
var packageVersion = "75.5.2";
|
|
10
10
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
11
11
|
// Remove URL as it has UGC
|
|
12
12
|
// TODO: Sanitise the URL instead of just removing it
|
|
@@ -4,6 +4,7 @@ var _templateObject;
|
|
|
4
4
|
|
|
5
5
|
import { css } from '@emotion/react';
|
|
6
6
|
import { akEditorShadowZIndex } from '@atlaskit/editor-shared-styles';
|
|
7
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
7
8
|
import { N40A } from '@atlaskit/theme/colors';
|
|
8
9
|
import { shadowClassNames } from '../../ui/OverflowShadow';
|
|
9
10
|
import { shadowObserverClassNames } from '../../ui/OverflowShadow/shadowObserver';
|
|
@@ -23,5 +24,5 @@ var shadowWidth = 8;
|
|
|
23
24
|
* background-attachment: local, local, scroll, scroll;
|
|
24
25
|
*/
|
|
25
26
|
|
|
26
|
-
var shadowSharedStyle = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n &\n .", "::before,\n .", "::after,\n .", "::before,\n .", "::after {\n display: none;\n position: absolute;\n pointer-events: none;\n z-index: ", ";\n width: ", "px;\n content: '';\n /* Scrollbar is outside the content in IE, inset in other browsers. */\n height: calc(100%);\n }\n\n & .", ", .", " {\n position: relative;\n }\n\n & .", "::before {\n background: linear-gradient(\n to left,\n transparent 0,\n ", "
|
|
27
|
+
var shadowSharedStyle = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n &\n .", "::before,\n .", "::after,\n .", "::before,\n .", "::after {\n display: none;\n position: absolute;\n pointer-events: none;\n z-index: ", ";\n width: ", "px;\n content: '';\n /* Scrollbar is outside the content in IE, inset in other browsers. */\n height: calc(100%);\n }\n\n & .", ", .", " {\n position: relative;\n }\n\n & .", "::before {\n background: linear-gradient(\n to left,\n transparent 0,\n ", "\n ", "%\n ),\n linear-gradient(\n to right,\n ", " 0px,\n transparent 1px\n );\n top: 0px;\n left: 0;\n display: block;\n }\n\n & .", "::after {\n background: linear-gradient(\n to right,\n transparent 0,\n ", "\n ", "%\n ),\n linear-gradient(\n to left,\n ", " 0px,\n transparent 1px\n );\n left: calc(100% - ", "px);\n top: 0px;\n display: block;\n }\n\n & .", " {\n height: 100%;\n width: 0px;\n min-width: 0px;\n }\n\n & .", " {\n height: 100%;\n width: 0px;\n min-width: 0px;\n }\n"])), shadowClassNames.RIGHT_SHADOW, shadowClassNames.RIGHT_SHADOW, shadowClassNames.LEFT_SHADOW, shadowClassNames.LEFT_SHADOW, akEditorShadowZIndex, shadowWidth, shadowClassNames.RIGHT_SHADOW, shadowClassNames.LEFT_SHADOW, shadowClassNames.LEFT_SHADOW, "var(--ds-shadow-overflow-spread, ".concat(N40A, ")"), getBooleanFF('platform.editor.table.increase-shadow-visibility_lh89r') ? 140 : 100, "var(--ds-shadow-overflow-perimeter, transparent)", shadowClassNames.RIGHT_SHADOW, "var(--ds-shadow-overflow-spread, ".concat(N40A, ")"), getBooleanFF('platform.editor.table.increase-shadow-visibility_lh89r') ? 140 : 100, "var(--ds-shadow-overflow-perimeter, transparent)", shadowWidth, shadowObserverClassNames.SENTINEL_LEFT, shadowObserverClassNames.SENTINEL_RIGHT);
|
|
27
28
|
export { shadowSharedStyle };
|
|
@@ -19,7 +19,7 @@ import { themed } from '@atlaskit/theme/components';
|
|
|
19
19
|
import { borderRadius } from '@atlaskit/theme/constants';
|
|
20
20
|
import Layer from '../Layer';
|
|
21
21
|
var packageName = "@atlaskit/editor-common";
|
|
22
|
-
var packageVersion = "75.5.
|
|
22
|
+
var packageVersion = "75.5.2";
|
|
23
23
|
var halfFocusRing = 1;
|
|
24
24
|
var dropOffset = '0, 8';
|
|
25
25
|
var DropList = /*#__PURE__*/function (_Component) {
|
|
@@ -259,13 +259,17 @@ var Popup = /*#__PURE__*/function (_React$Component) {
|
|
|
259
259
|
if (shouldRenderPopup && !shouldRenderPopup(position || {})) {
|
|
260
260
|
return null;
|
|
261
261
|
}
|
|
262
|
+
|
|
263
|
+
//In some cases we don't want to use default "Popup" text as an aria-label. It might be tedious for screen reader users.
|
|
264
|
+
var ariaLabel = this.props.ariaLabel === null ? undefined : this.props.ariaLabel || 'Popup';
|
|
262
265
|
return /*#__PURE__*/React.createElement("div", {
|
|
263
266
|
ref: this.handleRef,
|
|
264
267
|
style: _objectSpread(_objectSpread({
|
|
265
268
|
position: 'absolute',
|
|
266
269
|
zIndex: this.props.zIndex || akEditorFloatingPanelZIndex
|
|
267
270
|
}, position), this.props.style),
|
|
268
|
-
"aria-label":
|
|
271
|
+
"aria-label": ariaLabel,
|
|
272
|
+
"data-testid": "popup-wrapper"
|
|
269
273
|
// Indicates component is an editor pop. Required for focus handling in Message.tsx
|
|
270
274
|
,
|
|
271
275
|
"data-editor-popup": true
|
package/dist/esm/utils/index.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { hasParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
2
|
+
import { hasDocAsParent } from './document';
|
|
3
|
+
import { isEmptyParagraph } from './editor-core-utils';
|
|
2
4
|
export { canApplyAnnotationOnRange, getAnnotationIdsFromRange } from './annotation';
|
|
3
5
|
export { getExtensionLozengeData } from './macro';
|
|
4
6
|
export { default as browser } from './browser';
|
|
5
7
|
export { default as ErrorReporter } from './error-reporter';
|
|
6
8
|
export { isPastDate, timestampToIsoFormat, timestampToString, timestampToTaskContext, timestampToUTCDate, todayTimestampInUTC } from './date';
|
|
7
9
|
export { isElementInTableCell, isTextSelection, isLastItemMediaGroup, setNodeSelection, setTextSelection, nonNullable, stepAddsOneOf, stepHasSlice, extractSliceFromStep, isValidPosition, isEmptyParagraph, isInLayoutColumn, removeBlockMarks, filterChildrenBetween } from './editor-core-utils';
|
|
8
|
-
import { isEmptyParagraph } from './editor-core-utils';
|
|
9
10
|
export { withImageLoader } from './imageLoader';
|
|
10
11
|
export { absoluteBreakoutWidth, calcBreakoutWidth, calcWideWidth, breakoutConsts, calculateBreakoutStyles, calcBreakoutWidthPx, getNextBreakoutMode, getTitle } from './breakout';
|
|
11
12
|
export { findChangedNodesFromTransaction, validNode, validateNodes, isType, isParagraph, isText, isLinkMark, SelectedState, isNodeSelectedOrInRange, isSupportedInParent, isMediaNode, isNodeBeforeMediaNode } from './nodes';
|
|
@@ -199,6 +200,20 @@ export function isNodeEmpty(node) {
|
|
|
199
200
|
return !!childNode.childCount && !(childNode.childCount === 1 && isEmptyParagraph(childNode.firstChild)) || childNode.isAtom;
|
|
200
201
|
}).length;
|
|
201
202
|
}
|
|
203
|
+
export function isInEmptyLine(state) {
|
|
204
|
+
var selection = state.selection;
|
|
205
|
+
var _ref = selection,
|
|
206
|
+
$cursor = _ref.$cursor,
|
|
207
|
+
$anchor = _ref.$anchor;
|
|
208
|
+
if (!$cursor) {
|
|
209
|
+
return false;
|
|
210
|
+
}
|
|
211
|
+
var node = $cursor.node();
|
|
212
|
+
if (!node) {
|
|
213
|
+
return false;
|
|
214
|
+
}
|
|
215
|
+
return isEmptyParagraph(node) && hasDocAsParent($anchor);
|
|
216
|
+
}
|
|
202
217
|
export { dedupe } from './dedupe';
|
|
203
218
|
export { createWrapSelectionTransaction } from './create-wrap-selection-transaction';
|
|
204
219
|
export { wrapSelectionIn } from './wrap-selection-in';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Position } from './utils';
|
|
2
|
+
import type { Position } from './utils';
|
|
3
3
|
export interface Props {
|
|
4
4
|
zIndex?: number;
|
|
5
5
|
alignX?: 'left' | 'right' | 'center' | 'end';
|
|
@@ -15,7 +15,8 @@ export interface Props {
|
|
|
15
15
|
shouldRenderPopup?: (position: Position) => boolean;
|
|
16
16
|
scrollableElement?: HTMLElement;
|
|
17
17
|
stick?: boolean;
|
|
18
|
-
|
|
18
|
+
/** `null` should only be used if we provide enough context to screen readers to exclude aria-label attribute */
|
|
19
|
+
ariaLabel?: string | null;
|
|
19
20
|
forcePlacement?: boolean;
|
|
20
21
|
allowOutOfBounds?: boolean;
|
|
21
22
|
rect?: DOMRect;
|
|
@@ -42,7 +42,7 @@ declare const ToolbarButton: React.ForwardRefExoticComponent<{
|
|
|
42
42
|
onItemClick?: ((item: MenuItem) => void) | undefined;
|
|
43
43
|
onKeyDown?: ((event: React.KeyboardEvent<HTMLElement>) => void) | undefined;
|
|
44
44
|
selected?: boolean | undefined;
|
|
45
|
-
spacing?: "
|
|
45
|
+
spacing?: "default" | "none" | "compact" | undefined;
|
|
46
46
|
target?: string | undefined;
|
|
47
47
|
title?: React.ReactNode;
|
|
48
48
|
titlePosition?: PositionType | undefined;
|
|
@@ -79,6 +79,7 @@ export declare const isEmptyNode: (schema: Schema) => (node: PMNode) => boolean;
|
|
|
79
79
|
* Checks if a node has any content. Ignores node that only contain empty block nodes.
|
|
80
80
|
*/
|
|
81
81
|
export declare function isNodeEmpty(node?: PMNode): boolean;
|
|
82
|
+
export declare function isInEmptyLine(state: EditorState): boolean;
|
|
82
83
|
export { dedupe } from './dedupe';
|
|
83
84
|
export { createWrapSelectionTransaction } from './create-wrap-selection-transaction';
|
|
84
85
|
export { wrapSelectionIn } from './wrap-selection-in';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Position } from './utils';
|
|
2
|
+
import type { Position } from './utils';
|
|
3
3
|
export interface Props {
|
|
4
4
|
zIndex?: number;
|
|
5
5
|
alignX?: 'left' | 'right' | 'center' | 'end';
|
|
@@ -18,7 +18,8 @@ export interface Props {
|
|
|
18
18
|
shouldRenderPopup?: (position: Position) => boolean;
|
|
19
19
|
scrollableElement?: HTMLElement;
|
|
20
20
|
stick?: boolean;
|
|
21
|
-
|
|
21
|
+
/** `null` should only be used if we provide enough context to screen readers to exclude aria-label attribute */
|
|
22
|
+
ariaLabel?: string | null;
|
|
22
23
|
forcePlacement?: boolean;
|
|
23
24
|
allowOutOfBounds?: boolean;
|
|
24
25
|
rect?: DOMRect;
|
|
@@ -42,7 +42,7 @@ declare const ToolbarButton: React.ForwardRefExoticComponent<{
|
|
|
42
42
|
onItemClick?: ((item: MenuItem) => void) | undefined;
|
|
43
43
|
onKeyDown?: ((event: React.KeyboardEvent<HTMLElement>) => void) | undefined;
|
|
44
44
|
selected?: boolean | undefined;
|
|
45
|
-
spacing?: "
|
|
45
|
+
spacing?: "default" | "none" | "compact" | undefined;
|
|
46
46
|
target?: string | undefined;
|
|
47
47
|
title?: React.ReactNode;
|
|
48
48
|
titlePosition?: PositionType | undefined;
|
|
@@ -79,6 +79,7 @@ export declare const isEmptyNode: (schema: Schema) => (node: PMNode) => boolean;
|
|
|
79
79
|
* Checks if a node has any content. Ignores node that only contain empty block nodes.
|
|
80
80
|
*/
|
|
81
81
|
export declare function isNodeEmpty(node?: PMNode): boolean;
|
|
82
|
+
export declare function isInEmptyLine(state: EditorState): boolean;
|
|
82
83
|
export { dedupe } from './dedupe';
|
|
83
84
|
export { createWrapSelectionTransaction } from './create-wrap-selection-transaction';
|
|
84
85
|
export { wrapSelectionIn } from './wrap-selection-in';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "75.5.
|
|
3
|
+
"version": "75.5.2",
|
|
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/"
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
"@atlaskit/icon": "^21.12.0",
|
|
102
102
|
"@atlaskit/icon-object": "^6.3.0",
|
|
103
103
|
"@atlaskit/in-product-testing": "^0.2.0",
|
|
104
|
-
"@atlaskit/link-datasource": "^1.
|
|
104
|
+
"@atlaskit/link-datasource": "^1.3.0",
|
|
105
105
|
"@atlaskit/link-picker": "^1.30.0",
|
|
106
106
|
"@atlaskit/media-card": "^77.0.0",
|
|
107
107
|
"@atlaskit/media-client": "^24.0.0",
|
|
@@ -204,6 +204,9 @@
|
|
|
204
204
|
},
|
|
205
205
|
"platform.linking-platform.smart-card.show-smart-links-refreshed-design": {
|
|
206
206
|
"type": "boolean"
|
|
207
|
+
},
|
|
208
|
+
"platform.editor.table.increase-shadow-visibility_lh89r": {
|
|
209
|
+
"type": "boolean"
|
|
207
210
|
}
|
|
208
211
|
}
|
|
209
212
|
}
|