@atlaskit/editor-common 111.0.3 → 111.0.5
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 +14 -0
- package/dist/cjs/element-browser/components/ElementSearch.js +1 -1
- package/dist/cjs/link/LinkPicker/HyperlinkAddToolbar/HyperlinkAddToolbar.js +1 -1
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/selection/index.js +12 -0
- package/dist/cjs/selection/utils.js +33 -2
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/ui/FloatingToolbar/SmallerEditIcon.js +1 -1
- package/dist/cjs/ui/Toolbar/ExpandIcon.js +1 -1
- package/dist/cjs/ui/UnsupportedBlock/index.js +1 -1
- package/dist/cjs/ui/UnsupportedInline/index.js +1 -1
- package/dist/es2019/element-browser/components/ElementSearch.js +1 -1
- package/dist/es2019/link/LinkPicker/HyperlinkAddToolbar/HyperlinkAddToolbar.js +1 -1
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/selection/index.js +1 -1
- package/dist/es2019/selection/utils.js +31 -1
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/ui/FloatingToolbar/SmallerEditIcon.js +1 -1
- package/dist/es2019/ui/Toolbar/ExpandIcon.js +1 -1
- package/dist/es2019/ui/UnsupportedBlock/index.js +1 -1
- package/dist/es2019/ui/UnsupportedInline/index.js +1 -1
- package/dist/esm/element-browser/components/ElementSearch.js +1 -1
- package/dist/esm/link/LinkPicker/HyperlinkAddToolbar/HyperlinkAddToolbar.js +1 -1
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/selection/index.js +1 -1
- package/dist/esm/selection/utils.js +30 -1
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/ui/FloatingToolbar/SmallerEditIcon.js +1 -1
- package/dist/esm/ui/Toolbar/ExpandIcon.js +1 -1
- package/dist/esm/ui/UnsupportedBlock/index.js +1 -1
- package/dist/esm/ui/UnsupportedInline/index.js +1 -1
- package/dist/types/selection/index.d.ts +1 -1
- package/dist/types/selection/utils.d.ts +8 -3
- package/dist/types-ts4.5/selection/index.d.ts +1 -1
- package/dist/types-ts4.5/selection/utils.d.ts +8 -3
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 111.0.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`4bf196f8645a7`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/4bf196f8645a7) -
|
|
8
|
+
Editor-4011: Added util function isMultiNodeSelection
|
|
9
|
+
|
|
10
|
+
## 111.0.4
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- [`b429c01ce6af9`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b429c01ce6af9) -
|
|
15
|
+
icon migration entry point update
|
|
16
|
+
|
|
3
17
|
## 111.0.3
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -13,7 +13,7 @@ var _reactIntlNext = require("react-intl-next");
|
|
|
13
13
|
var _withAnalyticsContext = _interopRequireDefault(require("@atlaskit/analytics-next/withAnalyticsContext"));
|
|
14
14
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
15
15
|
var _shortcut = require("@atlaskit/editor-shared-styles/shortcut");
|
|
16
|
-
var _search = _interopRequireDefault(require("@atlaskit/icon/core/
|
|
16
|
+
var _search = _interopRequireDefault(require("@atlaskit/icon/core/search"));
|
|
17
17
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
18
18
|
var _textfield = _interopRequireDefault(require("@atlaskit/textfield"));
|
|
19
19
|
var _constants = require("../constants");
|
|
@@ -24,7 +24,7 @@ var _reactIntlNext = require("react-intl-next");
|
|
|
24
24
|
var _adfSchema = require("@atlaskit/adf-schema");
|
|
25
25
|
var _withAnalyticsEvents = _interopRequireDefault(require("@atlaskit/analytics-next/withAnalyticsEvents"));
|
|
26
26
|
var _ = _interopRequireDefault(require("@atlaskit/icon-object/glyph/page/16"));
|
|
27
|
-
var _crossCircle = _interopRequireDefault(require("@atlaskit/icon/core/
|
|
27
|
+
var _crossCircle = _interopRequireDefault(require("@atlaskit/icon/core/cross-circle"));
|
|
28
28
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
29
29
|
var _primitives = require("@atlaskit/primitives");
|
|
30
30
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
@@ -19,7 +19,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
19
19
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
20
20
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
21
21
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
22
|
-
var packageVersion = "
|
|
22
|
+
var packageVersion = "111.0.4";
|
|
23
23
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
24
24
|
// Remove URL as it has UGC
|
|
25
25
|
// Ignored via go/ees007
|
|
@@ -110,6 +110,18 @@ Object.defineProperty(exports, "isIgnored", {
|
|
|
110
110
|
return _isIgnored.isIgnored;
|
|
111
111
|
}
|
|
112
112
|
});
|
|
113
|
+
Object.defineProperty(exports, "isMultiBlockRange", {
|
|
114
|
+
enumerable: true,
|
|
115
|
+
get: function get() {
|
|
116
|
+
return _utils2.isMultiBlockRange;
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
Object.defineProperty(exports, "isMultiBlockSelection", {
|
|
120
|
+
enumerable: true,
|
|
121
|
+
get: function get() {
|
|
122
|
+
return _utils2.isMultiBlockSelection;
|
|
123
|
+
}
|
|
124
|
+
});
|
|
113
125
|
Object.defineProperty(exports, "isSelectionAtEndOfNode", {
|
|
114
126
|
enumerable: true,
|
|
115
127
|
get: function get() {
|
|
@@ -9,7 +9,9 @@ exports.atTheEndOfBlock = atTheEndOfBlock;
|
|
|
9
9
|
exports.atTheEndOfDoc = atTheEndOfDoc;
|
|
10
10
|
exports.deleteSelectedRange = void 0;
|
|
11
11
|
exports.endPositionOfParent = endPositionOfParent;
|
|
12
|
-
exports.
|
|
12
|
+
exports.isMultiBlockRange = exports.expandToBlockRange = exports.expandSelectionToBlockRange = exports.expandSelectionBounds = void 0;
|
|
13
|
+
exports.isMultiBlockSelection = isMultiBlockSelection;
|
|
14
|
+
exports.isSelectionAtStartOfNode = exports.isSelectionAtEndOfNode = void 0;
|
|
13
15
|
exports.startPositionOfParent = startPositionOfParent;
|
|
14
16
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
15
17
|
var _utils = require("@atlaskit/editor-tables/utils");
|
|
@@ -206,4 +208,33 @@ var expandSelectionToBlockRange = exports.expandSelectionToBlockRange = function
|
|
|
206
208
|
var $from = _ref2.$from,
|
|
207
209
|
$to = _ref2.$to;
|
|
208
210
|
return expandToBlockRange($from, $to);
|
|
209
|
-
};
|
|
211
|
+
};
|
|
212
|
+
var isMultiBlockRange = exports.isMultiBlockRange = function isMultiBlockRange(range) {
|
|
213
|
+
if (range.endIndex - range.startIndex <= 1) {
|
|
214
|
+
return false; // At most one child
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
// Count block nodes in the range, return true if more than one
|
|
218
|
+
var blockCount = 0;
|
|
219
|
+
for (var i = range.startIndex; i < range.endIndex; i++) {
|
|
220
|
+
if (range.parent.child(i).isBlock) {
|
|
221
|
+
blockCount++;
|
|
222
|
+
}
|
|
223
|
+
if (blockCount > 1) {
|
|
224
|
+
return true;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
return false;
|
|
228
|
+
};
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* Determines if a selection contains multiple block nodes.
|
|
232
|
+
*/
|
|
233
|
+
function isMultiBlockSelection(selection) {
|
|
234
|
+
var _expandSelectionToBlo = expandSelectionToBlockRange(selection),
|
|
235
|
+
range = _expandSelectionToBlo.range;
|
|
236
|
+
if (!range) {
|
|
237
|
+
return false;
|
|
238
|
+
}
|
|
239
|
+
return isMultiBlockRange(range);
|
|
240
|
+
}
|
|
@@ -24,7 +24,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
24
24
|
* @jsx jsx
|
|
25
25
|
*/ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
26
26
|
var packageName = "@atlaskit/editor-common";
|
|
27
|
-
var packageVersion = "
|
|
27
|
+
var packageVersion = "111.0.4";
|
|
28
28
|
var halfFocusRing = 1;
|
|
29
29
|
var dropOffset = '0, 8';
|
|
30
30
|
var fadeIn = (0, _react2.keyframes)({
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.SmallerEditIcon = void 0;
|
|
8
8
|
var _react = require("@emotion/react");
|
|
9
|
-
var _edit = _interopRequireDefault(require("@atlaskit/icon/core/
|
|
9
|
+
var _edit = _interopRequireDefault(require("@atlaskit/icon/core/edit"));
|
|
10
10
|
/**
|
|
11
11
|
* @jsxRuntime classic
|
|
12
12
|
* @jsx jsx
|
|
@@ -10,7 +10,7 @@ exports.ToolbarExpandIcon = ToolbarExpandIcon;
|
|
|
10
10
|
require("./ExpandIcon.compiled.css");
|
|
11
11
|
var React = _interopRequireWildcard(require("react"));
|
|
12
12
|
var _runtime = require("@compiled/react/runtime");
|
|
13
|
-
var _chevronDown = _interopRequireDefault(require("@atlaskit/icon/core/
|
|
13
|
+
var _chevronDown = _interopRequireDefault(require("@atlaskit/icon/core/chevron-down"));
|
|
14
14
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
15
15
|
var expandIconContainerStyle = null;
|
|
16
16
|
function ToolbarExpandIcon() {
|
|
@@ -10,7 +10,7 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
10
10
|
var _react2 = require("@emotion/react");
|
|
11
11
|
var _reactIntlNext = require("react-intl-next");
|
|
12
12
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
13
|
-
var _questionCircle = _interopRequireDefault(require("@atlaskit/icon/core/
|
|
13
|
+
var _questionCircle = _interopRequireDefault(require("@atlaskit/icon/core/question-circle"));
|
|
14
14
|
var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
|
|
15
15
|
var _analytics = require("../../analytics");
|
|
16
16
|
var _unsupportedContent = require("../../messages/unsupportedContent");
|
|
@@ -10,7 +10,7 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
10
10
|
var _react2 = require("@emotion/react");
|
|
11
11
|
var _reactIntlNext = require("react-intl-next");
|
|
12
12
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
13
|
-
var _questionCircle = _interopRequireDefault(require("@atlaskit/icon/core/
|
|
13
|
+
var _questionCircle = _interopRequireDefault(require("@atlaskit/icon/core/question-circle"));
|
|
14
14
|
var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
|
|
15
15
|
var _analytics = require("../../analytics");
|
|
16
16
|
var _unsupportedContent = require("../../messages/unsupportedContent");
|
|
@@ -10,7 +10,7 @@ import { injectIntl } from 'react-intl-next';
|
|
|
10
10
|
import withAnalyticsContext from '@atlaskit/analytics-next/withAnalyticsContext';
|
|
11
11
|
import { relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
|
|
12
12
|
import { shortcutStyle } from '@atlaskit/editor-shared-styles/shortcut';
|
|
13
|
-
import SearchIcon from '@atlaskit/icon/core/
|
|
13
|
+
import SearchIcon from '@atlaskit/icon/core/search';
|
|
14
14
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
15
15
|
import Textfield from '@atlaskit/textfield';
|
|
16
16
|
import { GRID_SIZE, SEARCH_ITEM_HEIGHT_WIDTH } from '../constants';
|
|
@@ -14,7 +14,7 @@ import { defineMessages, injectIntl } from 'react-intl-next';
|
|
|
14
14
|
import { isSafeUrl } from '@atlaskit/adf-schema';
|
|
15
15
|
import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
16
16
|
import Page16Icon from '@atlaskit/icon-object/glyph/page/16';
|
|
17
|
-
import CrossCircleIcon from '@atlaskit/icon/core/
|
|
17
|
+
import CrossCircleIcon from '@atlaskit/icon/core/cross-circle';
|
|
18
18
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
19
19
|
// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
|
|
20
20
|
import { Pressable, xcss } from '@atlaskit/primitives';
|
|
@@ -4,7 +4,7 @@ import { isFedRamp } from './environment';
|
|
|
4
4
|
import { normaliseSentryBreadcrumbs, SERIALIZABLE_ATTRIBUTES } from './normalise-sentry-breadcrumbs';
|
|
5
5
|
const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
6
6
|
const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
7
|
-
const packageVersion = "
|
|
7
|
+
const packageVersion = "111.0.4";
|
|
8
8
|
const sanitiseSentryEvents = (data, _hint) => {
|
|
9
9
|
// Remove URL as it has UGC
|
|
10
10
|
// Ignored via go/ees007
|
|
@@ -12,7 +12,7 @@ export { isIgnored } from './gap-cursor/utils/is-ignored';
|
|
|
12
12
|
export { isValidTargetNode } from './gap-cursor/utils/is-valid-target-node';
|
|
13
13
|
export { setGapCursorSelection } from './gap-cursor/utils/setGapCursorSelection';
|
|
14
14
|
export { hideCaretModifier, gapCursorStyles } from './gap-cursor/styles';
|
|
15
|
-
export { atTheBeginningOfBlock, atTheBeginningOfDoc, atTheEndOfBlock, atTheEndOfDoc, deleteSelectedRange, endPositionOfParent, expandSelectionBounds, expandSelectionToBlockRange, expandToBlockRange, isSelectionAtEndOfNode, isSelectionAtStartOfNode, startPositionOfParent } from './utils';
|
|
15
|
+
export { atTheBeginningOfBlock, atTheBeginningOfDoc, atTheEndOfBlock, atTheEndOfDoc, deleteSelectedRange, endPositionOfParent, expandSelectionBounds, expandSelectionToBlockRange, expandToBlockRange, isMultiBlockRange, isMultiBlockSelection, isSelectionAtEndOfNode, isSelectionAtStartOfNode, startPositionOfParent } from './utils';
|
|
16
16
|
export function getNodeSelectionAnalyticsPayload(selection) {
|
|
17
17
|
if (selection instanceof NodeSelection) {
|
|
18
18
|
return {
|
|
@@ -204,4 +204,34 @@ export const expandSelectionToBlockRange = ({
|
|
|
204
204
|
$to
|
|
205
205
|
}) => {
|
|
206
206
|
return expandToBlockRange($from, $to);
|
|
207
|
-
};
|
|
207
|
+
};
|
|
208
|
+
export const isMultiBlockRange = range => {
|
|
209
|
+
if (range.endIndex - range.startIndex <= 1) {
|
|
210
|
+
return false; // At most one child
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
// Count block nodes in the range, return true if more than one
|
|
214
|
+
let blockCount = 0;
|
|
215
|
+
for (let i = range.startIndex; i < range.endIndex; i++) {
|
|
216
|
+
if (range.parent.child(i).isBlock) {
|
|
217
|
+
blockCount++;
|
|
218
|
+
}
|
|
219
|
+
if (blockCount > 1) {
|
|
220
|
+
return true;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
return false;
|
|
224
|
+
};
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* Determines if a selection contains multiple block nodes.
|
|
228
|
+
*/
|
|
229
|
+
export function isMultiBlockSelection(selection) {
|
|
230
|
+
const {
|
|
231
|
+
range
|
|
232
|
+
} = expandSelectionToBlockRange(selection);
|
|
233
|
+
if (!range) {
|
|
234
|
+
return false;
|
|
235
|
+
}
|
|
236
|
+
return isMultiBlockRange(range);
|
|
237
|
+
}
|
|
@@ -14,7 +14,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
|
14
14
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
15
15
|
import Layer from '../Layer';
|
|
16
16
|
const packageName = "@atlaskit/editor-common";
|
|
17
|
-
const packageVersion = "
|
|
17
|
+
const packageVersion = "111.0.4";
|
|
18
18
|
const halfFocusRing = 1;
|
|
19
19
|
const dropOffset = '0, 8';
|
|
20
20
|
const fadeIn = keyframes({
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
6
6
|
import { css, jsx } from '@emotion/react';
|
|
7
|
-
import EditIcon from '@atlaskit/icon/core/
|
|
7
|
+
import EditIcon from '@atlaskit/icon/core/edit';
|
|
8
8
|
const editIconStyles = css({
|
|
9
9
|
width: '20px'
|
|
10
10
|
});
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import "./ExpandIcon.compiled.css";
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
5
|
-
import ChevronDownIcon from '@atlaskit/icon/core/
|
|
5
|
+
import ChevronDownIcon from '@atlaskit/icon/core/chevron-down';
|
|
6
6
|
const expandIconContainerStyle = null;
|
|
7
7
|
export function ToolbarExpandIcon() {
|
|
8
8
|
return /*#__PURE__*/React.createElement("span", {
|
|
@@ -8,7 +8,7 @@ import React, { useCallback, useRef } from 'react';
|
|
|
8
8
|
import { css, jsx } from '@emotion/react';
|
|
9
9
|
import { injectIntl } from 'react-intl-next';
|
|
10
10
|
import { relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
|
|
11
|
-
import QuestionsIcon from '@atlaskit/icon/core/
|
|
11
|
+
import QuestionsIcon from '@atlaskit/icon/core/question-circle';
|
|
12
12
|
import Tooltip from '@atlaskit/tooltip';
|
|
13
13
|
import { ACTION_SUBJECT_ID } from '../../analytics';
|
|
14
14
|
import { unsupportedContentMessages } from '../../messages/unsupportedContent';
|
|
@@ -8,7 +8,7 @@ import React, { useCallback, useRef } from 'react';
|
|
|
8
8
|
import { css, jsx } from '@emotion/react';
|
|
9
9
|
import { injectIntl } from 'react-intl-next';
|
|
10
10
|
import { relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
|
|
11
|
-
import QuestionsIcon from '@atlaskit/icon/core/
|
|
11
|
+
import QuestionsIcon from '@atlaskit/icon/core/question-circle';
|
|
12
12
|
import Tooltip from '@atlaskit/tooltip';
|
|
13
13
|
import { ACTION_SUBJECT_ID } from '../../analytics';
|
|
14
14
|
import { unsupportedContentMessages } from '../../messages/unsupportedContent';
|
|
@@ -11,7 +11,7 @@ import { injectIntl } from 'react-intl-next';
|
|
|
11
11
|
import withAnalyticsContext from '@atlaskit/analytics-next/withAnalyticsContext';
|
|
12
12
|
import { relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
|
|
13
13
|
import { shortcutStyle } from '@atlaskit/editor-shared-styles/shortcut';
|
|
14
|
-
import SearchIcon from '@atlaskit/icon/core/
|
|
14
|
+
import SearchIcon from '@atlaskit/icon/core/search';
|
|
15
15
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
16
16
|
import Textfield from '@atlaskit/textfield';
|
|
17
17
|
import { GRID_SIZE, SEARCH_ITEM_HEIGHT_WIDTH } from '../constants';
|
|
@@ -25,7 +25,7 @@ import { defineMessages, injectIntl } from 'react-intl-next';
|
|
|
25
25
|
import { isSafeUrl } from '@atlaskit/adf-schema';
|
|
26
26
|
import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
27
27
|
import Page16Icon from '@atlaskit/icon-object/glyph/page/16';
|
|
28
|
-
import CrossCircleIcon from '@atlaskit/icon/core/
|
|
28
|
+
import CrossCircleIcon from '@atlaskit/icon/core/cross-circle';
|
|
29
29
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
30
30
|
// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
|
|
31
31
|
import { Pressable, xcss } from '@atlaskit/primitives';
|
|
@@ -10,7 +10,7 @@ import { isFedRamp } from './environment';
|
|
|
10
10
|
import { normaliseSentryBreadcrumbs, SERIALIZABLE_ATTRIBUTES } from './normalise-sentry-breadcrumbs';
|
|
11
11
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
12
12
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
13
|
-
var packageVersion = "
|
|
13
|
+
var packageVersion = "111.0.4";
|
|
14
14
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
15
15
|
// Remove URL as it has UGC
|
|
16
16
|
// Ignored via go/ees007
|
|
@@ -12,7 +12,7 @@ export { isIgnored } from './gap-cursor/utils/is-ignored';
|
|
|
12
12
|
export { isValidTargetNode } from './gap-cursor/utils/is-valid-target-node';
|
|
13
13
|
export { setGapCursorSelection } from './gap-cursor/utils/setGapCursorSelection';
|
|
14
14
|
export { hideCaretModifier, gapCursorStyles } from './gap-cursor/styles';
|
|
15
|
-
export { atTheBeginningOfBlock, atTheBeginningOfDoc, atTheEndOfBlock, atTheEndOfDoc, deleteSelectedRange, endPositionOfParent, expandSelectionBounds, expandSelectionToBlockRange, expandToBlockRange, isSelectionAtEndOfNode, isSelectionAtStartOfNode, startPositionOfParent } from './utils';
|
|
15
|
+
export { atTheBeginningOfBlock, atTheBeginningOfDoc, atTheEndOfBlock, atTheEndOfDoc, deleteSelectedRange, endPositionOfParent, expandSelectionBounds, expandSelectionToBlockRange, expandToBlockRange, isMultiBlockRange, isMultiBlockSelection, isSelectionAtEndOfNode, isSelectionAtStartOfNode, startPositionOfParent } from './utils';
|
|
16
16
|
export function getNodeSelectionAnalyticsPayload(selection) {
|
|
17
17
|
if (selection instanceof NodeSelection) {
|
|
18
18
|
return {
|
|
@@ -193,4 +193,33 @@ export var expandSelectionToBlockRange = function expandSelectionToBlockRange(_r
|
|
|
193
193
|
var $from = _ref2.$from,
|
|
194
194
|
$to = _ref2.$to;
|
|
195
195
|
return expandToBlockRange($from, $to);
|
|
196
|
-
};
|
|
196
|
+
};
|
|
197
|
+
export var isMultiBlockRange = function isMultiBlockRange(range) {
|
|
198
|
+
if (range.endIndex - range.startIndex <= 1) {
|
|
199
|
+
return false; // At most one child
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
// Count block nodes in the range, return true if more than one
|
|
203
|
+
var blockCount = 0;
|
|
204
|
+
for (var i = range.startIndex; i < range.endIndex; i++) {
|
|
205
|
+
if (range.parent.child(i).isBlock) {
|
|
206
|
+
blockCount++;
|
|
207
|
+
}
|
|
208
|
+
if (blockCount > 1) {
|
|
209
|
+
return true;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
return false;
|
|
213
|
+
};
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* Determines if a selection contains multiple block nodes.
|
|
217
|
+
*/
|
|
218
|
+
export function isMultiBlockSelection(selection) {
|
|
219
|
+
var _expandSelectionToBlo = expandSelectionToBlockRange(selection),
|
|
220
|
+
range = _expandSelectionToBlo.range;
|
|
221
|
+
if (!range) {
|
|
222
|
+
return false;
|
|
223
|
+
}
|
|
224
|
+
return isMultiBlockRange(range);
|
|
225
|
+
}
|
|
@@ -21,7 +21,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
|
21
21
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
22
22
|
import Layer from '../Layer';
|
|
23
23
|
var packageName = "@atlaskit/editor-common";
|
|
24
|
-
var packageVersion = "
|
|
24
|
+
var packageVersion = "111.0.4";
|
|
25
25
|
var halfFocusRing = 1;
|
|
26
26
|
var dropOffset = '0, 8';
|
|
27
27
|
var fadeIn = keyframes({
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
6
6
|
import { css, jsx } from '@emotion/react';
|
|
7
|
-
import EditIcon from '@atlaskit/icon/core/
|
|
7
|
+
import EditIcon from '@atlaskit/icon/core/edit';
|
|
8
8
|
var editIconStyles = css({
|
|
9
9
|
width: '20px'
|
|
10
10
|
});
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import "./ExpandIcon.compiled.css";
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
5
|
-
import ChevronDownIcon from '@atlaskit/icon/core/
|
|
5
|
+
import ChevronDownIcon from '@atlaskit/icon/core/chevron-down';
|
|
6
6
|
var expandIconContainerStyle = null;
|
|
7
7
|
export function ToolbarExpandIcon() {
|
|
8
8
|
return /*#__PURE__*/React.createElement("span", {
|
|
@@ -8,7 +8,7 @@ import React, { useCallback, useRef } from 'react';
|
|
|
8
8
|
import { css, jsx } from '@emotion/react';
|
|
9
9
|
import { injectIntl } from 'react-intl-next';
|
|
10
10
|
import { relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
|
|
11
|
-
import QuestionsIcon from '@atlaskit/icon/core/
|
|
11
|
+
import QuestionsIcon from '@atlaskit/icon/core/question-circle';
|
|
12
12
|
import Tooltip from '@atlaskit/tooltip';
|
|
13
13
|
import { ACTION_SUBJECT_ID } from '../../analytics';
|
|
14
14
|
import { unsupportedContentMessages } from '../../messages/unsupportedContent';
|
|
@@ -8,7 +8,7 @@ import React, { useCallback, useRef } from 'react';
|
|
|
8
8
|
import { css, jsx } from '@emotion/react';
|
|
9
9
|
import { injectIntl } from 'react-intl-next';
|
|
10
10
|
import { relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
|
|
11
|
-
import QuestionsIcon from '@atlaskit/icon/core/
|
|
11
|
+
import QuestionsIcon from '@atlaskit/icon/core/question-circle';
|
|
12
12
|
import Tooltip from '@atlaskit/tooltip';
|
|
13
13
|
import { ACTION_SUBJECT_ID } from '../../analytics';
|
|
14
14
|
import { unsupportedContentMessages } from '../../messages/unsupportedContent';
|
|
@@ -11,7 +11,7 @@ export { isIgnored } from './gap-cursor/utils/is-ignored';
|
|
|
11
11
|
export { isValidTargetNode } from './gap-cursor/utils/is-valid-target-node';
|
|
12
12
|
export { setGapCursorSelection } from './gap-cursor/utils/setGapCursorSelection';
|
|
13
13
|
export { hideCaretModifier, gapCursorStyles } from './gap-cursor/styles';
|
|
14
|
-
export { atTheBeginningOfBlock, atTheBeginningOfDoc, atTheEndOfBlock, atTheEndOfDoc, deleteSelectedRange, endPositionOfParent, expandSelectionBounds, expandSelectionToBlockRange, expandToBlockRange, isSelectionAtEndOfNode, isSelectionAtStartOfNode, startPositionOfParent, } from './utils';
|
|
14
|
+
export { atTheBeginningOfBlock, atTheBeginningOfDoc, atTheEndOfBlock, atTheEndOfDoc, deleteSelectedRange, endPositionOfParent, expandSelectionBounds, expandSelectionToBlockRange, expandToBlockRange, isMultiBlockRange, isMultiBlockSelection, isSelectionAtEndOfNode, isSelectionAtStartOfNode, startPositionOfParent, } from './utils';
|
|
15
15
|
export declare function getNodeSelectionAnalyticsPayload(selection: Selection): AnalyticsEventPayload | undefined;
|
|
16
16
|
export declare function getAllSelectionAnalyticsPayload(selection: Selection): AnalyticsEventPayload | undefined;
|
|
17
17
|
export declare function getCellSelectionAnalyticsPayload(state: EditorState): AnalyticsEventPayload | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Node as PMNode, ResolvedPos } from '@atlaskit/editor-prosemirror/model';
|
|
1
|
+
import type { NodeRange, Node as PMNode, ResolvedPos } from '@atlaskit/editor-prosemirror/model';
|
|
2
2
|
import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
3
|
import { type Selection } from '@atlaskit/editor-prosemirror/state';
|
|
4
4
|
export declare const isSelectionAtStartOfNode: ($pos: ResolvedPos, parentNode?: PMNode) => boolean;
|
|
@@ -46,7 +46,7 @@ export declare const expandToBlockRange: ($from: ResolvedPos, $to: ResolvedPos,
|
|
|
46
46
|
} | {
|
|
47
47
|
$from: ResolvedPos;
|
|
48
48
|
$to: ResolvedPos;
|
|
49
|
-
range:
|
|
49
|
+
range: NodeRange;
|
|
50
50
|
};
|
|
51
51
|
/**
|
|
52
52
|
* Expands a given selection to a block range, considering specific node types that require expansion.
|
|
@@ -67,5 +67,10 @@ export declare const expandSelectionToBlockRange: ({ $from, $to }: Selection) =>
|
|
|
67
67
|
} | {
|
|
68
68
|
$from: ResolvedPos;
|
|
69
69
|
$to: ResolvedPos;
|
|
70
|
-
range:
|
|
70
|
+
range: NodeRange;
|
|
71
71
|
};
|
|
72
|
+
export declare const isMultiBlockRange: (range: NodeRange) => boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Determines if a selection contains multiple block nodes.
|
|
75
|
+
*/
|
|
76
|
+
export declare function isMultiBlockSelection(selection: Selection): boolean;
|
|
@@ -11,7 +11,7 @@ export { isIgnored } from './gap-cursor/utils/is-ignored';
|
|
|
11
11
|
export { isValidTargetNode } from './gap-cursor/utils/is-valid-target-node';
|
|
12
12
|
export { setGapCursorSelection } from './gap-cursor/utils/setGapCursorSelection';
|
|
13
13
|
export { hideCaretModifier, gapCursorStyles } from './gap-cursor/styles';
|
|
14
|
-
export { atTheBeginningOfBlock, atTheBeginningOfDoc, atTheEndOfBlock, atTheEndOfDoc, deleteSelectedRange, endPositionOfParent, expandSelectionBounds, expandSelectionToBlockRange, expandToBlockRange, isSelectionAtEndOfNode, isSelectionAtStartOfNode, startPositionOfParent, } from './utils';
|
|
14
|
+
export { atTheBeginningOfBlock, atTheBeginningOfDoc, atTheEndOfBlock, atTheEndOfDoc, deleteSelectedRange, endPositionOfParent, expandSelectionBounds, expandSelectionToBlockRange, expandToBlockRange, isMultiBlockRange, isMultiBlockSelection, isSelectionAtEndOfNode, isSelectionAtStartOfNode, startPositionOfParent, } from './utils';
|
|
15
15
|
export declare function getNodeSelectionAnalyticsPayload(selection: Selection): AnalyticsEventPayload | undefined;
|
|
16
16
|
export declare function getAllSelectionAnalyticsPayload(selection: Selection): AnalyticsEventPayload | undefined;
|
|
17
17
|
export declare function getCellSelectionAnalyticsPayload(state: EditorState): AnalyticsEventPayload | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Node as PMNode, ResolvedPos } from '@atlaskit/editor-prosemirror/model';
|
|
1
|
+
import type { NodeRange, Node as PMNode, ResolvedPos } from '@atlaskit/editor-prosemirror/model';
|
|
2
2
|
import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
3
|
import { type Selection } from '@atlaskit/editor-prosemirror/state';
|
|
4
4
|
export declare const isSelectionAtStartOfNode: ($pos: ResolvedPos, parentNode?: PMNode) => boolean;
|
|
@@ -46,7 +46,7 @@ export declare const expandToBlockRange: ($from: ResolvedPos, $to: ResolvedPos,
|
|
|
46
46
|
} | {
|
|
47
47
|
$from: ResolvedPos;
|
|
48
48
|
$to: ResolvedPos;
|
|
49
|
-
range:
|
|
49
|
+
range: NodeRange;
|
|
50
50
|
};
|
|
51
51
|
/**
|
|
52
52
|
* Expands a given selection to a block range, considering specific node types that require expansion.
|
|
@@ -67,5 +67,10 @@ export declare const expandSelectionToBlockRange: ({ $from, $to }: Selection) =>
|
|
|
67
67
|
} | {
|
|
68
68
|
$from: ResolvedPos;
|
|
69
69
|
$to: ResolvedPos;
|
|
70
|
-
range:
|
|
70
|
+
range: NodeRange;
|
|
71
71
|
};
|
|
72
|
+
export declare const isMultiBlockRange: (range: NodeRange) => boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Determines if a selection contains multiple block nodes.
|
|
75
|
+
*/
|
|
76
|
+
export declare function isMultiBlockSelection(selection: Selection): boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "111.0.
|
|
3
|
+
"version": "111.0.5",
|
|
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/"
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"@atlaskit/adf-schema": "^51.5.0",
|
|
34
34
|
"@atlaskit/adf-utils": "^19.26.0",
|
|
35
35
|
"@atlaskit/afm-i18n-platform-editor-editor-common": "2.10.0",
|
|
36
|
-
"@atlaskit/analytics-listeners": "^9.
|
|
36
|
+
"@atlaskit/analytics-listeners": "^9.2.0",
|
|
37
37
|
"@atlaskit/analytics-namespaced-context": "^7.2.0",
|
|
38
38
|
"@atlaskit/analytics-next": "^11.1.0",
|
|
39
39
|
"@atlaskit/atlassian-context": "^0.6.0",
|