@atlaskit/editor-common 78.12.5 → 78.12.6
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 +6 -0
- package/dist/cjs/element-browser/components/CategoryList.js +8 -3
- package/dist/cjs/mark/commands.js +10 -2
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/utils/annotation/index.js +13 -4
- package/dist/cjs/utils/validator.js +23 -0
- package/dist/es2019/element-browser/components/CategoryList.js +7 -9
- package/dist/es2019/mark/commands.js +12 -2
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/utils/annotation/index.js +15 -4
- package/dist/es2019/utils/validator.js +25 -0
- package/dist/esm/element-browser/components/CategoryList.js +8 -3
- package/dist/esm/mark/commands.js +10 -2
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/utils/annotation/index.js +13 -4
- package/dist/esm/utils/validator.js +23 -0
- package/package.json +4 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 78.12.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#79543](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/79543) [`8b578f7427a2`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8b578f7427a2) - ED-22502: updated range selection check to exempt inline card, to allow them to have annotation marks
|
|
8
|
+
|
|
3
9
|
## 78.12.5
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.default = void 0;
|
|
9
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
10
9
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
12
11
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
@@ -19,7 +18,6 @@ var _colors = require("@atlaskit/theme/colors");
|
|
|
19
18
|
var _analytics = require("../../analytics");
|
|
20
19
|
var _constants = require("../constants");
|
|
21
20
|
var _useFocus = _interopRequireDefault(require("../hooks/use-focus"));
|
|
22
|
-
var _templateObject;
|
|
23
21
|
var _excluded = ["categories"],
|
|
24
22
|
_excluded2 = ["buttonStyles"];
|
|
25
23
|
/** @jsx jsx */
|
|
@@ -107,7 +105,14 @@ function CategoryListItem(_ref2) {
|
|
|
107
105
|
testId: "element-browser-category-item"
|
|
108
106
|
}, category.title));
|
|
109
107
|
}
|
|
110
|
-
var buttonWrapper = (0, _react2.css)(
|
|
108
|
+
var buttonWrapper = (0, _react2.css)((0, _defineProperty2.default)({
|
|
109
|
+
height: "".concat(_constants.GRID_SIZE * 4, "px"),
|
|
110
|
+
margin: "var(--ds-space-050, 4px)".concat(" ", "var(--ds-space-050, 4px)", " ", "var(--ds-space-050, 4px)", " 0")
|
|
111
|
+
}, "@media (min-width: ".concat(_constants.DEVICE_BREAKPOINT_NUMBERS.medium, "px)"), {
|
|
112
|
+
':not(:last-child)': {
|
|
113
|
+
marginBottom: 0
|
|
114
|
+
}
|
|
115
|
+
}));
|
|
111
116
|
var MemoizedCategoryListWithAnalytics = /*#__PURE__*/(0, _react.memo)((0, _analyticsNext.withAnalyticsContext)({
|
|
112
117
|
component: 'CategoryList'
|
|
113
118
|
})(CategoryList));
|
|
@@ -8,6 +8,7 @@ exports.filterChildrenBetween = filterChildrenBetween;
|
|
|
8
8
|
exports.transformSmartCharsMentionsAndEmojis = exports.toggleMark = void 0;
|
|
9
9
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
10
10
|
var _cellSelection = require("@atlaskit/editor-tables/cell-selection");
|
|
11
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
11
12
|
// eslint-disable-next-line no-duplicate-imports
|
|
12
13
|
|
|
13
14
|
var SMART_TO_ASCII = {
|
|
@@ -90,12 +91,19 @@ var transformSmartCharsMentionsAndEmojis = exports.transformSmartCharsMentionsAn
|
|
|
90
91
|
var applyMarkOnRange = exports.applyMarkOnRange = function applyMarkOnRange(from, to, removeMark, mark, tr) {
|
|
91
92
|
var schema = tr.doc.type.schema;
|
|
92
93
|
var code = schema.marks.code;
|
|
94
|
+
var inlineCard = schema.nodes.inlineCard;
|
|
93
95
|
if (mark.type === code) {
|
|
94
96
|
transformSmartCharsMentionsAndEmojis(from, to, tr);
|
|
95
97
|
}
|
|
96
98
|
tr.doc.nodesBetween(tr.mapping.map(from), tr.mapping.map(to), function (node, pos) {
|
|
97
|
-
if (
|
|
98
|
-
|
|
99
|
+
if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.allow-inline-comments-for-inline-nodes')) {
|
|
100
|
+
if (!node.isText && node.type !== inlineCard) {
|
|
101
|
+
return true;
|
|
102
|
+
}
|
|
103
|
+
} else {
|
|
104
|
+
if (!node.isText) {
|
|
105
|
+
return true;
|
|
106
|
+
}
|
|
99
107
|
}
|
|
100
108
|
|
|
101
109
|
// This is an issue when the user selects some text.
|
|
@@ -16,7 +16,7 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
|
|
|
16
16
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
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 = "78.12.
|
|
19
|
+
var packageVersion = "78.12.6";
|
|
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
|
|
@@ -22,7 +22,7 @@ var _templateObject, _templateObject2, _templateObject3;
|
|
|
22
22
|
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); }; }
|
|
23
23
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /** @jsx jsx */
|
|
24
24
|
var packageName = "@atlaskit/editor-common";
|
|
25
|
-
var packageVersion = "78.12.
|
|
25
|
+
var packageVersion = "78.12.6";
|
|
26
26
|
var halfFocusRing = 1;
|
|
27
27
|
var dropOffset = '0, 8';
|
|
28
28
|
var DropList = /*#__PURE__*/function (_Component) {
|
|
@@ -7,25 +7,34 @@ exports.canApplyAnnotationOnRange = void 0;
|
|
|
7
7
|
exports.containsAnyAnnotations = containsAnyAnnotations;
|
|
8
8
|
exports.getAnnotationIdsFromRange = void 0;
|
|
9
9
|
exports.hasAnnotationMark = hasAnnotationMark;
|
|
10
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
10
11
|
var canApplyAnnotationOnRange = exports.canApplyAnnotationOnRange = function canApplyAnnotationOnRange(rangeSelection, doc, schema) {
|
|
11
12
|
var from = rangeSelection.from,
|
|
12
13
|
to = rangeSelection.to;
|
|
13
14
|
if (isNaN(from + to) || to - from <= 0 || to < 0 || from < 0) {
|
|
14
15
|
return false;
|
|
15
16
|
}
|
|
17
|
+
var inlineCard = schema.nodes.inlineCard;
|
|
16
18
|
var foundInvalid = false;
|
|
17
19
|
doc.nodesBetween(rangeSelection.from, rangeSelection.to, function (node, _pos, parent) {
|
|
18
20
|
// Special exception for hardBreak nodes
|
|
19
21
|
if (schema.nodes.hardBreak === node.type) {
|
|
20
22
|
return false;
|
|
21
23
|
}
|
|
22
|
-
|
|
23
24
|
// For block elements or text nodes, we want to check
|
|
24
25
|
// if annotations are allowed inside this tree
|
|
25
26
|
// or if we're leaf and not text
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
|
|
28
|
+
if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.allow-inline-comments-for-inline-nodes')) {
|
|
29
|
+
if (node.isInline && !node.isText && node.type !== inlineCard || node.isLeaf && !node.isText && node.type !== inlineCard || node.isText && !(parent !== null && parent !== void 0 && parent.type.allowsMarkType(schema.marks.annotation))) {
|
|
30
|
+
foundInvalid = true;
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
33
|
+
} else {
|
|
34
|
+
if (node.isInline && !node.isText || node.isLeaf && !node.isText || node.isText && !(parent !== null && parent !== void 0 && parent.type.allowsMarkType(schema.marks.annotation))) {
|
|
35
|
+
foundInvalid = true;
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
29
38
|
}
|
|
30
39
|
return true;
|
|
31
40
|
});
|
|
@@ -9,6 +9,7 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
9
9
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
10
10
|
var _adfSchema = require("@atlaskit/adf-schema");
|
|
11
11
|
var _schemaDefault = require("@atlaskit/adf-schema/schema-default");
|
|
12
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
12
13
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
13
14
|
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) { (0, _defineProperty2.default)(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; }
|
|
14
15
|
var ADFStages = exports.ADFStages = {
|
|
@@ -290,6 +291,28 @@ var getValidNode = exports.getValidNode = function getValidNode(originalNode) {
|
|
|
290
291
|
break;
|
|
291
292
|
}
|
|
292
293
|
case 'inlineCard':
|
|
294
|
+
{
|
|
295
|
+
if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.allow-inline-comments-for-inline-nodes')) {
|
|
296
|
+
var inlineCardNode = {
|
|
297
|
+
type: type
|
|
298
|
+
};
|
|
299
|
+
if (attrs && (attrs.datasource && !attrs.url || attrs.url && (0, _adfSchema.isSafeUrl)(attrs.url) || attrs.data && attrs.data.url && (0, _adfSchema.isSafeUrl)(attrs.data.url))) {
|
|
300
|
+
inlineCardNode.attrs = _objectSpread({}, attrs);
|
|
301
|
+
}
|
|
302
|
+
if (marks) {
|
|
303
|
+
inlineCardNode.marks = (0, _toConsumableArray2.default)(marks);
|
|
304
|
+
}
|
|
305
|
+
return inlineCardNode;
|
|
306
|
+
} else {
|
|
307
|
+
if (attrs && (attrs.datasource && !attrs.url || attrs.url && (0, _adfSchema.isSafeUrl)(attrs.url) || attrs.data && attrs.data.url && (0, _adfSchema.isSafeUrl)(attrs.data.url))) {
|
|
308
|
+
return {
|
|
309
|
+
type: type,
|
|
310
|
+
attrs: attrs
|
|
311
|
+
};
|
|
312
|
+
}
|
|
313
|
+
break;
|
|
314
|
+
}
|
|
315
|
+
}
|
|
293
316
|
case 'blockCard':
|
|
294
317
|
{
|
|
295
318
|
if (attrs && (attrs.datasource && !attrs.url || attrs.url && (0, _adfSchema.isSafeUrl)(attrs.url) || attrs.data && attrs.data.url && (0, _adfSchema.isSafeUrl)(attrs.data.url))) {
|
|
@@ -89,17 +89,15 @@ function CategoryListItem({
|
|
|
89
89
|
testId: "element-browser-category-item"
|
|
90
90
|
}, category.title));
|
|
91
91
|
}
|
|
92
|
-
const buttonWrapper = css
|
|
93
|
-
height:
|
|
94
|
-
margin: ${"var(--ds-space-050, 4px)"} ${"var(--ds-space-050, 4px)"}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
:not(:last-child) {
|
|
99
|
-
margin-bottom: 0;
|
|
92
|
+
const buttonWrapper = css({
|
|
93
|
+
height: `${GRID_SIZE * 4}px`,
|
|
94
|
+
margin: `${"var(--ds-space-050, 4px)"} ${"var(--ds-space-050, 4px)"} ${"var(--ds-space-050, 4px)"} 0`,
|
|
95
|
+
[`@media (min-width: ${DEVICE_BREAKPOINT_NUMBERS.medium}px)`]: {
|
|
96
|
+
':not(:last-child)': {
|
|
97
|
+
marginBottom: 0
|
|
100
98
|
}
|
|
101
99
|
}
|
|
102
|
-
|
|
100
|
+
});
|
|
103
101
|
const MemoizedCategoryListWithAnalytics = /*#__PURE__*/memo(withAnalyticsContext({
|
|
104
102
|
component: 'CategoryList'
|
|
105
103
|
})(CategoryList));
|
|
@@ -2,6 +2,7 @@ import { TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
|
2
2
|
// eslint-disable-next-line no-duplicate-imports
|
|
3
3
|
|
|
4
4
|
import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
5
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
5
6
|
const SMART_TO_ASCII = {
|
|
6
7
|
'…': '...',
|
|
7
8
|
'→': '->',
|
|
@@ -96,12 +97,21 @@ export const applyMarkOnRange = (from, to, removeMark, mark, tr) => {
|
|
|
96
97
|
const {
|
|
97
98
|
code
|
|
98
99
|
} = schema.marks;
|
|
100
|
+
const {
|
|
101
|
+
inlineCard
|
|
102
|
+
} = schema.nodes;
|
|
99
103
|
if (mark.type === code) {
|
|
100
104
|
transformSmartCharsMentionsAndEmojis(from, to, tr);
|
|
101
105
|
}
|
|
102
106
|
tr.doc.nodesBetween(tr.mapping.map(from), tr.mapping.map(to), (node, pos) => {
|
|
103
|
-
if (
|
|
104
|
-
|
|
107
|
+
if (getBooleanFF('platform.editor.allow-inline-comments-for-inline-nodes')) {
|
|
108
|
+
if (!node.isText && node.type !== inlineCard) {
|
|
109
|
+
return true;
|
|
110
|
+
}
|
|
111
|
+
} else {
|
|
112
|
+
if (!node.isText) {
|
|
113
|
+
return true;
|
|
114
|
+
}
|
|
105
115
|
}
|
|
106
116
|
|
|
107
117
|
// This is an issue when the user selects some text.
|
|
@@ -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 = "78.12.
|
|
3
|
+
const packageVersion = "78.12.6";
|
|
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
|
|
@@ -7,7 +7,7 @@ import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@
|
|
|
7
7
|
import { N0, N50A, N60A, N900 } from '@atlaskit/theme/colors';
|
|
8
8
|
import Layer from '../Layer';
|
|
9
9
|
const packageName = "@atlaskit/editor-common";
|
|
10
|
-
const packageVersion = "78.12.
|
|
10
|
+
const packageVersion = "78.12.6";
|
|
11
11
|
const halfFocusRing = 1;
|
|
12
12
|
const dropOffset = '0, 8';
|
|
13
13
|
class DropList extends Component {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
1
2
|
export const canApplyAnnotationOnRange = (rangeSelection, doc, schema) => {
|
|
2
3
|
const {
|
|
3
4
|
from,
|
|
@@ -6,19 +7,29 @@ export const canApplyAnnotationOnRange = (rangeSelection, doc, schema) => {
|
|
|
6
7
|
if (isNaN(from + to) || to - from <= 0 || to < 0 || from < 0) {
|
|
7
8
|
return false;
|
|
8
9
|
}
|
|
10
|
+
const {
|
|
11
|
+
inlineCard
|
|
12
|
+
} = schema.nodes;
|
|
9
13
|
let foundInvalid = false;
|
|
10
14
|
doc.nodesBetween(rangeSelection.from, rangeSelection.to, (node, _pos, parent) => {
|
|
11
15
|
// Special exception for hardBreak nodes
|
|
12
16
|
if (schema.nodes.hardBreak === node.type) {
|
|
13
17
|
return false;
|
|
14
18
|
}
|
|
15
|
-
|
|
16
19
|
// For block elements or text nodes, we want to check
|
|
17
20
|
// if annotations are allowed inside this tree
|
|
18
21
|
// or if we're leaf and not text
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
+
|
|
23
|
+
if (getBooleanFF('platform.editor.allow-inline-comments-for-inline-nodes')) {
|
|
24
|
+
if (node.isInline && !node.isText && node.type !== inlineCard || node.isLeaf && !node.isText && node.type !== inlineCard || node.isText && !(parent !== null && parent !== void 0 && parent.type.allowsMarkType(schema.marks.annotation))) {
|
|
25
|
+
foundInvalid = true;
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
} else {
|
|
29
|
+
if (node.isInline && !node.isText || node.isLeaf && !node.isText || node.isText && !(parent !== null && parent !== void 0 && parent.type.allowsMarkType(schema.marks.annotation))) {
|
|
30
|
+
foundInvalid = true;
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
22
33
|
}
|
|
23
34
|
return true;
|
|
24
35
|
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { inlineNodes, isSafeUrl, PanelType, generateUuid as uuid } from '@atlaskit/adf-schema';
|
|
2
2
|
import { defaultSchema } from '@atlaskit/adf-schema/schema-default';
|
|
3
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
3
4
|
export const ADFStages = {
|
|
4
5
|
FINAL: 'final',
|
|
5
6
|
STAGE_0: 'stage0'
|
|
@@ -271,6 +272,30 @@ export const getValidNode = (originalNode, schema = defaultSchema, adfStage = 'f
|
|
|
271
272
|
break;
|
|
272
273
|
}
|
|
273
274
|
case 'inlineCard':
|
|
275
|
+
{
|
|
276
|
+
if (getBooleanFF('platform.editor.allow-inline-comments-for-inline-nodes')) {
|
|
277
|
+
let inlineCardNode = {
|
|
278
|
+
type
|
|
279
|
+
};
|
|
280
|
+
if (attrs && (attrs.datasource && !attrs.url || attrs.url && isSafeUrl(attrs.url) || attrs.data && attrs.data.url && isSafeUrl(attrs.data.url))) {
|
|
281
|
+
inlineCardNode.attrs = {
|
|
282
|
+
...attrs
|
|
283
|
+
};
|
|
284
|
+
}
|
|
285
|
+
if (marks) {
|
|
286
|
+
inlineCardNode.marks = [...marks];
|
|
287
|
+
}
|
|
288
|
+
return inlineCardNode;
|
|
289
|
+
} else {
|
|
290
|
+
if (attrs && (attrs.datasource && !attrs.url || attrs.url && isSafeUrl(attrs.url) || attrs.data && attrs.data.url && isSafeUrl(attrs.data.url))) {
|
|
291
|
+
return {
|
|
292
|
+
type,
|
|
293
|
+
attrs
|
|
294
|
+
};
|
|
295
|
+
}
|
|
296
|
+
break;
|
|
297
|
+
}
|
|
298
|
+
}
|
|
274
299
|
case 'blockCard':
|
|
275
300
|
{
|
|
276
301
|
if (attrs && (attrs.datasource && !attrs.url || attrs.url && isSafeUrl(attrs.url) || attrs.data && attrs.data.url && isSafeUrl(attrs.data.url))) {
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
4
3
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
5
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
6
|
-
var _templateObject;
|
|
7
5
|
var _excluded = ["categories"],
|
|
8
6
|
_excluded2 = ["buttonStyles"];
|
|
9
7
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
@@ -98,7 +96,14 @@ function CategoryListItem(_ref2) {
|
|
|
98
96
|
testId: "element-browser-category-item"
|
|
99
97
|
}, category.title));
|
|
100
98
|
}
|
|
101
|
-
var buttonWrapper = css(
|
|
99
|
+
var buttonWrapper = css(_defineProperty({
|
|
100
|
+
height: "".concat(GRID_SIZE * 4, "px"),
|
|
101
|
+
margin: "var(--ds-space-050, 4px)".concat(" ", "var(--ds-space-050, 4px)", " ", "var(--ds-space-050, 4px)", " 0")
|
|
102
|
+
}, "@media (min-width: ".concat(DEVICE_BREAKPOINT_NUMBERS.medium, "px)"), {
|
|
103
|
+
':not(:last-child)': {
|
|
104
|
+
marginBottom: 0
|
|
105
|
+
}
|
|
106
|
+
}));
|
|
102
107
|
var MemoizedCategoryListWithAnalytics = /*#__PURE__*/memo(withAnalyticsContext({
|
|
103
108
|
component: 'CategoryList'
|
|
104
109
|
})(CategoryList));
|
|
@@ -2,6 +2,7 @@ import { TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
|
2
2
|
// eslint-disable-next-line no-duplicate-imports
|
|
3
3
|
|
|
4
4
|
import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
5
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
5
6
|
var SMART_TO_ASCII = {
|
|
6
7
|
'…': '...',
|
|
7
8
|
'→': '->',
|
|
@@ -82,12 +83,19 @@ export var transformSmartCharsMentionsAndEmojis = function transformSmartCharsMe
|
|
|
82
83
|
export var applyMarkOnRange = function applyMarkOnRange(from, to, removeMark, mark, tr) {
|
|
83
84
|
var schema = tr.doc.type.schema;
|
|
84
85
|
var code = schema.marks.code;
|
|
86
|
+
var inlineCard = schema.nodes.inlineCard;
|
|
85
87
|
if (mark.type === code) {
|
|
86
88
|
transformSmartCharsMentionsAndEmojis(from, to, tr);
|
|
87
89
|
}
|
|
88
90
|
tr.doc.nodesBetween(tr.mapping.map(from), tr.mapping.map(to), function (node, pos) {
|
|
89
|
-
if (
|
|
90
|
-
|
|
91
|
+
if (getBooleanFF('platform.editor.allow-inline-comments-for-inline-nodes')) {
|
|
92
|
+
if (!node.isText && node.type !== inlineCard) {
|
|
93
|
+
return true;
|
|
94
|
+
}
|
|
95
|
+
} else {
|
|
96
|
+
if (!node.isText) {
|
|
97
|
+
return true;
|
|
98
|
+
}
|
|
91
99
|
}
|
|
92
100
|
|
|
93
101
|
// This is an issue when the user selects some text.
|
|
@@ -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 = "78.12.
|
|
9
|
+
var packageVersion = "78.12.6";
|
|
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
|
|
@@ -17,7 +17,7 @@ import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@
|
|
|
17
17
|
import { N0, N50A, N60A, N900 } from '@atlaskit/theme/colors';
|
|
18
18
|
import Layer from '../Layer';
|
|
19
19
|
var packageName = "@atlaskit/editor-common";
|
|
20
|
-
var packageVersion = "78.12.
|
|
20
|
+
var packageVersion = "78.12.6";
|
|
21
21
|
var halfFocusRing = 1;
|
|
22
22
|
var dropOffset = '0, 8';
|
|
23
23
|
var DropList = /*#__PURE__*/function (_Component) {
|
|
@@ -1,22 +1,31 @@
|
|
|
1
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
1
2
|
export var canApplyAnnotationOnRange = function canApplyAnnotationOnRange(rangeSelection, doc, schema) {
|
|
2
3
|
var from = rangeSelection.from,
|
|
3
4
|
to = rangeSelection.to;
|
|
4
5
|
if (isNaN(from + to) || to - from <= 0 || to < 0 || from < 0) {
|
|
5
6
|
return false;
|
|
6
7
|
}
|
|
8
|
+
var inlineCard = schema.nodes.inlineCard;
|
|
7
9
|
var foundInvalid = false;
|
|
8
10
|
doc.nodesBetween(rangeSelection.from, rangeSelection.to, function (node, _pos, parent) {
|
|
9
11
|
// Special exception for hardBreak nodes
|
|
10
12
|
if (schema.nodes.hardBreak === node.type) {
|
|
11
13
|
return false;
|
|
12
14
|
}
|
|
13
|
-
|
|
14
15
|
// For block elements or text nodes, we want to check
|
|
15
16
|
// if annotations are allowed inside this tree
|
|
16
17
|
// or if we're leaf and not text
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
|
|
19
|
+
if (getBooleanFF('platform.editor.allow-inline-comments-for-inline-nodes')) {
|
|
20
|
+
if (node.isInline && !node.isText && node.type !== inlineCard || node.isLeaf && !node.isText && node.type !== inlineCard || node.isText && !(parent !== null && parent !== void 0 && parent.type.allowsMarkType(schema.marks.annotation))) {
|
|
21
|
+
foundInvalid = true;
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
} else {
|
|
25
|
+
if (node.isInline && !node.isText || node.isLeaf && !node.isText || node.isText && !(parent !== null && parent !== void 0 && parent.type.allowsMarkType(schema.marks.annotation))) {
|
|
26
|
+
foundInvalid = true;
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
20
29
|
}
|
|
21
30
|
return true;
|
|
22
31
|
});
|
|
@@ -4,6 +4,7 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
4
4
|
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; }
|
|
5
5
|
import { inlineNodes, isSafeUrl, PanelType, generateUuid as uuid } from '@atlaskit/adf-schema';
|
|
6
6
|
import { defaultSchema } from '@atlaskit/adf-schema/schema-default';
|
|
7
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
7
8
|
export var ADFStages = {
|
|
8
9
|
FINAL: 'final',
|
|
9
10
|
STAGE_0: 'stage0'
|
|
@@ -283,6 +284,28 @@ export var getValidNode = function getValidNode(originalNode) {
|
|
|
283
284
|
break;
|
|
284
285
|
}
|
|
285
286
|
case 'inlineCard':
|
|
287
|
+
{
|
|
288
|
+
if (getBooleanFF('platform.editor.allow-inline-comments-for-inline-nodes')) {
|
|
289
|
+
var inlineCardNode = {
|
|
290
|
+
type: type
|
|
291
|
+
};
|
|
292
|
+
if (attrs && (attrs.datasource && !attrs.url || attrs.url && isSafeUrl(attrs.url) || attrs.data && attrs.data.url && isSafeUrl(attrs.data.url))) {
|
|
293
|
+
inlineCardNode.attrs = _objectSpread({}, attrs);
|
|
294
|
+
}
|
|
295
|
+
if (marks) {
|
|
296
|
+
inlineCardNode.marks = _toConsumableArray(marks);
|
|
297
|
+
}
|
|
298
|
+
return inlineCardNode;
|
|
299
|
+
} else {
|
|
300
|
+
if (attrs && (attrs.datasource && !attrs.url || attrs.url && isSafeUrl(attrs.url) || attrs.data && attrs.data.url && isSafeUrl(attrs.data.url))) {
|
|
301
|
+
return {
|
|
302
|
+
type: type,
|
|
303
|
+
attrs: attrs
|
|
304
|
+
};
|
|
305
|
+
}
|
|
306
|
+
break;
|
|
307
|
+
}
|
|
308
|
+
}
|
|
286
309
|
case 'blockCard':
|
|
287
310
|
{
|
|
288
311
|
if (attrs && (attrs.datasource && !attrs.url || attrs.url && isSafeUrl(attrs.url) || attrs.data && attrs.data.url && isSafeUrl(attrs.data.url))) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "78.12.
|
|
3
|
+
"version": "78.12.6",
|
|
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/"
|
|
@@ -240,6 +240,9 @@
|
|
|
240
240
|
},
|
|
241
241
|
"platform.editor.inline_extension.extended_lcqdn": {
|
|
242
242
|
"type": "boolean"
|
|
243
|
+
},
|
|
244
|
+
"platform.editor.allow-inline-comments-for-inline-nodes": {
|
|
245
|
+
"type": "boolean"
|
|
243
246
|
}
|
|
244
247
|
}
|
|
245
248
|
}
|